contentful-management 7.44.2 → 7.45.3
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/dist/contentful-management.browser.js +52 -68
- package/dist/contentful-management.browser.js.map +1 -1
- package/dist/contentful-management.browser.min.js +1 -1
- package/dist/contentful-management.legacy.js +52 -68
- package/dist/contentful-management.legacy.js.map +1 -1
- package/dist/contentful-management.legacy.min.js +1 -1
- package/dist/contentful-management.node.js +47 -63
- package/dist/contentful-management.node.js.map +1 -1
- package/dist/contentful-management.node.min.js +1 -1
- package/dist/es-modules/adapters/REST/endpoints/api-key.js +1 -1
- package/dist/es-modules/adapters/REST/endpoints/organization.js +2 -2
- package/dist/es-modules/adapters/REST/endpoints/space.js +4 -4
- package/dist/es-modules/adapters/REST/rest-adapter.js +1 -1
- package/dist/es-modules/common-utils.js +1 -1
- package/dist/es-modules/constants/editor-interface-defaults/sidebar-defaults.js +1 -8
- package/dist/es-modules/contentful-management.js +1 -1
- package/dist/es-modules/entities/locale.js +1 -1
- package/dist/es-modules/plain/as-iterator.js +12 -8
- package/dist/typings/create-entry-api.d.ts +3 -3
- package/dist/typings/create-environment-api.d.ts +4 -3
- package/dist/typings/entities/api-key.d.ts +1 -1578
- package/dist/typings/entities/app-bundle.d.ts +1 -1578
- package/dist/typings/entities/app-definition.d.ts +1 -1578
- package/dist/typings/entities/app-installation.d.ts +1 -1578
- package/dist/typings/entities/app-upload.d.ts +1 -1578
- package/dist/typings/entities/asset.d.ts +1 -1577
- package/dist/typings/entities/comment.d.ts +1 -1578
- package/dist/typings/entities/content-type.d.ts +1 -1578
- package/dist/typings/entities/editor-interface.d.ts +8 -1585
- package/dist/typings/entities/entry.d.ts +1 -1578
- package/dist/typings/entities/environment-alias.d.ts +1 -1578
- package/dist/typings/entities/environment.d.ts +1 -1578
- package/dist/typings/entities/extension.d.ts +1 -1578
- package/dist/typings/entities/locale.d.ts +1 -1578
- package/dist/typings/entities/organization-membership.d.ts +1 -1578
- package/dist/typings/entities/organization.d.ts +1 -1578
- package/dist/typings/entities/personal-access-token.d.ts +1 -1578
- package/dist/typings/entities/preview-api-key.d.ts +1 -1578
- package/dist/typings/entities/release-action.d.ts +1 -1578
- package/dist/typings/entities/role.d.ts +1 -1578
- package/dist/typings/entities/scheduled-action.d.ts +1 -1578
- package/dist/typings/entities/snapshot.d.ts +1 -1578
- package/dist/typings/entities/space-member.d.ts +1 -1578
- package/dist/typings/entities/space-membership.d.ts +1 -1578
- package/dist/typings/entities/space.d.ts +1 -1578
- package/dist/typings/entities/tag.d.ts +1 -1578
- package/dist/typings/entities/task.d.ts +1 -1578
- package/dist/typings/entities/team-membership.d.ts +1 -1578
- package/dist/typings/entities/team-space-membership.d.ts +1 -1578
- package/dist/typings/entities/team.d.ts +1 -1578
- package/dist/typings/entities/usage.d.ts +1 -1578
- package/dist/typings/entities/user.d.ts +1 -1578
- package/dist/typings/entities/webhook.d.ts +1 -1578
- package/dist/typings/export-types.d.ts +1 -1
- package/dist/typings/plain/wrappers/wrap.d.ts +4 -4
- package/package.json +14 -13
|
@@ -4,8 +4,8 @@ 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 * as raw from './raw';
|
|
8
7
|
import copy from 'fast-copy';
|
|
8
|
+
import * as raw from './raw';
|
|
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
|
};
|
|
@@ -9,10 +9,10 @@ export var get = function get(http, params) {
|
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
if (!org) {
|
|
12
|
-
var error = new Error("No organization was found with the ID ".concat(params.organizationId, " instead got ").concat(JSON.stringify(data))); // eslint-disable-next-line @typescript-eslint/ban-ts-
|
|
12
|
+
var error = new Error("No organization was found with the ID ".concat(params.organizationId, " instead got ").concat(JSON.stringify(data))); // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
13
13
|
// @ts-ignore
|
|
14
14
|
|
|
15
|
-
error.status = 404; // eslint-disable-next-line @typescript-eslint/ban-ts-
|
|
15
|
+
error.status = 404; // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
16
16
|
// @ts-ignore
|
|
17
17
|
|
|
18
18
|
error.statusText = 'Not Found';
|
|
@@ -21,14 +21,14 @@ export var create = function create(http, params, payload, headers) {
|
|
|
21
21
|
}) : headers
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
|
-
export var update = function update(http, params,
|
|
25
|
-
var
|
|
24
|
+
export var update = function update(http, params, rawData, headers) {
|
|
25
|
+
var _rawData$sys$version;
|
|
26
26
|
|
|
27
|
-
var data = copy(
|
|
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({
|
|
31
|
-
'X-Contentful-Version': (
|
|
31
|
+
'X-Contentful-Version': (_rawData$sys$version = rawData.sys.version) !== null && _rawData$sys$version !== void 0 ? _rawData$sys$version : 0
|
|
32
32
|
}, headers)
|
|
33
33
|
});
|
|
34
34
|
};
|
|
@@ -53,7 +53,7 @@ export var RestAdapter = /*#__PURE__*/function () {
|
|
|
53
53
|
entityType = _ref.entityType, actionInput = _ref.action, params = _ref.params, payload = _ref.payload, headers = _ref.headers, userAgent = _ref.userAgent;
|
|
54
54
|
// `delete` is a reserved keyword. Therefore, the methods are called `del`.
|
|
55
55
|
action = actionInput === 'delete' ? 'del' : actionInput;
|
|
56
|
-
endpoint = // eslint-disable-next-line @typescript-eslint/ban-ts-
|
|
56
|
+
endpoint = // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
57
57
|
// @ts-ignore
|
|
58
58
|
(_endpoints$entityType = endpoints[entityType]) === null || _endpoints$entityType === void 0 ? void 0 : _endpoints$entityType[action];
|
|
59
59
|
|
|
@@ -9,7 +9,6 @@ var SidebarWidgetTypes = {
|
|
|
9
9
|
VERSIONS: 'versions-widget',
|
|
10
10
|
INFO_PANEL: 'info-panel',
|
|
11
11
|
JOBS: 'jobs-widget',
|
|
12
|
-
TASKS: 'content-workflows-tasks-widget',
|
|
13
12
|
COMMENTS_PANEL: 'comments-panel'
|
|
14
13
|
};
|
|
15
14
|
var Publication = {
|
|
@@ -24,12 +23,6 @@ var Releases = {
|
|
|
24
23
|
name: 'Release',
|
|
25
24
|
description: 'Built-in - View release, add to it, etc.'
|
|
26
25
|
};
|
|
27
|
-
var Tasks = {
|
|
28
|
-
widgetId: SidebarWidgetTypes.TASKS,
|
|
29
|
-
widgetNamespace: WidgetNamespace.SIDEBAR_BUILTIN,
|
|
30
|
-
name: 'Tasks',
|
|
31
|
-
description: 'Built-in - Assign tasks to be completed before publishing. Currently only supported for master environment.'
|
|
32
|
-
};
|
|
33
26
|
var ContentPreview = {
|
|
34
27
|
widgetId: SidebarWidgetTypes.CONTENT_PREVIEW,
|
|
35
28
|
widgetNamespace: WidgetNamespace.SIDEBAR_BUILTIN,
|
|
@@ -60,5 +53,5 @@ var Users = {
|
|
|
60
53
|
name: 'Users',
|
|
61
54
|
description: 'Built-in - Displays users on the same entry.'
|
|
62
55
|
};
|
|
63
|
-
export var SidebarEntryConfiguration = [Publication, Releases,
|
|
56
|
+
export var SidebarEntryConfiguration = [Publication, Releases, ContentPreview, Links, Translation, Versions, Users];
|
|
64
57
|
export var SidebarAssetConfiguration = [Publication, Releases, Links, Translation, Users];
|
|
@@ -24,7 +24,7 @@ function createClient(params) {
|
|
|
24
24
|
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
25
25
|
var sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
|
|
26
26
|
var userAgent = getUserAgentHeader( // @ts-expect-error
|
|
27
|
-
"".concat(sdkMain, "/").concat("7.
|
|
27
|
+
"".concat(sdkMain, "/").concat("7.45.3"), params.application, params.integration, params.feature);
|
|
28
28
|
var adapter = createAdapter(params); // Parameters<?> and ReturnType<?> only return the types of the last overload
|
|
29
29
|
// https://github.com/microsoft/TypeScript/issues/26591
|
|
30
30
|
// @ts-expect-error
|
|
@@ -47,7 +47,7 @@ function createLocaleApi(makeRequest) {
|
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
export function wrapLocale(makeRequest, data) {
|
|
50
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
51
51
|
// @ts-ignore
|
|
52
52
|
delete data.internal_code;
|
|
53
53
|
var locale = toPlainObject(copy(data));
|
|
@@ -24,7 +24,7 @@ export var asIterator = function asIterator(fn, params) {
|
|
|
24
24
|
var _this = this;
|
|
25
25
|
|
|
26
26
|
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
27
|
-
var _yield$currentResult, total, items, skip, limit, value, endOfPage, endOfList;
|
|
27
|
+
var _yield$currentResult, _yield$currentResult$, total, _yield$currentResult$2, items, _yield$currentResult$3, skip, _yield$currentResult$4, limit, value, endOfPage, endOfList;
|
|
28
28
|
|
|
29
29
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
30
30
|
while (1) {
|
|
@@ -35,13 +35,17 @@ export var asIterator = function asIterator(fn, params) {
|
|
|
35
35
|
|
|
36
36
|
case 2:
|
|
37
37
|
_yield$currentResult = _context.sent;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
_yield$currentResult$ = _yield$currentResult.total;
|
|
39
|
+
total = _yield$currentResult$ === void 0 ? 0 : _yield$currentResult$;
|
|
40
|
+
_yield$currentResult$2 = _yield$currentResult.items;
|
|
41
|
+
items = _yield$currentResult$2 === void 0 ? [] : _yield$currentResult$2;
|
|
42
|
+
_yield$currentResult$3 = _yield$currentResult.skip;
|
|
43
|
+
skip = _yield$currentResult$3 === void 0 ? 0 : _yield$currentResult$3;
|
|
44
|
+
_yield$currentResult$4 = _yield$currentResult.limit;
|
|
45
|
+
limit = _yield$currentResult$4 === void 0 ? 100 : _yield$currentResult$4;
|
|
42
46
|
|
|
43
47
|
if (!(total === _this.current)) {
|
|
44
|
-
_context.next =
|
|
48
|
+
_context.next = 13;
|
|
45
49
|
break;
|
|
46
50
|
}
|
|
47
51
|
|
|
@@ -50,7 +54,7 @@ export var asIterator = function asIterator(fn, params) {
|
|
|
50
54
|
value: null
|
|
51
55
|
});
|
|
52
56
|
|
|
53
|
-
case
|
|
57
|
+
case 13:
|
|
54
58
|
value = items[_this.current++ - skip];
|
|
55
59
|
endOfPage = _this.current % limit === 0;
|
|
56
60
|
endOfList = _this.current === total;
|
|
@@ -69,7 +73,7 @@ export var asIterator = function asIterator(fn, params) {
|
|
|
69
73
|
value: value
|
|
70
74
|
});
|
|
71
75
|
|
|
72
|
-
case
|
|
76
|
+
case 18:
|
|
73
77
|
case "end":
|
|
74
78
|
return _context.stop();
|
|
75
79
|
}
|
|
@@ -170,7 +170,7 @@ export default function createEntryApi(makeRequest: MakeRequest): {
|
|
|
170
170
|
* .catch(console.error)
|
|
171
171
|
* ```
|
|
172
172
|
*/
|
|
173
|
-
getSnapshots: (query?: {}) => Promise<import("./common-types").Collection<import("./export-types").Snapshot<EntryProps<
|
|
173
|
+
getSnapshots: (query?: {}) => Promise<import("./common-types").Collection<import("./export-types").Snapshot<EntryProps<import("./common-types").KeyValueMap>>, import("./export-types").SnapshotProps<EntryProps<import("./common-types").KeyValueMap>>>>;
|
|
174
174
|
/**
|
|
175
175
|
* Gets a snapshot of an entry
|
|
176
176
|
* @param snapshotId - Id of the snapshot
|
|
@@ -189,7 +189,7 @@ export default function createEntryApi(makeRequest: MakeRequest): {
|
|
|
189
189
|
* .catch(console.error)
|
|
190
190
|
* ```
|
|
191
191
|
*/
|
|
192
|
-
getSnapshot: (snapshotId: string) => Promise<import("./export-types").Snapshot<EntryProps<
|
|
192
|
+
getSnapshot: (snapshotId: string) => Promise<import("./export-types").Snapshot<EntryProps<import("./common-types").KeyValueMap>>>;
|
|
193
193
|
/**
|
|
194
194
|
* Creates a new comment for an entry
|
|
195
195
|
* @param data Object representation of the Comment to be created
|
|
@@ -327,5 +327,5 @@ export default function createEntryApi(makeRequest: MakeRequest): {
|
|
|
327
327
|
/**
|
|
328
328
|
* Recursively collects references of an entry and their descendants
|
|
329
329
|
*/
|
|
330
|
-
references: (options?: EntryReferenceOptionsProps | undefined) => Promise<import("./common-types").Collection<Entry, EntryProps<
|
|
330
|
+
references: (options?: EntryReferenceOptionsProps | undefined) => Promise<import("./common-types").Collection<Entry, EntryProps<import("./common-types").KeyValueMap>>>;
|
|
331
331
|
};
|
|
@@ -12,6 +12,7 @@ import type { ContentTypeProps, CreateContentTypeProps } from './entities/conten
|
|
|
12
12
|
import type { CreateEntryProps, EntryProps, EntryReferenceOptionsProps, EntryReferenceProps } from './entities/entry';
|
|
13
13
|
import type { CreateExtensionProps } from './entities/extension';
|
|
14
14
|
import type { CreateLocaleProps } from './entities/locale';
|
|
15
|
+
import { TagVisibility } from './entities/tag';
|
|
15
16
|
/**
|
|
16
17
|
* @private
|
|
17
18
|
*/
|
|
@@ -481,7 +482,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest): {
|
|
|
481
482
|
* .catch(console.error)
|
|
482
483
|
* ```
|
|
483
484
|
*/
|
|
484
|
-
getEntries(query?: QueryOptions): Promise<import("./common-types").Collection<import("./entities/entry").Entry, EntryProps<
|
|
485
|
+
getEntries(query?: QueryOptions): Promise<import("./common-types").Collection<import("./entities/entry").Entry, EntryProps<import("./common-types").KeyValueMap>>>;
|
|
485
486
|
/**
|
|
486
487
|
* Creates a Entry
|
|
487
488
|
* @param contentTypeId - The Content Type ID of the newly created Entry
|
|
@@ -1041,7 +1042,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest): {
|
|
|
1041
1042
|
* .catch(console.error)
|
|
1042
1043
|
* ```
|
|
1043
1044
|
*/
|
|
1044
|
-
getEntrySnapshots(entryId: string, query?: QueryOptions): Promise<import("./common-types").Collection<import("./export-types").Snapshot<EntryProps<
|
|
1045
|
+
getEntrySnapshots(entryId: string, query?: QueryOptions): Promise<import("./common-types").Collection<import("./export-types").Snapshot<EntryProps<import("./common-types").KeyValueMap>>, import("./export-types").SnapshotProps<EntryProps<import("./common-types").KeyValueMap>>>>;
|
|
1045
1046
|
/**
|
|
1046
1047
|
* Gets all snapshots of a contentType
|
|
1047
1048
|
* @func getContentTypeSnapshots
|
|
@@ -1063,7 +1064,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest): {
|
|
|
1063
1064
|
* ```
|
|
1064
1065
|
*/
|
|
1065
1066
|
getContentTypeSnapshots(contentTypeId: string, query?: QueryOptions): Promise<import("./common-types").Collection<import("./export-types").Snapshot<ContentTypeProps>, import("./export-types").SnapshotProps<ContentTypeProps>>>;
|
|
1066
|
-
createTag(id: string, name: string, visibility?:
|
|
1067
|
+
createTag(id: string, name: string, visibility?: TagVisibility | undefined): Promise<import("./entities/tag").Tag>;
|
|
1067
1068
|
getTags(query?: BasicQueryOptions): Promise<import("./common-types").Collection<import("./entities/tag").Tag, import("./entities/tag").TagProps>>;
|
|
1068
1069
|
getTag(id: string): Promise<import("./entities/tag").Tag>;
|
|
1069
1070
|
/**
|