n8n-nodes-logicmonitor 0.1.0

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 (79) hide show
  1. package/README.md +90 -0
  2. package/dist/credentials/LogicMonitorApi.credentials.d.ts +8 -0
  3. package/dist/credentials/LogicMonitorApi.credentials.d.ts.map +1 -0
  4. package/dist/credentials/LogicMonitorApi.credentials.js +38 -0
  5. package/dist/credentials/LogicMonitorApi.credentials.js.map +1 -0
  6. package/dist/index.d.ts +3 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +8 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/nodes/LogicMonitor/LogicMonitor.node.d.ts +6 -0
  11. package/dist/nodes/LogicMonitor/LogicMonitor.node.d.ts.map +1 -0
  12. package/dist/nodes/LogicMonitor/LogicMonitor.node.js +118 -0
  13. package/dist/nodes/LogicMonitor/LogicMonitor.node.js.map +1 -0
  14. package/dist/nodes/LogicMonitor/descriptions/alerts.descriptions.d.ts +4 -0
  15. package/dist/nodes/LogicMonitor/descriptions/alerts.descriptions.d.ts.map +1 -0
  16. package/dist/nodes/LogicMonitor/descriptions/alerts.descriptions.js +157 -0
  17. package/dist/nodes/LogicMonitor/descriptions/alerts.descriptions.js.map +1 -0
  18. package/dist/nodes/LogicMonitor/descriptions/collectors.descriptions.d.ts +4 -0
  19. package/dist/nodes/LogicMonitor/descriptions/collectors.descriptions.d.ts.map +1 -0
  20. package/dist/nodes/LogicMonitor/descriptions/collectors.descriptions.js +232 -0
  21. package/dist/nodes/LogicMonitor/descriptions/collectors.descriptions.js.map +1 -0
  22. package/dist/nodes/LogicMonitor/descriptions/datasources.descriptions.d.ts +4 -0
  23. package/dist/nodes/LogicMonitor/descriptions/datasources.descriptions.d.ts.map +1 -0
  24. package/dist/nodes/LogicMonitor/descriptions/datasources.descriptions.js +214 -0
  25. package/dist/nodes/LogicMonitor/descriptions/datasources.descriptions.js.map +1 -0
  26. package/dist/nodes/LogicMonitor/descriptions/deviceGroups.descriptions.d.ts +4 -0
  27. package/dist/nodes/LogicMonitor/descriptions/deviceGroups.descriptions.d.ts.map +1 -0
  28. package/dist/nodes/LogicMonitor/descriptions/deviceGroups.descriptions.js +279 -0
  29. package/dist/nodes/LogicMonitor/descriptions/deviceGroups.descriptions.js.map +1 -0
  30. package/dist/nodes/LogicMonitor/descriptions/devices.descriptions.d.ts +4 -0
  31. package/dist/nodes/LogicMonitor/descriptions/devices.descriptions.d.ts.map +1 -0
  32. package/dist/nodes/LogicMonitor/descriptions/devices.descriptions.js +307 -0
  33. package/dist/nodes/LogicMonitor/descriptions/devices.descriptions.js.map +1 -0
  34. package/dist/nodes/LogicMonitor/descriptions/sdts.descriptions.d.ts +4 -0
  35. package/dist/nodes/LogicMonitor/descriptions/sdts.descriptions.d.ts.map +1 -0
  36. package/dist/nodes/LogicMonitor/descriptions/sdts.descriptions.js +260 -0
  37. package/dist/nodes/LogicMonitor/descriptions/sdts.descriptions.js.map +1 -0
  38. package/dist/nodes/LogicMonitor/helpers/apiRequest.d.ts +4 -0
  39. package/dist/nodes/LogicMonitor/helpers/apiRequest.d.ts.map +1 -0
  40. package/dist/nodes/LogicMonitor/helpers/apiRequest.js +115 -0
  41. package/dist/nodes/LogicMonitor/helpers/apiRequest.js.map +1 -0
  42. package/dist/nodes/LogicMonitor/helpers/errorHandler.d.ts +2 -0
  43. package/dist/nodes/LogicMonitor/helpers/errorHandler.d.ts.map +1 -0
  44. package/dist/nodes/LogicMonitor/helpers/errorHandler.js +29 -0
  45. package/dist/nodes/LogicMonitor/helpers/errorHandler.js.map +1 -0
  46. package/dist/nodes/LogicMonitor/helpers/executeOperation.d.ts +3 -0
  47. package/dist/nodes/LogicMonitor/helpers/executeOperation.d.ts.map +1 -0
  48. package/dist/nodes/LogicMonitor/helpers/executeOperation.js +99 -0
  49. package/dist/nodes/LogicMonitor/helpers/executeOperation.js.map +1 -0
  50. package/dist/nodes/LogicMonitor/helpers/responseFormatter.d.ts +3 -0
  51. package/dist/nodes/LogicMonitor/helpers/responseFormatter.d.ts.map +1 -0
  52. package/dist/nodes/LogicMonitor/helpers/responseFormatter.js +19 -0
  53. package/dist/nodes/LogicMonitor/helpers/responseFormatter.js.map +1 -0
  54. package/dist/nodes/LogicMonitor/logicmonitor.svg +1 -0
  55. package/dist/nodes/LogicMonitor/methods/alerts.d.ts +7 -0
  56. package/dist/nodes/LogicMonitor/methods/alerts.d.ts.map +1 -0
  57. package/dist/nodes/LogicMonitor/methods/alerts.js +53 -0
  58. package/dist/nodes/LogicMonitor/methods/alerts.js.map +1 -0
  59. package/dist/nodes/LogicMonitor/methods/collectors.d.ts +9 -0
  60. package/dist/nodes/LogicMonitor/methods/collectors.d.ts.map +1 -0
  61. package/dist/nodes/LogicMonitor/methods/collectors.js +95 -0
  62. package/dist/nodes/LogicMonitor/methods/collectors.js.map +1 -0
  63. package/dist/nodes/LogicMonitor/methods/datasources.d.ts +6 -0
  64. package/dist/nodes/LogicMonitor/methods/datasources.d.ts.map +1 -0
  65. package/dist/nodes/LogicMonitor/methods/datasources.js +62 -0
  66. package/dist/nodes/LogicMonitor/methods/datasources.js.map +1 -0
  67. package/dist/nodes/LogicMonitor/methods/deviceGroups.d.ts +7 -0
  68. package/dist/nodes/LogicMonitor/methods/deviceGroups.d.ts.map +1 -0
  69. package/dist/nodes/LogicMonitor/methods/deviceGroups.js +81 -0
  70. package/dist/nodes/LogicMonitor/methods/deviceGroups.js.map +1 -0
  71. package/dist/nodes/LogicMonitor/methods/devices.d.ts +7 -0
  72. package/dist/nodes/LogicMonitor/methods/devices.d.ts.map +1 -0
  73. package/dist/nodes/LogicMonitor/methods/devices.js +94 -0
  74. package/dist/nodes/LogicMonitor/methods/devices.js.map +1 -0
  75. package/dist/nodes/LogicMonitor/methods/sdts.d.ts +7 -0
  76. package/dist/nodes/LogicMonitor/methods/sdts.d.ts.map +1 -0
  77. package/dist/nodes/LogicMonitor/methods/sdts.js +72 -0
  78. package/dist/nodes/LogicMonitor/methods/sdts.js.map +1 -0
  79. package/package.json +53 -0
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getMany = getMany;
4
+ exports.get = get;
5
+ exports.acknowledge = acknowledge;
6
+ exports.escalate = escalate;
7
+ exports.addNote = addNote;
8
+ const apiRequest_1 = require("../helpers/apiRequest");
9
+ const responseFormatter_1 = require("../helpers/responseFormatter");
10
+ async function getMany(i) {
11
+ const returnAll = this.getNodeParameter('returnAll', i, false);
12
+ const additionalFields = this.getNodeParameter('additionalFields', i, {});
13
+ const query = {};
14
+ if (additionalFields.fields)
15
+ query.fields = additionalFields.fields;
16
+ if (additionalFields.filter)
17
+ query.filter = additionalFields.filter;
18
+ if (returnAll) {
19
+ const items = await apiRequest_1.apiRequestAllItems.call(this, 'GET', '/alert/alerts', {}, query);
20
+ return items.map((item) => ({ json: item }));
21
+ }
22
+ const limit = this.getNodeParameter('limit', i, 50);
23
+ query.size = limit;
24
+ const response = await apiRequest_1.apiRequest.call(this, 'GET', '/alert/alerts', {}, query);
25
+ return (0, responseFormatter_1.formatResponse)(response);
26
+ }
27
+ async function get(i) {
28
+ const alertId = this.getNodeParameter('alertId', i);
29
+ const options = this.getNodeParameter('options', i, {});
30
+ const query = {};
31
+ if (options.needMessage !== undefined)
32
+ query.needMessage = options.needMessage;
33
+ const response = await apiRequest_1.apiRequest.call(this, 'GET', `/alert/alerts/${alertId}`, {}, query);
34
+ return (0, responseFormatter_1.formatResponse)(response);
35
+ }
36
+ async function acknowledge(i) {
37
+ const alertId = this.getNodeParameter('alertId', i);
38
+ const ackComment = this.getNodeParameter('ackComment', i);
39
+ const response = await apiRequest_1.apiRequest.call(this, 'POST', `/alert/alerts/${alertId}/ack`, { ackComment });
40
+ return [{ json: response ?? { success: true, alertId } }];
41
+ }
42
+ async function escalate(i) {
43
+ const alertId = this.getNodeParameter('alertId', i);
44
+ const response = await apiRequest_1.apiRequest.call(this, 'POST', `/alert/alerts/${alertId}/escalate`);
45
+ return [{ json: response ?? { success: true, alertId } }];
46
+ }
47
+ async function addNote(i) {
48
+ const alertId = this.getNodeParameter('alertId', i);
49
+ const ackComment = this.getNodeParameter('ackComment', i);
50
+ const response = await apiRequest_1.apiRequest.call(this, 'POST', `/alert/alerts/${alertId}/note`, { ackComment });
51
+ return [{ json: response ?? { success: true, alertId } }];
52
+ }
53
+ //# sourceMappingURL=alerts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alerts.js","sourceRoot":"","sources":["../../../../nodes/LogicMonitor/methods/alerts.ts"],"names":[],"mappings":";;AAIA,0BAiBC;AAED,kBASC;AAED,kCAMC;AAED,4BAKC;AAED,0BAMC;AAtDD,sDAAuE;AACvE,oEAA8D;AAEvD,KAAK,UAAU,OAAO,CAA0B,CAAS;IAC/D,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,EAAE,KAAK,CAAY,CAAC;IAC1E,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,CAAC,EAAE,EAAE,CAAgB,CAAC;IAEzF,MAAM,KAAK,GAAgB,EAAE,CAAC;IAC9B,IAAI,gBAAgB,CAAC,MAAM;QAAE,KAAK,CAAC,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC;IACpE,IAAI,gBAAgB,CAAC,MAAM;QAAE,KAAK,CAAC,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC;IAEpE,IAAI,SAAS,EAAE,CAAC;QACf,MAAM,KAAK,GAAG,MAAM,+BAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;QACrF,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,KAAK,GAAG,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AAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;AAC3D,CAAC;AAEM,KAAK,UAAU,QAAQ,CAA0B,CAAS;IAChE,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAW,CAAC;IAE9D,MAAM,QAAQ,GAAG,MAAM,uBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,iBAAiB,OAAO,WAAW,CAAC,CAAC;IAC1F,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;AAC3D,CAAC;AAEM,KAAK,UAAU,OAAO,CAA0B,CAAS;IAC/D,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAW,CAAC;IAC9D,MAAM,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC,CAAW,CAAC;IAEpE,MAAM,QAAQ,GAAG,MAAM,uBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,iBAAiB,OAAO,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;IACtG,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;AAC3D,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
+ export declare function getMany(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
3
+ export declare function get(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
4
+ export declare function create(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
5
+ export declare function update(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
6
+ export declare function deleteCollector(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
7
+ export declare function getVersions(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
8
+ export declare function acknowledgeDown(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
9
+ //# sourceMappingURL=collectors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collectors.d.ts","sourceRoot":"","sources":["../../../../nodes/LogicMonitor/methods/collectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAe,MAAM,cAAc,CAAC;AAIlF,wBAAsB,OAAO,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAiB/F;AAED,wBAAsB,GAAG,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAI3F;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAqB9F;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAsB9F;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAIvG;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAWnG;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CASvG"}
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getMany = getMany;
4
+ exports.get = get;
5
+ exports.create = create;
6
+ exports.update = update;
7
+ exports.deleteCollector = deleteCollector;
8
+ exports.getVersions = getVersions;
9
+ exports.acknowledgeDown = acknowledgeDown;
10
+ const apiRequest_1 = require("../helpers/apiRequest");
11
+ const responseFormatter_1 = require("../helpers/responseFormatter");
12
+ async function getMany(i) {
13
+ const returnAll = this.getNodeParameter('returnAll', i, false);
14
+ const additionalFields = this.getNodeParameter('additionalFields', i, {});
15
+ const query = {};
16
+ if (additionalFields.fields)
17
+ query.fields = additionalFields.fields;
18
+ if (additionalFields.filter)
19
+ query.filter = additionalFields.filter;
20
+ if (returnAll) {
21
+ const items = await apiRequest_1.apiRequestAllItems.call(this, 'GET', '/setting/collector/collectors', {}, query);
22
+ return items.map((item) => ({ json: item }));
23
+ }
24
+ const limit = this.getNodeParameter('limit', i, 50);
25
+ query.size = limit;
26
+ const response = await apiRequest_1.apiRequest.call(this, 'GET', '/setting/collector/collectors', {}, query);
27
+ return (0, responseFormatter_1.formatResponse)(response);
28
+ }
29
+ async function get(i) {
30
+ const collectorId = this.getNodeParameter('collectorId', i);
31
+ const response = await apiRequest_1.apiRequest.call(this, 'GET', `/setting/collector/collectors/${collectorId}`);
32
+ return (0, responseFormatter_1.formatResponse)(response);
33
+ }
34
+ async function create(i) {
35
+ const additionalFields = this.getNodeParameter('additionalFields', i, {});
36
+ const body = {};
37
+ const allowedFields = ['description', 'collectorGroupId', 'enableFailBack'];
38
+ for (const field of allowedFields) {
39
+ if (additionalFields[field] !== undefined && additionalFields[field] !== '' && additionalFields[field] !== 0) {
40
+ body[field] = additionalFields[field];
41
+ }
42
+ }
43
+ if (additionalFields.customProperties) {
44
+ const propsCollection = additionalFields.customProperties.property;
45
+ if (propsCollection?.length) {
46
+ body.customProperties = propsCollection;
47
+ }
48
+ }
49
+ const response = await apiRequest_1.apiRequest.call(this, 'POST', '/setting/collector/collectors', body);
50
+ return (0, responseFormatter_1.formatResponse)(response);
51
+ }
52
+ async function update(i) {
53
+ const collectorId = this.getNodeParameter('collectorId', i);
54
+ const updateFields = this.getNodeParameter('updateFields', i, {});
55
+ const body = {};
56
+ const allowedFields = ['description', 'collectorGroupId', 'enableFailBack'];
57
+ for (const field of allowedFields) {
58
+ if (updateFields[field] !== undefined && updateFields[field] !== '') {
59
+ body[field] = updateFields[field];
60
+ }
61
+ }
62
+ if (updateFields.customProperties) {
63
+ const propsCollection = updateFields.customProperties.property;
64
+ if (propsCollection?.length) {
65
+ body.customProperties = propsCollection;
66
+ }
67
+ }
68
+ const response = await apiRequest_1.apiRequest.call(this, 'PATCH', `/setting/collector/collectors/${collectorId}`, body);
69
+ return (0, responseFormatter_1.formatResponse)(response);
70
+ }
71
+ async function deleteCollector(i) {
72
+ const collectorId = this.getNodeParameter('collectorId', i);
73
+ await apiRequest_1.apiRequest.call(this, 'DELETE', `/setting/collector/collectors/${collectorId}`);
74
+ return [{ json: { success: true, id: collectorId } }];
75
+ }
76
+ async function getVersions(i) {
77
+ const returnAll = this.getNodeParameter('returnAll', i, false);
78
+ if (returnAll) {
79
+ const items = await apiRequest_1.apiRequestAllItems.call(this, 'GET', '/setting/collector/collectors/versions');
80
+ return items.map((item) => ({ json: item }));
81
+ }
82
+ const limit = this.getNodeParameter('limit', i, 50);
83
+ const response = await apiRequest_1.apiRequest.call(this, 'GET', '/setting/collector/collectors/versions', {}, { size: limit });
84
+ return (0, responseFormatter_1.formatResponse)(response);
85
+ }
86
+ async function acknowledgeDown(i) {
87
+ const collectorId = this.getNodeParameter('collectorId', i);
88
+ const comment = this.getNodeParameter('comment', i, '');
89
+ const body = {};
90
+ if (comment)
91
+ body.comment = comment;
92
+ const response = await apiRequest_1.apiRequest.call(this, 'POST', `/setting/collector/collectors/${collectorId}/ackdown`, body);
93
+ return [{ json: response ?? { success: true, collectorId } }];
94
+ }
95
+ //# sourceMappingURL=collectors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collectors.js","sourceRoot":"","sources":["../../../../nodes/LogicMonitor/methods/collectors.ts"],"names":[],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O,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
+ export declare function getMany(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
3
+ export declare function get(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
4
+ export declare function update(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
5
+ export declare function deleteDatasource(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
6
+ //# sourceMappingURL=datasources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datasources.d.ts","sourceRoot":"","sources":["../../../../nodes/LogicMonitor/methods/datasources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAe,MAAM,cAAc,CAAC;AAIlF,wBAAsB,OAAO,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAkB/F;AAED,wBAAsB,GAAG,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAU3F;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAqB9F;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAIxG"}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getMany = getMany;
4
+ exports.get = get;
5
+ exports.update = update;
6
+ exports.deleteDatasource = deleteDatasource;
7
+ const apiRequest_1 = require("../helpers/apiRequest");
8
+ const responseFormatter_1 = require("../helpers/responseFormatter");
9
+ async function getMany(i) {
10
+ const returnAll = this.getNodeParameter('returnAll', i, false);
11
+ const additionalFields = this.getNodeParameter('additionalFields', i, {});
12
+ const query = {};
13
+ if (additionalFields.fields)
14
+ query.fields = additionalFields.fields;
15
+ if (additionalFields.filter)
16
+ query.filter = additionalFields.filter;
17
+ if (additionalFields.format)
18
+ query.format = additionalFields.format;
19
+ if (returnAll) {
20
+ const items = await apiRequest_1.apiRequestAllItems.call(this, 'GET', '/setting/datasources', {}, query);
21
+ return items.map((item) => ({ json: item }));
22
+ }
23
+ const limit = this.getNodeParameter('limit', i, 50);
24
+ query.size = limit;
25
+ const response = await apiRequest_1.apiRequest.call(this, 'GET', '/setting/datasources', {}, query);
26
+ return (0, responseFormatter_1.formatResponse)(response);
27
+ }
28
+ async function get(i) {
29
+ const datasourceId = this.getNodeParameter('datasourceId', i);
30
+ const options = this.getNodeParameter('options', i, {});
31
+ const query = {};
32
+ if (options.fields)
33
+ query.fields = options.fields;
34
+ if (options.format)
35
+ query.format = options.format;
36
+ const response = await apiRequest_1.apiRequest.call(this, 'GET', `/setting/datasources/${datasourceId}`, {}, query);
37
+ return (0, responseFormatter_1.formatResponse)(response);
38
+ }
39
+ async function update(i) {
40
+ const datasourceId = this.getNodeParameter('datasourceId', i);
41
+ const updateFields = this.getNodeParameter('updateFields', i, {});
42
+ const body = {};
43
+ const query = {};
44
+ // 'reason' goes as a query param
45
+ if (updateFields.reason) {
46
+ query.reason = updateFields.reason;
47
+ }
48
+ const allowedBodyFields = ['name', 'displayName', 'description', 'group', 'appliesTo', 'tags', 'technology'];
49
+ for (const field of allowedBodyFields) {
50
+ if (updateFields[field] !== undefined && updateFields[field] !== '') {
51
+ body[field] = updateFields[field];
52
+ }
53
+ }
54
+ const response = await apiRequest_1.apiRequest.call(this, 'PATCH', `/setting/datasources/${datasourceId}`, body, query);
55
+ return (0, responseFormatter_1.formatResponse)(response);
56
+ }
57
+ async function deleteDatasource(i) {
58
+ const datasourceId = this.getNodeParameter('datasourceId', i);
59
+ await apiRequest_1.apiRequest.call(this, 'DELETE', `/setting/datasources/${datasourceId}`);
60
+ return [{ json: { success: true, id: datasourceId } }];
61
+ }
62
+ //# sourceMappingURL=datasources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datasources.js","sourceRoot":"","sources":["../../../../nodes/LogicMonitor/methods/datasources.ts"],"names":[],"mappings":";;AAIA,0BAkBC;AAED,kBAUC;AAED,wBAqBC;AAED,4CAIC;AA9DD,sDAAuE;AACvE,oEAA8D;AAEvD,KAAK,UAAU,OAAO,CAA0B,CAAS;IAC/D,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,EAAE,KAAK,CAAY,CAAC;IAC1E,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,CAAC,EAAE,EAAE,CAAgB,CAAC;IAEzF,MAAM,KAAK,GAAgB,EAAE,CAAC;IAC9B,IAAI,gBAAgB,CAAC,MAAM;QAAE,KAAK,CAAC,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC;IACpE,IAAI,gBAAgB,CAAC,MAAM;QAAE,KAAK,CAAC,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC;IACpE,IAAI,gBAAgB,CAAC,MAAM;QAAE,KAAK,CAAC,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC;IAEpE,IAAI,SAAS,EAAE,CAAC;QACf,MAAM,KAAK,GAAG,MAAM,+BAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,sBAAsB,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;QAC5F,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAW,C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G,YAAY,CAAC,MAAM,CAAC;IACpC,CAAC;IAED,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;IAC7G,KAAK,MAAM,KAAK,IAAI,iBAAiB,EAAE,CAAC;QACvC,IAAI,YAAY,CAAC,KAAK,CAAC,KAAK,SAAS,IAAI,YAAY,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;YACrE,IAAI,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC;IACF,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,uBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,wBAAwB,YAAY,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAC3G,OAAO,IAAA,kCAAc,EAAC,QAAQ,CAAC,CAAC;AACjC,CAAC;AAEM,KAAK,UAAU,gBAAgB,CAA0B,CAAS;IACxE,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC,CAAW,CAAC;IACxE,MAAM,uBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,wBAAwB,YAAY,EAAE,CAAC,CAAC;IAC9E,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,CAAC,CAAC;AACxD,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
+ export declare function getMany(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
3
+ export declare function get(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
4
+ export declare function create(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
5
+ export declare function update(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
6
+ export declare function deleteGroup(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
7
+ //# sourceMappingURL=deviceGroups.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviceGroups.d.ts","sourceRoot":"","sources":["../../../../nodes/LogicMonitor/methods/deviceGroups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAe,MAAM,cAAc,CAAC;AAIlF,wBAAsB,OAAO,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAiB/F;AAED,wBAAsB,GAAG,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAI3F;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAsB9F;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAqB9F;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAUnG"}
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getMany = getMany;
4
+ exports.get = get;
5
+ exports.create = create;
6
+ exports.update = update;
7
+ exports.deleteGroup = deleteGroup;
8
+ const apiRequest_1 = require("../helpers/apiRequest");
9
+ const responseFormatter_1 = require("../helpers/responseFormatter");
10
+ async function getMany(i) {
11
+ const returnAll = this.getNodeParameter('returnAll', i, false);
12
+ const additionalFields = this.getNodeParameter('additionalFields', i, {});
13
+ const query = {};
14
+ if (additionalFields.fields)
15
+ query.fields = additionalFields.fields;
16
+ if (additionalFields.filter)
17
+ query.filter = additionalFields.filter;
18
+ if (returnAll) {
19
+ const items = await apiRequest_1.apiRequestAllItems.call(this, 'GET', '/device/groups', {}, query);
20
+ return items.map((item) => ({ json: item }));
21
+ }
22
+ const limit = this.getNodeParameter('limit', i, 50);
23
+ query.size = limit;
24
+ const response = await apiRequest_1.apiRequest.call(this, 'GET', '/device/groups', {}, query);
25
+ return (0, responseFormatter_1.formatResponse)(response);
26
+ }
27
+ async function get(i) {
28
+ const groupId = this.getNodeParameter('groupId', i);
29
+ const response = await apiRequest_1.apiRequest.call(this, 'GET', `/device/groups/${groupId}`);
30
+ return (0, responseFormatter_1.formatResponse)(response);
31
+ }
32
+ async function create(i) {
33
+ const name = this.getNodeParameter('name', i);
34
+ const additionalFields = this.getNodeParameter('additionalFields', i, {});
35
+ const body = { name };
36
+ const allowedFields = ['description', 'parentId', 'appliesTo', 'disableAlerting', 'defaultCollectorId'];
37
+ for (const field of allowedFields) {
38
+ if (additionalFields[field] !== undefined && additionalFields[field] !== '' && additionalFields[field] !== 0) {
39
+ body[field] = additionalFields[field];
40
+ }
41
+ }
42
+ if (additionalFields.customProperties) {
43
+ const propsCollection = additionalFields.customProperties.property;
44
+ if (propsCollection?.length) {
45
+ body.customProperties = propsCollection;
46
+ }
47
+ }
48
+ const response = await apiRequest_1.apiRequest.call(this, 'POST', '/device/groups', body);
49
+ return (0, responseFormatter_1.formatResponse)(response);
50
+ }
51
+ async function update(i) {
52
+ const groupId = this.getNodeParameter('groupId', i);
53
+ const updateFields = this.getNodeParameter('updateFields', i, {});
54
+ const body = {};
55
+ const allowedFields = ['name', 'description', 'parentId', 'appliesTo', 'disableAlerting', 'defaultCollectorId'];
56
+ for (const field of allowedFields) {
57
+ if (updateFields[field] !== undefined && updateFields[field] !== '') {
58
+ body[field] = updateFields[field];
59
+ }
60
+ }
61
+ if (updateFields.customProperties) {
62
+ const propsCollection = updateFields.customProperties.property;
63
+ if (propsCollection?.length) {
64
+ body.customProperties = propsCollection;
65
+ }
66
+ }
67
+ const response = await apiRequest_1.apiRequest.call(this, 'PATCH', `/device/groups/${groupId}`, body);
68
+ return (0, responseFormatter_1.formatResponse)(response);
69
+ }
70
+ async function deleteGroup(i) {
71
+ const groupId = this.getNodeParameter('groupId', i);
72
+ const options = this.getNodeParameter('options', i, {});
73
+ const query = {};
74
+ if (options.deleteChildren !== undefined)
75
+ query.deleteChildren = options.deleteChildren;
76
+ if (options.deleteHard !== undefined)
77
+ query.deleteHard = options.deleteHard;
78
+ await apiRequest_1.apiRequest.call(this, 'DELETE', `/device/groups/${groupId}`, {}, query);
79
+ return [{ json: { success: true, id: groupId } }];
80
+ }
81
+ //# sourceMappingURL=deviceGroups.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviceGroups.js","sourceRoot":"","sources":["../../../../nodes/LogicMonitor/methods/deviceGroups.ts"],"names":[],"mappings":";;AAIA,0BAiBC;AAED,kBAIC;AAED,wBAsBC;AAED,wBAqBC;AAED,kCAUC;AArFD,sDAAuE;AACvE,oEAA8D;AAEvD,KAAK,UAAU,OAAO,CAA0B,CAAS;IAC/D,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,EAAE,KAAK,CAAY,CAAC;IAC1E,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,CAAC,EAAE,EAAE,CAAgB,CAAC;IAEzF,MAAM,KAAK,GAAgB,EAAE,CAAC;IAC9B,IAAI,gBAAgB,CAAC,MAAM;QAAE,KAAK,CAAC,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC;IACpE,IAAI,gBAAgB,CAAC,MAAM;QAAE,KAAK,CAAC,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC;IAEpE,IAAI,SAAS,EAAE,CAAC;QACf,MAAM,KAAK,GAAG,MAAM,+BAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC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ACnC,MAAM,eAAe,GAAI,YAAY,CAAC,gBAAgC,CAAC,QAAyB,CAAC;QACjG,IAAI,eAAe,EAAE,MAAM,EAAE,CAAC;YAC7B,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;QACzC,CAAC;IACF,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,uBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,kBAAkB,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC;IACzF,OAAO,IAAA,kCAAc,EAAC,QAAQ,CAAC,CAAC;AACjC,CAAC;AAEM,KAAK,UAAU,WAAW,CAA0B,CAAS;IACnE,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAW,CAAC;IAC9D,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,CAAgB,CAAC;IAEvE,MAAM,KAAK,GAAgB,EAAE,CAAC;IAC9B,IAAI,OAAO,CAAC,cAAc,KAAK,SAAS;QAAE,KAAK,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;IACxF,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS;QAAE,KAAK,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAE5E,MAAM,uBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,kBAAkB,OAAO,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IAC9E,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;AACnD,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
+ export declare function getMany(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
3
+ export declare function get(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
4
+ export declare function create(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
5
+ export declare function update(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
6
+ export declare function deleteDevice(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
7
+ //# sourceMappingURL=devices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devices.d.ts","sourceRoot":"","sources":["../../../../nodes/LogicMonitor/methods/devices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAe,MAAM,cAAc,CAAC;AAIlF,wBAAsB,OAAO,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAoB/F;AAED,wBAAsB,GAAG,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAI3F;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAgC9F;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAqB9F;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CASpG"}
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getMany = getMany;
4
+ exports.get = get;
5
+ exports.create = create;
6
+ exports.update = update;
7
+ exports.deleteDevice = deleteDevice;
8
+ const apiRequest_1 = require("../helpers/apiRequest");
9
+ const responseFormatter_1 = require("../helpers/responseFormatter");
10
+ async function getMany(i) {
11
+ const returnAll = this.getNodeParameter('returnAll', i, false);
12
+ const additionalFields = this.getNodeParameter('additionalFields', i, {});
13
+ const query = {};
14
+ if (additionalFields.fields)
15
+ query.fields = additionalFields.fields;
16
+ if (additionalFields.filter)
17
+ query.filter = additionalFields.filter;
18
+ if (additionalFields.includeDeletedResources) {
19
+ query.includeDeletedResources = additionalFields.includeDeletedResources;
20
+ }
21
+ if (returnAll) {
22
+ const items = await apiRequest_1.apiRequestAllItems.call(this, 'GET', '/device/devices', {}, query);
23
+ return items.map((item) => ({ json: item }));
24
+ }
25
+ const limit = this.getNodeParameter('limit', i, 50);
26
+ query.size = limit;
27
+ const response = await apiRequest_1.apiRequest.call(this, 'GET', '/device/devices', {}, query);
28
+ return (0, responseFormatter_1.formatResponse)(response);
29
+ }
30
+ async function get(i) {
31
+ const deviceId = this.getNodeParameter('deviceId', i);
32
+ const response = await apiRequest_1.apiRequest.call(this, 'GET', `/device/devices/${deviceId}`);
33
+ return (0, responseFormatter_1.formatResponse)(response);
34
+ }
35
+ async function create(i) {
36
+ const displayName = this.getNodeParameter('displayName', i);
37
+ const name = this.getNodeParameter('name', i);
38
+ const preferredCollectorId = this.getNodeParameter('preferredCollectorId', i);
39
+ const additionalFields = this.getNodeParameter('additionalFields', i, {});
40
+ const body = {
41
+ displayName,
42
+ name,
43
+ preferredCollectorId,
44
+ };
45
+ if (additionalFields.description)
46
+ body.description = additionalFields.description;
47
+ if (additionalFields.disableAlerting !== undefined)
48
+ body.disableAlerting = additionalFields.disableAlerting;
49
+ if (additionalFields.enableNetflow !== undefined)
50
+ body.enableNetflow = additionalFields.enableNetflow;
51
+ if (additionalFields.hostGroupIds) {
52
+ body.hostGroupIds = additionalFields.hostGroupIds
53
+ .split(',')
54
+ .map((id) => id.trim())
55
+ .join(',');
56
+ }
57
+ if (additionalFields.customProperties) {
58
+ const propsCollection = additionalFields.customProperties.property;
59
+ if (propsCollection?.length) {
60
+ body.customProperties = propsCollection;
61
+ }
62
+ }
63
+ const response = await apiRequest_1.apiRequest.call(this, 'POST', '/device/devices', body);
64
+ return (0, responseFormatter_1.formatResponse)(response);
65
+ }
66
+ async function update(i) {
67
+ const deviceId = this.getNodeParameter('deviceId', i);
68
+ const updateFields = this.getNodeParameter('updateFields', i, {});
69
+ const body = {};
70
+ const allowedFields = ['displayName', 'name', 'description', 'preferredCollectorId', 'disableAlerting', 'enableNetflow'];
71
+ for (const field of allowedFields) {
72
+ if (updateFields[field] !== undefined && updateFields[field] !== '') {
73
+ body[field] = updateFields[field];
74
+ }
75
+ }
76
+ if (updateFields.customProperties) {
77
+ const propsCollection = updateFields.customProperties.property;
78
+ if (propsCollection?.length) {
79
+ body.customProperties = propsCollection;
80
+ }
81
+ }
82
+ const response = await apiRequest_1.apiRequest.call(this, 'PATCH', `/device/devices/${deviceId}`, body);
83
+ return (0, responseFormatter_1.formatResponse)(response);
84
+ }
85
+ async function deleteDevice(i) {
86
+ const deviceId = this.getNodeParameter('deviceId', i);
87
+ const options = this.getNodeParameter('options', i, {});
88
+ const query = {};
89
+ if (options.deleteHard !== undefined)
90
+ query.deleteHard = options.deleteHard;
91
+ await apiRequest_1.apiRequest.call(this, 'DELETE', `/device/devices/${deviceId}`, {}, query);
92
+ return [{ json: { success: true, id: deviceId } }];
93
+ }
94
+ //# sourceMappingURL=devices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devices.js","sourceRoot":"","sources":["../../../../nodes/LogicMonitor/methods/devices.ts"],"names":[],"mappings":";;AAIA,0BAoBC;AAED,kBAIC;AAED,wBAgCC;AAED,wBAqBC;AAED,oCASC;AAjGD,sDAAuE;AACvE,oEAA8D;AAEvD,KAAK,UAAU,OAAO,CAA0B,CAAS;IAC/D,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,EAAE,KAAK,CAAY,CAAC;IAC1E,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,CAAC,EAAE,EAAE,CAAgB,CAAC;IAEzF,MAAM,KAAK,GAAgB,EAAE,CAAC;IAC9B,IA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CAAC,UAAU,EAAE,CAAC,CAAW,CAAC;IAChE,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,CAAgB,CAAC;IAEvE,MAAM,KAAK,GAAgB,EAAE,CAAC;IAC9B,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS;QAAE,KAAK,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAE5E,MAAM,uBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,mBAAmB,QAAQ,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IAChF,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;AACpD,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
+ export declare function getMany(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
3
+ export declare function get(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
4
+ export declare function create(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
5
+ export declare function update(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
6
+ export declare function deleteSdt(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
7
+ //# sourceMappingURL=sdts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdts.d.ts","sourceRoot":"","sources":["../../../../nodes/LogicMonitor/methods/sdts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAe,MAAM,cAAc,CAAC;AAIlF,wBAAsB,OAAO,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAiB/F;AAED,wBAAsB,GAAG,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAI3F;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAsB9F;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAa9F;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAIjG"}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getMany = getMany;
4
+ exports.get = get;
5
+ exports.create = create;
6
+ exports.update = update;
7
+ exports.deleteSdt = deleteSdt;
8
+ const apiRequest_1 = require("../helpers/apiRequest");
9
+ const responseFormatter_1 = require("../helpers/responseFormatter");
10
+ async function getMany(i) {
11
+ const returnAll = this.getNodeParameter('returnAll', i, false);
12
+ const additionalFields = this.getNodeParameter('additionalFields', i, {});
13
+ const query = {};
14
+ if (additionalFields.fields)
15
+ query.fields = additionalFields.fields;
16
+ if (additionalFields.filter)
17
+ query.filter = additionalFields.filter;
18
+ if (returnAll) {
19
+ const items = await apiRequest_1.apiRequestAllItems.call(this, 'GET', '/sdt/sdts', {}, query);
20
+ return items.map((item) => ({ json: item }));
21
+ }
22
+ const limit = this.getNodeParameter('limit', i, 50);
23
+ query.size = limit;
24
+ const response = await apiRequest_1.apiRequest.call(this, 'GET', '/sdt/sdts', {}, query);
25
+ return (0, responseFormatter_1.formatResponse)(response);
26
+ }
27
+ async function get(i) {
28
+ const sdtId = this.getNodeParameter('sdtId', i);
29
+ const response = await apiRequest_1.apiRequest.call(this, 'GET', `/sdt/sdts/${sdtId}`);
30
+ return (0, responseFormatter_1.formatResponse)(response);
31
+ }
32
+ async function create(i) {
33
+ const type = this.getNodeParameter('type', i);
34
+ const startDateTime = this.getNodeParameter('startDateTime', i);
35
+ const endDateTime = this.getNodeParameter('endDateTime', i);
36
+ const additionalFields = this.getNodeParameter('additionalFields', i, {});
37
+ // Convert ISO date strings to epoch milliseconds
38
+ const body = {
39
+ type,
40
+ startDateTime: new Date(startDateTime).getTime(),
41
+ endDateTime: new Date(endDateTime).getTime(),
42
+ };
43
+ const optionalFields = ['comment', 'sdtType', 'deviceId', 'deviceGroupId', 'collectorId', 'websiteId', 'timezone'];
44
+ for (const field of optionalFields) {
45
+ if (additionalFields[field] !== undefined && additionalFields[field] !== '' && additionalFields[field] !== 0) {
46
+ body[field] = additionalFields[field];
47
+ }
48
+ }
49
+ const response = await apiRequest_1.apiRequest.call(this, 'POST', '/sdt/sdts', body);
50
+ return (0, responseFormatter_1.formatResponse)(response);
51
+ }
52
+ async function update(i) {
53
+ const sdtId = this.getNodeParameter('sdtId', i);
54
+ const updateFields = this.getNodeParameter('updateFields', i, {});
55
+ const body = {};
56
+ if (updateFields.comment)
57
+ body.comment = updateFields.comment;
58
+ if (updateFields.timezone)
59
+ body.timezone = updateFields.timezone;
60
+ if (updateFields.startDateTime)
61
+ body.startDateTime = new Date(updateFields.startDateTime).getTime();
62
+ if (updateFields.endDateTime)
63
+ body.endDateTime = new Date(updateFields.endDateTime).getTime();
64
+ const response = await apiRequest_1.apiRequest.call(this, 'PUT', `/sdt/sdts/${sdtId}`, body);
65
+ return (0, responseFormatter_1.formatResponse)(response);
66
+ }
67
+ async function deleteSdt(i) {
68
+ const sdtId = this.getNodeParameter('sdtId', i);
69
+ await apiRequest_1.apiRequest.call(this, 'DELETE', `/sdt/sdts/${sdtId}`);
70
+ return [{ json: { success: true, id: sdtId } }];
71
+ }
72
+ //# sourceMappingURL=sdts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdts.js","sourceRoot":"","sources":["../../../../nodes/LogicMonitor/methods/sdts.ts"],"names":[],"mappings":";;AAIA,0BAiBC;AAED,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