@ourofoundation/ouro-js 3.5.8 → 3.7.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.
Files changed (110) hide show
  1. package/dist/{chunk-6GPIZJ4T.cjs → chunk-57RRLX7P.cjs} +2 -2
  2. package/dist/{chunk-6GPIZJ4T.cjs.map → chunk-57RRLX7P.cjs.map} +1 -1
  3. package/dist/chunk-5EQ5LO7V.cjs +2 -0
  4. package/dist/chunk-5EQ5LO7V.cjs.map +1 -0
  5. package/dist/chunk-7EKD5NQB.js +2 -0
  6. package/dist/{chunk-IWOXGKK4.js.map → chunk-7EKD5NQB.js.map} +1 -1
  7. package/dist/{chunk-YKA3RUTN.cjs → chunk-AI2FA44G.cjs} +2 -2
  8. package/dist/{chunk-YKA3RUTN.cjs.map → chunk-AI2FA44G.cjs.map} +1 -1
  9. package/dist/chunk-AWBCE7ME.cjs +2 -0
  10. package/dist/chunk-AWBCE7ME.cjs.map +1 -0
  11. package/dist/chunk-DY5QSBE4.js +2 -0
  12. package/dist/chunk-DY5QSBE4.js.map +1 -0
  13. package/dist/{chunk-DBEBXFQI.cjs → chunk-HW6FGPTA.cjs} +2 -2
  14. package/dist/{chunk-DBEBXFQI.cjs.map → chunk-HW6FGPTA.cjs.map} +1 -1
  15. package/dist/{chunk-G3VMEPTP.js → chunk-ITF5WQQB.js} +2 -2
  16. package/dist/{chunk-G3VMEPTP.js.map → chunk-ITF5WQQB.js.map} +1 -1
  17. package/dist/{chunk-USO3MLKI.cjs → chunk-IVO3RQUN.cjs} +2 -2
  18. package/dist/chunk-IVO3RQUN.cjs.map +1 -0
  19. package/dist/chunk-JUELSRCY.js +2 -0
  20. package/dist/{chunk-4UE3XIYR.js.map → chunk-JUELSRCY.js.map} +1 -1
  21. package/dist/chunk-KHERHT26.cjs +2 -0
  22. package/dist/chunk-KHERHT26.cjs.map +1 -0
  23. package/dist/{chunk-F5CWCYOP.cjs → chunk-NTWSEN2H.cjs} +2 -2
  24. package/dist/{chunk-F5CWCYOP.cjs.map → chunk-NTWSEN2H.cjs.map} +1 -1
  25. package/dist/chunk-OU4JKY4M.js +2 -0
  26. package/dist/chunk-OU4JKY4M.js.map +1 -0
  27. package/dist/chunk-QBL6KIST.js +2 -0
  28. package/dist/{chunk-WNYOQITO.js.map → chunk-QBL6KIST.js.map} +1 -1
  29. package/dist/{chunk-6ZJQTECB.cjs → chunk-QNERXSMJ.cjs} +2 -2
  30. package/dist/{chunk-6ZJQTECB.cjs.map → chunk-QNERXSMJ.cjs.map} +1 -1
  31. package/dist/chunk-QSOXS57A.cjs +2 -0
  32. package/dist/chunk-QSOXS57A.cjs.map +1 -0
  33. package/dist/chunk-RD6EPK44.js +2 -0
  34. package/dist/{chunk-KCVE35IO.js.map → chunk-RD6EPK44.js.map} +1 -1
  35. package/dist/{chunk-FRMPLGE4.cjs → chunk-SY5IKIT6.cjs} +2 -2
  36. package/dist/{chunk-FRMPLGE4.cjs.map → chunk-SY5IKIT6.cjs.map} +1 -1
  37. package/dist/chunk-T3HVRQBB.js +2 -0
  38. package/dist/chunk-T3HVRQBB.js.map +1 -0
  39. package/dist/chunk-TGOXRPF5.js +2 -0
  40. package/dist/chunk-TGOXRPF5.js.map +1 -0
  41. package/dist/{chunk-TYOQ32UV.js → chunk-TMNFNVTZ.js} +2 -2
  42. package/dist/{chunk-TYOQ32UV.js.map → chunk-TMNFNVTZ.js.map} +1 -1
  43. package/dist/chunk-ZC2VDKSH.js +2 -0
  44. package/dist/chunk-ZC2VDKSH.js.map +1 -0
  45. package/dist/index.cjs +1 -1
  46. package/dist/index.d.cts +2 -1
  47. package/dist/index.d.ts +2 -1
  48. package/dist/index.js +1 -1
  49. package/dist/schema/assets.cjs +1 -1
  50. package/dist/schema/assets.d.cts +175 -45
  51. package/dist/schema/assets.d.ts +175 -45
  52. package/dist/schema/assets.js +1 -1
  53. package/dist/schema/comments.cjs +1 -1
  54. package/dist/schema/comments.d.cts +95 -27
  55. package/dist/schema/comments.d.ts +95 -27
  56. package/dist/schema/comments.js +1 -1
  57. package/dist/schema/conversations.cjs +1 -1
  58. package/dist/schema/conversations.d.cts +163 -47
  59. package/dist/schema/conversations.d.ts +163 -47
  60. package/dist/schema/conversations.js +1 -1
  61. package/dist/schema/datasets.cjs +1 -1
  62. package/dist/schema/datasets.d.cts +230 -66
  63. package/dist/schema/datasets.d.ts +230 -66
  64. package/dist/schema/datasets.js +1 -1
  65. package/dist/schema/files.cjs +1 -1
  66. package/dist/schema/files.d.cts +230 -66
  67. package/dist/schema/files.d.ts +230 -66
  68. package/dist/schema/files.js +1 -1
  69. package/dist/schema/posts.cjs +1 -1
  70. package/dist/schema/posts.d.cts +250 -74
  71. package/dist/schema/posts.d.ts +250 -74
  72. package/dist/schema/posts.js +1 -1
  73. package/dist/schema/quests.cjs +1 -1
  74. package/dist/schema/quests.d.cts +164 -48
  75. package/dist/schema/quests.d.ts +164 -48
  76. package/dist/schema/quests.js +1 -1
  77. package/dist/schema/services.cjs +1 -1
  78. package/dist/schema/services.d.cts +247 -71
  79. package/dist/schema/services.d.ts +247 -71
  80. package/dist/schema/services.js +1 -1
  81. package/dist/utils/air/index.cjs +1 -1
  82. package/dist/utils/air/index.js +1 -1
  83. package/dist/utils/files.cjs +2 -0
  84. package/dist/utils/files.cjs.map +1 -0
  85. package/dist/utils/files.d.cts +18 -0
  86. package/dist/utils/files.d.ts +18 -0
  87. package/dist/utils/files.js +2 -0
  88. package/dist/utils/files.js.map +1 -0
  89. package/dist/utils/quest-submission.cjs +1 -1
  90. package/dist/utils/quest-submission.js +1 -1
  91. package/package.json +2 -2
  92. package/dist/chunk-4UE3XIYR.js +0 -2
  93. package/dist/chunk-IWOXGKK4.js +0 -2
  94. package/dist/chunk-KCVE35IO.js +0 -2
  95. package/dist/chunk-LQOKGPEK.js +0 -2
  96. package/dist/chunk-LQOKGPEK.js.map +0 -1
  97. package/dist/chunk-MLTO7TMM.js +0 -2
  98. package/dist/chunk-MLTO7TMM.js.map +0 -1
  99. package/dist/chunk-NABNY2EN.js +0 -2
  100. package/dist/chunk-NABNY2EN.js.map +0 -1
  101. package/dist/chunk-ROMY5WNQ.cjs +0 -2
  102. package/dist/chunk-ROMY5WNQ.cjs.map +0 -1
  103. package/dist/chunk-SR5UZ4NP.js +0 -2
  104. package/dist/chunk-SR5UZ4NP.js.map +0 -1
  105. package/dist/chunk-TUZS3DKI.cjs +0 -2
  106. package/dist/chunk-TUZS3DKI.cjs.map +0 -1
  107. package/dist/chunk-USO3MLKI.cjs.map +0 -1
  108. package/dist/chunk-V73EW77Y.cjs +0 -2
  109. package/dist/chunk-V73EW77Y.cjs.map +0 -1
  110. package/dist/chunk-WNYOQITO.js +0 -2
