@awell-health/awell-extensions 1.1.63 → 1.1.65

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. package/dist/extensions/athenahealth/actions/index.d.ts +2 -2
  2. package/dist/extensions/athenahealth/api/schema/appointment.d.ts +2 -2
  3. package/dist/extensions/athenahealth/api/schema/clinicalDocument.d.ts +2 -2
  4. package/dist/extensions/athenahealth/settings.d.ts +4 -4
  5. package/dist/extensions/awell/v1/actions/updatePatient/config/fields.d.ts +4 -4
  6. package/dist/extensions/calDotCom/schema.d.ts +6 -6
  7. package/dist/extensions/calendly/webhooks/index.d.ts +1 -1
  8. package/dist/extensions/canvasMedical/v1/validation/patient.zod.d.ts +8 -8
  9. package/dist/extensions/canvasMedical/v1/validation/settings.zod.d.ts +4 -4
  10. package/dist/extensions/canvasMedical/v1/validation/task.zod.d.ts +8 -8
  11. package/dist/extensions/dockHealth/api/schema/patient.schema.d.ts +14 -14
  12. package/dist/extensions/dockHealth/api/schema/task.schema.d.ts +8 -8
  13. package/dist/extensions/dockHealth/lib/dock.types.d.ts +4 -4
  14. package/dist/extensions/dropboxSign/v1/actions/createEmbeddedSignatureRequestWithTemplate/config/fields.d.ts +1 -1
  15. package/dist/extensions/dropboxSign/v1/actions/sendRequestReminder/config/fields.d.ts +2 -2
  16. package/dist/extensions/elation/actions/index.d.ts +3 -3
  17. package/dist/extensions/elation/validation/appointment.zod.d.ts +24 -24
  18. package/dist/extensions/elation/validation/nonVisitNote.zod.d.ts +3 -3
  19. package/dist/extensions/elation/validation/patient.zod.d.ts +4 -4
  20. package/dist/extensions/elation/validation/physician.zod.d.ts +4 -4
  21. package/dist/extensions/elation/validation/settings.zod.d.ts +4 -4
  22. package/dist/extensions/healthie/actions/createAppointment/config/fields.d.ts +2 -2
  23. package/dist/extensions/healthie/actions/getMetricEntry/config/fields.d.ts +2 -2
  24. package/dist/extensions/healthie/actions/index.d.ts +3 -3
  25. package/dist/extensions/healthie/lib/validation/createTask.zod.d.ts +22 -22
  26. package/dist/extensions/index.js +22 -20
  27. package/dist/extensions/index.js.map +1 -1
  28. package/dist/extensions/infobip/settings.d.ts +4 -4
  29. package/dist/extensions/infobip/v1/actions/sendEmail/config/fields.d.ts +2 -2
  30. package/dist/extensions/infobip/v1/actions/sendEmailWithTemplate/config/fields.d.ts +2 -2
  31. package/dist/extensions/mailgun/settings.d.ts +1 -1
  32. package/dist/extensions/mailgun/v1/actions/sendEmailWithTemplate/config/fields.d.ts +2 -2
  33. package/dist/extensions/markdown.json +5 -1
  34. package/dist/extensions/medplum/actions/createPatient/config/fields.d.ts +4 -4
  35. package/dist/extensions/medplum/actions/createTask/config/fields.d.ts +2 -2
  36. package/dist/extensions/medplum/fhir/schemas/resources/patient.schema.d.ts +4 -4
  37. package/dist/extensions/medplum/fhir/schemas/resources/task.schema.d.ts +2 -2
  38. package/dist/extensions/metriport/actions/index.d.ts +1 -1
  39. package/dist/extensions/metriport/actions/patient/validation.d.ts +6 -6
  40. package/dist/extensions/sendgrid-extension/v1/actions/addOrUpdateContact/config/fields.d.ts +2 -2
  41. package/dist/extensions/sendgrid-extension/v1/actions/sendEmailWithTemplate/config/fields.d.ts +2 -2
  42. package/dist/extensions/sfdc/actions/createLead/createLead.js +6 -8
  43. package/dist/extensions/sfdc/actions/createLead/createLead.js.map +1 -1
  44. package/dist/extensions/sfdc/actions/updateLead/updateLead.js +6 -8
  45. package/dist/extensions/sfdc/actions/updateLead/updateLead.js.map +1 -1
  46. package/dist/extensions/sfdc/api/client.js +3 -6
  47. package/dist/extensions/sfdc/api/client.js.map +1 -1
  48. package/dist/extensions/sfdc/lib/errors.d.ts +9 -4
  49. package/dist/extensions/sfdc/lib/errors.js +18 -24
  50. package/dist/extensions/sfdc/lib/errors.js.map +1 -1
  51. package/dist/extensions/talkDesk/settings.d.ts +2 -2
  52. package/dist/extensions/twilio/lib/appendOptOutLanguage.d.ts +3 -0
  53. package/dist/extensions/twilio/lib/appendOptOutLanguage.js +18 -0
  54. package/dist/extensions/twilio/lib/appendOptOutLanguage.js.map +1 -0
  55. package/dist/extensions/twilio/lib/errors.d.ts +9 -0
  56. package/dist/extensions/twilio/lib/errors.js +23 -0
  57. package/dist/extensions/twilio/lib/errors.js.map +1 -0
  58. package/dist/extensions/twilio/lib/index.d.ts +1 -0
  59. package/dist/extensions/twilio/lib/index.js +6 -0
  60. package/dist/extensions/twilio/lib/index.js.map +1 -0
  61. package/dist/extensions/twilio/settings.d.ts +30 -0
  62. package/dist/extensions/twilio/settings.js +39 -0
  63. package/dist/extensions/twilio/settings.js.map +1 -1
  64. package/dist/extensions/twilio/tests/settings.test.d.ts +1 -0
  65. package/dist/extensions/twilio/tests/settings.test.js +24 -0
  66. package/dist/extensions/twilio/tests/settings.test.js.map +1 -0
  67. package/dist/extensions/twilio/v2/actions/createFlowExecution/config/actionSchema.d.ts +57 -24
  68. package/dist/extensions/twilio/v2/actions/getMessages/config/fields.d.ts +2 -2
  69. package/dist/extensions/twilio/v2/actions/getMessages/getMessages.test.js +12 -0
  70. package/dist/extensions/twilio/v2/actions/getMessages/getMessages.test.js.map +1 -1
  71. package/dist/extensions/twilio/v2/actions/sendSms/sendSms.js +11 -29
  72. package/dist/extensions/twilio/v2/actions/sendSms/sendSms.js.map +1 -1
  73. package/dist/extensions/twilio/v2/actions/sendSms/sendSms.test.js +19 -15
  74. package/dist/extensions/twilio/v2/actions/sendSms/sendSms.test.js.map +1 -1
  75. package/dist/extensions/twilio/v2/actions/sendSmsDuringBusinessHours/sendSmsDuringBusinessHours.js +11 -30
  76. package/dist/extensions/twilio/v2/actions/sendSmsDuringBusinessHours/sendSmsDuringBusinessHours.js.map +1 -1
  77. package/dist/extensions/twilio/v2/actions/sendSmsDuringBusinessHours/sendSmsDuringBusinessHours.test.js +25 -15
  78. package/dist/extensions/twilio/v2/actions/sendSmsDuringBusinessHours/sendSmsDuringBusinessHours.test.js.map +1 -1
  79. package/dist/extensions/twilio/v2/actions/sendSmsWithMessagingSid/sendSmsWithMessagingService.js +10 -29
  80. package/dist/extensions/twilio/v2/actions/sendSmsWithMessagingSid/sendSmsWithMessagingService.js.map +1 -1
  81. package/dist/extensions/twilio/v2/actions/sendSmsWithMessagingSid/sendSmsWithMessagingService.test.js +19 -15
  82. package/dist/extensions/twilio/v2/actions/sendSmsWithMessagingSid/sendSmsWithMessagingService.test.js.map +1 -1
  83. package/dist/extensions/workramp/config.d.ts +1 -0
  84. package/dist/extensions/workramp/config.js +5 -0
  85. package/dist/extensions/workramp/config.js.map +1 -0
  86. package/dist/extensions/workramp/index.d.ts +2 -0
  87. package/dist/extensions/workramp/index.js +19 -0
  88. package/dist/extensions/workramp/index.js.map +1 -0
  89. package/dist/extensions/workramp/settings.d.ts +1 -0
  90. package/dist/extensions/workramp/settings.js +5 -0
  91. package/dist/extensions/workramp/settings.js.map +1 -0
  92. package/dist/extensions/workramp/types/EventPayload.d.ts +49 -0
  93. package/dist/extensions/workramp/types/EventPayload.js +22 -0
  94. package/dist/extensions/workramp/types/EventPayload.js.map +1 -0
  95. package/dist/extensions/workramp/types/EventType.d.ts +13 -0
  96. package/dist/extensions/workramp/types/EventType.js +18 -0
  97. package/dist/extensions/workramp/types/EventType.js.map +1 -0
  98. package/dist/extensions/workramp/types/index.d.ts +2 -0
  99. package/dist/extensions/workramp/types/index.js +8 -0
  100. package/dist/extensions/workramp/types/index.js.map +1 -0
  101. package/dist/extensions/workramp/webhooks/EventWebhook.d.ts +12 -0
  102. package/dist/extensions/workramp/webhooks/EventWebhook.js +28 -0
  103. package/dist/extensions/workramp/webhooks/EventWebhook.js.map +1 -0
  104. package/dist/extensions/workramp/webhooks/index.d.ts +1 -0
  105. package/dist/extensions/workramp/webhooks/index.js +6 -0
  106. package/dist/extensions/workramp/webhooks/index.js.map +1 -0
  107. package/dist/extensions/zusHealth/validation/settings.zod.d.ts +5 -5
  108. package/package.json +1 -1
