@marcoappio/marco-config 2.0.420 → 2.0.422

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.
@@ -2,7 +2,7 @@ import type { MarcoSyncedQueryContext } from '../../types';
2
2
  import { DRAFT_STATUSES } from '../../types';
3
3
  type GetDraftsArgs = {
4
4
  accountId?: string;
5
- limit?: number;
5
+ limit: number;
6
6
  status?: (typeof DRAFT_STATUSES)[number];
7
7
  };
8
8
  export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts", MarcoSyncedQueryContext, true, [GetDraftsArgs], import("@rocicorp/zero").Query<{
@@ -28,11 +28,15 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
28
28
  customType: string;
29
29
  }, "optional"> & {
30
30
  optional: true;
31
+ } & {
32
+ serverName: string;
31
33
  };
32
34
  readonly undoSendEnabled: {
33
35
  type: "boolean";
34
36
  optional: false;
35
37
  customType: boolean;
38
+ } & {
39
+ serverName: string;
36
40
  };
37
41
  };
38
42
  primaryKey: readonly [string, ...string[]];
@@ -46,6 +50,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
46
50
  type: "number";
47
51
  optional: false;
48
52
  customType: number;
53
+ } & {
54
+ serverName: string;
49
55
  };
50
56
  readonly id: {
51
57
  type: "string";
@@ -61,6 +67,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
61
67
  type: "string";
62
68
  optional: false;
63
69
  customType: string;
70
+ } & {
71
+ serverName: string;
64
72
  };
65
73
  };
66
74
  primaryKey: readonly [string, ...string[]];
@@ -74,6 +82,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
74
82
  type: "string";
75
83
  optional: false;
76
84
  customType: string;
85
+ } & {
86
+ serverName: string;
77
87
  };
78
88
  readonly id: {
79
89
  type: "string";
@@ -91,6 +101,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
91
101
  type: "string";
92
102
  optional: false;
93
103
  customType: string;
104
+ } & {
105
+ serverName: string;
94
106
  };
95
107
  };
96
108
  primaryKey: readonly [string, ...string[]];
@@ -111,6 +123,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
111
123
  customType: string;
112
124
  }, "optional"> & {
113
125
  optional: true;
126
+ } & {
127
+ serverName: string;
114
128
  };
115
129
  readonly id: {
116
130
  type: "string";
@@ -121,16 +135,22 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
121
135
  type: "string";
122
136
  optional: false;
123
137
  customType: "AWAITING_CONNECTION" | "CONNECTED" | "CONNECTION_FAILED_AUTHENTICATION_ERROR" | "CONNECTION_FAILED_CONNECTION_ERROR" | "CONNECTION_FAILED_OAUTH_EXCHANGE_ERROR" | "CONNECTION_FAILED_QUOTA_ERROR" | "CONNECTION_FAILED_UNKNOWN_ERROR";
138
+ } & {
139
+ serverName: string;
124
140
  };
125
141
  readonly mailProcessedCount: {
126
142
  type: "number";
127
143
  optional: false;
128
144
  customType: number;
145
+ } & {
146
+ serverName: string;
129
147
  };
130
148
  readonly mailTotalCount: {
131
149
  type: "number";
132
150
  optional: false;
133
151
  customType: number;
152
+ } & {
153
+ serverName: string;
134
154
  };
135
155
  readonly primaryAliasId: Omit<{
136
156
  type: "string";
@@ -138,11 +158,15 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
138
158
  customType: string;
139
159
  }, "optional"> & {
140
160
  optional: true;
161
+ } & {
162
+ serverName: string;
141
163
  };
142
164
  readonly userId: {
143
165
  type: "string";
144
166
  optional: false;
145
167
  customType: string;
168
+ } & {
169
+ serverName: string;
146
170
  };
147
171
  };
148
172
  primaryKey: readonly [string, ...string[]];
@@ -156,11 +180,15 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
156
180
  type: "string";
157
181
  optional: false;
158
182
  customType: string;
183
+ } & {
184
+ serverName: string;
159
185
  };
160
186
  readonly emailAddress: {
161
187
  type: "string";
162
188
  optional: false;
163
189
  customType: string;
190
+ } & {
191
+ serverName: string;
164
192
  };
165
193
  readonly id: {
166
194
  type: "string";
@@ -171,6 +199,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
171
199
  type: "boolean";
172
200
  optional: false;
173
201
  customType: boolean;
202
+ } & {
203
+ serverName: string;
174
204
  };
