@awell-health/awell-extensions 2.0.294 → 2.0.296
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.
- package/dist/extensions/index.js +2 -0
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/landingAi/actions/documentExtraction/config/dataPoints.d.ts +18 -0
- package/dist/extensions/landingAi/actions/documentExtraction/config/dataPoints.js +22 -0
- package/dist/extensions/landingAi/actions/documentExtraction/config/dataPoints.js.map +1 -0
- package/dist/extensions/landingAi/actions/documentExtraction/config/fields.d.ts +44 -0
- package/dist/extensions/landingAi/actions/documentExtraction/config/fields.js +69 -0
- package/dist/extensions/landingAi/actions/documentExtraction/config/fields.js.map +1 -0
- package/dist/extensions/landingAi/actions/documentExtraction/config/index.d.ts +2 -0
- package/dist/extensions/landingAi/actions/documentExtraction/config/index.js +9 -0
- package/dist/extensions/landingAi/actions/documentExtraction/config/index.js.map +1 -0
- package/dist/extensions/landingAi/actions/documentExtraction/documentExtraction.d.ts +4 -0
- package/dist/extensions/landingAi/actions/documentExtraction/documentExtraction.js +67 -0
- package/dist/extensions/landingAi/actions/documentExtraction/documentExtraction.js.map +1 -0
- package/dist/extensions/landingAi/actions/documentExtraction/index.d.ts +1 -0
- package/dist/extensions/landingAi/actions/documentExtraction/index.js +18 -0
- package/dist/extensions/landingAi/actions/documentExtraction/index.js.map +1 -0
- package/dist/extensions/landingAi/actions/index.d.ts +39 -0
- package/dist/extensions/landingAi/actions/index.js +8 -0
- package/dist/extensions/landingAi/actions/index.js.map +1 -0
- package/dist/extensions/landingAi/index.d.ts +2 -0
- package/dist/extensions/landingAi/index.js +19 -0
- package/dist/extensions/landingAi/index.js.map +1 -0
- package/dist/extensions/landingAi/lib/api/client.d.ts +10 -0
- package/dist/extensions/landingAi/lib/api/client.js +65 -0
- package/dist/extensions/landingAi/lib/api/client.js.map +1 -0
- package/dist/extensions/landingAi/lib/api/schema/AgenticDocumentAnalysis.schema.d.ts +131 -0
- package/dist/extensions/landingAi/lib/api/schema/AgenticDocumentAnalysis.schema.js +36 -0
- package/dist/extensions/landingAi/lib/api/schema/AgenticDocumentAnalysis.schema.js.map +1 -0
- package/dist/extensions/landingAi/lib/api/schema/index.d.ts +1 -0
- package/dist/extensions/landingAi/lib/api/schema/index.js +18 -0
- package/dist/extensions/landingAi/lib/api/schema/index.js.map +1 -0
- package/dist/extensions/landingAi/lib/validatePayloadAndCreateSdk.d.ts +18 -0
- package/dist/extensions/landingAi/lib/validatePayloadAndCreateSdk.js +35 -0
- package/dist/extensions/landingAi/lib/validatePayloadAndCreateSdk.js.map +1 -0
- package/dist/extensions/landingAi/settings.d.ts +17 -0
- package/dist/extensions/landingAi/settings.js +17 -0
- package/dist/extensions/landingAi/settings.js.map +1 -0
- package/dist/extensions/markdown.json +5 -1
- package/dist/extensions/westFax/actions/getFaxDocument/config/dataPoints.d.ts +26 -0
- package/dist/extensions/westFax/actions/getFaxDocument/config/dataPoints.js +30 -0
- package/dist/extensions/westFax/actions/getFaxDocument/config/dataPoints.js.map +1 -0
- package/dist/extensions/westFax/actions/getFaxDocument/config/fields.d.ts +18 -0
- package/dist/extensions/westFax/actions/getFaxDocument/config/fields.js +18 -0
- package/dist/extensions/westFax/actions/getFaxDocument/config/fields.js.map +1 -0
- package/dist/extensions/westFax/actions/getFaxDocument/config/index.d.ts +1 -0
- package/dist/extensions/westFax/actions/getFaxDocument/config/index.js +6 -0
- package/dist/extensions/westFax/actions/getFaxDocument/config/index.js.map +1 -0
- package/dist/extensions/westFax/actions/getFaxDocument/getFaxDocument.d.ts +4 -0
- package/dist/extensions/westFax/actions/getFaxDocument/getFaxDocument.js +84 -0
- package/dist/extensions/westFax/actions/getFaxDocument/getFaxDocument.js.map +1 -0
- package/dist/extensions/westFax/actions/getFaxDocument/index.d.ts +1 -0
- package/dist/extensions/westFax/actions/getFaxDocument/index.js +6 -0
- package/dist/extensions/westFax/actions/getFaxDocument/index.js.map +1 -0
- package/dist/extensions/westFax/actions/index.d.ts +45 -0
- package/dist/extensions/westFax/actions/index.js +2 -0
- package/dist/extensions/westFax/actions/index.js.map +1 -1
- package/dist/extensions/westFax/index.js +2 -0
- package/dist/extensions/westFax/index.js.map +1 -1
- package/dist/extensions/westFax/lib/api/client.d.ts +14 -0
- package/dist/extensions/westFax/lib/api/client.js +52 -0
- package/dist/extensions/westFax/lib/api/client.js.map +1 -0
- package/dist/extensions/westFax/lib/api/schema/GetFaxDocument.schema.d.ts +150 -0
- package/dist/extensions/westFax/lib/api/schema/GetFaxDocument.schema.js +37 -0
- package/dist/extensions/westFax/lib/api/schema/GetFaxDocument.schema.js.map +1 -0
- package/dist/extensions/westFax/lib/api/schema/index.d.ts +1 -0
- package/dist/extensions/westFax/lib/api/schema/index.js +18 -0
- package/dist/extensions/westFax/lib/api/schema/index.js.map +1 -0
- package/dist/extensions/westFax/lib/validatePayloadAndCreateSdk.d.ts +18 -0
- package/dist/extensions/westFax/lib/validatePayloadAndCreateSdk.js +41 -0
- package/dist/extensions/westFax/lib/validatePayloadAndCreateSdk.js.map +1 -0
- package/dist/extensions/westFax/settings.d.ts +10 -0
- package/dist/extensions/westFax/settings.js +8 -0
- package/dist/extensions/westFax/settings.js.map +1 -1
- package/dist/extensions/westFax/webhooks/FaxReceived/__testdata__/faxReceived.mock.d.ts +5 -0
- package/dist/extensions/westFax/webhooks/FaxReceived/__testdata__/faxReceived.mock.js +9 -0
- package/dist/extensions/westFax/webhooks/FaxReceived/__testdata__/faxReceived.mock.js.map +1 -0
- package/dist/extensions/westFax/webhooks/FaxReceived/faxReceived.d.ts +20 -0
- package/dist/extensions/westFax/webhooks/FaxReceived/faxReceived.js +42 -0
- package/dist/extensions/westFax/webhooks/FaxReceived/faxReceived.js.map +1 -0
- package/dist/extensions/westFax/webhooks/FaxReceived/index.d.ts +1 -0
- package/dist/extensions/westFax/webhooks/FaxReceived/index.js +18 -0
- package/dist/extensions/westFax/webhooks/FaxReceived/index.js.map +1 -0
- package/dist/extensions/westFax/webhooks/FaxReceived/types.d.ts +15 -0
- package/dist/extensions/westFax/webhooks/FaxReceived/types.js +10 -0
- package/dist/extensions/westFax/webhooks/FaxReceived/types.js.map +1 -0
- package/dist/extensions/westFax/webhooks/index.d.ts +34 -0
- package/dist/extensions/westFax/webhooks/index.js +6 -0
- package/dist/extensions/westFax/webhooks/index.js.map +1 -0
- package/package.json +1 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AgenticDocumentAnalysis.schema.js","sourceRoot":"","sources":["../../../../../../extensions/landingAi/lib/api/schema/AgenticDocumentAnalysis.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,kCAAkC,GAAG,OAAC,CAAC,MAAM,CAAC;IACzD,KAAK,EAAE,OAAC;SACL,MAAM,CAAC;QACN,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC5B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC/B,CAAC;SACD,QAAQ,EAAE;SACV,QAAQ,EAAE;IACb,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC;QACb,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC5B,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC1B,kBAAkB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;QAC7C,4BAA4B,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;QACvD,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACrC,CAAC;CACH,CAAC,CAAA;AAMW,QAAA,qCAAqC,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5D,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC;QACb,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;QACpB,MAAM,EAAE,OAAC,CAAC,KAAK,CACb,OAAC,CAAC,MAAM,CAAC;YACP,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;YAChB,UAAU,EAAE,OAAC,CAAC,GAAG,EAAE;YACnB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;YACpB,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE;SACvC,CAAC,CACH;QACD,gBAAgB,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE;QAC1D,mBAAmB,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE;KAC9D,CAAC;IACF,MAAM,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,OAAO,EAAE,CAAC;IAC5B,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './AgenticDocumentAnalysis.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("./AgenticDocumentAnalysis.schema"), exports);
|
18
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/landingAi/lib/api/schema/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAgD"}
|
@@ -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 { LandingAiApiClient } from './api/client';
|
6
|
+
type ValidatePayloadAndCreateSdk = <T extends z.ZodTypeAny, P extends NewActivityPayload<any, any>>(args: {
|
7
|
+
fieldsSchema: T;
|
8
|
+
payload: P;
|
9
|
+
}) => Promise<{
|
10
|
+
landingAiSdk: LandingAiApiClient;
|
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 validatePayloadAndCreateSdk: ValidatePayloadAndCreateSdk;
|
18
|
+
export {};
|
@@ -0,0 +1,35 @@
|
|
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.validatePayloadAndCreateSdk = 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 client_1 = require("./api/client");
|
11
|
+
const validatePayloadAndCreateSdk = async ({ fieldsSchema, payload, }) => {
|
12
|
+
const { settings, fields } = (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 baseUrl = `https://api.va.landing.ai`;
|
21
|
+
const landingAiSdk = new client_1.LandingAiApiClient({
|
22
|
+
baseUrl,
|
23
|
+
apiKey: settings.apiKey,
|
24
|
+
});
|
25
|
+
return {
|
26
|
+
landingAiSdk,
|
27
|
+
settings,
|
28
|
+
fields,
|
29
|
+
patient,
|
30
|
+
pathway,
|
31
|
+
activity,
|
32
|
+
};
|
33
|
+
};
|
34
|
+
exports.validatePayloadAndCreateSdk = validatePayloadAndCreateSdk;
|
35
|
+
//# sourceMappingURL=validatePayloadAndCreateSdk.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"validatePayloadAndCreateSdk.js","sourceRoot":"","sources":["../../../../extensions/landingAi/lib/validatePayloadAndCreateSdk.ts"],"names":[],"mappings":";;;;;;AAAA,mEAKsC;AACtC,8CAAmB;AACnB,0CAAsD;AAEtD,yCAAiD;AAiB1C,MAAM,2BAA2B,GAAgC,KAAK,EAAE,EAC7E,YAAY,EACZ,OAAO,GACR,EAAE,EAAE;IACH,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAA,0BAAQ,EAAC;QACpC,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,OAAO,GAAG,2BAA2B,CAAA;IAE3C,MAAM,YAAY,GAAG,IAAI,2BAAkB,CAAC;QAC1C,OAAO;QACP,MAAM,EAAE,QAAQ,CAAC,MAAM;KACxB,CAAC,CAAA;IAEF,OAAO;QACL,YAAY;QACZ,QAAQ;QACR,MAAM;QACN,OAAO;QACP,OAAO;QACP,QAAQ;KACT,CAAA;AACH,CAAC,CAAA;AA7BY,QAAA,2BAA2B,+BA6BvC"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
export declare const settings: {
|
3
|
+
apiKey: {
|
4
|
+
key: string;
|
5
|
+
label: string;
|
6
|
+
description: string;
|
7
|
+
required: true;
|
8
|
+
obfuscated: true;
|
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,17 @@
|
|
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
|
+
key: 'apiKey',
|
8
|
+
label: 'API key',
|
9
|
+
description: '',
|
10
|
+
required: true,
|
11
|
+
obfuscated: true,
|
12
|
+
},
|
13
|
+
};
|
14
|
+
exports.SettingsValidationSchema = zod_1.z.object({
|
15
|
+
apiKey: zod_1.z.string().min(1),
|
16
|
+
});
|
17
|
+
//# sourceMappingURL=settings.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../extensions/landingAi/settings.ts"],"names":[],"mappings":";;;AACA,6BAAwC;AAE3B,QAAA,QAAQ,GAAG;IACtB,MAAM,EAAE;QACN,GAAG,EAAE,QAAQ;QACb,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,EAAE;QACf,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,IAAI;KACjB;CACgC,CAAA;AAEtB,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC0B,CAAC,CAAA"}
|
@@ -127,6 +127,10 @@
|
|
127
127
|
"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\n### Track Event\n\nTrack an event in Iterable.\n\n**Important:** Provide an `email` or a `userId` (but not both), depending on how your [project identifies users](https://support.iterable.com/hc/articles/204780579#identifying-users).\n",
|
128
128
|
"changelog": "# Iterable changelog\n"
|
129
129
|
},
|
130
|
+
"landingAi": {
|
131
|
+
"readme": "---\ntitle: Landing.ai\ndescription: Turn your documents and images into visual intelligence. LandingAI’s cutting-edge software platform makes computer vision easy for a wide range of applications across all industries.\n---\n\n# Landing.ai\n\nTurn your documents and images into visual intelligence. LandingAI’s cutting-edge software platform makes computer vision easy for a wide range of applications across all industries.\n\n## Extension settings\n\nTo enable the extension, you must configure an API key. You can obtain this key from the Landing.ai platform.\n\n## Actions\n\n### Document extraction\n\nExtract structured data from an image or PDF by providing a URL to the file. Please note that the file has to be publicly accessible. If you require enhanced security, we can also build custom connectors to access secure data stores such as Google Cloud Storage (GCS), AWS, and others. Please contact our customer support team to explore this option.\n\nIn most cases, you'll want to specify the \"Fields schema\", which allows you to define what data to extract and the desired output format. This schema must be written in JSON following a specific format.\n\nWe recommend creating the schema using Landing.ai’s playground, [exporting it](https://docs.landing.ai/ade/ade-extract-playground#export-the-schema), and then copying it into Awell.\n\nExample schema:\n```json\n{\n \"type\": \"object\",\n \"title\": \"Physician Referral Extraction Schema\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"required\": [\n \"date_of_birth\",\n \"urgency\",\n \"Referral reason\"\n ],\n \"properties\": {\n \"date_of_birth\": {\n \"type\": \"string\",\n \"format\": \"YYYY-MM-DD\",\n \"description\": \"Date of birth of the patient\"\n },\n \"urgency\": {\n \"type\": \"string\",\n \"description\": \"Urgency of the referral\"\n },\n \"Referral reason\": {\n \"type\": \"string\",\n \"description\": \"Reason of the referral\"\n }\n },\n \"description\": \"Schema for extracting high-value, form-like fields from a physician's referral markdown document.\"\n}\n```\n\n",
|
132
|
+
"changelog": "# CHANGELOG"
|
133
|
+
},
|
130
134
|
"mailchimp": {
|
131
135
|
"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",
|
132
136
|
"changelog": "# Mailchimp changelog"
|
@@ -200,7 +204,7 @@
|
|
200
204
|
"changelog": "# Twilio changelog\n\n## v2 2024-02-22\n\n1. Add capability to search for messages using all the allowed filters provided by Twilio API. Check here: https://www.twilio.com/docs/messaging/api/message-resource#read-multiple-message-resources\n\n## v2 2023-06-23\n\nFull description: https://github.com/awell-health/awell-extensions/issues/157\n\n1. \"Send SMS\" action\n 1. Change label from \"Send SMS\" to \"Send SMS (with from number)\"\n 2. Throw error when \"From\" number in both settings and in fields is not provided\n2. Add new action \"Send SMS (with Messaging Service)\"\n\n## v2\n\nCompared to v1 (pre-beta release), the extension only has one custom action \"Send SMS\" instead of two. The Custom Action allows for:\n\n1. Sending a text message to a recipient (phone number) stored in a data point, including patient profile data points.\n2. Sending a text message to a fixed recipient (phone number).\n"
|
201
205
|
},
|
202
206
|
"westFax": {
|
203
|
-
"readme": "---\ntitle: WestFax\ndescription: WestFax is a leading provider of HIPAA Compliant Cloud Fax / Fax to Email, Print to Fax\n---\n\n# WestFax\n\n[WestFax](https://westfax.com/) is a cloud-based faxing service that offers a variety of features, including:\n- Secure faxing: WestFax uses end-to-end encryption to protect your documents from unauthorized access.\n- HIPAA compliance: WestFax is HIPAA compliant, so you can be sure that your medical records are safe.\n- Integration with other applications: WestFax can be integrated with your existing email, CRM, and other applications.\n- Mobile app: You can send and receive faxes from your mobile device with the WestFax mobile app.\n- Paperless faxing: WestFax can store your faxes in the cloud, so you can access them from anywhere.\n\n## WestFax x Awell\n\nThis extension allows you to let a stakeholder (eg: a patient) send a fax as part of a care flow.\n\n## Extension settings\n\nIn order to set up this extension, **you will need to provide a WestFax Username and Password**. You will need as well to provide the ProductId when setting up the action - check how [here](https://westfax.com/how-to-get-productid/).\n\n\n",
|
207
|
+
"readme": "---\ntitle: WestFax\ndescription: WestFax is a leading provider of HIPAA Compliant Cloud Fax / Fax to Email, Print to Fax\n---\n\n# WestFax\n\n[WestFax](https://westfax.com/) is a cloud-based faxing service that offers a variety of features, including:\n- Secure faxing: WestFax uses end-to-end encryption to protect your documents from unauthorized access.\n- HIPAA compliance: WestFax is HIPAA compliant, so you can be sure that your medical records are safe.\n- Integration with other applications: WestFax can be integrated with your existing email, CRM, and other applications.\n- Mobile app: You can send and receive faxes from your mobile device with the WestFax mobile app.\n- Paperless faxing: WestFax can store your faxes in the cloud, so you can access them from anywhere.\n\n## WestFax x Awell\n\nThis extension allows you to let a stakeholder (eg: a patient) send a fax as part of a care flow.\n\n## Extension settings\n\nIn order to set up this extension, **you will need to provide a WestFax Username and Password**. You will need as well to provide the ProductId when setting up the action - check how [here](https://westfax.com/how-to-get-productid/).\n\n## Actions\n\n### Get Fax document\n\nRetrieve a fax document using a fax ID, sometimes also referred to as a job ID.\n\n## Webhooks\n\n### Fax received\n\nTrigger a care flow when a fax is received. Currently only works together with https://github.com/awell-health/westfax-webhook-handler\n\n",
|
204
208
|
"changelog": "# WestFax changelog\n\n## February 2024\n\n- Initial action to send an fax to an email\n"
|
205
209
|
},
|
206
210
|
"workramp": {
|
@@ -0,0 +1,26 @@
|
|
1
|
+
export declare const dataPoints: {
|
2
|
+
base64EncodedFax: {
|
3
|
+
key: string;
|
4
|
+
valueType: "string";
|
5
|
+
};
|
6
|
+
direction: {
|
7
|
+
key: string;
|
8
|
+
valueType: "string";
|
9
|
+
};
|
10
|
+
date: {
|
11
|
+
key: string;
|
12
|
+
valueType: "date";
|
13
|
+
};
|
14
|
+
status: {
|
15
|
+
key: string;
|
16
|
+
valueType: "string";
|
17
|
+
};
|
18
|
+
format: {
|
19
|
+
key: string;
|
20
|
+
valueType: "string";
|
21
|
+
};
|
22
|
+
pageCount: {
|
23
|
+
key: string;
|
24
|
+
valueType: "number";
|
25
|
+
};
|
26
|
+
};
|
@@ -0,0 +1,30 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.dataPoints = void 0;
|
4
|
+
exports.dataPoints = {
|
5
|
+
base64EncodedFax: {
|
6
|
+
key: 'base64EncodedFax',
|
7
|
+
valueType: 'string',
|
8
|
+
},
|
9
|
+
direction: {
|
10
|
+
key: 'direction',
|
11
|
+
valueType: 'string',
|
12
|
+
},
|
13
|
+
date: {
|
14
|
+
key: 'date',
|
15
|
+
valueType: 'date',
|
16
|
+
},
|
17
|
+
status: {
|
18
|
+
key: 'status',
|
19
|
+
valueType: 'string',
|
20
|
+
},
|
21
|
+
format: {
|
22
|
+
key: 'format',
|
23
|
+
valueType: 'string',
|
24
|
+
},
|
25
|
+
pageCount: {
|
26
|
+
key: 'pageCount',
|
27
|
+
valueType: 'number',
|
28
|
+
},
|
29
|
+
};
|
30
|
+
//# sourceMappingURL=dataPoints.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"dataPoints.js","sourceRoot":"","sources":["../../../../../../extensions/westFax/actions/getFaxDocument/config/dataPoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,gBAAgB,EAAE;QAChB,GAAG,EAAE,kBAAkB;QACvB,SAAS,EAAE,QAAQ;KACpB;IACD,SAAS,EAAE;QACT,GAAG,EAAE,WAAW;QAChB,SAAS,EAAE,QAAQ;KACpB;IACD,IAAI,EAAE;QACJ,GAAG,EAAE,MAAM;QACX,SAAS,EAAE,MAAM;KAClB;IACD,MAAM,EAAE;QACN,GAAG,EAAE,QAAQ;QACb,SAAS,EAAE,QAAQ;KACpB;IACD,MAAM,EAAE;QACN,GAAG,EAAE,QAAQ;QACb,SAAS,EAAE,QAAQ;KACpB;IACD,SAAS,EAAE;QACT,GAAG,EAAE,WAAW;QAChB,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { FieldType } from '@awell-health/extensions-core';
|
2
|
+
import { type ZodTypeAny, z } from 'zod';
|
3
|
+
export declare const fields: {
|
4
|
+
faxId: {
|
5
|
+
id: string;
|
6
|
+
label: string;
|
7
|
+
description: string;
|
8
|
+
type: FieldType.STRING;
|
9
|
+
required: true;
|
10
|
+
};
|
11
|
+
};
|
12
|
+
export declare const FieldsValidationSchema: z.ZodObject<{
|
13
|
+
faxId: z.ZodString;
|
14
|
+
}, "strip", ZodTypeAny, {
|
15
|
+
faxId: string;
|
16
|
+
}, {
|
17
|
+
faxId: string;
|
18
|
+
}>;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.FieldsValidationSchema = exports.fields = void 0;
|
4
|
+
const extensions_core_1 = require("@awell-health/extensions-core");
|
5
|
+
const zod_1 = require("zod");
|
6
|
+
exports.fields = {
|
7
|
+
faxId: {
|
8
|
+
id: 'faxId',
|
9
|
+
label: 'Fax Id',
|
10
|
+
description: 'Sometimes also referred to as the job ID',
|
11
|
+
type: extensions_core_1.FieldType.STRING,
|
12
|
+
required: true,
|
13
|
+
},
|
14
|
+
};
|
15
|
+
exports.FieldsValidationSchema = zod_1.z.object({
|
16
|
+
faxId: zod_1.z.string().min(1),
|
17
|
+
});
|
18
|
+
//# sourceMappingURL=fields.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/westFax/actions/getFaxDocument/config/fields.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,6BAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,KAAK,EAAE;QACL,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,QAAQ;QACf,WAAW,EAAE,0CAA0C;QACvD,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACyB,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { fields } from './fields';
|
@@ -0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.fields = void 0;
|
4
|
+
var fields_1 = require("./fields");
|
5
|
+
Object.defineProperty(exports, "fields", { enumerable: true, get: function () { return fields_1.fields; } });
|
6
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/westFax/actions/getFaxDocument/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAiC;AAAxB,gGAAA,MAAM,OAAA"}
|
@@ -0,0 +1,84 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getFaxDocument = void 0;
|
4
|
+
const extensions_core_1 = require("@awell-health/extensions-core");
|
5
|
+
const config_1 = require("./config");
|
6
|
+
const dataPoints_1 = require("./config/dataPoints");
|
7
|
+
const fields_1 = require("./config/fields");
|
8
|
+
const addEventLog_1 = require("../../../../src/lib/awell/addEventLog");
|
9
|
+
const validatePayloadAndCreateSdk_1 = require("../../lib/validatePayloadAndCreateSdk");
|
10
|
+
exports.getFaxDocument = {
|
11
|
+
key: 'getFaxDocument',
|
12
|
+
category: extensions_core_1.Category.COMMUNICATION,
|
13
|
+
title: 'Get fax document',
|
14
|
+
description: 'Get fax document with WestFax.',
|
15
|
+
fields: config_1.fields,
|
16
|
+
dataPoints: dataPoints_1.dataPoints,
|
17
|
+
previewable: false,
|
18
|
+
onActivityCreated: async (payload, onComplete, onError) => {
|
19
|
+
const { fields, westFaxSdk } = await (0, validatePayloadAndCreateSdk_1.validatePayloadAndCreateSdk)({
|
20
|
+
fieldsSchema: fields_1.FieldsValidationSchema,
|
21
|
+
payload,
|
22
|
+
});
|
23
|
+
const activityEventLog = [];
|
24
|
+
const response = await westFaxSdk.getFaxDocument({
|
25
|
+
Cookies: false,
|
26
|
+
FaxIds1: {
|
27
|
+
Id: fields.faxId,
|
28
|
+
},
|
29
|
+
format: 'pdf',
|
30
|
+
});
|
31
|
+
if (!response.data.Success) {
|
32
|
+
await onError({
|
33
|
+
events: [
|
34
|
+
(0, addEventLog_1.addActivityEventLog)({
|
35
|
+
message: `Error getting fax document:\n${JSON.stringify(response.data, null, 2)}`,
|
36
|
+
}),
|
37
|
+
],
|
38
|
+
});
|
39
|
+
return;
|
40
|
+
}
|
41
|
+
if (response.data.Result.length === 0) {
|
42
|
+
await onError({
|
43
|
+
events: [
|
44
|
+
(0, addEventLog_1.addActivityEventLog)({
|
45
|
+
message: 'No fax document found',
|
46
|
+
}),
|
47
|
+
],
|
48
|
+
});
|
49
|
+
return;
|
50
|
+
}
|
51
|
+
if (response.data.Result.length > 1) {
|
52
|
+
await onError({
|
53
|
+
events: [
|
54
|
+
(0, addEventLog_1.addActivityEventLog)({
|
55
|
+
message: 'More than one fax document found',
|
56
|
+
}),
|
57
|
+
],
|
58
|
+
});
|
59
|
+
return;
|
60
|
+
}
|
61
|
+
const faxDocument = response.data.Result[0];
|
62
|
+
if (faxDocument.FaxFiles[0].FileContents.length === 0) {
|
63
|
+
activityEventLog.push((0, addEventLog_1.addActivityEventLog)({
|
64
|
+
message: 'No fax file was found',
|
65
|
+
}));
|
66
|
+
}
|
67
|
+
if (faxDocument.FaxFiles[0].FileContents.length > 1) {
|
68
|
+
activityEventLog.push((0, addEventLog_1.addActivityEventLog)({
|
69
|
+
message: 'More than 1 fax file was found, only storing the first one',
|
70
|
+
}));
|
71
|
+
}
|
72
|
+
await onComplete({
|
73
|
+
data_points: {
|
74
|
+
base64EncodedFax: faxDocument.FaxFiles[0].FileContents,
|
75
|
+
direction: faxDocument.Direction,
|
76
|
+
date: faxDocument.Date,
|
77
|
+
status: faxDocument.Status,
|
78
|
+
format: faxDocument.Format,
|
79
|
+
pageCount: String(faxDocument.PageCount),
|
80
|
+
},
|
81
|
+
});
|
82
|
+
},
|
83
|
+
};
|
84
|
+
//# sourceMappingURL=getFaxDocument.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getFaxDocument.js","sourceRoot":"","sources":["../../../../../extensions/westFax/actions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-0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getFaxDocument = void 0;
|
4
|
+
var getFaxDocument_1 = require("./getFaxDocument");
|
5
|
+
Object.defineProperty(exports, "getFaxDocument", { enumerable: true, get: function () { return getFaxDocument_1.getFaxDocument; } });
|
6
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/westFax/actions/getFaxDocument/index.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAAxC,gHAAA,cAAc,OAAA"}
|
@@ -50,6 +50,51 @@ export declare const actions: {
|
|
50
50
|
required: true;
|
51
51
|
description: string;
|
52
52
|
};
|
53
|
+
productId: {
|
54
|
+
key: string;
|
55
|
+
label: string;
|
56
|
+
obfuscated: false;
|
57
|
+
required: false;
|
58
|
+
description: string;
|
59
|
+
};
|
60
|
+
faceSheetUrl: {
|
61
|
+
key: string;
|
62
|
+
label: string;
|
63
|
+
obfuscated: true;
|
64
|
+
required: false;
|
65
|
+
description: string;
|
66
|
+
};
|
67
|
+
}, string>;
|
68
|
+
getFaxDocument: import("@awell-health/extensions-core").Action<{
|
69
|
+
faxId: {
|
70
|
+
id: string;
|
71
|
+
label: string;
|
72
|
+
description: string;
|
73
|
+
type: import("@awell-health/extensions-core").FieldType.STRING;
|
74
|
+
required: true;
|
75
|
+
};
|
76
|
+
}, {
|
77
|
+
username: {
|
78
|
+
key: string;
|
79
|
+
label: string;
|
80
|
+
obfuscated: false;
|
81
|
+
required: true;
|
82
|
+
description: string;
|
83
|
+
};
|
84
|
+
password: {
|
85
|
+
key: string;
|
86
|
+
label: string;
|
87
|
+
obfuscated: true;
|
88
|
+
required: true;
|
89
|
+
description: string;
|
90
|
+
};
|
91
|
+
productId: {
|
92
|
+
key: string;
|
93
|
+
label: string;
|
94
|
+
obfuscated: false;
|
95
|
+
required: false;
|
96
|
+
description: string;
|
97
|
+
};
|
53
98
|
faceSheetUrl: {
|
54
99
|
key: string;
|
55
100
|
label: string;
|
@@ -2,7 +2,9 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.actions = void 0;
|
4
4
|
const sendFax_1 = require("./sendFax");
|
5
|
+
const getFaxDocument_1 = require("./getFaxDocument");
|
5
6
|
exports.actions = {
|
6
7
|
sendFax: sendFax_1.sendFax,
|
8
|
+
getFaxDocument: getFaxDocument_1.getFaxDocument,
|
7
9
|
};
|
8
10
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/westFax/actions/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/westFax/actions/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AACnC,qDAAiD;AAEpC,QAAA,OAAO,GAAG;IACrB,OAAO,EAAP,iBAAO;IACP,cAAc,EAAd,+BAAc;CACf,CAAA"}
|
@@ -4,6 +4,7 @@ exports.WestFax = void 0;
|
|
4
4
|
const actions_1 = require("./actions");
|
5
5
|
const settings_1 = require("./settings");
|
6
6
|
const extensions_core_1 = require("@awell-health/extensions-core");
|
7
|
+
const webhooks_1 = require("./webhooks");
|
7
8
|
exports.WestFax = {
|
8
9
|
key: 'westFax',
|
9
10
|
category: extensions_core_1.Category.COMMUNICATION,
|
@@ -15,5 +16,6 @@ exports.WestFax = {
|
|
15
16
|
},
|
16
17
|
settings: settings_1.settings,
|
17
18
|
actions: actions_1.actions,
|
19
|
+
webhooks: webhooks_1.webhooks,
|
18
20
|
};
|
19
21
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/westFax/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AAEnC,yCAAqC;AACrC,mEAAoE;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/westFax/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AAEnC,yCAAqC;AACrC,mEAAoE;AACpE,yCAAqC;AAExB,QAAA,OAAO,GAAc;IAChC,GAAG,EAAE,SAAS;IACd,QAAQ,EAAE,0BAAQ,CAAC,aAAa;IAChC,KAAK,EAAE,SAAS;IAChB,WAAW,EACT,6EAA6E;IAC/E,QAAQ,EACN,wHAAwH;IAC1H,MAAM,EAAE;QACN,UAAU,EAAE,4BAAU,CAAC,KAAK;KAC7B;IACD,QAAQ,EAAR,mBAAQ;IACR,OAAO,EAAP,iBAAO;IACP,QAAQ,EAAR,mBAAQ;CACT,CAAA"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { type AxiosResponse } from 'axios';
|
2
|
+
import { type GetFaxInputTypeWithoutCredentials, type GetFaxDocumentResponseType } from './schema';
|
3
|
+
export declare class WestFaxApiClient {
|
4
|
+
private readonly client;
|
5
|
+
private readonly credentials;
|
6
|
+
constructor({ baseUrl, username, password, productId, }: {
|
7
|
+
baseUrl: string;
|
8
|
+
username: string;
|
9
|
+
password: string;
|
10
|
+
productId: string;
|
11
|
+
});
|
12
|
+
testConnection(): Promise<AxiosResponse<Record<string, unknown>>>;
|
13
|
+
getFaxDocument(input: GetFaxInputTypeWithoutCredentials): Promise<AxiosResponse<GetFaxDocumentResponseType>>;
|
14
|
+
}
|
@@ -0,0 +1,52 @@
|
|
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.WestFaxApiClient = void 0;
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
8
|
+
const schema_1 = require("./schema");
|
9
|
+
class WestFaxApiClient {
|
10
|
+
constructor({ baseUrl, username, password, productId, }) {
|
11
|
+
this.credentials = {
|
12
|
+
Username: username,
|
13
|
+
Password: password,
|
14
|
+
ProductId: productId,
|
15
|
+
};
|
16
|
+
this.client = axios_1.default.create({
|
17
|
+
baseURL: baseUrl,
|
18
|
+
headers: {},
|
19
|
+
});
|
20
|
+
}
|
21
|
+
async testConnection() {
|
22
|
+
const allData = {
|
23
|
+
...this.credentials,
|
24
|
+
Cookies: false,
|
25
|
+
};
|
26
|
+
const formData = new URLSearchParams();
|
27
|
+
Object.entries(allData).forEach(([key, value]) => {
|
28
|
+
formData.append(key, String(value));
|
29
|
+
});
|
30
|
+
const response = await this.client.post(`/Security_Authenticate/JSON`, formData);
|
31
|
+
return response;
|
32
|
+
}
|
33
|
+
async getFaxDocument(input) {
|
34
|
+
const allData = schema_1.GetFaxDocumentInputSchema.parse({
|
35
|
+
...this.credentials,
|
36
|
+
...input,
|
37
|
+
});
|
38
|
+
const formData = new URLSearchParams();
|
39
|
+
Object.entries(allData).forEach(([key, value]) => {
|
40
|
+
if (typeof value === 'object') {
|
41
|
+
formData.append(key, JSON.stringify(value));
|
42
|
+
}
|
43
|
+
else {
|
44
|
+
formData.append(key, String(value));
|
45
|
+
}
|
46
|
+
});
|
47
|
+
const response = await this.client.post(`/Fax_GetFaxDocuments/JSON`, formData);
|
48
|
+
return response;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
exports.WestFaxApiClient = WestFaxApiClient;
|
52
|
+
//# sourceMappingURL=client.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../extensions/westFax/lib/api/client.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAqE;AACrE,qCAIiB;AAEjB,MAAa,gBAAgB;IAQ3B,YAAY,EACV,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,SAAS,GAMV;QACC,IAAI,CAAC,WAAW,GAAG;YACjB,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,QAAQ;YAClB,SAAS,EAAE,SAAS;SACrB,CAAA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