@@ -207,6 +207,35 @@ declare const ServiceSchema: z.ZodObject<{
207
207
  stripe_product_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
208
208
  stripe_price_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
209
209
  stripe_meter_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
210
+ attribution: z.ZodOptional<z.ZodNullable<z.ZodObject<{
211
+ originality: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
212
+ original: "original";
213
+ derivative: "derivative";
214
+ "third-party": "third-party";
215
+ }>>>;
216
+ external_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
217
+ github_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
218
+ paper_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
219
+ doi_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
220
+ citation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
221
+ doi: z.ZodOptional<z.ZodNullable<z.ZodString>>;
222
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
223
+ authors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
224
+ year: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
225
+ venue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
226
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
227
+ bibtex: z.ZodOptional<z.ZodNullable<z.ZodString>>;
228
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
229
+ }, z.core.$strip>>>;
230
+ relation_type: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
231
+ IsSupplementTo: "IsSupplementTo";
232
+ IsDerivedFrom: "IsDerivedFrom";
233
+ References: "References";
234
+ IsVariantFormOf: "IsVariantFormOf";
235
+ IsIdenticalTo: "IsIdenticalTo";
236
+ }>>>;
237
+ doi: z.ZodOptional<z.ZodNullable<z.ZodString>>;
238
+ }, z.core.$strip>>>;
210
239
  preview: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>>>>;
211
240
  state: z.ZodEnum<{
212
241
  success: "success";
@@ -247,15 +276,6 @@ declare const ServiceSchema: z.ZodObject<{
247
276
  spec_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
248
277
  spec_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
249
278
  auth_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
250
- doi_url: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
251
- external_url: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
252
- paper_url: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
253
- github_url: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
254
- originality: z.ZodOptional<z.ZodEnum<{
255
- original: "original";
256
- derivative: "derivative";
257
- "third-party": "third-party";
258
- }>>;
259
279
  source: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
260
280
  reply_to_comment_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
261
281
  }, z.core.$strip>;
@@ -287,6 +307,35 @@ declare const CreateServiceSchema: z.ZodPipe<z.ZodObject<{
287
307
  stripe_product_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
288
308
  stripe_price_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
289
309
  stripe_meter_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
310
+ attribution: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
311
+ originality: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
312
+ original: "original";
313
+ derivative: "derivative";
314
+ "third-party": "third-party";
315
+ }>>>;
316
+ external_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
317
+ github_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
318
+ paper_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
319
+ doi_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
320
+ citation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
321
+ doi: z.ZodOptional<z.ZodNullable<z.ZodString>>;
322
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
323
+ authors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
324
+ year: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
325
+ venue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
326
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
327
+ bibtex: z.ZodOptional<z.ZodNullable<z.ZodString>>;
328
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
329
+ }, z.core.$strip>>>;
330
+ relation_type: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
331
+ IsSupplementTo: "IsSupplementTo";
332
+ IsDerivedFrom: "IsDerivedFrom";
333
+ References: "References";
334
+ IsVariantFormOf: "IsVariantFormOf";
335
+ IsIdenticalTo: "IsIdenticalTo";
336
+ }>>>;
337
+ doi: z.ZodOptional<z.ZodNullable<z.ZodString>>;
338
+ }, z.core.$strip>>>>;
290
339
  preview: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>>>>>;
291
340
  id: z.ZodDefault<z.ZodUUID>;
292
341
  team_id: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
@@ -338,15 +387,6 @@ declare const CreateServiceSchema: z.ZodPipe<z.ZodObject<{
338
387
  spec_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
339
388
  spec_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
340
389
  auth_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
341
- doi_url: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
342
- external_url: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
343
- paper_url: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
344
- github_url: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
345
- originality: z.ZodOptional<z.ZodEnum<{
346
- original: "original";
347
- derivative: "derivative";
348
- "third-party": "third-party";
349
- }>>;
350
390
  source: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
351
391
  reply_to_comment_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
352
392
  }, z.core.$strip>;
@@ -368,11 +408,6 @@ declare const CreateServiceSchema: z.ZodPipe<z.ZodObject<{
368
408
  spec_path?: string | null | undefined;
369
409
  spec_url?: string | null | undefined;
370
410
  auth_url?: string | null | undefined;
371
- doi_url?: string | null | undefined;
372
- external_url?: string | null | undefined;
373
- paper_url?: string | null | undefined;
374
- github_url?: string | null | undefined;
375
- originality?: "original" | "derivative" | "third-party" | undefined;
376
411
  source?: string | null | undefined;
377
412
  reply_to_comment_id?: string | null | undefined;
378
413
  };
@@ -392,6 +427,25 @@ declare const CreateServiceSchema: z.ZodPipe<z.ZodObject<{
392
427
  stripe_product_id?: string | null | undefined;
393
428
  stripe_price_id?: string | null | undefined;
394
429
  stripe_meter_id?: string | null | undefined;
430
+ attribution?: {
431
+ originality: "original" | "derivative" | "third-party";
432
+ external_url?: string | null | undefined;
433
+ github_url?: string | null | undefined;
434
+ paper_url?: string | null | undefined;
435
+ doi_url?: string | null | undefined;
436
+ citation?: {
437
+ doi?: string | null | undefined;
438
+ title?: string | null | undefined;
439
+ authors?: string[] | null | undefined;
440
+ year?: number | null | undefined;
441
+ venue?: string | null | undefined;
442
+ url?: string | null | undefined;
443
+ bibtex?: string | null | undefined;
444
+ source?: string | null | undefined;
445
+ } | null | undefined;
446
+ relation_type?: "IsSupplementTo" | "IsDerivedFrom" | "References" | "IsVariantFormOf" | "IsIdenticalTo" | null | undefined;
447
+ doi?: string | null | undefined;
448
+ } | null | undefined;
395
449
  preview?: Record<string, any>[] | null | undefined;
396
450
  name_url_slug?: string | null | undefined;
397
451
  }, {
@@ -412,11 +466,6 @@ declare const CreateServiceSchema: z.ZodPipe<z.ZodObject<{
412
466
  spec_path?: string | null | undefined;
413
467
  spec_url?: string | null | undefined;
414
468
  auth_url?: string | null | undefined;
415
- doi_url?: string | null | undefined;
416
- external_url?: string | null | undefined;
417
- paper_url?: string | null | undefined;
418
- github_url?: string | null | undefined;
419
- originality?: "original" | "derivative" | "third-party" | undefined;
420
469
  source?: string | null | undefined;
421
470
  reply_to_comment_id?: string | null | undefined;
422
471
  };
@@ -436,6 +485,25 @@ declare const CreateServiceSchema: z.ZodPipe<z.ZodObject<{
436
485
  stripe_product_id?: string | null | undefined;
437
486
  stripe_price_id?: string | null | undefined;
438
487
  stripe_meter_id?: string | null | undefined;
488
+ attribution?: {
489
+ originality: "original" | "derivative" | "third-party";
490
+ external_url?: string | null | undefined;
491
+ github_url?: string | null | undefined;
492
+ paper_url?: string | null | undefined;
493
+ doi_url?: string | null | undefined;
494
+ citation?: {
495
+ doi?: string | null | undefined;
496
+ title?: string | null | undefined;
497
+ authors?: string[] | null | undefined;
498
+ year?: number | null | undefined;
499
+ venue?: string | null | undefined;
500
+ url?: string | null | undefined;
501
+ bibtex?: string | null | undefined;
502
+ source?: string | null | undefined;
503
+ } | null | undefined;
504
+ relation_type?: "IsSupplementTo" | "IsDerivedFrom" | "References" | "IsVariantFormOf" | "IsIdenticalTo" | null | undefined;
505
+ doi?: string | null | undefined;
506
+ } | null | undefined;
439
507
  preview?: Record<string, any>[] | null | undefined;
440
508
  name_url_slug?: string | null | undefined;
441
509
  }>>;
@@ -467,15 +535,6 @@ declare const UpdateServiceSchema: z.ZodPipe<z.ZodObject<{
467
535
  spec_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
468
536
  spec_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
469
537
  auth_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
470
- doi_url: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
471
- external_url: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
472
- paper_url: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
473
- github_url: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
474
- originality: z.ZodOptional<z.ZodEnum<{
475
- original: "original";
476
- derivative: "derivative";
477
- "third-party": "third-party";
478
- }>>;
479
538
  source: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
480
539
  reply_to_comment_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
481
540
  }, z.core.$strip>>;
@@ -526,6 +585,35 @@ declare const UpdateServiceSchema: z.ZodPipe<z.ZodObject<{
526
585
  stripe_product_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
527
586
  stripe_price_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
528
587
  stripe_meter_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
588
+ attribution: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
589
+ originality: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
590
+ original: "original";
591
+ derivative: "derivative";
592
+ "third-party": "third-party";
593
+ }>>>;
594
+ external_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
595
+ github_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
596
+ paper_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
597
+ doi_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
598
+ citation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
599
+ doi: z.ZodOptional<z.ZodNullable<z.ZodString>>;
600
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
601
+ authors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
602
+ year: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
603
+ venue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
604
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
605
+ bibtex: z.ZodOptional<z.ZodNullable<z.ZodString>>;
606
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
607
+ }, z.core.$strip>>>;
608
+ relation_type: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
609
+ IsSupplementTo: "IsSupplementTo";
610
+ IsDerivedFrom: "IsDerivedFrom";
611
+ References: "References";
612
+ IsVariantFormOf: "IsVariantFormOf";
613
+ IsIdenticalTo: "IsIdenticalTo";
614
+ }>>>;
615
+ doi: z.ZodOptional<z.ZodNullable<z.ZodString>>;
616
+ }, z.core.$strip>>>>;
529
617
  preview: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>>>>>;
