@xentom/integration-framework 0.0.0 → 0.0.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.
@@ -9,6 +9,8 @@ export interface BaseControl<S = never> {
9
9
  description?: string;
10
10
  /**
11
11
  * The default value used when no user input is provided.
12
+ *
13
+ * @remarks `unknown`
12
14
  */
13
15
  defaultValue?: S;
14
16
  }
@@ -1,6 +1,9 @@
1
1
  import { type ControlType } from '.';
2
2
  import { type BaseControl } from './base';
3
3
  export interface ExpressionControl<S = never> extends BaseControl<S> {
4
+ /**
5
+ * @internal
6
+ */
4
7
  type: ControlType.Expression;
5
8
  /**
6
9
  * Placeholder text displayed when the input is empty.
@@ -2,10 +2,15 @@ import { type ControlType } from '.';
2
2
  import { type IntegrationOptions } from '../integration';
3
3
  import { type BaseControl } from './base';
4
4
  export interface SelectControl<S = never, Options = SelectControlOptions<S> | SelectControlOptionsCallback<S>> extends BaseControl<S> {
5
+ /**
6
+ * @internal
7
+ */
5
8
  type: ControlType.Select;
6
9
  /**
7
10
  * Defines the options available for selection.
8
11
  * Can be a static array of options or a callback function that returns options dynamically.
12
+ *
13
+ * @remarks `SelectControlOption[] | (opts: IntegrationOptions) => SelectControlOption[]`
9
14
  */
10
15
  options: Options;
11
16
  /**
@@ -18,6 +23,8 @@ export type SelectControlOptionsCallback<S = never> = (opts: IntegrationOptions)
18
23
  export interface SelectControlOption<S = never> {
19
24
  /**
20
25
  * The value associated with the option, which will be used as the pin's value.
26
+ *
27
+ * @remarks `unknown`
21
28
  */
22
29
  value: S;
23
30
  /**
@@ -1,6 +1,9 @@
1
1
  import { type ControlType } from '.';
2
2
  import { type BaseControl } from './base';
3
3
  export interface SwitchControl<S = never> extends BaseControl<S> {
4
+ /**
5
+ * @internal
6
+ */
4
7
  type: ControlType.Switch;
5
8
  }
6
9
  export type SwitchControlBuilder = (definition?: Omit<SwitchControl<boolean>, 'type'>) => SwitchControl<boolean>;
@@ -1,6 +1,9 @@
1
1
  import { type ControlType } from '.';
2
2
  import { type BaseControl } from './base';
3
3
  export interface TextControl<S = string> extends BaseControl<S> {
4
+ /**
5
+ * @internal
6
+ */
4
7
  type: ControlType.Text;
5
8
  /**
6
9
  * Specifies the syntax highlighting language used in the text control, if applicable.
package/dist/env.d.ts CHANGED
@@ -4,6 +4,8 @@ export interface Env<O = unknown> {
4
4
  /**
5
5
  * Defines the UI control used to configure the environment variable.
6
6
  * Can be a text input, a switch (boolean), or a select dropdown.
7
+ *
8
+ * @remarks `TextControl | SwitchControl | SelectControl`
7
9
  */
8
10
  control: TextControl<string> | SwitchControl<boolean> | SelectControl<string, SelectControlOptions<string>>;
9
11
  /**
@@ -17,6 +19,8 @@ export interface Env<O = unknown> {
17
19
  * ```ts
18
20
  * v.pipe(v.string(), v.startsWith('sk-'))
19
21
  * ```
22
+ *
23
+ * @remarks `StandardSchemaV1`
20
24
  */
21
25
  schema?: StandardSchemaV1<string | undefined, O>;
22
26
  }
@@ -16,6 +16,8 @@ export interface Integration<NR extends NodeRecord = NodeRecord, E extends EnvRe
16
16
  * }),
17
17
  * },
18
18
  * ```
19
+ *
20
+ * @remarks `Record<string, Node>`
19
21
  */
20
22
  nodes: NR;
21
23
  /**
@@ -36,6 +38,8 @@ export interface Integration<NR extends NodeRecord = NodeRecord, E extends EnvRe
36
38
  * }),
37
39
  * },
38
40
  * ```