@@ -53,8 +53,8 @@ export declare const SettingsValidationSchema: z.ZodObject<{
53
53
  testMode: z.ZodEffects<z.ZodOptional<z.ZodEnum<["Yes", "yes", "No", "no"]>>, boolean, "Yes" | "No" | "yes" | "no" | undefined>;
54
54
  }, "strip", z.ZodTypeAny, {
55
55
  apiKey: string;
56
- testMode: boolean;
57
56
  fromName: string;
57
+ testMode: boolean;
58
58
  fromEmail: string;
59
59
  domain: string;
60
60
  region?: "US" | "EU" | "eu" | "us" | undefined;
@@ -43,11 +43,11 @@ export declare const FieldsValidationSchema: z.ZodObject<{
43
43
  } | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null, string | undefined>;
44
44
  }, "strip", z.ZodTypeAny, {
45
45
  subject: string;
46
- to: string;
47
- template: string;
48
46
  variables: string | number | boolean | {
49
47
  [key: string]: string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
50
48
  } | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
49
+ to: string;
50
+ template: string;
51
51
  }, {
52
52
  subject: string;
53
53
  to: string;
@@ -140,13 +140,17 @@
140
140
  "changelog": "# Transform changelog\n\n## June 2024\n\n- Added \"Feet and inches to inches\" action\n## March 2024\n\n- Added \"Generate dynamic URL\" action\n\n## January 2024\n\n- Added \"Parse number to text with dictionary\" action"
141
141
  },
