@awell-health/awell-extensions 1.0.101 → 1.0.103
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/extensions/markdown.json +2 -2
- package/dist/extensions/wellinks/actions/checkFlourishCustomer/checkFlourishCustomer.d.ts +1 -1
- package/dist/extensions/wellinks/actions/checkFlourishCustomer/checkFlourishCustomer.js +1 -2
- package/dist/extensions/wellinks/actions/checkFlourishCustomer/checkFlourishCustomer.js.map +1 -1
- package/dist/extensions/wellinks/actions/checkFlourishCustomer/checkFlourishCustomer.test.js +5 -3
- package/dist/extensions/wellinks/actions/checkFlourishCustomer/checkFlourishCustomer.test.js.map +1 -1
- package/dist/extensions/wellinks/actions/checkForChat/checkForChat.d.ts +1 -1
- package/dist/extensions/wellinks/actions/checkForChat/checkForChat.js +9 -7
- package/dist/extensions/wellinks/actions/checkForChat/checkForChat.js.map +1 -1
- package/dist/extensions/wellinks/actions/checkForChat/checkForChat.test.js +2 -2
- package/dist/extensions/wellinks/actions/checkForChat/checkForChat.test.js.map +1 -1
- package/dist/extensions/wellinks/actions/checkForCheckInOverride/checkForCheckInOverride.d.ts +1 -1
- package/dist/extensions/wellinks/actions/checkForCheckInOverride/checkForCheckInOverride.js +12 -6
- package/dist/extensions/wellinks/actions/checkForCheckInOverride/checkForCheckInOverride.js.map +1 -1
- package/dist/extensions/wellinks/actions/checkForCheckInOverride/checkForCheckInOverride.test.js +2 -2
- package/dist/extensions/wellinks/actions/checkForCheckInOverride/checkForCheckInOverride.test.js.map +1 -1
- package/dist/extensions/wellinks/actions/checkForOverride/checkForOverride.d.ts +1 -1
- package/dist/extensions/wellinks/actions/checkForOverride/checkForOverride.js +16 -7
- package/dist/extensions/wellinks/actions/checkForOverride/checkForOverride.js.map +1 -1
- package/dist/extensions/wellinks/actions/checkForOverride/checkForOverride.test.js +2 -2
- package/dist/extensions/wellinks/actions/checkForOverride/checkForOverride.test.js.map +1 -1
- package/dist/extensions/wellinks/actions/checkForScheduledAppointment/checkForScheduledAppointment.d.ts +1 -1
- package/dist/extensions/wellinks/actions/checkForScheduledAppointment/checkForScheduledAppointment.js +1 -1
- package/dist/extensions/wellinks/actions/checkForScheduledAppointment/checkForScheduledAppointment.js.map +1 -1
- package/dist/extensions/wellinks/actions/checkForScheduledAppointment/checkForScheduledAppointment.test.js +2 -2
- package/dist/extensions/wellinks/actions/checkForScheduledAppointment/checkForScheduledAppointment.test.js.map +1 -1
- package/dist/extensions/wellinks/actions/createFlourishCustomer/config/fields.d.ts +58 -0
- package/dist/extensions/wellinks/actions/createFlourishCustomer/config/fields.js +56 -0
- package/dist/extensions/wellinks/actions/createFlourishCustomer/config/fields.js.map +1 -0
- package/dist/extensions/wellinks/actions/createFlourishCustomer/config/index.d.ts +2 -0
- package/dist/extensions/wellinks/actions/createFlourishCustomer/config/index.js +9 -0
- package/dist/extensions/wellinks/actions/createFlourishCustomer/config/index.js.map +1 -0
- package/dist/extensions/wellinks/actions/createFlourishCustomer/config/settings.d.ts +35 -0
- package/dist/extensions/wellinks/actions/createFlourishCustomer/config/settings.js +17 -0
- package/dist/extensions/wellinks/actions/createFlourishCustomer/config/settings.js.map +1 -0
- package/dist/extensions/wellinks/actions/createFlourishCustomer/createFlourishCustomer.d.ts +11 -0
- package/dist/extensions/wellinks/actions/createFlourishCustomer/createFlourishCustomer.js +56 -0
- package/dist/extensions/wellinks/actions/createFlourishCustomer/createFlourishCustomer.js.map +1 -0
- package/dist/extensions/wellinks/actions/createFlourishCustomer/createFlourishCustomer.test.d.ts +1 -0
- package/dist/extensions/wellinks/actions/createFlourishCustomer/createFlourishCustomer.test.js +53 -0
- package/dist/extensions/wellinks/actions/createFlourishCustomer/createFlourishCustomer.test.js.map +1 -0
- package/dist/extensions/wellinks/actions/index.d.ts +307 -0
- package/dist/extensions/wellinks/actions/index.js +4 -0
- package/dist/extensions/wellinks/actions/index.js.map +1 -1
- package/dist/extensions/wellinks/actions/insertMemberListEvent/insertMemberListEvent.d.ts +1 -1
- package/dist/extensions/wellinks/actions/insertMemberListEvent/insertMemberListEvent.js +1 -1
- package/dist/extensions/wellinks/actions/insertMemberListEvent/insertMemberListEvent.js.map +1 -1
- package/dist/extensions/wellinks/actions/insertMemberListEvent/insertMemberListEvent.test.js +3 -3
- package/dist/extensions/wellinks/actions/insertMemberListEvent/insertMemberListEvent.test.js.map +1 -1
- package/dist/extensions/wellinks/actions/submitPamSurvey/config/fields.d.ts +188 -0
- package/dist/extensions/wellinks/actions/submitPamSurvey/config/fields.js +160 -0
- package/dist/extensions/wellinks/actions/submitPamSurvey/config/fields.js.map +1 -0
- package/dist/extensions/wellinks/actions/submitPamSurvey/config/index.d.ts +2 -0
- package/dist/extensions/wellinks/actions/submitPamSurvey/config/index.js +9 -0
- package/dist/extensions/wellinks/actions/submitPamSurvey/config/index.js.map +1 -0
- package/dist/extensions/wellinks/actions/submitPamSurvey/config/settings.d.ts +35 -0
- package/dist/extensions/wellinks/actions/submitPamSurvey/config/settings.js +17 -0
- package/dist/extensions/wellinks/actions/submitPamSurvey/config/settings.js.map +1 -0
- package/dist/extensions/wellinks/actions/submitPamSurvey/submitPamSurvey.d.ts +19 -0
- package/dist/extensions/wellinks/actions/submitPamSurvey/submitPamSurvey.js +66 -0
- package/dist/extensions/wellinks/actions/submitPamSurvey/submitPamSurvey.js.map +1 -0
- package/dist/extensions/wellinks/actions/submitPamSurvey/submitPamSurvey.test.d.ts +1 -0
- package/dist/extensions/wellinks/actions/submitPamSurvey/submitPamSurvey.test.js +125 -0
- package/dist/extensions/wellinks/actions/submitPamSurvey/submitPamSurvey.test.js.map +1 -0
- package/dist/extensions/wellinks/api/clients/wellinksClient.js.map +1 -0
- package/dist/extensions/wellinks/api/clients/wellinksFlourishClient.d.ts +14 -0
- package/dist/extensions/wellinks/api/clients/wellinksFlourishClient.js +198 -0
- package/dist/extensions/wellinks/api/clients/wellinksFlourishClient.js.map +1 -0
- package/dist/extensions/wellinks/{wellinksGraphqlClient.d.ts → api/clients/wellinksGraphqlClient.d.ts} +1 -1
- package/dist/extensions/wellinks/api/clients/wellinksGraphqlClient.js.map +1 -0
- package/dist/extensions/wellinks/api/test/wellinksFlourishClient.test.d.ts +1 -0
- package/dist/extensions/wellinks/api/test/wellinksFlourishClient.test.js +192 -0
- package/dist/extensions/wellinks/api/test/wellinksFlourishClient.test.js.map +1 -0
- package/dist/extensions/wellinks/config/settings.js.map +1 -0
- package/dist/extensions/wellinks/config/types.d.ts +5 -0
- package/dist/extensions/wellinks/config/types.js +3 -0
- package/dist/extensions/wellinks/config/types.js.map +1 -0
- package/dist/extensions/wellinks/index.js +1 -1
- package/dist/extensions/wellinks/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/extensions/wellinks/settings.js.map +0 -1
- package/dist/extensions/wellinks/wellinksClient.js.map +0 -1
- package/dist/extensions/wellinks/wellinksFlourishClient.d.ts +0 -9
- package/dist/extensions/wellinks/wellinksFlourishClient.js +0 -79
- package/dist/extensions/wellinks/wellinksFlourishClient.js.map +0 -1
- package/dist/extensions/wellinks/wellinksGraphqlClient.js.map +0 -1
- package/dist/extensions/wellinks/wellinksSendgridClient.d.ts +0 -7
- package/dist/extensions/wellinks/wellinksSendgridClient.js +0 -28
- package/dist/extensions/wellinks/wellinksSendgridClient.js.map +0 -1
- /package/dist/extensions/wellinks/{wellinksClient.d.ts → api/clients/wellinksClient.d.ts} +0 -0
- /package/dist/extensions/wellinks/{wellinksClient.js → api/clients/wellinksClient.js} +0 -0
- /package/dist/extensions/wellinks/{wellinksGraphqlClient.js → api/clients/wellinksGraphqlClient.js} +0 -0
- /package/dist/extensions/wellinks/{settings.d.ts → config/settings.d.ts} +0 -0
- /package/dist/extensions/wellinks/{settings.js → config/settings.js} +0 -0
package/dist/extensions/wellinks/actions/insertMemberListEvent/insertMemberListEvent.test.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"insertMemberListEvent.test.js","sourceRoot":"","sources":["../../../../../extensions/wellinks/actions/insertMemberListEvent/insertMemberListEvent.test.ts"],"names":[],"mappings":";;AAAA,iDAA2D;AAC3D
|
1
|
+
{"version":3,"file":"insertMemberListEvent.test.js","sourceRoot":"","sources":["../../../../../extensions/wellinks/actions/insertMemberListEvent/insertMemberListEvent.test.ts"],"names":[],"mappings":";;AAAA,iDAA2D;AAC3D,+EAGmD;AACnD,8DAA8D;AAC9D,mEAA+D;AAE/D,IAAI,CAAC,IAAI,CAAC,kCAAkC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,cAAc,EAAd,+BAAc,EAAE,CAAC,CAAC,CAAA;AAEzE,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAEzB,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,aAAa,EAAE,CAAA;IACtB,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,2FAA2F,EAAE,KAAK,IAAI,EAAE;QAC3G,MAAM,YAAY,GAAG,IAAA,2BAAmB,EAAC;YACvC,MAAM,EAAE;gBACN,SAAS,EAAE,YAAY;gBACvB,QAAQ,EAAE,UAAU;gBACpB,UAAU,EAAE,aAAa;gBACzB,cAAc,EAAE,kBAAkB;gBAClC,cAAc,EAAE,iBAAiB;gBACjC,SAAS,EAAE,YAAY;gBACvB,UAAU,EAAE,cAAc;aAC3B;YACD,QAAQ,EAAE,uBAAY;SACvB,CAAC,CAAA;QAEF,iDAAgC,CAAC,eAAe,CAAC,MAAM,CAAC,sBAAsB,CAC5E,GAAG,EAAE;YACH,OAAO,GAAG,CAAA;QACZ,CAAC,CACF,CAAA;QAED,MAAM,6CAAqB,CAAC,iBAAiB,CAC3C,YAAY,EACZ,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,CAAA;QAChC,MAAM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DAA2D,EAAE,KAAK,IAAI,EAAE;QAC3E,MAAM,cAAc,GAAG,IAAA,2BAAmB,EAAC;YACzC,MAAM,EAAE;gBACN,SAAS,EAAE,YAAY;gBACvB,QAAQ,EAAE,WAAW;gBACrB,UAAU,EAAE,aAAa;gBACzB,cAAc,EAAE,kBAAkB;gBAClC,cAAc,EAAE,iBAAiB;gBACjC,SAAS,EAAE,YAAY;gBACvB,UAAU,EAAE,cAAc;aAC3B;YACD,QAAQ,EAAE,uBAAY;SACvB,CAAC,CAAA;QACF,iDAAgC,CAAC,eAAe,CAAC,MAAM,CAAC,sBAAsB,CAC5E,GAAG,EAAE;YACH,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAA;QAC1C,CAAC,CACF,CAAA;QACD,MAAM,6CAAqB,CAAC,iBAAiB,CAC3C,cAAc,EACd,UAAU,EACV,OAAO,CACR,CAAA;QACD,MAAM,CAAC,OAAO,CAAC,CAAC,uBAAuB,CAAC,CAAC,EAAE;YACzC,MAAM,EAAE,MAAM,CAAC,eAAe,CAAC;gBAC7B,MAAM,CAAC,gBAAgB,CAAC;oBACtB,KAAK,EAAE;wBACL,QAAQ,EAAE,cAAc;wBACxB,OAAO,EACL,4DAA4D;qBAC/D;iBACF,CAAC;aACH,CAAC;SACH,CAAC,CAAA;QACF,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,CAAA;IACrC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1,188 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
import { FieldType } from '@awell-health/extensions-core';
|
3
|
+
export declare const fields: {
|
4
|
+
language: {
|
5
|
+
id: string;
|
6
|
+
label: string;
|
7
|
+
description: string;
|
8
|
+
type: FieldType.STRING;
|
9
|
+
required: true;
|
10
|
+
};
|
11
|
+
adminDate: {
|
12
|
+
id: string;
|
13
|
+
label: string;
|
14
|
+
description: string;
|
15
|
+
type: FieldType.DATE;
|
16
|
+
required: true;
|
17
|
+
};
|
18
|
+
thirdPartyIdentifier: {
|
19
|
+
id: string;
|
20
|
+
label: string;
|
21
|
+
description: string;
|
22
|
+
type: FieldType.STRING;
|
23
|
+
required: true;
|
24
|
+
};
|
25
|
+
gender: {
|
26
|
+
id: string;
|
27
|
+
label: string;
|
28
|
+
description: string;
|
29
|
+
type: FieldType.STRING;
|
30
|
+
required: true;
|
31
|
+
};
|
32
|
+
age: {
|
33
|
+
id: string;
|
34
|
+
label: string;
|
35
|
+
description: string;
|
36
|
+
type: FieldType.NUMERIC;
|
37
|
+
required: true;
|
38
|
+
};
|
39
|
+
pa1: {
|
40
|
+
id: string;
|
41
|
+
label: string;
|
42
|
+
description: string;
|
43
|
+
type: FieldType.NUMERIC;
|
44
|
+
required: true;
|
45
|
+
};
|
46
|
+
pa2: {
|
47
|
+
id: string;
|
48
|
+
label: string;
|
49
|
+
description: string;
|
50
|
+
type: FieldType.NUMERIC;
|
51
|
+
required: true;
|
52
|
+
};
|
53
|
+
pa3: {
|
54
|
+
id: string;
|
55
|
+
label: string;
|
56
|
+
description: string;
|
57
|
+
type: FieldType.NUMERIC;
|
58
|
+
required: true;
|
59
|
+
};
|
60
|
+
pa4: {
|
61
|
+
id: string;
|
62
|
+
label: string;
|
63
|
+
description: string;
|
64
|
+
type: FieldType.NUMERIC;
|
65
|
+
required: true;
|
66
|
+
};
|
67
|
+
pa5: {
|
68
|
+
id: string;
|
69
|
+
label: string;
|
70
|
+
description: string;
|
71
|
+
type: FieldType.NUMERIC;
|
72
|
+
required: true;
|
73
|
+
};
|
74
|
+
pa6: {
|
75
|
+
id: string;
|
76
|
+
label: string;
|
77
|
+
description: string;
|
78
|
+
type: FieldType.NUMERIC;
|
79
|
+
required: true;
|
80
|
+
};
|
81
|
+
pa7: {
|
82
|
+
id: string;
|
83
|
+
label: string;
|
84
|
+
description: string;
|
85
|
+
type: FieldType.NUMERIC;
|
86
|
+
required: true;
|
87
|
+
};
|
88
|
+
pa8: {
|
89
|
+
id: string;
|
90
|
+
label: string;
|
91
|
+
description: string;
|
92
|
+
type: FieldType.NUMERIC;
|
93
|
+
required: true;
|
94
|
+
};
|
95
|
+
pa9: {
|
96
|
+
id: string;
|
97
|
+
label: string;
|
98
|
+
description: string;
|
99
|
+
type: FieldType.NUMERIC;
|
100
|
+
required: true;
|
101
|
+
};
|
102
|
+
pa10: {
|
103
|
+
id: string;
|
104
|
+
label: string;
|
105
|
+
description: string;
|
106
|
+
type: FieldType.NUMERIC;
|
107
|
+
required: true;
|
108
|
+
};
|
109
|
+
pa11: {
|
110
|
+
id: string;
|
111
|
+
label: string;
|
112
|
+
description: string;
|
113
|
+
type: FieldType.NUMERIC;
|
114
|
+
required: true;
|
115
|
+
};
|
116
|
+
pa12: {
|
117
|
+
id: string;
|
118
|
+
label: string;
|
119
|
+
description: string;
|
120
|
+
type: FieldType.NUMERIC;
|
121
|
+
required: true;
|
122
|
+
};
|
123
|
+
pa13: {
|
124
|
+
id: string;
|
125
|
+
label: string;
|
126
|
+
description: string;
|
127
|
+
type: FieldType.NUMERIC;
|
128
|
+
required: true;
|
129
|
+
};
|
130
|
+
};
|
131
|
+
export declare const FieldsValidationSchema: z.ZodObject<{
|
132
|
+
language: z.ZodString;
|
133
|
+
adminDate: z.ZodString;
|
134
|
+
thirdPartyIdentifier: z.ZodString;
|
135
|
+
gender: z.ZodString;
|
136
|
+
age: z.ZodNumber;
|
137
|
+
pa1: z.ZodNumber;
|
138
|
+
pa2: z.ZodNumber;
|
139
|
+
pa3: z.ZodNumber;
|
140
|
+
pa4: z.ZodNumber;
|
141
|
+
pa5: z.ZodNumber;
|
142
|
+
pa6: z.ZodNumber;
|
143
|
+
pa7: z.ZodNumber;
|
144
|
+
pa8: z.ZodNumber;
|
145
|
+
pa9: z.ZodNumber;
|
146
|
+
pa10: z.ZodNumber;
|
147
|
+
pa11: z.ZodNumber;
|
148
|
+
pa12: z.ZodNumber;
|
149
|
+
pa13: z.ZodNumber;
|
150
|
+
}, "strip", z.ZodTypeAny, {
|
151
|
+
language: string;
|
152
|
+
age: number;
|
153
|
+
gender: string;
|
154
|
+
adminDate: string;
|
155
|
+
thirdPartyIdentifier: string;
|
156
|
+
pa1: number;
|
157
|
+
pa2: number;
|
158
|
+
pa3: number;
|
159
|
+
pa4: number;
|
160
|
+
pa5: number;
|
161
|
+
pa6: number;
|
162
|
+
pa7: number;
|
163
|
+
pa8: number;
|
164
|
+
pa9: number;
|
165
|
+
pa10: number;
|
166
|
+
pa11: number;
|
167
|
+
pa12: number;
|
168
|
+
pa13: number;
|
169
|
+
}, {
|
170
|
+
language: string;
|
171
|
+
age: number;
|
172
|
+
gender: string;
|
173
|
+
adminDate: string;
|
174
|
+
thirdPartyIdentifier: string;
|
175
|
+
pa1: number;
|
176
|
+
pa2: number;
|
177
|
+
pa3: number;
|
178
|
+
pa4: number;
|
179
|
+
pa5: number;
|
180
|
+
pa6: number;
|
181
|
+
pa7: number;
|
182
|
+
pa8: number;
|
183
|
+
pa9: number;
|
184
|
+
pa10: number;
|
185
|
+
pa11: number;
|
186
|
+
pa12: number;
|
187
|
+
pa13: number;
|
188
|
+
}>;
|
@@ -0,0 +1,160 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.FieldsValidationSchema = exports.fields = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const extensions_core_1 = require("@awell-health/extensions-core");
|
6
|
+
exports.fields = {
|
7
|
+
language: {
|
8
|
+
id: 'language',
|
9
|
+
label: 'language',
|
10
|
+
description: 'The language the survey was completed in.',
|
11
|
+
type: extensions_core_1.FieldType.STRING,
|
12
|
+
required: true,
|
13
|
+
},
|
14
|
+
adminDate: {
|
15
|
+
id: 'adminDate',
|
16
|
+
label: 'Administration Date',
|
17
|
+
description: 'The date the survey was completed in YYYY-MM-DD format.',
|
18
|
+
type: extensions_core_1.FieldType.DATE,
|
19
|
+
required: true,
|
20
|
+
},
|
21
|
+
thirdPartyIdentifier: {
|
22
|
+
id: 'thirdPartyIdentifier',
|
23
|
+
label: 'Third Party Identifier',
|
24
|
+
description: 'The (external) identifier for the user for whom the survey was completed.',
|
25
|
+
type: extensions_core_1.FieldType.STRING,
|
26
|
+
required: true,
|
27
|
+
},
|
28
|
+
gender: {
|
29
|
+
id: 'gender',
|
30
|
+
label: 'Gender',
|
31
|
+
description: 'The gender of the user for whom the survey was completed.',
|
32
|
+
type: extensions_core_1.FieldType.STRING,
|
33
|
+
required: true,
|
34
|
+
},
|
35
|
+
age: {
|
36
|
+
id: 'age',
|
37
|
+
label: 'Age',
|
38
|
+
description: 'The age of the user for whom the survey was completed.',
|
39
|
+
type: extensions_core_1.FieldType.NUMERIC,
|
40
|
+
required: true,
|
41
|
+
},
|
42
|
+
pa1: {
|
43
|
+
id: 'pa1',
|
44
|
+
label: 'PA 1',
|
45
|
+
description: 'The answer to PA 1.',
|
46
|
+
type: extensions_core_1.FieldType.NUMERIC,
|
47
|
+
required: true,
|
48
|
+
},
|
49
|
+
pa2: {
|
50
|
+
id: 'pa2',
|
51
|
+
label: 'PA 2',
|
52
|
+
description: 'The answer to PA 2.',
|
53
|
+
type: extensions_core_1.FieldType.NUMERIC,
|
54
|
+
required: true,
|
55
|
+
},
|
56
|
+
pa3: {
|
57
|
+
id: 'pa3',
|
58
|
+
label: 'PA 3',
|
59
|
+
description: 'The answer to PA 3.',
|
60
|
+
type: extensions_core_1.FieldType.NUMERIC,
|
61
|
+
required: true,
|
62
|
+
},
|
63
|
+
pa4: {
|
64
|
+
id: 'pa4',
|
65
|
+
label: 'PA 4',
|
66
|
+
description: 'The answer to PA 4.',
|
67
|
+
type: extensions_core_1.FieldType.NUMERIC,
|
68
|
+
required: true,
|
69
|
+
},
|
70
|
+
pa5: {
|
71
|
+
id: 'pa5',
|
72
|
+
label: 'PA 5',
|
73
|
+
description: 'The answer to PA 5.',
|
74
|
+
type: extensions_core_1.FieldType.NUMERIC,
|
75
|
+
required: true,
|
76
|
+
},
|
77
|
+
pa6: {
|
78
|
+
id: 'pa6',
|
79
|
+
label: 'PA 6',
|
80
|
+
description: 'The answer to PA 6.',
|
81
|
+
type: extensions_core_1.FieldType.NUMERIC,
|
82
|
+
required: true,
|
83
|
+
},
|
84
|
+
pa7: {
|
85
|
+
id: 'pa7',
|
86
|
+
label: 'PA 7',
|
87
|
+
description: 'The answer to PA 7.',
|
88
|
+
type: extensions_core_1.FieldType.NUMERIC,
|
89
|
+
required: true,
|
90
|
+
},
|
91
|
+
pa8: {
|
92
|
+
id: 'pa8',
|
93
|
+
label: 'PA 8',
|
94
|
+
description: 'The answer to PA 8.',
|
95
|
+
type: extensions_core_1.FieldType.NUMERIC,
|
96
|
+
required: true,
|
97
|
+
},
|
98
|
+
pa9: {
|
99
|
+
id: 'pa9',
|
100
|
+
label: 'PA 9',
|
101
|
+
description: 'The answer to PA 9.',
|
102
|
+
type: extensions_core_1.FieldType.NUMERIC,
|
103
|
+
required: true,
|
104
|
+
},
|
105
|
+
pa10: {
|
106
|
+
id: 'pa10',
|
107
|
+
label: 'PA 10',
|
108
|
+
description: 'The answer to PA 10.',
|
109
|
+
type: extensions_core_1.FieldType.NUMERIC,
|
110
|
+
required: true,
|
111
|
+
},
|
112
|
+
pa11: {
|
113
|
+
id: 'pa11',
|
114
|
+
label: 'PA 11',
|
115
|
+
description: 'The answer to PA 11.',
|
116
|
+
type: extensions_core_1.FieldType.NUMERIC,
|
117
|
+
required: true,
|
118
|
+
},
|
119
|
+
pa12: {
|
120
|
+
id: 'pa12',
|
121
|
+
label: 'PA 12',
|
122
|
+
description: 'The answer to PA 12.',
|
123
|
+
type: extensions_core_1.FieldType.NUMERIC,
|
124
|
+
required: true,
|
125
|
+
},
|
126
|
+
pa13: {
|
127
|
+
id: 'pa13',
|
128
|
+
label: 'PA 13',
|
129
|
+
description: 'The answer to PA 13.',
|
130
|
+
type: extensions_core_1.FieldType.NUMERIC,
|
131
|
+
required: true,
|
132
|
+
},
|
133
|
+
};
|
134
|
+
exports.FieldsValidationSchema = zod_1.z.object({
|
135
|
+
language: zod_1.z.string(),
|
136
|
+
adminDate: zod_1.z
|
137
|
+
.string({
|
138
|
+
errorMap: () => ({
|
139
|
+
message: 'Admin date is required and must be of format YYYY-MM-DD',
|
140
|
+
}),
|
141
|
+
})
|
142
|
+
.datetime(),
|
143
|
+
thirdPartyIdentifier: zod_1.z.string(),
|
144
|
+
gender: zod_1.z.string(),
|
145
|
+
age: zod_1.z.number(),
|
146
|
+
pa1: zod_1.z.number(),
|
147
|
+
pa2: zod_1.z.number(),
|
148
|
+
pa3: zod_1.z.number(),
|
149
|
+
pa4: zod_1.z.number(),
|
150
|
+
pa5: zod_1.z.number(),
|
151
|
+
pa6: zod_1.z.number(),
|
152
|
+
pa7: zod_1.z.number(),
|
153
|
+
pa8: zod_1.z.number(),
|
154
|
+
pa9: zod_1.z.number(),
|
155
|
+
pa10: zod_1.z.number(),
|
156
|
+
pa11: zod_1.z.number(),
|
157
|
+
pa12: zod_1.z.number(),
|
158
|
+
pa13: zod_1.z.number(),
|
159
|
+
});
|
160
|
+
//# sourceMappingURL=fields.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/wellinks/actions/submitPamSurvey/config/fields.ts"],"names":[],"mappings":";;;AAAA,6BAAwC;AACxC,mEAAqE;AAExD,QAAA,MAAM,GAAG;IACpB,QAAQ,EAAE;QACR,EAAE,EAAE,UAAU;QACd,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,2CAA2C;QACxD,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,SAAS,EAAE;QACT,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EAAE,yDAAyD;QACtE,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,IAAI;KACf;IACD,oBAAoB,EAAE;QACpB,EAAE,EAAE,s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ACf;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,SAAS,EAAE,OAAC;SACT,MAAM,CAAC;QACN,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC;YACf,OAAO,EAAE,yDAAyD;SACnE,CAAC;KACH,CAAC;SACD,QAAQ,EAAE;IACb,oBAAoB,EAAE,OAAC,CAAC,MAAM,EAAE;IAChC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;CACiC,CAAC,CAAA"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.SettingsValidationSchema = exports.FieldsValidationSchema = exports.fields = void 0;
|
4
|
+
var fields_1 = require("./fields");
|
5
|
+
Object.defineProperty(exports, "fields", { enumerable: true, get: function () { return fields_1.fields; } });
|
6
|
+
Object.defineProperty(exports, "FieldsValidationSchema", { enumerable: true, get: function () { return fields_1.FieldsValidationSchema; } });
|
7
|
+
var settings_1 = require("./settings");
|
8
|
+
Object.defineProperty(exports, "SettingsValidationSchema", { enumerable: true, get: function () { return settings_1.SettingsValidationSchema; } });
|
9
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/wellinks/actions/submitPamSurvey/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACvC,uCAAqD;AAA5C,oHAAA,wBAAwB,OAAA"}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
export declare const SettingsValidationSchema: z.ZodObject<{
|
3
|
+
platformApiKey: z.ZodOptional<z.ZodString>;
|
4
|
+
platformApiUrl: z.ZodOptional<z.ZodString>;
|
5
|
+
apiUrl: z.ZodOptional<z.ZodString>;
|
6
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
7
|
+
selectEventTypeQuestion: z.ZodOptional<z.ZodString>;
|
8
|
+
startSendingRemindersQuestions: z.ZodOptional<z.ZodString>;
|
9
|
+
memberEventFormId: z.ZodOptional<z.ZodString>;
|
10
|
+
flourishApiKey: z.ZodString;
|
11
|
+
flourishApiUrl: z.ZodString;
|
12
|
+
flourishClientExtId: z.ZodString;
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
14
|
+
flourishApiUrl: string;
|
15
|
+
flourishApiKey: string;
|
16
|
+
flourishClientExtId: string;
|
17
|
+
platformApiKey?: string | undefined;
|
18
|
+
platformApiUrl?: string | undefined;
|
19
|
+
apiUrl?: string | undefined;
|
20
|
+
apiKey?: string | undefined;
|
21
|
+
selectEventTypeQuestion?: string | undefined;
|
22
|
+
startSendingRemindersQuestions?: string | undefined;
|
23
|
+
memberEventFormId?: string | undefined;
|
24
|
+
}, {
|
25
|
+
flourishApiUrl: string;
|
26
|
+
flourishApiKey: string;
|
27
|
+
flourishClientExtId: string;
|
28
|
+
platformApiKey?: string | undefined;
|
29
|
+
platformApiUrl?: string | undefined;
|
30
|
+
apiUrl?: string | undefined;
|
31
|
+
apiKey?: string | undefined;
|
32
|
+
selectEventTypeQuestion?: string | undefined;
|
33
|
+
startSendingRemindersQuestions?: string | undefined;
|
34
|
+
memberEventFormId?: string | undefined;
|
35
|
+
}>;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.SettingsValidationSchema = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
exports.SettingsValidationSchema = zod_1.z.object({
|
6
|
+
platformApiKey: zod_1.z.string().optional(),
|
7
|
+
platformApiUrl: zod_1.z.string().optional(),
|
8
|
+
apiUrl: zod_1.z.string().optional(),
|
9
|
+
apiKey: zod_1.z.string().optional(),
|
10
|
+
selectEventTypeQuestion: zod_1.z.string().optional(),
|
11
|
+
startSendingRemindersQuestions: zod_1.z.string().optional(),
|
12
|
+
memberEventFormId: zod_1.z.string().optional(),
|
13
|
+
flourishApiKey: zod_1.z.string(),
|
14
|
+
flourishApiUrl: zod_1.z.string(),
|
15
|
+
flourishClientExtId: zod_1.z.string(),
|
16
|
+
});
|
17
|
+
//# sourceMappingURL=settings.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../../../../extensions/wellinks/actions/submitPamSurvey/config/settings.ts"],"names":[],"mappings":";;;AAAA,6BAAwC;AAE3B,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,uBAAuB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9C,8BAA8B,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrD,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE;IAC1B,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE;IAC1B,mBAAmB,EAAE,OAAC,CAAC,MAAM,EAAE;CACoB,CAAC,CAAA"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { type Action } from '@awell-health/extensions-core';
|
2
|
+
import { type settings } from '../../config/settings';
|
3
|
+
import { fields } from './config';
|
4
|
+
declare const dataPoints: {
|
5
|
+
pamLevel: {
|
6
|
+
key: string;
|
7
|
+
valueType: "number";
|
8
|
+
};
|
9
|
+
pamScore: {
|
10
|
+
key: string;
|
11
|
+
valueType: "number";
|
12
|
+
};
|
13
|
+
success: {
|
14
|
+
key: string;
|
15
|
+
valueType: "boolean";
|
16
|
+
};
|
17
|
+
};
|
18
|
+
export declare const submitPamSurvey: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
|
19
|
+
export {};
|
@@ -0,0 +1,66 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.submitPamSurvey = void 0;
|
4
|
+
const extensions_core_1 = require("@awell-health/extensions-core");
|
5
|
+
const wellinksFlourishClient_1 = require("../../api/clients/wellinksFlourishClient");
|
6
|
+
const zod_1 = require("zod");
|
7
|
+
const config_1 = require("./config");
|
8
|
+
const dataPoints = {
|
9
|
+
pamLevel: {
|
10
|
+
key: 'pamLevel',
|
11
|
+
valueType: 'number',
|
12
|
+
},
|
13
|
+
pamScore: {
|
14
|
+
key: 'pamScore',
|
15
|
+
valueType: 'number',
|
16
|
+
},
|
17
|
+
success: {
|
18
|
+
key: 'success',
|
19
|
+
valueType: 'boolean',
|
20
|
+
},
|
21
|
+
};
|
22
|
+
exports.submitPamSurvey = {
|
23
|
+
key: 'submitPamSurvey',
|
24
|
+
category: extensions_core_1.Category.WORKFLOW,
|
25
|
+
title: 'Submit PAM Survey',
|
26
|
+
description: 'Submits a PAM survey to Flourish.',
|
27
|
+
fields: config_1.fields,
|
28
|
+
dataPoints,
|
29
|
+
previewable: true,
|
30
|
+
onActivityCreated: async (payload, onComplete, onError) => {
|
31
|
+
const { fields: { language, adminDate, thirdPartyIdentifier, gender, age, pa1, pa2, pa3, pa4, pa5, pa6, pa7, pa8, pa9, pa10, pa11, pa12, pa13, }, settings: { flourishApiKey, flourishApiUrl, flourishClientExtId }, } = (0, extensions_core_1.validate)({
|
32
|
+
schema: zod_1.z.object({
|
33
|
+
fields: config_1.FieldsValidationSchema,
|
34
|
+
settings: config_1.SettingsValidationSchema,
|
35
|
+
}),
|
36
|
+
payload,
|
37
|
+
});
|
38
|
+
const client = new wellinksFlourishClient_1.WellinksFlourishClient(flourishApiUrl, flourishApiKey, flourishClientExtId);
|
39
|
+
try {
|
40
|
+
const result = await client.survey.submit(language, adminDate, thirdPartyIdentifier, gender, age, pa1, pa2, pa3, pa4, pa5, pa6, pa7, pa8, pa9, pa10, pa11, pa12, pa13);
|
41
|
+
await onComplete({
|
42
|
+
data_points: {
|
43
|
+
pamLevel: result.pamLevel.toString(),
|
44
|
+
pamScore: result.pamScore.toString(),
|
45
|
+
success: result.success.toString(),
|
46
|
+
},
|
47
|
+
});
|
48
|
+
}
|
49
|
+
catch (err) {
|
50
|
+
const error = err;
|
51
|
+
await onError({
|
52
|
+
events: [
|
53
|
+
{
|
54
|
+
date: new Date().toISOString(),
|
55
|
+
text: { en: 'Something went wrong while orchestration the action' },
|
56
|
+
error: {
|
57
|
+
category: 'SERVER_ERROR',
|
58
|
+
message: error.message,
|
59
|
+
},
|
60
|
+
},
|
61
|
+
],
|
62
|
+
});
|
63
|
+
}
|
64
|
+
},
|
65
|
+
};
|
66
|
+
//# sourceMappingURL=submitPamSurvey.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"submitPamSurvey.js","sourceRoot":"","sources":["../../../../../extensions/wellinks/actions/submitPamSurvey/submitPamSurvey.ts"],"names":[],"mappings":";;;AAAA,mEAKsC;AAEtC,qFAAiF;AACjF,6BAAuB;AACvB,qCAIiB;AAEjB,MAAM,UAAU,GAAG;IACjB,QAAQ,EAAE;QACR,GAAG,EAAE,UAAU;QACf,SAAS,EAAE,QAAQ;KACpB;IACD,QAAQ,EAAE;QACR,GAAG,EAAE,UAAU;QACf,SAAS,EAAE,QAAQ;KACpB;IACD,OAAO,EAAE;QACP,GAAG,EAAE,SAAS;QACd,SAAS,EAAE,SAAS;KACrB;CAC4C,CAAA;AAElC,QAAA,eAAe,GAIxB;IACF,GAAG,EAAE,iBAAiB;IACtB,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,mCAAmC;IAChD,MAAM,EAAN,eAAM;IACN,UAAU;IACV,WAAW,EAAE,IAAI;IACjB,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAiB,EAAE;QACvE,MAAM,EACJ,MAAM,EAAE,EACN,QAAQ,EACR,SAAS,EACT,oBAAoB,EACpB,MAAM,EACN,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,GACL,EACD,QAAQ,EAAE,EAAE,cAAc,EAAE,cAAc,EAAE,mBAAmB,EAAE,GAClE,GAAG,IAAA,0BAAQ,EAAC;YACX,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;gBACf,MAAM,EAAE,+BAAsB;gBAC9B,QAAQ,EAAE,iCAAwB;aACnC,CAAC;YACF,OAAO;SACR,CAAC,CAAA;QAEF,MAAM,MAAM,GAAG,IAAI,+CAAsB,CACvC,cAAc,EACd,cAAc,EACd,mBAAmB,CACpB,CAAA;QACD,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CACvC,QAAQ,EACR,SAAS,EACT,oBAAoB,EACpB,MAAM,EACN,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,CACL,CAAA;YACD,MAAM,UAAU,CAAC;gBACf,WAAW,EAAE;oBACX,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE;oBACpC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE;oBACpC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE;iBACnC;aACF,CAAC,CAAA;SACH;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,KAAK,GAAG,GAAY,CAAA;YAC1B,MAAM,OAAO,CAAC;gBACZ,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;wBAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,qDAAqD,EAAE;wBACnE,KAAK,EAAE;4BACL,QAAQ,EAAE,cAAc;4BACxB,OAAO,EAAE,KAAK,CAAC,OAAO;yBACvB;qBACF;iBACF;aACF,CAAC,CAAA;SACH;IACH,CAAC;CACF,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,125 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const tests_1 = require("../../../../src/tests");
|
4
|
+
const wellinksFlourishClient_1 = require("../../api/clients/__mocks__/wellinksFlourishClient");
|
5
|
+
const settings_1 = require("../../__mocks__/config/settings");
|
6
|
+
const submitPamSurvey_1 = require("./submitPamSurvey");
|
7
|
+
const zod_1 = require("zod");
|
8
|
+
jest.mock('../../api/clients/wellinksFlourishClient', () => ({
|
9
|
+
WellinksFlourishClient: wellinksFlourishClient_1.WellinksFlourishClient,
|
10
|
+
}));
|
11
|
+
describe('Submit PAM Survey', () => {
|
12
|
+
const onComplete = jest.fn();
|
13
|
+
const onError = jest.fn();
|
14
|
+
beforeEach(() => {
|
15
|
+
jest.clearAllMocks();
|
16
|
+
});
|
17
|
+
test('should call onError with a ZodError when the payload is invalid', async () => {
|
18
|
+
const invalidPayload = (0, tests_1.generateTestPayload)({
|
19
|
+
fields: {
|
20
|
+
language: undefined,
|
21
|
+
adminDate: undefined,
|
22
|
+
thirdPartyIdentifier: undefined,
|
23
|
+
gender: undefined,
|
24
|
+
age: undefined,
|
25
|
+
pa1: undefined,
|
26
|
+
pa2: undefined,
|
27
|
+
pa3: undefined,
|
28
|
+
pa4: undefined,
|
29
|
+
pa5: undefined,
|
30
|
+
pa6: undefined,
|
31
|
+
pa7: undefined,
|
32
|
+
pa8: undefined,
|
33
|
+
pa9: undefined,
|
34
|
+
pa10: undefined,
|
35
|
+
pa11: undefined,
|
36
|
+
pa12: undefined,
|
37
|
+
pa13: undefined,
|
38
|
+
},
|
39
|
+
settings: settings_1.mockSettings,
|
40
|
+
});
|
41
|
+
await expect(submitPamSurvey_1.submitPamSurvey.onActivityCreated(invalidPayload, onComplete, onError)).rejects.toThrowError(zod_1.ZodError);
|
42
|
+
});
|
43
|
+
test('should call onComplete with a complete DataPoint set when the survey is succesfully submitted', async () => {
|
44
|
+
const validPayload = (0, tests_1.generateTestPayload)({
|
45
|
+
fields: {
|
46
|
+
language: 'en',
|
47
|
+
adminDate: '2020-01-01T00:00:00Z',
|
48
|
+
thirdPartyIdentifier: 'identifier',
|
49
|
+
gender: 'male',
|
50
|
+
age: 25,
|
51
|
+
pa1: 1,
|
52
|
+
pa2: 2,
|
53
|
+
pa3: 3,
|
54
|
+
pa4: 4,
|
55
|
+
pa5: 5,
|
56
|
+
pa6: 6,
|
57
|
+
pa7: 7,
|
58
|
+
pa8: 8,
|
59
|
+
pa9: 9,
|
60
|
+
pa10: 10,
|
61
|
+
pa11: 11,
|
62
|
+
pa12: 12,
|
63
|
+
pa13: 13,
|
64
|
+
},
|
65
|
+
settings: settings_1.mockSettings,
|
66
|
+
});
|
67
|
+
wellinksFlourishClient_1.WellinksFlourishClientMockImplementation.survey.submit.mockImplementationOnce(() => {
|
68
|
+
return {
|
69
|
+
success: true,
|
70
|
+
pamLevel: 1,
|
71
|
+
pamScore: 1,
|
72
|
+
};
|
73
|
+
});
|
74
|
+
await submitPamSurvey_1.submitPamSurvey.onActivityCreated(validPayload, onComplete, onError);
|
75
|
+
expect(onError).not.toBeCalled();
|
76
|
+
expect(onComplete).toHaveBeenNthCalledWith(1, {
|
77
|
+
data_points: {
|
78
|
+
pamLevel: '1',
|
79
|
+
pamScore: '1',
|
80
|
+
success: 'true',
|
81
|
+
},
|
82
|
+
});
|
83
|
+
});
|
84
|
+
test('should call onError when wellinksFlourishClient.survey.submit throws an error', async () => {
|
85
|
+
const validPayload = (0, tests_1.generateTestPayload)({
|
86
|
+
fields: {
|
87
|
+
language: 'en',
|
88
|
+
adminDate: '2020-01-01T00:00:00Z',
|
89
|
+
thirdPartyIdentifier: 'identifier',
|
90
|
+
gender: 'male',
|
91
|
+
age: 25,
|
92
|
+
pa1: 1,
|
93
|
+
pa2: 2,
|
94
|
+
pa3: 3,
|
95
|
+
pa4: 4,
|
96
|
+
pa5: 5,
|
97
|
+
pa6: 6,
|
98
|
+
pa7: 7,
|
99
|
+
pa8: 8,
|
100
|
+
pa9: 9,
|
101
|
+
pa10: 10,
|
102
|
+
pa11: 11,
|
103
|
+
pa12: 12,
|
104
|
+
pa13: 13,
|
105
|
+
},
|
106
|
+
settings: settings_1.mockSettings,
|
107
|
+
});
|
108
|
+
wellinksFlourishClient_1.WellinksFlourishClientMockImplementation.survey.submit.mockImplementationOnce(() => {
|
109
|
+
throw new Error('Test Error');
|
110
|
+
});
|
111
|
+
await submitPamSurvey_1.submitPamSurvey.onActivityCreated(validPayload, onComplete, onError);
|
112
|
+
expect(onError).toHaveBeenNthCalledWith(1, {
|
113
|
+
events: expect.arrayContaining([
|
114
|
+
expect.objectContaining({
|
115
|
+
error: {
|
116
|
+
category: 'SERVER_ERROR',
|
117
|
+
message: 'Test Error',
|
118
|
+
},
|
119
|
+
}),
|
120
|
+
]),
|
121
|
+
});
|
122
|
+
expect(onComplete).not.toBeCalled();
|
123
|
+
});
|
124
|
+
});
|
125
|
+
//# sourceMappingURL=submitPamSurvey.test.js.map
|