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.
- package/README.md +90 -0
- package/dist/credentials/LogicMonitorApi.credentials.d.ts +8 -0
- package/dist/credentials/LogicMonitorApi.credentials.d.ts.map +1 -0
- package/dist/credentials/LogicMonitorApi.credentials.js +38 -0
- package/dist/credentials/LogicMonitorApi.credentials.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes/LogicMonitor/LogicMonitor.node.d.ts +6 -0
- package/dist/nodes/LogicMonitor/LogicMonitor.node.d.ts.map +1 -0
- package/dist/nodes/LogicMonitor/LogicMonitor.node.js +118 -0
- package/dist/nodes/LogicMonitor/LogicMonitor.node.js.map +1 -0
- package/dist/nodes/LogicMonitor/descriptions/alerts.descriptions.d.ts +4 -0
- package/dist/nodes/LogicMonitor/descriptions/alerts.descriptions.d.ts.map +1 -0
- package/dist/nodes/LogicMonitor/descriptions/alerts.descriptions.js +157 -0
- package/dist/nodes/LogicMonitor/descriptions/alerts.descriptions.js.map +1 -0
- package/dist/nodes/LogicMonitor/descriptions/collectors.descriptions.d.ts +4 -0
- package/dist/nodes/LogicMonitor/descriptions/collectors.descriptions.d.ts.map +1 -0
- package/dist/nodes/LogicMonitor/descriptions/collectors.descriptions.js +232 -0
- package/dist/nodes/LogicMonitor/descriptions/collectors.descriptions.js.map +1 -0
- package/dist/nodes/LogicMonitor/descriptions/datasources.descriptions.d.ts +4 -0
- package/dist/nodes/LogicMonitor/descriptions/datasources.descriptions.d.ts.map +1 -0
- package/dist/nodes/LogicMonitor/descriptions/datasources.descriptions.js +214 -0
- package/dist/nodes/LogicMonitor/descriptions/datasources.descriptions.js.map +1 -0
- package/dist/nodes/LogicMonitor/descriptions/deviceGroups.descriptions.d.ts +4 -0
- package/dist/nodes/LogicMonitor/descriptions/deviceGroups.descriptions.d.ts.map +1 -0
- package/dist/nodes/LogicMonitor/descriptions/deviceGroups.descriptions.js +279 -0
- package/dist/nodes/LogicMonitor/descriptions/deviceGroups.descriptions.js.map +1 -0
- package/dist/nodes/LogicMonitor/descriptions/devices.descriptions.d.ts +4 -0
- package/dist/nodes/LogicMonitor/descriptions/devices.descriptions.d.ts.map +1 -0
- package/dist/nodes/LogicMonitor/descriptions/devices.descriptions.js +307 -0
- package/dist/nodes/LogicMonitor/descriptions/devices.descriptions.js.map +1 -0
- package/dist/nodes/LogicMonitor/descriptions/sdts.descriptions.d.ts +4 -0
- package/dist/nodes/LogicMonitor/descriptions/sdts.descriptions.d.ts.map +1 -0
- package/dist/nodes/LogicMonitor/descriptions/sdts.descriptions.js +260 -0
- package/dist/nodes/LogicMonitor/descriptions/sdts.descriptions.js.map +1 -0
- package/dist/nodes/LogicMonitor/helpers/apiRequest.d.ts +4 -0
- package/dist/nodes/LogicMonitor/helpers/apiRequest.d.ts.map +1 -0
- package/dist/nodes/LogicMonitor/helpers/apiRequest.js +115 -0
- package/dist/nodes/LogicMonitor/helpers/apiRequest.js.map +1 -0
- package/dist/nodes/LogicMonitor/helpers/errorHandler.d.ts +2 -0
- package/dist/nodes/LogicMonitor/helpers/errorHandler.d.ts.map +1 -0
- package/dist/nodes/LogicMonitor/helpers/errorHandler.js +29 -0
- package/dist/nodes/LogicMonitor/helpers/errorHandler.js.map +1 -0
- package/dist/nodes/LogicMonitor/helpers/executeOperation.d.ts +3 -0
- package/dist/nodes/LogicMonitor/helpers/executeOperation.d.ts.map +1 -0
- package/dist/nodes/LogicMonitor/helpers/executeOperation.js +99 -0
- package/dist/nodes/LogicMonitor/helpers/executeOperation.js.map +1 -0
- package/dist/nodes/LogicMonitor/helpers/responseFormatter.d.ts +3 -0
- package/dist/nodes/LogicMonitor/helpers/responseFormatter.d.ts.map +1 -0
- package/dist/nodes/LogicMonitor/helpers/responseFormatter.js +19 -0
- package/dist/nodes/LogicMonitor/helpers/responseFormatter.js.map +1 -0
- package/dist/nodes/LogicMonitor/logicmonitor.svg +1 -0
- package/dist/nodes/LogicMonitor/methods/alerts.d.ts +7 -0
- package/dist/nodes/LogicMonitor/methods/alerts.d.ts.map +1 -0
- package/dist/nodes/LogicMonitor/methods/alerts.js +53 -0
- package/dist/nodes/LogicMonitor/methods/alerts.js.map +1 -0
- package/dist/nodes/LogicMonitor/methods/collectors.d.ts +9 -0
- package/dist/nodes/LogicMonitor/methods/collectors.d.ts.map +1 -0
- package/dist/nodes/LogicMonitor/methods/collectors.js +95 -0
- package/dist/nodes/LogicMonitor/methods/collectors.js.map +1 -0
- package/dist/nodes/LogicMonitor/methods/datasources.d.ts +6 -0
- package/dist/nodes/LogicMonitor/methods/datasources.d.ts.map +1 -0
- package/dist/nodes/LogicMonitor/methods/datasources.js +62 -0
- package/dist/nodes/LogicMonitor/methods/datasources.js.map +1 -0
- package/dist/nodes/LogicMonitor/methods/deviceGroups.d.ts +7 -0
- package/dist/nodes/LogicMonitor/methods/deviceGroups.d.ts.map +1 -0
- package/dist/nodes/LogicMonitor/methods/deviceGroups.js +81 -0
- package/dist/nodes/LogicMonitor/methods/deviceGroups.js.map +1 -0
- package/dist/nodes/LogicMonitor/methods/devices.d.ts +7 -0
- package/dist/nodes/LogicMonitor/methods/devices.d.ts.map +1 -0
- package/dist/nodes/LogicMonitor/methods/devices.js +94 -0
- package/dist/nodes/LogicMonitor/methods/devices.js.map +1 -0
- package/dist/nodes/LogicMonitor/methods/sdts.d.ts +7 -0
- package/dist/nodes/LogicMonitor/methods/sdts.d.ts.map +1 -0
- package/dist/nodes/LogicMonitor/methods/sdts.js +72 -0
- package/dist/nodes/LogicMonitor/methods/sdts.js.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sdtFields = exports.sdtOperations = void 0;
|
|
4
|
+
exports.sdtOperations = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: {
|
|
12
|
+
resource: ['sdt'],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
options: [
|
|
16
|
+
{
|
|
17
|
+
name: 'Create',
|
|
18
|
+
value: 'create',
|
|
19
|
+
description: 'Create a scheduled downtime',
|
|
20
|
+
action: 'Create an SDT',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'Delete',
|
|
24
|
+
value: 'delete',
|
|
25
|
+
description: 'Delete a scheduled downtime',
|
|
26
|
+
action: 'Delete an SDT',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'Get',
|
|
30
|
+
value: 'get',
|
|
31
|
+
description: 'Get a scheduled downtime by ID',
|
|
32
|
+
action: 'Get an SDT',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'Get Many',
|
|
36
|
+
value: 'getMany',
|
|
37
|
+
description: 'Get a list of scheduled downtimes',
|
|
38
|
+
action: 'Get many SDTs',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'Update',
|
|
42
|
+
value: 'update',
|
|
43
|
+
description: 'Update a scheduled downtime',
|
|
44
|
+
action: 'Update an SDT',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
default: 'getMany',
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
exports.sdtFields = [
|
|
51
|
+
// ─── GET MANY ───────────────────────────────────────────────────────────────
|
|
52
|
+
{
|
|
53
|
+
displayName: 'Return All',
|
|
54
|
+
name: 'returnAll',
|
|
55
|
+
type: 'boolean',
|
|
56
|
+
default: false,
|
|
57
|
+
description: 'Whether to return all results or only up to a given limit',
|
|
58
|
+
displayOptions: {
|
|
59
|
+
show: { resource: ['sdt'], operation: ['getMany'] },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
displayName: 'Limit',
|
|
64
|
+
name: 'limit',
|
|
65
|
+
type: 'number',
|
|
66
|
+
default: 50,
|
|
67
|
+
typeOptions: { minValue: 1, maxValue: 1000 },
|
|
68
|
+
description: 'Max number of results to return',
|
|
69
|
+
displayOptions: {
|
|
70
|
+
show: { resource: ['sdt'], operation: ['getMany'], returnAll: [false] },
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
displayName: 'Additional Fields',
|
|
75
|
+
name: 'additionalFields',
|
|
76
|
+
type: 'collection',
|
|
77
|
+
placeholder: 'Add Field',
|
|
78
|
+
default: {},
|
|
79
|
+
displayOptions: {
|
|
80
|
+
show: { resource: ['sdt'], operation: ['getMany'] },
|
|
81
|
+
},
|
|
82
|
+
options: [
|
|
83
|
+
{
|
|
84
|
+
displayName: 'Fields',
|
|
85
|
+
name: 'fields',
|
|
86
|
+
type: 'string',
|
|
87
|
+
default: '',
|
|
88
|
+
description: 'Comma-separated list of fields to return',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
displayName: 'Filter',
|
|
92
|
+
name: 'filter',
|
|
93
|
+
type: 'string',
|
|
94
|
+
default: '',
|
|
95
|
+
placeholder: 'sdtType=="oneTime"',
|
|
96
|
+
description: 'RSQL filter expression',
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
// ─── GET / UPDATE / DELETE ───────────────────────────────────────────────────
|
|
101
|
+
{
|
|
102
|
+
displayName: 'SDT ID',
|
|
103
|
+
name: 'sdtId',
|
|
104
|
+
type: 'string',
|
|
105
|
+
default: '',
|
|
106
|
+
required: true,
|
|
107
|
+
description: 'The ID of the SDT (format: XX_##)',
|
|
108
|
+
displayOptions: {
|
|
109
|
+
show: { resource: ['sdt'], operation: ['get', 'update', 'delete'] },
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
// ─── CREATE ─────────────────────────────────────────────────────────────────
|
|
113
|
+
{
|
|
114
|
+
displayName: 'SDT Type',
|
|
115
|
+
name: 'type',
|
|
116
|
+
type: 'options',
|
|
117
|
+
required: true,
|
|
118
|
+
options: [
|
|
119
|
+
{ name: 'Collector SDT', value: 'CollectorSDT' },
|
|
120
|
+
{ name: 'Device SDT', value: 'ResourceSDT' },
|
|
121
|
+
{ name: 'Device Group SDT', value: 'ResourceGroupSDT' },
|
|
122
|
+
{ name: 'Device DataSource SDT', value: 'DeviceDataSourceSDT' },
|
|
123
|
+
{ name: 'Device DataSource Instance SDT', value: 'DeviceDataSourceInstanceSDT' },
|
|
124
|
+
{ name: 'Website SDT', value: 'WebsiteSDT' },
|
|
125
|
+
{ name: 'Website Group SDT', value: 'WebsiteGroupSDT' },
|
|
126
|
+
],
|
|
127
|
+
default: 'ResourceSDT',
|
|
128
|
+
description: 'The type of resource to put in SDT',
|
|
129
|
+
displayOptions: {
|
|
130
|
+
show: { resource: ['sdt'], operation: ['create'] },
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
displayName: 'Start Date/Time',
|
|
135
|
+
name: 'startDateTime',
|
|
136
|
+
type: 'dateTime',
|
|
137
|
+
default: '',
|
|
138
|
+
required: true,
|
|
139
|
+
description: 'The start date and time of the SDT',
|
|
140
|
+
displayOptions: {
|
|
141
|
+
show: { resource: ['sdt'], operation: ['create'] },
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
displayName: 'End Date/Time',
|
|
146
|
+
name: 'endDateTime',
|
|
147
|
+
type: 'dateTime',
|
|
148
|
+
default: '',
|
|
149
|
+
required: true,
|
|
150
|
+
description: 'The end date and time of the SDT',
|
|
151
|
+
displayOptions: {
|
|
152
|
+
show: { resource: ['sdt'], operation: ['create'] },
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
displayName: 'Additional Fields',
|
|
157
|
+
name: 'additionalFields',
|
|
158
|
+
type: 'collection',
|
|
159
|
+
placeholder: 'Add Field',
|
|
160
|
+
default: {},
|
|
161
|
+
displayOptions: {
|
|
162
|
+
show: { resource: ['sdt'], operation: ['create'] },
|
|
163
|
+
},
|
|
164
|
+
options: [
|
|
165
|
+
{
|
|
166
|
+
displayName: 'Comment',
|
|
167
|
+
name: 'comment',
|
|
168
|
+
type: 'string',
|
|
169
|
+
default: '',
|
|
170
|
+
description: 'A comment or reason for the SDT',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
displayName: 'SDT Schedule Type',
|
|
174
|
+
name: 'sdtType',
|
|
175
|
+
type: 'options',
|
|
176
|
+
options: [
|
|
177
|
+
{ name: 'One Time', value: 'oneTime' },
|
|
178
|
+
{ name: 'Weekly', value: 'weekly' },
|
|
179
|
+
{ name: 'Monthly', value: 'monthly' },
|
|
180
|
+
{ name: 'Daily', value: 'daily' },
|
|
181
|
+
],
|
|
182
|
+
default: 'oneTime',
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
displayName: 'Device ID',
|
|
186
|
+
name: 'deviceId',
|
|
187
|
+
type: 'number',
|
|
188
|
+
default: 0,
|
|
189
|
+
description: 'Device ID (for ResourceSDT or DeviceDataSourceSDT)',
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
displayName: 'Device Group ID',
|
|
193
|
+
name: 'deviceGroupId',
|
|
194
|
+
type: 'number',
|
|
195
|
+
default: 0,
|
|
196
|
+
description: 'Device group ID (for ResourceGroupSDT)',
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
displayName: 'Collector ID',
|
|
200
|
+
name: 'collectorId',
|
|
201
|
+
type: 'number',
|
|
202
|
+
default: 0,
|
|
203
|
+
description: 'Collector ID (for CollectorSDT)',
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
displayName: 'Website ID',
|
|
207
|
+
name: 'websiteId',
|
|
208
|
+
type: 'number',
|
|
209
|
+
default: 0,
|
|
210
|
+
description: 'Website ID (for WebsiteSDT)',
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
displayName: 'Timezone',
|
|
214
|
+
name: 'timezone',
|
|
215
|
+
type: 'string',
|
|
216
|
+
default: '',
|
|
217
|
+
placeholder: 'America/Los_Angeles',
|
|
218
|
+
description: 'Timezone for the SDT (e.g. America/Los_Angeles)',
|
|
219
|
+
},
|
|
220
|
+
],
|
|
221
|
+
},
|
|
222
|
+
// ─── UPDATE ─────────────────────────────────────────────────────────────────
|
|
223
|
+
{
|
|
224
|
+
displayName: 'Update Fields',
|
|
225
|
+
name: 'updateFields',
|
|
226
|
+
type: 'collection',
|
|
227
|
+
placeholder: 'Add Field',
|
|
228
|
+
default: {},
|
|
229
|
+
displayOptions: {
|
|
230
|
+
show: { resource: ['sdt'], operation: ['update'] },
|
|
231
|
+
},
|
|
232
|
+
options: [
|
|
233
|
+
{
|
|
234
|
+
displayName: 'Comment',
|
|
235
|
+
name: 'comment',
|
|
236
|
+
type: 'string',
|
|
237
|
+
default: '',
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
displayName: 'Start Date/Time',
|
|
241
|
+
name: 'startDateTime',
|
|
242
|
+
type: 'dateTime',
|
|
243
|
+
default: '',
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
displayName: 'End Date/Time',
|
|
247
|
+
name: 'endDateTime',
|
|
248
|
+
type: 'dateTime',
|
|
249
|
+
default: '',
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
displayName: 'Timezone',
|
|
253
|
+
name: 'timezone',
|
|
254
|
+
type: 'string',
|
|
255
|
+
default: '',
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
},
|
|
259
|
+
];
|
|
260
|
+
//# sourceMappingURL=sdts.descriptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdts.descriptions.js","sourceRoot":"","sources":["../../../../nodes/LogicMonitor/descriptions/sdts.descriptions.ts"],"names":[],"mappings":";;;AAEa,QAAA,aAAa,GAAsB;IAC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AAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,CAAC;gBACV,WAAW,EAAE,6BAA6B;aAC1C;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,qBAAqB;gBAClC,WAAW,EAAE,iDAAiD;aAC9D;SACD;KACD;IAED,+EAA+E;IAC/E;QACC,WAAW,EAAE,eAAe;QAC5B,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,WAAW;QACxB,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACf,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE;SAClD;QACD,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,iBAAiB;gBAC9B,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,eAAe;gBAC5B,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;SACD;KACD;CACD,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions, IDataObject } from 'n8n-workflow';
|
|
2
|
+
export declare function apiRequest(this: IExecuteFunctions | IHookFunctions | ILoadOptionsFunctions, method: string, endpoint: string, body?: IDataObject, query?: IDataObject): Promise<any>;
|
|
3
|
+
export declare function apiRequestAllItems(this: IExecuteFunctions | ILoadOptionsFunctions, method: string, endpoint: string, body?: IDataObject, query?: IDataObject): Promise<any[]>;
|
|
4
|
+
//# sourceMappingURL=apiRequest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiRequest.d.ts","sourceRoot":"","sources":["../../../../nodes/LogicMonitor/helpers/apiRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,MAAM,cAAc,CAAC;AA6BtB,wBAAsB,UAAU,CAC/B,IAAI,EAAE,iBAAiB,GAAG,cAAc,GAAG,qBAAqB,EAChE,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,WAAgB,EACtB,KAAK,GAAE,WAAgB,GACrB,OAAO,CAAC,GAAG,CAAC,CAoDd;AAED,wBAAsB,kBAAkB,CACvC,IAAI,EAAE,iBAAiB,GAAG,qBAAqB,EAC/C,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,WAAgB,EACtB,KAAK,GAAE,WAAgB,GACrB,OAAO,CAAC,GAAG,EAAE,CAAC,CA0BhB"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.apiRequest = apiRequest;
|
|
37
|
+
exports.apiRequestAllItems = apiRequestAllItems;
|
|
38
|
+
const crypto = __importStar(require("crypto"));
|
|
39
|
+
const errorHandler_1 = require("./errorHandler");
|
|
40
|
+
/**
|
|
41
|
+
* Generate LMv1 Authorization header.
|
|
42
|
+
*
|
|
43
|
+
* Format: LMv1 <accessId>:<signature>:<epoch>
|
|
44
|
+
* Signature: base64(HmacSHA256(<method>\n<requestBody>\n<epoch>\n<resourcePath>, accessKey))
|
|
45
|
+
*/
|
|
46
|
+
function generateLMv1Header(method, resourcePath, body, accessId, accessKey) {
|
|
47
|
+
const timestamp = Date.now();
|
|
48
|
+
const requestVars = `${method.toUpperCase()}\n${body}\n${timestamp}\n${resourcePath}`;
|
|
49
|
+
const signature = crypto
|
|
50
|
+
.createHmac('sha256', accessKey)
|
|
51
|
+
.update(requestVars)
|
|
52
|
+
.digest('base64');
|
|
53
|
+
return {
|
|
54
|
+
authorization: `LMv1 ${accessId}:${signature}:${timestamp}`,
|
|
55
|
+
timestamp,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
async function apiRequest(method, endpoint, body = {}, query = {}) {
|
|
59
|
+
const credentials = await this.getCredentials('logicMonitorApi');
|
|
60
|
+
const company = credentials.company;
|
|
61
|
+
const accessId = credentials.accessId;
|
|
62
|
+
const accessKey = credentials.accessKey;
|
|
63
|
+
const baseUrl = `https://${company}.logicmonitor.com/santaba/rest`;
|
|
64
|
+
// The resource path for LMv1 signing is just the path portion (no domain)
|
|
65
|
+
const resourcePath = `/santaba/rest${endpoint}`;
|
|
66
|
+
const bodyString = Object.keys(body).length > 0 ? JSON.stringify(body) : '';
|
|
67
|
+
const { authorization } = generateLMv1Header(method, resourcePath, bodyString, accessId, accessKey);
|
|
68
|
+
// Build query string
|
|
69
|
+
const queryParams = new URLSearchParams();
|
|
70
|
+
for (const [key, value] of Object.entries(query)) {
|
|
71
|
+
if (value !== undefined && value !== null && value !== '') {
|
|
72
|
+
queryParams.append(key, String(value));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const queryString = queryParams.toString();
|
|
76
|
+
const url = `${baseUrl}${endpoint}${queryString ? `?${queryString}` : ''}`;
|
|
77
|
+
const options = {
|
|
78
|
+
method: method.toUpperCase(),
|
|
79
|
+
url,
|
|
80
|
+
headers: {
|
|
81
|
+
Authorization: authorization,
|
|
82
|
+
'Content-Type': 'application/json',
|
|
83
|
+
Accept: 'application/json',
|
|
84
|
+
},
|
|
85
|
+
json: true,
|
|
86
|
+
};
|
|
87
|
+
if (bodyString) {
|
|
88
|
+
options.body = body;
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
const response = await this.helpers.request(options);
|
|
92
|
+
return response;
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
throw (0, errorHandler_1.handleApiError)(error, endpoint);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
async function apiRequestAllItems(method, endpoint, body = {}, query = {}) {
|
|
99
|
+
const returnData = [];
|
|
100
|
+
let offset = 0;
|
|
101
|
+
const size = 1000;
|
|
102
|
+
let total = Infinity;
|
|
103
|
+
while (offset < total) {
|
|
104
|
+
const response = await apiRequest.call(this, method, endpoint, body, { ...query, size, offset });
|
|
105
|
+
const items = response?.items ?? response?.results ?? [];
|
|
106
|
+
returnData.push(...items);
|
|
107
|
+
total = response?.total ?? returnData.length;
|
|
108
|
+
offset += items.length;
|
|
109
|
+
// Break if no items returned to prevent infinite loop
|
|
110
|
+
if (items.length === 0)
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
return returnData;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=apiRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiRequest.js","sourceRoot":"","sources":["../../../../nodes/LogicMonitor/helpers/apiRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,gCA0DC;AAED,gDAgCC;AAxHD,+CAAiC;AACjC,iDAAgD;AAEhD;;;;;GAKG;AACH,SAAS,kBAAkB,CAC1B,MAAc,EACd,YAAoB,EACpB,IAAY,EACZ,QAAgB,EAChB,SAAiB;IAEjB,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC7B,MAAM,WAAW,GAAG,GAAG,MAAM,CAAC,WAAW,EAAE,KAAK,IAAI,KAAK,SAAS,KAAK,YAAY,EAAE,CAAC;IACtF,MAAM,SAAS,GAAG,MAAM;SACtB,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC;SAC/B,MAAM,CAAC,WAAW,CAAC;SACnB,MAAM,CAAC,QAAQ,CAAC,CAAC;IACnB,OAAO;QACN,aAAa,EAAE,QAAQ,QAAQ,IAAI,SAAS,IAAI,SAAS,EAAE;QAC3D,SAAS;KACT,CAAC;AAC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CAAC,MAAM,CAAC;QAC7C,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC;QAEvB,sDAAsD;QACtD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,MAAM;IAC/B,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorHandler.d.ts","sourceRoot":"","sources":["../../../../nodes/LogicMonitor/helpers/errorHandler.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,KAAK,CA+BlE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleApiError = handleApiError;
|
|
4
|
+
function handleApiError(error, endpoint) {
|
|
5
|
+
if (error.response) {
|
|
6
|
+
const status = error.response.statusCode || error.statusCode;
|
|
7
|
+
const body = error.response.body || error.error || {};
|
|
8
|
+
if (typeof body === 'object' && body !== null) {
|
|
9
|
+
const errCode = body.errorCode ?? body.code;
|
|
10
|
+
const errMsg = body.errorMessage ?? body.message ?? body.errmsg ?? JSON.stringify(body);
|
|
11
|
+
return new Error(`LogicMonitor API error [${status}] (code ${errCode}) on ${endpoint}: ${errMsg}`);
|
|
12
|
+
}
|
|
13
|
+
if (typeof body === 'string') {
|
|
14
|
+
return new Error(`LogicMonitor API error [${status}] on ${endpoint}: ${body}`);
|
|
15
|
+
}
|
|
16
|
+
return new Error(`LogicMonitor API error [${status}] on ${endpoint}`);
|
|
17
|
+
}
|
|
18
|
+
if (error.code === 'ECONNREFUSED') {
|
|
19
|
+
return new Error('Connection refused. Check your LogicMonitor company name and network connectivity.');
|
|
20
|
+
}
|
|
21
|
+
if (error.code === 'ENOTFOUND') {
|
|
22
|
+
return new Error('Host not found. Check your LogicMonitor company name in credentials.');
|
|
23
|
+
}
|
|
24
|
+
if (error.message) {
|
|
25
|
+
return new Error(`LogicMonitor API error on ${endpoint}: ${error.message}`);
|
|
26
|
+
}
|
|
27
|
+
return new Error(`LogicMonitor API error on ${endpoint}: ${String(error)}`);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=errorHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorHandler.js","sourceRoot":"","sources":["../../../../nodes/LogicMonitor/helpers/errorHandler.ts"],"names":[],"mappings":";;AAAA,wCA+BC;AA/BD,SAAgB,cAAc,CAAC,KAAU,EAAE,QAAgB;IAC1D,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACpB,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,UAAU,IAAI,KAAK,CAAC,UAAU,CAAC;QAC7D,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,IAAI,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;QAEtD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC;YAC5C,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YACxF,OAAO,IAAI,KAAK,CAAC,2BAA2B,MAAM,WAAW,OAAO,QAAQ,QAAQ,KAAK,MAAM,EAAE,CAAC,CAAC;QACpG,CAAC;QAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,IAAI,KAAK,CAAC,2BAA2B,MAAM,QAAQ,QAAQ,KAAK,IAAI,EAAE,CAAC,CAAC;QAChF,CAAC;QAED,OAAO,IAAI,KAAK,CAAC,2BAA2B,MAAM,QAAQ,QAAQ,EAAE,CAAC,CAAC;IACvE,CAAC;IAED,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;QACnC,OAAO,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAAC;IACxG,CAAC;IAED,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAChC,OAAO,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;IAC1F,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,IAAI,KAAK,CAAC,6BAA6B,QAAQ,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED,OAAO,IAAI,KAAK,CAAC,6BAA6B,QAAQ,KAAK,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAC7E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executeOperation.d.ts","sourceRoot":"","sources":["../../../../nodes/LogicMonitor/helpers/executeOperation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAyDrE,wBAAsB,gBAAgB,CACrC,IAAI,EAAE,iBAAiB,EACvB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,CAAC,EAAE,MAAM,GACP,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAY/B"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.executeOperation = executeOperation;
|
|
37
|
+
const devices = __importStar(require("../methods/devices"));
|
|
38
|
+
const deviceGroups = __importStar(require("../methods/deviceGroups"));
|
|
39
|
+
const alerts = __importStar(require("../methods/alerts"));
|
|
40
|
+
const sdts = __importStar(require("../methods/sdts"));
|
|
41
|
+
const collectors = __importStar(require("../methods/collectors"));
|
|
42
|
+
const datasources = __importStar(require("../methods/datasources"));
|
|
43
|
+
const handlers = {
|
|
44
|
+
device: {
|
|
45
|
+
getMany: devices.getMany,
|
|
46
|
+
get: devices.get,
|
|
47
|
+
create: devices.create,
|
|
48
|
+
update: devices.update,
|
|
49
|
+
delete: devices.deleteDevice,
|
|
50
|
+
},
|
|
51
|
+
deviceGroup: {
|
|
52
|
+
getMany: deviceGroups.getMany,
|
|
53
|
+
get: deviceGroups.get,
|
|
54
|
+
create: deviceGroups.create,
|
|
55
|
+
update: deviceGroups.update,
|
|
56
|
+
delete: deviceGroups.deleteGroup,
|
|
57
|
+
},
|
|
58
|
+
alert: {
|
|
59
|
+
getMany: alerts.getMany,
|
|
60
|
+
get: alerts.get,
|
|
61
|
+
acknowledge: alerts.acknowledge,
|
|
62
|
+
escalate: alerts.escalate,
|
|
63
|
+
addNote: alerts.addNote,
|
|
64
|
+
},
|
|
65
|
+
sdt: {
|
|
66
|
+
getMany: sdts.getMany,
|
|
67
|
+
get: sdts.get,
|
|
68
|
+
create: sdts.create,
|
|
69
|
+
update: sdts.update,
|
|
70
|
+
delete: sdts.deleteSdt,
|
|
71
|
+
},
|
|
72
|
+
collector: {
|
|
73
|
+
getMany: collectors.getMany,
|
|
74
|
+
get: collectors.get,
|
|
75
|
+
create: collectors.create,
|
|
76
|
+
update: collectors.update,
|
|
77
|
+
delete: collectors.deleteCollector,
|
|
78
|
+
getVersions: collectors.getVersions,
|
|
79
|
+
acknowledgeDown: collectors.acknowledgeDown,
|
|
80
|
+
},
|
|
81
|
+
datasource: {
|
|
82
|
+
getMany: datasources.getMany,
|
|
83
|
+
get: datasources.get,
|
|
84
|
+
update: datasources.update,
|
|
85
|
+
delete: datasources.deleteDatasource,
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
async function executeOperation(resource, operation, i) {
|
|
89
|
+
const resourceHandlers = handlers[resource];
|
|
90
|
+
if (!resourceHandlers) {
|
|
91
|
+
throw new Error(`Unknown resource: "${resource}"`);
|
|
92
|
+
}
|
|
93
|
+
const handler = resourceHandlers[operation];
|
|
94
|
+
if (!handler) {
|
|
95
|
+
throw new Error(`Unknown operation "${operation}" for resource "${resource}"`);
|
|
96
|
+
}
|
|
97
|
+
return handler.call(this, i);
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=executeOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executeOperation.js","sourceRoot":"","sources":["../../../../nodes/LogicMonitor/helpers/executeOperation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,4CAiBC;AAxED,4DAA8C;AAC9C,sEAAwD;AACxD,0DAA4C;AAC5C,sDAAwC;AACxC,kEAAoD;AACpD,oEAAsD;AAItD,MAAM,QAAQ,GAAqD;IAClE,MAAM,EAAE;QACP,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,OAAO,CAAC,YAAY;KAC5B;IACD,WAAW,EAAE;QACZ,OAAO,EAAE,YAAY,CAAC,OAAO;QAC7B,GAAG,EAAE,YAAY,CAAC,GAAG;QACrB,MAAM,EAAE,YAAY,CAAC,MAAM;QAC3B,MAAM,EAAE,YAAY,CAAC,MAAM;QAC3B,MAAM,EAAE,YAAY,CAAC,WAAW;KAChC;IACD,KAAK,EAAE;QACN,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,OAAO,EAAE,MAAM,CAAC,OAAO;KACvB;IACD,GAAG,EAAE;QACJ,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,MAAM,EAAE,IAAI,CAAC,SAAS;KACtB;IACD,SAAS,EAAE;QACV,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,GAAG,EAAE,UAAU,CAAC,GAAG;QACnB,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,MAAM,EAAE,UAAU,CAAC,eAAe;QAClC,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,eAAe,EAAE,UAAU,CAAC,eAAe;KAC3C;IACD,UAAU,EAAE;QACX,OAAO,EAAE,WAAW,CAAC,OAAO;QAC5B,GAAG,EAAE,WAAW,CAAC,GAAG;QACpB,MAAM,EAAE,WAAW,CAAC,MAAM;QAC1B,MAAM,EAAE,WAAW,CAAC,gBAAgB;KACpC;CACD,CAAC;AAEK,KAAK,UAAU,gBAAgB,CAErC,QAAgB,EAChB,SAAiB,EACjB,CAAS;IAET,MAAM,gBAAgB,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC5C,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,sBAAsB,QAAQ,GAAG,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,OAAO,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAC5C,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,sBAAsB,SAAS,mBAAmB,QAAQ,GAAG,CAAC,CAAC;IAChF,CAAC;IAED,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responseFormatter.d.ts","sourceRoot":"","sources":["../../../../nodes/LogicMonitor/helpers/responseFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,GAAG,GAAG,kBAAkB,EAAE,CAiBlE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatResponse = formatResponse;
|
|
4
|
+
function formatResponse(response) {
|
|
5
|
+
if (!response) {
|
|
6
|
+
return [{ json: {} }];
|
|
7
|
+
}
|
|
8
|
+
// Paginated list response: { items: [...], total: N, ... }
|
|
9
|
+
if (response.items && Array.isArray(response.items)) {
|
|
10
|
+
return response.items.map((item) => ({ json: item }));
|
|
11
|
+
}
|
|
12
|
+
// Array response
|
|
13
|
+
if (Array.isArray(response)) {
|
|
14
|
+
return response.map((item) => ({ json: item }));
|
|
15
|
+
}
|
|
16
|
+
// Single object response
|
|
17
|
+
return [{ json: response }];
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=responseFormatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responseFormatter.js","sourceRoot":"","sources":["../../../../nodes/LogicMonitor/helpers/responseFormatter.ts"],"names":[],"mappings":";;AAEA,wCAiBC;AAjBD,SAAgB,cAAc,CAAC,QAAa;IAC3C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACf,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IACvB,CAAC;IAED,2DAA2D;IAC3D,IAAI,QAAQ,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACrD,OAAO,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC5D,CAAC;IAED,iBAAiB;IACjB,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,yBAAyB;IACzB,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64"><path d="M64 52.8C64 59 59 64 52.8 64H11.2C5 64 0 59 0 52.8V11.2C0 5 5 0 11.2 0h41.6C59 0 64 5 64 11.2z" fill="#4275fa"/><path d="M42.94 46.188l4.228-14.72c.044-.2.133-.2.2 0l3.12 11a.5.5 0 0 0 .465.354h4.803a.35.35 0 0 0 .354-.354l-.73-2.9a.35.35 0 0 0-.354-.354h-1.35c-.2 0-.398-.155-.465-.354l-4.14-14.54a.5.5 0 0 0-.465-.354l-2.767.376c-.2 0-.398.155-.465.354L41.28 39.06c-.044.2-.133.2-.177 0l-5.38-21.56a.47.47 0 0 0-.443-.354l-2.8.376c-.2 0-.398.155-.443.354l-5.3 20.962c-.044.2-.354.354-.553.354h-1.13a.35.35 0 0 0-.354.354l-.73 2.9a.35.35 0 0 0 .354.354h4.78c.2 0 .398-.155.443-.354l4.206-16.778c.044-.2.133-.2.177 0l5.3 20.83a.47.47 0 0 0 .443.354l2.767-.332c.22.022.443-.133.487-.332m-31.57-28.133l-3.1.354c-.22 0-.376.155-.376.354v22.644c0 .797.642 1.44 1.44 1.44h11.4a.35.35 0 0 0 .354-.354v-2.8a.35.35 0 0 0-.354-.354h-8.28a.74.74 0 0 1-.73-.73V18.4a.35.35 0 0 0-.354-.354" fill="#fff"/></svg>
|
|
@@ -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 acknowledge(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
|
|
5
|
+
export declare function escalate(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
|
|
6
|
+
export declare function addNote(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
|
|
7
|
+
//# sourceMappingURL=alerts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alerts.d.ts","sourceRoot":"","sources":["../../../../nodes/LogicMonitor/methods/alerts.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,CAS3F;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAMnG;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAKhG;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAM/F"}
|