@epilot/erp-integration-client 0.4.1 → 0.4.2

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.
@@ -1 +1 @@
1
- (()=>{"use strict";var e={390:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=n(o(466));t.default=r.default},466:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"","version":""},"paths":{"/v1/erp/tracking/acknowledgement":{"post":{"operationId":"acknowledgeTracking","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/erp/trigger":{"post":{"operationId":"triggerErp","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/erp/updates/events":{"post":{"operationId":"processErpUpdatesEvents","requestBody":{"content":{"application/json":{}}},"responses":{}}}},"components":{"responses":{"BadRequest":{"content":{"application/json":{}}},"Unauthorized":{"content":{"application/json":{}}},"NotFound":{"content":{"application/json":{}}},"InternalServerError":{"content":{"application/json":{}}},"ERPUpdatesResponse":{"content":{"application/json":{}}},"TriggerWebhookResponse":{"content":{"application/json":{}}}}},"servers":[{"url":"https://erp-integration-api.sls.epilot.io"}]}')}},t={},o=function o(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,o),s.exports}(390),n=exports;for(var r in o)n[r]=o[r];o.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
1
+ (()=>{"use strict";var e={330:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=n(o(466));t.default=r.default},466:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"","version":""},"paths":{"/v1/erp/tracking/acknowledgement":{"post":{"operationId":"acknowledgeTracking","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/erp/trigger":{"post":{"operationId":"triggerErp","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/erp/updates/events":{"post":{"operationId":"processErpUpdatesEvents","requestBody":{"content":{"application/json":{}}},"responses":{}}}},"components":{"responses":{"BadRequest":{"content":{"application/json":{}}},"Unauthorized":{"content":{"application/json":{}}},"InternalServerError":{"content":{"application/json":{}}},"ERPUpdatesResponse":{"content":{"application/json":{}}},"TriggerWebhookResponse":{"content":{"application/json":{}}}}},"servers":[{"url":"https://erp-integration-api.sls.epilot.io"}]}')}},t={},o=function o(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,o),s.exports}(330),n=exports;for(var r in o)n[r]=o[r];o.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
@@ -52,11 +52,6 @@
52
52
  "application/json": {}
53
53
  }
54
54
  },
55
- "NotFound": {
56
- "content": {
57
- "application/json": {}
58
- }
59
- },
60
55
  "InternalServerError": {
61
56
  "content": {
62
57
  "application/json": {}
package/dist/openapi.d.ts CHANGED
@@ -18,14 +18,13 @@ declare namespace Components {
18
18
  */
19
19
  event_id: string;
20
20
  /**
21
- * Processing status for the event
21
+ * Processing status for the event (skipped indicates duplicate deduplication_id)
22
22
  */
23
- status: "success" | "error";
23
+ status: "success" | "error" | "skipped";
24
24
  message?: string;
25
25
  }[];
26
26
  }
27
27
  export type InternalServerError = Schemas.ErrorResponseBase;
28
- export type NotFound = Schemas.ErrorResponseBase;
29
28
  export type TriggerWebhookResponse = Schemas.TriggerWebhookResp;
30
29
  export type Unauthorized = Schemas.ErrorResponseBase;
31
30
  }
@@ -162,6 +161,13 @@ declare namespace Paths {
162
161
  * The serialized object data payload (JSON, XML, etc.) as a string
163
162
  */
164
163
  payload: string;
164
+ /**
165
+ * Optional unique identifier for idempotency - prevents duplicate processing of the same event within 24 hours in context of the same app and component. Must contain only alphanumeric characters, hyphens, and underscores.
166
+ *
167
+ * example:
168
+ * evt-2025-05-01-12345-create-bp
169
+ */
170
+ deduplication_id?: string; // ^[a-zA-Z0-9_-]+$
165
171
  }[];
166
172
  }
167
173
  namespace Responses {
package/dist/openapi.json CHANGED
@@ -2,12 +2,17 @@
2
2
  "openapi": "3.0.3",
3
3
  "info": {
4
4
  "title": "ERP Integration API",
5
- "version": "1.0.0"
5
+ "version": "0.2.0",
6
+ "description": "API for integrating with ERP systems, handling tracking acknowledgments, triggering ERP processes, and processing ERP updates."
6
7
  },
7
8
  "tags": [
8
9
  {
9
10
  "name": "erp",
10
11
  "description": "ERP integration endpoints"
12
+ },
13
+ {
14
+ "name": "trigger",
15
+ "description": "Endpoints to trigger ERP related actions"
11
16
  }
12
17
  ],
13
18
  "security": [
@@ -192,6 +197,14 @@
192
197
  "payload": {
193
198
  "type": "string",
194
199
  "description": "The serialized object data payload (JSON, XML, etc.) as a string"
200
+ },
201
+ "deduplication_id": {
202
+ "type": "string",
203
+ "pattern": "^[a-zA-Z0-9_-]+$",
204
+ "minLength": 1,
205
+ "maxLength": 255,
206
+ "description": "Optional unique identifier for idempotency - prevents duplicate processing of the same event within 24 hours in context of the same app and component. Must contain only alphanumeric characters, hyphens, and underscores.\n",
207
+ "example": "evt-2025-05-01-12345-create-bp"
195
208
  }
196
209
  }
197
210
  }
@@ -201,20 +214,25 @@
201
214
  "example": {
202
215
  "app_id": "123e4567-e89b-12d3-a456-426614174000",
203
216
  "component_id": "123e4567-e89b-12d3-a456-426614174000",
217
+ "meta": {
218
+ "correlation_id": "req-789e4567-e89b-12d3-a456-426614174000"
219
+ },
204
220
  "events": [
205
221
  {
206
222
  "event_type": "CREATE",
207
223
  "object_type": "business_partner",
208
224
  "timestamp": "2025-05-01T08:30:00Z",
209
225
  "format": "json",
210
- "payload": "{\"id\":\"BP10001\",\"name\":\"Acme Corporation\",\"type\":\"organization\",\"tax_id\":\"DE123456789\",\"status\":\"active\"}"
226
+ "payload": "{\"id\":\"BP10001\",\"name\":\"Acme Corporation\",\"type\":\"organization\",\"tax_id\":\"DE123456789\",\"status\":\"active\"}",
227
+ "deduplication_id": "bp-create-20250501-083000-001"
211
228
  },
212
229
  {
213
230
  "event_type": "UPDATE",
214
231
  "object_type": "contract_account",
215
232
  "timestamp": "2025-05-01T08:35:00Z",
216
233
  "format": "json",
217
- "payload": "{\"id\":\"CA20001\",\"business_partner_id\":\"BP10001\",\"status\":\"active\",\"payment_method\":\"direct_debit\"}"
234
+ "payload": "{\"id\":\"CA20001\",\"business_partner_id\":\"BP10001\",\"status\":\"active\",\"payment_method\":\"direct_debit\"}",
235
+ "deduplication_id": "ca-update-20250501-083500-001"
218
236
  }
219
237
  ]
220
238
  }
@@ -248,12 +266,6 @@
248
266
  "scheme": "bearer",
249
267
  "description": "Authorization header with epilot OAuth2 bearer token",
250
268
  "bearerFormat": "JWT"
251
- },
252
- "EpilotPublicAuth": {
253
- "type": "http",
254
- "scheme": "bearer",
255
- "description": "Authorization header with epilot public access token",
256
- "bearerFormat": "JWT"
257
269
  }
258
270
  },
259
271
  "schemas": {
@@ -383,16 +395,6 @@
383
395
  }
384
396
  }
385
397
  },
386
- "NotFound": {
387
- "description": "The specified resource was not found",
388
- "content": {
389
- "application/json": {
390
- "schema": {
391
- "$ref": "#/components/schemas/ErrorResponseBase"
392
- }
393
- }
394
- }
395
- },
396
398
  "InternalServerError": {
397
399
  "description": "Internal Server Error",
398
400
  "content": {
@@ -427,9 +429,10 @@
427
429
  "type": "string",
428
430
  "enum": [
429
431
  "success",
430
- "error"
432
+ "error",
433
+ "skipped"
431
434
  ],
432
- "description": "Processing status for the event"
435
+ "description": "Processing status for the event (skipped indicates duplicate deduplication_id)"
433
436
  },
434
437
  "message": {
435
438
  "type": "string"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/erp-integration-client",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Client library for ePilot ERP Integration API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,6 +22,18 @@
22
22
  "erp",
23
23
  "integration"
24
24
  ],
25
+ "scripts": {
26
+ "test": "jest",
27
+ "typescript": "tsc",
28
+ "bundle-definition": "webpack",
29
+ "openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/erp-integration.yaml",
30
+ "typegen": "openapi typegen src/openapi.json --client -b '/* eslint-disable */' > src/openapi.d.ts",
31
+ "build": "tsc && npm run build:patch && npm run bundle-definition",
32
+ "build:patch": "sed -i'' -e '/^__exportStar.*openapi.*$/d' dist/index.js",
33
+ "build:watch": "npm run build && tsc -w",
34
+ "prepublishOnly": "npm run typegen && npm run build",
35
+ "lint": "pnpm exec eslint src"
36
+ },
25
37
  "files": [
26
38
  "*.js",
27
39
  "*.d.ts",
@@ -51,25 +63,14 @@
51
63
  "@types/jest": "^26.0.20",
52
64
  "axios": "^1.11.0",
53
65
  "copy-webpack-plugin": "^7.0.0",
54
- "jest": "^26.6.3",
66
+ "jest": "^29.6.2",
55
67
  "json-loader": "^0.5.7",
56
68
  "openapicmd": "^2.7.0",
57
- "ts-jest": "^26.5.0",
69
+ "ts-jest": "^29.4.1",
58
70
  "ts-loader": "^8.0.14",
59
71
  "ts-node": "^10.9.1",
60
72
  "typescript": "^4.1.3",
61
73
  "webpack": "^5.18.0",
62
74
  "webpack-cli": "^4.4.0"
63
- },
64
- "scripts": {
65
- "test": "jest",
66
- "typescript": "tsc",
67
- "bundle-definition": "webpack",
68
- "openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/erp-integration.yaml",
69
- "typegen": "openapi typegen src/openapi.json --client -b '/* eslint-disable */' > src/openapi.d.ts",
70
- "build": "tsc && npm run build:patch && npm run bundle-definition",
71
- "build:patch": "sed -i'' -e '/^__exportStar.*openapi.*$/d' dist/index.js",
72
- "build:watch": "npm run build && tsc -w",
73
- "lint": "pnpm exec eslint src"
74
75
  }
75
- }
76
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2025 epilot GmbH
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.