@activepieces/piece-detecting-ai 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 +7 -0
- package/package.json +28 -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/check-plagiarism.d.ts +3 -0
- package/src/lib/actions/check-plagiarism.js +38 -0
- package/src/lib/actions/check-plagiarism.js.map +1 -0
- package/src/lib/actions/detect-ai-content.d.ts +4 -0
- package/src/lib/actions/detect-ai-content.js +56 -0
- package/src/lib/actions/detect-ai-content.js.map +1 -0
- package/src/lib/actions/humanize-text.d.ts +4 -0
- package/src/lib/actions/humanize-text.js +56 -0
- package/src/lib/actions/humanize-text.js.map +1 -0
- package/src/lib/common/index.d.ts +11 -0
- package/src/lib/common/index.js +37 -0
- package/src/lib/common/index.js.map +1 -0
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@activepieces/piece-detecting-ai",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "commonjs",
|
|
5
|
+
"main": "./src/index.js",
|
|
6
|
+
"types": "./src/index.d.ts",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@sinclair/typebox": "0.34.11",
|
|
9
|
+
"ai": "5.0.104",
|
|
10
|
+
"axios": "1.13.1",
|
|
11
|
+
"axios-retry": "4.4.1",
|
|
12
|
+
"deepmerge-ts": "7.1.0",
|
|
13
|
+
"form-data": "4.0.4",
|
|
14
|
+
"i18next": "23.13.0",
|
|
15
|
+
"mime-types": "2.1.35",
|
|
16
|
+
"nanoid": "3.3.8",
|
|
17
|
+
"semver": "7.6.0",
|
|
18
|
+
"socket.io-client": "4.8.1",
|
|
19
|
+
"tslib": "^2.3.0",
|
|
20
|
+
"zod": "4.1.13",
|
|
21
|
+
"@activepieces/pieces-common": "0.11.1",
|
|
22
|
+
"@activepieces/pieces-framework": "0.23.0",
|
|
23
|
+
"@activepieces/shared": "0.32.0"
|
|
24
|
+
},
|
|
25
|
+
"resolutions": {
|
|
26
|
+
"rollup": "npm:@rollup/wasm-node"
|
|
27
|
+
}
|
|
28
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const detectingAi: import("@activepieces/pieces-framework").Piece<import("@activepieces/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.detectingAi = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const shared_1 = require("@activepieces/shared");
|
|
7
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
8
|
+
const common_1 = require("./lib/common");
|
|
9
|
+
const detect_ai_content_1 = require("./lib/actions/detect-ai-content");
|
|
10
|
+
const check_plagiarism_1 = require("./lib/actions/check-plagiarism");
|
|
11
|
+
const humanize_text_1 = require("./lib/actions/humanize-text");
|
|
12
|
+
exports.detectingAi = (0, pieces_framework_1.createPiece)({
|
|
13
|
+
displayName: 'DETECTING-AI.COM',
|
|
14
|
+
auth: common_1.detectingAiAuth,
|
|
15
|
+
minimumSupportedRelease: '0.36.1',
|
|
16
|
+
logoUrl: 'https://cdn.activepieces.com/pieces/detecting-ai.png',
|
|
17
|
+
categories: [shared_1.PieceCategory.ARTIFICIAL_INTELLIGENCE],
|
|
18
|
+
authors: ['onyedikachi-david'],
|
|
19
|
+
actions: [
|
|
20
|
+
detect_ai_content_1.detectAiContent,
|
|
21
|
+
check_plagiarism_1.checkPlagiarism,
|
|
22
|
+
humanize_text_1.humanizeText,
|
|
23
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
24
|
+
auth: common_1.detectingAiAuth,
|
|
25
|
+
baseUrl: () => common_1.BASE_URL,
|
|
26
|
+
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
+
return {
|
|
28
|
+
'X-API-Key': auth.secret_text,
|
|
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/detecting-ai/src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA6D;AAC7D,iDAAqD;AACrD,+DAAwE;AACxE,yCAAyD;AACzD,uEAAkE;AAClE,qEAAiE;AACjE,+DAA2D;AAE9C,QAAA,WAAW,GAAG,IAAA,8BAAW,EAAC;IACrC,WAAW,EAAE,kBAAkB;IAC/B,IAAI,EAAE,wBAAe;IACrB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,sDAAsD;IAC/D,UAAU,EAAE,CAAC,sBAAa,CAAC,uBAAuB,CAAC;IACnD,OAAO,EAAE,CAAC,mBAAmB,CAAC;IAC9B,OAAO,EAAE;QACP,mCAAe;QACf,kCAAe;QACf,4BAAY;QACZ,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,wBAAe;YACrB,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAQ;YACvB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC1B,OAAO;oBACL,WAAW,EAAE,IAAI,CAAC,WAAW;iBAC9B,CAAC;YACJ,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkPlagiarism = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
exports.checkPlagiarism = (0, pieces_framework_1.createAction)({
|
|
9
|
+
name: 'check_plagiarism',
|
|
10
|
+
displayName: 'Check Plagiarism',
|
|
11
|
+
description: 'Check text for plagiarism',
|
|
12
|
+
auth: common_1.detectingAiAuth,
|
|
13
|
+
requireAuth: true,
|
|
14
|
+
props: {
|
|
15
|
+
text: pieces_framework_1.Property.LongText({
|
|
16
|
+
displayName: 'Text',
|
|
17
|
+
required: true,
|
|
18
|
+
}),
|
|
19
|
+
},
|
|
20
|
+
run(_a) {
|
|
21
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
22
|
+
const apiKey = auth.secret_text;
|
|
23
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
24
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
25
|
+
url: `${common_1.BASE_URL}/api/plagiarism/`,
|
|
26
|
+
headers: {
|
|
27
|
+
'X-API-Key': apiKey,
|
|
28
|
+
'Content-Type': 'application/json',
|
|
29
|
+
},
|
|
30
|
+
body: {
|
|
31
|
+
text: propsValue.text,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
return response.body;
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=check-plagiarism.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-plagiarism.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/detecting-ai/src/lib/actions/check-plagiarism.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAqE;AACrE,sCAAsD;AAEzC,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,2BAA2B;IACxC,IAAI,EAAE,wBAAe;IACrB,WAAW,EAAE,IAAI;IACjB,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,MAAM;YACnB,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC;YAEhC,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,iBAAQ,kBAAkB;gBAClC,OAAO,EAAE;oBACP,WAAW,EAAE,MAAM;oBACnB,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,UAAU,CAAC,IAAI;iBACtB;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const detectAiContent: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
text: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
version: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
4
|
+
}>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.detectAiContent = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
exports.detectAiContent = (0, pieces_framework_1.createAction)({
|
|
9
|
+
name: 'detect_ai_content',
|
|
10
|
+
displayName: 'Detect AI Content',
|
|
11
|
+
description: 'Detect AI-generated content in text',
|
|
12
|
+
auth: common_1.detectingAiAuth,
|
|
13
|
+
requireAuth: true,
|
|
14
|
+
props: {
|
|
15
|
+
text: pieces_framework_1.Property.LongText({
|
|
16
|
+
displayName: 'Text',
|
|
17
|
+
required: true,
|
|
18
|
+
}),
|
|
19
|
+
version: pieces_framework_1.Property.StaticDropdown({
|
|
20
|
+
displayName: 'Version',
|
|
21
|
+
required: true,
|
|
22
|
+
options: {
|
|
23
|
+
options: [
|
|
24
|
+
{
|
|
25
|
+
label: 'v1',
|
|
26
|
+
value: 'v1',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: 'v2',
|
|
30
|
+
value: 'v2',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
defaultValue: 'v2',
|
|
35
|
+
}),
|
|
36
|
+
},
|
|
37
|
+
run(_a) {
|
|
38
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
39
|
+
const apiKey = auth.secret_text;
|
|
40
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
41
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
42
|
+
url: `${common_1.BASE_URL}/api/detect/`,
|
|
43
|
+
headers: {
|
|
44
|
+
'X-API-Key': apiKey,
|
|
45
|
+
'Content-Type': 'application/json',
|
|
46
|
+
},
|
|
47
|
+
body: {
|
|
48
|
+
text: propsValue.text,
|
|
49
|
+
version: propsValue.version,
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
return response.body;
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=detect-ai-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-ai-content.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/detecting-ai/src/lib/actions/detect-ai-content.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAqE;AACrE,sCAAsD;AAEzC,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,qCAAqC;IAClD,IAAI,EAAE,wBAAe;IACrB,WAAW,EAAE,IAAI;IACjB,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,MAAM;YACnB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC/B,WAAW,EAAE,SAAS;YACtB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,IAAI;wBACX,KAAK,EAAE,IAAI;qBACZ;oBACD;wBACE,KAAK,EAAE,IAAI;wBACX,KAAK,EAAE,IAAI;qBACZ;iBACF;aACF;YACD,YAAY,EAAE,IAAI;SACnB,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC;YAEhC,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,iBAAQ,cAAc;gBAC9B,OAAO,EAAE;oBACP,WAAW,EAAE,MAAM;oBACnB,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,UAAU,CAAC,IAAI;oBACrB,OAAO,EAAE,UAAU,CAAC,OAAO;iBAC5B;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const humanizeText: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
text: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
model: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
4
|
+
}>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.humanizeText = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
exports.humanizeText = (0, pieces_framework_1.createAction)({
|
|
9
|
+
name: 'humanize_text',
|
|
10
|
+
displayName: 'Humanize Text',
|
|
11
|
+
description: 'Humanize text to make it sound more natural',
|
|
12
|
+
auth: common_1.detectingAiAuth,
|
|
13
|
+
requireAuth: true,
|
|
14
|
+
props: {
|
|
15
|
+
text: pieces_framework_1.Property.LongText({
|
|
16
|
+
displayName: 'Text',
|
|
17
|
+
required: true,
|
|
18
|
+
}),
|
|
19
|
+
model: pieces_framework_1.Property.StaticDropdown({
|
|
20
|
+
displayName: 'Model',
|
|
21
|
+
required: true,
|
|
22
|
+
options: {
|
|
23
|
+
options: [
|
|
24
|
+
{
|
|
25
|
+
label: 'cognia',
|
|
26
|
+
value: 'cognia',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: 'lexi',
|
|
30
|
+
value: 'lexi',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
defaultValue: 'lexi',
|
|
35
|
+
}),
|
|
36
|
+
},
|
|
37
|
+
run(_a) {
|
|
38
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
39
|
+
const apiKey = auth.secret_text;
|
|
40
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
41
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
42
|
+
url: `${common_1.BASE_URL}/api/humanize/`,
|
|
43
|
+
headers: {
|
|
44
|
+
'X-API-Key': apiKey,
|
|
45
|
+
'Content-Type': 'application/json',
|
|
46
|
+
},
|
|
47
|
+
body: {
|
|
48
|
+
text: propsValue.text,
|
|
49
|
+
model: propsValue.model,
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
return response.body;
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=humanize-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"humanize-text.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/detecting-ai/src/lib/actions/humanize-text.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAqE;AACrE,sCAAsD;AAEzC,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACvC,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,6CAA6C;IAC1D,IAAI,EAAE,wBAAe;IACrB,WAAW,EAAE,IAAI;IACjB,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,MAAM;YACnB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC7B,WAAW,EAAE,OAAO;YACpB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,QAAQ;wBACf,KAAK,EAAE,QAAQ;qBAChB;oBACD;wBACE,KAAK,EAAE,MAAM;wBACb,KAAK,EAAE,MAAM;qBACd;iBACF;aACF;YACD,YAAY,EAAE,MAAM;SACrB,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC;YAEhC,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,iBAAQ,gBAAgB;gBAChC,OAAO,EAAE;oBACP,WAAW,EAAE,MAAM;oBACnB,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,UAAU,CAAC,IAAI;oBACrB,KAAK,EAAE,UAAU,CAAC,KAAK;iBACxB;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HttpMethod, HttpMessageBody } from '@activepieces/pieces-common';
|
|
2
|
+
export declare const BASE_URL = "https://api.detecting-ai.com";
|
|
3
|
+
export declare const detectingAiAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
+
export type DetectingAiApiCallParams = {
|
|
5
|
+
apiKey: string;
|
|
6
|
+
method: HttpMethod;
|
|
7
|
+
endpoint: string;
|
|
8
|
+
query?: Record<string, string | number | string[] | undefined>;
|
|
9
|
+
body?: unknown;
|
|
10
|
+
};
|
|
11
|
+
export declare function detectingAiApiCall<T extends HttpMessageBody>({ apiKey, method, endpoint, query, body, }: DetectingAiApiCallParams): Promise<T>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.detectingAiAuth = exports.BASE_URL = void 0;
|
|
4
|
+
exports.detectingAiApiCall = detectingAiApiCall;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
8
|
+
exports.BASE_URL = 'https://api.detecting-ai.com';
|
|
9
|
+
exports.detectingAiAuth = pieces_framework_1.PieceAuth.SecretText({
|
|
10
|
+
displayName: 'API Key',
|
|
11
|
+
description: 'You can obtain your API key from the [DETECTING-AI.COM Dashboard](https://detecting-ai.com) in the API section.',
|
|
12
|
+
required: true,
|
|
13
|
+
});
|
|
14
|
+
function detectingAiApiCall(_a) {
|
|
15
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ apiKey, method, endpoint, query, body, }) {
|
|
16
|
+
const qs = {};
|
|
17
|
+
if (query) {
|
|
18
|
+
for (const [key, value] of Object.entries(query)) {
|
|
19
|
+
if (value !== null && value !== undefined) {
|
|
20
|
+
qs[key] = String(value);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const request = {
|
|
25
|
+
method,
|
|
26
|
+
url: `${exports.BASE_URL}${endpoint}`,
|
|
27
|
+
headers: {
|
|
28
|
+
'X-API-Key': apiKey,
|
|
29
|
+
},
|
|
30
|
+
queryParams: qs,
|
|
31
|
+
body,
|
|
32
|
+
};
|
|
33
|
+
const response = yield pieces_common_1.httpClient.sendRequest(request);
|
|
34
|
+
return response.body;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/detecting-ai/src/lib/common/index.ts"],"names":[],"mappings":";;;AA0BA,gDA6BC;;AAvDD,qEAA2D;AAC3D,+DAMqC;AAExB,QAAA,QAAQ,GAAG,8BAA8B,CAAC;AAE1C,QAAA,eAAe,GAAG,4BAAS,CAAC,UAAU,CAAC;IAClD,WAAW,EAAE,SAAS;IACtB,WAAW,EACT,iHAAiH;IACnH,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC;AAUH,SAAsB,kBAAkB;iEAA4B,EAClE,MAAM,EACN,MAAM,EACN,QAAQ,EACR,KAAK,EACL,IAAI,GACqB;QACzB,MAAM,EAAE,GAAgB,EAAE,CAAC;QAE3B,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBACjD,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;oBAC1C,EAAE,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;gBAC1B,CAAC;YACH,CAAC;QACH,CAAC;QAED,MAAM,OAAO,GAAgB;YAC3B,MAAM;YACN,GAAG,EAAE,GAAG,gBAAQ,GAAG,QAAQ,EAAE;YAC7B,OAAO,EAAE;gBACP,WAAW,EAAE,MAAM;aACpB;YACD,WAAW,EAAE,EAAE;YACf,IAAI;SACL,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAI,OAAO,CAAC,CAAC;QAC1D,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CAAA"}
|