@epilot/erp-integration-client 0.16.0 → 0.17.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/openapi.d.ts +76 -2
- package/dist/openapi.json +87 -5
- package/package.json +2 -2
package/dist/openapi.d.ts
CHANGED
|
@@ -193,6 +193,10 @@ declare namespace Components {
|
|
|
193
193
|
* Optional description of the integration
|
|
194
194
|
*/
|
|
195
195
|
description?: string;
|
|
196
|
+
/**
|
|
197
|
+
* List of access token IDs to associate with this integration
|
|
198
|
+
*/
|
|
199
|
+
access_token_ids?: string[];
|
|
196
200
|
}
|
|
197
201
|
export interface CreateOutboundUseCaseRequest {
|
|
198
202
|
/**
|
|
@@ -600,6 +604,10 @@ declare namespace Components {
|
|
|
600
604
|
* Optional description of the integration
|
|
601
605
|
*/
|
|
602
606
|
description?: string;
|
|
607
|
+
/**
|
|
608
|
+
* List of access token IDs associated with this integration
|
|
609
|
+
*/
|
|
610
|
+
access_token_ids?: string[];
|
|
603
611
|
/**
|
|
604
612
|
* ISO-8601 timestamp when the integration was created
|
|
605
613
|
*/
|
|
@@ -663,6 +671,23 @@ declare namespace Components {
|
|
|
663
671
|
* Controls whether this entity mapping should be processed. Can be a boolean or a JSONata expression (string) that evaluates to a boolean.
|
|
664
672
|
*/
|
|
665
673
|
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;
|
|
674
|
+
/**
|
|
675
|
+
* Operation mode for entity mapping:
|
|
676
|
+
* - 'upsert': Create or update the entity (default)
|
|
677
|
+
* - 'delete': Soft delete the entity (marks as deleted)
|
|
678
|
+
* - 'purge': Hard delete the entity (permanent removal)
|
|
679
|
+
* - 'upsert-prune-scope-purge': Upsert entities from array, then purge entities in scope that weren't upserted
|
|
680
|
+
* - 'upsert-prune-scope-delete': Upsert entities from array, then soft delete entities in scope that weren't upserted
|
|
681
|
+
*
|
|
682
|
+
*/
|
|
683
|
+
mode?: "upsert" | "delete" | "purge" | "upsert-prune-scope-purge" | "upsert-prune-scope-delete";
|
|
684
|
+
scope?: /**
|
|
685
|
+
* Scope configuration for upsert-prune-scope modes.
|
|
686
|
+
* Defines how to find entities that should be pruned if not in the upsert payload.
|
|
687
|
+
* The scope is resolved against the original event payload (not individual array items).
|
|
688
|
+
*
|
|
689
|
+
*/
|
|
690
|
+
PruneScopeConfig;
|
|
666
691
|
/**
|
|
667
692
|
* Field mapping definitions
|
|
668
693
|
*/
|
|
@@ -779,6 +804,10 @@ declare namespace Components {
|
|
|
779
804
|
* Optional description of the integration
|
|
780
805
|
*/
|
|
781
806
|
description?: string;
|
|
807
|
+
/**
|
|
808
|
+
* List of access token IDs associated with this integration
|
|
809
|
+
*/
|
|
810
|
+
access_token_ids?: string[];
|
|
782
811
|
/**
|
|
783
812
|
* All use cases belonging to this integration
|
|
784
813
|
*/
|
|
@@ -1191,13 +1220,49 @@ declare namespace Components {
|
|
|
1191
1220
|
*/
|
|
1192
1221
|
conflicts?: OutboundConflict[];
|
|
1193
1222
|
}
|
|
1223
|
+
/**
|
|
1224
|
+
* Scope configuration for upsert-prune-scope modes.
|
|
1225
|
+
* Defines how to find entities that should be pruned if not in the upsert payload.
|
|
1226
|
+
* The scope is resolved against the original event payload (not individual array items).
|
|
1227
|
+
*
|
|
1228
|
+
*/
|
|
1229
|
+
export interface PruneScopeConfig {
|
|
1230
|
+
/**
|
|
1231
|
+
* Scope mode for finding entities to prune:
|
|
1232
|
+
* - 'relations': Find scope by looking at all entities related to a specific entity (both direct and reverse relations)
|
|
1233
|
+
* - 'query': Find scope entities directly via query parameters
|
|
1234
|
+
*
|
|
1235
|
+
*/
|
|
1236
|
+
scope_mode: "relations" | "query";
|
|
1237
|
+
/**
|
|
1238
|
+
* For 'relations' mode: The schema of the entity to find (e.g., 'billing_account').
|
|
1239
|
+
* Not used for 'query' mode.
|
|
1240
|
+
*
|
|
1241
|
+
*/
|
|
1242
|
+
schema?: string;
|
|
1243
|
+
/**
|
|
1244
|
+
* For 'relations' mode: How to identify the scope entity from the payload.
|
|
1245
|
+
* Not used for 'query' mode.
|
|
1246
|
+
*
|
|
1247
|
+
*/
|
|
1248
|
+
unique_ids?: RelationUniqueIdField[];
|
|
1249
|
+
/**
|
|
1250
|
+
* For 'query' mode: Direct query parameters to find scope entities.
|
|
1251
|
+
* Not used for 'relations' or 'reverse-relations' modes.
|
|
1252
|
+
*
|
|
1253
|
+
*/
|
|
1254
|
+
query?: RelationUniqueIdField[];
|
|
1255
|
+
}
|
|
1194
1256
|
export interface QueryAccessLogsRequest {
|
|
1195
1257
|
/**
|
|
1196
|
-
* Filter by access token ID (e.g., 'api_5ZugdRXasLfWBypHi93Fk')
|
|
1258
|
+
* Filter by a specific access token ID (e.g., 'api_5ZugdRXasLfWBypHi93Fk').
|
|
1259
|
+
* Must be one of the access_token_ids linked to the integration.
|
|
1260
|
+
* If omitted, returns logs for all access tokens linked to the integration.
|
|
1261
|
+
*
|
|
1197
1262
|
* example:
|
|
1198
1263
|
* api_5ZugdRXasLfWBypHi93Fk
|
|
1199
1264
|
*/
|
|
1200
|
-
token_id
|
|
1265
|
+
token_id?: string;
|
|
1201
1266
|
/**
|
|
1202
1267
|
* Filter by service name (e.g., 'entity', 'metering', 'submission-api')
|
|
1203
1268
|
* example:
|
|
@@ -1741,6 +1806,10 @@ declare namespace Components {
|
|
|
1741
1806
|
* Optional description of the integration
|
|
1742
1807
|
*/
|
|
1743
1808
|
description?: string;
|
|
1809
|
+
/**
|
|
1810
|
+
* List of access token IDs to associate with this integration
|
|
1811
|
+
*/
|
|
1812
|
+
access_token_ids?: string[];
|
|
1744
1813
|
}
|
|
1745
1814
|
export interface UpdateOutboundUseCaseRequest {
|
|
1746
1815
|
/**
|
|
@@ -1790,6 +1859,10 @@ declare namespace Components {
|
|
|
1790
1859
|
* Optional description of the integration
|
|
1791
1860
|
*/
|
|
1792
1861
|
description?: string;
|
|
1862
|
+
/**
|
|
1863
|
+
* List of access token IDs to associate with this integration
|
|
1864
|
+
*/
|
|
1865
|
+
access_token_ids?: string[];
|
|
1793
1866
|
/**
|
|
1794
1867
|
* Full list of use cases (declarative). This replaces ALL existing use cases.
|
|
1795
1868
|
* - Use cases with an `id` field matching an existing use case will be updated
|
|
@@ -3197,6 +3270,7 @@ export type OutboundStatusResponse = Components.Schemas.OutboundStatusResponse;
|
|
|
3197
3270
|
export type OutboundUseCase = Components.Schemas.OutboundUseCase;
|
|
3198
3271
|
export type OutboundUseCaseHistoryEntry = Components.Schemas.OutboundUseCaseHistoryEntry;
|
|
3199
3272
|
export type OutboundUseCaseStatus = Components.Schemas.OutboundUseCaseStatus;
|
|
3273
|
+
export type PruneScopeConfig = Components.Schemas.PruneScopeConfig;
|
|
3200
3274
|
export type QueryAccessLogsRequest = Components.Schemas.QueryAccessLogsRequest;
|
|
3201
3275
|
export type QueryEventsRequest = Components.Schemas.QueryEventsRequest;
|
|
3202
3276
|
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.30.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": [
|
|
@@ -2378,6 +2378,13 @@
|
|
|
2378
2378
|
"type": "string",
|
|
2379
2379
|
"description": "Optional description of the integration"
|
|
2380
2380
|
},
|
|
2381
|
+
"access_token_ids": {
|
|
2382
|
+
"type": "array",
|
|
2383
|
+
"description": "List of access token IDs associated with this integration",
|
|
2384
|
+
"items": {
|
|
2385
|
+
"type": "string"
|
|
2386
|
+
}
|
|
2387
|
+
},
|
|
2381
2388
|
"created_at": {
|
|
2382
2389
|
"type": "string",
|
|
2383
2390
|
"format": "date-time",
|
|
@@ -2406,6 +2413,13 @@
|
|
|
2406
2413
|
"type": "string",
|
|
2407
2414
|
"maxLength": 1000,
|
|
2408
2415
|
"description": "Optional description of the integration"
|
|
2416
|
+
},
|
|
2417
|
+
"access_token_ids": {
|
|
2418
|
+
"type": "array",
|
|
2419
|
+
"description": "List of access token IDs to associate with this integration",
|
|
2420
|
+
"items": {
|
|
2421
|
+
"type": "string"
|
|
2422
|
+
}
|
|
2409
2423
|
}
|
|
2410
2424
|
}
|
|
2411
2425
|
},
|
|
@@ -2422,6 +2436,13 @@
|
|
|
2422
2436
|
"type": "string",
|
|
2423
2437
|
"maxLength": 1000,
|
|
2424
2438
|
"description": "Optional description of the integration"
|
|
2439
|
+
},
|
|
2440
|
+
"access_token_ids": {
|
|
2441
|
+
"type": "array",
|
|
2442
|
+
"description": "List of access token IDs to associate with this integration",
|
|
2443
|
+
"items": {
|
|
2444
|
+
"type": "string"
|
|
2445
|
+
}
|
|
2425
2446
|
}
|
|
2426
2447
|
}
|
|
2427
2448
|
},
|
|
@@ -3456,6 +3477,21 @@
|
|
|
3456
3477
|
],
|
|
3457
3478
|
"description": "Controls whether this entity mapping should be processed. Can be a boolean or a JSONata expression (string) that evaluates to a boolean."
|
|
3458
3479
|
},
|
|
3480
|
+
"mode": {
|
|
3481
|
+
"type": "string",
|
|
3482
|
+
"enum": [
|
|
3483
|
+
"upsert",
|
|
3484
|
+
"delete",
|
|
3485
|
+
"purge",
|
|
3486
|
+
"upsert-prune-scope-purge",
|
|
3487
|
+
"upsert-prune-scope-delete"
|
|
3488
|
+
],
|
|
3489
|
+
"default": "upsert",
|
|
3490
|
+
"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"
|
|
3491
|
+
},
|
|
3492
|
+
"scope": {
|
|
3493
|
+
"$ref": "#/components/schemas/PruneScopeConfig"
|
|
3494
|
+
},
|
|
3459
3495
|
"fields": {
|
|
3460
3496
|
"type": "array",
|
|
3461
3497
|
"description": "Field mapping definitions",
|
|
@@ -3465,6 +3501,41 @@
|
|
|
3465
3501
|
}
|
|
3466
3502
|
}
|
|
3467
3503
|
},
|
|
3504
|
+
"PruneScopeConfig": {
|
|
3505
|
+
"type": "object",
|
|
3506
|
+
"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",
|
|
3507
|
+
"required": [
|
|
3508
|
+
"scope_mode"
|
|
3509
|
+
],
|
|
3510
|
+
"properties": {
|
|
3511
|
+
"scope_mode": {
|
|
3512
|
+
"type": "string",
|
|
3513
|
+
"enum": [
|
|
3514
|
+
"relations",
|
|
3515
|
+
"query"
|
|
3516
|
+
],
|
|
3517
|
+
"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"
|
|
3518
|
+
},
|
|
3519
|
+
"schema": {
|
|
3520
|
+
"type": "string",
|
|
3521
|
+
"description": "For 'relations' mode: The schema of the entity to find (e.g., 'billing_account').\nNot used for 'query' mode.\n"
|
|
3522
|
+
},
|
|
3523
|
+
"unique_ids": {
|
|
3524
|
+
"type": "array",
|
|
3525
|
+
"description": "For 'relations' mode: How to identify the scope entity from the payload.\nNot used for 'query' mode.\n",
|
|
3526
|
+
"items": {
|
|
3527
|
+
"$ref": "#/components/schemas/RelationUniqueIdField"
|
|
3528
|
+
}
|
|
3529
|
+
},
|
|
3530
|
+
"query": {
|
|
3531
|
+
"type": "array",
|
|
3532
|
+
"description": "For 'query' mode: Direct query parameters to find scope entities.\nNot used for 'relations' or 'reverse-relations' modes.\n",
|
|
3533
|
+
"items": {
|
|
3534
|
+
"$ref": "#/components/schemas/RelationUniqueIdField"
|
|
3535
|
+
}
|
|
3536
|
+
}
|
|
3537
|
+
}
|
|
3538
|
+
},
|
|
3468
3539
|
"IntegrationMeterReading": {
|
|
3469
3540
|
"type": "object",
|
|
3470
3541
|
"required": [
|
|
@@ -3769,6 +3840,13 @@
|
|
|
3769
3840
|
"type": "string",
|
|
3770
3841
|
"description": "Optional description of the integration"
|
|
3771
3842
|
},
|
|
3843
|
+
"access_token_ids": {
|
|
3844
|
+
"type": "array",
|
|
3845
|
+
"description": "List of access token IDs associated with this integration",
|
|
3846
|
+
"items": {
|
|
3847
|
+
"type": "string"
|
|
3848
|
+
}
|
|
3849
|
+
},
|
|
3772
3850
|
"use_cases": {
|
|
3773
3851
|
"type": "array",
|
|
3774
3852
|
"description": "All use cases belonging to this integration",
|
|
@@ -3806,6 +3884,13 @@
|
|
|
3806
3884
|
"maxLength": 1000,
|
|
3807
3885
|
"description": "Optional description of the integration"
|
|
3808
3886
|
},
|
|
3887
|
+
"access_token_ids": {
|
|
3888
|
+
"type": "array",
|
|
3889
|
+
"description": "List of access token IDs to associate with this integration",
|
|
3890
|
+
"items": {
|
|
3891
|
+
"type": "string"
|
|
3892
|
+
}
|
|
3893
|
+
},
|
|
3809
3894
|
"use_cases": {
|
|
3810
3895
|
"type": "array",
|
|
3811
3896
|
"description": "Full list of use cases (declarative). This replaces ALL existing use cases.\n- Use cases with an `id` field matching an existing use case will be updated\n- Use cases without an `id` or with a non-matching `id` will be created\n- Existing use cases not in this list will be deleted\n",
|
|
@@ -4077,13 +4162,10 @@
|
|
|
4077
4162
|
},
|
|
4078
4163
|
"QueryAccessLogsRequest": {
|
|
4079
4164
|
"type": "object",
|
|
4080
|
-
"required": [
|
|
4081
|
-
"token_id"
|
|
4082
|
-
],
|
|
4083
4165
|
"properties": {
|
|
4084
4166
|
"token_id": {
|
|
4085
4167
|
"type": "string",
|
|
4086
|
-
"description": "Filter by access token ID (e.g., 'api_5ZugdRXasLfWBypHi93Fk')",
|
|
4168
|
+
"description": "Filter by a specific access token ID (e.g., 'api_5ZugdRXasLfWBypHi93Fk').\nMust be one of the access_token_ids linked to the integration.\nIf omitted, returns logs for all access tokens linked to the integration.\n",
|
|
4087
4169
|
"example": "api_5ZugdRXasLfWBypHi93Fk"
|
|
4088
4170
|
},
|
|
4089
4171
|
"service": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epilot/erp-integration-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.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",
|