|
9 | 9 | <input type="text" id="node-input-name" /> |
10 | 10 | </div> |
11 | 11 |
|
| 12 | + <!-- Data link parameters (same as list node) --> |
| 13 | + <div class="form-row"> |
| 14 | + <label for="node-input-dataLinkName"><i class="fa fa-link"></i> Data link</label> |
| 15 | + <input type="text" id="node-input-dataLinkName" /> |
| 16 | + </div> |
| 17 | + <div class="form-row"> |
| 18 | + <label for="node-input-returnType"><i class="fa fa-filter"></i> Return type</label> |
| 19 | + <select id="node-input-returnType"> |
| 20 | + <option value="files">Files only</option> |
| 21 | + <option value="folders">Folders only</option> |
| 22 | + <option value="all">Everything</option> |
| 23 | + </select> |
| 24 | + </div> |
| 25 | + |
12 | 26 | <!-- Polling specific --> |
13 | 27 | <div class="form-row"> |
14 | 28 | <label for="node-input-pollFrequency"><i class="fa fa-clock-o"></i> Poll frequency</label> |
|
20 | 34 | <option value="days">Days</option> |
21 | 35 | </select> |
22 | 36 | </div> |
23 | | - |
24 | | - <!-- Data link parameters (same as list node) --> |
25 | 37 | <div class="form-row"> |
26 | | - <label for="node-input-dataLinkName"><i class="fa fa-link"></i> Data link name</label> |
27 | | - <input type="text" id="node-input-dataLinkName" /> |
28 | | - </div> |
29 | | - <div class="form-row"> |
30 | | - <label for="node-input-returnType"><i class="fa fa-filter"></i> Return type</label> |
31 | | - <select id="node-input-returnType"> |
32 | | - <option value="files">Files only</option> |
33 | | - <option value="folders">Folders only</option> |
34 | | - <option value="all">Everything</option> |
35 | | - </select> |
| 38 | + <label for="node-input-outputAllPolls"> |
| 39 | + <i class="fa fa-refresh" aria-hidden="true"></i> |
| 40 | + Every poll |
| 41 | + </label> |
| 42 | + <label for="node-input-outputAllPolls" style="width:70%"> |
| 43 | + <input |
| 44 | + type="checkbox" |
| 45 | + id="node-input-outputAllPolls" |
| 46 | + style="display:inline-block; width:22px; vertical-align:top;" |
| 47 | + autocomplete="off" |
| 48 | + /> |
| 49 | + Show output port |
| 50 | + </label> |
36 | 51 | </div> |
| 52 | + |
| 53 | + <!-- More specifics --> |
37 | 54 | <div class="form-row"> |
38 | 55 | <label for="node-input-basePath"><i class="fa fa-folder-open-o"></i> Base path</label> |
39 | 56 | <input type="text" id="node-input-basePath" /> |
|
66 | 83 |
|
67 | 84 | ### Inputs |
68 | 85 |
|
69 | | -: pollFrequency (string) : Poll frequency (default `15 minutes`). Can be configured in seconds, minutes, hours, or days. |
70 | 86 | : dataLinkName (string) : The name of the data explorer link. |
| 87 | +: returnType (string) : Select whether to return files, folders or everything. |
| 88 | +: pollFrequency (string) : Poll frequency (default `15 minutes`). Can be configured in seconds, minutes, hours, or days. |
| 89 | +: outputAllPolls (boolean) : Show the "every poll" output port. Emits an output file listing on every poll event, irrespective of changes (disabled by default). |
71 | 90 | : basePath (string) : Path within the data link to start browsing. Leave blank for the root. |
72 | 91 | : prefix (string) : Optional prefix filter for results (applies to folders and files) |
73 | 92 | : pattern (string) : Optional regex pattern filter for results (applies to files only) |
74 | | -: returnType (string) : Select whether to return files, folders or everything. |
75 | 93 | : maxResults (number) : Maximum number of results to return (default 100). |
| 94 | +: depth (number) : Folder recursion depth (default 0). |
76 | 95 | : workspaceId (string) : Override the workspace ID from the config node. |
77 | 96 |
|
78 | | -All inputs support msg._, flow._, global.\*, env, or JSONata expressions via the **typedInput**. |
| 97 | +All inputs support `msg`, `flow`, `global`, `env`, or JSONata expressions via the **typedInput**. |
79 | 98 |
|
80 | 99 | ### Outputs |
81 | 100 |
|
82 | | -The node has two outputs: |
| 101 | +The node has two or three outputs depending on configuration: |
83 | 102 |
|
84 | | -1. All results on every poll. |
85 | | -2. New objects since the previous poll (nothing sent if no new objects). |
| 103 | +1. **All results** (optional, disabled by default) - Emitted every poll with the full list of files. |
| 104 | +2. **New results** - Emitted only when new objects are detected since the previous poll. |
| 105 | +3. **Deleted results** - Emitted only when objects are deleted since the previous poll. |
86 | 106 |
|
87 | | -Both outputs have the following properties: |
| 107 | +All outputs have the following properties: |
88 | 108 |
|
89 | | -: payload (array) : Fle information aggregated from the API (array of objects). |
| 109 | +: payload (array) : File information aggregated from the API (array of objects). |
90 | 110 | : files (array) : File names (array of strings). |
91 | 111 |
|
92 | | -All typed-input fields are identical to the _List files_ node with the addition of **poll frequency**. |
| 112 | +The "All results" output also includes: |
| 113 | + |
| 114 | +: payload.nextPoll (string) : ISO timestamp of the next scheduled poll. |
| 115 | +: payload.pollIntervalSeconds (number) : Poll interval duration in seconds. |
| 116 | + |
93 | 117 | </script> |
94 | 118 |
|
95 | 119 | <script type="text/javascript"> |
|
104 | 128 | label: function () { |
105 | 129 | return this.name || "Poll files"; |
106 | 130 | }, |
107 | | - outputLabels: ["All objects", "Only new objects"], |
| 131 | + outputLabels: function (index) { |
| 132 | + if (this.outputAllPolls) { |
| 133 | + // 3 outputs: All, New, Deleted |
| 134 | + return ["All objects", "New objects", "Deleted objects"][index]; |
| 135 | + } |
| 136 | + // 2 outputs: New, Deleted |
| 137 | + return ["New objects", "Deleted objects"][index]; |
| 138 | + }, |
108 | 139 | defaults: { |
109 | 140 | name: { value: "" }, |
110 | 141 | seqera: { value: "", type: "seqera-config" }, |
|
128 | 159 | pollFrequency: { value: "15" }, |
129 | 160 | pollUnits: { value: "minutes" }, |
130 | 161 | returnType: { value: "files" }, |
| 162 | + outputAllPolls: { value: false }, |
131 | 163 | }, |
132 | 164 | oneditprepare: function () { |
133 | 165 | function ti(id, val, type, def = "str") { |
|
149 | 181 | $("#node-input-pollFrequency").val(this.pollFrequency || "15"); |
150 | 182 | $("#node-input-pollUnits").val(this.pollUnits || "minutes"); |
151 | 183 |
|
| 184 | + // Output all polls checkbox |
| 185 | + $("#node-input-outputAllPolls").prop("checked", this.outputAllPolls || false); |
| 186 | + |
152 | 187 | $("#node-input-returnType").val(this.returnType || "files"); |
153 | 188 |
|
154 | 189 | // Add auto-complete for datalink name when type is "str" |
|
260 | 295 | this.pollFrequency = $("#node-input-pollFrequency").val(); |
261 | 296 | this.pollUnits = $("#node-input-pollUnits").val(); |
262 | 297 |
|
| 298 | + // Save output all polls checkbox and update outputs count |
| 299 | + this.outputAllPolls = $("#node-input-outputAllPolls").prop("checked"); |
| 300 | + this.outputs = this.outputAllPolls ? 3 : 2; |
| 301 | + |
263 | 302 | this.returnType = $("#node-input-returnType").val(); |
264 | 303 | }, |
265 | 304 | }); |
|
0 commit comments