@awell-health/awell-extensions 1.0.247 → 1.0.249

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. package/dist/extensions/index.js +2 -0
  2. package/dist/extensions/index.js.map +1 -1
  3. package/dist/extensions/markdown.json +4 -0
  4. package/dist/extensions/medplum/actions/submitQuestionnaireResponse/submitQuestionnaireResponse.test.js +17 -12
  5. package/dist/extensions/medplum/actions/submitQuestionnaireResponse/submitQuestionnaireResponse.test.js.map +1 -1
  6. package/dist/extensions/stripe/actions/createCustomer/config/datapoints.d.ts +6 -0
  7. package/dist/extensions/stripe/actions/createCustomer/config/datapoints.js +10 -0
  8. package/dist/extensions/stripe/actions/createCustomer/config/datapoints.js.map +1 -0
  9. package/dist/extensions/stripe/actions/createCustomer/config/fields.d.ts +28 -0
  10. package/dist/extensions/stripe/actions/createCustomer/config/fields.js +29 -0
  11. package/dist/extensions/stripe/actions/createCustomer/config/fields.js.map +1 -0
  12. package/dist/extensions/stripe/actions/createCustomer/config/index.d.ts +2 -0
  13. package/dist/extensions/stripe/actions/createCustomer/config/index.js +9 -0
  14. package/dist/extensions/stripe/actions/createCustomer/config/index.js.map +1 -0
  15. package/dist/extensions/stripe/actions/createCustomer/createCustomer.d.ts +4 -0
  16. package/dist/extensions/stripe/actions/createCustomer/createCustomer.js +34 -0
  17. package/dist/extensions/stripe/actions/createCustomer/createCustomer.js.map +1 -0
  18. package/dist/extensions/stripe/actions/createCustomer/createCustomer.test.d.ts +1 -0
  19. package/dist/extensions/stripe/actions/createCustomer/createCustomer.test.js +32 -0
  20. package/dist/extensions/stripe/actions/createCustomer/createCustomer.test.js.map +1 -0
  21. package/dist/extensions/stripe/actions/createCustomer/index.d.ts +1 -0
  22. package/dist/extensions/stripe/actions/createCustomer/index.js +6 -0
  23. package/dist/extensions/stripe/actions/createCustomer/index.js.map +1 -0
  24. package/dist/extensions/stripe/actions/createSubscription/config/datapoints.d.ts +6 -0
  25. package/dist/extensions/stripe/actions/createSubscription/config/datapoints.js +10 -0
  26. package/dist/extensions/stripe/actions/createSubscription/config/datapoints.js.map +1 -0
  27. package/dist/extensions/stripe/actions/createSubscription/config/fields.d.ts +28 -0
  28. package/dist/extensions/stripe/actions/createSubscription/config/fields.js +29 -0
  29. package/dist/extensions/stripe/actions/createSubscription/config/fields.js.map +1 -0
  30. package/dist/extensions/stripe/actions/createSubscription/config/index.d.ts +2 -0
  31. package/dist/extensions/stripe/actions/createSubscription/config/index.js +9 -0
  32. package/dist/extensions/stripe/actions/createSubscription/config/index.js.map +1 -0
  33. package/dist/extensions/stripe/actions/createSubscription/createSubscription.d.ts +4 -0
  34. package/dist/extensions/stripe/actions/createSubscription/createSubscription.js +43 -0
  35. package/dist/extensions/stripe/actions/createSubscription/createSubscription.js.map +1 -0
  36. package/dist/extensions/stripe/actions/createSubscription/createSubscription.test.d.ts +1 -0
  37. package/dist/extensions/stripe/actions/createSubscription/createSubscription.test.js +32 -0
  38. package/dist/extensions/stripe/actions/createSubscription/createSubscription.test.js.map +1 -0
  39. package/dist/extensions/stripe/actions/createSubscription/index.d.ts +1 -0
  40. package/dist/extensions/stripe/actions/createSubscription/index.js +6 -0
  41. package/dist/extensions/stripe/actions/createSubscription/index.js.map +1 -0
  42. package/dist/extensions/stripe/actions/index.d.ts +79 -0
  43. package/dist/extensions/stripe/actions/index.js +10 -0
  44. package/dist/extensions/stripe/actions/index.js.map +1 -0
  45. package/dist/extensions/stripe/api/client.d.ts +2 -0
  46. package/dist/extensions/stripe/api/client.js +8 -0
  47. package/dist/extensions/stripe/api/client.js.map +1 -0
  48. package/dist/extensions/stripe/index.d.ts +2 -0
  49. package/dist/extensions/stripe/index.js +22 -0
  50. package/dist/extensions/stripe/index.js.map +1 -0
  51. package/dist/extensions/stripe/lib/index.d.ts +1 -0
  52. package/dist/extensions/stripe/lib/index.js +6 -0
  53. package/dist/extensions/stripe/lib/index.js.map +1 -0
  54. package/dist/extensions/stripe/lib/validateAndCreateStripeSdk.d.ts +18 -0
  55. package/dist/extensions/stripe/lib/validateAndCreateStripeSdk.js +29 -0
  56. package/dist/extensions/stripe/lib/validateAndCreateStripeSdk.js.map +1 -0
  57. package/dist/extensions/stripe/settings.d.ts +37 -0
  58. package/dist/extensions/stripe/settings.js +37 -0
  59. package/dist/extensions/stripe/settings.js.map +1 -0
  60. package/package.json +2 -1
@@ -60,6 +60,7 @@ const medplum_1 = require("./medplum");
60
60
  const dockHealth_1 = require("./dockHealth");
61
61
  const json = __importStar(require("./markdown.json"));
62
62
  const external_server_1 = require("./external-server");
63
+ const stripe_1 = require("./stripe");
63
64
  exports.markdown = json;
