@epilot/cli 0.1.143 → 0.1.145

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/README.md CHANGED
@@ -29,7 +29,7 @@ npm install -g @epilot/cli
29
29
 
30
30
  <!-- usage-help -->
31
31
  ```
32
- epilot v0.1.143 — CLI for epilot APIs
32
+ epilot v0.1.145 — CLI for epilot APIs
33
33
 
34
34
  USAGE
35
35
  epilot <api> <operationId> [params...] [flags]
@@ -1150,6 +1150,9 @@
1150
1150
  "description": "Target version to create"
1151
1151
  }
1152
1152
  ],
1153
+ "requestBody": {
1154
+ "$ref": "#/components/requestBodies/CloneVersionRequest"
1155
+ },
1153
1156
  "responses": {
1154
1157
  "201": {
1155
1158
  "description": "New version created successfully",
@@ -1902,6 +1905,28 @@
1902
1905
  "$ref": "#/components/schemas/Options"
1903
1906
  },
1904
1907
  "description": "Replaces the full set of app-level option declarations for this version.\nOption keys must be unique app-wide; `secret`-touching options are always\nsensitive and must not declare `sensitive: false`.\n"
1908
+ },
1909
+ "changelog": {
1910
+ "type": "string",
1911
+ "maxLength": 250,
1912
+ "description": "Short description of what changed in this version"
1913
+ }
1914
+ }
1915
+ }
1916
+ }
1917
+ }
1918
+ },
1919
+ "CloneVersionRequest": {
1920
+ "required": false,
1921
+ "content": {
1922
+ "application/json": {
1923
+ "schema": {
1924
+ "type": "object",
1925
+ "properties": {
1926
+ "changelog": {
1927
+ "type": "string",
1928
+ "maxLength": 250,
1929
+ "description": "Short description of what the new version will change"
1905
1930
  }
1906
1931
  }
1907
1932
  }
@@ -2009,7 +2034,7 @@
2009
2034
  },
2010
2035
  "Options": {
2011
2036
  "type": "object",
2012
- "description": "Options for the component configuration",
2037
+ "description": "An option declaration — a setting the installing org fills in. Declared at app level.",
2013
2038
  "required": [
2014
2039
  "key",
2015
2040
  "type"
@@ -2058,7 +2083,7 @@
2058
2083
  },
2059
2084
  "sensitive": {
2060
2085
  "type": "boolean",
2061
- "description": "Write-only, server-side only value — like a sensitive environment variable\n(app-level options only). Sensitive values are never serialized in any response;\nthey are resolvable only via server-side channels (API proxy injection, function\n`secrets` allowlist, the internal options/resolve endpoint). Non-sensitive values\nare readable wherever the app runs, including the end-customer browser (journey and\nportal runtime). Forced to true for `secret`-touching options. Default: false.\n"
2086
+ "description": "Write-only, server-side only value — like a sensitive environment variable\n(app-level options only). Sensitive values are never serialized in any response;\nthey are resolvable only via server-side channels (API proxy injection, function\nruns, the internal options/resolve endpoint). Non-sensitive values\nare readable wherever the app runs, including the end-customer browser (journey and\nportal runtime). Forced to true for `secret`-touching options. Default: false.\n"
2062
2087
  },
2063
2088
  "configured": {
2064
2089
  "type": "boolean",
@@ -2179,6 +2204,7 @@
2179
2204
  "EXTERNAL_PRODUCT_CATALOG",
2180
2205
  "CUSTOM_PAGE",
2181
2206
  "API_PROXY",
2207
+ "EXTERNAL_VALUES",
2182
2208
  "APP_FUNCTION"
2183
2209
  ],
2184
2210
  "description": "Type of app component"
@@ -2375,7 +2401,8 @@
2375
2401
  "CUSTOM_CAPABILITY": "#/components/schemas/CustomCapabilityComponent",
2376
2402
  "EXTERNAL_PRODUCT_CATALOG": "#/components/schemas/ExternalProductCatalogComponent",
2377
2403
  "CUSTOM_PAGE": "#/components/schemas/CustomPageComponent",
2378
- "API_PROXY": "#/components/schemas/ApiProxyComponent"
2404
+ "API_PROXY": "#/components/schemas/ApiProxyComponent",
2405
+ "EXTERNAL_VALUES": "#/components/schemas/ExternalValuesComponent"
2379
2406
  }
2380
2407
  },
2381
2408
  "oneOf": [
@@ -2405,6 +2432,9 @@
2405
2432
  },
2406
2433
  {
2407
2434
  "$ref": "#/components/schemas/ApiProxyComponent"
2435
+ },
2436
+ {
2437
+ "$ref": "#/components/schemas/ExternalValuesComponent"
2408
2438
  }
2409
2439
  ]
2410
2440
  }
@@ -2428,6 +2458,25 @@
2428
2458
  }
2429
2459
  }
2430
2460
  },
2461
+ "ExternalValuesComponent": {
2462
+ "type": "object",
2463
+ "description": "Exposes typed values resolved from an external system at runtime (e.g. a meter reading prediction). Consumers such as validation rules reference a hook and one of its results by id. Resolution is performed by the external-values-api on behalf of authenticated epilot 360 users and portal end customers.\n",
2464
+ "required": [
2465
+ "component_type",
2466
+ "configuration"
2467
+ ],
2468
+ "properties": {
2469
+ "component_type": {
2470
+ "type": "string",
2471
+ "enum": [
2472
+ "EXTERNAL_VALUES"
2473
+ ]
2474
+ },
2475
+ "configuration": {
2476
+ "$ref": "#/components/schemas/ExternalValuesConfig"
2477
+ }
2478
+ }
2479
+ },
2431
2480
  "CustomCapabilityComponent": {
2432
2481
  "type": "object",
2433
2482
  "required": [
@@ -3667,7 +3716,7 @@
3667
3716
  "additionalProperties": false
3668
3717
  },
3669
3718
  "PortalExtensionHookVisualizationMetadata": {
3670
- "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\": [\n { \"id\": \"ht\", \"label\": { \"en\": \"High tariff\" }, \"aggregation_group\": \"consumption\", \"statistical_method\": \"sum\", \"unit\": \"kWh\", \"color\": \"primary\", \"precision\": 2 },\n ...\n ],\n \"intervals\": [\"PT15M\", \"PT1H\", \"P1D\", \"P1M\"],\n \"data_range\": { \"from\": \"2024-01-01T00:00:00Z\", \"to\": \"2026-05-01T00:00:00Z\" }\n }\n Each type option carries its own `statistical_method`, which describes the method already applied to that type's data and dictates the chart shape: `sum` is rendered as a bar chart; `min`, `average`, and `max` are rendered as a line chart. A single visualization can therefore mix bar-shaped types with line-shaped types. Defaults to `sum` when omitted.\n Each type option may also customize its rendering: `color` picks a Spark palette color (`primary`, `slate`, `mauve`, `orange`, `red`, `tomato`, `amber`, `green`, `blue`) used to draw the type's series; `precision` sets the number of decimal places to show for that type's values (axis labels, tooltips, summaries). Both are optional — the consumer falls back to its own defaults when they are omitted.\n `aggregation_group` controls how types within a group are visually combined (depends on the per-type `statistical_method`):\n - bar chart (`sum`): same-group types are stacked into a single bar (e.g. ht/nt summed into total consumption); different-group types render side-by-side.\n - line chart (`min` / `average` / `max`): same-group types are rendered as an area chart; different-group types render as separate lines.\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",
3719
+ "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\": [\n { \"id\": \"ht\", \"label\": { \"en\": \"High tariff\" }, \"aggregation_group\": \"consumption\", \"statistical_method\": \"sum\", \"unit\": \"kWh\", \"color\": \"primary\", \"precision\": 2 },\n ...\n ],\n \"intervals\": [\"PT15M\", \"PT1H\", \"P1D\", \"P1M\", \"P1Y\"],\n \"data_range\": { \"from\": \"2024-01-01T00:00:00Z\", \"to\": \"2026-05-01T00:00:00Z\" }\n }\n Each type option carries its own `statistical_method`, which describes the method already applied to that type's data and dictates the chart shape: `sum` is rendered as a bar chart; `min`, `average`, and `max` are rendered as a line chart. A single visualization can therefore mix bar-shaped types with line-shaped types. Defaults to `sum` when omitted.\n Each type option may also customize its rendering: `color` picks a Spark palette color (`primary`, `slate`, `mauve`, `orange`, `red`, `tomato`, `amber`, `green`, `blue`) used to draw the type's series; `precision` sets the number of decimal places to show for that type's values (axis labels, tooltips, summaries). Both are optional — the consumer falls back to its own defaults when they are omitted.\n `aggregation_group` controls how types within a group are visually combined (depends on the per-type `statistical_method`):\n - bar chart (`sum`): same-group types are stacked into a single bar (e.g. ht/nt summed into total consumption); different-group types render side-by-side.\n - line chart (`min` / `average` / `max`): same-group types are rendered as an area chart; different-group types render as separate lines.\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",
3671
3720
  "type": "object",
3672
3721
  "properties": {
3673
3722
  "id": {
@@ -5082,6 +5131,204 @@
5082
5131
  }
5083
5132
  }
5084
5133
  },
5134
+ "ExternalValuesConfig": {
5135
+ "type": "object",
5136
+ "description": "Configuration for an EXTERNAL_VALUES component",
5137
+ "required": [
5138
+ "hooks"
5139
+ ],
5140
+ "properties": {
5141
+ "hooks": {
5142
+ "type": "array",
5143
+ "description": "Hooks exposed by this component. Hook ids must be unique within the component.",
5144
+ "items": {
5145
+ "$ref": "#/components/schemas/ExternalValuesHook"
5146
+ }
5147
+ }
5148
+ }
5149
+ },
5150
+ "ExternalValuesHook": {
5151
+ "type": "object",
5152
+ "description": "One external call that returns one or more typed results. Interpolated templates (Liquid) have access to `Input`, `Context`, `Consumer`, `Options`, `Env` and — for `result` templates — `Response` and `AuthResponse`.\n",
5153
+ "required": [
5154
+ "id",
5155
+ "name",
5156
+ "call",
5157
+ "result"
5158
+ ],
5159
+ "properties": {
5160
+ "id": {
5161
+ "type": "string",
5162
+ "pattern": "^[a-zA-Z0-9_-]{1,100}$",
5163
+ "description": "Stable identifier; consumers (e.g. validation rules) reference it. Renaming breaks references."
5164
+ },
5165
+ "name": {
5166
+ "$ref": "#/components/schemas/TranslatedString"
5167
+ },
5168
+ "description": {
5169
+ "$ref": "#/components/schemas/TranslatedString"
5170
+ },
5171
+ "auth_type": {
5172
+ "type": "string",
5173
+ "enum": [
5174
+ "none",
5175
+ "header",
5176
+ "bearer",
5177
+ "hmac"
5178
+ ],
5179
+ "default": "none",
5180
+ "description": "Static request authentication applied to the call.\n- `none`: no static authentication.\n- `header`: sends `auth_secret` in header `auth_header` (default `X-API-Key`).\n- `bearer`: sends `Authorization: Bearer <auth_secret>`.\n- `hmac`: signs the request per Standard Webhooks (headers `webhook-id`,\n `webhook-timestamp`, `webhook-signature` = `v1,<base64 HMAC-SHA256>` over\n `<id>.<timestamp>.<body>`) using `auth_secret` as a `whsec_`-prefixed\n base64 secret, exactly as epilot webhooks do.\n\n`auth_secret` is required when `auth_type` is `header`, `bearer` or `hmac`.\nCombine with `auth` (a pre-call that fetches a token) when the target needs both.\n"
5181
+ },
5182
+ "auth_header": {
5183
+ "type": "string",
5184
+ "description": "Header name used when `auth_type` is `header`. Defaults to `X-API-Key`."
5185
+ },
5186
+ "auth_secret": {
5187
+ "type": "string",
5188
+ "description": "Liquid template resolving to the secret, e.g. \"{{Options.api_key}}\". Must reference an option declared with `type: secret`; literals are rejected. Required when `auth_type` is `header`, `bearer` or `hmac`.",
5189
+ "example": "{{Options.api_key}}"
5190
+ },
5191
+ "auth": {
5192
+ "$ref": "#/components/schemas/PortalExtensionAuthBlock"
5193
+ },
5194
+ "call": {
5195
+ "type": "object",
5196
+ "required": [
5197
+ "url"
5198
+ ],
5199
+ "properties": {
5200
+ "method": {
5201
+ "type": "string",
5202
+ "enum": [
5203
+ "GET",
5204
+ "POST",
5205
+ "PUT",
5206
+ "PATCH"
5207
+ ],
5208
+ "default": "POST",
5209
+ "description": "HTTP method to use for the call"
5210
+ },
5211
+ "url": {
5212
+ "type": "string",
5213
+ "description": "URL to call. Supports variable interpolation."
5214
+ },
5215
+ "headers": {
5216
+ "type": "object",
5217
+ "description": "Headers to send with the call. Supports variable interpolation.",
5218
+ "additionalProperties": {
5219
+ "type": "string"
5220
+ }
5221
+ },
5222
+ "params": {
5223
+ "type": "object",
5224
+ "description": "Query parameters to append to the URL. Supports variable interpolation.",
5225
+ "additionalProperties": {
5226
+ "type": "string"
5227
+ }
5228
+ },
5229
+ "body": {
5230
+ "type": "object",
5231
+ "description": "JSON body to send. Values support variable interpolation. When omitted, `{ Input, Context, Consumer }` is sent as-is.",
5232
+ "additionalProperties": true
5233
+ }
5234
+ }
5235
+ },
5236
+ "result": {
5237
+ "type": "array",
5238
+ "minItems": 1,
5239
+ "description": "Typed results extracted from the response. Result ids must be unique within the hook.",
5240
+ "items": {
5241
+ "$ref": "#/components/schemas/ExternalValuesResult"
5242
+ }
5243
+ },
5244
+ "timeout_ms": {
5245
+ "type": "integer",
5246
+ "minimum": 500,
5247
+ "maximum": 5000,
5248
+ "default": 3000,
5249
+ "description": "Timeout for the external call in milliseconds."
5250
+ },
5251
+ "on_unavailable": {
5252
+ "type": "string",
5253
+ "enum": [
5254
+ "skip",
5255
+ "block"
5256
+ ],
5257
+ "default": "skip",
5258
+ "description": "Behaviour when the external system is unavailable (timeout, network or upstream error). `skip`: consumers ignore conditions depending on this hook. `block`: consumers treat the dependent action as not allowed."
5259
+ },
5260
+ "cache": {
5261
+ "type": "object",
5262
+ "description": "Response caching. Off when omitted.",
5263
+ "required": [
5264
+ "ttl_seconds"
5265
+ ],
5266
+ "properties": {
5267
+ "ttl_seconds": {
5268
+ "type": "integer",
5269
+ "minimum": 0,
5270
+ "maximum": 3600,
5271
+ "description": "Time to live in seconds. 0 disables caching."
5272
+ },
5273
+ "key": {
5274
+ "type": "string",
5275
+ "description": "Liquid template for the cache key. Defaults to a hash of org, app, hook, `Input` and `Context`."
5276
+ }
5277
+ }
5278
+ },
5279
+ "use_static_ips": {
5280
+ "type": "boolean",
5281
+ "description": "If set, requests are sent from epilot's static egress IPs. Mutually exclusive with secure_proxy."
5282
+ },
5283
+ "secure_proxy": {
5284
+ "$ref": "#/components/schemas/PortalExtensionSecureProxy"
5285
+ }
5286
+ }
5287
+ },
5288
+ "ExternalValuesResult": {
5289
+ "type": "object",
5290
+ "description": "A single typed value extracted from the hook response. Exactly one of `template`, `path` or `jsonata` must be set.\n",
5291
+ "required": [
5292
+ "id",
5293
+ "type",
5294
+ "name"
5295
+ ],
5296
+ "properties": {
5297
+ "id": {
5298
+ "type": "string",
5299
+ "pattern": "^[a-zA-Z0-9_-]{1,100}$",
5300
+ "description": "Stable identifier of the result within the hook. Renaming breaks references."
5301
+ },
5302
+ "type": {
5303
+ "type": "string",
5304
+ "enum": [
5305
+ "number",
5306
+ "text",
5307
+ "date",
5308
+ "boolean"
5309
+ ],
5310
+ "description": "Type the extracted value is coerced to."
5311
+ },
5312
+ "name": {
5313
+ "$ref": "#/components/schemas/TranslatedString"
5314
+ },
5315
+ "template": {
5316
+ "type": "string",
5317
+ "description": "Liquid template over `Response` etc.; output coerced to `type`.",
5318
+ "example": "{{Response.value}}"
5319
+ },
5320
+ "path": {
5321
+ "type": "string",
5322
+ "description": "Dot path into the response body, e.g. \"data.limit\".",
5323
+ "example": "data.limit"
5324
+ },
5325
+ "jsonata": {
5326
+ "type": "string",
5327
+ "description": "JSONata expression over `{ Response, Input, Context, Options, Env }`.",
5328
+ "example": "$sum(Response.items.amount)"
5329
+ }
5330
+ }
5331
+ },
5085
5332
  "Grants": {
5086
5333
  "type": "array",
5087
5334
  "description": "Required grants for the app in order to call APIs for the installing tenant",