@awell-health/awell-extensions 1.0.111 → 1.0.113

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.
Files changed (65) hide show
  1. package/dist/extensions/cloudinary/actions/index.d.ts +1 -0
  2. package/dist/extensions/cloudinary/actions/index.js +3 -1
  3. package/dist/extensions/cloudinary/actions/index.js.map +1 -1
  4. package/dist/extensions/cloudinary/actions/uploadFiles/uploadFiles.test.js +1 -1
  5. package/dist/extensions/cloudinary/actions/uploadFiles/uploadFiles.test.js.map +1 -1
  6. package/dist/extensions/cloudinary/actions/uploadSingleFile/config/dataPoints.d.ts +6 -0
  7. package/dist/extensions/cloudinary/actions/uploadSingleFile/config/dataPoints.js +10 -0
  8. package/dist/extensions/cloudinary/actions/uploadSingleFile/config/dataPoints.js.map +1 -0
  9. package/dist/extensions/cloudinary/actions/uploadSingleFile/config/fields.d.ts +38 -0
  10. package/dist/extensions/cloudinary/actions/uploadSingleFile/config/fields.js +45 -0
  11. package/dist/extensions/cloudinary/actions/uploadSingleFile/config/fields.js.map +1 -0
  12. package/dist/extensions/cloudinary/actions/uploadSingleFile/config/index.d.ts +2 -0
  13. package/dist/extensions/cloudinary/actions/uploadSingleFile/config/index.js +8 -0
  14. package/dist/extensions/cloudinary/actions/uploadSingleFile/config/index.js.map +1 -0
  15. package/dist/extensions/cloudinary/actions/uploadSingleFile/index.d.ts +1 -0
  16. package/dist/extensions/cloudinary/actions/uploadSingleFile/index.js +6 -0
  17. package/dist/extensions/cloudinary/actions/uploadSingleFile/index.js.map +1 -0
  18. package/dist/extensions/cloudinary/actions/uploadSingleFile/uploadSingleFile.d.ts +4 -0
  19. package/dist/extensions/cloudinary/actions/uploadSingleFile/uploadSingleFile.js +69 -0
  20. package/dist/extensions/cloudinary/actions/uploadSingleFile/uploadSingleFile.js.map +1 -0
  21. package/dist/extensions/cloudinary/actions/uploadSingleFile/uploadSingleFile.test.d.ts +1 -0
  22. package/dist/extensions/cloudinary/actions/uploadSingleFile/uploadSingleFile.test.js +32 -0
  23. package/dist/extensions/cloudinary/actions/uploadSingleFile/uploadSingleFile.test.js.map +1 -0
  24. package/dist/extensions/cloudinary/index.js +1 -0
  25. package/dist/extensions/cloudinary/index.js.map +1 -1
  26. package/dist/extensions/index.js +2 -0
  27. package/dist/extensions/index.js.map +1 -1
  28. package/dist/extensions/iterable/index.d.ts +2 -0
  29. package/dist/extensions/iterable/index.js +42 -0
  30. package/dist/extensions/iterable/index.js.map +1 -0
  31. package/dist/extensions/iterable/settings.d.ts +17 -0
  32. package/dist/extensions/iterable/settings.js +19 -0
  33. package/dist/extensions/iterable/settings.js.map +1 -0
  34. package/dist/extensions/iterable/v1/actions/index.d.ts +1 -0
  35. package/dist/extensions/iterable/v1/actions/index.js +6 -0
  36. package/dist/extensions/iterable/v1/actions/index.js.map +1 -0
  37. package/dist/extensions/iterable/v1/actions/sendEmail/config/fields.d.ts +82 -0
  38. package/dist/extensions/iterable/v1/actions/sendEmail/config/fields.js +77 -0
  39. package/dist/extensions/iterable/v1/actions/sendEmail/config/fields.js.map +1 -0
  40. package/dist/extensions/iterable/v1/actions/sendEmail/config/index.d.ts +1 -0
  41. package/dist/extensions/iterable/v1/actions/sendEmail/config/index.js +7 -0
  42. package/dist/extensions/iterable/v1/actions/sendEmail/config/index.js.map +1 -0
  43. package/dist/extensions/iterable/v1/actions/sendEmail/index.d.ts +1 -0
  44. package/dist/extensions/iterable/v1/actions/sendEmail/index.js +6 -0
  45. package/dist/extensions/iterable/v1/actions/sendEmail/index.js.map +1 -0
  46. package/dist/extensions/iterable/v1/actions/sendEmail/sendEmail.d.ts +4 -0
  47. package/dist/extensions/iterable/v1/actions/sendEmail/sendEmail.js +38 -0
  48. package/dist/extensions/iterable/v1/actions/sendEmail/sendEmail.js.map +1 -0
  49. package/dist/extensions/iterable/v1/actions/sendEmail/sendEmail.test.d.ts +1 -0
  50. package/dist/extensions/iterable/v1/actions/sendEmail/sendEmail.test.js +35 -0
  51. package/dist/extensions/iterable/v1/actions/sendEmail/sendEmail.test.js.map +1 -0
  52. package/dist/extensions/iterable/v1/client/client.d.ts +16 -0
  53. package/dist/extensions/iterable/v1/client/client.js +62 -0
  54. package/dist/extensions/iterable/v1/client/client.js.map +1 -0
  55. package/dist/extensions/iterable/v1/client/index.d.ts +1 -0
  56. package/dist/extensions/iterable/v1/client/index.js +18 -0
  57. package/dist/extensions/iterable/v1/client/index.js.map +1 -0
  58. package/dist/extensions/iterable/v1/client/types.d.ts +42 -0
  59. package/dist/extensions/iterable/v1/client/types.js +33 -0
  60. package/dist/extensions/iterable/v1/client/types.js.map +1 -0
  61. package/dist/extensions/iterable/v1/validation.d.ts +2 -0
  62. package/dist/extensions/iterable/v1/validation.js +19 -0
  63. package/dist/extensions/iterable/v1/validation.js.map +1 -0
  64. package/dist/extensions/markdown.json +6 -2
  65. package/package.json +1 -1
@@ -1 +1,2 @@
1
1
  export { uploadFiles } from './uploadFiles';
2
+ export { uploadSingleFile } from './uploadSingleFile';
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.uploadFiles = void 0;
3
+ exports.uploadSingleFile = exports.uploadFiles = void 0;
4
4
  var uploadFiles_1 = require("./uploadFiles");
5
5
  Object.defineProperty(exports, "uploadFiles", { enumerable: true, get: function () { return uploadFiles_1.uploadFiles; } });
6
+ var uploadSingleFile_1 = require("./uploadSingleFile");
7
+ Object.defineProperty(exports, "uploadSingleFile", { enumerable: true, get: function () { return uploadSingleFile_1.uploadSingleFile; } });
6
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/cloudinary/actions/index.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAAlC,0GAAA,WAAW,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/cloudinary/actions/index.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAAlC,0GAAA,WAAW,OAAA;AACpB,uDAAqD;AAA5C,oHAAA,gBAAgB,OAAA"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tests_1 = require("../../../../src/tests");
4
4
  const uploadFiles_1 = require("./uploadFiles");
