@slflows/sdk 0.5.0 → 0.6.0

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 +23 -3
  2. package/package.json +1 -1
@@ -815,14 +815,21 @@ interface AppSchema {
815
815
  * Called when a timer created with timers.app.set() expires.
816
816
  */
817
817
  onTimer?: (input: AppOnTimerInput) => Promise<void>;
818
+ /**
819
+ * Skip confirmation step and automatically confirm the app installation.
820
+ * Useful for apps that don't require any configuration.
821
+ * Defaults to false.
822
+ */
823
+ autoconfirm?: boolean;
818
824
  }
819
825
  interface AppUIComponent {
820
826
  onRequest: (input: AppOnUIRequestInput) => Promise<any>;
821
827
  }
822
828
  type SimpleType = "string" | "number" | "boolean" | "any";
823
829
  type SimpleTypeArray = [SimpleType];
830
+ type JsonSchemaType = "string" | "number" | "boolean" | "object" | "array" | "integer" | "null";
824
831
  interface JsonSchema {
825
- type?: string;
832
+ type?: JsonSchemaType;
826
833
  properties?: Record<string, JsonSchema>;
827
834
  items?: JsonSchema;
828
835
  required?: string[];
@@ -831,7 +838,7 @@ interface JsonSchema {
831
838
  oneOf?: JsonSchema[];
832
839
  description?: string;
833
840
  additionalProperties?: boolean | {
834
- type: "string" | "number" | "boolean" | "object" | "array";
841
+ type: JsonSchemaType;
835
842
  };
836
843
  }
837
844
  type Type = SimpleType | SimpleTypeArray | JsonSchema;
@@ -887,6 +894,12 @@ interface AppBlock {
887
894
  ui?: AppBlockUIComponent;
888
895
  schedules?: Record<string, AppBlockSchedule>;
889
896
  onTimer?: (input: EntityOnTimerInput) => Promise<void>;
897
+ /**
898
+ * Skip confirmation step and automatically confirm the block lifecycle.
899
+ * Useful for blocks that don't require any configuration before sync.
900
+ * Defaults to false.
901
+ */
902
+ autoconfirm?: boolean;
890
903
  }
891
904
  interface AppBlockConfigField {
892
905
  name: string;
@@ -905,6 +918,7 @@ interface AppBlockComponentInput {
905
918
  onEvent: (input: EventInput) => Promise<void>;
906
919
  }
907
920
  interface AppBlockComponentOutput {
921
+ order?: number;
908
922
  name?: string;
909
923
  description?: string;
910
924
  default?: boolean;
@@ -983,6 +997,9 @@ interface EntityInput extends AppInput {
983
997
  /** Block (entity) instance context and configuration */
984
998
  block: EntityContext;
985
999
  }
1000
+ interface EntityOutput extends AppBlockComponentOutput {
1001
+ modified?: boolean;
1002
+ }
986
1003
  /**
987
1004
  * Block (entity) runtime context containing configuration and state.
988
1005
  * Available in all block-level handlers (onEvent, onSync, onDrain, etc.).
@@ -1000,6 +1017,8 @@ interface EntityContext {
1000
1017
  lifecycle: EntityLifecycleComponent | null;
1001
1018
  /** HTTP endpoint information (null if block has no HTTP handler) */
1002
1019
  http: EntityHTTPEndpoint | null;
1020
+ /** Outputs of the block */
1021
+ outputs: Record<string, EntityOutput>;
1003
1022
  }
1004
1023
  interface EntityLifecycleComponent {
1005
1024
  status: EntityLifecycleStatus;
@@ -1040,6 +1059,7 @@ interface EventContext {
1040
1059
  };
1041
1060
  }
1042
1061
  interface BaseLifecycleCallbackOutput {
1062
+ outputUpdates?: Record<string, AppBlockComponentOutput | null>;
1043
1063
  signalUpdates?: Record<string, any>;
1044
1064
  customStatusDescription?: string | null;
1045
1065
  }
@@ -1135,4 +1155,4 @@ interface UIRequest {
1135
1155
  payload?: any;
1136
1156
  }
1137
1157
 
1138
- 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 };
1158
+ 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 EntityOutput, 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slflows/sdk",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],