@epilot/sdk 2.11.6 → 2.12.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.
Files changed (151) hide show
  1. package/definitions/focus-pocus-runtime.json +1 -0
  2. package/definitions/focus-pocus.json +757 -0
  3. package/definitions/integration-toolkit.json +26 -19
  4. package/definitions/metering-runtime.json +1 -1
  5. package/definitions/metering.json +22 -2
  6. package/definitions/notification.json +14 -0
  7. package/dist/apis/access-token.cjs +6 -6
  8. package/dist/apis/access-token.js +1 -1
  9. package/dist/apis/address-suggestions.cjs +6 -6
  10. package/dist/apis/address-suggestions.js +1 -1
  11. package/dist/apis/address.cjs +6 -6
  12. package/dist/apis/address.js +1 -1
  13. package/dist/apis/ai-agents.cjs +6 -6
  14. package/dist/apis/ai-agents.js +1 -1
  15. package/dist/apis/app.cjs +6 -6
  16. package/dist/apis/app.js +1 -1
  17. package/dist/apis/audit-logs.cjs +6 -6
  18. package/dist/apis/audit-logs.js +1 -1
  19. package/dist/apis/automation.cjs +6 -6
  20. package/dist/apis/automation.js +1 -1
  21. package/dist/apis/billing.cjs +6 -6
  22. package/dist/apis/billing.js +1 -1
  23. package/dist/apis/blueprint-manifest.cjs +6 -6
  24. package/dist/apis/blueprint-manifest.js +1 -1
  25. package/dist/apis/calendar.cjs +6 -6
  26. package/dist/apis/calendar.js +1 -1
  27. package/dist/apis/configuration-hub.cjs +6 -6
  28. package/dist/apis/configuration-hub.js +1 -1
  29. package/dist/apis/consent.cjs +6 -6
  30. package/dist/apis/consent.js +1 -1
  31. package/dist/apis/customer-portal.cjs +6 -6
  32. package/dist/apis/customer-portal.js +1 -1
  33. package/dist/apis/dashboard.cjs +6 -6
  34. package/dist/apis/dashboard.js +1 -1
  35. package/dist/apis/data-governance.cjs +6 -6
  36. package/dist/apis/data-governance.js +1 -1
  37. package/dist/apis/deduplication.cjs +6 -6
  38. package/dist/apis/deduplication.js +1 -1
  39. package/dist/apis/design.cjs +6 -6
  40. package/dist/apis/design.js +1 -1
  41. package/dist/apis/document.cjs +6 -6
  42. package/dist/apis/document.js +1 -1
  43. package/dist/apis/email-settings.cjs +6 -6
  44. package/dist/apis/email-settings.js +1 -1
  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.d.cts +2 -2
  61. package/dist/apis/integration-toolkit.d.ts +2 -2
  62. package/dist/apis/integration-toolkit.js +1 -1
  63. package/dist/apis/journey.cjs +6 -6
  64. package/dist/apis/journey.js +1 -1
  65. package/dist/apis/kanban.cjs +6 -6
  66. package/dist/apis/kanban.js +1 -1
  67. package/dist/apis/message.cjs +6 -6
  68. package/dist/apis/message.js +1 -1
  69. package/dist/apis/metering.cjs +8 -8
  70. package/dist/apis/metering.d.cts +2 -2
  71. package/dist/apis/metering.d.ts +2 -2
  72. package/dist/apis/metering.js +2 -2
  73. package/dist/apis/notes.cjs +6 -6
  74. package/dist/apis/notes.js +1 -1
  75. package/dist/apis/notification.cjs +6 -6
  76. package/dist/apis/notification.d.cts +2 -2
  77. package/dist/apis/notification.d.ts +2 -2
  78. package/dist/apis/notification.js +1 -1
  79. package/dist/apis/organization.cjs +6 -6
  80. package/dist/apis/organization.js +1 -1
  81. package/dist/apis/partner-directory.cjs +6 -6
  82. package/dist/apis/partner-directory.js +1 -1
  83. package/dist/apis/permissions.cjs +6 -6
  84. package/dist/apis/permissions.js +1 -1
  85. package/dist/apis/pricing-tier.cjs +6 -6
  86. package/dist/apis/pricing-tier.js +1 -1
  87. package/dist/apis/pricing.cjs +6 -6
  88. package/dist/apis/pricing.js +1 -1
  89. package/dist/apis/purpose.cjs +6 -6
  90. package/dist/apis/purpose.js +1 -1
  91. package/dist/apis/query.cjs +6 -6
  92. package/dist/apis/query.js +1 -1
  93. package/dist/apis/sandbox.cjs +6 -6
  94. package/dist/apis/sandbox.js +1 -1
  95. package/dist/apis/sharing.cjs +6 -6
  96. package/dist/apis/sharing.js +1 -1
  97. package/dist/apis/snapshot.cjs +6 -6
  98. package/dist/apis/snapshot.js +1 -1
  99. package/dist/apis/submission.cjs +6 -6
  100. package/dist/apis/submission.js +1 -1
  101. package/dist/apis/target.cjs +6 -6
  102. package/dist/apis/target.js +1 -1
  103. package/dist/apis/targeting.cjs +6 -6
  104. package/dist/apis/targeting.js +1 -1
  105. package/dist/apis/template-variables.cjs +6 -6
  106. package/dist/apis/template-variables.js +1 -1
  107. package/dist/apis/user.cjs +6 -6
  108. package/dist/apis/user.js +1 -1
  109. package/dist/apis/validation-rules.cjs +6 -6
  110. package/dist/apis/validation-rules.js +1 -1
  111. package/dist/apis/webhooks.cjs +6 -6
  112. package/dist/apis/webhooks.js +1 -1
  113. package/dist/apis/workflow-definition.cjs +6 -6
  114. package/dist/apis/workflow-definition.js +1 -1
  115. package/dist/apis/workflow.cjs +6 -6
  116. package/dist/apis/workflow.js +1 -1
  117. package/dist/chunk-2KZBLHTS.cjs +14 -0
  118. package/dist/{chunk-H72QGQR6.js → chunk-FOGUF2AK.js} +4 -4
  119. package/dist/chunk-K2F255B3.js +14 -0
  120. package/dist/{chunk-F4KDYDCB.cjs → chunk-XGCTJYBW.cjs} +4 -4
  121. package/dist/index.cjs +10 -10
  122. package/dist/index.d.cts +3 -3
  123. package/dist/index.d.ts +3 -3
  124. package/dist/index.js +2 -2
  125. package/dist/integration-toolkit-2BLX4CSH.cjs +7 -0
  126. package/dist/integration-toolkit-OLFKCTLY.js +7 -0
  127. package/dist/{integration-toolkit.d-BVe_MBBi.d.cts → integration-toolkit.d-7q19qDTD.d.cts} +20 -11
  128. package/dist/{integration-toolkit.d-BVe_MBBi.d.ts → integration-toolkit.d-7q19qDTD.d.ts} +20 -11
  129. package/dist/js-yaml-DLCVPJ7G.js +0 -0
  130. package/dist/metering-KLRWUTAL.js +7 -0
  131. package/dist/metering-WU45K2JS.cjs +7 -0
  132. package/dist/{metering-runtime-KZMJKKUZ.js → metering-runtime-7DPUSUYS.js} +1 -1
  133. package/dist/{metering-runtime-IUZJHBVS.cjs → metering-runtime-VXOK3WJZ.cjs} +2 -2
  134. package/dist/{metering.d-CUICZDiL.d.cts → metering.d-BrZWNonl.d.cts} +6 -0
  135. package/dist/{metering.d-CUICZDiL.d.ts → metering.d-BrZWNonl.d.ts} +6 -0
  136. package/dist/notification-PLIRHBNF.js +7 -0
  137. package/dist/notification-R2XBHFEW.cjs +7 -0
  138. package/dist/{notification.d-BfBL3lga.d.ts → notification.d-r89Jec85.d.cts} +24 -2
  139. package/dist/{notification.d-BfBL3lga.d.cts → notification.d-r89Jec85.d.ts} +24 -2
  140. package/docs/integration-toolkit.md +20 -14
  141. package/docs/metering.md +3 -0
  142. package/docs/notification.md +10 -3
  143. package/package.json +12 -11
  144. package/dist/chunk-56MMZJOD.js +0 -14
  145. package/dist/chunk-T6A22LSD.cjs +0 -14
  146. package/dist/integration-toolkit-DUMRNE6A.cjs +0 -7
  147. package/dist/integration-toolkit-IK7KA76K.js +0 -7
  148. package/dist/metering-3IUSYAGN.js +0 -7
  149. package/dist/metering-MHBFU7QH.cjs +0 -7
  150. package/dist/notification-PZOCUYD5.cjs +0 -7
  151. package/dist/notification-VWDZRSFZ.js +0 -7