41
+ *
42
+ * @remarks `Record<string, Env>`
39
43
  */
40
44
  env?: E;
41
45
  /**
@@ -8,6 +8,8 @@ export interface BaseNode<I extends BaseNodeInputs = BaseNodeInputs, O extends B
8
8
  /**
9
9
  * Category used to organize the node in a hierarchical structure.
10
10
  * Helps with grouping and filtering nodes in the UI.
11
+ *
12
+ * @remarks `{ path: string[] }`
11
13
  */
12
14
  category?: NodeCategory;
13
15
  /**
@@ -25,11 +27,15 @@ export interface BaseNode<I extends BaseNodeInputs = BaseNodeInputs, O extends B
25
27
  /**
26
28
  * Defines the input pins for the node.
27
29
  * These specify the data required for the node to run.
30
+ *
31
+ * @remarks `Record<string, DataPin>`
28
32
  */
29
33
  inputs?: I;
30
34
  /**
31
35
  * Defines the output pins for the node.
32
36
  * These represent the result or side effects of running the node.
37
+ *
38
+ * @remarks `Record<string, DataPin | ExecPin>`
33
39
  */
34
40
  outputs?: O;
35
41
  }
@@ -11,12 +11,17 @@ export type CallableNodeOutputs = PinRecord<DataPin | ExecPin>;
11
11
  * CallableNode is a type of node that can be called by other nodes.
12
12
  */
13
13
  export interface CallableNode<I extends CallableNodeInputs = CallableNodeInputs, O extends CallableNodeOutputs = CallableNodeOutputs> extends BaseNode<I, O> {
14
+ /**
15
+ * @internal
16
+ */
14
17
  type: NodeType.Callable;
15
18
  /**
16
19
  * Runs the node with the provided inputs, state, and context.
17
20
  * This method is invoked when the node is called by another node.
18
21
  *
19
22
  * @param opts - Options containing the execution context, state, inputs, variables, webhook, and next callback.
23
+ *
24
+ * @remarks `run(opts: CallableNodeRunOptions): Promise<void> | void`
20
25
  */
21
26
  run(opts: CallableNodeRunOptions<I, O>): void | Promise<void>;
22
27
  }
@@ -46,6 +51,8 @@ export interface CallableNodeRunOptions<I extends CallableNodeInputs, O extends
46
51
  /**
47
52
  * The resolved input values for the node, typically based on user configuration
48
53
  * or outputs from preceding nodes in the workflow.
54
+ *
55
+ * @remarks `Record<string, unknown>`
49
56
  */
50
57
  inputs: InferPinRecordOutput<I>;
51
58
  /**
@@ -58,6 +65,8 @@ export interface CallableNodeRunOptions<I extends CallableNodeInputs, O extends
58
65
  /**
59
66
  * Webhook utility exposing the integration's public URL.
60
67
  * Can be shared with external systems to send data back into the workflow.
68
+ *
69
+ * @remarks `{ url: string }`
61
70
  */
62
71
  webhook: Pick<Webhook, 'url'>;
63
72
  /**
@@ -80,6 +89,8 @@ export interface CallableNodeRunOptions<I extends CallableNodeInputs, O extends
80
89
  * value: Math.random(),
81
90
  * });
82
91
  * ```
92
+ *
93
+ * @remarks `NodeNextCallback`
83
94
  */
84
95
  next: NodeNextCallback<O>;
85
96
  }
@@ -11,10 +11,7 @@ export type PureNodeOutputs = PinRecord<DataPin>;
11
11
  */
12
12
  export interface PureNode<I extends PureNodeInputs = PureNodeInputs, O extends PureNodeOutputs = PureNodeOutputs> extends BaseNode<I, O> {
13
13
  /**
14
- * Identifies the node as a pure node.
15
- * Pure nodes do not mutate any external or internal state and produce outputs solely based on their inputs.
16
- * They cannot be triggered directly or independently, they must be connected to an input pin.
17
- * The `run` function is executed automatically when the node is required as part of a data flow.
14
+ * @internal
18
15
  */
19
16
  type: NodeType.Pure;
20
17
  /**
@@ -28,6 +25,8 @@ export interface PureNode<I extends PureNodeInputs = PureNodeInputs, O extends P
28
25
  * opts.outputs.result = opts.inputs.a + opts.inputs.b;
29
26
  * }
30
27
  * ```
28
+ *
29
+ * @remarks `run(opts: PureNodeRunOptions): Promise<void> | void`
31
30
  */
32
31
  run?(opts: PureNodeRunOptions<I, O>): Promise<void> | void;
33
32
  }
