@remkoj/optimizely-cms-api 2.0.0-pre2 → 2.0.0-pre4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/CmsIntegrationApiClient.d.ts +24 -22
- package/dist/client/CmsIntegrationApiClient.js +36 -34
- package/dist/client/core/ApiError.d.ts +10 -10
- package/dist/client/core/ApiError.js +15 -15
- package/dist/client/core/ApiRequestOptions.d.ts +13 -13
- package/dist/client/core/ApiRequestOptions.js +2 -2
- package/dist/client/core/ApiResult.d.ts +7 -7
- package/dist/client/core/ApiResult.js +2 -2
- package/dist/client/core/BaseHttpRequest.d.ts +8 -8
- package/dist/client/core/BaseHttpRequest.js +9 -9
- package/dist/client/core/CancelablePromise.d.ts +20 -20
- package/dist/client/core/CancelablePromise.js +116 -116
- package/dist/client/core/FetchHttpRequest.d.ts +14 -14
- package/dist/client/core/FetchHttpRequest.js +20 -20
- package/dist/client/core/OpenAPI.d.ts +16 -16
- package/dist/client/core/OpenAPI.js +14 -14
- package/dist/client/core/request.d.ts +30 -30
- package/dist/client/core/request.js +294 -294
- package/dist/client/index.d.ts +81 -76
- package/dist/client/index.js +48 -46
- package/dist/client/models/BinaryProperty.d.ts +8 -8
- package/dist/client/models/BinaryProperty.js +2 -2
- package/dist/client/models/BooleanProperty.d.ts +5 -5
- package/dist/client/models/BooleanProperty.js +2 -2
- package/dist/client/models/Changeset.d.ts +26 -26
- package/dist/client/models/Changeset.js +2 -2
- package/dist/client/models/ChangesetItem.d.ts +11 -11
- package/dist/client/models/ChangesetItem.js +2 -2
- package/dist/client/models/ChangesetItemPage.d.ts +19 -19
- package/dist/client/models/ChangesetItemPage.js +2 -2
- package/dist/client/models/ChangesetPage.d.ts +19 -19
- package/dist/client/models/ChangesetPage.js +2 -2
- package/dist/client/models/ComponentListItem.d.ts +10 -10
- package/dist/client/models/ComponentListItem.js +2 -2
- package/dist/client/models/ComponentProperty.d.ts +10 -10
- package/dist/client/models/ComponentProperty.js +2 -2
- package/dist/client/models/ContentBaseType.d.ts +11 -11
- package/dist/client/models/ContentBaseType.js +19 -19
- package/dist/client/models/ContentComponent.d.ts +34 -34
- package/dist/client/models/ContentComponent.js +2 -2
- package/dist/client/models/ContentItem.d.ts +60 -60
- package/dist/client/models/ContentItem.js +2 -2
- package/dist/client/models/ContentItemListWithContentTypes.d.ts +27 -27
- package/dist/client/models/ContentItemListWithContentTypes.js +2 -2
- package/dist/client/models/ContentItemPage.d.ts +19 -19
- package/dist/client/models/ContentItemPage.js +2 -2
- package/dist/client/models/ContentItemWithContentTypes.d.ts +12 -12
- package/dist/client/models/ContentItemWithContentTypes.js +2 -2
- package/dist/client/models/ContentListItem.d.ts +14 -14
- package/dist/client/models/ContentListItem.js +2 -2
- package/dist/client/models/ContentLocaleInfo.d.ts +11 -11
- package/dist/client/models/ContentLocaleInfo.js +2 -2
- package/dist/client/models/ContentMetadata.d.ts +46 -46
- package/dist/client/models/ContentMetadata.js +2 -2
- package/dist/client/models/ContentMetadataPage.d.ts +19 -19
- package/dist/client/models/ContentMetadataPage.js +2 -2
- package/dist/client/models/ContentProperty.d.ts +14 -14
- package/dist/client/models/ContentProperty.js +2 -2
- package/dist/client/models/ContentReference.d.ts +17 -17
- package/dist/client/models/ContentReference.js +2 -2
- package/dist/client/models/ContentReferenceListItem.d.ts +14 -14
- package/dist/client/models/ContentReferenceListItem.js +2 -2
- package/dist/client/models/ContentReferenceProperty.d.ts +14 -14
- package/dist/client/models/ContentReferenceProperty.js +2 -2
- package/dist/client/models/ContentType.d.ts +79 -79
- package/dist/client/models/ContentType.js +2 -2
- package/dist/client/models/ContentTypeFeature.d.ts +10 -10
- package/dist/client/models/ContentTypeFeature.js +18 -18
- package/dist/client/models/ContentTypePage.d.ts +19 -19
- package/dist/client/models/ContentTypePage.js +2 -2
- package/dist/client/models/ContentTypeProperty.d.ts +47 -47
- package/dist/client/models/ContentTypeProperty.js +2 -2
- package/dist/client/models/ContentTypeUsage.d.ts +7 -7
- package/dist/client/models/ContentTypeUsage.js +15 -15
- package/dist/client/models/CopyContentOptions.d.ts +21 -21
- package/dist/client/models/CopyContentOptions.js +2 -2
- package/dist/client/models/DateTimeListItem.d.ts +14 -14
- package/dist/client/models/DateTimeListItem.js +2 -2
- package/dist/client/models/DateTimeProperty.d.ts +14 -14
- package/dist/client/models/DateTimeProperty.js +2 -2
- package/dist/client/models/DisplaySetting.d.ts +22 -0
- package/dist/client/models/DisplaySetting.js +2 -0
- package/dist/client/models/DisplaySettingChoice.d.ts +13 -0
- package/dist/client/models/DisplaySettingChoice.js +2 -0
- package/dist/client/models/DisplayTemplate.d.ts +49 -0
- package/dist/client/models/DisplayTemplate.js +2 -0
- package/dist/client/models/DisplayTemplatePage.d.ts +19 -0
- package/dist/client/models/DisplayTemplatePage.js +2 -0
- package/dist/client/models/DoubleEnumerationSettings.d.ts +9 -9
- package/dist/client/models/DoubleEnumerationSettings.js +2 -2
- package/dist/client/models/FloatListItem.d.ts +16 -16
- package/dist/client/models/FloatListItem.js +2 -2
- package/dist/client/models/FloatProperty.d.ts +16 -16
- package/dist/client/models/FloatProperty.js +2 -2
- package/dist/client/models/ImageDescriptor.d.ts +17 -17
- package/dist/client/models/ImageDescriptor.js +2 -2
- package/dist/client/models/ImportPackageMessage.d.ts +17 -17
- package/dist/client/models/ImportPackageMessage.js +2 -2
- package/dist/client/models/ImportPackageResult.d.ts +22 -22
- package/dist/client/models/ImportPackageResult.js +2 -2
- package/dist/client/models/IndexingType.d.ts +8 -8
- package/dist/client/models/IndexingType.js +16 -16
- package/dist/client/models/Int32EnumerationSettings.d.ts +9 -9
- package/dist/client/models/Int32EnumerationSettings.js +2 -2
- package/dist/client/models/IntegerListItem.d.ts +16 -16
- package/dist/client/models/IntegerListItem.js +2 -2
- package/dist/client/models/IntegerProperty.d.ts +16 -16
- package/dist/client/models/IntegerProperty.js +2 -2
- package/dist/client/models/JsonStringProperty.d.ts +5 -5
- package/dist/client/models/JsonStringProperty.js +2 -2
- package/dist/client/models/ListProperty.d.ts +26 -26
- package/dist/client/models/ListProperty.js +2 -2
- package/dist/client/models/ListPropertyItem.d.ts +11 -11
- package/dist/client/models/ListPropertyItem.js +2 -2
- package/dist/client/models/LocaleStatus.d.ts +7 -7
- package/dist/client/models/LocaleStatus.js +15 -15
- package/dist/client/models/Manifest.d.ts +24 -19
- package/dist/client/models/Manifest.js +2 -2
- package/dist/client/models/OauthToken.d.ts +18 -18
- package/dist/client/models/OauthToken.js +2 -2
- package/dist/client/models/OauthTokenError.d.ts +13 -13
- package/dist/client/models/OauthTokenError.js +2 -2
- package/dist/client/models/OauthTokenRequest.d.ts +21 -21
- package/dist/client/models/OauthTokenRequest.js +2 -2
- package/dist/client/models/PackageJob.d.ts +28 -28
- package/dist/client/models/PackageJob.js +2 -2
- package/dist/client/models/PackageJobMessage.d.ts +17 -17
- package/dist/client/models/PackageJobMessage.js +2 -2
- package/dist/client/models/PackageJobStatus.d.ts +4 -4
- package/dist/client/models/PackageJobStatus.js +2 -2
- package/dist/client/models/ProblemDetails.d.ts +1 -1
- package/dist/client/models/ProblemDetails.js +2 -2
- package/dist/client/models/PropertyDataType.d.ts +18 -18
- package/dist/client/models/PropertyDataType.js +26 -26
- package/dist/client/models/PropertyFormat.d.ts +34 -34
- package/dist/client/models/PropertyFormat.js +2 -2
- package/dist/client/models/PropertyFormatPage.d.ts +19 -19
- package/dist/client/models/PropertyFormatPage.js +2 -2
- package/dist/client/models/PropertyGroup.d.ts +21 -21
- package/dist/client/models/PropertyGroup.js +2 -2
- package/dist/client/models/PropertyGroupPage.d.ts +19 -19
- package/dist/client/models/PropertyGroupPage.js +2 -2
- package/dist/client/models/StringEnumerationSettings.d.ts +9 -9
- package/dist/client/models/StringEnumerationSettings.js +2 -2
- package/dist/client/models/StringListItem.d.ts +14 -14
- package/dist/client/models/StringListItem.js +2 -2
- package/dist/client/models/StringProperty.d.ts +14 -14
- package/dist/client/models/StringProperty.js +2 -2
- package/dist/client/models/UrlListItem.d.ts +5 -5
- package/dist/client/models/UrlListItem.js +2 -2
- package/dist/client/models/UrlProperty.d.ts +5 -5
- package/dist/client/models/UrlProperty.js +2 -2
- package/dist/client/models/VersionStatus.d.ts +12 -12
- package/dist/client/models/VersionStatus.js +20 -20
- package/dist/client/services/ChangesetsService.d.ts +105 -105
- package/dist/client/services/ChangesetsService.js +239 -239
- package/dist/client/services/ContentService.d.ts +172 -172
- package/dist/client/services/ContentService.js +409 -409
- package/dist/client/services/ContentTypesService.d.ts +66 -66
- package/dist/client/services/ContentTypesService.js +149 -149
- package/dist/client/services/DisplayTemplatesService.d.ts +60 -0
- package/dist/client/services/DisplayTemplatesService.js +135 -0
- package/dist/client/services/OauthService.d.ts +17 -17
- package/dist/client/services/OauthService.js +28 -28
- package/dist/client/services/PackagesService.d.ts +41 -41
- package/dist/client/services/PackagesService.js +80 -80
- package/dist/client/services/PropertyFormatsService.d.ts +26 -26
- package/dist/client/services/PropertyFormatsService.js +53 -53
- package/dist/client/services/PropertyGroupsService.d.ts +61 -61
- package/dist/client/services/PropertyGroupsService.js +135 -135
- package/dist/config.d.ts +8 -8
- package/dist/config.js +40 -36
- package/dist/index.d.ts +15 -15
- package/dist/index.js +95 -95
- package/package.json +4 -3
|
@@ -1,409 +1,409 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ContentService = void 0;
|
|
4
|
-
class ContentService {
|
|
5
|
-
constructor(httpRequest) {
|
|
6
|
-
this.httpRequest = httpRequest;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Create content
|
|
10
|
-
* Create a new content item.
|
|
11
|
-
* @param requestBody The content item that should be created.
|
|
12
|
-
* @param skipValidation Indicates that the content validation should be ignored.
|
|
13
|
-
* @returns ContentItem Created
|
|
14
|
-
* @throws ApiError
|
|
15
|
-
*/
|
|
16
|
-
contentCreate(requestBody, skipValidation) {
|
|
17
|
-
return this.httpRequest.request({
|
|
18
|
-
method: 'POST',
|
|
19
|
-
url: '/content',
|
|
20
|
-
query: {
|
|
21
|
-
'skipValidation': skipValidation,
|
|
22
|
-
},
|
|
23
|
-
body: requestBody,
|
|
24
|
-
mediaType: 'application/json',
|
|
25
|
-
errors: {
|
|
26
|
-
400: `Bad Request`,
|
|
27
|
-
403: `Forbidden`,
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Get content
|
|
33
|
-
* Get shared metadata about the content instance with the provided key.
|
|
34
|
-
* @param key The key of the content to retrieve metadata for.
|
|
35
|
-
* @param allowDeleted Indicates that metadata for a deleted content may be returned.
|
|
36
|
-
* @returns ContentMetadata Success
|
|
37
|
-
* @throws ApiError
|
|
38
|
-
*/
|
|
39
|
-
contentGetMetadata(key, allowDeleted) {
|
|
40
|
-
return this.httpRequest.request({
|
|
41
|
-
method: 'GET',
|
|
42
|
-
url: '/content/{key}',
|
|
43
|
-
path: {
|
|
44
|
-
'key': key,
|
|
45
|
-
},
|
|
46
|
-
query: {
|
|
47
|
-
'allowDeleted': allowDeleted,
|
|
48
|
-
},
|
|
49
|
-
errors: {
|
|
50
|
-
403: `Forbidden`,
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Update content
|
|
56
|
-
* Update an existing content item. If a content item with the provided key does not exist an error is returned.
|
|
57
|
-
* @param key The key of the content item to patch.
|
|
58
|
-
* @param requestBody The values of the content item that should be updated.
|
|
59
|
-
* @returns ContentMetadata Success
|
|
60
|
-
* @throws ApiError
|
|
61
|
-
*/
|
|
62
|
-
contentPatchMetadata(key, requestBody) {
|
|
63
|
-
return this.httpRequest.request({
|
|
64
|
-
method: 'PATCH',
|
|
65
|
-
url: '/content/{key}',
|
|
66
|
-
path: {
|
|
67
|
-
'key': key,
|
|
68
|
-
},
|
|
69
|
-
body: requestBody,
|
|
70
|
-
mediaType: 'application/merge-patch+json',
|
|
71
|
-
errors: {
|
|
72
|
-
400: `Bad Request`,
|
|
73
|
-
403: `Forbidden`,
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Delete content
|
|
79
|
-
* Deletes the content item with the provided key. If a content item with the provided key does not exist an error is returned.
|
|
80
|
-
* @param key The key of the content item to delete.
|
|
81
|
-
* @param permanent Indicates that the content item should be permanently deleted immediately or if it should be soft deleted first.
|
|
82
|
-
* @returns ContentMetadata Success
|
|
83
|
-
* @throws ApiError
|
|
84
|
-
*/
|
|
85
|
-
contentDelete(key, permanent) {
|
|
86
|
-
return this.httpRequest.request({
|
|
87
|
-
method: 'DELETE',
|
|
88
|
-
url: '/content/{key}',
|
|
89
|
-
path: {
|
|
90
|
-
'key': key,
|
|
91
|
-
},
|
|
92
|
-
query: {
|
|
93
|
-
'permanent': permanent,
|
|
94
|
-
},
|
|
95
|
-
errors: {
|
|
96
|
-
400: `Bad Request`,
|
|
97
|
-
403: `Forbidden`,
|
|
98
|
-
},
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Get content path
|
|
103
|
-
* Get the content path with the provided key.
|
|
104
|
-
* @param key The key of the content path to retrieve.
|
|
105
|
-
* @param pageIndex
|
|
106
|
-
* @param pageSize
|
|
107
|
-
* @returns ContentMetadataPage Success
|
|
108
|
-
* @throws ApiError
|
|
109
|
-
*/
|
|
110
|
-
contentGetPath(key, pageIndex, pageSize) {
|
|
111
|
-
return this.httpRequest.request({
|
|
112
|
-
method: 'GET',
|
|
113
|
-
url: '/content/{key}/path',
|
|
114
|
-
path: {
|
|
115
|
-
'key': key,
|
|
116
|
-
},
|
|
117
|
-
query: {
|
|
118
|
-
'pageIndex': pageIndex,
|
|
119
|
-
'pageSize': pageSize,
|
|
120
|
-
},
|
|
121
|
-
errors: {
|
|
122
|
-
403: `Forbidden`,
|
|
123
|
-
},
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* List content in container
|
|
128
|
-
* List the content items located in a specific container.
|
|
129
|
-
* @param key The key of the content to retrieve items for.
|
|
130
|
-
* @param contentTypes Indicates which content types or base types to include in the list.
|
|
131
|
-
* @param pageIndex
|
|
132
|
-
* @param pageSize
|
|
133
|
-
* @returns ContentMetadataPage Success
|
|
134
|
-
* @throws ApiError
|
|
135
|
-
*/
|
|
136
|
-
contentListItems(key, contentTypes, pageIndex, pageSize) {
|
|
137
|
-
return this.httpRequest.request({
|
|
138
|
-
method: 'GET',
|
|
139
|
-
url: '/content/{key}/items',
|
|
140
|
-
path: {
|
|
141
|
-
'key': key,
|
|
142
|
-
},
|
|
143
|
-
query: {
|
|
144
|
-
'contentTypes': contentTypes,
|
|
145
|
-
'pageIndex': pageIndex,
|
|
146
|
-
'pageSize': pageSize,
|
|
147
|
-
},
|
|
148
|
-
errors: {
|
|
149
|
-
403: `Forbidden`,
|
|
150
|
-
},
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* List assets
|
|
155
|
-
* List the assets that belongs to a content instance.
|
|
156
|
-
* @param key The key of the content to retrieve assets for.
|
|
157
|
-
* @param contentTypes Indicates which content types or base types to include in the list.
|
|
158
|
-
* @param pageIndex
|
|
159
|
-
* @param pageSize
|
|
160
|
-
* @returns ContentMetadataPage Success
|
|
161
|
-
* @throws ApiError
|
|
162
|
-
*/
|
|
163
|
-
contentListAssets(key, contentTypes, pageIndex, pageSize) {
|
|
164
|
-
return this.httpRequest.request({
|
|
165
|
-
method: 'GET',
|
|
166
|
-
url: '/content/{key}/assets',
|
|
167
|
-
path: {
|
|
168
|
-
'key': key,
|
|
169
|
-
},
|
|
170
|
-
query: {
|
|
171
|
-
'contentTypes': contentTypes,
|
|
172
|
-
'pageIndex': pageIndex,
|
|
173
|
-
'pageSize': pageSize,
|
|
174
|
-
},
|
|
175
|
-
errors: {
|
|
176
|
-
403: `Forbidden`,
|
|
177
|
-
},
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Copy content
|
|
182
|
-
* Create a copy of the content item with the provided key.
|
|
183
|
-
* @param key The key of the content item to copy.
|
|
184
|
-
* @param requestBody Optional instructions for how to copy content.
|
|
185
|
-
* @returns ContentMetadata Success
|
|
186
|
-
* @throws ApiError
|
|
187
|
-
*/
|
|
188
|
-
contentCopy(key, requestBody) {
|
|
189
|
-
return this.httpRequest.request({
|
|
190
|
-
method: 'POST',
|
|
191
|
-
url: '/content/{key}:copy',
|
|
192
|
-
path: {
|
|
193
|
-
'key': key,
|
|
194
|
-
},
|
|
195
|
-
body: requestBody,
|
|
196
|
-
mediaType: 'application/json',
|
|
197
|
-
errors: {
|
|
198
|
-
400: `Bad Request`,
|
|
199
|
-
403: `Forbidden`,
|
|
200
|
-
},
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Restore content
|
|
205
|
-
* Restore the deleted content item with the provided key. If a content item with the provided key is not deleted an error is returned.
|
|
206
|
-
* @param key The key of the content item to undelete.
|
|
207
|
-
* @returns ContentMetadata Success
|
|
208
|
-
* @throws ApiError
|
|
209
|
-
*/
|
|
210
|
-
contentUndelete(key) {
|
|
211
|
-
return this.httpRequest.request({
|
|
212
|
-
method: 'POST',
|
|
213
|
-
url: '/content/{key}:undelete',
|
|
214
|
-
path: {
|
|
215
|
-
'key': key,
|
|
216
|
-
},
|
|
217
|
-
errors: {
|
|
218
|
-
400: `Bad Request`,
|
|
219
|
-
403: `Forbidden`,
|
|
220
|
-
},
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Query versions
|
|
225
|
-
* List content versions based on the provided query options.
|
|
226
|
-
* @param locales Indicates which content locales that should be listed. Use 'NEUTRAL' to include locale-neutral content.
|
|
227
|
-
* Locale must be a valid IETF BCP-47 language tag.
|
|
228
|
-
* @param statuses Indicates which status content versions must have to be listed.
|
|
229
|
-
* @param pageIndex
|
|
230
|
-
* @param pageSize
|
|
231
|
-
* @returns ContentItemPage Success
|
|
232
|
-
* @throws ApiError
|
|
233
|
-
*/
|
|
234
|
-
contentListAllVersions(locales, statuses, pageIndex, pageSize) {
|
|
235
|
-
return this.httpRequest.request({
|
|
236
|
-
method: 'GET',
|
|
237
|
-
url: '/content/versions',
|
|
238
|
-
query: {
|
|
239
|
-
'locales': locales,
|
|
240
|
-
'statuses': statuses,
|
|
241
|
-
'pageIndex': pageIndex,
|
|
242
|
-
'pageSize': pageSize,
|
|
243
|
-
},
|
|
244
|
-
errors: {
|
|
245
|
-
403: `Forbidden`,
|
|
246
|
-
},
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* List versions
|
|
251
|
-
* List versions of the content item with the provided key and the provided options.
|
|
252
|
-
* @param key
|
|
253
|
-
* @param locales Indicates which content locales that should be listed. Use 'NEUTRAL' to include locale-neutral content.
|
|
254
|
-
* Locale must be a valid IETF BCP-47 language tag.
|
|
255
|
-
* @param statuses Indicates which status content versions must have to be listed.
|
|
256
|
-
* @param pageIndex
|
|
257
|
-
* @param pageSize
|
|
258
|
-
* @returns ContentItemPage Success
|
|
259
|
-
* @throws ApiError
|
|
260
|
-
*/
|
|
261
|
-
contentListVersions(key, locales, statuses, pageIndex, pageSize) {
|
|
262
|
-
return this.httpRequest.request({
|
|
263
|
-
method: 'GET',
|
|
264
|
-
url: '/content/{key}/versions',
|
|
265
|
-
path: {
|
|
266
|
-
'key': key,
|
|
267
|
-
},
|
|
268
|
-
query: {
|
|
269
|
-
'locales': locales,
|
|
270
|
-
'statuses': statuses,
|
|
271
|
-
'pageIndex': pageIndex,
|
|
272
|
-
'pageSize': pageSize,
|
|
273
|
-
},
|
|
274
|
-
errors: {
|
|
275
|
-
403: `Forbidden`,
|
|
276
|
-
},
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* Create version
|
|
281
|
-
* Create a new version of a content item.
|
|
282
|
-
* @param key The key of the content item for which a new content version should be created.
|
|
283
|
-
* @param requestBody The content version that should be created.
|
|
284
|
-
* @param skipValidation Indicates that the content validation should be ignored.
|
|
285
|
-
* @returns ContentItem Created
|
|
286
|
-
* @throws ApiError
|
|
287
|
-
*/
|
|
288
|
-
contentCreateVersion(key, requestBody, skipValidation) {
|
|
289
|
-
return this.httpRequest.request({
|
|
290
|
-
method: 'POST',
|
|
291
|
-
url: '/content/{key}/versions',
|
|
292
|
-
path: {
|
|
293
|
-
'key': key,
|
|
294
|
-
},
|
|
295
|
-
query: {
|
|
296
|
-
'skipValidation': skipValidation,
|
|
297
|
-
},
|
|
298
|
-
body: requestBody,
|
|
299
|
-
mediaType: 'application/json',
|
|
300
|
-
errors: {
|
|
301
|
-
400: `Bad Request`,
|
|
302
|
-
403: `Forbidden`,
|
|
303
|
-
},
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
|
-
* Delete locale
|
|
308
|
-
* Deletes the content item with the provided key. If a content item with the provided key does not exist an error is returned.
|
|
309
|
-
* @param key
|
|
310
|
-
* @param locale
|
|
311
|
-
* @returns ContentItem Success
|
|
312
|
-
* @throws ApiError
|
|
313
|
-
*/
|
|
314
|
-
contentDeleteLocale(key, locale) {
|
|
315
|
-
return this.httpRequest.request({
|
|
316
|
-
method: 'DELETE',
|
|
317
|
-
url: '/content/{key}/versions',
|
|
318
|
-
path: {
|
|
319
|
-
'key': key,
|
|
320
|
-
},
|
|
321
|
-
query: {
|
|
322
|
-
'locale': locale,
|
|
323
|
-
},
|
|
324
|
-
errors: {
|
|
325
|
-
400: `Bad Request`,
|
|
326
|
-
403: `Forbidden`,
|
|
327
|
-
},
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* Get version
|
|
332
|
-
* Get the content item with the provided key and version.
|
|
333
|
-
* @param key
|
|
334
|
-
* @param version
|
|
335
|
-
* @param locale
|
|
336
|
-
* @returns ContentItem Success
|
|
337
|
-
* @throws ApiError
|
|
338
|
-
*/
|
|
339
|
-
contentGetVersion(key, version, locale) {
|
|
340
|
-
return this.httpRequest.request({
|
|
341
|
-
method: 'GET',
|
|
342
|
-
url: '/content/{key}/versions/{version}',
|
|
343
|
-
path: {
|
|
344
|
-
'key': key,
|
|
345
|
-
'version': version,
|
|
346
|
-
},
|
|
347
|
-
query: {
|
|
348
|
-
'locale': locale,
|
|
349
|
-
},
|
|
350
|
-
errors: {
|
|
351
|
-
403: `Forbidden`,
|
|
352
|
-
},
|
|
353
|
-
});
|
|
354
|
-
}
|
|
355
|
-
/**
|
|
356
|
-
* Update version
|
|
357
|
-
* Update an existing content item. If a content item with the provided key does not exist an error is returned.
|
|
358
|
-
* @param key The key of the content item that should be updated.
|
|
359
|
-
* @param version The version of the content that should be updated.
|
|
360
|
-
* @param requestBody The content information that should be updated.
|
|
361
|
-
* @param locale The locale of the content that should be updated.
|
|
362
|
-
* @param skipValidation Indicates that the content validation should be ignored.
|
|
363
|
-
* @returns ContentItem Success
|
|
364
|
-
* @throws ApiError
|
|
365
|
-
*/
|
|
366
|
-
contentPatchVersion(key, version, requestBody, locale, skipValidation) {
|
|
367
|
-
return this.httpRequest.request({
|
|
368
|
-
method: 'PATCH',
|
|
369
|
-
url: '/content/{key}/versions/{version}',
|
|
370
|
-
path: {
|
|
371
|
-
'key': key,
|
|
372
|
-
'version': version,
|
|
373
|
-
},
|
|
374
|
-
query: {
|
|
375
|
-
'locale': locale,
|
|
376
|
-
'skipValidation': skipValidation,
|
|
377
|
-
},
|
|
378
|
-
body: requestBody,
|
|
379
|
-
mediaType: 'application/merge-patch+json',
|
|
380
|
-
errors: {
|
|
381
|
-
400: `Bad Request`,
|
|
382
|
-
403: `Forbidden`,
|
|
383
|
-
},
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
/**
|
|
387
|
-
* Delete version
|
|
388
|
-
* Deletes the content item with the provided key. If a content item with the provided key does not exist an error is returned.
|
|
389
|
-
* @param key
|
|
390
|
-
* @param version
|
|
391
|
-
* @returns ContentItem Success
|
|
392
|
-
* @throws ApiError
|
|
393
|
-
*/
|
|
394
|
-
contentDeleteVersion(key, version) {
|
|
395
|
-
return this.httpRequest.request({
|
|
396
|
-
method: 'DELETE',
|
|
397
|
-
url: '/content/{key}/versions/{version}',
|
|
398
|
-
path: {
|
|
399
|
-
'key': key,
|
|
400
|
-
'version': version,
|
|
401
|
-
},
|
|
402
|
-
errors: {
|
|
403
|
-
400: `Bad Request`,
|
|
404
|
-
403: `Forbidden`,
|
|
405
|
-
},
|
|
406
|
-
});
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
exports.ContentService = ContentService;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContentService = void 0;
|
|
4
|
+
class ContentService {
|
|
5
|
+
constructor(httpRequest) {
|
|
6
|
+
this.httpRequest = httpRequest;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Create content
|
|
10
|
+
* Create a new content item.
|
|
11
|
+
* @param requestBody The content item that should be created.
|
|
12
|
+
* @param skipValidation Indicates that the content validation should be ignored.
|
|
13
|
+
* @returns ContentItem Created
|
|
14
|
+
* @throws ApiError
|
|
15
|
+
*/
|
|
16
|
+
contentCreate(requestBody, skipValidation) {
|
|
17
|
+
return this.httpRequest.request({
|
|
18
|
+
method: 'POST',
|
|
19
|
+
url: '/content',
|
|
20
|
+
query: {
|
|
21
|
+
'skipValidation': skipValidation,
|
|
22
|
+
},
|
|
23
|
+
body: requestBody,
|
|
24
|
+
mediaType: 'application/json',
|
|
25
|
+
errors: {
|
|
26
|
+
400: `Bad Request`,
|
|
27
|
+
403: `Forbidden`,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get content
|
|
33
|
+
* Get shared metadata about the content instance with the provided key.
|
|
34
|
+
* @param key The key of the content to retrieve metadata for.
|
|
35
|
+
* @param allowDeleted Indicates that metadata for a deleted content may be returned.
|
|
36
|
+
* @returns ContentMetadata Success
|
|
37
|
+
* @throws ApiError
|
|
38
|
+
*/
|
|
39
|
+
contentGetMetadata(key, allowDeleted) {
|
|
40
|
+
return this.httpRequest.request({
|
|
41
|
+
method: 'GET',
|
|
42
|
+
url: '/content/{key}',
|
|
43
|
+
path: {
|
|
44
|
+
'key': key,
|
|
45
|
+
},
|
|
46
|
+
query: {
|
|
47
|
+
'allowDeleted': allowDeleted,
|
|
48
|
+
},
|
|
49
|
+
errors: {
|
|
50
|
+
403: `Forbidden`,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Update content
|
|
56
|
+
* Update an existing content item. If a content item with the provided key does not exist an error is returned.
|
|
57
|
+
* @param key The key of the content item to patch.
|
|
58
|
+
* @param requestBody The values of the content item that should be updated.
|
|
59
|
+
* @returns ContentMetadata Success
|
|
60
|
+
* @throws ApiError
|
|
61
|
+
*/
|
|
62
|
+
contentPatchMetadata(key, requestBody) {
|
|
63
|
+
return this.httpRequest.request({
|
|
64
|
+
method: 'PATCH',
|
|
65
|
+
url: '/content/{key}',
|
|
66
|
+
path: {
|
|
67
|
+
'key': key,
|
|
68
|
+
},
|
|
69
|
+
body: requestBody,
|
|
70
|
+
mediaType: 'application/merge-patch+json',
|
|
71
|
+
errors: {
|
|
72
|
+
400: `Bad Request`,
|
|
73
|
+
403: `Forbidden`,
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Delete content
|
|
79
|
+
* Deletes the content item with the provided key. If a content item with the provided key does not exist an error is returned.
|
|
80
|
+
* @param key The key of the content item to delete.
|
|
81
|
+
* @param permanent Indicates that the content item should be permanently deleted immediately or if it should be soft deleted first.
|
|
82
|
+
* @returns ContentMetadata Success
|
|
83
|
+
* @throws ApiError
|
|
84
|
+
*/
|
|
85
|
+
contentDelete(key, permanent) {
|
|
86
|
+
return this.httpRequest.request({
|
|
87
|
+
method: 'DELETE',
|
|
88
|
+
url: '/content/{key}',
|
|
89
|
+
path: {
|
|
90
|
+
'key': key,
|
|
91
|
+
},
|
|
92
|
+
query: {
|
|
93
|
+
'permanent': permanent,
|
|
94
|
+
},
|
|
95
|
+
errors: {
|
|
96
|
+
400: `Bad Request`,
|
|
97
|
+
403: `Forbidden`,
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Get content path
|
|
103
|
+
* Get the content path with the provided key.
|
|
104
|
+
* @param key The key of the content path to retrieve.
|
|
105
|
+
* @param pageIndex
|
|
106
|
+
* @param pageSize
|
|
107
|
+
* @returns ContentMetadataPage Success
|
|
108
|
+
* @throws ApiError
|
|
109
|
+
*/
|
|
110
|
+
contentGetPath(key, pageIndex, pageSize) {
|
|
111
|
+
return this.httpRequest.request({
|
|
112
|
+
method: 'GET',
|
|
113
|
+
url: '/content/{key}/path',
|
|
114
|
+
path: {
|
|
115
|
+
'key': key,
|
|
116
|
+
},
|
|
117
|
+
query: {
|
|
118
|
+
'pageIndex': pageIndex,
|
|
119
|
+
'pageSize': pageSize,
|
|
120
|
+
},
|
|
121
|
+
errors: {
|
|
122
|
+
403: `Forbidden`,
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* List content in container
|
|
128
|
+
* List the content items located in a specific container.
|
|
129
|
+
* @param key The key of the content to retrieve items for.
|
|
130
|
+
* @param contentTypes Indicates which content types or base types to include in the list.
|
|
131
|
+
* @param pageIndex
|
|
132
|
+
* @param pageSize
|
|
133
|
+
* @returns ContentMetadataPage Success
|
|
134
|
+
* @throws ApiError
|
|
135
|
+
*/
|
|
136
|
+
contentListItems(key, contentTypes, pageIndex, pageSize) {
|
|
137
|
+
return this.httpRequest.request({
|
|
138
|
+
method: 'GET',
|
|
139
|
+
url: '/content/{key}/items',
|
|
140
|
+
path: {
|
|
141
|
+
'key': key,
|
|
142
|
+
},
|
|
143
|
+
query: {
|
|
144
|
+
'contentTypes': contentTypes,
|
|
145
|
+
'pageIndex': pageIndex,
|
|
146
|
+
'pageSize': pageSize,
|
|
147
|
+
},
|
|
148
|
+
errors: {
|
|
149
|
+
403: `Forbidden`,
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* List assets
|
|
155
|
+
* List the assets that belongs to a content instance.
|
|
156
|
+
* @param key The key of the content to retrieve assets for.
|
|
157
|
+
* @param contentTypes Indicates which content types or base types to include in the list.
|
|
158
|
+
* @param pageIndex
|
|
159
|
+
* @param pageSize
|
|
160
|
+
* @returns ContentMetadataPage Success
|
|
161
|
+
* @throws ApiError
|
|
162
|
+
*/
|
|
163
|
+
contentListAssets(key, contentTypes, pageIndex, pageSize) {
|
|
164
|
+
return this.httpRequest.request({
|
|
165
|
+
method: 'GET',
|
|
166
|
+
url: '/content/{key}/assets',
|
|
167
|
+
path: {
|
|
168
|
+
'key': key,
|
|
169
|
+
},
|
|
170
|
+
query: {
|
|
171
|
+
'contentTypes': contentTypes,
|
|
172
|
+
'pageIndex': pageIndex,
|
|
173
|
+
'pageSize': pageSize,
|
|
174
|
+
},
|
|
175
|
+
errors: {
|
|
176
|
+
403: `Forbidden`,
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Copy content
|
|
182
|
+
* Create a copy of the content item with the provided key.
|
|
183
|
+
* @param key The key of the content item to copy.
|
|
184
|
+
* @param requestBody Optional instructions for how to copy content.
|
|
185
|
+
* @returns ContentMetadata Success
|
|
186
|
+
* @throws ApiError
|
|
187
|
+
*/
|
|
188
|
+
contentCopy(key, requestBody) {
|
|
189
|
+
return this.httpRequest.request({
|
|
190
|
+
method: 'POST',
|
|
191
|
+
url: '/content/{key}:copy',
|
|
192
|
+
path: {
|
|
193
|
+
'key': key,
|
|
194
|
+
},
|
|
195
|
+
body: requestBody,
|
|
196
|
+
mediaType: 'application/json',
|
|
197
|
+
errors: {
|
|
198
|
+
400: `Bad Request`,
|
|
199
|
+
403: `Forbidden`,
|
|
200
|
+
},
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Restore content
|
|
205
|
+
* Restore the deleted content item with the provided key. If a content item with the provided key is not deleted an error is returned.
|
|
206
|
+
* @param key The key of the content item to undelete.
|
|
207
|
+
* @returns ContentMetadata Success
|
|
208
|
+
* @throws ApiError
|
|
209
|
+
*/
|
|
210
|
+
contentUndelete(key) {
|
|
211
|
+
return this.httpRequest.request({
|
|
212
|
+
method: 'POST',
|
|
213
|
+
url: '/content/{key}:undelete',
|
|
214
|
+
path: {
|
|
215
|
+
'key': key,
|
|
216
|
+
},
|
|
217
|
+
errors: {
|
|
218
|
+
400: `Bad Request`,
|
|
219
|
+
403: `Forbidden`,
|
|
220
|
+
},
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Query versions
|
|
225
|
+
* List content versions based on the provided query options.
|
|
226
|
+
* @param locales Indicates which content locales that should be listed. Use 'NEUTRAL' to include locale-neutral content.
|
|
227
|
+
* Locale must be a valid IETF BCP-47 language tag.
|
|
228
|
+
* @param statuses Indicates which status content versions must have to be listed.
|
|
229
|
+
* @param pageIndex
|
|
230
|
+
* @param pageSize
|
|
231
|
+
* @returns ContentItemPage Success
|
|
232
|
+
* @throws ApiError
|
|
233
|
+
*/
|
|
234
|
+
contentListAllVersions(locales, statuses, pageIndex, pageSize) {
|
|
235
|
+
return this.httpRequest.request({
|
|
236
|
+
method: 'GET',
|
|
237
|
+
url: '/content/versions',
|
|
238
|
+
query: {
|
|
239
|
+
'locales': locales,
|
|
240
|
+
'statuses': statuses,
|
|
241
|
+
'pageIndex': pageIndex,
|
|
242
|
+
'pageSize': pageSize,
|
|
243
|
+
},
|
|
244
|
+
errors: {
|
|
245
|
+
403: `Forbidden`,
|
|
246
|
+
},
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* List versions
|
|
251
|
+
* List versions of the content item with the provided key and the provided options.
|
|
252
|
+
* @param key
|
|
253
|
+
* @param locales Indicates which content locales that should be listed. Use 'NEUTRAL' to include locale-neutral content.
|
|
254
|
+
* Locale must be a valid IETF BCP-47 language tag.
|
|
255
|
+
* @param statuses Indicates which status content versions must have to be listed.
|
|
256
|
+
* @param pageIndex
|
|
257
|
+
* @param pageSize
|
|
258
|
+
* @returns ContentItemPage Success
|
|
259
|
+
* @throws ApiError
|
|
260
|
+
*/
|
|
261
|
+
contentListVersions(key, locales, statuses, pageIndex, pageSize) {
|
|
262
|
+
return this.httpRequest.request({
|
|
263
|
+
method: 'GET',
|
|
264
|
+
url: '/content/{key}/versions',
|
|
265
|
+
path: {
|
|
266
|
+
'key': key,
|
|
267
|
+
},
|
|
268
|
+
query: {
|
|
269
|
+
'locales': locales,
|
|
270
|
+
'statuses': statuses,
|
|
271
|
+
'pageIndex': pageIndex,
|
|
272
|
+
'pageSize': pageSize,
|
|
273
|
+
},
|
|
274
|
+
errors: {
|
|
275
|
+
403: `Forbidden`,
|
|
276
|
+
},
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Create version
|
|
281
|
+
* Create a new version of a content item.
|
|
282
|
+
* @param key The key of the content item for which a new content version should be created.
|
|
283
|
+
* @param requestBody The content version that should be created.
|
|
284
|
+
* @param skipValidation Indicates that the content validation should be ignored.
|
|
285
|
+
* @returns ContentItem Created
|
|
286
|
+
* @throws ApiError
|
|
287
|
+
*/
|
|
288
|
+
contentCreateVersion(key, requestBody, skipValidation) {
|
|
289
|
+
return this.httpRequest.request({
|
|
290
|
+
method: 'POST',
|
|
291
|
+
url: '/content/{key}/versions',
|
|
292
|
+
path: {
|
|
293
|
+
'key': key,
|
|
294
|
+
},
|
|
295
|
+
query: {
|
|
296
|
+
'skipValidation': skipValidation,
|
|
297
|
+
},
|
|
298
|
+
body: requestBody,
|
|
299
|
+
mediaType: 'application/json',
|
|
300
|
+
errors: {
|
|
301
|
+
400: `Bad Request`,
|
|
302
|
+
403: `Forbidden`,
|
|
303
|
+
},
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Delete locale
|
|
308
|
+
* Deletes the content item with the provided key. If a content item with the provided key does not exist an error is returned.
|
|
309
|
+
* @param key
|
|
310
|
+
* @param locale
|
|
311
|
+
* @returns ContentItem Success
|
|
312
|
+
* @throws ApiError
|
|
313
|
+
*/
|
|
314
|
+
contentDeleteLocale(key, locale) {
|
|
315
|
+
return this.httpRequest.request({
|
|
316
|
+
method: 'DELETE',
|
|
317
|
+
url: '/content/{key}/versions',
|
|
318
|
+
path: {
|
|
319
|
+
'key': key,
|
|
320
|
+
},
|
|
321
|
+
query: {
|
|
322
|
+
'locale': locale,
|
|
323
|
+
},
|
|
324
|
+
errors: {
|
|
325
|
+
400: `Bad Request`,
|
|
326
|
+
403: `Forbidden`,
|
|
327
|
+
},
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Get version
|
|
332
|
+
* Get the content item with the provided key and version.
|
|
333
|
+
* @param key
|
|
334
|
+
* @param version
|
|
335
|
+
* @param locale
|
|
336
|
+
* @returns ContentItem Success
|
|
337
|
+
* @throws ApiError
|
|
338
|
+
*/
|
|
339
|
+
contentGetVersion(key, version, locale) {
|
|
340
|
+
return this.httpRequest.request({
|
|
341
|
+
method: 'GET',
|
|
342
|
+
url: '/content/{key}/versions/{version}',
|
|
343
|
+
path: {
|
|
344
|
+
'key': key,
|
|
345
|
+
'version': version,
|
|
346
|
+
},
|
|
347
|
+
query: {
|
|
348
|
+
'locale': locale,
|
|
349
|
+
},
|
|
350
|
+
errors: {
|
|
351
|
+
403: `Forbidden`,
|
|
352
|
+
},
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Update version
|
|
357
|
+
* Update an existing content item. If a content item with the provided key does not exist an error is returned.
|
|
358
|
+
* @param key The key of the content item that should be updated.
|
|
359
|
+
* @param version The version of the content that should be updated.
|
|
360
|
+
* @param requestBody The content information that should be updated.
|
|
361
|
+
* @param locale The locale of the content that should be updated.
|
|
362
|
+
* @param skipValidation Indicates that the content validation should be ignored.
|
|
363
|
+
* @returns ContentItem Success
|
|
364
|
+
* @throws ApiError
|
|
365
|
+
*/
|
|
366
|
+
contentPatchVersion(key, version, requestBody, locale, skipValidation) {
|
|
367
|
+
return this.httpRequest.request({
|
|
368
|
+
method: 'PATCH',
|
|
369
|
+
url: '/content/{key}/versions/{version}',
|
|
370
|
+
path: {
|
|
371
|
+
'key': key,
|
|
372
|
+
'version': version,
|
|
373
|
+
},
|
|
374
|
+
query: {
|
|
375
|
+
'locale': locale,
|
|
376
|
+
'skipValidation': skipValidation,
|
|
377
|
+
},
|
|
378
|
+
body: requestBody,
|
|
379
|
+
mediaType: 'application/merge-patch+json',
|
|
380
|
+
errors: {
|
|
381
|
+
400: `Bad Request`,
|
|
382
|
+
403: `Forbidden`,
|
|
383
|
+
},
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Delete version
|
|
388
|
+
* Deletes the content item with the provided key. If a content item with the provided key does not exist an error is returned.
|
|
389
|
+
* @param key
|
|
390
|
+
* @param version
|
|
391
|
+
* @returns ContentItem Success
|
|
392
|
+
* @throws ApiError
|
|
393
|
+
*/
|
|
394
|
+
contentDeleteVersion(key, version) {
|
|
395
|
+
return this.httpRequest.request({
|
|
396
|
+
method: 'DELETE',
|
|
397
|
+
url: '/content/{key}/versions/{version}',
|
|
398
|
+
path: {
|
|
399
|
+
'key': key,
|
|
400
|
+
'version': version,
|
|
401
|
+
},
|
|
402
|
+
errors: {
|
|
403
|
+
400: `Bad Request`,
|
|
404
|
+
403: `Forbidden`,
|
|
405
|
+
},
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
exports.ContentService = ContentService;
|