@epilot/erp-integration-client 0.23.0 → 0.24.1

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={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":{"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}(330),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
  */
@@ -804,6 +882,20 @@ declare namespace Components {
804
882
  *
805
883
  */
806
884
  reading_matching?: "external_id" | "strict-date";
885
+ /**
886
+ * Operation mode for meter reading mapping:
887
+ * - 'upsert': Create or update meter readings (default)
888
+ * - 'delete': Delete the meter reading
889
+ * - 'upsert-prune-scope': Upsert readings from array, then delete all other readings for the same meter+counter that weren't upserted
890
+ *
891
+ */
892
+ mode?: "upsert" | "delete" | "upsert-prune-scope";
893
+ scope?: /**
894
+ * Scope configuration for meter reading upsert-prune-scope mode.
895
+ * The scope is all readings for the same meter + counter.
896
+ *
897
+ */
898
+ MeterReadingPruneScopeConfig;
807
899
  meter: MeterUniqueIdsConfig;
808
900
  meter_counter?: MeterUniqueIdsConfig;
809
901
  /**
@@ -904,6 +996,19 @@ declare namespace Components {
904
996
  [name: string]: any;
905
997
  };
906
998
  }
999
+ /**
1000
+ * Scope configuration for meter reading upsert-prune-scope mode.
1001
+ * The scope is all readings for the same meter + counter.
1002
+ *
1003
+ */
1004
+ export interface MeterReadingPruneScopeConfig {
1005
+ /**
1006
+ * Optional source filter. When set, only readings with this source
1007
+ * are eligible for pruning (e.g., 'ERP' to only prune ERP-synced readings).
1008
+ *
1009
+ */
1010
+ source?: string;
1011
+ }
907
1012
  export interface MeterReadingUpdate {
908
1013
  meter: {
909
1014
  /**
@@ -922,7 +1027,7 @@ declare namespace Components {
922
1027
  };
923
1028
  };
924
1029
  /**
925
- * Meter reading attributes (external_id, timestamp, source, value, etc.)
1030
+ * 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
1031
  */
927
1032
  attributes: {
928
1033
  [name: string]: any;
@@ -1777,6 +1882,31 @@ declare namespace Components {
1777
1882
  */
1778
1883
  overwrite?: boolean;
1779
1884
  }
1885
+ export interface TimeSeriesBucket {
1886
+ /**
1887
+ * The start timestamp of the bucket
1888
+ */
1889
+ timestamp: string; // date-time
1890
+ /**
1891
+ * Inbound event counts for this bucket. Null when direction is outbound.
1892
+ */
1893
+ inbound?: {
1894
+ success_count?: number;
1895
+ error_count?: number;
1896
+ warning_count?: number;
1897
+ skipped_count?: number;
1898
+ total_count?: number;
1899
+ } | null;
1900
+ /**
1901
+ * Outbound event counts for this bucket. Null when direction is inbound.
1902
+ */
1903
+ outbound?: {
1904
+ success_count?: number;
1905
+ error_count?: number;
1906
+ pending_count?: number;
1907
+ total_count?: number;
1908
+ } | null;
1909
+ }
1780
1910
  export interface TriggerErpActionRequest {
1781
1911
  /**
1782
1912
  * Unique identifier of the current automation execution
@@ -1863,6 +1993,10 @@ declare namespace Components {
1863
1993
  * List of access token IDs to associate with this integration
1864
1994
  */
1865
1995
  access_token_ids?: string[];
1996
+ /**
1997
+ * Configuration defining environment variables needed by this integration
1998
+ */
1999
+ environment_config?: EnvironmentFieldConfig[];
1866
2000
  }
1867
2001
  export interface UpdateOutboundUseCaseRequest {
1868
2002
  /**
@@ -2192,6 +2326,22 @@ declare namespace Paths {
2192
2326
  export type $500 = Components.Responses.InternalServerError;
2193
2327
  }
2194
2328
  }
2329
+ namespace GetMonitoringTimeSeries {
2330
+ namespace Parameters {
2331
+ export type IntegrationId = string; // uuid
2332
+ }
2333
+ export interface PathParameters {
2334
+ integrationId: Parameters.IntegrationId /* uuid */;
2335
+ }
2336
+ export type RequestBody = Components.Schemas.GetMonitoringTimeSeriesRequest;
2337
+ namespace Responses {
2338
+ export type $200 = Components.Responses.GetMonitoringTimeSeriesResponse;
2339
+ export type $400 = Components.Responses.BadRequest;
2340
+ export type $401 = Components.Responses.Unauthorized;
2341
+ export type $404 = Components.Responses.NotFound;
2342
+ export type $500 = Components.Responses.InternalServerError;
2343
+ }
2344
+ }
2195
2345
  namespace GetOutboundStatus {
2196
2346
  namespace Parameters {
2197
2347
  export type IntegrationId = string; // uuid
@@ -2315,7 +2465,6 @@ declare namespace Paths {
2315
2465
  export type $200 = Components.Responses.ERPUpdatesResponse;
2316
2466
  export type $400 = Components.Responses.BadRequest;
2317
2467
  export type $401 = Components.Responses.Unauthorized;
2318
- export type $422 = Components.Responses.ERPUpdatesResponse;
2319
2468
  export type $500 = Components.Responses.InternalServerError;
2320
2469
  }
2321
2470
  }
@@ -2325,7 +2474,6 @@ declare namespace Paths {
2325
2474
  export type $200 = Components.Responses.ERPUpdatesResponse;
2326
2475
  export type $400 = Components.Responses.BadRequest;
2327
2476
  export type $401 = Components.Responses.Unauthorized;
2328
- export type $422 = Components.Responses.ERPUpdatesResponse;
2329
2477
  export type $500 = Components.Responses.InternalServerError;
2330
2478
  }
2331
2479
  }
@@ -2335,7 +2483,6 @@ declare namespace Paths {
2335
2483
  export type $200 = Components.Responses.ERPUpdatesResponse;
2336
2484
  export type $400 = Components.Responses.BadRequest;
2337
2485
  export type $401 = Components.Responses.Unauthorized;
2338
- export type $422 = Components.Responses.ERPUpdatesResponse;
2339
2486
  export type $500 = Components.Responses.InternalServerError;
2340
2487
  }
2341
2488
  }
@@ -2862,6 +3009,19 @@ export interface OperationMethods {
2862
3009
  data?: Paths.GetMonitoringStats.RequestBody,
2863
3010
  config?: AxiosRequestConfig
2864
3011
  ): OperationResponse<Paths.GetMonitoringStats.Responses.$200>
3012
+ /**
3013
+ * getMonitoringTimeSeries - getMonitoringTimeSeries
3014
+ *
3015
+ * Get time-series aggregated event counts for monitoring charts.
3016
+ * Returns pre-bucketed counts at configurable intervals for both inbound and outbound events.
3017
+ * Maximum of 200 buckets per request. Returns 400 if the time range and interval would exceed this limit.
3018
+ *
3019
+ */
3020
+ 'getMonitoringTimeSeries'(
3021
+ parameters?: Parameters<Paths.GetMonitoringTimeSeries.PathParameters> | null,
3022
+ data?: Paths.GetMonitoringTimeSeries.RequestBody,
3023
+ config?: AxiosRequestConfig
3024
+ ): OperationResponse<Paths.GetMonitoringTimeSeries.Responses.$200>
2865
3025
  /**
2866
3026
  * getOutboundStatus - getOutboundStatus
2867
3027
  *
@@ -3267,6 +3427,21 @@ export interface PathsDictionary {
3267
3427
  config?: AxiosRequestConfig
3268
3428
  ): OperationResponse<Paths.GetMonitoringStats.Responses.$200>
3269
3429
  }
3430
+ ['/v1/integrations/{integrationId}/monitoring/timeseries']: {
3431
+ /**
3432
+ * getMonitoringTimeSeries - getMonitoringTimeSeries
3433
+ *
3434
+ * Get time-series aggregated event counts for monitoring charts.
3435
+ * Returns pre-bucketed counts at configurable intervals for both inbound and outbound events.
3436
+ * Maximum of 200 buckets per request. Returns 400 if the time range and interval would exceed this limit.
3437
+ *
3438
+ */
3439
+ 'post'(
3440
+ parameters?: Parameters<Paths.GetMonitoringTimeSeries.PathParameters> | null,
3441
+ data?: Paths.GetMonitoringTimeSeries.RequestBody,
3442
+ config?: AxiosRequestConfig
3443
+ ): OperationResponse<Paths.GetMonitoringTimeSeries.Responses.$200>
3444
+ }
3270
3445
  ['/v1/integrations/{integrationId}/outbound-status']: {
3271
3446
  /**
3272
3447
  * getOutboundStatus - getOutboundStatus
@@ -3329,12 +3504,14 @@ export type EmbeddedOutboundUseCaseRequest = Components.Schemas.EmbeddedOutbound
3329
3504
  export type EmbeddedUseCaseRequest = Components.Schemas.EmbeddedUseCaseRequest;
3330
3505
  export type EmbeddedUseCaseRequestBase = Components.Schemas.EmbeddedUseCaseRequestBase;
3331
3506
  export type EntityUpdate = Components.Schemas.EntityUpdate;
3507
+ export type EnvironmentFieldConfig = Components.Schemas.EnvironmentFieldConfig;
3332
3508
  export type ErpEvent = Components.Schemas.ErpEvent;
3333
3509
  export type ErpEventV3 = Components.Schemas.ErpEventV3;
3334
3510
  export type ErpUpdatesEventsV2Request = Components.Schemas.ErpUpdatesEventsV2Request;
3335
3511
  export type ErpUpdatesEventsV3Request = Components.Schemas.ErpUpdatesEventsV3Request;
3336
3512
  export type ErrorResponseBase = Components.Schemas.ErrorResponseBase;
3337
3513
  export type GetMonitoringStatsRequest = Components.Schemas.GetMonitoringStatsRequest;
3514
+ export type GetMonitoringTimeSeriesRequest = Components.Schemas.GetMonitoringTimeSeriesRequest;
3338
3515
  export type InboundIntegrationEventConfiguration = Components.Schemas.InboundIntegrationEventConfiguration;
3339
3516
  export type InboundMonitoringEvent = Components.Schemas.InboundMonitoringEvent;
3340
3517
  export type InboundUseCase = Components.Schemas.InboundUseCase;
@@ -3352,6 +3529,7 @@ export type IntegrationWithUseCases = Components.Schemas.IntegrationWithUseCases
3352
3529
  export type MappingSimulationRequest = Components.Schemas.MappingSimulationRequest;
3353
3530
  export type MappingSimulationResponse = Components.Schemas.MappingSimulationResponse;
3354
3531
  export type MappingSimulationV2Request = Components.Schemas.MappingSimulationV2Request;
3532
+ export type MeterReadingPruneScopeConfig = Components.Schemas.MeterReadingPruneScopeConfig;
3355
3533
  export type MeterReadingUpdate = Components.Schemas.MeterReadingUpdate;
3356
3534
  export type MeterUniqueIdsConfig = Components.Schemas.MeterUniqueIdsConfig;
3357
3535
  export type MonitoringStats = Components.Schemas.MonitoringStats;
@@ -3377,6 +3555,7 @@ export type RelationUniqueIdField = Components.Schemas.RelationUniqueIdField;
3377
3555
  export type RepeatableFieldType = Components.Schemas.RepeatableFieldType;
3378
3556
  export type ReplayEventsRequest = Components.Schemas.ReplayEventsRequest;
3379
3557
  export type SetIntegrationAppMappingRequest = Components.Schemas.SetIntegrationAppMappingRequest;
3558
+ export type TimeSeriesBucket = Components.Schemas.TimeSeriesBucket;
3380
3559
  export type TriggerErpActionRequest = Components.Schemas.TriggerErpActionRequest;
3381
3560
  export type TriggerWebhookResp = Components.Schemas.TriggerWebhookResp;
3382
3561
  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.37.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
  },
@@ -3670,6 +3776,16 @@
3670
3776
  }
3671
3777
  }
3672
3778
  },
3779
+ "MeterReadingPruneScopeConfig": {
3780
+ "type": "object",
3781
+ "description": "Scope configuration for meter reading upsert-prune-scope mode.\nThe scope is all readings for the same meter + counter.\n",
3782
+ "properties": {
3783
+ "source": {
3784
+ "type": "string",
3785
+ "description": "Optional source filter. When set, only readings with this source\nare eligible for pruning (e.g., 'ERP' to only prune ERP-synced readings).\n"
3786
+ }
3787
+ }
3788
+ },
3673
3789
  "IntegrationMeterReading": {
3674
3790
  "type": "object",
3675
3791
  "required": [
@@ -3690,6 +3806,19 @@
3690
3806
  "default": "external_id",
3691
3807
  "description": "Strategy for matching incoming readings against existing readings.\n- 'external_id': Match readings by external_id attribute (default behavior)\n- 'strict-date': Match by meter_id + counter_id + direction + date (German timezone).\n Useful when readings originate from ECP and are echoed back by the ERP with truncated timestamps.\n"
3692
3808
  },
3809
+ "mode": {
3810
+ "type": "string",
3811
+ "enum": [
3812
+ "upsert",
3813
+ "delete",
3814
+ "upsert-prune-scope"
3815
+ ],
3816
+ "default": "upsert",
3817
+ "description": "Operation mode for meter reading mapping:\n- 'upsert': Create or update meter readings (default)\n- 'delete': Delete the meter reading\n- 'upsert-prune-scope': Upsert readings from array, then delete all other readings for the same meter+counter that weren't upserted\n"
3818
+ },
3819
+ "scope": {
3820
+ "$ref": "#/components/schemas/MeterReadingPruneScopeConfig"
3821
+ },
3693
3822
  "meter": {
3694
3823
  "$ref": "#/components/schemas/MeterUniqueIdsConfig"
3695
3824
  },
@@ -4490,6 +4619,105 @@
4490
4619
  }
4491
4620
  }
4492
4621
  },
4622
+ "GetMonitoringTimeSeriesRequest": {
4623
+ "type": "object",
4624
+ "required": [
4625
+ "from_date",
4626
+ "interval"
4627
+ ],
4628
+ "properties": {
4629
+ "from_date": {
4630
+ "type": "string",
4631
+ "format": "date-time",
4632
+ "description": "Start date for the time series (inclusive)",
4633
+ "example": "2025-01-01T00:00:00Z"
4634
+ },
4635
+ "to_date": {
4636
+ "type": "string",
4637
+ "format": "date-time",
4638
+ "description": "End date for the time series (inclusive). Defaults to current time if not specified.",
4639
+ "example": "2025-01-31T23:59:59Z"
4640
+ },
4641
+ "interval": {
4642
+ "type": "string",
4643
+ "enum": [
4644
+ "5m",
4645
+ "10m",
4646
+ "30m",
4647
+ "1h",
4648
+ "3h",
4649
+ "1d"
4650
+ ],
4651
+ "description": "The time bucket interval for aggregation",
4652
+ "example": "1h"
4653
+ },
4654
+ "direction": {
4655
+ "type": "string",
4656
+ "enum": [
4657
+ "inbound",
4658
+ "outbound",
4659
+ "both"
4660
+ ],
4661
+ "default": "both",
4662
+ "description": "Filter by event direction. Defaults to both.",
4663
+ "example": "both"
4664
+ }
4665
+ }
4666
+ },
4667
+ "TimeSeriesBucket": {
4668
+ "type": "object",
4669
+ "required": [
4670
+ "timestamp"
4671
+ ],
4672
+ "properties": {
4673
+ "timestamp": {
4674
+ "type": "string",
4675
+ "format": "date-time",
4676
+ "description": "The start timestamp of the bucket"
4677
+ },
4678
+ "inbound": {
4679
+ "type": "object",
4680
+ "nullable": true,
4681
+ "description": "Inbound event counts for this bucket. Null when direction is outbound.",
4682
+ "properties": {
4683
+ "success_count": {
4684
+ "type": "integer"
4685
+ },
4686
+ "error_count": {
4687
+ "type": "integer"
4688
+ },
4689
+ "warning_count": {
4690
+ "type": "integer"
4691
+ },
4692
+ "skipped_count": {
4693
+ "type": "integer"
4694
+ },
4695
+ "total_count": {
4696
+ "type": "integer"
4697
+ }
4698
+ }
4699
+ },
4700
+ "outbound": {
4701
+ "type": "object",
4702
+ "nullable": true,
4703
+ "description": "Outbound event counts for this bucket. Null when direction is inbound.",
4704
+ "properties": {
4705
+ "success_count": {
4706
+ "type": "integer"
4707
+ },
4708
+ "error_count": {
4709
+ "type": "integer"
4710
+ },
4711
+ "pending_count": {
4712
+ "type": "integer"
4713
+ },
4714
+ "total_count": {
4715
+ "type": "integer"
4716
+ }
4717
+ }
4718
+ }
4719
+ }
4720
+ },
4493
4721
  "QueryOutboundMonitoringEventsRequest": {
4494
4722
  "type": "object",
4495
4723
  "properties": {
@@ -4930,6 +5158,53 @@
4930
5158
  }
4931
5159
  }
4932
5160
  },
5161
+ "GetMonitoringTimeSeriesResponse": {
5162
+ "description": "Time-series aggregated event counts retrieved successfully",
5163
+ "content": {
5164
+ "application/json": {
5165
+ "schema": {
5166
+ "type": "object",
5167
+ "required": [
5168
+ "interval",
5169
+ "from_date",
5170
+ "to_date",
5171
+ "buckets"
5172
+ ],
5173
+ "properties": {
5174
+ "interval": {
5175
+ "type": "string",
5176
+ "enum": [
5177
+ "5m",
5178
+ "10m",
5179
+ "30m",
5180
+ "1h",
5181
+ "3h",
5182
+ "1d"
5183
+ ],
5184
+ "description": "The time bucket interval used for aggregation"
5185
+ },
5186
+ "from_date": {
5187
+ "type": "string",
5188
+ "format": "date-time",
5189
+ "description": "Start date of the time series"
5190
+ },
5191
+ "to_date": {
5192
+ "type": "string",
5193
+ "format": "date-time",
5194
+ "description": "End date of the time series"
5195
+ },
5196
+ "buckets": {
5197
+ "type": "array",
5198
+ "items": {
5199
+ "$ref": "#/components/schemas/TimeSeriesBucket"
5200
+ },
5201
+ "description": "List of time-series buckets with event counts"
5202
+ }
5203
+ }
5204
+ }
5205
+ }
5206
+ }
5207
+ },
4933
5208
  "QueryAccessLogsResponse": {
4934
5209
  "description": "Access logs queried successfully",
4935
5210
  "content": {
@@ -5052,9 +5327,10 @@
5052
5327
  "enum": [
5053
5328
  "success",
5054
5329
  "error",
5055
- "skipped"
5330
+ "skipped",
5331
+ "ignored"
5056
5332
  ],
5057
- "description": "Processing status for the event (skipped indicates duplicate deduplication_id)"
5333
+ "description": "Processing status for the event (skipped indicates duplicate deduplication_id, ignored indicates unconfigured event)"
5058
5334
  },
5059
5335
  "message": {
5060
5336
  "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.1",
4
4
  "description": "Client library for ePilot ERP Integration API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",