@awell-health/awell-extensions 2.0.240 → 2.0.241

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 (55) hide show
  1. package/dist/extensions/customerIo/actions/index.d.ts +54 -0
  2. package/dist/extensions/customerIo/actions/index.js +8 -0
  3. package/dist/extensions/customerIo/actions/index.js.map +1 -0
  4. package/dist/extensions/customerIo/actions/trackPersonEvent/config/datapoints.d.ts +1 -0
  5. package/dist/extensions/customerIo/actions/trackPersonEvent/config/datapoints.js +5 -0
  6. package/dist/extensions/customerIo/actions/trackPersonEvent/config/datapoints.js.map +1 -0
  7. package/dist/extensions/customerIo/actions/trackPersonEvent/config/fields.d.ts +54 -0
  8. package/dist/extensions/customerIo/actions/trackPersonEvent/config/fields.js +77 -0
  9. package/dist/extensions/customerIo/actions/trackPersonEvent/config/fields.js.map +1 -0
  10. package/dist/extensions/customerIo/actions/trackPersonEvent/config/index.d.ts +2 -0
  11. package/dist/extensions/customerIo/actions/trackPersonEvent/config/index.js +9 -0
  12. package/dist/extensions/customerIo/actions/trackPersonEvent/config/index.js.map +1 -0
  13. package/dist/extensions/customerIo/actions/trackPersonEvent/index.d.ts +1 -0
  14. package/dist/extensions/customerIo/actions/trackPersonEvent/index.js +6 -0
  15. package/dist/extensions/customerIo/actions/trackPersonEvent/index.js.map +1 -0
  16. package/dist/extensions/customerIo/actions/trackPersonEvent/trackPersonEvent.d.ts +4 -0
  17. package/dist/extensions/customerIo/actions/trackPersonEvent/trackPersonEvent.js +63 -0
  18. package/dist/extensions/customerIo/actions/trackPersonEvent/trackPersonEvent.js.map +1 -0
  19. package/dist/extensions/customerIo/index.d.ts +2 -0
  20. package/dist/extensions/customerIo/index.js +22 -0
  21. package/dist/extensions/customerIo/index.js.map +1 -0
  22. package/dist/extensions/customerIo/lib/api/index.d.ts +1 -0
  23. package/dist/extensions/customerIo/lib/api/index.js +6 -0
  24. package/dist/extensions/customerIo/lib/api/index.js.map +1 -0
  25. package/dist/extensions/customerIo/lib/api/schema/TrackPersonEvent.schema.d.ts +98 -0
  26. package/dist/extensions/customerIo/lib/api/schema/TrackPersonEvent.schema.js +40 -0
  27. package/dist/extensions/customerIo/lib/api/schema/TrackPersonEvent.schema.js.map +1 -0
  28. package/dist/extensions/customerIo/lib/api/schema/atoms/ActionType.schema.d.ts +2 -0
  29. package/dist/extensions/customerIo/lib/api/schema/atoms/ActionType.schema.js +19 -0
  30. package/dist/extensions/customerIo/lib/api/schema/atoms/ActionType.schema.js.map +1 -0
  31. package/dist/extensions/customerIo/lib/api/schema/atoms/EventType.schema.d.ts +2 -0
  32. package/dist/extensions/customerIo/lib/api/schema/atoms/EventType.schema.js +6 -0
  33. package/dist/extensions/customerIo/lib/api/schema/atoms/EventType.schema.js.map +1 -0
  34. package/dist/extensions/customerIo/lib/api/schema/atoms/index.d.ts +2 -0
  35. package/dist/extensions/customerIo/lib/api/schema/atoms/index.js +19 -0
  36. package/dist/extensions/customerIo/lib/api/schema/atoms/index.js.map +1 -0
  37. package/dist/extensions/customerIo/lib/api/schema/index.d.ts +1 -0
  38. package/dist/extensions/customerIo/lib/api/schema/index.js +18 -0
  39. package/dist/extensions/customerIo/lib/api/schema/index.js.map +1 -0
  40. package/dist/extensions/customerIo/lib/api/trackApiClient.d.ts +12 -0
  41. package/dist/extensions/customerIo/lib/api/trackApiClient.js +26 -0
  42. package/dist/extensions/customerIo/lib/api/trackApiClient.js.map +1 -0
  43. package/dist/extensions/customerIo/lib/index.d.ts +1 -0
  44. package/dist/extensions/customerIo/lib/index.js +6 -0
  45. package/dist/extensions/customerIo/lib/index.js.map +1 -0
  46. package/dist/extensions/customerIo/lib/validatePayloadAndCreateSdk.d.ts +18 -0
  47. package/dist/extensions/customerIo/lib/validatePayloadAndCreateSdk.js +34 -0
  48. package/dist/extensions/customerIo/lib/validatePayloadAndCreateSdk.js.map +1 -0
  49. package/dist/extensions/customerIo/settings.d.ts +27 -0
  50. package/dist/extensions/customerIo/settings.js +25 -0
  51. package/dist/extensions/customerIo/settings.js.map +1 -0
  52. package/dist/extensions/index.js +2 -0
  53. package/dist/extensions/index.js.map +1 -1
  54. package/dist/extensions/markdown.json +4 -0
  55. package/package.json +1 -1
