oro-sdk-apis 5.15.3 → 5.16.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.
- package/dist/models/workflow.d.ts +32 -0
- package/dist/oro-sdk-apis.cjs.development.js +5 -1
- package/dist/oro-sdk-apis.cjs.development.js.map +1 -1
- package/dist/oro-sdk-apis.cjs.production.min.js +1 -1
- package/dist/oro-sdk-apis.cjs.production.min.js.map +1 -1
- package/dist/oro-sdk-apis.esm.js +5 -1
- package/dist/oro-sdk-apis.esm.js.map +1 -1
- package/package.json +4 -3
- package/src/models/workflow.ts +51 -16
- package/src/services/api.ts +4 -0
package/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"version": "5.
|
2
|
+
"version": "5.16.0",
|
3
3
|
"main": "dist/index.js",
|
4
4
|
"typings": "dist/index.d.ts",
|
5
5
|
"files": [
|
@@ -41,7 +41,6 @@
|
|
41
41
|
"@size-limit/preset-small-lib": "^4.10.2",
|
42
42
|
"@types/jest": "^27.4.1",
|
43
43
|
"@types/sha.js": "^2.4.0",
|
44
|
-
"@types/uuid": "^8.3.0",
|
45
44
|
"prettier": "^2.6.1",
|
46
45
|
"prettier-plugin-svelte": "^2.3.0",
|
47
46
|
"size-limit": "^4.10.2",
|
@@ -50,9 +49,11 @@
|
|
50
49
|
"typescript": "^4.2.4"
|
51
50
|
},
|
52
51
|
"dependencies": {
|
52
|
+
"@types/uuid": "^8.3.0",
|
53
53
|
"axios": "^0.21.4",
|
54
54
|
"axios-auth-refresh": "^3.2.1",
|
55
55
|
"buffer": "^6.0.3",
|
56
|
-
"hash.js": "^1.1.7"
|
56
|
+
"hash.js": "^1.1.7",
|
57
|
+
"uuid": "^8.3.2"
|
57
58
|
}
|
58
59
|
}
|
package/src/models/workflow.ts
CHANGED
@@ -198,6 +198,16 @@ export interface GenericQuestionData<T, A = IndexedData<ChoiceInputData>, O = un
|
|
198
198
|
*/
|
199
199
|
options?: O
|
200
200
|
messages?: string
|
201
|
+
/**
|
202
|
+
* Overrides the read only ability of the question's answer
|
203
|
+
* populated by extended workflow feature
|
204
|
+
*/
|
205
|
+
readOnly?: boolean
|
206
|
+
/**
|
207
|
+
* Overrides the fillable default of the question's answer
|
208
|
+
* populated by extended workflow feature
|
209
|
+
*/
|
210
|
+
defaultEmpty?: boolean
|
201
211
|
}
|
202
212
|
|
203
213
|
export interface GroupedGenericQuestionData<T, A = IndexedData<ChoiceInputData>> extends GenericQuestionData<T, A> {
|
@@ -209,25 +219,25 @@ export interface GroupedGenericQuestionData<T, A = IndexedData<ChoiceInputData>>
|
|
209
219
|
export declare type QuestionData =
|
210
220
|
| GenericQuestionData<'title' | 'paragraph' | 'checkbox', void>
|
211
221
|
| GenericQuestionData<
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
+
| 'text'
|
223
|
+
| 'text-area'
|
224
|
+
| 'date'
|
225
|
+
| 'number'
|
226
|
+
| 'images'
|
227
|
+
| 'body-parts'
|
228
|
+
| 'pharmacy-picker'
|
229
|
+
| 'online-pharmacy-picker'
|
230
|
+
| 'place-address'
|
231
|
+
>
|
222
232
|
| GenericQuestionData<'images-alias', IndexedData<ChoiceInputData>, ImagesAliasQuestionOptions>
|
223
233
|
| GenericQuestionData<
|
224
|
-
|
225
|
-
|
226
|
-
|
234
|
+
'checkbox-group' | 'hair-loss-frontal' | 'select' | 'multiple' | 'text-select-group',
|
235
|
+
IndexedData<ChoiceInputData>
|
236
|
+
>
|
227
237
|
| GroupedGenericQuestionData<
|
228
|
-
|
229
|
-
|
230
|
-
|
238
|
+
'radio' | 'hair-selector-women' | 'hair-selector-men' | 'hair-loss-stage' | 'hair-loss-other',
|
239
|
+
IndexedData<RadioInputData>
|
240
|
+
>
|
231
241
|
| GroupedGenericQuestionData<'radio-card' | 'profile-selector', IndexedData<RadioCardInputData>>
|
232
242
|
| GroupedGenericQuestionData<'language-picker', IndexedData<LanguagePickerData>>
|
233
243
|
| GroupedGenericQuestionData<'tile-radio', IndexedData<TileRadioData>>
|
@@ -283,6 +293,31 @@ export interface WorkflowData {
|
|
283
293
|
* (optional) rules to hide certain payment plans depending on the workflow answers
|
284
294
|
*/
|
285
295
|
hidePlanRules?: HidePlanRule[]
|
296
|
+
|
297
|
+
/**
|
298
|
+
* (optional) extension of another workflow referenced by uuid
|
299
|
+
*/
|
300
|
+
extendingWorkflow?: string
|
301
|
+
|
302
|
+
/**
|
303
|
+
* (optional) rules for the extension of another workflow
|
304
|
+
*/
|
305
|
+
extendingRules?: IndexedData<WorkflowExtendingRules>
|
306
|
+
}
|
307
|
+
|
308
|
+
export interface WorkflowExtendingRules {
|
309
|
+
/**
|
310
|
+
* Whether the field becomes read only in the extended workflow
|
311
|
+
*/
|
312
|
+
readOnly?: boolean,
|
313
|
+
/**
|
314
|
+
* Whether the field becomes deselected/empty by default in the extended workflow
|
315
|
+
*/
|
316
|
+
defaultEmpty?: boolean,
|
317
|
+
/**
|
318
|
+
* Whether the field should be removed altogether in the extended workflow
|
319
|
+
*/
|
320
|
+
remove?: boolean,
|
286
321
|
}
|
287
322
|
|
288
323
|
export interface HidePlanRule {
|
package/src/services/api.ts
CHANGED
@@ -3,6 +3,7 @@ import createAuthRefreshInterceptor from 'axios-auth-refresh'
|
|
3
3
|
import { AuthRefreshFunc, Tokens } from '../models'
|
4
4
|
import { AxiosService } from './axios'
|
5
5
|
import { GuardRequestConfig } from './guard'
|
6
|
+
import { v4 as uuidv4 } from 'uuid'
|
6
7
|
|
7
8
|
export class APIService extends AxiosService {
|
8
9
|
private authRefreshFn?: AuthRefreshFunc
|
@@ -21,6 +22,7 @@ export class APIService extends AxiosService {
|
|
21
22
|
) {
|
22
23
|
super(config)
|
23
24
|
const self = this
|
25
|
+
const sessionId = uuidv4()
|
24
26
|
|
25
27
|
this.axios.interceptors.request.use(
|
26
28
|
(config) => {
|
@@ -31,6 +33,8 @@ export class APIService extends AxiosService {
|
|
31
33
|
config.headers = {
|
32
34
|
...config.headers,
|
33
35
|
Authorization: `Bearer ${token}`,
|
36
|
+
'X-Session-Id': sessionId,
|
37
|
+
'X-Request-Id': uuidv4(),
|
34
38
|
}
|
35
39
|
return config
|
36
40
|
},
|