windmill-client 1.510.1 → 1.512.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.
package/dist/client.d.ts CHANGED
@@ -24,13 +24,23 @@ export declare function getResource(path?: string, undefinedIfEmpty?: boolean):
24
24
  * @returns root job id
25
25
  */
26
26
  export declare function getRootJobId(jobId?: string): Promise<string>;
27
+ /**
28
+ * @deprecated Use runScriptByPath or runScriptByHash instead
29
+ */
27
30
  export declare function runScript(path?: string | null, hash_?: string | null, args?: Record<string, any> | null, verbose?: boolean): Promise<any>;
31
+ export declare function runScriptByPath(path: string, args?: Record<string, any> | null, verbose?: boolean): Promise<any>;
32
+ export declare function runScriptByHash(hash_: string, args?: Record<string, any> | null, verbose?: boolean): Promise<any>;
28
33
  export declare function runFlow(path?: string | null, args?: Record<string, any> | null, verbose?: boolean): Promise<any>;
29
34
  export declare function waitJob(jobId: string, verbose?: boolean): Promise<any>;
30
35
  export declare function getResult(jobId: string): Promise<any>;
31
36
  export declare function getResultMaybe(jobId: string): Promise<any>;
32
37
  export declare function task<P, T>(f: (_: P) => T): (_: P) => Promise<T>;
38
+ /**
39
+ * @deprecated Use runScriptByPathAsync or runScriptByHashAsync instead
40
+ */
33
41
  export declare function runScriptAsync(path: string | null, hash_: string | null, args: Record<string, any> | null, scheduledInSeconds?: number | null): Promise<string>;
42
+ export declare function runScriptByPathAsync(path: string, args?: Record<string, any> | null, scheduledInSeconds?: number | null): Promise<string>;
43
+ export declare function runScriptByHashAsync(hash_: string, args?: Record<string, any> | null, scheduledInSeconds?: number | null): Promise<string>;
34
44
  export declare function runFlowAsync(path: string | null, args: Record<string, any> | null, scheduledInSeconds?: number | null, doNotTrackInParent?: boolean): Promise<string>;
35
45
  /**
36
46
  * Resolve a resource value in case the default value was picked because the input payload was undefined
package/dist/client.js CHANGED
@@ -15,12 +15,16 @@ exports.getWorkspace = getWorkspace;
15
15
  exports.getResource = getResource;
16
16
  exports.getRootJobId = getRootJobId;
17
17
  exports.runScript = runScript;
18
+ exports.runScriptByPath = runScriptByPath;
19
+ exports.runScriptByHash = runScriptByHash;
18
20
  exports.runFlow = runFlow;
19
21
  exports.waitJob = waitJob;
20
22
  exports.getResult = getResult;
21
23
  exports.getResultMaybe = getResultMaybe;
22
24
  exports.task = task;
23
25
  exports.runScriptAsync = runScriptAsync;
26
+ exports.runScriptByPathAsync = runScriptByPathAsync;
27
+ exports.runScriptByHashAsync = runScriptByHashAsync;
24
28
  exports.runFlowAsync = runFlowAsync;
25
29
  exports.resolveDefaultResource = resolveDefaultResource;
26
30
  exports.getStatePath = getStatePath;
@@ -151,16 +155,43 @@ function getRootJobId(jobId) {
151
155
  return yield index_1.JobService.getRootJobId({ workspace, id: jobId });
152
156
  });
153
157
  }
158
+ /**
159
+ * @deprecated Use runScriptByPath or runScriptByHash instead
160
+ */
154
161
  function runScript() {
162
+ return __awaiter(this, arguments, void 0, function* (path = null, hash_ = null, args = null, verbose = false) {
163
+ console.warn('runScript is deprecated. Use runScriptByPath or runScriptByHash instead.');
164
+ if (path && hash_) {
165
+ throw new Error("path and hash_ are mutually exclusive");
166
+ }
167
+ return _runScriptInternal(path, hash_, args, verbose);
168
+ });
169
+ }
170
+ function _runScriptInternal() {
155
171
  return __awaiter(this, arguments, void 0, function* (path = null, hash_ = null, args = null, verbose = false) {
156
172
  args = args || {};
157
173
  if (verbose) {
158
- console.info(`running \`${path}\` synchronously with args:`, args);
174
+ if (path) {
175
+ console.info(`running \`${path}\` synchronously with args:`, args);
176
+ }
177
+ else if (hash_) {
178
+ console.info(`running script with hash \`${hash_}\` synchronously with args:`, args);
179
+ }
159
180
  }
160
- const jobId = yield runScriptAsync(path, hash_, args);
181
+ const jobId = yield _runScriptAsyncInternal(path, hash_, args);
161
182
  return yield waitJob(jobId, verbose);
162
183
  });
163
184
  }