64
65
  exports.extensions = [
65
66
  awell_1.Awell,
@@ -91,6 +92,7 @@ exports.extensions = [
91
92
  nexuzhealth_1.nexuzhealth,
92
93
  sendbird_1.Sendbird,
93
94
  sendgrid_extension_1.Sendgrid,
95
+ stripe_1.stripe,
94
96
  talkDesk_1.TalkDesk,
95
97
  textline_1.TextLine,
96
98
  transform_1.Transform,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../extensions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAA+B;AAC/B,2CAAuC;AACvC,yCAAqC;AACrC,mDAA+C;AAC/C,6CAAyC;AACzC,+CAA2C;AAC3C,uCAAmC;AACnC,iDAA6C;AAC7C,yCAAqC;AACrC,yCAAqC;AACrC,+CAA0C;AAC1C,2CAAuC;AACvC,uCAAmC;AACnC,iCAAsC;AACtC,+CAA2C;AAC3C,2CAAuC;AACvC,qCAAiC;AACjC,6DAA+C;AAC/C,yCAAqC;AACrC,yCAAqC;AACrC,yCAAqC;AACrC,yCAAqC;AACrC,2CAAuC;AACvC,yCAAqC;AACrC,uCAAmC;AACnC,uCAAmC;AACnC,uCAAmC;AACnC,+CAA2C;AAC3C,+CAA2C;AAC3C,iDAA6C;AAC7C,+BAA2B;AAC3B,yCAAqC;AACrC,uCAAmC;AACnC,6CAAyC;AAEzC,sDAAuC;AACvC,uDAAkD;AAGrC,QAAA,QAAQ,GAAa,IAAI,CAAA;AAEzB,QAAA,UAAU,GAAG;IACxB,aAAK;IACL,2BAAY;IACZ,qBAAS;IACT,mBAAQ;IACR,6BAAa;IACb,uBAAU;IACV,mBAAQ;IACR,yBAAW;IACX,uBAAU;IACV,mBAAQ;IACR,yBAAW;IACX,iBAAO;IACP,2BAAY;IACZ,gCAAc;IACd,mBAAQ;IACR,mBAAQ;IACR,wBAAU;IACV,SAAG;IACH,iBAAO;IACP,mBAAQ;IACR,qBAAS;IACT,iBAAO;IACP,oBAAa;IACb,yBAAW;IACX,iBAAO;IACP,qBAAS;IACT,yBAAW;IACX,mBAAQ;IACR,6BAAQ;IACR,mBAAQ;IACR,mBAAQ;IACR,qBAAS;IACT,eAAM;IACN,iBAAO;IACP,iBAAO;CACR,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../extensions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAA+B;AAC/B,2CAAuC;AACvC,yCAAqC;AACrC,mDAA+C;AAC/C,6CAAyC;AACzC,+CAA2C;AAC3C,uCAAmC;AACnC,iDAA6C;AAC7C,yCAAqC;AACrC,yCAAqC;AACrC,+CAA0C;AAC1C,2CAAuC;AACvC,uCAAmC;AACnC,iCAAsC;AACtC,+CAA2C;AAC3C,2CAAuC;AACvC,qCAAiC;AACjC,6DAA+C;AAC/C,yCAAqC;AACrC,yCAAqC;AACrC,yCAAqC;AACrC,yCAAqC;AACrC,2CAAuC;AACvC,yCAAqC;AACrC,uCAAmC;AACnC,uCAAmC;AACnC,uCAAmC;AACnC,+CAA2C;AAC3C,+CAA2C;AAC3C,iDAA6C;AAC7C,+BAA2B;AAC3B,yCAAqC;AACrC,uCAAmC;AACnC,6CAAyC;AAEzC,sDAAuC;AACvC,uDAAkD;AAClD,qCAAiC;AAGpB,QAAA,QAAQ,GAAa,IAAI,CAAA;AAEzB,QAAA,UAAU,GAAG;IACxB,aAAK;IACL,2BAAY;IACZ,qBAAS;IACT,mBAAQ;IACR,6BAAa;IACb,uBAAU;IACV,mBAAQ;IACR,yBAAW;IACX,uBAAU;IACV,mBAAQ;IACR,yBAAW;IACX,iBAAO;IACP,2BAAY;IACZ,gCAAc;IACd,mBAAQ;IACR,mBAAQ;IACR,wBAAU;IACV,SAAG;IACH,iBAAO;IACP,mBAAQ;IACR,qBAAS;IACT,iBAAO;IACP,oBAAa;IACb,yBAAW;IACX,iBAAO;IACP,qBAAS;IACT,yBAAW;IACX,mBAAQ;IACR,6BAAQ;IACR,eAAM;IACN,mBAAQ;IACR,mBAAQ;IACR,qBAAS;IACT,eAAM;IACN,iBAAO;IACP,iBAAO;CACR,CAAA"}
@@ -115,6 +115,10 @@
115
115
  "readme": "---\ntitle: Sendgrid\ndescription: SendGrid is a cloud-based email delivery platform that provides services for sending and managing email campaigns, transactional emails, and other types of messages.\n---\n# Sendgrid\n\nSendGrid is a cloud-based email delivery platform that provides services for sending and managing email campaigns, transactional emails, and other types of messages.\n\n## Extension settings\n\nIn order to set up this extension, you will need to provide:\n\n1. An API key\n2. A from name\n3. A from email\n\n## Custom Actions\n\n### Send email\n\nAllows for sending a plain email to a recipient.\n\n### Send email with a template\n\nAllows for sending an email based on a template to a recipient. You can also insert variables so they are rendered in your template.\n\n### Add or update contact\n\nAllows adding or updating contacts. The contact to update will be determined only by the email field and any fields omitted from the request will remain as they were. A contact's ID cannot be used to update the contact.\n\nPlease note that custom fields need to have been already created if you wish to set their values for the contacts being upserted. To do this, please use the \"Create Custom Field Definition\" endpoint. They also can be created in **Marketing -> Custom Fields** section in Sendgrid.\n\n### Add and remove emails from suppression lists\n\nSuppression lists ([link on SendGrid's website](https://docs.sendgrid.com/api-reference/suppressions-suppressions/add-suppressions-to-a-suppression-group)) are unsubscribe groups. Use these actions to add an email address to any number of unsubscribe groups. You can apply a suppression add/remove to multiple groups by using comma-separated lists for the groups. Only a single email can be used. **This functionality is different from SendGrid's API, which allows multiple email addresses for a single group**.\n\n### Check an import status\n\nAllows user to check the status of contact import jobs when given a jobID. Statuses are either: `pending`, `completed`, `failed`, or `errored`.",
116
116
  "changelog": "# Sendgrid changelog\n\n## July 7, 2023\n\nAdded \"Add Email to Suppression Lists\" and \"Remove Email from Suppression Lists\" actions.\n\n## July 15, 2023\n\nUpdated \"Add or Update Contact\" acction to create a datapoint of the Job ID.\n\nAdded \"Check Import Status\" action.\n\n## July 27, 2023\n\nAdds \"Finished At\" data point to the importStatus action."
117
117
  },
118
+ "stripe": {
119
+ "readme": "---\ntitle: Stripe Health\ndescription: Stripe powers online and in-person payment processing and financial solutions for businesses of all sizes.\n---\n\n## Stripe\n\nStripe powers online and in-person payment processing and financial solutions for businesses of all sizes.\n\n## Extension settings\n\nFor the extension to function correctly, you must configure the following settings:\n\n- Secret key (test mode)\n- Secret key (live mode)\n- Mode (\"Test\" or \"Live\")",
120
+ "changelog": "# Stripe changelog"
121
+ },
118
122
  "talkDesk": {
119
123
  "readme": "---\ntitle: Talkdesk\ndescription: Talkdesk is a cloud-based customer experience and contact center software company. It provides a platform that enables businesses to set up and manage their customer service and support operations.\n---\n# TalkDesk\n\nTalkdesk is a cloud-based customer experience and contact center software company. It provides a platform that enables businesses to set up and manage their customer service and support operations. Talkdesk offers a range of features and tools to streamline and enhance communication between businesses and their customers.\n\n## Setup\n\nTo set up the extension, you'll need your Talkdesk account name along with a client ID and client secret. Please ensure that the credentials you provide are associated with the necessary permissions, or \"scopes,\" to run the extension:\n\n- flows-interactions:start\n\n## Custom Actions\n\n### Trigger flow\n\nEnables the initiation of a Talkdesk flow directly from an Awell careflow. This feature triggers an interaction using the most recent published version of a specific Studio flow. You'll need to supply the ID of the flow and the data (as a JSON object) that you want to input into the flow.\n\nImportant: Please note that Talkdesk sets a restriction of up to two API requests per second (rps) for each account using their Flows API.\n\n[Click here](https://studio.talkdesk.com/docs/sending-notifications-to-contacts-via-api-request) to learn more about triggering flows via the Talkdesk API and here to read the [API docs](https://docs.talkdesk.com/reference/flows-api-ref).\n",
120
124
  "changelog": "# TalkDesk changelog\n"
@@ -6,15 +6,15 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  const _1 = require(".");
8
8
  const tests_1 = require("../../../../src/tests");
9
- const __mocks__1 = require("../../__mocks__");
10
- jest.mock('@medplum/core', () => {
11
- // eslint-disable-next-line @typescript-eslint/no-var-requires
12
- const { MedplumClient: MedplumMockClient } = require('../../__mocks__');
13
- return {
14
- MedplumClient: MedplumMockClient,
15
- };
16
- });
17
- describe.skip('Medplum - Submit questionnaire response', () => {
9
+ // import { mockSettings } from '../../__mocks__'
10
+ // jest.mock('@medplum/core', () => {
11
+ // // eslint-disable-next-line @typescript-eslint/no-var-requires
12
+ // const { MedplumClient: MedplumMockClient } = require('../../__mocks__')
13
+ // return {
14
+ // MedplumClient: MedplumMockClient,
15
+ // }
16
+ // })
17
+ describe('Medplum - Submit questionnaire response', () => {
18
18
  const onComplete = jest.fn();
19
19
  const onError = jest.fn();
20
20
  beforeEach(() => {
@@ -23,12 +23,17 @@ describe.skip('Medplum - Submit questionnaire response', () => {
23
23
  test('Should submit a questionnaire response', async () => {
24
24
  const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
25
25
  fields: {},
26
- settings: __mocks__1.mockSettings,
26
+ settings: {
27
+ clientId: 'a578f41d-be4d-48e9-801a-d969f80d4c3a',
28
+ clientSecret: 'e6a0356298ff86ba07dd8660b1f17cb395648852f2563649e38f85c0e6df21a3',
29
+ awellApiUrl: 'https://api.development.awellhealth.com/orchestration/m2m/graphql',
30
+ awellApiKey: '59bQf06crzUinBB4T4oATZC9W3Hy0uKF',
31
+ },
27
32
  pathway: {
28
- id: 'LldfGZ7x1rZx',
33
+ id: 'uWjPgEzAdmnS',
29
34
  },
30
35
  activity: {
31
- id: 'vFTGRflHTL1iUVCzHhHts',
36
+ id: '5p9NNIdP2Wj_Srobbqb6V',
32
37
  },
33
38
  });
34
39
  await _1.submitQuestionnaireResponse.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
@@ -1 +1 @@
1
- {"version":3,"file":"submitQuestionnaireResponse.test.js","sourceRoot":"","sources":["../../../../../extensions/medplum/actions/submitQuestionnaireResponse/submitQuestionnaireResponse.test.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAEH,wBAA+C;AAC/C,iDAA2D;AAC3D,8CAA8C;AAE9C,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE;IAC9B,8DAA8D;IAC9D,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;IAEvE,OAAO;QACL,aAAa,EAAE,iBAAiB;KACjC,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,QAAQ,CAAC,IAAI,CAAC,yCAAyC,EAAE,GAAG,EAAE;IAC5D,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,wCAAwC,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE,EAAE;YACV,QAAQ,EAAE,uBAAY;YACtB,OAAO,EAAE;gBACP,EAAE,EAAE,cAAc;aACnB;YACD,QAAQ,EAAE;gBACR,EAAE,EAAE,uBAAuB;aAC5B;SACF,CAAC,CAAA;QAEF,MAAM,8BAA2B,CAAC,iBAAiB,CACjD,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,gBAAgB,EAAE,CAAA;IACvC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"submitQuestionnaireResponse.test.js","sourceRoot":"","sources":["../../../../../extensions/medplum/actions/submitQuestionnaireResponse/submitQuestionnaireResponse.test.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAEH,wBAA+C;AAC/C,iDAA2D;AAC3D,iDAAiD;AAEjD,qCAAqC;AACrC,mEAAmE;AACnE,4EAA4E;AAE5E,aAAa;AACb,wCAAwC;AACxC,MAAM;AACN,KAAK;AAEL,QAAQ,CAAC,yCAAyC,EAAE,GAAG,EAAE;IACvD,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,wCAAwC,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE,EAAE;YACV,QAAQ,EAAE;gBACR,QAAQ,EAAE,sCAAsC;gBAChD,YAAY,EACV,kEAAkE;gBACpE,WAAW,EACT,mEAAmE;gBACrE,WAAW,EAAE,kCAAkC;aAChD;YACD,OAAO,EAAE;gBACP,EAAE,EAAE,cAAc;aACnB;YACD,QAAQ,EAAE;gBACR,EAAE,EAAE,uBAAuB;aAC5B;SACF,CAAC,CAAA;QAEF,MAAM,8BAA2B,CAAC,iBAAiB,CACjD,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,gBAAgB,EAAE,CAAA;IACvC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ export declare const dataPoints: {
2
+ customerId: {
3
+ key: string;
4
+ valueType: "string";
5
+ };
6
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataPoints = void 0;
4
+ exports.dataPoints = {
5
+ customerId: {
6
+ key: 'customerId',
7
+ valueType: 'string',
8
+ },
9
+ };
10
+ //# sourceMappingURL=datapoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datapoints.js","sourceRoot":"","sources":["../../../../../../extensions/stripe/actions/createCustomer/config/datapoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,UAAU,EAAE;QACV,GAAG,EAAE,YAAY;QACjB,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA"}
@@ -0,0 +1,28 @@
1
+ import { FieldType } from '@awell-health/extensions-core';
2
+ import z from 'zod';
3
+ export declare const fields: {
4
+ email: {
5
+ id: string;
6
+ label: string;
7
+ description: string;
8
+ type: FieldType.STRING;
9
+ required: false;
10
+ };
11
+ name: {
12
+ id: string;
13
+ label: string;
14
+ description: string;
15
+ type: FieldType.STRING;
16
+ required: false;
17
+ };
18
+ };
19
+ export declare const FieldsValidationSchema: z.ZodObject<{
20
+ email: z.ZodOptional<z.ZodString>;
21
+ name: z.ZodOptional<z.ZodString>;
22
+ }, "strip", z.ZodTypeAny, {
23
+ name?: string | undefined;
24
+ email?: string | undefined;
25
+ }, {
26
+ name?: string | undefined;
27
+ email?: string | undefined;
28
+ }>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FieldsValidationSchema = exports.fields = void 0;
7
+ const extensions_core_1 = require("@awell-health/extensions-core");
8
+ const zod_1 = __importDefault(require("zod"));
9
+ exports.fields = {
10
+ email: {
11
+ id: 'email',
12
+ label: 'Email',
13
+ description: 'Customer’s email address. It’s displayed alongside the customer in your dashboard and can be useful for searching and tracking.',
14
+ type: extensions_core_1.FieldType.STRING,
15
+ required: false,
16
+ },
17
+ name: {
18
+ id: 'name',
19
+ label: 'Name',
20
+ description: 'The customer’s full name or business name.',
21
+ type: extensions_core_1.FieldType.STRING,
22
+ required: false,
23
+ },
24
+ };
25
+ exports.FieldsValidationSchema = zod_1.default.object({
26
+ email: zod_1.default.string().optional(),
27
+ name: zod_1.default.string().optional(),
28
+ });
29
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/stripe/actions/createCustomer/config/fields.ts"],"names":[],"mappings":";;;;;;AAAA,mEAAqE;AACrE,8CAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,KAAK,EAAE;QACL,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,OAAO;QACd,WAAW,EACT,iIAAiI;QACnI,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;KAChB;IACD,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,MAAM;QACb,WAAW,EAAE,4CAA4C;QACzD,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;KAChB;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7C,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,IAAI,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACsB,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { fields, FieldsValidationSchema } from './fields';
2
+ export { dataPoints } from './datapoints';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataPoints = 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 datapoints_1 = require("./datapoints");
8
+ Object.defineProperty(exports, "dataPoints", { enumerable: true, get: function () { return datapoints_1.dataPoints; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/stripe/actions/createCustomer/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACvC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
@@ -0,0 +1,4 @@
1
+ import { type Action } from '@awell-health/extensions-core';
2
+ import { type settings } from '../../settings';
3
+ import { fields, dataPoints } from './config';
4
+ export declare const createCustomer: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createCustomer = void 0;
4
+ const extensions_core_1 = require("@awell-health/extensions-core");
5
+ const config_1 = require("./config");
6
+ const lib_1 = require("../../lib");
7
+ exports.createCustomer = {
8
+ key: 'createCustomer',
9
+ category: extensions_core_1.Category.BILLING,
10
+ title: 'Create customer',
11
+ description: 'Create a customer in Stripe',
12
+ fields: config_1.fields,
13
+ previewable: false,
14
+ dataPoints: config_1.dataPoints,
15
+ onActivityCreated: async (payload, onComplete, onError) => {
16
+ const { fields: input, stripe, patient, } = await (0, lib_1.validateAndCreateStripeSdk)({
17
+ fieldsSchema: config_1.FieldsValidationSchema,
18
+ payload,
19
+ });
20
+ const res = await stripe.customers.create({
21
+ email: input.email,
22
+ name: input.name,
23
+ metadata: {
24
+ awellPatientId: patient.id,
25
+ },
26
+ });
27
+ await onComplete({
28
+ data_points: {
29
+ customerId: res.id,
30
+ },
31
+ });
32
+ },
33
+ };
34
+ //# sourceMappingURL=createCustomer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createCustomer.js","sourceRoot":"","sources":["../../../../../extensions/stripe/actions/createCustomer/createCustomer.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,mCAAsD;AAEzC,QAAA,cAAc,GAIvB;IACF,GAAG,EAAE,gBAAgB;IACrB,QAAQ,EAAE,0BAAQ,CAAC,OAAO;IAC1B,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,6BAA6B;IAC1C,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK;IAClB,UAAU,EAAV,mBAAU;IACV,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAiB,EAAE;QACvE,MAAM,EACJ,MAAM,EAAE,KAAK,EACb,MAAM,EACN,OAAO,GACR,GAAG,MAAM,IAAA,gCAA0B,EAAC;YACnC,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEF,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC;YACxC,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,QAAQ,EAAE;gBACR,cAAc,EAAE,OAAO,CAAC,EAAE;aAC3B;SACF,CAAC,CAAA;QAEF,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,UAAU,EAAE,GAAG,CAAC,EAAE;aACnB;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _1 = require(".");
4
+ const tests_1 = require("../../../../src/tests");
5
+ const __mocks__1 = require("../../__mocks__");
6
+ jest.mock('../../api/client');
7
+ /**
8
+ * Mock isn't working yet
9
+ */
10
+ describe.skip('Stripe - Create customer', () => {
11
+ const onComplete = jest.fn();
12
+ const onError = jest.fn();
13
+ beforeEach(() => {
14
+ jest.clearAllMocks();
15
+ });
16
+ test('Should create a subscription', async () => {
17
+ const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
18
+ fields: {
19
+ email: 'nick+nickske@awellhealth.com',
20
+ name: 'Nick Hellemans',
21
+ },
22
+ settings: __mocks__1.mockSettings,
23
+ });
24
+ await _1.createCustomer.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
25
+ expect(onComplete).toHaveBeenCalledWith({
26
+ data_points: {
27
+ customerId: 'new-customer-id',
28
+ },
29
+ });
30
+ });
31
+ });
32
+ //# sourceMappingURL=createCustomer.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createCustomer.test.js","sourceRoot":"","sources":["../../../../../extensions/stripe/actions/createCustomer/createCustomer.test.ts"],"names":[],"mappings":";;AAAA,wBAAkC;AAClC,iDAA2D;AAC3D,8CAA8C;AAE9C,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;AAE7B;;GAEG;AACH,QAAQ,CAAC,IAAI,CAAC,0BAA0B,EAAE,GAAG,EAAE;IAC7C,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,8BAA8B,EAAE,KAAK,IAAI,EAAE;QAC9C,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,KAAK,EAAE,8BAA8B;gBACrC,IAAI,EAAE,gBAAgB;aACvB;YACD,QAAQ,EAAE,uBAAY;SACvB,CAAC,CAAA;QAEF,MAAM,iBAAc,CAAC,iBAAiB,CACpC,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC;YACtC,WAAW,EAAE;gBACX,UAAU,EAAE,iBAAiB;aAC9B;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export { createCustomer } from './createCustomer';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createCustomer = void 0;
4
+ var createCustomer_1 = require("./createCustomer");
5
+ Object.defineProperty(exports, "createCustomer", { enumerable: true, get: function () { return createCustomer_1.createCustomer; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/stripe/actions/createCustomer/index.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAAxC,gHAAA,cAAc,OAAA"}
@@ -0,0 +1,6 @@
1
+ export declare const dataPoints: {
2
+ subscriptionId: {
3
+ key: string;
4
+ valueType: "string";
5
+ };
6
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataPoints = void 0;
4
+ exports.dataPoints = {
5
+ subscriptionId: {
6
+ key: 'subscriptionId',
7
+ valueType: 'string',
8
+ },
9
+ };
10
+ //# sourceMappingURL=datapoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datapoints.js","sourceRoot":"","sources":["../../../../../../extensions/stripe/actions/createSubscription/config/datapoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,cAAc,EAAE;QACd,GAAG,EAAE,gBAAgB;QACrB,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA"}
@@ -0,0 +1,28 @@
1
+ import { FieldType } from '@awell-health/extensions-core';
2
+ import z from 'zod';
3
+ export declare const fields: {
4
+ customer: {
5
+ id: string;
6
+ label: string;
7
+ description: string;
8
+ type: FieldType.STRING;
9
+ required: true;
10
+ };
11
+ item: {
12
+ id: string;
13
+ label: string;
14
+ description: string;
15
+ type: FieldType.STRING;
16
+ required: true;
17
+ };
18
+ };
19
+ export declare const FieldsValidationSchema: z.ZodObject<{
20
+ customer: z.ZodString;
21
+ item: z.ZodString;
22
+ }, "strip", z.ZodTypeAny, {
23
+ item: string;
24
+ customer: string;
25
+ }, {
26
+ item: string;
27
+ customer: string;
28
+ }>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FieldsValidationSchema = exports.fields = void 0;
7
+ const extensions_core_1 = require("@awell-health/extensions-core");
8
+ const zod_1 = __importDefault(require("zod"));
9
+ exports.fields = {
10
+ customer: {
11
+ id: 'customer',
12
+ label: 'Customer',
13
+ description: 'The identifier of the customer to subscribe',
14
+ type: extensions_core_1.FieldType.STRING,
15
+ required: true,
16
+ },
17
+ item: {
18
+ id: 'item',
19
+ label: 'Item',
20
+ description: 'The ID of the price object',
21
+ type: extensions_core_1.FieldType.STRING,
22
+ required: true,
23
+ },
24
+ };
25
+ exports.FieldsValidationSchema = zod_1.default.object({
26
+ customer: zod_1.default.string().min(1),
27
+ item: zod_1.default.string().min(1),
28
+ });
29
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/stripe/actions/createSubscription/config/fields.ts"],"names":[],"mappings":";;;;;;AAAA,mEAAqE;AACrE,8CAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,QAAQ,EAAE;QACR,EAAE,EAAE,UAAU;QACd,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,6CAA6C;QAC1D,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,MAAM;QACb,WAAW,EAAE,4BAA4B;QACzC,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7C,QAAQ,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,IAAI,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC0B,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { fields, FieldsValidationSchema } from './fields';
2
+ export { dataPoints } from './datapoints';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataPoints = 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 datapoints_1 = require("./datapoints");
8
+ Object.defineProperty(exports, "dataPoints", { enumerable: true, get: function () { return datapoints_1.dataPoints; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/stripe/actions/createSubscription/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACvC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
@@ -0,0 +1,4 @@
1
+ import { type Action } from '@awell-health/extensions-core';
2
+ import { type settings } from '../../settings';
3
+ import { fields, dataPoints } from './config';
4
+ export declare const createSubscription: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createSubscription = void 0;
4
+ const extensions_core_1 = require("@awell-health/extensions-core");
5
+ const config_1 = require("./config");
6
+ const lib_1 = require("../../lib");
7
+ exports.createSubscription = {
8
+ key: 'createSubscription',
9
+ category: extensions_core_1.Category.BILLING,
10
+ title: 'Create subscription',
11
+ description: 'Create a subscription in Stripe',
12
+ fields: config_1.fields,
13
+ previewable: false,
14
+ dataPoints: config_1.dataPoints,
15
+ onActivityCreated: async (payload, onComplete, onError) => {
16
+ const { fields: input, stripe, patient, pathway, activity, } = await (0, lib_1.validateAndCreateStripeSdk)({
17
+ fieldsSchema: config_1.FieldsValidationSchema,
18
+ payload,
19
+ });
20
+ const res = await stripe.subscriptions.create({
21
+ customer: input.customer,
22
+ items: [
23
+ {
24
+ price: input.item,
25
+ },
26
+ ],
27
+ payment_settings: {
28
+ payment_method_types: ['card'],
29
+ },
30
+ metadata: {
31
+ awellPatientId: patient.id,
32
+ awellCareflowId: pathway.id,
33
+ awellActivityId: activity.id,
34
+ },
35
+ });
36
+ await onComplete({
37
+ data_points: {
38
+ subscriptionId: res.id,
39
+ },
40
+ });
41
+ },
42
+ };
43
+ //# sourceMappingURL=createSubscription.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createSubscription.js","sourceRoot":"","sources":["../../../../../extensions/stripe/actions/createSubscription/createSubscription.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,mCAAsD;AAEzC,QAAA,kBAAkB,GAI3B;IACF,GAAG,EAAE,oBAAoB;IACzB,QAAQ,EAAE,0BAAQ,CAAC,OAAO;IAC1B,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EAAE,iCAAiC;IAC9C,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK;IAClB,UAAU,EAAV,mBAAU;IACV,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAiB,EAAE;QACvE,MAAM,EACJ,MAAM,EAAE,KAAK,EACb,MAAM,EACN,OAAO,EACP,OAAO,EACP,QAAQ,GACT,GAAG,MAAM,IAAA,gCAA0B,EAAC;YACnC,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEF,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC;YAC5C,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,KAAK,EAAE;gBACL;oBACE,KAAK,EAAE,KAAK,CAAC,IAAI;iBAClB;aACF;YACD,gBAAgB,EAAE;gBAChB,oBAAoB,EAAE,CAAC,MAAM,CAAC;aAC/B;YACD,QAAQ,EAAE;gBACR,cAAc,EAAE,OAAO,CAAC,EAAE;gBAC1B,eAAe,EAAE,OAAO,CAAC,EAAE;gBAC3B,eAAe,EAAE,QAAQ,CAAC,EAAE;aAC7B;SACF,CAAC,CAAA;QAEF,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,cAAc,EAAE,GAAG,CAAC,EAAE;aACvB;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _1 = require(".");
4
+ const tests_1 = require("../../../../src/tests");
5
+ const __mocks__1 = require("../../__mocks__");
6
+ // jest.mock('../../api/client')
7
+ /**
8
+ * Mock isn't working yet
9
+ */
10
+ describe.skip('Stripe - Create subscription', () => {
11
+ const onComplete = jest.fn();
12
+ const onError = jest.fn();
13
+ beforeEach(() => {
14
+ jest.clearAllMocks();
15
+ });
16
+ test('Should create a subscription', async () => {
17
+ const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
18
+ fields: {
19
+ customer: 'cus_Q3advyWTRn52YQ',
20
+ item: 'price_1PDTeoJvYdJ7UEuEG3rPlTPq',
21
+ },
22
+ settings: __mocks__1.mockSettings,
23
+ });
24
+ await _1.createSubscription.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
25
+ expect(onComplete).toHaveBeenCalledWith({
26
+ data_points: {
27
+ subscriptionId: 'subscription-id',
28
+ },
29
+ });
30
+ });
31
+ });
32
+ //# sourceMappingURL=createSubscription.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createSubscription.test.js","sourceRoot":"","sources":["../../../../../extensions/stripe/actions/createSubscription/createSubscription.test.ts"],"names":[],"mappings":";;AAAA,wBAAsC;AACtC,iDAA2D;AAC3D,8CAA8C;AAE9C,gCAAgC;AAEhC;;GAEG;AACH,QAAQ,CAAC,IAAI,CAAC,8BAA8B,EAAE,GAAG,EAAE;IACjD,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,8BAA8B,EAAE,KAAK,IAAI,EAAE;QAC9C,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,QAAQ,EAAE,oBAAoB;gBAC9B,IAAI,EAAE,gCAAgC;aACvC;YACD,QAAQ,EAAE,uBAAY;SACvB,CAAC,CAAA;QAEF,MAAM,qBAAkB,CAAC,iBAAiB,CACxC,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC;YACtC,WAAW,EAAE;gBACX,cAAc,EAAE,iBAAiB;aAClC;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export { createSubscription } from './createSubscription';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createSubscription = void 0;
4
+ var createSubscription_1 = require("./createSubscription");
5
+ Object.defineProperty(exports, "createSubscription", { enumerable: true, get: function () { return createSubscription_1.createSubscription; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/stripe/actions/createSubscription/index.ts"],"names":[],"mappings":";;;AAAA,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA"}
@@ -0,0 +1,79 @@
1
+ declare const actions: {
2
+ createSubscription: import("@awell-health/extensions-core").Action<{
3
+ customer: {
4
+ id: string;
5
+ label: string;
6
+ description: string;
7
+ type: import("@awell-health/extensions-core").FieldType.STRING;
8
+ required: true;
9
+ };
10
+ item: {
11
+ id: string;
12
+ label: string;
13
+ description: string;
14
+ type: import("@awell-health/extensions-core").FieldType.STRING;
15
+ required: true;
16
+ };
17
+ }, {
18
+ testModeSecretKey: {
19
+ key: string;
20
+ label: string;
21
+ obfuscated: true;
22
+ required: true;
23
+ description: string;
24
+ };
25
+ liveModeSecretKey: {
26
+ key: string;
27
+ label: string;
28
+ obfuscated: true;
29
+ required: false;
30
+ description: string;
31
+ };
32
+ mode: {
33
+ key: string;
34
+ label: string;
35
+ obfuscated: true;
36
+ required: false;
37
+ description: string;
38
+ };
39
+ }, "subscriptionId", never>;
40
+ createCustomer: import("@awell-health/extensions-core").Action<{
41
+ email: {
42
+ id: string;
43
+ label: string;
44
+ description: string;
45
+ type: import("@awell-health/extensions-core").FieldType.STRING;
46
+ required: false;
47
+ };
48
+ name: {
49
+ id: string;
50
+ label: string;
51
+ description: string;
52
+ type: import("@awell-health/extensions-core").FieldType.STRING;
53
+ required: false;
54
+ };
55
+ }, {
56
+ testModeSecretKey: {
57
+ key: string;
58
+ label: string;
59
+ obfuscated: true;
60
+ required: true;
61
+ description: string;
62
+ };
63
+ liveModeSecretKey: {
64
+ key: string;
65
+ label: string;
66
+ obfuscated: true;
67
+ required: false;
68
+ description: string;
69
+ };
70
+ mode: {
71
+ key: string;
72
+ label: string;
73
+ obfuscated: true;
74
+ required: false;
75
+ description: string;
76
+ };
77
+ }, "customerId", never>;
78
+ };
79
+ export default actions;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const createSubscription_1 = require("./createSubscription");
4
+ const createCustomer_1 = require("./createCustomer");
5
+ const actions = {
6
+ createSubscription: createSubscription_1.createSubscription,
7
+ createCustomer: createCustomer_1.createCustomer,
8
+ };
9
+ exports.default = actions;
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/stripe/actions/index.ts"],"names":[],"mappings":";;AAAA,6DAAyD;AACzD,qDAAiD;AAEjD,MAAM,OAAO,GAAG;IACd,kBAAkB,EAAlB,uCAAkB;IAClB,cAAc,EAAd,+BAAc;CACf,CAAA;AAED,kBAAe,OAAO,CAAA"}
@@ -0,0 +1,2 @@
1
+ import Stripe from 'stripe';
2
+ export default Stripe;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const stripe_1 = __importDefault(require("stripe"));
7
+ exports.default = stripe_1.default;
8
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../extensions/stripe/api/client.ts"],"names":[],"mappings":";;;;;AAAA,oDAA2B;AAE3B,kBAAe,gBAAM,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { type Extension } from '@awell-health/extensions-core';
2
+ export declare const stripe: Extension;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.stripe = void 0;
7
+ const extensions_core_1 = require("@awell-health/extensions-core");
8
+ const actions_1 = __importDefault(require("./actions"));
9
+ const settings_1 = require("./settings");
10
+ exports.stripe = {
11
+ key: 'stripe',
12
+ title: 'Stripe (alpha)',
13
+ description: 'Stripe powers online and in-person payment processing and financial solutions for businesses of all sizes.',
14
+ icon_url: 'https://res.cloudinary.com/da7x4rzl4/image/upload/v1715008389/Awell%20Extensions/images_1.png',
15
+ category: extensions_core_1.Category.BILLING,
16
+ author: {
17
+ authorType: extensions_core_1.AuthorType.AWELL,
18
+ },
19
+ settings: settings_1.settings,
20
+ actions: actions_1.default,
21
+ };
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/stripe/index.ts"],"names":[],"mappings":";;;;;;AAAA,mEAIsC;AACtC,wDAA+B;AAC/B,yCAAqC;AAExB,QAAA,MAAM,GAAc;IAC/B,GAAG,EAAE,QAAQ;IACb,KAAK,EAAE,gBAAgB;IACvB,WAAW,EACT,4GAA4G;IAC9G,QAAQ,EACN,+FAA+F;IACjG,QAAQ,EAAE,0BAAQ,CAAC,OAAO;IAC1B,MAAM,EAAE;QACN,UAAU,EAAE,4BAAU,CAAC,KAAK;KAC7B;IACD,QAAQ,EAAR,mBAAQ;IACR,OAAO,EAAP,iBAAO;CACR,CAAA"}
@@ -0,0 +1 @@
1
+ export { validateAndCreateStripeSdk } from './validateAndCreateStripeSdk';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateAndCreateStripeSdk = void 0;
4
+ var validateAndCreateStripeSdk_1 = require("./validateAndCreateStripeSdk");
5
+ Object.defineProperty(exports, "validateAndCreateStripeSdk", { enumerable: true, get: function () { return validateAndCreateStripeSdk_1.validateAndCreateStripeSdk; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/stripe/lib/index.ts"],"names":[],"mappings":";;;AAAA,2EAAyE;AAAhE,wIAAA,0BAA0B,OAAA"}
@@ -0,0 +1,18 @@
1
+ import { type NewActivityPayload, type Patient, type Pathway } from '@awell-health/extensions-core';
2
+ import z from 'zod';
3
+ import Stripe from '../api/client';
4
+ import { SettingsValidationSchema } from '../settings';
5
+ import { type Activity } from '@awell-health/extensions-core/dist/types/Activity';
6
+ type ValidateAndCreateStripeSdk = <T extends z.ZodTypeAny, P extends NewActivityPayload<any, any>>(args: {
7
+ fieldsSchema: T;
8
+ payload: P;
9
+ }) => Promise<{
10
+ stripe: Stripe;
11
+ fields: z.infer<(typeof args)['fieldsSchema']>;
12
+ settings: z.infer<typeof SettingsValidationSchema>;
13
+ pathway: Pathway;
14
+ patient: Patient;
15
+ activity: Activity;
16
+ }>;
17
+ export declare const validateAndCreateStripeSdk: ValidateAndCreateStripeSdk;
18
+ export {};
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.validateAndCreateStripeSdk = void 0;
7
+ const extensions_core_1 = require("@awell-health/extensions-core");
8
+ const zod_1 = __importDefault(require("zod"));
9
+ const client_1 = __importDefault(require("../api/client"));
10
+ const settings_1 = require("../settings");
11
+ const lodash_1 = require("lodash");
12
+ const validateAndCreateStripeSdk = async ({ fieldsSchema, payload, }) => {
13
+ const { settings: { testModeSecretKey, liveModeSecretKey, mode }, fields, settings, } = (0, extensions_core_1.validate)({
14
+ schema: zod_1.default.object({
15
+ fields: fieldsSchema,
16
+ settings: settings_1.SettingsValidationSchema,
17
+ pathway: zod_1.default.object({ id: zod_1.default.string() }),
18
+ activity: zod_1.default.object({ id: zod_1.default.string() }),
19
+ }),
20
+ payload,
21
+ });
22
+ const { patient, pathway, activity } = payload;
23
+ if (mode === 'LIVE' && (0, lodash_1.isEmpty)(liveModeSecretKey))
24
+ throw new Error('Stripe is in "live" mode but missing secret key for live mode.');
25
+ const stripe = new client_1.default(mode === 'TEST' ? testModeSecretKey : liveModeSecretKey);
26
+ return { stripe, fields, settings, patient, pathway, activity };
27
+ };
28
+ exports.validateAndCreateStripeSdk = validateAndCreateStripeSdk;
29
+ //# sourceMappingURL=validateAndCreateStripeSdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateAndCreateStripeSdk.js","sourceRoot":"","sources":["../../../../extensions/stripe/lib/validateAndCreateStripeSdk.ts"],"names":[],"mappings":";;;;;;AAAA,mEAKsC;AACtC,8CAAmB;AACnB,2DAAkC;AAClC,0CAAsD;AAEtD,mCAAgC;AAiBzB,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,IAAI,IAAI,KAAK,MAAM,IAAI,IAAA,gBAAO,EAAC,iBAAiB,CAAC;QAC/C,MAAM,IAAI,KAAK,CACb,gEAAgE,CACjE,CAAA;IAEH,MAAM,MAAM,GAAG,IAAI,gBAAM,CACvB,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAE,iBAA4B,CACpE,CAAA;IAED,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAA;AACjE,CAAC,CAAA;AA9BY,QAAA,0BAA0B,8BA8BtC"}
@@ -0,0 +1,37 @@
1
+ import { z } from 'zod';
2
+ export declare const settings: {
3
+ testModeSecretKey: {
4
+ key: string;
5
+ label: string;
6
+ obfuscated: true;
7
+ required: true;
8
+ description: string;
9
+ };
10
+ liveModeSecretKey: {
11
+ key: string;
12
+ label: string;
13
+ obfuscated: true;
14
+ required: false;
15
+ description: string;
16
+ };
17
+ mode: {
18
+ key: string;
19
+ label: string;
20
+ obfuscated: true;
21
+ required: false;
22
+ description: string;
23
+ };
24
+ };
25
+ export declare const SettingsValidationSchema: z.ZodObject<{
26
+ liveModeSecretKey: z.ZodOptional<z.ZodString>;
27
+ testModeSecretKey: z.ZodString;
28
+ mode: z.ZodPipeline<z.ZodOptional<z.ZodString>, z.ZodEnum<["LIVE", "TEST"]>>;
29
+ }, "strip", z.ZodTypeAny, {
30
+ mode: "LIVE" | "TEST";
31
+ testModeSecretKey: string;
32
+ liveModeSecretKey?: string | undefined;
33
+ }, {
34
+ testModeSecretKey: string;
35
+ mode?: string | undefined;
36
+ liveModeSecretKey?: string | undefined;
37
+ }>;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SettingsValidationSchema = exports.settings = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.settings = {
6
+ testModeSecretKey: {
7
+ key: 'testModeSecretKey',
8
+ label: 'Stripe secret key (test mode)',
9
+ obfuscated: true,
10
+ required: true,
11
+ description: 'Use this key to authenticate requests on your server when in test mode',
12
+ },
13
+ liveModeSecretKey: {
14
+ key: 'liveModeSecretKey',
15
+ label: 'Stripe secret key (live mode)',
16
+ obfuscated: true,
17
+ required: false,
18
+ description: 'Use this key to authenticate requests on your server when in live mode',
19
+ },
20
+ mode: {
21
+ key: 'mode',
22
+ label: 'Mode',
23
+ obfuscated: true,
24
+ required: false,
25
+ description: '"Test" or "Live", defaults to "Test". Make sure to have a secret key set for live mode when enabling it.',
26
+ },
27
+ };
28
+ exports.SettingsValidationSchema = zod_1.z.object({
29
+ liveModeSecretKey: zod_1.z.string().optional(),
30
+ testModeSecretKey: zod_1.z.string().min(1),
31
+ mode: zod_1.z
32
+ .string()
33
+ .toUpperCase()
34
+ .optional()
35
+ .pipe(zod_1.z.enum(['LIVE', 'TEST'])),
36
+ });
37
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +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,+BAA+B;QACtC,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,wEAAwE;KAC3E;IACD,iBAAiB,EAAE;QACjB,GAAG,EAAE,mBAAmB;QACxB,KAAK,EAAE,+BAA+B;QACtC,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,KAAK;QACf,WAAW,EACT,wEAAwE;KAC3E;IACD,IAAI,EAAE;QACJ,GAAG,EAAE,MAAM;QACX,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,KAAK;QACf,WAAW,EACT,0GAA0G;KAC7G;CACgC,CAAA;AAEtB,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACpC,IAAI,EAAE,OAAC;SACJ,MAAM,EAAE;SACR,WAAW,EAAE;SACb,QAAQ,EAAE;SACV,IAAI,CAAC,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACkB,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awell-health/awell-extensions",
3
- "version": "1.0.247",
3
+ "version": "1.0.249",
4
4
  "packageManager": "yarn@3.4.1",
5
5
  "main": "dist/src/index.js",
6
6
  "repository": {
@@ -94,6 +94,7 @@
94
94
  "node-fetch": "2",
95
95
  "openai": "^3.2.1",
96
96
  "showdown": "^2.1.0",
97
+ "stripe": "^15.5.0",
97
98
  "twilio": "^4.8.0",
98
99
  "xml2js": "^0.6.2",
99
100
  "zod": "^3.23.5",