@api-client/core 0.18.33 → 0.18.35

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/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.18.33",
4
+ "version": "0.18.35",
5
5
  "license": "Apache-2.0",
6
6
  "exports": {
7
7
  "./browser.js": {
@@ -92,13 +92,15 @@
92
92
  "@pawel-up/csv": "^0.2.0",
93
93
  "@pawel-up/data-mock": "^0.4.0",
94
94
  "@pawel-up/jexl": "^4.0.1",
95
- "@xmldom/xmldom": "^0.9.7",
95
+ "@types/sinon": "^20.0.0",
96
+ "@xmldom/xmldom": "^0.8.11",
96
97
  "amf-json-ld-lib": "^0.0.15",
97
98
  "chalk": "^5.4.1",
98
99
  "console-table-printer": "^2.11.2",
99
100
  "dompurify": "^3.2.6",
100
101
  "jsdom": "^27.0.0",
101
102
  "nanoid": "^5.1.5",
103
+ "sinon": "^21.0.0",
102
104
  "tslog": "^4.9.3",
103
105
  "ws": "^8.12.0",
104
106
  "xpath": "^0.0.34"
@@ -120,12 +122,11 @@
120
122
  "@types/json-schema": "^7.0.15",
121
123
  "@types/mocha": "^10.0.10",
122
124
  "@types/node": "^24.0.1",
123
- "@types/sinon": "^17.0.1",
124
125
  "@web/dev-server": "^0.4.6",
125
126
  "@web/dev-server-rollup": "^0.6.4",
126
127
  "@web/test-runner": "^0.20.0",
127
128
  "@web/test-runner-playwright": "^0.11.0",
128
- "amf-client-js": "^5.7.0",
129
+ "amf-client-js": "^5.9.1-3",
129
130
  "c8": "^10.1.3",
130
131
  "conventional-changelog-cli": "^5.0.0",
131
132
  "cors": "^2.8.5",
@@ -142,7 +143,6 @@
142
143
  "oauth2-mock-server": "^8.0.0",
143
144
  "prettier": "^3.5.1",
144
145
  "schema-org-json-schemas": "^2.1.4",
145
- "sinon": "^21.0.0",
146
146
  "ts-lit-plugin": "^2.0.2",
147
147
  "ts-node-maintained": "^10.9.5",
148
148
  "typescript": "^5.5.2",
@@ -100,7 +100,7 @@ export class XmlReader extends DataReader {
100
100
  xResult = xpath.default.XPathResult
101
101
  let errored = false
102
102
  const parser = new DOMParser({
103
- onError: (): void => {
103
+ errorHandler: (): void => {
104
104
  errored = true
105
105
  },
106
106
  })
@@ -674,6 +674,13 @@ export interface DeleteAction extends Action {
674
674
  * @default 'soft'
675
675
  */
676
676
  strategy?: 'soft' | 'hard'
677
+ /**
678
+ * The data retention period (in days) for soft-deleted resources.
679
+ * This defines how long the data should be kept before it is permanently deleted.
680
+ *
681
+ * @default 30
682
+ */
683
+ retentionPeriod?: number
677
684
  }
678
685
 
679
686
  /**
@@ -0,0 +1,40 @@
1
+ # SDK Mocking
2
+
3
+ The `SdkMock` class provides easy API mocking for testing. See the [full documentation](../docs/sdk-mock.md) for details.
4
+
5
+ ## Quick Start
6
+
7
+ ```typescript
8
+ import { SdkMock, StoreSdk } from '@api-client/core/browser.js';
9
+
10
+ const sdk = new StoreSdk('http://localhost:8080');
11
+ const mocker = new SdkMock(sdk);
12
+
13
+ // Mock with random data
14
+ mocker.organizations.list();
15
+ const orgs = await sdk.organizations.list();
16
+
17
+ // Mock with custom data
18
+ mocker.organizations.create({
19
+ data: { key: 'org-1', name: 'Test Org', ... }
20
+ });
21
+
22
+ // Clean up
23
+ mocker.restore();
24
+ ```
25
+
26
+ ## Features
27
+
28
+ - ✅ Simple API - generate random but correct responses
29
+ - ✅ Custom responses with specific data, status codes, and headers
30
+ - ✅ Easy stub management and cleanup
31
+ - ✅ Full TypeScript support
32
+
33
+ ## Supported APIs
34
+
35
+ - Organizations (list, create, read, delete)
36
+ - Groups (list, create, read, update, delete)
37
+ - Users (me)
38
+ - Auth (oauthRedirect)
39
+
40
+ See the [complete documentation](../docs/sdk-mock.md) for more information.