contentful-management 12.6.0-dev.3 → 12.6.0-dev.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.
Files changed (52) hide show
  1. package/dist/browser/index.js +2201 -1260
  2. package/dist/browser/index.js.map +1 -1
  3. package/dist/browser/index.min.js +1 -1
  4. package/dist/browser/index.min.js.map +1 -1
  5. package/dist/cjs/index.cjs +92 -19
  6. package/dist/cjs/index.cjs.map +1 -1
  7. package/dist/esm/adapters/REST/endpoints/asset.mjs +12 -1
  8. package/dist/esm/adapters/REST/endpoints/asset.mjs.map +1 -1
  9. package/dist/esm/adapters/REST/endpoints/comment.mjs +10 -2
  10. package/dist/esm/adapters/REST/endpoints/comment.mjs.map +1 -1
  11. package/dist/esm/adapters/REST/endpoints/content-type.mjs +9 -1
  12. package/dist/esm/adapters/REST/endpoints/content-type.mjs.map +1 -1
  13. package/dist/esm/adapters/REST/endpoints/entry.mjs +12 -1
  14. package/dist/esm/adapters/REST/endpoints/entry.mjs.map +1 -1
  15. package/dist/esm/adapters/REST/endpoints/task.mjs +28 -1
  16. package/dist/esm/adapters/REST/endpoints/task.mjs.map +1 -1
  17. package/dist/esm/common-types.mjs.map +1 -1
  18. package/dist/esm/entities/ai-action-invocation.mjs.map +1 -1
  19. package/dist/esm/entities/ai-action.mjs.map +1 -1
  20. package/dist/esm/entities/comment.mjs +10 -6
  21. package/dist/esm/entities/comment.mjs.map +1 -1
  22. package/dist/esm/entities/task.mjs +10 -6
  23. package/dist/esm/entities/task.mjs.map +1 -1
  24. package/dist/types/adapters/REST/endpoints/asset.d.ts +1 -0
  25. package/dist/types/adapters/REST/endpoints/asset.js +12 -1
  26. package/dist/types/adapters/REST/endpoints/asset.js.map +1 -1
  27. package/dist/types/adapters/REST/endpoints/comment.js +10 -2
  28. package/dist/types/adapters/REST/endpoints/comment.js.map +1 -1
  29. package/dist/types/adapters/REST/endpoints/content-type.d.ts +1 -0
  30. package/dist/types/adapters/REST/endpoints/content-type.js +9 -1
  31. package/dist/types/adapters/REST/endpoints/content-type.js.map +1 -1
  32. package/dist/types/adapters/REST/endpoints/entry.d.ts +1 -0
  33. package/dist/types/adapters/REST/endpoints/entry.js +12 -1
  34. package/dist/types/adapters/REST/endpoints/entry.js.map +1 -1
  35. package/dist/types/adapters/REST/endpoints/task.js +28 -1
  36. package/dist/types/adapters/REST/endpoints/task.js.map +1 -1
  37. package/dist/types/common-types.d.ts +9 -4
  38. package/dist/types/common-types.js.map +1 -1
  39. package/dist/types/constants/editor-interface-defaults/controls-defaults.d.ts +1 -1
  40. package/dist/types/entities/ai-action-invocation.d.ts +37 -18
  41. package/dist/types/entities/ai-action-invocation.js.map +1 -1
  42. package/dist/types/entities/ai-action.d.ts +4 -1
  43. package/dist/types/entities/ai-action.js.map +1 -1
  44. package/dist/types/entities/comment.d.ts +4 -6
  45. package/dist/types/entities/comment.js +10 -6
  46. package/dist/types/entities/comment.js.map +1 -1
  47. package/dist/types/entities/task.d.ts +5 -3
  48. package/dist/types/entities/task.js +10 -6
  49. package/dist/types/entities/task.js.map +1 -1
  50. package/dist/types/export-types.d.ts +7 -7
  51. package/dist/types/plain/entities/task.d.ts +77 -8
  52. package/package.json +2 -2
@@ -2,7 +2,34 @@ import copy from 'fast-copy';
2
2
  import { post, del as del$1, get as get$1, put } from './raw.js';
3
3
  import { normalizeSelect } from './utils.js';
4
4
 
5
- const getBaseUrl = (params) => `/spaces/${params.spaceId}/environments/${params.environmentId}/entries/${params.entryId}/tasks`;
5
+ const getSpaceEnvBaseUrl = (params) => `/spaces/${params.spaceId}/environments/${params.environmentId}`;
6
+ function getParentPlural(parentEntityType) {
7
+ switch (parentEntityType) {
8
+ case 'Entry':
9
+ return 'entries';
10
+ case 'Experience':
11
+ return 'experiences';
12
+ case 'Fragment':
13
+ return 'fragments';
14
+ case 'Template':
15
+ return 'templates';
16
+ case 'ComponentType':
17
+ return 'component_types';
18
+ }
19
+ }
20
+ const normalizeTaskParentParams = (paramsOrg) => 'entryId' in paramsOrg
21
+ ? {
22
+ spaceId: paramsOrg.spaceId,
23
+ environmentId: paramsOrg.environmentId,
24
+ parentEntityType: 'Entry',
25
+ parentEntityId: paramsOrg.entryId,
26
+ }
27
+ : paramsOrg;
28
+ const getBaseUrl = (paramsOrg) => {
29
+ const params = normalizeTaskParentParams(paramsOrg);
30
+ const parentPlural = getParentPlural(params.parentEntityType);
31
+ return `${getSpaceEnvBaseUrl(params)}/${parentPlural}/${params.parentEntityId}/tasks`;
32
+ };
6
33
  const getTaskUrl = (params) => `${getBaseUrl(params)}/${params.taskId}`;
