Merge session-s3-files-tool into session-s3-query-table

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Guilhem Lemouel
2026-12-01 03:28:21 -08:00
co-authored by Claude Opus 5.5
653 changed files with 31186 additions and 6137 deletions
+26 -19
View File
@@ -123,21 +123,22 @@ accounts) are many per service. Each trigger acts through one connection, named
| Table | What's Stored |
|-------|---------------|
| `workspace_integrations` | `oauth_data` JSON with `base_url`, `client_id`, `client_secret`, `instance_shared` flag and the workspace app's registered `redirect_uri`. One row per (workspace, service); it must exist for every connection made by the connect flow, since token refresh reads the client from it |
| `workspace_integrations` | `oauth_data` JSON with the workspace's own app: `base_url`, `client_id`, `client_secret` and its registered `redirect_uri`. NULL when the workspace has none and the row only holds the shared `resource_path`. Rows with `instance_shared` are legacy, kept for accounts made before connections went through the resource connect |
| `variable` | Encrypted `access_token` at the connection path, linked to `account` via its `account` column |
| `account` | `refresh_token` and the requested `scopes`. The connect flow writes `client` = service name and `is_workspace_integration = true` |
| `account` | `refresh_token` and the requested `scopes`. A token issued by the workspace app has `client` = service name and `is_workspace_integration = true`; one issued by the instance connect client has `client` = resource type |
| `resource` | The connection's resource at the same path, of the service's resource type, `{ "token": "$var:<path>" }` |
Any resource of the service's resource type with a variable at the same path is a connection,
including one connected for runnables through the resource connect drawer. Its account
(`is_workspace_integration = false`) was issued by the instance connect client, so
`http_client_request` refreshes it through the variable store (`windmill_store`'s
`_refresh_token`), never with the workspace app. A connection whose account lacks some of
`ServiceName::oauth_scopes` reports them as `missing_scopes`; reconnecting asks for those plus the
account's own scopes. Only connections the connect flow made can be reconnected or disconnected
(`check_can_replace`, `delete_connection`): a connected resource's token may hold scopes its
runnables need that a trigger connect would not request (a GitHub resource has no account to
read them from), so its lifecycle stays in Resources.
A connection is any resource of the service's resource type with a variable at the same path, and
there is one way to make one: the resource connect drawer (`AppConnectInner.svelte`), opened from
Resources or the trigger picker with the service's `required_scopes` added. It connects through the
workspace's app when there is one (`generate_connect_url` and `callback` here, which only build the
authorize URL with a signed state and exchange the code), otherwise through the instance connect
client (`/oauth/connect/{client}`). Either way the drawer saves the token with `createAccount`.
`http_client_request` refreshes a workspace-app account with the workspace's client and any other
through the variable store (`windmill_store`'s `_refresh_token`). A connection whose account lacks
some of `ServiceName::oauth_scopes` reports them as `missing_scopes`. Reconnecting opens the drawer
on the existing path with those plus the account's own scopes, and `createAccount` with `replace`
swaps the token and account in place.
A user may use a connection when they can read its variable (checked with a user transaction,
so the variable's row-level security decides): `resolve_usable_connection` /
@@ -164,10 +165,6 @@ pub struct OAuthConfig {
A refreshed token is written back by connection path and account id, never by service: providers
like Nextcloud rotate refresh tokens, so writing one onto another account breaks its next refresh.
Instance-level sharing: when the workspace has no OAuth app of its own and the instance admin
shares one (`share_with_workspaces` in the `oauths` setting; not available for Nextcloud), the
connect flow uses it and records `{"instance_shared": true}` in `workspace_integrations`.
### URL Resolution
The `resolve_endpoint()` helper handles both absolute and relative OAuth URLs:
@@ -775,11 +772,21 @@ pub async fn prepare_native_trigger_args(service_name, db, w_id, headers, body)
}
```
### Instance-Level OAuth Credentials
### Instance and Workspace OAuth Clients
When `workspace_integrations.oauth_data.instance_shared == true`, `decrypt_oauth_data()` reads `client_id` and `client_secret` from instance-level global settings instead of workspace-level. This allows admins to share OAuth app credentials across workspaces.
Every workspace can connect through the instance's connect client for a service; there is no
per-workspace sharing switch. A workspace app, when configured, takes precedence in the resource
connect drawer. `workspace_integrations.oauth_data.instance_shared == true` only appears on rows
written before connections went through the resource connect: `decrypt_oauth_data()` then reads
`client_id` and `client_secret` from the instance settings to refresh those legacy accounts.
`generate_connect_url` picks the client (`resolve_oauth_client`): the workspace's own app when configured, the instance's otherwise. The server also picks the redirect URI (`redirect_uri_for`), identically when exchanging the code: `{BASE_URL}/oauth/callback/{resource_type}` for an instance client, which it already registers for resources; for a workspace app, the `redirect_uri` it was saved with, or `/workspace_settings?tab=native_triggers&service=<s>` for one saved before that was stored. Every page a provider can send the user back to (that callback, `/user/login_callback/{client}`, the workspace settings page, the legacy `/oauth/callback/github/native_trigger`) recognises the signed state and hands it to `NativeOAuthCallback`, so a provider with a single registered URI per client (Nextcloud) works whichever one the admin registered.
For a workspace app the server picks the redirect URI (`redirect_uri_for`), identically when
exchanging the code: the `redirect_uri` it was saved with, or
`/workspace_settings?tab=native_triggers&service=<s>` for one saved before that was stored. Every
page a provider can send the user back to (`/oauth/callback/{client}`,
`/user/login_callback/{client}`, the workspace settings page, the legacy
`/oauth/callback/github/native_trigger`) recognises the signed state and hands it to
`NativeOAuthCallback`, which exchanges the code and posts the token to the drawer that opened it.
---
+2
View File
@@ -11,6 +11,8 @@ on:
- "frontend/**"
# The flow chat compiles the chat SDK's source in (svelte.config.js alias).
- "chat-sdk/src/**"
# Also compiled in through an alias.
- "cli/windmill-utils-internal/src/**"
- ".github/workflows/frontend-check.yml"
jobs:
+23
View File
@@ -51,3 +51,26 @@ jobs:
with:
bun-version: latest
- run: cd cli && ./build.sh && cd npm && npm publish --access public
publish_utils_internal:
runs-on: ubuntu-latest
environment: npm
permissions:
contents: read
id-token: write
defaults:
run:
working-directory: cli/windmill-utils-internal
steps:
- uses: actions/checkout@v4.4.0
- uses: actions/setup-node@v7.1.0
with:
node-version: "24.x"
registry-url: "https://registry.npmjs.org"
# Versioned on its own, so most releases have nothing new to publish.
- run: |
pkg=$(node -p 'const p = require("./package.json"); p.name + "@" + p.version')
if [ -n "$(npm view "$pkg" version 2>/dev/null)" ]; then
echo "$pkg is already published"
else
npm ci && npm publish
fi
+1 -1
View File
@@ -1,3 +1,3 @@
{
".": "1.884.1"
".": "1.894.1"
}
+1 -1
View File
File diff suppressed because one or more lines are too long
+194
View File
@@ -1,5 +1,199 @@
# Changelog
## [1.894.1](https://github.com/windmill-labs/windmill/compare/v1.894.0...v1.894.1) (2026-12-01)
### Bug Fixes
* run squashed loop iterations as regular jobs ([#12772](https://github.com/windmill-labs/windmill/issues/12772)) ([b4ca673](https://github.com/windmill-labs/windmill/commit/b4ca673a2920f20b283e59dd3afc9786ee741ff2))
## [1.894.0](https://github.com/windmill-labs/windmill/compare/v1.893.0...v1.894.0) (2026-11-30)
### Features
* load a large result on request, ten render_all elements at a time ([#12664](https://github.com/windmill-labs/windmill/issues/12664)) ([d1abc75](https://github.com/windmill-labs/windmill/commit/d1abc75fa6afcf60ed1948830fb90d0a3c6ece94))
* show s3 csv and parquet results in the db table with filters ([#12712](https://github.com/windmill-labs/windmill/issues/12712)) ([8064fa8](https://github.com/windmill-labs/windmill/commit/8064fa8fb62fc30ce88777395bf69ca828374e23))
### Bug Fixes
* copy labels into forks and detect label changes in compare ([#12738](https://github.com/windmill-labs/windmill/issues/12738)) ([f79e4b6](https://github.com/windmill-labs/windmill/commit/f79e4b618dee54f25396e5b70eef9cca05781cef))
* forward ai proxy decisions requests on output-limited models ([#12770](https://github.com/windmill-labs/windmill/issues/12770)) ([39fb7f3](https://github.com/windmill-labs/windmill/commit/39fb7f34cb206a8087d2ca05c5e6a5c108302f44))
* give AI agent tools run locally a job span and log fields ([#12684](https://github.com/windmill-labs/windmill/issues/12684)) ([d482968](https://github.com/windmill-labs/windmill/commit/d48296808effa9cb259adc891e9a6f8f4ee3b0ca))
* resolve $var: references in custom ai resource headers ([#12764](https://github.com/windmill-labs/windmill/issues/12764)) ([a57f2df](https://github.com/windmill-labs/windmill/commit/a57f2df2c8b2e87d4ea329ab48ad2a0943b3d53c))
* S3 table preview and DB table search bar bugs ([#12768](https://github.com/windmill-labs/windmill/issues/12768)) ([876fbb1](https://github.com/windmill-labs/windmill/commit/876fbb1e09c9723f80603abb4c759f4e4dbefe16))
* show a running job with a fading play ring on home and the runs page ([#12671](https://github.com/windmill-labs/windmill/issues/12671)) ([e3d5b04](https://github.com/windmill-labs/windmill/commit/e3d5b043504e6292967bcac479703d54a7d6a0ee))
## [1.893.0](https://github.com/windmill-labs/windmill/compare/v1.892.0...v1.893.0) (2026-11-30)
### Features
* configurable CRAN repository url for R scripts ([#12759](https://github.com/windmill-labs/windmill/issues/12759)) ([5b6ee10](https://github.com/windmill-labs/windmill/commit/5b6ee1001c0092576bd1e4de5c8bfdca9698aeca))
### Bug Fixes
* keep the cli login form reachable under a long admin reliance notice ([#12761](https://github.com/windmill-labs/windmill/issues/12761)) ([0a4583b](https://github.com/windmill-labs/windmill/commit/0a4583b661cf36a30c1059c36adaf45b5b6e6765))
## [1.892.0](https://github.com/windmill-labs/windmill/compare/v1.891.0...v1.892.0) (2026-11-30)
### Features
* instance-wide IP allowlist on the Client IP settings page ([#12756](https://github.com/windmill-labs/windmill/issues/12756)) ([d62b195](https://github.com/windmill-labs/windmill/commit/d62b195f481c149dd20facaead07a92feda29d9f))
* make client IP trust settable from the instance settings ([#12755](https://github.com/windmill-labs/windmill/issues/12755)) ([de14e74](https://github.com/windmill-labs/windmill/commit/de14e74ec0e0d461072e4c3ee21083abdec7705d))
## [1.891.0](https://github.com/windmill-labs/windmill/compare/v1.890.0...v1.891.0) (2026-11-29)
### Features
* record the real client IP behind proxies with no configuration ([#12752](https://github.com/windmill-labs/windmill/issues/12752)) ([9039e1a](https://github.com/windmill-labs/windmill/commit/9039e1a8246f120beb353cca824bdefcefe31882))
### Bug Fixes
* **audit:** record what a global users.update changed (super_admin, devops, disabled, name) ([#12742](https://github.com/windmill-labs/windmill/issues/12742)) ([ca1cb13](https://github.com/windmill-labs/windmill/commit/ca1cb13ad9c349413bd8cff26ebe694595f1f0cf))
## [1.890.0](https://github.com/windmill-labs/windmill/compare/v1.889.1...v1.890.0) (2026-11-29)
### Features
* show what a token loses without its owner's admin rights ([#12749](https://github.com/windmill-labs/windmill/issues/12749)) ([3ee1d6a](https://github.com/windmill-labs/windmill/commit/3ee1d6a4b8ce56209f0617d1cbd67951ea6df0c5))
### Bug Fixes
* clearer refusal messages and an install-scripts opt-in for app bundling ([#12750](https://github.com/windmill-labs/windmill/issues/12750)) ([6ca1820](https://github.com/windmill-labs/windmill/commit/6ca1820c518bcf684d3b31231a3f4109e9b390d7))
* **cli:** accept the cwd's spelling of the checkout in wmill dev path checks ([#12736](https://github.com/windmill-labs/windmill/issues/12736)) ([76ac275](https://github.com/windmill-labs/windmill/commit/76ac275686d348a6ad61b470cc909e72305a80a7))
* consistent argument reference handling across captures, re-runs, approvals and evals ([#12745](https://github.com/windmill-labs/windmill/issues/12745)) ([86612a0](https://github.com/windmill-labs/windmill/commit/86612a0ff609013027e69f6f3839cbba56675a05))
* consistent writes for linked resource/variable pairs and instance database resolution ([#12746](https://github.com/windmill-labs/windmill/issues/12746)) ([09202d4](https://github.com/windmill-labs/windmill/commit/09202d40948d59fc3e519a103c55ce8a7b04669b))
* copy data tables whose database uses extensions ([#12716](https://github.com/windmill-labs/windmill/issues/12716)) ([2a53334](https://github.com/windmill-labs/windmill/commit/2a53334b3ffe7de5a22d57e951a9eb7487d47f8f))
* leave draining workers out of the autoscaling count ([#12739](https://github.com/windmill-labs/windmill/issues/12739)) ([dd206df](https://github.com/windmill-labs/windmill/commit/dd206df8e33aa7ba6adc4e04c4dd56696f16338c))
* resolve runnables and run-as identities consistently across tasks, deploys and triggers ([#12744](https://github.com/windmill-labs/windmill/issues/12744)) ([8fac722](https://github.com/windmill-labs/windmill/commit/8fac722b8edfce2ae29fc9a8723d8d0e4faf9ff5))
* tighten generated SQL names, flow input lookup and app install steps ([#12748](https://github.com/windmill-labs/windmill/issues/12748)) ([65d567f](https://github.com/windmill-labs/windmill/commit/65d567fec6468dcbb2d52528b4594fe4a0c26b59))
* tighten token scope consistency across MCP, job import and capture paths ([#12743](https://github.com/windmill-labs/windmill/issues/12743)) ([3ee0d88](https://github.com/windmill-labs/windmill/commit/3ee0d889ef7d1453666c3c451be9259da3c8825b))
* workspace and fork lifecycle consistency ([#12747](https://github.com/windmill-labs/windmill/issues/12747)) ([0f2f8aa](https://github.com/windmill-labs/windmill/commit/0f2f8aaaa325b93a42c78753a9b4184f3670763e))
## [1.889.1](https://github.com/windmill-labs/windmill/compare/v1.889.0...v1.889.1) (2026-11-28)
### Bug Fixes
* **frontend:** keep url helpers in their own chunk ([dde36c1](https://github.com/windmill-labs/windmill/commit/dde36c16826ce534ff3d4e0c403e373394693149))
* read scope for listing mcp tools ([8ccb60c](https://github.com/windmill-labs/windmill/commit/8ccb60c711ada9abdb46e9afa24760bb899bdd89))
## [1.889.0](https://github.com/windmill-labs/windmill/compare/v1.888.0...v1.889.0) (2026-11-28)
### Features
* **mcp:** show client details on the oauth consent page ([1a43ff8](https://github.com/windmill-labs/windmill/commit/1a43ff85005fb972404323decab3bbbf61f8cb2b))
### Bug Fixes
* app rendering mode for visitors ([24b15a7](https://github.com/windmill-labs/windmill/commit/24b15a72e846a648ce52f50f9d7141a1aff8ad52))
* **cli:** dev server and sync path handling improvements ([46a64b1](https://github.com/windmill-labs/windmill/commit/46a64b1b467b9596e698456abf38369744dd8843))
* **frontend:** dev page and raw app editor message handling ([c883b82](https://github.com/windmill-labs/windmill/commit/c883b82fa73a4a6556cebe4b0ef72d2923d8046b))
* **frontend:** input handling cleanups ([90c1361](https://github.com/windmill-labs/windmill/commit/90c1361b73f8897a4dce78f1b59163df4027a3ea))
* **frontend:** use the shared markdown renderer in more views ([767d2d6](https://github.com/windmill-labs/windmill/commit/767d2d6f915db277a3e712e3a0075924a17aadbb))
* recordings and mcp tools loading tweaks ([b9e0e06](https://github.com/windmill-labs/windmill/commit/b9e0e068788681a24748f28b4af2df9a3c7e7998))
* serve s3 previews with an explicit content type ([#12715](https://github.com/windmill-labs/windmill/issues/12715)) ([4f309ec](https://github.com/windmill-labs/windmill/commit/4f309ec5fb01d13636a4bcef7fd1fe427a307823))
* tidy redirect handling after login and logout ([561c5a1](https://github.com/windmill-labs/windmill/commit/561c5a1ad30b3c34c8c7d42008f57645078e9854))
* token scope matching cleanups ([7365bfd](https://github.com/windmill-labs/windmill/commit/7365bfdf68a3cdb42c25f6a0b7053eec22f64752))
* **typescript-client:** read task parameter names past a default value ([#12718](https://github.com/windmill-labs/windmill/issues/12718)) ([a7ee99c](https://github.com/windmill-labs/windmill/commit/a7ee99ce63671efde8860e89b3ead8cf794c1c9f))
* **typescript-client:** skip regex literals when reading task parameter names ([00acb80](https://github.com/windmill-labs/windmill/commit/00acb80e0dfe803c7741f63b380bf95f33605f8f))
## [1.888.0](https://github.com/windmill-labs/windmill/compare/v1.887.0...v1.888.0) (2026-11-28)
### Features
* open images in the session preview panel ([#12602](https://github.com/windmill-labs/windmill/issues/12602)) ([0c63dfe](https://github.com/windmill-labs/windmill/commit/0c63dfe18cdcd86cd34cc51907ceef2118e80e2f))
* require two-factor authentication for password logins ([#12704](https://github.com/windmill-labs/windmill/issues/12704)) ([8ec6bee](https://github.com/windmill-labs/windmill/commit/8ec6beed3a4ef550ecd86991122b8a8757ef7021))
### Bug Fixes
* give mcp show tools a text fallback for clients without cards ([#12707](https://github.com/windmill-labs/windmill/issues/12707)) ([84e9038](https://github.com/windmill-labs/windmill/commit/84e903848af65ca049d8059c9627a859220052b2))
* **mcp:** hold each MCP call to its own token, workspace and route ([#12709](https://github.com/windmill-labs/windmill/issues/12709)) ([cb5d6a9](https://github.com/windmill-labs/windmill/commit/cb5d6a92c22bdb606c23266a7370d726ef9eb16e))
* opt the audit probe token into superadmin ([#12710](https://github.com/windmill-labs/windmill/issues/12710)) ([3ad867e](https://github.com/windmill-labs/windmill/commit/3ad867ee658a9bf9aa7c587d4e61724915841683))
* tidy the mcp show tool text fallbacks ([#12713](https://github.com/windmill-labs/windmill/issues/12713)) ([a32ae57](https://github.com/windmill-labs/windmill/commit/a32ae571ca3bdae708f8018abd193d45de69241d))
* validate return addresses on the webhook and cli sign-in pages ([#12719](https://github.com/windmill-labs/windmill/issues/12719)) ([dce05fd](https://github.com/windmill-labs/windmill/commit/dce05fdc3b775d9930b17fdfc3eeb8c93fb389a4))
## [1.887.0](https://github.com/windmill-labs/windmill/compare/v1.886.0...v1.887.0) (2026-11-27)
### Features
* add native totp two-factor authentication for password login ([#12620](https://github.com/windmill-labs/windmill/issues/12620)) ([f52c117](https://github.com/windmill-labs/windmill/commit/f52c117e76c4b39265e4d5b3f8304934dce3f0c0))
* add token introspection endpoint and token test UI ([#12702](https://github.com/windmill-labs/windmill/issues/12702)) ([55aec82](https://github.com/windmill-labs/windmill/commit/55aec82102bca445fa91a2d6b926a8a68f953527))
* connect native trigger accounts through the resource connect flow ([#12352](https://github.com/windmill-labs/windmill/issues/12352)) ([9643ba0](https://github.com/windmill-labs/windmill/commit/9643ba09a4c2a10172e2b4227f9c00f8c46662f5))
* edit token expiration and allowed IPs, widen only as far as mintable ([#12703](https://github.com/windmill-labs/windmill/issues/12703)) ([b2f3986](https://github.com/windmill-labs/windmill/commit/b2f3986f9430147eab8fb36d47c091124824de0e))
* edit token scopes from the CLI and show token access in token lists ([#12694](https://github.com/windmill-labs/windmill/issues/12694)) ([7e79229](https://github.com/windmill-labs/windmill/commit/7e79229aa4731cf0fbf108ab946fa6b7b651d5d5))
* flag risky tokens and add a superadmin token review ([#12693](https://github.com/windmill-labs/windmill/issues/12693)) ([51e9017](https://github.com/windmill-labs/windmill/commit/51e9017c67481e334c529387db442be2002a287c))
* make new tokens workspace-bound and rights-free unless opted in ([#12695](https://github.com/windmill-labs/windmill/issues/12695)) ([f5644d7](https://github.com/windmill-labs/windmill/commit/f5644d7f431f7c566302645fd2e0e94970ea3376))
* split account settings into profile, tokens, AI and MCP drawers ([#12691](https://github.com/windmill-labs/windmill/issues/12691)) ([46cf750](https://github.com/windmill-labs/windmill/commit/46cf7509fabb8464a75d5651b2ef6c0be83d81a4))
* stop a loop once a failure threshold of iterations has failed ([#12686](https://github.com/windmill-labs/windmill/issues/12686)) ([0496abb](https://github.com/windmill-labs/windmill/commit/0496abbad8e494b6ae2eff0d72661c6b9534b179))
### Bug Fixes
* apply token read-only flag to HTTP route calls ([#12690](https://github.com/windmill-labs/windmill/issues/12690)) ([f1edefa](https://github.com/windmill-labs/windmill/commit/f1edefa132b6b5a7e6ba9475749027aa315895d3))
* **cli:** accept Windows separators in strict-folder-boundaries test ([#12689](https://github.com/windmill-labs/windmill/issues/12689)) ([443ea15](https://github.com/windmill-labs/windmill/commit/443ea155a155dd2e76d7583b0ba48e6cd15d788c))
* copy the shown error from AI chat tool cards ([#12698](https://github.com/windmill-labs/windmill/issues/12698)) ([5b3a40b](https://github.com/windmill-labs/windmill/commit/5b3a40b1a428a508b3472b1756a37cea33e869ef))
* demote a token's superadmin when its owner loses it ([#12692](https://github.com/windmill-labs/windmill/issues/12692)) ([3ec14c7](https://github.com/windmill-labs/windmill/commit/3ec14c7ed2b1ff1283c69197522a5b79e3970a77))
* **frontend:** open non-raster images in a new tab as PNG ([#12697](https://github.com/windmill-labs/windmill/issues/12697)) ([de2cd55](https://github.com/windmill-labs/windmill/commit/de2cd55b338d48de055f134e304dfbe10c3ca29e))
* rerun recovered iterations in failed-only restarts ([#12657](https://github.com/windmill-labs/windmill/issues/12657)) ([57ad72b](https://github.com/windmill-labs/windmill/commit/57ad72b28aaf9386eb552443379addb7d3b00777))
## [1.886.0](https://github.com/windmill-labs/windmill/compare/v1.885.0...v1.886.0) (2026-11-26)
### Features
* a second OTel logs exporter for audit logs ([#12675](https://github.com/windmill-labs/windmill/issues/12675)) ([f28bdff](https://github.com/windmill-labs/windmill/commit/f28bdff94f82d18c2d75d179c6f35f524f5b220c))
* add a Require SSO workspace protection rule ([#12681](https://github.com/windmill-labs/windmill/issues/12681)) ([71f22fc](https://github.com/windmill-labs/windmill/commit/71f22fc6e93f43b2ee4d1eec5c1b5c9ece5e941e))
* overwrite or discard each path conflict when reassigning user items ([#12683](https://github.com/windmill-labs/windmill/issues/12683)) ([b3ab8e2](https://github.com/windmill-labs/windmill/commit/b3ab8e22b37a666d4ffdbead4a80c406502254b2))
* own model and effort for script generation and AI review ([#12678](https://github.com/windmill-labs/windmill/issues/12678)) ([51cd51c](https://github.com/windmill-labs/windmill/commit/51cd51cd52cabed72b6516e83b1542d0225543cd))
* record client IP and user agent on audit entries ([#12673](https://github.com/windmill-labs/windmill/issues/12673)) ([c689d74](https://github.com/windmill-labs/windmill/commit/c689d74505a007d87dfc558fd69ee22ccba22653))
### Bug Fixes
* derive the client ip from trusted proxies only ([#12677](https://github.com/windmill-labs/windmill/issues/12677)) ([f452090](https://github.com/windmill-labs/windmill/commit/f45209064ac3a030e0c31f5ac54c09f8c54a32c1))
* redact secrets in instance settings reads unless explicitly revealed ([#12682](https://github.com/windmill-labs/windmill/issues/12682)) ([cc855e6](https://github.com/windmill-labs/windmill/commit/cc855e6fd94268c19bf05658736e15b83310f283))
* resolve the client ip in one place and trust private ranges only on cloud ([#12685](https://github.com/windmill-labs/windmill/issues/12685)) ([0b11d3e](https://github.com/windmill-labs/windmill/commit/0b11d3e9a691450997d902015f680a54fd2f2cc6))
## [1.885.0](https://github.com/windmill-labs/windmill/compare/v1.884.1...v1.885.0) (2026-11-25)
### Features
* hand the code selected with ⌘K and Ctrl+L to an AI session ([#12661](https://github.com/windmill-labs/windmill/issues/12661)) ([5d4820d](https://github.com/windmill-labs/windmill/commit/5d4820d3736fa6f307fb4838e525e32c4dc24838))
* pass MCP image results to the AI chat model as images ([#12660](https://github.com/windmill-labs/windmill/issues/12660)) ([772c0c3](https://github.com/windmill-labs/windmill/commit/772c0c30f1f47a84b2fd7ec6456882482c0759c5))
* show who approved a flow run, and list opted-in approvals on home ([#12604](https://github.com/windmill-labs/windmill/issues/12604)) ([3efe1e9](https://github.com/windmill-labs/windmill/commit/3efe1e97a7d54be674b78dbfdb48e6f8f8591527))
* show why a step waits: sleep, concurrency limit, approval ([#12607](https://github.com/windmill-labs/windmill/issues/12607)) ([182356e](https://github.com/windmill-labs/windmill/commit/182356ec358cf9fa759983d39ffff128468c85cb))
### Bug Fixes
* bound sqlx's return-to-pool step so a failover can't wedge the pool ([#12655](https://github.com/windmill-labs/windmill/issues/12655)) ([8e3f117](https://github.com/windmill-labs/windmill/commit/8e3f11705f8705e2c1adb50a139b4a501795e5ec))
* check run scope on what a schedule or trigger save names ([#12618](https://github.com/windmill-labs/windmill/issues/12618)) ([4b715c4](https://github.com/windmill-labs/windmill/commit/4b715c422a75e93ac9a6aa9b9c74a31ba786734c))
* **cli:** keep generate-metadata inside the named folder ([#12668](https://github.com/windmill-labs/windmill/issues/12668)) ([2c2273c](https://github.com/windmill-labs/windmill/commit/2c2273cffb26c55e883bad6ee96653935e0412ab))
* hold a volume's lease through sync-back and pull it in parallel ([#12667](https://github.com/windmill-labs/windmill/issues/12667)) ([5953595](https://github.com/windmill-labs/windmill/commit/5953595d50a20fc08449bf1d0c7aa6b0c0a12b81))
* let the attached flow step panel scroll ([#12652](https://github.com/windmill-labs/windmill/issues/12652)) ([29383dd](https://github.com/windmill-labs/windmill/commit/29383dd814677465f98a02038b2fd2d83e117edd))
* log in on the live session when the browser sends two token cookies ([#12663](https://github.com/windmill-labs/windmill/issues/12663)) ([8f637d5](https://github.com/windmill-labs/windmill/commit/8f637d58d6654740bca41f32a3462e5951ff8f4c))
* match flow step pickers to the role and keep picked settings ([#12654](https://github.com/windmill-labs/windmill/issues/12654)) ([00e354d](https://github.com/windmill-labs/windmill/commit/00e354dade598ed9f434576ef616b53e0cf6b543))
* **mcp:** require a session on the MCP OAuth client routes and audit registrations ([#12647](https://github.com/windmill-labs/windmill/issues/12647)) ([2b7c7e9](https://github.com/windmill-labs/windmill/commit/2b7c7e98acfc96dc10931948252a02d39325e798))
* **python:** treat tomllib and newer stdlib modules as stdlib in import inference ([#12670](https://github.com/windmill-labs/windmill/issues/12670)) ([655562e](https://github.com/windmill-labs/windmill/commit/655562e805a9b74adbb1e3faa85d97bc567dd99a))
* show minutes instead of seconds after the first minute in relative times ([#12631](https://github.com/windmill-labs/windmill/issues/12631)) ([b59d27b](https://github.com/windmill-labs/windmill/commit/b59d27bdb1daaa0e3fbacc3cfb692b01fe7254d3))
* skip the session backup in preview frames and keep draft handles stable ([#12598](https://github.com/windmill-labs/windmill/issues/12598)) ([53ebb94](https://github.com/windmill-labs/windmill/commit/53ebb94ddb167ae4bebd06fcdbed77df1391bc68))
* stop state_snapshot_uncloneable warnings from chart options ([#12653](https://github.com/windmill-labs/windmill/issues/12653)) ([2bdad42](https://github.com/windmill-labs/windmill/commit/2bdad42ad060e5678df22e5df3d90d598c2586c5))
## [1.884.1](https://github.com/windmill-labs/windmill/compare/v1.884.0...v1.884.1) (2026-11-25)
+7
View File
@@ -1,4 +1,11 @@
{
# Caddy replaces X-Forwarded-For with its own peer unless that peer is trusted. With a load
# balancer or Cloudflare in front of Caddy, list its ranges so the client address reaches
# Windmill. On windmill_server, add a balancer to TRUSTED_PROXIES, but for Cloudflare set
# TRUST_CLOUDFLARE=true rather than listing its ranges, which any Cloudflare Worker sends from:
# servers {
# trusted_proxies static private_ranges
# }
layer4 {
:25 {
route {
+2
View File
@@ -83,6 +83,8 @@ COPY /backend/windmill-api/build_openapi.sh /backend/windmill-api/build_openapi.
COPY /system_prompts/auto-generated /system_prompts/auto-generated
# The flow chat imports the chat SDK's source (svelte.config.js alias `windmill-chat`).
COPY /chat-sdk/src /chat-sdk/src
# Shared with the CLI (svelte.config.js alias `windmill-utils-internal`).
COPY /cli/windmill-utils-internal/src /cli/windmill-utils-internal/src
RUN cd /backend/windmill-api && . ./build_openapi.sh
COPY /backend/parsers/windmill-parser-wasm/pkg/ /backend/parsers/windmill-parser-wasm/pkg/
+12
View File
@@ -30,6 +30,18 @@ If the prompt context provides a `PR AUTHOR` (GitHub login) and the verdict is N
- Read additional files only when the diff is not enough to validate a finding.
- Do not modify any files.
## Accepted risks
Some security trade-offs are decided on purpose and recorded where the code they concern is
documented. Do not report them as findings; do report a change that widens one beyond what its
record describes.
- **Client IP default proxy trust** (`backend/windmill-common/src/client_ip.rs`,
`docs/auth-surface.md` → "The client IP"): with `TRUSTED_PROXIES` unset, the private ranges are
trusted as proxies, token IP allowlists included, so a host on the private network can name its
own client address. Setting `TRUSTED_PROXIES` to the actual proxies' addresses (not `private`)
closes it.
## Severity triage
Tag each finding with a severity. Always report P0 and P1. Report P2 only when the diff invites it (a new `pub fn`, a new module, a new exported component, a meaningful refactor).
+16
View File
@@ -254,6 +254,22 @@ secretRequests:
and the resource are created in the workspace, deployed, and the model reads the result the
chat would give it. `check` is reported as is; no connection test runs.
`runtime.codeSelections` attaches code to the prompt of a global case, as the chips of code
selected in an editor do. `source` names the item (`script`, `flow`, `raw_app` or `agent`) and
optionally its `part` (a flow step, app runnable, agent tool or script module file), and
`content` is the code from `startLine` to `endLine`:
```yaml
codeSelections:
- source: { kind: flow, path: f/evals/global/process_refund, part: calculate_total }
lang: bun
startLine: 1
endLine: 2
content: |-
export async function main(subtotal: number) {
return { subtotal, total: subtotal }
```
`runtime.profile` runs a session-chat case (`sessionChat: true`) as a non-admin role
instead of full access: the prompt, toolset and tool schemas are cut as production's
`capabilitiesForRole` cuts them, and the workspace's `operator_settings` are seeded for the
@@ -4,6 +4,7 @@ import {
globalToolsFor,
prepareGlobalUserMessage,
} from "../../../../../frontend/src/lib/components/copilot/chat/global/core";
import { createCodeSelection } from "../../../../../frontend/src/lib/components/copilot/chat/context";
import { assembleGlobalSystemMessage } from "../../../../../frontend/src/lib/components/copilot/chat/global/globalAssembly";
import {
canBuild,
@@ -46,6 +47,7 @@ import {
type EvalPreviewTabFixture,
} from "./evalPreviewTabs";
import type {
EvalCaseCodeSelection,
EvalCaseProfile,
EvalSecretRequestAnswer,
ModeRunContext,
@@ -145,6 +147,7 @@ export interface GlobalEvalOptions {
// Start in plan mode: the gate refuses every tool without `planModeSafe`, and the two plan
// tools are offered. Needs sessionChat, which is what plan mode is gated on in production.
planMode?: boolean;
codeSelections?: EvalCaseCodeSelection[];
// The user's rights, resolved as a session resolves them; unset keeps full access.
profile?: EvalCaseProfile;
// Run the pipeline the chat drafted once it is over (`validate.pipelineRun`).
@@ -286,6 +289,9 @@ export async function runGlobalEval(
pipelineFolders: pipelineEditors?.folders(),
});
const baseSystemMessage = assembleSystemMessage();
const codeSelections = (options.codeSelections ?? []).map(({ source, ...selection }) =>
createCodeSelection(source, selection),
);
const helpers = {
...evalArtifacts.helpers,
// A standalone chat has no session: the tools that behave differently in one (a pipeline
@@ -317,7 +323,7 @@ export async function runGlobalEval(
isToolAvailable: (name) =>
(!pipelineToolNames.has(name) || (pipelineEditors?.folders().length ?? 0) > 0) &&
(planMode?.isToolAvailable?.(name) ?? true),
userMessage: prepareGlobalUserMessage(userPrompt, [], {
userMessage: prepareGlobalUserMessage(userPrompt, codeSelections, {
...(injectActiveEditorContext ? { workspace: workspaceRoot } : {}),
activePreview: panel?.activePreview(),
resourceTypeSync: await resolveResourceTypeSync(workspaceRoot, []),
+39
View File
@@ -519,6 +519,45 @@
- returns subtotal, tax, and total from the updated flow logic
- leaves the result as a draft only
- id: global-code-selection-names-its-item
prompt: |-
Throw an error here when the subtotal is negative.
Keep the change as a draft.
initial: ai_evals/fixtures/frontend/global/initial/current_invoice_live_flow.json
runtime:
maxTurns: 10
codeSelections:
- source:
kind: flow
path: f/evals/global/process_refund
part: calculate_total
lang: bun
startLine: 1
endLine: 2
content: |-
export async function main(subtotal: number) {
return { subtotal, total: subtotal }
validate:
# The open flow's own draft, which must stay as it was, and the edited one.
draftCountExactly: 2
requiredDrafts:
- type: flow
path: f/evals/global/process_refund
valueIncludes:
- calculate_total
- throw
forbiddenDrafts:
- type: flow
path: f/evals/global/process_invoice
toolExpect:
forbiddenToolsUsed:
- deploy_workspace_item
- delete_workspace_item
judgeChecklist:
- edits the calculate_total step of the process_refund flow, which the selected code belongs to, not the flow open in the editor
- throws when the subtotal is negative and keeps the rest of the step as it was
- leaves the result as a draft only
- id: global-test14-current-without-live-editor-asks-question
prompt: |-
Please update this script so it returns `ok`.
+10
View File
@@ -38,6 +38,8 @@ export interface EvalCaseRuntimeSpec {
secretRequests?: EvalSecretRequestAnswer[];
backendPreview?: EvalCaseRuntimeBackendPreview;
appContext?: EvalCaseRuntimeAppContextSpec;
// Global mode: code the user selected in an editor and attached to the prompt.
codeSelections?: EvalCaseCodeSelection[];
// Global mode: run as a session chat (preview tools + session prompt) vs the standalone chat.
sessionChat?: boolean;
// Global session chats: start the case in plan mode, so the workspace-changing tools are
@@ -60,6 +62,14 @@ export interface EvalSecretRequestAnswer {
check?: { ok: true } | { ok: false; error: string };
}
export interface EvalCaseCodeSelection {
source: { kind: "script" | "flow" | "raw_app" | "agent"; path: string; part?: string };
lang: "bun" | "python3" | "bash" | "postgresql";
startLine: number;
endLine: number;
content: string;
}
export interface EvalCaseProfile {
operator: boolean;
operatorSettings?: {
+1
View File
@@ -55,6 +55,7 @@ export function createGlobalModeRunner(
previewTabs: initial?.previewTabs,
sessionChat: context.evalCase?.runtime?.sessionChat,
planMode: context.evalCase?.runtime?.planMode,
codeSelections: context.evalCase?.runtime?.codeSelections,
profile: context.evalCase?.runtime?.profile,
pipelineRun: context.executionOnly
? undefined
@@ -0,0 +1,80 @@
{
"db_name": "PostgreSQL",
"query": "SELECT email, label, token_prefix AS \"token_prefix!\", expiration,\n created_at AS \"created_at!\", last_used_at AS \"last_used_at!\", scopes, workspace_id,\n read_only AS \"read_only!\", risks AS \"risks!\"\n FROM token_risk\n WHERE NOT self_managed\n AND CASE WHEN $1::text IS NULL THEN cardinality(risks) > 0\n WHEN $1 = 'all' THEN true\n ELSE $1 = ANY(risks) END\n AND ($2::text IS NULL OR strpos(lower(email), $2) > 0\n OR strpos(lower(COALESCE(label, '')), $2) > 0)\n AND ($3::timestamptz IS NULL OR (last_used_at, token_prefix) > ($3, $4::text))\n ORDER BY last_used_at, token_prefix\n LIMIT $5",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "email",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "label",
"type_info": "Varchar"
},
{
"ordinal": 2,
"name": "token_prefix!",
"type_info": "Varchar"
},
{
"ordinal": 3,
"name": "expiration",
"type_info": "Timestamptz"
},
{
"ordinal": 4,
"name": "created_at!",
"type_info": "Timestamptz"
},
{
"ordinal": 5,
"name": "last_used_at!",
"type_info": "Timestamptz"
},
{
"ordinal": 6,
"name": "scopes",
"type_info": "TextArray"
},
{
"ordinal": 7,
"name": "workspace_id",
"type_info": "Varchar"
},
{
"ordinal": 8,
"name": "read_only!",
"type_info": "Bool"
},
{
"ordinal": 9,
"name": "risks!",
"type_info": "TextArray"
}
],
"parameters": {
"Left": [
"Text",
"Text",
"Timestamptz",
"Text",
"Int8"
]
},
"nullable": [
true,
true,
true,
true,
true,
true,
true,
true,
true,
true
]
},
"hash": "027dbff1397b96a6fb1cfe9aaaffe226bf276cac01b052dac82a6e21b00ac833"
}
@@ -0,0 +1,28 @@
{
"db_name": "PostgreSQL",
"query": "SELECT key, original_scheduled_for IS NOT NULL AND released_at IS NULL AS \"held!\"\n FROM concurrency_key WHERE job_id = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "key",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "held!",
"type_info": "Bool"
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
false,
null
]
},
"hash": "0361abb4ab7e9a9cf28f0e0551892334eda482fea471e77b6febcd061feba08f"
}
@@ -0,0 +1,15 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE password SET totp_recovery_codes = $2 WHERE email = $1",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text",
"TextArray"
]
},
"nullable": []
},
"hash": "05d2b07dd15d14a9c36bdb3dac87d1deb52b91ac98fdadc0c355955a1d90d26a"
}
@@ -0,0 +1,47 @@
{
"db_name": "PostgreSQL",
"query": "SELECT totp_secret, totp_pending_secret, totp_last_step, totp_recovery_codes,\n (totp_failed_attempts >= $2 AND totp_failed_since > now() - interval '1 minute')\n AS \"locked!\"\n FROM password WHERE email = $1 FOR UPDATE",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "totp_secret",
"type_info": "Text"
},
{
"ordinal": 1,
"name": "totp_pending_secret",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "totp_last_step",
"type_info": "Int8"
},
{
"ordinal": 3,
"name": "totp_recovery_codes",
"type_info": "TextArray"
},
{
"ordinal": 4,
"name": "locked!",
"type_info": "Bool"
}
],
"parameters": {
"Left": [
"Text",
"Int4"
]
},
"nullable": [
true,
true,
true,
true,
null
]
},
"hash": "08cc5c57fb76a392fc32c9122e32d8c33945f8e20daf9242e1de8f4f4ef5546e"
}
@@ -0,0 +1,15 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE password SET totp_secret = totp_pending_secret, totp_pending_secret = NULL,\n totp_recovery_codes = $2\n WHERE email = $1",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text",
"TextArray"
]
},
"nullable": []
},
"hash": "0cdcf2f56b35f2c4929071933c2c7f3e4e2dda9f0663fb8b814ce78c3c99a63d"
}
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE volume\n SET size_bytes = $3, file_count = $4,\n updated_at = now(), last_used_at = now(),\n lease_until = NULL, leased_by = NULL,\n generation = generation + generation % 2\n WHERE workspace_id = $1 AND name = $2 AND leased_by = $5",
"query": "UPDATE volume\n SET size_bytes = $3, file_count = $4,\n updated_at = now(), last_used_at = now(),\n generation = generation + generation % 2\n WHERE workspace_id = $1 AND name = $2 AND leased_by = $5",
"describe": {
"columns": [],
"parameters": {
@@ -14,5 +14,5 @@
},
"nullable": []
},
"hash": "f5946a3968df859f668d6197562c10024ffc24f108ca48d5b3fa98e489d931ea"
"hash": "123015f4012169763ac8b16c2e4e0775b6da84dd53aeca8fb9b556f969aee29a"
}
@@ -0,0 +1,15 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE password SET totp_pending_secret = $2\n WHERE email = $1 AND login_type = 'password' AND totp_secret IS NULL",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text",
"Text"
]
},
"nullable": []
},
"hash": "134c3b21135ff0558fd234490b7ef56ccb86c2ba94d318c5fb341aa9114b8268"
}
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO app (workspace_id, path, summary, policy, versions, extra_perms, custom_path)\n VALUES ($1, $2, $3, $4, $5, $6, $7)\n RETURNING id",
"query": "INSERT INTO app (workspace_id, path, summary, policy, versions, extra_perms, custom_path, labels)\n VALUES ($1, $2, $3, $4, $5, $6, $7, $8)\n RETURNING id",
"describe": {
"columns": [
{
@@ -17,12 +17,13 @@
"Jsonb",
"Int8Array",
"Jsonb",
"Text"
"Text",
"TextArray"
]
},
"nullable": [
false
]
},
"hash": "c61977907414d2336030fbab114ea03e4a1d1edb4470812cd7dd57c657fa287a"
"hash": "138fda3e2e7f83f5f60b7990efed2cedbaec80b4a54e4396b40ee5f3d15abcd2"
}
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "SELECT value, description, resource_type\n FROM resource\n WHERE workspace_id = $1 AND path = $2",
"query": "SELECT value, description, resource_type, labels\n FROM resource\n WHERE workspace_id = $1 AND path = $2",
"describe": {
"columns": [
{
@@ -17,6 +17,11 @@
"ordinal": 2,
"name": "resource_type",
"type_info": "Varchar"
},
{
"ordinal": 3,
"name": "labels",
"type_info": "TextArray"
}
],
"parameters": {
@@ -28,8 +33,9 @@
"nullable": [
true,
true,
false
false,
true
]
},
"hash": "819c233915383e89af1bcf1a56c5f67c4e1fc217f216f609e36a9944a7807b33"
"hash": "1473ebd933fbda4550c63c81bddc3486fac4f9c2d0643e8eb15b169c1a900a3a"
}
@@ -0,0 +1,24 @@
{
"db_name": "PostgreSQL",
"query": "SELECT ($2 AND EXISTS(SELECT 1 FROM usr WHERE email = $1 AND is_admin))\n OR ($3 AND COALESCE((SELECT super_admin FROM password WHERE email = $1), false))",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "?column?",
"type_info": "Bool"
}
],
"parameters": {
"Left": [
"Text",
"Bool",
"Bool"
]
},
"nullable": [
null
]
},
"hash": "14bc6e1320127fe40be6f057785a88e50ab1c8c355502d7dbbe52b0e66899897"
}
@@ -0,0 +1,14 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO notify_event (channel, payload) VALUES ('notify_token_invalidation', $1)",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text"
]
},
"nullable": []
},
"hash": "16003c729b74440f86fe511461f6c091cf865d1a6e877fe69104d59db0e13c61"
}
@@ -0,0 +1,34 @@
{
"db_name": "PostgreSQL",
"query": "SELECT u.username, u.email,\n COALESCE(array_agg(g.group_) FILTER (WHERE g.group_ IS NOT NULL), '{}') AS \"groups!\"\n FROM usr u\n JOIN password p ON p.email = u.email AND p.login_type = 'password'\n LEFT JOIN usr_to_group g ON g.workspace_id = u.workspace_id AND g.usr = u.username\n WHERE u.workspace_id = $1 AND NOT u.is_service_account\n GROUP BY u.username, u.email\n ORDER BY u.username",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "username",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "email",
"type_info": "Varchar"
},
{
"ordinal": 2,
"name": "groups!",
"type_info": "VarcharArray"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
false,
false,
null
]
},
"hash": "1816ab8f23338f3e01d01bf4e1ba67e1c180bd4c81b17db1ae2619e2e73fef28"
}
@@ -0,0 +1,28 @@
{
"db_name": "PostgreSQL",
"query": "SELECT login_type, username FROM password WHERE email = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "login_type",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "username",
"type_info": "Varchar"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
false,
true
]
},
"hash": "22b6a5e8d05d47c86713ff804857e037112aac008865934fa3419581034e69d3"
}
@@ -0,0 +1,28 @@
{
"db_name": "PostgreSQL",
"query": "SELECT super_admin, login_type = 'password' AND totp_secret IS NULL AS \"lacks_totp!\"\n FROM password WHERE email = $1 AND disabled = false",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "super_admin",
"type_info": "Bool"
},
{
"ordinal": 1,
"name": "lacks_totp!",
"type_info": "Bool"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
false,
null
]
},
"hash": "235d480efa2a0d8ea0a530454a52aa1fa5a76623cf2e7b75774435cdac9720d0"
}
@@ -0,0 +1,97 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT j.id AS \"id!\",\n COALESCE(j.root_job, j.parent_job, j.id) AS \"root_job_id!\",\n j.runnable_path,\n j.permissioned_as_email AS \"email!\",\n j.created_by AS \"created_by!\",\n j.created_at AS \"created_at!\",\n COALESCE(rj.runnable_path, j.runnable_path) AS flow_path,\n NULLIF(f.summary, '') AS flow_summary,\n s.flow_status->'approval_conditions' AS approval_conditions,\n NULLIF(w.m->'home'->>'step_summary', '') AS step_summary,\n COALESCE((w.m->>'count')::bigint, 1) AS \"required_approvals!\",\n -- Counted as the worker counts them: those sent to the approval step's job,\n -- plus those sent to the flow itself.\n (SELECT count(*) FROM resume_job r WHERE r.job IN (j.id, (w.m->>'job')::uuid))\n AS \"approvals!\",\n EXISTS(SELECT 1 FROM resume_job r\n WHERE r.job IN (j.id, (w.m->>'job')::uuid) AND r.approver = $2)\n AS \"approved_by_me!\"\n FROM v2_job_queue q\n JOIN v2_job j ON j.id = q.id\n JOIN v2_job_status s ON s.id = q.id\n LEFT JOIN v2_job rj ON rj.id = COALESCE(j.root_job, j.parent_job)\n LEFT JOIN flow f\n ON f.workspace_id = j.workspace_id\n AND f.path = COALESCE(rj.runnable_path, j.runnable_path)\n -- The step waiting on the approval, which the worker marks `home` when the approval\n -- step has `show_on_home`: only those are listed, since many approvals are announced\n -- elsewhere (a resume link sent to a chat) and every admin and owner could give them.\n CROSS JOIN LATERAL (\n SELECT s.flow_status->'modules'->((s.flow_status->>'step')::int) AS m\n ) w\n WHERE q.workspace_id = $1\n AND q.suspend > 0\n AND w.m->>'type' = 'WaitingForEvents'\n AND w.m->'home' IS NOT NULL\n AND ($4::text[] IS NULL OR j.tag = ANY($4))\n ORDER BY j.created_at DESC\n LIMIT $3\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id!",
"type_info": "Uuid"
},
{
"ordinal": 1,
"name": "root_job_id!",
"type_info": "Uuid"
},
{
"ordinal": 2,
"name": "runnable_path",
"type_info": "Varchar"
},
{
"ordinal": 3,
"name": "email!",
"type_info": "Varchar"
},
{
"ordinal": 4,
"name": "created_by!",
"type_info": "Varchar"
},
{
"ordinal": 5,
"name": "created_at!",
"type_info": "Timestamptz"
},
{
"ordinal": 6,
"name": "flow_path",
"type_info": "Varchar"
},
{
"ordinal": 7,
"name": "flow_summary",
"type_info": "Text"
},
{
"ordinal": 8,
"name": "approval_conditions",
"type_info": "Jsonb"
},
{
"ordinal": 9,
"name": "step_summary",
"type_info": "Text"
},
{
"ordinal": 10,
"name": "required_approvals!",
"type_info": "Int8"
},
{
"ordinal": 11,
"name": "approvals!",
"type_info": "Int8"
},
{
"ordinal": 12,
"name": "approved_by_me!",
"type_info": "Bool"
}
],
"parameters": {
"Left": [
"Text",
"Text",
"Int8",
"TextArray"
]
},
"nullable": [
false,
null,
true,
false,
false,
false,
null,
null,
null,
null,
null,
null,
null
]
},
"hash": "25a603879c2324cf4390a4d8ff3ce820f1f96d2c22e645a17b1125a949f8dd88"
}
@@ -0,0 +1,44 @@
{
"db_name": "PostgreSQL",
"query": "SELECT to_char(timestamp AT TIME ZONE 'UTC', 'YYYY-MM-DD') AS \"day!\",\n id AS \"id!\",\n timestamp AS \"ts!\",\n row_to_json(r)::text AS \"line!\"\n FROM (\n SELECT workspace_id, id, timestamp, username, operation,\n action_kind::text AS action_kind, resource, parameters, email, span,\n client_ip, user_agent, peer_ip, forwarded_for\n FROM audit_partitioned\n WHERE timestamp >= $1 AND timestamp < $2\n AND (timestamp, id) > ($3, $4)\n ORDER BY timestamp, id\n LIMIT $5\n ) r\n ORDER BY timestamp, id",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "day!",
"type_info": "Text"
},
{
"ordinal": 1,
"name": "id!",
"type_info": "Int8"
},
{
"ordinal": 2,
"name": "ts!",
"type_info": "Timestamptz"
},
{
"ordinal": 3,
"name": "line!",
"type_info": "Text"
}
],
"parameters": {
"Left": [
"Timestamptz",
"Timestamptz",
"Timestamptz",
"Int8",
"Int8"
]
},
"nullable": [
null,
false,
false,
null
]
},
"hash": "25ddcc281bb8a5f046176bc57749f3e17e9346c3822336c7b001e04a711449a8"
}
@@ -0,0 +1,24 @@
{
"db_name": "PostgreSQL",
"query": "SELECT path FROM resource\n WHERE workspace_id = $1 AND path = ANY($2) AND extra_perms ?| $3",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "path",
"type_info": "Varchar"
}
],
"parameters": {
"Left": [
"Text",
"TextArray",
"TextArray"
]
},
"nullable": [
false
]
},
"hash": "269ef755d901662606ce1a4dbcf333331b8500e25ee4196bd5261a953ef876da"
}
@@ -1,15 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE token SET super_admin = $1 WHERE email = $2 AND label != 'session'\n AND (NOT $1 OR NOT EXISTS (SELECT 1 FROM unnest(scopes) s WHERE s LIKE 'mcp:%'))",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Bool",
"Text"
]
},
"nullable": []
},
"hash": "2aaac7db9463db32f8fb24418aad9aa1e775741631cef8da46d922a0ac63d9b3"
}
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO token\n (token_hash, token_prefix, token, label, super_admin, email)\n VALUES ($1, $2, $3, $4, $5, $6)",
"query": "INSERT INTO token\n (token_hash, token_prefix, token, label, super_admin, email, admin)\n VALUES ($1, $2, $3, $4, $5, $6, true)",
"describe": {
"columns": [],
"parameters": {
@@ -15,5 +15,5 @@
},
"nullable": []
},
"hash": "fd4c5391107af34a3bf9b83b0c3f7d5ee9490240a627b20a1037444845e39c5f"
"hash": "2c70b10578338d5722e5fa4f43b92ab3384f62ae44824b3ba15a4d7921435ca7"
}
@@ -0,0 +1,21 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO token\n (token_hash, token_prefix, token, email, label, expiration, super_admin, owner, allowed_ips, admin)\n VALUES ($1, $2, $3, $4, $5, $6, false, $7, $8::text[]::cidr[], true)",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Varchar",
"Varchar",
"Varchar",
"Varchar",
"Varchar",
"Timestamptz",
"Varchar",
"TextArray"
]
},
"nullable": []
},
"hash": "305f8db93baaa55c2b46192eea353f84ba03bf0c9a8a409386c6c1ef5305dc8d"
}
@@ -0,0 +1,20 @@
{
"db_name": "PostgreSQL",
"query": "SELECT email FROM password WHERE totp_secret IS NOT NULL",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "email",
"type_info": "Varchar"
}
],
"parameters": {
"Left": []
},
"nullable": [
false
]
},
"hash": "31c9a45b4db0ceca15338aa9e95a4a4eb82c330c9838c8358d1067e6a6dc05dd"
}
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE volume\n SET size_bytes = $3, file_count = $4,\n updated_at = now(), updated_by = $5, last_used_at = now(),\n lease_until = NULL, leased_by = NULL, generation = generation + generation % 2\n WHERE workspace_id = $1 AND name = $2",
"query": "UPDATE volume\n SET size_bytes = $3, file_count = $4,\n updated_at = now(), updated_by = $5, last_used_at = now(),\n lease_until = NULL, leased_by = NULL, generation = generation + generation % 2\n WHERE workspace_id = $1 AND name = $2 AND leased_by = $5",
"describe": {
"columns": [],
"parameters": {
@@ -14,5 +14,5 @@
},
"nullable": []
},
"hash": "19c481a0d6ecd4c0dfab6973e4732c2146953253ba6062ab05b34b6b35e41f66"
"hash": "3339c1d01792ff181f9506b57c7e6771c3a1a2a5a67dd467ed263b3501c5d279"
}
@@ -0,0 +1,28 @@
{
"db_name": "PostgreSQL",
"query": "SELECT r AS risk, count(*) AS n FROM token_risk, unnest(risks) r WHERE email = $1 GROUP BY r",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "risk",
"type_info": "Text"
},
{
"ordinal": 1,
"name": "n",
"type_info": "Int8"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
null,
null
]
},
"hash": "34854f8d651562512ac522db1dc0c43946b7440bd427d045b8d8b83ba7a3ab26"
}
@@ -0,0 +1,20 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE v2_job_queue\n SET canceled_by = $3, canceled_reason = $4, scheduled_for = now(), suspend = 0\n WHERE id = ANY($2) AND workspace_id = $5 AND canceled_by IS NULL\n AND (suspend > 0 OR NOT running)\n AND NOT EXISTS (SELECT 1 FROM v2_job c WHERE c.parent_job = v2_job_queue.id)\n AND (SELECT count(*) FROM v2_job_status s,\n jsonb_array_elements(s.flow_status->'modules'->$6::int->'flow_jobs_success') e\n WHERE s.id = $1 AND e = 'false'::jsonb) >= $7",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid",
"UuidArray",
"Varchar",
"Text",
"Text",
"Int4",
"Int8"
]
},
"nullable": []
},
"hash": "36270d5bc57411ee110b5299ceb04e0c39747ff8f2aebfed1e3478c4baa2b748"
}
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "SELECT hash, created_at, content, summary, description, lock, schema\n FROM script\n WHERE workspace_id = $1 AND path = $2 AND archived = false\n ORDER BY created_at DESC\n LIMIT 1",
"query": "SELECT hash, created_at, content, summary, description, lock, schema, labels\n FROM script\n WHERE workspace_id = $1 AND path = $2 AND archived = false\n ORDER BY created_at DESC\n LIMIT 1",
"describe": {
"columns": [
{
@@ -37,6 +37,11 @@
"ordinal": 6,
"name": "schema",
"type_info": "Json"
},
{
"ordinal": 7,
"name": "labels",
"type_info": "TextArray"
}
],
"parameters": {
@@ -52,8 +57,9 @@
false,
false,
true,
true,
true
]
},
"hash": "a6fe41e36e06c88e1387abaea17107ceab2c5b17258958bde03b3e492bb2790e"
"hash": "398b309a86c3abe0b8daf2ec256dd4eac403ea69d09d7b13d6f5a0b21e2b034a"
}
@@ -0,0 +1,65 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE token SET last_used_at = now() WHERE\n token_hash = $1\n AND (expiration > NOW() OR expiration IS NULL)\n AND (workspace_id IS NULL OR workspace_id = $2)\n RETURNING owner, email, super_admin, scopes, label, read_only,\n allowed_ips::text[] AS allowed_ips, admin",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "owner",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "email",
"type_info": "Varchar"
},
{
"ordinal": 2,
"name": "super_admin",
"type_info": "Bool"
},
{
"ordinal": 3,
"name": "scopes",
"type_info": "TextArray"
},
{
"ordinal": 4,
"name": "label",
"type_info": "Varchar"
},
{
"ordinal": 5,
"name": "read_only",
"type_info": "Bool"
},
{
"ordinal": 6,
"name": "allowed_ips",
"type_info": "TextArray"
},
{
"ordinal": 7,
"name": "admin",
"type_info": "Bool"
}
],
"parameters": {
"Left": [
"Text",
"Text"
]
},
"nullable": [
true,
true,
false,
true,
true,
false,
null,
false
]
},
"hash": "3c2031a385e80273a15d45d45ede51c89c6fdadfcce19f23c518040e82d1df69"
}
@@ -0,0 +1,41 @@
{
"db_name": "PostgreSQL",
"query": "SELECT resume_id, approver, created_at, approved FROM resume_job\n WHERE flow = $1 AND ($2::uuid IS NULL OR job IN ($1, $2))",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "resume_id",
"type_info": "Int4"
},
{
"ordinal": 1,
"name": "approver",
"type_info": "Varchar"
},
{
"ordinal": 2,
"name": "created_at",
"type_info": "Timestamptz"
},
{
"ordinal": 3,
"name": "approved",
"type_info": "Bool"
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid"
]
},
"nullable": [
false,
true,
false,
false
]
},
"hash": "456f07b39a39791ea4c0764adc235374571db2fa45b6e97db42e8309ecb02c05"
}
@@ -0,0 +1,22 @@
{
"db_name": "PostgreSQL",
"query": "SELECT account FROM variable WHERE workspace_id = 'test-workspace' AND path = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "account",
"type_info": "Int4"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
true
]
},
"hash": "483d07c7ad9cf0cb402a5800445cd3f22d75213ebb950af902c4a3fc078f5017"
}
@@ -0,0 +1,15 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO flow (\n workspace_id, path, summary, description, value, edited_by, edited_at,\n archived, schema, extra_perms, dependency_job, tag,\n ws_error_handler_muted, dedicated_worker, timeout, visible_to_runner_only,\n concurrency_key, versions, on_behalf_of, on_behalf_of_email, lock_error_logs,\n job_token_scopes, labels\n )\n SELECT $2, path, summary, description, value, edited_by, edited_at,\n archived, schema, extra_perms, NULL, tag,\n ws_error_handler_muted, dedicated_worker, timeout, visible_to_runner_only,\n concurrency_key, ARRAY[]::bigint[],\n -- Same predicate as clone_scripts.\n CASE WHEN on_behalf_of LIKE 'u/%' THEN\n (SELECT on_behalf_of WHERE EXISTS (\n SELECT 1 FROM usr u WHERE u.workspace_id = $2::varchar\n AND u.username = substring(on_behalf_of from 3)\n UNION ALL\n SELECT 1 FROM password p WHERE p.super_admin\n AND (p.username = substring(on_behalf_of from 3)\n OR p.email = substring(on_behalf_of from 3))))\n WHEN on_behalf_of LIKE 'g/%' THEN\n (SELECT on_behalf_of WHERE EXISTS (\n SELECT 1 FROM group_ g WHERE g.workspace_id = $2::varchar\n AND g.name = substring(on_behalf_of from 3)))\n ELSE\n (SELECT on_behalf_of WHERE EXISTS (\n SELECT 1 FROM usr u WHERE u.workspace_id = $2::varchar\n AND u.username = on_behalf_of\n UNION ALL\n SELECT 1 FROM password p WHERE p.email = on_behalf_of\n AND p.super_admin))\n END, on_behalf_of_email, lock_error_logs, job_token_scopes, labels\n FROM flow\n WHERE workspace_id = $1",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text",
"Varchar"
]
},
"nullable": []
},
"hash": "4a5679413cd1f5b1b2822a4804a54b2a5a008d7c3313c90fb80d431057223b34"
}
@@ -0,0 +1,20 @@
{
"db_name": "PostgreSQL",
"query": "SELECT 1 AS \"one!\" FROM workspace_key\n WHERE workspace_id = 'admins' AND kind = 'cloud' FOR UPDATE",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "one!",
"type_info": "Int4"
}
],
"parameters": {
"Left": []
},
"nullable": [
null
]
},
"hash": "4b8fe0471867cbf4bbb571eae4fc097b36b70a46748fa0c2eedae610173bde86"
}
@@ -0,0 +1,38 @@
{
"db_name": "PostgreSQL",
"query": "DELETE FROM password RETURNING email, totp_secret, totp_last_step, totp_recovery_codes",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "email",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "totp_secret",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "totp_last_step",
"type_info": "Int8"
},
{
"ordinal": 3,
"name": "totp_recovery_codes",
"type_info": "TextArray"
}
],
"parameters": {
"Left": []
},
"nullable": [
false,
true,
true,
true
]
},
"hash": "4c100853478519e794d05fe6070acfe8ddb246ceaed99e9e25f6bd34b105c6de"
}
@@ -0,0 +1,22 @@
{
"db_name": "PostgreSQL",
"query": "SELECT password_hash FROM password WHERE email = $1 AND login_type = 'password'",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "password_hash",
"type_info": "Varchar"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
true
]
},
"hash": "4d6646a2bccd6599cdd0d603a2e64f621449524162ef02ff52825af519f576e9"
}
@@ -0,0 +1,14 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE password SET\n totp_failed_attempts = CASE WHEN totp_failed_since > now() - interval '1 minute'\n THEN totp_failed_attempts + 1 ELSE 1 END,\n totp_failed_since = CASE WHEN totp_failed_since > now() - interval '1 minute'\n THEN totp_failed_since ELSE now() END\n WHERE email = $1",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text"
]
},
"nullable": []
},
"hash": "4e57eb6c62eb8a04088e91cae5cf955af22d885b24908c3beb949be24378797f"
}
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "SELECT id, workspace_id, path, summary, policy, versions, extra_perms, custom_path\n FROM app\n WHERE workspace_id = $1",
"query": "SELECT id, workspace_id, path, summary, policy, versions, extra_perms, custom_path, labels\n FROM app\n WHERE workspace_id = $1",
"describe": {
"columns": [
{
@@ -42,6 +42,11 @@
"ordinal": 7,
"name": "custom_path",
"type_info": "Text"
},
{
"ordinal": 8,
"name": "labels",
"type_info": "TextArray"
}
],
"parameters": {
@@ -57,8 +62,9 @@
false,
false,
false,
true,
true
]
},
"hash": "26fb727ef7d50c93c1c8ce33356ef6feafc448e70c30ba7e7c835f5e3167f3a5"
"hash": "4fff0ec1067f69aa3b67f73e3a7c84177a1050456baa43d348e8b467c5db3b75"
}
@@ -0,0 +1,32 @@
{
"db_name": "PostgreSQL",
"query": "SELECT email, totp_secret, totp_pending_secret FROM password\n WHERE totp_secret IS NOT NULL OR totp_pending_secret IS NOT NULL FOR UPDATE",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "email",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "totp_secret",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "totp_pending_secret",
"type_info": "Text"
}
],
"parameters": {
"Left": []
},
"nullable": [
false,
true,
true
]
},
"hash": "536bda805dc3d1a5e66185787749b02dbefe608a83564cf165157230a4887639"
}
@@ -0,0 +1,14 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE password SET totp_secret = NULL, totp_pending_secret = NULL, totp_last_step = NULL,\n totp_recovery_codes = NULL, totp_failed_attempts = 0, totp_failed_since = NULL\n WHERE email = $1 AND (totp_secret IS NOT NULL OR totp_pending_secret IS NOT NULL)",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text"
]
},
"nullable": []
},
"hash": "547f245179c2f91275a0b8e00e5dc327f3a6fe55fb9020c922603e4e7946b49c"
}
@@ -0,0 +1,25 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO token (token_hash, token_prefix, token, email, label, super_admin, scopes, workspace_id, owner, expiration, allowed_ips, admin)\n VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11::text[]::cidr[], $12)",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Varchar",
"Varchar",
"Varchar",
"Varchar",
"Varchar",
"Bool",
"TextArray",
"Varchar",
"Varchar",
"Timestamptz",
"TextArray",
"Bool"
]
},
"nullable": []
},
"hash": "562275b5ac29438796d01d8cfb885f4b31f6b4834687e0c06d1274b5c84b3a0d"
}
@@ -0,0 +1,26 @@
{
"db_name": "PostgreSQL",
"query": "SELECT r AS risk, count(*) AS n FROM token_risk, unnest(risks) r GROUP BY r",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "risk",
"type_info": "Text"
},
{
"ordinal": 1,
"name": "n",
"type_info": "Int8"
}
],
"parameters": {
"Left": []
},
"nullable": [
null,
null
]
},
"hash": "58bb4c7646404beae1f2183b13aef01f3c1737a1ff5f86c37211ff4aa3290b66"
}
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "SELECT display_name, owners, extra_perms, summary\n FROM folder\n WHERE workspace_id = $1 AND name = $2",
"query": "SELECT display_name, owners, extra_perms, summary, labels\n FROM folder\n WHERE workspace_id = $1 AND name = $2",
"describe": {
"columns": [
{
@@ -22,6 +22,11 @@
"ordinal": 3,
"name": "summary",
"type_info": "Text"
},
{
"ordinal": 4,
"name": "labels",
"type_info": "TextArray"
}
],
"parameters": {
@@ -34,8 +39,9 @@
false,
false,
false,
true,
true
]
},
"hash": "8039b459914ceefe0c0a31b97473a5522e47b4b2fd3ddeff8f221560bc9c6f57"
"hash": "5bd796933edd56a80add193599714e763d17f9514b0746e9e389699c95f6bb7d"
}
@@ -0,0 +1,30 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE token t SET label = $1\n FROM token old\n WHERE old.token_hash = t.token_hash\n AND t.email = $2 AND t.token_prefix = $3\n AND (t.label IS NULL OR (\n t.label <> 'session'\n AND t.label <> 'guest_session'\n AND lower(t.label) NOT LIKE 'ephemeral%'\n AND t.label <> 'debugger-token'\n AND t.label NOT LIKE 'mcp-oauth-%'\n AND NOT starts_with(t.label, 'embed_app:')\n AND NOT starts_with(t.label, 'sdk_app:')\n AND NOT starts_with(t.label, 'impersonation:')\n AND NOT starts_with(t.label, 'cli-login:')\n AND NOT starts_with(t.label, 'remote-deploy:')\n ))\n RETURNING t.token_prefix, old.label AS previous_label",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "token_prefix",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "previous_label",
"type_info": "Varchar"
}
],
"parameters": {
"Left": [
"Varchar",
"Text",
"Text"
]
},
"nullable": [
false,
true
]
},
"hash": "6141c832d916e87dfb353ac73ae4d06088cbdbac4f1a8e7859adfed4c6f64dac"
}
@@ -0,0 +1,47 @@
{
"db_name": "PostgreSQL",
"query": "SELECT v.path, r.created_by AS \"owner?\", false AS \"workspace!\", a.scopes AS \"scopes?\",\n NULL::text[] AS \"missing_scopes?\"\n FROM variable v\n JOIN resource r ON r.workspace_id = v.workspace_id AND r.path = v.path\n LEFT JOIN account a ON a.workspace_id = v.workspace_id AND a.id = v.account\n WHERE v.workspace_id = $1 AND r.resource_type = $2\n ORDER BY v.path",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "path",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "owner?",
"type_info": "Varchar"
},
{
"ordinal": 2,
"name": "workspace!",
"type_info": "Bool"
},
{
"ordinal": 3,
"name": "scopes?",
"type_info": "TextArray"
},
{
"ordinal": 4,
"name": "missing_scopes?",
"type_info": "TextArray"
}
],
"parameters": {
"Left": [
"Text",
"Text"
]
},
"nullable": [
false,
true,
null,
true,
null
]
},
"hash": "62e8902d2e50191325524827b8ed7e8f4bf2a2b54b8522b52c47f8249ba624b0"
}
@@ -0,0 +1,29 @@
{
"db_name": "PostgreSQL",
"query": "SELECT favorite_kind::text AS \"kind!\", path FROM favorite\n WHERE usr = $1 AND workspace_id = $2 AND favorite_kind IN ('script', 'flow')",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "kind!",
"type_info": "Text"
},
{
"ordinal": 1,
"name": "path",
"type_info": "Varchar"
}
],
"parameters": {
"Left": [
"Text",
"Text"
]
},
"nullable": [
null,
false
]
},
"hash": "6550c0a58ae0b258d9b101683f5a14c9edc522a2895925263286fd41d13ff9c7"
}
@@ -0,0 +1,52 @@
{
"db_name": "PostgreSQL",
"query": "SELECT email, workspace_id, super_admin, owner, allowed_ips::text[] AS allowed_ips, admin\n FROM token WHERE token_hash = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "email",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "workspace_id",
"type_info": "Varchar"
},
{
"ordinal": 2,
"name": "super_admin",
"type_info": "Bool"
},
{
"ordinal": 3,
"name": "owner",
"type_info": "Varchar"
},
{
"ordinal": 4,
"name": "allowed_ips",
"type_info": "TextArray"
},
{
"ordinal": 5,
"name": "admin",
"type_info": "Bool"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
true,
true,
false,
true,
null,
false
]
},
"hash": "6bbf56bbc7b647daaba8dc5a4d49bffa976b5da8e8052638b8ee3e3c834dac27"
}
@@ -0,0 +1,16 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO resource (workspace_id, path, value, description, resource_type, extra_perms, edited_at, created_by, labels)\n SELECT $2, path,\n CASE WHEN $3::text IS NOT NULL AND resource_type = 'ai_agent'\n AND jsonb_typeof(value) = 'object' AND value ? 'on_behalf_of'\n THEN jsonb_set(value, '{on_behalf_of}', to_jsonb($3::text))\n ELSE value END,\n description, resource_type, extra_perms, edited_at, created_by, labels\n FROM resource\n WHERE workspace_id = $1",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text",
"Varchar",
"Text"
]
},
"nullable": []
},
"hash": "6c1798b9a60634e908852e65e7583a9bc7d8e6f97559b1f6a2a069a073b7e48c"
}
@@ -0,0 +1,47 @@
{
"db_name": "PostgreSQL",
"query": "SELECT j.id, j.tag, j.kind = 'flownode' AS \"is_node!\",\n COALESCE(s.flow_status, c.flow_status) AS flow_status,\n COALESCE(j.raw_flow, fv.value, fn.flow) AS flow\n FROM v2_job j\n LEFT JOIN v2_job_status s ON s.id = j.id\n LEFT JOIN v2_job_completed c ON c.id = j.id\n LEFT JOIN flow_version fv\n ON j.raw_flow IS NULL AND j.kind = 'flow' AND fv.id = j.runnable_id\n LEFT JOIN flow_node fn\n ON j.raw_flow IS NULL AND j.kind = 'flownode' AND fn.id = j.runnable_id\n WHERE j.id = ANY($1) AND j.workspace_id = $2",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid"
},
{
"ordinal": 1,
"name": "tag",
"type_info": "Varchar"
},
{
"ordinal": 2,
"name": "is_node!",
"type_info": "Bool"
},
{
"ordinal": 3,
"name": "flow_status",
"type_info": "Jsonb"
},
{
"ordinal": 4,
"name": "flow",
"type_info": "Jsonb"
}
],
"parameters": {
"Left": [
"UuidArray",
"Text"
]
},
"nullable": [
false,
false,
null,
null,
null
]
},
"hash": "6f9c95e209ad7161ec02b70c156a31e640ed9e8c7fcdc5bd2da94bc5728f0455"
}
@@ -1,15 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO script (\n workspace_id, hash, path, parent_hashes, summary, description, content,\n created_by, created_at, archived, schema, deleted, is_template,\n extra_perms, lock, lock_error_logs, language, kind, tag,\n envs, concurrent_limit, concurrency_time_window_s, cache_ttl,\n dedicated_worker, ws_error_handler_muted, priority, timeout,\n delete_after_use, delete_after_secs, restart_unless_cancelled, concurrency_key,\n visible_to_runner_only, auto_kind, codebase, has_preprocessor,\n on_behalf_of, on_behalf_of_email, assets, modules, job_token_scopes\n )\n SELECT\n $1, hash, path, parent_hashes, summary, description, content,\n created_by, created_at, archived, schema, deleted, is_template,\n extra_perms, lock, lock_error_logs, language, kind, tag,\n envs, concurrent_limit, concurrency_time_window_s, cache_ttl,\n dedicated_worker, ws_error_handler_muted, priority, timeout,\n delete_after_use, delete_after_secs, restart_unless_cancelled, concurrency_key,\n visible_to_runner_only, auto_kind, codebase, has_preprocessor,\n -- Same three forms and the same prefix-first rule as permissioned_as_exists,\n -- superadmin fallback included: one acting outside their workspaces has no usr\n -- row but still authenticates.\n CASE WHEN on_behalf_of LIKE 'u/%' THEN\n (SELECT on_behalf_of WHERE EXISTS (\n SELECT 1 FROM usr u WHERE u.workspace_id = $1::varchar\n AND u.username = substring(on_behalf_of from 3)\n UNION ALL\n SELECT 1 FROM password p WHERE p.super_admin\n AND (p.username = substring(on_behalf_of from 3)\n OR p.email = substring(on_behalf_of from 3))))\n WHEN on_behalf_of LIKE 'g/%' THEN\n (SELECT on_behalf_of WHERE EXISTS (\n SELECT 1 FROM group_ g WHERE g.workspace_id = $1::varchar\n AND g.name = substring(on_behalf_of from 3)))\n ELSE\n (SELECT on_behalf_of WHERE EXISTS (\n SELECT 1 FROM usr u WHERE u.workspace_id = $1::varchar\n AND u.username = on_behalf_of\n UNION ALL\n SELECT 1 FROM password p WHERE p.email = on_behalf_of\n AND p.super_admin))\n END, on_behalf_of_email, assets, modules, job_token_scopes\n FROM script\n WHERE workspace_id = $2",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Varchar",
"Text"
]
},
"nullable": []
},
"hash": "706f2227e34971d22a577b33f6aaa7f5755da9997419c4a9d07b30d4da318bea"
}
@@ -0,0 +1,25 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO token\n (token_hash, token_prefix, token, email, label, expiration, super_admin, scopes, workspace_id, read_only, allowed_ips, admin)\n SELECT $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11::text[]::cidr[], $12\n WHERE $9::varchar IS NULL OR NOT EXISTS(\n SELECT 1 FROM workspace WHERE id = $9 AND deleted = true\n )",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Varchar",
"Varchar",
"Varchar",
"Varchar",
"Varchar",
"Timestamptz",
"Bool",
"TextArray",
"Varchar",
"Bool",
"TextArray",
"Bool"
]
},
"nullable": []
},
"hash": "7209d20f905f1dd81479e91c5748fcd59ddabaa0ad68e1ac74313948ce1457d1"
}
@@ -0,0 +1,23 @@
{
"db_name": "PostgreSQL",
"query": "SELECT 1 FROM variable WHERE path = $1 AND workspace_id = $2 FOR UPDATE",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "?column?",
"type_info": "Int4"
}
],
"parameters": {
"Left": [
"Text",
"Text"
]
},
"nullable": [
null
]
},
"hash": "756524a33cf4923bb0b2a037930faf2f63e8b74389fd543d3b1fbea114706bbd"
}
@@ -1,25 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "SELECT EXISTS (\n SELECT 1 FROM v2_job_completed c JOIN v2_job j USING (id)\n WHERE j.workspace_id = $2\n AND c.started_at > now() - interval '3 hours'\n AND c.result @> ('{\"s3\":\"' || $1 || '\"}')::jsonb\n AND j.trigger_kind = 'app'\n AND j.trigger = $3\n AND j.created_by = $4\n )",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "exists",
"type_info": "Bool"
}
],
"parameters": {
"Left": [
"Text",
"Text",
"Text",
"Text"
]
},
"nullable": [
null
]
},
"hash": "75d1618e12c4dfe5e9632ba8dc45b5aeb572e51ebd0732e6ebf80197acb3e577"
}
@@ -0,0 +1,32 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO account (workspace_id, client, expires_at, refresh_token, grant_type, cc_client_id, cc_client_secret, cc_token_url, mcp_server_url, scopes, is_workspace_integration) VALUES ($1, $2, now() + ($3 || ' seconds')::interval, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING id",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Int4"
}
],
"parameters": {
"Left": [
"Varchar",
"Varchar",
"Text",
"Varchar",
"Varchar",
"Varchar",
"Varchar",
"Varchar",
"Text",
"TextArray",
"Bool"
]
},
"nullable": [
false
]
},
"hash": "7856dbf515932a2aa31e2124f5cc845a8d8da9e32e2a5b666a220398c76d1266"
}
@@ -0,0 +1,15 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO script (\n workspace_id, hash, path, parent_hashes, summary, description, content,\n created_by, created_at, archived, schema, deleted, is_template,\n extra_perms, lock, lock_error_logs, language, kind, tag,\n envs, concurrent_limit, concurrency_time_window_s, cache_ttl,\n dedicated_worker, ws_error_handler_muted, priority, timeout,\n delete_after_use, delete_after_secs, restart_unless_cancelled, concurrency_key,\n visible_to_runner_only, auto_kind, codebase, has_preprocessor,\n on_behalf_of, on_behalf_of_email, assets, modules, job_token_scopes, labels\n )\n SELECT\n $1, hash, path, parent_hashes, summary, description, content,\n created_by, created_at, archived, schema, deleted, is_template,\n extra_perms, lock, lock_error_logs, language, kind, tag,\n envs, concurrent_limit, concurrency_time_window_s, cache_ttl,\n dedicated_worker, ws_error_handler_muted, priority, timeout,\n delete_after_use, delete_after_secs, restart_unless_cancelled, concurrency_key,\n visible_to_runner_only, auto_kind, codebase, has_preprocessor,\n -- Same three forms and the same prefix-first rule as permissioned_as_exists,\n -- superadmin fallback included: one acting outside their workspaces has no usr\n -- row but still authenticates.\n CASE WHEN on_behalf_of LIKE 'u/%' THEN\n (SELECT on_behalf_of WHERE EXISTS (\n SELECT 1 FROM usr u WHERE u.workspace_id = $1::varchar\n AND u.username = substring(on_behalf_of from 3)\n UNION ALL\n SELECT 1 FROM password p WHERE p.super_admin\n AND (p.username = substring(on_behalf_of from 3)\n OR p.email = substring(on_behalf_of from 3))))\n WHEN on_behalf_of LIKE 'g/%' THEN\n (SELECT on_behalf_of WHERE EXISTS (\n SELECT 1 FROM group_ g WHERE g.workspace_id = $1::varchar\n AND g.name = substring(on_behalf_of from 3)))\n ELSE\n (SELECT on_behalf_of WHERE EXISTS (\n SELECT 1 FROM usr u WHERE u.workspace_id = $1::varchar\n AND u.username = on_behalf_of\n UNION ALL\n SELECT 1 FROM password p WHERE p.email = on_behalf_of\n AND p.super_admin))\n END, on_behalf_of_email, assets, modules, job_token_scopes, labels\n FROM script\n WHERE workspace_id = $2",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Varchar",
"Text"
]
},
"nullable": []
},
"hash": "78d53c53d22bdd8948a3375a19a2b3a87eb50150eb7b6888bc32a9d48a5ad21f"
}
@@ -0,0 +1,15 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE concurrency_key SET released_at = $2 WHERE job_id = $1 AND released_at IS NULL",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid",
"Timestamptz"
]
},
"nullable": []
},
"hash": "79ad082adcef4e3dd4745bff5f498889cdd0f5365bd43442ac745997f1a4173c"
}
@@ -0,0 +1,149 @@
{
"db_name": "PostgreSQL",
"query": "SELECT resource.workspace_id, resource.path, resource.value, resource.description,\n resource.resource_type, resource.extra_perms, resource.created_by, resource.edited_at,\n resource.labels,\n folder_labels(resource.workspace_id, resource.path) as \"inherited_labels?\",\n (now() > account.expires_at) as is_expired, account.refresh_token != '' as is_refreshed,\n account.refresh_error, account.scopes as \"scopes?\", account.client as \"client?\",\n account.is_workspace_integration as \"is_workspace_integration?\",\n variable.path IS NOT NULL as is_linked,\n variable.is_oauth as \"is_oauth?\",\n variable.account,\n ws_specific.path IS NOT NULL as ws_specific,\n null::bool as draft_only,\n null::bool as is_draft\n FROM resource\n LEFT JOIN variable ON variable.path = resource.path AND variable.workspace_id = $2\n LEFT JOIN account ON variable.account = account.id AND account.workspace_id = $2\n LEFT JOIN ws_specific ON ws_specific.path = resource.path AND ws_specific.workspace_id = $2 AND ws_specific.item_kind = 'resource'\n WHERE resource.path = $1 AND resource.workspace_id = $2",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "workspace_id",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "path",
"type_info": "Varchar"
},
{
"ordinal": 2,
"name": "value",
"type_info": "Jsonb"
},
{
"ordinal": 3,
"name": "description",
"type_info": "Text"
},
{
"ordinal": 4,
"name": "resource_type",
"type_info": "Varchar"
},
{
"ordinal": 5,
"name": "extra_perms",
"type_info": "Jsonb"
},
{
"ordinal": 6,
"name": "created_by",
"type_info": "Varchar"
},
{
"ordinal": 7,
"name": "edited_at",
"type_info": "Timestamptz"
},
{
"ordinal": 8,
"name": "labels",
"type_info": "TextArray"
},
{
"ordinal": 9,
"name": "inherited_labels?",
"type_info": "TextArray"
},
{
"ordinal": 10,
"name": "is_expired",
"type_info": "Bool"
},
{
"ordinal": 11,
"name": "is_refreshed",
"type_info": "Bool"
},
{
"ordinal": 12,
"name": "refresh_error",
"type_info": "Text"
},
{
"ordinal": 13,
"name": "scopes?",
"type_info": "TextArray"
},
{
"ordinal": 14,
"name": "client?",
"type_info": "Varchar"
},
{
"ordinal": 15,
"name": "is_workspace_integration?",
"type_info": "Bool"
},
{
"ordinal": 16,
"name": "is_linked",
"type_info": "Bool"
},
{
"ordinal": 17,
"name": "is_oauth?",
"type_info": "Bool"
},
{
"ordinal": 18,
"name": "account",
"type_info": "Int4"
},
{
"ordinal": 19,
"name": "ws_specific",
"type_info": "Bool"
},
{
"ordinal": 20,
"name": "draft_only",
"type_info": "Bool"
},
{
"ordinal": 21,
"name": "is_draft",
"type_info": "Bool"
}
],
"parameters": {
"Left": [
"Text",
"Text"
]
},
"nullable": [
false,
false,
true,
true,
false,
false,
true,
true,
true,
null,
null,
null,
true,
true,
false,
false,
null,
false,
true,
null,
null,
null
]
},
"hash": "79eed97c7119a64f00b85679c491a5001d75fa977a6f57d806d0d1fb28564a23"
}
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "\n WITH j AS (\n SELECT \n raw_flow->>'concurrency_key' as concurrency_key, \n raw_flow->>'concurrency_time_window_s' as concurrency_time_window_s,\n raw_flow->>'concurrency_limit' as concurrent_limit,\n runnable_path, \n runnable_id as version FROM v2_job\n WHERE id = $1\n )\n SELECT tag, j.concurrency_key, j.concurrency_time_window_s::int, j.concurrent_limit::int, j.version\n FROM flow, j\n WHERE path = j.runnable_path\n ",
"query": "\n WITH j AS (\n SELECT \n raw_flow->>'concurrency_key' as concurrency_key, \n raw_flow->>'concurrency_time_window_s' as concurrency_time_window_s,\n raw_flow->>'concurrency_limit' as concurrent_limit,\n runnable_path, \n workspace_id,\n runnable_id as version FROM v2_job\n WHERE id = $1\n )\n SELECT tag, j.concurrency_key, j.concurrency_time_window_s::int, j.concurrent_limit::int, j.version\n FROM flow, j\n WHERE path = j.runnable_path AND flow.workspace_id = j.workspace_id\n ",
"describe": {
"columns": [
{
@@ -42,5 +42,5 @@
true
]
},
"hash": "b7335ac24702c86fbb4ab95916a6aa1648082287b09122755df2462dc71ce831"
"hash": "7af495acd76616fcb91b058b12e852363a314b39a7aa0ee2beaeab549378e7c0"
}
@@ -0,0 +1,23 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO token\n (token_hash, token_prefix, token, email, label, expiration, super_admin, allowed_ips,\n workspace_id, admin)\n SELECT $1, $2, $3, $4, $5, $6, $7, $8::text[]::cidr[], $9, $10\n WHERE $9::varchar IS NULL OR NOT EXISTS(\n SELECT 1 FROM workspace WHERE id = $9 AND deleted = true\n )",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Varchar",
"Varchar",
"Varchar",
"Varchar",
"Varchar",
"Timestamptz",
"Bool",
"TextArray",
"Varchar",
"Bool"
]
},
"nullable": []
},
"hash": "7c420846f546d4307cc503e3a6eafdad0b565360247a644ef7777eecd3e99e1a"
}
@@ -0,0 +1,90 @@
{
"db_name": "PostgreSQL",
"query": "SELECT label, token_prefix AS \"token_prefix!\", expiration,\n created_at AS \"created_at!\", last_used_at AS \"last_used_at!\", scopes, workspace_id,\n read_only AS \"read_only!\", allowed_ips::text[] AS allowed_ips,\n admin AS \"admin!\", super_admin AS \"super_admin!\", risks AS \"risks!\"\n FROM token_risk WHERE email = $1 AND (label != 'ephemeral-script' OR label IS NULL)\n ORDER BY created_at DESC LIMIT $2 OFFSET $3",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "label",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "token_prefix!",
"type_info": "Varchar"
},
{
"ordinal": 2,
"name": "expiration",
"type_info": "Timestamptz"
},
{
"ordinal": 3,
"name": "created_at!",
"type_info": "Timestamptz"
},
{
"ordinal": 4,
"name": "last_used_at!",
"type_info": "Timestamptz"
},
{
"ordinal": 5,
"name": "scopes",
"type_info": "TextArray"
},
{
"ordinal": 6,
"name": "workspace_id",
"type_info": "Varchar"
},
{
"ordinal": 7,
"name": "read_only!",
"type_info": "Bool"
},
{
"ordinal": 8,
"name": "allowed_ips",
"type_info": "TextArray"
},
{
"ordinal": 9,
"name": "admin!",
"type_info": "Bool"
},
{
"ordinal": 10,
"name": "super_admin!",
"type_info": "Bool"
},
{
"ordinal": 11,
"name": "risks!",
"type_info": "TextArray"
}
],
"parameters": {
"Left": [
"Text",
"Int8",
"Int8"
]
},
"nullable": [
true,
true,
true,
true,
true,
true,
true,
true,
null,
true,
true,
true
]
},
"hash": "7c70080e4d6248c9593ebfe8c3c3a09252f353124ddad863100f3598f6241fb1"
}
@@ -0,0 +1,14 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE password SET totp_failed_attempts = 0, totp_failed_since = NULL WHERE email = $1",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text"
]
},
"nullable": []
},
"hash": "80a33efd3fd3e9bb447568f7e51aecdedadcbf2aaf65820b91793accbd695032"
}
@@ -0,0 +1,22 @@
{
"db_name": "PostgreSQL",
"query": "SELECT totp_secret IS NOT NULL AS \"enrolled!\" FROM password\n WHERE email = $1 AND login_type = 'password'",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "enrolled!",
"type_info": "Bool"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
null
]
},
"hash": "8449b974fcedf52f9746ae6fd6a052977a44f8b068285949cef8b6ac3ecd6dce"
}
@@ -0,0 +1,18 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE variable SET value = $3, account = $4, edited_by = $5, edited_at = now()\n WHERE workspace_id = $1 AND path = $2",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text",
"Text",
"Varchar",
"Int4",
"Varchar"
]
},
"nullable": []
},
"hash": "850fa2b74ada0abebf3905a8596c13dcaae05ce1e15146c77c864c2ad6abbcf5"
}
@@ -0,0 +1,22 @@
{
"db_name": "PostgreSQL",
"query": "SELECT key FROM workspace_key WHERE workspace_id = $1 AND kind = 'cloud' FOR SHARE",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "key",
"type_info": "Varchar"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
false
]
},
"hash": "8728e856ad6ba82495890e466f5226b401927d6ada71f91e0a035f9945dbf036"
}
@@ -0,0 +1,57 @@
{
"db_name": "PostgreSQL",
"query": "WITH v AS (\n SELECT c.result #> $3 AS r, created_by\n FROM v2_job_completed c JOIN v2_job USING (id)\n WHERE c.id = $1 AND c.workspace_id = $2 AND ($4::text[] IS NULL OR tag = ANY($4))\n )\n SELECT\n created_by AS \"created_by!\",\n jsonb_typeof(r) AS \"type\",\n length(r::text) AS \"length\",\n CASE WHEN jsonb_typeof(r) = 'object' THEN\n ARRAY(SELECT jsonb_object_keys(r) LIMIT $6)\n END AS \"keys\",\n CASE WHEN jsonb_typeof(r) = 'array' THEN jsonb_array_length(r) END AS \"item_count\",\n CASE WHEN jsonb_typeof(r) = 'array' THEN (\n SELECT jsonb_agg(jsonb_build_object(\n 'length', length(e::text),\n 'keys', CASE WHEN jsonb_typeof(e) = 'object' THEN\n to_jsonb(ARRAY(SELECT jsonb_object_keys(e) LIMIT $6))\n END\n ) ORDER BY i)\n FROM jsonb_array_elements(r) WITH ORDINALITY AS t(e, i)\n WHERE i <= $5\n ) END AS \"items: sqlx::types::Json<Vec<ResultShapeItem>>\"\n FROM v",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "created_by!",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "type",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "length",
"type_info": "Int4"
},
{
"ordinal": 3,
"name": "keys",
"type_info": "TextArray"
},
{
"ordinal": 4,
"name": "item_count",
"type_info": "Int4"
},
{
"ordinal": 5,
"name": "items: sqlx::types::Json<Vec<ResultShapeItem>>",
"type_info": "Jsonb"
}
],
"parameters": {
"Left": [
"Uuid",
"Text",
"TextArray",
"TextArray",
"Int8",
"Int8"
]
},
"nullable": [
false,
null,
null,
null,
null,
null
]
},
"hash": "8b088d35a98d695c35d0ffe3ee3d104d2e4275bd1e9562927d591650382d510d"
}
@@ -0,0 +1,35 @@
{
"db_name": "PostgreSQL",
"query": "SELECT name, bypass_users, bypass_groups FROM workspace_protection_rule\n WHERE workspace_id = $1 AND (rules & $2) <> 0 ORDER BY name",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "name",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "bypass_users",
"type_info": "TextArray"
},
{
"ordinal": 2,
"name": "bypass_groups",
"type_info": "TextArray"
}
],
"parameters": {
"Left": [
"Text",
"Int4"
]
},
"nullable": [
false,
false,
false
]
},
"hash": "8c8ab1f498ca1460d2b58d95c09af1e3230e8f7cfd7a49b4fec87110e31470fa"
}
@@ -0,0 +1,65 @@
{
"db_name": "PostgreSQL",
"query": "SELECT token_hash, label, scopes, super_admin, admin,\n allowed_ips::text[] AS allowed_ips, expiration, workspace_id\n FROM token\n WHERE email = $1 AND token_prefix = $2\n AND (expiration IS NULL OR expiration > now())\n FOR UPDATE",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "token_hash",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "label",
"type_info": "Varchar"
},
{
"ordinal": 2,
"name": "scopes",
"type_info": "TextArray"
},
{
"ordinal": 3,
"name": "super_admin",
"type_info": "Bool"
},
{
"ordinal": 4,
"name": "admin",
"type_info": "Bool"
},
{
"ordinal": 5,
"name": "allowed_ips",
"type_info": "TextArray"
},
{
"ordinal": 6,
"name": "expiration",
"type_info": "Timestamptz"
},
{
"ordinal": 7,
"name": "workspace_id",
"type_info": "Varchar"
}
],
"parameters": {
"Left": [
"Text",
"Text"
]
},
"nullable": [
false,
true,
true,
false,
false,
null,
true,
true
]
},
"hash": "8f7b47cc91a6d520cf40787382f5d511eb8c9f096a7ef0fd9c13db8a88be0cf9"
}
@@ -0,0 +1,15 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE variable SET account = NULL WHERE workspace_id = $1 AND account = ANY($2)",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text",
"Int4Array"
]
},
"nullable": []
},
"hash": "922caf8126ce91b0339b377a14860a0ef6183943eb452c4c9bb9de22a559e47d"
}
@@ -0,0 +1,37 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO audit_partitioned\n (workspace_id, username, operation, action_kind, resource, parameters, email, span,\n client_ip, user_agent, peer_ip, forwarded_for)\n VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Varchar",
"Varchar",
"Varchar",
{
"Custom": {
"name": "action_kind",
"kind": {
"Enum": [
"create",
"update",
"delete",
"execute"
]
}
}
},
"Varchar",
"Jsonb",
"Varchar",
"Varchar",
"Text",
"Text",
"Text",
"Text"
]
},
"nullable": []
},
"hash": "931ae8904481286bbc42f30ba8df35b3a687a894311e8d7d0b8e6f1e5a07797a"
}
@@ -0,0 +1,90 @@
{
"db_name": "PostgreSQL",
"query": "SELECT label, token_prefix AS \"token_prefix!\", expiration,\n created_at AS \"created_at!\", last_used_at AS \"last_used_at!\", scopes, workspace_id,\n read_only AS \"read_only!\", allowed_ips::text[] AS allowed_ips,\n admin AS \"admin!\", super_admin AS \"super_admin!\", risks AS \"risks!\"\n FROM token_risk WHERE email = $1\n ORDER BY created_at DESC LIMIT $2 OFFSET $3",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "label",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "token_prefix!",
"type_info": "Varchar"
},
{
"ordinal": 2,
"name": "expiration",
"type_info": "Timestamptz"
},
{
"ordinal": 3,
"name": "created_at!",
"type_info": "Timestamptz"
},
{
"ordinal": 4,
"name": "last_used_at!",
"type_info": "Timestamptz"
},
{
"ordinal": 5,
"name": "scopes",
"type_info": "TextArray"
},
{
"ordinal": 6,
"name": "workspace_id",
"type_info": "Varchar"
},
{
"ordinal": 7,
"name": "read_only!",
"type_info": "Bool"
},
{
"ordinal": 8,
"name": "allowed_ips",
"type_info": "TextArray"
},
{
"ordinal": 9,
"name": "admin!",
"type_info": "Bool"
},
{
"ordinal": 10,
"name": "super_admin!",
"type_info": "Bool"
},
{
"ordinal": 11,
"name": "risks!",
"type_info": "TextArray"
}
],
"parameters": {
"Left": [
"Text",
"Int8",
"Int8"
]
},
"nullable": [
true,
true,
true,
true,
true,
true,
true,
true,
null,
true,
true,
true
]
},
"hash": "96611797b0867dc967ab5076005e39141ff05981a14029714318b80ae97cc4fa"
}
@@ -0,0 +1,40 @@
{
"db_name": "PostgreSQL",
"query": "SELECT client_id, client_name, redirect_uris, created_at FROM mcp_oauth_server_client\n WHERE client_id = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "client_id",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "client_name",
"type_info": "Varchar"
},
{
"ordinal": 2,
"name": "redirect_uris",
"type_info": "TextArray"
},
{
"ordinal": 3,
"name": "created_at",
"type_info": "Timestamptz"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
false,
false,
false,
false
]
},
"hash": "99acb6ee58e9289e5f10f535859290da9bd333a79aa71f0bc3118381aaeae465"
}
@@ -0,0 +1,23 @@
{
"db_name": "PostgreSQL",
"query": "SELECT EXISTS(SELECT 1 FROM script WHERE hash = $1 AND workspace_id = $2)",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "exists",
"type_info": "Bool"
}
],
"parameters": {
"Left": [
"Int8",
"Text"
]
},
"nullable": [
null
]
},
"hash": "9b35fc71fa5994aa7db3b190c7389648ca885dc87ff1b105a35ba23572598504"
}
@@ -0,0 +1,30 @@
{
"db_name": "PostgreSQL",
"query": "SELECT 'scripts' AS \"domain!\", path AS \"path!\" FROM script WHERE workspace_id = $1 AND NOT archived\n AND starts_with(path, 'u/') AND NOT starts_with(path, $2) AND NOT extra_perms ?| $3\n UNION\n SELECT 'flows', path FROM flow WHERE workspace_id = $1 AND NOT archived\n AND starts_with(path, 'u/') AND NOT starts_with(path, $2) AND NOT extra_perms ?| $3\n UNION ALL\n SELECT 'apps', path FROM app WHERE workspace_id = $1\n AND starts_with(path, 'u/') AND NOT starts_with(path, $2) AND NOT extra_perms ?| $3\n UNION ALL\n SELECT 'resources', path FROM resource WHERE workspace_id = $1\n AND starts_with(path, 'u/') AND NOT starts_with(path, $2) AND NOT extra_perms ?| $3\n UNION ALL\n SELECT 'variables', path FROM variable WHERE workspace_id = $1\n AND starts_with(path, 'u/') AND NOT starts_with(path, $2) AND NOT extra_perms ?| $3\n LIMIT 10000",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "domain!",
"type_info": "Text"
},
{
"ordinal": 1,
"name": "path!",
"type_info": "Varchar"
}
],
"parameters": {
"Left": [
"Text",
"Text",
"TextArray"
]
},
"nullable": [
null,
null
]
},
"hash": "9c5b3df2be18b88c063a39df8be1bd0f3cceb1312e0856600ece549ab649df3b"
}
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE token SET scopes = $1\n WHERE email = $2 AND token_prefix = $3\n AND (label IS NULL OR label <> 'guest_session')\n RETURNING token_prefix",
"query": "DELETE FROM token WHERE email = $1 AND token_prefix = $2 RETURNING token_prefix",
"describe": {
"columns": [
{
@@ -11,7 +11,6 @@
],
"parameters": {
"Left": [
"TextArray",
"Text",
"Text"
]
@@ -20,5 +19,5 @@
false
]
},
"hash": "d17645b5001d7f8da1dc451c5d35ea3c9346271b8404863256071cfdf884036a"
"hash": "9f1e9d7657c78e014792be95b6bf3d12945450fdfbd9f52e59617660ea20c4c3"
}
@@ -0,0 +1,30 @@
{
"db_name": "PostgreSQL",
"query": "SELECT workspace_id, username FROM usr\n WHERE email = $1 AND is_admin AND NOT disabled\n AND ($2::text[] IS NULL OR workspace_id = ANY($2))\n ORDER BY workspace_id LIMIT $3",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "workspace_id",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "username",
"type_info": "Varchar"
}
],
"parameters": {
"Left": [
"Text",
"TextArray",
"Int8"
]
},
"nullable": [
false,
false
]
},
"hash": "a1657b30563ec08887fda54469febbc2a33fea44f9ffad3416ef3915a81c9cc7"
}
@@ -0,0 +1,16 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE token SET expiration = $1, allowed_ips = $2::text[]::cidr[]\n WHERE token_hash = $3",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Timestamptz",
"TextArray",
"Text"
]
},
"nullable": []
},
"hash": "a2d0fb45dde296b7011a0cf8a9ae83f33736266736c0f0dd8113f0363db984b2"
}
@@ -0,0 +1,22 @@
{
"db_name": "PostgreSQL",
"query": "SELECT i.email FROM workspace_invite i\n JOIN password p ON p.email = i.email AND p.login_type = 'password'\n WHERE i.workspace_id = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "email",
"type_info": "Varchar"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
false
]
},
"hash": "a5ddda3592c30ad7ccb1bf4215bb5271e1563ce19cb252837f9e26d5b8502667"
}
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "SELECT l.id IS NOT NULL as \"has_lite!\",\n CASE WHEN $3::bigint IS NULL THEN NOT EXISTS (\n SELECT 1 FROM app_script s\n WHERE s.app = a.id AND s.code_sha256 = $4::text\n AND jsonb_path_exists(l.value, '$.**.inlineScript.id ? (@ == $id)',\n jsonb_build_object('id', s.id)))\n ELSE coalesce(jsonb_path_exists(l.value, '$.**.inlineScript.id ? (@ == $id)',\n jsonb_build_object('id', $3::bigint)), false)\n END as \"may_run!\"\n FROM app a\n LEFT JOIN app_version_lite l ON l.id = a.versions[array_upper(a.versions, 1)]\n WHERE a.path = $1 AND a.workspace_id = $2",
"query": "SELECT l.id IS NOT NULL as \"has_lite!\",\n CASE WHEN $3::bigint IS NULL THEN NOT EXISTS (\n SELECT 1 FROM app_script s\n WHERE s.app = a.id AND s.code_sha256 = $4::text\n AND jsonb_path_exists(l.value, '$.**.inlineScript.id ? (@ == $id)',\n jsonb_build_object('id', s.id)))\n ELSE coalesce(jsonb_path_exists(coalesce(l.value, v.value::jsonb),\n '$.**.inlineScript.id ? (@ == $id)',\n jsonb_build_object('id', $3::bigint)), false)\n END as \"may_run!\"\n FROM app a\n LEFT JOIN app_version_lite l ON l.id = a.versions[array_upper(a.versions, 1)]\n LEFT JOIN app_version v ON v.id = a.versions[array_upper(a.versions, 1)]\n WHERE a.path = $1 AND a.workspace_id = $2",
"describe": {
"columns": [
{
@@ -27,5 +27,5 @@
null
]
},
"hash": "eafb6d792370bf4d42cb79d0264e2eaf32f8f756920bd9fe9b302cba8e7d8814"
"hash": "a7bd504d6e509cde3e2ab12597f7e09c9c3d3ca760fab7244510824b5c762d07"
}
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO token\n (token_hash, token_prefix, token, email, label, expiration, super_admin, scopes, read_only)\n VALUES ($1, $2, $3, $4, $5, now() + ($6 || ' seconds')::interval, $7, $8, $9)",
"query": "INSERT INTO token\n (token_hash, token_prefix, token, email, label, expiration, super_admin, scopes, read_only, admin)\n VALUES ($1, $2, $3, $4, $5, now() + ($6 || ' seconds')::interval, $7, $8, $9, true)",
"describe": {
"columns": [],
"parameters": {
@@ -18,5 +18,5 @@
},
"nullable": []
},
"hash": "7f832370916794ab0e5645053688c24678f1519d49ee7263a86dba71d45b8e8c"
"hash": "a8785d44c4af680f862689707dbe0eb0ad0c741d035eea9b31166aed7ca394d4"
}
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "SELECT app.summary, app.policy, app_version.value, app_version.raw_app\n FROM app\n JOIN app_version\n ON app_version.id = app.versions[array_upper(app.versions, 1)]\n WHERE app.workspace_id = $1 AND app.path = $2",
"query": "SELECT app.summary, app.policy, app_version.value, app_version.raw_app, app.labels\n FROM app\n JOIN app_version\n ON app_version.id = app.versions[array_upper(app.versions, 1)]\n WHERE app.workspace_id = $1 AND app.path = $2",
"describe": {
"columns": [
{
@@ -22,6 +22,11 @@
"ordinal": 3,
"name": "raw_app",
"type_info": "Bool"
},
{
"ordinal": 4,
"name": "labels",
"type_info": "TextArray"
}
],
"parameters": {
@@ -34,8 +39,9 @@
false,
false,
false,
false
false,
true
]
},
"hash": "ac09d8de92d8e1ee9b463b87b2374e11ba46e9b392414282d2d67161a6544d11"
"hash": "a8f41490f55dea4b7f5497111d925ac5be5518831a9896c3949d32fe3eda0f3e"
}
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO variable (workspace_id, path, value, is_secret, description, extra_perms, account, is_oauth, expires_at, value_valid_until)\n SELECT $2, path, value, is_secret, description, extra_perms, account, is_oauth, expires_at, value_valid_until\n FROM variable\n WHERE workspace_id = $1",
"query": "INSERT INTO variable (workspace_id, path, value, is_secret, description, extra_perms, account, is_oauth, expires_at, value_valid_until, labels)\n SELECT $2, path, value, is_secret, description, extra_perms, account, is_oauth, expires_at, value_valid_until, labels\n FROM variable\n WHERE workspace_id = $1",
"describe": {
"columns": [],
"parameters": {
@@ -11,5 +11,5 @@
},
"nullable": []
},
"hash": "809a2dd647ddfc6fa79ca2c9039e4ebfc4b2880600a03b82e60b89c4a1fd5cc8"
"hash": "ab305b4e020220ba25c5c8263cb569991adb42acea00b109c74eb16bd8361dd6"
}
@@ -0,0 +1,26 @@
{
"db_name": "PostgreSQL",
"query": "SELECT EXISTS (\n SELECT 1 FROM v2_job_completed c JOIN v2_job j USING (id)\n WHERE j.workspace_id = $2\n AND c.started_at > now() - interval '3 hours'\n AND j.trigger_kind = 'app'\n AND j.trigger = $3\n AND j.created_by = $4\n AND EXISTS (\n SELECT 1 FROM jsonb_array_elements(CASE jsonb_typeof(c.result)\n WHEN 'array' THEN c.result ELSE jsonb_build_array(c.result) END) o\n WHERE o->>'s3' = $1 AND o->>'storage' IS NOT DISTINCT FROM $5\n )\n )",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "exists",
"type_info": "Bool"
}
],
"parameters": {
"Left": [
"Text",
"Text",
"Text",
"Text",
"Text"
]
},
"nullable": [
null
]
},
"hash": "b051ae8494073bc988dd272b2264520f36048ab3d12fe47652a854a41ddce1b0"
}
@@ -0,0 +1,42 @@
{
"db_name": "PostgreSQL",
"query": "WITH bounds AS (\n SELECT ($2::bigint % 4294967296)::text::xid AS prev_xid,\n ($3::bigint % 4294967296)::text::xid AS cur_xid,\n $1::timestamptz AS ts_floor\n ),\n batch AS (\n SELECT workspace_id, id, timestamp, username, operation,\n action_kind::text AS action_kind, resource, parameters, email, span,\n client_ip, user_agent, peer_ip, forwarded_for\n FROM audit_partitioned, bounds b\n WHERE timestamp >= b.ts_floor\n AND age(xmin) > age(b.cur_xid)\n AND age(xmin) <= age(b.prev_xid)\n ORDER BY id\n )\n SELECT to_char(timestamp AT TIME ZONE 'UTC', 'YYYY-MM-DD') AS \"day!\",\n string_agg(row_to_json(batch)::text, E'\\n' ORDER BY id) AS \"ndjson!\",\n max(id) AS \"max_id!\",\n max(timestamp) AS \"max_ts!\"\n FROM batch\n GROUP BY 1\n ORDER BY 1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "day!",
"type_info": "Text"
},
{
"ordinal": 1,
"name": "ndjson!",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "max_id!",
"type_info": "Int8"
},
{
"ordinal": 3,
"name": "max_ts!",
"type_info": "Timestamptz"
}
],
"parameters": {
"Left": [
"Timestamptz",
"Int8",
"Int8"
]
},
"nullable": [
null,
null,
null,
null
]
},
"hash": "b277825c1a82eebac652f4fcd19c91c3737cbc98cc8e5dd5e7bb50a802efad96"
}
@@ -1,24 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE token SET label = $1\n WHERE email = $2 AND token_prefix = $3\n AND (label IS NULL OR (\n label <> 'session'\n AND label <> 'guest_session'\n AND lower(label) NOT LIKE 'ephemeral%'\n AND label <> 'debugger-token'\n AND label NOT LIKE 'mcp-oauth-%'\n AND NOT starts_with(label, 'embed_app:')\n AND NOT starts_with(label, 'sdk_app:')\n AND NOT starts_with(label, 'impersonation:')\n AND NOT starts_with(label, 'cli-login:')\n AND NOT starts_with(label, 'remote-deploy:')\n ))\n RETURNING token_prefix",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "token_prefix",
"type_info": "Varchar"
}
],
"parameters": {
"Left": [
"Varchar",
"Text",
"Text"
]
},
"nullable": [
false
]
},
"hash": "b30fb28004897cd1d201a416cdabf124a055eb44b3c5892fd18ff7baf6010ae9"
}
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "SELECT value::text AS \"value!\", is_secret, description, value_valid_until\n FROM variable\n WHERE workspace_id = $1 AND path = $2",
"query": "SELECT value::text AS \"value!\", is_secret, description, value_valid_until, labels\n FROM variable\n WHERE workspace_id = $1 AND path = $2",
"describe": {
"columns": [
{
@@ -22,6 +22,11 @@
"ordinal": 3,
"name": "value_valid_until",
"type_info": "Timestamptz"
},
{
"ordinal": 4,
"name": "labels",
"type_info": "TextArray"
}
],
"parameters": {
@@ -34,8 +39,9 @@
null,
false,
false,
true,
true
]
},
"hash": "30f69fd4baef17716d26cc59bf6369d6768972478def50010f680103d7c4281b"
"hash": "b7ecb69c99a1c840c400340c51e0a1b30410e587cf35d9488c5e5f4fc8c3ab58"
}
@@ -0,0 +1,88 @@
{
"db_name": "PostgreSQL",
"query": "SELECT owner, email, label, token_prefix, created_at, expiration, workspace_id,\n scopes, read_only, super_admin, admin, allowed_ips::text[] AS allowed_ips\n FROM token\n WHERE token_hash = $1 AND (expiration > NOW() OR expiration IS NULL)",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "owner",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "email",
"type_info": "Varchar"
},
{
"ordinal": 2,
"name": "label",
"type_info": "Varchar"
},
{
"ordinal": 3,
"name": "token_prefix",
"type_info": "Varchar"
},
{
"ordinal": 4,
"name": "created_at",
"type_info": "Timestamptz"
},
{
"ordinal": 5,
"name": "expiration",
"type_info": "Timestamptz"
},
{
"ordinal": 6,
"name": "workspace_id",
"type_info": "Varchar"
},
{
"ordinal": 7,
"name": "scopes",
"type_info": "TextArray"
},
{
"ordinal": 8,
"name": "read_only",
"type_info": "Bool"
},
{
"ordinal": 9,
"name": "super_admin",
"type_info": "Bool"
},
{
"ordinal": 10,
"name": "admin",
"type_info": "Bool"
},
{
"ordinal": 11,
"name": "allowed_ips",
"type_info": "TextArray"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
true,
true,
true,
false,
false,
true,
true,
true,
false,
false,
false,
null
]
},
"hash": "bcc9c9a09ecf260a9221037285e0f7d6892b8f91fee8db3563bffe87ab4ed889"
}
@@ -0,0 +1,22 @@
{
"db_name": "PostgreSQL",
"query": "SELECT EXISTS(SELECT 1 FROM password WHERE totp_secret IS NOT NULL AND email <> $1)\n AS \"exists!\"",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "exists!",
"type_info": "Bool"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
null
]
},
"hash": "be65c6653f4e116517ff14abb7e3f075a82e41f758daae9aeab4d558d781f817"
}
@@ -1,16 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO resource (workspace_id, path, value, description, resource_type, extra_perms, edited_at, created_by)\n SELECT $2, path,\n CASE WHEN $3::text IS NOT NULL AND resource_type = 'ai_agent'\n AND jsonb_typeof(value) = 'object' AND value ? 'on_behalf_of'\n THEN jsonb_set(value, '{on_behalf_of}', to_jsonb($3::text))\n ELSE value END,\n description, resource_type, extra_perms, edited_at, created_by\n FROM resource\n WHERE workspace_id = $1",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text",
"Varchar",
"Text"
]
},
"nullable": []
},
"hash": "bf763c3ae4951537033d18ce48d3eb83d5c19e32aef199bf161e8ba8d1adf176"
}
@@ -0,0 +1,15 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE password SET totp_recovery_codes = array_remove(totp_recovery_codes, $2)\n WHERE email = $1",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text",
"Text"
]
},
"nullable": []
},
"hash": "c42f409f1c238ed5d6e9b57dd0b2a621e23dfbfefe99e848484b764fa57d837f"
}
@@ -0,0 +1,35 @@
{
"db_name": "PostgreSQL",
"query": "SELECT u.workspace_id, u.username,\n COALESCE(array_agg(g.group_) FILTER (WHERE g.group_ IS NOT NULL), '{}') AS \"groups!\"\n FROM usr u\n LEFT JOIN usr_to_group g ON g.workspace_id = u.workspace_id AND g.usr = u.username\n WHERE u.email = $1 AND NOT u.is_service_account\n AND EXISTS (SELECT 1 FROM workspace_protection_rule r\n WHERE r.workspace_id = u.workspace_id AND (r.rules & $2) <> 0)\n GROUP BY u.workspace_id, u.username",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "workspace_id",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "username",
"type_info": "Varchar"
},
{
"ordinal": 2,
"name": "groups!",
"type_info": "VarcharArray"
}
],
"parameters": {
"Left": [
"Text",
"Int4"
]
},
"nullable": [
false,
false,
null
]
},
"hash": "c901b1954818bfa402d2ded9f020c0862421001e10a5ac8cb3d1c1791b6ca597"
}

Some files were not shown because too many files have changed in this diff Show More