@mspcopilot/n8n-nodes-connectwise 0.2.1-beta.1 → 0.2.1-beta.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-community → dist-beta}/credentials/ConnectWisePsaApi.credentials.js +18 -4
  2. package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/ConnectWisePsa.node.js +14 -2
  3. package/dist-beta/nodes/ConnectWise/PSA/ConnectWisePsaTrigger.node.js +506 -0
  4. package/dist-beta/nodes/ConnectWise/PSA/IfSchedule.node.js +332 -0
  5. package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/descriptions/common.properties.js +17 -2
  6. package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/helpers/hint-collector.js +17 -3
  7. package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/methods/fieldOptions.js +1 -0
  8. package/dist-beta/nodes/ConnectWise/PSA/schema/resources/alert-consolidation.js +451 -0
  9. package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/schema/resources/custom.schema.js +38 -1
  10. package/dist-beta/nodes/ConnectWise/PSA/schema/resources/diagnostics.schema.js +103 -0
  11. package/dist-beta/nodes/ConnectWise/PSA/schema/resources/reports.schema.js +206 -0
  12. package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/schema/resources/ticket.schema.js +11 -1
  13. package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/transport/cache.js +84 -6
  14. package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/transport/client.js +46 -5
  15. package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/transport/version-check.js +7 -7
  16. package/package.json +7 -5
  17. package/dist-community/nodes/ConnectWise/PSA/schema/resources/alert-consolidation.js +0 -42
  18. /package/{dist-community → dist-beta}/LICENSE.md +0 -0
  19. /package/{dist-community → dist-beta}/credentials/connectwise-dark.svg +0 -0
  20. /package/{dist-community → dist-beta}/credentials/connectwise-light.svg +0 -0
  21. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/connectwise-dark.svg +0 -0
  22. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/connectwise-light.svg +0 -0
  23. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/descriptions/common.descriptions.js +0 -0
  24. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/descriptions/index.js +0 -0
  25. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/helpers/customFields.js +0 -0
  26. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/helpers/field-collector.js +0 -0
  27. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/helpers/field-conditions.js +0 -0
  28. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/helpers/index.js +0 -0
  29. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/helpers/logging.js +0 -0
  30. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/helpers/utils.js +0 -0
  31. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/methods/generated.js +0 -0
  32. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/methods/index.js +0 -0
  33. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/schema/converter/index.js +0 -0
  34. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/schema/converter/reference.generator.js +0 -0
  35. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/schema/index.js +0 -0
  36. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/schema/references.js +0 -0
  37. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/schema/reports-descriptions.js +0 -0
  38. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/schema/resources/activity.schema.js +0 -0
  39. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/schema/resources/company.schema.js +0 -0
  40. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/schema/resources/contact.schema.js +0 -0
  41. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/schema/resources/index.js +0 -0
  42. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/schema/resources/members.schema.js +0 -0
  43. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/schema/resources/ticketNote.schema.js +0 -0
  44. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/schema/resources/ticketTask.schema.js +0 -0
  45. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/schema/resources/timeEntry.schema.js +0 -0
  46. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/schema/static-fields.js +0 -0
  47. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/schema/transformer.js +0 -0
  48. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/schema/types/index.js +0 -0
  49. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/schema/types/reference.types.js +0 -0
  50. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/schema/types/resource.types.js +0 -0
  51. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/transport/access-key.js +0 -0
  52. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/transport/index.js +0 -0
  53. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/transport/operations.js +0 -0
  54. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/transport/response-transformer.js +0 -0
  55. /package/{dist-community → dist-beta}/nodes/ConnectWise/PSA/types/n8n-augmentation.d.js +0 -0
  56. /package/{dist-community → dist-beta}/nodes/ConnectWisePsa.node.json +0 -0
