How to use the contentful-sdk-core.createRequestConfig function in contentful-sdk-core

To help you get started, we’ve selected a few contentful-sdk-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github contentful / contentful-management.js / lib / create-environment-api.js View on Github external
function getEntrySnapshots (entryId, query = {}) {
    return http.get(`entries/${entryId}/snapshots`, createRequestConfig({query: query}))
      .then((response) => wrapSnapshotCollection(http, response.data), errorHandler)
  }
github contentful / contentful-management.js / lib / create-environment-api.js View on Github external
function getAssets (query = {}) {
    normalizeSelect(query)
    return http.get('assets', createRequestConfig({query: query}))
      .then((response) => wrapAssetCollection(http, response.data), errorHandler)
  }
github contentful / contentful.js / lib / paged-sync.js View on Github external
query.sync_token = query.nextSyncToken
    delete query.nextSyncToken
  }

  if (query.nextPageToken) {
    query.sync_token = query.nextPageToken
    delete query.nextPageToken
  }

  if (query.sync_token) {
    delete query.initial
    delete query.type
    delete query.content_type
  }

  return http.get('sync', createRequestConfig({query: query}))
    .then((response) => {
      const data = response.data
      items = items.concat(data.items)
      if (data.nextPageUrl) {
        if (paginate) {
          delete query.initial
          query.sync_token = getToken(data.nextPageUrl)
          return getSyncPage(http, items, query, { paginate })
        }
        return {
          items: items,
          nextPageToken: getToken(data.nextPageUrl)
        }
      } else if (data.nextSyncUrl) {
        return {
          items: items,
github contentful / contentful-management.js / lib / entities / entry.js View on Github external
getSnapshots: function (query = {}) {
      return http.get(`entries/${this.sys.id}/snapshots`, createRequestConfig({query: query}))
        .then((response) => wrapSnapshotCollection(http, response.data), errorHandler)
    },
github contentful / contentful-management.js / lib / create-space-api.js View on Github external
function getEntries (query = {}) {
    raiseDeprecationWarning('getEntries')
    normalizeSelect(query)
    return http.get('entries', createRequestConfig({query: query}))
      .then((response) => wrapEntryCollection(http, response.data), errorHandler)
  }
github contentful / contentful.js / lib / create-contentful-api.js View on Github external
function getAsset (id, query = {}) {
    switchToEnvironment(http)
    normalizeSelect(query)
    return http.get('assets/' + id, createRequestConfig({query: query}))
      .then((response) => wrapAsset(response.data), errorHandler)
  }
github contentful / contentful-management.js / lib / create-space-api.js View on Github external
function getAsset (id, query = {}) {
    raiseDeprecationWarning('getAsset')
    normalizeSelect(query)
    return http.get('assets/' + id, createRequestConfig({query: query}))
      .then((response) => wrapAsset(http, response.data), errorHandler)
  }
github contentful / contentful-management.js / lib / create-space-api.js View on Github external
function getAssets (query = {}) {
    raiseDeprecationWarning('getAssets')
    normalizeSelect(query)
    return http.get('assets', createRequestConfig({query: query}))
      .then((response) => wrapAssetCollection(http, response.data), errorHandler)
  }
github contentful / contentful-management.js / lib / entities / content-type.js View on Github external
getSnapshots: function (query = {}) {
      return http.get(`content_types/${this.sys.id}/snapshots`, createRequestConfig({query: query}))
        .then((response) => wrapSnapshotCollection(http, response.data), errorHandler)
    },

contentful-sdk-core

Core modules for the Contentful JS SDKs

MIT
Latest version published 1 day ago

Package Health Score

84 / 100
Full package analysis

Similar packages