@epilot/app-client 0.9.2 → 0.9.4

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,439 @@ 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
1237
  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
- }[];
1238
+ } & (/**
1239
+ * 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:
1240
+ * - 200 with contact id if exactly one contact is found
1241
+ * - 404 if no contact is found or more than contact is found
1242
+ *
1243
+ */
1244
+ PortalExtensionHookRegistrationIdentifiersCheck | /**
1245
+ * 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:
1246
+ * - 200 if found with either:
1247
+ * - contract_id array
1248
+ * - contact_id string
1249
+ * - 404 if no contract is found
1250
+ * 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.
1251
+ *
1252
+ */
1253
+ PortalExtensionHookContractIdentification | /**
1254
+ * 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:
1255
+ * - 200 with the time series data
1256
+ *
1257
+ */
1258
+ PortalExtensionHookPriceDataRetrieval | /**
1259
+ * 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:
1260
+ * - 200 with the time series data
1261
+ *
1262
+ */
1263
+ PortalExtensionHookConsumptionDataRetrieval | /**
1264
+ * 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:
1265
+ * - 200 with the time series data
1266
+ *
1267
+ */
1268
+ PortalExtensionHookCostDataRetrieval | /**
1269
+ * 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:
1270
+ * - 200:
1271
+ * If meter reading is plausible, the response should contain:
1272
+ * - valid: true
1273
+ * If meter reading is not plausible, the response should contain:
1274
+ * - valid: false
1275
+ *
1276
+ */
1277
+ PortalExtensionHookMeterReadingPlausibilityCheck))[];
1216
1278
  links?: {
1217
- id?: string;
1218
- type?: string;
1219
- name?: TranslatedString;
1279
+ /**
1280
+ * Identifier of the link. Should not change between updates.
1281
+ */
1282
+ id: string;
1283
+ name: TranslatedString;
1220
1284
  description?: TranslatedString;
1285
+ type: "seamless";
1286
+ /**
1287
+ * Controls whether the link should be shown. Supports variable interpolation.
1288
+ * example:
1289
+ * {{Contact.customer_number | is_not_empty}}
1290
+ */
1221
1291
  condition?: string;
1222
- auth?: PortalAuth;
1223
- redirect?: {
1292
+ auth?: PortalExtensionAuthBlock;
1293
+ redirect: {
1294
+ /**
1295
+ * URL to redirect to. Supports variable interpolation.
1296
+ */
1224
1297
  url?: string;
1298
+ /**
1299
+ * Parameters to append to the URL. Supports variable interpolation.
1300
+ */
1225
1301
  params?: {
1226
1302
  [name: string]: string;
1227
1303
  };
1228
1304
  };
1229
1305
  }[];
1230
1306
  }
