@epilot/app-client 0.12.5 → 0.12.6

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.
package/dist/openapi.d.ts CHANGED
@@ -1515,7 +1515,19 @@ declare namespace Components {
1515
1515
  * - valid: false
1516
1516
  *
1517
1517
  */
1518
- PortalExtensionHookMeterReadingPlausibilityCheck)[];
1518
+ PortalExtensionHookMeterReadingPlausibilityCheck | /**
1519
+ * Hook that returns runtime metadata describing how a visualization (consumption / price / cost chart) should be rendered for a given portal context (meter, contract, etc). It is invoked by the portal before fetching data, with the same context the data hook would receive, so that the discovery shape can vary per meter/contract. The expected response to the call is:
1520
+ * - 200 with a JSON body of shape:
1521
+ * {
1522
+ * "type_options": [{ "id": "ht", "label": { "en": "High tariff" }, "aggregation_group": "consumption", "unit": "kWh" }, ...],
1523
+ * "intervals": ["PT15M", "PT1H", "P1D", "P1M"],
1524
+ * "data_range": { "from": "2024-01-01T00:00:00Z", "to": "2026-05-01T00:00:00Z" }
1525
+ * }
1526
+ * All fields are optional; the consumer falls back to its defaults for whatever the hook does not return.
1527
+ * The portal looks up this hook implicitly per extension (one `visualizationMetadata` hook per extension) — there is no need for a data-retrieval hook to reference it explicitly.
1528
+ *
1529
+ */
1530
+ PortalExtensionHookVisualizationMetadata)[];
1519
1531
  links?: {
1520
1532
  /**
1521
1533
  * Identifier of the link. Should not change between updates.
@@ -1545,16 +1557,6 @@ declare namespace Components {
1545
1557
  };
1546
1558
  }[];
1547
1559
  }
1548
- /**
1549
- * An aggregation method advertised by a consumption data retrieval hook.
1550
- */
1551
- export interface PortalExtensionHookConsumptionAggregationMethodOption {
1552
- /**
1553
- * Identifier of the option. Matches the `aggregation_method` value returned by the hook.
1554
- */
1555
- id: "sum" | "average" | "min" | "max";
1556
- label: TranslatedString;
1557
- }
1558
1560
  /**
1559
1561
  * Hook that will allow using the specified source as data for consumption visualizations. This hook is triggered to fetch the data. Format of the request and response has to follow the following specification: TBD. The expected response to the call is:
1560
1562
  * - 200 with the time series data
@@ -1568,19 +1570,11 @@ declare namespace Components {
1568
1570
  name?: TranslatedString;
1569
1571
  type: "consumptionDataRetrieval";
1570
1572
  /**
1573
+ * Deprecated. Prefer declaring a sibling `visualizationMetadata` hook on the same extension and returning `intervals` from its response — that way the supported intervals can vary per meter/contract.
1571
1574
  * Intervals supported by the API. If omitted, it is assumed that all intervals are supported.
1572
- */
1573
- intervals?: ("PT15M" | "PT1H" | "P1D" | "P1M")[];
1574
- /**
1575
- * Consumption types advertised by the hook (e.g. `ht`/`nt`, `feed-in`/`feed-out`). The `id` has to match the `type` field returned in the consumption response.
1576
1575
  *
1577
1576
  */
1578
- type_options?: /* A consumption type advertised by a consumption data retrieval hook. */ PortalExtensionHookConsumptionOption[];
1579
- /**
1580
- * Aggregation methods advertised by the hook (e.g. `sum`, `average`, `min`, `max`). The `id` has to match the `aggregation_method` field returned in the consumption response.
1581
- *
1582
- */
1583
- aggregation_method_options?: /* An aggregation method advertised by a consumption data retrieval hook. */ PortalExtensionHookConsumptionAggregationMethodOption[];
1577
+ intervals?: ("PT15M" | "PT1H" | "P1D" | "P1M")[];
1584
1578
  auth?: PortalExtensionAuthBlock;
1585
1579
  call: {
1586
1580
  /**
@@ -1624,23 +1618,6 @@ declare namespace Components {
1624
1618
  use_static_ips?: boolean;
1625
1619
  secure_proxy?: /* If set, requests are routed through the ERP Integration secure proxy. Mutually exclusive with use_static_ips. */ PortalExtensionSecureProxy;
1626
1620
  }
1627
- /**
1628
- * A consumption type advertised by a consumption data retrieval hook.
1629
- */
1630
- export interface PortalExtensionHookConsumptionOption {
1631
- /**
1632
- * Identifier of the option. Matches the `type` value returned by the hook (e.g. `ht`, `nt`, `feed-in`).
1633
- */
1634
- id: string;
1635
- label: TranslatedString;
1636
- /**
1637
- * Optional grouping key. Types sharing the same aggregation_group are interpreted as values that can be aggregated (e.g. ht/nt shown as a stacked bar chart - summed into total consumption per interval). Types in different groups — or types without a group — are not (e.g. feed-in vs feed-out shown as separate bars).
1638
- *
1639
- * example:
1640
- * consumption
1641
- */
1642
- aggregation_group?: string;
1643
- }
1644
1621
  /**
1645
1622
  * Hook that replaces the built-in Contract identification for self-assignment. This hook involves an HTTP request whenever a user is trying to self-assign Contract(s).
1646
1623
  * The expected response http status code to the call is:
@@ -1738,7 +1715,9 @@ declare namespace Components {
1738
1715
  name?: TranslatedString;
1739
1716
  type: "costDataRetrieval";
1740
1717
  /**
1718
+ * Deprecated. Prefer declaring a sibling `visualizationMetadata` hook on the same extension and returning `intervals` from its response — that way the supported intervals can vary per meter/contract.
1741
1719
  * Intervals supported by the API. If omitted, it is assumed that all intervals are supported.
1720
+ *
1742
1721
  */
1743
1722
  intervals?: ("PT15M" | "PT1H" | "P1D" | "P1M")[];
1744
1723
  auth?: PortalExtensionAuthBlock;
@@ -1796,6 +1775,14 @@ declare namespace Components {
1796
1775
  id: string; // ^[a-zA-Z0-9_-]+$
1797
1776
  name?: TranslatedString;
1798
1777
  type: "dataExport";
1778
+ /**
1779
+ * Optional list of portal block types this hook supports. If omitted,
1780
+ * the hook is usable on any export-capable block. Allowed values match
1781
+ * the block type identifiers used by the portal builder
1782
+ * (e.g. `consumption_visualization`, `dynamic_tariff`).
1783
+ *
1784
+ */
1785
+ block_types?: string[];
1799
1786
  auth?: PortalExtensionAuthBlock;
1800
1787
  call: {
1801
1788
  /**
@@ -1942,7 +1929,9 @@ declare namespace Components {
1942
1929
  name?: TranslatedString;
1943
1930
  type: "priceDataRetrieval";
1944
1931
  /**
1932
+ * Deprecated. Prefer declaring a sibling `visualizationMetadata` hook on the same extension and returning `intervals` from its response — that way the supported intervals can vary per meter/contract.
1945
1933
  * Intervals supported by the API. If omitted, it is assumed that all intervals are supported.
1934
+ *
1946
1935
  */
1947
1936
  intervals?: ("PT15M" | "PT1H" | "P1D" | "P1M")[];
1948
1937
  auth?: PortalExtensionAuthBlock;
@@ -2042,6 +2031,68 @@ declare namespace Components {
2042
2031
  use_static_ips?: boolean;
2043
2032
  secure_proxy?: /* If set, requests are routed through the ERP Integration secure proxy. Mutually exclusive with use_static_ips. */ PortalExtensionSecureProxy;
2044
2033
  }
2034
+ /**
2035
+ * Hook that returns runtime metadata describing how a visualization (consumption / price / cost chart) should be rendered for a given portal context (meter, contract, etc). It is invoked by the portal before fetching data, with the same context the data hook would receive, so that the discovery shape can vary per meter/contract. The expected response to the call is:
2036
+ * - 200 with a JSON body of shape:
2037
+ * {
2038
+ * "type_options": [{ "id": "ht", "label": { "en": "High tariff" }, "aggregation_group": "consumption", "unit": "kWh" }, ...],
2039
+ * "intervals": ["PT15M", "PT1H", "P1D", "P1M"],
2040
+ * "data_range": { "from": "2024-01-01T00:00:00Z", "to": "2026-05-01T00:00:00Z" }
2041
+ * }
2042
+ * All fields are optional; the consumer falls back to its defaults for whatever the hook does not return.
2043
+ * The portal looks up this hook implicitly per extension (one `visualizationMetadata` hook per extension) — there is no need for a data-retrieval hook to reference it explicitly.
2044
+ *
2045
+ */
2046
+ export interface PortalExtensionHookVisualizationMetadata {
2047
+ /**
2048
+ * Identifier of the hook. Should not change between updates.
2049
+ */
2050
+ id: string; // ^[a-zA-Z0-9_-]+$
2051
+ name?: TranslatedString;
2052
+ type: "visualizationMetadata";
2053
+ auth?: PortalExtensionAuthBlock;
2054
+ call: {
2055
+ /**
2056
+ * HTTP method to use for the call
2057
+ */
2058
+ method?: string;
2059
+ /**
2060
+ * URL to call. Supports variable interpolation.
2061
+ */
2062
+ url: string;
2063
+ /**
2064
+ * Parameters to append to the URL. Supports variable interpolation.
2065
+ */
2066
+ params?: {
2067
+ [name: string]: string;
2068
+ };
2069
+ /**
2070
+ * Headers to use. Supports variable interpolation.
2071
+ */
2072
+ headers?: {
2073
+ [name: string]: string;
2074
+ };
2075
+ /**
2076
+ * Request body to send. Supports variable interpolation. Content format is determined by Content-Type header.
2077
+ */
2078
+ body?: {
2079
+ [name: string]: any;
2080
+ };
2081
+ };
2082
+ resolved?: {
2083
+ /**
2084
+ * Optional path to the metadata object in the response. If omitted, the metadata is assumed to be on the top level.
2085
+ */
2086
+ dataPath?: string;
2087
+ };
2088
+ /**
2089
+ * Deprecated. Prefer `secure_proxy` instead.
2090
+ * If true, requests are made from a set of static IP addresses and only allow connections to a set of allowed IP addresses. Get in touch with us to add your IP addresses.
2091
+ *
2092
+ */
2093
+ use_static_ips?: boolean;
2094
+ secure_proxy?: /* If set, requests are routed through the ERP Integration secure proxy. Mutually exclusive with use_static_ips. */ PortalExtensionSecureProxy;
2095
+ }
2045
2096
  export interface PortalExtensionSeamlessLink {
2046
2097
  /**
2047
2098
  * Identifier of the link. Should not change between updates.
@@ -3611,15 +3662,14 @@ export type PortalBlockSurfaceConfig = Components.Schemas.PortalBlockSurfaceConf
3611
3662
  export type PortalExtensionAuthBlock = Components.Schemas.PortalExtensionAuthBlock;
3612
3663
  export type PortalExtensionComponent = Components.Schemas.PortalExtensionComponent;
3613
3664
  export type PortalExtensionConfig = Components.Schemas.PortalExtensionConfig;
3614
- export type PortalExtensionHookConsumptionAggregationMethodOption = Components.Schemas.PortalExtensionHookConsumptionAggregationMethodOption;
3615
3665
  export type PortalExtensionHookConsumptionDataRetrieval = Components.Schemas.PortalExtensionHookConsumptionDataRetrieval;
3616
- export type PortalExtensionHookConsumptionOption = Components.Schemas.PortalExtensionHookConsumptionOption;
3617
3666
  export type PortalExtensionHookContractIdentification = Components.Schemas.PortalExtensionHookContractIdentification;
3618
3667
  export type PortalExtensionHookCostDataRetrieval = Components.Schemas.PortalExtensionHookCostDataRetrieval;
3619
3668
  export type PortalExtensionHookDataExport = Components.Schemas.PortalExtensionHookDataExport;
3620
3669
  export type PortalExtensionHookMeterReadingPlausibilityCheck = Components.Schemas.PortalExtensionHookMeterReadingPlausibilityCheck;
3621
3670
  export type PortalExtensionHookPriceDataRetrieval = Components.Schemas.PortalExtensionHookPriceDataRetrieval;
3622
3671
  export type PortalExtensionHookRegistrationIdentifiersCheck = Components.Schemas.PortalExtensionHookRegistrationIdentifiersCheck;
3672
+ export type PortalExtensionHookVisualizationMetadata = Components.Schemas.PortalExtensionHookVisualizationMetadata;
3623
3673
  export type PortalExtensionSeamlessLink = Components.Schemas.PortalExtensionSeamlessLink;
3624
3674
  export type PortalExtensionSecureProxy = Components.Schemas.PortalExtensionSecureProxy;
3625
3675
  export type Pricing = Components.Schemas.Pricing;
package/dist/openapi.json CHANGED
@@ -2611,7 +2611,8 @@
2611
2611
  "consumptionDataRetrieval": "#/components/schemas/PortalExtensionHookConsumptionDataRetrieval",
2612
2612
  "dataExport": "#/components/schemas/PortalExtensionHookDataExport",
2613
2613
  "costDataRetrieval": "#/components/schemas/PortalExtensionHookCostDataRetrieval",
2614
- "meterReadingPlausibilityCheck": "#/components/schemas/PortalExtensionHookMeterReadingPlausibilityCheck"
2614
+ "meterReadingPlausibilityCheck": "#/components/schemas/PortalExtensionHookMeterReadingPlausibilityCheck",
2615
+ "visualizationMetadata": "#/components/schemas/PortalExtensionHookVisualizationMetadata"
2615
2616
  }
2616
2617
  },
2617
2618
  "oneOf": [
@@ -2635,6 +2636,9 @@
2635
2636
  },
2636
2637
  {
2637
2638
  "$ref": "#/components/schemas/PortalExtensionHookMeterReadingPlausibilityCheck"
2639
+ },
2640
+ {
2641
+ "$ref": "#/components/schemas/PortalExtensionHookVisualizationMetadata"
2638
2642
  }
2639
2643
  ]
2640
2644
  }
@@ -2981,7 +2985,8 @@
2981
2985
  },
2982
2986
  "intervals": {
2983
2987
  "type": "array",
2984
- "description": "Intervals supported by the API. If omitted, it is assumed that all intervals are supported.",
2988
+ "deprecated": true,
2989
+ "description": "Deprecated. Prefer declaring a sibling `visualizationMetadata` hook on the same extension and returning `intervals` from its response — that way the supported intervals can vary per meter/contract.\nIntervals supported by the API. If omitted, it is assumed that all intervals are supported.\n",
2985
2990
  "items": {
2986
2991
  "type": "string",
2987
2992
  "enum": [
@@ -3081,7 +3086,8 @@
3081
3086
  },
3082
3087
  "intervals": {
3083
3088
  "type": "array",
3084
- "description": "Intervals supported by the API. If omitted, it is assumed that all intervals are supported.",
3089
+ "deprecated": true,
3090
+ "description": "Deprecated. Prefer declaring a sibling `visualizationMetadata` hook on the same extension and returning `intervals` from its response — that way the supported intervals can vary per meter/contract.\nIntervals supported by the API. If omitted, it is assumed that all intervals are supported.\n",
3085
3091
  "items": {
3086
3092
  "type": "string",
3087
3093
  "enum": [
@@ -3092,20 +3098,6 @@
3092
3098
  ]
3093
3099
  }
3094
3100
  },
3095
- "type_options": {
3096
- "type": "array",
3097
- "description": "Consumption types advertised by the hook (e.g. `ht`/`nt`, `feed-in`/`feed-out`). The `id` has to match the `type` field returned in the consumption response.\n",
3098
- "items": {
3099
- "$ref": "#/components/schemas/PortalExtensionHookConsumptionOption"
3100
- }
3101
- },
3102
- "aggregation_method_options": {
3103
- "type": "array",
3104
- "description": "Aggregation methods advertised by the hook (e.g. `sum`, `average`, `min`, `max`). The `id` has to match the `aggregation_method` field returned in the consumption response.\n",
3105
- "items": {
3106
- "$ref": "#/components/schemas/PortalExtensionHookConsumptionAggregationMethodOption"
3107
- }
3108
- },
3109
3101
  "auth": {
3110
3102
  "$ref": "#/components/schemas/PortalExtensionAuthBlock"
3111
3103
  },
@@ -3193,6 +3185,13 @@
3193
3185
  "dataExport"
3194
3186
  ]
3195
3187
  },
3188
+ "block_types": {
3189
+ "type": "array",
3190
+ "description": "Optional list of portal block types this hook supports. If omitted,\nthe hook is usable on any export-capable block. Allowed values match\nthe block type identifiers used by the portal builder\n(e.g. `consumption_visualization`, `dynamic_tariff`).\n",
3191
+ "items": {
3192
+ "type": "string"
3193
+ }
3194
+ },
3196
3195
  "auth": {
3197
3196
  "$ref": "#/components/schemas/PortalExtensionAuthBlock"
3198
3197
  },
@@ -3252,50 +3251,90 @@
3252
3251
  ],
3253
3252
  "additionalProperties": false
3254
3253
  },
3255
- "PortalExtensionHookConsumptionOption": {
3254
+ "PortalExtensionHookVisualizationMetadata": {
3255
+ "description": "Hook that returns runtime metadata describing how a visualization (consumption / price / cost chart) should be rendered for a given portal context (meter, contract, etc). It is invoked by the portal before fetching data, with the same context the data hook would receive, so that the discovery shape can vary per meter/contract. The expected response to the call is:\n - 200 with a JSON body of shape:\n {\n \"type_options\": [{ \"id\": \"ht\", \"label\": { \"en\": \"High tariff\" }, \"aggregation_group\": \"consumption\", \"unit\": \"kWh\" }, ...],\n \"intervals\": [\"PT15M\", \"PT1H\", \"P1D\", \"P1M\"],\n \"data_range\": { \"from\": \"2024-01-01T00:00:00Z\", \"to\": \"2026-05-01T00:00:00Z\" }\n }\n All fields are optional; the consumer falls back to its defaults for whatever the hook does not return.\nThe portal looks up this hook implicitly per extension (one `visualizationMetadata` hook per extension) — there is no need for a data-retrieval hook to reference it explicitly.\n",
3256
3256
  "type": "object",
3257
- "description": "A consumption type advertised by a consumption data retrieval hook.",
3258
3257
  "properties": {
3259
3258
  "id": {
3260
3259
  "type": "string",
3261
- "description": "Identifier of the option. Matches the `type` value returned by the hook (e.g. `ht`, `nt`, `feed-in`)."
3260
+ "pattern": "^[a-zA-Z0-9_-]+$",
3261
+ "description": "Identifier of the hook. Should not change between updates."
3262
3262
  },
3263
- "label": {
3263
+ "name": {
3264
3264
  "$ref": "#/components/schemas/TranslatedString"
3265
3265
  },
3266
- "aggregation_group": {
3267
- "type": "string",
3268
- "description": "Optional grouping key. Types sharing the same aggregation_group are interpreted as values that can be aggregated (e.g. ht/nt shown as a stacked bar chart - summed into total consumption per interval). Types in different groups — or types without a group — are not (e.g. feed-in vs feed-out shown as separate bars).\n",
3269
- "example": "consumption"
3270
- }
3271
- },
3272
- "required": [
3273
- "id",
3274
- "label"
3275
- ],
3276
- "additionalProperties": false
3277
- },
3278
- "PortalExtensionHookConsumptionAggregationMethodOption": {
3279
- "type": "object",
3280
- "description": "An aggregation method advertised by a consumption data retrieval hook.",
3281
- "properties": {
3282
- "id": {
3266
+ "type": {
3283
3267
  "type": "string",
3284
3268
  "enum": [
3285
- "sum",
3286
- "average",
3287
- "min",
3288
- "max"
3269
+ "visualizationMetadata"
3270
+ ]
3271
+ },
3272
+ "auth": {
3273
+ "$ref": "#/components/schemas/PortalExtensionAuthBlock"
3274
+ },
3275
+ "call": {
3276
+ "type": "object",
3277
+ "properties": {
3278
+ "method": {
3279
+ "type": "string",
3280
+ "description": "HTTP method to use for the call",
3281
+ "default": "GET"
3282
+ },
3283
+ "url": {
3284
+ "type": "string",
3285
+ "description": "URL to call. Supports variable interpolation."
3286
+ },
3287
+ "params": {
3288
+ "type": "object",
3289
+ "description": "Parameters to append to the URL. Supports variable interpolation.",
3290
+ "additionalProperties": {
3291
+ "type": "string"
3292
+ },
3293
+ "default": {}
3294
+ },
3295
+ "headers": {
3296
+ "type": "object",
3297
+ "description": "Headers to use. Supports variable interpolation.",
3298
+ "additionalProperties": {
3299
+ "type": "string"
3300
+ },
3301
+ "default": {}
3302
+ },
3303
+ "body": {
3304
+ "type": "object",
3305
+ "description": "Request body to send. Supports variable interpolation. Content format is determined by Content-Type header.",
3306
+ "additionalProperties": true
3307
+ }
3308
+ },
3309
+ "required": [
3310
+ "url"
3289
3311
  ],
3290
- "description": "Identifier of the option. Matches the `aggregation_method` value returned by the hook."
3312
+ "additionalProperties": false
3291
3313
  },
3292
- "label": {
3293
- "$ref": "#/components/schemas/TranslatedString"
3314
+ "resolved": {
3315
+ "type": "object",
3316
+ "properties": {
3317
+ "dataPath": {
3318
+ "type": "string",
3319
+ "description": "Optional path to the metadata object in the response. If omitted, the metadata is assumed to be on the top level."
3320
+ }
3321
+ },
3322
+ "additionalProperties": false
3323
+ },
3324
+ "use_static_ips": {
3325
+ "type": "boolean",
3326
+ "deprecated": true,
3327
+ "description": "Deprecated. Prefer `secure_proxy` instead.\nIf true, requests are made from a set of static IP addresses and only allow connections to a set of allowed IP addresses. Get in touch with us to add your IP addresses.\n",
3328
+ "default": false
3329
+ },
3330
+ "secure_proxy": {
3331
+ "$ref": "#/components/schemas/PortalExtensionSecureProxy"
3294
3332
  }
3295
3333
  },
3296
3334
  "required": [
3297
3335
  "id",
3298
- "label"
3336
+ "type",
3337
+ "call"
3299
3338
  ],
3300
3339
  "additionalProperties": false
3301
3340
  },
@@ -3319,7 +3358,8 @@
3319
3358
  },
3320
3359
  "intervals": {
3321
3360
  "type": "array",
3322
- "description": "Intervals supported by the API. If omitted, it is assumed that all intervals are supported.",
3361
+ "deprecated": true,
3362
+ "description": "Deprecated. Prefer declaring a sibling `visualizationMetadata` hook on the same extension and returning `intervals` from its response — that way the supported intervals can vary per meter/contract.\nIntervals supported by the API. If omitted, it is assumed that all intervals are supported.\n",
3323
3363
  "items": {
3324
3364
  "type": "string",
3325
3365
  "enum": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/app-client",
3
- "version": "0.12.5",
3
+ "version": "0.12.6",
4
4
  "description": "JavaScript client library for the epilot App API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",