@@ -0,0 +1,332 @@
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 IfSchedule_node_exports = {};
33
+
34
+ __export(IfSchedule_node_exports, {
35
+ IfSchedule: () => IfSchedule
36
+ });
37
+
38
+ module.exports = __toCommonJS(IfSchedule_node_exports);
39
+
40
+ var import_luxon = require("luxon"), import_client = require("./transport/client"), import_methods = require("./methods"), import_utils = require("./helpers/utils");
41
+
42
+ const WINDOWS_TO_IANA_TIMEZONE = {
43
+ "Morocco Standard Time": "Africa/Casablanca",
44
+ "W. Central Africa Standard Time": "Africa/Lagos",
45
+ "South Africa Standard Time": "Africa/Johannesburg",
46
+ "Namibia Standard Time": "Africa/Windhoek",
47
+ "Egypt Standard Time": "Africa/Cairo",
48
+ "E. Africa Standard Time": "Africa/Nairobi",
49
+ "Alaskan Standard Time": "America/Anchorage",
50
+ "Hawaiian Standard Time": "Pacific/Honolulu",
51
+ "Pacific Standard Time": "America/Los_Angeles",
52
+ "Pacific Standard Time (Mexico)": "America/Tijuana",
53
+ "US Mountain Standard Time": "America/Phoenix",
54
+ "Mountain Standard Time": "America/Denver",
55
+ "Mountain Standard Time (Mexico)": "America/Chihuahua",
56
+ "Central Standard Time": "America/Chicago",
57
+ "Central Standard Time (Mexico)": "America/Mexico_City",
58
+ "Canada Central Standard Time": "America/Regina",
59
+ "Central America Standard Time": "America/Guatemala",
60
+ "Eastern Standard Time": "America/New_York",
61
+ "US Eastern Standard Time": "America/Indianapolis",
62
+ "Atlantic Standard Time": "America/Halifax",
63
+ "Newfoundland Standard Time": "America/St_Johns",
64
+ "SA Pacific Standard Time": "America/Bogota",
65
+ "Venezuela Standard Time": "America/Caracas",
66
+ "SA Western Standard Time": "America/La_Paz",
67
+ "Pacific SA Standard Time": "America/Santiago",
68
+ "E. South America Standard Time": "America/Sao_Paulo",
69
+ "Central Brazilian Standard Time": "America/Cuiaba",
70
+ "Argentina Standard Time": "America/Buenos_Aires",
71
+ "SA Eastern Standard Time": "America/Cayenne",
72
+ "Montevideo Standard Time": "America/Montevideo",
73
+ "Azores Standard Time": "Atlantic/Azores",
74
+ "Cape Verde Standard Time": "Atlantic/Cape_Verde",
75
+ "Mid-Atlantic Standard Time": "Atlantic/South_Georgia",
76
+ "Greenland Standard Time": "America/Godthab",
77
+ "Jordan Standard Time": "Asia/Amman",
78
+ "Middle East Standard Time": "Asia/Beirut",
79
+ "Israel Standard Time": "Asia/Jerusalem",
80
+ "Arabic Standard Time": "Asia/Baghdad",
81
+ "Arab Standard Time": "Asia/Riyadh",
82
+ "Arabian Standard Time": "Asia/Dubai",
83
+ "Iran Standard Time": "Asia/Tehran",
84
+ "Afghanistan Standard Time": "Asia/Kabul",
85
+ "Georgian Standard Time": "Asia/Tbilisi",
86
+ "Caucasus Standard Time": "Asia/Yerevan",
87
+ "Azerbaijan Standard Time": "Asia/Baku",
88
+ "West Asia Standard Time": "Asia/Tashkent",
89
+ "Pakistan Standard Time": "Asia/Karachi",
90
+ "India Standard Time": "Asia/Kolkata",
91
+ "Sri Lanka Standard Time": "Asia/Colombo",
92
+ "Nepal Standard Time": "Asia/Kathmandu",
93
+ "Central Asia Standard Time": "Asia/Almaty",
94
+ "Myanmar Standard Time": "Asia/Yangon",
95
+ "SE Asia Standard Time": "Asia/Bangkok",
96
+ "China Standard Time": "Asia/Shanghai",
97
+ "Singapore Standard Time": "Asia/Singapore",
98
+ "Taipei Standard Time": "Asia/Taipei",
99
+ "Tokyo Standard Time": "Asia/Tokyo",
100
+ "Korea Standard Time": "Asia/Seoul",
101
+ "Russian Standard Time": "Europe/Moscow",
102
+ "Ekaterinburg Standard Time": "Asia/Yekaterinburg",
103
+ "N. Central Asia Standard Time": "Asia/Novosibirsk",
104
+ "North Asia Standard Time": "Asia/Krasnoyarsk",
105
+ "North Asia East Standard Time": "Asia/Irkutsk",
106
+ "Yakutsk Standard Time": "Asia/Yakutsk",
107
+ "Vladivostok Standard Time": "Asia/Vladivostok",
108
+ "W. Australia Standard Time": "Australia/Perth",
109
+ "AUS Central Standard Time": "Australia/Darwin",
110
+ "Cen. Australia Standard Time": "Australia/Adelaide",
111
+ "E. Australia Standard Time": "Australia/Brisbane",
112
+ "AUS Eastern Standard Time": "Australia/Sydney",
113
+ "Tasmania Standard Time": "Australia/Hobart",
114
+ "West Pacific Standard Time": "Pacific/Port_Moresby",
115
+ "Central Pacific Standard Time": "Pacific/Guadalcanal",
116
+ "Fiji Standard Time": "Pacific/Fiji",
117
+ "New Zealand Standard Time": "Pacific/Auckland",
118
+ "Tonga Standard Time": "Pacific/Tongatapu",
119
+ "GMT Standard Time": "Europe/London",
120
+ "Greenwich Standard Time": "Atlantic/Reykjavik",
121
+ "W. Europe Standard Time": "Europe/Berlin",
122
+ "Central Europe Standard Time": "Europe/Budapest",
123
+ "Romance Standard Time": "Europe/Paris",
124
+ "Central European Standard Time": "Europe/Warsaw",
125
+ "GTB Standard Time": "Europe/Bucharest",
126
+ "E. Europe Standard Time": "Europe/Minsk",
127
+ "FLE Standard Time": "Europe/Kiev",
128
+ "UTC-11": "Pacific/Midway",
129
+ "Dateline Standard Time": "Etc/GMT+12",
130
+ "Mauritius Standard Time": "Indian/Mauritius"
131
+ };
132
+
133
+ class IfSchedule {
134
+ description={
135
+ displayName: "If ConnectWise Schedule ✨",
136
+ name: "ifConnectWiseSchedule",
137
+ icon: {
138
+ light: "file:connectwise-light.svg",
139
+ dark: "file:connectwise-dark.svg"
140
+ },
141
+ group: [ "transform" ],
142
+ version: 1,
143
+ description: "Check if timestamp is during business hours or is a workday based on calendar and holidays",
144
+ defaults: {
145
+ name: "If Business Hours"
146
+ },
147
+ inputs: [ "main" ],
148
+ outputs: [ "main", "main" ],
149
+ outputNames: [ "true", "false" ],
150
+ credentials: [ {
151
+ name: "connectWisePsaApi",
152
+ required: !0
153
+ } ],
154
+ properties: [ {
155
+ displayName: "Calendar Name or ID",
156
+ name: "calendarId",
157
+ type: "options",
158
+ required: !0,
159
+ typeOptions: {
160
+ loadOptionsMethod: "loadOptions_schedule_calendars"
161
+ },
162
+ default: "",
163
+ description: 'Select the business hours calendar to check against. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.'
164
+ }, {
165
+ displayName: "Time Zone Name or ID",
166
+ name: "timeZoneSetupId",
167
+ type: "options",
168
+ required: !0,
169
+ typeOptions: {
170
+ loadOptionsMethod: "loadTimeZoneOptions"
171
+ },
172
+ default: "",
173
+ description: 'Select the time zone for interpreting the calendar business hours. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.'
174
+ }, {
175
+ displayName: "Check Day Only",
176
+ name: "checkDateOnly",
177
+ type: "boolean",
178
+ default: !1,
179
+ description: "Whether to only check if the date is a workday, ignoring specific business hours and partial-day holidays",
180
+ hint: "When enabled, returns true if the date has business hours defined and is not an all-day holiday"
181
+ }, {
182
+ displayName: "Use Current Time",
183
+ name: "useNow",
184
+ type: "boolean",
185
+ default: !1,
186
+ description: "Whether to use the current date/time for checking"
187
+ }, {
188
+ displayName: "Timestamp",
189
+ name: "timestamp",
190
+ type: "dateTime",
191
+ required: !0,
192
+ displayOptions: {
193
+ show: {
194
+ useNow: [ !1 ]
195
+ }
196
+ },
197
+ default: "",
198
+ hint: "Use UTC time or specify timezone",
199
+ description: "The date/time to check against business hours"
200
+ } ]
201
+ };
202
+ methods={
203
+ loadOptions: {
204
+ ...import_methods.loadOptions,
205
+ async loadTimeZoneOptions() {
206
+ const timeZones = await import_client.connectWiseApiRequest.call(this, "GET", "/system/timeZoneSetups", {}, {
207
+ pageSize: 1e3
208
+ }, {
209
+ returnAll: !0,
210
+ optionsCache: !0
211
+ }), defaultTimeZone = timeZones.find(tz => tz.defaultFlag === !0);
212
+ return [ ...timeZones ].sort((a, b) => a.defaultFlag === !0 ? -1 : b.defaultFlag === !0 ? 1 : a.name.localeCompare(b.name)).map(tz => ({
213
+ name: tz.defaultFlag ? `${tz.name} (Default)` : tz.name,
214
+ value: tz.id
215
+ }));
216
+ }
217
+ }
218
+ };
219
+ async execute() {
220
+ const items = this.getInputData();
221
+ if (process.env.MSPCOPILOT_BETA === "true") {
222
+ const {requireAccessKey: requireAccessKey} = await import("./transport/access-key.js");
223
+ if (!await requireAccessKey(this, "beta")) return (0, import_utils.returnAccessKeyRequired)(this, 0),
224
+ [ [], [] ];
225
+ } else return [ [], [] ];
226
+ const trueItems = [], falseItems = [], calendarIds = /* @__PURE__ */ new Set, calendarDateRanges = /* @__PURE__ */ new Map, itemConfigs = [];
227
+ for (let i = 0; i < items.length; i++) {
228
+ const calendarId = this.getNodeParameter("calendarId", i), timeZoneSetupId = this.getNodeParameter("timeZoneSetupId", i), useNow = this.getNodeParameter("useNow", i), checkDateOnly = this.getNodeParameter("checkDateOnly", i), timestamp = useNow ? /* @__PURE__ */ new Date : new Date(this.getNodeParameter("timestamp", i));
229
+ if (!calendarDateRanges.has(calendarId)) calendarDateRanges.set(calendarId, {
230
+ min: timestamp,
231
+ max: timestamp
232
+ }); else {
233
+ const range = calendarDateRanges.get(calendarId);
234
+ timestamp < range.min && (range.min = timestamp), timestamp > range.max && (range.max = timestamp);
235
+ }
236
+ calendarIds.add(calendarId), itemConfigs.push({
237
+ timestamp: timestamp,
238
+ calendarId: calendarId,
239
+ timeZoneSetupId: timeZoneSetupId,
240
+ checkDateOnly: checkDateOnly,
241
+ useNow: useNow
242
+ });
243
+ }
244
+ const calendarsMap = /* @__PURE__ */ new Map, timeZonesMap = /* @__PURE__ */ new Map, holidaysByCalendarAndDate = /* @__PURE__ */ new Map, allTimeZones = await import_client.connectWiseApiRequest.call(this, "GET", "/system/timeZoneSetups", {}, {
245
+ pageSize: 1e3
246
+ }, {
247
+ returnAll: !0,
248
+ optionsCache: !0
249
+ });
250
+ for (const tz of allTimeZones) {
251
+ const windowsTimeZone = tz.timeZone?.name, ianaTimeZone = windowsTimeZone ? WINDOWS_TO_IANA_TIMEZONE[windowsTimeZone] : void 0;
252
+ ianaTimeZone ? timeZonesMap.set(tz.id, ianaTimeZone) : (console.warn(`No IANA timezone mapping found for Windows timezone: ${windowsTimeZone} (ID: ${tz.id}). Using UTC as fallback.`),
253
+ timeZonesMap.set(tz.id, "UTC"));
254
+ }
255
+ for (const calendarId of calendarIds) {
256
+ const calendar = await import_client.connectWiseApiRequest.call(this, "GET", `/schedule/calendars/${calendarId}`, {}, {}, {
257
+ optionsCache: !0
258
+ });
259
+ if (calendarsMap.set(calendarId, calendar), calendar.holidayList?.id) {
260
+ const dateRange = calendarDateRanges.get(calendarId), minDateStr = dateRange.min.toISOString().split("T")[0], maxDateStr = dateRange.max.toISOString().split("T")[0], holidays = await import_client.connectWiseApiRequest.call(this, "GET", `/schedule/holidayLists/${calendar.holidayList.id}/holidays`, {}, {
261
+ conditions: `date>=[${minDateStr}] and date<=[${maxDateStr}]`,
262
+ pageSize: 1e3
263
+ }, {
264
+ returnAll: !0,
265
+ optionsCache: !0
266
+ }), holidayMap = /* @__PURE__ */ new Map;
267
+ if (holidays && Array.isArray(holidays)) for (const holiday of holidays) {
268
+ const dateKey = holiday.date;
269
+ holidayMap.has(dateKey) || holidayMap.set(dateKey, []), holidayMap.get(dateKey).push(holiday);
270
+ }
271
+ holidaysByCalendarAndDate.set(calendarId, holidayMap);
272
+ }
273
+ }
274
+ for (let i = 0; i < items.length; i++) {
275
+ const config = itemConfigs[i], calendar = calendarsMap.get(config.calendarId), ianaTimeZone = timeZonesMap.get(config.timeZoneSetupId) || "UTC";
276
+ if (!calendar) {
277
+ falseItems.push(items[i]);
278
+ continue;
279
+ }
280
+ const dateTimeInZone = import_luxon.DateTime.fromJSDate(config.timestamp).setZone(ianaTimeZone), dateStr = dateTimeInZone.toISODate();
281
+ let isHoliday = !1, holidayName = null;
282
+ const holidaysForDate = holidaysByCalendarAndDate.get(config.calendarId)?.get(dateStr) || [];
283
+ if (holidaysForDate.length > 0) {
284
+ for (const holiday of holidaysForDate) if (holiday.allDayFlag) {
285
+ isHoliday = !0, holidayName = holiday.name;
286
+ break;
287
+ } else if (!config.checkDateOnly) {
288
+ const holidayStart = import_luxon.DateTime.fromISO(`${dateStr}T${holiday.timeStart}`, {
289
+ zone: ianaTimeZone
290
+ }), holidayEnd = import_luxon.DateTime.fromISO(`${dateStr}T${holiday.timeEnd}`, {
291
+ zone: ianaTimeZone
292
+ });
293
+ if (dateTimeInZone >= holidayStart && dateTimeInZone < holidayEnd) {
294
+ isHoliday = !0, holidayName = holiday.name;
295
+ break;
296
+ }
297
+ }
298
+ }
299
+ const dayName = dateTimeInZone.toFormat("cccc").toLowerCase(), startTimeField = `${dayName}StartTime`, endTimeField = `${dayName}EndTime`;
300
+ let isDuringBusinessHours = !1;
301
+ if (!isHoliday && calendar[startTimeField] && calendar[endTimeField]) if (config.checkDateOnly) isDuringBusinessHours = !0; else {
302
+ const startTime = import_luxon.DateTime.fromISO(`${dateStr}T${calendar[startTimeField]}`, {
303
+ zone: ianaTimeZone
304
+ }), endTime = import_luxon.DateTime.fromISO(`${dateStr}T${calendar[endTimeField]}`, {
305
+ zone: ianaTimeZone
306
+ });
307
+ isDuringBusinessHours = dateTimeInZone >= startTime && dateTimeInZone < endTime;
308
+ }
309
+ const itemWithMetadata = {
310
+ ...items[i],
311
+ json: {
312
+ ...items[i].json,
313
+ __schedule: {
314
+ isDuringBusinessHours: isDuringBusinessHours,
315
+ isHoliday: isHoliday,
316
+ holidayName: holidayName,
317
+ businessHours: calendar[startTimeField] ? `${calendar[startTimeField]} - ${calendar[endTimeField]}` : "Closed",
318
+ checkDateOnly: config.checkDateOnly,
319
+ timezone: ianaTimeZone,
320
+ localTime: dateTimeInZone.toFormat("yyyy-MM-dd HH:mm:ss")
321
+ }
322
+ }
323
+ };
324
+ isDuringBusinessHours ? trueItems.push(itemWithMetadata) : falseItems.push(itemWithMetadata);
325
+ }
326
+ return [ trueItems, falseItems ];
327
+ }
328
+ }
329
+
330
+ 0 && (module.exports = {
331
+ IfSchedule: IfSchedule
332
+ });
@@ -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}/n8n-nodes-connectwise/conditions${import_common.DOCURL_SUFFIX}">ConnectWise query syntax</a> for filtering results`
160
+ hint: `Use <a href="https://${import_common.DOCURL_PREFIX}/conditions${import_common.DOCURL_SUFFIX}">ConnectWise query syntax</a> for filtering results`
161
161
  },
