@bunbase-ae/js 2.16.1-next.367.86ccc66 → 2.16.1-next.373.29de22b

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/admin.ts +24 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunbase-ae/js",
3
- "version": "2.16.1-next.367.86ccc66",
3
+ "version": "2.16.1-next.373.29de22b",
4
4
  "type": "module",
5
5
  "description": "TypeScript/JavaScript SDK for BunBase",
6
6
  "license": "UNLICENSED",
package/src/admin.ts CHANGED
@@ -391,15 +391,24 @@ export interface AuditListParams {
391
391
  from?: number;
392
392
  /** Inclusive upper bound (epoch ms). */
393
393
  to?: number;
394
- /** Resume from `next_cursor` returned by a prior call. */
394
+ /**
395
+ * Resume from `next_cursor` returned by a prior call. The audit list is
396
+ * returned newest-first, so successive pages walk **backwards** through
397
+ * history (older rows than the cursor).
398
+ */
395
399
  cursor?: number;
396
400
  /** Page size (server caps at 500, defaults to 50). */
397
401
  limit?: number;
398
402
  }
399
403
 
400
404
  export interface AuditListResult {
405
+ /** Audit rows, ordered most recent first (descending `id`). */
401
406
  items: AuditLogEntry[];
402
- /** Cursor for the next page. `null` when the page wasn't full (end of stream). */
407
+ /**
408
+ * Cursor for the next page (the oldest id on this page). Pass it back as
409
+ * `cursor` to fetch the next page of older rows. `null` when the page
410
+ * wasn't full (end of stream).
411
+ */
403
412
  next_cursor: number | null;
404
413
  limit: number;
405
414
  /**
@@ -1015,6 +1024,12 @@ class AdminStorageClient {
1015
1024
  // `_users`, `_api_keys`, `_impersonate`, `_hooks`, `_logs`, `_backups`, `_files`,
1016
1025
  // and any user-defined collection that has audit emit enabled.
1017
1026
  //
1027
+ // Ordering: rows are returned **most recent first** (descending `id`), matching
1028
+ // every audit-log UI ever built and the precedent set by
1029
+ // `client.admin.settings.getAudit(...)`. Cursor-based pagination walks backwards
1030
+ // through history — `next_cursor` is the id of the last (oldest) row on the
1031
+ // current page; pass it back as `cursor` to fetch the next page of older rows.
1032
+ //
1018
1033
  // Tenant isolation: a JWT-authenticated caller scoped to a tenant only sees
1019
1034
  // rows for that tenant. An admin-secret call sees all rows.
1020
1035
  class AdminAuditClient {
@@ -1573,10 +1588,13 @@ class AdminSequencesClient {
1573
1588
  );
1574
1589
  }
1575
1590
 
1576
- async delete(name: string, opts: SequenceTenantOptions = {}): Promise<void> {
1577
- await this.http.request("DELETE", `/api/v1/admin/sequences/${encodeURIComponent(name)}`, {
1578
- query: tenantQuery(opts),
1579
- });
1591
+ async delete(name: string, opts: SequenceTenantOptions = {}): Promise<boolean> {
1592
+ const res = await this.http.request<{ deleted: boolean }>(
1593
+ "DELETE",
1594
+ `/api/v1/admin/sequences/${encodeURIComponent(name)}`,
1595
+ { query: tenantQuery(opts) },
1596
+ );
1597
+ return res.deleted;
1580
1598
  }
1581
1599
  }
1582
1600