@remkoj/optimizely-cms-api 6.0.0-pre1 → 6.0.0-pre11
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 +12 -12
- package/README.md +3 -5
- package/dist/api-client.d.ts +23 -7
- package/dist/api-client.js +97 -37
- package/dist/client/client/{client.d.ts → client.gen.d.ts} +1 -1
- package/dist/client/client/client.gen.js +208 -0
- package/dist/client/client/index.d.ts +8 -7
- package/dist/client/client/index.js +15 -12
- package/dist/client/client/{types.d.ts → types.gen.d.ts} +18 -13
- package/dist/client/{core/types.js → client/types.gen.js} +1 -0
- package/dist/client/client/{utils.d.ts → utils.gen.d.ts} +9 -21
- package/dist/client/client/{utils.js → utils.gen.js} +68 -122
- package/dist/client/client.gen.d.ts +3 -3
- package/dist/client/client.gen.js +1 -1
- package/dist/client/core/{auth.js → auth.gen.js} +1 -0
- package/dist/client/core/{bodySerializer.d.ts → bodySerializer.gen.d.ts} +13 -5
- package/dist/client/core/{bodySerializer.js → bodySerializer.gen.js} +4 -0
- package/dist/client/core/{params.d.ts → params.gen.d.ts} +10 -0
- package/dist/client/core/{params.js → params.gen.js} +1 -0
- package/dist/client/core/{pathSerializer.js → pathSerializer.gen.js} +1 -0
- package/dist/client/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/client/core/queryKeySerializer.gen.js +105 -0
- package/dist/client/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/client/core/serverSentEvents.gen.js +139 -0
- package/dist/client/core/{types.d.ts → types.gen.d.ts} +19 -14
- package/dist/client/{client/types.js → core/types.gen.js} +1 -0
- package/dist/client/core/utils.gen.d.ts +19 -0
- package/dist/client/core/utils.gen.js +93 -0
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -2
- package/dist/client/sdk.gen.d.ts +28 -167
- package/dist/client/sdk.gen.js +34 -421
- package/dist/client/transformers.gen.d.ts +8 -24
- package/dist/client/transformers.gen.js +76 -192
- package/dist/client/types.gen.d.ts +511 -2167
- package/dist/client/types.gen.js +0 -84
- package/dist/client-config.d.ts +5 -2
- package/dist/client-config.js +42 -14
- package/dist/config.d.ts +5 -2
- package/dist/config.js +26 -17
- package/dist/getaccesstoken.d.ts +1 -1
- package/dist/getaccesstoken.js +10 -8
- package/dist/index.d.ts +4 -0
- package/dist/index.js +10 -1
- package/dist/instance.client/client/client.gen.d.ts +2 -0
- package/dist/instance.client/client/client.gen.js +208 -0
- package/dist/instance.client/client/index.d.ts +8 -0
- package/dist/instance.client/client/index.js +17 -0
- package/dist/instance.client/client/types.gen.d.ts +124 -0
- package/dist/instance.client/client/types.gen.js +3 -0
- package/dist/instance.client/client/utils.gen.d.ts +33 -0
- package/dist/instance.client/client/utils.gen.js +242 -0
- package/dist/instance.client/client.gen.d.ts +12 -0
- package/dist/instance.client/client.gen.js +9 -0
- package/dist/instance.client/core/auth.gen.d.ts +18 -0
- package/dist/instance.client/core/auth.gen.js +18 -0
- package/dist/instance.client/core/bodySerializer.gen.d.ts +25 -0
- package/dist/instance.client/core/bodySerializer.gen.js +60 -0
- package/dist/instance.client/core/params.gen.d.ts +33 -0
- package/dist/instance.client/core/params.gen.js +92 -0
- package/dist/instance.client/core/pathSerializer.gen.d.ts +33 -0
- package/dist/instance.client/core/pathSerializer.gen.js +123 -0
- package/dist/instance.client/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/instance.client/core/queryKeySerializer.gen.js +105 -0
- package/dist/instance.client/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/instance.client/core/serverSentEvents.gen.js +139 -0
- package/dist/instance.client/core/types.gen.d.ts +78 -0
- package/dist/instance.client/core/types.gen.js +3 -0
- package/dist/instance.client/core/utils.gen.d.ts +19 -0
- package/dist/instance.client/core/utils.gen.js +93 -0
- package/dist/instance.client/index.d.ts +4 -0
- package/dist/instance.client/index.js +21 -0
- package/dist/instance.client/sdk.gen.d.ts +303 -0
- package/dist/instance.client/sdk.gen.js +699 -0
- package/dist/instance.client/transformers.gen.d.ts +48 -0
- package/dist/instance.client/transformers.gen.js +431 -0
- package/dist/instance.client/types.gen.d.ts +2838 -0
- package/dist/instance.client/types.gen.js +3 -0
- package/dist/types.d.ts +3 -1
- package/dist/types.js +1 -0
- package/dist/version.json +3 -3
- package/package.json +8 -12
- package/dist/client/client/client.js +0 -147
- /package/dist/client/core/{auth.d.ts → auth.gen.d.ts} +0 -0
- /package/dist/client/core/{pathSerializer.d.ts → pathSerializer.gen.d.ts} +0 -0
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type InstanceApiVersionInfo = {
|
|
2
2
|
status: "Healthy";
|
|
3
|
+
baseUrl?: string;
|
|
3
4
|
statusDuration: number;
|
|
4
5
|
apiVersion: string;
|
|
5
6
|
serviceVersion: string;
|
|
@@ -8,5 +9,6 @@ export type InstanceApiVersionInfo = {
|
|
|
8
9
|
};
|
|
9
10
|
export declare enum OptiCmsVersion {
|
|
10
11
|
CMS12 = "OPTI-CMS-12",
|
|
11
|
-
CMS13 = "OPTI-CMS-13"
|
|
12
|
+
CMS13 = "OPTI-CMS-13",
|
|
13
|
+
CMSSAAS = "OPTI-CMS-SAAS"
|
|
12
14
|
}
|
package/dist/types.js
CHANGED
package/dist/version.json
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@remkoj/optimizely-cms-api",
|
|
3
3
|
"displayName": "Optimizely CMS - Integration API Client",
|
|
4
4
|
"description": "A Javascript client for the Integration API provided by the Optimizely CMS.",
|
|
5
|
-
"version": "6.0.0-
|
|
5
|
+
"version": "6.0.0-pre11",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"main": "./dist/index.js",
|
|
@@ -12,24 +12,20 @@
|
|
|
12
12
|
],
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@hey-api/client-fetch": "^0.13.1",
|
|
15
|
-
"@hey-api/openapi-ts": "^0.
|
|
16
|
-
"
|
|
17
|
-
"dotenv": "^17.0.1",
|
|
18
|
-
"dotenv-expand": "^12.0.2",
|
|
19
|
-
"glob": "^11.0.3",
|
|
20
|
-
"rimraf": "^6.0.1",
|
|
21
|
-
"typescript": "^5.8.3"
|
|
15
|
+
"@hey-api/openapi-ts": "^0.86.8",
|
|
16
|
+
"rimraf": "^6.0.1"
|
|
22
17
|
},
|
|
23
18
|
"dependencies": {
|
|
24
|
-
"@types/node": "^22.
|
|
25
|
-
"dotenv": "^17.
|
|
19
|
+
"@types/node": "^22.18.13",
|
|
20
|
+
"dotenv": "^17.2.3",
|
|
21
|
+
"dotenv-expand": "^12.0.3",
|
|
26
22
|
"glob": "^11.0.3",
|
|
27
23
|
"openapi-typescript-codegen": "^0.29.0",
|
|
28
24
|
"tslib": "^2.8.1",
|
|
29
|
-
"typescript": "^5.
|
|
25
|
+
"typescript": "^5.9.3"
|
|
30
26
|
},
|
|
31
27
|
"scripts": {
|
|
32
|
-
"clean": "rimraf -g ./dist ./*.tsbuildinfo
|
|
28
|
+
"clean": "rimraf -g ./dist ./*.tsbuildinfo ./openapi-ts*log",
|
|
33
29
|
"prepare": "tsc --build && yarn node scripts/copy-client.mjs",
|
|
34
30
|
"watch": "tsc --watch",
|
|
35
31
|
"rebuild": "yarn clean && yarn generate && tsc --build --force",
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createClient = void 0;
|
|
4
|
-
const utils_1 = require("./utils");
|
|
5
|
-
const createClient = (config = {}) => {
|
|
6
|
-
let _config = (0, utils_1.mergeConfigs)((0, utils_1.createConfig)(), config);
|
|
7
|
-
const getConfig = () => ({ ..._config });
|
|
8
|
-
const setConfig = (config) => {
|
|
9
|
-
_config = (0, utils_1.mergeConfigs)(_config, config);
|
|
10
|
-
return getConfig();
|
|
11
|
-
};
|
|
12
|
-
const interceptors = (0, utils_1.createInterceptors)();
|
|
13
|
-
const request = async (options) => {
|
|
14
|
-
const opts = {
|
|
15
|
-
..._config,
|
|
16
|
-
...options,
|
|
17
|
-
fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
|
|
18
|
-
headers: (0, utils_1.mergeHeaders)(_config.headers, options.headers),
|
|
19
|
-
};
|
|
20
|
-
if (opts.security) {
|
|
21
|
-
await (0, utils_1.setAuthParams)({
|
|
22
|
-
...opts,
|
|
23
|
-
security: opts.security,
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
if (opts.requestValidator) {
|
|
27
|
-
await opts.requestValidator(opts);
|
|
28
|
-
}
|
|
29
|
-
if (opts.body && opts.bodySerializer) {
|
|
30
|
-
opts.body = opts.bodySerializer(opts.body);
|
|
31
|
-
}
|
|
32
|
-
// remove Content-Type header if body is empty to avoid sending invalid requests
|
|
33
|
-
if (opts.body === undefined || opts.body === '') {
|
|
34
|
-
opts.headers.delete('Content-Type');
|
|
35
|
-
}
|
|
36
|
-
const url = (0, utils_1.buildUrl)(opts);
|
|
37
|
-
const requestInit = {
|
|
38
|
-
redirect: 'follow',
|
|
39
|
-
...opts,
|
|
40
|
-
};
|
|
41
|
-
let request = new Request(url, requestInit);
|
|
42
|
-
for (const fn of interceptors.request._fns) {
|
|
43
|
-
if (fn) {
|
|
44
|
-
request = await fn(request, opts);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
// fetch must be assigned here, otherwise it would throw the error:
|
|
48
|
-
// TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
|
|
49
|
-
const _fetch = opts.fetch;
|
|
50
|
-
let response = await _fetch(request);
|
|
51
|
-
for (const fn of interceptors.response._fns) {
|
|
52
|
-
if (fn) {
|
|
53
|
-
response = await fn(response, request, opts);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
const result = {
|
|
57
|
-
request,
|
|
58
|
-
response,
|
|
59
|
-
};
|
|
60
|
-
if (response.ok) {
|
|
61
|
-
if (response.status === 204 ||
|
|
62
|
-
response.headers.get('Content-Length') === '0') {
|
|
63
|
-
return opts.responseStyle === 'data'
|
|
64
|
-
? {}
|
|
65
|
-
: {
|
|
66
|
-
data: {},
|
|
67
|
-
...result,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
const parseAs = (opts.parseAs === 'auto'
|
|
71
|
-
? (0, utils_1.getParseAs)(response.headers.get('Content-Type'))
|
|
72
|
-
: opts.parseAs) ?? 'json';
|
|
73
|
-
let data;
|
|
74
|
-
switch (parseAs) {
|
|
75
|
-
case 'arrayBuffer':
|
|
76
|
-
case 'blob':
|
|
77
|
-
case 'formData':
|
|
78
|
-
case 'json':
|
|
79
|
-
case 'text':
|
|
80
|
-
data = await response[parseAs]();
|
|
81
|
-
break;
|
|
82
|
-
case 'stream':
|
|
83
|
-
return opts.responseStyle === 'data'
|
|
84
|
-
? response.body
|
|
85
|
-
: {
|
|
86
|
-
data: response.body,
|
|
87
|
-
...result,
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
if (parseAs === 'json') {
|
|
91
|
-
if (opts.responseValidator) {
|
|
92
|
-
await opts.responseValidator(data);
|
|
93
|
-
}
|
|
94
|
-
if (opts.responseTransformer) {
|
|
95
|
-
data = await opts.responseTransformer(data);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return opts.responseStyle === 'data'
|
|
99
|
-
? data
|
|
100
|
-
: {
|
|
101
|
-
data,
|
|
102
|
-
...result,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
let error = await response.text();
|
|
106
|
-
try {
|
|
107
|
-
error = JSON.parse(error);
|
|
108
|
-
}
|
|
109
|
-
catch {
|
|
110
|
-
// noop
|
|
111
|
-
}
|
|
112
|
-
let finalError = error;
|
|
113
|
-
for (const fn of interceptors.error._fns) {
|
|
114
|
-
if (fn) {
|
|
115
|
-
finalError = (await fn(error, response, request, opts));
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
finalError = finalError || {};
|
|
119
|
-
if (opts.throwOnError) {
|
|
120
|
-
throw finalError;
|
|
121
|
-
}
|
|
122
|
-
// TODO: we probably want to return error and improve types
|
|
123
|
-
return opts.responseStyle === 'data'
|
|
124
|
-
? undefined
|
|
125
|
-
: {
|
|
126
|
-
error: finalError,
|
|
127
|
-
...result,
|
|
128
|
-
};
|
|
129
|
-
};
|
|
130
|
-
return {
|
|
131
|
-
buildUrl: utils_1.buildUrl,
|
|
132
|
-
connect: (options) => request({ ...options, method: 'CONNECT' }),
|
|
133
|
-
delete: (options) => request({ ...options, method: 'DELETE' }),
|
|
134
|
-
get: (options) => request({ ...options, method: 'GET' }),
|
|
135
|
-
getConfig,
|
|
136
|
-
head: (options) => request({ ...options, method: 'HEAD' }),
|
|
137
|
-
interceptors,
|
|
138
|
-
options: (options) => request({ ...options, method: 'OPTIONS' }),
|
|
139
|
-
patch: (options) => request({ ...options, method: 'PATCH' }),
|
|
140
|
-
post: (options) => request({ ...options, method: 'POST' }),
|
|
141
|
-
put: (options) => request({ ...options, method: 'PUT' }),
|
|
142
|
-
request,
|
|
143
|
-
setConfig,
|
|
144
|
-
trace: (options) => request({ ...options, method: 'TRACE' }),
|
|
145
|
-
};
|
|
146
|
-
};
|
|
147
|
-
exports.createClient = createClient;
|
|
File without changes
|
|
File without changes
|