n8n-nodes-wix 1.0.1 → 1.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.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- import { INodeType, INodeTypeDescription, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
- export declare class WixSiteList implements INodeType {
3
- description: INodeTypeDescription;
4
- execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
- }
1
+ import { WixSiteList } from './nodes/sites';
2
+ export { WixSiteList };
package/dist/index.js CHANGED
@@ -1,125 +1,6 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  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;
4
+ const sites_1 = require("./nodes/sites");
5
+ Object.defineProperty(exports, "WixSiteList", { enumerable: true, get: function () { return sites_1.WixSiteList; } });
6
+ module.exports = { WixSiteList: sites_1.WixSiteList };
@@ -0,0 +1,5 @@
1
+ import { INodeType, INodeTypeDescription, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
+ export declare class WixSiteList implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
@@ -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,4 @@
1
+ import { WixSiteList } from './nodes/sites'
2
+
3
+ export { WixSiteList }
4
+ module.exports = { WixSiteList }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-wix",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Wix sites node for n8n",
5
5
  "keywords": [
6
6
  "wix",
@@ -9,7 +9,7 @@
9
9
  "license": "MIT",
10
10
  "author": "Snoorky",
11
11
  "type": "commonjs",
12
- "main": "/dist/index.js",
12
+ "main": "dist/index.js",
13
13
  "scripts": {
14
14
  "test": "echo \"Error: no test specified\" && exit 1"
15
15
  },
@@ -19,6 +19,11 @@
19
19
  "n8n-workflow": "^2.5.0"
20
20
  },
21
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",
22
27
  "typescript": "^5.2.2"
23
28
  }
24
29
  }
package/tsconfig.json CHANGED
@@ -5,7 +5,9 @@
5
5
  "declaration": true,
6
6
  "outDir": "./dist",
7
7
  "strict": true,
8
- "esModuleInterop": true
8
+ "esModuleInterop": true,
9
+ "skipLibCheck": true
9
10
  },
10
- "include": ["nodes/**/*.ts"]
11
+ "include": ["nodes/**/*.ts", "index.ts"],
12
+ "exclude": ["node_modules"]
11
13
  }