@xentom/integration-framework 0.0.13 → 0.0.17

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.
@@ -1,6 +1,6 @@
1
1
  import { type StandardSchemaV1 } from '@standard-schema/spec';
2
- import { type AuthType } from '.';
3
2
  import { type TextControl } from '../controls';
3
+ import { type AuthType } from '.';
4
4
  export interface BasicAuth {
5
5
  type: AuthType.Basic;
6
6
  username?: {
@@ -1,5 +1,5 @@
1
- import { type AuthType } from '.';
2
1
  import { type IntegrationOptions } from '../integration';
2
+ import { type AuthType } from '.';
3
3
  export declare enum OAuth2GrantType {
4
4
  AuthorizationCode = "authorization_code",
5
5
  ClientCredentials = "client_credentials"
@@ -1,6 +1,6 @@
1
1
  import { type StandardSchemaV1 } from '@standard-schema/spec';
2
- import { type AuthType } from '.';
3
2
  import { type TextControl } from '../controls';
3
+ import { type AuthType } from '.';
4
4
  export interface TokenAuth {
5
5
  type: AuthType.Token;
6
6
  /**
@@ -1,6 +1,6 @@
1
- import { type ControlType } from '.';
2
1
  import { type Auth } from '../auth';
3
2
  import { type IntegrationOptions } from '../integration';
3
+ import { type ControlType } from '.';
4
4
  import { type BaseControl } from './base';
5
5
  type ArrayElementType<T> = T extends readonly (infer U)[] ? U : T;
6
6
  export interface SelectControl<S = never, Multiple extends boolean = boolean> extends BaseControl<S> {
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  export * from './auth';
2
2
  export * from './controls';
3
- export * from './nodes';
4
- export * from './pins';
5
3
  export * from './env';
6
4
  export * from './generic';
7
5
  export * from './integration';
8
6
  export * from './kv';
7
+ export * from './nodes';
8
+ export * from './pins';
9
9
  export * from './utils';
10
10
  export * from './webhook';
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  export * from './auth';
2
2
  export * from './controls';
3
- export * from './nodes';
4
- export * from './pins';
5
3
  export * from './env';
6
4
  export * from './generic';
7
5
  export * from './integration';
8
6
  export * from './kv';
7
+ export * from './nodes';
8
+ export * from './pins';
9
9
  export * from './utils';
10
10
  export * from './webhook';
@@ -1,9 +1,9 @@
1
- import { type NodeType } from '.';
2
1
  import { type IntegrationState } from '../integration';
3
2
  import { type KeyValueStore } from '../kv';
4
3
  import { type DataPin, type ExecPin, type ExtractPinsOfType, type InferPinRecordInput, type InferPinRecordOutput, type PinRecord, type PinRecordHasPinType } from '../pins';
5
4
  import { type HasRequiredKeys } from '../utils';
6
5
  import { type Webhook } from '../webhook';
6
+ import { type NodeType } from '.';
7
7
  import { type BaseNode } from './base';
8
8
  import { type TriggerRunContext } from './trigger';
9
9
  export type CallableNodeInputs = PinRecord<DataPin>;
@@ -1,8 +1,8 @@
1
- import { type NodeType } from '.';
2
1
  import { type IntegrationState } from '../integration';
3
2
  import { type KeyValueStore } from '../kv';
4
3
  import { type DataPin, type InferPinRecordInput, type InferPinRecordOutput, type PinRecord } from '../pins';
5
4
  import { type Webhook } from '../webhook';
5
+ import { type NodeType } from '.';
6
6
  import { type BaseNode } from './base';
7
7
  import { type TriggerRunContext } from './trigger';
8
8
  export type PureNodeInputs = PinRecord<DataPin>;
@@ -112,6 +112,23 @@ export interface TriggerSubscribeOptions<I extends TriggerNodeInputs, O extends
112
112
  * persist across restarts and be accessible from any instance.
113
113
  */
114
114
  kv: KeyValueStore;
115
+ /**
116
+ * Workflow-related utilities and metadata.
117
+ *
118
+ * Provides access to workflow lifecycle information and hooks
119
+ * that allow the integration to react to workflow behavior.
120
+ */
121
+ workflow: {
122
+ /**
123
+ * Subscribe to workflow lifecycle events (e.g. start).
124
+ *
125
+ * Use this to run initialization logic when a workflow starts
126
+ * or respond to other lifecycle state changes.
127
+ *
128
+ * Returns an unsubscribe function that removes the listener.
129
+ */
130
+ on<T extends keyof WorkflowEventMap>(type: T, callback: (...args: WorkflowEventMap[T]) => void): () => void;
131
+ };
115
132
  /**
116
133
  * Function used to programmatically run an output pin of the trigger.
117
134
  * Calling this starts a workflow run with optional execution context and output values.
@@ -135,7 +152,25 @@ export interface TriggerSubscribeOptions<I extends TriggerNodeInputs, O extends
135
152
  *
136
153
  * @remarks `NodeNextCallback`
137
154
  */
138
- next: NodeNextCallback<O, [ctx?: TriggerRunContext]>;
155
+ next: NodeNextCallback<O, [options?: TriggerNextOptions]>;
156
+ }
157
+ export type WorkflowEventMap = {
158
+ start: [];
159
+ };
160
+ export interface TriggerNextOptions {
161
+ /**
162
+ * Optional context object to pass custom data to integration nodes.
163
+ * This data will be available throughout the trigger execution and can be
164
+ * accessed by any integration node in the workflow.
165
+ */
166
+ ctx?: TriggerRunContext;
167
+ /**
168
+ * Optional identifier to prevent duplicate executions of the same trigger.
169
+ * If a trigger with the same deduplicationId is already queued or recently
170
+ * executed, this run will be skipped. Useful for ensuring idempotency when
171
+ * the same event may be received multiple times.
172
+ */
173
+ deduplicationId?: string;
139
174
  }
140
175
  export type TriggerRunContext = Record<string, any>;
141
176
  export type TriggerNodeBuilder = <I extends TriggerNodeInputs, O extends TriggerNodeOutputs>(definition: Omit<TriggerNode<I, O>, 'type'>) => TriggerNode<I, O>;
@@ -1,5 +1,5 @@
1
- import { type Node, type NodeRecord } from '.';
2
1
  import { type InferPinRecordInput, type InferPinRecordOutput, type PinRecord } from '../pins';
2
+ import { type Node, type NodeRecord } from '.';
3
3
  export declare const DefaultExecPinName = "__exec";
4
4
  export declare const DefaultErrorPinName = "__error";
5
5
  export type InferNodeRecordOutput<R extends NodeRecord> = {
@@ -1,9 +1,9 @@
1
1
  import { type StandardSchemaV1 } from '@standard-schema/spec';
2
- import { type PinType } from '.';
3
2
  import { type Auth } from '../auth';
4
3
  import { type Control } from '../controls';
5
4
  import { type IntegrationOptions } from '../integration';
6
5
  import { type ConditionalOptional } from '../utils';
6
+ import { type PinType } from '.';
7
7
  import { type BasePin } from './base';
8
8
  export interface DataPin<Input = any, Output = Input, Optional extends boolean = boolean, MultiSelect extends boolean = boolean> extends BasePin {
9
9
  /**
package/dist/utils.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /** biome-ignore-all lint/complexity/noBannedTypes: `Function` here is intentional for broad type acceptance in this API layer. */
1
2
  import { type StandardSchemaV1 } from '@standard-schema/spec';
2
3
  export type HasRequiredKeys<T> = keyof T extends never ? false : {
3
4
  [K in keyof T]-?: undefined extends T[K] ? false : true;
package/dist/utils.js CHANGED
@@ -1 +1 @@
1
- /* eslint-disable @typescript-eslint/no-unsafe-function-type */
1
+ /** biome-ignore-all lint/complexity/noBannedTypes: `Function` here is intentional for broad type acceptance in this API layer. */
package/dist/webhook.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /** biome-ignore-all lint/suspicious/noConfusingVoidType: This is a valid use case for void return type */
1
2
  export interface Webhook {
2
3
  /**
3
4
  * The external URL that an external service can call to trigger the webhook handler.
package/dist/webhook.js CHANGED
@@ -0,0 +1 @@
1
+ /** biome-ignore-all lint/suspicious/noConfusingVoidType: This is a valid use case for void return type */
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.13",
4
+ "version": "0.0.17",
5
5
  "license": "MIT",
6
6
  "homepage": "https://xentom.com",
7
7
  "author": {
@@ -32,12 +32,12 @@
32
32
  "main": "./dist/index.js",
33
33
  "types": "./dist/index.d.ts",
34
34
  "scripts": {
35
- "lint": "eslint",
36
- "format": "prettier --check . --ignore-path ../../.gitignore",
35
+ "lint": "biome lint",
36
+ "format": "biome format",
37
37
  "typecheck": "tsc --noEmit",
38
38
  "clean": "git clean -xdf .cache .turbo node_modules dist",
39
- "build": "tsc",
40
- "prepack": "bun run build"
39
+ "prepare": "bun run build",
40
+ "build": "tsc"
41
41
  },
42
42
  "sideEffects": false,
43
43
  "files": [
@@ -54,14 +54,11 @@
54
54
  "#src/*": "./src/*.ts"
55
55
  },
56
56
  "dependencies": {
57
- "@standard-schema/spec": "^1.0.0"
57
+ "@standard-schema/spec": "^1.1.0"
58
58
  },
59
59
  "devDependencies": {
60
- "@types/bun": "^1.3.1",
61
60
  "@xentom/style-guide": "^0.0.0",
62
- "eslint": "^9.39.1",
63
- "prettier": "^3.6.2",
61
+ "bun-types": "^1.3.6",
64
62
  "typescript": "^5.9.3"
65
- },
66
- "prettier": "@xentom/style-guide/prettier"
67
- }
63
+ }
64
+ }