n8n-node-whazing 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.
Files changed (72) hide show
  1. package/LICENSE.md +19 -0
  2. package/README.md +247 -0
  3. package/dist/credentials/GithubIssuesApi.credentials.d.ts +10 -0
  4. package/dist/credentials/GithubIssuesApi.credentials.js +37 -0
  5. package/dist/credentials/GithubIssuesApi.credentials.js.map +1 -0
  6. package/dist/credentials/GithubIssuesOAuth2Api.credentials.d.ts +9 -0
  7. package/dist/credentials/GithubIssuesOAuth2Api.credentials.js +54 -0
  8. package/dist/credentials/GithubIssuesOAuth2Api.credentials.js.map +1 -0
  9. package/dist/credentials/WhazingApi.credentials.d.ts +10 -0
  10. package/dist/credentials/WhazingApi.credentials.js +76 -0
  11. package/dist/credentials/WhazingApi.credentials.js.map +1 -0
  12. package/dist/icons/github.dark.svg +3 -0
  13. package/dist/icons/github.svg +3 -0
  14. package/dist/nodes/Example/Example.node.d.ts +5 -0
  15. package/dist/nodes/Example/Example.node.js +61 -0
  16. package/dist/nodes/Example/Example.node.js.map +1 -0
  17. package/dist/nodes/Example/Example.node.json +18 -0
  18. package/dist/nodes/Example/example.dark.svg +13 -0
  19. package/dist/nodes/Example/example.svg +13 -0
  20. package/dist/nodes/GithubIssues/GithubIssues.node.d.ts +14 -0
  21. package/dist/nodes/GithubIssues/GithubIssues.node.js +101 -0
  22. package/dist/nodes/GithubIssues/GithubIssues.node.js.map +1 -0
  23. package/dist/nodes/GithubIssues/GithubIssues.node.json +18 -0
  24. package/dist/nodes/GithubIssues/listSearch/getIssues.d.ts +2 -0
  25. package/dist/nodes/GithubIssues/listSearch/getIssues.js +28 -0
  26. package/dist/nodes/GithubIssues/listSearch/getIssues.js.map +1 -0
  27. package/dist/nodes/GithubIssues/listSearch/getRepositories.d.ts +2 -0
  28. package/dist/nodes/GithubIssues/listSearch/getRepositories.js +31 -0
  29. package/dist/nodes/GithubIssues/listSearch/getRepositories.js.map +1 -0
  30. package/dist/nodes/GithubIssues/listSearch/getUsers.d.ts +2 -0
  31. package/dist/nodes/GithubIssues/listSearch/getUsers.js +29 -0
  32. package/dist/nodes/GithubIssues/listSearch/getUsers.js.map +1 -0
  33. package/dist/nodes/GithubIssues/resources/issue/create.d.ts +2 -0
  34. package/dist/nodes/GithubIssues/resources/issue/create.js +75 -0
  35. package/dist/nodes/GithubIssues/resources/issue/create.js.map +1 -0
  36. package/dist/nodes/GithubIssues/resources/issue/get.d.ts +2 -0
  37. package/dist/nodes/GithubIssues/resources/issue/get.js +15 -0
  38. package/dist/nodes/GithubIssues/resources/issue/get.js.map +1 -0
  39. package/dist/nodes/GithubIssues/resources/issue/getAll.d.ts +2 -0
  40. package/dist/nodes/GithubIssues/resources/issue/getAll.js +125 -0
  41. package/dist/nodes/GithubIssues/resources/issue/getAll.js.map +1 -0
  42. package/dist/nodes/GithubIssues/resources/issue/index.d.ts +2 -0
  43. package/dist/nodes/GithubIssues/resources/issue/index.js +76 -0
  44. package/dist/nodes/GithubIssues/resources/issue/index.js.map +1 -0
  45. package/dist/nodes/GithubIssues/resources/issueComment/getAll.d.ts +2 -0
  46. package/dist/nodes/GithubIssues/resources/issueComment/getAll.js +66 -0
  47. package/dist/nodes/GithubIssues/resources/issueComment/getAll.js.map +1 -0
  48. package/dist/nodes/GithubIssues/resources/issueComment/index.d.ts +2 -0
  49. package/dist/nodes/GithubIssues/resources/issueComment/index.js +48 -0
  50. package/dist/nodes/GithubIssues/resources/issueComment/index.js.map +1 -0
  51. package/dist/nodes/GithubIssues/shared/descriptions.d.ts +4 -0
  52. package/dist/nodes/GithubIssues/shared/descriptions.js +151 -0
  53. package/dist/nodes/GithubIssues/shared/descriptions.js.map +1 -0
  54. package/dist/nodes/GithubIssues/shared/transport.d.ts +2 -0
  55. package/dist/nodes/GithubIssues/shared/transport.js +16 -0
  56. package/dist/nodes/GithubIssues/shared/transport.js.map +1 -0
  57. package/dist/nodes/GithubIssues/shared/utils.d.ts +3 -0
  58. package/dist/nodes/GithubIssues/shared/utils.js +17 -0
  59. package/dist/nodes/GithubIssues/shared/utils.js.map +1 -0
  60. package/dist/nodes/Whazing/GenericFunctions.d.ts +3 -0
  61. package/dist/nodes/Whazing/GenericFunctions.js +60 -0
  62. package/dist/nodes/Whazing/GenericFunctions.js.map +1 -0
  63. package/dist/nodes/Whazing/Whazing.node.d.ts +5 -0
  64. package/dist/nodes/Whazing/Whazing.node.js +581 -0
  65. package/dist/nodes/Whazing/Whazing.node.js.map +1 -0
  66. package/dist/nodes/Whazing/WhazingDescription.d.ts +2 -0
  67. package/dist/nodes/Whazing/WhazingDescription.js +1307 -0
  68. package/dist/nodes/Whazing/WhazingDescription.js.map +1 -0
  69. package/dist/nodes/Whazing/whazing.svg +5 -0
  70. package/dist/package.json +55 -0
  71. package/dist/tsconfig.tsbuildinfo +1 -0
  72. package/package.json +55 -0
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.issueCommentDescription = void 0;
4
+ const descriptions_1 = require("../../shared/descriptions");
5
+ const getAll_1 = require("./getAll");
6
+ const showOnlyForIssueComments = {
7
+ resource: ['issueComment'],
8
+ };
9
+ exports.issueCommentDescription = [
10
+ {
11
+ displayName: 'Operation',
12
+ name: 'operation',
13
+ type: 'options',
14
+ noDataExpression: true,
15
+ displayOptions: {
16
+ show: showOnlyForIssueComments,
17
+ },
18
+ options: [
19
+ {
20
+ name: 'Get Many',
21
+ value: 'getAll',
22
+ action: 'Get issue comments',
23
+ description: 'Get issue comments',
24
+ routing: {
25
+ request: {
26
+ method: 'GET',
27
+ url: '=/repos/{{$parameter.owner}}/{{$parameter.repository}}/issues/comments',
28
+ },
29
+ },
30
+ },
31
+ ],
32
+ default: 'getAll',
33
+ },
34
+ {
35
+ ...descriptions_1.repoOwnerSelect,
36
+ displayOptions: {
37
+ show: showOnlyForIssueComments,
38
+ },
39
+ },
40
+ {
41
+ ...descriptions_1.repoNameSelect,
42
+ displayOptions: {
43
+ show: showOnlyForIssueComments,
44
+ },
45
+ },
46
+ ...getAll_1.issueCommentGetManyDescription,
47
+ ];
48
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/GithubIssues/resources/issueComment/index.ts"],"names":[],"mappings":";;;AACA,4DAA4E;AAC5E,qCAA0D;AAE1D,MAAM,wBAAwB,GAAG;IAChC,QAAQ,EAAE,CAAC,cAAc,CAAC;CAC1B,CAAC;AAEW,QAAA,uBAAuB,GAAsB;IACzD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACf,IAAI,EAAE,wBAAwB;SAC9B;QACD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,oBAAoB;gBAC5B,WAAW,EAAE,oBAAoB;gBACjC,OAAO,EAAE;oBACR,OAAO,EAAE;wBACR,MAAM,EAAE,KAAK;wBACb,GAAG,EAAE,wEAAwE;qBAC7E;iBACD;aACD;SACD;QACD,OAAO,EAAE,QAAQ;KACjB;IACD;QACC,GAAG,8BAAe;QAClB,cAAc,EAAE;YACf,IAAI,EAAE,wBAAwB;SAC9B;KACD;IACD;QACC,GAAG,6BAAc;QACjB,cAAc,EAAE;YACf,IAAI,EAAE,wBAAwB;SAC9B;KACD;IACD,GAAG,uCAA8B;CACjC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ export declare const repoOwnerSelect: INodeProperties;
3
+ export declare const repoNameSelect: INodeProperties;
4
+ export declare const issueSelect: INodeProperties;
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.issueSelect = exports.repoNameSelect = exports.repoOwnerSelect = void 0;
4
+ exports.repoOwnerSelect = {
5
+ displayName: 'Repository Owner',
6
+ name: 'owner',
7
+ type: 'resourceLocator',
8
+ default: { mode: 'list', value: '' },
9
+ required: true,
10
+ modes: [
11
+ {
12
+ displayName: 'Repository Owner',
13
+ name: 'list',
14
+ type: 'list',
15
+ placeholder: 'Select an owner...',
16
+ typeOptions: {
17
+ searchListMethod: 'getUsers',
18
+ searchable: true,
19
+ searchFilterRequired: false,
20
+ },
21
+ },
22
+ {
23
+ displayName: 'Link',
24
+ name: 'url',
25
+ type: 'string',
26
+ placeholder: 'e.g. https://github.com/n8n-io',
27
+ extractValue: {
28
+ type: 'regex',
29
+ regex: 'https:\\/\\/github.com\\/([-_0-9a-zA-Z]+)',
30
+ },
31
+ validation: [
32
+ {
33
+ type: 'regex',
34
+ properties: {
35
+ regex: 'https:\\/\\/github.com\\/([-_0-9a-zA-Z]+)(?:.*)',
36
+ errorMessage: 'Not a valid GitHub URL',
37
+ },
38
+ },
39
+ ],
40
+ },
41
+ {
42
+ displayName: 'By Name',
43
+ name: 'name',
44
+ type: 'string',
45
+ placeholder: 'e.g. n8n-io',
46
+ validation: [
47
+ {
48
+ type: 'regex',
49
+ properties: {
50
+ regex: '[-_a-zA-Z0-9]+',
51
+ errorMessage: 'Not a valid GitHub Owner Name',
52
+ },
53
+ },
54
+ ],
55
+ url: '=https://github.com/{{$value}}',
56
+ },
57
+ ],
58
+ };
59
+ exports.repoNameSelect = {
60
+ displayName: 'Repository Name',
61
+ name: 'repository',
62
+ type: 'resourceLocator',
63
+ default: {
64
+ mode: 'list',
65
+ value: '',
66
+ },
67
+ required: true,
68
+ modes: [
69
+ {
70
+ displayName: 'Repository Name',
71
+ name: 'list',
72
+ type: 'list',
73
+ placeholder: 'Select an Repository...',
74
+ typeOptions: {
75
+ searchListMethod: 'getRepositories',
76
+ searchable: true,
77
+ },
78
+ },
79
+ {
80
+ displayName: 'Link',
81
+ name: 'url',
82
+ type: 'string',
83
+ placeholder: 'e.g. https://github.com/n8n-io/n8n',
84
+ extractValue: {
85
+ type: 'regex',
86
+ regex: 'https:\\/\\/github.com\\/(?:[-_0-9a-zA-Z]+)\\/([-_.0-9a-zA-Z]+)',
87
+ },
88
+ validation: [
89
+ {
90
+ type: 'regex',
91
+ properties: {
92
+ regex: 'https:\\/\\/github.com\\/(?:[-_0-9a-zA-Z]+)\\/([-_.0-9a-zA-Z]+)(?:.*)',
93
+ errorMessage: 'Not a valid GitHub Repository URL',
94
+ },
95
+ },
96
+ ],
97
+ },
98
+ {
99
+ displayName: 'By Name',
100
+ name: 'name',
101
+ type: 'string',
102
+ placeholder: 'e.g. n8n',
103
+ validation: [
104
+ {
105
+ type: 'regex',
106
+ properties: {
107
+ regex: '[-_.0-9a-zA-Z]+',
108
+ errorMessage: 'Not a valid GitHub Repository Name',
109
+ },
110
+ },
111
+ ],
112
+ url: '=https://github.com/{{$parameter["owner"]}}/{{$value}}',
113
+ },
114
+ ],
115
+ displayOptions: {
116
+ hide: {
117
+ resource: ['user', 'organization'],
118
+ operation: ['getRepositories'],
119
+ },
120
+ },
121
+ };
122
+ exports.issueSelect = {
123
+ displayName: 'Issue',
124
+ name: 'issue',
125
+ type: 'resourceLocator',
126
+ default: {
127
+ mode: 'list',
128
+ value: '',
129
+ },
130
+ required: true,
131
+ modes: [
132
+ {
133
+ displayName: 'Issue',
134
+ name: 'list',
135
+ type: 'list',
136
+ placeholder: 'Select an Issue...',
137
+ typeOptions: {
138
+ searchListMethod: 'getIssues',
139
+ searchable: true,
140
+ },
141
+ },
142
+ {
143
+ displayName: 'By ID',
144
+ name: 'name',
145
+ type: 'string',
146
+ placeholder: 'e.g. 123',
147
+ url: '=https://github.com/{{$parameter.owner}}/{{$parameter.repository}}/issues/{{$value}}',
148
+ },
149
+ ],
150
+ };
151
+ //# sourceMappingURL=descriptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptions.js","sourceRoot":"","sources":["../../../../nodes/GithubIssues/shared/descriptions.ts"],"names":[],"mappings":";;;AAEa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M;YACZ,WAAW,EAAE,oBAAoB;YACjC,WAAW,EAAE;gBACZ,gBAAgB,EAAE,WAAW;gBAC7B,UAAU,EAAE,IAAI;aAChB;SACD;QACD;YACC,WAAW,EAAE,OAAO;YACpB,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,UAAU;YACvB,GAAG,EAAE,sFAAsF;SAC3F;KACD;CACD,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { IHookFunctions, IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions, IHttpRequestMethods, IDataObject } from 'n8n-workflow';
2
+ export declare function githubApiRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: IHttpRequestMethods, resource: string, qs?: IDataObject, body?: IDataObject | undefined): Promise<any>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.githubApiRequest = githubApiRequest;
4
+ async function githubApiRequest(method, resource, qs = {}, body = undefined) {
5
+ const authenticationMethod = this.getNodeParameter('authentication', 0);
6
+ const options = {
7
+ method: method,
8
+ qs,
9
+ body,
10
+ url: `https://api.github.com${resource}`,
11
+ json: true,
12
+ };
13
+ const credentialType = authenticationMethod === 'accessToken' ? 'githubIssuesApi' : 'githubIssuesOAuth2Api';
14
+ return this.helpers.httpRequestWithAuthentication.call(this, credentialType, options);
15
+ }
16
+ //# sourceMappingURL=transport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../../nodes/GithubIssues/shared/transport.ts"],"names":[],"mappings":";;AAUA,4CAqBC;AArBM,KAAK,UAAU,gBAAgB,CAErC,MAA2B,EAC3B,QAAgB,EAChB,KAAkB,EAAE,EACpB,OAAgC,SAAS;IAEzC,MAAM,oBAAoB,GAAG,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;IAExE,MAAM,OAAO,GAAwB;QACpC,MAAM,EAAE,MAAM;QACd,EAAE;QACF,IAAI;QACJ,GAAG,EAAE,yBAAyB,QAAQ,EAAE;QACxC,IAAI,EAAE,IAAI;KACV,CAAC;IAEF,MAAM,cAAc,GACnB,oBAAoB,KAAK,aAAa,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,uBAAuB,CAAC;IAEtF,OAAO,IAAI,CAAC,OAAO,CAAC,6BAA6B,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;AACvF,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare function parseLinkHeader(header?: string): {
2
+ [rel: string]: string;
3
+ };
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseLinkHeader = parseLinkHeader;
4
+ function parseLinkHeader(header) {
5
+ var _a;
6
+ const links = {};
7
+ for (const part of (_a = header === null || header === void 0 ? void 0 : header.split(',')) !== null && _a !== void 0 ? _a : []) {
8
+ const section = part.trim();
9
+ const match = section.match(/^<([^>]+)>\s*;\s*rel="?([^"]+)"?/);
10
+ if (match) {
11
+ const [, url, rel] = match;
12
+ links[rel] = url;
13
+ }
14
+ }
15
+ return links;
16
+ }
17
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../nodes/GithubIssues/shared/utils.ts"],"names":[],"mappings":";;AAAA,0CAaC;AAbD,SAAgB,eAAe,CAAC,MAAe;;IAC9C,MAAM,KAAK,GAA8B,EAAE,CAAC;IAE5C,KAAK,MAAM,IAAI,IAAI,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,GAAG,CAAC,mCAAI,EAAE,EAAE,CAAC;QAC7C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAChE,IAAI,KAAK,EAAE,CAAC;YACX,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC;YAC3B,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;QAClB,CAAC;IACF,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions, IDataObject } from 'n8n-workflow';
2
+ export declare function whazingApiRequest(this: IExecuteFunctions | ILoadOptionsFunctions | IHookFunctions, method: string, path: string, body?: IDataObject, qs?: IDataObject, uri?: string, option?: IDataObject, formData?: IDataObject): Promise<IDataObject>;
3
+ export declare function adminApiRequest(this: IExecuteFunctions | ILoadOptionsFunctions | IHookFunctions, method: string, path: string, body?: IDataObject, qs?: IDataObject): Promise<IDataObject>;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.whazingApiRequest = whazingApiRequest;
4
+ exports.adminApiRequest = adminApiRequest;
5
+ async function whazingApiRequest(method, path, body = {}, qs = {}, uri, option = {}, formData) {
6
+ const credentials = await this.getCredentials('whazingApi');
7
+ const finalBaseUrl = (credentials.baseUrl || '').trim().replace(/\/+$/, '');
8
+ const options = {
9
+ headers: {
10
+ 'Content-Type': formData ? 'multipart/form-data' : 'application/json',
11
+ },
12
+ method,
13
+ body,
14
+ qs,
15
+ formData,
16
+ url: uri || `${finalBaseUrl}${path}`,
17
+ json: true,
18
+ };
19
+ if (Object.keys(option).length !== 0) {
20
+ Object.assign(options, option);
21
+ }
22
+ if (Object.keys(body).length === 0) {
23
+ delete options.body;
24
+ }
25
+ if (!formData) {
26
+ delete options.formData;
27
+ }
28
+ return this.helpers.httpRequestWithAuthentication.call(this, 'whazingApi', options);
29
+ }
30
+ async function adminApiRequest(method, path, body = {}, qs = {}) {
31
+ const credentials = await this.getCredentials('whazingApi');
32
+ if (!credentials.adminUrl || !credentials.adminApiId) {
33
+ throw new Error('Admin API URL e Admin API ID são necessários para esta operação.');
34
+ }
35
+ let baseAdminUrl = (credentials.adminUrl || '').trim().replace(/\/+$/, '');
36
+ if (path.startsWith('/external')) {
37
+ if (baseAdminUrl.includes('/external')) {
38
+ baseAdminUrl = baseAdminUrl.split('/external')[0];
39
+ }
40
+ }
41
+ const finalUri = path.startsWith('/external')
42
+ ? `${baseAdminUrl}${path}`
43
+ : `${baseAdminUrl}/${credentials.adminApiId}${path}`;
44
+ const options = {
45
+ headers: {
46
+ 'Content-Type': 'application/json',
47
+ Authorization: `Bearer ${credentials.adminToken}`,
48
+ },
49
+ method,
50
+ body,
51
+ qs,
52
+ uri: finalUri,
53
+ json: true,
54
+ };
55
+ if (Object.keys(body).length === 0) {
56
+ delete options.body;
57
+ }
58
+ return this.helpers.httpRequest.call(this, options);
59
+ }
60
+ //# sourceMappingURL=GenericFunctions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/Whazing/GenericFunctions.ts"],"names":[],"mappings":";;AAOA,8CAkDC;AAED,0CA0CC;AA9FM,KAAK,UAAU,iBAAiB,CAEtC,MAAc,EACd,IAAY,EACZ,OAAoB,EAAE,EACtB,KAAkB,EAAE,EACpB,GAAY,EACZ,SAAsB,EAAE,EACxB,QAAsB;IAEtB,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;IAK5D,MAAM,YAAY,GAAG,CAAC,WAAW,CAAC,OAAiB,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAEtF,MAAM,OAAO,GAQT;QACH,OAAO,EAAE;YACR,cAAc,EAAE,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,kBAAkB;SACrE;QACD,MAAM;QACN,IAAI;QACJ,EAAE;QACF,QAAQ;QACR,GAAG,EAAE,GAAG,IAA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,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;QAC5C,CAAC,CAAC,GAAG,YAAY,GAAG,IAAI,EAAE;QAC1B,CAAC,CAAC,GAAG,YAAY,IAAI,WAAW,CAAC,UAAU,GAAG,IAAI,EAAE,CAAC;IAEtD,MAAM,OAAO,GAAgB;QAC5B,OAAO,EAAE;YACR,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,UAAU,WAAW,CAAC,UAAU,EAAE;SACjD;QACD,MAAM;QACN,IAAI;QACJ,EAAE;QACF,GAAG,EAAE,QAAQ;QACb,IAAI,EAAE,IAAI;KACV,CAAC;IAEF,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpC,OAAO,OAAO,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,OAAc,CAAC,CAAC;AAC5D,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class Whazing implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }