contentful-management 12.6.0-dev.3 → 12.6.0

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 (78) hide show
  1. package/README.md +3 -3
  2. package/dist/browser/index.js +752 -1055
  3. package/dist/browser/index.js.map +1 -1
  4. package/dist/browser/index.min.js +1 -1
  5. package/dist/browser/index.min.js.map +1 -1
  6. package/dist/cjs/index.cjs +744 -1047
  7. package/dist/cjs/index.cjs.map +1 -1
  8. package/dist/esm/adapters/REST/endpoints/asset.mjs +12 -1
  9. package/dist/esm/adapters/REST/endpoints/asset.mjs.map +1 -1
  10. package/dist/esm/adapters/REST/endpoints/component-type.mjs +3 -43
  11. package/dist/esm/adapters/REST/endpoints/component-type.mjs.map +1 -1
  12. package/dist/esm/adapters/REST/endpoints/content-type.mjs +9 -1
  13. package/dist/esm/adapters/REST/endpoints/content-type.mjs.map +1 -1
  14. package/dist/esm/adapters/REST/endpoints/entry.mjs +12 -1
  15. package/dist/esm/adapters/REST/endpoints/entry.mjs.map +1 -1
  16. package/dist/esm/adapters/REST/endpoints/index.mjs +0 -8
  17. package/dist/esm/adapters/REST/endpoints/index.mjs.map +1 -1
  18. package/dist/esm/common-types.mjs.map +1 -1
  19. package/dist/esm/entities/ai-action-invocation.mjs.map +1 -1
  20. package/dist/esm/entities/ai-action.mjs.map +1 -1
  21. package/dist/esm/plain/plain-client.mjs +0 -44
  22. package/dist/esm/plain/plain-client.mjs.map +1 -1
  23. package/dist/types/adapters/REST/endpoints/asset.d.ts +1 -0
  24. package/dist/types/adapters/REST/endpoints/asset.js +12 -1
  25. package/dist/types/adapters/REST/endpoints/asset.js.map +1 -1
  26. package/dist/types/adapters/REST/endpoints/component-type.d.ts +0 -6
  27. package/dist/types/adapters/REST/endpoints/component-type.js +3 -43
  28. package/dist/types/adapters/REST/endpoints/component-type.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/index.d.ts +0 -8
  36. package/dist/types/adapters/REST/endpoints/index.js +0 -8
  37. package/dist/types/adapters/REST/endpoints/index.js.map +1 -1
  38. package/dist/types/common-types.d.ts +5 -384
  39. package/dist/types/common-types.js.map +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/component-type.d.ts +56 -88
  45. package/dist/types/export-types.d.ts +1 -6
  46. package/dist/types/plain/entities/component-type.d.ts +7 -118
  47. package/dist/types/plain/plain-client-types.d.ts +0 -8
  48. package/dist/types/plain/plain-client.js +0 -44
  49. package/dist/types/plain/plain-client.js.map +1 -1
  50. package/package.json +1 -1
  51. package/dist/esm/adapters/REST/endpoints/data-assembly.mjs +0 -62
  52. package/dist/esm/adapters/REST/endpoints/data-assembly.mjs.map +0 -1
  53. package/dist/esm/adapters/REST/endpoints/experience.mjs +0 -52
  54. package/dist/esm/adapters/REST/endpoints/experience.mjs.map +0 -1
  55. package/dist/esm/adapters/REST/endpoints/fragment.mjs +0 -50
  56. package/dist/esm/adapters/REST/endpoints/fragment.mjs.map +0 -1
  57. package/dist/esm/adapters/REST/endpoints/template.mjs +0 -50
  58. package/dist/esm/adapters/REST/endpoints/template.mjs.map +0 -1
  59. package/dist/types/adapters/REST/endpoints/data-assembly.d.ts +0 -10
  60. package/dist/types/adapters/REST/endpoints/data-assembly.js +0 -62
  61. package/dist/types/adapters/REST/endpoints/data-assembly.js.map +0 -1
  62. package/dist/types/adapters/REST/endpoints/experience.d.ts +0 -8
  63. package/dist/types/adapters/REST/endpoints/experience.js +0 -52
  64. package/dist/types/adapters/REST/endpoints/experience.js.map +0 -1
  65. package/dist/types/adapters/REST/endpoints/fragment.d.ts +0 -8
  66. package/dist/types/adapters/REST/endpoints/fragment.js +0 -50
  67. package/dist/types/adapters/REST/endpoints/fragment.js.map +0 -1
  68. package/dist/types/adapters/REST/endpoints/template.d.ts +0 -8
  69. package/dist/types/adapters/REST/endpoints/template.js +0 -50
  70. package/dist/types/adapters/REST/endpoints/template.js.map +0 -1
  71. package/dist/types/entities/data-assembly.d.ts +0 -94
  72. package/dist/types/entities/experience.d.ts +0 -78
  73. package/dist/types/entities/fragment.d.ts +0 -52
  74. package/dist/types/entities/template.d.ts +0 -47
  75. package/dist/types/plain/entities/data-assembly.d.ts +0 -178
  76. package/dist/types/plain/entities/experience.d.ts +0 -164
  77. package/dist/types/plain/entities/fragment.d.ts +0 -133
  78. package/dist/types/plain/entities/template.d.ts +0 -138
