contentful-management 12.5.0 → 12.6.0-dev.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.
- package/README.md +3 -3
- package/dist/browser/index.js +1070 -737
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.min.js +1 -1
- package/dist/browser/index.min.js.map +1 -1
- package/dist/cjs/index.cjs +1062 -729
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/adapters/REST/endpoints/component-type.mjs +43 -3
- package/dist/esm/adapters/REST/endpoints/component-type.mjs.map +1 -1
- package/dist/esm/adapters/REST/endpoints/data-assembly.mjs +62 -0
- package/dist/esm/adapters/REST/endpoints/data-assembly.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/experience.mjs +52 -0
- package/dist/esm/adapters/REST/endpoints/experience.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/fragment.mjs +50 -0
- package/dist/esm/adapters/REST/endpoints/fragment.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/index.mjs +8 -0
- package/dist/esm/adapters/REST/endpoints/index.mjs.map +1 -1
- package/dist/esm/adapters/REST/endpoints/template.mjs +50 -0
- package/dist/esm/adapters/REST/endpoints/template.mjs.map +1 -0
- package/dist/esm/common-types.mjs.map +1 -1
- package/dist/esm/plain/plain-client.mjs +44 -0
- package/dist/esm/plain/plain-client.mjs.map +1 -1
- package/dist/types/adapters/REST/endpoints/component-type.d.ts +6 -0
- package/dist/types/adapters/REST/endpoints/component-type.js +43 -3
- package/dist/types/adapters/REST/endpoints/component-type.js.map +1 -1
- package/dist/types/adapters/REST/endpoints/data-assembly.d.ts +10 -0
- package/dist/types/adapters/REST/endpoints/data-assembly.js +62 -0
- package/dist/types/adapters/REST/endpoints/data-assembly.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/experience.d.ts +8 -0
- package/dist/types/adapters/REST/endpoints/experience.js +52 -0
- package/dist/types/adapters/REST/endpoints/experience.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/fragment.d.ts +8 -0
- package/dist/types/adapters/REST/endpoints/fragment.js +50 -0
- package/dist/types/adapters/REST/endpoints/fragment.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/index.d.ts +8 -0
- package/dist/types/adapters/REST/endpoints/index.js +8 -0
- package/dist/types/adapters/REST/endpoints/index.js.map +1 -1
- package/dist/types/adapters/REST/endpoints/template.d.ts +8 -0
- package/dist/types/adapters/REST/endpoints/template.js +50 -0
- package/dist/types/adapters/REST/endpoints/template.js.map +1 -0
- package/dist/types/common-types.d.ts +330 -5
- package/dist/types/common-types.js.map +1 -1
- package/dist/types/entities/component-type.d.ts +89 -45
- package/dist/types/entities/data-assembly.d.ts +119 -0
- package/dist/types/entities/experience.d.ts +89 -0
- package/dist/types/entities/fragment.d.ts +52 -0
- package/dist/types/entities/template.d.ts +48 -0
- package/dist/types/export-types.d.ts +5 -0
- package/dist/types/plain/entities/component-type.d.ts +119 -7
- package/dist/types/plain/entities/data-assembly.d.ts +178 -0
- package/dist/types/plain/entities/experience.d.ts +165 -0
- package/dist/types/plain/entities/fragment.d.ts +134 -0
- package/dist/types/plain/entities/template.d.ts +139 -0
- package/dist/types/plain/plain-client-types.d.ts +8 -0
- package/dist/types/plain/plain-client.js +44 -0
- package/dist/types/plain/plain-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,165 @@
|
|
|
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
|
+
* dimensionKeyMap: { designProperties: {} },
|
|
61
|
+
* });
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
create(params: OptionalDefaults<GetSpaceEnvironmentParams>, rawData: CreateExperienceProps): Promise<ExperienceProps>;
|
|
65
|
+
/**
|
|
66
|
+
* Upserts an experience (creates or updates via PUT)
|
|
67
|
+
* @param params the space ID, environment ID, and experience ID
|
|
68
|
+
* @param rawData the experience data to upsert (include sys.version for updates, omit for creates)
|
|
69
|
+
* @returns the upserted experience
|
|
70
|
+
* @throws if the request fails
|
|
71
|
+
* @internal - Experimental endpoint, subject to breaking changes without notice
|
|
72
|
+
* @example
|
|
73
|
+
* ```javascript
|
|
74
|
+
* const current = await client.experience.get({ experienceId: '<experience_id>' });
|
|
75
|
+
* const updated = await client.experience.upsert({
|
|
76
|
+
* spaceId: '<space_id>',
|
|
77
|
+
* environmentId: '<environment_id>',
|
|
78
|
+
* experienceId: '<experience_id>',
|
|
79
|
+
* }, {
|
|
80
|
+
* sys: { id: current.sys.id, type: 'Experience', version: current.sys.version },
|
|
81
|
+
* name: 'Updated Experience',
|
|
82
|
+
* ...otherFields,
|
|
83
|
+
* });
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
upsert(params: OptionalDefaults<GetExperienceParams>, rawData: UpsertExperienceProps): Promise<ExperienceProps>;
|
|
87
|
+
/**
|
|
88
|
+
* Deletes an experience
|
|
89
|
+
* @param params the space ID, environment ID, and experience ID
|
|
90
|
+
* @returns void
|
|
91
|
+
* @throws if the request fails, or the experience is not found
|
|
92
|
+
* @internal - Experimental endpoint, subject to breaking changes without notice
|
|
93
|
+
* @example
|
|
94
|
+
* ```javascript
|
|
95
|
+
* await client.experience.delete({
|
|
96
|
+
* spaceId: '<space_id>',
|
|
97
|
+
* environmentId: '<environment_id>',
|
|
98
|
+
* experienceId: '<experience_id>',
|
|
99
|
+
* });
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
delete(params: OptionalDefaults<GetExperienceParams>): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* Publishes an experience, optionally targeting specific locales.
|
|
105
|
+
*
|
|
106
|
+
* When called without a payload, the experience is fully published across all locales.
|
|
107
|
+
* Pass `{ add: ['en-US'] }` to publish specific locales, or `{ remove: ['de-DE'] }`
|
|
108
|
+
* to remove specific locales from an already-published experience.
|
|
109
|
+
* The payload is a union — only `add` or `remove` can be sent per request, not both.
|
|
110
|
+
*
|
|
111
|
+
* @param params the space ID, environment ID, experience ID, and the version number
|
|
112
|
+
* @param payload optional locale-based publish payload
|
|
113
|
+
* @returns the published experience
|
|
114
|
+
* @throws if the request fails, or the experience is not found
|
|
115
|
+
* @internal - Experimental endpoint, subject to breaking changes without notice
|
|
116
|
+
* @example
|
|
117
|
+
* ```javascript
|
|
118
|
+
* // Full publish (all locales)
|
|
119
|
+
* const experience = await client.experience.publish({
|
|
120
|
+
* spaceId: '<space_id>',
|
|
121
|
+
* environmentId: '<environment_id>',
|
|
122
|
+
* experienceId: '<experience_id>',
|
|
123
|
+
* version: 1,
|
|
124
|
+
* });
|
|
125
|
+
*
|
|
126
|
+
* // Publish specific locales
|
|
127
|
+
* const experience = await client.experience.publish({
|
|
128
|
+
* spaceId: '<space_id>',
|
|
129
|
+
* environmentId: '<environment_id>',
|
|
130
|
+
* experienceId: '<experience_id>',
|
|
131
|
+
* version: 1,
|
|
132
|
+
* }, { add: ['en-US', 'de-DE'] });
|
|
133
|
+
*
|
|
134
|
+
* // Remove specific locales from publishing
|
|
135
|
+
* const experience = await client.experience.publish({
|
|
136
|
+
* spaceId: '<space_id>',
|
|
137
|
+
* environmentId: '<environment_id>',
|
|
138
|
+
* experienceId: '<experience_id>',
|
|
139
|
+
* version: 1,
|
|
140
|
+
* }, { remove: ['de-DE'] });
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
143
|
+
publish(params: OptionalDefaults<GetExperienceParams & {
|
|
144
|
+
version: number;
|
|
145
|
+
}>, payload?: ExperienceLocalePublishPayload): Promise<ExperienceProps>;
|
|
146
|
+
/**
|
|
147
|
+
* Unpublishes an experience
|
|
148
|
+
* @param params the space ID, environment ID, experience ID, and the version number
|
|
149
|
+
* @returns the unpublished experience
|
|
150
|
+
* @throws if the request fails, or the experience is not found
|
|
151
|
+
* @internal - Experimental endpoint, subject to breaking changes without notice
|
|
152
|
+
* @example
|
|
153
|
+
* ```javascript
|
|
154
|
+
* const experience = await client.experience.unpublish({
|
|
155
|
+
* spaceId: '<space_id>',
|
|
156
|
+
* environmentId: '<environment_id>',
|
|
157
|
+
* experienceId: '<experience_id>',
|
|
158
|
+
* version: <version>,
|
|
159
|
+
* });
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
unpublish(params: OptionalDefaults<GetExperienceParams & {
|
|
163
|
+
version: number;
|
|
164
|
+
}>): Promise<ExperienceProps>;
|
|
165
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import type { ExoCursorPaginatedCollectionProp, GetFragmentParams, GetSpaceEnvironmentParams } from '../../common-types';
|
|
2
|
+
import type { CreateFragmentProps, FragmentProps, FragmentQueryOptions, UpdateFragmentProps } 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
|
+
* dimensionKeyMap: { designProperties: {} },
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
create(params: OptionalDefaults<GetSpaceEnvironmentParams>, data: CreateFragmentProps): Promise<FragmentProps>;
|
|
64
|
+
/**
|
|
65
|
+
* Updates a fragment with PUT
|
|
66
|
+
* @param params the space, environment, and fragment IDs
|
|
67
|
+
* @param data the fragment data (including sys.version)
|
|
68
|
+
* @returns the updated fragment
|
|
69
|
+
* @throws if the request fails, or the space, environment, or fragment is not found
|
|
70
|
+
* @internal - Experimental endpoint, subject to breaking changes without notice
|
|
71
|
+
* @example
|
|
72
|
+
* ```javascript
|
|
73
|
+
* const fragment = await client.fragment.update({
|
|
74
|
+
* spaceId: '<space_id>',
|
|
75
|
+
* environmentId: '<environment_id>',
|
|
76
|
+
* fragmentId: '<fragment_id>',
|
|
77
|
+
* }, fragmentData);
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
update(params: OptionalDefaults<GetFragmentParams>, data: UpdateFragmentProps): Promise<FragmentProps>;
|
|
81
|
+
/**
|
|
82
|
+
* Deletes a fragment
|
|
83
|
+
* @param params the space, environment, and fragment IDs
|
|
84
|
+
* @throws if the request fails, or the space, environment, or fragment is not found
|
|
85
|
+
* @internal - Experimental endpoint, subject to breaking changes without notice
|
|
86
|
+
* @example
|
|
87
|
+
* ```javascript
|
|
88
|
+
* await client.fragment.delete({
|
|
89
|
+
* spaceId: '<space_id>',
|
|
90
|
+
* environmentId: '<environment_id>',
|
|
91
|
+
* fragmentId: '<fragment_id>',
|
|
92
|
+
* });
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
delete(params: OptionalDefaults<GetFragmentParams>): Promise<void>;
|
|
96
|
+
/**
|
|
97
|
+
* Publishes a fragment
|
|
98
|
+
* @param params the space, environment, and fragment IDs, plus the current version
|
|
99
|
+
* @returns the published fragment
|
|
100
|
+
* @throws if the request fails, or the space, environment, or fragment is not found
|
|
101
|
+
* @internal - Experimental endpoint, subject to breaking changes without notice
|
|
102
|
+
* @example
|
|
103
|
+
* ```javascript
|
|
104
|
+
* const fragment = await client.fragment.publish({
|
|
105
|
+
* spaceId: '<space_id>',
|
|
106
|
+
* environmentId: '<environment_id>',
|
|
107
|
+
* fragmentId: '<fragment_id>',
|
|
108
|
+
* version: 1,
|
|
109
|
+
* });
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
publish(params: OptionalDefaults<GetFragmentParams & {
|
|
113
|
+
version: number;
|
|
114
|
+
}>): Promise<FragmentProps>;
|
|
115
|
+
/**
|
|
116
|
+
* Unpublishes a fragment
|
|
117
|
+
* @param params the space, environment, and fragment IDs, plus the current version
|
|
118
|
+
* @returns the unpublished fragment
|
|
119
|
+
* @throws if the request fails, or the space, environment, or fragment is not found
|
|
120
|
+
* @internal - Experimental endpoint, subject to breaking changes without notice
|
|
121
|
+
* @example
|
|
122
|
+
* ```javascript
|
|
123
|
+
* const fragment = await client.fragment.unpublish({
|
|
124
|
+
* spaceId: '<space_id>',
|
|
125
|
+
* environmentId: '<environment_id>',
|
|
126
|
+
* fragmentId: '<fragment_id>',
|
|
127
|
+
* version: 2,
|
|
128
|
+
* });
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
unpublish(params: OptionalDefaults<GetFragmentParams & {
|
|
132
|
+
version: number;
|
|
133
|
+
}>): Promise<FragmentProps>;
|
|
134
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { ExoCursorPaginatedCollectionProp, GetSpaceEnvironmentParams, GetTemplateParams } from '../../common-types';
|
|
2
|
+
import type { CreateTemplateProps, TemplateProps, TemplateQueryOptions, UpsertTemplateProps } from '../../entities/template';
|
|
3
|
+
import type { OptionalDefaults } from '../wrappers/wrap';
|
|
4
|
+
export type TemplatePlainClientAPI = {
|
|
5
|
+
/**
|
|
6
|
+
* Fetches all templates for a space and environment
|
|
7
|
+
* @param params the space, environment IDs and query options (see {@link TemplateQueryOptions})
|
|
8
|
+
* @returns a collection of templates
|
|
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 templates = await client.template.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: TemplateQueryOptions;
|
|
24
|
+
}>): Promise<ExoCursorPaginatedCollectionProp<TemplateProps>>;
|
|
25
|
+
/**
|
|
26
|
+
* Fetches a single template by ID
|
|
27
|
+
* @param params the space, environment, and template IDs
|
|
28
|
+
* @returns the template
|
|
29
|
+
* @throws if the request fails, or the space, environment, or template is not found
|
|
30
|
+
* @internal - Experimental endpoint, subject to breaking changes without notice
|
|
31
|
+
* @example
|
|
32
|
+
* ```javascript
|
|
33
|
+
* const template = await client.template.get({
|
|
34
|
+
* spaceId: '<space_id>',
|
|
35
|
+
* environmentId: '<environment_id>',
|
|
36
|
+
* templateId: '<template_id>',
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
get(params: OptionalDefaults<GetTemplateParams>): Promise<TemplateProps>;
|
|
41
|
+
/**
|
|
42
|
+
* Creates a new template
|
|
43
|
+
* @param params the space and environment IDs
|
|
44
|
+
* @param data the template data
|
|
45
|
+
* @returns the created template
|
|
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 template = await client.template.create({
|
|
51
|
+
* spaceId: '<space_id>',
|
|
52
|
+
* environmentId: '<environment_id>',
|
|
53
|
+
* }, {
|
|
54
|
+
* name: 'My Template',
|
|
55
|
+
* description: 'A new template',
|
|
56
|
+
* viewports: [],
|
|
57
|
+
* contentProperties: [],
|
|
58
|
+
* designProperties: [],
|
|
59
|
+
* dimensionKeyMap: { designProperties: {} },
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
create(params: OptionalDefaults<GetSpaceEnvironmentParams>, data: CreateTemplateProps): Promise<TemplateProps>;
|
|
64
|
+
/**
|
|
65
|
+
* Upserts a template (creates or updates via PUT)
|
|
66
|
+
* @param params the space, environment, and template IDs
|
|
67
|
+
* @param data the template data to upsert (include sys.version for updates, omit for creates)
|
|
68
|
+
* @returns the upserted template
|
|
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.template.get({ templateId: '<template_id>' });
|
|
74
|
+
* const updated = await client.template.upsert({
|
|
75
|
+
* spaceId: '<space_id>',
|
|
76
|
+
* environmentId: '<environment_id>',
|
|
77
|
+
* templateId: '<template_id>',
|
|
78
|
+
* }, {
|
|
79
|
+
* sys: { id: current.sys.id, type: 'Template', version: current.sys.version },
|
|
80
|
+
* name: 'Updated Template',
|
|
81
|
+
* ...otherFields,
|
|
82
|
+
* });
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
upsert(params: OptionalDefaults<GetTemplateParams>, data: UpsertTemplateProps): Promise<TemplateProps>;
|
|
86
|
+
/**
|
|
87
|
+
* Deletes a template
|
|
88
|
+
* @param params the space, environment, and template IDs
|
|
89
|
+
* @throws if the request fails, or the space, environment, or template is not found
|
|
90
|
+
* @internal - Experimental endpoint, subject to breaking changes without notice
|
|
91
|
+
* @example
|
|
92
|
+
* ```javascript
|
|
93
|
+
* await client.template.delete({
|
|
94
|
+
* spaceId: '<space_id>',
|
|
95
|
+
* environmentId: '<environment_id>',
|
|
96
|
+
* templateId: '<template_id>',
|
|
97
|
+
* });
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
delete(params: OptionalDefaults<GetTemplateParams>): Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* Publishes a template
|
|
103
|
+
* @param params the space, environment, and template IDs, plus the current version
|
|
104
|
+
* @returns the published template
|
|
105
|
+
* @throws if the request fails, or the space, environment, or template is not found
|
|
106
|
+
* @internal - Experimental endpoint, subject to breaking changes without notice
|
|
107
|
+
* @example
|
|
108
|
+
* ```javascript
|
|
109
|
+
* const template = await client.template.publish({
|
|
110
|
+
* spaceId: '<space_id>',
|
|
111
|
+
* environmentId: '<environment_id>',
|
|
112
|
+
* templateId: '<template_id>',
|
|
113
|
+
* version: 1,
|
|
114
|
+
* });
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
publish(params: OptionalDefaults<GetTemplateParams & {
|
|
118
|
+
version: number;
|
|
119
|
+
}>): Promise<TemplateProps>;
|
|
120
|
+
/**
|
|
121
|
+
* Unpublishes a template
|
|
122
|
+
* @param params the space, environment, and template IDs, plus the current version
|
|
123
|
+
* @returns the unpublished template
|
|
124
|
+
* @throws if the request fails, or the space, environment, or template is not found
|
|
125
|
+
* @internal - Experimental endpoint, subject to breaking changes without notice
|
|
126
|
+
* @example
|
|
127
|
+
* ```javascript
|
|
128
|
+
* const template = await client.template.unpublish({
|
|
129
|
+
* spaceId: '<space_id>',
|
|
130
|
+
* environmentId: '<environment_id>',
|
|
131
|
+
* templateId: '<template_id>',
|
|
132
|
+
* version: 2,
|
|
133
|
+
* });
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
unpublish(params: OptionalDefaults<GetTemplateParams & {
|
|
137
|
+
version: number;
|
|
138
|
+
}>): Promise<TemplateProps>;
|
|
139
|
+
};
|
|
@@ -51,6 +51,8 @@ import type { TaskPlainClientAPI } from './entities/task';
|
|
|
51
51
|
import type { TeamPlainClientAPI } from './entities/team';
|
|
52
52
|
import type { TeamMembershipPlainClientAPI } from './entities/team-membership';
|
|
53
53
|
import type { TeamSpaceMembershipPlainClientAPI } from './entities/team-space-membership';
|
|
54
|
+
import type { FragmentPlainClientAPI } from './entities/fragment';
|
|
55
|
+
import type { TemplatePlainClientAPI } from './entities/template';
|
|
54
56
|
import type { UIConfigPlainClientAPI } from './entities/ui-config';
|
|
55
57
|
import type { UploadPlainClientAPI } from './entities/upload';
|
|
56
58
|
import type { UploadCredentialAPI } from './entities/upload-credential';
|
|
@@ -77,6 +79,8 @@ import type { SemanticSearchPlainClientAPI } from './entities/semantic-search';
|
|
|
77
79
|
import type { SemanticSettingsPlainClientAPI } from './entities/semantic-settings';
|
|
78
80
|
import type { ContentSemanticsIndexPlainClientAPI } from './entities/content-semantics-index';
|
|
79
81
|
import type { ComponentTypePlainClientAPI } from './entities/component-type';
|
|
82
|
+
import type { DataAssemblyPlainClientAPI } from './entities/data-assembly';
|
|
83
|
+
import type { ExperiencePlainClientAPI } from './entities/experience';
|
|
80
84
|
export type PlainClientAPI = {
|
|
81
85
|
raw: {
|
|
82
86
|
getDefaultParams(): PlainClientDefaultParams | undefined;
|
|
@@ -166,6 +170,7 @@ export type PlainClientAPI = {
|
|
|
166
170
|
};
|
|
167
171
|
comment: CommentPlainClientAPI;
|
|
168
172
|
componentType: ComponentTypePlainClientAPI;
|
|
173
|
+
dataAssembly: DataAssemblyPlainClientAPI;
|
|
169
174
|
concept: ConceptPlainClientAPI;
|
|
170
175
|
conceptScheme: ConceptSchemePlainClientAPI;
|
|
171
176
|
contentType: {
|
|
@@ -479,12 +484,15 @@ export type PlainClientAPI = {
|
|
|
479
484
|
team: TeamPlainClientAPI;
|
|
480
485
|
teamMembership: TeamMembershipPlainClientAPI;
|
|
481
486
|
teamSpaceMembership: TeamSpaceMembershipPlainClientAPI;
|
|
487
|
+
fragment: FragmentPlainClientAPI;
|
|
488
|
+
template: TemplatePlainClientAPI;
|
|
482
489
|
uiConfig: UIConfigPlainClientAPI;
|
|
483
490
|
userUIConfig: UserUIConfigPlainClientAPI;
|
|
484
491
|
workflowDefinition: WorkflowDefinitionPlainClientAPI;
|
|
485
492
|
workflow: WorkflowPlainClientAPI;
|
|
486
493
|
workflowsChangelog: WorkflowsChangelogPlainClientAPI;
|
|
487
494
|
oauthApplication: OAuthApplicationPlainClientAPI;
|
|
495
|
+
experience: ExperiencePlainClientAPI;
|
|
488
496
|
semanticSearch: SemanticSearchPlainClientAPI;
|
|
489
497
|
semanticDuplicates: SemanticDuplicatesPlainClientAPI;
|
|
490
498
|
semanticRecommendations: SemanticRecommendationsPlainClientAPI;
|
|
@@ -221,6 +221,12 @@ const createPlainClient = (makeRequest, defaults) => {
|
|
|
221
221
|
},
|
|
222
222
|
componentType: {
|
|
223
223
|
getMany: wrap(wrapParams, 'ComponentType', 'getMany'),
|
|
224
|
+
get: wrap(wrapParams, 'ComponentType', 'get'),
|
|
225
|
+
create: wrap(wrapParams, 'ComponentType', 'create'),
|
|
226
|
+
upsert: wrap(wrapParams, 'ComponentType', 'upsert'),
|
|
227
|
+
delete: wrap(wrapParams, 'ComponentType', 'delete'),
|
|
228
|
+
publish: wrap(wrapParams, 'ComponentType', 'publish'),
|
|
229
|
+
unpublish: wrap(wrapParams, 'ComponentType', 'unpublish'),
|
|
224
230
|
},
|
|
225
231
|
contentType: {
|
|
226
232
|
get: wrap(wrapParams, 'ContentType', 'get'),
|
|
@@ -234,6 +240,17 @@ const createPlainClient = (makeRequest, defaults) => {
|
|
|
234
240
|
createWithId: wrap(wrapParams, 'ContentType', 'createWithId'),
|
|
235
241
|
omitAndDeleteField: (params, contentType, fieldId) => omitAndDeleteField(makeRequest, { ...{ ...defaults, ...params }, fieldId }, contentType),
|
|
236
242
|
},
|
|
243
|
+
dataAssembly: {
|
|
244
|
+
getMany: wrap(wrapParams, 'DataAssembly', 'getMany'),
|
|
245
|
+
getManyPublished: wrap(wrapParams, 'DataAssembly', 'getManyPublished'),
|
|
246
|
+
getPublished: wrap(wrapParams, 'DataAssembly', 'getPublished'),
|
|
247
|
+
get: wrap(wrapParams, 'DataAssembly', 'get'),
|
|
248
|
+
create: wrap(wrapParams, 'DataAssembly', 'create'),
|
|
249
|
+
update: wrap(wrapParams, 'DataAssembly', 'update'),
|
|
250
|
+
delete: wrap(wrapParams, 'DataAssembly', 'delete'),
|
|
251
|
+
publish: wrap(wrapParams, 'DataAssembly', 'publish'),
|
|
252
|
+
unpublish: wrap(wrapParams, 'DataAssembly', 'unpublish'),
|
|
253
|
+
},
|
|
237
254
|
user: {
|
|
238
255
|
getManyForSpace: wrap(wrapParams, 'User', 'getManyForSpace'),
|
|
239
256
|
getForSpace: wrap(wrapParams, 'User', 'getForSpace'),
|
|
@@ -581,6 +598,24 @@ const createPlainClient = (makeRequest, defaults) => {
|
|
|
581
598
|
update: wrap(wrapParams, 'TeamSpaceMembership', 'update'),
|
|
582
599
|
delete: wrap(wrapParams, 'TeamSpaceMembership', 'delete'),
|
|
583
600
|
},
|
|
601
|
+
fragment: {
|
|
602
|
+
getMany: wrap(wrapParams, 'Fragment', 'getMany'),
|
|
603
|
+
get: wrap(wrapParams, 'Fragment', 'get'),
|
|
604
|
+
create: wrap(wrapParams, 'Fragment', 'create'),
|
|
605
|
+
update: wrap(wrapParams, 'Fragment', 'update'),
|
|
606
|
+
delete: wrap(wrapParams, 'Fragment', 'delete'),
|
|
607
|
+
publish: wrap(wrapParams, 'Fragment', 'publish'),
|
|
608
|
+
unpublish: wrap(wrapParams, 'Fragment', 'unpublish'),
|
|
609
|
+
},
|
|
610
|
+
template: {
|
|
611
|
+
getMany: wrap(wrapParams, 'Template', 'getMany'),
|
|
612
|
+
get: wrap(wrapParams, 'Template', 'get'),
|
|
613
|
+
create: wrap(wrapParams, 'Template', 'create'),
|
|
614
|
+
upsert: wrap(wrapParams, 'Template', 'upsert'),
|
|
615
|
+
delete: wrap(wrapParams, 'Template', 'delete'),
|
|
616
|
+
publish: wrap(wrapParams, 'Template', 'publish'),
|
|
617
|
+
unpublish: wrap(wrapParams, 'Template', 'unpublish'),
|
|
618
|
+
},
|
|
584
619
|
uiConfig: {
|
|
585
620
|
get: wrap(wrapParams, 'UIConfig', 'get'),
|
|
586
621
|
update: wrap(wrapParams, 'UIConfig', 'update'),
|
|
@@ -589,6 +624,15 @@ const createPlainClient = (makeRequest, defaults) => {
|
|
|
589
624
|
get: wrap(wrapParams, 'UserUIConfig', 'get'),
|
|
590
625
|
update: wrap(wrapParams, 'UserUIConfig', 'update'),
|
|
591
626
|
},
|
|
627
|
+
experience: {
|
|
628
|
+
getMany: wrap(wrapParams, 'Experience', 'getMany'),
|
|
629
|
+
get: wrap(wrapParams, 'Experience', 'get'),
|
|
630
|
+
create: wrap(wrapParams, 'Experience', 'create'),
|
|
631
|
+
upsert: wrap(wrapParams, 'Experience', 'upsert'),
|
|
632
|
+
delete: wrap(wrapParams, 'Experience', 'delete'),
|
|
633
|
+
publish: wrap(wrapParams, 'Experience', 'publish'),
|
|
634
|
+
unpublish: wrap(wrapParams, 'Experience', 'unpublish'),
|
|
635
|
+
},
|
|
592
636
|
workflowDefinition: {
|
|
593
637
|
get: wrap(wrapParams, 'WorkflowDefinition', 'get'),
|
|
594
638
|
getMany: wrap(wrapParams, 'WorkflowDefinition', 'getMany'),
|