@ourofoundation/ouro-js 1.0.4 → 1.0.6
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.d.ts +3 -2
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/schema/assets.d.ts +8 -73
- package/dist/schema/assets.js +16 -0
- package/dist/schema/assets.js.map +1 -1
- package/dist/schema/comments.d.ts +7 -7
- package/dist/schema/comments.js +2 -3
- package/dist/schema/comments.js.map +1 -1
- package/dist/schema/conversations.d.ts +26 -5
- package/dist/schema/datasets.d.ts +45 -175
- package/dist/schema/datasets.js +5 -6
- package/dist/schema/datasets.js.map +1 -1
- package/dist/schema/files.d.ts +32 -163
- package/dist/schema/files.js +5 -7
- package/dist/schema/files.js.map +1 -1
- package/dist/schema/posts.d.ts +637 -265
- package/dist/schema/posts.js +21 -42
- package/dist/schema/posts.js.map +1 -1
- package/dist/utils/air/markdown-parser.d.ts +1 -0
- package/dist/utils/air/markdown-parser.js +118 -0
- package/dist/utils/air/markdown-parser.js.map +1 -0
- package/package.json +2 -2
package/dist/schema/files.d.ts
CHANGED
|
@@ -125,7 +125,7 @@ declare const FileSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
125
125
|
created_at: z.ZodString;
|
|
126
126
|
last_updated: z.ZodString;
|
|
127
127
|
}, {
|
|
128
|
-
asset_type: z.
|
|
128
|
+
asset_type: z.ZodDefault<z.ZodLiteral<"file">>;
|
|
129
129
|
metadata: z.ZodObject<{
|
|
130
130
|
id: z.ZodString;
|
|
131
131
|
path: z.ZodString;
|
|
@@ -170,7 +170,7 @@ declare const FileSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
170
170
|
};
|
|
171
171
|
user_id: string;
|
|
172
172
|
org_id: string;
|
|
173
|
-
asset_type: "file"
|
|
173
|
+
asset_type: "file";
|
|
174
174
|
created_at: string;
|
|
175
175
|
last_updated: string;
|
|
176
176
|
team_id: string;
|
|
@@ -236,7 +236,6 @@ declare const FileSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
236
236
|
};
|
|
237
237
|
user_id: string;
|
|
238
238
|
org_id: string;
|
|
239
|
-
asset_type: "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
|
|
240
239
|
created_at: string;
|
|
241
240
|
last_updated: string;
|
|
242
241
|
team_id: string;
|
|
@@ -267,6 +266,7 @@ declare const FileSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
267
266
|
}[] | null | undefined;
|
|
268
267
|
base_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
269
268
|
} | undefined;
|
|
269
|
+
asset_type?: "file" | undefined;
|
|
270
270
|
team?: {
|
|
271
271
|
id?: string | undefined;
|
|
272
272
|
name?: string | undefined;
|
|
@@ -412,16 +412,19 @@ declare const CreateFileSchema: z.ZodDiscriminatedUnion<"state", [z.ZodObject<z.
|
|
|
412
412
|
state: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodEnum<["queued", "in-progress", "success", "error"]>>>>;
|
|
413
413
|
created_at: z.ZodOptional<z.ZodString>;
|
|
414
414
|
last_updated: z.ZodOptional<z.ZodString>;
|
|
415
|
-
}, "user_id">, {
|
|
415
|
+
}, "user" | "organization" | "user_id" | "team" | "slug">, {
|
|
416
416
|
id: z.ZodDefault<z.ZodString>;
|
|
417
417
|
team_id: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
418
418
|
org_id: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
419
|
+
name: z.ZodString;
|
|
419
420
|
name_url_slug: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
420
421
|
state: z.ZodDefault<z.ZodOptional<z.ZodEnum<["queued", "in-progress", "success", "error"]>>>;
|
|
421
422
|
visibility: z.ZodDefault<z.ZodOptional<z.ZodEnum<["public", "private", "organization", "monetized", "inherit"]>>>;
|
|
423
|
+
created_at: z.ZodDefault<z.ZodString>;
|
|
424
|
+
last_updated: z.ZodDefault<z.ZodString>;
|
|
422
425
|
}>, {
|
|
423
|
-
asset_type: z.
|
|
424
|
-
state: z.ZodLiteral<"success"
|
|
426
|
+
asset_type: z.ZodDefault<z.ZodLiteral<"file">>;
|
|
427
|
+
state: z.ZodDefault<z.ZodLiteral<"success">>;
|
|
425
428
|
metadata: z.ZodObject<{
|
|
426
429
|
id: z.ZodString;
|
|
427
430
|
path: z.ZodString;
|
|
@@ -453,6 +456,7 @@ declare const CreateFileSchema: z.ZodDiscriminatedUnion<"state", [z.ZodObject<z.
|
|
|
453
456
|
}>, "strip", z.ZodTypeAny, {
|
|
454
457
|
id: string;
|
|
455
458
|
state: "success";
|
|
459
|
+
name: string;
|
|
456
460
|
visibility: "inherit" | "private" | "public" | "organization" | "monetized";
|
|
457
461
|
metadata: {
|
|
458
462
|
type: string;
|
|
@@ -465,48 +469,13 @@ declare const CreateFileSchema: z.ZodDiscriminatedUnion<"state", [z.ZodObject<z.
|
|
|
465
469
|
width?: number | undefined;
|
|
466
470
|
};
|
|
467
471
|
org_id: string | null;
|
|
468
|
-
asset_type: "file"
|
|
472
|
+
asset_type: "file";
|
|
473
|
+
created_at: string;
|
|
474
|
+
last_updated: string;
|
|
469
475
|
team_id: string | null;
|
|
470
|
-
name?: string | undefined;
|
|
471
476
|
description?: string | null | undefined;
|
|
472
|
-
user?: {
|
|
473
|
-
id?: string | undefined;
|
|
474
|
-
user_id?: string | undefined;
|
|
475
|
-
avatar_path?: string | null | undefined;
|
|
476
|
-
urls?: {
|
|
477
|
-
value: string;
|
|
478
|
-
}[] | undefined;
|
|
479
|
-
username?: string | null | undefined;
|
|
480
|
-
bio?: string | null | undefined;
|
|
481
|
-
last_active?: string | undefined;
|
|
482
|
-
} | undefined;
|
|
483
|
-
organization?: {
|
|
484
|
-
id?: string | undefined;
|
|
485
|
-
name?: string | undefined;
|
|
486
|
-
size?: string | undefined;
|
|
487
|
-
email?: string | null | undefined;
|
|
488
|
-
avatar_path?: string | null | undefined;
|
|
489
|
-
mission?: string | null | undefined;
|
|
490
|
-
domain?: string | null | undefined;
|
|
491
|
-
urls?: {
|
|
492
|
-
value: string;
|
|
493
|
-
}[] | null | undefined;
|
|
494
|
-
base_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
495
|
-
} | undefined;
|
|
496
|
-
created_at?: string | undefined;
|
|
497
|
-
last_updated?: string | undefined;
|
|
498
|
-
team?: {
|
|
499
|
-
id?: string | undefined;
|
|
500
|
-
name?: string | undefined;
|
|
501
|
-
visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
|
|
502
|
-
description?: string | null | undefined;
|
|
503
|
-
org_id?: string | undefined;
|
|
504
|
-
created_at?: string | undefined;
|
|
505
|
-
default_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
506
|
-
} | undefined;
|
|
507
477
|
parent_id?: string | null | undefined;
|
|
508
478
|
name_url_slug?: string | null | undefined;
|
|
509
|
-
slug?: string | null | undefined;
|
|
510
479
|
monetization?: "none" | "pay-to-unlock" | "pay-per-use" | undefined;
|
|
511
480
|
price?: number | null | undefined;
|
|
512
481
|
unit_cost?: number | null | undefined;
|
|
@@ -516,7 +485,7 @@ declare const CreateFileSchema: z.ZodDiscriminatedUnion<"state", [z.ZodObject<z.
|
|
|
516
485
|
price_id?: string | null | undefined;
|
|
517
486
|
preview?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough">[] | null | undefined;
|
|
518
487
|
}, {
|
|
519
|
-
|
|
488
|
+
name: string;
|
|
520
489
|
metadata: {
|
|
521
490
|
type: string;
|
|
522
491
|
id: string;
|
|
@@ -527,51 +496,17 @@ declare const CreateFileSchema: z.ZodDiscriminatedUnion<"state", [z.ZodObject<z.
|
|
|
527
496
|
height?: number | undefined;
|
|
528
497
|
width?: number | undefined;
|
|
529
498
|
};
|
|
530
|
-
asset_type: "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
|
|
531
499
|
id?: string | undefined;
|
|
532
|
-
|
|
500
|
+
state?: "success" | undefined;
|
|
533
501
|
visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
|
|
534
502
|
description?: string | null | undefined;
|
|
535
|
-
user?: {
|
|
536
|
-
id?: string | undefined;
|
|
537
|
-
user_id?: string | undefined;
|
|
538
|
-
avatar_path?: string | null | undefined;
|
|
539
|
-
urls?: {
|
|
540
|
-
value: string;
|
|
541
|
-
}[] | undefined;
|
|
542
|
-
username?: string | null | undefined;
|
|
543
|
-
bio?: string | null | undefined;
|
|
544
|
-
last_active?: string | undefined;
|
|
545
|
-
} | undefined;
|
|
546
|
-
organization?: {
|
|
547
|
-
id?: string | undefined;
|
|
548
|
-
name?: string | undefined;
|
|
549
|
-
size?: string | undefined;
|
|
550
|
-
email?: string | null | undefined;
|
|
551
|
-
avatar_path?: string | null | undefined;
|
|
552
|
-
mission?: string | null | undefined;
|
|
553
|
-
domain?: string | null | undefined;
|
|
554
|
-
urls?: {
|
|
555
|
-
value: string;
|
|
556
|
-
}[] | null | undefined;
|
|
557
|
-
base_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
558
|
-
} | undefined;
|
|
559
503
|
org_id?: string | null | undefined;
|
|
504
|
+
asset_type?: "file" | undefined;
|
|
560
505
|
created_at?: string | undefined;
|
|
561
506
|
last_updated?: string | undefined;
|
|
562
507
|
team_id?: string | null | undefined;
|
|
563
|
-
team?: {
|
|
564
|
-
id?: string | undefined;
|
|
565
|
-
name?: string | undefined;
|
|
566
|
-
visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
|
|
567
|
-
description?: string | null | undefined;
|
|
568
|
-
org_id?: string | undefined;
|
|
569
|
-
created_at?: string | undefined;
|
|
570
|
-
default_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
571
|
-
} | undefined;
|
|
572
508
|
parent_id?: string | null | undefined;
|
|
573
509
|
name_url_slug?: string | null | undefined;
|
|
574
|
-
slug?: string | null | undefined;
|
|
575
510
|
monetization?: "none" | "pay-to-unlock" | "pay-per-use" | undefined;
|
|
576
511
|
price?: number | null | undefined;
|
|
577
512
|
unit_cost?: number | null | undefined;
|
|
@@ -705,16 +640,19 @@ declare const CreateFileSchema: z.ZodDiscriminatedUnion<"state", [z.ZodObject<z.
|
|
|
705
640
|
state: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodEnum<["queued", "in-progress", "success", "error"]>>>>;
|
|
706
641
|
created_at: z.ZodOptional<z.ZodString>;
|
|
707
642
|
last_updated: z.ZodOptional<z.ZodString>;
|
|
708
|
-
}, "user_id">, {
|
|
643
|
+
}, "user" | "organization" | "user_id" | "team" | "slug">, {
|
|
709
644
|
id: z.ZodDefault<z.ZodString>;
|
|
710
645
|
team_id: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
711
646
|
org_id: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
647
|
+
name: z.ZodString;
|
|
712
648
|
name_url_slug: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
713
649
|
state: z.ZodDefault<z.ZodOptional<z.ZodEnum<["queued", "in-progress", "success", "error"]>>>;
|
|
714
650
|
visibility: z.ZodDefault<z.ZodOptional<z.ZodEnum<["public", "private", "organization", "monetized", "inherit"]>>>;
|
|
651
|
+
created_at: z.ZodDefault<z.ZodString>;
|
|
652
|
+
last_updated: z.ZodDefault<z.ZodString>;
|
|
715
653
|
}>, {
|
|
716
|
-
asset_type: z.
|
|
717
|
-
state: z.ZodLiteral<"in-progress"
|
|
654
|
+
asset_type: z.ZodDefault<z.ZodLiteral<"file">>;
|
|
655
|
+
state: z.ZodDefault<z.ZodLiteral<"in-progress">>;
|
|
718
656
|
metadata: z.ZodObject<{
|
|
719
657
|
type: z.ZodString;
|
|
720
658
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -725,53 +663,19 @@ declare const CreateFileSchema: z.ZodDiscriminatedUnion<"state", [z.ZodObject<z.
|
|
|
725
663
|
}>, "strip", z.ZodTypeAny, {
|
|
726
664
|
id: string;
|
|
727
665
|
state: "in-progress";
|
|
666
|
+
name: string;
|
|
728
667
|
visibility: "inherit" | "private" | "public" | "organization" | "monetized";
|
|
729
668
|
metadata: {
|
|
730
669
|
type: string;
|
|
731
670
|
};
|
|
732
671
|
org_id: string | null;
|
|
733
|
-
asset_type: "file"
|
|
672
|
+
asset_type: "file";
|
|
673
|
+
created_at: string;
|
|
674
|
+
last_updated: string;
|
|
734
675
|
team_id: string | null;
|
|
735
|
-
name?: string | undefined;
|
|
736
676
|
description?: string | null | undefined;
|
|
737
|
-
user?: {
|
|
738
|
-
id?: string | undefined;
|
|
739
|
-
user_id?: string | undefined;
|
|
740
|
-
avatar_path?: string | null | undefined;
|
|
741
|
-
urls?: {
|
|
742
|
-
value: string;
|
|
743
|
-
}[] | undefined;
|
|
744
|
-
username?: string | null | undefined;
|
|
745
|
-
bio?: string | null | undefined;
|
|
746
|
-
last_active?: string | undefined;
|
|
747
|
-
} | undefined;
|
|
748
|
-
organization?: {
|
|
749
|
-
id?: string | undefined;
|
|
750
|
-
name?: string | undefined;
|
|
751
|
-
size?: string | undefined;
|
|
752
|
-
email?: string | null | undefined;
|
|
753
|
-
avatar_path?: string | null | undefined;
|
|
754
|
-
mission?: string | null | undefined;
|
|
755
|
-
domain?: string | null | undefined;
|
|
756
|
-
urls?: {
|
|
757
|
-
value: string;
|
|
758
|
-
}[] | null | undefined;
|
|
759
|
-
base_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
760
|
-
} | undefined;
|
|
761
|
-
created_at?: string | undefined;
|
|
762
|
-
last_updated?: string | undefined;
|
|
763
|
-
team?: {
|
|
764
|
-
id?: string | undefined;
|
|
765
|
-
name?: string | undefined;
|
|
766
|
-
visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
|
|
767
|
-
description?: string | null | undefined;
|
|
768
|
-
org_id?: string | undefined;
|
|
769
|
-
created_at?: string | undefined;
|
|
770
|
-
default_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
771
|
-
} | undefined;
|
|
772
677
|
parent_id?: string | null | undefined;
|
|
773
678
|
name_url_slug?: string | null | undefined;
|
|
774
|
-
slug?: string | null | undefined;
|
|
775
679
|
monetization?: "none" | "pay-to-unlock" | "pay-per-use" | undefined;
|
|
776
680
|
price?: number | null | undefined;
|
|
777
681
|
unit_cost?: number | null | undefined;
|
|
@@ -781,55 +685,21 @@ declare const CreateFileSchema: z.ZodDiscriminatedUnion<"state", [z.ZodObject<z.
|
|
|
781
685
|
price_id?: string | null | undefined;
|
|
782
686
|
preview?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough">[] | null | undefined;
|
|
783
687
|
}, {
|
|
784
|
-
|
|
688
|
+
name: string;
|
|
785
689
|
metadata: {
|
|
786
690
|
type: string;
|
|
787
691
|
};
|
|
788
|
-
asset_type: "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
|
|
789
692
|
id?: string | undefined;
|
|
790
|
-
|
|
693
|
+
state?: "in-progress" | undefined;
|
|
791
694
|
visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
|
|
792
695
|
description?: string | null | undefined;
|
|
793
|
-
user?: {
|
|
794
|
-
id?: string | undefined;
|
|
795
|
-
user_id?: string | undefined;
|
|
796
|
-
avatar_path?: string | null | undefined;
|
|
797
|
-
urls?: {
|
|
798
|
-
value: string;
|
|
799
|
-
}[] | undefined;
|
|
800
|
-
username?: string | null | undefined;
|
|
801
|
-
bio?: string | null | undefined;
|
|
802
|
-
last_active?: string | undefined;
|
|
803
|
-
} | undefined;
|
|
804
|
-
organization?: {
|
|
805
|
-
id?: string | undefined;
|
|
806
|
-
name?: string | undefined;
|
|
807
|
-
size?: string | undefined;
|
|
808
|
-
email?: string | null | undefined;
|
|
809
|
-
avatar_path?: string | null | undefined;
|
|
810
|
-
mission?: string | null | undefined;
|
|
811
|
-
domain?: string | null | undefined;
|
|
812
|
-
urls?: {
|
|
813
|
-
value: string;
|
|
814
|
-
}[] | null | undefined;
|
|
815
|
-
base_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
816
|
-
} | undefined;
|
|
817
696
|
org_id?: string | null | undefined;
|
|
697
|
+
asset_type?: "file" | undefined;
|
|
818
698
|
created_at?: string | undefined;
|
|
819
699
|
last_updated?: string | undefined;
|
|
820
700
|
team_id?: string | null | undefined;
|
|
821
|
-
team?: {
|
|
822
|
-
id?: string | undefined;
|
|
823
|
-
name?: string | undefined;
|
|
824
|
-
visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
|
|
825
|
-
description?: string | null | undefined;
|
|
826
|
-
org_id?: string | undefined;
|
|
827
|
-
created_at?: string | undefined;
|
|
828
|
-
default_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
829
|
-
} | undefined;
|
|
830
701
|
parent_id?: string | null | undefined;
|
|
831
702
|
name_url_slug?: string | null | undefined;
|
|
832
|
-
slug?: string | null | undefined;
|
|
833
703
|
monetization?: "none" | "pay-to-unlock" | "pay-per-use" | undefined;
|
|
834
704
|
price?: number | null | undefined;
|
|
835
705
|
unit_cost?: number | null | undefined;
|
|
@@ -962,7 +832,7 @@ declare const updateFileSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
|
962
832
|
state: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodEnum<["queued", "in-progress", "success", "error"]>>>>;
|
|
963
833
|
created_at: z.ZodOptional<z.ZodString>;
|
|
964
834
|
last_updated: z.ZodOptional<z.ZodString>;
|
|
965
|
-
asset_type: z.ZodOptional<z.
|
|
835
|
+
asset_type: z.ZodOptional<z.ZodDefault<z.ZodLiteral<"file">>>;
|
|
966
836
|
metadata: z.ZodOptional<z.ZodObject<{
|
|
967
837
|
id: z.ZodString;
|
|
968
838
|
path: z.ZodString;
|
|
@@ -992,10 +862,8 @@ declare const updateFileSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
|
992
862
|
width?: number | undefined;
|
|
993
863
|
}>>;
|
|
994
864
|
}, "id" | "user_id" | "created_at" | "last_updated">, {
|
|
995
|
-
asset_type: z.ZodEffects<z.ZodEnum<["dataset", "file", "service", "route", "post", "comment", "conversation", "blueprint", "replication"]>, "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication", "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication">;
|
|
996
865
|
last_updated: z.ZodDefault<z.ZodString>;
|
|
997
866
|
}>, "strip", z.ZodTypeAny, {
|
|
998
|
-
asset_type: "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
|
|
999
867
|
last_updated: string;
|
|
1000
868
|
state?: "error" | "in-progress" | "success" | "queued" | null | undefined;
|
|
1001
869
|
name?: string | undefined;
|
|
@@ -1036,6 +904,7 @@ declare const updateFileSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
|
1036
904
|
base_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
1037
905
|
} | undefined;
|
|
1038
906
|
org_id?: string | undefined;
|
|
907
|
+
asset_type?: "file" | undefined;
|
|
1039
908
|
team_id?: string | undefined;
|
|
1040
909
|
team?: {
|
|
1041
910
|
id?: string | undefined;
|
|
@@ -1058,7 +927,6 @@ declare const updateFileSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
|
1058
927
|
price_id?: string | null | undefined;
|
|
1059
928
|
preview?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough">[] | null | undefined;
|
|
1060
929
|
}, {
|
|
1061
|
-
asset_type: "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
|
|
1062
930
|
state?: "error" | "in-progress" | "success" | "queued" | null | undefined;
|
|
1063
931
|
name?: string | undefined;
|
|
1064
932
|
visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
|
|
@@ -1098,6 +966,7 @@ declare const updateFileSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
|
1098
966
|
base_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
1099
967
|
} | undefined;
|
|
1100
968
|
org_id?: string | undefined;
|
|
969
|
+
asset_type?: "file" | undefined;
|
|
1101
970
|
last_updated?: string | undefined;
|
|
1102
971
|
team_id?: string | undefined;
|
|
1103
972
|
team?: {
|
package/dist/schema/files.js
CHANGED
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.updateFileSchema = exports.CreateFileSchema = exports.FileSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const assets_1 = require("./assets");
|
|
6
|
-
const common_1 = require("./common");
|
|
7
6
|
const FileMetadataSchema = zod_1.z.object({
|
|
8
7
|
id: zod_1.z.string().uuid(),
|
|
9
8
|
path: zod_1.z.string(),
|
|
@@ -16,21 +15,21 @@ const FileMetadataSchema = zod_1.z.object({
|
|
|
16
15
|
height: zod_1.z.number().optional(),
|
|
17
16
|
});
|
|
18
17
|
const FileSchema = assets_1.AssetSchema.extend({
|
|
19
|
-
asset_type:
|
|
18
|
+
asset_type: zod_1.z.literal("file").default("file"),
|
|
20
19
|
metadata: FileMetadataSchema,
|
|
21
20
|
});
|
|
22
21
|
exports.FileSchema = FileSchema;
|
|
23
22
|
const CreateFileSchema = zod_1.z.discriminatedUnion("state", [
|
|
24
23
|
// Success state, file is ready
|
|
25
24
|
assets_1.CreateAssetSchema.extend({
|
|
26
|
-
asset_type:
|
|
27
|
-
state: zod_1.z.literal("success"),
|
|
25
|
+
asset_type: zod_1.z.literal("file").default("file"),
|
|
26
|
+
state: zod_1.z.literal("success").default("success"),
|
|
28
27
|
metadata: FileMetadataSchema,
|
|
29
28
|
}),
|
|
30
29
|
// In-progress state, file is being processed
|
|
31
30
|
assets_1.CreateAssetSchema.extend({
|
|
32
|
-
asset_type:
|
|
33
|
-
state: zod_1.z.literal("in-progress"),
|
|
31
|
+
asset_type: zod_1.z.literal("file").default("file"),
|
|
32
|
+
state: zod_1.z.literal("in-progress").default("in-progress"),
|
|
34
33
|
metadata: zod_1.z.object({
|
|
35
34
|
type: zod_1.z.string(),
|
|
36
35
|
}),
|
|
@@ -45,7 +44,6 @@ const updateFileSchema = FileSchema.partial()
|
|
|
45
44
|
last_updated: true,
|
|
46
45
|
})
|
|
47
46
|
.extend({
|
|
48
|
-
asset_type: common_1.AssetTypeSchema.refine((val) => val === "file"),
|
|
49
47
|
last_updated: zod_1.z.string().default(() => new Date().toISOString()),
|
|
50
48
|
});
|
|
51
49
|
exports.updateFileSchema = updateFileSchema;
|
package/dist/schema/files.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/schema/files.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,qCAA0D;
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/schema/files.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,qCAA0D;AAE1D,MAAM,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACrB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACzC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,qDAAqD;IACrD,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,oBAAW,CAAC,MAAM,CAAC;IACpC,UAAU,EAAE,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IAC7C,QAAQ,EAAE,kBAAkB;CAC7B,CAAC,CAAC;AAmCD,gCAAU;AAjCZ,MAAM,gBAAgB,GAAG,OAAC,CAAC,kBAAkB,CAAC,OAAO,EAAE;IACrD,+BAA+B;IAC/B,0BAAiB,CAAC,MAAM,CAAC;QACvB,UAAU,EAAE,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;QAC7C,KAAK,EAAE,OAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;QAC9C,QAAQ,EAAE,kBAAkB;KAC7B,CAAC;IACF,6CAA6C;IAC7C,0BAAiB,CAAC,MAAM,CAAC;QACvB,UAAU,EAAE,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;QAC7C,KAAK,EAAE,OAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;QACtD,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC;YACjB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;SACjB,CAAC;KACH,CAAC;CACH,CAAC,CAAC;AAmBD,4CAAgB;AAjBlB,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,EAAE;KAC1C,IAAI,CAAC;IACJ,OAAO,EAAE,IAAI;IACb,EAAE,EAAE,IAAI;IACR,UAAU,EAAE,IAAI;IAChB,YAAY,EAAE,IAAI;CACnB,CAAC;KACD,MAAM,CAAC;IACN,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;CACjE,CAAC,CAAC;AASH,4CAAgB"}
|