@deepraxis/sdk 0.1.0-dev.95813a3 → 0.1.0-dev.a5cf3ce
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 +14 -1
- package/dist/core/client.d.ts +5 -1
- package/dist/core/client.js +3 -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 +38 -18
- package/dist/generated/sdk.gen.js +102 -46
- package/dist/generated/types.gen.d.ts +5089 -3874
- 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/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/operations.generated.d.ts +83 -16
- package/dist/operations.generated.js +109 -17
- package/dist/resources.generated.d.ts +348 -0
- package/dist/resources.generated.js +7 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Praxis } from '../core/client.js';
|
|
2
|
-
import type { ApplicationAssetsConfig, ApplicationBinding } from '../generated/types.gen.js';
|
|
2
|
+
import type { ApplicationAssetsConfig, ApplicationBinding, ApplicationVersion } from '../generated/types.gen.js';
|
|
3
3
|
export type AssetsConfig = ApplicationAssetsConfig;
|
|
4
4
|
export interface PublishInput {
|
|
5
5
|
/** 应用名;存在同名应用时复用。 */
|
|
@@ -20,16 +20,32 @@ export interface PublishInput {
|
|
|
20
20
|
bindings?: ApplicationBinding[];
|
|
21
21
|
/** 静态资源路由配置,原样传递。 */
|
|
22
22
|
assets_config?: AssetsConfig;
|
|
23
|
+
/** Register an upload session to plan changes; do not upload content or publish. Requires an existing application. */
|
|
24
|
+
dryRun?: boolean;
|
|
25
|
+
/** Preserve current paths omitted from files. Defaults to false (whole-site replacement). */
|
|
26
|
+
keepExisting?: boolean;
|
|
23
27
|
/** 是否等待部署完成,默认 true。 */
|
|
24
28
|
wait?: boolean;
|
|
25
29
|
/** 部署等待上限(毫秒),默认 120000。超时不会撤销部署。 */
|
|
26
30
|
timeout_ms?: number;
|
|
27
31
|
}
|
|
28
32
|
export interface PublishResult {
|
|
33
|
+
/** True when a static-only publication matches the active version. */
|
|
34
|
+
unchanged?: boolean;
|
|
35
|
+
/** Current version when unchanged or planning an existing deployment. */
|
|
36
|
+
version?: ApplicationVersion;
|
|
37
|
+
/** dryRun compares against the active version; counts are distinct content hashes. */
|
|
38
|
+
plan?: {
|
|
39
|
+
added: string[];
|
|
40
|
+
changed: string[];
|
|
41
|
+
removed: string[];
|
|
42
|
+
upload_hashes: number;
|
|
43
|
+
existing_hashes: number;
|
|
44
|
+
};
|
|
29
45
|
url: string;
|
|
30
46
|
worker_id: string;
|
|
31
|
-
version_id: string;
|
|
32
|
-
deployment_id: string;
|
|
47
|
+
version_id: string | null;
|
|
48
|
+
deployment_id: string | null;
|
|
33
49
|
status: string;
|
|
34
50
|
created: boolean;
|
|
35
51
|
/** 本次上传的不同内容 hash 数量。 */
|
|
@@ -37,5 +53,9 @@ export interface PublishResult {
|
|
|
37
53
|
/** 服务端已存在的不同内容 hash 数量。 */
|
|
38
54
|
reused: number;
|
|
39
55
|
}
|
|
40
|
-
/** Publish
|
|
56
|
+
/** Publish with whole-site replacement by default; keepExisting preserves omitted paths.
|
|
57
|
+
* dryRun registers an idempotent upload session (stores its manifest), but uploads no content and does not publish.
|
|
58
|
+
* The platform does not support gradual rollout. Roll back using workers.deployments.create with
|
|
59
|
+
* strategy: 'percentage', versions: [{ version_id: previousVersionId, percentage: 100 }], while artifacts are retained.
|
|
60
|
+
*/
|
|
41
61
|
export declare function publish(client: Pick<Praxis, 'application'>, input: PublishInput): Promise<PublishResult>;
|
|
@@ -8,8 +8,16 @@ function base64(bytes) {
|
|
|
8
8
|
}
|
|
9
9
|
return btoa(chunks.join(''));
|
|
10
10
|
}
|
|
11
|
-
/** Publish
|
|
11
|
+
/** Publish with whole-site replacement by default; keepExisting preserves omitted paths.
|
|
12
|
+
* dryRun registers an idempotent upload session (stores its manifest), but uploads no content and does not publish.
|
|
13
|
+
* The platform does not support gradual rollout. Roll back using workers.deployments.create with
|
|
14
|
+
* strategy: 'percentage', versions: [{ version_id: previousVersionId, percentage: 100 }], while artifacts are retained.
|
|
15
|
+
*/
|
|
12
16
|
export async function publish(client, input) {
|
|
17
|
+
const rolloutFields = ['gradual', 'gradualRollout', 'gradual_rollout', 'canary', 'rollout', 'percentage', 'percent', 'traffic', 'traffic_percentage', 'strategy', 'versions'];
|
|
18
|
+
if (Object.keys(input).some(key => rolloutFields.includes(key) || /percentage|percent|canary|gradual|rollout|灰度/i.test(key))) {
|
|
19
|
+
throw new PraxisError({ code: 'INVALID_PARAMS', message: '平台不支持灰度 (gradual rollout is not supported). Roll back with praxis.application.workers.deployments.create({ path: { worker_id }, body: { strategy: "percentage", versions: [{ version_id: previousVersionId, percentage: 100 }] } }); the previous version artifacts must still be retained.' });
|
|
20
|
+
}
|
|
13
21
|
const timeout = input.timeout_ms ?? 120_000;
|
|
14
22
|
if (!Number.isFinite(timeout) || timeout < 0)
|
|
15
23
|
throw new RangeError('timeout_ms must be non-negative and finite');
|
|
@@ -21,7 +29,7 @@ export async function publish(client, input) {
|
|
|
21
29
|
const files = Object.entries(input.files);
|
|
22
30
|
if (files.length > 100_000)
|
|
23
31
|
throw new PraxisError({ code: 'LIMIT_EXCEEDED', message: 'At most 100000 asset paths can be published' });
|
|
24
|
-
|
|
32
|
+
let manifest = {};
|
|
25
33
|
const contents = new Map();
|
|
26
34
|
for (const [path, content] of files) {
|
|
27
35
|
const normalized = path.startsWith('/') ? path : `/${path}`;
|
|
@@ -44,9 +52,51 @@ export async function publish(client, input) {
|
|
|
44
52
|
}
|
|
45
53
|
}
|
|
46
54
|
const created = !worker;
|
|
55
|
+
if (!worker && input.dryRun)
|
|
56
|
+
throw new PraxisError({ code: 'NOT_FOUND', message: '请先创建应用 (create the application before dryRun)' });
|
|
47
57
|
worker ??= await workers.create({ body: { name: input.name, subdomain: { enabled: true } } });
|
|
48
58
|
const path = { worker_id: worker.id };
|
|
59
|
+
let currentVersion;
|
|
60
|
+
let currentDeployment;
|
|
61
|
+
let previous = {};
|
|
62
|
+
if (worker.praxis?.current_deployment_id) {
|
|
63
|
+
currentDeployment = await workers.deployments.retrieve({ path: { ...path, deployment_id: worker.praxis.current_deployment_id } });
|
|
64
|
+
const active = currentDeployment.versions[0];
|
|
65
|
+
if (!active)
|
|
66
|
+
throw new PraxisError({ code: 'INVALID_RESPONSE', message: 'Current deployment has no version' });
|
|
67
|
+
currentVersion = await workers.versions.retrieve({ path: { ...path, version_id: active.version_id } });
|
|
68
|
+
previous = (await workers.versions.assets.retrieveManifest({ path: { ...path, version_id: active.version_id } })).manifest;
|
|
69
|
+
}
|
|
70
|
+
// Keep the stored path order: the service hashes JSON.stringify(manifest), including property order.
|
|
71
|
+
// Reordered input with identical paths must still hash to the active version's manifest_hash.
|
|
72
|
+
manifest = {
|
|
73
|
+
...Object.fromEntries(Object.entries(previous).filter(([key]) => input.keepExisting || Object.hasOwn(manifest, key))),
|
|
74
|
+
...manifest,
|
|
75
|
+
};
|
|
76
|
+
if (Object.keys(manifest).length > 100_000)
|
|
77
|
+
throw new PraxisError({ code: 'LIMIT_EXCEEDED', message: 'At most 100000 asset paths can be published' });
|
|
78
|
+
const added = Object.keys(manifest).filter(key => !Object.hasOwn(previous, key));
|
|
79
|
+
const changed = Object.keys(manifest).filter(key => previous[key] && (previous[key].hash !== manifest[key].hash || previous[key].size !== manifest[key].size));
|
|
80
|
+
const removed = Object.keys(previous).filter(key => !Object.hasOwn(manifest, key));
|
|
81
|
+
const digest = new Uint8Array(await crypto.subtle.digest('SHA-256', new TextEncoder().encode(JSON.stringify(manifest))));
|
|
82
|
+
const manifestHash = Array.from(digest, byte => byte.toString(16).padStart(2, '0')).join('');
|
|
83
|
+
const staticOnly = !['main', 'bindings', 'compatibility_date', 'compatibility_flags', 'assets_config'].some(key => Object.hasOwn(input, key));
|
|
84
|
+
const unchanged = staticOnly && !!currentVersion && manifestHash === currentVersion.praxis.assets_manifest?.manifest_hash;
|
|
85
|
+
const hashes = new Set(Object.values(manifest).map(entry => entry.hash));
|
|
86
|
+
const currentResult = { url: worker.subdomain.url, worker_id: worker.id, version_id: currentVersion?.id ?? null,
|
|
87
|
+
deployment_id: currentDeployment?.id ?? null, status: currentDeployment?.praxis.status ?? 'draft', created,
|
|
88
|
+
...(currentVersion ? { version: currentVersion } : {}), unchanged, uploaded: 0, reused: hashes.size };
|
|
89
|
+
if (unchanged && !input.dryRun)
|
|
90
|
+
return currentResult;
|
|
91
|
+
// dryRun intentionally registers the content-addressed session manifest, but never uploads or publishes.
|
|
49
92
|
const session = await workers.assetsUploadSession.create({ path, body: { manifest } });
|
|
93
|
+
if (input.dryRun) {
|
|
94
|
+
const missing = new Set(session.buckets.flat());
|
|
95
|
+
if ([...missing].some(hash => !hashes.has(hash)))
|
|
96
|
+
throw new PraxisError({ code: 'INVALID_RESPONSE', message: 'Upload session requested an unknown hash' });
|
|
97
|
+
return { ...currentResult, reused: hashes.size - missing.size,
|
|
98
|
+
plan: { added, changed, removed, upload_hashes: missing.size, existing_hashes: hashes.size - missing.size } };
|
|
99
|
+
}
|
|
50
100
|
let jwt = session.buckets.length ? null : session.jwt;
|
|
51
101
|
const uploaded = new Set();
|
|
52
102
|
for (const bucket of session.buckets) {
|
|
@@ -112,5 +162,5 @@ export async function publish(client, input) {
|
|
|
112
162
|
}
|
|
113
163
|
return { url: worker.subdomain.url, worker_id: worker.id, version_id: result.version.id,
|
|
114
164
|
deployment_id: deployment.id, status: deployment.praxis.status, created,
|
|
115
|
-
uploaded: uploaded.size, reused:
|
|
165
|
+
uploaded: uploaded.size, reused: hashes.size - uploaded.size };
|
|
116
166
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Transport } from '../core/transport.js';
|
|
2
|
+
export interface CountInput {
|
|
3
|
+
/** Database ID from database list/create; not its display name. */
|
|
4
|
+
database_id: string;
|
|
5
|
+
/** Existing table name or ID from the database table APIs. */
|
|
6
|
+
table: string;
|
|
7
|
+
/** PostgREST query filters, as in databaseSelect; omitted means all rows. */
|
|
8
|
+
filters?: Record<string, string>;
|
|
9
|
+
/** exact counts within budget (default); filtered planned returns null; estimated may return null over budget. Unfiltered counts are exact in every mode. */
|
|
10
|
+
count?: 'exact' | 'planned' | 'estimated';
|
|
11
|
+
}
|
|
12
|
+
export interface CountResult {
|
|
13
|
+
/** Matching total, or null when the server reports an unknown total. */
|
|
14
|
+
count: number | null;
|
|
15
|
+
}
|
|
16
|
+
/** Count matching rows without retrieving row data. */
|
|
17
|
+
export declare function count(transport: Pick<Transport, 'requestWithResponse'>, input: CountInput): Promise<CountResult>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { databaseHead } from "../generated/sdk.gen.js";
|
|
2
|
+
/** Count matching rows without retrieving row data. */
|
|
3
|
+
export async function count(transport, input) {
|
|
4
|
+
const { response } = await transport.requestWithResponse(databaseHead, {
|
|
5
|
+
path: { database_id: input.database_id, table: input.table },
|
|
6
|
+
query: input.filters,
|
|
7
|
+
headers: { Prefer: `count=${input.count ?? 'exact'}` },
|
|
8
|
+
});
|
|
9
|
+
const total = response.headers.get('Content-Range')?.split('/')[1];
|
|
10
|
+
return { count: total === undefined || total === '*' ? null : Number(total) };
|
|
11
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,3 +7,5 @@ export { parseSSE } from './core/sse.js';
|
|
|
7
7
|
export type { SSEEvent, SSEOptions } from './core/sse.js';
|
|
8
8
|
export { publish } from './helpers/application-publish.js';
|
|
9
9
|
export type { PublishInput, PublishResult, AssetsConfig } from './helpers/application-publish.js';
|
|
10
|
+
export { count } from './helpers/database-count.js';
|
|
11
|
+
export type { CountInput, CountResult } from './helpers/database-count.js';
|
package/dist/index.js
CHANGED
|
@@ -3,3 +3,4 @@ export { PraxisError, PraxisConnectionError, PraxisTimeoutError } from "./core/e
|
|
|
3
3
|
export { Page } from "./core/pagination.js";
|
|
4
4
|
export { parseSSE } from "./core/sse.js";
|
|
5
5
|
export { publish } from "./helpers/application-publish.js";
|
|
6
|
+
export { count } from "./helpers/database-count.js";
|
|
@@ -140,6 +140,12 @@ export declare const operations: readonly [{
|
|
|
140
140
|
readonly type: "object";
|
|
141
141
|
readonly required: false;
|
|
142
142
|
readonly description: "Praxis extension: switchable model ids on /agent/v1 only. The default model must be included. When omitted, only the default model is selectable.";
|
|
143
|
+
}, {
|
|
144
|
+
readonly name: "preset";
|
|
145
|
+
readonly type: "string";
|
|
146
|
+
readonly enum: readonly ["minimal", "data-editor", "full"];
|
|
147
|
+
readonly required: false;
|
|
148
|
+
readonly description: "Optional tool preset. minimal enables read, glob, grep and ask_user_question; data-editor also enables write and edit; full uses the default toolset with always_allow. Explicit tools override matching preset entries. codemode requires bash and is absent from data-editor.";
|
|
143
149
|
}];
|
|
144
150
|
};
|
|
145
151
|
}, {
|
|
@@ -268,6 +274,12 @@ export declare const operations: readonly [{
|
|
|
268
274
|
readonly type: "object";
|
|
269
275
|
readonly required: false;
|
|
270
276
|
readonly description: "Praxis extension: switchable model ids on /agent/v1 only. The default model must be included. When omitted, only the default model is selectable.";
|
|
277
|
+
}, {
|
|
278
|
+
readonly name: "preset";
|
|
279
|
+
readonly type: "string";
|
|
280
|
+
readonly enum: readonly ["minimal", "data-editor", "full"];
|
|
281
|
+
readonly required: false;
|
|
282
|
+
readonly description: "Optional tool preset. minimal enables read, glob, grep and ask_user_question; data-editor also enables write and edit; full uses the default toolset with always_allow. Explicit tools override matching preset entries. codemode requires bash and is absent from data-editor.";
|
|
271
283
|
}];
|
|
272
284
|
};
|
|
273
285
|
}, {
|
|
@@ -420,6 +432,20 @@ export declare const operations: readonly [{
|
|
|
420
432
|
readonly sdkName: "external_user_id";
|
|
421
433
|
}];
|
|
422
434
|
readonly query: readonly [];
|
|
435
|
+
}, {
|
|
436
|
+
readonly resource: "agent.agents.unarchive";
|
|
437
|
+
readonly method: "create";
|
|
438
|
+
readonly summary: "Unarchive Agent";
|
|
439
|
+
readonly description: "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.";
|
|
440
|
+
readonly http: "POST";
|
|
441
|
+
readonly path: "/agent/v1/agents/{agent_id}/unarchive";
|
|
442
|
+
readonly streaming: "no";
|
|
443
|
+
readonly pagination: false;
|
|
444
|
+
readonly pathParams: readonly [{
|
|
445
|
+
readonly name: "agent_id";
|
|
446
|
+
readonly sdkName: "agent_id";
|
|
447
|
+
}];
|
|
448
|
+
readonly query: readonly [];
|
|
423
449
|
}, {
|
|
424
450
|
readonly resource: "agent.agents.versions";
|
|
425
451
|
readonly method: "list";
|
|
@@ -582,7 +608,7 @@ export declare const operations: readonly [{
|
|
|
582
608
|
readonly resource: "agent.computers";
|
|
583
609
|
readonly method: "connect";
|
|
584
610
|
readonly summary: "Connect computer";
|
|
585
|
-
readonly description: "Resume the computer and issue a sandbox connection.\n\nOwn-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.";
|
|
611
|
+
readonly description: "Resume the computer and issue a sandbox connection.\n\nOwn-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.\n\nConnect 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. Heavy running time counts toward the daily budget in seconds. Renew the lease while using the connection and release it with DELETE when finished. If the daily budget is exhausted, 429 COMPUTER_BUDGET_EXHAUSTED allows you to continue with need light.";
|
|
586
612
|
readonly http: "POST";
|
|
587
613
|
readonly path: "/agent/v1/computers/{computer_id}/connect";
|
|
588
614
|
readonly streaming: "no";
|
|
@@ -592,6 +618,16 @@ export declare const operations: readonly [{
|
|
|
592
618
|
readonly sdkName: "computer_id";
|
|
593
619
|
}];
|
|
594
620
|
readonly query: readonly [];
|
|
621
|
+
readonly body: {
|
|
622
|
+
readonly required: false;
|
|
623
|
+
readonly fields: readonly [{
|
|
624
|
+
readonly name: "need";
|
|
625
|
+
readonly type: "string";
|
|
626
|
+
readonly enum: readonly ["light", "heavy"];
|
|
627
|
+
readonly required: false;
|
|
628
|
+
readonly description: "Defaults to light. light uses the lightweight shell, or the heavy instance while it is running. heavy requests a full Linux computer for interactive programs; heavy running time counts toward the daily budget in seconds.";
|
|
629
|
+
}];
|
|
630
|
+
};
|
|
595
631
|
}, {
|
|
596
632
|
readonly resource: "agent.computers.files";
|
|
597
633
|
readonly method: "list";
|
|
@@ -1485,6 +1521,20 @@ export declare const operations: readonly [{
|
|
|
1485
1521
|
readonly description: "Praxis extension: explicit session thinking effort; null inherits the pinned agent default, then the model default. none disables thinking only when model.thinking.can_disable is true. Unsupported efforts return 400 invalid_request_error.";
|
|
1486
1522
|
}];
|
|
1487
1523
|
};
|
|
1524
|
+
}, {
|
|
1525
|
+
readonly resource: "agent.sessions";
|
|
1526
|
+
readonly method: "delete";
|
|
1527
|
+
readonly summary: "Delete session";
|
|
1528
|
+
readonly description: "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.";
|
|
1529
|
+
readonly http: "DELETE";
|
|
1530
|
+
readonly path: "/agent/v1/sessions/{session_id}";
|
|
1531
|
+
readonly streaming: "no";
|
|
1532
|
+
readonly pagination: false;
|
|
1533
|
+
readonly pathParams: readonly [{
|
|
1534
|
+
readonly name: "session_id";
|
|
1535
|
+
readonly sdkName: "session_id";
|
|
1536
|
+
}];
|
|
1537
|
+
readonly query: readonly [];
|
|
1488
1538
|
}, {
|
|
1489
1539
|
readonly resource: "agent.sessions";
|
|
1490
1540
|
readonly method: "retrieve";
|
|
@@ -2694,6 +2744,23 @@ export declare const operations: readonly [{
|
|
|
2694
2744
|
readonly sdkName: "version_id";
|
|
2695
2745
|
}];
|
|
2696
2746
|
readonly query: readonly [];
|
|
2747
|
+
}, {
|
|
2748
|
+
readonly resource: "application.workers.versions.assets";
|
|
2749
|
+
readonly method: "retrieveManifest";
|
|
2750
|
+
readonly summary: "Get version asset manifest";
|
|
2751
|
+
readonly description: "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.";
|
|
2752
|
+
readonly http: "GET";
|
|
2753
|
+
readonly path: "/application/v1/workers/{worker_id}/versions/{version_id}/assets/manifest";
|
|
2754
|
+
readonly streaming: "no";
|
|
2755
|
+
readonly pagination: false;
|
|
2756
|
+
readonly pathParams: readonly [{
|
|
2757
|
+
readonly name: "worker_id";
|
|
2758
|
+
readonly sdkName: "worker_id";
|
|
2759
|
+
}, {
|
|
2760
|
+
readonly name: "version_id";
|
|
2761
|
+
readonly sdkName: "version_id";
|
|
2762
|
+
}];
|
|
2763
|
+
readonly query: readonly [];
|
|
2697
2764
|
}, {
|
|
2698
2765
|
readonly resource: "automation.actions";
|
|
2699
2766
|
readonly method: "list";
|
|
@@ -5435,7 +5502,7 @@ export declare const operations: readonly [{
|
|
|
5435
5502
|
readonly name: "{column}";
|
|
5436
5503
|
readonly type: "string";
|
|
5437
5504
|
readonly required: false;
|
|
5438
|
-
readonly description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns.
|
|
5505
|
+
readonly description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns. Supported operators: eq (equal), neq (not equal; ne is not supported), gt/gte/lt/lte (comparisons), like (case-sensitive text pattern), ilike (case-insensitive text pattern), in (membership), is (null/boolean test), cs (contains), cd (contained by), and ov (array overlap). For like/ilike, * or % matches any sequence and _ matches one character, e.g. title=ilike.*spring*; URL-encode a literal % as %25. Use days=in.(1,2,3), title=is.null, active=is.true or active=is.false; is.not_null and is.unknown are also accepted (unknown means null). Negate a condition with not., e.g. title=not.eq.draft. Multiple filters are ANDed; use or=(title.eq.a,title.eq.b), and=(days.gte.1,days.lte.3), not.or=(...) or not.and=(...), with nested and(...) and or(...) groups as needed. cs/cd accept JSON objects or arrays on JSON fields; cs also accepts a JSON scalar. For array values or multi-link fields, use cs.{a,b}, cd.{a,b} or ov.{a,b}. JSON paths use -> for JSON and ->> for text, e.g. attributes->>has_onsen=eq.true or attributes->tags=cs.[1,2]; chain -> segments and end with ->> for text. Dot paths such as attributes.has_onsen are unsupported. Full-text, regex, range operators and any/all modifiers are unsupported.";
|
|
5439
5506
|
}, {
|
|
5440
5507
|
readonly name: "and";
|
|
5441
5508
|
readonly type: "string";
|
|
@@ -5475,7 +5542,7 @@ export declare const operations: readonly [{
|
|
|
5475
5542
|
readonly name: "on_conflict";
|
|
5476
5543
|
readonly type: "string";
|
|
5477
5544
|
readonly required: false;
|
|
5478
|
-
readonly description: "POST upsert: id or one unique field with resolution=merge-duplicates|ignore-duplicates. POST accepts an optional client id matching [A-Za-z0-9_-]{1,64}; omitted ids are generated. PATCH cannot change id.";
|
|
5545
|
+
readonly description: "POST upsert: id or one unique field with resolution=merge-duplicates|ignore-duplicates. 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. POST accepts an optional client id matching [A-Za-z0-9_-]{1,64}; omitted ids are generated. PATCH cannot change id.";
|
|
5479
5546
|
}, {
|
|
5480
5547
|
readonly name: "columns";
|
|
5481
5548
|
readonly type: "string";
|
|
@@ -5486,7 +5553,7 @@ export declare const operations: readonly [{
|
|
|
5486
5553
|
readonly resource: "database.databases.rest";
|
|
5487
5554
|
readonly method: "retrieve";
|
|
5488
5555
|
readonly summary: "Select rows";
|
|
5489
|
-
readonly description: "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.
|
|
5556
|
+
readonly description: "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.";
|
|
5490
5557
|
readonly http: "GET";
|
|
5491
5558
|
readonly path: "/database/v1/databases/{database_id}/rest/{table}";
|
|
5492
5559
|
readonly streaming: "no";
|
|
@@ -5507,7 +5574,7 @@ export declare const operations: readonly [{
|
|
|
5507
5574
|
readonly name: "{column}";
|
|
5508
5575
|
readonly type: "string";
|
|
5509
5576
|
readonly required: false;
|
|
5510
|
-
readonly description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns.
|
|
5577
|
+
readonly description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns. Supported operators: eq (equal), neq (not equal; ne is not supported), gt/gte/lt/lte (comparisons), like (case-sensitive text pattern), ilike (case-insensitive text pattern), in (membership), is (null/boolean test), cs (contains), cd (contained by), and ov (array overlap). For like/ilike, * or % matches any sequence and _ matches one character, e.g. title=ilike.*spring*; URL-encode a literal % as %25. Use days=in.(1,2,3), title=is.null, active=is.true or active=is.false; is.not_null and is.unknown are also accepted (unknown means null). Negate a condition with not., e.g. title=not.eq.draft. Multiple filters are ANDed; use or=(title.eq.a,title.eq.b), and=(days.gte.1,days.lte.3), not.or=(...) or not.and=(...), with nested and(...) and or(...) groups as needed. cs/cd accept JSON objects or arrays on JSON fields; cs also accepts a JSON scalar. For array values or multi-link fields, use cs.{a,b}, cd.{a,b} or ov.{a,b}. JSON paths use -> for JSON and ->> for text, e.g. attributes->>has_onsen=eq.true or attributes->tags=cs.[1,2]; chain -> segments and end with ->> for text. Dot paths such as attributes.has_onsen are unsupported. Full-text, regex, range operators and any/all modifiers are unsupported.";
|
|
5511
5578
|
}, {
|
|
5512
5579
|
readonly name: "and";
|
|
5513
5580
|
readonly type: "string";
|
|
@@ -5547,7 +5614,7 @@ export declare const operations: readonly [{
|
|
|
5547
5614
|
readonly name: "on_conflict";
|
|
5548
5615
|
readonly type: "string";
|
|
5549
5616
|
readonly required: false;
|
|
5550
|
-
readonly description: "POST upsert: id or one unique field with resolution=merge-duplicates|ignore-duplicates. POST accepts an optional client id matching [A-Za-z0-9_-]{1,64}; omitted ids are generated. PATCH cannot change id.";
|
|
5617
|
+
readonly description: "POST upsert: id or one unique field with resolution=merge-duplicates|ignore-duplicates. 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. POST accepts an optional client id matching [A-Za-z0-9_-]{1,64}; omitted ids are generated. PATCH cannot change id.";
|
|
5551
5618
|
}, {
|
|
5552
5619
|
readonly name: "columns";
|
|
5553
5620
|
readonly type: "string";
|
|
@@ -5558,7 +5625,7 @@ export declare const operations: readonly [{
|
|
|
5558
5625
|
readonly resource: "database.databases.rest";
|
|
5559
5626
|
readonly method: "head";
|
|
5560
5627
|
readonly summary: "Count rows";
|
|
5561
|
-
readonly description: "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.
|
|
5628
|
+
readonly description: "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.";
|
|
5562
5629
|
readonly http: "HEAD";
|
|
5563
5630
|
readonly path: "/database/v1/databases/{database_id}/rest/{table}";
|
|
5564
5631
|
readonly streaming: "no";
|
|
@@ -5579,7 +5646,7 @@ export declare const operations: readonly [{
|
|
|
5579
5646
|
readonly name: "{column}";
|
|
5580
5647
|
readonly type: "string";
|
|
5581
5648
|
readonly required: false;
|
|
5582
|
-
readonly description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns.
|
|
5649
|
+
readonly description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns. Supported operators: eq (equal), neq (not equal; ne is not supported), gt/gte/lt/lte (comparisons), like (case-sensitive text pattern), ilike (case-insensitive text pattern), in (membership), is (null/boolean test), cs (contains), cd (contained by), and ov (array overlap). For like/ilike, * or % matches any sequence and _ matches one character, e.g. title=ilike.*spring*; URL-encode a literal % as %25. Use days=in.(1,2,3), title=is.null, active=is.true or active=is.false; is.not_null and is.unknown are also accepted (unknown means null). Negate a condition with not., e.g. title=not.eq.draft. Multiple filters are ANDed; use or=(title.eq.a,title.eq.b), and=(days.gte.1,days.lte.3), not.or=(...) or not.and=(...), with nested and(...) and or(...) groups as needed. cs/cd accept JSON objects or arrays on JSON fields; cs also accepts a JSON scalar. For array values or multi-link fields, use cs.{a,b}, cd.{a,b} or ov.{a,b}. JSON paths use -> for JSON and ->> for text, e.g. attributes->>has_onsen=eq.true or attributes->tags=cs.[1,2]; chain -> segments and end with ->> for text. Dot paths such as attributes.has_onsen are unsupported. Full-text, regex, range operators and any/all modifiers are unsupported.";
|
|
5583
5650
|
}, {
|
|
5584
5651
|
readonly name: "and";
|
|
5585
5652
|
readonly type: "string";
|
|
@@ -5619,7 +5686,7 @@ export declare const operations: readonly [{
|
|
|
5619
5686
|
readonly name: "on_conflict";
|
|
5620
5687
|
readonly type: "string";
|
|
5621
5688
|
readonly required: false;
|
|
5622
|
-
readonly description: "POST upsert: id or one unique field with resolution=merge-duplicates|ignore-duplicates. POST accepts an optional client id matching [A-Za-z0-9_-]{1,64}; omitted ids are generated. PATCH cannot change id.";
|
|
5689
|
+
readonly description: "POST upsert: id or one unique field with resolution=merge-duplicates|ignore-duplicates. 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. POST accepts an optional client id matching [A-Za-z0-9_-]{1,64}; omitted ids are generated. PATCH cannot change id.";
|
|
5623
5690
|
}, {
|
|
5624
5691
|
readonly name: "columns";
|
|
5625
5692
|
readonly type: "string";
|
|
@@ -5651,7 +5718,7 @@ export declare const operations: readonly [{
|
|
|
5651
5718
|
readonly name: "{column}";
|
|
5652
5719
|
readonly type: "string";
|
|
5653
5720
|
readonly required: false;
|
|
5654
|
-
readonly description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns.
|
|
5721
|
+
readonly description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns. Supported operators: eq (equal), neq (not equal; ne is not supported), gt/gte/lt/lte (comparisons), like (case-sensitive text pattern), ilike (case-insensitive text pattern), in (membership), is (null/boolean test), cs (contains), cd (contained by), and ov (array overlap). For like/ilike, * or % matches any sequence and _ matches one character, e.g. title=ilike.*spring*; URL-encode a literal % as %25. Use days=in.(1,2,3), title=is.null, active=is.true or active=is.false; is.not_null and is.unknown are also accepted (unknown means null). Negate a condition with not., e.g. title=not.eq.draft. Multiple filters are ANDed; use or=(title.eq.a,title.eq.b), and=(days.gte.1,days.lte.3), not.or=(...) or not.and=(...), with nested and(...) and or(...) groups as needed. cs/cd accept JSON objects or arrays on JSON fields; cs also accepts a JSON scalar. For array values or multi-link fields, use cs.{a,b}, cd.{a,b} or ov.{a,b}. JSON paths use -> for JSON and ->> for text, e.g. attributes->>has_onsen=eq.true or attributes->tags=cs.[1,2]; chain -> segments and end with ->> for text. Dot paths such as attributes.has_onsen are unsupported. Full-text, regex, range operators and any/all modifiers are unsupported.";
|
|
5655
5722
|
}, {
|
|
5656
5723
|
readonly name: "and";
|
|
5657
5724
|
readonly type: "string";
|
|
@@ -5691,7 +5758,7 @@ export declare const operations: readonly [{
|
|
|
5691
5758
|
readonly name: "on_conflict";
|
|
5692
5759
|
readonly type: "string";
|
|
5693
5760
|
readonly required: false;
|
|
5694
|
-
readonly description: "POST upsert: id or one unique field with resolution=merge-duplicates|ignore-duplicates. POST accepts an optional client id matching [A-Za-z0-9_-]{1,64}; omitted ids are generated. PATCH cannot change id.";
|
|
5761
|
+
readonly description: "POST upsert: id or one unique field with resolution=merge-duplicates|ignore-duplicates. 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. POST accepts an optional client id matching [A-Za-z0-9_-]{1,64}; omitted ids are generated. PATCH cannot change id.";
|
|
5695
5762
|
}, {
|
|
5696
5763
|
readonly name: "columns";
|
|
5697
5764
|
readonly type: "string";
|
|
@@ -5706,7 +5773,7 @@ export declare const operations: readonly [{
|
|
|
5706
5773
|
readonly resource: "database.databases.rest";
|
|
5707
5774
|
readonly method: "create";
|
|
5708
5775
|
readonly summary: "Insert rows";
|
|
5709
|
-
readonly description: "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.\nRows are filled to the union of their keys with null; send Prefer: missing=default to use field defaults for missing keys.\nThe 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.";
|
|
5776
|
+
readonly description: "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.\nRows are filled to the union of their keys with null; send Prefer: missing=default to use field defaults for missing keys.\nThe 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.";
|
|
5710
5777
|
readonly http: "POST";
|
|
5711
5778
|
readonly path: "/database/v1/databases/{database_id}/rest/{table}";
|
|
5712
5779
|
readonly streaming: "no";
|
|
@@ -5727,7 +5794,7 @@ export declare const operations: readonly [{
|
|
|
5727
5794
|
readonly name: "{column}";
|
|
5728
5795
|
readonly type: "string";
|
|
5729
5796
|
readonly required: false;
|
|
5730
|
-
readonly description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns.
|
|
5797
|
+
readonly description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns. Supported operators: eq (equal), neq (not equal; ne is not supported), gt/gte/lt/lte (comparisons), like (case-sensitive text pattern), ilike (case-insensitive text pattern), in (membership), is (null/boolean test), cs (contains), cd (contained by), and ov (array overlap). For like/ilike, * or % matches any sequence and _ matches one character, e.g. title=ilike.*spring*; URL-encode a literal % as %25. Use days=in.(1,2,3), title=is.null, active=is.true or active=is.false; is.not_null and is.unknown are also accepted (unknown means null). Negate a condition with not., e.g. title=not.eq.draft. Multiple filters are ANDed; use or=(title.eq.a,title.eq.b), and=(days.gte.1,days.lte.3), not.or=(...) or not.and=(...), with nested and(...) and or(...) groups as needed. cs/cd accept JSON objects or arrays on JSON fields; cs also accepts a JSON scalar. For array values or multi-link fields, use cs.{a,b}, cd.{a,b} or ov.{a,b}. JSON paths use -> for JSON and ->> for text, e.g. attributes->>has_onsen=eq.true or attributes->tags=cs.[1,2]; chain -> segments and end with ->> for text. Dot paths such as attributes.has_onsen are unsupported. Full-text, regex, range operators and any/all modifiers are unsupported.";
|
|
5731
5798
|
}, {
|
|
5732
5799
|
readonly name: "and";
|
|
5733
5800
|
readonly type: "string";
|
|
@@ -5767,7 +5834,7 @@ export declare const operations: readonly [{
|
|
|
5767
5834
|
readonly name: "on_conflict";
|
|
5768
5835
|
readonly type: "string";
|
|
5769
5836
|
readonly required: false;
|
|
5770
|
-
readonly description: "POST upsert: id or one unique field with resolution=merge-duplicates|ignore-duplicates. POST accepts an optional client id matching [A-Za-z0-9_-]{1,64}; omitted ids are generated. PATCH cannot change id.";
|
|
5837
|
+
readonly description: "POST upsert: id or one unique field with resolution=merge-duplicates|ignore-duplicates. 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. POST accepts an optional client id matching [A-Za-z0-9_-]{1,64}; omitted ids are generated. PATCH cannot change id.";
|
|
5771
5838
|
}, {
|
|
5772
5839
|
readonly name: "columns";
|
|
5773
5840
|
readonly type: "string";
|
|
@@ -5810,7 +5877,7 @@ export declare const operations: readonly [{
|
|
|
5810
5877
|
readonly resource: "database.databases.tables";
|
|
5811
5878
|
readonly method: "create";
|
|
5812
5879
|
readonly summary: "Create table";
|
|
5813
|
-
readonly description: "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.";
|
|
5880
|
+
readonly description: "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.";
|
|
5814
5881
|
readonly http: "POST";
|
|
5815
5882
|
readonly path: "/database/v1/databases/{database_id}/tables";
|
|
5816
5883
|
readonly streaming: "no";
|
|
@@ -5909,7 +5976,7 @@ export declare const operations: readonly [{
|
|
|
5909
5976
|
readonly resource: "database.databases.tables.fields";
|
|
5910
5977
|
readonly method: "create";
|
|
5911
5978
|
readonly summary: "Add field";
|
|
5912
|
-
readonly description: "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.
|
|
5979
|
+
readonly description: "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.";
|
|
5913
5980
|
readonly http: "POST";
|
|
5914
5981
|
readonly path: "/database/v1/databases/{database_id}/tables/{table}/fields";
|
|
5915
5982
|
readonly streaming: "no";
|