@deepraxis/sdk 0.1.1-dev.fb97f26 → 0.1.1-dev.fc4f4d7
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 +149 -1
- package/dist/core/deprecation.d.ts +11 -0
- package/dist/core/deprecation.js +20 -0
- package/dist/core/transport.d.ts +4 -0
- package/dist/core/transport.js +3 -0
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.js +1 -1
- package/dist/generated/sdk.gen.d.ts +384 -22
- package/dist/generated/sdk.gen.js +986 -100
- package/dist/generated/types.gen.d.ts +2688 -124
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/operations.generated.js +2043 -68
- package/dist/resources.generated.d.ts +197 -0
- package/dist/resources.generated.js +247 -22
- package/package.json +1 -1
|
@@ -2666,6 +2666,198 @@ export const exportOrganizationCharges = (options) => (options.client ?? client)
|
|
|
2666
2666
|
url: '/organization/v1/charges',
|
|
2667
2667
|
...options
|
|
2668
2668
|
});
|
|
2669
|
+
/**
|
|
2670
|
+
* Your inbox counts for the notification bell
|
|
2671
|
+
*
|
|
2672
|
+
* Bell-badge counts for the calling person in the organization behind your credential: notices not yet read and not yet seen. The person is always the credential's own; the request cannot name another member. Read-only; no usage charge.
|
|
2673
|
+
*/
|
|
2674
|
+
export const getOrganizationNotificationsInbox = (options) => (options?.client ?? client).get({
|
|
2675
|
+
security: [{
|
|
2676
|
+
key: 'BearerAuth',
|
|
2677
|
+
scheme: 'bearer',
|
|
2678
|
+
type: 'http'
|
|
2679
|
+
}, {
|
|
2680
|
+
key: 'ApiKeyAuth',
|
|
2681
|
+
name: 'X-API-Key',
|
|
2682
|
+
type: 'apiKey'
|
|
2683
|
+
}],
|
|
2684
|
+
url: '/organization/v1/notifications/inbox',
|
|
2685
|
+
...options
|
|
2686
|
+
});
|
|
2687
|
+
/**
|
|
2688
|
+
* List the letters addressed to you
|
|
2689
|
+
*
|
|
2690
|
+
* The letters this person received in this organization, newest first, as the notification center lists them (ADR-193 §5): the sender's display name (never an address or an internal id; an unknown sender answers 「某位成员」), the summary, the kind, when it arrived, whether it is read, and one line saying why it reached this person. The address is the credential's own and is never a request field. Details stay whole in body; open one by its id. Pass next_cursor unchanged as cursor; null ends the list. Read-only; no usage charge.
|
|
2691
|
+
*/
|
|
2692
|
+
export const listOrganizationNotificationLetters = (options) => (options?.client ?? client).get({
|
|
2693
|
+
security: [{
|
|
2694
|
+
key: 'BearerAuth',
|
|
2695
|
+
scheme: 'bearer',
|
|
2696
|
+
type: 'http'
|
|
2697
|
+
}, {
|
|
2698
|
+
key: 'ApiKeyAuth',
|
|
2699
|
+
name: 'X-API-Key',
|
|
2700
|
+
type: 'apiKey'
|
|
2701
|
+
}],
|
|
2702
|
+
url: '/organization/v1/notifications/letters',
|
|
2703
|
+
...options
|
|
2704
|
+
});
|
|
2705
|
+
/**
|
|
2706
|
+
* Mark one of your letters read
|
|
2707
|
+
*
|
|
2708
|
+
* Mark one letter addressed to you as read, together with the bell notice it wrote, so the platform does not email it later as unread. The mailbox is the credential's own — an agent credential reads its own agent mailbox, never its owner's — and the request names only the letter. Repeating the call changes nothing and keeps the first read time. A letter that is not in your mailbox in this organization, or does not exist, answers 404 the same way. Returns how many delivered letters you still have unread. No usage charge.
|
|
2709
|
+
*/
|
|
2710
|
+
export const readOrganizationNotificationLetter = (options) => (options.client ?? client).post({
|
|
2711
|
+
security: [{
|
|
2712
|
+
key: 'BearerAuth',
|
|
2713
|
+
scheme: 'bearer',
|
|
2714
|
+
type: 'http'
|
|
2715
|
+
}, {
|
|
2716
|
+
key: 'ApiKeyAuth',
|
|
2717
|
+
name: 'X-API-Key',
|
|
2718
|
+
type: 'apiKey'
|
|
2719
|
+
}],
|
|
2720
|
+
url: '/organization/v1/notifications/letters/{id}:read',
|
|
2721
|
+
...options
|
|
2722
|
+
});
|
|
2723
|
+
/**
|
|
2724
|
+
* Mark all your letters read
|
|
2725
|
+
*
|
|
2726
|
+
* Mark every delivered letter in your own mailbox in this organization as read, with their bell notices; give kind to read only letters of that kind. Nothing in another mailbox is touched. Letters still scheduled are not delivered yet and stay as they are. Returns how many delivered letters you still have unread. No usage charge.
|
|
2727
|
+
*/
|
|
2728
|
+
export const readAllOrganizationNotificationLetters = (options) => (options?.client ?? client).post({
|
|
2729
|
+
security: [{
|
|
2730
|
+
key: 'BearerAuth',
|
|
2731
|
+
scheme: 'bearer',
|
|
2732
|
+
type: 'http'
|
|
2733
|
+
}, {
|
|
2734
|
+
key: 'ApiKeyAuth',
|
|
2735
|
+
name: 'X-API-Key',
|
|
2736
|
+
type: 'apiKey'
|
|
2737
|
+
}],
|
|
2738
|
+
url: '/organization/v1/notifications/letters:readAll',
|
|
2739
|
+
...options,
|
|
2740
|
+
headers: {
|
|
2741
|
+
'Content-Type': 'application/json',
|
|
2742
|
+
...options?.headers
|
|
2743
|
+
}
|
|
2744
|
+
});
|
|
2745
|
+
/**
|
|
2746
|
+
* Archive one of your letters
|
|
2747
|
+
*
|
|
2748
|
+
* Archive one letter addressed to you: it leaves the default letters list (ask for archived=true to see archived ones) and is marked read, with its bell notice. Repeating the call changes nothing and keeps the first archive time. A letter that is not in your mailbox in this organization, or does not exist, answers 404 the same way. Returns how many delivered letters you still have unread. No usage charge.
|
|
2749
|
+
*/
|
|
2750
|
+
export const archiveOrganizationNotificationLetter = (options) => (options.client ?? client).post({
|
|
2751
|
+
security: [{
|
|
2752
|
+
key: 'BearerAuth',
|
|
2753
|
+
scheme: 'bearer',
|
|
2754
|
+
type: 'http'
|
|
2755
|
+
}, {
|
|
2756
|
+
key: 'ApiKeyAuth',
|
|
2757
|
+
name: 'X-API-Key',
|
|
2758
|
+
type: 'apiKey'
|
|
2759
|
+
}],
|
|
2760
|
+
url: '/organization/v1/notifications/letters/{id}:archive',
|
|
2761
|
+
...options
|
|
2762
|
+
});
|
|
2763
|
+
/**
|
|
2764
|
+
* Your notification switches, and what they resolve to
|
|
2765
|
+
*
|
|
2766
|
+
* This person's notification preferences in the organization behind the credential: their own per-category switches, the channels they unsubscribed from everywhere, the organization's layer (defaults, blocked channels, whether members may change their own switches, hidden categories), and for every offered channel the answer the five layers produce — which layer decided it (platform_mandatory, channel_opt_out, person, organization_default, platform_default). Severity never appears here because it never decides delivery. Read-only; no usage charge.
|
|
2767
|
+
*/
|
|
2768
|
+
export const getOrganizationNotificationPreferences = (options) => (options?.client ?? client).get({
|
|
2769
|
+
security: [{
|
|
2770
|
+
key: 'BearerAuth',
|
|
2771
|
+
scheme: 'bearer',
|
|
2772
|
+
type: 'http'
|
|
2773
|
+
}, {
|
|
2774
|
+
key: 'ApiKeyAuth',
|
|
2775
|
+
name: 'X-API-Key',
|
|
2776
|
+
type: 'apiKey'
|
|
2777
|
+
}],
|
|
2778
|
+
url: '/organization/v1/notifications/preferences',
|
|
2779
|
+
...options
|
|
2780
|
+
});
|
|
2781
|
+
/**
|
|
2782
|
+
* Change your notification switches
|
|
2783
|
+
*
|
|
2784
|
+
* Set this person's own notification switches in this organization. Refused with INVALID_PARAMS for an unknown category, a channel the category does not declare, or a channel this deployment has no provider for (nothing is stored that could not take effect); NOT_CONFIGURABLE for a category nobody configures; CRITICAL_CHANNELS_OFF when a critical category would be left with every offered channel off; ORGANIZATION_LOCKED when the organization does not let members change their own switches. A channel the organization blocked is still storable — the block decides, the switch stays theirs.
|
|
2785
|
+
*/
|
|
2786
|
+
export const updateOrganizationNotificationPreferences = (options) => (options.client ?? client).post({
|
|
2787
|
+
security: [{
|
|
2788
|
+
key: 'BearerAuth',
|
|
2789
|
+
scheme: 'bearer',
|
|
2790
|
+
type: 'http'
|
|
2791
|
+
}, {
|
|
2792
|
+
key: 'ApiKeyAuth',
|
|
2793
|
+
name: 'X-API-Key',
|
|
2794
|
+
type: 'apiKey'
|
|
2795
|
+
}],
|
|
2796
|
+
url: '/organization/v1/notifications/preferences',
|
|
2797
|
+
...options,
|
|
2798
|
+
headers: {
|
|
2799
|
+
'Content-Type': 'application/json',
|
|
2800
|
+
...options.headers
|
|
2801
|
+
}
|
|
2802
|
+
});
|
|
2803
|
+
/**
|
|
2804
|
+
* The organization's notification layer
|
|
2805
|
+
*
|
|
2806
|
+
* The organization's own preference layer: its per-category defaults for members who said nothing, the channels it blocks for everyone, whether members may change their own switches, and the non-critical categories it keeps off members' pages. Any member may read it; only an owner or admin may change it. A critical category can never be hidden, because hiding it would hide a channel nobody may switch off.
|
|
2807
|
+
*/
|
|
2808
|
+
export const getOrganizationNotificationDefaults = (options) => (options?.client ?? client).get({
|
|
2809
|
+
security: [{
|
|
2810
|
+
key: 'BearerAuth',
|
|
2811
|
+
scheme: 'bearer',
|
|
2812
|
+
type: 'http'
|
|
2813
|
+
}, {
|
|
2814
|
+
key: 'ApiKeyAuth',
|
|
2815
|
+
name: 'X-API-Key',
|
|
2816
|
+
type: 'apiKey'
|
|
2817
|
+
}],
|
|
2818
|
+
url: '/organization/v1/notifications/organization_default',
|
|
2819
|
+
...options
|
|
2820
|
+
});
|
|
2821
|
+
/**
|
|
2822
|
+
* Set the organization's notification layer
|
|
2823
|
+
*
|
|
2824
|
+
* Change the organization's notification layer. Requires an organization owner or admin role; a member answers 403. Refused with INVALID_PARAMS for an unknown or non-configurable category, a channel the category does not declare, or a hidden critical category. Blocking a channel silences it for every member, and a critical category's mandatory channel still reaches people (ADR-193 §4 layer 1); setting member_may_change false makes these defaults final for members.
|
|
2825
|
+
*/
|
|
2826
|
+
export const updateOrganizationNotificationDefaults = (options) => (options.client ?? client).post({
|
|
2827
|
+
security: [{
|
|
2828
|
+
key: 'BearerAuth',
|
|
2829
|
+
scheme: 'bearer',
|
|
2830
|
+
type: 'http'
|
|
2831
|
+
}, {
|
|
2832
|
+
key: 'ApiKeyAuth',
|
|
2833
|
+
name: 'X-API-Key',
|
|
2834
|
+
type: 'apiKey'
|
|
2835
|
+
}],
|
|
2836
|
+
url: '/organization/v1/notifications/organization_default',
|
|
2837
|
+
...options,
|
|
2838
|
+
headers: {
|
|
2839
|
+
'Content-Type': 'application/json',
|
|
2840
|
+
...options.headers
|
|
2841
|
+
}
|
|
2842
|
+
});
|
|
2843
|
+
/**
|
|
2844
|
+
* Your own notification delivery records
|
|
2845
|
+
*
|
|
2846
|
+
* This person's delivery records in this organization, newest first: channel, status, the reason nothing was sent, the address a mail actually went to, and a carrier's verdict for a sent sms. The recipient is always the credential's own. Records are kept 30 days. Pass next_page unchanged as page; null ends the list. Read-only; no usage charge.
|
|
2847
|
+
*/
|
|
2848
|
+
export const listOrganizationNotificationDeliveries = (options) => (options?.client ?? client).get({
|
|
2849
|
+
security: [{
|
|
2850
|
+
key: 'BearerAuth',
|
|
2851
|
+
scheme: 'bearer',
|
|
2852
|
+
type: 'http'
|
|
2853
|
+
}, {
|
|
2854
|
+
key: 'ApiKeyAuth',
|
|
2855
|
+
name: 'X-API-Key',
|
|
2856
|
+
type: 'apiKey'
|
|
2857
|
+
}],
|
|
2858
|
+
url: '/organization/v1/notifications/deliveries',
|
|
2859
|
+
...options
|
|
2860
|
+
});
|
|
2669
2861
|
/**
|
|
2670
2862
|
* Upgrade to a full sandbox
|
|
2671
2863
|
*
|
|
@@ -9139,31 +9331,31 @@ export const cutRestoreVersion = (options) => (options.client ?? client).post({
|
|
|
9139
9331
|
...options
|
|
9140
9332
|
});
|
|
9141
9333
|
/**
|
|
9142
|
-
* List databases
|
|
9334
|
+
* List table databases
|
|
9143
9335
|
*
|
|
9144
|
-
* 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.
|
|
9336
|
+
* Find the table databases owned by your tenant (databases of the other type are not listed) 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.
|
|
9145
9337
|
*/
|
|
9146
|
-
export const
|
|
9338
|
+
export const databaseListTableDatabases = (options) => (options?.client ?? client).get({
|
|
9147
9339
|
security: [{
|
|
9148
9340
|
key: 'database-bearerAuth',
|
|
9149
9341
|
scheme: 'bearer',
|
|
9150
9342
|
type: 'http'
|
|
9151
9343
|
}],
|
|
9152
|
-
url: '/database/v1/
|
|
9344
|
+
url: '/database/v1/table',
|
|
9153
9345
|
...options
|
|
9154
9346
|
});
|
|
9155
9347
|
/**
|
|
9156
|
-
* Create database
|
|
9348
|
+
* Create table database
|
|
9157
9349
|
*
|
|
9158
|
-
* Creates an empty database for the caller and returns it with status active (HTTP 201); add tables next with praxis.database.
|
|
9350
|
+
* Creates an empty table database for the caller and returns it with status active (HTTP 201); add tables next with praxis.database.table.tables.create, then read and write rows with praxis.database.table.rest. The path is the type: the body takes no kind, and a body that carries kind returns 400 INVALID_PARAMS: kind is set by the path. 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 databaseListTableDatabases 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. For Redis-style keys use praxis.database.kv.create instead.
|
|
9159
9351
|
*/
|
|
9160
|
-
export const
|
|
9352
|
+
export const databaseCreateTableDatabase = (options) => (options.client ?? client).post({
|
|
9161
9353
|
security: [{
|
|
9162
9354
|
key: 'database-bearerAuth',
|
|
9163
9355
|
scheme: 'bearer',
|
|
9164
9356
|
type: 'http'
|
|
9165
9357
|
}],
|
|
9166
|
-
url: '/database/v1/
|
|
9358
|
+
url: '/database/v1/table',
|
|
9167
9359
|
...options,
|
|
9168
9360
|
headers: {
|
|
9169
9361
|
'Content-Type': 'application/json',
|
|
@@ -9171,45 +9363,31 @@ export const databaseCreateDatabase = (options) => (options.client ?? client).po
|
|
|
9171
9363
|
}
|
|
9172
9364
|
});
|
|
9173
9365
|
/**
|
|
9174
|
-
*
|
|
9175
|
-
*
|
|
9176
|
-
* 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.
|
|
9177
|
-
*/
|
|
9178
|
-
export const databaseDeleteDatabase = (options) => (options.client ?? client).delete({
|
|
9179
|
-
security: [{
|
|
9180
|
-
key: 'database-bearerAuth',
|
|
9181
|
-
scheme: 'bearer',
|
|
9182
|
-
type: 'http'
|
|
9183
|
-
}],
|
|
9184
|
-
url: '/database/v1/databases/{database_id}',
|
|
9185
|
-
...options
|
|
9186
|
-
});
|
|
9187
|
-
/**
|
|
9188
|
-
* Get database
|
|
9366
|
+
* List key-value databases
|
|
9189
9367
|
*
|
|
9190
|
-
*
|
|
9368
|
+
* Find the key-value databases owned by your tenant (databases of the other type are not listed) and obtain their ids for key and command operations. Excludes deleting by default. status=active or status=deleting selects that state; invalid values return 400 INVALID_PARAMS.
|
|
9191
9369
|
*/
|
|
9192
|
-
export const
|
|
9370
|
+
export const databaseListKvDatabases = (options) => (options?.client ?? client).get({
|
|
9193
9371
|
security: [{
|
|
9194
9372
|
key: 'database-bearerAuth',
|
|
9195
9373
|
scheme: 'bearer',
|
|
9196
9374
|
type: 'http'
|
|
9197
9375
|
}],
|
|
9198
|
-
url: '/database/v1/
|
|
9376
|
+
url: '/database/v1/kv',
|
|
9199
9377
|
...options
|
|
9200
9378
|
});
|
|
9201
9379
|
/**
|
|
9202
|
-
*
|
|
9380
|
+
* Create key-value database
|
|
9203
9381
|
*
|
|
9204
|
-
*
|
|
9382
|
+
* Creates an empty key-value database (键值库) for the caller and returns it with status active (HTTP 201); read and write it next with praxis.database.kv.keys and praxis.database.kv.commands, or point an existing Redis or @upstash/redis client at /redis/<database_id>. The path is the type: the body takes no kind, and a body that carries kind returns 400 INVALID_PARAMS: kind is set by the path. Creating a key-value database in an organization that has not been opened for it returns 400 INVALID_PARAMS: kind kv is not available. 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 databaseListKvDatabases 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. Use a Praxis credential; access is scoped to its tenant. For structured tables and rows use praxis.database.table.create instead.
|
|
9205
9383
|
*/
|
|
9206
|
-
export const
|
|
9384
|
+
export const databaseCreateKvDatabase = (options) => (options.client ?? client).post({
|
|
9207
9385
|
security: [{
|
|
9208
9386
|
key: 'database-bearerAuth',
|
|
9209
9387
|
scheme: 'bearer',
|
|
9210
9388
|
type: 'http'
|
|
9211
9389
|
}],
|
|
9212
|
-
url: '/database/v1/
|
|
9390
|
+
url: '/database/v1/kv',
|
|
9213
9391
|
...options,
|
|
9214
9392
|
headers: {
|
|
9215
9393
|
'Content-Type': 'application/json',
|
|
@@ -9217,59 +9395,45 @@ export const databaseUpdateDatabase = (options) => (options.client ?? client).pa
|
|
|
9217
9395
|
}
|
|
9218
9396
|
});
|
|
9219
9397
|
/**
|
|
9220
|
-
*
|
|
9221
|
-
*
|
|
9222
|
-
* 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.
|
|
9223
|
-
*/
|
|
9224
|
-
export const databaseRestoreDatabase = (options) => (options.client ?? client).post({
|
|
9225
|
-
security: [{
|
|
9226
|
-
key: 'database-bearerAuth',
|
|
9227
|
-
scheme: 'bearer',
|
|
9228
|
-
type: 'http'
|
|
9229
|
-
}],
|
|
9230
|
-
url: '/database/v1/databases/{database_id}/restore',
|
|
9231
|
-
...options
|
|
9232
|
-
});
|
|
9233
|
-
/**
|
|
9234
|
-
* Permanently purge database
|
|
9398
|
+
* Delete database
|
|
9235
9399
|
*
|
|
9236
|
-
*
|
|
9400
|
+
* 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.
|
|
9237
9401
|
*/
|
|
9238
|
-
export const
|
|
9402
|
+
export const databaseDeleteTableDatabase = (options) => (options.client ?? client).delete({
|
|
9239
9403
|
security: [{
|
|
9240
9404
|
key: 'database-bearerAuth',
|
|
9241
9405
|
scheme: 'bearer',
|
|
9242
9406
|
type: 'http'
|
|
9243
9407
|
}],
|
|
9244
|
-
url: '/database/v1/
|
|
9408
|
+
url: '/database/v1/table/{database_id}',
|
|
9245
9409
|
...options
|
|
9246
9410
|
});
|
|
9247
9411
|
/**
|
|
9248
|
-
*
|
|
9412
|
+
* Get table database
|
|
9249
9413
|
*
|
|
9250
|
-
*
|
|
9414
|
+
* 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, or the id of a key-value database, returns 404 DATABASE_NOT_FOUND.
|
|
9251
9415
|
*/
|
|
9252
|
-
export const
|
|
9416
|
+
export const databaseGetTableDatabase = (options) => (options.client ?? client).get({
|
|
9253
9417
|
security: [{
|
|
9254
9418
|
key: 'database-bearerAuth',
|
|
9255
9419
|
scheme: 'bearer',
|
|
9256
9420
|
type: 'http'
|
|
9257
9421
|
}],
|
|
9258
|
-
url: '/database/v1/
|
|
9422
|
+
url: '/database/v1/table/{database_id}',
|
|
9259
9423
|
...options
|
|
9260
9424
|
});
|
|
9261
9425
|
/**
|
|
9262
|
-
*
|
|
9426
|
+
* Update database
|
|
9263
9427
|
*
|
|
9264
|
-
*
|
|
9428
|
+
* 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 databaseRestoreTableDatabase.
|
|
9265
9429
|
*/
|
|
9266
|
-
export const
|
|
9430
|
+
export const databaseUpdateTableDatabase = (options) => (options.client ?? client).patch({
|
|
9267
9431
|
security: [{
|
|
9268
9432
|
key: 'database-bearerAuth',
|
|
9269
9433
|
scheme: 'bearer',
|
|
9270
9434
|
type: 'http'
|
|
9271
9435
|
}],
|
|
9272
|
-
url: '/database/v1/
|
|
9436
|
+
url: '/database/v1/table/{database_id}',
|
|
9273
9437
|
...options,
|
|
9274
9438
|
headers: {
|
|
9275
9439
|
'Content-Type': 'application/json',
|
|
@@ -9277,45 +9441,45 @@ export const databaseCreateTable = (options) => (options.client ?? client).post(
|
|
|
9277
9441
|
}
|
|
9278
9442
|
});
|
|
9279
9443
|
/**
|
|
9280
|
-
* Delete
|
|
9444
|
+
* Delete database
|
|
9281
9445
|
*
|
|
9282
|
-
*
|
|
9446
|
+
* 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.
|
|
9283
9447
|
*/
|
|
9284
|
-
export const
|
|
9448
|
+
export const databaseDeleteKvDatabase = (options) => (options.client ?? client).delete({
|
|
9285
9449
|
security: [{
|
|
9286
9450
|
key: 'database-bearerAuth',
|
|
9287
9451
|
scheme: 'bearer',
|
|
9288
9452
|
type: 'http'
|
|
9289
9453
|
}],
|
|
9290
|
-
url: '/database/v1/
|
|
9454
|
+
url: '/database/v1/kv/{database_id}',
|
|
9291
9455
|
...options
|
|
9292
9456
|
});
|
|
9293
9457
|
/**
|
|
9294
|
-
* Get
|
|
9458
|
+
* Get key-value database
|
|
9295
9459
|
*
|
|
9296
|
-
* Returns one
|
|
9460
|
+
* 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 key or command operations to confirm status is active: key and command 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, or the id of a table database, returns 404 DATABASE_NOT_FOUND.
|
|
9297
9461
|
*/
|
|
9298
|
-
export const
|
|
9462
|
+
export const databaseGetKvDatabase = (options) => (options.client ?? client).get({
|
|
9299
9463
|
security: [{
|
|
9300
9464
|
key: 'database-bearerAuth',
|
|
9301
9465
|
scheme: 'bearer',
|
|
9302
9466
|
type: 'http'
|
|
9303
9467
|
}],
|
|
9304
|
-
url: '/database/v1/
|
|
9468
|
+
url: '/database/v1/kv/{database_id}',
|
|
9305
9469
|
...options
|
|
9306
9470
|
});
|
|
9307
9471
|
/**
|
|
9308
|
-
* Update
|
|
9472
|
+
* Update database
|
|
9309
9473
|
*
|
|
9310
|
-
* Renames
|
|
9474
|
+
* 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 databaseRestoreKvDatabase.
|
|
9311
9475
|
*/
|
|
9312
|
-
export const
|
|
9476
|
+
export const databaseUpdateKvDatabase = (options) => (options.client ?? client).patch({
|
|
9313
9477
|
security: [{
|
|
9314
9478
|
key: 'database-bearerAuth',
|
|
9315
9479
|
scheme: 'bearer',
|
|
9316
9480
|
type: 'http'
|
|
9317
9481
|
}],
|
|
9318
|
-
url: '/database/v1/
|
|
9482
|
+
url: '/database/v1/kv/{database_id}',
|
|
9319
9483
|
...options,
|
|
9320
9484
|
headers: {
|
|
9321
9485
|
'Content-Type': 'application/json',
|
|
@@ -9323,73 +9487,679 @@ export const databaseUpdateTable = (options) => (options.client ?? client).patch
|
|
|
9323
9487
|
}
|
|
9324
9488
|
});
|
|
9325
9489
|
/**
|
|
9326
|
-
*
|
|
9490
|
+
* Restore database
|
|
9327
9491
|
*
|
|
9328
|
-
*
|
|
9492
|
+
* 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.
|
|
9329
9493
|
*/
|
|
9330
|
-
export const
|
|
9494
|
+
export const databaseRestoreTableDatabase = (options) => (options.client ?? client).post({
|
|
9331
9495
|
security: [{
|
|
9332
9496
|
key: 'database-bearerAuth',
|
|
9333
9497
|
scheme: 'bearer',
|
|
9334
9498
|
type: 'http'
|
|
9335
9499
|
}],
|
|
9336
|
-
url: '/database/v1/
|
|
9337
|
-
...options
|
|
9338
|
-
headers: {
|
|
9339
|
-
'Content-Type': 'application/json',
|
|
9340
|
-
...options.headers
|
|
9341
|
-
}
|
|
9500
|
+
url: '/database/v1/table/{database_id}/restore',
|
|
9501
|
+
...options
|
|
9342
9502
|
});
|
|
9343
9503
|
/**
|
|
9344
|
-
*
|
|
9504
|
+
* Restore database
|
|
9345
9505
|
*
|
|
9346
|
-
*
|
|
9506
|
+
* 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.
|
|
9347
9507
|
*/
|
|
9348
|
-
export const
|
|
9508
|
+
export const databaseRestoreKvDatabase = (options) => (options.client ?? client).post({
|
|
9349
9509
|
security: [{
|
|
9350
9510
|
key: 'database-bearerAuth',
|
|
9351
9511
|
scheme: 'bearer',
|
|
9352
9512
|
type: 'http'
|
|
9353
9513
|
}],
|
|
9354
|
-
url: '/database/v1/
|
|
9514
|
+
url: '/database/v1/kv/{database_id}/restore',
|
|
9355
9515
|
...options
|
|
9356
9516
|
});
|
|
9357
9517
|
/**
|
|
9358
|
-
*
|
|
9518
|
+
* Permanently purge database
|
|
9359
9519
|
*
|
|
9360
|
-
*
|
|
9520
|
+
* Immediately and irreversibly purges a deleting database. Active databases return 409; absent or already purged databases return 404.
|
|
9361
9521
|
*/
|
|
9362
|
-
export const
|
|
9522
|
+
export const databasePurgeTableDatabase = (options) => (options.client ?? client).post({
|
|
9363
9523
|
security: [{
|
|
9364
9524
|
key: 'database-bearerAuth',
|
|
9365
9525
|
scheme: 'bearer',
|
|
9366
9526
|
type: 'http'
|
|
9367
9527
|
}],
|
|
9368
|
-
url: '/database/v1/
|
|
9369
|
-
...options
|
|
9370
|
-
headers: {
|
|
9371
|
-
'Content-Type': 'application/json',
|
|
9372
|
-
...options.headers
|
|
9373
|
-
}
|
|
9528
|
+
url: '/database/v1/table/{database_id}/purge',
|
|
9529
|
+
...options
|
|
9374
9530
|
});
|
|
9375
9531
|
/**
|
|
9376
|
-
*
|
|
9532
|
+
* Permanently purge database
|
|
9377
9533
|
*
|
|
9378
|
-
*
|
|
9534
|
+
* Immediately and irreversibly purges a deleting database. Active databases return 409; absent or already purged databases return 404.
|
|
9379
9535
|
*/
|
|
9380
|
-
export const
|
|
9536
|
+
export const databasePurgeKvDatabase = (options) => (options.client ?? client).post({
|
|
9381
9537
|
security: [{
|
|
9382
9538
|
key: 'database-bearerAuth',
|
|
9383
9539
|
scheme: 'bearer',
|
|
9384
9540
|
type: 'http'
|
|
9385
9541
|
}],
|
|
9386
|
-
url: '/database/v1/
|
|
9542
|
+
url: '/database/v1/kv/{database_id}/purge',
|
|
9387
9543
|
...options
|
|
9388
9544
|
});
|
|
9389
9545
|
/**
|
|
9390
|
-
*
|
|
9546
|
+
* List tables
|
|
9547
|
+
*
|
|
9548
|
+
* 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 databaseTableGetTable instead when you also need row_count for one table.
|
|
9549
|
+
*/
|
|
9550
|
+
export const databaseTableListTables = (options) => (options.client ?? client).get({
|
|
9551
|
+
security: [{
|
|
9552
|
+
key: 'database-bearerAuth',
|
|
9553
|
+
scheme: 'bearer',
|
|
9554
|
+
type: 'http'
|
|
9555
|
+
}],
|
|
9556
|
+
url: '/database/v1/table/{database_id}/tables',
|
|
9557
|
+
...options
|
|
9558
|
+
});
|
|
9559
|
+
/**
|
|
9560
|
+
* Create table
|
|
9561
|
+
*
|
|
9562
|
+
* 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 databaseTableAddField. 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 databaseTableInsert. 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.
|
|
9563
|
+
*/
|
|
9564
|
+
export const databaseTableCreateTable = (options) => (options.client ?? client).post({
|
|
9565
|
+
security: [{
|
|
9566
|
+
key: 'database-bearerAuth',
|
|
9567
|
+
scheme: 'bearer',
|
|
9568
|
+
type: 'http'
|
|
9569
|
+
}],
|
|
9570
|
+
url: '/database/v1/table/{database_id}/tables',
|
|
9571
|
+
...options,
|
|
9572
|
+
headers: {
|
|
9573
|
+
'Content-Type': 'application/json',
|
|
9574
|
+
...options.headers
|
|
9575
|
+
}
|
|
9576
|
+
});
|
|
9577
|
+
/**
|
|
9578
|
+
* Delete table
|
|
9579
|
+
*
|
|
9580
|
+
* 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.
|
|
9581
|
+
*/
|
|
9582
|
+
export const databaseTableDeleteTable = (options) => (options.client ?? client).delete({
|
|
9583
|
+
security: [{
|
|
9584
|
+
key: 'database-bearerAuth',
|
|
9585
|
+
scheme: 'bearer',
|
|
9586
|
+
type: 'http'
|
|
9587
|
+
}],
|
|
9588
|
+
url: '/database/v1/table/{database_id}/tables/{table}',
|
|
9589
|
+
...options
|
|
9590
|
+
});
|
|
9591
|
+
/**
|
|
9592
|
+
* Get table
|
|
9593
|
+
*
|
|
9594
|
+
* 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.
|
|
9595
|
+
*/
|
|
9596
|
+
export const databaseTableGetTable = (options) => (options.client ?? client).get({
|
|
9597
|
+
security: [{
|
|
9598
|
+
key: 'database-bearerAuth',
|
|
9599
|
+
scheme: 'bearer',
|
|
9600
|
+
type: 'http'
|
|
9601
|
+
}],
|
|
9602
|
+
url: '/database/v1/table/{database_id}/tables/{table}',
|
|
9603
|
+
...options
|
|
9604
|
+
});
|
|
9605
|
+
/**
|
|
9606
|
+
* Update table
|
|
9607
|
+
*
|
|
9608
|
+
* 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 databaseTableAddField, databaseTableUpdateField and databaseTableDeleteField.
|
|
9609
|
+
*/
|
|
9610
|
+
export const databaseTableUpdateTable = (options) => (options.client ?? client).patch({
|
|
9611
|
+
security: [{
|
|
9612
|
+
key: 'database-bearerAuth',
|
|
9613
|
+
scheme: 'bearer',
|
|
9614
|
+
type: 'http'
|
|
9615
|
+
}],
|
|
9616
|
+
url: '/database/v1/table/{database_id}/tables/{table}',
|
|
9617
|
+
...options,
|
|
9618
|
+
headers: {
|
|
9619
|
+
'Content-Type': 'application/json',
|
|
9620
|
+
...options.headers
|
|
9621
|
+
}
|
|
9622
|
+
});
|
|
9623
|
+
/**
|
|
9624
|
+
* Add field
|
|
9625
|
+
*
|
|
9626
|
+
* 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.
|
|
9627
|
+
*/
|
|
9628
|
+
export const databaseTableAddField = (options) => (options.client ?? client).post({
|
|
9629
|
+
security: [{
|
|
9630
|
+
key: 'database-bearerAuth',
|
|
9631
|
+
scheme: 'bearer',
|
|
9632
|
+
type: 'http'
|
|
9633
|
+
}],
|
|
9634
|
+
url: '/database/v1/table/{database_id}/tables/{table}/fields',
|
|
9635
|
+
...options,
|
|
9636
|
+
headers: {
|
|
9637
|
+
'Content-Type': 'application/json',
|
|
9638
|
+
...options.headers
|
|
9639
|
+
}
|
|
9640
|
+
});
|
|
9641
|
+
/**
|
|
9642
|
+
* Delete field
|
|
9643
|
+
*
|
|
9644
|
+
* 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.
|
|
9645
|
+
*/
|
|
9646
|
+
export const databaseTableDeleteField = (options) => (options.client ?? client).delete({
|
|
9647
|
+
security: [{
|
|
9648
|
+
key: 'database-bearerAuth',
|
|
9649
|
+
scheme: 'bearer',
|
|
9650
|
+
type: 'http'
|
|
9651
|
+
}],
|
|
9652
|
+
url: '/database/v1/table/{database_id}/tables/{table}/fields/{field}',
|
|
9653
|
+
...options
|
|
9654
|
+
});
|
|
9655
|
+
/**
|
|
9656
|
+
* Update field
|
|
9657
|
+
*
|
|
9658
|
+
* 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.
|
|
9659
|
+
*/
|
|
9660
|
+
export const databaseTableUpdateField = (options) => (options.client ?? client).patch({
|
|
9661
|
+
security: [{
|
|
9662
|
+
key: 'database-bearerAuth',
|
|
9663
|
+
scheme: 'bearer',
|
|
9664
|
+
type: 'http'
|
|
9665
|
+
}],
|
|
9666
|
+
url: '/database/v1/table/{database_id}/tables/{table}/fields/{field}',
|
|
9667
|
+
...options,
|
|
9668
|
+
headers: {
|
|
9669
|
+
'Content-Type': 'application/json',
|
|
9670
|
+
...options.headers
|
|
9671
|
+
}
|
|
9672
|
+
});
|
|
9673
|
+
/**
|
|
9674
|
+
* List events
|
|
9675
|
+
*
|
|
9676
|
+
* 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.
|
|
9677
|
+
*/
|
|
9678
|
+
export const databaseTableListEvents = (options) => (options.client ?? client).get({
|
|
9679
|
+
security: [{
|
|
9680
|
+
key: 'database-bearerAuth',
|
|
9681
|
+
scheme: 'bearer',
|
|
9682
|
+
type: 'http'
|
|
9683
|
+
}],
|
|
9684
|
+
url: '/database/v1/table/{database_id}/events',
|
|
9685
|
+
...options
|
|
9686
|
+
});
|
|
9687
|
+
/**
|
|
9688
|
+
* List key-value database events
|
|
9689
|
+
*
|
|
9690
|
+
* Read the lifecycle events of a key-value database (created, status changes), including while the database is deleting; use it to see when the database was provisioned or deleted. 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. This is paged lifecycle history, not a feed of key changes: writing, updating or deleting keys does not add events. The id of a table database returns 404 DATABASE_NOT_FOUND here; read its events with praxis.database.table.events.list.
|
|
9691
|
+
*/
|
|
9692
|
+
export const databaseKvListEvents = (options) => (options.client ?? client).get({
|
|
9693
|
+
security: [{
|
|
9694
|
+
key: 'database-bearerAuth',
|
|
9695
|
+
scheme: 'bearer',
|
|
9696
|
+
type: 'http'
|
|
9697
|
+
}],
|
|
9698
|
+
url: '/database/v1/kv/{database_id}/events',
|
|
9699
|
+
...options
|
|
9700
|
+
});
|
|
9701
|
+
/**
|
|
9702
|
+
* Delete rows
|
|
9703
|
+
*
|
|
9704
|
+
* Deletes the rows matched by the filter query parameters (the same filters as databaseTableSelect); 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.
|
|
9705
|
+
*/
|
|
9706
|
+
export const databaseTableDelete = (options) => (options.client ?? client).delete({
|
|
9707
|
+
security: [{
|
|
9708
|
+
key: 'database-bearerAuth',
|
|
9709
|
+
scheme: 'bearer',
|
|
9710
|
+
type: 'http'
|
|
9711
|
+
}],
|
|
9712
|
+
url: '/database/v1/table/{database_id}/rest/{table}',
|
|
9713
|
+
...options
|
|
9714
|
+
});
|
|
9715
|
+
/**
|
|
9716
|
+
* Select rows
|
|
9717
|
+
*
|
|
9718
|
+
* 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.
|
|
9719
|
+
*/
|
|
9720
|
+
export const databaseTableSelect = (options) => (options.client ?? client).get({
|
|
9721
|
+
security: [{
|
|
9722
|
+
key: 'database-bearerAuth',
|
|
9723
|
+
scheme: 'bearer',
|
|
9724
|
+
type: 'http'
|
|
9725
|
+
}],
|
|
9726
|
+
url: '/database/v1/table/{database_id}/rest/{table}',
|
|
9727
|
+
...options
|
|
9728
|
+
});
|
|
9729
|
+
/**
|
|
9730
|
+
* Count rows
|
|
9731
|
+
*
|
|
9732
|
+
* 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.
|
|
9733
|
+
*/
|
|
9734
|
+
export const databaseTableHead = (options) => (options.client ?? client).head({
|
|
9735
|
+
security: [{
|
|
9736
|
+
key: 'database-bearerAuth',
|
|
9737
|
+
scheme: 'bearer',
|
|
9738
|
+
type: 'http'
|
|
9739
|
+
}],
|
|
9740
|
+
url: '/database/v1/table/{database_id}/rest/{table}',
|
|
9741
|
+
...options
|
|
9742
|
+
});
|
|
9743
|
+
/**
|
|
9744
|
+
* Update rows
|
|
9745
|
+
*
|
|
9746
|
+
* Updates the rows matched by the filter query parameters (the same filters as databaseTableSelect); 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.
|
|
9747
|
+
*/
|
|
9748
|
+
export const databaseTableUpdate = (options) => (options.client ?? client).patch({
|
|
9749
|
+
security: [{
|
|
9750
|
+
key: 'database-bearerAuth',
|
|
9751
|
+
scheme: 'bearer',
|
|
9752
|
+
type: 'http'
|
|
9753
|
+
}],
|
|
9754
|
+
url: '/database/v1/table/{database_id}/rest/{table}',
|
|
9755
|
+
...options,
|
|
9756
|
+
headers: {
|
|
9757
|
+
'Content-Type': 'application/json',
|
|
9758
|
+
...options.headers
|
|
9759
|
+
}
|
|
9760
|
+
});
|
|
9761
|
+
/**
|
|
9762
|
+
* Insert rows
|
|
9763
|
+
*
|
|
9764
|
+
* 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.
|
|
9765
|
+
* Rows are filled to the union of their keys with null; send Prefer: missing=default to use field defaults for missing keys.
|
|
9766
|
+
* 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.
|
|
9767
|
+
*/
|
|
9768
|
+
export const databaseTableInsert = (options) => (options.client ?? client).post({
|
|
9769
|
+
security: [{
|
|
9770
|
+
key: 'database-bearerAuth',
|
|
9771
|
+
scheme: 'bearer',
|
|
9772
|
+
type: 'http'
|
|
9773
|
+
}],
|
|
9774
|
+
url: '/database/v1/table/{database_id}/rest/{table}',
|
|
9775
|
+
...options,
|
|
9776
|
+
headers: {
|
|
9777
|
+
'Content-Type': 'application/json',
|
|
9778
|
+
...options.headers
|
|
9779
|
+
}
|
|
9780
|
+
});
|
|
9781
|
+
/**
|
|
9782
|
+
* List keys
|
|
9783
|
+
*
|
|
9784
|
+
* Browse the keys of a key-value database (kind kv): use it to see what is stored before reading one key with databaseKvGetKey; to run an arbitrary Redis command (counters, ranges, scans) use databaseKvExecuteCommand instead. Keys come back in lexicographic key order, one page at a time, as summaries (key, type, remaining TTL, size) without values; expired keys are never returned. pattern filters with a Redis glob (* ? [abc] [^abc]) matched against the whole key, and type keeps one value type. limit is 1–500, default 50; while next_cursor is a string, pass it back unchanged as cursor for the next page; null means this is the last page. Needs a read credential. Errors: 400 INVALID_PARAMS for a limit outside 1–500 or a malformed query; 404 DATABASE_NOT_FOUND for an unknown id.
|
|
9785
|
+
*/
|
|
9786
|
+
export const databaseKvListKeys = (options) => (options.client ?? client).get({
|
|
9787
|
+
security: [{
|
|
9788
|
+
key: 'database-bearerAuth',
|
|
9789
|
+
scheme: 'bearer',
|
|
9790
|
+
type: 'http'
|
|
9791
|
+
}],
|
|
9792
|
+
url: '/database/v1/kv/{database_id}/keys',
|
|
9793
|
+
...options
|
|
9794
|
+
});
|
|
9795
|
+
/**
|
|
9796
|
+
* Delete key
|
|
9797
|
+
*
|
|
9798
|
+
* Delete one key of a key-value database together with its value; the data cannot be recovered. A key that is absent or has already expired is not an error: the call succeeds with deleted false, so it is safe to retry. To delete many keys at once or by pattern, list them with databaseKvListKeys or run DEL / UNLINK through databaseKvExecuteCommand. Needs a read-write credential. Errors: 404 DATABASE_NOT_FOUND for an unknown id; 403 BINDING_READ_ONLY for a read-only credential.
|
|
9799
|
+
*/
|
|
9800
|
+
export const databaseKvDeleteKey = (options) => (options.client ?? client).delete({
|
|
9801
|
+
security: [{
|
|
9802
|
+
key: 'database-bearerAuth',
|
|
9803
|
+
scheme: 'bearer',
|
|
9804
|
+
type: 'http'
|
|
9805
|
+
}],
|
|
9806
|
+
url: '/database/v1/kv/{database_id}/keys/{key}',
|
|
9807
|
+
...options
|
|
9808
|
+
});
|
|
9809
|
+
/**
|
|
9810
|
+
* Get key
|
|
9811
|
+
*
|
|
9812
|
+
* Read one key of a key-value database with its type, TTL, size and value; use databaseKvListKeys first to find key names. A string value is returned whole. A hash, list, set or zset is returned a page of entries at a time: limit is 1–1000, default 100, and while next_cursor is a string, pass it back unchanged as cursor to read the next page; string values and the last page return next_cursor null. value takes the shape of type: a string; hash as [{field, value}]; list and set as a string array; zset as [{member, score}]. Needs a read credential. Errors: 404 KEY_NOT_FOUND when the key does not exist or has expired; 400 INVALID_PARAMS for a limit outside 1–1000; 404 DATABASE_NOT_FOUND.
|
|
9813
|
+
*/
|
|
9814
|
+
export const databaseKvGetKey = (options) => (options.client ?? client).get({
|
|
9815
|
+
security: [{
|
|
9816
|
+
key: 'database-bearerAuth',
|
|
9817
|
+
scheme: 'bearer',
|
|
9818
|
+
type: 'http'
|
|
9819
|
+
}],
|
|
9820
|
+
url: '/database/v1/kv/{database_id}/keys/{key}',
|
|
9821
|
+
...options
|
|
9822
|
+
});
|
|
9823
|
+
/**
|
|
9824
|
+
* Update key
|
|
9825
|
+
*
|
|
9826
|
+
* Change only the TTL of an existing key of a key-value database, leaving its value alone. update_mask must be ttl_ms (the only writable field) and ttl_ms is required: a positive integer is the new TTL in milliseconds (Redis PEXPIRE), null removes the TTL so the key never expires (PERSIST). To replace the value use databaseKvSetKey. Returns the key after the change. Needs a read-write credential. Errors: 404 KEY_NOT_FOUND when the key does not exist or has expired; 400 INVALID_PARAMS when update_mask is not ttl_ms or ttl_ms is neither a positive integer nor null; 404 DATABASE_NOT_FOUND; 403 BINDING_READ_ONLY.
|
|
9827
|
+
*/
|
|
9828
|
+
export const databaseKvUpdateKey = (options) => (options.client ?? client).patch({
|
|
9829
|
+
security: [{
|
|
9830
|
+
key: 'database-bearerAuth',
|
|
9831
|
+
scheme: 'bearer',
|
|
9832
|
+
type: 'http'
|
|
9833
|
+
}],
|
|
9834
|
+
url: '/database/v1/kv/{database_id}/keys/{key}',
|
|
9835
|
+
...options,
|
|
9836
|
+
headers: {
|
|
9837
|
+
'Content-Type': 'application/json',
|
|
9838
|
+
...options.headers
|
|
9839
|
+
}
|
|
9840
|
+
});
|
|
9841
|
+
/**
|
|
9842
|
+
* Set key
|
|
9843
|
+
*
|
|
9844
|
+
* Overwrite one key of a key-value database with a whole new value in a single transaction, creating it if absent; the previous value is dropped first and never merged, even when the type changes. To change only the TTL use databaseKvUpdateKey; to add to a counter or push onto a list use databaseKvExecuteCommand. type decides the shape of value: a string; hash as [{field, value}]; list and set as a string array; zset as [{member, score}] with finite scores. Containers must not be empty, and hash fields and set members must be unique. ttl_ms omitted keeps the key's existing TTL, a positive integer sets a new one in milliseconds, null makes the key permanent. A value is at most 1 MiB and a key at most 1 KiB. Returns the stored key (first page for a container). Needs a read-write credential. Errors: 400 INVALID_PARAMS for an empty container, duplicate field or member, non-finite score or bad ttl_ms; 400 LIMIT_EXCEEDED for an oversized key or value; 503 CAPACITY when the database is full; 404 DATABASE_NOT_FOUND; 403 BINDING_READ_ONLY for a read-only credential.
|
|
9845
|
+
*/
|
|
9846
|
+
export const databaseKvSetKey = (options) => (options.client ?? client).put({
|
|
9847
|
+
security: [{
|
|
9848
|
+
key: 'database-bearerAuth',
|
|
9849
|
+
scheme: 'bearer',
|
|
9850
|
+
type: 'http'
|
|
9851
|
+
}],
|
|
9852
|
+
url: '/database/v1/kv/{database_id}/keys/{key}',
|
|
9853
|
+
...options,
|
|
9854
|
+
headers: {
|
|
9855
|
+
'Content-Type': 'application/json',
|
|
9856
|
+
...options.headers
|
|
9857
|
+
}
|
|
9858
|
+
});
|
|
9859
|
+
/**
|
|
9860
|
+
* Execute command
|
|
9861
|
+
*
|
|
9862
|
+
* Run one Redis command with Redis 7 semantics against a key-value database and get its reply; use it for what the key operations cannot do: counters (INCR), list and set operations, ranges (LRANGE, ZRANGE), scans (SCAN, HSCAN) and expiry commands. For one whole-value read or write use databaseKvGetKey / databaseKvSetKey; for existing Redis clients use the Upstash-compatible face under /redis. command is the command name followed by its arguments, every element a string, for example ["SET","k","v"] or ["LRANGE","queue","0","9"]. result is Redis's reply as plain JSON (integers, strings, arrays, null), never base64. Not supported: Lua scripting (EVAL), blocking commands, Pub/Sub and Streams. A value is at most 1 MiB, a key at most 1 KiB, a reply at most 8 MiB (read big collections in ranges with SCAN, HSCAN, LRANGE or ZRANGE) and the database at most 1 GiB. A read command needs a read credential; a write command, or a command that cannot be parsed, needs a read-write credential. Errors: 400 KV_COMMAND_ERROR when Redis rejects the command, with Redis's own text in message (for example WRONGTYPE Operation against a key holding the wrong kind of value or ERR unknown command); 400 INVALID_PARAMS for a missing or empty command; 404 DATABASE_NOT_FOUND; 403 BINDING_READ_ONLY for a write on a read-only credential.
|
|
9863
|
+
*/
|
|
9864
|
+
export const databaseKvExecuteCommand = (options) => (options.client ?? client).post({
|
|
9865
|
+
security: [{
|
|
9866
|
+
key: 'database-bearerAuth',
|
|
9867
|
+
scheme: 'bearer',
|
|
9868
|
+
type: 'http'
|
|
9869
|
+
}],
|
|
9870
|
+
url: '/database/v1/kv/{database_id}/commands',
|
|
9871
|
+
...options,
|
|
9872
|
+
headers: {
|
|
9873
|
+
'Content-Type': 'application/json',
|
|
9874
|
+
...options.headers
|
|
9875
|
+
}
|
|
9876
|
+
});
|
|
9877
|
+
/**
|
|
9878
|
+
* List databases
|
|
9879
|
+
*
|
|
9880
|
+
* Deprecated: use praxis.database.table.list for a table database or praxis.database.kv.list for a key-value database instead; this path stops working on 2027-03-01. 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.
|
|
9881
|
+
*
|
|
9882
|
+
* @deprecated
|
|
9883
|
+
*/
|
|
9884
|
+
export const databaseListDatabases = (options) => (options?.client ?? client).get({
|
|
9885
|
+
security: [{
|
|
9886
|
+
key: 'database-bearerAuth',
|
|
9887
|
+
scheme: 'bearer',
|
|
9888
|
+
type: 'http'
|
|
9889
|
+
}],
|
|
9890
|
+
url: '/database/v1/databases',
|
|
9891
|
+
...options
|
|
9892
|
+
});
|
|
9893
|
+
/**
|
|
9894
|
+
* Create database
|
|
9895
|
+
*
|
|
9896
|
+
* Deprecated: use praxis.database.table.create for a table database or praxis.database.kv.create for a key-value database instead; this path stops working on 2027-03-01. 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. kind is optional: table (the default) for tables and rows, kv for Redis-style keys and values; it cannot change later, and creating kv where it is not available returns 400 INVALID_PARAMS: kind kv is not available. 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.
|
|
9897
|
+
*
|
|
9898
|
+
* @deprecated
|
|
9899
|
+
*/
|
|
9900
|
+
export const databaseCreateDatabase = (options) => (options.client ?? client).post({
|
|
9901
|
+
security: [{
|
|
9902
|
+
key: 'database-bearerAuth',
|
|
9903
|
+
scheme: 'bearer',
|
|
9904
|
+
type: 'http'
|
|
9905
|
+
}],
|
|
9906
|
+
url: '/database/v1/databases',
|
|
9907
|
+
...options,
|
|
9908
|
+
headers: {
|
|
9909
|
+
'Content-Type': 'application/json',
|
|
9910
|
+
...options.headers
|
|
9911
|
+
}
|
|
9912
|
+
});
|
|
9913
|
+
/**
|
|
9914
|
+
* Delete database
|
|
9915
|
+
*
|
|
9916
|
+
* Deprecated: use praxis.database.table.delete for a table database or praxis.database.kv.delete for a key-value database instead; this path stops working on 2027-03-01. 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.
|
|
9917
|
+
*
|
|
9918
|
+
* @deprecated
|
|
9919
|
+
*/
|
|
9920
|
+
export const databaseDeleteDatabase = (options) => (options.client ?? client).delete({
|
|
9921
|
+
security: [{
|
|
9922
|
+
key: 'database-bearerAuth',
|
|
9923
|
+
scheme: 'bearer',
|
|
9924
|
+
type: 'http'
|
|
9925
|
+
}],
|
|
9926
|
+
url: '/database/v1/databases/{database_id}',
|
|
9927
|
+
...options
|
|
9928
|
+
});
|
|
9929
|
+
/**
|
|
9930
|
+
* Get database
|
|
9931
|
+
*
|
|
9932
|
+
* Deprecated: use praxis.database.table.retrieve for a table database or praxis.database.kv.retrieve for a key-value database instead; this path stops working on 2027-03-01. 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.
|
|
9933
|
+
*
|
|
9934
|
+
* @deprecated
|
|
9935
|
+
*/
|
|
9936
|
+
export const databaseGetDatabase = (options) => (options.client ?? client).get({
|
|
9937
|
+
security: [{
|
|
9938
|
+
key: 'database-bearerAuth',
|
|
9939
|
+
scheme: 'bearer',
|
|
9940
|
+
type: 'http'
|
|
9941
|
+
}],
|
|
9942
|
+
url: '/database/v1/databases/{database_id}',
|
|
9943
|
+
...options
|
|
9944
|
+
});
|
|
9945
|
+
/**
|
|
9946
|
+
* Update database
|
|
9947
|
+
*
|
|
9948
|
+
* Deprecated: use praxis.database.table.update for a table database or praxis.database.kv.update for a key-value database instead; this path stops working on 2027-03-01. 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.
|
|
9949
|
+
*
|
|
9950
|
+
* @deprecated
|
|
9951
|
+
*/
|
|
9952
|
+
export const databaseUpdateDatabase = (options) => (options.client ?? client).patch({
|
|
9953
|
+
security: [{
|
|
9954
|
+
key: 'database-bearerAuth',
|
|
9955
|
+
scheme: 'bearer',
|
|
9956
|
+
type: 'http'
|
|
9957
|
+
}],
|
|
9958
|
+
url: '/database/v1/databases/{database_id}',
|
|
9959
|
+
...options,
|
|
9960
|
+
headers: {
|
|
9961
|
+
'Content-Type': 'application/json',
|
|
9962
|
+
...options.headers
|
|
9963
|
+
}
|
|
9964
|
+
});
|
|
9965
|
+
/**
|
|
9966
|
+
* Restore database
|
|
9391
9967
|
*
|
|
9392
|
-
*
|
|
9968
|
+
* Deprecated: use praxis.database.table.restore for a table database or praxis.database.kv.restore for a key-value database instead; this path stops working on 2027-03-01. 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.
|
|
9969
|
+
*
|
|
9970
|
+
* @deprecated
|
|
9971
|
+
*/
|
|
9972
|
+
export const databaseRestoreDatabase = (options) => (options.client ?? client).post({
|
|
9973
|
+
security: [{
|
|
9974
|
+
key: 'database-bearerAuth',
|
|
9975
|
+
scheme: 'bearer',
|
|
9976
|
+
type: 'http'
|
|
9977
|
+
}],
|
|
9978
|
+
url: '/database/v1/databases/{database_id}/restore',
|
|
9979
|
+
...options
|
|
9980
|
+
});
|
|
9981
|
+
/**
|
|
9982
|
+
* Permanently purge database
|
|
9983
|
+
*
|
|
9984
|
+
* Deprecated: use praxis.database.table.purge.create for a table database or praxis.database.kv.purge.create for a key-value database instead; this path stops working on 2027-03-01. Immediately and irreversibly purges a deleting database. Active databases return 409; absent or already purged databases return 404.
|
|
9985
|
+
*
|
|
9986
|
+
* @deprecated
|
|
9987
|
+
*/
|
|
9988
|
+
export const databasePurgeDatabase = (options) => (options.client ?? client).post({
|
|
9989
|
+
security: [{
|
|
9990
|
+
key: 'database-bearerAuth',
|
|
9991
|
+
scheme: 'bearer',
|
|
9992
|
+
type: 'http'
|
|
9993
|
+
}],
|
|
9994
|
+
url: '/database/v1/databases/{database_id}/purge',
|
|
9995
|
+
...options
|
|
9996
|
+
});
|
|
9997
|
+
/**
|
|
9998
|
+
* List tables
|
|
9999
|
+
*
|
|
10000
|
+
* Deprecated: use praxis.database.table.tables.list instead; this path stops working on 2027-03-01. 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.
|
|
10001
|
+
*
|
|
10002
|
+
* @deprecated
|
|
10003
|
+
*/
|
|
10004
|
+
export const databaseListTables = (options) => (options.client ?? client).get({
|
|
10005
|
+
security: [{
|
|
10006
|
+
key: 'database-bearerAuth',
|
|
10007
|
+
scheme: 'bearer',
|
|
10008
|
+
type: 'http'
|
|
10009
|
+
}],
|
|
10010
|
+
url: '/database/v1/databases/{database_id}/tables',
|
|
10011
|
+
...options
|
|
10012
|
+
});
|
|
10013
|
+
/**
|
|
10014
|
+
* Create table
|
|
10015
|
+
*
|
|
10016
|
+
* Deprecated: use praxis.database.table.tables.create instead; this path stops working on 2027-03-01. 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.
|
|
10017
|
+
*
|
|
10018
|
+
* @deprecated
|
|
10019
|
+
*/
|
|
10020
|
+
export const databaseCreateTable = (options) => (options.client ?? client).post({
|
|
10021
|
+
security: [{
|
|
10022
|
+
key: 'database-bearerAuth',
|
|
10023
|
+
scheme: 'bearer',
|
|
10024
|
+
type: 'http'
|
|
10025
|
+
}],
|
|
10026
|
+
url: '/database/v1/databases/{database_id}/tables',
|
|
10027
|
+
...options,
|
|
10028
|
+
headers: {
|
|
10029
|
+
'Content-Type': 'application/json',
|
|
10030
|
+
...options.headers
|
|
10031
|
+
}
|
|
10032
|
+
});
|
|
10033
|
+
/**
|
|
10034
|
+
* Delete table
|
|
10035
|
+
*
|
|
10036
|
+
* Deprecated: use praxis.database.table.tables.delete instead; this path stops working on 2027-03-01. 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.
|
|
10037
|
+
*
|
|
10038
|
+
* @deprecated
|
|
10039
|
+
*/
|
|
10040
|
+
export const databaseDeleteTable = (options) => (options.client ?? client).delete({
|
|
10041
|
+
security: [{
|
|
10042
|
+
key: 'database-bearerAuth',
|
|
10043
|
+
scheme: 'bearer',
|
|
10044
|
+
type: 'http'
|
|
10045
|
+
}],
|
|
10046
|
+
url: '/database/v1/databases/{database_id}/tables/{table}',
|
|
10047
|
+
...options
|
|
10048
|
+
});
|
|
10049
|
+
/**
|
|
10050
|
+
* Get table
|
|
10051
|
+
*
|
|
10052
|
+
* Deprecated: use praxis.database.table.tables.retrieve instead; this path stops working on 2027-03-01. 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.
|
|
10053
|
+
*
|
|
10054
|
+
* @deprecated
|
|
10055
|
+
*/
|
|
10056
|
+
export const databaseGetTable = (options) => (options.client ?? client).get({
|
|
10057
|
+
security: [{
|
|
10058
|
+
key: 'database-bearerAuth',
|
|
10059
|
+
scheme: 'bearer',
|
|
10060
|
+
type: 'http'
|
|
10061
|
+
}],
|
|
10062
|
+
url: '/database/v1/databases/{database_id}/tables/{table}',
|
|
10063
|
+
...options
|
|
10064
|
+
});
|
|
10065
|
+
/**
|
|
10066
|
+
* Update table
|
|
10067
|
+
*
|
|
10068
|
+
* Deprecated: use praxis.database.table.tables.update instead; this path stops working on 2027-03-01. 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.
|
|
10069
|
+
*
|
|
10070
|
+
* @deprecated
|
|
10071
|
+
*/
|
|
10072
|
+
export const databaseUpdateTable = (options) => (options.client ?? client).patch({
|
|
10073
|
+
security: [{
|
|
10074
|
+
key: 'database-bearerAuth',
|
|
10075
|
+
scheme: 'bearer',
|
|
10076
|
+
type: 'http'
|
|
10077
|
+
}],
|
|
10078
|
+
url: '/database/v1/databases/{database_id}/tables/{table}',
|
|
10079
|
+
...options,
|
|
10080
|
+
headers: {
|
|
10081
|
+
'Content-Type': 'application/json',
|
|
10082
|
+
...options.headers
|
|
10083
|
+
}
|
|
10084
|
+
});
|
|
10085
|
+
/**
|
|
10086
|
+
* Add field
|
|
10087
|
+
*
|
|
10088
|
+
* Deprecated: use praxis.database.table.tables.fields.create instead; this path stops working on 2027-03-01. 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.
|
|
10089
|
+
*
|
|
10090
|
+
* @deprecated
|
|
10091
|
+
*/
|
|
10092
|
+
export const databaseAddField = (options) => (options.client ?? client).post({
|
|
10093
|
+
security: [{
|
|
10094
|
+
key: 'database-bearerAuth',
|
|
10095
|
+
scheme: 'bearer',
|
|
10096
|
+
type: 'http'
|
|
10097
|
+
}],
|
|
10098
|
+
url: '/database/v1/databases/{database_id}/tables/{table}/fields',
|
|
10099
|
+
...options,
|
|
10100
|
+
headers: {
|
|
10101
|
+
'Content-Type': 'application/json',
|
|
10102
|
+
...options.headers
|
|
10103
|
+
}
|
|
10104
|
+
});
|
|
10105
|
+
/**
|
|
10106
|
+
* Delete field
|
|
10107
|
+
*
|
|
10108
|
+
* Deprecated: use praxis.database.table.tables.fields.delete instead; this path stops working on 2027-03-01. 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.
|
|
10109
|
+
*
|
|
10110
|
+
* @deprecated
|
|
10111
|
+
*/
|
|
10112
|
+
export const databaseDeleteField = (options) => (options.client ?? client).delete({
|
|
10113
|
+
security: [{
|
|
10114
|
+
key: 'database-bearerAuth',
|
|
10115
|
+
scheme: 'bearer',
|
|
10116
|
+
type: 'http'
|
|
10117
|
+
}],
|
|
10118
|
+
url: '/database/v1/databases/{database_id}/tables/{table}/fields/{field}',
|
|
10119
|
+
...options
|
|
10120
|
+
});
|
|
10121
|
+
/**
|
|
10122
|
+
* Update field
|
|
10123
|
+
*
|
|
10124
|
+
* Deprecated: use praxis.database.table.tables.fields.update instead; this path stops working on 2027-03-01. 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.
|
|
10125
|
+
*
|
|
10126
|
+
* @deprecated
|
|
10127
|
+
*/
|
|
10128
|
+
export const databaseUpdateField = (options) => (options.client ?? client).patch({
|
|
10129
|
+
security: [{
|
|
10130
|
+
key: 'database-bearerAuth',
|
|
10131
|
+
scheme: 'bearer',
|
|
10132
|
+
type: 'http'
|
|
10133
|
+
}],
|
|
10134
|
+
url: '/database/v1/databases/{database_id}/tables/{table}/fields/{field}',
|
|
10135
|
+
...options,
|
|
10136
|
+
headers: {
|
|
10137
|
+
'Content-Type': 'application/json',
|
|
10138
|
+
...options.headers
|
|
10139
|
+
}
|
|
10140
|
+
});
|
|
10141
|
+
/**
|
|
10142
|
+
* List events
|
|
10143
|
+
*
|
|
10144
|
+
* Deprecated: use praxis.database.table.events.list for a table database or praxis.database.kv.events.list for a key-value database instead; this path stops working on 2027-03-01. 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.
|
|
10145
|
+
*
|
|
10146
|
+
* @deprecated
|
|
10147
|
+
*/
|
|
10148
|
+
export const databaseListEvents = (options) => (options.client ?? client).get({
|
|
10149
|
+
security: [{
|
|
10150
|
+
key: 'database-bearerAuth',
|
|
10151
|
+
scheme: 'bearer',
|
|
10152
|
+
type: 'http'
|
|
10153
|
+
}],
|
|
10154
|
+
url: '/database/v1/databases/{database_id}/events',
|
|
10155
|
+
...options
|
|
10156
|
+
});
|
|
10157
|
+
/**
|
|
10158
|
+
* Delete rows
|
|
10159
|
+
*
|
|
10160
|
+
* Deprecated: use praxis.database.table.rest.delete instead; this path stops working on 2027-03-01. 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.
|
|
10161
|
+
*
|
|
10162
|
+
* @deprecated
|
|
9393
10163
|
*/
|
|
9394
10164
|
export const databaseDelete = (options) => (options.client ?? client).delete({
|
|
9395
10165
|
security: [{
|
|
@@ -9403,7 +10173,9 @@ export const databaseDelete = (options) => (options.client ?? client).delete({
|
|
|
9403
10173
|
/**
|
|
9404
10174
|
* Select rows
|
|
9405
10175
|
*
|
|
9406
|
-
* 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.
|
|
10176
|
+
* Deprecated: use praxis.database.table.rest.retrieve instead; this path stops working on 2027-03-01. 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.
|
|
10177
|
+
*
|
|
10178
|
+
* @deprecated
|
|
9407
10179
|
*/
|
|
9408
10180
|
export const databaseSelect = (options) => (options.client ?? client).get({
|
|
9409
10181
|
security: [{
|
|
@@ -9417,7 +10189,9 @@ export const databaseSelect = (options) => (options.client ?? client).get({
|
|
|
9417
10189
|
/**
|
|
9418
10190
|
* Count rows
|
|
9419
10191
|
*
|
|
9420
|
-
* 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.
|
|
10192
|
+
* Deprecated: use praxis.database.table.rest.head instead; this path stops working on 2027-03-01. 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.
|
|
10193
|
+
*
|
|
10194
|
+
* @deprecated
|
|
9421
10195
|
*/
|
|
9422
10196
|
export const databaseHead = (options) => (options.client ?? client).head({
|
|
9423
10197
|
security: [{
|
|
@@ -9431,7 +10205,9 @@ export const databaseHead = (options) => (options.client ?? client).head({
|
|
|
9431
10205
|
/**
|
|
9432
10206
|
* Update rows
|
|
9433
10207
|
*
|
|
9434
|
-
* 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.
|
|
10208
|
+
* Deprecated: use praxis.database.table.rest.update instead; this path stops working on 2027-03-01. 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.
|
|
10209
|
+
*
|
|
10210
|
+
* @deprecated
|
|
9435
10211
|
*/
|
|
9436
10212
|
export const databaseUpdate = (options) => (options.client ?? client).patch({
|
|
9437
10213
|
security: [{
|
|
@@ -9449,9 +10225,11 @@ export const databaseUpdate = (options) => (options.client ?? client).patch({
|
|
|
9449
10225
|
/**
|
|
9450
10226
|
* Insert rows
|
|
9451
10227
|
*
|
|
9452
|
-
* 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.
|
|
10228
|
+
* Deprecated: use praxis.database.table.rest.create instead; this path stops working on 2027-03-01. 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.
|
|
9453
10229
|
* Rows are filled to the union of their keys with null; send Prefer: missing=default to use field defaults for missing keys.
|
|
9454
10230
|
* 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.
|
|
10231
|
+
*
|
|
10232
|
+
* @deprecated
|
|
9455
10233
|
*/
|
|
9456
10234
|
export const databaseInsert = (options) => (options.client ?? client).post({
|
|
9457
10235
|
security: [{
|
|
@@ -9466,6 +10244,114 @@ export const databaseInsert = (options) => (options.client ?? client).post({
|
|
|
9466
10244
|
...options.headers
|
|
9467
10245
|
}
|
|
9468
10246
|
});
|
|
10247
|
+
/**
|
|
10248
|
+
* List keys
|
|
10249
|
+
*
|
|
10250
|
+
* Deprecated: use praxis.database.kv.keys.list instead; this path stops working on 2027-03-01. Browse the keys of a key-value database (kind kv): use it to see what is stored before reading one key with databaseGetKey; to run an arbitrary Redis command (counters, ranges, scans) use databaseExecuteCommand instead. Keys come back in lexicographic key order, one page at a time, as summaries (key, type, remaining TTL, size) without values; expired keys are never returned. pattern filters with a Redis glob (* ? [abc] [^abc]) matched against the whole key, and type keeps one value type. limit is 1–500, default 50; while next_cursor is a string, pass it back unchanged as cursor for the next page; null means this is the last page. Needs a read credential. Errors: 400 INVALID_PARAMS for a limit outside 1–500 or a malformed query; 404 DATABASE_NOT_FOUND for an unknown id; 409 DATABASE_KIND_MISMATCH when the database is a table database.
|
|
10251
|
+
*
|
|
10252
|
+
* @deprecated
|
|
10253
|
+
*/
|
|
10254
|
+
export const databaseListKeys = (options) => (options.client ?? client).get({
|
|
10255
|
+
security: [{
|
|
10256
|
+
key: 'database-bearerAuth',
|
|
10257
|
+
scheme: 'bearer',
|
|
10258
|
+
type: 'http'
|
|
10259
|
+
}],
|
|
10260
|
+
url: '/database/v1/databases/{database_id}/keys',
|
|
10261
|
+
...options
|
|
10262
|
+
});
|
|
10263
|
+
/**
|
|
10264
|
+
* Delete key
|
|
10265
|
+
*
|
|
10266
|
+
* Deprecated: use praxis.database.kv.keys.delete instead; this path stops working on 2027-03-01. Delete one key of a key-value database together with its value; the data cannot be recovered. A key that is absent or has already expired is not an error: the call succeeds with deleted false, so it is safe to retry. To delete many keys at once or by pattern, list them with databaseListKeys or run DEL / UNLINK through databaseExecuteCommand. Needs a read-write credential. Errors: 404 DATABASE_NOT_FOUND for an unknown id; 409 DATABASE_KIND_MISMATCH for a table database; 403 BINDING_READ_ONLY for a read-only credential.
|
|
10267
|
+
*
|
|
10268
|
+
* @deprecated
|
|
10269
|
+
*/
|
|
10270
|
+
export const databaseDeleteKey = (options) => (options.client ?? client).delete({
|
|
10271
|
+
security: [{
|
|
10272
|
+
key: 'database-bearerAuth',
|
|
10273
|
+
scheme: 'bearer',
|
|
10274
|
+
type: 'http'
|
|
10275
|
+
}],
|
|
10276
|
+
url: '/database/v1/databases/{database_id}/keys/{key}',
|
|
10277
|
+
...options
|
|
10278
|
+
});
|
|
10279
|
+
/**
|
|
10280
|
+
* Get key
|
|
10281
|
+
*
|
|
10282
|
+
* Deprecated: use praxis.database.kv.keys.retrieve instead; this path stops working on 2027-03-01. Read one key of a key-value database with its type, TTL, size and value; use databaseListKeys first to find key names. A string value is returned whole. A hash, list, set or zset is returned a page of entries at a time: limit is 1–1000, default 100, and while next_cursor is a string, pass it back unchanged as cursor to read the next page; string values and the last page return next_cursor null. value takes the shape of type: a string; hash as [{field, value}]; list and set as a string array; zset as [{member, score}]. Needs a read credential. Errors: 404 KEY_NOT_FOUND when the key does not exist or has expired; 400 INVALID_PARAMS for a limit outside 1–1000; 404 DATABASE_NOT_FOUND; 409 DATABASE_KIND_MISMATCH for a table database.
|
|
10283
|
+
*
|
|
10284
|
+
* @deprecated
|
|
10285
|
+
*/
|
|
10286
|
+
export const databaseGetKey = (options) => (options.client ?? client).get({
|
|
10287
|
+
security: [{
|
|
10288
|
+
key: 'database-bearerAuth',
|
|
10289
|
+
scheme: 'bearer',
|
|
10290
|
+
type: 'http'
|
|
10291
|
+
}],
|
|
10292
|
+
url: '/database/v1/databases/{database_id}/keys/{key}',
|
|
10293
|
+
...options
|
|
10294
|
+
});
|
|
10295
|
+
/**
|
|
10296
|
+
* Update key
|
|
10297
|
+
*
|
|
10298
|
+
* Deprecated: use praxis.database.kv.keys.update instead; this path stops working on 2027-03-01. Change only the TTL of an existing key of a key-value database, leaving its value alone. update_mask must be ttl_ms (the only writable field) and ttl_ms is required: a positive integer is the new TTL in milliseconds (Redis PEXPIRE), null removes the TTL so the key never expires (PERSIST). To replace the value use databaseSetKey. Returns the key after the change. Needs a read-write credential. Errors: 404 KEY_NOT_FOUND when the key does not exist or has expired; 400 INVALID_PARAMS when update_mask is not ttl_ms or ttl_ms is neither a positive integer nor null; 404 DATABASE_NOT_FOUND; 409 DATABASE_KIND_MISMATCH; 403 BINDING_READ_ONLY.
|
|
10299
|
+
*
|
|
10300
|
+
* @deprecated
|
|
10301
|
+
*/
|
|
10302
|
+
export const databaseUpdateKey = (options) => (options.client ?? client).patch({
|
|
10303
|
+
security: [{
|
|
10304
|
+
key: 'database-bearerAuth',
|
|
10305
|
+
scheme: 'bearer',
|
|
10306
|
+
type: 'http'
|
|
10307
|
+
}],
|
|
10308
|
+
url: '/database/v1/databases/{database_id}/keys/{key}',
|
|
10309
|
+
...options,
|
|
10310
|
+
headers: {
|
|
10311
|
+
'Content-Type': 'application/json',
|
|
10312
|
+
...options.headers
|
|
10313
|
+
}
|
|
10314
|
+
});
|
|
10315
|
+
/**
|
|
10316
|
+
* Set key
|
|
10317
|
+
*
|
|
10318
|
+
* Deprecated: use praxis.database.kv.keys.set instead; this path stops working on 2027-03-01. Overwrite one key of a key-value database with a whole new value in a single transaction, creating it if absent; the previous value is dropped first and never merged, even when the type changes. To change only the TTL use databaseUpdateKey; to add to a counter or push onto a list use databaseExecuteCommand. type decides the shape of value: a string; hash as [{field, value}]; list and set as a string array; zset as [{member, score}] with finite scores. Containers must not be empty, and hash fields and set members must be unique. ttl_ms omitted keeps the key's existing TTL, a positive integer sets a new one in milliseconds, null makes the key permanent. A value is at most 1 MiB and a key at most 1 KiB. Returns the stored key (first page for a container). Needs a read-write credential. Errors: 400 INVALID_PARAMS for an empty container, duplicate field or member, non-finite score or bad ttl_ms; 400 LIMIT_EXCEEDED for an oversized key or value; 503 CAPACITY when the database is full; 404 DATABASE_NOT_FOUND; 409 DATABASE_KIND_MISMATCH; 403 BINDING_READ_ONLY for a read-only credential.
|
|
10319
|
+
*
|
|
10320
|
+
* @deprecated
|
|
10321
|
+
*/
|
|
10322
|
+
export const databaseSetKey = (options) => (options.client ?? client).put({
|
|
10323
|
+
security: [{
|
|
10324
|
+
key: 'database-bearerAuth',
|
|
10325
|
+
scheme: 'bearer',
|
|
10326
|
+
type: 'http'
|
|
10327
|
+
}],
|
|
10328
|
+
url: '/database/v1/databases/{database_id}/keys/{key}',
|
|
10329
|
+
...options,
|
|
10330
|
+
headers: {
|
|
10331
|
+
'Content-Type': 'application/json',
|
|
10332
|
+
...options.headers
|
|
10333
|
+
}
|
|
10334
|
+
});
|
|
10335
|
+
/**
|
|
10336
|
+
* Execute command
|
|
10337
|
+
*
|
|
10338
|
+
* Deprecated: use praxis.database.kv.commands.execute instead; this path stops working on 2027-03-01. Run one Redis command with Redis 7 semantics against a key-value database and get its reply; use it for what the key operations cannot do: counters (INCR), list and set operations, ranges (LRANGE, ZRANGE), scans (SCAN, HSCAN) and expiry commands. For one whole-value read or write use databaseGetKey / databaseSetKey; for existing Redis clients use the Upstash-compatible face under /redis. command is the command name followed by its arguments, every element a string, for example ["SET","k","v"] or ["LRANGE","queue","0","9"]. result is Redis's reply as plain JSON (integers, strings, arrays, null), never base64. Not supported: Lua scripting (EVAL), blocking commands, Pub/Sub and Streams. A value is at most 1 MiB, a key at most 1 KiB, a reply at most 8 MiB (read big collections in ranges with SCAN, HSCAN, LRANGE or ZRANGE) and the database at most 1 GiB. A read command needs a read credential; a write command, or a command that cannot be parsed, needs a read-write credential. Errors: 400 KV_COMMAND_ERROR when Redis rejects the command, with Redis's own text in message (for example WRONGTYPE Operation against a key holding the wrong kind of value or ERR unknown command); 400 INVALID_PARAMS for a missing or empty command; 404 DATABASE_NOT_FOUND; 409 DATABASE_KIND_MISMATCH; 403 BINDING_READ_ONLY for a write on a read-only credential.
|
|
10339
|
+
*
|
|
10340
|
+
* @deprecated
|
|
10341
|
+
*/
|
|
10342
|
+
export const databaseExecuteCommand = (options) => (options.client ?? client).post({
|
|
10343
|
+
security: [{
|
|
10344
|
+
key: 'database-bearerAuth',
|
|
10345
|
+
scheme: 'bearer',
|
|
10346
|
+
type: 'http'
|
|
10347
|
+
}],
|
|
10348
|
+
url: '/database/v1/databases/{database_id}/commands',
|
|
10349
|
+
...options,
|
|
10350
|
+
headers: {
|
|
10351
|
+
'Content-Type': 'application/json',
|
|
10352
|
+
...options.headers
|
|
10353
|
+
}
|
|
10354
|
+
});
|
|
9469
10355
|
/**
|
|
9470
10356
|
* Read a commit's test catalog
|
|
9471
10357
|
*
|