@awell-health/awell-extensions 2.0.320 → 2.0.322
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/airtop/actions/index.d.ts +50 -0
- package/dist/extensions/airtop/actions/index.js +10 -0
- package/dist/extensions/airtop/actions/index.js.map +1 -0
- package/dist/extensions/airtop/actions/queryPage/config/dataPoints.d.ts +10 -0
- package/dist/extensions/airtop/actions/queryPage/config/dataPoints.js +14 -0
- package/dist/extensions/airtop/actions/queryPage/config/dataPoints.js.map +1 -0
- package/dist/extensions/airtop/actions/queryPage/config/fields.d.ts +38 -0
- package/dist/extensions/airtop/actions/queryPage/config/fields.js +58 -0
- package/dist/extensions/airtop/actions/queryPage/config/fields.js.map +1 -0
- package/dist/extensions/airtop/actions/queryPage/config/index.d.ts +2 -0
- package/dist/extensions/airtop/actions/queryPage/config/index.js +9 -0
- package/dist/extensions/airtop/actions/queryPage/config/index.js.map +1 -0
- package/dist/extensions/airtop/actions/queryPage/index.d.ts +1 -0
- package/dist/extensions/airtop/actions/queryPage/index.js +18 -0
- package/dist/extensions/airtop/actions/queryPage/index.js.map +1 -0
- package/dist/extensions/airtop/actions/queryPage/queryPage.d.ts +4 -0
- package/dist/extensions/airtop/actions/queryPage/queryPage.js +47 -0
- package/dist/extensions/airtop/actions/queryPage/queryPage.js.map +1 -0
- package/dist/extensions/airtop/actions/smartScrape/config/dataPoints.d.ts +10 -0
- package/dist/extensions/airtop/actions/smartScrape/config/dataPoints.js +14 -0
- package/dist/extensions/airtop/actions/smartScrape/config/dataPoints.js.map +1 -0
- package/dist/extensions/airtop/actions/smartScrape/config/fields.d.ts +18 -0
- package/dist/extensions/airtop/actions/smartScrape/config/fields.js +21 -0
- package/dist/extensions/airtop/actions/smartScrape/config/fields.js.map +1 -0
- package/dist/extensions/airtop/actions/smartScrape/config/index.d.ts +2 -0
- package/dist/extensions/airtop/actions/smartScrape/config/index.js +9 -0
- package/dist/extensions/airtop/actions/smartScrape/config/index.js.map +1 -0
- package/dist/extensions/airtop/actions/smartScrape/index.d.ts +1 -0
- package/dist/extensions/airtop/actions/smartScrape/index.js +18 -0
- package/dist/extensions/airtop/actions/smartScrape/index.js.map +1 -0
- package/dist/extensions/airtop/actions/smartScrape/smartScrape.d.ts +4 -0
- package/dist/extensions/airtop/actions/smartScrape/smartScrape.js +40 -0
- package/dist/extensions/airtop/actions/smartScrape/smartScrape.js.map +1 -0
- package/dist/extensions/airtop/index.d.ts +2 -0
- package/dist/extensions/airtop/index.js +19 -0
- package/dist/extensions/airtop/index.js.map +1 -0
- package/dist/extensions/airtop/lib/validatePayloadAndCreateSdk.d.ts +18 -0
- package/dist/extensions/airtop/lib/validatePayloadAndCreateSdk.js +33 -0
- package/dist/extensions/airtop/lib/validatePayloadAndCreateSdk.js.map +1 -0
- package/dist/extensions/airtop/settings.d.ts +17 -0
- package/dist/extensions/airtop/settings.js +17 -0
- package/dist/extensions/airtop/settings.js.map +1 -0
- package/dist/extensions/canvasMedical/v1/validation/extension.zod.d.ts +32 -32
- package/dist/extensions/canvasMedical/v1/validation/patient.zod.d.ts +76 -76
- package/dist/extensions/collectData/v1/actions/remoteSingleSelect/config/fields.d.ts +2 -2
- package/dist/extensions/elation/actions/findAppointments/config/dataPoints.d.ts +10 -0
- package/dist/extensions/elation/actions/findAppointments/config/dataPoints.js +14 -0
- package/dist/extensions/elation/actions/findAppointments/config/dataPoints.js.map +1 -0
- package/dist/extensions/elation/actions/findAppointments/config/fields.d.ts +68 -0
- package/dist/extensions/elation/actions/findAppointments/config/fields.js +58 -0
- package/dist/extensions/elation/actions/findAppointments/config/fields.js.map +1 -0
- package/dist/extensions/elation/actions/findAppointments/config/index.d.ts +2 -0
- package/dist/extensions/elation/actions/findAppointments/config/index.js +9 -0
- package/dist/extensions/elation/actions/findAppointments/config/index.js.map +1 -0
- package/dist/extensions/elation/actions/findAppointments/findAppointments.d.ts +4 -0
- package/dist/extensions/elation/actions/findAppointments/findAppointments.js +37 -0
- package/dist/extensions/elation/actions/findAppointments/findAppointments.js.map +1 -0
- package/dist/extensions/elation/actions/findAppointments/index.d.ts +1 -0
- package/dist/extensions/elation/actions/findAppointments/index.js +6 -0
- package/dist/extensions/elation/actions/findAppointments/index.js.map +1 -0
- package/dist/extensions/elation/actions/findAppointmentsWithAI/config/dataPoints.d.ts +4 -0
- package/dist/extensions/elation/actions/findAppointmentsWithAI/config/dataPoints.js +4 -0
- package/dist/extensions/elation/actions/findAppointmentsWithAI/config/dataPoints.js.map +1 -1
- package/dist/extensions/elation/actions/findAppointmentsWithAI/findAppointmentsWithAI.js +2 -0
- package/dist/extensions/elation/actions/findAppointmentsWithAI/findAppointmentsWithAI.js.map +1 -1
- package/dist/extensions/elation/actions/index.d.ts +3 -1
- package/dist/extensions/index.js +2 -0
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/markdown.json +4 -0
- package/package.json +2 -1
- package/dist/extensions/elation/actions/findAppointments.d.ts +0 -56
- package/dist/extensions/elation/actions/findAppointments.js +0 -87
- package/dist/extensions/elation/actions/findAppointments.js.map +0 -1
@@ -0,0 +1,50 @@
|
|
1
|
+
export declare const actions: {
|
2
|
+
smartScrape: import("@awell-health/extensions-core").Action<{
|
3
|
+
pageUrl: {
|
4
|
+
id: string;
|
5
|
+
label: string;
|
6
|
+
description: string;
|
7
|
+
type: import("@awell-health/extensions-core").FieldType.STRING;
|
8
|
+
required: true;
|
9
|
+
};
|
10
|
+
}, {
|
11
|
+
apiKey: {
|
12
|
+
key: string;
|
13
|
+
label: string;
|
14
|
+
description: string;
|
15
|
+
required: true;
|
16
|
+
obfuscated: true;
|
17
|
+
};
|
18
|
+
}, "result" | "mimeType">;
|
19
|
+
queryPage: import("@awell-health/extensions-core").Action<{
|
20
|
+
pageUrl: {
|
21
|
+
id: string;
|
22
|
+
label: string;
|
23
|
+
description: string;
|
24
|
+
type: import("@awell-health/extensions-core").FieldType.STRING;
|
25
|
+
required: true;
|
26
|
+
};
|
27
|
+
prompt: {
|
28
|
+
id: string;
|
29
|
+
label: string;
|
30
|
+
description: string;
|
31
|
+
type: import("@awell-health/extensions-core").FieldType.TEXT;
|
32
|
+
required: true;
|
33
|
+
};
|
34
|
+
jsonSchema: {
|
35
|
+
id: string;
|
36
|
+
label: string;
|
37
|
+
description: string;
|
38
|
+
type: import("@awell-health/extensions-core").FieldType.JSON;
|
39
|
+
required: false;
|
40
|
+
};
|
41
|
+
}, {
|
42
|
+
apiKey: {
|
43
|
+
key: string;
|
44
|
+
label: string;
|
45
|
+
description: string;
|
46
|
+
required: true;
|
47
|
+
obfuscated: true;
|
48
|
+
};
|
49
|
+
}, "result" | "resultJson">;
|
50
|
+
};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.actions = void 0;
|
4
|
+
const smartScrape_1 = require("./smartScrape");
|
5
|
+
const queryPage_1 = require("./queryPage");
|
6
|
+
exports.actions = {
|
7
|
+
smartScrape: smartScrape_1.smartScrape,
|
8
|
+
queryPage: queryPage_1.queryPage,
|
9
|
+
};
|
10
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/airtop/actions/index.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAC3C,2CAAuC;AAE1B,QAAA,OAAO,GAAG;IACrB,WAAW,EAAX,yBAAW;IACX,SAAS,EAAT,qBAAS;CACV,CAAA"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.dataPoints = void 0;
|
4
|
+
exports.dataPoints = {
|
5
|
+
result: {
|
6
|
+
key: 'result',
|
7
|
+
valueType: 'string',
|
8
|
+
},
|
9
|
+
resultJson: {
|
10
|
+
key: 'resultJson',
|
11
|
+
valueType: 'json',
|
12
|
+
},
|
13
|
+
};
|
14
|
+
//# sourceMappingURL=dataPoints.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"dataPoints.js","sourceRoot":"","sources":["../../../../../../extensions/airtop/actions/queryPage/config/dataPoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,MAAM,EAAE;QACN,GAAG,EAAE,QAAQ;QACb,SAAS,EAAE,QAAQ;KACpB;IACD,UAAU,EAAE;QACV,GAAG,EAAE,YAAY;QACjB,SAAS,EAAE,MAAM;KAClB;CAC4C,CAAA"}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { FieldType } from '@awell-health/extensions-core';
|
2
|
+
import z from 'zod';
|
3
|
+
export declare const fields: {
|
4
|
+
pageUrl: {
|
5
|
+
id: string;
|
6
|
+
label: string;
|
7
|
+
description: string;
|
8
|
+
type: FieldType.STRING;
|
9
|
+
required: true;
|
10
|
+
};
|
11
|
+
prompt: {
|
12
|
+
id: string;
|
13
|
+
label: string;
|
14
|
+
description: string;
|
15
|
+
type: FieldType.TEXT;
|
16
|
+
required: true;
|
17
|
+
};
|
18
|
+
jsonSchema: {
|
19
|
+
id: string;
|
20
|
+
label: string;
|
21
|
+
description: string;
|
22
|
+
type: FieldType.JSON;
|
23
|
+
required: false;
|
24
|
+
};
|
25
|
+
};
|
26
|
+
export declare const FieldsValidationSchema: z.ZodObject<{
|
27
|
+
pageUrl: z.ZodString;
|
28
|
+
prompt: z.ZodString;
|
29
|
+
jsonSchema: z.ZodEffects<z.ZodOptional<z.ZodString>, Record<string, unknown> | undefined, string | undefined>;
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
31
|
+
pageUrl: string;
|
32
|
+
prompt: string;
|
33
|
+
jsonSchema?: Record<string, unknown> | undefined;
|
34
|
+
}, {
|
35
|
+
pageUrl: string;
|
36
|
+
prompt: string;
|
37
|
+
jsonSchema?: string | undefined;
|
38
|
+
}>;
|
@@ -0,0 +1,58 @@
|
|
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
|
+
exports.fields = {
|
11
|
+
pageUrl: {
|
12
|
+
id: 'pageUrl',
|
13
|
+
label: 'Page URL',
|
14
|
+
description: 'The URL of the page to scrape',
|
15
|
+
type: extensions_core_1.FieldType.STRING,
|
16
|
+
required: true,
|
17
|
+
},
|
18
|
+
prompt: {
|
19
|
+
id: 'prompt',
|
20
|
+
label: 'Prompt',
|
21
|
+
description: 'The prompt used to query the page',
|
22
|
+
type: extensions_core_1.FieldType.TEXT,
|
23
|
+
required: true,
|
24
|
+
},
|
25
|
+
jsonSchema: {
|
26
|
+
id: 'jsonSchema',
|
27
|
+
label: 'JSON Schema',
|
28
|
+
description: 'Optional JSON schema to guide the AI’s response and force it to return JSON. This can be useful if you want a structured response that is more suitable for automated processing.',
|
29
|
+
type: extensions_core_1.FieldType.JSON,
|
30
|
+
required: false,
|
31
|
+
},
|
32
|
+
};
|
33
|
+
exports.FieldsValidationSchema = zod_1.default.object({
|
34
|
+
pageUrl: zod_1.default.string().min(1).url(),
|
35
|
+
prompt: zod_1.default.string().min(1),
|
36
|
+
jsonSchema: zod_1.default
|
37
|
+
.string()
|
38
|
+
.optional()
|
39
|
+
.transform((str, ctx) => {
|
40
|
+
if ((0, lodash_1.isNil)(str) || (0, lodash_1.isEmpty)(str))
|
41
|
+
return undefined;
|
42
|
+
try {
|
43
|
+
const parsedJson = JSON.parse(str);
|
44
|
+
if ((0, lodash_1.isEmpty)(parsedJson)) {
|
45
|
+
return undefined;
|
46
|
+
}
|
47
|
+
return parsedJson;
|
48
|
+
}
|
49
|
+
catch (e) {
|
50
|
+
ctx.addIssue({
|
51
|
+
code: 'custom',
|
52
|
+
message: 'Not a valid JSON object',
|
53
|
+
});
|
54
|
+
return zod_1.default.NEVER;
|
55
|
+
}
|
56
|
+
}),
|
57
|
+
});
|
58
|
+
//# sourceMappingURL=fields.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/airtop/actions/queryPage/config/fields.ts"],"names":[],"mappings":";;;;;;AAAA,mEAAqE;AACrE,mCAAuC;AACvC,8CAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,OAAO,EAAE;QACP,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,+BAA+B;QAC5C,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,MAAM,EAAE;QACN,EAAE,EAAE,QAAQ;QACZ,KAAK,EAAE,QAAQ;QACf,WAAW,EAAE,mCAAmC;QAChD,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,IAAI;KACf;IACD,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,aAAa;QACpB,WAAW,EACT,mLAAmL;QACrL,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,KAAK;KAChB;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7C,OAAO,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE;IAChC,MAAM,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,UAAU,EAAE,aAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,SAAS,CAAC,CAAC,GAAG,EAAE,GAAG,EAAuC,EAAE;QAC3D,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,OAAO,UAAU,CAAA;QACnB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,GAAG,CAAC,QAAQ,CAAC;gBACX,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,yBAAyB;aACnC,CAAC,CAAA;YACF,OAAO,aAAC,CAAC,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/airtop/actions/queryPage/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 * from './queryPage';
|
@@ -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("./queryPage"), exports);
|
18
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/airtop/actions/queryPage/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B"}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.queryPage = 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
|
+
exports.queryPage = {
|
9
|
+
key: 'queryPage',
|
10
|
+
category: extensions_core_1.Category.DATA,
|
11
|
+
title: 'Query web page with LLM',
|
12
|
+
description: 'Query a web page using LLMs with Airtop’s.',
|
13
|
+
fields: config_1.fields,
|
14
|
+
previewable: false,
|
15
|
+
dataPoints: config_1.dataPoints,
|
16
|
+
onEvent: async ({ payload, onComplete, onError }) => {
|
17
|
+
const { fields, airtopSdk } = await (0, validatePayloadAndCreateSdk_1.validatePayloadAndCreateSdk)({
|
18
|
+
fieldsSchema: config_1.FieldsValidationSchema,
|
19
|
+
payload,
|
20
|
+
});
|
21
|
+
// Create a headless browser session
|
22
|
+
const session = await airtopSdk.sessions.create();
|
23
|
+
// Create a new window in the session and open the page
|
24
|
+
const window = await airtopSdk.windows.create(session.data.id, {
|
25
|
+
url: fields.pageUrl,
|
26
|
+
});
|
27
|
+
// query the content of the window using the prompt
|
28
|
+
const result = await airtopSdk.windows.pageQuery(session.data.id, window.data.windowId, {
|
29
|
+
prompt: fields.prompt,
|
30
|
+
configuration: {
|
31
|
+
outputSchema: fields.jsonSchema,
|
32
|
+
},
|
33
|
+
});
|
34
|
+
// Close the window and terminate the session
|
35
|
+
await airtopSdk.windows.close(session.data.id, window.data.windowId);
|
36
|
+
await airtopSdk.sessions.terminate(session.data.id);
|
37
|
+
const content = result.data.modelResponse;
|
38
|
+
// Return the result
|
39
|
+
await onComplete({
|
40
|
+
data_points: {
|
41
|
+
result: (0, lodash_1.isNil)(fields.jsonSchema) ? content : content,
|
42
|
+
resultJson: (0, lodash_1.isNil)(fields.jsonSchema) ? undefined : content,
|
43
|
+
},
|
44
|
+
});
|
45
|
+
},
|
46
|
+
};
|
47
|
+
//# sourceMappingURL=queryPage.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"queryPage.js","sourceRoot":"","sources":["../../../../../extensions/airtop/actions/queryPage/queryPage.ts"],"names":[],"mappings":";;;AACA,mEAAwD;AACxD,uFAAmF;AAEnF,qCAAqE;AACrE,mCAA8B;AAEjB,QAAA,SAAS,GAIlB;IACF,GAAG,EAAE,WAAW;IAChB,QAAQ,EAAE,0BAAQ,CAAC,IAAI;IACvB,KAAK,EAAE,yBAAyB;IAChC,WAAW,EAAE,4CAA4C;IACzD,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK;IAClB,UAAU,EAAV,mBAAU;IACV,OAAO,EAAE,K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UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO;aAC3D;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.dataPoints = void 0;
|
4
|
+
exports.dataPoints = {
|
5
|
+
result: {
|
6
|
+
key: 'result',
|
7
|
+
valueType: 'string',
|
8
|
+
},
|
9
|
+
mimeType: {
|
10
|
+
key: 'mimeType',
|
11
|
+
valueType: 'string',
|
12
|
+
},
|
13
|
+
};
|
14
|
+
//# sourceMappingURL=dataPoints.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"dataPoints.js","sourceRoot":"","sources":["../../../../../../extensions/airtop/actions/smartScrape/config/dataPoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,MAAM,EAAE;QACN,GAAG,EAAE,QAAQ;QACb,SAAS,EAAE,QAAQ;KACpB;IACD,QAAQ,EAAE;QACR,GAAG,EAAE,UAAU;QACf,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { FieldType } from '@awell-health/extensions-core';
|
2
|
+
import z from 'zod';
|
3
|
+
export declare const fields: {
|
4
|
+
pageUrl: {
|
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
|
+
pageUrl: z.ZodString;
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
15
|
+
pageUrl: string;
|
16
|
+
}, {
|
17
|
+
pageUrl: string;
|
18
|
+
}>;
|
@@ -0,0 +1,21 @@
|
|
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
|
+
exports.fields = {
|
10
|
+
pageUrl: {
|
11
|
+
id: 'pageUrl',
|
12
|
+
label: 'Page URL',
|
13
|
+
description: 'The URL of the page to scrape',
|
14
|
+
type: extensions_core_1.FieldType.STRING,
|
15
|
+
required: true,
|
16
|
+
},
|
17
|
+
};
|
18
|
+
exports.FieldsValidationSchema = zod_1.default.object({
|
19
|
+
pageUrl: zod_1.default.string().min(1).url(),
|
20
|
+
});
|
21
|
+
//# sourceMappingURL=fields.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/airtop/actions/smartScrape/config/fields.ts"],"names":[],"mappings":";;;;;;AAAA,mEAAqE;AACrE,8CAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,OAAO,EAAE;QACP,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,+BAA+B;QAC5C,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7C,OAAO,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE;CACiB,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/airtop/actions/smartScrape/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 * from './smartScrape';
|
@@ -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("./smartScrape"), exports);
|
18
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/airtop/actions/smartScrape/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA6B"}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.smartScrape = 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
|
+
exports.smartScrape = {
|
8
|
+
key: 'smartScrape',
|
9
|
+
category: extensions_core_1.Category.DATA,
|
10
|
+
title: 'Smart Scrape a web page',
|
11
|
+
description: 'Scrape a web page with Airtop.',
|
12
|
+
fields: config_1.fields,
|
13
|
+
previewable: false,
|
14
|
+
dataPoints: config_1.dataPoints,
|
15
|
+
onEvent: async ({ payload, onComplete, onError }) => {
|
16
|
+
const { fields, airtopSdk } = await (0, validatePayloadAndCreateSdk_1.validatePayloadAndCreateSdk)({
|
17
|
+
fieldsSchema: config_1.FieldsValidationSchema,
|
18
|
+
payload,
|
19
|
+
});
|
20
|
+
// Create a headless browser session
|
21
|
+
const session = await airtopSdk.sessions.create();
|
22
|
+
// Create a new window in the session and open the page
|
23
|
+
const window = await airtopSdk.windows.create(session.data.id, {
|
24
|
+
url: fields.pageUrl,
|
25
|
+
});
|
26
|
+
// Scrape the content of the window
|
27
|
+
const content = await airtopSdk.windows.scrapeContent(session.data.id, window.data.windowId);
|
28
|
+
// Close the window and terminate the session
|
29
|
+
await airtopSdk.windows.close(session.data.id, window.data.windowId);
|
30
|
+
await airtopSdk.sessions.terminate(session.data.id);
|
31
|
+
// Return the result
|
32
|
+
await onComplete({
|
33
|
+
data_points: {
|
34
|
+
result: content.data.modelResponse.scrapedContent.text,
|
35
|
+
mimeType: content.data.modelResponse.scrapedContent.contentType,
|
36
|
+
},
|
37
|
+
});
|
38
|
+
},
|
39
|
+
};
|
40
|
+
//# sourceMappingURL=smartScrape.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"smartScr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U,CAAC;YACf,WAAW,EAAE;gBACX,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,IAAI;gBACtD,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,WAAW;aAChE;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.airtop = 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.airtop = {
|
8
|
+
key: 'airtop',
|
9
|
+
title: 'Airtop',
|
10
|
+
icon_url: 'https://res.cloudinary.com/da7x4rzl4/image/upload/v1754294899/Awell%20Extensions/1797e9c62ed74a4d95e8b9955abb6259.png',
|
11
|
+
description: 'Effortlessly scrape and control any site with inexpensive and scalable AI-powered cloud browsers',
|
12
|
+
category: extensions_core_1.Category.DATA,
|
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/airtop/index.ts"],"names":[],"mappings":";;;AACA,mEAAoE;AACpE,uCAAmC;AACnC,yCAAqC;AAExB,QAAA,MAAM,GAAc;IAC/B,GAAG,EAAE,QAAQ;IACb,KAAK,EAAE,QAAQ;IACf,QAAQ,EACN,uHAAuH;IACzH,WAAW,EACT,kGAAkG;IACpG,QAAQ,EAAE,0BAAQ,CAAC,IAAI;IACvB,MAAM,EAAE;QACN,UAAU,EAAE,4BAAU,CAAC,KAAK;KAC7B;IACD,OAAO,EAAP,iBAAO;IACP,QAAQ,EAAR,mBAAQ;CACT,CAAA"}
|
@@ -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 { AirtopClient } from '@airtop/sdk';
|
6
|
+
type ValidatePayloadAndCreateSdk = <T extends z.ZodTypeAny, P extends NewActivityPayload<any, any>>(args: {
|
7
|
+
fieldsSchema: T;
|
8
|
+
payload: P;
|
9
|
+
}) => Promise<{
|
10
|
+
airtopSdk: AirtopClient;
|
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,33 @@
|
|
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 sdk_1 = require("@airtop/sdk");
|
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 airtopSdk = new sdk_1.AirtopClient({
|
21
|
+
apiKey: settings.apiKey,
|
22
|
+
});
|
23
|
+
return {
|
24
|
+
airtopSdk,
|
25
|
+
settings,
|
26
|
+
fields,
|
27
|
+
patient,
|
28
|
+
pathway,
|
29
|
+
activity,
|
30
|
+
};
|
31
|
+
};
|
32
|
+
exports.validatePayloadAndCreateSdk = validatePayloadAndCreateSdk;
|
33
|
+
//# sourceMappingURL=validatePayloadAndCreateSdk.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"validatePayloadAndCreateSdk.js","sourceRoot":"","sources":["../../../../extensions/airtop/lib/validatePayloadAndCreateSdk.ts"],"names":[],"mappings":";;;;;;AAAA,mEAKsC;AACtC,8CAAmB;AACnB,0CAAsD;AAEtD,qCAA0C;AAiBnC,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,SAAS,GAAG,IAAI,kBAAY,CAAC;QACjC,MAAM,EAAE,QAAQ,CAAC,MAAM;KACxB,CAAC,CAAA;IAEF,OAAO;QACL,SAAS;QACT,QAAQ;QACR,MAAM;QACN,OAAO;QACP,OAAO;QACP,QAAQ;KACT,CAAA;AACH,CAAC,CAAA;AA1BY,QAAA,2BAA2B,+BA0BvC"}
|
@@ -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: 'Your Airtop API key',
|
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/airtop/settings.ts"],"names":[],"mappings":";;;AACA,6BAAwC;AAE3B,QAAA,QAAQ,GAAG;IACtB,MAAM,EAAE;QACN,GAAG,EAAE,QAAQ;QACb,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,qBAAqB;QAClC,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"}
|