@mspcopilot/n8n-nodes-connectwise 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/README.md +59 -0
- package/dist-community/LICENSE.md +21 -0
- package/dist-community/credentials/ConnectWisePsaApi.credentials.js +142 -0
- package/dist-community/credentials/connectwise.svg +1 -0
- package/dist-community/nodes/ConnectWise/PSA/ConnectWisePsa.node.js +180 -0
- package/dist-community/nodes/ConnectWise/PSA/connectwise.svg +1 -0
- package/dist-community/nodes/ConnectWise/PSA/descriptions/common.descriptions.js +46 -0
- package/dist-community/nodes/ConnectWise/PSA/descriptions/common.properties.js +353 -0
- package/dist-community/nodes/ConnectWise/PSA/descriptions/index.js +30 -0
- package/dist-community/nodes/ConnectWise/PSA/helpers/customFields.js +116 -0
- package/dist-community/nodes/ConnectWise/PSA/helpers/field-collector.js +83 -0
- package/dist-community/nodes/ConnectWise/PSA/helpers/field-conditions.js +86 -0
- package/dist-community/nodes/ConnectWise/PSA/helpers/index.js +33 -0
- package/dist-community/nodes/ConnectWise/PSA/helpers/logging.js +61 -0
- package/dist-community/nodes/ConnectWise/PSA/helpers/utils.js +128 -0
- package/dist-community/nodes/ConnectWise/PSA/methods/fieldOptions.js +223 -0
- package/dist-community/nodes/ConnectWise/PSA/methods/generated.js +53 -0
- package/dist-community/nodes/ConnectWise/PSA/methods/index.js +40 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/converter/index.js +66 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/converter/reference.generator.js +178 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/index.js +39 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/references.js +293 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/reports-descriptions.js +300 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/activity.schema.js +413 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/alert-consolidation.js +42 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/company.schema.js +720 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/contact.schema.js +461 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/custom.schema.js +163 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/index.js +72 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/members.schema.js +361 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/reports.schema.js +177 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/ticket.schema.js +983 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/ticketNote.schema.js +289 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/timeEntry.schema.js +407 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/static-fields.js +1813 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/transformer.js +126 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/types/index.js +33 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/types/reference.types.js +23 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/types/resource.types.js +23 -0
- package/dist-community/nodes/ConnectWise/PSA/transport/cache.js +81 -0
- package/dist-community/nodes/ConnectWise/PSA/transport/client.js +200 -0
- package/dist-community/nodes/ConnectWise/PSA/transport/index.js +105 -0
- package/dist-community/nodes/ConnectWise/PSA/transport/operations.js +167 -0
- package/dist-community/nodes/ConnectWise/PSA/transport/response-transformer.js +123 -0
- package/dist-community/nodes/ConnectWise/PSA/transport/version-check.js +128 -0
- package/dist-community/nodes/ConnectWise/PSA/types/n8n-augmentation.d.js +1 -0
- package/dist-community/nodes/ConnectWisePsa.node.json +25 -0
- package/docs/assets/screenshots/create-ticket.png +0 -0
- package/docs/assets/screenshots/field-list.png +0 -0
- package/docs/assets/screenshots/field-sort.png +0 -0
- package/index.js +0 -0
- package/package.json +73 -0
|
@@ -0,0 +1,720 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: !0
|
|
13
|
+
});
|
|
14
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
+
value: !0
|
|
24
|
+
}), mod);
|
|
25
|
+
|
|
26
|
+
var company_schema_exports = {};
|
|
27
|
+
|
|
28
|
+
__export(company_schema_exports, {
|
|
29
|
+
companySchema: () => companySchema,
|
|
30
|
+
execute: () => execute
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
module.exports = __toCommonJS(company_schema_exports);
|
|
34
|
+
|
|
35
|
+
var import_transport = require("../../transport"), import_common = require("../../descriptions/common.properties");
|
|
36
|
+
|
|
37
|
+
const companyFields = [ {
|
|
38
|
+
displayName: "Operation",
|
|
39
|
+
name: "operation",
|
|
40
|
+
type: "options",
|
|
41
|
+
noDataExpression: !0,
|
|
42
|
+
displayOptions: {
|
|
43
|
+
show: {
|
|
44
|
+
resource: [ "company" ]
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
options: [ {
|
|
48
|
+
name: "Create",
|
|
49
|
+
value: "create",
|
|
50
|
+
description: "Create a company",
|
|
51
|
+
action: "Create a company"
|
|
52
|
+
}, {
|
|
53
|
+
name: "Delete",
|
|
54
|
+
value: "delete",
|
|
55
|
+
description: "Delete a company",
|
|
56
|
+
action: "Delete a company"
|
|
57
|
+
}, {
|
|
58
|
+
name: "Get",
|
|
59
|
+
value: "get",
|
|
60
|
+
description: "Retrieve a company",
|
|
61
|
+
action: "Get a company"
|
|
62
|
+
}, {
|
|
63
|
+
name: "Get Many",
|
|
64
|
+
value: "getAll",
|
|
65
|
+
description: "Retrieve many companies",
|
|
66
|
+
action: "Get many companies"
|
|
67
|
+
}, {
|
|
68
|
+
name: "Update",
|
|
69
|
+
value: "update",
|
|
70
|
+
description: "Update a company",
|
|
71
|
+
action: "Update a company"
|
|
72
|
+
} ],
|
|
73
|
+
default: "create"
|
|
74
|
+
}, {
|
|
75
|
+
displayName: "Company ID",
|
|
76
|
+
name: "id",
|
|
77
|
+
type: "number",
|
|
78
|
+
required: !0,
|
|
79
|
+
default: null,
|
|
80
|
+
description: "The ID of the company",
|
|
81
|
+
displayOptions: {
|
|
82
|
+
show: {
|
|
83
|
+
operation: [ "update", "delete" ]
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}, {
|
|
87
|
+
displayName: "Company Name or ID",
|
|
88
|
+
name: "company",
|
|
89
|
+
type: "resourceLocator",
|
|
90
|
+
required: !0,
|
|
91
|
+
default: {
|
|
92
|
+
mode: "id",
|
|
93
|
+
value: ""
|
|
94
|
+
},
|
|
95
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
96
|
+
displayOptions: {
|
|
97
|
+
show: {
|
|
98
|
+
operation: [ "get" ]
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
modes: [ {
|
|
102
|
+
displayName: "ID",
|
|
103
|
+
name: "id",
|
|
104
|
+
type: "string"
|
|
105
|
+
}, {
|
|
106
|
+
displayName: "By Identifier",
|
|
107
|
+
name: "identifier",
|
|
108
|
+
type: "string"
|
|
109
|
+
}, {
|
|
110
|
+
displayName: "From List",
|
|
111
|
+
name: "list",
|
|
112
|
+
type: "list",
|
|
113
|
+
typeOptions: {
|
|
114
|
+
searchListMethod: "searchList_company_companies",
|
|
115
|
+
searchable: !0
|
|
116
|
+
}
|
|
117
|
+
} ]
|
|
118
|
+
}, {
|
|
119
|
+
displayName: 'For information on how to create/update companies, check the <a href="temp">documentation</a>',
|
|
120
|
+
name: "importantNotice",
|
|
121
|
+
type: "notice",
|
|
122
|
+
default: "",
|
|
123
|
+
displayOptions: {
|
|
124
|
+
show: {
|
|
125
|
+
operation: [ "create", "update" ]
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}, {
|
|
129
|
+
displayName: "Identifier",
|
|
130
|
+
name: "identifier",
|
|
131
|
+
type: "string",
|
|
132
|
+
default: "",
|
|
133
|
+
description: "Unique identifier (cannot be changed after creation via API)",
|
|
134
|
+
placeholder: "ShortCompanyName",
|
|
135
|
+
hint: "Cannot be changed by API after creation. Must be unique.",
|
|
136
|
+
required: !0,
|
|
137
|
+
displayOptions: {
|
|
138
|
+
show: {
|
|
139
|
+
operation: [ "create" ]
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
typeOptions: {
|
|
143
|
+
maxLength: 30
|
|
144
|
+
}
|
|
145
|
+
}, {
|
|
146
|
+
displayName: "Company Name",
|
|
147
|
+
name: "name",
|
|
148
|
+
type: "string",
|
|
149
|
+
default: "",
|
|
150
|
+
x_requiredOnCreate: !0,
|
|
151
|
+
displayOptions: {
|
|
152
|
+
show: {
|
|
153
|
+
operation: [ "create", "update" ]
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
typeOptions: {
|
|
157
|
+
maxLength: 50
|
|
158
|
+
}
|
|
159
|
+
}, {
|
|
160
|
+
displayName: "Site Name",
|
|
161
|
+
name: "siteName",
|
|
162
|
+
type: "string",
|
|
163
|
+
default: "",
|
|
164
|
+
hint: "Name of the site that will be created with the new company",
|
|
165
|
+
placeholder: "Main",
|
|
166
|
+
required: !0,
|
|
167
|
+
displayOptions: {
|
|
168
|
+
show: {
|
|
169
|
+
operation: [ "create" ]
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
typeOptions: {
|
|
173
|
+
maxLength: 50
|
|
174
|
+
},
|
|
175
|
+
x_submitAs: "site.name"
|
|
176
|
+
}, {
|
|
177
|
+
displayName: "Company Status",
|
|
178
|
+
name: "status",
|
|
179
|
+
type: "options",
|
|
180
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
181
|
+
default: "",
|
|
182
|
+
displayOptions: {
|
|
183
|
+
show: {
|
|
184
|
+
operation: [ "create", "update" ]
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
typeOptions: {
|
|
188
|
+
loadOptionsMethod: "loadOptions_company_companies_statuses"
|
|
189
|
+
},
|
|
190
|
+
x_submitAs: "status.id"
|
|
191
|
+
}, {
|
|
192
|
+
displayName: "Company Types",
|
|
193
|
+
name: "types",
|
|
194
|
+
type: "multiOptions",
|
|
195
|
+
default: [],
|
|
196
|
+
description: 'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
197
|
+
hint: "This will replace all existing types",
|
|
198
|
+
displayOptions: {
|
|
199
|
+
show: {
|
|
200
|
+
operation: [ "create" ]
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
typeOptions: {
|
|
204
|
+
loadOptionsMethod: "loadOptions_company_companies_types"
|
|
205
|
+
},
|
|
206
|
+
x_submitAs: "types[].id"
|
|
207
|
+
}, {
|
|
208
|
+
displayName: "Country",
|
|
209
|
+
name: "country",
|
|
210
|
+
type: "options",
|
|
211
|
+
default: "",
|
|
212
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
213
|
+
displayOptions: {
|
|
214
|
+
show: {
|
|
215
|
+
operation: [ "create", "update" ]
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
typeOptions: {
|
|
219
|
+
loadOptionsMethod: "loadOptions_company_countries"
|
|
220
|
+
},
|
|
221
|
+
x_submitAs: "country.id"
|
|
222
|
+
}, {
|
|
223
|
+
displayName: "State/Province",
|
|
224
|
+
name: "state",
|
|
225
|
+
type: "options",
|
|
226
|
+
default: "",
|
|
227
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
228
|
+
displayOptions: {
|
|
229
|
+
show: {
|
|
230
|
+
operation: [ "create", "update" ]
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
typeOptions: {
|
|
234
|
+
loadOptionsMethod: "loadOptions_company_states",
|
|
235
|
+
loadOptionsDependsOn: [ "country" ]
|
|
236
|
+
}
|
|
237
|
+
}, {
|
|
238
|
+
displayName: "Address Information",
|
|
239
|
+
name: "addressCollection",
|
|
240
|
+
type: "collection",
|
|
241
|
+
default: {},
|
|
242
|
+
placeholder: "Add Address Fields",
|
|
243
|
+
displayOptions: {
|
|
244
|
+
show: {
|
|
245
|
+
operation: [ "create", "update" ]
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
options: [ {
|
|
249
|
+
displayName: "Address Line 1",
|
|
250
|
+
name: "addressLine1",
|
|
251
|
+
type: "string",
|
|
252
|
+
default: "",
|
|
253
|
+
description: "First line of the address",
|
|
254
|
+
typeOptions: {
|
|
255
|
+
maxLength: 50
|
|
256
|
+
},
|
|
257
|
+
x_submitAs: "addressLine1"
|
|
258
|
+
}, {
|
|
259
|
+
displayName: "Address Line 2",
|
|
260
|
+
name: "addressLine2",
|
|
261
|
+
type: "string",
|
|
262
|
+
default: "",
|
|
263
|
+
description: "Second line of the address",
|
|
264
|
+
typeOptions: {
|
|
265
|
+
maxLength: 50
|
|
266
|
+
},
|
|
267
|
+
x_submitAs: "addressLine2"
|
|
268
|
+
}, {
|
|
269
|
+
displayName: "City",
|
|
270
|
+
name: "city",
|
|
271
|
+
type: "string",
|
|
272
|
+
default: "",
|
|
273
|
+
typeOptions: {
|
|
274
|
+
maxLength: 50
|
|
275
|
+
},
|
|
276
|
+
x_submitAs: "city"
|
|
277
|
+
}, {
|
|
278
|
+
displayName: "Zip/Postal Code",
|
|
279
|
+
name: "zip",
|
|
280
|
+
type: "string",
|
|
281
|
+
default: "",
|
|
282
|
+
description: "Zip or postal code",
|
|
283
|
+
typeOptions: {
|
|
284
|
+
maxLength: 12
|
|
285
|
+
},
|
|
286
|
+
x_submitAs: "zip"
|
|
287
|
+
}, {
|
|
288
|
+
displayName: "Time Zone",
|
|
289
|
+
name: "timeZoneSetupId",
|
|
290
|
+
type: "options",
|
|
291
|
+
default: "",
|
|
292
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
293
|
+
typeOptions: {
|
|
294
|
+
loadOptionsMethod: "loadOptions_system_timeZoneSetups"
|
|
295
|
+
},
|
|
296
|
+
x_submitAs: "timeZoneSetup.id"
|
|
297
|
+
} ]
|
|
298
|
+
}, {
|
|
299
|
+
displayName: "Contact Details",
|
|
300
|
+
name: "contactCollection",
|
|
301
|
+
type: "collection",
|
|
302
|
+
default: {},
|
|
303
|
+
placeholder: "Add Contact Information",
|
|
304
|
+
displayOptions: {
|
|
305
|
+
show: {
|
|
306
|
+
operation: [ "create", "update" ]
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
options: [ {
|
|
310
|
+
displayName: "Default Contact ID",
|
|
311
|
+
name: "defaultContact",
|
|
312
|
+
type: "number",
|
|
313
|
+
hint: "This can only be used on an update operation",
|
|
314
|
+
default: null,
|
|
315
|
+
x_submitAs: "defaultContact.id"
|
|
316
|
+
}, {
|
|
317
|
+
displayName: "Phone Number",
|
|
318
|
+
name: "phoneNumber",
|
|
319
|
+
type: "string",
|
|
320
|
+
default: "",
|
|
321
|
+
placeholder: "+1 (555) 123-4567",
|
|
322
|
+
typeOptions: {
|
|
323
|
+
maxLength: 30
|
|
324
|
+
},
|
|
325
|
+
x_submitAs: "phoneNumber"
|
|
326
|
+
}, {
|
|
327
|
+
displayName: "Fax Number",
|
|
328
|
+
name: "faxNumber",
|
|
329
|
+
type: "string",
|
|
330
|
+
default: "",
|
|
331
|
+
typeOptions: {
|
|
332
|
+
maxLength: 30
|
|
333
|
+
},
|
|
334
|
+
x_submitAs: "faxNumber"
|
|
335
|
+
}, {
|
|
336
|
+
displayName: "Website",
|
|
337
|
+
name: "website",
|
|
338
|
+
type: "string",
|
|
339
|
+
default: "",
|
|
340
|
+
description: "Company website URL",
|
|
341
|
+
placeholder: "https://example.com",
|
|
342
|
+
typeOptions: {
|
|
343
|
+
maxLength: 255
|
|
344
|
+
},
|
|
345
|
+
x_submitAs: "website"
|
|
346
|
+
}, {
|
|
347
|
+
displayName: "Facebook URL",
|
|
348
|
+
name: "facebookUrl",
|
|
349
|
+
type: "string",
|
|
350
|
+
default: "",
|
|
351
|
+
description: "Facebook page URL",
|
|
352
|
+
placeholder: "https://facebook.com/company",
|
|
353
|
+
x_submitAs: "facebookUrl"
|
|
354
|
+
}, {
|
|
355
|
+
displayName: "Twitter URL",
|
|
356
|
+
name: "twitterUrl",
|
|
357
|
+
type: "string",
|
|
358
|
+
default: "",
|
|
359
|
+
description: "Twitter profile URL",
|
|
360
|
+
placeholder: "https://twitter.com/company",
|
|
361
|
+
x_submitAs: "twitterUrl"
|
|
362
|
+
}, {
|
|
363
|
+
displayName: "LinkedIn URL",
|
|
364
|
+
name: "linkedInUrl",
|
|
365
|
+
type: "string",
|
|
366
|
+
default: "",
|
|
367
|
+
description: "LinkedIn company page URL",
|
|
368
|
+
placeholder: "https://linkedin.com/company/company-name",
|
|
369
|
+
x_submitAs: "linkedInUrl"
|
|
370
|
+
} ]
|
|
371
|
+
}, {
|
|
372
|
+
displayName: "Business Information",
|
|
373
|
+
name: "businessCollection",
|
|
374
|
+
type: "collection",
|
|
375
|
+
default: {},
|
|
376
|
+
placeholder: "Add Business Details",
|
|
377
|
+
displayOptions: {
|
|
378
|
+
show: {
|
|
379
|
+
operation: [ "create", "update" ]
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
options: [ {
|
|
383
|
+
displayName: "Account Number",
|
|
384
|
+
name: "accountNumber",
|
|
385
|
+
type: "string",
|
|
386
|
+
default: "",
|
|
387
|
+
x_submitAs: "accountNumber"
|
|
388
|
+
}, {
|
|
389
|
+
displayName: "Annual Revenue",
|
|
390
|
+
name: "annualRevenue",
|
|
391
|
+
type: "number",
|
|
392
|
+
default: null,
|
|
393
|
+
x_submitAs: "annualRevenue"
|
|
394
|
+
}, {
|
|
395
|
+
displayName: "Number of Employees",
|
|
396
|
+
name: "numberOfEmployees",
|
|
397
|
+
type: "number",
|
|
398
|
+
default: null,
|
|
399
|
+
x_submitAs: "numberOfEmployees"
|
|
400
|
+
}, {
|
|
401
|
+
displayName: "Year Established",
|
|
402
|
+
name: "yearEstablished",
|
|
403
|
+
type: "number",
|
|
404
|
+
default: null,
|
|
405
|
+
description: "Year the company was established",
|
|
406
|
+
x_submitAs: "yearEstablished"
|
|
407
|
+
}, {
|
|
408
|
+
displayName: "Revenue Year",
|
|
409
|
+
name: "revenueYear",
|
|
410
|
+
type: "number",
|
|
411
|
+
default: null,
|
|
412
|
+
description: "Year of the revenue data",
|
|
413
|
+
x_submitAs: "revenueYear"
|
|
414
|
+
}, {
|
|
415
|
+
displayName: "Date Acquired",
|
|
416
|
+
name: "dateAcquired",
|
|
417
|
+
type: "dateTime",
|
|
418
|
+
default: "",
|
|
419
|
+
description: "Date the company was acquired"
|
|
420
|
+
}, {
|
|
421
|
+
displayName: "SIC Code",
|
|
422
|
+
name: "sicCode",
|
|
423
|
+
type: "options",
|
|
424
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
425
|
+
default: "",
|
|
426
|
+
typeOptions: {
|
|
427
|
+
loadOptionsMethod: "loadOptions_company_sicCodes"
|
|
428
|
+
},
|
|
429
|
+
x_submitAs: "sicCode.id"
|
|
430
|
+
}, {
|
|
431
|
+
displayName: "Parent Company",
|
|
432
|
+
name: "parentCompany",
|
|
433
|
+
type: "options",
|
|
434
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
435
|
+
default: "",
|
|
436
|
+
typeOptions: {
|
|
437
|
+
loadOptionsMethod: "loadOptions_company_companies"
|
|
438
|
+
},
|
|
439
|
+
x_submitAs: "parentCompany.id"
|
|
440
|
+
}, {
|
|
441
|
+
displayName: "Ownership Type",
|
|
442
|
+
name: "ownershipType",
|
|
443
|
+
type: "options",
|
|
444
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
445
|
+
default: "",
|
|
446
|
+
typeOptions: {
|
|
447
|
+
loadOptionsMethod: "loadOptions_company_ownershipTypes"
|
|
448
|
+
},
|
|
449
|
+
x_submitAs: "ownershipType.id"
|
|
450
|
+
}, {
|
|
451
|
+
displayName: "Lead Source",
|
|
452
|
+
name: "leadSource",
|
|
453
|
+
type: "string",
|
|
454
|
+
default: "",
|
|
455
|
+
description: "Source of the lead",
|
|
456
|
+
typeOptions: {
|
|
457
|
+
maxLength: 50
|
|
458
|
+
}
|
|
459
|
+
} ]
|
|
460
|
+
}, {
|
|
461
|
+
displayName: "Classification",
|
|
462
|
+
name: "classificationCollection",
|
|
463
|
+
type: "collection",
|
|
464
|
+
default: {},
|
|
465
|
+
placeholder: "Add Classification",
|
|
466
|
+
displayOptions: {
|
|
467
|
+
show: {
|
|
468
|
+
operation: [ "create", "update" ]
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
options: [ {
|
|
472
|
+
displayName: "Is Vendor",
|
|
473
|
+
name: "isVendorFlag",
|
|
474
|
+
type: "boolean",
|
|
475
|
+
default: !1,
|
|
476
|
+
description: "Whether this company is a vendor"
|
|
477
|
+
}, {
|
|
478
|
+
displayName: "Lead Flag",
|
|
479
|
+
name: "leadFlag",
|
|
480
|
+
type: "boolean",
|
|
481
|
+
default: !1,
|
|
482
|
+
description: "Whether this company is a lead"
|
|
483
|
+
}, {
|
|
484
|
+
displayName: "Unsubscribe Flag",
|
|
485
|
+
name: "unsubscribeFlag",
|
|
486
|
+
type: "boolean",
|
|
487
|
+
default: !1,
|
|
488
|
+
description: "Whether this company has unsubscribed from communications"
|
|
489
|
+
} ]
|
|
490
|
+
}, {
|
|
491
|
+
displayName: "Territory & Management",
|
|
492
|
+
name: "territoryCollection",
|
|
493
|
+
type: "collection",
|
|
494
|
+
default: {},
|
|
495
|
+
placeholder: "Add Territory & Management Information",
|
|
496
|
+
displayOptions: {
|
|
497
|
+
show: {
|
|
498
|
+
operation: [ "create", "update" ]
|
|
499
|
+
}
|
|
500
|
+
},
|
|
501
|
+
options: [ {
|
|
502
|
+
displayName: "Territory",
|
|
503
|
+
name: "territory",
|
|
504
|
+
type: "options",
|
|
505
|
+
default: "",
|
|
506
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
507
|
+
typeOptions: {
|
|
508
|
+
loadOptionsMethod: "loadOptions_system_locations"
|
|
509
|
+
},
|
|
510
|
+
x_submitAs: "territory.id"
|
|
511
|
+
}, {
|
|
512
|
+
displayName: "Market",
|
|
513
|
+
name: "market",
|
|
514
|
+
type: "options",
|
|
515
|
+
default: "",
|
|
516
|
+
description: 'Market classification. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
517
|
+
typeOptions: {
|
|
518
|
+
loadOptionsMethod: "loadOptions_company_marketDescriptions"
|
|
519
|
+
},
|
|
520
|
+
x_submitAs: "market.id"
|
|
521
|
+
}, {
|
|
522
|
+
displayName: "Territory Manager",
|
|
523
|
+
name: "territoryManager",
|
|
524
|
+
type: "options",
|
|
525
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
526
|
+
default: "",
|
|
527
|
+
typeOptions: {
|
|
528
|
+
loadOptionsMethod: "loadOptions_system_members"
|
|
529
|
+
},
|
|
530
|
+
x_submitAs: "territoryManager.id"
|
|
531
|
+
}, {
|
|
532
|
+
displayName: "Calendar",
|
|
533
|
+
name: "calendar",
|
|
534
|
+
type: "options",
|
|
535
|
+
default: "",
|
|
536
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
537
|
+
typeOptions: {
|
|
538
|
+
loadOptionsMethod: "loadOptions_schedule_calendars"
|
|
539
|
+
},
|
|
540
|
+
x_submitAs: "calendar.id"
|
|
541
|
+
} ]
|
|
542
|
+
}, {
|
|
543
|
+
displayName: "Financial & Billing",
|
|
544
|
+
name: "financialCollection",
|
|
545
|
+
type: "collection",
|
|
546
|
+
default: {},
|
|
547
|
+
placeholder: "Add Financial & Billing Information",
|
|
548
|
+
displayOptions: {
|
|
549
|
+
show: {
|
|
550
|
+
operation: [ "create", "update" ]
|
|
551
|
+
}
|
|
552
|
+
},
|
|
553
|
+
options: [ {
|
|
554
|
+
displayName: "Tax Identifier",
|
|
555
|
+
name: "taxIdentifier",
|
|
556
|
+
type: "string",
|
|
557
|
+
default: "",
|
|
558
|
+
description: "Tax identification number"
|
|
559
|
+
}, {
|
|
560
|
+
displayName: "Vendor Identifier",
|
|
561
|
+
name: "vendorIdentifier",
|
|
562
|
+
type: "string",
|
|
563
|
+
default: "",
|
|
564
|
+
description: "Vendor identification number"
|
|
565
|
+
}, {
|
|
566
|
+
displayName: "Tax Code",
|
|
567
|
+
name: "taxCode",
|
|
568
|
+
type: "options",
|
|
569
|
+
default: "",
|
|
570
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
571
|
+
typeOptions: {
|
|
572
|
+
loadOptionsMethod: "loadOptions_finance_taxCodes"
|
|
573
|
+
},
|
|
574
|
+
x_submitAs: "taxCode.id"
|
|
575
|
+
}, {
|
|
576
|
+
displayName: "Billing Terms",
|
|
577
|
+
name: "billingTerms",
|
|
578
|
+
type: "options",
|
|
579
|
+
default: "",
|
|
580
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
581
|
+
typeOptions: {
|
|
582
|
+
loadOptionsMethod: "loadOptions_finance_billingTerms"
|
|
583
|
+
},
|
|
584
|
+
x_submitAs: "billingTerms.id"
|
|
585
|
+
}, {
|
|
586
|
+
displayName: "Invoice Template",
|
|
587
|
+
name: "invoiceTemplate",
|
|
588
|
+
type: "options",
|
|
589
|
+
default: "",
|
|
590
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
591
|
+
typeOptions: {
|
|
592
|
+
loadOptionsMethod: "loadOptions_finance_invoiceTemplates"
|
|
593
|
+
},
|
|
594
|
+
x_submitAs: "invoiceTemplate.id"
|
|
595
|
+
}, {
|
|
596
|
+
displayName: "Pricing Schedule",
|
|
597
|
+
name: "pricingSchedule",
|
|
598
|
+
type: "options",
|
|
599
|
+
default: "",
|
|
600
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
601
|
+
typeOptions: {
|
|
602
|
+
loadOptionsMethod: "loadOptions_procurement_pricingSchedules"
|
|
603
|
+
},
|
|
604
|
+
x_submitAs: "pricingSchedule.id"
|
|
605
|
+
}, {
|
|
606
|
+
displayName: "Company Entity Type",
|
|
607
|
+
name: "companyEntityType",
|
|
608
|
+
type: "options",
|
|
609
|
+
default: "",
|
|
610
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
611
|
+
typeOptions: {
|
|
612
|
+
loadOptionsMethod: "loadOptions_company_entityTypes"
|
|
613
|
+
},
|
|
614
|
+
x_submitAs: "companyEntityType.id"
|
|
615
|
+
}, {
|
|
616
|
+
displayName: "Bill To Company",
|
|
617
|
+
name: "billToCompany",
|
|
618
|
+
type: "options",
|
|
619
|
+
default: "",
|
|
620
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
621
|
+
typeOptions: {
|
|
622
|
+
loadOptionsMethod: "loadOptions_company_companies"
|
|
623
|
+
},
|
|
624
|
+
x_submitAs: "billToCompany.id"
|
|
625
|
+
}, {
|
|
626
|
+
displayName: "Billing Site",
|
|
627
|
+
name: "billingSite",
|
|
628
|
+
type: "options",
|
|
629
|
+
default: "",
|
|
630
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
631
|
+
typeOptions: {
|
|
632
|
+
loadOptionsMethod: "loadOptions_company_sites"
|
|
633
|
+
},
|
|
634
|
+
x_submitAs: "billingSite.id"
|
|
635
|
+
}, {
|
|
636
|
+
displayName: "Billing Contact ID",
|
|
637
|
+
name: "billingContact",
|
|
638
|
+
type: "number",
|
|
639
|
+
default: null,
|
|
640
|
+
description: "Billing contact ID number",
|
|
641
|
+
x_submitAs: "billingContact.id"
|
|
642
|
+
}, {
|
|
643
|
+
displayName: "Invoice Delivery Method",
|
|
644
|
+
name: "invoiceDeliveryMethod",
|
|
645
|
+
type: "options",
|
|
646
|
+
default: "",
|
|
647
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
648
|
+
typeOptions: {
|
|
649
|
+
loadOptionsMethod: "loadOptions_finance_invoiceDeliveryMethods"
|
|
650
|
+
},
|
|
651
|
+
x_submitAs: "invoiceDeliveryMethod.id"
|
|
652
|
+
}, {
|
|
653
|
+
displayName: "Invoice To Email Address",
|
|
654
|
+
name: "invoiceToEmailAddress",
|
|
655
|
+
type: "string",
|
|
656
|
+
default: "",
|
|
657
|
+
description: "Email address for invoice delivery",
|
|
658
|
+
placeholder: "billing@company.com"
|
|
659
|
+
}, {
|
|
660
|
+
displayName: "Invoice CC Email Address",
|
|
661
|
+
name: "invoiceCCEmailAddress",
|
|
662
|
+
type: "string",
|
|
663
|
+
default: "",
|
|
664
|
+
placeholder: "e.g. accounting@company.com,billing@company.com",
|
|
665
|
+
description: "CC email address for invoice delivery"
|
|
666
|
+
}, {
|
|
667
|
+
displayName: "Currency",
|
|
668
|
+
name: "currency",
|
|
669
|
+
type: "options",
|
|
670
|
+
default: "",
|
|
671
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
672
|
+
typeOptions: {
|
|
673
|
+
loadOptionsMethod: "loadOptions_finance_currencies"
|
|
674
|
+
},
|
|
675
|
+
x_submitAs: "currency.id"
|
|
676
|
+
} ]
|
|
677
|
+
}, ...(0, import_common.getCommonFields)("company_companies") ], companySchema = {
|
|
678
|
+
resource: "company",
|
|
679
|
+
displayName: "Company",
|
|
680
|
+
pluralDisplayName: "Companies",
|
|
681
|
+
description: "Manage ConnectWise companies",
|
|
682
|
+
identifierField: "identifier",
|
|
683
|
+
nameField: "name",
|
|
684
|
+
fieldDetection: {
|
|
685
|
+
endpoint: "/company/companies",
|
|
686
|
+
sampleSize: 3
|
|
687
|
+
},
|
|
688
|
+
endpoints: {
|
|
689
|
+
create: {
|
|
690
|
+
method: "POST",
|
|
691
|
+
path: params => "/company/companies"
|
|
692
|
+
},
|
|
693
|
+
update: {
|
|
694
|
+
method: "PATCH",
|
|
695
|
+
path: params => `/company/companies/${params.id}`
|
|
696
|
+
},
|
|
697
|
+
get: {
|
|
698
|
+
method: "GET",
|
|
699
|
+
path: params => `/company/companies/${params.id}`
|
|
700
|
+
},
|
|
701
|
+
getAll: {
|
|
702
|
+
method: "GET",
|
|
703
|
+
path: params => "/company/companies"
|
|
704
|
+
},
|
|
705
|
+
delete: {
|
|
706
|
+
method: "DELETE",
|
|
707
|
+
path: params => `/company/companies/${params.id}`
|
|
708
|
+
}
|
|
709
|
+
},
|
|
710
|
+
fields: companyFields
|
|
711
|
+
};
|
|
712
|
+
|
|
713
|
+
async function execute(operation, i) {
|
|
714
|
+
return import_transport.executeResourceOperation.call(this, companySchema, operation, i);
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
0 && (module.exports = {
|
|
718
|
+
companySchema: companySchema,
|
|
719
|
+
execute: execute
|
|
720
|
+
});
|