@inneropen/marvin-sdk 2.0.0-next.22 → 2.0.0-next.24
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-SGZG7U7V.js → chunk-DCTX4NSF.js} +49 -203
- package/dist/index.cjs +48 -202
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/{marvin-BAslemIz.d.cts → marvin-CwB9ybc8.d.cts} +56 -155
- package/dist/{marvin-BmbMUJXh.d.ts → marvin-KVTEthgH.d.ts} +56 -155
- package/dist/platform.cjs +1 -14
- package/dist/platform.d.cts +27 -188
- package/dist/platform.d.ts +27 -188
- package/dist/platform.js +1 -14
- package/dist/publish.cjs +48 -202
- 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 +122 -124
- package/dist/types/index.d.ts +122 -124
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PublishedEntryType, MarvinResource,
|
|
1
|
+
import { PublishedEntryType, MarvinResource, MarvinAsset, MarvinCollection, MarvinEntryListItem, PublishedCollectionSummary, MarvinEntry, PublishedAssetRead, PublishedResourceRead, MarvinSite, GetResourcesOptions as GetResourcesOptions$1 } from './types/index.cjs';
|
|
2
2
|
import { H as HttpClient } from './HttpClient-CdF3IHM1.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -212,30 +212,15 @@ 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
|
-
get
|
|
227
|
-
get updatedAt(): string;
|
|
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(): Record<string, unknown> | null | undefined;
|
|
223
|
+
get entries(): string[];
|
|
239
224
|
toJSON(): MarvinResource;
|
|
240
225
|
}
|
|
241
226
|
|
|
@@ -261,9 +246,9 @@ declare class ResourcesModule {
|
|
|
261
246
|
*/
|
|
262
247
|
get(slug: string): Promise<Resource>;
|
|
263
248
|
/**
|
|
264
|
-
* Get
|
|
249
|
+
* Get entry slugs that reference this resource
|
|
265
250
|
*/
|
|
266
|
-
entries(slug: string): Promise<
|
|
251
|
+
entries(slug: string): Promise<string[]>;
|
|
267
252
|
}
|
|
268
253
|
|
|
269
254
|
/**
|
|
@@ -307,35 +292,15 @@ declare class AssetsModule {
|
|
|
307
292
|
|
|
308
293
|
declare class Collection {
|
|
309
294
|
private data;
|
|
310
|
-
|
|
311
|
-
private workspaceSlug;
|
|
312
|
-
constructor(data: MarvinCollection, http: MarvinHttpClient, workspaceSlug: string);
|
|
313
|
-
get id(): string;
|
|
295
|
+
constructor(data: MarvinCollection);
|
|
314
296
|
get name(): string;
|
|
315
297
|
get slug(): string;
|
|
316
|
-
get description(): string | undefined;
|
|
317
|
-
get icon(): string | undefined;
|
|
318
|
-
get color(): string | undefined;
|
|
319
|
-
get sortOrder(): number;
|
|
298
|
+
get description(): string | null | undefined;
|
|
320
299
|
get isSmart(): boolean;
|
|
321
|
-
get smartRules(): Record<string, unknown> | undefined;
|
|
322
|
-
get
|
|
323
|
-
get
|
|
324
|
-
|
|
325
|
-
* Get all entries in this collection
|
|
326
|
-
*/
|
|
327
|
-
entries(): Promise<MarvinEntry[]>;
|
|
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
|
-
*/
|
|
300
|
+
get smartRules(): Record<string, unknown> | null | undefined;
|
|
301
|
+
get metadataJson(): Record<string, unknown> | null | undefined;
|
|
302
|
+
get entryCount(): number;
|
|
303
|
+
get entries(): MarvinEntryListItem[];
|
|
339
304
|
toJSON(): MarvinCollection;
|
|
340
305
|
}
|
|
341
306
|
|
|
@@ -350,7 +315,7 @@ declare class CollectionsModule {
|
|
|
350
315
|
/**
|
|
351
316
|
* Get all collections
|
|
352
317
|
*/
|
|
353
|
-
list(): Promise<
|
|
318
|
+
list(): Promise<PublishedCollectionSummary[]>;
|
|
354
319
|
/**
|
|
355
320
|
* Get a single collection by slug
|
|
356
321
|
* Returns null if collection is not found (404)
|
|
@@ -360,89 +325,46 @@ declare class CollectionsModule {
|
|
|
360
325
|
* Get entries in a collection
|
|
361
326
|
* Returns empty array if collection is not found
|
|
362
327
|
*/
|
|
363
|
-
entries(slug: string): Promise<
|
|
328
|
+
entries(slug: string): Promise<MarvinEntryListItem[]>;
|
|
364
329
|
/**
|
|
365
330
|
* Try multiple collection slugs in fallback order
|
|
366
331
|
* 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
332
|
*/
|
|
378
333
|
fallback(slugs: string[], options?: {
|
|
379
334
|
requireEntries?: boolean;
|
|
380
|
-
}): Promise<
|
|
335
|
+
}): Promise<MarvinEntryListItem[]>;
|
|
381
336
|
}
|
|
382
337
|
|
|
338
|
+
/**
|
|
339
|
+
* Entry - Rich object representing a single entry
|
|
340
|
+
*/
|
|
341
|
+
|
|
383
342
|
declare class Entry {
|
|
384
|
-
private
|
|
385
|
-
|
|
386
|
-
private workspaceSlug;
|
|
387
|
-
constructor(data: MarvinEntry, http: MarvinHttpClient, workspaceSlug: string);
|
|
388
|
-
get id(): string;
|
|
343
|
+
private raw;
|
|
344
|
+
constructor(raw: MarvinEntry);
|
|
389
345
|
get title(): string;
|
|
390
346
|
get slug(): string;
|
|
391
|
-
get summary(): string | undefined;
|
|
392
|
-
get
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
get
|
|
404
|
-
get
|
|
405
|
-
get publishedAt(): string | undefined;
|
|
406
|
-
get
|
|
407
|
-
get
|
|
408
|
-
get
|
|
409
|
-
get
|
|
410
|
-
/**
|
|
411
|
-
* Get entry assets
|
|
412
|
-
*/
|
|
413
|
-
get assets(): MarvinAsset[];
|
|
414
|
-
/**
|
|
415
|
-
* Get entry collections
|
|
416
|
-
*/
|
|
417
|
-
get collections(): MarvinCollection[];
|
|
418
|
-
/**
|
|
419
|
-
* Get a specific field value from the entry's schema-driven content (dataJson).
|
|
420
|
-
*
|
|
421
|
-
* @param key - Field key as defined in the entry type's schema
|
|
422
|
-
* @returns The field value, or undefined if not present
|
|
423
|
-
* @since 2.0.0
|
|
424
|
-
*
|
|
425
|
-
* @example
|
|
426
|
-
* ```typescript
|
|
427
|
-
* const entry = await client.entries.get('my-entry');
|
|
428
|
-
* const body = entry.field('body'); // Get markdown body
|
|
429
|
-
* const difficulty = entry.field('difficulty'); // Get difficulty level
|
|
430
|
-
* const heroImage = entry.field('heroImage'); // Get hero image UUID
|
|
431
|
-
* ```
|
|
432
|
-
*/
|
|
347
|
+
get summary(): string | null | undefined;
|
|
348
|
+
get entryType(): string;
|
|
349
|
+
get entryTypeInfo(): {
|
|
350
|
+
slug: string;
|
|
351
|
+
renderer?: string | null;
|
|
352
|
+
package?: string | null;
|
|
353
|
+
version?: string | null;
|
|
354
|
+
config?: Record<string, unknown> | null;
|
|
355
|
+
publishable: boolean;
|
|
356
|
+
submittable: boolean;
|
|
357
|
+
routable: boolean;
|
|
358
|
+
} | null | undefined;
|
|
359
|
+
get data(): Record<string, unknown>;
|
|
360
|
+
get metadataJson(): Record<string, unknown> | null | undefined;
|
|
361
|
+
get publishedAt(): string | null | undefined;
|
|
362
|
+
get order(): number | null | undefined;
|
|
363
|
+
get assets(): PublishedAssetRead[];
|
|
364
|
+
get collections(): PublishedCollectionSummary[];
|
|
365
|
+
get resources(): PublishedResourceRead[];
|
|
433
366
|
field<T = unknown>(key: string): T | undefined;
|
|
434
|
-
/**
|
|
435
|
-
* Get all fields from the entry's schema-driven content.
|
|
436
|
-
* @since 2.0.0
|
|
437
|
-
*/
|
|
438
367
|
get fields(): Record<string, unknown>;
|
|
439
|
-
/**
|
|
440
|
-
* Get related entries (future)
|
|
441
|
-
*/
|
|
442
|
-
relatedEntries(): Promise<MarvinEntry[]>;
|
|
443
|
-
/**
|
|
444
|
-
* Get raw entry data
|
|
445
|
-
*/
|
|
446
368
|
toJSON(): MarvinEntry;
|
|
447
369
|
}
|
|
448
370
|
|
|
@@ -464,7 +386,7 @@ declare class EntriesModule {
|
|
|
464
386
|
/**
|
|
465
387
|
* Get all published entries
|
|
466
388
|
*/
|
|
467
|
-
list(options?: GetEntriesOptions): Promise<
|
|
389
|
+
list(options?: GetEntriesOptions): Promise<MarvinEntryListItem[]>;
|
|
468
390
|
/**
|
|
469
391
|
* Get a single entry by slug
|
|
470
392
|
* Returns null if entry is not found (404)
|
|
@@ -473,15 +395,15 @@ declare class EntriesModule {
|
|
|
473
395
|
/**
|
|
474
396
|
* Convenience: Get all pages
|
|
475
397
|
*/
|
|
476
|
-
pages(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<
|
|
398
|
+
pages(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<MarvinEntryListItem[]>;
|
|
477
399
|
/**
|
|
478
400
|
* Convenience: Get all blog posts
|
|
479
401
|
*/
|
|
480
|
-
posts(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<
|
|
402
|
+
posts(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<MarvinEntryListItem[]>;
|
|
481
403
|
/**
|
|
482
404
|
* Convenience: Get all projects
|
|
483
405
|
*/
|
|
484
|
-
projects(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<
|
|
406
|
+
projects(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<MarvinEntryListItem[]>;
|
|
485
407
|
}
|
|
486
408
|
|
|
487
409
|
/**
|
|
@@ -524,7 +446,6 @@ declare class Workspace {
|
|
|
524
446
|
}
|
|
525
447
|
|
|
526
448
|
declare class MarvinClient {
|
|
527
|
-
private config;
|
|
528
449
|
private http;
|
|
529
450
|
private cache;
|
|
530
451
|
private workspace;
|
|
@@ -581,15 +502,15 @@ declare class MarvinClient {
|
|
|
581
502
|
/**
|
|
582
503
|
* Get all pages
|
|
583
504
|
*/
|
|
584
|
-
pages(options?: GetEntriesOptions): Promise<
|
|
505
|
+
pages(options?: GetEntriesOptions): Promise<MarvinEntryListItem[]>;
|
|
585
506
|
/**
|
|
586
507
|
* Get all blog posts
|
|
587
508
|
*/
|
|
588
|
-
posts(options?: GetEntriesOptions): Promise<
|
|
509
|
+
posts(options?: GetEntriesOptions): Promise<MarvinEntryListItem[]>;
|
|
589
510
|
/**
|
|
590
511
|
* Get all projects
|
|
591
512
|
*/
|
|
592
|
-
projects(options?: GetEntriesOptions): Promise<
|
|
513
|
+
projects(options?: GetEntriesOptions): Promise<MarvinEntryListItem[]>;
|
|
593
514
|
/**
|
|
594
515
|
* Get a single resource by slug
|
|
595
516
|
*/
|
|
@@ -597,70 +518,50 @@ declare class MarvinClient {
|
|
|
597
518
|
/**
|
|
598
519
|
* Try multiple collection slugs in fallback order
|
|
599
520
|
* Returns entries from the first collection that exists and has content
|
|
600
|
-
*
|
|
601
|
-
* @param slugs - Collection slugs to try in order
|
|
602
|
-
* @param options - Options for fallback behavior
|
|
603
|
-
* @returns Entries from the first matching collection, or empty array
|
|
604
|
-
*
|
|
605
|
-
* @example
|
|
606
|
-
* ```ts
|
|
607
|
-
* // Try bench-notes, then journal, then blog
|
|
608
|
-
* const entries = await client.collectionFallback(['bench-notes', 'journal', 'blog']);
|
|
609
|
-
* ```
|
|
610
521
|
*/
|
|
611
522
|
collectionFallback(slugs: string[], options?: {
|
|
612
523
|
requireEntries?: boolean;
|
|
613
|
-
}): Promise<
|
|
524
|
+
}): Promise<MarvinEntryListItem[]>;
|
|
614
525
|
/**
|
|
615
526
|
* @deprecated Use workspace.site or marvin.site instead
|
|
616
|
-
* Get site configuration
|
|
617
527
|
*/
|
|
618
528
|
getSite(): Promise<MarvinSite>;
|
|
619
529
|
/**
|
|
620
530
|
* @deprecated Use workspace.entries.list() instead
|
|
621
|
-
* Get all published entries
|
|
622
531
|
*/
|
|
623
|
-
getEntries(options?: GetEntriesOptions): Promise<
|
|
532
|
+
getEntries(options?: GetEntriesOptions): Promise<MarvinEntryListItem[]>;
|
|
624
533
|
/**
|
|
625
534
|
* @deprecated Use workspace.entries.get() instead
|
|
626
|
-
* Get a single published entry by slug
|
|
627
535
|
*/
|
|
628
536
|
getEntry(slug: string): Promise<MarvinEntry | null>;
|
|
629
537
|
/**
|
|
630
538
|
* @deprecated Use workspace.collections.list() instead
|
|
631
|
-
* Get all collections
|
|
632
539
|
*/
|
|
633
|
-
getCollections(): Promise<
|
|
540
|
+
getCollections(): Promise<PublishedCollectionSummary[]>;
|
|
634
541
|
/**
|
|
635
542
|
* @deprecated Use workspace.collections.get() instead
|
|
636
|
-
* Get a single collection by slug
|
|
637
543
|
*/
|
|
638
544
|
getCollection(slug: string): Promise<MarvinCollection | null>;
|
|
639
545
|
/**
|
|
640
546
|
* @deprecated Use workspace.collections.entries() instead
|
|
641
|
-
* Get all entries in a collection
|
|
642
547
|
*/
|
|
643
|
-
getCollectionEntries(slug: string): Promise<
|
|
548
|
+
getCollectionEntries(slug: string): Promise<MarvinEntryListItem[]>;
|
|
644
549
|
/**
|
|
645
550
|
* @deprecated Use workspace.assets.list() instead
|
|
646
|
-
* Get all published assets
|
|
647
551
|
*/
|
|
648
552
|
getAssets(options?: GetAssetsOptions): Promise<MarvinAsset[]>;
|
|
649
553
|
/**
|
|
650
554
|
* @deprecated Use workspace.resources.list() instead
|
|
651
|
-
* Get all published resources
|
|
652
555
|
*/
|
|
653
556
|
getResources(options?: GetResourcesOptions$1): Promise<MarvinResource[]>;
|
|
654
557
|
/**
|
|
655
558
|
* @deprecated Use workspace.resources.get() instead
|
|
656
|
-
* Get a single resource by slug
|
|
657
559
|
*/
|
|
658
560
|
getResource(slug: string): Promise<MarvinResource>;
|
|
659
561
|
/**
|
|
660
562
|
* @deprecated Use workspace.resources.entries() instead
|
|
661
|
-
* Get entries that reference a resource
|
|
662
563
|
*/
|
|
663
|
-
getResourceEntries(slug: string): Promise<
|
|
564
|
+
getResourceEntries(slug: string): Promise<string[]>;
|
|
664
565
|
}
|
|
665
566
|
|
|
666
567
|
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 };
|