@marcoappio/marco-config 4.0.2 → 4.0.4
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.
|
@@ -230,7 +230,12 @@ declare const rowSchemas: {
|
|
|
230
230
|
readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
231
231
|
}, undefined>;
|
|
232
232
|
readonly messages: v.StrictObjectSchema<{
|
|
233
|
-
readonly
|
|
233
|
+
readonly account: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
234
|
+
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
235
|
+
}, undefined>, v.TransformAction<{
|
|
236
|
+
$id: string;
|
|
237
|
+
}, string>]>], undefined>;
|
|
238
|
+
readonly accountAssignmentKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
234
239
|
readonly attachmentMetadata: v.StringSchema<undefined>;
|
|
235
240
|
readonly htmlFileId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
|
|
236
241
|
readonly preview: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -240,13 +245,17 @@ declare const rowSchemas: {
|
|
|
240
245
|
readonly recipients: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
241
246
|
readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
242
247
|
readonly rfcMessageId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
|
|
243
|
-
readonly sender: v.NullableSchema<v.
|
|
244
|
-
readonly senderName: v.NullableSchema<v.
|
|
248
|
+
readonly sender: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
249
|
+
readonly senderName: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
245
250
|
readonly sentAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
246
251
|
readonly size: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
247
252
|
readonly subject: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
248
|
-
readonly
|
|
249
|
-
|
|
253
|
+
readonly thread: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
254
|
+
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
255
|
+
}, undefined>, v.TransformAction<{
|
|
256
|
+
$id: string;
|
|
257
|
+
}, string>]>], undefined>;
|
|
258
|
+
readonly threadAssignmentKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
250
259
|
readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
251
260
|
readonly $databaseId: v.LiteralSchema<"marco", undefined>;
|
|
252
261
|
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
|
|
@@ -263,7 +272,7 @@ declare const rowSchemas: {
|
|
|
263
272
|
readonly operation: v.PicklistSchema<readonly ["CONNECT", "REPLACE"], undefined>;
|
|
264
273
|
readonly profile: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
265
274
|
readonly provider: v.PicklistSchema<readonly ["GMAIL", "OUTLOOK"], undefined>;
|
|
266
|
-
readonly returnUri: v.PicklistSchema<readonly ["https://app.marcoapp.io/onboarding/
|
|
275
|
+
readonly returnUri: v.PicklistSchema<readonly ["https://app.marcoapp.io/onboarding/loading"], undefined>;
|
|
267
276
|
readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
268
277
|
readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
269
278
|
readonly $databaseId: v.LiteralSchema<"marco", undefined>;
|
|
@@ -341,11 +350,19 @@ declare const rowSchemas: {
|
|
|
341
350
|
readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
342
351
|
}, undefined>;
|
|
343
352
|
readonly threadAliases: v.StrictObjectSchema<{
|
|
344
|
-
readonly
|
|
345
|
-
|
|
353
|
+
readonly alias: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
354
|
+
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
355
|
+
}, undefined>, v.TransformAction<{
|
|
356
|
+
$id: string;
|
|
357
|
+
}, string>]>], undefined>;
|
|
358
|
+
readonly aliasAssignmentKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
346
359
|
readonly latestMessageAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
347
|
-
readonly
|
|
348
|
-
|
|
360
|
+
readonly thread: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
361
|
+
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
362
|
+
}, undefined>, v.TransformAction<{
|
|
363
|
+
$id: string;
|
|
364
|
+
}, string>]>], undefined>;
|
|
365
|
+
readonly threadAssignmentKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
349
366
|
readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
350
367
|
readonly $databaseId: v.LiteralSchema<"marco", undefined>;
|
|
351
368
|
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
|
|
@@ -355,12 +372,20 @@ declare const rowSchemas: {
|
|
|
355
372
|
readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
356
373
|
}, undefined>;
|
|
357
374
|
readonly threadLabels: v.StrictObjectSchema<{
|
|
358
|
-
readonly
|
|
359
|
-
|
|
375
|
+
readonly label: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
376
|
+
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
377
|
+
}, undefined>, v.TransformAction<{
|
|
378
|
+
$id: string;
|
|
379
|
+
}, string>]>], undefined>;
|
|
380
|
+
readonly labelAssignmentKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
360
381
|
readonly latestMessageAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
361
382
|
readonly locationCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
362
|
-
readonly
|
|
363
|
-
|
|
383
|
+
readonly thread: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
384
|
+
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
385
|
+
}, undefined>, v.TransformAction<{
|
|
386
|
+
$id: string;
|
|
387
|
+
}, string>]>], undefined>;
|
|
388
|
+
readonly threadAssignmentKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
364
389
|
readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
365
390
|
readonly $databaseId: v.LiteralSchema<"marco", undefined>;
|
|
366
391
|
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
|
|
@@ -370,7 +395,12 @@ declare const rowSchemas: {
|
|
|
370
395
|
readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
371
396
|
}, undefined>;
|
|
372
397
|
readonly threads: v.StrictObjectSchema<{
|
|
373
|
-
readonly
|
|
398
|
+
readonly account: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
399
|
+
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
400
|
+
}, undefined>, v.TransformAction<{
|
|
401
|
+
$id: string;
|
|
402
|
+
}, string>]>], undefined>;
|
|
403
|
+
readonly accountAssignmentKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
374
404
|
readonly archived: v.BooleanSchema<undefined>;
|
|
375
405
|
readonly firstMessageAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
|
|
376
406
|
readonly flagged: v.BooleanSchema<undefined>;
|
|
@@ -393,7 +423,6 @@ declare const rowSchemas: {
|
|
|
393
423
|
readonly subject: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
394
424
|
readonly trashed: v.BooleanSchema<undefined>;
|
|
395
425
|
readonly unseenLocationCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
396
|
-
readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
397
426
|
readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
398
427
|
readonly $databaseId: v.LiteralSchema<"marco", undefined>;
|
|
399
428
|
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
|
|
@@ -481,8 +510,8 @@ export declare const appwrite: {
|
|
|
481
510
|
readonly oauth: {
|
|
482
511
|
readonly operations: readonly ["CONNECT", "REPLACE"];
|
|
483
512
|
readonly providers: readonly ["GMAIL", "OUTLOOK"];
|
|
484
|
-
readonly returnUriSchema: v.PicklistSchema<readonly ["https://app.marcoapp.io/onboarding/
|
|
485
|
-
readonly returnUris: readonly ["https://app.marcoapp.io/onboarding/
|
|
513
|
+
readonly returnUriSchema: v.PicklistSchema<readonly ["https://app.marcoapp.io/onboarding/loading"], undefined>;
|
|
514
|
+
readonly returnUris: readonly ["https://app.marcoapp.io/onboarding/loading"];
|
|
486
515
|
};
|
|
487
516
|
readonly polling: {
|
|
488
517
|
readonly shardStates: readonly ["ACTIVE", "STOPPED", "FAILED"];
|
|
@@ -677,7 +706,12 @@ export declare const appwrite: {
|
|
|
677
706
|
readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
678
707
|
}, undefined>;
|
|
679
708
|
readonly messages: v.StrictObjectSchema<{
|
|
680
|
-
readonly
|
|
709
|
+
readonly account: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
710
|
+
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
711
|
+
}, undefined>, v.TransformAction<{
|
|
712
|
+
$id: string;
|
|
713
|
+
}, string>]>], undefined>;
|
|
714
|
+
readonly accountAssignmentKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
681
715
|
readonly attachmentMetadata: v.StringSchema<undefined>;
|
|
682
716
|
readonly htmlFileId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
|
|
683
717
|
readonly preview: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -687,13 +721,17 @@ export declare const appwrite: {
|
|
|
687
721
|
readonly recipients: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
688
722
|
readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
689
723
|
readonly rfcMessageId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
|
|
690
|
-
readonly sender: v.NullableSchema<v.
|
|
691
|
-
readonly senderName: v.NullableSchema<v.
|
|
724
|
+
readonly sender: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
725
|
+
readonly senderName: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
692
726
|
readonly sentAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
693
727
|
readonly size: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
694
728
|
readonly subject: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
695
|
-
readonly
|
|
696
|
-
|
|
729
|
+
readonly thread: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
730
|
+
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
731
|
+
}, undefined>, v.TransformAction<{
|
|
732
|
+
$id: string;
|
|
733
|
+
}, string>]>], undefined>;
|
|
734
|
+
readonly threadAssignmentKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
697
735
|
readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
698
736
|
readonly $databaseId: v.LiteralSchema<"marco", undefined>;
|
|
699
737
|
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
|
|
@@ -710,7 +748,7 @@ export declare const appwrite: {
|
|
|
710
748
|
readonly operation: v.PicklistSchema<readonly ["CONNECT", "REPLACE"], undefined>;
|
|
711
749
|
readonly profile: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
712
750
|
readonly provider: v.PicklistSchema<readonly ["GMAIL", "OUTLOOK"], undefined>;
|
|
713
|
-
readonly returnUri: v.PicklistSchema<readonly ["https://app.marcoapp.io/onboarding/
|
|
751
|
+
readonly returnUri: v.PicklistSchema<readonly ["https://app.marcoapp.io/onboarding/loading"], undefined>;
|
|
714
752
|
readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
715
753
|
readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
716
754
|
readonly $databaseId: v.LiteralSchema<"marco", undefined>;
|
|
@@ -788,11 +826,19 @@ export declare const appwrite: {
|
|
|
788
826
|
readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
789
827
|
}, undefined>;
|
|
790
828
|
readonly threadAliases: v.StrictObjectSchema<{
|
|
791
|
-
readonly
|
|
792
|
-
|
|
829
|
+
readonly alias: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
830
|
+
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
831
|
+
}, undefined>, v.TransformAction<{
|
|
832
|
+
$id: string;
|
|
833
|
+
}, string>]>], undefined>;
|
|
834
|
+
readonly aliasAssignmentKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
793
835
|
readonly latestMessageAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
794
|
-
readonly
|
|
795
|
-
|
|
836
|
+
readonly thread: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
837
|
+
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
838
|
+
}, undefined>, v.TransformAction<{
|
|
839
|
+
$id: string;
|
|
840
|
+
}, string>]>], undefined>;
|
|
841
|
+
readonly threadAssignmentKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
796
842
|
readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
797
843
|
readonly $databaseId: v.LiteralSchema<"marco", undefined>;
|
|
798
844
|
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
|
|
@@ -802,12 +848,20 @@ export declare const appwrite: {
|
|
|
802
848
|
readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
803
849
|
}, undefined>;
|
|
804
850
|
readonly threadLabels: v.StrictObjectSchema<{
|
|
805
|
-
readonly
|
|
806
|
-
|
|
851
|
+
readonly label: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
852
|
+
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
853
|
+
}, undefined>, v.TransformAction<{
|
|
854
|
+
$id: string;
|
|
855
|
+
}, string>]>], undefined>;
|
|
856
|
+
readonly labelAssignmentKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
807
857
|
readonly latestMessageAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
808
858
|
readonly locationCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
809
|
-
readonly
|
|
810
|
-
|
|
859
|
+
readonly thread: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
860
|
+
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
861
|
+
}, undefined>, v.TransformAction<{
|
|
862
|
+
$id: string;
|
|
863
|
+
}, string>]>], undefined>;
|
|
864
|
+
readonly threadAssignmentKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
811
865
|
readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
812
866
|
readonly $databaseId: v.LiteralSchema<"marco", undefined>;
|
|
813
867
|
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
|
|
@@ -817,7 +871,12 @@ export declare const appwrite: {
|
|
|
817
871
|
readonly $updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
818
872
|
}, undefined>;
|
|
819
873
|
readonly threads: v.StrictObjectSchema<{
|
|
820
|
-
readonly
|
|
874
|
+
readonly account: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
875
|
+
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
876
|
+
}, undefined>, v.TransformAction<{
|
|
877
|
+
$id: string;
|
|
878
|
+
}, string>]>], undefined>;
|
|
879
|
+
readonly accountAssignmentKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
821
880
|
readonly archived: v.BooleanSchema<undefined>;
|
|
822
881
|
readonly firstMessageAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
|
|
823
882
|
readonly flagged: v.BooleanSchema<undefined>;
|
|
@@ -840,7 +899,6 @@ export declare const appwrite: {
|
|
|
840
899
|
readonly subject: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
841
900
|
readonly trashed: v.BooleanSchema<undefined>;
|
|
842
901
|
readonly unseenLocationCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
843
|
-
readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
844
902
|
readonly $createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
845
903
|
readonly $databaseId: v.LiteralSchema<"marco", undefined>;
|
|
846
904
|
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"appwrite.d.ts","sourceRoot":"","sources":["../../src/appwrite/appwrite.ts"],"names":[],"mappings":"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"}
|
|
@@ -8,6 +8,10 @@ const nonNegativeIntegerSchema = v.pipe(v.number(), v.integer(), v.minValue(0));
|
|
|
8
8
|
const colourSchema = v.pipe(v.string(), v.maxLength(64));
|
|
9
9
|
const emailSchema = v.pipe(v.string(), v.email());
|
|
10
10
|
const jsonObjectTextSchema = v.pipe(v.string(), v.parseJson(), v.check(value => !Array.isArray(value)), v.looseObject({}));
|
|
11
|
+
const appwriteRelationshipIdSchema = v.union([
|
|
12
|
+
identifierSchema,
|
|
13
|
+
v.pipe(v.object({ $id: identifierSchema }), v.transform(relationship => relationship.$id)),
|
|
14
|
+
]);
|
|
11
15
|
const draftAttachmentSchema = v.strictObject({
|
|
12
16
|
fileId: appwriteRowIdSchema,
|
|
13
17
|
fileName: v.pipe(v.string(), v.minLength(1), v.maxLength(255)),
|
|
@@ -48,7 +52,7 @@ const mailboxSyncLaneStates = ['PENDING', 'RUNNING', 'COMPLETED', 'FAILED'];
|
|
|
48
52
|
const mailboxSyncStates = ['INITIAL', 'SYNCING', 'CURRENT', 'ERROR'];
|
|
49
53
|
const oauthOperations = ['CONNECT', 'REPLACE'];
|
|
50
54
|
const oauthProviders = ['GMAIL', 'OUTLOOK'];
|
|
51
|
-
const oauthReturnUris = ['https://app.marcoapp.io/onboarding/
|
|
55
|
+
const oauthReturnUris = ['https://app.marcoapp.io/onboarding/loading'];
|
|
52
56
|
const oauthReturnUriSchema = v.picklist(oauthReturnUris);
|
|
53
57
|
const pollShardStates = ['ACTIVE', 'STOPPED', 'FAILED'];
|
|
54
58
|
const appwriteEnvironments = ['development', 'production', 'staging'];
|
|
@@ -252,7 +256,8 @@ const rowSchemas = {
|
|
|
252
256
|
}),
|
|
253
257
|
messages: v.strictObject({
|
|
254
258
|
...wireMetadata(appwriteIds.tables.messages),
|
|
255
|
-
|
|
259
|
+
account: appwriteRelationshipIdSchema,
|
|
260
|
+
accountAssignmentKey: identifierSchema,
|
|
256
261
|
attachmentMetadata: v.string(),
|
|
257
262
|
htmlFileId: v.nullable(identifierSchema),
|
|
258
263
|
preview: v.nullable(v.string()),
|
|
@@ -262,13 +267,13 @@ const rowSchemas = {
|
|
|
262
267
|
recipients: v.nullable(v.string()),
|
|
263
268
|
revision: nonNegativeIntegerSchema,
|
|
264
269
|
rfcMessageId: v.nullable(identifierSchema),
|
|
265
|
-
sender: v.nullable(
|
|
266
|
-
senderName: v.nullable(
|
|
270
|
+
sender: v.nullable(v.string()),
|
|
271
|
+
senderName: v.nullable(v.string()),
|
|
267
272
|
sentAt: timestampSchema,
|
|
268
273
|
size: nonNegativeIntegerSchema,
|
|
269
274
|
subject: v.nullable(v.string()),
|
|
270
|
-
|
|
271
|
-
|
|
275
|
+
thread: appwriteRelationshipIdSchema,
|
|
276
|
+
threadAssignmentKey: identifierSchema,
|
|
272
277
|
}),
|
|
273
278
|
oauthStates: v.strictObject({
|
|
274
279
|
...wireMetadata(appwriteIds.tables.oauthStates),
|
|
@@ -321,27 +326,27 @@ const rowSchemas = {
|
|
|
321
326
|
icon: v.nullable(identifierSchema),
|
|
322
327
|
name: identifierSchema,
|
|
323
328
|
}),
|
|
324
|
-
// Scalar IDs keep this hot materialisation join eligible for TablesDB bulk writes.
|
|
325
329
|
threadAliases: v.strictObject({
|
|
326
330
|
...wireMetadata(appwriteIds.tables.threadAliases),
|
|
327
|
-
|
|
328
|
-
|
|
331
|
+
alias: appwriteRelationshipIdSchema,
|
|
332
|
+
aliasAssignmentKey: identifierSchema,
|
|
329
333
|
latestMessageAt: timestampSchema,
|
|
330
|
-
|
|
331
|
-
|
|
334
|
+
thread: appwriteRelationshipIdSchema,
|
|
335
|
+
threadAssignmentKey: identifierSchema,
|
|
332
336
|
}),
|
|
333
337
|
threadLabels: v.strictObject({
|
|
334
338
|
...wireMetadata(appwriteIds.tables.threadLabels),
|
|
335
|
-
|
|
336
|
-
|
|
339
|
+
label: appwriteRelationshipIdSchema,
|
|
340
|
+
labelAssignmentKey: identifierSchema,
|
|
337
341
|
latestMessageAt: timestampSchema,
|
|
338
342
|
locationCount: nonNegativeIntegerSchema,
|
|
339
|
-
|
|
340
|
-
|
|
343
|
+
thread: appwriteRelationshipIdSchema,
|
|
344
|
+
threadAssignmentKey: identifierSchema,
|
|
341
345
|
}),
|
|
342
346
|
threads: v.strictObject({
|
|
343
347
|
...wireMetadata(appwriteIds.tables.threads),
|
|
344
|
-
|
|
348
|
+
account: appwriteRelationshipIdSchema,
|
|
349
|
+
accountAssignmentKey: identifierSchema,
|
|
345
350
|
archived: v.boolean(),
|
|
346
351
|
firstMessageAt: v.nullable(timestampSchema),
|
|
347
352
|
flagged: v.boolean(),
|
|
@@ -364,7 +369,6 @@ const rowSchemas = {
|
|
|
364
369
|
subject: v.nullable(v.string()),
|
|
365
370
|
trashed: v.boolean(),
|
|
366
371
|
unseenLocationCount: nonNegativeIntegerSchema,
|
|
367
|
-
userId: identifierSchema,
|
|
368
372
|
}),
|
|
369
373
|
};
|
|
370
374
|
export const appwrite = {
|
|
@@ -152,7 +152,8 @@ const validRows = {
|
|
|
152
152
|
messages: {
|
|
153
153
|
...metadata,
|
|
154
154
|
$tableId: 'messages',
|
|
155
|
-
|
|
155
|
+
account: 'account-1',
|
|
156
|
+
accountAssignmentKey: 'account-1',
|
|
156
157
|
attachmentMetadata: '[]',
|
|
157
158
|
htmlFileId: null,
|
|
158
159
|
preview: 'Preview',
|
|
@@ -167,8 +168,8 @@ const validRows = {
|
|
|
167
168
|
sentAt: '2026-07-15T00:00:00.000Z',
|
|
168
169
|
size: 1,
|
|
169
170
|
subject: 'Test subject',
|
|
170
|
-
|
|
171
|
-
|
|
171
|
+
thread: 'thread-1',
|
|
172
|
+
threadAssignmentKey: 'thread-1',
|
|
172
173
|
},
|
|
173
174
|
oauthStates: {
|
|
174
175
|
...metadata,
|
|
@@ -180,7 +181,7 @@ const validRows = {
|
|
|
180
181
|
operation: 'CONNECT',
|
|
181
182
|
profile: 'user-1',
|
|
182
183
|
provider: 'GMAIL',
|
|
183
|
-
returnUri: 'https://app.marcoapp.io/onboarding/
|
|
184
|
+
returnUri: 'https://app.marcoapp.io/onboarding/loading',
|
|
184
185
|
userId: 'user-1',
|
|
185
186
|
},
|
|
186
187
|
pollShards: {
|
|
@@ -224,26 +225,27 @@ const validRows = {
|
|
|
224
225
|
threadAliases: {
|
|
225
226
|
...metadata,
|
|
226
227
|
$tableId: 'thread_aliases',
|
|
227
|
-
|
|
228
|
-
|
|
228
|
+
alias: 'alias-1',
|
|
229
|
+
aliasAssignmentKey: 'alias-1',
|
|
229
230
|
latestMessageAt: '2026-07-15T00:00:00.000Z',
|
|
230
|
-
|
|
231
|
-
|
|
231
|
+
thread: 'thread-1',
|
|
232
|
+
threadAssignmentKey: 'thread-1',
|
|
232
233
|
},
|
|
233
234
|
threadLabels: {
|
|
234
235
|
...metadata,
|
|
235
236
|
$tableId: 'thread_labels',
|
|
236
|
-
|
|
237
|
-
|
|
237
|
+
label: 'label-1',
|
|
238
|
+
labelAssignmentKey: 'label-1',
|
|
238
239
|
latestMessageAt: '2026-07-15T00:00:00.000Z',
|
|
239
240
|
locationCount: 1,
|
|
240
|
-
|
|
241
|
-
|
|
241
|
+
thread: 'thread-1',
|
|
242
|
+
threadAssignmentKey: 'thread-1',
|
|
242
243
|
},
|
|
243
244
|
threads: {
|
|
244
245
|
...metadata,
|
|
245
246
|
$tableId: 'threads',
|
|
246
|
-
|
|
247
|
+
account: 'account-1',
|
|
248
|
+
accountAssignmentKey: 'account-1',
|
|
247
249
|
archived: false,
|
|
248
250
|
firstMessageAt: '2026-07-14T00:00:00.000Z',
|
|
249
251
|
flagged: false,
|
|
@@ -266,7 +268,6 @@ const validRows = {
|
|
|
266
268
|
subject: null,
|
|
267
269
|
trashed: false,
|
|
268
270
|
unseenLocationCount: 0,
|
|
269
|
-
userId: 'user-1',
|
|
270
271
|
},
|
|
271
272
|
};
|
|
272
273
|
const validPollShardCoordinatorRow = {
|
|
@@ -326,9 +327,24 @@ describe('appwrite', () => {
|
|
|
326
327
|
expect(appwrite.oauth).toMatchObject({
|
|
327
328
|
operations: ['CONNECT', 'REPLACE'],
|
|
328
329
|
providers: ['GMAIL', 'OUTLOOK'],
|
|
329
|
-
returnUris: ['https://app.marcoapp.io/onboarding/
|
|
330
|
+
returnUris: ['https://app.marcoapp.io/onboarding/loading'],
|
|
330
331
|
});
|
|
331
332
|
});
|
|
333
|
+
for (const operation of ['CONNECT', 'REPLACE']) {
|
|
334
|
+
it(`accepts a persisted ${operation} OAuth state completing at production loading`, () => {
|
|
335
|
+
expect(v.safeParse(appwrite.rowSchemas.oauthStates, { ...validRows.oauthStates, operation }).success).toBe(true);
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
for (const returnUri of [
|
|
339
|
+
'https://app.marcoapp.io/onboarding/provider-selection',
|
|
340
|
+
'https://app.staging.marcoapp.io/onboarding/loading',
|
|
341
|
+
'https://attacker.example/onboarding/loading',
|
|
342
|
+
'https://app.marcoapp.io/onboarding/loading/unexpected',
|
|
343
|
+
]) {
|
|
344
|
+
it(`rejects persisted OAuth state with unapproved return URI ${returnUri}`, () => {
|
|
345
|
+
expect(v.safeParse(appwrite.rowSchemas.oauthStates, { ...validRows.oauthStates, returnUri }).success).toBe(false);
|
|
346
|
+
});
|
|
347
|
+
}
|
|
332
348
|
it('exports the final polling-only mailbox contract', () => {
|
|
333
349
|
expect(appwrite.mailboxSync).toEqual({
|
|
334
350
|
laneStates: ['PENDING', 'RUNNING', 'COMPLETED', 'FAILED'],
|
|
@@ -394,6 +410,72 @@ describe('appwrite', () => {
|
|
|
394
410
|
expect(v.safeParse(appwrite.rowSchemas[table], rowWithoutId).success).toBe(false);
|
|
395
411
|
});
|
|
396
412
|
}
|
|
413
|
+
it('normalises Appwrite mailbox thread relationship objects to row IDs', () => {
|
|
414
|
+
const thread = v.parse(appwrite.rowSchemas.threads, { ...validRows.threads, account: { $id: 'account-1' } });
|
|
415
|
+
const message = v.parse(appwrite.rowSchemas.messages, {
|
|
416
|
+
...validRows.messages,
|
|
417
|
+
account: { $id: 'account-1' },
|
|
418
|
+
thread: { $id: 'thread-1' },
|
|
419
|
+
});
|
|
420
|
+
const threadAlias = v.parse(appwrite.rowSchemas.threadAliases, {
|
|
421
|
+
...validRows.threadAliases,
|
|
422
|
+
alias: { $id: 'alias-1' },
|
|
423
|
+
thread: { $id: 'thread-1' },
|
|
424
|
+
});
|
|
425
|
+
const threadLabel = v.parse(appwrite.rowSchemas.threadLabels, {
|
|
426
|
+
...validRows.threadLabels,
|
|
427
|
+
label: { $id: 'label-1' },
|
|
428
|
+
thread: { $id: 'thread-1' },
|
|
429
|
+
});
|
|
430
|
+
expect(thread.account).toBe('account-1');
|
|
431
|
+
expect(message.account).toBe('account-1');
|
|
432
|
+
expect(message.thread).toBe('thread-1');
|
|
433
|
+
expect(threadAlias.alias).toBe('alias-1');
|
|
434
|
+
expect(threadAlias.thread).toBe('thread-1');
|
|
435
|
+
expect(threadLabel.label).toBe('label-1');
|
|
436
|
+
expect(threadLabel.thread).toBe('thread-1');
|
|
437
|
+
});
|
|
438
|
+
it('accepts backend message sender fields as plain nullable text', () => {
|
|
439
|
+
expect(v.safeParse(appwrite.rowSchemas.messages, {
|
|
440
|
+
...validRows.messages,
|
|
441
|
+
sender: 'not-an-email',
|
|
442
|
+
senderName: '',
|
|
443
|
+
}).success).toBe(true);
|
|
444
|
+
});
|
|
445
|
+
const requiredRelationshipFieldTestCases = [
|
|
446
|
+
{ field: 'account', row: { ...validRows.messages, account: null }, schema: appwrite.rowSchemas.messages, table: 'messages' },
|
|
447
|
+
{ field: 'thread', row: { ...validRows.messages, thread: null }, schema: appwrite.rowSchemas.messages, table: 'messages' },
|
|
448
|
+
{ field: 'account', row: { ...validRows.threads, account: null }, schema: appwrite.rowSchemas.threads, table: 'threads' },
|
|
449
|
+
{ field: 'alias', row: { ...validRows.threadAliases, alias: null }, schema: appwrite.rowSchemas.threadAliases, table: 'threadAliases' },
|
|
450
|
+
{ field: 'thread', row: { ...validRows.threadAliases, thread: null }, schema: appwrite.rowSchemas.threadAliases, table: 'threadAliases' },
|
|
451
|
+
{ field: 'label', row: { ...validRows.threadLabels, label: null }, schema: appwrite.rowSchemas.threadLabels, table: 'threadLabels' },
|
|
452
|
+
{ field: 'thread', row: { ...validRows.threadLabels, thread: null }, schema: appwrite.rowSchemas.threadLabels, table: 'threadLabels' },
|
|
453
|
+
];
|
|
454
|
+
for (const { field, row, schema, table } of requiredRelationshipFieldTestCases) {
|
|
455
|
+
it(`rejects nullable ${field} relationships on ${table}`, () => {
|
|
456
|
+
expect(v.safeParse(schema, row).success).toBe(false);
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
const obsoleteMailboxThreadFieldTestCases = [
|
|
460
|
+
{ field: 'accountId', row: { ...validRows.messages, accountId: 'account-1' }, schema: appwrite.rowSchemas.messages, table: 'messages' },
|
|
461
|
+
{ field: 'threadId', row: { ...validRows.messages, threadId: 'thread-1' }, schema: appwrite.rowSchemas.messages, table: 'messages' },
|
|
462
|
+
{ field: 'userId', row: { ...validRows.messages, userId: 'user-1' }, schema: appwrite.rowSchemas.messages, table: 'messages' },
|
|
463
|
+
{ field: 'accountId', row: { ...validRows.threads, accountId: 'account-1' }, schema: appwrite.rowSchemas.threads, table: 'threads' },
|
|
464
|
+
{ field: 'userId', row: { ...validRows.threads, userId: 'user-1' }, schema: appwrite.rowSchemas.threads, table: 'threads' },
|
|
465
|
+
{ field: 'accountId', row: { ...validRows.threadAliases, accountId: 'account-1' }, schema: appwrite.rowSchemas.threadAliases, table: 'threadAliases' },
|
|
466
|
+
{ field: 'aliasId', row: { ...validRows.threadAliases, aliasId: 'alias-1' }, schema: appwrite.rowSchemas.threadAliases, table: 'threadAliases' },
|
|
467
|
+
{ field: 'threadId', row: { ...validRows.threadAliases, threadId: 'thread-1' }, schema: appwrite.rowSchemas.threadAliases, table: 'threadAliases' },
|
|
468
|
+
{ field: 'userId', row: { ...validRows.threadAliases, userId: 'user-1' }, schema: appwrite.rowSchemas.threadAliases, table: 'threadAliases' },
|
|
469
|
+
{ field: 'accountId', row: { ...validRows.threadLabels, accountId: 'account-1' }, schema: appwrite.rowSchemas.threadLabels, table: 'threadLabels' },
|
|
470
|
+
{ field: 'labelId', row: { ...validRows.threadLabels, labelId: 'label-1' }, schema: appwrite.rowSchemas.threadLabels, table: 'threadLabels' },
|
|
471
|
+
{ field: 'threadId', row: { ...validRows.threadLabels, threadId: 'thread-1' }, schema: appwrite.rowSchemas.threadLabels, table: 'threadLabels' },
|
|
472
|
+
{ field: 'userId', row: { ...validRows.threadLabels, userId: 'user-1' }, schema: appwrite.rowSchemas.threadLabels, table: 'threadLabels' },
|
|
473
|
+
];
|
|
474
|
+
for (const { field, row, schema, table } of obsoleteMailboxThreadFieldTestCases) {
|
|
475
|
+
it(`rejects obsolete ${field} on ${table}`, () => {
|
|
476
|
+
expect(v.safeParse(schema, row).success).toBe(false);
|
|
477
|
+
});
|
|
478
|
+
}
|
|
397
479
|
const nullableColumnTestCases = [
|
|
398
480
|
{
|
|
399
481
|
description: 'alias name',
|
|
@@ -18,7 +18,7 @@ export declare const appwriteFunctions: {
|
|
|
18
18
|
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
19
19
|
readonly kind: v.LiteralSchema<"OAUTH", undefined>;
|
|
20
20
|
readonly provider: v.PicklistSchema<["GMAIL", "OUTLOOK"], undefined>;
|
|
21
|
-
readonly returnUri: v.PicklistSchema<readonly ["https://app.marcoapp.io/onboarding/
|
|
21
|
+
readonly returnUri: v.PicklistSchema<readonly ["https://app.marcoapp.io/onboarding/loading"], undefined>;
|
|
22
22
|
}, undefined>, v.StrictObjectSchema<{
|
|
23
23
|
readonly imap: v.StrictObjectSchema<{
|
|
24
24
|
readonly host: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
@@ -69,7 +69,7 @@ export declare const appwriteFunctions: {
|
|
|
69
69
|
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
70
70
|
readonly kind: v.LiteralSchema<"OAUTH", undefined>;
|
|
71
71
|
readonly provider: v.PicklistSchema<["GMAIL", "OUTLOOK"], undefined>;
|
|
72
|
-
readonly returnUri: v.PicklistSchema<readonly ["https://app.marcoapp.io/onboarding/
|
|
72
|
+
readonly returnUri: v.PicklistSchema<readonly ["https://app.marcoapp.io/onboarding/loading"], undefined>;
|
|
73
73
|
}, undefined>, v.StrictObjectSchema<{
|
|
74
74
|
readonly imap: v.StrictObjectSchema<{
|
|
75
75
|
readonly host: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
@@ -54,7 +54,7 @@ const routeFixtures = [
|
|
|
54
54
|
email: 'test-user@example.com',
|
|
55
55
|
kind: 'OAUTH',
|
|
56
56
|
provider: 'GMAIL',
|
|
57
|
-
returnUri: 'https://app.marcoapp.io/onboarding/
|
|
57
|
+
returnUri: 'https://app.marcoapp.io/onboarding/loading',
|
|
58
58
|
},
|
|
59
59
|
},
|
|
60
60
|
response: {
|
|
@@ -314,16 +314,12 @@ describe('appwriteFunctions', () => {
|
|
|
314
314
|
description: 'a malformed mailbox email',
|
|
315
315
|
expected: false,
|
|
316
316
|
},
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
},
|
|
324
|
-
description: 'an unapproved return destination',
|
|
325
|
-
expected: false,
|
|
326
|
-
},
|
|
317
|
+
];
|
|
318
|
+
const forbiddenOAuthReturnUris = [
|
|
319
|
+
{ description: 'provider-selection', returnUri: 'https://app.marcoapp.io/onboarding/provider-selection' },
|
|
320
|
+
{ description: 'staging loading', returnUri: 'https://app.staging.marcoapp.io/onboarding/loading' },
|
|
321
|
+
{ description: 'arbitrary origin', returnUri: 'https://attacker.example/onboarding/loading' },
|
|
322
|
+
{ description: 'arbitrary path', returnUri: 'https://app.marcoapp.io/onboarding/loading/unexpected' },
|
|
327
323
|
];
|
|
328
324
|
const oauthConnectionRoutes = [
|
|
329
325
|
{
|
|
@@ -337,6 +333,18 @@ describe('appwriteFunctions', () => {
|
|
|
337
333
|
requestSchema: appwriteFunctions.api.routes.accountConnection.requestSchema,
|
|
338
334
|
},
|
|
339
335
|
];
|
|
336
|
+
for (const { description, includesAccountId, requestSchema } of oauthConnectionRoutes) {
|
|
337
|
+
it(`accepts ${description} OAuth connection completing at production loading`, () => {
|
|
338
|
+
const connection = {
|
|
339
|
+
email: 'test-user@example.com',
|
|
340
|
+
kind: 'OAUTH',
|
|
341
|
+
provider: 'GMAIL',
|
|
342
|
+
returnUri: 'https://app.marcoapp.io/onboarding/loading',
|
|
343
|
+
};
|
|
344
|
+
const request = includesAccountId ? { accountId: 'account_1', connection } : { connection };
|
|
345
|
+
expect(v.safeParse(requestSchema, request).success).toBe(true);
|
|
346
|
+
});
|
|
347
|
+
}
|
|
340
348
|
for (const { connection, description, expected } of invalidOAuthConnections) {
|
|
341
349
|
for (const { description: routeDescription, includesAccountId, requestSchema } of oauthConnectionRoutes) {
|
|
342
350
|
it(`rejects ${routeDescription} OAuth connection with ${description}`, () => {
|
|
@@ -345,4 +353,18 @@ describe('appwriteFunctions', () => {
|
|
|
345
353
|
});
|
|
346
354
|
}
|
|
347
355
|
}
|
|
356
|
+
for (const { description, returnUri } of forbiddenOAuthReturnUris) {
|
|
357
|
+
for (const { description: routeDescription, includesAccountId, requestSchema } of oauthConnectionRoutes) {
|
|
358
|
+
it(`rejects ${routeDescription} OAuth connection with ${description} return URI`, () => {
|
|
359
|
+
const connection = {
|
|
360
|
+
email: 'test-user@example.com',
|
|
361
|
+
kind: 'OAUTH',
|
|
362
|
+
provider: 'GMAIL',
|
|
363
|
+
returnUri,
|
|
364
|
+
};
|
|
365
|
+
const request = includesAccountId ? { accountId: 'account_1', connection } : { connection };
|
|
366
|
+
expect(v.safeParse(requestSchema, request).success).toBe(false);
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
}
|
|
348
370
|
});
|