n8n-nodes-ldxhub 0.1.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/LICENSE +21 -0
- package/README.md +55 -0
- package/dist/credentials/LdxHubApi.credentials.d.ts +10 -0
- package/dist/credentials/LdxHubApi.credentials.js +39 -0
- package/dist/credentials/LdxHubApi.credentials.js.map +1 -0
- package/dist/credentials/ldxhub.svg +1 -0
- package/dist/nodes/LdxHub/LdxHub.node.d.ts +11 -0
- package/dist/nodes/LdxHub/LdxHub.node.js +71 -0
- package/dist/nodes/LdxHub/LdxHub.node.js.map +1 -0
- package/dist/nodes/LdxHub/ldxhub.svg +1 -0
- package/dist/nodes/LdxHub/methods/loadOptions/getModels.d.ts +2 -0
- package/dist/nodes/LdxHub/methods/loadOptions/getModels.js +18 -0
- package/dist/nodes/LdxHub/methods/loadOptions/getModels.js.map +1 -0
- package/dist/nodes/LdxHub/resources/refineLoop/index.d.ts +2 -0
- package/dist/nodes/LdxHub/resources/refineLoop/index.js +29 -0
- package/dist/nodes/LdxHub/resources/refineLoop/index.js.map +1 -0
- package/dist/nodes/LdxHub/resources/refineLoop/runJob.d.ts +2 -0
- package/dist/nodes/LdxHub/resources/refineLoop/runJob.execute.d.ts +2 -0
- package/dist/nodes/LdxHub/resources/refineLoop/runJob.execute.js +94 -0
- package/dist/nodes/LdxHub/resources/refineLoop/runJob.execute.js.map +1 -0
- package/dist/nodes/LdxHub/resources/refineLoop/runJob.js +136 -0
- package/dist/nodes/LdxHub/resources/refineLoop/runJob.js.map +1 -0
- package/dist/nodes/LdxHub/shared/files.d.ts +17 -0
- package/dist/nodes/LdxHub/shared/files.js +69 -0
- package/dist/nodes/LdxHub/shared/files.js.map +1 -0
- package/dist/nodes/LdxHub/shared/polling.d.ts +20 -0
- package/dist/nodes/LdxHub/shared/polling.js +27 -0
- package/dist/nodes/LdxHub/shared/polling.js.map +1 -0
- package/dist/nodes/LdxHub/shared/transport.d.ts +3 -0
- package/dist/nodes/LdxHub/shared/transport.js +16 -0
- package/dist/nodes/LdxHub/shared/transport.js.map +1 -0
- package/dist/package.json +69 -0
- package/package.json +69 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ldxhub-io
|
|
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,55 @@
|
|
|
1
|
+
# n8n-nodes-ldxhub
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/n8n-nodes-ldxhub)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
n8n community node for **LDX hub** — AI-powered XLIFF translation refinement using the RefineLoop API.
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- **RefineLoop**: Iteratively improve XLIFF translation quality using frontier AI models (Google Gemini, Anthropic Claude, OpenAI GPT, and more)
|
|
11
|
+
- HTTP long-polling architecture — compatible with n8n Cloud execution model
|
|
12
|
+
- Proven at scale: tested with 1.19M-character academic papers
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
In your n8n instance:
|
|
17
|
+
|
|
18
|
+
1. Go to **Settings** → **Community Nodes**
|
|
19
|
+
2. Click **Install**
|
|
20
|
+
3. Enter `n8n-nodes-ldxhub` and confirm
|
|
21
|
+
|
|
22
|
+
## Prerequisites
|
|
23
|
+
|
|
24
|
+
- An [LDX hub](https://ldxlab.io/ldxhub) account and API key — [sign up here](https://gw.portal.ldxhub.io/signup)
|
|
25
|
+
- n8n version supporting community nodes (v1.x+)
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
1. Add **LDXhub API** credentials (API key from your LDX hub dashboard)
|
|
30
|
+
2. Add the **LDXhub** node to your workflow
|
|
31
|
+
3. Select **RefineLoop** resource and **Run Refinement Job** operation
|
|
32
|
+
4. Provide an XLIFF file via binary input, choose an AI model, and set max revisions
|
|
33
|
+
|
|
34
|
+
Documentation: https://gw.portal.ldxhub.io/introduction
|
|
35
|
+
|
|
36
|
+
## Polling Settings
|
|
37
|
+
|
|
38
|
+
For large documents, jobs may take several minutes. The node polls until completion:
|
|
39
|
+
|
|
40
|
+
| Setting | Default | Description |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| Max Polling Attempts | 180 | Maximum number of poll requests |
|
|
43
|
+
| Server Wait Seconds | 10 | Server-side long-poll wait per request |
|
|
44
|
+
|
|
45
|
+
Theoretical max wait = `Max Polling Attempts × Server Wait Seconds` seconds.
|
|
46
|
+
Defaults give 30 minutes. For longer documents, increase Max Polling Attempts
|
|
47
|
+
(e.g., 360 for 60 minutes).
|
|
48
|
+
|
|
49
|
+
> **n8n Cloud users**: your plan's workflow execution timeout applies independently. Check your plan's limits.
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
[MIT](LICENSE)
|
|
54
|
+
|
|
55
|
+
Copyright (c) 2026 Kawamura International Co., Ltd.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, Icon, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class LdxHubApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
icon: Icon;
|
|
6
|
+
documentationUrl: string;
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
authenticate: IAuthenticateGeneric;
|
|
9
|
+
test: ICredentialTestRequest;
|
|
10
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LdxHubApi = void 0;
|
|
4
|
+
class LdxHubApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'ldxHubApi';
|
|
7
|
+
this.displayName = 'LDXhub API';
|
|
8
|
+
this.icon = 'file:ldxhub.svg';
|
|
9
|
+
this.documentationUrl = 'https://gw.portal.ldxhub.io/introduction';
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'API Key',
|
|
13
|
+
name: 'apiKey',
|
|
14
|
+
type: 'string',
|
|
15
|
+
typeOptions: { password: true },
|
|
16
|
+
default: '',
|
|
17
|
+
required: true,
|
|
18
|
+
description: 'Issued from the LDXhub console',
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
this.authenticate = {
|
|
22
|
+
type: 'generic',
|
|
23
|
+
properties: {
|
|
24
|
+
headers: {
|
|
25
|
+
Authorization: '=Bearer {{$credentials?.apiKey}}',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
this.test = {
|
|
30
|
+
request: {
|
|
31
|
+
baseURL: 'https://gw.ldxhub.io',
|
|
32
|
+
url: '/refineloop/models',
|
|
33
|
+
method: 'GET',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.LdxHubApi = LdxHubApi;
|
|
39
|
+
//# sourceMappingURL=LdxHubApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LdxHubApi.credentials.js","sourceRoot":"","sources":["../../credentials/LdxHubApi.credentials.ts"],"names":[],"mappings":";;;AAQA,MAAa,SAAS;IAAtB;QACC,SAAI,GAAG,WAAW,CAAC;QAEnB,gBAAW,GAAG,YAAY,CAAC;QAE3B,SAAI,GAAS,iBAAiB,CAAC;QAE/B,qBAAgB,GAAG,0CAA0C,CAAC;QAE9D,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,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,gCAAgC;aAC7C;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,kCAAkC;iBACjD;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,sBAAsB;gBAC/B,GAAG,EAAE,oBAAoB;gBACzB,MAAM,EAAE,KAAK;aACb;SACD,CAAC;IACH,CAAC;CAAA;AArCD,8BAqCC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="300" height="300" viewBox="0 0 300 300"><path fill="#fff" d="M0 0h300v300H0z"/><svg width="280" height="125" x="10" y="15" overflow="hidden" viewBox="30 485 280 125"><defs><path id="c" d="M37.14-109.969v65.813q-.001 16.03 11.516 16.031 4.923.001 8.344-3.344 3.422-3.34 3.422-8.093 0-4.905-3.219-8.25-3.221-3.342-7.89-3.344-3.315.001-7.579 2.89v-33.187q5.31-.482 8.063-.484 16.997.001 29.125 12.25 12.124 12.251 12.125 29.484 0 17.642-12.328 29.734Q66.389 1.611 48.422 1.61c-6.024 0-11.89-1.312-17.61-3.937q-8.578-3.95-14.14-10.64-9.656-11.608-9.656-30.048v-66.953Zm0 0"/><path id="a" d="M38.906-109.969v33.594q7.654-5.561 15.313-5.562 11.608 0 18.406 8.39 6.812 8.377 6.813 22.625V0H49.311v-42.453c0-3.438-.367-5.742-1.093-6.922q-1.094-1.78-4.235-1.781-5.079.001-5.078 7.484V0H8.781v-109.969Zm0 0"/><path id="b" d="M8.781-79.203h30.125v45.36q-.001 6.86 5.735 6.859c3.757 0 5.64-2.286 5.64-6.86v-45.36h30.125v44.798q-.001 15.644-10.39 26.39-10.393 10.751-25.47 10.75c-11.437 0-20.648-4.16-27.624-12.484-5.43-6.5-8.14-15.52-8.14-27.062Zm0 0"/></defs><path fill="none" stroke="#9b9ca0" stroke-miterlimit="10" stroke-width="6.7" d="M397.953 235.469V207.41h-1.55q-6.2.001-8.45-2.09-2.245-2.091-2.246-9.07v-57.969h-28.984v62.465c0 10.852 2.968 19.352 8.914 25.5q8.911 9.223 24.566 9.223Zm5.735 5.734h-13.485q-18.447 0-28.832-10.695c-6.922-7.133-10.383-17.051-10.383-29.762v-68.2h40.453v63.704q.002 3.566 1.086 4.496t3.875.93h7.286Zm0 0"/><path fill="none" stroke="#ea962a" stroke-miterlimit="10" stroke-width="6.7" d="M456.3 201.523h2.173q19.682-.001 19.683-15.347 0-14.1-19.219-14.102h-4.03v27.899c0 .722.1 1.16.312 1.316q.306.234 1.082.234Zm-2.476 34.254c5.27.207 8.16.309 8.68.309q22.471 0 36.734-13.95c9.504-9.3 14.258-21.284 14.258-35.96q0-21.856-14.8-34.875-14.808-13.02-40.688-13.02h-37.664v97.188h28.828v-69.133h9.765c16.637 0 24.954 6.617 24.954 19.84q0 21.081-25.418 21.082h-4.649Zm-7.285 5.426h-31.934V132.547h43.403c19.012 0 33.969 4.86 44.87 14.57q16.353 14.573 16.352 39.059 0 24.49-15.886 40.07-15.89 15.576-40.84 15.578-4.653 0-9.844-.312c-3.46-.207-5.504-.309-6.12-.309Zm0 0"/><path fill="none" stroke="#9b9ca0" stroke-miterlimit="10" stroke-width="6.7" d="m600.918 235.469-26.195-49.91 25.261-47.278h-29.449l-9.144 22.164-11.313-22.164h-30.07l25.265 48.051-26.66 49.137h29.914l10.075-23.563 11.933 23.563Zm9.453 5.734h-43.398l-7.907-15.656-6.664 15.656h-43.554l29.914-55.027-28.211-53.63h43.09l7.285 14.263 5.734-14.262h42.938l-28.368 53.012Zm0 0"/><path fill="none" stroke="#9b9ca0" stroke-miterlimit="10" stroke-width="2.68" d="M369.984 357.895v-11.223h-.62q-2.481.001-3.38-.836c-.597-.559-.898-1.766-.898-3.629V319.02h-11.594v24.988q0 6.509 3.567 10.199 3.561 3.687 9.824 3.688Zm2.293 2.293h-5.394q-7.377 0-11.531-4.278t-4.153-11.902v-27.281h16.18v25.48c0 .953.144 1.55.433 1.8.29.247.81.372 1.551.372h2.914Zm0 0"/><path fill="none" stroke="#ea962a" stroke-miterlimit="10" stroke-width="2.68" d="M393.324 344.316h.867q7.875 0 7.875-6.136 0-5.644-7.687-5.645h-1.613v11.16c0 .29.039.465.125.528q.123.093.433.093Zm-.992 13.704q3.164.124 3.473.125c5.992 0 10.89-1.864 14.691-5.582q5.707-5.581 5.707-14.383-.001-8.743-5.922-13.95-5.924-5.209-16.277-5.21H378.94v38.875h11.532v-27.653h3.906q9.979 0 9.98 7.938 0 8.43-10.168 8.43h-1.859Zm-2.914 2.168h-12.773v-43.461h17.359q11.409-.001 17.95 5.828 6.543 5.828 6.542 15.625-.002 9.793-6.355 16.027-6.358 6.229-16.336 6.23-1.864 0-3.938-.125-2.08-.124-2.449-.125Zm0 0"/><path fill="none" stroke="#9b9ca0" stroke-miterlimit="10" stroke-width="2.68" d="m451.168 357.895-10.477-19.965 10.106-18.91h-11.781l-3.657 8.867-4.527-8.867h-12.027l10.105 19.222-10.664 19.653h11.969l4.027-9.422 4.774 9.422Zm3.785 2.293H437.59l-3.16-6.262-2.668 6.262H414.34l11.969-22.008-11.286-21.453h17.235l2.914 5.703 2.297-5.703h17.172l-11.344 21.203Zm0 0"/><path fill="none" stroke="#171112" stroke-miterlimit="10" stroke-width="6.7" d="M697.953 595.469V567.41h-1.55q-6.2.001-8.45-2.09-2.245-2.091-2.246-9.07v-57.969h-28.984v62.465c0 10.852 2.968 19.352 8.914 25.5q8.911 9.223 24.566 9.223Zm5.735 5.734h-13.485q-18.447 0-28.832-10.695c-6.922-7.133-10.383-17.051-10.383-29.762v-68.2h40.453v63.704q.002 3.567 1.086 4.496t3.875.93h7.285Zm52.612-39.68h2.173q19.682-.001 19.683-15.347 0-14.1-19.218-14.102h-4.032v27.899q-.002 1.082.313 1.316.306.234 1.082.234Zm-2.476 34.254c5.27.207 8.16.309 8.68.309q22.471 0 36.734-13.95 14.257-13.948 14.258-35.96 0-21.856-14.8-34.875-14.807-13.02-40.688-13.02h-37.664v97.188h28.828v-69.133h9.765c16.637 0 24.954 6.617 24.954 19.84q0 21.082-25.418 21.082h-4.649Zm-7.285 5.426h-31.934V492.547h43.403c19.012 0 33.969 4.86 44.87 14.57q16.353 14.573 16.352 39.059 0 24.49-15.886 40.07-15.89 15.576-40.84 15.578-4.653 0-9.844-.312c-3.46-.207-5.504-.309-6.12-.309Zm0 0"/><path fill="none" stroke="#171112" stroke-miterlimit="10" stroke-width="6.7" d="m900.918 595.469-26.195-49.91 25.261-47.278h-29.449l-9.144 22.164-11.313-22.164h-30.07l25.265 48.051-26.66 49.137h29.914l10.075-23.563 11.933 23.563Zm9.453 5.734h-43.398l-7.907-15.656-6.664 15.656h-43.554l29.914-55.027-28.211-53.63h43.09l7.285 14.263 5.734-14.262h42.938l-28.368 53.012Zm0 0"/><path fill="none" stroke="#3b3b3f" stroke-miterlimit="10" stroke-width="2.68" d="M669.984 717.895v-11.223h-.62q-2.481.001-3.38-.836c-.597-.559-.898-1.766-.898-3.629V679.02h-11.594v24.988q0 6.509 3.567 10.199 3.561 3.687 9.824 3.688Zm2.293 2.293h-5.394q-7.377 0-11.531-4.278t-4.153-11.902v-27.281h16.18v25.48c0 .953.144 1.55.433 1.8.29.247.81.372 1.551.372h2.914Zm21.047-15.872h.867q7.875 0 7.875-6.136 0-5.644-7.687-5.645h-1.613v11.16c0 .293.039.465.125.528q.123.093.433.093Zm-.992 13.704q3.164.124 3.473.125c5.992 0 10.89-1.864 14.691-5.582q5.707-5.581 5.707-14.383-.001-8.743-5.922-13.95-5.924-5.209-16.277-5.21H678.94v38.875h11.532v-27.653h3.906q9.979 0 9.98 7.938 0 8.43-10.168 8.43h-1.859Zm-2.914 2.168h-12.773v-43.461h17.359q11.409-.001 17.95 5.828 6.543 5.828 6.542 15.625-.002 9.793-6.355 16.027-6.358 6.229-16.336 6.23-1.863 0-3.938-.125-2.08-.124-2.449-.125Zm0 0"/><path fill="none" stroke="#3b3b3f" stroke-miterlimit="10" stroke-width="2.68" d="m751.168 717.895-10.477-19.965 10.106-18.91h-11.781l-3.657 8.867-4.527-8.867h-12.027l10.105 19.222-10.664 19.653h11.969l4.027-9.422 4.774 9.422Zm3.785 2.293H737.59l-3.16-6.262-2.668 6.261H714.34l11.969-22.007-11.286-21.453h17.235l2.914 5.703 2.297-5.703h17.172l-11.344 21.203Zm0 0"/><path fill="none" stroke="#191a2c" stroke-miterlimit="10" stroke-width="2.68" d="M672.176 818.617v-11.222h-.621q-2.478 0-3.38-.836-.897-.84-.898-3.63v-23.187h-11.593v24.985q-.001 6.514 3.566 10.199 3.563 3.69 9.828 3.691Zm2.293 2.293h-5.39q-7.383 0-11.536-4.277-4.154-4.278-4.152-11.906v-27.278h16.18v25.48q-.001 1.43.437 1.798.433.375 1.547.375h2.914Zm21.047-15.87h.867q7.875 0 7.875-6.142c0-3.757-2.563-5.64-7.688-5.64h-1.613v11.16q.001.434.125.527.123.094.434.094Zm-.993 13.702q3.164.122 3.473.121 8.988 0 14.695-5.578c3.801-3.722 5.704-8.515 5.704-14.387q0-8.738-5.922-13.949c-3.95-3.472-9.371-5.207-16.274-5.207h-15.066v38.875h11.531v-27.652h3.906q9.98 0 9.98 7.933 0 8.436-10.167 8.434h-1.86Zm-2.914 2.168h-12.77v-43.46h17.36c7.606 0 13.586 1.94 17.95 5.827 4.359 3.883 6.538 9.094 6.538 15.621q.001 9.798-6.355 16.028c-4.234 4.156-9.684 6.234-16.336 6.234-1.238 0-2.555-.043-3.937-.125-1.383-.086-2.2-.125-2.45-.125Zm0 0"/><path fill="none" stroke="#191a2c" stroke-miterlimit="10" stroke-width="2.68" d="m753.363 818.617-10.48-19.965 10.105-18.91h-11.777l-3.66 8.867-4.524-8.867h-12.03l10.108 19.219-10.664 19.656h11.965l4.032-9.426 4.773 9.426Zm3.782 2.293h-17.36l-3.164-6.262-2.664 6.262h-17.422l11.965-22.008-11.285-21.453h17.238l2.914 5.703 2.293-5.703h17.172l-11.344 21.203Zm0 0"/><path fill="none" stroke="#171112" stroke-miterlimit="10" stroke-width="6.7" d="M87.953 595.469V567.41h-1.55q-6.2.001-8.45-2.09-2.245-2.091-2.246-9.07v-57.969H46.723v62.465c0 10.852 2.968 19.352 8.914 25.5q8.911 9.223 24.566 9.223Zm5.734 5.734H80.204q-18.447 0-28.832-10.695c-6.922-7.133-10.383-17.051-10.383-29.762v-68.2h40.453v63.704q.002 3.567 1.086 4.496 1.086.93 3.875.93h7.285Zm52.613-39.68h2.173q19.681-.001 19.683-15.347 0-14.1-19.219-14.102h-4.03v27.899c0 .722.1 1.16.312 1.316q.306.234 1.082.234Zm-2.476 34.254c5.27.207 8.16.309 8.68.309q22.471 0 36.734-13.95 14.257-13.948 14.258-35.96 0-21.856-14.8-34.875-14.808-13.02-40.688-13.02h-37.664v97.188h28.828v-69.133h9.766c16.636 0 24.953 6.617 24.953 19.84q0 21.082-25.418 21.082h-4.649Zm-7.285 5.426h-31.934V492.547h43.403c19.012 0 33.969 4.86 44.87 14.57q16.353 14.573 16.352 39.059 0 24.49-15.886 40.07-15.89 15.576-40.84 15.578-4.653 0-9.844-.312c-3.46-.207-5.504-.309-6.12-.309Zm0 0"/><path fill="none" stroke="#171112" stroke-miterlimit="10" stroke-width="6.7" d="m290.918 595.469-26.195-49.91 25.261-47.278h-29.449l-9.144 22.164-11.313-22.164h-30.07l25.265 48.051-26.66 49.137h29.914l10.075-23.563 11.933 23.563Zm9.453 5.734h-43.398l-7.907-15.656-6.664 15.656h-43.554l29.914-55.027-28.211-53.63h43.09l7.285 14.263 5.734-14.262h42.938l-28.368 53.012Zm0 0"/><g fill="#171111"><use xlink:href="#a" x="302.303" y="605.203"/><use xlink:href="#b" x="382.328" y="605.203"/></g><use xlink:href="#c" x="463.26" y="605.203" fill="#171111"/><path fill="none" stroke="#3b3b3f" stroke-miterlimit="10" stroke-width="2.68" d="M59.984 717.895v-11.223h-.62q-2.481.001-3.38-.836c-.597-.559-.898-1.766-.898-3.629V679.02H43.492v24.988q0 6.509 3.567 10.199 3.561 3.687 9.824 3.688Zm2.293 2.293h-5.394q-7.377 0-11.531-4.278t-4.153-11.902v-27.281h16.18v25.48c0 .953.144 1.55.434 1.8q.435.371 1.55.372h2.914Zm21.047-15.872h.867q7.875 0 7.875-6.136 0-5.644-7.687-5.645h-1.613v11.16c0 .293.039.465.125.528q.123.093.433.093Zm-.992 13.704q3.164.124 3.473.125c5.992 0 10.89-1.864 14.691-5.582q5.707-5.581 5.707-14.383-.001-8.743-5.922-13.95-5.924-5.209-16.277-5.21H68.94v38.875h11.532v-27.653h3.906q9.979 0 9.98 7.938 0 8.43-10.168 8.43h-1.859Zm-2.914 2.168H66.645v-43.461h17.359q11.409-.001 17.95 5.828 6.542 5.828 6.542 15.625c0 6.53-2.121 11.87-6.355 16.027q-6.358 6.229-16.336 6.23-1.864 0-3.938-.125-2.08-.124-2.449-.125Zm0 0"/><path fill="none" stroke="#3b3b3f" stroke-miterlimit="10" stroke-width="2.68" d="m141.168 717.895-10.477-19.965 10.106-18.91h-11.781l-3.657 8.867-4.527-8.867h-12.027l10.105 19.222-10.664 19.653h11.969l4.027-9.422 4.774 9.422Zm3.785 2.293H127.59l-3.16-6.262-2.668 6.261H104.34l11.969-22.007-11.286-21.453h17.235l2.914 5.703 2.297-5.703h17.172l-11.344 21.203Zm0 0"/><path fill="none" stroke="#191a2c" stroke-miterlimit="10" stroke-width="2.68" d="M62.176 818.617v-11.222h-.621q-2.478 0-3.38-.836-.897-.84-.898-3.63v-23.187H45.684v24.985q-.001 6.514 3.566 10.199 3.563 3.69 9.828 3.691Zm2.293 2.293h-5.39q-7.383 0-11.536-4.277t-4.152-11.906v-27.278h16.18v25.48q-.001 1.43.437 1.798.433.375 1.547.375h2.914Zm21.047-15.87h.867q7.875 0 7.875-6.142c0-3.757-2.563-5.64-7.688-5.64h-1.613v11.16q.001.434.125.527.123.094.434.094Zm-.993 13.702q3.164.122 3.473.121 8.988 0 14.695-5.578c3.801-3.722 5.704-8.515 5.704-14.387q0-8.738-5.922-13.949c-3.95-3.472-9.371-5.207-16.274-5.207H71.133v38.875h11.531v-27.652h3.906q9.98 0 9.98 7.933 0 8.436-10.167 8.434h-1.86Zm-2.914 2.168H68.84v-43.46H86.2c7.606 0 13.586 1.94 17.95 5.827 4.359 3.883 6.538 9.094 6.538 15.621q.001 9.798-6.355 16.028c-4.234 4.156-9.684 6.234-16.336 6.234-1.238 0-2.555-.043-3.937-.125-1.383-.086-2.2-.125-2.45-.125Zm0 0"/><path fill="none" stroke="#191a2c" stroke-miterlimit="10" stroke-width="2.68" d="m143.363 818.617-10.48-19.965 10.105-18.91h-11.777l-3.66 8.867-4.524-8.867h-12.03l10.108 19.219-10.664 19.656h11.965l4.031-9.426 4.774 9.426Zm3.782 2.293h-17.36l-3.164-6.262-2.664 6.262h-17.422l11.965-22.008-11.285-21.453h17.238l2.914 5.703 2.293-5.703h17.172l-11.344 21.203Zm0 0"/></svg><svg width="255" height="125" x="22" y="160" overflow="hidden" viewBox="305 485 255 125"><path fill="none" stroke="#9b9ca0" stroke-miterlimit="10" stroke-width="6.7" d="M397.953 235.469V207.41h-1.55q-6.2.001-8.45-2.09-2.245-2.091-2.246-9.07v-57.969h-28.984v62.465c0 10.852 2.968 19.352 8.914 25.5q8.911 9.223 24.566 9.223Zm5.735 5.734h-13.485q-18.447 0-28.832-10.695c-6.922-7.133-10.383-17.051-10.383-29.762v-68.2h40.453v63.704q.002 3.566 1.086 4.496t3.875.93h7.286Zm0 0"/><path fill="none" stroke="#ea962a" stroke-miterlimit="10" stroke-width="6.7" d="M456.3 201.523h2.173q19.682-.001 19.683-15.347 0-14.1-19.219-14.102h-4.03v27.899c0 .722.1 1.16.312 1.316q.306.234 1.082.234Zm-2.476 34.254c5.27.207 8.16.309 8.68.309q22.471 0 36.734-13.95c9.504-9.3 14.258-21.284 14.258-35.96q0-21.856-14.8-34.875-14.808-13.02-40.688-13.02h-37.664v97.188h28.828v-69.133h9.765c16.637 0 24.954 6.617 24.954 19.84q0 21.081-25.418 21.082h-4.649Zm-7.285 5.426h-31.934V132.547h43.403c19.012 0 33.969 4.86 44.87 14.57q16.353 14.573 16.352 39.059 0 24.49-15.886 40.07-15.89 15.576-40.84 15.578-4.653 0-9.844-.312c-3.46-.207-5.504-.309-6.12-.309Zm0 0"/><path fill="none" stroke="#9b9ca0" stroke-miterlimit="10" stroke-width="6.7" d="m600.918 235.469-26.195-49.91 25.261-47.278h-29.449l-9.144 22.164-11.313-22.164h-30.07l25.265 48.051-26.66 49.137h29.914l10.075-23.563 11.933 23.563Zm9.453 5.734h-43.398l-7.907-15.656-6.664 15.656h-43.554l29.914-55.027-28.211-53.63h43.09l7.285 14.263 5.734-14.262h42.938l-28.368 53.012Zm0 0"/><path fill="none" stroke="#9b9ca0" stroke-miterlimit="10" stroke-width="2.68" d="M369.984 357.895v-11.223h-.62q-2.481.001-3.38-.836c-.597-.559-.898-1.766-.898-3.629V319.02h-11.594v24.988q0 6.509 3.567 10.199 3.561 3.687 9.824 3.688Zm2.293 2.293h-5.394q-7.377 0-11.531-4.278t-4.153-11.902v-27.281h16.18v25.48c0 .953.144 1.55.433 1.8.29.247.81.372 1.551.372h2.914Zm0 0"/><path fill="none" stroke="#ea962a" stroke-miterlimit="10" stroke-width="2.68" d="M393.324 344.316h.867q7.875 0 7.875-6.136 0-5.644-7.687-5.645h-1.613v11.16c0 .29.039.465.125.528q.123.093.433.093Zm-.992 13.704q3.164.124 3.473.125c5.992 0 10.89-1.864 14.691-5.582q5.707-5.581 5.707-14.383-.001-8.743-5.922-13.95-5.924-5.209-16.277-5.21H378.94v38.875h11.532v-27.653h3.906q9.979 0 9.98 7.938 0 8.43-10.168 8.43h-1.859Zm-2.914 2.168h-12.773v-43.461h17.359q11.409-.001 17.95 5.828 6.543 5.828 6.542 15.625-.002 9.793-6.355 16.027-6.358 6.229-16.336 6.23-1.864 0-3.938-.125-2.08-.124-2.449-.125Zm0 0"/><path fill="none" stroke="#9b9ca0" stroke-miterlimit="10" stroke-width="2.68" d="m451.168 357.895-10.477-19.965 10.106-18.91h-11.781l-3.657 8.867-4.527-8.867h-12.027l10.105 19.222-10.664 19.653h11.969l4.027-9.422 4.774 9.422Zm3.785 2.293H437.59l-3.16-6.262-2.668 6.262H414.34l11.969-22.008-11.286-21.453h17.235l2.914 5.703 2.297-5.703h17.172l-11.344 21.203Zm0 0"/><path fill="none" stroke="#171112" stroke-miterlimit="10" stroke-width="6.7" d="M697.953 595.469V567.41h-1.55q-6.2.001-8.45-2.09-2.245-2.091-2.246-9.07v-57.969h-28.984v62.465c0 10.852 2.968 19.352 8.914 25.5q8.911 9.223 24.566 9.223Zm5.735 5.734h-13.485q-18.447 0-28.832-10.695c-6.922-7.133-10.383-17.051-10.383-29.762v-68.2h40.453v63.704q.002 3.567 1.086 4.496t3.875.93h7.285Zm52.612-39.68h2.173q19.682-.001 19.683-15.347 0-14.1-19.218-14.102h-4.032v27.899q-.002 1.082.313 1.316.306.234 1.082.234Zm-2.476 34.254c5.27.207 8.16.309 8.68.309q22.471 0 36.734-13.95 14.257-13.948 14.258-35.96 0-21.856-14.8-34.875-14.807-13.02-40.688-13.02h-37.664v97.188h28.828v-69.133h9.765c16.637 0 24.954 6.617 24.954 19.84q0 21.082-25.418 21.082h-4.649Zm-7.285 5.426h-31.934V492.547h43.403c19.012 0 33.969 4.86 44.87 14.57q16.353 14.573 16.352 39.059 0 24.49-15.886 40.07-15.89 15.576-40.84 15.578-4.653 0-9.844-.312c-3.46-.207-5.504-.309-6.12-.309Zm0 0"/><path fill="none" stroke="#171112" stroke-miterlimit="10" stroke-width="6.7" d="m900.918 595.469-26.195-49.91 25.261-47.278h-29.449l-9.144 22.164-11.313-22.164h-30.07l25.265 48.051-26.66 49.137h29.914l10.075-23.563 11.933 23.563Zm9.453 5.734h-43.398l-7.907-15.656-6.664 15.656h-43.554l29.914-55.027-28.211-53.63h43.09l7.285 14.263 5.734-14.262h42.938l-28.368 53.012Zm0 0"/><path fill="none" stroke="#3b3b3f" stroke-miterlimit="10" stroke-width="2.68" d="M669.984 717.895v-11.223h-.62q-2.481.001-3.38-.836c-.597-.559-.898-1.766-.898-3.629V679.02h-11.594v24.988q0 6.509 3.567 10.199 3.561 3.687 9.824 3.688Zm2.293 2.293h-5.394q-7.377 0-11.531-4.278t-4.153-11.902v-27.281h16.18v25.48c0 .953.144 1.55.433 1.8.29.247.81.372 1.551.372h2.914Zm21.047-15.872h.867q7.875 0 7.875-6.136 0-5.644-7.687-5.645h-1.613v11.16c0 .293.039.465.125.528q.123.093.433.093Zm-.992 13.704q3.164.124 3.473.125c5.992 0 10.89-1.864 14.691-5.582q5.707-5.581 5.707-14.383-.001-8.743-5.922-13.95-5.924-5.209-16.277-5.21H678.94v38.875h11.532v-27.653h3.906q9.979 0 9.98 7.938 0 8.43-10.168 8.43h-1.859Zm-2.914 2.168h-12.773v-43.461h17.359q11.409-.001 17.95 5.828 6.543 5.828 6.542 15.625-.002 9.793-6.355 16.027-6.358 6.229-16.336 6.23-1.863 0-3.938-.125-2.08-.124-2.449-.125Zm0 0"/><path fill="none" stroke="#3b3b3f" stroke-miterlimit="10" stroke-width="2.68" d="m751.168 717.895-10.477-19.965 10.106-18.91h-11.781l-3.657 8.867-4.527-8.867h-12.027l10.105 19.222-10.664 19.653h11.969l4.027-9.422 4.774 9.422Zm3.785 2.293H737.59l-3.16-6.262-2.668 6.261H714.34l11.969-22.007-11.286-21.453h17.235l2.914 5.703 2.297-5.703h17.172l-11.344 21.203Zm0 0"/><path fill="none" stroke="#191a2c" stroke-miterlimit="10" stroke-width="2.68" d="M672.176 818.617v-11.222h-.621q-2.478 0-3.38-.836-.897-.84-.898-3.63v-23.187h-11.593v24.985q-.001 6.514 3.566 10.199 3.563 3.69 9.828 3.691Zm2.293 2.293h-5.39q-7.383 0-11.536-4.277-4.154-4.278-4.152-11.906v-27.278h16.18v25.48q-.001 1.43.437 1.798.433.375 1.547.375h2.914Zm21.047-15.87h.867q7.875 0 7.875-6.142c0-3.757-2.563-5.64-7.688-5.64h-1.613v11.16q.001.434.125.527.123.094.434.094Zm-.993 13.702q3.164.122 3.473.121 8.988 0 14.695-5.578c3.801-3.722 5.704-8.515 5.704-14.387q0-8.738-5.922-13.949c-3.95-3.472-9.371-5.207-16.274-5.207h-15.066v38.875h11.531v-27.652h3.906q9.98 0 9.98 7.933 0 8.436-10.167 8.434h-1.86Zm-2.914 2.168h-12.77v-43.46h17.36c7.606 0 13.586 1.94 17.95 5.827 4.359 3.883 6.538 9.094 6.538 15.621q.001 9.798-6.355 16.028c-4.234 4.156-9.684 6.234-16.336 6.234-1.238 0-2.555-.043-3.937-.125-1.383-.086-2.2-.125-2.45-.125Zm0 0"/><path fill="none" stroke="#191a2c" stroke-miterlimit="10" stroke-width="2.68" d="m753.363 818.617-10.48-19.965 10.105-18.91h-11.777l-3.66 8.867-4.524-8.867h-12.03l10.108 19.219-10.664 19.656h11.965l4.032-9.426 4.773 9.426Zm3.782 2.293h-17.36l-3.164-6.262-2.664 6.262h-17.422l11.965-22.008-11.285-21.453h17.238l2.914 5.703 2.293-5.703h17.172l-11.344 21.203Zm0 0"/><path fill="none" stroke="#171112" stroke-miterlimit="10" stroke-width="6.7" d="M87.953 595.469V567.41h-1.55q-6.2.001-8.45-2.09-2.245-2.091-2.246-9.07v-57.969H46.723v62.465c0 10.852 2.968 19.352 8.914 25.5q8.911 9.223 24.566 9.223Zm5.734 5.734H80.204q-18.447 0-28.832-10.695c-6.922-7.133-10.383-17.051-10.383-29.762v-68.2h40.453v63.704q.002 3.567 1.086 4.496 1.086.93 3.875.93h7.285Zm52.613-39.68h2.173q19.681-.001 19.683-15.347 0-14.1-19.219-14.102h-4.03v27.899c0 .722.1 1.16.312 1.316q.306.234 1.082.234Zm-2.476 34.254c5.27.207 8.16.309 8.68.309q22.471 0 36.734-13.95 14.257-13.948 14.258-35.96 0-21.856-14.8-34.875-14.808-13.02-40.688-13.02h-37.664v97.188h28.828v-69.133h9.766c16.636 0 24.953 6.617 24.953 19.84q0 21.082-25.418 21.082h-4.649Zm-7.285 5.426h-31.934V492.547h43.403c19.012 0 33.969 4.86 44.87 14.57q16.353 14.573 16.352 39.059 0 24.49-15.886 40.07-15.89 15.576-40.84 15.578-4.653 0-9.844-.312c-3.46-.207-5.504-.309-6.12-.309Zm0 0"/><path fill="none" stroke="#171112" stroke-miterlimit="10" stroke-width="6.7" d="m290.918 595.469-26.195-49.91 25.261-47.278h-29.449l-9.144 22.164-11.313-22.164h-30.07l25.265 48.051-26.66 49.137h29.914l10.075-23.563 11.933 23.563Zm9.453 5.734h-43.398l-7.907-15.656-6.664 15.656h-43.554l29.914-55.027-28.211-53.63h43.09l7.285 14.263 5.734-14.262h42.938l-28.368 53.012Zm0 0"/><g fill="#171111"><use xlink:href="#a" x="302.303" y="605.203"/><use xlink:href="#b" x="382.328" y="605.203"/></g><use xlink:href="#c" x="463.26" y="605.203" fill="#171111"/><path fill="none" stroke="#3b3b3f" stroke-miterlimit="10" stroke-width="2.68" d="M59.984 717.895v-11.223h-.62q-2.481.001-3.38-.836c-.597-.559-.898-1.766-.898-3.629V679.02H43.492v24.988q0 6.509 3.567 10.199 3.561 3.687 9.824 3.688Zm2.293 2.293h-5.394q-7.377 0-11.531-4.278t-4.153-11.902v-27.281h16.18v25.48c0 .953.144 1.55.434 1.8q.435.371 1.55.372h2.914Zm21.047-15.872h.867q7.875 0 7.875-6.136 0-5.644-7.687-5.645h-1.613v11.16c0 .293.039.465.125.528q.123.093.433.093Zm-.992 13.704q3.164.124 3.473.125c5.992 0 10.89-1.864 14.691-5.582q5.707-5.581 5.707-14.383-.001-8.743-5.922-13.95-5.924-5.209-16.277-5.21H68.94v38.875h11.532v-27.653h3.906q9.979 0 9.98 7.938 0 8.43-10.168 8.43h-1.859Zm-2.914 2.168H66.645v-43.461h17.359q11.409-.001 17.95 5.828 6.542 5.828 6.542 15.625c0 6.53-2.121 11.87-6.355 16.027q-6.358 6.229-16.336 6.23-1.864 0-3.938-.125-2.08-.124-2.449-.125Zm0 0"/><path fill="none" stroke="#3b3b3f" stroke-miterlimit="10" stroke-width="2.68" d="m141.168 717.895-10.477-19.965 10.106-18.91h-11.781l-3.657 8.867-4.527-8.867h-12.027l10.105 19.222-10.664 19.653h11.969l4.027-9.422 4.774 9.422Zm3.785 2.293H127.59l-3.16-6.262-2.668 6.261H104.34l11.969-22.007-11.286-21.453h17.235l2.914 5.703 2.297-5.703h17.172l-11.344 21.203Zm0 0"/><path fill="none" stroke="#191a2c" stroke-miterlimit="10" stroke-width="2.68" d="M62.176 818.617v-11.222h-.621q-2.478 0-3.38-.836-.897-.84-.898-3.63v-23.187H45.684v24.985q-.001 6.514 3.566 10.199 3.563 3.69 9.828 3.691Zm2.293 2.293h-5.39q-7.383 0-11.536-4.277t-4.152-11.906v-27.278h16.18v25.48q-.001 1.43.437 1.798.433.375 1.547.375h2.914Zm21.047-15.87h.867q7.875 0 7.875-6.142c0-3.757-2.563-5.64-7.688-5.64h-1.613v11.16q.001.434.125.527.123.094.434.094Zm-.993 13.702q3.164.122 3.473.121 8.988 0 14.695-5.578c3.801-3.722 5.704-8.515 5.704-14.387q0-8.738-5.922-13.949c-3.95-3.472-9.371-5.207-16.274-5.207H71.133v38.875h11.531v-27.652h3.906q9.98 0 9.98 7.933 0 8.436-10.167 8.434h-1.86Zm-2.914 2.168H68.84v-43.46H86.2c7.606 0 13.586 1.94 17.95 5.827 4.359 3.883 6.538 9.094 6.538 15.621q.001 9.798-6.355 16.028c-4.234 4.156-9.684 6.234-16.336 6.234-1.238 0-2.555-.043-3.937-.125-1.383-.086-2.2-.125-2.45-.125Zm0 0"/><path fill="none" stroke="#191a2c" stroke-miterlimit="10" stroke-width="2.68" d="m143.363 818.617-10.48-19.965 10.105-18.91h-11.777l-3.66 8.867-4.524-8.867h-12.03l10.108 19.219-10.664 19.656h11.965l4.031-9.426 4.774 9.426Zm3.782 2.293h-17.36l-3.164-6.262-2.664 6.262h-17.422l11.965-22.008-11.285-21.453h17.238l2.914 5.703 2.293-5.703h17.172l-11.344 21.203Zm0 0"/></svg></svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
import { getModels } from './methods/loadOptions/getModels';
|
|
3
|
+
export declare class LdxHub implements INodeType {
|
|
4
|
+
description: INodeTypeDescription;
|
|
5
|
+
methods: {
|
|
6
|
+
loadOptions: {
|
|
7
|
+
getModels: typeof getModels;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LdxHub = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const getModels_1 = require("./methods/loadOptions/getModels");
|
|
6
|
+
const refineLoop_1 = require("./resources/refineLoop");
|
|
7
|
+
const runJob_execute_1 = require("./resources/refineLoop/runJob.execute");
|
|
8
|
+
class LdxHub {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.description = {
|
|
11
|
+
displayName: 'LDXhub',
|
|
12
|
+
name: 'ldxHub',
|
|
13
|
+
icon: 'file:ldxhub.svg',
|
|
14
|
+
group: ['transform'],
|
|
15
|
+
version: 1,
|
|
16
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
17
|
+
description: 'Work with the LDXhub AI-powered document processing platform',
|
|
18
|
+
defaults: {
|
|
19
|
+
name: 'LDXhub',
|
|
20
|
+
},
|
|
21
|
+
usableAsTool: true,
|
|
22
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
23
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
24
|
+
credentials: [
|
|
25
|
+
{
|
|
26
|
+
name: 'ldxHubApi',
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
requestDefaults: {
|
|
31
|
+
baseURL: 'https://gw.ldxhub.io',
|
|
32
|
+
headers: {
|
|
33
|
+
Accept: 'application/json',
|
|
34
|
+
'Content-Type': 'application/json',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
properties: [
|
|
38
|
+
{
|
|
39
|
+
displayName: 'Resource',
|
|
40
|
+
name: 'resource',
|
|
41
|
+
type: 'options',
|
|
42
|
+
noDataExpression: true,
|
|
43
|
+
options: [
|
|
44
|
+
{
|
|
45
|
+
name: 'RefineLoop',
|
|
46
|
+
value: 'refineLoop',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
default: 'refineLoop',
|
|
50
|
+
},
|
|
51
|
+
...refineLoop_1.refineLoopDescription,
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
this.methods = {
|
|
55
|
+
loadOptions: {
|
|
56
|
+
getModels: getModels_1.getModels,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
async execute() {
|
|
61
|
+
const items = this.getInputData();
|
|
62
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
63
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
64
|
+
if (resource === 'refineLoop' && operation === 'runJob') {
|
|
65
|
+
return runJob_execute_1.runJobExecute.call(this, items);
|
|
66
|
+
}
|
|
67
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Operation "${resource}.${operation}" is not supported`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.LdxHub = LdxHub;
|
|
71
|
+
//# sourceMappingURL=LdxHub.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LdxHub.node.js","sourceRoot":"","sources":["../../../nodes/LdxHub/LdxHub.node.ts"],"names":[],"mappings":";;;AAMA,+CAAuE;AAEvE,+DAA4D;AAC5D,uDAA+D;AAC/D,0EAAsE;AAEtE,MAAa,MAAM;IAAnB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,QAAQ;YACrB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,iBAAiB;YACvB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,8DAA8D;YAC3E,QAAQ,EAAE;gBACT,IAAI,EAAE,QAAQ;aACd;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,WAAW;oBACjB,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,eAAe,EAAE;gBAChB,OAAO,EAAE,sBAAsB;gBAC/B,OAAO,EAAE;oBACR,MAAM,EAAE,kBAAkB;oBAC1B,cAAc,EAAE,kBAAkB;iBAClC;aACD;YACD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR;4BACC,IAAI,EAAE,YAAY;4BAClB,KAAK,EAAE,YAAY;yBACnB;qBACD;oBACD,OAAO,EAAE,YAAY;iBACrB;gBACD,GAAG,kCAAqB;aACxB;SACD,CAAC;QAEF,YAAO,GAAG;YACT,WAAW,EAAE;gBACZ,SAAS,EAAT,qBAAS;aACT;SACD,CAAC;IAgBH,CAAC;IAdA,KAAK,CAAC,OAAO;QACZ,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAClC,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC,CAAW,CAAC;QAChE,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAW,CAAC;QAElE,IAAI,QAAQ,KAAK,YAAY,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;YACzD,OAAO,8BAAa,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACxC,CAAC;QAED,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,cAAc,QAAQ,IAAI,SAAS,oBAAoB,CACvD,CAAC;IACH,CAAC;CACD;AAlED,wBAkEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="300" height="300" viewBox="0 0 300 300"><path fill="#fff" d="M0 0h300v300H0z"/><svg width="280" height="125" x="10" y="15" overflow="hidden" viewBox="30 485 280 125"><defs><path id="c" d="M37.14-109.969v65.813q-.001 16.03 11.516 16.031 4.923.001 8.344-3.344 3.422-3.34 3.422-8.093 0-4.905-3.219-8.25-3.221-3.342-7.89-3.344-3.315.001-7.579 2.89v-33.187q5.31-.482 8.063-.484 16.997.001 29.125 12.25 12.124 12.251 12.125 29.484 0 17.642-12.328 29.734Q66.389 1.611 48.422 1.61c-6.024 0-11.89-1.312-17.61-3.937q-8.578-3.95-14.14-10.64-9.656-11.608-9.656-30.048v-66.953Zm0 0"/><path id="a" d="M38.906-109.969v33.594q7.654-5.561 15.313-5.562 11.608 0 18.406 8.39 6.812 8.377 6.813 22.625V0H49.311v-42.453c0-3.438-.367-5.742-1.093-6.922q-1.094-1.78-4.235-1.781-5.079.001-5.078 7.484V0H8.781v-109.969Zm0 0"/><path id="b" d="M8.781-79.203h30.125v45.36q-.001 6.86 5.735 6.859c3.757 0 5.64-2.286 5.64-6.86v-45.36h30.125v44.798q-.001 15.644-10.39 26.39-10.393 10.751-25.47 10.75c-11.437 0-20.648-4.16-27.624-12.484-5.43-6.5-8.14-15.52-8.14-27.062Zm0 0"/></defs><path fill="none" stroke="#9b9ca0" stroke-miterlimit="10" stroke-width="6.7" d="M397.953 235.469V207.41h-1.55q-6.2.001-8.45-2.09-2.245-2.091-2.246-9.07v-57.969h-28.984v62.465c0 10.852 2.968 19.352 8.914 25.5q8.911 9.223 24.566 9.223Zm5.735 5.734h-13.485q-18.447 0-28.832-10.695c-6.922-7.133-10.383-17.051-10.383-29.762v-68.2h40.453v63.704q.002 3.566 1.086 4.496t3.875.93h7.286Zm0 0"/><path fill="none" stroke="#ea962a" stroke-miterlimit="10" stroke-width="6.7" d="M456.3 201.523h2.173q19.682-.001 19.683-15.347 0-14.1-19.219-14.102h-4.03v27.899c0 .722.1 1.16.312 1.316q.306.234 1.082.234Zm-2.476 34.254c5.27.207 8.16.309 8.68.309q22.471 0 36.734-13.95c9.504-9.3 14.258-21.284 14.258-35.96q0-21.856-14.8-34.875-14.808-13.02-40.688-13.02h-37.664v97.188h28.828v-69.133h9.765c16.637 0 24.954 6.617 24.954 19.84q0 21.081-25.418 21.082h-4.649Zm-7.285 5.426h-31.934V132.547h43.403c19.012 0 33.969 4.86 44.87 14.57q16.353 14.573 16.352 39.059 0 24.49-15.886 40.07-15.89 15.576-40.84 15.578-4.653 0-9.844-.312c-3.46-.207-5.504-.309-6.12-.309Zm0 0"/><path fill="none" stroke="#9b9ca0" stroke-miterlimit="10" stroke-width="6.7" d="m600.918 235.469-26.195-49.91 25.261-47.278h-29.449l-9.144 22.164-11.313-22.164h-30.07l25.265 48.051-26.66 49.137h29.914l10.075-23.563 11.933 23.563Zm9.453 5.734h-43.398l-7.907-15.656-6.664 15.656h-43.554l29.914-55.027-28.211-53.63h43.09l7.285 14.263 5.734-14.262h42.938l-28.368 53.012Zm0 0"/><path fill="none" stroke="#9b9ca0" stroke-miterlimit="10" stroke-width="2.68" d="M369.984 357.895v-11.223h-.62q-2.481.001-3.38-.836c-.597-.559-.898-1.766-.898-3.629V319.02h-11.594v24.988q0 6.509 3.567 10.199 3.561 3.687 9.824 3.688Zm2.293 2.293h-5.394q-7.377 0-11.531-4.278t-4.153-11.902v-27.281h16.18v25.48c0 .953.144 1.55.433 1.8.29.247.81.372 1.551.372h2.914Zm0 0"/><path fill="none" stroke="#ea962a" stroke-miterlimit="10" stroke-width="2.68" d="M393.324 344.316h.867q7.875 0 7.875-6.136 0-5.644-7.687-5.645h-1.613v11.16c0 .29.039.465.125.528q.123.093.433.093Zm-.992 13.704q3.164.124 3.473.125c5.992 0 10.89-1.864 14.691-5.582q5.707-5.581 5.707-14.383-.001-8.743-5.922-13.95-5.924-5.209-16.277-5.21H378.94v38.875h11.532v-27.653h3.906q9.979 0 9.98 7.938 0 8.43-10.168 8.43h-1.859Zm-2.914 2.168h-12.773v-43.461h17.359q11.409-.001 17.95 5.828 6.543 5.828 6.542 15.625-.002 9.793-6.355 16.027-6.358 6.229-16.336 6.23-1.864 0-3.938-.125-2.08-.124-2.449-.125Zm0 0"/><path fill="none" stroke="#9b9ca0" stroke-miterlimit="10" stroke-width="2.68" d="m451.168 357.895-10.477-19.965 10.106-18.91h-11.781l-3.657 8.867-4.527-8.867h-12.027l10.105 19.222-10.664 19.653h11.969l4.027-9.422 4.774 9.422Zm3.785 2.293H437.59l-3.16-6.262-2.668 6.262H414.34l11.969-22.008-11.286-21.453h17.235l2.914 5.703 2.297-5.703h17.172l-11.344 21.203Zm0 0"/><path fill="none" stroke="#171112" stroke-miterlimit="10" stroke-width="6.7" d="M697.953 595.469V567.41h-1.55q-6.2.001-8.45-2.09-2.245-2.091-2.246-9.07v-57.969h-28.984v62.465c0 10.852 2.968 19.352 8.914 25.5q8.911 9.223 24.566 9.223Zm5.735 5.734h-13.485q-18.447 0-28.832-10.695c-6.922-7.133-10.383-17.051-10.383-29.762v-68.2h40.453v63.704q.002 3.567 1.086 4.496t3.875.93h7.285Zm52.612-39.68h2.173q19.682-.001 19.683-15.347 0-14.1-19.218-14.102h-4.032v27.899q-.002 1.082.313 1.316.306.234 1.082.234Zm-2.476 34.254c5.27.207 8.16.309 8.68.309q22.471 0 36.734-13.95 14.257-13.948 14.258-35.96 0-21.856-14.8-34.875-14.807-13.02-40.688-13.02h-37.664v97.188h28.828v-69.133h9.765c16.637 0 24.954 6.617 24.954 19.84q0 21.082-25.418 21.082h-4.649Zm-7.285 5.426h-31.934V492.547h43.403c19.012 0 33.969 4.86 44.87 14.57q16.353 14.573 16.352 39.059 0 24.49-15.886 40.07-15.89 15.576-40.84 15.578-4.653 0-9.844-.312c-3.46-.207-5.504-.309-6.12-.309Zm0 0"/><path fill="none" stroke="#171112" stroke-miterlimit="10" stroke-width="6.7" d="m900.918 595.469-26.195-49.91 25.261-47.278h-29.449l-9.144 22.164-11.313-22.164h-30.07l25.265 48.051-26.66 49.137h29.914l10.075-23.563 11.933 23.563Zm9.453 5.734h-43.398l-7.907-15.656-6.664 15.656h-43.554l29.914-55.027-28.211-53.63h43.09l7.285 14.263 5.734-14.262h42.938l-28.368 53.012Zm0 0"/><path fill="none" stroke="#3b3b3f" stroke-miterlimit="10" stroke-width="2.68" d="M669.984 717.895v-11.223h-.62q-2.481.001-3.38-.836c-.597-.559-.898-1.766-.898-3.629V679.02h-11.594v24.988q0 6.509 3.567 10.199 3.561 3.687 9.824 3.688Zm2.293 2.293h-5.394q-7.377 0-11.531-4.278t-4.153-11.902v-27.281h16.18v25.48c0 .953.144 1.55.433 1.8.29.247.81.372 1.551.372h2.914Zm21.047-15.872h.867q7.875 0 7.875-6.136 0-5.644-7.687-5.645h-1.613v11.16c0 .293.039.465.125.528q.123.093.433.093Zm-.992 13.704q3.164.124 3.473.125c5.992 0 10.89-1.864 14.691-5.582q5.707-5.581 5.707-14.383-.001-8.743-5.922-13.95-5.924-5.209-16.277-5.21H678.94v38.875h11.532v-27.653h3.906q9.979 0 9.98 7.938 0 8.43-10.168 8.43h-1.859Zm-2.914 2.168h-12.773v-43.461h17.359q11.409-.001 17.95 5.828 6.543 5.828 6.542 15.625-.002 9.793-6.355 16.027-6.358 6.229-16.336 6.23-1.863 0-3.938-.125-2.08-.124-2.449-.125Zm0 0"/><path fill="none" stroke="#3b3b3f" stroke-miterlimit="10" stroke-width="2.68" d="m751.168 717.895-10.477-19.965 10.106-18.91h-11.781l-3.657 8.867-4.527-8.867h-12.027l10.105 19.222-10.664 19.653h11.969l4.027-9.422 4.774 9.422Zm3.785 2.293H737.59l-3.16-6.262-2.668 6.261H714.34l11.969-22.007-11.286-21.453h17.235l2.914 5.703 2.297-5.703h17.172l-11.344 21.203Zm0 0"/><path fill="none" stroke="#191a2c" stroke-miterlimit="10" stroke-width="2.68" d="M672.176 818.617v-11.222h-.621q-2.478 0-3.38-.836-.897-.84-.898-3.63v-23.187h-11.593v24.985q-.001 6.514 3.566 10.199 3.563 3.69 9.828 3.691Zm2.293 2.293h-5.39q-7.383 0-11.536-4.277-4.154-4.278-4.152-11.906v-27.278h16.18v25.48q-.001 1.43.437 1.798.433.375 1.547.375h2.914Zm21.047-15.87h.867q7.875 0 7.875-6.142c0-3.757-2.563-5.64-7.688-5.64h-1.613v11.16q.001.434.125.527.123.094.434.094Zm-.993 13.702q3.164.122 3.473.121 8.988 0 14.695-5.578c3.801-3.722 5.704-8.515 5.704-14.387q0-8.738-5.922-13.949c-3.95-3.472-9.371-5.207-16.274-5.207h-15.066v38.875h11.531v-27.652h3.906q9.98 0 9.98 7.933 0 8.436-10.167 8.434h-1.86Zm-2.914 2.168h-12.77v-43.46h17.36c7.606 0 13.586 1.94 17.95 5.827 4.359 3.883 6.538 9.094 6.538 15.621q.001 9.798-6.355 16.028c-4.234 4.156-9.684 6.234-16.336 6.234-1.238 0-2.555-.043-3.937-.125-1.383-.086-2.2-.125-2.45-.125Zm0 0"/><path fill="none" stroke="#191a2c" stroke-miterlimit="10" stroke-width="2.68" d="m753.363 818.617-10.48-19.965 10.105-18.91h-11.777l-3.66 8.867-4.524-8.867h-12.03l10.108 19.219-10.664 19.656h11.965l4.032-9.426 4.773 9.426Zm3.782 2.293h-17.36l-3.164-6.262-2.664 6.262h-17.422l11.965-22.008-11.285-21.453h17.238l2.914 5.703 2.293-5.703h17.172l-11.344 21.203Zm0 0"/><path fill="none" stroke="#171112" stroke-miterlimit="10" stroke-width="6.7" d="M87.953 595.469V567.41h-1.55q-6.2.001-8.45-2.09-2.245-2.091-2.246-9.07v-57.969H46.723v62.465c0 10.852 2.968 19.352 8.914 25.5q8.911 9.223 24.566 9.223Zm5.734 5.734H80.204q-18.447 0-28.832-10.695c-6.922-7.133-10.383-17.051-10.383-29.762v-68.2h40.453v63.704q.002 3.567 1.086 4.496 1.086.93 3.875.93h7.285Zm52.613-39.68h2.173q19.681-.001 19.683-15.347 0-14.1-19.219-14.102h-4.03v27.899c0 .722.1 1.16.312 1.316q.306.234 1.082.234Zm-2.476 34.254c5.27.207 8.16.309 8.68.309q22.471 0 36.734-13.95 14.257-13.948 14.258-35.96 0-21.856-14.8-34.875-14.808-13.02-40.688-13.02h-37.664v97.188h28.828v-69.133h9.766c16.636 0 24.953 6.617 24.953 19.84q0 21.082-25.418 21.082h-4.649Zm-7.285 5.426h-31.934V492.547h43.403c19.012 0 33.969 4.86 44.87 14.57q16.353 14.573 16.352 39.059 0 24.49-15.886 40.07-15.89 15.576-40.84 15.578-4.653 0-9.844-.312c-3.46-.207-5.504-.309-6.12-.309Zm0 0"/><path fill="none" stroke="#171112" stroke-miterlimit="10" stroke-width="6.7" d="m290.918 595.469-26.195-49.91 25.261-47.278h-29.449l-9.144 22.164-11.313-22.164h-30.07l25.265 48.051-26.66 49.137h29.914l10.075-23.563 11.933 23.563Zm9.453 5.734h-43.398l-7.907-15.656-6.664 15.656h-43.554l29.914-55.027-28.211-53.63h43.09l7.285 14.263 5.734-14.262h42.938l-28.368 53.012Zm0 0"/><g fill="#171111"><use xlink:href="#a" x="302.303" y="605.203"/><use xlink:href="#b" x="382.328" y="605.203"/></g><use xlink:href="#c" x="463.26" y="605.203" fill="#171111"/><path fill="none" stroke="#3b3b3f" stroke-miterlimit="10" stroke-width="2.68" d="M59.984 717.895v-11.223h-.62q-2.481.001-3.38-.836c-.597-.559-.898-1.766-.898-3.629V679.02H43.492v24.988q0 6.509 3.567 10.199 3.561 3.687 9.824 3.688Zm2.293 2.293h-5.394q-7.377 0-11.531-4.278t-4.153-11.902v-27.281h16.18v25.48c0 .953.144 1.55.434 1.8q.435.371 1.55.372h2.914Zm21.047-15.872h.867q7.875 0 7.875-6.136 0-5.644-7.687-5.645h-1.613v11.16c0 .293.039.465.125.528q.123.093.433.093Zm-.992 13.704q3.164.124 3.473.125c5.992 0 10.89-1.864 14.691-5.582q5.707-5.581 5.707-14.383-.001-8.743-5.922-13.95-5.924-5.209-16.277-5.21H68.94v38.875h11.532v-27.653h3.906q9.979 0 9.98 7.938 0 8.43-10.168 8.43h-1.859Zm-2.914 2.168H66.645v-43.461h17.359q11.409-.001 17.95 5.828 6.542 5.828 6.542 15.625c0 6.53-2.121 11.87-6.355 16.027q-6.358 6.229-16.336 6.23-1.864 0-3.938-.125-2.08-.124-2.449-.125Zm0 0"/><path fill="none" stroke="#3b3b3f" stroke-miterlimit="10" stroke-width="2.68" d="m141.168 717.895-10.477-19.965 10.106-18.91h-11.781l-3.657 8.867-4.527-8.867h-12.027l10.105 19.222-10.664 19.653h11.969l4.027-9.422 4.774 9.422Zm3.785 2.293H127.59l-3.16-6.262-2.668 6.261H104.34l11.969-22.007-11.286-21.453h17.235l2.914 5.703 2.297-5.703h17.172l-11.344 21.203Zm0 0"/><path fill="none" stroke="#191a2c" stroke-miterlimit="10" stroke-width="2.68" d="M62.176 818.617v-11.222h-.621q-2.478 0-3.38-.836-.897-.84-.898-3.63v-23.187H45.684v24.985q-.001 6.514 3.566 10.199 3.563 3.69 9.828 3.691Zm2.293 2.293h-5.39q-7.383 0-11.536-4.277t-4.152-11.906v-27.278h16.18v25.48q-.001 1.43.437 1.798.433.375 1.547.375h2.914Zm21.047-15.87h.867q7.875 0 7.875-6.142c0-3.757-2.563-5.64-7.688-5.64h-1.613v11.16q.001.434.125.527.123.094.434.094Zm-.993 13.702q3.164.122 3.473.121 8.988 0 14.695-5.578c3.801-3.722 5.704-8.515 5.704-14.387q0-8.738-5.922-13.949c-3.95-3.472-9.371-5.207-16.274-5.207H71.133v38.875h11.531v-27.652h3.906q9.98 0 9.98 7.933 0 8.436-10.167 8.434h-1.86Zm-2.914 2.168H68.84v-43.46H86.2c7.606 0 13.586 1.94 17.95 5.827 4.359 3.883 6.538 9.094 6.538 15.621q.001 9.798-6.355 16.028c-4.234 4.156-9.684 6.234-16.336 6.234-1.238 0-2.555-.043-3.937-.125-1.383-.086-2.2-.125-2.45-.125Zm0 0"/><path fill="none" stroke="#191a2c" stroke-miterlimit="10" stroke-width="2.68" d="m143.363 818.617-10.48-19.965 10.105-18.91h-11.777l-3.66 8.867-4.524-8.867h-12.03l10.108 19.219-10.664 19.656h11.965l4.031-9.426 4.774 9.426Zm3.782 2.293h-17.36l-3.164-6.262-2.664 6.262h-17.422l11.965-22.008-11.285-21.453h17.238l2.914 5.703 2.293-5.703h17.172l-11.344 21.203Zm0 0"/></svg><svg width="255" height="125" x="22" y="160" overflow="hidden" viewBox="305 485 255 125"><path fill="none" stroke="#9b9ca0" stroke-miterlimit="10" stroke-width="6.7" d="M397.953 235.469V207.41h-1.55q-6.2.001-8.45-2.09-2.245-2.091-2.246-9.07v-57.969h-28.984v62.465c0 10.852 2.968 19.352 8.914 25.5q8.911 9.223 24.566 9.223Zm5.735 5.734h-13.485q-18.447 0-28.832-10.695c-6.922-7.133-10.383-17.051-10.383-29.762v-68.2h40.453v63.704q.002 3.566 1.086 4.496t3.875.93h7.286Zm0 0"/><path fill="none" stroke="#ea962a" stroke-miterlimit="10" stroke-width="6.7" d="M456.3 201.523h2.173q19.682-.001 19.683-15.347 0-14.1-19.219-14.102h-4.03v27.899c0 .722.1 1.16.312 1.316q.306.234 1.082.234Zm-2.476 34.254c5.27.207 8.16.309 8.68.309q22.471 0 36.734-13.95c9.504-9.3 14.258-21.284 14.258-35.96q0-21.856-14.8-34.875-14.808-13.02-40.688-13.02h-37.664v97.188h28.828v-69.133h9.765c16.637 0 24.954 6.617 24.954 19.84q0 21.081-25.418 21.082h-4.649Zm-7.285 5.426h-31.934V132.547h43.403c19.012 0 33.969 4.86 44.87 14.57q16.353 14.573 16.352 39.059 0 24.49-15.886 40.07-15.89 15.576-40.84 15.578-4.653 0-9.844-.312c-3.46-.207-5.504-.309-6.12-.309Zm0 0"/><path fill="none" stroke="#9b9ca0" stroke-miterlimit="10" stroke-width="6.7" d="m600.918 235.469-26.195-49.91 25.261-47.278h-29.449l-9.144 22.164-11.313-22.164h-30.07l25.265 48.051-26.66 49.137h29.914l10.075-23.563 11.933 23.563Zm9.453 5.734h-43.398l-7.907-15.656-6.664 15.656h-43.554l29.914-55.027-28.211-53.63h43.09l7.285 14.263 5.734-14.262h42.938l-28.368 53.012Zm0 0"/><path fill="none" stroke="#9b9ca0" stroke-miterlimit="10" stroke-width="2.68" d="M369.984 357.895v-11.223h-.62q-2.481.001-3.38-.836c-.597-.559-.898-1.766-.898-3.629V319.02h-11.594v24.988q0 6.509 3.567 10.199 3.561 3.687 9.824 3.688Zm2.293 2.293h-5.394q-7.377 0-11.531-4.278t-4.153-11.902v-27.281h16.18v25.48c0 .953.144 1.55.433 1.8.29.247.81.372 1.551.372h2.914Zm0 0"/><path fill="none" stroke="#ea962a" stroke-miterlimit="10" stroke-width="2.68" d="M393.324 344.316h.867q7.875 0 7.875-6.136 0-5.644-7.687-5.645h-1.613v11.16c0 .29.039.465.125.528q.123.093.433.093Zm-.992 13.704q3.164.124 3.473.125c5.992 0 10.89-1.864 14.691-5.582q5.707-5.581 5.707-14.383-.001-8.743-5.922-13.95-5.924-5.209-16.277-5.21H378.94v38.875h11.532v-27.653h3.906q9.979 0 9.98 7.938 0 8.43-10.168 8.43h-1.859Zm-2.914 2.168h-12.773v-43.461h17.359q11.409-.001 17.95 5.828 6.543 5.828 6.542 15.625-.002 9.793-6.355 16.027-6.358 6.229-16.336 6.23-1.864 0-3.938-.125-2.08-.124-2.449-.125Zm0 0"/><path fill="none" stroke="#9b9ca0" stroke-miterlimit="10" stroke-width="2.68" d="m451.168 357.895-10.477-19.965 10.106-18.91h-11.781l-3.657 8.867-4.527-8.867h-12.027l10.105 19.222-10.664 19.653h11.969l4.027-9.422 4.774 9.422Zm3.785 2.293H437.59l-3.16-6.262-2.668 6.262H414.34l11.969-22.008-11.286-21.453h17.235l2.914 5.703 2.297-5.703h17.172l-11.344 21.203Zm0 0"/><path fill="none" stroke="#171112" stroke-miterlimit="10" stroke-width="6.7" d="M697.953 595.469V567.41h-1.55q-6.2.001-8.45-2.09-2.245-2.091-2.246-9.07v-57.969h-28.984v62.465c0 10.852 2.968 19.352 8.914 25.5q8.911 9.223 24.566 9.223Zm5.735 5.734h-13.485q-18.447 0-28.832-10.695c-6.922-7.133-10.383-17.051-10.383-29.762v-68.2h40.453v63.704q.002 3.567 1.086 4.496t3.875.93h7.285Zm52.612-39.68h2.173q19.682-.001 19.683-15.347 0-14.1-19.218-14.102h-4.032v27.899q-.002 1.082.313 1.316.306.234 1.082.234Zm-2.476 34.254c5.27.207 8.16.309 8.68.309q22.471 0 36.734-13.95 14.257-13.948 14.258-35.96 0-21.856-14.8-34.875-14.807-13.02-40.688-13.02h-37.664v97.188h28.828v-69.133h9.765c16.637 0 24.954 6.617 24.954 19.84q0 21.082-25.418 21.082h-4.649Zm-7.285 5.426h-31.934V492.547h43.403c19.012 0 33.969 4.86 44.87 14.57q16.353 14.573 16.352 39.059 0 24.49-15.886 40.07-15.89 15.576-40.84 15.578-4.653 0-9.844-.312c-3.46-.207-5.504-.309-6.12-.309Zm0 0"/><path fill="none" stroke="#171112" stroke-miterlimit="10" stroke-width="6.7" d="m900.918 595.469-26.195-49.91 25.261-47.278h-29.449l-9.144 22.164-11.313-22.164h-30.07l25.265 48.051-26.66 49.137h29.914l10.075-23.563 11.933 23.563Zm9.453 5.734h-43.398l-7.907-15.656-6.664 15.656h-43.554l29.914-55.027-28.211-53.63h43.09l7.285 14.263 5.734-14.262h42.938l-28.368 53.012Zm0 0"/><path fill="none" stroke="#3b3b3f" stroke-miterlimit="10" stroke-width="2.68" d="M669.984 717.895v-11.223h-.62q-2.481.001-3.38-.836c-.597-.559-.898-1.766-.898-3.629V679.02h-11.594v24.988q0 6.509 3.567 10.199 3.561 3.687 9.824 3.688Zm2.293 2.293h-5.394q-7.377 0-11.531-4.278t-4.153-11.902v-27.281h16.18v25.48c0 .953.144 1.55.433 1.8.29.247.81.372 1.551.372h2.914Zm21.047-15.872h.867q7.875 0 7.875-6.136 0-5.644-7.687-5.645h-1.613v11.16c0 .293.039.465.125.528q.123.093.433.093Zm-.992 13.704q3.164.124 3.473.125c5.992 0 10.89-1.864 14.691-5.582q5.707-5.581 5.707-14.383-.001-8.743-5.922-13.95-5.924-5.209-16.277-5.21H678.94v38.875h11.532v-27.653h3.906q9.979 0 9.98 7.938 0 8.43-10.168 8.43h-1.859Zm-2.914 2.168h-12.773v-43.461h17.359q11.409-.001 17.95 5.828 6.543 5.828 6.542 15.625-.002 9.793-6.355 16.027-6.358 6.229-16.336 6.23-1.863 0-3.938-.125-2.08-.124-2.449-.125Zm0 0"/><path fill="none" stroke="#3b3b3f" stroke-miterlimit="10" stroke-width="2.68" d="m751.168 717.895-10.477-19.965 10.106-18.91h-11.781l-3.657 8.867-4.527-8.867h-12.027l10.105 19.222-10.664 19.653h11.969l4.027-9.422 4.774 9.422Zm3.785 2.293H737.59l-3.16-6.262-2.668 6.261H714.34l11.969-22.007-11.286-21.453h17.235l2.914 5.703 2.297-5.703h17.172l-11.344 21.203Zm0 0"/><path fill="none" stroke="#191a2c" stroke-miterlimit="10" stroke-width="2.68" d="M672.176 818.617v-11.222h-.621q-2.478 0-3.38-.836-.897-.84-.898-3.63v-23.187h-11.593v24.985q-.001 6.514 3.566 10.199 3.563 3.69 9.828 3.691Zm2.293 2.293h-5.39q-7.383 0-11.536-4.277-4.154-4.278-4.152-11.906v-27.278h16.18v25.48q-.001 1.43.437 1.798.433.375 1.547.375h2.914Zm21.047-15.87h.867q7.875 0 7.875-6.142c0-3.757-2.563-5.64-7.688-5.64h-1.613v11.16q.001.434.125.527.123.094.434.094Zm-.993 13.702q3.164.122 3.473.121 8.988 0 14.695-5.578c3.801-3.722 5.704-8.515 5.704-14.387q0-8.738-5.922-13.949c-3.95-3.472-9.371-5.207-16.274-5.207h-15.066v38.875h11.531v-27.652h3.906q9.98 0 9.98 7.933 0 8.436-10.167 8.434h-1.86Zm-2.914 2.168h-12.77v-43.46h17.36c7.606 0 13.586 1.94 17.95 5.827 4.359 3.883 6.538 9.094 6.538 15.621q.001 9.798-6.355 16.028c-4.234 4.156-9.684 6.234-16.336 6.234-1.238 0-2.555-.043-3.937-.125-1.383-.086-2.2-.125-2.45-.125Zm0 0"/><path fill="none" stroke="#191a2c" stroke-miterlimit="10" stroke-width="2.68" d="m753.363 818.617-10.48-19.965 10.105-18.91h-11.777l-3.66 8.867-4.524-8.867h-12.03l10.108 19.219-10.664 19.656h11.965l4.032-9.426 4.773 9.426Zm3.782 2.293h-17.36l-3.164-6.262-2.664 6.262h-17.422l11.965-22.008-11.285-21.453h17.238l2.914 5.703 2.293-5.703h17.172l-11.344 21.203Zm0 0"/><path fill="none" stroke="#171112" stroke-miterlimit="10" stroke-width="6.7" d="M87.953 595.469V567.41h-1.55q-6.2.001-8.45-2.09-2.245-2.091-2.246-9.07v-57.969H46.723v62.465c0 10.852 2.968 19.352 8.914 25.5q8.911 9.223 24.566 9.223Zm5.734 5.734H80.204q-18.447 0-28.832-10.695c-6.922-7.133-10.383-17.051-10.383-29.762v-68.2h40.453v63.704q.002 3.567 1.086 4.496 1.086.93 3.875.93h7.285Zm52.613-39.68h2.173q19.681-.001 19.683-15.347 0-14.1-19.219-14.102h-4.03v27.899c0 .722.1 1.16.312 1.316q.306.234 1.082.234Zm-2.476 34.254c5.27.207 8.16.309 8.68.309q22.471 0 36.734-13.95 14.257-13.948 14.258-35.96 0-21.856-14.8-34.875-14.808-13.02-40.688-13.02h-37.664v97.188h28.828v-69.133h9.766c16.636 0 24.953 6.617 24.953 19.84q0 21.082-25.418 21.082h-4.649Zm-7.285 5.426h-31.934V492.547h43.403c19.012 0 33.969 4.86 44.87 14.57q16.353 14.573 16.352 39.059 0 24.49-15.886 40.07-15.89 15.576-40.84 15.578-4.653 0-9.844-.312c-3.46-.207-5.504-.309-6.12-.309Zm0 0"/><path fill="none" stroke="#171112" stroke-miterlimit="10" stroke-width="6.7" d="m290.918 595.469-26.195-49.91 25.261-47.278h-29.449l-9.144 22.164-11.313-22.164h-30.07l25.265 48.051-26.66 49.137h29.914l10.075-23.563 11.933 23.563Zm9.453 5.734h-43.398l-7.907-15.656-6.664 15.656h-43.554l29.914-55.027-28.211-53.63h43.09l7.285 14.263 5.734-14.262h42.938l-28.368 53.012Zm0 0"/><g fill="#171111"><use xlink:href="#a" x="302.303" y="605.203"/><use xlink:href="#b" x="382.328" y="605.203"/></g><use xlink:href="#c" x="463.26" y="605.203" fill="#171111"/><path fill="none" stroke="#3b3b3f" stroke-miterlimit="10" stroke-width="2.68" d="M59.984 717.895v-11.223h-.62q-2.481.001-3.38-.836c-.597-.559-.898-1.766-.898-3.629V679.02H43.492v24.988q0 6.509 3.567 10.199 3.561 3.687 9.824 3.688Zm2.293 2.293h-5.394q-7.377 0-11.531-4.278t-4.153-11.902v-27.281h16.18v25.48c0 .953.144 1.55.434 1.8q.435.371 1.55.372h2.914Zm21.047-15.872h.867q7.875 0 7.875-6.136 0-5.644-7.687-5.645h-1.613v11.16c0 .293.039.465.125.528q.123.093.433.093Zm-.992 13.704q3.164.124 3.473.125c5.992 0 10.89-1.864 14.691-5.582q5.707-5.581 5.707-14.383-.001-8.743-5.922-13.95-5.924-5.209-16.277-5.21H68.94v38.875h11.532v-27.653h3.906q9.979 0 9.98 7.938 0 8.43-10.168 8.43h-1.859Zm-2.914 2.168H66.645v-43.461h17.359q11.409-.001 17.95 5.828 6.542 5.828 6.542 15.625c0 6.53-2.121 11.87-6.355 16.027q-6.358 6.229-16.336 6.23-1.864 0-3.938-.125-2.08-.124-2.449-.125Zm0 0"/><path fill="none" stroke="#3b3b3f" stroke-miterlimit="10" stroke-width="2.68" d="m141.168 717.895-10.477-19.965 10.106-18.91h-11.781l-3.657 8.867-4.527-8.867h-12.027l10.105 19.222-10.664 19.653h11.969l4.027-9.422 4.774 9.422Zm3.785 2.293H127.59l-3.16-6.262-2.668 6.261H104.34l11.969-22.007-11.286-21.453h17.235l2.914 5.703 2.297-5.703h17.172l-11.344 21.203Zm0 0"/><path fill="none" stroke="#191a2c" stroke-miterlimit="10" stroke-width="2.68" d="M62.176 818.617v-11.222h-.621q-2.478 0-3.38-.836-.897-.84-.898-3.63v-23.187H45.684v24.985q-.001 6.514 3.566 10.199 3.563 3.69 9.828 3.691Zm2.293 2.293h-5.39q-7.383 0-11.536-4.277t-4.152-11.906v-27.278h16.18v25.48q-.001 1.43.437 1.798.433.375 1.547.375h2.914Zm21.047-15.87h.867q7.875 0 7.875-6.142c0-3.757-2.563-5.64-7.688-5.64h-1.613v11.16q.001.434.125.527.123.094.434.094Zm-.993 13.702q3.164.122 3.473.121 8.988 0 14.695-5.578c3.801-3.722 5.704-8.515 5.704-14.387q0-8.738-5.922-13.949c-3.95-3.472-9.371-5.207-16.274-5.207H71.133v38.875h11.531v-27.652h3.906q9.98 0 9.98 7.933 0 8.436-10.167 8.434h-1.86Zm-2.914 2.168H68.84v-43.46H86.2c7.606 0 13.586 1.94 17.95 5.827 4.359 3.883 6.538 9.094 6.538 15.621q.001 9.798-6.355 16.028c-4.234 4.156-9.684 6.234-16.336 6.234-1.238 0-2.555-.043-3.937-.125-1.383-.086-2.2-.125-2.45-.125Zm0 0"/><path fill="none" stroke="#191a2c" stroke-miterlimit="10" stroke-width="2.68" d="m143.363 818.617-10.48-19.965 10.105-18.91h-11.777l-3.66 8.867-4.524-8.867h-12.03l10.108 19.219-10.664 19.656h11.965l4.031-9.426 4.774 9.426Zm3.782 2.293h-17.36l-3.164-6.262-2.664 6.262h-17.422l11.965-22.008-11.285-21.453h17.238l2.914 5.703 2.293-5.703h17.172l-11.344 21.203Zm0 0"/></svg></svg>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getModels = getModels;
|
|
4
|
+
const transport_1 = require("../../shared/transport");
|
|
5
|
+
async function getModels() {
|
|
6
|
+
var _a;
|
|
7
|
+
const response = (await transport_1.ldxHubApiRequest.call(this, 'GET', '/refineloop/models'));
|
|
8
|
+
const models = (_a = response.data) !== null && _a !== void 0 ? _a : [];
|
|
9
|
+
return models.map((m) => {
|
|
10
|
+
var _a;
|
|
11
|
+
return ({
|
|
12
|
+
name: (_a = m.display_name) !== null && _a !== void 0 ? _a : m.id,
|
|
13
|
+
value: m.id,
|
|
14
|
+
description: m.description,
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=getModels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getModels.js","sourceRoot":"","sources":["../../../../../nodes/LdxHub/methods/loadOptions/getModels.ts"],"names":[],"mappings":";;AAeA,8BAgBC;AA7BD,sDAA0D;AAanD,KAAK,UAAU,SAAS;;IAG9B,MAAM,QAAQ,GAAG,CAAC,MAAM,4BAAgB,CAAC,IAAI,CAC5C,IAAI,EACJ,KAAK,EACL,oBAAoB,CACpB,CAAmB,CAAC;IAErB,MAAM,MAAM,GAAG,MAAA,QAAQ,CAAC,IAAI,mCAAI,EAAE,CAAC;IAEnC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;;QAAC,OAAA,CAAC;YACzB,IAAI,EAAE,MAAA,CAAC,CAAC,YAAY,mCAAI,CAAC,CAAC,EAAE;YAC5B,KAAK,EAAE,CAAC,CAAC,EAAE;YACX,WAAW,EAAE,CAAC,CAAC,WAAW;SAC1B,CAAC,CAAA;KAAA,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.refineLoopDescription = void 0;
|
|
4
|
+
const runJob_1 = require("./runJob");
|
|
5
|
+
const showOnlyForRefineLoop = {
|
|
6
|
+
resource: ['refineLoop'],
|
|
7
|
+
};
|
|
8
|
+
exports.refineLoopDescription = [
|
|
9
|
+
{
|
|
10
|
+
displayName: 'Operation',
|
|
11
|
+
name: 'operation',
|
|
12
|
+
type: 'options',
|
|
13
|
+
noDataExpression: true,
|
|
14
|
+
displayOptions: {
|
|
15
|
+
show: showOnlyForRefineLoop,
|
|
16
|
+
},
|
|
17
|
+
options: [
|
|
18
|
+
{
|
|
19
|
+
name: 'Run Refinement Job',
|
|
20
|
+
value: 'runJob',
|
|
21
|
+
action: 'Run a refinement job',
|
|
22
|
+
description: 'Upload an XLIFF file, run a RefineLoop job, and return the refined file',
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
default: 'runJob',
|
|
26
|
+
},
|
|
27
|
+
...runJob_1.runJobFields,
|
|
28
|
+
];
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/LdxHub/resources/refineLoop/index.ts"],"names":[],"mappings":";;;AAEA,qCAAwC;AAExC,MAAM,qBAAqB,GAAG;IAC7B,QAAQ,EAAE,CAAC,YAAY,CAAC;CACxB,CAAC;AAEW,QAAA,qBAAqB,GAAsB;IACvD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACf,IAAI,EAAE,qBAAqB;SAC3B;QACD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,oBAAoB;gBAC1B,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,sBAAsB;gBAC9B,WAAW,EAAE,yEAAyE;aACtF;SACD;QACD,OAAO,EAAE,QAAQ;KACjB;IACD,GAAG,qBAAY;CACf,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runJobExecute = runJobExecute;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const files_1 = require("../../shared/files");
|
|
6
|
+
const polling_1 = require("../../shared/polling");
|
|
7
|
+
const transport_1 = require("../../shared/transport");
|
|
8
|
+
function buildRefineLoopBody(input) {
|
|
9
|
+
const body = {
|
|
10
|
+
file_id: input.fileId,
|
|
11
|
+
model: input.model,
|
|
12
|
+
max_revisions: input.maxRevisions,
|
|
13
|
+
};
|
|
14
|
+
const o = input.options;
|
|
15
|
+
if (o.domain)
|
|
16
|
+
body.domain = o.domain;
|
|
17
|
+
if (o.noteLanguage)
|
|
18
|
+
body.note_language = o.noteLanguage;
|
|
19
|
+
if (o.outputMode)
|
|
20
|
+
body.output_mode = o.outputMode;
|
|
21
|
+
if (o.customInstructions)
|
|
22
|
+
body.custom_instructions = o.customInstructions;
|
|
23
|
+
if (o.removeHyphenation !== undefined)
|
|
24
|
+
body.remove_hyphenation = o.removeHyphenation;
|
|
25
|
+
if (o.excludeNumericSegments !== undefined) {
|
|
26
|
+
body.exclude_numeric_segments = o.excludeNumericSegments;
|
|
27
|
+
}
|
|
28
|
+
return body;
|
|
29
|
+
}
|
|
30
|
+
async function runJobExecute(items) {
|
|
31
|
+
var _a, _b, _c, _d, _e;
|
|
32
|
+
const returnData = [];
|
|
33
|
+
for (let i = 0; i < items.length; i++) {
|
|
34
|
+
try {
|
|
35
|
+
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
|
|
36
|
+
const model = this.getNodeParameter('model', i);
|
|
37
|
+
const maxRevisions = this.getNodeParameter('maxRevisions', i);
|
|
38
|
+
const options = this.getNodeParameter('options', i, {});
|
|
39
|
+
const pollingSettings = this.getNodeParameter('pollingSettings', i, {});
|
|
40
|
+
const binaryMeta = this.helpers.assertBinaryData(i, binaryPropertyName);
|
|
41
|
+
const buffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
|
42
|
+
const filename = (_a = binaryMeta.fileName) !== null && _a !== void 0 ? _a : 'input.xliff';
|
|
43
|
+
const mimeType = (_b = binaryMeta.mimeType) !== null && _b !== void 0 ? _b : 'application/octet-stream';
|
|
44
|
+
const uploadRes = await files_1.uploadFile.call(this, buffer, filename, mimeType);
|
|
45
|
+
const jobBody = buildRefineLoopBody({
|
|
46
|
+
fileId: uploadRes.file_id,
|
|
47
|
+
model,
|
|
48
|
+
maxRevisions,
|
|
49
|
+
options,
|
|
50
|
+
});
|
|
51
|
+
const jobRes = (await transport_1.ldxHubApiRequest.call(this, 'POST', '/refineloop/jobs', jobBody));
|
|
52
|
+
const finalJob = await polling_1.pollJobUntilDone.call(this, jobRes.job_id, {
|
|
53
|
+
serverWaitSeconds: (_c = pollingSettings.serverWaitSeconds) !== null && _c !== void 0 ? _c : 10,
|
|
54
|
+
pollingMaxAttempts: (_d = pollingSettings.pollingMaxAttempts) !== null && _d !== void 0 ? _d : 180,
|
|
55
|
+
}, i);
|
|
56
|
+
if (!finalJob.output_file_id) {
|
|
57
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `RefineLoop job ${jobRes.job_id} completed but returned no output_file_id`, { itemIndex: i });
|
|
58
|
+
}
|
|
59
|
+
const download = await files_1.downloadFile.call(this, finalJob.output_file_id);
|
|
60
|
+
const outputBinary = await this.helpers.prepareBinaryData(download.buffer, (_e = download.filename) !== null && _e !== void 0 ? _e : 'refined.xliff', download.mimeType);
|
|
61
|
+
returnData.push({
|
|
62
|
+
json: {
|
|
63
|
+
job_id: jobRes.job_id,
|
|
64
|
+
status: finalJob.status,
|
|
65
|
+
output_file_id: finalJob.output_file_id,
|
|
66
|
+
usage: finalJob.usage,
|
|
67
|
+
},
|
|
68
|
+
binary: {
|
|
69
|
+
[binaryPropertyName]: outputBinary,
|
|
70
|
+
},
|
|
71
|
+
pairedItem: { item: i },
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
if (this.continueOnFail()) {
|
|
76
|
+
const wrapped = error instanceof n8n_workflow_1.NodeOperationError
|
|
77
|
+
? error
|
|
78
|
+
: new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex: i });
|
|
79
|
+
returnData.push({
|
|
80
|
+
json: items[i].json,
|
|
81
|
+
error: wrapped,
|
|
82
|
+
pairedItem: { item: i },
|
|
83
|
+
});
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
const ctx = error.context;
|
|
87
|
+
if (ctx)
|
|
88
|
+
ctx.itemIndex = i;
|
|
89
|
+
throw error;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return [returnData];
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=runJob.execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runJob.execute.js","sourceRoot":"","sources":["../../../../../nodes/LdxHub/resources/refineLoop/runJob.execute.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runJobFields = void 0;
|
|
4
|
+
const showOnlyForRunJob = {
|
|
5
|
+
resource: ['refineLoop'],
|
|
6
|
+
operation: ['runJob'],
|
|
7
|
+
};
|
|
8
|
+
exports.runJobFields = [
|
|
9
|
+
{
|
|
10
|
+
displayName: 'Input Binary Field',
|
|
11
|
+
name: 'binaryPropertyName',
|
|
12
|
+
type: 'string',
|
|
13
|
+
default: 'data',
|
|
14
|
+
required: true,
|
|
15
|
+
description: 'Name of the binary property from the previous node that contains the file to refine',
|
|
16
|
+
displayOptions: { show: showOnlyForRunJob },
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
displayName: 'Model Name or ID',
|
|
20
|
+
name: 'model',
|
|
21
|
+
type: 'options',
|
|
22
|
+
typeOptions: {
|
|
23
|
+
loadOptionsMethod: 'getModels',
|
|
24
|
+
},
|
|
25
|
+
required: true,
|
|
26
|
+
default: '',
|
|
27
|
+
description: 'AI model to use. Click to load available models from LDXhub. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
28
|
+
displayOptions: { show: showOnlyForRunJob },
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
displayName: 'Max Revisions',
|
|
32
|
+
name: 'maxRevisions',
|
|
33
|
+
type: 'number',
|
|
34
|
+
typeOptions: { minValue: 1, maxValue: 10 },
|
|
35
|
+
default: 6,
|
|
36
|
+
description: 'Maximum number of refinement iterations (1-10)',
|
|
37
|
+
displayOptions: { show: showOnlyForRunJob },
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
displayName: 'Options',
|
|
41
|
+
name: 'options',
|
|
42
|
+
type: 'collection',
|
|
43
|
+
placeholder: 'Add Option',
|
|
44
|
+
default: {},
|
|
45
|
+
displayOptions: { show: showOnlyForRunJob },
|
|
46
|
+
options: [
|
|
47
|
+
{
|
|
48
|
+
displayName: 'Custom Instructions',
|
|
49
|
+
name: 'customInstructions',
|
|
50
|
+
type: 'string',
|
|
51
|
+
typeOptions: { rows: 4 },
|
|
52
|
+
default: '',
|
|
53
|
+
description: 'Free-form instructions for the AI (e.g., translation style)',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
displayName: 'Domain',
|
|
57
|
+
name: 'domain',
|
|
58
|
+
type: 'string',
|
|
59
|
+
default: '',
|
|
60
|
+
description: 'Subject-matter domain hint for the AI (e.g., "medical", "legal", "technical")',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
displayName: 'Exclude Numeric Segments',
|
|
64
|
+
name: 'excludeNumericSegments',
|
|
65
|
+
type: 'boolean',
|
|
66
|
+
default: false,
|
|
67
|
+
description: 'Whether to skip segments that contain only numbers',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
displayName: 'Note Language',
|
|
71
|
+
name: 'noteLanguage',
|
|
72
|
+
type: 'string',
|
|
73
|
+
default: '',
|
|
74
|
+
description: 'Language for AI-generated notes (e.g., "en", "ja", "de")',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
displayName: 'Output Mode',
|
|
78
|
+
name: 'outputMode',
|
|
79
|
+
type: 'options',
|
|
80
|
+
options: [
|
|
81
|
+
{
|
|
82
|
+
name: 'Full',
|
|
83
|
+
value: 'full',
|
|
84
|
+
description: 'Return complete job data',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: 'Translations Only',
|
|
88
|
+
value: 'translations',
|
|
89
|
+
description: 'Return only refined translations',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'None',
|
|
93
|
+
value: 'none',
|
|
94
|
+
description: 'Return only job metadata',
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
default: 'full',
|
|
98
|
+
description: 'How much detail to include in the response',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
displayName: 'Remove Hyphenation',
|
|
102
|
+
name: 'removeHyphenation',
|
|
103
|
+
type: 'boolean',
|
|
104
|
+
default: true,
|
|
105
|
+
description: 'Whether to remove hyphenation artifacts from the source',
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
displayName: 'Polling Settings',
|
|
111
|
+
name: 'pollingSettings',
|
|
112
|
+
type: 'collection',
|
|
113
|
+
placeholder: 'Add Setting',
|
|
114
|
+
default: {},
|
|
115
|
+
displayOptions: { show: showOnlyForRunJob },
|
|
116
|
+
options: [
|
|
117
|
+
{
|
|
118
|
+
displayName: 'Max Polling Attempts',
|
|
119
|
+
name: 'pollingMaxAttempts',
|
|
120
|
+
type: 'number',
|
|
121
|
+
typeOptions: { minValue: 1 },
|
|
122
|
+
default: 180,
|
|
123
|
+
description: 'Maximum number of polling attempts before giving up. With default serverWaitSeconds=10 and pollingMaxAttempts=180, maximum wait is about 30 minutes.',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
displayName: 'Server Wait Seconds',
|
|
127
|
+
name: 'serverWaitSeconds',
|
|
128
|
+
type: 'number',
|
|
129
|
+
typeOptions: { minValue: 1, maxValue: 10 },
|
|
130
|
+
default: 10,
|
|
131
|
+
description: 'Seconds the LDXhub server should wait before responding. Longer values reduce client-side polling frequency.',
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
];
|
|
136
|
+
//# sourceMappingURL=runJob.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runJob.js","sourceRoot":"","sources":["../../../../../nodes/LdxHub/resources/refineLoop/runJob.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
export type UploadResponse = {
|
|
3
|
+
file_id: string;
|
|
4
|
+
filename: string;
|
|
5
|
+
size: number;
|
|
6
|
+
created_at: string;
|
|
7
|
+
updated_at: string;
|
|
8
|
+
expires_at: string;
|
|
9
|
+
};
|
|
10
|
+
export type DownloadResult = {
|
|
11
|
+
buffer: Buffer;
|
|
12
|
+
mimeType: string;
|
|
13
|
+
filename?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function uploadFile(this: IExecuteFunctions, buffer: Buffer, filename: string, mimeType: string): Promise<UploadResponse>;
|
|
16
|
+
export declare function downloadFile(this: IExecuteFunctions, fileId: string): Promise<DownloadResult>;
|
|
17
|
+
export declare function parseContentDisposition(header: string | undefined): string | undefined;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uploadFile = uploadFile;
|
|
4
|
+
exports.downloadFile = downloadFile;
|
|
5
|
+
exports.parseContentDisposition = parseContentDisposition;
|
|
6
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
7
|
+
const transport_1 = require("./transport");
|
|
8
|
+
async function uploadFile(buffer, filename, mimeType) {
|
|
9
|
+
const formData = new FormData();
|
|
10
|
+
formData.append('file', new Blob([buffer], { type: mimeType }), filename);
|
|
11
|
+
const options = {
|
|
12
|
+
method: 'POST',
|
|
13
|
+
url: `${transport_1.LDX_HUB_BASE_URL}/files`,
|
|
14
|
+
body: formData,
|
|
15
|
+
};
|
|
16
|
+
return (await this.helpers.httpRequestWithAuthentication.call(this, 'ldxHubApi', options));
|
|
17
|
+
}
|
|
18
|
+
async function downloadFile(fileId) {
|
|
19
|
+
const options = {
|
|
20
|
+
method: 'GET',
|
|
21
|
+
url: `${transport_1.LDX_HUB_BASE_URL}/files/${encodeURIComponent(fileId)}/content`,
|
|
22
|
+
encoding: 'arraybuffer',
|
|
23
|
+
returnFullResponse: true,
|
|
24
|
+
};
|
|
25
|
+
let response;
|
|
26
|
+
try {
|
|
27
|
+
response = await this.helpers.httpRequestWithAuthentication.call(this, 'ldxHubApi', options);
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
const httpCode = error.httpCode;
|
|
31
|
+
if (httpCode === 404 || httpCode === '404') {
|
|
32
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Output file not found. The file may have expired.');
|
|
33
|
+
}
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
const body = response.body;
|
|
37
|
+
const buffer = Buffer.isBuffer(body) ? body : Buffer.from(body);
|
|
38
|
+
const headers = response.headers;
|
|
39
|
+
const contentTypeHeader = headers['content-type'];
|
|
40
|
+
const contentType = typeof contentTypeHeader === 'string'
|
|
41
|
+
? contentTypeHeader.split(';')[0].trim()
|
|
42
|
+
: 'application/octet-stream';
|
|
43
|
+
const dispositionHeader = headers['content-disposition'];
|
|
44
|
+
const disposition = typeof dispositionHeader === 'string' ? dispositionHeader : undefined;
|
|
45
|
+
return {
|
|
46
|
+
buffer,
|
|
47
|
+
mimeType: contentType,
|
|
48
|
+
filename: parseContentDisposition(disposition),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function parseContentDisposition(header) {
|
|
52
|
+
if (!header)
|
|
53
|
+
return undefined;
|
|
54
|
+
const rfc5987Match = /filename\*=UTF-8''([^;]+)/i.exec(header);
|
|
55
|
+
if (rfc5987Match) {
|
|
56
|
+
try {
|
|
57
|
+
return decodeURIComponent(rfc5987Match[1].trim());
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const plainMatch = /filename="?([^";]+)"?/i.exec(header);
|
|
64
|
+
if (plainMatch) {
|
|
65
|
+
return plainMatch[1].trim();
|
|
66
|
+
}
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../../nodes/LdxHub/shared/files.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
export type JobStatus = 'queued' | 'processing' | 'completed' | 'failed';
|
|
3
|
+
export type APIError = {
|
|
4
|
+
request_id?: string;
|
|
5
|
+
code?: string;
|
|
6
|
+
message?: string;
|
|
7
|
+
};
|
|
8
|
+
export type JobResponse = {
|
|
9
|
+
job_id: string;
|
|
10
|
+
status: JobStatus;
|
|
11
|
+
output_file_id?: string;
|
|
12
|
+
error?: APIError;
|
|
13
|
+
usage?: Record<string, unknown>;
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
};
|
|
16
|
+
export type PollConfig = {
|
|
17
|
+
serverWaitSeconds: number;
|
|
18
|
+
pollingMaxAttempts: number;
|
|
19
|
+
};
|
|
20
|
+
export declare function pollJobUntilDone(this: IExecuteFunctions, jobId: string, config: PollConfig, itemIndex: number): Promise<JobResponse>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pollJobUntilDone = pollJobUntilDone;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const transport_1 = require("./transport");
|
|
6
|
+
async function pollJobUntilDone(jobId, config, itemIndex) {
|
|
7
|
+
var _a, _b, _c;
|
|
8
|
+
for (let attempt = 1; attempt <= config.pollingMaxAttempts; attempt++) {
|
|
9
|
+
const res = (await transport_1.ldxHubApiRequest.call(this, 'GET', `/refineloop/jobs/${encodeURIComponent(jobId)}`, undefined, { wait: config.serverWaitSeconds }));
|
|
10
|
+
switch (res.status) {
|
|
11
|
+
case 'completed':
|
|
12
|
+
return res;
|
|
13
|
+
case 'failed': {
|
|
14
|
+
const code = ((_a = res.error) === null || _a === void 0 ? void 0 : _a.code) ? ` [${res.error.code}]` : '';
|
|
15
|
+
const msg = (_c = (_b = res.error) === null || _b === void 0 ? void 0 : _b.message) !== null && _c !== void 0 ? _c : 'no error details returned by API';
|
|
16
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `RefineLoop job ${jobId} failed${code}: ${msg}`, { itemIndex });
|
|
17
|
+
}
|
|
18
|
+
case 'queued':
|
|
19
|
+
case 'processing':
|
|
20
|
+
break;
|
|
21
|
+
default:
|
|
22
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unexpected status '${res.status}' for RefineLoop job ${jobId}`, { itemIndex });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `RefineLoop job ${jobId} exceeded max poll attempts (${config.pollingMaxAttempts})`, { itemIndex });
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=polling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polling.js","sourceRoot":"","sources":["../../../../nodes/LdxHub/shared/polling.ts"],"names":[],"mappings":";;AA2BA,4CA4CC;AAtED,+CAAkD;AAElD,2CAA+C;AAwBxC,KAAK,UAAU,gBAAgB,CAErC,KAAa,EACb,MAAkB,EAClB,SAAiB;;IAEjB,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,MAAM,CAAC,kBAAkB,EAAE,OAAO,EAAE,EAAE,CAAC;QACvE,MAAM,GAAG,GAAG,CAAC,MAAM,4BAAgB,CAAC,IAAI,CACvC,IAAI,EACJ,KAAK,EACL,oBAAoB,kBAAkB,CAAC,KAAK,CAAC,EAAE,EAC/C,SAAS,EACT,EAAE,IAAI,EAAE,MAAM,CAAC,iBAAiB,EAAE,CAClC,CAAgB,CAAC;QAElB,QAAQ,GAAG,CAAC,MAAM,EAAE,CAAC;YACpB,KAAK,WAAW;gBACf,OAAO,GAAG,CAAC;YACZ,KAAK,QAAQ,CAAC,CAAC,CAAC;gBACf,MAAM,IAAI,GAAG,CAAA,MAAA,GAAG,CAAC,KAAK,0CAAE,IAAI,EAAC,CAAC,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC3D,MAAM,GAAG,GAAG,MAAA,MAAA,GAAG,CAAC,KAAK,0CAAE,OAAO,mCAAI,kCAAkC,CAAC;gBACrE,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,kBAAkB,KAAK,UAAU,IAAI,KAAK,GAAG,EAAE,EAC/C,EAAE,SAAS,EAAE,CACb,CAAC;YACH,CAAC;YACD,KAAK,QAAQ,CAAC;YACd,KAAK,YAAY;gBAChB,MAAM;YACP;gBACC,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,sBAAsB,GAAG,CAAC,MAAM,wBAAwB,KAAK,EAAE,EAC/D,EAAE,SAAS,EAAE,CACb,CAAC;QACJ,CAAC;IACF,CAAC;IAED,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,kBAAkB,KAAK,gCAAgC,MAAM,CAAC,kBAAkB,GAAG,EACnF,EAAE,SAAS,EAAE,CACb,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IDataObject, IExecuteFunctions, IHookFunctions, IHttpRequestMethods, ILoadOptionsFunctions } from 'n8n-workflow';
|
|
2
|
+
export declare const LDX_HUB_BASE_URL = "https://gw.ldxhub.io";
|
|
3
|
+
export declare function ldxHubApiRequest(this: IExecuteFunctions | ILoadOptionsFunctions | IHookFunctions, method: IHttpRequestMethods, endpoint: string, body?: IDataObject | undefined, qs?: IDataObject): Promise<any>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LDX_HUB_BASE_URL = void 0;
|
|
4
|
+
exports.ldxHubApiRequest = ldxHubApiRequest;
|
|
5
|
+
exports.LDX_HUB_BASE_URL = 'https://gw.ldxhub.io';
|
|
6
|
+
async function ldxHubApiRequest(method, endpoint, body = undefined, qs = {}) {
|
|
7
|
+
const options = {
|
|
8
|
+
method,
|
|
9
|
+
url: `${exports.LDX_HUB_BASE_URL}${endpoint}`,
|
|
10
|
+
qs,
|
|
11
|
+
body,
|
|
12
|
+
json: true,
|
|
13
|
+
};
|
|
14
|
+
return this.helpers.httpRequestWithAuthentication.call(this, 'ldxHubApi', options);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=transport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../../nodes/LdxHub/shared/transport.ts"],"names":[],"mappings":";;;AAWA,4CAgBC;AAlBY,QAAA,gBAAgB,GAAG,sBAAsB,CAAC;AAEhD,KAAK,UAAU,gBAAgB,CAErC,MAA2B,EAC3B,QAAgB,EAChB,OAAgC,SAAS,EACzC,KAAkB,EAAE;IAEpB,MAAM,OAAO,GAAwB;QACpC,MAAM;QACN,GAAG,EAAE,GAAG,wBAAgB,GAAG,QAAQ,EAAE;QACrC,EAAE;QACF,IAAI;QACJ,IAAI,EAAE,IAAI;KACV,CAAC;IAEF,OAAO,IAAI,CAAC,OAAO,CAAC,6BAA6B,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;AACpF,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-ldxhub",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "n8n community node for LDX hub — AI-powered XLIFF translation refinement (RefineLoop)",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://ldxlab.io/ldxhub",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/ldxhub-io/n8n-nodes-ldxhub/issues"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"n8n-community-node-package",
|
|
12
|
+
"n8n",
|
|
13
|
+
"ldxhub",
|
|
14
|
+
"ldx-hub",
|
|
15
|
+
"refineloop",
|
|
16
|
+
"translation",
|
|
17
|
+
"xliff",
|
|
18
|
+
"xlf",
|
|
19
|
+
"localization",
|
|
20
|
+
"ai-translation"
|
|
21
|
+
],
|
|
22
|
+
"author": {
|
|
23
|
+
"name": "ldxhub-io",
|
|
24
|
+
"email": "ki_cs@k-intl.co.jp"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/ldxhub-io/n8n-nodes-ldxhub.git"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "n8n-node build",
|
|
32
|
+
"build:watch": "tsc --watch",
|
|
33
|
+
"dev": "n8n-node dev",
|
|
34
|
+
"lint": "n8n-node lint",
|
|
35
|
+
"lint:fix": "n8n-node lint --fix",
|
|
36
|
+
"release": "n8n-node release",
|
|
37
|
+
"prepublishOnly": "n8n-node prerelease"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist"
|
|
41
|
+
],
|
|
42
|
+
"n8n": {
|
|
43
|
+
"n8nNodesApiVersion": 1,
|
|
44
|
+
"strict": true,
|
|
45
|
+
"credentials": [
|
|
46
|
+
"dist/credentials/LdxHubApi.credentials.js"
|
|
47
|
+
],
|
|
48
|
+
"nodes": [
|
|
49
|
+
"dist/nodes/LdxHub/LdxHub.node.js"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@n8n/node-cli": "*",
|
|
54
|
+
"eslint": "9.39.4",
|
|
55
|
+
"prettier": "3.8.1",
|
|
56
|
+
"release-it": "19.2.4",
|
|
57
|
+
"typescript": "5.9.3"
|
|
58
|
+
},
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">=20.15"
|
|
61
|
+
},
|
|
62
|
+
"publishConfig": {
|
|
63
|
+
"access": "public",
|
|
64
|
+
"provenance": true
|
|
65
|
+
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"n8n-workflow": "*"
|
|
68
|
+
}
|
|
69
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-ldxhub",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "n8n community node for LDX hub — AI-powered XLIFF translation refinement (RefineLoop)",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://ldxlab.io/ldxhub",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/ldxhub-io/n8n-nodes-ldxhub/issues"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"n8n-community-node-package",
|
|
12
|
+
"n8n",
|
|
13
|
+
"ldxhub",
|
|
14
|
+
"ldx-hub",
|
|
15
|
+
"refineloop",
|
|
16
|
+
"translation",
|
|
17
|
+
"xliff",
|
|
18
|
+
"xlf",
|
|
19
|
+
"localization",
|
|
20
|
+
"ai-translation"
|
|
21
|
+
],
|
|
22
|
+
"author": {
|
|
23
|
+
"name": "ldxhub-io",
|
|
24
|
+
"email": "ki_cs@k-intl.co.jp"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/ldxhub-io/n8n-nodes-ldxhub.git"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "n8n-node build",
|
|
32
|
+
"build:watch": "tsc --watch",
|
|
33
|
+
"dev": "n8n-node dev",
|
|
34
|
+
"lint": "n8n-node lint",
|
|
35
|
+
"lint:fix": "n8n-node lint --fix",
|
|
36
|
+
"release": "n8n-node release",
|
|
37
|
+
"prepublishOnly": "n8n-node prerelease"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist"
|
|
41
|
+
],
|
|
42
|
+
"n8n": {
|
|
43
|
+
"n8nNodesApiVersion": 1,
|
|
44
|
+
"strict": true,
|
|
45
|
+
"credentials": [
|
|
46
|
+
"dist/credentials/LdxHubApi.credentials.js"
|
|
47
|
+
],
|
|
48
|
+
"nodes": [
|
|
49
|
+
"dist/nodes/LdxHub/LdxHub.node.js"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@n8n/node-cli": "*",
|
|
54
|
+
"eslint": "9.39.4",
|
|
55
|
+
"prettier": "3.8.1",
|
|
56
|
+
"release-it": "19.2.4",
|
|
57
|
+
"typescript": "5.9.3"
|
|
58
|
+
},
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">=20.15"
|
|
61
|
+
},
|
|
62
|
+
"publishConfig": {
|
|
63
|
+
"access": "public",
|
|
64
|
+
"provenance": true
|
|
65
|
+
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"n8n-workflow": "*"
|
|
68
|
+
}
|
|
69
|
+
}
|