@mspcopilot/n8n-nodes-connectwise 0.1.6 → 0.1.7
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 +9 -2
- package/dist-community/credentials/ConnectWisePsaApi.credentials.js +7 -7
- package/dist-community/credentials/connectwise-dark.svg +1 -0
- package/dist-community/nodes/ConnectWise/PSA/ConnectWisePsa.node.js +11 -4
- package/dist-community/nodes/ConnectWise/PSA/connectwise-dark.svg +1 -0
- package/dist-community/nodes/ConnectWise/PSA/descriptions/common.descriptions.js +1 -1
- package/dist-community/nodes/ConnectWise/PSA/descriptions/common.properties.js +2 -2
- package/dist-community/nodes/ConnectWise/PSA/helpers/utils.js +2 -1
- package/dist-community/nodes/ConnectWise/PSA/methods/fieldOptions.js +3 -1
- package/dist-community/nodes/ConnectWise/PSA/schema/references.js +2 -1
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/activity.schema.js +1 -1
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/alert-consolidation.js +1 -1
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/company.schema.js +1 -1
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/contact.schema.js +1 -1
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/custom.schema.js +1 -1
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/diagnostics.schema.js +106 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/index.js +5 -1
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/members.schema.js +8 -2
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/reports.schema.js +1 -1
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/ticket.schema.js +17 -24
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/ticketNote.schema.js +7 -1
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/ticketTask.schema.js +226 -0
- package/dist-community/nodes/ConnectWise/PSA/schema/resources/timeEntry.schema.js +1 -1
- package/dist-community/nodes/ConnectWise/PSA/schema/static-fields.js +62 -1
- package/dist-community/nodes/ConnectWise/PSA/transport/cache.js +21 -0
- package/dist-community/nodes/ConnectWise/PSA/transport/operations.js +3 -2
- package/dist-community/nodes/ConnectWise/PSA/transport/version-check.js +2 -2
- package/package.json +2 -2
- /package/dist-community/credentials/{connectwise.svg → connectwise-light.svg} +0 -0
- /package/dist-community/nodes/ConnectWise/PSA/{connectwise.svg → connectwise-light.svg} +0 -0
package/README.md
CHANGED
|
@@ -11,6 +11,12 @@ and extensibility.
|
|
|
11
11
|
|
|
12
12
|
**WARNING**: This is beta. Just because it works for us, doesn't mean there won't be obvious bugs I haven't found yet. :)
|
|
13
13
|
|
|
14
|
+
## Workflow Examples
|
|
15
|
+
|
|
16
|
+
More info at [https://mspcopilot.io/n8n-nodes/connectwise-psa](https://mspcopilot.io/n8n-nodes/connectwise-psa)
|
|
17
|
+
|
|
18
|
+
Workflow examples at [https://mspcopilot.io/n8n-workflows](https://mspcopilot.io/n8n-workflows)
|
|
19
|
+
|
|
14
20
|
## Covered Actions (so far)
|
|
15
21
|
- Activities
|
|
16
22
|
- Companies
|
|
@@ -18,6 +24,7 @@ and extensibility.
|
|
|
18
24
|
- Members
|
|
19
25
|
- Tickets
|
|
20
26
|
- Ticket Notes
|
|
27
|
+
- Ticket Tasks (NEW)
|
|
21
28
|
- Time Entries
|
|
22
29
|
|
|
23
30
|
## Features
|
|
@@ -49,8 +56,8 @@ and extensibility.
|
|
|
49
56
|
- Auto link to IT Glue assets, Microsoft tenants, etc.
|
|
50
57
|
- More n8n nodes
|
|
51
58
|
- [UniFi Site Manager](https://www.npmjs.com/package/@mspcopilot/n8n-nodes-unifi-sitemanager)
|
|
52
|
-
-
|
|
53
|
-
- Microsoft Partner GDAP
|
|
59
|
+
- In Testing:
|
|
60
|
+
- [Microsoft Partner GDAP](https://mspcopilot.io/n8n-nodes/microsoft-partner-gdap)
|
|
54
61
|
- IT Glue
|
|
55
62
|
- Zabbix
|
|
56
63
|
- UniFi Local Controller
|
|
@@ -31,13 +31,16 @@ __export(ConnectWisePsaApi_credentials_exports, {
|
|
|
31
31
|
|
|
32
32
|
module.exports = __toCommonJS(ConnectWisePsaApi_credentials_exports);
|
|
33
33
|
|
|
34
|
-
var import_transport = require("../nodes/ConnectWise/PSA/transport");
|
|
34
|
+
var import_common = require("../nodes/ConnectWise/PSA/descriptions/common.descriptions"), import_transport = require("../nodes/ConnectWise/PSA/transport");
|
|
35
35
|
|
|
36
36
|
class ConnectWisePsaApi {
|
|
37
37
|
name="connectWisePsaApi";
|
|
38
38
|
displayName="ConnectWise PSA API";
|
|
39
|
-
documentationUrl
|
|
40
|
-
icon=
|
|
39
|
+
documentationUrl=`https://${import_common.DOCURL_PREFIX}/n8n-nodes-connectwise/credentials${import_common.DOCURL_SUFFIX}`;
|
|
40
|
+
icon={
|
|
41
|
+
light: "file:connectwise-light.svg",
|
|
42
|
+
dark: "file:connectwise-dark.svg"
|
|
43
|
+
};
|
|
41
44
|
properties=[ {
|
|
42
45
|
displayName: "ConnectWise Site",
|
|
43
46
|
name: "site",
|
|
@@ -91,9 +94,6 @@ class ConnectWisePsaApi {
|
|
|
91
94
|
name: "publicKey",
|
|
92
95
|
type: "string",
|
|
93
96
|
default: "",
|
|
94
|
-
typeOptions: {
|
|
95
|
-
password: !0
|
|
96
|
-
},
|
|
97
97
|
required: !0
|
|
98
98
|
}, {
|
|
99
99
|
displayName: "Private Key",
|
|
@@ -117,7 +117,7 @@ class ConnectWisePsaApi {
|
|
|
117
117
|
name: "checkForUpdates",
|
|
118
118
|
type: "boolean",
|
|
119
119
|
default: !1,
|
|
120
|
-
hint: "Current version: 0.1.
|
|
120
|
+
hint: "Current version: 0.1.7 (community edition)",
|
|
121
121
|
description: "Check for new versions of this node package and show notifications when updates are available"
|
|
122
122
|
} ];
|
|
123
123
|
async authenticate(credentials, requestOptions) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="244 340 504 252"><g transform="scale(2)"> <path d="M298.529 207.425C283.091 198.75 265.737 194.126 247.982 194.126C230.228 194.126 212.894 198.75 197.436 207.425C203.628 213.64 209.419 220.554 214.79 228.127C224.057 241.192 230.249 253.579 233.956 262.169L247.982 239.114L262.009 262.169C265.716 253.579 271.887 241.192 281.175 228.127C286.545 220.554 292.358 213.661 298.529 207.425ZM368.957 182.46C350.529 186.087 333.806 193.914 318.937 205.771C315.61 208.422 312.387 211.264 309.249 214.318C302.973 220.448 297.055 227.363 291.537 235.105C275.951 256.973 269.528 277.335 269.465 277.547C268.749 279.859 266.79 281.534 264.41 281.895C264.115 281.937 263.799 281.959 263.504 281.959C261.44 281.959 259.503 280.941 258.323 279.18L247.982 263.675L237.641 279.18C236.483 280.941 234.524 281.959 232.46 281.959C232.165 281.959 231.849 281.937 231.555 281.895C229.175 281.534 227.216 279.859 226.5 277.547C226.437 277.356 220.013 256.973 204.428 235.126C198.868 227.342 192.907 220.363 186.589 214.212C185.873 213.512 185.136 212.813 184.399 212.134C184.378 212.113 184.357 212.091 184.336 212.07C181.956 209.864 179.513 207.786 177.048 205.792C162.179 193.914 145.457 186.109 127.028 182.482C123.658 181.782 121.447 178.494 122.121 175.079C122.774 171.685 126.059 169.458 129.429 170.116C150.785 174.337 170.498 183.966 187.726 198.453C205.923 187.381 226.689 181.421 248.003 181.421C269.317 181.421 290.083 187.36 308.28 198.453C325.508 183.966 345.2 174.337 366.577 170.116C369.968 169.458 373.233 171.664 373.886 175.079C374.539 178.494 372.327 181.782 368.957 182.46ZM169.129 212.41C147.584 232.114 133.389 259.242 129.198 288.767C128.713 292.225 131.093 295.449 134.547 295.936C138.001 296.424 141.181 294.027 141.666 290.549C145.436 263.93 158.199 239.517 177.596 221.785C178.754 220.724 179.955 219.685 181.155 218.667C178.017 215.676 174.795 212.876 171.467 210.31C170.688 211.01 169.909 211.688 169.129 212.41ZM366.788 288.767C367.273 292.225 364.893 295.449 361.439 295.936C361.144 295.979 360.828 296 360.533 296C357.458 296 354.762 293.709 354.299 290.549C350.529 263.93 337.766 239.517 318.369 221.785C317.189 220.724 316.01 219.685 314.809 218.667C317.947 215.676 321.17 212.876 324.497 210.31C325.298 210.988 326.077 211.688 326.856 212.41C348.423 232.114 362.597 259.242 366.788 288.767Z" fill="#f8f8f8"/> </g></svg>
|
|
@@ -31,7 +31,7 @@ __export(ConnectWisePsa_node_exports, {
|
|
|
31
31
|
|
|
32
32
|
module.exports = __toCommonJS(ConnectWisePsa_node_exports);
|
|
33
33
|
|
|
34
|
-
var import_n8n_workflow = require("n8n-workflow"), import_methods = require("./methods"), import_fieldOptions = require("./methods/fieldOptions"), import_activity = require("./schema/resources/activity.schema"), import_company = require("./schema/resources/company.schema"), import_contact = require("./schema/resources/contact.schema"), import_members = require("./schema/resources/members.schema"), import_reports = require("./schema/resources/reports.schema"), import_ticket = require("./schema/resources/ticket.schema"), import_ticketNote = require("./schema/resources/ticketNote.schema"), import_timeEntry = require("./schema/resources/timeEntry.schema"), import_custom = require("./schema/resources/custom.schema");
|
|
34
|
+
var import_n8n_workflow = require("n8n-workflow"), import_methods = require("./methods"), import_fieldOptions = require("./methods/fieldOptions"), import_activity = require("./schema/resources/activity.schema"), import_company = require("./schema/resources/company.schema"), import_contact = require("./schema/resources/contact.schema"), import_diagnostics = require("./schema/resources/diagnostics.schema"), import_members = require("./schema/resources/members.schema"), import_reports = require("./schema/resources/reports.schema"), import_ticket = require("./schema/resources/ticket.schema"), import_ticketNote = require("./schema/resources/ticketNote.schema"), import_ticketTask = require("./schema/resources/ticketTask.schema"), import_timeEntry = require("./schema/resources/timeEntry.schema"), import_custom = require("./schema/resources/custom.schema");
|
|
35
35
|
|
|
36
36
|
const resources = {
|
|
37
37
|
activity: {
|
|
@@ -58,6 +58,10 @@ const resources = {
|
|
|
58
58
|
schema: import_ticketNote.ticketNoteSchema,
|
|
59
59
|
execute: import_ticketNote.execute
|
|
60
60
|
},
|
|
61
|
+
ticketTask: {
|
|
62
|
+
schema: import_ticketTask.ticketTaskSchema,
|
|
63
|
+
execute: import_ticketTask.execute
|
|
64
|
+
},
|
|
61
65
|
timeEntry: {
|
|
62
66
|
schema: import_timeEntry.timeEntrySchema,
|
|
63
67
|
execute: import_timeEntry.execute
|
|
@@ -75,7 +79,10 @@ class ConnectWisePsa {
|
|
|
75
79
|
description={
|
|
76
80
|
displayName: "ConnectWise PSA",
|
|
77
81
|
name: "connectWisePsa",
|
|
78
|
-
icon:
|
|
82
|
+
icon: {
|
|
83
|
+
light: "file:connectwise-light.svg",
|
|
84
|
+
dark: "file:connectwise-dark.svg"
|
|
85
|
+
},
|
|
79
86
|
group: [ "transform" ],
|
|
80
87
|
version: 1,
|
|
81
88
|
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
@@ -83,8 +90,8 @@ class ConnectWisePsa {
|
|
|
83
90
|
defaults: {
|
|
84
91
|
name: "ConnectWise PSA"
|
|
85
92
|
},
|
|
86
|
-
inputs: [
|
|
87
|
-
outputs: [
|
|
93
|
+
inputs: [ "main" ],
|
|
94
|
+
outputs: [ "main" ],
|
|
88
95
|
credentials: [ {
|
|
89
96
|
name: "connectWisePsaApi",
|
|
90
97
|
required: !0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="244 340 504 252"><g transform="scale(2)"> <path d="M298.529 207.425C283.091 198.75 265.737 194.126 247.982 194.126C230.228 194.126 212.894 198.75 197.436 207.425C203.628 213.64 209.419 220.554 214.79 228.127C224.057 241.192 230.249 253.579 233.956 262.169L247.982 239.114L262.009 262.169C265.716 253.579 271.887 241.192 281.175 228.127C286.545 220.554 292.358 213.661 298.529 207.425ZM368.957 182.46C350.529 186.087 333.806 193.914 318.937 205.771C315.61 208.422 312.387 211.264 309.249 214.318C302.973 220.448 297.055 227.363 291.537 235.105C275.951 256.973 269.528 277.335 269.465 277.547C268.749 279.859 266.79 281.534 264.41 281.895C264.115 281.937 263.799 281.959 263.504 281.959C261.44 281.959 259.503 280.941 258.323 279.18L247.982 263.675L237.641 279.18C236.483 280.941 234.524 281.959 232.46 281.959C232.165 281.959 231.849 281.937 231.555 281.895C229.175 281.534 227.216 279.859 226.5 277.547C226.437 277.356 220.013 256.973 204.428 235.126C198.868 227.342 192.907 220.363 186.589 214.212C185.873 213.512 185.136 212.813 184.399 212.134C184.378 212.113 184.357 212.091 184.336 212.07C181.956 209.864 179.513 207.786 177.048 205.792C162.179 193.914 145.457 186.109 127.028 182.482C123.658 181.782 121.447 178.494 122.121 175.079C122.774 171.685 126.059 169.458 129.429 170.116C150.785 174.337 170.498 183.966 187.726 198.453C205.923 187.381 226.689 181.421 248.003 181.421C269.317 181.421 290.083 187.36 308.28 198.453C325.508 183.966 345.2 174.337 366.577 170.116C369.968 169.458 373.233 171.664 373.886 175.079C374.539 178.494 372.327 181.782 368.957 182.46ZM169.129 212.41C147.584 232.114 133.389 259.242 129.198 288.767C128.713 292.225 131.093 295.449 134.547 295.936C138.001 296.424 141.181 294.027 141.666 290.549C145.436 263.93 158.199 239.517 177.596 221.785C178.754 220.724 179.955 219.685 181.155 218.667C178.017 215.676 174.795 212.876 171.467 210.31C170.688 211.01 169.909 211.688 169.129 212.41ZM366.788 288.767C367.273 292.225 364.893 295.449 361.439 295.936C361.144 295.979 360.828 296 360.533 296C357.458 296 354.762 293.709 354.299 290.549C350.529 263.93 337.766 239.517 318.369 221.785C317.189 220.724 316.01 219.685 314.809 218.667C317.947 215.676 321.17 212.876 324.497 210.31C325.298 210.988 326.077 211.688 326.856 212.41C348.423 232.114 362.597 259.242 366.788 288.767Z" fill="#f8f8f8"/> </g></svg>
|
|
@@ -35,7 +35,7 @@ __export(common_descriptions_exports, {
|
|
|
35
35
|
|
|
36
36
|
module.exports = __toCommonJS(common_descriptions_exports);
|
|
37
37
|
|
|
38
|
-
const DOCURL_PREFIX = "mspcopilot.io/docs
|
|
38
|
+
const DOCURL_PREFIX = "mspcopilot.io/docs", DOCURL_SUFFIX = "?utm_source=n8n_node_connectwise", CHANGELOG_URL = "mspcopilot.io/changelog${DOCURL_SUFFIX}", VERSION_CHECK_URL = "https://djstgzbunlbcnghwfzja.supabase.co/functions/v1/version-check/n8n-nodes-connectwise", VERSION_CHECK_CACHE_TTL = 6e5;
|
|
39
39
|
|
|
40
40
|
0 && (module.exports = {
|
|
41
41
|
CHANGELOG_URL: CHANGELOG_URL,
|
|
@@ -157,7 +157,7 @@ const additionalFieldsProperty = {
|
|
|
157
157
|
default: "",
|
|
158
158
|
placeholder: 'e.g. name like "Acme%"',
|
|
159
159
|
description: "Filter conditions using ConnectWise query syntax",
|
|
160
|
-
hint: `Use <a href="https://${import_common.DOCURL_PREFIX}
|
|
160
|
+
hint: `Use <a href="https://${import_common.DOCURL_PREFIX}/n8n-nodes-connectwise/conditions${import_common.DOCURL_SUFFIX}">ConnectWise query syntax</a> for filtering results`
|
|
161
161
|
},
|
|
162
162
|
fields: {
|
|
163
163
|
displayName: "Field Names",
|
|
@@ -271,7 +271,7 @@ function getCustomFieldsProperty(resourceKey) {
|
|
|
271
271
|
};
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
-
function getCommonFields(
|
|
274
|
+
function getCommonFields(options) {
|
|
275
275
|
let fields = [ {
|
|
276
276
|
...assignmentsProperty,
|
|
277
277
|
displayOptions: {
|
|
@@ -52,7 +52,8 @@ function parseDuration(duration) {
|
|
|
52
52
|
if (!duration) return 0;
|
|
53
53
|
if (/^\d+$/.test(duration.trim())) return parseInt(duration, 10) * 1e3;
|
|
54
54
|
const milliseconds = ms(duration);
|
|
55
|
-
|
|
55
|
+
if (typeof milliseconds != "number" || isNaN(milliseconds)) throw new Error(`Invalid duration format: "${duration}". Expected formats like "5m", "2h", "30s", "1d", or plain numbers (treated as seconds).`);
|
|
56
|
+
return milliseconds;
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
function processFieldsArray(fields) {
|
|
@@ -33,7 +33,7 @@ __export(fieldOptions_exports, {
|
|
|
33
33
|
|
|
34
34
|
module.exports = __toCommonJS(fieldOptions_exports);
|
|
35
35
|
|
|
36
|
-
var import_client = require("../transport/client"), import_static_fields = require("../schema/static-fields"), import_customFields = require("../helpers/customFields"), import_company = require("../schema/resources/company.schema"), import_contact = require("../schema/resources/contact.schema"), import_activity = require("../schema/resources/activity.schema"), import_ticket = require("../schema/resources/ticket.schema"), import_members = require("../schema/resources/members.schema"), import_ticketNote = require("../schema/resources/ticketNote.schema"), import_timeEntry = require("../schema/resources/timeEntry.schema"), import_reports = require("../schema/resources/reports.schema"), import_custom = require("../schema/resources/custom.schema");
|
|
36
|
+
var import_client = require("../transport/client"), import_static_fields = require("../schema/static-fields"), import_customFields = require("../helpers/customFields"), import_company = require("../schema/resources/company.schema"), import_contact = require("../schema/resources/contact.schema"), import_activity = require("../schema/resources/activity.schema"), import_ticket = require("../schema/resources/ticket.schema"), import_members = require("../schema/resources/members.schema"), import_ticketNote = require("../schema/resources/ticketNote.schema"), import_ticketTask = require("../schema/resources/ticketTask.schema"), import_timeEntry = require("../schema/resources/timeEntry.schema"), import_reports = require("../schema/resources/reports.schema"), import_custom = require("../schema/resources/custom.schema");
|
|
37
37
|
|
|
38
38
|
const resourceSchemas = {
|
|
39
39
|
company: import_company.companySchema,
|
|
@@ -42,6 +42,7 @@ const resourceSchemas = {
|
|
|
42
42
|
ticket: import_ticket.ticketSchema,
|
|
43
43
|
members: import_members.membersSchema,
|
|
44
44
|
ticketNote: import_ticketNote.ticketNoteSchema,
|
|
45
|
+
ticketTask: import_ticketTask.ticketTaskSchema,
|
|
45
46
|
timeEntry: import_timeEntry.timeEntrySchema,
|
|
46
47
|
reports: import_reports.reportsSchema,
|
|
47
48
|
custom: import_custom.customSchema
|
|
@@ -60,6 +61,7 @@ const resourceToStaticFieldKey = {
|
|
|
60
61
|
ticket: "tickets",
|
|
61
62
|
members: "system_members",
|
|
62
63
|
ticketNote: "ticketNotes",
|
|
64
|
+
ticketTask: "ticketTasks",
|
|
63
65
|
timeEntry: "time_entries"
|
|
64
66
|
};
|
|
65
67
|
|
|
@@ -367,7 +367,7 @@ const activityFields = [ {
|
|
|
367
367
|
},
|
|
368
368
|
x_submitAs: "campaign.id"
|
|
369
369
|
} ]
|
|
370
|
-
}, ...(0, import_common.getCommonFields)(
|
|
370
|
+
}, ...(0, import_common.getCommonFields)() ], activitySchema = {
|
|
371
371
|
resource: "activity",
|
|
372
372
|
displayName: "Activity",
|
|
373
373
|
pluralDisplayName: "Activities",
|
|
@@ -31,7 +31,7 @@ __export(alert_consolidation_exports, {
|
|
|
31
31
|
|
|
32
32
|
module.exports = __toCommonJS(alert_consolidation_exports);
|
|
33
33
|
|
|
34
|
-
var import_n8n_workflow = require("n8n-workflow"), import_luxon = require("luxon"), import_client = require("../../transport/client"), import_utils = require("../../helpers/utils");
|
|
34
|
+
var import_n8n_workflow = require("n8n-workflow"), import_luxon = require("luxon"), import_crypto = require("crypto"), import_client = require("../../transport/client"), import_utils = require("../../helpers/utils");
|
|
35
35
|
|
|
36
36
|
const executeSmartConsolidationStub = async function(itemIndex) {
|
|
37
37
|
return (0, import_utils.returnProOnlyMessage)(this, itemIndex);
|
|
@@ -674,7 +674,7 @@ const companyFields = [ {
|
|
|
674
674
|
},
|
|
675
675
|
x_submitAs: "currency.id"
|
|
676
676
|
} ]
|
|
677
|
-
}, ...(0, import_common.getCommonFields)(
|
|
677
|
+
}, ...(0, import_common.getCommonFields)() ], companySchema = {
|
|
678
678
|
resource: "company",
|
|
679
679
|
displayName: "Company",
|
|
680
680
|
pluralDisplayName: "Companies",
|
|
@@ -415,7 +415,7 @@ const contactFields = [ {
|
|
|
415
415
|
description: "Whether portal login is disabled for the contact",
|
|
416
416
|
x_submitAs: "disablePortalLoginFlag"
|
|
417
417
|
} ]
|
|
418
|
-
}, (0, import_common.getCustomFieldsProperty)("company_contacts"), ...(0, import_common.getCommonFields)(
|
|
418
|
+
}, (0, import_common.getCustomFieldsProperty)("company_contacts"), ...(0, import_common.getCommonFields)() ], contactSchema = {
|
|
419
419
|
resource: "contact",
|
|
420
420
|
displayName: "Contact",
|
|
421
421
|
pluralDisplayName: "Contacts",
|
|
@@ -102,7 +102,7 @@ const customFields = [ {
|
|
|
102
102
|
description: "Value for the custom field. Leave empty to nullify. Ensure you pass a value compatible with the field type. Checkbox can be true/false/1/0/on/off."
|
|
103
103
|
} ]
|
|
104
104
|
} ]
|
|
105
|
-
}, ...(0, import_common.getCommonFields)(
|
|
105
|
+
}, ...(0, import_common.getCommonFields)({
|
|
106
106
|
overrides: {
|
|
107
107
|
fields: {
|
|
108
108
|
type: "string",
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
|
|
11
|
+
var __export = (target, all) => {
|
|
12
|
+
for (var name in all) __defProp(target, name, {
|
|
13
|
+
get: all[name],
|
|
14
|
+
enumerable: !0
|
|
15
|
+
});
|
|
16
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
18
|
+
get: () => from[key],
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {},
|
|
25
|
+
__copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: !0
|
|
28
|
+
}) : target, mod)), __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
29
|
+
value: !0
|
|
30
|
+
}), mod);
|
|
31
|
+
|
|
32
|
+
var diagnostics_schema_exports = {};
|
|
33
|
+
|
|
34
|
+
__export(diagnostics_schema_exports, {
|
|
35
|
+
diagnosticsSchema: () => diagnosticsSchema,
|
|
36
|
+
execute: () => execute
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
module.exports = __toCommonJS(diagnostics_schema_exports);
|
|
40
|
+
|
|
41
|
+
const diagnosticsFields = [ {
|
|
42
|
+
displayName: "Operation",
|
|
43
|
+
name: "operation",
|
|
44
|
+
type: "options",
|
|
45
|
+
noDataExpression: !0,
|
|
46
|
+
displayOptions: {
|
|
47
|
+
show: {
|
|
48
|
+
resource: [ "diagnostics" ]
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
options: [ {
|
|
52
|
+
name: "Clear Cache",
|
|
53
|
+
value: "clearCache",
|
|
54
|
+
description: "Clear all cached ConnectWise PSA data",
|
|
55
|
+
action: "Clear all cache entries"
|
|
56
|
+
} ],
|
|
57
|
+
default: "clearCache"
|
|
58
|
+
} ], diagnosticsSchema = {
|
|
59
|
+
resource: "diagnostics",
|
|
60
|
+
displayName: "Diagnostics",
|
|
61
|
+
description: "Diagnostic and maintenance operations",
|
|
62
|
+
endpoints: {},
|
|
63
|
+
fields: diagnosticsFields
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
async function execute(operation, i) {
|
|
67
|
+
if (operation === "clearCache") try {
|
|
68
|
+
const {clearAllCached: clearAllCached} = await import("../../transport/cache.js"), clearedCount = await clearAllCached(), result = {
|
|
69
|
+
success: !0,
|
|
70
|
+
clearedCount: clearedCount,
|
|
71
|
+
message: `Cleared ${clearedCount} cache entries`
|
|
72
|
+
};
|
|
73
|
+
return this.addExecutionHints({
|
|
74
|
+
message: `Cache cleared: ${clearedCount} entries removed`,
|
|
75
|
+
location: "outputPane"
|
|
76
|
+
}), this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(result), {
|
|
77
|
+
itemData: {
|
|
78
|
+
item: i
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
} catch (error) {
|
|
82
|
+
const originalError = error.message || "Unknown error occurred";
|
|
83
|
+
let friendlyMessage;
|
|
84
|
+
originalError.includes("isn't writeable") || originalError.includes("ECONNREFUSED") || originalError.includes("Connection is closed") || originalError.includes("Redis cache is not available") ? friendlyMessage = "Redis cache server is not running or not accessible. Please start Redis and ensure it is configured correctly (check QUEUE_BULL_REDIS_HOST and QUEUE_BULL_REDIS_PORT environment variables)." : originalError.includes("only available in the pro version") ? friendlyMessage = "Cache clearing requires the pro version of this node." : friendlyMessage = "Failed to clear cache. Please check the error details and your Redis configuration.";
|
|
85
|
+
const result = {
|
|
86
|
+
success: !1,
|
|
87
|
+
clearedCount: 0,
|
|
88
|
+
error: originalError,
|
|
89
|
+
message: friendlyMessage
|
|
90
|
+
};
|
|
91
|
+
return this.addExecutionHints({
|
|
92
|
+
message: friendlyMessage,
|
|
93
|
+
location: "outputPane"
|
|
94
|
+
}), this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(result), {
|
|
95
|
+
itemData: {
|
|
96
|
+
item: i
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
throw new Error(`Unsupported operation: ${operation}`);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
0 && (module.exports = {
|
|
104
|
+
diagnosticsSchema: diagnosticsSchema,
|
|
105
|
+
execute: execute
|
|
106
|
+
});
|
|
@@ -36,19 +36,21 @@ __export(resources_exports, {
|
|
|
36
36
|
executeReports: () => import_reports2.execute,
|
|
37
37
|
executeTicket: () => import_ticket2.execute,
|
|
38
38
|
executeTicketNote: () => import_ticketNote2.execute,
|
|
39
|
+
executeTicketTask: () => import_ticketTask2.execute,
|
|
39
40
|
executeTimeEntry: () => import_timeEntry2.execute,
|
|
40
41
|
loadReportColumns: () => import_reports3.loadReportColumns,
|
|
41
42
|
membersSchema: () => import_members.membersSchema,
|
|
42
43
|
reportsSchema: () => import_reports.reportsSchema,
|
|
43
44
|
ticketNoteSchema: () => import_ticketNote.ticketNoteSchema,
|
|
44
45
|
ticketSchema: () => import_ticket.ticketSchema,
|
|
46
|
+
ticketTaskSchema: () => import_ticketTask.ticketTaskSchema,
|
|
45
47
|
timeEntrySchema: () => import_timeEntry.timeEntrySchema,
|
|
46
48
|
transformReportData: () => import_reports3.transformReportData
|
|
47
49
|
});
|
|
48
50
|
|
|
49
51
|
module.exports = __toCommonJS(resources_exports);
|
|
50
52
|
|
|
51
|
-
var import_company = require("./company.schema"), import_contact = require("./contact.schema"), import_activity = require("./activity.schema"), import_ticket = require("./ticket.schema"), import_ticketNote = require("./ticketNote.schema"), import_members = require("./members.schema"), import_timeEntry = require("./timeEntry.schema"), import_reports = require("./reports.schema"), import_company2 = require("./company.schema"), import_contact2 = require("./contact.schema"), import_activity2 = require("./activity.schema"), import_ticket2 = require("./ticket.schema"), import_ticketNote2 = require("./ticketNote.schema"), import_members2 = require("./members.schema"), import_timeEntry2 = require("./timeEntry.schema"), import_reports2 = require("./reports.schema"), import_reports3 = require("./reports.schema");
|
|
53
|
+
var import_company = require("./company.schema"), import_contact = require("./contact.schema"), import_activity = require("./activity.schema"), import_ticket = require("./ticket.schema"), import_ticketNote = require("./ticketNote.schema"), import_ticketTask = require("./ticketTask.schema"), import_members = require("./members.schema"), import_timeEntry = require("./timeEntry.schema"), import_reports = require("./reports.schema"), import_company2 = require("./company.schema"), import_contact2 = require("./contact.schema"), import_activity2 = require("./activity.schema"), import_ticket2 = require("./ticket.schema"), import_ticketNote2 = require("./ticketNote.schema"), import_ticketTask2 = require("./ticketTask.schema"), import_members2 = require("./members.schema"), import_timeEntry2 = require("./timeEntry.schema"), import_reports2 = require("./reports.schema"), import_reports3 = require("./reports.schema");
|
|
52
54
|
|
|
53
55
|
0 && (module.exports = {
|
|
54
56
|
activitySchema: activitySchema,
|
|
@@ -61,12 +63,14 @@ var import_company = require("./company.schema"), import_contact = require("./co
|
|
|
61
63
|
executeReports: executeReports,
|
|
62
64
|
executeTicket: executeTicket,
|
|
63
65
|
executeTicketNote: executeTicketNote,
|
|
66
|
+
executeTicketTask: executeTicketTask,
|
|
64
67
|
executeTimeEntry: executeTimeEntry,
|
|
65
68
|
loadReportColumns: loadReportColumns,
|
|
66
69
|
membersSchema: membersSchema,
|
|
67
70
|
reportsSchema: reportsSchema,
|
|
68
71
|
ticketNoteSchema: ticketNoteSchema,
|
|
69
72
|
ticketSchema: ticketSchema,
|
|
73
|
+
ticketTaskSchema: ticketTaskSchema,
|
|
70
74
|
timeEntrySchema: timeEntrySchema,
|
|
71
75
|
transformReportData: transformReportData
|
|
72
76
|
});
|
|
@@ -89,7 +89,7 @@ const membersFields = [ {
|
|
|
89
89
|
displayName: "License Types",
|
|
90
90
|
name: "licenseTypes",
|
|
91
91
|
type: "multiOptions",
|
|
92
|
-
default: [],
|
|
92
|
+
default: [ "F" ],
|
|
93
93
|
options: [ {
|
|
94
94
|
name: "Full Member",
|
|
95
95
|
value: "F"
|
|
@@ -323,7 +323,13 @@ const membersFields = [ {
|
|
|
323
323
|
description: "Minimum hours required per day",
|
|
324
324
|
x_submitAs: "minimumHours"
|
|
325
325
|
} ]
|
|
326
|
-
}, ...(0, import_common.getCommonFields)(
|
|
326
|
+
}, ...(0, import_common.getCommonFields)({
|
|
327
|
+
overrides: {
|
|
328
|
+
returnAll: {
|
|
329
|
+
default: !0
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}) ], membersSchema = {
|
|
327
333
|
resource: "members",
|
|
328
334
|
displayName: "Members",
|
|
329
335
|
pluralDisplayName: "Members",
|
|
@@ -121,7 +121,7 @@ const reportsFields = [ {
|
|
|
121
121
|
},
|
|
122
122
|
default: !0,
|
|
123
123
|
hint: "Transform matrix format (column_definitions + row_values) to array of objects"
|
|
124
|
-
}, ...(0, import_common.getCommonFields)(
|
|
124
|
+
}, ...(0, import_common.getCommonFields)({
|
|
125
125
|
overrides: {
|
|
126
126
|
fields: {
|
|
127
127
|
typeOptions: {
|
|
@@ -175,7 +175,8 @@ const ticketFields = [ {
|
|
|
175
175
|
operation: [ "create", "update" ]
|
|
176
176
|
}
|
|
177
177
|
},
|
|
178
|
-
x_detectField: "auto"
|
|
178
|
+
x_detectField: "auto",
|
|
179
|
+
x_requiredOnCreate: !0
|
|
179
180
|
}, {
|
|
180
181
|
displayName: "Project",
|
|
181
182
|
name: "project",
|
|
@@ -246,17 +247,12 @@ const ticketFields = [ {
|
|
|
246
247
|
},
|
|
247
248
|
displayOptions: {
|
|
248
249
|
show: {
|
|
249
|
-
operation: [ "create", "update" ]
|
|
250
|
-
board: [ {
|
|
251
|
-
_cnd: {
|
|
252
|
-
exists: !0
|
|
253
|
-
}
|
|
254
|
-
} ]
|
|
250
|
+
operation: [ "create", "update" ]
|
|
255
251
|
}
|
|
256
252
|
},
|
|
257
253
|
x_detectField: "auto"
|
|
258
254
|
}, {
|
|
259
|
-
displayName: "Priority ID
|
|
255
|
+
displayName: "Priority ID",
|
|
260
256
|
name: "priority",
|
|
261
257
|
type: "options",
|
|
262
258
|
default: "",
|
|
@@ -485,7 +481,7 @@ const ticketFields = [ {
|
|
|
485
481
|
ticketType: [ "project" ]
|
|
486
482
|
}
|
|
487
483
|
}
|
|
488
|
-
}, ...(0, import_common.getCommonFields)(
|
|
484
|
+
}, ...(0, import_common.getCommonFields)(), {
|
|
489
485
|
displayName: "Company",
|
|
490
486
|
name: "company",
|
|
491
487
|
type: "options",
|
|
@@ -606,11 +602,11 @@ const ticketFields = [ {
|
|
|
606
602
|
}
|
|
607
603
|
}
|
|
608
604
|
}, {
|
|
609
|
-
displayName: "Priority
|
|
605
|
+
displayName: "Priority ID or Name",
|
|
610
606
|
name: "priority",
|
|
611
607
|
type: "options",
|
|
612
608
|
default: "",
|
|
613
|
-
description: 'Priority for new tickets. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
609
|
+
description: 'Priority for new tickets. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>. You may also specify a priority name for a case-insensitive lookup.',
|
|
614
610
|
typeOptions: {
|
|
615
611
|
loadOptionsMethod: "loadOptions_service_priorities"
|
|
616
612
|
},
|
|
@@ -626,11 +622,8 @@ const ticketFields = [ {
|
|
|
626
622
|
type: "string",
|
|
627
623
|
required: !0,
|
|
628
624
|
default: "",
|
|
629
|
-
description: "Summary for new tickets (
|
|
625
|
+
description: "Summary for new tickets (will be intelligently trimmed to 100 characters if needed)",
|
|
630
626
|
placeholder: "SERVER is not responding to pings",
|
|
631
|
-
typeOptions: {
|
|
632
|
-
maxLength: 100
|
|
633
|
-
},
|
|
634
627
|
displayOptions: {
|
|
635
628
|
show: {
|
|
636
629
|
resource: [ "ticket" ],
|
|
@@ -724,7 +717,8 @@ const ticketFields = [ {
|
|
|
724
717
|
name: "reopenSameBoardOnly",
|
|
725
718
|
type: "boolean",
|
|
726
719
|
default: !0,
|
|
727
|
-
description: "Whether to only reopen tickets only on the original board
|
|
720
|
+
description: "Whether to only reopen tickets only on the original board",
|
|
721
|
+
hint: "If disabled, you must change your success and failure statuses to strings using an expression",
|
|
728
722
|
displayOptions: {
|
|
729
723
|
show: {
|
|
730
724
|
resource: [ "ticket" ],
|
|
@@ -801,13 +795,12 @@ const ticketFields = [ {
|
|
|
801
795
|
name: "appendPreviousNote",
|
|
802
796
|
type: "boolean",
|
|
803
797
|
default: !1,
|
|
804
|
-
description: "Whether to append to previous note when
|
|
798
|
+
description: "Whether to append to previous note when adding notes to existing tickets",
|
|
805
799
|
hint: "Will use the short message if available",
|
|
806
800
|
displayOptions: {
|
|
807
801
|
show: {
|
|
808
802
|
resource: [ "ticket" ],
|
|
809
|
-
operation: [ "smartAlertConsolidation" ]
|
|
810
|
-
reopenClosedTicket: [ !0 ]
|
|
803
|
+
operation: [ "smartAlertConsolidation" ]
|
|
811
804
|
}
|
|
812
805
|
}
|
|
813
806
|
}, {
|
|
@@ -856,7 +849,7 @@ const ticketFields = [ {
|
|
|
856
849
|
name: "configAttachment",
|
|
857
850
|
type: "collection",
|
|
858
851
|
placeholder: "Auto-attach configuration by identifiers",
|
|
859
|
-
description: "If multiple options, will
|
|
852
|
+
description: "If multiple options, will prioritize MAC > IP > Full Hostname > Smart Match",
|
|
860
853
|
default: {},
|
|
861
854
|
displayOptions: {
|
|
862
855
|
show: {
|
|
@@ -865,11 +858,11 @@ const ticketFields = [ {
|
|
|
865
858
|
}
|
|
866
859
|
},
|
|
867
860
|
options: [ {
|
|
868
|
-
displayName: "Configuration
|
|
861
|
+
displayName: "Configuration Types",
|
|
869
862
|
name: "configurationTypeId",
|
|
870
|
-
type: "
|
|
871
|
-
default:
|
|
872
|
-
description: 'Filter configurations by
|
|
863
|
+
type: "multiOptions",
|
|
864
|
+
default: [],
|
|
865
|
+
description: 'Filter configurations by one or more types. Leave empty to search all types. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
873
866
|
typeOptions: {
|
|
874
867
|
loadOptionsMethod: "loadOptions_company_configurations_types"
|
|
875
868
|
}
|
|
@@ -240,7 +240,13 @@ const ticketNoteFields = [ {
|
|
|
240
240
|
}
|
|
241
241
|
},
|
|
242
242
|
x_submitAs: "contact.id"
|
|
243
|
-
}, ...(0, import_common.getCommonFields)(
|
|
243
|
+
}, ...(0, import_common.getCommonFields)({
|
|
244
|
+
overrides: {
|
|
245
|
+
returnAll: {
|
|
246
|
+
default: !0
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}) ], ticketNoteSchema = {
|
|
244
250
|
resource: "ticketNote",
|
|
245
251
|
displayName: "Ticket Note",
|
|
246
252
|
pluralDisplayName: "Ticket Notes",
|
|
@@ -0,0 +1,226 @@
|
|
|
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 ticketTask_schema_exports = {};
|
|
27
|
+
|
|
28
|
+
__export(ticketTask_schema_exports, {
|
|
29
|
+
execute: () => execute,
|
|
30
|
+
ticketTaskSchema: () => ticketTaskSchema
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
module.exports = __toCommonJS(ticketTask_schema_exports);
|
|
34
|
+
|
|
35
|
+
var import_transport = require("../../transport"), import_common = require("../../descriptions/common.properties");
|
|
36
|
+
|
|
37
|
+
const ticketTaskFields = [ {
|
|
38
|
+
displayName: "Operation",
|
|
39
|
+
name: "operation",
|
|
40
|
+
type: "options",
|
|
41
|
+
noDataExpression: !0,
|
|
42
|
+
displayOptions: {
|
|
43
|
+
show: {
|
|
44
|
+
resource: [ "ticketTask" ]
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
options: [ {
|
|
48
|
+
name: "Create",
|
|
49
|
+
value: "create",
|
|
50
|
+
description: "Create a ticket task",
|
|
51
|
+
action: "Create a ticket task"
|
|
52
|
+
}, {
|
|
53
|
+
name: "Delete",
|
|
54
|
+
value: "delete",
|
|
55
|
+
description: "Delete a ticket task",
|
|
56
|
+
action: "Delete a ticket task"
|
|
57
|
+
}, {
|
|
58
|
+
name: "Get",
|
|
59
|
+
value: "get",
|
|
60
|
+
description: "Retrieve a ticket task",
|
|
61
|
+
action: "Get a ticket task"
|
|
62
|
+
}, {
|
|
63
|
+
name: "Get Many",
|
|
64
|
+
value: "getAll",
|
|
65
|
+
description: "Retrieve many ticket tasks",
|
|
66
|
+
action: "Get many ticket tasks"
|
|
67
|
+
}, {
|
|
68
|
+
name: "Update",
|
|
69
|
+
value: "update",
|
|
70
|
+
description: "Update a ticket task",
|
|
71
|
+
action: "Update a ticket task"
|
|
72
|
+
} ],
|
|
73
|
+
default: "create"
|
|
74
|
+
}, {
|
|
75
|
+
displayName: "Ticket Type",
|
|
76
|
+
name: "ticketType",
|
|
77
|
+
type: "options",
|
|
78
|
+
required: !0,
|
|
79
|
+
default: "service",
|
|
80
|
+
description: "Type of ticket to work with",
|
|
81
|
+
options: [ {
|
|
82
|
+
name: "Service Ticket",
|
|
83
|
+
value: "service"
|
|
84
|
+
}, {
|
|
85
|
+
name: "Project Ticket",
|
|
86
|
+
value: "project"
|
|
87
|
+
} ],
|
|
88
|
+
displayOptions: {
|
|
89
|
+
show: {
|
|
90
|
+
resource: [ "ticketTask" ]
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}, {
|
|
94
|
+
displayName: "Ticket ID",
|
|
95
|
+
name: "parentId",
|
|
96
|
+
type: "number",
|
|
97
|
+
default: null,
|
|
98
|
+
required: !0,
|
|
99
|
+
description: "The ID of the parent ticket",
|
|
100
|
+
displayOptions: {
|
|
101
|
+
show: {
|
|
102
|
+
resource: [ "ticketTask" ]
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}, {
|
|
106
|
+
displayName: "Task ID",
|
|
107
|
+
name: "id",
|
|
108
|
+
type: "number",
|
|
109
|
+
default: null,
|
|
110
|
+
required: !0,
|
|
111
|
+
description: "The ID of the task",
|
|
112
|
+
displayOptions: {
|
|
113
|
+
show: {
|
|
114
|
+
operation: [ "update", "delete", "get" ]
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}, {
|
|
118
|
+
displayName: "Sequence",
|
|
119
|
+
name: "priority",
|
|
120
|
+
type: "number",
|
|
121
|
+
x_requiredOnCreate: !0,
|
|
122
|
+
default: 100,
|
|
123
|
+
typeOptions: {
|
|
124
|
+
minValue: 1
|
|
125
|
+
},
|
|
126
|
+
hint: "Priority/order of task",
|
|
127
|
+
description: "The order the task is displayed in the ticket",
|
|
128
|
+
displayOptions: {
|
|
129
|
+
show: {
|
|
130
|
+
operation: [ "create", "update" ]
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}, {
|
|
134
|
+
displayName: "Notes",
|
|
135
|
+
name: "notes",
|
|
136
|
+
type: "string",
|
|
137
|
+
x_requiredOnCreate: !0,
|
|
138
|
+
typeOptions: {
|
|
139
|
+
rows: 4
|
|
140
|
+
},
|
|
141
|
+
default: "",
|
|
142
|
+
description: "Notes for the task",
|
|
143
|
+
displayOptions: {
|
|
144
|
+
show: {
|
|
145
|
+
operation: [ "create", "update" ]
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}, {
|
|
149
|
+
displayName: "Additional Fields",
|
|
150
|
+
name: "additionalTaskFields",
|
|
151
|
+
type: "collection",
|
|
152
|
+
placeholder: "Add Field",
|
|
153
|
+
default: {},
|
|
154
|
+
displayOptions: {
|
|
155
|
+
show: {
|
|
156
|
+
operation: [ "create", "update" ]
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
options: [ {
|
|
160
|
+
displayName: "Done",
|
|
161
|
+
name: "closedFlag",
|
|
162
|
+
type: "boolean",
|
|
163
|
+
default: !1,
|
|
164
|
+
description: "Whether the task is completed",
|
|
165
|
+
x_submitAs: "closedFlag"
|
|
166
|
+
}, {
|
|
167
|
+
displayName: "Resolution",
|
|
168
|
+
name: "resolution",
|
|
169
|
+
type: "string",
|
|
170
|
+
typeOptions: {
|
|
171
|
+
rows: 2
|
|
172
|
+
},
|
|
173
|
+
default: "",
|
|
174
|
+
description: "Resolution details for the task",
|
|
175
|
+
x_submitAs: "resolution"
|
|
176
|
+
} ]
|
|
177
|
+
}, ...(0, import_common.getCommonFields)({
|
|
178
|
+
overrides: {
|
|
179
|
+
returnAll: {
|
|
180
|
+
default: !0
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}) ], ticketTaskSchema = {
|
|
184
|
+
resource: "ticketTask",
|
|
185
|
+
displayName: "Ticket Task",
|
|
186
|
+
pluralDisplayName: "Ticket Tasks",
|
|
187
|
+
description: "Manage ConnectWise ticket tasks",
|
|
188
|
+
identifierField: "id",
|
|
189
|
+
nameField: "notes",
|
|
190
|
+
fieldDetection: {
|
|
191
|
+
endpoint: "",
|
|
192
|
+
sampleSize: 3
|
|
193
|
+
},
|
|
194
|
+
endpoints: {
|
|
195
|
+
create: {
|
|
196
|
+
method: "POST",
|
|
197
|
+
path: params => `/${params.ticketType}/tickets/${params.parentId}/tasks`
|
|
198
|
+
},
|
|
199
|
+
update: {
|
|
200
|
+
method: "PATCH",
|
|
201
|
+
path: params => `/${params.ticketType}/tickets/${params.parentId}/tasks/${params.id}`
|
|
202
|
+
},
|
|
203
|
+
get: {
|
|
204
|
+
method: "GET",
|
|
205
|
+
path: params => `/${params.ticketType}/tickets/${params.parentId}/tasks/${params.id}`
|
|
206
|
+
},
|
|
207
|
+
getAll: {
|
|
208
|
+
method: "GET",
|
|
209
|
+
path: params => `/${params.ticketType}/tickets/${params.parentId}/tasks`
|
|
210
|
+
},
|
|
211
|
+
delete: {
|
|
212
|
+
method: "DELETE",
|
|
213
|
+
path: params => `/${params.ticketType}/tickets/${params.parentId}/tasks/${params.id}`
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
fields: ticketTaskFields
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
async function execute(operation, i) {
|
|
220
|
+
return import_transport.executeResourceOperation.call(this, ticketTaskSchema, operation, i);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
0 && (module.exports = {
|
|
224
|
+
execute: execute,
|
|
225
|
+
ticketTaskSchema: ticketTaskSchema
|
|
226
|
+
});
|
|
@@ -361,7 +361,7 @@ const timeEntryFields = [ {
|
|
|
361
361
|
description: "Whether to email the contact about this time entry",
|
|
362
362
|
x_submitAs: "emailContactFlag"
|
|
363
363
|
} ]
|
|
364
|
-
}, ...(0, import_common.getCommonFields)(
|
|
364
|
+
}, ...(0, import_common.getCommonFields)() ], timeEntrySchema = {
|
|
365
365
|
resource: "timeEntry",
|
|
366
366
|
displayName: "Time Entry",
|
|
367
367
|
pluralDisplayName: "Time Entries",
|
|
@@ -214,7 +214,7 @@ const COMMON_FIELDS_NAME = "Common Fields", staticFieldDefinitions = {
|
|
|
214
214
|
value: "types"
|
|
215
215
|
}, {
|
|
216
216
|
name: "Types (Names)",
|
|
217
|
-
value: "__types_names
|
|
217
|
+
value: "__types_names,$$types"
|
|
218
218
|
}, {
|
|
219
219
|
name: "Types (Simplified)",
|
|
220
220
|
value: "__types,$$types"
|
|
@@ -1798,6 +1798,67 @@ const COMMON_FIELDS_NAME = "Common Fields", staticFieldDefinitions = {
|
|
|
1798
1798
|
name: "_info/Date Entered",
|
|
1799
1799
|
value: "_info/dateEntered"
|
|
1800
1800
|
} ]
|
|
1801
|
+
},
|
|
1802
|
+
ticketTasks: {
|
|
1803
|
+
fields: [ {
|
|
1804
|
+
name: "All Fields (Override Selection)",
|
|
1805
|
+
value: "__ALL_FIELDS_OVERRIDE__"
|
|
1806
|
+
}, {
|
|
1807
|
+
name: COMMON_FIELDS_NAME,
|
|
1808
|
+
value: "id,ticketId,priority,closedFlag,member/id,member/identifier,member/name,notes,resolution,_info/lastUpdated"
|
|
1809
|
+
}, {
|
|
1810
|
+
name: "ID",
|
|
1811
|
+
value: "id"
|
|
1812
|
+
}, {
|
|
1813
|
+
name: "Ticket ID",
|
|
1814
|
+
value: "ticketId"
|
|
1815
|
+
}, {
|
|
1816
|
+
name: "Priority",
|
|
1817
|
+
value: "priority"
|
|
1818
|
+
}, {
|
|
1819
|
+
name: "Closed Flag",
|
|
1820
|
+
value: "closedFlag"
|
|
1821
|
+
}, {
|
|
1822
|
+
name: "Member",
|
|
1823
|
+
value: "member"
|
|
1824
|
+
}, {
|
|
1825
|
+
name: "Member ID",
|
|
1826
|
+
value: "member/id"
|
|
1827
|
+
}, {
|
|
1828
|
+
name: "Member Identifier",
|
|
1829
|
+
value: "member/identifier"
|
|
1830
|
+
}, {
|
|
1831
|
+
name: "Member Name",
|
|
1832
|
+
value: "member/name"
|
|
1833
|
+
}, {
|
|
1834
|
+
name: "Notes",
|
|
1835
|
+
value: "notes"
|
|
1836
|
+
}, {
|
|
1837
|
+
name: "Resolution",
|
|
1838
|
+
value: "resolution"
|
|
1839
|
+
}, {
|
|
1840
|
+
name: "Summary",
|
|
1841
|
+
value: "summary"
|
|
1842
|
+
}, {
|
|
1843
|
+
name: "_info",
|
|
1844
|
+
value: "_info"
|
|
1845
|
+
}, {
|
|
1846
|
+
name: "_info/Last Updated",
|
|
1847
|
+
value: "_info/lastUpdated"
|
|
1848
|
+
} ],
|
|
1849
|
+
orderByFields: [ {
|
|
1850
|
+
name: "ID",
|
|
1851
|
+
value: "id"
|
|
1852
|
+
}, {
|
|
1853
|
+
name: "Priority",
|
|
1854
|
+
value: "priority"
|
|
1855
|
+
}, {
|
|
1856
|
+
name: "Closed Flag",
|
|
1857
|
+
value: "closedFlag"
|
|
1858
|
+
}, {
|
|
1859
|
+
name: "_info/Last Updated",
|
|
1860
|
+
value: "_info/lastUpdated"
|
|
1861
|
+
} ]
|
|
1801
1862
|
}
|
|
1802
1863
|
};
|
|
1803
1864
|
|
|
@@ -26,6 +26,7 @@ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
|
26
26
|
var cache_exports = {};
|
|
27
27
|
|
|
28
28
|
__export(cache_exports, {
|
|
29
|
+
clearAllCached: () => clearAllCached,
|
|
29
30
|
deleteCached: () => deleteCached,
|
|
30
31
|
getCacheConfig: () => getCacheConfig,
|
|
31
32
|
getCached: () => getCached,
|
|
@@ -52,6 +53,25 @@ async function deleteCached(key) {
|
|
|
52
53
|
return !1;
|
|
53
54
|
}
|
|
54
55
|
|
|
56
|
+
async function clearAllCached() {
|
|
57
|
+
const redis = await getCacheClient();
|
|
58
|
+
if (!redis) throw new Error("Redis not available");
|
|
59
|
+
try {
|
|
60
|
+
let cursor = "0", deletedCount = 0;
|
|
61
|
+
const pattern = "cw:psa:*", batchSize = 100;
|
|
62
|
+
do {
|
|
63
|
+
const [newCursor, keys] = await redis.scan(cursor, "MATCH", pattern, "COUNT", batchSize);
|
|
64
|
+
if (cursor = newCursor, keys && keys.length > 0) {
|
|
65
|
+
const deleted = await redis.del(...keys);
|
|
66
|
+
deletedCount += deleted;
|
|
67
|
+
}
|
|
68
|
+
} while (cursor !== "0");
|
|
69
|
+
return console.log(`🗑️ Cleared ${deletedCount} cache entries`), deletedCount;
|
|
70
|
+
} catch (error) {
|
|
71
|
+
throw console.error("Cache clear all error:", error.message), error;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
55
75
|
function getCacheConfig(context, index) {
|
|
56
76
|
try {
|
|
57
77
|
if (context.getNodeParameter("cacheResponse", index, !1)) {
|
|
@@ -74,6 +94,7 @@ function getCacheConfig(context, index) {
|
|
|
74
94
|
}
|
|
75
95
|
|
|
76
96
|
0 && (module.exports = {
|
|
97
|
+
clearAllCached: clearAllCached,
|
|
77
98
|
deleteCached: deleteCached,
|
|
78
99
|
getCacheConfig: getCacheConfig,
|
|
79
100
|
getCached: getCached,
|
|
@@ -47,8 +47,9 @@ function extractOperationParams(context, index) {
|
|
|
47
47
|
id !== void 0 && id !== "" && (params.id = id);
|
|
48
48
|
} catch {}
|
|
49
49
|
try {
|
|
50
|
-
|
|
51
|
-
ticketType !== void 0 && ticketType !== "" && (
|
|
50
|
+
let ticketType = context.getNodeParameter("ticketType", index);
|
|
51
|
+
ticketType !== void 0 && ticketType !== "" && (ticketType === "ServiceTicket" && (ticketType = "service"),
|
|
52
|
+
ticketType === "ProjectTicket" && (ticketType = "project"), params.ticketType = ticketType);
|
|
52
53
|
} catch {}
|
|
53
54
|
try {
|
|
54
55
|
const parentId = context.getNodeParameter("parentId", index);
|
|
@@ -39,7 +39,7 @@ module.exports = __toCommonJS(version_check_exports);
|
|
|
39
39
|
|
|
40
40
|
var fs = __toESM(require("fs/promises")), path = __toESM(require("path")), os = __toESM(require("os")), import_common = require("../descriptions/common.descriptions");
|
|
41
41
|
|
|
42
|
-
const CACHE_FILE_PATH = path.join(os.tmpdir(), "connectwise-n8n-version-cache.json"), CURRENT_VERSION = "0.1.
|
|
42
|
+
const CACHE_FILE_PATH = path.join(os.tmpdir(), "connectwise-n8n-version-cache.json"), CURRENT_VERSION = "0.1.7";
|
|
43
43
|
|
|
44
44
|
let inMemoryCache = null, cacheLoadPromise = null, fetchInProgress = !1;
|
|
45
45
|
|
|
@@ -113,7 +113,7 @@ async function checkAndNotifyUpdate(context) {
|
|
|
113
113
|
try {
|
|
114
114
|
if (!(await context.getCredentials("connectWisePsaApi")).checkForUpdates) return;
|
|
115
115
|
checkForUpdatesAsync(), inMemoryCache?.updateAvailable && "addExecutionHints" in context && !notificationShown.has(context) && (context.addExecutionHints({
|
|
116
|
-
message: `🎉 ConnectWise PSA Node v${inMemoryCache.latest} is available! <a href="https://${import_common.CHANGELOG_URL}
|
|
116
|
+
message: `🎉 ConnectWise PSA Node v${inMemoryCache.latest} is available! <a href="https://${import_common.CHANGELOG_URL}" target="_blank">View changelog</a>`,
|
|
117
117
|
location: "outputPane"
|
|
118
118
|
}), notificationShown.add(context));
|
|
119
119
|
} catch (error) {
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mspcopilot/n8n-nodes-connectwise",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "n8n node to integrate with ConnectWise PSA",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package"
|
|
7
7
|
],
|
|
8
8
|
"license": "SUL-1.0",
|
|
9
|
-
"homepage": "https://
|
|
9
|
+
"homepage": "https://mspcopilot.io/n8n-nodes/connectwise-psa",
|
|
10
10
|
"author": {
|
|
11
11
|
"name": "Dan Buhler (j0dan)",
|
|
12
12
|
"email": "dan.buhler@mspcopilot.io"
|
|
File without changes
|
|
File without changes
|