530
618
  last_updated: z.ZodDefault<z.ZodString>;
531
619
  }, z.core.$strip>, z.ZodTransform<{
@@ -540,11 +628,6 @@ declare const UpdateServiceSchema: z.ZodPipe<z.ZodObject<{
540
628
  spec_path?: string | null | undefined;
541
629
  spec_url?: string | null | undefined;
542
630
  auth_url?: string | null | undefined;
543
- doi_url?: string | null | undefined;
544
- external_url?: string | null | undefined;
545
- paper_url?: string | null | undefined;
546
- github_url?: string | null | undefined;
547
- originality?: "original" | "derivative" | "third-party" | undefined;
548
631
  source?: string | null | undefined;
549
632
  reply_to_comment_id?: string | null | undefined;
550
633
  } | undefined;
@@ -570,6 +653,25 @@ declare const UpdateServiceSchema: z.ZodPipe<z.ZodObject<{
570
653
  stripe_product_id?: string | null | undefined;
571
654
  stripe_price_id?: string | null | undefined;
572
655
  stripe_meter_id?: string | null | undefined;
656
+ attribution?: {
657
+ originality: "original" | "derivative" | "third-party";
658
+ external_url?: string | null | undefined;
659
+ github_url?: string | null | undefined;
660
+ paper_url?: string | null | undefined;
661
+ doi_url?: string | null | undefined;
662
+ citation?: {
663
+ doi?: string | null | undefined;
664
+ title?: string | null | undefined;
665
+ authors?: string[] | null | undefined;
666
+ year?: number | null | undefined;
667
+ venue?: string | null | undefined;
668
+ url?: string | null | undefined;
669
+ bibtex?: string | null | undefined;
670
+ source?: string | null | undefined;
671
+ } | null | undefined;
672
+ relation_type?: "IsSupplementTo" | "IsDerivedFrom" | "References" | "IsVariantFormOf" | "IsIdenticalTo" | null | undefined;
673
+ doi?: string | null | undefined;
674
+ } | null | undefined;
573
675
  preview?: Record<string, any>[] | null | undefined;
574
676
  }, {
575
677
  last_updated: string;
@@ -583,11 +685,6 @@ declare const UpdateServiceSchema: z.ZodPipe<z.ZodObject<{
583
685
  spec_path?: string | null | undefined;
584
686
  spec_url?: string | null | undefined;
585
687
  auth_url?: string | null | undefined;
586
- doi_url?: string | null | undefined;
587
- external_url?: string | null | undefined;
588
- paper_url?: string | null | undefined;
589
- github_url?: string | null | undefined;
590
- originality?: "original" | "derivative" | "third-party" | undefined;
591
688
  source?: string | null | undefined;
592
689
  reply_to_comment_id?: string | null | undefined;
593
690
  } | undefined;
@@ -613,6 +710,25 @@ declare const UpdateServiceSchema: z.ZodPipe<z.ZodObject<{
613
710
  stripe_product_id?: string | null | undefined;
614
711
  stripe_price_id?: string | null | undefined;
615
712
  stripe_meter_id?: string | null | undefined;
713
+ attribution?: {
714
+ originality: "original" | "derivative" | "third-party";
715
+ external_url?: string | null | undefined;
716
+ github_url?: string | null | undefined;
717
+ paper_url?: string | null | undefined;
718
+ doi_url?: string | null | undefined;
719
+ citation?: {
720
+ doi?: string | null | undefined;
721
+ title?: string | null | undefined;
722
+ authors?: string[] | null | undefined;
723
+ year?: number | null | undefined;
724
+ venue?: string | null | undefined;
725
+ url?: string | null | undefined;
726
+ bibtex?: string | null | undefined;
727
+ source?: string | null | undefined;
728
+ } | null | undefined;
729
+ relation_type?: "IsSupplementTo" | "IsDerivedFrom" | "References" | "IsVariantFormOf" | "IsIdenticalTo" | null | undefined;
730
+ doi?: string | null | undefined;
731
+ } | null | undefined;
616
732
  preview?: Record<string, any>[] | null | undefined;
617
733
  }>>;
618
734
  declare const ExecutionModeSchema: z.ZodEnum<{
@@ -967,17 +1083,37 @@ declare const RouteSchema: z.ZodObject<{
967
1083
  stripe_price_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
968
1084
  stripe_meter_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
969
1085
  metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
970
- doi_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
971
- external_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
972
- paper_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
973
- github_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
974
- originality: z.ZodEnum<{
1086
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1087
+ reply_to_comment_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1088
+ }, z.core.$strip>>>;
1089
+ attribution: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1090
+ originality: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
975
1091
  original: "original";
976
1092
  derivative: "derivative";
977
1093
  "third-party": "third-party";
978
- }>;
979
- source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
980
- reply_to_comment_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1094
+ }>>>;
1095
+ external_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1096
+ github_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1097
+ paper_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1098
+ doi_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1099
+ citation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1100
+ doi: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1101
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1102
+ authors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1103
+ year: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1104
+ venue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1105
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1106
+ bibtex: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1107
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1108
+ }, z.core.$strip>>>;
1109
+ relation_type: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
1110
+ IsSupplementTo: "IsSupplementTo";
1111
+ IsDerivedFrom: "IsDerivedFrom";
1112
+ References: "References";
1113
+ IsVariantFormOf: "IsVariantFormOf";
1114
+ IsIdenticalTo: "IsIdenticalTo";
1115
+ }>>>;
1116
+ doi: z.ZodOptional<z.ZodNullable<z.ZodString>>;
981
1117
  }, z.core.$strip>>>;
