@api-client/core 0.10.6 → 0.10.7
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/build/cjs/src/Platform.d.ts +4 -0
- package/build/cjs/src/Platform.js +5 -1
- package/build/cjs/src/Platform.js.map +1 -1
- package/build/cjs/src/lib/transformers/PayloadSerializer.d.ts +1 -1
- package/build/cjs/src/lib/transformers/PayloadSerializer.js +1 -1
- package/build/cjs/src/lib/transformers/PayloadSerializer.js.map +1 -1
- package/build/esm/src/Platform.d.ts +4 -0
- package/build/esm/src/Platform.js +4 -0
- package/build/esm/src/Platform.js.map +1 -1
- package/build/esm/src/lib/transformers/PayloadSerializer.d.ts +1 -1
- package/build/esm/src/lib/transformers/PayloadSerializer.js +2 -2
- package/build/esm/src/lib/transformers/PayloadSerializer.js.map +1 -1
- package/data/model.js +2 -2
- package/data/models/APIC-187.json +103 -103
- package/data/models/APIC-188.json +103 -103
- package/data/models/APIC-391.json +304 -304
- package/data/models/APIC-487.json +140 -140
- package/data/models/APIC-655.json +308 -308
- package/data/models/APIC-690.json +1013 -1013
- package/data/models/SE-10469.json +3395 -3395
- package/data/models/SE-13092.json +187 -187
- package/data/models/SE-22063.json +58 -58
- package/data/models/amf-helper-api.json +18045 -17866
- package/data/models/arc-demo-api.json +11432 -11339
- package/data/models/example-generator-api.json +6989 -6967
- package/data/models/multiple-servers.json +6 -6
- package/data/models/oas-3-api.json +2117 -2117
- package/data/models/oas-date.json +2 -2
- package/data/models/oas-types.json +10 -10
- package/data/models/oas-unions.json +323 -323
- package/data/models/petstore.json +5556 -5556
- package/data/models/raml-date.json +2 -2
- package/data/models/schema-api.json +504 -367
- package/data/models/secured-api.json +5118 -3110
- package/data/models/tracked-to-linked.json +211 -211
- package/package.json +11 -11
- package/src/Platform.ts +5 -0
- package/src/lib/transformers/PayloadSerializer.ts +3 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@api-client/core",
|
|
3
3
|
"description": "The API Client's core client library. Works in NodeJS and in a ES enabled browser.",
|
|
4
|
-
"version": "0.10.
|
|
4
|
+
"version": "0.10.7",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./build/esm/browser.js": {
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"xpath": "^0.0.33"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@commitlint/cli": "^
|
|
51
|
-
"@commitlint/config-conventional": "^
|
|
50
|
+
"@commitlint/cli": "^18.2.0",
|
|
51
|
+
"@commitlint/config-conventional": "^18.1.0",
|
|
52
52
|
"@types/chai": "^4.2.22",
|
|
53
53
|
"@types/chai-as-promised": "^7.1.5",
|
|
54
54
|
"@types/chai-uuid": "^1.0.2",
|
|
@@ -56,19 +56,19 @@
|
|
|
56
56
|
"@types/express-ntlm": "^2.3.3",
|
|
57
57
|
"@types/mocha": "^10.0.0",
|
|
58
58
|
"@types/node": "^20.4.2",
|
|
59
|
-
"@types/sinon": "^
|
|
59
|
+
"@types/sinon": "^17.0.1",
|
|
60
60
|
"@typescript-eslint/eslint-plugin": "^6.1.0",
|
|
61
61
|
"@typescript-eslint/parser": "^6.1.0",
|
|
62
|
-
"@web/dev-server-esbuild": "^0.
|
|
63
|
-
"@web/test-runner": "^0.
|
|
64
|
-
"@web/test-runner-playwright": "^0.
|
|
62
|
+
"@web/dev-server-esbuild": "^1.0.0",
|
|
63
|
+
"@web/test-runner": "^0.18.0",
|
|
64
|
+
"@web/test-runner-playwright": "^0.11.0",
|
|
65
65
|
"amf-client-js": "^5.4.0-2",
|
|
66
66
|
"chai": "^4.3.4",
|
|
67
67
|
"chai-as-promised": "^7.1.1",
|
|
68
68
|
"chai-uuid": "^1.0.6",
|
|
69
69
|
"cors": "^2.8.5",
|
|
70
70
|
"eslint": "^8.9.0",
|
|
71
|
-
"eslint-config-prettier": "^
|
|
71
|
+
"eslint-config-prettier": "^9.0.0",
|
|
72
72
|
"eslint-import-resolver-typescript": "^3.5.1",
|
|
73
73
|
"eslint-plugin-import": "^2.25.3",
|
|
74
74
|
"eslint-plugin-no-only-tests": "^3.0.0",
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
"express-ntlm": "^2.6.1",
|
|
78
78
|
"get-port": "^7.0.0",
|
|
79
79
|
"husky": "^8.0.1",
|
|
80
|
-
"lint-staged": "^
|
|
80
|
+
"lint-staged": "^15.0.2",
|
|
81
81
|
"mocha": "^10.0.0",
|
|
82
82
|
"nock": "^13.2.7",
|
|
83
|
-
"oauth2-mock-server": "^
|
|
84
|
-
"sinon": "^
|
|
83
|
+
"oauth2-mock-server": "^7.1.1",
|
|
84
|
+
"sinon": "^17.0.1",
|
|
85
85
|
"source-map-support": "^0.5.21",
|
|
86
86
|
"ssl-root-cas": "^1.3.1",
|
|
87
87
|
"ts-node": "^10.4.0",
|
package/src/Platform.ts
CHANGED
|
@@ -15,3 +15,8 @@ export const hasFile: boolean = typeof File === 'function';
|
|
|
15
15
|
* Whether the current platform has the `Buffer` interface.
|
|
16
16
|
*/
|
|
17
17
|
export const hasBuffer: boolean = typeof Buffer === 'function';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Whether the environment is a NodeJS environment.
|
|
21
|
+
*/
|
|
22
|
+
export const isNode = (typeof process !== 'undefined') && (typeof process.release !== 'undefined') && (process.release.name === 'node');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { hasBlob, hasBuffer, hasFile, hasFormData } from '../../Platform.js';
|
|
1
|
+
import { hasBlob, hasBuffer, hasFile, hasFormData, isNode } from '../../Platform.js';
|
|
2
2
|
|
|
3
3
|
export type PayloadTypes = 'string' | 'file' | 'blob' | 'buffer' | 'arraybuffer' | 'formdata' | 'x-www-form-urlencoded';
|
|
4
4
|
export type DeserializedPayload = string | Blob | File | FormData | Buffer | ArrayBuffer | undefined;
|
|
@@ -93,7 +93,7 @@ export class PayloadSerializer {
|
|
|
93
93
|
* Checked whether the passed payload can be safely stored in the data store.
|
|
94
94
|
* @param payload The value to test.
|
|
95
95
|
*/
|
|
96
|
-
static isSafePayload(payload:
|
|
96
|
+
static isSafePayload(payload: unknown): boolean {
|
|
97
97
|
if (payload === undefined || payload === null) {
|
|
98
98
|
// both values should be stored correctly
|
|
99
99
|
return true;
|
|
@@ -289,7 +289,7 @@ export class PayloadSerializer {
|
|
|
289
289
|
if (typeof payload === 'string') {
|
|
290
290
|
return payload;
|
|
291
291
|
}
|
|
292
|
-
if (
|
|
292
|
+
if (isNode) {
|
|
293
293
|
// we are in the nodejs environment.
|
|
294
294
|
// We mostly gonna return a Buffer here.
|
|
295
295
|
switch (payload.type) {
|