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
@@ -9,7 +9,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
9
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); }); }; }
10
10
 
11
11
  import * as raw from './raw';
12
- import cloneDeep from 'lodash/cloneDeep';
12
+ import copy from 'fast-copy';
13
13
  import { normalizeSelect } from './utils';
14
14
 
15
15
  var getBaseUrl = function getBaseUrl(params) {
@@ -30,7 +30,7 @@ export var getMany = function getMany(http, params) {
30
30
  });
31
31
  };
32
32
  export var create = function create(http, params, rawData) {
33
- var data = cloneDeep(rawData);
33
+ var data = copy(rawData);
34
34
  return raw.post(http, getBaseUrl(params), data);
35
35
  };
36
36
  export var update = /*#__PURE__*/function () {
@@ -42,7 +42,7 @@ export var update = /*#__PURE__*/function () {
42
42
  while (1) {
43
43
  switch (_context.prev = _context.next) {
44
44
  case 0:
45
- data = cloneDeep(rawData);
45
+ data = copy(rawData);
46
46
  delete data.sys;
47
47
  return _context.abrupt("return", raw.put(http, getAppDefinitionUrl(params), data, {
48
48
  headers: _objectSpread({
@@ -1,5 +1,3 @@
1
- import _cloneDeep from "lodash/cloneDeep";
2
-
3
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; }
4
2
 
5
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; }
@@ -8,6 +6,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
8
6
 
9
7
  import * as raw from './raw';
10
8
  import { normalizeSelect } from './utils';
9
+ import copy from 'fast-copy';
11
10
 
12
11
  var getBaseUrl = function getBaseUrl(params) {
13
12
  return "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/app_installations");
@@ -27,8 +26,7 @@ export var getMany = function getMany(http, params) {
27
26
  });
28
27
  };
29
28
  export var upsert = function upsert(http, params, rawData, headers) {
30
- var data = _cloneDeep(rawData);
31
-
29
+ var data = copy(rawData);
32
30
  return raw.put(http, getAppInstallationUrl(params), data, _objectSpread({}, headers));
33
31
  };
34
32
  export var del = function del(http, params) {
@@ -7,7 +7,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
7
7
  import * as raw from './raw';
8
8
  import errorHandler from '../../error-handler';
9
9
  import { normalizeSelect } from './utils';
10
- import cloneDeep from 'lodash/cloneDeep';
10
+ import copy from 'fast-copy';
11
11
  import { create as createUpload } from './upload';
12
12
  import { getUploadHttpClient } from '../../upload-http-client';
13
13
  export var get = function get(http, params) {
@@ -23,7 +23,7 @@ export var getMany = function getMany(http, params) {
23
23
  export var update = function update(http, params, rawData, headers) {
24
24
  var _rawData$sys$version;
25
25
 
26
- var data = cloneDeep(rawData);
26
+ var data = copy(rawData);
27
27
  delete data.sys;
28
28
  return raw.put(http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/assets/").concat(params.assetId), data, {
29
29
  headers: _objectSpread({
@@ -53,11 +53,11 @@ export var unarchive = function unarchive(http, params) {
53
53
  return raw.del(http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/assets/").concat(params.assetId, "/archived"));
54
54
  };
55
55
  export var create = function create(http, params, rawData) {
56
- var data = cloneDeep(rawData);
56
+ var data = copy(rawData);
57
57
  return raw.post(http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/assets"), data);
58
58
  };
59
59
  export var createWithId = function createWithId(http, params, rawData) {
60
- var data = cloneDeep(rawData);
60
+ var data = copy(rawData);
61
61
  return raw.put(http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/assets/").concat(params.assetId), data);
62
62
  };
63
63
  export var createFromFiles = function createFromFiles(http, params, data) {
@@ -6,7 +6,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
6
6
 
7
7
  import * as raw from './raw';
8
8
  import { normalizeSelect } from './utils';
9
- import cloneDeep from 'lodash/cloneDeep';
9
+ import copy from 'fast-copy';
10
10
 
11
11
  var getBaseUrl = function getBaseUrl(params) {
12
12
  return "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/content_types");
@@ -27,17 +27,17 @@ export var getMany = function getMany(http, params) {
27
27
  });
28
28
  };
29
29
  export var create = function create(http, params, rawData) {
30
- var data = cloneDeep(rawData);
30
+ var data = copy(rawData);
31
31
  return raw.post(http, getBaseUrl(params), data);
32
32
  };
33
33
  export var createWithId = function createWithId(http, params, rawData) {
34
- var data = cloneDeep(rawData);
34
+ var data = copy(rawData);
35
35
  return raw.put(http, getContentTypeUrl(params), data);
36
36
  };
37
37
  export var update = function update(http, params, rawData, headers) {
38
38
  var _rawData$sys$version;
39
39
 
40
- var data = cloneDeep(rawData);
40
+ var data = copy(rawData);
41
41
  delete data.sys;
42
42
  return raw.put(http, getContentTypeUrl(params), data, {
43
43
  headers: _objectSpread({
@@ -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
 
10
10
  var getBaseUrl = function getBaseUrl(params) {
11
11
  return "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/content_types/").concat(params.contentTypeId, "/editor_interface");
@@ -20,7 +20,7 @@ export var getMany = function getMany(http, params) {
20
20
  export var update = function update(http, params, rawData, headers) {
21
21
  var _rawData$sys$version;
22
22
 
23
- var data = cloneDeep(rawData);
23
+ var data = copy(rawData);
24
24
  delete data.sys;
25
25
  return raw.put(http, getBaseUrl(params), data, {
26
26
  headers: _objectSpread({
@@ -6,7 +6,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
6
6
 
7
7
  import * as raw from './raw';
8
8
  import { normalizeSelect } from './utils';
9
- import cloneDeep from 'lodash/cloneDeep';
9
+ import copy from 'fast-copy';
10
10
  export var get = function get(http, params) {
11
11
  return raw.get(http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/entries/").concat(params.entryId), {
12
12
  params: normalizeSelect(params.query)
@@ -20,7 +20,7 @@ export var getMany = function getMany(http, params) {
20
20
  export var update = function update(http, params, rawData, headers) {
21
21
  var _rawData$sys$version;
22
22
 
23
- var data = cloneDeep(rawData);
23
+ var data = copy(rawData);
24
24
  delete data.sys;
25
25
  return raw.put(http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/entries/").concat(params.entryId), data, {
26
26
  headers: _objectSpread({
@@ -48,7 +48,7 @@ export var unarchive = function unarchive(http, params) {
48
48
  return raw.del(http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/entries/").concat(params.entryId, "/archived"));
49
49
  };
50
50
  export var create = function create(http, params, rawData) {
51
- var data = cloneDeep(rawData);
51
+ var data = copy(rawData);
52
52
  return raw.post(http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/entries"), data, {
53
53
  headers: {
54
54
  'X-Contentful-Content-Type': params.contentTypeId
@@ -56,7 +56,7 @@ export var create = function create(http, params, rawData) {
56
56
  });
57
57
  };
58
58
  export var createWithId = function createWithId(http, params, rawData) {
59
- var data = cloneDeep(rawData);
59
+ var data = copy(rawData);
60
60
  return raw.put(http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/entries/").concat(params.entryId), data, {
61
61
  headers: {
62
62
  'X-Contentful-Content-Type': params.contentTypeId
@@ -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
 
10
10
  /**
11
11
  * Urls
@@ -31,7 +31,7 @@ export var getMany = function getMany(http, params) {
31
31
  });
32
32
  };
33
33
  export var createWithId = function createWithId(http, params, rawData, headers) {
34
- var data = cloneDeep(rawData);
34
+ var data = copy(rawData);
35
35
  return raw.put(http, getEnvironmentAliasUrl(params), data, {
36
36
  headers: headers
37
37
  });
@@ -39,7 +39,7 @@ export var createWithId = function createWithId(http, params, rawData, headers)
39
39
  export var update = function update(http, params, rawData, headers) {
40
40
  var _rawData$sys$version;
41
41
 
42
- var data = cloneDeep(rawData);
42
+ var data = copy(rawData);
43
43
  delete data.sys;
44
44
  return raw.put(http, getEnvironmentAliasUrl(params), data, {
45
45
  headers: _objectSpread(_objectSpread({}, headers), {}, {
@@ -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, "/environments/").concat(params.environmentId));
11
11
  };
@@ -17,7 +17,7 @@ export var getMany = function getMany(http, params) {
17
17
  export var update = function update(http, params, rawData, headers) {
18
18
  var _rawData$sys$version;
19
19
 
20
- var data = cloneDeep(rawData);
20
+ var data = copy(rawData);
21
21
  delete data.sys;
22
22
  return raw.put(http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId), data, {
23
23
  headers: _objectSpread(_objectSpread({}, headers), {}, {
@@ -29,13 +29,13 @@ export var del = function del(http, params) {
29
29
  return raw.del(http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId));
30
30
  };
31
31
  export var create = function create(http, params, rawData, headers) {
32
- var data = cloneDeep(rawData);
32
+ var data = copy(rawData);
33
33
  return raw.post(http, "/spaces/".concat(params.spaceId, "/environments"), data, {
34
34
  headers: headers
35
35
  });
36
36
  };
37
37
  export var createWithId = function createWithId(http, params, rawData, headers) {
38
- var data = cloneDeep(rawData);
38
+ var data = copy(rawData);
39
39
  return raw.put(http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId), data, {
40
40
  headers: _objectSpread(_objectSpread({}, headers), params.sourceEnvironmentId ? {
41
41
  'X-Contentful-Source-Environment': params.sourceEnvironmentId
@@ -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 { normalizeSelect } from './utils';
9
9
  import * as raw from './raw';
10
10
  export var get = function get(http, params) {
@@ -23,7 +23,7 @@ export var create = function create(http, params, data, headers) {
23
23
  export var update = function update(http, params, rawData, headers) {
24
24
  var _rawData$sys$version;
25
25
 
26
- var data = cloneDeep(rawData);
26
+ var data = copy(rawData);
27
27
  delete data.sys;
28
28
  delete data["default"]; // we should not send this back
29
29
 
@@ -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
 
10
10
  var getBaseUrl = function getBaseUrl(params) {
11
11
  return "/organizations/".concat(params.organizationId, "/organization_memberships");
@@ -24,7 +24,7 @@ export var getMany = function getMany(http, params) {
24
24
  export var update = function update(http, params, rawData, headers) {
25
25
  var _rawData$sys$version;
26
26
 
27
- var data = cloneDeep(rawData);
27
+ var data = copy(rawData);
28
28
  delete data.sys;
29
29
  var role = data.role;
30
30
  return raw.put(http, getEntityUrl(params), {
@@ -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 * as raw from './raw';
9
9
  import { normalizeSelect } from './utils';
10
10
  export var get = function get(http, params) {
@@ -28,7 +28,7 @@ export var createWithId = function createWithId(http, params, data, headers) {
28
28
  export var update = function update(http, params, rawData, headers) {
29
29
  var _rawData$sys$version;
30
30
 
31
- var data = cloneDeep(rawData);
31
+ var data = copy(rawData);
32
32
  delete data.sys;
33
33
  return raw.put(http, "/spaces/".concat(params.spaceId, "/roles/").concat(params.roleId), data, {
34
34
  headers: _objectSpread(_objectSpread({}, headers), {}, {
@@ -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 * as raw from './raw';
9
9
 
10
10
  function spaceMembershipDeprecationWarning() {
@@ -52,7 +52,7 @@ export var createWithId = function createWithId(http, params, data, headers) {
52
52
  export var update = function update(http, params, rawData, headers) {
53
53
  var _rawData$sys$version;
54
54
 
55
- var data = cloneDeep(rawData);
55
+ var data = copy(rawData);
56
56
  delete data.sys;
57
57
  return raw.put(http, getEntityUrl(params), data, {
58
58
  headers: _objectSpread(_objectSpread({}, headers), {}, {
@@ -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));
11
11
  };
@@ -24,7 +24,7 @@ export var create = function create(http, params, rawData, headers) {
24
24
  export var update = function update(http, params, rawData, headers) {
25
25
  var _rawData$sys$version;
26
26
 
27
- var data = cloneDeep(rawData);
27
+ var data = copy(rawData);
28
28
  delete data.sys;
29
29
  return raw.put(http, "/spaces/".concat(params.spaceId), data, {
30
30
  headers: _objectSpread({
@@ -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
 
10
10
  var getBaseUrl = function getBaseUrl(params) {
11
11
  return "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/tags");
@@ -24,13 +24,13 @@ export var getMany = function getMany(http, params) {
24
24
  });
25
25
  };
26
26
  export var createWithId = function createWithId(http, params, rawData) {
27
- var data = cloneDeep(rawData);
27
+ var data = copy(rawData);
28
28
  return raw.put(http, getTagUrl(params), data);
29
29
  };
30
30
  export var update = function update(http, params, rawData, headers) {
31
31
  var _rawData$sys$version;
32
32
 
33
- var data = cloneDeep(rawData);
33
+ var data = copy(rawData);
34
34
  delete data.sys;
35
35
  return raw.put(http, getTagUrl(params), data, {
36
36
  headers: _objectSpread({
@@ -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
  import { normalizeSelect } from './utils';
10
10
 
11
11
  var getBaseUrl = function getBaseUrl(params) {
@@ -35,7 +35,7 @@ export var create = function create(http, params, rawData, headers) {
35
35
  });
36
36
  };
37
37
  export var update = function update(http, params, rawData, headers) {
38
- var data = cloneDeep(rawData);
38
+ var data = copy(rawData);
39
39
  delete data.sys;
40
40
  return raw.put(http, getEntityUrl(params), data, {
41
41
  headers: _objectSpread({
@@ -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 * as raw from './raw';
9
9
 
10
10
  var getBaseUrl = function getBaseUrl(params) {
@@ -45,7 +45,7 @@ export var create = function create(http, params, rawData, headers) {
45
45
  });
46
46
  };
47
47
  export var update = function update(http, params, rawData, headers) {
48
- var data = cloneDeep(rawData);
48
+ var data = copy(rawData);
49
49
  delete data.sys;
50
50
  return raw.put(http, getEntityUrl(params), data, {
51
51
  headers: _objectSpread({
@@ -6,7 +6,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
6
6
 
7
7
  import * as raw from './raw';
8
8
  import { normalizeSelect } from './utils';
9
- import cloneDeep from 'lodash/cloneDeep';
9
+ import copy from 'fast-copy';
10
10
 
11
11
  var getBaseUrl = function getBaseUrl(params) {
12
12
  return "/organizations/".concat(params.organizationId, "/teams");
@@ -32,7 +32,7 @@ export var create = function create(http, params, rawData, headers) {
32
32
  export var update = function update(http, params, rawData, headers) {
33
33
  var _rawData$sys$version;
34
34
 
35
- var data = cloneDeep(rawData);
35
+ var data = copy(rawData);
36
36
  delete data.sys;
37
37
  return raw.put(http, getEntityUrl(params), data, {
38
38
  headers: _objectSpread({
@@ -1,5 +1,3 @@
1
- import _cloneDeep from "lodash/cloneDeep";
2
-
3
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; }
4
2
 
5
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; }
@@ -12,6 +10,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
12
10
 
13
11
  import * as raw from './raw';
14
12
  import { normalizeSelect } from './utils';
13
+ import copy from 'fast-copy';
15
14
 
16
15
  var getBaseUrl = function getBaseUrl(params) {
17
16
  return "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/extensions");
@@ -36,8 +35,7 @@ export var create = function create(http, params, rawData, headers) {
36
35
  });
37
36
  };
38
37
  export var createWithId = function createWithId(http, params, rawData, headers) {
39
- var data = _cloneDeep(rawData);
40
-
38
+ var data = copy(rawData);
41
39
  return raw.put(http, getUIExtensionUrl(params), data, {
42
40
  headers: headers
43
41
  });
@@ -51,7 +49,7 @@ export var update = /*#__PURE__*/function () {
51
49
  while (1) {
52
50
  switch (_context.prev = _context.next) {
53
51
  case 0:
54
- data = _cloneDeep(rawData);
52
+ data = copy(rawData);
55
53
  delete data.sys;
56
54
  return _context.abrupt("return", raw.put(http, getUIExtensionUrl(params), data, {
57
55
  headers: _objectSpread({
@@ -1,5 +1,3 @@
1
- import _cloneDeep from "lodash/cloneDeep";
2
-
3
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; }
4
2
 
5
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; }
@@ -12,6 +10,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
12
10
 
13
11
  import * as raw from './raw';
14
12
  import { normalizeSelect } from './utils';
13
+ import copy from 'fast-copy';
15
14
 
16
15
  var getBaseUrl = function getBaseUrl(params) {
17
16
  return "/spaces/".concat(params.spaceId, "/webhook_definitions");
@@ -57,15 +56,13 @@ export var getMany = function getMany(http, params) {
57
56
  });
58
57
  };
59
58
  export var create = function create(http, params, rawData, headers) {
60
- var data = _cloneDeep(rawData);
61
-
59
+ var data = copy(rawData);
62
60
  return raw.post(http, getBaseUrl(params), data, {
63
61
  headers: headers
64
62
  });
65
63
  };
66
64
  export var createWithId = function createWithId(http, params, rawData, headers) {
67
- var data = _cloneDeep(rawData);
68
-
65
+ var data = copy(rawData);
69
66
  return raw.put(http, getWebhookUrl(params), data, {
70
67
  headers: headers
71
68
  });
@@ -79,7 +76,7 @@ export var update = /*#__PURE__*/function () {
79
76
  while (1) {
80
77
  switch (_context.prev = _context.next) {
81
78
  case 0:
82
- data = _cloneDeep(rawData);
79
+ data = copy(rawData);
83
80
  delete data.sys;
84
81
  return _context.abrupt("return", raw.put(http, getWebhookUrl(params), data, {
85
82
  headers: _objectSpread({
@@ -1,9 +1,8 @@
1
1
  export function getUploadHttpClient(http) {
2
- var sdkHttp = http;
3
- var _sdkHttp$httpClientPa = sdkHttp.httpClientParams,
4
- hostUpload = _sdkHttp$httpClientPa.hostUpload,
5
- defaultHostnameUpload = _sdkHttp$httpClientPa.defaultHostnameUpload;
6
- var uploadHttp = sdkHttp.cloneWithNewParams({
2
+ var _ref = http.httpClientParams,
3
+ hostUpload = _ref.hostUpload,
4
+ defaultHostnameUpload = _ref.defaultHostnameUpload;
5
+ var uploadHttp = http.cloneWithNewParams({
7
6
  host: hostUpload || defaultHostnameUpload
8
7
  });
9
8
  return uploadHttp;
@@ -1,3 +1,3 @@
1
- import { AxiosInstance } from 'axios';
1
+ import type { AxiosInstance } from 'contentful-sdk-core';
2
2
  import { CollectionProp, Collection } from './common-types';
3
3
  export declare const wrapCollection: <R, T, Rest extends any[]>(fn: (http: AxiosInstance, entity: T, ...rest: Rest) => R) => (http: AxiosInstance, data: CollectionProp<T>, ...rest: Rest) => Collection<R, T>;
@@ -2,25 +2,12 @@
2
2
  * @packageDocumentation
3
3
  * @hidden
4
4
  */
5
- /// <reference types="node" />
6
- import { AxiosRequestConfig, AxiosProxyConfig, AxiosResponse } from 'axios';
7
- import { Agent as httpAgent } from 'http';
8
- import { Agent as httpsAgent } from 'https';
9
- export declare type ClientParams = {
5
+ import type { CreateHttpClientParams } from 'contentful-sdk-core';
6
+ export declare type ClientParams = CreateHttpClientParams & {
10
7
  /**
11
8
  * Contentful CMA Access Token
12
9
  */
13
- accessToken: string;
14
- /**
15
- * Requests will be made over http instead of the default https
16
- * @default false
17
- */
18
- insecure?: boolean;
19
- /**
20
- * If we should retry on errors and 429 rate limit exceptions
21
- * @default true
22
- */
23
- retryOnError?: boolean;
10
+ accessToken: CreateHttpClientParams['accessToken'];
24
11
  /**
25
12
  * API host
26
13
  * @default api.contentful.com
@@ -31,41 +18,6 @@ export declare type ClientParams = {
31
18
  * @default upload.contentful.com
32
19
  */
33
20
  hostUpload?: string;
34
- /**
35
- * Optional Node.js HTTP agent for proxying
36
- * @see <a href="https://nodejs.org/api/http.html#http_class_http_agent">Node.js docs</a> and <a href="https://www.npmjs.com/package/https-proxy-agent">https-proxy-agent</a>
37
- */
38
- httpAgent?: httpAgent;
39
- /**
40
- * Optional Node.js HTTP agent for proxying
41
- * @see <a href="https://nodejs.org/api/http.html#http_class_http_agent">Node.js docs</a> and <a href="https://www.npmjs.com/package/https-proxy-agent">https-proxy-agent</a>
42
- */
43
- httpsAgent?: httpsAgent;
44
- /**
45
- * Optional Axios proxy
46
- * @see <a href="https://github.com/mzabriskie/axios#request-config"> axios docs </a>
47
- */
48
- proxy?: AxiosProxyConfig;
49
- /**
50
- * Optional additional headers
51
- */
52
- headers?: {
53
- [key: string]: unknown;
54
- };
55
- /**
56
- * A log handler function to process given log messages & errors.
57
- * Receives the log level (error, warning & info) and the actual log data (Error object or string).
58
- * @see The default can be found at: https://github.com/contentful/contentful-sdk-core/blob/master/lib/create-http-client.js
59
- */
60
- logHandler?: (level: string, data: Error | string) => void;
61
- /**
62
- * Gets called on every request triggered by the SDK
63
- */
64
- requestLogger?: (config: AxiosRequestConfig) => void;
65
- /**
66
- * Gets called on every response
67
- */
68
- responseLogger?: (response: AxiosResponse) => void;
69
21
  /**
70
22
  * Application name and version e.g myApp/version
71
23
  */
@@ -74,21 +26,6 @@ export declare type ClientParams = {
74
26
  * Integration name and version e.g react/version
75
27
  */
76
28
  integration?: string;
77
- /**
78
- * Optional number of milliseconds before the request times out.
79
- * @default 30000
80
- */
81
- timeout?: number;
82
- /**
83
- * Optional number of retries before failure
84
- * @default 5
85
- */
86
- retryLimit?: number;
87
- /**
88
- * Optional maximum content length in bytes
89
- * @default 1073741824 i.e 1GB
90
- */
91
- maxContentLength?: number;
92
29
  feature?: string;
93
30
  };
94
31
  export declare const defaultHostParameters: {
@@ -98,4 +35,4 @@ export declare const defaultHostParameters: {
98
35
  /**
99
36
  * @private
100
37
  */
101
- export declare function createCMAHttpClient(params: ClientParams, plainClient?: boolean): import("axios").AxiosInstance;
38
+ export declare function createCMAHttpClient(params: ClientParams, plainClient?: boolean): import("contentful-sdk-core").AxiosInstance;
@@ -1,4 +1,5 @@
1
- import { AxiosInstance, AxiosRequestConfig } from 'axios';
1
+ import { AxiosRequestConfig } from 'axios';
2
+ import { AxiosInstance } from 'contentful-sdk-core';
2
3
  import { Collection, QueryOptions } from './common-types';
3
4
  import { OrganizationProp, Organization } from './entities/organization';
4
5
  import { SpaceProps, Space } from './entities/space';
@@ -1,4 +1,4 @@
1
- import { AxiosInstance } from 'axios';
1
+ import type { AxiosInstance } from 'contentful-sdk-core';
2
2
  import { BasicQueryOptions } from './common-types';
3
3
  import type { QueryOptions } from './common-types';
4
4
  import type { EntryProps, CreateEntryProps } from './entities/entry';
@@ -1,4 +1,4 @@
1
- import { AxiosInstance } from 'axios';
1
+ import type { AxiosInstance } from 'contentful-sdk-core';
2
2
  import { CreateTeamMembershipProps } from './entities/team-membership';
3
3
  import { CreateTeamProps } from './entities/team';
4
4
  import { CreateOrganizationInvitationProps } from './entities/organization-invitation';
@@ -2,7 +2,7 @@
2
2
  * Contentful Space API. Contains methods to access any operations at a space
3
3
  * level, such as creating and reading entities contained in a space.
4
4
  */
5
- import { AxiosInstance } from 'axios';
5
+ import type { AxiosInstance } from 'contentful-sdk-core';
6
6
  import { CreateEnvironmentProps } from './entities/environment';
7
7
  import { CreateTeamSpaceMembershipProps } from './entities/team-space-membership';
8
8
  import { CreateSpaceMembershipProps } from './entities/space-membership';
@@ -1,4 +1,4 @@
1
- import { AxiosInstance } from 'axios';
1
+ import type { AxiosInstance } from 'contentful-sdk-core';
2
2
  import { MetaLinkProps, MetaSysProps, DefaultElements } from '../common-types';
3
3
  export declare type ApiKeyProps = {
4
4
  sys: MetaSysProps;