@awell-health/awell-extensions 1.0.254 → 1.0.256
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/extensions/stripe/actions/embeddedCheckout/embeddedCheckout.js +2 -11
- package/dist/extensions/stripe/actions/embeddedCheckout/embeddedCheckout.js.map +1 -1
- package/dist/extensions/stripe/actions/index.d.ts +15 -15
- package/dist/extensions/stripe/lib/validateAndCreateStripeSdk.js +2 -6
- package/dist/extensions/stripe/lib/validateAndCreateStripeSdk.js.map +1 -1
- package/dist/extensions/stripe/settings.d.ts +14 -14
- package/dist/extensions/stripe/settings.js +8 -12
- package/dist/extensions/stripe/settings.js.map +1 -1
- package/package.json +1 -1
@@ -2,6 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.embeddedCheckout = void 0;
|
4
4
|
const extensions_core_1 = require("@awell-health/extensions-core");
|
5
|
+
const settings_1 = require("../../settings");
|
5
6
|
const config_1 = require("./config");
|
6
7
|
const zod_1 = require("zod");
|
7
8
|
exports.embeddedCheckout = {
|
@@ -22,17 +23,7 @@ exports.embeddedCheckout = {
|
|
22
23
|
(0, extensions_core_1.validate)({
|
23
24
|
schema: zod_1.z.object({
|
24
25
|
fields: config_1.FieldsValidationSchema,
|
25
|
-
settings:
|
26
|
-
hostedPagesEnvironmentVariable: zod_1.z
|
27
|
-
.string()
|
28
|
-
.min(1, 'Missing Hosted Pages environment variable'),
|
29
|
-
liveModePublishableKey: zod_1.z
|
30
|
-
.string()
|
31
|
-
.min(1, 'Missing live mode publishable key'),
|
32
|
-
testModePublishableKey: zod_1.z
|
33
|
-
.string()
|
34
|
-
.min(1, 'Missing test mode publishable key'),
|
35
|
-
}),
|
26
|
+
settings: settings_1.SettingsValidationSchema,
|
36
27
|
}),
|
37
28
|
payload,
|
38
29
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"embeddedCheckout.js","sourceRoot":"","sources":["../../../../../extensions/stripe/actions/embeddedCheckout/embeddedCheckout.ts"],"names":[],"mappings":";;;AAAA,mEAA+E;
|
1
|
+
{"version":3,"file":"embeddedCheckout.js","sourceRoot":"","sources":["../../../../../extensions/stripe/actions/embeddedCheckout/embeddedCheckout.ts"],"names":[],"mappings":";;;AAAA,mEAA+E;AAC/E,6CAAwE;AACxE,qCAAqE;AACrE,6BAAuB;AAEV,QAAA,gBAAgB,GAIzB;IACF,GAAG,EAAE,kBAAkB;IACvB,QAAQ,EAAE,0BAAQ,CAAC,OAAO;IAC1B,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,yCAAyC;IACtD,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK;IAClB,UAAU,EAAV,mBAAU;IACV,OAAO,EAAE;QACP,YAAY,EAAE;YACZ,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,QAAQ;SACf;KACF;IACD,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAiB,EAAE;QACvE,IAAA,0BAAQ,EAAC;YACP,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;gBACf,MAAM,EAAE,+BAAsB;gBAC9B,QAAQ,EAAE,mCAAwB;aACnC,CAAC;YACF,OAAO;SACR,CAAC,CAAA;QAEF,qCAAqC;IACvC,CAAC;CACF,CAAA"}
|
@@ -33,28 +33,28 @@ declare const actions: {
|
|
33
33
|
key: string;
|
34
34
|
label: string;
|
35
35
|
obfuscated: true;
|
36
|
-
required:
|
36
|
+
required: true;
|
37
37
|
description: string;
|
38
38
|
};
|
39
39
|
liveModePublishableKey: {
|
40
40
|
key: string;
|
41
41
|
label: string;
|
42
42
|
obfuscated: false;
|
43
|
-
required:
|
43
|
+
required: true;
|
44
44
|
description: string;
|
45
45
|
};
|
46
46
|
mode: {
|
47
47
|
key: string;
|
48
48
|
label: string;
|
49
|
-
obfuscated:
|
50
|
-
required:
|
49
|
+
obfuscated: false;
|
50
|
+
required: true;
|
51
51
|
description: string;
|
52
52
|
};
|
53
53
|
hostedPagesEnvironmentVariable: {
|
54
54
|
key: string;
|
55
55
|
label: string;
|
56
56
|
obfuscated: false;
|
57
|
-
required:
|
57
|
+
required: true;
|
58
58
|
description: string;
|
59
59
|
};
|
60
60
|
}, "subscriptionId", never>;
|
@@ -92,28 +92,28 @@ declare const actions: {
|
|
92
92
|
key: string;
|
93
93
|
label: string;
|
94
94
|
obfuscated: true;
|
95
|
-
required:
|
95
|
+
required: true;
|
96
96
|
description: string;
|
97
97
|
};
|
98
98
|
liveModePublishableKey: {
|
99
99
|
key: string;
|
100
100
|
label: string;
|
101
101
|
obfuscated: false;
|
102
|
-
required:
|
102
|
+
required: true;
|
103
103
|
description: string;
|
104
104
|
};
|
105
105
|
mode: {
|
106
106
|
key: string;
|
107
107
|
label: string;
|
108
|
-
obfuscated:
|
109
|
-
required:
|
108
|
+
obfuscated: false;
|
109
|
+
required: true;
|
110
110
|
description: string;
|
111
111
|
};
|
112
112
|
hostedPagesEnvironmentVariable: {
|
113
113
|
key: string;
|
114
114
|
label: string;
|
115
115
|
obfuscated: false;
|
116
|
-
required:
|
116
|
+
required: true;
|
117
117
|
description: string;
|
118
118
|
};
|
119
119
|
}, "customerId", never>;
|
@@ -151,28 +151,28 @@ declare const actions: {
|
|
151
151
|
key: string;
|
152
152
|
label: string;
|
153
153
|
obfuscated: true;
|
154
|
-
required:
|
154
|
+
required: true;
|
155
155
|
description: string;
|
156
156
|
};
|
157
157
|
liveModePublishableKey: {
|
158
158
|
key: string;
|
159
159
|
label: string;
|
160
160
|
obfuscated: false;
|
161
|
-
required:
|
161
|
+
required: true;
|
162
162
|
description: string;
|
163
163
|
};
|
164
164
|
mode: {
|
165
165
|
key: string;
|
166
166
|
label: string;
|
167
|
-
obfuscated:
|
168
|
-
required:
|
167
|
+
obfuscated: false;
|
168
|
+
required: true;
|
169
169
|
description: string;
|
170
170
|
};
|
171
171
|
hostedPagesEnvironmentVariable: {
|
172
172
|
key: string;
|
173
173
|
label: string;
|
174
174
|
obfuscated: false;
|
175
|
-
required:
|
175
|
+
required: true;
|
176
176
|
description: string;
|
177
177
|
};
|
178
178
|
}, "success", never>;
|
@@ -8,9 +8,8 @@ const extensions_core_1 = require("@awell-health/extensions-core");
|
|
8
8
|
const zod_1 = __importDefault(require("zod"));
|
9
9
|
const client_1 = __importDefault(require("../api/client"));
|
10
10
|
const settings_1 = require("../settings");
|
11
|
-
const lodash_1 = require("lodash");
|
12
11
|
const validateAndCreateStripeSdk = async ({ fieldsSchema, payload, }) => {
|
13
|
-
const { settings: { testModeSecretKey, liveModeSecretKey,
|
12
|
+
const { settings: { testModeSecretKey, liveModeSecretKey, mode }, fields, settings, } = (0, extensions_core_1.validate)({
|
14
13
|
schema: zod_1.default.object({
|
15
14
|
fields: fieldsSchema,
|
16
15
|
settings: settings_1.SettingsValidationSchema,
|
@@ -20,10 +19,7 @@ const validateAndCreateStripeSdk = async ({ fieldsSchema, payload, }) => {
|
|
20
19
|
payload,
|
21
20
|
});
|
22
21
|
const { patient, pathway, activity } = payload;
|
23
|
-
|
24
|
-
((0, lodash_1.isEmpty)(liveModeSecretKey) || (0, lodash_1.isEmpty)(liveModePublishableKey)))
|
25
|
-
throw new Error('Stripe is in "live" mode but missing (publishable) secret key for live mode.');
|
26
|
-
const stripe = new client_1.default(mode === 'TEST' ? testModeSecretKey : liveModeSecretKey);
|
22
|
+
const stripe = new client_1.default(mode === 'Test' ? testModeSecretKey : (liveModeSecretKey));
|
27
23
|
return { stripe, fields, settings, patient, pathway, activity };
|
28
24
|
};
|
29
25
|
exports.validateAndCreateStripeSdk = validateAndCreateStripeSdk;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"validateAndCreateStripeSdk.js","sourceRoot":"","sources":["../../../../extensions/stripe/lib/validateAndCreateStripeSdk.ts"],"names":[],"mappings":";;;;;;AAAA,mEAKsC;AACtC,8CAAmB;AACnB,2DAAkC;AAClC,0CAAsD;
|
1
|
+
{"version":3,"file":"validateAndCreateStripeSdk.js","sourceRoot":"","sources":["../../../../extensions/stripe/lib/validateAndCreateStripeSdk.ts"],"names":[],"mappings":";;;;;;AAAA,mEAKsC;AACtC,8CAAmB;AACnB,2DAAkC;AAClC,0CAAsD;AAkB/C,MAAM,0BAA0B,GAA+B,KAAK,EAAE,EAC3E,YAAY,EACZ,OAAO,GACR,EAAE,EAAE;IACH,MAAM,EACJ,QAAQ,EAAE,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,IAAI,EAAE,EACxD,MAAM,EACN,QAAQ,GACT,GAAG,IAAA,0BAAQ,EAAC;QACX,MAAM,EAAE,aAAC,CAAC,MAAM,CAAC;YACf,MAAM,EAAE,YAAY;YACpB,QAAQ,EAAE,mCAAwB;YAClC,OAAO,EAAE,aAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,aAAC,CAAC,MAAM,EAAE,EAAE,CAAC;YACrC,QAAQ,EAAE,aAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,aAAC,CAAC,MAAM,EAAE,EAAE,CAAC;SACvC,CAAC;QACF,OAAO;KACR,CAAC,CAAA;IAEF,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAA;IAE9C,MAAM,MAAM,GAAG,IAAI,gBAAM,CACvB,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAE,CAC3D,CAAA;IAED,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAA;AACjE,CAAC,CAAA;AAzBY,QAAA,0BAA0B,8BAyBtC"}
|
@@ -18,50 +18,50 @@ export declare const settings: {
|
|
18
18
|
key: string;
|
19
19
|
label: string;
|
20
20
|
obfuscated: true;
|
21
|
-
required:
|
21
|
+
required: true;
|
22
22
|
description: string;
|
23
23
|
};
|
24
24
|
liveModePublishableKey: {
|
25
25
|
key: string;
|
26
26
|
label: string;
|
27
27
|
obfuscated: false;
|
28
|
-
required:
|
28
|
+
required: true;
|
29
29
|
description: string;
|
30
30
|
};
|
31
31
|
mode: {
|
32
32
|
key: string;
|
33
33
|
label: string;
|
34
|
-
obfuscated:
|
35
|
-
required:
|
34
|
+
obfuscated: false;
|
35
|
+
required: true;
|
36
36
|
description: string;
|
37
37
|
};
|
38
38
|
hostedPagesEnvironmentVariable: {
|
39
39
|
key: string;
|
40
40
|
label: string;
|
41
41
|
obfuscated: false;
|
42
|
-
required:
|
42
|
+
required: true;
|
43
43
|
description: string;
|
44
44
|
};
|
45
45
|
};
|
46
46
|
export declare const SettingsValidationSchema: z.ZodObject<{
|
47
|
-
liveModeSecretKey: z.
|
48
|
-
liveModePublishableKey: z.
|
47
|
+
liveModeSecretKey: z.ZodString;
|
48
|
+
liveModePublishableKey: z.ZodString;
|
49
49
|
testModeSecretKey: z.ZodString;
|
50
50
|
testModePublishableKey: z.ZodString;
|
51
51
|
hostedPagesEnvironmentVariable: z.ZodString;
|
52
|
-
mode: z.
|
52
|
+
mode: z.ZodEnum<["Live", "Test"]>;
|
53
53
|
}, "strip", z.ZodTypeAny, {
|
54
|
-
mode: "
|
54
|
+
mode: "Test" | "Live";
|
55
55
|
testModeSecretKey: string;
|
56
56
|
testModePublishableKey: string;
|
57
|
+
liveModeSecretKey: string;
|
58
|
+
liveModePublishableKey: string;
|
57
59
|
hostedPagesEnvironmentVariable: string;
|
58
|
-
liveModeSecretKey?: string | undefined;
|
59
|
-
liveModePublishableKey?: string | undefined;
|
60
60
|
}, {
|
61
|
+
mode: "Test" | "Live";
|
61
62
|
testModeSecretKey: string;
|
62
63
|
testModePublishableKey: string;
|
64
|
+
liveModeSecretKey: string;
|
65
|
+
liveModePublishableKey: string;
|
63
66
|
hostedPagesEnvironmentVariable: string;
|
64
|
-
mode?: string | undefined;
|
65
|
-
liveModeSecretKey?: string | undefined;
|
66
|
-
liveModePublishableKey?: string | undefined;
|
67
67
|
}>;
|
@@ -21,41 +21,37 @@ exports.settings = {
|
|
21
21
|
key: 'liveModeSecretKey',
|
22
22
|
label: 'Live mode secret key',
|
23
23
|
obfuscated: true,
|
24
|
-
required:
|
24
|
+
required: true,
|
25
25
|
description: 'This key is used to authenticate requests on your server when in live mode',
|
26
26
|
},
|
27
27
|
liveModePublishableKey: {
|
28
28
|
key: 'liveModePublishableKey',
|
29
29
|
label: 'Live mode publishable key',
|
30
30
|
obfuscated: false,
|
31
|
-
required:
|
31
|
+
required: true,
|
32
32
|
description: 'This key is used for testing Embedded checkout in Awell Hosted Pages',
|
33
33
|
},
|
34
34
|
mode: {
|
35
35
|
key: 'mode',
|
36
36
|
label: 'Mode',
|
37
|
-
obfuscated:
|
38
|
-
required:
|
37
|
+
obfuscated: false,
|
38
|
+
required: true,
|
39
39
|
description: '"Test" or "Live", defaults to "Test". Make sure to have a secret key set for live mode when enabling it.',
|
40
40
|
},
|
41
41
|
hostedPagesEnvironmentVariable: {
|
42
42
|
key: 'hostedPagesEnvironmentVariable',
|
43
43
|
label: 'Hosted Pages environment variable',
|
44
44
|
obfuscated: false,
|
45
|
-
required:
|
45
|
+
required: true,
|
46
46
|
description: 'This will be removed once the extension is out of alpha mode. This needs to be configured by an Awell developer.',
|
47
47
|
},
|
48
48
|
};
|
49
49
|
exports.SettingsValidationSchema = zod_1.z.object({
|
50
|
-
liveModeSecretKey: zod_1.z.string().
|
51
|
-
liveModePublishableKey: zod_1.z.string().
|
50
|
+
liveModeSecretKey: zod_1.z.string().min(1),
|
51
|
+
liveModePublishableKey: zod_1.z.string().min(1),
|
52
52
|
testModeSecretKey: zod_1.z.string().min(1),
|
53
53
|
testModePublishableKey: zod_1.z.string().min(1),
|
54
54
|
hostedPagesEnvironmentVariable: zod_1.z.string().min(1),
|
55
|
-
mode: zod_1.z
|
56
|
-
.string()
|
57
|
-
.toUpperCase()
|
58
|
-
.optional()
|
59
|
-
.pipe(zod_1.z.enum(['LIVE', 'TEST'])),
|
55
|
+
mode: zod_1.z.enum(['Live', 'Test']),
|
60
56
|
});
|
61
57
|
//# sourceMappingURL=settings.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../extensions/stripe/settings.ts"],"names":[],"mappings":";;;AACA,6BAAwC;AAE3B,QAAA,QAAQ,GAAG;IACtB,iBAAiB,EAAE;QACjB,GAAG,EAAE,mBAAmB;QACxB,KAAK,EAAE,sBAAsB;QAC7B,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,4EAA4E;KAC/E;IACD,sBAAsB,EAAE;QACtB,GAAG,EAAE,wBAAwB;QAC7B,KAAK,EAAE,2BAA2B;QAClC,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,sEAAsE;KACzE;IACD,iBAAiB,EAAE;QACjB,GAAG,EAAE,mBAAmB;QACxB,KAAK,EAAE,sBAAsB;QAC7B,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../extensions/stripe/settings.ts"],"names":[],"mappings":";;;AACA,6BAAwC;AAE3B,QAAA,QAAQ,GAAG;IACtB,iBAAiB,EAAE;QACjB,GAAG,EAAE,mBAAmB;QACxB,KAAK,EAAE,sBAAsB;QAC7B,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,4EAA4E;KAC/E;IACD,sBAAsB,EAAE;QACtB,GAAG,EAAE,wBAAwB;QAC7B,KAAK,EAAE,2BAA2B;QAClC,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,sEAAsE;KACzE;IACD,iBAAiB,EAAE;QACjB,GAAG,EAAE,mBAAmB;QACxB,KAAK,EAAE,sBAAsB;QAC7B,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,4EAA4E;KAC/E;IACD,sBAAsB,EAAE;QACtB,GAAG,EAAE,wBAAwB;QAC7B,KAAK,EAAE,2BAA2B;QAClC,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,sEAAsE;KACzE;IACD,IAAI,EAAE;QACJ,GAAG,EAAE,MAAM;QACX,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,0GAA0G;KAC7G;IACD,8BAA8B,EAAE;QAC9B,GAAG,EAAE,gCAAgC;QACrC,KAAK,EAAE,mCAAmC;QAC1C,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,kHAAkH;KACrH;CACgC,CAAA;AAEtB,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACpC,sBAAsB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzC,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACpC,sBAAsB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzC,8BAA8B,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACjD,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACqB,CAAC,CAAA"}
|