175
205
  readonly name: Omit<{
176
206
  type: "string";
@@ -191,6 +221,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
191
221
  type: "string";
192
222
  optional: false;
193
223
  customType: string;
224
+ } & {
225
+ serverName: string;
194
226
  };
195
227
  readonly id: {
196
228
  type: "string";
@@ -208,6 +240,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
208
240
  customType: "ARCHIVE" | "INBOX" | "SENT" | "SPAM" | "TRASH";
209
241
  }, "optional"> & {
210
242
  optional: true;
243
+ } & {
244
+ serverName: string;
211
245
  };
212
246
  };
213
247
  primaryKey: readonly [string, ...string[]];
@@ -221,6 +255,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
221
255
  type: "string";
222
256
  optional: false;
223
257
  customType: string;
258
+ } & {
259
+ serverName: string;
224
260
  };
225
261
  readonly body: {
226
262
  type: "json";
@@ -245,11 +281,15 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
245
281
  customType: string;
246
282
  }, "optional"> & {
247
283
  optional: true;
284
+ } & {
285
+ serverName: string;
248
286
  };
249
287
  readonly fromEmail: {
250
288
  type: "string";
251
289
  optional: false;
252
290
  customType: string;
291
+ } & {
292
+ serverName: string;
253
293
  };
254
294
  readonly fromName: Omit<{
255
295
  type: "string";
@@ -257,6 +297,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
257
297
  customType: string;
258
298
  }, "optional"> & {
259
299
  optional: true;
300
+ } & {
301
+ serverName: string;
260
302
  };
261
303
  readonly id: {
262
304
  type: "string";
@@ -269,6 +311,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
269
311
  customType: string;
270
312
  }, "optional"> & {
271
313
  optional: true;
314
+ } & {
315
+ serverName: string;
272
316
  };
273
317
  readonly scheduledFor: Omit<{
274
318
  type: "number";
@@ -276,6 +320,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
276
320
  customType: number;
277
321
  }, "optional"> & {
278
322
  optional: true;
323
+ } & {
324
+ serverName: string;
279
325
  };
280
326
  readonly status: {
281
327
  type: "string";
@@ -298,11 +344,15 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
298
344
  type: "number";
299
345
  optional: false;
300
346
  customType: number;
347
+ } & {
348
+ serverName: string;
301
349
  };
302
350
  readonly userId: {
303
351
  type: "string";
304
352
  optional: false;
305
353
  customType: string;
354
+ } & {
355
+ serverName: string;
306
356
  };
307
357
  };
308
358
  primaryKey: readonly [string, ...string[]];
@@ -316,11 +366,15 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
316
366
  type: "string";
317
367
  optional: false;
318
368
  customType: string;
369
+ } & {
370
+ serverName: string;
319
371
  };
320
372
  readonly emailAddress: {
321
373
  type: "string";
322
374
  optional: false;
323
375
  customType: string;
376
+ } & {
377
+ serverName: string;
324
378
  };
325
379
  readonly id: {
326
380
  type: "string";
@@ -344,6 +398,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
344
398
  type: "string";
345
399
  optional: false;
346
400
  customType: string;
401
+ } & {
402
+ serverName: string;
347
403
  };
348
404
  readonly failed: {
349
405
  type: "boolean";
@@ -354,6 +410,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
354
410
  type: "string";
355
411
  optional: false;
356
412
  customType: string;
413
+ } & {
414
+ serverName: string;
357
415
  };
358
416
  readonly id: {
359
417
  type: "string";
@@ -364,21 +422,29 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
364
422
  type: "string";
365
423
  optional: false;
366
424
  customType: string;
425
+ } & {
426
+ serverName: string;
367
427
  };
368
428
  readonly totalChunks: {
369
429
  type: "number";
370
430
  optional: false;
371
431
  customType: number;
432
+ } & {
433
+ serverName: string;
372
434
  };
373
435
  readonly totalSize: {
374
436
  type: "number";
375
437
  optional: false;
376
438
  customType: number;
439
+ } & {
440
+ serverName: string;
377
441
  };
378
442
  readonly uploadedChunks: {
379
443
  type: "number";
380
444
  optional: false;
381
445
  customType: number;
446
+ } & {
447
+ serverName: string;
382
448
  };
383
449
  };
384
450
  primaryKey: readonly [string, ...string[]];
@@ -392,6 +458,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
392
458
  type: "string";
393
459
  optional: false;
394
460
  customType: string;
