@awell-health/awell-extensions 2.0.294 → 2.0.295
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 +4 -0
- package/package.json +1 -1
package/dist/extensions/index.js
CHANGED
@@ -66,6 +66,7 @@ const hubspot_1 = require("./hubspot");
|
|
66
66
|
const identityVerification_1 = require("./identityVerification");
|
67
67
|
const infobip_1 = require("./infobip");
|
68
68
|
const iterable_1 = require("./iterable");
|
69
|
+
const landingAi_1 = require("./landingAi");
|
69
70
|
const mailchimp_1 = require("./mailchimp");
|
70
71
|
const mailgun_1 = require("./mailgun");
|
71
72
|
const math_1 = require("./math");
|
@@ -123,6 +124,7 @@ exports.extensions = [
|
|
123
124
|
identityVerification_1.identityVerification,
|
124
125
|
infobip_1.Infobip,
|
125
126
|
iterable_1.Iterable,
|
127
|
+
landingAi_1.landingAi,
|
126
128
|
mailchimp_1.Mailchimp,
|
127
129
|
mailgun_1.Mailgun,
|
128
130
|
math_1.MathExtension,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../extensions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA6C;AAC7C,yCAAqC;AACrC,mCAA+B;AAC/B,6CAAyC;AACzC,mCAA+B;AAC/B,mCA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BAAW;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;IACP,WAAI;CACL,CAAA"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../extensions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA6C;AAC7C,yCAAqC;AACrC,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,6CAAyC;AACzC,2CAAuC;AACvC,yCAAqC;AACrC,+CAA0C;AAC1C,uCAAmC;AACnC,iEAA6D;AAC7D,uCAAmC;AACnC,yCAAqC;AACrC,2CAAuC;AACvC,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;AACnC,iCAA6B;AAE7B,sDAAuC;AAG1B,QAAA,QAAQ,GAAa,IAAI,CAAA;AAEzB,QAAA,UAAU,GAAG;IACxB,aAAK;IACL,aAAK;IACL,2BAAY;IACZ,mBAAQ;IACR,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,uBAAU;IACV,qBAAS;IACT,mBAAQ;IACR,wBAAU;IACV,iBAAO;IACP,2CAAoB;IACpB,iBAAO;IACP,mBAAQ;IACR,qBAAS;IACT,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;IACP,WAAI;CACL,CAAA"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
export declare const dataPoints: {
|
2
|
+
markdown: {
|
3
|
+
key: string;
|
4
|
+
valueType: "string";
|
5
|
+
};
|
6
|
+
chunks: {
|
7
|
+
key: string;
|
8
|
+
valueType: "json";
|
9
|
+
};
|
10
|
+
extractedDataBasedOnSchema: {
|
11
|
+
key: string;
|
12
|
+
valueType: "json";
|
13
|
+
};
|
14
|
+
extractedMetadata: {
|
15
|
+
key: string;
|
16
|
+
valueType: "json";
|
17
|
+
};
|
18
|
+
};
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.dataPoints = void 0;
|
4
|
+
exports.dataPoints = {
|
5
|
+
markdown: {
|
6
|
+
key: 'markdown',
|
7
|
+
valueType: 'string',
|
8
|
+
},
|
9
|
+
chunks: {
|
10
|
+
key: 'chunks',
|
11
|
+
valueType: 'json',
|
12
|
+
},
|
13
|
+
extractedDataBasedOnSchema: {
|
14
|
+
key: 'extractedDataBasedOnSchema',
|
15
|
+
valueType: 'json',
|
16
|
+
},
|
17
|
+
extractedMetadata: {
|
18
|
+
key: 'extractedMetadata',
|
19
|
+
valueType: 'json',
|
20
|
+
},
|
21
|
+
};
|
22
|
+
//# sourceMappingURL=dataPoints.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"dataPoints.js","sourceRoot":"","sources":["../../../../../../extensions/landingAi/actions/documentExtraction/config/dataPoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,QAAQ,EAAE;QACR,GAAG,EAAE,UAAU;QACf,SAAS,EAAE,QAAQ;KACpB;IACD,MAAM,EAAE;QACN,GAAG,EAAE,QAAQ;QACb,SAAS,EAAE,MAAM;KAClB;IACD,0BAA0B,EAAE;QAC1B,GAAG,EAAE,4BAA4B;QACjC,SAAS,EAAE,MAAM;KAClB;IACD,iBAAiB,EAAE;QACjB,GAAG,EAAE,mBAAmB;QACxB,SAAS,EAAE,MAAM;KAClB;CAC4C,CAAA"}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { FieldType } from '@awell-health/extensions-core';
|
2
|
+
import z from 'zod';
|
3
|
+
export declare const fields: {
|
4
|
+
fileType: {
|
5
|
+
id: string;
|
6
|
+
label: string;
|
7
|
+
description: string;
|
8
|
+
type: FieldType.STRING;
|
9
|
+
options: {
|
10
|
+
dropdownOptions: {
|
11
|
+
label: string;
|
12
|
+
value: string;
|
13
|
+
}[];
|
14
|
+
};
|
15
|
+
required: true;
|
16
|
+
};
|
17
|
+
fileUrl: {
|
18
|
+
id: string;
|
19
|
+
label: string;
|
20
|
+
description: string;
|
21
|
+
type: FieldType.STRING;
|
22
|
+
required: true;
|
23
|
+
};
|
24
|
+
fieldsSchema: {
|
25
|
+
id: string;
|
26
|
+
label: string;
|
27
|
+
description: string;
|
28
|
+
type: FieldType.JSON;
|
29
|
+
required: false;
|
30
|
+
};
|
31
|
+
};
|
32
|
+
export declare const FieldsValidationSchema: z.ZodObject<{
|
33
|
+
fileType: z.ZodEnum<["image", "pdf"]>;
|
34
|
+
fileUrl: z.ZodString;
|
35
|
+
fieldsSchema: z.ZodEffects<z.ZodOptional<z.ZodString>, Record<string, unknown> | undefined, string | undefined>;
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
37
|
+
fileUrl: string;
|
38
|
+
fileType: "pdf" | "image";
|
39
|
+
fieldsSchema?: Record<string, unknown> | undefined;
|
40
|
+
}, {
|
41
|
+
fileUrl: string;
|
42
|
+
fileType: "pdf" | "image";
|
43
|
+
fieldsSchema?: string | undefined;
|
44
|
+
}>;
|
@@ -0,0 +1,69 @@
|
|
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 zod_1 = __importDefault(require("zod"));
|
9
|
+
const lodash_1 = require("lodash");
|
10
|
+
exports.fields = {
|
11
|
+
fileType: {
|
12
|
+
id: 'fileType',
|
13
|
+
label: 'File type',
|
14
|
+
description: 'The type of file to extract data from',
|
15
|
+
type: extensions_core_1.FieldType.STRING,
|
16
|
+
options: {
|
17
|
+
dropdownOptions: [
|
18
|
+
{
|
19
|
+
label: 'Image',
|
20
|
+
value: 'image',
|
21
|
+
},
|
22
|
+
{
|
23
|
+
label: 'PDF',
|
24
|
+
value: 'pdf',
|
25
|
+
},
|
26
|
+
],
|
27
|
+
},
|
28
|
+
required: true,
|
29
|
+
},
|
30
|
+
fileUrl: {
|
31
|
+
id: 'fileUrl',
|
32
|
+
label: 'File URL',
|
33
|
+
description: 'The URL of the file to extract data from',
|
34
|
+
type: extensions_core_1.FieldType.STRING,
|
35
|
+
required: true,
|
36
|
+
},
|
37
|
+
fieldsSchema: {
|
38
|
+
id: 'fieldsSchema',
|
39
|
+
label: 'Fields schema',
|
40
|
+
description: 'Defines the structure of the fields to extract from the document. Providing a schema is optional but strongly recommended, as it significantly improves the accuracy of the extracted data.',
|
41
|
+
type: extensions_core_1.FieldType.JSON,
|
42
|
+
required: false,
|
43
|
+
},
|
44
|
+
};
|
45
|
+
exports.FieldsValidationSchema = zod_1.default.object({
|
46
|
+
fileType: zod_1.default.enum(['image', 'pdf']),
|
47
|
+
fileUrl: zod_1.default.string(),
|
48
|
+
fieldsSchema: zod_1.default
|
49
|
+
.string()
|
50
|
+
.optional()
|
51
|
+
.transform((str, ctx) => {
|
52
|
+
if ((0, lodash_1.isNil)(str) || (0, lodash_1.isEmpty)(str))
|
53
|
+
return undefined;
|
54
|
+
try {
|
55
|
+
const parsedJson = JSON.parse(str);
|
56
|
+
if ((0, lodash_1.isEmpty)(parsedJson))
|
57
|
+
return undefined;
|
58
|
+
return parsedJson;
|
59
|
+
}
|
60
|
+
catch (e) {
|
61
|
+
ctx.addIssue({
|
62
|
+
code: 'custom',
|
63
|
+
message: 'Not a valid JSON object',
|
64
|
+
});
|
65
|
+
return zod_1.default.NEVER;
|
66
|
+
}
|
67
|
+
}),
|
68
|
+
});
|
69
|
+
//# sourceMappingURL=fields.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/landingAi/actions/documentExtraction/config/fields.ts"],"names":[],"mappings":";;;;;;AAAA,mEAAqE;AACrE,8CAAwC;AACxC,mCAAuC;AAE1B,QAAA,MAAM,GAAG;IACpB,QAAQ,EAAE;QACR,EAAE,EAAE,UAAU;QACd,KAAK,EAAE,WAAW;QAClB,WAAW,EAAE,uCAAuC;QACpD,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,OAAO,EAAE;YACP,eAAe,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KAAK,CAAA;QAChB,CAAC;IACH,CAAC,CAAC;CAC6C,CAAC,CAAA"}
|
@@ -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/landingAi/actions/documentExtraction/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACvC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
|
@@ -0,0 +1,67 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.documentExtraction = void 0;
|
4
|
+
const extensions_core_1 = require("@awell-health/extensions-core");
|
5
|
+
const validatePayloadAndCreateSdk_1 = require("../../lib/validatePayloadAndCreateSdk");
|
6
|
+
const config_1 = require("./config");
|
7
|
+
const lodash_1 = require("lodash");
|
8
|
+
const addEventLog_1 = require("../../../../src/lib/awell/addEventLog");
|
9
|
+
exports.documentExtraction = {
|
10
|
+
key: 'documentExtraction',
|
11
|
+
category: extensions_core_1.Category.DOCUMENT_MANAGEMENT,
|
12
|
+
title: 'Document extraction',
|
13
|
+
description: 'Extract structured data from documents and images',
|
14
|
+
fields: config_1.fields,
|
15
|
+
previewable: false,
|
16
|
+
dataPoints: config_1.dataPoints,
|
17
|
+
onEvent: async ({ payload, onComplete, onError }) => {
|
18
|
+
const { fields, landingAiSdk } = await (0, validatePayloadAndCreateSdk_1.validatePayloadAndCreateSdk)({
|
19
|
+
fieldsSchema: config_1.FieldsValidationSchema,
|
20
|
+
payload,
|
21
|
+
});
|
22
|
+
const { data } = await landingAiSdk.agenticDocumentAnalysis({
|
23
|
+
body: {
|
24
|
+
image: fields.fileType === 'image' ? fields.fileUrl : null,
|
25
|
+
pdf: fields.fileType === 'pdf' ? fields.fileUrl : null,
|
26
|
+
include_marginalia: true,
|
27
|
+
include_metadata_in_markdown: true,
|
28
|
+
fields_schema: !(0, lodash_1.isNil)(fields.fieldsSchema)
|
29
|
+
? JSON.stringify(fields.fieldsSchema)
|
30
|
+
: null,
|
31
|
+
},
|
32
|
+
});
|
33
|
+
if (data.errors.length > 0) {
|
34
|
+
await onError({
|
35
|
+
events: [
|
36
|
+
(0, addEventLog_1.addActivityEventLog)({
|
37
|
+
message: JSON.stringify(data.errors, null, 2),
|
38
|
+
}),
|
39
|
+
],
|
40
|
+
});
|
41
|
+
return;
|
42
|
+
}
|
43
|
+
if (data.extraction_error !== null) {
|
44
|
+
await onError({
|
45
|
+
events: [
|
46
|
+
(0, addEventLog_1.addActivityEventLog)({
|
47
|
+
message: data.extraction_error,
|
48
|
+
}),
|
49
|
+
],
|
50
|
+
});
|
51
|
+
return;
|
52
|
+
}
|
53
|
+
await onComplete({
|
54
|
+
data_points: {
|
55
|
+
markdown: data.data.markdown,
|
56
|
+
chunks: JSON.stringify(data.data.chunks),
|
57
|
+
extractedDataBasedOnSchema: !(0, lodash_1.isNil)(data.data.extracted_schema)
|
58
|
+
? JSON.stringify(data.data.extracted_schema)
|
59
|
+
: undefined,
|
60
|
+
extractedMetadata: !(0, lodash_1.isNil)(data.data.extraction_metadata)
|
61
|
+
? JSON.stringify(data.data.extraction_metadata)
|
62
|
+
: undefined,
|
63
|
+
},
|
64
|
+
});
|
65
|
+
},
|
66
|
+
};
|
67
|
+
//# sourceMappingURL=documentExtraction.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"documentExtraction.js","sourceRoot":"","sources":["../../../../../extensions/landingAi/actions/documentExtraction/documentExtraction.ts"],"names":[],"mappings":";;;AACA,mEAAwD;AACxD,uFAAmF;AAEnF,qCAAqE;AACrE,mCAA8B;AAC9B,uEAA2E;AAE9D,QAAA,kBAAkB,GAI3B;IACF,GAAG,EAAE,oBAAoB;IACzB,QAAQ,EAAE,0BAAQ,CAAC,mBAAmB;IACtC,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EAAE,mDAAmD;IAChE,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,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,IAAA,yDAA2B,EAAC;YACjE,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,YAAY,CAAC,uBAAuB,CAAC;YAC1D,IAAI,EAAE;gBACJ,KAAK,EAAE,MAAM,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;gBAC1D,GAAG,EAAE,MAAM,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;gBACtD,kBAAkB,EAAE,IAAI;gBACxB,4BAA4B,EAAE,IAAI;gBAClC,aAAa,EAAE,CAAC,IAAA,cAAK,EAAC,MAAM,CAAC,YAAY,CAAC;oBACxC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC;oBACrC,CAAC,CAAC,IAAI;aACT;SACF,CAAC,CAAA;QAEF,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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("./documentExtraction"), exports);
|
18
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/landingAi/actions/documentExtraction/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAoC"}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
export declare const actions: {
|
2
|
+
documentExtraction: import("@awell-health/extensions-core").Action<{
|
3
|
+
fileType: {
|
4
|
+
id: string;
|
5
|
+
label: string;
|
6
|
+
description: string;
|
7
|
+
type: import("@awell-health/extensions-core").FieldType.STRING;
|
8
|
+
options: {
|
9
|
+
dropdownOptions: {
|
10
|
+
label: string;
|
11
|
+
value: string;
|
12
|
+
}[];
|
13
|
+
};
|
14
|
+
required: true;
|
15
|
+
};
|
16
|
+
fileUrl: {
|
17
|
+
id: string;
|
18
|
+
label: string;
|
19
|
+
description: string;
|
20
|
+
type: import("@awell-health/extensions-core").FieldType.STRING;
|
21
|
+
required: true;
|
22
|
+
};
|
23
|
+
fieldsSchema: {
|
24
|
+
id: string;
|
25
|
+
label: string;
|
26
|
+
description: string;
|
27
|
+
type: import("@awell-health/extensions-core").FieldType.JSON;
|
28
|
+
required: false;
|
29
|
+
};
|
30
|
+
}, {
|
31
|
+
apiKey: {
|
32
|
+
key: string;
|
33
|
+
label: string;
|
34
|
+
description: string;
|
35
|
+
required: true;
|
36
|
+
obfuscated: true;
|
37
|
+
};
|
38
|
+
}, "markdown" | "chunks" | "extractedDataBasedOnSchema" | "extractedMetadata">;
|
39
|
+
};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.actions = void 0;
|
4
|
+
const documentExtraction_1 = require("./documentExtraction/documentExtraction");
|
5
|
+
exports.actions = {
|
6
|
+
documentExtraction: documentExtraction_1.documentExtraction,
|
7
|
+
};
|
8
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/landingAi/actions/index.ts"],"names":[],"mappings":";;;AAAA,gFAA4E;AAE/D,QAAA,OAAO,GAAG;IACrB,kBAAkB,EAAlB,uCAAkB;CACnB,CAAA"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.landingAi = void 0;
|
4
|
+
const extensions_core_1 = require("@awell-health/extensions-core");
|
5
|
+
const actions_1 = require("./actions");
|
6
|
+
const settings_1 = require("./settings");
|
7
|
+
exports.landingAi = {
|
8
|
+
key: 'landingAi',
|
9
|
+
title: 'Landing.ai',
|
10
|
+
icon_url: 'https://res.cloudinary.com/da7x4rzl4/image/upload/v1752834756/Awell%20Extensions/34525670.png',
|
11
|
+
description: '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.',
|
12
|
+
category: extensions_core_1.Category.DOCUMENT_MANAGEMENT,
|
13
|
+
author: {
|
14
|
+
authorType: extensions_core_1.AuthorType.AWELL,
|
15
|
+
},
|
16
|
+
actions: actions_1.actions,
|
17
|
+
settings: settings_1.settings,
|
18
|
+
};
|
19
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/landingAi/index.ts"],"names":[],"mappings":";;;AACA,mEAAoE;AACpE,uCAAmC;AACnC,yCAAqC;AAExB,QAAA,SAAS,GAAc;IAClC,GAAG,EAAE,WAAW;IAChB,KAAK,EAAE,YAAY;IACnB,QAAQ,EACN,+FAA+F;IACjG,WAAW,EACT,wLAAwL;IAC1L,QAAQ,EAAE,0BAAQ,CAAC,mBAAmB;IACtC,MAAM,EAAE;QACN,UAAU,EAAE,4BAAU,CAAC,KAAK;KAC7B;IACD,OAAO,EAAP,iBAAO;IACP,QAAQ,EAAR,mBAAQ;CACT,CAAA"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { type AxiosResponse } from 'axios';
|
2
|
+
import { type AgenticDocumentAnalysisInputType, type AgenticDocumentAnalysisResponseType } from './schema';
|
3
|
+
export declare class LandingAiApiClient {
|
4
|
+
private readonly client;
|
5
|
+
constructor({ baseUrl, apiKey }: {
|
6
|
+
baseUrl: string;
|
7
|
+
apiKey: string;
|
8
|
+
});
|
9
|
+
agenticDocumentAnalysis(input: AgenticDocumentAnalysisInputType): Promise<AxiosResponse<AgenticDocumentAnalysisResponseType>>;
|
10
|
+
}
|
@@ -0,0 +1,65 @@
|
|
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.LandingAiApiClient = void 0;
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
8
|
+
const form_data_1 = __importDefault(require("form-data"));
|
9
|
+
const lodash_1 = require("lodash");
|
10
|
+
class LandingAiApiClient {
|
11
|
+
constructor({ baseUrl, apiKey }) {
|
12
|
+
this.client = axios_1.default.create({
|
13
|
+
baseURL: baseUrl,
|
14
|
+
headers: {
|
15
|
+
Authorization: `Bearer ${apiKey}`,
|
16
|
+
'Content-Type': 'application/json',
|
17
|
+
},
|
18
|
+
});
|
19
|
+
}
|
20
|
+
async agenticDocumentAnalysis(input) {
|
21
|
+
var _a, _b, _c, _d, _e, _f;
|
22
|
+
const form = new form_data_1.default();
|
23
|
+
/**
|
24
|
+
* Step 1: Download the file as a stream
|
25
|
+
* Their API currently doesn't support a reference to a file URL,
|
26
|
+
* so we need to download the file and append it to the form
|
27
|
+
*/
|
28
|
+
if (!(0, lodash_1.isNil)(input.body.pdf)) {
|
29
|
+
const fileRes = await axios_1.default.get(input.body.pdf, {
|
30
|
+
responseType: 'stream',
|
31
|
+
});
|
32
|
+
form.append('pdf', fileRes.data, { filename: 'document.pdf' });
|
33
|
+
}
|
34
|
+
else if (!(0, lodash_1.isNil)(input.body.image)) {
|
35
|
+
const fileRes = await axios_1.default.get(input.body.image, {
|
36
|
+
responseType: 'stream',
|
37
|
+
});
|
38
|
+
form.append('image', fileRes.data, { filename: 'document.png' });
|
39
|
+
}
|
40
|
+
else {
|
41
|
+
throw new Error('Must provide either image or pdf file URL.');
|
42
|
+
}
|
43
|
+
// Add remaining fields
|
44
|
+
form.append('include_marginalia', (_b = (_a = input.body.include_marginalia) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : 'false');
|
45
|
+
form.append('include_metadata_in_markdown', (_d = (_c = input.body.include_metadata_in_markdown) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : 'false');
|
46
|
+
if (!(0, lodash_1.isNil)(input.body.fields_schema)) {
|
47
|
+
form.append('fields_schema', input.body.fields_schema);
|
48
|
+
}
|
49
|
+
const queryParams = new URLSearchParams();
|
50
|
+
if (!(0, lodash_1.isNil)((_e = input.query) === null || _e === void 0 ? void 0 : _e.pages)) {
|
51
|
+
queryParams.set('pages', input.query.pages);
|
52
|
+
}
|
53
|
+
if (!(0, lodash_1.isNil)((_f = input.query) === null || _f === void 0 ? void 0 : _f.timeout)) {
|
54
|
+
queryParams.set('timeout', input.query.timeout.toString());
|
55
|
+
}
|
56
|
+
const response = await this.client.post(`/v1/tools/agentic-document-analysis?${queryParams.toString()}`, form, {
|
57
|
+
headers: {
|
58
|
+
...form.getHeaders(),
|
59
|
+
},
|
60
|
+
});
|
61
|
+
return response;
|
62
|
+
}
|
63
|
+
}
|
64
|
+
exports.LandingAiApiClient = LandingAiApiClient;
|
65
|
+
//# sourceMappingURL=client.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../extensions/landingAi/lib/api/client.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAqE;AACrE,0DAAgC;AAMhC,mCAA8B;AAE9B,MAAa,kBAAkB;IAG7B,YAAY,EAAE,OAAO,EAAE,MAAM,EAAuC;QAClE,IAAI,CAAC,MAAM,GAAG,eAAK,CAAC,MAAM,CAAC;YACzB,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,MAAM,EAAE;gBACjC,cAAc,EAAE,kBAAkB;aACnC;SACF,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,uBAAuB,CAC3B,KAAuC;;QAEvC,MAAM,IAAI,GAAG,IAAI,mBAAQ,EAAE,CAAA;QAE3B;;;;WAIG;QACH,IAAI,CAAC,IAAA,cAAK,EAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YAC3B,MAAM,OAAO,GAAG,MAAM,eAAK,CAAC,GAAG,CAAW,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;gBACxD,YAAY,EAAE,QAAQ;aACvB,CAAC,CAAA;YACF,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC,CAAA;QAChE,CAAC;aAA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AS,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAA;QAC5D,CAAC;QAED,MAAM,QAAQ,GACZ,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CACpB,uCAAuC,WAAW,CAAC,QAAQ,EAAE,EAAE,EAC/D,IAAI,EACJ;YACE,OAAO,EAAE;gBACP,GAAG,IAAI,CAAC,UAAU,EAAE;aACrB;SACF,CACF,CAAA;QAEH,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF;AAvED,gDAuEC"}
|
@@ -0,0 +1,131 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
export declare const AgenticDocumentAnalysisInputSchema: z.ZodObject<{
|
3
|
+
query: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
4
|
+
pages: z.ZodNullable<z.ZodString>;
|
5
|
+
timeout: z.ZodNullable<z.ZodNumber>;
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
7
|
+
timeout: number | null;
|
8
|
+
pages: string | null;
|
9
|
+
}, {
|
10
|
+
timeout: number | null;
|
11
|
+
pages: string | null;
|
12
|
+
}>>>;
|
13
|
+
body: z.ZodObject<{
|
14
|
+
image: z.ZodNullable<z.ZodString>;
|
15
|
+
pdf: z.ZodNullable<z.ZodString>;
|
16
|
+
include_marginalia: z.ZodDefault<z.ZodBoolean>;
|
17
|
+
include_metadata_in_markdown: z.ZodDefault<z.ZodBoolean>;
|
18
|
+
fields_schema: z.ZodNullable<z.ZodString>;
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
20
|
+
pdf: string | null;
|
21
|
+
image: string | null;
|
22
|
+
include_marginalia: boolean;
|
23
|
+
include_metadata_in_markdown: boolean;
|
24
|
+
fields_schema: string | null;
|
25
|
+
}, {
|
26
|
+
pdf: string | null;
|
27
|
+
image: string | null;
|
28
|
+
fields_schema: string | null;
|
29
|
+
include_marginalia?: boolean | undefined;
|
30
|
+
include_metadata_in_markdown?: boolean | undefined;
|
31
|
+
}>;
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
33
|
+
body: {
|
34
|
+
pdf: string | null;
|
35
|
+
image: string | null;
|
36
|
+
include_marginalia: boolean;
|
37
|
+
include_metadata_in_markdown: boolean;
|
38
|
+
fields_schema: string | null;
|
39
|
+
};
|
40
|
+
query?: {
|
41
|
+
timeout: number | null;
|
42
|
+
pages: string | null;
|
43
|
+
} | null | undefined;
|
44
|
+
}, {
|
45
|
+
body: {
|
46
|
+
pdf: string | null;
|
47
|
+
image: string | null;
|
48
|
+
fields_schema: string | null;
|
49
|
+
include_marginalia?: boolean | undefined;
|
50
|
+
include_metadata_in_markdown?: boolean | undefined;
|
51
|
+
};
|
52
|
+
query?: {
|
53
|
+
timeout: number | null;
|
54
|
+
pages: string | null;
|
55
|
+
} | null | undefined;
|
56
|
+
}>;
|
57
|
+
export type AgenticDocumentAnalysisInputType = z.infer<typeof AgenticDocumentAnalysisInputSchema>;
|
58
|
+
export declare const AgenticDocumentAnalysisResponseSchema: z.ZodObject<{
|
59
|
+
data: z.ZodObject<{
|
60
|
+
markdown: z.ZodString;
|
61
|
+
chunks: z.ZodArray<z.ZodObject<{
|
62
|
+
text: z.ZodString;
|
63
|
+
chunk_type: z.ZodAny;
|
64
|
+
chunk_id: z.ZodString;
|
65
|
+
grounding: z.ZodNullable<z.ZodArray<z.ZodAny, "many">>;
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
67
|
+
text: string;
|
68
|
+
chunk_id: string;
|
69
|
+
grounding: any[] | null;
|
70
|
+
chunk_type?: any;
|
71
|
+
}, {
|
72
|
+
text: string;
|
73
|
+
chunk_id: string;
|
74
|
+
grounding: any[] | null;
|
75
|
+
chunk_type?: any;
|
76
|
+
}>, "many">;
|
77
|
+
extracted_schema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
78
|
+
extraction_metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
80
|
+
markdown: string;
|
81
|
+
chunks: {
|
82
|
+
text: string;
|
83
|
+
chunk_id: string;
|
84
|
+
grounding: any[] | null;
|
85
|
+
chunk_type?: any;
|
86
|
+
}[];
|
87
|
+
extracted_schema: Record<string, any> | null;
|
88
|
+
extraction_metadata: Record<string, any> | null;
|
89
|
+
}, {
|
90
|
+
markdown: string;
|
91
|
+
chunks: {
|
92
|
+
text: string;
|
93
|
+
chunk_id: string;
|
94
|
+
grounding: any[] | null;
|
95
|
+
chunk_type?: any;
|
96
|
+
}[];
|
97
|
+
extracted_schema: Record<string, any> | null;
|
98
|
+
extraction_metadata: Record<string, any> | null;
|
99
|
+
}>;
|
100
|
+
errors: z.ZodArray<z.ZodUnknown, "many">;
|
101
|
+
extraction_error: z.ZodNullable<z.ZodString>;
|
102
|
+
}, "strip", z.ZodTypeAny, {
|
103
|
+
data: {
|
104
|
+
markdown: string;
|
105
|
+
chunks: {
|
106
|
+
text: string;
|
107
|
+
chunk_id: string;
|
108
|
+
grounding: any[] | null;
|
109
|
+
chunk_type?: any;
|
110
|
+
}[];
|
111
|
+
extracted_schema: Record<string, any> | null;
|
112
|
+
extraction_metadata: Record<string, any> | null;
|
113
|
+
};
|
114
|
+
errors: unknown[];
|
115
|
+
extraction_error: string | null;
|
116
|
+
}, {
|
117
|
+
data: {
|
118
|
+
markdown: string;
|
119
|
+
chunks: {
|
120
|
+
text: string;
|
121
|
+
chunk_id: string;
|
122
|
+
grounding: any[] | null;
|
123
|
+
chunk_type?: any;
|
124
|
+
}[];
|
125
|
+
extracted_schema: Record<string, any> | null;
|
126
|
+
extraction_metadata: Record<string, any> | null;
|
127
|
+
};
|
128
|
+
errors: unknown[];
|
129
|
+
extraction_error: string | null;
|
130
|
+
}>;
|
131
|
+
export type AgenticDocumentAnalysisResponseType = z.infer<typeof AgenticDocumentAnalysisResponseSchema>;
|
@@ -0,0 +1,36 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.AgenticDocumentAnalysisResponseSchema = exports.AgenticDocumentAnalysisInputSchema = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
exports.AgenticDocumentAnalysisInputSchema = zod_1.z.object({
|
6
|
+
query: zod_1.z
|
7
|
+
.object({
|
8
|
+
pages: zod_1.z.string().nullable(),
|
9
|
+
timeout: zod_1.z.number().nullable(),
|
10
|
+
})
|
11
|
+
.optional()
|
12
|
+
.nullable(),
|
13
|
+
body: zod_1.z.object({
|
14
|
+
image: zod_1.z.string().nullable(),
|
15
|
+
pdf: zod_1.z.string().nullable(),
|
16
|
+
include_marginalia: zod_1.z.boolean().default(true),
|
17
|
+
include_metadata_in_markdown: zod_1.z.boolean().default(true),
|
18
|
+
fields_schema: zod_1.z.string().nullable(),
|
19
|
+
}),
|
20
|
+
});
|
21
|
+
exports.AgenticDocumentAnalysisResponseSchema = zod_1.z.object({
|
22
|
+
data: zod_1.z.object({
|
23
|
+
markdown: zod_1.z.string(),
|
24
|
+
chunks: zod_1.z.array(zod_1.z.object({
|
25
|
+
text: zod_1.z.string(),
|
26
|
+
chunk_type: zod_1.z.any(),
|
27
|
+
chunk_id: zod_1.z.string(),
|
28
|
+
grounding: zod_1.z.array(zod_1.z.any()).nullable(),
|
29
|
+
})),
|
30
|
+
extracted_schema: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).nullable(),
|
31
|
+
extraction_metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).nullable(),
|
32
|
+
}),
|
33
|
+
errors: zod_1.z.array(zod_1.z.unknown()),
|
34
|
+
extraction_error: zod_1.z.string().nullable(),
|
35
|
+
});
|
36
|
+
//# sourceMappingURL=AgenticDocumentAnalysis.schema.js.map
|
@@ -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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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"
|