@slflows/sdk 0.1.1 → 0.3.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 +25 -12
  2. package/package.json +1 -1
@@ -587,7 +587,8 @@ declare const http: {
587
587
  *
588
588
  * onSync: async (input) => {
589
589
  * // Create approval prompt if needed
590
- * const promptId = await lifecycle.prompt.create(
590
+ * await lifecycle.prompt.create(
591
+ * "production-deployment-approval",
591
592
  * "Please approve production deployment",
592
593
  * {
593
594
  * redirect: {
@@ -609,8 +610,8 @@ declare const lifecycle: {
609
610
  sync: () => Promise<void>;
610
611
  proceed: () => Promise<void>;
611
612
  prompt: {
612
- create: (description: string, options: PromptOptions) => Promise<string>;
613
- delete: (promptId: string) => Promise<void>;
613
+ create: (key: string, description: string, options: PromptOptions) => Promise<void>;
614
+ delete: (promptKey: string) => Promise<void>;
614
615
  };
615
616
  };
616
617
  /**
@@ -632,7 +633,7 @@ declare const timers: {
632
633
  set: (delaySeconds: number, options: {
633
634
  inputPayload?: unknown;
634
635
  pendingEventId?: string;
635
- promptId?: string;
636
+ promptKey?: string;
636
637
  description?: string;
637
638
  }) => Promise<string>;
638
639
  unset: (id: string) => Promise<void>;
@@ -647,7 +648,7 @@ declare const timers: {
647
648
  app: {
648
649
  set: (delaySeconds: number, options: {
649
650
  inputPayload?: unknown;
650
- promptId?: string;
651
+ promptKey?: string;
651
652
  description?: string;
652
653
  }) => Promise<string>;
653
654
  unset: (id: string) => Promise<void>;
@@ -958,6 +959,8 @@ interface AppContext {
958
959
  config: Record<string, any>;
959
960
  /** Current status of the app installation */
960
961
  status: "draft" | "in_progress" | "ready" | "failed" | "draining" | "draining_failed" | "drained";
962
+ /** Currently active prompts for this app */
963
+ prompts: Record<string, {}>;
961
964
  /** HTTP endpoint information for this app */
962
965
  http: AppHTTPEndpoint;
963
966
  /** URL for managing this app installation */
@@ -1002,7 +1005,7 @@ interface EntityLifecycleComponent {
1002
1005
  status: EntityLifecycleStatus;
1003
1006
  signals: Record<string, any> | null;
1004
1007
  }
1005
- type EntityLifecycleStatus = "draft" | "in_progress" | "ready" | "drifted" | "failed" | "draining" | "draining_failed" | "drained";
1008
+ type EntityLifecycleStatus = "draft" | "in_progress" | "ready" | "failed" | "draining" | "draining_failed" | "drained";
1006
1009
  interface EntityHTTPEndpoint {
1007
1010
  url: string;
1008
1011
  }
@@ -1034,18 +1037,28 @@ interface EventContext {
1034
1037
  outputKey: string;
1035
1038
  };
1036
1039
  }
1037
- interface EntityLifecycleCallbackOutput {
1040
+ interface BaseLifecycleCallbackOutput {
1038
1041
  signalUpdates?: Record<string, any>;
1039
- newStatus?: EntityLifecycleStatus;
1040
1042
  customStatusDescription?: string | null;
1043
+ }
1044
+ interface EntityNonSchedulableLifecycleCallbackOutput extends BaseLifecycleCallbackOutput {
1045
+ newStatus: Exclude<EntityLifecycleStatus, "in_progress" | "draining">;
1046
+ nextScheduleDelay?: never;
1047
+ }
1048
+ interface EntitySchedulableLifecycleCallbackOutput extends BaseLifecycleCallbackOutput {
1049
+ newStatus: "in_progress" | "draining";
1041
1050
  nextScheduleDelay?: number;
1042
1051
  }
1043
- interface AppLifecycleCallbackOutput {
1044
- signalUpdates?: Record<string, any>;
1045
- newStatus?: AppLifecycleStatus;
1046
- customStatusDescription?: string | null;
1052
+ type EntityLifecycleCallbackOutput = EntityNonSchedulableLifecycleCallbackOutput | EntitySchedulableLifecycleCallbackOutput;
1053
+ interface AppNonSchedulableLifecycleCallbackOutput extends BaseLifecycleCallbackOutput {
1054
+ newStatus: Exclude<AppLifecycleStatus, "in_progress" | "draining">;
1055
+ nextScheduleDelay?: never;
1056
+ }
1057
+ interface AppSchedulableLifecycleCallbackOutput extends BaseLifecycleCallbackOutput {
1058
+ newStatus: "in_progress" | "draining";
1047
1059
  nextScheduleDelay?: number;
1048
1060
  }
1061
+ type AppLifecycleCallbackOutput = AppNonSchedulableLifecycleCallbackOutput | AppSchedulableLifecycleCallbackOutput;
1049
1062
  type AppLifecycleStatus = "draft" | "in_progress" | "ready" | "failed" | "draining" | "draining_failed" | "drained";
1050
1063
  interface AppOnCreateOutput {
1051
1064
  ok?: {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slflows/sdk",
3
- "version": "0.1.1",
3
+ "version": "0.3.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],