@deepraxis/sdk 0.1.1-dev.1046919 → 0.1.1-dev.124112f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -343,7 +343,7 @@ export const computersList = (options) => (options?.client ?? client).get({
343
343
  /**
344
344
  * Create Computer
345
345
  *
346
- * Create a durable computer: a named machine whose files outlive sessions, for personal agents.
346
+ * Create a durable computer: a named machine whose files outlive sessions, for general and personal agents.
347
347
  *
348
348
  * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
349
349
  */
@@ -750,7 +750,7 @@ export const getSessionCompaction = (options) => (options.client ?? client).get(
750
750
  *
751
751
  * Read session compaction history and summaries.
752
752
  *
753
- * Available only on /agent/v1. Returns { data: [...], active }. active is the queued or running compaction ({ type: session_compaction, id, status, trigger: manual|auto }), or null when none; manual work takes precedence. Each data entry contains type, id, event_id, trigger, status, model, compacted_message_count, input_tokens_before, input_tokens_after, summary, error and created_at, as recorded by the service. Missing or inaccessible managed sessions return 404 not_found_error.
753
+ * Available only on /agent/v1. Returns { data: [...], active }. active is the queued or running compaction ({ type: session_compaction, id, status, trigger: manual|auto|idle }), or null when none; manual work takes precedence. Each data entry contains type, id, event_id, trigger, status, model, compacted_message_count, input_tokens_before, input_tokens_after, summary, error and created_at, as recorded by the service. Missing or inaccessible managed sessions return 404 not_found_error.
754
754
  */
755
755
  export const listSessionCompactions = (options) => (options.client ?? client).get({
756
756
  security: [{
@@ -1235,6 +1235,50 @@ export const fileCancelUpload = (options) => (options.client ?? client).post({
1235
1235
  url: '/file/v1/uploads/{upload_id}/cancel',
1236
1236
  ...options
1237
1237
  });
1238
+ /**
1239
+ * Create a one-time upload URL
1240
+ *
1241
+ * Upload a local file of up to 2 GiB from a coding agent without sending bytes through the model. Provide basename, exact byte count and MIME type. Up to 104857600 bytes, PUT the file to url with curl -T photo.png -H 'Content-Type: image/png' '<url>'; success returns 201 with the file object, and reuse returns 410 CAPABILITY_USED. Above that threshold, split the file into part_size chunks (default 64000000 bytes), PUT each chunk to its numbered parts[].url in any order, then POST complete_url without a body. Part PUTs return 200; completion returns 201 with the file object, including its state, or 400 if a part is missing. A processing file can be polled with files.retrieve until active. Identical part bytes may be retried; changed bytes at the same number return 400. Completion reuse returns 410 CAPABILITY_USED. Each PUT requires the exact signed Content-Length; single-PUT Content-Type must match content_type or be omitted. Expired, revoked, invalid, wrong-action or cross-organization URLs return 404. URL lifetime defaults to 900 seconds for single PUT or 3600 for multipart, at most 604800; all multipart URLs share an expiry. Multipart creation reserves storage quota. Issuance requires the same unscoped credential as direct file creation. Each issuance creates a new upload and is not idempotent. Example body: {"filename":"photo.png","bytes":2048,"content_type":"image/png"}.
1242
+ */
1243
+ export const fileCreateSignedUpload = (options) => (options.client ?? client).post({
1244
+ security: [{
1245
+ key: 'BearerAuth',
1246
+ scheme: 'bearer',
1247
+ type: 'http'
1248
+ }, {
1249
+ key: 'ApiKeyAuth',
1250
+ name: 'X-API-Key',
1251
+ type: 'apiKey'
1252
+ }],
1253
+ url: '/file/v1/uploads/signed',
1254
+ ...options,
1255
+ headers: {
1256
+ 'Content-Type': 'application/json',
1257
+ ...options.headers
1258
+ }
1259
+ });
1260
+ /**
1261
+ * Revoke a file content link
1262
+ *
1263
+ * Stop a previously issued content link from reading a file. Use file_id from file creation or listing and the token path component from a content URL (/c/<token>), not the complete URL. The caller must own the file and have write access; a read-only binding is refused. Revocation propagates through the capability deny list within 30 seconds; the file and other links remain available. Only current IAM capability tokens can be revoked; legacy content links expire at the migration deadline. Example body: {"token":"<token from /c/>"}.
1264
+ */
1265
+ export const fileRevokeContentLink = (options) => (options.client ?? client).post({
1266
+ security: [{
1267
+ key: 'BearerAuth',
1268
+ scheme: 'bearer',
1269
+ type: 'http'
1270
+ }, {
1271
+ key: 'ApiKeyAuth',
1272
+ name: 'X-API-Key',
1273
+ type: 'apiKey'
1274
+ }],
1275
+ url: '/file/v1/files/{file_id}/content_links:revoke',
1276
+ ...options,
1277
+ headers: {
1278
+ 'Content-Type': 'application/json',
1279
+ ...options.headers
1280
+ }
1281
+ });
1238
1282
  /**
1239
1283
  * Health Check
1240
1284
  *
@@ -1389,6 +1433,28 @@ export const remixVideo = (options) => (options.client ?? client).post({
1389
1433
  url: '/model/v1/videos/{video_id}/remix',
1390
1434
  ...options
1391
1435
  });
1436
+ /**
1437
+ * Ask structured decision questions
1438
+ *
1439
+ * Ask typed questions about a state and get calibrated probabilities instead of generated text. Same request and response as TypeSafe System One. Use model ids from model.models.list declaring typesafe.systemone. Send one or more noul, choice or score questions; answers use the same question ids. Input tokens are charged at the catalog input price; output tokens are free. usage.cost and X-Praxis-Cost-Usd expose the same customer charge in USD. box questions and assets are unsupported and return 400: images are not supported. Unknown top-level fields pass unchanged to the native upstream.
1440
+ */
1441
+ export const createSystemone = (options) => (options.client ?? client).post({
1442
+ security: [{
1443
+ key: 'BearerAuth',
1444
+ scheme: 'bearer',
1445
+ type: 'http'
1446
+ }, {
1447
+ key: 'ApiKeyAuth',
1448
+ name: 'X-API-Key',
1449
+ type: 'apiKey'
1450
+ }],
1451
+ url: '/model/v1/systemone',
1452
+ ...options,
1453
+ headers: {
1454
+ 'Content-Type': 'application/json',
1455
+ ...options.headers
1456
+ }
1457
+ });
1392
1458
  /**
1393
1459
  * Transcribe audio
1394
1460
  *
@@ -2464,7 +2530,7 @@ export const sessionsUpdate = (options) => (options.client ?? client).post({
2464
2530
  /**
2465
2531
  * List agents
2466
2532
  *
2467
- * List the agents of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Use it to find an agent id before creating a session; to read one agent use agents.retrieve, to see its history use agents.versions.list. Archived agents are hidden unless include_archived is true. Filter kind=personal for durable-computer agents or kind=service for per-session environments. Pass next_page from the response as page to read the next page; a null next_page means the end.
2533
+ * List the agents of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Use it to find an agent id before creating a session; to read one agent use agents.retrieve, to see its history use agents.versions.list. Archived agents are hidden unless include_archived is true. Filter kind=general or kind=personal for durable-computer agents, kind=service for per-session environments, or kind=assume for external MCP clients. Pass next_page from the response as page to read the next page; a null next_page means the end.
2468
2534
  */
2469
2535
  export const agentsList = (options) => (options?.client ?? client).get({
2470
2536
  security: [{
@@ -2482,7 +2548,7 @@ export const agentsList = (options) => (options?.client ?? client).get({
2482
2548
  /**
2483
2549
  * Create agent
2484
2550
  *
2485
- * Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. The definition includes model, system prompt, tools, MCP servers and an optional multiagent roster. It is saved as version 1; real updates create new versions. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. Use tools: [{type: "agent_toolset_20260401"}] for built-in tools including codemode, skill and agent; inspect toolsets.list for names and schemas, and keep bash enabled for native additions. To offer only some tools, set default_config: {enabled: false} and list the tools to keep in configs, e.g. tools: [{type: "agent_toolset_20260401", default_config: {enabled: false}, configs: [{name: "codemode", enabled: true}, {name: "bash", enabled: true, permission_policy: {type: "always_ask"}}]}]; every tool not listed, including todo_write, enter_plan_mode, ask_user_question and goal_read, follows default_config, and the response echoes it. codemode runs through bash, so enabling codemode while bash is disabled returns 400. Optional mcp_toolset entries pair with mcp_servers. model accepts platform model IDs such as deepseek-flash, not only the Claude IDs in the protocol examples. model.settings.reasoning sets default thinking; other extra model controls return 400. model and every models.allowed entry must be a catalog model that can run an agent: an unknown id returns 400 "model <id> is not in the model catalog" and an embedding, image or speech model returns 400 "model <id> cannot run an agent". name is a label, not a unique key: 1 to 256 characters after trimming, no NUL or line breaks. avatar is trimmed, must not contain spaces or point at a loopback, private or internal host, and its scheme is stored in lowercase. script and workflow binding ids are stored in lowercase, the form automation matches; bindings together with environment_id null return 400 because bindings need a machine. Example: {"name":"helper","model":{"id":"deepseek-flash"},"tools":[{"type":"agent_toolset_20260401"}]}.
2551
+ * Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. The definition includes model, system prompt, tools, MCP servers and an optional multiagent roster. It is saved as version 1; real updates create new versions. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. Use tools: [{type: "agent_toolset_20260401"}] for built-in tools including codemode, skill and agent; inspect toolsets.list for names and schemas, and keep bash enabled for native additions. To offer only some tools, set default_config: {enabled: false} and list the tools to keep in configs, e.g. tools: [{type: "agent_toolset_20260401", default_config: {enabled: false}, configs: [{name: "codemode", enabled: true}, {name: "bash", enabled: true, permission_policy: {type: "always_ask"}}]}]; every tool not listed, including todo_write, enter_plan_mode, ask_user_question and goal_read, follows default_config, and the response echoes it. codemode runs through bash, so enabling codemode while bash is disabled returns 400. Optional mcp_toolset entries pair with mcp_servers. model accepts platform model IDs such as deepseek-flash, not only the Claude IDs in the protocol examples. model.settings.reasoning sets default thinking; other extra model controls return 400. model and every models.allowed entry must be a catalog model that can run an agent: an unknown id returns 400 "model <id> is not in the model catalog" and an embedding, image or speech model returns 400 "model <id> cannot run an agent". name is a label, not a unique key: 1 to 256 characters after trimming, no NUL or line breaks. avatar is trimmed, must not contain spaces or point at a loopback, private or internal host, and its scheme is stored in lowercase. script and workflow binding ids are stored in lowercase, the form automation matches; bindings together with environment_id null return 400 because bindings need a machine. Example: {"name":"helper","model":{"id":"deepseek-flash"},"tools":[{"type":"agent_toolset_20260401"}]}. For kind assume, provide name without model, models, subagent_model, subagents or multiagent; omit computer_id to register a new computer named after the agent without starting an instance, or provide an existing computer_id; vault_ids are accepted, bindings and environment_id are refused. Drive assume agents over MCP at /agent/v1/agents/{id}/mcp.
2486
2552
  */
2487
2553
  export const agentsCreate = (options) => (options.client ?? client).post({
2488
2554
  security: [{
@@ -2522,7 +2588,7 @@ export const agentsRetrieve = (options) => (options.client ?? client).get({
2522
2588
  /**
2523
2589
  * Update agent
2524
2590
  *
2525
- * Save configuration changes as a new immutable version. Send latest_version from a default retrieve or update response as the request version for optimistic concurrency; a stale value returns 409. apply defaults to true and makes the new version effective; apply false saves without changing active_version. The response contains the effective configuration, with version equal to active_version and latest_version naming the newest saved version. An unchanged configuration, including a note-only update, is a no-op returning 200 and the current effective version without creating or activating a version. version_note records up to 280 characters only when a configuration change creates a new version; null is equivalent to omission. Use agents.versions.apply to activate an existing saved version. Existing sessions and tokens keep their version. Omitted fields keep their value. multiagent takes null or a coordinator roster; subagent_model keeps its value when omitted and is cleared by null. Archived agents cannot be updated. tools: [] removes every tool, while tools: null returns 400 (tools cannot be null; send [] to remove every tool). On update, omit skills to keep them, send an array to replace them, or send [] or null to clear them. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400.
2591
+ * Save configuration changes as a new immutable version. Send latest_version from a default retrieve or update response as the request version for optimistic concurrency; a stale value returns 409. apply defaults to true and makes the new version effective; apply false saves without changing active_version. The response contains the effective configuration, with version equal to active_version and latest_version naming the newest saved version. An unchanged configuration, including a note-only update, is a no-op returning 200 and the current effective version without creating or activating a version. version_note records up to 280 characters only when a configuration change creates a new version; null is equivalent to omission. Use agents.versions.apply to activate an existing saved version. Existing sessions and tokens keep their version. Omitted fields keep their value. multiagent takes null or a coordinator roster; subagent_model keeps its value when omitted and is cleared by null. Archived agents cannot be updated. tools: [] removes every tool, while tools: null returns 400 (tools cannot be null; send [] to remove every tool). On update, omit skills to keep them, send an array to replace them, or send [] or null to clear them. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. Assume agents reject model, models, subagent_model, subagents and multiagent on every update; other fields follow the general agent rules, with vault_ids also accepted.
2526
2592
  */
2527
2593
  export const agentsUpdate = (options) => (options.client ?? client).post({
2528
2594
  security: [{
@@ -2598,7 +2664,7 @@ export const sessionsList = (options) => (options?.client ?? client).get({
2598
2664
  /**
2599
2665
  * Create session
2600
2666
  *
2601
- * Create a session: one conversation with an agent. Pass agent as an agent id or {type:"agent", id, version?}; an id alone, or an object without version, pins the agent's active_version (the version chosen with agents.versions.apply, not necessarily the newest saved one). Unlike Anthropic Managed Agents, omit environment_id to use the default environment saved in the agent version (light for a new agent), unless computer_id (explicit, or the agent's default) selects a Computer; pass an environment id for a sandbox recipe. For service agents, explicit null allocates no machine, so codemode, bash and other machine tools are unavailable. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|max|none} or null, where null inherits the agent default and then the model default (none requires the model to allow disabling thinking). Selections are saved before initial_events run; invalid ones return 400 invalid_request_error. Unlike Anthropic Managed Agents, the only inline agent override is system ({type:"agent_with_overrides", id, system}); to change the model, tools, MCP servers or skills, save a version instead. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. budget is {type:"limit", max_list_cost:{amount, currency:"USD"}} where amount is a positive decimal string of US dollars with at most 2 decimal places ("20.00" is USD 20.00); omitted budget defaults to "20.00" and null removes the limit. Up to 500 file resources can be attached. Use initial_events to send a first user.message in this request, or send messages afterwards with sessions.events.send. The returned status can still be idle before initial events run; read agent.message and the subsequent session.status_idle event to confirm completion.
2667
+ * Create a session: one conversation with an agent. Pass agent as an agent id or {type:"agent", id, version?}; an id alone, or an object without version, pins the agent's active_version (the version chosen with agents.versions.apply, not necessarily the newest saved one). Unlike Anthropic Managed Agents, omit environment_id to use the default environment saved in the agent version (light for a new agent), unless computer_id (explicit, or the agent's default) selects a Computer; pass an environment id for a sandbox recipe. For service agents, explicit null allocates no machine, so codemode, bash and other machine tools are unavailable. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|max|none} or null, where null inherits the agent default and then the model default (none requires the model to allow disabling thinking). Selections are saved before initial_events run; invalid ones return 400 invalid_request_error. Unlike Anthropic Managed Agents, the only inline agent override is system ({type:"agent_with_overrides", id, system}); to change the model, tools, MCP servers or skills, save a version instead. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. budget is {type:"limit", max_list_cost:{amount, currency:"USD"}} where amount is a positive decimal string of US dollars with at most 2 decimal places ("20.00" is USD 20.00); omitted budget defaults to "20.00" and null removes the limit. Up to 500 file resources can be attached. Use initial_events to send a first user.message in this request, or send messages afterwards with sessions.events.send. The returned status can still be idle before initial events run; read agent.message and the subsequent session.status_idle event to confirm completion. Assume agents return 400 INVALID_PARAMS; drive them over MCP at /agent/v1/agents/{id}/mcp instead.
2602
2668
  */
2603
2669
  export const sessionsCreate = (options) => (options.client ?? client).post({
2604
2670
  security: [{
@@ -2978,7 +3044,7 @@ export const deploymentsList = (options) => (options?.client ?? client).get({
2978
3044
  /**
2979
3045
  * Create deployment
2980
3046
  *
2981
- * Freeze session parameters as a deployment; this operation does not open a session. Pass an agent id or versioned reference, a name, 1–50 user.message initial events and an environment_id from environments.list. Unlike Anthropic Managed Agents, /agent/v1 also accepts agent_with_overrides (model, permission_mode and cwd) and target=computer for personal agents, with environment_id omitted. Cron schedules use five POSIX fields and an IANA timezone. File resources are accepted. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. Active schedules run every minute when due; session creation errors pause the deployment. Unsupported tools, mcp_servers, system and skills overrides return 400.
3047
+ * Freeze session parameters as a deployment; this operation does not open a session. Pass an agent id or versioned reference, a name, 1–50 user.message initial events and an environment_id from environments.list. Unlike Anthropic Managed Agents, /agent/v1 also accepts agent_with_overrides (model, permission_mode and cwd) and target=computer for general and personal agents, with environment_id omitted. Cron schedules use five POSIX fields and an IANA timezone. File resources are accepted. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. Active schedules run every minute when due; session creation errors pause the deployment. Unsupported tools, mcp_servers, system and skills overrides return 400.
2982
3048
  */
2983
3049
  export const deploymentsCreate = (options) => (options.client ?? client).post({
2984
3050
  security: [{
@@ -3624,7 +3690,7 @@ export const applicationListGrants = (options) => (options.client ?? client).get
3624
3690
  /**
3625
3691
  * Create grant
3626
3692
  *
3627
- * Let this Worker's platform token access one of your databases, folders or knowledge bases.
3693
+ * Record access to an organization-owned database or knowledge base, all organization files (files, id *), or models (models, id *, read only). Each resource and optional alias must be unique within this Worker. Foreign and missing resources both return RESOURCE_NOT_FOUND (404); an unavailable resource service returns PROVIDER_CAPACITY (503, retryable).
3628
3694
  */
3629
3695
  export const applicationCreateGrant = (options) => (options.client ?? client).post({
3630
3696
  security: [{
@@ -4212,7 +4278,7 @@ export const automationWorkflowsList = (options) => (options?.client ?? client).
4212
4278
  /**
4213
4279
  * Create a workflow
4214
4280
  *
4215
- * Workflow syntax reference: https://deepraxis.com/docs/developers/automation/reference/workflow-syntax. Save a YAML workflow as an editable draft; this does not validate, publish or run it, so check it with validate (kind=workflow) first. Minimal draft: document with dsl ("1.0.3"), namespace, name and version, plus a do list of steps, for example document: {dsl: "1.0.3", namespace: demo, name: add, version: "1.0.0"} and do: [{first: {call: demo/add-one, with: {n: "${ .n }"}}}]. call: <ns/name> calls an Action directly (bare name for built-ins such as ocr) and with is the Action input; the input contract is at current_revision.input_schema in the get-action response. run: starts a saved script or child workflow. The run input is . in the first step, and expressions are jq written as a whole ${ ... } string. Limits: Action 30 s (run-sandbox 10 min), workflow 24 h by default and 30 days at most, payload 1 MiB. Test the draft by sending its source and language=yaml to praxis.automation.runs.create. Guide: /docs/developers/automation/guides/write-workflow. Error details are in the errors[] of the response (pointer, detail, hint). Choose your own namespace without registering it first; praxis is reserved for built-in Actions. Scripts and workflows share names within the tenant; a duplicate returns NAME_TAKEN. run.workflow accepts ns/name@range or {namespace, name, version, input}; run.script uses the same reference shape as a platform extension. Object namespace, name and version are required; version accepts an exact version, dist-tag or range, locked at publication. Object input defaults to {} and supports expressions; string references retain task-level with. run.await defaults to true and returns the child output. With false, the child uses detach and the task immediately returns {run_id}; parent cancellation does not cascade. Inline script.code returns DEFINITION_INVALID with a detail asking you to save a script and reference it first. raise.error retains its type URI, status, title and detail in the run error.
4281
+ * Workflow syntax reference: https://deepraxis.com/docs/developers/automation/reference/workflow-syntax. Save a YAML workflow as an editable draft; this does not validate, publish or run it, so check it with validate (kind=workflow) first. Minimal draft: document with dsl ("1.0.3"), namespace, name and version, plus a do list of steps, for example document: {dsl: "1.0.3", namespace: demo, name: add, version: "1.0.0"} and do: [{first: {call: demo/add-one, with: {n: "${ .n }"}}}]. call: <ns/name> calls an Action directly (bare name for built-ins such as ocr) and with is the Action input; the input contract is at current_revision.input_schema in the get-action response. run: starts a saved script or child workflow. The run input is . in the first step, and expressions are jq written as a whole ${ ... } string. Limits: Action 30 s (run-sandbox 10 min), workflow 24 h by default and 30 days at most, payload 1 MiB. Test the draft by sending its source and language=yaml to praxis.automation.runs.create. To pause for a person, call praxis/approval (it opens a human task; the step output is the decision); agents answer with praxis.automation.humanTasks.respond on behalf of their user. Guide: /docs/developers/automation/guides/approvals Guide: /docs/developers/automation/guides/write-workflow. Error details are in the errors[] of the response (pointer, detail, hint). Choose your own namespace without registering it first; praxis is reserved for built-in Actions. Scripts and workflows share names within the tenant; a duplicate returns NAME_TAKEN. run.workflow accepts ns/name@range or {namespace, name, version, input}; run.script uses the same reference shape as a platform extension. Object namespace, name and version are required; version accepts an exact version, dist-tag or range, locked at publication. Object input defaults to {} and supports expressions; string references retain task-level with. run.await defaults to true and returns the child output. With false, the child uses detach and the task immediately returns {run_id}; parent cancellation does not cascade. Inline script.code returns DEFINITION_INVALID with a detail asking you to save a script and reference it first. raise.error retains its type URI, status, title and detail in the run error.
4216
4282
  */
4217
4283
  export const automationWorkflowsCreate = (options) => (options.client ?? client).post({
4218
4284
  security: [{
@@ -5151,31 +5217,57 @@ export const automationHumanTasksDelegate = (options) => (options.client ?? clie
5151
5217
  }
5152
5218
  });
5153
5219
  /**
5154
- * List databases
5220
+ * List script vault bindings
5155
5221
  *
5156
- * Find databases owned by your tenant and obtain their ids for schema or row operations. Excludes deleting by default. status=active or status=deleting selects that state; invalid values return 400 INVALID_PARAMS.
5222
+ * Inspect the whole vaults attached to a saved script, including archived definitions, without reading secret values. Obtain ns and name from automation.scripts.list. Bindings belong to the definition rather than a published version. When vault or secret metadata cannot be read, the binding remains visible with secrets: [] and secrets_unavailable: true.
5157
5223
  */
5158
- export const databaseListDatabases = (options) => (options?.client ?? client).get({
5224
+ export const automationScriptsVaultsList = (options) => (options.client ?? client).get({
5159
5225
  security: [{
5160
- key: 'database-bearerAuth',
5226
+ key: 'BearerAuth',
5161
5227
  scheme: 'bearer',
5162
5228
  type: 'http'
5229
+ }, {
5230
+ key: 'ApiKeyAuth',
5231
+ name: 'X-API-Key',
5232
+ type: 'apiKey'
5163
5233
  }],
5164
- url: '/database/v1/databases',
5234
+ url: '/automation/v1/scripts/{ns}/{name}/vaults',
5165
5235
  ...options
5166
5236
  });
5167
5237
  /**
5168
- * Create database
5238
+ * Delete a script vault binding
5169
5239
  *
5170
- * Creates an empty database for the caller and returns it with status active (HTTP 201); add tables next with praxis.database.databases.tables.create. name is required and is 1–64 visible characters after trimming. labels are optional string tags (at most 64; each key starts with a lowercase letter and uses up to 63 characters of a-z 0-9 _ -; each value is up to 63 characters of a-z 0-9 _ -) that databaseListDatabases can filter on. If initialization fails the call returns 503 CAPACITY and the half-created database is left with status failed; retry by calling create again, which makes a new database. Unlike Supabase, this creates a SQLite-backed database without a PostgreSQL connection or SQL execution endpoint. Use a Praxis credential; access is scoped to its tenant, not to Supabase Auth users or RLS policies.
5240
+ * Remove the vault assignment from this saved script without deleting the vault or its secrets. Obtain aliases from automation.scripts.vaults.list. Repeating deletion of an absent alias on an existing definition succeeds. Bindings also disappear when the definition is permanently deleted, while archival retains them.
5171
5241
  */
5172
- export const databaseCreateDatabase = (options) => (options.client ?? client).post({
5242
+ export const automationScriptsVaultsDelete = (options) => (options.client ?? client).delete({
5173
5243
  security: [{
5174
- key: 'database-bearerAuth',
5244
+ key: 'BearerAuth',
5175
5245
  scheme: 'bearer',
5176
5246
  type: 'http'
5247
+ }, {
5248
+ key: 'ApiKeyAuth',
5249
+ name: 'X-API-Key',
5250
+ type: 'apiKey'
5177
5251
  }],
5178
- url: '/database/v1/databases',
5252
+ url: '/automation/v1/scripts/{ns}/{name}/vaults/{alias}',
5253
+ ...options
5254
+ });
5255
+ /**
5256
+ * Set a script vault binding
5257
+ *
5258
+ * Attach an entire active vault in your organization to a saved script, or replace the vault at an existing alias. Obtain the vault ID or display name from praxis.vault.vaults.list; ambiguous names require an ID. Bindings are independent of published versions and survive archival. The same vault cannot be assigned to two aliases on one definition. Repeating the same assignment is idempotent. Example body: {"vault":"Production"}.
5259
+ */
5260
+ export const automationScriptsVaultsSet = (options) => (options.client ?? client).put({
5261
+ security: [{
5262
+ key: 'BearerAuth',
5263
+ scheme: 'bearer',
5264
+ type: 'http'
5265
+ }, {
5266
+ key: 'ApiKeyAuth',
5267
+ name: 'X-API-Key',
5268
+ type: 'apiKey'
5269
+ }],
5270
+ url: '/automation/v1/scripts/{ns}/{name}/vaults/{alias}',
5179
5271
  ...options,
5180
5272
  headers: {
5181
5273
  'Content-Type': 'application/json',
@@ -5183,45 +5275,57 @@ export const databaseCreateDatabase = (options) => (options.client ?? client).po
5183
5275
  }
5184
5276
  });
5185
5277
  /**
5186
- * Delete database
5278
+ * List workflow vault bindings
5187
5279
  *
5188
- * Soft-delete a database when it should stop accepting schema and row operations. Idempotently enters deleting with a seven-day purge_at. GET remains available; child operations return 409 until restored.
5280
+ * Inspect the whole vaults attached to a saved workflow, including archived definitions, without reading secret values. Obtain ns and name from automation.workflows.list. Bindings belong to the definition rather than a published version. When vault or secret metadata cannot be read, the binding remains visible with secrets: [] and secrets_unavailable: true.
5189
5281
  */
5190
- export const databaseDeleteDatabase = (options) => (options.client ?? client).delete({
5282
+ export const automationWorkflowsVaultsList = (options) => (options.client ?? client).get({
5191
5283
  security: [{
5192
- key: 'database-bearerAuth',
5284
+ key: 'BearerAuth',
5193
5285
  scheme: 'bearer',
5194
5286
  type: 'http'
5287
+ }, {
5288
+ key: 'ApiKeyAuth',
5289
+ name: 'X-API-Key',
5290
+ type: 'apiKey'
5195
5291
  }],
5196
- url: '/database/v1/databases/{database_id}',
5292
+ url: '/automation/v1/workflows/{ns}/{name}/vaults',
5197
5293
  ...options
5198
5294
  });
5199
5295
  /**
5200
- * Get database
5296
+ * Delete a workflow vault binding
5201
5297
  *
5202
- * Returns one database by id, including a database in the deleting state (purge_at then shows when it will be permanently removed). Call it before table or row operations to confirm status is active: schema and row calls on a deleting database return 409 DATABASE_INVALID_STATE. size_bytes is refreshed from live storage at most once every five seconds. A purged or unknown id returns 404 DATABASE_NOT_FOUND.
5298
+ * Remove the vault assignment from this saved workflow without deleting the vault or its secrets. Obtain aliases from automation.workflows.vaults.list. Repeating deletion of an absent alias on an existing definition succeeds. Bindings also disappear when the definition is permanently deleted, while archival retains them.
5203
5299
  */
5204
- export const databaseGetDatabase = (options) => (options.client ?? client).get({
5300
+ export const automationWorkflowsVaultsDelete = (options) => (options.client ?? client).delete({
5205
5301
  security: [{
5206
- key: 'database-bearerAuth',
5302
+ key: 'BearerAuth',
5207
5303
  scheme: 'bearer',
5208
5304
  type: 'http'
5305
+ }, {
5306
+ key: 'ApiKeyAuth',
5307
+ name: 'X-API-Key',
5308
+ type: 'apiKey'
5209
5309
  }],
5210
- url: '/database/v1/databases/{database_id}',
5310
+ url: '/automation/v1/workflows/{ns}/{name}/vaults/{alias}',
5211
5311
  ...options
5212
5312
  });
5213
5313
  /**
5214
- * Update database
5314
+ * Set a workflow vault binding
5215
5315
  *
5216
- * Renames an active database and/or replaces its labels; send only the keys you want to change. labels is replaced as a whole, not merged, so include every label you want to keep. A body without name or labels, or with values equal to the current ones, changes nothing and leaves updated_at as is. A database in the deleting state returns 409 DATABASE_INVALID_STATE; restore it first with databaseRestoreDatabase.
5316
+ * Attach an entire active vault in your organization to a saved workflow, or replace the vault at an existing alias. Obtain the vault ID or display name from praxis.vault.vaults.list; ambiguous names require an ID. Bindings are independent of published versions and survive archival. The same vault cannot be assigned to two aliases on one definition. Repeating the same assignment is idempotent. Example body: {"vault":"Production"}.
5217
5317
  */
5218
- export const databaseUpdateDatabase = (options) => (options.client ?? client).patch({
5318
+ export const automationWorkflowsVaultsSet = (options) => (options.client ?? client).put({
5219
5319
  security: [{
5220
- key: 'database-bearerAuth',
5320
+ key: 'BearerAuth',
5221
5321
  scheme: 'bearer',
5222
5322
  type: 'http'
5323
+ }, {
5324
+ key: 'ApiKeyAuth',
5325
+ name: 'X-API-Key',
5326
+ type: 'apiKey'
5223
5327
  }],
5224
- url: '/database/v1/databases/{database_id}',
5328
+ url: '/automation/v1/workflows/{ns}/{name}/vaults/{alias}',
5225
5329
  ...options,
5226
5330
  headers: {
5227
5331
  'Content-Type': 'application/json',
@@ -5229,123 +5333,116 @@ export const databaseUpdateDatabase = (options) => (options.client ?? client).pa
5229
5333
  }
5230
5334
  });
5231
5335
  /**
5232
- * Restore database
5336
+ * List canvases
5233
5337
  *
5234
- * Recover a soft-deleted database within its seven-day recovery window. Restore before purge_at. An empty body is accepted. Active databases return 409; purged databases return 404.
5338
+ * Discover canvases in the API key's organization and obtain ids for retrieval or editing. Results are ordered by updated_at from newest to oldest. limit is 1–100 and defaults to 50; omit cursor for the first page, then copy next_cursor into the next request until it is null. Deleted canvases are unavailable.
5235
5339
  */
5236
- export const databaseRestoreDatabase = (options) => (options.client ?? client).post({
5340
+ export const canvasListCanvases = (options) => (options?.client ?? client).get({
5237
5341
  security: [{
5238
- key: 'database-bearerAuth',
5342
+ key: 'canvas-bearerAuth',
5239
5343
  scheme: 'bearer',
5240
5344
  type: 'http'
5241
5345
  }],
5242
- url: '/database/v1/databases/{database_id}/restore',
5346
+ url: '/canvas/v1/canvases',
5243
5347
  ...options
5244
5348
  });
5245
5349
  /**
5246
- * Permanently purge database
5350
+ * Create canvas
5247
5351
  *
5248
- * Immediately and irreversibly purges a deleting database. Active databases return 409; absent or already purged databases return 404.
5352
+ * Create a blank design canvas in the API key's organization before drawing with praxis.canvas.canvases.execute. Send an optional name of at most 200 characters; omitting name uses Untitled. Each successful call creates a new canvas and returns its id and viewer_url with HTTP 201; save the id for subsequent reads, edits and deletion.
5249
5353
  */
5250
- export const databasePurgeDatabase = (options) => (options.client ?? client).post({
5354
+ export const canvasCreateCanvas = (options) => (options?.client ?? client).post({
5251
5355
  security: [{
5252
- key: 'database-bearerAuth',
5356
+ key: 'canvas-bearerAuth',
5253
5357
  scheme: 'bearer',
5254
5358
  type: 'http'
5255
5359
  }],
5256
- url: '/database/v1/databases/{database_id}/purge',
5257
- ...options
5360
+ url: '/canvas/v1/canvases',
5361
+ ...options,
5362
+ headers: {
5363
+ 'Content-Type': 'application/json',
5364
+ ...options?.headers
5365
+ }
5258
5366
  });
5259
5367
  /**
5260
- * List tables
5368
+ * Delete canvas
5261
5369
  *
5262
- * Lists every table of an active database with its field definitions. A database holds at most 50 tables, so the single page contains all of them and next_cursor is always null. Use databaseGetTable instead when you also need row_count for one table.
5370
+ * Permanently delete a canvas and its design content when it is no longer needed. Obtain canvas_id from create or list and confirm the target before calling; deletion cannot be undone. HTTP 200 confirms deletion with deleted=true. Subsequent access returns CANVAS_NOT_FOUND, as it does for a missing canvas or one outside the API key's organization.
5263
5371
  */
5264
- export const databaseListTables = (options) => (options.client ?? client).get({
5372
+ export const canvasDeleteCanvas = (options) => (options.client ?? client).delete({
5265
5373
  security: [{
5266
- key: 'database-bearerAuth',
5374
+ key: 'canvas-bearerAuth',
5267
5375
  scheme: 'bearer',
5268
5376
  type: 'http'
5269
5377
  }],
5270
- url: '/database/v1/databases/{database_id}/tables',
5378
+ url: '/canvas/v1/canvases/{canvas_id}',
5271
5379
  ...options
5272
5380
  });
5273
5381
  /**
5274
- * Create table
5382
+ * Retrieve canvas
5275
5383
  *
5276
- * Creates a table together with its initial fields in one call and returns it (HTTP 201) with generated tbl_ and fld_ ids. name must match ^[a-z_][a-z0-9_]{0,62}$ and be unused in this database (duplicate: 409 UNIQUE_VIOLATION). fields is required and may be an empty array; fields can also be added later with databaseAddField. Limits: 50 tables per database, 64 fields per table, and 16 indexed or unique fields per table; exceeding one returns 400 LIMIT_EXCEEDED. Fields default to indexed:false. Set indexed:true explicitly for fields used in filters or ordering. Only indexed:true or unique:true consumes one of the 16 indexed-or-unique field slots; a field with both consumes one slot. Unique fields still consume a slot even with indexed:false. Existing fields are unchanged. Minimal field example: {"name":"notes","type":"string","indexed":false}. Every row also has a system id column, which is not declared as a field. Insert data afterwards with databaseInsert. Unlike Supabase, define schema with this table API and the field APIs; PostgreSQL DDL and SQL migration files cannot be submitted. Each table supports up to 1,000,000 rows.
5384
+ * Inspect the current canvas before editing, like Pencil get_app_state. The response adds top-level node summaries in canvas order and reusable component ids to the canvas metadata. Use these ids in nodes.list, images.list or an execute script; use the returned version as expected_version to detect concurrent edits. Read full node content with nodes.list rather than guessing fields from these summaries.
5277
5385
  */
5278
- export const databaseCreateTable = (options) => (options.client ?? client).post({
5386
+ export const canvasRetrieveCanvas = (options) => (options.client ?? client).get({
5279
5387
  security: [{
5280
- key: 'database-bearerAuth',
5388
+ key: 'canvas-bearerAuth',
5281
5389
  scheme: 'bearer',
5282
5390
  type: 'http'
5283
5391
  }],
5284
- url: '/database/v1/databases/{database_id}/tables',
5285
- ...options,
5286
- headers: {
5287
- 'Content-Type': 'application/json',
5288
- ...options.headers
5289
- }
5392
+ url: '/canvas/v1/canvases/{canvas_id}',
5393
+ ...options
5290
5394
  });
5291
5395
  /**
5292
- * Delete table
5396
+ * Read canvas nodes
5293
5397
  *
5294
- * Permanently drops a table with all of its rows; the deletion is immediate and has no recovery window or undo. Refused with 409 REFERENCE_RESTRICT while a link field of another table points at this table, so delete or change those fields first. Returns {deleted: true}. A table name can be reused afterwards.
5398
+ * Read node documents for inspection before changing individual nodes. Supply 1–100 comma-separated node ids from retrieve or execute, or instance paths such as a/b. depth is an integer at least 0; omit it for complete subtrees. Each requested id maps to a document wrapper or null if absent. Unlike Figma, document contains a Pencil .pen 2.21 node, not a Figma node. For top-level summaries use canvases.retrieve; for pixels use images.list.
5295
5399
  */
5296
- export const databaseDeleteTable = (options) => (options.client ?? client).delete({
5400
+ export const canvasListNodes = (options) => (options.client ?? client).get({
5297
5401
  security: [{
5298
- key: 'database-bearerAuth',
5402
+ key: 'canvas-bearerAuth',
5299
5403
  scheme: 'bearer',
5300
5404
  type: 'http'
5301
5405
  }],
5302
- url: '/database/v1/databases/{database_id}/tables/{table}',
5406
+ url: '/canvas/v1/canvases/{canvas_id}/nodes',
5303
5407
  ...options
5304
5408
  });
5305
5409
  /**
5306
- * Get table
5410
+ * Render canvas nodes
5307
5411
  *
5308
- * Returns one table by id or name with its field definitions, schema_revision and row_count. row_count is only returned by this operation, not by list or create. Use field ids from this response for stable references because field names can be renamed; an unknown table returns 404 TABLE_NOT_FOUND.
5412
+ * Render 1–4 nodes to inspect the visual result of a design edit. Use ids from retrieve, execute.created or execute.screenshots; scale defaults to 1 and accepts 0.25–4, and png is the only supported format. Unlike Figma, images contains inline data:image/png;base64,... URLs, not hosted image URLs; a null entry means no image is available for that id. Use nodes.list for editable node content instead of pixels.
5309
5413
  */
5310
- export const databaseGetTable = (options) => (options.client ?? client).get({
5414
+ export const canvasListImages = (options) => (options.client ?? client).get({
5311
5415
  security: [{
5312
- key: 'database-bearerAuth',
5416
+ key: 'canvas-bearerAuth',
5313
5417
  scheme: 'bearer',
5314
5418
  type: 'http'
5315
5419
  }],
5316
- url: '/database/v1/databases/{database_id}/tables/{table}',
5420
+ url: '/canvas/v1/canvases/{canvas_id}/images',
5317
5421
  ...options
5318
5422
  });
5319
5423
  /**
5320
- * Update table
5424
+ * Execute canvas script
5321
5425
  *
5322
- * Renames a table and/or changes its description; send only the keys to change, and send description null to clear it. The new name must follow ^[a-z_][a-z0-9_]{0,62}$ and be unused (409 UNIQUE_VIOLATION); ids are stable, so renaming never rewrites row data. A body with no changes or values equal to the current ones does not bump schema_revision. Fields cannot be changed here; use databaseAddField, databaseUpdateField and databaseDeleteField.
5323
- */
5324
- export const databaseUpdateTable = (options) => (options.client ?? client).patch({
5325
- security: [{
5326
- key: 'database-bearerAuth',
5327
- scheme: 'bearer',
5328
- type: 'http'
5329
- }],
5330
- url: '/database/v1/databases/{database_id}/tables/{table}',
5331
- ...options,
5332
- headers: {
5333
- 'Content-Type': 'application/json',
5334
- ...options.headers
5335
- }
5336
- });
5337
- /**
5338
- * Add field
5426
+ * Draw or edit a canvas atomically with a synchronous Pencil execute script. First create a canvas with praxis.canvas.canvases.create and use its id as canvas_id; inspect an existing canvas with retrieve before modifying it. Send exactly one of script (new source) or edit_id (a failed script to patch using edits). Unlike Figma REST, :execute writes design content; nodes use Pencil .pen schema 2.21 (frame/group/rectangle/ellipse/polygon/path/text/icon/ref/note), not Figma node fields.
5427
+ *
5428
+ * The root variable is document. Synchronous functions are Insert / Copy / Update / Replace / Move / Delete / SetVariables / Get / GetVariables / FindEmptySpace / Print / TakeScreenshot; globals persist for the next call. A first frame needs only this body.script:
5429
+ *
5430
+ * ```js
5431
+ * const f = Insert(document, { type: "frame", name: "Hero", width: 1200, layout: "vertical", padding: 48, fill: "#FFFFFF" }); Insert(f, { type: "text", content: "Hello", fontSize: 32, fill: "#111111" }); Print(f)
5432
+ * ```
5433
+ *
5434
+ * Use viewer_url to watch the result in Console. TakeScreenshot records node ids in screenshots; call images.list with those ids to fetch PNG data URLs. See the [Canvas execute reference](https://deepraxis.com/en/docs/api/native/canvas/execute) for request fields and results, and the [Canvas node reference](https://deepraxis.com/en/docs/developers/canvas/nodes) for node content.
5435
+ *
5436
+ * A successful write increments version by one. Optionally set expected_version to the version from retrieve or nodes.list; on 409 REVISION_CONFLICT read again, merge your intent and retry with the current version. Every script failure rolls back all writes. On 400 SCRIPT_ERROR, SCRIPT_LIMIT or OPS_REJECTED, use error.details.edit_id plus edits to repair and rerun the stored source without resending the entire script; details may include line, column and rejection. On 400 EDIT_EXPIRED the saved script is older than ten minutes: submit a corrected new script. On 429 CANVAS_BUSY, more than four calls are queued for this canvas: wait for pending calls before retrying.
5339
5437
  *
5340
- * Adds one field to an existing table and returns the updated table (HTTP 201). Required inputs are name (lowercase letters, digits and underscores; id and names starting with _ are reserved) and type (string, integer, number, boolean, datetime, json or link); json needs options.schema and link needs options.linked_table_id and options.multiple. Adding a required field to a table that already has rows needs a default, otherwise the call fails with 400 VALIDATION_FAILED; a default is written into every existing row. Fields default to indexed:false. Set indexed:true explicitly for fields used in filters or ordering. Only indexed:true or unique:true consumes one of the 16 indexed-or-unique field slots; a field with both consumes one slot. Unique fields still consume a slot even with indexed:false. Existing fields are unchanged. Minimal field example: {"name":"notes","type":"string","indexed":false}. JSON and link fields cannot be indexed. Limits: 64 fields and 16 indexed or unique fields per table (400 LIMIT_EXCEEDED). Unlike Supabase, schema evolution uses field definitions rather than ALTER TABLE statements or SQL migrations.
5341
5438
  */
5342
- export const databaseAddField = (options) => (options.client ?? client).post({
5439
+ export const canvasExecute = (options) => (options.client ?? client).post({
5343
5440
  security: [{
5344
- key: 'database-bearerAuth',
5441
+ key: 'canvas-bearerAuth',
5345
5442
  scheme: 'bearer',
5346
5443
  type: 'http'
5347
5444
  }],
5348
- url: '/database/v1/databases/{database_id}/tables/{table}/fields',
5445
+ url: '/canvas/v1/canvases/{canvas_id}:execute',
5349
5446
  ...options,
5350
5447
  headers: {
5351
5448
  'Content-Type': 'application/json',
@@ -5353,31 +5450,39 @@ export const databaseAddField = (options) => (options.client ?? client).post({
5353
5450
  }
5354
5451
  });
5355
5452
  /**
5356
- * Delete field
5453
+ * List projects
5357
5454
  *
5358
- * Deletes one field definition from a table and returns the updated table; the deletion is immediate and has no recovery window. Look the field up by id or name. The field's index, if any, is dropped with it, and the name can be reused afterwards. Unknown fields return 400 FIELD_NOT_FOUND.
5455
+ * Discover projects owned by the API key organization and obtain project_id values. Results default to active projects ordered by updateTime descending; use filter state = "deleted" to find retained deleted projects for undelete. Continue with next_page_token as page_token until the token is absent.
5359
5456
  */
5360
- export const databaseDeleteField = (options) => (options.client ?? client).delete({
5457
+ export const cutListProjects = (options) => (options?.client ?? client).get({
5361
5458
  security: [{
5362
- key: 'database-bearerAuth',
5459
+ key: 'BearerAuth',
5363
5460
  scheme: 'bearer',
5364
5461
  type: 'http'
5462
+ }, {
5463
+ key: 'ApiKeyAuth',
5464
+ name: 'X-API-Key',
5465
+ type: 'apiKey'
5365
5466
  }],
5366
- url: '/database/v1/databases/{database_id}/tables/{table}/fields/{field}',
5467
+ url: '/cut/v1/projects',
5367
5468
  ...options
5368
5469
  });
5369
5470
  /**
5370
- * Update field
5471
+ * Create project
5371
5472
  *
5372
- * Changes a field's name, description, required flag, indexed flag, default or json options.schema and returns the updated table. The field type, a link field's linked_table_id and the unique flag cannot be changed (400 FIELD_TYPE_IMMUTABLE or INVALID_PARAMS). Setting required to true fails with 400 VALIDATION_FAILED while existing rows hold null for the field. A new json schema constrains only later writes; existing rows are not revalidated. Renaming never rewrites row data, and a request that changes nothing does not bump schema_revision. Unlike Supabase, field types and uniqueness cannot be altered through SQL migrations; use the supported field settings described here.
5473
+ * Create a blank editing project in the API key organization before writing a script. First obtain accessible library ids from praxis.media; bindings must include exactly one read_write library with default_upload true. Each call creates a new project and returns HTTP 201; save its id for execute, state and timeline calls. All editing positions use seconds.
5373
5474
  */
5374
- export const databaseUpdateField = (options) => (options.client ?? client).patch({
5475
+ export const cutCreateProject = (options) => (options.client ?? client).post({
5375
5476
  security: [{
5376
- key: 'database-bearerAuth',
5477
+ key: 'BearerAuth',
5377
5478
  scheme: 'bearer',
5378
5479
  type: 'http'
5480
+ }, {
5481
+ key: 'ApiKeyAuth',
5482
+ name: 'X-API-Key',
5483
+ type: 'apiKey'
5379
5484
  }],
5380
- url: '/database/v1/databases/{database_id}/tables/{table}/fields/{field}',
5485
+ url: '/cut/v1/projects',
5381
5486
  ...options,
5382
5487
  headers: {
5383
5488
  'Content-Type': 'application/json',
@@ -5385,67 +5490,695 @@ export const databaseUpdateField = (options) => (options.client ?? client).patch
5385
5490
  }
5386
5491
  });
5387
5492
  /**
5388
- * List events
5493
+ * Delete project
5389
5494
  *
5390
- * Read lifecycle and schema events, including while the database is deleting. next_cursor is an opaque string cursor (do not do arithmetic on it): pass it as after_seq for asc or before_seq for desc. Supplying both cursors returns 400 INVALID_PARAMS. Unlike Supabase Realtime, this is paged lifecycle and schema history, not a subscription or a row-change feed; row inserts, updates and deletes do not appear here.
5495
+ * Soft-delete a project selected from projects.list. The project is retained for seven days until purge_time and can be restored with undelete before that deadline. Deleted projects cannot be edited; list with filter state = "deleted" to locate retained projects.
5391
5496
  */
5392
- export const databaseListEvents = (options) => (options.client ?? client).get({
5497
+ export const cutDeleteProject = (options) => (options.client ?? client).delete({
5393
5498
  security: [{
5394
- key: 'database-bearerAuth',
5499
+ key: 'BearerAuth',
5395
5500
  scheme: 'bearer',
5396
5501
  type: 'http'
5502
+ }, {
5503
+ key: 'ApiKeyAuth',
5504
+ name: 'X-API-Key',
5505
+ type: 'apiKey'
5397
5506
  }],
5398
- url: '/database/v1/databases/{database_id}/events',
5507
+ url: '/cut/v1/projects/{project_id}',
5399
5508
  ...options
5400
5509
  });
5401
5510
  /**
5402
- * Delete rows
5511
+ * Retrieve project
5403
5512
  *
5404
- * Deletes the rows matched by the filter query parameters (the same filters as databaseSelect); with no filter every row of the table matches. Deletion is immediate and cannot be undone. A row that a link field of another table still references makes the whole call fail with 409 REFERENCE_RESTRICT and nothing is deleted. The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the deleted rows.
5513
+ * Inspect project metadata, settings and library bindings before editing. Copy id from projects.create or list; expand=timeline,exports,versions includes selected related resources. The expanded timeline uses seconds and the returned revision can guard a later execute call with expected_revision.
5405
5514
  */
5406
- export const databaseDelete = (options) => (options.client ?? client).delete({
5515
+ export const cutRetrieveProject = (options) => (options.client ?? client).get({
5407
5516
  security: [{
5408
- key: 'database-bearerAuth',
5517
+ key: 'BearerAuth',
5409
5518
  scheme: 'bearer',
5410
5519
  type: 'http'
5520
+ }, {
5521
+ key: 'ApiKeyAuth',
5522
+ name: 'X-API-Key',
5523
+ type: 'apiKey'
5411
5524
  }],
5412
- url: '/database/v1/databases/{database_id}/rest/{table}',
5525
+ url: '/cut/v1/projects/{project_id}',
5413
5526
  ...options
5414
5527
  });
5415
5528
  /**
5416
- * Select rows
5529
+ * Update project metadata
5417
5530
  *
5418
- * Read matching rows with filters, selected columns and ordering. Returns at most 1000 rows per request, including when limit is omitted. Content-Range reports the actual returned interval and the total when count is requested. PATCH and DELETE are not subject to this read cap. Unlike Supabase, casts, aggregates, spread and join modifiers are unsupported. Each table supports up to 1,000,000 rows. Query budget: 8,000 ms with a shared 3,000,000-row safety ceiling. Create indexes on filtered or sorted fields, or narrow the request when it exceeds its budget. Synchronous SQLite aggregates use candidate-row throughput estimates before execution; deployed Workers freeze clocks during synchronous CPU work, so the timer is not a guaranteed server-side interrupt. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Error table: QUERY_CANCELED / PostgREST 57014 is HTTP 500, retryable=false: Query timed out: index filtered or sorted fields, or narrow the range. DATABASE_INVALID_STATE is HTTP 409 for operations on a deleting database. Cleared or nonexistent databases return DATABASE_NOT_FOUND / HTTP 404. The count is an HTTP Content-Range response header, not a JSON property. Use praxis.database.count in the SDK or codemode to return { count: number | null }; a page length is not a total unless you know all matches fit in that page.
5531
+ * Change the project display name or replace its labels by naming those fields in update_mask. Use execute for clip or track edits. Each successful update commits a new revision; labels are replaced as a whole when selected, so read and merge existing labels before overwriting them.
5419
5532
  */
5420
- export const databaseSelect = (options) => (options.client ?? client).get({
5533
+ export const cutUpdateProject = (options) => (options.client ?? client).patch({
5421
5534
  security: [{
5422
- key: 'database-bearerAuth',
5535
+ key: 'BearerAuth',
5423
5536
  scheme: 'bearer',
5424
5537
  type: 'http'
5538
+ }, {
5539
+ key: 'ApiKeyAuth',
5540
+ name: 'X-API-Key',
5541
+ type: 'apiKey'
5425
5542
  }],
5426
- url: '/database/v1/databases/{database_id}/rest/{table}',
5427
- ...options
5543
+ url: '/cut/v1/projects/{project_id}',
5544
+ ...options,
5545
+ headers: {
5546
+ 'Content-Type': 'application/json',
5547
+ ...options.headers
5548
+ }
5428
5549
  });
5429
5550
  /**
5430
- * Count rows
5551
+ * Restore deleted project
5431
5552
  *
5432
- * Inspect the HTTP row count and range without retrieving row data; send Prefer: count=exact for a filtered count. Returns no body and does not fetch or serialize row data. A known count determines the interval using limit/offset or Range with a default and maximum page size of 1000. Without a count preference, or when the selected count mode cannot supply a total, Content-Range is **. Singular Accept still validates page cardinality. Unlike Supabase, planned and estimated counts do not use PostgreSQL planner estimates. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Use praxis.database.count in the SDK or codemode to return { count: number | null } from this header without retrieving rows.
5553
+ * Return a retained deleted project to active state before its purge_time. Obtain project_id from projects.list filtered to deleted projects. This restores the project, not an older timeline revision; use versions.restore when reverting editing content.
5433
5554
  */
5434
- export const databaseHead = (options) => (options.client ?? client).head({
5555
+ export const cutUndeleteProject = (options) => (options.client ?? client).post({
5435
5556
  security: [{
5436
- key: 'database-bearerAuth',
5557
+ key: 'BearerAuth',
5437
5558
  scheme: 'bearer',
5438
5559
  type: 'http'
5560
+ }, {
5561
+ key: 'ApiKeyAuth',
5562
+ name: 'X-API-Key',
5563
+ type: 'apiKey'
5439
5564
  }],
5440
- url: '/database/v1/databases/{database_id}/rest/{table}',
5565
+ url: '/cut/v1/projects/{project_id}:undelete',
5441
5566
  ...options
5442
5567
  });
5443
5568
  /**
5444
- * Update rows
5569
+ * Execute editing script
5445
5570
  *
5446
- * Updates the rows matched by the filter query parameters (the same filters as databaseSelect); with no filter every row of the table matches. The JSON object body lists only the fields to change, other fields keep their values, and id cannot be changed. Values are validated against the field types and the required and unique settings (400 VALIDATION_FAILED, 409 UNIQUE_VIOLATION). The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the updated rows. Each changed row's _version increases by one.
5571
+ * Edit the current timeline atomically using synchronous JavaScript source. Read state or timeline first, then pass its revision as expected_revision to detect concurrent changes. Use AddTrack, Insert, Update, Delete, Split, Trim, Move, RippleDeleteRange, UpdateTrack, DeleteTrack, SetSettings, AddCaptionsFromTranscript and SetMarker for writes; GetTimeline, GetItem, FindItems, GetMedia, GetTranscript and GetAnalysis read editing context; Print emits text and Preview requests frame previews. All script times are seconds; script object fields use camelCase, for example `media: {libraryId, assetId}`. Unlike Shotstack, execute applies script edits to a persistent project in one transaction. Provide script or a saved edit_id with literal edits, never both; failures roll back writes. A revision conflict while preparing the response may follow a committed edit: retrieve state before retrying. Minimal script after creating a project:
5572
+ *
5573
+ * ```js
5574
+ * const t = AddTrack("video");
5575
+ * Insert(t, {type: "color", color: "#123456", start: 0, length: 3});
5576
+ * Print(t);
5577
+ * ```
5447
5578
  */
5448
- export const databaseUpdate = (options) => (options.client ?? client).patch({
5579
+ export const cutExecute = (options) => (options.client ?? client).post({
5580
+ security: [{
5581
+ key: 'BearerAuth',
5582
+ scheme: 'bearer',
5583
+ type: 'http'
5584
+ }, {
5585
+ key: 'ApiKeyAuth',
5586
+ name: 'X-API-Key',
5587
+ type: 'apiKey'
5588
+ }],
5589
+ url: '/cut/v1/projects/{project_id}:execute',
5590
+ ...options,
5591
+ headers: {
5592
+ 'Content-Type': 'application/json',
5593
+ ...options.headers
5594
+ }
5595
+ });
5596
+ /**
5597
+ * Read editing state
5598
+ *
5599
+ * Read lightweight project context before composing an execute script. Returns current revision, rendering settings, track counts, library bindings and offline media count without individual clips. For complete clip documents or a selected time range, read timeline instead.
5600
+ */
5601
+ export const cutRetrieveState = (options) => (options.client ?? client).get({
5602
+ security: [{
5603
+ key: 'BearerAuth',
5604
+ scheme: 'bearer',
5605
+ type: 'http'
5606
+ }, {
5607
+ key: 'ApiKeyAuth',
5608
+ name: 'X-API-Key',
5609
+ type: 'apiKey'
5610
+ }],
5611
+ url: '/cut/v1/projects/{project_id}/state',
5612
+ ...options
5613
+ });
5614
+ /**
5615
+ * Read project timeline
5616
+ *
5617
+ * Inspect clips and markers in a selected project range before editing. view=full returns structured tracks with all timeline positions in seconds; view=compact returns compact text for script context. from and to are seconds and tracks limits the selection to comma-separated track ids from state. Concurrent changes while preparing a full timeline return 409; retrieve the latest state and try the read again.
5618
+ */
5619
+ export const cutRetrieveTimeline = (options) => (options.client ?? client).get({
5620
+ security: [{
5621
+ key: 'BearerAuth',
5622
+ scheme: 'bearer',
5623
+ type: 'http'
5624
+ }, {
5625
+ key: 'ApiKeyAuth',
5626
+ name: 'X-API-Key',
5627
+ type: 'apiKey'
5628
+ }],
5629
+ url: '/cut/v1/projects/{project_id}/timeline',
5630
+ ...options
5631
+ });
5632
+ /**
5633
+ * Render preview frames
5634
+ *
5635
+ * Review the visual result at one or more project times without creating an export. Pass comma-separated seconds in at, such as 12,15.5; scale changes preview size and revision selects a committed project revision. Fetch the returned image URLs before expires_at; render again when they expire.
5636
+ */
5637
+ export const cutListFrames = (options) => (options.client ?? client).get({
5638
+ security: [{
5639
+ key: 'BearerAuth',
5640
+ scheme: 'bearer',
5641
+ type: 'http'
5642
+ }, {
5643
+ key: 'ApiKeyAuth',
5644
+ name: 'X-API-Key',
5645
+ type: 'apiKey'
5646
+ }],
5647
+ url: '/cut/v1/projects/{project_id}/frames',
5648
+ ...options
5649
+ });
5650
+ /**
5651
+ * Analyze project media
5652
+ *
5653
+ * Request silence, filler-word or scene analysis for selected bound assets before editing. Omit media to select project sources; ranges returned in segments use source seconds. A pending result is not completion: use retry_after_sec before checking again, and inspect failed or unsupported asset results before deciding which edits are possible.
5654
+ */
5655
+ export const cutCreateAnalysis = (options) => (options.client ?? client).post({
5656
+ security: [{
5657
+ key: 'BearerAuth',
5658
+ scheme: 'bearer',
5659
+ type: 'http'
5660
+ }, {
5661
+ key: 'ApiKeyAuth',
5662
+ name: 'X-API-Key',
5663
+ type: 'apiKey'
5664
+ }],
5665
+ url: '/cut/v1/projects/{project_id}/analysis',
5666
+ ...options,
5667
+ headers: {
5668
+ 'Content-Type': 'application/json',
5669
+ ...options.headers
5670
+ }
5671
+ });
5672
+ /**
5673
+ * List library bindings
5674
+ *
5675
+ * Discover the named media libraries available to this project before selecting source assets or an import/export destination. read bindings supply source assets; read_write bindings also accept uploads. Exactly one writable binding supplies the default upload destination.
5676
+ */
5677
+ export const cutListBindings = (options) => (options.client ?? client).get({
5678
+ security: [{
5679
+ key: 'BearerAuth',
5680
+ scheme: 'bearer',
5681
+ type: 'http'
5682
+ }, {
5683
+ key: 'ApiKeyAuth',
5684
+ name: 'X-API-Key',
5685
+ type: 'apiKey'
5686
+ }],
5687
+ url: '/cut/v1/projects/{project_id}/bindings',
5688
+ ...options
5689
+ });
5690
+ /**
5691
+ * Bind media library
5692
+ *
5693
+ * Attach an accessible media library to an existing project under a unique name. Obtain library_id from praxis.media and choose read for source-only access or read_write for imports and exports. The project must retain exactly one read_write binding with default_upload true after the change.
5694
+ */
5695
+ export const cutCreateBinding = (options) => (options.client ?? client).post({
5696
+ security: [{
5697
+ key: 'BearerAuth',
5698
+ scheme: 'bearer',
5699
+ type: 'http'
5700
+ }, {
5701
+ key: 'ApiKeyAuth',
5702
+ name: 'X-API-Key',
5703
+ type: 'apiKey'
5704
+ }],
5705
+ url: '/cut/v1/projects/{project_id}/bindings',
5706
+ ...options,
5707
+ headers: {
5708
+ 'Content-Type': 'application/json',
5709
+ ...options.headers
5710
+ }
5711
+ });
5712
+ /**
5713
+ * Remove library binding
5714
+ *
5715
+ * Detach a library alias obtained from bindings.list after removing all timeline clips that reference its library. BINDING_IN_USE returns 409 while references remain; inspect timeline and edit those clips first. Removal must preserve the one writable default upload binding.
5716
+ */
5717
+ export const cutDeleteBinding = (options) => (options.client ?? client).delete({
5718
+ security: [{
5719
+ key: 'BearerAuth',
5720
+ scheme: 'bearer',
5721
+ type: 'http'
5722
+ }, {
5723
+ key: 'ApiKeyAuth',
5724
+ name: 'X-API-Key',
5725
+ type: 'apiKey'
5726
+ }],
5727
+ url: '/cut/v1/projects/{project_id}/bindings/{name}',
5728
+ ...options
5729
+ });
5730
+ /**
5731
+ * Import project media
5732
+ *
5733
+ * Import a URL, data URI or existing file into a writable project media library. Select binding from bindings.list or omit it to use default_upload. Save library_id and asset_id from the result and use them as libraryId and assetId inside execute script media references; overwrites follow the source asset latest version.
5734
+ */
5735
+ export const cutImportMedia = (options) => (options.client ?? client).post({
5736
+ security: [{
5737
+ key: 'BearerAuth',
5738
+ scheme: 'bearer',
5739
+ type: 'http'
5740
+ }, {
5741
+ key: 'ApiKeyAuth',
5742
+ name: 'X-API-Key',
5743
+ type: 'apiKey'
5744
+ }],
5745
+ url: '/cut/v1/projects/{project_id}/media:import',
5746
+ ...options,
5747
+ headers: {
5748
+ 'Content-Type': 'application/json',
5749
+ ...options.headers
5750
+ }
5751
+ });
5752
+ /**
5753
+ * List project exports
5754
+ *
5755
+ * Find export jobs associated with this project before polling or canceling a render. Copy an export id into praxis.cut.exports.retrieve or cancel. Continue with next_page_token as page_token when present; queued or in-progress jobs have not produced a final media asset.
5756
+ */
5757
+ export const cutListExports = (options) => (options.client ?? client).get({
5758
+ security: [{
5759
+ key: 'BearerAuth',
5760
+ scheme: 'bearer',
5761
+ type: 'http'
5762
+ }, {
5763
+ key: 'ApiKeyAuth',
5764
+ name: 'X-API-Key',
5765
+ type: 'apiKey'
5766
+ }],
5767
+ url: '/cut/v1/projects/{project_id}/exports',
5768
+ ...options
5769
+ });
5770
+ /**
5771
+ * Create video export
5772
+ *
5773
+ * Start an asynchronous video export from the project into a writable bound media library. Choose binding from bindings.list or omit it for default_upload, and optionally select revision and output settings. HTTP 202 only accepts the job; poll praxis.cut.exports.retrieve using the returned id until status is done, failed or canceled. On done, asset identifies the video written back to praxis.media. Each call starts a job, so retrieve a known job before retrying a submission.
5774
+ */
5775
+ export const cutCreateExport = (options) => (options.client ?? client).post({
5776
+ security: [{
5777
+ key: 'BearerAuth',
5778
+ scheme: 'bearer',
5779
+ type: 'http'
5780
+ }, {
5781
+ key: 'ApiKeyAuth',
5782
+ name: 'X-API-Key',
5783
+ type: 'apiKey'
5784
+ }],
5785
+ url: '/cut/v1/projects/{project_id}/exports',
5786
+ ...options,
5787
+ headers: {
5788
+ 'Content-Type': 'application/json',
5789
+ ...options.headers
5790
+ }
5791
+ });
5792
+ /**
5793
+ * Retrieve video export
5794
+ *
5795
+ * Poll an export id returned by projects.exports.create or list to observe render progress. queued, fetching, rendering, stitching and saving are in progress; done provides asset in the target library, failed provides error, and canceled means the job stopped. Only done confirms a usable output asset.
5796
+ */
5797
+ export const cutRetrieveExport = (options) => (options.client ?? client).get({
5798
+ security: [{
5799
+ key: 'BearerAuth',
5800
+ scheme: 'bearer',
5801
+ type: 'http'
5802
+ }, {
5803
+ key: 'ApiKeyAuth',
5804
+ name: 'X-API-Key',
5805
+ type: 'apiKey'
5806
+ }],
5807
+ url: '/cut/v1/exports/{export_id}',
5808
+ ...options
5809
+ });
5810
+ /**
5811
+ * Cancel video export
5812
+ *
5813
+ * Request cancellation of an export obtained from projects.exports.create or list when its output is no longer needed. Read the returned job status and retrieve it to confirm the terminal outcome; do not interpret a cancellation request as successful rendering.
5814
+ */
5815
+ export const cutCancelExport = (options) => (options.client ?? client).post({
5816
+ security: [{
5817
+ key: 'BearerAuth',
5818
+ scheme: 'bearer',
5819
+ type: 'http'
5820
+ }, {
5821
+ key: 'ApiKeyAuth',
5822
+ name: 'X-API-Key',
5823
+ type: 'apiKey'
5824
+ }],
5825
+ url: '/cut/v1/exports/{export_id}:cancel',
5826
+ ...options
5827
+ });
5828
+ /**
5829
+ * List saved versions
5830
+ *
5831
+ * Find saved timeline snapshots for this project and obtain version_id values for restore. A saved version records its original revision; restoring it creates a new current revision rather than rewinding the revision counter. Continue with next_page_token as page_token until absent.
5832
+ */
5833
+ export const cutListVersions = (options) => (options.client ?? client).get({
5834
+ security: [{
5835
+ key: 'BearerAuth',
5836
+ scheme: 'bearer',
5837
+ type: 'http'
5838
+ }, {
5839
+ key: 'ApiKeyAuth',
5840
+ name: 'X-API-Key',
5841
+ type: 'apiKey'
5842
+ }],
5843
+ url: '/cut/v1/projects/{project_id}/versions',
5844
+ ...options
5845
+ });
5846
+ /**
5847
+ * Save project version
5848
+ *
5849
+ * Save the current project timeline as a named recovery point before a substantial edit. Supply an optional label or send an empty object; keep the returned version id for versions.restore. Saving a version does not publish a rendered asset; use projects.exports.create for video output.
5850
+ */
5851
+ export const cutCreateVersion = (options) => (options.client ?? client).post({
5852
+ security: [{
5853
+ key: 'BearerAuth',
5854
+ scheme: 'bearer',
5855
+ type: 'http'
5856
+ }, {
5857
+ key: 'ApiKeyAuth',
5858
+ name: 'X-API-Key',
5859
+ type: 'apiKey'
5860
+ }],
5861
+ url: '/cut/v1/projects/{project_id}/versions',
5862
+ ...options,
5863
+ headers: {
5864
+ 'Content-Type': 'application/json',
5865
+ ...options.headers
5866
+ }
5867
+ });
5868
+ /**
5869
+ * Restore saved version
5870
+ *
5871
+ * Replace current editing content with a saved project snapshot selected from projects.versions.list. The restore commits a new transaction and revision while preserving the saved version for future use. Inspect the returned summary and timeline before further editing; a response revision conflict can follow a committed restore, so retrieve current state before retrying.
5872
+ */
5873
+ export const cutRestoreVersion = (options) => (options.client ?? client).post({
5874
+ security: [{
5875
+ key: 'BearerAuth',
5876
+ scheme: 'bearer',
5877
+ type: 'http'
5878
+ }, {
5879
+ key: 'ApiKeyAuth',
5880
+ name: 'X-API-Key',
5881
+ type: 'apiKey'
5882
+ }],
5883
+ url: '/cut/v1/versions/{version_id}:restore',
5884
+ ...options
5885
+ });
5886
+ /**
5887
+ * List databases
5888
+ *
5889
+ * Find databases owned by your tenant and obtain their ids for schema or row operations. Excludes deleting by default. status=active or status=deleting selects that state; invalid values return 400 INVALID_PARAMS.
5890
+ */
5891
+ export const databaseListDatabases = (options) => (options?.client ?? client).get({
5892
+ security: [{
5893
+ key: 'database-bearerAuth',
5894
+ scheme: 'bearer',
5895
+ type: 'http'
5896
+ }],
5897
+ url: '/database/v1/databases',
5898
+ ...options
5899
+ });
5900
+ /**
5901
+ * Create database
5902
+ *
5903
+ * Creates an empty database for the caller and returns it with status active (HTTP 201); add tables next with praxis.database.databases.tables.create. name is required and is 1–64 visible characters after trimming. labels are optional string tags (at most 64; each key starts with a lowercase letter and uses up to 63 characters of a-z 0-9 _ -; each value is up to 63 characters of a-z 0-9 _ -) that databaseListDatabases can filter on. If initialization fails the call returns 503 CAPACITY and the half-created database is left with status failed; retry by calling create again, which makes a new database. Unlike Supabase, this creates a SQLite-backed database without a PostgreSQL connection or SQL execution endpoint. Use a Praxis credential; access is scoped to its tenant, not to Supabase Auth users or RLS policies.
5904
+ */
5905
+ export const databaseCreateDatabase = (options) => (options.client ?? client).post({
5906
+ security: [{
5907
+ key: 'database-bearerAuth',
5908
+ scheme: 'bearer',
5909
+ type: 'http'
5910
+ }],
5911
+ url: '/database/v1/databases',
5912
+ ...options,
5913
+ headers: {
5914
+ 'Content-Type': 'application/json',
5915
+ ...options.headers
5916
+ }
5917
+ });
5918
+ /**
5919
+ * Delete database
5920
+ *
5921
+ * Soft-delete a database when it should stop accepting schema and row operations. Idempotently enters deleting with a seven-day purge_at. GET remains available; child operations return 409 until restored.
5922
+ */
5923
+ export const databaseDeleteDatabase = (options) => (options.client ?? client).delete({
5924
+ security: [{
5925
+ key: 'database-bearerAuth',
5926
+ scheme: 'bearer',
5927
+ type: 'http'
5928
+ }],
5929
+ url: '/database/v1/databases/{database_id}',
5930
+ ...options
5931
+ });
5932
+ /**
5933
+ * Get database
5934
+ *
5935
+ * Returns one database by id, including a database in the deleting state (purge_at then shows when it will be permanently removed). Call it before table or row operations to confirm status is active: schema and row calls on a deleting database return 409 DATABASE_INVALID_STATE. size_bytes is refreshed from live storage at most once every five seconds. A purged or unknown id returns 404 DATABASE_NOT_FOUND.
5936
+ */
5937
+ export const databaseGetDatabase = (options) => (options.client ?? client).get({
5938
+ security: [{
5939
+ key: 'database-bearerAuth',
5940
+ scheme: 'bearer',
5941
+ type: 'http'
5942
+ }],
5943
+ url: '/database/v1/databases/{database_id}',
5944
+ ...options
5945
+ });
5946
+ /**
5947
+ * Update database
5948
+ *
5949
+ * Renames an active database and/or replaces its labels; send only the keys you want to change. labels is replaced as a whole, not merged, so include every label you want to keep. A body without name or labels, or with values equal to the current ones, changes nothing and leaves updated_at as is. A database in the deleting state returns 409 DATABASE_INVALID_STATE; restore it first with databaseRestoreDatabase.
5950
+ */
5951
+ export const databaseUpdateDatabase = (options) => (options.client ?? client).patch({
5952
+ security: [{
5953
+ key: 'database-bearerAuth',
5954
+ scheme: 'bearer',
5955
+ type: 'http'
5956
+ }],
5957
+ url: '/database/v1/databases/{database_id}',
5958
+ ...options,
5959
+ headers: {
5960
+ 'Content-Type': 'application/json',
5961
+ ...options.headers
5962
+ }
5963
+ });
5964
+ /**
5965
+ * Restore database
5966
+ *
5967
+ * Recover a soft-deleted database within its seven-day recovery window. Restore before purge_at. An empty body is accepted. Active databases return 409; purged databases return 404.
5968
+ */
5969
+ export const databaseRestoreDatabase = (options) => (options.client ?? client).post({
5970
+ security: [{
5971
+ key: 'database-bearerAuth',
5972
+ scheme: 'bearer',
5973
+ type: 'http'
5974
+ }],
5975
+ url: '/database/v1/databases/{database_id}/restore',
5976
+ ...options
5977
+ });
5978
+ /**
5979
+ * Permanently purge database
5980
+ *
5981
+ * Immediately and irreversibly purges a deleting database. Active databases return 409; absent or already purged databases return 404.
5982
+ */
5983
+ export const databasePurgeDatabase = (options) => (options.client ?? client).post({
5984
+ security: [{
5985
+ key: 'database-bearerAuth',
5986
+ scheme: 'bearer',
5987
+ type: 'http'
5988
+ }],
5989
+ url: '/database/v1/databases/{database_id}/purge',
5990
+ ...options
5991
+ });
5992
+ /**
5993
+ * List tables
5994
+ *
5995
+ * Lists every table of an active database with its field definitions. A database holds at most 50 tables, so the single page contains all of them and next_cursor is always null. Use databaseGetTable instead when you also need row_count for one table.
5996
+ */
5997
+ export const databaseListTables = (options) => (options.client ?? client).get({
5998
+ security: [{
5999
+ key: 'database-bearerAuth',
6000
+ scheme: 'bearer',
6001
+ type: 'http'
6002
+ }],
6003
+ url: '/database/v1/databases/{database_id}/tables',
6004
+ ...options
6005
+ });
6006
+ /**
6007
+ * Create table
6008
+ *
6009
+ * Creates a table together with its initial fields in one call and returns it (HTTP 201) with generated tbl_ and fld_ ids. name must match ^[a-z_][a-z0-9_]{0,62}$ and be unused in this database (duplicate: 409 UNIQUE_VIOLATION). fields is required and may be an empty array; fields can also be added later with databaseAddField. Limits: 50 tables per database, 64 fields per table, and 16 indexed or unique fields per table; exceeding one returns 400 LIMIT_EXCEEDED. Fields default to indexed:false. Set indexed:true explicitly for fields used in filters or ordering. Only indexed:true or unique:true consumes one of the 16 indexed-or-unique field slots; a field with both consumes one slot. Unique fields still consume a slot even with indexed:false. Existing fields are unchanged. Minimal field example: {"name":"notes","type":"string","indexed":false}. Every row also has a system id column, which is not declared as a field. Insert data afterwards with databaseInsert. Unlike Supabase, define schema with this table API and the field APIs; PostgreSQL DDL and SQL migration files cannot be submitted. Each table supports up to 1,000,000 rows.
6010
+ */
6011
+ export const databaseCreateTable = (options) => (options.client ?? client).post({
6012
+ security: [{
6013
+ key: 'database-bearerAuth',
6014
+ scheme: 'bearer',
6015
+ type: 'http'
6016
+ }],
6017
+ url: '/database/v1/databases/{database_id}/tables',
6018
+ ...options,
6019
+ headers: {
6020
+ 'Content-Type': 'application/json',
6021
+ ...options.headers
6022
+ }
6023
+ });
6024
+ /**
6025
+ * Delete table
6026
+ *
6027
+ * Permanently drops a table with all of its rows; the deletion is immediate and has no recovery window or undo. Refused with 409 REFERENCE_RESTRICT while a link field of another table points at this table, so delete or change those fields first. Returns {deleted: true}. A table name can be reused afterwards.
6028
+ */
6029
+ export const databaseDeleteTable = (options) => (options.client ?? client).delete({
6030
+ security: [{
6031
+ key: 'database-bearerAuth',
6032
+ scheme: 'bearer',
6033
+ type: 'http'
6034
+ }],
6035
+ url: '/database/v1/databases/{database_id}/tables/{table}',
6036
+ ...options
6037
+ });
6038
+ /**
6039
+ * Get table
6040
+ *
6041
+ * Returns one table by id or name with its field definitions, schema_revision and row_count. row_count is only returned by this operation, not by list or create. Use field ids from this response for stable references because field names can be renamed; an unknown table returns 404 TABLE_NOT_FOUND.
6042
+ */
6043
+ export const databaseGetTable = (options) => (options.client ?? client).get({
6044
+ security: [{
6045
+ key: 'database-bearerAuth',
6046
+ scheme: 'bearer',
6047
+ type: 'http'
6048
+ }],
6049
+ url: '/database/v1/databases/{database_id}/tables/{table}',
6050
+ ...options
6051
+ });
6052
+ /**
6053
+ * Update table
6054
+ *
6055
+ * Renames a table and/or changes its description; send only the keys to change, and send description null to clear it. The new name must follow ^[a-z_][a-z0-9_]{0,62}$ and be unused (409 UNIQUE_VIOLATION); ids are stable, so renaming never rewrites row data. A body with no changes or values equal to the current ones does not bump schema_revision. Fields cannot be changed here; use databaseAddField, databaseUpdateField and databaseDeleteField.
6056
+ */
6057
+ export const databaseUpdateTable = (options) => (options.client ?? client).patch({
6058
+ security: [{
6059
+ key: 'database-bearerAuth',
6060
+ scheme: 'bearer',
6061
+ type: 'http'
6062
+ }],
6063
+ url: '/database/v1/databases/{database_id}/tables/{table}',
6064
+ ...options,
6065
+ headers: {
6066
+ 'Content-Type': 'application/json',
6067
+ ...options.headers
6068
+ }
6069
+ });
6070
+ /**
6071
+ * Add field
6072
+ *
6073
+ * Adds one field to an existing table and returns the updated table (HTTP 201). Required inputs are name (lowercase letters, digits and underscores; id and names starting with _ are reserved) and type (string, integer, number, boolean, datetime, json or link); json needs options.schema and link needs options.linked_table_id and options.multiple. Adding a required field to a table that already has rows needs a default, otherwise the call fails with 400 VALIDATION_FAILED; a default is written into every existing row. Fields default to indexed:false. Set indexed:true explicitly for fields used in filters or ordering. Only indexed:true or unique:true consumes one of the 16 indexed-or-unique field slots; a field with both consumes one slot. Unique fields still consume a slot even with indexed:false. Existing fields are unchanged. Minimal field example: {"name":"notes","type":"string","indexed":false}. JSON and link fields cannot be indexed. Limits: 64 fields and 16 indexed or unique fields per table (400 LIMIT_EXCEEDED). Unlike Supabase, schema evolution uses field definitions rather than ALTER TABLE statements or SQL migrations.
6074
+ */
6075
+ export const databaseAddField = (options) => (options.client ?? client).post({
6076
+ security: [{
6077
+ key: 'database-bearerAuth',
6078
+ scheme: 'bearer',
6079
+ type: 'http'
6080
+ }],
6081
+ url: '/database/v1/databases/{database_id}/tables/{table}/fields',
6082
+ ...options,
6083
+ headers: {
6084
+ 'Content-Type': 'application/json',
6085
+ ...options.headers
6086
+ }
6087
+ });
6088
+ /**
6089
+ * Delete field
6090
+ *
6091
+ * Deletes one field definition from a table and returns the updated table; the deletion is immediate and has no recovery window. Look the field up by id or name. The field's index, if any, is dropped with it, and the name can be reused afterwards. Unknown fields return 400 FIELD_NOT_FOUND.
6092
+ */
6093
+ export const databaseDeleteField = (options) => (options.client ?? client).delete({
6094
+ security: [{
6095
+ key: 'database-bearerAuth',
6096
+ scheme: 'bearer',
6097
+ type: 'http'
6098
+ }],
6099
+ url: '/database/v1/databases/{database_id}/tables/{table}/fields/{field}',
6100
+ ...options
6101
+ });
6102
+ /**
6103
+ * Update field
6104
+ *
6105
+ * Changes a field's name, description, required flag, indexed flag, default or json options.schema and returns the updated table. The field type, a link field's linked_table_id and the unique flag cannot be changed (400 FIELD_TYPE_IMMUTABLE or INVALID_PARAMS). Setting required to true fails with 400 VALIDATION_FAILED while existing rows hold null for the field. A new json schema constrains only later writes; existing rows are not revalidated. Renaming never rewrites row data, and a request that changes nothing does not bump schema_revision. Unlike Supabase, field types and uniqueness cannot be altered through SQL migrations; use the supported field settings described here.
6106
+ */
6107
+ export const databaseUpdateField = (options) => (options.client ?? client).patch({
6108
+ security: [{
6109
+ key: 'database-bearerAuth',
6110
+ scheme: 'bearer',
6111
+ type: 'http'
6112
+ }],
6113
+ url: '/database/v1/databases/{database_id}/tables/{table}/fields/{field}',
6114
+ ...options,
6115
+ headers: {
6116
+ 'Content-Type': 'application/json',
6117
+ ...options.headers
6118
+ }
6119
+ });
6120
+ /**
6121
+ * List events
6122
+ *
6123
+ * Read lifecycle and schema events, including while the database is deleting. next_cursor is an opaque string cursor (do not do arithmetic on it): pass it as after_seq for asc or before_seq for desc. Supplying both cursors returns 400 INVALID_PARAMS. Unlike Supabase Realtime, this is paged lifecycle and schema history, not a subscription or a row-change feed; row inserts, updates and deletes do not appear here.
6124
+ */
6125
+ export const databaseListEvents = (options) => (options.client ?? client).get({
6126
+ security: [{
6127
+ key: 'database-bearerAuth',
6128
+ scheme: 'bearer',
6129
+ type: 'http'
6130
+ }],
6131
+ url: '/database/v1/databases/{database_id}/events',
6132
+ ...options
6133
+ });
6134
+ /**
6135
+ * Delete rows
6136
+ *
6137
+ * Deletes the rows matched by the filter query parameters (the same filters as databaseSelect); with no filter every row of the table matches. Deletion is immediate and cannot be undone. A row that a link field of another table still references makes the whole call fail with 409 REFERENCE_RESTRICT and nothing is deleted. The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the deleted rows.
6138
+ */
6139
+ export const databaseDelete = (options) => (options.client ?? client).delete({
6140
+ security: [{
6141
+ key: 'database-bearerAuth',
6142
+ scheme: 'bearer',
6143
+ type: 'http'
6144
+ }],
6145
+ url: '/database/v1/databases/{database_id}/rest/{table}',
6146
+ ...options
6147
+ });
6148
+ /**
6149
+ * Select rows
6150
+ *
6151
+ * Read matching rows with filters, selected columns and ordering. Returns at most 1000 rows per request, including when limit is omitted. Content-Range reports the actual returned interval and the total when count is requested. PATCH and DELETE are not subject to this read cap. Unlike Supabase, casts, aggregates, spread and join modifiers are unsupported. Each table supports up to 1,000,000 rows. Query budget: 8,000 ms with a shared 3,000,000-row safety ceiling. Create indexes on filtered or sorted fields, or narrow the request when it exceeds its budget. Synchronous SQLite aggregates use candidate-row throughput estimates before execution; deployed Workers freeze clocks during synchronous CPU work, so the timer is not a guaranteed server-side interrupt. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Error table: QUERY_CANCELED / PostgREST 57014 is HTTP 500, retryable=false: Query timed out: index filtered or sorted fields, or narrow the range. DATABASE_INVALID_STATE is HTTP 409 for operations on a deleting database. Cleared or nonexistent databases return DATABASE_NOT_FOUND / HTTP 404. The count is an HTTP Content-Range response header, not a JSON property. Use praxis.database.count in the SDK or codemode to return { count: number | null }; a page length is not a total unless you know all matches fit in that page.
6152
+ */
6153
+ export const databaseSelect = (options) => (options.client ?? client).get({
6154
+ security: [{
6155
+ key: 'database-bearerAuth',
6156
+ scheme: 'bearer',
6157
+ type: 'http'
6158
+ }],
6159
+ url: '/database/v1/databases/{database_id}/rest/{table}',
6160
+ ...options
6161
+ });
6162
+ /**
6163
+ * Count rows
6164
+ *
6165
+ * Inspect the HTTP row count and range without retrieving row data; send Prefer: count=exact for a filtered count. Returns no body and does not fetch or serialize row data. A known count determines the interval using limit/offset or Range with a default and maximum page size of 1000. Without a count preference, or when the selected count mode cannot supply a total, Content-Range is **. Singular Accept still validates page cardinality. Unlike Supabase, planned and estimated counts do not use PostgreSQL planner estimates. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Use praxis.database.count in the SDK or codemode to return { count: number | null } from this header without retrieving rows.
6166
+ */
6167
+ export const databaseHead = (options) => (options.client ?? client).head({
6168
+ security: [{
6169
+ key: 'database-bearerAuth',
6170
+ scheme: 'bearer',
6171
+ type: 'http'
6172
+ }],
6173
+ url: '/database/v1/databases/{database_id}/rest/{table}',
6174
+ ...options
6175
+ });
6176
+ /**
6177
+ * Update rows
6178
+ *
6179
+ * Updates the rows matched by the filter query parameters (the same filters as databaseSelect); with no filter every row of the table matches. The JSON object body lists only the fields to change, other fields keep their values, and id cannot be changed. Values are validated against the field types and the required and unique settings (400 VALIDATION_FAILED, 409 UNIQUE_VIOLATION). The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the updated rows. Each changed row's _version increases by one.
6180
+ */
6181
+ export const databaseUpdate = (options) => (options.client ?? client).patch({
5449
6182
  security: [{
5450
6183
  key: 'database-bearerAuth',
5451
6184
  scheme: 'bearer',
@@ -6208,6 +6941,24 @@ export const mediaListEvents = (options) => (options.client ?? client).get({
6208
6941
  url: '/media/v1/libraries/{library_id}/events',
6209
6942
  ...options
6210
6943
  });
6944
+ /**
6945
+ * Create delivery token
6946
+ *
6947
+ * Issue a time-limited bearer token for originals and transformed authenticated assets in an active library. Use library_id from library creation or listing; read access is sufficient. Append token as the __cld_token__ query parameter on a matching delivery URL. The default ACL covers this library and the default lifetime is 3600 seconds; narrow acl and expires_in before sharing. Anyone holding the token can read matching paths until expires_at.
6948
+ */
6949
+ export const mediaCreateDeliveryToken = (options) => (options.client ?? client).post({
6950
+ security: [{
6951
+ key: 'media-BearerAuth',
6952
+ scheme: 'bearer',
6953
+ type: 'http'
6954
+ }],
6955
+ url: '/media/v1/libraries/{library_id}/delivery_tokens',
6956
+ ...options,
6957
+ headers: {
6958
+ 'Content-Type': 'application/json',
6959
+ ...options.headers
6960
+ }
6961
+ });
6211
6962
  /**
6212
6963
  * List sandboxes (v2)
6213
6964
  *
@@ -7083,7 +7834,7 @@ export const vaultListSecrets = (options) => (options.client ?? client).get({
7083
7834
  /**
7084
7835
  * Create secret
7085
7836
  *
7086
- * Store a manually supplied token in an active vault for use on requests to its allowed_hosts. Unlike Anthropic credentials, this native operation takes name, value and allowed_hosts directly and creates only static secrets; use praxis.vault.authorizations.create for OAuth. Its name must be unused by any non-archived secret in that vault; the response contains metadata but never the supplied value. Application praxis_vault_ref bindings declare vault_id and secret (the secret name), but currently return 501; do not copy the value into a plain-text binding or metadata as a substitute.
7837
+ * Store a manually supplied token in an active vault. Omit allowed_hosts for name-based resolution only; host-based redemption never matches an empty host list. Unlike Anthropic credentials, this native operation takes name and value directly, with optional allowed_hosts and creates only static secrets; use praxis.vault.authorizations.create for OAuth. Its name must be unused by any non-archived secret in that vault; the response contains metadata but never the supplied value. Application praxis_vault_ref bindings declare vault_id and secret (the secret name), but currently return 501; do not copy the value into a plain-text binding or metadata as a substitute.
7087
7838
  */
7088
7839
  export const vaultCreateSecret = (options) => (options.client ?? client).post({
7089
7840
  security: [{
@@ -7101,7 +7852,7 @@ export const vaultCreateSecret = (options) => (options.client ?? client).post({
7101
7852
  /**
7102
7853
  * Import secrets
7103
7854
  *
7104
- * Import lines or dotenv text into an active vault, reporting success or failure for each entry. Existing names have their values replaced; their hosts change only when that line supplies allowed_hosts. Shared hosts apply only to newly created secrets.
7855
+ * Import lines or dotenv text into an active vault, reporting success or failure for each entry. Existing names have their values replaced; their hosts change only when that line supplies allowed_hosts. Shared hosts apply only to newly created secrets; if neither shared nor per-line hosts are supplied, new secrets use an empty host list for name-based resolution only.
7105
7856
  */
7106
7857
  export const vaultImportSecrets = (options) => (options.client ?? client).post({
7107
7858
  security: [{
@@ -7653,7 +8404,7 @@ export const ticketGetMilestones = (options) => (options?.client ?? client).get(
7653
8404
  /**
7654
8405
  * Create or add milestones
7655
8406
  *
7656
- * Create or add milestones within the authenticated organization. Obtain resource identifiers from the corresponding list or create response. Writes complete synchronously; read the returned resource to observe the result. Organization owner or admin authority is required for this write; API keys without role information act as members.
8407
+ * Create or add milestones within the authenticated organization. Obtain resource identifiers from the corresponding list or create response. Writes complete synchronously; read the returned resource to observe the result. Service authorization applies to the verified human subject.
7657
8408
  */
7658
8409
  export const ticketPostMilestones = (options) => (options.client ?? client).post({
7659
8410
  security: [{
@@ -7675,7 +8426,7 @@ export const ticketPostMilestones = (options) => (options.client ?? client).post
7675
8426
  /**
7676
8427
  * Remove milestones
7677
8428
  *
7678
- * Remove milestones within the authenticated organization. Obtain resource identifiers from the corresponding list or create response. Writes complete synchronously; read the returned resource to observe the result. Organization owner or admin authority is required for this write; API keys without role information act as members.
8429
+ * Remove milestones within the authenticated organization. Obtain resource identifiers from the corresponding list or create response. Writes complete synchronously; read the returned resource to observe the result. Service authorization applies to the verified human subject.
7679
8430
  */
7680
8431
  export const ticketDeleteMilestonesNumber = (options) => (options.client ?? client).delete({
7681
8432
  security: [{
@@ -7711,7 +8462,7 @@ export const ticketGetMilestonesNumber = (options) => (options.client ?? client)
7711
8462
  /**
7712
8463
  * Update milestones
7713
8464
  *
7714
- * Update milestones within the authenticated organization. Obtain resource identifiers from the corresponding list or create response. Writes complete synchronously; read the returned resource to observe the result. Organization owner or admin authority is required for this write; API keys without role information act as members.
8465
+ * Update milestones within the authenticated organization. Obtain resource identifiers from the corresponding list or create response. Writes complete synchronously; read the returned resource to observe the result. Service authorization applies to the verified human subject.
7715
8466
  */
7716
8467
  export const ticketPatchMilestonesNumber = (options) => (options.client ?? client).patch({
7717
8468
  security: [{