contentful-management 11.57.1 → 11.58.0-canary.1

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.
@@ -18,6 +18,8 @@ export interface ReleaseQueryOptions {
18
18
  'sys.createdBy.sys.id[in]'?: string;
19
19
  /** Comma-separated filter (inclusion) by Release status (active, archived) */
20
20
  'sys.status[in]'?: ReleaseStatus;
21
+ /** Determines the Release API version to use. 'Release.v1' refers to Launch, 'Release.v2' refers to Releases. */
22
+ 'sys.schemaVersion'?: 'Release.v1' | 'Release.v2';
21
23
  /** Comma-separated filter (exclusion) by Release status (active, archived) */
22
24
  'sys.status[nin]'?: ReleaseStatus;
23
25
  /** Find releases using full text phrase and term matching */
@@ -55,6 +57,7 @@ export type ReleaseSysProps = {
55
57
  createdAt: ISO8601Timestamp;
56
58
  updatedAt: ISO8601Timestamp;
57
59
  lastAction?: Link<'ReleaseAction'>;
60
+ schemaVersion?: 'Release.v2';
58
61
  };
59
62
  export type ReleaseReferenceFilters = ScheduledActionReferenceFilters;
60
63
  export declare const ReleaseReferenceFilters: typeof ScheduledActionReferenceFilters;
@@ -72,9 +75,23 @@ export interface ReleaseProps {
72
75
  metadata?: ReleaseMetadata;
73
76
  }
74
77
  export interface ReleasePayload extends MakeRequestPayload {
78
+ sys?: {
79
+ type: 'Release';
80
+ schemaVersion?: 'Release.v1' | undefined;
81
+ };
75
82
  title: string;
76
83
  entities: BaseCollection<Link<Entity>>;
77
84
  }
85
+ export interface ReleasePayloadV2 extends MakeRequestPayload {
86
+ sys?: {
87
+ type: 'Release';
88
+ schemaVersion: 'Release.v2';
89
+ };
90
+ title: string;
91
+ entities: BaseCollection<{
92
+ entity: Link<Entity>;
93
+ } & ReleaseValidatePayload>;
94
+ }
78
95
  export interface ReleaseValidatePayload {
79
96
  action?: 'publish';
80
97
  }
@@ -95,7 +112,7 @@ export interface ReleaseApiMethods {
95
112
  * */
96
113
  unarchive(): Promise<Release>;
97
114
  /** Updates a Release and returns the updated Release object */
98
- update(payload: ReleasePayload): Promise<Release>;
115
+ update(payload: ReleasePayload | ReleasePayloadV2): Promise<Release>;
99
116
  /** Deletes a Release and all ReleaseActions linked to it (non-reversible) */
100
117
  delete(): Promise<void>;
101
118
  /** Publishes a Release and waits until the asynchronous action is completed */
@@ -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, GetOrganizationMembershipParams, GetOrganizationParams, GetReleaseParams, GetSnapshotForContentTypeParams, GetSnapshotForEntryParams, GetSpaceEnvironmentParams, GetSpaceParams, KeyValueMap, QueryParams } from '../common-types';
3
+ import type { BasicCursorPaginationOptions, CollectionProp, CreateReleaseEntryParams, CreateWithIdReleaseEntryParams, CursorPaginatedCollectionProp, EnvironmentTemplateParams, GetBulkActionParams, GetContentTypeParams, GetEntryParams, GetEnvironmentTemplateParams, GetManyEntryParams, GetManyReleaseEntryParams, GetOrganizationMembershipParams, GetOrganizationParams, GetReleaseEntryParams, GetReleaseParams, GetSnapshotForContentTypeParams, GetSnapshotForEntryParams, GetSpaceEnvironmentParams, GetSpaceParams, KeyValueMap, PatchEntryParams, PatchReleaseEntryParams, QueryParams, ReleaseEnvironmentParams, UpdateEntryParams, 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';
@@ -14,7 +14,7 @@ import type { CreateOrganizationInvitationProps, OrganizationInvitationProps } f
14
14
  import type { OrganizationMembershipProps } from '../entities/organization-membership';
15
15
  import type { CreatePersonalAccessTokenProps, PersonalAccessTokenProps } from '../entities/personal-access-token';
16
16
  import type { PreviewApiKeyProps } from '../entities/preview-api-key';
17
- import type { ReleasePayload, ReleaseProps, ReleaseQueryOptions, ReleaseValidatePayload } from '../entities/release';
17
+ import type { ReleasePayload, ReleasePayloadV2, ReleaseProps, ReleaseQueryOptions, ReleaseValidatePayload } from '../entities/release';
18
18
  import type { ReleaseActionProps, ReleaseActionQueryOptions } from '../entities/release-action';
19
19
  import type { CreateUpdateScheduledActionProps, ScheduledActionProps } from '../entities/scheduled-action';
20
20
  import type { SnapshotProps } from '../entities/snapshot';
@@ -162,17 +162,26 @@ 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<GetSpaceEnvironmentParams & QueryParams>, rawData?: unknown, headers?: RawAxiosRequestHeaders): Promise<CollectionProp<EntryProps<T>>>;
166
- get<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetSpaceEnvironmentParams & {
167
- entryId: string;
168
- }>, rawData?: unknown, headers?: RawAxiosRequestHeaders): Promise<EntryProps<T>>;
169
- update<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetSpaceEnvironmentParams & {
170
- entryId: string;
171
- }>, rawData: EntryProps<T>, headers?: RawAxiosRequestHeaders): Promise<EntryProps<T>>;
172
- patch<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetSpaceEnvironmentParams & {
173
- entryId: string;
174
- version?: number;
175
- }>, rawData: OpPatch[], headers?: RawAxiosRequestHeaders): Promise<EntryProps<T>>;
165
+ getMany<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetManyEntryParams & QueryParams>, rawData?: unknown, headers?: RawAxiosRequestHeaders): Promise<CollectionProp<EntryProps<T, {
166
+ release: {
167
+ sys: {
168
+ type: 'Link';
169
+ linkType: 'Entry' | 'Asset';
170
+ id: string;
171
+ };
172
+ };
173
+ }>>>;
174
+ get<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetEntryParams & QueryParams>, rawData?: unknown, headers?: RawAxiosRequestHeaders): Promise<EntryProps<T, {
175
+ release: {
176
+ sys: {
177
+ type: 'Link';
178
+ linkType: 'Entry' | 'Asset';
179
+ id: string;
180
+ };
181
+ };
182
+ }>>;
183
+ update<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<UpdateEntryParams & QueryParams>, rawData: EntryProps<T>, headers?: RawAxiosRequestHeaders): Promise<EntryProps<T>>;
184
+ patch<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<PatchEntryParams & QueryParams>, rawData: OpPatch[], headers?: RawAxiosRequestHeaders): Promise<EntryProps<T>>;
176
185
  delete(params: OptionalDefaults<GetSpaceEnvironmentParams & {
177
186
  entryId: string;
178
187
  }>): Promise<any>;
