@elliemae/pui-scripting-object 1.11.0 → 1.12.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.
@@ -41,9 +41,9 @@ export declare type ResourceOptions = {
41
41
  name: string;
42
42
  };
43
43
  /**
44
- * response object of createResource method
44
+ * details of the transaction resource
45
45
  */
46
- export declare type CreateResourceResponse = {
46
+ export declare type ResourceDetails = {
47
47
  /**
48
48
  * resource id
49
49
  */
@@ -75,50 +75,64 @@ export declare type CreateResourceResponse = {
75
75
  */
76
76
  export interface ITransactionV2 {
77
77
  /**
78
- * Get transaction's origination and context
78
+ * create new transaction
79
79
  *
80
- * @param id - unique identifier for the transaction
81
- * @returns transaction origination information and null if the transaction is not found
80
+ * @param options details of the transaction to be created
81
+ * @returns transaction id
82
+ * @throws error when transaction creation fails
82
83
  */
83
- getOrigin(id: string): Promise<OriginInfo | null>;
84
+ create(options: TransactionDetails): Promise<string>;
84
85
  /**
85
- * Refresh transaction origination context, if current one expires.
86
+ * send event for the subject transaction
86
87
  *
87
88
  * @param id - unique identifier for the transaction
88
- * @returns transaction origination information or null if the transaction is not found
89
+ * @param options details of the event/message to be initiated
90
+ * @returns transaction event id
91
+ * @throws error when event creation fails
89
92
  */
90
- refreshOrigin(id: string): Promise<OriginInfo | null>;
93
+ createEvent(id: string, options: TransactionEvent): Promise<string>;
91
94
  /**
92
95
  * get necessary details to upload document for specific transaction
93
96
  *
94
97
  * @param id - unique identifier for the transaction
95
98
  * @param options details of the document to be uploaded
96
99
  * @returns details about the location where to upload the document
100
+ * @throws error when resource can not be created
97
101
  */
98
- createResource(id: string, options: ResourceOptions): Promise<CreateResourceResponse | null>;
102
+ createResource(id: string, options: ResourceOptions): Promise<ResourceDetails>;
99
103
  /**
100
- * create new transaction
104
+ * get details about the transaction
101
105
  *
102
- * @param options details of the transaction to be created
103
- * @returns transaction id
106
+ * @param id - unique identifier for the transaction
107
+ * @returns transaction details
108
+ * @throws TransactionNotFound error for invalid transaction id
104
109
  */
105
- create(options: TransactionDetails): Promise<string>;
110
+ get(id: string): Promise<TransactionDetails>;
106
111
  /**
107
- * update existing transaction.
112
+ * Get transaction's origination and context
108
113
  *
109
114
  * @param id - unique identifier for the transaction
110
- * @param options transaction details to be updated
111
- * @returns transaction id and null if the transaction is not found
115
+ * @returns transaction origination information
116
+ * @throws TransactinNotFound error for invalid transaction id
112
117
  */
113
- update(id: string, options: TransactionDetails): Promise<void | null>;
118
+ getOrigin(id: string): Promise<OriginInfo>;
114
119
  /**
115
- * send event for the subject transaction
120
+ * refresh transaction origination context, if current one expires.
116
121
  *
117
122
  * @param id - unique identifier for the transaction
118
- * @param options details of the event/message to be initiated
119
- * @returns transaction event id
123
+ * @returns transaction origination information
124
+ * @throws TransactionNotFound error for invalid transaction id
120
125
  */
121
- createEvent(id: string, options: TransactionEvent): Promise<string>;
126
+ refreshOrigin(id: string): Promise<OriginInfo>;
127
+ /**
128
+ * update existing transaction.
129
+ *
130
+ * @param id - unique identifier for the transaction
131
+ * @param options transaction details to be updated
132
+ * @returns transaction id and null if the transaction is not found
133
+ * @throws error when transaction update fails
134
+ */
135
+ update(id: string, options: TransactionDetails): Promise<void>;
122
136
  /**
123
137
  * Navigate your users back to where they left off in the host Encompass application,
124
138
  * after they are done interacting with your application's user-interface
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-scripting-object",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "Typescript defintions for Scripting Objects",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/cjs/index.js",