n8n-nodes-trustmarkt 0.2.1 → 0.3.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/README.md +44 -1
- package/dist/nodes/Trustmarkt/Trustmarkt.node.d.ts +7 -0
- package/dist/nodes/Trustmarkt/Trustmarkt.node.js +8 -1
- package/dist/nodes/Trustmarkt/Trustmarkt.node.js.map +1 -1
- package/dist/nodes/Trustmarkt/resources/article/index.js +9 -0
- package/dist/nodes/Trustmarkt/resources/article/index.js.map +1 -1
- package/dist/nodes/Trustmarkt/resources/article/operations/create.d.ts +3 -0
- package/dist/nodes/Trustmarkt/resources/article/operations/create.js +57 -0
- package/dist/nodes/Trustmarkt/resources/article/operations/create.js.map +1 -0
- package/dist/nodes/Trustmarkt/resources/article/operations/fields.d.ts +2 -0
- package/dist/nodes/Trustmarkt/resources/article/operations/fields.js +61 -0
- package/dist/nodes/Trustmarkt/resources/article/operations/fields.js.map +1 -0
- package/dist/nodes/Trustmarkt/resources/article/operations/startAiGeneration.d.ts +3 -0
- package/dist/nodes/Trustmarkt/resources/article/operations/startAiGeneration.js +40 -0
- package/dist/nodes/Trustmarkt/resources/article/operations/startAiGeneration.js.map +1 -0
- package/dist/nodes/Trustmarkt/resources/article/operations/update.d.ts +3 -0
- package/dist/nodes/Trustmarkt/resources/article/operations/update.js +66 -0
- package/dist/nodes/Trustmarkt/resources/article/operations/update.js.map +1 -0
- package/dist/nodes/Trustmarkt/resources/caseStudy/index.js +9 -0
- package/dist/nodes/Trustmarkt/resources/caseStudy/index.js.map +1 -1
- package/dist/nodes/Trustmarkt/resources/caseStudy/operations/create.d.ts +3 -0
- package/dist/nodes/Trustmarkt/resources/caseStudy/operations/create.js +71 -0
- package/dist/nodes/Trustmarkt/resources/caseStudy/operations/create.js.map +1 -0
- package/dist/nodes/Trustmarkt/resources/caseStudy/operations/startAiGeneration.d.ts +3 -0
- package/dist/nodes/Trustmarkt/resources/caseStudy/operations/startAiGeneration.js +40 -0
- package/dist/nodes/Trustmarkt/resources/caseStudy/operations/startAiGeneration.js.map +1 -0
- package/dist/nodes/Trustmarkt/resources/caseStudy/operations/update.d.ts +3 -0
- package/dist/nodes/Trustmarkt/resources/caseStudy/operations/update.js +414 -0
- package/dist/nodes/Trustmarkt/resources/caseStudy/operations/update.js.map +1 -0
- package/dist/nodes/Trustmarkt/shared/aiGeneration.d.ts +2 -0
- package/dist/nodes/Trustmarkt/shared/aiGeneration.js +98 -0
- package/dist/nodes/Trustmarkt/shared/aiGeneration.js.map +1 -0
- package/dist/nodes/Trustmarkt/shared/listSearch.d.ts +11 -0
- package/dist/nodes/Trustmarkt/shared/listSearch.js +72 -0
- package/dist/nodes/Trustmarkt/shared/listSearch.js.map +1 -0
- package/dist/nodes/Trustmarkt/shared/transport.d.ts +4 -0
- package/dist/nodes/Trustmarkt/shared/transport.js +123 -1
- package/dist/nodes/Trustmarkt/shared/transport.js.map +1 -1
- package/dist/package.json +4 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -19,11 +19,17 @@ Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes
|
|
|
19
19
|
### Trustmarkt Node
|
|
20
20
|
|
|
21
21
|
- **Article**
|
|
22
|
+
- Create an article draft (title, optional Markdown content, author, category from a list, thumbnail alt text)
|
|
22
23
|
- Get an article
|
|
23
24
|
- Get many articles
|
|
25
|
+
- Start AI generation for an article (from a YouTube video or a text)
|
|
26
|
+
- Update an article (draft or rejected articles only)
|
|
24
27
|
- **Case Study**
|
|
28
|
+
- Create a case study draft (title, optional customer name)
|
|
25
29
|
- Get a case study
|
|
26
30
|
- Get many case studies
|
|
31
|
+
- Start AI generation for a case study (from a YouTube video or a text)
|
|
32
|
+
- Update a case study (texts as Markdown, customer details, customer industry from a list, dates, 'Is Ongoing', sections, tags)
|
|
27
33
|
- **Inquiry**
|
|
28
34
|
- Get an inquiry
|
|
29
35
|
- Get many inquiries
|
|
@@ -44,6 +50,8 @@ Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes
|
|
|
44
50
|
- Get a user
|
|
45
51
|
- Get many users
|
|
46
52
|
|
|
53
|
+
Article and case study outputs include `ai_generation` (`status`: `none`, `running`, `completed` or `failed`, plus `source`, `started_at`, `completed_at`, `failed_at` and `error`). Case studies also include `is_ongoing` (the collaboration still runs, so there is no end date).
|
|
54
|
+
|
|
47
55
|
### Trustmarkt Trigger Node
|
|
48
56
|
|
|
49
57
|
Starts the workflow when Trustmarkt events occur via webhooks. Events are loaded dynamically from the API, so newly added events (e.g. `lead.created`, `lead.verified`, `resource.published`) are available without updating this package.
|
|
@@ -56,7 +64,42 @@ You need a Trustmarkt API key to authenticate.
|
|
|
56
64
|
2. Navigate to your API settings and generate an API key.
|
|
57
65
|
3. In n8n, create new **Trustmarkt API** credentials and paste your API key.
|
|
58
66
|
|
|
59
|
-
The
|
|
67
|
+
The credential is tested against `GET /me` when you save it.
|
|
68
|
+
|
|
69
|
+
## Usage
|
|
70
|
+
|
|
71
|
+
### Let the Trustmarkt AI write an article or case study
|
|
72
|
+
|
|
73
|
+
The AI generation runs in the background and usually takes two to three minutes, so the workflow starts it, waits, and then checks the result:
|
|
74
|
+
|
|
75
|
+
1. **Trustmarkt** → *Case Study* → *Create*: enter a **Title** (for an article: *Article* → *Create*). Rename this node to `Create Case Study`.
|
|
76
|
+
2. **Trustmarkt** → *Case Study* → *Start AI Generation*: set **Case Study ID** to `{{ $json.id }}`, pick the **Source**:
|
|
77
|
+
- *YouTube Video*: the **YouTube URL** of the video, or
|
|
78
|
+
- *Text*: an interview, notes or a transcript with **at least 100 words** (max 50,000 characters).
|
|
79
|
+
3. **Wait** node: about 3 minutes.
|
|
80
|
+
4. **Trustmarkt** → *Case Study* → *Get*: set **Case Study ID** to `{{ $('Create Case Study').item.json.id }}`.
|
|
81
|
+
5. **If** node on `{{ $json.ai_generation.status }}`:
|
|
82
|
+
- `completed`: the draft is written; review and publish it in Trustmarkt.
|
|
83
|
+
- `running`: loop back to the Wait node.
|
|
84
|
+
- `failed`: `ai_generation.error` says why. Start the generation again (step 2). A generation that runs longer than 5 minutes counts as `failed`.
|
|
85
|
+
|
|
86
|
+
Only drafts can be written by the AI (for articles also rejected ones). The AI replaces the title and content of an article, and the texts, metrics and customer name of a case study.
|
|
87
|
+
|
|
88
|
+
### Limits and error messages
|
|
89
|
+
|
|
90
|
+
- A company can run at most **5 AI generations at the same time** (articles and case studies together) and has a **daily limit** shared with the Trustmarkt web app.
|
|
91
|
+
- A company can have at most **50 case study drafts** and **50 articles** in draft, submitted or rejected status.
|
|
92
|
+
- When Trustmarkt refuses a request, the node shows what happened and how to continue, the fields it rejected, and the API's own `message` and `reason` (`not_editable`, `already_running`, `too_many_running`, `daily_limit`, `start_failed`). Use the node setting *On Error → Continue* to handle these cases in the workflow.
|
|
93
|
+
- **Customer Industry** (case study) and **Category** (article) can be picked *From List* (loaded from `GET /industries` and `GET /article-categories`, the same choices as in the Trustmarkt web app) or entered *By ID*.
|
|
94
|
+
- Images (thumbnails, logos, images in the text), case study metrics and the linked review can only be changed in the Trustmarkt web app.
|
|
95
|
+
|
|
96
|
+
## Releasing (maintainers)
|
|
97
|
+
|
|
98
|
+
Releases are published to npm by the GitHub Actions workflow `.github/workflows/publish.yml` with an npm provenance statement, as n8n requires for community nodes. Never run `npm publish` locally.
|
|
99
|
+
|
|
100
|
+
1. Move the `[Unreleased]` entry in `CHANGELOG.md` to the new version and commit.
|
|
101
|
+
2. Run `npm run release:patch`, `npm run release:minor` or `npm run release:major`. This lints, builds, bumps the version, creates the tag `vX.Y.Z` and pushes it.
|
|
102
|
+
3. The tag push starts the workflow, which lints, builds and runs `npm publish --provenance --access public`.
|
|
60
103
|
|
|
61
104
|
## Compatibility
|
|
62
105
|
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { type INodeType, type INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
import { searchArticleCategories, searchIndustries } from './shared/listSearch';
|
|
2
3
|
export declare class Trustmarkt implements INodeType {
|
|
3
4
|
description: INodeTypeDescription;
|
|
5
|
+
methods: {
|
|
6
|
+
listSearch: {
|
|
7
|
+
searchArticleCategories: typeof searchArticleCategories;
|
|
8
|
+
searchIndustries: typeof searchIndustries;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
4
11
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Trustmarkt = void 0;
|
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const listSearch_1 = require("./shared/listSearch");
|
|
5
6
|
const article_1 = require("./resources/article");
|
|
6
7
|
const caseStudy_1 = require("./resources/caseStudy");
|
|
7
8
|
const inquiry_1 = require("./resources/inquiry");
|
|
@@ -67,7 +68,7 @@ class Trustmarkt {
|
|
|
67
68
|
group: ['transform'],
|
|
68
69
|
version: 1,
|
|
69
70
|
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
70
|
-
description: 'Interact with the Trustmarkt API to manage reviews, leads, resources, users, case studies, and more',
|
|
71
|
+
description: 'Interact with the Trustmarkt API to manage reviews, leads, resources, users, articles, case studies, and more',
|
|
71
72
|
defaults: {
|
|
72
73
|
name: 'Trustmarkt',
|
|
73
74
|
},
|
|
@@ -116,6 +117,12 @@ class Trustmarkt {
|
|
|
116
117
|
...user_1.userFields,
|
|
117
118
|
],
|
|
118
119
|
};
|
|
120
|
+
this.methods = {
|
|
121
|
+
listSearch: {
|
|
122
|
+
searchArticleCategories: listSearch_1.searchArticleCategories,
|
|
123
|
+
searchIndustries: listSearch_1.searchIndustries,
|
|
124
|
+
},
|
|
125
|
+
};
|
|
119
126
|
}
|
|
120
127
|
}
|
|
121
128
|
exports.Trustmarkt = Trustmarkt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Trustmarkt.node.js","sourceRoot":"","sources":["../../../nodes/Trustmarkt/Trustmarkt.node.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Trustmarkt.node.js","sourceRoot":"","sources":["../../../nodes/Trustmarkt/Trustmarkt.node.ts"],"names":[],"mappings":";;;AAkCA,+CAIsB;AAEtB,oDAAgF;AAGhF,iDAAuE;AACvE,qDAA6E;AAC7E,iDAAuE;AACvE,2CAA8D;AAC9D,uCAAwD;AACxD,mDAA0E;AAC1E,+CAAoE;AACpE,iEAA+F;AAC/F,2CAA8D;AAM9D,MAAM,eAAe,GAAG;IACpB;QACI,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,iCAAiC;KACjD;IACD;QACI,IAAI,EAAE,YAAY;QAClB,KAAK,EAAE,WAAW;QAClB,WAAW,EAAE,qCAAqC;KACrD;IACD;QACI,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,oDAAoD;KACpE;IACD;QACI,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,MAAM;QACb,WAAW,EAAE,+DAA+D;KAC/E;IACD;QACI,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,IAAI;QACX,WAAW,EAAE,8CAA8C;KAC9D;IACD;QACI,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,iDAAiD;KACjE;IACD;QACI,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,QAAQ;QACf,WAAW,EAAE,2CAA2C;KAC3D;IACD;QACI,IAAI,EAAE,kBAAkB;QACxB,KAAK,EAAE,iBAAiB;QACxB,WAAW,EAAE,sFAAsF;KACtG;IACD;QACI,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,MAAM;QACb,WAAW,EAAE,8BAA8B;KAC9C;CACJ,CAAC;AAEF,MAAa,UAAU;IAAvB;QACI,gBAAW,GAAyB;YAIhC,WAAW,EAAE,YAAY;YACzB,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,EAAE,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,0BAA0B,EAAE;YACxE,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,+GAA+G;YAE5H,QAAQ,EAAE;gBACN,IAAI,EAAE,YAAY;aACrB;YAKD,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,YAAY,EAAE,IAAI;YAKlB,WAAW,EAAE;gBACT;oBACI,IAAI,EAAE,eAAe;oBACrB,QAAQ,EAAE,IAAI;iBACjB;aACJ;YAKD,eAAe,EAAE;gBACb,OAAO,EAAE,8BAA8B;gBACvC,OAAO,EAAE;oBACL,MAAM,EAAE,kBAAkB;oBAC1B,cAAc,EAAE,kBAAkB;iBACrC;aACJ;YAKD,UAAU,EAAE;gBAIR;oBACI,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE,eAAe;oBACxB,OAAO,EAAE,QAAQ;iBACpB;gBAMD,GAAG,2BAAiB;gBACpB,GAAG,uBAAa;gBAEhB,GAAG,+BAAmB;gBACtB,GAAG,2BAAe;gBAElB,GAAG,2BAAiB;gBACpB,GAAG,uBAAa;gBAEhB,GAAG,qBAAc;gBACjB,GAAG,iBAAU;gBAEb,GAAG,iBAAY;gBACf,GAAG,aAAQ;gBAEX,GAAG,6BAAkB;gBACrB,GAAG,yBAAc;gBAEjB,GAAG,yBAAgB;gBACnB,GAAG,qBAAY;gBAEf,GAAG,2CAAyB;gBAC5B,GAAG,uCAAqB;gBAExB,GAAG,qBAAc;gBACjB,GAAG,iBAAU;aAChB;SACJ,CAAC;QAKF,YAAO,GAAG;YACN,UAAU,EAAE;gBACR,uBAAuB,EAAvB,oCAAuB;gBACvB,gBAAgB,EAAhB,6BAAgB;aACnB;SACJ,CAAC;IACN,CAAC;CAAA;AAvGD,gCAuGC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.articleFields = exports.articleOperations = void 0;
|
|
4
|
+
const create_1 = require("./operations/create");
|
|
4
5
|
const get_1 = require("./operations/get");
|
|
5
6
|
const list_1 = require("./operations/list");
|
|
7
|
+
const startAiGeneration_1 = require("./operations/startAiGeneration");
|
|
8
|
+
const update_1 = require("./operations/update");
|
|
6
9
|
const showForArticle = {
|
|
7
10
|
resource: ['article'],
|
|
8
11
|
};
|
|
@@ -16,14 +19,20 @@ exports.articleOperations = [
|
|
|
16
19
|
show: showForArticle,
|
|
17
20
|
},
|
|
18
21
|
options: [
|
|
22
|
+
create_1.createArticleOperation,
|
|
19
23
|
get_1.getArticleOperation,
|
|
20
24
|
list_1.listArticleOperation,
|
|
25
|
+
startAiGeneration_1.startAiGenerationArticleOperation,
|
|
26
|
+
update_1.updateArticleOperation,
|
|
21
27
|
],
|
|
22
28
|
default: 'getMany',
|
|
23
29
|
},
|
|
24
30
|
];
|
|
25
31
|
exports.articleFields = [
|
|
32
|
+
...create_1.createArticleFields,
|
|
26
33
|
...get_1.getArticleFields,
|
|
27
34
|
...list_1.listArticleFields,
|
|
35
|
+
...startAiGeneration_1.startAiGenerationArticleFields,
|
|
36
|
+
...update_1.updateArticleFields,
|
|
28
37
|
];
|
|
29
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Trustmarkt/resources/article/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Trustmarkt/resources/article/index.ts"],"names":[],"mappings":";;;AAyBA,gDAAkF;AAClF,0CAAyE;AACzE,4CAA4E;AAC5E,sEAGwC;AACxC,gDAAkF;AAKlF,MAAM,cAAc,GAAG;IACnB,QAAQ,EAAE,CAAC,SAAS,CAAC;CACxB,CAAC;AAMW,QAAA,iBAAiB,GAAsB;IAChD;QACI,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACZ,IAAI,EAAE,cAAc;SACvB;QAED,OAAO,EAAE;YACL,+BAAsB;YACtB,yBAAmB;YACnB,2BAAoB;YACpB,qDAAiC;YACjC,+BAAsB;SACzB;QACD,OAAO,EAAE,SAAS;KACrB;CACJ,CAAC;AAMW,QAAA,aAAa,GAAsB;IAE5C,GAAG,4BAAmB;IAGtB,GAAG,sBAAgB;IAGnB,GAAG,wBAAiB;IAGpB,GAAG,kDAA8B;IAGjC,GAAG,4BAAmB;CACzB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createArticleFields = exports.createArticleOperation = void 0;
|
|
4
|
+
const transport_1 = require("../../../shared/transport");
|
|
5
|
+
const fields_1 = require("./fields");
|
|
6
|
+
const showForCreate = {
|
|
7
|
+
resource: ['article'],
|
|
8
|
+
operation: ['create'],
|
|
9
|
+
};
|
|
10
|
+
exports.createArticleOperation = {
|
|
11
|
+
name: 'Create',
|
|
12
|
+
value: 'create',
|
|
13
|
+
action: 'Create an article',
|
|
14
|
+
description: 'Create a new article draft',
|
|
15
|
+
routing: {
|
|
16
|
+
request: {
|
|
17
|
+
method: 'POST',
|
|
18
|
+
url: '/articles',
|
|
19
|
+
ignoreHttpStatusErrors: true,
|
|
20
|
+
},
|
|
21
|
+
output: {
|
|
22
|
+
postReceive: [transport_1.handleTrustmarktApiError],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
exports.createArticleFields = [
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Title',
|
|
29
|
+
name: 'title',
|
|
30
|
+
type: 'string',
|
|
31
|
+
required: true,
|
|
32
|
+
default: '',
|
|
33
|
+
placeholder: 'e.g. 5 ways to win more reviews',
|
|
34
|
+
description: 'The title of the article (3–90 characters). The AI generation may replace it.',
|
|
35
|
+
displayOptions: {
|
|
36
|
+
show: showForCreate,
|
|
37
|
+
},
|
|
38
|
+
routing: {
|
|
39
|
+
send: {
|
|
40
|
+
type: 'body',
|
|
41
|
+
property: 'title',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
displayName: 'Additional Fields',
|
|
47
|
+
name: 'additionalFields',
|
|
48
|
+
type: 'collection',
|
|
49
|
+
placeholder: 'Add Field',
|
|
50
|
+
default: {},
|
|
51
|
+
displayOptions: {
|
|
52
|
+
show: showForCreate,
|
|
53
|
+
},
|
|
54
|
+
options: (0, fields_1.getArticleBodyFields)(),
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../../nodes/Trustmarkt/resources/article/operations/create.ts"],"names":[],"mappings":";;;AAkBA,yDAAqE;AACrE,qCAAgD;AAKhD,MAAM,aAAa,GAAG;IAClB,QAAQ,EAAE,CAAC,SAAS,CAAC;IACrB,SAAS,EAAE,CAAC,QAAQ,CAAC;CACxB,CAAC;AAKW,QAAA,sBAAsB,GAAyB;IACxD,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,mBAAmB;IAC3B,WAAW,EAAE,4BAA4B;IACzC,OAAO,EAAE;QACL,OAAO,EAAE;YACL,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,WAAW;YAChB,sBAAsB,EAAE,IAAI;SAC/B;QACD,MAAM,EAAE;YACJ,WAAW,EAAE,CAAC,oCAAwB,CAAC;SAC1C;KACJ;CACJ,CAAC;AAKW,QAAA,mBAAmB,GAAsB;IAIlD;QACI,WAAW,EAAE,OAAO;QACpB,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,iCAAiC;QAC9C,WAAW,EAAE,+EAA+E;QAC5F,cAAc,EAAE;YACZ,IAAI,EAAE,aAAa;SACtB;QACD,OAAO,EAAE;YACL,IAAI,EAAE;gBACF,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,OAAO;aACpB;SACJ;KACJ;IAKD;QACI,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,WAAW;QACxB,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACZ,IAAI,EAAE,aAAa;SACtB;QACD,OAAO,EAAE,IAAA,6BAAoB,GAAE;KAClC;CACJ,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getArticleBodyFields = getArticleBodyFields;
|
|
4
|
+
const listSearch_1 = require("../../../shared/listSearch");
|
|
5
|
+
function getArticleBodyFields() {
|
|
6
|
+
return [
|
|
7
|
+
{
|
|
8
|
+
displayName: 'Author ID',
|
|
9
|
+
name: 'authorId',
|
|
10
|
+
type: 'string',
|
|
11
|
+
default: '',
|
|
12
|
+
placeholder: 'e.g. 5GdkVeN8ZLaw29zBDXyb',
|
|
13
|
+
description: "The ID of the user who wrote the article, see 'User → Get Many'. Defaults to the user of the API key.",
|
|
14
|
+
routing: {
|
|
15
|
+
send: {
|
|
16
|
+
type: 'body',
|
|
17
|
+
property: 'author_id',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
(0, listSearch_1.getListResourceLocator)({
|
|
22
|
+
displayName: 'Category',
|
|
23
|
+
name: 'categoryId',
|
|
24
|
+
description: 'The category of the article. Choose one from the list or enter its ID; leave empty for no category.',
|
|
25
|
+
searchListMethod: 'searchArticleCategories',
|
|
26
|
+
placeholder: 'e.g. gYW1KaOqEpMdeMQrlwpV',
|
|
27
|
+
bodyProperty: 'category_id',
|
|
28
|
+
}),
|
|
29
|
+
{
|
|
30
|
+
displayName: 'Content',
|
|
31
|
+
name: 'content',
|
|
32
|
+
type: 'string',
|
|
33
|
+
default: '',
|
|
34
|
+
typeOptions: {
|
|
35
|
+
rows: 8,
|
|
36
|
+
},
|
|
37
|
+
description: 'The content as Markdown (headings H2–H4, bold, italic, links, lists, dividers), max 50,000 characters. HTML tags are removed; images can only be added in the Trustmarkt web app.',
|
|
38
|
+
routing: {
|
|
39
|
+
send: {
|
|
40
|
+
type: 'body',
|
|
41
|
+
property: 'content',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
displayName: 'Thumbnail Alt Text',
|
|
47
|
+
name: 'thumbnailAlt',
|
|
48
|
+
type: 'string',
|
|
49
|
+
default: '',
|
|
50
|
+
placeholder: 'e.g. A team planning a review campaign',
|
|
51
|
+
description: 'The alternative text of the article thumbnail (max 90 characters)',
|
|
52
|
+
routing: {
|
|
53
|
+
send: {
|
|
54
|
+
type: 'body',
|
|
55
|
+
property: 'thumbnail_alt',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../nodes/Trustmarkt/resources/article/operations/fields.ts"],"names":[],"mappings":";;AAcA,oDA0DC;AA/DD,2DAAoE;AAKpE,SAAgB,oBAAoB;IAChC,OAAO;QACH;YACI,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,2BAA2B;YACxC,WAAW,EACP,uGAAuG;YAC3G,OAAO,EAAE;gBACL,IAAI,EAAE;oBACF,IAAI,EAAE,MAAM;oBACZ,QAAQ,EAAE,WAAW;iBACxB;aACJ;SACJ;QACD,IAAA,mCAAsB,EAAC;YACnB,WAAW,EAAE,UAAU;YACvB,IAAI,EAAE,YAAY;YAClB,WAAW,EACP,qGAAqG;YACzG,gBAAgB,EAAE,yBAAyB;YAC3C,WAAW,EAAE,2BAA2B;YACxC,YAAY,EAAE,aAAa;SAC9B,CAAC;QACF;YACI,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,WAAW,EAAE;gBACT,IAAI,EAAE,CAAC;aACV;YACD,WAAW,EACP,mLAAmL;YACvL,OAAO,EAAE;gBACL,IAAI,EAAE;oBACF,IAAI,EAAE,MAAM;oBACZ,QAAQ,EAAE,SAAS;iBACtB;aACJ;SACJ;QACD;YACI,WAAW,EAAE,oBAAoB;YACjC,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,wCAAwC;YACrD,WAAW,EAAE,mEAAmE;YAChF,OAAO,EAAE;gBACL,IAAI,EAAE;oBACF,IAAI,EAAE,MAAM;oBACZ,QAAQ,EAAE,eAAe;iBAC5B;aACJ;SACJ;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.startAiGenerationArticleFields = exports.startAiGenerationArticleOperation = void 0;
|
|
4
|
+
const aiGeneration_1 = require("../../../shared/aiGeneration");
|
|
5
|
+
const transport_1 = require("../../../shared/transport");
|
|
6
|
+
const showForStart = {
|
|
7
|
+
resource: ['article'],
|
|
8
|
+
operation: ['startAiGeneration'],
|
|
9
|
+
};
|
|
10
|
+
exports.startAiGenerationArticleOperation = {
|
|
11
|
+
name: 'Start AI Generation',
|
|
12
|
+
value: 'startAiGeneration',
|
|
13
|
+
action: 'Start AI generation for an article',
|
|
14
|
+
description: 'Let the Trustmarkt AI write an article draft from a YouTube video or a text',
|
|
15
|
+
routing: {
|
|
16
|
+
request: {
|
|
17
|
+
method: 'POST',
|
|
18
|
+
url: '=/articles/{{ $parameter.articleId }}/ai-generation',
|
|
19
|
+
ignoreHttpStatusErrors: true,
|
|
20
|
+
},
|
|
21
|
+
output: {
|
|
22
|
+
postReceive: [transport_1.handleTrustmarktApiError],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
exports.startAiGenerationArticleFields = [
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Article ID',
|
|
29
|
+
name: 'articleId',
|
|
30
|
+
type: 'string',
|
|
31
|
+
required: true,
|
|
32
|
+
default: '',
|
|
33
|
+
description: 'The unique identifier of the article draft the AI should write',
|
|
34
|
+
displayOptions: {
|
|
35
|
+
show: showForStart,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
...(0, aiGeneration_1.getAiGenerationFields)('article', 'article', 'the title and the content'),
|
|
39
|
+
];
|
|
40
|
+
//# sourceMappingURL=startAiGeneration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"startAiGeneration.js","sourceRoot":"","sources":["../../../../../../nodes/Trustmarkt/resources/article/operations/startAiGeneration.ts"],"names":[],"mappings":";;;AAgBA,+DAAqE;AACrE,yDAAqE;AAKrE,MAAM,YAAY,GAAG;IACjB,QAAQ,EAAE,CAAC,SAAS,CAAC;IACrB,SAAS,EAAE,CAAC,mBAAmB,CAAC;CACnC,CAAC;AAKW,QAAA,iCAAiC,GAAyB;IACnE,IAAI,EAAE,qBAAqB;IAC3B,KAAK,EAAE,mBAAmB;IAC1B,MAAM,EAAE,oCAAoC;IAC5C,WAAW,EAAE,6EAA6E;IAC1F,OAAO,EAAE;QACL,OAAO,EAAE;YACL,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,qDAAqD;YAC1D,sBAAsB,EAAE,IAAI;SAC/B;QACD,MAAM,EAAE;YACJ,WAAW,EAAE,CAAC,oCAAwB,CAAC;SAC1C;KACJ;CACJ,CAAC;AAKW,QAAA,8BAA8B,GAAsB;IAI7D;QACI,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,gEAAgE;QAC7E,cAAc,EAAE;YACZ,IAAI,EAAE,YAAY;SACrB;KACJ;IACD,GAAG,IAAA,oCAAqB,EAAC,SAAS,EAAE,SAAS,EAAE,2BAA2B,CAAC;CAC9E,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateArticleFields = exports.updateArticleOperation = void 0;
|
|
4
|
+
const transport_1 = require("../../../shared/transport");
|
|
5
|
+
const fields_1 = require("./fields");
|
|
6
|
+
const showForUpdate = {
|
|
7
|
+
resource: ['article'],
|
|
8
|
+
operation: ['update'],
|
|
9
|
+
};
|
|
10
|
+
exports.updateArticleOperation = {
|
|
11
|
+
name: 'Update',
|
|
12
|
+
value: 'update',
|
|
13
|
+
action: 'Update an article',
|
|
14
|
+
description: 'Change the title, content or details of a draft or rejected article',
|
|
15
|
+
routing: {
|
|
16
|
+
request: {
|
|
17
|
+
method: 'PUT',
|
|
18
|
+
url: '=/articles/{{ $parameter.articleId }}',
|
|
19
|
+
ignoreHttpStatusErrors: true,
|
|
20
|
+
},
|
|
21
|
+
output: {
|
|
22
|
+
postReceive: [transport_1.handleTrustmarktApiError],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
exports.updateArticleFields = [
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Article ID',
|
|
29
|
+
name: 'articleId',
|
|
30
|
+
type: 'string',
|
|
31
|
+
required: true,
|
|
32
|
+
default: '',
|
|
33
|
+
description: 'The unique identifier of the article to update. Only drafts and rejected articles can be changed.',
|
|
34
|
+
displayOptions: {
|
|
35
|
+
show: showForUpdate,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
displayName: 'Update Fields',
|
|
40
|
+
name: 'updateFields',
|
|
41
|
+
type: 'collection',
|
|
42
|
+
placeholder: 'Add Field',
|
|
43
|
+
default: {},
|
|
44
|
+
displayOptions: {
|
|
45
|
+
show: showForUpdate,
|
|
46
|
+
},
|
|
47
|
+
options: [
|
|
48
|
+
...(0, fields_1.getArticleBodyFields)(),
|
|
49
|
+
{
|
|
50
|
+
displayName: 'Title',
|
|
51
|
+
name: 'title',
|
|
52
|
+
type: 'string',
|
|
53
|
+
default: '',
|
|
54
|
+
placeholder: 'e.g. 5 ways to win more reviews',
|
|
55
|
+
description: 'The title of the article (10–90 characters)',
|
|
56
|
+
routing: {
|
|
57
|
+
send: {
|
|
58
|
+
type: 'body',
|
|
59
|
+
property: 'title',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../../../nodes/Trustmarkt/resources/article/operations/update.ts"],"names":[],"mappings":";;;AAeA,yDAAqE;AACrE,qCAAgD;AAKhD,MAAM,aAAa,GAAG;IAClB,QAAQ,EAAE,CAAC,SAAS,CAAC;IACrB,SAAS,EAAE,CAAC,QAAQ,CAAC;CACxB,CAAC;AAKW,QAAA,sBAAsB,GAAyB;IACxD,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,mBAAmB;IAC3B,WAAW,EAAE,qEAAqE;IAClF,OAAO,EAAE;QACL,OAAO,EAAE;YACL,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,uCAAuC;YAC5C,sBAAsB,EAAE,IAAI;SAC/B;QACD,MAAM,EAAE;YACJ,WAAW,EAAE,CAAC,oCAAwB,CAAC;SAC1C;KACJ;CACJ,CAAC;AAKW,QAAA,mBAAmB,GAAsB;IAIlD;QACI,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,mGAAmG;QAChH,cAAc,EAAE;YACZ,IAAI,EAAE,aAAa;SACtB;KACJ;IAKD;QACI,WAAW,EAAE,eAAe;QAC5B,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,WAAW;QACxB,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACZ,IAAI,EAAE,aAAa;SACtB;QACD,OAAO,EAAE;YACL,GAAG,IAAA,6BAAoB,GAAE;YACzB;gBACI,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,iCAAiC;gBAC9C,WAAW,EAAE,6CAA6C;gBAC1D,OAAO,EAAE;oBACL,IAAI,EAAE;wBACF,IAAI,EAAE,MAAM;wBACZ,QAAQ,EAAE,OAAO;qBACpB;iBACJ;aACJ;SACJ;KACJ;CACJ,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.caseStudyFields = exports.caseStudyOperations = void 0;
|
|
4
|
+
const create_1 = require("./operations/create");
|
|
4
5
|
const get_1 = require("./operations/get");
|
|
5
6
|
const list_1 = require("./operations/list");
|
|
7
|
+
const startAiGeneration_1 = require("./operations/startAiGeneration");
|
|
8
|
+
const update_1 = require("./operations/update");
|
|
6
9
|
const showForCaseStudy = {
|
|
7
10
|
resource: ['caseStudy'],
|
|
8
11
|
};
|
|
@@ -16,14 +19,20 @@ exports.caseStudyOperations = [
|
|
|
16
19
|
show: showForCaseStudy,
|
|
17
20
|
},
|
|
18
21
|
options: [
|
|
22
|
+
create_1.createCaseStudyOperation,
|
|
19
23
|
get_1.getCaseStudyOperation,
|
|
20
24
|
list_1.listCaseStudyOperation,
|
|
25
|
+
startAiGeneration_1.startAiGenerationCaseStudyOperation,
|
|
26
|
+
update_1.updateCaseStudyOperation,
|
|
21
27
|
],
|
|
22
28
|
default: 'getMany',
|
|
23
29
|
},
|
|
24
30
|
];
|
|
25
31
|
exports.caseStudyFields = [
|
|
32
|
+
...create_1.createCaseStudyFields,
|
|
26
33
|
...get_1.getCaseStudyFields,
|
|
27
34
|
...list_1.listCaseStudyFields,
|
|
35
|
+
...startAiGeneration_1.startAiGenerationCaseStudyFields,
|
|
36
|
+
...update_1.updateCaseStudyFields,
|
|
28
37
|
];
|
|
29
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Trustmarkt/resources/caseStudy/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Trustmarkt/resources/caseStudy/index.ts"],"names":[],"mappings":";;;AAyBA,gDAAsF;AACtF,0CAA6E;AAC7E,4CAAgF;AAChF,sEAGwC;AACxC,gDAAsF;AAKtF,MAAM,gBAAgB,GAAG;IACrB,QAAQ,EAAE,CAAC,WAAW,CAAC;CAC1B,CAAC;AAMW,QAAA,mBAAmB,GAAsB;IAClD;QACI,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACZ,IAAI,EAAE,gBAAgB;SACzB;QAED,OAAO,EAAE;YACL,iCAAwB;YACxB,2BAAqB;YACrB,6BAAsB;YACtB,uDAAmC;YACnC,iCAAwB;SAC3B;QACD,OAAO,EAAE,SAAS;KACrB;CACJ,CAAC;AAMW,QAAA,eAAe,GAAsB;IAE9C,GAAG,8BAAqB;IAGxB,GAAG,wBAAkB;IAGrB,GAAG,0BAAmB;IAGtB,GAAG,oDAAgC;IAGnC,GAAG,8BAAqB;CAC3B,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createCaseStudyFields = exports.createCaseStudyOperation = void 0;
|
|
4
|
+
const transport_1 = require("../../../shared/transport");
|
|
5
|
+
const showForCreate = {
|
|
6
|
+
resource: ['caseStudy'],
|
|
7
|
+
operation: ['create'],
|
|
8
|
+
};
|
|
9
|
+
exports.createCaseStudyOperation = {
|
|
10
|
+
name: 'Create',
|
|
11
|
+
value: 'create',
|
|
12
|
+
action: 'Create a case study',
|
|
13
|
+
description: 'Create a new case study draft',
|
|
14
|
+
routing: {
|
|
15
|
+
request: {
|
|
16
|
+
method: 'POST',
|
|
17
|
+
url: '/case-studies',
|
|
18
|
+
ignoreHttpStatusErrors: true,
|
|
19
|
+
},
|
|
20
|
+
output: {
|
|
21
|
+
postReceive: [transport_1.handleTrustmarktApiError],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
exports.createCaseStudyFields = [
|
|
26
|
+
{
|
|
27
|
+
displayName: 'Title',
|
|
28
|
+
name: 'title',
|
|
29
|
+
type: 'string',
|
|
30
|
+
required: true,
|
|
31
|
+
default: '',
|
|
32
|
+
placeholder: 'e.g. Rebranding for Bäckerei Schmidt',
|
|
33
|
+
description: 'The internal title of the case study (3–100 characters). The AI generation may replace it.',
|
|
34
|
+
displayOptions: {
|
|
35
|
+
show: showForCreate,
|
|
36
|
+
},
|
|
37
|
+
routing: {
|
|
38
|
+
send: {
|
|
39
|
+
type: 'body',
|
|
40
|
+
property: 'title',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
displayName: 'Additional Fields',
|
|
46
|
+
name: 'additionalFields',
|
|
47
|
+
type: 'collection',
|
|
48
|
+
placeholder: 'Add Field',
|
|
49
|
+
default: {},
|
|
50
|
+
displayOptions: {
|
|
51
|
+
show: showForCreate,
|
|
52
|
+
},
|
|
53
|
+
options: [
|
|
54
|
+
{
|
|
55
|
+
displayName: 'Customer Name',
|
|
56
|
+
name: 'customerName',
|
|
57
|
+
type: 'string',
|
|
58
|
+
default: '',
|
|
59
|
+
placeholder: 'e.g. Bäckerei Schmidt',
|
|
60
|
+
description: 'The name of the customer the case study is about (3–100 characters). The AI generation fills it in when empty.',
|
|
61
|
+
routing: {
|
|
62
|
+
send: {
|
|
63
|
+
type: 'body',
|
|
64
|
+
property: 'customer_name',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../../nodes/Trustmarkt/resources/caseStudy/operations/create.ts"],"names":[],"mappings":";;;AAeA,yDAAqE;AAKrE,MAAM,aAAa,GAAG;IAClB,QAAQ,EAAE,CAAC,WAAW,CAAC;IACvB,SAAS,EAAE,CAAC,QAAQ,CAAC;CACxB,CAAC;AAKW,QAAA,wBAAwB,GAAyB;IAC1D,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,qBAAqB;IAC7B,WAAW,EAAE,+BAA+B;IAC5C,OAAO,EAAE;QACL,OAAO,EAAE;YACL,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,eAAe;YACpB,sBAAsB,EAAE,IAAI;SAC/B;QACD,MAAM,EAAE;YACJ,WAAW,EAAE,CAAC,oCAAwB,CAAC;SAC1C;KACJ;CACJ,CAAC;AAKW,QAAA,qBAAqB,GAAsB;IAIpD;QACI,WAAW,EAAE,OAAO;QACpB,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,sCAAsC;QACnD,WAAW,EACP,4FAA4F;QAChG,cAAc,EAAE;YACZ,IAAI,EAAE,aAAa;SACtB;QACD,OAAO,EAAE;YACL,IAAI,EAAE;gBACF,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,OAAO;aACpB;SACJ;KACJ;IAKD;QACI,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,WAAW;QACxB,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACZ,IAAI,EAAE,aAAa;SACtB;QACD,OAAO,EAAE;YACL;gBACI,WAAW,EAAE,eAAe;gBAC5B,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,uBAAuB;gBACpC,WAAW,EACP,gHAAgH;gBACpH,OAAO,EAAE;oBACL,IAAI,EAAE;wBACF,IAAI,EAAE,MAAM;wBACZ,QAAQ,EAAE,eAAe;qBAC5B;iBACJ;aACJ;SACJ;KACJ;CACJ,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.startAiGenerationCaseStudyFields = exports.startAiGenerationCaseStudyOperation = void 0;
|
|
4
|
+
const aiGeneration_1 = require("../../../shared/aiGeneration");
|
|
5
|
+
const transport_1 = require("../../../shared/transport");
|
|
6
|
+
const showForStart = {
|
|
7
|
+
resource: ['caseStudy'],
|
|
8
|
+
operation: ['startAiGeneration'],
|
|
9
|
+
};
|
|
10
|
+
exports.startAiGenerationCaseStudyOperation = {
|
|
11
|
+
name: 'Start AI Generation',
|
|
12
|
+
value: 'startAiGeneration',
|
|
13
|
+
action: 'Start AI generation for a case study',
|
|
14
|
+
description: 'Let the Trustmarkt AI write a case study draft from a YouTube video or a text',
|
|
15
|
+
routing: {
|
|
16
|
+
request: {
|
|
17
|
+
method: 'POST',
|
|
18
|
+
url: '=/case-studies/{{ $parameter.caseStudyId }}/ai-generation',
|
|
19
|
+
ignoreHttpStatusErrors: true,
|
|
20
|
+
},
|
|
21
|
+
output: {
|
|
22
|
+
postReceive: [transport_1.handleTrustmarktApiError],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
exports.startAiGenerationCaseStudyFields = [
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Case Study ID',
|
|
29
|
+
name: 'caseStudyId',
|
|
30
|
+
type: 'string',
|
|
31
|
+
required: true,
|
|
32
|
+
default: '',
|
|
33
|
+
description: 'The unique identifier of the case study draft the AI should write',
|
|
34
|
+
displayOptions: {
|
|
35
|
+
show: showForStart,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
...(0, aiGeneration_1.getAiGenerationFields)('caseStudy', 'case study', 'the texts, the metrics and the customer name'),
|
|
39
|
+
];
|
|
40
|
+
//# sourceMappingURL=startAiGeneration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"startAiGeneration.js","sourceRoot":"","sources":["../../../../../../nodes/Trustmarkt/resources/caseStudy/operations/startAiGeneration.ts"],"names":[],"mappings":";;;AAgBA,+DAAqE;AACrE,yDAAqE;AAKrE,MAAM,YAAY,GAAG;IACjB,QAAQ,EAAE,CAAC,WAAW,CAAC;IACvB,SAAS,EAAE,CAAC,mBAAmB,CAAC;CACnC,CAAC;AAKW,QAAA,mCAAmC,GAAyB;IACrE,IAAI,EAAE,qBAAqB;IAC3B,KAAK,EAAE,mBAAmB;IAC1B,MAAM,EAAE,sCAAsC;IAC9C,WAAW,EAAE,+EAA+E;IAC5F,OAAO,EAAE;QACL,OAAO,EAAE;YACL,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,2DAA2D;YAChE,sBAAsB,EAAE,IAAI;SAC/B;QACD,MAAM,EAAE;YACJ,WAAW,EAAE,CAAC,oCAAwB,CAAC;SAC1C;KACJ;CACJ,CAAC;AAKW,QAAA,gCAAgC,GAAsB;IAI/D;QACI,WAAW,EAAE,eAAe;QAC5B,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,mEAAmE;QAChF,cAAc,EAAE;YACZ,IAAI,EAAE,YAAY;SACrB;KACJ;IACD,GAAG,IAAA,oCAAqB,EAAC,WAAW,EAAE,YAAY,EAAE,8CAA8C,CAAC;CACtG,CAAC"}
|