n8n-nodes-wix 1.0.0 → 1.0.2
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 +1 -0
- package/dist/index.js +5 -0
- package/dist/nodes/sites/index.d.ts +5 -0
- package/dist/nodes/sites/index.js +125 -0
- package/index.ts +1 -0
- package/package.json +11 -3
- package/tsconfig.json +4 -2
- /package/nodes/sites/{list.node.ts → index.ts} +0 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WixSiteList } from './nodes/sites';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WixSiteList = void 0;
|
|
4
|
+
var sites_1 = require("./nodes/sites");
|
|
5
|
+
Object.defineProperty(exports, "WixSiteList", { enumerable: true, get: function () { return sites_1.WixSiteList; } });
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.WixSiteList = void 0;
|
|
7
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
8
|
+
const axios_1 = __importDefault(require("axios"));
|
|
9
|
+
class WixSiteList {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.description = {
|
|
12
|
+
displayName: 'Wix Site List',
|
|
13
|
+
name: 'wixSiteList',
|
|
14
|
+
icon: 'file:wix.png', // coloque um ícone do Wix se quiser
|
|
15
|
+
group: ['transform'],
|
|
16
|
+
version: 1,
|
|
17
|
+
description: 'Retrieve a list of Wix sites dynamically',
|
|
18
|
+
defaults: {
|
|
19
|
+
name: 'Wix Site List',
|
|
20
|
+
color: '#1A73E8', // azul Wix
|
|
21
|
+
},
|
|
22
|
+
inputs: ['main'],
|
|
23
|
+
outputs: ['main'],
|
|
24
|
+
properties: [
|
|
25
|
+
{
|
|
26
|
+
displayName: 'API Key',
|
|
27
|
+
name: 'apiKey',
|
|
28
|
+
type: 'string',
|
|
29
|
+
default: '',
|
|
30
|
+
required: true,
|
|
31
|
+
description: 'Your Wix account-level API key or OAuth token',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
displayName: 'Filter',
|
|
35
|
+
name: 'filter',
|
|
36
|
+
type: 'json',
|
|
37
|
+
default: {},
|
|
38
|
+
description: 'JSON object to filter the sites. Example: {"displayName":"my-site"}',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
displayName: 'Limit',
|
|
42
|
+
name: 'limit',
|
|
43
|
+
type: 'number',
|
|
44
|
+
default: 100,
|
|
45
|
+
description: 'Maximum number of sites to return (max 1000)',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
displayName: 'Cursor',
|
|
49
|
+
name: 'cursor',
|
|
50
|
+
type: 'string',
|
|
51
|
+
default: '',
|
|
52
|
+
description: 'Cursor for paging. Leave empty for the first request',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
displayName: 'Sort',
|
|
56
|
+
name: 'sort',
|
|
57
|
+
type: 'json',
|
|
58
|
+
default: [],
|
|
59
|
+
description: 'JSON array of objects for sorting. Example: [{"fieldName":"displayName","order":"ASC"}]',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
displayName: 'Fields',
|
|
63
|
+
name: 'fields',
|
|
64
|
+
type: 'json',
|
|
65
|
+
default: {},
|
|
66
|
+
description: 'Specify which fields to return for each site. Leave empty for all fields',
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
// Função principal do node
|
|
72
|
+
async execute() {
|
|
73
|
+
const items = this.getInputData(); // dados recebidos de outros nodes
|
|
74
|
+
const returnData = [];
|
|
75
|
+
// Pegando valores dos parâmetros do node
|
|
76
|
+
const apiKey = this.getNodeParameter('apiKey', 0);
|
|
77
|
+
const filter = this.getNodeParameter('filter', 0);
|
|
78
|
+
const limit = this.getNodeParameter('limit', 0);
|
|
79
|
+
const cursor = this.getNodeParameter('cursor', 0);
|
|
80
|
+
const sort = this.getNodeParameter('sort', 0);
|
|
81
|
+
const fields = this.getNodeParameter('fields', 0);
|
|
82
|
+
// Montando o corpo da requisição
|
|
83
|
+
const body = {
|
|
84
|
+
query: {
|
|
85
|
+
filter,
|
|
86
|
+
cursorPaging: {
|
|
87
|
+
limit,
|
|
88
|
+
cursor: cursor || undefined,
|
|
89
|
+
},
|
|
90
|
+
sort,
|
|
91
|
+
fields,
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
// Configuração da requisição HTTP
|
|
95
|
+
const config = {
|
|
96
|
+
method: 'POST',
|
|
97
|
+
url: 'https://www.wixapis.com/site-list/v2/sites/query',
|
|
98
|
+
headers: {
|
|
99
|
+
Authorization: `Bearer ${apiKey}`,
|
|
100
|
+
'Content-Type': 'application/json',
|
|
101
|
+
},
|
|
102
|
+
data: body,
|
|
103
|
+
validateStatus: (status) => status >= 200 && status < 300,
|
|
104
|
+
};
|
|
105
|
+
// Executando a requisição
|
|
106
|
+
let responseData;
|
|
107
|
+
try {
|
|
108
|
+
const response = await (0, axios_1.default)(config);
|
|
109
|
+
responseData = response.data;
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error);
|
|
113
|
+
}
|
|
114
|
+
// Retornando os sites como output
|
|
115
|
+
if (responseData.sites && Array.isArray(responseData.sites)) {
|
|
116
|
+
for (const site of responseData.sites) {
|
|
117
|
+
returnData.push({
|
|
118
|
+
json: site
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return [returnData];
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
exports.WixSiteList = WixSiteList;
|
package/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WixSiteList } from './nodes/sites'
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-wix",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Wix sites node for n8n",
|
|
5
|
-
"keywords": [
|
|
5
|
+
"keywords": [
|
|
6
|
+
"wix",
|
|
7
|
+
"api"
|
|
8
|
+
],
|
|
6
9
|
"license": "MIT",
|
|
7
10
|
"author": "Snoorky",
|
|
8
11
|
"type": "commonjs",
|
|
9
|
-
"main": "
|
|
12
|
+
"main": "dist/index.js",
|
|
10
13
|
"scripts": {
|
|
11
14
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
12
15
|
},
|
|
@@ -16,6 +19,11 @@
|
|
|
16
19
|
"n8n-workflow": "^2.5.0"
|
|
17
20
|
},
|
|
18
21
|
"devDependencies": {
|
|
22
|
+
"@codemirror/autocomplete": "^6.20.0",
|
|
23
|
+
"@types/express": "^5.0.6",
|
|
24
|
+
"@types/nock": "^10.0.3",
|
|
25
|
+
"@types/node": "^25.0.9",
|
|
26
|
+
"@types/ssh2": "^1.15.5",
|
|
19
27
|
"typescript": "^5.2.2"
|
|
20
28
|
}
|
|
21
29
|
}
|
package/tsconfig.json
CHANGED
|
File without changes
|