@activepieces/piece-mindee 0.0.1 → 0.0.3
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/package.json
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-mindee",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@sinclair/typebox": "0.26.8",
|
|
6
6
|
"axios": "1.2.4",
|
|
7
7
|
"form-data": "4.0.0",
|
|
8
|
+
"lodash": "4.17.21",
|
|
8
9
|
"nanoid": "3.3.4",
|
|
9
|
-
"@activepieces/framework": "0.3.
|
|
10
|
-
"@activepieces/shared": "0.3.
|
|
11
|
-
"
|
|
10
|
+
"@activepieces/pieces-framework": "0.3.27",
|
|
11
|
+
"@activepieces/shared": "0.3.44",
|
|
12
|
+
"@activepieces/pieces-common": "0.0.7",
|
|
13
|
+
"tslib": "2.5.3"
|
|
12
14
|
},
|
|
13
15
|
"main": "./src/index.js",
|
|
14
16
|
"types": "./src/index.d.ts"
|
package/src/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const mindee: import("@activepieces/framework").Piece;
|
|
1
|
+
export declare const mindee: import("@activepieces/pieces-framework").Piece;
|
package/src/index.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mindee = void 0;
|
|
4
|
-
const
|
|
5
|
-
const framework_1 = require("@activepieces/framework");
|
|
6
|
-
const package_json_1 = tslib_1.__importDefault(require("../package.json"));
|
|
4
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
5
|
const predict_document_1 = require("./lib/actions/predict-document");
|
|
8
|
-
exports.mindee = (0,
|
|
9
|
-
name: "mindee",
|
|
6
|
+
exports.mindee = (0, pieces_framework_1.createPiece)({
|
|
10
7
|
displayName: "Mindee",
|
|
11
8
|
logoUrl: "https://cdn.activepieces.com/pieces/mindee.png",
|
|
12
|
-
version: package_json_1.default.version,
|
|
13
9
|
authors: ['kanarelo'],
|
|
14
10
|
actions: [predict_document_1.mindeePredictDocumentAction],
|
|
15
11
|
triggers: [],
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/mindee/src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/mindee/src/index.ts"],"names":[],"mappings":";;;AACA,qEAA6D;AAC7D,qEAA6E;AAEhE,QAAA,MAAM,GAAG,IAAA,8BAAW,EAAC;IAChC,WAAW,EAAE,QAAQ;IACrB,OAAO,EAAE,gDAAgD;IACzD,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,OAAO,EAAE,CAAC,8CAA2B,CAAC;IACtC,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const mindeePredictDocumentAction: import("@activepieces/framework").Action;
|
|
1
|
+
export declare const mindeePredictDocumentAction: import("@activepieces/pieces-framework").Action;
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mindeePredictDocumentAction = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
7
|
const fs_1 = require("fs");
|
|
7
8
|
const form_data_1 = tslib_1.__importDefault(require("form-data"));
|
|
8
|
-
exports.mindeePredictDocumentAction = (0,
|
|
9
|
+
exports.mindeePredictDocumentAction = (0, pieces_framework_1.createAction)({
|
|
9
10
|
name: 'mindee_predict_document',
|
|
10
11
|
displayName: 'Extract Document',
|
|
11
12
|
description: 'Parse details of a document using OCR.',
|
|
12
13
|
props: {
|
|
13
|
-
authentication:
|
|
14
|
+
authentication: pieces_framework_1.Property.SecretText({
|
|
14
15
|
displayName: 'Api Key',
|
|
15
16
|
description: `
|
|
16
17
|
#### To obtain access your Api Key
|
|
@@ -20,13 +21,13 @@ exports.mindeePredictDocumentAction = (0, framework_1.createAction)({
|
|
|
20
21
|
`,
|
|
21
22
|
required: true,
|
|
22
23
|
}),
|
|
23
|
-
account_name:
|
|
24
|
+
account_name: pieces_framework_1.Property.ShortText({
|
|
24
25
|
displayName: 'Account Name',
|
|
25
26
|
description: 'Refers to your username or organization name with which you signed up with.',
|
|
26
27
|
required: true,
|
|
27
28
|
defaultValue: 'mindee'
|
|
28
29
|
}),
|
|
29
|
-
api_name:
|
|
30
|
+
api_name: pieces_framework_1.Property.StaticDropdown({
|
|
30
31
|
displayName: 'API Name',
|
|
31
32
|
description: 'Refers to the name of the API your are using.',
|
|
32
33
|
required: true,
|
|
@@ -43,7 +44,7 @@ exports.mindeePredictDocumentAction = (0, framework_1.createAction)({
|
|
|
43
44
|
]
|
|
44
45
|
}
|
|
45
46
|
}),
|
|
46
|
-
file:
|
|
47
|
+
file: pieces_framework_1.Property.LongText({
|
|
47
48
|
displayName: 'File URL',
|
|
48
49
|
description: 'Remote file URL or Base64 string. We currently support .pdf (slower), .jpg, .png, .webp, .tiff and .heic formats',
|
|
49
50
|
required: true
|
|
@@ -96,8 +97,8 @@ exports.mindeePredictDocumentAction = (0, framework_1.createAction)({
|
|
|
96
97
|
body = { 'document': file };
|
|
97
98
|
headers = { 'Content-Type': 'application/json' };
|
|
98
99
|
}
|
|
99
|
-
const response = yield
|
|
100
|
-
method:
|
|
100
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
101
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
101
102
|
url: `https://api.mindee.net/v1/products/${account_name}/${api_name}/predict`,
|
|
102
103
|
headers: Object.assign({ Authorization: `Token ${authentication}` }, headers),
|
|
103
104
|
body: body
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predict-document.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/mindee/src/lib/actions/predict-document.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"predict-document.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/mindee/src/lib/actions/predict-document.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAqE;AACrE,2BAAqC;AACrC,kEAAiC;AAEpB,QAAA,2BAA2B,GAAG,IAAA,+BAAY,EAAC;IACtD,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,wCAAwC;IACrD,KAAK,EAAE;QACL,cAAc,EAAE,2BAAQ,CAAC,UAAU,CAAC;YAClC,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE;;;;;OAKZ;YACD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,6EAA6E;YAC1F,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,QAAQ;SACvB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAChC,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,+CAA+C;YAC5D,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,MAAM;YACpB,OAAO,EAAE;gBACP,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,0BAA0B,EAAE;oBACvE,EAAE,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,aAAa,EAAE;oBACrD,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,cAAc,EAAE;oBAC/C,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;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