461
+ } & {
462
+ serverName: string;
395
463
  };
396
464
  readonly flagged: {
397
465
  type: "boolean";
@@ -407,6 +475,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
407
475
  type: "number";
408
476
  optional: false;
409
477
  customType: number;
478
+ } & {
479
+ serverName: string;
410
480
  };
411
481
  readonly seen: {
412
482
  type: "boolean";
@@ -417,6 +487,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
417
487
  type: "string";
418
488
  optional: false;
419
489
  customType: string;
490
+ } & {
491
+ serverName: string;
420
492
  };
421
493
  readonly words: {
422
494
  type: "string";
@@ -435,11 +507,15 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
435
507
  type: "string";
436
508
  optional: false;
437
509
  customType: string;
510
+ } & {
511
+ serverName: string;
438
512
  };
439
513
  readonly threadId: {
440
514
  type: "string";
441
515
  optional: false;
442
516
  customType: string;
517
+ } & {
518
+ serverName: string;
443
519
  };
444
520
  };
445
521
  primaryKey: readonly [string, ...string[]];
@@ -453,6 +529,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
453
529
  type: "number";
454
530
  optional: false;
455
531
  customType: number;
532
+ } & {
533
+ serverName: string;
456
534
  };
457
535
  readonly envelopeSubject: Omit<{
458
536
  type: "string";
@@ -460,6 +538,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
460
538
  customType: string;
461
539
  }, "optional"> & {
462
540
  optional: true;
541
+ } & {
542
+ serverName: string;
463
543
  };
464
544
  readonly id: {
465
545
  type: "string";
@@ -470,11 +550,15 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
470
550
  type: "string";
471
551
  optional: false;
472
552
  customType: string;
553
+ } & {
554
+ serverName: string;
473
555
  };
474
556
  readonly senderEmail: {
475
557
  type: "string";
476
558
  optional: false;
477
559
  customType: string;
560
+ } & {
561
+ serverName: string;
478
562
  };
479
563
  readonly senderName: Omit<{
480
564
  type: "string";
@@ -482,11 +566,15 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
482
566
  customType: string;
483
567
  }, "optional"> & {
484
568
  optional: true;
569
+ } & {
570
+ serverName: string;
485
571
  };
486
572
  readonly threadId: {
487
573
  type: "string";
488
574
  optional: false;
489
575
  customType: string;
576
+ } & {
577
+ serverName: string;
490
578
  };
491
579
  };
492
580
  primaryKey: readonly [string, ...string[]];
@@ -500,6 +588,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
500
588
  type: "string";
501
589
  optional: false;
502
590
  customType: string;
591
+ } & {
592
+ serverName: string;
503
593
  };
504
594
  readonly id: {
505
595
  type: "string";
@@ -517,6 +607,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
517
607
  type: "string";
518
608
  optional: false;
519
609
  customType: string;
610
+ } & {
611
+ serverName: string;
520
612
  };
521
613
  readonly type: {
522
614
  type: "string";
@@ -535,6 +627,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
535
627
  type: "string";
536
628
  optional: false;
537
629
  customType: string;
630
+ } & {
631
+ serverName: string;
538
632
  };
539
633
  readonly id: {
540
634
  type: "string";
@@ -545,6 +639,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
545
639
  type: "string";
546
640
  optional: false;
547
641
  customType: string;
642
+ } & {
643
+ serverName: string;
548
644
  };
549
645
  readonly size: {
550
646
  type: "number";
@@ -560,6 +656,8 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
560
656
  type: "string";
561
657
  optional: false;
562
658
  customType: string;
659
+ } & {
660
+ serverName: string;
563
661
  };
564
662
  };
565
663
  primaryKey: readonly [string, ...string[]];
@@ -573,11 +671,15 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
573
671
  type: "string";
574
672
  optional: false;
575
673
  customType: string;
674
+ } & {
675
+ serverName: string;
576
676
  };
577
677
  readonly threadMessageId: {
578
678
  type: "string";
579
679
  optional: false;
580
680
  customType: string;
681
+ } & {
682
+ serverName: string;
581
683
  };
582
684
  };
583
685
  primaryKey: readonly [string, ...string[]];
