@sparkvault/sdk-js 11.3.0 → 12.0.0

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.
@@ -181,11 +181,19 @@ export declare class IngotsModule {
181
181
  */
182
182
  search(vault: UnsealedVault, options?: SearchIngotsOptions): Promise<IngotPage>;
183
183
  /**
184
- * List a folder, or the vault root, whole: the folder, its breadcrumb trail,
185
- * its direct subfolders and every ingot directly in it, in one response.
184
+ * List one page of a folder's, or the vault root's, children: every direct
185
+ * subfolder first, then the ingots directly in it in creation order
186
+ * ({@link FolderContents}). Pass a page's `nextPageToken` back as
187
+ * `pageToken`, with the same folder and order, until it is null.
186
188
  *
187
189
  * @example
188
- * const { folders, ingots } = await sv.ingots.listContents(unsealed, { folderId: 'fld_x' });
190
+ * let pageToken: string | undefined;
191
+ * do {
192
+ * const page = await sv.ingots.listContents(unsealed, { folderId: 'fld_x', pageToken });
193
+ * page.folders.forEach((f) => console.log(f.name));
194
+ * page.ingots.forEach((i) => console.log(i.name));
195
+ * pageToken = page.nextPageToken ?? undefined;
196
+ * } while (pageToken);
189
197
  */
190
198
  listContents(vault: UnsealedVault, options?: ListContentsOptions): Promise<FolderContents>;
191
199
  /**
@@ -219,29 +219,38 @@ export interface ListIngotsOptions {
219
219
  export interface ListContentsOptions {
220
220
  /** Folder to list (null/omitted lists the vault root) */
221
221
  folderId?: string | null;
222
- /** Ingot sort field (name | size | content_type | created | access_count | bandwidth); `created` by default */
223
- sortBy?: string;
224
- /** Sort direction; `desc` by default */
222
+ /** Most children on one page (1-500; server default 100) */
223
+ limit?: number;
224
+ /** A prior page's `nextPageToken`, for the same folder and order */
225
+ pageToken?: string;
226
+ /** Ingot creation order; `desc` (newest first) by default */
225
227
  sortOrder?: 'asc' | 'desc';
226
228
  }
227
229
  /**
228
- * One folder's whole listing, in one response: the folder itself, the trail
229
- * from the vault root to it, its direct subfolders (pinned first) and every
230
- * ingot directly in it, in the requested order.
230
+ * One page of a folder's listing. The folder's children run as one sequence
231
+ * across its pages: every direct subfolder first, in a stable order that is
232
+ * not by name, then every ingot directly in the folder in creation order
233
+ * (newest first under `desc`). A page holds at most `limit` children in all,
234
+ * so one page can hold the last subfolders and the first ingots, and a page
235
+ * can hold fewer than `limit`, even none, and still not be the last: follow
236
+ * `nextPageToken`, never the count. Ordering by name, size or type is the
237
+ * caller's, over the children it holds.
231
238
  */
232
239
  export interface FolderContents {
233
- /** The folder listed, or null at the vault root */
240
+ /** The folder listed, on every page; null at the vault root */
234
241
  folder: {
235
242
  id: string;
236
243
  name: string;
237
244
  parentId: string | null;
238
245
  } | null;
239
- /** Root → … → the folder listed */
246
+ /** Root → … → the folder listed, on every page */
240
247
  breadcrumb: FolderBreadcrumbItem[];
241
- /** Direct subfolders */
248
+ /** This page's subfolders */
242
249
  folders: Folder[];
243
- /** Every ingot directly in the folder */
250
+ /** This page's ingots */
244
251
  ingots: Ingot[];
252
+ /** The next page's `pageToken`; null on the last page */
253
+ nextPageToken: string | null;
245
254
  }
246
255
  /** Options for search. */
247
256
  export interface SearchIngotsOptions {
@@ -375,7 +384,7 @@ export interface ListIngotsResponse {
375
384
  count?: number;
376
385
  next_cursor?: string;
377
386
  }
378
- /** GET /vaults/:id/contents */
387
+ /** GET /vaults/:id/contents: one page */
379
388
  export interface ListContentsResponse {
380
389
  folder: {
381
390
  folder_id: string;
@@ -388,6 +397,8 @@ export interface ListContentsResponse {
388
397
  }[];
389
398
  folders?: FolderWire[];
390
399
  ingots?: IngotWire[];
400
+ /** Null on the last page; read as null when absent, so a page without it ends the walk instead of looping. */
401
+ next_page_token?: string | null;
391
402
  }
392
403
  export interface DownloadIngotResponse {
393
404
  content_version?: string | null;