@epilot/erp-integration-client 0.23.0 → 0.24.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={390:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(466));t.default=o.default},466:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"","version":""},"servers":[{"url":"https://erp-integration-api.sls.epilot.io"}],"paths":{"/v1/erp/tracking/acknowledgement":{"post":{"operationId":"acknowledgeTracking","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/erp/trigger":{"post":{"operationId":"triggerErp","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/erp/updates/events":{"post":{"deprecated":true,"operationId":"processErpUpdatesEvents","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v2/erp/updates/events":{"post":{"deprecated":true,"operationId":"processErpUpdatesEventsV2","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v3/erp/updates/events":{"post":{"operationId":"processErpUpdatesEventsV3","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v2/erp/updates/mapping_simulation":{"post":{"operationId":"simulateMappingV2","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/erp/updates/mapping_simulation":{"post":{"operationId":"simulateMapping","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations":{"get":{"operationId":"listIntegrations","responses":{}},"post":{"operationId":"createIntegration","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}":{"get":{"operationId":"getIntegration","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}},"put":{"operationId":"updateIntegration","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteIntegration","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}}},"/v1/integrations/{integrationId}/events":{"post":{"operationId":"queryEvents","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/events/replay":{"post":{"operationId":"replayEvents","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/use-cases":{"get":{"operationId":"listUseCases","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}},"post":{"operationId":"createUseCase","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/use-cases/{useCaseId}":{"get":{"operationId":"getUseCase","parameters":[{"name":"integrationId","in":"path","required":true},{"name":"useCaseId","in":"path","required":true}],"responses":{}},"put":{"operationId":"updateUseCase","parameters":[{"name":"integrationId","in":"path","required":true},{"name":"useCaseId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteUseCase","parameters":[{"name":"integrationId","in":"path","required":true},{"name":"useCaseId","in":"path","required":true}],"responses":{}}},"/v1/integrations/{integrationId}/use-cases/{useCaseId}/history":{"get":{"operationId":"listUseCaseHistory","parameters":[{"name":"integrationId","in":"path","required":true},{"name":"useCaseId","in":"path","required":true},{"name":"cursor","in":"query","required":false}],"responses":{}}},"/v2/integrations":{"get":{"operationId":"listIntegrationsV2","responses":{}},"post":{"operationId":"createIntegrationV2","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v2/integrations/{integrationId}":{"get":{"operationId":"getIntegrationV2","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}},"put":{"operationId":"updateIntegrationV2","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteIntegrationV2","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}}},"/v1/integrations/{integrationId}/app-mapping":{"put":{"operationId":"setIntegrationAppMapping","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteIntegrationAppMapping","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/monitoring/inbound-events":{"post":{"operationId":"queryInboundMonitoringEvents","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/monitoring/stats":{"post":{"operationId":"getMonitoringStats","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/outbound-status":{"get":{"operationId":"getOutboundStatus","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}}},"/v1/integrations/{integrationId}/monitoring/access-logs":{"post":{"operationId":"queryAccessLogs","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/monitoring/outbound-events":{"post":{"operationId":"queryOutboundMonitoringEvents","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}}},"components":{"responses":{"BadRequest":{"content":{"application/json":{}}},"NotFound":{"content":{"application/json":{}}},"Unauthorized":{"content":{"application/json":{}}},"InternalServerError":{"content":{"application/json":{}}},"QueryInboundMonitoringEventsResponse":{"content":{"application/json":{}}},"GetMonitoringStatsResponse":{"content":{"application/json":{}}},"QueryAccessLogsResponse":{"content":{"application/json":{}}},"QueryOutboundMonitoringEventsResponse":{"content":{"application/json":{}}},"ReplayEventsResponse":{"content":{"application/json":{}}},"ERPUpdatesResponse":{"content":{"application/json":{}}},"TriggerWebhookResponse":{"content":{"application/json":{}}},"QueryEventsResponse":{"content":{"application/json":{}}}}}}')}},t={},n=function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}(390),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,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(466));t.default=o.default},466:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"","version":""},"servers":[{"url":"https://erp-integration-api.sls.epilot.io"}],"paths":{"/v1/erp/tracking/acknowledgement":{"post":{"operationId":"acknowledgeTracking","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/erp/trigger":{"post":{"operationId":"triggerErp","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/erp/updates/events":{"post":{"deprecated":true,"operationId":"processErpUpdatesEvents","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v2/erp/updates/events":{"post":{"deprecated":true,"operationId":"processErpUpdatesEventsV2","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v3/erp/updates/events":{"post":{"operationId":"processErpUpdatesEventsV3","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v2/erp/updates/mapping_simulation":{"post":{"operationId":"simulateMappingV2","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/erp/updates/mapping_simulation":{"post":{"operationId":"simulateMapping","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations":{"get":{"operationId":"listIntegrations","responses":{}},"post":{"operationId":"createIntegration","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}":{"get":{"operationId":"getIntegration","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}},"put":{"operationId":"updateIntegration","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteIntegration","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}}},"/v1/integrations/{integrationId}/events":{"post":{"operationId":"queryEvents","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/events/replay":{"post":{"operationId":"replayEvents","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/use-cases":{"get":{"operationId":"listUseCases","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}},"post":{"operationId":"createUseCase","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/use-cases/{useCaseId}":{"get":{"operationId":"getUseCase","parameters":[{"name":"integrationId","in":"path","required":true},{"name":"useCaseId","in":"path","required":true}],"responses":{}},"put":{"operationId":"updateUseCase","parameters":[{"name":"integrationId","in":"path","required":true},{"name":"useCaseId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteUseCase","parameters":[{"name":"integrationId","in":"path","required":true},{"name":"useCaseId","in":"path","required":true}],"responses":{}}},"/v1/integrations/{integrationId}/use-cases/{useCaseId}/history":{"get":{"operationId":"listUseCaseHistory","parameters":[{"name":"integrationId","in":"path","required":true},{"name":"useCaseId","in":"path","required":true},{"name":"cursor","in":"query","required":false}],"responses":{}}},"/v2/integrations":{"get":{"operationId":"listIntegrationsV2","responses":{}},"post":{"operationId":"createIntegrationV2","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v2/integrations/{integrationId}":{"get":{"operationId":"getIntegrationV2","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}},"put":{"operationId":"updateIntegrationV2","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteIntegrationV2","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}}},"/v1/integrations/{integrationId}/app-mapping":{"put":{"operationId":"setIntegrationAppMapping","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteIntegrationAppMapping","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/monitoring/inbound-events":{"post":{"operationId":"queryInboundMonitoringEvents","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/monitoring/stats":{"post":{"operationId":"getMonitoringStats","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/monitoring/timeseries":{"post":{"operationId":"getMonitoringTimeSeries","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/outbound-status":{"get":{"operationId":"getOutboundStatus","parameters":[{"name":"integrationId","in":"path","required":true}],"responses":{}}},"/v1/integrations/{integrationId}/monitoring/access-logs":{"post":{"operationId":"queryAccessLogs","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/integrations/{integrationId}/monitoring/outbound-events":{"post":{"operationId":"queryOutboundMonitoringEvents","parameters":[{"name":"integrationId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}}},"components":{"responses":{"BadRequest":{"content":{"application/json":{}}},"NotFound":{"content":{"application/json":{}}},"Unauthorized":{"content":{"application/json":{}}},"InternalServerError":{"content":{"application/json":{}}},"QueryInboundMonitoringEventsResponse":{"content":{"application/json":{}}},"GetMonitoringStatsResponse":{"content":{"application/json":{}}},"GetMonitoringTimeSeriesResponse":{"content":{"application/json":{}}},"QueryAccessLogsResponse":{"content":{"application/json":{}}},"QueryOutboundMonitoringEventsResponse":{"content":{"application/json":{}}},"ReplayEventsResponse":{"content":{"application/json":{}}},"ERPUpdatesResponse":{"content":{"application/json":{}}},"TriggerWebhookResponse":{"content":{"application/json":{}}},"QueryEventsResponse":{"content":{"application/json":{}}}}}}')}},t={},n=function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}(390),r=exports;for(var o in n)r[o]=n[o];n.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})();
@@ -427,6 +427,25 @@
427
427
  "responses": {}
428
428
  }
429
429
  },
430
+ "/v1/integrations/{integrationId}/monitoring/timeseries": {
431
+ "post": {
432
+ "operationId": "getMonitoringTimeSeries",
433
+ "parameters": [
434
+ {
435
+ "name": "integrationId",
436
+ "in": "path",
437
+ "required": true
438
+ }
439
+ ],
440
+ "requestBody": {
441
+ "required": true,
442
+ "content": {
443
+ "application/json": {}
444
+ }
445
+ },
446
+ "responses": {}
447
+ }
448
+ },
430
449
  "/v1/integrations/{integrationId}/outbound-status": {
431
450
  "get": {
432
451
  "operationId": "getOutboundStatus",
@@ -511,6 +530,11 @@
511
530
  "application/json": {}
512
531
  }
513
532
  },
533
+ "GetMonitoringTimeSeriesResponse": {
534
+ "content": {
535
+ "application/json": {}
536
+ }
537
+ },
514
538
  "QueryAccessLogsResponse": {
515
539
  "content": {
516
540
  "application/json": {}
package/dist/openapi.d.ts CHANGED
@@ -18,13 +18,31 @@ declare namespace Components {
18
18
  */
19
19
  event_id: string;
20
20
  /**
21
- * Processing status for the event (skipped indicates duplicate deduplication_id)
21
+ * Processing status for the event (skipped indicates duplicate deduplication_id, ignored indicates unconfigured event)
22
22
  */
23
- status: "success" | "error" | "skipped";
23
+ status: "success" | "error" | "skipped" | "ignored";
24
24
  message?: string;
25
25
  }[];
26
26
  }
27
27
  export type GetMonitoringStatsResponse = Schemas.MonitoringStats;
28
+ export interface GetMonitoringTimeSeriesResponse {
29
+ /**
30
+ * The time bucket interval used for aggregation
31
+ */
32
+ interval: "5m" | "10m" | "30m" | "1h" | "3h" | "1d";
33
+ /**
34
+ * Start date of the time series
35
+ */
36
+ from_date: string; // date-time
37
+ /**
38
+ * End date of the time series
39
+ */
40
+ to_date: string; // date-time
41
+ /**
42
+ * List of time-series buckets with event counts
43
+ */
44
+ buckets: Schemas.TimeSeriesBucket[];
45
+ }
28
46
  export type InternalServerError = Schemas.ErrorResponseBase;
29
47
  export type NotFound = Schemas.ErrorResponseBase;
30
48
  export interface QueryAccessLogsResponse {
@@ -197,6 +215,10 @@ declare namespace Components {
197
215
  * List of access token IDs to associate with this integration
198
216
  */
199
217
  access_token_ids?: string[];
218
+ /**
219
+ * Configuration defining environment variables needed by this integration
220
+ */
221
+ environment_config?: EnvironmentFieldConfig[];
200
222
  }
201
223
  export interface CreateOutboundUseCaseRequest {
202
224
  /**
@@ -350,6 +372,32 @@ declare namespace Components {
350
372
  [name: string]: any;
351
373
  };
352
374
  }
375
+ export interface EnvironmentFieldConfig {
376
+ /**
377
+ * Environment variable key, used to look up the value in the Environments API.
378
+ */
379
+ key: string; // ^[a-z0-9][a-z0-9_.\-]{0,127}$
380
+ /**
381
+ * Display label for the field in the UI
382
+ */
383
+ label: string;
384
+ /**
385
+ * Whether the value is a plain string or an encrypted secret
386
+ */
387
+ type: "String" | "SecretString";
388
+ /**
389
+ * Help text shown below the field
390
+ */
391
+ description?: string;
392
+ /**
393
+ * Whether this field must be filled before the integration can be used
394
+ */
395
+ required?: boolean;
396
+ /**
397
+ * Sort order for display and drag-to-reorder
398
+ */
399
+ order?: number;
400
+ }
353
401
  export interface ErpEvent {
354
402
  /**
355
403
  * Type of event (create, update, delete)
@@ -478,6 +526,32 @@ declare namespace Components {
478
526
  */
479
527
  outbound_group_by?: ("event_name" | "status" | "webhook_config_id" | "date")[];
480
528
  }
529
+ export interface GetMonitoringTimeSeriesRequest {
530
+ /**
531
+ * Start date for the time series (inclusive)
532
+ * example:
533
+ * 2025-01-01T00:00:00Z
534
+ */
535
+ from_date: string; // date-time
536
+ /**
537
+ * End date for the time series (inclusive). Defaults to current time if not specified.
538
+ * example:
539
+ * 2025-01-31T23:59:59Z
540
+ */
541
+ to_date?: string; // date-time
542
+ /**
543
+ * The time bucket interval for aggregation
544
+ * example:
545
+ * 1h
546
+ */
547
+ interval: "5m" | "10m" | "30m" | "1h" | "3h" | "1d";
548
+ /**
549
+ * Filter by event direction. Defaults to both.
550
+ * example:
551
+ * both
552
+ */
553
+ direction?: "inbound" | "outbound" | "both";
554
+ }
481
555
  /**
482
556
  * Configuration for inbound use cases (ERP to epilot)
483
557
  */
@@ -649,6 +723,10 @@ declare namespace Components {
649
723
  * List of access token IDs associated with this integration
650
724
  */
651
725
  access_token_ids?: string[];
726
+ /**
727
+ * Configuration defining environment variables needed by this integration. Values are stored in the Environments API.
728
+ */
729
+ environment_config?: EnvironmentFieldConfig[];
652
730
  /**
653
731
  * ISO-8601 timestamp when the integration was created
654
732
  */
@@ -922,7 +1000,7 @@ declare namespace Components {
922
1000
  };
923
1001
  };
924
1002
  /**
925
- * Meter reading attributes (external_id, timestamp, source, value, etc.)
1003
+ * Meter reading attributes. Required: external_id, timestamp, source, value. `source` must be one of: ECP, ERP, 360, journey-submission. `reason` (optional) must be one of: regular, irregular, last, first, meter_change, contract_change, meter_adjustment (or empty/null).
926
1004
  */
927
1005
  attributes: {
928
1006
  [name: string]: any;
@@ -1777,6 +1855,31 @@ declare namespace Components {
1777
1855
  */
1778
1856
  overwrite?: boolean;
1779
1857
  }
1858
+ export interface TimeSeriesBucket {
1859
+ /**
1860
+ * The start timestamp of the bucket
1861
+ */
1862
+ timestamp: string; // date-time
1863
+ /**
1864
+ * Inbound event counts for this bucket. Null when direction is outbound.
1865
+ */
1866
+ inbound?: {
1867
+ success_count?: number;
1868
+ error_count?: number;
1869
+ warning_count?: number;
1870
+ skipped_count?: number;
1871
+ total_count?: number;
1872
+ } | null;
1873
+ /**
1874
+ * Outbound event counts for this bucket. Null when direction is inbound.
1875
+ */
1876
+ outbound?: {
1877
+ success_count?: number;
1878
+ error_count?: number;
1879
+ pending_count?: number;
1880
+ total_count?: number;
1881
+ } | null;
1882
+ }
1780
1883
  export interface TriggerErpActionRequest {
1781
1884
  /**
1782
1885
  * Unique identifier of the current automation execution
@@ -1863,6 +1966,10 @@ declare namespace Components {
1863
1966
  * List of access token IDs to associate with this integration
1864
1967
  */
1865
1968
  access_token_ids?: string[];
1969
+ /**
1970
+ * Configuration defining environment variables needed by this integration
1971
+ */
1972
+ environment_config?: EnvironmentFieldConfig[];
1866
1973
  }
1867
1974
  export interface UpdateOutboundUseCaseRequest {
1868
1975
  /**
@@ -2192,6 +2299,22 @@ declare namespace Paths {
2192
2299
  export type $500 = Components.Responses.InternalServerError;
2193
2300
  }
2194
2301
  }
2302
+ namespace GetMonitoringTimeSeries {
2303
+ namespace Parameters {
2304
+ export type IntegrationId = string; // uuid
2305
+ }
2306
+ export interface PathParameters {
2307
+ integrationId: Parameters.IntegrationId /* uuid */;
2308
+ }
2309
+ export type RequestBody = Components.Schemas.GetMonitoringTimeSeriesRequest;
2310
+ namespace Responses {
2311
+ export type $200 = Components.Responses.GetMonitoringTimeSeriesResponse;
2312
+ export type $400 = Components.Responses.BadRequest;
2313
+ export type $401 = Components.Responses.Unauthorized;
2314
+ export type $404 = Components.Responses.NotFound;
2315
+ export type $500 = Components.Responses.InternalServerError;
2316
+ }
2317
+ }
2195
2318
  namespace GetOutboundStatus {
2196
2319
  namespace Parameters {
2197
2320
  export type IntegrationId = string; // uuid
@@ -2315,7 +2438,6 @@ declare namespace Paths {
2315
2438
  export type $200 = Components.Responses.ERPUpdatesResponse;
2316
2439
  export type $400 = Components.Responses.BadRequest;
2317
2440
  export type $401 = Components.Responses.Unauthorized;
2318
- export type $422 = Components.Responses.ERPUpdatesResponse;
2319
2441
  export type $500 = Components.Responses.InternalServerError;
2320
2442
  }
2321
2443
  }
@@ -2325,7 +2447,6 @@ declare namespace Paths {
2325
2447
  export type $200 = Components.Responses.ERPUpdatesResponse;
2326
2448
  export type $400 = Components.Responses.BadRequest;
2327
2449
  export type $401 = Components.Responses.Unauthorized;
2328
- export type $422 = Components.Responses.ERPUpdatesResponse;
2329
2450
  export type $500 = Components.Responses.InternalServerError;
2330
2451
  }
2331
2452
  }
@@ -2335,7 +2456,6 @@ declare namespace Paths {
2335
2456
  export type $200 = Components.Responses.ERPUpdatesResponse;
2336
2457
  export type $400 = Components.Responses.BadRequest;
2337
2458
  export type $401 = Components.Responses.Unauthorized;
2338
- export type $422 = Components.Responses.ERPUpdatesResponse;
2339
2459
  export type $500 = Components.Responses.InternalServerError;
2340
2460
  }
2341
2461
  }
@@ -2862,6 +2982,19 @@ export interface OperationMethods {
2862
2982
  data?: Paths.GetMonitoringStats.RequestBody,
2863
2983
  config?: AxiosRequestConfig
2864
2984
  ): OperationResponse<Paths.GetMonitoringStats.Responses.$200>
2985
+ /**
2986
+ * getMonitoringTimeSeries - getMonitoringTimeSeries
2987
+ *
2988
+ * Get time-series aggregated event counts for monitoring charts.
2989
+ * Returns pre-bucketed counts at configurable intervals for both inbound and outbound events.
2990
+ * Maximum of 200 buckets per request. Returns 400 if the time range and interval would exceed this limit.
2991
+ *
2992
+ */
2993
+ 'getMonitoringTimeSeries'(
2994
+ parameters?: Parameters<Paths.GetMonitoringTimeSeries.PathParameters> | null,
2995
+ data?: Paths.GetMonitoringTimeSeries.RequestBody,
2996
+ config?: AxiosRequestConfig
2997
+ ): OperationResponse<Paths.GetMonitoringTimeSeries.Responses.$200>
2865
2998
  /**
2866
2999
  * getOutboundStatus - getOutboundStatus
2867
3000
  *
@@ -3267,6 +3400,21 @@ export interface PathsDictionary {
3267
3400
  config?: AxiosRequestConfig
3268
3401
  ): OperationResponse<Paths.GetMonitoringStats.Responses.$200>
3269
3402
  }
3403
+ ['/v1/integrations/{integrationId}/monitoring/timeseries']: {
3404
+ /**
3405
+ * getMonitoringTimeSeries - getMonitoringTimeSeries
3406
+ *
3407
+ * Get time-series aggregated event counts for monitoring charts.
3408
+ * Returns pre-bucketed counts at configurable intervals for both inbound and outbound events.
3409
+ * Maximum of 200 buckets per request. Returns 400 if the time range and interval would exceed this limit.
3410
+ *
3411
+ */
3412
+ 'post'(
3413
+ parameters?: Parameters<Paths.GetMonitoringTimeSeries.PathParameters> | null,
3414
+ data?: Paths.GetMonitoringTimeSeries.RequestBody,
3415
+ config?: AxiosRequestConfig
3416
+ ): OperationResponse<Paths.GetMonitoringTimeSeries.Responses.$200>
3417
+ }
3270
3418
  ['/v1/integrations/{integrationId}/outbound-status']: {
3271
3419
  /**
3272
3420
  * getOutboundStatus - getOutboundStatus
@@ -3329,12 +3477,14 @@ export type EmbeddedOutboundUseCaseRequest = Components.Schemas.EmbeddedOutbound
3329
3477
  export type EmbeddedUseCaseRequest = Components.Schemas.EmbeddedUseCaseRequest;
3330
3478
  export type EmbeddedUseCaseRequestBase = Components.Schemas.EmbeddedUseCaseRequestBase;
3331
3479
  export type EntityUpdate = Components.Schemas.EntityUpdate;
3480
+ export type EnvironmentFieldConfig = Components.Schemas.EnvironmentFieldConfig;
3332
3481
  export type ErpEvent = Components.Schemas.ErpEvent;
3333
3482
  export type ErpEventV3 = Components.Schemas.ErpEventV3;
3334
3483
  export type ErpUpdatesEventsV2Request = Components.Schemas.ErpUpdatesEventsV2Request;
3335
3484
  export type ErpUpdatesEventsV3Request = Components.Schemas.ErpUpdatesEventsV3Request;
3336
3485
  export type ErrorResponseBase = Components.Schemas.ErrorResponseBase;
3337
3486
  export type GetMonitoringStatsRequest = Components.Schemas.GetMonitoringStatsRequest;
3487
+ export type GetMonitoringTimeSeriesRequest = Components.Schemas.GetMonitoringTimeSeriesRequest;
3338
3488
  export type InboundIntegrationEventConfiguration = Components.Schemas.InboundIntegrationEventConfiguration;
3339
3489
  export type InboundMonitoringEvent = Components.Schemas.InboundMonitoringEvent;
3340
3490
  export type InboundUseCase = Components.Schemas.InboundUseCase;
@@ -3377,6 +3527,7 @@ export type RelationUniqueIdField = Components.Schemas.RelationUniqueIdField;
3377
3527
  export type RepeatableFieldType = Components.Schemas.RepeatableFieldType;
3378
3528
  export type ReplayEventsRequest = Components.Schemas.ReplayEventsRequest;
3379
3529
  export type SetIntegrationAppMappingRequest = Components.Schemas.SetIntegrationAppMappingRequest;
3530
+ export type TimeSeriesBucket = Components.Schemas.TimeSeriesBucket;
3380
3531
  export type TriggerErpActionRequest = Components.Schemas.TriggerErpActionRequest;
3381
3532
  export type TriggerWebhookResp = Components.Schemas.TriggerWebhookResp;
3382
3533
  export type UpdateInboundUseCaseRequest = Components.Schemas.UpdateInboundUseCaseRequest;
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.32.0",
5
+ "version": "0.36.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": [
@@ -215,9 +215,6 @@
215
215
  "401": {
216
216
  "$ref": "#/components/responses/Unauthorized"
217
217
  },
218
- "422": {
219
- "$ref": "#/components/responses/ERPUpdatesResponse"
220
- },
221
218
  "500": {
222
219
  "$ref": "#/components/responses/InternalServerError"
223
220
  }
@@ -274,9 +271,6 @@
274
271
  "401": {
275
272
  "$ref": "#/components/responses/Unauthorized"
276
273
  },
277
- "422": {
278
- "$ref": "#/components/responses/ERPUpdatesResponse"
279
- },
280
274
  "500": {
281
275
  "$ref": "#/components/responses/InternalServerError"
282
276
  }
@@ -330,9 +324,6 @@
330
324
  "401": {
331
325
  "$ref": "#/components/responses/Unauthorized"
332
326
  },
333
- "422": {
334
- "$ref": "#/components/responses/ERPUpdatesResponse"
335
- },
336
327
  "500": {
337
328
  "$ref": "#/components/responses/InternalServerError"
338
329
  }
@@ -2065,6 +2056,56 @@
2065
2056
  }
2066
2057
  }
2067
2058
  },
2059
+ "/v1/integrations/{integrationId}/monitoring/timeseries": {
2060
+ "post": {
2061
+ "operationId": "getMonitoringTimeSeries",
2062
+ "summary": "getMonitoringTimeSeries",
2063
+ "description": "Get time-series aggregated event counts for monitoring charts.\nReturns pre-bucketed counts at configurable intervals for both inbound and outbound events.\nMaximum of 200 buckets per request. Returns 400 if the time range and interval would exceed this limit.\n",
2064
+ "tags": [
2065
+ "monitoring",
2066
+ "integrations"
2067
+ ],
2068
+ "parameters": [
2069
+ {
2070
+ "name": "integrationId",
2071
+ "in": "path",
2072
+ "required": true,
2073
+ "description": "The integration ID",
2074
+ "schema": {
2075
+ "type": "string",
2076
+ "format": "uuid"
2077
+ }
2078
+ }
2079
+ ],
2080
+ "requestBody": {
2081
+ "required": true,
2082
+ "content": {
2083
+ "application/json": {
2084
+ "schema": {
2085
+ "$ref": "#/components/schemas/GetMonitoringTimeSeriesRequest"
2086
+ }
2087
+ }
2088
+ }
2089
+ },
2090
+ "responses": {
2091
+ "200": {
2092
+ "$ref": "#/components/responses/GetMonitoringTimeSeriesResponse"
2093
+ },
2094
+ "400": {
2095
+ "$ref": "#/components/responses/BadRequest"
2096
+ },
2097
+ "401": {
2098
+ "$ref": "#/components/responses/Unauthorized"
2099
+ },
2100
+ "404": {
2101
+ "$ref": "#/components/responses/NotFound"
2102
+ },
2103
+ "500": {
2104
+ "$ref": "#/components/responses/InternalServerError"
2105
+ }
2106
+ }
2107
+ }
2108
+ },
2068
2109
  "/v1/integrations/{integrationId}/outbound-status": {
2069
2110
  "get": {
2070
2111
  "operationId": "getOutboundStatus",
@@ -2519,6 +2560,13 @@
2519
2560
  "type": "string"
2520
2561
  }
2521
2562
  },
2563
+ "environment_config": {
2564
+ "type": "array",
2565
+ "items": {
2566
+ "$ref": "#/components/schemas/EnvironmentFieldConfig"
2567
+ },
2568
+ "description": "Configuration defining environment variables needed by this integration. Values are stored in the Environments API."
2569
+ },
2522
2570
  "created_at": {
2523
2571
  "type": "string",
2524
2572
  "format": "date-time",
@@ -2554,6 +2602,13 @@
2554
2602
  "items": {
2555
2603
  "type": "string"
2556
2604
  }
2605
+ },
2606
+ "environment_config": {
2607
+ "type": "array",
2608
+ "items": {
2609
+ "$ref": "#/components/schemas/EnvironmentFieldConfig"
2610
+ },
2611
+ "description": "Configuration defining environment variables needed by this integration"
2557
2612
  }
2558
2613
  }
2559
2614
  },
@@ -2577,6 +2632,57 @@
2577
2632
  "items": {
2578
2633
  "type": "string"
2579
2634
  }
2635
+ },
2636
+ "environment_config": {
2637
+ "type": "array",
2638
+ "items": {
2639
+ "$ref": "#/components/schemas/EnvironmentFieldConfig"
2640
+ },
2641
+ "description": "Configuration defining environment variables needed by this integration"
2642
+ }
2643
+ }
2644
+ },
2645
+ "EnvironmentFieldConfig": {
2646
+ "type": "object",
2647
+ "required": [
2648
+ "key",
2649
+ "label",
2650
+ "type"
2651
+ ],
2652
+ "properties": {
2653
+ "key": {
2654
+ "type": "string",
2655
+ "description": "Environment variable key, used to look up the value in the Environments API.",
2656
+ "pattern": "^[a-z0-9][a-z0-9_.\\-]{0,127}$"
2657
+ },
2658
+ "label": {
2659
+ "type": "string",
2660
+ "description": "Display label for the field in the UI",
2661
+ "minLength": 1,
2662
+ "maxLength": 255
2663
+ },
2664
+ "type": {
2665
+ "type": "string",
2666
+ "enum": [
2667
+ "String",
2668
+ "SecretString"
2669
+ ],
2670
+ "description": "Whether the value is a plain string or an encrypted secret"
2671
+ },
2672
+ "description": {
2673
+ "type": "string",
2674
+ "description": "Help text shown below the field",
2675
+ "maxLength": 1000
2676
+ },
2677
+ "required": {
2678
+ "type": "boolean",
2679
+ "default": false,
2680
+ "description": "Whether this field must be filled before the integration can be used"
2681
+ },
2682
+ "order": {
2683
+ "type": "integer",
2684
+ "minimum": 0,
2685
+ "description": "Sort order for display and drag-to-reorder"
2580
2686
  }
2581
2687
  }
2582
2688
  },
@@ -3212,7 +3318,7 @@
3212
3318
  "attributes": {
3213
3319
  "type": "object",
3214
3320
  "additionalProperties": true,
3215
- "description": "Meter reading attributes (external_id, timestamp, source, value, etc.)"
3321
+ "description": "Meter reading attributes. Required: external_id, timestamp, source, value. `source` must be one of: ECP, ERP, 360, journey-submission. `reason` (optional) must be one of: regular, irregular, last, first, meter_change, contract_change, meter_adjustment (or empty/null)."
3216
3322
  }
3217
3323
  }
3218
3324
  },
@@ -4490,6 +4596,105 @@
4490
4596
  }
4491
4597
  }
4492
4598
  },
4599
+ "GetMonitoringTimeSeriesRequest": {
4600
+ "type": "object",
4601
+ "required": [
4602
+ "from_date",
4603
+ "interval"
4604
+ ],
4605
+ "properties": {
4606
+ "from_date": {
4607
+ "type": "string",
4608
+ "format": "date-time",
4609
+ "description": "Start date for the time series (inclusive)",
4610
+ "example": "2025-01-01T00:00:00Z"
4611
+ },
4612
+ "to_date": {
4613
+ "type": "string",
4614
+ "format": "date-time",
4615
+ "description": "End date for the time series (inclusive). Defaults to current time if not specified.",
4616
+ "example": "2025-01-31T23:59:59Z"
4617
+ },
4618
+ "interval": {
4619
+ "type": "string",
4620
+ "enum": [
4621
+ "5m",
4622
+ "10m",
4623
+ "30m",
4624
+ "1h",
4625
+ "3h",
4626
+ "1d"
4627
+ ],
4628
+ "description": "The time bucket interval for aggregation",
4629
+ "example": "1h"
4630
+ },
4631
+ "direction": {
4632
+ "type": "string",
4633
+ "enum": [
4634
+ "inbound",
4635
+ "outbound",
4636
+ "both"
4637
+ ],
4638
+ "default": "both",
4639
+ "description": "Filter by event direction. Defaults to both.",
4640
+ "example": "both"
4641
+ }
4642
+ }
4643
+ },
4644
+ "TimeSeriesBucket": {
4645
+ "type": "object",
4646
+ "required": [
4647
+ "timestamp"
4648
+ ],
4649
+ "properties": {
4650
+ "timestamp": {
4651
+ "type": "string",
4652
+ "format": "date-time",
4653
+ "description": "The start timestamp of the bucket"
4654
+ },
4655
+ "inbound": {
4656
+ "type": "object",
4657
+ "nullable": true,
4658
+ "description": "Inbound event counts for this bucket. Null when direction is outbound.",
4659
+ "properties": {
4660
+ "success_count": {
4661
+ "type": "integer"
4662
+ },
4663
+ "error_count": {
4664
+ "type": "integer"
4665
+ },
4666
+ "warning_count": {
4667
+ "type": "integer"
4668
+ },
4669
+ "skipped_count": {
4670
+ "type": "integer"
4671
+ },
4672
+ "total_count": {
4673
+ "type": "integer"
4674
+ }
4675
+ }
4676
+ },
4677
+ "outbound": {
4678
+ "type": "object",
4679
+ "nullable": true,
4680
+ "description": "Outbound event counts for this bucket. Null when direction is inbound.",
4681
+ "properties": {
4682
+ "success_count": {
4683
+ "type": "integer"
4684
+ },
4685
+ "error_count": {
4686
+ "type": "integer"
4687
+ },
4688
+ "pending_count": {
4689
+ "type": "integer"
4690
+ },
4691
+ "total_count": {
4692
+ "type": "integer"
4693
+ }
4694
+ }
4695
+ }
4696
+ }
4697
+ },
4493
4698
  "QueryOutboundMonitoringEventsRequest": {
4494
4699
  "type": "object",
4495
4700
  "properties": {
@@ -4930,6 +5135,53 @@
4930
5135
  }
4931
5136
  }
4932
5137
  },
5138
+ "GetMonitoringTimeSeriesResponse": {
5139
+ "description": "Time-series aggregated event counts retrieved successfully",
5140
+ "content": {
5141
+ "application/json": {
5142
+ "schema": {
5143
+ "type": "object",
5144
+ "required": [
5145
+ "interval",
5146
+ "from_date",
5147
+ "to_date",
5148
+ "buckets"
5149
+ ],
5150
+ "properties": {
5151
+ "interval": {
5152
+ "type": "string",
5153
+ "enum": [
5154
+ "5m",
5155
+ "10m",
5156
+ "30m",
5157
+ "1h",
5158
+ "3h",
5159
+ "1d"
5160
+ ],
5161
+ "description": "The time bucket interval used for aggregation"
5162
+ },
5163
+ "from_date": {
5164
+ "type": "string",
5165
+ "format": "date-time",
5166
+ "description": "Start date of the time series"
5167
+ },
5168
+ "to_date": {
5169
+ "type": "string",
5170
+ "format": "date-time",
5171
+ "description": "End date of the time series"
5172
+ },
5173
+ "buckets": {
5174
+ "type": "array",
5175
+ "items": {
5176
+ "$ref": "#/components/schemas/TimeSeriesBucket"
5177
+ },
5178
+ "description": "List of time-series buckets with event counts"
5179
+ }
5180
+ }
5181
+ }
5182
+ }
5183
+ }
5184
+ },
4933
5185
  "QueryAccessLogsResponse": {
4934
5186
  "description": "Access logs queried successfully",
4935
5187
  "content": {
@@ -5052,9 +5304,10 @@
5052
5304
  "enum": [
5053
5305
  "success",
5054
5306
  "error",
5055
- "skipped"
5307
+ "skipped",
5308
+ "ignored"
5056
5309
  ],
5057
- "description": "Processing status for the event (skipped indicates duplicate deduplication_id)"
5310
+ "description": "Processing status for the event (skipped indicates duplicate deduplication_id, ignored indicates unconfigured event)"
5058
5311
  },
5059
5312
  "message": {
5060
5313
  "type": "string"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/erp-integration-client",
3
- "version": "0.23.0",
3
+ "version": "0.24.0",
4
4
  "description": "Client library for ePilot ERP Integration API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",