contentful-management 7.3.3 → 7.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -2
- package/dist/contentful-management.browser.js +840 -3576
- package/dist/contentful-management.browser.js.map +1 -1
- package/dist/contentful-management.browser.min.js +1 -1
- package/dist/contentful-management.legacy.js +833 -3569
- package/dist/contentful-management.legacy.js.map +1 -1
- package/dist/contentful-management.legacy.min.js +1 -1
- package/dist/contentful-management.node.js +784 -3579
- package/dist/contentful-management.node.js.map +1 -1
- package/dist/contentful-management.node.min.js +1 -1
- package/dist/es-modules/common-utils.js +2 -2
- package/dist/es-modules/create-cma-http-client.js +4 -4
- package/dist/es-modules/entities/api-key.js +2 -2
- package/dist/es-modules/entities/app-definition.js +2 -2
- package/dist/es-modules/entities/app-installation.js +2 -2
- package/dist/es-modules/entities/asset.js +2 -2
- package/dist/es-modules/entities/content-type.js +2 -2
- package/dist/es-modules/entities/editor-interface.js +2 -2
- package/dist/es-modules/entities/entry.js +2 -2
- package/dist/es-modules/entities/environment-alias.js +2 -2
- package/dist/es-modules/entities/environment.js +2 -2
- package/dist/es-modules/entities/locale.js +2 -2
- package/dist/es-modules/entities/organization-invitation.js +2 -2
- package/dist/es-modules/entities/organization-membership.js +2 -2
- package/dist/es-modules/entities/organization.js +2 -2
- package/dist/es-modules/entities/personal-access-token.js +2 -2
- package/dist/es-modules/entities/preview-api-key.js +2 -2
- package/dist/es-modules/entities/role.js +2 -2
- package/dist/es-modules/entities/scheduled-action.js +2 -2
- package/dist/es-modules/entities/snapshot.js +2 -2
- package/dist/es-modules/entities/space-member.js +2 -2
- package/dist/es-modules/entities/space-membership.js +2 -2
- package/dist/es-modules/entities/space.js +2 -2
- package/dist/es-modules/entities/tag.js +2 -2
- package/dist/es-modules/entities/team-membership.js +2 -2
- package/dist/es-modules/entities/team-space-membership.js +2 -2
- package/dist/es-modules/entities/team.js +2 -2
- package/dist/es-modules/entities/ui-extension.js +2 -2
- package/dist/es-modules/entities/upload.js +2 -2
- package/dist/es-modules/entities/usage.js +2 -2
- package/dist/es-modules/entities/user.js +2 -2
- package/dist/es-modules/entities/webhook.js +2 -2
- package/dist/es-modules/error-handler.js +5 -4
- package/dist/es-modules/plain/as-iterator.js +10 -7
- package/dist/es-modules/plain/endpoints/api-key.js +2 -2
- package/dist/es-modules/plain/endpoints/app-definition.js +3 -3
- package/dist/es-modules/plain/endpoints/app-installation.js +2 -4
- package/dist/es-modules/plain/endpoints/asset.js +4 -4
- package/dist/es-modules/plain/endpoints/content-type.js +4 -4
- package/dist/es-modules/plain/endpoints/editor-interface.js +2 -2
- package/dist/es-modules/plain/endpoints/entry.js +4 -4
- package/dist/es-modules/plain/endpoints/environment-alias.js +3 -3
- package/dist/es-modules/plain/endpoints/environment.js +4 -4
- package/dist/es-modules/plain/endpoints/locale.js +2 -2
- package/dist/es-modules/plain/endpoints/organization-membership.js +2 -2
- package/dist/es-modules/plain/endpoints/role.js +2 -2
- package/dist/es-modules/plain/endpoints/space-membership.js +2 -2
- package/dist/es-modules/plain/endpoints/space.js +2 -2
- package/dist/es-modules/plain/endpoints/tag.js +3 -3
- package/dist/es-modules/plain/endpoints/team-membership.js +2 -2
- package/dist/es-modules/plain/endpoints/team-space-membership.js +2 -2
- package/dist/es-modules/plain/endpoints/team.js +2 -2
- package/dist/es-modules/plain/endpoints/ui-extension.js +3 -5
- package/dist/es-modules/plain/endpoints/webhook.js +4 -7
- package/dist/es-modules/upload-http-client.js +4 -5
- package/dist/typings/common-utils.d.ts +1 -1
- package/dist/typings/create-cma-http-client.d.ts +4 -67
- package/dist/typings/create-contentful-api.d.ts +2 -1
- package/dist/typings/create-environment-api.d.ts +1 -1
- package/dist/typings/create-organization-api.d.ts +1 -1
- package/dist/typings/create-space-api.d.ts +1 -1
- package/dist/typings/entities/api-key.d.ts +1 -1
- package/dist/typings/entities/app-definition.d.ts +1 -1
- package/dist/typings/entities/app-installation.d.ts +1 -1
- package/dist/typings/entities/asset.d.ts +1 -1
- package/dist/typings/entities/content-type.d.ts +1 -1
- package/dist/typings/entities/editor-interface.d.ts +1 -1
- package/dist/typings/entities/entry.d.ts +1 -1
- package/dist/typings/entities/environment-alias.d.ts +1 -1
- package/dist/typings/entities/environment.d.ts +1 -1
- package/dist/typings/entities/locale.d.ts +1 -1
- package/dist/typings/entities/organization-invitation.d.ts +1 -1
- package/dist/typings/entities/organization-membership.d.ts +1 -1
- package/dist/typings/entities/organization.d.ts +1 -1
- package/dist/typings/entities/personal-access-token.d.ts +1 -1
- package/dist/typings/entities/preview-api-key.d.ts +1 -1
- package/dist/typings/entities/role.d.ts +1 -1
- package/dist/typings/entities/scheduled-action.d.ts +1 -1
- package/dist/typings/entities/snapshot.d.ts +1 -1
- package/dist/typings/entities/space-member.d.ts +1 -1
- package/dist/typings/entities/space-membership.d.ts +1 -1
- package/dist/typings/entities/space.d.ts +1 -1
- package/dist/typings/entities/tag.d.ts +1 -1
- package/dist/typings/entities/team-membership.d.ts +1 -1
- package/dist/typings/entities/team-space-membership.d.ts +1 -1
- package/dist/typings/entities/team.d.ts +1 -1
- package/dist/typings/entities/ui-extension.d.ts +1 -1
- package/dist/typings/entities/upload.d.ts +1 -1
- package/dist/typings/entities/usage.d.ts +1 -1
- package/dist/typings/entities/user.d.ts +1 -1
- package/dist/typings/entities/webhook.d.ts +1 -1
- package/dist/typings/plain/endpoints/api-key.d.ts +1 -1
- package/dist/typings/plain/endpoints/app-definition.d.ts +1 -1
- package/dist/typings/plain/endpoints/app-installation.d.ts +1 -1
- package/dist/typings/plain/endpoints/asset.d.ts +1 -1
- package/dist/typings/plain/endpoints/content-type.d.ts +1 -1
- package/dist/typings/plain/endpoints/editor-interface.d.ts +1 -1
- package/dist/typings/plain/endpoints/entry.d.ts +1 -1
- package/dist/typings/plain/endpoints/environment-alias.d.ts +1 -1
- package/dist/typings/plain/endpoints/environment.d.ts +1 -1
- package/dist/typings/plain/endpoints/locale.d.ts +1 -1
- package/dist/typings/plain/endpoints/organization-invitation.d.ts +1 -1
- package/dist/typings/plain/endpoints/organization-membership.d.ts +1 -1
- package/dist/typings/plain/endpoints/organization.d.ts +1 -1
- package/dist/typings/plain/endpoints/personal-access-token.d.ts +1 -1
- package/dist/typings/plain/endpoints/preview-api-keys.d.ts +1 -1
- package/dist/typings/plain/endpoints/role.d.ts +1 -1
- package/dist/typings/plain/endpoints/scheduled-action.d.ts +1 -1
- package/dist/typings/plain/endpoints/snapshot.d.ts +1 -1
- package/dist/typings/plain/endpoints/space-member.d.ts +1 -1
- package/dist/typings/plain/endpoints/space-membership.d.ts +1 -1
- package/dist/typings/plain/endpoints/space.d.ts +1 -1
- package/dist/typings/plain/endpoints/tag.d.ts +1 -1
- package/dist/typings/plain/endpoints/team-membership.d.ts +1 -1
- package/dist/typings/plain/endpoints/team-space-membership.d.ts +1 -1
- package/dist/typings/plain/endpoints/team.d.ts +1 -1
- package/dist/typings/plain/endpoints/ui-extension.d.ts +1 -1
- package/dist/typings/plain/endpoints/upload.d.ts +1 -1
- package/dist/typings/plain/endpoints/usage.d.ts +1 -1
- package/dist/typings/plain/endpoints/user.d.ts +1 -1
- package/dist/typings/plain/endpoints/webhook.d.ts +1 -1
- package/dist/typings/plain/plain-client.d.ts +2 -2
- package/dist/typings/plain/wrappers/wrap.d.ts +1 -1
- package/dist/typings/upload-http-client.d.ts +1 -1
- package/package.json +8 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/ban-ts-ignore */
|
|
2
|
-
import
|
|
2
|
+
import copy from 'fast-copy';
|
|
3
3
|
import { toPlainObject } from 'contentful-sdk-core';
|
|
4
4
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
5
|
export var wrapCollection = function wrapCollection(fn) {
|
|
@@ -8,7 +8,7 @@ export var wrapCollection = function wrapCollection(fn) {
|
|
|
8
8
|
rest[_key - 2] = arguments[_key];
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
var collectionData = toPlainObject(
|
|
11
|
+
var collectionData = toPlainObject(copy(data)); // @ts-ignore
|
|
12
12
|
|
|
13
13
|
collectionData.items = collectionData.items.map(function (entity) {
|
|
14
14
|
return fn.apply(void 0, [http, entity].concat(rest));
|
|
@@ -10,7 +10,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
10
10
|
*/
|
|
11
11
|
import axios from 'axios';
|
|
12
12
|
import { createHttpClient, getUserAgentHeader } from 'contentful-sdk-core';
|
|
13
|
-
import
|
|
13
|
+
import copy from 'fast-copy';
|
|
14
14
|
export var defaultHostParameters = {
|
|
15
15
|
defaultHostname: 'api.contentful.com',
|
|
16
16
|
defaultHostnameUpload: 'upload.contentful.com'
|
|
@@ -23,17 +23,17 @@ export function createCMAHttpClient(params) {
|
|
|
23
23
|
var plainClient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
24
24
|
var sdkMain = plainClient ? 'contentful-management-plain.js' : 'contentful-management.js';
|
|
25
25
|
var userAgentHeader = getUserAgentHeader( // @ts-expect-error
|
|
26
|
-
"".concat(sdkMain, "/").concat("7.
|
|
26
|
+
"".concat(sdkMain, "/").concat("7.5.2"), params.application, params.integration, params.feature);
|
|
27
27
|
var requiredHeaders = {
|
|
28
28
|
'Content-Type': 'application/vnd.contentful.management.v1+json',
|
|
29
29
|
'X-Contentful-User-Agent': userAgentHeader
|
|
30
30
|
};
|
|
31
|
-
params = _objectSpread(_objectSpread({}, defaultHostParameters),
|
|
31
|
+
params = _objectSpread(_objectSpread({}, defaultHostParameters), copy(params));
|
|
32
32
|
|
|
33
33
|
if (!params.accessToken) {
|
|
34
34
|
throw new TypeError('Expected parameter accessToken');
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
params.headers = _objectSpread(_objectSpread({}, params.headers)
|
|
37
|
+
params.headers = _objectSpread(_objectSpread({}, requiredHeaders), params.headers);
|
|
38
38
|
return createHttpClient(axios, params);
|
|
39
39
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import { wrapCollection } from '../common-utils';
|
|
@@ -35,7 +35,7 @@ function createApiKeyApi(http) {
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
export function wrapApiKey(http, data) {
|
|
38
|
-
var apiKey = toPlainObject(
|
|
38
|
+
var apiKey = toPlainObject(copy(data));
|
|
39
39
|
var apiKeyWithMethods = enhanceWithMethods(apiKey, createApiKeyApi(http));
|
|
40
40
|
return freezeSys(apiKeyWithMethods);
|
|
41
41
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import { wrapCollection } from '../common-utils';
|
|
@@ -34,7 +34,7 @@ function createAppDefinitionApi(http) {
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
export function wrapAppDefinition(http, data) {
|
|
37
|
-
var appDefinition = toPlainObject(
|
|
37
|
+
var appDefinition = toPlainObject(copy(data));
|
|
38
38
|
var appDefinitionWithMethods = enhanceWithMethods(appDefinition, createAppDefinitionApi(http));
|
|
39
39
|
return freezeSys(appDefinitionWithMethods);
|
|
40
40
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toPlainObject, freezeSys } from 'contentful-sdk-core';
|
|
2
|
-
import
|
|
2
|
+
import copy from 'fast-copy';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import { wrapCollection } from '../common-utils';
|
|
5
5
|
import * as endpoints from '../plain/endpoints';
|
|
@@ -35,7 +35,7 @@ function createAppInstallationApi(http) {
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
export function wrapAppInstallation(http, data) {
|
|
38
|
-
var appInstallation = toPlainObject(
|
|
38
|
+
var appInstallation = toPlainObject(copy(data));
|
|
39
39
|
var appInstallationWithMethods = enhanceWithMethods(appInstallation, createAppInstallationApi(http));
|
|
40
40
|
return freezeSys(appInstallationWithMethods);
|
|
41
41
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import { wrapCollection } from '../common-utils';
|
|
@@ -88,7 +88,7 @@ function createAssetApi(http) {
|
|
|
88
88
|
|
|
89
89
|
|
|
90
90
|
export function wrapAsset(http, data) {
|
|
91
|
-
var asset = toPlainObject(
|
|
91
|
+
var asset = toPlainObject(copy(data));
|
|
92
92
|
var assetWithMethods = enhanceWithMethods(asset, createAssetApi(http));
|
|
93
93
|
return freezeSys(assetWithMethods);
|
|
94
94
|
}
|
|
@@ -4,7 +4,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import copy from 'fast-copy';
|
|
8
8
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
9
9
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
10
10
|
import { wrapCollection } from '../common-utils';
|
|
@@ -119,7 +119,7 @@ function createContentTypeApi(http) {
|
|
|
119
119
|
|
|
120
120
|
|
|
121
121
|
export function wrapContentType(http, data) {
|
|
122
|
-
var contentType = toPlainObject(
|
|
122
|
+
var contentType = toPlainObject(copy(data));
|
|
123
123
|
var contentTypeWithMethods = enhanceWithMethods(contentType, createContentTypeApi(http));
|
|
124
124
|
return freezeSys(contentTypeWithMethods);
|
|
125
125
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import { wrapCollection } from '../common-utils';
|
|
@@ -32,7 +32,7 @@ function createEditorInterfaceApi(http) {
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
export function wrapEditorInterface(http, data) {
|
|
35
|
-
var editorInterface = toPlainObject(
|
|
35
|
+
var editorInterface = toPlainObject(copy(data));
|
|
36
36
|
var editorInterfaceWithMethods = enhanceWithMethods(editorInterface, createEditorInterfaceApi(http));
|
|
37
37
|
return freezeSys(editorInterfaceWithMethods);
|
|
38
38
|
}
|
|
@@ -4,7 +4,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import copy from 'fast-copy';
|
|
8
8
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
9
9
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
10
10
|
import { wrapCollection } from '../common-utils';
|
|
@@ -123,7 +123,7 @@ function createEntryApi(http) {
|
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
export function wrapEntry(http, data) {
|
|
126
|
-
var entry = toPlainObject(
|
|
126
|
+
var entry = toPlainObject(copy(data));
|
|
127
127
|
var entryWithMethods = enhanceWithMethods(entry, createEntryApi(http));
|
|
128
128
|
return freezeSys(entryWithMethods);
|
|
129
129
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import { wrapCollection } from '../common-utils';
|
|
@@ -35,7 +35,7 @@ function createEnvironmentAliasApi(http) {
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
export function wrapEnvironmentAlias(http, data) {
|
|
38
|
-
var alias = toPlainObject(
|
|
38
|
+
var alias = toPlainObject(copy(data));
|
|
39
39
|
var enhancedAlias = enhanceWithMethods(alias, createEnvironmentAliasApi(http));
|
|
40
40
|
return freezeSys(enhancedAlias);
|
|
41
41
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import createEnvironmentApi from '../create-environment-api';
|
|
@@ -16,7 +16,7 @@ import { wrapCollection } from '../common-utils';
|
|
|
16
16
|
*/
|
|
17
17
|
export function wrapEnvironment(http, data) {
|
|
18
18
|
// do not pollute generated typings
|
|
19
|
-
var environment = toPlainObject(
|
|
19
|
+
var environment = toPlainObject(copy(data));
|
|
20
20
|
var environmentApi = createEnvironmentApi({
|
|
21
21
|
http: http
|
|
22
22
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import { wrapCollection } from '../common-utils';
|
|
@@ -39,7 +39,7 @@ export function wrapLocale(http, data) {
|
|
|
39
39
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
40
40
|
// @ts-ignore
|
|
41
41
|
delete data.internal_code;
|
|
42
|
-
var locale = toPlainObject(
|
|
42
|
+
var locale = toPlainObject(copy(data));
|
|
43
43
|
var localeWithMethods = enhanceWithMethods(locale, createLocaleApi(http));
|
|
44
44
|
return freezeSys(localeWithMethods);
|
|
45
45
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -8,6 +8,6 @@ import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
|
8
8
|
* @return {OrganizationInvitation} Wrapped Inviation data
|
|
9
9
|
*/
|
|
10
10
|
export function wrapOrganizationInvitation(_http, data) {
|
|
11
|
-
var invitation = toPlainObject(
|
|
11
|
+
var invitation = toPlainObject(copy(data));
|
|
12
12
|
return freezeSys(invitation);
|
|
13
13
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import { wrapCollection } from '../common-utils';
|
|
@@ -34,7 +34,7 @@ function createOrganizationMembershipApi(http, organizationId) {
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
export function wrapOrganizationMembership(http, data, organizationId) {
|
|
37
|
-
var organizationMembership = toPlainObject(
|
|
37
|
+
var organizationMembership = toPlainObject(copy(data));
|
|
38
38
|
var organizationMembershipWithMethods = enhanceWithMethods(organizationMembership, createOrganizationMembershipApi(http, organizationId));
|
|
39
39
|
return freezeSys(organizationMembershipWithMethods);
|
|
40
40
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import createOrganizationApi from '../create-organization-api';
|
|
@@ -15,7 +15,7 @@ import { wrapCollection } from '../common-utils';
|
|
|
15
15
|
* @return {Organization}
|
|
16
16
|
*/
|
|
17
17
|
export function wrapOrganization(http, data) {
|
|
18
|
-
var org = toPlainObject(
|
|
18
|
+
var org = toPlainObject(copy(data));
|
|
19
19
|
var orgApi = createOrganizationApi({
|
|
20
20
|
http: http
|
|
21
21
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import { wrapCollection } from '../common-utils';
|
|
@@ -11,7 +11,7 @@ import * as endpoints from '../plain/endpoints';
|
|
|
11
11
|
* @return Wrapped personal access token
|
|
12
12
|
*/
|
|
13
13
|
export function wrapPersonalAccessToken(http, data) {
|
|
14
|
-
var personalAccessToken = toPlainObject(
|
|
14
|
+
var personalAccessToken = toPlainObject(copy(data));
|
|
15
15
|
var personalAccessTokenWithMethods = enhanceWithMethods(personalAccessToken, {
|
|
16
16
|
revoke: function revoke() {
|
|
17
17
|
return endpoints.personalAccessToken.revoke(http, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import { wrapCollection } from '../common-utils';
|
|
@@ -15,7 +15,7 @@ function createPreviewApiKeyApi() {
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
export function wrapPreviewApiKey(_http, data) {
|
|
18
|
-
var previewApiKey = toPlainObject(
|
|
18
|
+
var previewApiKey = toPlainObject(copy(data));
|
|
19
19
|
var previewApiKeyWithMethods = enhanceWithMethods(previewApiKey, createPreviewApiKeyApi());
|
|
20
20
|
return freezeSys(previewApiKeyWithMethods);
|
|
21
21
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import { wrapCollection } from '../common-utils';
|
|
@@ -34,7 +34,7 @@ function createRoleApi(http) {
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
export function wrapRole(http, data) {
|
|
37
|
-
var role = toPlainObject(
|
|
37
|
+
var role = toPlainObject(copy(data));
|
|
38
38
|
var roleWithMethods = enhanceWithMethods(role, createRoleApi(http));
|
|
39
39
|
return freezeSys(roleWithMethods);
|
|
40
40
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _cloneDeep from "lodash/cloneDeep";
|
|
2
1
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
2
|
+
import copy from 'fast-copy';
|
|
3
3
|
import { wrapCollection } from '../common-utils';
|
|
4
4
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
5
5
|
import * as endpoints from '../plain/endpoints';
|
|
@@ -34,7 +34,7 @@ export default function createScheduledActionApi(http) {
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
export function wrapScheduledAction(http, data) {
|
|
37
|
-
var scheduledAction = toPlainObject(
|
|
37
|
+
var scheduledAction = toPlainObject(copy(data));
|
|
38
38
|
var scheduledActionWithMethods = enhanceWithMethods(scheduledAction, createScheduledActionApi(http));
|
|
39
39
|
return freezeSys(scheduledActionWithMethods);
|
|
40
40
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import { wrapCollection } from '../common-utils';
|
|
@@ -17,7 +17,7 @@ function createSnapshotApi() {
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
export function wrapSnapshot(_http, data) {
|
|
20
|
-
var snapshot = toPlainObject(
|
|
20
|
+
var snapshot = toPlainObject(copy(data));
|
|
21
21
|
var snapshotWithMethods = enhanceWithMethods(snapshot, createSnapshotApi());
|
|
22
22
|
return freezeSys(snapshotWithMethods);
|
|
23
23
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import { wrapCollection } from '../common-utils';
|
|
4
4
|
|
|
@@ -9,7 +9,7 @@ import { wrapCollection } from '../common-utils';
|
|
|
9
9
|
* @return Wrapped space member data
|
|
10
10
|
*/
|
|
11
11
|
export function wrapSpaceMember(http, data) {
|
|
12
|
-
var spaceMember = toPlainObject(
|
|
12
|
+
var spaceMember = toPlainObject(copy(data));
|
|
13
13
|
return freezeSys(spaceMember);
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import { wrapCollection } from '../common-utils';
|
|
@@ -34,7 +34,7 @@ function createSpaceMembershipApi(http) {
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
export function wrapSpaceMembership(http, data) {
|
|
37
|
-
var spaceMembership = toPlainObject(
|
|
37
|
+
var spaceMembership = toPlainObject(copy(data));
|
|
38
38
|
var spaceMembershipWithMethods = enhanceWithMethods(spaceMembership, createSpaceMembershipApi(http));
|
|
39
39
|
return freezeSys(spaceMembershipWithMethods);
|
|
40
40
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import { wrapCollection } from '../common-utils';
|
|
@@ -15,7 +15,7 @@ import createSpaceApi from '../create-space-api';
|
|
|
15
15
|
* @return {Space}
|
|
16
16
|
*/
|
|
17
17
|
export function wrapSpace(http, data) {
|
|
18
|
-
var space = toPlainObject(
|
|
18
|
+
var space = toPlainObject(copy(data));
|
|
19
19
|
var spaceApi = createSpaceApi({
|
|
20
20
|
http: http
|
|
21
21
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _cloneDeep from "lodash/cloneDeep";
|
|
2
1
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
2
|
+
import copy from 'fast-copy';
|
|
3
3
|
import { wrapCollection } from '../common-utils';
|
|
4
4
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
5
5
|
import * as endpoints from '../plain/endpoints';
|
|
@@ -27,7 +27,7 @@ export default function createTagApi(http) {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
export function wrapTag(http, data) {
|
|
30
|
-
var tag = toPlainObject(
|
|
30
|
+
var tag = toPlainObject(copy(data));
|
|
31
31
|
var tagWithMethods = enhanceWithMethods(tag, createTagApi(http));
|
|
32
32
|
return freezeSys(tagWithMethods);
|
|
33
33
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import { wrapCollection } from '../common-utils';
|
|
@@ -35,7 +35,7 @@ function createTeamMembershipApi(http) {
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
export function wrapTeamMembership(http, data) {
|
|
38
|
-
var teamMembership = toPlainObject(
|
|
38
|
+
var teamMembership = toPlainObject(copy(data));
|
|
39
39
|
var teamMembershipWithMethods = enhanceWithMethods(teamMembership, createTeamMembershipApi(http));
|
|
40
40
|
return freezeSys(teamMembershipWithMethods);
|
|
41
41
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import { wrapCollection } from '../common-utils';
|
|
@@ -34,7 +34,7 @@ function createTeamSpaceMembershipApi(http) {
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
export function wrapTeamSpaceMembership(http, data) {
|
|
37
|
-
var teamSpaceMembership = toPlainObject(
|
|
37
|
+
var teamSpaceMembership = toPlainObject(copy(data));
|
|
38
38
|
var teamSpaceMembershipWithMethods = enhanceWithMethods(teamSpaceMembership, createTeamSpaceMembershipApi(http));
|
|
39
39
|
return freezeSys(teamSpaceMembershipWithMethods);
|
|
40
40
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import { wrapCollection } from '../common-utils';
|
|
@@ -37,7 +37,7 @@ function createTeamApi(http) {
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
export function wrapTeam(http, data) {
|
|
40
|
-
var team = toPlainObject(
|
|
40
|
+
var team = toPlainObject(copy(data));
|
|
41
41
|
var teamWithMethods = enhanceWithMethods(team, createTeamApi(http));
|
|
42
42
|
return freezeSys(teamWithMethods);
|
|
43
43
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import * as endpoints from '../plain/endpoints';
|
|
@@ -35,7 +35,7 @@ function createUiExtensionApi(http) {
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
export function wrapUiExtension(http, data) {
|
|
38
|
-
var uiExtension = toPlainObject(
|
|
38
|
+
var uiExtension = toPlainObject(copy(data));
|
|
39
39
|
var uiExtensionWithMethods = enhanceWithMethods(uiExtension, createUiExtensionApi(http));
|
|
40
40
|
return freezeSys(uiExtensionWithMethods);
|
|
41
41
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import * as endpoints from '../plain/endpoints';
|
|
@@ -23,7 +23,7 @@ function createUploadApi(http) {
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
export function wrapUpload(http, data) {
|
|
26
|
-
var upload = toPlainObject(
|
|
26
|
+
var upload = toPlainObject(copy(data));
|
|
27
27
|
var uploadWithMethods = enhanceWithMethods(upload, createUploadApi(http));
|
|
28
28
|
return freezeSys(uploadWithMethods);
|
|
29
29
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
2
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import { wrapCollection } from '../common-utils';
|
|
@@ -10,7 +10,7 @@ import { wrapCollection } from '../common-utils';
|
|
|
10
10
|
* @return Normalized usage
|
|
11
11
|
*/
|
|
12
12
|
export function wrapUsage(http, data) {
|
|
13
|
-
var usage = toPlainObject(
|
|
13
|
+
var usage = toPlainObject(copy(data));
|
|
14
14
|
var usageWithMethods = enhanceWithMethods(usage, {});
|
|
15
15
|
return freezeSys(usageWithMethods);
|
|
16
16
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
2
|
-
import
|
|
2
|
+
import copy from 'fast-copy';
|
|
3
3
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
4
|
import { wrapCollection } from '../common-utils';
|
|
5
5
|
|
|
@@ -10,7 +10,7 @@ import { wrapCollection } from '../common-utils';
|
|
|
10
10
|
* @return Normalized user
|
|
11
11
|
*/
|
|
12
12
|
export function wrapUser(http, data) {
|
|
13
|
-
var user = toPlainObject(
|
|
13
|
+
var user = toPlainObject(copy(data));
|
|
14
14
|
var userWithMethods = enhanceWithMethods(user, {});
|
|
15
15
|
return freezeSys(userWithMethods);
|
|
16
16
|
}
|
|
@@ -4,7 +4,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import copy from 'fast-copy';
|
|
8
8
|
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
9
9
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
10
10
|
import * as endpoints from '../plain/endpoints';
|
|
@@ -54,7 +54,7 @@ function createWebhookApi(http) {
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
export function wrapWebhook(http, data) {
|
|
57
|
-
var webhook = toPlainObject(
|
|
57
|
+
var webhook = toPlainObject(copy(data));
|
|
58
58
|
var webhookWithMethods = enhanceWithMethods(webhook, createWebhookApi(http));
|
|
59
59
|
return freezeSys(webhookWithMethods);
|
|
60
60
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import isPlainObject from 'lodash
|
|
2
|
-
import get from 'lodash/get';
|
|
1
|
+
import isPlainObject from 'lodash.isplainobject';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Handles errors received from the server. Parses the error into a more useful
|
|
@@ -14,7 +13,7 @@ export default function errorHandler(errorResponse) {
|
|
|
14
13
|
response = errorResponse.response;
|
|
15
14
|
var errorName; // Obscure the Management token
|
|
16
15
|
|
|
17
|
-
if (config.headers && config.headers['Authorization']) {
|
|
16
|
+
if (config && config.headers && config.headers['Authorization']) {
|
|
18
17
|
var token = "...".concat(config.headers['Authorization'].substr(-5));
|
|
19
18
|
config.headers['Authorization'] = "Bearer ".concat(token);
|
|
20
19
|
}
|
|
@@ -66,7 +65,9 @@ export default function errorHandler(errorResponse) {
|
|
|
66
65
|
try {
|
|
67
66
|
error.message = JSON.stringify(errorData, null, ' ');
|
|
68
67
|
} catch (_unused) {
|
|
69
|
-
|
|
68
|
+
var _errorData$message;
|
|
69
|
+
|
|
70
|
+
error.message = (_errorData$message = errorData === null || errorData === void 0 ? void 0 : errorData.message) !== null && _errorData$message !== void 0 ? _errorData$message : '';
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
throw error;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
+
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
4
|
+
|
|
1
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
6
|
|
|
3
7
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
8
|
|
|
5
9
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
6
10
|
|
|
7
|
-
import
|
|
8
|
-
import merge from 'lodash/merge';
|
|
11
|
+
import copy from 'fast-copy';
|
|
9
12
|
export var asIterator = function asIterator(fn, params) {
|
|
10
13
|
return _defineProperty({}, Symbol.asyncIterator, function () {
|
|
11
|
-
var options =
|
|
14
|
+
var options = copy(params);
|
|
12
15
|
|
|
13
16
|
var get = function get() {
|
|
14
|
-
return fn(
|
|
17
|
+
return fn(copy(options));
|
|
15
18
|
};
|
|
16
19
|
|
|
17
20
|
var currentResult = get();
|
|
@@ -53,10 +56,10 @@ export var asIterator = function asIterator(fn, params) {
|
|
|
53
56
|
endOfList = _this.current === total;
|
|
54
57
|
|
|
55
58
|
if (endOfPage && !endOfList) {
|
|
56
|
-
|
|
57
|
-
query: {
|
|
59
|
+
options = _objectSpread(_objectSpread({}, options), {}, {
|
|
60
|
+
query: _objectSpread(_objectSpread({}, options.query), {}, {
|
|
58
61
|
skip: skip + limit
|
|
59
|
-
}
|
|
62
|
+
})
|
|
60
63
|
});
|
|
61
64
|
currentResult = get();
|
|
62
65
|
}
|
|
@@ -5,7 +5,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
7
|
import * as raw from './raw';
|
|
8
|
-
import
|
|
8
|
+
import copy from 'fast-copy';
|
|
9
9
|
export var get = function get(http, params) {
|
|
10
10
|
return raw.get(http, "/spaces/".concat(params.spaceId, "/api_keys/").concat(params.apiKeyId));
|
|
11
11
|
};
|
|
@@ -27,7 +27,7 @@ export var createWithId = function createWithId(http, params, data, headers) {
|
|
|
27
27
|
export var update = function update(http, params, rawData, headers) {
|
|
28
28
|
var _rawData$sys$version;
|
|
29
29
|
|
|
30
|
-
var data =
|
|
30
|
+
var data = copy(rawData);
|
|
31
31
|
|
|
32
32
|
if ('accessToken' in data) {
|
|
33
33
|
delete data.accessToken;
|