@awell-health/awell-extensions 1.0.48 → 1.0.50

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.
@@ -0,0 +1,20 @@
1
+ import { FieldType, type Action } from '@awell-health/extensions-core';
2
+ import { type settings } from '../settings';
3
+ declare const fields: {
4
+ id: {
5
+ id: string;
6
+ label: string;
7
+ description: string;
8
+ type: FieldType.STRING;
9
+ required: true;
10
+ };
11
+ groupId: {
12
+ id: string;
13
+ label: string;
14
+ description: string;
15
+ type: FieldType.STRING;
16
+ required: false;
17
+ };
18
+ };
19
+ export declare const assignPatientToGroup: Action<typeof fields, typeof settings>;
20
+ export {};
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assignPatientToGroup = void 0;
4
+ const lodash_1 = require("lodash");
5
+ const extensions_core_1 = require("@awell-health/extensions-core");
6
+ const extensions_core_2 = require("@awell-health/extensions-core");
7
+ const sdk_1 = require("../gql/sdk");
8
+ const graphqlClient_1 = require("../graphqlClient");
9
+ const errors_1 = require("../errors");
10
+ const fields = {
11
+ id: {
12
+ id: 'id',
13
+ label: 'Patient ID',
14
+ description: 'The id of the patient in Healthie.',
15
+ type: extensions_core_1.FieldType.STRING,
16
+ required: true,
17
+ },
18
+ groupId: {
19
+ id: 'groupId',
20
+ label: 'Group ID',
21
+ description: 'The ID of the group the patient will be assigned to. Leave blank to remove the patient from a group.',
22
+ type: extensions_core_1.FieldType.STRING,
23
+ required: false,
24
+ },
25
+ };
26
+ exports.assignPatientToGroup = {
27
+ key: 'assignPatientToGroup',
28
+ category: extensions_core_2.Category.EHR_INTEGRATIONS,
29
+ title: 'Assign patient to group',
30
+ description: 'Assign or remove a patient from a group in Healthie.',
31
+ fields,
32
+ previewable: true,
33
+ onActivityCreated: async (payload, onComplete, onError) => {
34
+ const { fields, settings } = payload;
35
+ const { id, groupId } = fields;
36
+ try {
37
+ if ((0, lodash_1.isNil)(id)) {
38
+ await onError({
39
+ events: [
40
+ {
41
+ date: new Date().toISOString(),
42
+ text: { en: 'Fields are missing' },
43
+ error: {
44
+ category: 'MISSING_FIELDS',
45
+ message: '`id` is missing',
46
+ },
47
+ },
48
+ ],
49
+ });
50
+ return;
51
+ }
52
+ const client = (0, graphqlClient_1.initialiseClient)(settings);
53
+ if (client !== undefined) {
54
+ const sdk = (0, sdk_1.getSdk)(client);
55
+ await sdk.updatePatient({
56
+ input: {
57
+ id,
58
+ // "" group will remove from current group according to docs
59
+ user_group_id: groupId !== null && groupId !== void 0 ? groupId : '',
60
+ },
61
+ });
62
+ await onComplete();
63
+ }
64
+ else {
65
+ await onError({
66
+ events: [
67
+ {
68
+ date: new Date().toISOString(),
69
+ text: { en: 'API client requires an API url and API key' },
70
+ error: {
71
+ category: 'MISSING_SETTINGS',
72
+ message: 'Missing api url or api key',
73
+ },
74
+ },
75
+ ],
76
+ });
77
+ }
78
+ }
79
+ catch (err) {
80
+ if (err instanceof errors_1.HealthieError) {
81
+ const errors = (0, errors_1.mapHealthieToActivityError)(err.errors);
82
+ await onError({
83
+ events: errors,
84
+ });
85
+ }
86
+ else {
87
+ const error = err;
88
+ await onError({
89
+ events: [
90
+ {
91
+ date: new Date().toISOString(),
92
+ text: { en: 'Healthie API reported an error' },
93
+ error: {
94
+ category: 'SERVER_ERROR',
95
+ message: error.message,
96
+ },
97
+ },
98
+ ],
99
+ });
100
+ }
101
+ }
102
+ },
103
+ };
104
+ //# sourceMappingURL=assignPatientToGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assignPatientToGroup.js","sourceRoot":"","sources":["../../../../extensions/healthie/actions/assignPatientToGroup.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAC9B,mEAIsC;AACtC,mEAAwD;AACxD,oCAAmC;AACnC,oDAAmD;AAEnD,sCAAqE;AAErE,MAAM,MAAM,GAAG;IACb,EAAE,EAAE;QACF,EAAE,EAAE,IAAI;QACR,KAAK,EAAE,YA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ACF,4DAA4D;wBAC5D,aAAa,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE;qBAC7B;iBACF,CAAC,CAAA;gBAEF,MAAM,UAAU,EAAE,CAAA;aACnB;iBAAM;gBACL,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;4BAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,4CAA4C,EAAE;4BAC1D,KAAK,EAAE;gCACL,QAAQ,EAAE,kBAAkB;gCAC5B,OAAO,EAAE,4BAA4B;6BACtC;yBACF;qBACF;iBACF,CAAC,CAAA;aACH;SACF;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,GAAG,YAAY,sBAAa,EAAE;gBAChC,MAAM,MAAM,GAAG,IAAA,mCAA0B,EAAC,GAAG,CAAC,MAAM,CAAC,CAAA;gBACrD,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE,MAAM;iBACf,CAAC,CAAA;aACH;iBAAM;gBACL,MAAM,KAAK,GAAG,GAAY,CAAA;gBAC1B,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;4BAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,gCAAgC,EAAE;4BAC9C,KAAK,EAAE;gCACL,QAAQ,EAAE,cAAc;gCACxB,OAAO,EAAE,KAAK,CAAC,OAAO;6BACvB;yBACF;qBACF;iBACF,CAAC,CAAA;aACH;SACF;IACH,CAAC;CACF,CAAA"}
@@ -32,10 +32,7 @@ export declare const actions: {
32
32
  label: string;
33
33
  description: string;
34
34
  type: import("@awell-health/extensions-core").FieldType.STRING;
35
- required: true; /**
36
- * Specs of this API endpoint are unclear so we are not sure what
37
- * functional value it delivers in the current state. Needs to be revisited.
38
- **/
35
+ required: true;
39
36
  };
