@epilot/erp-integration-client 0.16.1 → 0.18.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.
- package/dist/definition.js +1 -1
- package/dist/openapi-runtime.json +11 -0
- package/dist/openapi.d.ts +147 -3
- package/dist/openapi.json +197 -3
- package/package.json +2 -2
package/dist/definition.js
CHANGED
|
@@ -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":{"operationId":"processErpUpdatesEvents","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v2/erp/updates/events":{"post":{"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})})();
|
|
@@ -55,6 +55,17 @@
|
|
|
55
55
|
"responses": {}
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
|
+
"/v3/erp/updates/events": {
|
|
59
|
+
"post": {
|
|
60
|
+
"operationId": "processErpUpdatesEventsV3",
|
|
61
|
+
"requestBody": {
|
|
62
|
+
"content": {
|
|
63
|
+
"application/json": {}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"responses": {}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
58
69
|
"/v2/erp/updates/mapping_simulation": {
|
|
59
70
|
"post": {
|
|
60
71
|
"operationId": "simulateMappingV2",
|
package/dist/openapi.d.ts
CHANGED
|
@@ -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,13 @@ 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)
|
|
517
|
+
*/
|
|
518
|
+
event_type?: "CREATE" | "UPDATE" | "DELETE" | "TRIGGER";
|
|
519
|
+
/**
|
|
520
|
+
* Event name (alias for object_type, used in V3+)
|
|
476
521
|
*/
|
|
477
|
-
|
|
522
|
+
event_name?: string;
|
|
478
523
|
/**
|
|
479
524
|
* Type of object being synced (e.g., 'contract', 'meter')
|
|
480
525
|
*/
|
|
@@ -671,6 +716,23 @@ declare namespace Components {
|
|
|
671
716
|
* Controls whether this entity mapping should be processed. Can be a boolean or a JSONata expression (string) that evaluates to a boolean.
|
|
672
717
|
*/
|
|
673
718
|
enabled?: /* Controls whether this entity mapping should be processed. Can be a boolean or a JSONata expression (string) that evaluates to a boolean. */ boolean | string;
|
|
719
|
+
/**
|
|
720
|
+
* Operation mode for entity mapping:
|
|
721
|
+
* - 'upsert': Create or update the entity (default)
|
|
722
|
+
* - 'delete': Soft delete the entity (marks as deleted)
|
|
723
|
+
* - 'purge': Hard delete the entity (permanent removal)
|
|
724
|
+
* - 'upsert-prune-scope-purge': Upsert entities from array, then purge entities in scope that weren't upserted
|
|
725
|
+
* - 'upsert-prune-scope-delete': Upsert entities from array, then soft delete entities in scope that weren't upserted
|
|
726
|
+
*
|
|
727
|
+
*/
|
|
728
|
+
mode?: "upsert" | "delete" | "purge" | "upsert-prune-scope-purge" | "upsert-prune-scope-delete";
|
|
729
|
+
scope?: /**
|
|
730
|
+
* Scope configuration for upsert-prune-scope modes.
|
|
731
|
+
* Defines how to find entities that should be pruned if not in the upsert payload.
|
|
732
|
+
* The scope is resolved against the original event payload (not individual array items).
|
|
733
|
+
*
|
|
734
|
+
*/
|
|
735
|
+
PruneScopeConfig;
|
|
674
736
|
/**
|
|
675
737
|
* Field mapping definitions
|
|
676
738
|
*/
|
|
@@ -1203,6 +1265,39 @@ declare namespace Components {
|
|
|
1203
1265
|
*/
|
|
1204
1266
|
conflicts?: OutboundConflict[];
|
|
1205
1267
|
}
|
|
1268
|
+
/**
|
|
1269
|
+
* Scope configuration for upsert-prune-scope modes.
|
|
1270
|
+
* Defines how to find entities that should be pruned if not in the upsert payload.
|
|
1271
|
+
* The scope is resolved against the original event payload (not individual array items).
|
|
1272
|
+
*
|
|
1273
|
+
*/
|
|
1274
|
+
export interface PruneScopeConfig {
|
|
1275
|
+
/**
|
|
1276
|
+
* Scope mode for finding entities to prune:
|
|
1277
|
+
* - 'relations': Find scope by looking at all entities related to a specific entity (both direct and reverse relations)
|
|
1278
|
+
* - 'query': Find scope entities directly via query parameters
|
|
1279
|
+
*
|
|
1280
|
+
*/
|
|
1281
|
+
scope_mode: "relations" | "query";
|
|
1282
|
+
/**
|
|
1283
|
+
* For 'relations' mode: The schema of the entity to find (e.g., 'billing_account').
|
|
1284
|
+
* Not used for 'query' mode.
|
|
1285
|
+
*
|
|
1286
|
+
*/
|
|
1287
|
+
schema?: string;
|
|
1288
|
+
/**
|
|
1289
|
+
* For 'relations' mode: How to identify the scope entity from the payload.
|
|
1290
|
+
* Not used for 'query' mode.
|
|
1291
|
+
*
|
|
1292
|
+
*/
|
|
1293
|
+
unique_ids?: RelationUniqueIdField[];
|
|
1294
|
+
/**
|
|
1295
|
+
* For 'query' mode: Direct query parameters to find scope entities.
|
|
1296
|
+
* Not used for 'relations' or 'reverse-relations' modes.
|
|
1297
|
+
*
|
|
1298
|
+
*/
|
|
1299
|
+
query?: RelationUniqueIdField[];
|
|
1300
|
+
}
|
|
1206
1301
|
export interface QueryAccessLogsRequest {
|
|
1207
1302
|
/**
|
|
1208
1303
|
* Filter by a specific access token ID (e.g., 'api_5ZugdRXasLfWBypHi93Fk').
|
|
@@ -1284,6 +1379,10 @@ declare namespace Components {
|
|
|
1284
1379
|
* Filter by object type
|
|
1285
1380
|
*/
|
|
1286
1381
|
object_type?: string;
|
|
1382
|
+
/**
|
|
1383
|
+
* Filter by event name (alias for object_type)
|
|
1384
|
+
*/
|
|
1385
|
+
event_name?: string;
|
|
1287
1386
|
/**
|
|
1288
1387
|
* Maximum number of results to return
|
|
1289
1388
|
* example:
|
|
@@ -1337,6 +1436,10 @@ declare namespace Components {
|
|
|
1337
1436
|
* Filter by object type (e.g., 'contract', 'meter')
|
|
1338
1437
|
*/
|
|
1339
1438
|
object_type?: string;
|
|
1439
|
+
/**
|
|
1440
|
+
* Filter by event name (alias for object_type)
|
|
1441
|
+
*/
|
|
1442
|
+
event_name?: string;
|
|
1340
1443
|
/**
|
|
1341
1444
|
* Filter by event ID to find a specific event
|
|
1342
1445
|
*/
|
|
@@ -2226,6 +2329,16 @@ declare namespace Paths {
|
|
|
2226
2329
|
export type $500 = Components.Responses.InternalServerError;
|
|
2227
2330
|
}
|
|
2228
2331
|
}
|
|
2332
|
+
namespace ProcessErpUpdatesEventsV3 {
|
|
2333
|
+
export type RequestBody = Components.Schemas.ErpUpdatesEventsV3Request;
|
|
2334
|
+
namespace Responses {
|
|
2335
|
+
export type $200 = Components.Responses.ERPUpdatesResponse;
|
|
2336
|
+
export type $400 = Components.Responses.BadRequest;
|
|
2337
|
+
export type $401 = Components.Responses.Unauthorized;
|
|
2338
|
+
export type $422 = Components.Responses.ERPUpdatesResponse;
|
|
2339
|
+
export type $500 = Components.Responses.InternalServerError;
|
|
2340
|
+
}
|
|
2341
|
+
}
|
|
2229
2342
|
namespace QueryAccessLogs {
|
|
2230
2343
|
namespace Parameters {
|
|
2231
2344
|
export type IntegrationId = string; // uuid
|
|
@@ -2466,6 +2579,19 @@ export interface OperationMethods {
|
|
|
2466
2579
|
data?: Paths.ProcessErpUpdatesEventsV2.RequestBody,
|
|
2467
2580
|
config?: AxiosRequestConfig
|
|
2468
2581
|
): OperationResponse<Paths.ProcessErpUpdatesEventsV2.Responses.$200>
|
|
2582
|
+
/**
|
|
2583
|
+
* processErpUpdatesEventsV3 - processErpUpdatesEventsV3
|
|
2584
|
+
*
|
|
2585
|
+
* Handles updates from ERP systems using integration_id directly.
|
|
2586
|
+
* This is the v3 version that removes the unused event_type field and renames object_type to event_name
|
|
2587
|
+
* to align with the integration UI naming.
|
|
2588
|
+
*
|
|
2589
|
+
*/
|
|
2590
|
+
'processErpUpdatesEventsV3'(
|
|
2591
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
2592
|
+
data?: Paths.ProcessErpUpdatesEventsV3.RequestBody,
|
|
2593
|
+
config?: AxiosRequestConfig
|
|
2594
|
+
): OperationResponse<Paths.ProcessErpUpdatesEventsV3.Responses.$200>
|
|
2469
2595
|
/**
|
|
2470
2596
|
* simulateMappingV2 - simulateMappingV2
|
|
2471
2597
|
*
|
|
@@ -2828,6 +2954,21 @@ export interface PathsDictionary {
|
|
|
2828
2954
|
config?: AxiosRequestConfig
|
|
2829
2955
|
): OperationResponse<Paths.ProcessErpUpdatesEventsV2.Responses.$200>
|
|
2830
2956
|
}
|
|
2957
|
+
['/v3/erp/updates/events']: {
|
|
2958
|
+
/**
|
|
2959
|
+
* processErpUpdatesEventsV3 - processErpUpdatesEventsV3
|
|
2960
|
+
*
|
|
2961
|
+
* Handles updates from ERP systems using integration_id directly.
|
|
2962
|
+
* This is the v3 version that removes the unused event_type field and renames object_type to event_name
|
|
2963
|
+
* to align with the integration UI naming.
|
|
2964
|
+
*
|
|
2965
|
+
*/
|
|
2966
|
+
'post'(
|
|
2967
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
2968
|
+
data?: Paths.ProcessErpUpdatesEventsV3.RequestBody,
|
|
2969
|
+
config?: AxiosRequestConfig
|
|
2970
|
+
): OperationResponse<Paths.ProcessErpUpdatesEventsV3.Responses.$200>
|
|
2971
|
+
}
|
|
2831
2972
|
['/v2/erp/updates/mapping_simulation']: {
|
|
2832
2973
|
/**
|
|
2833
2974
|
* simulateMappingV2 - simulateMappingV2
|
|
@@ -3189,7 +3330,9 @@ export type EmbeddedUseCaseRequest = Components.Schemas.EmbeddedUseCaseRequest;
|
|
|
3189
3330
|
export type EmbeddedUseCaseRequestBase = Components.Schemas.EmbeddedUseCaseRequestBase;
|
|
3190
3331
|
export type EntityUpdate = Components.Schemas.EntityUpdate;
|
|
3191
3332
|
export type ErpEvent = Components.Schemas.ErpEvent;
|
|
3333
|
+
export type ErpEventV3 = Components.Schemas.ErpEventV3;
|
|
3192
3334
|
export type ErpUpdatesEventsV2Request = Components.Schemas.ErpUpdatesEventsV2Request;
|
|
3335
|
+
export type ErpUpdatesEventsV3Request = Components.Schemas.ErpUpdatesEventsV3Request;
|
|
3193
3336
|
export type ErrorResponseBase = Components.Schemas.ErrorResponseBase;
|
|
3194
3337
|
export type GetMonitoringStatsRequest = Components.Schemas.GetMonitoringStatsRequest;
|
|
3195
3338
|
export type InboundIntegrationEventConfiguration = Components.Schemas.InboundIntegrationEventConfiguration;
|
|
@@ -3220,6 +3363,7 @@ export type OutboundStatusResponse = Components.Schemas.OutboundStatusResponse;
|
|
|
3220
3363
|
export type OutboundUseCase = Components.Schemas.OutboundUseCase;
|
|
3221
3364
|
export type OutboundUseCaseHistoryEntry = Components.Schemas.OutboundUseCaseHistoryEntry;
|
|
3222
3365
|
export type OutboundUseCaseStatus = Components.Schemas.OutboundUseCaseStatus;
|
|
3366
|
+
export type PruneScopeConfig = Components.Schemas.PruneScopeConfig;
|
|
3223
3367
|
export type QueryAccessLogsRequest = Components.Schemas.QueryAccessLogsRequest;
|
|
3224
3368
|
export type QueryEventsRequest = Components.Schemas.QueryEventsRequest;
|
|
3225
3369
|
export type QueryInboundMonitoringEventsRequest = Components.Schemas.QueryInboundMonitoringEventsRequest;
|
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.
|
|
5
|
+
"version": "0.31.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": [
|
|
@@ -281,6 +281,62 @@
|
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
},
|
|
284
|
+
"/v3/erp/updates/events": {
|
|
285
|
+
"post": {
|
|
286
|
+
"operationId": "processErpUpdatesEventsV3",
|
|
287
|
+
"summary": "processErpUpdatesEventsV3",
|
|
288
|
+
"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",
|
|
289
|
+
"tags": [
|
|
290
|
+
"erp"
|
|
291
|
+
],
|
|
292
|
+
"requestBody": {
|
|
293
|
+
"content": {
|
|
294
|
+
"application/json": {
|
|
295
|
+
"schema": {
|
|
296
|
+
"$ref": "#/components/schemas/ErpUpdatesEventsV3Request"
|
|
297
|
+
},
|
|
298
|
+
"example": {
|
|
299
|
+
"integration_id": "123e4567-e89b-12d3-a456-426614174000",
|
|
300
|
+
"correlation_id": "req-789e4567-e89b-12d3-a456-426614174000",
|
|
301
|
+
"events": [
|
|
302
|
+
{
|
|
303
|
+
"event_name": "business_partner",
|
|
304
|
+
"timestamp": "2025-05-01T08:30:00Z",
|
|
305
|
+
"format": "json",
|
|
306
|
+
"payload": "{\"id\":\"BP10001\",\"name\":\"Acme Corporation\",\"type\":\"organization\",\"tax_id\":\"DE123456789\",\"status\":\"active\"}",
|
|
307
|
+
"deduplication_id": "bp-create-20250501-083000-001"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"event_name": "contract_account",
|
|
311
|
+
"timestamp": "2025-05-01T08:35:00Z",
|
|
312
|
+
"format": "json",
|
|
313
|
+
"payload": "{\"id\":\"CA20001\",\"business_partner_id\":\"BP10001\",\"status\":\"active\",\"payment_method\":\"direct_debit\"}",
|
|
314
|
+
"deduplication_id": "ca-update-20250501-083500-001"
|
|
315
|
+
}
|
|
316
|
+
]
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
"responses": {
|
|
322
|
+
"200": {
|
|
323
|
+
"$ref": "#/components/responses/ERPUpdatesResponse"
|
|
324
|
+
},
|
|
325
|
+
"400": {
|
|
326
|
+
"$ref": "#/components/responses/BadRequest"
|
|
327
|
+
},
|
|
328
|
+
"401": {
|
|
329
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
330
|
+
},
|
|
331
|
+
"422": {
|
|
332
|
+
"$ref": "#/components/responses/ERPUpdatesResponse"
|
|
333
|
+
},
|
|
334
|
+
"500": {
|
|
335
|
+
"$ref": "#/components/responses/InternalServerError"
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
},
|
|
284
340
|
"/v2/erp/updates/mapping_simulation": {
|
|
285
341
|
"post": {
|
|
286
342
|
"operationId": "simulateMappingV2",
|
|
@@ -2260,6 +2316,82 @@
|
|
|
2260
2316
|
}
|
|
2261
2317
|
}
|
|
2262
2318
|
},
|
|
2319
|
+
"ErpEventV3": {
|
|
2320
|
+
"type": "object",
|
|
2321
|
+
"required": [
|
|
2322
|
+
"event_name",
|
|
2323
|
+
"timestamp",
|
|
2324
|
+
"format",
|
|
2325
|
+
"payload"
|
|
2326
|
+
],
|
|
2327
|
+
"properties": {
|
|
2328
|
+
"event_name": {
|
|
2329
|
+
"type": "string",
|
|
2330
|
+
"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."
|
|
2331
|
+
},
|
|
2332
|
+
"timestamp": {
|
|
2333
|
+
"type": "string",
|
|
2334
|
+
"format": "date-time",
|
|
2335
|
+
"description": "Timestamp when the event occurred"
|
|
2336
|
+
},
|
|
2337
|
+
"format": {
|
|
2338
|
+
"type": "string",
|
|
2339
|
+
"enum": [
|
|
2340
|
+
"json",
|
|
2341
|
+
"xml"
|
|
2342
|
+
],
|
|
2343
|
+
"default": "json",
|
|
2344
|
+
"description": "Format of the payload data"
|
|
2345
|
+
},
|
|
2346
|
+
"payload": {
|
|
2347
|
+
"oneOf": [
|
|
2348
|
+
{
|
|
2349
|
+
"type": "string",
|
|
2350
|
+
"description": "The serialized object data payload (JSON, XML, etc.) as a string"
|
|
2351
|
+
},
|
|
2352
|
+
{
|
|
2353
|
+
"type": "object",
|
|
2354
|
+
"description": "Direct JSON object (will be automatically serialized)",
|
|
2355
|
+
"additionalProperties": true
|
|
2356
|
+
}
|
|
2357
|
+
],
|
|
2358
|
+
"description": "The object data payload - can be either a serialized string or a direct JSON object"
|
|
2359
|
+
},
|
|
2360
|
+
"deduplication_id": {
|
|
2361
|
+
"type": "string",
|
|
2362
|
+
"pattern": "^[a-zA-Z0-9_-]+$",
|
|
2363
|
+
"minLength": 1,
|
|
2364
|
+
"maxLength": 255,
|
|
2365
|
+
"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",
|
|
2366
|
+
"example": "evt-2025-05-01-12345-bp"
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
},
|
|
2370
|
+
"ErpUpdatesEventsV3Request": {
|
|
2371
|
+
"type": "object",
|
|
2372
|
+
"required": [
|
|
2373
|
+
"integration_id",
|
|
2374
|
+
"events"
|
|
2375
|
+
],
|
|
2376
|
+
"properties": {
|
|
2377
|
+
"integration_id": {
|
|
2378
|
+
"type": "string",
|
|
2379
|
+
"format": "uuid",
|
|
2380
|
+
"description": "UUID that identifies the integration configuration to use"
|
|
2381
|
+
},
|
|
2382
|
+
"correlation_id": {
|
|
2383
|
+
"type": "string",
|
|
2384
|
+
"description": "Optional ID that identifies the specific request for debugging purposes"
|
|
2385
|
+
},
|
|
2386
|
+
"events": {
|
|
2387
|
+
"type": "array",
|
|
2388
|
+
"description": "List of ERP events to process",
|
|
2389
|
+
"items": {
|
|
2390
|
+
"$ref": "#/components/schemas/ErpEventV3"
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2394
|
+
},
|
|
2263
2395
|
"TriggerErpActionRequest": {
|
|
2264
2396
|
"type": "object",
|
|
2265
2397
|
"required": [
|
|
@@ -3477,6 +3609,21 @@
|
|
|
3477
3609
|
],
|
|
3478
3610
|
"description": "Controls whether this entity mapping should be processed. Can be a boolean or a JSONata expression (string) that evaluates to a boolean."
|
|
3479
3611
|
},
|
|
3612
|
+
"mode": {
|
|
3613
|
+
"type": "string",
|
|
3614
|
+
"enum": [
|
|
3615
|
+
"upsert",
|
|
3616
|
+
"delete",
|
|
3617
|
+
"purge",
|
|
3618
|
+
"upsert-prune-scope-purge",
|
|
3619
|
+
"upsert-prune-scope-delete"
|
|
3620
|
+
],
|
|
3621
|
+
"default": "upsert",
|
|
3622
|
+
"description": "Operation mode for entity mapping:\n- 'upsert': Create or update the entity (default)\n- 'delete': Soft delete the entity (marks as deleted)\n- 'purge': Hard delete the entity (permanent removal)\n- 'upsert-prune-scope-purge': Upsert entities from array, then purge entities in scope that weren't upserted\n- 'upsert-prune-scope-delete': Upsert entities from array, then soft delete entities in scope that weren't upserted\n"
|
|
3623
|
+
},
|
|
3624
|
+
"scope": {
|
|
3625
|
+
"$ref": "#/components/schemas/PruneScopeConfig"
|
|
3626
|
+
},
|
|
3480
3627
|
"fields": {
|
|
3481
3628
|
"type": "array",
|
|
3482
3629
|
"description": "Field mapping definitions",
|
|
@@ -3486,6 +3633,41 @@
|
|
|
3486
3633
|
}
|
|
3487
3634
|
}
|
|
3488
3635
|
},
|
|
3636
|
+
"PruneScopeConfig": {
|
|
3637
|
+
"type": "object",
|
|
3638
|
+
"description": "Scope configuration for upsert-prune-scope modes.\nDefines how to find entities that should be pruned if not in the upsert payload.\nThe scope is resolved against the original event payload (not individual array items).\n",
|
|
3639
|
+
"required": [
|
|
3640
|
+
"scope_mode"
|
|
3641
|
+
],
|
|
3642
|
+
"properties": {
|
|
3643
|
+
"scope_mode": {
|
|
3644
|
+
"type": "string",
|
|
3645
|
+
"enum": [
|
|
3646
|
+
"relations",
|
|
3647
|
+
"query"
|
|
3648
|
+
],
|
|
3649
|
+
"description": "Scope mode for finding entities to prune:\n- 'relations': Find scope by looking at all entities related to a specific entity (both direct and reverse relations)\n- 'query': Find scope entities directly via query parameters\n"
|
|
3650
|
+
},
|
|
3651
|
+
"schema": {
|
|
3652
|
+
"type": "string",
|
|
3653
|
+
"description": "For 'relations' mode: The schema of the entity to find (e.g., 'billing_account').\nNot used for 'query' mode.\n"
|
|
3654
|
+
},
|
|
3655
|
+
"unique_ids": {
|
|
3656
|
+
"type": "array",
|
|
3657
|
+
"description": "For 'relations' mode: How to identify the scope entity from the payload.\nNot used for 'query' mode.\n",
|
|
3658
|
+
"items": {
|
|
3659
|
+
"$ref": "#/components/schemas/RelationUniqueIdField"
|
|
3660
|
+
}
|
|
3661
|
+
},
|
|
3662
|
+
"query": {
|
|
3663
|
+
"type": "array",
|
|
3664
|
+
"description": "For 'query' mode: Direct query parameters to find scope entities.\nNot used for 'relations' or 'reverse-relations' modes.\n",
|
|
3665
|
+
"items": {
|
|
3666
|
+
"$ref": "#/components/schemas/RelationUniqueIdField"
|
|
3667
|
+
}
|
|
3668
|
+
}
|
|
3669
|
+
}
|
|
3670
|
+
},
|
|
3489
3671
|
"IntegrationMeterReading": {
|
|
3490
3672
|
"type": "object",
|
|
3491
3673
|
"required": [
|
|
@@ -3988,6 +4170,10 @@
|
|
|
3988
4170
|
"type": "string",
|
|
3989
4171
|
"description": "Filter by object type"
|
|
3990
4172
|
},
|
|
4173
|
+
"event_name": {
|
|
4174
|
+
"type": "string",
|
|
4175
|
+
"description": "Filter by event name (alias for object_type)"
|
|
4176
|
+
},
|
|
3991
4177
|
"limit": {
|
|
3992
4178
|
"type": "integer",
|
|
3993
4179
|
"description": "Maximum number of results to return",
|
|
@@ -4069,6 +4255,10 @@
|
|
|
4069
4255
|
"type": "string",
|
|
4070
4256
|
"description": "Filter by object type (e.g., 'contract', 'meter')"
|
|
4071
4257
|
},
|
|
4258
|
+
"event_name": {
|
|
4259
|
+
"type": "string",
|
|
4260
|
+
"description": "Filter by event name (alias for object_type)"
|
|
4261
|
+
},
|
|
4072
4262
|
"event_id": {
|
|
4073
4263
|
"type": "string",
|
|
4074
4264
|
"description": "Filter by event ID to find a specific event"
|
|
@@ -4266,6 +4456,7 @@
|
|
|
4266
4456
|
"status",
|
|
4267
4457
|
"error_category",
|
|
4268
4458
|
"object_type",
|
|
4459
|
+
"event_name",
|
|
4269
4460
|
"date"
|
|
4270
4461
|
]
|
|
4271
4462
|
},
|
|
@@ -4538,7 +4729,6 @@
|
|
|
4538
4729
|
"required": [
|
|
4539
4730
|
"org_id",
|
|
4540
4731
|
"event_id",
|
|
4541
|
-
"event_type",
|
|
4542
4732
|
"object_type",
|
|
4543
4733
|
"sync_type",
|
|
4544
4734
|
"status",
|
|
@@ -4577,7 +4767,11 @@
|
|
|
4577
4767
|
"DELETE",
|
|
4578
4768
|
"TRIGGER"
|
|
4579
4769
|
],
|
|
4580
|
-
"description": "Type of event"
|
|
4770
|
+
"description": "Type of event (optional for V3 events)"
|
|
4771
|
+
},
|
|
4772
|
+
"event_name": {
|
|
4773
|
+
"type": "string",
|
|
4774
|
+
"description": "Event name (alias for object_type, used in V3+)"
|
|
4581
4775
|
},
|
|
4582
4776
|
"object_type": {
|
|
4583
4777
|
"type": "string",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epilot/erp-integration-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Client library for ePilot ERP Integration API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"test": "jest",
|
|
27
27
|
"typescript": "tsc",
|
|
28
28
|
"bundle-definition": "webpack",
|
|
29
|
-
"openapi": "node ../../scripts/update-openapi.js
|
|
29
|
+
"openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/erp-integration.yaml",
|
|
30
30
|
"typegen": "openapi typegen src/openapi.json --client -b '/* eslint-disable */' > src/openapi.d.ts",
|
|
31
31
|
"build": "tsc && npm run build:patch && npm run bundle-definition",
|
|
32
32
|
"build:patch": "sed -i'' -e '/^__exportStar.*openapi.*$/d' dist/index.js",
|