contentful-management 11.55.0-canary.2 → 11.55.0-canary.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 +15 -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 +15 -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/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 +31 -0
- package/dist/typings/plain/common-types.d.ts +14 -10
- package/package.json +1 -1
|
@@ -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.3"}`, 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'>;
|
|
@@ -1895,6 +1900,24 @@ export type MRActions = {
|
|
|
1895
1900
|
};
|
|
1896
1901
|
}>;
|
|
1897
1902
|
};
|
|
1903
|
+
createWithId: {
|
|
1904
|
+
params: GetSpaceEnvironmentParams & {
|
|
1905
|
+
releaseId: string;
|
|
1906
|
+
entryId: string;
|
|
1907
|
+
contentTypeId: string;
|
|
1908
|
+
};
|
|
1909
|
+
payload: CreateEntryProps<any>;
|
|
1910
|
+
headers?: RawAxiosRequestHeaders;
|
|
1911
|
+
return: EntryProps<any, {
|
|
1912
|
+
release: {
|
|
1913
|
+
sys: {
|
|
1914
|
+
type: 'Link';
|
|
1915
|
+
linkType: 'Entry' | 'Asset';
|
|
1916
|
+
id: string;
|
|
1917
|
+
};
|
|
1918
|
+
};
|
|
1919
|
+
}>;
|
|
1920
|
+
};
|
|
1898
1921
|
};
|
|
1899
1922
|
ReleaseAction: {
|
|
1900
1923
|
get: {
|
|
@@ -2604,9 +2627,17 @@ export type GetManyReleaseEntryParams = GetSpaceEnvironmentParams & {
|
|
|
2604
2627
|
};
|
|
2605
2628
|
export type UpdateReleaseEntryParams = GetSpaceEnvironmentParams & {
|
|
2606
2629
|
releaseId: string;
|
|
2630
|
+
entryId: string;
|
|
2607
2631
|
};
|
|
2608
2632
|
export type PatchReleaseEntryParams = GetSpaceEnvironmentParams & {
|
|
2609
2633
|
releaseId: string;
|
|
2634
|
+
entryId: string;
|
|
2635
|
+
version: number;
|
|
2636
|
+
};
|
|
2637
|
+
export type CreateWithIdReleaseEntryParams = GetSpaceEnvironmentParams & {
|
|
2638
|
+
releaseId: string;
|
|
2639
|
+
entryId: string;
|
|
2640
|
+
contentTypeId: string;
|
|
2610
2641
|
};
|
|
2611
2642
|
export type GetSnapshotForContentTypeParams = GetSpaceEnvironmentParams & {
|
|
2612
2643
|
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, GetEnvironmentTemplateParams, GetManyReleaseEntryParams, GetOrganizationMembershipParams, GetOrganizationParams, GetReleaseEntryParams, GetReleaseParams, GetSnapshotForContentTypeParams, GetSnapshotForEntryParams, GetSpaceEnvironmentParams, GetSpaceParams, KeyValueMap, 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';
|
|
@@ -283,7 +283,7 @@ export type PlainClientAPI = {
|
|
|
283
283
|
usage: UsagePlainClientAPI;
|
|
284
284
|
release: {
|
|
285
285
|
entry: {
|
|
286
|
-
get<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetReleaseEntryParams>): Promise<EntryProps<T, {
|
|
286
|
+
get<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetReleaseEntryParams & QueryParams>): Promise<EntryProps<T, {
|
|
287
287
|
release: {
|
|
288
288
|
sys: {
|
|
289
289
|
type: 'Link';
|
|
@@ -292,7 +292,7 @@ export type PlainClientAPI = {
|
|
|
292
292
|
};
|
|
293
293
|
};
|
|
294
294
|
}>>;
|
|
295
|
-
getMany<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetManyReleaseEntryParams>): Promise<CollectionProp<EntryProps<T, {
|
|
295
|
+
getMany<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetManyReleaseEntryParams & QueryParams>): Promise<CollectionProp<EntryProps<T, {
|
|
296
296
|
release: {
|
|
297
297
|
sys: {
|
|
298
298
|
type: 'Link';
|
|
@@ -301,9 +301,7 @@ export type PlainClientAPI = {
|
|
|
301
301
|
};
|
|
302
302
|
};
|
|
303
303
|
}>>>;
|
|
304
|
-
update<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<UpdateReleaseEntryParams & {
|
|
305
|
-
entryId: string;
|
|
306
|
-
}>, rawData: EntryProps<T>, headers?: RawAxiosRequestHeaders): Promise<EntryProps<T, {
|
|
304
|
+
update<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<UpdateReleaseEntryParams & QueryParams>, rawData: EntryProps<T>, headers?: RawAxiosRequestHeaders): Promise<EntryProps<T, {
|
|
307
305
|
release: {
|
|
308
306
|
sys: {
|
|
309
307
|
type: 'Link';
|
|
@@ -312,10 +310,16 @@ export type PlainClientAPI = {
|
|
|
312
310
|
};
|
|
313
311
|
};
|
|
314
312
|
}>>;
|
|
315
|
-
patch<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<PatchReleaseEntryParams & {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
313
|
+
patch<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<PatchReleaseEntryParams & QueryParams>, rawData: OpPatch[], headers?: RawAxiosRequestHeaders): Promise<EntryProps<T, {
|
|
314
|
+
release: {
|
|
315
|
+
sys: {
|
|
316
|
+
type: 'Link';
|
|
317
|
+
linkType: 'Entry' | 'Asset';
|
|
318
|
+
id: string;
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
}>>;
|
|
322
|
+
createWithId<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<CreateWithIdReleaseEntryParams & QueryParams>, rawData: CreateEntryProps<T>, headers?: RawAxiosRequestHeaders): Promise<EntryProps<T, {
|
|
319
323
|
release: {
|
|
320
324
|
sys: {
|
|
321
325
|
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.3",
|
|
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",
|