@vxil/sdk 0.5.0 → 0.5.1
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/dist/index.d.ts +64 -1
- package/dist/index.js +37 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2189,6 +2189,37 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
|
|
|
2189
2189
|
}>;
|
|
2190
2190
|
};
|
|
2191
2191
|
};
|
|
2192
|
+
/** E-mail CHANGE for a signed-in (non-anonymous) user: a 6-digit code is
|
|
2193
|
+
* mailed to the NEW address; verify swaps the account's address (both the
|
|
2194
|
+
* auth row and the shared identity row, in one transaction), marks it
|
|
2195
|
+
* verified, and revokes every OTHER session of the user (reason
|
|
2196
|
+
* `email_changed`) — the presenting `token` keeps working. `request` is
|
|
2197
|
+
* always 202 whether or not the address is taken (no enumeration);
|
|
2198
|
+
* a taken address surfaces at `verify` as 409 `email_in_use`. A guest
|
|
2199
|
+
* session is 409 `anonymous_user` — guests use `anonymous.link`. Shares
|
|
2200
|
+
* the OTP knobs (cooldown → 429 `otp_rate_limited`, attempts, TTL,
|
|
2201
|
+
* `test_code` for `otp.testRecipients`) but does NOT need `otp.enabled`. */
|
|
2202
|
+
email: {
|
|
2203
|
+
change: {
|
|
2204
|
+
request: (input: {
|
|
2205
|
+
token: string;
|
|
2206
|
+
new_email: string;
|
|
2207
|
+
locale?: string;
|
|
2208
|
+
}) => Promise<{
|
|
2209
|
+
sent: true;
|
|
2210
|
+
test_code?: string;
|
|
2211
|
+
}>;
|
|
2212
|
+
verify: (input: {
|
|
2213
|
+
token: string;
|
|
2214
|
+
new_email: string;
|
|
2215
|
+
code: string;
|
|
2216
|
+
}) => Promise<{
|
|
2217
|
+
user_id: string;
|
|
2218
|
+
email: string;
|
|
2219
|
+
verified: true;
|
|
2220
|
+
}>;
|
|
2221
|
+
};
|
|
2222
|
+
};
|
|
2192
2223
|
/** Step-up re-auth: an OTP challenge on the CURRENT session. On verify the
|
|
2193
2224
|
* bearer token ROTATES (the returned session.token replaces the old one —
|
|
2194
2225
|
* swap it client-side) and the JWT gains an `elv` claim. */
|
|
@@ -2668,6 +2699,21 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
|
|
|
2668
2699
|
}>;
|
|
2669
2700
|
scanned: number;
|
|
2670
2701
|
}>;
|
|
2702
|
+
/** SERVER-ONLY (403 server_only in end-user mode). Account merge: move
|
|
2703
|
+
* every row `from_user_id` owns — across every collection that declares
|
|
2704
|
+
* an `owner_field`, soft-deleted rows included, the stored owner value
|
|
2705
|
+
* AND its indexed projection — onto `into_user_id`. ONE bounded page (≤500
|
|
2706
|
+
* rows) per call: loop while `done` is false. Idempotent (a second pass
|
|
2707
|
+
* moves 0). Bumps each moved row's `version`. The cms consumer of the
|
|
2708
|
+
* `auth.user.merged { from, into }` event; auth-v1 calls it after a
|
|
2709
|
+
* merge, the event is the backstop. Emits one `cms.items.rekeyed`. */
|
|
2710
|
+
reKey: (input: {
|
|
2711
|
+
from_user_id: string;
|
|
2712
|
+
into_user_id: string;
|
|
2713
|
+
}) => Promise<{
|
|
2714
|
+
moved: number;
|
|
2715
|
+
done: boolean;
|
|
2716
|
+
}>;
|
|
2671
2717
|
};
|
|
2672
2718
|
/** cms-rel B4 (cms.md §13): atomic multi-collection transaction — 1–5
|
|
2673
2719
|
* steps over ≤3 collections, per-step `$where` CAS preconditions (the
|
|
@@ -3505,6 +3551,22 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
|
|
|
3505
3551
|
object_id: string;
|
|
3506
3552
|
expires_at: string | null;
|
|
3507
3553
|
}>;
|
|
3554
|
+
/** SERVER-ONLY (403 server_only in end-user mode). Account merge: move
|
|
3555
|
+
* every object `from_user_id` owns (every status, tombstones included) and
|
|
3556
|
+
* the shared links minted on them onto `into_user_id`, which must be a
|
|
3557
|
+
* live tenant user (404 user_not_found otherwise). ONE bounded page (≤500
|
|
3558
|
+
* objects) per call: loop while `done` is false. Idempotent. An erased
|
|
3559
|
+
* `from` user's objects are held back for the GDPR byte sweep (moved 0).
|
|
3560
|
+
* The files consumer of the `auth.user.merged { from, into }` event;
|
|
3561
|
+
* auth-v1 calls it after a merge, the event is the backstop. Emits one
|
|
3562
|
+
* `files.objects.rekeyed`. */
|
|
3563
|
+
reKey: (input: {
|
|
3564
|
+
from_user_id: string;
|
|
3565
|
+
into_user_id: string;
|
|
3566
|
+
}) => Promise<{
|
|
3567
|
+
moved: number;
|
|
3568
|
+
done: boolean;
|
|
3569
|
+
}>;
|
|
3508
3570
|
sharedLinks: {
|
|
3509
3571
|
/** Public (unauthenticated) URL for the object; revocable. Optional
|
|
3510
3572
|
* `max_downloads` (1 = one-time link) and an absolute `expires_at`; the
|
|
@@ -3614,7 +3676,8 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
|
|
|
3614
3676
|
* openrouter) route via BYO keys in tenant_secrets. `images` on the generate
|
|
3615
3677
|
* inputs takes up to 8 vision refs: a public https:// URL, a
|
|
3616
3678
|
* data:image/...;base64 URL, or file:<object_id> (a files-feature object) —
|
|
3617
|
-
* fetched images are capped at 4 MiB each /
|
|
3679
|
+
* fetched images are capped at 4 MiB each; `documents` (pdf/text, ≤10 MiB
|
|
3680
|
+
* each) share one 20 MiB inline ceiling per request with them.
|
|
3618
3681
|
*/
|
|
3619
3682
|
readonly ai: {
|
|
3620
3683
|
templates: {
|
package/dist/index.js
CHANGED
|
@@ -664,6 +664,22 @@ export class Vxil {
|
|
|
664
664
|
verify: async (input) => (await this.call('POST', '/v1/auth/anonymous/link/verify', input)).data,
|
|
665
665
|
},
|
|
666
666
|
},
|
|
667
|
+
/** E-mail CHANGE for a signed-in (non-anonymous) user: a 6-digit code is
|
|
668
|
+
* mailed to the NEW address; verify swaps the account's address (both the
|
|
669
|
+
* auth row and the shared identity row, in one transaction), marks it
|
|
670
|
+
* verified, and revokes every OTHER session of the user (reason
|
|
671
|
+
* `email_changed`) — the presenting `token` keeps working. `request` is
|
|
672
|
+
* always 202 whether or not the address is taken (no enumeration);
|
|
673
|
+
* a taken address surfaces at `verify` as 409 `email_in_use`. A guest
|
|
674
|
+
* session is 409 `anonymous_user` — guests use `anonymous.link`. Shares
|
|
675
|
+
* the OTP knobs (cooldown → 429 `otp_rate_limited`, attempts, TTL,
|
|
676
|
+
* `test_code` for `otp.testRecipients`) but does NOT need `otp.enabled`. */
|
|
677
|
+
email: {
|
|
678
|
+
change: {
|
|
679
|
+
request: async (input) => (await this.call('POST', '/v1/auth/email/change/request', input)).data,
|
|
680
|
+
verify: async (input) => (await this.call('POST', '/v1/auth/email/change/verify', input)).data,
|
|
681
|
+
},
|
|
682
|
+
},
|
|
667
683
|
/** Step-up re-auth: an OTP challenge on the CURRENT session. On verify the
|
|
668
684
|
* bearer token ROTATES (the returned session.token replaces the old one —
|
|
669
685
|
* swap it client-side) and the JWT gains an `elv` claim. */
|
|
@@ -983,6 +999,15 @@ export class Vxil {
|
|
|
983
999
|
* row_number|rank|percent_rank, computed over ≤500 aggregated groups
|
|
984
1000
|
* (never raw rows), optional partitionBy. Same scan cap as aggregate. */
|
|
985
1001
|
rank: async (collection, body) => (await this.call('POST', `/v1/cms/items/${encodeURIComponent(collection)}/rank`, body)).data,
|
|
1002
|
+
/** SERVER-ONLY (403 server_only in end-user mode). Account merge: move
|
|
1003
|
+
* every row `from_user_id` owns — across every collection that declares
|
|
1004
|
+
* an `owner_field`, soft-deleted rows included, the stored owner value
|
|
1005
|
+
* AND its indexed projection — onto `into_user_id`. ONE bounded page (≤500
|
|
1006
|
+
* rows) per call: loop while `done` is false. Idempotent (a second pass
|
|
1007
|
+
* moves 0). Bumps each moved row's `version`. The cms consumer of the
|
|
1008
|
+
* `auth.user.merged { from, into }` event; auth-v1 calls it after a
|
|
1009
|
+
* merge, the event is the backstop. Emits one `cms.items.rekeyed`. */
|
|
1010
|
+
reKey: async (input) => (await this.call('POST', '/v1/cms/items/re-key', input)).data,
|
|
986
1011
|
},
|
|
987
1012
|
/** cms-rel B4 (cms.md §13): atomic multi-collection transaction — 1–5
|
|
988
1013
|
* steps over ≤3 collections, per-step `$where` CAS preconditions (the
|
|
@@ -1365,6 +1390,16 @@ export class Vxil {
|
|
|
1365
1390
|
/** Set / extend / clear an object's TTL. `expiresInSeconds: null` clears it
|
|
1366
1391
|
* (else a future auto-delete after the given seconds; minimum 60). */
|
|
1367
1392
|
setTtl: async (objectId, expiresInSeconds) => (await this.call('PUT', `/v1/files/${encodeURIComponent(objectId)}/ttl`, { expiresInSeconds })).data,
|
|
1393
|
+
/** SERVER-ONLY (403 server_only in end-user mode). Account merge: move
|
|
1394
|
+
* every object `from_user_id` owns (every status, tombstones included) and
|
|
1395
|
+
* the shared links minted on them onto `into_user_id`, which must be a
|
|
1396
|
+
* live tenant user (404 user_not_found otherwise). ONE bounded page (≤500
|
|
1397
|
+
* objects) per call: loop while `done` is false. Idempotent. An erased
|
|
1398
|
+
* `from` user's objects are held back for the GDPR byte sweep (moved 0).
|
|
1399
|
+
* The files consumer of the `auth.user.merged { from, into }` event;
|
|
1400
|
+
* auth-v1 calls it after a merge, the event is the backstop. Emits one
|
|
1401
|
+
* `files.objects.rekeyed`. */
|
|
1402
|
+
reKey: async (input) => (await this.call('POST', '/v1/files/objects/re-key', input)).data,
|
|
1368
1403
|
sharedLinks: {
|
|
1369
1404
|
/** Public (unauthenticated) URL for the object; revocable. Optional
|
|
1370
1405
|
* `max_downloads` (1 = one-time link) and an absolute `expires_at`; the
|
|
@@ -1432,7 +1467,8 @@ export class Vxil {
|
|
|
1432
1467
|
* openrouter) route via BYO keys in tenant_secrets. `images` on the generate
|
|
1433
1468
|
* inputs takes up to 8 vision refs: a public https:// URL, a
|
|
1434
1469
|
* data:image/...;base64 URL, or file:<object_id> (a files-feature object) —
|
|
1435
|
-
* fetched images are capped at 4 MiB each /
|
|
1470
|
+
* fetched images are capped at 4 MiB each; `documents` (pdf/text, ≤10 MiB
|
|
1471
|
+
* each) share one 20 MiB inline ceiling per request with them.
|
|
1436
1472
|
*/
|
|
1437
1473
|
ai = {
|
|
1438
1474
|
templates: {
|
package/package.json
CHANGED