@@ -1,78 +0,0 @@
1
- import type { CursorPaginationParams, ExoCursorPaginatedCollectionProp, ExperienceMetadataProps, ExoQueryFilters, Link, ResourceLink } from '../common-types';
2
- import type { ComponentTypeViewport, DimensionedDesignPropertyValue, FragmentNode } from './component-type';
3
- export type ExperienceContentBindings = {
4
- sys: ResourceLink<'Contentful:DataAssembly'>['sys'];
5
- parameters: Record<string, ResourceLink<string>>;
6
- };
7
- export type ExperienceSys = {
8
- id: string;
9
- type: 'Experience';
10
- version: number;
11
- space: Link<'Space'>;
12
- environment: Link<'Environment'>;
13
- template: ResourceLink<'Contentful:Template'>;
14
- createdAt: string;
15
- updatedAt: string;
16
- createdBy: Link<'User'>;
17
- updatedBy: Link<'User'>;
18
- archivedAt?: string;
19
- archivedBy?: Link<'User'>;
20
- archivedVersion?: number;
21
- variant?: string;
22
- variantType?: string;
23
- variantDimension?: string;
24
- publishedAt?: string;
25
- publishedVersion?: number;
26
- publishedCounter?: number;
27
- firstPublishedAt?: string;
28
- publishedBy?: Link<'User'> | Link<'AppDefinition'>;
29
- localeStatus?: Record<string, 'draft' | 'published' | 'changed'>;
30
- };
31
- type ExperienceCommonProps = {
32
- name: string;
33
- description: string;
34
- viewports: ComponentTypeViewport[];
35
- designProperties: Record<string, DimensionedDesignPropertyValue>;
36
- contentBindings?: ExperienceContentBindings;
37
- metadata?: ExperienceMetadataProps;
38
- slots?: Record<string, Array<FragmentNode | InlineFragmentNode>>;
39
- };
40
- export type ExperienceProps = ExperienceCommonProps & {
41
- sys: ExperienceSys;
42
- };
43
- export type ExperienceQueryOptions = CursorPaginationParams & ExoQueryFilters & {
44
- order?: string;
45
- };
46
- export type ExperienceLocalePublishPayload = {
47
- add: string[];
48
- } | {
49
- remove: string[];
50
- };
51
- export type CreateExperienceProps = ExperienceCommonProps & {
52
- template: ResourceLink<'Contentful:Template'>;
53
- };
54
- export type UpsertExperienceProps = ExperienceCommonProps & {
55
- sys: {
56
- id: string;
57
- type: 'Experience';
58
- version?: number;
59
- };
60
- template?: ResourceLink<'Contentful:Template'>;
61
- };
62
- export type InlineFragmentNode = {
63
- id: string;
64
- nodeType: 'InlineFragment';
65
- componentType: ResourceLink<'Contentful:ComponentType'>;
66
- designProperties: Record<string, DimensionedDesignPropertyValue>;
67
- contentBindings?: ExperienceContentBindings;
68
- slots?: Record<string, Array<FragmentNode | InlineFragmentNode>>;
69
- };
70
- export type ExperienceCollection = ExoCursorPaginatedCollectionProp<ExperienceProps>;
71
- export type ReleaseExperienceSys = Omit<ExperienceSys, 'variant' | 'variantType' | 'variantDimension'> & {
72
- release: Link<'Release'>;
73
- };
74
- export type ReleaseExperience = Omit<ExperienceProps, 'sys'> & {
75
- sys: ReleaseExperienceSys;
76
- };
77
- export type ReleaseExperienceCollection = ExoCursorPaginatedCollectionProp<ReleaseExperience>;
78
- export {};
@@ -1,52 +0,0 @@
1
- import type { Except } from 'type-fest';
2
- import type { CursorPaginationParams, ExoCursorPaginatedCollectionProp, ExoQueryFilters, ExperienceMetadataProps, Link, ResourceLink } from '../common-types';
3
- import type { ComponentTypeViewport, DimensionedDesignPropertyValue, FragmentNode } from './component-type';
4
- import type { ExperienceContentBindings, InlineFragmentNode } from './experience';
5
- export type FragmentSys = {
6
- id: string;
7
- type: 'Fragment';
8
- version: number;
9
- space: Link<'Space'>;
10
- environment: Link<'Environment'>;
11
- componentType: ResourceLink<'Contentful:ComponentType'>;
12
- archivedAt?: string;
13
- archivedBy?: Link<'User'>;
14
- archivedVersion?: number;
15
- createdAt: string;
16
- updatedAt: string;
17
- createdBy: Link<'User'>;
18
- updatedBy: Link<'User'>;
19
- variant?: string;
20
- variantType?: string;
21
- variantDimension?: string;
22
- publishedAt?: string;
23
- publishedVersion?: number;
24
- publishedCounter?: number;
25
- firstPublishedAt?: string;
26
- publishedBy?: Link<'User'> | Link<'AppDefinition'>;
27
- };
28
- export type FragmentProps = {
29
- sys: FragmentSys;
30
- name: string;
31
- description: string;
32
- viewports: ComponentTypeViewport[];
33
- designProperties: Record<string, DimensionedDesignPropertyValue>;
34
- contentBindings?: ExperienceContentBindings;
35
- metadata?: ExperienceMetadataProps;
36
- slots?: Record<string, Array<FragmentNode | InlineFragmentNode>>;
37
- };
38
- export type CreateFragmentProps = Except<FragmentProps, 'sys'> & {
39
- componentType: ResourceLink<'Contentful:ComponentType'>;
40
- };
41
- export type UpsertFragmentProps = Omit<FragmentProps, 'sys'> & {
42
- sys: {
43
- id: string;
44
- type: 'Fragment';
45
- version?: number;
46
- };
47
- componentType?: ResourceLink<'Contentful:ComponentType'>;
48
- };
49
- export type FragmentQueryOptions = CursorPaginationParams & ExoQueryFilters & {
50
- order?: string;
51
- };
52
- export type FragmentCollection = ExoCursorPaginatedCollectionProp<FragmentProps>;
@@ -1,47 +0,0 @@
1
- import type { Except } from 'type-fest';
2
- import type { CursorPaginationParams, ExoCursorPaginatedCollectionProp, ExoMetadataProps, ExoQueryFilters, Link } from '../common-types';
3
- import type { ComponentTypeContentProperty, ComponentTypeDesignProperty, ComponentTypeSlotDefinition, ComponentTypeViewport, DataAssemblyLink, TreeNode } from './component-type';
4
- export type TemplateSys = {
5
- id: string;
6
- type: 'Template';
7
- version: number;
8
- space: Link<'Space'>;
9
- environment: Link<'Environment'>;
10
- fieldStatus?: Record<string, Record<string, 'draft' | 'published' | 'changed'>>;
11
- publishedAt?: string;
12
- publishedVersion?: number;
13
- publishedCounter?: number;
14
- firstPublishedAt?: string;
15
- publishedBy?: Link<'User'> | Link<'AppDefinition'>;
16
- variant?: string;
17
- variantType?: string;
18
- variantDimension?: string;
19
- createdAt: string;
20
- createdBy: Link<'User'>;
21
- updatedAt: string;
22
- updatedBy: Link<'User'>;
23
- };
24
- export type TemplateProps = {
25
- sys: TemplateSys;
26
- name: string;
27
- description: string;
28
- viewports: ComponentTypeViewport[];
29
- contentProperties: ComponentTypeContentProperty[];
30
- designProperties: ComponentTypeDesignProperty[];
31
- componentTree?: TreeNode[];
32
- slots?: ComponentTypeSlotDefinition[];
33
- metadata?: ExoMetadataProps;
34
- dataAssemblies?: DataAssemblyLink[];
35
- };
36
- export type CreateTemplateProps = Except<TemplateProps, 'sys'>;
37
- export type UpsertTemplateProps = Except<TemplateProps, 'sys'> & {
38
- sys: {
39
- id: string;
40
- type: 'Template';
41
- version?: number;
42
- };
43
- };
44
- export type TemplateQueryOptions = CursorPaginationParams & ExoQueryFilters & {
45
- order?: string;
46
- };
47
- export type TemplateCollection = ExoCursorPaginatedCollectionProp<TemplateProps>;
@@ -1,178 +0,0 @@
1
- import type { RawAxiosRequestHeaders } from 'axios';
2
- import type { GetDataAssemblyParams, GetSpaceEnvironmentParams } from '../../common-types';
3
- import type { CreateDataAssemblyProps, DataAssemblyProps, DataAssemblyQueryOptions, UpdateDataAssemblyProps, DataAssemblyCollection } from '../../entities/data-assembly';
4
- import type { OptionalDefaults } from '../wrappers/wrap';
5
- export type DataAssemblyPlainClientAPI = {
6
- /**
7
- * Fetches all data assemblies for a space and environment
8
- * @param params the space, environment IDs and query options (see {@link DataAssemblyQueryOptions})
9
- * @returns a collection of data assemblies
10
- * @throws if the request fails, or the space or environment is not found
11
- * @internal - Experimental endpoint, subject to breaking changes without notice
12
- * @example
13
- * ```javascript
14
- * const dataAssemblies = await client.dataAssembly.getMany({
15
- * spaceId: '<space_id>',
16
- * environmentId: '<environment_id>',
17
- * query: {
18
- * limit: 10,
19
- * },
20
- * });
21
- * ```
22
- */
23
- getMany(params: OptionalDefaults<GetSpaceEnvironmentParams & {
24
- query: DataAssemblyQueryOptions;
25
- }>): Promise<DataAssemblyCollection>;
26
- /**
27
- * Fetches a single data assembly by ID
28
- * @param params the space, environment, and data assembly IDs
29
- * @returns the data assembly
30
- * @throws if the request fails, or the data assembly is not found
31
- * @internal - Experimental endpoint, subject to breaking changes without notice
32
- * @example
33
- * ```javascript
34
- * const dataAssembly = await client.dataAssembly.get({
35
- * spaceId: '<space_id>',
36
- * environmentId: '<environment_id>',
37
- * dataAssemblyId: '<data_assembly_id>',
38
- * });
39
- * ```
40
- */
41
- get(params: OptionalDefaults<GetDataAssemblyParams>): Promise<DataAssemblyProps>;
42
- /**
43
- * Creates a new data assembly
44
- * @param params the space and environment IDs
45
- * @param rawData the data assembly data to create
46
- * @param headers optional custom headers
47
- * @returns the created data assembly
48
- * @throws if the request fails
49
- * @internal - Experimental endpoint, subject to breaking changes without notice
50
- * @example
51
- * ```javascript
52
- * const dataAssembly = await client.dataAssembly.create({
53
- * spaceId: '<space_id>',
54
- * environmentId: '<environment_id>',
55
- * }, {
56
- * sys: { type: 'DataAssembly', dataType: [] },
57
- * metadata: { tags: [] },
58
- * name: 'My Assembly',
59
- * description: 'A data assembly',
60
- * parameters: {},
61
- * resolvers: {},
62
- * return: {},
63
- * });
64
- * ```
65
- */
66
- create(params: OptionalDefaults<GetSpaceEnvironmentParams>, rawData: CreateDataAssemblyProps, headers?: RawAxiosRequestHeaders): Promise<DataAssemblyProps>;
67
- /**
68
- * Updates a data assembly with PUT
69
- * @param params the space, environment, and data assembly IDs
70
- * @param rawData the data assembly data to update (must include sys.version)
71
- * @param headers optional custom headers
72
- * @returns the updated data assembly
73
- * @throws if the request fails, or the data assembly is not found
74
- * @internal - Experimental endpoint, subject to breaking changes without notice
75
- * @example
76
- * ```javascript
77
- * const updated = await client.dataAssembly.update(
78
- * {
79
- * spaceId: '<space_id>',
80
- * environmentId: '<environment_id>',
81
- * dataAssemblyId: '<data_assembly_id>',
82
- * },
83
- * { ...dataAssembly, name: 'Updated Name' },
84
- * );
85
- * ```
86
- */
87
- update(params: OptionalDefaults<GetDataAssemblyParams>, rawData: UpdateDataAssemblyProps, headers?: RawAxiosRequestHeaders): Promise<DataAssemblyProps>;
88
- /**
89
- * Deletes a data assembly
90
- * @param params the space, environment, and data assembly IDs
91
- * @returns void
92
- * @throws if the request fails, or the data assembly is not found
93
- * @internal - Experimental endpoint, subject to breaking changes without notice
94
- * @example
95
- * ```javascript
96
- * await client.dataAssembly.delete({
97
- * spaceId: '<space_id>',
98
- * environmentId: '<environment_id>',
99
- * dataAssemblyId: '<data_assembly_id>',
100
- * });
101
- * ```
102
- */
103
- delete(params: OptionalDefaults<GetDataAssemblyParams>): Promise<void>;
104
- /**
105
- * Publishes a data assembly
106
- * @param params the space, environment, and data assembly IDs, and the version number
107
- * @returns the published data assembly
108
- * @throws if the request fails, or the data assembly is not found
109
- * @internal - Experimental endpoint, subject to breaking changes without notice
110
- * @example
111
- * ```javascript
112
- * const dataAssembly = await client.dataAssembly.publish({
113
- * spaceId: '<space_id>',
114
- * environmentId: '<environment_id>',
115
- * dataAssemblyId: '<data_assembly_id>',
116
- * version: 1,
117
- * });
118
- * ```
119
- */
120
- publish(params: OptionalDefaults<GetDataAssemblyParams & {
121
- version: number;
122
- }>): Promise<DataAssemblyProps>;
123
- /**
124
- * Unpublishes a data assembly
125
- * @param params the space, environment, and data assembly IDs, and the version number
126
- * @returns the unpublished data assembly
127
- * @throws if the request fails, or the data assembly is not found
128
- * @internal - Experimental endpoint, subject to breaking changes without notice
129
- * @example
130
- * ```javascript
131
- * const dataAssembly = await client.dataAssembly.unpublish({
132
- * spaceId: '<space_id>',
133
- * environmentId: '<environment_id>',
134
- * dataAssemblyId: '<data_assembly_id>',
135
- * version: 1,
136
- * });
137
- * ```
138
- */
139
- unpublish(params: OptionalDefaults<GetDataAssemblyParams & {
140
- version: number;
141
- }>): Promise<DataAssemblyProps>;
142
- /**
143
- * Fetches all published data assemblies for a space and environment
144
- * @param params the space, environment IDs and query options (see {@link DataAssemblyQueryOptions})
145
- * @returns a collection of published data assemblies
146
- * @throws if the request fails, or the space or environment is not found
147
- * @internal - Experimental endpoint, subject to breaking changes without notice
148
- * @example
149
- * ```javascript
150
- * const dataAssemblies = await client.dataAssembly.getManyPublished({
151
- * spaceId: '<space_id>',
152
- * environmentId: '<environment_id>',
153
- * query: {
154
- * limit: 10,
155
- * },
156
- * });
157
- * ```
158
- */
159
- getManyPublished(params: OptionalDefaults<GetSpaceEnvironmentParams & {
160
- query: DataAssemblyQueryOptions;
161
- }>): Promise<DataAssemblyCollection>;
162
- /**
163
- * Fetches a single published data assembly by ID
164
- * @param params the space, environment, and data assembly IDs
165
- * @returns the published data assembly
166
- * @throws if the request fails, or the data assembly is not found
167
- * @internal - Experimental endpoint, subject to breaking changes without notice
168
- * @example
169
- * ```javascript
170
- * const dataAssembly = await client.dataAssembly.getPublished({
171
- * spaceId: '<space_id>',
172
- * environmentId: '<environment_id>',
173
- * dataAssemblyId: '<data_assembly_id>',
174
- * });
175
- * ```
176
- */
177
- getPublished(params: OptionalDefaults<GetDataAssemblyParams>): Promise<DataAssemblyProps>;
178
- };
@@ -1,164 +0,0 @@
1
- import type { ExoCursorPaginatedCollectionProp, GetSpaceEnvironmentParams, GetExperienceParams } from '../../common-types';
2
- import type { CreateExperienceProps, UpsertExperienceProps, ExperienceLocalePublishPayload, ExperienceProps, ExperienceQueryOptions } from '../../entities/experience';
3
- import type { OptionalDefaults } from '../wrappers/wrap';
4
- export type ExperiencePlainClientAPI = {
5
- /**
6
- * Fetches all experiences for a space and environment
7
- * @param params the space, environment IDs and query options (see {@link ExperienceQueryOptions})
8
- * @returns a collection of experiences
9
- * @throws if the request fails, or the space or environment is not found
10
- * @internal - Experimental endpoint, subject to breaking changes without notice
11
- * @example
12
- * ```javascript
13
- * const experiences = await client.experience.getMany({
14
- * spaceId: '<space_id>',
15
- * environmentId: '<environment_id>',
16
- * query: {
17
- * limit: 10,
18
- * },
19
- * });
20
- * ```
21
- */
22
- getMany(params: OptionalDefaults<GetSpaceEnvironmentParams & {
23
- query: ExperienceQueryOptions;
24
- }>): Promise<ExoCursorPaginatedCollectionProp<ExperienceProps>>;
25
- /**
26
- * Fetches a single experience by ID
27
- * @param params the space ID, environment ID, and experience ID
28
- * @returns the experience
29
- * @throws if the request fails, or the space, environment, or experience is not found
30
- * @internal - Experimental endpoint, subject to breaking changes without notice
31
- * @example
32
- * ```javascript
33
- * const experience = await client.experience.get({
34
- * spaceId: '<space_id>',
35
- * environmentId: '<environment_id>',
36
- * experienceId: '<experience_id>',
37
- * });
38
- * ```
39
- */
40
- get(params: OptionalDefaults<GetExperienceParams>): Promise<ExperienceProps>;
41
- /**
42
- * Creates a new experience
43
- * @param params the space ID and environment ID
44
- * @param rawData the experience data to create
45
- * @returns the created experience
46
- * @throws if the request fails
47
- * @internal - Experimental endpoint, subject to breaking changes without notice
48
- * @example
49
- * ```javascript
50
- * const experience = await client.experience.create({
51
- * spaceId: '<space_id>',
52
- * environmentId: '<environment_id>',
53
- * }, {
54
- * name: 'My Experience',
55
- * description: 'A new experience',
56
- * template: { sys: { type: 'Link', linkType: 'Template', id: '<template_id>' } },
57
- * viewports: [],
58
- * contentProperties: {},
59
- * designProperties: {},
60
- * });
61
- * ```
62
- */
63
- create(params: OptionalDefaults<GetSpaceEnvironmentParams>, rawData: CreateExperienceProps): Promise<ExperienceProps>;
64
- /**
65
- * Upserts an experience (creates or updates via PUT)
66
- * @param params the space ID, environment ID, and experience ID
67
- * @param rawData the experience data to upsert (include sys.version for updates, omit for creates)
68
- * @returns the upserted experience
69
- * @throws if the request fails
70
- * @internal - Experimental endpoint, subject to breaking changes without notice
71
- * @example
72
- * ```javascript
73
- * const current = await client.experience.get({ experienceId: '<experience_id>' });
74
- * const updated = await client.experience.upsert({
75
- * spaceId: '<space_id>',
76
- * environmentId: '<environment_id>',
77
- * experienceId: '<experience_id>',
78
- * }, {
79
- * sys: { id: current.sys.id, type: 'Experience', version: current.sys.version },
80
- * name: 'Updated Experience',
81
- * ...otherFields,
82
- * });
83
- * ```
84
- */
85
- upsert(params: OptionalDefaults<GetExperienceParams>, rawData: UpsertExperienceProps): Promise<ExperienceProps>;
86
- /**
87
- * Deletes an experience
88
- * @param params the space ID, environment ID, and experience ID
89
- * @returns void
90
- * @throws if the request fails, or the experience is not found
91
- * @internal - Experimental endpoint, subject to breaking changes without notice
92
- * @example
93
- * ```javascript
94
- * await client.experience.delete({
95
- * spaceId: '<space_id>',
96
- * environmentId: '<environment_id>',
97
- * experienceId: '<experience_id>',
98
- * });
99
- * ```
100
- */
101
- delete(params: OptionalDefaults<GetExperienceParams>): Promise<void>;
102
- /**
103
- * Publishes an experience, optionally targeting specific locales.
104
- *
105
- * When called without a payload, the experience is fully published across all locales.
106
- * Pass `{ add: ['en-US'] }` to publish specific locales, or `{ remove: ['de-DE'] }`
107
- * to remove specific locales from an already-published experience.
108
- * The payload is a union — only `add` or `remove` can be sent per request, not both.
109
- *
110
- * @param params the space ID, environment ID, experience ID, and the version number
111
- * @param payload optional locale-based publish payload
112
- * @returns the published experience
113
- * @throws if the request fails, or the experience is not found
114
- * @internal - Experimental endpoint, subject to breaking changes without notice
115
- * @example
116
- * ```javascript
117
- * // Full publish (all locales)
118
- * const experience = await client.experience.publish({
119
- * spaceId: '<space_id>',
120
- * environmentId: '<environment_id>',
121
- * experienceId: '<experience_id>',
122
- * version: 1,
123
- * });
124
- *
125
- * // Publish specific locales
126
- * const experience = await client.experience.publish({
127
- * spaceId: '<space_id>',
128
- * environmentId: '<environment_id>',
129
- * experienceId: '<experience_id>',
130
- * version: 1,
131
- * }, { add: ['en-US', 'de-DE'] });
132
- *
133
- * // Remove specific locales from publishing
134
- * const experience = await client.experience.publish({
135
- * spaceId: '<space_id>',
136
- * environmentId: '<environment_id>',
137
- * experienceId: '<experience_id>',
138
- * version: 1,
139
- * }, { remove: ['de-DE'] });
140
- * ```
141
- */
142
- publish(params: OptionalDefaults<GetExperienceParams & {
143
- version: number;
144
- }>, payload?: ExperienceLocalePublishPayload): Promise<ExperienceProps>;
145
- /**
146
- * Unpublishes an experience
147
- * @param params the space ID, environment ID, experience ID, and the version number
148
- * @returns the unpublished experience
149
- * @throws if the request fails, or the experience is not found
150
- * @internal - Experimental endpoint, subject to breaking changes without notice
151
- * @example
152
- * ```javascript
153
- * const experience = await client.experience.unpublish({
154
- * spaceId: '<space_id>',
155
- * environmentId: '<environment_id>',
156
- * experienceId: '<experience_id>',
157
- * version: <version>,
158
- * });
159
- * ```
160
- */
161
- unpublish(params: OptionalDefaults<GetExperienceParams & {
162
- version: number;
163
- }>): Promise<ExperienceProps>;
164
- };
@@ -1,133 +0,0 @@
1
- import type { ExoCursorPaginatedCollectionProp, GetFragmentParams, GetSpaceEnvironmentParams } from '../../common-types';
2
- import type { CreateFragmentProps, FragmentProps, FragmentQueryOptions, UpsertFragmentProps } from '../../entities/fragment';
3
- import type { OptionalDefaults } from '../wrappers/wrap';
4
- export type FragmentPlainClientAPI = {
5
- /**
6
- * Fetches all fragments for a space and environment
7
- * @param params the space, environment IDs and query options (see {@link FragmentQueryOptions})
8
- * @returns a collection of fragments
9
- * @throws if the request fails, or the space or environment is not found
10
- * @internal - Experimental endpoint, subject to breaking changes without notice
11
- * @example
12
- * ```javascript
13
- * const fragments = await client.fragment.getMany({
14
- * spaceId: '<space_id>',
15
- * environmentId: '<environment_id>',
16
- * query: {
17
- * limit: 10,
18
- * },
19
- * });
20
- * ```
21
- */
22
- getMany(params: OptionalDefaults<GetSpaceEnvironmentParams & {
23
- query: FragmentQueryOptions;
24
- }>): Promise<ExoCursorPaginatedCollectionProp<FragmentProps>>;
25
- /**
26
- * Fetches a single fragment by ID
27
- * @param params the space, environment, and fragment IDs
28
- * @returns the fragment
29
- * @throws if the request fails, or the space, environment, or fragment is not found
30
- * @internal - Experimental endpoint, subject to breaking changes without notice
31
- * @example
32
- * ```javascript
33
- * const fragment = await client.fragment.get({
34
- * spaceId: '<space_id>',
35
- * environmentId: '<environment_id>',
36
- * fragmentId: '<fragment_id>',
37
- * });
38
- * ```
39
- */
40
- get(params: OptionalDefaults<GetFragmentParams>): Promise<FragmentProps>;
41
- /**
42
- * Creates a new fragment
43
- * @param params the space and environment IDs
44
- * @param data the fragment data
45
- * @returns the created fragment
46
- * @throws if the request fails, or the space or environment is not found
47
- * @internal - Experimental endpoint, subject to breaking changes without notice
48
- * @example
49
- * ```javascript
50
- * const fragment = await client.fragment.create({
51
- * spaceId: '<space_id>',
52
- * environmentId: '<environment_id>',
53
- * }, {
54
- * name: 'My Fragment',
55
- * description: 'A new fragment',
56
- * componentType: { sys: { type: 'Link', linkType: 'ComponentType', id: '<component_type_id>' } },
57
- * viewports: [],
58
- * designProperties: {},
59
- * });
60
- * ```
61
- */
62
- create(params: OptionalDefaults<GetSpaceEnvironmentParams>, data: CreateFragmentProps): Promise<FragmentProps>;
63
- /**
64
- * Upserts a fragment (creates or updates via PUT)
65
- * @param params the space, environment, and fragment IDs
66
- * @param data the fragment data to upsert (include sys.version for updates, omit for creates)
67
- * @returns the upserted fragment
68
- * @throws if the request fails, or the space, environment, or fragment is not found
69
- * @internal - Experimental endpoint, subject to breaking changes without notice
70
- * @example
71
- * ```javascript
72
- * const fragment = await client.fragment.upsert({
73
- * spaceId: '<space_id>',
74
- * environmentId: '<environment_id>',
75
- * fragmentId: '<fragment_id>',
76
- * }, fragmentData);
77
- * ```
78
- */
79
- upsert(params: OptionalDefaults<GetFragmentParams>, data: UpsertFragmentProps): Promise<FragmentProps>;
80
- /**
81
- * Deletes a fragment
82
- * @param params the space, environment, and fragment IDs
83
- * @throws if the request fails, or the space, environment, or fragment is not found
84
- * @internal - Experimental endpoint, subject to breaking changes without notice
85
- * @example
86
- * ```javascript
87
- * await client.fragment.delete({
88
- * spaceId: '<space_id>',
89
- * environmentId: '<environment_id>',
90
- * fragmentId: '<fragment_id>',
91
- * });
92
- * ```
93
- */
94
- delete(params: OptionalDefaults<GetFragmentParams>): Promise<void>;
95
- /**
96
- * Publishes a fragment
97
- * @param params the space, environment, and fragment IDs, plus the current version
98
- * @returns the published fragment
99
- * @throws if the request fails, or the space, environment, or fragment is not found
100
- * @internal - Experimental endpoint, subject to breaking changes without notice
101
- * @example
102
- * ```javascript
103
- * const fragment = await client.fragment.publish({
104
- * spaceId: '<space_id>',
105
- * environmentId: '<environment_id>',
106
- * fragmentId: '<fragment_id>',
107
- * version: 1,
108
- * });
109
- * ```
110
- */
111
- publish(params: OptionalDefaults<GetFragmentParams & {
112
- version: number;
113
- }>): Promise<FragmentProps>;
114
- /**
115
- * Unpublishes a fragment
116
- * @param params the space, environment, and fragment IDs, plus the current version
117
- * @returns the unpublished fragment
118
- * @throws if the request fails, or the space, environment, or fragment is not found
119
- * @internal - Experimental endpoint, subject to breaking changes without notice
120
- * @example
121
- * ```javascript
122
- * const fragment = await client.fragment.unpublish({
123
- * spaceId: '<space_id>',
124
- * environmentId: '<environment_id>',
125
- * fragmentId: '<fragment_id>',
126
- * version: 2,
127
- * });
128
- * ```
129
- */
130
- unpublish(params: OptionalDefaults<GetFragmentParams & {
131
- version: number;
132
- }>): Promise<FragmentProps>;
133
- };