@marcoappio/marco-config 3.0.9 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,7 +32,7 @@ export type AppwriteMessageAttachment = ReadonlyDeep<v.InferOutput<typeof messag
32
32
  export type AppwriteMessageRecipient = ReadonlyDeep<v.InferOutput<typeof messageRecipientSchema>>;
33
33
  declare const mailboxSyncLanes: readonly ["HEAD", "BACKFILL"];
34
34
  declare const mailboxSyncLaneStates: readonly ["PENDING", "RUNNING", "COMPLETED", "FAILED"];
35
- declare const mailboxSyncStates: readonly ["INITIAL", "SYNCING", "CURRENT", "IDLE", "ERROR"];
35
+ declare const mailboxSyncStates: readonly ["INITIAL", "SYNCING", "CURRENT", "ERROR"];
36
36
  declare const pollShardStates: readonly ["ACTIVE", "STOPPED", "FAILED"];
37
37
  declare const appwriteEnvironments: readonly ['development', 'production', 'staging'];
38
38
  export type AppwriteEnvironment = (typeof appwriteEnvironments)[number];
@@ -60,8 +60,6 @@ declare const rowSchemas: {
60
60
  readonly provider: v.PicklistSchema<readonly ["GMAIL", "OUTLOOK", "IMAP"], undefined>;
61
61
  readonly state: v.PicklistSchema<readonly ["AWAITING_CONNECTION", "CONNECTED", "ERROR", "DISCONNECTED"], undefined>;
62
62
  readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
63
- readonly watcherShard: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
64
- readonly watcherShardId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
65
63
  readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
66
64
  readonly $databaseId: v.LiteralSchema<"marco", undefined>;
67
65
  readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
@@ -220,7 +218,7 @@ declare const rowSchemas: {
220
218
  readonly nextPollAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
221
219
  readonly provider: v.PicklistSchema<readonly ["GMAIL", "OUTLOOK", "IMAP"], undefined>;
222
220
  readonly providerCursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
223
- readonly state: v.PicklistSchema<readonly ["INITIAL", "SYNCING", "CURRENT", "IDLE", "ERROR"], undefined>;
221
+ readonly state: v.PicklistSchema<readonly ["INITIAL", "SYNCING", "CURRENT", "ERROR"], undefined>;
224
222
  readonly uidValidity: v.NullableSchema<v.StringSchema<undefined>, undefined>;
225
223
  readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
226
224
  readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
@@ -331,7 +329,7 @@ declare const rowSchemas: {
331
329
  readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
332
330
  }, undefined>;
333
331
  readonly savedViews: v.StrictObjectSchema<{
334
- readonly aliasEmails: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>, undefined>;
332
+ readonly aliasIds: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
335
333
  readonly icon: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
336
334
  readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
337
335
  readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
@@ -342,6 +340,20 @@ declare const rowSchemas: {
342
340
  readonly $tableId: v.LiteralSchema<"saved_views", undefined>;
343
341
  readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
344
342
  }, undefined>;
343
+ readonly threadAliases: v.StrictObjectSchema<{
344
+ readonly accountId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
345
+ readonly aliasId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
346
+ readonly latestMessageAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
347
+ readonly threadId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
348
+ readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
349
+ readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
350
+ readonly $databaseId: v.LiteralSchema<"marco", undefined>;
351
+ readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
352
+ readonly $permissions: v.ArraySchema<v.StringSchema<undefined>, undefined>;
353
+ readonly $sequence: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
354
+ readonly $tableId: v.LiteralSchema<"thread_aliases", undefined>;
355
+ readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
356
+ }, undefined>;
345
357
  readonly threadLabels: v.StrictObjectSchema<{
346
358
  readonly accountId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
347
359
  readonly labelId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
@@ -362,6 +374,7 @@ declare const rowSchemas: {
362
374
  readonly archived: v.BooleanSchema<undefined>;
363
375
  readonly firstMessageAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
364
376
  readonly flagged: v.BooleanSchema<undefined>;
377
+ readonly flaggedLocationCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
365
378
  readonly hasAttachments: v.BooleanSchema<undefined>;
366
379
  readonly labelIds: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
367
380
  readonly latestMessageAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
@@ -379,6 +392,7 @@ declare const rowSchemas: {
379
392
  readonly spam: v.BooleanSchema<undefined>;
380
393
  readonly subject: v.NullableSchema<v.StringSchema<undefined>, undefined>;
381
394
  readonly trashed: v.BooleanSchema<undefined>;
395
+ readonly unseenLocationCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
382
396
  readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
383
397
  readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
384
398
  readonly $databaseId: v.LiteralSchema<"marco", undefined>;
@@ -388,23 +402,6 @@ declare const rowSchemas: {
388
402
  readonly $tableId: v.LiteralSchema<"threads", undefined>;
389
403
  readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
390
404
  }, undefined>;
391
- readonly watcherShards: v.StrictObjectSchema<{
392
- readonly accountIds: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
393
- readonly errorCode: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
394
- readonly generation: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
395
- readonly heartbeatAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
396
- readonly lastHandoffAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
397
- readonly leaseExpiresAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
398
- readonly leaseId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
399
- readonly state: v.PicklistSchema<readonly ["ACTIVE", "IDLE", "STOPPED", "FAILED"], undefined>;
400
- readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
401
- readonly $databaseId: v.LiteralSchema<"marco", undefined>;
402
- readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
403
- readonly $permissions: v.ArraySchema<v.StringSchema<undefined>, undefined>;
404
- readonly $sequence: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
405
- readonly $tableId: v.LiteralSchema<"watcher_shards", undefined>;
406
- readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
407
- }, undefined>;
408
405
  };
409
406
  export declare const appwrite: {
410
407
  readonly decodedSchemas: {
@@ -471,15 +468,15 @@ export declare const appwrite: {
471
468
  readonly profiles: "profiles";
472
469
  readonly pushNotificationTokens: "push_notification_tokens";
473
470
  readonly savedViews: "saved_views";
471
+ readonly threadAliases: "thread_aliases";
474
472
  readonly threadLabels: "thread_labels";
475
473
  readonly threads: "threads";
476
- readonly watcherShards: "watcher_shards";
477
474
  };
478
475
  };
479
476
  readonly mailboxSync: {
480
477
  readonly laneStates: readonly ["PENDING", "RUNNING", "COMPLETED", "FAILED"];
481
478
  readonly lanes: readonly ["HEAD", "BACKFILL"];
482
- readonly states: readonly ["INITIAL", "SYNCING", "CURRENT", "IDLE", "ERROR"];
479
+ readonly states: readonly ["INITIAL", "SYNCING", "CURRENT", "ERROR"];
483
480
  };
484
481
  readonly oauth: {
485
482
  readonly operations: readonly ["CONNECT", "REPLACE"];
@@ -510,8 +507,6 @@ export declare const appwrite: {
510
507
  readonly provider: v.PicklistSchema<readonly ["GMAIL", "OUTLOOK", "IMAP"], undefined>;
511
508
  readonly state: v.PicklistSchema<readonly ["AWAITING_CONNECTION", "CONNECTED", "ERROR", "DISCONNECTED"], undefined>;
512
509
  readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
513
- readonly watcherShard: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
514
- readonly watcherShardId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
515
510
  readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
516
511
  readonly $databaseId: v.LiteralSchema<"marco", undefined>;
517
512
  readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
@@ -670,7 +665,7 @@ export declare const appwrite: {
670
665
  readonly nextPollAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
671
666
  readonly provider: v.PicklistSchema<readonly ["GMAIL", "OUTLOOK", "IMAP"], undefined>;
672
667
  readonly providerCursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
673
- readonly state: v.PicklistSchema<readonly ["INITIAL", "SYNCING", "CURRENT", "IDLE", "ERROR"], undefined>;
668
+ readonly state: v.PicklistSchema<readonly ["INITIAL", "SYNCING", "CURRENT", "ERROR"], undefined>;
674
669
  readonly uidValidity: v.NullableSchema<v.StringSchema<undefined>, undefined>;
675
670
  readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
676
671
  readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
@@ -781,7 +776,7 @@ export declare const appwrite: {
781
776
  readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
782
777
  }, undefined>;
783
778
  readonly savedViews: v.StrictObjectSchema<{
784
- readonly aliasEmails: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>, undefined>;
779
+ readonly aliasIds: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
785
780
  readonly icon: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
786
781
  readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
787
782
  readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
@@ -792,6 +787,20 @@ export declare const appwrite: {
792
787
  readonly $tableId: v.LiteralSchema<"saved_views", undefined>;
793
788
  readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
794
789
  }, undefined>;
790
+ readonly threadAliases: v.StrictObjectSchema<{
791
+ readonly accountId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
792
+ readonly aliasId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
793
+ readonly latestMessageAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
794
+ readonly threadId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
795
+ readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
796
+ readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
797
+ readonly $databaseId: v.LiteralSchema<"marco", undefined>;
798
+ readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
799
+ readonly $permissions: v.ArraySchema<v.StringSchema<undefined>, undefined>;
800
+ readonly $sequence: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
801
+ readonly $tableId: v.LiteralSchema<"thread_aliases", undefined>;
802
+ readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
803
+ }, undefined>;
795
804
  readonly threadLabels: v.StrictObjectSchema<{
796
805
  readonly accountId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
797
806
  readonly labelId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
@@ -812,6 +821,7 @@ export declare const appwrite: {
812
821
  readonly archived: v.BooleanSchema<undefined>;
813
822
  readonly firstMessageAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
814
823
  readonly flagged: v.BooleanSchema<undefined>;
824
+ readonly flaggedLocationCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
815
825
  readonly hasAttachments: v.BooleanSchema<undefined>;
816
826
  readonly labelIds: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
817
827
  readonly latestMessageAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
@@ -829,6 +839,7 @@ export declare const appwrite: {
829
839
  readonly spam: v.BooleanSchema<undefined>;
830
840
  readonly subject: v.NullableSchema<v.StringSchema<undefined>, undefined>;
831
841
  readonly trashed: v.BooleanSchema<undefined>;
842
+ readonly unseenLocationCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
832
843
  readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
833
844
  readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
834
845
  readonly $databaseId: v.LiteralSchema<"marco", undefined>;
@@ -838,23 +849,6 @@ export declare const appwrite: {
838
849
  readonly $tableId: v.LiteralSchema<"threads", undefined>;
839
850
  readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
840
851
  }, undefined>;
841
- readonly watcherShards: v.StrictObjectSchema<{
842
- readonly accountIds: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
843
- readonly errorCode: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
844
- readonly generation: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
845
- readonly heartbeatAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
846
- readonly lastHandoffAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
847
- readonly leaseExpiresAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
848
- readonly leaseId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
849
- readonly state: v.PicklistSchema<readonly ["ACTIVE", "IDLE", "STOPPED", "FAILED"], undefined>;
850
- readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
851
- readonly $databaseId: v.LiteralSchema<"marco", undefined>;
852
- readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
853
- readonly $permissions: v.ArraySchema<v.StringSchema<undefined>, undefined>;
854
- readonly $sequence: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
855
- readonly $tableId: v.LiteralSchema<"watcher_shards", undefined>;
856
- readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
857
- }, undefined>;
858
852
  };
859
853
  };
860
854
  export type AppwriteRowTable = keyof typeof rowSchemas;
@@ -1 +1 @@
1
- {"version":3,"file":"appwrite.d.ts","sourceRoot":"","sources":["../../src/appwrite/appwrite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAO5B,eAAO,MAAM,mBAAmB,6KAA+F,CAAA;AAW/H,QAAA,MAAM,qBAAqB;;;;;aAKzB,CAAA;AAEF,QAAA,MAAM,mBAAmB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkWT,CAAA;AAEV,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,UAAU,CAAA;AACtD,MAAM,MAAM,WAAW,CAAC,MAAM,SAAS,gBAAgB,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA"}
@@ -45,13 +45,12 @@ const jobStates = ['PENDING', 'RUNNING', 'SUCCEEDED', 'FAILED', 'CANCELLED'];
45
45
  const labelSpecialUses = ['ALL', 'ARCHIVE', 'DRAFTS', 'INBOX', 'JUNK', 'SENT', 'STARRED', 'TRASH'];
46
46
  const mailboxSyncLanes = ['HEAD', 'BACKFILL'];
47
47
  const mailboxSyncLaneStates = ['PENDING', 'RUNNING', 'COMPLETED', 'FAILED'];
48
- const mailboxSyncStates = ['INITIAL', 'SYNCING', 'CURRENT', 'IDLE', 'ERROR'];
48
+ const mailboxSyncStates = ['INITIAL', 'SYNCING', 'CURRENT', 'ERROR'];
49
49
  const oauthOperations = ['CONNECT', 'REPLACE'];
50
50
  const oauthProviders = ['GMAIL', 'OUTLOOK'];
51
51
  const oauthReturnUris = ['https://app.marcoapp.io/onboarding/provider-selection', 'https://app.staging.marcoapp.io/onboarding/provider-selection'];
52
52
  const oauthReturnUriSchema = v.picklist(oauthReturnUris);
53
53
  const pollShardStates = ['ACTIVE', 'STOPPED', 'FAILED'];
54
- const watcherShardStates = ['ACTIVE', 'IDLE', 'STOPPED', 'FAILED'];
55
54
  const appwriteEnvironments = ['development', 'production', 'staging'];
56
55
  const appwriteDeployments = {
57
56
  development: {
@@ -107,9 +106,9 @@ const appwriteIds = {
107
106
  profiles: 'profiles',
108
107
  pushNotificationTokens: 'push_notification_tokens',
109
108
  savedViews: 'saved_views',
109
+ threadAliases: 'thread_aliases',
110
110
  threadLabels: 'thread_labels',
111
111
  threads: 'threads',
112
- watcherShards: 'watcher_shards',
113
112
  },
114
113
  };
115
114
  const wireMetadata = (tableId) => ({
@@ -142,8 +141,6 @@ const rowSchemas = {
142
141
  provider: v.picklist(accountProviders),
143
142
  state: v.picklist(accountStates),
144
143
  userId: identifierSchema,
145
- watcherShard: v.nullable(identifierSchema),
146
- watcherShardId: v.nullable(identifierSchema),
147
144
  }),
148
145
  aliases: v.strictObject({
149
146
  ...wireMetadata(appwriteIds.tables.aliases),
@@ -320,10 +317,19 @@ const rowSchemas = {
320
317
  }),
321
318
  savedViews: v.strictObject({
322
319
  ...wireMetadata(appwriteIds.tables.savedViews),
323
- aliasEmails: v.array(emailSchema),
320
+ aliasIds: v.array(identifierSchema),
324
321
  icon: v.nullable(identifierSchema),
325
322
  name: identifierSchema,
326
323
  }),
324
+ // Scalar IDs keep this hot materialisation join eligible for TablesDB bulk writes.
325
+ threadAliases: v.strictObject({
326
+ ...wireMetadata(appwriteIds.tables.threadAliases),
327
+ accountId: identifierSchema,
328
+ aliasId: identifierSchema,
329
+ latestMessageAt: timestampSchema,
330
+ threadId: identifierSchema,
331
+ userId: identifierSchema,
332
+ }),
327
333
  threadLabels: v.strictObject({
328
334
  ...wireMetadata(appwriteIds.tables.threadLabels),
329
335
  accountId: identifierSchema,
@@ -339,6 +345,7 @@ const rowSchemas = {
339
345
  archived: v.boolean(),
340
346
  firstMessageAt: v.nullable(timestampSchema),
341
347
  flagged: v.boolean(),
348
+ flaggedLocationCount: nonNegativeIntegerSchema,
342
349
  hasAttachments: v.boolean(),
343
350
  labelIds: v.array(identifierSchema),
344
351
  latestMessageAt: timestampSchema,
@@ -356,19 +363,9 @@ const rowSchemas = {
356
363
  spam: v.boolean(),
357
364
  subject: v.nullable(v.string()),
358
365
  trashed: v.boolean(),
366
+ unseenLocationCount: nonNegativeIntegerSchema,
359
367
  userId: identifierSchema,
360
368
  }),
361
- watcherShards: v.strictObject({
362
- ...wireMetadata(appwriteIds.tables.watcherShards),
363
- accountIds: v.array(identifierSchema),
364
- errorCode: v.nullable(identifierSchema),
365
- generation: nonNegativeIntegerSchema,
366
- heartbeatAt: v.nullable(timestampSchema),
367
- lastHandoffAt: v.nullable(timestampSchema),
368
- leaseExpiresAt: v.nullable(timestampSchema),
369
- leaseId: v.nullable(identifierSchema),
370
- state: v.picklist(watcherShardStates),
371
- }),
372
369
  };
373
370
  export const appwrite = {
374
371
  decodedSchemas: {
@@ -31,8 +31,6 @@ const validRows = {
31
31
  provider: 'GMAIL',
32
32
  state: 'CONNECTED',
33
33
  userId: 'user-1',
34
- watcherShard: null,
35
- watcherShardId: 'watcher-shard-1',
36
34
  },
37
35
  aliases: {
38
36
  ...metadata,
@@ -147,7 +145,7 @@ const validRows = {
147
145
  nextPollAt: null,
148
146
  provider: 'GMAIL',
149
147
  providerCursor: null,
150
- state: 'IDLE',
148
+ state: 'CURRENT',
151
149
  uidValidity: null,
152
150
  userId: 'user-1',
153
151
  },
@@ -219,10 +217,19 @@ const validRows = {
219
217
  savedViews: {
220
218
  ...metadata,
221
219
  $tableId: 'saved_views',
222
- aliasEmails: ['marco@example.com'],
220
+ aliasIds: ['alias-1'],
223
221
  icon: 'mail',
224
222
  name: 'Unread',
225
223
  },
224
+ threadAliases: {
225
+ ...metadata,
226
+ $tableId: 'thread_aliases',
227
+ accountId: 'account-1',
228
+ aliasId: 'alias-1',
229
+ latestMessageAt: '2026-07-15T00:00:00.000Z',
230
+ threadId: 'thread-1',
231
+ userId: 'user-1',
232
+ },
226
233
  threadLabels: {
227
234
  ...metadata,
228
235
  $tableId: 'thread_labels',
@@ -240,6 +247,7 @@ const validRows = {
240
247
  archived: false,
241
248
  firstMessageAt: '2026-07-14T00:00:00.000Z',
242
249
  flagged: false,
250
+ flaggedLocationCount: 0,
243
251
  hasAttachments: false,
244
252
  labelIds: ['label-1'],
245
253
  latestMessageAt: '2026-07-15T00:00:00.000Z',
@@ -257,20 +265,9 @@ const validRows = {
257
265
  spam: false,
258
266
  subject: null,
259
267
  trashed: false,
268
+ unseenLocationCount: 0,
260
269
  userId: 'user-1',
261
270
  },
262
- watcherShards: {
263
- ...metadata,
264
- $tableId: 'watcher_shards',
265
- accountIds: ['account-1'],
266
- errorCode: null,
267
- generation: 1,
268
- heartbeatAt: null,
269
- lastHandoffAt: null,
270
- leaseExpiresAt: null,
271
- leaseId: null,
272
- state: 'ACTIVE',
273
- },
274
271
  };
275
272
  const validPollShardCoordinatorRow = {
276
273
  ...metadata,
@@ -319,9 +316,9 @@ describe('appwrite', () => {
319
316
  profiles: 'profiles',
320
317
  pushNotificationTokens: 'push_notification_tokens',
321
318
  savedViews: 'saved_views',
319
+ threadAliases: 'thread_aliases',
322
320
  threadLabels: 'thread_labels',
323
321
  threads: 'threads',
324
- watcherShards: 'watcher_shards',
325
322
  },
326
323
  });
327
324
  });
@@ -332,19 +329,22 @@ describe('appwrite', () => {
332
329
  returnUris: ['https://app.marcoapp.io/onboarding/provider-selection', 'https://app.staging.marcoapp.io/onboarding/provider-selection'],
333
330
  });
334
331
  });
335
- it('exports the additive mailbox polling contract', () => {
332
+ it('exports the final polling-only mailbox contract', () => {
336
333
  expect(appwrite.mailboxSync).toEqual({
337
334
  laneStates: ['PENDING', 'RUNNING', 'COMPLETED', 'FAILED'],
338
335
  lanes: ['HEAD', 'BACKFILL'],
339
- states: ['INITIAL', 'SYNCING', 'CURRENT', 'IDLE', 'ERROR'],
336
+ states: ['INITIAL', 'SYNCING', 'CURRENT', 'ERROR'],
340
337
  });
341
338
  expect(appwrite.polling).toEqual({ shardStates: ['ACTIVE', 'STOPPED', 'FAILED'] });
342
339
  });
343
- for (const state of ['CURRENT', 'IDLE']) {
344
- it(`accepts the transitional ${state} mailbox sync state`, () => {
345
- expect(v.safeParse(appwrite.rowSchemas.mailboxSyncStates, { ...validRows.mailboxSyncStates, state }).success).toBe(true);
346
- });
347
- }
340
+ it('accepts CURRENT and rejects the retired IDLE mailbox sync state', () => {
341
+ expect(v.safeParse(appwrite.rowSchemas.mailboxSyncStates, { ...validRows.mailboxSyncStates, state: 'CURRENT' }).success).toBe(true);
342
+ expect(v.safeParse(appwrite.rowSchemas.mailboxSyncStates, { ...validRows.mailboxSyncStates, state: 'IDLE' }).success).toBe(false);
343
+ });
344
+ it('keys saved views by stable alias IDs', () => {
345
+ expect(v.safeParse(appwrite.rowSchemas.savedViews, validRows.savedViews).success).toBe(true);
346
+ expect(v.safeParse(appwrite.rowSchemas.savedViews, { ...validRows.savedViews, aliasEmails: ['marco@example.com'] }).success).toBe(false);
347
+ });
348
348
  it('rejects a mailbox sync lane without a command UUID', () => {
349
349
  expect(v.safeParse(appwrite.rowSchemas.mailboxSyncLanes, {
350
350
  ...validRows.mailboxSyncLanes,
@@ -554,21 +554,6 @@ export declare const appwriteFunctions: {
554
554
  readonly state: v.LiteralSchema<"COMPLETED", undefined>;
555
555
  }, undefined>;
556
556
  };
557
- readonly watchersRun: {
558
- errorSchema: v.StrictObjectSchema<{
559
- readonly code: v.PicklistSchema<readonly ["AUTHENTICATION_FAILED", "AUTHORIZATION_FAILED", "CONFLICT", "INVALID_REQUEST", "NOT_FOUND", "PROVIDER_REJECTED", "TRANSIENT_FAILURE", "INTERNAL_ERROR"], undefined>;
560
- readonly retryable: v.BooleanSchema<undefined>;
561
- }, undefined>;
562
- context: "internal";
563
- method: "POST";
564
- path: "/watchers/run";
565
- requestSchema: v.StrictObjectSchema<{
566
- readonly shardId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
567
- }, undefined>;
568
- responseSchema: v.StrictObjectSchema<{
569
- readonly state: v.LiteralSchema<"COMPLETED", undefined>;
570
- }, undefined>;
571
- };
572
557
  };
573
558
  };
574
559
  };
@@ -1 +1 @@
1
- {"version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vD,KAAK,GACP,KAAK,CAAA;AACT,MAAM,MAAM,uBAAuB,CAAC,SAAS,SAAS,oBAAoB,EAAE,MAAM,SAAS,yBAAyB,CAAC,SAAS,CAAC,IAAI,qBAAqB,CACtJ,SAAS,EACT,MAAM,CACP,SAAS;IAAE,aAAa,EAAE,MAAM,OAAO,SAAS,CAAC,CAAC,aAAa,CAAA;CAAE,GAC9D,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,GACtB,KAAK,CAAA;AACT,MAAM,MAAM,wBAAwB,CAAC,SAAS,SAAS,oBAAoB,EAAE,MAAM,SAAS,yBAAyB,CAAC,SAAS,CAAC,IAAI,qBAAqB,CACvJ,SAAS,EACT,MAAM,CACP,SAAS;IAAE,cAAc,EAAE,MAAM,OAAO,SAAS,CAAC,CAAC,aAAa,CAAA;CAAE,GAC/D,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,GACtB,KAAK,CAAA"}
@@ -154,13 +154,6 @@ const workerRoutes = {
154
154
  requestSchema: emptySchema,
155
155
  responseSchema: completedSchema,
156
156
  }),
157
- watchersRun: createRoute({
158
- context: 'internal',
159
- method: 'POST',
160
- path: '/watchers/run',
161
- requestSchema: v.strictObject({ shardId: appwriteRowIdSchema }),
162
- responseSchema: completedSchema,
163
- }),
164
157
  };
165
158
  export const appwriteFunctions = {
166
159
  api: {
@@ -109,12 +109,6 @@ const routeFixtures = [
109
109
  response: { state: 'COMPLETED' },
110
110
  route: () => appwriteFunctions.api.routes.pollsRun,
111
111
  },
112
- {
113
- name: 'watcher runner',
114
- request: { shardId: 'test-watcher-shard-id-1' },
115
- response: { state: 'COMPLETED' },
116
- route: () => appwriteFunctions.worker.routes.watchersRun,
117
- },
118
112
  ];
119
113
  describe('appwriteFunctions', () => {
120
114
  it('publishes the complete Appwrite Function route manifest', () => {
@@ -130,7 +124,6 @@ describe('appwriteFunctions', () => {
130
124
  { functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.pollsRun },
131
125
  { functionId: appwriteFunctions.worker.id, route: appwriteFunctions.worker.routes.supervisor },
132
126
  { functionId: appwriteFunctions.worker.id, route: appwriteFunctions.worker.routes.jobsRun },
133
- { functionId: appwriteFunctions.worker.id, route: appwriteFunctions.worker.routes.watchersRun },
134
127
  ].map(({ functionId, route }) => ({
135
128
  context: route.context,
136
129
  functionId,
@@ -148,7 +141,6 @@ describe('appwriteFunctions', () => {
148
141
  { context: 'internal', functionId: 'marco-api', method: 'POST', path: '/polls/run' },
149
142
  { context: 'internal', functionId: 'marco-worker', method: 'POST', path: '/' },
150
143
  { context: 'internal', functionId: 'marco-worker', method: 'POST', path: '/jobs/run' },
151
- { context: 'internal', functionId: 'marco-worker', method: 'POST', path: '/watchers/run' },
152
144
  ]);
153
145
  });
154
146
  for (const { name, request, response, route } of routeFixtures) {
@@ -178,19 +170,14 @@ describe('appwriteFunctions', () => {
178
170
  }).success).toBe(false);
179
171
  });
180
172
  }
181
- const workerShardRoutes = [
173
+ const shardRoutes = [
182
174
  {
183
175
  description: 'poll',
184
176
  request: { scheduledFor: '2026-07-23T12:00:30.000Z', shardId: 'test invalid shard id' },
185
177
  requestSchema: appwriteFunctions.api.routes.pollsRun.requestSchema,
186
178
  },
187
- {
188
- description: 'watcher',
189
- request: { shardId: 'test invalid shard id' },
190
- requestSchema: appwriteFunctions.worker.routes.watchersRun.requestSchema,
191
- },
192
179
  ];
193
- for (const { description, request, requestSchema } of workerShardRoutes) {
180
+ for (const { description, request, requestSchema } of shardRoutes) {
194
181
  it(`rejects a malformed ${description} shard ID`, () => {
195
182
  expect(v.safeParse(requestSchema, request).success).toBe(false);
196
183
  });
@@ -41,7 +41,7 @@ export declare const marcoConstants: {
41
41
  maxFileSize: number;
42
42
  };
43
43
  views: {
44
- maxAliasEmailsPerView: number;
44
+ maxAliasIdsPerView: number;
45
45
  maxViews: number;
46
46
  };
47
47
  };
@@ -5,7 +5,7 @@ export declare const user: {
5
5
  maxFileSize: number;
6
6
  };
7
7
  views: {
8
- maxAliasEmailsPerView: number;
8
+ maxAliasIdsPerView: number;
9
9
  maxViews: number;
10
10
  };
11
11
  };
@@ -5,7 +5,7 @@ export const user = {
5
5
  maxFileSize: 5 * 1024 * 1024,
6
6
  },
7
7
  views: {
8
- maxAliasEmailsPerView: 100,
8
+ maxAliasIdsPerView: 100,
9
9
  maxViews: 25,
10
10
  },
11
11
  };
@@ -313,7 +313,7 @@ export declare const marcoSchemas: {
313
313
  words: import("valibot").StringSchema<undefined>;
314
314
  }, undefined>;
315
315
  userViewSchema: import("valibot").ObjectSchema<{
316
- readonly aliasEmails: 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>;
316
+ readonly aliasIds: 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>, import("valibot").BrandAction<string, "AliasId">]>, undefined>, undefined>;
317
317
  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>;
318
318
  readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>, import("valibot").BrandAction<string, "ViewId">]>, undefined>;
319
319
  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>;
@@ -1,6 +1,6 @@
1
1
  import * as v from 'valibot';
2
2
  export declare const userViewSchema: v.ObjectSchema<{
3
- readonly aliasEmails: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
3
+ readonly aliasIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "AliasId">]>, undefined>, undefined>;
4
4
  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>;
5
5
  readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "ViewId">]>, undefined>;
6
6
  readonly name: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
@@ -3,7 +3,7 @@ import { id } from '../../schemas/id';
3
3
  import { string } from '../../schemas/string';
4
4
  import { USER_SETTINGS_CUSTOM_VIEW_ICONS } from '../../types';
5
5
  export const userViewSchema = v.object({
6
- aliasEmails: v.array(string.required()),
6
+ aliasIds: v.array(id.aliasId.required()),
7
7
  icon: v.picklist(USER_SETTINGS_CUSTOM_VIEW_ICONS),
8
8
  id: id.viewId.required(),
9
9
  name: string.required(),
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=user.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.test.d.ts","sourceRoot":"","sources":["../../../src/schemas/models/user.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import { describe, expect, it } from 'bun:test';
2
+ import * as v from 'valibot';
3
+ import { userViewSchema } from './user';
4
+ describe('userViewSchema', () => {
5
+ it('keys saved views by stable alias IDs', () => {
6
+ const view = { aliasIds: ['alias-1'], icon: 'STAR', id: 'view-1', name: 'Important' };
7
+ const legacyView = { aliasEmails: ['marco@example.com'], icon: 'STAR', id: 'view-1', name: 'Important' };
8
+ expect(v.safeParse(userViewSchema, view).success).toBe(true);
9
+ expect(v.safeParse(userViewSchema, legacyView).success).toBe(false);
10
+ });
11
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marcoappio/marco-config",
3
- "version": "3.0.9",
3
+ "version": "4.0.0",
4
4
  "author": "team@marcoapp.io",
5
5
  "main": "dist/index.js",
6
6
  "repository": "git@github.com:marcoappio/marco-config.git",