@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.
Files changed (38) hide show
  1. package/build/cjs/src/Platform.d.ts +4 -0
  2. package/build/cjs/src/Platform.js +5 -1
  3. package/build/cjs/src/Platform.js.map +1 -1
  4. package/build/cjs/src/lib/transformers/PayloadSerializer.d.ts +1 -1
  5. package/build/cjs/src/lib/transformers/PayloadSerializer.js +1 -1
  6. package/build/cjs/src/lib/transformers/PayloadSerializer.js.map +1 -1
  7. package/build/esm/src/Platform.d.ts +4 -0
  8. package/build/esm/src/Platform.js +4 -0
  9. package/build/esm/src/Platform.js.map +1 -1
  10. package/build/esm/src/lib/transformers/PayloadSerializer.d.ts +1 -1
  11. package/build/esm/src/lib/transformers/PayloadSerializer.js +2 -2
  12. package/build/esm/src/lib/transformers/PayloadSerializer.js.map +1 -1
  13. package/data/model.js +2 -2
  14. package/data/models/APIC-187.json +103 -103
  15. package/data/models/APIC-188.json +103 -103
  16. package/data/models/APIC-391.json +304 -304
  17. package/data/models/APIC-487.json +140 -140
  18. package/data/models/APIC-655.json +308 -308
  19. package/data/models/APIC-690.json +1013 -1013
  20. package/data/models/SE-10469.json +3395 -3395
  21. package/data/models/SE-13092.json +187 -187
  22. package/data/models/SE-22063.json +58 -58
  23. package/data/models/amf-helper-api.json +18045 -17866
  24. package/data/models/arc-demo-api.json +11432 -11339
  25. package/data/models/example-generator-api.json +6989 -6967
  26. package/data/models/multiple-servers.json +6 -6
  27. package/data/models/oas-3-api.json +2117 -2117
  28. package/data/models/oas-date.json +2 -2
  29. package/data/models/oas-types.json +10 -10
  30. package/data/models/oas-unions.json +323 -323
  31. package/data/models/petstore.json +5556 -5556
  32. package/data/models/raml-date.json +2 -2
  33. package/data/models/schema-api.json +504 -367
  34. package/data/models/secured-api.json +5118 -3110
  35. package/data/models/tracked-to-linked.json +211 -211
  36. package/package.json +11 -11
  37. package/src/Platform.ts +5 -0
  38. 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.6",
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": "^17.0.0",
51
- "@commitlint/config-conventional": "^17.0.0",
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": "^10.0.11",
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.4.0",
63
- "@web/test-runner": "^0.17.0",
64
- "@web/test-runner-playwright": "^0.10.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": "^8.3.0",
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": "^13.0.1",
80
+ "lint-staged": "^15.0.2",
81
81
  "mocha": "^10.0.0",
82
82
  "nock": "^13.2.7",
83
- "oauth2-mock-server": "^6.0.0",
84
- "sinon": "^15.0.1",
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: any): boolean {
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 (hasBuffer && (!hasBlob || !hasFile)) {
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) {