@deepraxis/sdk 0.1.1-dev.b3a6ca0 → 0.1.1-dev.b623d9c

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.
@@ -1092,7 +1092,7 @@ export const fileListFiles = (options) => (options?.client ?? client).get({
1092
1092
  /**
1093
1093
  * Upload file
1094
1094
  *
1095
- * Upload a file to reuse in conversations or attach to a knowledge base. Unlike OpenAI Files, uploads must be nonempty and at most 100000000 bytes, and only user_data and vision purposes are accepted. Send file bytes as a multipart file part, not a filename or file ID; in the SDK use a File or Blob, for example new File(["Return within 23 days."], "policy.txt", { type: "text/plain" }). Content determines the MIME type. Supported uploads include PDF, DOCX/XLSX/PPTX, PNG/JPEG/GIF/WebP, MP3/WAV/FLAC/OGG/M4A, MP4/WebM, and UTF-8 JSON/NDJSON/CSV/Markdown/plain text; empty, unsupported, oversized files and unsupported purposes return 400. Use Uploads for larger files. The purpose vision accepts only PNG, JPEG, GIF and WebP, while conversation images require user_data. The returned ID belongs to your tenant; upload alone does not ingest the file into Knowledge. Knowledge attachment has a lower limit of 100000000 bytes. Optionally set expires_after[anchor]=created_at with expires_after[seconds] (3600–7776000). Without expiry, the file persists until deleted.
1095
+ * Upload a file to reuse in conversations or attach to a knowledge base. Unlike OpenAI Files, uploads must be nonempty and at most 100000000 bytes, and only user_data, assistants and vision purposes are accepted. Send file bytes as a multipart file part, not a filename or file ID; in the SDK use a File or Blob, for example new File(["Return within 23 days."], "policy.txt", { type: "text/plain" }). Content determines the MIME type. Supported uploads include PDF, DOCX/XLSX/PPTX, PNG/JPEG/GIF/WebP, MP3/WAV/FLAC/OGG/M4A, MP4/WebM, and UTF-8 JSON/NDJSON/CSV/Markdown/plain text; empty, unsupported, oversized files and unsupported purposes return 400. Use Uploads for larger files. The purpose vision accepts only PNG, JPEG, GIF and WebP, while conversation images require user_data. The returned ID belongs to your tenant; upload alone does not ingest the file into Knowledge. Knowledge attachment has a lower limit of 100000000 bytes. Optionally set expires_after[anchor]=created_at with expires_after[seconds] (3600–7776000). Without expiry, the file persists until deleted.
1096
1096
  */
1097
1097
  export const fileCreateFile = (options) => (options.client ?? client).post({
1098
1098
  ...formDataBodySerializer,
@@ -1169,7 +1169,7 @@ export const fileRetrieveFileContent = (options) => (options.client ?? client).g
1169
1169
  /**
1170
1170
  * Create an upload
1171
1171
  *
1172
- * Start a multipart upload for a file larger than the 100000000-byte direct-upload limit. Supply the exact byte length, filename, MIME type and purpose. Unlike OpenAI, uploads accept at most 2 GiB (2147483648 bytes) and only user_data and vision purposes. Add parts of at most 64000000 bytes and complete within one hour. Optional part_size enables fixed-size, retryable parts. expires_after applies to the resulting file (3600–7776000 seconds on this own face); without it the file persists until deleted.
1172
+ * Start a multipart upload for a file larger than the 100000000-byte direct-upload limit. Supply the exact byte length, filename, MIME type and purpose. Unlike OpenAI, uploads accept at most 2 GiB (2147483648 bytes) and only user_data, assistants and vision purposes. Add parts of at most 64000000 bytes and complete within one hour. Optional part_size enables fixed-size, retryable parts. expires_after applies to the resulting file (3600–7776000 seconds on this own face); without it the file persists until deleted.
1173
1173
  */
1174
1174
  export const fileCreateUpload = (options) => (options.client ?? client).post({
1175
1175
  security: [{
@@ -1235,6 +1235,72 @@ 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
+ * Create a download URL
1262
+ *
1263
+ * Download a file's bytes to a local disk from a coding agent without sending them through the model. Use file_id from file creation or listing, then run curl -fsSL -o <filename> '<url>' locally with the returned URL; GET needs no Authorization header. The link is reusable until expiry and supports a single byte Range (for example Range: bytes=0-9 returns 206). Revoke it with files.contentLinks.revoke, passing the token after /c/ in the URL. Expired, revoked, invalid or cross-organization URLs return 404. Lifetime defaults to 900 seconds and is at most 604800 seconds. Issuance requires the same credential and file-read access as files.retrieveContent; a processing file returns 409 FILE_NOT_READY, so poll files.retrieve until active before retrying. A missing, expired or other-organization file returns 404. Each issuance creates a new link. OpenAI Files has no signed download URL; this follows S3 presigned GET semantics. Example body: {"ttl_seconds":3600}.
1264
+ */
1265
+ export const fileCreateContentUrl = (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_url',
1276
+ ...options,
1277
+ headers: {
1278
+ 'Content-Type': 'application/json',
1279
+ ...options.headers
1280
+ }
1281
+ });
1282
+ /**
1283
+ * Revoke a file content link
1284
+ *
1285
+ * Stop a previously issued content link from reading a file. Obtain the link with files.contentUrl.create. 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 15 minutes; 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/>"}.
1286
+ */
1287
+ export const fileRevokeContentLink = (options) => (options.client ?? client).post({
1288
+ security: [{
1289
+ key: 'BearerAuth',
1290
+ scheme: 'bearer',
1291
+ type: 'http'
1292
+ }, {
1293
+ key: 'ApiKeyAuth',
1294
+ name: 'X-API-Key',
1295
+ type: 'apiKey'
1296
+ }],
1297
+ url: '/file/v1/files/{file_id}/content_links:revoke',
1298
+ ...options,
1299
+ headers: {
1300
+ 'Content-Type': 'application/json',
1301
+ ...options.headers
1302
+ }
1303
+ });
1238
1304
  /**
1239
1305
  * Health Check
1240
1306
  *
@@ -1389,6 +1455,28 @@ export const remixVideo = (options) => (options.client ?? client).post({
1389
1455
  url: '/model/v1/videos/{video_id}/remix',
1390
1456
  ...options
1391
1457
  });
1458
+ /**
1459
+ * Ask structured decision questions
1460
+ *
1461
+ * 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.
1462
+ */
1463
+ export const createSystemone = (options) => (options.client ?? client).post({
1464
+ security: [{
1465
+ key: 'BearerAuth',
1466
+ scheme: 'bearer',
1467
+ type: 'http'
1468
+ }, {
1469
+ key: 'ApiKeyAuth',
1470
+ name: 'X-API-Key',
1471
+ type: 'apiKey'
1472
+ }],
1473
+ url: '/model/v1/systemone',
1474
+ ...options,
1475
+ headers: {
1476
+ 'Content-Type': 'application/json',
1477
+ ...options.headers
1478
+ }
1479
+ });
1392
1480
  /**
1393
1481
  * Transcribe audio
1394
1482
  *
@@ -1900,6 +1988,24 @@ export const countResponseInputTokens = (options) => (options.client ?? client).
1900
1988
  ...options.headers
1901
1989
  }
1902
1990
  });
1991
+ /**
1992
+ * List organization members
1993
+ *
1994
+ * Concepts follow GitHub org members: find a person's user id, for example to assign an approver to an approval task. Lists only members of the organization behind your API key or runtime token, ordered by joined_at ascending (membership id breaks ties). Ask the user who should approve, then use that member's id. Emails are visible only within this organization. The request cannot select another organization. Pass next_page unchanged as page; null means the end. Read-only; no usage charge. Example: GET /organization/v1/members?limit=20.
1995
+ */
1996
+ export const listOrganizationMembers = (options) => (options?.client ?? client).get({
1997
+ security: [{
1998
+ key: 'BearerAuth',
1999
+ scheme: 'bearer',
2000
+ type: 'http'
2001
+ }, {
2002
+ key: 'ApiKeyAuth',
2003
+ name: 'X-API-Key',
2004
+ type: 'apiKey'
2005
+ }],
2006
+ url: '/organization/v1/members',
2007
+ ...options
2008
+ });
1903
2009
  /**
1904
2010
  * List your organization's feedback
1905
2011
  *
@@ -2384,7 +2490,7 @@ export const makeSandboxDirectory = (options) => (options.client ?? client).post
2384
2490
  /**
2385
2491
  * Run a command in the sandbox
2386
2492
  *
2387
- * Execute a shell command and wait for stdout, stderr and exitCode. Supply cmd, optional cwd and envs, and timeoutMs (1–60000 milliseconds, default 60000). Unlike E2B, this endpoint is synchronous only: no background mode, callbacks or unlimited timeout; output is bounded to 1 MiB including stream framing. Nonzero exit codes return 200 with the result. A timeout returns COMMAND_TIMEOUT (504); transport timeout does not confirm process termination, so do not blindly retry commands with side effects. Example body: {"cmd":"echo hi"}.
2493
+ * Execute a shell command and wait for stdout, stderr and exitCode. Supply cmd, optional cwd and envs, and timeoutMs (1–3600000 milliseconds, default 600000, that is 10 minutes; E2B defaults to 60000). Unlike E2B, this endpoint is synchronous only: no background mode, callbacks or unlimited timeout (timeoutMs 0); output is bounded to 1 MiB including stream framing. Nonzero exit codes return 200 with the result. A timeout returns COMMAND_TIMEOUT (504); transport timeout does not confirm process termination, so do not blindly retry commands with side effects. Example body: {"cmd":"echo hi"}.
2388
2494
  */
2389
2495
  export const runSandboxCommand = (options) => (options.client ?? client).post({
2390
2496
  security: [{
@@ -2482,7 +2588,7 @@ export const agentsList = (options) => (options?.client ?? client).get({
2482
2588
  /**
2483
2589
  * Create agent
2484
2590
  *
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"}]}. For kind assume, provide name and computer_id without model, models, subagent_model, subagents or multiagent; vault_ids are accepted, bindings and environment_id are refused. Drive assume agents over MCP at /agent/v1/agents/{id}/mcp.
2591
+ * 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
2592
  */
2487
2593
  export const agentsCreate = (options) => (options.client ?? client).post({
2488
2594
  security: [{
@@ -3769,7 +3875,7 @@ export const automationActionsGet = (options) => (options.client ?? client).get(
3769
3875
  /**
3770
3876
  * Update an action
3771
3877
  *
3772
- * Update after checking compatibility against the current and five recent revisions. Widening inputs and narrowing outputs are compatible, including length, item count, property count, type (integer/number), and multipleOf (the new input factor divides the old one; the reverse holds for outputs). dry_run=true returns only CompatResult and may omit If-Match; a supplied header is still checked, and * matches any existing representation. Normal updates require If-Match and return ActionDef with ETag; previews return no ETag. Omitted optional fields retain their existing values only for description and labels; when constructing a new revision, errors defaults to [], omitted annotations keys to false, timeout_ms to 30000, and message to null. Incompatible normal updates return 422 SCHEMA_INCOMPATIBLE with issues; unchanged contents retain the existing revision.
3878
+ * Update after checking compatibility against the current and five recent revisions. Widening inputs and narrowing outputs are compatible, including length, item count, property count, type (integer/number), and multipleOf (the new input factor divides the old one; the reverse holds for outputs). dry_run=true returns only CompatResult and may omit If-Match; a supplied header is still checked, and * matches any existing representation. Normal updates require If-Match and return ActionDef with ETag; previews return no ETag. Omitted optional fields retain their existing values only for description and labels; when constructing a new revision, errors defaults to [], omitted annotations keys to false, timeout_ms to 300000, and message to null. Incompatible normal updates return 422 SCHEMA_INCOMPATIBLE with issues; unchanged contents retain the existing revision.
3773
3879
  */
3774
3880
  export const automationActionsUpdate = (options) => (options.client ?? client).put({
3775
3881
  security: [{
@@ -4212,7 +4318,7 @@ export const automationWorkflowsList = (options) => (options?.client ?? client).
4212
4318
  /**
4213
4319
  * Create a workflow
4214
4320
  *
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. 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.
4321
+ * 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 5 min (run-sandbox 6 h), 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
4322
  */
4217
4323
  export const automationWorkflowsCreate = (options) => (options.client ?? client).post({
4218
4324
  security: [{
@@ -4544,7 +4650,7 @@ export const automationRunsList = (options) => (options?.client ?? client).get({
4544
4650
  /**
4545
4651
  * Run a published target or execute draft source
4546
4652
  *
4547
- * Execute a published script or workflow with target, or test unpublished code directly with source and language (ts for TypeScript, yaml for workflow YAML), without first saving or publishing a definition. Minimal script: `export default async ({ file_id }: { file_id: string }) => { const result = await call("ocr", { document: { type: "file", file_id } }); return result; }`; send it as source with language="ts", input={"file_id":"<uploaded file ID>"} and wait=0, using a PDF or image already uploaded to your account. To call a platform API directly in the same script, use the praxis SDK object, for example `praxis.model.ocr.create({ body: { model: "glm-ocr", document: { type: "file", file_id } } })`; Action IDs are strings passed to call(), not SDK methods such as praxis.ocr(...). praxis, call, invoke, console and codemode are module-scope bindings, not on globalThis, and need no import; invoke("namespace/name", input) starts a child run. target and source are mutually exclusive; target accepts ns/name@version, @tag or @range and defaults to latest when @ is omitted. Source/input validation precedes run creation, so a separate validate call is optional. input defaults to {} and must match the input schema and fit within 1 MiB. wait is 0–60 seconds (default 0): a terminal run returns 200, otherwise 202. Use the returned id with praxis.automation.runs.retrieve and inspect status, output and error; acceptance does not mean successful completion. For long-running, background or batch work, use wait: 0 and poll the run, or split work into child runs or a workflow; wait only controls the response wait and does not extend execution limits. Actions time out after 30 s (run-sandbox after 10 min); scripts have a 5 min wall-clock limit and a 30 s CPU limit; workflows default to 24 h and allow up to 30 days. Each run can start at most 100 child runs, with at most 20 active at once; nesting depth is limited to 10. Idempotency-Key is scoped to tenant, method and path for 24 hours, excluding wait from the fingerprint; replay returns the current run with Idempotent-Replayed: true, changed contents return 422 and an in-flight request returns 409. With language=yaml, source is a workflow YAML: the run input is . in the first step, and the shape is described in create workflow. Error details are in errors[] (pointer, detail, hint). New non-deterministic run IDs contain 78 characters, compared with 46 for legacy random IDs; treat IDs as opaque strings. Historical and deterministic IDs remain valid; same-millisecond order is not guaranteed.
4653
+ * Execute a published script or workflow with target, or test unpublished code directly with source and language (ts for TypeScript, yaml for workflow YAML), without first saving or publishing a definition. Minimal script: `export default async ({ file_id }: { file_id: string }) => { const result = await call("ocr", { document: { type: "file", file_id } }); return result; }`; send it as source with language="ts", input={"file_id":"<uploaded file ID>"} and wait=0, using a PDF or image already uploaded to your account. To call a platform API directly in the same script, use the praxis SDK object, for example `praxis.model.ocr.create({ body: { model: "glm-ocr", document: { type: "file", file_id } } })`; Action IDs are strings passed to call(), not SDK methods such as praxis.ocr(...). praxis, call, invoke, console and codemode are module-scope bindings, not on globalThis, and need no import; invoke("namespace/name", input) starts a child run. target and source are mutually exclusive; target accepts ns/name@version, @tag or @range and defaults to latest when @ is omitted. Source/input validation precedes run creation, so a separate validate call is optional. input defaults to {} and must match the input schema and fit within 1 MiB. wait is 0–60 seconds (default 0): a terminal run returns 200, otherwise 202. Use the returned id with praxis.automation.runs.retrieve and inspect status, output and error; acceptance does not mean successful completion. For long-running, background or batch work, use wait: 0 and poll the run, or split work into child runs or a workflow; wait only controls the response wait and does not extend execution limits. Actions time out after 5 min (run-sandbox after 6 h); scripts have a 30 min wall-clock limit and a 30 s CPU limit; workflows default to 24 h and allow up to 30 days. Each run can start at most 1,000 child runs, with at most 100 active at once; nesting depth is limited to 10. Idempotency-Key is scoped to tenant, method and path for 24 hours, excluding wait from the fingerprint; replay returns the current run with Idempotent-Replayed: true, changed contents return 422 and an in-flight request returns 409. With language=yaml, source is a workflow YAML: the run input is . in the first step, and the shape is described in create workflow. Error details are in errors[] (pointer, detail, hint). New non-deterministic run IDs contain 78 characters, compared with 46 for legacy random IDs; treat IDs as opaque strings. Historical and deterministic IDs remain valid; same-millisecond order is not guaranteed.
4548
4654
  */
4549
4655
  export const automationRunsCreate = (options) => (options.client ?? client).post({
4550
4656
  security: [{
@@ -5150,6 +5256,122 @@ export const automationHumanTasksDelegate = (options) => (options.client ?? clie
5150
5256
  ...options.headers
5151
5257
  }
5152
5258
  });
5259
+ /**
5260
+ * List script vault bindings
5261
+ *
5262
+ * 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.
5263
+ */
5264
+ export const automationScriptsVaultsList = (options) => (options.client ?? client).get({
5265
+ security: [{
5266
+ key: 'BearerAuth',
5267
+ scheme: 'bearer',
5268
+ type: 'http'
5269
+ }, {
5270
+ key: 'ApiKeyAuth',
5271
+ name: 'X-API-Key',
5272
+ type: 'apiKey'
5273
+ }],
5274
+ url: '/automation/v1/scripts/{ns}/{name}/vaults',
5275
+ ...options
5276
+ });
5277
+ /**
5278
+ * Delete a script vault binding
5279
+ *
5280
+ * 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.
5281
+ */
5282
+ export const automationScriptsVaultsDelete = (options) => (options.client ?? client).delete({
5283
+ security: [{
5284
+ key: 'BearerAuth',
5285
+ scheme: 'bearer',
5286
+ type: 'http'
5287
+ }, {
5288
+ key: 'ApiKeyAuth',
5289
+ name: 'X-API-Key',
5290
+ type: 'apiKey'
5291
+ }],
5292
+ url: '/automation/v1/scripts/{ns}/{name}/vaults/{alias}',
5293
+ ...options
5294
+ });
5295
+ /**
5296
+ * Set a script vault binding
5297
+ *
5298
+ * 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"}.
5299
+ */
5300
+ export const automationScriptsVaultsSet = (options) => (options.client ?? client).put({
5301
+ security: [{
5302
+ key: 'BearerAuth',
5303
+ scheme: 'bearer',
5304
+ type: 'http'
5305
+ }, {
5306
+ key: 'ApiKeyAuth',
5307
+ name: 'X-API-Key',
5308
+ type: 'apiKey'
5309
+ }],
5310
+ url: '/automation/v1/scripts/{ns}/{name}/vaults/{alias}',
5311
+ ...options,
5312
+ headers: {
5313
+ 'Content-Type': 'application/json',
5314
+ ...options.headers
5315
+ }
5316
+ });
5317
+ /**
5318
+ * List workflow vault bindings
5319
+ *
5320
+ * 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.
5321
+ */
5322
+ export const automationWorkflowsVaultsList = (options) => (options.client ?? client).get({
5323
+ security: [{
5324
+ key: 'BearerAuth',
5325
+ scheme: 'bearer',
5326
+ type: 'http'
5327
+ }, {
5328
+ key: 'ApiKeyAuth',
5329
+ name: 'X-API-Key',
5330
+ type: 'apiKey'
5331
+ }],
5332
+ url: '/automation/v1/workflows/{ns}/{name}/vaults',
5333
+ ...options
5334
+ });
5335
+ /**
5336
+ * Delete a workflow vault binding
5337
+ *
5338
+ * 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.
5339
+ */
5340
+ export const automationWorkflowsVaultsDelete = (options) => (options.client ?? client).delete({
5341
+ security: [{
5342
+ key: 'BearerAuth',
5343
+ scheme: 'bearer',
5344
+ type: 'http'
5345
+ }, {
5346
+ key: 'ApiKeyAuth',
5347
+ name: 'X-API-Key',
5348
+ type: 'apiKey'
5349
+ }],
5350
+ url: '/automation/v1/workflows/{ns}/{name}/vaults/{alias}',
5351
+ ...options
5352
+ });
5353
+ /**
5354
+ * Set a workflow vault binding
5355
+ *
5356
+ * 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"}.
5357
+ */
5358
+ export const automationWorkflowsVaultsSet = (options) => (options.client ?? client).put({
5359
+ security: [{
5360
+ key: 'BearerAuth',
5361
+ scheme: 'bearer',
5362
+ type: 'http'
5363
+ }, {
5364
+ key: 'ApiKeyAuth',
5365
+ name: 'X-API-Key',
5366
+ type: 'apiKey'
5367
+ }],
5368
+ url: '/automation/v1/workflows/{ns}/{name}/vaults/{alias}',
5369
+ ...options,
5370
+ headers: {
5371
+ 'Content-Type': 'application/json',
5372
+ ...options.headers
5373
+ }
5374
+ });
5153
5375
  /**
5154
5376
  * List canvases
5155
5377
  *
@@ -5210,6 +5432,28 @@ export const canvasRetrieveCanvas = (options) => (options.client ?? client).get(
5210
5432
  url: '/canvas/v1/canvases/{canvas_id}',
5211
5433
  ...options
5212
5434
  });
5435
+ /**
5436
+ * Update canvas
5437
+ *
5438
+ * Rename a canvas or move it to a collection without editing its design content. Use a canvas id from canvases.list and a collection id from collections.list. Send collection_id=null to make it uncategorized; omit either field to preserve its current value. A canvas belongs to at most one collection. The destination must belong to your organization. Renaming keeps the canvas version unchanged.
5439
+ */
5440
+ export const canvasUpdateCanvas = (options) => (options.client ?? client).patch({
5441
+ security: [{
5442
+ key: 'BearerAuth',
5443
+ scheme: 'bearer',
5444
+ type: 'http'
5445
+ }, {
5446
+ key: 'ApiKeyAuth',
5447
+ name: 'X-API-Key',
5448
+ type: 'apiKey'
5449
+ }],
5450
+ url: '/canvas/v1/canvases/{canvas_id}',
5451
+ ...options,
5452
+ headers: {
5453
+ 'Content-Type': 'application/json',
5454
+ ...options.headers
5455
+ }
5456
+ });
5213
5457
  /**
5214
5458
  * Read canvas nodes
5215
5459
  *
@@ -5249,10 +5493,21 @@ export const canvasListImages = (options) => (options.client ?? client).get({
5249
5493
  * 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)
5250
5494
  * ```
5251
5495
  *
5496
+ * Insert/Copy return the new node id; read the copy with Get(id) — copied descendants get new ids, so change them through Copy's third argument `descendants` keyed by the source node ids. To copy a page and change its title in the same script:
5497
+ *
5498
+ * ```js canvas-example="copy-page"
5499
+ * const page = Insert(document, {type:"frame",name:"Original",width:320,height:160,layout:"vertical",padding:16});
5500
+ * const title = Insert(page, {type:"text",name:"Title",content:"Original",fontSize:24});
5501
+ * const copy = Copy(page, document, {name:"Copy",x:360,descendants:{[title]:{content:"Updated"}}});
5502
+ * Print(copy); Print(Get(copy).children[0].content);
5503
+ * ```
5504
+ *
5252
5505
  * 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.
5253
5506
  *
5254
5507
  * 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.
5255
5508
  *
5509
+ * Execution errors include error.details.prints containing output printed before failure, with the same string-array shape and output limit as successful prints; rolled-back writes still create no version.
5510
+ *
5256
5511
  */
5257
5512
  export const canvasExecute = (options) => (options.client ?? client).post({
5258
5513
  security: [{
@@ -5268,31 +5523,39 @@ export const canvasExecute = (options) => (options.client ?? client).post({
5268
5523
  }
5269
5524
  });
5270
5525
  /**
5271
- * List databases
5526
+ * List collections
5272
5527
  *
5273
- * 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.
5528
+ * Find collections and ids for filtering or moving canvases. All organization collections are returned in name order in one response; next_cursor is always null. canvas_count excludes deleted canvases. total_count counts all live canvases, rather than collections, and uncategorized_count counts live canvases without a collection. Use canvases.list with collection_id to read a collection or none to read uncategorized canvases.
5274
5529
  */
5275
- export const databaseListDatabases = (options) => (options?.client ?? client).get({
5530
+ export const canvasListCollections = (options) => (options?.client ?? client).get({
5276
5531
  security: [{
5277
- key: 'database-bearerAuth',
5532
+ key: 'BearerAuth',
5278
5533
  scheme: 'bearer',
5279
5534
  type: 'http'
5535
+ }, {
5536
+ key: 'ApiKeyAuth',
5537
+ name: 'X-API-Key',
5538
+ type: 'apiKey'
5280
5539
  }],
5281
- url: '/database/v1/databases',
5540
+ url: '/canvas/v1/collections',
5282
5541
  ...options
5283
5542
  });
5284
5543
  /**
5285
- * Create database
5544
+ * Create collection
5286
5545
  *
5287
- * 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.
5546
+ * Organize canvases by creating a one-level collection in your organization. Send a name of 1–100 characters after trimming; duplicate names are allowed. Each call creates a new collection, initially containing no canvases. Use canvases.update with its id as collection_id to move existing canvases into it. Collections cannot be nested and an organization can have at most 200.
5288
5547
  */
5289
- export const databaseCreateDatabase = (options) => (options.client ?? client).post({
5548
+ export const canvasCreateCollection = (options) => (options.client ?? client).post({
5290
5549
  security: [{
5291
- key: 'database-bearerAuth',
5550
+ key: 'BearerAuth',
5292
5551
  scheme: 'bearer',
5293
5552
  type: 'http'
5553
+ }, {
5554
+ key: 'ApiKeyAuth',
5555
+ name: 'X-API-Key',
5556
+ type: 'apiKey'
5294
5557
  }],
5295
- url: '/database/v1/databases',
5558
+ url: '/canvas/v1/collections',
5296
5559
  ...options,
5297
5560
  headers: {
5298
5561
  'Content-Type': 'application/json',
@@ -5300,45 +5563,57 @@ export const databaseCreateDatabase = (options) => (options.client ?? client).po
5300
5563
  }
5301
5564
  });
5302
5565
  /**
5303
- * Delete database
5566
+ * Delete collection
5304
5567
  *
5305
- * 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.
5568
+ * Remove a collection using an id from collections.list. All its canvases are preserved and become uncategorized, with collection_id set to null; read them using canvases.list with collection_id=none. The removed collection cannot be retrieved again, and repeating deletion returns COLLECTION_NOT_FOUND.
5306
5569
  */
5307
- export const databaseDeleteDatabase = (options) => (options.client ?? client).delete({
5570
+ export const canvasDeleteCollection = (options) => (options.client ?? client).delete({
5308
5571
  security: [{
5309
- key: 'database-bearerAuth',
5572
+ key: 'BearerAuth',
5310
5573
  scheme: 'bearer',
5311
5574
  type: 'http'
5575
+ }, {
5576
+ key: 'ApiKeyAuth',
5577
+ name: 'X-API-Key',
5578
+ type: 'apiKey'
5312
5579
  }],
5313
- url: '/database/v1/databases/{database_id}',
5580
+ url: '/canvas/v1/collections/{collection_id}',
5314
5581
  ...options
5315
5582
  });
5316
5583
  /**
5317
- * Get database
5584
+ * Retrieve collection
5318
5585
  *
5319
- * 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.
5586
+ * Inspect one collection and its current live canvas count using an id from collections.list or collections.create. The collection must belong to the API key organization. To read its canvases, pass the same id as collection_id to canvases.list; this response contains collection metadata only.
5320
5587
  */
5321
- export const databaseGetDatabase = (options) => (options.client ?? client).get({
5588
+ export const canvasRetrieveCollection = (options) => (options.client ?? client).get({
5322
5589
  security: [{
5323
- key: 'database-bearerAuth',
5590
+ key: 'BearerAuth',
5324
5591
  scheme: 'bearer',
5325
5592
  type: 'http'
5593
+ }, {
5594
+ key: 'ApiKeyAuth',
5595
+ name: 'X-API-Key',
5596
+ type: 'apiKey'
5326
5597
  }],
5327
- url: '/database/v1/databases/{database_id}',
5598
+ url: '/canvas/v1/collections/{collection_id}',
5328
5599
  ...options
5329
5600
  });
5330
5601
  /**
5331
- * Update database
5602
+ * Rename collection
5332
5603
  *
5333
- * 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.
5604
+ * Change the display name of a collection from collections.list without changing its id or canvas assignments. Names contain 1–100 characters after trimming and may match another collection name. This operation does not move canvases; use canvases.update with collection_id for that.
5334
5605
  */
5335
- export const databaseUpdateDatabase = (options) => (options.client ?? client).patch({
5606
+ export const canvasUpdateCollection = (options) => (options.client ?? client).patch({
5336
5607
  security: [{
5337
- key: 'database-bearerAuth',
5608
+ key: 'BearerAuth',
5338
5609
  scheme: 'bearer',
5339
5610
  type: 'http'
5611
+ }, {
5612
+ key: 'ApiKeyAuth',
5613
+ name: 'X-API-Key',
5614
+ type: 'apiKey'
5340
5615
  }],
5341
- url: '/database/v1/databases/{database_id}',
5616
+ url: '/canvas/v1/collections/{collection_id}',
5342
5617
  ...options,
5343
5618
  headers: {
5344
5619
  'Content-Type': 'application/json',
@@ -5346,59 +5621,76 @@ export const databaseUpdateDatabase = (options) => (options.client ?? client).pa
5346
5621
  }
5347
5622
  });
5348
5623
  /**
5349
- * Restore database
5624
+ * List canvas versions
5350
5625
  *
5351
- * 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.
5626
+ * Inspect retained edits before restoring a canvas or reading historical nodes and images. Supply a canvas_id from canvases.list or create. Results include successful execute, import and restore commits since history was enabled, newest first. limit is 1–100 and defaults to 30; pass next_cursor as cursor until it is null. All versions from the last 30 days are retained unless the 256 MiB history budget requires pruning; the newest 100 versions are always retained regardless of age or size. earliest_restorable_version is the oldest readable and restorable version, including the state immediately before the first retained commit; null means no history has been recorded. Listing does not change the canvas.
5352
5627
  */
5353
- export const databaseRestoreDatabase = (options) => (options.client ?? client).post({
5628
+ export const canvasListVersions = (options) => (options.client ?? client).get({
5354
5629
  security: [{
5355
- key: 'database-bearerAuth',
5630
+ key: 'BearerAuth',
5356
5631
  scheme: 'bearer',
5357
5632
  type: 'http'
5633
+ }, {
5634
+ key: 'ApiKeyAuth',
5635
+ name: 'X-API-Key',
5636
+ type: 'apiKey'
5358
5637
  }],
5359
- url: '/database/v1/databases/{database_id}/restore',
5638
+ url: '/canvas/v1/canvases/{canvas_id}/versions',
5360
5639
  ...options
5361
5640
  });
5362
5641
  /**
5363
- * Permanently purge database
5642
+ * Restore canvas version
5364
5643
  *
5365
- * Immediately and irreversibly purges a deleting database. Active databases return 409; absent or already purged databases return 404.
5644
+ * Recover a canvas after an unwanted edit by restoring a retained version from versions.list or its earliest_restorable_version. This replaces current nodes, variables and themes with the target state and creates one new version; history remains available, so restoring can itself be undone with another restore. Restoring the current version succeeds without creating a version. Optionally guard the write with expected_version from retrieve or nodes.list; if it is stale, inspect current state and retry with the new value. Repeating an unguarded request after another edit can create another restore version. Versions from before history was enabled or outside retention cannot be recovered. Connected viewers resync after a successful restore.
5366
5645
  */
5367
- export const databasePurgeDatabase = (options) => (options.client ?? client).post({
5646
+ export const canvasRestoreCanvas = (options) => (options.client ?? client).post({
5368
5647
  security: [{
5369
- key: 'database-bearerAuth',
5648
+ key: 'BearerAuth',
5370
5649
  scheme: 'bearer',
5371
5650
  type: 'http'
5651
+ }, {
5652
+ key: 'ApiKeyAuth',
5653
+ name: 'X-API-Key',
5654
+ type: 'apiKey'
5372
5655
  }],
5373
- url: '/database/v1/databases/{database_id}/purge',
5374
- ...options
5656
+ url: '/canvas/v1/canvases/{canvas_id}:restore',
5657
+ ...options,
5658
+ headers: {
5659
+ 'Content-Type': 'application/json',
5660
+ ...options.headers
5661
+ }
5375
5662
  });
5376
5663
  /**
5377
- * List tables
5664
+ * List records
5378
5665
  *
5379
- * 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.
5666
+ * Browse records of one object type and obtain ids for retrieval or edits. Discover objectType with schemas.list; select properties by internal names from properties.list. Omit after for the first page, then copy paging.next.after until no next page is returned. archived defaults to false; use objects.search for property filters.
5380
5667
  */
5381
- export const databaseListTables = (options) => (options.client ?? client).get({
5668
+ export const crmObjectsList = (options) => (options.client ?? client).get({
5669
+ querySerializer: { parameters: {
5670
+ associations: { array: { explode: false } },
5671
+ properties: { array: { explode: false } },
5672
+ propertiesWithHistory: { array: { explode: false } }
5673
+ } },
5382
5674
  security: [{
5383
- key: 'database-bearerAuth',
5675
+ key: 'crm-bearerAuth',
5384
5676
  scheme: 'bearer',
5385
5677
  type: 'http'
5386
5678
  }],
5387
- url: '/database/v1/databases/{database_id}/tables',
5679
+ url: '/crm/v1/objects/{objectType}',
5388
5680
  ...options
5389
5681
  });
5390
5682
  /**
5391
- * Create table
5683
+ * Create record
5392
5684
  *
5393
- * 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.
5685
+ * Create a customer record with property values and optional initial associations. Discover objectType with schemas.list and allowed property names with properties.list; save the returned id for subsequent calls. Each call creates a record. Example for contacts: {"properties":{"email":"person@example.com"}}. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
5394
5686
  */
5395
- export const databaseCreateTable = (options) => (options.client ?? client).post({
5687
+ export const crmObjectsCreate = (options) => (options.client ?? client).post({
5396
5688
  security: [{
5397
- key: 'database-bearerAuth',
5689
+ key: 'crm-bearerAuth',
5398
5690
  scheme: 'bearer',
5399
5691
  type: 'http'
5400
5692
  }],
5401
- url: '/database/v1/databases/{database_id}/tables',
5693
+ url: '/crm/v1/objects/{objectType}',
5402
5694
  ...options,
5403
5695
  headers: {
5404
5696
  'Content-Type': 'application/json',
@@ -5406,45 +5698,50 @@ export const databaseCreateTable = (options) => (options.client ?? client).post(
5406
5698
  }
5407
5699
  });
5408
5700
  /**
5409
- * Delete table
5701
+ * Archive record
5410
5702
  *
5411
- * 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.
5703
+ * Archive a record selected from objects.list or objects.search when it should leave active results. This removes it from normal lists without deleting its history; archived=true can be used to read archived records. Confirm objectType and objectId before calling. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations. Unlike HubSpot, this own-face archive returns HTTP 200 with a JSON refs body instead of HTTP 204.
5412
5704
  */
5413
- export const databaseDeleteTable = (options) => (options.client ?? client).delete({
5705
+ export const crmObjectsArchive = (options) => (options.client ?? client).delete({
5414
5706
  security: [{
5415
- key: 'database-bearerAuth',
5707
+ key: 'crm-bearerAuth',
5416
5708
  scheme: 'bearer',
5417
5709
  type: 'http'
5418
5710
  }],
5419
- url: '/database/v1/databases/{database_id}/tables/{table}',
5711
+ url: '/crm/v1/objects/{objectType}/{objectId}',
5420
5712
  ...options
5421
5713
  });
5422
5714
  /**
5423
- * Get table
5715
+ * Retrieve record
5424
5716
  *
5425
- * 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.
5717
+ * Read one record by id from objects.list, objects.search or objects.create. Select property names with properties and associated object types with associations; use idProperty only when objectId is a value of that unique property. Use archived=true to inspect an archived record.
5426
5718
  */
5427
- export const databaseGetTable = (options) => (options.client ?? client).get({
5719
+ export const crmObjectsRetrieve = (options) => (options.client ?? client).get({
5720
+ querySerializer: { parameters: {
5721
+ associations: { array: { explode: false } },
5722
+ properties: { array: { explode: false } },
5723
+ propertiesWithHistory: { array: { explode: false } }
5724
+ } },
5428
5725
  security: [{
5429
- key: 'database-bearerAuth',
5726
+ key: 'crm-bearerAuth',
5430
5727
  scheme: 'bearer',
5431
5728
  type: 'http'
5432
5729
  }],
5433
- url: '/database/v1/databases/{database_id}/tables/{table}',
5730
+ url: '/crm/v1/objects/{objectType}/{objectId}',
5434
5731
  ...options
5435
5732
  });
5436
5733
  /**
5437
- * Update table
5734
+ * Update record
5438
5735
  *
5439
- * 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.
5736
+ * Change only the supplied properties of a record selected from objects.list or objects.search. Omitted properties retain their values. Use property names from properties.list and valid stage ids from pipelines.retrieve. Stage-entry requirements must be satisfied by the resulting record; inspect 400 errors before retrying. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
5440
5737
  */
5441
- export const databaseUpdateTable = (options) => (options.client ?? client).patch({
5738
+ export const crmObjectsUpdate = (options) => (options.client ?? client).patch({
5442
5739
  security: [{
5443
- key: 'database-bearerAuth',
5740
+ key: 'crm-bearerAuth',
5444
5741
  scheme: 'bearer',
5445
5742
  type: 'http'
5446
5743
  }],
5447
- url: '/database/v1/databases/{database_id}/tables/{table}',
5744
+ url: '/crm/v1/objects/{objectType}/{objectId}',
5448
5745
  ...options,
5449
5746
  headers: {
5450
5747
  'Content-Type': 'application/json',
@@ -5452,17 +5749,17 @@ export const databaseUpdateTable = (options) => (options.client ?? client).patch
5452
5749
  }
5453
5750
  });
5454
5751
  /**
5455
- * Add field
5752
+ * Search records
5456
5753
  *
5457
- * 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.
5754
+ * Find records using text query, property filters and sort order rather than scanning a list. Obtain objectType from schemas.list and filter propertyName values from properties.list. Supply filterGroups, sorts, properties, limit and after; use empty arrays for no filters, sorts or property selection, and an empty after for the first page. Copy paging.next.after with the same query to continue. This operation reads records without changing them.
5458
5755
  */
5459
- export const databaseAddField = (options) => (options.client ?? client).post({
5756
+ export const crmObjectsSearch = (options) => (options.client ?? client).post({
5460
5757
  security: [{
5461
- key: 'database-bearerAuth',
5758
+ key: 'crm-bearerAuth',
5462
5759
  scheme: 'bearer',
5463
5760
  type: 'http'
5464
5761
  }],
5465
- url: '/database/v1/databases/{database_id}/tables/{table}/fields',
5762
+ url: '/crm/v1/objects/{objectType}/search',
5466
5763
  ...options,
5467
5764
  headers: {
5468
5765
  'Content-Type': 'application/json',
@@ -5470,31 +5767,35 @@ export const databaseAddField = (options) => (options.client ?? client).post({
5470
5767
  }
5471
5768
  });
5472
5769
  /**
5473
- * Delete field
5770
+ * Batch read records
5474
5771
  *
5475
- * 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.
5772
+ * Read a set of known record ids in one call; use objects.search to discover ids first. Supply inputs with ids plus requested properties; set idProperty only when the inputs use unique-property values rather than record ids.
5476
5773
  */
5477
- export const databaseDeleteField = (options) => (options.client ?? client).delete({
5774
+ export const crmObjectsBatchRead = (options) => (options.client ?? client).post({
5478
5775
  security: [{
5479
- key: 'database-bearerAuth',
5776
+ key: 'crm-bearerAuth',
5480
5777
  scheme: 'bearer',
5481
5778
  type: 'http'
5482
5779
  }],
5483
- url: '/database/v1/databases/{database_id}/tables/{table}/fields/{field}',
5484
- ...options
5780
+ url: '/crm/v1/objects/{objectType}/batch/read',
5781
+ ...options,
5782
+ headers: {
5783
+ 'Content-Type': 'application/json',
5784
+ ...options.headers
5785
+ }
5485
5786
  });
5486
5787
  /**
5487
- * Update field
5788
+ * Batch create records
5488
5789
  *
5489
- * 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.
5790
+ * Create several records of one object type using inputs with properties and optional associations. Obtain property names from properties.list; each successful input creates a record, so inspect per-item errors before resubmitting failed inputs. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
5490
5791
  */
5491
- export const databaseUpdateField = (options) => (options.client ?? client).patch({
5792
+ export const crmObjectsBatchCreate = (options) => (options.client ?? client).post({
5492
5793
  security: [{
5493
- key: 'database-bearerAuth',
5794
+ key: 'crm-bearerAuth',
5494
5795
  scheme: 'bearer',
5495
5796
  type: 'http'
5496
5797
  }],
5497
- url: '/database/v1/databases/{database_id}/tables/{table}/fields/{field}',
5798
+ url: '/crm/v1/objects/{objectType}/batch/create',
5498
5799
  ...options,
5499
5800
  headers: {
5500
5801
  'Content-Type': 'application/json',
@@ -5502,73 +5803,131 @@ export const databaseUpdateField = (options) => (options.client ?? client).patch
5502
5803
  }
5503
5804
  });
5504
5805
  /**
5505
- * List events
5806
+ * Batch update records
5506
5807
  *
5507
- * 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.
5808
+ * Apply distinct property patches to existing records identified by inputs[].id. Obtain ids from objects.list or objects.search and property names from properties.list. Omitted properties retain their values; inspect results and errors for each input. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
5508
5809
  */
5509
- export const databaseListEvents = (options) => (options.client ?? client).get({
5810
+ export const crmObjectsBatchUpdate = (options) => (options.client ?? client).post({
5510
5811
  security: [{
5511
- key: 'database-bearerAuth',
5812
+ key: 'crm-bearerAuth',
5512
5813
  scheme: 'bearer',
5513
5814
  type: 'http'
5514
5815
  }],
5515
- url: '/database/v1/databases/{database_id}/events',
5516
- ...options
5816
+ url: '/crm/v1/objects/{objectType}/batch/update',
5817
+ ...options,
5818
+ headers: {
5819
+ 'Content-Type': 'application/json',
5820
+ ...options.headers
5821
+ }
5517
5822
  });
5518
5823
  /**
5519
- * Delete rows
5824
+ * Batch upsert records
5520
5825
  *
5521
- * 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.
5826
+ * Create records that do not yet exist or update matches using a unique property. Provide idProperty and its value in each input, plus properties; choose a property with hasUniqueValue from properties.list. Inspect each result to determine whether it was newly created. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
5522
5827
  */
5523
- export const databaseDelete = (options) => (options.client ?? client).delete({
5828
+ export const crmObjectsBatchUpsert = (options) => (options.client ?? client).post({
5524
5829
  security: [{
5525
- key: 'database-bearerAuth',
5830
+ key: 'crm-bearerAuth',
5526
5831
  scheme: 'bearer',
5527
5832
  type: 'http'
5528
5833
  }],
5529
- url: '/database/v1/databases/{database_id}/rest/{table}',
5834
+ url: '/crm/v1/objects/{objectType}/batch/upsert',
5835
+ ...options,
5836
+ headers: {
5837
+ 'Content-Type': 'application/json',
5838
+ ...options.headers
5839
+ }
5840
+ });
5841
+ /**
5842
+ * Batch archive records
5843
+ *
5844
+ * Archive known records of one object type using inputs[].id from objects.list or objects.search. Archived records leave active lists but retain their history; confirm all ids before calling. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations. Unlike HubSpot, this own-face archive returns HTTP 200 with a JSON refs body instead of HTTP 204.
5845
+ */
5846
+ export const crmObjectsBatchArchive = (options) => (options.client ?? client).post({
5847
+ security: [{
5848
+ key: 'crm-bearerAuth',
5849
+ scheme: 'bearer',
5850
+ type: 'http'
5851
+ }],
5852
+ url: '/crm/v1/objects/{objectType}/batch/archive',
5853
+ ...options,
5854
+ headers: {
5855
+ 'Content-Type': 'application/json',
5856
+ ...options.headers
5857
+ }
5858
+ });
5859
+ /**
5860
+ * List properties
5861
+ *
5862
+ * Inspect the property definitions available for an object type before writing or filtering records. Obtain objectType from schemas.list; reuse each immutable name in record properties and filters. archived defaults to false.
5863
+ */
5864
+ export const crmPropertiesList = (options) => (options.client ?? client).get({
5865
+ security: [{
5866
+ key: 'crm-bearerAuth',
5867
+ scheme: 'bearer',
5868
+ type: 'http'
5869
+ }],
5870
+ url: '/crm/v1/properties/{objectType}',
5530
5871
  ...options
5531
5872
  });
5532
5873
  /**
5533
- * Select rows
5874
+ * Create property
5534
5875
  *
5535
- * 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.
5876
+ * Define a property before setting its values on records. Choose objectType from schemas.list and groupName from properties.groups.list; provide an immutable internal name, display label, type and fieldType. Enumeration properties require their valid options. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
5536
5877
  */
5537
- export const databaseSelect = (options) => (options.client ?? client).get({
5878
+ export const crmPropertiesCreate = (options) => (options.client ?? client).post({
5538
5879
  security: [{
5539
- key: 'database-bearerAuth',
5880
+ key: 'crm-bearerAuth',
5540
5881
  scheme: 'bearer',
5541
5882
  type: 'http'
5542
5883
  }],
5543
- url: '/database/v1/databases/{database_id}/rest/{table}',
5884
+ url: '/crm/v1/properties/{objectType}',
5885
+ ...options,
5886
+ headers: {
5887
+ 'Content-Type': 'application/json',
5888
+ ...options.headers
5889
+ }
5890
+ });
5891
+ /**
5892
+ * Archive property
5893
+ *
5894
+ * Archive a property definition selected by internal name from properties.list. Confirm that record entry and search flows no longer depend on it; archived definitions are excluded from normal property lists. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations. Unlike HubSpot, this own-face archive returns HTTP 200 with a JSON refs body instead of HTTP 204.
5895
+ */
5896
+ export const crmPropertiesArchive = (options) => (options.client ?? client).delete({
5897
+ security: [{
5898
+ key: 'crm-bearerAuth',
5899
+ scheme: 'bearer',
5900
+ type: 'http'
5901
+ }],
5902
+ url: '/crm/v1/properties/{objectType}/{propertyName}',
5544
5903
  ...options
5545
5904
  });
5546
5905
  /**
5547
- * Count rows
5906
+ * Retrieve property
5548
5907
  *
5549
- * 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.
5908
+ * Inspect the type, options and modification restrictions of a property before changing its definition or record values. Obtain propertyName from properties.list; it is the immutable internal name rather than the label.
5550
5909
  */
5551
- export const databaseHead = (options) => (options.client ?? client).head({
5910
+ export const crmPropertiesRetrieve = (options) => (options.client ?? client).get({
5552
5911
  security: [{
5553
- key: 'database-bearerAuth',
5912
+ key: 'crm-bearerAuth',
5554
5913
  scheme: 'bearer',
5555
5914
  type: 'http'
5556
5915
  }],
5557
- url: '/database/v1/databases/{database_id}/rest/{table}',
5916
+ url: '/crm/v1/properties/{objectType}/{propertyName}',
5558
5917
  ...options
5559
5918
  });
5560
5919
  /**
5561
- * Update rows
5920
+ * Update property
5562
5921
  *
5563
- * 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.
5922
+ * Change editable settings of a property selected from properties.list, such as its label, group or options. Preserve the immutable internal name; inspect modificationMetadata before editing system-managed definitions. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
5564
5923
  */
5565
- export const databaseUpdate = (options) => (options.client ?? client).patch({
5924
+ export const crmPropertiesUpdate = (options) => (options.client ?? client).patch({
5566
5925
  security: [{
5567
- key: 'database-bearerAuth',
5926
+ key: 'crm-bearerAuth',
5568
5927
  scheme: 'bearer',
5569
5928
  type: 'http'
5570
5929
  }],
5571
- url: '/database/v1/databases/{database_id}/rest/{table}',
5930
+ url: '/crm/v1/properties/{objectType}/{propertyName}',
5572
5931
  ...options,
5573
5932
  headers: {
5574
5933
  'Content-Type': 'application/json',
@@ -5576,19 +5935,31 @@ export const databaseUpdate = (options) => (options.client ?? client).patch({
5576
5935
  }
5577
5936
  });
5578
5937
  /**
5579
- * Insert rows
5938
+ * List property groups
5580
5939
  *
5581
- * Insert rows into an existing table after defining its fields; at most 500 rows per request. Each request is atomic: any failure rolls back the entire batch. There are no transactions across requests.
5582
- * Rows are filled to the union of their keys with null; send Prefer: missing=default to use field defaults for missing keys.
5583
- * The default is return=minimal: success returns HTTP 201 with an empty body. Send Prefer: return=representation to return the inserted rows. With resolution=merge-duplicates, a conflicting row keeps columns omitted from the request; supplied values replace the whole field value (including JSON objects), and explicit null clears a nullable field. With resolution=ignore-duplicates, a conflicting row is left unchanged. Without a conflict, both modes insert a new row using field defaults for omitted fields. In a batch, a key present in another row is filled with null when omitted in this row unless missing=default is set; that null can overwrite a value during merge. With missing=default, omitted keys stay omitted for conflict merges (existing values are preserved); new rows use defaults, or null when no default exists. Explicit null never invokes a default. Unlike Supabase, upsert conflicts can target only id or one unique field, not a composite key. Each table supports up to 1,000,000 rows.
5940
+ * Discover property groups for an object type before creating or organizing property definitions. Obtain objectType from schemas.list and reuse a group name as groupName in properties.create or properties.update.
5584
5941
  */
5585
- export const databaseInsert = (options) => (options.client ?? client).post({
5942
+ export const crmPropertiesGroupsList = (options) => (options.client ?? client).get({
5586
5943
  security: [{
5587
- key: 'database-bearerAuth',
5944
+ key: 'crm-bearerAuth',
5588
5945
  scheme: 'bearer',
5589
5946
  type: 'http'
5590
5947
  }],
5591
- url: '/database/v1/databases/{database_id}/rest/{table}',
5948
+ url: '/crm/v1/properties/{objectType}/groups',
5949
+ ...options
5950
+ });
5951
+ /**
5952
+ * Create property group
5953
+ *
5954
+ * Create a named group for related property definitions of one object type. Obtain objectType from schemas.list; choose a unique internal name and display label, then reuse the returned name as groupName when creating properties. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
5955
+ */
5956
+ export const crmPropertiesGroupsCreate = (options) => (options.client ?? client).post({
5957
+ security: [{
5958
+ key: 'crm-bearerAuth',
5959
+ scheme: 'bearer',
5960
+ type: 'http'
5961
+ }],
5962
+ url: '/crm/v1/properties/{objectType}/groups',
5592
5963
  ...options,
5593
5964
  headers: {
5594
5965
  'Content-Type': 'application/json',
@@ -5596,31 +5967,31 @@ export const databaseInsert = (options) => (options.client ?? client).post({
5596
5967
  }
5597
5968
  });
5598
5969
  /**
5599
- * List knowledge bases
5970
+ * List pipelines
5600
5971
  *
5601
- * Lists knowledge bases visible to the caller, newest first by default. Use last_id as after to read the next page; for example, ?limit=20.
5972
+ * Discover pipelines and stage ids for records of one object type from schemas.list. Reuse pipeline and stage ids in record property updates or lead qualification. Stage rules are string values in stage.metadata: praxis_category is open (active), won (successful) or lost (unsuccessful); praxis_terminal is "true" (no further transition) or "false" (transitions allowed); praxis_allowed_next is a JSON-encoded array string of permitted next stage ids, with the string "null" meaning unrestricted; praxis_required is a JSON-encoded array string of property names ("[]" means none) that must be non-empty on entry (boolean properties must be "true"). Rule violations return HTTP 400 VALIDATION_ERROR; errors[0].context.properties lists missing required property names. Correct those values or choose an allowed stage before retrying. Example metadata: {"praxis_category":"open","praxis_terminal":"false","praxis_allowed_next":"[\"proposal\",\"lost\"]","praxis_required":"[\"budget\",\"decision_maker\"]"}.
5602
5973
  */
5603
- export const knowledgeListVectorStores = (options) => (options?.client ?? client).get({
5974
+ export const crmPipelinesList = (options) => (options.client ?? client).get({
5604
5975
  security: [{
5605
- key: 'knowledge-bearerAuth',
5976
+ key: 'crm-bearerAuth',
5606
5977
  scheme: 'bearer',
5607
5978
  type: 'http'
5608
5979
  }],
5609
- url: '/knowledge/v1/vector_stores',
5980
+ url: '/crm/v1/pipelines/{objectType}',
5610
5981
  ...options
5611
5982
  });
5612
5983
  /**
5613
- * Create knowledge base
5984
+ * Create pipeline
5614
5985
  *
5615
- * Create a knowledge base, optionally starting ingestion of uploaded file_ids in the same call; no separate attachment or batch is needed for those files. Use the returned id with vectorStores.files.retrieve to poll each attachment until completed, failed or cancelled; store status=completed alone does not mean every file succeeded. Unlike OpenAI vector stores, each file is limited to 100000000 bytes and each account to 100 active/nondeleted stores. Minimal body: {"name":"Refund policies"}.
5986
+ * Create a pipeline with its ordered stages for an object type from schemas.list. Provide a display label, displayOrder and initial stages, then use the returned ids when assigning records. Stage rules are string values in stage.metadata: praxis_category is open (active), won (successful) or lost (unsuccessful); praxis_terminal is "true" (no further transition) or "false" (transitions allowed); praxis_allowed_next is a JSON-encoded array string of permitted next stage ids, with the string "null" meaning unrestricted; praxis_required is a JSON-encoded array string of property names ("[]" means none) that must be non-empty on entry (boolean properties must be "true"). Rule violations return HTTP 400 VALIDATION_ERROR; errors[0].context.properties lists missing required property names. Correct those values or choose an allowed stage before retrying. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations. Example metadata: {"praxis_category":"open","praxis_terminal":"false","praxis_allowed_next":"[\"proposal\",\"lost\"]","praxis_required":"[\"budget\",\"decision_maker\"]"}.
5616
5987
  */
5617
- export const knowledgeCreateVectorStore = (options) => (options.client ?? client).post({
5988
+ export const crmPipelinesCreate = (options) => (options.client ?? client).post({
5618
5989
  security: [{
5619
- key: 'knowledge-bearerAuth',
5990
+ key: 'crm-bearerAuth',
5620
5991
  scheme: 'bearer',
5621
5992
  type: 'http'
5622
5993
  }],
5623
- url: '/knowledge/v1/vector_stores',
5994
+ url: '/crm/v1/pipelines/{objectType}',
5624
5995
  ...options,
5625
5996
  headers: {
5626
5997
  'Content-Type': 'application/json',
@@ -5628,45 +5999,45 @@ export const knowledgeCreateVectorStore = (options) => (options.client ?? client
5628
5999
  }
5629
6000
  });
5630
6001
  /**
5631
- * Delete knowledge base
6002
+ * Archive pipeline
5632
6003
  *
5633
- * Remove a knowledge base from active use while keeping a recovery window. Unlike OpenAI vector stores, native DELETE returns the store with status=deleting and ISO purge_at, retains it for 7 days and is idempotent on repeat. Retrieve remains 200; object operations return 409. Use restore before purge_at to recover it, or purge to remove it irreversibly.
6004
+ * Archive a pipeline selected from pipelines.list when records no longer depend on it. Check current records and stage usage first; resolve references reported by validation before retrying. Stage rules are string values in stage.metadata: praxis_category is open (active), won (successful) or lost (unsuccessful); praxis_terminal is "true" (no further transition) or "false" (transitions allowed); praxis_allowed_next is a JSON-encoded array string of permitted next stage ids, with the string "null" meaning unrestricted; praxis_required is a JSON-encoded array string of property names ("[]" means none) that must be non-empty on entry (boolean properties must be "true"). Rule violations return HTTP 400 VALIDATION_ERROR; errors[0].context.properties lists missing required property names. Correct those values or choose an allowed stage before retrying. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations. Unlike HubSpot, this own-face archive returns HTTP 200 with a JSON refs body instead of HTTP 204. Example metadata: {"praxis_category":"open","praxis_terminal":"false","praxis_allowed_next":"[\"proposal\",\"lost\"]","praxis_required":"[\"budget\",\"decision_maker\"]"}.
5634
6005
  */
5635
- export const knowledgeDeleteVectorStore = (options) => (options.client ?? client).delete({
6006
+ export const crmPipelinesArchive = (options) => (options.client ?? client).delete({
5636
6007
  security: [{
5637
- key: 'knowledge-bearerAuth',
6008
+ key: 'crm-bearerAuth',
5638
6009
  scheme: 'bearer',
5639
6010
  type: 'http'
5640
6011
  }],
5641
- url: '/knowledge/v1/vector_stores/{vector_store_id}',
6012
+ url: '/crm/v1/pipelines/{objectType}/{pipelineId}',
5642
6013
  ...options
5643
6014
  });
5644
6015
  /**
5645
- * Retrieve knowledge base
6016
+ * Retrieve pipeline
5646
6017
  *
5647
- * Retrieves a knowledge base using an id returned by create or list. Add ?expand=files to include the first page of attached files. Soft-deleted stores remain readable with status=deleting until purged.
6018
+ * Inspect the stage ids and metadata of a pipeline before moving a record or editing its workflow. Obtain pipelineId from pipelines.list and use the returned stages array to select a destination. Stage rules are string values in stage.metadata: praxis_category is open (active), won (successful) or lost (unsuccessful); praxis_terminal is "true" (no further transition) or "false" (transitions allowed); praxis_allowed_next is a JSON-encoded array string of permitted next stage ids, with the string "null" meaning unrestricted; praxis_required is a JSON-encoded array string of property names ("[]" means none) that must be non-empty on entry (boolean properties must be "true"). Rule violations return HTTP 400 VALIDATION_ERROR; errors[0].context.properties lists missing required property names. Correct those values or choose an allowed stage before retrying. Example metadata: {"praxis_category":"open","praxis_terminal":"false","praxis_allowed_next":"[\"proposal\",\"lost\"]","praxis_required":"[\"budget\",\"decision_maker\"]"}.
5648
6019
  */
5649
- export const knowledgeRetrieveVectorStore = (options) => (options.client ?? client).get({
6020
+ export const crmPipelinesRetrieve = (options) => (options.client ?? client).get({
5650
6021
  security: [{
5651
- key: 'knowledge-bearerAuth',
6022
+ key: 'crm-bearerAuth',
5652
6023
  scheme: 'bearer',
5653
6024
  type: 'http'
5654
6025
  }],
5655
- url: '/knowledge/v1/vector_stores/{vector_store_id}',
6026
+ url: '/crm/v1/pipelines/{objectType}/{pipelineId}',
5656
6027
  ...options
5657
6028
  });
5658
6029
  /**
5659
- * Update knowledge base
6030
+ * Update pipeline
5660
6031
  *
5661
- * Updates an active knowledge base using its returned id. Omitted fields stay unchanged; metadata replaces the whole map. Example body: {"name":"Refund policies"}.
6032
+ * Change editable pipeline settings selected by pipelineId from pipelines.list. Omit settings that should remain unchanged and inspect current stages with pipelines.retrieve before modifying the workflow. Stage rules are string values in stage.metadata: praxis_category is open (active), won (successful) or lost (unsuccessful); praxis_terminal is "true" (no further transition) or "false" (transitions allowed); praxis_allowed_next is a JSON-encoded array string of permitted next stage ids, with the string "null" meaning unrestricted; praxis_required is a JSON-encoded array string of property names ("[]" means none) that must be non-empty on entry (boolean properties must be "true"). Rule violations return HTTP 400 VALIDATION_ERROR; errors[0].context.properties lists missing required property names. Correct those values or choose an allowed stage before retrying. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations. Example metadata: {"praxis_category":"open","praxis_terminal":"false","praxis_allowed_next":"[\"proposal\",\"lost\"]","praxis_required":"[\"budget\",\"decision_maker\"]"}.
5662
6033
  */
5663
- export const knowledgeUpdateVectorStore = (options) => (options.client ?? client).post({
6034
+ export const crmPipelinesUpdate = (options) => (options.client ?? client).patch({
5664
6035
  security: [{
5665
- key: 'knowledge-bearerAuth',
6036
+ key: 'crm-bearerAuth',
5666
6037
  scheme: 'bearer',
5667
6038
  type: 'http'
5668
6039
  }],
5669
- url: '/knowledge/v1/vector_stores/{vector_store_id}',
6040
+ url: '/crm/v1/pipelines/{objectType}/{pipelineId}',
5670
6041
  ...options,
5671
6042
  headers: {
5672
6043
  'Content-Type': 'application/json',
@@ -5674,17 +6045,17 @@ export const knowledgeUpdateVectorStore = (options) => (options.client ?? client
5674
6045
  }
5675
6046
  });
5676
6047
  /**
5677
- * Search knowledge base
6048
+ * Create pipeline stage
5678
6049
  *
5679
- * Search ingested text to answer a question or find supporting passages. Native results contain one chunk each, so file_id can repeat; max_num_results counts chunks (1–50, default 10), while the compatible URL groups results by file. Unlike OpenAI vector stores, next_page is always null even when has_more is true. Only completed attachments are searchable. For keyword-only retrieval set ranking_options.hybrid_search to {"embedding_weight":0,"text_weight":1}; omit rewrite_query or set it to false to avoid query rewriting. Unlike OpenAI, ranker auto does not rerank; only default-2024-11-15 requests reranking. Set praxis.explain=true to inspect scores and use returned content[].chunk_id to retrieve a segment.
6050
+ * Add an ordered stage to a pipeline from pipelines.list. Provide its display label, displayOrder and metadata; save the returned stage id for record updates. Stage rules are string values in stage.metadata: praxis_category is open (active), won (successful) or lost (unsuccessful); praxis_terminal is "true" (no further transition) or "false" (transitions allowed); praxis_allowed_next is a JSON-encoded array string of permitted next stage ids, with the string "null" meaning unrestricted; praxis_required is a JSON-encoded array string of property names ("[]" means none) that must be non-empty on entry (boolean properties must be "true"). Rule violations return HTTP 400 VALIDATION_ERROR; errors[0].context.properties lists missing required property names. Correct those values or choose an allowed stage before retrying. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations. Example metadata: {"praxis_category":"open","praxis_terminal":"false","praxis_allowed_next":"[\"proposal\",\"lost\"]","praxis_required":"[\"budget\",\"decision_maker\"]"}.
5680
6051
  */
5681
- export const knowledgeSearchVectorStore = (options) => (options.client ?? client).post({
6052
+ export const crmPipelinesStagesCreate = (options) => (options.client ?? client).post({
5682
6053
  security: [{
5683
- key: 'knowledge-bearerAuth',
6054
+ key: 'crm-bearerAuth',
5684
6055
  scheme: 'bearer',
5685
6056
  type: 'http'
5686
6057
  }],
5687
- url: '/knowledge/v1/vector_stores/{vector_store_id}/search',
6058
+ url: '/crm/v1/pipelines/{objectType}/{pipelineId}/stages',
5688
6059
  ...options,
5689
6060
  headers: {
5690
6061
  'Content-Type': 'application/json',
@@ -5692,31 +6063,31 @@ export const knowledgeSearchVectorStore = (options) => (options.client ?? client
5692
6063
  }
5693
6064
  });
5694
6065
  /**
5695
- * List files
6066
+ * Archive pipeline stage
5696
6067
  *
5697
- * Lists attached files and their ingestion status, newest attachment first by default. Use last_id as after to continue; ?filter=failed selects files that can be retried.
6068
+ * Archive a stage selected from pipelines.retrieve after checking record usage. A stage that still has records cannot be archived without resolving their assignment; move those records to an allowed stage first. Stage rules are string values in stage.metadata: praxis_category is open (active), won (successful) or lost (unsuccessful); praxis_terminal is "true" (no further transition) or "false" (transitions allowed); praxis_allowed_next is a JSON-encoded array string of permitted next stage ids, with the string "null" meaning unrestricted; praxis_required is a JSON-encoded array string of property names ("[]" means none) that must be non-empty on entry (boolean properties must be "true"). Rule violations return HTTP 400 VALIDATION_ERROR; errors[0].context.properties lists missing required property names. Correct those values or choose an allowed stage before retrying. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations. Unlike HubSpot, this own-face archive returns HTTP 200 with a JSON refs body instead of HTTP 204. Example metadata: {"praxis_category":"open","praxis_terminal":"false","praxis_allowed_next":"[\"proposal\",\"lost\"]","praxis_required":"[\"budget\",\"decision_maker\"]"}.
5698
6069
  */
5699
- export const knowledgeListFiles = (options) => (options.client ?? client).get({
6070
+ export const crmPipelinesStagesArchive = (options) => (options.client ?? client).delete({
5700
6071
  security: [{
5701
- key: 'knowledge-bearerAuth',
6072
+ key: 'crm-bearerAuth',
5702
6073
  scheme: 'bearer',
5703
6074
  type: 'http'
5704
6075
  }],
5705
- url: '/knowledge/v1/vector_stores/{vector_store_id}/files',
6076
+ url: '/crm/v1/pipelines/{objectType}/{pipelineId}/stages/{stageId}',
5706
6077
  ...options
5707
6078
  });
5708
6079
  /**
5709
- * Add file
6080
+ * Update pipeline stage
5710
6081
  *
5711
- * Attach an uploaded File for asynchronous ingestion, then poll this attachment until status is completed, failed or cancelled before searching. Unlike OpenAI vector stores, the file limit is 100000000 bytes; chunk sizes use estimated tokens rather than a model tokenizer. Text, Markdown, CSV, JSON, HTML, PDF, DOCX, PPTX, XLSX and PNG/JPEG/GIF/WebP images can be extracted; audio and video uploads are not knowledge documents. Images may yield generated descriptions rather than verbatim OCR. auto chunking resolves to static 800/400; explicit sizes are 100–4096 with overlap at most half the size. Each store holds at most 10000 attached files. Reattaching the same file returns its existing record without applying new attributes or chunking; inspect last_error after failure.
6082
+ * Change the label, order or metadata of a stage selected from pipelines.retrieve. Existing records must satisfy entry rules when subsequently moved; omitted settings retain their values. Stage rules are string values in stage.metadata: praxis_category is open (active), won (successful) or lost (unsuccessful); praxis_terminal is "true" (no further transition) or "false" (transitions allowed); praxis_allowed_next is a JSON-encoded array string of permitted next stage ids, with the string "null" meaning unrestricted; praxis_required is a JSON-encoded array string of property names ("[]" means none) that must be non-empty on entry (boolean properties must be "true"). Rule violations return HTTP 400 VALIDATION_ERROR; errors[0].context.properties lists missing required property names. Correct those values or choose an allowed stage before retrying. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations. Example metadata: {"praxis_category":"open","praxis_terminal":"false","praxis_allowed_next":"[\"proposal\",\"lost\"]","praxis_required":"[\"budget\",\"decision_maker\"]"}.
5712
6083
  */
5713
- export const knowledgeAttachFile = (options) => (options.client ?? client).post({
6084
+ export const crmPipelinesStagesUpdate = (options) => (options.client ?? client).patch({
5714
6085
  security: [{
5715
- key: 'knowledge-bearerAuth',
6086
+ key: 'crm-bearerAuth',
5716
6087
  scheme: 'bearer',
5717
6088
  type: 'http'
5718
6089
  }],
5719
- url: '/knowledge/v1/vector_stores/{vector_store_id}/files',
6090
+ url: '/crm/v1/pipelines/{objectType}/{pipelineId}/stages/{stageId}',
5720
6091
  ...options,
5721
6092
  headers: {
5722
6093
  'Content-Type': 'application/json',
@@ -5724,45 +6095,45 @@ export const knowledgeAttachFile = (options) => (options.client ?? client).post(
5724
6095
  }
5725
6096
  });
5726
6097
  /**
5727
- * Remove file
6098
+ * List record associations
5728
6099
  *
5729
- * Removes the file from search immediately; does not delete the original File.
6100
+ * Read records linked to a source record, including association labels and type ids. Obtain source and destination object types from schemas.list and objectId from objects.list or objects.search. Follow paging.next.after to continue reading associated records.
5730
6101
  */
5731
- export const knowledgeRemoveFile = (options) => (options.client ?? client).delete({
6102
+ export const crmAssociationsList = (options) => (options.client ?? client).get({
5732
6103
  security: [{
5733
- key: 'knowledge-bearerAuth',
6104
+ key: 'crm-bearerAuth',
5734
6105
  scheme: 'bearer',
5735
6106
  type: 'http'
5736
6107
  }],
5737
- url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}',
6108
+ url: '/crm/v1/objects/{objectType}/{objectId}/associations/{toObjectType}',
5738
6109
  ...options
5739
6110
  });
5740
6111
  /**
5741
- * Retrieve file
6112
+ * Remove association
5742
6113
  *
5743
- * Retrieves an attached file using the id returned by attachment or file listing. Poll this operation until status leaves in_progress to observe the ingestion outcome.
6114
+ * Remove the association between two existing records without archiving either record. Obtain the linked destination id from associations.list and confirm the source and destination object types before calling. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations. Unlike HubSpot, this own-face archive returns HTTP 200 with a JSON refs body instead of HTTP 204.
5744
6115
  */
5745
- export const knowledgeRetrieveFile = (options) => (options.client ?? client).get({
6116
+ export const crmAssociationsRemove = (options) => (options.client ?? client).delete({
5746
6117
  security: [{
5747
- key: 'knowledge-bearerAuth',
6118
+ key: 'crm-bearerAuth',
5748
6119
  scheme: 'bearer',
5749
6120
  type: 'http'
5750
6121
  }],
5751
- url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}',
6122
+ url: '/crm/v1/objects/{objectType}/{objectId}/associations/{toObjectType}/{toObjectId}',
5752
6123
  ...options
5753
6124
  });
5754
6125
  /**
5755
- * Update file attributes
6126
+ * Create labelled association
5756
6127
  *
5757
- * Replaces search-filter attributes of an existing attachment without reingesting its content. Use an attached file id. Example body: {"attributes":{"category":"refund"}}; null clears the attributes.
6128
+ * Associate two existing records using the requested association category and type id. Obtain record ids from objects.list or objects.search; reuse known association type ids from associations.list. Send the association-spec array as the body; use associations.createDefault when no label is needed. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
5758
6129
  */
5759
- export const knowledgeUpdateFile = (options) => (options.client ?? client).post({
6130
+ export const crmAssociationsCreate = (options) => (options.client ?? client).put({
5760
6131
  security: [{
5761
- key: 'knowledge-bearerAuth',
6132
+ key: 'crm-bearerAuth',
5762
6133
  scheme: 'bearer',
5763
6134
  type: 'http'
5764
6135
  }],
5765
- url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}',
6136
+ url: '/crm/v1/objects/{objectType}/{objectId}/associations/{toObjectType}/{toObjectId}',
5766
6137
  ...options,
5767
6138
  headers: {
5768
6139
  'Content-Type': 'application/json',
@@ -5770,31 +6141,45 @@ export const knowledgeUpdateFile = (options) => (options.client ?? client).post(
5770
6141
  }
5771
6142
  });
5772
6143
  /**
5773
- * Read extracted content
6144
+ * Create default association
5774
6145
  *
5775
- * Extracted text chunks may overlap. Image content can be a generated description rather than verbatim OCR.
6146
+ * Link two existing records with the default unlabelled association. Obtain each record id from objects.list or objects.search for its type. No request body is required; use associations.create to choose explicit association labels. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
5776
6147
  */
5777
- export const knowledgeRetrieveFileContent = (options) => (options.client ?? client).get({
6148
+ export const crmAssociationsCreateDefault = (options) => (options.client ?? client).put({
5778
6149
  security: [{
5779
- key: 'knowledge-bearerAuth',
6150
+ key: 'crm-bearerAuth',
5780
6151
  scheme: 'bearer',
5781
6152
  type: 'http'
5782
6153
  }],
5783
- url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}/content',
6154
+ url: '/crm/v1/objects/{objectType}/{objectId}/associations/default/{toObjectType}/{toObjectId}',
5784
6155
  ...options
5785
6156
  });
5786
6157
  /**
5787
- * Create file batch
6158
+ * List object schemas
5788
6159
  *
5789
- * Attaches existing Files as a batch for asynchronous ingestion. Supply exactly one of file_ids or files; files allows per-file settings. Existing attachments are reused. Read the returned batch id to monitor status.
6160
+ * Discover available object schemas, display labels, property definitions and association definitions. Reuse the object type identifier or name in record, property and pipeline operations. archived defaults to false; the include parameters control the definition and audit details returned.
5790
6161
  */
5791
- export const knowledgeCreateFileBatch = (options) => (options.client ?? client).post({
6162
+ export const crmSchemasList = (options) => (options?.client ?? client).get({
5792
6163
  security: [{
5793
- key: 'knowledge-bearerAuth',
6164
+ key: 'crm-bearerAuth',
5794
6165
  scheme: 'bearer',
5795
6166
  type: 'http'
5796
6167
  }],
5797
- url: '/knowledge/v1/vector_stores/{vector_store_id}/file_batches',
6168
+ url: '/crm/v1/schemas',
6169
+ ...options
6170
+ });
6171
+ /**
6172
+ * Create object schema
6173
+ *
6174
+ * Define a custom CRM object type before creating its records. Provide its immutable name, singular and plural labels, primaryDisplayProperty, properties and associated object types. Save the returned object type identifier for subsequent record and property operations. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
6175
+ */
6176
+ export const crmSchemasCreate = (options) => (options.client ?? client).post({
6177
+ security: [{
6178
+ key: 'crm-bearerAuth',
6179
+ scheme: 'bearer',
6180
+ type: 'http'
6181
+ }],
6182
+ url: '/crm/v1/schemas',
5798
6183
  ...options,
5799
6184
  headers: {
5800
6185
  'Content-Type': 'application/json',
@@ -5802,157 +6187,296 @@ export const knowledgeCreateFileBatch = (options) => (options.client ?? client).
5802
6187
  }
5803
6188
  });
5804
6189
  /**
5805
- * Retrieve file batch
6190
+ * Qualify lead
5806
6191
  *
5807
- * Retrieves a batch created in this knowledge base, including current status and file counts. Use the batch id returned by batch creation to monitor ingestion.
6192
+ * Qualify a lead with explicit contact, company and optional deal choices in one operation. Unlike HubSpot, CRM exposes these decisions as a single action because qualification coordinates several related record edits rather than editing only the lead stage. Obtain leadId from objects.list for leads and qualifiedStageId from its pipeline; choose a won stage and satisfy its required properties. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
5808
6193
  */
5809
- export const knowledgeRetrieveFileBatch = (options) => (options.client ?? client).get({
6194
+ export const crmLeadsQualify = (options) => (options.client ?? client).post({
5810
6195
  security: [{
5811
- key: 'knowledge-bearerAuth',
6196
+ key: 'crm-bearerAuth',
5812
6197
  scheme: 'bearer',
5813
6198
  type: 'http'
5814
6199
  }],
5815
- url: '/knowledge/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}',
5816
- ...options
6200
+ url: '/crm/v1/leads/{leadId}:qualify',
6201
+ ...options,
6202
+ headers: {
6203
+ 'Content-Type': 'application/json',
6204
+ ...options.headers
6205
+ }
5817
6206
  });
5818
6207
  /**
5819
- * Cancel file batch
6208
+ * Revert change set
5820
6209
  *
5821
- * Cancels only in-progress batches and pending files. Completed, failed and cancelled batches return unchanged (200, idempotent).
6210
+ * Reverse property changes made by one earlier request. Unlike HubSpot, CRM exposes change-set reversal because agents need to undo a whole recorded action rather than manually reconstructing individual values. Supply the changeSetId recorded in property history. A later conflicting value prevents reversal with HTTP 409 CONFLICT; inspect current records before resolving the conflict. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
5822
6211
  */
5823
- export const knowledgeCancelFileBatch = (options) => (options.client ?? client).post({
6212
+ export const crmChangesRevert = (options) => (options.client ?? client).post({
5824
6213
  security: [{
5825
- key: 'knowledge-bearerAuth',
6214
+ key: 'crm-bearerAuth',
5826
6215
  scheme: 'bearer',
5827
6216
  type: 'http'
5828
6217
  }],
5829
- url: '/knowledge/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel',
6218
+ url: '/crm/v1/changes/{changeSetId}:revert',
5830
6219
  ...options
5831
6220
  });
5832
6221
  /**
5833
- * List batch files
6222
+ * Retrieve record layout
5834
6223
  *
5835
- * Lists files still attached from the identified batch, newest attachment first by default. Use the batch creation id and ?filter=failed to inspect failures; last_id is the next after cursor.
6224
+ * Read the shared record-page layout for an object type from schemas.list. Unlike HubSpot, CRM exposes this presentation as an API resource so people and agents can share the same record layout instead of relying on interface-only settings. The response orders summary tiles, sidebar properties and main-column sections.
5836
6225
  */
5837
- export const knowledgeListBatchFiles = (options) => (options.client ?? client).get({
6226
+ export const crmLayoutsRetrieve = (options) => (options.client ?? client).get({
5838
6227
  security: [{
5839
- key: 'knowledge-bearerAuth',
6228
+ key: 'crm-bearerAuth',
5840
6229
  scheme: 'bearer',
5841
6230
  type: 'http'
5842
6231
  }],
5843
- url: '/knowledge/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files',
6232
+ url: '/crm/v1/layouts/{objectType}',
5844
6233
  ...options
5845
6234
  });
5846
6235
  /**
5847
- * Restore knowledge base
6236
+ * Update record layout
5848
6237
  *
5849
- * Restores a deleting store within 7 days. Active stores return 409 VECTOR_STORE_INVALID_STATE; absent stores return 404. Empty body is allowed.
6238
+ * Replace the shared record-page layout for an object type from schemas.list. Unlike HubSpot, CRM exposes this presentation as an API resource so agents can configure the same record view used by people. Send the complete layout with at most three summary tiles and property names from properties.list; omitted prior sections are removed. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
5850
6239
  */
5851
- export const knowledgeRestoreVectorStore = (options) => (options.client ?? client).post({
6240
+ export const crmLayoutsUpdate = (options) => (options.client ?? client).put({
5852
6241
  security: [{
5853
- key: 'knowledge-bearerAuth',
6242
+ key: 'crm-bearerAuth',
5854
6243
  scheme: 'bearer',
5855
6244
  type: 'http'
5856
6245
  }],
5857
- url: '/knowledge/v1/vector_stores/{vector_store_id}/restore',
5858
- ...options
6246
+ url: '/crm/v1/layouts/{objectType}',
6247
+ ...options,
6248
+ headers: {
6249
+ 'Content-Type': 'application/json',
6250
+ ...options.headers
6251
+ }
5859
6252
  });
5860
6253
  /**
5861
- * Permanently purge knowledge base
6254
+ * List projects
5862
6255
  *
5863
- * Immediately and irreversibly clears a deleting store using the retention cleanup path. Active stores return 409; absent stores return 404. Empty body is allowed.
6256
+ * 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.
5864
6257
  */
5865
- export const knowledgePurgeVectorStore = (options) => (options.client ?? client).post({
6258
+ export const cutListProjects = (options) => (options?.client ?? client).get({
5866
6259
  security: [{
5867
- key: 'knowledge-bearerAuth',
6260
+ key: 'BearerAuth',
5868
6261
  scheme: 'bearer',
5869
6262
  type: 'http'
6263
+ }, {
6264
+ key: 'ApiKeyAuth',
6265
+ name: 'X-API-Key',
6266
+ type: 'apiKey'
5870
6267
  }],
5871
- url: '/knowledge/v1/vector_stores/{vector_store_id}/purge',
6268
+ url: '/cut/v1/projects',
5872
6269
  ...options
5873
6270
  });
5874
6271
  /**
5875
- * Retry failed file
6272
+ * Create project
5876
6273
  *
5877
- * Retries only failed files; other states return 409 FILE_INVALID_STATE. Retry after failure has not yet been observed in the documented run.
6274
+ * 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.
5878
6275
  */
5879
- export const knowledgeRetryFile = (options) => (options.client ?? client).post({
6276
+ export const cutCreateProject = (options) => (options.client ?? client).post({
5880
6277
  security: [{
5881
- key: 'knowledge-bearerAuth',
6278
+ key: 'BearerAuth',
5882
6279
  scheme: 'bearer',
5883
6280
  type: 'http'
6281
+ }, {
6282
+ key: 'ApiKeyAuth',
6283
+ name: 'X-API-Key',
6284
+ type: 'apiKey'
5884
6285
  }],
5885
- url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}/retry',
5886
- ...options
6286
+ url: '/cut/v1/projects',
6287
+ ...options,
6288
+ headers: {
6289
+ 'Content-Type': 'application/json',
6290
+ ...options.headers
6291
+ }
5887
6292
  });
5888
6293
  /**
5889
- * List file segments
6294
+ * Delete project
5890
6295
  *
5891
- * Lists the stored chunks of an attached file, ordered by increasing segment index by default. Use the attachment id and last_id as after to continue; returned chunk ids can be retrieved individually.
6296
+ * 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.
5892
6297
  */
5893
- export const knowledgeListSegments = (options) => (options.client ?? client).get({
6298
+ export const cutDeleteProject = (options) => (options.client ?? client).delete({
5894
6299
  security: [{
5895
- key: 'knowledge-bearerAuth',
6300
+ key: 'BearerAuth',
5896
6301
  scheme: 'bearer',
5897
6302
  type: 'http'
6303
+ }, {
6304
+ key: 'ApiKeyAuth',
6305
+ name: 'X-API-Key',
6306
+ type: 'apiKey'
5898
6307
  }],
5899
- url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}/segments',
6308
+ url: '/cut/v1/projects/{project_id}',
5900
6309
  ...options
5901
6310
  });
5902
6311
  /**
5903
- * Retrieve segment
6312
+ * Retrieve project
5904
6313
  *
5905
- * Retrieves one chunk and its term statistics. Take chunk_id from segment listing or native search content; the chunk must belong to this knowledge base.
6314
+ * 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.
5906
6315
  */
5907
- export const knowledgeRetrieveSegment = (options) => (options.client ?? client).get({
6316
+ export const cutRetrieveProject = (options) => (options.client ?? client).get({
5908
6317
  security: [{
5909
- key: 'knowledge-bearerAuth',
6318
+ key: 'BearerAuth',
5910
6319
  scheme: 'bearer',
5911
6320
  type: 'http'
6321
+ }, {
6322
+ key: 'ApiKeyAuth',
6323
+ name: 'X-API-Key',
6324
+ type: 'apiKey'
5912
6325
  }],
5913
- url: '/knowledge/v1/vector_stores/{vector_store_id}/segments/{chunk_id}',
6326
+ url: '/cut/v1/projects/{project_id}',
5914
6327
  ...options
5915
6328
  });
5916
6329
  /**
5917
- * List events
6330
+ * Update project metadata
5918
6331
  *
5919
- * Reads events for this knowledge base in increasing sequence order, including while soft-deleted. Pass next_seq as after_seq to continue; null next_seq marks the current end. Example: ?after_seq=0&limit=20.
6332
+ * 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.
5920
6333
  */
5921
- export const knowledgeListEvents = (options) => (options.client ?? client).get({
6334
+ export const cutUpdateProject = (options) => (options.client ?? client).patch({
5922
6335
  security: [{
5923
- key: 'knowledge-bearerAuth',
6336
+ key: 'BearerAuth',
5924
6337
  scheme: 'bearer',
5925
6338
  type: 'http'
6339
+ }, {
6340
+ key: 'ApiKeyAuth',
6341
+ name: 'X-API-Key',
6342
+ type: 'apiKey'
5926
6343
  }],
5927
- url: '/knowledge/v1/vector_stores/{vector_store_id}/events',
5928
- ...options
6344
+ url: '/cut/v1/projects/{project_id}',
6345
+ ...options,
6346
+ headers: {
6347
+ 'Content-Type': 'application/json',
6348
+ ...options.headers
6349
+ }
5929
6350
  });
5930
6351
  /**
5931
- * List libraries
6352
+ * Restore deleted project
5932
6353
  *
5933
- * List libraries owned by the caller, newest first. By default, deleting and deleted libraries are excluded; use status=deleting to find libraries awaiting purge. All supplied label pairs must match.
6354
+ * 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.
5934
6355
  */
5935
- export const mediaListLibraries = (options) => (options?.client ?? client).get({
6356
+ export const cutUndeleteProject = (options) => (options.client ?? client).post({
5936
6357
  security: [{
5937
- key: 'media-BearerAuth',
6358
+ key: 'BearerAuth',
5938
6359
  scheme: 'bearer',
5939
6360
  type: 'http'
6361
+ }, {
6362
+ key: 'ApiKeyAuth',
6363
+ name: 'X-API-Key',
6364
+ type: 'apiKey'
5940
6365
  }],
5941
- url: '/media/v1/libraries',
6366
+ url: '/cut/v1/projects/{project_id}:undelete',
5942
6367
  ...options
5943
6368
  });
5944
6369
  /**
5945
- * Create library
6370
+ * Execute editing script
6371
+ *
6372
+ * 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. 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: `const t = AddTrack("video"); Insert(t, {type: "color", color: "#123456", start: 0, length: 3}); Print(t);`
6373
+ *
6374
+ * ### Script function reference
6375
+ *
6376
+ * Functions are synchronous globals; do not import them. `project` is the current project ID. TrackId and ClipId are strings returned by AddTrack and Insert or read from GetTimeline. JoinId is the string returned by Join or read from GetTimeline().joins. Reads see earlier writes in the same script.
6377
+ *
6378
+ * ```ts
6379
+ * GetTimeline(o?: { from?: number; to?: number; tracks?: TrackId[] }): TimelineView;
6380
+ * GetItem(id: ClipId): ItemView;
6381
+ * FindItems<T>(visit: (item: ItemView, ctx: { track: TrackView; index: number }) => T | undefined): T[];
6382
+ * GetMedia(ref: MediaRef): MediaInfo;
6383
+ * GetTranscript(ref: MediaRef, o?: { from?: number; to?: number }): Word[];
6384
+ * GetAnalysis(ref: MediaRef, kind: AnalysisKind): Segment[];
6385
+ * ListTransitions(): TransitionInfo[];
6386
+ * Insert(track: TrackId, item: ItemInit, o?: { ripple?: boolean }): ClipId;
6387
+ * Update(id: ClipId, patch: ItemPatchView): void;
6388
+ * Delete(id: ClipId, o?: { ripple?: boolean }): void;
6389
+ * Join(left: ClipId, right: ClipId, o: { length?: number; effect: TransitionInput }): JoinId;
6390
+ * UpdateJoin(id: JoinId, patch: { length?: number; effect?: TransitionInput }): void;
6391
+ * DeleteJoin(id: JoinId): void;
6392
+ * Split(id: ClipId, at: number): ClipId;
6393
+ * Trim(id: ClipId, edge: "in" | "out", delta: number, o?: { ripple?: boolean }): void;
6394
+ * Move(id: ClipId, start: number, track?: TrackId): void;
6395
+ * RippleDeleteRange(from: number, to: number, tracks?: TrackId[]): void;
6396
+ * AddTrack(kind: "video" | "audio" | "caption", init?: { name?: string }, index?: number): TrackId;
6397
+ * UpdateTrack(id: TrackId, patch: TrackPatch): void;
6398
+ * DeleteTrack(id: TrackId): void;
6399
+ * SetSettings(patch: Partial<ProjectSettingsView>): void;
6400
+ * AddCaptionsFromTranscript(track: TrackId, source: ClipId, o?: { style?: Partial<CaptionStyle>; maxChars?: number }): ClipId[];
6401
+ * SetMarker(at: number, label: string): string;
6402
+ * Print(...values: unknown[]): void;
6403
+ * Preview(at: number[]): void;
6404
+ * ```
6405
+ *
6406
+ * | Functions | Behavior and arguments |
6407
+ * | --- | --- |
6408
+ * | GetTimeline, GetItem | Read compact item views: id, track, type, start, end, length, optional media, sourceIn/sourceOut, text and offline reason. GetTimeline returns duration, tracks (id, kind, name, index, locked, items), and joins (id, track, left, right, length in seconds, normalized effect). from/to and tracks narrow the items and joins; joins are selected by their overlap window. |
6409
+ * | ListTransitions | Discover the shared validation catalog: each entry contains kind (effect ID), name, description and params. Each parameter has name, type (enum/number/integer), default, description, enum values or numeric min/max. Use the returned kind and parameter names inside effect. |
6410
+ * | FindItems | Visit items with their track and index; return undefined to omit an item, any other value to collect it. |
6411
+ * | GetMedia | Read metadata for `{libraryId, assetId}` in a bound library: kind, dimensions, fps, hasAudio and durationUs when available. durationUs is microseconds. |
6412
+ * | GetTranscript, GetAnalysis | Read available transcript words or silence/filler/scenes segments. Transcript filter from/to is seconds; returned word and segment from/to values are source microseconds (divide by 1,000,000 for editing). Words contain text and optional speaker/filler; segments may include label/confidence. Request analysis first if unavailable. |
6413
+ * | Insert, Update, Delete | Insert returns the new clip ID; Update changes supplied fields; Delete removes the clip. Optional ripple on Insert/Delete closes or opens space on the track. |
6414
+ * | Join, UpdateJoin, DeleteJoin | Join creates an overlap between two butt-adjacent visual clips on the same track and returns its ID. length defaults to 0.5 seconds; effect is required. The right clip and all same-track followers move left by length, shortening that track and potentially the project. UpdateJoin moves those followers by the difference in length; omitted fields are preserved. DeleteJoin moves them right to restore the butt cut. Other tracks stay in place. |
6415
+ * | Split, Trim, Move | Split at a timeline position and return the new right-hand clip ID. Trim changes the in or out edge by delta seconds. Move sets the timeline start and optionally a new track. |
6416
+ * | RippleDeleteRange | Delete a timeline interval and close its gap on the specified tracks, or all unlocked tracks when omitted. |
6417
+ * | AddTrack, UpdateTrack, DeleteTrack | Add video/audio/caption tracks; index selects layer order (0 is top). TrackPatch supports name, locked, hidden, muted, gainDb and style as appropriate to track kind. |
6418
+ * | SetSettings | Supply any of width/height (pixels), fps (frames per second), background (color). |
6419
+ * | AddCaptionsFromTranscript | Create captions from an audio/video clip's kept words. Optional maxChars is 1–1000, default 16; style updates the caption track. Returns caption IDs. |
6420
+ * | SetMarker | Add a label at a timeline time and return its ID. |
6421
+ * | Print, Preview | Print appends text to prints. Preview requests up to eight times total per execute and puts images in the result's frames. Each url is an inline PNG data URL, not an HTTP image link. Decode the base64 payload to save an image. Codemode returns at most four images per call; request at most four times there. |
6422
+ *
6423
+ * #### Joins between clips
6424
+ *
6425
+ * Endpoints may be video, image, text, color or shape; audio and caption are rejected. Require 0 < length < each endpoint's length. Each clip allows at most one incoming and one outgoing join; their summed lengths cannot exceed its length. Three-input overlaps, nonadjacent endpoints and cross-track joins are rejected with OPS_REJECTED. Read the rejection's code and message, shorten or remove conflicting joins, and retry the saved edit.
6426
+ *
6427
+ * TransitionInput is an object with kind plus the parameters returned by ListTransitions; omitted parameters use the catalog defaults. Unknown kinds and unknown or invalid parameters are rejected. Effects: dissolve (no parameters); dip (color black/white, default black); push and wipe (direction left/right/up/down, default left); wipe also has softness 0–1, default 0; iris has centerX/centerY 0–1, both default 0.5; blinds has integer count 2–64, default 8, and orientation vertical/horizontal, default vertical; blur has radius 0–100 pixels at 1080-pixel frame height, default 24. Join options and UpdateJoin patches accept only length and effect. Effect updates replace the effect object and apply defaults for omitted parameters.
6428
+ *
6429
+ * Minimal example on an existing visual track with adjacent clips left and right: `Print(ListTransitions()); const j = Join(left, right, {length: 0.5, effect: {kind: "dissolve"}}); Print(GetTimeline().joins); Preview([GetItem(right).start + 0.25]);` Use `UpdateJoin(j, {length: 0.8})` to adjust it in a later edit or `DeleteJoin(j)` to restore the cut. Preview uses server-rendered frames and includes joins. Per-clip transitionIn/transitionOut remain separate entrance/exit effects.
6430
+ *
6431
+ * #### Insert fields (ItemInit)
6432
+ *
6433
+ * Every item requires `type` and `start`. Times used for editing are seconds and snap to the project frame rate: start, length, sourceIn, fadeIn/fadeOut, transition length, keyframe at, reveal delay/stagger/duration. Keyframe and reveal times are relative to the clip start. Video/audio may omit length to use the remaining source duration; other types require length.
6434
+ *
6435
+ * | type | Required fields beyond type/start | Optional fields |
6436
+ * | --- | --- | --- |
6437
+ * | video | media | length, sourceIn, volumeDb, transform, fit, animate, transitionIn, transitionOut |
6438
+ * | image | media, length | transform, fit, animate, transitionIn, transitionOut |
6439
+ * | text | text, length | style, transform, reveal, animate, transitionIn, transitionOut |
6440
+ * | color | color, length | transform, fill, animate, transitionIn, transitionOut |
6441
+ * | shape | shape, length, width, height, fill | radius, stroke, transform, animate, transitionIn, transitionOut |
6442
+ * | audio | media | length, sourceIn, volumeDb, fadeIn, fadeOut, transitionIn, transitionOut |
6443
+ * | caption | text, length | — |
6444
+ *
6445
+ * Video tracks accept video/image/text/color/shape; audio and caption tracks accept their corresponding type. Media is `{libraryId: string, assetId: string}` from a bound library. sourceIn defaults to 0, volumeDb to 0 dB, audio fades to 0 seconds. fit defaults to contain: contain fits the whole image, cover fills and crops, fill stretches, none keeps native dimensions.
6446
+ *
6447
+ * | Field | Value |
6448
+ * | --- | --- |
6449
+ * | transform | Partial `{x, y, scale, rotation, opacity, crop, blur}`. x/y are normalized canvas center coordinates (default 0.5); scale 1 is fitted size; rotation is degrees (default 0); opacity is 0–1 (default 1). crop is `{top,right,bottom,left}`. blur is 0–100 pixels at 1080-pixel frame height. |
6450
+ * | style | Partial `{fontFamily, fontSize, fontWeight, color, stroke, background, align, maxWidth, position, margin}`. fontFamily: Geist or Noto Sans SC (default); fontSize defaults to 48; fontWeight: 400 (default), 500 or 700; color defaults to #FFFFFF; align: left, center (default), right; maxWidth is a fraction of canvas width (default 0.9). stroke is `{color,width}`. Text and captions support position (top/middle/bottom; box centers at 12%/50%/85% of height without margin) and optional margin (0–0.4 of canvas height, box edge distance for top/bottom; middle ignores it). Omitted position preserves the text transform (center by default); explicit position controls vertical placement, so omit it for y animation. Caption style additionally supports highlightColor and maxLines: 2. GetItem and GetTimeline return text style and current caption track style. Caption tracks only accept captions; use AddCaptionsFromTranscript, and place text on video tracks. |
6451
+ * | animate | An object keyed by x, y, scale, rotation, opacity or blur. Each value is an array of `{at: number, value: number, ease?: Ease}` sorted by at with distinct frame-snapped times. Values hold before the first and after the last keyframe, overriding the static transform. |
6452
+ * | Ease | linear, in, out, inOut, `{bezier: [x1,y1,x2,y2]}` or `{spring: {stiffness, damping, mass?}}`. Easing shapes the segment arriving at that keyframe; springs may overshoot. |
6453
+ * | reveal | `{by, delay?: number, stagger: number, duration: number, from: {y?, opacity?, scale?, blur?}, ease?: Ease}`. by selects char, word or line. Unit k starts at delay + k * stagger and takes duration seconds to reach its resting state; from.y is a fraction of font size. |
6454
+ * | fill | A color string (#RRGGBB or #RRGGBBAA), `{linear: {angle, stops: [{at,color}, ...]}}` or `{radial: {stops: [{at,color}, ...]}}`. Stop positions are 0–1; angle is degrees, 0 left to right. On color clips, fill replaces color when supplied. |
6455
+ * | shape, width, height, radius, stroke | shape is rect or ellipse. width/height are fractions of canvas width/height before scaling. radius rounds rect corners in pixels at 1080-pixel frame height. stroke is `{color: string, width: number}`. |
6456
+ * | transitionIn, transitionOut | `{kind, length: number}` at the clip's beginning/end. length is seconds. fade changes opacity; dissolve blends; push_left/push_right move horizontally; wipe_left reveals horizontally. |
6457
+ *
6458
+ * #### Update fields (ItemPatchView)
6459
+ *
6460
+ * All fields are optional; use only fields relevant to the item's type. Supported fields: start, length, sourceIn, volumeDb, transform, fit, text, style, color, fadeIn, fadeOut, animate, reveal, fill, stroke, shape, width, height, radius, transitionIn, transitionOut. Values and units match Insert. Set animate, reveal, fill, stroke, transitionIn or transitionOut to null to remove that effect; omitting a field preserves it. For example: `Update(id, {volumeDb: -12})` or `Update(id, {transitionIn: null})`.
6461
+ *
6462
+ * #### Script names versus HTTP response names
6463
+ *
6464
+ * Use camelCase inside scripts, including nested objects. HTTP request/response JSON outside script source uses snake_case. Map media.library_id → media.libraryId, media.asset_id → media.assetId, source_in → sourceIn, volume_db → volumeDb, fade_in/fade_out → fadeIn/fadeOut, transition_in/transition_out → transitionIn/transitionOut, font_family/font_size/font_weight/max_width → fontFamily/fontSize/fontWeight/maxWidth, gain_db → gainDb, highlight_color/max_lines → highlightColor/maxLines. Fields such as animate, reveal, fill, stroke, at and length retain their spelling. GetTimeline/GetItem already return camelCase compact views; the expanded retrieveTimeline HTTP response is not an Insert object.
6465
+ *
6466
+ * Unrecognized script fields fail with OPS_REJECTED and rejection code UNKNOWN_FIELD; snake_case mistakes suggest the corresponding camelCase name. The error message lists each rejection's #opIndex, code and reason. Correct the named fields and retry the saved edit; do not assume an ignored field applied an effect.
5946
6467
  *
5947
- * Create a library owned by the caller with a name, optional labels and understanding settings. Understanding is enabled by default; the returned id is used for subsequent asset operations.
5948
6468
  */
5949
- export const mediaCreateLibrary = (options) => (options.client ?? client).post({
6469
+ export const cutExecute = (options) => (options.client ?? client).post({
5950
6470
  security: [{
5951
- key: 'media-BearerAuth',
6471
+ key: 'BearerAuth',
5952
6472
  scheme: 'bearer',
5953
6473
  type: 'http'
6474
+ }, {
6475
+ key: 'ApiKeyAuth',
6476
+ name: 'X-API-Key',
6477
+ type: 'apiKey'
5954
6478
  }],
5955
- url: '/media/v1/libraries',
6479
+ url: '/cut/v1/projects/{project_id}:execute',
5956
6480
  ...options,
5957
6481
  headers: {
5958
6482
  'Content-Type': 'application/json',
@@ -5960,45 +6484,75 @@ export const mediaCreateLibrary = (options) => (options.client ?? client).post({
5960
6484
  }
5961
6485
  });
5962
6486
  /**
5963
- * Delete library
6487
+ * Read editing state
5964
6488
  *
5965
- * Soft-delete an active library, returning its deleting status and purge_at deadline. Asset operations and delivery become unavailable; the library can be restored before purge_at. Repeated deletion while deleting returns the current library.
6489
+ * 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.
5966
6490
  */
5967
- export const mediaDeleteLibrary = (options) => (options.client ?? client).delete({
6491
+ export const cutRetrieveState = (options) => (options.client ?? client).get({
5968
6492
  security: [{
5969
- key: 'media-BearerAuth',
6493
+ key: 'BearerAuth',
5970
6494
  scheme: 'bearer',
5971
6495
  type: 'http'
6496
+ }, {
6497
+ key: 'ApiKeyAuth',
6498
+ name: 'X-API-Key',
6499
+ type: 'apiKey'
5972
6500
  }],
5973
- url: '/media/v1/libraries/{library_id}',
6501
+ url: '/cut/v1/projects/{project_id}/state',
5974
6502
  ...options
5975
6503
  });
5976
6504
  /**
5977
- * Get library
6505
+ * Read project timeline
5978
6506
  *
5979
- * Read a caller-owned library’s current settings, usage and lifecycle status. A deleting library remains readable; missing, foreign or purged libraries return LIBRARY_NOT_FOUND.
6507
+ * 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.
5980
6508
  */
5981
- export const mediaGetLibrary = (options) => (options.client ?? client).get({
6509
+ export const cutRetrieveTimeline = (options) => (options.client ?? client).get({
5982
6510
  security: [{
5983
- key: 'media-BearerAuth',
6511
+ key: 'BearerAuth',
5984
6512
  scheme: 'bearer',
5985
6513
  type: 'http'
6514
+ }, {
6515
+ key: 'ApiKeyAuth',
6516
+ name: 'X-API-Key',
6517
+ type: 'apiKey'
5986
6518
  }],
5987
- url: '/media/v1/libraries/{library_id}',
6519
+ url: '/cut/v1/projects/{project_id}/timeline',
5988
6520
  ...options
5989
6521
  });
5990
6522
  /**
5991
- * Update library
6523
+ * Render preview frames
5992
6524
  *
5993
- * Update an active library’s supplied settings. Labels replace the complete map; understanding settings and model roles merge with current values. Changing the embedding model is rejected while assets exist.
6525
+ * 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. Request at most eight times. Each returned url is an inline PNG data URL (data:image/png;base64,...), not a hosted HTTP image link. The default scale is 0.25; use 0.5 for subtitle layout inspection (1080×1920 renders at 540×960). The maximum is 0.5; values above it return INVALID_PARAMS. Actual width and height are returned per frame. PNGs above 2 MiB or responses above 4 MiB return RESPONSE_TOO_LARGE without silently lowering resolution. FRAME_UNAVAILABLE warnings on execute mean a source preview could not be fetched and an offline tile was drawn; edits still commit, and this warning alone does not establish that the source media is broken. Decode its base64 payload to save the image. Codemode returns at most four images per call, so request at most four times when reviewing there.
5994
6526
  */
5995
- export const mediaUpdateLibrary = (options) => (options.client ?? client).patch({
6527
+ export const cutListFrames = (options) => (options.client ?? client).get({
5996
6528
  security: [{
5997
- key: 'media-BearerAuth',
6529
+ key: 'BearerAuth',
5998
6530
  scheme: 'bearer',
5999
6531
  type: 'http'
6532
+ }, {
6533
+ key: 'ApiKeyAuth',
6534
+ name: 'X-API-Key',
6535
+ type: 'apiKey'
6000
6536
  }],
6001
- url: '/media/v1/libraries/{library_id}',
6537
+ url: '/cut/v1/projects/{project_id}/frames',
6538
+ ...options
6539
+ });
6540
+ /**
6541
+ * Analyze project media
6542
+ *
6543
+ * 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. Silence measures transcript-based speech pauses, not music or loudness. A completed transcript without words returns ready with empty segments and reason no_speech; no completed transcript returns unsupported with reason no_transcript. A failed transcription remains failed.
6544
+ */
6545
+ export const cutCreateAnalysis = (options) => (options.client ?? client).post({
6546
+ security: [{
6547
+ key: 'BearerAuth',
6548
+ scheme: 'bearer',
6549
+ type: 'http'
6550
+ }, {
6551
+ key: 'ApiKeyAuth',
6552
+ name: 'X-API-Key',
6553
+ type: 'apiKey'
6554
+ }],
6555
+ url: '/cut/v1/projects/{project_id}/analysis',
6002
6556
  ...options,
6003
6557
  headers: {
6004
6558
  'Content-Type': 'application/json',
@@ -6006,59 +6560,79 @@ export const mediaUpdateLibrary = (options) => (options.client ?? client).patch(
6006
6560
  }
6007
6561
  });
6008
6562
  /**
6009
- * Restore library
6563
+ * List library bindings
6010
6564
  *
6011
- * Restore a deleting library before its purge_at deadline. The library becomes active again and deleted_at and purge_at are cleared; expired or non-deleting libraries cannot be restored.
6565
+ * 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.
6012
6566
  */
6013
- export const mediaRestoreLibrary = (options) => (options.client ?? client).post({
6567
+ export const cutListBindings = (options) => (options.client ?? client).get({
6014
6568
  security: [{
6015
- key: 'media-BearerAuth',
6569
+ key: 'BearerAuth',
6016
6570
  scheme: 'bearer',
6017
6571
  type: 'http'
6572
+ }, {
6573
+ key: 'ApiKeyAuth',
6574
+ name: 'X-API-Key',
6575
+ type: 'apiKey'
6018
6576
  }],
6019
- url: '/media/v1/libraries/{library_id}/restore',
6577
+ url: '/cut/v1/projects/{project_id}/bindings',
6020
6578
  ...options
6021
6579
  });
6022
6580
  /**
6023
- * Purge library
6581
+ * Bind media library
6024
6582
  *
6025
- * Permanently remove a library that is already deleting, without waiting for purge_at. Its assets and related resources are removed and cannot be restored; first soft-delete an active library.
6583
+ * 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.
6026
6584
  */
6027
- export const mediaPurgeLibrary = (options) => (options.client ?? client).post({
6585
+ export const cutCreateBinding = (options) => (options.client ?? client).post({
6028
6586
  security: [{
6029
- key: 'media-BearerAuth',
6587
+ key: 'BearerAuth',
6030
6588
  scheme: 'bearer',
6031
6589
  type: 'http'
6590
+ }, {
6591
+ key: 'ApiKeyAuth',
6592
+ name: 'X-API-Key',
6593
+ type: 'apiKey'
6032
6594
  }],
6033
- url: '/media/v1/libraries/{library_id}/purge',
6034
- ...options
6595
+ url: '/cut/v1/projects/{project_id}/bindings',
6596
+ ...options,
6597
+ headers: {
6598
+ 'Content-Type': 'application/json',
6599
+ ...options.headers
6600
+ }
6035
6601
  });
6036
6602
  /**
6037
- * List assets
6603
+ * Remove library binding
6038
6604
  *
6039
- * List assets in an active library, newest first, optionally filtering by exact folder and stored resource type. Continue using next_cursor; video includes audio-only assets.
6605
+ * 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.
6040
6606
  */
6041
- export const mediaListAssets = (options) => (options.client ?? client).get({
6607
+ export const cutDeleteBinding = (options) => (options.client ?? client).delete({
6042
6608
  security: [{
6043
- key: 'media-BearerAuth',
6609
+ key: 'BearerAuth',
6044
6610
  scheme: 'bearer',
6045
6611
  type: 'http'
6612
+ }, {
6613
+ key: 'ApiKeyAuth',
6614
+ name: 'X-API-Key',
6615
+ type: 'apiKey'
6046
6616
  }],
6047
- url: '/media/v1/libraries/{library_id}/assets',
6617
+ url: '/cut/v1/projects/{project_id}/bindings/{name}',
6048
6618
  ...options
6049
6619
  });
6050
6620
  /**
6051
- * Upload asset
6621
+ * Import project media
6052
6622
  *
6053
- * Upload content into an active library and return a Cloudinary-compatible resource. Use file for a multipart file, data URI, public HTTPS URL or same-owner file identifier. Reusing public_id overwrites by default; overwrite=false returns the existing resource. Chunk uploads require both chunk headers.
6623
+ * 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.
6054
6624
  */
6055
- export const mediaUploadAsset = (options) => (options.client ?? client).post({
6625
+ export const cutImportMedia = (options) => (options.client ?? client).post({
6056
6626
  security: [{
6057
- key: 'media-BearerAuth',
6627
+ key: 'BearerAuth',
6058
6628
  scheme: 'bearer',
6059
6629
  type: 'http'
6630
+ }, {
6631
+ key: 'ApiKeyAuth',
6632
+ name: 'X-API-Key',
6633
+ type: 'apiKey'
6060
6634
  }],
6061
- url: '/media/v1/libraries/{library_id}/assets',
6635
+ url: '/cut/v1/projects/{project_id}/media:import',
6062
6636
  ...options,
6063
6637
  headers: {
6064
6638
  'Content-Type': 'application/json',
@@ -6066,17 +6640,39 @@ export const mediaUploadAsset = (options) => (options.client ?? client).post({
6066
6640
  }
6067
6641
  });
6068
6642
  /**
6069
- * Import file
6643
+ * List project exports
6070
6644
  *
6071
- * Copy source content into an active library using upload options and return the full native Asset. The imported asset is independent of the source after copying. Reusing public_id follows overwrite semantics.
6645
+ * 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.
6072
6646
  */
6073
- export const mediaImportAsset = (options) => (options.client ?? client).post({
6647
+ export const cutListExports = (options) => (options.client ?? client).get({
6074
6648
  security: [{
6075
- key: 'media-BearerAuth',
6649
+ key: 'BearerAuth',
6076
6650
  scheme: 'bearer',
6077
6651
  type: 'http'
6652
+ }, {
6653
+ key: 'ApiKeyAuth',
6654
+ name: 'X-API-Key',
6655
+ type: 'apiKey'
6078
6656
  }],
6079
- url: '/media/v1/libraries/{library_id}/assets/import',
6657
+ url: '/cut/v1/projects/{project_id}/exports',
6658
+ ...options
6659
+ });
6660
+ /**
6661
+ * Create video export
6662
+ *
6663
+ * 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.
6664
+ */
6665
+ export const cutCreateExport = (options) => (options.client ?? client).post({
6666
+ security: [{
6667
+ key: 'BearerAuth',
6668
+ scheme: 'bearer',
6669
+ type: 'http'
6670
+ }, {
6671
+ key: 'ApiKeyAuth',
6672
+ name: 'X-API-Key',
6673
+ type: 'apiKey'
6674
+ }],
6675
+ url: '/cut/v1/projects/{project_id}/exports',
6080
6676
  ...options,
6081
6677
  headers: {
6082
6678
  'Content-Type': 'application/json',
@@ -6084,63 +6680,75 @@ export const mediaImportAsset = (options) => (options.client ?? client).post({
6084
6680
  }
6085
6681
  });
6086
6682
  /**
6087
- * Delete asset
6683
+ * Retrieve video export
6088
6684
  *
6089
- * Delete an asset from the library so it is no longer readable, searchable or deliverable. This removes the asset rather than placing it in the library’s restoration window; a missing asset returns ASSET_NOT_FOUND.
6685
+ * 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.
6090
6686
  */
6091
- export const mediaDeleteAsset = (options) => (options.client ?? client).delete({
6687
+ export const cutRetrieveExport = (options) => (options.client ?? client).get({
6092
6688
  security: [{
6093
- key: 'media-BearerAuth',
6689
+ key: 'BearerAuth',
6094
6690
  scheme: 'bearer',
6095
6691
  type: 'http'
6692
+ }, {
6693
+ key: 'ApiKeyAuth',
6694
+ name: 'X-API-Key',
6695
+ type: 'apiKey'
6096
6696
  }],
6097
- url: '/media/v1/libraries/{library_id}/assets/{asset_id}',
6697
+ url: '/cut/v1/exports/{export_id}',
6098
6698
  ...options
6099
6699
  });
6100
6700
  /**
6101
- * Get asset
6701
+ * Cancel video export
6102
6702
  *
6103
- * Read a non-deleted asset by its asset_id in an active library, including content hashes, processing progress and available previews. Missing or deleted assets return ASSET_NOT_FOUND.
6703
+ * 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.
6104
6704
  */
6105
- export const mediaGetAsset = (options) => (options.client ?? client).get({
6705
+ export const cutCancelExport = (options) => (options.client ?? client).post({
6106
6706
  security: [{
6107
- key: 'media-BearerAuth',
6707
+ key: 'BearerAuth',
6108
6708
  scheme: 'bearer',
6109
6709
  type: 'http'
6710
+ }, {
6711
+ key: 'ApiKeyAuth',
6712
+ name: 'X-API-Key',
6713
+ type: 'apiKey'
6110
6714
  }],
6111
- url: '/media/v1/libraries/{library_id}/assets/{asset_id}',
6715
+ url: '/cut/v1/exports/{export_id}:cancel',
6112
6716
  ...options
6113
6717
  });
6114
6718
  /**
6115
- * Update asset
6719
+ * List saved versions
6116
6720
  *
6117
- * Update an asset’s supplied metadata fields. Tags and context replace their current collections; an empty collection clears them. Moving asset_folder or changing display_name preserves public_id and delivery URLs.
6721
+ * 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.
6118
6722
  */
6119
- export const mediaUpdateAsset = (options) => (options.client ?? client).patch({
6723
+ export const cutListVersions = (options) => (options.client ?? client).get({
6120
6724
  security: [{
6121
- key: 'media-BearerAuth',
6725
+ key: 'BearerAuth',
6122
6726
  scheme: 'bearer',
6123
6727
  type: 'http'
6728
+ }, {
6729
+ key: 'ApiKeyAuth',
6730
+ name: 'X-API-Key',
6731
+ type: 'apiKey'
6124
6732
  }],
6125
- url: '/media/v1/libraries/{library_id}/assets/{asset_id}',
6126
- ...options,
6127
- headers: {
6128
- 'Content-Type': 'application/json',
6129
- ...options.headers
6130
- }
6733
+ url: '/cut/v1/projects/{project_id}/versions',
6734
+ ...options
6131
6735
  });
6132
6736
  /**
6133
- * Reprocess asset
6737
+ * Save project version
6134
6738
  *
6135
- * Queue reprocessing of the asset’s current version and return its updated state immediately. Omit kinds to retry failed tasks; explicit kinds rerun applicable completed tasks. Replaced understandings become superseded, and processing finishes asynchronously.
6739
+ * 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.
6136
6740
  */
6137
- export const mediaReprocessAsset = (options) => (options.client ?? client).post({
6741
+ export const cutCreateVersion = (options) => (options.client ?? client).post({
6138
6742
  security: [{
6139
- key: 'media-BearerAuth',
6743
+ key: 'BearerAuth',
6140
6744
  scheme: 'bearer',
6141
6745
  type: 'http'
6746
+ }, {
6747
+ key: 'ApiKeyAuth',
6748
+ name: 'X-API-Key',
6749
+ type: 'apiKey'
6142
6750
  }],
6143
- url: '/media/v1/libraries/{library_id}/assets/{asset_id}/reprocess',
6751
+ url: '/cut/v1/projects/{project_id}/versions',
6144
6752
  ...options,
6145
6753
  headers: {
6146
6754
  'Content-Type': 'application/json',
@@ -6148,31 +6756,49 @@ export const mediaReprocessAsset = (options) => (options.client ?? client).post(
6148
6756
  }
6149
6757
  });
6150
6758
  /**
6151
- * List understandings
6759
+ * Restore saved version
6152
6760
  *
6153
- * List an asset’s understanding results in creation order. By default only current, non-superseded results are returned; use include_superseded=true for history or kind to select an output type.
6761
+ * 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.
6154
6762
  */
6155
- export const mediaListUnderstandings = (options) => (options.client ?? client).get({
6763
+ export const cutRestoreVersion = (options) => (options.client ?? client).post({
6156
6764
  security: [{
6157
- key: 'media-BearerAuth',
6765
+ key: 'BearerAuth',
6158
6766
  scheme: 'bearer',
6159
6767
  type: 'http'
6768
+ }, {
6769
+ key: 'ApiKeyAuth',
6770
+ name: 'X-API-Key',
6771
+ type: 'apiKey'
6160
6772
  }],
6161
- url: '/media/v1/libraries/{library_id}/assets/{asset_id}/understandings',
6773
+ url: '/cut/v1/versions/{version_id}:restore',
6162
6774
  ...options
6163
6775
  });
6164
6776
  /**
6165
- * Expression search
6777
+ * List databases
6166
6778
  *
6167
- * Search active assets using the supported filter-expression syntax, sorting and cursor pagination. Empty expression matches all assets. Tags and context require with_field; inspect the exactness flags before treating counts as complete.
6779
+ * 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.
6168
6780
  */
6169
- export const mediaExpressionSearch = (options) => (options.client ?? client).post({
6781
+ export const databaseListDatabases = (options) => (options?.client ?? client).get({
6170
6782
  security: [{
6171
- key: 'media-BearerAuth',
6783
+ key: 'database-bearerAuth',
6172
6784
  scheme: 'bearer',
6173
6785
  type: 'http'
6174
6786
  }],
6175
- url: '/media/v1/libraries/{library_id}/search/expression',
6787
+ url: '/database/v1/databases',
6788
+ ...options
6789
+ });
6790
+ /**
6791
+ * Create database
6792
+ *
6793
+ * 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.
6794
+ */
6795
+ export const databaseCreateDatabase = (options) => (options.client ?? client).post({
6796
+ security: [{
6797
+ key: 'database-bearerAuth',
6798
+ scheme: 'bearer',
6799
+ type: 'http'
6800
+ }],
6801
+ url: '/database/v1/databases',
6176
6802
  ...options,
6177
6803
  headers: {
6178
6804
  'Content-Type': 'application/json',
@@ -6180,17 +6806,45 @@ export const mediaExpressionSearch = (options) => (options.client ?? client).pos
6180
6806
  }
6181
6807
  });
6182
6808
  /**
6183
- * Visual search
6809
+ * Delete database
6184
6810
  *
6185
- * Find visually similar assets using exactly one of asset_id or an inline base64 image. The library must support image search; an asset query needs a current image embedding and excludes that source asset from results.
6811
+ * 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.
6186
6812
  */
6187
- export const mediaVisualSearch = (options) => (options.client ?? client).post({
6813
+ export const databaseDeleteDatabase = (options) => (options.client ?? client).delete({
6188
6814
  security: [{
6189
- key: 'media-BearerAuth',
6815
+ key: 'database-bearerAuth',
6190
6816
  scheme: 'bearer',
6191
6817
  type: 'http'
6192
6818
  }],
6193
- url: '/media/v1/libraries/{library_id}/search/visual',
6819
+ url: '/database/v1/databases/{database_id}',
6820
+ ...options
6821
+ });
6822
+ /**
6823
+ * Get database
6824
+ *
6825
+ * 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.
6826
+ */
6827
+ export const databaseGetDatabase = (options) => (options.client ?? client).get({
6828
+ security: [{
6829
+ key: 'database-bearerAuth',
6830
+ scheme: 'bearer',
6831
+ type: 'http'
6832
+ }],
6833
+ url: '/database/v1/databases/{database_id}',
6834
+ ...options
6835
+ });
6836
+ /**
6837
+ * Update database
6838
+ *
6839
+ * 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.
6840
+ */
6841
+ export const databaseUpdateDatabase = (options) => (options.client ?? client).patch({
6842
+ security: [{
6843
+ key: 'database-bearerAuth',
6844
+ scheme: 'bearer',
6845
+ type: 'http'
6846
+ }],
6847
+ url: '/database/v1/databases/{database_id}',
6194
6848
  ...options,
6195
6849
  headers: {
6196
6850
  'Content-Type': 'application/json',
@@ -6198,17 +6852,59 @@ export const mediaVisualSearch = (options) => (options.client ?? client).post({
6198
6852
  }
6199
6853
  });
6200
6854
  /**
6201
- * Semantic search
6855
+ * Restore database
6202
6856
  *
6203
- * Search assets with a nonblank text query and optional expression filter. Hybrid mode combines semantic and keyword matches; semantic mode uses vector similarity only. Results are ranked and limited by top_k.
6857
+ * 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.
6204
6858
  */
6205
- export const mediaSemanticSearch = (options) => (options.client ?? client).post({
6859
+ export const databaseRestoreDatabase = (options) => (options.client ?? client).post({
6206
6860
  security: [{
6207
- key: 'media-BearerAuth',
6861
+ key: 'database-bearerAuth',
6208
6862
  scheme: 'bearer',
6209
6863
  type: 'http'
6210
6864
  }],
6211
- url: '/media/v1/libraries/{library_id}/search/semantic',
6865
+ url: '/database/v1/databases/{database_id}/restore',
6866
+ ...options
6867
+ });
6868
+ /**
6869
+ * Permanently purge database
6870
+ *
6871
+ * Immediately and irreversibly purges a deleting database. Active databases return 409; absent or already purged databases return 404.
6872
+ */
6873
+ export const databasePurgeDatabase = (options) => (options.client ?? client).post({
6874
+ security: [{
6875
+ key: 'database-bearerAuth',
6876
+ scheme: 'bearer',
6877
+ type: 'http'
6878
+ }],
6879
+ url: '/database/v1/databases/{database_id}/purge',
6880
+ ...options
6881
+ });
6882
+ /**
6883
+ * List tables
6884
+ *
6885
+ * 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.
6886
+ */
6887
+ export const databaseListTables = (options) => (options.client ?? client).get({
6888
+ security: [{
6889
+ key: 'database-bearerAuth',
6890
+ scheme: 'bearer',
6891
+ type: 'http'
6892
+ }],
6893
+ url: '/database/v1/databases/{database_id}/tables',
6894
+ ...options
6895
+ });
6896
+ /**
6897
+ * Create table
6898
+ *
6899
+ * 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.
6900
+ */
6901
+ export const databaseCreateTable = (options) => (options.client ?? client).post({
6902
+ security: [{
6903
+ key: 'database-bearerAuth',
6904
+ scheme: 'bearer',
6905
+ type: 'http'
6906
+ }],
6907
+ url: '/database/v1/databases/{database_id}/tables',
6212
6908
  ...options,
6213
6909
  headers: {
6214
6910
  'Content-Type': 'application/json',
@@ -6216,17 +6912,45 @@ export const mediaSemanticSearch = (options) => (options.client ?? client).post(
6216
6912
  }
6217
6913
  });
6218
6914
  /**
6219
- * Semantic search alias
6915
+ * Delete table
6220
6916
  *
6221
- * Alias of semantic search. Search assets with a nonblank text query, optional expression filter and top_k; hybrid combines semantic and keyword matches, while semantic uses vector similarity only.
6917
+ * 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.
6222
6918
  */
6223
- export const mediaSearch = (options) => (options.client ?? client).post({
6919
+ export const databaseDeleteTable = (options) => (options.client ?? client).delete({
6224
6920
  security: [{
6225
- key: 'media-BearerAuth',
6921
+ key: 'database-bearerAuth',
6226
6922
  scheme: 'bearer',
6227
6923
  type: 'http'
6228
6924
  }],
6229
- url: '/media/v1/libraries/{library_id}/search',
6925
+ url: '/database/v1/databases/{database_id}/tables/{table}',
6926
+ ...options
6927
+ });
6928
+ /**
6929
+ * Get table
6930
+ *
6931
+ * 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.
6932
+ */
6933
+ export const databaseGetTable = (options) => (options.client ?? client).get({
6934
+ security: [{
6935
+ key: 'database-bearerAuth',
6936
+ scheme: 'bearer',
6937
+ type: 'http'
6938
+ }],
6939
+ url: '/database/v1/databases/{database_id}/tables/{table}',
6940
+ ...options
6941
+ });
6942
+ /**
6943
+ * Update table
6944
+ *
6945
+ * 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.
6946
+ */
6947
+ export const databaseUpdateTable = (options) => (options.client ?? client).patch({
6948
+ security: [{
6949
+ key: 'database-bearerAuth',
6950
+ scheme: 'bearer',
6951
+ type: 'http'
6952
+ }],
6953
+ url: '/database/v1/databases/{database_id}/tables/{table}',
6230
6954
  ...options,
6231
6955
  headers: {
6232
6956
  'Content-Type': 'application/json',
@@ -6234,31 +6958,49 @@ export const mediaSearch = (options) => (options.client ?? client).post({
6234
6958
  }
6235
6959
  });
6236
6960
  /**
6237
- * List folders
6961
+ * Add field
6238
6962
  *
6239
- * List all immediate child folders under parent, or under the root when parent is omitted. Counts include descendant assets. The result is unpaginated; limit and cursor are rejected.
6963
+ * 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.
6240
6964
  */
6241
- export const mediaListFolders = (options) => (options.client ?? client).get({
6965
+ export const databaseAddField = (options) => (options.client ?? client).post({
6242
6966
  security: [{
6243
- key: 'media-BearerAuth',
6967
+ key: 'database-bearerAuth',
6244
6968
  scheme: 'bearer',
6245
6969
  type: 'http'
6246
6970
  }],
6247
- url: '/media/v1/libraries/{library_id}/folders',
6971
+ url: '/database/v1/databases/{database_id}/tables/{table}/fields',
6972
+ ...options,
6973
+ headers: {
6974
+ 'Content-Type': 'application/json',
6975
+ ...options.headers
6976
+ }
6977
+ });
6978
+ /**
6979
+ * Delete field
6980
+ *
6981
+ * 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.
6982
+ */
6983
+ export const databaseDeleteField = (options) => (options.client ?? client).delete({
6984
+ security: [{
6985
+ key: 'database-bearerAuth',
6986
+ scheme: 'bearer',
6987
+ type: 'http'
6988
+ }],
6989
+ url: '/database/v1/databases/{database_id}/tables/{table}/fields/{field}',
6248
6990
  ...options
6249
6991
  });
6250
6992
  /**
6251
- * Create batch
6993
+ * Update field
6252
6994
  *
6253
- * Create an asynchronous batch for tagging, untagging, replacing context, moving or deleting assets. Select ids or an expression; selection is frozen at creation. Poll the returned job id for completion and per-item failures.
6995
+ * 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.
6254
6996
  */
6255
- export const mediaCreateBatch = (options) => (options.client ?? client).post({
6997
+ export const databaseUpdateField = (options) => (options.client ?? client).patch({
6256
6998
  security: [{
6257
- key: 'media-BearerAuth',
6999
+ key: 'database-bearerAuth',
6258
7000
  scheme: 'bearer',
6259
7001
  type: 'http'
6260
7002
  }],
6261
- url: '/media/v1/libraries/{library_id}/batches',
7003
+ url: '/database/v1/databases/{database_id}/tables/{table}/fields/{field}',
6262
7004
  ...options,
6263
7005
  headers: {
6264
7006
  'Content-Type': 'application/json',
@@ -6266,31 +7008,1080 @@ export const mediaCreateBatch = (options) => (options.client ?? client).post({
6266
7008
  }
6267
7009
  });
6268
7010
  /**
6269
- * Get batch
7011
+ * List events
6270
7012
  *
6271
- * Read a batch job’s status, successful and failed item counts, and a bounded list of failed items. Use the id returned by batch creation; a job outside this library is not found.
7013
+ * 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.
6272
7014
  */
6273
- export const mediaGetBatch = (options) => (options.client ?? client).get({
7015
+ export const databaseListEvents = (options) => (options.client ?? client).get({
6274
7016
  security: [{
6275
- key: 'media-BearerAuth',
7017
+ key: 'database-bearerAuth',
6276
7018
  scheme: 'bearer',
6277
7019
  type: 'http'
6278
7020
  }],
6279
- url: '/media/v1/libraries/{library_id}/batches/{job_id}',
7021
+ url: '/database/v1/databases/{database_id}/events',
6280
7022
  ...options
6281
7023
  });
6282
7024
  /**
6283
- * Batch assets alias
7025
+ * Delete rows
6284
7026
  *
6285
- * Alias of batch creation. Apply one metadata or deletion action to ids or a frozen expression selection asynchronously; poll the returned job id to inspect completion and item failures.
7027
+ * 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.
6286
7028
  */
6287
- export const mediaBatchAssets = (options) => (options.client ?? client).post({
7029
+ export const databaseDelete = (options) => (options.client ?? client).delete({
6288
7030
  security: [{
6289
- key: 'media-BearerAuth',
7031
+ key: 'database-bearerAuth',
7032
+ scheme: 'bearer',
7033
+ type: 'http'
7034
+ }],
7035
+ url: '/database/v1/databases/{database_id}/rest/{table}',
7036
+ ...options
7037
+ });
7038
+ /**
7039
+ * Select rows
7040
+ *
7041
+ * 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.
7042
+ */
7043
+ export const databaseSelect = (options) => (options.client ?? client).get({
7044
+ security: [{
7045
+ key: 'database-bearerAuth',
7046
+ scheme: 'bearer',
7047
+ type: 'http'
7048
+ }],
7049
+ url: '/database/v1/databases/{database_id}/rest/{table}',
7050
+ ...options
7051
+ });
7052
+ /**
7053
+ * Count rows
7054
+ *
7055
+ * 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.
7056
+ */
7057
+ export const databaseHead = (options) => (options.client ?? client).head({
7058
+ security: [{
7059
+ key: 'database-bearerAuth',
7060
+ scheme: 'bearer',
7061
+ type: 'http'
7062
+ }],
7063
+ url: '/database/v1/databases/{database_id}/rest/{table}',
7064
+ ...options
7065
+ });
7066
+ /**
7067
+ * Update rows
7068
+ *
7069
+ * 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.
7070
+ */
7071
+ export const databaseUpdate = (options) => (options.client ?? client).patch({
7072
+ security: [{
7073
+ key: 'database-bearerAuth',
7074
+ scheme: 'bearer',
7075
+ type: 'http'
7076
+ }],
7077
+ url: '/database/v1/databases/{database_id}/rest/{table}',
7078
+ ...options,
7079
+ headers: {
7080
+ 'Content-Type': 'application/json',
7081
+ ...options.headers
7082
+ }
7083
+ });
7084
+ /**
7085
+ * Insert rows
7086
+ *
7087
+ * Insert rows into an existing table after defining its fields; at most 500 rows per request. Each request is atomic: any failure rolls back the entire batch. There are no transactions across requests.
7088
+ * Rows are filled to the union of their keys with null; send Prefer: missing=default to use field defaults for missing keys.
7089
+ * The default is return=minimal: success returns HTTP 201 with an empty body. Send Prefer: return=representation to return the inserted rows. With resolution=merge-duplicates, a conflicting row keeps columns omitted from the request; supplied values replace the whole field value (including JSON objects), and explicit null clears a nullable field. With resolution=ignore-duplicates, a conflicting row is left unchanged. Without a conflict, both modes insert a new row using field defaults for omitted fields. In a batch, a key present in another row is filled with null when omitted in this row unless missing=default is set; that null can overwrite a value during merge. With missing=default, omitted keys stay omitted for conflict merges (existing values are preserved); new rows use defaults, or null when no default exists. Explicit null never invokes a default. Unlike Supabase, upsert conflicts can target only id or one unique field, not a composite key. Each table supports up to 1,000,000 rows.
7090
+ */
7091
+ export const databaseInsert = (options) => (options.client ?? client).post({
7092
+ security: [{
7093
+ key: 'database-bearerAuth',
7094
+ scheme: 'bearer',
7095
+ type: 'http'
7096
+ }],
7097
+ url: '/database/v1/databases/{database_id}/rest/{table}',
7098
+ ...options,
7099
+ headers: {
7100
+ 'Content-Type': 'application/json',
7101
+ ...options.headers
7102
+ }
7103
+ });
7104
+ /**
7105
+ * List knowledge bases
7106
+ *
7107
+ * Lists knowledge bases visible to the caller, newest first by default. Use last_id as after to read the next page; for example, ?limit=20.
7108
+ */
7109
+ export const knowledgeListVectorStores = (options) => (options?.client ?? client).get({
7110
+ security: [{
7111
+ key: 'knowledge-bearerAuth',
7112
+ scheme: 'bearer',
7113
+ type: 'http'
7114
+ }],
7115
+ url: '/knowledge/v1/vector_stores',
7116
+ ...options
7117
+ });
7118
+ /**
7119
+ * Create knowledge base
7120
+ *
7121
+ * Create a knowledge base, optionally starting ingestion of uploaded file_ids in the same call; no separate attachment or batch is needed for those files. Use the returned id with vectorStores.files.retrieve to poll each attachment until completed, failed or cancelled; store status=completed alone does not mean every file succeeded. Each file accepts up to 52428800 bytes and 5000000 estimated tokens; each account holds up to 100 active/nondeleted stores. Minimal body: {"name":"Refund policies"}.
7122
+ */
7123
+ export const knowledgeCreateVectorStore = (options) => (options.client ?? client).post({
7124
+ security: [{
7125
+ key: 'knowledge-bearerAuth',
7126
+ scheme: 'bearer',
7127
+ type: 'http'
7128
+ }],
7129
+ url: '/knowledge/v1/vector_stores',
7130
+ ...options,
7131
+ headers: {
7132
+ 'Content-Type': 'application/json',
7133
+ ...options.headers
7134
+ }
7135
+ });
7136
+ /**
7137
+ * Delete knowledge base
7138
+ *
7139
+ * Remove a knowledge base from active use while keeping a recovery window. Unlike OpenAI vector stores, native DELETE returns the store with status=deleting and ISO purge_at, retains it for 7 days and is idempotent on repeat. Retrieve remains 200; object operations return 409. Use restore before purge_at to recover it, or purge to remove it irreversibly.
7140
+ */
7141
+ export const knowledgeDeleteVectorStore = (options) => (options.client ?? client).delete({
7142
+ security: [{
7143
+ key: 'knowledge-bearerAuth',
7144
+ scheme: 'bearer',
7145
+ type: 'http'
7146
+ }],
7147
+ url: '/knowledge/v1/vector_stores/{vector_store_id}',
7148
+ ...options
7149
+ });
7150
+ /**
7151
+ * Retrieve knowledge base
7152
+ *
7153
+ * Retrieves a knowledge base using an id returned by create or list. Add ?expand=files to include the first page of attached files. Soft-deleted stores remain readable with status=deleting until purged.
7154
+ */
7155
+ export const knowledgeRetrieveVectorStore = (options) => (options.client ?? client).get({
7156
+ security: [{
7157
+ key: 'knowledge-bearerAuth',
7158
+ scheme: 'bearer',
7159
+ type: 'http'
7160
+ }],
7161
+ url: '/knowledge/v1/vector_stores/{vector_store_id}',
7162
+ ...options
7163
+ });
7164
+ /**
7165
+ * Update knowledge base
7166
+ *
7167
+ * Updates an active knowledge base using its returned id. Omitted fields stay unchanged; metadata replaces the whole map. Example body: {"name":"Refund policies"}.
7168
+ */
7169
+ export const knowledgeUpdateVectorStore = (options) => (options.client ?? client).post({
7170
+ security: [{
7171
+ key: 'knowledge-bearerAuth',
7172
+ scheme: 'bearer',
7173
+ type: 'http'
7174
+ }],
7175
+ url: '/knowledge/v1/vector_stores/{vector_store_id}',
7176
+ ...options,
7177
+ headers: {
7178
+ 'Content-Type': 'application/json',
7179
+ ...options.headers
7180
+ }
7181
+ });
7182
+ /**
7183
+ * Search knowledge base
7184
+ *
7185
+ * Search ingested text to answer a question or find supporting passages. Native results contain one chunk each, so file_id can repeat; max_num_results counts chunks (1–50, default 10), while the compatible URL groups results by file. Unlike OpenAI vector stores, next_page is always null even when has_more is true. Only completed attachments are searchable. For keyword-only retrieval set ranking_options.hybrid_search to {"embedding_weight":0,"text_weight":1}; omit rewrite_query or set it to false to avoid query rewriting. Unlike OpenAI, ranker auto does not rerank; only default-2024-11-15 requests reranking. Set praxis.explain=true to inspect scores and use returned content[].chunk_id to retrieve a segment.
7186
+ */
7187
+ export const knowledgeSearchVectorStore = (options) => (options.client ?? client).post({
7188
+ security: [{
7189
+ key: 'knowledge-bearerAuth',
7190
+ scheme: 'bearer',
7191
+ type: 'http'
7192
+ }],
7193
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/search',
7194
+ ...options,
7195
+ headers: {
7196
+ 'Content-Type': 'application/json',
7197
+ ...options.headers
7198
+ }
7199
+ });
7200
+ /**
7201
+ * List files
7202
+ *
7203
+ * Lists attached files and their ingestion status, newest attachment first by default. Use last_id as after to continue; ?filter=failed selects files that can be retried.
7204
+ */
7205
+ export const knowledgeListFiles = (options) => (options.client ?? client).get({
7206
+ security: [{
7207
+ key: 'knowledge-bearerAuth',
7208
+ scheme: 'bearer',
7209
+ type: 'http'
7210
+ }],
7211
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/files',
7212
+ ...options
7213
+ });
7214
+ /**
7215
+ * Add file
7216
+ *
7217
+ * Attach an uploaded File for asynchronous ingestion, then poll this attachment until status is completed, failed or cancelled before searching. Each file accepts up to 52428800 bytes and 5000000 estimated tokens; chunk sizes use estimated tokens rather than a model tokenizer. Text, Markdown, CSV, JSON, HTML, PDF, DOCX, PPTX, XLSX and PNG/JPEG/GIF/WebP images can be extracted; audio and video uploads are not knowledge documents. Images may yield generated descriptions rather than verbatim OCR. auto chunking resolves to static 800/400; explicit sizes are 100–4096 with overlap at most half the size. Each store holds at most 10000 attached files. Reattaching the same file returns its existing record without applying new attributes or chunking; inspect last_error after failure.
7218
+ */
7219
+ export const knowledgeAttachFile = (options) => (options.client ?? client).post({
7220
+ security: [{
7221
+ key: 'knowledge-bearerAuth',
7222
+ scheme: 'bearer',
7223
+ type: 'http'
7224
+ }],
7225
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/files',
7226
+ ...options,
7227
+ headers: {
7228
+ 'Content-Type': 'application/json',
7229
+ ...options.headers
7230
+ }
7231
+ });
7232
+ /**
7233
+ * Remove file
7234
+ *
7235
+ * Removes the file from search immediately; does not delete the original File.
7236
+ */
7237
+ export const knowledgeRemoveFile = (options) => (options.client ?? client).delete({
7238
+ security: [{
7239
+ key: 'knowledge-bearerAuth',
7240
+ scheme: 'bearer',
7241
+ type: 'http'
7242
+ }],
7243
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}',
7244
+ ...options
7245
+ });
7246
+ /**
7247
+ * Retrieve file
7248
+ *
7249
+ * Retrieves an attached file using the id returned by attachment or file listing. Poll this operation until status leaves in_progress to observe the ingestion outcome.
7250
+ */
7251
+ export const knowledgeRetrieveFile = (options) => (options.client ?? client).get({
7252
+ security: [{
7253
+ key: 'knowledge-bearerAuth',
7254
+ scheme: 'bearer',
7255
+ type: 'http'
7256
+ }],
7257
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}',
7258
+ ...options
7259
+ });
7260
+ /**
7261
+ * Update file attributes
7262
+ *
7263
+ * Replaces search-filter attributes of an existing attachment without reingesting its content. Use an attached file id. Example body: {"attributes":{"category":"refund"}}; null clears the attributes.
7264
+ */
7265
+ export const knowledgeUpdateFile = (options) => (options.client ?? client).post({
7266
+ security: [{
7267
+ key: 'knowledge-bearerAuth',
7268
+ scheme: 'bearer',
7269
+ type: 'http'
7270
+ }],
7271
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}',
7272
+ ...options,
7273
+ headers: {
7274
+ 'Content-Type': 'application/json',
7275
+ ...options.headers
7276
+ }
7277
+ });
7278
+ /**
7279
+ * Read extracted content
7280
+ *
7281
+ * Extracted text chunks may overlap. Image content can be a generated description rather than verbatim OCR.
7282
+ */
7283
+ export const knowledgeRetrieveFileContent = (options) => (options.client ?? client).get({
7284
+ security: [{
7285
+ key: 'knowledge-bearerAuth',
7286
+ scheme: 'bearer',
7287
+ type: 'http'
7288
+ }],
7289
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}/content',
7290
+ ...options
7291
+ });
7292
+ /**
7293
+ * Create file batch
7294
+ *
7295
+ * Attaches existing Files as a batch for asynchronous ingestion. Supply exactly one of file_ids or files; files allows per-file settings. Existing attachments are reused. Read the returned batch id to monitor status.
7296
+ */
7297
+ export const knowledgeCreateFileBatch = (options) => (options.client ?? client).post({
7298
+ security: [{
7299
+ key: 'knowledge-bearerAuth',
7300
+ scheme: 'bearer',
7301
+ type: 'http'
7302
+ }],
7303
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/file_batches',
7304
+ ...options,
7305
+ headers: {
7306
+ 'Content-Type': 'application/json',
7307
+ ...options.headers
7308
+ }
7309
+ });
7310
+ /**
7311
+ * Retrieve file batch
7312
+ *
7313
+ * Retrieves a batch created in this knowledge base, including current status and file counts. Use the batch id returned by batch creation to monitor ingestion.
7314
+ */
7315
+ export const knowledgeRetrieveFileBatch = (options) => (options.client ?? client).get({
7316
+ security: [{
7317
+ key: 'knowledge-bearerAuth',
7318
+ scheme: 'bearer',
7319
+ type: 'http'
7320
+ }],
7321
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}',
7322
+ ...options
7323
+ });
7324
+ /**
7325
+ * Cancel file batch
7326
+ *
7327
+ * Cancels only in-progress batches and pending files. Completed, failed and cancelled batches return unchanged (200, idempotent).
7328
+ */
7329
+ export const knowledgeCancelFileBatch = (options) => (options.client ?? client).post({
7330
+ security: [{
7331
+ key: 'knowledge-bearerAuth',
7332
+ scheme: 'bearer',
7333
+ type: 'http'
7334
+ }],
7335
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel',
7336
+ ...options
7337
+ });
7338
+ /**
7339
+ * List batch files
7340
+ *
7341
+ * Lists files still attached from the identified batch, newest attachment first by default. Use the batch creation id and ?filter=failed to inspect failures; last_id is the next after cursor.
7342
+ */
7343
+ export const knowledgeListBatchFiles = (options) => (options.client ?? client).get({
7344
+ security: [{
7345
+ key: 'knowledge-bearerAuth',
7346
+ scheme: 'bearer',
7347
+ type: 'http'
7348
+ }],
7349
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files',
7350
+ ...options
7351
+ });
7352
+ /**
7353
+ * Restore knowledge base
7354
+ *
7355
+ * Restores a deleting store within 7 days. Active stores return 409 VECTOR_STORE_INVALID_STATE; absent stores return 404. Empty body is allowed.
7356
+ */
7357
+ export const knowledgeRestoreVectorStore = (options) => (options.client ?? client).post({
7358
+ security: [{
7359
+ key: 'knowledge-bearerAuth',
7360
+ scheme: 'bearer',
7361
+ type: 'http'
7362
+ }],
7363
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/restore',
7364
+ ...options
7365
+ });
7366
+ /**
7367
+ * Permanently purge knowledge base
7368
+ *
7369
+ * Immediately and irreversibly clears a deleting store using the retention cleanup path. Active stores return 409; absent stores return 404. Empty body is allowed.
7370
+ */
7371
+ export const knowledgePurgeVectorStore = (options) => (options.client ?? client).post({
7372
+ security: [{
7373
+ key: 'knowledge-bearerAuth',
7374
+ scheme: 'bearer',
7375
+ type: 'http'
7376
+ }],
7377
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/purge',
7378
+ ...options
7379
+ });
7380
+ /**
7381
+ * Retry failed file
7382
+ *
7383
+ * Retries only failed files; other states return 409 FILE_INVALID_STATE. Retry after failure has not yet been observed in the documented run.
7384
+ */
7385
+ export const knowledgeRetryFile = (options) => (options.client ?? client).post({
7386
+ security: [{
7387
+ key: 'knowledge-bearerAuth',
7388
+ scheme: 'bearer',
7389
+ type: 'http'
7390
+ }],
7391
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}/retry',
7392
+ ...options
7393
+ });
7394
+ /**
7395
+ * List file segments
7396
+ *
7397
+ * Lists the stored chunks of an attached file, ordered by increasing segment index by default. Use the attachment id and last_id as after to continue; returned chunk ids can be retrieved individually.
7398
+ */
7399
+ export const knowledgeListSegments = (options) => (options.client ?? client).get({
7400
+ security: [{
7401
+ key: 'knowledge-bearerAuth',
7402
+ scheme: 'bearer',
7403
+ type: 'http'
7404
+ }],
7405
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}/segments',
7406
+ ...options
7407
+ });
7408
+ /**
7409
+ * Retrieve segment
7410
+ *
7411
+ * Retrieves one chunk and its term statistics. Take chunk_id from segment listing or native search content; the chunk must belong to this knowledge base.
7412
+ */
7413
+ export const knowledgeRetrieveSegment = (options) => (options.client ?? client).get({
7414
+ security: [{
7415
+ key: 'knowledge-bearerAuth',
7416
+ scheme: 'bearer',
7417
+ type: 'http'
7418
+ }],
7419
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/segments/{chunk_id}',
7420
+ ...options
7421
+ });
7422
+ /**
7423
+ * List events
7424
+ *
7425
+ * Reads events for this knowledge base in increasing sequence order, including while soft-deleted. Pass next_seq as after_seq to continue; null next_seq marks the current end. Example: ?after_seq=0&limit=20.
7426
+ */
7427
+ export const knowledgeListEvents = (options) => (options.client ?? client).get({
7428
+ security: [{
7429
+ key: 'knowledge-bearerAuth',
7430
+ scheme: 'bearer',
7431
+ type: 'http'
7432
+ }],
7433
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/events',
7434
+ ...options
7435
+ });
7436
+ /**
7437
+ * List libraries
7438
+ *
7439
+ * List libraries owned by the caller, newest first. By default, deleting and deleted libraries are excluded; use status=deleting to find libraries awaiting purge. All supplied label pairs must match.
7440
+ */
7441
+ export const mediaListLibraries = (options) => (options?.client ?? client).get({
7442
+ security: [{
7443
+ key: 'media-BearerAuth',
7444
+ scheme: 'bearer',
7445
+ type: 'http'
7446
+ }],
7447
+ url: '/media/v1/libraries',
7448
+ ...options
7449
+ });
7450
+ /**
7451
+ * Create library
7452
+ *
7453
+ * Create a library owned by the caller with a name, optional labels and understanding settings. Understanding is enabled by default; the returned id is used for subsequent asset operations.
7454
+ */
7455
+ export const mediaCreateLibrary = (options) => (options.client ?? client).post({
7456
+ security: [{
7457
+ key: 'media-BearerAuth',
7458
+ scheme: 'bearer',
7459
+ type: 'http'
7460
+ }],
7461
+ url: '/media/v1/libraries',
7462
+ ...options,
7463
+ headers: {
7464
+ 'Content-Type': 'application/json',
7465
+ ...options.headers
7466
+ }
7467
+ });
7468
+ /**
7469
+ * Delete library
7470
+ *
7471
+ * Soft-delete an active library, returning its deleting status and purge_at deadline. Asset operations and delivery become unavailable; the library can be restored before purge_at. Repeated deletion while deleting returns the current library.
7472
+ */
7473
+ export const mediaDeleteLibrary = (options) => (options.client ?? client).delete({
7474
+ security: [{
7475
+ key: 'media-BearerAuth',
7476
+ scheme: 'bearer',
7477
+ type: 'http'
7478
+ }],
7479
+ url: '/media/v1/libraries/{library_id}',
7480
+ ...options
7481
+ });
7482
+ /**
7483
+ * Get library
7484
+ *
7485
+ * Read a caller-owned library’s current settings, usage and lifecycle status. A deleting library remains readable; missing, foreign or purged libraries return LIBRARY_NOT_FOUND.
7486
+ */
7487
+ export const mediaGetLibrary = (options) => (options.client ?? client).get({
7488
+ security: [{
7489
+ key: 'media-BearerAuth',
7490
+ scheme: 'bearer',
7491
+ type: 'http'
7492
+ }],
7493
+ url: '/media/v1/libraries/{library_id}',
7494
+ ...options
7495
+ });
7496
+ /**
7497
+ * Update library
7498
+ *
7499
+ * Update an active library’s supplied settings. Labels replace the complete map; understanding settings and model roles merge with current values. Changing the embedding model is rejected while assets exist.
7500
+ */
7501
+ export const mediaUpdateLibrary = (options) => (options.client ?? client).patch({
7502
+ security: [{
7503
+ key: 'media-BearerAuth',
7504
+ scheme: 'bearer',
7505
+ type: 'http'
7506
+ }],
7507
+ url: '/media/v1/libraries/{library_id}',
7508
+ ...options,
7509
+ headers: {
7510
+ 'Content-Type': 'application/json',
7511
+ ...options.headers
7512
+ }
7513
+ });
7514
+ /**
7515
+ * Restore library
7516
+ *
7517
+ * Restore a deleting library before its purge_at deadline. The library becomes active again and deleted_at and purge_at are cleared; expired or non-deleting libraries cannot be restored.
7518
+ */
7519
+ export const mediaRestoreLibrary = (options) => (options.client ?? client).post({
7520
+ security: [{
7521
+ key: 'media-BearerAuth',
7522
+ scheme: 'bearer',
7523
+ type: 'http'
7524
+ }],
7525
+ url: '/media/v1/libraries/{library_id}/restore',
7526
+ ...options
7527
+ });
7528
+ /**
7529
+ * Purge library
7530
+ *
7531
+ * Permanently remove a library that is already deleting, without waiting for purge_at. Its assets and related resources are removed and cannot be restored; first soft-delete an active library.
7532
+ */
7533
+ export const mediaPurgeLibrary = (options) => (options.client ?? client).post({
7534
+ security: [{
7535
+ key: 'media-BearerAuth',
7536
+ scheme: 'bearer',
7537
+ type: 'http'
7538
+ }],
7539
+ url: '/media/v1/libraries/{library_id}/purge',
7540
+ ...options
7541
+ });
7542
+ /**
7543
+ * List assets
7544
+ *
7545
+ * List assets in an active library, newest first, optionally filtering by exact folder and stored resource type. Continue using next_cursor; video includes audio-only assets.
7546
+ */
7547
+ export const mediaListAssets = (options) => (options.client ?? client).get({
7548
+ security: [{
7549
+ key: 'media-BearerAuth',
7550
+ scheme: 'bearer',
7551
+ type: 'http'
7552
+ }],
7553
+ url: '/media/v1/libraries/{library_id}/assets',
7554
+ ...options
7555
+ });
7556
+ /**
7557
+ * Upload asset
7558
+ *
7559
+ * Upload content into an active library and return a Cloudinary-compatible resource. Use file for a multipart file, data URI, public HTTPS URL or same-owner file identifier. Reusing public_id overwrites by default; overwrite=false returns the existing resource. Chunk uploads require both chunk headers.
7560
+ */
7561
+ export const mediaUploadAsset = (options) => (options.client ?? client).post({
7562
+ security: [{
7563
+ key: 'media-BearerAuth',
7564
+ scheme: 'bearer',
7565
+ type: 'http'
7566
+ }],
7567
+ url: '/media/v1/libraries/{library_id}/assets',
7568
+ ...options,
7569
+ headers: {
7570
+ 'Content-Type': 'application/json',
7571
+ ...options.headers
7572
+ }
7573
+ });
7574
+ /**
7575
+ * Import file
7576
+ *
7577
+ * Copy source content into an active library using upload options and return the full native Asset. The imported asset is independent of the source after copying. Reusing public_id follows overwrite semantics.
7578
+ */
7579
+ export const mediaImportAsset = (options) => (options.client ?? client).post({
7580
+ security: [{
7581
+ key: 'media-BearerAuth',
7582
+ scheme: 'bearer',
7583
+ type: 'http'
7584
+ }],
7585
+ url: '/media/v1/libraries/{library_id}/assets/import',
7586
+ ...options,
7587
+ headers: {
7588
+ 'Content-Type': 'application/json',
7589
+ ...options.headers
7590
+ }
7591
+ });
7592
+ /**
7593
+ * Delete asset
7594
+ *
7595
+ * Delete an asset from the library so it is no longer readable, searchable or deliverable. This removes the asset rather than placing it in the library’s restoration window; a missing asset returns ASSET_NOT_FOUND.
7596
+ */
7597
+ export const mediaDeleteAsset = (options) => (options.client ?? client).delete({
7598
+ security: [{
7599
+ key: 'media-BearerAuth',
7600
+ scheme: 'bearer',
7601
+ type: 'http'
7602
+ }],
7603
+ url: '/media/v1/libraries/{library_id}/assets/{asset_id}',
7604
+ ...options
7605
+ });
7606
+ /**
7607
+ * Get asset
7608
+ *
7609
+ * Read a non-deleted asset by its asset_id in an active library, including content hashes, processing progress and available previews. Missing or deleted assets return ASSET_NOT_FOUND.
7610
+ */
7611
+ export const mediaGetAsset = (options) => (options.client ?? client).get({
7612
+ security: [{
7613
+ key: 'media-BearerAuth',
7614
+ scheme: 'bearer',
7615
+ type: 'http'
7616
+ }],
7617
+ url: '/media/v1/libraries/{library_id}/assets/{asset_id}',
7618
+ ...options
7619
+ });
7620
+ /**
7621
+ * Update asset
7622
+ *
7623
+ * Update an asset’s supplied metadata fields. Tags and context replace their current collections; an empty collection clears them. Moving asset_folder or changing display_name preserves public_id and delivery URLs.
7624
+ */
7625
+ export const mediaUpdateAsset = (options) => (options.client ?? client).patch({
7626
+ security: [{
7627
+ key: 'media-BearerAuth',
7628
+ scheme: 'bearer',
7629
+ type: 'http'
7630
+ }],
7631
+ url: '/media/v1/libraries/{library_id}/assets/{asset_id}',
7632
+ ...options,
7633
+ headers: {
7634
+ 'Content-Type': 'application/json',
7635
+ ...options.headers
7636
+ }
7637
+ });
7638
+ /**
7639
+ * Reprocess asset
7640
+ *
7641
+ * Queue reprocessing of the asset’s current version and return its updated state immediately. Omit kinds to retry failed tasks; explicit kinds rerun applicable completed tasks. Replaced understandings become superseded, and processing finishes asynchronously.
7642
+ */
7643
+ export const mediaReprocessAsset = (options) => (options.client ?? client).post({
7644
+ security: [{
7645
+ key: 'media-BearerAuth',
7646
+ scheme: 'bearer',
7647
+ type: 'http'
7648
+ }],
7649
+ url: '/media/v1/libraries/{library_id}/assets/{asset_id}/reprocess',
7650
+ ...options,
7651
+ headers: {
7652
+ 'Content-Type': 'application/json',
7653
+ ...options.headers
7654
+ }
7655
+ });
7656
+ /**
7657
+ * List understandings
7658
+ *
7659
+ * List an asset’s understanding results in creation order. By default only current, non-superseded results are returned; use include_superseded=true for history or kind to select an output type.
7660
+ */
7661
+ export const mediaListUnderstandings = (options) => (options.client ?? client).get({
7662
+ security: [{
7663
+ key: 'media-BearerAuth',
7664
+ scheme: 'bearer',
7665
+ type: 'http'
7666
+ }],
7667
+ url: '/media/v1/libraries/{library_id}/assets/{asset_id}/understandings',
7668
+ ...options
7669
+ });
7670
+ /**
7671
+ * Expression search
7672
+ *
7673
+ * Search active assets using the supported filter-expression syntax, sorting and cursor pagination. Empty expression matches all assets. Tags and context require with_field; inspect the exactness flags before treating counts as complete.
7674
+ */
7675
+ export const mediaExpressionSearch = (options) => (options.client ?? client).post({
7676
+ security: [{
7677
+ key: 'media-BearerAuth',
7678
+ scheme: 'bearer',
7679
+ type: 'http'
7680
+ }],
7681
+ url: '/media/v1/libraries/{library_id}/search/expression',
7682
+ ...options,
7683
+ headers: {
7684
+ 'Content-Type': 'application/json',
7685
+ ...options.headers
7686
+ }
7687
+ });
7688
+ /**
7689
+ * Visual search
7690
+ *
7691
+ * Find visually similar assets using exactly one of asset_id or an inline base64 image. The library must support image search; an asset query needs a current image embedding and excludes that source asset from results.
7692
+ */
7693
+ export const mediaVisualSearch = (options) => (options.client ?? client).post({
7694
+ security: [{
7695
+ key: 'media-BearerAuth',
7696
+ scheme: 'bearer',
7697
+ type: 'http'
7698
+ }],
7699
+ url: '/media/v1/libraries/{library_id}/search/visual',
7700
+ ...options,
7701
+ headers: {
7702
+ 'Content-Type': 'application/json',
7703
+ ...options.headers
7704
+ }
7705
+ });
7706
+ /**
7707
+ * Semantic search
7708
+ *
7709
+ * Search assets with a nonblank text query and optional expression filter. Hybrid mode combines semantic and keyword matches; semantic mode uses vector similarity only. Results are ranked and limited by top_k.
7710
+ */
7711
+ export const mediaSemanticSearch = (options) => (options.client ?? client).post({
7712
+ security: [{
7713
+ key: 'media-BearerAuth',
7714
+ scheme: 'bearer',
7715
+ type: 'http'
7716
+ }],
7717
+ url: '/media/v1/libraries/{library_id}/search/semantic',
7718
+ ...options,
7719
+ headers: {
7720
+ 'Content-Type': 'application/json',
7721
+ ...options.headers
7722
+ }
7723
+ });
7724
+ /**
7725
+ * Semantic search alias
7726
+ *
7727
+ * Alias of semantic search. Search assets with a nonblank text query, optional expression filter and top_k; hybrid combines semantic and keyword matches, while semantic uses vector similarity only.
7728
+ */
7729
+ export const mediaSearch = (options) => (options.client ?? client).post({
7730
+ security: [{
7731
+ key: 'media-BearerAuth',
7732
+ scheme: 'bearer',
7733
+ type: 'http'
7734
+ }],
7735
+ url: '/media/v1/libraries/{library_id}/search',
7736
+ ...options,
7737
+ headers: {
7738
+ 'Content-Type': 'application/json',
7739
+ ...options.headers
7740
+ }
7741
+ });
7742
+ /**
7743
+ * List folders
7744
+ *
7745
+ * List all immediate child folders under parent, or under the root when parent is omitted. Counts include descendant assets. The result is unpaginated; limit and cursor are rejected.
7746
+ */
7747
+ export const mediaListFolders = (options) => (options.client ?? client).get({
7748
+ security: [{
7749
+ key: 'media-BearerAuth',
7750
+ scheme: 'bearer',
7751
+ type: 'http'
7752
+ }],
7753
+ url: '/media/v1/libraries/{library_id}/folders',
7754
+ ...options
7755
+ });
7756
+ /**
7757
+ * Create batch
7758
+ *
7759
+ * Create an asynchronous batch for tagging, untagging, replacing context, moving or deleting assets. Select ids or an expression; selection is frozen at creation. Poll the returned job id for completion and per-item failures.
7760
+ */
7761
+ export const mediaCreateBatch = (options) => (options.client ?? client).post({
7762
+ security: [{
7763
+ key: 'media-BearerAuth',
7764
+ scheme: 'bearer',
7765
+ type: 'http'
7766
+ }],
7767
+ url: '/media/v1/libraries/{library_id}/batches',
7768
+ ...options,
7769
+ headers: {
7770
+ 'Content-Type': 'application/json',
7771
+ ...options.headers
7772
+ }
7773
+ });
7774
+ /**
7775
+ * Get batch
7776
+ *
7777
+ * Read a batch job’s status, successful and failed item counts, and a bounded list of failed items. Use the id returned by batch creation; a job outside this library is not found.
7778
+ */
7779
+ export const mediaGetBatch = (options) => (options.client ?? client).get({
7780
+ security: [{
7781
+ key: 'media-BearerAuth',
7782
+ scheme: 'bearer',
7783
+ type: 'http'
7784
+ }],
7785
+ url: '/media/v1/libraries/{library_id}/batches/{job_id}',
7786
+ ...options
7787
+ });
7788
+ /**
7789
+ * Batch assets alias
7790
+ *
7791
+ * Alias of batch creation. Apply one metadata or deletion action to ids or a frozen expression selection asynchronously; poll the returned job id to inspect completion and item failures.
7792
+ */
7793
+ export const mediaBatchAssets = (options) => (options.client ?? client).post({
7794
+ security: [{
7795
+ key: 'media-BearerAuth',
7796
+ scheme: 'bearer',
7797
+ type: 'http'
7798
+ }],
7799
+ url: '/media/v1/libraries/{library_id}/assets:batch',
7800
+ ...options,
7801
+ headers: {
7802
+ 'Content-Type': 'application/json',
7803
+ ...options.headers
7804
+ }
7805
+ });
7806
+ /**
7807
+ * Get job alias
7808
+ *
7809
+ * Alias of batch retrieval. Read the job returned by a batch request, including terminal status, successful and failed counts, and individual failure codes.
7810
+ */
7811
+ export const mediaGetJob = (options) => (options.client ?? client).get({
7812
+ security: [{
7813
+ key: 'media-BearerAuth',
7814
+ scheme: 'bearer',
7815
+ type: 'http'
7816
+ }],
7817
+ url: '/media/v1/libraries/{library_id}/jobs/{job_id}',
7818
+ ...options
7819
+ });
7820
+ /**
7821
+ * List events
7822
+ *
7823
+ * Read library events in sequence order, including while the library is deleting. Page forward with asc and after_seq, or backward with desc and before_seq; never combine the two sequence cursors.
7824
+ */
7825
+ export const mediaListEvents = (options) => (options.client ?? client).get({
7826
+ security: [{
7827
+ key: 'media-BearerAuth',
7828
+ scheme: 'bearer',
7829
+ type: 'http'
7830
+ }],
7831
+ url: '/media/v1/libraries/{library_id}/events',
7832
+ ...options
7833
+ });
7834
+ /**
7835
+ * Create delivery token
7836
+ *
7837
+ * 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 900 seconds; narrow acl and expires_in before sharing. Anyone holding the token can read matching paths until expires_at.
7838
+ */
7839
+ export const mediaCreateDeliveryToken = (options) => (options.client ?? client).post({
7840
+ security: [{
7841
+ key: 'media-BearerAuth',
7842
+ scheme: 'bearer',
7843
+ type: 'http'
7844
+ }],
7845
+ url: '/media/v1/libraries/{library_id}/delivery_tokens',
7846
+ ...options,
7847
+ headers: {
7848
+ 'Content-Type': 'application/json',
7849
+ ...options.headers
7850
+ }
7851
+ });
7852
+ /**
7853
+ * List sandboxes (v2)
7854
+ *
7855
+ * List your running and paused sandboxes with paging and filters. Use it to find a sandboxID before connecting to, pausing or killing a sandbox. Filter by state, template (id or alias), name, metadata (key=value pairs joined with &) and startedAfter; order sorts by start time (default newest first); limit is 1 to 100 (default 100). When more results exist the response carries an x-next-token header; send it back as nextToken for the next page. To read one sandbox use getSandbox.
7856
+ */
7857
+ export const getSandboxV1Sandboxes = (options) => (options?.client ?? client).get({
7858
+ querySerializer: { parameters: { state: { array: { explode: false } } } },
7859
+ security: [
7860
+ {
7861
+ key: 'sandbox-ApiKeyAuth',
7862
+ name: 'X-API-Key',
7863
+ type: 'apiKey'
7864
+ },
7865
+ {
7866
+ key: 'sandbox-AuthProviderBearerAuth',
7867
+ scheme: 'bearer',
7868
+ type: 'http'
7869
+ },
7870
+ {
7871
+ key: 'sandbox-AuthProviderTeamAuth',
7872
+ name: 'X-Team-ID',
7873
+ type: 'apiKey'
7874
+ },
7875
+ { name: 'X-Admin-Token', type: 'apiKey' },
7876
+ {
7877
+ key: 'sandbox-AdminTeamAuth',
7878
+ name: 'X-Team-ID',
7879
+ type: 'apiKey'
7880
+ },
7881
+ {
7882
+ key: 'sandbox-AdminJWTAuth',
7883
+ scheme: 'bearer',
7884
+ type: 'http'
7885
+ }
7886
+ ],
7887
+ url: '/sandbox/v1/sandboxes',
7888
+ ...options
7889
+ });
7890
+ /**
7891
+ * Create sandbox (v2)
7892
+ *
7893
+ * Create a sandbox from the template. All system communication with the sandbox is secured.
7894
+ */
7895
+ export const postSandboxV1Sandboxes = (options) => (options.client ?? client).post({
7896
+ security: [
7897
+ {
7898
+ key: 'sandbox-ApiKeyAuth',
7899
+ name: 'X-API-Key',
7900
+ type: 'apiKey'
7901
+ },
7902
+ {
7903
+ key: 'sandbox-AuthProviderBearerAuth',
7904
+ scheme: 'bearer',
7905
+ type: 'http'
7906
+ },
7907
+ {
7908
+ key: 'sandbox-AuthProviderTeamAuth',
7909
+ name: 'X-Team-ID',
7910
+ type: 'apiKey'
7911
+ },
7912
+ { name: 'X-Admin-Token', type: 'apiKey' },
7913
+ {
7914
+ key: 'sandbox-AdminTeamAuth',
7915
+ name: 'X-Team-ID',
7916
+ type: 'apiKey'
7917
+ },
7918
+ {
7919
+ key: 'sandbox-AdminJWTAuth',
7920
+ scheme: 'bearer',
7921
+ type: 'http'
7922
+ }
7923
+ ],
7924
+ url: '/sandbox/v1/sandboxes',
7925
+ ...options,
7926
+ headers: {
7927
+ 'Content-Type': 'application/json',
7928
+ ...options.headers
7929
+ }
7930
+ });
7931
+ /**
7932
+ * Sandbox metrics
7933
+ *
7934
+ * Read CPU, memory and disk usage samples of a sandbox over a time window. Use it to size a sandbox or find out why it is slow. start and end are Unix timestamps in seconds; without them the recent samples are returned. An unknown id answers 404.
7935
+ */
7936
+ export const getSandboxV1SandboxesBySandboxIdMetrics = (options) => (options.client ?? client).get({
7937
+ security: [
7938
+ {
7939
+ key: 'sandbox-ApiKeyAuth',
7940
+ name: 'X-API-Key',
7941
+ type: 'apiKey'
7942
+ },
7943
+ {
7944
+ key: 'sandbox-AuthProviderBearerAuth',
7945
+ scheme: 'bearer',
7946
+ type: 'http'
7947
+ },
7948
+ {
7949
+ key: 'sandbox-AuthProviderTeamAuth',
7950
+ name: 'X-Team-ID',
7951
+ type: 'apiKey'
7952
+ },
7953
+ { name: 'X-Admin-Token', type: 'apiKey' },
7954
+ {
7955
+ key: 'sandbox-AdminTeamAuth',
7956
+ name: 'X-Team-ID',
7957
+ type: 'apiKey'
7958
+ },
7959
+ {
7960
+ key: 'sandbox-AdminJWTAuth',
7961
+ scheme: 'bearer',
7962
+ type: 'http'
7963
+ }
7964
+ ],
7965
+ url: '/sandbox/v1/sandboxes/{sandboxID}/metrics',
7966
+ ...options
7967
+ });
7968
+ /**
7969
+ * Pause sandbox
7970
+ *
7971
+ * Pause a running sandbox, keeping its files and memory so that connectSandbox can resume it later. Use it to stop paying for compute without losing state; to discard the sandbox use killSandbox. Success answers 204. A sandbox that is not running answers 409.
7972
+ */
7973
+ export const postSandboxV1SandboxesBySandboxIdPause = (options) => (options.client ?? client).post({
7974
+ security: [
7975
+ {
7976
+ key: 'sandbox-ApiKeyAuth',
7977
+ name: 'X-API-Key',
7978
+ type: 'apiKey'
7979
+ },
7980
+ {
7981
+ key: 'sandbox-AuthProviderBearerAuth',
7982
+ scheme: 'bearer',
7983
+ type: 'http'
7984
+ },
7985
+ {
7986
+ key: 'sandbox-AuthProviderTeamAuth',
7987
+ name: 'X-Team-ID',
7988
+ type: 'apiKey'
7989
+ },
7990
+ { name: 'X-Admin-Token', type: 'apiKey' },
7991
+ {
7992
+ key: 'sandbox-AdminTeamAuth',
7993
+ name: 'X-Team-ID',
7994
+ type: 'apiKey'
7995
+ },
7996
+ {
7997
+ key: 'sandbox-AdminJWTAuth',
7998
+ scheme: 'bearer',
7999
+ type: 'http'
8000
+ }
8001
+ ],
8002
+ url: '/sandbox/v1/sandboxes/{sandboxID}/pause',
8003
+ ...options,
8004
+ headers: {
8005
+ 'Content-Type': 'application/json',
8006
+ ...options.headers
8007
+ }
8008
+ });
8009
+ /**
8010
+ * Set sandbox timeout
8011
+ *
8012
+ * Set the timeout for the sandbox. The sandbox will expire x seconds from the time of the request. Calling this method multiple times overwrites the TTL, each time using the current timestamp as the starting point to measure the timeout duration.
8013
+ */
8014
+ export const postSandboxV1SandboxesBySandboxIdTimeout = (options) => (options.client ?? client).post({
8015
+ security: [
8016
+ {
8017
+ key: 'sandbox-ApiKeyAuth',
8018
+ name: 'X-API-Key',
8019
+ type: 'apiKey'
8020
+ },
8021
+ {
8022
+ key: 'sandbox-AuthProviderBearerAuth',
8023
+ scheme: 'bearer',
8024
+ type: 'http'
8025
+ },
8026
+ {
8027
+ key: 'sandbox-AuthProviderTeamAuth',
8028
+ name: 'X-Team-ID',
8029
+ type: 'apiKey'
8030
+ },
8031
+ { name: 'X-Admin-Token', type: 'apiKey' },
8032
+ {
8033
+ key: 'sandbox-AdminTeamAuth',
8034
+ name: 'X-Team-ID',
8035
+ type: 'apiKey'
8036
+ },
8037
+ {
8038
+ key: 'sandbox-AdminJWTAuth',
8039
+ scheme: 'bearer',
8040
+ type: 'http'
8041
+ }
8042
+ ],
8043
+ url: '/sandbox/v1/sandboxes/{sandboxID}/timeout',
8044
+ ...options,
8045
+ headers: {
8046
+ 'Content-Type': 'application/json',
8047
+ ...options.headers
8048
+ }
8049
+ });
8050
+ /**
8051
+ * Connect sandbox (v2)
8052
+ *
8053
+ * Returns sandbox details. If the sandbox is paused, it will be resumed. TTL is only extended. The request body is optional; an omitted timeout defaults to 300 seconds.
8054
+ */
8055
+ export const postSandboxV1SandboxesBySandboxIdConnect = (options) => (options.client ?? client).post({
8056
+ security: [
8057
+ {
8058
+ key: 'sandbox-ApiKeyAuth',
8059
+ name: 'X-API-Key',
8060
+ type: 'apiKey'
8061
+ },
8062
+ {
8063
+ key: 'sandbox-AuthProviderBearerAuth',
8064
+ scheme: 'bearer',
8065
+ type: 'http'
8066
+ },
8067
+ {
8068
+ key: 'sandbox-AuthProviderTeamAuth',
8069
+ name: 'X-Team-ID',
8070
+ type: 'apiKey'
8071
+ },
8072
+ { name: 'X-Admin-Token', type: 'apiKey' },
8073
+ {
8074
+ key: 'sandbox-AdminTeamAuth',
8075
+ name: 'X-Team-ID',
8076
+ type: 'apiKey'
8077
+ },
8078
+ {
8079
+ key: 'sandbox-AdminJWTAuth',
6290
8080
  scheme: 'bearer',
6291
8081
  type: 'http'
6292
- }],
6293
- url: '/media/v1/libraries/{library_id}/assets:batch',
8082
+ }
8083
+ ],
8084
+ url: '/sandbox/v1/sandboxes/{sandboxID}/connect',
6294
8085
  ...options,
6295
8086
  headers: {
6296
8087
  'Content-Type': 'application/json',
@@ -6298,40 +8089,89 @@ export const mediaBatchAssets = (options) => (options.client ?? client).post({
6298
8089
  }
6299
8090
  });
6300
8091
  /**
6301
- * Get job alias
8092
+ * List templates (v2)
6302
8093
  *
6303
- * Alias of batch retrieval. Read the job returned by a batch request, including terminal status, successful and failed counts, and individual failure codes.
8094
+ * List official templates and all your custom templates, including waiting, building, ready and error builds. Custom templates appear first; each custom row describes its latest build, not necessarily the current ready build. Use templateID for build management and a ready template name when creating a sandbox. Own-face official distinguishes public catalog entries; sourceKind is omitted until a source is submitted and on official templates. Other organizations' templates are invisible.
6304
8095
  */
6305
- export const mediaGetJob = (options) => (options.client ?? client).get({
6306
- security: [{
6307
- key: 'media-BearerAuth',
8096
+ export const listSandboxTemplates = (options) => (options?.client ?? client).get({
8097
+ security: [
8098
+ {
8099
+ key: 'sandbox-ApiKeyAuth',
8100
+ name: 'X-API-Key',
8101
+ type: 'apiKey'
8102
+ },
8103
+ {
8104
+ key: 'sandbox-AuthProviderBearerAuth',
6308
8105
  scheme: 'bearer',
6309
8106
  type: 'http'
6310
- }],
6311
- url: '/media/v1/libraries/{library_id}/jobs/{job_id}',
8107
+ },
8108
+ {
8109
+ key: 'sandbox-AuthProviderTeamAuth',
8110
+ name: 'X-Team-ID',
8111
+ type: 'apiKey'
8112
+ },
8113
+ { name: 'X-Admin-Token', type: 'apiKey' },
8114
+ {
8115
+ key: 'sandbox-AdminTeamAuth',
8116
+ name: 'X-Team-ID',
8117
+ type: 'apiKey'
8118
+ },
8119
+ {
8120
+ key: 'sandbox-AdminJWTAuth',
8121
+ scheme: 'bearer',
8122
+ type: 'http'
8123
+ }
8124
+ ],
8125
+ url: '/sandbox/v1/templates',
6312
8126
  ...options
6313
8127
  });
6314
8128
  /**
6315
- * List events
8129
+ * Create template (v3)
6316
8130
  *
6317
- * Read library events in sequence order, including while the library is deleting. Page forward with asc and after_seq, or backward with desc and before_seq; never combine the two sequence cursors.
8131
+ * Reserve a waiting build before submitting its source. Reusing a name in your organization allocates a new build on the same template. Returns templateID and buildID; start it with templates.builds.update, then poll templates.builds.status.list. A name:tag suffix and tags are assigned after successful publication. Example: {"name":"my-template","cpuCount":2,"memoryMB":2048}. The own face also accepts diskGb, a positive integer defaulting to 10 GiB.
6318
8132
  */
6319
- export const mediaListEvents = (options) => (options.client ?? client).get({
6320
- security: [{
6321
- key: 'media-BearerAuth',
8133
+ export const requestTemplateBuild = (options) => (options.client ?? client).post({
8134
+ security: [
8135
+ {
8136
+ key: 'sandbox-ApiKeyAuth',
8137
+ name: 'X-API-Key',
8138
+ type: 'apiKey'
8139
+ },
8140
+ {
8141
+ key: 'sandbox-AuthProviderBearerAuth',
6322
8142
  scheme: 'bearer',
6323
8143
  type: 'http'
6324
- }],
6325
- url: '/media/v1/libraries/{library_id}/events',
6326
- ...options
8144
+ },
8145
+ {
8146
+ key: 'sandbox-AuthProviderTeamAuth',
8147
+ name: 'X-Team-ID',
8148
+ type: 'apiKey'
8149
+ },
8150
+ { name: 'X-Admin-Token', type: 'apiKey' },
8151
+ {
8152
+ key: 'sandbox-AdminTeamAuth',
8153
+ name: 'X-Team-ID',
8154
+ type: 'apiKey'
8155
+ },
8156
+ {
8157
+ key: 'sandbox-AdminJWTAuth',
8158
+ scheme: 'bearer',
8159
+ type: 'http'
8160
+ }
8161
+ ],
8162
+ url: '/sandbox/v1/templates',
8163
+ ...options,
8164
+ headers: {
8165
+ 'Content-Type': 'application/json',
8166
+ ...options.headers
8167
+ }
6327
8168
  });
6328
8169
  /**
6329
- * List sandboxes (v2)
8170
+ * List team volumes
6330
8171
  *
6331
- * List your running and paused sandboxes with paging and filters. Use it to find a sandboxID before connecting to, pausing or killing a sandbox. Filter by state, template (id or alias), name, metadata (key=value pairs joined with &) and startedAfter; order sorts by start time (default newest first); limit is 1 to 100 (default 100). When more results exist the response carries an x-next-token header; send it back as nextToken for the next page. To read one sandbox use getSandbox.
8172
+ * List the volumes of your team. Use it to find a volumeID before reading or deleting a volume, or to attach a volume to a sandbox by name when you create it.
6332
8173
  */
6333
- export const getSandboxV1Sandboxes = (options) => (options?.client ?? client).get({
6334
- querySerializer: { parameters: { state: { array: { explode: false } } } },
8174
+ export const getSandboxV1Volumes = (options) => (options?.client ?? client).get({
6335
8175
  security: [
6336
8176
  {
6337
8177
  key: 'sandbox-ApiKeyAuth',
@@ -6360,15 +8200,15 @@ export const getSandboxV1Sandboxes = (options) => (options?.client ?? client).ge
6360
8200
  type: 'http'
6361
8201
  }
6362
8202
  ],
6363
- url: '/sandbox/v1/sandboxes',
8203
+ url: '/sandbox/v1/volumes',
6364
8204
  ...options
6365
8205
  });
6366
8206
  /**
6367
- * Create sandbox (v2)
8207
+ * Create team volume
6368
8208
  *
6369
- * Create a sandbox from the template. All system communication with the sandbox is secured.
8209
+ * Create a team volume: persistent storage that can be mounted into sandboxes and outlives them. Send the volume name; the response returns the volume id and name. Use getVolume to read it back and deleteVolume to remove it.
6370
8210
  */
6371
- export const postSandboxV1Sandboxes = (options) => (options.client ?? client).post({
8211
+ export const postSandboxV1Volumes = (options) => (options.client ?? client).post({
6372
8212
  security: [
6373
8213
  {
6374
8214
  key: 'sandbox-ApiKeyAuth',
@@ -6397,7 +8237,7 @@ export const postSandboxV1Sandboxes = (options) => (options.client ?? client).po
6397
8237
  type: 'http'
6398
8238
  }
6399
8239
  ],
6400
- url: '/sandbox/v1/sandboxes',
8240
+ url: '/sandbox/v1/volumes',
6401
8241
  ...options,
6402
8242
  headers: {
6403
8243
  'Content-Type': 'application/json',
@@ -6405,11 +8245,11 @@ export const postSandboxV1Sandboxes = (options) => (options.client ?? client).po
6405
8245
  }
6406
8246
  });
6407
8247
  /**
6408
- * Sandbox metrics
8248
+ * Delete team volume
6409
8249
  *
6410
- * Read CPU, memory and disk usage samples of a sandbox over a time window. Use it to size a sandbox or find out why it is slow. start and end are Unix timestamps in seconds; without them the recent samples are returned. An unknown id answers 404.
8250
+ * Delete a team volume and its data permanently. Use it only when no sandbox needs the volume any more; the data cannot be recovered. Success answers 204; an unknown id answers 404.
6411
8251
  */
6412
- export const getSandboxV1SandboxesBySandboxIdMetrics = (options) => (options.client ?? client).get({
8252
+ export const deleteSandboxV1VolumesByVolumeId = (options) => (options.client ?? client).delete({
6413
8253
  security: [
6414
8254
  {
6415
8255
  key: 'sandbox-ApiKeyAuth',
@@ -6438,15 +8278,15 @@ export const getSandboxV1SandboxesBySandboxIdMetrics = (options) => (options.cli
6438
8278
  type: 'http'
6439
8279
  }
6440
8280
  ],
6441
- url: '/sandbox/v1/sandboxes/{sandboxID}/metrics',
8281
+ url: '/sandbox/v1/volumes/{volumeID}',
6442
8282
  ...options
6443
8283
  });
6444
8284
  /**
6445
- * Pause sandbox
8285
+ * Team volume
6446
8286
  *
6447
- * Pause a running sandbox, keeping its files and memory so that connectSandbox can resume it later. Use it to stop paying for compute without losing state; to discard the sandbox use killSandbox. Success answers 204. A sandbox that is not running answers 409.
8287
+ * Read one team volume by id. Use it to confirm a volume exists and to read its name before mounting it in a sandbox. An unknown id answers 404.
6448
8288
  */
6449
- export const postSandboxV1SandboxesBySandboxIdPause = (options) => (options.client ?? client).post({
8289
+ export const getSandboxV1VolumesByVolumeId = (options) => (options.client ?? client).get({
6450
8290
  security: [
6451
8291
  {
6452
8292
  key: 'sandbox-ApiKeyAuth',
@@ -6475,19 +8315,15 @@ export const postSandboxV1SandboxesBySandboxIdPause = (options) => (options.clie
6475
8315
  type: 'http'
6476
8316
  }
6477
8317
  ],
6478
- url: '/sandbox/v1/sandboxes/{sandboxID}/pause',
6479
- ...options,
6480
- headers: {
6481
- 'Content-Type': 'application/json',
6482
- ...options.headers
6483
- }
8318
+ url: '/sandbox/v1/volumes/{volumeID}',
8319
+ ...options
6484
8320
  });
6485
8321
  /**
6486
- * Set sandbox timeout
8322
+ * Fork sandbox
6487
8323
  *
6488
- * Set the timeout for the sandbox. The sandbox will expire x seconds from the time of the request. Calling this method multiple times overwrites the TTL, each time using the current timestamp as the starting point to measure the timeout duration.
8324
+ * Fork the sandbox: checkpoint the running sandbox in place (it is briefly paused, snapshotted with its full memory state, and resumed on its node, keeping its ID and expiration untouched) and create count new sandboxes from that snapshot. Returns one result per requested fork, each carrying either the created sandbox or the error that prevented it from starting. A non-201 status means the request failed before any fork was attempted.
6489
8325
  */
6490
- export const postSandboxV1SandboxesBySandboxIdTimeout = (options) => (options.client ?? client).post({
8326
+ export const postSandboxV1SandboxesBySandboxIdFork = (options) => (options.client ?? client).post({
6491
8327
  security: [
6492
8328
  {
6493
8329
  key: 'sandbox-ApiKeyAuth',
@@ -6516,7 +8352,7 @@ export const postSandboxV1SandboxesBySandboxIdTimeout = (options) => (options.cl
6516
8352
  type: 'http'
6517
8353
  }
6518
8354
  ],
6519
- url: '/sandbox/v1/sandboxes/{sandboxID}/timeout',
8355
+ url: '/sandbox/v1/sandboxes/{sandboxID}/fork',
6520
8356
  ...options,
6521
8357
  headers: {
6522
8358
  'Content-Type': 'application/json',
@@ -6524,11 +8360,11 @@ export const postSandboxV1SandboxesBySandboxIdTimeout = (options) => (options.cl
6524
8360
  }
6525
8361
  });
6526
8362
  /**
6527
- * Connect sandbox (v2)
8363
+ * Create snapshot
6528
8364
  *
6529
- * Returns sandbox details. If the sandbox is paused, it will be resumed. TTL is only extended. The request body is optional; an omitted timeout defaults to 300 seconds.
8365
+ * Create a persistent snapshot from the sandbox's current state. Snapshots can be used to create new sandboxes and persist beyond the original sandbox's lifetime.
6530
8366
  */
6531
- export const postSandboxV1SandboxesBySandboxIdConnect = (options) => (options.client ?? client).post({
8367
+ export const postSandboxV1SandboxesBySandboxIdSnapshots = (options) => (options.client ?? client).post({
6532
8368
  security: [
6533
8369
  {
6534
8370
  key: 'sandbox-ApiKeyAuth',
@@ -6557,7 +8393,7 @@ export const postSandboxV1SandboxesBySandboxIdConnect = (options) => (options.cl
6557
8393
  type: 'http'
6558
8394
  }
6559
8395
  ],
6560
- url: '/sandbox/v1/sandboxes/{sandboxID}/connect',
8396
+ url: '/sandbox/v1/sandboxes/{sandboxID}/snapshots',
6561
8397
  ...options,
6562
8398
  headers: {
6563
8399
  'Content-Type': 'application/json',
@@ -6565,11 +8401,11 @@ export const postSandboxV1SandboxesBySandboxIdConnect = (options) => (options.cl
6565
8401
  }
6566
8402
  });
6567
8403
  /**
6568
- * List templates (v2)
8404
+ * List snapshots
6569
8405
  *
6570
- * List the templates you can create sandboxes from. Use it to pick the template id or alias for createSandbox. `base` is the default template that createSandbox uses when templateID is omitted. limit is 1 to 100 (default 100); send the cursor from the response back as nextToken to continue.
8406
+ * List the snapshots you created, one cursor page at a time. Use it to find a snapshot id before you create a sandbox from it or delete it. Filter by sandboxID (the source sandbox) or by name or snapshot id, optionally tag-qualified; limit is 1 to 100 (default 100). When more results exist send the cursor from the response back as nextToken.
6571
8407
  */
6572
- export const getSandboxV1Templates = (options) => (options?.client ?? client).get({
8408
+ export const getSandboxV1Snapshots = (options) => (options?.client ?? client).get({
6573
8409
  security: [
6574
8410
  {
6575
8411
  key: 'sandbox-ApiKeyAuth',
@@ -6598,15 +8434,15 @@ export const getSandboxV1Templates = (options) => (options?.client ?? client).ge
6598
8434
  type: 'http'
6599
8435
  }
6600
8436
  ],
6601
- url: '/sandbox/v1/templates',
8437
+ url: '/sandbox/v1/snapshots',
6602
8438
  ...options
6603
8439
  });
6604
8440
  /**
6605
- * List team volumes
8441
+ * Delete template
6606
8442
  *
6607
- * List the volumes of your team. Use it to find a volumeID before reading or deleting a volume, or to attach a volume to a sandbox by name when you create it.
8443
+ * Delete one of your snapshots. Sandboxes already created from it keep running; no new sandbox can be created from it afterwards. Success answers 204. A snapshot that does not exist or belongs to someone else answers 404.
6608
8444
  */
6609
- export const getSandboxV1Volumes = (options) => (options?.client ?? client).get({
8445
+ export const deleteSandboxV1SnapshotsBySnapshotId = (options) => (options.client ?? client).delete({
6610
8446
  security: [
6611
8447
  {
6612
8448
  key: 'sandbox-ApiKeyAuth',
@@ -6635,15 +8471,15 @@ export const getSandboxV1Volumes = (options) => (options?.client ?? client).get(
6635
8471
  type: 'http'
6636
8472
  }
6637
8473
  ],
6638
- url: '/sandbox/v1/volumes',
8474
+ url: '/sandbox/v1/snapshots/{snapshotID}',
6639
8475
  ...options
6640
8476
  });
6641
8477
  /**
6642
- * Create team volume
8478
+ * Update sandbox network
6643
8479
  *
6644
- * Create a team volume: persistent storage that can be mounted into sandboxes and outlives them. Send the volume name; the response returns the volume id and name. Use getVolume to read it back and deleteVolume to remove it.
8480
+ * Update the network configuration for a running sandbox. Replaces the current egress rules with the provided configuration. Omitting field clears it.
6645
8481
  */
6646
- export const postSandboxV1Volumes = (options) => (options.client ?? client).post({
8482
+ export const putSandboxV1SandboxesBySandboxIdNetwork = (options) => (options.client ?? client).put({
6647
8483
  security: [
6648
8484
  {
6649
8485
  key: 'sandbox-ApiKeyAuth',
@@ -6672,7 +8508,7 @@ export const postSandboxV1Volumes = (options) => (options.client ?? client).post
6672
8508
  type: 'http'
6673
8509
  }
6674
8510
  ],
6675
- url: '/sandbox/v1/volumes',
8511
+ url: '/sandbox/v1/sandboxes/{sandboxID}/network',
6676
8512
  ...options,
6677
8513
  headers: {
6678
8514
  'Content-Type': 'application/json',
@@ -6680,11 +8516,11 @@ export const postSandboxV1Volumes = (options) => (options.client ?? client).post
6680
8516
  }
6681
8517
  });
6682
8518
  /**
6683
- * Delete team volume
8519
+ * Sandbox logs (v2)
6684
8520
  *
6685
- * Delete a team volume and its data permanently. Use it only when no sandbox needs the volume any more; the data cannot be recovered. Success answers 204; an unknown id answers 404.
8521
+ * Read the log lines of a sandbox. Use it to debug what ran inside a sandbox. cursor is a start timestamp in milliseconds, direction chooses forward or backward from it, level sets the lowest level to return, search is a case-sensitive substring filter (at most 256 characters) and limit caps the count (at most 1000, default 1000). To continue, pass the timestamp of the last entry as the next cursor.
6686
8522
  */
6687
- export const deleteSandboxV1VolumesByVolumeId = (options) => (options.client ?? client).delete({
8523
+ export const getSandboxV1SandboxesBySandboxIdLogs = (options) => (options.client ?? client).get({
6688
8524
  security: [
6689
8525
  {
6690
8526
  key: 'sandbox-ApiKeyAuth',
@@ -6713,15 +8549,15 @@ export const deleteSandboxV1VolumesByVolumeId = (options) => (options.client ??
6713
8549
  type: 'http'
6714
8550
  }
6715
8551
  ],
6716
- url: '/sandbox/v1/volumes/{volumeID}',
8552
+ url: '/sandbox/v1/sandboxes/{sandboxID}/logs',
6717
8553
  ...options
6718
8554
  });
6719
8555
  /**
6720
- * Team volume
8556
+ * Start template build (v2)
6721
8557
  *
6722
- * Read one team volume by id. Use it to confirm a volume exists and to read its name before mounting it in a sandbox. An unknown id answers 404.
8558
+ * Submit source for a waiting build returned by templates.create; returns 202 after queueing, not after successful publication. Unlike E2B, COPY is rejected (use RUN curl or git clone), fromTemplate accepts official catalog names only, and plaintext registry credentials are rejected. The own face also accepts dockerfile, mutually exclusive with fromImage/fromTemplate/steps, and fromImageRegistry vault references for nonofficial images. Poll templates.builds.status.list until ready or error. Example: {"fromImage":"node:22","steps":[{"type":"RUN","args":["echo hello"]}]}.
6723
8559
  */
6724
- export const getSandboxV1VolumesByVolumeId = (options) => (options.client ?? client).get({
8560
+ export const startTemplateBuild = (options) => (options.client ?? client).post({
6725
8561
  security: [
6726
8562
  {
6727
8563
  key: 'sandbox-ApiKeyAuth',
@@ -6750,15 +8586,19 @@ export const getSandboxV1VolumesByVolumeId = (options) => (options.client ?? cli
6750
8586
  type: 'http'
6751
8587
  }
6752
8588
  ],
6753
- url: '/sandbox/v1/volumes/{volumeID}',
6754
- ...options
8589
+ url: '/sandbox/v1/templates/{templateID}/builds/{buildID}',
8590
+ ...options,
8591
+ headers: {
8592
+ 'Content-Type': 'application/json',
8593
+ ...options.headers
8594
+ }
6755
8595
  });
6756
8596
  /**
6757
- * Fork sandbox
8597
+ * Template build status
6758
8598
  *
6759
- * Fork the sandbox: checkpoint the running sandbox in place (it is briefly paused, snapshotted with its full memory state, and resumed on its node, keeping its ID and expiration untouched) and create count new sandboxes from that snapshot. Returns one result per requested fork, each carrying either the created sandbox or the error that prevented it from starting. A non-201 status means the request failed before any fork was attempted.
8599
+ * Poll a build using templateID and buildID from templates.create. waiting means source has not been submitted; building includes queued work; ready permits sandbox creation; error is terminal, with reason when available. logsOffset counts previously read log entries, starting at zero; add logEntries.length after each response. limit is 0–100, default 100. level selects one log level; offsets then count entries at that level. Drain logs until an empty page, including after a terminal status.
6760
8600
  */
6761
- export const postSandboxV1SandboxesBySandboxIdFork = (options) => (options.client ?? client).post({
8601
+ export const getTemplateBuildStatus = (options) => (options.client ?? client).get({
6762
8602
  security: [
6763
8603
  {
6764
8604
  key: 'sandbox-ApiKeyAuth',
@@ -6787,19 +8627,15 @@ export const postSandboxV1SandboxesBySandboxIdFork = (options) => (options.clien
6787
8627
  type: 'http'
6788
8628
  }
6789
8629
  ],
6790
- url: '/sandbox/v1/sandboxes/{sandboxID}/fork',
6791
- ...options,
6792
- headers: {
6793
- 'Content-Type': 'application/json',
6794
- ...options.headers
6795
- }
8630
+ url: '/sandbox/v1/templates/{templateID}/builds/{buildID}/status',
8631
+ ...options
6796
8632
  });
6797
8633
  /**
6798
- * Create snapshot
8634
+ * Delete template
6799
8635
  *
6800
- * Create a persistent snapshot from the sandbox's current state. Snapshots can be used to create new sandboxes and persist beyond the original sandbox's lifetime.
8636
+ * Permanently remove your template, its builds and tag assignments using templateID from templates.create. Active instances prevent deletion with 409; terminate them first. Unknown or other-organization IDs return 404. Snapshot IDs use snapshots.delete instead.
6801
8637
  */
6802
- export const postSandboxV1SandboxesBySandboxIdSnapshots = (options) => (options.client ?? client).post({
8638
+ export const deleteUserTemplate = (options) => (options.client ?? client).delete({
6803
8639
  security: [
6804
8640
  {
6805
8641
  key: 'sandbox-ApiKeyAuth',
@@ -6828,19 +8664,15 @@ export const postSandboxV1SandboxesBySandboxIdSnapshots = (options) => (options.
6828
8664
  type: 'http'
6829
8665
  }
6830
8666
  ],
6831
- url: '/sandbox/v1/sandboxes/{sandboxID}/snapshots',
6832
- ...options,
6833
- headers: {
6834
- 'Content-Type': 'application/json',
6835
- ...options.headers
6836
- }
8667
+ url: '/sandbox/v1/templates/{templateID}',
8668
+ ...options
6837
8669
  });
6838
8670
  /**
6839
- * List snapshots
8671
+ * List template builds
6840
8672
  *
6841
- * List the snapshots you created, one cursor page at a time. Use it to find a snapshot id before you create a sandbox from it or delete it. Filter by sandboxID (the source sandbox) or by name or snapshot id, optionally tag-qualified; limit is 1 to 100 (default 100). When more results exist send the cursor from the response back as nextToken.
8673
+ * Inspect your template and its newest builds using templateID from templates.create. Build states are waiting, building, ready or error. Use limit and the returned x-next-token header to page builds. Unknown or other-organization templates return 404.
6842
8674
  */
6843
- export const getSandboxV1Snapshots = (options) => (options?.client ?? client).get({
8675
+ export const getTemplateWithBuilds = (options) => (options.client ?? client).get({
6844
8676
  security: [
6845
8677
  {
6846
8678
  key: 'sandbox-ApiKeyAuth',
@@ -6869,15 +8701,15 @@ export const getSandboxV1Snapshots = (options) => (options?.client ?? client).ge
6869
8701
  type: 'http'
6870
8702
  }
6871
8703
  ],
6872
- url: '/sandbox/v1/snapshots',
8704
+ url: '/sandbox/v1/templates/{templateID}',
6873
8705
  ...options
6874
8706
  });
6875
8707
  /**
6876
- * Delete template
8708
+ * Delete template tags
6877
8709
  *
6878
- * Delete one of your snapshots. Sandboxes already created from it keep running; no new sandbox can be created from it afterwards. Success answers 204. A snapshot that does not exist or belongs to someone else answers 404.
8710
+ * Remove the specified tag labels from your template by name, for example {"name":"my-template","tags":["stable"]}. Builds remain available. Removing default means untagged sandbox creation no longer resolves this template. Unknown or other-organization names return 404. b<number> names are reserved read-only build aliases and cannot be assigned or deleted as tags.
6879
8711
  */
6880
- export const deleteSandboxV1SnapshotsBySnapshotId = (options) => (options.client ?? client).delete({
8712
+ export const deleteTemplateTags = (options) => (options.client ?? client).delete({
6881
8713
  security: [
6882
8714
  {
6883
8715
  key: 'sandbox-ApiKeyAuth',
@@ -6906,15 +8738,19 @@ export const deleteSandboxV1SnapshotsBySnapshotId = (options) => (options.client
6906
8738
  type: 'http'
6907
8739
  }
6908
8740
  ],
6909
- url: '/sandbox/v1/snapshots/{snapshotID}',
6910
- ...options
8741
+ url: '/sandbox/v1/templates/tags',
8742
+ ...options,
8743
+ headers: {
8744
+ 'Content-Type': 'application/json',
8745
+ ...options.headers
8746
+ }
6911
8747
  });
6912
8748
  /**
6913
- * Update sandbox network
8749
+ * Assign template tags
6914
8750
  *
6915
- * Update the network configuration for a running sandbox. Replaces the current egress rules with the provided configuration. Omitting field clears it.
8751
+ * Assign tags to the ready build selected by target in name:tag format, for example {"target":"my-template:default","tags":["stable"]}. Names belong to your organization. Tags move an existing label to this build without rebuilding. Obtain available names from templates.list and tags from templates.tags.list. b<number> names are reserved read-only build aliases and cannot be assigned or deleted as tags. target also accepts name:b<number> to select a ready build by number, for example my-template:b1.
6916
8752
  */
6917
- export const putSandboxV1SandboxesBySandboxIdNetwork = (options) => (options.client ?? client).put({
8753
+ export const assignTemplateTags = (options) => (options.client ?? client).post({
6918
8754
  security: [
6919
8755
  {
6920
8756
  key: 'sandbox-ApiKeyAuth',
@@ -6943,7 +8779,7 @@ export const putSandboxV1SandboxesBySandboxIdNetwork = (options) => (options.cli
6943
8779
  type: 'http'
6944
8780
  }
6945
8781
  ],
6946
- url: '/sandbox/v1/sandboxes/{sandboxID}/network',
8782
+ url: '/sandbox/v1/templates/tags',
6947
8783
  ...options,
6948
8784
  headers: {
6949
8785
  'Content-Type': 'application/json',
@@ -6951,11 +8787,11 @@ export const putSandboxV1SandboxesBySandboxIdNetwork = (options) => (options.cli
6951
8787
  }
6952
8788
  });
6953
8789
  /**
6954
- * Sandbox logs (v2)
8790
+ * List template tags
6955
8791
  *
6956
- * Read the log lines of a sandbox. Use it to debug what ran inside a sandbox. cursor is a start timestamp in milliseconds, direction chooses forward or backward from it, level sets the lowest level to return, search is a case-sensitive substring filter (at most 256 characters) and limit caps the count (at most 1000, default 1000). To continue, pass the timestamp of the last entry as the next cursor.
8792
+ * Read the tag-to-build assignments for your template using templateID from templates.create. Only ready builds acquire tags. Use a returned tag with the template name as name:tag when creating a sandbox or assigning additional tags. Foreign IDs return 404.
6957
8793
  */
6958
- export const getSandboxV1SandboxesBySandboxIdLogs = (options) => (options.client ?? client).get({
8794
+ export const listTemplateTags = (options) => (options.client ?? client).get({
6959
8795
  security: [
6960
8796
  {
6961
8797
  key: 'sandbox-ApiKeyAuth',
@@ -6984,7 +8820,44 @@ export const getSandboxV1SandboxesBySandboxIdLogs = (options) => (options.client
6984
8820
  type: 'http'
6985
8821
  }
6986
8822
  ],
6987
- url: '/sandbox/v1/sandboxes/{sandboxID}/logs',
8823
+ url: '/sandbox/v1/templates/{templateID}/tags',
8824
+ ...options
8825
+ });
8826
+ /**
8827
+ * Check template alias
8828
+ *
8829
+ * Resolve a name within your organization to its templateID before reading or managing builds. Use the bare template name, without a :tag suffix. Unknown and other-organization names return 404. The response public field is false for your private templates.
8830
+ */
8831
+ export const resolveTemplateAlias = (options) => (options.client ?? client).get({
8832
+ security: [
8833
+ {
8834
+ key: 'sandbox-ApiKeyAuth',
8835
+ name: 'X-API-Key',
8836
+ type: 'apiKey'
8837
+ },
8838
+ {
8839
+ key: 'sandbox-AuthProviderBearerAuth',
8840
+ scheme: 'bearer',
8841
+ type: 'http'
8842
+ },
8843
+ {
8844
+ key: 'sandbox-AuthProviderTeamAuth',
8845
+ name: 'X-Team-ID',
8846
+ type: 'apiKey'
8847
+ },
8848
+ { name: 'X-Admin-Token', type: 'apiKey' },
8849
+ {
8850
+ key: 'sandbox-AdminTeamAuth',
8851
+ name: 'X-Team-ID',
8852
+ type: 'apiKey'
8853
+ },
8854
+ {
8855
+ key: 'sandbox-AdminJWTAuth',
8856
+ scheme: 'bearer',
8857
+ type: 'http'
8858
+ }
8859
+ ],
8860
+ url: '/sandbox/v1/templates/aliases/{alias}',
6988
8861
  ...options
6989
8862
  });
6990
8863
  /**
@@ -7200,7 +9073,7 @@ export const vaultListSecrets = (options) => (options.client ?? client).get({
7200
9073
  /**
7201
9074
  * Create secret
7202
9075
  *
7203
- * 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.
9076
+ * 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.
7204
9077
  */
7205
9078
  export const vaultCreateSecret = (options) => (options.client ?? client).post({
7206
9079
  security: [{
@@ -7218,7 +9091,7 @@ export const vaultCreateSecret = (options) => (options.client ?? client).post({
7218
9091
  /**
7219
9092
  * Import secrets
7220
9093
  *
7221
- * 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.
9094
+ * 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.
7222
9095
  */
7223
9096
  export const vaultImportSecrets = (options) => (options.client ?? client).post({
7224
9097
  security: [{
@@ -7770,7 +9643,7 @@ export const ticketGetMilestones = (options) => (options?.client ?? client).get(
7770
9643
  /**
7771
9644
  * Create or add milestones
7772
9645
  *
7773
- * 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.
9646
+ * 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.
7774
9647
  */
7775
9648
  export const ticketPostMilestones = (options) => (options.client ?? client).post({
7776
9649
  security: [{
@@ -7792,7 +9665,7 @@ export const ticketPostMilestones = (options) => (options.client ?? client).post
7792
9665
  /**
7793
9666
  * Remove milestones
7794
9667
  *
7795
- * 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.
9668
+ * 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.
7796
9669
  */
7797
9670
  export const ticketDeleteMilestonesNumber = (options) => (options.client ?? client).delete({
7798
9671
  security: [{
@@ -7828,7 +9701,7 @@ export const ticketGetMilestonesNumber = (options) => (options.client ?? client)
7828
9701
  /**
7829
9702
  * Update milestones
7830
9703
  *
7831
- * 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.
9704
+ * 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.
7832
9705
  */
7833
9706
  export const ticketPatchMilestonesNumber = (options) => (options.client ?? client).patch({
7834
9707
  security: [{