@marcoappio/marco-config 3.0.10 → 4.0.1

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>]>;
@@ -390,23 +402,6 @@ declare const rowSchemas: {
390
402
  readonly $tableId: v.LiteralSchema<"threads", undefined>;
391
403
  readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
392
404
  }, undefined>;
393
- readonly watcherShards: v.StrictObjectSchema<{
394
- readonly accountIds: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
395
- readonly errorCode: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
396
- readonly generation: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
397
- readonly heartbeatAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
398
- readonly lastHandoffAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
399
- readonly leaseExpiresAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
400
- readonly leaseId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
401
- readonly state: v.PicklistSchema<readonly ["ACTIVE", "IDLE", "STOPPED", "FAILED"], undefined>;
402
- readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
403
- readonly $databaseId: v.LiteralSchema<"marco", undefined>;
404
- readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
405
- readonly $permissions: v.ArraySchema<v.StringSchema<undefined>, undefined>;
406
- readonly $sequence: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
407
- readonly $tableId: v.LiteralSchema<"watcher_shards", undefined>;
408
- readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
409
- }, undefined>;
410
405
  };
411
406
  export declare const appwrite: {
412
407
  readonly decodedSchemas: {
@@ -473,15 +468,15 @@ export declare const appwrite: {
473
468
  readonly profiles: "profiles";
474
469
  readonly pushNotificationTokens: "push_notification_tokens";
475
470
  readonly savedViews: "saved_views";
471
+ readonly threadAliases: "thread_aliases";
476
472
  readonly threadLabels: "thread_labels";
477
473
  readonly threads: "threads";
478
- readonly watcherShards: "watcher_shards";
479
474
  };
480
475
  };
481
476
  readonly mailboxSync: {
482
477
  readonly laneStates: readonly ["PENDING", "RUNNING", "COMPLETED", "FAILED"];
483
478
  readonly lanes: readonly ["HEAD", "BACKFILL"];
484
- readonly states: readonly ["INITIAL", "SYNCING", "CURRENT", "IDLE", "ERROR"];
479
+ readonly states: readonly ["INITIAL", "SYNCING", "CURRENT", "ERROR"];
485
480
  };
486
481
  readonly oauth: {
487
482
  readonly operations: readonly ["CONNECT", "REPLACE"];
@@ -512,8 +507,6 @@ export declare const appwrite: {
512
507
  readonly provider: v.PicklistSchema<readonly ["GMAIL", "OUTLOOK", "IMAP"], undefined>;
513
508
  readonly state: v.PicklistSchema<readonly ["AWAITING_CONNECTION", "CONNECTED", "ERROR", "DISCONNECTED"], undefined>;
514
509
  readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
515
- readonly watcherShard: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
516
- readonly watcherShardId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
517
510
  readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
518
511
  readonly $databaseId: v.LiteralSchema<"marco", undefined>;
519
512
  readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
@@ -672,7 +665,7 @@ export declare const appwrite: {
672
665
  readonly nextPollAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
673
666
  readonly provider: v.PicklistSchema<readonly ["GMAIL", "OUTLOOK", "IMAP"], undefined>;
674
667
  readonly providerCursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
675
- readonly state: v.PicklistSchema<readonly ["INITIAL", "SYNCING", "CURRENT", "IDLE", "ERROR"], undefined>;
668
+ readonly state: v.PicklistSchema<readonly ["INITIAL", "SYNCING", "CURRENT", "ERROR"], undefined>;
676
669
  readonly uidValidity: v.NullableSchema<v.StringSchema<undefined>, undefined>;
677
670
  readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
678
671
  readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
@@ -783,7 +776,7 @@ export declare const appwrite: {
783
776
  readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
784
777
  }, undefined>;
785
778
  readonly savedViews: v.StrictObjectSchema<{
786
- 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>;
787
780
  readonly icon: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
788
781
  readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
789
782
  readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
@@ -794,6 +787,20 @@ export declare const appwrite: {
794
787
  readonly $tableId: v.LiteralSchema<"saved_views", undefined>;
795
788
  readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
796
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>;
797
804
  readonly threadLabels: v.StrictObjectSchema<{
798
805
  readonly accountId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
799
806
  readonly labelId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
@@ -842,23 +849,6 @@ export declare const appwrite: {
842
849
  readonly $tableId: v.LiteralSchema<"threads", undefined>;
843
850
  readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
844
851
  }, undefined>;
845
- readonly watcherShards: v.StrictObjectSchema<{
846
- readonly accountIds: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
847
- readonly errorCode: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
848
- readonly generation: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
849
- readonly heartbeatAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
850
- readonly lastHandoffAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
851
- readonly leaseExpiresAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
852
- readonly leaseId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
853
- readonly state: v.PicklistSchema<readonly ["ACTIVE", "IDLE", "STOPPED", "FAILED"], undefined>;
854
- readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
855
- readonly $databaseId: v.LiteralSchema<"marco", undefined>;
856
- readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
857
- readonly $permissions: v.ArraySchema<v.StringSchema<undefined>, undefined>;
858
- readonly $sequence: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
859
- readonly $tableId: v.LiteralSchema<"watcher_shards", undefined>;
860
- readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
861
- }, undefined>;
862
852
  };
863
853
  };
864
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;;;;;eASxB,CAAA;AACD,QAAA,MAAM,uBAAuB;;;;;;;aAO3B,CAAA;AAEF,QAAA,MAAM,sBAAsB;;;;aAI1B,CAAA;AAGF,MAAM,MAAM,uBAAuB,GAAG,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAA;AAC/F,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAA;AAC3F,MAAM,MAAM,yBAAyB,GAAG,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAAC,CAAA;AACnG,MAAM,MAAM,wBAAwB,GAAG,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,sBAAsB,CAAC,CAAC,CAAA;AASjG,QAAA,MAAM,gBAAgB,+BAAgC,CAAA;AACtD,QAAA,MAAM,qBAAqB,wDAAyD,CAAA;AACpF,QAAA,MAAM,iBAAiB,6DAA8D,CAAA;AAKrF,QAAA,MAAM,eAAe,0CAA2C,CAAA;AAEhE,QAAA,MAAM,oBAAoB,EAAE,SAAS,CAAC,aAAa,EAAE,YAAY,EAAE,SAAS,CAA4C,CAAA;AACxH,MAAM,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CAAA;AAEV,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA7UH,MAAM;kBACZ,MAAM;wBACA;YACd,MAAM,EAAE,MAAM,CAAA;YACd,SAAS,EAAE,MAAM,CAAA;SAClB;mBACU,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,
@@ -360,17 +366,6 @@ const rowSchemas = {
360
366
  unseenLocationCount: nonNegativeIntegerSchema,
361
367
  userId: identifierSchema,
362
368
  }),
363
- watcherShards: v.strictObject({
364
- ...wireMetadata(appwriteIds.tables.watcherShards),
365
- accountIds: v.array(identifierSchema),
366
- errorCode: v.nullable(identifierSchema),
367
- generation: nonNegativeIntegerSchema,
368
- heartbeatAt: v.nullable(timestampSchema),
369
- lastHandoffAt: v.nullable(timestampSchema),
370
- leaseExpiresAt: v.nullable(timestampSchema),
371
- leaseId: v.nullable(identifierSchema),
372
- state: v.picklist(watcherShardStates),
373
- }),
374
369
  };
375
370
  export const appwrite = {
376
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',
@@ -261,18 +268,6 @@ const validRows = {
261
268
  unseenLocationCount: 0,
262
269
  userId: 'user-1',
263
270
  },
264
- watcherShards: {
265
- ...metadata,
266
- $tableId: 'watcher_shards',
267
- accountIds: ['account-1'],
268
- errorCode: null,
269
- generation: 1,
270
- heartbeatAt: null,
271
- lastHandoffAt: null,
272
- leaseExpiresAt: null,
273
- leaseId: null,
274
- state: 'ACTIVE',
275
- },
276
271
  };
277
272
  const validPollShardCoordinatorRow = {
278
273
  ...metadata,
@@ -321,9 +316,9 @@ describe('appwrite', () => {
321
316
  profiles: 'profiles',
322
317
  pushNotificationTokens: 'push_notification_tokens',
323
318
  savedViews: 'saved_views',
319
+ threadAliases: 'thread_aliases',
324
320
  threadLabels: 'thread_labels',
325
321
  threads: 'threads',
326
- watcherShards: 'watcher_shards',
327
322
  },
328
323
  });
329
324
  });
@@ -334,19 +329,22 @@ describe('appwrite', () => {
334
329
  returnUris: ['https://app.marcoapp.io/onboarding/provider-selection', 'https://app.staging.marcoapp.io/onboarding/provider-selection'],
335
330
  });
336
331
  });
