@epilot/app-client 0.9.9 → 0.9.10-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (()=>{"use strict";var e={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,90 @@ 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 and pricing details from an external catalog.
1005
+ *
1006
+ */
1007
+ ExternalProductCatalogHook[];
1008
+ }
1009
+ /**
1010
+ * Hook for getting products and pricing details from an external catalog.
1011
+ *
1012
+ */
1013
+ export interface ExternalProductCatalogHook {
1014
+ /**
1015
+ * Identifier of the hook. Should not change between updates.
1016
+ */
1017
+ id: string; // ^[a-zA-Z0-9_-]+$
1018
+ name: TranslatedString;
1019
+ /**
1020
+ * Type of the hook. Either "products" or "products-recommendation". The response of the call will be different depending on the type. Check the docs or the response API call contract https://docs.api.epilot.io/pricing-api-external-catalog for more details.
1021
+ *
1022
+ */
1023
+ type?: "products" | "products-recommendation";
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
+ }
970
1054
  /**
971
1055
  * Required grants for the app in order to call APIs for the installing tenant
972
1056
  */
@@ -1229,10 +1313,6 @@ declare namespace Components {
1229
1313
  configuration: PortalExtensionConfig;
1230
1314
  }
1231
1315
  export interface PortalExtensionConfig {
1232
- /**
1233
- * Identifier of the extension. Should not change between updates.
1234
- */
1235
- id?: string; // ^[a-zA-Z0-9_-]+$
1236
1316
  hooks?: ({
1237
1317
  /**
1238
1318
  * Identifier of the hook. Should not change between updates.
@@ -1246,12 +1326,17 @@ declare namespace Components {
1246
1326
  *
1247
1327
  */
1248
1328
  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.
1329
+ * 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).
1330
+ * The expected response http status code to the call is:
1331
+ * - 200 if found
1332
+ * - 404 if not found
1333
+ *
1334
+ * The following assignment modes are supported:
1335
+ * - `contracts`: We expect the response to contain Contract ids (customizable using `result` property).
1336
+ * - `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.
1337
+ * - `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.
1338
+ *
1339
+ * 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
1340
  *
1256
1341
  */
1257
1342
  PortalExtensionHookContractIdentification | /**
@@ -1367,12 +1452,17 @@ declare namespace Components {
1367
1452
  use_static_ips?: boolean;
1368
1453
  }
1369
1454
  /**
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.
1455
+ * 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).
1456
+ * The expected response http status code to the call is:
1457
+ * - 200 if found
1458
+ * - 404 if not found
1459
+ *
1460
+ * The following assignment modes are supported:
1461
+ * - `contracts`: We expect the response to contain Contract ids (customizable using `result` property).
1462
+ * - `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.
1463
+ * - `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.
1464
+ *
1465
+ * 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
1466
  *
1377
1467
  */
1378
1468
  export interface PortalExtensionHookContractIdentification {
@@ -1407,7 +1497,11 @@ declare namespace Components {
1407
1497
  };
1408
1498
  };
1409
1499
  /**
1410
- * Name of the Contact attribute to update with the matched Contact ID. Must be a Contact relation attribute supporting multiple entities.
1500
+ * Mode of contract assignment. See hook description for mode details.
1501
+ */
1502
+ assignment_mode?: "contracts" | "contact_to_contracts" | "contact_to_portal_user";
1503
+ /**
1504
+ * 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
1505
  * example:
1412
1506
  * represents_contact
1413
1507
  */
@@ -1420,7 +1514,7 @@ declare namespace Components {
1420
1514
  /**
1421
1515
  * Explanation of the functionality shown to the end user.
1422
1516
  * example:
1423
- * This process will give you access to all Contracts kept
1517
+ * This process will give you access to the matching Contracts.
1424
1518
  */
1425
1519
  en: string;
1426
1520
  };
@@ -3020,6 +3114,10 @@ export type ErpInformToolkitComponent = Components.Schemas.ErpInformToolkitCompo
3020
3114
  export type EventsQuery = Components.Schemas.EventsQuery;
3021
3115
  export type EventsQueryResponse = Components.Schemas.EventsQueryResponse;
3022
3116
  export type ExternalIntegrationCustomActionConfig = Components.Schemas.ExternalIntegrationCustomActionConfig;
3117
+ export type ExternalProductCatalogAuthBlock = Components.Schemas.ExternalProductCatalogAuthBlock;
3118
+ export type ExternalProductCatalogComponent = Components.Schemas.ExternalProductCatalogComponent;
3119
+ export type ExternalProductCatalogConfig = Components.Schemas.ExternalProductCatalogConfig;
3120
+ export type ExternalProductCatalogHook = Components.Schemas.ExternalProductCatalogHook;
3023
3121
  export type Grants = Components.Schemas.Grants;
3024
3122
  export type Installation = Components.Schemas.Installation;
3025
3123
  export type JourneyBlockComponent = Components.Schemas.JourneyBlockComponent;
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
  }
@@ -2084,7 +2089,7 @@
2084
2089
  }
2085
2090
  }
2086
2091
  },
