@epilot/sdk 2.14.6 → 2.15.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.
Files changed (145) hide show
  1. package/definitions/email-settings-runtime.json +1 -1
  2. package/definitions/email-settings.json +853 -16
  3. package/definitions/metering-runtime.json +1 -1
  4. package/definitions/metering.json +134 -7
  5. package/dist/apis/access-token.cjs +6 -6
  6. package/dist/apis/access-token.js +1 -1
  7. package/dist/apis/address-suggestions.cjs +6 -6
  8. package/dist/apis/address-suggestions.js +1 -1
  9. package/dist/apis/address.cjs +6 -6
  10. package/dist/apis/address.js +1 -1
  11. package/dist/apis/ai-agents.cjs +6 -6
  12. package/dist/apis/ai-agents.js +1 -1
  13. package/dist/apis/app.cjs +6 -6
  14. package/dist/apis/app.js +1 -1
  15. package/dist/apis/audit-logs.cjs +6 -6
  16. package/dist/apis/audit-logs.js +1 -1
  17. package/dist/apis/automation.cjs +6 -6
  18. package/dist/apis/automation.js +1 -1
  19. package/dist/apis/billing.cjs +6 -6
  20. package/dist/apis/billing.js +1 -1
  21. package/dist/apis/blueprint-manifest.cjs +6 -6
  22. package/dist/apis/blueprint-manifest.js +1 -1
  23. package/dist/apis/calendar.cjs +6 -6
  24. package/dist/apis/calendar.js +1 -1
  25. package/dist/apis/configuration-hub.cjs +6 -6
  26. package/dist/apis/configuration-hub.js +1 -1
  27. package/dist/apis/consent.cjs +6 -6
  28. package/dist/apis/consent.js +1 -1
  29. package/dist/apis/customer-portal.cjs +6 -6
  30. package/dist/apis/customer-portal.js +1 -1
  31. package/dist/apis/dashboard.cjs +6 -6
  32. package/dist/apis/dashboard.js +1 -1
  33. package/dist/apis/data-governance.cjs +6 -6
  34. package/dist/apis/data-governance.js +1 -1
  35. package/dist/apis/deduplication.cjs +6 -6
  36. package/dist/apis/deduplication.js +1 -1
  37. package/dist/apis/design.cjs +6 -6
  38. package/dist/apis/design.js +1 -1
  39. package/dist/apis/document.cjs +6 -6
  40. package/dist/apis/document.js +1 -1
  41. package/dist/apis/email-settings.cjs +8 -8
  42. package/dist/apis/email-settings.d.cts +2 -2
  43. package/dist/apis/email-settings.d.ts +2 -2
  44. package/dist/apis/email-settings.js +2 -2
  45. package/dist/apis/email-template.cjs +6 -6
  46. package/dist/apis/email-template.js +1 -1
  47. package/dist/apis/entity-mapping.cjs +6 -6
  48. package/dist/apis/entity-mapping.js +1 -1
  49. package/dist/apis/entity.cjs +6 -6
  50. package/dist/apis/entity.js +1 -1
  51. package/dist/apis/environments.cjs +6 -6
  52. package/dist/apis/environments.js +1 -1
  53. package/dist/apis/event-catalog.cjs +6 -6
  54. package/dist/apis/event-catalog.js +1 -1
  55. package/dist/apis/file.cjs +6 -6
  56. package/dist/apis/file.js +1 -1
  57. package/dist/apis/iban.cjs +6 -6
  58. package/dist/apis/iban.js +1 -1
  59. package/dist/apis/integration-toolkit.cjs +6 -6
  60. package/dist/apis/integration-toolkit.js +1 -1
  61. package/dist/apis/journey.cjs +6 -6
  62. package/dist/apis/journey.js +1 -1
  63. package/dist/apis/kanban.cjs +6 -6
  64. package/dist/apis/kanban.js +1 -1
  65. package/dist/apis/message.cjs +6 -6
  66. package/dist/apis/message.js +1 -1
  67. package/dist/apis/metering.cjs +8 -8
  68. package/dist/apis/metering.d.cts +2 -2
  69. package/dist/apis/metering.d.ts +2 -2
  70. package/dist/apis/metering.js +2 -2
  71. package/dist/apis/notes.cjs +6 -6
  72. package/dist/apis/notes.js +1 -1
  73. package/dist/apis/notification.cjs +6 -6
  74. package/dist/apis/notification.js +1 -1
  75. package/dist/apis/organization.cjs +6 -6
  76. package/dist/apis/organization.js +1 -1
  77. package/dist/apis/partner-directory.cjs +6 -6
  78. package/dist/apis/partner-directory.js +1 -1
  79. package/dist/apis/permissions.cjs +6 -6
  80. package/dist/apis/permissions.js +1 -1
  81. package/dist/apis/pricing-tier.cjs +6 -6
  82. package/dist/apis/pricing-tier.js +1 -1
  83. package/dist/apis/pricing.cjs +6 -6
  84. package/dist/apis/pricing.js +1 -1
  85. package/dist/apis/purpose.cjs +6 -6
  86. package/dist/apis/purpose.js +1 -1
  87. package/dist/apis/query.cjs +6 -6
  88. package/dist/apis/query.js +1 -1
  89. package/dist/apis/sandbox.cjs +6 -6
  90. package/dist/apis/sandbox.js +1 -1
  91. package/dist/apis/sharing.cjs +6 -6
  92. package/dist/apis/sharing.js +1 -1
  93. package/dist/apis/snapshot.cjs +6 -6
  94. package/dist/apis/snapshot.js +1 -1
  95. package/dist/apis/submission.cjs +6 -6
  96. package/dist/apis/submission.js +1 -1
  97. package/dist/apis/target.cjs +6 -6
  98. package/dist/apis/target.js +1 -1
  99. package/dist/apis/targeting.cjs +6 -6
  100. package/dist/apis/targeting.js +1 -1
  101. package/dist/apis/template-variables.cjs +6 -6
  102. package/dist/apis/template-variables.js +1 -1
  103. package/dist/apis/user.cjs +6 -6
  104. package/dist/apis/user.js +1 -1
  105. package/dist/apis/validation-rules.cjs +6 -6
  106. package/dist/apis/validation-rules.js +1 -1
  107. package/dist/apis/webhooks.cjs +6 -6
  108. package/dist/apis/webhooks.js +1 -1
  109. package/dist/apis/workflow-definition.cjs +6 -6
  110. package/dist/apis/workflow-definition.js +1 -1
  111. package/dist/apis/workflow.cjs +6 -6
  112. package/dist/apis/workflow.js +1 -1
  113. package/dist/{chunk-BEPK4SMV.cjs → chunk-3SG23C54.cjs} +4 -4
  114. package/dist/chunk-KHKNOPEX.js +14 -0
  115. package/dist/chunk-LE4OZS7T.js +14 -0
  116. package/dist/{chunk-YTG6MIEJ.js → chunk-TGKYRQMO.js} +4 -4
  117. package/dist/chunk-XNC4FWS2.cjs +14 -0
  118. package/dist/chunk-YNJPE3SS.cjs +14 -0
  119. package/dist/email-settings-ECSU7KWC.js +7 -0
  120. package/dist/email-settings-RHMYC2KT.cjs +7 -0
  121. package/dist/{email-settings-runtime-BXRZV4M5.js → email-settings-runtime-4BT72ADN.js} +1 -1
  122. package/dist/{email-settings-runtime-FWJQBQBK.cjs → email-settings-runtime-J7JLYDMU.cjs} +2 -2
  123. package/dist/{email-settings.d-UJ0C3jPI.d.cts → email-settings.d-CR4lORuR.d.cts} +721 -2
  124. package/dist/{email-settings.d-UJ0C3jPI.d.ts → email-settings.d-CR4lORuR.d.ts} +721 -2
  125. package/dist/index.cjs +12 -12
  126. package/dist/index.d.cts +2 -2
  127. package/dist/index.d.ts +2 -2
  128. package/dist/index.js +3 -3
  129. package/dist/metering-COO4BTOC.js +7 -0
  130. package/dist/metering-FJI2AU7Q.cjs +7 -0
  131. package/dist/{metering-runtime-7DPUSUYS.js → metering-runtime-HQ5F6R5M.js} +1 -1
  132. package/dist/{metering-runtime-VXOK3WJZ.cjs → metering-runtime-LSBYAJ6Z.cjs} +2 -2
  133. package/dist/{metering.d-DoC7rUbS.d.cts → metering.d-DomHYl06.d.cts} +133 -10
  134. package/dist/{metering.d-DoC7rUbS.d.ts → metering.d-DomHYl06.d.ts} +133 -10
  135. package/docs/email-settings.md +584 -1
  136. package/docs/metering.md +73 -21
  137. package/package.json +1 -1
  138. package/dist/chunk-2KZBLHTS.cjs +0 -14
  139. package/dist/chunk-K2F255B3.js +0 -14
  140. package/dist/chunk-KCPVNRDL.js +0 -14
  141. package/dist/chunk-YI5YGTAH.cjs +0 -14
  142. package/dist/email-settings-YJ4X5VFU.cjs +0 -7
  143. package/dist/email-settings-YUK3DXFJ.js +0 -7
  144. package/dist/metering-3K36TQ5Z.cjs +0 -7
  145. package/dist/metering-7T6NJRHT.js +0 -7
