@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.
Files changed (85) hide show
  1. package/LICENSE +12 -12
  2. package/README.md +3 -5
  3. package/dist/api-client.d.ts +23 -7
  4. package/dist/api-client.js +97 -37
  5. package/dist/client/client/{client.d.ts → client.gen.d.ts} +1 -1
  6. package/dist/client/client/client.gen.js +208 -0
  7. package/dist/client/client/index.d.ts +8 -7
  8. package/dist/client/client/index.js +15 -12
  9. package/dist/client/client/{types.d.ts → types.gen.d.ts} +18 -13
  10. package/dist/client/{core/types.js → client/types.gen.js} +1 -0
  11. package/dist/client/client/{utils.d.ts → utils.gen.d.ts} +9 -21
  12. package/dist/client/client/{utils.js → utils.gen.js} +68 -122
  13. package/dist/client/client.gen.d.ts +3 -3
  14. package/dist/client/client.gen.js +1 -1
  15. package/dist/client/core/{auth.js → auth.gen.js} +1 -0
  16. package/dist/client/core/{bodySerializer.d.ts → bodySerializer.gen.d.ts} +13 -5
  17. package/dist/client/core/{bodySerializer.js → bodySerializer.gen.js} +4 -0
  18. package/dist/client/core/{params.d.ts → params.gen.d.ts} +10 -0
  19. package/dist/client/core/{params.js → params.gen.js} +1 -0
  20. package/dist/client/core/{pathSerializer.js → pathSerializer.gen.js} +1 -0
  21. package/dist/client/core/queryKeySerializer.gen.d.ts +18 -0
  22. package/dist/client/core/queryKeySerializer.gen.js +105 -0
  23. package/dist/client/core/serverSentEvents.gen.d.ts +71 -0
  24. package/dist/client/core/serverSentEvents.gen.js +139 -0
  25. package/dist/client/core/{types.d.ts → types.gen.d.ts} +19 -14
  26. package/dist/client/{client/types.js → core/types.gen.js} +1 -0
  27. package/dist/client/core/utils.gen.d.ts +19 -0
  28. package/dist/client/core/utils.gen.js +93 -0
  29. package/dist/client/index.d.ts +1 -1
  30. package/dist/client/index.js +1 -2
  31. package/dist/client/sdk.gen.d.ts +28 -167
  32. package/dist/client/sdk.gen.js +34 -421
  33. package/dist/client/transformers.gen.d.ts +8 -24
  34. package/dist/client/transformers.gen.js +76 -192
  35. package/dist/client/types.gen.d.ts +511 -2167
  36. package/dist/client/types.gen.js +0 -84
  37. package/dist/client-config.d.ts +5 -2
  38. package/dist/client-config.js +42 -14
  39. package/dist/config.d.ts +5 -2
  40. package/dist/config.js +26 -17
  41. package/dist/getaccesstoken.d.ts +1 -1
  42. package/dist/getaccesstoken.js +10 -8
  43. package/dist/index.d.ts +4 -0
  44. package/dist/index.js +10 -1
  45. package/dist/instance.client/client/client.gen.d.ts +2 -0
  46. package/dist/instance.client/client/client.gen.js +208 -0
  47. package/dist/instance.client/client/index.d.ts +8 -0
  48. package/dist/instance.client/client/index.js +17 -0
  49. package/dist/instance.client/client/types.gen.d.ts +124 -0
  50. package/dist/instance.client/client/types.gen.js +3 -0
  51. package/dist/instance.client/client/utils.gen.d.ts +33 -0
  52. package/dist/instance.client/client/utils.gen.js +242 -0
  53. package/dist/instance.client/client.gen.d.ts +12 -0
  54. package/dist/instance.client/client.gen.js +9 -0
  55. package/dist/instance.client/core/auth.gen.d.ts +18 -0
  56. package/dist/instance.client/core/auth.gen.js +18 -0
  57. package/dist/instance.client/core/bodySerializer.gen.d.ts +25 -0
  58. package/dist/instance.client/core/bodySerializer.gen.js +60 -0
  59. package/dist/instance.client/core/params.gen.d.ts +33 -0
  60. package/dist/instance.client/core/params.gen.js +92 -0
  61. package/dist/instance.client/core/pathSerializer.gen.d.ts +33 -0
  62. package/dist/instance.client/core/pathSerializer.gen.js +123 -0
  63. package/dist/instance.client/core/queryKeySerializer.gen.d.ts +18 -0
  64. package/dist/instance.client/core/queryKeySerializer.gen.js +105 -0
  65. package/dist/instance.client/core/serverSentEvents.gen.d.ts +71 -0
  66. package/dist/instance.client/core/serverSentEvents.gen.js +139 -0
  67. package/dist/instance.client/core/types.gen.d.ts +78 -0
  68. package/dist/instance.client/core/types.gen.js +3 -0
  69. package/dist/instance.client/core/utils.gen.d.ts +19 -0
  70. package/dist/instance.client/core/utils.gen.js +93 -0
  71. package/dist/instance.client/index.d.ts +4 -0
  72. package/dist/instance.client/index.js +21 -0
  73. package/dist/instance.client/sdk.gen.d.ts +303 -0
  74. package/dist/instance.client/sdk.gen.js +699 -0
  75. package/dist/instance.client/transformers.gen.d.ts +48 -0
  76. package/dist/instance.client/transformers.gen.js +431 -0
  77. package/dist/instance.client/types.gen.d.ts +2838 -0
  78. package/dist/instance.client/types.gen.js +3 -0
  79. package/dist/types.d.ts +3 -1
  80. package/dist/types.js +1 -0
  81. package/dist/version.json +3 -3
  82. package/package.json +8 -12
  83. package/dist/client/client/client.js +0 -147
  84. /package/dist/client/core/{auth.d.ts → auth.gen.d.ts} +0 -0
  85. /package/dist/client/core/{pathSerializer.d.ts → pathSerializer.gen.d.ts} +0 -0
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file is auto-generated by @hey-api/openapi-ts
3
+ Object.defineProperty(exports, "__esModule", { value: true });
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
@@ -5,4 +5,5 @@ var OptiCmsVersion;
5
5
  (function (OptiCmsVersion) {
6
6
  OptiCmsVersion["CMS12"] = "OPTI-CMS-12";
7
7
  OptiCmsVersion["CMS13"] = "OPTI-CMS-13";
8
+ OptiCmsVersion["CMSSAAS"] = "OPTI-CMS-SAAS";
8
9
  })(OptiCmsVersion || (exports.OptiCmsVersion = OptiCmsVersion = {}));
package/dist/version.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "api": "preview2-1.0.0",
3
- "service": "2025.06.18.1735",
4
- "cms": "2025.06.18.1735"
2
+ "api": "preview3-1.0.0",
3
+ "service": "2025.09.24.1104",
4
+ "cms": "2025.09.24.1104"
5
5
  }
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-pre1",
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.77.0",
16
- "@types/node": "^22.16.0",
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.16.0",
25
- "dotenv": "^17.0.1",
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.8.3"
25
+ "typescript": "^5.9.3"
30
26
  },
31
27
  "scripts": {
32
- "clean": "rimraf -g ./dist ./*.tsbuildinfo && rimraf -g ./openapi-ts*log",
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