982
1118
  preview: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>>>>;
983
1119
  state: z.ZodEnum<{
@@ -1322,17 +1458,37 @@ declare const ActionSchema: z.ZodObject<{
1322
1458
  stripe_price_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1323
1459
  stripe_meter_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1324
1460
  metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1325
- doi_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1326
- external_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1327
- paper_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1328
- github_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1329
- originality: z.ZodEnum<{
1461
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1462
+ reply_to_comment_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1463
+ }, z.core.$strip>>>;
1464
+ attribution: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1465
+ originality: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
1330
1466
  original: "original";
1331
1467
  derivative: "derivative";
1332
1468
  "third-party": "third-party";
1333
- }>;
1334
- source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1335
- reply_to_comment_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1469
+ }>>>;
1470
+ external_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1471
+ github_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1472
+ paper_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1473
+ doi_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1474
+ citation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1475
+ doi: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1476
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1477
+ authors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1478
+ year: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1479
+ venue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1480
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1481
+ bibtex: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1482
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1483
+ }, z.core.$strip>>>;
1484
+ relation_type: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
1485
+ IsSupplementTo: "IsSupplementTo";
1486
+ IsDerivedFrom: "IsDerivedFrom";
1487
+ References: "References";
1488
+ IsVariantFormOf: "IsVariantFormOf";
1489
+ IsIdenticalTo: "IsIdenticalTo";
1490
+ }>>>;
1491
+ doi: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1336
1492
  }, z.core.$strip>>>;
1337
1493
  preview: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>>>>;
1338
1494
  state: z.ZodEnum<{
@@ -1572,17 +1728,37 @@ declare const ActionSchema: z.ZodObject<{
1572
1728
  stripe_price_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1573
1729
  stripe_meter_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1574
1730
  metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1575
- doi_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1576
- external_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1577
- paper_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1578
- github_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1579
- originality: z.ZodEnum<{
1731
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1732
+ reply_to_comment_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1733
+ }, z.core.$strip>>>;
1734
+ attribution: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1735
+ originality: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
1580
1736
  original: "original";
1581
1737
  derivative: "derivative";
1582
1738
  "third-party": "third-party";
1583
- }>;
1584
- source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1585
- reply_to_comment_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1739
+ }>>>;
1740
+ external_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1741
+ github_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1742
+ paper_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1743
+ doi_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1744
+ citation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1745
+ doi: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1746
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1747
+ authors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1748
+ year: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1749
+ venue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1750
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1751
+ bibtex: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1752
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1753
+ }, z.core.$strip>>>;
1754
+ relation_type: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
1755
+ IsSupplementTo: "IsSupplementTo";
1756
+ IsDerivedFrom: "IsDerivedFrom";
1757
+ References: "References";
1758
+ IsVariantFormOf: "IsVariantFormOf";
1759
+ IsIdenticalTo: "IsIdenticalTo";
1760
+ }>>>;
1761
+ doi: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1586
1762
  }, z.core.$strip>>>;
1587
1763
  preview: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>>>>;
