@epilot/app-client 0.10.0 → 0.10.2

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={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})})();
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})})();
package/dist/openapi.d.ts CHANGED
@@ -247,7 +247,7 @@ declare namespace Components {
247
247
  surfaces?: {
248
248
  [key: string]: any;
249
249
  };
250
- } & (JourneyBlockComponent | PortalExtensionComponent | CustomFlowActionComponent | ErpInformToolkitComponent | CustomCapabilityComponent);
250
+ } & (JourneyBlockComponent | PortalExtensionComponent | CustomFlowActionComponent | ErpInformToolkitComponent | CustomCapabilityComponent | ExternalProductCatalogComponent);
251
251
  export interface BaseComponentCommon {
252
252
  /**
253
253
  * Unique identifier for the component
@@ -451,7 +451,7 @@ declare namespace Components {
451
451
  /**
452
452
  * Type of app component
453
453
  */
454
- export type ComponentType = "CUSTOM_JOURNEY_BLOCK" | "PORTAL_EXTENSION" | "CUSTOM_FLOW_ACTION" | "ERP_INFORM_TOOLKIT" | "CUSTOM_CAPABILITY";
454
+ export type ComponentType = "CUSTOM_JOURNEY_BLOCK" | "PORTAL_EXTENSION" | "CUSTOM_FLOW_ACTION" | "ERP_INFORM_TOOLKIT" | "CUSTOM_CAPABILITY" | "EXTERNAL_PRODUCT_CATALOG";
455
455
  /**
456
456
  * Configuration of the published app
457
457
  */
@@ -967,6 +967,131 @@ declare namespace Components {
967
967
  };
968
968
  };
969
969
  }
970
+ export interface ExternalProductCatalogAuthBlock {
971
+ /**
972
+ * HTTP method to use for authentication
973
+ */
974
+ method?: string;
975
+ /**
976
+ * URL to use for authentication. Supports variable interpolation.
977
+ */
978
+ url: string;
979
+ /**
980
+ * Parameters to append to the URL. Supports variable interpolation.
981
+ */
982
+ params?: {
983
+ [name: string]: string;
984
+ };
985
+ /**
986
+ * Headers to use for authentication. Supports variable interpolation.
987
+ */
988
+ headers?: {
989
+ [name: string]: string;
990
+ };
991
+ /**
992
+ * JSON body to use for authentication. Supports variable interpolation. Content format is determined by Content-Type header.
993
+ */
994
+ body?: {
995
+ [name: string]: string;
996
+ };
997
+ }
998
+ export interface ExternalProductCatalogComponent {
999
+ component_type: "EXTERNAL_PRODUCT_CATALOG";
1000
+ configuration: ExternalProductCatalogConfig;
1001
+ }
1002
+ export interface ExternalProductCatalogConfig {
1003
+ hooks?: (/**
1004
+ * Hook for getting products from an external catalog. This hook makes a call to retrieve product data from an external source. Check the docs or the response API call contract https://docs.api.epilot.io/pricing-api-external-catalog for more details.
1005
+ *
1006
+ */
1007
+ ExternalProductCatalogHookProducts | /**
1008
+ * Hook for getting product recommendations from an external catalog. This hook makes a call to retrieve product recommendations from an external source. Check the docs or the response API call contract https://docs.api.epilot.io/pricing-api-external-catalog for more details.
1009
+ *
1010
+ */
1011
+ ExternalProductCatalogHookProductsRecommendation)[];
1012
+ }
1013
+ /**
1014
+ * Hook for getting products from an external catalog. This hook makes a call to retrieve product data from an external source. Check the docs or the response API call contract https://docs.api.epilot.io/pricing-api-external-catalog for more details.
1015
+ *
1016
+ */
1017
+ export interface ExternalProductCatalogHookProducts {
1018
+ /**
1019
+ * Identifier of the hook. Should not change between updates.
1020
+ */
1021
+ id: string; // ^[a-zA-Z0-9_-]+$
1022
+ name: TranslatedString;
1023
+ type: "products";
1024
+ auth?: ExternalProductCatalogAuthBlock;
1025
+ call: {
1026
+ /**
1027
+ * HTTP method to use for the call
1028
+ */
1029
+ method?: string;
1030
+ /**
1031
+ * URL to call. Supports variable interpolation.
1032
+ */
1033
+ url: string;
1034
+ /**
1035
+ * Parameters to append to the URL. Supports variable interpolation.
1036
+ */
1037
+ params?: {
1038
+ [name: string]: string;
1039
+ };
1040
+ /**
1041
+ * Headers to use. Supports variable interpolation.
1042
+ */
1043
+ headers?: {
1044
+ [name: string]: string;
1045
+ };
1046
+ /**
1047
+ * JSON body to use for the call. Supports variable interpolation. If empty / not provided, the default request context will be used based on the consumer (e.g. Journey).
1048
+ */
1049
+ body?: {
1050
+ [name: string]: string;
1051
+ };
1052
+ };
1053
+ }
1054
+ /**
1055
+ * Hook for getting product recommendations from an external catalog. This hook makes a call to retrieve product recommendations from an external source. Check the docs or the response API call contract https://docs.api.epilot.io/pricing-api-external-catalog for more details.
1056
+ *
1057
+ */
1058
+ export interface ExternalProductCatalogHookProductsRecommendation {
1059
+ /**
1060
+ * Identifier of the hook. Should not change between updates.
1061
+ */
1062
+ id: string; // ^[a-zA-Z0-9_-]+$
1063
+ name: TranslatedString;
1064
+ type: "products-recommendation";
1065
+ auth?: ExternalProductCatalogAuthBlock;
1066
+ call: {
1067
+ /**
1068
+ * HTTP method to use for the call
1069
+ */
1070
+ method?: string;
1071
+ /**
1072
+ * URL to call. Supports variable interpolation.
1073
+ */
1074
+ url: string;
1075
+ /**
1076
+ * Parameters to append to the URL. Supports variable interpolation.
1077
+ */
1078
+ params?: {
1079
+ [name: string]: string;
1080
+ };
1081
+ /**
1082
+ * Headers to use. Supports variable interpolation.
1083
+ */
1084
+ headers?: {
1085
+ [name: string]: string;
1086
+ };
1087
+ /**
1088
+ * JSON body to use for the call. Supports variable interpolation. If empty / not provided, the default request context will be used based on the consumer (e.g. Journey).
1089
+ */
1090
+ body?: {
1091
+ [name: string]: string;
1092
+ };
1093
+ };
1094
+ }
970
1095
  /**
971
1096
  * Required grants for the app in order to call APIs for the installing tenant
972
1097
  */
