@deepraxis/sdk 0.1.0-dev.95813a3 → 0.1.0-dev.a3beed2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/METHODS.md +28 -1
- package/dist/core/client.d.ts +9 -1
- package/dist/core/client.js +6 -0
- package/dist/core/transport.d.ts +5 -0
- package/dist/core/transport.js +6 -1
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.js +1 -1
- package/dist/generated/sdk.gen.d.ts +66 -22
- package/dist/generated/sdk.gen.js +175 -50
- package/dist/generated/types.gen.d.ts +5113 -3071
- package/dist/helpers/application-publish.d.ts +24 -4
- package/dist/helpers/application-publish.js +53 -3
- package/dist/helpers/database-count.d.ts +17 -0
- package/dist/helpers/database-count.js +11 -0
- package/dist/helpers/file-upload.d.ts +24 -0
- package/dist/helpers/file-upload.js +113 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -0
- package/dist/operations.generated.d.ts +244 -23
- package/dist/operations.generated.js +304 -24
- package/dist/resources.generated.d.ts +482 -0
- package/dist/resources.generated.js +15 -0
- package/package.json +1 -1
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
2
|
import { formDataBodySerializer } from './client/index.js';
|
|
3
3
|
import { client } from './client.gen.js';
|
|
4
|
+
/**
|
|
5
|
+
* Unarchive Agent
|
|
6
|
+
*
|
|
7
|
+
* Restore an archived agent without creating a configuration version. Already active agents are unchanged. Missing or inaccessible agents return 404. Use the returned agent id to create new sessions.
|
|
8
|
+
*/
|
|
9
|
+
export const unarchiveAgent = (options) => (options.client ?? client).post({
|
|
10
|
+
security: [{
|
|
11
|
+
key: 'BearerAuth',
|
|
12
|
+
scheme: 'bearer',
|
|
13
|
+
type: 'http'
|
|
14
|
+
}, {
|
|
15
|
+
key: 'ApiKeyAuth',
|
|
16
|
+
name: 'X-API-Key',
|
|
17
|
+
type: 'apiKey'
|
|
18
|
+
}],
|
|
19
|
+
url: '/agent/v1/agents/{agent_id}/unarchive',
|
|
20
|
+
...options
|
|
21
|
+
});
|
|
4
22
|
/**
|
|
5
23
|
* Delete Run Feedback
|
|
6
24
|
*
|
|
@@ -478,6 +496,8 @@ export const computersFilesContent = (options) => (options.client ?? client).get
|
|
|
478
496
|
* Resume the computer and issue a sandbox connection.
|
|
479
497
|
*
|
|
480
498
|
* Own-face extension: Managed Agents has no persistent Computer connection. Returns the public SDK sandbox_id, envd_access_token and template_id, plus the machine tier the computer is on now (light or heavy) and the lease that keeps it there (lease_id, lease_expires_at; lease_id is null when no lease exists). Keep the lease while the connection stays open: renew it about every 20 seconds (POST .../leases/{lease_id}/renew) and release it on close (DELETE .../leases/{lease_id}). An unrenewed lease simply expires, and the full machine is reclaimed only after that. Archived computers remain accessible; foreign or absent computers return 404. Never cache credentials.
|
|
499
|
+
*
|
|
500
|
+
* Connect to a computer with a caller-held lease. Omit the body or send {} to request light: the lightweight shell, or the heavy instance while it is running. Send {"need":"heavy"} to request full Linux for interactive programs; files are synchronized before the heavy connection is returned with tier heavy. Renew the lease while using the connection and release it with DELETE when finished.
|
|
481
501
|
*/
|
|
482
502
|
export const connectComputer = (options) => (options.client ?? client).post({
|
|
483
503
|
security: [{
|
|
@@ -490,7 +510,11 @@ export const connectComputer = (options) => (options.client ?? client).post({
|
|
|
490
510
|
type: 'apiKey'
|
|
491
511
|
}],
|
|
492
512
|
url: '/agent/v1/computers/{computer_id}/connect',
|
|
493
|
-
...options
|
|
513
|
+
...options,
|
|
514
|
+
headers: {
|
|
515
|
+
'Content-Type': 'application/json',
|
|
516
|
+
...options.headers
|
|
517
|
+
}
|
|
494
518
|
});
|
|
495
519
|
/**
|
|
496
520
|
* Renew computer lease
|
|
@@ -1059,7 +1083,7 @@ export const fileListFiles = (options) => (options?.client ?? client).get({
|
|
|
1059
1083
|
/**
|
|
1060
1084
|
* Upload file
|
|
1061
1085
|
*
|
|
1062
|
-
* Upload a file to reuse in conversations or attach to a knowledge base. Unlike OpenAI Files, uploads must be nonempty and at most
|
|
1086
|
+
* 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–2592000), or praxis[expires_in_seconds] (3600–7776000), never both. Without expiry, the file persists until deleted.
|
|
1063
1087
|
*/
|
|
1064
1088
|
export const fileCreateFile = (options) => (options.client ?? client).post({
|
|
1065
1089
|
...formDataBodySerializer,
|
|
@@ -1100,7 +1124,7 @@ export const fileDeleteFile = (options) => (options.client ?? client).delete({
|
|
|
1100
1124
|
/**
|
|
1101
1125
|
* Retrieve file
|
|
1102
1126
|
*
|
|
1103
|
-
* Retrieve metadata for a live file owned by your tenant. Use its
|
|
1127
|
+
* Retrieve metadata for a live file owned by your tenant. Use its file- ID from upload or list. Missing, deleted, expired and other-tenant files return 404; use the content endpoint to download the bytes.
|
|
1104
1128
|
*/
|
|
1105
1129
|
export const fileRetrieveFile = (options) => (options.client ?? client).get({
|
|
1106
1130
|
security: [{
|
|
@@ -1118,7 +1142,7 @@ export const fileRetrieveFile = (options) => (options.client ?? client).get({
|
|
|
1118
1142
|
/**
|
|
1119
1143
|
* Retrieve file content
|
|
1120
1144
|
*
|
|
1121
|
-
* Download the original bytes of a live file owned by your tenant. Supply its
|
|
1145
|
+
* Download the original bytes of a live file owned by your tenant. Supply its file- ID from upload or list. A single byte Range can return a partial response; a range outside the file returns 416. Missing, deleted, expired and other-tenant files return 404.
|
|
1122
1146
|
*/
|
|
1123
1147
|
export const fileRetrieveFileContent = (options) => (options.client ?? client).get({
|
|
1124
1148
|
security: [{
|
|
@@ -1133,6 +1157,75 @@ export const fileRetrieveFileContent = (options) => (options.client ?? client).g
|
|
|
1133
1157
|
url: '/file/v1/files/{file_id}/content',
|
|
1134
1158
|
...options
|
|
1135
1159
|
});
|
|
1160
|
+
/**
|
|
1161
|
+
* Create an upload
|
|
1162
|
+
*
|
|
1163
|
+
* 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.
|
|
1164
|
+
*/
|
|
1165
|
+
export const fileCreateUpload = (options) => (options.client ?? client).post({
|
|
1166
|
+
security: [{
|
|
1167
|
+
key: 'BearerAuth',
|
|
1168
|
+
scheme: 'bearer',
|
|
1169
|
+
type: 'http'
|
|
1170
|
+
}],
|
|
1171
|
+
url: '/file/v1/uploads',
|
|
1172
|
+
...options,
|
|
1173
|
+
headers: {
|
|
1174
|
+
'Content-Type': 'application/json',
|
|
1175
|
+
...options.headers
|
|
1176
|
+
}
|
|
1177
|
+
});
|
|
1178
|
+
/**
|
|
1179
|
+
* Add an upload part
|
|
1180
|
+
*
|
|
1181
|
+
* Send one nonempty part as the multipart data field, at most 64000000 bytes. Parts may arrive concurrently in any order. Use upload_id from create. For a fixed-size upload, supply part_number starting at 1 and exactly part_size bytes except for the final remainder; retry the same number with identical bytes to recover its part ID. Without part_size, each request creates a new part and part_number is ignored. Save the returned part IDs for complete.
|
|
1182
|
+
*/
|
|
1183
|
+
export const fileAddUploadPart = (options) => (options.client ?? client).post({
|
|
1184
|
+
...formDataBodySerializer,
|
|
1185
|
+
security: [{
|
|
1186
|
+
key: 'BearerAuth',
|
|
1187
|
+
scheme: 'bearer',
|
|
1188
|
+
type: 'http'
|
|
1189
|
+
}],
|
|
1190
|
+
url: '/file/v1/uploads/{upload_id}/parts',
|
|
1191
|
+
...options,
|
|
1192
|
+
headers: {
|
|
1193
|
+
'Content-Type': null,
|
|
1194
|
+
...options.headers
|
|
1195
|
+
}
|
|
1196
|
+
});
|
|
1197
|
+
/**
|
|
1198
|
+
* Complete an upload
|
|
1199
|
+
*
|
|
1200
|
+
* Assemble the uploaded parts into a file. Supply upload_id from create and part_ids from addPart in file byte order; their sizes must total the declared bytes. Optional md5 verifies the assembled content. Retrying identical part_ids and normalized md5 returns the same result; different inputs return 409. Unlike OpenAI, completed can contain a file still processing (status uploaded). Poll files.retrieve using file.id until status processed (own face state active); error, expiry or 404 means processing failed and the file cannot be used.
|
|
1201
|
+
*/
|
|
1202
|
+
export const fileCompleteUpload = (options) => (options.client ?? client).post({
|
|
1203
|
+
security: [{
|
|
1204
|
+
key: 'BearerAuth',
|
|
1205
|
+
scheme: 'bearer',
|
|
1206
|
+
type: 'http'
|
|
1207
|
+
}],
|
|
1208
|
+
url: '/file/v1/uploads/{upload_id}/complete',
|
|
1209
|
+
...options,
|
|
1210
|
+
headers: {
|
|
1211
|
+
'Content-Type': 'application/json',
|
|
1212
|
+
...options.headers
|
|
1213
|
+
}
|
|
1214
|
+
});
|
|
1215
|
+
/**
|
|
1216
|
+
* Cancel an upload
|
|
1217
|
+
*
|
|
1218
|
+
* Cancel an unfinished upload using upload_id from create and release its reserved storage. Further parts and completion are rejected. Cancelling an already cancelled upload returns the same terminal result; a completed upload cannot be cancelled. Delete its resulting file instead.
|
|
1219
|
+
*/
|
|
1220
|
+
export const fileCancelUpload = (options) => (options.client ?? client).post({
|
|
1221
|
+
security: [{
|
|
1222
|
+
key: 'BearerAuth',
|
|
1223
|
+
scheme: 'bearer',
|
|
1224
|
+
type: 'http'
|
|
1225
|
+
}],
|
|
1226
|
+
url: '/file/v1/uploads/{upload_id}/cancel',
|
|
1227
|
+
...options
|
|
1228
|
+
});
|
|
1136
1229
|
/**
|
|
1137
1230
|
* Health Check
|
|
1138
1231
|
*
|
|
@@ -2289,6 +2382,64 @@ export const runSandboxCommand = (options) => (options.client ?? client).post({
|
|
|
2289
2382
|
...options.headers
|
|
2290
2383
|
}
|
|
2291
2384
|
});
|
|
2385
|
+
/**
|
|
2386
|
+
* Delete session
|
|
2387
|
+
*
|
|
2388
|
+
* Delete an idle or terminated session and its event history after saving a deletion snapshot. Supply the session id from creation or listing. Running sessions return 409 INVALID_STATE: interrupt first or wait until idle or terminated. Afterwards retrieval and event listing return 404 and lists omit the session. Example: DELETE /agent/v1/sessions/sesn_example.
|
|
2389
|
+
*/
|
|
2390
|
+
export const sessionsDelete = (options) => (options.client ?? client).delete({
|
|
2391
|
+
security: [{
|
|
2392
|
+
key: 'BearerAuth',
|
|
2393
|
+
scheme: 'bearer',
|
|
2394
|
+
type: 'http'
|
|
2395
|
+
}, {
|
|
2396
|
+
key: 'ApiKeyAuth',
|
|
2397
|
+
name: 'X-API-Key',
|
|
2398
|
+
type: 'apiKey'
|
|
2399
|
+
}],
|
|
2400
|
+
url: '/agent/v1/sessions/{session_id}',
|
|
2401
|
+
...options
|
|
2402
|
+
});
|
|
2403
|
+
/**
|
|
2404
|
+
* Get session
|
|
2405
|
+
*
|
|
2406
|
+
* Read one session by id: its agent snapshot, status, model and thinking selection, resources, title, metadata and, for a fork, forked_from. Use it to poll status; to read what happened use sessions.events.list. This response does not include a machine object or sandbox id. With no environment_id or Computer selected at creation, the session starts on a light machine; no environment lookup or provisioning is needed for a codemode calculation.
|
|
2407
|
+
*/
|
|
2408
|
+
export const sessionsRetrieve = (options) => (options.client ?? client).get({
|
|
2409
|
+
security: [{
|
|
2410
|
+
key: 'BearerAuth',
|
|
2411
|
+
scheme: 'bearer',
|
|
2412
|
+
type: 'http'
|
|
2413
|
+
}, {
|
|
2414
|
+
key: 'ApiKeyAuth',
|
|
2415
|
+
name: 'X-API-Key',
|
|
2416
|
+
type: 'apiKey'
|
|
2417
|
+
}],
|
|
2418
|
+
url: '/agent/v1/sessions/{session_id}',
|
|
2419
|
+
...options
|
|
2420
|
+
});
|
|
2421
|
+
/**
|
|
2422
|
+
* Update session
|
|
2423
|
+
*
|
|
2424
|
+
* Update a session's title, metadata, model or thinking selection. metadata follows patch semantics: a string value sets the key, null deletes it, a null metadata clears all keys, untouched keys stay. model must be allowed by the session's agent version; thinking is {effort} or null (null restores inheritance); a model-only change clears a session thinking that the new model does not support, and combined changes are validated against the new model, with the previous selection kept on a 400. Changes apply from the next turn, not to a turn already running. Agent overrides are not supported (400 naming the field). Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. A budget limit must exceed consumed cost; null removes it permanently for this session. Updating an archived session returns 409.
|
|
2425
|
+
*/
|
|
2426
|
+
export const sessionsUpdate = (options) => (options.client ?? client).post({
|
|
2427
|
+
security: [{
|
|
2428
|
+
key: 'BearerAuth',
|
|
2429
|
+
scheme: 'bearer',
|
|
2430
|
+
type: 'http'
|
|
2431
|
+
}, {
|
|
2432
|
+
key: 'ApiKeyAuth',
|
|
2433
|
+
name: 'X-API-Key',
|
|
2434
|
+
type: 'apiKey'
|
|
2435
|
+
}],
|
|
2436
|
+
url: '/agent/v1/sessions/{session_id}',
|
|
2437
|
+
...options,
|
|
2438
|
+
headers: {
|
|
2439
|
+
'Content-Type': 'application/json',
|
|
2440
|
+
...options.headers
|
|
2441
|
+
}
|
|
2442
|
+
});
|
|
2292
2443
|
/**
|
|
2293
2444
|
* List agents
|
|
2294
2445
|
*
|
|
@@ -2426,7 +2577,7 @@ export const sessionsList = (options) => (options?.client ?? client).get({
|
|
|
2426
2577
|
/**
|
|
2427
2578
|
* Create session
|
|
2428
2579
|
*
|
|
2429
|
-
* Create a session: one conversation with an agent
|
|
2580
|
+
* Create a session: one conversation with an agent. Pass agent as an agent id (latest version) or {id, version, type:"agent"}. Unlike Anthropic Managed Agents, omit environment_id to get a light machine, unless computer_id (explicit, or the agent's default) selects a Computer; pass an environment id for a sandbox recipe. For service agents, omission returns environment_id=light; explicit null allocates no machine, so codemode, bash and other machine tools are unavailable. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|max|none} or null, where null inherits the agent default and then the model default (none requires the model to allow disabling thinking). Selections are saved before initial_events run; invalid ones return 400 invalid_request_error. Inline agent overrides are not supported. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. Omitted budget defaults to USD 20; null removes the limit, and a limit object uses a positive integer string of USD cents. Up to 500 file resources can be attached. Use initial_events to send a first user.message in this request, or send messages afterwards with sessions.events.send. The returned status can still be idle before initial events run; read agent.message and the subsequent session.status_idle event to confirm completion.
|
|
2430
2581
|
*/
|
|
2431
2582
|
export const sessionsCreate = (options) => (options.client ?? client).post({
|
|
2432
2583
|
security: [{
|
|
@@ -2445,46 +2596,6 @@ export const sessionsCreate = (options) => (options.client ?? client).post({
|
|
|
2445
2596
|
...options.headers
|
|
2446
2597
|
}
|
|
2447
2598
|
});
|
|
2448
|
-
/**
|
|
2449
|
-
* Get session
|
|
2450
|
-
*
|
|
2451
|
-
* Read one session by id: its agent snapshot, status, model and thinking selection, resources, title, metadata and, for a fork, forked_from. Use it to poll status; to read what happened use sessions.events.list. This response does not include a machine object or sandbox id. With no environment_id or Computer selected at creation, the session starts on a light machine; no environment lookup or provisioning is needed for a codemode calculation.
|
|
2452
|
-
*/
|
|
2453
|
-
export const sessionsRetrieve = (options) => (options.client ?? client).get({
|
|
2454
|
-
security: [{
|
|
2455
|
-
key: 'BearerAuth',
|
|
2456
|
-
scheme: 'bearer',
|
|
2457
|
-
type: 'http'
|
|
2458
|
-
}, {
|
|
2459
|
-
key: 'ApiKeyAuth',
|
|
2460
|
-
name: 'X-API-Key',
|
|
2461
|
-
type: 'apiKey'
|
|
2462
|
-
}],
|
|
2463
|
-
url: '/agent/v1/sessions/{session_id}',
|
|
2464
|
-
...options
|
|
2465
|
-
});
|
|
2466
|
-
/**
|
|
2467
|
-
* Update session
|
|
2468
|
-
*
|
|
2469
|
-
* Update a session's title, metadata, model or thinking selection. metadata follows patch semantics: a string value sets the key, null deletes it, a null metadata clears all keys, untouched keys stay. model must be allowed by the session's agent version; thinking is {effort} or null (null restores inheritance); a model-only change clears a session thinking that the new model does not support, and combined changes are validated against the new model, with the previous selection kept on a 400. Changes apply from the next turn, not to a turn already running. Agent overrides are not supported (400 naming the field). Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. A budget limit must exceed consumed cost; null removes it permanently for this session. Updating an archived session returns 409.
|
|
2470
|
-
*/
|
|
2471
|
-
export const sessionsUpdate = (options) => (options.client ?? client).post({
|
|
2472
|
-
security: [{
|
|
2473
|
-
key: 'BearerAuth',
|
|
2474
|
-
scheme: 'bearer',
|
|
2475
|
-
type: 'http'
|
|
2476
|
-
}, {
|
|
2477
|
-
key: 'ApiKeyAuth',
|
|
2478
|
-
name: 'X-API-Key',
|
|
2479
|
-
type: 'apiKey'
|
|
2480
|
-
}],
|
|
2481
|
-
url: '/agent/v1/sessions/{session_id}',
|
|
2482
|
-
...options,
|
|
2483
|
-
headers: {
|
|
2484
|
-
'Content-Type': 'application/json',
|
|
2485
|
-
...options.headers
|
|
2486
|
-
}
|
|
2487
|
-
});
|
|
2488
2599
|
/**
|
|
2489
2600
|
* Archive session
|
|
2490
2601
|
*
|
|
@@ -3169,6 +3280,20 @@ export const applicationCreateVersion = (options) => (options.client ?? client).
|
|
|
3169
3280
|
...options.headers
|
|
3170
3281
|
}
|
|
3171
3282
|
});
|
|
3283
|
+
/**
|
|
3284
|
+
* Get version asset manifest
|
|
3285
|
+
*
|
|
3286
|
+
* Read the retained asset paths, content hashes and byte sizes of a version for publication planning. This read creates no session or version. A version without assets returns an empty manifest; unavailable artifacts and foreign resources return 404.
|
|
3287
|
+
*/
|
|
3288
|
+
export const applicationGetVersionAssetManifest = (options) => (options.client ?? client).get({
|
|
3289
|
+
security: [{
|
|
3290
|
+
key: 'application-bearerAuth',
|
|
3291
|
+
scheme: 'bearer',
|
|
3292
|
+
type: 'http'
|
|
3293
|
+
}],
|
|
3294
|
+
url: '/application/v1/workers/{worker_id}/versions/{version_id}/assets/manifest',
|
|
3295
|
+
...options
|
|
3296
|
+
});
|
|
3172
3297
|
/**
|
|
3173
3298
|
* Get version
|
|
3174
3299
|
*
|
|
@@ -4852,7 +4977,7 @@ export const databaseListTables = (options) => (options.client ?? client).get({
|
|
|
4852
4977
|
/**
|
|
4853
4978
|
* Create table
|
|
4854
4979
|
*
|
|
4855
|
-
* 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. 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.
|
|
4980
|
+
* 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.
|
|
4856
4981
|
*/
|
|
4857
4982
|
export const databaseCreateTable = (options) => (options.client ?? client).post({
|
|
4858
4983
|
security: [{
|
|
@@ -4916,7 +5041,7 @@ export const databaseUpdateTable = (options) => (options.client ?? client).patch
|
|
|
4916
5041
|
/**
|
|
4917
5042
|
* Add field
|
|
4918
5043
|
*
|
|
4919
|
-
* 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.
|
|
5044
|
+
* 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.
|
|
4920
5045
|
*/
|
|
4921
5046
|
export const databaseAddField = (options) => (options.client ?? client).post({
|
|
4922
5047
|
security: [{
|
|
@@ -4994,7 +5119,7 @@ export const databaseDelete = (options) => (options.client ?? client).delete({
|
|
|
4994
5119
|
/**
|
|
4995
5120
|
* Select rows
|
|
4996
5121
|
*
|
|
4997
|
-
* 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.
|
|
5122
|
+
* 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.
|
|
4998
5123
|
*/
|
|
4999
5124
|
export const databaseSelect = (options) => (options.client ?? client).get({
|
|
5000
5125
|
security: [{
|
|
@@ -5008,7 +5133,7 @@ export const databaseSelect = (options) => (options.client ?? client).get({
|
|
|
5008
5133
|
/**
|
|
5009
5134
|
* Count rows
|
|
5010
5135
|
*
|
|
5011
|
-
* 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.
|
|
5136
|
+
* 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.
|
|
5012
5137
|
*/
|
|
5013
5138
|
export const databaseHead = (options) => (options.client ?? client).head({
|
|
5014
5139
|
security: [{
|
|
@@ -5042,7 +5167,7 @@ export const databaseUpdate = (options) => (options.client ?? client).patch({
|
|
|
5042
5167
|
*
|
|
5043
5168
|
* 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.
|
|
5044
5169
|
* Rows are filled to the union of their keys with null; send Prefer: missing=default to use field defaults for missing keys.
|
|
5045
|
-
* The default is return=minimal: success returns HTTP 201 with an empty body. Send Prefer: return=representation to return the inserted rows. 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.
|
|
5170
|
+
* 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.
|
|
5046
5171
|
*/
|
|
5047
5172
|
export const databaseInsert = (options) => (options.client ?? client).post({
|
|
5048
5173
|
security: [{
|