@luzconsulting/n8n-nodes-vibetrack 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/LICENSE.md +19 -0
  2. package/README.md +69 -0
  3. package/dist/credentials/VibeTrackApi.credentials.d.ts +10 -0
  4. package/dist/credentials/VibeTrackApi.credentials.js +48 -0
  5. package/dist/credentials/vibetrack-dark-icon.svg +1 -0
  6. package/dist/credentials/vibetrack-light-icon.svg +1 -0
  7. package/dist/nodes/VibeTrack/VibeTrack.node.d.ts +13 -0
  8. package/dist/nodes/VibeTrack/VibeTrack.node.js +141 -0
  9. package/dist/nodes/VibeTrack/VibeTrack.node.json +18 -0
  10. package/dist/nodes/VibeTrack/actions/apiCall/apiCall.actions.d.ts +2 -0
  11. package/dist/nodes/VibeTrack/actions/apiCall/apiCall.actions.js +35 -0
  12. package/dist/nodes/VibeTrack/actions/apiCall/index.d.ts +3 -0
  13. package/dist/nodes/VibeTrack/actions/apiCall/index.js +105 -0
  14. package/dist/nodes/VibeTrack/actions/attribution/attribution.actions.d.ts +2 -0
  15. package/dist/nodes/VibeTrack/actions/attribution/attribution.actions.js +58 -0
  16. package/dist/nodes/VibeTrack/actions/attribution/index.d.ts +3 -0
  17. package/dist/nodes/VibeTrack/actions/attribution/index.js +105 -0
  18. package/dist/nodes/VibeTrack/actions/conversion/conversion.actions.d.ts +2 -0
  19. package/dist/nodes/VibeTrack/actions/conversion/conversion.actions.js +86 -0
  20. package/dist/nodes/VibeTrack/actions/conversion/index.d.ts +3 -0
  21. package/dist/nodes/VibeTrack/actions/conversion/index.js +193 -0
  22. package/dist/nodes/VibeTrack/actions/project/index.d.ts +3 -0
  23. package/dist/nodes/VibeTrack/actions/project/index.js +22 -0
  24. package/dist/nodes/VibeTrack/actions/project/project.actions.d.ts +2 -0
  25. package/dist/nodes/VibeTrack/actions/project/project.actions.js +16 -0
  26. package/dist/nodes/VibeTrack/actions/resource.selector.d.ts +2 -0
  27. package/dist/nodes/VibeTrack/actions/resource.selector.js +47 -0
  28. package/dist/nodes/VibeTrack/actions/router.d.ts +2 -0
  29. package/dist/nodes/VibeTrack/actions/router.js +31 -0
  30. package/dist/nodes/VibeTrack/actions/team/index.d.ts +3 -0
  31. package/dist/nodes/VibeTrack/actions/team/index.js +104 -0
  32. package/dist/nodes/VibeTrack/actions/team/team.actions.d.ts +2 -0
  33. package/dist/nodes/VibeTrack/actions/team/team.actions.js +37 -0
  34. package/dist/nodes/VibeTrack/actions/trigger/index.d.ts +3 -0
  35. package/dist/nodes/VibeTrack/actions/trigger/index.js +88 -0
  36. package/dist/nodes/VibeTrack/actions/trigger/trigger.actions.d.ts +2 -0
  37. package/dist/nodes/VibeTrack/actions/trigger/trigger.actions.js +31 -0
  38. package/dist/nodes/VibeTrack/actions/webhook/index.d.ts +3 -0
  39. package/dist/nodes/VibeTrack/actions/webhook/index.js +129 -0
  40. package/dist/nodes/VibeTrack/actions/webhook/webhook.actions.d.ts +2 -0
  41. package/dist/nodes/VibeTrack/actions/webhook/webhook.actions.js +83 -0
  42. package/dist/nodes/VibeTrack/helpers/apiclient.d.ts +14 -0
  43. package/dist/nodes/VibeTrack/helpers/apiclient.js +61 -0
  44. package/dist/nodes/VibeTrack/methods/loadOptions/common.loadOptions.d.ts +5 -0
  45. package/dist/nodes/VibeTrack/methods/loadOptions/common.loadOptions.js +86 -0
  46. package/dist/nodes/VibeTrack/methods/loadOptions/index.d.ts +1 -0
  47. package/dist/nodes/VibeTrack/methods/loadOptions/index.js +37 -0
  48. package/dist/nodes/VibeTrack/trigger/VibeTrackTrigger.node.d.ts +19 -0
  49. package/dist/nodes/VibeTrack/trigger/VibeTrackTrigger.node.js +208 -0
  50. package/dist/nodes/VibeTrack/trigger/VibeTrackTrigger.node.json +18 -0
  51. package/dist/nodes/VibeTrack/trigger/trigger.instant.properties.d.ts +2 -0
  52. package/dist/nodes/VibeTrack/trigger/trigger.instant.properties.js +71 -0
  53. package/dist/nodes/VibeTrack/vibetrack-dark-icon.svg +1 -0
  54. package/dist/nodes/VibeTrack/vibetrack-light-icon.svg +1 -0
  55. package/dist/package.json +76 -0
  56. package/package.json +76 -0
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handleConversion = handleConversion;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const apiclient_1 = require("../../helpers/apiclient");
6
+ const PAGE_SIZE = 100;
7
+ async function handleConversion(i, operation) {
8
+ var _a, _b, _c, _d, _e, _f;
9
+ switch (operation) {
10
+ case "getAll": {
11
+ const projectId = (_a = this.getNodeParameter("projectId", i)) === null || _a === void 0 ? void 0 : _a.trim();
12
+ if (!projectId) {
13
+ throw new n8n_workflow_1.ApplicationError("projectId is required.");
14
+ }
15
+ const returnAll = this.getNodeParameter("returnAll", i, false);
16
+ const filters = this.getNodeParameter("filters", i, {});
17
+ const baseQs = {
18
+ projectId,
19
+ from: filters.from,
20
+ to: filters.to,
21
+ triggerId: filters.triggerId,
22
+ email: filters.email,
23
+ };
24
+ const conversions = [];
25
+ const max = returnAll
26
+ ? Number.POSITIVE_INFINITY
27
+ : this.getNodeParameter("limit", i, 50);
28
+ let offset = 0;
29
+ for (;;) {
30
+ const limit = Math.min(PAGE_SIZE, max - conversions.length);
31
+ const data = await (0, apiclient_1.vtRequest)(this, "GET", "/v1/conversions", { qs: { ...baseQs, limit, offset } });
32
+ const page = (_b = data === null || data === void 0 ? void 0 : data.conversions) !== null && _b !== void 0 ? _b : [];
33
+ conversions.push(...page);
34
+ const hasMore = ((_c = data === null || data === void 0 ? void 0 : data.summary) === null || _c === void 0 ? void 0 : _c.hasMore) === true;
35
+ if (!hasMore || conversions.length >= max || page.length === 0) {
36
+ break;
37
+ }
38
+ offset += page.length;
39
+ }
40
+ return conversions;
41
+ }
42
+ case "sendOffline": {
43
+ const projectId = (_d = this.getNodeParameter("projectId", i)) === null || _d === void 0 ? void 0 : _d.trim();
44
+ const triggerId = (_e = this.getNodeParameter("triggerId", i)) === null || _e === void 0 ? void 0 : _e.trim();
45
+ const email = (_f = this.getNodeParameter("email", i)) === null || _f === void 0 ? void 0 : _f.trim();
46
+ if (!projectId || !triggerId || !email) {
47
+ throw new n8n_workflow_1.ApplicationError("projectId, triggerId and email are required.");
48
+ }
49
+ const additionalFields = this.getNodeParameter("additionalFields", i, {});
50
+ const body = { projectId, triggerId, email };
51
+ if (additionalFields.phone)
52
+ body.phone = additionalFields.phone;
53
+ if (additionalFields.eventTime)
54
+ body.eventTime = additionalFields.eventTime;
55
+ if (additionalFields.value !== undefined &&
56
+ additionalFields.value !== null &&
57
+ additionalFields.value !== 0) {
58
+ body.value = additionalFields.value;
59
+ }
60
+ if (additionalFields.currency)
61
+ body.currency = additionalFields.currency;
62
+ if (additionalFields.externalId)
63
+ body.externalId = additionalFields.externalId;
64
+ if (additionalFields.metadata) {
65
+ const rawMetadata = additionalFields.metadata;
66
+ try {
67
+ const metadata = typeof rawMetadata === "string"
68
+ ? JSON.parse(rawMetadata)
69
+ : rawMetadata;
70
+ if (Object.keys(metadata).length) {
71
+ body.metadata = metadata;
72
+ }
73
+ }
74
+ catch {
75
+ throw new n8n_workflow_1.ApplicationError("Metadata must be valid JSON.");
76
+ }
77
+ }
78
+ const data = await (0, apiclient_1.vtRequest)(this, "POST", "/v1/offline-conversions", {
79
+ body,
80
+ });
81
+ return data !== null && data !== void 0 ? data : {};
82
+ }
83
+ default:
84
+ throw new n8n_workflow_1.ApplicationError(`Unsupported conversion operation: ${operation}`);
85
+ }
86
+ }
@@ -0,0 +1,3 @@
1
+ import type { INodeProperties } from "n8n-workflow";
2
+ export declare const conversionOperations: INodeProperties[];
3
+ export declare const conversionFields: INodeProperties[];
@@ -0,0 +1,193 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.conversionFields = exports.conversionOperations = void 0;
4
+ exports.conversionOperations = [
5
+ {
6
+ displayName: "Operation",
7
+ name: "operation",
8
+ type: "options",
9
+ noDataExpression: true,
10
+ displayOptions: { show: { resource: ["conversion"] } },
11
+ options: [
12
+ {
13
+ name: "Get Many",
14
+ value: "getAll",
15
+ description: "Retrieve many online conversions of a project",
16
+ action: "Get many conversions",
17
+ },
18
+ {
19
+ name: "Send Offline Conversion",
20
+ value: "sendOffline",
21
+ description: "Create and process one offline conversion",
22
+ action: "Send offline conversion",
23
+ },
24
+ ],
25
+ default: "getAll",
26
+ },
27
+ ];
28
+ exports.conversionFields = [
29
+ {
30
+ displayName: "Project Name or ID",
31
+ name: "projectId",
32
+ type: "options",
33
+ typeOptions: { loadOptionsMethod: "getProjects" },
34
+ default: "",
35
+ required: true,
36
+ displayOptions: {
37
+ show: { resource: ["conversion"], operation: ["getAll", "sendOffline"] },
38
+ },
39
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
40
+ },
41
+ {
42
+ displayName: "Return All",
43
+ name: "returnAll",
44
+ type: "boolean",
45
+ default: false,
46
+ displayOptions: {
47
+ show: { resource: ["conversion"], operation: ["getAll"] },
48
+ },
49
+ description: "Whether to return all results or only up to a given limit",
50
+ },
51
+ {
52
+ displayName: "Limit",
53
+ name: "limit",
54
+ type: "number",
55
+ typeOptions: { minValue: 1 },
56
+ default: 50,
57
+ displayOptions: {
58
+ show: {
59
+ resource: ["conversion"],
60
+ operation: ["getAll"],
61
+ returnAll: [false],
62
+ },
63
+ },
64
+ description: "Max number of results to return",
65
+ },
66
+ {
67
+ displayName: "Filters",
68
+ name: "filters",
69
+ type: "collection",
70
+ placeholder: "Add Filter",
71
+ default: {},
72
+ displayOptions: {
73
+ show: { resource: ["conversion"], operation: ["getAll"] },
74
+ },
75
+ options: [
76
+ {
77
+ displayName: "Email",
78
+ name: "email",
79
+ type: "string",
80
+ placeholder: "name@email.com",
81
+ default: "",
82
+ description: "Only return conversions of this contact email",
83
+ },
84
+ {
85
+ displayName: "From",
86
+ name: "from",
87
+ type: "dateTime",
88
+ default: "",
89
+ description: "Only return conversions after this date",
90
+ },
91
+ {
92
+ displayName: "To",
93
+ name: "to",
94
+ type: "dateTime",
95
+ default: "",
96
+ description: "Only return conversions before this date",
97
+ },
98
+ {
99
+ displayName: "Trigger Name or ID",
100
+ name: "triggerId",
101
+ type: "options",
102
+ typeOptions: {
103
+ loadOptionsMethod: "getConversionTriggers",
104
+ loadOptionsDependsOn: ["projectId"],
105
+ },
106
+ default: "",
107
+ description: 'Only return conversions of this conversion trigger. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
108
+ },
109
+ ],
110
+ },
111
+ {
112
+ displayName: "Trigger Name or ID",
113
+ name: "triggerId",
114
+ type: "options",
115
+ typeOptions: {
116
+ loadOptionsMethod: "getOfflineTriggers",
117
+ loadOptionsDependsOn: ["projectId"],
118
+ },
119
+ default: "",
120
+ required: true,
121
+ displayOptions: {
122
+ show: { resource: ["conversion"], operation: ["sendOffline"] },
123
+ },
124
+ description: 'The offline trigger to send the conversion to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
125
+ },
126
+ {
127
+ displayName: "Email",
128
+ name: "email",
129
+ type: "string",
130
+ placeholder: "name@email.com",
131
+ default: "",
132
+ required: true,
133
+ displayOptions: {
134
+ show: { resource: ["conversion"], operation: ["sendOffline"] },
135
+ },
136
+ description: "Email address of the contact the conversion belongs to",
137
+ },
138
+ {
139
+ displayName: "Additional Fields",
140
+ name: "additionalFields",
141
+ type: "collection",
142
+ placeholder: "Add Field",
143
+ default: {},
144
+ displayOptions: {
145
+ show: { resource: ["conversion"], operation: ["sendOffline"] },
146
+ },
147
+ options: [
148
+ {
149
+ displayName: "Currency",
150
+ name: "currency",
151
+ type: "string",
152
+ default: "",
153
+ placeholder: "EUR",
154
+ description: "Currency of the conversion value",
155
+ },
156
+ {
157
+ displayName: "Event Time",
158
+ name: "eventTime",
159
+ type: "dateTime",
160
+ default: "",
161
+ description: "When the conversion happened",
162
+ },
163
+ {
164
+ displayName: "External ID",
165
+ name: "externalId",
166
+ type: "string",
167
+ default: "",
168
+ description: "External identifier used for deduplication",
169
+ },
170
+ {
171
+ displayName: "Metadata",
172
+ name: "metadata",
173
+ type: "json",
174
+ default: "{}",
175
+ description: "Additional metadata as JSON object",
176
+ },
177
+ {
178
+ displayName: "Phone",
179
+ name: "phone",
180
+ type: "string",
181
+ default: "",
182
+ description: "Phone number of the contact",
183
+ },
184
+ {
185
+ displayName: "Value",
186
+ name: "value",
187
+ type: "number",
188
+ default: 0,
189
+ description: "Monetary value of the conversion",
190
+ },
191
+ ],
192
+ },
193
+ ];
@@ -0,0 +1,3 @@
1
+ import type { INodeProperties } from "n8n-workflow";
2
+ export declare const projectOperations: INodeProperties[];
3
+ export declare const projectFields: INodeProperties[];
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.projectFields = exports.projectOperations = void 0;
4
+ exports.projectOperations = [
5
+ {
6
+ displayName: "Operation",
7
+ name: "operation",
8
+ type: "options",
9
+ noDataExpression: true,
10
+ displayOptions: { show: { resource: ["project"] } },
11
+ options: [
12
+ {
13
+ name: "Get Many",
14
+ value: "getAll",
15
+ description: "Retrieve many projects available to the API key",
16
+ action: "Get many projects",
17
+ },
18
+ ],
19
+ default: "getAll",
20
+ },
21
+ ];
22
+ exports.projectFields = [];
@@ -0,0 +1,2 @@
1
+ import { IExecuteFunctions } from "n8n-workflow";
2
+ export declare function handleProject(this: IExecuteFunctions, i: number, operation: string): Promise<unknown>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handleProject = handleProject;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const apiclient_1 = require("../../helpers/apiclient");
6
+ async function handleProject(i, operation) {
7
+ var _a;
8
+ switch (operation) {
9
+ case "getAll": {
10
+ const data = await (0, apiclient_1.vtRequest)(this, "GET", "/v1/projects");
11
+ return (_a = data === null || data === void 0 ? void 0 : data.projects) !== null && _a !== void 0 ? _a : [];
12
+ }
13
+ default:
14
+ throw new n8n_workflow_1.ApplicationError(`Unsupported project operation: ${operation}`);
15
+ }
16
+ }
@@ -0,0 +1,2 @@
1
+ import type { INodeProperties } from "n8n-workflow";
2
+ export declare const resourceSelector: INodeProperties;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resourceSelector = void 0;
4
+ exports.resourceSelector = {
5
+ displayName: "Resource",
6
+ name: "resource",
7
+ type: "options",
8
+ noDataExpression: true,
9
+ options: [
10
+ {
11
+ name: "API Call",
12
+ value: "apiCall",
13
+ description: "Make a custom API call to the VibeTrack API",
14
+ },
15
+ {
16
+ name: "Attribution",
17
+ value: "attribution",
18
+ description: "Aggregate attribution data for campaigns, adsets or ads",
19
+ },
20
+ {
21
+ name: "Conversion",
22
+ value: "conversion",
23
+ description: "Read online conversions and send offline conversions",
24
+ },
25
+ {
26
+ name: "Project",
27
+ value: "project",
28
+ description: "List projects available to the API key",
29
+ },
30
+ {
31
+ name: "Team Member",
32
+ value: "teamMember",
33
+ description: "Add or invite team members",
34
+ },
35
+ {
36
+ name: "Trigger",
37
+ value: "trigger",
38
+ description: "List conversion and offline triggers of a project",
39
+ },
40
+ {
41
+ name: "Webhook",
42
+ value: "webhook",
43
+ description: "Manage webhook subscriptions in VibeTrack",
44
+ },
45
+ ],
46
+ default: "conversion",
47
+ };
@@ -0,0 +1,2 @@
1
+ import { IExecuteFunctions } from "n8n-workflow";
2
+ export declare function route(this: IExecuteFunctions, i: number, resource: string, operation: string): Promise<unknown>;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.route = route;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const apiCall_actions_1 = require("./apiCall/apiCall.actions");
6
+ const attribution_actions_1 = require("./attribution/attribution.actions");
7
+ const conversion_actions_1 = require("./conversion/conversion.actions");
8
+ const project_actions_1 = require("./project/project.actions");
9
+ const team_actions_1 = require("./team/team.actions");
10
+ const trigger_actions_1 = require("./trigger/trigger.actions");
11
+ const webhook_actions_1 = require("./webhook/webhook.actions");
12
+ async function route(i, resource, operation) {
13
+ switch (resource) {
14
+ case "apiCall":
15
+ return await apiCall_actions_1.handleApiCall.call(this, i, operation);
16
+ case "attribution":
17
+ return await attribution_actions_1.handleAttribution.call(this, i, operation);
18
+ case "conversion":
19
+ return await conversion_actions_1.handleConversion.call(this, i, operation);
20
+ case "project":
21
+ return await project_actions_1.handleProject.call(this, i, operation);
22
+ case "teamMember":
23
+ return await team_actions_1.handleTeamMember.call(this, i, operation);
24
+ case "trigger":
25
+ return await trigger_actions_1.handleTrigger.call(this, i, operation);
26
+ case "webhook":
27
+ return await webhook_actions_1.handleWebhook.call(this, i, operation);
28
+ default:
29
+ throw new n8n_workflow_1.ApplicationError(`Unsupported resource: ${resource}`);
30
+ }
31
+ }
@@ -0,0 +1,3 @@
1
+ import type { INodeProperties } from "n8n-workflow";
2
+ export declare const teamMemberOperations: INodeProperties[];
3
+ export declare const teamMemberFields: INodeProperties[];
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.teamMemberFields = exports.teamMemberOperations = void 0;
4
+ exports.teamMemberOperations = [
5
+ {
6
+ displayName: "Operation",
7
+ name: "operation",
8
+ type: "options",
9
+ noDataExpression: true,
10
+ displayOptions: { show: { resource: ["teamMember"] } },
11
+ options: [
12
+ {
13
+ name: "Add",
14
+ value: "add",
15
+ description: "Add an existing user or send an invitation for project-level or workspace-level access",
16
+ action: "Add a team member",
17
+ },
18
+ ],
19
+ default: "add",
20
+ },
21
+ ];
22
+ exports.teamMemberFields = [
23
+ {
24
+ displayName: "Scope",
25
+ name: "scope",
26
+ type: "options",
27
+ options: [
28
+ {
29
+ name: "Project",
30
+ value: "project",
31
+ description: "Grant access to a single project",
32
+ },
33
+ {
34
+ name: "Workspace",
35
+ value: "workspace",
36
+ description: "Grant access to a whole workspace",
37
+ },
38
+ ],
39
+ default: "project",
40
+ displayOptions: {
41
+ show: { resource: ["teamMember"], operation: ["add"] },
42
+ },
43
+ description: "Whether to grant project-level or workspace-level access",
44
+ },
45
+ {
46
+ displayName: "Project Name or ID",
47
+ name: "projectId",
48
+ type: "options",
49
+ typeOptions: { loadOptionsMethod: "getProjects" },
50
+ default: "",
51
+ required: true,
52
+ displayOptions: {
53
+ show: {
54
+ resource: ["teamMember"],
55
+ operation: ["add"],
56
+ scope: ["project"],
57
+ },
58
+ },
59
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
60
+ },
61
+ {
62
+ displayName: "Workspace ID",
63
+ name: "workspaceId",
64
+ type: "string",
65
+ default: "",
66
+ required: true,
67
+ displayOptions: {
68
+ show: {
69
+ resource: ["teamMember"],
70
+ operation: ["add"],
71
+ scope: ["workspace"],
72
+ },
73
+ },
74
+ description: "ID of the workspace to grant access to",
75
+ },
76
+ {
77
+ displayName: "Email",
78
+ name: "email",
79
+ type: "string",
80
+ placeholder: "name@email.com",
81
+ default: "",
82
+ required: true,
83
+ displayOptions: {
84
+ show: { resource: ["teamMember"], operation: ["add"] },
85
+ },
86
+ description: "Email address of the user to add or invite",
87
+ },
88
+ {
89
+ displayName: "Access Level",
90
+ name: "accessLevel",
91
+ type: "options",
92
+ options: [
93
+ { name: "Admin", value: "ADMIN" },
94
+ { name: "Editor", value: "EDITOR" },
95
+ { name: "Read Only", value: "READ_ONLY" },
96
+ ],
97
+ default: "READ_ONLY",
98
+ required: true,
99
+ displayOptions: {
100
+ show: { resource: ["teamMember"], operation: ["add"] },
101
+ },
102
+ description: "Access level to grant. OWNER access cannot be granted through the public API.",
103
+ },
104
+ ];
@@ -0,0 +1,2 @@
1
+ import { IExecuteFunctions } from "n8n-workflow";
2
+ export declare function handleTeamMember(this: IExecuteFunctions, i: number, operation: string): Promise<unknown>;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handleTeamMember = handleTeamMember;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const apiclient_1 = require("../../helpers/apiclient");
6
+ async function handleTeamMember(i, operation) {
7
+ var _a, _b, _c;
8
+ switch (operation) {
9
+ case "add": {
10
+ const scope = this.getNodeParameter("scope", i, "project");
11
+ const email = (_a = this.getNodeParameter("email", i)) === null || _a === void 0 ? void 0 : _a.trim();
12
+ const accessLevel = this.getNodeParameter("accessLevel", i);
13
+ if (!email || !accessLevel) {
14
+ throw new n8n_workflow_1.ApplicationError("email and accessLevel are required.");
15
+ }
16
+ const body = { email, accessLevel };
17
+ if (scope === "workspace") {
18
+ const workspaceId = (_b = this.getNodeParameter("workspaceId", i)) === null || _b === void 0 ? void 0 : _b.trim();
19
+ if (!workspaceId) {
20
+ throw new n8n_workflow_1.ApplicationError("workspaceId is required.");
21
+ }
22
+ body.workspaceId = workspaceId;
23
+ }
24
+ else {
25
+ const projectId = (_c = this.getNodeParameter("projectId", i)) === null || _c === void 0 ? void 0 : _c.trim();
26
+ if (!projectId) {
27
+ throw new n8n_workflow_1.ApplicationError("projectId is required.");
28
+ }
29
+ body.projectId = projectId;
30
+ }
31
+ const data = await (0, apiclient_1.vtRequest)(this, "POST", "/v1/team-members", { body });
32
+ return data !== null && data !== void 0 ? data : {};
33
+ }
34
+ default:
35
+ throw new n8n_workflow_1.ApplicationError(`Unsupported team member operation: ${operation}`);
36
+ }
37
+ }
@@ -0,0 +1,3 @@
1
+ import type { INodeProperties } from "n8n-workflow";
2
+ export declare const triggerOperations: INodeProperties[];
3
+ export declare const triggerFields: INodeProperties[];
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.triggerFields = exports.triggerOperations = void 0;
4
+ exports.triggerOperations = [
5
+ {
6
+ displayName: "Operation",
7
+ name: "operation",
8
+ type: "options",
9
+ noDataExpression: true,
10
+ displayOptions: { show: { resource: ["trigger"] } },
11
+ options: [
12
+ {
13
+ name: "Get Many",
14
+ value: "getAll",
15
+ description: "Retrieve many active triggers of a project",
16
+ action: "Get many triggers",
17
+ },
18
+ ],
19
+ default: "getAll",
20
+ },
21
+ ];
22
+ exports.triggerFields = [
23
+ {
24
+ displayName: "Project Name or ID",
25
+ name: "projectId",
26
+ type: "options",
27
+ typeOptions: { loadOptionsMethod: "getProjects" },
28
+ default: "",
29
+ required: true,
30
+ displayOptions: {
31
+ show: { resource: ["trigger"], operation: ["getAll"] },
32
+ },
33
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
34
+ },
35
+ {
36
+ displayName: "Trigger Type",
37
+ name: "triggerType",
38
+ type: "options",
39
+ options: [
40
+ {
41
+ name: "Conversion (Online)",
42
+ value: "conversion",
43
+ description: "Active online conversion triggers",
44
+ },
45
+ {
46
+ name: "Offline",
47
+ value: "offline",
48
+ description: "Active offline triggers",
49
+ },
50
+ ],
51
+ default: "conversion",
52
+ displayOptions: {
53
+ show: { resource: ["trigger"], operation: ["getAll"] },
54
+ },
55
+ description: "Which kind of triggers to list",
56
+ },
57
+ {
58
+ displayName: "Source",
59
+ name: "source",
60
+ type: "options",
61
+ options: [
62
+ {
63
+ name: "API",
64
+ value: "api",
65
+ description: "Only triggers enabled for the API source",
66
+ },
67
+ {
68
+ name: "Any",
69
+ value: "any",
70
+ description: "Do not filter by source",
71
+ },
72
+ {
73
+ name: "Zapier",
74
+ value: "zapier",
75
+ description: "Only triggers enabled for the Zapier source",
76
+ },
77
+ ],
78
+ default: "any",
79
+ displayOptions: {
80
+ show: {
81
+ resource: ["trigger"],
82
+ operation: ["getAll"],
83
+ triggerType: ["offline"],
84
+ },
85
+ },
86
+ description: "Filter offline triggers by their enabled source",
87
+ },
88
+ ];
@@ -0,0 +1,2 @@
1
+ import { IExecuteFunctions } from "n8n-workflow";
2
+ export declare function handleTrigger(this: IExecuteFunctions, i: number, operation: string): Promise<unknown>;