@lbono/n8n-nodes-npaw 2.0.1 → 2.0.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.
@@ -0,0 +1,5 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class NpawTool implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
@@ -0,0 +1,189 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NpawTool = void 0;
4
+ const GenericFunctions_1 = require("./GenericFunctions");
5
+ class NpawTool {
6
+ constructor() {
7
+ this.description = {
8
+ displayName: 'NPAW Analytics Tool',
9
+ name: 'npawTool',
10
+ icon: 'file:npaw.svg',
11
+ group: ['transform'],
12
+ version: 1,
13
+ description: 'Query NPAW/Youbora analytics data - optimized for AI agents to retrieve video analytics metrics, events, and alerts',
14
+ defaults: {
15
+ name: 'NPAW Analytics',
16
+ },
17
+ codex: {
18
+ categories: ['AI'],
19
+ subcategories: {
20
+ AI: ['Tools'],
21
+ },
22
+ resources: {
23
+ primaryDocumentation: [
24
+ {
25
+ url: 'https://documentation.npaw.com/',
26
+ },
27
+ ],
28
+ },
29
+ },
30
+ inputs: ['main'],
31
+ outputs: ['main'],
32
+ credentials: [
33
+ {
34
+ name: 'npawApi',
35
+ required: true,
36
+ },
37
+ ],
38
+ properties: [
39
+ {
40
+ displayName: 'Query Type',
41
+ name: 'queryType',
42
+ type: 'options',
43
+ noDataExpression: true,
44
+ options: [
45
+ {
46
+ name: 'Get Analytics Data',
47
+ value: 'data',
48
+ description: 'Retrieve aggregated analytics metrics (views, hours, users, buffer ratio, etc.)',
49
+ },
50
+ {
51
+ name: 'Get Raw Events',
52
+ value: 'events',
53
+ description: 'Retrieve raw event data for detailed session analysis',
54
+ },
55
+ {
56
+ name: 'Get Alerts',
57
+ value: 'alerts',
58
+ description: 'Retrieve system alerts and notifications',
59
+ },
60
+ ],
61
+ default: 'data',
62
+ description: 'Type of data to retrieve from NPAW/Youbora platform',
63
+ },
64
+ {
65
+ displayName: 'Time Period',
66
+ name: 'fromDate',
67
+ type: 'string',
68
+ default: 'last24hours',
69
+ options: [
70
+ { name: 'Last Hour', value: 'lasthour' },
71
+ { name: 'Last 6 Hours', value: 'last6hours' },
72
+ { name: 'Last 24 Hours', value: 'last24hours' },
73
+ { name: 'Last 7 Days', value: 'last7days' },
74
+ { name: 'Last 30 Days', value: 'last30days' },
75
+ { name: 'Today', value: 'today' },
76
+ { name: 'Yesterday', value: 'yesterday' },
77
+ { name: 'This Week', value: 'thisweek' },
78
+ { name: 'This Month', value: 'thismonth' },
79
+ ],
80
+ placeholder: 'YYYY-MM-DD or YYYY-MM-DD HH:mm:ss',
81
+ description: 'Time period for data retrieval. Use presets or enter custom date',
82
+ },
83
+ {
84
+ displayName: 'Metrics',
85
+ name: 'metrics',
86
+ type: 'string',
87
+ displayOptions: {
88
+ show: {
89
+ queryType: ['data'],
90
+ },
91
+ },
92
+ default: 'views,hours,uniques',
93
+ placeholder: 'views,hours,uniques,bufferRatio',
94
+ description: 'Comma-separated metrics to retrieve. Common: views, hours, uniques, joinTime, bufferRatio, throughput, errors',
95
+ },
96
+ {
97
+ displayName: 'Granularity',
98
+ name: 'granularity',
99
+ type: 'options',
100
+ displayOptions: {
101
+ show: {
102
+ queryType: ['data'],
103
+ },
104
+ },
105
+ options: [
106
+ { name: 'Minute', value: 'minute' },
107
+ { name: 'Hour', value: 'hour' },
108
+ { name: 'Day', value: 'day' },
109
+ { name: 'Week', value: 'week' },
110
+ { name: 'Month', value: 'month' },
111
+ ],
112
+ default: 'hour',
113
+ description: 'Time granularity for data aggregation',
114
+ },
115
+ {
116
+ displayName: 'Group By',
117
+ name: 'groupBy',
118
+ type: 'string',
119
+ displayOptions: {
120
+ show: {
121
+ queryType: ['data'],
122
+ },
123
+ },
124
+ default: '',
125
+ placeholder: 'country,device_type,browser',
126
+ description: 'Dimensions to group by. Common: country, device_type, browser, cdn, os, title',
127
+ },
128
+ {
129
+ displayName: 'Filter (JSON)',
130
+ name: 'filter',
131
+ type: 'string',
132
+ default: '',
133
+ placeholder: '[{"name":"Spain Users","rules":{"country":["Spain"]}}]',
134
+ description: 'JSON filter to narrow results. Example: [{"name":"Filter Name","rules":{"country":["Spain"],"device_type":["PC"]}}]',
135
+ },
136
+ {
137
+ displayName: 'Limit',
138
+ name: 'limit',
139
+ type: 'number',
140
+ displayOptions: {
141
+ show: {
142
+ queryType: ['events', 'alerts'],
143
+ },
144
+ },
145
+ default: 10,
146
+ description: 'Maximum number of results to return (max 500 for events/alerts)',
147
+ },
148
+ ],
149
+ };
150
+ }
151
+ async execute() {
152
+ const items = this.getInputData();
153
+ const returnData = [];
154
+ const credentials = await this.getCredentials('npawApi');
155
+ for (let i = 0; i < items.length; i++) {
156
+ const queryType = this.getNodeParameter('queryType', i);
157
+ const fromDate = this.getNodeParameter('fromDate', i);
158
+ const filter = this.getNodeParameter('filter', i);
159
+ const params = {
160
+ fromDate,
161
+ version: '2',
162
+ };
163
+ if (filter)
164
+ params.filter = filter;
165
+ let endpoint = '';
166
+ if (queryType === 'data') {
167
+ endpoint = `/${credentials.accountCode}/data`;
168
+ params.metrics = this.getNodeParameter('metrics', i);
169
+ params.granularity = this.getNodeParameter('granularity', i);
170
+ const groupBy = this.getNodeParameter('groupBy', i);
171
+ if (groupBy)
172
+ params.groupBy = groupBy;
173
+ }
174
+ else if (queryType === 'events') {
175
+ endpoint = `/${credentials.accountCode}/rawdata/events`;
176
+ params.limit = this.getNodeParameter('limit', i);
177
+ }
178
+ else if (queryType === 'alerts') {
179
+ endpoint = `/${credentials.accountCode}/rawdata/genericalerts`;
180
+ params.limit = this.getNodeParameter('limit', i, 10);
181
+ }
182
+ const response = await GenericFunctions_1.npawApiRequest.call(this, 'GET', endpoint, params);
183
+ returnData.push(response);
184
+ }
185
+ return [this.helpers.returnJsonArray(returnData)];
186
+ }
187
+ }
188
+ exports.NpawTool = NpawTool;
189
+ //# sourceMappingURL=NpawTool.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NpawTool.node.js","sourceRoot":"","sources":["../../../nodes/Npaw/NpawTool.node.ts"],"names":[],"mappings":";;;AAQA,yDAAoD;AAEpD,MAAa,QAAQ;IAArB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,qBAAqB;YAClC,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,qHAAqH;YAClI,QAAQ,EAAE;gBACT,IAAI,EAAE,gBAAgB;aACtB;YACD,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EAAE,CAAC,OAAO,CAAC;iBACb;gBACD,SAAS,EAAE;oBACV,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,iCAAiC;yBACtC;qBACD;iBACD;aACD;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,SAAS;oBACf,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,YAAY;oBACzB,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR;4BACC,IAAI,EAAE,oBAAoB;4BAC1B,KAAK,EAAE,MAAM;4BACb,WAAW,EAAE,iFAAiF;yBAC9F;wBACD;4BACC,IAAI,EAAE,gBAAgB;4BACtB,KAAK,EAAE,QAAQ;4BACf,WAAW,EAAE,uDAAuD;yBACpE;wBACD;4BACC,IAAI,EAAE,YAAY;4BAClB,KAAK,EAAE,QAAQ;4BACf,WAAW,EAAE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CAAC;iBAAM,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;gBACnC,QAAQ,GAAG,IAAI,WAAW,CAAC,WAAW,wBAAwB,CAAC;gBAC/D,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAW,CAAC;YAChE,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,iCAAc,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC1E,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3B,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC;IACnD,CAAC;CACD;AAzLD,4BAyLC"}
@@ -0,0 +1,196 @@
1
+ import {
2
+ IExecuteFunctions,
3
+ INodeExecutionData,
4
+ INodeType,
5
+ INodeTypeDescription,
6
+ IDataObject,
7
+ } from 'n8n-workflow';
8
+
9
+ import { npawApiRequest } from './GenericFunctions';
10
+
11
+ export class NpawTool implements INodeType {
12
+ description: INodeTypeDescription = {
13
+ displayName: 'NPAW Analytics Tool',
14
+ name: 'npawTool',
15
+ icon: 'file:npaw.svg',
16
+ group: ['transform'],
17
+ version: 1,
18
+ description: 'Query NPAW/Youbora analytics data - optimized for AI agents to retrieve video analytics metrics, events, and alerts',
19
+ defaults: {
20
+ name: 'NPAW Analytics',
21
+ },
22
+ codex: {
23
+ categories: ['AI'],
24
+ subcategories: {
25
+ AI: ['Tools'],
26
+ },
27
+ resources: {
28
+ primaryDocumentation: [
29
+ {
30
+ url: 'https://documentation.npaw.com/',
31
+ },
32
+ ],
33
+ },
34
+ },
35
+ inputs: ['main'],
36
+ outputs: ['main'],
37
+ credentials: [
38
+ {
39
+ name: 'npawApi',
40
+ required: true,
41
+ },
42
+ ],
43
+ properties: [
44
+ {
45
+ displayName: 'Query Type',
46
+ name: 'queryType',
47
+ type: 'options',
48
+ noDataExpression: true,
49
+ options: [
50
+ {
51
+ name: 'Get Analytics Data',
52
+ value: 'data',
53
+ description: 'Retrieve aggregated analytics metrics (views, hours, users, buffer ratio, etc.)',
54
+ },
55
+ {
56
+ name: 'Get Raw Events',
57
+ value: 'events',
58
+ description: 'Retrieve raw event data for detailed session analysis',
59
+ },
60
+ {
61
+ name: 'Get Alerts',
62
+ value: 'alerts',
63
+ description: 'Retrieve system alerts and notifications',
64
+ },
65
+ ],
66
+ default: 'data',
67
+ description: 'Type of data to retrieve from NPAW/Youbora platform',
68
+ },
69
+ {
70
+ displayName: 'Time Period',
71
+ name: 'fromDate',
72
+ type: 'string',
73
+ default: 'last24hours',
74
+ options: [
75
+ { name: 'Last Hour', value: 'lasthour' },
76
+ { name: 'Last 6 Hours', value: 'last6hours' },
77
+ { name: 'Last 24 Hours', value: 'last24hours' },
78
+ { name: 'Last 7 Days', value: 'last7days' },
79
+ { name: 'Last 30 Days', value: 'last30days' },
80
+ { name: 'Today', value: 'today' },
81
+ { name: 'Yesterday', value: 'yesterday' },
82
+ { name: 'This Week', value: 'thisweek' },
83
+ { name: 'This Month', value: 'thismonth' },
84
+ ],
85
+ placeholder: 'YYYY-MM-DD or YYYY-MM-DD HH:mm:ss',
86
+ description: 'Time period for data retrieval. Use presets or enter custom date',
87
+ },
88
+ {
89
+ displayName: 'Metrics',
90
+ name: 'metrics',
91
+ type: 'string',
92
+ displayOptions: {
93
+ show: {
94
+ queryType: ['data'],
95
+ },
96
+ },
97
+ default: 'views,hours,uniques',
98
+ placeholder: 'views,hours,uniques,bufferRatio',
99
+ description: 'Comma-separated metrics to retrieve. Common: views, hours, uniques, joinTime, bufferRatio, throughput, errors',
100
+ },
101
+ {
102
+ displayName: 'Granularity',
103
+ name: 'granularity',
104
+ type: 'options',
105
+ displayOptions: {
106
+ show: {
107
+ queryType: ['data'],
108
+ },
109
+ },
110
+ options: [
111
+ { name: 'Minute', value: 'minute' },
112
+ { name: 'Hour', value: 'hour' },
113
+ { name: 'Day', value: 'day' },
114
+ { name: 'Week', value: 'week' },
115
+ { name: 'Month', value: 'month' },
116
+ ],
117
+ default: 'hour',
118
+ description: 'Time granularity for data aggregation',
119
+ },
120
+ {
121
+ displayName: 'Group By',
122
+ name: 'groupBy',
123
+ type: 'string',
124
+ displayOptions: {
125
+ show: {
126
+ queryType: ['data'],
127
+ },
128
+ },
129
+ default: '',
130
+ placeholder: 'country,device_type,browser',
131
+ description: 'Dimensions to group by. Common: country, device_type, browser, cdn, os, title',
132
+ },
133
+ {
134
+ displayName: 'Filter (JSON)',
135
+ name: 'filter',
136
+ type: 'string',
137
+ default: '',
138
+ placeholder: '[{"name":"Spain Users","rules":{"country":["Spain"]}}]',
139
+ description: 'JSON filter to narrow results. Example: [{"name":"Filter Name","rules":{"country":["Spain"],"device_type":["PC"]}}]',
140
+ },
141
+ {
142
+ displayName: 'Limit',
143
+ name: 'limit',
144
+ type: 'number',
145
+ displayOptions: {
146
+ show: {
147
+ queryType: ['events', 'alerts'],
148
+ },
149
+ },
150
+ default: 10,
151
+ description: 'Maximum number of results to return (max 500 for events/alerts)',
152
+ },
153
+ ],
154
+ };
155
+
156
+ async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
157
+ const items = this.getInputData();
158
+ const returnData: IDataObject[] = [];
159
+ const credentials = await this.getCredentials('npawApi');
160
+
161
+ for (let i = 0; i < items.length; i++) {
162
+ const queryType = this.getNodeParameter('queryType', i) as string;
163
+ const fromDate = this.getNodeParameter('fromDate', i) as string;
164
+ const filter = this.getNodeParameter('filter', i) as string;
165
+
166
+ const params: IDataObject = {
167
+ fromDate,
168
+ version: '2',
169
+ };
170
+
171
+ if (filter) params.filter = filter;
172
+
173
+ let endpoint = '';
174
+
175
+ if (queryType === 'data') {
176
+ endpoint = `/${credentials.accountCode}/data`;
177
+ params.metrics = this.getNodeParameter('metrics', i) as string;
178
+ params.granularity = this.getNodeParameter('granularity', i) as string;
179
+
180
+ const groupBy = this.getNodeParameter('groupBy', i) as string;
181
+ if (groupBy) params.groupBy = groupBy;
182
+ } else if (queryType === 'events') {
183
+ endpoint = `/${credentials.accountCode}/rawdata/events`;
184
+ params.limit = this.getNodeParameter('limit', i) as number;
185
+ } else if (queryType === 'alerts') {
186
+ endpoint = `/${credentials.accountCode}/rawdata/genericalerts`;
187
+ params.limit = this.getNodeParameter('limit', i, 10) as number;
188
+ }
189
+
190
+ const response = await npawApiRequest.call(this, 'GET', endpoint, params);
191
+ returnData.push(response);
192
+ }
193
+
194
+ return [this.helpers.returnJsonArray(returnData)];
195
+ }
196
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lbono/n8n-nodes-npaw",
3
- "version": "2.0.1",
4
- "description": "NPAW/Youbora support for n8n",
3
+ "version": "2.0.3",
4
+ "description": "NPAW / Youbora analytics nodes for n8n",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "Luciano Bono",
@@ -16,37 +16,40 @@
16
16
  "n8n",