162
162
  fields: {
163
163
  displayName: "Field Names",
@@ -336,7 +336,22 @@ function getCommonFields(options) {
336
336
  operation: [ "getAll", "getReport" ]
337
337
  }
338
338
  }
339
- } ];
339
+ }, ...queryOptions.cacheResponse ? [ {
340
+ ...queryOptions.cacheResponse,
341
+ displayOptions: {
342
+ show: {
343
+ operation: [ "get", "getAll", "getReport" ]
344
+ }
345
+ }
346
+ }, {
347
+ ...queryOptions.cacheDuration,
348
+ displayOptions: {
349
+ show: {
350
+ operation: [ "get", "getAll", "getReport" ],
351
+ cacheResponse: [ !0 ]
352
+ }
353
+ }
354
+ } ] : [] ];
340
355
  return options?.only ? fields = fields.filter(f => options.only.includes(f.name)) : options?.exclude && (fields = fields.filter(f => !options.exclude.includes(f.name))),
341
356
  options?.overrides && (fields = fields.map(field => options.overrides[field.name] ? {
342
357
  ...field,
@@ -42,6 +42,7 @@ const HINT_TYPES = {
42
42
  },
43
43
  pagination_limit: {
44
44
  aggregate: "dedupe",
45
+ type: "warning",
45
46
  template: data => `Pagination limit reached: Retrieved ${data.itemCount} items across ${data.maxPages} pages. Additional records may exist.`
46
47
  },
47
48
  cache_hit: {
@@ -62,6 +63,7 @@ const HINT_TYPES = {
62
63
  },
63
64
  cache_error: {
64
65
  aggregate: "dedupe",
66
+ type: "warning",
65
67
  template: error => `⚠️ Cache error: ${error}`
66
68
  },
67
69
  version_update: {
@@ -78,14 +80,17 @@ const HINT_TYPES = {
78
80
  },
79
81
  accesskey_missing_feature: {
80
82
  aggregate: "dedupe",
83
+ type: "warning",
81
84
  template: () => "🔑 Your access key does not include this feature."
82
85
  },
83
86
  accesskey_missing: {
84
87
  aggregate: "dedupe",
88
+ type: "warning",
85
89
  template: () => "🔑 An access key is needed to use this feature. Add one in your ConnectWise PSA credentials."
86
90
  },
87
91
  accesskey_invalid: {
88
92
  aggregate: "dedupe",
93
+ type: "danger",
89
94
  template: () => "🔑 This access key doesn't appear to be valid. Please double-check it in your ConnectWise PSA credentials."
90
95
  },
91
96
  custom: {
@@ -143,7 +148,10 @@ function flushHints(ctx) {
143
148
  if (type === "custom") {
144
149
  for (const val of values) val !== void 0 && hints.push({
145
150
  message: config.template(val),
146
- location: "outputPane"
151
+ location: "outputPane",
152
+ ...config.type ? {
153
+ type: config.type
154
+ } : {}
147
155
  });
148
156
  continue;
149
157
  }
@@ -168,7 +176,10 @@ function flushHints(ctx) {
168
176
  }
169
177
  hints.push({
170
178
  message: message,
171
- location: "outputPane"
179
+ location: "outputPane",
180
+ ...config.type ? {
181
+ type: config.type
182
+ } : {}
172
183
  });
173
184
  }
174
185
  hints.length > 0 && ctx.addExecutionHints(...hints), collectors.delete(ctx);
@@ -192,7 +203,10 @@ function emitHintDirectly(ctx, type, value) {
192
203
  }
193
204
  ctx.addExecutionHints({
194
205
  message: message,
195
- location: "outputPane"
206
+ location: "outputPane",
207
+ ...config.type ? {
208
+ type: config.type
209
+ } : {}
196
210
  });
197
211
  }
198
212
 
@@ -44,6 +44,7 @@ const resourceSchemas = {
44
44
  ticketNote: import_ticketNote.ticketNoteSchema,
45
45
  ticketTask: import_ticketTask.ticketTaskSchema,
46
46
  timeEntry: import_timeEntry.timeEntrySchema,
47
+ reports: require("../schema/resources/reports.schema").reportsSchema,
47
48
  custom: import_custom.customSchema
48
49
  };
49
50