1588
1764
  state: z.ZodEnum<{
@@ -1,2 +1,2 @@
1
- export{k as ActionSchema,b as CreateServiceSchema,d as ExecutionModeSchema,e as RouteInputAssetDeclarationSchema,g as RouteInputAssetsSchema,i as RouteMetricsSchema,f as RouteOutputAssetDeclarationSchema,h as RouteOutputAssetsSchema,j as RouteSchema,a as ServiceSchema,c as UpdateServiceSchema}from'../chunk-MLTO7TMM.js';import'../chunk-SR5UZ4NP.js';import'../chunk-CF56NFUG.js';import'../chunk-WLGOABHV.js';import'../chunk-3N56ERWF.js';import'../chunk-WRHPQNEL.js';import'../chunk-DUBPWSCA.js';//# sourceMappingURL=services.js.map
1
+ export{k as ActionSchema,b as CreateServiceSchema,d as ExecutionModeSchema,e as RouteInputAssetDeclarationSchema,g as RouteInputAssetsSchema,i as RouteMetricsSchema,f as RouteOutputAssetDeclarationSchema,h as RouteOutputAssetsSchema,j as RouteSchema,a as ServiceSchema,c as UpdateServiceSchema}from'../chunk-ZC2VDKSH.js';import'../chunk-OU4JKY4M.js';import'../chunk-TGOXRPF5.js';import'../chunk-CF56NFUG.js';import'../chunk-WLGOABHV.js';import'../chunk-3N56ERWF.js';import'../chunk-WRHPQNEL.js';import'../chunk-DUBPWSCA.js';//# sourceMappingURL=services.js.map
2
2
  //# sourceMappingURL=services.js.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkTUZS3DKI_cjs=require('../../chunk-TUZS3DKI.cjs');Object.defineProperty(exports,"getReferencesInContent",{enumerable:true,get:function(){return chunkTUZS3DKI_cjs.e}});Object.defineProperty(exports,"normalizeViewMode",{enumerable:true,get:function(){return chunkTUZS3DKI_cjs.a}});Object.defineProperty(exports,"parseAssetLinkShorthand",{enumerable:true,get:function(){return chunkTUZS3DKI_cjs.c}});Object.defineProperty(exports,"parseOuroAssetUrl",{enumerable:true,get:function(){return chunkTUZS3DKI_cjs.d}});Object.defineProperty(exports,"resolveDisplayConfig",{enumerable:true,get:function(){return chunkTUZS3DKI_cjs.b}});//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var chunkAWBCE7ME_cjs=require('../../chunk-AWBCE7ME.cjs');Object.defineProperty(exports,"getReferencesInContent",{enumerable:true,get:function(){return chunkAWBCE7ME_cjs.e}});Object.defineProperty(exports,"normalizeViewMode",{enumerable:true,get:function(){return chunkAWBCE7ME_cjs.a}});Object.defineProperty(exports,"parseAssetLinkShorthand",{enumerable:true,get:function(){return chunkAWBCE7ME_cjs.c}});Object.defineProperty(exports,"parseOuroAssetUrl",{enumerable:true,get:function(){return chunkAWBCE7ME_cjs.d}});Object.defineProperty(exports,"resolveDisplayConfig",{enumerable:true,get:function(){return chunkAWBCE7ME_cjs.b}});//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- export{e as getReferencesInContent,a as normalizeViewMode,c as parseAssetLinkShorthand,d as parseOuroAssetUrl,b as resolveDisplayConfig}from'../../chunk-LQOKGPEK.js';//# sourceMappingURL=index.js.map
1
+ export{e as getReferencesInContent,a as normalizeViewMode,c as parseAssetLinkShorthand,d as parseOuroAssetUrl,b as resolveDisplayConfig}from'../../chunk-T3HVRQBB.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkKHERHT26_cjs=require('../chunk-KHERHT26.cjs');Object.defineProperty(exports,"FILE_FILTERS",{enumerable:true,get:function(){return chunkKHERHT26_cjs.a}});Object.defineProperty(exports,"fileTypes",{enumerable:true,get:function(){return chunkKHERHT26_cjs.b}});Object.defineProperty(exports,"getExtensionFromFileName",{enumerable:true,get:function(){return chunkKHERHT26_cjs.e}});Object.defineProperty(exports,"getExtensionFromMimeType",{enumerable:true,get:function(){return chunkKHERHT26_cjs.f}});Object.defineProperty(exports,"getFileClassification",{enumerable:true,get:function(){return chunkKHERHT26_cjs.h}});Object.defineProperty(exports,"getFileFilterLabel",{enumerable:true,get:function(){return chunkKHERHT26_cjs.c}});Object.defineProperty(exports,"getSafeFileExtension",{enumerable:true,get:function(){return chunkKHERHT26_cjs.g}});Object.defineProperty(exports,"normalizeExtension",{enumerable:true,get:function(){return chunkKHERHT26_cjs.d}});//# sourceMappingURL=files.cjs.map
2
+ //# sourceMappingURL=files.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"files.cjs"}
@@ -0,0 +1,18 @@
1
+ /** Canonical file-input filter values (route `input_filter`, discovery, etc.). */
2
+ declare const FILE_FILTERS: readonly ["audio", "video", "image", "pdf", "3d model", "atomic structure"];
3
+ type FileFilter = (typeof FILE_FILTERS)[number];
4
+ /** MIME types grouped by file filter. */
5
+ declare const fileTypes: Record<FileFilter, readonly string[]>;
6
+ declare function getFileFilterLabel(fileType: string | null | undefined): string | null;
7
+ declare function normalizeExtension(value: string | null | undefined): string | null;
8
+ declare function getExtensionFromFileName(fileName: string | null | undefined): string | null;
9
+ declare function getExtensionFromMimeType(mimeType: string | null | undefined): string | null;
10
+ declare function getSafeFileExtension({ fileName, mimeType, fallback, }: {
11
+ fileName?: string | null;
12
+ mimeType?: string | null;
13
+ fallback?: string | null;
14
+ }): string;
15
+ /** Display classification for a MIME type (asset badges, etc.). */
16
+ declare function getFileClassification(type: string, extension: string): string;
17
+
18
+ export { FILE_FILTERS, type FileFilter, fileTypes, getExtensionFromFileName, getExtensionFromMimeType, getFileClassification, getFileFilterLabel, getSafeFileExtension, normalizeExtension };
@@ -0,0 +1,18 @@
1
+ /** Canonical file-input filter values (route `input_filter`, discovery, etc.). */
2
+ declare const FILE_FILTERS: readonly ["audio", "video", "image", "pdf", "3d model", "atomic structure"];
3
+ type FileFilter = (typeof FILE_FILTERS)[number];
4
+ /** MIME types grouped by file filter. */
5
+ declare const fileTypes: Record<FileFilter, readonly string[]>;
6
+ declare function getFileFilterLabel(fileType: string | null | undefined): string | null;
7
+ declare function normalizeExtension(value: string | null | undefined): string | null;
8
+ declare function getExtensionFromFileName(fileName: string | null | undefined): string | null;
9
+ declare function getExtensionFromMimeType(mimeType: string | null | undefined): string | null;
10
+ declare function getSafeFileExtension({ fileName, mimeType, fallback, }: {
11
+ fileName?: string | null;
12
+ mimeType?: string | null;
13
+ fallback?: string | null;
14
+ }): string;
15
+ /** Display classification for a MIME type (asset badges, etc.). */
16
+ declare function getFileClassification(type: string, extension: string): string;
17
+
18
+ export { FILE_FILTERS, type FileFilter, fileTypes, getExtensionFromFileName, getExtensionFromMimeType, getFileClassification, getFileFilterLabel, getSafeFileExtension, normalizeExtension };
@@ -0,0 +1,2 @@
1
+ export{a as FILE_FILTERS,b as fileTypes,e as getExtensionFromFileName,f as getExtensionFromMimeType,h as getFileClassification,c as getFileFilterLabel,g as getSafeFileExtension,d as normalizeExtension}from'../chunk-OU4JKY4M.js';//# sourceMappingURL=files.js.map
2
+ //# sourceMappingURL=files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"files.js"}
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk6ZJQTECB_cjs=require('../chunk-6ZJQTECB.cjs');require('../chunk-V73EW77Y.cjs'),require('../chunk-ROMY5WNQ.cjs'),require('../chunk-UY43EQTO.cjs'),require('../chunk-VOY623ZD.cjs'),require('../chunk-GY6SLMMJ.cjs'),require('../chunk-43KB23BA.cjs'),require('../chunk-7HF5VHUN.cjs');Object.defineProperty(exports,"KeyedAssetInputSchema",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.c}});Object.defineProperty(exports,"KeyedAssetInputValueSchema",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.b}});Object.defineProperty(exports,"KeyedAssetRefsSchema",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.a}});Object.defineProperty(exports,"QuestSubmissionAssetDeclarationSchema",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.d}});Object.defineProperty(exports,"assetMatchesDeclaration",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.k}});Object.defineProperty(exports,"declarationToPickerFilters",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.j}});Object.defineProperty(exports,"declarationToSubmissionDeclaration",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.f}});Object.defineProperty(exports,"getPrimaryAssetRef",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.l}});Object.defineProperty(exports,"getPrimaryDeclarationKey",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.h}});Object.defineProperty(exports,"getRouteInputDeclarationsFromRoute",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.e}});Object.defineProperty(exports,"getSubmissionAssetShape",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.i}});Object.defineProperty(exports,"materializeContributorSubmissionAssets",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.g}});Object.defineProperty(exports,"toRouteInputAssets",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.m}});//# sourceMappingURL=quest-submission.cjs.map
1
+ 'use strict';var chunkQNERXSMJ_cjs=require('../chunk-QNERXSMJ.cjs');require('../chunk-QSOXS57A.cjs'),require('../chunk-KHERHT26.cjs'),require('../chunk-5EQ5LO7V.cjs'),require('../chunk-UY43EQTO.cjs'),require('../chunk-VOY623ZD.cjs'),require('../chunk-GY6SLMMJ.cjs'),require('../chunk-43KB23BA.cjs'),require('../chunk-7HF5VHUN.cjs');Object.defineProperty(exports,"KeyedAssetInputSchema",{enumerable:true,get:function(){return chunkQNERXSMJ_cjs.c}});Object.defineProperty(exports,"KeyedAssetInputValueSchema",{enumerable:true,get:function(){return chunkQNERXSMJ_cjs.b}});Object.defineProperty(exports,"KeyedAssetRefsSchema",{enumerable:true,get:function(){return chunkQNERXSMJ_cjs.a}});Object.defineProperty(exports,"QuestSubmissionAssetDeclarationSchema",{enumerable:true,get:function(){return chunkQNERXSMJ_cjs.d}});Object.defineProperty(exports,"assetMatchesDeclaration",{enumerable:true,get:function(){return chunkQNERXSMJ_cjs.k}});Object.defineProperty(exports,"declarationToPickerFilters",{enumerable:true,get:function(){return chunkQNERXSMJ_cjs.j}});Object.defineProperty(exports,"declarationToSubmissionDeclaration",{enumerable:true,get:function(){return chunkQNERXSMJ_cjs.f}});Object.defineProperty(exports,"getPrimaryAssetRef",{enumerable:true,get:function(){return chunkQNERXSMJ_cjs.l}});Object.defineProperty(exports,"getPrimaryDeclarationKey",{enumerable:true,get:function(){return chunkQNERXSMJ_cjs.h}});Object.defineProperty(exports,"getRouteInputDeclarationsFromRoute",{enumerable:true,get:function(){return chunkQNERXSMJ_cjs.e}});Object.defineProperty(exports,"getSubmissionAssetShape",{enumerable:true,get:function(){return chunkQNERXSMJ_cjs.i}});Object.defineProperty(exports,"materializeContributorSubmissionAssets",{enumerable:true,get:function(){return chunkQNERXSMJ_cjs.g}});Object.defineProperty(exports,"toRouteInputAssets",{enumerable:true,get:function(){return chunkQNERXSMJ_cjs.m}});//# sourceMappingURL=quest-submission.cjs.map
2
2
  //# sourceMappingURL=quest-submission.cjs.map