@@ -1229,29 +1354,24 @@ declare namespace Components {
1229
1354
  configuration: PortalExtensionConfig;
1230
1355
  }
1231
1356
  export interface PortalExtensionConfig {
1232
- /**
1233
- * Identifier of the extension. Should not change between updates.
1234
- */
1235
- id?: string; // ^[a-zA-Z0-9_-]+$
1236
- hooks?: ({
1237
- /**
1238
- * Identifier of the hook. Should not change between updates.
1239
- */
1240
- id?: string; // ^[a-zA-Z0-9_-]+$
1241
- name?: TranslatedString;
1242
- } & (/**
1357
+ hooks?: (/**
1243
1358
  * 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:
1244
1359
  * - 200 with contact id if exactly one contact is found
1245
1360
  * - 404 if no contact is found or more than contact is found
1246
1361
  *
1247
1362
  */
1248
1363
  PortalExtensionHookRegistrationIdentifiersCheck | /**
1249
- * 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:
1250
- * - 200 if found with either:
1251
- * - contract_id array
1252
- * - contact_id string
1253
- * - 404 if no contract is found
1254
- * 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.
1364
+ * Hook that replaces the built-in Contract identification for self-assignment. This hook involves an HTTP request whenever a user is trying to self-assign Contract(s).
1365
+ * The expected response http status code to the call is:
1366
+ * - 200 if found
1367
+ * - 404 if not found
1368
+ *
1369
+ * The following assignment modes are supported:
1370
+ * - `contracts`: We expect the response to contain Contract ids (customizable using `result` property).
1371
+ * - `contact_to_contracts`: We expect the response to contain a Contact id (customizable using `result` property) and we will assign the Contact as a Customer to the Contracts and (optionally) update the Contact attribute specified by `contact_relation_attribute` to add the matched Contact.
1372
+ * - `contact_to_portal_user`: We expect the response to contain a Contact id (customizable using `result` property) and we will assign the Contact to the Portal User. Portal User will be able to see all data including Contracts transitively.
1373
+ *
1374
+ * Defaults to `contact_to_contracts` for backwards compatibility. We recommend using `contact_to_portal_user` as it does not influence the data model of business entities.
1255
1375
  *
1256
1376
  */
1257
1377
  PortalExtensionHookContractIdentification | /**
@@ -1278,7 +1398,7 @@ declare namespace Components {
1278
1398
  * - valid: false
1279
1399
  *
1280
1400
  */
1281
- PortalExtensionHookMeterReadingPlausibilityCheck))[];
1401
+ PortalExtensionHookMeterReadingPlausibilityCheck)[];
1282
1402
  links?: {
1283
1403
  /**
1284
1404
  * Identifier of the link. Should not change between updates.
@@ -1308,19 +1428,17 @@ declare namespace Components {
1308
1428
  };
1309
1429
  }[];
1310
1430
  }
1311
- export interface PortalExtensionHook {
1312
- /**
1313
- * Identifier of the hook. Should not change between updates.
1314
- */
1315
- id?: string; // ^[a-zA-Z0-9_-]+$
1316
- name?: TranslatedString;
1317
- }
1318
1431
  /**
1319
1432
  * 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:
1320
1433
  * - 200 with the time series data
1321
1434
  *
1322
1435
  */
