@mspcopilot/n8n-nodes-connectwise 0.2.1-beta.9 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/{dist-beta → dist-community}/credentials/ConnectWisePsaApi.credentials.js +3 -17
  2. package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/ConnectWisePsa.node.js +2 -14
  3. package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/descriptions/common.properties.js +1 -16
  4. package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/methods/fieldOptions.js +0 -1
  5. package/dist-community/nodes/ConnectWise/PSA/schema/resources/alert-consolidation.js +42 -0
  6. package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/schema/resources/custom.schema.js +1 -38
  7. package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/schema/resources/ticket.schema.js +1 -11
  8. package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/transport/cache.js +6 -84
  9. package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/transport/client.js +5 -46
  10. package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/transport/version-check.js +13 -9
  11. package/package.json +4 -6
  12. package/dist-beta/nodes/ConnectWise/PSA/ConnectWisePsaTrigger.node.js +0 -506
  13. package/dist-beta/nodes/ConnectWise/PSA/IfSchedule.node.js +0 -333
  14. package/dist-beta/nodes/ConnectWise/PSA/schema/resources/alert-consolidation.js +0 -451
  15. package/dist-beta/nodes/ConnectWise/PSA/schema/resources/diagnostics.schema.js +0 -103
  16. package/dist-beta/nodes/ConnectWise/PSA/schema/resources/reports.schema.js +0 -206
  17. /package/{dist-beta → dist-community}/LICENSE.md +0 -0
  18. /package/{dist-beta → dist-community}/credentials/connectwise-dark.svg +0 -0
  19. /package/{dist-beta → dist-community}/credentials/connectwise-light.svg +0 -0
  20. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/connectwise-dark.svg +0 -0
  21. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/connectwise-light.svg +0 -0
  22. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/descriptions/common.descriptions.js +0 -0
  23. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/descriptions/index.js +0 -0
  24. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/helpers/customFields.js +0 -0
  25. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/helpers/field-collector.js +0 -0
  26. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/helpers/field-conditions.js +0 -0
  27. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/helpers/hint-collector.js +0 -0
  28. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/helpers/index.js +0 -0
  29. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/helpers/logging.js +0 -0
  30. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/helpers/utils.js +0 -0
  31. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/methods/generated.js +0 -0
  32. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/methods/index.js +0 -0
  33. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/schema/converter/index.js +0 -0
  34. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/schema/converter/reference.generator.js +0 -0
  35. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/schema/index.js +0 -0
  36. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/schema/references.js +0 -0
  37. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/schema/reports-descriptions.js +0 -0
  38. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/schema/resources/activity.schema.js +0 -0
  39. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/schema/resources/company.schema.js +0 -0
  40. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/schema/resources/contact.schema.js +0 -0
  41. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/schema/resources/index.js +0 -0
  42. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/schema/resources/members.schema.js +0 -0
  43. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/schema/resources/ticketNote.schema.js +0 -0
  44. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/schema/resources/ticketTask.schema.js +0 -0
  45. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/schema/resources/timeEntry.schema.js +0 -0
  46. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/schema/static-fields.js +0 -0
  47. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/schema/transformer.js +0 -0
  48. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/schema/types/index.js +0 -0
  49. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/schema/types/reference.types.js +0 -0
  50. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/schema/types/resource.types.js +0 -0
  51. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/transport/access-key.js +0 -0
  52. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/transport/index.js +0 -0
  53. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/transport/operations.js +0 -0
  54. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/transport/response-transformer.js +0 -0
  55. /package/{dist-beta → dist-community}/nodes/ConnectWise/PSA/types/n8n-augmentation.d.js +0 -0
  56. /package/{dist-beta → dist-community}/nodes/ConnectWisePsa.node.json +0 -0