@@ -192,11 +201,21 @@ export type PlainClientAPI = {
192
201
  }>): Promise<EntryProps<T>>;
193
202
  create<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetSpaceEnvironmentParams & {
194
203
  contentTypeId: string;
195
- }>, rawData: CreateEntryProps<T>): Promise<EntryProps<T>>;
204
+ releaseId?: string;
205
+ } & QueryParams>, rawData: CreateEntryProps<T>): Promise<EntryProps<T>>;
196
206
  createWithId<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetSpaceEnvironmentParams & {
197
207
  entryId: string;
198
208
  contentTypeId: string;
199
- }>, rawData: CreateEntryProps<T>): Promise<EntryProps<T>>;
209
+ releaseId?: string;
210
+ }>, rawData: CreateEntryProps<T>): Promise<EntryProps<T, {
211
+ release: {
212
+ sys: {
213
+ type: 'Link';
214
+ linkType: 'Entry' | 'Asset';
215
+ id: string;
216
+ };
217
+ };
218
+ }>>;
200
219
  references(params: OptionalDefaults<GetSpaceEnvironmentParams & {
201
220
  entryId: string;
202
221
  include?: number;
@@ -266,6 +285,62 @@ export type PlainClientAPI = {
266
285
  };
267
286
  usage: UsagePlainClientAPI;
268
287
  release: {
288
+ entry: {
289
+ get<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetReleaseEntryParams & QueryParams>): Promise<EntryProps<T, {
290
+ release: {
291
+ sys: {
292
+ type: 'Link';
293
+ linkType: 'Entry' | 'Asset';
294
+ id: string;
295
+ };
296
+ };
297
+ }>>;
298
+ getMany<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetManyReleaseEntryParams & QueryParams>): Promise<CollectionProp<EntryProps<T, {
299
+ release: {
300
+ sys: {
301
+ type: 'Link';
302
+ linkType: 'Entry' | 'Asset';
303
+ id: string;
304
+ };
305
+ };
306
+ }>>>;
307
+ update<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<UpdateReleaseEntryParams & QueryParams>, rawData: EntryProps<T>, headers?: RawAxiosRequestHeaders): Promise<EntryProps<T, {
308
+ release: {
309
+ sys: {
310
+ type: 'Link';
311
+ linkType: 'Entry' | 'Asset';
312
+ id: string;
313
+ };
314
+ };
315
+ }>>;
316
+ patch<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<PatchReleaseEntryParams & QueryParams>, rawData: OpPatch[], headers?: RawAxiosRequestHeaders): Promise<EntryProps<T, {
317
+ release: {
318
+ sys: {
319
+ type: 'Link';
320
+ linkType: 'Entry' | 'Asset';
321
+ id: string;
322
+ };
323
+ };
324
+ }>>;
325
+ create<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<CreateReleaseEntryParams & QueryParams>, rawData: CreateEntryProps<T>, headers?: RawAxiosRequestHeaders): Promise<EntryProps<T, {
326
+ release: {
327
+ sys: {
328
+ type: 'Link';
329
+ linkType: 'Entry' | 'Asset';
330
+ id: string;
331
+ };
332
+ };
333
+ }>>;
334
+ createWithId<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<CreateWithIdReleaseEntryParams & QueryParams>, rawData: CreateEntryProps<T>, headers?: RawAxiosRequestHeaders): Promise<EntryProps<T, {
335
+ release: {
336
+ sys: {
337
+ type: 'Link';
338
+ linkType: 'Entry' | 'Asset';
339
+ id: string;
340
+ };
341
+ };
342
+ }>>;
343
+ };
269
344
  archive(params: OptionalDefaults<GetReleaseParams & {
270
345
  version: number;
271
346
  }>): Promise<ReleaseProps>;