2087
- "PortalExtensionComponent": {
2092
+ "ExternalProductCatalogComponent": {
2088
2093
  "type": "object",
2089
2094
  "required": [
2090
2095
  "component_type",
@@ -2094,22 +2099,121 @@
2094
2099
  "component_type": {
2095
2100
  "type": "string",
2096
2101
  "enum": [
2097
- "PORTAL_EXTENSION"
2102
+ "EXTERNAL_PRODUCT_CATALOG"
2098
2103
  ]
2099
2104
  },
2100
2105
  "configuration": {
2101
- "$ref": "#/components/schemas/PortalExtensionConfig"
2106
+ "$ref": "#/components/schemas/ExternalProductCatalogConfig"
2102
2107
  }
2103
2108
  }
2104
2109
  },
2105
- "PortalExtensionConfig": {
2110
+ "ExternalProductCatalogConfig": {
2111
+ "type": "object",
2112
+ "properties": {
2113
+ "hooks": {
2114
+ "type": "array",
2115
+ "items": {
2116
+ "$ref": "#/components/schemas/ExternalProductCatalogHook"
2117
+ }
2118
+ }
2119
+ },
2120
+ "additionalProperties": false
2121
+ },
2122
+ "ExternalProductCatalogHook": {
2106
2123
  "type": "object",
2124
+ "description": "Hook for getting products and pricing details from an external catalog.\n",
2107
2125
  "properties": {
2108
2126
  "id": {
2109
2127
  "type": "string",
2110
2128
  "pattern": "^[a-zA-Z0-9_-]+$",
2111
- "description": "Identifier of the extension. Should not change between updates."
2129
+ "description": "Identifier of the hook. Should not change between updates."
2130
+ },
2131
+ "name": {
2132
+ "$ref": "#/components/schemas/TranslatedString"
2133
+ },
2134
+ "type": {
2135
+ "type": "string",
2136
+ "description": "Type of the hook. Either \"products\" or \"products-recommendation\". The response of the call will be different depending on the type. Check the docs or the response API call contract https://docs.api.epilot.io/pricing-api-external-catalog for more details.\n",
2137
+ "enum": [
2138
+ "products",
2139
+ "products-recommendation"
2140
+ ],
2141
+ "default": "products"
2142
+ },
2143
+ "auth": {
2144
+ "$ref": "#/components/schemas/ExternalProductCatalogAuthBlock"
2112
2145
  },
2146
+ "call": {
2147
+ "type": "object",
2148
+ "properties": {
2149
+ "method": {
2150
+ "type": "string",
2151
+ "description": "HTTP method to use for the call",
2152
+ "default": "GET"
2153
+ },
2154
+ "url": {
2155
+ "type": "string",
2156
+ "description": "URL to call. Supports variable interpolation."
2157
+ },
2158
+ "params": {
2159
+ "type": "object",
2160
+ "description": "Parameters to append to the URL. Supports variable interpolation.",
2161
+ "additionalProperties": {
2162
+ "type": "string"
2163
+ },
2164
+ "default": {}
2165
+ },
2166
+ "headers": {
2167
+ "type": "object",
2168
+ "description": "Headers to use. Supports variable interpolation.",
2169
+ "additionalProperties": {
2170
+ "type": "string"
2171
+ },
2172
+ "default": {}
2173
+ },
2174
+ "body": {
2175
+ "type": "object",
2176
+ "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).",
2177
+ "additionalProperties": {
2178
+ "type": "string"
2179
+ },
2180
+ "default": {}
2181
+ }
2182
+ },
2183
+ "required": [
2184
+ "url"
2185
+ ],
2186
+ "additionalProperties": false
2187
+ }
2188
+ },
2189
+ "required": [
2190
+ "call",
2191
+ "name",
2192
+ "id"
2193
+ ],
2194
+ "additionalProperties": false
2195
+ },
2196
+ "PortalExtensionComponent": {
2197
+ "type": "object",
2198
+ "required": [
2199
+ "component_type",
2200
+ "configuration"
2201
+ ],
2202
+ "properties": {
2203
+ "component_type": {
2204
+ "type": "string",
2205
+ "enum": [
2206
+ "PORTAL_EXTENSION"
2207
+ ]
2208
+ },
2209
+ "configuration": {
2210
+ "$ref": "#/components/schemas/PortalExtensionConfig"
2211
+ }
2212
+ }
2213
+ },
2214
+ "PortalExtensionConfig": {
2215
+ "type": "object",
2216
+ "properties": {
2113
2217
  "hooks": {
2114
2218
  "type": "array",
2115
2219
  "items": {
@@ -2238,7 +2342,7 @@
2238
2342
  "additionalProperties": false
2239
2343
  },
2240
2344
  "PortalExtensionHookContractIdentification": {
2241
- "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",
2345
+ "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",
2242
2346
  "type": "object",
2243
2347
  "properties": {
2244
2348
  "type": {
@@ -2289,9 +2393,19 @@
2289
2393
  ],
2290
2394
  "additionalProperties": false
2291
2395
  },
2396
+ "assignment_mode": {
2397
+ "type": "string",
2398
+ "enum": [
2399
+ "contracts",
2400
+ "contact_to_contracts",
2401
+ "contact_to_portal_user"
2402
+ ],
2403
+ "description": "Mode of contract assignment. See hook description for mode details.",
2404
+ "default": "contact_to_contracts"
2405
+ },
2292
2406
  "contact_relation_attribute": {
2293
2407
  "type": "string",
2294
- "description": "Name of the Contact attribute to update with the matched Contact ID. Must be a Contact relation attribute supporting multiple entities.",
2408
+ "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.",
2295
2409
  "example": "represents_contact"
2296
2410
  },
2297
2411
  "explanation": {
@@ -2300,7 +2414,7 @@
2300
2414
  "en": {
2301
2415
  "type": "string",
2302
2416
  "description": "Explanation of the functionality shown to the end user.",
2303
- "example": "This process will give you access to all Contracts kept"
2417
+ "example": "This process will give you access to the matching Contracts."
2304
2418
  }
2305
2419
  },
2306
2420
  "additionalProperties": {
@@ -2790,6 +2904,48 @@
2790
2904
  ],
2791
2905
  "additionalProperties": false
2792
2906
  },
2907
+ "ExternalProductCatalogAuthBlock": {
2908
+ "type": "object",
2909
+ "properties": {
2910
+ "method": {
2911
+ "type": "string",
2912
+ "description": "HTTP method to use for authentication",
2913
+ "default": "GET"
2914
+ },
2915
+ "url": {
2916
+ "type": "string",
2917
+ "description": "URL to use for authentication. Supports variable interpolation."
2918
+ },
2919
+ "params": {
2920
+ "type": "object",
2921
+ "description": "Parameters to append to the URL. Supports variable interpolation.",
2922
+ "additionalProperties": {
2923
+ "type": "string"
2924
+ },
2925
+ "default": {}
2926
+ },
2927
+ "headers": {
2928
+ "type": "object",
2929
+ "description": "Headers to use for authentication. Supports variable interpolation.",
2930
+ "additionalProperties": {
2931
+ "type": "string"
2932
+ },
2933
+ "default": {}
2934
+ },
2935
+ "body": {
2936
+ "type": "object",
2937
+ "description": "JSON body to use for authentication. Supports variable interpolation. Content format is determined by Content-Type header.",
2938
+ "additionalProperties": {
2939
+ "type": "string"
2940
+ },
2941
+ "default": {}
2942
+ }
2943
+ },
2944
+ "required": [
2945
+ "url"
2946
+ ],
2947
+ "additionalProperties": false
2948
+ },
2793
2949
  "OverrideDevMode": {
2794
2950
  "type": "object",
2795
2951
  "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.9.9",
3
+ "version": "0.9.10-alpha.0",
4
4
  "description": "JavaScript client library for the epilot App API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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",