windmill-client 1.728.1 → 1.730.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.
@@ -4022,6 +4022,7 @@ var OauthService = class {
4022
4022
  /**
4023
4023
  * connect OAuth using client credentials
4024
4024
  * @param data The data for the request.
4025
+ * @param data.workspace
4025
4026
  * @param data.client OAuth client name
4026
4027
  * @param data.requestBody client credentials flow parameters
4027
4028
  * @returns TokenResponse OAuth token response
@@ -4030,8 +4031,11 @@ var OauthService = class {
4030
4031
  static connectClientCredentials(data) {
4031
4032
  return request(OpenAPI, {
4032
4033
  method: "POST",
4033
- url: "/oauth/connect_client_credentials/{client}",
4034
- path: { client: data.client },
4034
+ url: "/w/{workspace}/oauth/connect_client_credentials/{client}",
4035
+ path: {
4036
+ workspace: data.workspace,
4037
+ client: data.client
4038
+ },
4035
4039
  body: data.requestBody,
4036
4040
  mediaType: "application/json"
4037
4041
  });
@@ -4116,7 +4120,7 @@ var OauthService = class {
4116
4120
  }
4117
4121
  /**
4118
4122
  * list oauth connects
4119
- * @returns string list of oauth connects clients
4123
+ * @returns unknown list of oauth connects clients
4120
4124
  * @throws ApiError
4121
4125
  */
4122
4126
  static listOauthConnects() {
@@ -6349,6 +6353,7 @@ var DraftService = class {
6349
6353
  * list every draft the current user has in this workspace, across all kinds
6350
6354
  * @param data The data for the request.
6351
6355
  * @param data.workspace
6356
+ * @param data.allUsers List every draft in the workspace (all users), not just the current user's own + legacy rows. Other users' rows come back with `mine=false` (view-only).
6352
6357
  * @returns unknown the user's drafts
6353
6358
  * @throws ApiError
6354
6359
  */
@@ -6356,7 +6361,8 @@ var DraftService = class {
6356
6361
  return request(OpenAPI, {
6357
6362
  method: "GET",
6358
6363
  url: "/w/{workspace}/drafts/list",
6359
- path: { workspace: data.workspace }
6364
+ path: { workspace: data.workspace },
6365
+ query: { all_users: data.allUsers }
6360
6366
  });
6361
6367
  }
6362
6368
  /**
@@ -6383,6 +6389,26 @@ var DraftService = class {
6383
6389
  });
6384
6390
  }
6385
6391
  /**
6392
+ * fetch the current user's own draft content at a path (any kind)
6393
+ * @param data The data for the request.
6394
+ * @param data.workspace
6395
+ * @param data.kind
6396
+ * @param data.path
6397
+ * @returns unknown the user's draft content, or null when none exists
6398
+ * @throws ApiError
6399
+ */
6400
+ static getOwnDraft(data) {
6401
+ return request(OpenAPI, {
6402
+ method: "GET",
6403
+ url: "/w/{workspace}/drafts/get_own/{kind}/{path}",
6404
+ path: {
6405
+ workspace: data.workspace,
6406
+ kind: data.kind,
6407
+ path: data.path
6408
+ }
6409
+ });
6410
+ }
6411
+ /**
6386
6412
  * upsert (or clear) the current user's draft at a path
6387
6413
  * @param data The data for the request.
6388
6414
  * @param data.workspace
@@ -6405,6 +6431,30 @@ var DraftService = class {
6405
6431
  mediaType: "application/json"
6406
6432
  });
6407
6433
  }
6434
+ /**
6435
+ * resolve a legacy (workspace-level) draft (admin only)
6436
+ * Delete a legacy draft (email NULL) or assign it to the authed admin as a per-user draft. Workspace admins / superadmins only.
6437
+ * @param data The data for the request.
6438
+ * @param data.workspace
6439
+ * @param data.kind
6440
+ * @param data.path
6441
+ * @param data.requestBody
6442
+ * @returns string migration result
6443
+ * @throws ApiError
6444
+ */
6445
+ static migrateLegacyDraft(data) {
6446
+ return request(OpenAPI, {
6447
+ method: "POST",
6448
+ url: "/w/{workspace}/drafts/migrate_legacy/{kind}/{path}",
6449
+ path: {
6450
+ workspace: data.workspace,
6451
+ kind: data.kind,
6452
+ path: data.path
6453
+ },
6454
+ body: data.requestBody,
6455
+ mediaType: "application/json"
6456
+ });
6457
+ }
6408
6458
  };
6409
6459
  var WorkerService = class {
6410
6460
  /**
@@ -8564,6 +8614,48 @@ var JobService = class {
8564
8614
  });
8565
8615
  }
8566
8616
  /**
8617
+ * list asset-trigger dispatch events for a producer job
8618
+ * Returns the chronological log of decisions the asset-trigger dispatcher made after this producer job completed. Each row is one (subscriber, asset write) decision: `dispatched` (with `child_job_id`), `join_pending` (with `received_inputs` / `required_inputs` / `partition`), or `skipped` (with `reason`). Rows are reaped automatically when the producer's `v2_job` row is deleted by the retention sweep.
8619
+ *
8620
+ * @param data The data for the request.
8621
+ * @param data.workspace
8622
+ * @param data.id
8623
+ * @returns unknown dispatch events for this producer job
8624
+ * @throws ApiError
8625
+ */
8626
+ static listDispatchEvents(data) {
8627
+ return request(OpenAPI, {
8628
+ method: "GET",
8629
+ url: "/w/{workspace}/jobs_u/dispatch_events/{id}",
8630
+ path: {
8631
+ workspace: data.workspace,
8632
+ id: data.id
8633
+ }
8634
+ });
8635
+ }
8636
+ /**
8637
+ * list asset-cascade producer→child job edges for a folder
8638
+ * Returns the `dispatched` asset-trigger edges (producer job → child job) whose subscriber lives under `path_start`. Lets a pipeline view reconstruct the cascade tree of a folder by job id and group connected runs. Visibility follows the producer job's RLS.
8639
+ *
8640
+ * @param data The data for the request.
8641
+ * @param data.workspace
8642
+ * @param data.pathStart Folder path prefix the children live under, e.g. `f/orders/`.
8643
+ * @param data.createdAfter Only edges dispatched at/after this instant.
8644
+ * @returns unknown asset-cascade edges for the folder
8645
+ * @throws ApiError
8646
+ */
8647
+ static listAssetDispatchEdges(data) {
8648
+ return request(OpenAPI, {
8649
+ method: "GET",
8650
+ url: "/w/{workspace}/jobs/asset_dispatch_edges",
8651
+ path: { workspace: data.workspace },
8652
+ query: {
8653
+ path_start: data.pathStart,
8654
+ created_after: data.createdAfter
8655
+ }
8656
+ });
8657
+ }
8658
+ /**
8567
8659
  * delete completed job (erase content but keep run id)
8568
8660
  * @param data The data for the request.
8569
8661
  * @param data.workspace
@@ -14185,6 +14277,40 @@ var AssetService = class {
14185
14277
  path: { workspace: data.workspace }
14186
14278
  });
14187
14279
  }
14280
+ /**
14281
+ * Get the workspace-wide asset <-> runnable graph
14282
+ * @param data The data for the request.
14283
+ * @param data.workspace
14284
+ * @param data.assetKinds Filter by asset kinds (comma-separated list)
14285
+ * @param data.folder Scope the graph to runnables in a single folder
14286
+ * @returns unknown asset graph nodes, lineage edges and trigger edges
14287
+ * @throws ApiError
14288
+ */
14289
+ static getAssetsGraph(data) {
14290
+ return request(OpenAPI, {
14291
+ method: "GET",
14292
+ url: "/w/{workspace}/assets/graph",
14293
+ path: { workspace: data.workspace },
14294
+ query: {
14295
+ asset_kinds: data.assetKinds,
14296
+ folder: data.folder
14297
+ }
14298
+ });
14299
+ }
14300
+ /**
14301
+ * List folders that contain at least one pipeline-member script
14302
+ * @param data The data for the request.
14303
+ * @param data.workspace
14304
+ * @returns unknown folders containing pipeline scripts, with their script counts
14305
+ * @throws ApiError
14306
+ */
14307
+ static listPipelineFolders(data) {
14308
+ return request(OpenAPI, {
14309
+ method: "GET",
14310
+ url: "/w/{workspace}/assets/pipelines",
14311
+ path: { workspace: data.workspace }
14312
+ });
14313
+ }
14188
14314
  };
14189
14315
  var VolumeService = class {
14190
14316
  /**
@@ -71,7 +71,7 @@ export interface DatatableSqlTemplateFunction extends SqlTemplateFunction {
71
71
  export declare function datatable(name?: string): DatatableSqlTemplateFunction;
72
72
  /**
73
73
  * Create a SQL template function for DuckDB/ducklake queries
74
- * @param name - DuckDB database name (default: "main")
74
+ * @param name - DuckDB database name, optionally with a schema as `name:schema` (default: "main")
75
75
  * @returns SQL template function for building parameterized queries
76
76
  * @example
77
77
  * let sql = wmill.ducklake()
@@ -81,6 +81,9 @@ export declare function datatable(name?: string): DatatableSqlTemplateFunction;
81
81
  * SELECT * FROM friends
82
82
  * WHERE name = ${name} AND age = ${age}
83
83
  * `.fetch()
84
+ * @example
85
+ * // Target a specific schema within the ducklake
86
+ * let sql = wmill.ducklake("my_lake:analytics")
84
87
  */
85
88
  export declare function ducklake(name?: string): SqlTemplateFunction;
86
89
  export {};
package/dist/sqlUtils.mjs CHANGED
@@ -22,14 +22,14 @@ function datatableProvider(name, schema) {
22
22
  preamble: () => schema ? `SET search_path TO "${schema}";\n` : ""
23
23
  };
24
24
  }
25
- function ducklakeProvider(name) {
25
+ function ducklakeProvider(name, schema) {
26
26
  return {
27
27
  providerName: "ducklake",
28
28
  language: "duckdb",
29
29
  extraArgs: {},
30
30
  formatArgDecl: (argNum, argType) => `-- $arg${argNum} (${argType})`,
31
31
  formatArgUsage: (argNum) => `$arg${argNum}`,
32
- preamble: () => `ATTACH 'ducklake://${name}' AS dl;USE dl;\n`
32
+ preamble: () => `ATTACH 'ducklake://${name}' AS dl;USE dl${schema ? `."${schema}"` : ""};\n`
33
33
  };
34
34
  }
35
35
  function buildSqlStatement(provider, content, contentBody, args) {
@@ -170,7 +170,7 @@ function datatable(name = "main") {
170
170
  }
171
171
  /**
172
172
  * Create a SQL template function for DuckDB/ducklake queries
173
- * @param name - DuckDB database name (default: "main")
173
+ * @param name - DuckDB database name, optionally with a schema as `name:schema` (default: "main")
174
174
  * @returns SQL template function for building parameterized queries
175
175
  * @example
176
176
  * let sql = wmill.ducklake()
@@ -180,9 +180,13 @@ function datatable(name = "main") {
180
180
  * SELECT * FROM friends
181
181
  * WHERE name = ${name} AND age = ${age}
182
182
  * `.fetch()
183
+ * @example
184
+ * // Target a specific schema within the ducklake
185
+ * let sql = wmill.ducklake("my_lake:analytics")
183
186
  */
184
187
  function ducklake(name = "main") {
185
- return buildSqlTemplateFunction(ducklakeProvider(name));
188
+ let { name: n, schema } = parseName(name);
189
+ return buildSqlTemplateFunction(ducklakeProvider(n, schema));
186
190
  }
187
191
  function inferSqlType(value) {
188
192
  if (typeof value === "bigint") return "BIGINT";