@remkoj/optimizely-cms-api 2.0.0-pre2
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/LICENSE +13 -0
- package/README.md +44 -0
- package/dist/client/CmsIntegrationApiClient.d.ts +22 -0
- package/dist/client/CmsIntegrationApiClient.js +34 -0
- package/dist/client/core/ApiError.d.ts +10 -0
- package/dist/client/core/ApiError.js +15 -0
- package/dist/client/core/ApiRequestOptions.d.ts +13 -0
- package/dist/client/core/ApiRequestOptions.js +2 -0
- package/dist/client/core/ApiResult.d.ts +7 -0
- package/dist/client/core/ApiResult.js +2 -0
- package/dist/client/core/BaseHttpRequest.d.ts +8 -0
- package/dist/client/core/BaseHttpRequest.js +9 -0
- package/dist/client/core/CancelablePromise.d.ts +20 -0
- package/dist/client/core/CancelablePromise.js +116 -0
- package/dist/client/core/FetchHttpRequest.d.ts +14 -0
- package/dist/client/core/FetchHttpRequest.js +20 -0
- package/dist/client/core/OpenAPI.d.ts +16 -0
- package/dist/client/core/OpenAPI.js +14 -0
- package/dist/client/core/request.d.ts +30 -0
- package/dist/client/core/request.js +294 -0
- package/dist/client/index.d.ts +76 -0
- package/dist/client/index.js +46 -0
- package/dist/client/models/BinaryProperty.d.ts +8 -0
- package/dist/client/models/BinaryProperty.js +2 -0
- package/dist/client/models/BooleanProperty.d.ts +5 -0
- package/dist/client/models/BooleanProperty.js +2 -0
- package/dist/client/models/Changeset.d.ts +26 -0
- package/dist/client/models/Changeset.js +2 -0
- package/dist/client/models/ChangesetItem.d.ts +11 -0
- package/dist/client/models/ChangesetItem.js +2 -0
- package/dist/client/models/ChangesetItemPage.d.ts +19 -0
- package/dist/client/models/ChangesetItemPage.js +2 -0
- package/dist/client/models/ChangesetPage.d.ts +19 -0
- package/dist/client/models/ChangesetPage.js +2 -0
- package/dist/client/models/ComponentListItem.d.ts +10 -0
- package/dist/client/models/ComponentListItem.js +2 -0
- package/dist/client/models/ComponentProperty.d.ts +10 -0
- package/dist/client/models/ComponentProperty.js +2 -0
- package/dist/client/models/ContentBaseType.d.ts +11 -0
- package/dist/client/models/ContentBaseType.js +19 -0
- package/dist/client/models/ContentComponent.d.ts +34 -0
- package/dist/client/models/ContentComponent.js +2 -0
- package/dist/client/models/ContentItem.d.ts +60 -0
- package/dist/client/models/ContentItem.js +2 -0
- package/dist/client/models/ContentItemListWithContentTypes.d.ts +27 -0
- package/dist/client/models/ContentItemListWithContentTypes.js +2 -0
- package/dist/client/models/ContentItemPage.d.ts +19 -0
- package/dist/client/models/ContentItemPage.js +2 -0
- package/dist/client/models/ContentItemWithContentTypes.d.ts +12 -0
- package/dist/client/models/ContentItemWithContentTypes.js +2 -0
- package/dist/client/models/ContentListItem.d.ts +14 -0
- package/dist/client/models/ContentListItem.js +2 -0
- package/dist/client/models/ContentLocaleInfo.d.ts +11 -0
- package/dist/client/models/ContentLocaleInfo.js +2 -0
- package/dist/client/models/ContentMetadata.d.ts +46 -0
- package/dist/client/models/ContentMetadata.js +2 -0
- package/dist/client/models/ContentMetadataPage.d.ts +19 -0
- package/dist/client/models/ContentMetadataPage.js +2 -0
- package/dist/client/models/ContentProperty.d.ts +14 -0
- package/dist/client/models/ContentProperty.js +2 -0
- package/dist/client/models/ContentReference.d.ts +17 -0
- package/dist/client/models/ContentReference.js +2 -0
- package/dist/client/models/ContentReferenceListItem.d.ts +14 -0
- package/dist/client/models/ContentReferenceListItem.js +2 -0
- package/dist/client/models/ContentReferenceProperty.d.ts +14 -0
- package/dist/client/models/ContentReferenceProperty.js +2 -0
- package/dist/client/models/ContentType.d.ts +79 -0
- package/dist/client/models/ContentType.js +2 -0
- package/dist/client/models/ContentTypeFeature.d.ts +10 -0
- package/dist/client/models/ContentTypeFeature.js +18 -0
- package/dist/client/models/ContentTypePage.d.ts +19 -0
- package/dist/client/models/ContentTypePage.js +2 -0
- package/dist/client/models/ContentTypeProperty.d.ts +47 -0
- package/dist/client/models/ContentTypeProperty.js +2 -0
- package/dist/client/models/ContentTypeUsage.d.ts +7 -0
- package/dist/client/models/ContentTypeUsage.js +15 -0
- package/dist/client/models/CopyContentOptions.d.ts +21 -0
- package/dist/client/models/CopyContentOptions.js +2 -0
- package/dist/client/models/DateTimeListItem.d.ts +14 -0
- package/dist/client/models/DateTimeListItem.js +2 -0
- package/dist/client/models/DateTimeProperty.d.ts +14 -0
- package/dist/client/models/DateTimeProperty.js +2 -0
- package/dist/client/models/DoubleEnumerationSettings.d.ts +9 -0
- package/dist/client/models/DoubleEnumerationSettings.js +2 -0
- package/dist/client/models/FloatListItem.d.ts +16 -0
- package/dist/client/models/FloatListItem.js +2 -0
- package/dist/client/models/FloatProperty.d.ts +16 -0
- package/dist/client/models/FloatProperty.js +2 -0
- package/dist/client/models/ImageDescriptor.d.ts +17 -0
- package/dist/client/models/ImageDescriptor.js +2 -0
- package/dist/client/models/ImportPackageMessage.d.ts +17 -0
- package/dist/client/models/ImportPackageMessage.js +2 -0
- package/dist/client/models/ImportPackageResult.d.ts +22 -0
- package/dist/client/models/ImportPackageResult.js +2 -0
- package/dist/client/models/IndexingType.d.ts +8 -0
- package/dist/client/models/IndexingType.js +16 -0
- package/dist/client/models/Int32EnumerationSettings.d.ts +9 -0
- package/dist/client/models/Int32EnumerationSettings.js +2 -0
- package/dist/client/models/IntegerListItem.d.ts +16 -0
- package/dist/client/models/IntegerListItem.js +2 -0
- package/dist/client/models/IntegerProperty.d.ts +16 -0
- package/dist/client/models/IntegerProperty.js +2 -0
- package/dist/client/models/JsonStringProperty.d.ts +5 -0
- package/dist/client/models/JsonStringProperty.js +2 -0
- package/dist/client/models/ListProperty.d.ts +26 -0
- package/dist/client/models/ListProperty.js +2 -0
- package/dist/client/models/ListPropertyItem.d.ts +11 -0
- package/dist/client/models/ListPropertyItem.js +2 -0
- package/dist/client/models/LocaleStatus.d.ts +7 -0
- package/dist/client/models/LocaleStatus.js +15 -0
- package/dist/client/models/Manifest.d.ts +19 -0
- package/dist/client/models/Manifest.js +2 -0
- package/dist/client/models/OauthToken.d.ts +18 -0
- package/dist/client/models/OauthToken.js +2 -0
- package/dist/client/models/OauthTokenError.d.ts +13 -0
- package/dist/client/models/OauthTokenError.js +2 -0
- package/dist/client/models/OauthTokenRequest.d.ts +21 -0
- package/dist/client/models/OauthTokenRequest.js +2 -0
- package/dist/client/models/PackageJob.d.ts +28 -0
- package/dist/client/models/PackageJob.js +2 -0
- package/dist/client/models/PackageJobMessage.d.ts +17 -0
- package/dist/client/models/PackageJobMessage.js +2 -0
- package/dist/client/models/PackageJobStatus.d.ts +4 -0
- package/dist/client/models/PackageJobStatus.js +2 -0
- package/dist/client/models/ProblemDetails.d.ts +1 -0
- package/dist/client/models/ProblemDetails.js +2 -0
- package/dist/client/models/PropertyDataType.d.ts +18 -0
- package/dist/client/models/PropertyDataType.js +26 -0
- package/dist/client/models/PropertyFormat.d.ts +34 -0
- package/dist/client/models/PropertyFormat.js +2 -0
- package/dist/client/models/PropertyFormatPage.d.ts +19 -0
- package/dist/client/models/PropertyFormatPage.js +2 -0
- package/dist/client/models/PropertyGroup.d.ts +21 -0
- package/dist/client/models/PropertyGroup.js +2 -0
- package/dist/client/models/PropertyGroupPage.d.ts +19 -0
- package/dist/client/models/PropertyGroupPage.js +2 -0
- package/dist/client/models/StringEnumerationSettings.d.ts +9 -0
- package/dist/client/models/StringEnumerationSettings.js +2 -0
- package/dist/client/models/StringListItem.d.ts +14 -0
- package/dist/client/models/StringListItem.js +2 -0
- package/dist/client/models/StringProperty.d.ts +14 -0
- package/dist/client/models/StringProperty.js +2 -0
- package/dist/client/models/UrlListItem.d.ts +5 -0
- package/dist/client/models/UrlListItem.js +2 -0
- package/dist/client/models/UrlProperty.d.ts +5 -0
- package/dist/client/models/UrlProperty.js +2 -0
- package/dist/client/models/VersionStatus.d.ts +12 -0
- package/dist/client/models/VersionStatus.js +20 -0
- package/dist/client/services/ChangesetsService.d.ts +105 -0
- package/dist/client/services/ChangesetsService.js +239 -0
- package/dist/client/services/ContentService.d.ts +172 -0
- package/dist/client/services/ContentService.js +409 -0
- package/dist/client/services/ContentTypesService.d.ts +66 -0
- package/dist/client/services/ContentTypesService.js +149 -0
- package/dist/client/services/OauthService.d.ts +17 -0
- package/dist/client/services/OauthService.js +28 -0
- package/dist/client/services/PackagesService.d.ts +41 -0
- package/dist/client/services/PackagesService.js +80 -0
- package/dist/client/services/PropertyFormatsService.d.ts +26 -0
- package/dist/client/services/PropertyFormatsService.js +53 -0
- package/dist/client/services/PropertyGroupsService.d.ts +61 -0
- package/dist/client/services/PropertyGroupsService.js +135 -0
- package/dist/config.d.ts +8 -0
- package/dist/config.js +36 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +95 -0
- package/package.json +27 -0
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.request = exports.catchErrorCodes = exports.getResponseBody = exports.getResponseHeader = exports.sendRequest = exports.getRequestBody = exports.getHeaders = exports.resolve = exports.getFormData = exports.getQueryString = exports.base64 = exports.isFormData = exports.isBlob = exports.isStringWithValue = exports.isString = exports.isDefined = void 0;
|
|
4
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
5
|
+
/* istanbul ignore file */
|
|
6
|
+
/* tslint:disable */
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
const ApiError_1 = require("./ApiError");
|
|
9
|
+
const CancelablePromise_1 = require("./CancelablePromise");
|
|
10
|
+
const isDefined = (value) => {
|
|
11
|
+
return value !== undefined && value !== null;
|
|
12
|
+
};
|
|
13
|
+
exports.isDefined = isDefined;
|
|
14
|
+
const isString = (value) => {
|
|
15
|
+
return typeof value === 'string';
|
|
16
|
+
};
|
|
17
|
+
exports.isString = isString;
|
|
18
|
+
const isStringWithValue = (value) => {
|
|
19
|
+
return (0, exports.isString)(value) && value !== '';
|
|
20
|
+
};
|
|
21
|
+
exports.isStringWithValue = isStringWithValue;
|
|
22
|
+
const isBlob = (value) => {
|
|
23
|
+
return (typeof value === 'object' &&
|
|
24
|
+
typeof value.type === 'string' &&
|
|
25
|
+
typeof value.stream === 'function' &&
|
|
26
|
+
typeof value.arrayBuffer === 'function' &&
|
|
27
|
+
typeof value.constructor === 'function' &&
|
|
28
|
+
typeof value.constructor.name === 'string' &&
|
|
29
|
+
/^(Blob|File)$/.test(value.constructor.name) &&
|
|
30
|
+
/^(Blob|File)$/.test(value[Symbol.toStringTag]));
|
|
31
|
+
};
|
|
32
|
+
exports.isBlob = isBlob;
|
|
33
|
+
const isFormData = (value) => {
|
|
34
|
+
return value instanceof FormData;
|
|
35
|
+
};
|
|
36
|
+
exports.isFormData = isFormData;
|
|
37
|
+
const base64 = (str) => {
|
|
38
|
+
try {
|
|
39
|
+
return btoa(str);
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
// @ts-ignore
|
|
43
|
+
return Buffer.from(str).toString('base64');
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.base64 = base64;
|
|
47
|
+
const getQueryString = (params) => {
|
|
48
|
+
const qs = [];
|
|
49
|
+
const append = (key, value) => {
|
|
50
|
+
qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
|
|
51
|
+
};
|
|
52
|
+
const process = (key, value) => {
|
|
53
|
+
if ((0, exports.isDefined)(value)) {
|
|
54
|
+
if (Array.isArray(value)) {
|
|
55
|
+
value.forEach(v => {
|
|
56
|
+
process(key, v);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
else if (typeof value === 'object') {
|
|
60
|
+
Object.entries(value).forEach(([k, v]) => {
|
|
61
|
+
process(`${key}[${k}]`, v);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
append(key, value);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
70
|
+
process(key, value);
|
|
71
|
+
});
|
|
72
|
+
if (qs.length > 0) {
|
|
73
|
+
return `?${qs.join('&')}`;
|
|
74
|
+
}
|
|
75
|
+
return '';
|
|
76
|
+
};
|
|
77
|
+
exports.getQueryString = getQueryString;
|
|
78
|
+
const getUrl = (config, options) => {
|
|
79
|
+
const encoder = config.ENCODE_PATH || encodeURI;
|
|
80
|
+
const path = options.url
|
|
81
|
+
.replace('{api-version}', config.VERSION)
|
|
82
|
+
.replace(/{(.*?)}/g, (substring, group) => {
|
|
83
|
+
if (options.path?.hasOwnProperty(group)) {
|
|
84
|
+
return encoder(String(options.path[group]));
|
|
85
|
+
}
|
|
86
|
+
return substring;
|
|
87
|
+
});
|
|
88
|
+
const url = `${config.BASE}${path}`;
|
|
89
|
+
if (options.query) {
|
|
90
|
+
return `${url}${(0, exports.getQueryString)(options.query)}`;
|
|
91
|
+
}
|
|
92
|
+
return url;
|
|
93
|
+
};
|
|
94
|
+
const getFormData = (options) => {
|
|
95
|
+
if (options.formData) {
|
|
96
|
+
const formData = new FormData();
|
|
97
|
+
const process = (key, value) => {
|
|
98
|
+
if ((0, exports.isString)(value) || (0, exports.isBlob)(value)) {
|
|
99
|
+
formData.append(key, value);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
formData.append(key, JSON.stringify(value));
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
Object.entries(options.formData)
|
|
106
|
+
.filter(([_, value]) => (0, exports.isDefined)(value))
|
|
107
|
+
.forEach(([key, value]) => {
|
|
108
|
+
if (Array.isArray(value)) {
|
|
109
|
+
value.forEach(v => process(key, v));
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
process(key, value);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
return formData;
|
|
116
|
+
}
|
|
117
|
+
return undefined;
|
|
118
|
+
};
|
|
119
|
+
exports.getFormData = getFormData;
|
|
120
|
+
const resolve = async (options, resolver) => {
|
|
121
|
+
if (typeof resolver === 'function') {
|
|
122
|
+
return resolver(options);
|
|
123
|
+
}
|
|
124
|
+
return resolver;
|
|
125
|
+
};
|
|
126
|
+
exports.resolve = resolve;
|
|
127
|
+
const getHeaders = async (config, options) => {
|
|
128
|
+
const [token, username, password, additionalHeaders] = await Promise.all([
|
|
129
|
+
(0, exports.resolve)(options, config.TOKEN),
|
|
130
|
+
(0, exports.resolve)(options, config.USERNAME),
|
|
131
|
+
(0, exports.resolve)(options, config.PASSWORD),
|
|
132
|
+
(0, exports.resolve)(options, config.HEADERS),
|
|
133
|
+
]);
|
|
134
|
+
const headers = Object.entries({
|
|
135
|
+
Accept: 'application/json',
|
|
136
|
+
...additionalHeaders,
|
|
137
|
+
...options.headers,
|
|
138
|
+
})
|
|
139
|
+
.filter(([_, value]) => (0, exports.isDefined)(value))
|
|
140
|
+
.reduce((headers, [key, value]) => ({
|
|
141
|
+
...headers,
|
|
142
|
+
[key]: String(value),
|
|
143
|
+
}), {});
|
|
144
|
+
if ((0, exports.isStringWithValue)(token)) {
|
|
145
|
+
headers['Authorization'] = `Bearer ${token}`;
|
|
146
|
+
}
|
|
147
|
+
if ((0, exports.isStringWithValue)(username) && (0, exports.isStringWithValue)(password)) {
|
|
148
|
+
const credentials = (0, exports.base64)(`${username}:${password}`);
|
|
149
|
+
headers['Authorization'] = `Basic ${credentials}`;
|
|
150
|
+
}
|
|
151
|
+
if (options.body !== undefined) {
|
|
152
|
+
if (options.mediaType) {
|
|
153
|
+
headers['Content-Type'] = options.mediaType;
|
|
154
|
+
}
|
|
155
|
+
else if ((0, exports.isBlob)(options.body)) {
|
|
156
|
+
headers['Content-Type'] = options.body.type || 'application/octet-stream';
|
|
157
|
+
}
|
|
158
|
+
else if ((0, exports.isString)(options.body)) {
|
|
159
|
+
headers['Content-Type'] = 'text/plain';
|
|
160
|
+
}
|
|
161
|
+
else if (!(0, exports.isFormData)(options.body)) {
|
|
162
|
+
headers['Content-Type'] = 'application/json';
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return new Headers(headers);
|
|
166
|
+
};
|
|
167
|
+
exports.getHeaders = getHeaders;
|
|
168
|
+
const getRequestBody = (options) => {
|
|
169
|
+
if (options.body !== undefined) {
|
|
170
|
+
if (options.mediaType?.includes('/json')) {
|
|
171
|
+
return JSON.stringify(options.body);
|
|
172
|
+
}
|
|
173
|
+
else if ((0, exports.isString)(options.body) || (0, exports.isBlob)(options.body) || (0, exports.isFormData)(options.body)) {
|
|
174
|
+
return options.body;
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
return JSON.stringify(options.body);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return undefined;
|
|
181
|
+
};
|
|
182
|
+
exports.getRequestBody = getRequestBody;
|
|
183
|
+
const sendRequest = async (config, options, url, body, formData, headers, onCancel) => {
|
|
184
|
+
const controller = new AbortController();
|
|
185
|
+
const request = {
|
|
186
|
+
headers,
|
|
187
|
+
body: body ?? formData,
|
|
188
|
+
method: options.method,
|
|
189
|
+
signal: controller.signal,
|
|
190
|
+
};
|
|
191
|
+
if (config.WITH_CREDENTIALS) {
|
|
192
|
+
request.credentials = config.CREDENTIALS;
|
|
193
|
+
}
|
|
194
|
+
onCancel(() => controller.abort());
|
|
195
|
+
return await fetch(url, request);
|
|
196
|
+
};
|
|
197
|
+
exports.sendRequest = sendRequest;
|
|
198
|
+
const getResponseHeader = (response, responseHeader) => {
|
|
199
|
+
if (responseHeader) {
|
|
200
|
+
const content = response.headers.get(responseHeader);
|
|
201
|
+
if ((0, exports.isString)(content)) {
|
|
202
|
+
return content;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return undefined;
|
|
206
|
+
};
|
|
207
|
+
exports.getResponseHeader = getResponseHeader;
|
|
208
|
+
const getResponseBody = async (response) => {
|
|
209
|
+
if (response.status !== 204) {
|
|
210
|
+
try {
|
|
211
|
+
const contentType = response.headers.get('Content-Type');
|
|
212
|
+
if (contentType) {
|
|
213
|
+
const jsonTypes = ['application/json', 'application/problem+json'];
|
|
214
|
+
const isJSON = jsonTypes.some(type => contentType.toLowerCase().startsWith(type));
|
|
215
|
+
if (isJSON) {
|
|
216
|
+
return await response.json();
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
return await response.text();
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
catch (error) {
|
|
224
|
+
console.error(error);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return undefined;
|
|
228
|
+
};
|
|
229
|
+
exports.getResponseBody = getResponseBody;
|
|
230
|
+
const catchErrorCodes = (options, result) => {
|
|
231
|
+
const errors = {
|
|
232
|
+
400: 'Bad Request',
|
|
233
|
+
401: 'Unauthorized',
|
|
234
|
+
403: 'Forbidden',
|
|
235
|
+
404: 'Not Found',
|
|
236
|
+
500: 'Internal Server Error',
|
|
237
|
+
502: 'Bad Gateway',
|
|
238
|
+
503: 'Service Unavailable',
|
|
239
|
+
...options.errors,
|
|
240
|
+
};
|
|
241
|
+
const error = errors[result.status];
|
|
242
|
+
if (error) {
|
|
243
|
+
throw new ApiError_1.ApiError(options, result, error);
|
|
244
|
+
}
|
|
245
|
+
if (!result.ok) {
|
|
246
|
+
const errorStatus = result.status ?? 'unknown';
|
|
247
|
+
const errorStatusText = result.statusText ?? 'unknown';
|
|
248
|
+
const errorBody = (() => {
|
|
249
|
+
try {
|
|
250
|
+
return JSON.stringify(result.body, null, 2);
|
|
251
|
+
}
|
|
252
|
+
catch (e) {
|
|
253
|
+
return undefined;
|
|
254
|
+
}
|
|
255
|
+
})();
|
|
256
|
+
throw new ApiError_1.ApiError(options, result, `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`);
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
exports.catchErrorCodes = catchErrorCodes;
|
|
260
|
+
/**
|
|
261
|
+
* Request method
|
|
262
|
+
* @param config The OpenAPI configuration object
|
|
263
|
+
* @param options The request options from the service
|
|
264
|
+
* @returns CancelablePromise<T>
|
|
265
|
+
* @throws ApiError
|
|
266
|
+
*/
|
|
267
|
+
const request = (config, options) => {
|
|
268
|
+
return new CancelablePromise_1.CancelablePromise(async (resolve, reject, onCancel) => {
|
|
269
|
+
try {
|
|
270
|
+
const url = getUrl(config, options);
|
|
271
|
+
const formData = (0, exports.getFormData)(options);
|
|
272
|
+
const body = (0, exports.getRequestBody)(options);
|
|
273
|
+
const headers = await (0, exports.getHeaders)(config, options);
|
|
274
|
+
if (!onCancel.isCancelled) {
|
|
275
|
+
const response = await (0, exports.sendRequest)(config, options, url, body, formData, headers, onCancel);
|
|
276
|
+
const responseBody = await (0, exports.getResponseBody)(response);
|
|
277
|
+
const responseHeader = (0, exports.getResponseHeader)(response, options.responseHeader);
|
|
278
|
+
const result = {
|
|
279
|
+
url,
|
|
280
|
+
ok: response.ok,
|
|
281
|
+
status: response.status,
|
|
282
|
+
statusText: response.statusText,
|
|
283
|
+
body: responseHeader ?? responseBody,
|
|
284
|
+
};
|
|
285
|
+
(0, exports.catchErrorCodes)(options, result);
|
|
286
|
+
resolve(result.body);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
catch (error) {
|
|
290
|
+
reject(error);
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
};
|
|
294
|
+
exports.request = request;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export { CmsIntegrationApiClient } from './CmsIntegrationApiClient';
|
|
2
|
+
export { ApiError } from './core/ApiError';
|
|
3
|
+
export { BaseHttpRequest } from './core/BaseHttpRequest';
|
|
4
|
+
export { CancelablePromise, CancelError } from './core/CancelablePromise';
|
|
5
|
+
export { OpenAPI } from './core/OpenAPI';
|
|
6
|
+
export type { OpenAPIConfig } from './core/OpenAPI';
|
|
7
|
+
export type { BinaryProperty } from './models/BinaryProperty';
|
|
8
|
+
export type { BooleanProperty } from './models/BooleanProperty';
|
|
9
|
+
export type { Changeset } from './models/Changeset';
|
|
10
|
+
export type { ChangesetItem } from './models/ChangesetItem';
|
|
11
|
+
export type { ChangesetItemPage } from './models/ChangesetItemPage';
|
|
12
|
+
export type { ChangesetPage } from './models/ChangesetPage';
|
|
13
|
+
export type { ComponentListItem } from './models/ComponentListItem';
|
|
14
|
+
export type { ComponentProperty } from './models/ComponentProperty';
|
|
15
|
+
export { ContentBaseType } from './models/ContentBaseType';
|
|
16
|
+
export type { ContentComponent } from './models/ContentComponent';
|
|
17
|
+
export type { ContentItem } from './models/ContentItem';
|
|
18
|
+
export type { ContentItemListWithContentTypes } from './models/ContentItemListWithContentTypes';
|
|
19
|
+
export type { ContentItemPage } from './models/ContentItemPage';
|
|
20
|
+
export type { ContentItemWithContentTypes } from './models/ContentItemWithContentTypes';
|
|
21
|
+
export type { ContentListItem } from './models/ContentListItem';
|
|
22
|
+
export type { ContentLocaleInfo } from './models/ContentLocaleInfo';
|
|
23
|
+
export type { ContentMetadata } from './models/ContentMetadata';
|
|
24
|
+
export type { ContentMetadataPage } from './models/ContentMetadataPage';
|
|
25
|
+
export type { ContentProperty } from './models/ContentProperty';
|
|
26
|
+
export type { ContentReference } from './models/ContentReference';
|
|
27
|
+
export type { ContentReferenceListItem } from './models/ContentReferenceListItem';
|
|
28
|
+
export type { ContentReferenceProperty } from './models/ContentReferenceProperty';
|
|
29
|
+
export type { ContentType } from './models/ContentType';
|
|
30
|
+
export { ContentTypeFeature } from './models/ContentTypeFeature';
|
|
31
|
+
export type { ContentTypePage } from './models/ContentTypePage';
|
|
32
|
+
export type { ContentTypeProperty } from './models/ContentTypeProperty';
|
|
33
|
+
export { ContentTypeUsage } from './models/ContentTypeUsage';
|
|
34
|
+
export type { CopyContentOptions } from './models/CopyContentOptions';
|
|
35
|
+
export type { DateTimeListItem } from './models/DateTimeListItem';
|
|
36
|
+
export type { DateTimeProperty } from './models/DateTimeProperty';
|
|
37
|
+
export type { DoubleEnumerationSettings } from './models/DoubleEnumerationSettings';
|
|
38
|
+
export type { FloatListItem } from './models/FloatListItem';
|
|
39
|
+
export type { FloatProperty } from './models/FloatProperty';
|
|
40
|
+
export type { ImageDescriptor } from './models/ImageDescriptor';
|
|
41
|
+
export type { ImportPackageMessage } from './models/ImportPackageMessage';
|
|
42
|
+
export type { ImportPackageResult } from './models/ImportPackageResult';
|
|
43
|
+
export { IndexingType } from './models/IndexingType';
|
|
44
|
+
export type { Int32EnumerationSettings } from './models/Int32EnumerationSettings';
|
|
45
|
+
export type { IntegerListItem } from './models/IntegerListItem';
|
|
46
|
+
export type { IntegerProperty } from './models/IntegerProperty';
|
|
47
|
+
export type { JsonStringProperty } from './models/JsonStringProperty';
|
|
48
|
+
export type { ListProperty } from './models/ListProperty';
|
|
49
|
+
export type { ListPropertyItem } from './models/ListPropertyItem';
|
|
50
|
+
export { LocaleStatus } from './models/LocaleStatus';
|
|
51
|
+
export type { Manifest } from './models/Manifest';
|
|
52
|
+
export type { OauthToken } from './models/OauthToken';
|
|
53
|
+
export type { OauthTokenError } from './models/OauthTokenError';
|
|
54
|
+
export type { OauthTokenRequest } from './models/OauthTokenRequest';
|
|
55
|
+
export type { PackageJob } from './models/PackageJob';
|
|
56
|
+
export type { PackageJobMessage } from './models/PackageJobMessage';
|
|
57
|
+
export type { PackageJobStatus } from './models/PackageJobStatus';
|
|
58
|
+
export type { ProblemDetails } from './models/ProblemDetails';
|
|
59
|
+
export { PropertyDataType } from './models/PropertyDataType';
|
|
60
|
+
export type { PropertyFormat } from './models/PropertyFormat';
|
|
61
|
+
export type { PropertyFormatPage } from './models/PropertyFormatPage';
|
|
62
|
+
export type { PropertyGroup } from './models/PropertyGroup';
|
|
63
|
+
export type { PropertyGroupPage } from './models/PropertyGroupPage';
|
|
64
|
+
export type { StringEnumerationSettings } from './models/StringEnumerationSettings';
|
|
65
|
+
export type { StringListItem } from './models/StringListItem';
|
|
66
|
+
export type { StringProperty } from './models/StringProperty';
|
|
67
|
+
export type { UrlListItem } from './models/UrlListItem';
|
|
68
|
+
export type { UrlProperty } from './models/UrlProperty';
|
|
69
|
+
export { VersionStatus } from './models/VersionStatus';
|
|
70
|
+
export { ChangesetsService } from './services/ChangesetsService';
|
|
71
|
+
export { ContentService } from './services/ContentService';
|
|
72
|
+
export { ContentTypesService } from './services/ContentTypesService';
|
|
73
|
+
export { OauthService } from './services/OauthService';
|
|
74
|
+
export { PackagesService } from './services/PackagesService';
|
|
75
|
+
export { PropertyFormatsService } from './services/PropertyFormatsService';
|
|
76
|
+
export { PropertyGroupsService } from './services/PropertyGroupsService';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PropertyGroupsService = exports.PropertyFormatsService = exports.PackagesService = exports.OauthService = exports.ContentTypesService = exports.ContentService = exports.ChangesetsService = exports.VersionStatus = exports.PropertyDataType = exports.LocaleStatus = exports.IndexingType = exports.ContentTypeUsage = exports.ContentTypeFeature = exports.ContentBaseType = exports.OpenAPI = exports.CancelError = exports.CancelablePromise = exports.BaseHttpRequest = exports.ApiError = exports.CmsIntegrationApiClient = void 0;
|
|
4
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
5
|
+
/* istanbul ignore file */
|
|
6
|
+
/* tslint:disable */
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
var CmsIntegrationApiClient_1 = require("./CmsIntegrationApiClient");
|
|
9
|
+
Object.defineProperty(exports, "CmsIntegrationApiClient", { enumerable: true, get: function () { return CmsIntegrationApiClient_1.CmsIntegrationApiClient; } });
|
|
10
|
+
var ApiError_1 = require("./core/ApiError");
|
|
11
|
+
Object.defineProperty(exports, "ApiError", { enumerable: true, get: function () { return ApiError_1.ApiError; } });
|
|
12
|
+
var BaseHttpRequest_1 = require("./core/BaseHttpRequest");
|
|
13
|
+
Object.defineProperty(exports, "BaseHttpRequest", { enumerable: true, get: function () { return BaseHttpRequest_1.BaseHttpRequest; } });
|
|
14
|
+
var CancelablePromise_1 = require("./core/CancelablePromise");
|
|
15
|
+
Object.defineProperty(exports, "CancelablePromise", { enumerable: true, get: function () { return CancelablePromise_1.CancelablePromise; } });
|
|
16
|
+
Object.defineProperty(exports, "CancelError", { enumerable: true, get: function () { return CancelablePromise_1.CancelError; } });
|
|
17
|
+
var OpenAPI_1 = require("./core/OpenAPI");
|
|
18
|
+
Object.defineProperty(exports, "OpenAPI", { enumerable: true, get: function () { return OpenAPI_1.OpenAPI; } });
|
|
19
|
+
var ContentBaseType_1 = require("./models/ContentBaseType");
|
|
20
|
+
Object.defineProperty(exports, "ContentBaseType", { enumerable: true, get: function () { return ContentBaseType_1.ContentBaseType; } });
|
|
21
|
+
var ContentTypeFeature_1 = require("./models/ContentTypeFeature");
|
|
22
|
+
Object.defineProperty(exports, "ContentTypeFeature", { enumerable: true, get: function () { return ContentTypeFeature_1.ContentTypeFeature; } });
|
|
23
|
+
var ContentTypeUsage_1 = require("./models/ContentTypeUsage");
|
|
24
|
+
Object.defineProperty(exports, "ContentTypeUsage", { enumerable: true, get: function () { return ContentTypeUsage_1.ContentTypeUsage; } });
|
|
25
|
+
var IndexingType_1 = require("./models/IndexingType");
|
|
26
|
+
Object.defineProperty(exports, "IndexingType", { enumerable: true, get: function () { return IndexingType_1.IndexingType; } });
|
|
27
|
+
var LocaleStatus_1 = require("./models/LocaleStatus");
|
|
28
|
+
Object.defineProperty(exports, "LocaleStatus", { enumerable: true, get: function () { return LocaleStatus_1.LocaleStatus; } });
|
|
29
|
+
var PropertyDataType_1 = require("./models/PropertyDataType");
|
|
30
|
+
Object.defineProperty(exports, "PropertyDataType", { enumerable: true, get: function () { return PropertyDataType_1.PropertyDataType; } });
|
|
31
|
+
var VersionStatus_1 = require("./models/VersionStatus");
|
|
32
|
+
Object.defineProperty(exports, "VersionStatus", { enumerable: true, get: function () { return VersionStatus_1.VersionStatus; } });
|
|
33
|
+
var ChangesetsService_1 = require("./services/ChangesetsService");
|
|
34
|
+
Object.defineProperty(exports, "ChangesetsService", { enumerable: true, get: function () { return ChangesetsService_1.ChangesetsService; } });
|
|
35
|
+
var ContentService_1 = require("./services/ContentService");
|
|
36
|
+
Object.defineProperty(exports, "ContentService", { enumerable: true, get: function () { return ContentService_1.ContentService; } });
|
|
37
|
+
var ContentTypesService_1 = require("./services/ContentTypesService");
|
|
38
|
+
Object.defineProperty(exports, "ContentTypesService", { enumerable: true, get: function () { return ContentTypesService_1.ContentTypesService; } });
|
|
39
|
+
var OauthService_1 = require("./services/OauthService");
|
|
40
|
+
Object.defineProperty(exports, "OauthService", { enumerable: true, get: function () { return OauthService_1.OauthService; } });
|
|
41
|
+
var PackagesService_1 = require("./services/PackagesService");
|
|
42
|
+
Object.defineProperty(exports, "PackagesService", { enumerable: true, get: function () { return PackagesService_1.PackagesService; } });
|
|
43
|
+
var PropertyFormatsService_1 = require("./services/PropertyFormatsService");
|
|
44
|
+
Object.defineProperty(exports, "PropertyFormatsService", { enumerable: true, get: function () { return PropertyFormatsService_1.PropertyFormatsService; } });
|
|
45
|
+
var PropertyGroupsService_1 = require("./services/PropertyGroupsService");
|
|
46
|
+
Object.defineProperty(exports, "PropertyGroupsService", { enumerable: true, get: function () { return PropertyGroupsService_1.PropertyGroupsService; } });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ContentTypeProperty } from './ContentTypeProperty';
|
|
2
|
+
import type { ImageDescriptor } from './ImageDescriptor';
|
|
3
|
+
/**
|
|
4
|
+
* Describes a property that can contain a reference to binary data.
|
|
5
|
+
*/
|
|
6
|
+
export type BinaryProperty = (ContentTypeProperty & {
|
|
7
|
+
imageDescriptor?: ImageDescriptor;
|
|
8
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A writable implementation of an Changeset.
|
|
3
|
+
*/
|
|
4
|
+
export type Changeset = {
|
|
5
|
+
/**
|
|
6
|
+
* The unique key of this Changeset
|
|
7
|
+
*/
|
|
8
|
+
key: string;
|
|
9
|
+
/**
|
|
10
|
+
* The source of this Changeset
|
|
11
|
+
*/
|
|
12
|
+
source?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The name of this Changeset.
|
|
15
|
+
*/
|
|
16
|
+
displayName: string;
|
|
17
|
+
/**
|
|
18
|
+
* A timestamp indicating when this changeset was first created.
|
|
19
|
+
*/
|
|
20
|
+
readonly created?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The username of the user that created this changeset.
|
|
23
|
+
*/
|
|
24
|
+
readonly createdBy?: string;
|
|
25
|
+
readonly lastModified?: string;
|
|
26
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ChangesetItem } from './ChangesetItem';
|
|
2
|
+
export type ChangesetItemPage = {
|
|
3
|
+
/**
|
|
4
|
+
* The items in this paged collection.
|
|
5
|
+
*/
|
|
6
|
+
readonly items?: Array<ChangesetItem>;
|
|
7
|
+
/**
|
|
8
|
+
* The zero-based index of the current page.
|
|
9
|
+
*/
|
|
10
|
+
readonly pageIndex?: number;
|
|
11
|
+
/**
|
|
12
|
+
* The number of item in each page. Not necessarily the same as the number of items in this page.
|
|
13
|
+
*/
|
|
14
|
+
readonly pageSize?: number;
|
|
15
|
+
/**
|
|
16
|
+
* The estimated total number of items in the collection. May be omitted if the total item count is unknown.
|
|
17
|
+
*/
|
|
18
|
+
readonly totalItemCount?: number;
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Changeset } from './Changeset';
|
|
2
|
+
export type ChangesetPage = {
|
|
3
|
+
/**
|
|
4
|
+
* The items in this paged collection.
|
|
5
|
+
*/
|
|
6
|
+
readonly items?: Array<Changeset>;
|
|
7
|
+
/**
|
|
8
|
+
* The zero-based index of the current page.
|
|
9
|
+
*/
|
|
10
|
+
readonly pageIndex?: number;
|
|
11
|
+
/**
|
|
12
|
+
* The number of item in each page. Not necessarily the same as the number of items in this page.
|
|
13
|
+
*/
|
|
14
|
+
readonly pageSize?: number;
|
|
15
|
+
/**
|
|
16
|
+
* The estimated total number of items in the collection. May be omitted if the total item count is unknown.
|
|
17
|
+
*/
|
|
18
|
+
readonly totalItemCount?: number;
|
|
19
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ListPropertyItem } from './ListPropertyItem';
|
|
2
|
+
/**
|
|
3
|
+
* Describes a property list item that can contain a component instance of a specific type.
|
|
4
|
+
*/
|
|
5
|
+
export type ComponentListItem = (ListPropertyItem & {
|
|
6
|
+
/**
|
|
7
|
+
* The key of the ContentType that this ComponentProperty can contain.
|
|
8
|
+
*/
|
|
9
|
+
contentType: string;
|
|
10
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ContentTypeProperty } from './ContentTypeProperty';
|
|
2
|
+
/**
|
|
3
|
+
* Describes a property that can contain a component instance of a specific type.
|
|
4
|
+
*/
|
|
5
|
+
export type ComponentProperty = (ContentTypeProperty & {
|
|
6
|
+
/**
|
|
7
|
+
* The key of the ContentType that this ComponentProperty can contain.
|
|
8
|
+
*/
|
|
9
|
+
contentType: string;
|
|
10
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContentBaseType = void 0;
|
|
4
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
5
|
+
/* istanbul ignore file */
|
|
6
|
+
/* tslint:disable */
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
/**
|
|
9
|
+
* Represent the base type of a ContentType.
|
|
10
|
+
*/
|
|
11
|
+
var ContentBaseType;
|
|
12
|
+
(function (ContentBaseType) {
|
|
13
|
+
ContentBaseType["PAGE"] = "page";
|
|
14
|
+
ContentBaseType["COMPONENT"] = "component";
|
|
15
|
+
ContentBaseType["MEDIA"] = "media";
|
|
16
|
+
ContentBaseType["IMAGE"] = "image";
|
|
17
|
+
ContentBaseType["VIDEO"] = "video";
|
|
18
|
+
ContentBaseType["FOLDER"] = "folder";
|
|
19
|
+
})(ContentBaseType || (exports.ContentBaseType = ContentBaseType = {}));
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a content component.
|
|
3
|
+
*/
|
|
4
|
+
export type ContentComponent = {
|
|
5
|
+
/**
|
|
6
|
+
* The name of the content component. If Reference is set, the name is automatically set to the name of the referenced content.
|
|
7
|
+
*/
|
|
8
|
+
name?: string;
|
|
9
|
+
/**
|
|
10
|
+
* An optional display option for the content component.
|
|
11
|
+
*/
|
|
12
|
+
displayOption?: string;
|
|
13
|
+
/**
|
|
14
|
+
* An optional group for the personalizable component.
|
|
15
|
+
*/
|
|
16
|
+
segmentationGroup?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Specifies the settings for the content component.
|
|
19
|
+
*/
|
|
20
|
+
segments?: Array<string>;
|
|
21
|
+
/**
|
|
22
|
+
* A reference to the content of this component.
|
|
23
|
+
* Cannot be assigned together with Content.
|
|
24
|
+
*/
|
|
25
|
+
reference?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The key of the content type that this is an embedded instance of.
|
|
28
|
+
*/
|
|
29
|
+
contentType?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Dictionary with all custom properties as specified by associated ContentType
|
|
32
|
+
*/
|
|
33
|
+
content?: any;
|
|
34
|
+
};
|