@@ -273,10 +348,10 @@ export type PlainClientAPI = {
273
348
  query(params: OptionalDefaults<GetSpaceEnvironmentParams> & {
274
349
  query?: ReleaseQueryOptions;
275
350
  }): Promise<CursorPaginatedCollectionProp<ReleaseProps>>;
276
- create(params: OptionalDefaults<GetSpaceEnvironmentParams>, data: ReleasePayload): Promise<ReleaseProps>;
351
+ create(params: OptionalDefaults<ReleaseEnvironmentParams>, data: ReleasePayload | ReleasePayloadV2): Promise<ReleaseProps>;
277
352
  update(params: OptionalDefaults<GetReleaseParams & {
278
353
  version: number;
279
- }>, data: ReleasePayload): Promise<ReleaseProps>;
354
+ }>, data: ReleasePayload | ReleasePayloadV2): Promise<ReleaseProps>;
280
355
  delete(params: OptionalDefaults<GetReleaseParams>): Promise<void>;
281
356
  publish(params: OptionalDefaults<GetReleaseParams & {
282
357
  version: number;
@@ -3,6 +3,8 @@ export type DefaultParams = {
3
3
  spaceId?: string;
4
4
  environmentId?: string;
5
5
  organizationId?: string;
6
+ releaseSchemaVersion?: 'Release.v1' | 'Release.v2';
7
+ releaseId?: string;
6
8
  };
7
9
  /**
8
10
  * @private
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentful-management",
3
- "version": "11.57.1",
3
+ "version": "11.58.0-canary.1",
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",
@@ -45,7 +45,7 @@
45
45
  "test:types": "npx vitest --project types --run",
46
46
  "test:unit-watch": "npx vitest --project unit",
47
47
  "test:integration": "npx vitest --project integration --run --no-file-parallelism",
48
- "test:integration-watch": "npx vitest --project integration --no-file-parallelism",
48
+ "test:integration-watch": "npx vitest --project integration --no-file-parallelism entry-integration",
49
49
  "test:browser": "npx playwright install && npx vitest --project browser-unit --run && npx vitest --project browser-integration --run",
50
50
  "test:version": "grep -r \"0.0.0-determined-by-semantic-release\" ./dist > /dev/null && echo \"version 0.0.0-determined-by-semantic-release found in output\" && exit 1 || exit 0",
51
51
  "test:size": "size-limit",
@@ -142,6 +142,10 @@
142
142
  "name": "beta",
143
143
  "channel": "beta",
144
144
  "prerelease": true
145
+ },
146
+ {
147
+ "name": "canary",
148
+ "prerelease": true
145
149
  }
146
150
  ],
147
151
  "plugins": [