@taskmagic/apps-parser-expert 0.0.1
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/README.md +3 -0
- package/package.json +48 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +35 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/get-extracted-data.d.ts +4 -0
- package/src/lib/actions/get-extracted-data.js +42 -0
- package/src/lib/actions/get-extracted-data.js.map +1 -0
- package/src/lib/actions/upload-document.d.ts +5 -0
- package/src/lib/actions/upload-document.js +57 -0
- package/src/lib/actions/upload-document.js.map +1 -0
- package/src/lib/common/auth.d.ts +1 -0
- package/src/lib/common/auth.js +22 -0
- package/src/lib/common/auth.js.map +1 -0
- package/src/lib/common/client.d.ts +12 -0
- package/src/lib/common/client.js +28 -0
- package/src/lib/common/client.js.map +1 -0
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@taskmagic/apps-parser-expert",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"dependencies": {
|
|
5
|
+
"@anthropic-ai/sdk": "0.33.1",
|
|
6
|
+
"@sinclair/typebox": "0.34.11",
|
|
7
|
+
"axios": "1.17.0",
|
|
8
|
+
"axios-retry": "4.4.1",
|
|
9
|
+
"deepmerge-ts": "7.1.0",
|
|
10
|
+
"form-data": "4.0.5",
|
|
11
|
+
"mime-types": "2.1.35",
|
|
12
|
+
"nanoid": "3.3.8",
|
|
13
|
+
"openai": "4.67.1",
|
|
14
|
+
"replicate": "0.34.1",
|
|
15
|
+
"semver": "7.6.0",
|
|
16
|
+
"zod": "3.25.76",
|
|
17
|
+
"@taskmagic/pieces-common": "0.4.4",
|
|
18
|
+
"@taskmagic/pieces-framework": "0.7.46",
|
|
19
|
+
"@taskmagic/shared": "0.10.171",
|
|
20
|
+
"tslib": "1.14.1"
|
|
21
|
+
},
|
|
22
|
+
"overrides": {
|
|
23
|
+
"cross-spawn": "7.0.6",
|
|
24
|
+
"elliptic": "^6.6.1",
|
|
25
|
+
"fast-xml-parser": "^4.4.1",
|
|
26
|
+
"protobufjs": "^7.5.5",
|
|
27
|
+
"tmp": "^0.2.4",
|
|
28
|
+
"koa": "^2.16.4",
|
|
29
|
+
"picomatch": "^4.0.4",
|
|
30
|
+
"langsmith": "^0.6.0",
|
|
31
|
+
"serialize-javascript": "^6.0.2",
|
|
32
|
+
"elevenlabs": {
|
|
33
|
+
"form-data": "^4.0.4"
|
|
34
|
+
},
|
|
35
|
+
"@tryfabric/martian": {
|
|
36
|
+
"@notionhq/client": "$@notionhq/client"
|
|
37
|
+
},
|
|
38
|
+
"vite": {
|
|
39
|
+
"rollup": "npm:@rollup/wasm-node@^4.61.1"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"resolutions": {
|
|
43
|
+
"rollup": "npm:@rollup/wasm-node@^4.61.1"
|
|
44
|
+
},
|
|
45
|
+
"types": "./src/index.d.ts",
|
|
46
|
+
"main": "./src/index.js",
|
|
47
|
+
"type": "commonjs"
|
|
48
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const parserExpert: import("@taskmagic/pieces-framework").Piece<import("@taskmagic/pieces-framework").SecretTextProperty<true>>;
|
package/src/index.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parserExpert = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@taskmagic/pieces-framework");
|
|
6
|
+
const shared_1 = require("@taskmagic/shared");
|
|
7
|
+
const pieces_common_1 = require("@taskmagic/pieces-common");
|
|
8
|
+
const auth_1 = require("./lib/common/auth");
|
|
9
|
+
const client_1 = require("./lib/common/client");
|
|
10
|
+
const upload_document_1 = require("./lib/actions/upload-document");
|
|
11
|
+
const get_extracted_data_1 = require("./lib/actions/get-extracted-data");
|
|
12
|
+
exports.parserExpert = (0, pieces_framework_1.createPiece)({
|
|
13
|
+
displayName: 'Parser Expert',
|
|
14
|
+
auth: auth_1.parserExpertAuth,
|
|
15
|
+
minimumSupportedRelease: '0.30.0',
|
|
16
|
+
logoUrl: 'https://cdn.activepieces.com/pieces/parser-expert.png',
|
|
17
|
+
description: "Parse documents and extract data from PDFs, DOCX files, images, and webpages using Parser Expert's powerful API.",
|
|
18
|
+
categories: [shared_1.PieceCategory.CONTENT_AND_FILES],
|
|
19
|
+
authors: ['onyedikachi-david'],
|
|
20
|
+
actions: [
|
|
21
|
+
upload_document_1.uploadDocument,
|
|
22
|
+
get_extracted_data_1.getExtractedData,
|
|
23
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
24
|
+
auth: auth_1.parserExpertAuth,
|
|
25
|
+
baseUrl: () => client_1.parserExpertCommon.baseUrl,
|
|
26
|
+
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
+
return {
|
|
28
|
+
'X-API-Key': auth,
|
|
29
|
+
};
|
|
30
|
+
}),
|
|
31
|
+
}),
|
|
32
|
+
],
|
|
33
|
+
triggers: [],
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/parser-expert/src/index.ts"],"names":[],"mappings":";;;;AAAA,kEAA0D;AAC1D,8CAAkD;AAClD,4DAAqE;AACrE,4CAAqD;AACrD,gDAAyD;AACzD,mEAA+D;AAC/D,yEAAoE;AAEvD,QAAA,YAAY,GAAG,IAAA,8BAAW,EAAC;IACtC,WAAW,EAAE,eAAe;IAC5B,IAAI,EAAE,uBAAgB;IACtB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,uDAAuD;IAChE,WAAW,EACT,kHAAkH;IACpH,UAAU,EAAE,CAAC,sBAAa,CAAC,iBAAiB,CAAC;IAC7C,OAAO,EAAE,CAAC,mBAAmB,CAAC;IAC9B,OAAO,EAAE;QACP,gCAAc;QACd,qCAAgB;QAChB,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,uBAAgB;YACtB,OAAO,EAAE,GAAG,EAAE,CAAC,2BAAkB,CAAC,OAAO;YACzC,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC1B,OAAO;oBACL,WAAW,EAAE,IAAc;iBAC5B,CAAC;YACJ,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const getExtractedData: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
parser_id: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
bucket_id: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getExtractedData = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@taskmagic/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@taskmagic/pieces-common");
|
|
7
|
+
const auth_1 = require("../common/auth");
|
|
8
|
+
const client_1 = require("../common/client");
|
|
9
|
+
exports.getExtractedData = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: auth_1.parserExpertAuth,
|
|
11
|
+
name: 'get_extracted_data',
|
|
12
|
+
displayName: 'Get Extracted Data',
|
|
13
|
+
description: 'Retrieve the extracted data using the parser ID and bucket ID. The parser ID is returned when you upload a document.',
|
|
14
|
+
props: {
|
|
15
|
+
parser_id: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Parser ID',
|
|
17
|
+
description: 'The ID of the parser. This is returned when content is uploaded.',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
bucket_id: pieces_framework_1.Property.ShortText({
|
|
21
|
+
displayName: 'Bucket ID',
|
|
22
|
+
description: 'The ID of the bucket where the data is stored.',
|
|
23
|
+
required: true,
|
|
24
|
+
}),
|
|
25
|
+
},
|
|
26
|
+
run(_a) {
|
|
27
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
28
|
+
const { parser_id, bucket_id } = propsValue;
|
|
29
|
+
const response = yield client_1.parserExpertCommon.apiCall({
|
|
30
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
31
|
+
url: '/v1/extracts',
|
|
32
|
+
auth: auth,
|
|
33
|
+
queryParams: {
|
|
34
|
+
parser_id,
|
|
35
|
+
bucket_id,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
return response;
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=get-extracted-data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-extracted-data.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/parser-expert/src/lib/actions/get-extracted-data.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,4DAAsD;AACtD,yCAAkD;AAClD,6CAAsD;AAEzC,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,uBAAgB;IACtB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EACT,sHAAsH;IACxH,KAAK,EAAE;QACL,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,WAAW;YACxB,WAAW,EACT,kEAAkE;YACpE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,gDAAgD;YAC7D,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC;YAE5C,MAAM,QAAQ,GAAG,MAAM,2BAAkB,CAAC,OAAO,CAQ9C;gBACD,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,cAAc;gBACnB,IAAI,EAAE,IAAc;gBACpB,WAAW,EAAE;oBACX,SAAS;oBACT,SAAS;iBACV;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const uploadDocument: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
bucket_id: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
file: import("@taskmagic/pieces-framework").FileProperty<false>;
|
|
4
|
+
webpage_url: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
|
|
5
|
+
}>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uploadDocument = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@taskmagic/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@taskmagic/pieces-common");
|
|
7
|
+
const form_data_1 = tslib_1.__importDefault(require("form-data"));
|
|
8
|
+
const auth_1 = require("../common/auth");
|
|
9
|
+
const client_1 = require("../common/client");
|
|
10
|
+
exports.uploadDocument = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: auth_1.parserExpertAuth,
|
|
12
|
+
name: 'upload_document',
|
|
13
|
+
displayName: 'Upload Document',
|
|
14
|
+
description: 'Upload a document or provide a webpage URL to parse. Supported formats: PDF, DOCX, Image, Txt File (maximum 10 pages per document).',
|
|
15
|
+
props: {
|
|
16
|
+
bucket_id: pieces_framework_1.Property.ShortText({
|
|
17
|
+
displayName: 'Bucket ID',
|
|
18
|
+
description: 'The ID of the bucket where the data will be stored. You can find this in your dashboard under Manage Bucket.',
|
|
19
|
+
required: true,
|
|
20
|
+
}),
|
|
21
|
+
file: pieces_framework_1.Property.File({
|
|
22
|
+
displayName: 'File',
|
|
23
|
+
description: 'The file to upload. Supported formats: PDF, DOCX, Image, Txt File (maximum 10 pages per document). This will be ignored if webpage URL is provided.',
|
|
24
|
+
required: false,
|
|
25
|
+
}),
|
|
26
|
+
webpage_url: pieces_framework_1.Property.ShortText({
|
|
27
|
+
displayName: 'Webpage URL',
|
|
28
|
+
description: 'The URL of the webpage to extract content from. This will be ignored if file is provided.',
|
|
29
|
+
required: false,
|
|
30
|
+
}),
|
|
31
|
+
},
|
|
32
|
+
run(_a) {
|
|
33
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
34
|
+
const { bucket_id, file, webpage_url } = propsValue;
|
|
35
|
+
if (!file && !webpage_url) {
|
|
36
|
+
throw new Error('Either file or webpage URL must be provided');
|
|
37
|
+
}
|
|
38
|
+
const formData = new form_data_1.default();
|
|
39
|
+
formData.append('bucket_id', bucket_id);
|
|
40
|
+
if (file) {
|
|
41
|
+
formData.append('file', file.data, file.filename);
|
|
42
|
+
}
|
|
43
|
+
else if (webpage_url) {
|
|
44
|
+
formData.append('webpage_url', webpage_url);
|
|
45
|
+
}
|
|
46
|
+
const response = yield client_1.parserExpertCommon.apiCall({
|
|
47
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
48
|
+
url: '/v1/upload',
|
|
49
|
+
auth: auth,
|
|
50
|
+
body: formData,
|
|
51
|
+
headers: formData.getHeaders(),
|
|
52
|
+
});
|
|
53
|
+
return response;
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=upload-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-document.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/parser-expert/src/lib/actions/upload-document.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,4DAAsD;AACtD,kEAAiC;AACjC,yCAAkD;AAClD,6CAAsD;AAEzC,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,uBAAgB;IACtB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EACT,qIAAqI;IACvI,KAAK,EAAE;QACL,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,WAAW;YACxB,WAAW,EACT,8GAA8G;YAChH,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAClB,WAAW,EAAE,MAAM;YACnB,WAAW,EACT,qJAAqJ;YACvJ,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,aAAa;YAC1B,WAAW,EACT,2FAA2F;YAC7F,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC;YAEpD,IAAI,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;gBAC1B,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;YACjE,CAAC;YAED,MAAM,QAAQ,GAAG,IAAI,mBAAQ,EAAE,CAAC;YAChC,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;YAExC,IAAI,IAAI,EAAE,CAAC;gBACT,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YACpD,CAAC;iBAAM,IAAI,WAAW,EAAE,CAAC;gBACvB,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;YAC9C,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,2BAAkB,CAAC,OAAO,CAK9C;gBACD,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,YAAY;gBACjB,IAAI,EAAE,IAAc;gBACpB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE;aAC/B,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const parserExpertAuth: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parserExpertAuth = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@taskmagic/pieces-framework");
|
|
6
|
+
exports.parserExpertAuth = pieces_framework_1.PieceAuth.SecretText({
|
|
7
|
+
displayName: 'API Key',
|
|
8
|
+
description: 'Your Parser Expert API key. You can find this in your dashboard under Integration -> New API Key.',
|
|
9
|
+
required: true,
|
|
10
|
+
validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
11
|
+
if (!auth) {
|
|
12
|
+
return {
|
|
13
|
+
valid: false,
|
|
14
|
+
error: 'API key is required',
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
valid: true,
|
|
19
|
+
};
|
|
20
|
+
}),
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/parser-expert/src/lib/common/auth.ts"],"names":[],"mappings":";;;;AAAA,kEAAwD;AAE3C,QAAA,gBAAgB,GAAG,4BAAS,CAAC,UAAU,CAAC;IACnD,WAAW,EAAE,SAAS;IACtB,WAAW,EACT,mGAAmG;IACrG,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,qBAAqB;aAC7B,CAAC;QACJ,CAAC;QAED,OAAO;YACL,KAAK,EAAE,IAAI;SACZ,CAAC;IACJ,CAAC,CAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HttpMethod } from '@taskmagic/pieces-common';
|
|
2
|
+
export declare const parserExpertCommon: {
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
apiCall<T>({ method, url, auth, body, headers, queryParams, }: {
|
|
5
|
+
method: HttpMethod;
|
|
6
|
+
url: string;
|
|
7
|
+
auth: string;
|
|
8
|
+
body?: unknown;
|
|
9
|
+
headers?: Record<string, string>;
|
|
10
|
+
queryParams?: Record<string, string>;
|
|
11
|
+
}): Promise<T>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parserExpertCommon = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_common_1 = require("@taskmagic/pieces-common");
|
|
6
|
+
exports.parserExpertCommon = {
|
|
7
|
+
baseUrl: 'https://api.parser.expert',
|
|
8
|
+
apiCall(_a) {
|
|
9
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ method, url, auth, body, headers, queryParams, }) {
|
|
10
|
+
let fullUrl = `${this.baseUrl}${url}`;
|
|
11
|
+
if (queryParams && Object.keys(queryParams).length > 0) {
|
|
12
|
+
const params = new URLSearchParams(queryParams);
|
|
13
|
+
fullUrl += `?${params.toString()}`;
|
|
14
|
+
}
|
|
15
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
16
|
+
method,
|
|
17
|
+
url: fullUrl,
|
|
18
|
+
headers: Object.assign({ 'X-API-Key': auth }, headers),
|
|
19
|
+
body,
|
|
20
|
+
});
|
|
21
|
+
if (response.status >= 400) {
|
|
22
|
+
throw new Error(`Parser Expert API error: ${response.status} ${JSON.stringify(response.body)}`);
|
|
23
|
+
}
|
|
24
|
+
return response.body;
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/parser-expert/src/lib/common/client.ts"],"names":[],"mappings":";;;;AAAA,4DAAkE;AAErD,QAAA,kBAAkB,GAAG;IAChC,OAAO,EAAE,2BAA2B;IAE9B,OAAO;qEAAI,EACf,MAAM,EACN,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,WAAW,GAQZ;YACC,IAAI,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,GAAG,EAAE,CAAC;YAEtC,IAAI,WAAW,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACvD,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,WAAW,CAAC,CAAC;gBAChD,OAAO,IAAI,IAAI,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;YACrC,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAI;gBAC/C,MAAM;gBACN,GAAG,EAAE,OAAO;gBACZ,OAAO,kBACL,WAAW,EAAE,IAAI,IACd,OAAO,CACX;gBACD,IAAI;aACL,CAAC,CAAC;YAEH,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;gBAC3B,MAAM,IAAI,KAAK,CACb,4BAA4B,QAAQ,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,CAC3D,QAAQ,CAAC,IAAI,CACd,EAAE,CACJ,CAAC;YACJ,CAAC;YAED,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC"}
|