40
37
  }, {
41
38
  apiUrl: {
@@ -314,10 +311,7 @@ export declare const actions: {
314
311
  };
315
312
  email: {
316
313
  id: string;
317
- label: string; /**
318
- * There is bug in Healthie that prevents linking an address with a patient
319
- * Waiting for fix
320
- **/
314
+ label: string;
321
315
  description: string;
322
316
  type: import("@awell-health/extensions-core").FieldType.STRING;
323
317
  stringType: import("@awell-health/extensions-core").StringType.EMAIL;
@@ -549,9 +543,9 @@ export declare const actions: {
549
543
  };
550
544
  }, string>;
551
545
  /**
552
- * There is bug in Healthie that prevents linking an address with a patient
553
- * Waiting for fix
554
- **/
546
+ * There is bug in Healthie that prevents linking an address with a patient
547
+ * Waiting for fix
548
+ **/
555
549
  closeChatConversation: import("@awell-health/extensions-core").Action<{
556
550
  id: {
557
551
  id: string;
@@ -683,4 +677,35 @@ export declare const actions: {
683
677
  description: string;
684
678
  };
685
679
  }, string>;
680
+ assignPatientToGroup: import("@awell-health/extensions-core").Action<{
681
+ id: {
682
+ id: string;
683
+ label: string;
684
+ description: string;
685
+ type: import("@awell-health/extensions-core").FieldType.STRING;
686
+ required: true;
687
+ };
688
+ groupId: {
689
+ id: string;
690
+ label: string;
691
+ description: string;
692
+ type: import("@awell-health/extensions-core").FieldType.STRING;
693
+ required: false;
694
+ };
695
+ }, {
696
+ apiUrl: {
697
+ key: string;
698
+ label: string;
699
+ obfuscated: false;
700
+ required: true;
701
+ description: string;
702
+ };
703
+ apiKey: {
704
+ key: string;
705
+ label: string;
706
+ obfuscated: true;
707
+ required: true;
708
+ description: string;
709
+ };
710
+ }, string>;
686
711
  };
@@ -19,6 +19,7 @@ const deleteAppointment_1 = require("./deleteAppointment");
19
19
  const cancelAppointment_1 = require("./cancelAppointment");
20
20
  const deleteTask_1 = require("./deleteTask");
21
21
  const completeTask_1 = require("./completeTask");
22
+ const assignPatientToGroup_1 = require("./assignPatientToGroup");
22
23
  exports.actions = {
23
24
  createAppointment: createAppointment_1.createAppointment,
24
25
  createTask: createTask_1.createTask,
@@ -33,9 +34,9 @@ exports.actions = {
33
34
  sendFormCompletionRequest: sendFormCompletionRequest_1.sendFormCompletionRequest,
34
35
  archivePatient: archivePatient_1.archivePatient,
35
36
  /**
36
- * There is bug in Healthie that prevents linking an address with a patient
37
- * Waiting for fix
38
- **/
37
+ * There is bug in Healthie that prevents linking an address with a patient
38
+ * Waiting for fix
39
+ **/
39
40
  // createLocation,
40
41
  closeChatConversation: closeChatConversation_1.closeChatConversation,
41
42
  deleteAppointment: deleteAppointment_1.deleteAppointment,
@@ -47,5 +48,6 @@ exports.actions = {
47
48
  // createJournalEntry,
48
49
  deleteTask: deleteTask_1.deleteTask,
49
50
  completeTask: completeTask_1.completeTask,
51
+ assignPatientToGroup: assignPatientToGroup_1.assignPatientToGroup,
50
52
  };
51
53
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/healthie/actions/index.ts"],"names":[],"mappings":";;;AAAA,2DAAuD;AACvD,6CAAyC;AACzC,qDAAiD;AACjD,6CAAyC;AACzC,uDAAmD;AACnD,mDAA+C;AAC/C,mDAA+C;AAC/C,2DAAuD;AACvD,iEAA6D;AAC7D,6DAAyD;AACzD,2EAAuE;AACvE,qDAAiD;AACjD,oDAAoD;AACpD,mEAA+D;AAC/D,2DAAuD;AACvD,2DAAuD;AACvD,6CAAyC;AACzC,iDAA6C;AAEhC,QAAA,OAAO,GAAG;IACrB,iBAAiB,EAAjB,qCAAiB;IACjB,UAAU,EAAV,uBAAU;IACV,cAAc,EAAd,+BAAc;IACd,UAAU,EAAV,uBAAU;IACV,eAAe,EAAf,iCAAe;IACf,aAAa,EAAb,6BAAa;IACb,aAAa,EAAb,6BAAa;IACb,iBAAiB,EAAjB,qCAAiB;IACjB,oBAAoB,EAApB,2CAAoB;IACpB,kBAAkB,EAAlB,uCAAkB;IAClB,yBAAyB,EAAzB,qDAAyB;IACzB,cAAc,EAAd,+BAAc;IACd;;;OAGG;IACH,kBAAkB;IAClB,qBAAqB,EAArB,6CAAqB;IACrB,iBAAiB,EAAjB,qCAAiB;IACjB,iBAAiB,EAAjB,qCAAiB;IACjB;;;QAGI;IACJ,sBAAsB;IACtB,UAAU,EAAV,uBAAU;IACV,YAAY,EAAZ,2BAAY;CACb,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/healthie/actions/index.ts"],"names":[],"mappings":";;;AAAA,2DAAuD;AACvD,6CAAyC;AACzC,qDAAiD;AACjD,6CAAyC;AACzC,uDAAmD;AACnD,mDAA+C;AAC/C,mDAA+C;AAC/C,2DAAuD;AACvD,iEAA6D;AAC7D,6DAAyD;AACzD,2EAAuE;AACvE,qDAAiD;AACjD,oDAAoD;AACpD,mEAA+D;AAC/D,2DAAuD;AACvD,2DAAuD;AACvD,6CAAyC;AACzC,iDAA6C;AAC7C,iEAA6D;AAEhD,QAAA,OAAO,GAAG;IACrB,iBAAiB,EAAjB,qCAAiB;IACjB,UAAU,EAAV,uBAAU;IACV,cAAc,EAAd,+BAAc;IACd,UAAU,EAAV,uBAAU;IACV,eAAe,EAAf,iCAAe;IACf,aAAa,EAAb,6BAAa;IACb,aAAa,EAAb,6BAAa;IACb,iBAAiB,EAAjB,qCAAiB;IACjB,oBAAoB,EAApB,2CAAoB;IACpB,kBAAkB,EAAlB,uCAAkB;IAClB,yBAAyB,EAAzB,qDAAyB;IACzB,cAAc,EAAd,+BAAc;IACd;;;QAGI;IACJ,kBAAkB;IAClB,qBAAqB,EAArB,6CAAqB;IACrB,iBAAiB,EAAjB,qCAAiB;IACjB,iBAAiB,EAAjB,qCAAiB;IACjB;;;QAGI;IACJ,sBAAsB;IACtB,UAAU,EAAV,uBAAU;IACV,YAAY,EAAZ,2BAAY;IACZ,oBAAoB,EAApB,2CAAoB;CACrB,CAAA"}
@@ -65,7 +65,7 @@
65
65
  },
66
66
  "sendgrid-extension": {
67
67
  "readme": "# 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`.",
68
- "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"
68
+ "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."
69
69
  },
70
70
  "twilio": {
71
71
  "readme": "# Twilio\n\nTwilio is a customer engagement platform used by hundreds of thousands of businesses and more than ten million developers worldwide to build unique, personalized experiences for their customers.\n\nThey are known for democratizing channels like voice, text, chat, video, and email through APIs, making it easy for every organization to build meaningful interactions with customers on the channels they prefer.\n\n## Extension settings\n\nIn order to set up this extension, you will need:\n\n1. A Twilio API key or auth token which can be found in the Twilio console.\n2. Your account SID which can be found in the Twilio console.\n3. A phone number to send the message from. This must be a Twilio phone number that you own.\n\n## Custom Actions\n\n### Send SMS\n\nSend an SMS with Twilio to a recipient of your liking.\n",
@@ -14,6 +14,19 @@ export interface Contact {
14
14
  state_province_region?: string;
15
15
  custom_fields?: object;
16
16
  }
17
+ export declare enum ImportStatus {
18
+ PENDING = "pending",
19
+ COMPLETED = "completed",
20
+ ERRORED = "errored",
21
+ FAILED = "failed"
22
+ }
23
+ export interface ImportStatusResponse {
24
+ id: string;
25
+ status: ImportStatus;
26
+ finished_at?: string;
27
+ job_type: string;
28
+ started_at: string;
29
+ }
17
30
  export interface MailApi {
18
31
  send: MailService['send'];
19
32
  }
@@ -25,9 +38,7 @@ export interface MarketingApi {
25
38
  }) => RequestReturnType<{
26
39
  job_id: string;
27
40
  }>;
28
- importStatus: (jobId: string) => RequestReturnType<{
29
- status: string;
30
- }>;
41
+ importStatus: (jobId: string) => RequestReturnType<ImportStatusResponse>;
31
42
  };
32
43
  }
33
44
  export interface GroupsApi {
@@ -1,3 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ImportStatus = void 0;
4
+ var ImportStatus;
5
+ (function (ImportStatus) {
6
+ ImportStatus["PENDING"] = "pending";
7
+ ImportStatus["COMPLETED"] = "completed";
8
+ ImportStatus["ERRORED"] = "errored";
9
+ ImportStatus["FAILED"] = "failed";
10
+ })(ImportStatus = exports.ImportStatus || (exports.ImportStatus = {}));
3
11
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../extensions/sendgrid-extension/client/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../extensions/sendgrid-extension/client/types.ts"],"names":[],"mappings":";;;AAmBA,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,uCAAuB,CAAA;IACvB,mCAAmB,CAAA;IACnB,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB"}
@@ -9,11 +9,21 @@ export declare const fields: {
9
9
  stringType: StringType.TEXT;
10
10
  required: true;
11
11
  };
12
+ wait_for_finished: {
13
+ id: string;
14
+ label: string;
15
+ description: string;
16
+ type: FieldType.BOOLEAN;
17
+ required: false;
18
+ };
12
19
  };
13
20
  export declare const FieldsValidationSchema: z.ZodObject<{
14
21
  jobId: z.ZodString;
22
+ wait_for_finished: z.ZodOptional<z.ZodBoolean>;
15
23
  }, "strip", z.ZodTypeAny, {
16
24
  jobId: string;
25
+ wait_for_finished?: boolean | undefined;
17
26
  }, {
18
27
  jobId: string;
28
+ wait_for_finished?: boolean | undefined;
19
29
  }>;
@@ -10,10 +10,18 @@ exports.fields = {
10
10
  description: 'The ID of the Sendgrid Job (usually obtained from the Add or Update Contact action)',
11
11
  type: extensions_core_1.FieldType.STRING,
12
12
  stringType: extensions_core_1.StringType.TEXT,
13
- required: true
14
- }
13
+ required: true,
14
+ },
15
+ wait_for_finished: {
16
+ id: 'wait_for_finished',
17
+ label: 'Wait for finished',
18
+ description: 'If true, the action will wait for the import job to finish before completing.',
19
+ type: extensions_core_1.FieldType.BOOLEAN,
20
+ required: false,
21
+ },
15
22
  };
