@epilot/app-client 0.15.0 → 0.17.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.
@@ -1 +1 @@
1
- (()=>{"use strict";var e={438(e,r,t){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});var o=n(t(466));r.default=o.default},466(e){e.exports=JSON.parse('{"openapi":"3.1.0","info":{"title":"","version":""},"servers":[{"url":"https://app.sls.epilot.io"}],"paths":{"/v1/public/app/{appId}/components/{componentId}":{"parameters":[{"name":"appId","in":"path","required":true,"description":"ID of the app configuration to install"},{"name":"componentId","in":"path","required":true,"description":"ID of the component to retrieve"}],"get":{"operationId":"getPublicFacingComponent","responses":{}}},"/v1/app-configurations":{"get":{"operationId":"listConfigurations","parameters":[{"name":"page","in":"query"},{"name":"pageSize","in":"query"}],"responses":{}},"post":{"operationId":"createConfiguration","requestBody":{"$ref":"#/components/requestBodies/CreateConfigRequest"},"responses":{}}},"/v1/app-configurations/public":{"get":{"operationId":"listPublicConfigurations","parameters":[{"name":"page","in":"query"},{"name":"pageSize","in":"query"}],"responses":{}}},"/v1/app-configurations/public/{appId}":{"parameters":[{"name":"appId","in":"path","required":true,"description":"ID of the app configuration to install"}],"get":{"operationId":"getPublicConfiguration","parameters":[{"name":"version","in":"query"}],"responses":{}}},"/v1/app-configurations/{appId}":{"parameters":[{"name":"appId","in":"path","required":true,"description":"ID of the app configuration"}],"get":{"operationId":"getConfiguration","parameters":[{"name":"version","in":"query"}],"responses":{}},"patch":{"operationId":"patchMetadata","requestBody":{"$ref":"#/components/requestBodies/PatchConfigMetadataRequest"},"responses":{}},"delete":{"operationId":"deleteConfiguration","responses":{}}},"/v1/app-configurations/{appId}/events":{"post":{"operationId":"queryEvents","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/app-configurations/{appId}/bundle":{"post":{"operationId":"createBundleUploadUrl","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/CreateBundlePresignedRequest"},"responses":{}}},"/v1/app-configurations/{appId}/zip":{"post":{"operationId":"createZipUploadUrl","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/app-configurations/{appId}/logo":{"parameters":[{"name":"appId","in":"path","required":true,"description":"ID of the app configuration"}],"post":{"operationId":"createLogoUploadUrl","requestBody":{"$ref":"#/components/requestBodies/CreateLogoPresignedRequest"},"responses":{}},"delete":{"operationId":"deleteLogo","responses":{}}},"/v1/app-configurations/{appId}/versions":{"get":{"operationId":"listVersions","parameters":[{"name":"appId","in":"path","required":true},{"name":"page","in":"query"},{"name":"pageSize","in":"query"}],"responses":{}}},"/v1/app-configurations/{appId}/versions/{version}":{"get":{"operationId":"getVersion","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"responses":{}},"delete":{"operationId":"deleteVersion","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"responses":{}},"patch":{"operationId":"patchVersion","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/PatchVersionRequest"},"responses":{}}},"/v1/app-configurations/{appId}/versions/{version}/review":{"get":{"operationId":"getReview","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"responses":{}},"post":{"operationId":"createReview","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/CreateReviewRequest"},"responses":{}}},"/v1/app-configurations/{appId}/versions/{version}/components":{"post":{"operationId":"createComponent","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/UpsertComponentRequest"},"responses":{}}},"/v1/app-configurations/{appId}/versions/{version}/components/{componentId}":{"patch":{"operationId":"patchComponent","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true},{"name":"componentId","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/UpsertComponentRequest"},"responses":{}},"delete":{"operationId":"deleteComponent","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true},{"name":"componentId","in":"path","required":true}],"responses":{}}},"/v1/app-configurations/{appId}/versions/{sourceVersion}/clone-to/{targetVersion}":{"post":{"operationId":"cloneVersion","parameters":[{"name":"appId","in":"path","required":true},{"name":"sourceVersion","in":"path","required":true},{"name":"targetVersion","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/CloneVersionRequest"},"responses":{}}},"/v1/app":{"get":{"operationId":"listInstallations","parameters":[{"name":"componentType","in":"query"},{"name":"enabled","in":"query"},{"name":"page","in":"query"},{"name":"pageSize","in":"query"}],"responses":{}}},"/v1/app/{appId}":{"get":{"operationId":"getInstallation","parameters":[{"name":"appId","in":"path","required":true}],"responses":{}},"post":{"operationId":"install","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/InstallRequest"},"responses":{}},"patch":{"operationId":"patchInstallation","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/InstallRequest"},"responses":{}},"delete":{"operationId":"uninstall","parameters":[{"name":"appId","in":"path","required":true}],"responses":{}}},"/v1/app/{appId}/promote-to/{version}":{"post":{"operationId":"promoteVersion","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"responses":{}}},"/v1/app/{appId}/options/resolve":{"post":{"operationId":"resolveOptions","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/app-events":{"post":{"operationId":"ingestEvent","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/public/app/{appId}/proxy/{proxyName}/{path}":{"parameters":[{"name":"appId","in":"path","required":true,"description":"ID of the installed app"},{"name":"proxyName","in":"path","required":true,"description":"Name of the proxy target as defined in the app manifest"},{"name":"path","in":"path","required":true,"description":"Path to forward to the proxy target"},{"name":"query","in":"query","required":false,"style":"form","explode":true,"description":"Free-form query parameters, forwarded unchanged to the proxy target"}],"get":{"operationId":"publicProxyGet","responses":{}},"post":{"operationId":"publicProxyPost","requestBody":{"content":{"application/json":{}}},"responses":{}},"put":{"operationId":"publicProxyPut","requestBody":{"content":{"application/json":{}}},"responses":{}},"patch":{"operationId":"publicProxyPatch","requestBody":{"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"publicProxyDelete","responses":{}}}},"components":{"requestBodies":{"CreateReviewRequest":{"required":true,"content":{"application/json":{}}},"CreateLogoPresignedRequest":{"required":true,"content":{"application/json":{}}},"CreateBundlePresignedRequest":{"required":true,"content":{"application/json":{}}},"PatchConfigMetadataRequest":{"required":true,"content":{"application/json":{}}},"PatchVersionRequest":{"required":true,"content":{"application/json":{}}},"CloneVersionRequest":{"required":false,"content":{"application/json":{}}},"UpsertComponentRequest":{"required":true,"content":{"application/json":{}}},"CreateConfigRequest":{"required":true,"content":{"application/json":{}}},"InstallRequest":{"content":{"application/json":{}}}}}}')}},r={},t=function t(n){var o=r[n];if(void 0!==o)return o.exports;var p=r[n]={exports:{}};return e[n].call(p.exports,p,p.exports,t),p.exports}(438),n=exports;for(var o in t)n[o]=t[o];t.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
1
+ (()=>{"use strict";var e={438(e,r,t){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});var o=n(t(466));r.default=o.default},466(e){e.exports=JSON.parse('{"openapi":"3.1.0","info":{"title":"","version":""},"servers":[{"url":"https://app.sls.epilot.io"}],"paths":{"/v1/public/app/{appId}/components/{componentId}":{"parameters":[{"name":"appId","in":"path","required":true,"description":"ID of the app configuration to install"},{"name":"componentId","in":"path","required":true,"description":"ID of the component to retrieve"}],"get":{"operationId":"getPublicFacingComponent","responses":{}}},"/v1/app-configurations":{"get":{"operationId":"listConfigurations","parameters":[{"name":"page","in":"query"},{"name":"pageSize","in":"query"}],"responses":{}},"post":{"operationId":"createConfiguration","requestBody":{"$ref":"#/components/requestBodies/CreateConfigRequest"},"responses":{}}},"/v1/app-configurations/public":{"get":{"operationId":"listPublicConfigurations","parameters":[{"name":"page","in":"query"},{"name":"pageSize","in":"query"}],"responses":{}}},"/v1/app-configurations/public/{appId}":{"parameters":[{"name":"appId","in":"path","required":true,"description":"ID of the app configuration to install"}],"get":{"operationId":"getPublicConfiguration","parameters":[{"name":"version","in":"query"}],"responses":{}}},"/v1/app-configurations/{appId}":{"parameters":[{"name":"appId","in":"path","required":true,"description":"ID of the app configuration"}],"get":{"operationId":"getConfiguration","parameters":[{"name":"version","in":"query"}],"responses":{}},"patch":{"operationId":"patchMetadata","requestBody":{"$ref":"#/components/requestBodies/PatchConfigMetadataRequest"},"responses":{}},"delete":{"operationId":"deleteConfiguration","responses":{}}},"/v1/app-configurations/{appId}/events":{"post":{"operationId":"queryEvents","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/app-configurations/{appId}/bundle":{"post":{"operationId":"createBundleUploadUrl","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/CreateBundlePresignedRequest"},"responses":{}}},"/v1/app-configurations/{appId}/zip":{"post":{"operationId":"createZipUploadUrl","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/app-configurations/{appId}/logo":{"parameters":[{"name":"appId","in":"path","required":true,"description":"ID of the app configuration"}],"post":{"operationId":"createLogoUploadUrl","requestBody":{"$ref":"#/components/requestBodies/CreateLogoPresignedRequest"},"responses":{}},"delete":{"operationId":"deleteLogo","responses":{}}},"/v1/app-configurations/{appId}/versions":{"get":{"operationId":"listVersions","parameters":[{"name":"appId","in":"path","required":true},{"name":"page","in":"query"},{"name":"pageSize","in":"query"}],"responses":{}}},"/v1/app-configurations/{appId}/versions/{version}":{"get":{"operationId":"getVersion","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"responses":{}},"delete":{"operationId":"deleteVersion","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"responses":{}},"patch":{"operationId":"patchVersion","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/PatchVersionRequest"},"responses":{}}},"/v1/app-configurations/{appId}/versions/{version}/review":{"get":{"operationId":"getReview","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"responses":{}},"post":{"operationId":"createReview","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/CreateReviewRequest"},"responses":{}}},"/v1/app-configurations/{appId}/versions/{version}/components":{"post":{"operationId":"createComponent","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/UpsertComponentRequest"},"responses":{}}},"/v1/app-configurations/{appId}/versions/{version}/components/{componentId}":{"patch":{"operationId":"patchComponent","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true},{"name":"componentId","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/UpsertComponentRequest"},"responses":{}},"delete":{"operationId":"deleteComponent","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true},{"name":"componentId","in":"path","required":true}],"responses":{}}},"/v1/app-configurations/{appId}/versions/{sourceVersion}/clone-to/{targetVersion}":{"post":{"operationId":"cloneVersion","parameters":[{"name":"appId","in":"path","required":true},{"name":"sourceVersion","in":"path","required":true},{"name":"targetVersion","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/CloneVersionRequest"},"responses":{}}},"/v1/app":{"get":{"operationId":"listInstallations","parameters":[{"name":"componentType","in":"query"},{"name":"enabled","in":"query"},{"name":"page","in":"query"},{"name":"pageSize","in":"query"}],"responses":{}}},"/v1/app/{appId}":{"get":{"operationId":"getInstallation","parameters":[{"name":"appId","in":"path","required":true}],"responses":{}},"post":{"operationId":"install","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/InstallRequest"},"responses":{}},"patch":{"operationId":"patchInstallation","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/InstallRequest"},"responses":{}},"delete":{"operationId":"uninstall","parameters":[{"name":"appId","in":"path","required":true}],"responses":{}}},"/v1/app/{appId}/promote-to/{version}":{"post":{"operationId":"promoteVersion","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"responses":{}}},"/v1/app/{appId}/options/resolve":{"post":{"operationId":"resolveOptions","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/app-events":{"post":{"operationId":"ingestEvent","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/public/app/{appId}/proxy/{proxyName}/{path}":{"parameters":[{"name":"appId","in":"path","required":true,"description":"ID of the installed app"},{"name":"proxyName","in":"path","required":true,"description":"Name of the proxy target as defined in the app manifest"},{"name":"path","in":"path","required":true,"description":"Path to forward to the proxy target"},{"name":"query","in":"query","required":false,"style":"form","explode":true,"description":"Free-form query parameters, forwarded unchanged to the proxy target"}],"get":{"operationId":"publicProxyGet","responses":{}},"post":{"operationId":"publicProxyPost","requestBody":{"content":{"application/json":{}}},"responses":{}},"put":{"operationId":"publicProxyPut","requestBody":{"content":{"application/json":{}}},"responses":{}},"patch":{"operationId":"publicProxyPatch","requestBody":{"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"publicProxyDelete","responses":{}}}},"components":{"requestBodies":{"CreateReviewRequest":{"required":true,"content":{"application/json":{}}},"CreateLogoPresignedRequest":{"required":true,"content":{"application/json":{}}},"CreateBundlePresignedRequest":{"required":true,"content":{"application/json":{}}},"PatchConfigMetadataRequest":{"required":true,"content":{"application/json":{}}},"PatchVersionRequest":{"required":true,"content":{"application/json":{}}},"CloneVersionRequest":{"required":false,"content":{"application/json":{}}},"UpsertComponentRequest":{"required":true,"content":{"application/json":{}}},"CreateConfigRequest":{"required":true,"content":{"application/json":{}}},"InstallRequest":{"required":true,"content":{"application/json":{}}}}}}')}},r={},t=function t(n){var o=r[n];if(void 0!==o)return o.exports;var p=r[n]={exports:{}};return e[n].call(p.exports,p,p.exports,t),p.exports}(438),n=exports;for(var o in t)n[o]=t[o];t.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
@@ -166,6 +166,7 @@
166
166
  }
