@elliemae/pui-scripting-object 1.25.0 → 1.27.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,5 +1,6 @@
1
1
  import { IEvent, Listener } from '../event.js';
2
2
  import { IScriptingObject } from '../scriptingObject.js';
3
+ import { UserAccessRights } from './userAccessRights.js';
3
4
  /**
4
5
  * Log levels
5
6
  */
@@ -222,10 +223,17 @@ export interface IApplication extends IScriptingObject {
222
223
  */
223
224
  getPoliciesDetails(): Promise<Record<string, string>>;
224
225
  /**
226
+ * @deprecated use getUserAccessRights instead
225
227
  * get persona Access information for the current user
226
228
  * @returns persona access information as key value pairs
227
229
  */
228
230
  getPersonaAccess(): Promise<Record<string, string>>;
231
+ /**
232
+ * Get access rights for the current user
233
+ * @returns user access rights (effective rights)
234
+ * @throws {Error} if operation fails
235
+ */
236
+ getUserAccessRights(): Promise<UserAccessRights>;
229
237
  /**
230
238
  * Prints given document
231
239
  * @param options Print options
@@ -1,5 +1,4 @@
1
1
  import { IScriptingObject } from '../scriptingObject.js';
2
- import { UserAccessRights } from './userAccessRights.js';
3
2
  export type Personas = {
4
3
  entityId: string;
5
4
  entityType: string;
@@ -115,10 +114,4 @@ export interface IAuth extends IScriptingObject {
115
114
  * @returns user information
116
115
  */
117
116
  getUser(): Promise<User>;
118
- /**
119
- * Get access rights for the current user
120
- * @returns user access rights
121
- * @throws {Error} if operation fails
122
- */
123
- getUserAccessRights(): Promise<UserAccessRights>;
124
117
  }
@@ -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,29 @@ 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
+ * Supports EPC & EVP service order integrations
136
+ * @param category - name of the service category
137
+ * @param {LaunchCategoryOptions} options - options for launching the service order integration
138
+ * @returns None
100
139
  *
101
140
  * #### Product Compatibility:
102
141
  * | | Encompass | Encompass Web | TPO | Consumer Connect |
103
142
  * :-----:|:-----: |:-----: |:-----: |:-----: |
104
143
  * | all | ✖️ | ✖️ | ✖️ | ✖️ |
105
144
  */
106
- selectServiceSetup: (category: ServiceSetupCategory, providerId?: string) => Promise<ServiceSetup>;
145
+ launchByCategory: (category: string, options: LaunchCategoryOptions) => Promise<void>;
107
146
  /**
108
- * launch the default or specific service intergration to place a new service order or view existing order
147
+ * launch a service intergration for a specific service setup to place a new service order or view existing order
148
+ * This method will unload the current microapp and navigate to the service order integration
149
+ * after the integration flow is complete, user will be redirected back to the url provided in the options.
150
+ * redirect url will be appended with query parameters containing the service order transaction id and service order id incase of new order
151
+ * Supports EPC & EVP service order integrations
109
152
  * @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
153
+ * @param {LaunchServiceSetupOptions} options - options for launching the service order integration
112
154
  * @returns None
113
155
  *
114
156
  * #### Product Compatibility:
@@ -116,5 +158,5 @@ export interface IService extends IScriptingObject {
116
158
  * :-----:|:-----: |:-----: |:-----: |:-----: |
117
159
  * | all | ✖️ | ✖️ | ✖️ | ✖️ |
118
160
  */
119
- launch: (serviceSetupId: string, options: LaunchOptions) => Promise<void>;
161
+ launchByServiceSetup: (serviceSetupId: string, options: LaunchServiceSetupOptions) => Promise<void>;
120
162
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-scripting-object",
3
- "version": "1.25.0",
3
+ "version": "1.27.0",
4
4
  "description": "Typescript defintions for Scripting Objects",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/cjs/index.js",
@@ -67,7 +67,7 @@
67
67
  },
68
68
  "devDependencies": {
69
69
  "@elliemae/browserslist-config-elliemae-latest-browsers": "~1.7.0",
70
- "@elliemae/pui-cli": "~8.13.0",
70
+ "@elliemae/pui-cli": "~8.13.1",
71
71
  "@elliemae/pui-doc-gen": "~1.7.1",
72
72
  "@elliemae/pui-theme": "~2.7.0",
73
73
  "@types/styled-components": "~5.1.26",