@@ -0,0 +1,54 @@
1
+ declare const actions: {
2
+ trackPersonEvent: import("@awell-health/extensions-core").Action<{
3
+ personIdentifierType: {
4
+ id: string;
5
+ label: string;
6
+ description: string;
7
+ type: import("@awell-health/extensions-core").FieldType.STRING;
8
+ required: true;
9
+ options: {
10
+ dropdownOptions: {
11
+ label: "email" | "id" | "cio_id";
12
+ value: "email" | "id" | "cio_id";
13
+ }[];
14
+ };
15
+ };
16
+ identifierValue: {
17
+ id: string;
18
+ label: string;
19
+ description: string;
20
+ type: import("@awell-health/extensions-core").FieldType.STRING;
21
+ required: true;
22
+ };
23
+ eventName: {
24
+ id: string;
25
+ label: string;
26
+ description: string;
27
+ type: import("@awell-health/extensions-core").FieldType.STRING;
28
+ required: true;
29
+ };
30
+ attributes: {
31
+ id: string;
32
+ label: string;
33
+ description: string;
34
+ type: import("@awell-health/extensions-core").FieldType.JSON;
35
+ required: false;
36
+ };
37
+ }, {
38
+ siteId: {
39
+ key: string;
40
+ label: string;
41
+ description: string;
42
+ obfuscated: false;
43
+ required: true;
44
+ };
45
+ apiKey: {
46
+ key: string;
47
+ label: string;
48
+ description: string;
49
+ obfuscated: true;
50
+ required: true;
51
+ };
52
+ }, never>;
53
+ };
54
+ export default actions;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const trackPersonEvent_1 = require("./trackPersonEvent");
4
+ const actions = {
5
+ trackPersonEvent: trackPersonEvent_1.trackPersonEvent,
6
+ };
7
+ exports.default = actions;
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/customerIo/actions/index.ts"],"names":[],"mappings":";;AAAA,yDAAqD;AAErD,MAAM,OAAO,GAAG;IACd,gBAAgB,EAAhB,mCAAgB;CACjB,CAAA;AAED,kBAAe,OAAO,CAAA"}
@@ -0,0 +1 @@
1
+ export declare const dataPoints: {};
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataPoints = void 0;
4
+ exports.dataPoints = {};
5
+ //# sourceMappingURL=datapoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datapoints.js","sourceRoot":"","sources":["../../../../../../extensions/customerIo/actions/trackPersonEvent/config/datapoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,EAAgD,CAAA"}
@@ -0,0 +1,54 @@
1
+ import { FieldType } from '@awell-health/extensions-core';
2
+ import z from 'zod';
3
+ export declare const fields: {
4
+ personIdentifierType: {
5
+ id: string;
6
+ label: string;
7
+ description: string;
8
+ type: FieldType.STRING;
9
+ required: true;
10
+ options: {
11
+ dropdownOptions: {
12
+ label: "email" | "id" | "cio_id";
13
+ value: "email" | "id" | "cio_id";
14
+ }[];
15
+ };
16
+ };
17
+ identifierValue: {
18
+ id: string;
19
+ label: string;
20
+ description: string;
21
+ type: FieldType.STRING;
22
+ required: true;
23
+ };
24
+ eventName: {
25
+ id: string;
26
+ label: string;
27
+ description: string;
28
+ type: FieldType.STRING;
29
+ required: true;
30
+ };
31
+ attributes: {
32
+ id: string;
33
+ label: string;
34
+ description: string;
35
+ type: FieldType.JSON;
36
+ required: false;
37
+ };
38
+ };
39
+ export declare const FieldsValidationSchema: z.ZodObject<{
40
+ personIdentifierType: z.ZodDefault<z.ZodEnum<["id", "email", "cio_id"]>>;
41
+ identifierValue: z.ZodString;
42
+ eventName: z.ZodString;
43
+ attributes: z.ZodEffects<z.ZodOptional<z.ZodString>, Record<string, string> | undefined, string | undefined>;
44
+ }, "strip", z.ZodTypeAny, {
45
+ eventName: string;
46
+ personIdentifierType: "email" | "id" | "cio_id";
47
+ identifierValue: string;
48
+ attributes?: Record<string, string> | undefined;
49
+ }, {
50
+ eventName: string;
51
+ identifierValue: string;
52
+ attributes?: string | undefined;
53
+ personIdentifierType?: "email" | "id" | "cio_id" | undefined;
54
+ }>;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FieldsValidationSchema = exports.fields = void 0;
7
+ const extensions_core_1 = require("@awell-health/extensions-core");
8
+ const lodash_1 = require("lodash");
9
+ const zod_1 = __importDefault(require("zod"));
10
+ const IdentifierOptionsSchema = zod_1.default.enum(['id', 'email', 'cio_id']);
11
+ exports.fields = {
12
+ personIdentifierType: {
13
+ id: 'personIdentifierType',
14
+ label: 'Person identifier type',
15
+ description: 'The identifier type used to identify the person. Defaults to email.',
16
+ type: extensions_core_1.FieldType.STRING,
17
+ required: true,
18
+ options: {
19
+ dropdownOptions: Object.values(IdentifierOptionsSchema.options).map((identifier) => ({
20
+ label: identifier,
21
+ value: identifier,
22
+ })),
23
+ },
24
+ },
25
+ identifierValue: {
26
+ id: 'identifierValue',
27
+ label: 'Identifier value',
28
+ description: 'The value of the identifier used to identify the person.',
29
+ type: extensions_core_1.FieldType.STRING,
30
+ required: true,
31
+ },
32
+ eventName: {
33
+ id: 'eventName',
34
+ label: 'Event name',
35
+ description: "The name of the event. This is how you'll find your event in Customer.io or select it when using events as campaign triggers.",
36
+ type: extensions_core_1.FieldType.STRING,
37
+ required: true,
38
+ },
39
+ attributes: {
40
+ id: 'attributes',
41
+ label: 'Attributes',
42
+ description: 'Additional information that you might want to reference in a message using liquid or use to set attributes on the identified person.',
43
+ type: extensions_core_1.FieldType.JSON,
44
+ required: false,
45
+ },
46
+ };
47
+ exports.FieldsValidationSchema = zod_1.default.object({
48
+ personIdentifierType: IdentifierOptionsSchema.default('email'),
49
+ identifierValue: zod_1.default.string().min(1),
50
+ eventName: zod_1.default.string().min(1),
51
+ attributes: zod_1.default
52
+ .string()
53
+ .optional()
54
+ .transform((str, ctx) => {
55
+ if ((0, lodash_1.isNil)(str) || (0, lodash_1.isEmpty)(str))
56
+ return undefined;
57
+ try {
58
+ const parsedJson = JSON.parse(str);
59
+ if ((0, lodash_1.isEmpty)(parsedJson)) {
60
+ return undefined;
61
+ }
62
+ if (typeof parsedJson !== 'object' || Array.isArray(parsedJson)) {
63
+ ctx.addIssue({
64
+ code: 'custom',
65
+ message: 'Attributes should be an object',
66
+ });
67
+ return zod_1.default.NEVER;
68
+ }
69
+ return parsedJson;
70
+ }
71
+ catch (e) {
72
+ ctx.addIssue({ code: 'custom', message: 'Invalid JSON.' });
73
+ return zod_1.default.NEVER;
74
+ }
75
+ }),
76
+ });
77
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/customerIo/actions/trackPersonEvent/config/fields.ts"],"names":[],"mappings":";;;;;;AAAA,mEAAqE;AACrE,mCAAuC;AACvC,8CAAwC;AAExC,MAAM,uBAAuB,GAAG,aAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAA;AAEpD,QAAA,MAAM,GAAG;IACpB,oBAAoB,EAAE;QACpB,EAAE,EAAE,sBAAsB;QAC1B,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EACT,qEAAqE;QACvE,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACP,eAAe,EAAE,MAAM,CAAC,MAAM,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC,GAAG,CACjE,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;gBACf,KAAK,EAAE,UAAU;gBACjB,KAAK,EAAE,UAAU;aAClB,CAAC,CACH;SACF;KACF;IACD,eAAe,EAAE;QACf,EAAE,EAAE,iBAAiB;QACrB,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,0DAA0D;QACvE,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,SAAS,EAAE;QACT,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,YAAY;QACnB,WAAW,EACT,+HAA+H;QACjI,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,YAAY;QACnB,WAAW,EACT,sIAAsI;QACxI,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,KAAK;KAChB;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7C,oBAAoB,EAAE,uBAAuB,CAAC,OAAO,CAAC,OAAO,CAAC;IAC9D,eAAe,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAClC,SAAS,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,UAAU,EAAE,aAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,SAAS,CAAC,CAAC,GAAG,EAAE,GAAG,EAAsC,EAAE;QAC1D,IAAI,IAAA,cAAK,EAAC,GAAG,CAAC,IAAI,IAAA,gBAAO,EAAC,GAAG,CAAC;YAAE,OAAO,SAAS,CAAA;QAEhD,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAElC,IAAI,IAAA,gBAAO,EAAC,UAAU,CAAC,EAAE,CAAC;gBACxB,OAAO,SAAS,CAAA;YAClB,CAAC;YAED,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;gBAChE,GAAG,CAAC,QAAQ,CAAC;oBACX,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,gCAAgC;iBAC1C,CAAC,CAAA;gBACF,OAAO,aAAC,CAAC,KAAK,CAAA;YAChB,CAAC;YAED,OAAO,UAAU,CAAA;QACnB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,CAAA;YAC1D,OAAO,aAAC,CAAC,KAAK,CAAA;QAChB,CAAC;IACH,CAAC,CAAC;CAC6C,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { fields, FieldsValidationSchema } from './fields';
2
+ export { dataPoints } from './datapoints';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataPoints = exports.FieldsValidationSchema = exports.fields = void 0;
4
+ var fields_1 = require("./fields");
5
+ Object.defineProperty(exports, "fields", { enumerable: true, get: function () { return fields_1.fields; } });
6
+ Object.defineProperty(exports, "FieldsValidationSchema", { enumerable: true, get: function () { return fields_1.FieldsValidationSchema; } });
7
+ var datapoints_1 = require("./datapoints");
8
+ Object.defineProperty(exports, "dataPoints", { enumerable: true, get: function () { return datapoints_1.dataPoints; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/customerIo/actions/trackPersonEvent/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACvC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
@@ -0,0 +1 @@
1
+ export { trackPersonEvent } from './trackPersonEvent';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.trackPersonEvent = void 0;
4
+ var trackPersonEvent_1 = require("./trackPersonEvent");
5
+ Object.defineProperty(exports, "trackPersonEvent", { enumerable: true, get: function () { return trackPersonEvent_1.trackPersonEvent; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/customerIo/actions/trackPersonEvent/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, dataPoints } from './config';
4
+ export declare const trackPersonEvent: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.trackPersonEvent = void 0;
4
+ const extensions_core_1 = require("@awell-health/extensions-core");
5
+ const lib_1 = require("../../lib");
6
+ const config_1 = require("./config");
7
+ const lodash_1 = require("lodash");
8
+ exports.trackPersonEvent = {
9
+ key: 'trackPersonEvent',
10
+ category: extensions_core_1.Category.CUSTOMER_SUPPORT,
11
+ title: 'Track person event',
12
+ description: 'Track a person event in Customer.io',
13
+ fields: config_1.fields,
14
+ previewable: false,
15
+ dataPoints: config_1.dataPoints,
16
+ onEvent: async ({ payload, onComplete, onError }) => {
17
+ var _a;
18
+ const { customerIoTrackClient, fields, pathway, patient, activity } = await (0, lib_1.validatePayloadAndCreateSdks)({
19
+ fieldsSchema: config_1.FieldsValidationSchema,
20
+ payload,
21
+ });
22
+ const patientIdentifiers = (_a = patient.profile) === null || _a === void 0 ? void 0 : _a.identifier;
23
+ const patientIdentifiersAttributes = !(0, lodash_1.isNil)(patientIdentifiers) && !(0, lodash_1.isEmpty)(patientIdentifiers)
24
+ ? patientIdentifiers.reduce((acc, identifier) => {
25
+ acc[`_awell_identifier_${identifier.system}`] = identifier.value;
26
+ return acc;
27
+ }, {})
28
+ : {};
29
+ await customerIoTrackClient.trackPersonEvent({
30
+ type: 'person',
31
+ action: 'event',
32
+ name: fields.eventName,
33
+ identifiers: {
34
+ [fields.personIdentifierType]: fields.identifierValue,
35
+ },
36
+ attributes: {
37
+ _awell_careflow_id: pathway.id,
38
+ _awell_careflow_definition_id: pathway.definition_id,
39
+ _awell_patient_id: patient.id,
40
+ _awell_activity_id: activity.id,
41
+ ...patientIdentifiersAttributes,
42
+ ...fields.attributes,
43
+ },
44
+ });
45
+ await customerIoTrackClient.trackPersonEvent({
46
+ type: 'person',
47
+ action: 'event',
48
+ name: fields.eventName,
49
+ identifiers: {
50
+ [fields.personIdentifierType]: fields.identifierValue,
51
+ },
52
+ attributes: {
53
+ _awell_careflow_id: pathway.id,
54
+ _awell_careflow_definition_id: pathway.definition_id,
55
+ _awell_patient_id: patient.id,
56
+ _awell_activity_id: activity.id,
57
+ ...fields.attributes,
58
+ },
59
+ });
60
+ await onComplete();
61
+ },
62
+ };
63
+ //# sourceMappingURL=trackPersonEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trackPersonEvent.js","sourceRoot":"","sources":["../../../../../extensions/customerIo/actions/trackPersonEvent/trackPersonEvent.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,mCAAwD;AAExD,qCAAqE;AACrE,mCAAuC;AAE1B,QAAA,gBAAgB,GAIzB;IACF,GAAG,EAAE,kBAAkB;IACvB,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EAAE,qCAAqC;IAClD,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK;IAClB,UAAU,EAAV,mBAAU;IACV,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,EAAiB,EAAE;;QACjE,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GACjE,MAAM,IAAA,kCAA4B,EAAC;YACjC,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEJ,MAAM,kBAAkB,GAAG,MAAA,OAAO,CAAC,OAAO,0CAAE,UAAU,CAAA;QACtD,MAAM,4BAA4B,GAChC,CAAC,IAAA,cAAK,EAAC,kBAAkB,CAAC,IAAI,CAAC,IAAA,gBAAO,EAAC,kBAAkB,CAAC;YACxD,CAAC,CAAC,kBAAkB,CAAC,MAAM,CACvB,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE;gBAClB,GAAG,CAAC,qBAAqB,UAAU,CAAC,MAAM,EAAE,CAAC,GAAG,UAAU,CAAC,KAAK,CAAA;gBAChE,OAAO,GAAG,CAAA;YACZ,CAAC,EACD,EAAE,CACH;YACH,CAAC,CAAC,EAAE,CAAA;QAER,MAAM,qBAAqB,CAAC,gBAAgB,CAAC;YAC3C,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,MAAM,CAAC,SAAS;YACtB,WAAW,EAAE;gBACX,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC,eAAe;aACtD;YACD,UAAU,EAAE;gBACV,kBAAkB,EAAE,OAAO,CAAC,EAAE;gBAC9B,6BAA6B,EAAE,OAAO,CAAC,aAAa;gBACpD,iBAAiB,EAAE,OAAO,CAAC,EAAE;gBAC7B,kBAAkB,EAAE,QAAQ,CAAC,EAAE;gBAC/B,GAAG,4BAA4B;gBAC/B,GAAG,MAAM,CAAC,UAAU;aACrB;SACF,CAAC,CAAA;QAEF,MAAM,qBAAqB,CAAC,gBAAgB,CAAC;YAC3C,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,MAAM,CAAC,SAAS;YACtB,WAAW,EAAE;gBACX,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC,eAAe;aACtD;YACD,UAAU,EAAE;gBACV,kBAAkB,EAAE,OAAO,CAAC,EAAE;gBAC9B,6BAA6B,EAAE,OAAO,CAAC,aAAa;gBACpD,iBAAiB,EAAE,OAAO,CAAC,EAAE;gBAC7B,kBAAkB,EAAE,QAAQ,CAAC,EAAE;gBAC/B,GAAG,MAAM,CAAC,UAAU;aACrB;SACF,CAAC,CAAA;QAEF,MAAM,UAAU,EAAE,CAAA;IACpB,CAAC;CACF,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { type Extension } from '@awell-health/extensions-core';
2
+ export declare const customerIo: Extension;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.customerIo = void 0;
7
+ const extensions_core_1 = require("@awell-health/extensions-core");
8
+ const actions_1 = __importDefault(require("./actions"));
9
+ const settings_1 = require("./settings");
10
+ exports.customerIo = {
11
+ key: 'customerIo',
12
+ title: 'Customer.io',
13
+ description: 'Customer.io is a customer engagement platform designed to create personalized customer journeys that engage, convert, and scale.',
14
+ icon_url: 'https://res.cloudinary.com/da7x4rzl4/image/upload/v1746447967/Awell%20Extensions/favicon.svg',
15
+ category: extensions_core_1.Category.CUSTOMER_SUPPORT,
16
+ author: {
17
+ authorType: extensions_core_1.AuthorType.AWELL,
18
+ },
19
+ settings: settings_1.settings,
20
+ actions: actions_1.default,
21
+ };
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/customerIo/index.ts"],"names":[],"mappings":";;;;;;AAAA,mEAIsC;AACtC,wDAA+B;AAC/B,yCAAqC;AAExB,QAAA,UAAU,GAAc;IACnC,GAAG,EAAE,YAAY;IACjB,KAAK,EAAE,aAAa;IACpB,WAAW,EACT,kIAAkI;IACpI,QAAQ,EACN,8FAA8F;IAChG,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,MAAM,EAAE;QACN,UAAU,EAAE,4BAAU,CAAC,KAAK;KAC7B;IACD,QAAQ,EAAR,mBAAQ;IACR,OAAO,EAAP,iBAAO;CACR,CAAA"}
@@ -0,0 +1 @@
1
+ export { CustomerioTrackApiClient } from './trackApiClient';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomerioTrackApiClient = void 0;
4
+ var trackApiClient_1 = require("./trackApiClient");
5
+ Object.defineProperty(exports, "CustomerioTrackApiClient", { enumerable: true, get: function () { return trackApiClient_1.CustomerioTrackApiClient; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/customerIo/lib/api/index.ts"],"names":[],"mappings":";;;AAAA,mDAA2D;AAAlD,0HAAA,wBAAwB,OAAA"}
@@ -0,0 +1,98 @@
1
+ import z from 'zod';
2
+ export declare const IdentifiersSchema: z.ZodEffects<z.ZodObject<{
3
+ id: z.ZodOptional<z.ZodString>;
4
+ email: z.ZodOptional<z.ZodString>;
5
+ cio_id: z.ZodOptional<z.ZodString>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ email?: string | undefined;
8
+ id?: string | undefined;
9
+ cio_id?: string | undefined;
10
+ }, {
11
+ email?: string | undefined;
12
+ id?: string | undefined;
13
+ cio_id?: string | undefined;
14
+ }>, {
15
+ email?: string | undefined;
16
+ id?: string | undefined;
17
+ cio_id?: string | undefined;
18
+ }, {
19
+ email?: string | undefined;
20
+ id?: string | undefined;
21
+ cio_id?: string | undefined;
22
+ }>;
23
+ export declare const TrackPersonEventInputSchema: z.ZodObject<{
24
+ type: z.ZodLiteral<"person">;
25
+ action: z.ZodLiteral<"event">;
26
+ identifiers: z.ZodEffects<z.ZodObject<{
27
+ id: z.ZodOptional<z.ZodString>;
28
+ email: z.ZodOptional<z.ZodString>;
29
+ cio_id: z.ZodOptional<z.ZodString>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ email?: string | undefined;
32
+ id?: string | undefined;
33
+ cio_id?: string | undefined;
34
+ }, {
35
+ email?: string | undefined;
36
+ id?: string | undefined;
37
+ cio_id?: string | undefined;
38
+ }>, {
39
+ email?: string | undefined;
40
+ id?: string | undefined;
41
+ cio_id?: string | undefined;
42
+ }, {
43
+ email?: string | undefined;
44
+ id?: string | undefined;
45
+ cio_id?: string | undefined;
46
+ }>;
47
+ name: z.ZodString;
48
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
49
+ }, "strip", z.ZodTypeAny, {
50
+ type: "person";
51
+ name: string;
52
+ action: "event";
53
+ identifiers: {
54
+ email?: string | undefined;
55
+ id?: string | undefined;
56
+ cio_id?: string | undefined;
57
+ };
58
+ attributes?: Record<string, string> | undefined;
59
+ }, {
60
+ type: "person";
61
+ name: string;
62
+ action: "event";
63
+ identifiers: {
64
+ email?: string | undefined;
65
+ id?: string | undefined;
66
+ cio_id?: string | undefined;
67
+ };
68
+ attributes?: Record<string, string> | undefined;
69
+ }>;
70
+ export type TrackPersonEventInputType = z.infer<typeof TrackPersonEventInputSchema>;
71
+ export declare const TrackPersonEventResponseSchema: z.ZodObject<{
72
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
73
+ reason: z.ZodString;
74
+ field: z.ZodString;
75
+ message: z.ZodString;
76
+ }, "strip", z.ZodTypeAny, {
77
+ message: string;
78
+ reason: string;
79
+ field: string;
80
+ }, {
81
+ message: string;
82
+ reason: string;
83
+ field: string;
84
+ }>, "many">>;
85
+ }, "strip", z.ZodTypeAny, {
86
+ errors?: {
87
+ message: string;
88
+ reason: string;
89
+ field: string;
90
+ }[] | undefined;
91
+ }, {
92
+ errors?: {
93
+ message: string;
94
+ reason: string;
95
+ field: string;
96
+ }[] | undefined;
97
+ }>;
98
+ export type TrackPersonEventResponseType = z.infer<typeof TrackPersonEventResponseSchema>;
@@ -0,0 +1,40 @@
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.TrackPersonEventResponseSchema = exports.TrackPersonEventInputSchema = exports.IdentifiersSchema = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ const atoms_1 = require("./atoms");
9
+ exports.IdentifiersSchema = zod_1.default
10
+ .object({
11
+ // Only one of these should be present
12
+ id: zod_1.default.string().optional(),
13
+ email: zod_1.default.string().email().optional(),
14
+ cio_id: zod_1.default.string().optional(),
15
+ })
16
+ .refine((data) => {
17
+ // Ensure exactly one identifier is provided
18
+ const count = [data.id, data.email, data.cio_id].filter(Boolean).length;
19
+ return count === 1;
20
+ }, {
21
+ message: 'Must provide exactly one of: id, email, or cio_id',
22
+ path: ['identifiers'],
23
+ });
24
+ exports.TrackPersonEventInputSchema = zod_1.default.object({
25
+ type: zod_1.default.literal(atoms_1.EventType.Values.person),
26
+ action: zod_1.default.literal(atoms_1.ActionType.Values.event),
27
+ identifiers: exports.IdentifiersSchema,
28
+ name: zod_1.default.string().min(1),
29
+ attributes: zod_1.default.record(zod_1.default.string(), zod_1.default.string()).optional(),
30
+ });
31
+ exports.TrackPersonEventResponseSchema = zod_1.default.object({
32
+ errors: zod_1.default
33
+ .array(zod_1.default.object({
34
+ reason: zod_1.default.string(),
35
+ field: zod_1.default.string(),
36
+ message: zod_1.default.string(),
37
+ }))
38
+ .optional(),
39
+ });
40
+ //# sourceMappingURL=TrackPersonEvent.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrackPersonEvent.schema.js","sourceRoot":"","sources":["../../../../../../extensions/customerIo/lib/api/schema/TrackPersonEvent.schema.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAmB;AACnB,mCAA+C;AAElC,QAAA,iBAAiB,GAAG,aAAC;KAC/B,MAAM,CAAC;IACN,sCAAsC;IACtC,EAAE,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IACpC,MAAM,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC;KACD,MAAM,CACL,CAAC,IAAI,EAAE,EAAE;IACP,4CAA4C;IAC5C,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAA;IACvE,OAAO,KAAK,KAAK,CAAC,CAAA;AACpB,CAAC,EACD;IACE,OAAO,EAAE,mDAAmD;IAC5D,IAAI,EAAE,CAAC,aAAa,CAAC;CACtB,CACF,CAAA;AAEU,QAAA,2BAA2B,GAAG,aAAC,CAAC,MAAM,CAAC;IAClD,IAAI,EAAE,aAAC,CAAC,OAAO,CAAC,iBAAS,CAAC,MAAM,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,aAAC,CAAC,OAAO,CAAC,kBAAU,CAAC,MAAM,CAAC,KAAK,CAAC;IAC1C,WAAW,EAAE,yBAAiB;IAC9B,IAAI,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,UAAU,EAAE,aAAC,CAAC,MAAM,CAAC,aAAC,CAAC,MAAM,EAAE,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACxD,CAAC,CAAA;AAMW,QAAA,8BAA8B,GAAG,aAAC,CAAC,MAAM,CAAC;IACrD,MAAM,EAAE,aAAC;SACN,KAAK,CACJ,aAAC,CAAC,MAAM,CAAC;QACP,MAAM,EAAE,aAAC,CAAC,MAAM,EAAE;QAClB,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE;QACjB,OAAO,EAAE,aAAC,CAAC,MAAM,EAAE;KACpB,CAAC,CACH;SACA,QAAQ,EAAE;CACd,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { z } from 'zod';
2
+ export declare const ActionType: z.ZodEnum<["identify", "delete", "event", "screen", "page", "add_relationships", "delete_relationships", "add_device", "delete_device", "merge", "suppress", "unsuppress"]>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ActionType = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.ActionType = zod_1.z.enum([
6
+ 'identify',
7
+ 'delete',
8
+ 'event',
9
+ 'screen',
10
+ 'page',
11
+ 'add_relationships',
12
+ 'delete_relationships',
13
+ 'add_device',
14
+ 'delete_device',
15
+ 'merge',
16
+ 'suppress',
17
+ 'unsuppress',
18
+ ]);
19
+ //# sourceMappingURL=ActionType.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionType.schema.js","sourceRoot":"","sources":["../../../../../../../extensions/customerIo/lib/api/schema/atoms/ActionType.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,UAAU,GAAG,OAAC,CAAC,IAAI,CAAC;IAC/B,UAAU;IACV,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,MAAM;IACN,mBAAmB;IACnB,sBAAsB;IACtB,YAAY;IACZ,eAAe;IACf,OAAO;IACP,UAAU;IACV,YAAY;CACb,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { z } from 'zod';
2
+ export declare const EventType: z.ZodEnum<["person", "object", "delivery"]>;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EventType = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.EventType = zod_1.z.enum(['person', 'object', 'delivery']);
6
+ //# sourceMappingURL=EventType.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventType.schema.js","sourceRoot":"","sources":["../../../../../../../extensions/customerIo/lib/api/schema/atoms/EventType.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,SAAS,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './EventType.schema';
2
+ export * from './ActionType.schema';
@@ -0,0 +1,19 @@
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("./EventType.schema"), exports);
18
+ __exportStar(require("./ActionType.schema"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../extensions/customerIo/lib/api/schema/atoms/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAkC;AAClC,sDAAmC"}
@@ -0,0 +1 @@
1
+ export * from './TrackPersonEvent.schema';
@@ -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("./TrackPersonEvent.schema"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/customerIo/lib/api/schema/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAAyC"}
@@ -0,0 +1,12 @@
1
+ import { type AxiosResponse } from 'axios';
2
+ import { type TrackPersonEventInputType, type TrackPersonEventResponseType } from './schema';
3
+ export interface CustomerioTrackApiClientOptions {
4
+ apiKey: string;
5
+ siteId: string;
6
+ }
7
+ export declare class CustomerioTrackApiClient {
8
+ private readonly options;
9
+ private readonly client;
10
+ constructor(options: CustomerioTrackApiClientOptions);
11
+ trackPersonEvent(input: TrackPersonEventInputType): Promise<AxiosResponse<TrackPersonEventResponseType>>;
12
+ }
@@ -0,0 +1,26 @@
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.CustomerioTrackApiClient = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const TRACK_API_BASE_URL = 'https://track.customer.io';
9
+ class CustomerioTrackApiClient {
10
+ constructor(options) {
11
+ this.options = options;
12
+ this.client = axios_1.default.create({
13
+ baseURL: TRACK_API_BASE_URL,
14
+ headers: {
15
+ 'Content-Type': 'application/json',
16
+ Authorization: `Basic ${Buffer.from(`${this.options.siteId}:${this.options.apiKey}`).toString('base64')}`,
17
+ },
18
+ });
19
+ }
20
+ async trackPersonEvent(input) {
21
+ const response = await this.client.post(`/api/v2/entity`, input);
22
+ return response;
23
+ }
24
+ }
25
+ exports.CustomerioTrackApiClient = CustomerioTrackApiClient;
26
+ //# sourceMappingURL=trackApiClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trackApiClient.js","sourceRoot":"","sources":["../../../../../extensions/customerIo/lib/api/trackApiClient.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAqE;AAMrE,MAAM,kBAAkB,GAAG,2BAA2B,CAAA;AAOtD,MAAa,wBAAwB;IAGnC,YAA6B,OAAwC;QAAxC,YAAO,GAAP,OAAO,CAAiC;QACnE,IAAI,CAAC,MAAM,GAAG,eAAK,CAAC,MAAM,CAAC;YACzB,OAAO,EAAE,kBAAkB;YAC3B,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,SAAS,MAAM,CAAC,IAAI,CACjC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAChD,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;aACvB;SACF,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,gBAAgB,CACpB,KAAgC;QAEhC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CACrC,gBAAgB,EAChB,KAAK,CACN,CAAA;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF;AAzBD,4DAyBC"}
@@ -0,0 +1 @@
1
+ export { validatePayloadAndCreateSdks } from './validatePayloadAndCreateSdk';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validatePayloadAndCreateSdks = void 0;
4
+ var validatePayloadAndCreateSdk_1 = require("./validatePayloadAndCreateSdk");
5
+ Object.defineProperty(exports, "validatePayloadAndCreateSdks", { enumerable: true, get: function () { return validatePayloadAndCreateSdk_1.validatePayloadAndCreateSdks; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/customerIo/lib/index.ts"],"names":[],"mappings":";;;AAAA,6EAA4E;AAAnE,2IAAA,4BAA4B,OAAA"}
@@ -0,0 +1,18 @@
1
+ import { type NewActivityPayload, type Pathway, type Patient } from '@awell-health/extensions-core';
2
+ import z from 'zod';
3
+ import { SettingsValidationSchema } from '../settings';
4
+ import { type Activity } from '@awell-health/extensions-core/dist/types/Activity';
5
+ import { CustomerioTrackApiClient } from './api';
6
+ type ValidatePayloadAndCreateSdks = <T extends z.ZodTypeAny, P extends NewActivityPayload<any, any>>(args: {
7
+ fieldsSchema: T;
8
+ payload: P;
9
+ }) => Promise<{
10
+ customerIoTrackClient: CustomerioTrackApiClient;
11
+ fields: z.infer<(typeof args)['fieldsSchema']>;
12
+ settings: z.infer<typeof SettingsValidationSchema>;
13
+ pathway: Pathway;
14
+ patient: Patient;
15
+ activity: Activity;
16
+ }>;
17
+ export declare const validatePayloadAndCreateSdks: ValidatePayloadAndCreateSdks;
18
+ export {};
@@ -0,0 +1,34 @@
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.validatePayloadAndCreateSdks = void 0;
7
+ const extensions_core_1 = require("@awell-health/extensions-core");
8
+ const zod_1 = __importDefault(require("zod"));
9
+ const settings_1 = require("../settings");
10
+ const api_1 = require("./api");
11
+ const validatePayloadAndCreateSdks = async ({ fieldsSchema, payload }) => {
12
+ const { settings: { siteId, apiKey }, fields, settings, } = (0, extensions_core_1.validate)({
13
+ schema: zod_1.default.object({
14
+ fields: fieldsSchema,
15
+ settings: settings_1.SettingsValidationSchema,
16
+ }),
17
+ payload,
18
+ });
19
+ const { patient, pathway, activity } = payload;
20
+ const customerIoTrackClient = new api_1.CustomerioTrackApiClient({
21
+ siteId,
22
+ apiKey,
23
+ });
24
+ return {
25
+ customerIoTrackClient,
26
+ fields,
27
+ settings,
28
+ patient,
29
+ pathway,
30
+ activity,
31
+ };
32
+ };
33
+ exports.validatePayloadAndCreateSdks = validatePayloadAndCreateSdks;
34
+ //# sourceMappingURL=validatePayloadAndCreateSdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validatePayloadAndCreateSdk.js","sourceRoot":"","sources":["../../../../extensions/customerIo/lib/validatePayloadAndCreateSdk.ts"],"names":[],"mappings":";;;;;;AAAA,mEAKsC;AACtC,8CAAmB;AACnB,0CAAsD;AAEtD,+BAAgD;AAiBzC,MAAM,4BAA4B,GACvC,KAAK,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,EAAE;IAClC,MAAM,EACJ,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAC5B,MAAM,EACN,QAAQ,GACT,GAAG,IAAA,0BAAQ,EAAC;QACX,MAAM,EAAE,aAAC,CAAC,MAAM,CAAC;YACf,MAAM,EAAE,YAAY;YACpB,QAAQ,EAAE,mCAAwB;SACnC,CAAC;QACF,OAAO;KACR,CAAC,CAAA;IAEF,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAA;IAE9C,MAAM,qBAAqB,GAAG,IAAI,8BAAwB,CAAC;QACzD,MAAM;QACN,MAAM;KACP,CAAC,CAAA;IAEF,OAAO;QACL,qBAAqB;QACrB,MAAM;QACN,QAAQ;QACR,OAAO;QACP,OAAO;QACP,QAAQ;KACT,CAAA;AACH,CAAC,CAAA;AA7BU,QAAA,4BAA4B,gCA6BtC"}
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ export declare const settings: {
3
+ siteId: {
4
+ key: string;
5
+ label: string;
6
+ description: string;
7
+ obfuscated: false;
8
+ required: true;
9
+ };
10
+ apiKey: {
11
+ key: string;
12
+ label: string;
13
+ description: string;
14
+ obfuscated: true;
15
+ required: true;
16
+ };
17
+ };
18
+ export declare const SettingsValidationSchema: z.ZodObject<{
19
+ siteId: z.ZodString;
20
+ apiKey: z.ZodString;
21
+ }, "strip", z.ZodTypeAny, {
22
+ apiKey: string;
23
+ siteId: string;
24
+ }, {
25
+ apiKey: string;
26
+ siteId: string;
27
+ }>;
@@ -0,0 +1,25 @@
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
+ siteId: {
7
+ key: 'siteId',
8
+ label: 'Site ID',
9
+ description: 'This ID references the workspace you are working in.',
10
+ obfuscated: false,
11
+ required: true,
12
+ },
13
+ apiKey: {
14
+ key: 'apiKey',
15
+ label: 'API Key',
16
+ description: 'The API key needed to authenticate requests to the Customer.io API.',
17
+ obfuscated: true,
18
+ required: true,
19
+ },
20
+ };
21
+ exports.SettingsValidationSchema = zod_1.z.object({
22
+ siteId: zod_1.z.string().min(1),
23
+ apiKey: zod_1.z.string().min(1),
24
+ });
25
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../extensions/customerIo/settings.ts"],"names":[],"mappings":";;;AACA,6BAAwC;AAE3B,QAAA,QAAQ,GAAG;IACtB,MAAM,EAAE;QACN,GAAG,EAAE,QAAQ;QACb,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,sDAAsD;QACnE,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,IAAI;KACf;IACD,MAAM,EAAE;QACN,GAAG,EAAE,QAAQ;QACb,KAAK,EAAE,SAAS;QAChB,WAAW,EACT,qEAAqE;QACvE,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;KACf;CACgC,CAAA;AAEtB,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC0B,CAAC,CAAA"}
@@ -46,6 +46,7 @@ const cerner_1 = require("./cerner");
46
46
  const cloudinary_1 = require("./cloudinary");
47
47
  const cmDotCom_1 = require("./cmDotCom");
48
48
  const collectData_1 = require("./collectData");
49
+ const customerIo_1 = require("./customerIo");
49
50
  const dateHelpers_1 = require("./dateHelpers");
50
51
  const dockHealth_1 = require("./dockHealth");
51
52
  const docuSign_1 = require("./docuSign");
@@ -98,6 +99,7 @@ exports.extensions = [
98
99
  cloudinary_1.Cloudinary,
99
100
  cmDotCom_1.CmDotCom,
100
101
  collectData_1.CollectData,
102
+ customerIo_1.customerIo,
101
103
  dateHelpers_1.dateHelpers,
102
104
  dockHealth_1.dockHealth,
103
105
  docuSign_1.DocuSign,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../extensions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA6C;AAC7C,mCAA+B;AAC/B,6CAAyC;AACzC,mCAA+B;AAC/B,mCAA+B;AAC/B,2CAAuC;AACvC,yCAAqC;AACrC,mDAA+C;AAC/C,qCAAiC;AACjC,6CAAyC;AACzC,yCAAqC;AACrC,+CAA2C;AAC3C,+CAA2C;AAC3C,6CAAyC;AACzC,yCAAqC;AACrC,+CAA2C;AAC3C,uCAAmC;AACnC,iCAA6B;AAC7B,iDAA6C;AAC7C,uDAAkD;AAClD,yCAAqC;AACrC,2CAAuC;AACvC,yCAAqC;AACrC,+CAA0C;AAC1C,uCAAmC;AACnC,iEAA6D;AAC7D,uCAAmC;AACnC,yCAAqC;AACrC,2CAAuC;AACvC,uCAAmC;AACnC,iCAAsC;AACtC,uCAAmC;AACnC,+CAA2C;AAC3C,0CAA0C;AAC1C,+CAA2C;AAC3C,iCAA6B;AAC7B,yCAAqC;AACrC,6DAA+C;AAC/C,iCAA6B;AAC7B,qCAAiC;AACjC,qCAAiC;AACjC,yCAAqC;AACrC,yCAAqC;AACrC,+CAAyC;AACzC,2CAAuC;AACvC,qCAAiC;AACjC,uCAAmC;AACnC,yCAAqC;AACrC,uCAAmC;AAEnC,sDAAuC;AAG1B,QAAA,QAAQ,GAAa,IAAI,CAAA;AAEzB,QAAA,UAAU,GAAG;IACxB,aAAK;IACL,aAAK;IACL,2BAAY;IACZ,aAAK;IACL,uBAAU;IACV,qBAAS;IACT,mBAAQ;IACR,6BAAa;IACb,eAAM;IACN,uBAAU;IACV,mBAAQ;IACR,yBAAW;IACX,yBAAW;IACX,uBAAU;IACV,mBAAQ;IACR,yBAAW;IACX,iBAAO;IACP,WAAI;IACJ,2BAAY;IACZ,gCAAc;IACd,mBAAQ;IACR,qBAAS;IACT,mBAAQ;IACR,wBAAU;IACV,iBAAO;IACP,2CAAoB;IACpB,iBAAO;IACP,mBAAQ;IACR,qBAAS;IACT,iBAAO;IACP,oBAAa;IACb,yBAAW;IACX,iBAAO;IACP,aAAa;IACb,yBAAW;IACX,WAAI;IACJ,mBAAQ;IACR,6BAAQ;IACR,WAAI;IACJ,eAAM;IACN,eAAM;IACN,mBAAQ;IACR,mBAAQ;IACR,uBAAS;IACT,qBAAS;IACT,eAAM;IACN,iBAAO;IACP,mBAAQ;IACR,iBAAO;CACR,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../extensions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA6C;AAC7C,mCAA+B;AAC/B,6CAAyC;AACzC,mCAA+B;AAC/B,mCAA+B;AAC/B,2CAAuC;AACvC,yCAAqC;AACrC,mDAA+C;AAC/C,qCAAiC;AACjC,6CAAyC;AACzC,yCAAqC;AACrC,+CAA2C;AAC3C,6CAAyC;AACzC,+CAA2C;AAC3C,6CAAyC;AACzC,yCAAqC;AACrC,+CAA2C;AAC3C,uCAAmC;AACnC,iCAA6B;AAC7B,iDAA6C;AAC7C,uDAAkD;AAClD,yCAAqC;AACrC,2CAAuC;AACvC,yCAAqC;AACrC,+CAA0C;AAC1C,uCAAmC;AACnC,iEAA6D;AAC7D,uCAAmC;AACnC,yCAAqC;AACrC,2CAAuC;AACvC,uCAAmC;AACnC,iCAAsC;AACtC,uCAAmC;AACnC,+CAA2C;AAC3C,0CAA0C;AAC1C,+CAA2C;AAC3C,iCAA6B;AAC7B,yCAAqC;AACrC,6DAA+C;AAC/C,iCAA6B;AAC7B,qCAAiC;AACjC,qCAAiC;AACjC,yCAAqC;AACrC,yCAAqC;AACrC,+CAAyC;AACzC,2CAAuC;AACvC,qCAAiC;AACjC,uCAAmC;AACnC,yCAAqC;AACrC,uCAAmC;AAEnC,sDAAuC;AAG1B,QAAA,QAAQ,GAAa,IAAI,CAAA;AAEzB,QAAA,UAAU,GAAG;IACxB,aAAK;IACL,aAAK;IACL,2BAAY;IACZ,aAAK;IACL,uBAAU;IACV,qBAAS;IACT,mBAAQ;IACR,6BAAa;IACb,eAAM;IACN,uBAAU;IACV,mBAAQ;IACR,yBAAW;IACX,uBAAU;IACV,yBAAW;IACX,uBAAU;IACV,mBAAQ;IACR,yBAAW;IACX,iBAAO;IACP,WAAI;IACJ,2BAAY;IACZ,gCAAc;IACd,mBAAQ;IACR,qBAAS;IACT,mBAAQ;IACR,wBAAU;IACV,iBAAO;IACP,2CAAoB;IACpB,iBAAO;IACP,mBAAQ;IACR,qBAAS;IACT,iBAAO;IACP,oBAAa;IACb,yBAAW;IACX,iBAAO;IACP,aAAa;IACb,yBAAW;IACX,WAAI;IACJ,mBAAQ;IACR,6BAAQ;IACR,WAAI;IACJ,eAAM;IACN,eAAM;IACN,mBAAQ;IACR,mBAAQ;IACR,uBAAS;IACT,qBAAS;IACT,eAAM;IACN,iBAAO;IACP,mBAAQ;IACR,iBAAO;CACR,CAAA"}
@@ -47,6 +47,10 @@
47
47
  "readme": "---\ntitle: Advanced data collection\ndescription: Collect data from your users using a variety of input types and data sources\n---\n\nThis extension allows you to collect data from your users using a variety of more advanced input types and data sources.\n\n## Extension settings\n\nIn order to set up this extension, no settings are required.\n\n## Custom Actions\n\n### Dynamic choice selector\n\nStandard select questions in Awell forms have a discrete set of choices to select from that are defined at the time that the form is created. If the list of choices to present to your responders isn't known at the time the form is being built, or changes often, this action allows you to load choices dynamically from a remote data source.\n\nDynamically-loaded choices must minimally adhere to the following format in a list form (i.e. an array):\n\n```json\n[\n {\n \"id\": \"unique-id-1\",\n \"label\": \"Choice label 1\",\n \"value\": \"Choice value 1\"\n },\n {\n \"id\": \"unique-id-2\",\n \"label\": \"Choice label 2\",\n \"value\": \"Choice value 2\"\n }\n]\n```\n\nThe `id`, `label`, and `value` fields are required. However, additional fields can be added to the object. Besides the `label` and `value`, which are available as distinct data points, the additional data of the selected choice will also be returned as a data point.\n\nExample:\n\n```json\n[\n {\n \"id\": \"unique-id-1\",\n \"label\": \"Choice label 1\",\n \"value\": \"Choice value 1\",\n \"additionalData\": \"Additional data\",\n \"nestedData\": {\n \"nested\": \"value\"\n }\n }\n]\n```\n\nAdditionally, you can specify a free text search field (`Options - Search query param` field) to allow users to search through the choices. This is optional but highly recommended. If not specified, the choices will be fetched on question load and presented in a static list that cannot be filtered.\n\nAs an example, using the endpoint `https://example.com/choices` with a query parameter `search` (e.g. `https://example.com/choices?search=QUERY` where `QUERY` is whatever the user typed into the input), then the API is expected to return the choices based on that match the search term.\n\nWe recommend that your search logic returns an _alphabetically-sorted_ list of all options where the _lowercase_ label names _contain_ the _lowercase_ search term.\n\n```js\n// Example search logic\nconst searchTerm = req.query.search\nconst results = []\n\noptions.forEach((option) => {\n if (option.label.toLowerCase().includes(searchTerm.toLowerCase())) {\n results.push({\n label: option.label,\n value: option.value,\n id: option.id,\n })\n }\n})\n\nconst sortedResults = results.sort((a, b) => a.label.localeCompare(b.label))\nres.json(results)\n```\n\n### Collect medication\n\nThis action enables patients to list their medications. They can add multiple medications, providing the name, dosage, and any specific instructions for each one.\n",
48
48
  "changelog": "# Collect Data changelog\n"
49
49
  },
50
+ "customerIo": {
51
+ "readme": "---\ntitle: Customer.io\ndescription: Customer.io is a customer engagement platform designed to create personalized customer journeys that engage, convert, and scale.\n---\n\n## Customer.io\n\nCustomer.io is a customer engagement platform designed to create personalized customer journeys that engage, convert, and scale.\n\n## Settings and setup\n\nTo start using the Customer.io extension, you need to create an account and get your API key and site ID.\n\n## Actions\n\n### Track person event\n\nTracks an event for a person in Customer.io. You can identify a person using `email`, `cio_id` or `id`, give your event a name and optional attributes.\n\nBy default, Awell adds the following attributes to the event:\n\n- `_awell_careflow_id`: The ID of the careflow.\n- `_awell_careflow_definition_id`: The ID of the careflow definition.\n- `_awell_patient_id`: The ID of the patient.\n- `_awell_activity_id`: The ID of the activity.\n- `_awell_identifier_{system_namespace}`: For every identifier the patient has in Awell, an attribute is added with the system namespace as the key and the identifier value as the value.\n\n",
52
+ "changelog": "# Customer.io changelog"
53
+ },
50
54
  "dateHelpers": {
51
55
  "readme": "---\ntitle: Date helpers\ndescription: A set of utility actions to help with common and useful date and time operations.\n---\n\n# Date helpers\n\nA set of utility actions to help with common and useful date and time operations.\n\n## Actions\n\n### Get next workday\n\nReturns the next workday (Monday to Friday) based on a reference date.\n\nIf the reference date is a weekday and \"Include reference date\" is enabled, the reference date is returned. If it's a weekend or \"Include reference date\" is disabled, the next weekday is returned instead.\n\n**Examples:**\n\n- Reference date: Thursday, April 17\n - Include reference date enabled → returns Thursday, April 17\n - Include reference date disabled → returns Friday, April 18\n- Reference date: Sunday, April 20\n - Include reference date enabled → returns Monday, April 21\n - Include reference date disabled → returns Monday, April 21\n\n✅ Include reference date enabled or disabled → returns Monday, April 21\n\nThis action does not account for holidays.",
52
56
  "changelog": "# Date helopers\n"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awell-health/awell-extensions",
3
- "version": "2.0.240",
3
+ "version": "2.0.241",
4
4
  "packageManager": "yarn@4.5.3",
5
5
  "main": "dist/src/index.js",
6
6
  "repository": {