142
142
  "twilio": {
143
- "readme": "---\ntitle: Twilio\ndescription: Twilio 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---\n# 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\n### Get messages\n\nGet a list of text messages matching the given criteria. Only the last 50 messages are returned.\n\n## Send SMS during working hours\n\nThis action allows for the scheduling of SMS messages to be sent within the \"daily operational hours\" of 9 AM to 5 PM. It ensures that text messages are dispatched at appropriate times during the day, avoiding early morning or late-night disturbances to recipients.\n\n**Here's how it works:**\n\n- If the action is activate during business hours (9 AM to 5 PM), the SMS is sent immediately.\n- If activated before 9 AM, the SMS is scheduled to be sent at 9 AM on the same day.\n- If activated after 5 PM, the SMS is scheduled to be sent at 9 AM the following day.\n\nThis setup ensures that all messages reach your respondents during reasonable daytime hours, enhancing the likelihood of a timely and considerate communication. It's important to mention that messages will still be dispatched over the weekend, but they will adhere to the \"business hours\" schedule of 9 AM to 5 PM.\n\nNote that scheduling messages with Twilio is only possible if you send text messages using a MessagingServiceSid.\n\n\n\n\n\n\n",
143
+ "readme": "---\ntitle: Twilio\ndescription: Twilio 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---\n# 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## User consent\n\nThe extension has some built-in mechanisms to enforce compliance with [Twilio's messaging policy](https://www.twilio.com/en-us/legal/messaging-policy).\n\n### Opt-out\n\nBy default, every text message will be appended with standard opt-out language (\"Reply STOP to unsubscribe.\"). You can specify custom opt-out language within the settings of the extension but make sure the opt-out keywords used are supported. STOP, UNSTOP, UNSUBSCRIBE or CANCEL are the default opt-out keywords supported but Twilio also supports defining custom stop keywords.\n\nIf you don't want to append opt-out language to your text messages, set the \"Add opt-out language\" setting to \"Off\".\n\nFor more information, please visit the Twilio docs.\n\n### Sending text messages to recipients that opted out\n\nIf you attempt to send a text message to a recipient who has opted out, the message will fail to be delivered and the action will be marked as failed. This is the default behavior of Twilio's API, which prevents sending texts to anyone who has chosen to opt out.\n\n## Custom Actions\n\n### Send SMS\n\nSend an SMS with Twilio to a recipient of your liking.\n\n### Get messages\n\nGet a list of text messages matching the given criteria. Only the last 50 messages are returned.\n\n## Send SMS during working hours\n\nThis action allows for the scheduling of SMS messages to be sent within the \"daily operational hours\" of 9 AM to 5 PM. It ensures that text messages are dispatched at appropriate times during the day, avoiding early morning or late-night disturbances to recipients.\n\n**Here's how it works:**\n\n- If the action is activate during business hours (9 AM to 5 PM), the SMS is sent immediately.\n- If activated before 9 AM, the SMS is scheduled to be sent at 9 AM on the same day.\n- If activated after 5 PM, the SMS is scheduled to be sent at 9 AM the following day.\n\nThis setup ensures that all messages reach your respondents during reasonable daytime hours, enhancing the likelihood of a timely and considerate communication. It's important to mention that messages will still be dispatched over the weekend, but they will adhere to the \"business hours\" schedule of 9 AM to 5 PM.\n\nNote that scheduling messages with Twilio is only possible if you send text messages using a MessagingServiceSid.\n\n\n\n\n\n\n",
144
144
  "changelog": "# Twilio changelog\n\n## v2 2024-02-22\n\n1. Add capability to search for messages using all the allowed filters provided by Twilio API. Check here: https://www.twilio.com/docs/messaging/api/message-resource#read-multiple-message-resources\n\n## v2 2023-06-23\n\nFull description: https://github.com/awell-health/awell-extensions/issues/157\n\n1. \"Send SMS\" action\n 1. Change label from \"Send SMS\" to \"Send SMS (with from number)\"\n 2. Throw error when \"From\" number in both settings and in fields is not provided\n2. Add new action \"Send SMS (with Messaging Service)\"\n\n## v2\n\nCompared to v1 (pre-beta release), the extension only has one custom action \"Send SMS\" instead of two. The Custom Action allows for:\n\n1. Sending a text message to a recipient (phone number) stored in a data point, including patient profile data points.\n2. Sending a text message to a fixed recipient (phone number).\n"
145
145
  },
146
146
  "westFax": {
147
147
  "readme": "---\ntitle: WestFax\ndescription: WestFax is a leading provider of HIPAA Compliant Cloud Fax / Fax to Email, Print to Fax\n---\n\n# WestFax\n\n[WestFax](https://westfax.com/) is a cloud-based faxing service that offers a variety of features, including:\n- Secure faxing: WestFax uses end-to-end encryption to protect your documents from unauthorized access.\n- HIPAA compliance: WestFax is HIPAA compliant, so you can be sure that your medical records are safe.\n- Integration with other applications: WestFax can be integrated with your existing email, CRM, and other applications.\n- Mobile app: You can send and receive faxes from your mobile device with the WestFax mobile app.\n- Paperless faxing: WestFax can store your faxes in the cloud, so you can access them from anywhere.\n\n## WestFax x Awell\n\nThis extension allows you to let a stakeholder (eg: a patient) send a fax as part of a care flow.\n\n## Extension settings\n\nIn order to set up this extension, **you will need to provide a WestFax Username and Password**. You will need as well to provide the ProductId when setting up the action - check how [here](https://westfax.com/how-to-get-productid/).\n\n\n",
148
148
  "changelog": "# WestFax changelog\n\n## February 2024\n\n- Initial action to send an fax to an email\n"
149
149
  },