167
167
  ],
168
168
  "requestBody": {
169
+ "required": true,
169
170
  "content": {
170
171
  "application/json": {}
171
172
  }
@@ -640,6 +641,7 @@
640
641
  }
641
642
  },
642
643
  "InstallRequest": {
644
+ "required": true,
643
645
  "content": {
644
646
  "application/json": {}
645
647
  }
package/dist/openapi.d.ts CHANGED
@@ -314,7 +314,11 @@ declare namespace Components {
314
314
  surfaces?: {
315
315
  [key: string]: any;
316
316
  };
317
- } & (JourneyBlockComponent | PortalBlockComponent | PortalExtensionComponent | CustomFlowActionComponent | ErpInformToolkitComponent | CustomCapabilityComponent | ExternalProductCatalogComponent | CustomPageComponent | ApiProxyComponent);
317
+ } & (JourneyBlockComponent | PortalBlockComponent | PortalExtensionComponent | CustomFlowActionComponent | ErpInformToolkitComponent | CustomCapabilityComponent | ExternalProductCatalogComponent | CustomPageComponent | ApiProxyComponent | /**
318
+ * 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.
319
+ *
320
+ */
321
+ ExternalValuesComponent);
318
322
  export interface BaseComponentCommon {
319
323
  /**
320
324
  * Unique identifier for the component
@@ -547,7 +551,7 @@ declare namespace Components {
547
551
  /**
548
552
  * Type of app component
549
553
  */
550
- export type ComponentType = "CUSTOM_JOURNEY_BLOCK" | "CUSTOM_PORTAL_BLOCK" | "PORTAL_EXTENSION" | "CUSTOM_FLOW_ACTION" | "ERP_INFORM_TOOLKIT" | "CUSTOM_CAPABILITY" | "EXTERNAL_PRODUCT_CATALOG" | "CUSTOM_PAGE" | "API_PROXY" | "APP_FUNCTION";
554
+ export type ComponentType = "CUSTOM_JOURNEY_BLOCK" | "CUSTOM_PORTAL_BLOCK" | "PORTAL_EXTENSION" | "CUSTOM_FLOW_ACTION" | "ERP_INFORM_TOOLKIT" | "CUSTOM_CAPABILITY" | "EXTERNAL_PRODUCT_CATALOG" | "CUSTOM_PAGE" | "API_PROXY" | "EXTERNAL_VALUES" | "APP_FUNCTION";
551
555
  /**
552
556
  * Configuration of the published app
553
557
  */
@@ -1264,6 +1268,163 @@ declare namespace Components {
1264
1268
  };
1265
1269
  };