16
23
  exports.FieldsValidationSchema = zod_1.z.object({
17
- jobId: zod_1.z.string()
24
+ jobId: zod_1.z.string(),
25
+ wait_for_finished: zod_1.z.boolean().optional(),
18
26
  });
19
27
  //# sourceMappingURL=fields.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/sendgrid-extension/v1/actions/importStatus/config/fields.ts"],"names":[],"mappings":";;;AAAA,6BAAwC;AAExC,mEAIsC;AAEzB,QAAA,MAAM,GAAG;IACpB,KAAK,EAAE;QACL,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,QAAQ;QACf,WAAW,EAAE,qFAAqF;QAClG,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,UAAU,EAAE,4BAAU,CAAC,IAAI;QAC3B,QAAQ,EAAE,IAAI;KACf;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;CACgC,CAAC,CAAA"}
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/sendgrid-extension/v1/actions/importStatus/config/fields.ts"],"names":[],"mappings":";;;AAAA,6BAAwC;AAExC,mEAIsC;AAEzB,QAAA,MAAM,GAAG;IACpB,KAAK,EAAE;QACL,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,QAAQ;QACf,WAAW,EACT,qFAAqF;QACvF,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,UAAU,EAAE,4BAAU,CAAC,IAAI;QAC3B,QAAQ,EAAE,IAAI;KACf;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,mBAAmB;QACvB,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EACT,+EAA+E;QACjF,IAAI,EAAE,2BAAS,CAAC,OAAO;QACvB,QAAQ,EAAE,KAAK;KAChB;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,iBAAiB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACQ,CAAC,CAAA"}
@@ -6,6 +6,22 @@ declare const dataPoints: {
6
6
  key: string;
7
7
  valueType: "string";
8
8
  };