@@ -589,7 +691,7 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
589
691
  readonly user: {
590
692
  accounts: [{
591
693
  readonly sourceField: string[];
592
- readonly destField: ("id" | "color" | "userId" | "mailProcessedCount" | "mailTotalCount" | "displayName" | "imapConnectionStatus" | "primaryAliasId")[];
694
+ readonly destField: ("id" | "color" | "userId" | "displayName" | "imapConnectionStatus" | "mailProcessedCount" | "mailTotalCount" | "primaryAliasId")[];
593
695
  readonly destSchema: "account";
594
696
  readonly cardinality: "many";
595
697
  }];
@@ -601,7 +703,7 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
601
703
  }];
602
704
  drafts: [{
603
705
  readonly sourceField: string[];
604
- readonly destField: ("type" | "status" | "id" | "updatedAt" | "body" | "accountId" | "subject" | "scheduledFor" | "error" | "fromName" | "referencedMessageId" | "userId" | "fromEmail" | "fromAliasId")[];
706
+ readonly destField: ("type" | "status" | "id" | "updatedAt" | "body" | "accountId" | "subject" | "scheduledFor" | "error" | "fromName" | "referencedMessageId" | "userId" | "fromAliasId" | "fromEmail")[];
605
707
  readonly destSchema: "draft";
606
708
  readonly cardinality: "many";
607
709
  }];
@@ -621,7 +723,7 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
621
723
  readonly userPushNotificationToken: {
622
724
  user: [{
623
725
  readonly sourceField: string[];
624
- readonly destField: ("id" | "name" | "undoSendEnabled" | "profilePicture")[];
726
+ readonly destField: ("id" | "name" | "profilePicture" | "undoSendEnabled")[];
625
727
  readonly destSchema: "user";
626
728
  readonly cardinality: "one";
627
729
  }];
@@ -629,7 +731,7 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
629
731
  readonly contact: {
630
732
  user: [{
631
733
  readonly sourceField: string[];
632
- readonly destField: ("id" | "name" | "undoSendEnabled" | "profilePicture")[];
734
+ readonly destField: ("id" | "name" | "profilePicture" | "undoSendEnabled")[];
633
735
  readonly destSchema: "user";
634
736
  readonly cardinality: "one";
635
737
  }];
@@ -643,7 +745,7 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
643
745
  }];
644
746
  drafts: [{
645
747
  readonly sourceField: string[];
646
- readonly destField: ("type" | "status" | "id" | "updatedAt" | "body" | "accountId" | "subject" | "scheduledFor" | "error" | "fromName" | "referencedMessageId" | "userId" | "fromEmail" | "fromAliasId")[];
748
+ readonly destField: ("type" | "status" | "id" | "updatedAt" | "body" | "accountId" | "subject" | "scheduledFor" | "error" | "fromName" | "referencedMessageId" | "userId" | "fromAliasId" | "fromEmail")[];
647
749
  readonly destSchema: "draft";
648
750
  readonly cardinality: "many";
649
751
  }];
@@ -667,7 +769,7 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
667
769
  }];
668
770
  user: [{
669
771
  readonly sourceField: string[];
670
- readonly destField: ("id" | "name" | "undoSendEnabled" | "profilePicture")[];
772
+ readonly destField: ("id" | "name" | "profilePicture" | "undoSendEnabled")[];
671
773
  readonly destSchema: "user";
672
774
  readonly cardinality: "one";
673
775
  }];
@@ -675,7 +777,7 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
675
777
  readonly accountAlias: {
676
778
  account: [{
677
779
  readonly sourceField: string[];
678
- readonly destField: ("id" | "color" | "userId" | "mailProcessedCount" | "mailTotalCount" | "displayName" | "imapConnectionStatus" | "primaryAliasId")[];
780
+ readonly destField: ("id" | "color" | "userId" | "displayName" | "imapConnectionStatus" | "mailProcessedCount" | "mailTotalCount" | "primaryAliasId")[];
679
781
  readonly destSchema: "account";
680
782
  readonly cardinality: "one";
681
783
  }];
@@ -683,7 +785,7 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
683
785
  readonly accountLabel: {
684
786
  account: [{
685
787
  readonly sourceField: string[];
686
- readonly destField: ("id" | "color" | "userId" | "mailProcessedCount" | "mailTotalCount" | "displayName" | "imapConnectionStatus" | "primaryAliasId")[];
788
+ readonly destField: ("id" | "color" | "userId" | "displayName" | "imapConnectionStatus" | "mailProcessedCount" | "mailTotalCount" | "primaryAliasId")[];
687
789
  readonly destSchema: "account";
688
790
  readonly cardinality: "one";
689
791
  }];
@@ -694,7 +796,7 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
694
796
  readonly cardinality: "many";
695
797
  }, {
696
798
  readonly sourceField: string[];
697
- readonly destField: ("threadId" | "id" | "envelopeDate" | "previewText" | "senderEmail" | "envelopeSubject" | "senderName")[];
799
+ readonly destField: ("threadId" | "id" | "envelopeDate" | "envelopeSubject" | "previewText" | "senderEmail" | "senderName")[];
698
800
  readonly destSchema: "threadMessage";
699
801
  readonly cardinality: "many";
700
802
  }];
