@xentom/integration-framework 0.0.8 → 0.0.9

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/index.d.ts CHANGED
@@ -5,5 +5,6 @@ export * from './pins';
5
5
  export * from './env';
6
6
  export * from './generic';
7
7
  export * from './integration';
8
+ export * from './kv';
8
9
  export * from './utils';
9
10
  export * from './webhook';
package/dist/index.js CHANGED
@@ -5,5 +5,6 @@ export * from './pins';
5
5
  export * from './env';
6
6
  export * from './generic';
7
7
  export * from './integration';
8
+ export * from './kv';
8
9
  export * from './utils';
9
10
  export * from './webhook';
@@ -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
@@ -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.
@@ -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>;
@@ -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.8",
4
+ "version": "0.0.9",
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.5"
51
+ },
49
52
  "imports": {
50
53
  "#src/*": "./src/*.ts"
51
54
  },