contentful-management 11.55.0-canary.2 → 11.55.0-canary.4
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 +20 -2
- package/dist/contentful-management.browser.js.map +1 -1
- package/dist/contentful-management.browser.min.js +1 -1
- package/dist/contentful-management.node.js +20 -2
- 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/entry.js +4 -0
- package/dist/es-modules/adapters/REST/endpoints/release-entry.js +11 -0
- package/dist/es-modules/contentful-management.js +1 -1
- package/dist/es-modules/plain/plain-client.js +2 -1
- package/dist/typings/adapters/REST/endpoints/release-entry.d.ts +1 -0
- package/dist/typings/common-types.d.ts +43 -8
- package/dist/typings/plain/common-types.d.ts +17 -18
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
6
6
|
import copy from 'fast-copy';
|
|
7
7
|
import * as raw from './raw';
|
|
8
8
|
import { normalizeSelect } from './utils';
|
|
9
|
+
import * as releaseEntry from './release-entry';
|
|
9
10
|
export const get = (http, params, rawData, headers) => {
|
|
10
11
|
if (params.releaseId) {
|
|
11
12
|
params.query = _objectSpread(_objectSpread({}, params.query), {}, {
|
|
@@ -35,6 +36,9 @@ export const getMany = (http, params, rawData, headers) => {
|
|
|
35
36
|
});
|
|
36
37
|
};
|
|
37
38
|
export const patch = (http, params, data, headers) => {
|
|
39
|
+
if (params.releaseId) {
|
|
40
|
+
return releaseEntry.patch(http, params, data, headers !== null && headers !== void 0 ? headers : {});
|
|
41
|
+
}
|
|
38
42
|
return raw.patch(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/entries/${params.entryId}`, data, {
|
|
39
43
|
headers: _objectSpread({
|
|
40
44
|
'X-Contentful-Version': params.version,
|
|
@@ -38,4 +38,15 @@ export const patch = (http, params, data, headers) => {
|
|
|
38
38
|
'Content-Type': 'application/json-patch+json'
|
|
39
39
|
}, headers)
|
|
40
40
|
});
|
|
41
|
+
};
|
|
42
|
+
export const createWithId = (http, params, rawData, headers) => {
|
|
43
|
+
params.query = _objectSpread(_objectSpread({}, params.query), {}, {
|
|
44
|
+
'sys.schemaVersion': 'Release.V2'
|
|
45
|
+
});
|
|
46
|
+
const data = copy(rawData);
|
|
47
|
+
return raw.put(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/releases/${params.releaseId}/entries/${params.entryId}`, data, {
|
|
48
|
+
headers: _objectSpread({
|
|
49
|
+
'X-Contentful-Content-Type': params.contentTypeId
|
|
50
|
+
}, headers)
|
|
51
|
+
});
|
|
41
52
|
};
|
|
@@ -47,7 +47,7 @@ function createClient(params, opts = {}) {
|
|
|
47
47
|
const sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
|
|
48
48
|
const userAgent = getUserAgentHeader(
|
|
49
49
|
// @ts-expect-error
|
|
50
|
-
`${sdkMain}/${"11.55.0-canary.
|
|
50
|
+
`${sdkMain}/${"11.55.0-canary.4"}`, params.application, params.integration, params.feature);
|
|
51
51
|
const adapter = createAdapter(_objectSpread(_objectSpread({}, params), {}, {
|
|
52
52
|
userAgent
|
|
53
53
|
}));
|
|
@@ -347,7 +347,8 @@ export const createPlainClient = (makeRequest, defaults) => {
|
|
|
347
347
|
get: wrap(wrapParams, 'ReleaseEntry', 'get'),
|
|
348
348
|
getMany: wrap(wrapParams, 'ReleaseEntry', 'getMany'),
|
|
349
349
|
update: wrap(wrapParams, 'ReleaseEntry', 'update'),
|
|
350
|
-
patch: wrap(wrapParams, 'ReleaseEntry', 'patch')
|
|
350
|
+
patch: wrap(wrapParams, 'ReleaseEntry', 'patch'),
|
|
351
|
+
createWithId: wrap(wrapParams, 'ReleaseEntry', 'createWithId')
|
|
351
352
|
},
|
|
352
353
|
archive: wrap(wrapParams, 'Release', 'archive'),
|
|
353
354
|
get: wrap(wrapParams, 'Release', 'get'),
|
|
@@ -3,3 +3,4 @@ export declare const get: RestEndpoint<'ReleaseEntry', 'get'>;
|
|
|
3
3
|
export declare const getMany: RestEndpoint<'ReleaseEntry', 'getMany'>;
|
|
4
4
|
export declare const update: RestEndpoint<'ReleaseEntry', 'update'>;
|
|
5
5
|
export declare const patch: RestEndpoint<'ReleaseEntry', 'patch'>;
|
|
6
|
+
export declare const createWithId: RestEndpoint<'ReleaseEntry', 'createWithId'>;
|
|
@@ -451,6 +451,11 @@ type MRInternal<UA extends boolean> = {
|
|
|
451
451
|
(opts: MROpts<'ReleaseAction', 'get', UA>): MRReturn<'ReleaseAction', 'get'>;
|
|
452
452
|
(opts: MROpts<'ReleaseAction', 'getMany', UA>): MRReturn<'ReleaseAction', 'getMany'>;
|
|
453
453
|
(opts: MROpts<'ReleaseAction', 'queryForRelease', UA>): MRReturn<'ReleaseAction', 'queryForRelease'>;
|
|
454
|
+
(opts: MROpts<'ReleaseEntry', 'get', UA>): MRReturn<'ReleaseEntry', 'get'>;
|
|
455
|
+
(opts: MROpts<'ReleaseEntry', 'getMany', UA>): MRReturn<'ReleaseEntry', 'getMany'>;
|
|
456
|
+
(opts: MROpts<'ReleaseEntry', 'update', UA>): MRReturn<'ReleaseEntry', 'update'>;
|
|
457
|
+
(opts: MROpts<'ReleaseEntry', 'patch', UA>): MRReturn<'ReleaseEntry', 'patch'>;
|
|
458
|
+
(opts: MROpts<'ReleaseEntry', 'createWithId', UA>): MRReturn<'ReleaseEntry', 'createWithId'>;
|
|
454
459
|
(opts: MROpts<'Resource', 'getMany', UA>): MRReturn<'Resource', 'getMany'>;
|
|
455
460
|
(opts: MROpts<'ResourceProvider', 'get', UA>): MRReturn<'ResourceProvider', 'get'>;
|
|
456
461
|
(opts: MROpts<'ResourceProvider', 'upsert', UA>): MRReturn<'ResourceProvider', 'upsert'>;
|
|
@@ -1488,20 +1493,15 @@ export type MRActions = {
|
|
|
1488
1493
|
return: CollectionProp<EntryProps<any>>;
|
|
1489
1494
|
};
|
|
1490
1495
|
getMany: {
|
|
1491
|
-
params:
|
|
1492
|
-
releaseId?: string;
|
|
1493
|
-
};
|
|
1496
|
+
params: GetManyEntryParams & QueryParams;
|
|
1494
1497
|
return: CollectionProp<EntryProps<any, any>>;
|
|
1495
1498
|
};
|
|
1496
1499
|
get: {
|
|
1497
|
-
params:
|
|
1500
|
+
params: GetEntryParams & QueryParams;
|
|
1498
1501
|
return: EntryProps<any, any>;
|
|
1499
1502
|
};
|
|
1500
1503
|
patch: {
|
|
1501
|
-
params:
|
|
1502
|
-
entryId: string;
|
|
1503
|
-
version: number;
|
|
1504
|
-
};
|
|
1504
|
+
params: PatchEntryParams & QueryParams;
|
|
1505
1505
|
payload: OpPatch[];
|
|
1506
1506
|
headers?: RawAxiosRequestHeaders;
|
|
1507
1507
|
return: EntryProps<any>;
|
|
@@ -1895,6 +1895,24 @@ export type MRActions = {
|
|
|
1895
1895
|
};
|
|
1896
1896
|
}>;
|
|
1897
1897
|
};
|
|
1898
|
+
createWithId: {
|
|
1899
|
+
params: GetSpaceEnvironmentParams & {
|
|
1900
|
+
releaseId: string;
|
|
1901
|
+
entryId: string;
|
|
1902
|
+
contentTypeId: string;
|
|
1903
|
+
};
|
|
1904
|
+
payload: CreateEntryProps<any>;
|
|
1905
|
+
headers?: RawAxiosRequestHeaders;
|
|
1906
|
+
return: EntryProps<any, {
|
|
1907
|
+
release: {
|
|
1908
|
+
sys: {
|
|
1909
|
+
type: 'Link';
|
|
1910
|
+
linkType: 'Entry' | 'Asset';
|
|
1911
|
+
id: string;
|
|
1912
|
+
};
|
|
1913
|
+
};
|
|
1914
|
+
}>;
|
|
1915
|
+
};
|
|
1898
1916
|
};
|
|
1899
1917
|
ReleaseAction: {
|
|
1900
1918
|
get: {
|
|
@@ -2569,6 +2587,15 @@ export type GetEditorInterfaceParams = GetSpaceEnvironmentParams & {
|
|
|
2569
2587
|
};
|
|
2570
2588
|
export type GetEntryParams = GetSpaceEnvironmentParams & {
|
|
2571
2589
|
entryId: string;
|
|
2590
|
+
releaseId?: string;
|
|
2591
|
+
};
|
|
2592
|
+
export type GetManyEntryParams = GetSpaceEnvironmentParams & {
|
|
2593
|
+
releaseId?: string;
|
|
2594
|
+
};
|
|
2595
|
+
export type PatchEntryParams = GetSpaceEnvironmentParams & {
|
|
2596
|
+
entryId: string;
|
|
2597
|
+
version: number;
|
|
2598
|
+
releaseId?: string;
|
|
2572
2599
|
};
|
|
2573
2600
|
export type GetExtensionParams = GetSpaceEnvironmentParams & {
|
|
2574
2601
|
extensionId: string;
|
|
@@ -2604,9 +2631,17 @@ export type GetManyReleaseEntryParams = GetSpaceEnvironmentParams & {
|
|
|
2604
2631
|
};
|
|
2605
2632
|
export type UpdateReleaseEntryParams = GetSpaceEnvironmentParams & {
|
|
2606
2633
|
releaseId: string;
|
|
2634
|
+
entryId: string;
|
|
2607
2635
|
};
|
|
2608
2636
|
export type PatchReleaseEntryParams = GetSpaceEnvironmentParams & {
|
|
2609
2637
|
releaseId: string;
|
|
2638
|
+
entryId: string;
|
|
2639
|
+
version: number;
|
|
2640
|
+
};
|
|
2641
|
+
export type CreateWithIdReleaseEntryParams = GetSpaceEnvironmentParams & {
|
|
2642
|
+
releaseId: string;
|
|
2643
|
+
entryId: string;
|
|
2644
|
+
contentTypeId: string;
|
|
2610
2645
|
};
|
|
2611
2646
|
export type GetSnapshotForContentTypeParams = GetSpaceEnvironmentParams & {
|
|
2612
2647
|
contentTypeId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RawAxiosRequestConfig, RawAxiosRequestHeaders } from 'axios';
|
|
2
2
|
import type { OpPatch } from 'json-patch';
|
|
3
|
-
import type { BasicCursorPaginationOptions, CollectionProp, CursorPaginatedCollectionProp, EnvironmentTemplateParams, GetBulkActionParams, GetContentTypeParams, GetEnvironmentTemplateParams, GetManyReleaseEntryParams, GetOrganizationMembershipParams, GetOrganizationParams, GetReleaseEntryParams, GetReleaseParams, GetSnapshotForContentTypeParams, GetSnapshotForEntryParams, GetSpaceEnvironmentParams, GetSpaceParams, KeyValueMap, PatchReleaseEntryParams, QueryParams, ReleaseEnvironmentParams, UpdateReleaseEntryParams } from '../common-types';
|
|
3
|
+
import type { BasicCursorPaginationOptions, CollectionProp, CreateWithIdReleaseEntryParams, CursorPaginatedCollectionProp, EnvironmentTemplateParams, GetBulkActionParams, GetContentTypeParams, GetEntryParams, GetEnvironmentTemplateParams, GetManyEntryParams, GetManyReleaseEntryParams, GetOrganizationMembershipParams, GetOrganizationParams, GetReleaseEntryParams, GetReleaseParams, GetSnapshotForContentTypeParams, GetSnapshotForEntryParams, GetSpaceEnvironmentParams, GetSpaceParams, KeyValueMap, PatchEntryParams, PatchReleaseEntryParams, QueryParams, ReleaseEnvironmentParams, UpdateReleaseEntryParams } from '../common-types';
|
|
4
4
|
import type { AccessTokenProps, CreatePersonalAccessTokenProps as CreatePATProps } from '../entities/access-token';
|
|
5
5
|
import type { ApiKeyProps, CreateApiKeyProps } from '../entities/api-key';
|
|
6
6
|
import type { AssetFileProp, AssetProcessingForLocale, AssetProps, CreateAssetProps } from '../entities/asset';
|
|
@@ -162,9 +162,7 @@ export type PlainClientAPI = {
|
|
|
162
162
|
user: UserPlainClientAPI;
|
|
163
163
|
entry: {
|
|
164
164
|
getPublished<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetSpaceEnvironmentParams & QueryParams>, rawData?: unknown, headers?: RawAxiosRequestHeaders): Promise<CollectionProp<EntryProps<T>>>;
|
|
165
|
-
getMany<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<
|
|
166
|
-
releaseId?: string;
|
|
167
|
-
}>, rawData?: unknown, headers?: RawAxiosRequestHeaders): Promise<CollectionProp<EntryProps<T, {
|
|
165
|
+
getMany<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetManyEntryParams & QueryParams>, rawData?: unknown, headers?: RawAxiosRequestHeaders): Promise<CollectionProp<EntryProps<T, {
|
|
168
166
|
release: {
|
|
169
167
|
sys: {
|
|
170
168
|
type: 'Link';
|
|
@@ -173,7 +171,7 @@ export type PlainClientAPI = {
|
|
|
173
171
|
};
|
|
174
172
|
};
|
|
175
173
|
}>>>;
|
|
176
|
-
get<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<
|
|
174
|
+
get<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetEntryParams & QueryParams>, rawData?: unknown, headers?: RawAxiosRequestHeaders): Promise<EntryProps<T, {
|
|
177
175
|
release: {
|
|
178
176
|
sys: {
|
|
179
177
|
type: 'Link';
|
|
@@ -185,10 +183,7 @@ export type PlainClientAPI = {
|
|
|
185
183
|
update<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetSpaceEnvironmentParams & {
|
|
186
184
|
entryId: string;
|
|
187
185
|
}>, rawData: EntryProps<T>, headers?: RawAxiosRequestHeaders): Promise<EntryProps<T>>;
|
|
188
|
-
patch<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<
|
|
189
|
-
entryId: string;
|
|
190
|
-
version?: number;
|
|
191
|
-
}>, rawData: OpPatch[], headers?: RawAxiosRequestHeaders): Promise<EntryProps<T>>;
|
|
186
|
+
patch<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<PatchEntryParams & QueryParams>, rawData: OpPatch[], headers?: RawAxiosRequestHeaders): Promise<EntryProps<T>>;
|
|
192
187
|
delete(params: OptionalDefaults<GetSpaceEnvironmentParams & {
|
|
193
188
|
entryId: string;
|
|
194
189
|
}>): Promise<any>;
|
|
@@ -283,7 +278,7 @@ export type PlainClientAPI = {
|
|
|
283
278
|
usage: UsagePlainClientAPI;
|
|
284
279
|
release: {
|
|
285
280
|
entry: {
|
|
286
|
-
get<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetReleaseEntryParams>): Promise<EntryProps<T, {
|
|
281
|
+
get<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetReleaseEntryParams & QueryParams>): Promise<EntryProps<T, {
|
|
287
282
|
release: {
|
|
288
283
|
sys: {
|
|
289
284
|
type: 'Link';
|
|
@@ -292,7 +287,7 @@ export type PlainClientAPI = {
|
|
|
292
287
|
};
|
|
293
288
|
};
|
|
294
289
|
}>>;
|
|
295
|
-
getMany<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetManyReleaseEntryParams>): Promise<CollectionProp<EntryProps<T, {
|
|
290
|
+
getMany<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetManyReleaseEntryParams & QueryParams>): Promise<CollectionProp<EntryProps<T, {
|
|
296
291
|
release: {
|
|
297
292
|
sys: {
|
|
298
293
|
type: 'Link';
|
|
@@ -301,9 +296,16 @@ export type PlainClientAPI = {
|
|
|
301
296
|
};
|
|
302
297
|
};
|
|
303
298
|
}>>>;
|
|
304
|
-
update<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<UpdateReleaseEntryParams & {
|
|
305
|
-
|
|
306
|
-
|
|
299
|
+
update<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<UpdateReleaseEntryParams & QueryParams>, rawData: EntryProps<T>, headers?: RawAxiosRequestHeaders): Promise<EntryProps<T, {
|
|
300
|
+
release: {
|
|
301
|
+
sys: {
|
|
302
|
+
type: 'Link';
|
|
303
|
+
linkType: 'Entry' | 'Asset';
|
|
304
|
+
id: string;
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
}>>;
|
|
308
|
+
patch<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<PatchReleaseEntryParams & QueryParams>, rawData: OpPatch[], headers?: RawAxiosRequestHeaders): Promise<EntryProps<T, {
|
|
307
309
|
release: {
|
|
308
310
|
sys: {
|
|
309
311
|
type: 'Link';
|
|
@@ -312,10 +314,7 @@ export type PlainClientAPI = {
|
|
|
312
314
|
};
|
|
313
315
|
};
|
|
314
316
|
}>>;
|
|
315
|
-
|
|
316
|
-
entryId: string;
|
|
317
|
-
version: number;
|
|
318
|
-
}>, rawData: OpPatch[], headers?: RawAxiosRequestHeaders): Promise<EntryProps<T, {
|
|
317
|
+
createWithId<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<CreateWithIdReleaseEntryParams & QueryParams>, rawData: CreateEntryProps<T>, headers?: RawAxiosRequestHeaders): Promise<EntryProps<T, {
|
|
319
318
|
release: {
|
|
320
319
|
sys: {
|
|
321
320
|
type: 'Link';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contentful-management",
|
|
3
|
-
"version": "11.55.0-canary.
|
|
3
|
+
"version": "11.55.0-canary.4",
|
|
4
4
|
"description": "Client for Contentful's Content Management API",
|
|
5
5
|
"homepage": "https://www.contentful.com/developers/documentation/content-management-api/",
|
|
6
6
|
"main": "./dist/contentful-management.node.js",
|