1266
1270
  }
1271
+ /**
1272
+ * 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.
1273
+ *
1274
+ */
1275
+ export interface ExternalValuesComponent {
1276
+ component_type: "EXTERNAL_VALUES";
1277
+ configuration: /* Configuration for an EXTERNAL_VALUES component */ ExternalValuesConfig;
1278
+ }
1279
+ /**
1280
+ * Configuration for an EXTERNAL_VALUES component
1281
+ */
1282
+ export interface ExternalValuesConfig {
1283
+ /**
1284
+ * Hooks exposed by this component. Hook ids must be unique within the component.
1285
+ */
1286
+ hooks: /**
1287
+ * 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`.
1288
+ *
1289
+ */
1290
+ ExternalValuesHook[];
1291
+ }
1292
+ /**
1293
+ * 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`.
1294
+ *
1295
+ */
1296
+ export interface ExternalValuesHook {
1297
+ /**
1298
+ * Stable identifier; consumers (e.g. validation rules) reference it. Renaming breaks references.
1299
+ */
1300
+ id: string; // ^[a-zA-Z0-9_-]{1,100}$
1301
+ name: TranslatedString;
1302
+ description?: TranslatedString;
1303
+ /**
1304
+ * Static request authentication applied to the call.
1305
+ * - `none`: no static authentication.
1306
+ * - `header`: sends `auth_secret` in header `auth_header` (default `X-API-Key`).
1307
+ * - `bearer`: sends `Authorization: Bearer <auth_secret>`.
1308
+ * - `hmac`: signs the request per Standard Webhooks (headers `webhook-id`,
1309
+ * `webhook-timestamp`, `webhook-signature` = `v1,<base64 HMAC-SHA256>` over
1310
+ * `<id>.<timestamp>.<body>`) using `auth_secret` as a `whsec_`-prefixed
1311
+ * base64 secret, exactly as epilot webhooks do.
1312
+ *
1313
+ * `auth_secret` is required when `auth_type` is `header`, `bearer` or `hmac`.
1314
+ * Combine with `auth` (a pre-call that fetches a token) when the target needs both.
1315
+ *
1316
+ */
1317
+ auth_type?: "none" | "header" | "bearer" | "hmac";
1318
+ /**
1319
+ * Header name used when `auth_type` is `header`. Defaults to `X-API-Key`.
1320
+ */
1321
+ auth_header?: string;
1322
+ /**
1323
+ * 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`.
1324
+ * example:
1325
+ * {{Options.api_key}}
1326
+ */
1327
+ auth_secret?: string;
1328
+ auth?: PortalExtensionAuthBlock;
1329
+ call: {
1330
+ /**
1331
+ * HTTP method to use for the call
1332
+ */
1333
+ method?: "GET" | "POST" | "PUT" | "PATCH";
1334
+ /**
1335
+ * URL to call. Supports variable interpolation.
1336
+ */
1337
+ url: string;
1338
+ /**
1339
+ * Headers to send with the call. Supports variable interpolation.
1340
+ */
1341
+ headers?: {
1342
+ [name: string]: string;
1343
+ };
1344
+ /**
1345
+ * Query parameters to append to the URL. Supports variable interpolation.
1346
+ */
1347
+ params?: {
1348
+ [name: string]: string;
1349
+ };
1350
+ /**
1351
+ * JSON body to send. Values support variable interpolation. When omitted, `{ Input, Context, Consumer }` is sent as-is.
1352
+ */
1353
+ body?: {
1354
+ [name: string]: any;
1355
+ };
1356
+ };
1357
+ /**
1358
+ * Typed results extracted from the response. Result ids must be unique within the hook.
1359
+ */
1360
+ result: [
1361
+ /**
1362
+ * A single typed value extracted from the hook response. Exactly one of `template`, `path` or `jsonata` must be set.
1363
+ *
1364
+ */
1365
+ ExternalValuesResult,
1366
+ .../**
1367
+ * A single typed value extracted from the hook response. Exactly one of `template`, `path` or `jsonata` must be set.
1368
+ *
1369
+ */
1370
+ ExternalValuesResult[]
1371
+ ];
1372
+ /**
1373
+ * Timeout for the external call in milliseconds.
1374
+ */
1375
+ timeout_ms?: number;
1376
+ /**
1377
+ * 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.
1378
+ */
1379
+ on_unavailable?: "skip" | "block";
1380
+ /**
1381
+ * Response caching. Off when omitted.
1382
+ */
1383
+ cache?: {
1384
+ /**
1385
+ * Time to live in seconds. 0 disables caching.
1386
+ */
1387
+ ttl_seconds: number;
1388
+ /**
1389
+ * Liquid template for the cache key. Defaults to a hash of org, app, hook, `Input` and `Context`.
1390
+ */
1391
+ key?: string;
1392
+ };
1393
+ secure_proxy?: /* If set, requests are routed through the ERP Integration secure proxy. Mutually exclusive with use_static_ips. */ PortalExtensionSecureProxy;
1394
+ }
1395
+ /**
1396
+ * A single typed value extracted from the hook response. Exactly one of `template`, `path` or `jsonata` must be set.
1397
+ *
1398
+ */
1399
+ export interface ExternalValuesResult {
1400
+ /**
1401
+ * Stable identifier of the result within the hook. Renaming breaks references.
1402
+ */
1403
+ id: string; // ^[a-zA-Z0-9_-]{1,100}$
1404
+ /**
1405
+ * Type the extracted value is coerced to.
1406
+ */
1407
+ type: "number" | "text" | "date" | "boolean";
1408
+ name: TranslatedString;
1409
+ /**
1410
+ * Liquid template over `Response` etc.; output coerced to `type`.
1411
+ * example:
1412
+ * {{Response.value}}
1413
+ */
1414
+ template?: string;
1415
+ /**
1416
+ * Dot path into the response body, e.g. "data.limit".
1417
+ * example:
1418
+ * data.limit
1419
+ */
1420
+ path?: string;
1421
+ /**
1422
+ * JSONata expression over `{ Response, Input, Context, Options, Env }`.
1423
+ * example:
1424
+ * $sum(Response.items.amount)
1425
+ */
1426
+ jsonata?: string;
1427
+ }
1267
1428
  /**
1268
1429
  * A named server-side function belonging to the app. Runs in the epilot code-execution sandbox with an installation-scoped app token. Functions with a schedule are executed automatically once per installation.
1269
1430
  *
@@ -1306,7 +1467,7 @@ declare namespace Components {
1306
1467
  de: string;
1307
1468
  };
1308
1469
  /**
1309
- * JavaScript code to execute. Must declare a top-level `async function handler(input, context)`. Maximum size: 300KB (hard limit). Security restrictions: eval() and Function() constructor are not allowed.
1470
+ * JavaScript code to execute. Must declare a top-level `async function handler(input, context)`. Maximum size: 300KB (hard limit). Security restrictions: dynamic code evaluation via `eval` or the `Function` constructor is not allowed.
1310
1471
  *
1311
1472
  */
