@inneropen/marvin-sdk 2.0.0-next.23 → 2.0.0-next.25
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/{chunk-CIFRKLJS.js → chunk-DCTX4NSF.js} +24 -126
- package/dist/index-D5zkKa4N.d.cts +3394 -0
- package/dist/index-D5zkKa4N.d.ts +3394 -0
- package/dist/index.cjs +24 -126
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/{marvin-B6kWCfmU.d.ts → marvin-DDpwJbmj.d.ts} +83 -104
- package/dist/{marvin-ixVRMtIS.d.cts → marvin-DcQimSKv.d.cts} +83 -104
- package/dist/platform.cjs +1 -14
- package/dist/platform.d.cts +28 -3521
- package/dist/platform.d.ts +28 -3521
- package/dist/platform.js +1 -14
- package/dist/publish.cjs +24 -126
- package/dist/publish.d.cts +3 -3
- package/dist/publish.d.ts +3 -3
- package/dist/publish.js +1 -1
- package/dist/types/index.d.cts +1 -218
- package/dist/types/index.d.ts +1 -218
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PublishedEntryType, MarvinResource,
|
|
1
|
+
import { k as PublishedEntryType, h as MarvinResource, M as MarvinAsset, c as MarvinCollection, e as MarvinEntryListItem, j as PublishedCollectionSummary, d as MarvinEntry, P as PublishedAssetRead, l as PublishedResourceRead, i as MarvinSite, m as components, b as GetResourcesOptions$1 } from './index-D5zkKa4N.js';
|
|
2
2
|
import { H as HttpClient } from './HttpClient-CdF3IHM1.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -212,30 +212,17 @@ declare class RenderersModule {
|
|
|
212
212
|
|
|
213
213
|
declare class Resource {
|
|
214
214
|
private data;
|
|
215
|
-
|
|
216
|
-
private workspaceSlug;
|
|
217
|
-
constructor(data: MarvinResource, http: MarvinHttpClient, workspaceSlug: string);
|
|
218
|
-
get id(): string;
|
|
215
|
+
constructor(data: MarvinResource);
|
|
219
216
|
get name(): string;
|
|
220
217
|
get slug(): string;
|
|
221
|
-
get resourceType(): string
|
|
222
|
-
get description(): string | undefined;
|
|
223
|
-
get externalId(): string | undefined;
|
|
224
|
-
get url(): string | undefined;
|
|
225
|
-
get
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
* Get all entries that reference this resource
|
|
230
|
-
*/
|
|
231
|
-
entries(): Promise<MarvinEntry[]>;
|
|
232
|
-
/**
|
|
233
|
-
* Get assets related to this resource (future)
|
|
234
|
-
*/
|
|
235
|
-
assets(): Promise<MarvinAsset[]>;
|
|
236
|
-
/**
|
|
237
|
-
* Get raw resource data
|
|
238
|
-
*/
|
|
218
|
+
get resourceType(): string;
|
|
219
|
+
get description(): string | null | undefined;
|
|
220
|
+
get externalId(): string | null | undefined;
|
|
221
|
+
get url(): string | null | undefined;
|
|
222
|
+
get metadataJson(): {
|
|
223
|
+
[key: string]: unknown;
|
|
224
|
+
} | null | undefined;
|
|
225
|
+
get entries(): string[];
|
|
239
226
|
toJSON(): MarvinResource;
|
|
240
227
|
}
|
|
241
228
|
|
|
@@ -261,9 +248,9 @@ declare class ResourcesModule {
|
|
|
261
248
|
*/
|
|
262
249
|
get(slug: string): Promise<Resource>;
|
|
263
250
|
/**
|
|
264
|
-
* Get
|
|
251
|
+
* Get entry slugs that reference this resource
|
|
265
252
|
*/
|
|
266
|
-
entries(slug: string): Promise<
|
|
253
|
+
entries(slug: string): Promise<string[]>;
|
|
267
254
|
}
|
|
268
255
|
|
|
269
256
|
/**
|
|
@@ -307,35 +294,19 @@ declare class AssetsModule {
|
|
|
307
294
|
|
|
308
295
|
declare class Collection {
|
|
309
296
|
private data;
|
|
310
|
-
|
|
311
|
-
private workspaceSlug;
|
|
312
|
-
constructor(data: MarvinCollection, http: MarvinHttpClient, workspaceSlug: string);
|
|
313
|
-
get id(): string;
|
|
297
|
+
constructor(data: MarvinCollection);
|
|
314
298
|
get name(): string;
|
|
315
299
|
get slug(): string;
|
|
316
|
-
get description(): string | undefined;
|
|
317
|
-
get icon(): string | undefined;
|
|
318
|
-
get color(): string | undefined;
|
|
319
|
-
get sortOrder(): number;
|
|
300
|
+
get description(): string | null | undefined;
|
|
320
301
|
get isSmart(): boolean;
|
|
321
|
-
get smartRules():
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
* Get assets in this collection (future)
|
|
330
|
-
*/
|
|
331
|
-
assets(): Promise<MarvinAsset[]>;
|
|
332
|
-
/**
|
|
333
|
-
* Get collection metadata (future)
|
|
334
|
-
*/
|
|
335
|
-
metadata(): Promise<any>;
|
|
336
|
-
/**
|
|
337
|
-
* Get raw collection data
|
|
338
|
-
*/
|
|
302
|
+
get smartRules(): {
|
|
303
|
+
[key: string]: unknown;
|
|
304
|
+
} | null | undefined;
|
|
305
|
+
get metadataJson(): {
|
|
306
|
+
[key: string]: unknown;
|
|
307
|
+
} | null | undefined;
|
|
308
|
+
get entryCount(): number;
|
|
309
|
+
get entries(): MarvinEntryListItem[];
|
|
339
310
|
toJSON(): MarvinCollection;
|
|
340
311
|
}
|
|
341
312
|
|
|
@@ -350,7 +321,7 @@ declare class CollectionsModule {
|
|
|
350
321
|
/**
|
|
351
322
|
* Get all collections
|
|
352
323
|
*/
|
|
353
|
-
list(): Promise<
|
|
324
|
+
list(): Promise<PublishedCollectionSummary[]>;
|
|
354
325
|
/**
|
|
355
326
|
* Get a single collection by slug
|
|
356
327
|
* Returns null if collection is not found (404)
|
|
@@ -360,24 +331,14 @@ declare class CollectionsModule {
|
|
|
360
331
|
* Get entries in a collection
|
|
361
332
|
* Returns empty array if collection is not found
|
|
362
333
|
*/
|
|
363
|
-
entries(slug: string): Promise<
|
|
334
|
+
entries(slug: string): Promise<MarvinEntryListItem[]>;
|
|
364
335
|
/**
|
|
365
336
|
* Try multiple collection slugs in fallback order
|
|
366
337
|
* Returns the first collection that exists and has entries
|
|
367
|
-
*
|
|
368
|
-
* @param slugs - Collection slugs to try in order
|
|
369
|
-
* @param options - Options for fallback behavior
|
|
370
|
-
* @returns Entries from the first matching collection, or empty array
|
|
371
|
-
*
|
|
372
|
-
* @example
|
|
373
|
-
* ```ts
|
|
374
|
-
* // Try bench-notes, then journal, then blog
|
|
375
|
-
* const entries = await collections.fallback(['bench-notes', 'journal', 'blog']);
|
|
376
|
-
* ```
|
|
377
338
|
*/
|
|
378
339
|
fallback(slugs: string[], options?: {
|
|
379
340
|
requireEntries?: boolean;
|
|
380
|
-
}): Promise<
|
|
341
|
+
}): Promise<MarvinEntryListItem[]>;
|
|
381
342
|
}
|
|
382
343
|
|
|
383
344
|
/**
|
|
@@ -386,9 +347,7 @@ declare class CollectionsModule {
|
|
|
386
347
|
|
|
387
348
|
declare class Entry {
|
|
388
349
|
private raw;
|
|
389
|
-
|
|
390
|
-
private workspaceSlug;
|
|
391
|
-
constructor(raw: MarvinEntry, http: MarvinHttpClient, workspaceSlug: string);
|
|
350
|
+
constructor(raw: MarvinEntry);
|
|
392
351
|
get title(): string;
|
|
393
352
|
get slug(): string;
|
|
394
353
|
get summary(): string | null | undefined;
|
|
@@ -398,13 +357,19 @@ declare class Entry {
|
|
|
398
357
|
renderer?: string | null;
|
|
399
358
|
package?: string | null;
|
|
400
359
|
version?: string | null;
|
|
401
|
-
config?:
|
|
360
|
+
config?: {
|
|
361
|
+
[key: string]: unknown;
|
|
362
|
+
} | null;
|
|
402
363
|
publishable: boolean;
|
|
403
364
|
submittable: boolean;
|
|
404
365
|
routable: boolean;
|
|
405
366
|
} | null | undefined;
|
|
406
|
-
get data():
|
|
407
|
-
|
|
367
|
+
get data(): {
|
|
368
|
+
[key: string]: unknown;
|
|
369
|
+
};
|
|
370
|
+
get metadataJson(): {
|
|
371
|
+
[key: string]: unknown;
|
|
372
|
+
} | null | undefined;
|
|
408
373
|
get publishedAt(): string | null | undefined;
|
|
409
374
|
get order(): number | null | undefined;
|
|
410
375
|
get assets(): PublishedAssetRead[];
|
|
@@ -412,7 +377,6 @@ declare class Entry {
|
|
|
412
377
|
get resources(): PublishedResourceRead[];
|
|
413
378
|
field<T = unknown>(key: string): T | undefined;
|
|
414
379
|
get fields(): Record<string, unknown>;
|
|
415
|
-
relatedEntries(): Promise<MarvinEntry[]>;
|
|
416
380
|
toJSON(): MarvinEntry;
|
|
417
381
|
}
|
|
418
382
|
|
|
@@ -434,7 +398,7 @@ declare class EntriesModule {
|
|
|
434
398
|
/**
|
|
435
399
|
* Get all published entries
|
|
436
400
|
*/
|
|
437
|
-
list(options?: GetEntriesOptions): Promise<
|
|
401
|
+
list(options?: GetEntriesOptions): Promise<MarvinEntryListItem[]>;
|
|
438
402
|
/**
|
|
439
403
|
* Get a single entry by slug
|
|
440
404
|
* Returns null if entry is not found (404)
|
|
@@ -443,15 +407,15 @@ declare class EntriesModule {
|
|
|
443
407
|
/**
|
|
444
408
|
* Convenience: Get all pages
|
|
445
409
|
*/
|
|
446
|
-
pages(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<
|
|
410
|
+
pages(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<MarvinEntryListItem[]>;
|
|
447
411
|
/**
|
|
448
412
|
* Convenience: Get all blog posts
|
|
449
413
|
*/
|
|
450
|
-
posts(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<
|
|
414
|
+
posts(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<MarvinEntryListItem[]>;
|
|
451
415
|
/**
|
|
452
416
|
* Convenience: Get all projects
|
|
453
417
|
*/
|
|
454
|
-
projects(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<
|
|
418
|
+
projects(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<MarvinEntryListItem[]>;
|
|
455
419
|
}
|
|
456
420
|
|
|
457
421
|
/**
|
|
@@ -494,7 +458,6 @@ declare class Workspace {
|
|
|
494
458
|
}
|
|
495
459
|
|
|
496
460
|
declare class MarvinClient {
|
|
497
|
-
private config;
|
|
498
461
|
private http;
|
|
499
462
|
private cache;
|
|
500
463
|
private workspace;
|
|
@@ -551,15 +514,51 @@ declare class MarvinClient {
|
|
|
551
514
|
/**
|
|
552
515
|
* Get all pages
|
|
553
516
|
*/
|
|
554
|
-
pages(options?: GetEntriesOptions): Promise<
|
|
517
|
+
pages(options?: GetEntriesOptions): Promise<{
|
|
518
|
+
slug: string;
|
|
519
|
+
title: string;
|
|
520
|
+
entryType: string;
|
|
521
|
+
entryTypeInfo?: components["schemas"]["PublishedEntryTypeInfo"] | null;
|
|
522
|
+
summary?: string | null;
|
|
523
|
+
publishedAt?: string | null;
|
|
524
|
+
status: string;
|
|
525
|
+
collections: string[];
|
|
526
|
+
assetSlugs: string[];
|
|
527
|
+
resourceSlugs: string[];
|
|
528
|
+
order?: number | null;
|
|
529
|
+
}[]>;
|
|
555
530
|
/**
|
|
556
531
|
* Get all blog posts
|
|
557
532
|
*/
|
|
558
|
-
posts(options?: GetEntriesOptions): Promise<
|
|
533
|
+
posts(options?: GetEntriesOptions): Promise<{
|
|
534
|
+
slug: string;
|
|
535
|
+
title: string;
|
|
536
|
+
entryType: string;
|
|
537
|
+
entryTypeInfo?: components["schemas"]["PublishedEntryTypeInfo"] | null;
|
|
538
|
+
summary?: string | null;
|
|
539
|
+
publishedAt?: string | null;
|
|
540
|
+
status: string;
|
|
541
|
+
collections: string[];
|
|
542
|
+
assetSlugs: string[];
|
|
543
|
+
resourceSlugs: string[];
|
|
544
|
+
order?: number | null;
|
|
545
|
+
}[]>;
|
|
559
546
|
/**
|
|
560
547
|
* Get all projects
|
|
561
548
|
*/
|
|
562
|
-
projects(options?: GetEntriesOptions): Promise<
|
|
549
|
+
projects(options?: GetEntriesOptions): Promise<{
|
|
550
|
+
slug: string;
|
|
551
|
+
title: string;
|
|
552
|
+
entryType: string;
|
|
553
|
+
entryTypeInfo?: components["schemas"]["PublishedEntryTypeInfo"] | null;
|
|
554
|
+
summary?: string | null;
|
|
555
|
+
publishedAt?: string | null;
|
|
556
|
+
status: string;
|
|
557
|
+
collections: string[];
|
|
558
|
+
assetSlugs: string[];
|
|
559
|
+
resourceSlugs: string[];
|
|
560
|
+
order?: number | null;
|
|
561
|
+
}[]>;
|
|
563
562
|
/**
|
|
564
563
|
* Get a single resource by slug
|
|
565
564
|
*/
|
|
@@ -567,70 +566,50 @@ declare class MarvinClient {
|
|
|
567
566
|
/**
|
|
568
567
|
* Try multiple collection slugs in fallback order
|
|
569
568
|
* Returns entries from the first collection that exists and has content
|
|
570
|
-
*
|
|
571
|
-
* @param slugs - Collection slugs to try in order
|
|
572
|
-
* @param options - Options for fallback behavior
|
|
573
|
-
* @returns Entries from the first matching collection, or empty array
|
|
574
|
-
*
|
|
575
|
-
* @example
|
|
576
|
-
* ```ts
|
|
577
|
-
* // Try bench-notes, then journal, then blog
|
|
578
|
-
* const entries = await client.collectionFallback(['bench-notes', 'journal', 'blog']);
|
|
579
|
-
* ```
|
|
580
569
|
*/
|
|
581
570
|
collectionFallback(slugs: string[], options?: {
|
|
582
571
|
requireEntries?: boolean;
|
|
583
|
-
}): Promise<
|
|
572
|
+
}): Promise<MarvinEntryListItem[]>;
|
|
584
573
|
/**
|
|
585
574
|
* @deprecated Use workspace.site or marvin.site instead
|
|
586
|
-
* Get site configuration
|
|
587
575
|
*/
|
|
588
576
|
getSite(): Promise<MarvinSite>;
|
|
589
577
|
/**
|
|
590
578
|
* @deprecated Use workspace.entries.list() instead
|
|
591
|
-
* Get all published entries
|
|
592
579
|
*/
|
|
593
|
-
getEntries(options?: GetEntriesOptions): Promise<
|
|
580
|
+
getEntries(options?: GetEntriesOptions): Promise<MarvinEntryListItem[]>;
|
|
594
581
|
/**
|
|
595
582
|
* @deprecated Use workspace.entries.get() instead
|
|
596
|
-
* Get a single published entry by slug
|
|
597
583
|
*/
|
|
598
584
|
getEntry(slug: string): Promise<MarvinEntry | null>;
|
|
599
585
|
/**
|
|
600
586
|
* @deprecated Use workspace.collections.list() instead
|
|
601
|
-
* Get all collections
|
|
602
587
|
*/
|
|
603
|
-
getCollections(): Promise<
|
|
588
|
+
getCollections(): Promise<PublishedCollectionSummary[]>;
|
|
604
589
|
/**
|
|
605
590
|
* @deprecated Use workspace.collections.get() instead
|
|
606
|
-
* Get a single collection by slug
|
|
607
591
|
*/
|
|
608
592
|
getCollection(slug: string): Promise<MarvinCollection | null>;
|
|
609
593
|
/**
|
|
610
594
|
* @deprecated Use workspace.collections.entries() instead
|
|
611
|
-
* Get all entries in a collection
|
|
612
595
|
*/
|
|
613
|
-
getCollectionEntries(slug: string): Promise<
|
|
596
|
+
getCollectionEntries(slug: string): Promise<MarvinEntryListItem[]>;
|
|
614
597
|
/**
|
|
615
598
|
* @deprecated Use workspace.assets.list() instead
|
|
616
|
-
* Get all published assets
|
|
617
599
|
*/
|
|
618
600
|
getAssets(options?: GetAssetsOptions): Promise<MarvinAsset[]>;
|
|
619
601
|
/**
|
|
620
602
|
* @deprecated Use workspace.resources.list() instead
|
|
621
|
-
* Get all published resources
|
|
622
603
|
*/
|
|
623
604
|
getResources(options?: GetResourcesOptions$1): Promise<MarvinResource[]>;
|
|
624
605
|
/**
|
|
625
606
|
* @deprecated Use workspace.resources.get() instead
|
|
626
|
-
* Get a single resource by slug
|
|
627
607
|
*/
|
|
628
608
|
getResource(slug: string): Promise<MarvinResource>;
|
|
629
609
|
/**
|
|
630
610
|
* @deprecated Use workspace.resources.entries() instead
|
|
631
|
-
* Get entries that reference a resource
|
|
632
611
|
*/
|
|
633
|
-
getResourceEntries(slug: string): Promise<
|
|
612
|
+
getResourceEntries(slug: string): Promise<string[]>;
|
|
634
613
|
}
|
|
635
614
|
|
|
636
615
|
export { Collection as C, Entry as E, type MarvinConfig as M, type PaginatedResponse as P, Resource as R, Workspace as W, MarvinClient as a, MarvinApiError as b, MarvinAuthError as c, MarvinCache as d, MarvinConfigError as e, MarvinError as f, MarvinNetworkError as g, MarvinNotFoundError as h, MarvinServerError as i, MarvinValidationError as j, type PaginationMeta as k, type PaginationParams as l, createConfigFromEnv as m, createPaginatedResponse as n, extractData as o, isPaginatedResponse as p, offsetToPage as q, pageToOffset as r };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PublishedEntryType, MarvinResource,
|
|
1
|
+
import { k as PublishedEntryType, h as MarvinResource, M as MarvinAsset, c as MarvinCollection, e as MarvinEntryListItem, j as PublishedCollectionSummary, d as MarvinEntry, P as PublishedAssetRead, l as PublishedResourceRead, i as MarvinSite, m as components, b as GetResourcesOptions$1 } from './index-D5zkKa4N.cjs';
|
|
2
2
|
import { H as HttpClient } from './HttpClient-CdF3IHM1.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -212,30 +212,17 @@ declare class RenderersModule {
|
|
|
212
212
|
|
|
213
213
|
declare class Resource {
|
|
214
214
|
private data;
|
|
215
|
-
|
|
216
|
-
private workspaceSlug;
|
|
217
|
-
constructor(data: MarvinResource, http: MarvinHttpClient, workspaceSlug: string);
|
|
218
|
-
get id(): string;
|
|
215
|
+
constructor(data: MarvinResource);
|
|
219
216
|
get name(): string;
|
|
220
217
|
get slug(): string;
|
|
221
|
-
get resourceType(): string
|
|
222
|
-
get description(): string | undefined;
|
|
223
|
-
get externalId(): string | undefined;
|
|
224
|
-
get url(): string | undefined;
|
|
225
|
-
get
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
* Get all entries that reference this resource
|
|
230
|
-
*/
|
|
231
|
-
entries(): Promise<MarvinEntry[]>;
|
|
232
|
-
/**
|
|
233
|
-
* Get assets related to this resource (future)
|
|
234
|
-
*/
|
|
235
|
-
assets(): Promise<MarvinAsset[]>;
|
|
236
|
-
/**
|
|
237
|
-
* Get raw resource data
|
|
238
|
-
*/
|
|
218
|
+
get resourceType(): string;
|
|
219
|
+
get description(): string | null | undefined;
|
|
220
|
+
get externalId(): string | null | undefined;
|
|
221
|
+
get url(): string | null | undefined;
|
|
222
|
+
get metadataJson(): {
|
|
223
|
+
[key: string]: unknown;
|
|
224
|
+
} | null | undefined;
|
|
225
|
+
get entries(): string[];
|
|
239
226
|
toJSON(): MarvinResource;
|
|
240
227
|
}
|
|
241
228
|
|
|
@@ -261,9 +248,9 @@ declare class ResourcesModule {
|
|
|
261
248
|
*/
|
|
262
249
|
get(slug: string): Promise<Resource>;
|
|
263
250
|
/**
|
|
264
|
-
* Get
|
|
251
|
+
* Get entry slugs that reference this resource
|
|
265
252
|
*/
|
|
266
|
-
entries(slug: string): Promise<
|
|
253
|
+
entries(slug: string): Promise<string[]>;
|
|
267
254
|
}
|
|
268
255
|
|
|
269
256
|
/**
|
|
@@ -307,35 +294,19 @@ declare class AssetsModule {
|
|
|
307
294
|
|
|
308
295
|
declare class Collection {
|
|
309
296
|
private data;
|
|
310
|
-
|
|
311
|
-
private workspaceSlug;
|
|
312
|
-
constructor(data: MarvinCollection, http: MarvinHttpClient, workspaceSlug: string);
|
|
313
|
-
get id(): string;
|
|
297
|
+
constructor(data: MarvinCollection);
|
|
314
298
|
get name(): string;
|
|
315
299
|
get slug(): string;
|
|
316
|
-
get description(): string | undefined;
|
|
317
|
-
get icon(): string | undefined;
|
|
318
|
-
get color(): string | undefined;
|
|
319
|
-
get sortOrder(): number;
|
|
300
|
+
get description(): string | null | undefined;
|
|
320
301
|
get isSmart(): boolean;
|
|
321
|
-
get smartRules():
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
* Get assets in this collection (future)
|
|
330
|
-
*/
|
|
331
|
-
assets(): Promise<MarvinAsset[]>;
|
|
332
|
-
/**
|
|
333
|
-
* Get collection metadata (future)
|
|
334
|
-
*/
|
|
335
|
-
metadata(): Promise<any>;
|
|
336
|
-
/**
|
|
337
|
-
* Get raw collection data
|
|
338
|
-
*/
|
|
302
|
+
get smartRules(): {
|
|
303
|
+
[key: string]: unknown;
|
|
304
|
+
} | null | undefined;
|
|
305
|
+
get metadataJson(): {
|
|
306
|
+
[key: string]: unknown;
|
|
307
|
+
} | null | undefined;
|
|
308
|
+
get entryCount(): number;
|
|
309
|
+
get entries(): MarvinEntryListItem[];
|
|
339
310
|
toJSON(): MarvinCollection;
|
|
340
311
|
}
|
|
341
312
|
|
|
@@ -350,7 +321,7 @@ declare class CollectionsModule {
|
|
|
350
321
|
/**
|
|
351
322
|
* Get all collections
|
|
352
323
|
*/
|
|
353
|
-
list(): Promise<
|
|
324
|
+
list(): Promise<PublishedCollectionSummary[]>;
|
|
354
325
|
/**
|
|
355
326
|
* Get a single collection by slug
|
|
356
327
|
* Returns null if collection is not found (404)
|
|
@@ -360,24 +331,14 @@ declare class CollectionsModule {
|
|
|
360
331
|
* Get entries in a collection
|
|
361
332
|
* Returns empty array if collection is not found
|
|
362
333
|
*/
|
|
363
|
-
entries(slug: string): Promise<
|
|
334
|
+
entries(slug: string): Promise<MarvinEntryListItem[]>;
|
|
364
335
|
/**
|
|
365
336
|
* Try multiple collection slugs in fallback order
|
|
366
337
|
* Returns the first collection that exists and has entries
|
|
367
|
-
*
|
|
368
|
-
* @param slugs - Collection slugs to try in order
|
|
369
|
-
* @param options - Options for fallback behavior
|
|
370
|
-
* @returns Entries from the first matching collection, or empty array
|
|
371
|
-
*
|
|
372
|
-
* @example
|
|
373
|
-
* ```ts
|
|
374
|
-
* // Try bench-notes, then journal, then blog
|
|
375
|
-
* const entries = await collections.fallback(['bench-notes', 'journal', 'blog']);
|
|
376
|
-
* ```
|
|
377
338
|
*/
|
|
378
339
|
fallback(slugs: string[], options?: {
|
|
379
340
|
requireEntries?: boolean;
|
|
380
|
-
}): Promise<
|
|
341
|
+
}): Promise<MarvinEntryListItem[]>;
|
|
381
342
|
}
|
|
382
343
|
|
|
383
344
|
/**
|
|
@@ -386,9 +347,7 @@ declare class CollectionsModule {
|
|
|
386
347
|
|
|
387
348
|
declare class Entry {
|
|
388
349
|
private raw;
|
|
389
|
-
|
|
390
|
-
private workspaceSlug;
|
|
391
|
-
constructor(raw: MarvinEntry, http: MarvinHttpClient, workspaceSlug: string);
|
|
350
|
+
constructor(raw: MarvinEntry);
|
|
392
351
|
get title(): string;
|
|
393
352
|
get slug(): string;
|
|
394
353
|
get summary(): string | null | undefined;
|
|
@@ -398,13 +357,19 @@ declare class Entry {
|
|
|
398
357
|
renderer?: string | null;
|
|
399
358
|
package?: string | null;
|
|
400
359
|
version?: string | null;
|
|
401
|
-
config?:
|
|
360
|
+
config?: {
|
|
361
|
+
[key: string]: unknown;
|
|
362
|
+
} | null;
|
|
402
363
|
publishable: boolean;
|
|
403
364
|
submittable: boolean;
|
|
404
365
|
routable: boolean;
|
|
405
366
|
} | null | undefined;
|
|
406
|
-
get data():
|
|
407
|
-
|
|
367
|
+
get data(): {
|
|
368
|
+
[key: string]: unknown;
|
|
369
|
+
};
|
|
370
|
+
get metadataJson(): {
|
|
371
|
+
[key: string]: unknown;
|
|
372
|
+
} | null | undefined;
|
|
408
373
|
get publishedAt(): string | null | undefined;
|
|
409
374
|
get order(): number | null | undefined;
|
|
410
375
|
get assets(): PublishedAssetRead[];
|
|
@@ -412,7 +377,6 @@ declare class Entry {
|
|
|
412
377
|
get resources(): PublishedResourceRead[];
|
|
413
378
|
field<T = unknown>(key: string): T | undefined;
|
|
414
379
|
get fields(): Record<string, unknown>;
|
|
415
|
-
relatedEntries(): Promise<MarvinEntry[]>;
|
|
416
380
|
toJSON(): MarvinEntry;
|
|
417
381
|
}
|
|
418
382
|
|
|
@@ -434,7 +398,7 @@ declare class EntriesModule {
|
|
|
434
398
|
/**
|
|
435
399
|
* Get all published entries
|
|
436
400
|
*/
|
|
437
|
-
list(options?: GetEntriesOptions): Promise<
|
|
401
|
+
list(options?: GetEntriesOptions): Promise<MarvinEntryListItem[]>;
|
|
438
402
|
/**
|
|
439
403
|
* Get a single entry by slug
|
|
440
404
|
* Returns null if entry is not found (404)
|
|
@@ -443,15 +407,15 @@ declare class EntriesModule {
|
|
|
443
407
|
/**
|
|
444
408
|
* Convenience: Get all pages
|
|
445
409
|
*/
|
|
446
|
-
pages(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<
|
|
410
|
+
pages(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<MarvinEntryListItem[]>;
|
|
447
411
|
/**
|
|
448
412
|
* Convenience: Get all blog posts
|
|
449
413
|
*/
|
|
450
|
-
posts(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<
|
|
414
|
+
posts(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<MarvinEntryListItem[]>;
|
|
451
415
|
/**
|
|
452
416
|
* Convenience: Get all projects
|
|
453
417
|
*/
|
|
454
|
-
projects(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<
|
|
418
|
+
projects(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<MarvinEntryListItem[]>;
|
|
455
419
|
}
|
|
456
420
|
|
|
457
421
|
/**
|
|
@@ -494,7 +458,6 @@ declare class Workspace {
|
|
|
494
458
|
}
|
|
495
459
|
|
|
496
460
|
declare class MarvinClient {
|
|
497
|
-
private config;
|
|
498
461
|
private http;
|
|
499
462
|
private cache;
|
|
500
463
|
private workspace;
|
|
@@ -551,15 +514,51 @@ declare class MarvinClient {
|
|
|
551
514
|
/**
|
|
552
515
|
* Get all pages
|
|
553
516
|
*/
|
|
554
|
-
pages(options?: GetEntriesOptions): Promise<
|
|
517
|
+
pages(options?: GetEntriesOptions): Promise<{
|
|
518
|
+
slug: string;
|
|
519
|
+
title: string;
|
|
520
|
+
entryType: string;
|
|
521
|
+
entryTypeInfo?: components["schemas"]["PublishedEntryTypeInfo"] | null;
|
|
522
|
+
summary?: string | null;
|
|
523
|
+
publishedAt?: string | null;
|
|
524
|
+
status: string;
|
|
525
|
+
collections: string[];
|
|
526
|
+
assetSlugs: string[];
|
|
527
|
+
resourceSlugs: string[];
|
|
528
|
+
order?: number | null;
|
|
529
|
+
}[]>;
|
|
555
530
|
/**
|
|
556
531
|
* Get all blog posts
|
|
557
532
|
*/
|
|
558
|
-
posts(options?: GetEntriesOptions): Promise<
|
|
533
|
+
posts(options?: GetEntriesOptions): Promise<{
|
|
534
|
+
slug: string;
|
|
535
|
+
title: string;
|
|
536
|
+
entryType: string;
|
|
537
|
+
entryTypeInfo?: components["schemas"]["PublishedEntryTypeInfo"] | null;
|
|
538
|
+
summary?: string | null;
|
|
539
|
+
publishedAt?: string | null;
|
|
540
|
+
status: string;
|
|
541
|
+
collections: string[];
|
|
542
|
+
assetSlugs: string[];
|
|
543
|
+
resourceSlugs: string[];
|
|
544
|
+
order?: number | null;
|
|
545
|
+
}[]>;
|
|
559
546
|
/**
|
|
560
547
|
* Get all projects
|
|
561
548
|
*/
|
|
562
|
-
projects(options?: GetEntriesOptions): Promise<
|
|
549
|
+
projects(options?: GetEntriesOptions): Promise<{
|
|
550
|
+
slug: string;
|
|
551
|
+
title: string;
|
|
552
|
+
entryType: string;
|
|
553
|
+
entryTypeInfo?: components["schemas"]["PublishedEntryTypeInfo"] | null;
|
|
554
|
+
summary?: string | null;
|
|
555
|
+
publishedAt?: string | null;
|
|
556
|
+
status: string;
|
|
557
|
+
collections: string[];
|
|
558
|
+
assetSlugs: string[];
|
|
559
|
+
resourceSlugs: string[];
|
|
560
|
+
order?: number | null;
|
|
561
|
+
}[]>;
|
|
563
562
|
/**
|
|
564
563
|
* Get a single resource by slug
|
|
565
564
|
*/
|
|
@@ -567,70 +566,50 @@ declare class MarvinClient {
|
|
|
567
566
|
/**
|
|
568
567
|
* Try multiple collection slugs in fallback order
|
|
569
568
|
* Returns entries from the first collection that exists and has content
|
|
570
|
-
*
|
|
571
|
-
* @param slugs - Collection slugs to try in order
|
|
572
|
-
* @param options - Options for fallback behavior
|
|
573
|
-
* @returns Entries from the first matching collection, or empty array
|
|
574
|
-
*
|
|
575
|
-
* @example
|
|
576
|
-
* ```ts
|
|
577
|
-
* // Try bench-notes, then journal, then blog
|
|
578
|
-
* const entries = await client.collectionFallback(['bench-notes', 'journal', 'blog']);
|
|
579
|
-
* ```
|
|
580
569
|
*/
|
|
581
570
|
collectionFallback(slugs: string[], options?: {
|
|
582
571
|
requireEntries?: boolean;
|
|
583
|
-
}): Promise<
|
|
572
|
+
}): Promise<MarvinEntryListItem[]>;
|
|
584
573
|
/**
|
|
585
574
|
* @deprecated Use workspace.site or marvin.site instead
|
|
586
|
-
* Get site configuration
|
|
587
575
|
*/
|
|
588
576
|
getSite(): Promise<MarvinSite>;
|
|
589
577
|
/**
|
|
590
578
|
* @deprecated Use workspace.entries.list() instead
|
|
591
|
-
* Get all published entries
|
|
592
579
|
*/
|
|
593
|
-
getEntries(options?: GetEntriesOptions): Promise<
|
|
580
|
+
getEntries(options?: GetEntriesOptions): Promise<MarvinEntryListItem[]>;
|
|
594
581
|
/**
|
|
595
582
|
* @deprecated Use workspace.entries.get() instead
|
|
596
|
-
* Get a single published entry by slug
|
|
597
583
|
*/
|
|
598
584
|
getEntry(slug: string): Promise<MarvinEntry | null>;
|
|
599
585
|
/**
|
|
600
586
|
* @deprecated Use workspace.collections.list() instead
|
|
601
|
-
* Get all collections
|
|
602
587
|
*/
|
|
603
|
-
getCollections(): Promise<
|
|
588
|
+
getCollections(): Promise<PublishedCollectionSummary[]>;
|
|
604
589
|
/**
|
|
605
590
|
* @deprecated Use workspace.collections.get() instead
|
|
606
|
-
* Get a single collection by slug
|
|
607
591
|
*/
|
|
608
592
|
getCollection(slug: string): Promise<MarvinCollection | null>;
|
|
609
593
|
/**
|
|
610
594
|
* @deprecated Use workspace.collections.entries() instead
|
|
611
|
-
* Get all entries in a collection
|
|
612
595
|
*/
|
|
613
|
-
getCollectionEntries(slug: string): Promise<
|
|
596
|
+
getCollectionEntries(slug: string): Promise<MarvinEntryListItem[]>;
|
|
614
597
|
/**
|
|
615
598
|
* @deprecated Use workspace.assets.list() instead
|
|
616
|
-
* Get all published assets
|
|
617
599
|
*/
|
|
618
600
|
getAssets(options?: GetAssetsOptions): Promise<MarvinAsset[]>;
|
|
619
601
|
/**
|
|
620
602
|
* @deprecated Use workspace.resources.list() instead
|
|
621
|
-
* Get all published resources
|
|
622
603
|
*/
|
|
623
604
|
getResources(options?: GetResourcesOptions$1): Promise<MarvinResource[]>;
|
|
624
605
|
/**
|
|
625
606
|
* @deprecated Use workspace.resources.get() instead
|
|
626
|
-
* Get a single resource by slug
|
|
627
607
|
*/
|
|
628
608
|
getResource(slug: string): Promise<MarvinResource>;
|
|
629
609
|
/**
|
|
630
610
|
* @deprecated Use workspace.resources.entries() instead
|
|
631
|
-
* Get entries that reference a resource
|
|
632
611
|
*/
|
|
633
|
-
getResourceEntries(slug: string): Promise<
|
|
612
|
+
getResourceEntries(slug: string): Promise<string[]>;
|
|
634
613
|
}
|
|
635
614
|
|
|
636
615
|
export { Collection as C, Entry as E, type MarvinConfig as M, type PaginatedResponse as P, Resource as R, Workspace as W, MarvinClient as a, MarvinApiError as b, MarvinAuthError as c, MarvinCache as d, MarvinConfigError as e, MarvinError as f, MarvinNetworkError as g, MarvinNotFoundError as h, MarvinServerError as i, MarvinValidationError as j, type PaginationMeta as k, type PaginationParams as l, createConfigFromEnv as m, createPaginatedResponse as n, extractData as o, isPaginatedResponse as p, offsetToPage as q, pageToOffset as r };
|