@epilot/erp-integration-client 0.15.3 → 0.15.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (()=>{"use strict";var e={330:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(466));t.default=o.default},466:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"","version":""},"servers":[{"url":"https://erp-integration-api.sls.epilot.io"}],"paths":{"/v1/erp/tracking/acknowledgement":{"post":{"operationId":"acknowledgeTracking","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/erp/trigger":{"post":{"operationId":"triggerErp","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/erp/updates/events":{"post":{"operationId":"processErpUpdatesEvents","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v2/erp/updates/events":{"post":{"operationId":"processErpUpdatesEventsV2","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v2/erp/updates/mapping_simulation":{"post":{"operationId":"simulateMappingV2","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/erp/updates/mapping_simulation":{"post":{"operationId":"simulateMapping","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations":{"get":{"operationId":"listIntegrations","responses":{}},"post":{"operationId":"createIntegration","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}":{"get":{"operationId":"getIntegration","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}},"put":{"operationId":"updateIntegration","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteIntegration","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}}},"/v1/integrations/{integrationId}/events":{"post":{"operationId":"queryEvents","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/events/replay":{"post":{"operationId":"replayEvents","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/use-cases":{"get":{"operationId":"listUseCases","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}},"post":{"operationId":"createUseCase","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/use-cases/{useCaseId}":{"get":{"operationId":"getUseCase","parameters":[{"name":"integrationId","in":"path","required":true},{"name":"useCaseId","in":"path","required":true}],"responses":{}},"put":{"operationId":"updateUseCase","parameters":[{"name":"integrationId","in":"path","required":true},{"name":"useCaseId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteUseCase","parameters":[{"name":"integrationId","in":"path","required":true},{"name":"useCaseId","in":"path","required":true}],"responses":{}}},"/v1/integrations/{integrationId}/use-cases/{useCaseId}/history":{"get":{"operationId":"listUseCaseHistory","parameters":[{"name":"integrationId","in":"path","required":true},{"name":"useCaseId","in":"path","required":true},{"name":"cursor","in":"query","required":false}],"responses":{}}},"/v2/integrations":{"get":{"operationId":"listIntegrationsV2","responses":{}},"post":{"operationId":"createIntegrationV2","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v2/integrations/{integrationId}":{"get":{"operationId":"getIntegrationV2","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}},"put":{"operationId":"updateIntegrationV2","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteIntegrationV2","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}}},"/v1/integrations/{integrationId}/app-mapping":{"put":{"operationId":"setIntegrationAppMapping","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteIntegrationAppMapping","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/monitoring/events":{"post":{"operationId":"queryMonitoringEvents","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}/monitoring/access-logs":{"post":{"operationId":"queryAccessLogs","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":{}}},"QueryMonitoringEventsResponse":{"content":{"application/json":{}}},"GetMonitoringStatsResponse":{"content":{"application/json":{}}},"QueryAccessLogsResponse":{"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={187: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/events":{"post":{"operationId":"queryMonitoringEvents","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":{}}}},"components":{"responses":{"BadRequest":{"content":{"application/json":{}}},"NotFound":{"content":{"application/json":{}}},"Unauthorized":{"content":{"application/json":{}}},"InternalServerError":{"content":{"application/json":{}}},"QueryMonitoringEventsResponse":{"content":{"application/json":{}}},"GetMonitoringStatsResponse":{"content":{"application/json":{}}},"QueryAccessLogsResponse":{"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}(187),r=exports;for(var o in n)r[o]=n[o];n.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})();
@@ -414,6 +414,19 @@
414
414
  "responses": {}
415
415
  }
416
416
  },
417
+ "/v1/integrations/{integrationId}/outbound-status": {
418
+ "get": {
419
+ "operationId": "getOutboundStatus",
420
+ "parameters": [
421
+ {
422
+ "name": "integrationId",
423
+ "in": "path",
424
+ "required": true
425
+ }
426
+ ],
427
+ "responses": {}
428
+ }
429
+ },
417
430
  "/v1/integrations/{integrationId}/monitoring/access-logs": {
418
431
  "post": {
419
432
  "operationId": "queryAccessLogs",
package/dist/openapi.d.ts CHANGED
@@ -190,7 +190,7 @@ declare namespace Components {
190
190
  * Use case type
191
191
  */
192
192
  type: "outbound";
193
- configuration?: /* Configuration for outbound use cases (epilot to ERP). Structure TBD. */ OutboundIntegrationEventConfiguration;
193
+ configuration?: /* Configuration for outbound use cases. Defines the event that triggers the flow and the webhook mappings. */ OutboundIntegrationEventConfiguration;
194
194
  }
195
195
  export type CreateUseCaseRequest = CreateInboundUseCaseRequest | CreateOutboundUseCaseRequest;
196
196
  export interface CreateUseCaseRequestBase {
@@ -213,6 +213,27 @@ declare namespace Components {
213
213
  */
214
214
  component_id: string; // uuid
215
215
  }
216
+ /**
217
+ * Configuration for how the transformed event should be delivered
218
+ */
219
+ export interface DeliveryConfig {
220
+ /**
221
+ * Delivery mechanism type (currently only webhook is supported)
222
+ */
223
+ type: "webhook";
224
+ /**
225
+ * Reference to the webhook configuration in svc-webhooks
226
+ */
227
+ webhook_id: string;
228
+ /**
229
+ * Cached webhook name for display purposes
230
+ */
231
+ webhook_name?: string;
232
+ /**
233
+ * Cached webhook URL for display purposes
234
+ */
235
+ webhook_url?: string;
236
+ }
216
237
  export interface EmbeddedInboundUseCaseRequest {
217
238
  /**
218
239
  * Optional use case ID for update matching.
@@ -265,7 +286,7 @@ declare namespace Components {
265
286
  * Use case type
266
287
  */
267
288
  type: "outbound";
268
- configuration?: /* Configuration for outbound use cases (epilot to ERP). Structure TBD. */ OutboundIntegrationEventConfiguration;
289
+ configuration?: /* Configuration for outbound use cases. Defines the event that triggers the flow and the webhook mappings. */ OutboundIntegrationEventConfiguration;
269
290
  }
270
291
  export type EmbeddedUseCaseRequest = EmbeddedInboundUseCaseRequest | EmbeddedOutboundUseCaseRequest;
271
292
  export interface EmbeddedUseCaseRequestBase {
@@ -876,11 +897,79 @@ declare namespace Components {
876
897
  [name: string]: any;
877
898
  }[];
878
899
  }
900
+ export interface OutboundConflict {
901
+ /**
902
+ * Type of conflict:
903
+ * - 'event_disabled': Event catalog event is disabled while use case is enabled
904
+ * - 'all_webhooks_disabled': All webhooks are disabled while use case is enabled
905
+ * - 'event_enabled_while_disabled': Event is enabled while use case is disabled
906
+ * - 'webhook_enabled_while_disabled': A webhook is enabled while use case is disabled
907
+ *
908
+ */
909
+ type: "event_disabled" | "all_webhooks_disabled" | "event_enabled_while_disabled" | "webhook_enabled_while_disabled";
910
+ /**
911
+ * Webhook ID (only present for webhook_enabled_while_disabled conflicts)
912
+ */
913
+ webhookId?: string;
914
+ /**
915
+ * Human-readable description of the conflict
916
+ */
917
+ message: string;
918
+ }
879
919
  /**
880
- * Configuration for outbound use cases (epilot to ERP). Structure TBD.
920
+ * Configuration for outbound use cases. Defines the event that triggers the flow and the webhook mappings.
881
921
  */
882
922
  export interface OutboundIntegrationEventConfiguration {
883
- [name: string]: any;
923
+ /**
924
+ * The Event Catalog event name that triggers this outbound flow
925
+ * example:
926
+ * contract.created
927
+ */
928
+ event_catalog_event: string;
929
+ /**
930
+ * List of mappings that transform and deliver the event
931
+ */
932
+ mappings: [
933
+ /* A mapping that transforms an event and delivers it to a webhook */ OutboundMapping,
934
+ .../* A mapping that transforms an event and delivers it to a webhook */ OutboundMapping[]
935
+ ];
936
+ }
937
+ /**
938
+ * A mapping that transforms an event and delivers it to a webhook
939
+ */
940
+ export interface OutboundMapping {
941
+ /**
942
+ * Unique identifier for this mapping
943
+ */
944
+ id: string; // uuid
945
+ /**
946
+ * Human-readable name for this mapping
947
+ * example:
948
+ * ERP Contract Sync
949
+ */
950
+ name: string;
951
+ /**
952
+ * JSONata expression to transform the event payload
953
+ * example:
954
+ * { "id": entity._id, "customer": entity.customer_name }
955
+ */
956
+ jsonata_expression: string;
957
+ /**
958
+ * Whether this mapping is active
959
+ */
960
+ enabled: boolean;
961
+ delivery: /* Configuration for how the transformed event should be delivered */ DeliveryConfig;
962
+ /**
963
+ * Timestamp when the mapping was created
964
+ */
965
+ created_at?: string; // date-time
966
+ /**
967
+ * Timestamp when the mapping was last updated
968
+ */
969
+ updated_at?: string; // date-time
970
+ }
971
+ export interface OutboundStatusResponse {
972
+ useCases: OutboundUseCaseStatus[];
884
973
  }
885
974
  export interface OutboundUseCase {
886
975
  /**
@@ -912,7 +1001,7 @@ declare namespace Components {
912
1001
  * ISO-8601 timestamp when the use case was last updated
913
1002
  */
914
1003
  updated_at: string; // date-time
915
- configuration?: /* Configuration for outbound use cases (epilot to ERP). Structure TBD. */ OutboundIntegrationEventConfiguration;
1004
+ configuration?: /* Configuration for outbound use cases. Defines the event that triggers the flow and the webhook mappings. */ OutboundIntegrationEventConfiguration;
916
1005
  }
917
1006
  export interface OutboundUseCaseHistoryEntry {
918
1007
  /**
@@ -955,7 +1044,44 @@ declare namespace Components {
955
1044
  * Use case type
956
1045
  */
957
1046
  type: "outbound";
958
- configuration?: /* Configuration for outbound use cases (epilot to ERP). Structure TBD. */ OutboundIntegrationEventConfiguration;
1047
+ configuration?: /* Configuration for outbound use cases. Defines the event that triggers the flow and the webhook mappings. */ OutboundIntegrationEventConfiguration;
1048
+ }
1049
+ export interface OutboundUseCaseStatus {
1050
+ /**
1051
+ * Unique identifier for the use case
1052
+ */
1053
+ useCaseId: string; // uuid
1054
+ /**
1055
+ * Human-readable name of the use case
1056
+ */
1057
+ name: string;
1058
+ /**
1059
+ * Whether the use case is enabled
1060
+ */
1061
+ useCaseEnabled: boolean;
1062
+ /**
1063
+ * The Event Catalog event name that triggers this outbound flow
1064
+ * example:
1065
+ * contract.created
1066
+ */
1067
+ eventCatalogEvent?: string;
1068
+ /**
1069
+ * Whether the event is enabled in Event Catalog. Null if the API is unreachable.
1070
+ */
1071
+ eventEnabled?: boolean | null;
1072
+ webhooks?: WebhookStatus[];
1073
+ /**
1074
+ * Overall status of the use case:
1075
+ * - 'ok': Use case is enabled and all dependencies are properly configured
1076
+ * - 'conflict': Use case has configuration issues (disabled events/webhooks while enabled)
1077
+ * - 'disabled': Use case is disabled
1078
+ *
1079
+ */
1080
+ status: "ok" | "conflict" | "disabled";
1081
+ /**
1082
+ * List of detected conflicts, if any
1083
+ */
1084
+ conflicts?: OutboundConflict[];
959
1085
  }
960
1086
  export interface QueryAccessLogsRequest {
961
1087
  /**
@@ -1482,7 +1608,7 @@ declare namespace Components {
1482
1608
  * Use case type
1483
1609
  */
1484
1610
  type?: "outbound";
1485
- configuration?: /* Configuration for outbound use cases (epilot to ERP). Structure TBD. */ OutboundIntegrationEventConfiguration;
1611
+ configuration?: /* Configuration for outbound use cases. Defines the event that triggers the flow and the webhook mappings. */ OutboundIntegrationEventConfiguration;
1486
1612
  }
1487
1613
  export type UpdateUseCaseRequest = UpdateInboundUseCaseRequest | UpdateOutboundUseCaseRequest;
1488
1614
  export interface UpdateUseCaseRequestBase {
@@ -1593,6 +1719,20 @@ declare namespace Components {
1593
1719
  */
1594
1720
  history_created_at: string; // date-time
1595
1721
  }
1722
+ export interface WebhookStatus {
1723
+ /**
1724
+ * Unique identifier for the webhook
1725
+ */
1726
+ webhookId: string;
1727
+ /**
1728
+ * Human-readable name of the webhook
1729
+ */
1730
+ webhookName?: string;
1731
+ /**
1732
+ * Whether the webhook is enabled. Null if the API is unreachable.
1733
+ */
1734
+ enabled?: boolean | null;
1735
+ }
1596
1736
  }
1597
1737
  }
1598
1738
  declare namespace Paths {
@@ -1775,6 +1915,20 @@ declare namespace Paths {
1775
1915
  export type $500 = Components.Responses.InternalServerError;
1776
1916
  }
1777
1917
  }
1918
+ namespace GetOutboundStatus {
1919
+ namespace Parameters {
1920
+ export type IntegrationId = string; // uuid
1921
+ }
1922
+ export interface PathParameters {
1923
+ integrationId: Parameters.IntegrationId /* uuid */;
1924
+ }
1925
+ namespace Responses {
1926
+ export type $200 = Components.Schemas.OutboundStatusResponse;
1927
+ export type $401 = Components.Responses.Unauthorized;
1928
+ export type $404 = Components.Responses.NotFound;
1929
+ export type $500 = Components.Responses.InternalServerError;
1930
+ }
1931
+ }
1778
1932
  namespace GetUseCase {
1779
1933
  namespace Parameters {
1780
1934
  export type IntegrationId = string; // uuid
@@ -2392,6 +2546,18 @@ export interface OperationMethods {
2392
2546
  data?: Paths.GetMonitoringStats.RequestBody,
2393
2547
  config?: AxiosRequestConfig
2394
2548
  ): OperationResponse<Paths.GetMonitoringStats.Responses.$200>
2549
+ /**
2550
+ * getOutboundStatus - getOutboundStatus
2551
+ *
2552
+ * Get the status of all outbound use cases for a specific integration.
2553
+ * Returns conflict information when events or webhooks are disabled but the use case is enabled.
2554
+ *
2555
+ */
2556
+ 'getOutboundStatus'(
2557
+ parameters?: Parameters<Paths.GetOutboundStatus.PathParameters> | null,
2558
+ data?: any,
2559
+ config?: AxiosRequestConfig
2560
+ ): OperationResponse<Paths.GetOutboundStatus.Responses.$200>
2395
2561
  /**
2396
2562
  * queryAccessLogs - queryAccessLogs
2397
2563
  *
@@ -2757,6 +2923,20 @@ export interface PathsDictionary {
2757
2923
  config?: AxiosRequestConfig
2758
2924
  ): OperationResponse<Paths.GetMonitoringStats.Responses.$200>
2759
2925
  }
2926
+ ['/v1/integrations/{integrationId}/outbound-status']: {
2927
+ /**
2928
+ * getOutboundStatus - getOutboundStatus
2929
+ *
2930
+ * Get the status of all outbound use cases for a specific integration.
2931
+ * Returns conflict information when events or webhooks are disabled but the use case is enabled.
2932
+ *
2933
+ */
2934
+ 'get'(
2935
+ parameters?: Parameters<Paths.GetOutboundStatus.PathParameters> | null,
2936
+ data?: any,
2937
+ config?: AxiosRequestConfig
2938
+ ): OperationResponse<Paths.GetOutboundStatus.Responses.$200>
2939
+ }
2760
2940
  ['/v1/integrations/{integrationId}/monitoring/access-logs']: {
2761
2941
  /**
2762
2942
  * queryAccessLogs - queryAccessLogs
@@ -2784,6 +2964,7 @@ export type CreateOutboundUseCaseRequest = Components.Schemas.CreateOutboundUseC
2784
2964
  export type CreateUseCaseRequest = Components.Schemas.CreateUseCaseRequest;
2785
2965
  export type CreateUseCaseRequestBase = Components.Schemas.CreateUseCaseRequestBase;
2786
2966
  export type DeleteIntegrationAppMappingRequest = Components.Schemas.DeleteIntegrationAppMappingRequest;
2967
+ export type DeliveryConfig = Components.Schemas.DeliveryConfig;
2787
2968
  export type EmbeddedInboundUseCaseRequest = Components.Schemas.EmbeddedInboundUseCaseRequest;
2788
2969
  export type EmbeddedOutboundUseCaseRequest = Components.Schemas.EmbeddedOutboundUseCaseRequest;
2789
2970
  export type EmbeddedUseCaseRequest = Components.Schemas.EmbeddedUseCaseRequest;
@@ -2813,9 +2994,13 @@ export type MeterReadingUpdate = Components.Schemas.MeterReadingUpdate;
2813
2994
  export type MeterUniqueIdsConfig = Components.Schemas.MeterUniqueIdsConfig;
2814
2995
  export type MonitoringEvent = Components.Schemas.MonitoringEvent;
2815
2996
  export type MonitoringStats = Components.Schemas.MonitoringStats;
2997
+ export type OutboundConflict = Components.Schemas.OutboundConflict;
2816
2998
  export type OutboundIntegrationEventConfiguration = Components.Schemas.OutboundIntegrationEventConfiguration;
2999
+ export type OutboundMapping = Components.Schemas.OutboundMapping;
3000
+ export type OutboundStatusResponse = Components.Schemas.OutboundStatusResponse;
2817
3001
  export type OutboundUseCase = Components.Schemas.OutboundUseCase;
2818
3002
  export type OutboundUseCaseHistoryEntry = Components.Schemas.OutboundUseCaseHistoryEntry;
3003
+ export type OutboundUseCaseStatus = Components.Schemas.OutboundUseCaseStatus;
2819
3004
  export type QueryAccessLogsRequest = Components.Schemas.QueryAccessLogsRequest;
2820
3005
  export type QueryEventsRequest = Components.Schemas.QueryEventsRequest;
2821
3006
  export type QueryMonitoringEventsRequest = Components.Schemas.QueryMonitoringEventsRequest;
@@ -2840,3 +3025,4 @@ export type UseCase = Components.Schemas.UseCase;
2840
3025
  export type UseCaseBase = Components.Schemas.UseCaseBase;
2841
3026
  export type UseCaseHistoryEntry = Components.Schemas.UseCaseHistoryEntry;
2842
3027
  export type UseCaseHistoryEntryBase = Components.Schemas.UseCaseHistoryEntryBase;
3028
+ export type WebhookStatus = Components.Schemas.WebhookStatus;
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.24.0",
5
+ "version": "0.25.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": [
@@ -2007,6 +2007,49 @@
2007
2007
  }
2008
2008
  }
2009
2009
  },
2010
+ "/v1/integrations/{integrationId}/outbound-status": {
2011
+ "get": {
2012
+ "operationId": "getOutboundStatus",
2013
+ "summary": "getOutboundStatus",
2014
+ "description": "Get the status of all outbound use cases for a specific integration.\nReturns conflict information when events or webhooks are disabled but the use case is enabled.\n",
2015
+ "tags": [
2016
+ "integrations"
2017
+ ],
2018
+ "parameters": [
2019
+ {
2020
+ "name": "integrationId",
2021
+ "in": "path",
2022
+ "required": true,
2023
+ "description": "The integration ID",
2024
+ "schema": {
2025
+ "type": "string",
2026
+ "format": "uuid"
2027
+ }
2028
+ }
2029
+ ],
2030
+ "responses": {
2031
+ "200": {
2032
+ "description": "Successfully retrieved outbound status",
2033
+ "content": {
2034
+ "application/json": {
2035
+ "schema": {
2036
+ "$ref": "#/components/schemas/OutboundStatusResponse"
2037
+ }
2038
+ }
2039
+ }
2040
+ },
2041
+ "401": {
2042
+ "$ref": "#/components/responses/Unauthorized"
2043
+ },
2044
+ "404": {
2045
+ "$ref": "#/components/responses/NotFound"
2046
+ },
2047
+ "500": {
2048
+ "$ref": "#/components/responses/InternalServerError"
2049
+ }
2050
+ }
2051
+ }
2052
+ },
2010
2053
  "/v1/integrations/{integrationId}/monitoring/access-logs": {
2011
2054
  "post": {
2012
2055
  "operationId": "queryAccessLogs",
@@ -3115,8 +3158,219 @@
3115
3158
  },
3116
3159
  "OutboundIntegrationEventConfiguration": {
3117
3160
  "type": "object",
3118
- "description": "Configuration for outbound use cases (epilot to ERP). Structure TBD.",
3119
- "additionalProperties": true
3161
+ "required": [
3162
+ "event_catalog_event",
3163
+ "mappings"
3164
+ ],
3165
+ "description": "Configuration for outbound use cases. Defines the event that triggers the flow and the webhook mappings.",
3166
+ "properties": {
3167
+ "event_catalog_event": {
3168
+ "type": "string",
3169
+ "description": "The Event Catalog event name that triggers this outbound flow",
3170
+ "example": "contract.created"
3171
+ },
3172
+ "mappings": {
3173
+ "type": "array",
3174
+ "minItems": 1,
3175
+ "items": {
3176
+ "$ref": "#/components/schemas/OutboundMapping"
3177
+ },
3178
+ "description": "List of mappings that transform and deliver the event"
3179
+ }
3180
+ }
3181
+ },
3182
+ "OutboundMapping": {
3183
+ "type": "object",
3184
+ "required": [
3185
+ "id",
3186
+ "name",
3187
+ "jsonata_expression",
3188
+ "enabled",
3189
+ "delivery"
3190
+ ],
3191
+ "description": "A mapping that transforms an event and delivers it to a webhook",
3192
+ "properties": {
3193
+ "id": {
3194
+ "type": "string",
3195
+ "format": "uuid",
3196
+ "description": "Unique identifier for this mapping"
3197
+ },
3198
+ "name": {
3199
+ "type": "string",
3200
+ "description": "Human-readable name for this mapping",
3201
+ "example": "ERP Contract Sync"
3202
+ },
3203
+ "jsonata_expression": {
3204
+ "type": "string",
3205
+ "description": "JSONata expression to transform the event payload",
3206
+ "example": "{ \"id\": entity._id, \"customer\": entity.customer_name }"
3207
+ },
3208
+ "enabled": {
3209
+ "type": "boolean",
3210
+ "description": "Whether this mapping is active",
3211
+ "default": true
3212
+ },
3213
+ "delivery": {
3214
+ "$ref": "#/components/schemas/DeliveryConfig"
3215
+ },
3216
+ "created_at": {
3217
+ "type": "string",
3218
+ "format": "date-time",
3219
+ "description": "Timestamp when the mapping was created"
3220
+ },
3221
+ "updated_at": {
3222
+ "type": "string",
3223
+ "format": "date-time",
3224
+ "description": "Timestamp when the mapping was last updated"
3225
+ }
3226
+ }
3227
+ },
3228
+ "DeliveryConfig": {
3229
+ "type": "object",
3230
+ "required": [
3231
+ "type",
3232
+ "webhook_id"
3233
+ ],
3234
+ "description": "Configuration for how the transformed event should be delivered",
3235
+ "properties": {
3236
+ "type": {
3237
+ "type": "string",
3238
+ "enum": [
3239
+ "webhook"
3240
+ ],
3241
+ "description": "Delivery mechanism type (currently only webhook is supported)"
3242
+ },
3243
+ "webhook_id": {
3244
+ "type": "string",
3245
+ "description": "Reference to the webhook configuration in svc-webhooks"
3246
+ },
3247
+ "webhook_name": {
3248
+ "type": "string",
3249
+ "description": "Cached webhook name for display purposes"
3250
+ },
3251
+ "webhook_url": {
3252
+ "type": "string",
3253
+ "description": "Cached webhook URL for display purposes"
3254
+ }
3255
+ }
3256
+ },
3257
+ "OutboundStatusResponse": {
3258
+ "type": "object",
3259
+ "required": [
3260
+ "useCases"
3261
+ ],
3262
+ "properties": {
3263
+ "useCases": {
3264
+ "type": "array",
3265
+ "items": {
3266
+ "$ref": "#/components/schemas/OutboundUseCaseStatus"
3267
+ }
3268
+ }
3269
+ }
3270
+ },
3271
+ "OutboundUseCaseStatus": {
3272
+ "type": "object",
3273
+ "required": [
3274
+ "useCaseId",
3275
+ "name",
3276
+ "useCaseEnabled",
3277
+ "status"
3278
+ ],
3279
+ "properties": {
3280
+ "useCaseId": {
3281
+ "type": "string",
3282
+ "format": "uuid",
3283
+ "description": "Unique identifier for the use case"
3284
+ },
3285
+ "name": {
3286
+ "type": "string",
3287
+ "description": "Human-readable name of the use case"
3288
+ },
3289
+ "useCaseEnabled": {
3290
+ "type": "boolean",
3291
+ "description": "Whether the use case is enabled"
3292
+ },
3293
+ "eventCatalogEvent": {
3294
+ "type": "string",
3295
+ "description": "The Event Catalog event name that triggers this outbound flow",
3296
+ "example": "contract.created"
3297
+ },
3298
+ "eventEnabled": {
3299
+ "type": "boolean",
3300
+ "nullable": true,
3301
+ "description": "Whether the event is enabled in Event Catalog. Null if the API is unreachable."
3302
+ },
3303
+ "webhooks": {
3304
+ "type": "array",
3305
+ "items": {
3306
+ "$ref": "#/components/schemas/WebhookStatus"
3307
+ }
3308
+ },
3309
+ "status": {
3310
+ "type": "string",
3311
+ "enum": [
3312
+ "ok",
3313
+ "conflict",
3314
+ "disabled"
3315
+ ],
3316
+ "description": "Overall status of the use case:\n- 'ok': Use case is enabled and all dependencies are properly configured\n- 'conflict': Use case has configuration issues (disabled events/webhooks while enabled)\n- 'disabled': Use case is disabled\n"
3317
+ },
3318
+ "conflicts": {
3319
+ "type": "array",
3320
+ "items": {
3321
+ "$ref": "#/components/schemas/OutboundConflict"
3322
+ },
3323
+ "description": "List of detected conflicts, if any"
3324
+ }
3325
+ }
3326
+ },
3327
+ "WebhookStatus": {
3328
+ "type": "object",
3329
+ "required": [
3330
+ "webhookId"
3331
+ ],
3332
+ "properties": {
3333
+ "webhookId": {
3334
+ "type": "string",
3335
+ "description": "Unique identifier for the webhook"
3336
+ },
3337
+ "webhookName": {
3338
+ "type": "string",
3339
+ "description": "Human-readable name of the webhook"
3340
+ },
3341
+ "enabled": {
3342
+ "type": "boolean",
3343
+ "nullable": true,
3344
+ "description": "Whether the webhook is enabled. Null if the API is unreachable."
3345
+ }
3346
+ }
3347
+ },
3348
+ "OutboundConflict": {
3349
+ "type": "object",
3350
+ "required": [
3351
+ "type",
3352
+ "message"
3353
+ ],
3354
+ "properties": {
3355
+ "type": {
3356
+ "type": "string",
3357
+ "enum": [
3358
+ "event_disabled",
3359
+ "all_webhooks_disabled",
3360
+ "event_enabled_while_disabled",
3361
+ "webhook_enabled_while_disabled"
3362
+ ],
3363
+ "description": "Type of conflict:\n- 'event_disabled': Event catalog event is disabled while use case is enabled\n- 'all_webhooks_disabled': All webhooks are disabled while use case is enabled\n- 'event_enabled_while_disabled': Event is enabled while use case is disabled\n- 'webhook_enabled_while_disabled': A webhook is enabled while use case is disabled\n"
3364
+ },
3365
+ "webhookId": {
3366
+ "type": "string",
3367
+ "description": "Webhook ID (only present for webhook_enabled_while_disabled conflicts)"
3368
+ },
3369
+ "message": {
3370
+ "type": "string",
3371
+ "description": "Human-readable description of the conflict"
3372
+ }
3373
+ }
3120
3374
  },
3121
3375
  "IntegrationEntity": {
3122
3376
  "type": "object",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/erp-integration-client",
3
- "version": "0.15.3",
3
+ "version": "0.15.4",
4
4
  "description": "Client library for ePilot ERP Integration API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",