1323
1436
  export interface PortalExtensionHookConsumptionDataRetrieval {
1437
+ /**
1438
+ * Identifier of the hook. Should not change between updates.
1439
+ */
1440
+ id?: string; // ^[a-zA-Z0-9_-]+$
1441
+ name?: TranslatedString;
1324
1442
  type: "consumptionDataRetrieval";
1325
1443
  /**
1326
1444
  * Intervals supported by the API. If omitted, it is assumed that all intervals are supported.
@@ -1367,15 +1485,25 @@ declare namespace Components {
1367
1485
  use_static_ips?: boolean;
1368
1486
  }
1369
1487
  /**
1370
- * 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:
1371
- * - 200 if found with either:
1372
- * - contract_id array
1373
- * - contact_id string
1374
- * - 404 if no contract is found
1375
- * 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.
1488
+ * Hook that replaces the built-in Contract identification for self-assignment. This hook involves an HTTP request whenever a user is trying to self-assign Contract(s).
1489
+ * The expected response http status code to the call is:
1490
+ * - 200 if found
1491
+ * - 404 if not found
1492
+ *
1493
+ * The following assignment modes are supported:
1494
+ * - `contracts`: We expect the response to contain Contract ids (customizable using `result` property).
1495
+ * - `contact_to_contracts`: We expect the response to contain a Contact id (customizable using `result` property) and we will assign the Contact as a Customer to the Contracts and (optionally) update the Contact attribute specified by `contact_relation_attribute` to add the matched Contact.
1496
+ * - `contact_to_portal_user`: We expect the response to contain a Contact id (customizable using `result` property) and we will assign the Contact to the Portal User. Portal User will be able to see all data including Contracts transitively.
1497
+ *
1498
+ * Defaults to `contact_to_contracts` for backwards compatibility. We recommend using `contact_to_portal_user` as it does not influence the data model of business entities.
1376
1499
  *
1377
1500
  */
1378
1501
  export interface PortalExtensionHookContractIdentification {
1502
+ /**
1503
+ * Identifier of the hook. Should not change between updates.
1504
+ */
1505
+ id?: string; // ^[a-zA-Z0-9_-]+$
1506
+ name?: TranslatedString;
1379
1507
  type: "contractIdentification";
1380
1508
  auth?: PortalExtensionAuthBlock;
1381
1509
  call: {
@@ -1405,9 +1533,17 @@ declare namespace Components {
1405
1533
  body?: {
1406
1534
  [key: string]: any;
1407
1535
  };
1536
+ /**
1537
+ * Contract or Contact ID usually retrieved from the response body, e.g. `{{CallResponse.data.contact_id}}`. Supports variable interpolation.
1538
+ */
1539
+ result?: string;
1408
1540
  };
1409
1541
  /**
1410
- * Name of the Contact attribute to update with the matched Contact ID. Must be a Contact relation attribute supporting multiple entities.
1542
+ * Mode of contract assignment. See hook description for mode details.
1543
+ */
1544
+ assignment_mode?: "contracts" | "contact_to_contracts" | "contact_to_portal_user";
1545
+ /**
1546
+ * Name of the Contact attribute to update with the matched Contact ID when using `contact_to_contracts` mode. Must be a Contact relation attribute supporting multiple entities.
1411
1547
  * example:
1412
1548
  * represents_contact
1413
1549
  */
@@ -1420,7 +1556,7 @@ declare namespace Components {
1420
1556
  /**
1421
1557
  * Explanation of the functionality shown to the end user.
1422
1558
  * example:
1423
- * This process will give you access to all Contracts kept
1559
+ * This process will give you access to the matching Contracts.
1424
1560
  */
1425
1561
  en: string;
1426
1562
  };
@@ -1435,6 +1571,11 @@ declare namespace Components {
1435
1571
  *
1436
1572
  */
1437
1573
  export interface PortalExtensionHookCostDataRetrieval {
1574
+ /**
1575
+ * Identifier of the hook. Should not change between updates.
1576
+ */
1577
+ id?: string; // ^[a-zA-Z0-9_-]+$
1578
+ name?: TranslatedString;
1438
1579
  type: "costDataRetrieval";
1439
1580
  /**
1440
1581
  * Intervals supported by the API. If omitted, it is assumed that all intervals are supported.
@@ -1490,6 +1631,11 @@ declare namespace Components {
1490
1631
  *
1491
1632
  */
1492
1633
  export interface PortalExtensionHookMeterReadingPlausibilityCheck {
1634
+ /**
1635
+ * Identifier of the hook. Should not change between updates.
1636
+ */
1637
+ id?: string; // ^[a-zA-Z0-9_-]+$
1638
+ name?: TranslatedString;
1493
1639
  type: "meterReadingPlausibilityCheck";
1494
1640
  auth?: PortalExtensionAuthBlock;
1495
1641
  call: {
@@ -1544,6 +1690,11 @@ declare namespace Components {
1544
1690
  *
1545
1691
  */
1546
1692
  export interface PortalExtensionHookPriceDataRetrieval {
1693
+ /**
1694
+ * Identifier of the hook. Should not change between updates.
1695
+ */
1696
+ id?: string; // ^[a-zA-Z0-9_-]+$
1697
+ name?: TranslatedString;
1547
1698
  type: "priceDataRetrieval";
1548
1699
  /**
1549
1700
  * Intervals supported by the API. If omitted, it is assumed that all intervals are supported.
@@ -1596,6 +1747,11 @@ declare namespace Components {
1596
1747
  *
1597
1748
  */
1598
1749
  export interface PortalExtensionHookRegistrationIdentifiersCheck {
1750
+ /**
1751
+ * Identifier of the hook. Should not change between updates.
1752
+ */
1753
+ id?: string; // ^[a-zA-Z0-9_-]+$
1754
+ name?: TranslatedString;
1599
1755
  type: "registrationIdentifiersCheck";
1600
1756
  auth?: PortalExtensionAuthBlock;
1601
1757
  call: {
@@ -3042,6 +3198,11 @@ export type ErpInformToolkitComponent = Components.Schemas.ErpInformToolkitCompo
3042
3198
  export type EventsQuery = Components.Schemas.EventsQuery;
3043
3199
  export type EventsQueryResponse = Components.Schemas.EventsQueryResponse;
3044
3200
  export type ExternalIntegrationCustomActionConfig = Components.Schemas.ExternalIntegrationCustomActionConfig;
3201
+ export type ExternalProductCatalogAuthBlock = Components.Schemas.ExternalProductCatalogAuthBlock;
3202
+ export type ExternalProductCatalogComponent = Components.Schemas.ExternalProductCatalogComponent;
3203
+ export type ExternalProductCatalogConfig = Components.Schemas.ExternalProductCatalogConfig;
3204
+ export type ExternalProductCatalogHookProducts = Components.Schemas.ExternalProductCatalogHookProducts;
3205
+ export type ExternalProductCatalogHookProductsRecommendation = Components.Schemas.ExternalProductCatalogHookProductsRecommendation;
3045
3206
  export type Grants = Components.Schemas.Grants;
3046
3207
  export type Installation = Components.Schemas.Installation;
3047
3208
  export type JourneyBlockComponent = Components.Schemas.JourneyBlockComponent;
@@ -3056,7 +3217,6 @@ export type OverrideDevMode = Components.Schemas.OverrideDevMode;
3056
3217
  export type PortalExtensionAuthBlock = Components.Schemas.PortalExtensionAuthBlock;
3057
3218
  export type PortalExtensionComponent = Components.Schemas.PortalExtensionComponent;
3058
3219
  export type PortalExtensionConfig = Components.Schemas.PortalExtensionConfig;
3059
- export type PortalExtensionHook = Components.Schemas.PortalExtensionHook;
3060
3220
  export type PortalExtensionHookConsumptionDataRetrieval = Components.Schemas.PortalExtensionHookConsumptionDataRetrieval;
3061
3221
  export type PortalExtensionHookContractIdentification = Components.Schemas.PortalExtensionHookContractIdentification;
3062
3222
  export type PortalExtensionHookCostDataRetrieval = Components.Schemas.PortalExtensionHookCostDataRetrieval;
package/dist/openapi.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "info": {
4
4
  "title": "App API",
5
5
  "description": "API for managing app publishing and installed app.",
6
- "version": "1.0.1"
6
+ "version": "2.0.0"
7
7
  },
8
8
  "tags": [
9
9
  {
@@ -1768,7 +1768,8 @@
1768
1768
  "PORTAL_EXTENSION",
1769
1769
  "CUSTOM_FLOW_ACTION",
1770
1770
  "ERP_INFORM_TOOLKIT",
1771
- "CUSTOM_CAPABILITY"
1771
+ "CUSTOM_CAPABILITY",
1772
+ "EXTERNAL_PRODUCT_CATALOG"
1772
1773
  ],
1773
1774
  "description": "Type of app component"
1774
1775
  },
@@ -1877,7 +1878,8 @@
1877
1878
  "PORTAL_EXTENSION": "#/components/schemas/PortalExtensionComponent",
1878
1879
  "CUSTOM_FLOW_ACTION": "#/components/schemas/CustomFlowActionComponent",
1879
1880
  "ERP_INFORM_TOOLKIT": "#/components/schemas/ErpInformToolkitComponent",
1880
- "CUSTOM_CAPABILITY": "#/components/schemas/CustomCapabilityComponent"
1881
+ "CUSTOM_CAPABILITY": "#/components/schemas/CustomCapabilityComponent",
1882
+ "EXTERNAL_PRODUCT_CATALOG": "#/components/schemas/ExternalProductCatalogComponent"
1881
1883
  }
1882
1884
  },
1883
1885
  "oneOf": [
@@ -1895,6 +1897,9 @@
1895
1897
  },
1896
1898
  {
1897
1899
  "$ref": "#/components/schemas/CustomCapabilityComponent"
1900
+ },
1901
+ {
1902
+ "$ref": "#/components/schemas/ExternalProductCatalogComponent"
1898
1903
  }
1899
1904
  ]
1900
1905
  }
@@ -2119,7 +2124,7 @@
2119
2124
  }
2120
2125
  }
2121
2126
  },
2122
- "PortalExtensionComponent": {
2127
+ "ExternalProductCatalogComponent": {
2123
2128
  "type": "object",
2124
2129
  "required": [
2125
2130
  "component_type",
@@ -2129,50 +2134,239 @@
2129
2134
  "component_type": {
2130
2135
  "type": "string",
2131
2136
  "enum": [
2132
- "PORTAL_EXTENSION"
2137
+ "EXTERNAL_PRODUCT_CATALOG"
2133
2138
  ]
2134
2139
  },
2135
2140
  "configuration": {
2136
- "$ref": "#/components/schemas/PortalExtensionConfig"
2141
+ "$ref": "#/components/schemas/ExternalProductCatalogConfig"
2137
2142
  }
2138
2143
  }
2139
2144
  },
2140
- "PortalExtensionConfig": {
2145
+ "ExternalProductCatalogConfig": {
2146
+ "type": "object",
2147
+ "properties": {
2148
+ "hooks": {
2149
+ "type": "array",
2150
+ "items": {
2151
+ "type": "object",
2152
+ "discriminator": {
2153
+ "propertyName": "type",
2154
+ "mapping": {
2155
+ "products": "#/components/schemas/ExternalProductCatalogHookProducts",
2156
+ "products-recommendation": "#/components/schemas/ExternalProductCatalogHookProductsRecommendation"
2157
+ }
2158
+ },
2159
+ "oneOf": [
2160
+ {
2161
+ "$ref": "#/components/schemas/ExternalProductCatalogHookProducts"
2162
+ },
2163
+ {
2164
+ "$ref": "#/components/schemas/ExternalProductCatalogHookProductsRecommendation"
2165
+ }
2166
+ ]
2167
+ }
2168
+ }
2169
+ },
2170
+ "additionalProperties": false
2171
+ },
2172
+ "ExternalProductCatalogHookProducts": {
2173
+ "description": "Hook for getting products from an external catalog. This hook makes a call to retrieve product data from an external source. Check the docs or the response API call contract https://docs.api.epilot.io/pricing-api-external-catalog for more details.\n",
2141
2174
  "type": "object",
2142
2175
  "properties": {
2143
2176
  "id": {
2144
2177
  "type": "string",
2145
2178
  "pattern": "^[a-zA-Z0-9_-]+$",
2146
- "description": "Identifier of the extension. Should not change between updates."
2179
+ "description": "Identifier of the hook. Should not change between updates."
2180
+ },
2181
+ "name": {
2182
+ "$ref": "#/components/schemas/TranslatedString"
2183
+ },
2184
+ "type": {
2185
+ "type": "string",
2186
+ "enum": [
2187
+ "products"
2188
+ ]
2189
+ },
2190
+ "auth": {
2191
+ "$ref": "#/components/schemas/ExternalProductCatalogAuthBlock"
2192
+ },
2193
+ "call": {
2194
+ "type": "object",
2195
+ "properties": {
2196
+ "method": {
2197
+ "type": "string",
2198
+ "description": "HTTP method to use for the call",
2199
+ "default": "GET"
2200
+ },
2201
+ "url": {
2202
+ "type": "string",
2203
+ "description": "URL to call. Supports variable interpolation."
2204
+ },
2205
+ "params": {
2206
+ "type": "object",
2207
+ "description": "Parameters to append to the URL. Supports variable interpolation.",
2208
+ "additionalProperties": {
2209
+ "type": "string"
2210
+ },
2211
+ "default": {}
2212
+ },
2213
+ "headers": {
2214
+ "type": "object",
2215
+ "description": "Headers to use. Supports variable interpolation.",
2216
+ "additionalProperties": {
2217
+ "type": "string"
2218
+ },
2219
+ "default": {}
2220
+ },
2221
+ "body": {
2222
+ "type": "object",
2223
+ "description": "JSON body to use for the call. Supports variable interpolation. If empty / not provided, the default request context will be used based on the consumer (e.g. Journey).",
2224
+ "additionalProperties": {
2225
+ "type": "string"
2226
+ },
2227
+ "default": {}
2228
+ }
2229
+ },
2230
+ "required": [
2231
+ "url"
2232
+ ],
2233
+ "additionalProperties": false
2234
+ }
2235
+ },
2236
+ "required": [
2237
+ "type",
2238
+ "call",
2239
+ "id",
2240
+ "name"
2241
+ ],
2242
+ "additionalProperties": false
2243
+ },
2244
+ "ExternalProductCatalogHookProductsRecommendation": {
2245
+ "description": "Hook for getting product recommendations from an external catalog. This hook makes a call to retrieve product recommendations from an external source. Check the docs or the response API call contract https://docs.api.epilot.io/pricing-api-external-catalog for more details.\n",
2246
+ "type": "object",
2247
+ "properties": {
2248
+ "id": {
2249
+ "type": "string",
2250
+ "pattern": "^[a-zA-Z0-9_-]+$",
2251
+ "description": "Identifier of the hook. Should not change between updates."
2252
+ },
2253
+ "name": {
2254
+ "$ref": "#/components/schemas/TranslatedString"
2255
+ },
2256
+ "type": {
2257
+ "type": "string",
2258
+ "enum": [
2259
+ "products-recommendation"
2260
+ ]
2261
+ },
2262
+ "auth": {
2263
+ "$ref": "#/components/schemas/ExternalProductCatalogAuthBlock"
2264
+ },
2265
+ "call": {
2266
+ "type": "object",
2267
+ "properties": {
2268
+ "method": {
2269
+ "type": "string",
2270
+ "description": "HTTP method to use for the call",
2271
+ "default": "GET"
2272
+ },
2273
+ "url": {
2274
+ "type": "string",
2275
+ "description": "URL to call. Supports variable interpolation."
2276
+ },
2277
+ "params": {
2278
+ "type": "object",
2279
+ "description": "Parameters to append to the URL. Supports variable interpolation.",
2280
+ "additionalProperties": {
2281
+ "type": "string"
2282
+ },
2283
+ "default": {}
2284
+ },
2285
+ "headers": {
2286
+ "type": "object",
2287
+ "description": "Headers to use. Supports variable interpolation.",
2288
+ "additionalProperties": {
2289
+ "type": "string"
2290
+ },
2291
+ "default": {}
2292
+ },
2293
+ "body": {
2294
+ "type": "object",
2295
+ "description": "JSON body to use for the call. Supports variable interpolation. If empty / not provided, the default request context will be used based on the consumer (e.g. Journey).",
2296
+ "additionalProperties": {
2297
+ "type": "string"
2298
+ },
2299
+ "default": {}
2300
+ }
2301
+ },
2302
+ "required": [
2303
+ "url"
2304
+ ],
2305
+ "additionalProperties": false
2306
+ }
2307
+ },
2308
+ "required": [
2309
+ "type",
2310
+ "call",
2311
+ "id",
2312
+ "name"
2313
+ ],
2314
+ "additionalProperties": false
2315
+ },
2316
+ "PortalExtensionComponent": {
2317
+ "type": "object",
2318
+ "required": [
2319
+ "component_type",
2320
+ "configuration"
2321
+ ],
2322
+ "properties": {
2323
+ "component_type": {
2324
+ "type": "string",
2325
+ "enum": [
2326
+ "PORTAL_EXTENSION"
2327
+ ]
2147
2328
  },
2329
+ "configuration": {
2330
+ "$ref": "#/components/schemas/PortalExtensionConfig"
2331
+ }
2332
+ }
2333
+ },
2334
+ "PortalExtensionConfig": {
2335
+ "type": "object",
2336
+ "properties": {
2148
2337
  "hooks": {
2149
2338
  "type": "array",
2150
2339
  "items": {
2151
- "allOf": [
2340
+ "type": "object",
2341
+ "discriminator": {
2342
+ "propertyName": "type",
2343
+ "mapping": {
2344
+ "registrationIdentifiersCheck": "#/components/schemas/PortalExtensionHookRegistrationIdentifiersCheck",
2345
+ "contractIdentification": "#/components/schemas/PortalExtensionHookContractIdentification",
2346
+ "priceDataRetrieval": "#/components/schemas/PortalExtensionHookPriceDataRetrieval",
2347
+ "consumptionDataRetrieval": "#/components/schemas/PortalExtensionHookConsumptionDataRetrieval",
2348
+ "costDataRetrieval": "#/components/schemas/PortalExtensionHookCostDataRetrieval",
2349
+ "meterReadingPlausibilityCheck": "#/components/schemas/PortalExtensionHookMeterReadingPlausibilityCheck"
2350
+ }
2351
+ },
2352
+ "oneOf": [
2152
2353
  {
2153
- "$ref": "#/components/schemas/PortalExtensionHook"
2354
+ "$ref": "#/components/schemas/PortalExtensionHookRegistrationIdentifiersCheck"
2154
2355
  },
2155
2356
  {
2156
- "oneOf": [
2157
- {
2158
- "$ref": "#/components/schemas/PortalExtensionHookRegistrationIdentifiersCheck"
2159
- },
2160
- {
2161
- "$ref": "#/components/schemas/PortalExtensionHookContractIdentification"
2162
- },
2163
- {
2164
- "$ref": "#/components/schemas/PortalExtensionHookPriceDataRetrieval"
2165
- },
2166
- {
2167
- "$ref": "#/components/schemas/PortalExtensionHookConsumptionDataRetrieval"
2168
- },
2169
- {
2170
- "$ref": "#/components/schemas/PortalExtensionHookCostDataRetrieval"
2171
- },
2172
- {
2173
- "$ref": "#/components/schemas/PortalExtensionHookMeterReadingPlausibilityCheck"
2174
- }
2175
- ]
2357
+ "$ref": "#/components/schemas/PortalExtensionHookContractIdentification"
2358
+ },
2359
+ {
2360
+ "$ref": "#/components/schemas/PortalExtensionHookPriceDataRetrieval"
2361
+ },
2362
+ {
2363
+ "$ref": "#/components/schemas/PortalExtensionHookConsumptionDataRetrieval"
2364
+ },
2365
+ {
2366
+ "$ref": "#/components/schemas/PortalExtensionHookCostDataRetrieval"
2367
+ },
2368
+ {
2369
+ "$ref": "#/components/schemas/PortalExtensionHookMeterReadingPlausibilityCheck"
2176
2370
  }
2177
2371
  ]
2178
2372
  }
@@ -2190,7 +2384,8 @@
2190
2384
  },
2191
2385
  "additionalProperties": false
2192
2386
  },
2193
- "PortalExtensionHook": {
2387
+ "PortalExtensionHookRegistrationIdentifiersCheck": {
2388
+ "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",
2194
2389
  "type": "object",
2195
2390
  "properties": {
2196
2391
  "id": {
@@ -2200,13 +2395,7 @@
2200
2395
  },
2201
2396
  "name": {
2202
2397
  "$ref": "#/components/schemas/TranslatedString"
2203
- }
2204
- }
2205
- },
2206
- "PortalExtensionHookRegistrationIdentifiersCheck": {
2207
- "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",
2208
- "type": "object",
2209
- "properties": {
2398
+ },
2210
2399
  "type": {
2211
2400
  "type": "string",
2212
2401
  "enum": [
@@ -2273,9 +2462,17 @@
2273
2462
  "additionalProperties": false
2274
2463
  },
2275
2464
  "PortalExtensionHookContractIdentification": {
2276
- "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",
2465
+ "description": "Hook that replaces the built-in Contract identification for self-assignment. This hook involves an HTTP request whenever a user is trying to self-assign Contract(s).\nThe expected response http status code to the call is:\n - 200 if found\n - 404 if not found\n\nThe following assignment modes are supported:\n - `contracts`: We expect the response to contain Contract ids (customizable using `result` property).\n - `contact_to_contracts`: We expect the response to contain a Contact id (customizable using `result` property) and we will assign the Contact as a Customer to the Contracts and (optionally) update the Contact attribute specified by `contact_relation_attribute` to add the matched Contact.\n - `contact_to_portal_user`: We expect the response to contain a Contact id (customizable using `result` property) and we will assign the Contact to the Portal User. Portal User will be able to see all data including Contracts transitively.\n\nDefaults to `contact_to_contracts` for backwards compatibility. We recommend using `contact_to_portal_user` as it does not influence the data model of business entities.\n",
2277
2466
  "type": "object",
2278
2467
  "properties": {
2468
+ "id": {
2469
+ "type": "string",
2470
+ "pattern": "^[a-zA-Z0-9_-]+$",
2471
+ "description": "Identifier of the hook. Should not change between updates."
2472
+ },
2473
+ "name": {
2474
+ "$ref": "#/components/schemas/TranslatedString"
2475
+ },
2279
2476
  "type": {
2280
2477
  "type": "string",
2281
2478
  "enum": [
@@ -2316,6 +2513,10 @@
2316
2513
  "body": {
2317
2514
  "type": "object",
2318
2515
  "description": "Optional JSON body to use for the call. Defaults to object with all configured identifiers grouped by entity, e.g. `{\"contract\": {\"contract_name\": \"Name\"}}`. Supports variable interpolation."
2516
+ },
2517
+ "result": {
2518
+ "type": "string",
2519
+ "description": "Contract or Contact ID usually retrieved from the response body, e.g. `{{CallResponse.data.contact_id}}`. Supports variable interpolation."
2319
2520
  }
2320
2521
  },
2321
2522
  "required": [
@@ -2324,9 +2525,19 @@
2324
2525
  ],
2325
2526
  "additionalProperties": false
2326
2527
  },
2528
+ "assignment_mode": {
2529
+ "type": "string",
2530
+ "enum": [
2531
+ "contracts",
2532
+ "contact_to_contracts",
2533
+ "contact_to_portal_user"
2534
+ ],
2535
+ "description": "Mode of contract assignment. See hook description for mode details.",
2536
+ "default": "contact_to_contracts"
2537
+ },
2327
2538
  "contact_relation_attribute": {
2328
2539
  "type": "string",
2329
- "description": "Name of the Contact attribute to update with the matched Contact ID. Must be a Contact relation attribute supporting multiple entities.",
2540
+ "description": "Name of the Contact attribute to update with the matched Contact ID when using `contact_to_contracts` mode. Must be a Contact relation attribute supporting multiple entities.",
2330
2541
  "example": "represents_contact"
2331
2542
  },
2332
2543
  "explanation": {
@@ -2335,7 +2546,7 @@
2335
2546
  "en": {
2336
2547
  "type": "string",
2337
2548
  "description": "Explanation of the functionality shown to the end user.",
2338
- "example": "This process will give you access to all Contracts kept"
2549
+ "example": "This process will give you access to the matching Contracts."
2339
2550
  }
2340
2551
  },
2341
2552
  "additionalProperties": {
@@ -2363,6 +2574,14 @@
2363
2574
  "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",
2364
2575
  "type": "object",
2365
2576
  "properties": {
2577
+ "id": {
2578
+ "type": "string",
2579
+ "pattern": "^[a-zA-Z0-9_-]+$",
2580
+ "description": "Identifier of the hook. Should not change between updates."
2581
+ },
2582
+ "name": {
2583
+ "$ref": "#/components/schemas/TranslatedString"
2584
+ },
2366
2585
  "type": {
2367
2586
  "type": "string",
2368
2587
  "enum": [
@@ -2442,6 +2661,14 @@
2442
2661
  "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",
2443
2662
  "type": "object",
2444
2663
  "properties": {
2664
+ "id": {
2665
+ "type": "string",
2666
+ "pattern": "^[a-zA-Z0-9_-]+$",
2667
+ "description": "Identifier of the hook. Should not change between updates."
2668
+ },
2669
+ "name": {
2670
+ "$ref": "#/components/schemas/TranslatedString"
2671
+ },
2445
2672
  "type": {
2446
2673
  "type": "string",
2447
2674
  "enum": [
@@ -2532,6 +2759,14 @@
2532
2759
  "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",
2533
2760
  "type": "object",
2534
2761
  "properties": {
2762
+ "id": {
2763
+ "type": "string",
2764
+ "pattern": "^[a-zA-Z0-9_-]+$",
2765
+ "description": "Identifier of the hook. Should not change between updates."
2766
+ },
2767
+ "name": {
2768
+ "$ref": "#/components/schemas/TranslatedString"
2769
+ },
2535
2770
  "type": {
2536
2771
  "type": "string",
2537
2772
  "enum": [
@@ -2622,6 +2857,14 @@
2622
2857
  "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",
2623
2858
  "type": "object",
2624
2859
  "properties": {
2860
+ "id": {
2861
+ "type": "string",
2862
+ "pattern": "^[a-zA-Z0-9_-]+$",
2863
+ "description": "Identifier of the hook. Should not change between updates."
2864
+ },
2865
+ "name": {
2866
+ "$ref": "#/components/schemas/TranslatedString"
2867
+ },
2625
2868
  "type": {
2626
2869
  "type": "string",
2627
2870
  "enum": [
@@ -2825,6 +3068,48 @@
2825
3068
  ],
2826
3069
  "additionalProperties": false
2827
3070
  },
3071
+ "ExternalProductCatalogAuthBlock": {
3072
+ "type": "object",
3073
+ "properties": {
3074
+ "method": {
3075
+ "type": "string",
3076
+ "description": "HTTP method to use for authentication",
3077
+ "default": "GET"
3078
+ },
3079
+ "url": {
3080
+ "type": "string",
3081
+ "description": "URL to use for authentication. Supports variable interpolation."
3082
+ },
3083
+ "params": {
3084
+ "type": "object",
3085
+ "description": "Parameters to append to the URL. Supports variable interpolation.",
3086
+ "additionalProperties": {
3087
+ "type": "string"
3088
+ },
3089
+ "default": {}
3090
+ },
3091
+ "headers": {
3092
+ "type": "object",
3093
+ "description": "Headers to use for authentication. Supports variable interpolation.",
3094
+ "additionalProperties": {
3095
+ "type": "string"
3096
+ },
3097
+ "default": {}
3098
+ },
3099
+ "body": {
3100
+ "type": "object",
3101
+ "description": "JSON body to use for authentication. Supports variable interpolation. Content format is determined by Content-Type header.",
3102
+ "additionalProperties": {
3103
+ "type": "string"
3104
+ },
3105
+ "default": {}
3106
+ }
3107
+ },
3108
+ "required": [
3109
+ "url"
3110
+ ],
3111
+ "additionalProperties": false
3112
+ },
2828
3113
  "OverrideDevMode": {
2829
3114
  "type": "object",
2830
3115
  "description": "Override URL when app is in dev mode",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/app-client",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "description": "JavaScript client library for the epilot App API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -25,6 +25,7 @@
25
25
  "test": "jest",
26
26
  "typescript": "tsc",
27
27
  "bundle-definition": "webpack",
28
+ "openapi:local": "node ../../scripts/update-openapi.js ../../../app-api/openapi.yml",
28
29
  "openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/app.yaml",
29
30
  "typegen": "openapi typegen src/openapi.json --client -b '/* eslint-disable */' > src/openapi.d.ts",
30
31
  "build": "tsc && npm run build:patch && npm run bundle-definition",