@@ -1,2 +1,2 @@
1
- export{c as KeyedAssetInputSchema,b as KeyedAssetInputValueSchema,a as KeyedAssetRefsSchema,d as QuestSubmissionAssetDeclarationSchema,k as assetMatchesDeclaration,j as declarationToPickerFilters,f as declarationToSubmissionDeclaration,l as getPrimaryAssetRef,h as getPrimaryDeclarationKey,e as getRouteInputDeclarationsFromRoute,i as getSubmissionAssetShape,g as materializeContributorSubmissionAssets,m as toRouteInputAssets}from'../chunk-TYOQ32UV.js';import'../chunk-MLTO7TMM.js';import'../chunk-SR5UZ4NP.js';import'../chunk-CF56NFUG.js';import'../chunk-WLGOABHV.js';import'../chunk-3N56ERWF.js';import'../chunk-WRHPQNEL.js';import'../chunk-DUBPWSCA.js';//# sourceMappingURL=quest-submission.js.map
1
+ export{c as KeyedAssetInputSchema,b as KeyedAssetInputValueSchema,a as KeyedAssetRefsSchema,d as QuestSubmissionAssetDeclarationSchema,k as assetMatchesDeclaration,j as declarationToPickerFilters,f as declarationToSubmissionDeclaration,l as getPrimaryAssetRef,h as getPrimaryDeclarationKey,e as getRouteInputDeclarationsFromRoute,i as getSubmissionAssetShape,g as materializeContributorSubmissionAssets,m as toRouteInputAssets}from'../chunk-TMNFNVTZ.js';import'../chunk-ZC2VDKSH.js';import'../chunk-OU4JKY4M.js';import'../chunk-TGOXRPF5.js';import'../chunk-CF56NFUG.js';import'../chunk-WLGOABHV.js';import'../chunk-3N56ERWF.js';import'../chunk-WRHPQNEL.js';import'../chunk-DUBPWSCA.js';//# sourceMappingURL=quest-submission.js.map
2
2
  //# sourceMappingURL=quest-submission.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ourofoundation/ouro-js",
3
- "version": "3.5.8",
3
+ "version": "3.7.0",
4
4
  "description": "Interact with the Ouro platform in browser and node.js environments",
5
5
  "module": "./dist/index.js",
6
6
  "main": "./dist/index.cjs",
@@ -78,4 +78,4 @@
78
78
  "engines": {
79
79
  "node": ">=14.0.0"
80
80
  }