@@ -713,7 +815,7 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
713
815
  readonly draft: {
714
816
  account: [{
715
817
  readonly sourceField: string[];
716
- readonly destField: ("id" | "color" | "userId" | "mailProcessedCount" | "mailTotalCount" | "displayName" | "imapConnectionStatus" | "primaryAliasId")[];
818
+ readonly destField: ("id" | "color" | "userId" | "displayName" | "imapConnectionStatus" | "mailProcessedCount" | "mailTotalCount" | "primaryAliasId")[];
717
819
  readonly destSchema: "account";
718
820
  readonly cardinality: "one";
719
821
  }];
@@ -731,7 +833,7 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
731
833
  }];
732
834
  user: [{
733
835
  readonly sourceField: string[];
734
- readonly destField: ("id" | "name" | "undoSendEnabled" | "profilePicture")[];
836
+ readonly destField: ("id" | "name" | "profilePicture" | "undoSendEnabled")[];
735
837
  readonly destSchema: "user";
736
838
  readonly cardinality: "one";
737
839
  }];
@@ -739,7 +841,7 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
739
841
  readonly draftRecipient: {
740
842
  draft: [{
741
843
  readonly sourceField: string[];
742
- readonly destField: ("type" | "status" | "id" | "updatedAt" | "body" | "accountId" | "subject" | "scheduledFor" | "error" | "fromName" | "referencedMessageId" | "userId" | "fromEmail" | "fromAliasId")[];
844
+ readonly destField: ("type" | "status" | "id" | "updatedAt" | "body" | "accountId" | "subject" | "scheduledFor" | "error" | "fromName" | "referencedMessageId" | "userId" | "fromAliasId" | "fromEmail")[];
743
845
  readonly destSchema: "draft";
744
846
  readonly cardinality: "one";
745
847
  }];
@@ -747,7 +849,7 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
747
849
  readonly draftAttachment: {
748
850
  draft: [{
749
851
  readonly sourceField: string[];
750
- readonly destField: ("type" | "status" | "id" | "updatedAt" | "body" | "accountId" | "subject" | "scheduledFor" | "error" | "fromName" | "referencedMessageId" | "userId" | "fromEmail" | "fromAliasId")[];
852
+ readonly destField: ("type" | "status" | "id" | "updatedAt" | "body" | "accountId" | "subject" | "scheduledFor" | "error" | "fromName" | "referencedMessageId" | "userId" | "fromAliasId" | "fromEmail")[];
751
853
  readonly destSchema: "draft";
752
854
  readonly cardinality: "one";
753
855
  }];
@@ -755,7 +857,7 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
755
857
  readonly thread: {
756
858
  account: [{
757
859
  readonly sourceField: string[];
758
- readonly destField: ("id" | "color" | "userId" | "mailProcessedCount" | "mailTotalCount" | "displayName" | "imapConnectionStatus" | "primaryAliasId")[];
860
+ readonly destField: ("id" | "color" | "userId" | "displayName" | "imapConnectionStatus" | "mailProcessedCount" | "mailTotalCount" | "primaryAliasId")[];
759
861
  readonly destSchema: "account";
760
862
  readonly cardinality: "one";
761
863
  }];
@@ -772,13 +874,13 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
772
874
  }];
773
875
  messages: [{
774
876
  readonly sourceField: string[];
775
- readonly destField: ("threadId" | "id" | "envelopeDate" | "previewText" | "senderEmail" | "envelopeSubject" | "senderName")[];
877
+ readonly destField: ("threadId" | "id" | "envelopeDate" | "envelopeSubject" | "previewText" | "senderEmail" | "senderName")[];
776
878
  readonly destSchema: "threadMessage";
777
879
  readonly cardinality: "many";
778
880
  }];
779
881
  user: [{
780
882
  readonly sourceField: string[];
781
- readonly destField: ("id" | "name" | "undoSendEnabled" | "profilePicture")[];
883
+ readonly destField: ("id" | "name" | "profilePicture" | "undoSendEnabled")[];
782
884
  readonly destSchema: "user";
783
885
  readonly cardinality: "one";
784
886
  }];
@@ -831,7 +933,7 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
831
933
  readonly threadMessageRecipient: {
832
934
  message: [{
833
935
  readonly sourceField: string[];
834
- readonly destField: ("threadId" | "id" | "envelopeDate" | "previewText" | "senderEmail" | "envelopeSubject" | "senderName")[];
936
+ readonly destField: ("threadId" | "id" | "envelopeDate" | "envelopeSubject" | "previewText" | "senderEmail" | "senderName")[];
835
937
  readonly destSchema: "threadMessage";
836
938
  readonly cardinality: "one";
837
939
  }];
@@ -839,7 +941,7 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
839
941
  readonly threadMessageAttachment: {
840
942
  message: [{
841
943
  readonly sourceField: string[];
842
- readonly destField: ("threadId" | "id" | "envelopeDate" | "previewText" | "senderEmail" | "envelopeSubject" | "senderName")[];
944
+ readonly destField: ("threadId" | "id" | "envelopeDate" | "envelopeSubject" | "previewText" | "senderEmail" | "senderName")[];
843
945
  readonly destSchema: "threadMessage";
844
946
  readonly cardinality: "one";
845
947
  }];
@@ -853,7 +955,7 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
853
955
  }];
854
956
  message: [{
855
957
  readonly sourceField: string[];
856
- readonly destField: ("threadId" | "id" | "envelopeDate" | "previewText" | "senderEmail" | "envelopeSubject" | "senderName")[];
958
+ readonly destField: ("threadId" | "id" | "envelopeDate" | "envelopeSubject" | "previewText" | "senderEmail" | "senderName")[];
857
959
  readonly destSchema: "threadMessage";
858
960
  readonly cardinality: "one";
859
961
  }];
@@ -918,13 +1020,6 @@ export declare const getDrafts: import("@rocicorp/zero").SyncedQuery<"getDrafts"
918
1020
  readonly totalSize: number;
919
1021
  readonly uploadedChunks: number;
920
1022
  }[];