@@ -54,11 +53,15 @@ export interface PureNodeRunOptions<I extends PureNodeInputs = PureNodeInputs, O
54
53
  /**
55
54
  * The resolved input values for the node, typically based on user configuration
56
55
  * or outputs from preceding steps in the workflow.
56
+ *
57
+ * @remarks `Record<string, unknown>`
57
58
  */
58
59
  inputs: InferPinRecordOutput<I>;
59
60
  /**
60
61
  * The object used to assign output values from the node.
61
62
  * Each output pin should be populated within the `run` function to pass values forward in the workflow.
63
+ *
64
+ * @remarks `Record<string, unknown>`
62
65
  */
63
66
  outputs: InferPinRecordInput<O>;
64
67
  /**
@@ -71,6 +74,8 @@ export interface PureNodeRunOptions<I extends PureNodeInputs = PureNodeInputs, O
71
74
  /**
72
75
  * Webhook utility exposing the integration's public URL.
73
76
  * Can be shared with external systems to send data back into the workflow.
77
+ *
78
+ * @remarks `{ url: string }`
74
79
  */
75
80
  webhook: Pick<Webhook, 'url'>;
76
81
  }
@@ -10,6 +10,9 @@ import { type NodeType } from './index';
10
10
  export type TriggerNodeInputs = PinRecord<DataPin>;
11
11
  export type TriggerNodeOutputs = PinRecord<DataPin | ExecPin>;
12
12
  export interface TriggerNode<I extends TriggerNodeInputs = TriggerNodeInputs, O extends TriggerNodeOutputs = TriggerNodeOutputs> extends BaseNode<I, O> {
13
+ /**
14
+ * @internal
15
+ */
13
16
  type: NodeType.Trigger;
14
17
  /**
15
18
  * Registers a callback to subscribe to internal or external events.
@@ -62,6 +65,8 @@ export interface TriggerNode<I extends TriggerNodeInputs = TriggerNodeInputs, O
62
65
  * };
63
66
  * }
64
67
  * ```
68
+ *
69
+ * @remarks `subscribe(opts: TriggerSubscribeOptions): () => void`
65
70
  */
66
71
  subscribe(opts: TriggerSubscribeOptions<I, O>): TriggerSubscribeCleanup;
67
72
  }
@@ -88,6 +93,8 @@ export interface TriggerSubscribeOptions<I extends TriggerNodeInputs, O extends
88
93
  /**
89
94
  * The resolved input values for the trigger, typically based on user configuration
90
95
  * or outputs from preceding steps in the workflow.
96
+ *
97
+ * @remarks `Record<string, unknown>`
91
98
  */
92
99
  inputs: InferPinRecordOutput<I>;
93
100
  /**
@@ -117,6 +124,8 @@ export interface TriggerSubscribeOptions<I extends TriggerNodeInputs, O extends
117
124
  * value: Math.random(),
118
125
  * });
119
126
  * ```
127
+ *
128
+ * @remarks `NodeNextCallback`
120
129
  */
121
130
  next: NodeNextCallback<O, [ctx?: TriggerRunContext]>;
122
131
  }
@@ -5,6 +5,9 @@ import { type IntegrationOptions } from '../integration';
5
5
  import { type ConditionalOptional } from '../utils';
6
6
  import { type BasePin } from './base';
