@elliemae/pui-scripting-object 1.24.1 → 1.26.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.
@@ -242,5 +242,11 @@ export interface IApplication extends IScriptingObject {
242
242
  * @param logLevel level of the log message
243
243
  */
244
244
  log(message: string, logLevel: LogLevel): Promise<void>;
245
+ /**
246
+ * get company settings for a particular category
247
+ * @param category category name
248
+ * @returns company settings as key value pairs. Null if category is not found
249
+ */
250
+ getCompanySettings(category: string): Promise<Record<string, any> | null>;
245
251
  }
246
252
  export {};
@@ -31,15 +31,50 @@ export type ServiceSetup = {
31
31
  category: ServiceSetupCategory;
32
32
  };
33
33
  /**
34
- * options to launch service order integration
34
+ * options to launch service order integration by category
35
35
  */
36
- export type LaunchOptions = {
36
+ export type LaunchCategoryOptions = {
37
37
  /**
38
38
  * source application context that is launching the service order integration
39
39
  * urn patterned string
40
40
  * example: urn:elli:services:getpricing
41
41
  */
42
42
  source: string;
43
+ /**
44
+ * url to redirect to after the service order integration flow is complete
45
+ */
46
+ redirectUrl: string;
47
+ /**
48
+ * unique id of the existing service order transaction
49
+ */
50
+ transactionId?: string;
51
+ /**
52
+ * unique id of the existing service order
53
+ */
54
+ serviceOrderId?: string;
55
+ /**
56
+ * settings to be passed to the service order integration
57
+ */
58
+ settings?: any;
59
+ /**
60
+ * additional data needed for the service order integration
61
+ */
62
+ additionalData?: any;
63
+ };
64
+ /**
65
+ * options to launch service order integration by specific service setup
66
+ */
67
+ export type LaunchServiceSetupOptions = {
68
+ /**
69
+ * source application context that is launching the service order integration
70
+ * urn patterned string
71
+ * example: urn:elli:services:getpricing
72
+ */
73
+ source: string;
74
+ /**
75
+ * url to redirect to after the service order integration flow is complete
76
+ */
77
+ redirectUrl: string;
43
78
  /**
44
79
  * unique id of the partner
45
80
  */
@@ -93,22 +128,27 @@ export interface IService extends IScriptingObject {
93
128
  */
94
129
  getEligibleServices: (category: ServiceSetupCategory, providerId?: string) => Promise<Array<ServiceSetup>>;
95
130
  /**
96
- * select a service setup from the list of eligible service setups
97
- * @param {ServiceSetupCategory} category - service setup category
98
- * @param providerId - unique id of the service setup provider
99
- * @returns {ServiceSetup} service setup chosen by the user. Null if no service setup is chosen
131
+ * launch a service intergration for a specific category to place a new service order or view existing order
132
+ * This method will unload the current microapp and navigate to the service order integration
133
+ * after the integration flow is complete, user will be redirected back to the url provided in the options.
134
+ * redirect url will be appended with query parameters containing the service order transaction id and service order id incase of new order
135
+ * @param category - name of the service category
136
+ * @param {LaunchCategoryOptions} options - options for launching the service order integration
137
+ * @returns None
100
138
  *
101
139
  * #### Product Compatibility:
102
140
  * | | Encompass | Encompass Web | TPO | Consumer Connect |
103
141
  * :-----:|:-----: |:-----: |:-----: |:-----: |
104
142
  * | all | ✖️ | ✖️ | ✖️ | ✖️ |
105
143
  */
106
- selectServiceSetup: (category: ServiceSetupCategory, providerId?: string) => Promise<ServiceSetup>;
144
+ launchByCategory: (category: string, options: LaunchCategoryOptions) => Promise<void>;
107
145
  /**
108
- * launch the default or specific service intergration to place a new service order or view existing order
146
+ * launch a service intergration for a specific service setup to place a new service order or view existing order
147
+ * This method will unload the current microapp and navigate to the service order integration
148
+ * after the integration flow is complete, user will be redirected back to the url provided in the options.
149
+ * redirect url will be appended with query parameters containing the service order transaction id and service order id incase of new order
109
150
  * @param serviceSetupId - unique id of the service setup
110
- * @param {LaunchOptions} options - options for launching the service order integration
111
- * @throws Error if the service setup is not found or user is not authorized to open the integration
151
+ * @param {LaunchServiceSetupOptions} options - options for launching the service order integration
112
152
  * @returns None
113
153
  *
114
154
  * #### Product Compatibility:
@@ -116,5 +156,5 @@ export interface IService extends IScriptingObject {
116
156
  * :-----:|:-----: |:-----: |:-----: |:-----: |
117
157
  * | all | ✖️ | ✖️ | ✖️ | ✖️ |
118
158
  */
119
- launch: (serviceSetupId: string, options: LaunchOptions) => Promise<void>;
159
+ launchByServiceSetup: (serviceSetupId: string, options: LaunchServiceSetupOptions) => Promise<void>;
120
160
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-scripting-object",
3
- "version": "1.24.1",
3
+ "version": "1.26.0",
4
4
  "description": "Typescript defintions for Scripting Objects",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/cjs/index.js",