9
+ finishedAt: {
10
+ key: string;
11
+ valueType: "date";
12
+ };
13
+ startedAt: {
14
+ key: string;
15
+ valueType: "date";
16
+ };
17
+ jobType: {
18
+ key: string;
19
+ valueType: "string";
20
+ };
21
+ id: {
22
+ key: string;
23
+ valueType: "string";
24
+ };
9
25
  };
10
26
  export declare const importStatus: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
11
27
  export {};
@@ -9,11 +9,30 @@ const zod_validation_error_1 = require("zod-validation-error");
9
9
  const zod_1 = require("zod");
10
10
  const classes_1 = require("@sendgrid/helpers/classes");
11
11
  const client_1 = require("../../../client");
12
+ const types_1 = require("../../../client/types");
13
+ const lodash_1 = require("lodash");
14
+ // import { isResponseError } from '../../../client/types'
12
15
  const dataPoints = {
13
16
  importStatus: {
14
17
  key: 'importStatus',
15
18
  valueType: 'string',
16
19
  },
20
+ finishedAt: {
21
+ key: 'finishedAt',
22
+ valueType: 'date',
23
+ },
24
+ startedAt: {
25
+ key: 'startedAt',
26
+ valueType: 'date',
27
+ },
28
+ jobType: {
29
+ key: 'jobType',
30
+ valueType: 'string',
31
+ },
32
+ id: {
33
+ key: 'id',
34
+ valueType: 'string',
35
+ },
17
36
  };
