@attocash/n8n-nodes-atto 0.3.1 → 0.4.0

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.
@@ -37,7 +37,10 @@ class AttoTrigger {
37
37
  description = {
38
38
  displayName: 'Atto Trigger',
39
39
  name: 'attoTrigger',
40
- icon: 'file:atto.svg',
40
+ icon: {
41
+ light: 'file:atto.svg',
42
+ dark: 'file:atto.dark.svg',
43
+ },
41
44
  group: ['trigger'],
42
45
  version: 1,
43
46
  subtitle: '={{$parameter["event"]}}',
@@ -48,7 +51,6 @@ class AttoTrigger {
48
51
  inputs: [],
49
52
  outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
50
53
  usableAsTool: true,
51
- polling: true,
52
54
  credentials: [
53
55
  {
54
56
  name: 'attoApi',
@@ -56,37 +58,6 @@ class AttoTrigger {
56
58
  },
57
59
  ],
58
60
  properties: [
59
- {
60
- displayName: 'Poll Times',
61
- name: 'pollTimes',
62
- type: 'fixedCollection',
63
- typeOptions: {
64
- multipleValues: true,
65
- multipleValueButtonText: 'Add Poll Time',
66
- },
67
- default: {
68
- item: [{ mode: 'everyMinute' }],
69
- },
70
- options: [
71
- {
72
- name: 'item',
73
- displayName: 'Poll Time',
74
- values: [
75
- {
76
- displayName: 'Mode',
77
- name: 'mode',
78
- type: 'options',
79
- options: [
80
- { name: 'Every Minute', value: 'everyMinute' },
81
- { name: 'Every Hour', value: 'everyHour' },
82
- { name: 'Every Day', value: 'everyDay' },
83
- ],
84
- default: 'everyMinute',
85
- },
86
- ],
87
- },
88
- ],
89
- },
90
61
  {
91
62
  displayName: 'Event',
92
63
  name: 'event',
@@ -289,7 +260,7 @@ class AttoTrigger {
289
260
  },
290
261
  ],
291
262
  };
292
- async poll() {
263
+ async trigger() {
293
264
  try {
294
265
  const credentials = await this.getCredentials('attoApi');
295
266
  const event = this.getNodeParameter('event', 'receivable');
@@ -297,14 +268,16 @@ class AttoTrigger {
297
268
  name,
298
269
  this.getNodeParameter(name, TRIGGER_PARAMETER_DEFAULTS[name]),
299
270
  ]));
300
- const items = await (0, operations_1.pollAttoEvent)(this, event, parameters, credentials);
301
- return items.length > 0 ? [items.map((json) => ({ json }))] : null;
271
+ const stream = await (0, operations_1.startAttoEventStream)(this, event, parameters, credentials, (json) => this.emit([[{ json }]]));
272
+ return {
273
+ closeFunction: async () => stream.close(),
274
+ };
302
275
  }
303
276
  catch (error) {
304
- if (error instanceof n8n_workflow_1.NodeApiError) {
305
- throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
306
- }
307
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), error);
277
+ const nodeError = error instanceof n8n_workflow_1.NodeApiError || error instanceof n8n_workflow_1.NodeOperationError
278
+ ? error
279
+ : new n8n_workflow_1.NodeOperationError(this.getNode(), error);
280
+ throw nodeError;
308
281
  }
309
282
  }
310
283
  }
