n8n-nodes-wix 1.0.5 → 1.0.6

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.
@@ -21,6 +21,19 @@ class WixSiteList {
21
21
  },
22
22
  inputs: ['main'],
23
23
  outputs: ['main'],
24
+ credentials: [
25
+ {
26
+ name: 'WixSiteAPI',
27
+ required: true,
28
+ }
29
+ ],
30
+ requestDefaults: {
31
+ baseURL: 'https://www.wixapis.com/site-list/v2/sites/query',
32
+ headers: {
33
+ Accept: 'application/json',
34
+ 'Content-Type': 'application/json',
35
+ },
36
+ },
24
37
  properties: [
25
38
  {
26
39
  displayName: 'API Key',
package/package.json CHANGED
@@ -1,28 +1,35 @@
1
1
  {
2
2
  "name": "n8n-nodes-wix",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Wix sites node for n8n",
5
+ "license": "MIT",
6
+ "main": "index.js",
5
7
  "keywords": [
6
8
  "wix",
7
9
  "api"
8
10
  ],
9
- "license": "MIT",
10
11
  "author": "Snoorky",
11
12
  "type": "commonjs",
12
13
  "scripts": {
13
- "test": "echo \"Error: no test specified\" && exit 1"
14
+ "build": "tsc",
15
+ "dev": "tsc --watch",
16
+ "prepublishOnly": "npm run build"
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "n8n": {
22
+ "nodes": [
23
+ "nodes/WixSiteList.node.js"
24
+ ]
14
25
  },
15
26
  "dependencies": {
16
27
  "axios": "^1.6.0",
17
- "n8n-core": "^2.5.0",
18
- "n8n-workflow": "^2.5.0"
28
+ "n8n-core": "*",
29
+ "n8n-workflow": "*"
19
30
  },
20
31
  "devDependencies": {
21
- "@codemirror/autocomplete": "^6.20.0",
22
- "@types/express": "^5.0.6",
23
- "@types/nock": "^10.0.3",
24
32
  "@types/node": "^25.0.9",
25
- "@types/ssh2": "^1.15.5",
26
33
  "typescript": "^5.2.2"
27
34
  }
28
35
  }
@@ -1,108 +0,0 @@
1
- import { INodeType, INodeTypeDescription, IExecuteFunctions, INodeExecutionData, NodeOperationError } from 'n8n-workflow';
2
- import { IDataObject } from 'n8n-workflow';
3
- import axios, { AxiosRequestConfig } from 'axios';
4
-
5
- export class WixSiteList implements INodeType {
6
- description: INodeTypeDescription = {
7
- displayName: 'Wix Site List',
8
- name: 'wixSiteList',
9
- icon: 'file:wix.png',
10
- group: ['transform'],
11
- version: 1,
12
- description: 'Retrieve a list of Wix sites dynamically',
13
- defaults: {
14
- name: 'Wix Site List',
15
- color: '#1A73E8',
16
- },
17
- inputs: ['main'],
18
- outputs: ['main'],
19
- properties: [
20
- {
21
- displayName: 'API Key',
22
- name: 'apiKey',
23
- type: 'string',
24
- default: '',
25
- required: true,
26
- },
27
- {
28
- displayName: 'Filter',
29
- name: 'filter',
30
- type: 'json',
31
- default: {},
32
- },
33
- {
34
- displayName: 'Limit',
35
- name: 'limit',
36
- type: 'number',
37
- default: 100,
38
- },
39
- {
40
- displayName: 'Cursor',
41
- name: 'cursor',
42
- type: 'string',
43
- default: '',
44
- },
45
- {
46
- displayName: 'Sort',
47
- name: 'sort',
48
- type: 'json',
49
- default: [],
50
- },
51
- {
52
- displayName: 'Fields',
53
- name: 'fields',
54
- type: 'json',
55
- default: {},
56
- },
57
- ],
58
- };
59
-
60
- async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
61
- const returnData: INodeExecutionData[] = [];
62
-
63
- const apiKey = this.getNodeParameter('apiKey', 0) as string;
64
- const filter = this.getNodeParameter('filter', 0) as IDataObject;
65
- const limit = this.getNodeParameter('limit', 0) as number;
66
- const cursor = this.getNodeParameter('cursor', 0) as string;
67
- const sort = this.getNodeParameter('sort', 0) as IDataObject[];
68
- const fields = this.getNodeParameter('fields', 0) as IDataObject;
69
-
70
- const body: IDataObject = {
71
- query: {
72
- filter,
73
- cursorPaging: {
74
- limit,
75
- cursor: cursor || undefined,
76
- },
77
- sort,
78
- fields,
79
- },
80
- };
81
-
82
- const config: AxiosRequestConfig = {
83
- method: 'POST',
84
- url: 'https://www.wixapis.com/site-list/v2/sites/query',
85
- headers: {
86
- Authorization: `Bearer ${apiKey}`,
87
- 'Content-Type': 'application/json',
88
- },
89
- data: body,
90
- };
91
-
92
- let responseData: IDataObject;
93
- try {
94
- const response = await axios(config);
95
- responseData = response.data as IDataObject;
96
- } catch (error) {
97
- throw new NodeOperationError(this.getNode(), error as Error);
98
- }
99
-
100
- if (responseData.sites && Array.isArray(responseData.sites)) {
101
- for (const site of responseData.sites) {
102
- returnData.push({ json: site as IDataObject });
103
- }
104
- }
105
-
106
- return [returnData];
107
- }
108
- }
package/tsconfig.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "module": "commonjs",
5
- "declaration": true,
6
- "outDir": "dist",
7
- "strict": true,
8
- "esModuleInterop": true,
9
- "skipLibCheck": true
10
- },
11
- "include": ["nodes/**/*.ts"],
12
- "exclude": ["node_modules"]
13
- }