@@ -0,0 +1,7 @@
1
+ import "./chunk-YPSWSI3M.js";
2
+
3
+ // src/docs/metering.json
4
+ var metering_default = '# Metering API\n\n- **Base URL:** `https://metering.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/metering](https://docs.epilot.io/api/metering)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.metering.getCustomerMeters(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/metering\'\n\nconst meteringClient = getClient()\nauthorize(meteringClient, () => \'<token>\')\nconst { data } = await meteringClient.getCustomerMeters(...)\n```\n\n## Operations\n\n**ECP**\n- [`getCustomerMeters`](#getcustomermeters)\n- [`getMetersByContractId`](#getmetersbycontractid)\n- [`updateMeter`](#updatemeter)\n- [`getMeter`](#getmeter)\n- [`getMeterCounters`](#getmetercounters)\n- [`getCounterDetails`](#getcounterdetails)\n- [`createPortalMeterReadings`](#createportalmeterreadings)\n\n**ECP Admin**\n- [`createMeterReading`](#createmeterreading)\n- [`createMeterReadings`](#createmeterreadings)\n- [`batchWriteMeterReadings`](#batchwritemeterreadings)\n- [`createMeterReadingFromSubmission`](#createmeterreadingfromsubmission)\n- [`getAllowedReadingForMeter`](#getallowedreadingformeter)\n- [`createReadingWithMeter`](#createreadingwithmeter)\n- [`getReadingsByInterval`](#getreadingsbyinterval)\n- [`updateMeterReading`](#updatemeterreading)\n- [`deleteMeterReading`](#deletemeterreading)\n\n**Metering**\n- [`getReadingChangesets`](#getreadingchangesets)\n- [`applyReadingChangeset`](#applyreadingchangeset)\n- [`dismissReadingChangeset`](#dismissreadingchangeset)\n- [`updateReadingChangeset`](#updatereadingchangeset)\n\n**Schemas**\n- [`ErrorResp`](#errorresp)\n- [`EntityId`](#entityid)\n- [`EntitySlug`](#entityslug)\n- [`BaseEntity`](#baseentity)\n- [`Entity`](#entity)\n- [`EntityItem`](#entityitem)\n- [`Id`](#id)\n- [`EntityRelation`](#entityrelation)\n- [`Meter`](#meter)\n- [`Direction`](#direction)\n- [`TariffType`](#tarifftype)\n- [`Reason`](#reason)\n- [`ReasonString`](#reasonstring)\n- [`ReadBy`](#readby)\n- [`ReadingStatus`](#readingstatus)\n- [`Reading`](#reading)\n- [`MeterReading`](#meterreading)\n- [`PortalMeterReading`](#portalmeterreading)\n- [`BatchReadingBase`](#batchreadingbase)\n- [`CreateOrUpdateBatchReading`](#createorupdatebatchreading)\n- [`DeleteBatchReading`](#deletebatchreading)\n- [`BatchReading`](#batchreading)\n- [`UpdateMeterReading`](#updatemeterreading)\n- [`MeterCounter`](#metercounter)\n- [`CounterReadingOnSubmission`](#counterreadingonsubmission)\n- [`SubmissionMeterReading`](#submissionmeterreading)\n- [`Unit`](#unit)\n- [`Source`](#source)\n- [`ActionLabel`](#actionlabel)\n- [`Rule`](#rule)\n- [`JourneyActions`](#journeyactions)\n- [`ReadingWithMeter`](#readingwithmeter)\n- [`MeterReadingChangeset`](#meterreadingchangeset)\n- [`FuzzyConfig`](#fuzzyconfig)\n- [`ProposedReading`](#proposedreading)\n- [`ChangesetCreator`](#changesetcreator)\n- [`TimestampTolerance`](#timestamptolerance)\n- [`ActivityId`](#activityid)\n\n### `getCustomerMeters`\n\nRetrieves all meters associated with the authenticated portal customer.\n\n`GET /v1/metering/meter`\n\n```ts\nconst { data } = await client.getCustomerMeters({\n include_pending_changesets: true,\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": [\n {\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_title": "Example Entity",\n "_org": "123",\n "_tags": ["example", "mock"],\n "_created_at": "2021-02-09T12:41:43.662Z",\n "_updated_at": "2021-02-09T12:41:43.662Z",\n "_schema": "meter",\n "ma_lo_id": "A09-123",\n "status": "active",\n "meter_type": "three-phase-meter",\n "tariff_type": "Peak load tariff",\n "meter_number": "J-1093-1AK",\n "sector": "power",\n "location": [\n {\n "country": "Germany",\n "city": "Koln",\n "postal_code": 81475,\n "street": "Melateng\xFCrtel",\n "street_number": 71,\n "additional_info": "5. Etage",\n "_tags": ["billing", "delivery"]\n }\n ],\n "used_for": "Domestic Usage",\n "manufacturer": "Energy One",\n "calibration_date": "2022-10-10",\n "contract": {\n "$relation": [\n {\n "entity_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_slug": "contact"\n }\n ]\n },\n "customer": {\n "$relation": [\n {\n "entity_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_slug": "contact"\n }\n ]\n },\n "journey_actions": {\n "journey_id": "string",\n "action_label": {\n "en": "string",\n "de": "string"\n },\n "slug": "string",\n "rules": [\n {\n "entity": "string",\n "attribute": "string",\n "attribute_value": "string"\n }\n ]\n },\n "last_reading": "2022-10-10",\n "current_consumption": 100.5\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `getMetersByContractId`\n\nRetrieves all meters associated with a given contract entity.\n\n`GET /v1/metering/contract/meters/{contract_id}`\n\n```ts\nconst { data } = await client.getMetersByContractId({\n contract_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": [\n {\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_title": "Example Entity",\n "_org": "123",\n "_tags": ["example", "mock"],\n "_created_at": "2021-02-09T12:41:43.662Z",\n "_updated_at": "2021-02-09T12:41:43.662Z",\n "_schema": "meter",\n "ma_lo_id": "A09-123",\n "status": "active",\n "meter_type": "three-phase-meter",\n "tariff_type": "Peak load tariff",\n "meter_number": "J-1093-1AK",\n "sector": "power",\n "location": [\n {\n "country": "Germany",\n "city": "Koln",\n "postal_code": 81475,\n "street": "Melateng\xFCrtel",\n "street_number": 71,\n "additional_info": "5. Etage",\n "_tags": ["billing", "delivery"]\n }\n ],\n "used_for": "Domestic Usage",\n "manufacturer": "Energy One",\n "calibration_date": "2022-10-10",\n "contract": {\n "$relation": [\n {\n "entity_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_slug": "contact"\n }\n ]\n },\n "customer": {\n "$relation": [\n {\n "entity_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_slug": "contact"\n }\n ]\n }\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `updateMeter`\n\nPartially updates the details of a meter entity by ID.\n\n`PATCH /v1/metering/meter/{id}`\n\n```ts\nconst { data } = await client.updateMeter(\n {\n id: \'123e4567-e89b-12d3-a456-426614174000\',\n },\n {},\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": {\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_title": "Example Entity",\n "_org": "123",\n "_tags": ["example", "mock"],\n "_created_at": "2021-02-09T12:41:43.662Z",\n "_updated_at": "2021-02-09T12:41:43.662Z",\n "_schema": "meter",\n "ma_lo_id": "A09-123",\n "status": "active",\n "meter_type": "three-phase-meter",\n "tariff_type": "Peak load tariff",\n "meter_number": "J-1093-1AK",\n "sector": "power",\n "location": [\n {\n "country": "Germany",\n "city": "Koln",\n "postal_code": 81475,\n "street": "Melateng\xFCrtel",\n "street_number": 71,\n "additional_info": "5. Etage",\n "_tags": ["billing", "delivery"]\n }\n ],\n "used_for": "Domestic Usage",\n "manufacturer": "Energy One",\n "calibration_date": "2022-10-10",\n "contract": {\n "$relation": [\n {\n "entity_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_slug": "contact"\n }\n ]\n },\n "customer": {\n "$relation": [\n {\n "entity_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_slug": "contact"\n }\n ]\n }\n }\n}\n```\n\n</details>\n\n---\n\n### `getMeter`\n\nRetrieves the full details of a specific meter by ID, including related entities and available journey actions.\n\n`GET /v1/metering/meter/{id}`\n\n```ts\nconst { data } = await client.getMeter({\n id: \'123e4567-e89b-12d3-a456-426614174000\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": {\n "entity": {\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_title": "Example Entity",\n "_org": "123",\n "_tags": ["example", "mock"],\n "_created_at": "2021-02-09T12:41:43.662Z",\n "_updated_at": "2021-02-09T12:41:43.662Z",\n "_schema": "meter",\n "ma_lo_id": "A09-123",\n "status": "active",\n "meter_type": "three-phase-meter",\n "tariff_type": "Peak load tariff",\n "meter_number": "J-1093-1AK",\n "sector": "power",\n "location": [\n {\n "country": "Germany",\n "city": "Koln",\n "postal_code": 81475,\n "street": "Melateng\xFCrtel",\n "street_number": 71,\n "additional_info": "5. Etage",\n "_tags": ["billing", "delivery"]\n }\n ],\n "used_for": "Domestic Usage",\n "manufacturer": "Energy One",\n "calibration_date": "2022-10-10",\n "contract": {\n "$relation": [\n {\n "entity_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_slug": "contact"\n }\n ]\n },\n "customer": {\n "$relation": [\n {\n "entity_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_slug": "contact"\n }\n ]\n }\n },\n "journey_actions": {\n "journey_id": "string",\n "action_label": {\n "en": "string",\n "de": "string"\n },\n "slug": "string",\n "rules": [\n {\n "entity": "string",\n "attribute": "string",\n "attribute_value": "string"\n }\n ]\n },\n "relations": [\n {\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_title": "Example Entity",\n "_org": "123",\n "_tags": ["example", "mock"],\n "_created_at": "2021-02-09T12:41:43.662Z",\n "_updated_at": "2021-02-09T12:41:43.662Z"\n }\n ]\n }\n}\n```\n\n</details>\n\n---\n\n### `getMeterCounters`\n\nRetrieves all meter counters associated with a given meter.\n\n`GET /v1/metering/counter`\n\n```ts\nconst { data } = await client.getMeterCounters({\n meter_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": [\n {\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_title": "Example Entity",\n "_org": "123",\n "_tags": ["example", "mock"],\n "_created_at": "2021-02-09T12:41:43.662Z",\n "_updated_at": "2021-02-09T12:41:43.662Z",\n "_schema": "meter_counter",\n "obis_number": "A-34",\n "direction": "feed-in",\n "transformer_ratio": 70,\n "unit": "string",\n "forecast_reading_value": 270,\n "forecast_as_of": "2022-12-10",\n "current_consumption": 240,\n "last_reading": "2022-10-10",\n "conversion_factor": 3,\n "tariff_type": "ht"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `getCounterDetails`\n\nRetrieves the full details of a single meter counter by its ID.\n\n`GET /v1/metering/counter/{counter_id}`\n\n```ts\nconst { data } = await client.getCounterDetails({\n counter_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": {\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_title": "Example Entity",\n "_org": "123",\n "_tags": ["example", "mock"],\n "_created_at": "2021-02-09T12:41:43.662Z",\n "_updated_at": "2021-02-09T12:41:43.662Z",\n "_schema": "meter_counter",\n "obis_number": "A-34",\n "direction": "feed-in",\n "transformer_ratio": 70,\n "unit": "string",\n "forecast_reading_value": 270,\n "forecast_as_of": "2022-12-10",\n "current_consumption": 240,\n "last_reading": "2022-10-10",\n "conversion_factor": 3,\n "tariff_type": "ht"\n }\n}\n```\n\n</details>\n\n---\n\n### `createMeterReading`\n\nInserts a new meter reading.\n\n`POST /v1/metering/reading`\n\n```ts\nconst { data } = await client.createMeterReading(\n {\n direct: true,\n },\n {\n value: 240,\n read_by: \'John Doe\',\n reason: \'\',\n meter_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n counter_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n direction: \'feed-in\',\n timestamp: \'2022-10-10\',\n source: \'ECP\',\n status: \'valid\',\n external_id: \'string\',\n remark: \'Customer reported unusual consumption\',\n metadata: {\n registration_id: \'1234567890\',\n business_unit: \'ABC\'\n },\n note: \'string\',\n unit: \'string\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": {\n "value": 240,\n "read_by": "John Doe",\n "reason": "",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "direction": "feed-in",\n "timestamp": "2022-10-10",\n "source": "ECP",\n "status": "valid",\n "external_id": "string",\n "remark": "Customer reported unusual consumption",\n "metadata": {\n "registration_id": "1234567890",\n "business_unit": "ABC"\n },\n "note": "string",\n "unit": "string"\n }\n}\n```\n\n</details>\n\n---\n\n### `createMeterReadings`\n\nInserts multiple meter readings at once. Limited to 100 readings per request.\n\n`POST /v1/metering/readings`\n\n```ts\nconst { data } = await client.createMeterReadings(\n {\n async: true,\n activity_id: \'example\',\n skip_validation: true,\n direct: true,\n create_ticket: true,\n },\n {\n readings: [\n {\n value: 240,\n read_by: \'John Doe\',\n reason: \'\',\n meter_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n counter_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n direction: \'feed-in\',\n timestamp: \'2022-10-10\',\n source: \'ECP\',\n status: \'valid\',\n external_id: \'string\',\n remark: \'Customer reported unusual consumption\',\n metadata: {\n registration_id: \'1234567890\',\n business_unit: \'ABC\'\n },\n note: \'string\',\n unit: \'string\'\n }\n ]\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": [\n {\n "value": 240,\n "read_by": "John Doe",\n "reason": "",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "direction": "feed-in",\n "timestamp": "2022-10-10",\n "source": "ECP",\n "status": "valid",\n "external_id": "string",\n "remark": "Customer reported unusual consumption",\n "metadata": {\n "registration_id": "1234567890",\n "business_unit": "ABC"\n },\n "note": "string",\n "unit": "string"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `createPortalMeterReadings`\n\nInserts multiple meter readings at once for a given meter via the end customer portal.\nLimited to 100 readings per request.\n\n`POST /v1/metering/readings/{meter_id}`\n\n```ts\nconst { data } = await client.createPortalMeterReadings(\n {\n meter_id: \'example\',\n direct: true,\n },\n {\n readings: [\n {\n value: 240,\n read_by: \'John Doe\',\n reason: \'\',\n meter_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n counter_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n direction: \'feed-in\',\n timestamp: \'2022-10-10\',\n source: \'ECP\',\n status: \'valid\',\n external_id: \'string\',\n remark: \'Customer reported unusual consumption\',\n metadata: {\n registration_id: \'1234567890\',\n business_unit: \'ABC\'\n },\n note: \'string\',\n unit: \'string\'\n }\n ]\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": [\n {\n "value": 240,\n "read_by": "John Doe",\n "reason": "",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "direction": "feed-in",\n "timestamp": "2022-10-10",\n "source": "ECP",\n "status": "valid",\n "external_id": "string",\n "remark": "Customer reported unusual consumption",\n "metadata": {\n "registration_id": "1234567890",\n "business_unit": "ABC"\n },\n "note": "string",\n "unit": "string"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `batchWriteMeterReadings`\n\nUpserts or deletes multiple meter readings at once. Limited to 100 readings per request.\n\n`POST /v2/metering/readings`\n\n```ts\nconst { data } = await client.batchWriteMeterReadings(\n {\n async: true,\n skip_validation: true,\n activity_id: \'example\',\n direct: true,\n create_ticket: true,\n },\n {\n identifiers: [\'string\'],\n readings: [\n {\n meter_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n counter_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n direction: \'feed-in\',\n timestamp: \'2022-10-10T10:00:00Z\',\n external_id: \'string\',\n metadata: {\n registration_id: \'1234567890\',\n business_unit: \'ABC\'\n },\n operation: \'create\',\n value: 240,\n source: \'ECP\',\n read_by: \'John Doe\',\n reason: \'\',\n status: \'valid\',\n remark: \'Customer reported unusual consumption\',\n note: \'string\',\n unit: \'string\'\n }\n ]\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": [\n {\n "value": 240,\n "read_by": "John Doe",\n "reason": "",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "direction": "feed-in",\n "timestamp": "2022-10-10",\n "source": "ECP",\n "status": "valid",\n "external_id": "string",\n "remark": "Customer reported unusual consumption",\n "metadata": {\n "registration_id": "1234567890",\n "business_unit": "ABC"\n },\n "note": "string",\n "unit": "string"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `createMeterReadingFromSubmission`\n\nCreates meter readings from a journey submission payload.\n\n`POST /v1/metering/reading/submission`\n\n```ts\nconst { data } = await client.createMeterReadingFromSubmission(\n null,\n {\n org_id: \'123\',\n entity: {\n _org: \'123\',\n meterReadings: [\n {\n meterId: \'string\',\n readings: [\n {\n counterId: \'string\',\n direction: \'feed-in\',\n unit: \'string\',\n value: 240\n }\n ],\n readingValue: 240,\n readingDate: \'2022-10-10T10:10:00.000Z\',\n readBy: \'John Doe\',\n reason: \'\',\n maloId: \'A09-123\',\n obisNumber: \'A-34\',\n readingUnit: \'string\',\n meterType: \'one_tariff\',\n feedInValue: 240,\n feedOutValue: 240,\n htValue: 240,\n ntValue: 240\n }\n ]\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "message": "Successfully Processed"\n}\n```\n\n</details>\n\n---\n\n### `getAllowedReadingForMeter`\n\nReturns the allowed min/max reading range for each counter of the given meter.\n\n`GET /v1/metering/allowed/reading/{meter_id}`\n\n```ts\nconst { data } = await client.getAllowedReadingForMeter({\n meter_id: \'example\',\n timestamp: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": [\n {\n "counter_id": "string",\n "min_value": 0,\n "max_value": 0\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `createReadingWithMeter`\n\nCreates a meter reading along with meter lookup or creation by MA-LO ID and OBIS number.\n\n`POST /v1/metering/reading/with-meter`\n\n```ts\nconst { data } = await client.createReadingWithMeter(\n null,\n {\n ma_lo_id: \'A09-123\',\n meter_id: \'string\',\n obis_number: \'A-34\',\n unit: \'string\',\n direction: \'feed-in\',\n tariff_type: \'ht\',\n value: 240,\n read_by: \'John Doe\',\n reason: \'\',\n timestamp: \'2022-10-10T10:10:00.000Z\',\n source: \'ECP\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": {\n "value": 240,\n "read_by": "John Doe",\n "reason": "",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "direction": "feed-in",\n "timestamp": "2022-10-10",\n "source": "ECP",\n "status": "valid",\n "external_id": "string",\n "remark": "Customer reported unusual consumption",\n "metadata": {\n "registration_id": "1234567890",\n "business_unit": "ABC"\n },\n "note": "string",\n "unit": "string"\n }\n}\n```\n\n</details>\n\n---\n\n### `getReadingsByInterval`\n\nRetrieves all readings specified in an interval.\nIf the start_date and end_date are equal, then it returns the readings of the specified date.\nThe start_date should be less than or equal to the end_da\n\n`GET /v1/metering/reading/{meter_id}/{counter_id}`\n\n```ts\nconst { data } = await client.getReadingsByInterval({\n meter_id: \'example\',\n counter_id: \'example\',\n start_date: \'example\',\n end_date: \'example\',\n direction: \'example\',\n size: 1,\n from: 1,\n type: \'example\',\n sort: \'example\',\n include_pending_changesets: true,\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "value": 240,\n "read_by": "John Doe",\n "reason": "",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "direction": "feed-in",\n "timestamp": "2022-10-10",\n "source": "ECP",\n "status": "valid",\n "external_id": "string",\n "remark": "Customer reported unusual consumption",\n "metadata": {\n "registration_id": "1234567890",\n "business_unit": "ABC"\n },\n "note": "string",\n "unit": "string"\n }\n ],\n "hits": 120,\n "firstRecordCreatedAt": "2022-10-01T20:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `updateMeterReading`\n\nUpdates an existing meter reading identified by meter ID, counter ID, and timestamp.\n\n`PUT /v1/metering/reading/{meter_id}/{counter_id}`\n\n```ts\nconst { data } = await client.updateMeterReading(\n {\n meter_id: \'example\',\n counter_id: \'example\',\n timestamp: \'example\',\n },\n {\n value: 240,\n read_by: \'John Doe\',\n reason: \'string\',\n meter_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n counter_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n direction: \'feed-in\',\n timestamp: \'2022-10-10\',\n source: \'ECP\',\n status: \'valid\',\n external_id: \'string\',\n remark: \'Customer reported unusual consumption\',\n metadata: {\n registration_id: \'1234567890\',\n business_unit: \'ABC\'\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": {\n "value": 240,\n "read_by": "John Doe",\n "reason": "",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "direction": "feed-in",\n "timestamp": "2022-10-10",\n "source": "ECP",\n "status": "valid",\n "external_id": "string",\n "remark": "Customer reported unusual consumption",\n "metadata": {\n "registration_id": "1234567890",\n "business_unit": "ABC"\n },\n "note": "string",\n "unit": "string"\n }\n}\n```\n\n</details>\n\n---\n\n### `deleteMeterReading`\n\nPermanently deletes a meter reading identified by meter ID, counter ID, and timestamp.\n\n`DELETE /v1/metering/reading/{meter_id}/{counter_id}`\n\n```ts\nconst { data } = await client.deleteMeterReading({\n meter_id: \'example\',\n counter_id: \'example\',\n timestamp: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": {\n "meterId": "string",\n "counterId": "string",\n "timestamp": "2022-10-01T20:00:00.000Z"\n }\n}\n```\n\n</details>\n\n---\n\n### `getReadingChangesets`\n\nList pending reading changesets for a counter\n\n`GET /v1/metering/reading/{meter_id}/{counter_id}/changesets`\n\n```ts\nconst { data } = await client.getReadingChangesets({\n meter_id: \'example\',\n counter_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "changesets": [\n {\n "changeset_id": "string",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "proposed": {\n "value": 0,\n "direction": "feed-in",\n "timestamp": "1970-01-01T00:00:00.000Z",\n "reason": "string",\n "remark": "string",\n "read_by": "string",\n "status": "valid",\n "external_id": "string"\n },\n "previous": {\n "value": 0,\n "direction": "feed-in",\n "timestamp": "1970-01-01T00:00:00.000Z",\n "reason": "string",\n "remark": "string",\n "read_by": "string",\n "status": "valid",\n "external_id": "string"\n },\n "edit_mode": "external",\n "match_strategy": "exact",\n "timestamp_tolerance": "exact",\n "created_at": "1970-01-01T00:00:00.000Z",\n "created_by": {\n "type": "user",\n "id": "string"\n },\n "source": "360",\n "fuzzy_config": {\n "percentage_threshold": 0.01,\n "absolute_threshold": 0\n },\n "dismissed_reason": "string",\n "dismissed_at": "1970-01-01T00:00:00.000Z"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `applyReadingChangeset`\n\nApply (approve) a pending reading changeset\n\n`POST /v1/metering/reading/{meter_id}/{counter_id}/changesets/{changeset_id}:apply`\n\n```ts\nconst { data } = await client.applyReadingChangeset({\n meter_id: \'example\',\n counter_id: \'example\',\n changeset_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "reading": {\n "value": 240,\n "read_by": "John Doe",\n "reason": "",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "direction": "feed-in",\n "timestamp": "2022-10-10",\n "source": "ECP",\n "status": "valid",\n "external_id": "string",\n "remark": "Customer reported unusual consumption",\n "metadata": {\n "registration_id": "1234567890",\n "business_unit": "ABC"\n },\n "note": "string",\n "unit": "string"\n },\n "changeset": {\n "changeset_id": "string",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "proposed": {\n "value": 0,\n "direction": "feed-in",\n "timestamp": "1970-01-01T00:00:00.000Z",\n "reason": "string",\n "remark": "string",\n "read_by": "string",\n "status": "valid",\n "external_id": "string"\n },\n "previous": {\n "value": 0,\n "direction": "feed-in",\n "timestamp": "1970-01-01T00:00:00.000Z",\n "reason": "string",\n "remark": "string",\n "read_by": "string",\n "status": "valid",\n "external_id": "string"\n },\n "edit_mode": "external",\n "match_strategy": "exact",\n "timestamp_tolerance": "exact",\n "created_at": "1970-01-01T00:00:00.000Z",\n "created_by": {\n "type": "user",\n "id": "string"\n },\n "source": "360",\n "fuzzy_config": {\n "percentage_threshold": 0.01,\n "absolute_threshold": 0\n },\n "dismissed_reason": "string",\n "dismissed_at": "1970-01-01T00:00:00.000Z"\n }\n}\n```\n\n</details>\n\n---\n\n### `dismissReadingChangeset`\n\nDismiss (reject) a pending reading changeset\n\n`POST /v1/metering/reading/{meter_id}/{counter_id}/changesets/{changeset_id}:dismiss`\n\n```ts\nconst { data } = await client.dismissReadingChangeset(\n {\n meter_id: \'example\',\n counter_id: \'example\',\n changeset_id: \'example\',\n },\n {\n reason: \'string\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "changeset_id": "string",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "proposed": {\n "value": 0,\n "direction": "feed-in",\n "timestamp": "1970-01-01T00:00:00.000Z",\n "reason": "string",\n "remark": "string",\n "read_by": "string",\n "status": "valid",\n "external_id": "string"\n },\n "previous": {\n "value": 0,\n "direction": "feed-in",\n "timestamp": "1970-01-01T00:00:00.000Z",\n "reason": "string",\n "remark": "string",\n "read_by": "string",\n "status": "valid",\n "external_id": "string"\n },\n "edit_mode": "external",\n "match_strategy": "exact",\n "timestamp_tolerance": "exact",\n "created_at": "1970-01-01T00:00:00.000Z",\n "created_by": {\n "type": "user",\n "id": "string"\n },\n "source": "360",\n "fuzzy_config": {\n "percentage_threshold": 0.01,\n "absolute_threshold": 0\n },\n "dismissed_reason": "string",\n "dismissed_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `updateReadingChangeset`\n\nEdit a pending reading changeset\n\n`PATCH /v1/metering/reading/{meter_id}/{counter_id}/changesets/{changeset_id}`\n\n```ts\nconst { data } = await client.updateReadingChangeset(\n {\n meter_id: \'example\',\n counter_id: \'example\',\n changeset_id: \'example\',\n },\n {\n proposed: {\n value: 0,\n direction: \'feed-in\',\n timestamp: \'1970-01-01T00:00:00.000Z\',\n reason: \'string\',\n remark: \'string\',\n read_by: \'string\',\n status: \'valid\',\n external_id: \'string\'\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "changeset_id": "string",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "proposed": {\n "value": 0,\n "direction": "feed-in",\n "timestamp": "1970-01-01T00:00:00.000Z",\n "reason": "string",\n "remark": "string",\n "read_by": "string",\n "status": "valid",\n "external_id": "string"\n },\n "previous": {\n "value": 0,\n "direction": "feed-in",\n "timestamp": "1970-01-01T00:00:00.000Z",\n "reason": "string",\n "remark": "string",\n "read_by": "string",\n "status": "valid",\n "external_id": "string"\n },\n "edit_mode": "external",\n "match_strategy": "exact",\n "timestamp_tolerance": "exact",\n "created_at": "1970-01-01T00:00:00.000Z",\n "created_by": {\n "type": "user",\n "id": "string"\n },\n "source": "360",\n "fuzzy_config": {\n "percentage_threshold": 0.01,\n "absolute_threshold": 0\n },\n "dismissed_reason": "string",\n "dismissed_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `ErrorResp`\n\n```ts\ntype ErrorResp = {\n message?: string\n}\n```\n\n### `EntityId`\n\n```ts\ntype EntityId = string // uuid\n```\n\n### `EntitySlug`\n\nURL-friendly identifier for the entity schema\n\n```ts\ntype EntitySlug = string\n```\n\n### `BaseEntity`\n\n```ts\ntype BaseEntity = {\n _id: string // uuid\n _title: string\n _org: string\n _tags?: string[]\n _created_at: string // date-time\n _updated_at: string // date-time\n}\n```\n\n### `Entity`\n\n```ts\ntype Entity = Record<string, unknown>\n```\n\n### `EntityItem`\n\n```ts\ntype EntityItem = {\n _id: string // uuid\n _title: string\n _org: string\n _tags?: string[]\n _created_at: string // date-time\n _updated_at: string // date-time\n}\n```\n\n### `Id`\n\n```ts\ntype Id = string\n```\n\n### `EntityRelation`\n\n```ts\ntype EntityRelation = {\n entity_id?: string // uuid\n _slug?: "contact" | "contract"\n}\n```\n\n### `Meter`\n\n```ts\ntype Meter = {\n _id: string // uuid\n _title: string\n _org: string\n _tags?: string[]\n _created_at: string // date-time\n _updated_at: string // date-time\n _schema: "meter"\n ma_lo_id?: string\n status?: "active" | "decommissioned"\n meter_type?: "three-phase-meter" | "bellow-gas-meter" | "rotary-piston-meter" | "smart-meter" | "performance-meter" | "maximum-meter" | "turbine-gas-meter" | "ultrasonic-gas-meter" | "alternating-current-meter" | "modern-metering-system" | "intelligent-measuring-system" | "electronic-meter"\n tariff_type?: string\n meter_number?: string\n sector?: "power" | "water" | "gas" | "district_heating" | "waste_water"\n location?: object\n used_for?: string\n manufacturer?: string\n calibration_date?: string\n contract?: {\n $relation?: Array<{\n entity_id?: { ... }\n _slug?: { ... }\n }>\n }\n customer?: {\n $relation?: Array<{\n entity_id?: { ... }\n _slug?: { ... }\n }>\n }\n}\n```\n\n### `Direction`\n\n```ts\ntype Direction = "feed-in" | "feed-out"\n```\n\n### `TariffType`\n\n```ts\ntype TariffType = "ht" | "nt"\n```\n\n### `Reason`\n\nThe reason for recording the reading\nIf no reason is specified or left empty, the Epilot UI will show \'Regular\' as the default display text\n\n\n```ts\ntype Reason = "" | "regular" | "irregular" | "last" | "first" | "meter_change" | "contract_change" | "meter_adjustment"\n```\n\n### `ReasonString`\n\nThis field is deprecated. Please use the Reason enum instead.\n\n\n```ts\ntype ReasonString = string\n```\n\n### `ReadBy`\n\nThe person who recorded the reading\n\n```ts\ntype ReadBy = string\n```\n\n### `ReadingStatus`\n\n```ts\ntype ReadingStatus = "valid" | "in-validation" | "implausible" | null | ""\n```\n\n### `Reading`\n\n```ts\ntype Reading = {\n value: number\n read_by?: string\n reason?: "" | "regular" | "irregular" | "last" | "first" | "meter_change" | "contract_change" | "meter_adjustment"\n meter_id?: string // uuid\n counter_id?: string // uuid\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n source: "ECP" | "ERP" | "360" | "journey-submission"\n status?: "valid" | "in-validation" | "implausible" | null | ""\n external_id?: string\n remark?: string\n metadata?: Record<string, string>\n note?: string\n unit?: string\n}\n```\n\n### `MeterReading`\n\n```ts\ntype MeterReading = {\n value: number\n read_by?: string\n reason?: "" | "regular" | "irregular" | "last" | "first" | "meter_change" | "contract_change" | "meter_adjustment"\n meter_id: string // uuid\n counter_id?: string // uuid\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n source: "ECP" | "ERP" | "360" | "journey-submission"\n status?: "valid" | "in-validation" | "implausible" | null | ""\n external_id?: string\n remark?: string\n metadata?: Record<string, string>\n note?: string\n unit?: string\n}\n```\n\n### `PortalMeterReading`\n\n```ts\ntype PortalMeterReading = {\n value: number\n read_by?: string\n reason?: "" | "regular" | "irregular" | "last" | "first" | "meter_change" | "contract_change" | "meter_adjustment"\n meter_id?: string // uuid\n counter_id: string // uuid\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n source: "ECP" | "ERP" | "360" | "journey-submission"\n status?: "valid" | "in-validation" | "implausible" | null | ""\n external_id?: string\n remark?: string\n metadata?: Record<string, string>\n note?: string\n unit?: string\n}\n```\n\n### `BatchReadingBase`\n\nBase properties shared by all batch reading operations\n\n```ts\ntype BatchReadingBase = {\n meter_id?: string // uuid\n counter_id?: string // uuid\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n external_id?: string\n metadata?: Record<string, string>\n}\n```\n\n### `CreateOrUpdateBatchReading`\n\nSchema for create or update operations - requires value, source, and meter_id\n\n```ts\ntype CreateOrUpdateBatchReading = {\n meter_id: string // uuid\n counter_id?: string // uuid\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n external_id?: string\n metadata?: Record<string, string>\n operation?: "create" | "update"\n value: number\n source: "ECP" | "ERP" | "360" | "journey-submission"\n read_by?: string\n reason?: "" | "regular" | "irregular" | "last" | "first" | "meter_change" | "contract_change" | "meter_adjustment"\n status?: "valid" | "in-validation" | "implausible" | null | ""\n remark?: string\n note?: string\n unit?: string\n}\n```\n\n### `DeleteBatchReading`\n\nSchema for delete operations - only requires identifier fields specified in the identifiers parameter\n\n```ts\ntype DeleteBatchReading = {\n meter_id?: string // uuid\n counter_id?: string // uuid\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n external_id?: string\n metadata?: Record<string, string>\n operation: "delete"\n}\n```\n\n### `BatchReading`\n\nA meter reading for batch operations. The required fields depend on the operation:\n- create/update: requires value, source, and meter_id\n- delete: only requires the fields specified in the identifiers parameter\n\n\n```ts\ntype BatchReading = {\n meter_id: string // uuid\n counter_id?: string // uuid\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n external_id?: string\n metadata?: Record<string, string>\n operation?: "create" | "update"\n value: number\n source: "ECP" | "ERP" | "360" | "journey-submission"\n read_by?: string\n reason?: "" | "regular" | "irregular" | "last" | "first" | "meter_change" | "contract_change" | "meter_adjustment"\n status?: "valid" | "in-validation" | "implausible" | null | ""\n remark?: string\n note?: string\n unit?: string\n} | {\n meter_id?: string // uuid\n counter_id?: string // uuid\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n external_id?: string\n metadata?: Record<string, string>\n operation: "delete"\n}\n```\n\n### `UpdateMeterReading`\n\n```ts\ntype UpdateMeterReading = {\n value: number\n read_by?: string\n reason?: string\n meter_id: string // uuid\n counter_id?: string // uuid\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n source: "ECP" | "ERP" | "360" | "journey-submission"\n status?: "valid" | "in-validation" | "implausible" | null | ""\n external_id?: string\n remark?: string\n metadata?: Record<string, string>\n}\n```\n\n### `MeterCounter`\n\n```ts\ntype MeterCounter = {\n _id: string // uuid\n _title: string\n _org: string\n _tags?: string[]\n _created_at: string // date-time\n _updated_at: string // date-time\n _schema: "meter_counter"\n obis_number?: string\n direction?: "feed-in" | "feed-out"\n transformer_ratio?: number\n unit?: string\n forecast_reading_value?: string\n forecast_as_of?: string\n current_consumption?: number\n last_reading?: string\n conversion_factor?: number\n tariff_type?: "ht" | "nt"\n}\n```\n\n### `CounterReadingOnSubmission`\n\n```ts\ntype CounterReadingOnSubmission = {\n counterId: string\n direction: "feed-in" | "feed-out"\n unit?: string\n value: number\n}\n```\n\n### `SubmissionMeterReading`\n\n```ts\ntype SubmissionMeterReading = {\n meterId: string\n readings?: Array<{\n counterId: string\n direction: "feed-in" | "feed-out"\n unit?: string\n value: number\n }>\n readingValue?: number\n readingDate?: string\n readBy?: string\n reason?: "" | "regular" | "irregular" | "last" | "first" | "meter_change" | "contract_change" | "meter_adjustment"\n maloId?: string\n obisNumber?: string\n readingUnit?: string\n meterType?: "one_tariff" | "two_tariff" | "bi_directional"\n feedInValue?: number\n feedOutValue?: number\n htValue?: number\n ntValue?: number\n}\n```\n\n### `Unit`\n\n```ts\ntype Unit = string\n```\n\n### `Source`\n\n```ts\ntype Source = "ECP" | "ERP" | "360" | "journey-submission"\n```\n\n### `ActionLabel`\n\n```ts\ntype ActionLabel = {\n en?: string\n de?: string\n}\n```\n\n### `Rule`\n\n```ts\ntype Rule = {\n entity?: string\n attribute?: string\n attribute_value?: string\n}\n```\n\n### `JourneyActions`\n\n```ts\ntype JourneyActions = {\n journey_id?: string\n action_label?: {\n en?: string\n de?: string\n }\n slug?: string\n rules?: Array<{\n entity?: string\n attribute?: string\n attribute_value?: string\n }>\n}\n```\n\n### `ReadingWithMeter`\n\n```ts\ntype ReadingWithMeter = {\n ma_lo_id?: string\n meter_id?: string\n obis_number?: string\n unit?: string\n direction?: "feed-in" | "feed-out"\n tariff_type?: "ht" | "nt"\n value?: number\n read_by?: string\n reason?: "" | "regular" | "irregular" | "last" | "first" | "meter_change" | "contract_change" | "meter_adjustment"\n timestamp?: string\n source?: "ECP" | "ERP" | "360" | "journey-submission"\n}\n```\n\n### `MeterReadingChangeset`\n\n```ts\ntype MeterReadingChangeset = {\n changeset_id: string\n meter_id?: string // uuid\n counter_id?: string // uuid\n proposed: {\n value: number\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n reason?: string\n remark?: string\n read_by?: string\n status?: "valid" | "in-validation" | "implausible"\n external_id?: string\n }\n previous?: {\n value: number\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n reason?: string\n remark?: string\n read_by?: string\n status?: "valid" | "in-validation" | "implausible"\n external_id?: string\n }\n edit_mode: "external" | "approval"\n match_strategy?: "exact" | "fuzzy"\n timestamp_tolerance?: "exact" | {\n type: "same-day"\n timezone?: string\n } | {\n type: "within-seconds"\n seconds: number\n }\n created_at: string // date-time\n created_by?: {\n type?: "user" | "portal_user" | "api_client" | "automation"\n id?: string\n }\n source?: "360" | "ECP" | "ERP" | "journey-submission"\n fuzzy_config?: {\n percentage_threshold?: number\n absolute_threshold?: number\n }\n dismissed_reason?: string\n dismissed_at?: string // date-time\n}\n```\n\n### `FuzzyConfig`\n\nNumeric-threshold fuzzy matching for meter reading auto-clear.\n\nNOTE: This is intentionally different from entity-api\'s FuzzyConfig. Entity-api\'s\nfuzzy strategies (suffix, digits_only, normalize_phone, ignore_fields,\ncontains_entry, regex) are designed for strings and structured objects (IBAN, phone\n\n```ts\ntype FuzzyConfig = {\n percentage_threshold?: number\n absolute_threshold?: number\n}\n```\n\n### `ProposedReading`\n\n```ts\ntype ProposedReading = {\n value: number\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n reason?: string\n remark?: string\n read_by?: string\n status?: "valid" | "in-validation" | "implausible"\n external_id?: string\n}\n```\n\n### `ChangesetCreator`\n\n```ts\ntype ChangesetCreator = {\n type?: "user" | "portal_user" | "api_client" | "automation"\n id?: string\n}\n```\n\n### `TimestampTolerance`\n\nSlack on `reading.timestamp` when auto-clear matches an incoming reading\nagainst a pending changeset. Both sides reference the SAME physical\nmeter-read event \u2014 one as stored when the user submitted, the other as\nechoed back by the ERP. The tolerance accommodates round-trip format\ndrift between the t\n\n```ts\ntype TimestampTolerance = "exact" | {\n type: "same-day"\n timezone?: string\n} | {\n type: "within-seconds"\n seconds: number\n}\n```\n\n### `ActivityId`\n\nSee https://github.com/ulid/spec\n\n```ts\ntype ActivityId = string // ulid\n```\n';
5
+ export {
6
+ metering_default as default
7
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-NJK5F5TF.cjs');
2
+
3
+ // src/docs/metering.json
4
+ var metering_default = '# Metering API\n\n- **Base URL:** `https://metering.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/metering](https://docs.epilot.io/api/metering)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.metering.getCustomerMeters(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/metering\'\n\nconst meteringClient = getClient()\nauthorize(meteringClient, () => \'<token>\')\nconst { data } = await meteringClient.getCustomerMeters(...)\n```\n\n## Operations\n\n**ECP**\n- [`getCustomerMeters`](#getcustomermeters)\n- [`getMetersByContractId`](#getmetersbycontractid)\n- [`updateMeter`](#updatemeter)\n- [`getMeter`](#getmeter)\n- [`getMeterCounters`](#getmetercounters)\n- [`getCounterDetails`](#getcounterdetails)\n- [`createPortalMeterReadings`](#createportalmeterreadings)\n\n**ECP Admin**\n- [`createMeterReading`](#createmeterreading)\n- [`createMeterReadings`](#createmeterreadings)\n- [`batchWriteMeterReadings`](#batchwritemeterreadings)\n- [`createMeterReadingFromSubmission`](#createmeterreadingfromsubmission)\n- [`getAllowedReadingForMeter`](#getallowedreadingformeter)\n- [`createReadingWithMeter`](#createreadingwithmeter)\n- [`getReadingsByInterval`](#getreadingsbyinterval)\n- [`updateMeterReading`](#updatemeterreading)\n- [`deleteMeterReading`](#deletemeterreading)\n\n**Metering**\n- [`getReadingChangesets`](#getreadingchangesets)\n- [`applyReadingChangeset`](#applyreadingchangeset)\n- [`dismissReadingChangeset`](#dismissreadingchangeset)\n- [`updateReadingChangeset`](#updatereadingchangeset)\n\n**Schemas**\n- [`ErrorResp`](#errorresp)\n- [`EntityId`](#entityid)\n- [`EntitySlug`](#entityslug)\n- [`BaseEntity`](#baseentity)\n- [`Entity`](#entity)\n- [`EntityItem`](#entityitem)\n- [`Id`](#id)\n- [`EntityRelation`](#entityrelation)\n- [`Meter`](#meter)\n- [`Direction`](#direction)\n- [`TariffType`](#tarifftype)\n- [`Reason`](#reason)\n- [`ReasonString`](#reasonstring)\n- [`ReadBy`](#readby)\n- [`ReadingStatus`](#readingstatus)\n- [`Reading`](#reading)\n- [`MeterReading`](#meterreading)\n- [`PortalMeterReading`](#portalmeterreading)\n- [`BatchReadingBase`](#batchreadingbase)\n- [`CreateOrUpdateBatchReading`](#createorupdatebatchreading)\n- [`DeleteBatchReading`](#deletebatchreading)\n- [`BatchReading`](#batchreading)\n- [`UpdateMeterReading`](#updatemeterreading)\n- [`MeterCounter`](#metercounter)\n- [`CounterReadingOnSubmission`](#counterreadingonsubmission)\n- [`SubmissionMeterReading`](#submissionmeterreading)\n- [`Unit`](#unit)\n- [`Source`](#source)\n- [`ActionLabel`](#actionlabel)\n- [`Rule`](#rule)\n- [`JourneyActions`](#journeyactions)\n- [`ReadingWithMeter`](#readingwithmeter)\n- [`MeterReadingChangeset`](#meterreadingchangeset)\n- [`FuzzyConfig`](#fuzzyconfig)\n- [`ProposedReading`](#proposedreading)\n- [`ChangesetCreator`](#changesetcreator)\n- [`TimestampTolerance`](#timestamptolerance)\n- [`ActivityId`](#activityid)\n\n### `getCustomerMeters`\n\nRetrieves all meters associated with the authenticated portal customer.\n\n`GET /v1/metering/meter`\n\n```ts\nconst { data } = await client.getCustomerMeters({\n include_pending_changesets: true,\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": [\n {\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_title": "Example Entity",\n "_org": "123",\n "_tags": ["example", "mock"],\n "_created_at": "2021-02-09T12:41:43.662Z",\n "_updated_at": "2021-02-09T12:41:43.662Z",\n "_schema": "meter",\n "ma_lo_id": "A09-123",\n "status": "active",\n "meter_type": "three-phase-meter",\n "tariff_type": "Peak load tariff",\n "meter_number": "J-1093-1AK",\n "sector": "power",\n "location": [\n {\n "country": "Germany",\n "city": "Koln",\n "postal_code": 81475,\n "street": "Melateng\xFCrtel",\n "street_number": 71,\n "additional_info": "5. Etage",\n "_tags": ["billing", "delivery"]\n }\n ],\n "used_for": "Domestic Usage",\n "manufacturer": "Energy One",\n "calibration_date": "2022-10-10",\n "contract": {\n "$relation": [\n {\n "entity_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_slug": "contact"\n }\n ]\n },\n "customer": {\n "$relation": [\n {\n "entity_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_slug": "contact"\n }\n ]\n },\n "journey_actions": {\n "journey_id": "string",\n "action_label": {\n "en": "string",\n "de": "string"\n },\n "slug": "string",\n "rules": [\n {\n "entity": "string",\n "attribute": "string",\n "attribute_value": "string"\n }\n ]\n },\n "last_reading": "2022-10-10",\n "current_consumption": 100.5\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `getMetersByContractId`\n\nRetrieves all meters associated with a given contract entity.\n\n`GET /v1/metering/contract/meters/{contract_id}`\n\n```ts\nconst { data } = await client.getMetersByContractId({\n contract_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": [\n {\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_title": "Example Entity",\n "_org": "123",\n "_tags": ["example", "mock"],\n "_created_at": "2021-02-09T12:41:43.662Z",\n "_updated_at": "2021-02-09T12:41:43.662Z",\n "_schema": "meter",\n "ma_lo_id": "A09-123",\n "status": "active",\n "meter_type": "three-phase-meter",\n "tariff_type": "Peak load tariff",\n "meter_number": "J-1093-1AK",\n "sector": "power",\n "location": [\n {\n "country": "Germany",\n "city": "Koln",\n "postal_code": 81475,\n "street": "Melateng\xFCrtel",\n "street_number": 71,\n "additional_info": "5. Etage",\n "_tags": ["billing", "delivery"]\n }\n ],\n "used_for": "Domestic Usage",\n "manufacturer": "Energy One",\n "calibration_date": "2022-10-10",\n "contract": {\n "$relation": [\n {\n "entity_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_slug": "contact"\n }\n ]\n },\n "customer": {\n "$relation": [\n {\n "entity_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_slug": "contact"\n }\n ]\n }\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `updateMeter`\n\nPartially updates the details of a meter entity by ID.\n\n`PATCH /v1/metering/meter/{id}`\n\n```ts\nconst { data } = await client.updateMeter(\n {\n id: \'123e4567-e89b-12d3-a456-426614174000\',\n },\n {},\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": {\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_title": "Example Entity",\n "_org": "123",\n "_tags": ["example", "mock"],\n "_created_at": "2021-02-09T12:41:43.662Z",\n "_updated_at": "2021-02-09T12:41:43.662Z",\n "_schema": "meter",\n "ma_lo_id": "A09-123",\n "status": "active",\n "meter_type": "three-phase-meter",\n "tariff_type": "Peak load tariff",\n "meter_number": "J-1093-1AK",\n "sector": "power",\n "location": [\n {\n "country": "Germany",\n "city": "Koln",\n "postal_code": 81475,\n "street": "Melateng\xFCrtel",\n "street_number": 71,\n "additional_info": "5. Etage",\n "_tags": ["billing", "delivery"]\n }\n ],\n "used_for": "Domestic Usage",\n "manufacturer": "Energy One",\n "calibration_date": "2022-10-10",\n "contract": {\n "$relation": [\n {\n "entity_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_slug": "contact"\n }\n ]\n },\n "customer": {\n "$relation": [\n {\n "entity_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_slug": "contact"\n }\n ]\n }\n }\n}\n```\n\n</details>\n\n---\n\n### `getMeter`\n\nRetrieves the full details of a specific meter by ID, including related entities and available journey actions.\n\n`GET /v1/metering/meter/{id}`\n\n```ts\nconst { data } = await client.getMeter({\n id: \'123e4567-e89b-12d3-a456-426614174000\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": {\n "entity": {\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_title": "Example Entity",\n "_org": "123",\n "_tags": ["example", "mock"],\n "_created_at": "2021-02-09T12:41:43.662Z",\n "_updated_at": "2021-02-09T12:41:43.662Z",\n "_schema": "meter",\n "ma_lo_id": "A09-123",\n "status": "active",\n "meter_type": "three-phase-meter",\n "tariff_type": "Peak load tariff",\n "meter_number": "J-1093-1AK",\n "sector": "power",\n "location": [\n {\n "country": "Germany",\n "city": "Koln",\n "postal_code": 81475,\n "street": "Melateng\xFCrtel",\n "street_number": 71,\n "additional_info": "5. Etage",\n "_tags": ["billing", "delivery"]\n }\n ],\n "used_for": "Domestic Usage",\n "manufacturer": "Energy One",\n "calibration_date": "2022-10-10",\n "contract": {\n "$relation": [\n {\n "entity_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_slug": "contact"\n }\n ]\n },\n "customer": {\n "$relation": [\n {\n "entity_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_slug": "contact"\n }\n ]\n }\n },\n "journey_actions": {\n "journey_id": "string",\n "action_label": {\n "en": "string",\n "de": "string"\n },\n "slug": "string",\n "rules": [\n {\n "entity": "string",\n "attribute": "string",\n "attribute_value": "string"\n }\n ]\n },\n "relations": [\n {\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_title": "Example Entity",\n "_org": "123",\n "_tags": ["example", "mock"],\n "_created_at": "2021-02-09T12:41:43.662Z",\n "_updated_at": "2021-02-09T12:41:43.662Z"\n }\n ]\n }\n}\n```\n\n</details>\n\n---\n\n### `getMeterCounters`\n\nRetrieves all meter counters associated with a given meter.\n\n`GET /v1/metering/counter`\n\n```ts\nconst { data } = await client.getMeterCounters({\n meter_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": [\n {\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_title": "Example Entity",\n "_org": "123",\n "_tags": ["example", "mock"],\n "_created_at": "2021-02-09T12:41:43.662Z",\n "_updated_at": "2021-02-09T12:41:43.662Z",\n "_schema": "meter_counter",\n "obis_number": "A-34",\n "direction": "feed-in",\n "transformer_ratio": 70,\n "unit": "string",\n "forecast_reading_value": 270,\n "forecast_as_of": "2022-12-10",\n "current_consumption": 240,\n "last_reading": "2022-10-10",\n "conversion_factor": 3,\n "tariff_type": "ht"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `getCounterDetails`\n\nRetrieves the full details of a single meter counter by its ID.\n\n`GET /v1/metering/counter/{counter_id}`\n\n```ts\nconst { data } = await client.getCounterDetails({\n counter_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": {\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_title": "Example Entity",\n "_org": "123",\n "_tags": ["example", "mock"],\n "_created_at": "2021-02-09T12:41:43.662Z",\n "_updated_at": "2021-02-09T12:41:43.662Z",\n "_schema": "meter_counter",\n "obis_number": "A-34",\n "direction": "feed-in",\n "transformer_ratio": 70,\n "unit": "string",\n "forecast_reading_value": 270,\n "forecast_as_of": "2022-12-10",\n "current_consumption": 240,\n "last_reading": "2022-10-10",\n "conversion_factor": 3,\n "tariff_type": "ht"\n }\n}\n```\n\n</details>\n\n---\n\n### `createMeterReading`\n\nInserts a new meter reading.\n\n`POST /v1/metering/reading`\n\n```ts\nconst { data } = await client.createMeterReading(\n {\n direct: true,\n },\n {\n value: 240,\n read_by: \'John Doe\',\n reason: \'\',\n meter_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n counter_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n direction: \'feed-in\',\n timestamp: \'2022-10-10\',\n source: \'ECP\',\n status: \'valid\',\n external_id: \'string\',\n remark: \'Customer reported unusual consumption\',\n metadata: {\n registration_id: \'1234567890\',\n business_unit: \'ABC\'\n },\n note: \'string\',\n unit: \'string\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": {\n "value": 240,\n "read_by": "John Doe",\n "reason": "",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "direction": "feed-in",\n "timestamp": "2022-10-10",\n "source": "ECP",\n "status": "valid",\n "external_id": "string",\n "remark": "Customer reported unusual consumption",\n "metadata": {\n "registration_id": "1234567890",\n "business_unit": "ABC"\n },\n "note": "string",\n "unit": "string"\n }\n}\n```\n\n</details>\n\n---\n\n### `createMeterReadings`\n\nInserts multiple meter readings at once. Limited to 100 readings per request.\n\n`POST /v1/metering/readings`\n\n```ts\nconst { data } = await client.createMeterReadings(\n {\n async: true,\n activity_id: \'example\',\n skip_validation: true,\n direct: true,\n create_ticket: true,\n },\n {\n readings: [\n {\n value: 240,\n read_by: \'John Doe\',\n reason: \'\',\n meter_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n counter_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n direction: \'feed-in\',\n timestamp: \'2022-10-10\',\n source: \'ECP\',\n status: \'valid\',\n external_id: \'string\',\n remark: \'Customer reported unusual consumption\',\n metadata: {\n registration_id: \'1234567890\',\n business_unit: \'ABC\'\n },\n note: \'string\',\n unit: \'string\'\n }\n ]\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": [\n {\n "value": 240,\n "read_by": "John Doe",\n "reason": "",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "direction": "feed-in",\n "timestamp": "2022-10-10",\n "source": "ECP",\n "status": "valid",\n "external_id": "string",\n "remark": "Customer reported unusual consumption",\n "metadata": {\n "registration_id": "1234567890",\n "business_unit": "ABC"\n },\n "note": "string",\n "unit": "string"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `createPortalMeterReadings`\n\nInserts multiple meter readings at once for a given meter via the end customer portal.\nLimited to 100 readings per request.\n\n`POST /v1/metering/readings/{meter_id}`\n\n```ts\nconst { data } = await client.createPortalMeterReadings(\n {\n meter_id: \'example\',\n direct: true,\n },\n {\n readings: [\n {\n value: 240,\n read_by: \'John Doe\',\n reason: \'\',\n meter_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n counter_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n direction: \'feed-in\',\n timestamp: \'2022-10-10\',\n source: \'ECP\',\n status: \'valid\',\n external_id: \'string\',\n remark: \'Customer reported unusual consumption\',\n metadata: {\n registration_id: \'1234567890\',\n business_unit: \'ABC\'\n },\n note: \'string\',\n unit: \'string\'\n }\n ]\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": [\n {\n "value": 240,\n "read_by": "John Doe",\n "reason": "",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "direction": "feed-in",\n "timestamp": "2022-10-10",\n "source": "ECP",\n "status": "valid",\n "external_id": "string",\n "remark": "Customer reported unusual consumption",\n "metadata": {\n "registration_id": "1234567890",\n "business_unit": "ABC"\n },\n "note": "string",\n "unit": "string"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `batchWriteMeterReadings`\n\nUpserts or deletes multiple meter readings at once. Limited to 100 readings per request.\n\n`POST /v2/metering/readings`\n\n```ts\nconst { data } = await client.batchWriteMeterReadings(\n {\n async: true,\n skip_validation: true,\n activity_id: \'example\',\n direct: true,\n create_ticket: true,\n },\n {\n identifiers: [\'string\'],\n readings: [\n {\n meter_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n counter_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n direction: \'feed-in\',\n timestamp: \'2022-10-10T10:00:00Z\',\n external_id: \'string\',\n metadata: {\n registration_id: \'1234567890\',\n business_unit: \'ABC\'\n },\n operation: \'create\',\n value: 240,\n source: \'ECP\',\n read_by: \'John Doe\',\n reason: \'\',\n status: \'valid\',\n remark: \'Customer reported unusual consumption\',\n note: \'string\',\n unit: \'string\'\n }\n ]\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": [\n {\n "value": 240,\n "read_by": "John Doe",\n "reason": "",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "direction": "feed-in",\n "timestamp": "2022-10-10",\n "source": "ECP",\n "status": "valid",\n "external_id": "string",\n "remark": "Customer reported unusual consumption",\n "metadata": {\n "registration_id": "1234567890",\n "business_unit": "ABC"\n },\n "note": "string",\n "unit": "string"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `createMeterReadingFromSubmission`\n\nCreates meter readings from a journey submission payload.\n\n`POST /v1/metering/reading/submission`\n\n```ts\nconst { data } = await client.createMeterReadingFromSubmission(\n null,\n {\n org_id: \'123\',\n entity: {\n _org: \'123\',\n meterReadings: [\n {\n meterId: \'string\',\n readings: [\n {\n counterId: \'string\',\n direction: \'feed-in\',\n unit: \'string\',\n value: 240\n }\n ],\n readingValue: 240,\n readingDate: \'2022-10-10T10:10:00.000Z\',\n readBy: \'John Doe\',\n reason: \'\',\n maloId: \'A09-123\',\n obisNumber: \'A-34\',\n readingUnit: \'string\',\n meterType: \'one_tariff\',\n feedInValue: 240,\n feedOutValue: 240,\n htValue: 240,\n ntValue: 240\n }\n ]\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "message": "Successfully Processed"\n}\n```\n\n</details>\n\n---\n\n### `getAllowedReadingForMeter`\n\nReturns the allowed min/max reading range for each counter of the given meter.\n\n`GET /v1/metering/allowed/reading/{meter_id}`\n\n```ts\nconst { data } = await client.getAllowedReadingForMeter({\n meter_id: \'example\',\n timestamp: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": [\n {\n "counter_id": "string",\n "min_value": 0,\n "max_value": 0\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `createReadingWithMeter`\n\nCreates a meter reading along with meter lookup or creation by MA-LO ID and OBIS number.\n\n`POST /v1/metering/reading/with-meter`\n\n```ts\nconst { data } = await client.createReadingWithMeter(\n null,\n {\n ma_lo_id: \'A09-123\',\n meter_id: \'string\',\n obis_number: \'A-34\',\n unit: \'string\',\n direction: \'feed-in\',\n tariff_type: \'ht\',\n value: 240,\n read_by: \'John Doe\',\n reason: \'\',\n timestamp: \'2022-10-10T10:10:00.000Z\',\n source: \'ECP\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": {\n "value": 240,\n "read_by": "John Doe",\n "reason": "",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "direction": "feed-in",\n "timestamp": "2022-10-10",\n "source": "ECP",\n "status": "valid",\n "external_id": "string",\n "remark": "Customer reported unusual consumption",\n "metadata": {\n "registration_id": "1234567890",\n "business_unit": "ABC"\n },\n "note": "string",\n "unit": "string"\n }\n}\n```\n\n</details>\n\n---\n\n### `getReadingsByInterval`\n\nRetrieves all readings specified in an interval.\nIf the start_date and end_date are equal, then it returns the readings of the specified date.\nThe start_date should be less than or equal to the end_da\n\n`GET /v1/metering/reading/{meter_id}/{counter_id}`\n\n```ts\nconst { data } = await client.getReadingsByInterval({\n meter_id: \'example\',\n counter_id: \'example\',\n start_date: \'example\',\n end_date: \'example\',\n direction: \'example\',\n size: 1,\n from: 1,\n type: \'example\',\n sort: \'example\',\n include_pending_changesets: true,\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "value": 240,\n "read_by": "John Doe",\n "reason": "",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "direction": "feed-in",\n "timestamp": "2022-10-10",\n "source": "ECP",\n "status": "valid",\n "external_id": "string",\n "remark": "Customer reported unusual consumption",\n "metadata": {\n "registration_id": "1234567890",\n "business_unit": "ABC"\n },\n "note": "string",\n "unit": "string"\n }\n ],\n "hits": 120,\n "firstRecordCreatedAt": "2022-10-01T20:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `updateMeterReading`\n\nUpdates an existing meter reading identified by meter ID, counter ID, and timestamp.\n\n`PUT /v1/metering/reading/{meter_id}/{counter_id}`\n\n```ts\nconst { data } = await client.updateMeterReading(\n {\n meter_id: \'example\',\n counter_id: \'example\',\n timestamp: \'example\',\n },\n {\n value: 240,\n read_by: \'John Doe\',\n reason: \'string\',\n meter_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n counter_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n direction: \'feed-in\',\n timestamp: \'2022-10-10\',\n source: \'ECP\',\n status: \'valid\',\n external_id: \'string\',\n remark: \'Customer reported unusual consumption\',\n metadata: {\n registration_id: \'1234567890\',\n business_unit: \'ABC\'\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": {\n "value": 240,\n "read_by": "John Doe",\n "reason": "",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "direction": "feed-in",\n "timestamp": "2022-10-10",\n "source": "ECP",\n "status": "valid",\n "external_id": "string",\n "remark": "Customer reported unusual consumption",\n "metadata": {\n "registration_id": "1234567890",\n "business_unit": "ABC"\n },\n "note": "string",\n "unit": "string"\n }\n}\n```\n\n</details>\n\n---\n\n### `deleteMeterReading`\n\nPermanently deletes a meter reading identified by meter ID, counter ID, and timestamp.\n\n`DELETE /v1/metering/reading/{meter_id}/{counter_id}`\n\n```ts\nconst { data } = await client.deleteMeterReading({\n meter_id: \'example\',\n counter_id: \'example\',\n timestamp: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": {\n "meterId": "string",\n "counterId": "string",\n "timestamp": "2022-10-01T20:00:00.000Z"\n }\n}\n```\n\n</details>\n\n---\n\n### `getReadingChangesets`\n\nList pending reading changesets for a counter\n\n`GET /v1/metering/reading/{meter_id}/{counter_id}/changesets`\n\n```ts\nconst { data } = await client.getReadingChangesets({\n meter_id: \'example\',\n counter_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "changesets": [\n {\n "changeset_id": "string",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "proposed": {\n "value": 0,\n "direction": "feed-in",\n "timestamp": "1970-01-01T00:00:00.000Z",\n "reason": "string",\n "remark": "string",\n "read_by": "string",\n "status": "valid",\n "external_id": "string"\n },\n "previous": {\n "value": 0,\n "direction": "feed-in",\n "timestamp": "1970-01-01T00:00:00.000Z",\n "reason": "string",\n "remark": "string",\n "read_by": "string",\n "status": "valid",\n "external_id": "string"\n },\n "edit_mode": "external",\n "match_strategy": "exact",\n "timestamp_tolerance": "exact",\n "created_at": "1970-01-01T00:00:00.000Z",\n "created_by": {\n "type": "user",\n "id": "string"\n },\n "source": "360",\n "fuzzy_config": {\n "percentage_threshold": 0.01,\n "absolute_threshold": 0\n },\n "dismissed_reason": "string",\n "dismissed_at": "1970-01-01T00:00:00.000Z"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `applyReadingChangeset`\n\nApply (approve) a pending reading changeset\n\n`POST /v1/metering/reading/{meter_id}/{counter_id}/changesets/{changeset_id}:apply`\n\n```ts\nconst { data } = await client.applyReadingChangeset({\n meter_id: \'example\',\n counter_id: \'example\',\n changeset_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "reading": {\n "value": 240,\n "read_by": "John Doe",\n "reason": "",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "direction": "feed-in",\n "timestamp": "2022-10-10",\n "source": "ECP",\n "status": "valid",\n "external_id": "string",\n "remark": "Customer reported unusual consumption",\n "metadata": {\n "registration_id": "1234567890",\n "business_unit": "ABC"\n },\n "note": "string",\n "unit": "string"\n },\n "changeset": {\n "changeset_id": "string",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "proposed": {\n "value": 0,\n "direction": "feed-in",\n "timestamp": "1970-01-01T00:00:00.000Z",\n "reason": "string",\n "remark": "string",\n "read_by": "string",\n "status": "valid",\n "external_id": "string"\n },\n "previous": {\n "value": 0,\n "direction": "feed-in",\n "timestamp": "1970-01-01T00:00:00.000Z",\n "reason": "string",\n "remark": "string",\n "read_by": "string",\n "status": "valid",\n "external_id": "string"\n },\n "edit_mode": "external",\n "match_strategy": "exact",\n "timestamp_tolerance": "exact",\n "created_at": "1970-01-01T00:00:00.000Z",\n "created_by": {\n "type": "user",\n "id": "string"\n },\n "source": "360",\n "fuzzy_config": {\n "percentage_threshold": 0.01,\n "absolute_threshold": 0\n },\n "dismissed_reason": "string",\n "dismissed_at": "1970-01-01T00:00:00.000Z"\n }\n}\n```\n\n</details>\n\n---\n\n### `dismissReadingChangeset`\n\nDismiss (reject) a pending reading changeset\n\n`POST /v1/metering/reading/{meter_id}/{counter_id}/changesets/{changeset_id}:dismiss`\n\n```ts\nconst { data } = await client.dismissReadingChangeset(\n {\n meter_id: \'example\',\n counter_id: \'example\',\n changeset_id: \'example\',\n },\n {\n reason: \'string\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "changeset_id": "string",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "proposed": {\n "value": 0,\n "direction": "feed-in",\n "timestamp": "1970-01-01T00:00:00.000Z",\n "reason": "string",\n "remark": "string",\n "read_by": "string",\n "status": "valid",\n "external_id": "string"\n },\n "previous": {\n "value": 0,\n "direction": "feed-in",\n "timestamp": "1970-01-01T00:00:00.000Z",\n "reason": "string",\n "remark": "string",\n "read_by": "string",\n "status": "valid",\n "external_id": "string"\n },\n "edit_mode": "external",\n "match_strategy": "exact",\n "timestamp_tolerance": "exact",\n "created_at": "1970-01-01T00:00:00.000Z",\n "created_by": {\n "type": "user",\n "id": "string"\n },\n "source": "360",\n "fuzzy_config": {\n "percentage_threshold": 0.01,\n "absolute_threshold": 0\n },\n "dismissed_reason": "string",\n "dismissed_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `updateReadingChangeset`\n\nEdit a pending reading changeset\n\n`PATCH /v1/metering/reading/{meter_id}/{counter_id}/changesets/{changeset_id}`\n\n```ts\nconst { data } = await client.updateReadingChangeset(\n {\n meter_id: \'example\',\n counter_id: \'example\',\n changeset_id: \'example\',\n },\n {\n proposed: {\n value: 0,\n direction: \'feed-in\',\n timestamp: \'1970-01-01T00:00:00.000Z\',\n reason: \'string\',\n remark: \'string\',\n read_by: \'string\',\n status: \'valid\',\n external_id: \'string\'\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "changeset_id": "string",\n "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "counter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "proposed": {\n "value": 0,\n "direction": "feed-in",\n "timestamp": "1970-01-01T00:00:00.000Z",\n "reason": "string",\n "remark": "string",\n "read_by": "string",\n "status": "valid",\n "external_id": "string"\n },\n "previous": {\n "value": 0,\n "direction": "feed-in",\n "timestamp": "1970-01-01T00:00:00.000Z",\n "reason": "string",\n "remark": "string",\n "read_by": "string",\n "status": "valid",\n "external_id": "string"\n },\n "edit_mode": "external",\n "match_strategy": "exact",\n "timestamp_tolerance": "exact",\n "created_at": "1970-01-01T00:00:00.000Z",\n "created_by": {\n "type": "user",\n "id": "string"\n },\n "source": "360",\n "fuzzy_config": {\n "percentage_threshold": 0.01,\n "absolute_threshold": 0\n },\n "dismissed_reason": "string",\n "dismissed_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `ErrorResp`\n\n```ts\ntype ErrorResp = {\n message?: string\n}\n```\n\n### `EntityId`\n\n```ts\ntype EntityId = string // uuid\n```\n\n### `EntitySlug`\n\nURL-friendly identifier for the entity schema\n\n```ts\ntype EntitySlug = string\n```\n\n### `BaseEntity`\n\n```ts\ntype BaseEntity = {\n _id: string // uuid\n _title: string\n _org: string\n _tags?: string[]\n _created_at: string // date-time\n _updated_at: string // date-time\n}\n```\n\n### `Entity`\n\n```ts\ntype Entity = Record<string, unknown>\n```\n\n### `EntityItem`\n\n```ts\ntype EntityItem = {\n _id: string // uuid\n _title: string\n _org: string\n _tags?: string[]\n _created_at: string // date-time\n _updated_at: string // date-time\n}\n```\n\n### `Id`\n\n```ts\ntype Id = string\n```\n\n### `EntityRelation`\n\n```ts\ntype EntityRelation = {\n entity_id?: string // uuid\n _slug?: "contact" | "contract"\n}\n```\n\n### `Meter`\n\n```ts\ntype Meter = {\n _id: string // uuid\n _title: string\n _org: string\n _tags?: string[]\n _created_at: string // date-time\n _updated_at: string // date-time\n _schema: "meter"\n ma_lo_id?: string\n status?: "active" | "decommissioned"\n meter_type?: "three-phase-meter" | "bellow-gas-meter" | "rotary-piston-meter" | "smart-meter" | "performance-meter" | "maximum-meter" | "turbine-gas-meter" | "ultrasonic-gas-meter" | "alternating-current-meter" | "modern-metering-system" | "intelligent-measuring-system" | "electronic-meter"\n tariff_type?: string\n meter_number?: string\n sector?: "power" | "water" | "gas" | "district_heating" | "waste_water"\n location?: object\n used_for?: string\n manufacturer?: string\n calibration_date?: string\n contract?: {\n $relation?: Array<{\n entity_id?: { ... }\n _slug?: { ... }\n }>\n }\n customer?: {\n $relation?: Array<{\n entity_id?: { ... }\n _slug?: { ... }\n }>\n }\n}\n```\n\n### `Direction`\n\n```ts\ntype Direction = "feed-in" | "feed-out"\n```\n\n### `TariffType`\n\n```ts\ntype TariffType = "ht" | "nt"\n```\n\n### `Reason`\n\nThe reason for recording the reading\nIf no reason is specified or left empty, the Epilot UI will show \'Regular\' as the default display text\n\n\n```ts\ntype Reason = "" | "regular" | "irregular" | "last" | "first" | "meter_change" | "contract_change" | "meter_adjustment"\n```\n\n### `ReasonString`\n\nThis field is deprecated. Please use the Reason enum instead.\n\n\n```ts\ntype ReasonString = string\n```\n\n### `ReadBy`\n\nThe person who recorded the reading\n\n```ts\ntype ReadBy = string\n```\n\n### `ReadingStatus`\n\n```ts\ntype ReadingStatus = "valid" | "in-validation" | "implausible" | null | ""\n```\n\n### `Reading`\n\n```ts\ntype Reading = {\n value: number\n read_by?: string\n reason?: "" | "regular" | "irregular" | "last" | "first" | "meter_change" | "contract_change" | "meter_adjustment"\n meter_id?: string // uuid\n counter_id?: string // uuid\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n source: "ECP" | "ERP" | "360" | "journey-submission"\n status?: "valid" | "in-validation" | "implausible" | null | ""\n external_id?: string\n remark?: string\n metadata?: Record<string, string>\n note?: string\n unit?: string\n}\n```\n\n### `MeterReading`\n\n```ts\ntype MeterReading = {\n value: number\n read_by?: string\n reason?: "" | "regular" | "irregular" | "last" | "first" | "meter_change" | "contract_change" | "meter_adjustment"\n meter_id: string // uuid\n counter_id?: string // uuid\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n source: "ECP" | "ERP" | "360" | "journey-submission"\n status?: "valid" | "in-validation" | "implausible" | null | ""\n external_id?: string\n remark?: string\n metadata?: Record<string, string>\n note?: string\n unit?: string\n}\n```\n\n### `PortalMeterReading`\n\n```ts\ntype PortalMeterReading = {\n value: number\n read_by?: string\n reason?: "" | "regular" | "irregular" | "last" | "first" | "meter_change" | "contract_change" | "meter_adjustment"\n meter_id?: string // uuid\n counter_id: string // uuid\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n source: "ECP" | "ERP" | "360" | "journey-submission"\n status?: "valid" | "in-validation" | "implausible" | null | ""\n external_id?: string\n remark?: string\n metadata?: Record<string, string>\n note?: string\n unit?: string\n}\n```\n\n### `BatchReadingBase`\n\nBase properties shared by all batch reading operations\n\n```ts\ntype BatchReadingBase = {\n meter_id?: string // uuid\n counter_id?: string // uuid\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n external_id?: string\n metadata?: Record<string, string>\n}\n```\n\n### `CreateOrUpdateBatchReading`\n\nSchema for create or update operations - requires value, source, and meter_id\n\n```ts\ntype CreateOrUpdateBatchReading = {\n meter_id: string // uuid\n counter_id?: string // uuid\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n external_id?: string\n metadata?: Record<string, string>\n operation?: "create" | "update"\n value: number\n source: "ECP" | "ERP" | "360" | "journey-submission"\n read_by?: string\n reason?: "" | "regular" | "irregular" | "last" | "first" | "meter_change" | "contract_change" | "meter_adjustment"\n status?: "valid" | "in-validation" | "implausible" | null | ""\n remark?: string\n note?: string\n unit?: string\n}\n```\n\n### `DeleteBatchReading`\n\nSchema for delete operations - only requires identifier fields specified in the identifiers parameter\n\n```ts\ntype DeleteBatchReading = {\n meter_id?: string // uuid\n counter_id?: string // uuid\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n external_id?: string\n metadata?: Record<string, string>\n operation: "delete"\n}\n```\n\n### `BatchReading`\n\nA meter reading for batch operations. The required fields depend on the operation:\n- create/update: requires value, source, and meter_id\n- delete: only requires the fields specified in the identifiers parameter\n\n\n```ts\ntype BatchReading = {\n meter_id: string // uuid\n counter_id?: string // uuid\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n external_id?: string\n metadata?: Record<string, string>\n operation?: "create" | "update"\n value: number\n source: "ECP" | "ERP" | "360" | "journey-submission"\n read_by?: string\n reason?: "" | "regular" | "irregular" | "last" | "first" | "meter_change" | "contract_change" | "meter_adjustment"\n status?: "valid" | "in-validation" | "implausible" | null | ""\n remark?: string\n note?: string\n unit?: string\n} | {\n meter_id?: string // uuid\n counter_id?: string // uuid\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n external_id?: string\n metadata?: Record<string, string>\n operation: "delete"\n}\n```\n\n### `UpdateMeterReading`\n\n```ts\ntype UpdateMeterReading = {\n value: number\n read_by?: string\n reason?: string\n meter_id: string // uuid\n counter_id?: string // uuid\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n source: "ECP" | "ERP" | "360" | "journey-submission"\n status?: "valid" | "in-validation" | "implausible" | null | ""\n external_id?: string\n remark?: string\n metadata?: Record<string, string>\n}\n```\n\n### `MeterCounter`\n\n```ts\ntype MeterCounter = {\n _id: string // uuid\n _title: string\n _org: string\n _tags?: string[]\n _created_at: string // date-time\n _updated_at: string // date-time\n _schema: "meter_counter"\n obis_number?: string\n direction?: "feed-in" | "feed-out"\n transformer_ratio?: number\n unit?: string\n forecast_reading_value?: string\n forecast_as_of?: string\n current_consumption?: number\n last_reading?: string\n conversion_factor?: number\n tariff_type?: "ht" | "nt"\n}\n```\n\n### `CounterReadingOnSubmission`\n\n```ts\ntype CounterReadingOnSubmission = {\n counterId: string\n direction: "feed-in" | "feed-out"\n unit?: string\n value: number\n}\n```\n\n### `SubmissionMeterReading`\n\n```ts\ntype SubmissionMeterReading = {\n meterId: string\n readings?: Array<{\n counterId: string\n direction: "feed-in" | "feed-out"\n unit?: string\n value: number\n }>\n readingValue?: number\n readingDate?: string\n readBy?: string\n reason?: "" | "regular" | "irregular" | "last" | "first" | "meter_change" | "contract_change" | "meter_adjustment"\n maloId?: string\n obisNumber?: string\n readingUnit?: string\n meterType?: "one_tariff" | "two_tariff" | "bi_directional"\n feedInValue?: number\n feedOutValue?: number\n htValue?: number\n ntValue?: number\n}\n```\n\n### `Unit`\n\n```ts\ntype Unit = string\n```\n\n### `Source`\n\n```ts\ntype Source = "ECP" | "ERP" | "360" | "journey-submission"\n```\n\n### `ActionLabel`\n\n```ts\ntype ActionLabel = {\n en?: string\n de?: string\n}\n```\n\n### `Rule`\n\n```ts\ntype Rule = {\n entity?: string\n attribute?: string\n attribute_value?: string\n}\n```\n\n### `JourneyActions`\n\n```ts\ntype JourneyActions = {\n journey_id?: string\n action_label?: {\n en?: string\n de?: string\n }\n slug?: string\n rules?: Array<{\n entity?: string\n attribute?: string\n attribute_value?: string\n }>\n}\n```\n\n### `ReadingWithMeter`\n\n```ts\ntype ReadingWithMeter = {\n ma_lo_id?: string\n meter_id?: string\n obis_number?: string\n unit?: string\n direction?: "feed-in" | "feed-out"\n tariff_type?: "ht" | "nt"\n value?: number\n read_by?: string\n reason?: "" | "regular" | "irregular" | "last" | "first" | "meter_change" | "contract_change" | "meter_adjustment"\n timestamp?: string\n source?: "ECP" | "ERP" | "360" | "journey-submission"\n}\n```\n\n### `MeterReadingChangeset`\n\n```ts\ntype MeterReadingChangeset = {\n changeset_id: string\n meter_id?: string // uuid\n counter_id?: string // uuid\n proposed: {\n value: number\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n reason?: string\n remark?: string\n read_by?: string\n status?: "valid" | "in-validation" | "implausible"\n external_id?: string\n }\n previous?: {\n value: number\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n reason?: string\n remark?: string\n read_by?: string\n status?: "valid" | "in-validation" | "implausible"\n external_id?: string\n }\n edit_mode: "external" | "approval"\n match_strategy?: "exact" | "fuzzy"\n timestamp_tolerance?: "exact" | {\n type: "same-day"\n timezone?: string\n } | {\n type: "within-seconds"\n seconds: number\n }\n created_at: string // date-time\n created_by?: {\n type?: "user" | "portal_user" | "api_client" | "automation"\n id?: string\n }\n source?: "360" | "ECP" | "ERP" | "journey-submission"\n fuzzy_config?: {\n percentage_threshold?: number\n absolute_threshold?: number\n }\n dismissed_reason?: string\n dismissed_at?: string // date-time\n}\n```\n\n### `FuzzyConfig`\n\nNumeric-threshold fuzzy matching for meter reading auto-clear.\n\nNOTE: This is intentionally different from entity-api\'s FuzzyConfig. Entity-api\'s\nfuzzy strategies (suffix, digits_only, normalize_phone, ignore_fields,\ncontains_entry, regex) are designed for strings and structured objects (IBAN, phone\n\n```ts\ntype FuzzyConfig = {\n percentage_threshold?: number\n absolute_threshold?: number\n}\n```\n\n### `ProposedReading`\n\n```ts\ntype ProposedReading = {\n value: number\n direction?: "feed-in" | "feed-out"\n timestamp?: string // date-time\n reason?: string\n remark?: string\n read_by?: string\n status?: "valid" | "in-validation" | "implausible"\n external_id?: string\n}\n```\n\n### `ChangesetCreator`\n\n```ts\ntype ChangesetCreator = {\n type?: "user" | "portal_user" | "api_client" | "automation"\n id?: string\n}\n```\n\n### `TimestampTolerance`\n\nSlack on `reading.timestamp` when auto-clear matches an incoming reading\nagainst a pending changeset. Both sides reference the SAME physical\nmeter-read event \u2014 one as stored when the user submitted, the other as\nechoed back by the ERP. The tolerance accommodates round-trip format\ndrift between the t\n\n```ts\ntype TimestampTolerance = "exact" | {\n type: "same-day"\n timezone?: string\n} | {\n type: "within-seconds"\n seconds: number\n}\n```\n\n### `ActivityId`\n\nSee https://github.com/ulid/spec\n\n```ts\ntype ActivityId = string // ulid\n```\n';
5
+
6
+
7
+ exports.default = metering_default;
@@ -1,5 +1,5 @@
1
1
  import {
2
2
  require_metering_runtime
3
- } from "./chunk-56MMZJOD.js";
3
+ } from "./chunk-K2F255B3.js";
4
4
  import "./chunk-YPSWSI3M.js";
