@inneropen/marvin-sdk 3.1.0 → 3.2.0-next.10

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/index.cjs CHANGED
@@ -397,7 +397,7 @@ var init_HttpClient = __esm({
397
397
  const timeoutId = setTimeout(() => controller.abort(), this.timeout);
398
398
  const startTime = Date.now();
399
399
  if (this.debug) {
400
- this.logger.log(`[Marvin] ${method} ${url}`);
400
+ this.logger.log(`[Marvin SDK] ${method} ${url}`);
401
401
  }
402
402
  try {
403
403
  const response = await fetch(url, {
@@ -411,7 +411,7 @@ var init_HttpClient = __esm({
411
411
  const duration = Date.now() - startTime;
412
412
  if (this.debug) {
413
413
  this.logger.log(
414
- `[Marvin] ${response.status} ${response.statusText} (${duration}ms)`
414
+ `[Marvin SDK] ${response.status} ${response.statusText} (${duration}ms)`
415
415
  );
416
416
  }
417
417
  if (response.status === 401 && this.auth.handleUnauthorized) {
@@ -421,7 +421,7 @@ var init_HttpClient = __esm({
421
421
  const errorText = await response.text().catch(() => "");
422
422
  if (this.debug) {
423
423
  this.logger.error(
424
- `[Marvin] Error response: ${response.status} ${response.statusText}`,
424
+ `[Marvin SDK] Error response: ${response.status} ${response.statusText}`,
425
425
  errorText ? `Body: ${errorText}` : ""
426
426
  );
427
427
  }
@@ -431,7 +431,7 @@ var init_HttpClient = __esm({
431
431
  const delay = this.calculateRetryDelay(retryAttempt);
432
432
  if (this.debug) {
433
433
  this.logger.warn(
434
- `[Marvin] Retry ${retryAttempt + 1}/${this.retryConfig.maxRetries} after ${delay}ms (status: ${response.status})`
434
+ `[Marvin SDK] Retry ${retryAttempt + 1}/${this.retryConfig.maxRetries} after ${delay}ms (status: ${response.status})`
435
435
  );
436
436
  }
437
437
  await this.sleep(delay);
@@ -470,7 +470,7 @@ var init_HttpClient = __esm({
470
470
  const data = await response.json();
471
471
  if (this.debug) {
472
472
  const sanitized = this.sanitizeForLogging(data);
473
- this.logger.log("[Marvin] Response:", JSON.stringify(sanitized, null, 2));
473
+ this.logger.log("[Marvin SDK] Response:", JSON.stringify(sanitized, null, 2));
474
474
  }
475
475
  return data;
476
476
  } catch (error) {
@@ -484,7 +484,7 @@ var init_HttpClient = __esm({
484
484
  const delay = this.calculateRetryDelay(retryAttempt);
485
485
  if (this.debug) {
486
486
  this.logger.warn(
487
- `[Marvin] Retry ${retryAttempt + 1}/${this.retryConfig.maxRetries} after ${delay}ms (network error)`
487
+ `[Marvin SDK] Retry ${retryAttempt + 1}/${this.retryConfig.maxRetries} after ${delay}ms (network error)`
488
488
  );
489
489
  }
490
490
  await this.sleep(delay);
@@ -901,25 +901,22 @@ var init_entry = __esm({
901
901
  return this.raw.order;
902
902
  }
903
903
  get assets() {
904
- return this.raw.assets;
904
+ return (this.raw.assets ?? []).map(({ asset, role, position, metadataJson }) => ({
905
+ ...asset,
906
+ entryMetadata: { role: role ?? null, position, metadataJson: metadataJson ?? null }
907
+ }));
905
908
  }
906
909
  get collections() {
907
- return this.raw.collections;
910
+ return (this.raw.collections ?? []).map(({ collection, role, position, metadataJson }) => ({
911
+ collection,
912
+ entryMetadata: { role: role ?? null, position, metadataJson: metadataJson ?? null }
913
+ }));
908
914
  }
909
915
  get resources() {
910
- return this.raw.resources;
911
- }
912
- asset(role) {
913
- return this.raw.assets.find((a) => a.role === role);
914
- }
915
- assetsByRole(role) {
916
- return this.raw.assets.filter((a) => a.role === role);
917
- }
918
- resource(role) {
919
- return this.raw.resources.find((r) => r.role === role);
920
- }
921
- resourcesByRole(role) {
922
- return this.raw.resources.filter((r) => r.role === role);
916
+ return (this.raw.resources ?? []).map(({ resource, role, position, metadataJson }) => ({
917
+ ...resource,
918
+ entryMetadata: { role: role ?? null, position, metadataJson: metadataJson ?? null }
919
+ }));
923
920
  }
924
921
  field(key) {
925
922
  return this.raw.data[key];
@@ -935,6 +932,16 @@ var init_entry = __esm({
935
932
  });
936
933
 
937
934
  // src/entries/entries.ts
935
+ function toListEntry(raw) {
936
+ const { collections, ...rest } = raw;
937
+ return {
938
+ ...rest,
939
+ collections: (collections ?? []).map(({ collection, role, position, metadataJson }) => ({
940
+ collection,
941
+ entryMetadata: { role: role ?? null, position, metadataJson: metadataJson ?? null }
942
+ }))
943
+ };
944
+ }
938
945
  var EntriesModule;
939
946
  var init_entries = __esm({
940
947
  "src/entries/entries.ts"() {
@@ -960,7 +967,7 @@ var init_entries = __esm({
960
967
  });
961
968
  const endpoint = `/api/publish/${this.workspaceSlug}/entries${queryString}`;
962
969
  const response = await this.http.fetch(endpoint);
963
- return response.data || [];
970
+ return (response.data || []).map(toListEntry);
964
971
  }
965
972
  /**
966
973
  * Get a single entry by slug
@@ -1031,8 +1038,33 @@ var init_collection = __esm({
1031
1038
  get entryCount() {
1032
1039
  return this.data.entryCount;
1033
1040
  }
1041
+ /**
1042
+ * Entries with junction context for this collection surfaced directly.
1043
+ * - role, position, junctionMetadata: from this collection's junction record
1044
+ * - collections: slugs of other collections the entry belongs to
1045
+ */
1034
1046
  get entries() {
1035
- return this.data.entries;
1047
+ return this.data.entries.map((entry) => {
1048
+ const { collections, ...rest } = entry;
1049
+ const junction = collections.find((ec) => ec.collection.slug === this.data.slug);
1050
+ const entryMetadata = {
1051
+ role: junction?.role ?? null,
1052
+ position: junction?.position ?? 0,
1053
+ metadataJson: junction?.metadataJson ?? null
1054
+ };
1055
+ const collection = {
1056
+ slug: this.data.slug,
1057
+ name: this.data.name,
1058
+ description: this.data.description,
1059
+ metadataJson: this.data.metadataJson,
1060
+ entryMetadata
1061
+ };
1062
+ return {
1063
+ ...rest,
1064
+ collection,
1065
+ collectionSlugs: collections.map((ec) => ec.collection.slug)
1066
+ };
1067
+ });
1036
1068
  }
1037
1069
  toJSON() {
1038
1070
  return this.data;
@@ -1064,8 +1096,8 @@ var init_collections = __esm({
1064
1096
  return response.data || [];
1065
1097
  }
1066
1098
  /**
1067
- * Get a single collection by slug
1068
- * Returns null if collection is not found (404)
1099
+ * Get a single collection by slug.
1100
+ * Returns an empty array if the collection is not found (404).
1069
1101
  */
1070
1102
  async get(slug) {
1071
1103
  try {
@@ -1074,32 +1106,34 @@ var init_collections = __esm({
1074
1106
  return new Collection(data);
1075
1107
  } catch (error) {
1076
1108
  if (error instanceof MarvinNotFoundError) {
1077
- return null;
1109
+ return [];
1078
1110
  }
1079
1111
  throw error;
1080
1112
  }
1081
1113
  }
1082
1114
  /**
1083
- * Get entries in a collection
1084
- * Returns empty array if collection is not found
1115
+ * Get entries in a collection with junction context surfaced directly.
1116
+ * Each entry has role/position/junctionMetadata from this collection's junction,
1117
+ * and collections reduced to slugs of other memberships.
1118
+ * Returns empty array if collection is not found.
1085
1119
  */
1086
1120
  async entries(slug) {
1087
1121
  const collection = await this.get(slug);
1088
- if (!collection) {
1089
- return [];
1122
+ if (Array.isArray(collection)) {
1123
+ return collection;
1090
1124
  }
1091
1125
  return collection.entries;
1092
1126
  }
1093
1127
  /**
1094
- * Try multiple collection slugs in fallback order
1095
- * Returns the first collection that exists and has entries
1128
+ * Try multiple collection slugs in fallback order.
1129
+ * Returns entries from the first collection that exists and has entries.
1096
1130
  */
1097
1131
  async fallback(slugs, options = {}) {
1098
1132
  const { requireEntries = true } = options;
1099
1133
  for (const slug of slugs) {
1100
1134
  try {
1101
1135
  const collection = await this.get(slug);
1102
- if (!collection) {
1136
+ if (Array.isArray(collection)) {
1103
1137
  continue;
1104
1138
  }
1105
1139
  const entries = collection.entries;
@@ -1270,7 +1304,8 @@ var init_renderers = __esm({
1270
1304
  workspaceSlug;
1271
1305
  async list() {
1272
1306
  const endpoint = `/api/publish/${this.workspaceSlug}/entry-types`;
1273
- return this.http.fetch(endpoint);
1307
+ const all = await this.http.fetch(endpoint);
1308
+ return all.filter((et) => et.isRendered);
1274
1309
  }
1275
1310
  };
1276
1311
  }
@@ -1511,7 +1546,7 @@ var init_marvin = __esm({
1511
1546
  */
1512
1547
  async getCollection(slug) {
1513
1548
  const collection = await this.workspace.collections.get(slug);
1514
- if (!collection) {
1549
+ if (Array.isArray(collection)) {
1515
1550
  return null;
1516
1551
  }
1517
1552
  return collection.toJSON();
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
- import { M as MarvinConfig, a as MarvinClient } from './marvin-BhI__9Cj.cjs';
2
- export { C as Collection, E as Entry, b as MarvinApiError, c as MarvinAuthError, d as MarvinCache, e as MarvinConfigError, f as MarvinError, g as MarvinNetworkError, h as MarvinNotFoundError, i as MarvinServerError, j as MarvinValidationError, P as PaginatedResponse, k as PaginationMeta, l as PaginationParams, R as Resource, W as Workspace, m as createConfigFromEnv, n as createPaginatedResponse, o as extractData, p as isPaginatedResponse, q as offsetToPage, r as pageToOffset } from './marvin-BhI__9Cj.cjs';
1
+ import { M as MarvinConfig, a as MarvinClient } from './marvin-RZZj02LS.cjs';
2
+ export { C as Collection, E as Entry, b as MarvinApiError, c as MarvinAuthError, d as MarvinCache, e as MarvinConfigError, f as MarvinError, g as MarvinNetworkError, h as MarvinNotFoundError, i as MarvinServerError, j as MarvinValidationError, P as PaginatedResponse, k as PaginationMeta, l as PaginationParams, R as Resource, W as Workspace, m as createConfigFromEnv, n as createPaginatedResponse, o as extractData, p as isPaginatedResponse, q as offsetToPage, r as pageToOffset } from './marvin-RZZj02LS.cjs';
3
3
  import { H as HttpClient } from './HttpClient-CdF3IHM1.cjs';
4
4
  export { A as AuthStrategy, B as BearerTokenAuth, a as HttpClientConfig, N as NoAuth, S as SessionAuth } from './HttpClient-CdF3IHM1.cjs';
5
- import { A as AuthToken$1 } from './index-BLIrbIHf.cjs';
6
- export { G as GetAssetsOptions, a as GetEntriesOptions, b as GetResourcesOptions, M as MarvinAsset, c as MarvinCollection, d as MarvinEntry, e as MarvinEntryListItem, f as MarvinEntryType, g as MarvinPublishResponse, h as MarvinResource, i as MarvinSite, P as PublishedAssetRead, j as PublishedCollectionSummary, k as PublishedEntryAsset, l as PublishedEntryResource, m as PublishedEntryType, S as SiteConfiguration, W as WorkspaceInfo } from './index-BLIrbIHf.cjs';
5
+ import { A as AuthToken$1 } from './index-BVm5dIcw.cjs';
6
+ export { C as CollectionContext, a as CollectionEntry, b as CollectionEntryMetadata, E as EntryAsset, c as EntryCollectionContext, d as EntryResource, G as GetAssetsOptions, e as GetEntriesOptions, f as GetResourcesOptions, L as ListEntry, M as MarvinAsset, g as MarvinCollection, h as MarvinEntry, i as MarvinEntryListItem, j as MarvinEntryType, k as MarvinPublishResponse, l as MarvinResource, m as MarvinSite, P as PublishedAssetRead, n as PublishedCollectionSummary, o as PublishedEntryAsset, p as PublishedEntryResource, q as PublishedEntryType, S as SiteConfiguration, W as WorkspaceInfo } from './index-BVm5dIcw.cjs';
7
7
 
8
8
  /**
9
9
  * Authentication & User Registration
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { M as MarvinConfig, a as MarvinClient } from './marvin-C_TihjE2.js';
2
- export { C as Collection, E as Entry, b as MarvinApiError, c as MarvinAuthError, d as MarvinCache, e as MarvinConfigError, f as MarvinError, g as MarvinNetworkError, h as MarvinNotFoundError, i as MarvinServerError, j as MarvinValidationError, P as PaginatedResponse, k as PaginationMeta, l as PaginationParams, R as Resource, W as Workspace, m as createConfigFromEnv, n as createPaginatedResponse, o as extractData, p as isPaginatedResponse, q as offsetToPage, r as pageToOffset } from './marvin-C_TihjE2.js';
1
+ import { M as MarvinConfig, a as MarvinClient } from './marvin-BZ4meaB-.js';
2
+ export { C as Collection, E as Entry, b as MarvinApiError, c as MarvinAuthError, d as MarvinCache, e as MarvinConfigError, f as MarvinError, g as MarvinNetworkError, h as MarvinNotFoundError, i as MarvinServerError, j as MarvinValidationError, P as PaginatedResponse, k as PaginationMeta, l as PaginationParams, R as Resource, W as Workspace, m as createConfigFromEnv, n as createPaginatedResponse, o as extractData, p as isPaginatedResponse, q as offsetToPage, r as pageToOffset } from './marvin-BZ4meaB-.js';
3
3
  import { H as HttpClient } from './HttpClient-CdF3IHM1.js';
4
4
  export { A as AuthStrategy, B as BearerTokenAuth, a as HttpClientConfig, N as NoAuth, S as SessionAuth } from './HttpClient-CdF3IHM1.js';
5
- import { A as AuthToken$1 } from './index-BLIrbIHf.js';
6
- export { G as GetAssetsOptions, a as GetEntriesOptions, b as GetResourcesOptions, M as MarvinAsset, c as MarvinCollection, d as MarvinEntry, e as MarvinEntryListItem, f as MarvinEntryType, g as MarvinPublishResponse, h as MarvinResource, i as MarvinSite, P as PublishedAssetRead, j as PublishedCollectionSummary, k as PublishedEntryAsset, l as PublishedEntryResource, m as PublishedEntryType, S as SiteConfiguration, W as WorkspaceInfo } from './index-BLIrbIHf.js';
5
+ import { A as AuthToken$1 } from './index-BVm5dIcw.js';
6
+ export { C as CollectionContext, a as CollectionEntry, b as CollectionEntryMetadata, E as EntryAsset, c as EntryCollectionContext, d as EntryResource, G as GetAssetsOptions, e as GetEntriesOptions, f as GetResourcesOptions, L as ListEntry, M as MarvinAsset, g as MarvinCollection, h as MarvinEntry, i as MarvinEntryListItem, j as MarvinEntryType, k as MarvinPublishResponse, l as MarvinResource, m as MarvinSite, P as PublishedAssetRead, n as PublishedCollectionSummary, o as PublishedEntryAsset, p as PublishedEntryResource, q as PublishedEntryType, S as SiteConfiguration, W as WorkspaceInfo } from './index-BVm5dIcw.js';
7
7
 
8
8
  /**
9
9
  * Authentication & User Registration
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  init_resource,
14
14
  init_workspace,
15
15
  marvin_exports
16
- } from "./chunk-L4LJWRA7.js";
16
+ } from "./chunk-YHBF2SB3.js";
17
17
  import {
18
18
  BearerTokenAuth,
19
19
  HttpClient,
@@ -36,7 +36,7 @@ import {
36
36
  offsetToPage,
37
37
  pageToOffset,
38
38
  validateEmail
39
- } from "./chunk-WJC4X7TB.js";
39
+ } from "./chunk-SVH7AMMY.js";
40
40
 
41
41
  // src/index.ts
42
42
  init_marvin();
@@ -1,4 +1,4 @@
1
- import { m as PublishedEntryType, h as MarvinResource, M as MarvinAsset, c as MarvinCollection, e as MarvinEntryListItem, j as PublishedCollectionSummary, d as MarvinEntry, k as PublishedEntryAsset, l as PublishedEntryResource, i as MarvinSite, n as components, b as GetResourcesOptions$1 } from './index-BLIrbIHf.js';
1
+ import { q as PublishedEntryType, l as MarvinResource, M as MarvinAsset, g as MarvinCollection, a as CollectionEntry, n as PublishedCollectionSummary, h as MarvinEntry, E as EntryAsset, c as EntryCollectionContext, d as EntryResource, L as ListEntry, m as MarvinSite, f as GetResourcesOptions$1 } from './index-BVm5dIcw.js';
2
2
  import { H as HttpClient } from './HttpClient-CdF3IHM1.js';
3
3
 
4
4
  /**
@@ -306,7 +306,12 @@ declare class Collection {
306
306
  [key: string]: unknown;
307
307
  } | null | undefined;
308
308
  get entryCount(): number;
309
- get entries(): MarvinEntryListItem[];
309
+ /**
310
+ * Entries with junction context for this collection surfaced directly.
311
+ * - role, position, junctionMetadata: from this collection's junction record
312
+ * - collections: slugs of other collections the entry belongs to
313
+ */
314
+ get entries(): CollectionEntry[];
310
315
  toJSON(): MarvinCollection;
311
316
  }
312
317
 
@@ -323,22 +328,24 @@ declare class CollectionsModule {
323
328
  */
324
329
  list(): Promise<PublishedCollectionSummary[]>;
325
330
  /**
326
- * Get a single collection by slug
327
- * Returns null if collection is not found (404)
331
+ * Get a single collection by slug.
332
+ * Returns an empty array if the collection is not found (404).
328
333
  */
329
- get(slug: string): Promise<Collection | null>;
334
+ get(slug: string): Promise<Collection | []>;
330
335
  /**
331
- * Get entries in a collection
332
- * Returns empty array if collection is not found
336
+ * Get entries in a collection with junction context surfaced directly.
337
+ * Each entry has role/position/junctionMetadata from this collection's junction,
338
+ * and collections reduced to slugs of other memberships.
339
+ * Returns empty array if collection is not found.
333
340
  */
334
- entries(slug: string): Promise<MarvinEntryListItem[]>;
341
+ entries(slug: string): Promise<CollectionEntry[]>;
335
342
  /**
336
- * Try multiple collection slugs in fallback order
337
- * Returns the first collection that exists and has entries
343
+ * Try multiple collection slugs in fallback order.
344
+ * Returns entries from the first collection that exists and has entries.
338
345
  */
339
346
  fallback(slugs: string[], options?: {
340
347
  requireEntries?: boolean;
341
- }): Promise<MarvinEntryListItem[]>;
348
+ }): Promise<CollectionEntry[]>;
342
349
  }
343
350
 
344
351
  /**
@@ -372,13 +379,9 @@ declare class Entry {
372
379
  } | null | undefined;
373
380
  get publishedAt(): string | null | undefined;
374
381
  get order(): number | null | undefined;
375
- get assets(): PublishedEntryAsset[];
376
- get collections(): PublishedCollectionSummary[];
377
- get resources(): PublishedEntryResource[];
378
- asset(role: string): PublishedEntryAsset | undefined;
379
- assetsByRole(role: string): PublishedEntryAsset[];
380
- resource(role: string): PublishedEntryResource | undefined;
381
- resourcesByRole(role: string): PublishedEntryResource[];
382
+ get assets(): EntryAsset[];
383
+ get collections(): EntryCollectionContext[];
384
+ get resources(): EntryResource[];
382
385
  field<T = unknown>(key: string): T | undefined;
383
386
  get fields(): Record<string, unknown>;
384
387
  toJSON(): MarvinEntry;
@@ -402,7 +405,7 @@ declare class EntriesModule {
402
405
  /**
403
406
  * Get all published entries
404
407
  */
405
- list(options?: GetEntriesOptions): Promise<MarvinEntryListItem[]>;
408
+ list(options?: GetEntriesOptions): Promise<ListEntry[]>;
406
409
  /**
407
410
  * Get a single entry by slug
408
411
  * Returns null if entry is not found (404)
@@ -411,15 +414,15 @@ declare class EntriesModule {
411
414
  /**
412
415
  * Convenience: Get all pages
413
416
  */
414
- pages(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<MarvinEntryListItem[]>;
417
+ pages(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<ListEntry[]>;
415
418
  /**
416
419
  * Convenience: Get all blog posts
417
420
  */
418
- posts(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<MarvinEntryListItem[]>;
421
+ posts(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<ListEntry[]>;
419
422
  /**
420
423
  * Convenience: Get all projects
421
424
  */
422
- projects(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<MarvinEntryListItem[]>;
425
+ projects(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<ListEntry[]>;
423
426
  }
424
427
 
425
428
  /**
@@ -510,67 +513,19 @@ declare class MarvinClient {
510
513
  /**
511
514
  * Get a single collection by slug
512
515
  */
513
- collection(slug: string): Promise<Collection | null>;
516
+ collection(slug: string): Promise<[] | Collection>;
514
517
  /**
515
518
  * Get all pages
516
519
  */
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
- metadataJson?: {
529
- [key: string]: unknown;
530
- } | null;
531
- featuredAsset?: components["schemas"]["PublishedAssetRead"] | null;
532
- order?: number | null;
533
- }[]>;
520
+ pages(options?: GetEntriesOptions): Promise<ListEntry[]>;
534
521
  /**
535
522
  * Get all blog posts
536
523
  */
537
- posts(options?: GetEntriesOptions): Promise<{
538
- slug: string;
539
- title: string;
540
- entryType: string;
541
- entryTypeInfo?: components["schemas"]["PublishedEntryTypeInfo"] | null;
542
- summary?: string | null;
543
- publishedAt?: string | null;
544
- status: string;
545
- collections: string[];
546
- assetSlugs: string[];
547
- resourceSlugs: string[];
548
- metadataJson?: {
549
- [key: string]: unknown;
550
- } | null;
551
- featuredAsset?: components["schemas"]["PublishedAssetRead"] | null;
552
- order?: number | null;
553
- }[]>;
524
+ posts(options?: GetEntriesOptions): Promise<ListEntry[]>;
554
525
  /**
555
526
  * Get all projects
556
527
  */
557
- projects(options?: GetEntriesOptions): Promise<{
558
- slug: string;
559
- title: string;
560
- entryType: string;
561
- entryTypeInfo?: components["schemas"]["PublishedEntryTypeInfo"] | null;
562
- summary?: string | null;
563
- publishedAt?: string | null;
564
- status: string;
565
- collections: string[];
566
- assetSlugs: string[];
567
- resourceSlugs: string[];
568
- metadataJson?: {
569
- [key: string]: unknown;
570
- } | null;
571
- featuredAsset?: components["schemas"]["PublishedAssetRead"] | null;
572
- order?: number | null;
573
- }[]>;
528
+ projects(options?: GetEntriesOptions): Promise<ListEntry[]>;
574
529
  /**
575
530
  * Get a single resource by slug
576
531
  */
@@ -581,7 +536,7 @@ declare class MarvinClient {
581
536
  */
582
537
  collectionFallback(slugs: string[], options?: {
583
538
  requireEntries?: boolean;
584
- }): Promise<MarvinEntryListItem[]>;
539
+ }): Promise<CollectionEntry[]>;
585
540
  /**
586
541
  * @deprecated Use workspace.site or marvin.site instead
587
542
  */
@@ -589,7 +544,7 @@ declare class MarvinClient {
589
544
  /**
590
545
  * @deprecated Use workspace.entries.list() instead
591
546
  */
592
- getEntries(options?: GetEntriesOptions): Promise<MarvinEntryListItem[]>;
547
+ getEntries(options?: GetEntriesOptions): Promise<ListEntry[]>;
593
548
  /**
594
549
  * @deprecated Use workspace.entries.get() instead
595
550
  */
@@ -605,7 +560,7 @@ declare class MarvinClient {
605
560
  /**
606
561
  * @deprecated Use workspace.collections.entries() instead
607
562
  */
608
- getCollectionEntries(slug: string): Promise<MarvinEntryListItem[]>;
563
+ getCollectionEntries(slug: string): Promise<CollectionEntry[]>;
609
564
  /**
610
565
  * @deprecated Use workspace.assets.list() instead
611
566
  */
@@ -1,4 +1,4 @@
1
- import { m as PublishedEntryType, h as MarvinResource, M as MarvinAsset, c as MarvinCollection, e as MarvinEntryListItem, j as PublishedCollectionSummary, d as MarvinEntry, k as PublishedEntryAsset, l as PublishedEntryResource, i as MarvinSite, n as components, b as GetResourcesOptions$1 } from './index-BLIrbIHf.cjs';
1
+ import { q as PublishedEntryType, l as MarvinResource, M as MarvinAsset, g as MarvinCollection, a as CollectionEntry, n as PublishedCollectionSummary, h as MarvinEntry, E as EntryAsset, c as EntryCollectionContext, d as EntryResource, L as ListEntry, m as MarvinSite, f as GetResourcesOptions$1 } from './index-BVm5dIcw.cjs';
2
2
  import { H as HttpClient } from './HttpClient-CdF3IHM1.cjs';
3
3
 
4
4
  /**
@@ -306,7 +306,12 @@ declare class Collection {
306
306
  [key: string]: unknown;
307
307
  } | null | undefined;
308
308
  get entryCount(): number;
309
- get entries(): MarvinEntryListItem[];
309
+ /**
310
+ * Entries with junction context for this collection surfaced directly.
311
+ * - role, position, junctionMetadata: from this collection's junction record
312
+ * - collections: slugs of other collections the entry belongs to
313
+ */
314
+ get entries(): CollectionEntry[];
310
315
  toJSON(): MarvinCollection;
311
316
  }
312
317
 
@@ -323,22 +328,24 @@ declare class CollectionsModule {
323
328
  */
324
329
  list(): Promise<PublishedCollectionSummary[]>;
325
330
  /**
326
- * Get a single collection by slug
327
- * Returns null if collection is not found (404)
331
+ * Get a single collection by slug.
332
+ * Returns an empty array if the collection is not found (404).
328
333
  */
329
- get(slug: string): Promise<Collection | null>;
334
+ get(slug: string): Promise<Collection | []>;
330
335
  /**
331
- * Get entries in a collection
332
- * Returns empty array if collection is not found
336
+ * Get entries in a collection with junction context surfaced directly.
337
+ * Each entry has role/position/junctionMetadata from this collection's junction,
338
+ * and collections reduced to slugs of other memberships.
339
+ * Returns empty array if collection is not found.
333
340
  */
334
- entries(slug: string): Promise<MarvinEntryListItem[]>;
341
+ entries(slug: string): Promise<CollectionEntry[]>;
335
342
  /**
336
- * Try multiple collection slugs in fallback order
337
- * Returns the first collection that exists and has entries
343
+ * Try multiple collection slugs in fallback order.
344
+ * Returns entries from the first collection that exists and has entries.
338
345
  */
339
346
  fallback(slugs: string[], options?: {
340
347
  requireEntries?: boolean;
341
- }): Promise<MarvinEntryListItem[]>;
348
+ }): Promise<CollectionEntry[]>;
342
349
  }
343
350
 
344
351
  /**
@@ -372,13 +379,9 @@ declare class Entry {
372
379
  } | null | undefined;
373
380
  get publishedAt(): string | null | undefined;
374
381
  get order(): number | null | undefined;
375
- get assets(): PublishedEntryAsset[];
376
- get collections(): PublishedCollectionSummary[];
377
- get resources(): PublishedEntryResource[];
378
- asset(role: string): PublishedEntryAsset | undefined;
379
- assetsByRole(role: string): PublishedEntryAsset[];
380
- resource(role: string): PublishedEntryResource | undefined;
381
- resourcesByRole(role: string): PublishedEntryResource[];
382
+ get assets(): EntryAsset[];
383
+ get collections(): EntryCollectionContext[];
384
+ get resources(): EntryResource[];
382
385
  field<T = unknown>(key: string): T | undefined;
383
386
  get fields(): Record<string, unknown>;
384
387
  toJSON(): MarvinEntry;
@@ -402,7 +405,7 @@ declare class EntriesModule {
402
405
  /**
403
406
  * Get all published entries
404
407
  */
405
- list(options?: GetEntriesOptions): Promise<MarvinEntryListItem[]>;
408
+ list(options?: GetEntriesOptions): Promise<ListEntry[]>;
406
409
  /**
407
410
  * Get a single entry by slug
408
411
  * Returns null if entry is not found (404)
@@ -411,15 +414,15 @@ declare class EntriesModule {
411
414
  /**
412
415
  * Convenience: Get all pages
413
416
  */
414
- pages(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<MarvinEntryListItem[]>;
417
+ pages(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<ListEntry[]>;
415
418
  /**
416
419
  * Convenience: Get all blog posts
417
420
  */
418
- posts(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<MarvinEntryListItem[]>;
421
+ posts(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<ListEntry[]>;
419
422
  /**
420
423
  * Convenience: Get all projects
421
424
  */
422
- projects(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<MarvinEntryListItem[]>;
425
+ projects(options?: Omit<GetEntriesOptions, 'entryType'>): Promise<ListEntry[]>;
423
426
  }
424
427
 
425
428
  /**
@@ -510,67 +513,19 @@ declare class MarvinClient {
510
513
  /**
511
514
  * Get a single collection by slug
512
515
  */
513
- collection(slug: string): Promise<Collection | null>;
516
+ collection(slug: string): Promise<[] | Collection>;
514
517
  /**
515
518
  * Get all pages
516
519
  */
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
- metadataJson?: {
529
- [key: string]: unknown;
530
- } | null;
531
- featuredAsset?: components["schemas"]["PublishedAssetRead"] | null;
532
- order?: number | null;
533
- }[]>;
520
+ pages(options?: GetEntriesOptions): Promise<ListEntry[]>;
534
521
  /**
535
522
  * Get all blog posts
536
523
  */
537
- posts(options?: GetEntriesOptions): Promise<{
538
- slug: string;
539
- title: string;
540
- entryType: string;
541
- entryTypeInfo?: components["schemas"]["PublishedEntryTypeInfo"] | null;
542
- summary?: string | null;
543
- publishedAt?: string | null;
544
- status: string;
545
- collections: string[];
546
- assetSlugs: string[];
547
- resourceSlugs: string[];
548
- metadataJson?: {
549
- [key: string]: unknown;
550
- } | null;
551
- featuredAsset?: components["schemas"]["PublishedAssetRead"] | null;
552
- order?: number | null;
553
- }[]>;
524
+ posts(options?: GetEntriesOptions): Promise<ListEntry[]>;
554
525
  /**
555
526
  * Get all projects
556
527
  */
557
- projects(options?: GetEntriesOptions): Promise<{
558
- slug: string;
559
- title: string;
560
- entryType: string;
561
- entryTypeInfo?: components["schemas"]["PublishedEntryTypeInfo"] | null;
562
- summary?: string | null;
563
- publishedAt?: string | null;
564
- status: string;
565
- collections: string[];
566
- assetSlugs: string[];
567
- resourceSlugs: string[];
568
- metadataJson?: {
569
- [key: string]: unknown;
570
- } | null;
571
- featuredAsset?: components["schemas"]["PublishedAssetRead"] | null;
572
- order?: number | null;
573
- }[]>;
528
+ projects(options?: GetEntriesOptions): Promise<ListEntry[]>;
574
529
  /**
575
530
  * Get a single resource by slug
576
531
  */
@@ -581,7 +536,7 @@ declare class MarvinClient {
581
536
  */
582
537
  collectionFallback(slugs: string[], options?: {
583
538
  requireEntries?: boolean;
584
- }): Promise<MarvinEntryListItem[]>;
539
+ }): Promise<CollectionEntry[]>;
585
540
  /**
586
541
  * @deprecated Use workspace.site or marvin.site instead
587
542
  */
@@ -589,7 +544,7 @@ declare class MarvinClient {
589
544
  /**
590
545
  * @deprecated Use workspace.entries.list() instead
591
546
  */
592
- getEntries(options?: GetEntriesOptions): Promise<MarvinEntryListItem[]>;
547
+ getEntries(options?: GetEntriesOptions): Promise<ListEntry[]>;
593
548
  /**
594
549
  * @deprecated Use workspace.entries.get() instead
595
550
  */
@@ -605,7 +560,7 @@ declare class MarvinClient {
605
560
  /**
606
561
  * @deprecated Use workspace.collections.entries() instead
607
562
  */
608
- getCollectionEntries(slug: string): Promise<MarvinEntryListItem[]>;
563
+ getCollectionEntries(slug: string): Promise<CollectionEntry[]>;
609
564
  /**
610
565
  * @deprecated Use workspace.assets.list() instead
611
566
  */