@slflows/sdk 0.5.1 → 0.6.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.
Files changed (2) hide show
  1. package/dist/v1/index.d.ts +14 -3
  2. package/package.json +5 -5
@@ -827,8 +827,11 @@ interface AppUIComponent {
827
827
  }
828
828
  type SimpleType = "string" | "number" | "boolean" | "any";
829
829
  type SimpleTypeArray = [SimpleType];
830
+ type JsonSchemaType = "string" | "number" | "boolean" | "object" | "array" | "integer" | "null";
830
831
  interface JsonSchema {
831
- type?: string;
832
+ type?: JsonSchemaType;
833
+ const?: string | number;
834
+ title?: string;
832
835
  properties?: Record<string, JsonSchema>;
833
836
  items?: JsonSchema;
834
837
  required?: string[];
@@ -837,7 +840,7 @@ interface JsonSchema {
837
840
  oneOf?: JsonSchema[];
838
841
  description?: string;
839
842
  additionalProperties?: boolean | {
840
- type: "string" | "number" | "boolean" | "object" | "array";
843
+ type: JsonSchemaType;
841
844
  };
842
845
  }
843
846
  type Type = SimpleType | SimpleTypeArray | JsonSchema;
@@ -917,6 +920,7 @@ interface AppBlockComponentInput {
917
920
  onEvent: (input: EventInput) => Promise<void>;
918
921
  }
919
922
  interface AppBlockComponentOutput {
923
+ order?: number;
920
924
  name?: string;
921
925
  description?: string;
922
926
  default?: boolean;
@@ -995,6 +999,9 @@ interface EntityInput extends AppInput {
995
999
  /** Block (entity) instance context and configuration */
996
1000
  block: EntityContext;
997
1001
  }
1002
+ interface EntityOutput extends AppBlockComponentOutput {
1003
+ modified?: boolean;
1004
+ }
998
1005
  /**
999
1006
  * Block (entity) runtime context containing configuration and state.
1000
1007
  * Available in all block-level handlers (onEvent, onSync, onDrain, etc.).
@@ -1012,6 +1019,8 @@ interface EntityContext {
1012
1019
  lifecycle: EntityLifecycleComponent | null;
1013
1020
  /** HTTP endpoint information (null if block has no HTTP handler) */
1014
1021
  http: EntityHTTPEndpoint | null;
1022
+ /** Outputs of the block */
1023
+ outputs: Record<string, EntityOutput>;
1015
1024
  }
1016
1025
  interface EntityLifecycleComponent {
1017
1026
  status: EntityLifecycleStatus;
@@ -1052,6 +1061,7 @@ interface EventContext {
1052
1061
  };
1053
1062
  }
1054
1063
  interface BaseLifecycleCallbackOutput {
1064
+ outputUpdates?: Record<string, AppBlockComponentOutput | null>;
1055
1065
  signalUpdates?: Record<string, any>;
1056
1066
  customStatusDescription?: string | null;
1057
1067
  }
@@ -1147,4 +1157,5 @@ interface UIRequest {
1147
1157
  payload?: any;
1148
1158
  }
1149
1159
 
1150
- export { type AppBlock, type AppBlockComponentInput, type AppBlockComponentOutput, type AppBlockConfigField, type AppBlockHTTPComponent, type AppBlockSchedule, type AppBlockSignal, type AppBlockUIComponent, type AppConfigField, type AppContext, type AppHTTPComponent, type AppHTTPEndpoint, type AppInput, type AppLifecycleCallbackOutput, type AppLifecycleStatus, type AppOnCreateOutput, type AppOnHTTPRequestInput, type AppOnInternalMessageInput, type AppOnTimerInput, type AppOnTriggerInput, type AppOnUIRequestInput, type AppSchedule, type AppSchema, type AppSignal, type AppUIComponent, type EntityContext, type EntityHTTPEndpoint, type EntityInput, type EntityLifecycleCallbackOutput, type EntityLifecycleComponent, type EntityLifecycleStatus, type EntityOnHTTPRequestInput, type EntityOnInternalMessageInput, type EntityOnTimerInput, type EntityOnTriggerInput, type EntityOnUIRequestInput, type EntityView, type EntityViewType, type EventContext, type EventInput, type HTTPRequest, type JsonSchema, type ScheduleDefinition, type Type, type UIRequest, blocks, defineApp, events, getInvocationMetadata, http, kv, lifecycle, messaging, timers, ui };
1160
+ export { blocks, defineApp, events, getInvocationMetadata, http, kv, lifecycle, messaging, timers, ui };
1161
+ export type { AppBlock, AppBlockComponentInput, AppBlockComponentOutput, AppBlockConfigField, AppBlockHTTPComponent, AppBlockSchedule, AppBlockSignal, AppBlockUIComponent, AppConfigField, AppContext, AppHTTPComponent, AppHTTPEndpoint, AppInput, AppLifecycleCallbackOutput, AppLifecycleStatus, AppOnCreateOutput, AppOnHTTPRequestInput, AppOnInternalMessageInput, AppOnTimerInput, AppOnTriggerInput, AppOnUIRequestInput, AppSchedule, AppSchema, AppSignal, AppUIComponent, EntityContext, EntityHTTPEndpoint, EntityInput, EntityLifecycleCallbackOutput, EntityLifecycleComponent, EntityLifecycleStatus, EntityOnHTTPRequestInput, EntityOnInternalMessageInput, EntityOnTimerInput, EntityOnTriggerInput, EntityOnUIRequestInput, EntityOutput, EntityView, EntityViewType, EventContext, EventInput, HTTPRequest, JsonSchema, ScheduleDefinition, Type, UIRequest };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slflows/sdk",
3
- "version": "0.5.1",
3
+ "version": "0.6.1",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -9,10 +9,10 @@
9
9
  "./v1": "./dist/v1/index.d.ts"
10
10
  },
11
11
  "devDependencies": {
12
- "pkgroll": "^2.13.1",
13
- "rollup": "^4.44.1",
14
- "rollup-plugin-dts": "^6.2.1",
15
- "typescript": "^5.8.3"
12
+ "pkgroll": "^2.21.4",
13
+ "rollup": "^4.53.3",
14
+ "rollup-plugin-dts": "^6.3.0",
15
+ "typescript": "^5.9.3"
16
16
  },
17
17
  "scripts": {
18
18
  "build": "tsc && rollup -c && pkgroll --clean-dist --src types"