5
5
  export default require_metering_runtime();
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkT6A22LSDcjs = require('./chunk-T6A22LSD.cjs');
3
+ var _chunk2KZBLHTScjs = require('./chunk-2KZBLHTS.cjs');
4
4
  require('./chunk-NJK5F5TF.cjs');
5
- exports. default = _chunkT6A22LSDcjs.require_metering_runtime.call(void 0, );
5
+ exports. default = _chunk2KZBLHTScjs.require_metering_runtime.call(void 0, );
@@ -12,6 +12,7 @@ declare namespace Components {
12
12
  */
13
13
  Schemas.ActivityId /* ulid */;
14
14
  export type CounterIdParam = Schemas.Id;
15
+ export type CreateTicketQueryParam = boolean;
15
16
  export type DirectQueryParam = boolean;
16
17
  export type IncludePendingChangesetsQueryParam = boolean;
17
18
  export type MeterIdParam = Schemas.Id;
@@ -25,6 +26,7 @@ declare namespace Components {
25
26
  DirectQueryParam?: Parameters.DirectQueryParam;
26
27
  IncludePendingChangesetsQueryParam?: Parameters.IncludePendingChangesetsQueryParam;
27
28
  ActivityIdQueryParam?: Parameters.ActivityIdQueryParam;
29
+ CreateTicketQueryParam?: Parameters.CreateTicketQueryParam;
28
30
  SkipValidationQueryParam?: Parameters.SkipValidationQueryParam;
29
31
  }
30
32
  namespace Responses {
@@ -1187,6 +1189,7 @@ declare namespace Paths {
1187
1189
  */
1188
1190
  Components.Schemas.ActivityId /* ulid */;
1189
1191
  export type Async = boolean;
1192
+ export type CreateTicket = boolean;
1190
1193
  export type Direct = boolean;
1191
1194
  export type SkipValidation = boolean;
1192
1195
  }
@@ -1195,6 +1198,7 @@ declare namespace Paths {
1195
1198
  skip_validation?: Parameters.SkipValidation;
1196
1199
  activity_id?: Parameters.ActivityId;
1197
1200
  direct?: Parameters.Direct;
1201
+ create_ticket?: Parameters.CreateTicket;
1198
1202
  }
1199
1203
  export interface RequestBody {
1200
1204
  /**
@@ -1281,6 +1285,7 @@ declare namespace Paths {
1281
1285
  */
1282
1286
  Components.Schemas.ActivityId /* ulid */;
1283
1287
  export type Async = boolean;
1288
+ export type CreateTicket = boolean;
1284
1289
  export type Direct = boolean;
1285
1290
  export type SkipValidation = boolean;
1286
1291
  }
@@ -1289,6 +1294,7 @@ declare namespace Paths {
1289
1294
  activity_id?: Parameters.ActivityId;
1290
1295
  skip_validation?: Parameters.SkipValidation;
1291
1296
  direct?: Parameters.Direct;
1297
+ create_ticket?: Parameters.CreateTicket;
1292
1298
  }
1293
1299
  export interface RequestBody {
1294
1300
  readings?: Components.Schemas.MeterReading[];
@@ -12,6 +12,7 @@ declare namespace Components {
12
12
  */
13
13
  Schemas.ActivityId /* ulid */;
14
14
  export type CounterIdParam = Schemas.Id;
15
+ export type CreateTicketQueryParam = boolean;
15
16
  export type DirectQueryParam = boolean;
16
17
  export type IncludePendingChangesetsQueryParam = boolean;
17
18
  export type MeterIdParam = Schemas.Id;
@@ -25,6 +26,7 @@ declare namespace Components {
25
26
  DirectQueryParam?: Parameters.DirectQueryParam;
26
27
  IncludePendingChangesetsQueryParam?: Parameters.IncludePendingChangesetsQueryParam;
27
28
  ActivityIdQueryParam?: Parameters.ActivityIdQueryParam;
29
+ CreateTicketQueryParam?: Parameters.CreateTicketQueryParam;
28
30
  SkipValidationQueryParam?: Parameters.SkipValidationQueryParam;
29
31
  }
30
32
  namespace Responses {
@@ -1187,6 +1189,7 @@ declare namespace Paths {
1187
1189
  */
1188
1190
  Components.Schemas.ActivityId /* ulid */;
1189
1191
  export type Async = boolean;
1192
+ export type CreateTicket = boolean;
1190
1193
  export type Direct = boolean;
1191
1194
  export type SkipValidation = boolean;
1192
1195
  }
@@ -1195,6 +1198,7 @@ declare namespace Paths {
1195
1198
  skip_validation?: Parameters.SkipValidation;
1196
1199
  activity_id?: Parameters.ActivityId;
1197
1200
  direct?: Parameters.Direct;
1201
+ create_ticket?: Parameters.CreateTicket;
1198
1202
  }
1199
1203
  export interface RequestBody {
1200
1204
  /**
@@ -1281,6 +1285,7 @@ declare namespace Paths {
1281
1285
  */
1282
1286
  Components.Schemas.ActivityId /* ulid */;
1283
1287
  export type Async = boolean;
1288
+ export type CreateTicket = boolean;
1284
1289
  export type Direct = boolean;
1285
1290
  export type SkipValidation = boolean;
1286
1291
  }
@@ -1289,6 +1294,7 @@ declare namespace Paths {
1289
1294
  activity_id?: Parameters.ActivityId;
1290
1295
  skip_validation?: Parameters.SkipValidation;
1291
1296
  direct?: Parameters.Direct;
1297
+ create_ticket?: Parameters.CreateTicket;
1292
1298
  }
1293
1299
  export interface RequestBody {
1294
1300
  readings?: Components.Schemas.MeterReading[];
@@ -0,0 +1,7 @@
1
+ import "./chunk-YPSWSI3M.js";
2
+
3
+ // src/docs/notification.json
4
+ var notification_default = '# Notification API\n\n- **Base URL:** `https://notification.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/notification](https://docs.epilot.io/api/notification)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.notification.getNotificationsV2(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/notification\'\n\nconst notificationClient = getClient()\nauthorize(notificationClient, () => \'<token>\')\nconst { data } = await notificationClient.getNotificationsV2(...)\n```\n\n## Operations\n\n**Notification**\n- [`getNotificationsV2`](#getnotificationsv2)\n- [`createNotification`](#createnotification)\n- [`getNotifications`](#getnotifications)\n- [`getNotification`](#getnotification)\n- [`markAllAsRead`](#markallasread)\n- [`markAsRead`](#markasread)\n- [`getTotalUnread`](#gettotalunread)\n\n**Template**\n- [`listNotificationTemplates`](#listnotificationtemplates)\n- [`createNotificationTemplate`](#createnotificationtemplate)\n- [`getNotificationTemplate`](#getnotificationtemplate)\n- [`updateNotificationTemplate`](#updatenotificationtemplate)\n- [`patchNotificationTemplate`](#patchnotificationtemplate)\n- [`deleteNotificationTemplate`](#deletenotificationtemplate)\n- [`sendPreview`](#sendpreview)\n\n**Schemas**\n- [`Error`](#error)\n- [`EntityOperation`](#entityoperation)\n- [`NotificationItem`](#notificationitem)\n- [`Notification`](#notification)\n- [`NotificationBase`](#notificationbase)\n- [`EntityId`](#entityid)\n- [`Entity`](#entity)\n- [`Id`](#id)\n- [`NotificationId`](#notificationid)\n- [`NotificationCallerContext`](#notificationcallercontext)\n- [`EntitySlug`](#entityslug)\n- [`EntityOwner`](#entityowner)\n- [`EntityAcl`](#entityacl)\n- [`NotificationTemplate`](#notificationtemplate)\n- [`CreateNotificationTemplateInput`](#createnotificationtemplateinput)\n- [`UpdateNotificationTemplateInput`](#updatenotificationtemplateinput)\n- [`NotificationTemplateListResponse`](#notificationtemplatelistresponse)\n- [`SendPreviewInput`](#sendpreviewinput)\n- [`SendPreviewResponse`](#sendpreviewresponse)\n\n### `getNotificationsV2`\n\nGet notifications items. These items may eventually contain entities within their payload, which can be hydrated by the client if desired by calling the Entity API directly.\n\n`GET /v2/notification/notifications`\n\n```ts\nconst { data } = await client.getNotificationsV2({\n cursor: \'example\',\n after_id: 1,\n limit: 1,\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "cursor": "eyJjcmVhd",\n "total": 1,\n "total_unread": 1,\n "results": [\n {\n "id": 123456789,\n "notification_id": 123456789,\n "timestamp": "1970-01-01T00:00:00.000Z",\n "read_state": false,\n "type": "workflow",\n "redirect_url": "https://epilot.cloud",\n "organization_id": "206801",\n "title": {\n "en": "My custom notification",\n "de": "Meine benutzerdefinierte Aktivit\xE4t"\n },\n "message": {\n "en": "{{caller}} did something with {{contact.entity.id}} {{branch.name}}.",\n "de": "{{caller}} habe etwas damit gemacht {{contact.entity.id}} {{branch.name}}."\n },\n "payload": {\n "entity": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "schema": "contact"\n }\n },\n "caller": {\n "EpilotAuth": {\n "token": {\n "sub": "476e9b48-42f4-4234-a2b0-4668b34626ce",\n "cognito:groups": ["Administrator"],\n "cognito:preferred_role": "arn:aws:iam::912468240823:role/base-administrator-role",\n "iss": "https://cognito-idp.eu-central-1.amazonaws.com/eu-central-1_6lZSgmU6D",\n "custom:ivy_org_id": "739224",\n "cognito:username": "n.ahmad@epilot.cloud",\n "custom:ivy_user_id": "10006129",\n "cognito:roles": ["arn:aws:iam::912468240823:role/base-administrator-role"],\n "aud": "6e0jbdnger7nmoktaaflarue1l",\n "event_id": "cd5f5583-d90c-4db5-8e99-5f5dd29a4d75",\n "token_use": "id",\n "auth_time": 1614333023,\n "exp": 1614336623,\n "iat": 1614333023,\n "email": "n.ahmad@epilot.cloud"\n }\n }\n },\n "operations": [\n {\n "entity": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "operation": "updateEntity",\n "params": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "slug": "contact"\n },\n "payload": {\n "_schema": "contact",\n "_org": "123",\n "status": "Inactive"\n }\n }\n ],\n "force_notify_users": {\n "12345": {\n "email": false,\n "in_app": false\n }\n },\n "allowed_channels": ["in_app"]\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `createNotification`\n\nCreate a message that can be displayed in the notification panel.\n\n`POST /v1/notification/notifications`\n\n```ts\nconst { data } = await client.createNotification(\n null,\n {\n notification_id: 0,\n timestamp: \'1970-01-01T00:00:00.000Z\',\n type: \'workflow\',\n redirect_url: \'https://epilot.cloud\',\n organization_id: \'206801\',\n title: {\n en: \'My custom notification\',\n de: \'Meine benutzerdefinierte Aktivit\xE4t\'\n },\n message: {\n en: \'{{caller}} did something with {{contact.entity.id}} {{branch.name}}.\',\n de: \'{{caller}} habe etwas damit gemacht {{contact.entity.id}} {{branch.name}}.\'\n },\n payload: {\n entity: {\n id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n schema: \'contact\'\n }\n },\n caller: {\n EpilotAuth: {\n token: {\n sub: \'476e9b48-42f4-4234-a2b0-4668b34626ce\',\n \'cognito:groups\': [\'Administrator\'],\n \'cognito:preferred_role\': \'arn:aws:iam::912468240823:role/base-administrator-role\',\n iss: \'https://cognito-idp.eu-central-1.amazonaws.com/eu-central-1_6lZSgmU6D\',\n \'custom:ivy_org_id\': \'739224\',\n \'cognito:username\': \'n.ahmad@epilot.cloud\',\n \'custom:ivy_user_id\': \'10006129\',\n \'cognito:roles\': [\'arn:aws:iam::912468240823:role/base-administrator-role\'],\n aud: \'6e0jbdnger7nmoktaaflarue1l\',\n event_id: \'cd5f5583-d90c-4db5-8e99-5f5dd29a4d75\',\n token_use: \'id\',\n auth_time: 1614333023,\n exp: 1614336623,\n iat: 1614333023,\n email: \'n.ahmad@epilot.cloud\'\n }\n }\n },\n operations: [\n {\n entity: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n operation: \'updateEntity\',\n params: {\n id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n slug: \'contact\'\n },\n payload: {\n _schema: \'contact\',\n _org: \'123\',\n status: \'Inactive\'\n }\n }\n ],\n force_notify_users: {\n \'12345\': {\n email: false,\n in_app: false\n }\n },\n allowed_channels: [\'in_app\'],\n read_state: false,\n visibility_user_ids: [\'1\', \'2\', \'3\', \'4\', \'5\']\n },\n)\n```\n\n---\n\n### `getNotifications`\n\nGet notifications\n\n`GET /v1/notification/notifications`\n\n```ts\nconst { data } = await client.getNotifications({\n after_id: 1,\n limit: 1,\n no_hydrate: true,\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "total": 1,\n "total_unread": 1,\n "results": [\n {\n "id": 123456789,\n "notification_id": 123456789,\n "timestamp": "1970-01-01T00:00:00.000Z",\n "read_state": false,\n "type": "workflow",\n "redirect_url": "https://epilot.cloud",\n "organization_id": "206801",\n "title": {\n "en": "My custom notification",\n "de": "Meine benutzerdefinierte Aktivit\xE4t"\n },\n "message": {\n "en": "{{caller}} did something with {{contact.entity.id}} {{branch.name}}.",\n "de": "{{caller}} habe etwas damit gemacht {{contact.entity.id}} {{branch.name}}."\n },\n "payload": {\n "entity": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "schema": "contact"\n }\n },\n "caller": {\n "EpilotAuth": {\n "token": {\n "sub": "476e9b48-42f4-4234-a2b0-4668b34626ce",\n "cognito:groups": ["Administrator"],\n "cognito:preferred_role": "arn:aws:iam::912468240823:role/base-administrator-role",\n "iss": "https://cognito-idp.eu-central-1.amazonaws.com/eu-central-1_6lZSgmU6D",\n "custom:ivy_org_id": "739224",\n "cognito:username": "n.ahmad@epilot.cloud",\n "custom:ivy_user_id": "10006129",\n "cognito:roles": ["arn:aws:iam::912468240823:role/base-administrator-role"],\n "aud": "6e0jbdnger7nmoktaaflarue1l",\n "event_id": "cd5f5583-d90c-4db5-8e99-5f5dd29a4d75",\n "token_use": "id",\n "auth_time": 1614333023,\n "exp": 1614336623,\n "iat": 1614333023,\n "email": "n.ahmad@epilot.cloud"\n }\n }\n },\n "operations": [\n {\n "entity": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "operation": "updateEntity",\n "params": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "slug": "contact"\n },\n "payload": {\n "_schema": "contact",\n "_org": "123",\n "status": "Inactive"\n }\n }\n ],\n "force_notify_users": {\n "12345": {\n "email": false,\n "in_app": false\n }\n },\n "allowed_channels": ["in_app"]\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `getNotification`\n\nGet the details of a single notification.\n\n`GET /v1/notification/notifications/{id}`\n\n```ts\nconst { data } = await client.getNotification({\n id: 1,\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": 123456789,\n "notification_id": 123456789,\n "timestamp": "1970-01-01T00:00:00.000Z",\n "read_state": false,\n "type": "workflow",\n "redirect_url": "https://epilot.cloud",\n "organization_id": "206801",\n "title": {\n "en": "My custom notification",\n "de": "Meine benutzerdefinierte Aktivit\xE4t"\n },\n "message": {\n "en": "{{caller}} did something with {{contact.entity.id}} {{branch.name}}.",\n "de": "{{caller}} habe etwas damit gemacht {{contact.entity.id}} {{branch.name}}."\n },\n "payload": {\n "entity": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "schema": "contact"\n }\n },\n "caller": {\n "EpilotAuth": {\n "token": {\n "sub": "476e9b48-42f4-4234-a2b0-4668b34626ce",\n "cognito:groups": ["Administrator"],\n "cognito:preferred_role": "arn:aws:iam::912468240823:role/base-administrator-role",\n "iss": "https://cognito-idp.eu-central-1.amazonaws.com/eu-central-1_6lZSgmU6D",\n "custom:ivy_org_id": "739224",\n "cognito:username": "n.ahmad@epilot.cloud",\n "custom:ivy_user_id": "10006129",\n "cognito:roles": ["arn:aws:iam::912468240823:role/base-administrator-role"],\n "aud": "6e0jbdnger7nmoktaaflarue1l",\n "event_id": "cd5f5583-d90c-4db5-8e99-5f5dd29a4d75",\n "token_use": "id",\n "auth_time": 1614333023,\n "exp": 1614336623,\n "iat": 1614333023,\n "email": "n.ahmad@epilot.cloud"\n }\n }\n },\n "operations": [\n {\n "entity": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "operation": "updateEntity",\n "params": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "slug": "contact"\n },\n "payload": {\n "_schema": "contact",\n "_org": "123",\n "status": "Inactive"\n }\n }\n ],\n "force_notify_users": {\n "12345": {\n "email": false,\n "in_app": false\n }\n },\n "allowed_channels": ["in_app"]\n}\n```\n\n</details>\n\n---\n\n### `markAllAsRead`\n\nMark all as read\n\n`PUT /v1/notification/notifications/mark`\n\n```ts\nconst { data } = await client.markAllAsRead()\n```\n\n---\n\n### `markAsRead`\n\nMark as read\n\n`PUT /v1/notification/notifications/{id}/mark`\n\n```ts\nconst { data } = await client.markAsRead({\n id: 1,\n})\n```\n\n---\n\n### `getTotalUnread`\n\nGet total unread\n\n`GET /v1/notification/unreads`\n\n```ts\nconst { data } = await client.getTotalUnread()\n```\n\n---\n\n### `listNotificationTemplates`\n\nList notification templates with optional filtering and pagination\n\n`GET /v1/notification/templates`\n\n```ts\nconst { data } = await client.listNotificationTemplates({\n q: \'example\',\n from: 1,\n size: 1,\n sort: \'example\',\n fields: \'example\',\n hydrate: true,\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n }\n ],\n "hits": 0\n}\n```\n\n</details>\n\n---\n\n### `createNotificationTemplate`\n\nCreate a new notification template\n\n`POST /v1/notification/templates`\n\n```ts\nconst { data } = await client.createNotificationTemplate(\n null,\n {\n name: \'string\',\n type: \'string\',\n notification_title: \'string\',\n message: \'string\',\n action_label: \'string\',\n action_url: \'string\',\n style: \'string\',\n _title: \'string\',\n _tags: [\'string\'],\n _manifest: [\'123e4567-e89b-12d3-a456-426614174000\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `getNotificationTemplate`\n\nGet a single notification template by ID\n\n`GET /v1/notification/templates/{id}`\n\n```ts\nconst { data } = await client.getNotificationTemplate({\n id: \'123e4567-e89b-12d3-a456-426614174000\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `updateNotificationTemplate`\n\nUpdate a notification template (full replacement)\n\n`PUT /v1/notification/templates/{id}`\n\n```ts\nconst { data } = await client.updateNotificationTemplate(\n {\n id: \'123e4567-e89b-12d3-a456-426614174000\',\n },\n {\n name: \'string\',\n notification_title: \'string\',\n message: \'string\',\n action_label: \'string\',\n action_url: \'string\',\n style: \'string\',\n _title: \'string\',\n _tags: [\'string\'],\n _manifest: [\'123e4567-e89b-12d3-a456-426614174000\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `patchNotificationTemplate`\n\nPartially update a notification template\n\n`PATCH /v1/notification/templates/{id}`\n\n```ts\nconst { data } = await client.patchNotificationTemplate(\n {\n id: \'123e4567-e89b-12d3-a456-426614174000\',\n },\n {\n name: \'string\',\n notification_title: \'string\',\n message: \'string\',\n action_label: \'string\',\n action_url: \'string\',\n style: \'string\',\n _title: \'string\',\n _tags: [\'string\'],\n _manifest: [\'123e4567-e89b-12d3-a456-426614174000\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `deleteNotificationTemplate`\n\nDelete a notification template permanently\n\n`DELETE /v1/notification/templates/{id}`\n\n```ts\nconst { data } = await client.deleteNotificationTemplate({\n id: \'123e4567-e89b-12d3-a456-426614174000\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `sendPreview`\n\nSend a preview notification (both email and in-app) to the requesting user.\nUsed to test notification templates before saving.\n\n`POST /v1/notification/templates/send-preview`\n\n```ts\nconst { data } = await client.sendPreview(\n null,\n {\n template: {\n name: \'string\',\n notification_title: \'string\',\n message: \'string\',\n action_label: \'string\',\n action_url: \'string\',\n style: \'string\',\n _title: \'string\',\n _tags: [\'string\'],\n _manifest: [\'123e4567-e89b-12d3-a456-426614174000\']\n },\n context_ids: {}\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n[\n {\n "success": true,\n "data": {}\n }\n]\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `Error`\n\n```ts\ntype Error = {\n message: string\n code?: string\n}\n```\n\n### `EntityOperation`\n\n```ts\ntype EntityOperation = {\n entity: string // uuid\n operation?: string\n params?: {\n id?: string // uuid\n slug?: string\n }\n payload?: object\n}\n```\n\n### `NotificationItem`\n\n```ts\ntype NotificationItem = {\n id?: number\n notification_id?: number\n timestamp?: string // date-time\n read_state?: boolean\n type: string\n redirect_url?: string\n organization_id?: string\n title: {\n en?: string\n de?: string\n }\n message: {\n en?: string\n de?: string\n }\n payload?: Record<string, unknown>\n caller?: {\n EpilotAuth?: {\n token?: { ... }\n }\n }\n operations?: Array<{\n entity: string // uuid\n operation?: string\n params?: {\n id?: { ... }\n slug?: { ... }\n }\n payload?: object\n }>\n force_notify_users?: Record<string, unknown>\n allowed_channels?: "email" | "in_app"[]\n}\n```\n\n### `Notification`\n\n```ts\ntype Notification = {\n notification_id?: number\n timestamp?: string // date-time\n type: string\n redirect_url?: string\n organization_id?: string\n title: {\n en?: string\n de?: string\n }\n message: {\n en?: string\n de?: string\n }\n payload?: Record<string, unknown>\n caller?: {\n EpilotAuth?: {\n token?: { ... }\n }\n }\n operations?: Array<{\n entity: string // uuid\n operation?: string\n params?: {\n id?: { ... }\n slug?: { ... }\n }\n payload?: object\n }>\n force_notify_users?: Record<string, unknown>\n allowed_channels?: "email" | "in_app"[]\n read_state?: boolean\n visibility_user_ids?: string[]\n}\n```\n\n### `NotificationBase`\n\n```ts\ntype NotificationBase = {\n notification_id?: number\n timestamp?: string // date-time\n type: string\n redirect_url?: string\n organization_id?: string\n title: {\n en?: string\n de?: string\n }\n message: {\n en?: string\n de?: string\n }\n payload?: Record<string, unknown>\n caller?: {\n EpilotAuth?: {\n token?: { ... }\n }\n }\n operations?: Array<{\n entity: string // uuid\n operation?: string\n params?: {\n id?: { ... }\n slug?: { ... }\n }\n payload?: object\n }>\n force_notify_users?: Record<string, unknown>\n allowed_channels?: "email" | "in_app"[]\n}\n```\n\n### `EntityId`\n\n```ts\ntype EntityId = string // uuid\n```\n\n### `Entity`\n\n```ts\ntype Entity = Record<string, unknown>\n```\n\n### `Id`\n\n```ts\ntype Id = number\n```\n\n### `NotificationId`\n\n```ts\ntype NotificationId = number\n```\n\n### `NotificationCallerContext`\n\n```ts\ntype NotificationCallerContext = {\n EpilotAuth?: {\n token?: {\n sub?: { ... }\n email?: { ... }\n cognito:username?: { ... }\n custom:ivy_user_id?: { ... }\n }\n }\n}\n```\n\n### `EntitySlug`\n\nURL-friendly identifier for the entity schema\n\n```ts\ntype EntitySlug = string\n```\n\n### `EntityOwner`\n\n```ts\ntype EntityOwner = {\n org_id: string\n user_id: string\n}\n```\n\n### `EntityAcl`\n\nAccess control list\n\n```ts\ntype EntityAcl = {\n view?: string[]\n edit?: string[]\n delete?: string[]\n}\n```\n\n### `NotificationTemplate`\n\n```ts\ntype NotificationTemplate = {\n _id: string // uuid\n _schema: string\n _title: string\n _org: string\n _tags?: string[]\n _created_at: string // date-time\n _updated_at: string // date-time\n _manifest?: string // uuid[]\n _owners?: Array<{\n org_id: string\n user_id: string\n }>\n _acl?: {\n view?: string[]\n edit?: string[]\n delete?: string[]\n }\n name?: string\n type?: string\n notification_title?: string\n message?: string\n action_label?: string\n action_url?: string\n style?: string\n system_template?: boolean\n created_by?: string\n updated_by?: string\n}\n```\n\n### `CreateNotificationTemplateInput`\n\n```ts\ntype CreateNotificationTemplateInput = {\n name: string\n type: string\n notification_title?: string\n message?: string\n action_label?: string\n action_url?: string\n style?: string\n _title?: string\n _tags?: string[]\n _manifest?: string // uuid[]\n}\n```\n\n### `UpdateNotificationTemplateInput`\n\n```ts\ntype UpdateNotificationTemplateInput = {\n name?: string\n notification_title?: string\n message?: string\n action_label?: string\n action_url?: string\n style?: string\n _title?: string\n _tags?: string[]\n _manifest?: string // uuid[]\n}\n```\n\n### `NotificationTemplateListResponse`\n\n```ts\ntype NotificationTemplateListResponse = {\n results?: Array<{\n _id: string // uuid\n _schema: string\n _title: string\n _org: string\n _tags?: string[]\n _created_at: string // date-time\n _updated_at: string // date-time\n _manifest?: string // uuid[]\n _owners?: Array<{\n org_id: { ... }\n user_id: { ... }\n }>\n _acl?: {\n view?: { ... }\n edit?: { ... }\n delete?: { ... }\n }\n name?: string\n type?: string\n notification_title?: string\n message?: string\n action_label?: string\n action_url?: string\n style?: string\n system_template?: boolean\n created_by?: string\n updated_by?: string\n }>\n hits?: number\n}\n```\n\n### `SendPreviewInput`\n\n```ts\ntype SendPreviewInput = {\n template: {\n name?: string\n notification_title?: string\n message?: string\n action_label?: string\n action_url?: string\n style?: string\n _title?: string\n _tags?: string[]\n _manifest?: string // uuid[]\n }\n context_ids?: Record<string, string>\n}\n```\n\n### `SendPreviewResponse`\n\nArray of results for each notification channel (email, in-app)\n\n```ts\ntype SendPreviewResponse = Array<{\n success: boolean\n data?: unknown\n}>\n```\n';
5
+ export {
6
+ notification_default as default
7
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-NJK5F5TF.cjs');
2
+
3
+ // src/docs/notification.json
4
+ var notification_default = '# Notification API\n\n- **Base URL:** `https://notification.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/notification](https://docs.epilot.io/api/notification)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.notification.getNotificationsV2(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/notification\'\n\nconst notificationClient = getClient()\nauthorize(notificationClient, () => \'<token>\')\nconst { data } = await notificationClient.getNotificationsV2(...)\n```\n\n## Operations\n\n**Notification**\n- [`getNotificationsV2`](#getnotificationsv2)\n- [`createNotification`](#createnotification)\n- [`getNotifications`](#getnotifications)\n- [`getNotification`](#getnotification)\n- [`markAllAsRead`](#markallasread)\n- [`markAsRead`](#markasread)\n- [`getTotalUnread`](#gettotalunread)\n\n**Template**\n- [`listNotificationTemplates`](#listnotificationtemplates)\n- [`createNotificationTemplate`](#createnotificationtemplate)\n- [`getNotificationTemplate`](#getnotificationtemplate)\n- [`updateNotificationTemplate`](#updatenotificationtemplate)\n- [`patchNotificationTemplate`](#patchnotificationtemplate)\n- [`deleteNotificationTemplate`](#deletenotificationtemplate)\n- [`sendPreview`](#sendpreview)\n\n**Schemas**\n- [`Error`](#error)\n- [`EntityOperation`](#entityoperation)\n- [`NotificationItem`](#notificationitem)\n- [`Notification`](#notification)\n- [`NotificationBase`](#notificationbase)\n- [`EntityId`](#entityid)\n- [`Entity`](#entity)\n- [`Id`](#id)\n- [`NotificationId`](#notificationid)\n- [`NotificationCallerContext`](#notificationcallercontext)\n- [`EntitySlug`](#entityslug)\n- [`EntityOwner`](#entityowner)\n- [`EntityAcl`](#entityacl)\n- [`NotificationTemplate`](#notificationtemplate)\n- [`CreateNotificationTemplateInput`](#createnotificationtemplateinput)\n- [`UpdateNotificationTemplateInput`](#updatenotificationtemplateinput)\n- [`NotificationTemplateListResponse`](#notificationtemplatelistresponse)\n- [`SendPreviewInput`](#sendpreviewinput)\n- [`SendPreviewResponse`](#sendpreviewresponse)\n\n### `getNotificationsV2`\n\nGet notifications items. These items may eventually contain entities within their payload, which can be hydrated by the client if desired by calling the Entity API directly.\n\n`GET /v2/notification/notifications`\n\n```ts\nconst { data } = await client.getNotificationsV2({\n cursor: \'example\',\n after_id: 1,\n limit: 1,\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "cursor": "eyJjcmVhd",\n "total": 1,\n "total_unread": 1,\n "results": [\n {\n "id": 123456789,\n "notification_id": 123456789,\n "timestamp": "1970-01-01T00:00:00.000Z",\n "read_state": false,\n "type": "workflow",\n "redirect_url": "https://epilot.cloud",\n "organization_id": "206801",\n "title": {\n "en": "My custom notification",\n "de": "Meine benutzerdefinierte Aktivit\xE4t"\n },\n "message": {\n "en": "{{caller}} did something with {{contact.entity.id}} {{branch.name}}.",\n "de": "{{caller}} habe etwas damit gemacht {{contact.entity.id}} {{branch.name}}."\n },\n "payload": {\n "entity": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "schema": "contact"\n }\n },\n "caller": {\n "EpilotAuth": {\n "token": {\n "sub": "476e9b48-42f4-4234-a2b0-4668b34626ce",\n "cognito:groups": ["Administrator"],\n "cognito:preferred_role": "arn:aws:iam::912468240823:role/base-administrator-role",\n "iss": "https://cognito-idp.eu-central-1.amazonaws.com/eu-central-1_6lZSgmU6D",\n "custom:ivy_org_id": "739224",\n "cognito:username": "n.ahmad@epilot.cloud",\n "custom:ivy_user_id": "10006129",\n "cognito:roles": ["arn:aws:iam::912468240823:role/base-administrator-role"],\n "aud": "6e0jbdnger7nmoktaaflarue1l",\n "event_id": "cd5f5583-d90c-4db5-8e99-5f5dd29a4d75",\n "token_use": "id",\n "auth_time": 1614333023,\n "exp": 1614336623,\n "iat": 1614333023,\n "email": "n.ahmad@epilot.cloud"\n }\n }\n },\n "operations": [\n {\n "entity": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "operation": "updateEntity",\n "params": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "slug": "contact"\n },\n "payload": {\n "_schema": "contact",\n "_org": "123",\n "status": "Inactive"\n }\n }\n ],\n "force_notify_users": {\n "12345": {\n "email": false,\n "in_app": false\n }\n },\n "allowed_channels": ["in_app"]\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `createNotification`\n\nCreate a message that can be displayed in the notification panel.\n\n`POST /v1/notification/notifications`\n\n```ts\nconst { data } = await client.createNotification(\n null,\n {\n notification_id: 0,\n timestamp: \'1970-01-01T00:00:00.000Z\',\n type: \'workflow\',\n redirect_url: \'https://epilot.cloud\',\n organization_id: \'206801\',\n title: {\n en: \'My custom notification\',\n de: \'Meine benutzerdefinierte Aktivit\xE4t\'\n },\n message: {\n en: \'{{caller}} did something with {{contact.entity.id}} {{branch.name}}.\',\n de: \'{{caller}} habe etwas damit gemacht {{contact.entity.id}} {{branch.name}}.\'\n },\n payload: {\n entity: {\n id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n schema: \'contact\'\n }\n },\n caller: {\n EpilotAuth: {\n token: {\n sub: \'476e9b48-42f4-4234-a2b0-4668b34626ce\',\n \'cognito:groups\': [\'Administrator\'],\n \'cognito:preferred_role\': \'arn:aws:iam::912468240823:role/base-administrator-role\',\n iss: \'https://cognito-idp.eu-central-1.amazonaws.com/eu-central-1_6lZSgmU6D\',\n \'custom:ivy_org_id\': \'739224\',\n \'cognito:username\': \'n.ahmad@epilot.cloud\',\n \'custom:ivy_user_id\': \'10006129\',\n \'cognito:roles\': [\'arn:aws:iam::912468240823:role/base-administrator-role\'],\n aud: \'6e0jbdnger7nmoktaaflarue1l\',\n event_id: \'cd5f5583-d90c-4db5-8e99-5f5dd29a4d75\',\n token_use: \'id\',\n auth_time: 1614333023,\n exp: 1614336623,\n iat: 1614333023,\n email: \'n.ahmad@epilot.cloud\'\n }\n }\n },\n operations: [\n {\n entity: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n operation: \'updateEntity\',\n params: {\n id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n slug: \'contact\'\n },\n payload: {\n _schema: \'contact\',\n _org: \'123\',\n status: \'Inactive\'\n }\n }\n ],\n force_notify_users: {\n \'12345\': {\n email: false,\n in_app: false\n }\n },\n allowed_channels: [\'in_app\'],\n read_state: false,\n visibility_user_ids: [\'1\', \'2\', \'3\', \'4\', \'5\']\n },\n)\n```\n\n---\n\n### `getNotifications`\n\nGet notifications\n\n`GET /v1/notification/notifications`\n\n```ts\nconst { data } = await client.getNotifications({\n after_id: 1,\n limit: 1,\n no_hydrate: true,\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "total": 1,\n "total_unread": 1,\n "results": [\n {\n "id": 123456789,\n "notification_id": 123456789,\n "timestamp": "1970-01-01T00:00:00.000Z",\n "read_state": false,\n "type": "workflow",\n "redirect_url": "https://epilot.cloud",\n "organization_id": "206801",\n "title": {\n "en": "My custom notification",\n "de": "Meine benutzerdefinierte Aktivit\xE4t"\n },\n "message": {\n "en": "{{caller}} did something with {{contact.entity.id}} {{branch.name}}.",\n "de": "{{caller}} habe etwas damit gemacht {{contact.entity.id}} {{branch.name}}."\n },\n "payload": {\n "entity": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "schema": "contact"\n }\n },\n "caller": {\n "EpilotAuth": {\n "token": {\n "sub": "476e9b48-42f4-4234-a2b0-4668b34626ce",\n "cognito:groups": ["Administrator"],\n "cognito:preferred_role": "arn:aws:iam::912468240823:role/base-administrator-role",\n "iss": "https://cognito-idp.eu-central-1.amazonaws.com/eu-central-1_6lZSgmU6D",\n "custom:ivy_org_id": "739224",\n "cognito:username": "n.ahmad@epilot.cloud",\n "custom:ivy_user_id": "10006129",\n "cognito:roles": ["arn:aws:iam::912468240823:role/base-administrator-role"],\n "aud": "6e0jbdnger7nmoktaaflarue1l",\n "event_id": "cd5f5583-d90c-4db5-8e99-5f5dd29a4d75",\n "token_use": "id",\n "auth_time": 1614333023,\n "exp": 1614336623,\n "iat": 1614333023,\n "email": "n.ahmad@epilot.cloud"\n }\n }\n },\n "operations": [\n {\n "entity": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "operation": "updateEntity",\n "params": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "slug": "contact"\n },\n "payload": {\n "_schema": "contact",\n "_org": "123",\n "status": "Inactive"\n }\n }\n ],\n "force_notify_users": {\n "12345": {\n "email": false,\n "in_app": false\n }\n },\n "allowed_channels": ["in_app"]\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `getNotification`\n\nGet the details of a single notification.\n\n`GET /v1/notification/notifications/{id}`\n\n```ts\nconst { data } = await client.getNotification({\n id: 1,\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": 123456789,\n "notification_id": 123456789,\n "timestamp": "1970-01-01T00:00:00.000Z",\n "read_state": false,\n "type": "workflow",\n "redirect_url": "https://epilot.cloud",\n "organization_id": "206801",\n "title": {\n "en": "My custom notification",\n "de": "Meine benutzerdefinierte Aktivit\xE4t"\n },\n "message": {\n "en": "{{caller}} did something with {{contact.entity.id}} {{branch.name}}.",\n "de": "{{caller}} habe etwas damit gemacht {{contact.entity.id}} {{branch.name}}."\n },\n "payload": {\n "entity": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "schema": "contact"\n }\n },\n "caller": {\n "EpilotAuth": {\n "token": {\n "sub": "476e9b48-42f4-4234-a2b0-4668b34626ce",\n "cognito:groups": ["Administrator"],\n "cognito:preferred_role": "arn:aws:iam::912468240823:role/base-administrator-role",\n "iss": "https://cognito-idp.eu-central-1.amazonaws.com/eu-central-1_6lZSgmU6D",\n "custom:ivy_org_id": "739224",\n "cognito:username": "n.ahmad@epilot.cloud",\n "custom:ivy_user_id": "10006129",\n "cognito:roles": ["arn:aws:iam::912468240823:role/base-administrator-role"],\n "aud": "6e0jbdnger7nmoktaaflarue1l",\n "event_id": "cd5f5583-d90c-4db5-8e99-5f5dd29a4d75",\n "token_use": "id",\n "auth_time": 1614333023,\n "exp": 1614336623,\n "iat": 1614333023,\n "email": "n.ahmad@epilot.cloud"\n }\n }\n },\n "operations": [\n {\n "entity": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "operation": "updateEntity",\n "params": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "slug": "contact"\n },\n "payload": {\n "_schema": "contact",\n "_org": "123",\n "status": "Inactive"\n }\n }\n ],\n "force_notify_users": {\n "12345": {\n "email": false,\n "in_app": false\n }\n },\n "allowed_channels": ["in_app"]\n}\n```\n\n</details>\n\n---\n\n### `markAllAsRead`\n\nMark all as read\n\n`PUT /v1/notification/notifications/mark`\n\n```ts\nconst { data } = await client.markAllAsRead()\n```\n\n---\n\n### `markAsRead`\n\nMark as read\n\n`PUT /v1/notification/notifications/{id}/mark`\n\n```ts\nconst { data } = await client.markAsRead({\n id: 1,\n})\n```\n\n---\n\n### `getTotalUnread`\n\nGet total unread\n\n`GET /v1/notification/unreads`\n\n```ts\nconst { data } = await client.getTotalUnread()\n```\n\n---\n\n### `listNotificationTemplates`\n\nList notification templates with optional filtering and pagination\n\n`GET /v1/notification/templates`\n\n```ts\nconst { data } = await client.listNotificationTemplates({\n q: \'example\',\n from: 1,\n size: 1,\n sort: \'example\',\n fields: \'example\',\n hydrate: true,\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n }\n ],\n "hits": 0\n}\n```\n\n</details>\n\n---\n\n### `createNotificationTemplate`\n\nCreate a new notification template\n\n`POST /v1/notification/templates`\n\n```ts\nconst { data } = await client.createNotificationTemplate(\n null,\n {\n name: \'string\',\n type: \'string\',\n notification_title: \'string\',\n message: \'string\',\n action_label: \'string\',\n action_url: \'string\',\n style: \'string\',\n _title: \'string\',\n _tags: [\'string\'],\n _manifest: [\'123e4567-e89b-12d3-a456-426614174000\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `getNotificationTemplate`\n\nGet a single notification template by ID\n\n`GET /v1/notification/templates/{id}`\n\n```ts\nconst { data } = await client.getNotificationTemplate({\n id: \'123e4567-e89b-12d3-a456-426614174000\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `updateNotificationTemplate`\n\nUpdate a notification template (full replacement)\n\n`PUT /v1/notification/templates/{id}`\n\n```ts\nconst { data } = await client.updateNotificationTemplate(\n {\n id: \'123e4567-e89b-12d3-a456-426614174000\',\n },\n {\n name: \'string\',\n notification_title: \'string\',\n message: \'string\',\n action_label: \'string\',\n action_url: \'string\',\n style: \'string\',\n _title: \'string\',\n _tags: [\'string\'],\n _manifest: [\'123e4567-e89b-12d3-a456-426614174000\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `patchNotificationTemplate`\n\nPartially update a notification template\n\n`PATCH /v1/notification/templates/{id}`\n\n```ts\nconst { data } = await client.patchNotificationTemplate(\n {\n id: \'123e4567-e89b-12d3-a456-426614174000\',\n },\n {\n name: \'string\',\n notification_title: \'string\',\n message: \'string\',\n action_label: \'string\',\n action_url: \'string\',\n style: \'string\',\n _title: \'string\',\n _tags: [\'string\'],\n _manifest: [\'123e4567-e89b-12d3-a456-426614174000\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `deleteNotificationTemplate`\n\nDelete a notification template permanently\n\n`DELETE /v1/notification/templates/{id}`\n\n```ts\nconst { data } = await client.deleteNotificationTemplate({\n id: \'123e4567-e89b-12d3-a456-426614174000\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `sendPreview`\n\nSend a preview notification (both email and in-app) to the requesting user.\nUsed to test notification templates before saving.\n\n`POST /v1/notification/templates/send-preview`\n\n```ts\nconst { data } = await client.sendPreview(\n null,\n {\n template: {\n name: \'string\',\n notification_title: \'string\',\n message: \'string\',\n action_label: \'string\',\n action_url: \'string\',\n style: \'string\',\n _title: \'string\',\n _tags: [\'string\'],\n _manifest: [\'123e4567-e89b-12d3-a456-426614174000\']\n },\n context_ids: {}\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n[\n {\n "success": true,\n "data": {}\n }\n]\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `Error`\n\n```ts\ntype Error = {\n message: string\n code?: string\n}\n```\n\n### `EntityOperation`\n\n```ts\ntype EntityOperation = {\n entity: string // uuid\n operation?: string\n params?: {\n id?: string // uuid\n slug?: string\n }\n payload?: object\n}\n```\n\n### `NotificationItem`\n\n```ts\ntype NotificationItem = {\n id?: number\n notification_id?: number\n timestamp?: string // date-time\n read_state?: boolean\n type: string\n redirect_url?: string\n organization_id?: string\n title: {\n en?: string\n de?: string\n }\n message: {\n en?: string\n de?: string\n }\n payload?: Record<string, unknown>\n caller?: {\n EpilotAuth?: {\n token?: { ... }\n }\n }\n operations?: Array<{\n entity: string // uuid\n operation?: string\n params?: {\n id?: { ... }\n slug?: { ... }\n }\n payload?: object\n }>\n force_notify_users?: Record<string, unknown>\n allowed_channels?: "email" | "in_app"[]\n}\n```\n\n### `Notification`\n\n```ts\ntype Notification = {\n notification_id?: number\n timestamp?: string // date-time\n type: string\n redirect_url?: string\n organization_id?: string\n title: {\n en?: string\n de?: string\n }\n message: {\n en?: string\n de?: string\n }\n payload?: Record<string, unknown>\n caller?: {\n EpilotAuth?: {\n token?: { ... }\n }\n }\n operations?: Array<{\n entity: string // uuid\n operation?: string\n params?: {\n id?: { ... }\n slug?: { ... }\n }\n payload?: object\n }>\n force_notify_users?: Record<string, unknown>\n allowed_channels?: "email" | "in_app"[]\n read_state?: boolean\n visibility_user_ids?: string[]\n}\n```\n\n### `NotificationBase`\n\n```ts\ntype NotificationBase = {\n notification_id?: number\n timestamp?: string // date-time\n type: string\n redirect_url?: string\n organization_id?: string\n title: {\n en?: string\n de?: string\n }\n message: {\n en?: string\n de?: string\n }\n payload?: Record<string, unknown>\n caller?: {\n EpilotAuth?: {\n token?: { ... }\n }\n }\n operations?: Array<{\n entity: string // uuid\n operation?: string\n params?: {\n id?: { ... }\n slug?: { ... }\n }\n payload?: object\n }>\n force_notify_users?: Record<string, unknown>\n allowed_channels?: "email" | "in_app"[]\n}\n```\n\n### `EntityId`\n\n```ts\ntype EntityId = string // uuid\n```\n\n### `Entity`\n\n```ts\ntype Entity = Record<string, unknown>\n```\n\n### `Id`\n\n```ts\ntype Id = number\n```\n\n### `NotificationId`\n\n```ts\ntype NotificationId = number\n```\n\n### `NotificationCallerContext`\n\n```ts\ntype NotificationCallerContext = {\n EpilotAuth?: {\n token?: {\n sub?: { ... }\n email?: { ... }\n cognito:username?: { ... }\n custom:ivy_user_id?: { ... }\n }\n }\n}\n```\n\n### `EntitySlug`\n\nURL-friendly identifier for the entity schema\n\n```ts\ntype EntitySlug = string\n```\n\n### `EntityOwner`\n\n```ts\ntype EntityOwner = {\n org_id: string\n user_id: string\n}\n```\n\n### `EntityAcl`\n\nAccess control list\n\n```ts\ntype EntityAcl = {\n view?: string[]\n edit?: string[]\n delete?: string[]\n}\n```\n\n### `NotificationTemplate`\n\n```ts\ntype NotificationTemplate = {\n _id: string // uuid\n _schema: string\n _title: string\n _org: string\n _tags?: string[]\n _created_at: string // date-time\n _updated_at: string // date-time\n _manifest?: string // uuid[]\n _owners?: Array<{\n org_id: string\n user_id: string\n }>\n _acl?: {\n view?: string[]\n edit?: string[]\n delete?: string[]\n }\n name?: string\n type?: string\n notification_title?: string\n message?: string\n action_label?: string\n action_url?: string\n style?: string\n system_template?: boolean\n created_by?: string\n updated_by?: string\n}\n```\n\n### `CreateNotificationTemplateInput`\n\n```ts\ntype CreateNotificationTemplateInput = {\n name: string\n type: string\n notification_title?: string\n message?: string\n action_label?: string\n action_url?: string\n style?: string\n _title?: string\n _tags?: string[]\n _manifest?: string // uuid[]\n}\n```\n\n### `UpdateNotificationTemplateInput`\n\n```ts\ntype UpdateNotificationTemplateInput = {\n name?: string\n notification_title?: string\n message?: string\n action_label?: string\n action_url?: string\n style?: string\n _title?: string\n _tags?: string[]\n _manifest?: string // uuid[]\n}\n```\n\n### `NotificationTemplateListResponse`\n\n```ts\ntype NotificationTemplateListResponse = {\n results?: Array<{\n _id: string // uuid\n _schema: string\n _title: string\n _org: string\n _tags?: string[]\n _created_at: string // date-time\n _updated_at: string // date-time\n _manifest?: string // uuid[]\n _owners?: Array<{\n org_id: { ... }\n user_id: { ... }\n }>\n _acl?: {\n view?: { ... }\n edit?: { ... }\n delete?: { ... }\n }\n name?: string\n type?: string\n notification_title?: string\n message?: string\n action_label?: string\n action_url?: string\n style?: string\n system_template?: boolean\n created_by?: string\n updated_by?: string\n }>\n hits?: number\n}\n```\n\n### `SendPreviewInput`\n\n```ts\ntype SendPreviewInput = {\n template: {\n name?: string\n notification_title?: string\n message?: string\n action_label?: string\n action_url?: string\n style?: string\n _title?: string\n _tags?: string[]\n _manifest?: string // uuid[]\n }\n context_ids?: Record<string, string>\n}\n```\n\n### `SendPreviewResponse`\n\nArray of results for each notification channel (email, in-app)\n\n```ts\ntype SendPreviewResponse = Array<{\n success: boolean\n data?: unknown\n}>\n```\n';
5
+
6
+
7
+ exports.default = notification_default;