7
7
  export interface DataPin<Input = any, Output = Input, Optional extends boolean = boolean> extends BasePin {
8
+ /**
9
+ * @internal
10
+ */
8
11
  type: PinType.Data;
9
12
  /**
10
13
  * Validation schema compatible with the Standard Schema specification.
@@ -18,6 +21,8 @@ export interface DataPin<Input = any, Output = Input, Optional extends boolean =
18
21
  * ```ts
19
22
  * v.pipe(v.string(), v.trim())
20
23
  * ```
24
+ *
25
+ * @remarks `StandardSchemaV1 | (opts: IntegrationOptions) => StandardSchemaV1`
21
26
  */
22
27
  schema?: StandardSchemaV1<Input, Output> | ((opts: IntegrationOptions) => StandardSchemaV1<Input, Output>);
23
28
  /**
@@ -30,6 +35,8 @@ export interface DataPin<Input = any, Output = Input, Optional extends boolean =
30
35
  * label: 'Message',
31
36
  * })
32
37
  * ```
38
+ *
39
+ * @remarks `Control | false`
33
40
  */
34
41
  control?: false | Control<ConditionalOptional<Optional, Input & {}>>;
35
42
  /**
@@ -56,6 +63,8 @@ export interface DataPin<Input = any, Output = Input, Optional extends boolean =
56
63
  * },
57
64
  * ]
58
65
  * ```
66
+ *
67
+ * @remarks `DataPinExample[]`
59
68
  */
60
69
  examples?: DataPinExample<ConditionalOptional<Optional, Input & {}>>[];
61
70
  /**
@@ -67,6 +76,8 @@ export interface DataPin<Input = any, Output = Input, Optional extends boolean =
67
76
  * ```ts
68
77
  * optional: true,
69
78
  * ```
79
+ *
80
+ * @remarks `boolean`
70
81
  */
71
82
  optional?: Optional;
72
83
  }
@@ -78,6 +89,8 @@ export interface DataPinExample<I> {
78
89
  /**
79
90
  * The value of the example, which can be any valid input type for the pin.
80
91
  * This value is used to illustrate how the pin can be utilized in practice.
92
+ *
93
+ * @remarks `unknown`
81
94
  */
82
95
  value: I;
83
96
  }
@@ -90,6 +103,9 @@ export type DataPinBuilder<ParentInput = any, ParentOutput = ParentInput, Parent
90
103
  * i.pins.data().with({
91
104
  * description: 'A message to send',
92
105
  * })
106
+ * ```
107
+ *
108
+ * @remarks `DataPinBuilder`
93
109
  */
94
110
  with: DataPinBuilder<Input, Output, Optional>;
95
111
  }>;
@@ -2,6 +2,9 @@ import { type PinRecord, type PinType } from '.';
2
2
  import { type BasePin } from './base';
3
3
  import { type DataPin } from './data';
4
4
  export interface ExecPin<PR extends PinRecord<DataPin> = PinRecord<DataPin>> extends BasePin {
5
+ /**
6
+ * @internal
7
+ */
5
8
  type: PinType.Exec;
6
9
  /**
7
10
  * Optional outputs for the exec pin, defined as a set of named data pins.
@@ -44,6 +47,8 @@ export interface ExecPin<PR extends PinRecord<DataPin> = PinRecord<DataPin>> ext
44
47
  * },
45
48
  * });
46
49
  * ```
50
+ *
51
+ * @remarks `Record<string, DataPin>`
47
52
  */
48
53
  outputs?: PR;
49
54
  }
@@ -56,6 +61,9 @@ export type ExecPinBuilder<ParentPR extends PinRecord<DataPin> = PinRecord<DataP
56
61
  * i.pins.exec().with({
57
62
  * description: 'A message to send',
58
63
  * })
64
+ * ```
65
+ *
66
+ * @remarks `ExecPinBuilder`
59
67
  */
60
68
  with: ExecPinBuilder<PR>;
61
69
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xentom/integration-framework",
3
- "version": "0.0.0",
3
+ "version": "0.0.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -25,10 +25,11 @@
25
25
  "@standard-schema/spec": "^1.0.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@xentom/style-guide": "0.0.0",
29
- "eslint": "^9.31.0",
28
+ "@types/bun": "^1.2.19",
29
+ "@xentom/style-guide": "^0.0.0",
30
+ "eslint": "^9.32.0",
30
31
  "prettier": "^3.6.2",
31
- "typescript": "^5.8.3"
32
+ "typescript": "^5.9.2"
32
33
  },
33
34
  "prettier": "@xentom/style-guide/prettier"
34
35
  }