1307
+ export interface PortalExtensionHook {
1308
+ /**
1309
+ * Identifier of the hook. Should not change between updates.
1310
+ */
1311
+ id?: string;
1312
+ name?: TranslatedString;
1313
+ }
1314
+ /**
1315
+ * 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:
1316
+ * - 200 with the time series data
1317
+ *
1318
+ */
1319
+ export interface PortalExtensionHookConsumptionDataRetrieval {
1320
+ type: "consumptionDataRetrieval";
1321
+ /**
1322
+ * Intervals supported by the API. If omitted, it is assumed that all intervals are supported.
1323
+ */
1324
+ intervals?: ("PT15M" | "PT1H" | "P1D" | "P1M")[];
1325
+ auth?: PortalExtensionAuthBlock;
1326
+ call: {
1327
+ /**
1328
+ * HTTP method to use for the call
1329
+ */
1330
+ method?: string;
1331
+ /**
1332
+ * URL to call. Supports variable interpolation.
1333
+ */
1334
+ url: string;
1335
+ /**
1336
+ * Parameters to append to the URL. Supports variable interpolation.
1337
+ */
1338
+ params?: {
1339
+ [name: string]: string;
1340
+ };
1341
+ /**
1342
+ * Headers to use. Supports variable interpolation.
1343
+ */
1344
+ headers?: {
1345
+ [name: string]: string;
1346
+ };
1347
+ /**
1348
+ * Request body to send. Supports variable interpolation. Content format is determined by Content-Type header.
1349
+ */
1350
+ body?: {
1351
+ [name: string]: string;
1352
+ };
1353
+ };
1354
+ resolved?: {
1355
+ /**
1356
+ * Optional path to the data (array) in the response. If omitted, the data is assumed to be on the top level.
1357
+ */
1358
+ dataPath?: string;
1359
+ };
1360
+ }
1361
+ /**
1362
+ * 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:
1363
+ * - 200 if found with either:
1364
+ * - contract_id array
1365
+ * - contact_id string
1366
+ * - 404 if no contract is found
1367
+ * 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.
1368
+ *
1369
+ */
1370
+ export interface PortalExtensionHookContractIdentification {
1371
+ type: "contractIdentification";
1372
+ auth?: PortalExtensionAuthBlock;
1373
+ call: {
1374
+ /**
1375
+ * URL to call. Supports variable interpolation.
1376
+ */
1377
+ url: string;
1378
+ /**
1379
+ * Parameters to append to the URL. Supports variable interpolation.
1380
+ */
1381
+ params?: {
1382
+ [name: string]: string;
1383
+ };
1384
+ /**
1385
+ * Headers to use. Supports variable interpolation.
1386
+ */
1387
+ headers: {
1388
+ [name: string]: string;
1389
+ };
1390
+ };
1391
+ /**
1392
+ * Name of the Contact attribute to update with the matched Contact ID. Must be a Contact relation attribute supporting multiple entities.
1393
+ * example:
1394
+ * represents_contact
1395
+ */
1396
+ contact_relation_attribute?: string;
1397
+ /**
1398
+ * Explanation of the hook.
1399
+ */
1400
+ explanation?: {
1401
+ [name: string]: string;
1402
+ /**
1403
+ * Explanation of the functionality shown to the end user.
1404
+ * example:
1405
+ * This process will give you access to all Contracts kept
1406
+ */
1407
+ en: string;
1408
+ };
1409
+ }
1410
+ /**
1411
+ * 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:
1412
+ * - 200 with the time series data
1413
+ *
1414
+ */
1415
+ export interface PortalExtensionHookCostDataRetrieval {
1416
+ type: "costDataRetrieval";
1417
+ /**
1418
+ * Intervals supported by the API. If omitted, it is assumed that all intervals are supported.
1419
+ */
1420
+ intervals?: ("PT15M" | "PT1H" | "P1D" | "P1M")[];
1421
+ auth?: PortalExtensionAuthBlock;
1422
+ call: {
1423
+ /**
1424
+ * HTTP method to use for the call
1425
+ */
1426
+ method?: string;
1427
+ /**
1428
+ * URL to call. Supports variable interpolation.
1429
+ */
1430
+ url: string;
1431
+ /**
1432
+ * Parameters to append to the URL. Supports variable interpolation.
1433
+ */
1434
+ params?: {
1435
+ [name: string]: string;
1436
+ };
1437
+ /**
1438
+ * Headers to use. Supports variable interpolation.
1439
+ */
1440
+ headers?: {
1441
+ [name: string]: string;
1442
+ };
1443
+ /**
1444
+ * Request body to send. Supports variable interpolation. Content format is determined by Content-Type header.
1445
+ */
1446
+ body?: {
1447
+ [name: string]: string;
1448
+ };
1449
+ };
1450
+ resolved?: {
1451
+ /**
1452
+ * Optional path to the data (array) in the response. If omitted, the data is assumed to be on the top level.
1453
+ */
1454
+ dataPath?: string;
1455
+ };
1456
+ }
1457
+ /**
1458
+ * 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:
1459
+ * - 200:
1460
+ * If meter reading is plausible, the response should contain:
1461
+ * - valid: true
1462
+ * If meter reading is not plausible, the response should contain:
1463
+ * - valid: false
1464
+ *
1465
+ */
1466
+ export interface PortalExtensionHookMeterReadingPlausibilityCheck {
1467
+ type: "meterReadingPlausibilityCheck";
1468
+ auth?: PortalExtensionAuthBlock;
1469
+ call: {
1470
+ /**
1471
+ * URL to call. Supports variable interpolation.
1472
+ */
1473
+ url: string;
1474
+ /**
1475
+ * JSON body to use for the call. Supports variable interpolation.
1476
+ */
1477
+ body: {
1478
+ [name: string]: string;
1479
+ };
1480
+ /**
1481
+ * Headers to use. Supports variable interpolation.
1482
+ */
1483
+ headers: {
1484
+ [name: string]: string;
1485
+ };
1486
+ };
1487
+ /**
1488
+ * Response to the call
1489
+ */
1490
+ resolved?: {
1491
+ /**
1492
+ * Indicate whether the meter reading is plausible
1493
+ * example:
1494
+ * {{CallResponse.data.valid}}
1495
+ */
1496
+ valid?: string;
1497
+ /**
1498
+ * Upper allowed limit of the meter reading
1499
+ * example:
1500
+ * {{CallResponse.data.upper_limit}}
1501
+ */
1502
+ upper_limit?: string;
1503
+ /**
1504
+ * Lower allowed limit of the meter reading
1505
+ * example:
1506
+ * {{CallResponse.data.lower_limit}}
1507
+ */
1508
+ lower_limit?: string;
1509
+ };
1510
+ }
1511
+ /**
1512
+ * 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:
1513
+ * - 200 with the time series data
1514
+ *
1515
+ */
1516
+ export interface PortalExtensionHookPriceDataRetrieval {
1517
+ type: "priceDataRetrieval";
1518
+ /**
1519
+ * Intervals supported by the API. If omitted, it is assumed that all intervals are supported.
1520
+ */
1521
+ intervals?: ("PT15M" | "PT1H" | "P1D" | "P1M")[];
1522
+ auth?: PortalExtensionAuthBlock;
1523
+ call: {
1524
+ /**
1525
+ * HTTP method to use for the call
1526
+ */
1527
+ method?: string;
1528
+ /**
1529
+ * URL to call. Supports variable interpolation.
1530
+ */
1531
+ url: string;
1532
+ /**
1533
+ * Parameters to append to the URL. Supports variable interpolation.
1534
+ */
1535
+ params?: {
1536
+ [name: string]: string;
1537
+ };
1538
+ /**
1539
+ * Headers to use. Supports variable interpolation.
1540
+ */
1541
+ headers?: {
1542
+ [name: string]: string;
1543
+ };
1544
+ /**
1545
+ * Request body to send. Supports variable interpolation. Content format is determined by Content-Type header.
1546
+ */
1547
+ body?: {
1548
+ [name: string]: string;
1549
+ };
1550
+ };
1551
+ resolved?: {
1552
+ /**
1553
+ * Optional path to the data (array) in the response. If omitted, the data is assumed to be on the top level.
1554
+ */
1555
+ dataPath?: string;
1556
+ };
1557
+ }
1558
+ /**
1559
+ * 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:
1560
+ * - 200 with contact id if exactly one contact is found
1561
+ * - 404 if no contact is found or more than contact is found
1562
+ *
1563
+ */
1564
+ export interface PortalExtensionHookRegistrationIdentifiersCheck {
1565
+ type: "registrationIdentifiersCheck";
1566
+ auth?: PortalExtensionAuthBlock;
1567
+ call: {
1568
+ /**
1569
+ * URL to call. Supports variable interpolation.
1570
+ */
1571
+ url: string;
1572
+ /**
1573
+ * Parameters to append to the URL. Supports variable interpolation.
1574
+ */
1575
+ params?: {
1576
+ [name: string]: string;
1577
+ };
1578
+ /**
1579
+ * Headers to use. Supports variable interpolation.
1580
+ */
1581
+ headers: {
1582
+ [name: string]: string;
1583
+ };
1584
+ /**
1585
+ * Contact ID usually retrieved from the response body, e.g. `{{CallResponse.data.contact_id}}`. Supports variable interpolation.
1586
+ */
1587
+ result: string;
1588
+ };
1589
+ }
1590
+ export interface PortalExtensionSeamlessLink {
1591
+ /**
1592
+ * Identifier of the link. Should not change between updates.
1593
+ */
1594
+ id: string;
1595
+ name: TranslatedString;
1596
+ description?: TranslatedString;
1597
+ type: "seamless";
1598
+ /**
1599
+ * Controls whether the link should be shown. Supports variable interpolation.
1600
+ * example:
1601
+ * {{Contact.customer_number | is_not_empty}}
1602
+ */
1603
+ condition?: string;
1604
+ auth?: PortalExtensionAuthBlock;
1605
+ redirect: {
1606
+ /**
1607
+ * URL to redirect to. Supports variable interpolation.
1608
+ */
1609
+ url?: string;
1610
+ /**
1611
+ * Parameters to append to the URL. Supports variable interpolation.
1612
+ */
1613
+ params?: {
1614
+ [name: string]: string;
1615
+ };
1616
+ };
1617
+ }
1231
1618
  export interface Pricing {
1232
1619
  pricing_type?: "FREE" | "SUBSCRIPTION" | "USAGE_BASED" | "ONE_TIME" | "CUSTOM" | "UNKNOWN";
1233
1620
  billing_frequency?: /* How often the subscription is billed */ BillingFrequency;
@@ -2596,9 +2983,17 @@ export type Option = Components.Schemas.Option;
2596
2983
  export type Options = Components.Schemas.Options;
2597
2984
  export type OptionsRef = Components.Schemas.OptionsRef;
2598
2985
  export type OverrideDevMode = Components.Schemas.OverrideDevMode;
2599
- export type PortalAuth = Components.Schemas.PortalAuth;
2986
+ export type PortalExtensionAuthBlock = Components.Schemas.PortalExtensionAuthBlock;
2600
2987
  export type PortalExtensionComponent = Components.Schemas.PortalExtensionComponent;
2601
2988
  export type PortalExtensionConfig = Components.Schemas.PortalExtensionConfig;
2989
+ export type PortalExtensionHook = Components.Schemas.PortalExtensionHook;
2990
+ export type PortalExtensionHookConsumptionDataRetrieval = Components.Schemas.PortalExtensionHookConsumptionDataRetrieval;
2991
+ export type PortalExtensionHookContractIdentification = Components.Schemas.PortalExtensionHookContractIdentification;
2992
+ export type PortalExtensionHookCostDataRetrieval = Components.Schemas.PortalExtensionHookCostDataRetrieval;
2993
+ export type PortalExtensionHookMeterReadingPlausibilityCheck = Components.Schemas.PortalExtensionHookMeterReadingPlausibilityCheck;
2994
+ export type PortalExtensionHookPriceDataRetrieval = Components.Schemas.PortalExtensionHookPriceDataRetrieval;
2995
+ export type PortalExtensionHookRegistrationIdentifiersCheck = Components.Schemas.PortalExtensionHookRegistrationIdentifiersCheck;
2996
+ export type PortalExtensionSeamlessLink = Components.Schemas.PortalExtensionSeamlessLink;
2602
2997
  export type Pricing = Components.Schemas.Pricing;
2603
2998
  export type PublicConfiguration = Components.Schemas.PublicConfiguration;
2604
2999
  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,636 @@
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": {
2111
+ "allOf": [
2112
+ {
2113
+ "$ref": "#/components/schemas/PortalExtensionHook"
2114
+ },
2115
+ {
2116
+ "oneOf": [
2117
+ {
2118
+ "$ref": "#/components/schemas/PortalExtensionHookRegistrationIdentifiersCheck"
2119
+ },
2120
+ {
2121
+ "$ref": "#/components/schemas/PortalExtensionHookContractIdentification"
2122
+ },
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"
2134
+ }
2135
+ ]
2136
+ }
2137
+ ]
2138
+ }
2139
+ },
2140
+ "links": {
2141
+ "type": "array",
2142
+ "items": {
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
+ "name": {
2161
+ "$ref": "#/components/schemas/TranslatedString"
2162
+ }
2163
+ }
2164
+ },
2165
+ "PortalExtensionHookRegistrationIdentifiersCheck": {
2166
+ "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",
2167
+ "type": "object",
2168
+ "properties": {
2169
+ "type": {
2170
+ "type": "string",
2171
+ "enum": [
2172
+ "registrationIdentifiersCheck"
2173
+ ]
2174
+ },
2175
+ "auth": {
2176
+ "$ref": "#/components/schemas/PortalExtensionAuthBlock"
2177
+ },
2178
+ "call": {
2179
+ "type": "object",
2180
+ "properties": {
2181
+ "url": {
2182
+ "type": "string",
2183
+ "description": "URL to call. Supports variable interpolation."
2184
+ },
2185
+ "params": {
2186
+ "type": "object",
2187
+ "description": "Parameters to append to the URL. Supports variable interpolation.",
2188
+ "additionalProperties": {
2124
2189
  "type": "string"
2125
2190
  },
2126
- "type": {
2191
+ "default": {}
2192
+ },
2193
+ "headers": {
2194
+ "type": "object",
2195
+ "description": "Headers to use. Supports variable interpolation.",
2196
+ "additionalProperties": {
2127
2197
  "type": "string"
2128
2198
  },
2129
- "name": {
2130
- "$ref": "#/components/schemas/TranslatedString"
2199
+ "default": {}
2200
+ },
2201
+ "result": {
2202
+ "type": "string",
2203
+ "description": "Contact ID usually retrieved from the response body, e.g. `{{CallResponse.data.contact_id}}`. Supports variable interpolation."
2204
+ }
2205
+ },
2206
+ "required": [
2207
+ "url",
2208
+ "headers",
2209
+ "result"
2210
+ ],
2211
+ "additionalProperties": false
2212
+ }
2213
+ },
2214
+ "required": [
2215
+ "type",
2216
+ "call"
2217
+ ],
2218
+ "additionalProperties": false
2219
+ },
2220
+ "PortalExtensionHookContractIdentification": {
2221
+ "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",
2222
+ "type": "object",
2223
+ "properties": {
2224
+ "type": {
2225
+ "type": "string",
2226
+ "enum": [
2227
+ "contractIdentification"
2228
+ ]
2229
+ },
2230
+ "auth": {
2231
+ "$ref": "#/components/schemas/PortalExtensionAuthBlock"
2232
+ },
2233
+ "call": {
2234
+ "type": "object",
2235
+ "properties": {
2236
+ "url": {
2237
+ "type": "string",
2238
+ "description": "URL to call. Supports variable interpolation."
2239
+ },
2240
+ "params": {
2241
+ "type": "object",
2242
+ "description": "Parameters to append to the URL. Supports variable interpolation.",
2243
+ "additionalProperties": {
2244
+ "type": "string"
2131
2245
  },
2132
- "interval": {
2133
- "type": "array",
2134
- "items": {
2135
- "type": "string"
2136
- }
2246
+ "default": {}
2247
+ },
2248
+ "headers": {
2249
+ "type": "object",
2250
+ "description": "Headers to use. Supports variable interpolation.",
2251
+ "additionalProperties": {
2252
+ "type": "string"
2137
2253
  },
2138
- "auth": {
2139
- "$ref": "#/components/schemas/PortalAuth"
2254
+ "default": {}
2255
+ }
2256
+ },
2257
+ "required": [
2258
+ "url",
2259
+ "headers",
2260
+ "result"
2261
+ ],
2262
+ "additionalProperties": false
2263
+ },
2264
+ "contact_relation_attribute": {
2265
+ "type": "string",
2266
+ "description": "Name of the Contact attribute to update with the matched Contact ID. Must be a Contact relation attribute supporting multiple entities.",
2267
+ "example": "represents_contact"
2268
+ },
2269
+ "explanation": {
2270
+ "type": "object",
2271
+ "properties": {
2272
+ "en": {
2273
+ "type": "string",
2274
+ "description": "Explanation of the functionality shown to the end user.",
2275
+ "example": "This process will give you access to all Contracts kept"
2276
+ }
2277
+ },
2278
+ "additionalProperties": {
2279
+ "type": "string",
2280
+ "description": "Explanation of the functionality in language denoted by ISO 3166-1 alpha-2 code."
2281
+ },
2282
+ "required": [
2283
+ "en"
2284
+ ],
2285
+ "description": "Explanation of the hook."
2286
+ }
2287
+ },
2288
+ "required": [
2289
+ "type",
2290
+ "call"
2291
+ ],
2292
+ "additionalProperties": false
2293
+ },
2294
+ "PortalExtensionHookMeterReadingPlausibilityCheck": {
2295
+ "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",
2296
+ "type": "object",
2297
+ "properties": {
2298
+ "type": {
2299
+ "type": "string",
2300
+ "enum": [
2301
+ "meterReadingPlausibilityCheck"
2302
+ ]
2303
+ },
2304
+ "auth": {
2305
+ "$ref": "#/components/schemas/PortalExtensionAuthBlock"
2306
+ },
2307
+ "call": {
2308
+ "type": "object",
2309
+ "properties": {
2310
+ "url": {
2311
+ "type": "string",
2312
+ "description": "URL to call. Supports variable interpolation."
2313
+ },
2314
+ "body": {
2315
+ "type": "object",
2316
+ "description": "JSON body to use for the call. Supports variable interpolation.",
2317
+ "additionalProperties": {
2318
+ "type": "string"
2140
2319
  },
2141
- "call": {
2142
- "type": "object",
2143
- "properties": {
2144
- "url": {
2145
- "type": "string"
2146
- },
2147
- "headers": {
2148
- "type": "object",
2149
- "additionalProperties": {
2150
- "type": "string"
2151
- }
2152
- },
2153
- "params": {
2154
- "type": "object",
2155
- "additionalProperties": {
2156
- "type": "string"
2157
- }
2158
- }
2159
- }
2160
- }
2320
+ "default": {}
2321
+ },
2322
+ "headers": {
2323
+ "type": "object",
2324
+ "description": "Headers to use. Supports variable interpolation.",
2325
+ "additionalProperties": {
2326
+ "type": "string"
2327
+ },
2328
+ "default": {}
2161
2329
  }
2162
- }
2330
+ },
2331
+ "required": [
2332
+ "url",
2333
+ "headers",
2334
+ "body",
2335
+ "result"
2336
+ ],
2337
+ "additionalProperties": false
2163
2338
  },
2164
- "links": {
2339
+ "resolved": {
2340
+ "type": "object",
2341
+ "description": "Response to the call",
2342
+ "properties": {
2343
+ "valid": {
2344
+ "type": "string",
2345
+ "description": "Indicate whether the meter reading is plausible",
2346
+ "example": "{{CallResponse.data.valid}}"
2347
+ },
2348
+ "upper_limit": {
2349
+ "type": "string",
2350
+ "description": "Upper allowed limit of the meter reading",
2351
+ "example": "{{CallResponse.data.upper_limit}}"
2352
+ },
2353
+ "lower_limit": {
2354
+ "type": "string",
2355
+ "description": "Lower allowed limit of the meter reading",
2356
+ "example": "{{CallResponse.data.lower_limit}}"
2357
+ }
2358
+ },
2359
+ "additionalProperties": false
2360
+ }
2361
+ },
2362
+ "required": [
2363
+ "type",
2364
+ "call"
2365
+ ],
2366
+ "additionalProperties": false
2367
+ },
2368
+ "PortalExtensionHookPriceDataRetrieval": {
2369
+ "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",
2370
+ "type": "object",
2371
+ "properties": {
2372
+ "type": {
2373
+ "type": "string",
2374
+ "enum": [
2375
+ "priceDataRetrieval"
2376
+ ]
2377
+ },
2378
+ "intervals": {
2165
2379
  "type": "array",
2380
+ "description": "Intervals supported by the API. If omitted, it is assumed that all intervals are supported.",
2166
2381
  "items": {
2167
- "type": "object",
2168
- "properties": {
2169
- "id": {
2382
+ "type": "string",
2383
+ "enum": [
2384
+ "PT15M",
2385
+ "PT1H",
2386
+ "P1D",
2387
+ "P1M"
2388
+ ]
2389
+ }
2390
+ },
2391
+ "auth": {
2392
+ "$ref": "#/components/schemas/PortalExtensionAuthBlock"
2393
+ },
2394
+ "call": {
2395
+ "type": "object",
2396
+ "properties": {
2397
+ "method": {
2398
+ "type": "string",
2399
+ "description": "HTTP method to use for the call",
2400
+ "default": "GET"
2401
+ },
2402
+ "url": {
2403
+ "type": "string",
2404
+ "description": "URL to call. Supports variable interpolation."
2405
+ },
2406
+ "params": {
2407
+ "type": "object",
2408
+ "description": "Parameters to append to the URL. Supports variable interpolation.",
2409
+ "additionalProperties": {
2170
2410
  "type": "string"
2171
2411
  },
2172
- "type": {
2412
+ "default": {}
2413
+ },
2414
+ "headers": {
2415
+ "type": "object",
2416
+ "description": "Headers to use. Supports variable interpolation.",
2417
+ "additionalProperties": {
2173
2418
  "type": "string"
2174
2419
  },
2175
- "name": {
2176
- "$ref": "#/components/schemas/TranslatedString"
2420
+ "default": {}
2421
+ },
2422
+ "body": {
2423
+ "type": "object",
2424
+ "description": "Request body to send. Supports variable interpolation. Content format is determined by Content-Type header.",
2425
+ "additionalProperties": {
2426
+ "type": "string"
2177
2427
  },
2178
- "description": {
2179
- "$ref": "#/components/schemas/TranslatedString"
2428
+ "default": {}
2429
+ }
2430
+ },
2431
+ "required": [
2432
+ "url"
2433
+ ],
2434
+ "additionalProperties": false
2435
+ },
2436
+ "resolved": {
2437
+ "type": "object",
2438
+ "properties": {
2439
+ "dataPath": {
2440
+ "type": "string",
2441
+ "description": "Optional path to the data (array) in the response. If omitted, the data is assumed to be on the top level."
2442
+ }
2443
+ },
2444
+ "additionalProperties": false
2445
+ }
2446
+ },
2447
+ "required": [
2448
+ "type",
2449
+ "call"
2450
+ ],
2451
+ "additionalProperties": false
2452
+ },
2453
+ "PortalExtensionHookConsumptionDataRetrieval": {
2454
+ "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",
2455
+ "type": "object",
2456
+ "properties": {
2457
+ "type": {
2458
+ "type": "string",
2459
+ "enum": [
2460
+ "consumptionDataRetrieval"
2461
+ ]
2462
+ },
2463
+ "intervals": {
2464
+ "type": "array",
2465
+ "description": "Intervals supported by the API. If omitted, it is assumed that all intervals are supported.",
2466
+ "items": {
2467
+ "type": "string",
2468
+ "enum": [
2469
+ "PT15M",
2470
+ "PT1H",
2471
+ "P1D",
2472
+ "P1M"
2473
+ ]
2474
+ }
2475
+ },
2476
+ "auth": {
2477
+ "$ref": "#/components/schemas/PortalExtensionAuthBlock"
2478
+ },
2479
+ "call": {
2480
+ "type": "object",
2481
+ "properties": {
2482
+ "method": {
2483
+ "type": "string",
2484
+ "description": "HTTP method to use for the call",
2485
+ "default": "GET"
2486
+ },
2487
+ "url": {
2488
+ "type": "string",
2489
+ "description": "URL to call. Supports variable interpolation."
2490
+ },
2491
+ "params": {
2492
+ "type": "object",
2493
+ "description": "Parameters to append to the URL. Supports variable interpolation.",
2494
+ "additionalProperties": {
2495
+ "type": "string"
2180
2496
  },
2181
- "condition": {
2497
+ "default": {}
2498
+ },
2499
+ "headers": {
2500
+ "type": "object",
2501
+ "description": "Headers to use. Supports variable interpolation.",
2502
+ "additionalProperties": {
2182
2503
  "type": "string"
2183
2504
  },
2184
- "auth": {
2185
- "$ref": "#/components/schemas/PortalAuth"
2505
+ "default": {}
2506
+ },
2507
+ "body": {
2508
+ "type": "object",
2509
+ "description": "Request body to send. Supports variable interpolation. Content format is determined by Content-Type header.",
2510
+ "additionalProperties": {
2511
+ "type": "string"
2186
2512
  },
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
- }
2513
+ "default": {}
2514
+ }
2515
+ },
2516
+ "required": [
2517
+ "url"
2518
+ ],
2519
+ "additionalProperties": false
2520
+ },
2521
+ "resolved": {
2522
+ "type": "object",
2523
+ "properties": {
2524
+ "dataPath": {
2525
+ "type": "string",
2526
+ "description": "Optional path to the data (array) in the response. If omitted, the data is assumed to be on the top level."
2201
2527
  }
2528
+ },
2529
+ "additionalProperties": false
2530
+ }
2531
+ },
2532
+ "required": [
2533
+ "type",
2534
+ "call"
2535
+ ],
2536
+ "additionalProperties": false
2537
+ },
2538
+ "PortalExtensionHookCostDataRetrieval": {
2539
+ "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",
2540
+ "type": "object",
2541
+ "properties": {
2542
+ "type": {
2543
+ "type": "string",
2544
+ "enum": [
2545
+ "costDataRetrieval"
2546
+ ]
2547
+ },
2548
+ "intervals": {
2549
+ "type": "array",
2550
+ "description": "Intervals supported by the API. If omitted, it is assumed that all intervals are supported.",
2551
+ "items": {
2552
+ "type": "string",
2553
+ "enum": [
2554
+ "PT15M",
2555
+ "PT1H",
2556
+ "P1D",
2557
+ "P1M"
2558
+ ]
2202
2559
  }
2560
+ },
2561
+ "auth": {
2562
+ "$ref": "#/components/schemas/PortalExtensionAuthBlock"
2563
+ },
2564
+ "call": {
2565
+ "type": "object",
2566
+ "properties": {
2567
+ "method": {
2568
+ "type": "string",
2569
+ "description": "HTTP method to use for the call",
2570
+ "default": "GET"
2571
+ },
2572
+ "url": {
2573
+ "type": "string",
2574
+ "description": "URL to call. Supports variable interpolation."
2575
+ },
2576
+ "params": {
2577
+ "type": "object",
2578
+ "description": "Parameters to append to the URL. Supports variable interpolation.",
2579
+ "additionalProperties": {
2580
+ "type": "string"
2581
+ },
2582
+ "default": {}
2583
+ },
2584
+ "headers": {
2585
+ "type": "object",
2586
+ "description": "Headers to use. Supports variable interpolation.",
2587
+ "additionalProperties": {
2588
+ "type": "string"
2589
+ },
2590
+ "default": {}
2591
+ },
2592
+ "body": {
2593
+ "type": "object",
2594
+ "description": "Request body to send. Supports variable interpolation. Content format is determined by Content-Type header.",
2595
+ "additionalProperties": {
2596
+ "type": "string"
2597
+ },
2598
+ "default": {}
2599
+ }
2600
+ },
2601
+ "required": [
2602
+ "url"
2603
+ ],
2604
+ "additionalProperties": false
2605
+ },
2606
+ "resolved": {
2607
+ "type": "object",
2608
+ "properties": {
2609
+ "dataPath": {
2610
+ "type": "string",
2611
+ "description": "Optional path to the data (array) in the response. If omitted, the data is assumed to be on the top level."
2612
+ }
2613
+ },
2614
+ "additionalProperties": false
2203
2615
  }
2204
- }
2616
+ },
2617
+ "required": [
2618
+ "type",
2619
+ "call"
2620
+ ],
2621
+ "additionalProperties": false
2205
2622
  },
2206
- "PortalAuth": {
2623
+ "PortalExtensionSeamlessLink": {
2207
2624
  "type": "object",
2208
2625
  "properties": {
2626
+ "id": {
2627
+ "type": "string",
2628
+ "description": "Identifier of the link. Should not change between updates."
2629
+ },
2630
+ "name": {
2631
+ "$ref": "#/components/schemas/TranslatedString"
2632
+ },
2633
+ "description": {
2634
+ "$ref": "#/components/schemas/TranslatedString"
2635
+ },
2209
2636
  "type": {
2210
- "type": "string"
2637
+ "type": "string",
2638
+ "enum": [
2639
+ "seamless"
2640
+ ]
2211
2641
  },
2212
- "url": {
2213
- "type": "string"
2642
+ "condition": {
2643
+ "type": "string",
2644
+ "description": "Controls whether the link should be shown. Supports variable interpolation.",
2645
+ "example": "{{Contact.customer_number | is_not_empty}}"
2214
2646
  },
2647
+ "auth": {
2648
+ "$ref": "#/components/schemas/PortalExtensionAuthBlock"
2649
+ },
2650
+ "redirect": {
2651
+ "type": "object",
2652
+ "properties": {
2653
+ "url": {
2654
+ "type": "string",
2655
+ "description": "URL to redirect to. Supports variable interpolation."
2656
+ },
2657
+ "params": {
2658
+ "type": "object",
2659
+ "description": "Parameters to append to the URL. Supports variable interpolation.",
2660
+ "additionalProperties": {
2661
+ "type": "string"
2662
+ },
2663
+ "default": {}
2664
+ }
2665
+ },
2666
+ "additionalProperties": false
2667
+ }
2668
+ },
2669
+ "required": [
2670
+ "id",
2671
+ "name",
2672
+ "type",
2673
+ "redirect"
2674
+ ],
2675
+ "additionalProperties": false
2676
+ },
2677
+ "PortalExtensionAuthBlock": {
2678
+ "type": "object",
2679
+ "properties": {
2215
2680
  "method": {
2216
- "type": "string"
2681
+ "type": "string",
2682
+ "description": "HTTP method to use for authentication",
2683
+ "default": "GET"
2684
+ },
2685
+ "url": {
2686
+ "type": "string",
2687
+ "description": "URL to use for authentication. Supports variable interpolation."
2688
+ },
2689
+ "params": {
2690
+ "type": "object",
2691
+ "description": "Parameters to append to the URL. Supports variable interpolation.",
2692
+ "additionalProperties": {
2693
+ "type": "string"
2694
+ },
2695
+ "default": {}
2217
2696
  },
2218
2697
  "headers": {
2219
2698
  "type": "object",
2699
+ "description": "Headers to use for authentication. Supports variable interpolation.",
2220
2700
  "additionalProperties": {
2221
2701
  "type": "string"
2222
- }
2702
+ },
2703
+ "default": {}
2704
+ },
2705
+ "body": {
2706
+ "type": "object",
2707
+ "description": "JSON body to use for authentication. Supports variable interpolation. Content format is determined by Content-Type header.",
2708
+ "additionalProperties": {
2709
+ "type": "string"
2710
+ },
2711
+ "default": {}
2712
+ },
2713
+ "cache": {
2714
+ "type": "object",
2715
+ "properties": {
2716
+ "key": {
2717
+ "type": "string",
2718
+ "description": "Key to use to identify the auth response. Supports interpolation.",
2719
+ "example": "{{Options.api_key}}"
2720
+ },
2721
+ "ttl": {
2722
+ "type": "string",
2723
+ "description": "Time to live in seconds for the cache. Supports interpolation.",
2724
+ "example": "{{AuthResponse.data.expires_in}}"
2725
+ }
2726
+ },
2727
+ "required": [
2728
+ "key",
2729
+ "ttl"
2730
+ ],
2731
+ "additionalProperties": false
2223
2732
  }
2224
- }
2733
+ },
2734
+ "required": [
2735
+ "url"
2736
+ ],
2737
+ "additionalProperties": false
2225
2738
  },
2226
2739
  "OverrideDevMode": {
2227
2740
  "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.4",
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.