5
- describe('Upload files action', () => {
5
+ describe('Cloudinary - Upload files', () => {
6
6
  const onComplete = jest.fn();
7
7
  const onError = jest.fn();
8
8
  beforeEach(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"uploadFiles.test.js","sourceRoot":"","sources":["../../../../../extensions/cloudinary/actions/uploadFiles/uploadFiles.test.ts"],"names":[],"mappings":";;AAAA,iDAA2D;AAC3D,+CAA2C;AAE3C,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAEzB,UAAU,CAAC,GAAG,EAAE;QACd,UAAU,CAAC,SAAS,EAAE,CAAA;QACtB,OAAO,CAAC,SAAS,EAAE,CAAA;IACrB,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,yBAAW,CAAC,iBAAiB,CACjC,IAAA,2BAAmB,EAAC;YAClB,MAAM,EAAE;gBACN,YAAY,EAAE,SAAS;gBACvB,MAAM,EAAE,SAAS;gBACjB,IAAI,EAAE,qBAAqB;aAC5B;YACD,QAAQ,EAAE;gBACR,SAAS,EAAE,YAAY;gBACvB,YAAY,EAAE,eAAe;gBAC7B,MAAM,EAAE,eAAe;aACxB;SACF,CAAC,EACF,UAAU,EACV,IAAI,CAAC,EAAE,EAAE,CACV,CAAA;QAED;;WAEG;QACH,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAA;QACzC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAA;IACxC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"uploadFiles.test.js","sourceRoot":"","sources":["../../../../../extensions/cloudinary/actions/uploadFiles/uploadFiles.test.ts"],"names":[],"mappings":";;AAAA,iDAA2D;AAC3D,+CAA2C;AAE3C,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAEzB,UAAU,CAAC,GAAG,EAAE;QACd,UAAU,CAAC,SAAS,EAAE,CAAA;QACtB,OAAO,CAAC,SAAS,EAAE,CAAA;IACrB,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,yBAAW,CAAC,iBAAiB,CACjC,IAAA,2BAAmB,EAAC;YAClB,MAAM,EAAE;gBACN,YAAY,EAAE,SAAS;gBACvB,MAAM,EAAE,SAAS;gBACjB,IAAI,EAAE,qBAAqB;aAC5B;YACD,QAAQ,EAAE;gBACR,SAAS,EAAE,YAAY;gBACvB,YAAY,EAAE,eAAe;gBAC7B,MAAM,EAAE,eAAe;aACxB;SACF,CAAC,EACF,UAAU,EACV,IAAI,CAAC,EAAE,EAAE,CACV,CAAA;QAED;;WAEG;QACH,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAA;QACzC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAA;IACxC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ export declare const dataPoints: {
2
+ fileUrl: {
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
+ fileUrl: {
6
+ key: 'fileUrl',
7
+ valueType: 'string',
8
+ },
9
+ };
10
+ //# sourceMappingURL=dataPoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataPoints.js","sourceRoot":"","sources":["../../../../../../extensions/cloudinary/actions/uploadSingleFile/config/dataPoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,OAAO,EAAE;QACP,GAAG,EAAE,SAAS;QACd,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA"}
@@ -0,0 +1,38 @@
1
+ import { z } from 'zod';
2
+ import { FieldType } from '@awell-health/extensions-core';
3
+ export declare const fields: {
4
+ uploadPreset: {
5
+ id: string;
6
+ label: string;
7
+ description: string;
8
+ type: FieldType.STRING;
9
+ required: false;
10
+ };
11
+ folder: {
12
+ id: string;
13
+ label: string;
14
+ description: string;
15
+ type: FieldType.STRING;
16
+ required: false;
17
+ };
18
+ tags: {
19
+ id: string;
20
+ label: string;
21
+ description: string;
22
+ type: FieldType.STRING;
23
+ required: false;
24
+ };
25
+ };
26
+ export declare const FieldsValidationSchema: z.ZodObject<{
27
+ uploadPreset: z.ZodOptional<z.ZodString>;
28
+ folder: z.ZodOptional<z.ZodString>;
29
+ tags: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string[], string>, string[], string>>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ uploadPreset?: string | undefined;
32
+ folder?: string | undefined;
33
+ tags?: string[] | undefined;
34
+ }, {
35
+ uploadPreset?: string | undefined;
36
+ folder?: string | undefined;
37
+ tags?: string | undefined;
38
+ }>;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldsValidationSchema = exports.fields = void 0;
4
+ const lodash_1 = require("lodash");
5
+ const zod_1 = require("zod");
6
+ const extensions_core_1 = require("@awell-health/extensions-core");
7
+ exports.fields = {
8
+ uploadPreset: {
9
+ id: 'uploadPreset',
10
+ label: 'Upload preset',
11
+ description: 'The name of an upload preset defined for your product environment. If left empty, the preset defined in the extension settings will be used.',
12
+ type: extensions_core_1.FieldType.STRING,
13
+ required: false,
14
+ },
15
+ folder: {
16
+ id: 'folder',
17
+ label: 'Folder',
18
+ description: 'Upload the file to the specified folder. If left empty, the folder defined in the extension settings will be used.',
19
+ type: extensions_core_1.FieldType.STRING,
20
+ required: false,
21
+ },
22
+ tags: {
23
+ id: 'tags',
24
+ label: 'Tags',
25
+ description: 'A comma-separated string of tags to assign to the uploaded asset',
26
+ type: extensions_core_1.FieldType.STRING,
27
+ required: false,
28
+ },
29
+ };
30
+ exports.FieldsValidationSchema = zod_1.z.object({
31
+ uploadPreset: zod_1.z.optional(zod_1.z.string()),
32
+ folder: zod_1.z.optional(zod_1.z.string()),
33
+ tags: zod_1.z.optional(zod_1.z
34
+ .string()
35
+ // Make sure all white spaces are stripped
36
+ .transform((chars) => chars.replace(/\s/g, ''))
37
+ .transform((chars) => chars.split(','))
38
+ // Make sure there are no undefined or empty characteristics
39
+ .transform((charsArray) => charsArray.filter((chars) => {
40
+ if ((0, lodash_1.isNil)(chars) || (0, lodash_1.isEmpty)(chars))
41
+ return false;
42
+ return true;
43
+ }))),
44
+ });
45
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/cloudinary/actions/uploadSingleFile/config/fields.ts"],"names":[],"mappings":";;;AAAA,mCAAuC;AACvC,6BAAwC;AACxC,mEAAqE;AAExD,QAAA,MAAM,GAAG;IACpB,YAAY,EAAE;QACZ,EAAE,EAAE,cAAc;QAClB,KAAK,EAAE,eAAe;QACtB,WAAW,EACT,8IAA8I;QAChJ,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;KAChB;IACD,MAAM,EAAE;QACN,EAAE,EAAE,QAAQ;QACZ,KAAK,EAAE,QAAQ;QACf,WAAW,EACT,oHAAoH;QACtH,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;KAChB;IACD,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,MAAM;QACb,WAAW,EACT,kEAAkE;QACpE,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;KAChB;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,YAAY,EAAE,OAAC,CAAC,QAAQ,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;IACpC,MAAM,EAAE,OAAC,CAAC,QAAQ,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;IAC9B,IAAI,EAAE,OAAC,CAAC,QAAQ,CACd,OAAC;SACE,MAAM,EAAE;QACT,0CAA0C;SACzC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;SAC9C,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACvC,4DAA4D;SAC3D,SAAS,CAAC,CAAC,UAAU,EAAE,EAAE,CACxB,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QAC1B,IAAI,IAAA,cAAK,EAAC,KAAK,CAAC,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC;YAAE,OAAO,KAAK,CAAA;QAEhD,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CACH,CACJ;CACgD,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { fields } from './fields';
2
+ export { dataPoints } from './dataPoints';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataPoints = exports.fields = void 0;
4
+ var fields_1 = require("./fields");
5
+ Object.defineProperty(exports, "fields", { enumerable: true, get: function () { return fields_1.fields; } });
6
+ var dataPoints_1 = require("./dataPoints");
7
+ Object.defineProperty(exports, "dataPoints", { enumerable: true, get: function () { return dataPoints_1.dataPoints; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/cloudinary/actions/uploadSingleFile/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAiC;AAAxB,gGAAA,MAAM,OAAA;AACf,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
@@ -0,0 +1 @@
1
+ export { uploadSingleFile } from './uploadSingleFile';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uploadSingleFile = void 0;
4
+ var uploadSingleFile_1 = require("./uploadSingleFile");
5
+ Object.defineProperty(exports, "uploadSingleFile", { enumerable: true, get: function () { return uploadSingleFile_1.uploadSingleFile; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/cloudinary/actions/uploadSingleFile/index.ts"],"names":[],"mappings":";;;AAAA,uDAAqD;AAA5C,oHAAA,gBAAgB,OAAA"}
@@ -0,0 +1,4 @@
1
+ import { type Action } from '@awell-health/extensions-core';
2
+ import { type settings } from '../../settings';
3
+ import { fields } from './config';
4
+ export declare const uploadSingleFile: Action<typeof fields, typeof settings>;
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uploadSingleFile = void 0;
4
+ const extensions_core_1 = require("@awell-health/extensions-core");
5
+ const settings_1 = require("../../settings");
6
+ const config_1 = require("./config");
7
+ const zod_validation_error_1 = require("zod-validation-error");
8
+ const zod_1 = require("zod");
9
+ const fields_1 = require("./config/fields");
10
+ exports.uploadSingleFile = {
11
+ key: 'uploadSingleFile',
12
+ title: 'Upload single file',
13
+ description: 'Allow a stakeholder to upload one file',
14
+ category: extensions_core_1.Category.CONTENT_AND_FILES,
15
+ fields: config_1.fields,
16
+ options: {
17
+ stakeholders: {
18
+ label: 'Stakeholder',
19
+ mode: 'single',
20
+ },
21
+ },
22
+ previewable: false,
23
+ onActivityCreated: async (payload, onComplete, onError) => {
24
+ try {
25
+ (0, extensions_core_1.validate)({
26
+ schema: zod_1.z.object({
27
+ settings: settings_1.SettingsValidationSchema,
28
+ fields: fields_1.FieldsValidationSchema,
29
+ }),
30
+ payload,
31
+ });
32
+ /**
33
+ * Completion happens in Awell Hosted Pages
34
+ */
35
+ }
36
+ catch (err) {
37
+ if (err instanceof zod_1.ZodError) {
38
+ const error = (0, zod_validation_error_1.fromZodError)(err);
39
+ await onError({
40
+ events: [
41
+ {
42
+ date: new Date().toISOString(),
43
+ text: { en: error.name },
44
+ error: {
45
+ category: 'WRONG_INPUT',
46
+ message: `${error.message}`,
47
+ },
48
+ },
49
+ ],
50
+ });
51
+ return;
52
+ }
53
+ const error = err;
54
+ await onError({
55
+ events: [
56
+ {
57
+ date: new Date().toISOString(),
58
+ text: { en: 'Something went wrong while orchestration the action' },
59
+ error: {
60
+ category: 'SERVER_ERROR',
61
+ message: error.message,
62
+ },
63
+ },
64
+ ],
65
+ });
66
+ }
67
+ },
68
+ };
69
+ //# sourceMappingURL=uploadSingleFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploadSingleFile.js","sourceRoot":"","sources":["../../../../../extensions/cloudinary/actions/uploadSingleFile/uploadSingleFile.ts"],"names":[],"mappings":";;;AACA,mEAAkE;AAClE,6CAAwE;AACxE,qCAAiC;AACjC,+DAAmD;AACnD,6BAAiC;AACjC,4CAAwD;AAE3C,QAAA,gBAAgB,GAA2C;IACtE,GAAG,EAAE,kBAAkB;IACvB,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EAAE,wCAAwC;IACrD,QAAQ,EAAE,0BAAQ,CAAC,iBAAiB;IACpC,MAAM,EAAN,eAAM;IACN,OAAO,EAAE;QACP,YAAY,EAAE;YACZ,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,QAAQ;SACf;KACF;IACD,WAAW,EAAE,KAAK;IAClB,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;QACxD,IAAI;YACF,IAAA,0BAAQ,EAAC;gBACP,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;oBACf,QAAQ,EAAE,mCAAwB;oBAClC,MAAM,EAAE,+BAAsB;iBAC/B,CAAC;gBACF,OAAO;aACR,CAAC,CAAA;YAEF;;eAEG;SACJ;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;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"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tests_1 = require("../../../../src/tests");
4
+ const uploadSingleFile_1 = require("./uploadSingleFile");
5
+ describe('Cloudinary - Upload single file', () => {
6
+ const onComplete = jest.fn();
7
+ const onError = jest.fn();
8
+ beforeEach(() => {
9
+ onComplete.mockClear();
10
+ onError.mockClear();
11
+ });
12
+ test('Should not call the onComplete callback', async () => {
13
+ await uploadSingleFile_1.uploadSingleFile.onActivityCreated((0, tests_1.generateTestPayload)({
14
+ fields: {
15
+ uploadPreset: undefined,
16
+ folder: undefined,
17
+ tags: 'tag-1, tag-2, tag-3',
18
+ },
19
+ settings: {
20
+ cloudName: 'cloud-name',
21
+ uploadPreset: 'upload-preset',
22
+ folder: 'variant-label',
23
+ },
24
+ }), onComplete, jest.fn());
25
+ /**
26
+ * Because completion is done in Awell Hosted Pages
27
+ */
28
+ expect(onComplete).not.toHaveBeenCalled();
29
+ expect(onError).not.toHaveBeenCalled();
30
+ });
31
+ });
32
+ //# sourceMappingURL=uploadSingleFile.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploadSingleFile.test.js","sourceRoot":"","sources":["../../../../../extensions/cloudinary/actions/uploadSingleFile/uploadSingleFile.test.ts"],"names":[],"mappings":";;AAAA,iDAA2D;AAC3D,yDAAqD;AAErD,QAAQ,CAAC,iCAAiC,EAAE,GAAG,EAAE;IAC/C,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAEzB,UAAU,CAAC,GAAG,EAAE;QACd,UAAU,CAAC,SAAS,EAAE,CAAA;QACtB,OAAO,CAAC,SAAS,EAAE,CAAA;IACrB,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,mCAAgB,CAAC,iBAAiB,CACtC,IAAA,2BAAmB,EAAC;YAClB,MAAM,EAAE;gBACN,YAAY,EAAE,SAAS;gBACvB,MAAM,EAAE,SAAS;gBACjB,IAAI,EAAE,qBAAqB;aAC5B;YACD,QAAQ,EAAE;gBACR,SAAS,EAAE,YAAY;gBACvB,YAAY,EAAE,eAAe;gBAC7B,MAAM,EAAE,eAAe;aACxB;SACF,CAAC,EACF,UAAU,EACV,IAAI,CAAC,EAAE,EAAE,CACV,CAAA;QAED;;WAEG;QACH,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAA;QACzC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAA;IACxC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -15,6 +15,7 @@ exports.Cloudinary = {
15
15
  },
16
16
  actions: {
17
17
  uploadFiles: actions_1.uploadFiles,
18
+ uploadSingleFile: actions_1.uploadSingleFile,
18
19
  },
19
20
  settings: settings_1.settings,
20
21
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/cloudinary/index.ts"],"names":[],"mappings":";;;AACA,mEAAoE;AACpE,uCAAuC;AACvC,yCAAqC;AAExB,QAAA,UAAU,GAAc;IACnC,GAAG,EAAE,YAAY;IACjB,KAAK,EAAE,YAAY;IACnB,QAAQ,EACN,6GAA6G;IAC/G,WAAW,EACT,6HAA6H;IAC/H,QAAQ,EAAE,0BAAQ,CAAC,iBAAiB;IACpC,MAAM,EAAE;QACN,UAAU,EAAE,4BAAU,CAAC,KAAK;KAC7B;IACD,OAAO,EAAE;QACP,WAAW,EAAX,qBAAW;KACZ;IACD,QAAQ,EAAR,mBAAQ;CACT,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/cloudinary/index.ts"],"names":[],"mappings":";;;AACA,mEAAoE;AACpE,uCAAyD;AACzD,yCAAqC;AAExB,QAAA,UAAU,GAAc;IACnC,GAAG,EAAE,YAAY;IACjB,KAAK,EAAE,YAAY;IACnB,QAAQ,EACN,6GAA6G;IAC/G,WAAW,EACT,6HAA6H;IAC/H,QAAQ,EAAE,0BAAQ,CAAC,iBAAiB;IACpC,MAAM,EAAE;QACN,UAAU,EAAE,4BAAU,CAAC,KAAK;KAC7B;IACD,OAAO,EAAE;QACP,WAAW,EAAX,qBAAW;QACX,gBAAgB,EAAhB,0BAAgB;KACjB;IACD,QAAQ,EAAR,mBAAQ;CACT,CAAA"}
@@ -47,6 +47,7 @@ const docuSign_1 = require("./docuSign");
47
47
  const sendbird_1 = require("./sendbird");
48
48
  const zusHealth_1 = require("./zusHealth");
49
49
  const transform_1 = require("./transform");
50
+ const iterable_1 = require("./iterable");
50
51
  const json = __importStar(require("./markdown.json"));
51
52
  exports.markdown = json;
52
53
  exports.extensions = [
@@ -73,5 +74,6 @@ exports.extensions = [
73
74
  docuSign_1.DocuSign,
74
75
  sendbird_1.Sendbird,
75
76
  zusHealth_1.ZusHealth,
77
+ iterable_1.Iterable,
76
78
  ];
77
79
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../extensions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kCAAkC;AAClC,mCAA+B;AAC/B,2CAAuC;AACvC,mDAA+C;AAC/C,6CAAyC;AACzC,+CAA2C;AAC3C,uCAAmC;AACnC,yCAAqC;AACrC,yCAAqC;AACrC,+CAA0C;AAC1C,2CAAuC;AACvC,uCAAmC;AACnC,iCAAsC;AACtC,+CAA2C;AAC3C,2CAAuC;AACvC,qCAAiC;AACjC,yCAAqC;AACrC,6DAA+C;AAC/C,yCAAqC;AACrC,yCAAqC;AACrC,yCAAqC;AACrC,2CAAuC;AACvC,2CAAuC;AAEvC,sDAAuC;AAG1B,QAAA,QAAQ,GAAa,IAAI,CAAA;AAEzB,QAAA,UAAU,GAAG;IACxB,oFAAoF;IACpF,aAAK;IACL,qBAAS;IACT,6BAAa;IACb,uBAAU;IACV,yBAAW;IACX,iBAAO;IACP,mBAAQ;IACR,mBAAQ;IACR,wBAAU;IACV,qBAAS;IACT,iBAAO;IACP,oBAAa;IACb,yBAAW;IACX,qBAAS;IACT,qBAAS;IACT,eAAM;IACN,mBAAQ;IACR,6BAAQ;IACR,mBAAQ;IACR,mBAAQ;IACR,mBAAQ;IACR,qBAAS;CACV,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../extensions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kCAAkC;AAClC,mCAA+B;AAC/B,2CAAuC;AACvC,mDAA+C;AAC/C,6CAAyC;AACzC,+CAA2C;AAC3C,uCAAmC;AACnC,yCAAqC;AACrC,yCAAqC;AACrC,+CAA0C;AAC1C,2CAAuC;AACvC,uCAAmC;AACnC,iCAAsC;AACtC,+CAA2C;AAC3C,2CAAuC;AACvC,qCAAiC;AACjC,yCAAqC;AACrC,6DAA+C;AAC/C,yCAAqC;AACrC,yCAAqC;AACrC,yCAAqC;AACrC,2CAAuC;AACvC,2CAAuC;AACvC,yCAAqC;AAErC,sDAAuC;AAG1B,QAAA,QAAQ,GAAa,IAAI,CAAA;AAEzB,QAAA,UAAU,GAAG;IACxB,oFAAoF;IACpF,aAAK;IACL,qBAAS;IACT,6BAAa;IACb,uBAAU;IACV,yBAAW;IACX,iBAAO;IACP,mBAAQ;IACR,mBAAQ;IACR,wBAAU;IACV,qBAAS;IACT,iBAAO;IACP,oBAAa;IACb,yBAAW;IACX,qBAAS;IACT,qBAAS;IACT,eAAM;IACN,mBAAQ;IACR,6BAAQ;IACR,mBAAQ;IACR,mBAAQ;IACR,mBAAQ;IACR,qBAAS;IACT,mBAAQ;CACT,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { type Extension } from '@awell-health/extensions-core';
2
+ export declare const Iterable: Extension;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.Iterable = void 0;
27
+ const extensions_core_1 = require("@awell-health/extensions-core");
28
+ const actions = __importStar(require("./v1/actions"));
29
+ const settings_1 = require("./settings");
30
+ exports.Iterable = {
31
+ key: 'iterable',
32
+ title: 'Iterable',
33
+ icon_url: 'https://res.cloudinary.com/da7x4rzl4/image/upload/v1696933028/Awell%20Extensions/logo_1668536435066.jpg',
34
+ description: 'Iterable is an email marketing automation platform that allows creating, sending, and tracking personalized email campaigns.',
35
+ category: extensions_core_1.Category.COMMUNICATION,
36
+ author: {
37
+ authorType: extensions_core_1.AuthorType.AWELL,
38
+ },
39
+ actions,
40
+ settings: settings_1.settings,
41
+ };
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/iterable/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,mEAAoE;AACpE,sDAAuC;AACvC,yCAAqC;AAExB,QAAA,QAAQ,GAAc;IACjC,GAAG,EAAE,UAAU;IACf,KAAK,EAAE,UAAU;IACjB,QAAQ,EACN,yGAAyG;IAC3G,WAAW,EACT,8HAA8H;IAChI,QAAQ,EAAE,0BAAQ,CAAC,aAAa;IAChC,MAAM,EAAE;QACN,UAAU,EAAE,4BAAU,CAAC,KAAK;KAC7B;IACD,OAAO;IACP,QAAQ,EAAR,mBAAQ;CACT,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ export declare const settings: {
3
+ apiKey: {
4
+ label: string;
5
+ key: string;
6
+ obfuscated: true;
7
+ required: true;
8
+ description: string;
9
+ };
10
+ };
11
+ export declare const SettingsValidationSchema: z.ZodObject<{
12
+ apiKey: z.ZodString;
13
+ }, "strip", z.ZodTypeAny, {
14
+ apiKey: string;
15
+ }, {
16
+ apiKey: string;
17
+ }>;
@@ -0,0 +1,19 @@
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
+ apiKey: {
7
+ label: 'API key',
8
+ key: 'apiKey',
9
+ obfuscated: true,
10
+ required: true,
11
+ description: 'API key used to authenticate with the Iterable API',
12
+ },
13
+ };
14
+ exports.SettingsValidationSchema = zod_1.z.object({
15
+ apiKey: zod_1.z.string().nonempty({
16
+ message: 'Missing API key in the extension settings.',
17
+ }),
18
+ });
19
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../extensions/iterable/settings.ts"],"names":[],"mappings":";;;AACA,6BAAwC;AAE3B,QAAA,QAAQ,GAAG;IACtB,MAAM,EAAE;QACN,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,QAAQ;QACb,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,oDAAoD;KAClE;CACgC,CAAA;AAEtB,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC;QAC1B,OAAO,EAAE,4CAA4C;KACtD,CAAC;CACiD,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export { sendEmail } from './sendEmail';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sendEmail = void 0;
4
+ var sendEmail_1 = require("./sendEmail");
5
+ Object.defineProperty(exports, "sendEmail", { enumerable: true, get: function () { return sendEmail_1.sendEmail; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/iterable/v1/actions/index.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AAA9B,sGAAA,SAAS,OAAA"}
@@ -0,0 +1,82 @@
1
+ import { z } from 'zod';
2
+ import { FieldType } from '@awell-health/extensions-core';
3
+ export declare const fields: {
4
+ campaignId: {
5
+ label: string;
6
+ id: string;
7
+ type: FieldType.NUMERIC;
8
+ required: true;
9
+ description: string;
10
+ };
11
+ recipientEmail: {
12
+ label: string;
13
+ id: string;
14
+ type: FieldType.STRING;
15
+ required: false;
16
+ description: string;
17
+ };
18
+ recipientUserId: {
19
+ label: string;
20
+ id: string;
21
+ type: FieldType.STRING;
22
+ required: false;
23
+ description: string;
24
+ };
25
+ dataFields: {
26
+ label: string;
27
+ id: string;
28
+ type: FieldType.JSON;
29
+ required: false;
30
+ description: string;
31
+ };
32
+ allowRepeatMarketingSends: {
33
+ label: string;
34
+ id: string;
35
+ type: FieldType.BOOLEAN;
36
+ required: false;
37
+ description: string;
38
+ };
39
+ metadata: {
40
+ label: string;
41
+ id: string;
42
+ type: FieldType.JSON;
43
+ required: false;
44
+ description: string;
45
+ };
46
+ };
47
+ export declare const FieldsValidationSchema: z.ZodEffects<z.ZodObject<{
48
+ campaignId: z.ZodNumber;
49
+ recipientEmail: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodEffects<z.ZodLiteral<"">, undefined, "">]>;
50
+ recipientUserId: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodEffects<z.ZodLiteral<"">, undefined, "">]>;
51
+ dataFields: z.ZodUnion<[z.ZodOptional<z.ZodEffects<z.ZodString, Record<string, any>, string>>, z.ZodEffects<z.ZodLiteral<"">, undefined, "">]>;
52
+ allowRepeatMarketingSends: z.ZodOptional<z.ZodBoolean>;
53
+ metadata: z.ZodUnion<[z.ZodOptional<z.ZodEffects<z.ZodString, Record<string, any>, string>>, z.ZodEffects<z.ZodLiteral<"">, undefined, "">]>;
54
+ }, "strip", z.ZodTypeAny, {
55
+ campaignId: number;
56
+ recipientEmail?: string | undefined;
57
+ recipientUserId?: string | undefined;
58
+ dataFields?: Record<string, any> | undefined;
59
+ allowRepeatMarketingSends?: boolean | undefined;
60
+ metadata?: Record<string, any> | undefined;
61
+ }, {
62
+ campaignId: number;
63
+ recipientEmail?: string | undefined;
64
+ recipientUserId?: string | undefined;
65
+ dataFields?: string | undefined;
66
+ allowRepeatMarketingSends?: boolean | undefined;
67
+ metadata?: string | undefined;
68
+ }>, {
69
+ campaignId: number;
70
+ recipientEmail?: string | undefined;
71
+ recipientUserId?: string | undefined;
72
+ dataFields?: Record<string, any> | undefined;
73
+ allowRepeatMarketingSends?: boolean | undefined;
74
+ metadata?: Record<string, any> | undefined;
75
+ }, {
76
+ campaignId: number;
77
+ recipientEmail?: string | undefined;
78
+ recipientUserId?: string | undefined;
79
+ dataFields?: string | undefined;
80
+ allowRepeatMarketingSends?: boolean | undefined;
81
+ metadata?: string | undefined;
82
+ }>;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldsValidationSchema = exports.fields = void 0;
4
+ const zod_1 = require("zod");
5
+ const extensions_core_1 = require("@awell-health/extensions-core");
6
+ const lodash_1 = require("lodash");
7
+ const validation_1 = require("../../../validation");
8
+ exports.fields = {
9
+ campaignId: {
10
+ label: 'Campaign ID',
11
+ id: 'campaignId',
12
+ type: extensions_core_1.FieldType.NUMERIC,
13
+ required: true,
14
+ description: '',
15
+ },
16
+ recipientEmail: {
17
+ label: 'Recipient email',
18
+ id: 'recipientEmail',
19
+ type: extensions_core_1.FieldType.STRING,
20
+ required: false,
21
+ description: 'An email address that identifies a user profile in Iterable. Provide a recipient email or a recipient user ID, but not both, depending on how your project identifies users.',
22
+ },
23
+ recipientUserId: {
24
+ label: 'Recipient user ID',
25
+ id: 'recipientUserId',
26
+ type: extensions_core_1.FieldType.STRING,
27
+ required: false,
28
+ description: 'A user ID that identifies a user profile in Iterable. Provide a recipient email or a recipient user ID, but not both, depending on how your project identifies users.',
29
+ },
30
+ dataFields: {
31
+ label: 'Data fields',
32
+ id: 'dataFields',
33
+ type: extensions_core_1.FieldType.JSON,
34
+ required: false,
35
+ description: 'Fields to merge into email template.',
36
+ },
37
+ allowRepeatMarketingSends: {
38
+ label: 'Allow repeat marketing sends?',
39
+ id: 'allowRepeatMarketingSends',
40
+ type: extensions_core_1.FieldType.BOOLEAN,
41
+ required: false,
42
+ description: 'Defaults to true.',
43
+ },
44
+ metadata: {
45
+ label: 'Metadata',
46
+ id: 'metadata',
47
+ type: extensions_core_1.FieldType.JSON,
48
+ required: false,
49
+ description: 'Metadata to pass back via webhooks. Not used for rendering.',
50
+ },
51
+ };
52
+ exports.FieldsValidationSchema = zod_1.z
53
+ .object({
54
+ campaignId: extensions_core_1.NumericIdSchema,
55
+ recipientEmail: (0, extensions_core_1.makeStringOptional)(zod_1.z.string().email()),
56
+ recipientUserId: (0, extensions_core_1.makeStringOptional)(zod_1.z.string()),
57
+ dataFields: (0, extensions_core_1.makeStringOptional)(validation_1.StringTransformToJson),
58
+ allowRepeatMarketingSends: zod_1.z.boolean().optional(),
59
+ metadata: (0, extensions_core_1.makeStringOptional)(validation_1.StringTransformToJson),
60
+ })
61
+ .superRefine((value, context) => {
62
+ if ((0, lodash_1.isEmpty)(value.recipientEmail) && (0, lodash_1.isEmpty)(value.recipientUserId)) {
63
+ context.addIssue({
64
+ code: zod_1.z.ZodIssueCode.custom,
65
+ fatal: true,
66
+ message: 'Both "recipient email" and "recipient user ID" are empty. Please provide one of them.',
67
+ });
68
+ }
69
+ if (!(0, lodash_1.isEmpty)(value.recipientEmail) && !(0, lodash_1.isEmpty)(value.recipientUserId)) {
70
+ context.addIssue({
71
+ code: zod_1.z.ZodIssueCode.custom,
72
+ fatal: true,
73
+ message: 'Both "recipient email" and "recipient user ID" are provided. Please provide only one of them.',
74
+ });
75
+ }
76
+ });
77
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/iterable/v1/actions/sendEmail/config/fields.ts"],"names":[],"mappings":";;;AAAA,6BAAwC;AACxC,mEAKsC;AACtC,mCAAgC;AAChC,oDAA2D;AAE9C,QAAA,MAAM,GAAG;IACpB,UAAU,EAAE;QACV,KAAK,EAAE,aAAa;QACpB,EAAE,EAAE,YAAY;QAChB,IAAI,EAAE,2BAAS,CAAC,OAAO;QACvB,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,EAAE;KAChB;IACD,cAAc,EAAE;QACd,KAAK,EAAE,iBAAiB;QACxB,EAAE,EAAE,gBAAgB;QACpB,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;QACf,WAAW,EACT,8KAA8K;KACjL;IACD,eAAe,EAAE;QACf,KAAK,EAAE,mBAAmB;QAC1B,EAAE,EAAE,iBAAiB;QACrB,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;QACf,WAAW,EACT,uKAAuK;KAC1K;IACD,UAAU,EAAE;QACV,KAAK,EAAE,aAAa;QACpB,EAAE,EAAE,YAAY;QAChB,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,sCAAsC;KACpD;IACD,yBAAyB,EAAE;QACzB,KAAK,EAAE,+BAA+B;QACtC,EAAE,EAAE,2BAA2B;QAC/B,IAAI,EAAE,2BAAS,CAAC,OAAO;QACvB,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,mBAAmB;KACjC;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,UAAU;QACjB,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,6DAA6D;KAC3E;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC;KACpC,MAAM,CAAC;IACN,UAAU,EAAE,iCAAe;IAC3B,cAAc,EAAE,IAAA,oCAAkB,EAAC,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC;IACtD,eAAe,EAAE,IAAA,oCAAkB,EAAC,OAAC,CAAC,MAAM,EAAE,CAAC;IAC/C,UAAU,EAAE,IAAA,oCAAkB,EAAC,kCAAqB,CAAC;IACrD,yBAAyB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACjD,QAAQ,EAAE,IAAA,oCAAkB,EAAC,kCAAqB,CAAC;CACF,CAAC;KACnD,WAAW,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IAC9B,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC,cAAc,CAAC,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC,eAAe,CAAC,EAAE;QACnE,OAAO,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,KAAK,EAAE,IAAI;YACX,OAAO,EACL,uFAAuF;SAC1F,CAAC,CAAA;KACH;IAED,IAAI,CAAC,IAAA,gBAAO,EAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,IAAA,gBAAO,EAAC,KAAK,CAAC,eAAe,CAAC,EAAE;QACrE,OAAO,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,KAAK,EAAE,IAAI;YACX,OAAO,EACL,+FAA+F;SAClG,CAAC,CAAA;KACH;AACH,CAAC,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export { FieldsValidationSchema, fields } from './fields';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fields = exports.FieldsValidationSchema = void 0;
4
+ var fields_1 = require("./fields");
5
+ Object.defineProperty(exports, "FieldsValidationSchema", { enumerable: true, get: function () { return fields_1.FieldsValidationSchema; } });
6
+ Object.defineProperty(exports, "fields", { enumerable: true, get: function () { return fields_1.fields; } });
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../extensions/iterable/v1/actions/sendEmail/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gHAAA,sBAAsB,OAAA;AAAE,gGAAA,MAAM,OAAA"}
@@ -0,0 +1 @@
1
+ export { sendEmail } from './sendEmail';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sendEmail = void 0;
4
+ var sendEmail_1 = require("./sendEmail");
5
+ Object.defineProperty(exports, "sendEmail", { enumerable: true, get: function () { return sendEmail_1.sendEmail; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/iterable/v1/actions/sendEmail/index.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AAA9B,sGAAA,SAAS,OAAA"}
@@ -0,0 +1,4 @@
1
+ import { type Action } from '@awell-health/extensions-core';
2
+ import { type settings } from '../../../settings';
3
+ import { fields } from './config';
4
+ export declare const sendEmail: Action<typeof fields, typeof settings>;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sendEmail = void 0;
4
+ const zod_1 = require("zod");
5
+ const extensions_core_1 = require("@awell-health/extensions-core");
6
+ const settings_1 = require("../../../settings");
7
+ const config_1 = require("./config");
8
+ const client_1 = require("../../client");
9
+ exports.sendEmail = {
10
+ key: 'sendEmail',
11
+ title: 'Send email',
12
+ description: 'Send an email to a specific email address.',
13
+ category: extensions_core_1.Category.COMMUNICATION,
14
+ fields: config_1.fields,
15
+ previewable: false,
16
+ onActivityCreated: async (payload, onComplete, onError) => {
17
+ const { settings: { apiKey }, fields: { campaignId, recipientEmail, recipientUserId, dataFields, allowRepeatMarketingSends, metadata, }, } = (0, extensions_core_1.validate)({
18
+ schema: zod_1.z.object({
19
+ settings: settings_1.SettingsValidationSchema,
20
+ fields: config_1.FieldsValidationSchema,
21
+ }),
22
+ payload,
23
+ });
24
+ const client = new client_1.IterableClient({
25
+ apiKey,
26
+ });
27
+ await client.emailApi.sendEmail({
28
+ campaignId,
29
+ recipientEmail,
30
+ recipientUserId,
31
+ dataFields,
32
+ allowRepeatMarketingSends,
33
+ metadata,
34
+ });
35
+ await onComplete();
36
+ },
37
+ };
38
+ //# sourceMappingURL=sendEmail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendEmail.js","sourceRoot":"","sources":["../../../../../../extensions/iterable/v1/actions/sendEmail/sendEmail.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAGvB,mEAAkE;AAClE,gDAA4D;AAC5D,qCAAyD;AACzD,yCAA6C;AAEhC,QAAA,SAAS,GAA2C;IAC/D,GAAG,EAAE,WAAW;IAChB,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,4CAA4C;IACzD,QAAQ,EAAE,0BAAQ,CAAC,aAAa;IAChC,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK;IAClB,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;QACxD,MAAM,EACJ,QAAQ,EAAE,EAAE,MAAM,EAAE,EACpB,MAAM,EAAE,EACN,UAAU,EACV,cAAc,EACd,eAAe,EACf,UAAU,EACV,yBAAyB,EACzB,QAAQ,GACT,GACF,GAAG,IAAA,0BAAQ,EAAC;YACX,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;gBACf,QAAQ,EAAE,mCAAwB;gBAClC,MAAM,EAAE,+BAAsB;aAC/B,CAAC;YACF,OAAO;SACR,CAAC,CAAA;QAEF,MAAM,MAAM,GAAG,IAAI,uBAAc,CAAC;YAChC,MAAM;SACP,CAAC,CAAA;QAEF,MAAM,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;YAC9B,UAAU;YACV,cAAc;YACd,eAAe;YACf,UAAU;YACV,yBAAyB;YACzB,QAAQ;SACT,CAAC,CAAA;QAEF,MAAM,UAAU,EAAE,CAAA;IACpB,CAAC;CACF,CAAA"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const __mocks__1 = require("../../client/__mocks__");
4
+ const __1 = require("..");
5
+ const tests_1 = require("../../../../../src/tests");
6
+ jest.mock('../../client');
7
+ describe('Send email', () => {
8
+ const onComplete = jest.fn();
9
+ const onError = jest.fn();
10
+ const basePayload = (0, tests_1.generateTestPayload)({
11
+ fields: {
12
+ campaignId: __mocks__1.mockedSendEmailData.campaignId,
13
+ recipientEmail: __mocks__1.mockedSendEmailData.recipientEmail,
14
+ recipientUserId: __mocks__1.mockedSendEmailData.recipientUserId,
15
+ allowRepeatMarketingSends: __mocks__1.mockedSendEmailData.allowRepeatMarketingSends,
16
+ dataFields: JSON.stringify(__mocks__1.mockedSendEmailData.dataFields),
17
+ metadata: JSON.stringify(__mocks__1.mockedSendEmailData.metadata),
18
+ },
19
+ settings: {
20
+ apiKey: 'apiKey',
21
+ },
22
+ });
23
+ beforeEach(() => {
24
+ jest.clearAllMocks();
25
+ });
26
+ test('Should call the onComplete callback', async () => {
27
+ await __1.sendEmail.onActivityCreated(basePayload, onComplete, onError);
28
+ expect(__mocks__1.IterableClientMockImplementation.emailApi.sendEmail).toHaveBeenCalledWith({
29
+ ...__mocks__1.mockedSendEmailData,
30
+ });
31
+ expect(onComplete).toHaveBeenCalled();
32
+ expect(onError).not.toHaveBeenCalled();
33
+ });
34
+ });
35
+ //# sourceMappingURL=sendEmail.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendEmail.test.js","sourceRoot":"","sources":["../../../../../../extensions/iterable/v1/actions/sendEmail/sendEmail.test.ts"],"names":[],"mappings":";;AAAA,qDAG+B;AAC/B,0BAA8B;AAC9B,oDAA8D;AAE9D,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;AAEzB,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAEzB,MAAM,WAAW,GAAG,IAAA,2BAAmB,EAAC;QACtC,MAAM,EAAE;YACN,UAAU,EAAE,8BAAmB,CAAC,UAAU;YAC1C,cAAc,EAAE,8BAAmB,CAAC,cAAc;YAClD,eAAe,EAAE,8BAAmB,CAAC,eAAe;YACpD,yBAAyB,EAAE,8BAAmB,CAAC,yBAAyB;YACxE,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,8BAAmB,CAAC,UAAU,CAAC;YAC1D,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,8BAAmB,CAAC,QAAQ,CAAC;SACvD;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,QAAQ;SACjB;KACF,CAAC,CAAA;IAEF,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,aAAa,EAAE,CAAA;IACtB,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,qCAAqC,EAAE,KAAK,IAAI,EAAE;QACrD,MAAM,aAAS,CAAC,iBAAiB,CAAC,WAAW,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;QAEnE,MAAM,CACJ,2CAAgC,CAAC,QAAQ,CAAC,SAAS,CACpD,CAAC,oBAAoB,CAAC;YACrB,GAAG,8BAAmB;SACvB,CAAC,CAAA;QACF,MAAM,CAAC,UAAU,CAAC,CAAC,gBAAgB,EAAE,CAAA;QACrC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAA;IACxC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { type AxiosResponse } from 'axios';
2
+ import { type ApiResponse, type SendEmailRequest } from './types';
3
+ declare class IterableEmailAPI {
4
+ private readonly _baseApi;
5
+ constructor({ apiKey }: {
6
+ apiKey: string;
7
+ });
8
+ sendEmail: (body: SendEmailRequest) => Promise<AxiosResponse<ApiResponse>>;
9
+ }
10
+ export declare class IterableClient {
11
+ readonly emailApi: IterableEmailAPI;
12
+ constructor({ apiKey }: {
13
+ apiKey: string;
14
+ });
15
+ }
16
+ export {};
@@ -0,0 +1,62 @@
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.IterableClient = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ class IterableBaseAPI {
9
+ constructor({ baseUrl, apiKey }) {
10
+ this.post = async (url, { body }) => {
11
+ return await axios_1.default.post(`${this._baseUrl}/${url}`, body, {
12
+ headers: this._headers,
13
+ });
14
+ };
15
+ this.put = async (url, { body }) => {
16
+ return await axios_1.default.put(`${this._baseUrl}/${url}`, body, {
17
+ headers: this._headers,
18
+ });
19
+ };
20
+ this.patch = async (url, { body }) => {
21
+ return await axios_1.default.patch(`${this._baseUrl}/${url}`, body, {
22
+ headers: this._headers,
23
+ });
24
+ };
25
+ this.get = async (url) => {
26
+ return await axios_1.default.get(`${this._baseUrl}/${url}`, {
27
+ headers: this._headers,
28
+ });
29
+ };
30
+ this.delete = async (url) => {
31
+ return await axios_1.default.delete(`${this._baseUrl}/${url}`, {
32
+ headers: this._headers,
33
+ });
34
+ };
35
+ this._baseUrl = baseUrl;
36
+ this._apiKey = apiKey;
37
+ this._headers = {
38
+ 'Content-Type': 'application/json; charset=utf8',
39
+ 'Api-Key': this._apiKey,
40
+ };
41
+ }
42
+ }
43
+ class IterableEmailAPI {
44
+ constructor({ apiKey }) {
45
+ this.sendEmail = async (body) => {
46
+ return await this._baseApi.post('target', {
47
+ body,
48
+ });
49
+ };
50
+ this._baseApi = new IterableBaseAPI({
51
+ baseUrl: `https://api.iterable.com/api/email`,
52
+ apiKey,
53
+ });
54
+ }
55
+ }
56
+ class IterableClient {
57
+ constructor({ apiKey }) {
58
+ this.emailApi = new IterableEmailAPI({ apiKey });
59
+ }
60
+ }
61
+ exports.IterableClient = IterableClient;
62
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../extensions/iterable/v1/client/client.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAiD;AAGjD,MAAM,eAAe;IAKnB,YAAY,EAAE,OAAO,EAAE,MAAM,EAAuC;QASpE,SAAI,GAAG,KAAK,EACV,GAAW,EACX,EAAE,IAAI,EAAe,EACM,EAAE;YAC7B,OAAO,MAAM,eAAK,CAAC,IAAI,CAAI,GAAG,IAAI,CAAC,QAAQ,IAAI,GAAG,EAAE,EAAE,IAAI,EAAE;gBAC1D,OAAO,EAAE,IAAI,CAAC,QAAQ;aACvB,CAAC,CAAA;QACJ,CAAC,CAAA;QAED,QAAG,GAAG,KAAK,EACT,GAAW,EACX,EAAE,IAAI,EAAe,EACM,EAAE;YAC7B,OAAO,MAAM,eAAK,CAAC,GAAG,CAAI,GAAG,IAAI,CAAC,QAAQ,IAAI,GAAG,EAAE,EAAE,IAAI,EAAE;gBACzD,OAAO,EAAE,IAAI,CAAC,QAAQ;aACvB,CAAC,CAAA;QACJ,CAAC,CAAA;QAED,UAAK,GAAG,KAAK,EACX,GAAW,EACX,EAAE,IAAI,EAAe,EACM,EAAE;YAC7B,OAAO,MAAM,eAAK,CAAC,KAAK,CAAI,GAAG,IAAI,CAAC,QAAQ,IAAI,GAAG,EAAE,EAAE,IAAI,EAAE;gBAC3D,OAAO,EAAE,IAAI,CAAC,QAAQ;aACvB,CAAC,CAAA;QACJ,CAAC,CAAA;QAED,QAAG,GAAG,KAAK,EAAK,GAAW,EAA6B,EAAE;YACxD,OAAO,MAAM,eAAK,CAAC,GAAG,CAAI,GAAG,IAAI,CAAC,QAAQ,IAAI,GAAG,EAAE,EAAE;gBACnD,OAAO,EAAE,IAAI,CAAC,QAAQ;aACvB,CAAC,CAAA;QACJ,CAAC,CAAA;QAED,WAAM,GAAG,KAAK,EAAK,GAAW,EAA6B,EAAE;YAC3D,OAAO,MAAM,eAAK,CAAC,MAAM,CAAI,GAAG,IAAI,CAAC,QAAQ,IAAI,GAAG,EAAE,EAAE;gBACtD,OAAO,EAAE,IAAI,CAAC,QAAQ;aACvB,CAAC,CAAA;QACJ,CAAC,CAAA;QA7CC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;QACrB,IAAI,CAAC,QAAQ,GAAG;YACd,cAAc,EAAE,gCAAgC;YAChD,SAAS,EAAE,IAAI,CAAC,OAAO;SACf,CAAA;IACZ,CAAC;CAwCF;AAED,MAAM,gBAAgB;IAGpB,YAAY,EAAE,MAAM,EAAsB;QAO1C,cAAS,GAAG,KAAK,EACf,IAAsB,EACe,EAAE;YACvC,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAgC,QAAQ,EAAE;gBACvE,IAAI;aACL,CAAC,CAAA;QACJ,CAAC,CAAA;QAZC,IAAI,CAAC,QAAQ,GAAG,IAAI,eAAe,CAAC;YAClC,OAAO,EAAE,oCAAoC;YAC7C,MAAM;SACP,CAAC,CAAA;IACJ,CAAC;CASF;AAED,MAAa,cAAc;IAGzB,YAAY,EAAE,MAAM,EAAsB;QACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;IAClD,CAAC;CACF;AAND,wCAMC"}
@@ -0,0 +1 @@
1
+ export * from './client';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/iterable/v1/client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB"}
@@ -0,0 +1,42 @@
1
+ export declare enum ResponseCode {
2
+ Success = "Success",
3
+ BadApiKey = "BadApiKey",
4
+ BadAuthorizationHeader = "BadAuthorizationHeader",
5
+ BadJsonBody = "BadJsonBody",
6
+ BadParams = "BadParams",
7
+ BatchTooLarge = "BatchTooLarge",
8
+ DatabaseError = "DatabaseError",
9
+ EmailAlreadyExists = "EmailAlreadyExists",
10
+ ExternalKeyConflict = "ExternalKeyConflict",
11
+ Forbidden = "Forbidden",
12
+ ForbiddenParamsError = "ForbiddenParamsError",
13
+ ForgottenUserError = "ForgottenUserError",
14
+ GenericError = "GenericError",
15
+ InvalidEmailAddressError = "InvalidEmailAddressError",
16
+ InvalidJwtPayload = "InvalidJwtPayload",
17
+ InvalidUserIdError = "InvalidUserIdError",
18
+ JwtUserIdentifiersMismatched = "JwtUserIdentifiersMismatched",
19
+ NotFound = "NotFound",
20
+ QueueEmailError = "QueueEmailError",
21
+ RateLimitExceeded = "RateLimitExceeded",
22
+ RequestFieldsTypesMismatched = "RequestFieldsTypesMismatched",
23
+ Unauthorized = "Unauthorized",
24
+ UniqueFieldsLimitExceeded = "UniqueFieldsLimitExceeded",
25
+ UnknownEmailError = "UnknownEmailError",
26
+ UnknownUserIdError = "UnknownUserIdError",
27
+ UserIdAlreadyExists = "UserIdAlreadyExists"
28
+ }
29
+ export interface ApiResponse {
30
+ msg: string;
31
+ code: ResponseCode;
32
+ params?: Record<string, unknown>;
33
+ }
34
+ export interface SendEmailRequest {
35
+ campaignId: number;
36
+ recipientEmail?: string;
37
+ recipientUserId?: string;
38
+ dataFields?: Record<string, unknown>;
39
+ sendAt?: string;
40
+ allowRepeatMarketingSends?: boolean;
41
+ metadata?: Record<string, unknown>;
42
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResponseCode = void 0;
4
+ var ResponseCode;
5
+ (function (ResponseCode) {
6
+ ResponseCode["Success"] = "Success";
7
+ ResponseCode["BadApiKey"] = "BadApiKey";
8
+ ResponseCode["BadAuthorizationHeader"] = "BadAuthorizationHeader";
9
+ ResponseCode["BadJsonBody"] = "BadJsonBody";
10
+ ResponseCode["BadParams"] = "BadParams";
11
+ ResponseCode["BatchTooLarge"] = "BatchTooLarge";
12
+ ResponseCode["DatabaseError"] = "DatabaseError";
13
+ ResponseCode["EmailAlreadyExists"] = "EmailAlreadyExists";
14
+ ResponseCode["ExternalKeyConflict"] = "ExternalKeyConflict";
15
+ ResponseCode["Forbidden"] = "Forbidden";
16
+ ResponseCode["ForbiddenParamsError"] = "ForbiddenParamsError";
17
+ ResponseCode["ForgottenUserError"] = "ForgottenUserError";
18
+ ResponseCode["GenericError"] = "GenericError";
19
+ ResponseCode["InvalidEmailAddressError"] = "InvalidEmailAddressError";
20
+ ResponseCode["InvalidJwtPayload"] = "InvalidJwtPayload";
21
+ ResponseCode["InvalidUserIdError"] = "InvalidUserIdError";
22
+ ResponseCode["JwtUserIdentifiersMismatched"] = "JwtUserIdentifiersMismatched";
23
+ ResponseCode["NotFound"] = "NotFound";
24
+ ResponseCode["QueueEmailError"] = "QueueEmailError";
25
+ ResponseCode["RateLimitExceeded"] = "RateLimitExceeded";
26
+ ResponseCode["RequestFieldsTypesMismatched"] = "RequestFieldsTypesMismatched";
27
+ ResponseCode["Unauthorized"] = "Unauthorized";
28
+ ResponseCode["UniqueFieldsLimitExceeded"] = "UniqueFieldsLimitExceeded";
29
+ ResponseCode["UnknownEmailError"] = "UnknownEmailError";
30
+ ResponseCode["UnknownUserIdError"] = "UnknownUserIdError";
31
+ ResponseCode["UserIdAlreadyExists"] = "UserIdAlreadyExists";
32
+ })(ResponseCode = exports.ResponseCode || (exports.ResponseCode = {}));
33
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../extensions/iterable/v1/client/types.ts"],"names":[],"mappings":";;;AAAA,IAAY,YA2BX;AA3BD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,uCAAuB,CAAA;IACvB,iEAAiD,CAAA;IACjD,2CAA2B,CAAA;IAC3B,uCAAuB,CAAA;IACvB,+CAA+B,CAAA;IAC/B,+CAA+B,CAAA;IAC/B,yDAAyC,CAAA;IACzC,2DAA2C,CAAA;IAC3C,uCAAuB,CAAA;IACvB,6DAA6C,CAAA;IAC7C,yDAAyC,CAAA;IACzC,6CAA6B,CAAA;IAC7B,qEAAqD,CAAA;IACrD,uDAAuC,CAAA;IACvC,yDAAyC,CAAA;IACzC,6EAA6D,CAAA;IAC7D,qCAAqB,CAAA;IACrB,mDAAmC,CAAA;IACnC,uDAAuC,CAAA;IACvC,6EAA6D,CAAA;IAC7D,6CAA6B,CAAA;IAC7B,uEAAuD,CAAA;IACvD,uDAAuC,CAAA;IACvC,yDAAyC,CAAA;IACzC,2DAA2C,CAAA;AAC7C,CAAC,EA3BW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QA2BvB"}
@@ -0,0 +1,2 @@
1
+ import { z } from 'zod';
2
+ export declare const StringTransformToJson: z.ZodEffects<z.ZodString, Record<string, any>, string>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StringTransformToJson = void 0;
4
+ const lodash_1 = require("lodash");
5
+ const zod_1 = require("zod");
6
+ exports.StringTransformToJson = zod_1.z
7
+ .string()
8
+ .transform((str, ctx) => {
9
+ if ((0, lodash_1.isNil)(str) || (0, lodash_1.isEmpty)(str))
10
+ return {};
11
+ try {
12
+ return JSON.parse(str);
13
+ }
14
+ catch (e) {
15
+ ctx.addIssue({ code: 'custom', message: 'Invalid JSON' });
16
+ return zod_1.z.NEVER;
17
+ }
18
+ });
19
+ //# sourceMappingURL=validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../extensions/iterable/v1/validation.ts"],"names":[],"mappings":";;;AAAA,mCAAuC;AACvC,6BAAuB;AAEV,QAAA,qBAAqB,GAAG,OAAC;KACnC,MAAM,EAAE;KACR,SAAS,CAAC,CAAC,GAAG,EAAE,GAAG,EAAuB,EAAE;IAC3C,IAAI,IAAA,cAAK,EAAC,GAAG,CAAC,IAAI,IAAA,gBAAO,EAAC,GAAG,CAAC;QAAE,OAAO,EAAE,CAAA;IACzC,IAAI;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;KACvB;IAAC,OAAO,CAAC,EAAE;QACV,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAA;QACzD,OAAO,OAAC,CAAC,KAAK,CAAA;KACf;AACH,CAAC,CAAC,CAAA"}
@@ -16,8 +16,8 @@
16
16
  "changelog": "# Canvas Medical changelog\n\n## 2023-09-01\n\n- Add new actions: `createAppointment`, `createPatient`, `createQuestionnaireResponses`, `createTask`, `updateAppointment`, `updatePatient`, and `updateTask` for enhanced functionality.\n"
17
17
  },
18
18
  "cloudinary": {
19
- "readme": "---\ntitle: Cloudinary\ndescription: Cloudinary is a cloud-based image and video management platform that provides a comprehensive set of tools for storing, managing, and delivering digital media assets. \n---\n# Cloudinary\n\nCloudinary is a cloud-based image and video management platform that provides a comprehensive set of tools for storing, managing, and delivering digital media assets. It enables users to upload, manipulate, optimize, and deliver media files to any device or website quickly and easily.\n\nThe platform offers features such as image and video transformation, automatic image optimization, and responsive image delivery. Cloudinary also provides tools for organizing media assets, including tags, folders, and metadata.\n\n## Custom Actions\n\n### Upload files\n\nThis action allows a given stakeholder to upload one or many files (all file types allowed). Additionally, you can specify in what folder you would like to upload the assets.\n\n**Prerequisites:**\n\n1. You have a Cloudinary account\n2. You have created an upload preset that allows for unsigned uploads\n\n**Limitations:**\n\n- You cannot manage or browse uploaded file(s) in Awell. You can only do that in Cloudinary. To make searching files as easy as possible, you can assign tags to uploaded files and each uploaded file automatically has metadata attached (pathway id and activity id)\n- Only support for unsigned uploads\n- As a user, you cannot delete files you already uploaded\n",
20
- "changelog": "# Cloudinary changelog"
19
+ "readme": "---\ntitle: Cloudinary\ndescription: Cloudinary is a cloud-based image and video management platform that provides a comprehensive set of tools for storing, managing, and delivering digital media assets. \n---\n# Cloudinary\n\nCloudinary is a cloud-based image and video management platform that provides a comprehensive set of tools for storing, managing, and delivering digital media assets. It enables users to upload, manipulate, optimize, and deliver media files to any device or website quickly and easily.\n\nThe platform offers features such as image and video transformation, automatic image optimization, and responsive image delivery. Cloudinary also provides tools for organizing media assets, including tags, folders, and metadata.\n\n## Set up\n\nTo set up this extension and allow image upload you will need to:\n\n1. Have a Cloudinary account and know your cloud name\n2. Created an upload preset that allows for **unsigned uploads**\n\n## Custom Actions\n\n### Upload single file\n\nAllows a user to upload a single file using Awell Hosted Pages (all file types allowed). The URL of the uploaded file is returned as a data point.\n### Upload files\n\nThis action allows a given stakeholder to upload one or many files using Awell Hosted Pages (all file types allowed). This action currently doesn't return the URLs of the uploaded files. If you need this functionality, please use the \"Upload single file\" action for now.\n",
20
+ "changelog": "# Cloudinary changelog\n\n## October 2023\n\n- Action added: Upload a single file"
21
21
  },
22
22
  "cmDotCom": {
23
23
  "readme": "---\ntitle: cm.com\ndescription: CM.com is a global communication and digital services provider based in the Netherlands.\n---\n# CM.com\n\nCM.com is a global communication and digital services provider based in the Netherlands. It offers a wide range of services and solutions in the areas of messaging, payments, voice, and customer experience.\n\nCM.com enables businesses to communicate with their customers through various channels such as SMS, email, push notifications, social media messaging, and more.\n\n## Extension settings\n\nIn order to set up this extension, you will need:\n\n1. A **Product Token** - visit https://gateway.cmtelecom.com/ to retrieve your product token.\n2. A **From/sender name** - the maximum length is 11 alphanumerical characters or 16 digit\n\n## Custom Actions\n\n### Send SMS\n\nSend an SMS with CM.com to a recipient of your liking.\n",
@@ -47,6 +47,10 @@
47
47
  "readme": "---\ntitle: Hello world\ndescription: This is an example extension.\n---\n# Hello world extension",
48
48
  "changelog": "# Hello world changelog"
49
49
  },
50
+ "iterable": {
51
+ "readme": "---\ntitle: Iterable\ndescription: Iterable is an email marketing automation platform that allows creating, sending, and tracking personalized email campaigns.\n---\n\n# Iterable\n\nIterable is a marketing automation platform that provides tools and services for businesses to engage with their customers through email, SMS, in-app notifications, and other digital channels. It allows businesses to create and manage personalized marketing campaigns, track customer behavior, and analyze data to optimize their marketing strategies.\n\nIterable offers features such as email marketing, segmentation, A/B testing, workflow automation, and analytics to help businesses deliver the right message to the right audience at the right time.\n\n## Extension settings\n\nIn order to set up this extension, you will need an API key to authenticate with the Iterable API.\n\n## Custom Actions\n\n### Send email\n\nSend an email to a specific email address.\n\n**Important:** Provide a `recipientEmail` or a `recipientUserId` (but not both), depending on how your [project identifies users](https://support.iterable.com/hc/articles/204780579#identifying-users).\n",
52
+ "changelog": "# Iterable changelog\n"
53
+ },
50
54
  "mailchimp": {
51
55
  "readme": "---\ntitle: Mailchimp\ndescription: Mailchimp is an all-in-one marketing platform that helps businesses of all sizes to design, send, and manage email campaigns, automate marketing tasks, and build customer relationships. \n---\n# Mailchimp\n\nMailchimp is an all-in-one marketing platform that helps businesses of all sizes to design, send, and manage email campaigns, automate marketing tasks, and build customer relationships. \n\nIt offers a user-friendly interface that allows users to create custom email templates, segment their audience, and track their email campaign's performance with real-time analytics.\n\n## Extension settings\n\nIn order to set up this extension, you will need to provide a:\n\n1. API key\n2. From name\n3. 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",
52
56
  "changelog": "# Mailchimp changelog"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awell-health/awell-extensions",
3
- "version": "1.0.111",
3
+ "version": "1.0.113",
4
4
  "packageManager": "yarn@3.4.1",
5
5
  "main": "dist/src/index.js",
6
6
  "repository": {