n8n-nodes-proiectro 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 +77 -0
- package/dist/credentials/ProiectroApi.credentials.d.ts +13 -0
- package/dist/credentials/ProiectroApi.credentials.js +52 -0
- package/dist/credentials/proiectro.svg +44 -0
- package/dist/nodes/Proiectro/Proiectro.node.d.ts +17 -0
- package/dist/nodes/Proiectro/Proiectro.node.js +1865 -0
- package/dist/nodes/Proiectro/ProiectroTrigger.node.d.ts +12 -0
- package/dist/nodes/Proiectro/ProiectroTrigger.node.js +214 -0
- package/dist/nodes/Proiectro/descriptions/ContactDescription.d.ts +3 -0
- package/dist/nodes/Proiectro/descriptions/ContactDescription.js +157 -0
- package/dist/nodes/Proiectro/descriptions/CustomerDescription.d.ts +3 -0
- package/dist/nodes/Proiectro/descriptions/CustomerDescription.js +152 -0
- package/dist/nodes/Proiectro/descriptions/LabelDescription.d.ts +3 -0
- package/dist/nodes/Proiectro/descriptions/LabelDescription.js +370 -0
- package/dist/nodes/Proiectro/descriptions/OperationalWorkItemDescription.d.ts +3 -0
- package/dist/nodes/Proiectro/descriptions/OperationalWorkItemDescription.js +261 -0
- package/dist/nodes/Proiectro/descriptions/PaymentDescription.d.ts +3 -0
- package/dist/nodes/Proiectro/descriptions/PaymentDescription.js +163 -0
- package/dist/nodes/Proiectro/descriptions/ProcessDefinitionDescription.d.ts +3 -0
- package/dist/nodes/Proiectro/descriptions/ProcessDefinitionDescription.js +127 -0
- package/dist/nodes/Proiectro/descriptions/ProjectDescription.d.ts +3 -0
- package/dist/nodes/Proiectro/descriptions/ProjectDescription.js +48 -0
- package/dist/nodes/Proiectro/descriptions/ProposalDescription.d.ts +3 -0
- package/dist/nodes/Proiectro/descriptions/ProposalDescription.js +460 -0
- package/dist/nodes/Proiectro/descriptions/ResourceDescription.d.ts +3 -0
- package/dist/nodes/Proiectro/descriptions/ResourceDescription.js +119 -0
- package/dist/nodes/Proiectro/descriptions/SupportRequestDescription.d.ts +3 -0
- package/dist/nodes/Proiectro/descriptions/SupportRequestDescription.js +237 -0
- package/dist/nodes/Proiectro/descriptions/TagDescription.d.ts +3 -0
- package/dist/nodes/Proiectro/descriptions/TagDescription.js +235 -0
- package/dist/nodes/Proiectro/descriptions/TeamMemberDescription.d.ts +3 -0
- package/dist/nodes/Proiectro/descriptions/TeamMemberDescription.js +166 -0
- package/dist/nodes/Proiectro/descriptions/WebhookDescription.d.ts +3 -0
- package/dist/nodes/Proiectro/descriptions/WebhookDescription.js +118 -0
- package/dist/nodes/Proiectro/descriptions/WorkItemDescription.d.ts +3 -0
- package/dist/nodes/Proiectro/descriptions/WorkItemDescription.js +288 -0
- package/dist/nodes/Proiectro/proiectro.svg +44 -0
- package/package.json +45 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IHookFunctions, IWebhookFunctions, INodeType, INodeTypeDescription, IWebhookResponseData } from 'n8n-workflow';
|
|
2
|
+
export declare class ProiectroTrigger implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
webhookMethods: {
|
|
5
|
+
default: {
|
|
6
|
+
checkExists(this: IHookFunctions): Promise<boolean>;
|
|
7
|
+
create(this: IHookFunctions): Promise<boolean>;
|
|
8
|
+
delete(this: IHookFunctions): Promise<boolean>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProiectroTrigger = void 0;
|
|
4
|
+
// Auto-generated by generate_n8n.py — do not edit manually.
|
|
5
|
+
const crypto_1 = require("crypto");
|
|
6
|
+
const SIGNATURE_HEADER = 'x-webhook-signature';
|
|
7
|
+
const MAX_AGE_SECONDS = 300; // 5 minutes — reject older payloads (replay protection)
|
|
8
|
+
function verifySignature(secret, signature, rawBody) {
|
|
9
|
+
// Format: t={timestamp},v1={hex_digest}
|
|
10
|
+
const parts = {};
|
|
11
|
+
for (const pair of signature.split(',')) {
|
|
12
|
+
const idx = pair.indexOf('=');
|
|
13
|
+
if (idx > 0) {
|
|
14
|
+
parts[pair.slice(0, idx)] = pair.slice(idx + 1);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const timestamp = parts.t;
|
|
18
|
+
const v1 = parts.v1;
|
|
19
|
+
if (!timestamp || !v1)
|
|
20
|
+
return false;
|
|
21
|
+
// Replay protection
|
|
22
|
+
const age = Math.floor(Date.now() / 1000) - parseInt(timestamp, 10);
|
|
23
|
+
if (isNaN(age) || age > MAX_AGE_SECONDS || age < -MAX_AGE_SECONDS)
|
|
24
|
+
return false;
|
|
25
|
+
// Verify HMAC-SHA256: sign("{timestamp}.{body}")
|
|
26
|
+
const expected = (0, crypto_1.createHmac)('sha256', secret)
|
|
27
|
+
.update(`${timestamp}.${rawBody}`)
|
|
28
|
+
.digest('hex');
|
|
29
|
+
// Constant-time comparison
|
|
30
|
+
if (expected.length !== v1.length)
|
|
31
|
+
return false;
|
|
32
|
+
let mismatch = 0;
|
|
33
|
+
for (let i = 0; i < expected.length; i++) {
|
|
34
|
+
mismatch |= expected.charCodeAt(i) ^ v1.charCodeAt(i);
|
|
35
|
+
}
|
|
36
|
+
return mismatch === 0;
|
|
37
|
+
}
|
|
38
|
+
class ProiectroTrigger {
|
|
39
|
+
description = {
|
|
40
|
+
displayName: 'Proiect.ro Trigger',
|
|
41
|
+
name: 'proiectroTrigger',
|
|
42
|
+
icon: 'file:proiectro.svg',
|
|
43
|
+
group: ['trigger'],
|
|
44
|
+
version: 1,
|
|
45
|
+
usableAsTool: true,
|
|
46
|
+
subtitle: '={{$parameter["eventType"]}}',
|
|
47
|
+
description: 'Starts the workflow when a Proiect.ro event occurs',
|
|
48
|
+
defaults: { name: 'Proiect.ro Trigger' },
|
|
49
|
+
inputs: [],
|
|
50
|
+
outputs: ['main'],
|
|
51
|
+
credentials: [{ name: 'proiectroApi', required: true }],
|
|
52
|
+
webhooks: [
|
|
53
|
+
{
|
|
54
|
+
name: 'default',
|
|
55
|
+
httpMethod: 'POST',
|
|
56
|
+
responseMode: 'onReceived',
|
|
57
|
+
path: 'webhook',
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
properties: [
|
|
61
|
+
{
|
|
62
|
+
displayName: 'Event Type',
|
|
63
|
+
name: 'eventType',
|
|
64
|
+
type: 'multiOptions',
|
|
65
|
+
required: true,
|
|
66
|
+
default: [],
|
|
67
|
+
options: [
|
|
68
|
+
{ name: 'Contact Created', value: 'addContact' },
|
|
69
|
+
{ name: 'Contact Deleted', value: 'deleteContact' },
|
|
70
|
+
{ name: 'Contact Updated', value: 'editContact' },
|
|
71
|
+
{ name: 'Customer Created', value: 'addOrg' },
|
|
72
|
+
{ name: 'Customer Deleted', value: 'deleteOrg' },
|
|
73
|
+
{ name: 'Customer Labeled', value: 'labelOrg' },
|
|
74
|
+
{ name: 'Customer Tagged', value: 'tagOrg' },
|
|
75
|
+
{ name: 'Customer Unlabeled', value: 'unlabelOrg' },
|
|
76
|
+
{ name: 'Customer Untagged', value: 'untagOrg' },
|
|
77
|
+
{ name: 'Customer Updated', value: 'editOrg' },
|
|
78
|
+
{ name: 'Label Created', value: 'addLabel' },
|
|
79
|
+
{ name: 'Label Deleted', value: 'deleteLabel' },
|
|
80
|
+
{ name: 'Label Updated', value: 'editLabel' },
|
|
81
|
+
{ name: 'Operational Work Item Tagged', value: 'tagOperationalWorkItem' },
|
|
82
|
+
{ name: 'Operational Work Item Untagged', value: 'untagOperationalWorkItem' },
|
|
83
|
+
{ name: 'Payment Created', value: 'addPayment' },
|
|
84
|
+
{ name: 'Payment Deleted', value: 'deletePayment' },
|
|
85
|
+
{ name: 'Payment Marked Paid', value: 'markPaymentPaid' },
|
|
86
|
+
{ name: 'Payment Marked Unpaid', value: 'markPaymentUnpaid' },
|
|
87
|
+
{ name: 'Payment Updated', value: 'editPayment' },
|
|
88
|
+
{ name: 'Process Created', value: 'addProcess' },
|
|
89
|
+
{ name: 'Process Deleted', value: 'deleteProcess' },
|
|
90
|
+
{ name: 'Process Updated', value: 'editProcess' },
|
|
91
|
+
{ name: 'Proposal Accepted', value: 'acceptProposal' },
|
|
92
|
+
{ name: 'Proposal Created', value: 'addProposal' },
|
|
93
|
+
{ name: 'Proposal Labeled', value: 'labelProposal' },
|
|
94
|
+
{ name: 'Proposal Stage Changed', value: 'changeProposalStage' },
|
|
95
|
+
{ name: 'Proposal Tagged', value: 'tagProposal' },
|
|
96
|
+
{ name: 'Proposal Unlabeled', value: 'unlabelProposal' },
|
|
97
|
+
{ name: 'Proposal Untagged', value: 'untagProposal' },
|
|
98
|
+
{ name: 'Proposal Updated', value: 'editProposal' },
|
|
99
|
+
{ name: 'Resource Created', value: 'addResource' },
|
|
100
|
+
{ name: 'Resource Deleted', value: 'deleteResource' },
|
|
101
|
+
{ name: 'Resource Labeled', value: 'labelResource' },
|
|
102
|
+
{ name: 'Resource Tagged', value: 'tagResource' },
|
|
103
|
+
{ name: 'Resource Unlabeled', value: 'unlabelResource' },
|
|
104
|
+
{ name: 'Resource Untagged', value: 'untagResource' },
|
|
105
|
+
{ name: 'Resource Updated', value: 'editResource' },
|
|
106
|
+
{ name: 'Support Request Created', value: 'addInternalSupportRequest' },
|
|
107
|
+
{ name: 'Tag Created', value: 'addTag' },
|
|
108
|
+
{ name: 'Tag Deleted', value: 'deleteTag' },
|
|
109
|
+
{ name: 'Tag Updated', value: 'editTag' },
|
|
110
|
+
{ name: 'Team Member Invited', value: 'inviteToTeam' },
|
|
111
|
+
{ name: 'Team Member Labeled', value: 'labelMember' },
|
|
112
|
+
{ name: 'Team Member Removed', value: 'excludeFromTeam' },
|
|
113
|
+
{ name: 'Team Member Tagged', value: 'tagMember' },
|
|
114
|
+
{ name: 'Team Member Unlabeled', value: 'unlabelMember' },
|
|
115
|
+
{ name: 'Team Member Untagged', value: 'untagMember' },
|
|
116
|
+
{ name: 'Webhook Created', value: 'addWebhookEndpoint' },
|
|
117
|
+
{ name: 'Webhook Deleted', value: 'deleteWebhookEndpoint' },
|
|
118
|
+
{ name: 'Webhook Updated', value: 'editWebhookEndpoint' },
|
|
119
|
+
{ name: 'Work Item Approved', value: 'approveOperationalItem' },
|
|
120
|
+
{ name: 'Work Item Created', value: 'addOperationalItem' },
|
|
121
|
+
{ name: 'Work Item Created (Project)', value: 'addWorkItem' },
|
|
122
|
+
{ name: 'Work Item Deleted', value: 'deleteOperationalItem' },
|
|
123
|
+
{ name: 'Work Item Labeled', value: 'labelWorkItem' },
|
|
124
|
+
{ name: 'Work Item Moved', value: 'moveOperationalItem' },
|
|
125
|
+
{ name: 'Work Item Reassigned', value: 'reassignOperationalItem' },
|
|
126
|
+
{ name: 'Work Item Rejected', value: 'rejectOperationalItem' },
|
|
127
|
+
{ name: 'Work Item Status Changed', value: 'updateWorkItemStatus' },
|
|
128
|
+
{ name: 'Work Item Tagged (Project)', value: 'tagProjectWorkItem' },
|
|
129
|
+
{ name: 'Work Item Unlabeled', value: 'unlabelWorkItem' },
|
|
130
|
+
{ name: 'Work Item Untagged (Project)', value: 'untagProjectWorkItem' },
|
|
131
|
+
{ name: 'Work Item Updated', value: 'editOperationalItem' },
|
|
132
|
+
{ name: 'Work Item Updated (Project)', value: 'editWorkItem' },
|
|
133
|
+
],
|
|
134
|
+
description: 'The event types to listen for',
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
};
|
|
138
|
+
webhookMethods = {
|
|
139
|
+
default: {
|
|
140
|
+
async checkExists() {
|
|
141
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
142
|
+
return !!webhookData.webhookId;
|
|
143
|
+
},
|
|
144
|
+
async create() {
|
|
145
|
+
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
146
|
+
const eventTypes = this.getNodeParameter('eventType');
|
|
147
|
+
const credentials = await this.getCredentials('proiectroApi');
|
|
148
|
+
const response = (await this.helpers.httpRequest({
|
|
149
|
+
method: 'POST',
|
|
150
|
+
url: `${credentials.baseUrl}/api/v1/${credentials.workspacePath}/add_webhook`,
|
|
151
|
+
headers: {
|
|
152
|
+
Authorization: `Bearer ${credentials.apiKey}`,
|
|
153
|
+
'Content-Type': 'application/json',
|
|
154
|
+
},
|
|
155
|
+
body: {
|
|
156
|
+
name: `n8n: ${this.getWorkflow().name}`,
|
|
157
|
+
target_url: webhookUrl,
|
|
158
|
+
event_types: eventTypes,
|
|
159
|
+
is_active: true,
|
|
160
|
+
is_secure: true,
|
|
161
|
+
},
|
|
162
|
+
}));
|
|
163
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
164
|
+
webhookData.webhookId = response.webhook_id;
|
|
165
|
+
webhookData.secretKey = response.secret_key;
|
|
166
|
+
return true;
|
|
167
|
+
},
|
|
168
|
+
async delete() {
|
|
169
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
170
|
+
const credentials = await this.getCredentials('proiectroApi');
|
|
171
|
+
if (webhookData.webhookId) {
|
|
172
|
+
try {
|
|
173
|
+
await this.helpers.httpRequest({
|
|
174
|
+
method: 'DELETE',
|
|
175
|
+
url: `${credentials.baseUrl}/api/v1/${credentials.workspacePath}/delete_webhook/${webhookData.webhookId}`,
|
|
176
|
+
headers: {
|
|
177
|
+
Authorization: `Bearer ${credentials.apiKey}`,
|
|
178
|
+
},
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
catch {
|
|
182
|
+
// Webhook may already be deleted — ignore cleanup errors
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
delete webhookData.webhookId;
|
|
186
|
+
delete webhookData.secretKey;
|
|
187
|
+
return true;
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
async webhook() {
|
|
192
|
+
const req = this.getRequestObject();
|
|
193
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
194
|
+
const secret = webhookData.secretKey;
|
|
195
|
+
if (secret) {
|
|
196
|
+
const signature = this.getHeaderData()[SIGNATURE_HEADER];
|
|
197
|
+
if (!signature) {
|
|
198
|
+
return { webhookResponse: 'Missing signature', workflowData: undefined };
|
|
199
|
+
}
|
|
200
|
+
// Use the raw body for signature verification
|
|
201
|
+
const rawBody = typeof req.rawBody === 'string'
|
|
202
|
+
? req.rawBody
|
|
203
|
+
: req.rawBody.toString('utf-8');
|
|
204
|
+
if (!verifySignature(secret, signature, rawBody)) {
|
|
205
|
+
return { webhookResponse: 'Invalid signature', workflowData: undefined };
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
const bodyData = this.getBodyData();
|
|
209
|
+
return {
|
|
210
|
+
workflowData: [this.helpers.returnJsonArray(bodyData)],
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
exports.ProiectroTrigger = ProiectroTrigger;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.contactFields = exports.contactOperations = void 0;
|
|
4
|
+
exports.contactOperations = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: { resource: ['contact'] },
|
|
12
|
+
},
|
|
13
|
+
options: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Create',
|
|
16
|
+
value: 'create',
|
|
17
|
+
action: 'Create a contact',
|
|
18
|
+
description: 'Add a contact to an organization',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Delete',
|
|
22
|
+
value: 'delete',
|
|
23
|
+
action: 'Delete a contact',
|
|
24
|
+
description: 'Delete a contact',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'Invite to Portal',
|
|
28
|
+
value: 'invite',
|
|
29
|
+
action: 'Invite a contact to portal',
|
|
30
|
+
description: 'Send a portal invitation to a contact',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'List',
|
|
34
|
+
value: 'list',
|
|
35
|
+
action: 'List contacts',
|
|
36
|
+
description: 'List contacts for an organization',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'Update',
|
|
40
|
+
value: 'update',
|
|
41
|
+
action: 'Update a contact',
|
|
42
|
+
description: 'Update a contact\'s details',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
default: 'create',
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
exports.contactFields = [
|
|
49
|
+
{
|
|
50
|
+
displayName: 'Org Name or ID',
|
|
51
|
+
name: 'org_id',
|
|
52
|
+
type: 'options',
|
|
53
|
+
required: true,
|
|
54
|
+
typeOptions: {
|
|
55
|
+
loadOptionsMethod: 'getCustomers',
|
|
56
|
+
},
|
|
57
|
+
default: '',
|
|
58
|
+
displayOptions: {
|
|
59
|
+
show: {
|
|
60
|
+
resource: ['contact'],
|
|
61
|
+
operation: ["list", "create", "update", "delete", "invite"],
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
displayName: 'Contact Info First Name',
|
|
68
|
+
name: 'contact_info_first_name',
|
|
69
|
+
type: 'string',
|
|
70
|
+
required: true,
|
|
71
|
+
default: '',
|
|
72
|
+
displayOptions: {
|
|
73
|
+
show: {
|
|
74
|
+
resource: ['contact'],
|
|
75
|
+
operation: ["create", "update"],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
displayName: 'Contact Info Last Name',
|
|
81
|
+
name: 'contact_info_last_name',
|
|
82
|
+
type: 'string',
|
|
83
|
+
required: true,
|
|
84
|
+
default: '',
|
|
85
|
+
displayOptions: {
|
|
86
|
+
show: {
|
|
87
|
+
resource: ['contact'],
|
|
88
|
+
operation: ["create", "update"],
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
displayName: 'Contact Info Email',
|
|
94
|
+
name: 'contact_info_email',
|
|
95
|
+
type: 'string',
|
|
96
|
+
required: true,
|
|
97
|
+
default: '',
|
|
98
|
+
displayOptions: {
|
|
99
|
+
show: {
|
|
100
|
+
resource: ['contact'],
|
|
101
|
+
operation: ["create", "update"],
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
displayName: 'Contact Info Phone',
|
|
107
|
+
name: 'contact_info_phone',
|
|
108
|
+
type: 'string',
|
|
109
|
+
required: true,
|
|
110
|
+
default: '',
|
|
111
|
+
displayOptions: {
|
|
112
|
+
show: {
|
|
113
|
+
resource: ['contact'],
|
|
114
|
+
operation: ["create", "update"],
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
displayName: 'Contact Info Address',
|
|
120
|
+
name: 'contact_info_address',
|
|
121
|
+
type: 'string',
|
|
122
|
+
required: true,
|
|
123
|
+
default: '',
|
|
124
|
+
displayOptions: {
|
|
125
|
+
show: {
|
|
126
|
+
resource: ['contact'],
|
|
127
|
+
operation: ["create", "update"],
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
displayName: 'Contact Info Job Title',
|
|
133
|
+
name: 'contact_info_job_title',
|
|
134
|
+
type: 'string',
|
|
135
|
+
required: true,
|
|
136
|
+
default: '',
|
|
137
|
+
displayOptions: {
|
|
138
|
+
show: {
|
|
139
|
+
resource: ['contact'],
|
|
140
|
+
operation: ["create", "update"],
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
displayName: 'Contact ID',
|
|
146
|
+
name: 'contact_id',
|
|
147
|
+
type: 'string',
|
|
148
|
+
required: true,
|
|
149
|
+
default: '',
|
|
150
|
+
displayOptions: {
|
|
151
|
+
show: {
|
|
152
|
+
resource: ['contact'],
|
|
153
|
+
operation: ["update", "delete", "invite"],
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
];
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.customerFields = exports.customerOperations = void 0;
|
|
4
|
+
exports.customerOperations = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: { resource: ['customer'] },
|
|
12
|
+
},
|
|
13
|
+
options: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Create',
|
|
16
|
+
value: 'create',
|
|
17
|
+
action: 'Create a customer',
|
|
18
|
+
description: 'Create a new customer',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Delete',
|
|
22
|
+
value: 'delete',
|
|
23
|
+
action: 'Delete a customer',
|
|
24
|
+
description: 'Delete a customer',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'Get',
|
|
28
|
+
value: 'get',
|
|
29
|
+
action: 'Get a customer',
|
|
30
|
+
description: 'Get a single customer by ID',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'List All',
|
|
34
|
+
value: 'list',
|
|
35
|
+
action: 'List all customers',
|
|
36
|
+
description: 'Get all customers in the workspace',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'Update',
|
|
40
|
+
value: 'update',
|
|
41
|
+
action: 'Update a customer',
|
|
42
|
+
description: 'Update an existing customer',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
default: 'create',
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
exports.customerFields = [
|
|
49
|
+
{
|
|
50
|
+
displayName: 'Subtenant Name or ID',
|
|
51
|
+
name: 'subtenant_id',
|
|
52
|
+
type: 'options',
|
|
53
|
+
required: true,
|
|
54
|
+
typeOptions: {
|
|
55
|
+
loadOptionsMethod: 'getCustomers',
|
|
56
|
+
},
|
|
57
|
+
default: '',
|
|
58
|
+
displayOptions: {
|
|
59
|
+
show: {
|
|
60
|
+
resource: ['customer'],
|
|
61
|
+
operation: ["get", "update", "delete"],
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
displayName: 'Parent Name or ID',
|
|
68
|
+
name: 'parent_id',
|
|
69
|
+
type: 'options',
|
|
70
|
+
required: true,
|
|
71
|
+
typeOptions: {
|
|
72
|
+
loadOptionsMethod: 'getCustomers',
|
|
73
|
+
},
|
|
74
|
+
default: '',
|
|
75
|
+
displayOptions: {
|
|
76
|
+
show: {
|
|
77
|
+
resource: ['customer'],
|
|
78
|
+
operation: ["create"],
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
displayName: 'Name',
|
|
85
|
+
name: 'name',
|
|
86
|
+
type: 'string',
|
|
87
|
+
required: true,
|
|
88
|
+
default: '',
|
|
89
|
+
displayOptions: {
|
|
90
|
+
show: {
|
|
91
|
+
resource: ['customer'],
|
|
92
|
+
operation: ["create", "update"],
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
displayName: 'Timezone',
|
|
98
|
+
name: 'timezone',
|
|
99
|
+
type: 'string',
|
|
100
|
+
required: true,
|
|
101
|
+
default: '',
|
|
102
|
+
displayOptions: {
|
|
103
|
+
show: {
|
|
104
|
+
resource: ['customer'],
|
|
105
|
+
operation: ["create", "update"],
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
displayName: 'Default Currency',
|
|
111
|
+
name: 'default_currency',
|
|
112
|
+
type: 'string',
|
|
113
|
+
required: true,
|
|
114
|
+
default: '',
|
|
115
|
+
displayOptions: {
|
|
116
|
+
show: {
|
|
117
|
+
resource: ['customer'],
|
|
118
|
+
operation: ["create", "update"],
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
displayName: 'Country',
|
|
124
|
+
name: 'country',
|
|
125
|
+
type: 'string',
|
|
126
|
+
required: true,
|
|
127
|
+
default: '',
|
|
128
|
+
displayOptions: {
|
|
129
|
+
show: {
|
|
130
|
+
resource: ['customer'],
|
|
131
|
+
operation: ["create", "update"],
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
displayName: 'Manager Name or ID',
|
|
137
|
+
name: 'manager',
|
|
138
|
+
type: 'options',
|
|
139
|
+
required: true,
|
|
140
|
+
typeOptions: {
|
|
141
|
+
loadOptionsMethod: 'getMembers',
|
|
142
|
+
},
|
|
143
|
+
default: '',
|
|
144
|
+
displayOptions: {
|
|
145
|
+
show: {
|
|
146
|
+
resource: ['customer'],
|
|
147
|
+
operation: ["create", "update"],
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
151
|
+
},
|
|
152
|
+
];
|