337
- it('exports the additive mailbox polling contract', () => {
332
+ it('exports the final polling-only mailbox contract', () => {
338
333
  expect(appwrite.mailboxSync).toEqual({
339
334
  laneStates: ['PENDING', 'RUNNING', 'COMPLETED', 'FAILED'],
340
335
  lanes: ['HEAD', 'BACKFILL'],
341
- states: ['INITIAL', 'SYNCING', 'CURRENT', 'IDLE', 'ERROR'],
336
+ states: ['INITIAL', 'SYNCING', 'CURRENT', 'ERROR'],
342
337
  });
343
338
  expect(appwrite.polling).toEqual({ shardStates: ['ACTIVE', 'STOPPED', 'FAILED'] });
344
339
  });
345
- for (const state of ['CURRENT', 'IDLE']) {
346
- it(`accepts the transitional ${state} mailbox sync state`, () => {
347
- expect(v.safeParse(appwrite.rowSchemas.mailboxSyncStates, { ...validRows.mailboxSyncStates, state }).success).toBe(true);
348
- });
349
- }
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
+ });
350
348
  it('rejects a mailbox sync lane without a command UUID', () => {
351
349
  expect(v.safeParse(appwrite.rowSchemas.mailboxSyncLanes, {
352
350
  ...validRows.mailboxSyncLanes,
@@ -1,5 +1,5 @@
1
1
  import * as v from 'valibot';
2
- type AppwriteFunctionContext = 'authenticated' | 'internal' | 'webhook';
2
+ type AppwriteFunctionContext = 'authenticated' | 'internal' | 'public' | 'webhook';
3
3
  export declare const appwriteFunctions: {
4
4
  readonly api: {
5
5
  readonly id: "marco-api";
@@ -111,6 +111,40 @@ export declare const appwriteFunctions: {
111
111
  readonly failedAccountIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "AccountId">]>, undefined>, undefined>;
112
112
  }, undefined>;
113
113
  };
114
+ readonly authSendCode: {
115
+ errorSchema: v.StrictObjectSchema<{
116
+ readonly code: v.PicklistSchema<readonly ["AUTHENTICATION_FAILED", "AUTHORIZATION_FAILED", "CONFLICT", "INVALID_REQUEST", "NOT_FOUND", "PROVIDER_REJECTED", "TRANSIENT_FAILURE", "INTERNAL_ERROR"], undefined>;
117
+ readonly retryable: v.BooleanSchema<undefined>;
118
+ }, undefined>;
119
+ context: "public";
120
+ method: "POST";
121
+ path: "/auth/send-code";
122
+ requestSchema: v.StrictObjectSchema<{
123
+ readonly email: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, undefined>;
124
+ readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
125
+ }, undefined>;
126
+ responseSchema: v.StrictObjectSchema<{
127
+ readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
128
+ }, undefined>;
129
+ };
130
+ readonly authVerifyCode: {
131
+ errorSchema: v.StrictObjectSchema<{
132
+ readonly code: v.PicklistSchema<readonly ["AUTHENTICATION_FAILED", "AUTHORIZATION_FAILED", "CONFLICT", "INVALID_REQUEST", "NOT_FOUND", "PROVIDER_REJECTED", "TRANSIENT_FAILURE", "INTERNAL_ERROR"], undefined>;
133
+ readonly retryable: v.BooleanSchema<undefined>;
134
+ }, undefined>;
135
+ context: "public";
136
+ method: "POST";
137
+ path: "/auth/verify-code";
138
+ requestSchema: v.StrictObjectSchema<{
139
+ readonly code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
140
+ readonly email: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, undefined>;
141
+ readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
142
+ }, undefined>;
143
+ responseSchema: v.StrictObjectSchema<{
144
+ readonly secret: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
145
+ readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
146
+ }, undefined>;
147
+ };
114
148
  readonly commands: {
115
149
  errorSchema: v.StrictObjectSchema<{
116
150
  readonly code: v.PicklistSchema<readonly ["AUTHENTICATION_FAILED", "AUTHORIZATION_FAILED", "CONFLICT", "INVALID_REQUEST", "NOT_FOUND", "PROVIDER_REJECTED", "TRANSIENT_FAILURE", "INTERNAL_ERROR"], undefined>;
@@ -554,21 +588,6 @@ export declare const appwriteFunctions: {
554
588
  readonly state: v.LiteralSchema<"COMPLETED", undefined>;
555
589
  }, undefined>;
556
590
  };
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
591
  };
573
592
  };
574
593
  };
@@ -1 +1 @@
1
- {"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../src/appwrite/functions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAS5B,KAAK,uBAAuB,GAAG,eAAe,GAAG,UAAU,GAAG,SAAS,CAAA;AAuLvE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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S,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"}
@@ -48,6 +48,21 @@ const connectionResultSchema = v.strictObject({
48
48
  });
49
49
  const completedSchema = v.strictObject({ state: v.literal('COMPLETED') });
50
50
  const emptySchema = v.strictObject({});
51
+ const authUserIdSchema = appwriteRowIdSchema;
52
+ const authSendCodeRequestSchema = v.strictObject({
53
+ email: string.email(),
54
+ userId: authUserIdSchema,
55
+ });
56
+ const authSendCodeResponseSchema = v.strictObject({ userId: authUserIdSchema });
57
+ const authVerifyCodeRequestSchema = v.strictObject({
58
+ code: v.pipe(v.string(), v.regex(/^\d{6}$/)),
59
+ email: string.email(),
60
+ userId: authUserIdSchema,
61
+ });
62
+ const authVerifyCodeResponseSchema = v.strictObject({
63
+ secret: string.required(4096),
64
+ userId: authUserIdSchema,
65
+ });
51
66
  const timestampSchema = v.pipe(v.string(), v.isoTimestamp(), v.check(timestamp => {
52
67
  const milliseconds = Date.parse(timestamp);
53
68
  return Number.isFinite(milliseconds) && new Date(milliseconds).toISOString() === timestamp;
@@ -94,6 +109,20 @@ const apiRoutes = {
94
109
  failedAccountIds: v.array(id.accountId.required()),
95
110
  }),
96
111
  }),
112
+ authSendCode: createRoute({
113
+ context: 'public',
114
+ method: 'POST',
115
+ path: '/auth/send-code',
116
+ requestSchema: authSendCodeRequestSchema,
117
+ responseSchema: authSendCodeResponseSchema,
118
+ }),
119
+ authVerifyCode: createRoute({
120
+ context: 'public',
121
+ method: 'POST',
122
+ path: '/auth/verify-code',
123
+ requestSchema: authVerifyCodeRequestSchema,
124
+ responseSchema: authVerifyCodeResponseSchema,
125
+ }),
97
126
  commands: createRoute({
98
127
  context: 'authenticated',
99
128
  method: 'POST',
@@ -154,13 +183,6 @@ const workerRoutes = {
154
183
  requestSchema: emptySchema,
155
184
  responseSchema: completedSchema,
156
185
  }),
157
- watchersRun: createRoute({
158
- context: 'internal',
159
- method: 'POST',
160
- path: '/watchers/run',
161
- requestSchema: v.strictObject({ shardId: appwriteRowIdSchema }),
162
- responseSchema: completedSchema,
163
- }),
164
186
  };
165
187
  export const appwriteFunctions = {
166
188
  api: {
@@ -109,17 +109,13 @@ 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', () => {
121
115
  expect([
122
116
  { functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.profileEnsure },
117
+ { functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.authSendCode },
118
+ { functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.authVerifyCode },
123
119
  { functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.commands },
124
120
  { functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.accountsConnect },
125
121
  { functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.accountsPoll },
@@ -130,7 +126,6 @@ describe('appwriteFunctions', () => {
130
126
  { functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.pollsRun },
131
127
  { functionId: appwriteFunctions.worker.id, route: appwriteFunctions.worker.routes.supervisor },
132
128
  { functionId: appwriteFunctions.worker.id, route: appwriteFunctions.worker.routes.jobsRun },
133
- { functionId: appwriteFunctions.worker.id, route: appwriteFunctions.worker.routes.watchersRun },
134
129
  ].map(({ functionId, route }) => ({
135
130
  context: route.context,
136
131
  functionId,
@@ -138,6 +133,8 @@ describe('appwriteFunctions', () => {
138
133
  path: route.path,
139
134
  }))).toEqual([
140
135
  { context: 'authenticated', functionId: 'marco-api', method: 'POST', path: '/profile/ensure' },
136
+ { context: 'public', functionId: 'marco-api', method: 'POST', path: '/auth/send-code' },
137
+ { context: 'public', functionId: 'marco-api', method: 'POST', path: '/auth/verify-code' },
141
138
  { context: 'authenticated', functionId: 'marco-api', method: 'POST', path: '/commands' },
142
139
  { context: 'authenticated', functionId: 'marco-api', method: 'POST', path: '/accounts/connect' },
143
140
  { context: 'authenticated', functionId: 'marco-api', method: 'POST', path: '/accounts/poll' },
@@ -148,9 +145,46 @@ describe('appwriteFunctions', () => {
148
145
  { context: 'internal', functionId: 'marco-api', method: 'POST', path: '/polls/run' },
149
146
  { context: 'internal', functionId: 'marco-worker', method: 'POST', path: '/' },
150
147
  { context: 'internal', functionId: 'marco-worker', method: 'POST', path: '/jobs/run' },
151
- { context: 'internal', functionId: 'marco-worker', method: 'POST', path: '/watchers/run' },
152
148
  ]);
153
149
  });
150
+ const authRoutes = [
151
+ {
152
+ request: { email: 'test-user-email-1@example.com', userId: 'test-appwrite-user-id-1' },
153
+ response: { userId: 'test-appwrite-user-id-1' },
154
+ route: () => appwriteFunctions.api.routes.authSendCode,
155
+ },
156
+ {
157
+ request: { code: '123456', email: 'test-user-email-1@example.com', userId: 'test-appwrite-user-id-1' },
158
+ response: { secret: 'test-appwrite-secret-1', userId: 'test-appwrite-user-id-1' },
159
+ route: () => appwriteFunctions.api.routes.authVerifyCode,
160
+ },
161
+ ];
162
+ for (const { request, response, route } of authRoutes) {
163
+ it(`accepts the public ${route().path} contract`, () => {
164
+ expect(v.safeParse(route().requestSchema, request).success).toBe(true);
165
+ expect(v.safeParse(route().responseSchema, response).success).toBe(true);
166
+ });
167
+ it(`rejects unknown fields in the public ${route().path} contract`, () => {
168
+ expect(v.safeParse(route().requestSchema, { ...request, unexpected: true }).success).toBe(false);
169
+ expect(v.safeParse(route().responseSchema, { ...response, unexpected: true }).success).toBe(false);
170
+ });
171
+ }
172
+ for (const { description, request, route } of [
173
+ {
174
+ description: 'malformed email',
175
+ request: { email: 'not-an-email', userId: 'test-appwrite-user-id-1' },
176
+ route: () => appwriteFunctions.api.routes.authSendCode,
177
+ },
178
+ {
179
+ description: 'malformed code',
180
+ request: { code: '12345', email: 'test-user-email-1@example.com', userId: 'test-appwrite-user-id-1' },
181
+ route: () => appwriteFunctions.api.routes.authVerifyCode,
182
+ },
183
+ ]) {
184
+ it(`rejects a public auth request with a ${description}`, () => {
185
+ expect(v.safeParse(route().requestSchema, request).success).toBe(false);
186
+ });
187
+ }
154
188
  for (const { name, request, response, route } of routeFixtures) {
155
189
  it(`accepts the ${name} request and response`, () => {
156
190
  expect(v.safeParse(route().requestSchema, request).success).toBe(true);
@@ -178,19 +212,14 @@ describe('appwriteFunctions', () => {
178
212
  }).success).toBe(false);
179
213
  });
180
214
  }
181
- const workerShardRoutes = [
215
+ const shardRoutes = [
182
216
  {
183
217
  description: 'poll',
184
218
  request: { scheduledFor: '2026-07-23T12:00:30.000Z', shardId: 'test invalid shard id' },
185
219
  requestSchema: appwriteFunctions.api.routes.pollsRun.requestSchema,
186
220
  },
187
- {
188
- description: 'watcher',
189
- request: { shardId: 'test invalid shard id' },
190
- requestSchema: appwriteFunctions.worker.routes.watchersRun.requestSchema,
191
- },
192
221
  ];
193
- for (const { description, request, requestSchema } of workerShardRoutes) {
222
+ for (const { description, request, requestSchema } of shardRoutes) {
194
223
  it(`rejects a malformed ${description} shard ID`, () => {
195
224
  expect(v.safeParse(requestSchema, request).success).toBe(false);
196
225
  });
@@ -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.10",
3
+ "version": "4.0.1",
4
4
  "author": "team@marcoapp.io",
5
5
  "main": "dist/index.js",
6
6
  "repository": "git@github.com:marcoappio/marco-config.git",