@epilot/erp-integration-client 0.7.0 → 0.9.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":""},"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":{}}},"/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}/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}/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":{}}}},"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={},n=function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.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={390:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(r(466));t.default=s.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":{}}},"/v2/erp/updates/events":{"post":{"operationId":"processErpUpdatesEventsV2","requestBody":{"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}/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":{}}},"/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":{}}}},"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={},r=function r(n){var s=t[n];if(void 0!==s)return s.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}(390),n=exports;for(var s in r)n[s]=r[s];r.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
@@ -205,6 +205,29 @@
205
205
  "responses": {}
206
206
  }
207
207
  },
208
+ "/v1/integrations/{integrationId}/use-cases/{useCaseId}/history": {
209
+ "get": {
210
+ "operationId": "listUseCaseHistory",
211
+ "parameters": [
212
+ {
213
+ "name": "integrationId",
214
+ "in": "path",
215
+ "required": true
216
+ },
217
+ {
218
+ "name": "useCaseId",
219
+ "in": "path",
220
+ "required": true
221
+ },
222
+ {
223
+ "name": "cursor",
224
+ "in": "query",
225
+ "required": false
226
+ }
227
+ ],
228
+ "responses": {}
229
+ }
230
+ },
208
231
  "/v1/integrations/{integrationId}/app-mapping": {
209
232
  "put": {
210
233
  "operationId": "setIntegrationAppMapping",
package/dist/openapi.d.ts CHANGED
@@ -29,6 +29,21 @@ declare namespace Components {
29
29
  export type Unauthorized = Schemas.ErrorResponseBase;
30
30
  }
31
31
  namespace Schemas {
32
+ export interface CreateInboundUseCaseRequest {
33
+ /**
34
+ * Use case name
35
+ */
36
+ name: string;
37
+ /**
38
+ * Whether the use case is enabled
39
+ */
40
+ enabled: boolean;
41
+ /**
42
+ * Use case type
43
+ */
44
+ type: "inbound";
45
+ configuration?: /* Configuration for inbound use cases (ERP to epilot) */ InboundIntegrationEventConfiguration;
46
+ }
32
47
  export interface CreateIntegrationRequest {
33
48
  /**
34
49
  * Integration name
@@ -39,25 +54,31 @@ declare namespace Components {
39
54
  */
40
55
  description?: string;
41
56
  }
42
- export interface CreateUseCaseRequest {
57
+ export interface CreateOutboundUseCaseRequest {
43
58
  /**
44
59
  * Use case name
45
60
  */
46
61
  name: string;
62
+ /**
63
+ * Whether the use case is enabled
64
+ */
65
+ enabled: boolean;
47
66
  /**
48
67
  * Use case type
49
68
  */
50
- type: "inbound" | "outbound";
69
+ type: "outbound";
70
+ configuration?: /* Configuration for outbound use cases (epilot to ERP). Structure TBD. */ OutboundIntegrationEventConfiguration;
71
+ }
72
+ export type CreateUseCaseRequest = CreateInboundUseCaseRequest | CreateOutboundUseCaseRequest;
73
+ export interface CreateUseCaseRequestBase {
51
74
  /**
52
- * Whether the use case is enabled
75
+ * Use case name
53
76
  */
54
- enabled: boolean;
77
+ name: string;
55
78
  /**
56
- * Use case specific configuration
79
+ * Whether the use case is enabled
57
80
  */
58
- configuration?: {
59
- [name: string]: any;
60
- };
81
+ enabled: boolean;
61
82
  }
62
83
  export interface DeleteIntegrationAppMappingRequest {
63
84
  /**
@@ -142,6 +163,19 @@ declare namespace Components {
142
163
  */
143
164
  message?: string;
144
165
  }
166
+ /**
167
+ * Configuration for inbound use cases (ERP to epilot)
168
+ */
169
+ export interface InboundIntegrationEventConfiguration {
170
+ /**
171
+ * Array of entity configurations for this event
172
+ */
173
+ entities?: IntegrationEntity[];
174
+ /**
175
+ * Array of meter reading configurations for this event
176
+ */
177
+ meter_readings?: IntegrationMeterReading[];
178
+ }
145
179
  export interface InboundUseCase {
146
180
  /**
147
181
  * Unique identifier for the use case
@@ -163,7 +197,11 @@ declare namespace Components {
163
197
  * Whether the use case is enabled
164
198
  */
165
199
  enabled: boolean;
166
- configuration?: IntegrationEvent;
200
+ configuration?: /* Configuration for inbound use cases (ERP to epilot) */ InboundIntegrationEventConfiguration;
201
+ /**
202
+ * Description of the last change made to this use case
203
+ */
204
+ change_description?: string;
167
205
  /**
168
206
  * ISO-8601 timestamp when the use case was created
169
207
  */
@@ -173,6 +211,49 @@ declare namespace Components {
173
211
  */
174
212
  updated_at: string; // date-time
175
213
  }
214
+ export interface InboundUseCaseHistoryEntry {
215
+ /**
216
+ * Unique identifier for this history entry
217
+ */
218
+ id: string; // uuid
219
+ /**
220
+ * Reference to the parent use case
221
+ */
222
+ useCaseId: string; // uuid
223
+ /**
224
+ * Parent integration ID
225
+ */
226
+ integrationId: string; // uuid
227
+ /**
228
+ * Use case name at this point in history
229
+ */
230
+ name: string;
231
+ /**
232
+ * Whether the use case was enabled at this point in history
233
+ */
234
+ enabled: boolean;
235
+ /**
236
+ * Description of the change that was made at this point in history
237
+ */
238
+ change_description?: string;
239
+ /**
240
+ * ISO-8601 timestamp when the use case was originally created
241
+ */
242
+ created_at: string; // date-time
243
+ /**
244
+ * ISO-8601 timestamp of this historical snapshot (before the update)
245
+ */
246
+ updated_at: string; // date-time
247
+ /**
248
+ * ISO-8601 timestamp when this history entry was created
249
+ */
250
+ history_created_at: string; // date-time
251
+ /**
252
+ * Use case type
253
+ */
254
+ type: "inbound";
255
+ configuration?: /* Configuration for inbound use cases (ERP to epilot) */ InboundIntegrationEventConfiguration;
256
+ }
176
257
  export interface Integration {
177
258
  /**
178
259
  * Unique identifier for the integration
@@ -229,7 +310,7 @@ declare namespace Components {
229
310
  * [v2.0] Event type mappings
230
311
  */
231
312
  events: {
232
- [name: string]: IntegrationEvent;
313
+ [name: string]: /* Configuration for inbound use cases (ERP to epilot) */ InboundIntegrationEventConfiguration;
233
314
  };
234
315
  };
235
316
  }
@@ -278,16 +359,6 @@ declare namespace Components {
278
359
  enabled?: /* Controls whether this field mapping should be processed. Can be a boolean or a JSONata expression (string) that evaluates to a boolean. Defaults to true if omitted. */ boolean | string;
279
360
  relations?: RelationConfig;
280
361
  }
281
- export interface IntegrationEvent {
282
- /**
283
- * Array of entity configurations for this event
284
- */
285
- entities?: IntegrationEntity[];
286
- /**
287
- * Array of meter reading configurations for this event
288
- */
289
- meter_readings?: IntegrationMeterReading[];
290
- }
291
362
  export interface IntegrationFieldV1 {
292
363
  /**
293
364
  * Target entity slug
@@ -389,6 +460,12 @@ declare namespace Components {
389
460
  ...RelationUniqueIdField[]
390
461
  ];
391
462
  }
463
+ /**
464
+ * Configuration for outbound use cases (epilot to ERP). Structure TBD.
465
+ */
466
+ export interface OutboundIntegrationEventConfiguration {
467
+ [name: string]: any;
468
+ }
392
469
  export interface OutboundUseCase {
393
470
  /**
394
471
  * Unique identifier for the use case
@@ -410,12 +487,11 @@ declare namespace Components {
410
487
  * Whether the use case is enabled
411
488
  */
412
489
  enabled: boolean;
490
+ configuration?: /* Configuration for outbound use cases (epilot to ERP). Structure TBD. */ OutboundIntegrationEventConfiguration;
413
491
  /**
414
- * Use case specific configuration
492
+ * Description of the last change made to this use case
415
493
  */
416
- configuration?: {
417
- [name: string]: any;
418
- };
494
+ change_description?: string;
419
495
  /**
420
496
  * ISO-8601 timestamp when the use case was created
421
497
  */
@@ -425,6 +501,49 @@ declare namespace Components {
425
501
  */
426
502
  updated_at: string; // date-time
427
503
  }
504
+ export interface OutboundUseCaseHistoryEntry {
505
+ /**
506
+ * Unique identifier for this history entry
507
+ */
508
+ id: string; // uuid
509
+ /**
510
+ * Reference to the parent use case
511
+ */
512
+ useCaseId: string; // uuid
513
+ /**
514
+ * Parent integration ID
515
+ */
516
+ integrationId: string; // uuid
517
+ /**
518
+ * Use case name at this point in history
519
+ */
520
+ name: string;
521
+ /**
522
+ * Whether the use case was enabled at this point in history
523
+ */
524
+ enabled: boolean;
525
+ /**
526
+ * Description of the change that was made at this point in history
527
+ */
528
+ change_description?: string;
529
+ /**
530
+ * ISO-8601 timestamp when the use case was originally created
531
+ */
532
+ created_at: string; // date-time
533
+ /**
534
+ * ISO-8601 timestamp of this historical snapshot (before the update)
535
+ */
536
+ updated_at: string; // date-time
537
+ /**
538
+ * ISO-8601 timestamp when this history entry was created
539
+ */
540
+ history_created_at: string; // date-time
541
+ /**
542
+ * Use case type
543
+ */
544
+ type: "outbound";
545
+ configuration?: /* Configuration for outbound use cases (epilot to ERP). Structure TBD. */ OutboundIntegrationEventConfiguration;
546
+ }
428
547
  export interface RelationConfig {
429
548
  /**
430
549
  * Relation operation:
@@ -542,6 +661,25 @@ declare namespace Components {
542
661
  end_date?: string;
543
662
  event_id?: string;
544
663
  }
664
+ export interface UpdateInboundUseCaseRequest {
665
+ /**
666
+ * Use case name
667
+ */
668
+ name?: string;
669
+ /**
670
+ * Whether the use case is enabled
671
+ */
672
+ enabled?: boolean;
673
+ /**
674
+ * Optional description of this change (like a commit message)
675
+ */
676
+ change_description?: string;
677
+ /**
678
+ * Use case type
679
+ */
680
+ type?: "inbound";
681
+ configuration?: /* Configuration for inbound use cases (ERP to epilot) */ InboundIntegrationEventConfiguration;
682
+ }
545
683
  export interface UpdateIntegrationRequest {
546
684
  /**
547
685
  * Integration name
@@ -552,27 +690,80 @@ declare namespace Components {
552
690
  */
553
691
  description?: string;
554
692
  }
555
- export interface UpdateUseCaseRequest {
693
+ export interface UpdateOutboundUseCaseRequest {
556
694
  /**
557
695
  * Use case name
558
696
  */
559
697
  name?: string;
698
+ /**
699
+ * Whether the use case is enabled
700
+ */
701
+ enabled?: boolean;
702
+ /**
703
+ * Optional description of this change (like a commit message)
704
+ */
705
+ change_description?: string;
560
706
  /**
561
707
  * Use case type
562
708
  */
563
- type?: "inbound" | "outbound";
709
+ type?: "outbound";
710
+ configuration?: /* Configuration for outbound use cases (epilot to ERP). Structure TBD. */ OutboundIntegrationEventConfiguration;
711
+ }
712
+ export type UpdateUseCaseRequest = UpdateInboundUseCaseRequest | UpdateOutboundUseCaseRequest;
713
+ export interface UpdateUseCaseRequestBase {
714
+ /**
715
+ * Use case name
716
+ */
717
+ name?: string;
564
718
  /**
565
719
  * Whether the use case is enabled
566
720
  */
567
721
  enabled?: boolean;
568
722
  /**
569
- * Use case specific configuration
723
+ * Optional description of this change (like a commit message)
570
724
  */
571
- configuration?: {
572
- [name: string]: any;
573
- };
725
+ change_description?: string;
574
726
  }
575
727
  export type UseCase = InboundUseCase | OutboundUseCase;
728
+ export type UseCaseHistoryEntry = InboundUseCaseHistoryEntry | OutboundUseCaseHistoryEntry;
729
+ export interface UseCaseHistoryEntryBase {
730
+ /**
731
+ * Unique identifier for this history entry
732
+ */
733
+ id: string; // uuid
734
+ /**
735
+ * Reference to the parent use case
736
+ */
737
+ useCaseId: string; // uuid
738
+ /**
739
+ * Parent integration ID
740
+ */
741
+ integrationId: string; // uuid
742
+ /**
743
+ * Use case name at this point in history
744
+ */
745
+ name: string;
746
+ /**
747
+ * Whether the use case was enabled at this point in history
748
+ */
749
+ enabled: boolean;
750
+ /**
751
+ * Description of the change that was made at this point in history
752
+ */
753
+ change_description?: string;
754
+ /**
755
+ * ISO-8601 timestamp when the use case was originally created
756
+ */
757
+ created_at: string; // date-time
758
+ /**
759
+ * ISO-8601 timestamp of this historical snapshot (before the update)
760
+ */
761
+ updated_at: string; // date-time
762
+ /**
763
+ * ISO-8601 timestamp when this history entry was created
764
+ */
765
+ history_created_at: string; // date-time
766
+ }
576
767
  }
577
768
  }
578
769
  declare namespace Paths {
@@ -719,6 +910,36 @@ declare namespace Paths {
719
910
  export type $500 = Components.Responses.InternalServerError;
720
911
  }
721
912
  }
913
+ namespace ListUseCaseHistory {
914
+ namespace Parameters {
915
+ export type Cursor = string;
916
+ export type IntegrationId = string; // uuid
917
+ export type UseCaseId = string; // uuid
918
+ }
919
+ export interface PathParameters {
920
+ integrationId: Parameters.IntegrationId /* uuid */;
921
+ useCaseId: Parameters.UseCaseId /* uuid */;
922
+ }
923
+ export interface QueryParameters {
924
+ cursor?: Parameters.Cursor;
925
+ }
926
+ namespace Responses {
927
+ export interface $200 {
928
+ /**
929
+ * History entries in reverse chronological order (newest first)
930
+ */
931
+ history: Components.Schemas.UseCaseHistoryEntry[];
932
+ /**
933
+ * Opaque cursor for fetching the next page. Absent if no more pages.
934
+ */
935
+ next_cursor?: string;
936
+ }
937
+ export type $401 = Components.Responses.Unauthorized;
938
+ export interface $404 {
939
+ }
940
+ export type $500 = Components.Responses.InternalServerError;
941
+ }
942
+ }
722
943
  namespace ListUseCases {
723
944
  namespace Parameters {
724
945
  export type IntegrationId = string; // uuid
@@ -915,7 +1136,7 @@ export interface OperationMethods {
915
1136
  config?: AxiosRequestConfig
916
1137
  ): OperationResponse<Paths.SimulateMapping.Responses.$200>
917
1138
  /**
918
- * listIntegrations - List all integrations
1139
+ * listIntegrations - listIntegrations
919
1140
  *
920
1141
  * Retrieve all integrations for the authenticated organization
921
1142
  */
@@ -925,7 +1146,7 @@ export interface OperationMethods {
925
1146
  config?: AxiosRequestConfig
926
1147
  ): OperationResponse<Paths.ListIntegrations.Responses.$200>
927
1148
  /**
928
- * createIntegration - Create a new integration
1149
+ * createIntegration - createIntegration
929
1150
  *
930
1151
  * Create a new integration configuration
931
1152
  */
@@ -935,7 +1156,7 @@ export interface OperationMethods {
935
1156
  config?: AxiosRequestConfig
936
1157
  ): OperationResponse<Paths.CreateIntegration.Responses.$201>
937
1158
  /**
938
- * getIntegration - Get an integration by ID
1159
+ * getIntegration - getIntegration
939
1160
  *
940
1161
  * Retrieve a specific integration by its ID
941
1162
  */
@@ -945,7 +1166,7 @@ export interface OperationMethods {
945
1166
  config?: AxiosRequestConfig
946
1167
  ): OperationResponse<Paths.GetIntegration.Responses.$200>
947
1168
  /**
948
- * updateIntegration - Update an integration
1169
+ * updateIntegration - updateIntegration
949
1170
  *
950
1171
  * Update an existing integration configuration
951
1172
  */
@@ -955,7 +1176,7 @@ export interface OperationMethods {
955
1176
  config?: AxiosRequestConfig
956
1177
  ): OperationResponse<Paths.UpdateIntegration.Responses.$200>
957
1178
  /**
958
- * deleteIntegration - Delete an integration
1179
+ * deleteIntegration - deleteIntegration
959
1180
  *
960
1181
  * Delete an integration and all its use cases
961
1182
  */
@@ -965,7 +1186,7 @@ export interface OperationMethods {
965
1186
  config?: AxiosRequestConfig
966
1187
  ): OperationResponse<Paths.DeleteIntegration.Responses.$200>
967
1188
  /**
968
- * listUseCases - List all use cases for an integration
1189
+ * listUseCases - listUseCases
969
1190
  *
970
1191
  * Retrieve all use cases for a specific integration
971
1192
  */
@@ -975,7 +1196,7 @@ export interface OperationMethods {
975
1196
  config?: AxiosRequestConfig
976
1197
  ): OperationResponse<Paths.ListUseCases.Responses.$200>
977
1198
  /**
978
- * createUseCase - Create a new use case
1199
+ * createUseCase - createUseCase
979
1200
  *
980
1201
  * Create a new use case for an integration
981
1202
  */
@@ -985,7 +1206,7 @@ export interface OperationMethods {
985
1206
  config?: AxiosRequestConfig
986
1207
  ): OperationResponse<Paths.CreateUseCase.Responses.$201>
987
1208
  /**
988
- * getUseCase - Get a use case by ID
1209
+ * getUseCase - getUseCase
989
1210
  *
990
1211
  * Retrieve a specific use case by its ID
991
1212
  */
@@ -995,7 +1216,7 @@ export interface OperationMethods {
995
1216
  config?: AxiosRequestConfig
996
1217
  ): OperationResponse<Paths.GetUseCase.Responses.$200>
997
1218
  /**
998
- * updateUseCase - Update a use case
1219
+ * updateUseCase - updateUseCase
999
1220
  *
1000
1221
  * Update an existing use case configuration
1001
1222
  */
@@ -1005,7 +1226,7 @@ export interface OperationMethods {
1005
1226
  config?: AxiosRequestConfig
1006
1227
  ): OperationResponse<Paths.UpdateUseCase.Responses.$200>
1007
1228
  /**
1008
- * deleteUseCase - Delete a use case
1229
+ * deleteUseCase - deleteUseCase
1009
1230
  *
1010
1231
  * Delete a use case from an integration
1011
1232
  */
@@ -1015,7 +1236,20 @@ export interface OperationMethods {
1015
1236
  config?: AxiosRequestConfig
1016
1237
  ): OperationResponse<Paths.DeleteUseCase.Responses.$200>
1017
1238
  /**
1018
- * setIntegrationAppMapping - Set integration app mapping
1239
+ * listUseCaseHistory - listUseCaseHistory
1240
+ *
1241
+ * Retrieve historical versions of a use case's configuration.
1242
+ * History entries are returned in reverse chronological order (newest first).
1243
+ * Use the 'cursor' parameter for pagination to fetch additional entries.
1244
+ *
1245
+ */
1246
+ 'listUseCaseHistory'(
1247
+ parameters?: Parameters<Paths.ListUseCaseHistory.QueryParameters & Paths.ListUseCaseHistory.PathParameters> | null,
1248
+ data?: any,
1249
+ config?: AxiosRequestConfig
1250
+ ): OperationResponse<Paths.ListUseCaseHistory.Responses.$200>
1251
+ /**
1252
+ * setIntegrationAppMapping - setIntegrationAppMapping
1019
1253
  *
1020
1254
  * Creates or updates a mapping from an app/component to an integration.
1021
1255
  * This allows ERP updates sent via app_id and component_id to be associated
@@ -1028,7 +1262,7 @@ export interface OperationMethods {
1028
1262
  config?: AxiosRequestConfig
1029
1263
  ): OperationResponse<Paths.SetIntegrationAppMapping.Responses.$200>
1030
1264
  /**
1031
- * deleteIntegrationAppMapping - Delete integration app mapping
1265
+ * deleteIntegrationAppMapping - deleteIntegrationAppMapping
1032
1266
  *
1033
1267
  * Removes a mapping from an app/component to an integration.
1034
1268
  *
@@ -1110,7 +1344,7 @@ export interface PathsDictionary {
1110
1344
  }
1111
1345
  ['/v1/integrations']: {
1112
1346
  /**
1113
- * listIntegrations - List all integrations
1347
+ * listIntegrations - listIntegrations
1114
1348
  *
1115
1349
  * Retrieve all integrations for the authenticated organization
1116
1350
  */
@@ -1120,7 +1354,7 @@ export interface PathsDictionary {
1120
1354
  config?: AxiosRequestConfig
1121
1355
  ): OperationResponse<Paths.ListIntegrations.Responses.$200>
1122
1356
  /**
1123
- * createIntegration - Create a new integration
1357
+ * createIntegration - createIntegration
1124
1358
  *
1125
1359
  * Create a new integration configuration
1126
1360
  */
@@ -1132,7 +1366,7 @@ export interface PathsDictionary {
1132
1366
  }
1133
1367
  ['/v1/integrations/{integrationId}']: {
1134
1368
  /**
1135
- * getIntegration - Get an integration by ID
1369
+ * getIntegration - getIntegration
1136
1370
  *
1137
1371
  * Retrieve a specific integration by its ID
1138
1372
  */
@@ -1142,7 +1376,7 @@ export interface PathsDictionary {
1142
1376
  config?: AxiosRequestConfig
1143
1377
  ): OperationResponse<Paths.GetIntegration.Responses.$200>
1144
1378
  /**
1145
- * updateIntegration - Update an integration
1379
+ * updateIntegration - updateIntegration
1146
1380
  *
1147
1381
  * Update an existing integration configuration
1148
1382
  */
@@ -1152,7 +1386,7 @@ export interface PathsDictionary {
1152
1386
  config?: AxiosRequestConfig
1153
1387
  ): OperationResponse<Paths.UpdateIntegration.Responses.$200>
1154
1388
  /**
1155
- * deleteIntegration - Delete an integration
1389
+ * deleteIntegration - deleteIntegration
1156
1390
  *
1157
1391
  * Delete an integration and all its use cases
1158
1392
  */
@@ -1164,7 +1398,7 @@ export interface PathsDictionary {
1164
1398
  }
1165
1399
  ['/v1/integrations/{integrationId}/use-cases']: {
1166
1400
  /**
1167
- * listUseCases - List all use cases for an integration
1401
+ * listUseCases - listUseCases
1168
1402
  *
1169
1403
  * Retrieve all use cases for a specific integration
1170
1404
  */
@@ -1174,7 +1408,7 @@ export interface PathsDictionary {
1174
1408
  config?: AxiosRequestConfig
1175
1409
  ): OperationResponse<Paths.ListUseCases.Responses.$200>
1176
1410
  /**
1177
- * createUseCase - Create a new use case
1411
+ * createUseCase - createUseCase
1178
1412
  *
1179
1413
  * Create a new use case for an integration
1180
1414
  */
@@ -1186,7 +1420,7 @@ export interface PathsDictionary {
1186
1420
  }
1187
1421
  ['/v1/integrations/{integrationId}/use-cases/{useCaseId}']: {
1188
1422
  /**
1189
- * getUseCase - Get a use case by ID
1423
+ * getUseCase - getUseCase
1190
1424
  *
1191
1425
  * Retrieve a specific use case by its ID
1192
1426
  */
@@ -1196,7 +1430,7 @@ export interface PathsDictionary {
1196
1430
  config?: AxiosRequestConfig
1197
1431
  ): OperationResponse<Paths.GetUseCase.Responses.$200>
1198
1432
  /**
1199
- * updateUseCase - Update a use case
1433
+ * updateUseCase - updateUseCase
1200
1434
  *
1201
1435
  * Update an existing use case configuration
1202
1436
  */
@@ -1206,7 +1440,7 @@ export interface PathsDictionary {
1206
1440
  config?: AxiosRequestConfig
1207
1441
  ): OperationResponse<Paths.UpdateUseCase.Responses.$200>
1208
1442
  /**
1209
- * deleteUseCase - Delete a use case
1443
+ * deleteUseCase - deleteUseCase
1210
1444
  *
1211
1445
  * Delete a use case from an integration
1212
1446
  */
@@ -1216,9 +1450,24 @@ export interface PathsDictionary {
1216
1450
  config?: AxiosRequestConfig
1217
1451
  ): OperationResponse<Paths.DeleteUseCase.Responses.$200>
1218
1452
  }
1453
+ ['/v1/integrations/{integrationId}/use-cases/{useCaseId}/history']: {
1454
+ /**
1455
+ * listUseCaseHistory - listUseCaseHistory
1456
+ *
1457
+ * Retrieve historical versions of a use case's configuration.
1458
+ * History entries are returned in reverse chronological order (newest first).
1459
+ * Use the 'cursor' parameter for pagination to fetch additional entries.
1460
+ *
1461
+ */
1462
+ 'get'(
1463
+ parameters?: Parameters<Paths.ListUseCaseHistory.QueryParameters & Paths.ListUseCaseHistory.PathParameters> | null,
1464
+ data?: any,
1465
+ config?: AxiosRequestConfig
1466
+ ): OperationResponse<Paths.ListUseCaseHistory.Responses.$200>
1467
+ }
1219
1468
  ['/v1/integrations/{integrationId}/app-mapping']: {
1220
1469
  /**
1221
- * setIntegrationAppMapping - Set integration app mapping
1470
+ * setIntegrationAppMapping - setIntegrationAppMapping
1222
1471
  *
1223
1472
  * Creates or updates a mapping from an app/component to an integration.
1224
1473
  * This allows ERP updates sent via app_id and component_id to be associated
@@ -1231,7 +1480,7 @@ export interface PathsDictionary {
1231
1480
  config?: AxiosRequestConfig
1232
1481
  ): OperationResponse<Paths.SetIntegrationAppMapping.Responses.$200>
1233
1482
  /**
1234
- * deleteIntegrationAppMapping - Delete integration app mapping
1483
+ * deleteIntegrationAppMapping - deleteIntegrationAppMapping
1235
1484
  *
1236
1485
  * Removes a mapping from an app/component to an integration.
1237
1486
  *
@@ -1247,21 +1496,25 @@ export interface PathsDictionary {
1247
1496
  export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
1248
1497
 
1249
1498
 
1499
+ export type CreateInboundUseCaseRequest = Components.Schemas.CreateInboundUseCaseRequest;
1250
1500
  export type CreateIntegrationRequest = Components.Schemas.CreateIntegrationRequest;
1501
+ export type CreateOutboundUseCaseRequest = Components.Schemas.CreateOutboundUseCaseRequest;
1251
1502
  export type CreateUseCaseRequest = Components.Schemas.CreateUseCaseRequest;
1503
+ export type CreateUseCaseRequestBase = Components.Schemas.CreateUseCaseRequestBase;
1252
1504
  export type DeleteIntegrationAppMappingRequest = Components.Schemas.DeleteIntegrationAppMappingRequest;
1253
1505
  export type EntityUpdate = Components.Schemas.EntityUpdate;
1254
1506
  export type ErpEvent = Components.Schemas.ErpEvent;
1255
1507
  export type ErpUpdatesEventsV2Request = Components.Schemas.ErpUpdatesEventsV2Request;
1256
1508
  export type ErrorResponseBase = Components.Schemas.ErrorResponseBase;
1509
+ export type InboundIntegrationEventConfiguration = Components.Schemas.InboundIntegrationEventConfiguration;
1257
1510
  export type InboundUseCase = Components.Schemas.InboundUseCase;
1511
+ export type InboundUseCaseHistoryEntry = Components.Schemas.InboundUseCaseHistoryEntry;
1258
1512
  export type Integration = Components.Schemas.Integration;
1259
1513
  export type IntegrationAppMapping = Components.Schemas.IntegrationAppMapping;
1260
1514
  export type IntegrationConfigurationV1 = Components.Schemas.IntegrationConfigurationV1;
1261
1515
  export type IntegrationConfigurationV2 = Components.Schemas.IntegrationConfigurationV2;
1262
1516
  export type IntegrationEntity = Components.Schemas.IntegrationEntity;
1263
1517
  export type IntegrationEntityField = Components.Schemas.IntegrationEntityField;
1264
- export type IntegrationEvent = Components.Schemas.IntegrationEvent;
1265
1518
  export type IntegrationFieldV1 = Components.Schemas.IntegrationFieldV1;
1266
1519
  export type IntegrationMeterReading = Components.Schemas.IntegrationMeterReading;
1267
1520
  export type IntegrationObjectV1 = Components.Schemas.IntegrationObjectV1;
@@ -1269,13 +1522,20 @@ export type MappingSimulationRequest = Components.Schemas.MappingSimulationReque
1269
1522
  export type MappingSimulationResponse = Components.Schemas.MappingSimulationResponse;
1270
1523
  export type MeterReadingUpdate = Components.Schemas.MeterReadingUpdate;
1271
1524
  export type MeterUniqueIdsConfig = Components.Schemas.MeterUniqueIdsConfig;
1525
+ export type OutboundIntegrationEventConfiguration = Components.Schemas.OutboundIntegrationEventConfiguration;
1272
1526
  export type OutboundUseCase = Components.Schemas.OutboundUseCase;
1527
+ export type OutboundUseCaseHistoryEntry = Components.Schemas.OutboundUseCaseHistoryEntry;
1273
1528
  export type RelationConfig = Components.Schemas.RelationConfig;
1274
1529
  export type RelationItemConfig = Components.Schemas.RelationItemConfig;
1275
1530
  export type RelationUniqueIdField = Components.Schemas.RelationUniqueIdField;
1276
1531
  export type SetIntegrationAppMappingRequest = Components.Schemas.SetIntegrationAppMappingRequest;
1277
1532
  export type TriggerErpActionRequest = Components.Schemas.TriggerErpActionRequest;
1278
1533
  export type TriggerWebhookResp = Components.Schemas.TriggerWebhookResp;
1534
+ export type UpdateInboundUseCaseRequest = Components.Schemas.UpdateInboundUseCaseRequest;
1279
1535
  export type UpdateIntegrationRequest = Components.Schemas.UpdateIntegrationRequest;
1536
+ export type UpdateOutboundUseCaseRequest = Components.Schemas.UpdateOutboundUseCaseRequest;
1280
1537
  export type UpdateUseCaseRequest = Components.Schemas.UpdateUseCaseRequest;
1538
+ export type UpdateUseCaseRequestBase = Components.Schemas.UpdateUseCaseRequestBase;
1281
1539
  export type UseCase = Components.Schemas.UseCase;
1540
+ export type UseCaseHistoryEntry = Components.Schemas.UseCaseHistoryEntry;
1541
+ export type UseCaseHistoryEntryBase = Components.Schemas.UseCaseHistoryEntryBase;
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.12.0",
5
+ "version": "0.13.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": [
@@ -608,7 +608,7 @@
608
608
  "/v1/integrations": {
609
609
  "get": {
610
610
  "operationId": "listIntegrations",
611
- "summary": "List all integrations",
611
+ "summary": "listIntegrations",
612
612
  "description": "Retrieve all integrations for the authenticated organization",
613
613
  "tags": [
614
614
  "integrations"
@@ -645,7 +645,7 @@
645
645
  },
646
646
  "post": {
647
647
  "operationId": "createIntegration",
648
- "summary": "Create a new integration",
648
+ "summary": "createIntegration",
649
649
  "description": "Create a new integration configuration",
650
650
  "tags": [
651
651
  "integrations"
@@ -686,7 +686,7 @@
686
686
  "/v1/integrations/{integrationId}": {
687
687
  "get": {
688
688
  "operationId": "getIntegration",
689
- "summary": "Get an integration by ID",
689
+ "summary": "getIntegration",
690
690
  "description": "Retrieve a specific integration by its ID",
691
691
  "tags": [
692
692
  "integrations"
@@ -727,7 +727,7 @@
727
727
  },
728
728
  "put": {
729
729
  "operationId": "updateIntegration",
730
- "summary": "Update an integration",
730
+ "summary": "updateIntegration",
731
731
  "description": "Update an existing integration configuration",
732
732
  "tags": [
733
733
  "integrations"
@@ -781,7 +781,7 @@
781
781
  },
782
782
  "delete": {
783
783
  "operationId": "deleteIntegration",
784
- "summary": "Delete an integration",
784
+ "summary": "deleteIntegration",
785
785
  "description": "Delete an integration and all its use cases",
786
786
  "tags": [
787
787
  "integrations"
@@ -829,7 +829,7 @@
829
829
  "/v1/integrations/{integrationId}/use-cases": {
830
830
  "get": {
831
831
  "operationId": "listUseCases",
832
- "summary": "List all use cases for an integration",
832
+ "summary": "listUseCases",
833
833
  "description": "Retrieve all use cases for a specific integration",
834
834
  "tags": [
835
835
  "integrations"
@@ -878,7 +878,7 @@
878
878
  },
879
879
  "post": {
880
880
  "operationId": "createUseCase",
881
- "summary": "Create a new use case",
881
+ "summary": "createUseCase",
882
882
  "description": "Create a new use case for an integration",
883
883
  "tags": [
884
884
  "integrations"
@@ -934,7 +934,7 @@
934
934
  "/v1/integrations/{integrationId}/use-cases/{useCaseId}": {
935
935
  "get": {
936
936
  "operationId": "getUseCase",
937
- "summary": "Get a use case by ID",
937
+ "summary": "getUseCase",
938
938
  "description": "Retrieve a specific use case by its ID",
939
939
  "tags": [
940
940
  "integrations"
@@ -985,7 +985,7 @@
985
985
  },
986
986
  "put": {
987
987
  "operationId": "updateUseCase",
988
- "summary": "Update a use case",
988
+ "summary": "updateUseCase",
989
989
  "description": "Update an existing use case configuration",
990
990
  "tags": [
991
991
  "integrations"
@@ -1049,7 +1049,7 @@
1049
1049
  },
1050
1050
  "delete": {
1051
1051
  "operationId": "deleteUseCase",
1052
- "summary": "Delete a use case",
1052
+ "summary": "deleteUseCase",
1053
1053
  "description": "Delete a use case from an integration",
1054
1054
  "tags": [
1055
1055
  "integrations"
@@ -1104,10 +1104,89 @@
1104
1104
  }
1105
1105
  }
1106
1106
  },
1107
+ "/v1/integrations/{integrationId}/use-cases/{useCaseId}/history": {
1108
+ "get": {
1109
+ "operationId": "listUseCaseHistory",
1110
+ "summary": "listUseCaseHistory",
1111
+ "description": "Retrieve historical versions of a use case's configuration.\nHistory entries are returned in reverse chronological order (newest first).\nUse the 'cursor' parameter for pagination to fetch additional entries.\n",
1112
+ "tags": [
1113
+ "integrations"
1114
+ ],
1115
+ "parameters": [
1116
+ {
1117
+ "name": "integrationId",
1118
+ "in": "path",
1119
+ "required": true,
1120
+ "description": "The integration ID",
1121
+ "schema": {
1122
+ "type": "string",
1123
+ "format": "uuid"
1124
+ }
1125
+ },
1126
+ {
1127
+ "name": "useCaseId",
1128
+ "in": "path",
1129
+ "required": true,
1130
+ "description": "The use case ID",
1131
+ "schema": {
1132
+ "type": "string",
1133
+ "format": "uuid"
1134
+ }
1135
+ },
1136
+ {
1137
+ "name": "cursor",
1138
+ "in": "query",
1139
+ "required": false,
1140
+ "description": "Opaque pagination cursor. Pass the 'next_cursor' value from a previous\nresponse to fetch the next page of results.\n",
1141
+ "schema": {
1142
+ "type": "string"
1143
+ },
1144
+ "example": "eyJwayI6Ik9SRyMxMjM0NSIsInNrIjoiSU5URUdSQVRJT04jLi4uIn0="
1145
+ }
1146
+ ],
1147
+ "responses": {
1148
+ "200": {
1149
+ "description": "Successfully retrieved use case history",
1150
+ "content": {
1151
+ "application/json": {
1152
+ "schema": {
1153
+ "type": "object",
1154
+ "required": [
1155
+ "history"
1156
+ ],
1157
+ "properties": {
1158
+ "history": {
1159
+ "type": "array",
1160
+ "description": "History entries in reverse chronological order (newest first)",
1161
+ "items": {
1162
+ "$ref": "#/components/schemas/UseCaseHistoryEntry"
1163
+ }
1164
+ },
1165
+ "next_cursor": {
1166
+ "type": "string",
1167
+ "description": "Opaque cursor for fetching the next page. Absent if no more pages."
1168
+ }
1169
+ }
1170
+ }
1171
+ }
1172
+ }
1173
+ },
1174
+ "401": {
1175
+ "$ref": "#/components/responses/Unauthorized"
1176
+ },
1177
+ "404": {
1178
+ "description": "Use case not found"
1179
+ },
1180
+ "500": {
1181
+ "$ref": "#/components/responses/InternalServerError"
1182
+ }
1183
+ }
1184
+ }
1185
+ },
1107
1186
  "/v1/integrations/{integrationId}/app-mapping": {
1108
1187
  "put": {
1109
1188
  "operationId": "setIntegrationAppMapping",
1110
- "summary": "Set integration app mapping",
1189
+ "summary": "setIntegrationAppMapping",
1111
1190
  "description": "Creates or updates a mapping from an app/component to an integration.\nThis allows ERP updates sent via app_id and component_id to be associated\nwith a specific integration configuration.\n",
1112
1191
  "tags": [
1113
1192
  "integrations"
@@ -1171,7 +1250,7 @@
1171
1250
  },
1172
1251
  "delete": {
1173
1252
  "operationId": "deleteIntegrationAppMapping",
1174
- "summary": "Delete integration app mapping",
1253
+ "summary": "deleteIntegrationAppMapping",
1175
1254
  "description": "Removes a mapping from an app/component to an integration.\n",
1176
1255
  "tags": [
1177
1256
  "integrations"
@@ -1615,7 +1694,12 @@
1615
1694
  "description": "Whether the use case is enabled"
1616
1695
  },
1617
1696
  "configuration": {
1618
- "$ref": "#/components/schemas/IntegrationEvent"
1697
+ "$ref": "#/components/schemas/InboundIntegrationEventConfiguration"
1698
+ },
1699
+ "change_description": {
1700
+ "type": "string",
1701
+ "maxLength": 2000,
1702
+ "description": "Description of the last change made to this use case"
1619
1703
  },
1620
1704
  "created_at": {
1621
1705
  "type": "string",
@@ -1667,9 +1751,12 @@
1667
1751
  "description": "Whether the use case is enabled"
1668
1752
  },
1669
1753
  "configuration": {
1670
- "type": "object",
1671
- "description": "Use case specific configuration",
1672
- "additionalProperties": true
1754
+ "$ref": "#/components/schemas/OutboundIntegrationEventConfiguration"
1755
+ },
1756
+ "change_description": {
1757
+ "type": "string",
1758
+ "maxLength": 2000,
1759
+ "description": "Description of the last change made to this use case"
1673
1760
  },
1674
1761
  "created_at": {
1675
1762
  "type": "string",
@@ -1684,6 +1771,23 @@
1684
1771
  }
1685
1772
  },
1686
1773
  "CreateUseCaseRequest": {
1774
+ "oneOf": [
1775
+ {
1776
+ "$ref": "#/components/schemas/CreateInboundUseCaseRequest"
1777
+ },
1778
+ {
1779
+ "$ref": "#/components/schemas/CreateOutboundUseCaseRequest"
1780
+ }
1781
+ ],
1782
+ "discriminator": {
1783
+ "propertyName": "type",
1784
+ "mapping": {
1785
+ "inbound": "#/components/schemas/CreateInboundUseCaseRequest",
1786
+ "outbound": "#/components/schemas/CreateOutboundUseCaseRequest"
1787
+ }
1788
+ }
1789
+ },
1790
+ "CreateUseCaseRequestBase": {
1687
1791
  "type": "object",
1688
1792
  "required": [
1689
1793
  "name",
@@ -1697,26 +1801,80 @@
1697
1801
  "maxLength": 255,
1698
1802
  "description": "Use case name"
1699
1803
  },
1700
- "type": {
1701
- "type": "string",
1702
- "enum": [
1703
- "inbound",
1704
- "outbound"
1705
- ],
1706
- "description": "Use case type"
1707
- },
1708
1804
  "enabled": {
1709
1805
  "type": "boolean",
1710
1806
  "description": "Whether the use case is enabled"
1807
+ }
1808
+ }
1809
+ },
1810
+ "CreateInboundUseCaseRequest": {
1811
+ "allOf": [
1812
+ {
1813
+ "$ref": "#/components/schemas/CreateUseCaseRequestBase"
1711
1814
  },
1712
- "configuration": {
1815
+ {
1713
1816
  "type": "object",
1714
- "description": "Use case specific configuration",
1715
- "additionalProperties": true
1817
+ "required": [
1818
+ "type"
1819
+ ],
1820
+ "properties": {
1821
+ "type": {
1822
+ "type": "string",
1823
+ "enum": [
1824
+ "inbound"
1825
+ ],
1826
+ "description": "Use case type"
1827
+ },
1828
+ "configuration": {
1829
+ "$ref": "#/components/schemas/InboundIntegrationEventConfiguration"
1830
+ }
1831
+ }
1716
1832
  }
1717
- }
1833
+ ]
1834
+ },
1835
+ "CreateOutboundUseCaseRequest": {
1836
+ "allOf": [
1837
+ {
1838
+ "$ref": "#/components/schemas/CreateUseCaseRequestBase"
1839
+ },
1840
+ {
1841
+ "type": "object",
1842
+ "required": [
1843
+ "type"
1844
+ ],
1845
+ "properties": {
1846
+ "type": {
1847
+ "type": "string",
1848
+ "enum": [
1849
+ "outbound"
1850
+ ],
1851
+ "description": "Use case type"
1852
+ },
1853
+ "configuration": {
1854
+ "$ref": "#/components/schemas/OutboundIntegrationEventConfiguration"
1855
+ }
1856
+ }
1857
+ }
1858
+ ]
1718
1859
  },
1719
1860
  "UpdateUseCaseRequest": {
1861
+ "oneOf": [
1862
+ {
1863
+ "$ref": "#/components/schemas/UpdateInboundUseCaseRequest"
1864
+ },
1865
+ {
1866
+ "$ref": "#/components/schemas/UpdateOutboundUseCaseRequest"
1867
+ }
1868
+ ],
1869
+ "discriminator": {
1870
+ "propertyName": "type",
1871
+ "mapping": {
1872
+ "inbound": "#/components/schemas/UpdateInboundUseCaseRequest",
1873
+ "outbound": "#/components/schemas/UpdateOutboundUseCaseRequest"
1874
+ }
1875
+ }
1876
+ },
1877
+ "UpdateUseCaseRequestBase": {
1720
1878
  "type": "object",
1721
1879
  "properties": {
1722
1880
  "name": {
@@ -1725,25 +1883,186 @@
1725
1883
  "maxLength": 255,
1726
1884
  "description": "Use case name"
1727
1885
  },
1728
- "type": {
1729
- "type": "string",
1730
- "enum": [
1731
- "inbound",
1732
- "outbound"
1733
- ],
1734
- "description": "Use case type"
1735
- },
1736
1886
  "enabled": {
1737
1887
  "type": "boolean",
1738
1888
  "description": "Whether the use case is enabled"
1739
1889
  },
1740
- "configuration": {
1890
+ "change_description": {
1891
+ "type": "string",
1892
+ "maxLength": 2000,
1893
+ "description": "Optional description of this change (like a commit message)"
1894
+ }
1895
+ }
1896
+ },
1897
+ "UpdateInboundUseCaseRequest": {
1898
+ "allOf": [
1899
+ {
1900
+ "$ref": "#/components/schemas/UpdateUseCaseRequestBase"
1901
+ },
1902
+ {
1741
1903
  "type": "object",
1742
- "description": "Use case specific configuration",
1743
- "additionalProperties": true
1904
+ "properties": {
1905
+ "type": {
1906
+ "type": "string",
1907
+ "enum": [
1908
+ "inbound"
1909
+ ],
1910
+ "description": "Use case type"
1911
+ },
1912
+ "configuration": {
1913
+ "$ref": "#/components/schemas/InboundIntegrationEventConfiguration"
1914
+ }
1915
+ }
1916
+ }
1917
+ ]
1918
+ },
1919
+ "UpdateOutboundUseCaseRequest": {
1920
+ "allOf": [
1921
+ {
1922
+ "$ref": "#/components/schemas/UpdateUseCaseRequestBase"
1923
+ },
1924
+ {
1925
+ "type": "object",
1926
+ "properties": {
1927
+ "type": {
1928
+ "type": "string",
1929
+ "enum": [
1930
+ "outbound"
1931
+ ],
1932
+ "description": "Use case type"
1933
+ },
1934
+ "configuration": {
1935
+ "$ref": "#/components/schemas/OutboundIntegrationEventConfiguration"
1936
+ }
1937
+ }
1938
+ }
1939
+ ]
1940
+ },
1941
+ "UseCaseHistoryEntry": {
1942
+ "oneOf": [
1943
+ {
1944
+ "$ref": "#/components/schemas/InboundUseCaseHistoryEntry"
1945
+ },
1946
+ {
1947
+ "$ref": "#/components/schemas/OutboundUseCaseHistoryEntry"
1948
+ }
1949
+ ],
1950
+ "discriminator": {
1951
+ "propertyName": "type",
1952
+ "mapping": {
1953
+ "inbound": "#/components/schemas/InboundUseCaseHistoryEntry",
1954
+ "outbound": "#/components/schemas/OutboundUseCaseHistoryEntry"
1744
1955
  }
1745
1956
  }
1746
1957
  },
1958
+ "UseCaseHistoryEntryBase": {
1959
+ "type": "object",
1960
+ "required": [
1961
+ "id",
1962
+ "useCaseId",
1963
+ "integrationId",
1964
+ "name",
1965
+ "type",
1966
+ "enabled",
1967
+ "created_at",
1968
+ "updated_at",
1969
+ "history_created_at"
1970
+ ],
1971
+ "properties": {
1972
+ "id": {
1973
+ "type": "string",
1974
+ "format": "uuid",
1975
+ "description": "Unique identifier for this history entry"
1976
+ },
1977
+ "useCaseId": {
1978
+ "type": "string",
1979
+ "format": "uuid",
1980
+ "description": "Reference to the parent use case"
1981
+ },
1982
+ "integrationId": {
1983
+ "type": "string",
1984
+ "format": "uuid",
1985
+ "description": "Parent integration ID"
1986
+ },
1987
+ "name": {
1988
+ "type": "string",
1989
+ "description": "Use case name at this point in history"
1990
+ },
1991
+ "enabled": {
1992
+ "type": "boolean",
1993
+ "description": "Whether the use case was enabled at this point in history"
1994
+ },
1995
+ "change_description": {
1996
+ "type": "string",
1997
+ "description": "Description of the change that was made at this point in history"
1998
+ },
1999
+ "created_at": {
2000
+ "type": "string",
2001
+ "format": "date-time",
2002
+ "description": "ISO-8601 timestamp when the use case was originally created"
2003
+ },
2004
+ "updated_at": {
2005
+ "type": "string",
2006
+ "format": "date-time",
2007
+ "description": "ISO-8601 timestamp of this historical snapshot (before the update)"
2008
+ },
2009
+ "history_created_at": {
2010
+ "type": "string",
2011
+ "format": "date-time",
2012
+ "description": "ISO-8601 timestamp when this history entry was created"
2013
+ }
2014
+ }
2015
+ },
2016
+ "InboundUseCaseHistoryEntry": {
2017
+ "allOf": [
2018
+ {
2019
+ "$ref": "#/components/schemas/UseCaseHistoryEntryBase"
2020
+ },
2021
+ {
2022
+ "type": "object",
2023
+ "required": [
2024
+ "type"
2025
+ ],
2026
+ "properties": {
2027
+ "type": {
2028
+ "type": "string",
2029
+ "enum": [
2030
+ "inbound"
2031
+ ],
2032
+ "description": "Use case type"
2033
+ },
2034
+ "configuration": {
2035
+ "$ref": "#/components/schemas/InboundIntegrationEventConfiguration"
2036
+ }
2037
+ }
2038
+ }
2039
+ ]
2040
+ },
2041
+ "OutboundUseCaseHistoryEntry": {
2042
+ "allOf": [
2043
+ {
2044
+ "$ref": "#/components/schemas/UseCaseHistoryEntryBase"
2045
+ },
2046
+ {
2047
+ "type": "object",
2048
+ "required": [
2049
+ "type"
2050
+ ],
2051
+ "properties": {
2052
+ "type": {
2053
+ "type": "string",
2054
+ "enum": [
2055
+ "outbound"
2056
+ ],
2057
+ "description": "Use case type"
2058
+ },
2059
+ "configuration": {
2060
+ "$ref": "#/components/schemas/OutboundIntegrationEventConfiguration"
2061
+ }
2062
+ }
2063
+ }
2064
+ ]
2065
+ },
1747
2066
  "MappingSimulationRequest": {
1748
2067
  "type": "object",
1749
2068
  "required": [
@@ -1991,15 +2310,16 @@
1991
2310
  "type": "object",
1992
2311
  "description": "[v2.0] Event type mappings",
1993
2312
  "additionalProperties": {
1994
- "$ref": "#/components/schemas/IntegrationEvent"
2313
+ "$ref": "#/components/schemas/InboundIntegrationEventConfiguration"
1995
2314
  }
1996
2315
  }
1997
2316
  }
1998
2317
  }
1999
2318
  }
2000
2319
  },
2001
- "IntegrationEvent": {
2320
+ "InboundIntegrationEventConfiguration": {
2002
2321
  "type": "object",
2322
+ "description": "Configuration for inbound use cases (ERP to epilot)",
2003
2323
  "properties": {
2004
2324
  "entities": {
2005
2325
  "type": "array",
@@ -2017,6 +2337,11 @@
2017
2337
  }
2018
2338
  }
2019
2339
  },
2340
+ "OutboundIntegrationEventConfiguration": {
2341
+ "type": "object",
2342
+ "description": "Configuration for outbound use cases (epilot to ERP). Structure TBD.",
2343
+ "additionalProperties": true
2344
+ },
2020
2345
  "IntegrationEntity": {
2021
2346
  "type": "object",
2022
2347
  "required": [
@@ -2302,6 +2627,9 @@
2302
2627
  }
2303
2628
  },
2304
2629
  "servers": [
2630
+ {
2631
+ "url": "https://erp-integration-api.sls.epilot.io"
2632
+ },
2305
2633
  {
2306
2634
  "url": "https://erp-integration-api.sls.epilot.io"
2307
2635
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/erp-integration-client",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "Client library for ePilot ERP Integration API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",