n8n-nodes-deapi 0.1.0
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/LICENSE +21 -0
- package/README.md +90 -0
- package/dist/credentials/DeApi.credentials.d.ts +10 -0
- package/dist/credentials/DeApi.credentials.js +50 -0
- package/dist/credentials/DeApi.credentials.js.map +1 -0
- package/dist/credentials/deapi.svg +16 -0
- package/dist/nodes/Deapi/Deapi.node.d.ts +6 -0
- package/dist/nodes/Deapi/Deapi.node.js +166 -0
- package/dist/nodes/Deapi/Deapi.node.js.map +1 -0
- package/dist/nodes/Deapi/Deapi.node.json +18 -0
- package/dist/nodes/Deapi/DeapiTrigger.node.d.ts +12 -0
- package/dist/nodes/Deapi/DeapiTrigger.node.js +154 -0
- package/dist/nodes/Deapi/DeapiTrigger.node.js.map +1 -0
- package/dist/nodes/Deapi/DeapiTrigger.node.json +18 -0
- package/dist/nodes/Deapi/actions/audio/index.d.ts +4 -0
- package/dist/nodes/Deapi/actions/audio/index.js +62 -0
- package/dist/nodes/Deapi/actions/audio/index.js.map +1 -0
- package/dist/nodes/Deapi/actions/audio/transcribe.operation.d.ts +28 -0
- package/dist/nodes/Deapi/actions/audio/transcribe.operation.js +89 -0
- package/dist/nodes/Deapi/actions/audio/transcribe.operation.js.map +1 -0
- package/dist/nodes/Deapi/actions/image/generate.operation.d.ts +28 -0
- package/dist/nodes/Deapi/actions/image/generate.operation.js +484 -0
- package/dist/nodes/Deapi/actions/image/generate.operation.js.map +1 -0
- package/dist/nodes/Deapi/actions/image/index.d.ts +6 -0
- package/dist/nodes/Deapi/actions/image/index.js +80 -0
- package/dist/nodes/Deapi/actions/image/index.js.map +1 -0
- package/dist/nodes/Deapi/actions/image/removeBackground.operation.d.ts +28 -0
- package/dist/nodes/Deapi/actions/image/removeBackground.operation.js +79 -0
- package/dist/nodes/Deapi/actions/image/removeBackground.operation.js.map +1 -0
- package/dist/nodes/Deapi/actions/image/upscale.operation.d.ts +28 -0
- package/dist/nodes/Deapi/actions/image/upscale.operation.js +79 -0
- package/dist/nodes/Deapi/actions/image/upscale.operation.js.map +1 -0
- package/dist/nodes/Deapi/actions/node.type.d.ts +9 -0
- package/dist/nodes/Deapi/actions/node.type.js +3 -0
- package/dist/nodes/Deapi/actions/node.type.js.map +1 -0
- package/dist/nodes/Deapi/actions/prompt/imagePromptBooster.operation.d.ts +28 -0
- package/dist/nodes/Deapi/actions/prompt/imagePromptBooster.operation.js +68 -0
- package/dist/nodes/Deapi/actions/prompt/imagePromptBooster.operation.js.map +1 -0
- package/dist/nodes/Deapi/actions/prompt/index.d.ts +5 -0
- package/dist/nodes/Deapi/actions/prompt/index.js +71 -0
- package/dist/nodes/Deapi/actions/prompt/index.js.map +1 -0
- package/dist/nodes/Deapi/actions/prompt/videoPromptBooster.operation.d.ts +28 -0
- package/dist/nodes/Deapi/actions/prompt/videoPromptBooster.operation.js +93 -0
- package/dist/nodes/Deapi/actions/prompt/videoPromptBooster.operation.js.map +1 -0
- package/dist/nodes/Deapi/actions/router.d.ts +2 -0
- package/dist/nodes/Deapi/actions/router.js +102 -0
- package/dist/nodes/Deapi/actions/router.js.map +1 -0
- package/dist/nodes/Deapi/actions/video/generate.operation.d.ts +28 -0
- package/dist/nodes/Deapi/actions/video/generate.operation.js +477 -0
- package/dist/nodes/Deapi/actions/video/generate.operation.js.map +1 -0
- package/dist/nodes/Deapi/actions/video/index.d.ts +5 -0
- package/dist/nodes/Deapi/actions/video/index.js +71 -0
- package/dist/nodes/Deapi/actions/video/index.js.map +1 -0
- package/dist/nodes/Deapi/actions/video/transcribe.operation.d.ts +28 -0
- package/dist/nodes/Deapi/actions/video/transcribe.operation.js +141 -0
- package/dist/nodes/Deapi/actions/video/transcribe.operation.js.map +1 -0
- package/dist/nodes/Deapi/deapi.svg +16 -0
- package/dist/nodes/Deapi/helpers/binary-data.d.ts +7 -0
- package/dist/nodes/Deapi/helpers/binary-data.js +38 -0
- package/dist/nodes/Deapi/helpers/binary-data.js.map +1 -0
- package/dist/nodes/Deapi/helpers/formdata.d.ts +8 -0
- package/dist/nodes/Deapi/helpers/formdata.js +23 -0
- package/dist/nodes/Deapi/helpers/formdata.js.map +1 -0
- package/dist/nodes/Deapi/helpers/interfaces.d.ts +81 -0
- package/dist/nodes/Deapi/helpers/interfaces.js +3 -0
- package/dist/nodes/Deapi/helpers/interfaces.js.map +1 -0
- package/dist/nodes/Deapi/helpers/webhook-verification.d.ts +1 -0
- package/dist/nodes/Deapi/helpers/webhook-verification.js +58 -0
- package/dist/nodes/Deapi/helpers/webhook-verification.js.map +1 -0
- package/dist/nodes/Deapi/transport/index.d.ts +9 -0
- package/dist/nodes/Deapi/transport/index.js +29 -0
- package/dist/nodes/Deapi/transport/index.js.map +1 -0
- package/dist/package.json +82 -0
- package/package.json +80 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alex Glowacki
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# n8n-nodes-deapi
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/n8n-nodes-deapi)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
|
|
6
|
+
This is an n8n community node that lets you use [deAPI](https://deapi.ai/) in your n8n workflows.
|
|
7
|
+
|
|
8
|
+
deAPI is a unified API platform providing instant access to open-source AI models (FLUX, LTX Video, Whisper and more) through a decentralized GPU network. One API key to access thousands of GPUs with up to 20x lower costs.
|
|
9
|
+
|
|
10
|
+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation platform.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
|
|
15
|
+
|
|
16
|
+
## Credentials
|
|
17
|
+
|
|
18
|
+
To use this node, you need to configure the following credentials:
|
|
19
|
+
|
|
20
|
+
| Field | Description |
|
|
21
|
+
|-------|-------------|
|
|
22
|
+
| **API Key** | Your deAPI API key. Get it from the [deAPI Quickstart Guide](https://docs.deapi.ai/quickstart#2-obtain-your-api-key). |
|
|
23
|
+
| **Webhook Secret** | Secret used to verify webhook signatures. Configure it at [deAPI Webhook Settings](https://deapi.ai/settings/webhooks). |
|
|
24
|
+
|
|
25
|
+
## Operations
|
|
26
|
+
|
|
27
|
+
### Image
|
|
28
|
+
|
|
29
|
+
| Operation | Description | Models |
|
|
30
|
+
|-----------|-------------|--------|
|
|
31
|
+
| **Generate** | Generate an image from a text prompt | FLUX.1 Schnell, FLUX.2 Klein 4B, Z-Image Turbo |
|
|
32
|
+
| **Remove Background** | Remove the background from an image | Ben2 |
|
|
33
|
+
| **Upscale** | Increase image resolution by 4x | RealESRGAN x4 |
|
|
34
|
+
|
|
35
|
+
### Video
|
|
36
|
+
|
|
37
|
+
| Operation | Description | Models |
|
|
38
|
+
|-----------|-------------|--------|
|
|
39
|
+
| **Generate** | Generate a video from text or image(s) | LTX-Video 0.9.8, LTX-2 19B |
|
|
40
|
+
| **Transcribe** | Transcribe video to text (YouTube, Twitch, X, Kick URLs or file upload) | Whisper Large V3 |
|
|
41
|
+
|
|
42
|
+
### Audio
|
|
43
|
+
|
|
44
|
+
| Operation | Description | Models |
|
|
45
|
+
|-----------|-------------|--------|
|
|
46
|
+
| **Transcribe** | Transcribe audio file to text | Whisper Large V3 |
|
|
47
|
+
|
|
48
|
+
### Prompt
|
|
49
|
+
|
|
50
|
+
| Operation | Description |
|
|
51
|
+
|-----------|-------------|
|
|
52
|
+
| **Image Prompt Booster** | Optimize a prompt for text-to-image generation |
|
|
53
|
+
| **Video Prompt Booster** | Optimize a prompt for text/image-to-video generation |
|
|
54
|
+
|
|
55
|
+
## How It Works
|
|
56
|
+
|
|
57
|
+
Generation operations (image, video, transcription) use a webhook-based waiting pattern:
|
|
58
|
+
|
|
59
|
+
1. The node submits a generation request to deAPI with a webhook URL
|
|
60
|
+
2. The workflow pauses while deAPI processes the request
|
|
61
|
+
3. When deAPI completes the job, it sends a webhook notification
|
|
62
|
+
4. The workflow resumes with the generated content (binary file or text)
|
|
63
|
+
|
|
64
|
+
This approach ensures efficient resource usage - the workflow doesn't actively poll for results.
|
|
65
|
+
|
|
66
|
+
## Compatibility
|
|
67
|
+
|
|
68
|
+
- Tested with n8n version 2.3.4
|
|
69
|
+
- Webhook-based operations require n8n to be accessible via HTTPS
|
|
70
|
+
|
|
71
|
+
## Example Workflow
|
|
72
|
+
|
|
73
|
+
An example n8n workflow demonstrating all available operations is included in [`examples/deAPI_guide.json`](examples/deAPI_guide.json). Import it into your n8n instance to get started quickly:
|
|
74
|
+
|
|
75
|
+
1. Download [`deAPI_guide.json`](https://raw.githubusercontent.com/deapi-ai/n8n-nodes-deapi/main/examples/deAPI_guide.json) from the GitHub repository
|
|
76
|
+
2. In n8n, go to **Workflows** > **Import from File**
|
|
77
|
+
3. Select the downloaded `deAPI_guide.json`
|
|
78
|
+
4. Set up your deAPI credentials (API Key + Webhook Secret)
|
|
79
|
+
5. Explore the example nodes and sticky notes for usage instructions
|
|
80
|
+
|
|
81
|
+
## Resources
|
|
82
|
+
|
|
83
|
+
- [n8n community nodes documentation](https://docs.n8n.io/integrations/community-nodes/)
|
|
84
|
+
- [deAPI Documentation](https://docs.deapi.ai/)
|
|
85
|
+
- [deAPI Website](https://deapi.ai/)
|
|
86
|
+
- [GitHub Repository](https://github.com/deapi-ai/n8n-nodes-deapi)
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, Icon, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class DeApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
icon: Icon;
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
authenticate: IAuthenticateGeneric;
|
|
9
|
+
test: ICredentialTestRequest;
|
|
10
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeApi = void 0;
|
|
4
|
+
class DeApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'deApi';
|
|
7
|
+
this.displayName = 'deAPI API';
|
|
8
|
+
this.documentationUrl = 'https://docs.deapi.ai/quickstart';
|
|
9
|
+
this.icon = 'file:deapi.svg';
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'API Key',
|
|
13
|
+
name: 'apiKey',
|
|
14
|
+
type: 'string',
|
|
15
|
+
typeOptions: { password: true },
|
|
16
|
+
required: true,
|
|
17
|
+
default: '',
|
|
18
|
+
description: '<a href="https://docs.deapi.ai/quickstart#2-obtain-your-api-key" target="_blank">Get your API key</a>',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
displayName: 'Webhook Secret',
|
|
22
|
+
name: 'webhookSecret',
|
|
23
|
+
type: 'string',
|
|
24
|
+
typeOptions: { password: true },
|
|
25
|
+
required: true,
|
|
26
|
+
default: '',
|
|
27
|
+
description: 'Secret to verify signature from deAPI webhooks. <a href="https://deapi.ai/settings/webhooks" target="_blank">Get your webhook secret</a>',
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
this.authenticate = {
|
|
31
|
+
type: 'generic',
|
|
32
|
+
properties: {
|
|
33
|
+
headers: {
|
|
34
|
+
Authorization: '=Bearer {{$credentials.apiKey}}',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
this.test = {
|
|
39
|
+
request: {
|
|
40
|
+
baseURL: 'https://api.deapi.ai/api/v1/client',
|
|
41
|
+
url: '/models?per_page=15&page=1',
|
|
42
|
+
headers: {
|
|
43
|
+
Accept: 'application/json',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.DeApi = DeApi;
|
|
50
|
+
//# sourceMappingURL=DeApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeApi.credentials.js","sourceRoot":"","sources":["../../credentials/DeApi.credentials.ts"],"names":[],"mappings":";;;AAQA,MAAa,KAAK;IAAlB;QACC,SAAI,GAAG,OAAO,CAAC;QAEf,gBAAW,GAAG,WAAW,CAAC;QAE1B,qBAAgB,GAAG,kCAAkC,CAAC;QAEtD,SAAI,GAAS,gBAAgB,CAAC;QAE9B,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EACV,uGAAuG;aACxG;YACD;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EACV,0IAA0I;aAC3I;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,iCAAiC;iBAChD;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,oCAAoC;gBAC7C,GAAG,EAAE,4BAA4B;gBACjC,OAAO,EAAE;oBACR,MAAM,EAAE,kBAAkB;iBAC1B;aACD;SACD,CAAC;IACH,CAAC;CAAA;AAlDD,sBAkDC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_1045_7168)">
|
|
3
|
+
<path d="M53.8009 0H10.1991C4.5663 0 0 4.5663 0 10.1991V53.8009C0 59.4337 4.5663 64 10.1991 64H53.8009C59.4337 64 64 59.4337 64 53.8009V10.1991C64 4.5663 59.4337 0 53.8009 0Z" fill="#18181B"/>
|
|
4
|
+
<g clip-path="url(#clip1_1045_7168)">
|
|
5
|
+
<path d="M47.3118 49.2985L49.2089 47.4014V42.4785H55.8695V38.6843H49.2089V33.898H55.8695V30.1038H49.2089V25.3175H55.8695V21.5233H49.2089V16.6004L47.3118 14.7033H42.3889V10.3856L38.5947 8.19445V14.7014H33.8084V5.43041L33.3341 5.15723H30.4885L30.0143 5.43041V14.7014H25.2279V8.19445L21.4338 10.3856V14.7033H16.5108L14.6138 16.6004V21.5233H7.95312V25.3175H14.6138V30.1038H7.95312V33.898H14.6138V38.6843H7.95312V42.4785H14.6138V47.4014L16.5108 49.2985H21.4338V53.6143L25.2279 55.8054V49.2985H30.0143V58.5695L30.4885 58.8427H33.3341L33.8084 58.5695V49.2985H38.5947V55.8054L42.3889 53.6143V49.2985H47.3118ZM18.4079 45.5043V18.4956H45.4147V45.5024L18.4079 45.5043ZM37.5741 21.4797H42.3548L26.241 42.5183H21.4603L37.5741 21.4797Z" fill="#FFBA00"/>
|
|
6
|
+
</g>
|
|
7
|
+
</g>
|
|
8
|
+
<defs>
|
|
9
|
+
<clipPath id="clip0_1045_7168">
|
|
10
|
+
<rect width="64" height="64" fill="white"/>
|
|
11
|
+
</clipPath>
|
|
12
|
+
<clipPath id="clip1_1045_7168">
|
|
13
|
+
<rect width="47.9164" height="53.6854" fill="white" transform="translate(7.95312 5.15723)"/>
|
|
14
|
+
</clipPath>
|
|
15
|
+
</defs>
|
|
16
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeType, INodeTypeDescription, IWebhookFunctions, IWebhookResponseData, INodeExecutionData } from 'n8n-workflow';
|
|
2
|
+
export declare class Deapi implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Deapi = void 0;
|
|
37
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
38
|
+
const image = __importStar(require("./actions/image"));
|
|
39
|
+
const video = __importStar(require("./actions/video"));
|
|
40
|
+
const audio = __importStar(require("./actions/audio"));
|
|
41
|
+
const prompt = __importStar(require("./actions/prompt"));
|
|
42
|
+
const router_1 = require("./actions/router");
|
|
43
|
+
const webhook_verification_1 = require("./helpers/webhook-verification");
|
|
44
|
+
const binary_data_1 = require("./helpers/binary-data");
|
|
45
|
+
class Deapi {
|
|
46
|
+
constructor() {
|
|
47
|
+
this.description = {
|
|
48
|
+
displayName: 'deAPI',
|
|
49
|
+
name: 'deapi',
|
|
50
|
+
icon: 'file:deapi.svg',
|
|
51
|
+
group: ['transform'],
|
|
52
|
+
version: 1,
|
|
53
|
+
subtitle: '={{ $parameter["resource"] + ": " + $parameter["operation"] }}',
|
|
54
|
+
description: 'Generate images, videos, transcribe audio and boost prompts using deAPI AI models',
|
|
55
|
+
defaults: {
|
|
56
|
+
name: 'deAPI',
|
|
57
|
+
},
|
|
58
|
+
usableAsTool: true,
|
|
59
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
60
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
61
|
+
credentials: [
|
|
62
|
+
{
|
|
63
|
+
name: 'deApi',
|
|
64
|
+
required: true,
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
webhooks: [
|
|
68
|
+
{
|
|
69
|
+
name: 'default',
|
|
70
|
+
httpMethod: 'POST',
|
|
71
|
+
responseMode: 'onReceived',
|
|
72
|
+
path: '',
|
|
73
|
+
restartWebhook: true,
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
properties: [
|
|
77
|
+
{
|
|
78
|
+
displayName: 'Resource',
|
|
79
|
+
name: 'resource',
|
|
80
|
+
type: 'options',
|
|
81
|
+
noDataExpression: true,
|
|
82
|
+
options: [
|
|
83
|
+
{
|
|
84
|
+
name: 'Image',
|
|
85
|
+
value: 'image',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'Video',
|
|
89
|
+
value: 'video',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'Audio',
|
|
93
|
+
value: 'audio',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'Prompt',
|
|
97
|
+
value: 'prompt',
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
default: 'image',
|
|
101
|
+
},
|
|
102
|
+
...image.description,
|
|
103
|
+
...video.description,
|
|
104
|
+
...audio.description,
|
|
105
|
+
...prompt.description,
|
|
106
|
+
],
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
async execute() {
|
|
110
|
+
return await router_1.router.call(this);
|
|
111
|
+
}
|
|
112
|
+
async webhook() {
|
|
113
|
+
const res = this.getResponseObject();
|
|
114
|
+
const credentials = await this.getCredentials('deApi');
|
|
115
|
+
const secret = credentials.webhookSecret;
|
|
116
|
+
const headers = this.getHeaderData();
|
|
117
|
+
const signature = headers['x-deapi-signature'];
|
|
118
|
+
const timestamp = headers['x-deapi-timestamp'];
|
|
119
|
+
const req = this.getRequestObject();
|
|
120
|
+
const rawBody = req.rawBody;
|
|
121
|
+
const body = req.body;
|
|
122
|
+
if (!(0, webhook_verification_1.verifyWebhookSignature)(secret, signature, timestamp, rawBody)) {
|
|
123
|
+
res.status(401).send('Invalid signature');
|
|
124
|
+
return {
|
|
125
|
+
noWebhookResponse: true,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
const event = body.event;
|
|
129
|
+
if (event === 'job.processing') {
|
|
130
|
+
res.status(200).send('OK');
|
|
131
|
+
return {
|
|
132
|
+
noWebhookResponse: true,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
if (event === 'job.completed') {
|
|
136
|
+
const data = body.data;
|
|
137
|
+
const resultUrl = data.result_url;
|
|
138
|
+
if (resultUrl) {
|
|
139
|
+
const binaryData = await (0, binary_data_1.downloadAndPrepareBinaryData)(this, resultUrl);
|
|
140
|
+
const response = {
|
|
141
|
+
json: data,
|
|
142
|
+
binary: {
|
|
143
|
+
data: binaryData,
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
return {
|
|
147
|
+
workflowData: [[response]],
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
const response = {
|
|
151
|
+
json: body,
|
|
152
|
+
};
|
|
153
|
+
return {
|
|
154
|
+
workflowData: [[response]],
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
const response = {
|
|
158
|
+
json: body,
|
|
159
|
+
};
|
|
160
|
+
return {
|
|
161
|
+
workflowData: [[response]],
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
exports.Deapi = Deapi;
|
|
166
|
+
//# sourceMappingURL=Deapi.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Deapi.node.js","sourceRoot":"","sources":["../../../nodes/Deapi/Deapi.node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,+CAAmD;AAEnD,uDAAyC;AACzC,uDAAyC;AACzC,uDAAyC;AACzC,yDAA2C;AAC3C,6CAA0C;AAC1C,yEAAwE;AACxE,uDAAqE;AAErE,MAAa,KAAK;IAAlB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,OAAO;YACpB,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,gBAAgB;YACtB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,gEAAgE;YAC1E,WAAW,EACV,mFAAmF;YACpF,QAAQ,EAAE;gBACT,IAAI,EAAE,OAAO;aACb;YACD,YAAY,EAAE,IAAI;YAClB,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,OAAO;oBACb,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,QAAQ,EAAE;gBACT;oBACC,IAAI,EAAE,SAAS;oBACf,UAAU,EAAE,MAAM;oBAClB,YAAY,EAAE,YAAY;oBAC1B,IAAI,EAAE,EAAE;oBACR,cAAc,EAAE,IAAI;iBACpB;aACD;YACD,UAAU,EAA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
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-deapi",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["AI"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://github.com/deapi-ai/n8n-nodes-deapi?tab=readme-ov-file#credentials"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "https://github.com/deapi-ai/n8n-nodes-deapi?tab=readme-ov-file"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IHookFunctions, INodeType, INodeTypeDescription, IWebhookFunctions, IWebhookResponseData } from 'n8n-workflow';
|
|
2
|
+
export declare class DeapiTrigger implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
webhookMethods: {
|
|
5
|
+
default: {
|
|
6
|
+
checkExists(this: IHookFunctions): Promise<boolean>;
|
|
7
|
+
create(this: IHookFunctions): Promise<boolean>;
|
|
8
|
+
delete(this: IHookFunctions): Promise<boolean>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeapiTrigger = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const webhook_verification_1 = require("./helpers/webhook-verification");
|
|
6
|
+
const binary_data_1 = require("./helpers/binary-data");
|
|
7
|
+
class DeapiTrigger {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.description = {
|
|
10
|
+
displayName: 'deAPI Trigger',
|
|
11
|
+
name: 'deapiTrigger',
|
|
12
|
+
icon: 'file:deapi.svg',
|
|
13
|
+
group: ['trigger'],
|
|
14
|
+
version: 1,
|
|
15
|
+
description: 'Triggers workflows based on the status of the generation job from deAPI.',
|
|
16
|
+
subtitle: 'deAPI Trigger',
|
|
17
|
+
defaults: {
|
|
18
|
+
name: 'deAPI Trigger',
|
|
19
|
+
},
|
|
20
|
+
usableAsTool: true,
|
|
21
|
+
credentials: [
|
|
22
|
+
{
|
|
23
|
+
name: 'deApi',
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
inputs: [],
|
|
28
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
29
|
+
webhooks: [
|
|
30
|
+
{
|
|
31
|
+
name: 'default',
|
|
32
|
+
httpMethod: 'POST',
|
|
33
|
+
responseMode: 'onReceived',
|
|
34
|
+
path: 'deapi',
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
properties: [
|
|
38
|
+
{
|
|
39
|
+
displayName: 'Trigger On',
|
|
40
|
+
name: 'events',
|
|
41
|
+
type: 'multiOptions',
|
|
42
|
+
description: 'Select the events to trigger the workflow',
|
|
43
|
+
required: true,
|
|
44
|
+
default: ['jobCompleted'],
|
|
45
|
+
options: [
|
|
46
|
+
{
|
|
47
|
+
name: 'Job Processing',
|
|
48
|
+
value: 'jobProcessing',
|
|
49
|
+
description: 'A job starts processing',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'Job Completed',
|
|
53
|
+
value: 'jobCompleted',
|
|
54
|
+
description: 'A job completes successfully',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'Job Failed',
|
|
58
|
+
value: 'jobFailed',
|
|
59
|
+
description: 'A job fails',
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
displayName: 'Download Binary Result',
|
|
65
|
+
name: 'downloadBinary',
|
|
66
|
+
type: 'boolean',
|
|
67
|
+
default: true,
|
|
68
|
+
description: 'Whether to download the binary file from result_url when job completes',
|
|
69
|
+
displayOptions: {
|
|
70
|
+
show: {
|
|
71
|
+
events: ['jobCompleted'],
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
};
|
|
77
|
+
this.webhookMethods = {
|
|
78
|
+
default: {
|
|
79
|
+
async checkExists() {
|
|
80
|
+
return false;
|
|
81
|
+
},
|
|
82
|
+
async create() {
|
|
83
|
+
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
84
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
85
|
+
webhookData.webhookUrl = webhookUrl;
|
|
86
|
+
this.logger.info(`[deAPI] Configure this webhook URL in your deAPI dashboard: ${webhookUrl}`);
|
|
87
|
+
this.logger.info(`[deAPI] Visit: https://deapi.ai/settings/webhooks`);
|
|
88
|
+
return true;
|
|
89
|
+
},
|
|
90
|
+
async delete() {
|
|
91
|
+
return true;
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
async webhook() {
|
|
97
|
+
const res = this.getResponseObject();
|
|
98
|
+
const credentials = await this.getCredentials('deApi');
|
|
99
|
+
const secret = credentials.webhookSecret;
|
|
100
|
+
const headers = this.getHeaderData();
|
|
101
|
+
const signature = headers['x-deapi-signature'];
|
|
102
|
+
const timestamp = headers['x-deapi-timestamp'];
|
|
103
|
+
const req = this.getRequestObject();
|
|
104
|
+
const rawBody = req.rawBody;
|
|
105
|
+
const body = req.body;
|
|
106
|
+
if (!(0, webhook_verification_1.verifyWebhookSignature)(secret, signature, timestamp, rawBody)) {
|
|
107
|
+
res.status(401).send('Invalid signature');
|
|
108
|
+
return {
|
|
109
|
+
noWebhookResponse: true,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
const event = body.event;
|
|
113
|
+
const eventMap = {
|
|
114
|
+
'job.processing': 'jobProcessing',
|
|
115
|
+
'job.completed': 'jobCompleted',
|
|
116
|
+
'job.failed': 'jobFailed',
|
|
117
|
+
};
|
|
118
|
+
const selectedEvents = this.getNodeParameter('events');
|
|
119
|
+
const mappedEvent = eventMap[event];
|
|
120
|
+
if (!mappedEvent || !selectedEvents.includes(mappedEvent)) {
|
|
121
|
+
res.status(200).send('OK');
|
|
122
|
+
return {
|
|
123
|
+
noWebhookResponse: true,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
if (event === 'job.completed') {
|
|
127
|
+
const downloadBinary = this.getNodeParameter('downloadBinary');
|
|
128
|
+
if (downloadBinary) {
|
|
129
|
+
const data = body.data;
|
|
130
|
+
const resultUrl = data.result_url;
|
|
131
|
+
if (resultUrl) {
|
|
132
|
+
const binaryData = await (0, binary_data_1.downloadAndPrepareBinaryData)(this, resultUrl);
|
|
133
|
+
return {
|
|
134
|
+
workflowData: [
|
|
135
|
+
[
|
|
136
|
+
{
|
|
137
|
+
json: data,
|
|
138
|
+
binary: {
|
|
139
|
+
data: binaryData,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
],
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
workflowData: [this.helpers.returnJsonArray(body)],
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
exports.DeapiTrigger = DeapiTrigger;
|
|
154
|
+
//# sourceMappingURL=DeapiTrigger.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeapiTrigger.node.js","sourceRoot":"","sources":["../../../nodes/Deapi/DeapiTrigger.node.ts"],"names":[],"mappings":";;;AAQA,+CAAmD;AAEnD,yEAAwE;AACxE,uDAAqE;AAErE,MAAa,YAAY;IAAzB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,eAAe;YAC5B,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,gBAAgB;YACtB,KAAK,EAAE,CAAC,SAAS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ACH,CAAC;CACD;AAtLD,oCAsLC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-deapi-trigger",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["AI"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://github.com/deapi-ai/n8n-nodes-deapi?tab=readme-ov-file#credentials"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "https://github.com/deapi-ai/n8n-nodes-deapi?tab=readme-ov-file"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.description = exports.transcribe = void 0;
|
|
37
|
+
const transcribe = __importStar(require("./transcribe.operation"));
|
|
38
|
+
exports.transcribe = transcribe;
|
|
39
|
+
exports.description = [
|
|
40
|
+
{
|
|
41
|
+
displayName: 'Operation',
|
|
42
|
+
name: 'operation',
|
|
43
|
+
type: 'options',
|
|
44
|
+
noDataExpression: true,
|
|
45
|
+
options: [
|
|
46
|
+
{
|
|
47
|
+
name: 'Transcribe an Audio',
|
|
48
|
+
value: 'transcribe',
|
|
49
|
+
action: 'Transcribe an audio',
|
|
50
|
+
description: 'Transcribes an audio file to text',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
default: 'transcribe',
|
|
54
|
+
displayOptions: {
|
|
55
|
+
show: {
|
|
56
|
+
resource: ['audio'],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
...transcribe.description,
|
|
61
|
+
];
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Deapi/actions/audio/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,mEAAqD;AAE5C,gCAAU;AAEN,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,qBAAqB;gBAC3B,KAAK,EAAE,YAAY;gBACnB,MAAM,EAAE,qBAAqB;gBAC7B,WAAW,EAAE,mCAAmC;aAChD;SACD;QACD,OAAO,EAAE,YAAY;QACrB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,OAAO,CAAC;aACnB;SACD;KACD;IACD,GAAG,UAAU,CAAC,WAAW;CACzB,CAAC"}
|