150
+ "workramp": {
151
+ "readme": "---\ntitle: Workramp\ndescription: WorkRamp is the all-in-one LMS platform for employees, customers, and partners. \n---\n# Workramp\n\nWorkramp is a learning management platform helping to upskill employees and educate partners and customers.\n\n## Extension settings\n\nThere are no extension settings (e.g. API keys) to set. Simply enable the extension and then utilize the EventPayload webhook to subscribe to events.\n\n## Webhooks\n\n### EventPayload\nListens to an event and starts a care flow, using the `user.id` field as a unique patient identifier.\n\nTo learn more about webhooks, visit [their developer site](https://developers.workramp.com/reference/introduction-to-webhooks).",
152
+ "changelog": "# Workramp changelog\n\n## 2024-08-28\n\nCreated the extension."
153
+ },
150
154
  "zendesk": {
151
155
  "readme": "---\ntitle: Zendesk\ndescription: Zendesk is a customer service and support platform that provides a suite of tools and software for businesses to manage their customer interactions.\n---\n\n# Zendesk\n\nZendesk is a customer service and support platform that provides a suite of tools and software for businesses to manage their customer interactions. It offers a range of customer service solutions, including help desk ticketing systems, customer support and engagement, and self-service options. Zendesk is designed to help companies streamline their customer support processes, improve communication with their customers, and resolve issues more efficiently.\n\n## Extension settings\n\nIn order to set up this extension, you will to authenticate with the Sell API and need an API token. You can visit Zendesk Sales CRM dashboard and go to **Settings > Integration > OAuth** to enable and create an API token. Read more about how to get an access token for the Sell API [here](https://developer.zendesk.com/documentation/sales-crm/first-call/).\n\n## Custom Actions\n\n### Create task\n\nCreates a new task. You can create either a floating task or create a related task and associate it with one of the resource types: Leads, Contacts, Deals.\n\n### Complete task\n\nMarks a task as completed.\n",
152
156
  "changelog": "# Zendesk changelog\n"
@@ -93,10 +93,10 @@ export declare const FieldsValidationSchema: ZodObject<{
93
93
  country: import("zod").ZodOptional<import("zod").ZodString>;
94
94
  postalCode: import("zod").ZodOptional<import("zod").ZodString>;
95
95
  }, "strip", ZodTypeAny, {
96
- address?: string | undefined;
97
- email?: string | undefined;
98
96
  firstName?: string | undefined;
99
97
  lastName?: string | undefined;
98
+ email?: string | undefined;
99
+ address?: string | undefined;
100
100
  birthDate?: string | undefined;
101
101
  mobilePhone?: import("libphonenumber-js").E164Number | undefined;
102
102
  city?: string | undefined;
@@ -105,10 +105,10 @@ export declare const FieldsValidationSchema: ZodObject<{
105
105
  postalCode?: string | undefined;
106
106
  gender?: "unknown" | "male" | "female" | "other" | undefined;
107
107
  }, {
108
- address?: string | undefined;
109
- email?: string | undefined;
110
108
  firstName?: string | undefined;
111
109
  lastName?: string | undefined;
110
+ email?: string | undefined;
111
+ address?: string | undefined;
112
112
  birthDate?: "" | Date | undefined;
113
113
  mobilePhone?: string | undefined;
114
114
  city?: string | undefined;
@@ -72,8 +72,8 @@ export declare const FieldsValidationSchema: ZodObject<{
72
72
  patientId: string;
73
73
  intent: "unknown" | "order" | "plan" | "proposal" | "original-order" | "reflex-order" | "filler-order" | "instance-order" | "option";
74
74
  taskTitle: string;
75
- description?: string | undefined;
76
75
  priority?: "routine" | "urgent" | "asap" | "stat" | undefined;
76
+ description?: string | undefined;
77
77
  dueDate?: string | undefined;
78
78
  performerType?: string | undefined;
79
79
  }, {
@@ -81,8 +81,8 @@ export declare const FieldsValidationSchema: ZodObject<{
81
81
  patientId: string;
82
82
  intent: "unknown" | "order" | "plan" | "proposal" | "original-order" | "reflex-order" | "filler-order" | "instance-order" | "option";
83
83
  taskTitle: string;
84
- description?: string | undefined;
85
84
  priority?: "routine" | "urgent" | "asap" | "stat" | undefined;
85
+ description?: string | undefined;
86
86
  dueDate?: "" | Date | undefined;
87
87
  performerType?: string | undefined;
88
88
  }>;
@@ -12,10 +12,10 @@ export declare const PatientSchema: z.ZodObject<{
12
12
  country: z.ZodOptional<z.ZodString>;
13
13
  postalCode: z.ZodOptional<z.ZodString>;
14
14
  }, "strip", z.ZodTypeAny, {
15
- address?: string | undefined;
16
- email?: string | undefined;
17
15
  firstName?: string | undefined;
18
16
  lastName?: string | undefined;
17
+ email?: string | undefined;
18
+ address?: string | undefined;
19
19
  birthDate?: string | undefined;
20
20
  mobilePhone?: import("libphonenumber-js").E164Number | undefined;
21
21
  city?: string | undefined;
@@ -24,10 +24,10 @@ export declare const PatientSchema: z.ZodObject<{
24
24
  postalCode?: string | undefined;
25
25
  gender?: "unknown" | "male" | "female" | "other" | undefined;
26
26
  }, {
27
- address?: string | undefined;
28
- email?: string | undefined;
29
27
  firstName?: string | undefined;
30
28
  lastName?: string | undefined;
29
+ email?: string | undefined;
30
+ address?: string | undefined;
31
31
  birthDate?: "" | Date | undefined;
32
32
  mobilePhone?: string | undefined;
33
33
  city?: string | undefined;
@@ -13,8 +13,8 @@ export declare const CreateTaskSchema: z.ZodObject<{
13
13
  patientId: string;
14
14
  intent: "unknown" | "order" | "plan" | "proposal" | "original-order" | "reflex-order" | "filler-order" | "instance-order" | "option";
15
15
  taskTitle: string;
16
- description?: string | undefined;
17
16
  priority?: "routine" | "urgent" | "asap" | "stat" | undefined;
17
+ description?: string | undefined;
18
18
  dueDate?: string | undefined;
19
19
  performerType?: string | undefined;
20
20
  }, {
@@ -22,8 +22,8 @@ export declare const CreateTaskSchema: z.ZodObject<{
22
22
  patientId: string;
23
23
  intent: "unknown" | "order" | "plan" | "proposal" | "original-order" | "reflex-order" | "filler-order" | "instance-order" | "option";
24
24
  taskTitle: string;
25
- description?: string | undefined;
26
25
  priority?: "routine" | "urgent" | "asap" | "stat" | undefined;
26
+ description?: string | undefined;
27
27
  dueDate?: "" | Date | undefined;
28
28
  performerType?: string | undefined;
29
29
  }>;
@@ -22,7 +22,7 @@ export declare const actions: {
22
22
  description: string;
23
23
  required: false;
24
24
  };
25
- }, "email" | "phone" | "firstName" | "lastName" | "city" | "country" | "state" | "zip" | "dob" | "addressLine1" | "addressLine2" | "genderAtBirth" | "driversLicenseValue" | "driversLicenseState">;
25
+ }, "firstName" | "lastName" | "email" | "dob" | "phone" | "city" | "country" | "state" | "zip" | "addressLine1" | "addressLine2" | "genderAtBirth" | "driversLicenseValue" | "driversLicenseState">;
26
26
  createPatient: import("@awell-health/extensions-core").Action<{
27
27
  phone: {
28
28
  id: string;
@@ -18,9 +18,9 @@ export declare const patientCreateSchema: z.ZodObject<z.objectUtil.extendShape<{
18
18
  }>, "strip", z.ZodTypeAny, {
19
19
  firstName: string;
20
20
  lastName: string;
21
+ dob: string;
21
22
  country: string;
22
23
  zip: string;
23
- dob: string;
24
24
  genderAtBirth: "M" | "F";
25
25
  email?: string | undefined;
26
26
  phone?: string | undefined;
@@ -33,8 +33,8 @@ export declare const patientCreateSchema: z.ZodObject<z.objectUtil.extendShape<{
33
33
  }, {
34
34
  firstName: string;
35
35
  lastName: string;
36
- zip: string;
37
36
  dob: string;
37
+ zip: string;
38
38
  genderAtBirth: "M" | "F";
39
39
  email?: string | undefined;
40
40
  phone?: string | undefined;
@@ -66,12 +66,12 @@ export declare const patientUpdateSchema: z.ZodObject<z.objectUtil.extendShape<{
66
66
  zip: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
67
67
  country: z.ZodDefault<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodOptional<z.ZodString>]>, string | undefined, string | undefined>>;
68
68
  }>>, "strip", z.ZodTypeAny, {
69
- id: string;
70
69
  firstName: string;
71
70
  lastName: string;
71
+ dob: string;
72
+ id: string;
72
73
  country: string;
73
74
  zip: string;
74
- dob: string;
75
75
  genderAtBirth: "M" | "F";
76
76
  email?: string | undefined;
77
77
  phone?: string | undefined;
@@ -82,11 +82,11 @@ export declare const patientUpdateSchema: z.ZodObject<z.objectUtil.extendShape<{
82
82
  driversLicenseValue?: string | undefined;
83
83
  driversLicenseState?: string | undefined;
84
84
  }, {
85
- id: string;
86
85
  firstName: string;
87
86
  lastName: string;
88
- zip: string;
89
87
  dob: string;
88
+ id: string;
89
+ zip: string;
90
90
  genderAtBirth: "M" | "F";
91
91
  email?: string | undefined;
92
92
  phone?: string | undefined;
@@ -47,15 +47,15 @@ export declare const FieldsValidationSchema: z.ZodObject<{
47
47
  lastName: z.ZodString;
48
48
  customFields: z.ZodEffects<z.ZodOptional<z.ZodString>, CustomFields, string | undefined>;
49
49
  }, "strip", z.ZodTypeAny, {
50
- email: string;
51
50
  firstName: string;
52
51
  lastName: string;
52
+ email: string;
53
53
  customFields: CustomFields;
54
54
  listIds: string[];
55
55
  }, {
56
- email: string;
57
56
  firstName: string;
58
57
  lastName: string;
58
+ email: string;
59
59
  listIds: string;
60
60
  customFields?: string | undefined;
61
61
  }>;
@@ -56,15 +56,15 @@ export declare const FieldsValidationSchema: z.ZodObject<{
56
56
  fromName: z.ZodOptional<z.ZodString>;
57
57
  fromEmail: z.ZodOptional<z.ZodString>;
58
58
  }, "strip", z.ZodTypeAny, {
59
- templateId: string;
60
59
  to: string;
60
+ templateId: string;
61
61
  dynamicTemplateData: TemplateData;
62
62
  subject?: string | undefined;
63
63
  fromName?: string | undefined;
64
64
  fromEmail?: string | undefined;
65
65
  }, {
66
- templateId: string;
67
66
  to: string;
67
+ templateId: string;
68
68
  subject?: string | undefined;
69
69
  fromName?: string | undefined;
70
70
  fromEmail?: string | undefined;
@@ -4,7 +4,6 @@ exports.createLead = void 0;
4
4
  const extensions_core_1 = require("@awell-health/extensions-core");
5
5
  const config_1 = require("./config");
6
6
  const lib_1 = require("../../lib");
7
- const axios_1 = require("axios");
8
7
  const errors_1 = require("../../lib/errors");
9
8
  exports.createLead = {
10
9
  key: 'createLead',
@@ -31,16 +30,15 @@ exports.createLead = {
31
30
  });
32
31
  }
33
32
  catch (error) {
34
- let parsedError;
35
- if ((0, axios_1.isAxiosError)(error)) {
36
- parsedError = (0, errors_1.parseAxiosError)(error);
33
+ if ((0, errors_1.isSalesforceError)(error)) {
34
+ await onError({
35
+ events: [(0, errors_1.parseSalesforceError)(error)],
36
+ });
37
37
  }
38
38
  else {
39
- parsedError = (0, errors_1.parseUnknowError)(error);
39
+ // we handle ZodError and unknown errors in extension-server directly
40
+ throw error;
40
41
  }
41
- await onError({
42
- events: [parsedError],
43
- });
44
42
  }
45
43
  },
46
44
  };
@@ -1 +1 @@
1
- {"version":3,"file":"createLead.js","sourceRoot":"","sources":["../../../../../extensions/sfdc/actions/createLead/createLead.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,mCAA0D;AAC1D,iCAAgD;AAChD,6CAAoE;AAEvD,QAAA,UAAU,GAInB;IACF,GAAG,EAAE,YAAY;IACjB,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,yCAAyC;IACtD,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,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,IAAA,oCAA8B,EAAC;YACxE,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEF,IAAI;YACF,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAC,YAAY,CAAC;gBAC9C,OAAO,EAAE,MAAM;gBACf,IAAI,EAAE,MAAM,CAAC,IAAI;aAClB,CAAC,CAAA;YAEF,MAAM,UAAU,CAAC;gBACf,WAAW,EAAE;oBACX,aAAa,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;iBAC9B;aACF,CAAC,CAAA;SACH;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,WAAW,CAAA;YAEf,IAAI,IAAA,oBAAY,EAAC,KAAK,CAAC,EAAE;gBACvB,WAAW,GAAG,IAAA,wBAAe,EAAC,KAAmB,CAAC,CAAA;aACnD;iBAAM;gBACL,WAAW,GAAG,IAAA,yBAAgB,EAAC,KAAc,CAAC,CAAA;aAC/C;YACD,MAAM,OAAO,CAAC;gBACZ,MAAM,EAAE,CAAC,WAAW,CAAC;aACtB,CAAC,CAAA;SACH;IACH,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"createLead.js","sourceRoot":"","sources":["../../../../../extensions/sfdc/actions/createLead/createLead.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,mCAA0D;AAC1D,6CAA0E;AAE7D,QAAA,UAAU,GAInB;IACF,GAAG,EAAE,YAAY;IACjB,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,yCAAyC;IACtD,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,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,IAAA,oCAA8B,EAAC;YACxE,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEF,IAAI;YACF,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAC,YAAY,CAAC;gBAC9C,OAAO,EAAE,MAAM;gBACf,IAAI,EAAE,MAAM,CAAC,IAAI;aAClB,CAAC,CAAA;YAEF,MAAM,UAAU,CAAC;gBACf,WAAW,EAAE;oBACX,aAAa,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;iBAC9B;aACF,CAAC,CAAA;SACH;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,IAAA,0BAAiB,EAAC,KAAK,CAAC,EAAE;gBAC5B,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE,CAAC,IAAA,6BAAoB,EAAC,KAAK,CAAC,CAAC;iBACtC,CAAC,CAAA;aACH;iBAAM;gBACL,qEAAqE;gBACrE,MAAM,KAAK,CAAA;aACZ;SACF;IACH,CAAC;CACF,CAAA"}
@@ -4,7 +4,6 @@ exports.updateLead = void 0;
4
4
  const extensions_core_1 = require("@awell-health/extensions-core");
5
5
  const config_1 = require("./config");
6
6
  const lib_1 = require("../../lib");
7
- const axios_1 = require("axios");
8
7
  const errors_1 = require("../../lib/errors");
9
8
  exports.updateLead = {
10
9
  key: 'updateLead',
@@ -28,16 +27,15 @@ exports.updateLead = {
28
27
  await onComplete();
29
28
  }
30
29
  catch (error) {
31
- let parsedError;
32
- if ((0, axios_1.isAxiosError)(error)) {
33
- parsedError = (0, errors_1.parseAxiosError)(error);
30
+ if ((0, errors_1.isSalesforceError)(error)) {
31
+ await onError({
32
+ events: [(0, errors_1.parseSalesforceError)(error)],
33
+ });
34
34
  }
35
35
  else {
36
- parsedError = (0, errors_1.parseUnknowError)(error);
36
+ // we handle ZodError and unknown errors in extension-server directly
37
+ throw error;
37
38
  }
38
- await onError({
39
- events: [parsedError],
40
- });
41
39
  }
42
40
  },
43
41
  };
@@ -1 +1 @@
1
- {"version":3,"file":"updateLead.js","sourceRoot":"","sources":["../../../../../extensions/sfdc/actions/updateLead/updateLead.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,mCAA0D;AAC1D,iCAAgD;AAChD,6CAAoE;AAEvD,QAAA,UAAU,GAInB;IACF,GAAG,EAAE,YAAY;IACjB,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,+CAA+C;IAC5D,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,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,IAAA,oCAA8B,EAAC;YACxE,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEF,IAAI;YACF,MAAM,gBAAgB,CAAC,YAAY,CAAC;gBAClC,OAAO,EAAE,MAAM;gBACf,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,IAAI,EAAE,MAAM,CAAC,IAAI;aAClB,CAAC,CAAA;YAEF,MAAM,UAAU,EAAE,CAAA;SACnB;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,WAAW,CAAA;YAEf,IAAI,IAAA,oBAAY,EAAC,KAAK,CAAC,EAAE;gBACvB,WAAW,GAAG,IAAA,wBAAe,EAAC,KAAmB,CAAC,CAAA;aACnD;iBAAM;gBACL,WAAW,GAAG,IAAA,yBAAgB,EAAC,KAAc,CAAC,CAAA;aAC/C;YACD,MAAM,OAAO,CAAC;gBACZ,MAAM,EAAE,CAAC,WAAW,CAAC;aACtB,CAAC,CAAA;SACH;IACH,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"updateLead.js","sourceRoot":"","sources":["../../../../../extensions/sfdc/actions/updateLead/updateLead.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,mCAA0D;AAC1D,6CAA0E;AAE7D,QAAA,UAAU,GAInB;IACF,GAAG,EAAE,YAAY;IACjB,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,+CAA+C;IAC5D,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,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,IAAA,oCAA8B,EAAC;YACxE,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QACF,IAAI;YACF,MAAM,gBAAgB,CAAC,YAAY,CAAC;gBAClC,OAAO,EAAE,MAAM;gBACf,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,IAAI,EAAE,MAAM,CAAC,IAAI;aAClB,CAAC,CAAA;YAEF,MAAM,UAAU,EAAE,CAAA;SACnB;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,IAAA,0BAAiB,EAAC,KAAK,CAAC,EAAE;gBAC5B,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE,CAAC,IAAA,6BAAoB,EAAC,KAAK,CAAC,CAAC;iBACtC,CAAC,CAAA;aACH;iBAAM;gBACL,qEAAqE;gBACrE,MAAM,KAAK,CAAA;aACZ;SACF;IACH,CAAC;CACF,CAAA"}
@@ -9,7 +9,7 @@ class SalesforceDataWrapper extends extensions_core_1.DataWrapper {
9
9
  this.apiVersion = opts.apiVersion;
10
10
  }
11
11
  async createRecord(input) {
12
- const res = await this.Request({
12
+ return await this.Request({
13
13
  method: 'POST',
14
14
  url: `/services/data/${this.apiVersion}/sobjects/${input.sObject}/`,
15
15
  headers: {
@@ -17,10 +17,9 @@ class SalesforceDataWrapper extends extensions_core_1.DataWrapper {
17
17
  },
18
18
  data: JSON.stringify(input.data),
19
19
  });
20
- return res;
21
20
  }
22
21
  async updateRecord(input) {
23
- const res = await this.Request({
22
+ return await this.Request({
24
23
  method: 'PATCH',
25
24
  url: `/services/data/${this.apiVersion}/sobjects/${input.sObject}/${input.sObjectId}`,
26
25
  headers: {
@@ -28,17 +27,15 @@ class SalesforceDataWrapper extends extensions_core_1.DataWrapper {
28
27
  },
29
28
  data: JSON.stringify(input.data),
30
29
  });
31
- return res;
32
30
  }
33
31
  async getRecordShape(sObject) {
34
- const res = await this.Request({
32
+ return await this.Request({
35
33
  method: 'GET',
36
34
  url: `/services/data/${this.apiVersion}/sobjects/${sObject}/describe`,
37
35
  headers: {
38
36
  'Content-Type': 'application/json',
39
37
  },
40
38
  });
41
- return res;
42
39
  }
43
40
  }
44
41
  exports.SalesforceDataWrapper = SalesforceDataWrapper;
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../extensions/sfdc/api/client.ts"],"names":[],"mappings":";;;AAAA,mEASsC;AACtC,iDAAuD;AAQvD,MAAa,qBAAsB,SAAQ,6BAAW;IAGpD,YACE,KAAa,EACb,OAAe,EACf,IAEC;QAED,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QAErB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAA;IACnC,CAAC;IAEM,KAAK,CAAC,YAAY,CACvB,KAA4B;QAE5B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,OAAO,CAA2B;YACvD,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,kBAAkB,IAAI,CAAC,UAAU,aAAa,KAAK,CAAC,OAAO,GAAG;Y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;oBACjB,cAAc,EAAE,aAGf;oBACD;;uBAEG;oBACH,wCAAwC;iBACzC,CAAC,CAAA;aACH;YAED,OAAO,IAAI,wCAAsB,CAAC;gBAChC,QAAQ,EAAE,OAAO;gBACjB,cAAc,EAAE,aAGf;gBACD,YAAY,EAAE,qCAAsB;aACrC,CAAC,CAAA;QACJ,CAAC,CAAA;QAED,KAAK,CAAC;YACJ,GAAG,IAAI;YACP,IAAI,EAAE,OAAO,EAAE;SAChB,CAAC,CAAA;QAvCK,SAAI,GAA2C,CACtD,KAAa,EACb,OAAe,EACf,EAAE,CACF,IAAI,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAA;QAqC1E,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAA;IACnC,CAAC;IAEM,KAAK,CAAC,YAAY,CACvB,KAA4B;QAE5B,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAA;IACzE,CAAC;IAEM,KAAK,CAAC,YAAY,CACvB,KAA4B;QAE5B,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAA;IACzE,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,OAAe;QACzC,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;IAC7E,CAAC;CACF;AA9DD,0DA8DC"}
@@ -1,4 +1,9 @@
1
- import { ActivityEvent } from '@awell-health/extensions-core';
2
- import { AxiosError } from 'axios';
3
- export declare const parseAxiosError: (error: AxiosError) => ActivityEvent;
4
- export declare const parseUnknowError: (error: Error) => ActivityEvent;
1
+ import { type ActivityEvent } from '@awell-health/extensions-core';
2
+ import { type AxiosError } from 'axios';
3
+ type SalesforceError = Array<{
4
+ message: string;
5
+ errorCode: string;
6
+ }>;
7
+ export declare const isSalesforceError: (error: any) => error is AxiosError<SalesforceError, any>;
8
+ export declare const parseSalesforceError: (error: AxiosError<SalesforceError>) => ActivityEvent;
9
+ export {};
@@ -1,17 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseUnknowError = exports.parseAxiosError = void 0;
4
- const parseAxiosError = (error) => {
5
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
3
+ exports.parseSalesforceError = exports.isSalesforceError = void 0;
4
+ const isSalesforceError = (error) => {
5
+ return (typeof error === 'object' &&
6
+ error !== null &&
7
+ 'response' in error &&
8
+ typeof error.response === 'object' &&
9
+ error.response !== null &&
10
+ Array.isArray(error.response.data) &&
11
+ error.response.data.length > 0 &&
12
+ 'errorCode' in error.response.data[0] &&
13
+ 'message' in error.response.data[0]);
14
+ };
15
+ exports.isSalesforceError = isSalesforceError;
16
+ const parseSalesforceError = (error) => {
17
+ var _a;
6
18
  const category = 'BAD_REQUEST';
7
- let message = `${(_c = (_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.status) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : 'UNKNOWN_STATUS'}: ${error.message}`;
8
- // Check if it's a Salesforce error
9
- if (Array.isArray((_d = error === null || error === void 0 ? void 0 : error.response) === null || _d === void 0 ? void 0 : _d.data) &&
10
- ((_f = (_e = error === null || error === void 0 ? void 0 : error.response) === null || _e === void 0 ? void 0 : _e.data[0]) === null || _f === void 0 ? void 0 : _f.errorCode) &&
11
- ((_h = (_g = error === null || error === void 0 ? void 0 : error.response) === null || _g === void 0 ? void 0 : _g.data[0]) === null || _h === void 0 ? void 0 : _h.message)) {
12
- const salesforceError = (_j = error === null || error === void 0 ? void 0 : error.response) === null || _j === void 0 ? void 0 : _j.data[0];
13
- message = `${salesforceError.errorCode}: ${salesforceError.message}`;
14
- }
19
+ const salesforceError = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data[0];
20
+ const message = `${String(salesforceError === null || salesforceError === void 0 ? void 0 : salesforceError.errorCode)}: ${String(salesforceError === null || salesforceError === void 0 ? void 0 : salesforceError.message)}`;
15
21
  return {
16
22
  date: new Date().toISOString(),
17
23
  text: {
@@ -23,17 +29,5 @@ const parseAxiosError = (error) => {
23
29
  },
24
30
  };
25
31
  };
26
- exports.parseAxiosError = parseAxiosError;
27
- const parseUnknowError = (error) => {
28
- const message = error.message;
29
- return {
30
- date: new Date().toISOString(),
31
- text: { en: message },
32
- error: {
33
- category: 'SERVER_ERROR',
34
- message,
35
- },
36
- };
37
- };
38
- exports.parseUnknowError = parseUnknowError;
32
+ exports.parseSalesforceError = parseSalesforceError;
39
33
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../extensions/sfdc/lib/errors.ts"],"names":[],"mappings":";;;AAGO,MAAM,eAAe,GAAG,CAAC,KAAiB,EAAiB,EAAE;;IAClE,MAAM,QAAQ,GAAG,aAAa,CAAA;IAC9B,IAAI,OAAO,GAAG,GAAG,MAAA,MAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,0CAAE,MAAM,0CAAE,QAAQ,EAAE,mCAAI,gBAAgB,KACtE,KAAK,CAAC,OACR,EAAE,CAAA;IAEF,mCAAmC;IACnC,IACE,KAAK,CAAC,OAAO,CAAC,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,0CAAE,IAAI,CAAC;SACpC,MAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,0CAAE,IAAI,CAAC,CAAC,CAAC,0CAAE,SAAS,CAAA;SACnC,MAAA,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AK,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;QAC9B,WAAW,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QACrC,SAAS,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CACpC,CAAA;AACH,CAAC,CAAA;AAdY,QAAA,iBAAiB,qBAc7B;AAEM,MAAM,oBAAoB,GAAG,CAClC,KAAkC,EACnB,EAAE;;IACjB,MAAM,QAAQ,GAAG,aAAa,CAAA;IAC9B,MAAM,eAAe,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,0CAAE,IAAI,CAAC,CAAC,CAAC,CAAA;IAChD,MAAM,OAAO,GAAG,GAAG,MAAM,CAAC,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,SAAS,CAAC,KAAK,MAAM,CAC9D,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,OAAO,CACzB,EAAE,CAAA;IAEH,OAAO;QACL,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QAC9B,IAAI,EAAE;YACJ,EAAE,EAAE,OAAO;SACZ;QACD,KAAK,EAAE;YACL,QAAQ;YACR,OAAO;SACR;KACF,CAAA;AACH,CAAC,CAAA;AAnBY,QAAA,oBAAoB,wBAmBhC"}
@@ -36,12 +36,12 @@ export declare const SettingsValidationSchema: z.ZodObject<{
36
36
  clientSecret: z.ZodString;
37
37
  }, "strip", z.ZodTypeAny, {
38
38
  clientId: string;
39
+ clientSecret: string;
39
40
  region: "US" | "EU" | "Canada";
40
41
  talkDeskAccountName: string;
41
- clientSecret: string;
42
42
  }, {
43
43
  clientId: string;
44
- talkDeskAccountName: string;
45
44
  clientSecret: string;
45
+ talkDeskAccountName: string;
46
46
  region?: "US" | "EU" | "Canada" | undefined;
47
47
  }>;
@@ -0,0 +1,3 @@
1
+ type Language = 'en' | 'fr' | 'nl';
2
+ export declare const appendOptOutLanguage: (message: string, optOutLanguage?: string, language?: Language) => string;
3
+ export {};
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.appendOptOutLanguage = void 0;
4
+ const lodash_1 = require("lodash");
5
+ const DEFAULT_OPT_OUT_LANGUAGE = {
6
+ en: 'Reply STOP to unsubscribe.',
7
+ fr: 'Répondez STOP pour vous désabonner.',
8
+ nl: 'Antwoord STOP om geen communicate meer te ontvangen.',
9
+ };
10
+ const appendOptOutLanguage = (message, optOutLanguage, language) => {
11
+ const lang = language !== null && language !== void 0 ? language : 'en';
12
+ if ((0, lodash_1.isEmpty)(optOutLanguage) || optOutLanguage === undefined) {
13
+ return `${message}\n\n${DEFAULT_OPT_OUT_LANGUAGE[lang]}`;
14
+ }
15
+ return `${message}\n\n${optOutLanguage}`;
16
+ };
17
+ exports.appendOptOutLanguage = appendOptOutLanguage;
18
+ //# sourceMappingURL=appendOptOutLanguage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appendOptOutLanguage.js","sourceRoot":"","sources":["../../../../extensions/twilio/lib/appendOptOutLanguage.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAIhC,MAAM,wBAAwB,GAA6B;IACzD,EAAE,EAAE,4BAA4B;IAChC,EAAE,EAAE,qCAAqC;IACzC,EAAE,EAAE,sDAAsD;CAC3D,CAAA;AAEM,MAAM,oBAAoB,GAAG,CAClC,OAAe,EACf,cAAuB,EACvB,QAAmB,EACX,EAAE;IACV,MAAM,IAAI,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,IAAI,CAAA;IAE7B,IAAI,IAAA,gBAAO,EAAC,cAAc,CAAC,IAAI,cAAc,KAAK,SAAS,EAAE;QAC3D,OAAO,GAAG,OAAO,OAAO,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAA;KACzD;IAED,OAAO,GAAG,OAAO,OAAO,cAAc,EAAE,CAAA;AAC1C,CAAC,CAAA;AAZY,QAAA,oBAAoB,wBAYhC"}
@@ -0,0 +1,9 @@
1
+ import { type ActivityEvent } from '@awell-health/extensions-core';
2
+ export interface TwilioErrorResponse {
3
+ code: number;
4
+ message: string;
5
+ moreInfo: string;
6
+ status: number;
7
+ }
8
+ export declare const isTwilioErrorResponse: (data: any) => data is TwilioErrorResponse;
9
+ export declare const parseTwilioError: (error: TwilioErrorResponse) => ActivityEvent;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseTwilioError = exports.isTwilioErrorResponse = void 0;
4
+ const isTwilioErrorResponse = (data) => {
5
+ return typeof (data === null || data === void 0 ? void 0 : data.moreInfo) === 'string';
6
+ };
7
+ exports.isTwilioErrorResponse = isTwilioErrorResponse;
8
+ const parseTwilioError = (error) => {
9
+ const category = 'BAD_REQUEST';
10
+ const message = `${error.code}: ${error.message} (${error.moreInfo})`;
11
+ return {
12
+ date: new Date().toISOString(),
13
+ text: {
14
+ en: message,
15
+ },
16
+ error: {
17
+ category,
18
+ message,
19
+ },
20
+ };
21
+ };
22
+ exports.parseTwilioError = parseTwilioError;
23
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../extensions/twilio/lib/errors.ts"],"names":[],"mappings":";;;AASO,MAAM,qBAAqB,GAAG,CACnC,IAAS,EACoB,EAAE;IAC/B,OAAO,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,CAAA,KAAK,QAAQ,CAAA;AAC3C,CAAC,CAAA;AAJY,QAAA,qBAAqB,yBAIjC;AAEM,MAAM,gBAAgB,GAAG,CAAC,KAA0B,EAAiB,EAAE;IAC5E,MAAM,QAAQ,GAAG,aAAa,CAAA;IAC9B,MAAM,OAAO,GAAG,GAAG,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC,QAAQ,GAAG,CAAA;IAErE,OAAO;QACL,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QAC9B,IAAI,EAAE;YACJ,EAAE,EAAE,OAAO;SACZ;QACD,KAAK,EAAE;YACL,QAAQ;YACR,OAAO;SACR;KACF,CAAA;AACH,CAAC,CAAA;AAdY,QAAA,gBAAgB,oBAc5B"}
@@ -0,0 +1 @@
1
+ export { appendOptOutLanguage } from './appendOptOutLanguage';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.appendOptOutLanguage = void 0;
4
+ var appendOptOutLanguage_1 = require("./appendOptOutLanguage");
5
+ Object.defineProperty(exports, "appendOptOutLanguage", { enumerable: true, get: function () { return appendOptOutLanguage_1.appendOptOutLanguage; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/twilio/lib/index.ts"],"names":[],"mappings":";;;AAAA,+DAA6D;AAApD,4HAAA,oBAAoB,OAAA"}
@@ -28,20 +28,50 @@ export declare const settings: {
28
28
  required: false;
29
29
  description: string;
30
30
  };
31
+ addOptOutLanguage: {
32
+ label: string;
33
+ key: string;
34
+ obfuscated: false;
35
+ required: false;
36
+ description: string;
37
+ };
38
+ optOutLanguage: {
39
+ label: string;
40
+ key: string;
41
+ obfuscated: false;
42
+ required: false;
43
+ description: string;
44
+ };
45
+ language: {
46
+ label: string;
47
+ key: string;
48
+ obfuscated: false;
49
+ required: false;
50
+ description: string;
51
+ };
31
52
  };
32
53
  export declare const SettingsValidationSchema: z.ZodObject<{
33
54
  accountSid: z.ZodString;
34
55
  authToken: z.ZodString;
35
56
  fromNumber: z.ZodUnion<[z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, import("libphonenumber-js").PhoneNumber | import("libphonenumber-js").ParseError, string>, import("libphonenumber-js").PhoneNumber | import("libphonenumber-js").ParseError, string>, import("libphonenumber-js").E164Number, string>>, z.ZodEffects<z.ZodLiteral<"">, undefined, "">]>;
36
57
  messagingServiceSid: z.ZodOptional<z.ZodString>;
58
+ addOptOutLanguage: z.ZodEffects<z.ZodOptional<z.ZodString>, boolean, string | undefined>;
59
+ optOutLanguage: z.ZodOptional<z.ZodString>;
60
+ language: z.ZodEffects<z.ZodDefault<z.ZodUnion<[z.ZodEnum<["en", "fr", "nl"]>, z.ZodLiteral<"">]>>, "en" | "fr" | "nl", "" | "en" | "fr" | "nl" | undefined>;
37
61
  }, "strip", z.ZodTypeAny, {
62
+ language: "en" | "fr" | "nl";
38
63
  accountSid: string;
39
64
  authToken: string;
65
+ addOptOutLanguage: boolean;
40
66
  fromNumber?: import("libphonenumber-js").E164Number | undefined;
41
67
  messagingServiceSid?: string | undefined;
68
+ optOutLanguage?: string | undefined;
42
69
  }, {
43
70
  accountSid: string;
44
71
  authToken: string;
72
+ language?: "" | "en" | "fr" | "nl" | undefined;
45
73
  fromNumber?: string | undefined;
46
74
  messagingServiceSid?: string | undefined;
75
+ addOptOutLanguage?: string | undefined;
76
+ optOutLanguage?: string | undefined;
47
77
  }>;