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