@@ -1,206 +0,0 @@
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 reports_schema_exports = {};
33
-
34
- __export(reports_schema_exports, {
35
- execute: () => execute,
36
- loadReportColumns: () => loadReportColumns,
37
- reportsSchema: () => reportsSchema,
38
- transformReportData: () => transformReportData
39
- });
40
-
41
- module.exports = __toCommonJS(reports_schema_exports);
42
-
43
- var import_transport = require("../../transport"), import_utils = require("../../helpers/utils"), import_common = require("../../descriptions/common.properties");
44
-
45
- function transformReportData(columnDefinitions, rowValues) {
46
- if (process.env.MSPCOPILOT_BETA !== "true") return [];
47
- const columnNames = columnDefinitions.map(def => Object.keys(def)[0]);
48
- return rowValues.map(row => {
49
- const obj = {};
50
- return columnNames.forEach((col, index) => {
51
- obj[col] = row[index];
52
- }), obj;
53
- });
54
- }
55
-
56
- async function loadReportColumns() {
57
- const reportName = this.getCurrentNodeParameter("reportName");
58
- if (!reportName) return [];
59
- try {
60
- const sampleData = await import_transport.connectWiseApiRequest.call(this, "GET", `/system/reports/${reportName}`, {}, {
61
- pageSize: 1
62
- });
63
- if (!sampleData.column_definitions) return [];
64
- const columns = sampleData.column_definitions.map(def => {
65
- const columnName = Object.keys(def)[0], columnInfo = def[columnName], details = [ columnInfo.type ];
66
- for (const [key, value] of Object.entries(columnInfo)) if (key !== "type") {
67
- if (typeof value == "boolean") {
68
- if (value === !0) {
69
- let displayKey = key.replace(/^is/, "").replace(/([A-Z])/g, " $1").trim();
70
- displayKey = displayKey.charAt(0).toUpperCase() + displayKey.slice(1), details.push(displayKey);
71
- }
72
- } else if (value != null && value !== "") {
73
- let displayKey = key.replace(/([A-Z])/g, " $1").trim();
74
- displayKey = displayKey.charAt(0).toUpperCase() + displayKey.slice(1), details.push(`${displayKey}: ${value}`);
75
- }
76
- }
77
- return {
78
- name: columnName,
79
- value: columnName,
80
- description: details.join(", ")
81
- };
82
- });
83
- return columns.unshift({
84
- name: "All Fields (Override Selection)",
85
- value: "__ALL_FIELDS_OVERRIDE__"
86
- }), columns;
87
- } catch (error) {
88
- return console.error("Error loading report columns:", error), [];
89
- }
90
- }
91
-
92
- const reportsFields = [ {
93
- displayName: "Operation",
94
- name: "operation",
95
- type: "options",
96
- noDataExpression: !0,
97
- displayOptions: {
98
- show: {
99
- resource: [ "reports" ]
100
- }
101
- },
102
- options: [ {
103
- name: "Get Report",
104
- value: "getReport",
105
- description: "Retrieve report data",
106
- action: "Get a report"
107
- } ],
108
- default: "getReport"
109
- }, {
110
- displayName: "Report Name",
111
- name: "reportName",
112
- type: "options",
113
- required: !0,
114
- displayOptions: {
115
- show: {
116
- resource: [ "reports" ],
117
- operation: [ "getReport" ]
118
- }
119
- },
120
- typeOptions: {
121
- loadOptionsMethod: "loadOptions_system_reports"
122
- },
123
- default: "",
124
- description: "Select the report to retrieve"
125
- }, {
126
- displayName: "Transform Output",
127
- name: "transformOutput",
128
- type: "boolean",
129
- displayOptions: {
130
- show: {
131
- resource: [ "reports" ],
132
- operation: [ "getReport" ]
133
- }
134
- },
135
- default: !0,
136
- hint: "Transform matrix format (column_definitions + row_values) to array of objects"
137
- }, ...(0, import_common.getCommonFields)({
138
- overrides: {
139
- fields: {
140
- typeOptions: {
141
- loadOptionsMethod: "loadReportColumns",
142
- loadOptionsDependsOn: [ "reportName" ]
143
- },
144
- description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/" target="_blank">expression</a>. Leave empty to return all columns.'
145
- },
146
- orderBy: {
147
- type: "string",
148
- typeOptions: void 0,
149
- placeholder: "e.g., Date_Created or Company_Name",
150
- hint: "Use exact column name from the report"
151
- },
152
- descending: {
153
- displayOptions: {
154
- show: {
155
- operation: [ "getReport" ],
156
- orderBy: [ {
157
- _cnd: {
158
- not: ""
159
- }
160
- } ]
161
- }
162
- }
163
- }
164
- }
165
- }) ], reportsSchema = {
166
- resource: "reports",
167
- displayName: "Report ✨",
168
- pluralDisplayName: "Reports",
169
- description: "Access ConnectWise system reports",
170
- identifierField: "name",
171
- nameField: "reportName",
172
- endpoints: {
173
- getReport: {
174
- method: "GET",
175
- path: params => `/system/reports/${params.reportName}`
176
- }
177
- },
178
- fields: reportsFields
179
- };
180
-
181
- async function execute(operation, i) {
182
- {
183
- if (process.env.MSPCOPILOT_BETA !== "true") return (0, import_utils.returnProOnlyMessage)(this, i);
184
- const {requireAccessKey: requireAccessKey} = await import("../../transport/access-key.js");
185
- if (!await requireAccessKey(this, "beta")) return (0, import_utils.returnAccessKeyRequired)(this, i);
186
- }
187
- const reportName = this.getNodeParameter("reportName", i), transformOutput = this.getNodeParameter("transformOutput", i, !0), returnAll = this.getNodeParameter("returnAll", i, !1), limit = this.getNodeParameter("limit", i, 50), qs = (0,
188
- import_utils.buildQueryOptions)(this, i, []), endpoint = `/system/reports/${reportName}`;
189
- let result = await import_transport.connectWiseApiRequest.call(this, "GET", endpoint, {}, qs, {
190
- returnAll: returnAll,
191
- limit: returnAll ? void 0 : limit
192
- });
193
- return transformOutput && result && result.column_definitions && result.row_values && (result = transformReportData(result.column_definitions, result.row_values)),
194
- this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(result), {
195
- itemData: {
196
- item: i
197
- }
198
- });
199
- }
200
-
201
- 0 && (module.exports = {
202
- execute: execute,
203
- loadReportColumns: loadReportColumns,
204
- reportsSchema: reportsSchema,
205
- transformReportData: transformReportData
206
- });
File without changes