windmill-ts 0.7.0 → 0.7.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.
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-ts",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Type-safe client for Windmill",
5
5
  "main": "dist/src/index.js",
6
6
  "bin": "dist/src/index.js",
@@ -14,6 +14,7 @@ const preamble = dedent `
14
14
  };
15
15
 
16
16
  type RunFlowAsyncOptions = {
17
+ scheduledFor?: Date | null;
17
18
  detached?: boolean;
18
19
  };
19
20
 
@@ -22,14 +23,20 @@ const preamble = dedent `
22
23
  args: z.input<(typeof ${mapName})[Path]>,
23
24
  options?: RunFlowAsyncOptions,
24
25
  ) => {
25
- const { detached = false } = options ?? {};
26
+ const { scheduledFor, detached = false } = options ?? {};
26
27
  const schema = ${mapName}[flowPath];
27
28
 
28
29
  const runner = detached
29
30
  ? runDetached
30
31
  : <T extends unknown>(cb: () => Promise<T>) => cb();
31
32
 
32
- return runner(() => wmill.runFlowAsync(flowPath, schema.parse(args)));
33
+ const scheduledInSeconds = Math.ceil(
34
+ Math.max((scheduledFor?.getTime() ?? 0) - Date.now(), 0) / 1000,
35
+ );
36
+
37
+ return runner(
38
+ () => wmill.runFlowAsync(flowPath, schema.parse(args), scheduledInSeconds)
39
+ );
33
40
  };
34
41
 
35
42
  export const getFlowArgsSchema = <Path extends keyof typeof ${mapName}>(
@@ -1 +1 @@
1
- {"version":3,"file":"flows.js","sourceRoot":"","sources":["../../../src/generator/flows.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,MAAM,OAAO,GAAG,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tB,OAAO;QACP,QAAQ;KACT,CAAC,CAAC;AACL,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-ts",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Type-safe client for Windmill",
5
5
  "main": "dist/src/index.js",
6
6
  "bin": "dist/src/index.js",