@nodetool-ai/automation-nodes 0.8.1
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.
- package/README.md +39 -0
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/file-watch-match.d.ts +59 -0
- package/dist/lib/file-watch-match.d.ts.map +1 -0
- package/dist/lib/file-watch-match.js +99 -0
- package/dist/lib/file-watch-match.js.map +1 -0
- package/dist/lib/trigger-payload.d.ts +66 -0
- package/dist/lib/trigger-payload.d.ts.map +1 -0
- package/dist/lib/trigger-payload.js +112 -0
- package/dist/lib/trigger-payload.js.map +1 -0
- package/dist/nodes/lib-browser.d.ts +27 -0
- package/dist/nodes/lib-browser.d.ts.map +1 -0
- package/dist/nodes/lib-browser.js +68 -0
- package/dist/nodes/lib-browser.js.map +1 -0
- package/dist/nodes/lib-sqlite.d.ts +22 -0
- package/dist/nodes/lib-sqlite.d.ts.map +1 -0
- package/dist/nodes/lib-sqlite.js +48 -0
- package/dist/nodes/lib-sqlite.js.map +1 -0
- package/dist/nodes/triggers.d.ts +143 -0
- package/dist/nodes/triggers.d.ts.map +1 -0
- package/dist/nodes/triggers.js +600 -0
- package/dist/nodes/triggers.js.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { BaseNode } from "@nodetool-ai/node-sdk";
|
|
2
|
+
import type { StreamingInputs, StreamingOutputs, TriggerEvent } from "@nodetool-ai/node-sdk";
|
|
3
|
+
import type { FileWatchEvent, IntervalTickEvent } from "../lib/trigger-payload.js";
|
|
4
|
+
/** A trigger's buffered run emits nothing — `emitTriggerEvent` and `genProcess` do. */
|
|
5
|
+
type NoBufferedOutputs = Record<string, never>;
|
|
6
|
+
/** Output handles WaitNode.process() emits. */
|
|
7
|
+
type WaitOutputs = {
|
|
8
|
+
data: unknown;
|
|
9
|
+
resumed_at: string;
|
|
10
|
+
waited_seconds: number;
|
|
11
|
+
};
|
|
12
|
+
export declare class WaitNode extends BaseNode {
|
|
13
|
+
static readonly nodeType = "nodetool.triggers.Wait";
|
|
14
|
+
static readonly title = "Wait";
|
|
15
|
+
static readonly description: string;
|
|
16
|
+
static readonly inlineFields: never[];
|
|
17
|
+
static readonly inputFields: string[];
|
|
18
|
+
static readonly metadataOutputTypes: {
|
|
19
|
+
data: string;
|
|
20
|
+
resumed_at: string;
|
|
21
|
+
waited_seconds: string;
|
|
22
|
+
};
|
|
23
|
+
timeout_seconds: number;
|
|
24
|
+
input: unknown;
|
|
25
|
+
process(): Promise<WaitOutputs>;
|
|
26
|
+
}
|
|
27
|
+
export declare class ManualTriggerNode extends BaseNode {
|
|
28
|
+
static readonly nodeType = "nodetool.triggers.ManualTrigger";
|
|
29
|
+
static readonly title = "Manual Trigger";
|
|
30
|
+
static readonly description: string;
|
|
31
|
+
static readonly inlineFields: string[];
|
|
32
|
+
static readonly inputFields: never[];
|
|
33
|
+
static readonly metadataOutputTypes: {
|
|
34
|
+
data: string;
|
|
35
|
+
timestamp: string;
|
|
36
|
+
source: string;
|
|
37
|
+
event_type: string;
|
|
38
|
+
};
|
|
39
|
+
static readonly isStreamingInput = true;
|
|
40
|
+
static readonly isTrigger = true;
|
|
41
|
+
max_events: number;
|
|
42
|
+
name: string;
|
|
43
|
+
timeout_seconds: number | null;
|
|
44
|
+
process(): Promise<NoBufferedOutputs>;
|
|
45
|
+
/**
|
|
46
|
+
* Wake-up entry point: a manually fired trigger input becomes one event.
|
|
47
|
+
* The payload is either the adapter envelope ({data, timestamp, source})
|
|
48
|
+
* or an arbitrary value, which is emitted whole as `data`.
|
|
49
|
+
*/
|
|
50
|
+
emitTriggerEvent(event: TriggerEvent, outputs: StreamingOutputs): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Streaming run: reads events pushed into the inbox via pushInputValue()
|
|
53
|
+
* and emits them downstream. Keeps running until EOS or max_events.
|
|
54
|
+
*/
|
|
55
|
+
run(inputs: StreamingInputs, outputs: StreamingOutputs): Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
export declare class IntervalTriggerNode extends BaseNode {
|
|
58
|
+
static readonly nodeType = "nodetool.triggers.IntervalTrigger";
|
|
59
|
+
static readonly title = "Interval Trigger";
|
|
60
|
+
static readonly description: string;
|
|
61
|
+
static readonly inlineFields: string[];
|
|
62
|
+
static readonly inputFields: never[];
|
|
63
|
+
static readonly metadataOutputTypes: {
|
|
64
|
+
tick: string;
|
|
65
|
+
elapsed_seconds: string;
|
|
66
|
+
interval_seconds: string;
|
|
67
|
+
timestamp: string;
|
|
68
|
+
source: string;
|
|
69
|
+
event_type: string;
|
|
70
|
+
};
|
|
71
|
+
static readonly isTrigger = true;
|
|
72
|
+
max_events: number;
|
|
73
|
+
interval_seconds: number;
|
|
74
|
+
initial_delay_seconds: number;
|
|
75
|
+
emit_on_start: boolean;
|
|
76
|
+
include_drift_compensation: boolean;
|
|
77
|
+
process(): Promise<NoBufferedOutputs>;
|
|
78
|
+
/**
|
|
79
|
+
* Wake-up entry point: the scheduler adapter synthesizes a tick payload
|
|
80
|
+
* ({tick, elapsed_seconds, interval_seconds, timestamp}); missing fields
|
|
81
|
+
* are synthesized here so a bare fire still yields a complete event.
|
|
82
|
+
*/
|
|
83
|
+
emitTriggerEvent(event: TriggerEvent, outputs: StreamingOutputs): Promise<void>;
|
|
84
|
+
genProcess(): AsyncGenerator<IntervalTickEvent>;
|
|
85
|
+
private _createEvent;
|
|
86
|
+
}
|
|
87
|
+
export declare class WebhookTriggerNode extends BaseNode {
|
|
88
|
+
static readonly nodeType = "nodetool.triggers.WebhookTrigger";
|
|
89
|
+
static readonly title = "Webhook Trigger";
|
|
90
|
+
static readonly description: string;
|
|
91
|
+
static readonly inlineFields: never[];
|
|
92
|
+
static readonly inputFields: never[];
|
|
93
|
+
static readonly metadataOutputTypes: {
|
|
94
|
+
body: string;
|
|
95
|
+
headers: string;
|
|
96
|
+
query: string;
|
|
97
|
+
method: string;
|
|
98
|
+
path: string;
|
|
99
|
+
timestamp: string;
|
|
100
|
+
source: string;
|
|
101
|
+
event_type: string;
|
|
102
|
+
};
|
|
103
|
+
static readonly isTrigger = true;
|
|
104
|
+
process(): Promise<NoBufferedOutputs>;
|
|
105
|
+
/**
|
|
106
|
+
* Wake-up entry point: the server webhook route captures
|
|
107
|
+
* {body, headers, query, method} (plus path/timestamp when available)
|
|
108
|
+
* into the trigger input; a non-envelope payload is treated as the body.
|
|
109
|
+
*/
|
|
110
|
+
emitTriggerEvent(event: TriggerEvent, outputs: StreamingOutputs): Promise<void>;
|
|
111
|
+
}
|
|
112
|
+
export declare class FileWatchTriggerNode extends BaseNode {
|
|
113
|
+
static readonly nodeType = "nodetool.triggers.FileWatchTrigger";
|
|
114
|
+
static readonly title = "File Watch Trigger";
|
|
115
|
+
static readonly description: string;
|
|
116
|
+
static readonly inlineFields: string[];
|
|
117
|
+
static readonly inputFields: never[];
|
|
118
|
+
static readonly metadataOutputTypes: {
|
|
119
|
+
event: string;
|
|
120
|
+
path: string;
|
|
121
|
+
dest_path: string;
|
|
122
|
+
is_directory: string;
|
|
123
|
+
timestamp: string;
|
|
124
|
+
};
|
|
125
|
+
static readonly isTrigger = true;
|
|
126
|
+
max_events: number;
|
|
127
|
+
path: string;
|
|
128
|
+
recursive: boolean;
|
|
129
|
+
patterns: string[];
|
|
130
|
+
ignore_patterns: string[];
|
|
131
|
+
events: string[];
|
|
132
|
+
debounce_seconds: number;
|
|
133
|
+
process(): Promise<NoBufferedOutputs>;
|
|
134
|
+
/**
|
|
135
|
+
* Wake-up entry point: the file-watch adapter (or the launch-time
|
|
136
|
+
* snapshot diff) delivers {event, path, dest_path, is_directory}.
|
|
137
|
+
*/
|
|
138
|
+
emitTriggerEvent(event: TriggerEvent, outputs: StreamingOutputs): Promise<void>;
|
|
139
|
+
genProcess(): AsyncGenerator<FileWatchEvent>;
|
|
140
|
+
}
|
|
141
|
+
export declare const TRIGGER_NODES: readonly [typeof WaitNode, typeof ManualTriggerNode, typeof IntervalTriggerNode, typeof WebhookTriggerNode, typeof FileWatchTriggerNode];
|
|
142
|
+
export {};
|
|
143
|
+
//# sourceMappingURL=triggers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triggers.d.ts","sourceRoot":"","sources":["../../src/nodes/triggers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAQ,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,YAAY,EACb,MAAM,uBAAuB,CAAC;AAO/B,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAYnC,uFAAuF;AACvF,KAAK,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AA4D/C,+CAA+C;AAC/C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,qBAAa,QAAS,SAAQ,QAAQ;IACpC,MAAM,CAAC,QAAQ,CAAC,QAAQ,4BAA4B;IACpD,MAAM,CAAC,QAAQ,CAAC,KAAK,UAAU;IAC/B,MAAM,CAAC,QAAQ,CAAC,WAAW,SAMmB;IAC9C,MAAM,CAAC,QAAQ,CAAC,YAAY,UAAM;IAClC,MAAM,CAAC,QAAQ,CAAC,WAAW,WAAa;IACxC,MAAM,CAAC,QAAQ,CAAC,mBAAmB;QACjC,IAAI;QACJ,UAAU;QACV,cAAc;MACd;IASM,eAAe,EAAE,MAAM,CAAC;IAQxB,KAAK,EAAE,OAAO,CAAC;IAEjB,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC,CAiBpC;CACF;AAMD,qBAAa,iBAAkB,SAAQ,QAAQ;IAC7C,MAAM,CAAC,QAAQ,CAAC,QAAQ,q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