@@ -495,7 +495,7 @@ declare namespace Components {
495
495
  /**
496
496
  * The calibration date of the meter
497
497
  * example:
498
- * 2022-10-10T00:00:00.000Z
498
+ * 2022-10-10
499
499
  */
500
500
  calibration_date?: string;
501
501
  /**
@@ -570,7 +570,7 @@ declare namespace Components {
570
570
  /**
571
571
  * The date as of which the forecast reading value is applicable
572
572
  * example:
573
- * 2022-12-10T00:00:00.000Z
573
+ * 2022-12-10
574
574
  */
575
575
  forecast_as_of?: string;
576
576
  /**
@@ -582,7 +582,7 @@ declare namespace Components {
582
582
  /**
583
583
  * The timestamp of the last reading
584
584
  * example:
585
- * 2022-10-10T00:00:00.000Z
585
+ * 2022-10-10
586
586
  */
587
587
  last_reading?: string;
588
588
  /**
@@ -618,7 +618,7 @@ declare namespace Components {
618
618
  /**
619
619
  * If the value is not provided, the system will be set with the time the request is processed.
620
620
  * example:
621
- * 2022-10-10T00:00:00.000Z
621
+ * 2022-10-10
622
622
  */
623
623
  timestamp?: string; // date-time
624
624
  source: Source;
@@ -748,7 +748,7 @@ declare namespace Components {
748
748
  /**
749
749
  * If the value is not provided, the system will be set with the time the request is processed.
750
750
  * example:
751
- * 2022-10-10T00:00:00.000Z
751
+ * 2022-10-10
752
752
  */
753
753
  timestamp?: string; // date-time
754
754
  source: Source;
@@ -790,6 +790,32 @@ declare namespace Components {
790
790
  status?: "valid" | "in-validation" | "implausible";
791
791
  external_id?: string;
792
792
  }
793
+ export interface PruneMeterReadingsPayload {
794
+ /**
795
+ * The ID of the meter whose readings are pruned
796
+ */
797
+ meter_id: EntityId /* uuid */;
798
+ /**
799
+ * Optionally narrows the prune scope to a single counter of the meter
800
+ */
801
+ counter_id?: EntityId /* uuid */;
802
+ /**
803
+ * Optionally only prune readings with this source (e.g. `ERP`)
804
+ */
805
+ source?: Source;
806
+ /**
807
+ * Readings whose `external_id` is contained in this list are kept; every other reading in scope is deleted.
808
+ * An empty array deletes all readings in scope (subject to the no-external-id rule described on the endpoint).
809
+ * Limited to 10000 entries.
810
+ *
811
+ * example:
812
+ * [
813
+ * "erp-reading-1",
814
+ * "erp-reading-2"
815
+ * ]
816
+ */
817
+ keep_external_ids: string[];
818
+ }
793
819
  /**
794
820
  * The person who recorded the reading
795
821
  * example:
@@ -830,7 +856,7 @@ declare namespace Components {
830
856
  /**
831
857
  * If the value is not provided, the system will be set with the time the request is processed.
832
858
  * example:
833
- * 2022-10-10T00:00:00.000Z
859
+ * 2022-10-10
834
860
  */
835
861
  timestamp?: string; // date-time
836
862
  /**
@@ -1121,7 +1147,7 @@ declare namespace Components {
1121
1147
  /**
1122
1148
  * If the value is not provided, the system will be set with the time the request is processed.
1123
1149
  * example:
1124
- * 2022-10-10T00:00:00.000Z
1150
+ * 2022-10-10
1125
1151
  */
1126
1152
  timestamp?: string; // date-time
1127
1153
  /**
@@ -1583,7 +1609,7 @@ declare namespace Paths {
1583
1609
  /**
1584
1610
  * The calibration date of the meter
1585
1611
  * example:
1586
- * 2022-10-10T00:00:00.000Z
1612
+ * 2022-10-10
1587
1613
  */
1588
1614
  calibration_date?: string;
1589
1615
  /**
@@ -1602,7 +1628,7 @@ declare namespace Paths {
1602
1628
  /**
1603
1629
  * The timestamp of the last reading
1604
1630
  * example:
1605
- * 2022-10-10T00:00:00.000Z
1631
+ * 2022-10-10
1606
1632
  */
1607
1633
  last_reading?: string;
1608
1634
  /**
@@ -1771,6 +1797,48 @@ declare namespace Paths {
1771
1797
  export type $500 = Components.Responses.InternalServerError;
1772
1798
  }
1773
1799
  }
1800
+ namespace PruneMeterReadings {
1801
+ namespace Parameters {
1802
+ export type ActivityId = /**
1803
+ * See https://github.com/ulid/spec
1804
+ * example:
1805
+ * 01F130Q52Q6MWSNS8N2AVXV4JN
1806
+ */
1807
+ Components.Schemas.ActivityId /* ulid */;
1808
+ export type Async = boolean;
1809
+ export type CreateTicket = boolean;
1810
+ export type DryRun = boolean;
1811
+ }
1812
+ export interface QueryParameters {
1813
+ async?: Parameters.Async;
1814
+ activity_id?: Parameters.ActivityId;
1815
+ create_ticket?: Parameters.CreateTicket;
1816
+ dry_run?: Parameters.DryRun;
1817
+ }
1818
+ export type RequestBody = Components.Schemas.PruneMeterReadingsPayload;
1819
+ namespace Responses {
1820
+ export interface $200 {
1821
+ data?: {
1822
+ /**
1823
+ * Number of readings deleted (or that would be deleted when `dry_run=true`).
1824
+ * example:
1825
+ * 42
1826
+ */
1827
+ deleted_count?: number;
1828
+ /**
1829
+ * Number of readings in scope that were kept.
1830
+ * example:
1831
+ * 12
1832
+ */
1833
+ kept_count?: number;
1834
+ };
1835
+ }
1836
+ export type $400 = Components.Responses.InvalidRequest;
1837
+ export type $401 = Components.Responses.Unauthorized;
1838
+ export type $403 = Components.Responses.Forbidden;
1839
+ export type $500 = Components.Responses.InternalServerError;
1840
+ }
1841
+ }
1774
1842
  namespace UpdateMeter {
1775
1843
  namespace Parameters {
1776
1844
  export type Id = Components.Schemas.EntityId /* uuid */;
@@ -1982,6 +2050,32 @@ interface OperationMethods {
1982
2050
  data?: Paths.BatchWriteMeterReadings.RequestBody,
1983
2051
  config?: AxiosRequestConfig
1984
2052
  ): OperationResponse<Paths.BatchWriteMeterReadings.Responses.$200>
2053
+ /**
2054
+ * pruneMeterReadings - pruneMeterReadings
2055
+ *
2056
+ * Deletes every reading of a meter whose `external_id` is NOT in the provided keep list — in a single request.
2057
+ *
2058
+ * The prune scope can optionally be narrowed to a single counter (`counter_id`) and/or a reading `source` (e.g. `ERP`).
2059
+ * Replaces the client-side pattern of paginating the full reading history and issuing chunked batch deletes.
2060
+ *
2061
+ * Readings without an `external_id`:
2062
+ * - when a `source` filter is provided, they are **deleted** — they cannot be referenced by any keep list
2063
+ * - when no `source` filter is provided, they are **kept** (conservative default)
2064
+ *
2065
+ * Deletions reuse the same internal path as `batchWriteMeterReadings` with `operation: delete`: the same
2066
+ * per-reading lifecycle events are emitted, and providing `activity_id` suppresses the per-reading delete
2067
+ * activities and attaches the given activity to the affected meter and counters instead. Delete operations
2068
+ * never create manual-intervention tickets; `create_ticket` is accepted for call-site parity with
2069
+ * `batchWriteMeterReadings`.
2070
+ *
2071
+ * `keep_external_ids` is limited to 10000 entries.
2072
+ *
2073
+ */
2074
+ 'pruneMeterReadings'(
2075
+ parameters?: Parameters<Paths.PruneMeterReadings.QueryParameters> | null,
2076
+ data?: Paths.PruneMeterReadings.RequestBody,
2077
+ config?: AxiosRequestConfig
2078
+ ): OperationResponse<Paths.PruneMeterReadings.Responses.$200>
1985
2079
  /**
1986
2080
  * createMeterReadingFromSubmission - createMeterReadingFromSubmission
1987
2081
  *
@@ -2254,6 +2348,34 @@ interface PathsDictionary {
2254
2348
  config?: AxiosRequestConfig
2255
2349
  ): OperationResponse<Paths.BatchWriteMeterReadings.Responses.$200>
2256
2350
  }
2351
+ ['/v2/metering/readings/prune']: {
2352
+ /**
2353
+ * pruneMeterReadings - pruneMeterReadings
2354
+ *
2355
+ * Deletes every reading of a meter whose `external_id` is NOT in the provided keep list — in a single request.
2356
+ *
2357
+ * The prune scope can optionally be narrowed to a single counter (`counter_id`) and/or a reading `source` (e.g. `ERP`).
2358
+ * Replaces the client-side pattern of paginating the full reading history and issuing chunked batch deletes.
2359
+ *
2360
+ * Readings without an `external_id`:
2361
+ * - when a `source` filter is provided, they are **deleted** — they cannot be referenced by any keep list
2362
+ * - when no `source` filter is provided, they are **kept** (conservative default)
2363
+ *
2364
+ * Deletions reuse the same internal path as `batchWriteMeterReadings` with `operation: delete`: the same
2365
+ * per-reading lifecycle events are emitted, and providing `activity_id` suppresses the per-reading delete
2366
+ * activities and attaches the given activity to the affected meter and counters instead. Delete operations
2367
+ * never create manual-intervention tickets; `create_ticket` is accepted for call-site parity with
2368
+ * `batchWriteMeterReadings`.
2369
+ *
2370
+ * `keep_external_ids` is limited to 10000 entries.
2371
+ *
2372
+ */
2373
+ 'post'(
2374
+ parameters?: Parameters<Paths.PruneMeterReadings.QueryParameters> | null,
2375
+ data?: Paths.PruneMeterReadings.RequestBody,
2376
+ config?: AxiosRequestConfig
2377
+ ): OperationResponse<Paths.PruneMeterReadings.Responses.$200>
2378
+ }
2257
2379
  ['/v1/metering/reading/submission']: {
2258
2380
  /**
2259
2381
  * createMeterReadingFromSubmission - createMeterReadingFromSubmission
@@ -2418,6 +2540,7 @@ type MeterReading = Components.Schemas.MeterReading;
2418
2540
  type MeterReadingChangeset = Components.Schemas.MeterReadingChangeset;
2419
2541
  type PortalMeterReading = Components.Schemas.PortalMeterReading;
2420
2542
  type ProposedReading = Components.Schemas.ProposedReading;
2543
+ type PruneMeterReadingsPayload = Components.Schemas.PruneMeterReadingsPayload;
2421
2544
  type ReadBy = Components.Schemas.ReadBy;
2422
2545
  type Reading = Components.Schemas.Reading;
2423
2546
  type ReadingStatus = Components.Schemas.ReadingStatus;
@@ -2432,4 +2555,4 @@ type TimestampTolerance = Components.Schemas.TimestampTolerance;
2432
2555
  type Unit = Components.Schemas.Unit;
2433
2556
  type UpdateMeterReading = Components.Schemas.UpdateMeterReading;
2434
2557
 
2435
- export { type ActionLabel as A, type BaseEntity as B, type Client as C, type DeleteBatchReading as D, type Entity as E, type FuzzyConfig as F, type TimestampTolerance as G, UpdateMeterReading as H, type Id as I, type JourneyActions as J, type Meter as M, type OperationMethods as O, Paths as P, type ReadBy as R, type Source as S, type TariffType as T, type Unit as U, Components as a, type PathsDictionary as b, type ActivityId as c, type BatchReading as d, type BatchReadingBase as e, type ChangesetCreator as f, type CounterReadingOnSubmission as g, type CreateOrUpdateBatchReading as h, type Direction as i, type EntityId as j, type EntityItem as k, type EntityRelation as l, type EntitySlug as m, type ErrorResp as n, type MeterCounter as o, type MeterReading as p, type MeterReadingChangeset as q, type PortalMeterReading as r, type ProposedReading as s, type Reading as t, type ReadingStatus as u, type ReadingWithMeter as v, type Reason as w, type ReasonString as x, type Rule as y, type SubmissionMeterReading as z };
2558
+ export { type ActionLabel as A, type BaseEntity as B, type Client as C, type DeleteBatchReading as D, type Entity as E, type FuzzyConfig as F, type SubmissionMeterReading as G, type TimestampTolerance as H, type Id as I, type JourneyActions as J, UpdateMeterReading as K, type Meter as M, type OperationMethods as O, Paths as P, type ReadBy as R, type Source as S, type TariffType as T, type Unit as U, Components as a, type PathsDictionary as b, type ActivityId as c, type BatchReading as d, type BatchReadingBase as e, type ChangesetCreator as f, type CounterReadingOnSubmission as g, type CreateOrUpdateBatchReading as h, type Direction as i, type EntityId as j, type EntityItem as k, type EntityRelation as l, type EntitySlug as m, type ErrorResp as n, type MeterCounter as o, type MeterReading as p, type MeterReadingChangeset as q, type PortalMeterReading as r, type ProposedReading as s, type PruneMeterReadingsPayload as t, type Reading as u, type ReadingStatus as v, type ReadingWithMeter as w, type Reason as x, type ReasonString as y, type Rule as z };
@@ -495,7 +495,7 @@ declare namespace Components {
495
495
  /**
496
496
  * The calibration date of the meter
497
497
  * example:
498
- * 2022-10-10T00:00:00.000Z
498
+ * 2022-10-10
499
499
  */
500
500
  calibration_date?: string;
501
501
  /**
@@ -570,7 +570,7 @@ declare namespace Components {
570
570
  /**
571
571
  * The date as of which the forecast reading value is applicable
572
572
  * example:
573
- * 2022-12-10T00:00:00.000Z
573
+ * 2022-12-10
574
574
  */
575
575
  forecast_as_of?: string;
576
576
  /**
@@ -582,7 +582,7 @@ declare namespace Components {
582
582
  /**
583
583
  * The timestamp of the last reading
584
584
  * example:
585
- * 2022-10-10T00:00:00.000Z
585
+ * 2022-10-10
586
586
  */
587
587
  last_reading?: string;
588
588
  /**
@@ -618,7 +618,7 @@ declare namespace Components {
618
618
  /**
619
619
  * If the value is not provided, the system will be set with the time the request is processed.
620
620
  * example:
621
- * 2022-10-10T00:00:00.000Z
621
+ * 2022-10-10
622
622
  */
623
623
  timestamp?: string; // date-time
624
624
  source: Source;
@@ -748,7 +748,7 @@ declare namespace Components {
748
748
  /**
749
749
  * If the value is not provided, the system will be set with the time the request is processed.
750
750
  * example:
751
- * 2022-10-10T00:00:00.000Z
751
+ * 2022-10-10
752
752
  */
753
753
  timestamp?: string; // date-time
754
754
  source: Source;
@@ -790,6 +790,32 @@ declare namespace Components {
790
790
  status?: "valid" | "in-validation" | "implausible";
791
791
  external_id?: string;
792
792
  }
793
+ export interface PruneMeterReadingsPayload {
794
+ /**
795
+ * The ID of the meter whose readings are pruned
796
+ */
797
+ meter_id: EntityId /* uuid */;
798
+ /**
799
+ * Optionally narrows the prune scope to a single counter of the meter
800
+ */
801
+ counter_id?: EntityId /* uuid */;
802
+ /**
803
+ * Optionally only prune readings with this source (e.g. `ERP`)
804
+ */
805
+ source?: Source;
806
+ /**
807
+ * Readings whose `external_id` is contained in this list are kept; every other reading in scope is deleted.
808
+ * An empty array deletes all readings in scope (subject to the no-external-id rule described on the endpoint).
809
+ * Limited to 10000 entries.
810
+ *
811
+ * example:
812
+ * [
813
+ * "erp-reading-1",
814
+ * "erp-reading-2"
815
+ * ]
816
+ */
817
+ keep_external_ids: string[];
818
+ }
793
819
  /**
794
820
  * The person who recorded the reading
795
821
  * example:
@@ -830,7 +856,7 @@ declare namespace Components {
830
856
  /**
831
857
  * If the value is not provided, the system will be set with the time the request is processed.
832
858
  * example:
833
- * 2022-10-10T00:00:00.000Z
859
+ * 2022-10-10
834
860
  */
835
861
  timestamp?: string; // date-time
836
862
  /**
@@ -1121,7 +1147,7 @@ declare namespace Components {
1121
1147
  /**
1122
1148
  * If the value is not provided, the system will be set with the time the request is processed.
1123
1149
  * example:
1124
- * 2022-10-10T00:00:00.000Z
1150
+ * 2022-10-10
1125
1151
  */
1126
1152
  timestamp?: string; // date-time
1127
1153
  /**
@@ -1583,7 +1609,7 @@ declare namespace Paths {
1583
1609
  /**
1584
1610
  * The calibration date of the meter
1585
1611
  * example:
1586
- * 2022-10-10T00:00:00.000Z
1612
+ * 2022-10-10
1587
1613
  */
1588
1614
  calibration_date?: string;
1589
1615
  /**
@@ -1602,7 +1628,7 @@ declare namespace Paths {
1602
1628
  /**
1603
1629
  * The timestamp of the last reading
1604
1630
  * example:
1605
- * 2022-10-10T00:00:00.000Z
1631
+ * 2022-10-10
1606
1632
  */
1607
1633
  last_reading?: string;
1608
1634
  /**
@@ -1771,6 +1797,48 @@ declare namespace Paths {
1771
1797
  export type $500 = Components.Responses.InternalServerError;
1772
1798
  }
1773
1799
  }
1800
+ namespace PruneMeterReadings {
1801
+ namespace Parameters {
1802
+ export type ActivityId = /**
1803
+ * See https://github.com/ulid/spec
1804
+ * example:
1805
+ * 01F130Q52Q6MWSNS8N2AVXV4JN
1806
+ */
1807
+ Components.Schemas.ActivityId /* ulid */;
1808
+ export type Async = boolean;
1809
+ export type CreateTicket = boolean;
1810
+ export type DryRun = boolean;
1811
+ }
1812
+ export interface QueryParameters {
1813
+ async?: Parameters.Async;
1814
+ activity_id?: Parameters.ActivityId;
1815
+ create_ticket?: Parameters.CreateTicket;
1816
+ dry_run?: Parameters.DryRun;
1817
+ }
1818
+ export type RequestBody = Components.Schemas.PruneMeterReadingsPayload;
1819
+ namespace Responses {
1820
+ export interface $200 {
1821
+ data?: {
1822
+ /**
1823
+ * Number of readings deleted (or that would be deleted when `dry_run=true`).
1824
+ * example:
1825
+ * 42
1826
+ */
1827
+ deleted_count?: number;
1828
+ /**
1829
+ * Number of readings in scope that were kept.
1830
+ * example:
1831
+ * 12
1832
+ */
1833
+ kept_count?: number;
1834
+ };
1835
+ }
1836
+ export type $400 = Components.Responses.InvalidRequest;
1837
+ export type $401 = Components.Responses.Unauthorized;
1838
+ export type $403 = Components.Responses.Forbidden;
1839
+ export type $500 = Components.Responses.InternalServerError;
1840
+ }
1841
+ }
1774
1842
  namespace UpdateMeter {
1775
1843
  namespace Parameters {
1776
1844
  export type Id = Components.Schemas.EntityId /* uuid */;
@@ -1982,6 +2050,32 @@ interface OperationMethods {
1982
2050
  data?: Paths.BatchWriteMeterReadings.RequestBody,
1983
2051
  config?: AxiosRequestConfig
1984
2052
  ): OperationResponse<Paths.BatchWriteMeterReadings.Responses.$200>
2053
+ /**
2054
+ * pruneMeterReadings - pruneMeterReadings
2055
+ *
2056
+ * Deletes every reading of a meter whose `external_id` is NOT in the provided keep list — in a single request.
2057
+ *
2058
+ * The prune scope can optionally be narrowed to a single counter (`counter_id`) and/or a reading `source` (e.g. `ERP`).
2059
+ * Replaces the client-side pattern of paginating the full reading history and issuing chunked batch deletes.
2060
+ *
2061
+ * Readings without an `external_id`:
2062
+ * - when a `source` filter is provided, they are **deleted** — they cannot be referenced by any keep list
2063
+ * - when no `source` filter is provided, they are **kept** (conservative default)
2064
+ *
2065
+ * Deletions reuse the same internal path as `batchWriteMeterReadings` with `operation: delete`: the same
2066
+ * per-reading lifecycle events are emitted, and providing `activity_id` suppresses the per-reading delete
2067
+ * activities and attaches the given activity to the affected meter and counters instead. Delete operations
2068
+ * never create manual-intervention tickets; `create_ticket` is accepted for call-site parity with
2069
+ * `batchWriteMeterReadings`.
2070
+ *
2071
+ * `keep_external_ids` is limited to 10000 entries.
2072
+ *
2073
+ */
2074
+ 'pruneMeterReadings'(
2075
+ parameters?: Parameters<Paths.PruneMeterReadings.QueryParameters> | null,
2076
+ data?: Paths.PruneMeterReadings.RequestBody,
2077
+ config?: AxiosRequestConfig
2078
+ ): OperationResponse<Paths.PruneMeterReadings.Responses.$200>
1985
2079
  /**
1986
2080
  * createMeterReadingFromSubmission - createMeterReadingFromSubmission
1987
2081
  *
@@ -2254,6 +2348,34 @@ interface PathsDictionary {
2254
2348
  config?: AxiosRequestConfig
2255
2349
  ): OperationResponse<Paths.BatchWriteMeterReadings.Responses.$200>
2256
2350
  }
2351
+ ['/v2/metering/readings/prune']: {
2352
+ /**
2353
+ * pruneMeterReadings - pruneMeterReadings
2354
+ *
2355
+ * Deletes every reading of a meter whose `external_id` is NOT in the provided keep list — in a single request.
2356
+ *
2357
+ * The prune scope can optionally be narrowed to a single counter (`counter_id`) and/or a reading `source` (e.g. `ERP`).
2358
+ * Replaces the client-side pattern of paginating the full reading history and issuing chunked batch deletes.
2359
+ *
2360
+ * Readings without an `external_id`:
2361
+ * - when a `source` filter is provided, they are **deleted** — they cannot be referenced by any keep list
2362
+ * - when no `source` filter is provided, they are **kept** (conservative default)
2363
+ *
2364
+ * Deletions reuse the same internal path as `batchWriteMeterReadings` with `operation: delete`: the same
2365
+ * per-reading lifecycle events are emitted, and providing `activity_id` suppresses the per-reading delete
2366
+ * activities and attaches the given activity to the affected meter and counters instead. Delete operations
2367
+ * never create manual-intervention tickets; `create_ticket` is accepted for call-site parity with
2368
+ * `batchWriteMeterReadings`.
2369
+ *
2370
+ * `keep_external_ids` is limited to 10000 entries.
2371
+ *
2372
+ */
2373
+ 'post'(
2374
+ parameters?: Parameters<Paths.PruneMeterReadings.QueryParameters> | null,
2375
+ data?: Paths.PruneMeterReadings.RequestBody,
2376
+ config?: AxiosRequestConfig
2377
+ ): OperationResponse<Paths.PruneMeterReadings.Responses.$200>
2378
+ }
2257
2379
  ['/v1/metering/reading/submission']: {
2258
2380
  /**
2259
2381
  * createMeterReadingFromSubmission - createMeterReadingFromSubmission
@@ -2418,6 +2540,7 @@ type MeterReading = Components.Schemas.MeterReading;
2418
2540
  type MeterReadingChangeset = Components.Schemas.MeterReadingChangeset;
2419
2541
  type PortalMeterReading = Components.Schemas.PortalMeterReading;
2420
2542
  type ProposedReading = Components.Schemas.ProposedReading;
2543
+ type PruneMeterReadingsPayload = Components.Schemas.PruneMeterReadingsPayload;
2421
2544
  type ReadBy = Components.Schemas.ReadBy;
2422
2545
  type Reading = Components.Schemas.Reading;
2423
2546
  type ReadingStatus = Components.Schemas.ReadingStatus;
@@ -2432,4 +2555,4 @@ type TimestampTolerance = Components.Schemas.TimestampTolerance;
2432
2555
  type Unit = Components.Schemas.Unit;
2433
2556
  type UpdateMeterReading = Components.Schemas.UpdateMeterReading;
2434
2557
 
2435
- export { type ActionLabel as A, type BaseEntity as B, type Client as C, type DeleteBatchReading as D, type Entity as E, type FuzzyConfig as F, type TimestampTolerance as G, UpdateMeterReading as H, type Id as I, type JourneyActions as J, type Meter as M, type OperationMethods as O, Paths as P, type ReadBy as R, type Source as S, type TariffType as T, type Unit as U, Components as a, type PathsDictionary as b, type ActivityId as c, type BatchReading as d, type BatchReadingBase as e, type ChangesetCreator as f, type CounterReadingOnSubmission as g, type CreateOrUpdateBatchReading as h, type Direction as i, type EntityId as j, type EntityItem as k, type EntityRelation as l, type EntitySlug as m, type ErrorResp as n, type MeterCounter as o, type MeterReading as p, type MeterReadingChangeset as q, type PortalMeterReading as r, type ProposedReading as s, type Reading as t, type ReadingStatus as u, type ReadingWithMeter as v, type Reason as w, type ReasonString as x, type Rule as y, type SubmissionMeterReading as z };
2558
+ export { type ActionLabel as A, type BaseEntity as B, type Client as C, type DeleteBatchReading as D, type Entity as E, type FuzzyConfig as F, type SubmissionMeterReading as G, type TimestampTolerance as H, type Id as I, type JourneyActions as J, UpdateMeterReading as K, type Meter as M, type OperationMethods as O, Paths as P, type ReadBy as R, type Source as S, type TariffType as T, type Unit as U, Components as a, type PathsDictionary as b, type ActivityId as c, type BatchReading as d, type BatchReadingBase as e, type ChangesetCreator as f, type CounterReadingOnSubmission as g, type CreateOrUpdateBatchReading as h, type Direction as i, type EntityId as j, type EntityItem as k, type EntityRelation as l, type EntitySlug as m, type ErrorResp as n, type MeterCounter as o, type MeterReading as p, type MeterReadingChangeset as q, type PortalMeterReading as r, type ProposedReading as s, type PruneMeterReadingsPayload as t, type Reading as u, type ReadingStatus as v, type ReadingWithMeter as w, type Reason as x, type ReasonString as y, type Rule as z };