18
37
  exports.importStatus = {
19
38
  key: 'importStatus',
@@ -25,7 +44,7 @@ exports.importStatus = {
25
44
  previewable: true,
26
45
  onActivityCreated: async (payload, onComplete, onError) => {
27
46
  try {
28
- const { fields: { jobId }, settings: { apiKey }, } = (0, extensions_core_1.validate)({
47
+ const { fields: { jobId, wait_for_finished }, settings: { apiKey }, } = (0, extensions_core_1.validate)({
29
48
  schema: zod_1.z.object({
30
49
  fields: fields_1.FieldsValidationSchema,
31
50
  settings: settings_1.SettingsValidationSchema,
@@ -33,10 +52,29 @@ exports.importStatus = {
33
52
  payload,
34
53
  });
35
54
  const sendgridClient = new client_1.SendgridClient({ apiKey });
36
- const sgImportStatus = await sendgridClient.marketing.contacts.importStatus(jobId);
55
+ let resp;
56
+ if (!(0, lodash_1.isNil)(wait_for_finished)) {
57
+ resp = (await sendgridClient.marketing.contacts.importStatus(jobId))[0]
58
+ .body;
59
+ for (let i = 0; i < 9; i++) {
60
+ if ([types_1.ImportStatus.COMPLETED, types_1.ImportStatus.FAILED].includes(resp.status)) {
61
+ break;
62
+ }
63
+ await new Promise((resolve) => setTimeout(resolve, (1000 * 2) ^ i)); // exponential backoff
64
+ resp = (await sendgridClient.marketing.contacts.importStatus(jobId))[0].body;
65
+ }
66
+ }
67
+ else {
68
+ resp = (await sendgridClient.marketing.contacts.importStatus(jobId))[0]
69
+ .body;
70
+ }
37
71
  await onComplete({
38
72
  data_points: {
39
- importStatus: sgImportStatus[0].body.status,
73
+ importStatus: resp.status,
74
+ finishedAt: resp.finished_at,
75
+ startedAt: resp.started_at,
76
+ jobType: resp.job_type,
77
+ id: resp.id,
40
78
  },
41
79
  });
42
80
  }
@@ -1 +1 @@
1
- {"version":3,"file":"importStatus.js","sourceRoot":"","sources":["../../../../../../extensions/sendgrid-extension/v1/actions/importStatus/importStatus.ts"],"names":[],"mappings":";;;AAIA,qCAAiC;AACjC,mEAAkE;AAClE,gDAA2E;AAC3E,4CAAwD;AACxD,+DAAmD;AACnD,6BAAiC;AACjC,uDAAyD;AACzD,4CAGwB;AAExB,MAAM,UAAU,GAAG;IACjB,YAAY,EAAE;QACZ,GAAG,EAAE,cAAc;QACnB,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA;AAElC,QAAA,YAAY,GAIrB;IACF,GAAG,EAAE,cAAc;IACnB,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,iCAAiC;IAC9C,QAAQ,EAAE,0BAAQ,CAAC,aAAa;IAChC,MAAM,EAAN,eAAM;IACN,UAAU;IACV,WAAW,EAAE,IAAI;IACjB,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;QACxD,IAAI;YACF,MAAM,EACJ,MAAM,EAAE,EAAE,KAAK,EAAE,EACjB,QAAQ,EAAE,EAAE,MAAM,EAAE,GACrB,GAAG,IAAA,0BAAQ,EAAC;gBACX,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;oBACf,MAAM,EAAE,+BAAsB;oBAC9B,QAAQ,EAAE,mCAAwB;iBACnC,CAAC;g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BACvB;qBACF;iBACF;aACF,CAAC,CAAA;SACH;IACH,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"importStatus.js","sourceRoot":"","sources":["../../../../../../extensions/sendgrid-extension/v1/actions/importStatus/importStatus.ts"],"names":[],"mappings":";;;AAIA,qCAAiC;AACjC,mEAAkE;AAClE,gDAA2E;AAC3E,4CAAwD;AACxD,+DAAmD;AACnD,6BAAiC;AACjC,uDAAyD;AACzD,4CAGwB;AACxB,iDAA+E;AAC/E,mCAA8B;AAC9B,0DAA0D;AAE1D,MAAM,UAAU,GAAG;IACjB,YAAY,EAAE;QACZ,GAAG,EAAE,cAAc;QACnB,SAAS,EAAE,QAAQ;KACpB;IACD,UAAU,EAAE;QACV,GAAG,EAAE,YAAY;QACjB,SAAS,EAAE,MAAM;KAClB;IACD,SAAS,EAAE;QACT,GAAG,EAAE,WAAW;QAChB,SAAS,EAAE,MAAM;KAClB;IACD,OAAO,EAAE;QACP,GAAG,EAAE,SAAS;QACd,SAAS,EAAE,QAAQ;KACpB;IACD,EAAE,EAAE;QACF,GAAG,EAAE,IAAI;QACT,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA;AAElC,QAAA,YAAY,GAIrB;IACF,GAAG,EAAE,cAAc;IACnB,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,iCAAiC;IAC9C,QAAQ,EAAE,0BAAQ,CAAC,aAAa;IAChC,MAAM,EAAN,eAAM;IACN,UAAU;IACV,WAAW,EAAE,IAAI;IACjB,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;QACxD,IAAI;YACF,MAAM,EACJ,MAAM,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,EACpC,QAAQ,EAAE,EAAE,MAAM,EAAE,GACrB,GAAG,IAAA,0BAAQ,EAAC;gBACX,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;oBACf,MAAM,EAAE,+BAAsB;oBAC9B,QAAQ,EAAE,mCA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,CAAC,EAAE;iBACZ;aACF,CAAC,CAAA;SACH;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,GAAG,YAAY,cAAQ,EAAE;gBAC3B,MAAM,KAAK,GAAG,IAAA,mCAAY,EAAC,GAAG,CAAC,CAAA;gBAC/B,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;4BAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,IAAI,EAAE;4BACxB,KAAK,EAAE;gCACL,QAAQ,EAAE,aAAa;gCACvB,OAAO,EAAE,GAAG,KAAK,CAAC,OAAO,EAAE;6BAC5B;yBACF;qBACF;iBACF,CAAC,CAAA;gBACF,OAAM;aACP;iBAAM,IAAI,GAAG,YAAY,uBAAa,EAAE;gBACvC,MAAM,MAAM,GAAG,IAAA,0CAAiC,EAAC,GAAG,CAAC,CAAA;gBACrD,MAAM,OAAO,CAAC;oBACZ,MAAM;iBACP,CAAC,CAAA;gBACF,OAAM;aACP;YAED,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"}
@@ -8,14 +8,28 @@ describe('Import Status', () => {
8
8
  statusCode: 200,
9
9
  headers: {},
10
10
  body: {
11
- status: "done"
12
- }
11
+ status: 'completed',
12
+ finished_at: '10-10-2020',
13
+ started_at: '10-10-2020',
14
+ job_type: 'jobType',
15
+ id: 'id',
16
+ },
17
+ };
18
+ const pendingResponse = {
19
+ statusCode: 200,
20
+ headers: {},
21
+ body: {
22
+ status: 'pending',
23
+ started_at: '10-10-2020',
24
+ job_type: 'jobType',
25
+ id: 'id',
26
+ },
13
27
  };
14
28
  const onComplete = jest.fn();
15
29
  const onError = jest.fn();
16
30
  const basePayload = (0, client_1.mockActionPayload)({
17
31
  fields: {
18
- jobId: 'jobId'
32
+ jobId: 'jobId',
19
33
  },
20
34
  });
21
35
  beforeEach(() => {
@@ -23,19 +37,55 @@ describe('Import Status', () => {
23
37
  });
24
38
  test('Should call onComplete callback when Sendgrid returns a 200 status response', async () => {
25
39
  client_1.SendgridClientMockImplementation.marketing.contacts.importStatus.mockImplementationOnce(() => {
26
- return [successResponse, "status"];
40
+ return [successResponse, 'status'];
27
41
  });
28
42
  await importStatus_1.importStatus.onActivityCreated(basePayload, onComplete, onError);
29
43
  expect(client_1.SendgridClientMockImplementation.marketing.contacts.importStatus).toHaveBeenCalledWith('jobId');
30
44
  expect(onComplete).toHaveBeenNthCalledWith(1, {
31
45
  data_points: {
32
- importStatus: 'done'
33
- }
46
+ importStatus: 'completed',
47
+ finishedAt: '10-10-2020',
48
+ startedAt: '10-10-2020',
49
+ jobType: 'jobType',
50
+ id: 'id',
51
+ },
52
+ });
53
+ expect(onError).not.toBeCalled();
54
+ });
55
+ test('Should use exponential backoff', async () => {
56
+ client_1.SendgridClientMockImplementation.marketing.contacts.importStatus
57
+ .mockImplementationOnce(() => {
58
+ return [pendingResponse, 'status'];
59
+ })
60
+ .mockImplementationOnce(() => {
61
+ return [pendingResponse, 'status'];
62
+ })
63
+ .mockImplementationOnce(() => {
64
+ return [successResponse, 'status'];
65
+ });
66
+ await importStatus_1.importStatus.onActivityCreated({
67
+ ...basePayload,
68
+ fields: {
69
+ jobId: 'jobId',
70
+ wait_for_finished: true,
71
+ },
72
+ }, onComplete, onError);
73
+ expect(client_1.SendgridClientMockImplementation.marketing.contacts.importStatus).toHaveBeenCalledTimes(3);
74
+ expect(onComplete).toHaveBeenNthCalledWith(1, {
75
+ data_points: {
76
+ importStatus: 'completed',
77
+ finishedAt: '10-10-2020',
78
+ startedAt: '10-10-2020',
79
+ jobType: 'jobType',
80
+ id: 'id',
81
+ },
34
82
  });
35
83
  expect(onError).not.toBeCalled();
36
84
  });
37
85
  test('Should call onError callback when Sendgrid Client throws an error', async () => {
38
- client_1.SendgridClientMockImplementation.marketing.contacts.importStatus.mockImplementationOnce(() => { throw new Error('An error occurred'); });
86
+ client_1.SendgridClientMockImplementation.marketing.contacts.importStatus.mockImplementationOnce(() => {
87
+ throw new Error('An error occurred');
88
+ });
39
89
  await importStatus_1.importStatus.onActivityCreated(basePayload, onComplete, onError);
40
90
  expect(onComplete).not.toBeCalled();
41
91
  expect(onError).toHaveBeenNthCalledWith(1, {
@@ -43,10 +93,10 @@ describe('Import Status', () => {
43
93
  expect.objectContaining({
44
94
  error: {
45
95
  category: 'SERVER_ERROR',
46
- message: 'An error occurred'
47
- }
48
- })
49
- ])
96
+ message: 'An error occurred',
97
+ },
98
+ }),
99
+ ]),
50
100
  });
51
101
  });
52
102
  });
@@ -1 +1 @@
1
- {"version":3,"file":"importStatus.test.js","sourceRoot":"","sources":["../../../../../../extensions/sendgrid-extension/v1/actions/importStatus/importStatus.test.ts"],"names":[],"mappings":";;AAAA,sDAIkC;AAClC,iDAA6C;AAG7C,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,cAAc,EAAd,uBAAc,EAAE,CAAC,CAAC,CAAA;AAExD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,MAAM,eAAe,GAAa;QAChC,UAAU,EAAE,GAAG;QACf,OAAO,EAAE,EAAE;QACX,IAAI,EAAE;YACJ,MAAM,EAAE,MAAM;SACf;KACF,CAAA;IACD,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IACzB,MAAM,WAAW,GAAG,IAAA,0BAAiB,EA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AAC;gBAC7B,MAAM,CAAC,gBAAgB,CAAC;oBACpB,KAAK,EAAE;wBACH,QAAQ,EAAE,cAAc;wBACxB,OAAO,EAAE,mBAAmB;qBAC/B;iBACJ,CAAC;aACH,CAAC;SACH,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"importStatus.test.js","sourceRoot":"","sources":["../../../../../../extensions/sendgrid-extension/v1/actions/importStatus/importStatus.test.ts"],"names":[],"mappings":";;AAAA,sDAIkC;AAClC,iDAA6C;AAG7C,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,cAAc,EAAd,uBAAc,EAAE,CAAC,CAAC,CAAA;AAExD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,MAAM,eAAe,GAAa;QAChC,UAAU,EAAE,GAAG;QACf,OAAO,EAAE,EAAE;QACX,IAAI,EAAE;YACJ,MAAM,EAAE,WAAW;YACnB,WAAW,EAAE,YAAY;YACzB,UAAU,EAAE,YAAY;YACxB,QAAQ,EAAE,SAAS;YACnB,EAAE,EAAE,IAAI;SACT;KACF,CAAA;IACD,MAAM,eAAe,GAAa;QAChC,UAAU,EAAE,GAAG;QACf,OAAO,EAAE,EAAE;QACX,IAAI,EAAE;YACJ,MAAM,EAAE,SAAS;YACjB,UAAU,EAAE,YAAY;YACxB,QAAQ,EAAE,SAAS;YACnB,EAAE,EAAE,IAAI;SACT;KACF,CAAA;IACD,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IACzB,MAAM,WAAW,GAAG,IAAA,0BAAiB,EAAkC;QACrE,MAAM,EAAE;YACN,KAAK,EAAE,OAAO;SACf;KACF,CAAC,CAAA;IAEF,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,aAAa,EAAE,CAAA;IACtB,CAAC,CA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- "version": "1.0.48",
3
+ "version": "1.0.50",
4
4
  "packageManager": "yarn@3.4.1",
5
5
  "main": "dist/src/index.js",
6
6
  "repository": {