17
17
  "npaw",
18
18
  "youbora",
19
- "nodes",
20
- "workflow",
21
- "analytics"
19
+ "analytics",
20
+ "observability"
22
21
  ],
23
- "main": "index.js",
24
- "scripts": {
25
- "build": "tsc && gulp",
26
- "watch": "tsc --watch",
27
- "prepublishOnly": "npm run build"
28
- },
22
+ "main": "dist/index.js",
29
23
  "files": [
30
24
  "dist",
31
25
  "credentials",
32
26
  "nodes"
33
27
  ],
28
+ "scripts": {
29
+ "build": "tsc && gulp",
30
+ "watch": "tsc --watch",
31
+ "prepublishOnly": "npm run build"
32
+ },
33
+ "engines": {
34
+ "node": ">=18.10"
35
+ },
34
36
  "n8n": {
35
37
  "n8nNodesApiVersion": 1,
36
38
  "credentials": [
37
39
  "dist/credentials/NpawApi.credentials.js"
38
40
  ],
39
41
  "nodes": [
40
- "dist/nodes/Npaw/Npaw.node.js"
42
+ "dist/nodes/Npaw/Npaw.node.js",
43
+ "dist/nodes/Npaw/NpawTool.node.js"
41
44
  ]
42
45
  },
43
46
  "devDependencies": {
44
47
  "@types/node": "^20.0.0",
45
- "gulp": "^4.0.0",
46
- "n8n-workflow": "^1.0.0",
48
+ "gulp": "^4.0.2",
49
+ "n8n-workflow": "^1.60.0",
47
50
  "typescript": "^5.0.0"
48
51
  },
49
52
  "peerDependencies": {
50
- "n8n-workflow": "*"
53
+ "n8n-workflow": ">=1.0.0"
51
54
  }
52
- }
55
+ }
package/index.js DELETED
@@ -1 +0,0 @@
1
-