@justbrunasso/n8n-nodes-glpi 1.0.10 → 1.0.12
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/dist/index.d.ts
CHANGED
|
@@ -3,3 +3,8 @@ import { GlpiApi } from './nodes/Glpi/GlpiApi.credentials';
|
|
|
3
3
|
export { Glpi, GlpiApi };
|
|
4
4
|
export declare const nodes: (typeof Glpi)[];
|
|
5
5
|
export declare const credentials: (typeof GlpiApi)[];
|
|
6
|
+
declare const _default: {
|
|
7
|
+
nodes: (typeof Glpi)[];
|
|
8
|
+
credentials: (typeof GlpiApi)[];
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
package/dist/index.js
CHANGED
|
@@ -8,4 +8,6 @@ Object.defineProperty(exports, "GlpiApi", { enumerable: true, get: function () {
|
|
|
8
8
|
// Exports explícitos que o n8n busca ao carregar pacotes externos
|
|
9
9
|
exports.nodes = [Glpi_node_1.Glpi];
|
|
10
10
|
exports.credentials = [GlpiApi_credentials_1.GlpiApi];
|
|
11
|
+
// Default export para compatibilidade adicional
|
|
12
|
+
exports.default = { nodes: exports.nodes, credentials: exports.credentials };
|
|
11
13
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,sDAA8C;AAGrC,qFAHA,gBAAI,OAGA;AAFb,0EAA2D;AAE5C,wFAFN,6BAAO,OAEM;AAEtB,kEAAkE;AACrD,QAAA,KAAK,GAAG,CAAC,gBAAI,CAAC,CAAC;AACf,QAAA,WAAW,GAAG,CAAC,6BAAO,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,sDAA8C;AAGrC,qFAHA,gBAAI,OAGA;AAFb,0EAA2D;AAE5C,wFAFN,6BAAO,OAEM;AAEtB,kEAAkE;AACrD,QAAA,KAAK,GAAG,CAAC,gBAAI,CAAC,CAAC;AACf,QAAA,WAAW,GAAG,CAAC,6BAAO,CAAC,CAAC;AAErC,gDAAgD;AAChD,kBAAe,EAAE,KAAK,EAAL,aAAK,EAAE,WAAW,EAAX,mBAAW,EAAE,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
2
|
export declare class Glpi implements INodeType {
|
|
3
3
|
description: INodeTypeDescription;
|
|
4
|
-
private buildBaseHeaders;
|
|
5
|
-
private buildCriteriaQuery;
|
|
6
4
|
execute(this: any): Promise<INodeExecutionData[][]>;
|
|
7
5
|
}
|
|
@@ -7,7 +7,7 @@ class Glpi {
|
|
|
7
7
|
this.description = {
|
|
8
8
|
displayName: 'GLPI',
|
|
9
9
|
name: 'glpi',
|
|
10
|
-
icon: '
|
|
10
|
+
icon: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyIDJDMTMuMSAyIDE0IDIuOSAxNCA0VjE2QzE0IDE3LjEgMTMuMSAxOCA xMTggMTJDMTAgMTggOS4xIDE3LjEgOSAxNlY0QzkgMi45IDkuOSAyIDEyIDJaTTEyIDIwQzEzLjY2IDIwIDE1IDE4LjY2IDE1IDE3UzEzLjY2IDE1IDEyIDE1UzkgMTYuMzQgOSAxN1MxMC4zNCAyMCAxMiAyMFoiIGZpbGw9IiM2MzY2RjEiLz4KPC9zdmc+',
|
|
11
11
|
group: ['output'],
|
|
12
12
|
version: 1,
|
|
13
13
|
description: 'Interacts with GLPI API',
|
|
@@ -28,33 +28,9 @@ class Glpi {
|
|
|
28
28
|
],
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
// Minimal helpers/HTTP omitted — only a safe stub so n8n will load the node.
|
|
32
|
-
async buildBaseHeaders() {
|
|
33
|
-
const credentials = await this.getCredentials?.('glpiApi');
|
|
34
|
-
const headers = {
|
|
35
|
-
'App-Token': credentials?.appToken || '',
|
|
36
|
-
'Content-Type': 'application/json',
|
|
37
|
-
};
|
|
38
|
-
if (credentials?.userToken) {
|
|
39
|
-
headers['Authorization'] = `user_token ${credentials.userToken}`;
|
|
40
|
-
}
|
|
41
|
-
return { baseUrl: credentials?.baseUrl || '', headers, auth: credentials?.username ? { user: credentials.username, pass: credentials.password } : undefined };
|
|
42
|
-
}
|
|
43
|
-
buildCriteriaQuery(criteriaInput) {
|
|
44
|
-
if (!Array.isArray(criteriaInput) || criteriaInput.length === 0)
|
|
45
|
-
return '';
|
|
46
|
-
const parts = [];
|
|
47
|
-
criteriaInput.forEach((c, i) => {
|
|
48
|
-
parts.push(`criteria[${i}][glue]=${encodeURIComponent(String(c.glue || 'AND'))}`);
|
|
49
|
-
parts.push(`criteria[${i}][field]=${encodeURIComponent(String(c.field || ''))}`);
|
|
50
|
-
parts.push(`criteria[${i}][searchtype]=${encodeURIComponent(String(c.searchtype || 'contains'))}`);
|
|
51
|
-
parts.push(`criteria[${i}][value]=${encodeURIComponent(String(c.value || ''))}`);
|
|
52
|
-
});
|
|
53
|
-
return parts.join('&');
|
|
54
|
-
}
|
|
55
31
|
async execute() {
|
|
56
|
-
//
|
|
57
|
-
//
|
|
32
|
+
// Stub implementation: return empty data to avoid runtime errors.
|
|
33
|
+
// Replace with actual GLPI API calls using this.helpers.request(...)
|
|
58
34
|
const returnData = [];
|
|
59
35
|
return [returnData];
|
|
60
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Glpi.node.js","sourceRoot":"","sources":["../../../nodes/Glpi/Glpi.node.ts"],"names":[],"mappings":";;;AAMA,2DAAiE;AAEjE,MAAa,IAAI;IAAjB;QACI,gBAAW,GAAyB;YAChC,WAAW,EAAE,MAAM;YACnB,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"Glpi.node.js","sourceRoot":"","sources":["../../../nodes/Glpi/Glpi.node.ts"],"names":[],"mappings":";;;AAMA,2DAAiE;AAEjE,MAAa,IAAI;IAAjB;QACI,gBAAW,GAAyB;YAChC,WAAW,EAAE,MAAM;YACnB,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,qaAAqa;YAC3a,KAAK,EAAE,CAAC,QAAQ,CAAC;YACjB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,yBAAyB;YACtC,QAAQ,EAAE;gBACN,IAAI,EAAE,MAAM;aACf;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE;gBACT;oBACI,IAAI,EAAE,SAAS;oBACf,QAAQ,EAAE,IAAI;iBACjB;aACJ;YACD,UAAU,EAAE;gBACR,GAAG,kCAAc;gBACjB,GAAG,8BAAU;aAChB;SACJ,CAAC;IAQN,CAAC;IANG,KAAK,CAAC,OAAO;QACT,kEAAkE;QAClE,qEAAqE;QACrE,MAAM,UAAU,GAAyB,EAAE,CAAC;QAC5C,OAAO,CAAC,UAAU,CAAC,CAAC;IACxB,CAAC;CACJ;AA/BD,oBA+BC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justbrunasso/n8n-nodes-glpi",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "GLPI REST API node for n8n (GLPI 10.x) with Criteria Builder and automatic session handling (no cache).",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,6 +18,13 @@
|
|
|
18
18
|
"type": "git",
|
|
19
19
|
"url": "git+https://github.com/PhyBruno/n8n-nodes-glpi.git"
|
|
20
20
|
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/PhyBruno/n8n-nodes-glpi/issues"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/PhyBruno/n8n-nodes-glpi#readme",
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=16"
|
|
27
|
+
},
|
|
21
28
|
"peerDependencies": {
|
|
22
29
|
"n8n-core": "^1.0.0",
|
|
23
30
|
"n8n-workflow": "^1.0.0"
|