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.
Files changed (135) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/dist/contentful-management.browser.js +840 -3576
  3. package/dist/contentful-management.browser.js.map +1 -1
  4. package/dist/contentful-management.browser.min.js +1 -1
  5. package/dist/contentful-management.legacy.js +833 -3569
  6. package/dist/contentful-management.legacy.js.map +1 -1
  7. package/dist/contentful-management.legacy.min.js +1 -1
  8. package/dist/contentful-management.node.js +784 -3579
  9. package/dist/contentful-management.node.js.map +1 -1
  10. package/dist/contentful-management.node.min.js +1 -1
  11. package/dist/es-modules/common-utils.js +2 -2
  12. package/dist/es-modules/create-cma-http-client.js +4 -4
  13. package/dist/es-modules/entities/api-key.js +2 -2
  14. package/dist/es-modules/entities/app-definition.js +2 -2
  15. package/dist/es-modules/entities/app-installation.js +2 -2
  16. package/dist/es-modules/entities/asset.js +2 -2
  17. package/dist/es-modules/entities/content-type.js +2 -2
  18. package/dist/es-modules/entities/editor-interface.js +2 -2
  19. package/dist/es-modules/entities/entry.js +2 -2
  20. package/dist/es-modules/entities/environment-alias.js +2 -2
  21. package/dist/es-modules/entities/environment.js +2 -2
  22. package/dist/es-modules/entities/locale.js +2 -2
  23. package/dist/es-modules/entities/organization-invitation.js +2 -2
  24. package/dist/es-modules/entities/organization-membership.js +2 -2
  25. package/dist/es-modules/entities/organization.js +2 -2
  26. package/dist/es-modules/entities/personal-access-token.js +2 -2
  27. package/dist/es-modules/entities/preview-api-key.js +2 -2
  28. package/dist/es-modules/entities/role.js +2 -2
  29. package/dist/es-modules/entities/scheduled-action.js +2 -2
  30. package/dist/es-modules/entities/snapshot.js +2 -2
  31. package/dist/es-modules/entities/space-member.js +2 -2
  32. package/dist/es-modules/entities/space-membership.js +2 -2
  33. package/dist/es-modules/entities/space.js +2 -2
  34. package/dist/es-modules/entities/tag.js +2 -2
  35. package/dist/es-modules/entities/team-membership.js +2 -2
  36. package/dist/es-modules/entities/team-space-membership.js +2 -2
  37. package/dist/es-modules/entities/team.js +2 -2
  38. package/dist/es-modules/entities/ui-extension.js +2 -2
  39. package/dist/es-modules/entities/upload.js +2 -2
  40. package/dist/es-modules/entities/usage.js +2 -2
  41. package/dist/es-modules/entities/user.js +2 -2
  42. package/dist/es-modules/entities/webhook.js +2 -2
  43. package/dist/es-modules/error-handler.js +5 -4
  44. package/dist/es-modules/plain/as-iterator.js +10 -7
  45. package/dist/es-modules/plain/endpoints/api-key.js +2 -2
  46. package/dist/es-modules/plain/endpoints/app-definition.js +3 -3
  47. package/dist/es-modules/plain/endpoints/app-installation.js +2 -4
  48. package/dist/es-modules/plain/endpoints/asset.js +4 -4
  49. package/dist/es-modules/plain/endpoints/content-type.js +4 -4
  50. package/dist/es-modules/plain/endpoints/editor-interface.js +2 -2
  51. package/dist/es-modules/plain/endpoints/entry.js +4 -4
  52. package/dist/es-modules/plain/endpoints/environment-alias.js +3 -3
  53. package/dist/es-modules/plain/endpoints/environment.js +4 -4
  54. package/dist/es-modules/plain/endpoints/locale.js +2 -2
  55. package/dist/es-modules/plain/endpoints/organization-membership.js +2 -2
  56. package/dist/es-modules/plain/endpoints/role.js +2 -2
  57. package/dist/es-modules/plain/endpoints/space-membership.js +2 -2
  58. package/dist/es-modules/plain/endpoints/space.js +2 -2
  59. package/dist/es-modules/plain/endpoints/tag.js +3 -3
  60. package/dist/es-modules/plain/endpoints/team-membership.js +2 -2
  61. package/dist/es-modules/plain/endpoints/team-space-membership.js +2 -2
  62. package/dist/es-modules/plain/endpoints/team.js +2 -2
  63. package/dist/es-modules/plain/endpoints/ui-extension.js +3 -5
  64. package/dist/es-modules/plain/endpoints/webhook.js +4 -7
  65. package/dist/es-modules/upload-http-client.js +4 -5
  66. package/dist/typings/common-utils.d.ts +1 -1
  67. package/dist/typings/create-cma-http-client.d.ts +4 -67
  68. package/dist/typings/create-contentful-api.d.ts +2 -1
  69. package/dist/typings/create-environment-api.d.ts +1 -1
  70. package/dist/typings/create-organization-api.d.ts +1 -1
  71. package/dist/typings/create-space-api.d.ts +1 -1
  72. package/dist/typings/entities/api-key.d.ts +1 -1
  73. package/dist/typings/entities/app-definition.d.ts +1 -1
  74. package/dist/typings/entities/app-installation.d.ts +1 -1
  75. package/dist/typings/entities/asset.d.ts +1 -1
  76. package/dist/typings/entities/content-type.d.ts +1 -1
  77. package/dist/typings/entities/editor-interface.d.ts +1 -1
  78. package/dist/typings/entities/entry.d.ts +1 -1
  79. package/dist/typings/entities/environment-alias.d.ts +1 -1
  80. package/dist/typings/entities/environment.d.ts +1 -1
  81. package/dist/typings/entities/locale.d.ts +1 -1
  82. package/dist/typings/entities/organization-invitation.d.ts +1 -1
  83. package/dist/typings/entities/organization-membership.d.ts +1 -1
  84. package/dist/typings/entities/organization.d.ts +1 -1
  85. package/dist/typings/entities/personal-access-token.d.ts +1 -1
  86. package/dist/typings/entities/preview-api-key.d.ts +1 -1
  87. package/dist/typings/entities/role.d.ts +1 -1
  88. package/dist/typings/entities/scheduled-action.d.ts +1 -1
  89. package/dist/typings/entities/snapshot.d.ts +1 -1
  90. package/dist/typings/entities/space-member.d.ts +1 -1
  91. package/dist/typings/entities/space-membership.d.ts +1 -1
  92. package/dist/typings/entities/space.d.ts +1 -1
  93. package/dist/typings/entities/tag.d.ts +1 -1
  94. package/dist/typings/entities/team-membership.d.ts +1 -1
  95. package/dist/typings/entities/team-space-membership.d.ts +1 -1
  96. package/dist/typings/entities/team.d.ts +1 -1
  97. package/dist/typings/entities/ui-extension.d.ts +1 -1
  98. package/dist/typings/entities/upload.d.ts +1 -1
  99. package/dist/typings/entities/usage.d.ts +1 -1
  100. package/dist/typings/entities/user.d.ts +1 -1
  101. package/dist/typings/entities/webhook.d.ts +1 -1
  102. package/dist/typings/plain/endpoints/api-key.d.ts +1 -1
  103. package/dist/typings/plain/endpoints/app-definition.d.ts +1 -1
  104. package/dist/typings/plain/endpoints/app-installation.d.ts +1 -1
  105. package/dist/typings/plain/endpoints/asset.d.ts +1 -1
  106. package/dist/typings/plain/endpoints/content-type.d.ts +1 -1
  107. package/dist/typings/plain/endpoints/editor-interface.d.ts +1 -1
  108. package/dist/typings/plain/endpoints/entry.d.ts +1 -1
  109. package/dist/typings/plain/endpoints/environment-alias.d.ts +1 -1
  110. package/dist/typings/plain/endpoints/environment.d.ts +1 -1
  111. package/dist/typings/plain/endpoints/locale.d.ts +1 -1
  112. package/dist/typings/plain/endpoints/organization-invitation.d.ts +1 -1
  113. package/dist/typings/plain/endpoints/organization-membership.d.ts +1 -1
  114. package/dist/typings/plain/endpoints/organization.d.ts +1 -1
  115. package/dist/typings/plain/endpoints/personal-access-token.d.ts +1 -1
  116. package/dist/typings/plain/endpoints/preview-api-keys.d.ts +1 -1
  117. package/dist/typings/plain/endpoints/role.d.ts +1 -1
  118. package/dist/typings/plain/endpoints/scheduled-action.d.ts +1 -1
  119. package/dist/typings/plain/endpoints/snapshot.d.ts +1 -1
  120. package/dist/typings/plain/endpoints/space-member.d.ts +1 -1
  121. package/dist/typings/plain/endpoints/space-membership.d.ts +1 -1
  122. package/dist/typings/plain/endpoints/space.d.ts +1 -1
  123. package/dist/typings/plain/endpoints/tag.d.ts +1 -1
  124. package/dist/typings/plain/endpoints/team-membership.d.ts +1 -1
  125. package/dist/typings/plain/endpoints/team-space-membership.d.ts +1 -1
  126. package/dist/typings/plain/endpoints/team.d.ts +1 -1
  127. package/dist/typings/plain/endpoints/ui-extension.d.ts +1 -1
  128. package/dist/typings/plain/endpoints/upload.d.ts +1 -1
  129. package/dist/typings/plain/endpoints/usage.d.ts +1 -1
  130. package/dist/typings/plain/endpoints/user.d.ts +1 -1
  131. package/dist/typings/plain/endpoints/webhook.d.ts +1 -1
  132. package/dist/typings/plain/plain-client.d.ts +2 -2
  133. package/dist/typings/plain/wrappers/wrap.d.ts +1 -1
  134. package/dist/typings/upload-http-client.d.ts +1 -1
  135. package/package.json +8 -5
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/ban-ts-ignore */
2
- import cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data)); // @ts-ignore
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 cloneDeep from 'lodash/cloneDeep';
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.3.3"), params.application, params.integration, params.feature);
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), cloneDeep(params));
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), requiredHeaders);
37
+ params.headers = _objectSpread(_objectSpread({}, requiredHeaders), params.headers);
38
38
  return createHttpClient(axios, params);