@@ -0,0 +1,34 @@
1
+ <svg width="57" height="57" viewBox="-2.5 -3.2 61 61" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <defs>
3
+ <clipPath id="atto-octant" clipPathUnits="userSpaceOnUse">
4
+ <polygon points="27.6,27.7 27.6,-3.6 59,-3.6 28.4,27.7" shape-rendering="crispEdges"/>
5
+ </clipPath>
6
+ <g id="atto-icon-source">
7
+ <path
8
+ d="M21.4297 3.9861C23.4076 2.0743 25.103 -0.0353635 28.0922 0.000574928C28.2262 0.00197678 28.3599 0.00764585 28.4935 0.0175863C28.6272 0.0275267 28.7603 0.0417406 28.893 0.0602196C29.0257 0.0786986 29.1576 0.101381 29.2889 0.128271C29.42 0.155161 29.5503 0.186258 29.6796 0.221559C29.8089 0.25686 29.9368 0.296236 30.0635 0.339693C30.1902 0.383151 30.3154 0.430621 30.4391 0.482108C30.5627 0.533594 30.6846 0.589036 30.8048 0.648423C30.9249 0.707683 31.0429 0.770765 31.159 0.837671C32.7774 1.7822 36.9908 6.28062 38.5792 7.86229C34.4079 7.83272 30.2366 7.82788 26.0653 7.84776C23.2254 7.84126 20.3617 7.7409 17.5254 7.84814C18.8152 6.54914 20.1166 5.26179 21.4297 3.9861Z"
9
+ fill="#FAB005"/>
10
+ <path
11
+ d="M38.5792 7.86238C40.4356 7.11914 42.313 6.96602 44.1869 7.77043C45.8957 8.50372 47.3197 9.90838 48.0063 11.6434C48.7503 13.5231 48.5173 15.2426 47.8553 17.1007C46.8475 18.3902 45.5954 19.494 44.4267 20.6341L40.2131 24.8069C40.28 23.1995 40.5893 21.5842 40.5814 19.9797C40.5749 18.641 40.0863 17.2578 39.1045 16.3217C37.0924 14.4032 33.5756 15.2676 31.0645 15.3462C32.0507 14.0348 33.3823 12.8842 34.5457 11.7223C35.8573 10.4127 37.091 8.97532 38.5792 7.86238Z"
12
+ fill="#FAB005"/>
13
+ <path
14
+ d="M27.9777 18.9814C28.5935 19.03 29.085 19.1088 29.6139 19.4548C30.5938 20.0959 34.7841 24.3605 35.603 25.4161C35.9056 25.8061 36.2828 26.3442 36.3544 26.8397C36.4682 27.625 36.2229 28.5751 35.7574 29.2136C35.1679 30.0222 30.2501 34.9461 29.4243 35.4376C28.9844 35.6993 28.4782 35.7651 27.9814 35.8348C27.2659 35.7501 26.7941 35.5945 26.2108 35.1654C25.2753 34.4772 20.8914 30.1044 20.2263 29.1415C19.8851 28.6475 19.6295 28.0744 19.5563 27.4748C19.4537 26.6356 19.9614 25.8159 20.4685 25.1896C21.2435 24.2325 25.4479 19.9982 26.3787 19.4381C26.9026 19.1227 27.3849 19.0449 27.9777 18.9814Z"
15
+ fill="#FAB005"/>
16
+ <path
17
+ d="M8.34716 16.8802C8.19634 16.4449 8.08129 16.0002 8.00201 15.5463C7.92273 15.0923 7.88024 14.635 7.87455 14.1743C7.85883 12.3034 8.67045 10.6152 9.97257 9.29585C11.2658 7.98544 12.9694 7.36301 14.7963 7.36512C15.6262 7.36588 16.6816 7.48345 17.4156 7.89808C18.5108 8.51687 19.5471 9.8009 20.4421 10.6917C21.9886 12.2259 23.5271 13.768 25.0575 15.3182C23.3841 15.2909 21.6451 14.855 19.9862 14.9917C18.6679 15.1005 17.4705 15.6879 16.6389 16.7259C14.8514 18.9575 15.514 21.8508 15.8208 24.446C14.6736 23.3965 13.6222 22.2155 12.5217 21.1152C11.1515 19.7451 9.68869 18.4282 8.44799 16.9373C8.50244 19.8088 8.45904 22.6898 8.45994 25.562C8.47461 29.5671 8.45565 33.572 8.40307 37.5767C9.45251 36.1045 10.8781 34.8882 12.1642 33.6235C13.3456 32.4616 14.488 31.2425 15.7288 30.1447C15.6533 31.5561 15.283 33.0095 15.3696 34.4189C15.4564 35.8331 16.0326 37.1926 17.1186 38.1267C19.3884 40.0786 22.1763 39.3969 24.8855 39.1823C22.5678 41.6309 20.09 44.3302 17.5785 46.5634L38.3809 46.5775C38.3304 46.3652 31.8248 40.0129 30.9923 39.206C32.4824 39.3446 34.0521 39.538 35.5464 39.4864C36.9753 39.4369 38.3459 38.9364 39.3207 37.8523C41.2673 35.6876 40.3954 32.5472 40.218 29.9426C41.6989 31.272 43.0898 32.6828 44.4908 34.0951C45.6257 35.2392 46.7861 36.3594 47.8216 37.596C47.6131 34.0876 47.7432 30.4938 47.7354 26.9764C47.7281 23.7244 47.5546 20.337 47.8553 17.1C49.3875 18.549 50.8998 20.0184 52.3923 21.5082C53.403 22.5078 54.5891 23.4745 55.3341 24.6968C55.3955 24.7954 55.4535 24.896 55.508 24.9986C55.5626 25.1012 55.6136 25.2056 55.6612 25.3118C55.7087 25.4178 55.7525 25.5253 55.7927 25.6344C55.8328 25.7435 55.8692 25.8538 55.9018 25.9653C55.9345 26.0769 55.9633 26.1894 55.9882 26.3029C56.0132 26.4164 56.0343 26.5305 56.0515 26.6455C56.0687 26.7604 56.082 26.8758 56.0915 26.9917C56.1008 27.1075 56.1062 27.2236 56.1077 27.3398C56.1429 29.6588 54.8227 31.0606 53.2936 32.582C51.4841 34.3826 49.5834 36.1315 47.9373 38.0854C48.4547 40.0213 48.3708 42.0873 47.3582 43.8544C46.4611 45.4201 44.9628 46.6582 43.2043 47.109C41.2621 47.6066 40.2151 47.1176 38.3989 46.6249C38.379 46.6523 38.3601 46.6804 38.3392 46.707C37.4645 47.8205 32.0881 53.1479 31.0068 53.817C30.824 53.9284 30.6352 54.0288 30.4406 54.1183C30.246 54.2078 30.0469 54.2855 29.8432 54.3517C29.6396 54.4178 29.4328 54.4719 29.2229 54.5138C29.0129 54.5559 28.8012 54.5855 28.5877 54.6027C25.3309 54.8644 23.3906 52.3363 21.3041 50.2786C20.0432 49.0353 18.7423 47.7985 17.3789 46.6689C16.011 47.1468 14.5807 47.3127 13.1533 46.9943C11.4564 46.6156 9.85672 45.4078 8.93884 43.9407C7.74284 42.029 7.78709 39.9326 8.27744 37.8078C6.33126 35.6406 4.03572 33.7456 2.03225 31.6205C0.790345 30.3032 -0.0848882 28.9779 0.00641064 27.0703C0.0463634 26.2358 0.280842 25.3909 0.710306 24.6714C1.41565 23.4896 2.69667 22.481 3.66851 21.5069C5.21675 19.955 6.7409 18.3726 8.34716 16.8802Z"
18
+ fill="#FAB005"/>
19
+ </g>
20
+ <g id="atto-octant-source" clip-path="url(#atto-octant)">
21
+ <use href="#atto-icon-source"/>
22
+ </g>
23
+ <g id="atto-quadrant">
24
+ <use href="#atto-octant-source"/>
25
+ <use href="#atto-octant-source" transform="matrix(0 -1 -1 0 55.3 55.3)"/>
26
+ </g>
27
+ </defs>
28
+ <g>
29
+ <use href="#atto-quadrant"/>
30
+ <use href="#atto-quadrant" transform="rotate(90 28 27.3)"/>
31
+ <use href="#atto-quadrant" transform="rotate(180 28 27.3)"/>
32
+ <use href="#atto-quadrant" transform="rotate(270 28 27.3)"/>
33
+ </g>
34
+ </svg>
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attocash/n8n-nodes-atto",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Atto cryptocurrency wallet, transaction, account, and trigger nodes for n8n, powered by Atto Commons",
5
5
  "license": "MIT",
6
6
  "keywords": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attocash/n8n-nodes-atto",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Atto cryptocurrency wallet, transaction, account, and trigger nodes for n8n, powered by Atto Commons",
5
5
  "license": "MIT",
6
6
  "keywords": [