@inneropen/marvin-sdk 1.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.
package/dist/index.cjs ADDED
@@ -0,0 +1,859 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __esm = (fn, res) => function __init() {
7
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
8
+ };
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
+
23
+ // src/client/config.ts
24
+ var config_exports = {};
25
+ __export(config_exports, {
26
+ createConfigFromEnv: () => createConfigFromEnv,
27
+ validateConfig: () => validateConfig
28
+ });
29
+ function validateConfig(config) {
30
+ if (!config.apiUrl) {
31
+ throw new Error("MARVIN_API_URL is required");
32
+ }
33
+ if (!config.siteClientToken) {
34
+ throw new Error("MARVIN_SITE_CLIENT_TOKEN is required");
35
+ }
36
+ if (!config.workspaceSlug) {
37
+ throw new Error("MARVIN_WORKSPACE_SLUG is required");
38
+ }
39
+ }
40
+ function createConfigFromEnv(overrides) {
41
+ return {
42
+ apiUrl: overrides?.apiUrl || process.env.MARVIN_API_URL || "",
43
+ siteClientToken: overrides?.siteClientToken || process.env.MARVIN_SITE_CLIENT_TOKEN || "",
44
+ workspaceSlug: overrides?.workspaceSlug || process.env.MARVIN_WORKSPACE_SLUG || "",
45
+ autoInitialize: overrides?.autoInitialize ?? false,
46
+ cacheDuration: overrides?.cacheDuration ?? 5 * 60 * 1e3
47
+ // 5 minutes
48
+ };
49
+ }
50
+ var init_config = __esm({
51
+ "src/client/config.ts"() {
52
+ "use strict";
53
+ }
54
+ });
55
+
56
+ // src/client/http.ts
57
+ var MarvinHttpClient;
58
+ var init_http = __esm({
59
+ "src/client/http.ts"() {
60
+ "use strict";
61
+ MarvinHttpClient = class {
62
+ constructor(config) {
63
+ this.config = config;
64
+ }
65
+ config;
66
+ async fetch(endpoint) {
67
+ const url = `${this.config.apiUrl}${endpoint}`;
68
+ try {
69
+ const response = await fetch(url, {
70
+ headers: {
71
+ "Authorization": `Bearer ${this.config.siteClientToken}`,
72
+ "Content-Type": "application/json"
73
+ }
74
+ });
75
+ if (!response.ok) {
76
+ const errorText = await response.text();
77
+ throw new Error(
78
+ `Marvin API error: ${response.status} ${response.statusText} at ${endpoint}
79
+ ${errorText}`
80
+ );
81
+ }
82
+ return await response.json();
83
+ } catch (error) {
84
+ if (error instanceof Error) {
85
+ const safeMessage = error.message.replace(
86
+ this.config.siteClientToken,
87
+ "[REDACTED]"
88
+ );
89
+ throw new Error(safeMessage);
90
+ }
91
+ throw error;
92
+ }
93
+ }
94
+ buildQueryString(params) {
95
+ const filtered = Object.entries(params).filter(([_, value]) => value !== void 0).map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`);
96
+ return filtered.length > 0 ? `?${filtered.join("&")}` : "";
97
+ }
98
+ };
99
+ }
100
+ });
101
+
102
+ // src/utils/cache.ts
103
+ var MarvinCache;
104
+ var init_cache = __esm({
105
+ "src/utils/cache.ts"() {
106
+ "use strict";
107
+ MarvinCache = class {
108
+ constructor(duration = 5 * 60 * 1e3) {
109
+ this.duration = duration;
110
+ }
111
+ duration;
112
+ cache = /* @__PURE__ */ new Map();
113
+ get(key) {
114
+ const entry = this.cache.get(key);
115
+ if (!entry) return void 0;
116
+ const age = Date.now() - entry.timestamp;
117
+ if (age > this.duration) {
118
+ this.cache.delete(key);
119
+ return void 0;
120
+ }
121
+ return entry.data;
122
+ }
123
+ set(key, data) {
124
+ this.cache.set(key, {
125
+ data,
126
+ timestamp: Date.now()
127
+ });
128
+ }
129
+ has(key) {
130
+ return this.get(key) !== void 0;
131
+ }
132
+ clear() {
133
+ this.cache.clear();
134
+ }
135
+ delete(key) {
136
+ this.cache.delete(key);
137
+ }
138
+ };
139
+ }
140
+ });
141
+
142
+ // src/entries/entry.ts
143
+ var Entry;
144
+ var init_entry = __esm({
145
+ "src/entries/entry.ts"() {
146
+ "use strict";
147
+ Entry = class {
148
+ constructor(data, http, workspaceSlug) {
149
+ this.data = data;
150
+ this.http = http;
151
+ this.workspaceSlug = workspaceSlug;
152
+ }
153
+ data;
154
+ http;
155
+ workspaceSlug;
156
+ // Expose all entry data as properties
157
+ get id() {
158
+ return this.data.id;
159
+ }
160
+ get title() {
161
+ return this.data.title;
162
+ }
163
+ get slug() {
164
+ return this.data.slug;
165
+ }
166
+ get summary() {
167
+ return this.data.summary;
168
+ }
169
+ get description() {
170
+ return this.data.description;
171
+ }
172
+ get contentMarkdown() {
173
+ return this.data.contentMarkdown;
174
+ }
175
+ get metadata() {
176
+ return this.data.metadata;
177
+ }
178
+ get status() {
179
+ return this.data.status;
180
+ }
181
+ get publishedAt() {
182
+ return this.data.publishedAt;
183
+ }
184
+ get createdAt() {
185
+ return this.data.createdAt;
186
+ }
187
+ get updatedAt() {
188
+ return this.data.updatedAt;
189
+ }
190
+ get entryTypeId() {
191
+ return this.data.entryTypeId;
192
+ }
193
+ get entryType() {
194
+ return this.data.entryType;
195
+ }
196
+ /**
197
+ * Get entry assets
198
+ */
199
+ get assets() {
200
+ return this.data.assets || [];
201
+ }
202
+ /**
203
+ * Get entry collections
204
+ */
205
+ get collections() {
206
+ return this.data.collections || [];
207
+ }
208
+ /**
209
+ * Get related entries (future)
210
+ */
211
+ async relatedEntries() {
212
+ throw new Error("Related entries not yet implemented");
213
+ }
214
+ /**
215
+ * Get raw entry data
216
+ */
217
+ toJSON() {
218
+ return this.data;
219
+ }
220
+ };
221
+ }
222
+ });
223
+
224
+ // src/entries/entries.ts
225
+ var EntriesModule;
226
+ var init_entries = __esm({
227
+ "src/entries/entries.ts"() {
228
+ "use strict";
229
+ init_entry();
230
+ EntriesModule = class {
231
+ constructor(http, workspaceSlug) {
232
+ this.http = http;
233
+ this.workspaceSlug = workspaceSlug;
234
+ }
235
+ http;
236
+ workspaceSlug;
237
+ /**
238
+ * Get all published entries
239
+ */
240
+ async list(options = {}) {
241
+ const queryString = this.http.buildQueryString({
242
+ entry_type: options.entryType,
243
+ collection: options.collection,
244
+ limit: options.limit,
245
+ offset: options.offset,
246
+ status: options.status || "published"
247
+ });
248
+ const endpoint = `/api/publish/${this.workspaceSlug}/entries${queryString}`;
249
+ return this.http.fetch(endpoint);
250
+ }
251
+ /**
252
+ * Get a single entry by slug
253
+ */
254
+ async get(slug) {
255
+ const endpoint = `/api/publish/${this.workspaceSlug}/entries/${slug}`;
256
+ const data = await this.http.fetch(endpoint);
257
+ return new Entry(data, this.http, this.workspaceSlug);
258
+ }
259
+ /**
260
+ * Convenience: Get all pages
261
+ */
262
+ async pages(options) {
263
+ return this.list({ ...options, entryType: "page" });
264
+ }
265
+ /**
266
+ * Convenience: Get all blog posts
267
+ */
268
+ async posts(options) {
269
+ return this.list({ ...options, entryType: "blog" });
270
+ }
271
+ /**
272
+ * Convenience: Get all projects
273
+ */
274
+ async projects(options) {
275
+ return this.list({ ...options, entryType: "project" });
276
+ }
277
+ };
278
+ }
279
+ });
280
+
281
+ // src/collections/collection.ts
282
+ var Collection;
283
+ var init_collection = __esm({
284
+ "src/collections/collection.ts"() {
285
+ "use strict";
286
+ Collection = class {
287
+ constructor(data, http, workspaceSlug) {
288
+ this.data = data;
289
+ this.http = http;
290
+ this.workspaceSlug = workspaceSlug;
291
+ }
292
+ data;
293
+ http;
294
+ workspaceSlug;
295
+ // Expose all collection data as properties
296
+ get id() {
297
+ return this.data.id;
298
+ }
299
+ get name() {
300
+ return this.data.name;
301
+ }
302
+ get slug() {
303
+ return this.data.slug;
304
+ }
305
+ get description() {
306
+ return this.data.description;
307
+ }
308
+ get icon() {
309
+ return this.data.icon;
310
+ }
311
+ get color() {
312
+ return this.data.color;
313
+ }
314
+ get sortOrder() {
315
+ return this.data.sortOrder;
316
+ }
317
+ get isSmart() {
318
+ return this.data.isSmart;
319
+ }
320
+ get smartRules() {
321
+ return this.data.smartRules;
322
+ }
323
+ get createdAt() {
324
+ return this.data.createdAt;
325
+ }
326
+ get updatedAt() {
327
+ return this.data.updatedAt;
328
+ }
329
+ /**
330
+ * Get all entries in this collection
331
+ */
332
+ async entries() {
333
+ const endpoint = `/api/publish/${this.workspaceSlug}/collections/${this.data.slug}/entries`;
334
+ return this.http.fetch(endpoint);
335
+ }
336
+ /**
337
+ * Get assets in this collection (future)
338
+ */
339
+ async assets() {
340
+ throw new Error("Collection assets not yet implemented");
341
+ }
342
+ /**
343
+ * Get collection metadata (future)
344
+ */
345
+ async metadata() {
346
+ throw new Error("Collection metadata not yet implemented");
347
+ }
348
+ /**
349
+ * Get raw collection data
350
+ */
351
+ toJSON() {
352
+ return this.data;
353
+ }
354
+ };
355
+ }
356
+ });
357
+
358
+ // src/collections/collections.ts
359
+ var CollectionsModule;
360
+ var init_collections = __esm({
361
+ "src/collections/collections.ts"() {
362
+ "use strict";
363
+ init_collection();
364
+ CollectionsModule = class {
365
+ constructor(http, workspaceSlug) {
366
+ this.http = http;
367
+ this.workspaceSlug = workspaceSlug;
368
+ }
369
+ http;
370
+ workspaceSlug;
371
+ /**
372
+ * Get all collections
373
+ */
374
+ async list() {
375
+ const endpoint = `/api/publish/${this.workspaceSlug}/collections`;
376
+ return this.http.fetch(endpoint);
377
+ }
378
+ /**
379
+ * Get a single collection by slug
380
+ */
381
+ async get(slug) {
382
+ const endpoint = `/api/publish/${this.workspaceSlug}/collections/${slug}`;
383
+ const data = await this.http.fetch(endpoint);
384
+ return new Collection(data, this.http, this.workspaceSlug);
385
+ }
386
+ /**
387
+ * Get entries in a collection
388
+ */
389
+ async entries(slug) {
390
+ const collection = await this.get(slug);
391
+ return collection.entries();
392
+ }
393
+ };
394
+ }
395
+ });
396
+
397
+ // src/assets/assets.ts
398
+ var AssetsModule;
399
+ var init_assets = __esm({
400
+ "src/assets/assets.ts"() {
401
+ "use strict";
402
+ AssetsModule = class {
403
+ constructor(http, workspaceSlug) {
404
+ this.http = http;
405
+ this.workspaceSlug = workspaceSlug;
406
+ }
407
+ http;
408
+ workspaceSlug;
409
+ /**
410
+ * Get all published assets
411
+ */
412
+ async list(options = {}) {
413
+ const queryString = this.http.buildQueryString({
414
+ type: options.type,
415
+ limit: options.limit,
416
+ offset: options.offset
417
+ });
418
+ const endpoint = `/api/publish/${this.workspaceSlug}/assets${queryString}`;
419
+ return this.http.fetch(endpoint);
420
+ }
421
+ /**
422
+ * Convenience: Get all images
423
+ */
424
+ async images(options) {
425
+ return this.list({ ...options, type: "image" });
426
+ }
427
+ /**
428
+ * Convenience: Get all videos
429
+ */
430
+ async videos(options) {
431
+ return this.list({ ...options, type: "video" });
432
+ }
433
+ /**
434
+ * Convenience: Get all documents
435
+ */
436
+ async documents(options) {
437
+ return this.list({ ...options, type: "document" });
438
+ }
439
+ };
440
+ }
441
+ });
442
+
443
+ // src/resources/resource.ts
444
+ var Resource;
445
+ var init_resource = __esm({
446
+ "src/resources/resource.ts"() {
447
+ "use strict";
448
+ Resource = class {
449
+ constructor(data, http, workspaceSlug) {
450
+ this.data = data;
451
+ this.http = http;
452
+ this.workspaceSlug = workspaceSlug;
453
+ }
454
+ data;
455
+ http;
456
+ workspaceSlug;
457
+ // Expose all resource data as properties
458
+ get id() {
459
+ return this.data.id;
460
+ }
461
+ get name() {
462
+ return this.data.name;
463
+ }
464
+ get slug() {
465
+ return this.data.slug;
466
+ }
467
+ get resourceType() {
468
+ return this.data.resourceType;
469
+ }
470
+ get description() {
471
+ return this.data.description;
472
+ }
473
+ get externalId() {
474
+ return this.data.externalId;
475
+ }
476
+ get url() {
477
+ return this.data.url;
478
+ }
479
+ get metadata() {
480
+ return this.data.metadata;
481
+ }
482
+ get createdAt() {
483
+ return this.data.createdAt;
484
+ }
485
+ get updatedAt() {
486
+ return this.data.updatedAt;
487
+ }
488
+ /**
489
+ * Get all entries that reference this resource
490
+ */
491
+ async entries() {
492
+ const endpoint = `/api/publish/${this.workspaceSlug}/resources/${this.data.slug}/entries`;
493
+ return this.http.fetch(endpoint);
494
+ }
495
+ /**
496
+ * Get assets related to this resource (future)
497
+ */
498
+ async assets() {
499
+ throw new Error("Resource assets not yet implemented");
500
+ }
501
+ /**
502
+ * Get raw resource data
503
+ */
504
+ toJSON() {
505
+ return this.data;
506
+ }
507
+ };
508
+ }
509
+ });
510
+
511
+ // src/resources/resources.ts
512
+ var ResourcesModule;
513
+ var init_resources = __esm({
514
+ "src/resources/resources.ts"() {
515
+ "use strict";
516
+ init_resource();
517
+ ResourcesModule = class {
518
+ constructor(http, workspaceSlug) {
519
+ this.http = http;
520
+ this.workspaceSlug = workspaceSlug;
521
+ }
522
+ http;
523
+ workspaceSlug;
524
+ /**
525
+ * Get all published resources
526
+ */
527
+ async list(options = {}) {
528
+ const queryString = this.http.buildQueryString({
529
+ resource_type: options.resourceType,
530
+ limit: options.limit,
531
+ offset: options.offset
532
+ });
533
+ const endpoint = `/api/publish/${this.workspaceSlug}/resources${queryString}`;
534
+ return this.http.fetch(endpoint);
535
+ }
536
+ /**
537
+ * Get a single resource by slug
538
+ */
539
+ async get(slug) {
540
+ const endpoint = `/api/publish/${this.workspaceSlug}/resources/${slug}`;
541
+ const data = await this.http.fetch(endpoint);
542
+ return new Resource(data, this.http, this.workspaceSlug);
543
+ }
544
+ /**
545
+ * Get entries that reference this resource
546
+ */
547
+ async entries(slug) {
548
+ const resource = await this.get(slug);
549
+ return resource.entries();
550
+ }
551
+ };
552
+ }
553
+ });
554
+
555
+ // src/workspaces/workspace.ts
556
+ var Workspace;
557
+ var init_workspace = __esm({
558
+ "src/workspaces/workspace.ts"() {
559
+ "use strict";
560
+ init_entries();
561
+ init_collections();
562
+ init_assets();
563
+ init_resources();
564
+ Workspace = class {
565
+ constructor(http, slug) {
566
+ this.http = http;
567
+ this._slug = slug;
568
+ this.entries = new EntriesModule(http, slug);
569
+ this.collections = new CollectionsModule(http, slug);
570
+ this.assets = new AssetsModule(http, slug);
571
+ this.resources = new ResourcesModule(http, slug);
572
+ }
573
+ http;
574
+ _site = null;
575
+ _slug;
576
+ entries;
577
+ collections;
578
+ assets;
579
+ resources;
580
+ /**
581
+ * Get workspace slug
582
+ */
583
+ get slug() {
584
+ return this._slug;
585
+ }
586
+ /**
587
+ * Get site configuration (cached after first load)
588
+ */
589
+ get site() {
590
+ return this._site;
591
+ }
592
+ /**
593
+ * Load site configuration
594
+ */
595
+ async loadSite() {
596
+ const endpoint = `/api/publish/${this._slug}/site`;
597
+ this._site = await this.http.fetch(endpoint);
598
+ return this._site;
599
+ }
600
+ /**
601
+ * Get workspace info (name and slug only)
602
+ */
603
+ async getInfo() {
604
+ const endpoint = `/api/publish/${this._slug}`;
605
+ return this.http.fetch(endpoint);
606
+ }
607
+ /**
608
+ * Get workspace settings (future)
609
+ */
610
+ async settings() {
611
+ throw new Error("Workspace settings not yet implemented");
612
+ }
613
+ };
614
+ }
615
+ });
616
+
617
+ // src/client/marvin.ts
618
+ var marvin_exports = {};
619
+ __export(marvin_exports, {
620
+ MarvinClient: () => MarvinClient
621
+ });
622
+ var MarvinClient;
623
+ var init_marvin = __esm({
624
+ "src/client/marvin.ts"() {
625
+ "use strict";
626
+ init_config();
627
+ init_http();
628
+ init_cache();
629
+ init_workspace();
630
+ MarvinClient = class {
631
+ constructor(config) {
632
+ this.config = config;
633
+ validateConfig(config);
634
+ this.http = new MarvinHttpClient(config);
635
+ this.cache = new MarvinCache(config.cacheDuration);
636
+ this.workspace = new Workspace(this.http, config.workspaceSlug);
637
+ if (config.autoInitialize) {
638
+ this.initialize();
639
+ }
640
+ }
641
+ config;
642
+ http;
643
+ cache;
644
+ workspace;
645
+ initialized = false;
646
+ /**
647
+ * Initialize the SDK
648
+ * Preloads site configuration and metadata
649
+ */
650
+ async initialize() {
651
+ if (this.initialized) return;
652
+ try {
653
+ await this.workspace.loadSite();
654
+ this.initialized = true;
655
+ } catch (error) {
656
+ console.warn("Marvin SDK initialization warning:", error);
657
+ }
658
+ }
659
+ // ======================
660
+ // Workspace-First API
661
+ // ======================
662
+ /**
663
+ * Get the workspace object
664
+ */
665
+ async getWorkspace() {
666
+ if (!this.initialized) {
667
+ await this.initialize();
668
+ }
669
+ return this.workspace;
670
+ }
671
+ /**
672
+ * Get site configuration (cached)
673
+ */
674
+ get site() {
675
+ return this.workspace.site;
676
+ }
677
+ /**
678
+ * Get workspace info (name and slug)
679
+ */
680
+ async getWorkspaceInfo() {
681
+ return this.workspace.getInfo();
682
+ }
683
+ /**
684
+ * Get entries module
685
+ */
686
+ get entries() {
687
+ return this.workspace.entries;
688
+ }
689
+ /**
690
+ * Get collections module
691
+ */
692
+ get collections() {
693
+ return this.workspace.collections;
694
+ }
695
+ /**
696
+ * Get assets module
697
+ */
698
+ get assets() {
699
+ return this.workspace.assets;
700
+ }
701
+ /**
702
+ * Get resources module
703
+ */
704
+ get resources() {
705
+ return this.workspace.resources;
706
+ }
707
+ // ======================
708
+ // Convenience Methods
709
+ // ======================
710
+ /**
711
+ * Get a single entry by slug
712
+ */
713
+ async entry(slug) {
714
+ return this.workspace.entries.get(slug);
715
+ }
716
+ /**
717
+ * Get a single collection by slug
718
+ */
719
+ async collection(slug) {
720
+ return this.workspace.collections.get(slug);
721
+ }
722
+ /**
723
+ * Get all pages
724
+ */
725
+ async pages(options) {
726
+ return this.workspace.entries.pages(options);
727
+ }
728
+ /**
729
+ * Get all blog posts
730
+ */
731
+ async posts(options) {
732
+ return this.workspace.entries.posts(options);
733
+ }
734
+ /**
735
+ * Get all projects
736
+ */
737
+ async projects(options) {
738
+ return this.workspace.entries.projects(options);
739
+ }
740
+ /**
741
+ * Get a single resource by slug
742
+ */
743
+ async resource(slug) {
744
+ return this.workspace.resources.get(slug);
745
+ }
746
+ // ======================
747
+ // Backwards-Compatible Publishing API
748
+ // ======================
749
+ /**
750
+ * @deprecated Use workspace.site or marvin.site instead
751
+ * Get site configuration
752
+ */
753
+ async getSite() {
754
+ return this.workspace.loadSite();
755
+ }
756
+ /**
757
+ * @deprecated Use workspace.entries.list() instead
758
+ * Get all published entries
759
+ */
760
+ async getEntries(options) {
761
+ return this.workspace.entries.list(options);
762
+ }
763
+ /**
764
+ * @deprecated Use workspace.entries.get() instead
765
+ * Get a single published entry by slug
766
+ */
767
+ async getEntry(slug) {
768
+ const entry = await this.workspace.entries.get(slug);
769
+ return entry.toJSON();
770
+ }
771
+ /**
772
+ * @deprecated Use workspace.collections.list() instead
773
+ * Get all collections
774
+ */
775
+ async getCollections() {
776
+ return this.workspace.collections.list();
777
+ }
778
+ /**
779
+ * @deprecated Use workspace.collections.get() instead
780
+ * Get a single collection by slug
781
+ */
782
+ async getCollection(slug) {
783
+ const collection = await this.workspace.collections.get(slug);
784
+ return collection.toJSON();
785
+ }
786
+ /**
787
+ * @deprecated Use workspace.collections.entries() instead
788
+ * Get all entries in a collection
789
+ */
790
+ async getCollectionEntries(slug) {
791
+ return this.workspace.collections.entries(slug);
792
+ }
793
+ /**
794
+ * @deprecated Use workspace.assets.list() instead
795
+ * Get all published assets
796
+ */
797
+ async getAssets(options) {
798
+ return this.workspace.assets.list(options);
799
+ }
800
+ /**
801
+ * @deprecated Use workspace.resources.list() instead
802
+ * Get all published resources
803
+ */
804
+ async getResources(options) {
805
+ return this.workspace.resources.list(options);
806
+ }
807
+ /**
808
+ * @deprecated Use workspace.resources.get() instead
809
+ * Get a single resource by slug
810
+ */
811
+ async getResource(slug) {
812
+ const resource = await this.workspace.resources.get(slug);
813
+ return resource.toJSON();
814
+ }
815
+ /**
816
+ * @deprecated Use workspace.resources.entries() instead
817
+ * Get entries that reference a resource
818
+ */
819
+ async getResourceEntries(slug) {
820
+ return this.workspace.resources.entries(slug);
821
+ }
822
+ };
823
+ }
824
+ });
825
+
826
+ // src/index.ts
827
+ var index_exports = {};
828
+ __export(index_exports, {
829
+ Collection: () => Collection,
830
+ Entry: () => Entry,
831
+ MarvinClient: () => MarvinClient,
832
+ Resource: () => Resource,
833
+ Workspace: () => Workspace,
834
+ createConfigFromEnv: () => createConfigFromEnv,
835
+ createMarvinClient: () => createMarvinClient
836
+ });
837
+ module.exports = __toCommonJS(index_exports);
838
+ init_marvin();
839
+ init_config();
840
+ init_workspace();
841
+ init_entry();
842
+ init_collection();
843
+ init_resource();
844
+ function createMarvinClient(config) {
845
+ const { MarvinClient: MarvinClient2 } = (init_marvin(), __toCommonJS(marvin_exports));
846
+ const { createConfigFromEnv: createConfigFromEnv2 } = (init_config(), __toCommonJS(config_exports));
847
+ const finalConfig = createConfigFromEnv2(config);
848
+ return new MarvinClient2(finalConfig);
849
+ }
850
+ // Annotate the CommonJS export names for ESM import in node:
851
+ 0 && (module.exports = {
852
+ Collection,
853
+ Entry,
854
+ MarvinClient,
855
+ Resource,
856
+ Workspace,
857
+ createConfigFromEnv,
858
+ createMarvinClient
859
+ });