contentful
Advanced tools
Comparing version 3.3.6 to 3.3.7
// To understand why axios is vendored, check SETUP.md | ||
var axios = require('./vendor-browser/axios') | ||
var axios = require('contentful-sdk-core/vendor-browser/axios') | ||
var contentful = require('./dist/contentful').default | ||
@@ -4,0 +4,0 @@ module.exports = { |
@@ -8,10 +8,20 @@ 'use strict'; | ||
var _createHttpClient = require('./create-http-client'); | ||
var _object = require('lodash/object'); | ||
var _version = require('../version'); | ||
var _version2 = _interopRequireDefault(_version); | ||
var _createHttpClient = require('contentful-sdk-core/create-http-client'); | ||
var _createHttpClient2 = _interopRequireDefault(_createHttpClient); | ||
var _createCdaApi = require('./create-cda-api'); | ||
var _createContentfulApi = require('./create-contentful-api'); | ||
var _createCdaApi2 = _interopRequireDefault(_createCdaApi); | ||
var _createContentfulApi2 = _interopRequireDefault(_createContentfulApi); | ||
var _createLinkResolver = require('./create-link-resolver'); | ||
var _createLinkResolver2 = _interopRequireDefault(_createLinkResolver); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -31,3 +41,3 @@ | ||
* @prop {Object=} params.headers - Optional additional headers | ||
* @returns {CDAClient.ClientAPI} | ||
* @returns {ContentfulClientAPI.ClientAPI} | ||
* @example | ||
@@ -39,8 +49,2 @@ * const client = contentful.createClient({ | ||
*/ | ||
/** | ||
* Contentful CDA SDK. Allows you to create instances of a client with access | ||
* to the Contentful Content Delivery API. | ||
* @namespace contentful | ||
*/ | ||
function createClient(axios, params) { | ||
@@ -57,4 +61,20 @@ if (!params.accessToken) { | ||
var resolveLinks = !!('resolveLinks' in params ? params.resolveLinks : true); | ||
var shouldLinksResolve = (0, _createLinkResolver2.default)(resolveLinks); | ||
return (0, _createCdaApi2.default)((0, _createHttpClient2.default)(axios, params), resolveLinks); | ||
} | ||
params.defaultHostname = 'cdn.contentful.com'; | ||
params.headers = (0, _object.assign)(params.headers, { | ||
'Content-Type': 'application/vnd.contentful.delivery.v1+json', | ||
'X-Contentful-User-Agent': 'contentful.js/' + _version2.default | ||
}); | ||
var http = (0, _createHttpClient2.default)(axios, params); | ||
return (0, _createContentfulApi2.default)({ | ||
http: http, | ||
shouldLinksResolve: shouldLinksResolve | ||
}); | ||
} /** | ||
* Contentful Delivery API SDK. Allows you to create instances of a client | ||
* with access to the Contentful Content Delivery API. | ||
* @namespace contentful | ||
* @see ContentfulClientAPI | ||
*/ |
@@ -6,7 +6,2 @@ 'use strict'; | ||
}); | ||
var _freeze = require('babel-runtime/core-js/object/freeze'); | ||
var _freeze2 = _interopRequireDefault(_freeze); | ||
exports.wrapAsset = wrapAsset; | ||
@@ -17,6 +12,10 @@ exports.wrapAssetCollection = wrapAssetCollection; | ||
var _toPlainObject = require('../mixins/to-plain-object'); | ||
var _toPlainObject = require('contentful-sdk-core/mixins/to-plain-object'); | ||
var _toPlainObject2 = _interopRequireDefault(_toPlainObject); | ||
var _freezeSys = require('contentful-sdk-core/freeze-sys'); | ||
var _freezeSys2 = _interopRequireDefault(_freezeSys); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -46,3 +45,3 @@ | ||
function wrapAsset(data) { | ||
return (0, _freeze2.default)((0, _toPlainObject2.default)((0, _lang.cloneDeep)(data))); | ||
return (0, _freezeSys2.default)((0, _toPlainObject2.default)((0, _lang.cloneDeep)(data))); | ||
} | ||
@@ -66,3 +65,3 @@ | ||
function wrapAssetCollection(data) { | ||
return (0, _freeze2.default)((0, _toPlainObject2.default)((0, _lang.cloneDeep)(data))); | ||
return (0, _freezeSys2.default)((0, _toPlainObject2.default)((0, _lang.cloneDeep)(data))); | ||
} |
@@ -6,7 +6,2 @@ 'use strict'; | ||
}); | ||
var _freeze = require('babel-runtime/core-js/object/freeze'); | ||
var _freeze2 = _interopRequireDefault(_freeze); | ||
exports.wrapContentType = wrapContentType; | ||
@@ -17,6 +12,10 @@ exports.wrapContentTypeCollection = wrapContentTypeCollection; | ||
var _toPlainObject = require('../mixins/to-plain-object'); | ||
var _toPlainObject = require('contentful-sdk-core/mixins/to-plain-object'); | ||
var _toPlainObject2 = _interopRequireDefault(_toPlainObject); | ||
var _freezeSys = require('contentful-sdk-core/freeze-sys'); | ||
var _freezeSys2 = _interopRequireDefault(_freezeSys); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -41,3 +40,3 @@ | ||
function wrapContentType(data) { | ||
return (0, _freeze2.default)((0, _toPlainObject2.default)((0, _lang.cloneDeep)(data))); | ||
return (0, _freezeSys2.default)((0, _toPlainObject2.default)((0, _lang.cloneDeep)(data))); | ||
} | ||
@@ -61,3 +60,3 @@ | ||
function wrapContentTypeCollection(data) { | ||
return (0, _freeze2.default)((0, _toPlainObject2.default)((0, _lang.cloneDeep)(data))); | ||
return (0, _freezeSys2.default)((0, _toPlainObject2.default)((0, _lang.cloneDeep)(data))); | ||
} |
@@ -6,7 +6,2 @@ 'use strict'; | ||
}); | ||
var _freeze = require('babel-runtime/core-js/object/freeze'); | ||
var _freeze2 = _interopRequireDefault(_freeze); | ||
exports.wrapEntry = wrapEntry; | ||
@@ -19,6 +14,10 @@ exports.wrapEntryCollection = wrapEntryCollection; | ||
var _toPlainObject = require('../mixins/to-plain-object'); | ||
var _toPlainObject = require('contentful-sdk-core/mixins/to-plain-object'); | ||
var _toPlainObject2 = _interopRequireDefault(_toPlainObject); | ||
var _freezeSys = require('contentful-sdk-core/freeze-sys'); | ||
var _freezeSys2 = _interopRequireDefault(_freezeSys); | ||
var _linkGetters = require('../mixins/link-getters'); | ||
@@ -35,3 +34,58 @@ | ||
/** | ||
* Types of fields found in an Entry | ||
* @namespace EntryFields | ||
*/ | ||
/** | ||
* @memberof EntryFields | ||
* @typedef Symbol | ||
* @type string | ||
*/ | ||
/** | ||
* @memberof EntryFields | ||
* @typedef Text | ||
* @type string | ||
*/ | ||
/** | ||
* @memberof EntryFields | ||
* @typedef Integer | ||
* @type number | ||
*/ | ||
/** | ||
* @memberof EntryFields | ||
* @typedef Number | ||
* @type number | ||
*/ | ||
/** | ||
* @memberof EntryFields | ||
* @typedef Date | ||
* @type string | ||
*/ | ||
/** | ||
* @memberof EntryFields | ||
* @typedef Boolean | ||
* @type boolean | ||
*/ | ||
/** | ||
* @memberof EntryFields | ||
* @typedef Location | ||
* @prop {string} lat - latitude | ||
* @prop {string} lon - longitude | ||
*/ | ||
/** | ||
* A Field in an Entry can have one of the following types that can be defined in Contentful. See <a href="https://www.contentful.com/developers/docs/references/field-type/">Field Types</a> for more details. | ||
* @memberof Entities | ||
* @typedef Field | ||
* @type EntryFields.Symbol | EntryFields.Text | EntryFields.Integer | EntryFields.Number | EntryFields.Date | EntryFields.Boolean | EntryFields.Location | Entities.Link | Array<EntryFields.Symbol|Entities.Link> | Object | ||
*/ | ||
/** | ||
* @memberof Entities | ||
* @typedef Entry | ||
@@ -51,3 +105,3 @@ * @prop {Entities.Sys} sys - Standard system metadata with additional entry specific properties | ||
function wrapEntry(data) { | ||
return (0, _freeze2.default)((0, _toPlainObject2.default)((0, _lang.cloneDeep)(data))); | ||
return (0, _freezeSys2.default)((0, _toPlainObject2.default)((0, _lang.cloneDeep)(data))); | ||
} | ||
@@ -80,3 +134,3 @@ | ||
} | ||
return (0, _freeze2.default)(wrappedData); | ||
return (0, _freezeSys2.default)(wrappedData); | ||
} | ||
@@ -83,0 +137,0 @@ |
@@ -6,13 +6,12 @@ 'use strict'; | ||
}); | ||
exports.wrapSpace = wrapSpace; | ||
var _freeze = require('babel-runtime/core-js/object/freeze'); | ||
var _toPlainObject = require('contentful-sdk-core/mixins/to-plain-object'); | ||
var _freeze2 = _interopRequireDefault(_freeze); | ||
var _toPlainObject2 = _interopRequireDefault(_toPlainObject); | ||
exports.wrapSpace = wrapSpace; | ||
var _freezeSys = require('contentful-sdk-core/freeze-sys'); | ||
var _toPlainObject = require('../mixins/to-plain-object'); | ||
var _freezeSys2 = _interopRequireDefault(_freezeSys); | ||
var _toPlainObject2 = _interopRequireDefault(_toPlainObject); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -37,3 +36,3 @@ | ||
function wrapSpace(data) { | ||
return (0, _freeze2.default)((0, _toPlainObject2.default)(data)); | ||
return (0, _freezeSys2.default)((0, _toPlainObject2.default)(data)); | ||
} |
// To understand why axios is vendored, check SETUP.md | ||
var axios = require('./vendor-node/axios') | ||
var axios = require('contentful-sdk-core/vendor-node/axios') | ||
var contentful | ||
@@ -4,0 +4,0 @@ try { |
@@ -15,10 +15,12 @@ { | ||
"clean": "rimraf dist && rimraf browser-dist && rimraf coverage && rimraf out", | ||
"build": "npm run clean && npm run vendor && npm run build:dist && npm run build:standalone", | ||
"build": "npm run clean && npm run vendor:version && npm run build:dist && npm run build:standalone", | ||
"build:dist": "babel lib --out-dir dist", | ||
"build:standalone": "webpack && webpack -p --output-filename contentful.min.js", | ||
"docs:build": "jsdoc -r -c jsdoc.json dist", | ||
"link-dev-deps": "mkdirp node_modules && ln -s ../../contentful-sdk-core/src node_modules/contentful-sdk-core", | ||
"unlink-dev-deps": "rimraf node_modules/contentful-sdk-core", | ||
"docs:build": "jsdoc -r -c ./node_modules/contentful-sdk-jsdoc/jsdoc.json dist", | ||
"docs:dev": "npm run build && npm run docs:build", | ||
"docs:watch": "watchy -w lib,jsdoc-template npm run docs:dev", | ||
"docs:publish": "npm run docs:build && ./bin/publish-docs.sh", | ||
"test:ci": "npm run test:cover && npm run build && npm run test:integration && ./bin/run-if-node-version.js && npm run test:browser-remote || true", | ||
"docs:watch": "watchy -w lib npm run docs:dev", | ||
"docs:publish": "npm run docs:build && ./node_modules/contentful-sdk-jsdoc/bin/publish-docs.sh contentful.js contentful", | ||
"test:ci": "npm run test:cover && npm run build && npm run test:integration && ./node_modules/contentful-sdk-core/bin/run-if-node-version.js && npm run test:browser-remote || true", | ||
"test:cover": "BABEL_ENV=test babel-node ./node_modules/istanbul/lib/cli.js cover test/runner", | ||
@@ -30,5 +32,2 @@ "test:only": "BABEL_ENV=test babel-node ./test/runner", | ||
"test:browser-remote": "BABEL_ENV=test ./node_modules/.bin/karma start karma.conf.saucelabs.js", | ||
"vendor": "npm run vendor:node && npm run vendor:browser && npm run vendor:version", | ||
"vendor:node": "rimraf vendor-node && mkdirp vendor-node && babel node_modules/axios/lib/ --out-dir vendor-node/", | ||
"vendor:browser": "rimraf vendor-browser && mkdirp vendor-browser && babel node_modules/axios/dist/axios.js --out-file vendor-browser/axios.js", | ||
"vendor:version": "echo \"module.exports = '`cat package.json|json version`'\" > version.js", | ||
@@ -38,3 +37,3 @@ "browser-coverage": "npm run test:cover && opener coverage/lcov-report/index.html", | ||
"postpublish": "npm run docs:publish && npm run clean", | ||
"pretest": "standard lib/*.js && standard lib/**/*.js", | ||
"pretest": "standard lib/*.js && standard lib/**/*.js && standard test/**/*.js", | ||
"test": "npm run test:cover && npm run test:integration && npm run test:browser-local", | ||
@@ -50,4 +49,2 @@ "semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
"browser-dist", | ||
"vendor-browser", | ||
"vendor-node", | ||
"tonic-example.js" | ||
@@ -57,6 +54,5 @@ ], | ||
"babel-runtime": "^6.3.19", | ||
"follow-redirects": "0.0.7", | ||
"contentful-sdk-core": "^2.1.0", | ||
"json-stringify-safe": "^5.0.1", | ||
"lodash": "^4.2.0", | ||
"qs": "^6.1.0" | ||
"lodash": "^4.2.0" | ||
}, | ||
@@ -66,3 +62,3 @@ "devDependencies": { | ||
"babel-cli": "^6.4.5", | ||
"babel-eslint": "^5.0.0-beta8", | ||
"babel-eslint": "^6.0.3", | ||
"babel-loader": "^6.2.2", | ||
@@ -74,2 +70,3 @@ "babel-plugin-rewire": "^1.0.0-beta-5", | ||
"blue-tape": "^0.2.0", | ||
"contentful-sdk-jsdoc": "^1.2.0", | ||
"coveralls": "^2.11.6", | ||
@@ -94,3 +91,3 @@ "cz-conventional-changelog": "^1.1.5", | ||
"sinon": "^2.0.0-pre", | ||
"standard": "^5.4.1", | ||
"standard": "^6.0.8", | ||
"webpack": "^1.12.13" | ||
@@ -106,3 +103,3 @@ }, | ||
}, | ||
"version": "3.3.6" | ||
"version": "3.3.7" | ||
} |
@@ -1,1 +0,1 @@ | ||
module.exports = '3.3.6' | ||
module.exports = '3.3.7' |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4
806164
31
20
20590
+ Addedcontentful-sdk-core@^2.1.0
+ Addedcontentful-sdk-core@2.5.0(transitive)
+ Addedgopd@1.1.0(transitive)
- Removedfollow-redirects@0.0.7
- Removedqs@^6.1.0
- Removedgopd@1.0.1(transitive)