7
34
  const get = (http, params) => get$1(http, getTaskUrl(params));
8
35
  const getMany = (http, params) => get$1(http, getBaseUrl(params), {
@@ -1 +1 @@
1
- {"version":3,"file":"task.js","sources":["../../../../../lib/adapters/REST/endpoints/task.ts"],"sourcesContent":[null],"names":["raw.get","raw.post","raw.put","raw.del"],"mappings":";;;;AAqBA,MAAM,UAAU,GAAG,CAAC,MAAsB,KACxC,WAAW,MAAM,CAAC,OAAO,CAAA,cAAA,EAAiB,MAAM,CAAC,aAAa,CAAA,SAAA,EAAY,MAAM,CAAC,OAAO,QAAQ;AAClG,MAAM,UAAU,GAAG,CAAC,MAAqB,KAAK,CAAA,EAAG,UAAU,CAAC,MAAM,CAAC,CAAA,CAAA,EAAI,MAAM,CAAC,MAAM,EAAE;MAEzE,GAAG,GAAgC,CAAC,IAAmB,EAAE,MAAqB,KACzFA,KAAO,CAAY,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC;MAEhC,OAAO,GAAoC,CACtD,IAAmB,EACnB,MAA6D,KAE7DA,KAAO,CAA4B,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE;AAC3D,IAAA,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC;AACtC,CAAA;AAEH;;AAEG;AACI,MAAM,MAAM,GAAmC;AAE/C,MAAM,MAAM,GAAmC,CACpD,IAAmB,EACnB,MAAwB,EACxB,OAAwB,KACtB;AACF,IAAA,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC;AAC1B,IAAA,OAAOC,IAAQ,CAAY,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC;AAC5D;AAEO,MAAM,MAAM,GAAmC,CACpD,IAAmB,EACnB,MAAqB,EACrB,OAAwB,EACxB,OAAgC,KAC9B;AACF,IAAA,MAAM,IAAI,GAAuC,IAAI,CAAC,OAAO,CAAC;IAC9D,OAAO,IAAI,CAAC,GAAG;AAEf,IAAA,OAAOC,GAAO,CAAY,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE;AACxD,QAAA,OAAO,EAAE;AACP,YAAA,sBAAsB,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC;AAChD,YAAA,GAAG,OAAO;AACX,SAAA;AACF,KAAA,CAAC;AACJ;AAEO,MAAM,GAAG,GAAmC,CACjD,IAAmB,EACnB,EAAE,OAAO,EAAE,GAAG,MAAM,EAAoB,KACtC;IACF,OAAOC,KAAO,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,sBAAsB,EAAE,OAAO,EAAE,EAAE,CAAC;AAC5F;;;;"}
1
+ {"version":3,"file":"task.js","sources":["../../../../../lib/adapters/REST/endpoints/task.ts"],"sourcesContent":[null],"names":["raw.get","raw.post","raw.put","raw.del"],"mappings":";;;;AAyBA,MAAM,kBAAkB,GAAG,CAAC,MAAiC,KAC3D,CAAA,QAAA,EAAW,MAAM,CAAC,OAAO,CAAA,cAAA,EAAiB,MAAM,CAAC,aAAa,EAAE;AAElE,SAAS,eAAe,CAAC,gBAAsC,EAAA;IAC7D,QAAQ,gBAAgB;AACtB,QAAA,KAAK,OAAO;AACV,YAAA,OAAO,SAAS;AAClB,QAAA,KAAK,YAAY;AACf,YAAA,OAAO,aAAa;AACtB,QAAA,KAAK,UAAU;AACb,YAAA,OAAO,WA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OAAOC,IAAQ,CAAY,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC;AAC5D;AAEO,MAAM,MAAM,GAAmC,CACpD,IAAmB,EACnB,MAAqB,EACrB,OAAwB,EACxB,OAAgC,KAC9B;AACF,IAAA,MAAM,IAAI,GAAuC,IAAI,CAAC,OAAO,CAAC;IAC9D,OAAO,IAAI,CAAC,GAAG;AAEf,IAAA,OAAOC,GAAO,CAAY,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE;AACxD,QAAA,OAAO,EAAE;AACP,YAAA,sBAAsB,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC;AAChD,YAAA,GAAG,OAAO;AACX,SAAA;AACF,KAAA,CAAC;AACJ;AAEO,MAAM,GAAG,GAAmC,CACjD,IAAmB,EACnB,EAAE,OAAO,EAAE,GAAG,MAAM,EAAoB,KACtC;IACF,OAAOC,KAAO,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,sBAAsB,EAAE,OAAO,EAAE,EAAE,CAAC;AAC5F;;;;"}
@@ -49,7 +49,7 @@ import type { CreateTeamSpaceMembershipProps, TeamSpaceMembershipProps } from '.
49
49
  import type { UsageProps } from './entities/usage';
50
50
  import type { UserProps } from './entities/user';
51
51
  import type { CreateWebhooksProps, UpsertWebhookSigningSecretPayload, WebhookCallDetailsProps, WebhookCallOverviewProps, WebhookHealthProps, WebhookProps, WebhookRetryPolicyPayload, WebhookRetryPolicyProps, WebhookSigningSecretProps } from './entities/webhook';
52
- import type { CreateTaskParams, CreateTaskProps, DeleteTaskParams, TaskProps, UpdateTaskParams, UpdateTaskProps } from './entities/task';
52
+ import type { CreateTaskParams, CreateTaskProps, DeleteTaskParams, TaskParentEntityType, TaskProps, UpdateTaskParams, UpdateTaskProps } from './entities/task';
53
53
  import type { AppAccessTokenProps, CreateAppAccessTokenProps } from './entities/app-access-token';
54
54
  import type { AppEventSubscriptionProps, CreateAppEventSubscriptionProps } from './entities/app-event-subscription';
55
55
  import type { AppKeyProps, CreateAppKeyProps } from './entities/app-key';
@@ -2817,11 +2817,11 @@ export type MRActions = {
2817
2817
  return: TaskProps;
2818
2818
  };
2819
2819
  getMany: {
2820
- params: GetEntryParams & QueryParams;
2820
+ params: (GetEntryParams | GetTaskParentEntityParams) & QueryParams;
2821
2821
  return: CollectionProp<TaskProps>;
2822
2822
  };
2823
2823
  getAll: {
2824
- params: GetEntryParams & QueryParams;
2824
+ params: (GetEntryParams | GetTaskParentEntityParams) & QueryParams;
2825
2825
  return: CollectionProp<TaskProps>;
2826
2826
  };
2827
2827
  create: {
@@ -3556,7 +3556,12 @@ export type GetTagParams = GetSpaceEnvironmentParams & {
3556
3556
  tagId: string;
3557
3557
  };
3558
3558
  /** @internal */
3559
- export type GetTaskParams = GetEntryParams & {
3559
+ export type GetTaskParentEntityParams = GetSpaceEnvironmentParams & {
3560
+ parentEntityType: TaskParentEntityType;
3561
+ parentEntityId: string;
3562
+ };
3563
+ /** @internal */
3564
+ export type GetTaskParams = (GetEntryParams | GetTaskParentEntityParams) & {
3560
3565
  taskId: string;
3561
3566
  };
3562
3567
  /** @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"common-types.js","sources":["../../lib/common-types.ts"],"sourcesContent":[null],"names":[],"mappings":"AAi1GA;IACY;AAAZ,CAAA,UAAY,+BAA+B,EAAA;AACzC,IAAA,+BAAA,CAAA,4BAAA,CAAA,GAAA,uDAAoF;AACtF,CAAC,EAFW,+BAA+B,KAA/B,+BAA+B,GAAA,EAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"common-types.js","sources":["../../lib/common-types.ts"],"sourcesContent":[null],"names":[],"mappings":"AA61GA;IACY;AAAZ,CAAA,UAAY,+BAA+B,EAAA;AACzC,IAAA,+BAAA,CAAA,4BAAA,CAAA,GAAA,uDAAoF;AACtF,CAAC,EAFW,+BAA+B,KAA/B,+BAA+B,GAAA,EAAA,CAAA,CAAA;;;;"}
@@ -91,7 +91,7 @@ export declare const FIELD_TYPES: Array<keyof typeof INTERNAL_TO_API>;
91
91
  * - Assets
92
92
  * - File
93
93
  */
94
- export declare function toInternalFieldType(api: Partial<ContentFields>): "Asset" | "Entry" | "Boolean" | "Symbol" | "Number" | "Resource" | "Text" | "RichText" | "Integer" | "Date" | "Object" | "Location" | "File" | "Symbols" | "Entries" | "Assets" | "Resources" | undefined;
94
+ export declare function toInternalFieldType(api: Partial<ContentFields>): "Location" | "Asset" | "Entry" | "Boolean" | "Symbol" | "Number" | "Resource" | "Text" | "RichText" | "Integer" | "Date" | "Object" | "File" | "Symbols" | "Entries" | "Assets" | "Resources" | undefined;
95
95
  export declare const DEFAULTS_WIDGET: {
96
96
  Text: {
97
97
  widgetId: string;
@@ -37,26 +37,45 @@ export type AiActionInvocationProps = {
37
37
  };
38
38
  result?: InvocationResult;
39
39
  };
40
+ export type AiActionTextVariable = {
41
+ id: string;
42
+ value: string;
43
+ };
44
+ export type AiActionEntityLinkVariable = {
45
+ id: string;
46
+ value: {
47
+ sys: {
48
+ type: 'Link';
49
+ linkType: 'Entry' | 'Asset' | 'ResourceLink';
50
+ id: string;
51
+ release?: SysLink;
52
+ /** JSON Pointers to entity fields, e.g. `"/fields/title/en-US"` */
53
+ entityPaths?: Array<string>;
54
+ };
55
+ };
56
+ };
57
+ /** @deprecated Use `AiActionEntityLinkVariable` with the sys-nested format instead. */
58
+ export type AiActionLegacyEntityPathVariable = {
59
+ id: string;
60
+ value: {
61
+ entityPath: string;
62
+ entityType: 'Entry' | 'Asset' | 'ResourceLink';
63
+ entityId: string;
64
+ };
65
+ };
66
+ /** @deprecated Use `AiActionEntityLinkVariable` with the sys-nested format instead. */
67
+ export type AiActionLegacyEntityPathsVariable = {
68
+ id: string;
69
+ value: {
70
+ entityPaths: Array<string>;
71
+ entityType: 'Entry';
72
+ entityId: string;
73
+ };
74
+ };
75
+ export type AiActionInvocationVariable = AiActionTextVariable | AiActionEntityLinkVariable | AiActionLegacyEntityPathVariable | AiActionLegacyEntityPathsVariable;
40
76
  export type AiActionInvocationType = {
41
77
  outputFormat?: 'RichText' | 'Markdown' | 'PlainText';
42
- variables?: Array<{
43
- value: string;
44
- id: string;
45
- } | {
46
- value: {
47
- entityPath: string;
48
- entityType: 'Entry' | 'Asset' | 'ResourceLink';
49
- entityId: string;
50
- };
51
- id: string;
52
- } | {
53
- value: {
54
- entityPaths: Array<string>;
55
- entityType: 'Entry';
56
- entityId: string;
57
- };
58
- id: string;
59
- }>;
78
+ variables?: Array<AiActionInvocationVariable>;
60
79
  };
61
80
  /**
62
81
  * The AI Action Invocation entity.
@@ -1 +1 @@
1
- {"version":3,"file":"ai-action-invocation.js","sources":["../../../lib/entities/ai-action-invocation.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAqFA;;;;;;AAMG;AACG,SAAU,sBAAsB,CACpC,WAAwB,EACxB,IAA6B,EAAA;IAE7B,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5C,IAAA,OAAO,SAAS,CAAC,UAAU,CAAC;AAC9B;;;;"}
1
+ {"version":3,"file":"ai-action-invocation.js","sources":["../../../lib/entities/ai-action-invocation.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AA6GA;;;;;;AAMG;AACG,SAAU,sBAAsB,CACpC,WAAwB,EACxB,IAA6B,EAAA;IAE7B,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5C,IAAA,OAAO,SAAS,CAAC,UAAU,CAAC;AAC9B;;;;"}
@@ -4,10 +4,13 @@ export type VariableType = 'ResourceLink' | 'Text' | 'StandardInput' | 'Locale'
4
4
  export type ReferenceVariableConfiguration = {
5
5
  allowedEntities: Array<'Entry'>;
6
6
  };
7
+ export type LocaleVariableConfiguration = {
8
+ localeType: 'Target' | 'Source';
9
+ };
7
10
  export type VariableConfiguration = {
8
11
  strict: boolean;
9
12
  in: Array<string>;
10
- } | ReferenceVariableConfiguration;
13
+ } | ReferenceVariableConfiguration | LocaleVariableConfiguration;
11
14
  export type Variable = {
12
15
  configuration?: VariableConfiguration;
13
16
  description?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ai-action.js","sources":["../../../lib/entities/ai-action.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAuGA,SAAS,iBAAiB,CAAC,WAAwB,EAAA;AACjD,IAAA,MAAM,SAAS,GAAG,CAAC,IAAmB,MAAM;QAC1C,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;AAC9B,QAAA,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE;AACxB,KAAA,CAAC;IAEF,OAAO;QACL,MAAM,EAAE,SAAS,MAAM,GAAA;YACrB,MAAM,IAAI,GAAG,IAAqB;AAClC,YAAA,OAAO,WAAW,CAAC;AACjB,gBAAA,UAAU,EAAE,UAAU;AACtB,gBAAA,MAAM,EAAE,QAAQ;AAChB,gBAAA,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC;AACvB,gBAAA,OAAO,EAAE,IAAI;AACd,aAAA,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QACpD,CAAC;QAED,MAAM,EAAE,SAAS,GAAG,GAAA;YAClB,MAAM,IAAI,GAAG,IAAqB;AAClC,YAAA,OAAO,WAAW,CAAC;AACjB,gBAAA,UAAU,EAAE,UAAU;AACtB,gBAAA,MAAM,EAAE,QAAQ;AAChB,gBAAA,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC;AACxB,aAAA,CAAC;QACJ,CAAC;QAED,OAAO,EAAE,SAAS,OAAO,GAAA;YACvB,MAAM,IAAI,GAAG,IAAqB;AAClC,YAAA,OAAO,WAAW,CAAC;AACjB,gBAAA,UAAU,EAAE,UAAU;AACtB,gBAAA,MAAM,EAAE,SAAS;AACjB,gBAAA,M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C,WAAwB,EAAE,IAAmB,EAAA;IACxE,MAAM,QAAQ,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,mBAAmB,GAAG,kBAAkB,CAAC,QAAQ,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;AACxF,IAAA,OAAO,SAAS,CAAC,mBAAmB,CAAC;AACvC;MAEa,sBAAsB,GAAG,cAAc,CAAC,YAAY;;;;"}
@@ -5,11 +5,13 @@ interface LinkWithReference<T extends string> extends Link<T> {
5
5
  ref: string;
6
6
  };
7
7
  }
8
+ export type CommentParentEntityType = 'ContentType' | 'Entry' | 'Workflow' | 'Experience' | 'Fragment' | 'ComponentType' | 'Template';
9
+ type NonWorkflowCommentParentEntityType = Exclude<CommentParentEntityType, 'Workflow'>;
8
10
  export type CommentSysProps = Pick<BasicMetaSysProps, 'id' | 'version' | 'createdAt' | 'createdBy' | 'updatedAt' | 'updatedBy'> & {
9
11
  type: 'Comment';
10
12
  space: SysLink;
11
13
  environment: SysLink;
12
- parentEntity: Link<'ContentType'> | LinkWithReference<'ContentType'> | Link<'Entry'> | LinkWithReference<'Entry'> | VersionedLink<'Workflow'>;
14
+ parentEntity: Link<NonWorkflowCommentParentEntityType> | LinkWithReference<NonWorkflowCommentParentEntityType> | VersionedLink<'Workflow'>;
13
15
  parent: Link<'Comment'> | null;
14
16
  };
15
17
  export type PlainTextBodyProperty = 'plain-text';
@@ -57,11 +59,7 @@ export type RichTextCommentBodyPayload = {
57
59
  };
58
60
  export type RichTextCommentProps = Omit<CommentProps, 'body'> & RichTextCommentBodyPayload;
59
61
  export type GetCommentParentEntityParams = GetSpaceEnvironmentParams & ({
60
- parentEntityType: 'ContentType';
61
- parentEntityId: string;
62
- parentEntityReference?: string;
63
- } | {
64
- parentEntityType: 'Entry';
62
+ parentEntityType: NonWorkflowCommentParentEntityType;
65
63
  parentEntityId: string;
66
64
  parentEntityReference?: string;
67
65
  } | {
@@ -14,12 +14,16 @@ var CommentNode;
14
14
  * @internal
15
15
  */
16
16
  function createCommentApi(makeRequest) {
17
- const getParams = (comment) => ({
18
- spaceId: comment.sys.space.sys.id,
19
- environmentId: comment.sys.environment.sys.id,
20
- entryId: comment.sys.parentEntity.sys.id,
21
- commentId: comment.sys.id,
22
- });
17
+ const getParams = (comment) => {
18
+ const parentEntity = comment.sys.parentEntity;
19
+ return {
20
+ spaceId: comment.sys.space.sys.id,
21
+ environmentId: comment.sys.environment.sys.id,
22
+ commentId: comment.sys.id,
23
+ parentEntityType: parentEntity.sys.linkType,
24
+ parentEntityId: parentEntity.sys.id,
25
+ };
26
+ };
23
27
  return {
24
28
  update: async function () {
25
29
  const raw = this.toPlainObject();
@@ -1 +1 @@
1
- {"version":3,"file":"comment.js","sources":["../../../lib/entities/comment.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AA4DA;IACY;AAAZ,CAAA,UAAY,WAAW,EAAA;AACrB,IAAA,WAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,WAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,WAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACrB,CAAC,EAJW,WAAW,KAAX,WAAW,GAAA,EAAA,CAAA,CAAA;AA4EvB;;AAEG;AACW,SAAU,gBAAgB,CAAC,WAAwB,EAAA;AAC/D,IAAA,MAAM,SAAS,GAAG,CAAC,OAAqB,MAAwB;QAC9D,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;QACjC,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE;QAC7C,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE;AACxC,QAAA,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE;AAC1B,KAAA,CAAC;IAEF,OAAO;AACL,QAAA,MAAM,EAAE,kBAAK;AACX,YAAA,MAAM,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AAE,GAAG,CAAC,GAAG,CAAC,OAAO;AACzB,iBAAA;AACF,aAAA,CAAC;QACJ,CAAC;KACF;AACH;AAEA;;AAEG;AACG,SAAU,WAAW,CACzB,WAAwB,EACxB,IAAyC,EAAA;IAEzC,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;AACrF,IAAA,OAAO,SAAS,CAAC,kBAAkB,CAA8B;AACnE;AAEA;;AAEG;MACU,qBAAqB,GAAG,cAAc,CAAC,WAAW;;;;"}
@@ -1,10 +1,12 @@
1
- import type { BasicMetaSysProps, DefaultElements, GetEntryParams, GetTaskParams, Link, MakeRequest, SysLink } from '../common-types';
1
+ import type { BasicMetaSysProps, DefaultElements, GetEntryParams, GetTaskParentEntityParams, GetTaskParams, Link, MakeRequest, SysLink } from '../common-types';
2
2
  export type TaskStatus = 'active' | 'resolved';
3
+ export type TaskParentEntityType = 'Entry' | 'Experience' | 'Fragment' | 'Template' | 'ComponentType';
4
+ export type TaskParentEntityPath = 'entries' | 'experiences' | 'fragments' | 'templates' | 'component_types';
3
5
  export type TaskSysProps = Pick<BasicMetaSysProps, 'id' | 'version' | 'createdAt' | 'createdBy' | 'updatedAt' | 'updatedBy'> & {
4
6
  type: 'Task';
5
7
  space: SysLink;
6
8
  environment: SysLink;
7
- parentEntity: Link<'Entry'>;
9
+ parentEntity: Link<TaskParentEntityType>;
8
10
  };
9
11
  export type TaskProps = {
10
12
  sys: TaskSysProps;
@@ -17,7 +19,7 @@ export type CreateTaskProps = Omit<TaskProps, 'sys'>;
17
19
  export type UpdateTaskProps = Omit<TaskProps, 'sys'> & {
18
20
  sys: Pick<TaskSysProps, 'version'>;
19
21
  };
20
- export type CreateTaskParams = GetEntryParams;
22
+ export type CreateTaskParams = GetEntryParams | GetTaskParentEntityParams;
21
23
  export type UpdateTaskParams = GetTaskParams;
22
24
  export type DeleteTaskParams = GetTaskParams & {
23
25
  version: number;
@@ -7,12 +7,16 @@ import enhanceWithMethods from '../enhance-with-methods.js';
7
7
  * @internal
8
8
  */
9
9
  function createTaskApi(makeRequest) {
10
- const getParams = (task) => ({
11
- spaceId: task.sys.space.sys.id,
12
- environmentId: task.sys.environment.sys.id,
13
- entryId: task.sys.parentEntity.sys.id,
14
- taskId: task.sys.id,
15
- });
10
+ const getParams = (task) => {
11
+ const parentEntity = task.sys.parentEntity;
12
+ return {
13
+ spaceId: task.sys.space.sys.id,
14
+ environmentId: task.sys.environment.sys.id,
15
+ parentEntityType: parentEntity.sys.linkType,
16
+ parentEntityId: parentEntity.sys.id,
17
+ taskId: task.sys.id,
18
+ };
19
+ };
16
20
  return {
17
21
  update: function () {
18
22
  const raw = this.toPlainObject();
@@ -1 +1 @@
1
- {"version":3,"file":"task.js","sources":["../../../lib/entities/task.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAgDA;;AAEG;AACW,SAAU,aAAa,CAAC,WAAwB,EAAA;AAC5D,IAAA,MAAM,SAAS,GAAG,CAAC,IAAe,MAAqB;QACrD,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;QAC9B,aAAa,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE;QAC1C,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE;AACrC,QAAA,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE;AACpB,KAAA,CAAC;IAEF,OAAO;AACL,QAAA,MAAM,EAAE,YAAA;AACN,YAAA,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,EAAe;AAE7C,YAAA,OAAO,WAAW,CAAC;AACjB,gBAAA,UAAU,EAAE,MAAM;AAClB,gBAAA,MAAM,EAAE,QAAQ;AAChB,gBAAA,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC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ACnC;AAEA;;AAEG;MACU,kBAAkB,GAAG,cAAc,CAAC,QAAQ;;;;"}
@@ -7,7 +7,7 @@ CreatePersonalAccessTokenProps as CreatePATProps, } from './entities/access-toke
7
7
  export type { ApiKey, ApiKeyProps, CreateApiKeyProps } from './entities/api-key';
8
8
  export type { AppAccessToken, AppAccessTokenProps, CreateAppAccessTokenProps, } from './entities/app-access-token';
9
9
  export type { AiAction, AiActionProps, CreateAiActionProps } from './entities/ai-action';
10
- export type { AiActionInvocation, AiActionInvocationProps } from './entities/ai-action-invocation';
10
+ export type { AiActionInvocation, AiActionInvocationProps, AiActionInvocationVariable, } from './entities/ai-action-invocation';
11
11
  export type { Agent, AgentGeneratePayload, AgentProps, AgentToolLink } from './entities/agent';
12
12
  export type { AgentGenerateResponse, AgentResumeRunPayload, AgentRun, AgentRunMessage, AgentRunMessagePart, AgentRunMessageRole, AgentRunMessageTextPart, AgentRunMessageToolCallPart, AgentRunProps, AgentRunQueryOptions, AgentRunStatus, } from './entities/agent-run';
13
13
  export type { AppAction, AppActionCategoryProps, AppActionCategoryType, AppActionParameterDefinition, AppActionProps, AppActionType, CreateAppActionProps, } from './entities/app-action';
@@ -59,7 +59,7 @@ export type { SpaceAddOn, SpaceAddOnProps, SpaceAddOnType, UpdateSpaceAddOnAlloc
59
59
  export type { SpaceMember, SpaceMemberProps } from './entities/space-member';
60
60
  export type { CreateSpaceMembershipProps, SpaceMembership, SpaceMembershipProps, } from './entities/space-membership';
61
61
  export type { CreateTagProps, Tag, TagProps, TagSysProps, TagVisibility } from './entities/tag';
62
- export type { CreateTaskProps, Task, TaskProps, UpdateTaskProps } from './entities/task';
62
+ export type { CreateTaskProps, Task, TaskParentEntityPath, TaskParentEntityType, TaskProps, UpdateTaskProps, } from './entities/task';
63
63
  export type { CreateTeamProps, Team, TeamProps } from './entities/team';
64
64
  export type { CreateTeamMembershipProps, TeamMembership, TeamMembershipProps, } from './entities/team-membership';
65
65
  export type { CreateTeamSpaceMembershipProps, TeamSpaceMembership, TeamSpaceMembershipProps, } from './entities/team-space-membership';
@@ -85,8 +85,8 @@ export type { SemanticSearchProps, SemanticSearch } from './entities/semantic-se
85
85
  export type { DefinedParameters, FreeFormParameters, InstallationParameterType, ParameterDefinition, ParameterOption, ParameterType, } from './entities/widget-parameters';
86
86
  export type { CreateWorkflowProps, DeleteWorkflowParams, UpdateWorkflowProps, Workflow, WorkflowProps, WorkflowQueryOptions, } from './entities/workflow';
87
87
  export type { WorkflowsChangelogEntry, WorkflowsChangelogEntryProps, WorkflowsChangelogQueryOptions, } from './entities/workflows-changelog-entry';
88
- export type { ComponentTypeCollection } from './entities/component-type';
89
- export type { TemplateCollection } from './entities/template';
90
- export type { ExperienceCollection, ReleaseExperience, ReleaseExperienceCollection, ReleaseExperienceSys, } from './entities/experience';
91
- export type { FragmentCollection } from './entities/fragment';
92
- export type { DataAssemblyCollection, DataAssemblyResourceLinkParameter, } from './entities/data-assembly';
88
+ export type { ComponentTypeCollection, ComponentTypeProps, CreateComponentTypeProps, UpsertComponentTypeProps, } from './entities/component-type';
89
+ export type { TemplateCollection, TemplateProps, CreateTemplateProps, UpsertTemplateProps, } from './entities/template';
90
+ export type { ExperienceCollection, ExperienceProps, CreateExperienceProps, UpsertExperienceProps, ReleaseExperience, ReleaseExperienceCollection, ReleaseExperienceSys, } from './entities/experience';
91
+ export type { FragmentCollection, FragmentProps, CreateFragmentProps, UpsertFragmentProps, } from './entities/fragment';
92
+ export type { DataAssemblyCollection, DataAssemblyProps, DataAssemblyResourceLinkParameter, CreateDataAssemblyProps, UpdateDataAssemblyProps, } from './entities/data-assembly';
@@ -1,11 +1,11 @@
1
1
  import type { RawAxiosRequestHeaders } from 'axios';
2
- import type { GetTaskParams, GetEntryParams, QueryParams, CollectionProp } from '../../common-types';
2
+ import type { GetTaskParams, GetEntryParams, GetTaskParentEntityParams, QueryParams, CollectionProp } from '../../common-types';
3
3
  import type { CreateTaskParams, UpdateTaskParams, DeleteTaskParams, TaskProps, CreateTaskProps, UpdateTaskProps } from '../../entities/task';
4
4
  import type { OptionalDefaults } from '../wrappers/wrap';
5
5
  export type TaskPlainClientAPI = {
6
6
  /** Fetches a task
7
7
  *
8
- * @param params Space ID, Entry ID, Environment ID, and Task ID
8
+ * @param params Space ID, Environment ID, parent entity (or legacy Entry ID), and Task ID
9
9
  * @returns the task
10
10
  * @throws if the request fails or the task is not found
11
11
  * @example
@@ -16,12 +16,20 @@ export type TaskPlainClientAPI = {
16
16
  * environmentId: '<environment_id>',
17
17
  * taskId: '<task_id>',
18
18
  * });
19
+ *
20
+ * const experienceTask = await client.task.get({
21
+ * spaceId: '<space_id>',
22
+ * environmentId: '<environment_id>',
23
+ * parentEntityType: 'Experience',
24
+ * parentEntityId: '<experience_id>',
25
+ * taskId: '<task_id>',
26
+ * });
19
27
  * ```
20
28
  */
21
29
  get(params: OptionalDefaults<GetTaskParams>): Promise<TaskProps>;
22
- /** Fetches all tasks for a given entry
30
+ /** Fetches all tasks for a given parent entity
23
31
  *
24
- * @param params Space ID, Entry ID, Environment ID, and query parameters
32
+ * @param params Space ID, Environment ID, parent entity (or legacy Entry ID), and query parameters
25
33
  * @returns a collection of tasks
26
34
  * @throws if the request fails or the tasks are not found
27
35
  * @example
@@ -34,12 +42,22 @@ export type TaskPlainClientAPI = {
34
42
  * limit: 100,
35
43
  * }
36
44
  * });
45
+ *
46
+ * const experienceTasks = await client.task.getMany({
47
+ * spaceId: '<space_id>',
48
+ * environmentId: '<environment_id>',
49
+ * parentEntityType: 'Experience',
50
+ * parentEntityId: '<experience_id>',
51
+ * query: {
52
+ * limit: 100,
53
+ * }
54
+ * });
37
55
  * ```
38
56
  */
39
- getMany(params: OptionalDefaults<GetEntryParams & QueryParams>): Promise<CollectionProp<TaskProps>>;
57
+ getMany(params: OptionalDefaults<(GetEntryParams | GetTaskParentEntityParams) & QueryParams>): Promise<CollectionProp<TaskProps>>;
40
58
  /** Creates a task
41
59
  *
42
- * @param params Space ID, Entry ID, Environment ID
60
+ * @param params Space ID, Environment ID, and parent entity (or legacy Entry ID)
43
61
  * @param rawData the task to create
44
62
  * @returns the created task
45
63
  * @throws if the request fails or or the payload is malformed
@@ -63,12 +81,32 @@ export type TaskPlainClientAPI = {
63
81
  * }
64
82
  * }
65
83
  * );
84
+ *
85
+ * const fragmentTask = await client.task.create(
86
+ * {
87
+ * spaceId: '<space_id>',
88
+ * environmentId: '<environment_id>',
89
+ * parentEntityType: 'Fragment',
90
+ * parentEntityId: '<fragment_id>',
91
+ * },
92
+ * {
93
+ * body: "Review Translation",
94
+ * status: "active",
95
+ * assignedTo: {
96
+ * sys: {
97
+ * type: "Link",
98
+ * linkType: "User",
99
+ * id: <user_id>
100
+ * }
101
+ * }
102
+ * }
103
+ * );
66
104
  * ```
67
105
  */
68
106
  create(params: OptionalDefaults<CreateTaskParams>, rawData: CreateTaskProps, headers?: RawAxiosRequestHeaders): Promise<TaskProps>;
69
107
  /** Updates a task
70
108
  *
71
- * @param params Space ID, Entry ID, Environment ID, and Task ID
109
+ * @param params Space ID, Environment ID, parent entity (or legacy Entry ID), and Task ID
72
110
  * @param rawData the task update
73
111
  * @returns the updated task
74
112
  * @throws if the request fails, the task is not found, or the payload is malformed
@@ -93,12 +131,33 @@ export type TaskPlainClientAPI = {
93
131
  * }
94
132
  * }
95
133
  * );
134
+ *
135
+ * const templateTask = await client.task.update(
136
+ * {
137
+ * spaceId: '<space_id>',
138
+ * environmentId: '<environment_id>',
139
+ * parentEntityType: 'Template',
140
+ * parentEntityId: '<template_id>',
141
+ * taskId: '<task_id>',
142
+ * },
143
+ * {
144
+ * body: "Review Translation",
145
+ * status: "active",
146
+ * assignedTo: {
147
+ * sys: {
148
+ * type: "Link",
149
+ * linkType: "User",
150
+ * id: <user_id>
151
+ * }
152
+ * }
153
+ * }
154
+ * );
96
155
  * ```
97
156
  */
98
157
  update(params: OptionalDefaults<UpdateTaskParams>, rawData: UpdateTaskProps, headers?: RawAxiosRequestHeaders): Promise<TaskProps>;
99
158
  /** Deletes a task
100
159
  *
101
- * @param params Space ID, Entry ID, Environment ID, and Task ID
160
+ * @param params Space ID, Environment ID, parent entity (or legacy Entry ID), and Task ID
102
161
  * @throws if the request fails or the task is not found
103
162
  * @example
104
163
  * ```javascript
@@ -107,6 +166,16 @@ export type TaskPlainClientAPI = {
107
166
  * entryId: '<entry_id>',
108
167
  * environmentId: '<environment_id>',
109
168
  * taskId: '<task_id>',
169
+ * version: 1,
170
+ * });
171
+ *
172
+ * await client.task.delete({
173
+ * spaceId: '<space_id>',
174
+ * environmentId: '<environment_id>',
175
+ * parentEntityType: 'ComponentType',
176
+ * parentEntityId: '<component_type_id>',
177
+ * taskId: '<task_id>',
178
+ * version: 1,
110
179
  * });
111
180
  * ```
112
181
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentful-management",
3
- "version": "12.6.0-dev.3",
3
+ "version": "12.6.0-dev.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
  "exports": {
@@ -83,7 +83,7 @@
83
83
  "@rollup/plugin-json": "^6.1.0",
84
84
  "@rollup/plugin-node-resolve": "^16.0.3",
85
85
  "@rollup/plugin-replace": "^6.0.3",
86
- "@rollup/plugin-terser": "^0.4.4",
86
+ "@rollup/plugin-terser": "^1.0.0",
87
87
  "@rollup/plugin-typescript": "^12.3.0",
88
88
  "@semantic-release/changelog": "^6.0.3",
89
89
  "@size-limit/file": "^11.1.6",