185
+ function runScriptByPath(path_1) {
186
+ return __awaiter(this, arguments, void 0, function* (path, args = null, verbose = false) {
187
+ return _runScriptInternal(path, null, args, verbose);
188
+ });
189
+ }
190
+ function runScriptByHash(hash_1) {
191
+ return __awaiter(this, arguments, void 0, function* (hash_, args = null, verbose = false) {
192
+ return _runScriptInternal(null, hash_, args, verbose);
193
+ });
194
+ }
164
195
  function runFlow() {
165
196
  return __awaiter(this, arguments, void 0, function* (path = null, args = null, verbose = false) {
166
197
  args = args || {};
@@ -242,12 +273,22 @@ function task(f) {
242
273
  return r;
243
274
  });
244
275
  }
276
+ /**
277
+ * @deprecated Use runScriptByPathAsync or runScriptByHashAsync instead
278
+ */
245
279
  function runScriptAsync(path_1, hash_1, args_1) {
246
280
  return __awaiter(this, arguments, void 0, function* (path, hash_, args, scheduledInSeconds = null) {
281
+ console.warn('runScriptAsync is deprecated. Use runScriptByPathAsync or runScriptByHashAsync instead.');
247
282
  // Create a script job and return its job id.
248
283
  if (path && hash_) {
249
284
  throw new Error("path and hash_ are mutually exclusive");
250
285
  }
286
+ return _runScriptAsyncInternal(path, hash_, args, scheduledInSeconds);
287
+ });
288
+ }
289
+ function _runScriptAsyncInternal() {
290
+ return __awaiter(this, arguments, void 0, function* (path = null, hash_ = null, args = null, scheduledInSeconds = null) {
291
+ // Create a script job and return its job id.
251
292
  args = args || {};
252
293
  const params = {};
253
294
  if (scheduledInSeconds) {
@@ -283,6 +324,16 @@ function runScriptAsync(path_1, hash_1, args_1) {
283
324
  }).then((res) => res.text());
284
325
  });
285
326
  }
327
+ function runScriptByPathAsync(path_1) {
328
+ return __awaiter(this, arguments, void 0, function* (path, args = null, scheduledInSeconds = null) {
329
+ return _runScriptAsyncInternal(path, null, args, scheduledInSeconds);
330
+ });
331
+ }
332
+ function runScriptByHashAsync(hash_1) {
333
+ return __awaiter(this, arguments, void 0, function* (hash_, args = null, scheduledInSeconds = null) {
334
+ return _runScriptAsyncInternal(null, hash_, args, scheduledInSeconds);
335
+ });
336
+ }
286
337
  function runFlowAsync(path_1, args_1) {
287
338
  return __awaiter(this, arguments, void 0, function* (path, args, scheduledInSeconds = null,
288
339
  // can only be set to false if this the job will be fully await and not concurrent with any other job
@@ -39,7 +39,7 @@ exports.OpenAPI = {
39
39
  PASSWORD: undefined,
40
40
  TOKEN: getEnv("WM_TOKEN"),
41
41
  USERNAME: undefined,
42
- VERSION: '1.510.1',
42
+ VERSION: '1.512.0',
43
43
  WITH_CREDENTIALS: true,
44
44
  interceptors: {
45
45
  request: new Interceptors(),
package/dist/index.d.ts CHANGED
@@ -4,4 +4,4 @@ export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI';
4
4
  export * from './services.gen';
5
5
  export * from './types.gen';
6
6
  export type { S3Object, DenoS3LightClientSettings } from "./s3Types";
7
- export { type Base64, setClient, getVariable, setVariable, getResource, setResource, getResumeUrls, setState, setProgress, getProgress, getState, getIdToken, denoS3LightClientSettings, loadS3FileStream, loadS3File, writeS3File, signS3Objects, signS3Object, task, runScript, runScriptAsync, runFlow, runFlowAsync, waitJob, getRootJobId, setFlowUserState, getFlowUserState, usernameToEmail, requestInteractiveSlackApproval, Sql, requestInteractiveTeamsApproval } from "./client";
7
+ export { type Base64, setClient, getVariable, setVariable, getResource, setResource, getResumeUrls, setState, setProgress, getProgress, getState, getIdToken, denoS3LightClientSettings, loadS3FileStream, loadS3File, writeS3File, signS3Objects, signS3Object, task, runScript, runScriptAsync, runScriptByPath, runScriptByHash, runScriptByPathAsync, runScriptByHashAsync, runFlow, runFlowAsync, waitJob, getRootJobId, setFlowUserState, getFlowUserState, usernameToEmail, requestInteractiveSlackApproval, Sql, requestInteractiveTeamsApproval } from "./client";
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.requestInteractiveTeamsApproval = exports.requestInteractiveSlackApproval = exports.usernameToEmail = exports.getFlowUserState = exports.setFlowUserState = exports.getRootJobId = exports.waitJob = exports.runFlowAsync = exports.runFlow = exports.runScriptAsync = exports.runScript = exports.task = exports.signS3Object = exports.signS3Objects = exports.writeS3File = exports.loadS3File = exports.loadS3FileStream = exports.denoS3LightClientSettings = exports.getIdToken = exports.getState = exports.getProgress = exports.setProgress = exports.setState = exports.getResumeUrls = exports.setResource = exports.getResource = exports.setVariable = exports.getVariable = exports.setClient = exports.OpenAPI = exports.CancelError = exports.CancelablePromise = exports.ApiError = void 0;
17
+ exports.requestInteractiveTeamsApproval = exports.requestInteractiveSlackApproval = exports.usernameToEmail = exports.getFlowUserState = exports.setFlowUserState = exports.getRootJobId = exports.waitJob = exports.runFlowAsync = exports.runFlow = exports.runScriptByHashAsync = exports.runScriptByPathAsync = exports.runScriptByHash = exports.runScriptByPath = exports.runScriptAsync = exports.runScript = exports.task = exports.signS3Object = exports.signS3Objects = exports.writeS3File = exports.loadS3File = exports.loadS3FileStream = exports.denoS3LightClientSettings = exports.getIdToken = exports.getState = exports.getProgress = exports.setProgress = exports.setState = exports.getResumeUrls = exports.setResource = exports.getResource = exports.setVariable = exports.getVariable = exports.setClient = exports.OpenAPI = exports.CancelError = exports.CancelablePromise = exports.ApiError = void 0;
18
18
  // This file is auto-generated by @hey-api/openapi-ts
19
19
  var ApiError_1 = require("./core/ApiError");
20
20
  Object.defineProperty(exports, "ApiError", { enumerable: true, get: function () { return ApiError_1.ApiError; } });
@@ -46,6 +46,10 @@ Object.defineProperty(exports, "signS3Object", { enumerable: true, get: function
46
46
  Object.defineProperty(exports, "task", { enumerable: true, get: function () { return client_1.task; } });
47
47
  Object.defineProperty(exports, "runScript", { enumerable: true, get: function () { return client_1.runScript; } });
48
48
  Object.defineProperty(exports, "runScriptAsync", { enumerable: true, get: function () { return client_1.runScriptAsync; } });
49
+ Object.defineProperty(exports, "runScriptByPath", { enumerable: true, get: function () { return client_1.runScriptByPath; } });
50
+ Object.defineProperty(exports, "runScriptByHash", { enumerable: true, get: function () { return client_1.runScriptByHash; } });
51
+ Object.defineProperty(exports, "runScriptByPathAsync", { enumerable: true, get: function () { return client_1.runScriptByPathAsync; } });
52
+ Object.defineProperty(exports, "runScriptByHashAsync", { enumerable: true, get: function () { return client_1.runScriptByHashAsync; } });
49
53
  Object.defineProperty(exports, "runFlow", { enumerable: true, get: function () { return client_1.runFlow; } });
50
54
  Object.defineProperty(exports, "runFlowAsync", { enumerable: true, get: function () { return client_1.runFlowAsync; } });
51
55
  Object.defineProperty(exports, "waitJob", { enumerable: true, get: function () { return client_1.waitJob; } });
@@ -546,12 +546,15 @@ export type MainArgSignature = {
546
546
  } | {
547
547
  str: Array<(string)> | null;
548
548
  } | {
549
- object: Array<{
550
- key: string;
551
- typ: 'float' | 'int' | 'bool' | 'email' | 'unknown' | 'bytes' | 'dict' | 'datetime' | 'sql' | {
552
- str: unknown;
553
- };
554
- }>;
549
+ object: {
550
+ name?: string;
551
+ props?: Array<{
552
+ key: string;
553
+ typ: 'float' | 'int' | 'bool' | 'email' | 'unknown' | 'bytes' | 'dict' | 'datetime' | 'sql' | {
554
+ str: unknown;
555
+ };
556
+ }>;
557
+ };
555
558
  } | {
556
559
  list: 'float' | 'int' | 'bool' | 'email' | 'unknown' | 'bytes' | 'dict' | 'datetime' | 'sql' | {
557
560
  str: unknown;
@@ -3006,6 +3009,10 @@ export type CreateAccountData = {
3006
3009
  * OAuth client secret for resource-level credentials (client_credentials flow only)
3007
3010
  */
3008
3011
  cc_client_secret?: string;
3012
+ /**
3013
+ * OAuth token URL override for resource-level authentication (client_credentials flow only)
3014
+ */
3015
+ cc_token_url?: string;
3009
3016
  };
3010
3017
  workspace: string;
3011
3018
  };
@@ -3028,6 +3035,10 @@ export type ConnectClientCredentialsData = {
3028
3035
  * OAuth client secret for resource-level authentication
3029
3036
  */
3030
3037
  cc_client_secret: string;
3038
+ /**
3039
+ * OAuth token URL override for resource-level authentication
3040
+ */
3041
+ cc_token_url?: string;
3031
3042
  };
3032
3043
  };
3033
3044
  export type ConnectClientCredentialsResponse = TokenResponse;
@@ -9572,6 +9583,10 @@ export type $OpenApiTs = {
9572
9583
  * OAuth client secret for resource-level credentials (client_credentials flow only)
9573
9584
  */
9574
9585
  cc_client_secret?: string;
9586
+ /**
9587
+ * OAuth token URL override for resource-level authentication (client_credentials flow only)
9588
+ */
9589
+ cc_token_url?: string;
9575
9590
  };
9576
9591
  workspace: string;
9577
9592
  };
@@ -9603,6 +9618,10 @@ export type $OpenApiTs = {
9603
9618
  * OAuth client secret for resource-level authentication
9604
9619
  */
9605
9620
  cc_client_secret: string;
9621
+ /**
9622
+ * OAuth token URL override for resource-level authentication
9623
+ */
9624
+ cc_token_url?: string;
9606
9625
  };
9607
9626
  };
9608
9627
  res: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "windmill-client",
3
3
  "description": "Windmill SDK client for browsers and Node.js",
4
- "version": "1.510.1",
4
+ "version": "1.512.0",
5
5
  "author": "Ruben Fiszel",
6
6
  "license": "Apache 2.0",
7
7
  "devDependencies": {