@epilot/app-client 0.9.2 → 0.9.3

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={390:function(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/{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}],"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-events":{"post":{"operationId":"ingestEvent","requestBody":{"required":true,"content":{"application/json":{}}},"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":{}}},"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}(390),n=exports;for(var o in t)n[o]=t[o];t.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
1
+ (()=>{"use strict";var e={330:function(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/{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}],"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-events":{"post":{"operationId":"ingestEvent","requestBody":{"required":true,"content":{"application/json":{}}},"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":{}}},"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}(330),n=exports;for(var o in t)n[o]=t[o];t.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
package/dist/openapi.d.ts CHANGED
@@ -1182,52 +1182,425 @@ declare namespace Components {
1182
1182
  */
1183
1183
  override_url?: string;
1184
1184
  }
1185
- export interface PortalAuth {
1186
- type?: string;
1187
- url?: string;
1185
+ export interface PortalExtensionAuthBlock {
1186
+ /**
1187
+ * HTTP method to use for authentication
1188
+ */
1188
1189
  method?: string;
1190
+ /**
1191
+ * URL to use for authentication. Supports variable interpolation.
1192
+ */
1193
+ url: string;
1194
+ /**
1195
+ * Parameters to append to the URL. Supports variable interpolation.
1196
+ */
1197
+ params?: {
1198
+ [name: string]: string;
1199
+ };
1200
+ /**
1201
+ * Headers to use for authentication. Supports variable interpolation.
1202
+ */
1189
1203
  headers?: {
1190
1204
  [name: string]: string;
1191
1205
  };
1206
+ /**
1207
+ * JSON body to use for authentication. Supports variable interpolation. Content format is determined by Content-Type header.
1208
+ */
1209
+ body?: {
1210
+ [name: string]: string;
1211
+ };
1212
+ cache?: {
1213
+ /**
1214
+ * Key to use to identify the auth response. Supports interpolation.
1215
+ * example:
1216
+ * {{Options.api_key}}
1217
+ */
1218
+ key: string;
1219
+ /**
1220
+ * Time to live in seconds for the cache. Supports interpolation.
1221
+ * example:
1222
+ * {{AuthResponse.data.expires_in}}
1223
+ */
1224
+ ttl: string;
1225
+ };
1192
1226
  }
1193
1227
  export interface PortalExtensionComponent {
1194
1228
  component_type: "PORTAL_EXTENSION";
1195
- origin?: "END_CUSTOMER_PORTAL" | "INSTALLER_PORTAL";
1196
1229
  configuration: PortalExtensionConfig;
1197
1230
  }
1198
1231
  export interface PortalExtensionConfig {
1199
- id?: string;
1200
- hooks?: {
1232
+ hooks?: ({
1233
+ /**
1234
+ * Identifier of the hook. Should not change between updates.
1235
+ */
1201
1236
  id?: string;
1202
- type?: string;
1203
- name?: TranslatedString;
1204
- interval?: string[];
1205
- auth?: PortalAuth;
1206
- call?: {
1207
- url?: string;
1208
- headers?: {
1209
- [name: string]: string;
1210
- };
1211
- params?: {
1212
- [name: string]: string;
1213
- };
1214
- };
1215
- }[];
1237
+ } & (/**
1238
+ * Hook that replaces the built-in registration identifiers check. This hook makes a POST call whenever a user is trying to register to find the corresponding contact. The expected response to the call is:
1239
+ * - 200 with contact id if exactly one contact is found
1240
+ * - 404 if no contact is found or more than contact is found
1241
+ *
1242
+ */
1243
+ PortalExtensionHookRegistrationIdentifiersCheck | /**
1244
+ * Hook that replaces the built-in contract identification for self-assignment. This hook makes a POST call whenever a user is trying to self-assign a contract to find the corresponding contract(s). The expected response to the call is:
1245
+ * - 200 if found with either:
1246
+ * - contract_id array
1247
+ * - contact_id string
1248
+ * - 404 if no contract is found
1249
+ * If `contact_id` is provided in the response, Contracts are retrieved from this Contact. In that case, optionally, if you also specify `contact_relation_attribute`, the specified Contact attribute of the user performing the action will be modified to add the matched Contact.
1250
+ *
1251
+ */
1252
+ PortalExtensionHookContractIdentification | /**
1253
+ * Hook that will allow using the specified source as data for price 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:
1254
+ * - 200 with the time series data
1255
+ *
1256
+ */
1257
+ PortalExtensionHookPriceDataRetrieval | /**
1258
+ * 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:
1259
+ * - 200 with the time series data
1260
+ *
1261
+ */
1262
+ PortalExtensionHookConsumptionDataRetrieval | /**
1263
+ * 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:
1264
+ * - 200 with the time series data
1265
+ *
1266
+ */
1267
+ PortalExtensionHookCostDataRetrieval | /**
1268
+ * Hook that checks the plausibility of meter readings before they are saved. This hook makes a POST call whenever a user is trying to save a meter reading. The expected response to the call is:
1269
+ * - 200:
1270
+ * If meter reading is plausible, the response should contain:
1271
+ * - valid: true
1272
+ * If meter reading is not plausible, the response should contain:
1273
+ * - valid: false
1274
+ *
1275
+ */
1276
+ PortalExtensionHookMeterReadingPlausibilityCheck))[];
1216
1277
  links?: {
1217
- id?: string;
1218
- type?: string;
1219
- name?: TranslatedString;
1278
+ /**
1279
+ * Identifier of the link. Should not change between updates.
1280
+ */
1281
+ id: string;
1282
+ name: TranslatedString;
1220
1283
  description?: TranslatedString;
1284
+ type: "seamless";
1285
+ /**
1286
+ * Controls whether the link should be shown. Supports variable interpolation.
1287
+ * example:
1288
+ * {{Contact.customer_number | is_not_empty}}
1289
+ */
1221
1290
  condition?: string;
1222
- auth?: PortalAuth;
1223
- redirect?: {
1291
+ auth?: PortalExtensionAuthBlock;
1292
+ redirect: {
1293
+ /**
1294
+ * URL to redirect to. Supports variable interpolation.
1295
+ */
1224
1296
  url?: string;
1297
+ /**
1298
+ * Parameters to append to the URL. Supports variable interpolation.
1299
+ */
1225
1300
  params?: {
1226
1301
  [name: string]: string;
1227
1302
  };
1228
1303
  };
1229
1304
  }[];
1230
1305
  }
1306
+ export interface PortalExtensionHook {
1307
+ /**
1308
+ * Identifier of the hook. Should not change between updates.
1309
+ */
1310
+ id?: string;
1311
+ }
1312
+ /**
1313
+ * 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:
1314
+ * - 200 with the time series data
1315
+ *
1316
+ */
1317
+ export interface PortalExtensionHookConsumptionDataRetrieval {
1318
+ type: "consumptionDataRetrieval";
1319
+ auth?: PortalExtensionAuthBlock;
1320
+ call: {
1321
+ /**
1322
+ * HTTP method to use for the call
1323
+ */
1324
+ method?: string;
1325
+ /**
1326
+ * URL to call. Supports variable interpolation.
1327
+ */
1328
+ url: string;
1329
+ /**
1330
+ * Parameters to append to the URL. Supports variable interpolation.
1331
+ */
1332
+ params?: {
1333
+ [name: string]: string;
1334
+ };
1335
+ /**
1336
+ * Headers to use. Supports variable interpolation.
1337
+ */
1338
+ headers?: {
1339
+ [name: string]: string;
1340
+ };
1341
+ /**
1342
+ * Request body to send. Supports variable interpolation. Content format is determined by Content-Type header.
1343
+ */
1344
+ body?: {
1345
+ [name: string]: string;
1346
+ };
1347
+ };
1348
+ resolved: {
1349
+ /**
1350
+ * Optional path to the data (array) in the response. If omitted, the data is assumed to be on the top level.
1351
+ */
1352
+ dataPath?: string;
1353
+ };
1354
+ }
1355
+ /**
1356
+ * Hook that replaces the built-in contract identification for self-assignment. This hook makes a POST call whenever a user is trying to self-assign a contract to find the corresponding contract(s). The expected response to the call is:
1357
+ * - 200 if found with either:
1358
+ * - contract_id array
1359
+ * - contact_id string
1360
+ * - 404 if no contract is found
1361
+ * If `contact_id` is provided in the response, Contracts are retrieved from this Contact. In that case, optionally, if you also specify `contact_relation_attribute`, the specified Contact attribute of the user performing the action will be modified to add the matched Contact.
1362
+ *
1363
+ */
1364
+ export interface PortalExtensionHookContractIdentification {
1365
+ type: "contractIdentification";
1366
+ auth?: PortalExtensionAuthBlock;
1367
+ call: {
1368
+ /**
1369
+ * URL to call. Supports variable interpolation.
1370
+ */
1371
+ url: string;
1372
+ /**
1373
+ * Parameters to append to the URL. Supports variable interpolation.
1374
+ */
1375
+ params?: {
1376
+ [name: string]: string;
1377
+ };
1378
+ /**
1379
+ * Headers to use. Supports variable interpolation.
1380
+ */
1381
+ headers: {
1382
+ [name: string]: string;
1383
+ };
1384
+ };
1385
+ /**
1386
+ * Name of the Contact attribute to update with the matched Contact ID. Must be a Contact relation attribute supporting multiple entities.
1387
+ * example:
1388
+ * represents_contact
1389
+ */
1390
+ contact_relation_attribute?: string;
1391
+ /**
1392
+ * Explanation of the hook.
1393
+ */
1394
+ explanation?: {
1395
+ [name: string]: string;
1396
+ /**
1397
+ * Explanation of the functionality shown to the end user.
1398
+ * example:
1399
+ * This process will give you access to all Contracts kept
1400
+ */
1401
+ en: string;
1402
+ };
1403
+ }
1404
+ /**
1405
+ * 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:
1406
+ * - 200 with the time series data
1407
+ *
1408
+ */
1409
+ export interface PortalExtensionHookCostDataRetrieval {
1410
+ type: "costDataRetrieval";
1411
+ auth?: PortalExtensionAuthBlock;
1412
+ call: {
1413
+ /**
1414
+ * HTTP method to use for the call
1415
+ */
1416
+ method?: string;
1417
+ /**
1418
+ * URL to call. Supports variable interpolation.
1419
+ */
1420
+ url: string;
1421
+ /**
1422
+ * Parameters to append to the URL. Supports variable interpolation.
1423
+ */
1424
+ params?: {
1425
+ [name: string]: string;
1426
+ };
1427
+ /**
1428
+ * Headers to use. Supports variable interpolation.
1429
+ */
1430
+ headers?: {
1431
+ [name: string]: string;
1432
+ };
1433
+ /**
1434
+ * Request body to send. Supports variable interpolation. Content format is determined by Content-Type header.
1435
+ */
1436
+ body?: {
1437
+ [name: string]: string;
1438
+ };
1439
+ };
1440
+ resolved?: {
1441
+ /**
1442
+ * Optional path to the data (array) in the response. If omitted, the data is assumed to be on the top level.
1443
+ */
1444
+ dataPath?: string;
1445
+ };
1446
+ }
1447
+ /**
1448
+ * Hook that checks the plausibility of meter readings before they are saved. This hook makes a POST call whenever a user is trying to save a meter reading. The expected response to the call is:
1449
+ * - 200:
1450
+ * If meter reading is plausible, the response should contain:
1451
+ * - valid: true
1452
+ * If meter reading is not plausible, the response should contain:
1453
+ * - valid: false
1454
+ *
1455
+ */
1456
+ export interface PortalExtensionHookMeterReadingPlausibilityCheck {
1457
+ type: "meterReadingPlausibilityCheck";
1458
+ auth?: PortalExtensionAuthBlock;
1459
+ call: {
1460
+ /**
1461
+ * URL to call. Supports variable interpolation.
1462
+ */
1463
+ url: string;
1464
+ /**
1465
+ * JSON body to use for the call. Supports variable interpolation.
1466
+ */
1467
+ body: {
1468
+ [name: string]: string;
1469
+ };
1470
+ /**
1471
+ * Headers to use. Supports variable interpolation.
1472
+ */
1473
+ headers: {
1474
+ [name: string]: string;
1475
+ };
1476
+ };
1477
+ /**
1478
+ * Response to the call
1479
+ */
1480
+ resolved: {
1481
+ /**
1482
+ * Indicate whether the meter reading is plausible
1483
+ * example:
1484
+ * {{CallResponse.data.valid}}
1485
+ */
1486
+ valid?: string;
1487
+ /**
1488
+ * Upper allowed limit of the meter reading
1489
+ * example:
1490
+ * {{CallResponse.data.upper_limit}}
1491
+ */
1492
+ upper_limit?: string;
1493
+ /**
1494
+ * Lower allowed limit of the meter reading
1495
+ * example:
1496
+ * {{CallResponse.data.lower_limit}}
1497
+ */
1498
+ lower_limit?: string;
1499
+ };
1500
+ }
1501
+ /**
1502
+ * Hook that will allow using the specified source as data for price 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:
1503
+ * - 200 with the time series data
1504
+ *
1505
+ */
1506
+ export interface PortalExtensionHookPriceDataRetrieval {
1507
+ type: "priceDataRetrieval";
1508
+ auth?: PortalExtensionAuthBlock;
1509
+ call: {
1510
+ /**
1511
+ * HTTP method to use for the call
1512
+ */
1513
+ method?: string;
1514
+ /**
1515
+ * URL to call. Supports variable interpolation.
1516
+ */
1517
+ url: string;
1518
+ /**
1519
+ * Parameters to append to the URL. Supports variable interpolation.
1520
+ */
1521
+ params?: {
1522
+ [name: string]: string;
1523
+ };
1524
+ /**
1525
+ * Headers to use. Supports variable interpolation.
1526
+ */
1527
+ headers?: {
1528
+ [name: string]: string;
1529
+ };
1530
+ /**
1531
+ * Request body to send. Supports variable interpolation. Content format is determined by Content-Type header.
1532
+ */
1533
+ body?: {
1534
+ [name: string]: string;
1535
+ };
1536
+ };
1537
+ resolved: {
1538
+ /**
1539
+ * Optional path to the data (array) in the response. If omitted, the data is assumed to be on the top level.
1540
+ */
1541
+ dataPath?: string;
1542
+ };
1543
+ }
1544
+ /**
1545
+ * Hook that replaces the built-in registration identifiers check. This hook makes a POST call whenever a user is trying to register to find the corresponding contact. The expected response to the call is:
1546
+ * - 200 with contact id if exactly one contact is found
1547
+ * - 404 if no contact is found or more than contact is found
1548
+ *
1549
+ */
1550
+ export interface PortalExtensionHookRegistrationIdentifiersCheck {
1551
+ type: "registrationIdentifiersCheck";
1552
+ auth?: PortalExtensionAuthBlock;
1553
+ call: {
1554
+ /**
1555
+ * URL to call. Supports variable interpolation.
1556
+ */
1557
+ url: string;
1558
+ /**
1559
+ * Parameters to append to the URL. Supports variable interpolation.
1560
+ */
1561
+ params?: {
1562
+ [name: string]: string;
1563
+ };
1564
+ /**
1565
+ * Headers to use. Supports variable interpolation.
1566
+ */
1567
+ headers: {
1568
+ [name: string]: string;
1569
+ };
1570
+ /**
1571
+ * Contact ID usually retrieved from the response body, e.g. `{{CallResponse.data.contact_id}}`. Supports variable interpolation.
1572
+ */
1573
+ result: string;
1574
+ };
1575
+ }
1576
+ export interface PortalExtensionSeamlessLink {
1577
+ /**
1578
+ * Identifier of the link. Should not change between updates.
1579
+ */
1580
+ id: string;
1581
+ name: TranslatedString;
1582
+ description?: TranslatedString;
1583
+ type: "seamless";
1584
+ /**
1585
+ * Controls whether the link should be shown. Supports variable interpolation.
1586
+ * example:
1587
+ * {{Contact.customer_number | is_not_empty}}
1588
+ */
1589
+ condition?: string;
1590
+ auth?: PortalExtensionAuthBlock;
1591
+ redirect: {
1592
+ /**
1593
+ * URL to redirect to. Supports variable interpolation.
1594
+ */
1595
+ url?: string;
1596
+ /**
1597
+ * Parameters to append to the URL. Supports variable interpolation.
1598
+ */
1599
+ params?: {
1600
+ [name: string]: string;
1601
+ };
1602
+ };
1603
+ }
1231
1604
  export interface Pricing {
1232
1605
  pricing_type?: "FREE" | "SUBSCRIPTION" | "USAGE_BASED" | "ONE_TIME" | "CUSTOM" | "UNKNOWN";
1233
1606
  billing_frequency?: /* How often the subscription is billed */ BillingFrequency;
@@ -2596,9 +2969,17 @@ export type Option = Components.Schemas.Option;
2596
2969
  export type Options = Components.Schemas.Options;
2597
2970
  export type OptionsRef = Components.Schemas.OptionsRef;
2598
2971
  export type OverrideDevMode = Components.Schemas.OverrideDevMode;
2599
- export type PortalAuth = Components.Schemas.PortalAuth;
2972
+ export type PortalExtensionAuthBlock = Components.Schemas.PortalExtensionAuthBlock;
2600
2973
  export type PortalExtensionComponent = Components.Schemas.PortalExtensionComponent;
2601
2974
  export type PortalExtensionConfig = Components.Schemas.PortalExtensionConfig;
2975
+ export type PortalExtensionHook = Components.Schemas.PortalExtensionHook;
2976
+ export type PortalExtensionHookConsumptionDataRetrieval = Components.Schemas.PortalExtensionHookConsumptionDataRetrieval;
2977
+ export type PortalExtensionHookContractIdentification = Components.Schemas.PortalExtensionHookContractIdentification;
2978
+ export type PortalExtensionHookCostDataRetrieval = Components.Schemas.PortalExtensionHookCostDataRetrieval;
2979
+ export type PortalExtensionHookMeterReadingPlausibilityCheck = Components.Schemas.PortalExtensionHookMeterReadingPlausibilityCheck;
2980
+ export type PortalExtensionHookPriceDataRetrieval = Components.Schemas.PortalExtensionHookPriceDataRetrieval;
2981
+ export type PortalExtensionHookRegistrationIdentifiersCheck = Components.Schemas.PortalExtensionHookRegistrationIdentifiersCheck;
2982
+ export type PortalExtensionSeamlessLink = Components.Schemas.PortalExtensionSeamlessLink;
2602
2983
  export type Pricing = Components.Schemas.Pricing;
2603
2984
  export type PublicConfiguration = Components.Schemas.PublicConfiguration;
2604
2985
  export type RawEvents = Components.Schemas.RawEvents;
package/dist/openapi.json CHANGED
@@ -2097,13 +2097,6 @@
2097
2097
  "PORTAL_EXTENSION"
2098
2098
  ]
2099
2099
  },
2100
- "origin": {
2101
- "type": "string",
2102
- "enum": [
2103
- "END_CUSTOMER_PORTAL",
2104
- "INSTALLER_PORTAL"
2105
- ]
2106
- },
2107
2100
  "configuration": {
2108
2101
  "$ref": "#/components/schemas/PortalExtensionConfig"
2109
2102
  }
@@ -2112,116 +2105,597 @@
2112
2105
  "PortalExtensionConfig": {
2113
2106
  "type": "object",
2114
2107
  "properties": {
2115
- "id": {
2116
- "type": "string"
2117
- },
2118
2108
  "hooks": {
2119
2109
  "type": "array",
2120
2110
  "items": {
2121
- "type": "object",
2122
- "properties": {
2123
- "id": {
2124
- "type": "string"
2111
+ "allOf": [
2112
+ {
2113
+ "$ref": "#/components/schemas/PortalExtensionHook"
2125
2114
  },
2126
- "type": {
2127
- "type": "string"
2128
- },
2129
- "name": {
2130
- "$ref": "#/components/schemas/TranslatedString"
2131
- },
2132
- "interval": {
2133
- "type": "array",
2134
- "items": {
2135
- "type": "string"
2136
- }
2137
- },
2138
- "auth": {
2139
- "$ref": "#/components/schemas/PortalAuth"
2140
- },
2141
- "call": {
2142
- "type": "object",
2143
- "properties": {
2144
- "url": {
2145
- "type": "string"
2115
+ {
2116
+ "oneOf": [
2117
+ {
2118
+ "$ref": "#/components/schemas/PortalExtensionHookRegistrationIdentifiersCheck"
2146
2119
  },
2147
- "headers": {
2148
- "type": "object",
2149
- "additionalProperties": {
2150
- "type": "string"
2151
- }
2120
+ {
2121
+ "$ref": "#/components/schemas/PortalExtensionHookContractIdentification"
2152
2122
  },
2153
- "params": {
2154
- "type": "object",
2155
- "additionalProperties": {
2156
- "type": "string"
2157
- }
2123
+ {
2124
+ "$ref": "#/components/schemas/PortalExtensionHookPriceDataRetrieval"
2125
+ },
2126
+ {
2127
+ "$ref": "#/components/schemas/PortalExtensionHookConsumptionDataRetrieval"
2128
+ },
2129
+ {
2130
+ "$ref": "#/components/schemas/PortalExtensionHookCostDataRetrieval"
2131
+ },
2132
+ {
2133
+ "$ref": "#/components/schemas/PortalExtensionHookMeterReadingPlausibilityCheck"
2158
2134
  }
2159
- }
2135
+ ]
2160
2136
  }
2161
- }
2137
+ ]
2162
2138
  }
2163
2139
  },
2164
2140
  "links": {
2165
2141
  "type": "array",
2166
2142
  "items": {
2167
- "type": "object",
2168
- "properties": {
2169
- "id": {
2143
+ "allOf": [
2144
+ {
2145
+ "$ref": "#/components/schemas/PortalExtensionSeamlessLink"
2146
+ }
2147
+ ]
2148
+ }
2149
+ }
2150
+ },
2151
+ "additionalProperties": false
2152
+ },
2153
+ "PortalExtensionHook": {
2154
+ "type": "object",
2155
+ "properties": {
2156
+ "id": {
2157
+ "type": "string",
2158
+ "description": "Identifier of the hook. Should not change between updates."
2159
+ }
2160
+ }
2161
+ },
2162
+ "PortalExtensionHookRegistrationIdentifiersCheck": {
2163
+ "description": "Hook that replaces the built-in registration identifiers check. This hook makes a POST call whenever a user is trying to register to find the corresponding contact. The expected response to the call is:\n - 200 with contact id if exactly one contact is found\n - 404 if no contact is found or more than contact is found\n",
2164
+ "type": "object",
2165
+ "properties": {
2166
+ "type": {
2167
+ "type": "string",
2168
+ "enum": [
2169
+ "registrationIdentifiersCheck"
2170
+ ]
2171
+ },
2172
+ "auth": {
2173
+ "$ref": "#/components/schemas/PortalExtensionAuthBlock"
2174
+ },
2175
+ "call": {
2176
+ "type": "object",
2177
+ "properties": {
2178
+ "url": {
2179
+ "type": "string",
2180
+ "description": "URL to call. Supports variable interpolation."
2181
+ },
2182
+ "params": {
2183
+ "type": "object",
2184
+ "description": "Parameters to append to the URL. Supports variable interpolation.",
2185
+ "additionalProperties": {
2170
2186
  "type": "string"
2171
2187
  },
2172
- "type": {
2188
+ "default": {}
2189
+ },
2190
+ "headers": {
2191
+ "type": "object",
2192
+ "description": "Headers to use. Supports variable interpolation.",
2193
+ "additionalProperties": {
2173
2194
  "type": "string"
2174
2195
  },
2175
- "name": {
2176
- "$ref": "#/components/schemas/TranslatedString"
2196
+ "default": {}
2197
+ },
2198
+ "result": {
2199
+ "type": "string",
2200
+ "description": "Contact ID usually retrieved from the response body, e.g. `{{CallResponse.data.contact_id}}`. Supports variable interpolation."
2201
+ }
2202
+ },
2203
+ "required": [
2204
+ "url",
2205
+ "headers",
2206
+ "result"
2207
+ ],
2208
+ "additionalProperties": false
2209
+ }
2210
+ },
2211
+ "required": [
2212
+ "type",
2213
+ "call"
2214
+ ],
2215
+ "additionalProperties": false
2216
+ },
2217
+ "PortalExtensionHookContractIdentification": {
2218
+ "description": "Hook that replaces the built-in contract identification for self-assignment. This hook makes a POST call whenever a user is trying to self-assign a contract to find the corresponding contract(s). The expected response to the call is:\n - 200 if found with either:\n - contract_id array\n - contact_id string\n - 404 if no contract is found\nIf `contact_id` is provided in the response, Contracts are retrieved from this Contact. In that case, optionally, if you also specify `contact_relation_attribute`, the specified Contact attribute of the user performing the action will be modified to add the matched Contact.\n",
2219
+ "type": "object",
2220
+ "properties": {
2221
+ "type": {
2222
+ "type": "string",
2223
+ "enum": [
2224
+ "contractIdentification"
2225
+ ]
2226
+ },
2227
+ "auth": {
2228
+ "$ref": "#/components/schemas/PortalExtensionAuthBlock"
2229
+ },
2230
+ "call": {
2231
+ "type": "object",
2232
+ "properties": {
2233
+ "url": {
2234
+ "type": "string",
2235
+ "description": "URL to call. Supports variable interpolation."
2236
+ },
2237
+ "params": {
2238
+ "type": "object",
2239
+ "description": "Parameters to append to the URL. Supports variable interpolation.",
2240
+ "additionalProperties": {
2241
+ "type": "string"
2177
2242
  },
2178
- "description": {
2179
- "$ref": "#/components/schemas/TranslatedString"
2243
+ "default": {}
2244
+ },
2245
+ "headers": {
2246
+ "type": "object",
2247
+ "description": "Headers to use. Supports variable interpolation.",
2248
+ "additionalProperties": {
2249
+ "type": "string"
2180
2250
  },
2181
- "condition": {
2251
+ "default": {}
2252
+ }
2253
+ },
2254
+ "required": [
2255
+ "url",
2256
+ "headers",
2257
+ "result"
2258
+ ],
2259
+ "additionalProperties": false
2260
+ },
2261
+ "contact_relation_attribute": {
2262
+ "type": "string",
2263
+ "description": "Name of the Contact attribute to update with the matched Contact ID. Must be a Contact relation attribute supporting multiple entities.",
2264
+ "example": "represents_contact"
2265
+ },
2266
+ "explanation": {
2267
+ "type": "object",
2268
+ "properties": {
2269
+ "en": {
2270
+ "type": "string",
2271
+ "description": "Explanation of the functionality shown to the end user.",
2272
+ "example": "This process will give you access to all Contracts kept"
2273
+ }
2274
+ },
2275
+ "additionalProperties": {
2276
+ "type": "string",
2277
+ "description": "Explanation of the functionality in language denoted by ISO 3166-1 alpha-2 code."
2278
+ },
2279
+ "required": [
2280
+ "en"
2281
+ ],
2282
+ "description": "Explanation of the hook."
2283
+ }
2284
+ },
2285
+ "required": [
2286
+ "type",
2287
+ "call"
2288
+ ],
2289
+ "additionalProperties": false
2290
+ },
2291
+ "PortalExtensionHookMeterReadingPlausibilityCheck": {
2292
+ "description": "Hook that checks the plausibility of meter readings before they are saved. This hook makes a POST call whenever a user is trying to save a meter reading. The expected response to the call is:\n - 200:\n If meter reading is plausible, the response should contain:\n - valid: true\n If meter reading is not plausible, the response should contain:\n - valid: false\n",
2293
+ "type": "object",
2294
+ "properties": {
2295
+ "type": {
2296
+ "type": "string",
2297
+ "enum": [
2298
+ "meterReadingPlausibilityCheck"
2299
+ ]
2300
+ },
2301
+ "auth": {
2302
+ "$ref": "#/components/schemas/PortalExtensionAuthBlock"
2303
+ },
2304
+ "call": {
2305
+ "type": "object",
2306
+ "properties": {
2307
+ "url": {
2308
+ "type": "string",
2309
+ "description": "URL to call. Supports variable interpolation."
2310
+ },
2311
+ "body": {
2312
+ "type": "object",
2313
+ "description": "JSON body to use for the call. Supports variable interpolation.",
2314
+ "additionalProperties": {
2182
2315
  "type": "string"
2183
2316
  },
2184
- "auth": {
2185
- "$ref": "#/components/schemas/PortalAuth"
2317
+ "default": {}
2318
+ },
2319
+ "headers": {
2320
+ "type": "object",
2321
+ "description": "Headers to use. Supports variable interpolation.",
2322
+ "additionalProperties": {
2323
+ "type": "string"
2186
2324
  },
2187
- "redirect": {
2188
- "type": "object",
2189
- "properties": {
2190
- "url": {
2191
- "type": "string"
2192
- },
2193
- "params": {
2194
- "type": "object",
2195
- "additionalProperties": {
2196
- "type": "string"
2197
- }
2198
- }
2199
- }
2200
- }
2325
+ "default": {}
2201
2326
  }
2202
- }
2327
+ },
2328
+ "required": [
2329
+ "url",
2330
+ "headers",
2331
+ "body",
2332
+ "result"
2333
+ ],
2334
+ "additionalProperties": false
2335
+ },
2336
+ "resolved": {
2337
+ "type": "object",
2338
+ "description": "Response to the call",
2339
+ "properties": {
2340
+ "valid": {
2341
+ "type": "string",
2342
+ "description": "Indicate whether the meter reading is plausible",
2343
+ "example": "{{CallResponse.data.valid}}"
2344
+ },
2345
+ "upper_limit": {
2346
+ "type": "string",
2347
+ "description": "Upper allowed limit of the meter reading",
2348
+ "example": "{{CallResponse.data.upper_limit}}"
2349
+ },
2350
+ "lower_limit": {
2351
+ "type": "string",
2352
+ "description": "Lower allowed limit of the meter reading",
2353
+ "example": "{{CallResponse.data.lower_limit}}"
2354
+ }
2355
+ },
2356
+ "additionalProperties": false
2203
2357
  }
2204
- }
2358
+ },
2359
+ "required": [
2360
+ "type",
2361
+ "call",
2362
+ "resolved"
2363
+ ],
2364
+ "additionalProperties": false
2205
2365
  },
2206
- "PortalAuth": {
2366
+ "PortalExtensionHookPriceDataRetrieval": {
2367
+ "description": "Hook that will allow using the specified source as data for price 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:\n - 200 with the time series data\n",
2207
2368
  "type": "object",
2208
2369
  "properties": {
2209
2370
  "type": {
2210
- "type": "string"
2371
+ "type": "string",
2372
+ "enum": [
2373
+ "priceDataRetrieval"
2374
+ ]
2211
2375
  },
2212
- "url": {
2213
- "type": "string"
2376
+ "auth": {
2377
+ "$ref": "#/components/schemas/PortalExtensionAuthBlock"
2378
+ },
2379
+ "call": {
2380
+ "type": "object",
2381
+ "properties": {
2382
+ "method": {
2383
+ "type": "string",
2384
+ "description": "HTTP method to use for the call",
2385
+ "default": "GET"
2386
+ },
2387
+ "url": {
2388
+ "type": "string",
2389
+ "description": "URL to call. Supports variable interpolation."
2390
+ },
2391
+ "params": {
2392
+ "type": "object",
2393
+ "description": "Parameters to append to the URL. Supports variable interpolation.",
2394
+ "additionalProperties": {
2395
+ "type": "string"
2396
+ },
2397
+ "default": {}
2398
+ },
2399
+ "headers": {
2400
+ "type": "object",
2401
+ "description": "Headers to use. Supports variable interpolation.",
2402
+ "additionalProperties": {
2403
+ "type": "string"
2404
+ },
2405
+ "default": {}
2406
+ },
2407
+ "body": {
2408
+ "type": "object",
2409
+ "description": "Request body to send. Supports variable interpolation. Content format is determined by Content-Type header.",
2410
+ "additionalProperties": {
2411
+ "type": "string"
2412
+ },
2413
+ "default": {}
2414
+ }
2415
+ },
2416
+ "required": [
2417
+ "url"
2418
+ ],
2419
+ "additionalProperties": false
2214
2420
  },
2421
+ "resolved": {
2422
+ "type": "object",
2423
+ "properties": {
2424
+ "dataPath": {
2425
+ "type": "string",
2426
+ "description": "Optional path to the data (array) in the response. If omitted, the data is assumed to be on the top level."
2427
+ }
2428
+ },
2429
+ "additionalProperties": false
2430
+ }
2431
+ },
2432
+ "required": [
2433
+ "type",
2434
+ "call",
2435
+ "resolved"
2436
+ ],
2437
+ "additionalProperties": false
2438
+ },
2439
+ "PortalExtensionHookConsumptionDataRetrieval": {
2440
+ "description": "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:\n - 200 with the time series data\n",
2441
+ "type": "object",
2442
+ "properties": {
2443
+ "type": {
2444
+ "type": "string",
2445
+ "enum": [
2446
+ "consumptionDataRetrieval"
2447
+ ]
2448
+ },
2449
+ "auth": {
2450
+ "$ref": "#/components/schemas/PortalExtensionAuthBlock"
2451
+ },
2452
+ "call": {
2453
+ "type": "object",
2454
+ "properties": {
2455
+ "method": {
2456
+ "type": "string",
2457
+ "description": "HTTP method to use for the call",
2458
+ "default": "GET"
2459
+ },
2460
+ "url": {
2461
+ "type": "string",
2462
+ "description": "URL to call. Supports variable interpolation."
2463
+ },
2464
+ "params": {
2465
+ "type": "object",
2466
+ "description": "Parameters to append to the URL. Supports variable interpolation.",
2467
+ "additionalProperties": {
2468
+ "type": "string"
2469
+ },
2470
+ "default": {}
2471
+ },
2472
+ "headers": {
2473
+ "type": "object",
2474
+ "description": "Headers to use. Supports variable interpolation.",
2475
+ "additionalProperties": {
2476
+ "type": "string"
2477
+ },
2478
+ "default": {}
2479
+ },
2480
+ "body": {
2481
+ "type": "object",
2482
+ "description": "Request body to send. Supports variable interpolation. Content format is determined by Content-Type header.",
2483
+ "additionalProperties": {
2484
+ "type": "string"
2485
+ },
2486
+ "default": {}
2487
+ }
2488
+ },
2489
+ "required": [
2490
+ "url"
2491
+ ],
2492
+ "additionalProperties": false
2493
+ },
2494
+ "resolved": {
2495
+ "type": "object",
2496
+ "properties": {
2497
+ "dataPath": {
2498
+ "type": "string",
2499
+ "description": "Optional path to the data (array) in the response. If omitted, the data is assumed to be on the top level."
2500
+ }
2501
+ },
2502
+ "additionalProperties": false
2503
+ }
2504
+ },
2505
+ "required": [
2506
+ "type",
2507
+ "call",
2508
+ "resolved"
2509
+ ],
2510
+ "additionalProperties": false
2511
+ },
2512
+ "PortalExtensionHookCostDataRetrieval": {
2513
+ "description": "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:\n - 200 with the time series data\n",
2514
+ "type": "object",
2515
+ "properties": {
2516
+ "type": {
2517
+ "type": "string",
2518
+ "enum": [
2519
+ "costDataRetrieval"
2520
+ ]
2521
+ },
2522
+ "auth": {
2523
+ "$ref": "#/components/schemas/PortalExtensionAuthBlock"
2524
+ },
2525
+ "call": {
2526
+ "type": "object",
2527
+ "properties": {
2528
+ "method": {
2529
+ "type": "string",
2530
+ "description": "HTTP method to use for the call",
2531
+ "default": "GET"
2532
+ },
2533
+ "url": {
2534
+ "type": "string",
2535
+ "description": "URL to call. Supports variable interpolation."
2536
+ },
2537
+ "params": {
2538
+ "type": "object",
2539
+ "description": "Parameters to append to the URL. Supports variable interpolation.",
2540
+ "additionalProperties": {
2541
+ "type": "string"
2542
+ },
2543
+ "default": {}
2544
+ },
2545
+ "headers": {
2546
+ "type": "object",
2547
+ "description": "Headers to use. Supports variable interpolation.",
2548
+ "additionalProperties": {
2549
+ "type": "string"
2550
+ },
2551
+ "default": {}
2552
+ },
2553
+ "body": {
2554
+ "type": "object",
2555
+ "description": "Request body to send. Supports variable interpolation. Content format is determined by Content-Type header.",
2556
+ "additionalProperties": {
2557
+ "type": "string"
2558
+ },
2559
+ "default": {}
2560
+ }
2561
+ },
2562
+ "required": [
2563
+ "url"
2564
+ ],
2565
+ "additionalProperties": false
2566
+ },
2567
+ "resolved": {
2568
+ "type": "object",
2569
+ "properties": {
2570
+ "dataPath": {
2571
+ "type": "string",
2572
+ "description": "Optional path to the data (array) in the response. If omitted, the data is assumed to be on the top level."
2573
+ }
2574
+ },
2575
+ "additionalProperties": false
2576
+ }
2577
+ },
2578
+ "required": [
2579
+ "type",
2580
+ "call"
2581
+ ],
2582
+ "additionalProperties": false
2583
+ },
2584
+ "PortalExtensionSeamlessLink": {
2585
+ "type": "object",
2586
+ "properties": {
2587
+ "id": {
2588
+ "type": "string",
2589
+ "description": "Identifier of the link. Should not change between updates."
2590
+ },
2591
+ "name": {
2592
+ "$ref": "#/components/schemas/TranslatedString"
2593
+ },
2594
+ "description": {
2595
+ "$ref": "#/components/schemas/TranslatedString"
2596
+ },
2597
+ "type": {
2598
+ "type": "string",
2599
+ "enum": [
2600
+ "seamless"
2601
+ ]
2602
+ },
2603
+ "condition": {
2604
+ "type": "string",
2605
+ "description": "Controls whether the link should be shown. Supports variable interpolation.",
2606
+ "example": "{{Contact.customer_number | is_not_empty}}"
2607
+ },
2608
+ "auth": {
2609
+ "$ref": "#/components/schemas/PortalExtensionAuthBlock"
2610
+ },
2611
+ "redirect": {
2612
+ "type": "object",
2613
+ "properties": {
2614
+ "url": {
2615
+ "type": "string",
2616
+ "description": "URL to redirect to. Supports variable interpolation."
2617
+ },
2618
+ "params": {
2619
+ "type": "object",
2620
+ "description": "Parameters to append to the URL. Supports variable interpolation.",
2621
+ "additionalProperties": {
2622
+ "type": "string"
2623
+ },
2624
+ "default": {}
2625
+ }
2626
+ },
2627
+ "additionalProperties": false
2628
+ }
2629
+ },
2630
+ "required": [
2631
+ "id",
2632
+ "name",
2633
+ "type",
2634
+ "redirect"
2635
+ ],
2636
+ "additionalProperties": false
2637
+ },
2638
+ "PortalExtensionAuthBlock": {
2639
+ "type": "object",
2640
+ "properties": {
2215
2641
  "method": {
2216
- "type": "string"
2642
+ "type": "string",
2643
+ "description": "HTTP method to use for authentication",
2644
+ "default": "GET"
2645
+ },
2646
+ "url": {
2647
+ "type": "string",
2648
+ "description": "URL to use for authentication. Supports variable interpolation."
2649
+ },
2650
+ "params": {
2651
+ "type": "object",
2652
+ "description": "Parameters to append to the URL. Supports variable interpolation.",
2653
+ "additionalProperties": {
2654
+ "type": "string"
2655
+ },
2656
+ "default": {}
2217
2657
  },
2218
2658
  "headers": {
2219
2659
  "type": "object",
2660
+ "description": "Headers to use for authentication. Supports variable interpolation.",
2220
2661
  "additionalProperties": {
2221
2662
  "type": "string"
2222
- }
2663
+ },
2664
+ "default": {}
2665
+ },
2666
+ "body": {
2667
+ "type": "object",
2668
+ "description": "JSON body to use for authentication. Supports variable interpolation. Content format is determined by Content-Type header.",
2669
+ "additionalProperties": {
2670
+ "type": "string"
2671
+ },
2672
+ "default": {}
2673
+ },
2674
+ "cache": {
2675
+ "type": "object",
2676
+ "properties": {
2677
+ "key": {
2678
+ "type": "string",
2679
+ "description": "Key to use to identify the auth response. Supports interpolation.",
2680
+ "example": "{{Options.api_key}}"
2681
+ },
2682
+ "ttl": {
2683
+ "type": "string",
2684
+ "description": "Time to live in seconds for the cache. Supports interpolation.",
2685
+ "example": "{{AuthResponse.data.expires_in}}"
2686
+ }
2687
+ },
2688
+ "required": [
2689
+ "key",
2690
+ "ttl"
2691
+ ],
2692
+ "additionalProperties": false
2223
2693
  }
2224
- }
2694
+ },
2695
+ "required": [
2696
+ "url"
2697
+ ],
2698
+ "additionalProperties": false
2225
2699
  },
2226
2700
  "OverrideDevMode": {
2227
2701
  "type": "object",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/app-client",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
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,6 +21,19 @@
21
21
  "sdk",
22
22
  "app"
23
23
  ],
24
+ "scripts": {
25
+ "test": "jest",
26
+ "typescript": "tsc",
27
+ "bundle-definition": "webpack",
28
+ "openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/app.yaml",
29
+ "typegen": "openapi typegen src/openapi.json --client -b '/* eslint-disable */' > src/openapi.d.ts",
30
+ "build": "tsc && npm run build:patch && npm run bundle-definition",
31
+ "build:patch": "sed -i'' -e '/^__exportStar.*openapi.*$/d' dist/index.js",
32
+ "build:watch": "npm run build && tsc -w",
33
+ "release-alpha": "npm version prerelease --preid alpha",
34
+ "prepublishOnly": "npm run typegen && npm run build",
35
+ "lint": "pnpm exec eslint src"
36
+ },
24
37
  "files": [
25
38
  "*.js",
26
39
  "*.d.ts",
@@ -60,17 +73,5 @@
60
73
  "webpack": "^5.18.0",
61
74
  "webpack-cli": "^4.4.0"
62
75
  },
63
- "gitHead": "39426e86cfb320fa3227dc03f60ee6a10848e7c7",
64
- "scripts": {
65
- "test": "jest",
66
- "typescript": "tsc",
67
- "bundle-definition": "webpack",
68
- "openapi": "node ../../scripts/update-openapi.js ../../../backend/app-api/openapi.yml",
69
- "typegen": "openapi typegen src/openapi.json --client -b '/* eslint-disable */' > src/openapi.d.ts",
70
- "build": "tsc && npm run build:patch && npm run bundle-definition",
71
- "build:patch": "sed -i'' -e '/^__exportStar.*openapi.*$/d' dist/index.js",
72
- "build:watch": "npm run build && tsc -w",
73
- "release-alpha": "npm version prerelease --preid alpha",
74
- "lint": "pnpm exec eslint src"
75
- }
76
- }
76
+ "gitHead": "39426e86cfb320fa3227dc03f60ee6a10848e7c7"
77
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2025 epilot GmbH
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.