@epilot/erp-integration-client 0.17.0 → 0.19.0

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={330:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(466));t.default=o.default},466:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"","version":""},"servers":[{"url":"https://erp-integration-api.sls.epilot.io"}],"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":{}}},"/v2/erp/updates/events":{"post":{"operationId":"processErpUpdatesEventsV2","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v2/erp/updates/mapping_simulation":{"post":{"operationId":"simulateMappingV2","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/erp/updates/mapping_simulation":{"post":{"operationId":"simulateMapping","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations":{"get":{"operationId":"listIntegrations","responses":{}},"post":{"operationId":"createIntegration","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}":{"get":{"operationId":"getIntegration","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}},"put":{"operationId":"updateIntegration","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteIntegration","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}}},"/v1/integrations/{integrationId}/events":{"post":{"operationId":"queryEvents","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/events/replay":{"post":{"operationId":"replayEvents","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/use-cases":{"get":{"operationId":"listUseCases","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}},"post":{"operationId":"createUseCase","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/use-cases/{useCaseId}":{"get":{"operationId":"getUseCase","parameters":[{"name":"integrationId","in":"path","required":true},{"name":"useCaseId","in":"path","required":true}],"responses":{}},"put":{"operationId":"updateUseCase","parameters":[{"name":"integrationId","in":"path","required":true},{"name":"useCaseId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteUseCase","parameters":[{"name":"integrationId","in":"path","required":true},{"name":"useCaseId","in":"path","required":true}],"responses":{}}},"/v1/integrations/{integrationId}/use-cases/{useCaseId}/history":{"get":{"operationId":"listUseCaseHistory","parameters":[{"name":"integrationId","in":"path","required":true},{"name":"useCaseId","in":"path","required":true},{"name":"cursor","in":"query","required":false}],"responses":{}}},"/v2/integrations":{"get":{"operationId":"listIntegrationsV2","responses":{}},"post":{"operationId":"createIntegrationV2","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v2/integrations/{integrationId}":{"get":{"operationId":"getIntegrationV2","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}},"put":{"operationId":"updateIntegrationV2","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteIntegrationV2","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}}},"/v1/integrations/{integrationId}/app-mapping":{"put":{"operationId":"setIntegrationAppMapping","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteIntegrationAppMapping","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/monitoring/inbound-events":{"post":{"operationId":"queryInboundMonitoringEvents","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/monitoring/stats":{"post":{"operationId":"getMonitoringStats","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/outbound-status":{"get":{"operationId":"getOutboundStatus","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}}},"/v1/integrations/{integrationId}/monitoring/access-logs":{"post":{"operationId":"queryAccessLogs","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/monitoring/outbound-events":{"post":{"operationId":"queryOutboundMonitoringEvents","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}}},"components":{"responses":{"BadRequest":{"content":{"application/json":{}}},"NotFound":{"content":{"application/json":{}}},"Unauthorized":{"content":{"application/json":{}}},"InternalServerError":{"content":{"application/json":{}}},"QueryInboundMonitoringEventsResponse":{"content":{"application/json":{}}},"GetMonitoringStatsResponse":{"content":{"application/json":{}}},"QueryAccessLogsResponse":{"content":{"application/json":{}}},"QueryOutboundMonitoringEventsResponse":{"content":{"application/json":{}}},"ReplayEventsResponse":{"content":{"application/json":{}}},"ERPUpdatesResponse":{"content":{"application/json":{}}},"TriggerWebhookResponse":{"content":{"application/json":{}}},"QueryEventsResponse":{"content":{"application/json":{}}}}}}')}},t={},n=function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}(330),r=exports;for(var o in n)r[o]=n[o];n.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})();
1
+ (()=>{"use strict";var e={330:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(466));t.default=o.default},466:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"","version":""},"servers":[{"url":"https://erp-integration-api.sls.epilot.io"}],"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":{"deprecated":true,"operationId":"processErpUpdatesEvents","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v2/erp/updates/events":{"post":{"deprecated":true,"operationId":"processErpUpdatesEventsV2","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v3/erp/updates/events":{"post":{"operationId":"processErpUpdatesEventsV3","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v2/erp/updates/mapping_simulation":{"post":{"operationId":"simulateMappingV2","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/erp/updates/mapping_simulation":{"post":{"operationId":"simulateMapping","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations":{"get":{"operationId":"listIntegrations","responses":{}},"post":{"operationId":"createIntegration","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}":{"get":{"operationId":"getIntegration","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}},"put":{"operationId":"updateIntegration","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteIntegration","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}}},"/v1/integrations/{integrationId}/events":{"post":{"operationId":"queryEvents","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/events/replay":{"post":{"operationId":"replayEvents","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/use-cases":{"get":{"operationId":"listUseCases","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}},"post":{"operationId":"createUseCase","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/use-cases/{useCaseId}":{"get":{"operationId":"getUseCase","parameters":[{"name":"integrationId","in":"path","required":true},{"name":"useCaseId","in":"path","required":true}],"responses":{}},"put":{"operationId":"updateUseCase","parameters":[{"name":"integrationId","in":"path","required":true},{"name":"useCaseId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteUseCase","parameters":[{"name":"integrationId","in":"path","required":true},{"name":"useCaseId","in":"path","required":true}],"responses":{}}},"/v1/integrations/{integrationId}/use-cases/{useCaseId}/history":{"get":{"operationId":"listUseCaseHistory","parameters":[{"name":"integrationId","in":"path","required":true},{"name":"useCaseId","in":"path","required":true},{"name":"cursor","in":"query","required":false}],"responses":{}}},"/v2/integrations":{"get":{"operationId":"listIntegrationsV2","responses":{}},"post":{"operationId":"createIntegrationV2","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v2/integrations/{integrationId}":{"get":{"operationId":"getIntegrationV2","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}},"put":{"operationId":"updateIntegrationV2","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteIntegrationV2","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}}},"/v1/integrations/{integrationId}/app-mapping":{"put":{"operationId":"setIntegrationAppMapping","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteIntegrationAppMapping","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/monitoring/inbound-events":{"post":{"operationId":"queryInboundMonitoringEvents","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/monitoring/stats":{"post":{"operationId":"getMonitoringStats","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/outbound-status":{"get":{"operationId":"getOutboundStatus","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}}},"/v1/integrations/{integrationId}/monitoring/access-logs":{"post":{"operationId":"queryAccessLogs","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/monitoring/outbound-events":{"post":{"operationId":"queryOutboundMonitoringEvents","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}}},"components":{"responses":{"BadRequest":{"content":{"application/json":{}}},"NotFound":{"content":{"application/json":{}}},"Unauthorized":{"content":{"application/json":{}}},"InternalServerError":{"content":{"application/json":{}}},"QueryInboundMonitoringEventsResponse":{"content":{"application/json":{}}},"GetMonitoringStatsResponse":{"content":{"application/json":{}}},"QueryAccessLogsResponse":{"content":{"application/json":{}}},"QueryOutboundMonitoringEventsResponse":{"content":{"application/json":{}}},"ReplayEventsResponse":{"content":{"application/json":{}}},"ERPUpdatesResponse":{"content":{"application/json":{}}},"TriggerWebhookResponse":{"content":{"application/json":{}}},"QueryEventsResponse":{"content":{"application/json":{}}}}}}')}},t={},n=function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}(330),r=exports;for(var o in n)r[o]=n[o];n.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})();
@@ -35,6 +35,7 @@
35
35
  },
36
36
  "/v1/erp/updates/events": {
37
37
  "post": {
38
+ "deprecated": true,
38
39
  "operationId": "processErpUpdatesEvents",
39
40
  "requestBody": {
40
41
  "content": {
@@ -46,6 +47,7 @@
46
47
  },
47
48
  "/v2/erp/updates/events": {
48
49
  "post": {
50
+ "deprecated": true,
49
51
  "operationId": "processErpUpdatesEventsV2",
50
52
  "requestBody": {
51
53
  "content": {
@@ -55,6 +57,17 @@
55
57
  "responses": {}
56
58
  }
57
59
  },
60
+ "/v3/erp/updates/events": {
61
+ "post": {
62
+ "operationId": "processErpUpdatesEventsV3",
63
+ "requestBody": {
64
+ "content": {
65
+ "application/json": {}
66
+ }
67
+ },
68
+ "responses": {}
69
+ }
70
+ },
58
71
  "/v2/erp/updates/mapping_simulation": {
59
72
  "post": {
60
73
  "operationId": "simulateMappingV2",
package/dist/openapi.d.ts CHANGED
@@ -18,9 +18,9 @@ declare namespace Components {
18
18
  */
19
19
  event_id: string;
20
20
  /**
21
- * Processing status for the event (skipped indicates duplicate deduplication_id)
21
+ * Processing status for the event (skipped indicates duplicate deduplication_id, ignored indicates unconfigured event)
22
22
  */
23
- status: "success" | "error" | "skipped";
23
+ status: "success" | "error" | "skipped" | "ignored";
24
24
  message?: string;
25
25
  }[];
26
26
  }
@@ -381,6 +381,33 @@ declare namespace Components {
381
381
  */
382
382
  deduplication_id?: string; // ^[a-zA-Z0-9_-]+$
383
383
  }
384
+ export interface ErpEventV3 {
385
+ /**
386
+ * Name of the event (e.g., business_partner, contract_account). Corresponds to the "Event Name" from the integration UI. Replaces object_type from V2.
387
+ */
388
+ event_name: string;
389
+ /**
390
+ * Timestamp when the event occurred
391
+ */
392
+ timestamp: string; // date-time
393
+ /**
394
+ * Format of the payload data
395
+ */
396
+ format: "json" | "xml";
397
+ /**
398
+ * The object data payload - can be either a serialized string or a direct JSON object
399
+ */
400
+ payload: /* The object data payload - can be either a serialized string or a direct JSON object */ string | {
401
+ [name: string]: any;
402
+ };
403
+ /**
404
+ * Optional unique identifier for idempotency - prevents duplicate processing of the same event within 24 hours in context of the same integration. Must contain only alphanumeric characters, hyphens, and underscores.
405
+ *
406
+ * example:
407
+ * evt-2025-05-01-12345-bp
408
+ */
409
+ deduplication_id?: string; // ^[a-zA-Z0-9_-]+$
410
+ }
384
411
  export interface ErpUpdatesEventsV2Request {
385
412
  /**
386
413
  * UUID that identifies the integration configuration to use
@@ -395,6 +422,20 @@ declare namespace Components {
395
422
  */
396
423
  events: ErpEvent[];
397
424
  }
425
+ export interface ErpUpdatesEventsV3Request {
426
+ /**
427
+ * UUID that identifies the integration configuration to use
428
+ */
429
+ integration_id: string; // uuid
430
+ /**
431
+ * Optional ID that identifies the specific request for debugging purposes
432
+ */
433
+ correlation_id?: string;
434
+ /**
435
+ * List of ERP events to process
436
+ */
437
+ events: ErpEventV3[];
438
+ }
398
439
  export interface ErrorResponseBase {
399
440
  /**
400
441
  * Computer-readable error code
@@ -426,7 +467,7 @@ declare namespace Components {
426
467
  * "status"
427
468
  * ]
428
469
  */
429
- inbound_group_by?: ("use_case_id" | "sync_type" | "status" | "error_category" | "object_type" | "date")[];
470
+ inbound_group_by?: ("use_case_id" | "sync_type" | "status" | "error_category" | "object_type" | "event_name" | "date")[];
430
471
  /**
431
472
  * Fields to group outbound statistics by
432
473
  * example:
@@ -472,9 +513,9 @@ declare namespace Components {
472
513
  */
473
514
  use_case_id?: string | null;
474
515
  /**
475
- * Type of event
516
+ * Type of event (optional for V3 events)
476
517
  */
477
- event_type: "CREATE" | "UPDATE" | "DELETE" | "TRIGGER";
518
+ event_type?: "CREATE" | "UPDATE" | "DELETE" | "TRIGGER";
478
519
  /**
479
520
  * Type of object being synced (e.g., 'contract', 'meter')
480
521
  */
@@ -482,11 +523,11 @@ declare namespace Components {
482
523
  /**
483
524
  * Type of sync operation
484
525
  */
485
- sync_type: "entity" | "meter_reading";
526
+ sync_type: "entity" | "meter_reading" | "webhook" | "api_deprecation";
486
527
  /**
487
528
  * Processing status
488
529
  */
489
- status: "success" | "error" | "skipped";
530
+ status: "success" | "error" | "skipped" | "warning";
490
531
  /**
491
532
  * Error code (when status=error)
492
533
  */
@@ -921,6 +962,10 @@ declare namespace Components {
921
962
  * Number of skipped events
922
963
  */
923
964
  skipped_count: number;
965
+ /**
966
+ * Number of warning events
967
+ */
968
+ warning_count?: number;
924
969
  /**
925
970
  * Success rate as percentage (0-100)
926
971
  */
@@ -1334,6 +1379,10 @@ declare namespace Components {
1334
1379
  * Filter by object type
1335
1380
  */
1336
1381
  object_type?: string;
1382
+ /**
1383
+ * Filter by event name (alias for object_type)
1384
+ */
1385
+ event_name?: string;
1337
1386
  /**
1338
1387
  * Maximum number of results to return
1339
1388
  * example:
@@ -1370,11 +1419,11 @@ declare namespace Components {
1370
1419
  /**
1371
1420
  * Filter by sync type
1372
1421
  */
1373
- sync_type?: "entity" | "meter_reading";
1422
+ sync_type?: "entity" | "meter_reading" | "webhook" | "api_deprecation";
1374
1423
  /**
1375
1424
  * Filter by processing status
1376
1425
  */
1377
- status?: "success" | "error" | "skipped";
1426
+ status?: "success" | "error" | "skipped" | "warning";
1378
1427
  /**
1379
1428
  * Filter by error category (only applicable when status=error)
1380
1429
  */
@@ -1387,6 +1436,10 @@ declare namespace Components {
1387
1436
  * Filter by object type (e.g., 'contract', 'meter')
1388
1437
  */
1389
1438
  object_type?: string;
1439
+ /**
1440
+ * Filter by event name (alias for object_type)
1441
+ */
1442
+ event_name?: string;
1390
1443
  /**
1391
1444
  * Filter by event ID to find a specific event
1392
1445
  */
@@ -2262,7 +2315,6 @@ declare namespace Paths {
2262
2315
  export type $200 = Components.Responses.ERPUpdatesResponse;
2263
2316
  export type $400 = Components.Responses.BadRequest;
2264
2317
  export type $401 = Components.Responses.Unauthorized;
2265
- export type $422 = Components.Responses.ERPUpdatesResponse;
2266
2318
  export type $500 = Components.Responses.InternalServerError;
2267
2319
  }
2268
2320
  }
@@ -2272,7 +2324,15 @@ declare namespace Paths {
2272
2324
  export type $200 = Components.Responses.ERPUpdatesResponse;
2273
2325
  export type $400 = Components.Responses.BadRequest;
2274
2326
  export type $401 = Components.Responses.Unauthorized;
2275
- export type $422 = Components.Responses.ERPUpdatesResponse;
2327
+ export type $500 = Components.Responses.InternalServerError;
2328
+ }
2329
+ }
2330
+ namespace ProcessErpUpdatesEventsV3 {
2331
+ export type RequestBody = Components.Schemas.ErpUpdatesEventsV3Request;
2332
+ namespace Responses {
2333
+ export type $200 = Components.Responses.ERPUpdatesResponse;
2334
+ export type $400 = Components.Responses.BadRequest;
2335
+ export type $401 = Components.Responses.Unauthorized;
2276
2336
  export type $500 = Components.Responses.InternalServerError;
2277
2337
  }
2278
2338
  }
@@ -2516,6 +2576,19 @@ export interface OperationMethods {
2516
2576
  data?: Paths.ProcessErpUpdatesEventsV2.RequestBody,
2517
2577
  config?: AxiosRequestConfig
2518
2578
  ): OperationResponse<Paths.ProcessErpUpdatesEventsV2.Responses.$200>
2579
+ /**
2580
+ * processErpUpdatesEventsV3 - processErpUpdatesEventsV3
2581
+ *
2582
+ * Handles updates from ERP systems using integration_id directly.
2583
+ * This is the v3 version that removes the unused event_type field and renames object_type to event_name
2584
+ * to align with the integration UI naming.
2585
+ *
2586
+ */
2587
+ 'processErpUpdatesEventsV3'(
2588
+ parameters?: Parameters<UnknownParamsObject> | null,
2589
+ data?: Paths.ProcessErpUpdatesEventsV3.RequestBody,
2590
+ config?: AxiosRequestConfig
2591
+ ): OperationResponse<Paths.ProcessErpUpdatesEventsV3.Responses.$200>
2519
2592
  /**
2520
2593
  * simulateMappingV2 - simulateMappingV2
2521
2594
  *
@@ -2878,6 +2951,21 @@ export interface PathsDictionary {
2878
2951
  config?: AxiosRequestConfig
2879
2952
  ): OperationResponse<Paths.ProcessErpUpdatesEventsV2.Responses.$200>
2880
2953
  }
2954
+ ['/v3/erp/updates/events']: {
2955
+ /**
2956
+ * processErpUpdatesEventsV3 - processErpUpdatesEventsV3
2957
+ *
2958
+ * Handles updates from ERP systems using integration_id directly.
2959
+ * This is the v3 version that removes the unused event_type field and renames object_type to event_name
2960
+ * to align with the integration UI naming.
2961
+ *
2962
+ */
2963
+ 'post'(
2964
+ parameters?: Parameters<UnknownParamsObject> | null,
2965
+ data?: Paths.ProcessErpUpdatesEventsV3.RequestBody,
2966
+ config?: AxiosRequestConfig
2967
+ ): OperationResponse<Paths.ProcessErpUpdatesEventsV3.Responses.$200>
2968
+ }
2881
2969
  ['/v2/erp/updates/mapping_simulation']: {
2882
2970
  /**
2883
2971
  * simulateMappingV2 - simulateMappingV2
@@ -3239,7 +3327,9 @@ export type EmbeddedUseCaseRequest = Components.Schemas.EmbeddedUseCaseRequest;
3239
3327
  export type EmbeddedUseCaseRequestBase = Components.Schemas.EmbeddedUseCaseRequestBase;
3240
3328
  export type EntityUpdate = Components.Schemas.EntityUpdate;
3241
3329
  export type ErpEvent = Components.Schemas.ErpEvent;
3330
+ export type ErpEventV3 = Components.Schemas.ErpEventV3;
3242
3331
  export type ErpUpdatesEventsV2Request = Components.Schemas.ErpUpdatesEventsV2Request;
3332
+ export type ErpUpdatesEventsV3Request = Components.Schemas.ErpUpdatesEventsV3Request;
3243
3333
  export type ErrorResponseBase = Components.Schemas.ErrorResponseBase;
3244
3334
  export type GetMonitoringStatsRequest = Components.Schemas.GetMonitoringStatsRequest;
3245
3335
  export type InboundIntegrationEventConfiguration = Components.Schemas.InboundIntegrationEventConfiguration;
package/dist/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.0.3",
3
3
  "info": {
4
4
  "title": "ERP Integration API",
5
- "version": "0.30.0",
5
+ "version": "0.33.0",
6
6
  "description": "API for integrating with ERP systems, handling tracking acknowledgments, triggering ERP processes, and processing ERP updates."
7
7
  },
8
8
  "tags": [
@@ -128,6 +128,7 @@
128
128
  },
129
129
  "/v1/erp/updates/events": {
130
130
  "post": {
131
+ "deprecated": true,
131
132
  "operationId": "processErpUpdatesEvents",
132
133
  "summary": "processErpUpdatesEvents",
133
134
  "description": "Handles updates from ERP systems and tracks them appropriately",
@@ -214,9 +215,6 @@
214
215
  "401": {
215
216
  "$ref": "#/components/responses/Unauthorized"
216
217
  },
217
- "422": {
218
- "$ref": "#/components/responses/ERPUpdatesResponse"
219
- },
220
218
  "500": {
221
219
  "$ref": "#/components/responses/InternalServerError"
222
220
  }
@@ -225,6 +223,7 @@
225
223
  },
226
224
  "/v2/erp/updates/events": {
227
225
  "post": {
226
+ "deprecated": true,
228
227
  "operationId": "processErpUpdatesEventsV2",
229
228
  "summary": "processErpUpdatesEventsV2",
230
229
  "description": "Handles updates from ERP systems using integration_id directly.\nThis is the v2 version that simplifies the API by accepting integration_id\ninstead of app_id and component_id.\n",
@@ -272,9 +271,59 @@
272
271
  "401": {
273
272
  "$ref": "#/components/responses/Unauthorized"
274
273
  },
275
- "422": {
274
+ "500": {
275
+ "$ref": "#/components/responses/InternalServerError"
276
+ }
277
+ }
278
+ }
279
+ },
280
+ "/v3/erp/updates/events": {
281
+ "post": {
282
+ "operationId": "processErpUpdatesEventsV3",
283
+ "summary": "processErpUpdatesEventsV3",
284
+ "description": "Handles updates from ERP systems using integration_id directly.\nThis is the v3 version that removes the unused event_type field and renames object_type to event_name\nto align with the integration UI naming.\n",
285
+ "tags": [
286
+ "erp"
287
+ ],
288
+ "requestBody": {
289
+ "content": {
290
+ "application/json": {
291
+ "schema": {
292
+ "$ref": "#/components/schemas/ErpUpdatesEventsV3Request"
293
+ },
294
+ "example": {
295
+ "integration_id": "123e4567-e89b-12d3-a456-426614174000",
296
+ "correlation_id": "req-789e4567-e89b-12d3-a456-426614174000",
297
+ "events": [
298
+ {
299
+ "event_name": "business_partner",
300
+ "timestamp": "2025-05-01T08:30:00Z",
301
+ "format": "json",
302
+ "payload": "{\"id\":\"BP10001\",\"name\":\"Acme Corporation\",\"type\":\"organization\",\"tax_id\":\"DE123456789\",\"status\":\"active\"}",
303
+ "deduplication_id": "bp-create-20250501-083000-001"
304
+ },
305
+ {
306
+ "event_name": "contract_account",
307
+ "timestamp": "2025-05-01T08:35:00Z",
308
+ "format": "json",
309
+ "payload": "{\"id\":\"CA20001\",\"business_partner_id\":\"BP10001\",\"status\":\"active\",\"payment_method\":\"direct_debit\"}",
310
+ "deduplication_id": "ca-update-20250501-083500-001"
311
+ }
312
+ ]
313
+ }
314
+ }
315
+ }
316
+ },
317
+ "responses": {
318
+ "200": {
276
319
  "$ref": "#/components/responses/ERPUpdatesResponse"
277
320
  },
321
+ "400": {
322
+ "$ref": "#/components/responses/BadRequest"
323
+ },
324
+ "401": {
325
+ "$ref": "#/components/responses/Unauthorized"
326
+ },
278
327
  "500": {
279
328
  "$ref": "#/components/responses/InternalServerError"
280
329
  }
@@ -2260,6 +2309,82 @@
2260
2309
  }
2261
2310
  }
2262
2311
  },
2312
+ "ErpEventV3": {
2313
+ "type": "object",
2314
+ "required": [
2315
+ "event_name",
2316
+ "timestamp",
2317
+ "format",
2318
+ "payload"
2319
+ ],
2320
+ "properties": {
2321
+ "event_name": {
2322
+ "type": "string",
2323
+ "description": "Name of the event (e.g., business_partner, contract_account). Corresponds to the \"Event Name\" from the integration UI. Replaces object_type from V2."
2324
+ },
2325
+ "timestamp": {
2326
+ "type": "string",
2327
+ "format": "date-time",
2328
+ "description": "Timestamp when the event occurred"
2329
+ },
2330
+ "format": {
2331
+ "type": "string",
2332
+ "enum": [
2333
+ "json",
2334
+ "xml"
2335
+ ],
2336
+ "default": "json",
2337
+ "description": "Format of the payload data"
2338
+ },
2339
+ "payload": {
2340
+ "oneOf": [
2341
+ {
2342
+ "type": "string",
2343
+ "description": "The serialized object data payload (JSON, XML, etc.) as a string"
2344
+ },
2345
+ {
2346
+ "type": "object",
2347
+ "description": "Direct JSON object (will be automatically serialized)",
2348
+ "additionalProperties": true
2349
+ }
2350
+ ],
2351
+ "description": "The object data payload - can be either a serialized string or a direct JSON object"
2352
+ },
2353
+ "deduplication_id": {
2354
+ "type": "string",
2355
+ "pattern": "^[a-zA-Z0-9_-]+$",
2356
+ "minLength": 1,
2357
+ "maxLength": 255,
2358
+ "description": "Optional unique identifier for idempotency - prevents duplicate processing of the same event within 24 hours in context of the same integration. Must contain only alphanumeric characters, hyphens, and underscores.\n",
2359
+ "example": "evt-2025-05-01-12345-bp"
2360
+ }
2361
+ }
2362
+ },
2363
+ "ErpUpdatesEventsV3Request": {
2364
+ "type": "object",
2365
+ "required": [
2366
+ "integration_id",
2367
+ "events"
2368
+ ],
2369
+ "properties": {
2370
+ "integration_id": {
2371
+ "type": "string",
2372
+ "format": "uuid",
2373
+ "description": "UUID that identifies the integration configuration to use"
2374
+ },
2375
+ "correlation_id": {
2376
+ "type": "string",
2377
+ "description": "Optional ID that identifies the specific request for debugging purposes"
2378
+ },
2379
+ "events": {
2380
+ "type": "array",
2381
+ "description": "List of ERP events to process",
2382
+ "items": {
2383
+ "$ref": "#/components/schemas/ErpEventV3"
2384
+ }
2385
+ }
2386
+ }
2387
+ },
2263
2388
  "TriggerErpActionRequest": {
2264
2389
  "type": "object",
2265
2390
  "required": [
@@ -4038,6 +4163,10 @@
4038
4163
  "type": "string",
4039
4164
  "description": "Filter by object type"
4040
4165
  },
4166
+ "event_name": {
4167
+ "type": "string",
4168
+ "description": "Filter by event name (alias for object_type)"
4169
+ },
4041
4170
  "limit": {
4042
4171
  "type": "integer",
4043
4172
  "description": "Maximum number of results to return",
@@ -4087,7 +4216,9 @@
4087
4216
  "type": "string",
4088
4217
  "enum": [
4089
4218
  "entity",
4090
- "meter_reading"
4219
+ "meter_reading",
4220
+ "webhook",
4221
+ "api_deprecation"
4091
4222
  ],
4092
4223
  "description": "Filter by sync type"
4093
4224
  },
@@ -4096,7 +4227,8 @@
4096
4227
  "enum": [
4097
4228
  "success",
4098
4229
  "error",
4099
- "skipped"
4230
+ "skipped",
4231
+ "warning"
4100
4232
  ],
4101
4233
  "description": "Filter by processing status"
4102
4234
  },
@@ -4119,6 +4251,10 @@
4119
4251
  "type": "string",
4120
4252
  "description": "Filter by object type (e.g., 'contract', 'meter')"
4121
4253
  },
4254
+ "event_name": {
4255
+ "type": "string",
4256
+ "description": "Filter by event name (alias for object_type)"
4257
+ },
4122
4258
  "event_id": {
4123
4259
  "type": "string",
4124
4260
  "description": "Filter by event ID to find a specific event"
@@ -4316,6 +4452,7 @@
4316
4452
  "status",
4317
4453
  "error_category",
4318
4454
  "object_type",
4455
+ "event_name",
4319
4456
  "date"
4320
4457
  ]
4321
4458
  },
@@ -4514,6 +4651,10 @@
4514
4651
  "type": "integer",
4515
4652
  "description": "Number of skipped events"
4516
4653
  },
4654
+ "warning_count": {
4655
+ "type": "integer",
4656
+ "description": "Number of warning events"
4657
+ },
4517
4658
  "success_rate": {
4518
4659
  "type": "number",
4519
4660
  "format": "float",
@@ -4588,7 +4729,6 @@
4588
4729
  "required": [
4589
4730
  "org_id",
4590
4731
  "event_id",
4591
- "event_type",
4592
4732
  "object_type",
4593
4733
  "sync_type",
4594
4734
  "status",
@@ -4627,7 +4767,7 @@
4627
4767
  "DELETE",
4628
4768
  "TRIGGER"
4629
4769
  ],
4630
- "description": "Type of event"
4770
+ "description": "Type of event (optional for V3 events)"
4631
4771
  },
4632
4772
  "object_type": {
4633
4773
  "type": "string",
@@ -4637,7 +4777,9 @@
4637
4777
  "type": "string",
4638
4778
  "enum": [
4639
4779
  "entity",
4640
- "meter_reading"
4780
+ "meter_reading",
4781
+ "webhook",
4782
+ "api_deprecation"
4641
4783
  ],
4642
4784
  "description": "Type of sync operation"
4643
4785
  },
@@ -4646,7 +4788,8 @@
4646
4788
  "enum": [
4647
4789
  "success",
4648
4790
  "error",
4649
- "skipped"
4791
+ "skipped",
4792
+ "warning"
4650
4793
  ],
4651
4794
  "description": "Processing status"
4652
4795
  },
@@ -4900,9 +5043,10 @@
4900
5043
  "enum": [
4901
5044
  "success",
4902
5045
  "error",
4903
- "skipped"
5046
+ "skipped",
5047
+ "ignored"
4904
5048
  ],
4905
- "description": "Processing status for the event (skipped indicates duplicate deduplication_id)"
5049
+ "description": "Processing status for the event (skipped indicates duplicate deduplication_id, ignored indicates unconfigured event)"
4906
5050
  },
4907
5051
  "message": {
4908
5052
  "type": "string"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/erp-integration-client",
3
- "version": "0.17.0",
3
+ "version": "0.19.0",
4
4
  "description": "Client library for ePilot ERP Integration API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",