@marcoappio/marco-config 2.0.532 → 2.0.533
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/zero/index.d.ts +11 -11
- package/dist/zero/mutatorSchemas.d.ts +2 -2
- package/dist/zero/mutatorSchemas.js +1 -1
- package/dist/zero/mutators.d.ts +5 -5
- package/dist/zero/mutators.test.js +126 -60
- package/dist/zero/queries.d.ts +2 -2
- package/dist/zero/schema.d.ts +2 -2
- package/dist/zero/schema.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/zero/index.d.ts
CHANGED
|
@@ -246,7 +246,7 @@ export declare const marcoZero: {
|
|
|
246
246
|
readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
247
247
|
readonly view: import("valibot").ObjectSchema<{
|
|
248
248
|
readonly aliasEmails: import("valibot").SchemaWithPipe<readonly [import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RfcEmailAction<string, undefined>]>, undefined>, undefined>, import("valibot").MinLengthAction<string[], 1, undefined>, import("valibot").MaxLengthAction<string[], number, undefined>]>;
|
|
249
|
-
readonly icon: import("valibot").
|
|
249
|
+
readonly icon: import("valibot").PicklistSchema<readonly [import("..").CustomViewIcon.AIRPLANE, import("..").CustomViewIcon.BELL, import("..").CustomViewIcon.BRIEFCASE, import("..").CustomViewIcon.CLOCK, import("..").CustomViewIcon.CREDIT_CARD, import("..").CustomViewIcon.HEART, import("..").CustomViewIcon.HOME, import("..").CustomViewIcon.KEY, import("..").CustomViewIcon.MOON, import("..").CustomViewIcon.PERSON, import("..").CustomViewIcon.SHOPPING_CART, import("..").CustomViewIcon.STAR], undefined>;
|
|
250
250
|
readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
251
251
|
readonly name: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
252
252
|
}, undefined>;
|
|
@@ -275,7 +275,7 @@ export declare const marcoZero: {
|
|
|
275
275
|
readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
276
276
|
readonly view: import("valibot").ObjectSchema<{
|
|
277
277
|
readonly aliasEmails: import("valibot").SchemaWithPipe<readonly [import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RfcEmailAction<string, undefined>]>, undefined>, undefined>, import("valibot").MinLengthAction<string[], 1, undefined>, import("valibot").MaxLengthAction<string[], number, undefined>]>;
|
|
278
|
-
readonly icon: import("valibot").
|
|
278
|
+
readonly icon: import("valibot").PicklistSchema<readonly [import("..").CustomViewIcon.AIRPLANE, import("..").CustomViewIcon.BELL, import("..").CustomViewIcon.BRIEFCASE, import("..").CustomViewIcon.CLOCK, import("..").CustomViewIcon.CREDIT_CARD, import("..").CustomViewIcon.HEART, import("..").CustomViewIcon.HOME, import("..").CustomViewIcon.KEY, import("..").CustomViewIcon.MOON, import("..").CustomViewIcon.PERSON, import("..").CustomViewIcon.SHOPPING_CART, import("..").CustomViewIcon.STAR], undefined>;
|
|
279
279
|
readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
280
280
|
readonly name: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
281
281
|
}, undefined>;
|
|
@@ -745,7 +745,7 @@ export declare const marcoZero: {
|
|
|
745
745
|
id: string;
|
|
746
746
|
view: {
|
|
747
747
|
aliasEmails: string[];
|
|
748
|
-
icon: import("..").CustomViewIcon
|
|
748
|
+
icon: import("..").CustomViewIcon;
|
|
749
749
|
id: string;
|
|
750
750
|
name: string;
|
|
751
751
|
};
|
|
@@ -753,7 +753,7 @@ export declare const marcoZero: {
|
|
|
753
753
|
id: string;
|
|
754
754
|
view: {
|
|
755
755
|
aliasEmails: string[];
|
|
756
|
-
icon: import("..").CustomViewIcon
|
|
756
|
+
icon: import("..").CustomViewIcon;
|
|
757
757
|
id: string;
|
|
758
758
|
name: string;
|
|
759
759
|
};
|
|
@@ -808,7 +808,7 @@ export declare const marcoZero: {
|
|
|
808
808
|
id: string;
|
|
809
809
|
view: {
|
|
810
810
|
aliasEmails: string[];
|
|
811
|
-
icon: import("..").CustomViewIcon
|
|
811
|
+
icon: import("..").CustomViewIcon;
|
|
812
812
|
id: string;
|
|
813
813
|
name: string;
|
|
814
814
|
};
|
|
@@ -816,7 +816,7 @@ export declare const marcoZero: {
|
|
|
816
816
|
id: string;
|
|
817
817
|
view: {
|
|
818
818
|
aliasEmails: string[];
|
|
819
|
-
icon: import("..").CustomViewIcon
|
|
819
|
+
icon: import("..").CustomViewIcon;
|
|
820
820
|
id: string;
|
|
821
821
|
name: string;
|
|
822
822
|
};
|
|
@@ -864,7 +864,7 @@ export declare const marcoZero: {
|
|
|
864
864
|
id: string;
|
|
865
865
|
name: string;
|
|
866
866
|
aliasEmails: string[];
|
|
867
|
-
icon: import("..").CustomViewIcon
|
|
867
|
+
icon: import("..").CustomViewIcon;
|
|
868
868
|
}[];
|
|
869
869
|
};
|
|
870
870
|
};
|
|
@@ -2148,7 +2148,7 @@ export declare const marcoZero: {
|
|
|
2148
2148
|
id: string;
|
|
2149
2149
|
name: string;
|
|
2150
2150
|
aliasEmails: string[];
|
|
2151
|
-
icon: import("..").CustomViewIcon
|
|
2151
|
+
icon: import("..").CustomViewIcon;
|
|
2152
2152
|
}[];
|
|
2153
2153
|
} & {
|
|
2154
2154
|
readonly accounts: readonly ({
|
|
@@ -2237,7 +2237,7 @@ export declare const marcoZero: {
|
|
|
2237
2237
|
id: string;
|
|
2238
2238
|
name: string;
|
|
2239
2239
|
aliasEmails: string[];
|
|
2240
|
-
icon: import("..").CustomViewIcon
|
|
2240
|
+
icon: import("..").CustomViewIcon;
|
|
2241
2241
|
}[];
|
|
2242
2242
|
};
|
|
2243
2243
|
};
|
|
@@ -3279,7 +3279,7 @@ export declare const marcoZero: {
|
|
|
3279
3279
|
id: string;
|
|
3280
3280
|
name: string;
|
|
3281
3281
|
aliasEmails: string[];
|
|
3282
|
-
icon: import("..").CustomViewIcon
|
|
3282
|
+
icon: import("..").CustomViewIcon;
|
|
3283
3283
|
}[];
|
|
3284
3284
|
};
|
|
3285
3285
|
};
|
|
@@ -5017,7 +5017,7 @@ export declare const marcoZero: {
|
|
|
5017
5017
|
id: string;
|
|
5018
5018
|
name: string;
|
|
5019
5019
|
aliasEmails: string[];
|
|
5020
|
-
icon: import("..").CustomViewIcon
|
|
5020
|
+
icon: import("..").CustomViewIcon;
|
|
5021
5021
|
}[];
|
|
5022
5022
|
};
|
|
5023
5023
|
};
|
|
@@ -246,7 +246,7 @@ export declare const mutatorSchemas: {
|
|
|
246
246
|
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
247
247
|
readonly view: v.ObjectSchema<{
|
|
248
248
|
readonly aliasEmails: v.SchemaWithPipe<readonly [v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, undefined>, undefined>, v.MinLengthAction<string[], 1, undefined>, v.MaxLengthAction<string[], number, undefined>]>;
|
|
249
|
-
readonly icon: v.
|
|
249
|
+
readonly icon: v.PicklistSchema<readonly [import("../types").CustomViewIcon.AIRPLANE, import("../types").CustomViewIcon.BELL, import("../types").CustomViewIcon.BRIEFCASE, import("../types").CustomViewIcon.CLOCK, import("../types").CustomViewIcon.CREDIT_CARD, import("../types").CustomViewIcon.HEART, import("../types").CustomViewIcon.HOME, import("../types").CustomViewIcon.KEY, import("../types").CustomViewIcon.MOON, import("../types").CustomViewIcon.PERSON, import("../types").CustomViewIcon.SHOPPING_CART, import("../types").CustomViewIcon.STAR], undefined>;
|
|
250
250
|
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
251
251
|
readonly name: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
252
252
|
}, undefined>;
|
|
@@ -275,7 +275,7 @@ export declare const mutatorSchemas: {
|
|
|
275
275
|
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
276
276
|
readonly view: v.ObjectSchema<{
|
|
277
277
|
readonly aliasEmails: v.SchemaWithPipe<readonly [v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, undefined>, undefined>, v.MinLengthAction<string[], 1, undefined>, v.MaxLengthAction<string[], number, undefined>]>;
|
|
278
|
-
readonly icon: v.
|
|
278
|
+
readonly icon: v.PicklistSchema<readonly [import("../types").CustomViewIcon.AIRPLANE, import("../types").CustomViewIcon.BELL, import("../types").CustomViewIcon.BRIEFCASE, import("../types").CustomViewIcon.CLOCK, import("../types").CustomViewIcon.CREDIT_CARD, import("../types").CustomViewIcon.HEART, import("../types").CustomViewIcon.HOME, import("../types").CustomViewIcon.KEY, import("../types").CustomViewIcon.MOON, import("../types").CustomViewIcon.PERSON, import("../types").CustomViewIcon.SHOPPING_CART, import("../types").CustomViewIcon.STAR], undefined>;
|
|
279
279
|
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
280
280
|
readonly name: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
281
281
|
}, undefined>;
|
|
@@ -56,7 +56,7 @@ const connectionConfigImapRawSchema = v.object({
|
|
|
56
56
|
});
|
|
57
57
|
const userViewSchema = v.object({
|
|
58
58
|
aliasEmails: v.pipe(v.array(marcoSchemas.string.email()), v.minLength(1), v.maxLength(marcoConstants.user.views.maxAliasEmailsPerView)),
|
|
59
|
-
icon: v.
|
|
59
|
+
icon: v.picklist(USER_SETTINGS_CUSTOM_VIEW_ICONS),
|
|
60
60
|
id: marcoSchemas.string.required(),
|
|
61
61
|
name: marcoSchemas.string.required(),
|
|
62
62
|
});
|
package/dist/zero/mutators.d.ts
CHANGED
|
@@ -410,7 +410,7 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
410
410
|
id: string;
|
|
411
411
|
view: {
|
|
412
412
|
aliasEmails: string[];
|
|
413
|
-
icon: import("../types").CustomViewIcon
|
|
413
|
+
icon: import("../types").CustomViewIcon;
|
|
414
414
|
id: string;
|
|
415
415
|
name: string;
|
|
416
416
|
};
|
|
@@ -418,7 +418,7 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
418
418
|
id: string;
|
|
419
419
|
view: {
|
|
420
420
|
aliasEmails: string[];
|
|
421
|
-
icon: import("../types").CustomViewIcon
|
|
421
|
+
icon: import("../types").CustomViewIcon;
|
|
422
422
|
id: string;
|
|
423
423
|
name: string;
|
|
424
424
|
};
|
|
@@ -463,7 +463,7 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
463
463
|
id: string;
|
|
464
464
|
view: {
|
|
465
465
|
aliasEmails: string[];
|
|
466
|
-
icon: import("../types").CustomViewIcon
|
|
466
|
+
icon: import("../types").CustomViewIcon;
|
|
467
467
|
id: string;
|
|
468
468
|
name: string;
|
|
469
469
|
};
|
|
@@ -471,7 +471,7 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
471
471
|
id: string;
|
|
472
472
|
view: {
|
|
473
473
|
aliasEmails: string[];
|
|
474
|
-
icon: import("../types").CustomViewIcon
|
|
474
|
+
icon: import("../types").CustomViewIcon;
|
|
475
475
|
id: string;
|
|
476
476
|
name: string;
|
|
477
477
|
};
|
|
@@ -517,7 +517,7 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
517
517
|
id: string;
|
|
518
518
|
name: string;
|
|
519
519
|
aliasEmails: string[];
|
|
520
|
-
icon: import("../types").CustomViewIcon
|
|
520
|
+
icon: import("../types").CustomViewIcon;
|
|
521
521
|
}[];
|
|
522
522
|
};
|
|
523
523
|
};
|
|
@@ -655,7 +655,7 @@ describe('mutators', () => {
|
|
|
655
655
|
id: 'test-user-id-1',
|
|
656
656
|
view: {
|
|
657
657
|
aliasEmails: ['test-email-1@example.com', 'test-email-2@example.com'],
|
|
658
|
-
icon:
|
|
658
|
+
icon: CustomViewIcon.STAR,
|
|
659
659
|
id: 'test-view-id-1',
|
|
660
660
|
name: 'test-view-name-1',
|
|
661
661
|
},
|
|
@@ -666,7 +666,7 @@ describe('mutators', () => {
|
|
|
666
666
|
views: [
|
|
667
667
|
{
|
|
668
668
|
aliasEmails: ['test-email-1@example.com', 'test-email-2@example.com'],
|
|
669
|
-
icon:
|
|
669
|
+
icon: CustomViewIcon.STAR,
|
|
670
670
|
id: 'test-view-id-1',
|
|
671
671
|
name: 'test-view-name-1',
|
|
672
672
|
},
|
|
@@ -679,7 +679,7 @@ describe('mutators', () => {
|
|
|
679
679
|
id: 'test-user-id-1',
|
|
680
680
|
view: {
|
|
681
681
|
aliasEmails: ['test-email-1@example.com', 'test-email-2@example.com', 'test-email-1@example.com'],
|
|
682
|
-
icon:
|
|
682
|
+
icon: CustomViewIcon.STAR,
|
|
683
683
|
id: 'test-view-id-1',
|
|
684
684
|
name: 'test-view-name-1',
|
|
685
685
|
},
|
|
@@ -690,26 +690,15 @@ describe('mutators', () => {
|
|
|
690
690
|
views: [
|
|
691
691
|
{
|
|
692
692
|
aliasEmails: ['test-email-1@example.com', 'test-email-2@example.com'],
|
|
693
|
-
icon:
|
|
693
|
+
icon: CustomViewIcon.STAR,
|
|
694
694
|
id: 'test-view-id-1',
|
|
695
695
|
name: 'test-view-name-1',
|
|
696
696
|
},
|
|
697
697
|
],
|
|
698
698
|
});
|
|
699
699
|
});
|
|
700
|
-
it('
|
|
701
|
-
tx.run = mock(() => Promise.resolve({
|
|
702
|
-
const args = {
|
|
703
|
-
id: 'test-user-id-1',
|
|
704
|
-
view: {
|
|
705
|
-
aliasEmails: ['test-email-1@example.com'],
|
|
706
|
-
icon: CustomViewIcon.STAR,
|
|
707
|
-
id: 'test-view-id-1',
|
|
708
|
-
name: 'test-view-name-1',
|
|
709
|
-
},
|
|
710
|
-
};
|
|
711
|
-
await mutators.user.createView.fn({ args, ctx, tx: tx });
|
|
712
|
-
expect(tx.mutate.user.update).toHaveBeenCalledWith({
|
|
700
|
+
it('appends to existing views', async () => {
|
|
701
|
+
tx.run = mock(() => Promise.resolve({
|
|
713
702
|
id: 'test-user-id-1',
|
|
714
703
|
views: [
|
|
715
704
|
{
|
|
@@ -719,20 +708,12 @@ describe('mutators', () => {
|
|
|
719
708
|
name: 'test-view-name-1',
|
|
720
709
|
},
|
|
721
710
|
],
|
|
722
|
-
});
|
|
723
|
-
});
|
|
724
|
-
it('appends to existing views', async () => {
|
|
725
|
-
tx.run = mock(() => Promise.resolve({
|
|
726
|
-
id: 'test-user-id-1',
|
|
727
|
-
views: [
|
|
728
|
-
{ aliasEmails: ['test-email-1@example.com'], icon: null, id: 'test-view-id-1', name: 'test-view-name-1' },
|
|
729
|
-
],
|
|
730
711
|
}));
|
|
731
712
|
const args = {
|
|
732
713
|
id: 'test-user-id-1',
|
|
733
714
|
view: {
|
|
734
715
|
aliasEmails: ['test-email-2@example.com'],
|
|
735
|
-
icon:
|
|
716
|
+
icon: CustomViewIcon.STAR,
|
|
736
717
|
id: 'test-view-id-2',
|
|
737
718
|
name: 'test-view-name-2',
|
|
738
719
|
},
|
|
@@ -741,8 +722,18 @@ describe('mutators', () => {
|
|
|
741
722
|
expect(tx.mutate.user.update).toHaveBeenCalledWith({
|
|
742
723
|
id: 'test-user-id-1',
|
|
743
724
|
views: [
|
|
744
|
-
{
|
|
745
|
-
|
|
725
|
+
{
|
|
726
|
+
aliasEmails: ['test-email-1@example.com'],
|
|
727
|
+
icon: CustomViewIcon.STAR,
|
|
728
|
+
id: 'test-view-id-1',
|
|
729
|
+
name: 'test-view-name-1',
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
aliasEmails: ['test-email-2@example.com'],
|
|
733
|
+
icon: CustomViewIcon.STAR,
|
|
734
|
+
id: 'test-view-id-2',
|
|
735
|
+
name: 'test-view-name-2',
|
|
736
|
+
},
|
|
746
737
|
],
|
|
747
738
|
});
|
|
748
739
|
});
|
|
@@ -752,7 +743,7 @@ describe('mutators', () => {
|
|
|
752
743
|
id: 'test-user-id-1',
|
|
753
744
|
view: {
|
|
754
745
|
aliasEmails: ['test-email-1@example.com'],
|
|
755
|
-
icon:
|
|
746
|
+
icon: CustomViewIcon.STAR,
|
|
756
747
|
id: 'test-view-id-1',
|
|
757
748
|
name: 'test-view-name-1',
|
|
758
749
|
},
|
|
@@ -764,14 +755,19 @@ describe('mutators', () => {
|
|
|
764
755
|
tx.run = mock(() => Promise.resolve({
|
|
765
756
|
id: 'test-user-id-1',
|
|
766
757
|
views: [
|
|
767
|
-
{
|
|
758
|
+
{
|
|
759
|
+
aliasEmails: ['test-email-1@example.com'],
|
|
760
|
+
icon: CustomViewIcon.STAR,
|
|
761
|
+
id: 'test-view-id-1',
|
|
762
|
+
name: 'test-view-name-1',
|
|
763
|
+
},
|
|
768
764
|
],
|
|
769
765
|
}));
|
|
770
766
|
const args = {
|
|
771
767
|
id: 'test-user-id-1',
|
|
772
768
|
view: {
|
|
773
769
|
aliasEmails: ['test-email-2@example.com'],
|
|
774
|
-
icon:
|
|
770
|
+
icon: CustomViewIcon.STAR,
|
|
775
771
|
id: 'test-view-id-1',
|
|
776
772
|
name: 'test-view-name-2',
|
|
777
773
|
},
|
|
@@ -782,7 +778,7 @@ describe('mutators', () => {
|
|
|
782
778
|
it('does nothing if max views limit reached', async () => {
|
|
783
779
|
const existingViews = Array.from({ length: 25 }, (_, i) => ({
|
|
784
780
|
aliasEmails: [`test-email-${i}@example.com`],
|
|
785
|
-
icon:
|
|
781
|
+
icon: CustomViewIcon.STAR,
|
|
786
782
|
id: `test-view-id-${i}`,
|
|
787
783
|
name: `test-view-name-${i}`,
|
|
788
784
|
}));
|
|
@@ -791,7 +787,7 @@ describe('mutators', () => {
|
|
|
791
787
|
id: 'test-user-id-1',
|
|
792
788
|
view: {
|
|
793
789
|
aliasEmails: ['test-email-1@example.com'],
|
|
794
|
-
icon:
|
|
790
|
+
icon: CustomViewIcon.STAR,
|
|
795
791
|
id: 'test-view-id-1',
|
|
796
792
|
name: 'test-view-name-1',
|
|
797
793
|
},
|
|
@@ -805,8 +801,18 @@ describe('mutators', () => {
|
|
|
805
801
|
tx.run = mock(() => Promise.resolve({
|
|
806
802
|
id: 'test-user-id-1',
|
|
807
803
|
views: [
|
|
808
|
-
{
|
|
809
|
-
|
|
804
|
+
{
|
|
805
|
+
aliasEmails: ['test-email-1@example.com'],
|
|
806
|
+
icon: CustomViewIcon.STAR,
|
|
807
|
+
id: 'test-view-id-1',
|
|
808
|
+
name: 'test-view-name-1',
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
aliasEmails: ['test-email-2@example.com'],
|
|
812
|
+
icon: CustomViewIcon.STAR,
|
|
813
|
+
id: 'test-view-id-2',
|
|
814
|
+
name: 'test-view-name-2',
|
|
815
|
+
},
|
|
810
816
|
],
|
|
811
817
|
}));
|
|
812
818
|
const args = { id: 'test-user-id-1', viewId: 'test-view-id-1' };
|
|
@@ -814,7 +820,12 @@ describe('mutators', () => {
|
|
|
814
820
|
expect(tx.mutate.user.update).toHaveBeenCalledWith({
|
|
815
821
|
id: 'test-user-id-1',
|
|
816
822
|
views: [
|
|
817
|
-
{
|
|
823
|
+
{
|
|
824
|
+
aliasEmails: ['test-email-2@example.com'],
|
|
825
|
+
icon: CustomViewIcon.STAR,
|
|
826
|
+
id: 'test-view-id-2',
|
|
827
|
+
name: 'test-view-name-2',
|
|
828
|
+
},
|
|
818
829
|
],
|
|
819
830
|
});
|
|
820
831
|
});
|
|
@@ -830,14 +841,19 @@ describe('mutators', () => {
|
|
|
830
841
|
tx.run = mock(() => Promise.resolve({
|
|
831
842
|
id: 'test-user-id-1',
|
|
832
843
|
views: [
|
|
833
|
-
{
|
|
844
|
+
{
|
|
845
|
+
aliasEmails: ['test-email-1@example.com'],
|
|
846
|
+
icon: CustomViewIcon.STAR,
|
|
847
|
+
id: 'test-view-id-1',
|
|
848
|
+
name: 'test-view-name-1',
|
|
849
|
+
},
|
|
834
850
|
],
|
|
835
851
|
}));
|
|
836
852
|
const args = {
|
|
837
853
|
id: 'test-user-id-1',
|
|
838
854
|
view: {
|
|
839
855
|
aliasEmails: ['test-email-1@example.com'],
|
|
840
|
-
icon:
|
|
856
|
+
icon: CustomViewIcon.STAR,
|
|
841
857
|
id: 'test-view-id-1',
|
|
842
858
|
name: 'test-updated-name',
|
|
843
859
|
},
|
|
@@ -846,7 +862,12 @@ describe('mutators', () => {
|
|
|
846
862
|
expect(tx.mutate.user.update).toHaveBeenCalledWith({
|
|
847
863
|
id: 'test-user-id-1',
|
|
848
864
|
views: [
|
|
849
|
-
{
|
|
865
|
+
{
|
|
866
|
+
aliasEmails: ['test-email-1@example.com'],
|
|
867
|
+
icon: CustomViewIcon.STAR,
|
|
868
|
+
id: 'test-view-id-1',
|
|
869
|
+
name: 'test-updated-name',
|
|
870
|
+
},
|
|
850
871
|
],
|
|
851
872
|
});
|
|
852
873
|
});
|
|
@@ -854,14 +875,19 @@ describe('mutators', () => {
|
|
|
854
875
|
tx.run = mock(() => Promise.resolve({
|
|
855
876
|
id: 'test-user-id-1',
|
|
856
877
|
views: [
|
|
857
|
-
{
|
|
878
|
+
{
|
|
879
|
+
aliasEmails: ['test-email-1@example.com'],
|
|
880
|
+
icon: CustomViewIcon.STAR,
|
|
881
|
+
id: 'test-view-id-1',
|
|
882
|
+
name: 'test-view-name-1',
|
|
883
|
+
},
|
|
858
884
|
],
|
|
859
885
|
}));
|
|
860
886
|
const args = {
|
|
861
887
|
id: 'test-user-id-1',
|
|
862
888
|
view: {
|
|
863
889
|
aliasEmails: ['test-email-1@example.com', 'test-email-2@example.com'],
|
|
864
|
-
icon:
|
|
890
|
+
icon: CustomViewIcon.STAR,
|
|
865
891
|
id: 'test-view-id-1',
|
|
866
892
|
name: 'test-view-name-1',
|
|
867
893
|
},
|
|
@@ -872,7 +898,7 @@ describe('mutators', () => {
|
|
|
872
898
|
views: [
|
|
873
899
|
{
|
|
874
900
|
aliasEmails: ['test-email-1@example.com', 'test-email-2@example.com'],
|
|
875
|
-
icon:
|
|
901
|
+
icon: CustomViewIcon.STAR,
|
|
876
902
|
id: 'test-view-id-1',
|
|
877
903
|
name: 'test-view-name-1',
|
|
878
904
|
},
|
|
@@ -883,14 +909,19 @@ describe('mutators', () => {
|
|
|
883
909
|
tx.run = mock(() => Promise.resolve({
|
|
884
910
|
id: 'test-user-id-1',
|
|
885
911
|
views: [
|
|
886
|
-
{
|
|
912
|
+
{
|
|
913
|
+
aliasEmails: ['test-email-1@example.com'],
|
|
914
|
+
icon: CustomViewIcon.STAR,
|
|
915
|
+
id: 'test-view-id-1',
|
|
916
|
+
name: 'test-view-name-1',
|
|
917
|
+
},
|
|
887
918
|
],
|
|
888
919
|
}));
|
|
889
920
|
const args = {
|
|
890
921
|
id: 'test-user-id-1',
|
|
891
922
|
view: {
|
|
892
923
|
aliasEmails: ['test-email-1@example.com', 'test-email-2@example.com', 'test-email-1@example.com'],
|
|
893
|
-
icon:
|
|
924
|
+
icon: CustomViewIcon.STAR,
|
|
894
925
|
id: 'test-view-id-1',
|
|
895
926
|
name: 'test-view-name-1',
|
|
896
927
|
},
|
|
@@ -901,7 +932,7 @@ describe('mutators', () => {
|
|
|
901
932
|
views: [
|
|
902
933
|
{
|
|
903
934
|
aliasEmails: ['test-email-1@example.com', 'test-email-2@example.com'],
|
|
904
|
-
icon:
|
|
935
|
+
icon: CustomViewIcon.STAR,
|
|
905
936
|
id: 'test-view-id-1',
|
|
906
937
|
name: 'test-view-name-1',
|
|
907
938
|
},
|
|
@@ -912,7 +943,12 @@ describe('mutators', () => {
|
|
|
912
943
|
tx.run = mock(() => Promise.resolve({
|
|
913
944
|
id: 'test-user-id-1',
|
|
914
945
|
views: [
|
|
915
|
-
{
|
|
946
|
+
{
|
|
947
|
+
aliasEmails: ['test-email-1@example.com'],
|
|
948
|
+
icon: CustomViewIcon.STAR,
|
|
949
|
+
id: 'test-view-id-1',
|
|
950
|
+
name: 'test-view-name-1',
|
|
951
|
+
},
|
|
916
952
|
],
|
|
917
953
|
}));
|
|
918
954
|
const args = {
|
|
@@ -941,14 +977,19 @@ describe('mutators', () => {
|
|
|
941
977
|
tx.run = mock(() => Promise.resolve({
|
|
942
978
|
id: 'test-user-id-1',
|
|
943
979
|
views: [
|
|
944
|
-
{
|
|
980
|
+
{
|
|
981
|
+
aliasEmails: ['test-email-1@example.com'],
|
|
982
|
+
icon: CustomViewIcon.STAR,
|
|
983
|
+
id: 'test-view-id-1',
|
|
984
|
+
name: 'test-view-name-1',
|
|
985
|
+
},
|
|
945
986
|
],
|
|
946
987
|
}));
|
|
947
988
|
const args = {
|
|
948
989
|
id: 'test-user-id-1',
|
|
949
990
|
view: {
|
|
950
991
|
aliasEmails: ['test-email-1@example.com'],
|
|
951
|
-
icon:
|
|
992
|
+
icon: CustomViewIcon.STAR,
|
|
952
993
|
id: 'test-view-id-1',
|
|
953
994
|
name: 'test-updated-name',
|
|
954
995
|
},
|
|
@@ -957,7 +998,12 @@ describe('mutators', () => {
|
|
|
957
998
|
expect(tx.mutate.user.update).toHaveBeenCalledWith({
|
|
958
999
|
id: 'test-user-id-1',
|
|
959
1000
|
views: [
|
|
960
|
-
{
|
|
1001
|
+
{
|
|
1002
|
+
aliasEmails: ['test-email-1@example.com'],
|
|
1003
|
+
icon: CustomViewIcon.STAR,
|
|
1004
|
+
id: 'test-view-id-1',
|
|
1005
|
+
name: 'test-updated-name',
|
|
1006
|
+
},
|
|
961
1007
|
],
|
|
962
1008
|
});
|
|
963
1009
|
});
|
|
@@ -967,7 +1013,7 @@ describe('mutators', () => {
|
|
|
967
1013
|
id: 'test-user-id-1',
|
|
968
1014
|
view: {
|
|
969
1015
|
aliasEmails: ['test-email-1@example.com'],
|
|
970
|
-
icon:
|
|
1016
|
+
icon: CustomViewIcon.STAR,
|
|
971
1017
|
id: 'test-view-id-1',
|
|
972
1018
|
name: 'test-updated-name',
|
|
973
1019
|
},
|
|
@@ -979,14 +1025,19 @@ describe('mutators', () => {
|
|
|
979
1025
|
tx.run = mock(() => Promise.resolve({
|
|
980
1026
|
id: 'test-user-id-1',
|
|
981
1027
|
views: [
|
|
982
|
-
{
|
|
1028
|
+
{
|
|
1029
|
+
aliasEmails: ['test-email-1@example.com'],
|
|
1030
|
+
icon: CustomViewIcon.STAR,
|
|
1031
|
+
id: 'test-view-id-1',
|
|
1032
|
+
name: 'test-view-name-1',
|
|
1033
|
+
},
|
|
983
1034
|
],
|
|
984
1035
|
}));
|
|
985
1036
|
const args = {
|
|
986
1037
|
id: 'test-user-id-1',
|
|
987
1038
|
view: {
|
|
988
1039
|
aliasEmails: ['test-email-1@example.com'],
|
|
989
|
-
icon:
|
|
1040
|
+
icon: CustomViewIcon.STAR,
|
|
990
1041
|
id: 'test-view-id-nonexistent',
|
|
991
1042
|
name: 'test-updated-name',
|
|
992
1043
|
},
|
|
@@ -998,15 +1049,25 @@ describe('mutators', () => {
|
|
|
998
1049
|
tx.run = mock(() => Promise.resolve({
|
|
999
1050
|
id: 'test-user-id-1',
|
|
1000
1051
|
views: [
|
|
1001
|
-
{
|
|
1002
|
-
|
|
1052
|
+
{
|
|
1053
|
+
aliasEmails: ['test-email-1@example.com'],
|
|
1054
|
+
icon: CustomViewIcon.STAR,
|
|
1055
|
+
id: 'test-view-id-1',
|
|
1056
|
+
name: 'test-view-name-1',
|
|
1057
|
+
},
|
|
1058
|
+
{
|
|
1059
|
+
aliasEmails: ['test-email-2@example.com'],
|
|
1060
|
+
icon: CustomViewIcon.STAR,
|
|
1061
|
+
id: 'test-view-id-2',
|
|
1062
|
+
name: 'test-view-name-2',
|
|
1063
|
+
},
|
|
1003
1064
|
],
|
|
1004
1065
|
}));
|
|
1005
1066
|
const args = {
|
|
1006
1067
|
id: 'test-user-id-1',
|
|
1007
1068
|
view: {
|
|
1008
1069
|
aliasEmails: ['test-email-1@example.com'],
|
|
1009
|
-
icon:
|
|
1070
|
+
icon: CustomViewIcon.STAR,
|
|
1010
1071
|
id: 'test-view-id-1',
|
|
1011
1072
|
name: 'test-view-updated-name',
|
|
1012
1073
|
},
|
|
@@ -1017,18 +1078,23 @@ describe('mutators', () => {
|
|
|
1017
1078
|
views: [
|
|
1018
1079
|
{
|
|
1019
1080
|
aliasEmails: ['test-email-1@example.com'],
|
|
1020
|
-
icon:
|
|
1081
|
+
icon: CustomViewIcon.STAR,
|
|
1021
1082
|
id: 'test-view-id-1',
|
|
1022
1083
|
name: 'test-view-updated-name',
|
|
1023
1084
|
},
|
|
1024
|
-
{
|
|
1085
|
+
{
|
|
1086
|
+
aliasEmails: ['test-email-2@example.com'],
|
|
1087
|
+
icon: CustomViewIcon.STAR,
|
|
1088
|
+
id: 'test-view-id-2',
|
|
1089
|
+
name: 'test-view-name-2',
|
|
1090
|
+
},
|
|
1025
1091
|
],
|
|
1026
1092
|
});
|
|
1027
1093
|
});
|
|
1028
1094
|
it('schema rejects empty aliasEmails array', () => {
|
|
1029
1095
|
const args = {
|
|
1030
1096
|
id: 'test-user-id-1',
|
|
1031
|
-
view: { aliasEmails: [], icon:
|
|
1097
|
+
view: { aliasEmails: [], icon: CustomViewIcon.STAR, id: 'test-view-id-1', name: 'test-view-name-1' },
|
|
1032
1098
|
};
|
|
1033
1099
|
const result = v.safeParse(mutatorSchemas.user.updateView, args);
|
|
1034
1100
|
expect(result.success).toBe(false);
|
|
@@ -1043,7 +1109,7 @@ describe('mutators', () => {
|
|
|
1043
1109
|
expect(result.success).toBe(true);
|
|
1044
1110
|
});
|
|
1045
1111
|
}
|
|
1046
|
-
it('schema
|
|
1112
|
+
it('schema rejects null icon value', () => {
|
|
1047
1113
|
const args = {
|
|
1048
1114
|
id: 'test-user-id-1',
|
|
1049
1115
|
view: {
|
|
@@ -1054,7 +1120,7 @@ describe('mutators', () => {
|
|
|
1054
1120
|
},
|
|
1055
1121
|
};
|
|
1056
1122
|
const result = v.safeParse(mutatorSchemas.user.updateView, args);
|
|
1057
|
-
expect(result.success).toBe(
|
|
1123
|
+
expect(result.success).toBe(false);
|
|
1058
1124
|
});
|
|
1059
1125
|
it('schema rejects invalid icon value', () => {
|
|
1060
1126
|
const args = {
|
package/dist/zero/queries.d.ts
CHANGED
|
@@ -271,7 +271,7 @@ export declare const queries: import("@rocicorp/zero").QueryRegistry<{
|
|
|
271
271
|
id: string;
|
|
272
272
|
name: string;
|
|
273
273
|
aliasEmails: string[];
|
|
274
|
-
icon: import("../types").CustomViewIcon
|
|
274
|
+
icon: import("../types").CustomViewIcon;
|
|
275
275
|
}[];
|
|
276
276
|
} & {
|
|
277
277
|
readonly accounts: readonly ({
|
|
@@ -358,7 +358,7 @@ export declare const queries: import("@rocicorp/zero").QueryRegistry<{
|
|
|
358
358
|
id: string;
|
|
359
359
|
name: string;
|
|
360
360
|
aliasEmails: string[];
|
|
361
|
-
icon: import("../types").CustomViewIcon
|
|
361
|
+
icon: import("../types").CustomViewIcon;
|
|
362
362
|
}[];
|
|
363
363
|
};
|
|
364
364
|
};
|
package/dist/zero/schema.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export declare const schema: {
|
|
|
39
39
|
id: string;
|
|
40
40
|
name: string;
|
|
41
41
|
aliasEmails: string[];
|
|
42
|
-
icon: CustomViewIcon
|
|
42
|
+
icon: CustomViewIcon;
|
|
43
43
|
}[];
|
|
44
44
|
};
|
|
45
45
|
};
|
|
@@ -1777,7 +1777,7 @@ export declare const tables: {
|
|
|
1777
1777
|
id: string;
|
|
1778
1778
|
name: string;
|
|
1779
1779
|
aliasEmails: string[];
|
|
1780
|
-
icon: CustomViewIcon
|
|
1780
|
+
icon: CustomViewIcon;
|
|
1781
1781
|
}[];
|
|
1782
1782
|
};
|
|
1783
1783
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/zero/schema.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,cAAc,EAOf,MAAM,qBAAqB,CAAA;AAkb5B,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAvaL,MAAM;8BACJ,MAAM;qCACC,MAAM,EAAE;8BACf,cAAc
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/zero/schema.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,cAAc,EAOf,MAAM,qBAAqB,CAAA;AAkb5B,eAAO,MAAM,MAAM;;;;;;;;;;;;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