39
39
  }
@@ -1,4 +1,4 @@
1
- import cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
19
+ var environment = toPlainObject(copy(data));
20
20
  var environmentApi = createEnvironmentApi({
21
21
  http: http
22
22
  });
@@ -1,4 +1,4 @@
1
- import cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
11
+ var invitation = toPlainObject(copy(data));
12
12
  return freezeSys(invitation);
13
13
  }
@@ -1,4 +1,4 @@
1
- import cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
18
+ var org = toPlainObject(copy(data));
19
19
  var orgApi = createOrganizationApi({
20
20
  http: http
21
21
  });
@@ -1,4 +1,4 @@
1
- import cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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(_cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
12
+ var spaceMember = toPlainObject(copy(data));
13
13
  return freezeSys(spaceMember);
14
14
  }
15
15
  /**
@@ -1,4 +1,4 @@
1
- import cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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(_cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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 cloneDeep from 'lodash/cloneDeep';
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(cloneDeep(data));
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/isPlainObject';
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
- error.message = get(errorData, ['message'], '');
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 cloneDeep from 'lodash/cloneDeep';
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 = cloneDeep(params);
14
+ var options = copy(params);
12
15
 
13
16
  var get = function get() {
14
- return fn(cloneDeep(options));
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
- merge(options, {
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 cloneDeep from 'lodash/cloneDeep';
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 = cloneDeep(rawData);
30
+ var data = copy(rawData);
31
31
 
32
32
  if ('accessToken' in data) {
33
33
  delete data.accessToken;