921
- } & {
922
- readonly user: {
923
- readonly id: string;
924
- readonly name: string | null;
925
- readonly profilePicture: string | null;
926
- readonly undoSendEnabled: boolean;
927
- } | undefined;
928
1023
  }>>;
929
1024
  export {};
930
1025
  //# sourceMappingURL=getDrafts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getDrafts.d.ts","sourceRoot":"","sources":["../../../src/zero/queries/getDrafts.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAGpD,KAAK,aAAa,GAAG;IACnB,SAAS,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqBrB,CAAA"}
@@ -2,21 +2,22 @@ import { syncedQueryWithContext } from '@rocicorp/zero';
2
2
  import * as v from 'valibot';
3
3
  import { DRAFT_STATUSES } from '../../types';
4
4
  import { z } from '../../zero/queries';
5
+ const MAX_LIMIT = 1000;
6
+ const DEFAULT_LIMIT = 50;
5
7
  const parseArgs = (args) => {
6
8
  const schema = v.object({
7
9
  accountId: v.optional(v.string()),
8
- limit: v.optional(v.number()),
10
+ limit: v.optional(v.pipe(v.number(), v.minValue(1), v.maxValue(MAX_LIMIT)), DEFAULT_LIMIT),
9
11
  status: v.optional(v.picklist(DRAFT_STATUSES)),
10
12
  });
11
- return [v.parse(schema, args[0] ?? {})];
13
+ return [v.parse(schema, args[0])];
12
14
  };
13
15
  export const getDrafts = syncedQueryWithContext('getDrafts', parseArgs, ({ userId }, { status, accountId, limit }) => {
14
16
  let query = z.draft
15
17
  .where('userId', userId)
16
- .related('account', q => q.related('aliases'))
18
+ .related('account', x => x.related('aliases'))
17
19
  .related('recipients')
18
20
  .related('attachments')
19
- .related('user')
20
21
  .orderBy('updatedAt', 'desc');
21
22
  if (status) {
22
23
  query = query.where('status', status);
@@ -24,8 +25,5 @@ export const getDrafts = syncedQueryWithContext('getDrafts', parseArgs, ({ userI
24
25
  if (accountId) {
25
26
  query = query.where('accountId', accountId);
26
27
  }
27
- if (typeof limit === 'number') {
28
- query = query.limit(limit);
29
- }
30
- return query;
28
+ return query.limit(limit);
31
29
  });