@bunbase-ae/js 2.16.1-next.369.ceb4362 → 2.16.1-next.378.707ff9f

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunbase-ae/js",
3
- "version": "2.16.1-next.369.ceb4362",
3
+ "version": "2.16.1-next.378.707ff9f",
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
  /**
@@ -961,12 +970,14 @@ class AdminStorageClient {
961
970
  isPublic: boolean;
962
971
  collection?: string;
963
972
  bucket?: string;
973
+ recordId?: string;
964
974
  }): Promise<AdminStoredFile> {
965
975
  const form = new FormData();
966
976
  form.append("file", params.file, params.filename);
967
977
  form.append("is_public", params.isPublic ? "true" : "false");
968
978
  if (params.collection) form.append("collection", params.collection);
969
979
  if (params.bucket) form.append("bucket", params.bucket);
980
+ if (params.recordId) form.append("record_id", params.recordId);
970
981
  return this.http.request<AdminStoredFile>("POST", "/api/v1/admin/storage/upload", {
971
982
  formData: form,
972
983
  });
@@ -1015,6 +1026,12 @@ class AdminStorageClient {
1015
1026
  // `_users`, `_api_keys`, `_impersonate`, `_hooks`, `_logs`, `_backups`, `_files`,
1016
1027
  // and any user-defined collection that has audit emit enabled.
1017
1028
  //
1029
+ // Ordering: rows are returned **most recent first** (descending `id`), matching
1030
+ // every audit-log UI ever built and the precedent set by
1031
+ // `client.admin.settings.getAudit(...)`. Cursor-based pagination walks backwards
1032
+ // through history — `next_cursor` is the id of the last (oldest) row on the
1033
+ // current page; pass it back as `cursor` to fetch the next page of older rows.
1034
+ //
1018
1035
  // Tenant isolation: a JWT-authenticated caller scoped to a tenant only sees
1019
1036
  // rows for that tenant. An admin-secret call sees all rows.
1020
1037
  class AdminAuditClient {
package/src/types.ts CHANGED
@@ -85,6 +85,7 @@ export interface FileRecord {
85
85
  collection: string | null;
86
86
  record_id: string | null;
87
87
  owner_id: string | null;
88
+ tenant_id: string | null;
88
89
  size: number;
89
90
  mime_type: string;
90
91
  is_public: boolean;