@attocash/n8n-nodes-atto 0.3.2 → 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.
@@ -51,7 +51,6 @@ class AttoTrigger {
51
51
  inputs: [],
52
52
  outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
53
53
  usableAsTool: true,
54
- polling: true,
55
54
  credentials: [
56
55
  {
57
56
  name: 'attoApi',
@@ -59,37 +58,6 @@ class AttoTrigger {
59
58
  },
60
59
  ],
61
60
  properties: [
62
- {
63
- displayName: 'Poll Times',
64
- name: 'pollTimes',
65
- type: 'fixedCollection',
66
- typeOptions: {
67
- multipleValues: true,
68
- multipleValueButtonText: 'Add Poll Time',
69
- },
70
- default: {
71
- item: [{ mode: 'everyMinute' }],
72
- },
73
- options: [
74
- {
75
- name: 'item',
76
- displayName: 'Poll Time',
77
- values: [
78
- {
79
- displayName: 'Mode',
80
- name: 'mode',
81
- type: 'options',
82
- options: [
83
- { name: 'Every Minute', value: 'everyMinute' },
84
- { name: 'Every Hour', value: 'everyHour' },
85
- { name: 'Every Day', value: 'everyDay' },
86
- ],
87
- default: 'everyMinute',
88
- },
89
- ],
90
- },
91
- ],
92
- },
93
61
  {
94
62
  displayName: 'Event',
95
63
  name: 'event',
@@ -292,7 +260,7 @@ class AttoTrigger {
292
260
  },
293
261
  ],
294
262
  };
295
- async poll() {
263
+ async trigger() {
296
264
  try {
297
265
  const credentials = await this.getCredentials('attoApi');
298
266
  const event = this.getNodeParameter('event', 'receivable');
@@ -300,8 +268,10 @@ class AttoTrigger {
300
268
  name,
301
269
  this.getNodeParameter(name, TRIGGER_PARAMETER_DEFAULTS[name]),
302
270
  ]));
303
- const items = await (0, operations_1.pollAttoEvent)(this, event, parameters, credentials);
304
- 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
+ };
305
275
  }
306
276
  catch (error) {
307
277
  const nodeError = error instanceof n8n_workflow_1.NodeApiError || error instanceof n8n_workflow_1.NodeOperationError
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attocash/n8n-nodes-atto",
3
- "version": "0.3.2",
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.2",
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": [