1312
1473
  code: string;
@@ -1865,7 +2026,7 @@ declare namespace Components {
1865
2026
  * { "id": "ht", "label": { "en": "High tariff" }, "aggregation_group": "consumption", "statistical_method": "sum", "unit": "kWh", "color": "primary", "precision": 2 },
1866
2027
  * ...
1867
2028
  * ],
1868
- * "intervals": ["PT15M", "PT1H", "P1D", "P1M", "P1Y"],
2029
+ * "intervals": ["PT15M", "PT1H", "P1D", "P1M", "P1Y", "custom"],
1869
2030
  * "data_range": { "from": "2024-01-01T00:00:00Z", "to": "2026-05-01T00:00:00Z" }
1870
2031
  * }
1871
2032
  * 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.
@@ -2106,9 +2267,10 @@ declare namespace Components {
2106
2267
  /**
2107
2268
  * 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.
2108
2269
  * Intervals supported by the API. If omitted, it is assumed that all intervals are supported.
2270
+ * `custom` marks a period-based consumption source: records carry the `period` they cover instead of sitting on a fixed grid, and the portal shows the whole data range as one bar per record.
2109
2271
  *
2110
2272
  */
2111
- intervals?: ("PT15M" | "PT1H" | "P1D" | "P1M" | "P1Y")[];
2273
+ intervals?: ("PT15M" | "PT1H" | "P1D" | "P1M" | "P1Y" | "custom")[];
2112
2274
  auth?: PortalExtensionAuthBlock;
2113
2275
  call: {
2114
2276
  /**
@@ -2277,9 +2439,10 @@ declare namespace Components {
2277
2439
  /**
2278
2440
  * 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.
2279
2441
  * Intervals supported by the API. If omitted, it is assumed that all intervals are supported.
2442
+ * `custom` marks a period-based consumption source: records carry the `period` they cover instead of sitting on a fixed grid, and the portal shows the whole data range as one bar per record.
2280
2443
  *
2281
2444
  */
2282
- intervals?: ("PT15M" | "PT1H" | "P1D" | "P1M" | "P1Y")[];
2445
+ intervals?: ("PT15M" | "PT1H" | "P1D" | "P1M" | "P1Y" | "custom")[];
2283
2446
  auth?: PortalExtensionAuthBlock;
2284
2447
  call: {
2285
2448
  /**
@@ -2608,9 +2771,10 @@ declare namespace Components {
2608
2771
  /**
2609
2772
  * 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.
2610
2773
  * Intervals supported by the API. If omitted, it is assumed that all intervals are supported.
2774
+ * `custom` marks a period-based consumption source: records carry the `period` they cover instead of sitting on a fixed grid, and the portal shows the whole data range as one bar per record.
2611
2775
  *
2612
2776
  */
2613
- intervals?: ("PT15M" | "PT1H" | "P1D" | "P1M" | "P1Y")[];
2777
+ intervals?: ("PT15M" | "PT1H" | "P1D" | "P1M" | "P1Y" | "custom")[];
2614
2778
  auth?: PortalExtensionAuthBlock;
2615
2779
  call: {
2616
2780
  /**
@@ -2742,7 +2906,7 @@ declare namespace Components {
2742
2906
  * { "id": "ht", "label": { "en": "High tariff" }, "aggregation_group": "consumption", "statistical_method": "sum", "unit": "kWh", "color": "primary", "precision": 2 },
2743
2907
  * ...
2744
2908
  * ],
2745
- * "intervals": ["PT15M", "PT1H", "P1D", "P1M", "P1Y"],
2909
+ * "intervals": ["PT15M", "PT1H", "P1D", "P1M", "P1Y", "custom"],
2746
2910
  * "data_range": { "from": "2024-01-01T00:00:00Z", "to": "2026-05-01T00:00:00Z" }
2747
2911
  * }
2748
2912
  * 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.
@@ -4510,6 +4674,10 @@ export type ExternalProductCatalogComponent = Components.Schemas.ExternalProduct
4510
4674
  export type ExternalProductCatalogConfig = Components.Schemas.ExternalProductCatalogConfig;
4511
4675
  export type ExternalProductCatalogHookProductRecommendations = Components.Schemas.ExternalProductCatalogHookProductRecommendations;
4512
4676
  export type ExternalProductCatalogHookProducts = Components.Schemas.ExternalProductCatalogHookProducts;
4677
+ export type ExternalValuesComponent = Components.Schemas.ExternalValuesComponent;
4678
+ export type ExternalValuesConfig = Components.Schemas.ExternalValuesConfig;
4679
+ export type ExternalValuesHook = Components.Schemas.ExternalValuesHook;
4680
+ export type ExternalValuesResult = Components.Schemas.ExternalValuesResult;
4513
4681
  export type FunctionDefinition = Components.Schemas.FunctionDefinition;
4514
4682
  export type FunctionRefCustomActionConfig = Components.Schemas.FunctionRefCustomActionConfig;
4515
4683
  export type Grants = Components.Schemas.Grants;
package/dist/openapi.json CHANGED
@@ -511,6 +511,7 @@
511
511
  }
512
512
  ],
513
513
  "requestBody": {
514
+ "required": true,
514
515
  "content": {
515
516
  "application/json": {
516
517
  "schema": {
@@ -1974,6 +1975,7 @@
1974
1975
  }
1975
1976
  },
1976
1977
  "InstallRequest": {
1978
+ "required": true,
1977
1979
  "content": {
1978
1980
  "application/json": {
1979
1981
  "schema": {
@@ -2204,6 +2206,7 @@
2204
2206
  "EXTERNAL_PRODUCT_CATALOG",
2205
2207
  "CUSTOM_PAGE",
2206
2208
  "API_PROXY",
2209
+ "EXTERNAL_VALUES",
2207
2210
  "APP_FUNCTION"
2208
2211
  ],
2209
2212
  "description": "Type of app component"
@@ -2253,7 +2256,7 @@
2253
2256
  "code": {
2254
2257
  "type": "string",
2255
2258
  "maxLength": 307200,
2256
- "description": "JavaScript code to execute. Must declare a top-level `async function handler(input, context)`. Maximum size: 300KB (hard limit). Security restrictions: eval() and Function() constructor are not allowed.\n"
2259
+ "description": "JavaScript code to execute. Must declare a top-level `async function handler(input, context)`. Maximum size: 300KB (hard limit). Security restrictions: dynamic code evaluation via `eval` or the `Function` constructor is not allowed.\n"
2257
2260
  },
2258
2261
  "schedule": {
2259
2262
  "type": "string",
@@ -2400,7 +2403,8 @@
2400
2403
  "CUSTOM_CAPABILITY": "#/components/schemas/CustomCapabilityComponent",
2401
2404
  "EXTERNAL_PRODUCT_CATALOG": "#/components/schemas/ExternalProductCatalogComponent",
2402
2405
  "CUSTOM_PAGE": "#/components/schemas/CustomPageComponent",
2403
- "API_PROXY": "#/components/schemas/ApiProxyComponent"
2406
+ "API_PROXY": "#/components/schemas/ApiProxyComponent",
2407
+ "EXTERNAL_VALUES": "#/components/schemas/ExternalValuesComponent"
2404
2408
  }
2405
2409
  },
2406
2410
  "oneOf": [
@@ -2430,6 +2434,9 @@
2430
2434
  },
2431
2435
  {
2432
2436
  "$ref": "#/components/schemas/ApiProxyComponent"
2437
+ },
2438
+ {
2439
+ "$ref": "#/components/schemas/ExternalValuesComponent"
2433
2440
  }
2434
2441
  ]
2435
2442
  }
@@ -2453,6 +2460,25 @@
2453
2460
  }
2454
2461
  }
2455
2462
  },
2463
+ "ExternalValuesComponent": {
2464
+ "type": "object",
2465
+ "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",
2466
+ "required": [
2467
+ "component_type",
2468
+ "configuration"
2469
+ ],
2470
+ "properties": {
2471
+ "component_type": {
2472
+ "type": "string",
2473
+ "enum": [
2474
+ "EXTERNAL_VALUES"
2475
+ ]
2476
+ },
2477
+ "configuration": {
2478
+ "$ref": "#/components/schemas/ExternalValuesConfig"
2479
+ }
2480
+ }
2481
+ },
2456
2482
  "CustomCapabilityComponent": {
2457
2483
  "type": "object",
2458
2484
  "required": [
@@ -3393,7 +3419,7 @@
3393
3419
  "intervals": {
3394
3420
  "type": "array",
3395
3421
  "deprecated": true,
3396
- "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",
3422
+ "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`custom` marks a period-based consumption source: records carry the `period` they cover instead of sitting on a fixed grid, and the portal shows the whole data range as one bar per record.\n",
3397
3423
  "items": {
3398
3424
  "type": "string",
3399
3425
  "enum": [
@@ -3401,7 +3427,8 @@
3401
3427
  "PT1H",
3402
3428
  "P1D",
3403
3429
  "P1M",
3404
- "P1Y"
3430
+ "P1Y",
3431
+ "custom"
3405
3432
  ]
3406
3433
  }
3407
3434
  },
@@ -3505,7 +3532,7 @@
3505
3532
  "intervals": {
3506
3533
  "type": "array",
3507
3534
  "deprecated": true,
3508
- "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",
3535
+ "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`custom` marks a period-based consumption source: records carry the `period` they cover instead of sitting on a fixed grid, and the portal shows the whole data range as one bar per record.\n",
3509
3536
  "items": {
3510
3537
  "type": "string",
3511
3538
  "enum": [
@@ -3513,7 +3540,8 @@
3513
3540
  "PT1H",
3514
3541
  "P1D",
3515
3542
  "P1M",
3516
- "P1Y"
3543
+ "P1Y",
3544
+ "custom"
3517
3545
  ]
3518
3546
  }
3519
3547
  },
@@ -3692,7 +3720,7 @@
3692
3720
  "additionalProperties": false
3693
3721
  },
3694
3722
  "PortalExtensionHookVisualizationMetadata": {
3695
- "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",
3723
+ "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\", \"custom\"],\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",
3696
3724
  "type": "object",
3697
3725
  "properties": {
3698
3726
  "id": {
@@ -3809,7 +3837,7 @@
3809
3837
  "intervals": {
3810
3838
  "type": "array",
3811
3839
  "deprecated": true,
3812
- "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",
3840
+ "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`custom` marks a period-based consumption source: records carry the `period` they cover instead of sitting on a fixed grid, and the portal shows the whole data range as one bar per record.\n",
3813
3841
  "items": {
3814
3842
  "type": "string",
3815
3843
  "enum": [
@@ -3817,7 +3845,8 @@
3817
3845
  "PT1H",
3818
3846
  "P1D",
3819
3847
  "P1M",
3820
- "P1Y"
3848
+ "P1Y",
3849
+ "custom"
3821
3850
  ]
3822
3851
  }
3823
3852
  },
@@ -5107,6 +5136,200 @@
5107
5136
  }
5108
5137
  }
5109
5138
  },
5139
+ "ExternalValuesConfig": {
5140
+ "type": "object",
5141
+ "description": "Configuration for an EXTERNAL_VALUES component",
5142
+ "required": [
5143
+ "hooks"
5144
+ ],
5145
+ "properties": {
5146
+ "hooks": {
5147
+ "type": "array",
5148
+ "description": "Hooks exposed by this component. Hook ids must be unique within the component.",
5149
+ "items": {
5150
+ "$ref": "#/components/schemas/ExternalValuesHook"
5151
+ }
5152
+ }
5153
+ }
5154
+ },
5155
+ "ExternalValuesHook": {
5156
+ "type": "object",
5157
+ "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",
5158
+ "required": [
5159
+ "id",
5160
+ "name",
5161
+ "call",
5162
+ "result"
5163
+ ],
5164
+ "properties": {
5165
+ "id": {
5166
+ "type": "string",
5167
+ "pattern": "^[a-zA-Z0-9_-]{1,100}$",
5168
+ "description": "Stable identifier; consumers (e.g. validation rules) reference it. Renaming breaks references."
5169
+ },
5170
+ "name": {
5171
+ "$ref": "#/components/schemas/TranslatedString"
5172
+ },
5173
+ "description": {
5174
+ "$ref": "#/components/schemas/TranslatedString"
5175
+ },
5176
+ "auth_type": {
5177
+ "type": "string",
5178
+ "enum": [
5179
+ "none",
5180
+ "header",
5181
+ "bearer",
5182
+ "hmac"
5183
+ ],
5184
+ "default": "none",
5185
+ "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"
5186
+ },
5187
+ "auth_header": {
5188
+ "type": "string",
5189
+ "description": "Header name used when `auth_type` is `header`. Defaults to `X-API-Key`."
5190
+ },
5191
+ "auth_secret": {
5192
+ "type": "string",
5193
+ "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`.",
5194
+ "example": "{{Options.api_key}}"
5195
+ },
5196
+ "auth": {
5197
+ "$ref": "#/components/schemas/PortalExtensionAuthBlock"
5198
+ },
5199
+ "call": {
5200
+ "type": "object",
5201
+ "required": [
5202
+ "url"
5203
+ ],
5204
+ "properties": {
5205
+ "method": {
5206
+ "type": "string",
5207
+ "enum": [
5208
+ "GET",
5209
+ "POST",
5210
+ "PUT",
5211
+ "PATCH"
5212
+ ],
5213
+ "default": "POST",
5214
+ "description": "HTTP method to use for the call"
5215
+ },
5216
+ "url": {
5217
+ "type": "string",
5218
+ "description": "URL to call. Supports variable interpolation."
5219
+ },
5220
+ "headers": {
5221
+ "type": "object",
5222
+ "description": "Headers to send with the call. Supports variable interpolation.",
5223
+ "additionalProperties": {
5224
+ "type": "string"
5225
+ }
5226
+ },
5227
+ "params": {
5228
+ "type": "object",
5229
+ "description": "Query parameters to append to the URL. Supports variable interpolation.",
5230
+ "additionalProperties": {
5231
+ "type": "string"
5232
+ }
5233
+ },
5234
+ "body": {
5235
+ "type": "object",
5236
+ "description": "JSON body to send. Values support variable interpolation. When omitted, `{ Input, Context, Consumer }` is sent as-is.",
5237
+ "additionalProperties": true
5238
+ }
5239
+ }
5240
+ },
5241
+ "result": {
5242
+ "type": "array",
5243
+ "minItems": 1,
5244
+ "description": "Typed results extracted from the response. Result ids must be unique within the hook.",
5245
+ "items": {
5246
+ "$ref": "#/components/schemas/ExternalValuesResult"
5247
+ }
5248
+ },
5249
+ "timeout_ms": {
5250
+ "type": "integer",
5251
+ "minimum": 500,
5252
+ "maximum": 5000,
5253
+ "default": 3000,
5254
+ "description": "Timeout for the external call in milliseconds."
5255
+ },
5256
+ "on_unavailable": {
5257
+ "type": "string",
5258
+ "enum": [
5259
+ "skip",
5260
+ "block"
5261
+ ],
5262
+ "default": "skip",
5263
+ "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."
5264
+ },
5265
+ "cache": {
5266
+ "type": "object",
5267
+ "description": "Response caching. Off when omitted.",
5268
+ "required": [
5269
+ "ttl_seconds"
5270
+ ],
5271
+ "properties": {
5272
+ "ttl_seconds": {
5273
+ "type": "integer",
5274
+ "minimum": 0,
5275
+ "maximum": 3600,
5276
+ "description": "Time to live in seconds. 0 disables caching."
5277
+ },
5278
+ "key": {
5279
+ "type": "string",
5280
+ "description": "Liquid template for the cache key. Defaults to a hash of org, app, hook, `Input` and `Context`."
5281
+ }
5282
+ }
5283
+ },
5284
+ "secure_proxy": {
5285
+ "$ref": "#/components/schemas/PortalExtensionSecureProxy"
5286
+ }
5287
+ }
5288
+ },
5289
+ "ExternalValuesResult": {
5290
+ "type": "object",
5291
+ "description": "A single typed value extracted from the hook response. Exactly one of `template`, `path` or `jsonata` must be set.\n",
5292
+ "required": [
5293
+ "id",
5294
+ "type",
5295
+ "name"
5296
+ ],
5297
+ "properties": {
5298
+ "id": {
5299
+ "type": "string",
5300
+ "pattern": "^[a-zA-Z0-9_-]{1,100}$",
5301
+ "description": "Stable identifier of the result within the hook. Renaming breaks references."
5302
+ },
5303
+ "type": {
5304
+ "type": "string",
5305
+ "enum": [
5306
+ "number",
5307
+ "text",
5308
+ "date",
5309
+ "boolean"
5310
+ ],
5311
+ "description": "Type the extracted value is coerced to."
5312
+ },
5313
+ "name": {
5314
+ "$ref": "#/components/schemas/TranslatedString"
5315
+ },
5316
+ "template": {
5317
+ "type": "string",
5318
+ "description": "Liquid template over `Response` etc.; output coerced to `type`.",
5319
+ "example": "{{Response.value}}"
5320
+ },
5321
+ "path": {
5322
+ "type": "string",
5323
+ "description": "Dot path into the response body, e.g. \"data.limit\".",
5324
+ "example": "data.limit"
5325
+ },
5326
+ "jsonata": {
5327
+ "type": "string",
5328
+ "description": "JSONata expression over `{ Response, Input, Context, Options, Env }`.",
5329
+ "example": "$sum(Response.items.amount)"
5330
+ }
5331
+ }
5332
+ },
5110
5333
  "Grants": {
5111
5334
  "type": "array",
5112
5335
  "description": "Required grants for the app in order to call APIs for the installing tenant",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/app-client",
3
- "version": "0.15.0",
3
+ "version": "0.17.0",
4
4
  "description": "JavaScript client library for the epilot App API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -21,20 +21,6 @@
21
21
  "sdk",
22
22
  "app"
23
23
  ],
24
- "scripts": {
25
- "test": "vitest",
26
- "typescript": "tsc",
27
- "bundle-definition": "webpack",
28
- "openapi:local": "node ../../scripts/update-openapi.js ../../../app-api/openapi.yml",
29
- "openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/app.yaml",
30
- "typegen": "openapi typegen src/openapi.json --client > src/openapi.d.ts",
31
- "build": "tsc && npm run build:patch && npm run bundle-definition",
32
- "build:patch": "sed -i'' -e '/^__exportStar.*openapi.*$/d' dist/index.js",
33
- "build:watch": "npm run build && tsc -w",
34
- "release-alpha": "npm version prerelease --preid alpha",
35
- "prepublishOnly": "npm run typegen && npm run build",
36
- "lint": "biome check src"
37
- },
38
24
  "files": [
39
25
  "*.js",
40
26
  "*.d.ts",
@@ -71,5 +57,18 @@
71
57
  "webpack": "^5.18.0",
72
58
  "webpack-cli": "^4.4.0"
73
59
  },
74
- "gitHead": "39426e86cfb320fa3227dc03f60ee6a10848e7c7"
75
- }
60
+ "gitHead": "39426e86cfb320fa3227dc03f60ee6a10848e7c7",
61
+ "scripts": {
62
+ "test": "vitest",
63
+ "typescript": "tsc",
64
+ "bundle-definition": "webpack",
65
+ "openapi:local": "node ../../scripts/update-openapi.js ../../../app-api/openapi.yml",
66
+ "openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/app.yaml",
67
+ "typegen": "openapi typegen src/openapi.json --client > src/openapi.d.ts",
68
+ "build": "tsc && npm run build:patch && npm run bundle-definition",
69
+ "build:patch": "sed -i'' -e '/^__exportStar.*openapi.*$/d' dist/index.js",
70
+ "build:watch": "npm run build && tsc -w",
71
+ "release-alpha": "npm version prerelease --preid alpha",
72
+ "lint": "biome check src"
73
+ }
74
+ }