81
- }
81
+ }
@@ -1,2 +0,0 @@
1
- import {a as a$2}from'./chunk-IWOXGKK4.js';import {b,c,d,a as a$1}from'./chunk-SR5UZ4NP.js';import {b as b$1}from'./chunk-3N56ERWF.js';import {a,b as b$2,d as d$1}from'./chunk-WRHPQNEL.js';import {object,array,string,optional,nullable,literal,uuid,number,record,any}from'zod';var z=object({members:array(string())}),v=z.extend(b.partial().shape),U=c.extend({asset_type:a.default("conversation"),name:nullable(string()),metadata:v,users:optional(nullable(array(b$1)))}),S=d.extend({asset_type:literal("conversation").default("conversation"),monetization:d$1.default("none"),visibility:b$2.default("private"),name:string().optional().nullable().default("").transform(e=>e==null?void 0:e.trim()).transform(e=>e||null),metadata:v}),j=S.transform(e=>a$1(e)),B=S.omit({id:true,org_id:true,team_id:true}).partial().transform(e=>a$1(e)),P=object({id:uuid(),conversation_id:uuid(),turn_id:uuid(),seq:number(),user_id:uuid(),user:optional(nullable(b$1)),type:string().default("message"),created_at:string(),last_updated:string(),viewers:array(uuid()),json:a$2,text:string(),metadata:optional(nullable(record(string(),any())))});export{U as a,j as b,B as c,P as d};//# sourceMappingURL=chunk-4UE3XIYR.js.map
2
- //# sourceMappingURL=chunk-4UE3XIYR.js.map
@@ -1,2 +0,0 @@
1
- import {b,c as c$1,d,a as a$1}from'./chunk-SR5UZ4NP.js';import {a}from'./chunk-WRHPQNEL.js';import {lazy,object,optional,string,array,record,any,literal,nullable,number}from'zod';var h=lazy(()=>object({type:string(),content:optional(array(h)),attrs:optional(record(string(),any())),marks:optional(array(object({type:string(),attrs:optional(record(string(),any()))}))),text:optional(string())})),c=object({type:literal("doc"),content:array(h)}),P=object({json:c,text:string()}).default({json:{type:"doc",content:[]},text:""}),z=object({}),T=z.extend(b.partial().shape),m=c$1.extend({name:nullable(string()),asset_type:a.refine(t=>["post","comment"].includes(t)),metadata:T,preview:c.default({type:"doc",content:[]}),content:P}),A=d.extend({asset_type:literal("post").default("post"),name:string().optional().nullable().default("").transform(t=>t==null?void 0:t.trim()).transform(t=>t||null),preview:c}).transform(t=>a$1(t)),C=m.extend({content:optional(nullable(P.default({json:{type:"doc",content:[]},text:""}))),reactions:array(record(string(),any())).default([]),views:number().default(0),commentCount:number().default(0)}),j=array(C),w=array(m),v=m.partial().omit({user_id:true,id:true,created_at:true,last_updated:true,content:true,organization:true,user:true,team:true,slug:true,is_pinned_in_team:true}).extend({last_updated:string().default(()=>new Date().toISOString())}).transform(t=>a$1(t));export{c as a,P as b,m as c,A as d,C as e,j as f,w as g,v as h};//# sourceMappingURL=chunk-IWOXGKK4.js.map
2
- //# sourceMappingURL=chunk-IWOXGKK4.js.map
@@ -1,2 +0,0 @@
1
- import {b,c,d,a}from'./chunk-SR5UZ4NP.js';import {object,optional,number,string,enum as _enum,uuid,literal,discriminatedUnion}from'zod';var f=object({id:uuid(),path:string(),bucket:_enum(["public-files","files"]),name:string(),type:string(),extension:string(),size:number(),width:optional(number()),height:optional(number())}),h=object({type:string()}),p=f.extend(b.partial().shape),S=h.extend(b.partial().shape),F=c.extend({asset_type:literal("file").default("file"),metadata:p}),g=discriminatedUnion("state",[d.extend({asset_type:literal("file").default("file"),state:literal("success").default("success"),metadata:p}),d.extend({asset_type:literal("file").default("file"),state:literal("in-progress").default("in-progress"),metadata:S})]).transform(a$1=>a(a$1)),z=F.partial().omit({user_id:true,id:true,created_at:true,last_updated:true,organization:true,user:true,team:true,slug:true,is_pinned_in_team:true}).extend({last_updated:string().default(()=>new Date().toISOString())}).transform(a$1=>a(a$1));export{F as a,g as b,z as c};//# sourceMappingURL=chunk-KCVE35IO.js.map
2
- //# sourceMappingURL=chunk-KCVE35IO.js.map
@@ -1,2 +0,0 @@
1
- function T(e){return e==="default"?"card":e==="chart"?"preview":e==="preview"||e==="interactive"||e==="card"||e==="list"?e:"card"}function E(e){let s={};if(e.displayConfig&&(s=typeof e.displayConfig=="string"?JSON.parse(e.displayConfig):{...e.displayConfig}),s.visualizationId===void 0&&e.visualizationId&&(s.visualizationId=e.visualizationId),s.filters===void 0&&e.filters){let r=e.filters;s.filters=typeof r=="string"?JSON.parse(r):r;}return s}var v="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",C=new RegExp(`^(post|dataset|file|service|route):(${v})$`,"i"),h=new RegExp(`^asset:(${v})$`,"i"),A=new Set(["post","dataset","file","service","route"]);function I(e){let s=C.exec(e);if(s){let l=s[1].toLowerCase();return A.has(l)?{id:s[2],assetType:l,legacy:false}:null}let r=h.exec(e);return r?{id:r[1],legacy:true}:null}function x(e,s){let r;try{if(e.startsWith("/"))r=e;else {let c=new URL(e);if(s){let g=new URL(s).host;if(c.host!==g)return null}r=c.pathname;}}catch{return null}let l=r.match(/^\/(\w+)s\/([^/]+)\/([^/?#]+)/);if(!l)return null;let[,o,d,p]=l;return A.has(o)?{assetType:o,entity:decodeURIComponent(d),slug:decodeURIComponent(p)}:null}var y=e=>Array.isArray(e)?e.map(y):e!=null&&e.content?Array.isArray(e.content)?e.content.map(y).flat():y(e.content):e;function k(e,s){var g;if(!e||!(e!=null&&e.content))return {users:[],assets:[],linkedAssets:[]};let r=e.content.map(y).flat(),l=r.filter(t=>t.type==="mention").map(t=>{var n,i,f;return {user_id:(n=t.attrs)==null?void 0:n.id,username:((i=t.attrs)==null?void 0:i.label)||((f=t.attrs)==null?void 0:f.username)}}).reduce((t,n)=>(t.some(i=>i.user_id&&n.user_id&&i.user_id===n.user_id||i.username&&n.username&&i.username===n.username)||t.push(n),t),[]),o=r.filter(t=>{var n,i;return t.type==="assetComponent"&&((n=t.attrs)==null?void 0:n.id)&&!((i=t.attrs)!=null&&i.partial)}).map(({attrs:t})=>({id:t.id,assetType:t.assetType,via:"embed"})).reduce((t,n)=>(t.some(i=>i.id===n.id)||t.push(n),t),[]),d=[],p=new Set(o.map(t=>t.id)),c=new Set;for(let t of r){if((t==null?void 0:t.type)!=="text"||!(t!=null&&t.marks))continue;let n=t.marks.find(a=>a.type==="link");if(!((g=n==null?void 0:n.attrs)!=null&&g.href))continue;let i=n.attrs.href,f=I(i);if(f){let a=f.id;p.has(a)||(p.add(a),f.legacy?o.push({id:a,via:"link",legacy:true}):o.push({id:a,assetType:f.assetType,via:"link",legacy:false}));continue}let u=x(i,s==null?void 0:s.siteUrl);if(u){let a=`${u.assetType}:${u.entity}:${u.slug}`;c.has(a)||(c.add(a),d.push(u));}}return {users:l,assets:o,linkedAssets:d}}export{T as a,E as b,I as c,x as d,k as e};//# sourceMappingURL=chunk-LQOKGPEK.js.map
2
- //# sourceMappingURL=chunk-LQOKGPEK.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/utils/air/index.ts"],"names":["normalizeViewMode","raw","resolveDisplayConfig","attrs","base","UUID_RE","TYPED_ASSET_LINK_RE","LEGACY_ASSET_LINK_RE","VALID_ASSET_TYPES","parseAssetLinkShorthand","href","typed","assetType","legacy","parseOuroAssetUrl","siteUrl","pathname","url","siteHost","match","entity","slug","extractContent","item","getReferencesInContent","json","options","_a","content","users","_b","_c","unique","u","assets","linkedAssets","seenAssetIds","a","seenLinkedKeys","linkMark","m","shorthand","id","parsed","key"],"mappings":"AAyBO,SAASA,CACdC,CAAAA,CAAAA,CAC6C,CAC7C,OAAIA,IAAQ,SAAkB,CAAA,MAAA,CAC1BA,CAAQ,GAAA,OAAA,CAAgB,UAE1BA,CAAQ,GAAA,SAAA,EACRA,CAAQ,GAAA,aAAA,EACRA,IAAQ,MACRA,EAAAA,CAAAA,GAAQ,MAEDA,CAAAA,CAAAA,CACF,MACT,CAOO,SAASC,CAAAA,CAAqBC,EAInB,CAChB,IAAIC,CAAsB,CAAA,GAa1B,GAXID,CAAAA,CAAM,aACRC,GAAAA,CAAAA,CACE,OAAOD,CAAM,CAAA,aAAA,EAAkB,QAC3B,CAAA,IAAA,CAAK,KAAMA,CAAAA,CAAAA,CAAM,aAAa,CAAA,CAC9B,CAAE,GAAGA,CAAAA,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AAMjB,CAAAA,CAAe6B,EAAS,KAAM,CAAA,IAAA,CAE9BE,CAAYhC,CAAAA,CAAAA,CAAwBC,CAAI,CAAA,CAC9C,GAAI+B,CAAAA,CAAW,CACb,IAAMC,CAAAA,CAAKD,CAAU,CAAA,EAAA,CAChBL,EAAa,GAAIM,CAAAA,CAAE,CACtBN,GAAAA,CAAAA,CAAa,IAAIM,CAAE,CAAA,CACfD,CAAU,CAAA,MAAA,CACZP,CAAO,CAAA,IAAA,CAAK,CAAE,EAAA,CAAAQ,EAAI,GAAK,CAAA,MAAA,CAAQ,MAAQ,CAAA,IAAK,CAAC,CAE7CR,CAAAA,CAAAA,CAAO,IAAK,CAAA,CACV,GAAAQ,CACA,CAAA,SAAA,CAAWD,CAAU,CAAA,SAAA,CACrB,GAAK,CAAA,MAAA,CACL,MAAQ,CAAA,KACV,CAAC,CAGL,CAAA,CAAA,QACF,CAGA,IAAME,EAAS7B,CAAkBJ,CAAAA,CAAAA,CAAMgB,CAAA,EAAA,IAAA,CAAA,MAAA,CAAAA,EAAS,OAAO,CAAA,CACvD,GAAIiB,CAAAA,CAAQ,CACV,IAAMC,CAAM,CAAA,CAAA,EAAGD,EAAO,SAAS,CAAA,CAAA,EAAIA,CAAO,CAAA,MAAM,IAAIA,CAAO,CAAA,IAAI,CAC1DL,CAAAA,CAAAA,CAAAA,CAAe,IAAIM,CAAG,CAAA,GACzBN,CAAe,CAAA,GAAA,CAAIM,CAAG,CACtBT,CAAAA,CAAAA,CAAa,IAAKQ,CAAAA,CAAM,GAE5B,CACF,CAEA,OAAO,CACL,MAAAd,CACA,CAAA,MAAA,CAAAK,CACA,CAAA,YAAA,CAAAC,CACF,CACF","file":"chunk-LQOKGPEK.js","sourcesContent":["import { Content } from \"../../schema/posts\";\nimport { Profile } from \"../../schema/users\";\n\nexport interface DataFilter {\n column: string;\n value: string;\n operator: string;\n active?: boolean;\n}\n\nexport interface DisplayConfig {\n /** Dataset: ID of a saved visualization to render instead of the default chart. */\n visualizationId?: string | null;\n /** Dataset: column filters applied to the data. */\n filters?: DataFilter[];\n /** Route: ID of a specific action to preview (status, logs, side-effect assets). */\n actionId?: string | null;\n /** Route: author-provided defaults for an interactive route form. */\n defaultValues?: Record<string, unknown>;\n}\n\n/**\n * Normalize legacy viewMode values to the current set.\n * \"chart\" → \"preview\", \"default\" → \"card\", anything else → \"card\".\n */\nexport function normalizeViewMode(\n raw: string | undefined | null\n): \"card\" | \"preview\" | \"interactive\" | \"list\" {\n if (raw === \"default\") return \"card\";\n if (raw === \"chart\") return \"preview\";\n if (\n raw === \"preview\" ||\n raw === \"interactive\" ||\n raw === \"card\" ||\n raw === \"list\"\n )\n return raw;\n return \"card\";\n}\n\n/**\n * Build a DisplayConfig from node/element attributes, handling the legacy\n * flat `visualizationId` / `filters` attrs and the new `displayConfig` object.\n * Prefers values inside `displayConfig` when present.\n */\nexport function resolveDisplayConfig(attrs: {\n displayConfig?: DisplayConfig | string | null;\n visualizationId?: string | null;\n filters?: DataFilter[] | string | null;\n}): DisplayConfig {\n let base: DisplayConfig = {};\n\n if (attrs.displayConfig) {\n base =\n typeof attrs.displayConfig === \"string\"\n ? JSON.parse(attrs.displayConfig)\n : { ...attrs.displayConfig };\n }\n\n // Fall back to legacy flat attrs when displayConfig doesn't carry them\n if (base.visualizationId === undefined && attrs.visualizationId) {\n base.visualizationId = attrs.visualizationId;\n }\n if (base.filters === undefined && attrs.filters) {\n const raw = attrs.filters;\n base.filters =\n typeof raw === \"string\" ? JSON.parse(raw) : raw;\n }\n\n return base;\n}\n\nexport interface InlineAssetAttrs {\n id: string;\n assetType: string;\n viewMode: \"card\" | \"preview\" | \"interactive\" | \"list\";\n displayConfig?: DisplayConfig | null;\n /** @deprecated Use displayConfig.filters */\n filters?: any;\n /** @deprecated Use displayConfig.visualizationId */\n visualizationId?: string | null;\n partial?: boolean;\n}\n\n/** Assets pulled from Air JSON: embedded blocks or link href shorthands. */\nexport type ExtractedContentAsset =\n | { id: string; assetType: string; via: \"embed\" }\n | { id: string; assetType: string; via: \"link\"; legacy: false }\n | { id: string; via: \"link\"; legacy: true };\n\ninterface LinkedAssetRef {\n assetType: string;\n entity: string;\n slug: string;\n}\n\n/** UUID v4 pattern for inline link hrefs */\nconst UUID_RE =\n \"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\";\n\n/** Shorthand link hrefs: `post:<uuid>`, `file:<uuid>`, … (preferred over legacy `asset:<uuid>`). */\nconst TYPED_ASSET_LINK_RE = new RegExp(\n `^(post|dataset|file|service|route):(${UUID_RE})$`,\n \"i\"\n);\n\n/** @deprecated Prefer `post:<uuid>` etc.; still supported and resolved server-side. */\nconst LEGACY_ASSET_LINK_RE = new RegExp(`^asset:(${UUID_RE})$`, \"i\");\n\nconst VALID_ASSET_TYPES = new Set([\n \"post\",\n \"dataset\",\n \"file\",\n \"service\",\n \"route\",\n]);\n\n/**\n * Parse an inline link `href` for Ouro asset shorthands.\n * - `post:<uuid>`, `file:<uuid>`, … → typed (asset type known from prefix)\n * - `asset:<uuid>` → legacy (type resolved via DB when creating connections)\n */\nfunction parseAssetLinkShorthand(\n href: string\n):\n | { id: string; assetType: string; legacy: false }\n | { id: string; legacy: true }\n | null {\n const typed = TYPED_ASSET_LINK_RE.exec(href);\n if (typed) {\n const assetType = typed[1].toLowerCase();\n if (!VALID_ASSET_TYPES.has(assetType)) return null;\n return { id: typed[2], assetType, legacy: false };\n }\n const legacy = LEGACY_ASSET_LINK_RE.exec(href);\n if (legacy) return { id: legacy[1], legacy: true };\n return null;\n}\n\n/**\n * Parse an Ouro site URL into its asset components.\n * Accepts both absolute URLs (https://ouro.foundation/posts/entity/slug)\n * and relative paths (/posts/entity/slug).\n */\nfunction parseOuroAssetUrl(\n href: string,\n siteUrl?: string\n): LinkedAssetRef | null {\n let pathname: string;\n try {\n if (href.startsWith(\"/\")) {\n pathname = href;\n } else {\n const url = new URL(href);\n if (siteUrl) {\n const siteHost = new URL(siteUrl).host;\n if (url.host !== siteHost) return null;\n }\n pathname = url.pathname;\n }\n } catch {\n return null;\n }\n\n // Pattern: /{assetType}s/{entity}/{slug}\n const match = pathname.match(\n /^\\/(\\w+)s\\/([^/]+)\\/([^/?#]+)/\n );\n if (!match) return null;\n\n const [, assetType, entity, slug] = match;\n if (!VALID_ASSET_TYPES.has(assetType)) return null;\n\n return { assetType, entity: decodeURIComponent(entity), slug: decodeURIComponent(slug) };\n}\n\nconst extractContent = (item: any): any => {\n if (Array.isArray(item)) return item.map(extractContent);\n if (item?.content) {\n if (Array.isArray(item.content))\n return item.content.map(extractContent).flat();\n else return extractContent(item.content);\n } else return item; // leaf\n};\n\nfunction getReferencesInContent(\n json: Content[\"json\"],\n options?: { siteUrl?: string }\n) {\n if (!json || !json?.content)\n return { users: [], assets: [], linkedAssets: [] };\n const content = json.content.map(extractContent).flat();\n\n const users = content\n .filter((item: any) => item.type === \"mention\")\n .map((item: any) => ({\n user_id: item.attrs?.id,\n username: item.attrs?.label || item.attrs?.username,\n }))\n .reduce((unique: any[], item: any) => {\n if (\n !unique.some(\n (u) =>\n (u.user_id && item.user_id && u.user_id === item.user_id) ||\n (u.username && item.username && u.username === item.username)\n )\n ) {\n unique.push(item);\n }\n return unique;\n }, []) as Partial<Profile>[];\n\n const assets: ExtractedContentAsset[] = content\n .filter(\n (item: any) =>\n item.type === \"assetComponent\" && item.attrs?.id && !item.attrs?.partial\n )\n .map(({ attrs }: { attrs: InlineAssetAttrs }) => ({\n id: attrs.id,\n assetType: attrs.assetType,\n via: \"embed\" as const,\n }))\n .reduce((unique: ExtractedContentAsset[], item: ExtractedContentAsset) => {\n if (!unique.some((u) => u.id === item.id)) {\n unique.push(item);\n }\n return unique;\n }, []);\n\n // Extract asset references from link marks\n const linkedAssets: LinkedAssetRef[] = [];\n const seenAssetIds = new Set(assets.map((a) => a.id));\n const seenLinkedKeys = new Set<string>();\n\n for (const item of content) {\n if (item?.type !== \"text\" || !item?.marks) continue;\n const linkMark = item.marks.find((m: any) => m.type === \"link\");\n if (!linkMark?.attrs?.href) continue;\n\n const href: string = linkMark.attrs.href;\n\n const shorthand = parseAssetLinkShorthand(href);\n if (shorthand) {\n const id = shorthand.id;\n if (!seenAssetIds.has(id)) {\n seenAssetIds.add(id);\n if (shorthand.legacy) {\n assets.push({ id, via: \"link\", legacy: true });\n } else {\n assets.push({\n id,\n assetType: shorthand.assetType,\n via: \"link\",\n legacy: false,\n });\n }\n }\n continue;\n }\n\n // Check for Ouro site URLs\n const parsed = parseOuroAssetUrl(href, options?.siteUrl);\n if (parsed) {\n const key = `${parsed.assetType}:${parsed.entity}:${parsed.slug}`;\n if (!seenLinkedKeys.has(key)) {\n seenLinkedKeys.add(key);\n linkedAssets.push(parsed);\n }\n }\n }\n\n return {\n users,\n assets,\n linkedAssets,\n };\n}\n\nexport {\n getReferencesInContent,\n parseAssetLinkShorthand,\n parseOuroAssetUrl,\n};\n"]}