@marcoappio/marco-config 2.0.524 → 2.0.526
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/constants/index.d.ts +7 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +2 -0
- package/dist/constants/user.d.ts +8 -0
- package/dist/constants/user.d.ts.map +1 -0
- package/dist/constants/user.js +7 -0
- package/dist/zero/index.d.ts +56 -0
- package/dist/zero/index.d.ts.map +1 -1
- package/dist/zero/mutatorSchemas.d.ts +8 -0
- package/dist/zero/mutatorSchemas.d.ts.map +1 -1
- package/dist/zero/mutatorSchemas.js +4 -0
- package/dist/zero/mutators.d.ts +48 -0
- package/dist/zero/mutators.d.ts.map +1 -1
- package/dist/zero/mutators.js +67 -29
- package/dist/zero/mutators.test.js +72 -0
- package/package.json +1 -1
|
@@ -42,6 +42,13 @@ export declare const marcoConstants: {
|
|
|
42
42
|
};
|
|
43
43
|
readonly redirectPath: "/v1/wh/oauth/callback";
|
|
44
44
|
};
|
|
45
|
+
user: {
|
|
46
|
+
profilePicture: {
|
|
47
|
+
allowedMimeTypes: string[];
|
|
48
|
+
maxDimension: number;
|
|
49
|
+
maxFileSize: number;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
45
52
|
zero: {
|
|
46
53
|
mutateURL: string;
|
|
47
54
|
queryURL: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQ1B,CAAA"}
|
package/dist/constants/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { emailAccounts } from './emailAccounts';
|
|
|
3
3
|
import { emailProvider } from './emailProvider';
|
|
4
4
|
import { messages } from './messages';
|
|
5
5
|
import { oauth } from './oauth';
|
|
6
|
+
import { user } from './user';
|
|
6
7
|
import { zero } from './zero';
|
|
7
8
|
export const marcoConstants = {
|
|
8
9
|
api,
|
|
@@ -10,5 +11,6 @@ export const marcoConstants = {
|
|
|
10
11
|
emailProvider,
|
|
11
12
|
messages,
|
|
12
13
|
oauth,
|
|
14
|
+
user,
|
|
13
15
|
zero,
|
|
14
16
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/constants/user.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI;;;;;;CAMhB,CAAA"}
|
package/dist/zero/index.d.ts
CHANGED
|
@@ -196,22 +196,26 @@ export declare const marcoZero: {
|
|
|
196
196
|
readonly threadIds: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
197
197
|
}, undefined>, undefined>;
|
|
198
198
|
readonly labelPath: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
199
|
+
readonly labelUnreadCounts: import("valibot").OptionalSchema<import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").NumberSchema<undefined>, undefined>, undefined>;
|
|
199
200
|
}, undefined>;
|
|
200
201
|
delete: import("valibot").ObjectSchema<{
|
|
201
202
|
readonly accounts: import("valibot").RecordSchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, import("valibot").ObjectSchema<{
|
|
202
203
|
readonly threadIds: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
203
204
|
}, undefined>, undefined>;
|
|
205
|
+
readonly labelUnreadCounts: import("valibot").OptionalSchema<import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").NumberSchema<undefined>, undefined>, undefined>;
|
|
204
206
|
}, undefined>;
|
|
205
207
|
removeLabel: import("valibot").ObjectSchema<{
|
|
206
208
|
readonly accounts: import("valibot").RecordSchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, import("valibot").ObjectSchema<{
|
|
207
209
|
readonly threadIds: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
208
210
|
}, undefined>, undefined>;
|
|
209
211
|
readonly labelPath: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
212
|
+
readonly labelUnreadCounts: import("valibot").OptionalSchema<import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").NumberSchema<undefined>, undefined>, undefined>;
|
|
210
213
|
}, undefined>;
|
|
211
214
|
setArchive: import("valibot").ObjectSchema<{
|
|
212
215
|
readonly accounts: import("valibot").RecordSchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, import("valibot").ObjectSchema<{
|
|
213
216
|
readonly threadIds: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
214
217
|
}, undefined>, undefined>;
|
|
218
|
+
readonly labelUnreadCounts: import("valibot").OptionalSchema<import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").NumberSchema<undefined>, undefined>, undefined>;
|
|
215
219
|
}, undefined>;
|
|
216
220
|
setFlagged: import("valibot").ObjectSchema<{
|
|
217
221
|
readonly accounts: import("valibot").RecordSchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, import("valibot").ObjectSchema<{
|
|
@@ -223,22 +227,26 @@ export declare const marcoZero: {
|
|
|
223
227
|
readonly accounts: import("valibot").RecordSchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, import("valibot").ObjectSchema<{
|
|
224
228
|
readonly threadIds: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
225
229
|
}, undefined>, undefined>;
|
|
230
|
+
readonly labelUnreadCounts: import("valibot").OptionalSchema<import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").NumberSchema<undefined>, undefined>, undefined>;
|
|
226
231
|
}, undefined>;
|
|
227
232
|
setSeen: import("valibot").ObjectSchema<{
|
|
228
233
|
readonly accounts: import("valibot").RecordSchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, import("valibot").ObjectSchema<{
|
|
229
234
|
readonly threadIds: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
230
235
|
}, undefined>, undefined>;
|
|
236
|
+
readonly labelUnreadCounts: import("valibot").OptionalSchema<import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").NumberSchema<undefined>, undefined>, undefined>;
|
|
231
237
|
readonly seen: import("valibot").BooleanSchema<undefined>;
|
|
232
238
|
}, undefined>;
|
|
233
239
|
setSpam: import("valibot").ObjectSchema<{
|
|
234
240
|
readonly accounts: import("valibot").RecordSchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, import("valibot").ObjectSchema<{
|
|
235
241
|
readonly threadIds: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
236
242
|
}, undefined>, undefined>;
|
|
243
|
+
readonly labelUnreadCounts: import("valibot").OptionalSchema<import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").NumberSchema<undefined>, undefined>, undefined>;
|
|
237
244
|
}, undefined>;
|
|
238
245
|
setTrash: import("valibot").ObjectSchema<{
|
|
239
246
|
readonly accounts: import("valibot").RecordSchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, import("valibot").ObjectSchema<{
|
|
240
247
|
readonly threadIds: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
241
248
|
}, undefined>, undefined>;
|
|
249
|
+
readonly labelUnreadCounts: import("valibot").OptionalSchema<import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").NumberSchema<undefined>, undefined>, undefined>;
|
|
242
250
|
}, undefined>;
|
|
243
251
|
};
|
|
244
252
|
user: {
|
|
@@ -581,6 +589,9 @@ export declare const marcoZero: {
|
|
|
581
589
|
};
|
|
582
590
|
};
|
|
583
591
|
labelPath: string;
|
|
592
|
+
labelUnreadCounts?: {
|
|
593
|
+
[x: string]: number;
|
|
594
|
+
} | undefined;
|
|
584
595
|
}, {
|
|
585
596
|
accounts: {
|
|
586
597
|
[x: string]: {
|
|
@@ -588,6 +599,9 @@ export declare const marcoZero: {
|
|
|
588
599
|
};
|
|
589
600
|
};
|
|
590
601
|
labelPath: string;
|
|
602
|
+
labelUnreadCounts?: {
|
|
603
|
+
[x: string]: number;
|
|
604
|
+
} | undefined;
|
|
591
605
|
}, {
|
|
592
606
|
userId: string;
|
|
593
607
|
}, unknown>;
|
|
@@ -597,12 +611,18 @@ export declare const marcoZero: {
|
|
|
597
611
|
threadIds: string[];
|
|
598
612
|
};
|
|
599
613
|
};
|
|
614
|
+
labelUnreadCounts?: {
|
|
615
|
+
[x: string]: number;
|
|
616
|
+
} | undefined;
|
|
600
617
|
}, {
|
|
601
618
|
accounts: {
|
|
602
619
|
[x: string]: {
|
|
603
620
|
threadIds: string[];
|
|
604
621
|
};
|
|
605
622
|
};
|
|
623
|
+
labelUnreadCounts?: {
|
|
624
|
+
[x: string]: number;
|
|
625
|
+
} | undefined;
|
|
606
626
|
}, {
|
|
607
627
|
userId: string;
|
|
608
628
|
}, unknown>;
|
|
@@ -613,6 +633,9 @@ export declare const marcoZero: {
|
|
|
613
633
|
};
|
|
614
634
|
};
|
|
615
635
|
labelPath: string;
|
|
636
|
+
labelUnreadCounts?: {
|
|
637
|
+
[x: string]: number;
|
|
638
|
+
} | undefined;
|
|
616
639
|
}, {
|
|
617
640
|
accounts: {
|
|
618
641
|
[x: string]: {
|
|
@@ -620,6 +643,9 @@ export declare const marcoZero: {
|
|
|
620
643
|
};
|
|
621
644
|
};
|
|
622
645
|
labelPath: string;
|
|
646
|
+
labelUnreadCounts?: {
|
|
647
|
+
[x: string]: number;
|
|
648
|
+
} | undefined;
|
|
623
649
|
}, {
|
|
624
650
|
userId: string;
|
|
625
651
|
}, unknown>;
|
|
@@ -629,12 +655,18 @@ export declare const marcoZero: {
|
|
|
629
655
|
threadIds: string[];
|
|
630
656
|
};
|
|
631
657
|
};
|
|
658
|
+
labelUnreadCounts?: {
|
|
659
|
+
[x: string]: number;
|
|
660
|
+
} | undefined;
|
|
632
661
|
}, {
|
|
633
662
|
accounts: {
|
|
634
663
|
[x: string]: {
|
|
635
664
|
threadIds: string[];
|
|
636
665
|
};
|
|
637
666
|
};
|
|
667
|
+
labelUnreadCounts?: {
|
|
668
|
+
[x: string]: number;
|
|
669
|
+
} | undefined;
|
|
638
670
|
}, {
|
|
639
671
|
userId: string;
|
|
640
672
|
}, unknown>;
|
|
@@ -661,12 +693,18 @@ export declare const marcoZero: {
|
|
|
661
693
|
threadIds: string[];
|
|
662
694
|
};
|
|
663
695
|
};
|
|
696
|
+
labelUnreadCounts?: {
|
|
697
|
+
[x: string]: number;
|
|
698
|
+
} | undefined;
|
|
664
699
|
}, {
|
|
665
700
|
accounts: {
|
|
666
701
|
[x: string]: {
|
|
667
702
|
threadIds: string[];
|
|
668
703
|
};
|
|
669
704
|
};
|
|
705
|
+
labelUnreadCounts?: {
|
|
706
|
+
[x: string]: number;
|
|
707
|
+
} | undefined;
|
|
670
708
|
}, {
|
|
671
709
|
userId: string;
|
|
672
710
|
}, unknown>;
|
|
@@ -676,6 +714,9 @@ export declare const marcoZero: {
|
|
|
676
714
|
threadIds: string[];
|
|
677
715
|
};
|
|
678
716
|
};
|
|
717
|
+
labelUnreadCounts?: {
|
|
718
|
+
[x: string]: number;
|
|
719
|
+
} | undefined;
|
|
679
720
|
seen: boolean;
|
|
680
721
|
}, {
|
|
681
722
|
accounts: {
|
|
@@ -683,6 +724,9 @@ export declare const marcoZero: {
|
|
|
683
724
|
threadIds: string[];
|
|
684
725
|
};
|
|
685
726
|
};
|
|
727
|
+
labelUnreadCounts?: {
|
|
728
|
+
[x: string]: number;
|
|
729
|
+
} | undefined;
|
|
686
730
|
seen: boolean;
|
|
687
731
|
}, {
|
|
688
732
|
userId: string;
|
|
@@ -693,12 +737,18 @@ export declare const marcoZero: {
|
|
|
693
737
|
threadIds: string[];
|
|
694
738
|
};
|
|
695
739
|
};
|
|
740
|
+
labelUnreadCounts?: {
|
|
741
|
+
[x: string]: number;
|
|
742
|
+
} | undefined;
|
|
696
743
|
}, {
|
|
697
744
|
accounts: {
|
|
698
745
|
[x: string]: {
|
|
699
746
|
threadIds: string[];
|
|
700
747
|
};
|
|
701
748
|
};
|
|
749
|
+
labelUnreadCounts?: {
|
|
750
|
+
[x: string]: number;
|
|
751
|
+
} | undefined;
|
|
702
752
|
}, {
|
|
703
753
|
userId: string;
|
|
704
754
|
}, unknown>;
|
|
@@ -708,12 +758,18 @@ export declare const marcoZero: {
|
|
|
708
758
|
threadIds: string[];
|
|
709
759
|
};
|
|
710
760
|
};
|
|
761
|
+
labelUnreadCounts?: {
|
|
762
|
+
[x: string]: number;
|
|
763
|
+
} | undefined;
|
|
711
764
|
}, {
|
|
712
765
|
accounts: {
|
|
713
766
|
[x: string]: {
|
|
714
767
|
threadIds: string[];
|
|
715
768
|
};
|
|
716
769
|
};
|
|
770
|
+
labelUnreadCounts?: {
|
|
771
|
+
[x: string]: number;
|
|
772
|
+
} | undefined;
|
|
717
773
|
}, {
|
|
718
774
|
userId: string;
|
|
719
775
|
}, unknown>;
|
package/dist/zero/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/zero/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/zero/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMZ,CAAA"}
|
|
@@ -196,22 +196,26 @@ export declare const mutatorSchemas: {
|
|
|
196
196
|
readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
197
197
|
}, undefined>, undefined>;
|
|
198
198
|
readonly labelPath: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
199
|
+
readonly labelUnreadCounts: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.NumberSchema<undefined>, undefined>, undefined>;
|
|
199
200
|
}, undefined>;
|
|
200
201
|
delete: v.ObjectSchema<{
|
|
201
202
|
readonly accounts: v.RecordSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, v.ObjectSchema<{
|
|
202
203
|
readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
203
204
|
}, undefined>, undefined>;
|
|
205
|
+
readonly labelUnreadCounts: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.NumberSchema<undefined>, undefined>, undefined>;
|
|
204
206
|
}, undefined>;
|
|
205
207
|
removeLabel: v.ObjectSchema<{
|
|
206
208
|
readonly accounts: v.RecordSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, v.ObjectSchema<{
|
|
207
209
|
readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
208
210
|
}, undefined>, undefined>;
|
|
209
211
|
readonly labelPath: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
212
|
+
readonly labelUnreadCounts: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.NumberSchema<undefined>, undefined>, undefined>;
|
|
210
213
|
}, undefined>;
|
|
211
214
|
setArchive: v.ObjectSchema<{
|
|
212
215
|
readonly accounts: v.RecordSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, v.ObjectSchema<{
|
|
213
216
|
readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
214
217
|
}, undefined>, undefined>;
|
|
218
|
+
readonly labelUnreadCounts: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.NumberSchema<undefined>, undefined>, undefined>;
|
|
215
219
|
}, undefined>;
|
|
216
220
|
setFlagged: v.ObjectSchema<{
|
|
217
221
|
readonly accounts: v.RecordSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, v.ObjectSchema<{
|
|
@@ -223,22 +227,26 @@ export declare const mutatorSchemas: {
|
|
|
223
227
|
readonly accounts: v.RecordSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, v.ObjectSchema<{
|
|
224
228
|
readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
225
229
|
}, undefined>, undefined>;
|
|
230
|
+
readonly labelUnreadCounts: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.NumberSchema<undefined>, undefined>, undefined>;
|
|
226
231
|
}, undefined>;
|
|
227
232
|
setSeen: v.ObjectSchema<{
|
|
228
233
|
readonly accounts: v.RecordSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, v.ObjectSchema<{
|
|
229
234
|
readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
230
235
|
}, undefined>, undefined>;
|
|
236
|
+
readonly labelUnreadCounts: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.NumberSchema<undefined>, undefined>, undefined>;
|
|
231
237
|
readonly seen: v.BooleanSchema<undefined>;
|
|
232
238
|
}, undefined>;
|
|
233
239
|
setSpam: v.ObjectSchema<{
|
|
234
240
|
readonly accounts: v.RecordSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, v.ObjectSchema<{
|
|
235
241
|
readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
236
242
|
}, undefined>, undefined>;
|
|
243
|
+
readonly labelUnreadCounts: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.NumberSchema<undefined>, undefined>, undefined>;
|
|
237
244
|
}, undefined>;
|
|
238
245
|
setTrash: v.ObjectSchema<{
|
|
239
246
|
readonly accounts: v.RecordSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, v.ObjectSchema<{
|
|
240
247
|
readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
241
248
|
}, undefined>, undefined>;
|
|
249
|
+
readonly labelUnreadCounts: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.NumberSchema<undefined>, undefined>, undefined>;
|
|
242
250
|
}, undefined>;
|
|
243
251
|
};
|
|
244
252
|
user: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutatorSchemas.d.ts","sourceRoot":"","sources":["../../src/zero/mutatorSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"mutatorSchemas.d.ts","sourceRoot":"","sources":["../../src/zero/mutatorSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAyE5B,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2I1B,CAAA"}
|
|
@@ -10,12 +10,15 @@ const accountAliasSchema = v.object({
|
|
|
10
10
|
const accountsSchema = v.record(marcoSchemas.string.required(), v.object({
|
|
11
11
|
threadIds: v.array(marcoSchemas.string.required()),
|
|
12
12
|
}));
|
|
13
|
+
const labelUnreadCountsSchema = v.optional(v.record(v.string(), v.number()));
|
|
13
14
|
const baseThreadSchema = v.object({
|
|
14
15
|
accounts: accountsSchema,
|
|
16
|
+
labelUnreadCounts: labelUnreadCountsSchema,
|
|
15
17
|
});
|
|
16
18
|
const threadChangeLabelSchema = v.object({
|
|
17
19
|
accounts: accountsSchema,
|
|
18
20
|
labelPath: marcoSchemas.string.required(),
|
|
21
|
+
labelUnreadCounts: labelUnreadCountsSchema,
|
|
19
22
|
});
|
|
20
23
|
const draftBodySchema = v.object({
|
|
21
24
|
bcc: v.array(marcoSchemas.string.email()),
|
|
@@ -172,6 +175,7 @@ export const mutatorSchemas = {
|
|
|
172
175
|
setInbox: baseThreadSchema,
|
|
173
176
|
setSeen: v.object({
|
|
174
177
|
accounts: accountsSchema,
|
|
178
|
+
labelUnreadCounts: labelUnreadCountsSchema,
|
|
175
179
|
seen: v.boolean(),
|
|
176
180
|
}),
|
|
177
181
|
setSpam: baseThreadSchema,
|
package/dist/zero/mutators.d.ts
CHANGED
|
@@ -286,6 +286,9 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
286
286
|
};
|
|
287
287
|
};
|
|
288
288
|
labelPath: string;
|
|
289
|
+
labelUnreadCounts?: {
|
|
290
|
+
[x: string]: number;
|
|
291
|
+
} | undefined;
|
|
289
292
|
}, {
|
|
290
293
|
accounts: {
|
|
291
294
|
[x: string]: {
|
|
@@ -293,6 +296,9 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
293
296
|
};
|
|
294
297
|
};
|
|
295
298
|
labelPath: string;
|
|
299
|
+
labelUnreadCounts?: {
|
|
300
|
+
[x: string]: number;
|
|
301
|
+
} | undefined;
|
|
296
302
|
}, Context, unknown>;
|
|
297
303
|
readonly delete: import("@rocicorp/zero").MutatorDefinition<{
|
|
298
304
|
accounts: {
|
|
@@ -300,12 +306,18 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
300
306
|
threadIds: string[];
|
|
301
307
|
};
|
|
302
308
|
};
|
|
309
|
+
labelUnreadCounts?: {
|
|
310
|
+
[x: string]: number;
|
|
311
|
+
} | undefined;
|
|
303
312
|
}, {
|
|
304
313
|
accounts: {
|
|
305
314
|
[x: string]: {
|
|
306
315
|
threadIds: string[];
|
|
307
316
|
};
|
|
308
317
|
};
|
|
318
|
+
labelUnreadCounts?: {
|
|
319
|
+
[x: string]: number;
|
|
320
|
+
} | undefined;
|
|
309
321
|
}, Context, unknown>;
|
|
310
322
|
readonly removeLabel: import("@rocicorp/zero").MutatorDefinition<{
|
|
311
323
|
accounts: {
|
|
@@ -314,6 +326,9 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
314
326
|
};
|
|
315
327
|
};
|
|
316
328
|
labelPath: string;
|
|
329
|
+
labelUnreadCounts?: {
|
|
330
|
+
[x: string]: number;
|
|
331
|
+
} | undefined;
|
|
317
332
|
}, {
|
|
318
333
|
accounts: {
|
|
319
334
|
[x: string]: {
|
|
@@ -321,6 +336,9 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
321
336
|
};
|
|
322
337
|
};
|
|
323
338
|
labelPath: string;
|
|
339
|
+
labelUnreadCounts?: {
|
|
340
|
+
[x: string]: number;
|
|
341
|
+
} | undefined;
|
|
324
342
|
}, Context, unknown>;
|
|
325
343
|
readonly setArchive: import("@rocicorp/zero").MutatorDefinition<{
|
|
326
344
|
accounts: {
|
|
@@ -328,12 +346,18 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
328
346
|
threadIds: string[];
|
|
329
347
|
};
|
|
330
348
|
};
|
|
349
|
+
labelUnreadCounts?: {
|
|
350
|
+
[x: string]: number;
|
|
351
|
+
} | undefined;
|
|
331
352
|
}, {
|
|
332
353
|
accounts: {
|
|
333
354
|
[x: string]: {
|
|
334
355
|
threadIds: string[];
|
|
335
356
|
};
|
|
336
357
|
};
|
|
358
|
+
labelUnreadCounts?: {
|
|
359
|
+
[x: string]: number;
|
|
360
|
+
} | undefined;
|
|
337
361
|
}, Context, unknown>;
|
|
338
362
|
readonly setFlagged: import("@rocicorp/zero").MutatorDefinition<{
|
|
339
363
|
accounts: {
|
|
@@ -356,12 +380,18 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
356
380
|
threadIds: string[];
|
|
357
381
|
};
|
|
358
382
|
};
|
|
383
|
+
labelUnreadCounts?: {
|
|
384
|
+
[x: string]: number;
|
|
385
|
+
} | undefined;
|
|
359
386
|
}, {
|
|
360
387
|
accounts: {
|
|
361
388
|
[x: string]: {
|
|
362
389
|
threadIds: string[];
|
|
363
390
|
};
|
|
364
391
|
};
|
|
392
|
+
labelUnreadCounts?: {
|
|
393
|
+
[x: string]: number;
|
|
394
|
+
} | undefined;
|
|
365
395
|
}, Context, unknown>;
|
|
366
396
|
readonly setSeen: import("@rocicorp/zero").MutatorDefinition<{
|
|
367
397
|
accounts: {
|
|
@@ -369,6 +399,9 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
369
399
|
threadIds: string[];
|
|
370
400
|
};
|
|
371
401
|
};
|
|
402
|
+
labelUnreadCounts?: {
|
|
403
|
+
[x: string]: number;
|
|
404
|
+
} | undefined;
|
|
372
405
|
seen: boolean;
|
|
373
406
|
}, {
|
|
374
407
|
accounts: {
|
|
@@ -376,6 +409,9 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
376
409
|
threadIds: string[];
|
|
377
410
|
};
|
|
378
411
|
};
|
|
412
|
+
labelUnreadCounts?: {
|
|
413
|
+
[x: string]: number;
|
|
414
|
+
} | undefined;
|
|
379
415
|
seen: boolean;
|
|
380
416
|
}, Context, unknown>;
|
|
381
417
|
readonly setSpam: import("@rocicorp/zero").MutatorDefinition<{
|
|
@@ -384,12 +420,18 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
384
420
|
threadIds: string[];
|
|
385
421
|
};
|
|
386
422
|
};
|
|
423
|
+
labelUnreadCounts?: {
|
|
424
|
+
[x: string]: number;
|
|
425
|
+
} | undefined;
|
|
387
426
|
}, {
|
|
388
427
|
accounts: {
|
|
389
428
|
[x: string]: {
|
|
390
429
|
threadIds: string[];
|
|
391
430
|
};
|
|
392
431
|
};
|
|
432
|
+
labelUnreadCounts?: {
|
|
433
|
+
[x: string]: number;
|
|
434
|
+
} | undefined;
|
|
393
435
|
}, Context, unknown>;
|
|
394
436
|
readonly setTrash: import("@rocicorp/zero").MutatorDefinition<{
|
|
395
437
|
accounts: {
|
|
@@ -397,12 +439,18 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
397
439
|
threadIds: string[];
|
|
398
440
|
};
|
|
399
441
|
};
|
|
442
|
+
labelUnreadCounts?: {
|
|
443
|
+
[x: string]: number;
|
|
444
|
+
} | undefined;
|
|
400
445
|
}, {
|
|
401
446
|
accounts: {
|
|
402
447
|
[x: string]: {
|
|
403
448
|
threadIds: string[];
|
|
404
449
|
};
|
|
405
450
|
};
|
|
451
|
+
labelUnreadCounts?: {
|
|
452
|
+
[x: string]: number;
|
|
453
|
+
} | undefined;
|
|
406
454
|
}, Context, unknown>;
|
|
407
455
|
};
|
|
408
456
|
readonly user: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutators.d.ts","sourceRoot":"","sources":["../../src/zero/mutators.ts"],"names":[],"mappings":"AAQA,KAAK,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"mutators.d.ts","sourceRoot":"","sources":["../../src/zero/mutators.ts"],"names":[],"mappings":"AAQA,KAAK,OAAO,GAAG;IAAE,MAAM,EAAE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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiiBnB,CAAA"}
|
package/dist/zero/mutators.js
CHANGED
|
@@ -6,7 +6,7 @@ import { schema } from '../zero/schema';
|
|
|
6
6
|
const zql = createBuilder(schema);
|
|
7
7
|
const defineMutator = defineMutatorWithType();
|
|
8
8
|
const buildLabelIdList = (x) => (x.length === 0 ? '' : ` ${[...new Set(x)].join(' ')} `);
|
|
9
|
-
const setSystemLabel = async (tx, builder, threadId, targetSpecialUse) => {
|
|
9
|
+
const setSystemLabel = async (tx, builder, threadId, targetSpecialUse, labelUnreadCounts) => {
|
|
10
10
|
const thread = await tx.run(builder.thread.where('id', threadId).one());
|
|
11
11
|
if (thread) {
|
|
12
12
|
const [targetLabel, messages] = await Promise.all([
|
|
@@ -33,11 +33,19 @@ const setSystemLabel = async (tx, builder, threadId, targetSpecialUse) => {
|
|
|
33
33
|
...[...labelIdsToRemove].map(labelId => tx.mutate.threadByLabel.delete({ labelId, threadId })),
|
|
34
34
|
]);
|
|
35
35
|
if (thread.seen === false && labelIdsToRemove.size > 0) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
if (labelUnreadCounts) {
|
|
37
|
+
await Promise.all([...labelIdsToRemove].map(labelId => tx.mutate.accountLabel.update({
|
|
38
|
+
id: labelId,
|
|
39
|
+
unreadCount: labelUnreadCounts[labelId] ?? 0,
|
|
40
|
+
})));
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
const labelsToUpdate = await tx.run(builder.accountLabel.where('id', 'IN', [...labelIdsToRemove]));
|
|
44
|
+
await Promise.all(labelsToUpdate.map(label => tx.mutate.accountLabel.update({
|
|
45
|
+
id: label.id,
|
|
46
|
+
unreadCount: Math.max(0, (label.unreadCount ?? 0) - 1),
|
|
47
|
+
})));
|
|
48
|
+
}
|
|
41
49
|
}
|
|
42
50
|
if (!hasTarget) {
|
|
43
51
|
const baseTimestamp = Date.now();
|
|
@@ -60,7 +68,9 @@ const setSystemLabel = async (tx, builder, threadId, targetSpecialUse) => {
|
|
|
60
68
|
? [
|
|
61
69
|
tx.mutate.accountLabel.update({
|
|
62
70
|
id: targetLabel.id,
|
|
63
|
-
unreadCount:
|
|
71
|
+
unreadCount: labelUnreadCounts
|
|
72
|
+
? (labelUnreadCounts[targetLabel.id] ?? 0)
|
|
73
|
+
: (targetLabel.unreadCount ?? 0) + 1,
|
|
64
74
|
}),
|
|
65
75
|
]
|
|
66
76
|
: []),
|
|
@@ -329,7 +339,9 @@ export const mutators = defineMutators({
|
|
|
329
339
|
? [
|
|
330
340
|
tx.mutate.accountLabel.update({
|
|
331
341
|
id: label.id,
|
|
332
|
-
unreadCount:
|
|
342
|
+
unreadCount: args.labelUnreadCounts
|
|
343
|
+
? (args.labelUnreadCounts[label.id] ?? 0)
|
|
344
|
+
: (label.unreadCount ?? 0) + 1,
|
|
333
345
|
}),
|
|
334
346
|
]
|
|
335
347
|
: []),
|
|
@@ -367,11 +379,19 @@ export const mutators = defineMutators({
|
|
|
367
379
|
if (thread.seen === false) {
|
|
368
380
|
const labelIds = threadsUtils.parseLabelIdList(thread.labelIdList);
|
|
369
381
|
if (labelIds.length > 0) {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
382
|
+
if (args.labelUnreadCounts) {
|
|
383
|
+
await Promise.all(labelIds.map(labelId => tx.mutate.accountLabel.update({
|
|
384
|
+
id: labelId,
|
|
385
|
+
unreadCount: args.labelUnreadCounts?.[labelId] ?? 0,
|
|
386
|
+
})));
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
const labels = await tx.run(zql.accountLabel.where('id', 'IN', labelIds));
|
|
390
|
+
await Promise.all(labels.map(x => tx.mutate.accountLabel.update({
|
|
391
|
+
id: x.id,
|
|
392
|
+
unreadCount: Math.max(0, (x.unreadCount ?? 0) - 1),
|
|
393
|
+
})));
|
|
394
|
+
}
|
|
375
395
|
}
|
|
376
396
|
}
|
|
377
397
|
await tx.mutate.thread.delete({
|
|
@@ -408,7 +428,9 @@ export const mutators = defineMutators({
|
|
|
408
428
|
? [
|
|
409
429
|
tx.mutate.accountLabel.update({
|
|
410
430
|
id: label.id,
|
|
411
|
-
unreadCount:
|
|
431
|
+
unreadCount: args.labelUnreadCounts
|
|
432
|
+
? (args.labelUnreadCounts[label.id] ?? 0)
|
|
433
|
+
: Math.max(0, (label.unreadCount ?? 0) - 1),
|
|
412
434
|
}),
|
|
413
435
|
]
|
|
414
436
|
: []),
|
|
@@ -426,7 +448,7 @@ export const mutators = defineMutators({
|
|
|
426
448
|
setArchive: defineMutator(mutatorSchemas.thread.setArchive, async ({ tx, args }) => {
|
|
427
449
|
for (const [, { threadIds }] of Object.entries(args.accounts)) {
|
|
428
450
|
for (const threadId of threadIds) {
|
|
429
|
-
await setSystemLabel(tx, zql, threadId, 'ARCHIVE');
|
|
451
|
+
await setSystemLabel(tx, zql, threadId, 'ARCHIVE', args.labelUnreadCounts);
|
|
430
452
|
}
|
|
431
453
|
}
|
|
432
454
|
}),
|
|
@@ -441,30 +463,46 @@ export const mutators = defineMutators({
|
|
|
441
463
|
setInbox: defineMutator(mutatorSchemas.thread.setInbox, async ({ tx, args }) => {
|
|
442
464
|
for (const [, { threadIds }] of Object.entries(args.accounts)) {
|
|
443
465
|
for (const threadId of threadIds) {
|
|
444
|
-
await setSystemLabel(tx, zql, threadId, 'INBOX');
|
|
466
|
+
await setSystemLabel(tx, zql, threadId, 'INBOX', args.labelUnreadCounts);
|
|
445
467
|
}
|
|
446
468
|
}
|
|
447
469
|
}),
|
|
448
470
|
setSeen: defineMutator(mutatorSchemas.thread.setSeen, async ({ tx, args }) => {
|
|
449
471
|
const allThreadIds = Object.values(args.accounts).flatMap(x => x.threadIds);
|
|
450
472
|
const threads = await tx.run(zql.thread.where('id', 'IN', allThreadIds));
|
|
451
|
-
const
|
|
473
|
+
const affectedLabelIds = new Set();
|
|
452
474
|
for (const thread of threads) {
|
|
453
475
|
if (thread.seen !== args.seen) {
|
|
454
476
|
for (const labelId of threadsUtils.parseLabelIdList(thread.labelIdList)) {
|
|
455
|
-
|
|
477
|
+
affectedLabelIds.add(labelId);
|
|
456
478
|
}
|
|
457
479
|
}
|
|
458
480
|
}
|
|
459
|
-
if (
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
481
|
+
if (affectedLabelIds.size > 0) {
|
|
482
|
+
if (args.labelUnreadCounts) {
|
|
483
|
+
await Promise.all([...affectedLabelIds].map(labelId => tx.mutate.accountLabel.update({
|
|
484
|
+
id: labelId,
|
|
485
|
+
unreadCount: args.labelUnreadCounts?.[labelId] ?? 0,
|
|
486
|
+
})));
|
|
487
|
+
}
|
|
488
|
+
else {
|
|
489
|
+
const labelCounts = new Map();
|
|
490
|
+
for (const thread of threads) {
|
|
491
|
+
if (thread.seen !== args.seen) {
|
|
492
|
+
for (const labelId of threadsUtils.parseLabelIdList(thread.labelIdList)) {
|
|
493
|
+
labelCounts.set(labelId, (labelCounts.get(labelId) ?? 0) + 1);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
const labels = await tx.run(zql.accountLabel.where('id', 'IN', [...labelCounts.keys()]));
|
|
498
|
+
const delta = args.seen ? -1 : 1;
|
|
499
|
+
await Promise.all(labels
|
|
500
|
+
.filter(x => labelCounts.has(x.id))
|
|
501
|
+
.map(x => tx.mutate.accountLabel.update({
|
|
502
|
+
id: x.id,
|
|
503
|
+
unreadCount: Math.max(0, (x.unreadCount ?? 0) + delta * (labelCounts.get(x.id) ?? 0)),
|
|
504
|
+
})));
|
|
505
|
+
}
|
|
468
506
|
}
|
|
469
507
|
await Promise.all(allThreadIds.map(threadId => tx.mutate.thread.update({
|
|
470
508
|
id: threadId,
|
|
@@ -474,14 +512,14 @@ export const mutators = defineMutators({
|
|
|
474
512
|
setSpam: defineMutator(mutatorSchemas.thread.setSpam, async ({ tx, args }) => {
|
|
475
513
|
for (const [, { threadIds }] of Object.entries(args.accounts)) {
|
|
476
514
|
for (const threadId of threadIds) {
|
|
477
|
-
await setSystemLabel(tx, zql, threadId, 'SPAM');
|
|
515
|
+
await setSystemLabel(tx, zql, threadId, 'SPAM', args.labelUnreadCounts);
|
|
478
516
|
}
|
|
479
517
|
}
|
|
480
518
|
}),
|
|
481
519
|
setTrash: defineMutator(mutatorSchemas.thread.setTrash, async ({ tx, args }) => {
|
|
482
520
|
for (const [, { threadIds }] of Object.entries(args.accounts)) {
|
|
483
521
|
for (const threadId of threadIds) {
|
|
484
|
-
await setSystemLabel(tx, zql, threadId, 'TRASH');
|
|
522
|
+
await setSystemLabel(tx, zql, threadId, 'TRASH', args.labelUnreadCounts);
|
|
485
523
|
}
|
|
486
524
|
}
|
|
487
525
|
}),
|
|
@@ -440,6 +440,25 @@ describe('mutators', () => {
|
|
|
440
440
|
expect(tx.mutate.thread.update).not.toHaveBeenCalled();
|
|
441
441
|
expect(tx.mutate.threadByLabel.insert).not.toHaveBeenCalled();
|
|
442
442
|
});
|
|
443
|
+
it('uses pre-computed labelUnreadCounts when provided', async () => {
|
|
444
|
+
tx.run = mock()
|
|
445
|
+
.mockResolvedValueOnce({ id: 'label-1', uidValidity: 1, unreadCount: 0 })
|
|
446
|
+
.mockResolvedValueOnce({
|
|
447
|
+
id: 'thread-1',
|
|
448
|
+
labelIdList: ' label-2 ',
|
|
449
|
+
latestMessageDate: 1234567890,
|
|
450
|
+
seen: false,
|
|
451
|
+
})
|
|
452
|
+
.mockResolvedValueOnce([{ id: 'message-1' }])
|
|
453
|
+
.mockResolvedValueOnce(null);
|
|
454
|
+
const args = {
|
|
455
|
+
accounts: { 'account-1': { threadIds: ['thread-1'] } },
|
|
456
|
+
labelPath: 'INBOX',
|
|
457
|
+
labelUnreadCounts: { 'label-1': 42 },
|
|
458
|
+
};
|
|
459
|
+
await mutators.thread.addLabel.fn({ args, ctx, tx: tx });
|
|
460
|
+
expect(tx.mutate.accountLabel.update).toHaveBeenCalledWith({ id: 'label-1', unreadCount: 42 });
|
|
461
|
+
});
|
|
443
462
|
});
|
|
444
463
|
describe('delete', () => {
|
|
445
464
|
it('deletes threads and updates unread counts', async () => {
|
|
@@ -458,6 +477,16 @@ describe('mutators', () => {
|
|
|
458
477
|
expect(tx.mutate.accountLabel.update).not.toHaveBeenCalled();
|
|
459
478
|
expect(tx.mutate.thread.delete).toHaveBeenCalledWith({ id: 'thread-1' });
|
|
460
479
|
});
|
|
480
|
+
it('uses pre-computed labelUnreadCounts when provided', async () => {
|
|
481
|
+
tx.run = mock().mockResolvedValueOnce({ id: 'thread-1', labelIdList: ' label-1 ', seen: false });
|
|
482
|
+
const args = {
|
|
483
|
+
accounts: { 'account-1': { threadIds: ['thread-1'] } },
|
|
484
|
+
labelUnreadCounts: { 'label-1': 42 },
|
|
485
|
+
};
|
|
486
|
+
await mutators.thread.delete.fn({ args, ctx, tx: tx });
|
|
487
|
+
expect(tx.mutate.accountLabel.update).toHaveBeenCalledWith({ id: 'label-1', unreadCount: 42 });
|
|
488
|
+
expect(tx.run).toHaveBeenCalledTimes(1);
|
|
489
|
+
});
|
|
461
490
|
});
|
|
462
491
|
describe('removeLabel', () => {
|
|
463
492
|
it('removes a label from threads', async () => {
|
|
@@ -494,6 +523,19 @@ describe('mutators', () => {
|
|
|
494
523
|
expect(tx.mutate.threadLabel.delete).not.toHaveBeenCalled();
|
|
495
524
|
expect(tx.mutate.threadByLabel.delete).not.toHaveBeenCalled();
|
|
496
525
|
});
|
|
526
|
+
it('uses pre-computed labelUnreadCounts when provided', async () => {
|
|
527
|
+
tx.run = mock()
|
|
528
|
+
.mockResolvedValueOnce({ id: 'label-1', unreadCount: 5 })
|
|
529
|
+
.mockResolvedValueOnce({ id: 'thread-1', labelIdList: ' label-1 label-2 ', seen: false })
|
|
530
|
+
.mockResolvedValueOnce([{ id: 'message-1' }]);
|
|
531
|
+
const args = {
|
|
532
|
+
accounts: { 'account-1': { threadIds: ['thread-1'] } },
|
|
533
|
+
labelPath: 'INBOX',
|
|
534
|
+
labelUnreadCounts: { 'label-1': 42 },
|
|
535
|
+
};
|
|
536
|
+
await mutators.thread.removeLabel.fn({ args, ctx, tx: tx });
|
|
537
|
+
expect(tx.mutate.accountLabel.update).toHaveBeenCalledWith({ id: 'label-1', unreadCount: 42 });
|
|
538
|
+
});
|
|
497
539
|
});
|
|
498
540
|
describe('setFlagged', () => {
|
|
499
541
|
it('sets flagged status', async () => {
|
|
@@ -528,6 +570,17 @@ describe('mutators', () => {
|
|
|
528
570
|
await mutators.thread.setSeen.fn({ args, ctx, tx: tx });
|
|
529
571
|
expect(tx.mutate.accountLabel.update).not.toHaveBeenCalled();
|
|
530
572
|
});
|
|
573
|
+
it('uses pre-computed labelUnreadCounts when provided', async () => {
|
|
574
|
+
tx.run = mock().mockResolvedValueOnce([{ id: 'thread-1', labelIdList: ' label-1 ', seen: false }]);
|
|
575
|
+
const args = {
|
|
576
|
+
accounts: { 'account-1': { threadIds: ['thread-1'] } },
|
|
577
|
+
labelUnreadCounts: { 'label-1': 42 },
|
|
578
|
+
seen: true,
|
|
579
|
+
};
|
|
580
|
+
await mutators.thread.setSeen.fn({ args, ctx, tx: tx });
|
|
581
|
+
expect(tx.mutate.accountLabel.update).toHaveBeenCalledWith({ id: 'label-1', unreadCount: 42 });
|
|
582
|
+
expect(tx.run).toHaveBeenCalledTimes(1);
|
|
583
|
+
});
|
|
531
584
|
});
|
|
532
585
|
const systemLabelTestCases = [
|
|
533
586
|
{ mutatorName: 'setArchive', specialUse: 'ARCHIVE' },
|
|
@@ -562,6 +615,25 @@ describe('mutators', () => {
|
|
|
562
615
|
labelIdList: expect.stringContaining('new-label'),
|
|
563
616
|
});
|
|
564
617
|
});
|
|
618
|
+
it(`uses pre-computed labelUnreadCounts when moving unread thread to ${specialUse}`, async () => {
|
|
619
|
+
tx.run = mock()
|
|
620
|
+
.mockResolvedValueOnce({
|
|
621
|
+
accountId: 'account-1',
|
|
622
|
+
id: 'thread-1',
|
|
623
|
+
labelIdList: ' old-label ',
|
|
624
|
+
latestMessageDate: 1234567890,
|
|
625
|
+
seen: false,
|
|
626
|
+
})
|
|
627
|
+
.mockResolvedValueOnce({ id: 'new-label', uidValidity: 1, unreadCount: 0 })
|
|
628
|
+
.mockResolvedValueOnce([{ id: 'message-1' }]);
|
|
629
|
+
const args = {
|
|
630
|
+
accounts: { 'account-1': { threadIds: ['thread-1'] } },
|
|
631
|
+
labelUnreadCounts: { 'new-label': 10, 'old-label': 5 },
|
|
632
|
+
};
|
|
633
|
+
await mutators.thread[mutatorName].fn({ args, ctx, tx: tx });
|
|
634
|
+
expect(tx.mutate.accountLabel.update).toHaveBeenCalledWith({ id: 'old-label', unreadCount: 5 });
|
|
635
|
+
expect(tx.mutate.accountLabel.update).toHaveBeenCalledWith({ id: 'new-label', unreadCount: 10 });
|
|
636
|
+
});
|
|
565
637
|
});
|
|
566
638
|
}
|
|
567
639
|
});
|