@xentom/integration-framework 0.0.8 → 0.0.10
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/dist/controls/select.d.ts +23 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/integration.d.ts +2 -0
- package/dist/kv.d.ts +19 -0
- package/dist/kv.js +0 -0
- package/dist/nodes/callable.d.ts +8 -0
- package/dist/nodes/pure.d.ts +8 -0
- package/dist/nodes/trigger.d.ts +8 -0
- package/package.json +4 -1
|
@@ -27,17 +27,39 @@ export interface SelectControl<S = never, Multiple extends boolean = boolean> ex
|
|
|
27
27
|
placeholder?: string;
|
|
28
28
|
}
|
|
29
29
|
export type SelectControlOptions<S = never> = SelectControlOption<S>[];
|
|
30
|
-
export type SelectControlOptionsCallback<S = never> = (opts: SelectControlOptionsCallbackOptions) => Promise<
|
|
30
|
+
export type SelectControlOptionsCallback<S = never> = (opts: SelectControlOptionsCallbackOptions) => Promise<SelectControlOptionsWithMetadata<S>> | SelectControlOptionsWithMetadata<S>;
|
|
31
31
|
export interface SelectControlOptionsCallbackOptions extends IntegrationOptions<Auth> {
|
|
32
32
|
node: {
|
|
33
33
|
inputs: Record<string, unknown>;
|
|
34
34
|
outputs: Record<string, unknown>;
|
|
35
35
|
};
|
|
36
|
+
pagination: {
|
|
37
|
+
/**
|
|
38
|
+
* The limit of options to return.
|
|
39
|
+
*/
|
|
40
|
+
limit: number;
|
|
41
|
+
/**
|
|
42
|
+
* The cursor to use to get the next page of options.
|
|
43
|
+
*/
|
|
44
|
+
after?: string | number;
|
|
45
|
+
/**
|
|
46
|
+
* The cursor to use to get the previous page of options.
|
|
47
|
+
*/
|
|
48
|
+
before?: string | number;
|
|
49
|
+
/**
|
|
50
|
+
* The page number to use to get the next page of options.
|
|
51
|
+
*/
|
|
52
|
+
page: number;
|
|
53
|
+
};
|
|
36
54
|
/**
|
|
37
55
|
* The search query used to filter the options.
|
|
38
56
|
*/
|
|
39
57
|
search?: string;
|
|
40
58
|
}
|
|
59
|
+
export interface SelectControlOptionsWithMetadata<S = never> {
|
|
60
|
+
items: SelectControlOption<S>[];
|
|
61
|
+
hasMore: boolean;
|
|
62
|
+
}
|
|
41
63
|
export interface SelectControlOption<S = never> {
|
|
42
64
|
/**
|
|
43
65
|
* The value associated with the option, which will be used as the pin's value.
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/integration.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Auth, type AuthResponse } from './auth';
|
|
2
2
|
import { type EnvRecord, type InferEnvRecordOutput } from './env';
|
|
3
|
+
import { type KeyValueStore } from './kv';
|
|
3
4
|
import { type NodeRecord } from './nodes';
|
|
4
5
|
import { type PartialKeyValues, type Serialize } from './utils';
|
|
5
6
|
import { type Webhook } from './webhook';
|
|
@@ -114,6 +115,7 @@ export interface IntegrationOptions<A extends Auth = never, E extends Record<str
|
|
|
114
115
|
env: E;
|
|
115
116
|
state: IntegrationState;
|
|
116
117
|
webhook: Webhook;
|
|
118
|
+
kv: KeyValueStore;
|
|
117
119
|
}
|
|
118
120
|
/**
|
|
119
121
|
* In-memory state for the integration, shared across all nodes.
|
package/dist/kv.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface KeyValueStore {
|
|
2
|
+
/**
|
|
3
|
+
* Retrieves a value from the store.
|
|
4
|
+
* @param key - The key to look up.
|
|
5
|
+
* @returns The stored value, or null if the key doesn't exist.
|
|
6
|
+
*/
|
|
7
|
+
get: (key: string) => Promise<string | null>;
|
|
8
|
+
/**
|
|
9
|
+
* Stores a value under the given key, overwriting any existing value.
|
|
10
|
+
* @param key - The key to store under.
|
|
11
|
+
* @param value - The value to store.
|
|
12
|
+
*/
|
|
13
|
+
set: (key: string, value: string) => Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Removes one or more keys from the store.
|
|
16
|
+
* @param keys - The keys to delete. Non-existent keys are ignored.
|
|
17
|
+
*/
|
|
18
|
+
delete: (...keys: string[]) => Promise<void>;
|
|
19
|
+
}
|
package/dist/kv.js
ADDED
|
File without changes
|
package/dist/nodes/callable.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type NodeType } from '.';
|
|
2
2
|
import { type IntegrationState } from '../integration';
|
|
3
|
+
import { type KeyValueStore } from '../kv';
|
|
3
4
|
import { type DataPin, type ExecPin, type ExtractPinsOfType, type InferPinRecordInput, type InferPinRecordOutput, type PinRecord, type PinRecordHasPinType } from '../pins';
|
|
4
5
|
import { type HasRequiredKeys } from '../utils';
|
|
5
6
|
import { type Webhook } from '../webhook';
|
|
@@ -69,6 +70,13 @@ export interface CallableNodeRunOptions<I extends CallableNodeInputs, O extends
|
|
|
69
70
|
* @remarks `{ url: string }`
|
|
70
71
|
*/
|
|
71
72
|
webhook: Pick<Webhook, 'url'>;
|
|
73
|
+
/**
|
|
74
|
+
* Persistent key-value store for this integration.
|
|
75
|
+
*
|
|
76
|
+
* Use this to store configuration, state, or cached data that should
|
|
77
|
+
* persist across restarts and be accessible from any instance.
|
|
78
|
+
*/
|
|
79
|
+
kv: KeyValueStore;
|
|
72
80
|
/**
|
|
73
81
|
* Function used to programmatically run an output pin of the node.
|
|
74
82
|
* Calling this starts a workflow run with optional execution context and output values.
|
package/dist/nodes/pure.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type NodeType } from '.';
|
|
2
2
|
import { type IntegrationState } from '../integration';
|
|
3
|
+
import { type KeyValueStore } from '../kv';
|
|
3
4
|
import { type DataPin, type InferPinRecordInput, type InferPinRecordOutput, type PinRecord } from '../pins';
|
|
4
5
|
import { type Webhook } from '../webhook';
|
|
5
6
|
import { type BaseNode } from './base';
|
|
@@ -78,5 +79,12 @@ export interface PureNodeRunOptions<I extends PureNodeInputs = PureNodeInputs, O
|
|
|
78
79
|
* @remarks `{ url: string }`
|
|
79
80
|
*/
|
|
80
81
|
webhook: Pick<Webhook, 'url'>;
|
|
82
|
+
/**
|
|
83
|
+
* Persistent key-value store for this integration.
|
|
84
|
+
*
|
|
85
|
+
* Use this to store configuration, state, or cached data that should
|
|
86
|
+
* persist across restarts and be accessible from any instance.
|
|
87
|
+
*/
|
|
88
|
+
kv: KeyValueStore;
|
|
81
89
|
}
|
|
82
90
|
export type PureNodeBuilder = <I extends PureNodeInputs, O extends PureNodeOutputs>(definition: Omit<PureNode<I, O>, 'type'>) => PureNode<I, O>;
|
package/dist/nodes/trigger.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type IntegrationState } from '../integration';
|
|
2
|
+
import { type KeyValueStore } from '../kv';
|
|
2
3
|
import { type DataPin, type ExecPin, type InferPinRecordOutput, type PinRecord } from '../pins';
|
|
3
4
|
import { type Webhook } from '../webhook';
|
|
4
5
|
import { type BaseNode } from './base';
|
|
@@ -104,6 +105,13 @@ export interface TriggerSubscribeOptions<I extends TriggerNodeInputs, O extends
|
|
|
104
105
|
* during execution or generation.
|
|
105
106
|
*/
|
|
106
107
|
variables: Record<string, unknown>;
|
|
108
|
+
/**
|
|
109
|
+
* Persistent key-value store for this integration.
|
|
110
|
+
*
|
|
111
|
+
* Use this to store configuration, state, or cached data that should
|
|
112
|
+
* persist across restarts and be accessible from any instance.
|
|
113
|
+
*/
|
|
114
|
+
kv: KeyValueStore;
|
|
107
115
|
/**
|
|
108
116
|
* Function used to programmatically run an output pin of the trigger.
|
|
109
117
|
* Calling this starts a workflow run with optional execution context and output values.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xentom/integration-framework",
|
|
3
3
|
"description": "A type-safe, declarative framework for building composable workflow integrations using nodes, pins, and rich controls.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.10",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://xentom.com",
|
|
7
7
|
"author": {
|
|
@@ -46,6 +46,9 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"xentom": ">=0.0.6"
|
|
51
|
+
},
|
|
49
52
|
"imports": {
|
|
50
53
|
"#src/*": "./src/*.ts"
|
|
51
54
|
},
|