@marcoappio/marco-config 4.0.6 → 4.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/appwrite/appwrite.d.ts +12 -12
- package/dist/appwrite/appwrite.d.ts.map +1 -1
- package/dist/appwrite/appwrite.js +8 -6
- package/dist/appwrite/appwrite.test.js +18 -0
- package/dist/appwrite/commands.d.ts +3 -3
- package/dist/appwrite/commands.js +3 -3
- package/dist/appwrite/commands.test.js +12 -0
- package/dist/appwrite/functions.d.ts +3 -3
- package/dist/schemas/index.d.ts +16 -15
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/models/contact.d.ts +1 -1
- package/dist/schemas/models/contact.js +1 -1
- package/dist/schemas/models/draft.d.ts +6 -6
- package/dist/schemas/models/draft.js +3 -3
- package/dist/schemas/models/mailboxAddress.test.d.ts +2 -0
- package/dist/schemas/models/mailboxAddress.test.d.ts.map +1 -0
- package/dist/schemas/models/mailboxAddress.test.js +31 -0
- package/dist/schemas/models/thread.d.ts +8 -8
- package/dist/schemas/models/thread.js +3 -3
- package/dist/schemas/string.d.ts +1 -0
- package/dist/schemas/string.d.ts.map +1 -1
- package/dist/schemas/string.js +1 -0
- package/package.json +1 -1
|
@@ -8,10 +8,10 @@ declare const draftAttachmentSchema: v.StrictObjectSchema<{
|
|
|
8
8
|
readonly size: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
9
9
|
}, undefined>;
|
|
10
10
|
declare const draftEnvelopeSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.ParseJsonAction<string, undefined, undefined>, v.StrictObjectSchema<{
|
|
11
|
-
readonly bcc: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
12
|
-
readonly cc: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
11
|
+
readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
12
|
+
readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
13
13
|
readonly subject: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
14
|
-
readonly to: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
14
|
+
readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
15
15
|
}, undefined>]>;
|
|
16
16
|
declare const messageAttachmentSchema: v.LooseObjectSchema<{
|
|
17
17
|
readonly fileId: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>, undefined>, undefined>;
|
|
@@ -22,7 +22,7 @@ declare const messageAttachmentSchema: v.LooseObjectSchema<{
|
|
|
22
22
|
readonly size: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
23
23
|
}, undefined>;
|
|
24
24
|
declare const messageRecipientSchema: v.StrictObjectSchema<{
|
|
25
|
-
readonly emailAddress: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
25
|
+
readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
26
26
|
readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
|
|
27
27
|
readonly type: v.PicklistSchema<readonly ["bcc", "cc", "to", "replyTo"], undefined>;
|
|
28
28
|
}, undefined>;
|
|
@@ -137,7 +137,7 @@ declare const rowSchemas: {
|
|
|
137
137
|
readonly displayName: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
|
|
138
138
|
readonly lastContactedAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
|
|
139
139
|
readonly messageCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
140
|
-
readonly normalisedAddress: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
140
|
+
readonly normalisedAddress: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
141
141
|
readonly profile: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
142
142
|
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
143
143
|
}, undefined>, v.TransformAction<{
|
|
@@ -579,7 +579,7 @@ declare const rowSchemas: {
|
|
|
579
579
|
readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
580
580
|
readonly searchText: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
581
581
|
readonly seen: v.BooleanSchema<undefined>;
|
|
582
|
-
readonly senderEmail: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
582
|
+
readonly senderEmail: v.NullableSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
583
583
|
readonly senderName: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
|
|
584
584
|
readonly snoozedUntil: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
|
|
585
585
|
readonly spam: v.BooleanSchema<undefined>;
|
|
@@ -605,10 +605,10 @@ export declare const appwrite: {
|
|
|
605
605
|
readonly size: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
606
606
|
}, undefined>, undefined>]>;
|
|
607
607
|
readonly draftEnvelope: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.ParseJsonAction<string, undefined, undefined>, v.StrictObjectSchema<{
|
|
608
|
-
readonly bcc: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
609
|
-
readonly cc: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
608
|
+
readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
609
|
+
readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
610
610
|
readonly subject: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
611
|
-
readonly to: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
611
|
+
readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
612
612
|
}, undefined>]>;
|
|
613
613
|
readonly jobPayload: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.ParseJsonAction<string, undefined, undefined>, v.CheckAction<unknown, undefined>, v.LooseObjectSchema<{}, undefined>]>;
|
|
614
614
|
readonly messageAttachments: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.ParseJsonAction<string, undefined, undefined>, v.ArraySchema<v.LooseObjectSchema<{
|
|
@@ -620,7 +620,7 @@ export declare const appwrite: {
|
|
|
620
620
|
readonly size: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
621
621
|
}, undefined>, undefined>]>;
|
|
622
622
|
readonly messageRecipients: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.ParseJsonAction<string, undefined, undefined>, v.ArraySchema<v.StrictObjectSchema<{
|
|
623
|
-
readonly emailAddress: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
623
|
+
readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
624
624
|
readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
|
|
625
625
|
readonly type: v.PicklistSchema<readonly ["bcc", "cc", "to", "replyTo"], undefined>;
|
|
626
626
|
}, undefined>, undefined>]>;
|
|
@@ -779,7 +779,7 @@ export declare const appwrite: {
|
|
|
779
779
|
readonly displayName: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
|
|
780
780
|
readonly lastContactedAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
|
|
781
781
|
readonly messageCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
782
|
-
readonly normalisedAddress: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
782
|
+
readonly normalisedAddress: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
783
783
|
readonly profile: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
784
784
|
readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
785
785
|
}, undefined>, v.TransformAction<{
|
|
@@ -1221,7 +1221,7 @@ export declare const appwrite: {
|
|
|
1221
1221
|
readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
1222
1222
|
readonly searchText: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1223
1223
|
readonly seen: v.BooleanSchema<undefined>;
|
|
1224
|
-
readonly senderEmail: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
1224
|
+
readonly senderEmail: v.NullableSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
1225
1225
|
readonly senderName: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
|
|
1226
1226
|
readonly snoozedUntil: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
|
|
1227
1227
|
readonly spam: v.BooleanSchema<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;
|
|
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;AAM5B,eAAO,MAAM,mBAAmB,6KAA+F,CAAA;AAoB/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,qDAAsD,CAAA;AAK7E,QAAA,MAAM,eAAe,0CAA2C,CAAA;AAChE,QAAA,MAAM,oBAAoB,EAAE,SAAS,CAAC,aAAa,EAAE,YAAY,EAAE,SAAS,CAA4C,CAAA;AACxH,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AA0CvE,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAA;AACvE,MAAM,MAAM,4BAA4B,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAA;AACjF,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAA;AACzE,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAA;AA8CrE,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4SN,CAAA;AAEV,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAtYH,MAAM;kBACZ,MAAM;wBACA;YACd,MAAM,EAAE,MAAM,CAAA;YACd,SAAS,EAAE,MAAM,CAAA;SAClB;mBACU,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgZT,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"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
+
import { string } from '../schemas/string';
|
|
2
3
|
import { MESSAGE_RECIPIENT_TYPES } from '../types';
|
|
3
4
|
const identifierSchema = v.pipe(v.string(), v.minLength(1), v.maxLength(255));
|
|
4
5
|
export const appwriteRowIdSchema = v.pipe(v.string(), v.minLength(1), v.maxLength(36), v.regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/));
|
|
@@ -6,6 +7,7 @@ const timestampSchema = v.pipe(v.string(), v.isoTimestamp());
|
|
|
6
7
|
const nonNegativeIntegerSchema = v.pipe(v.number(), v.integer(), v.minValue(0));
|
|
7
8
|
const colourSchema = v.pipe(v.string(), v.maxLength(64));
|
|
8
9
|
const emailSchema = v.pipe(v.string(), v.email());
|
|
10
|
+
const mailboxAddressSchema = string.mailboxAddress();
|
|
9
11
|
const mailboxSortKeySchema = v.pipe(v.string(), v.minLength(1), v.maxLength(257));
|
|
10
12
|
const jsonObjectTextSchema = v.pipe(v.string(), v.parseJson(), v.check(value => !Array.isArray(value)), v.looseObject({}));
|
|
11
13
|
const appwriteRelationshipIdSchema = v.union([
|
|
@@ -20,10 +22,10 @@ const draftAttachmentSchema = v.strictObject({
|
|
|
20
22
|
});
|
|
21
23
|
const draftAttachmentsSchema = v.pipe(v.string(), v.parseJson(), v.array(draftAttachmentSchema));
|
|
22
24
|
const draftEnvelopeSchema = v.pipe(v.string(), v.parseJson(), v.strictObject({
|
|
23
|
-
bcc: v.array(
|
|
24
|
-
cc: v.array(
|
|
25
|
+
bcc: v.array(mailboxAddressSchema),
|
|
26
|
+
cc: v.array(mailboxAddressSchema),
|
|
25
27
|
subject: v.nullable(v.string()),
|
|
26
|
-
to: v.array(
|
|
28
|
+
to: v.array(mailboxAddressSchema),
|
|
27
29
|
}));
|
|
28
30
|
const messageAttachmentSchema = v.looseObject({
|
|
29
31
|
fileId: v.optional(v.nullable(appwriteRowIdSchema)),
|
|
@@ -35,7 +37,7 @@ const messageAttachmentSchema = v.looseObject({
|
|
|
35
37
|
});
|
|
36
38
|
const messageAttachmentsSchema = v.pipe(v.string(), v.parseJson(), v.array(messageAttachmentSchema));
|
|
37
39
|
const messageRecipientSchema = v.strictObject({
|
|
38
|
-
emailAddress:
|
|
40
|
+
emailAddress: mailboxAddressSchema,
|
|
39
41
|
name: v.nullable(identifierSchema),
|
|
40
42
|
type: v.picklist(MESSAGE_RECIPIENT_TYPES),
|
|
41
43
|
});
|
|
@@ -179,7 +181,7 @@ const rowSchemas = {
|
|
|
179
181
|
displayName: v.nullable(identifierSchema),
|
|
180
182
|
lastContactedAt: v.nullable(timestampSchema),
|
|
181
183
|
messageCount: nonNegativeIntegerSchema,
|
|
182
|
-
normalisedAddress:
|
|
184
|
+
normalisedAddress: mailboxAddressSchema,
|
|
183
185
|
profile: appwriteRelationshipIdSchema,
|
|
184
186
|
profileAssignmentKey: identifierSchema,
|
|
185
187
|
searchText: v.string(),
|
|
@@ -419,7 +421,7 @@ const rowSchemas = {
|
|
|
419
421
|
revision: nonNegativeIntegerSchema,
|
|
420
422
|
searchText: v.nullable(v.string()),
|
|
421
423
|
seen: v.boolean(),
|
|
422
|
-
senderEmail: v.nullable(
|
|
424
|
+
senderEmail: v.nullable(mailboxAddressSchema),
|
|
423
425
|
senderName: v.nullable(identifierSchema),
|
|
424
426
|
snoozedUntil: v.nullable(timestampSchema),
|
|
425
427
|
spam: v.boolean(),
|
|
@@ -804,6 +804,24 @@ describe('appwrite', () => {
|
|
|
804
804
|
expect(v.safeParse(schema, row).success).toBe(true);
|
|
805
805
|
});
|
|
806
806
|
}
|
|
807
|
+
it('accepts provider-derived RFC email addresses', () => {
|
|
808
|
+
const maximumLengthMailboxAddress = `${'a'.repeat(64)}@${'b'.repeat(63)}.${'c'.repeat(63)}.${'d'.repeat(63)}.${'e'.repeat(63)}`;
|
|
809
|
+
const mailboxAddresses = ['sender@example', 'first.last+tag@example.com', maximumLengthMailboxAddress];
|
|
810
|
+
expect(maximumLengthMailboxAddress).toHaveLength(320);
|
|
811
|
+
for (const mailboxAddress of mailboxAddresses) {
|
|
812
|
+
expect(v.safeParse(appwrite.rowSchemas.contacts, { ...validRows.contacts, normalisedAddress: mailboxAddress }).success).toBe(true);
|
|
813
|
+
expect(v.safeParse(appwrite.rowSchemas.threads, { ...validRows.threads, senderEmail: mailboxAddress }).success).toBe(true);
|
|
814
|
+
expect(v.safeParse(appwrite.decodedSchemas.draftEnvelope, JSON.stringify({ bcc: [mailboxAddress], cc: [mailboxAddress], subject: null, to: [mailboxAddress] })).success).toBe(true);
|
|
815
|
+
expect(v.safeParse(appwrite.decodedSchemas.messageRecipients, JSON.stringify([{ emailAddress: mailboxAddress, name: null, type: 'to' }])).success).toBe(true);
|
|
816
|
+
}
|
|
817
|
+
expect(v.safeParse(appwrite.rowSchemas.contacts, { ...validRows.contacts, normalisedAddress: '' }).success).toBe(false);
|
|
818
|
+
expect(v.safeParse(appwrite.rowSchemas.contacts, { ...validRows.contacts, normalisedAddress: 'invalid@@example.com' }).success).toBe(false);
|
|
819
|
+
expect(v.safeParse(appwrite.rowSchemas.contacts, { ...validRows.contacts, normalisedAddress: 'a'.repeat(321) }).success).toBe(false);
|
|
820
|
+
});
|
|
821
|
+
it('keeps account identity emails on the strict web-email boundary', () => {
|
|
822
|
+
expect(v.safeParse(appwrite.rowSchemas.accounts, { ...validRows.accounts, primaryEmail: 'sender@example' }).success).toBe(false);
|
|
823
|
+
expect(v.safeParse(appwrite.rowSchemas.aliases, { ...validRows.aliases, email: '"a@b"@example.com' }).success).toBe(false);
|
|
824
|
+
});
|
|
807
825
|
const { name: _aliasName, ...aliasWithoutName } = validRows.aliases;
|
|
808
826
|
const { signature: _aliasSignature, ...aliasWithoutSignature } = validRows.aliases;
|
|
809
827
|
const { displayName: _contactDisplayName, ...contactWithoutDisplayName } = validRows.contacts;
|
|
@@ -241,11 +241,11 @@ export declare const appwriteCommands: {
|
|
|
241
241
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.BrandAction<string, "CommandId">]>;
|
|
242
242
|
readonly kind: v.LiteralSchema<"draft.envelope.set", undefined>;
|
|
243
243
|
readonly payload: v.StrictObjectSchema<{
|
|
244
|
-
readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, undefined>, undefined>;
|
|
245
|
-
readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, undefined>, undefined>;
|
|
244
|
+
readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
245
|
+
readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
246
246
|
readonly draftId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "DraftId">]>, undefined>;
|
|
247
247
|
readonly subject: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 998, undefined>]>, undefined>;
|
|
248
|
-
readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, undefined>, undefined>;
|
|
248
|
+
readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
249
249
|
}, undefined>;
|
|
250
250
|
readonly submittedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
251
251
|
readonly version: v.LiteralSchema<1, undefined>;
|
|
@@ -150,11 +150,11 @@ const draftContentSetPayloadSchema = v.strictObject({
|
|
|
150
150
|
html: v.pipe(v.string(), v.maxLength(384_000)),
|
|
151
151
|
});
|
|
152
152
|
const draftEnvelopeSetPayloadSchema = v.strictObject({
|
|
153
|
-
bcc: v.array(string.
|
|
154
|
-
cc: v.array(string.
|
|
153
|
+
bcc: v.array(string.mailboxAddress()),
|
|
154
|
+
cc: v.array(string.mailboxAddress()),
|
|
155
155
|
draftId: id.draftId.required(),
|
|
156
156
|
subject: v.nullable(v.pipe(v.string(), v.maxLength(998))),
|
|
157
|
-
to: v.array(string.
|
|
157
|
+
to: v.array(string.mailboxAddress()),
|
|
158
158
|
});
|
|
159
159
|
const draftFromSetPayloadSchema = v.strictObject({
|
|
160
160
|
draftId: id.draftId.required(),
|
|
@@ -308,6 +308,18 @@ describe('appwriteCommands', () => {
|
|
|
308
308
|
},
|
|
309
309
|
}).success).toBe(false);
|
|
310
310
|
});
|
|
311
|
+
it('uses the persisted mailbox-address boundary for draft recipients', () => {
|
|
312
|
+
const command = {
|
|
313
|
+
...commandMetadata,
|
|
314
|
+
accountId: 'account_1',
|
|
315
|
+
kind: 'draft.envelope.set',
|
|
316
|
+
payload: { bcc: ['sender@example'], cc: ['sender@example'], draftId: 'draft_1', subject: null, to: ['sender@example'] },
|
|
317
|
+
};
|
|
318
|
+
const overlongAddress = `${'a'.repeat(65)}@${'b'.repeat(63)}.${'c'.repeat(63)}.${'d'.repeat(63)}.${'e'.repeat(63)}`;
|
|
319
|
+
expect(overlongAddress).toHaveLength(321);
|
|
320
|
+
expect(v.safeParse(appwriteCommands.requestSchema, command).success).toBe(true);
|
|
321
|
+
expect(v.safeParse(appwriteCommands.requestSchema, { ...command, payload: { ...command.payload, to: [overlongAddress] } }).success).toBe(false);
|
|
322
|
+
});
|
|
311
323
|
for (const { command } of commandFixtures) {
|
|
312
324
|
it(`accepts ${command.kind}`, () => {
|
|
313
325
|
expect(v.safeParse(appwriteCommands.requestSchema, command).success).toBe(true);
|
|
@@ -384,11 +384,11 @@ export declare const appwriteFunctions: {
|
|
|
384
384
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.BrandAction<string, "CommandId">]>;
|
|
385
385
|
readonly kind: v.LiteralSchema<"draft.envelope.set", undefined>;
|
|
386
386
|
readonly payload: v.StrictObjectSchema<{
|
|
387
|
-
readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, undefined>, undefined>;
|
|
388
|
-
readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, undefined>, undefined>;
|
|
387
|
+
readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
388
|
+
readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
389
389
|
readonly draftId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "DraftId">]>, undefined>;
|
|
390
390
|
readonly subject: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 998, undefined>]>, undefined>;
|
|
391
|
-
readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, undefined>, undefined>;
|
|
391
|
+
readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
392
392
|
}, undefined>;
|
|
393
393
|
readonly submittedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
394
394
|
readonly version: v.LiteralSchema<1, undefined>;
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -146,7 +146,7 @@ export declare const marcoSchemas: {
|
|
|
146
146
|
readonly userId: 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, "UserId">]>, undefined>;
|
|
147
147
|
}, undefined>;
|
|
148
148
|
contactSchema: import("valibot").ObjectSchema<{
|
|
149
|
-
readonly emailAddress: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").
|
|
149
|
+
readonly emailAddress: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RfcEmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
150
150
|
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, "ContactId">]>, undefined>;
|
|
151
151
|
readonly name: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
152
152
|
readonly userId: 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, "UserId">]>, undefined>;
|
|
@@ -160,10 +160,10 @@ export declare const marcoSchemas: {
|
|
|
160
160
|
readonly totalSize: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
|
|
161
161
|
}, undefined>;
|
|
162
162
|
draftBodySchema: import("valibot").ObjectSchema<{
|
|
163
|
-
readonly bcc: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").
|
|
164
|
-
readonly cc: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").
|
|
163
|
+
readonly bcc: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RfcEmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
164
|
+
readonly cc: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RfcEmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
165
165
|
readonly content: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MaxLengthAction<string, 384000, undefined>]>;
|
|
166
|
-
readonly to: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").
|
|
166
|
+
readonly to: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RfcEmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
167
167
|
}, undefined>;
|
|
168
168
|
draftSchema: import("valibot").ObjectSchema<{
|
|
169
169
|
readonly accountId: 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, "AccountId">]>, undefined>;
|
|
@@ -176,10 +176,10 @@ export declare const marcoSchemas: {
|
|
|
176
176
|
readonly totalSize: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
|
|
177
177
|
}, undefined>, undefined>;
|
|
178
178
|
readonly body: import("valibot").ObjectSchema<{
|
|
179
|
-
readonly bcc: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").
|
|
180
|
-
readonly cc: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").
|
|
179
|
+
readonly bcc: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RfcEmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
180
|
+
readonly cc: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RfcEmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
181
181
|
readonly content: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MaxLengthAction<string, 384000, undefined>]>;
|
|
182
|
-
readonly to: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").
|
|
182
|
+
readonly to: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RfcEmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
183
183
|
}, undefined>;
|
|
184
184
|
readonly error: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
185
185
|
readonly fromAliasId: import("valibot").NullableSchema<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>;
|
|
@@ -209,13 +209,13 @@ export declare const marcoSchemas: {
|
|
|
209
209
|
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, "MessageId">]>, undefined>;
|
|
210
210
|
readonly previewText: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
211
211
|
readonly recipients: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
212
|
-
readonly emailAddress: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").
|
|
212
|
+
readonly emailAddress: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RfcEmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
213
213
|
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, "RecipientId">]>, undefined>;
|
|
214
214
|
readonly name: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
215
215
|
readonly threadMessageId: 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, "MessageId">]>, undefined>;
|
|
216
216
|
readonly type: import("valibot").PicklistSchema<readonly ["bcc", "cc", "to", "replyTo"], undefined>;
|
|
217
217
|
}, undefined>, undefined>;
|
|
218
|
-
readonly senderEmail: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").
|
|
218
|
+
readonly senderEmail: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RfcEmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
219
219
|
readonly senderName: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
220
220
|
readonly threadId: 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, "ThreadId">]>, undefined>;
|
|
221
221
|
readonly unsubscribeUrl: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
@@ -230,7 +230,7 @@ export declare const marcoSchemas: {
|
|
|
230
230
|
readonly messageCount: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
|
|
231
231
|
readonly previewText: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
232
232
|
readonly seen: import("valibot").BooleanSchema<undefined>;
|
|
233
|
-
readonly senderEmail: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").
|
|
233
|
+
readonly senderEmail: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RfcEmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
234
234
|
readonly senderName: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
235
235
|
readonly snoozedUntil: import("valibot").NullableSchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
|
|
236
236
|
readonly subject: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
@@ -248,7 +248,7 @@ export declare const marcoSchemas: {
|
|
|
248
248
|
messageCount: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
|
|
249
249
|
previewText: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
250
250
|
seen: import("valibot").BooleanSchema<undefined>;
|
|
251
|
-
senderEmail: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").
|
|
251
|
+
senderEmail: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RfcEmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
252
252
|
senderName: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
253
253
|
snoozedUntil: import("valibot").NullableSchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
|
|
254
254
|
subject: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
@@ -263,7 +263,7 @@ export declare const marcoSchemas: {
|
|
|
263
263
|
readonly threadMessageId: 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, "MessageId">]>, undefined>;
|
|
264
264
|
}, undefined>;
|
|
265
265
|
threadMessageRecipientSchema: import("valibot").ObjectSchema<{
|
|
266
|
-
readonly emailAddress: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").
|
|
266
|
+
readonly emailAddress: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RfcEmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
267
267
|
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, "RecipientId">]>, undefined>;
|
|
268
268
|
readonly name: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
269
269
|
readonly threadMessageId: 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, "MessageId">]>, undefined>;
|
|
@@ -283,13 +283,13 @@ export declare const marcoSchemas: {
|
|
|
283
283
|
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, "MessageId">]>, undefined>;
|
|
284
284
|
readonly previewText: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
285
285
|
readonly recipients: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
286
|
-
readonly emailAddress: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").
|
|
286
|
+
readonly emailAddress: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RfcEmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
287
287
|
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, "RecipientId">]>, undefined>;
|
|
288
288
|
readonly name: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
289
289
|
readonly threadMessageId: 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, "MessageId">]>, undefined>;
|
|
290
290
|
readonly type: import("valibot").PicklistSchema<readonly ["bcc", "cc", "to", "replyTo"], undefined>;
|
|
291
291
|
}, undefined>, undefined>;
|
|
292
|
-
readonly senderEmail: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").
|
|
292
|
+
readonly senderEmail: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RfcEmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
293
293
|
readonly senderName: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
294
294
|
readonly threadId: 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, "ThreadId">]>, undefined>;
|
|
295
295
|
readonly unsubscribeUrl: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
@@ -305,7 +305,7 @@ export declare const marcoSchemas: {
|
|
|
305
305
|
messageCount: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
|
|
306
306
|
previewText: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
307
307
|
seen: import("valibot").BooleanSchema<undefined>;
|
|
308
|
-
senderEmail: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").
|
|
308
|
+
senderEmail: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RfcEmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
309
309
|
senderName: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
310
310
|
snoozedUntil: import("valibot").NullableSchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
|
|
311
311
|
subject: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
@@ -341,6 +341,7 @@ export declare const marcoSchemas: {
|
|
|
341
341
|
string: {
|
|
342
342
|
email: () => import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RfcEmailAction<string, undefined>]>, undefined>;
|
|
343
343
|
enum: (values: Record<string, string>) => import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").EnumSchema<Record<string, string>, undefined>]>, undefined>;
|
|
344
|
+
mailboxAddress: () => import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RfcEmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
344
345
|
matches: (regex: RegExp) => import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RegexAction<string, undefined>]>, undefined>;
|
|
345
346
|
nullable: (maxLength?: number) => import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
346
347
|
optional: (maxLength?: number) => import("valibot").UndefinedableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AA2BA,YAAY,EACV,SAAS,EACT,OAAO,EACP,YAAY,EACZ,SAAS,EACT,OAAO,EACP,KAAK,EACL,OAAO,EACP,SAAS,EACT,uBAAuB,EACvB,WAAW,EACX,QAAQ,EACR,MAAM,EACN,MAAM,GACP,MAAM,MAAM,CAAA;AACb,YAAY,EACV,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,KAAK,EACL,eAAe,EACf,SAAS,EACT,MAAM,EACN,aAAa,EACb,uBAAuB,EACvB,sBAAsB,EACtB,QAAQ,GACT,MAAM,UAAU,CAAA;AAEjB,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AA2BA,YAAY,EACV,SAAS,EACT,OAAO,EACP,YAAY,EACZ,SAAS,EACT,OAAO,EACP,KAAK,EACL,OAAO,EACP,SAAS,EACT,uBAAuB,EACvB,WAAW,EACX,QAAQ,EACR,MAAM,EACN,MAAM,GACP,MAAM,MAAM,CAAA;AACb,YAAY,EACV,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,KAAK,EACL,eAAe,EACf,SAAS,EACT,MAAM,EACN,aAAa,EACb,uBAAuB,EACvB,sBAAsB,EACtB,QAAQ,GACT,MAAM,UAAU,CAAA;AAEjB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BxB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
2
|
export declare const contactSchema: v.ObjectSchema<{
|
|
3
|
-
readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
3
|
+
readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
4
4
|
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "ContactId">]>, undefined>;
|
|
5
5
|
readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
6
6
|
readonly userId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "UserId">]>, undefined>;
|
|
@@ -2,7 +2,7 @@ import * as v from 'valibot';
|
|
|
2
2
|
import { id } from '../../schemas/id';
|
|
3
3
|
import { string } from '../../schemas/string';
|
|
4
4
|
export const contactSchema = v.object({
|
|
5
|
-
emailAddress: string.
|
|
5
|
+
emailAddress: string.mailboxAddress(),
|
|
6
6
|
id: id.contactId.required(),
|
|
7
7
|
name: string.nullable(),
|
|
8
8
|
userId: id.userId.required(),
|
|
@@ -8,10 +8,10 @@ export declare const draftAttachmentSchema: v.ObjectSchema<{
|
|
|
8
8
|
readonly totalSize: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
9
9
|
}, undefined>;
|
|
10
10
|
export declare const draftBodySchema: v.ObjectSchema<{
|
|
11
|
-
readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
12
|
-
readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
11
|
+
readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
12
|
+
readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
13
13
|
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 384000, undefined>]>;
|
|
14
|
-
readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
14
|
+
readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
15
15
|
}, undefined>;
|
|
16
16
|
export declare const draftSchema: v.ObjectSchema<{
|
|
17
17
|
readonly accountId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "AccountId">]>, undefined>;
|
|
@@ -24,10 +24,10 @@ export declare const draftSchema: v.ObjectSchema<{
|
|
|
24
24
|
readonly totalSize: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
25
25
|
}, undefined>, undefined>;
|
|
26
26
|
readonly body: v.ObjectSchema<{
|
|
27
|
-
readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
28
|
-
readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
27
|
+
readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
28
|
+
readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
29
29
|
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 384000, undefined>]>;
|
|
30
|
-
readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
30
|
+
readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
31
31
|
}, undefined>;
|
|
32
32
|
readonly error: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
33
33
|
readonly fromAliasId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "AliasId">]>, undefined>;
|
|
@@ -12,10 +12,10 @@ export const draftAttachmentSchema = v.object({
|
|
|
12
12
|
totalSize: number.positiveInteger(),
|
|
13
13
|
});
|
|
14
14
|
export const draftBodySchema = v.object({
|
|
15
|
-
bcc: v.array(string.
|
|
16
|
-
cc: v.array(string.
|
|
15
|
+
bcc: v.array(string.mailboxAddress()),
|
|
16
|
+
cc: v.array(string.mailboxAddress()),
|
|
17
17
|
content: v.pipe(v.string(), v.maxLength(384000)),
|
|
18
|
-
to: v.array(string.
|
|
18
|
+
to: v.array(string.mailboxAddress()),
|
|
19
19
|
});
|
|
20
20
|
export const draftSchema = v.object({
|
|
21
21
|
accountId: id.accountId.required(),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mailboxAddress.test.d.ts","sourceRoot":"","sources":["../../../src/schemas/models/mailboxAddress.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { describe, expect, it } from 'bun:test';
|
|
2
|
+
import * as v from 'valibot';
|
|
3
|
+
import { contactSchema } from './contact';
|
|
4
|
+
import { draftBodySchema } from './draft';
|
|
5
|
+
import { threadMessageRecipientSchema, threadMessageSchema, threadSchema } from './thread';
|
|
6
|
+
const mailboxAddressSchemas = [
|
|
7
|
+
contactSchema.entries.emailAddress,
|
|
8
|
+
draftBodySchema.entries.bcc.item,
|
|
9
|
+
draftBodySchema.entries.cc.item,
|
|
10
|
+
draftBodySchema.entries.to.item,
|
|
11
|
+
threadMessageRecipientSchema.entries.emailAddress,
|
|
12
|
+
threadMessageSchema.entries.senderEmail,
|
|
13
|
+
threadSchema.entries.senderEmail,
|
|
14
|
+
];
|
|
15
|
+
describe('mailbox address models', () => {
|
|
16
|
+
it('accepts the maximum persisted mailbox-address length', () => {
|
|
17
|
+
const mailboxAddress = `${'a'.repeat(64)}@${'b'.repeat(63)}.${'c'.repeat(63)}.${'d'.repeat(63)}.${'e'.repeat(63)}`;
|
|
18
|
+
expect(mailboxAddress).toHaveLength(320);
|
|
19
|
+
for (const schema of mailboxAddressSchemas) {
|
|
20
|
+
expect(v.safeParse(schema, mailboxAddress).success).toBe(true);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
it('rejects malformed and overlong mailbox addresses', () => {
|
|
24
|
+
const overlongAddress = `${'a'.repeat(65)}@${'b'.repeat(63)}.${'c'.repeat(63)}.${'d'.repeat(63)}.${'e'.repeat(63)}`;
|
|
25
|
+
expect(overlongAddress).toHaveLength(321);
|
|
26
|
+
for (const schema of mailboxAddressSchemas) {
|
|
27
|
+
expect(v.safeParse(schema, 'invalid@@example.com').success).toBe(false);
|
|
28
|
+
expect(v.safeParse(schema, overlongAddress).success).toBe(false);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -7,7 +7,7 @@ export declare const threadMessageAttachmentSchema: v.ObjectSchema<{
|
|
|
7
7
|
readonly threadMessageId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "MessageId">]>, undefined>;
|
|
8
8
|
}, undefined>;
|
|
9
9
|
export declare const threadMessageRecipientSchema: v.ObjectSchema<{
|
|
10
|
-
readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
10
|
+
readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
11
11
|
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "RecipientId">]>, undefined>;
|
|
12
12
|
readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
13
13
|
readonly threadMessageId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "MessageId">]>, undefined>;
|
|
@@ -27,13 +27,13 @@ export declare const threadMessageSchema: v.ObjectSchema<{
|
|
|
27
27
|
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "MessageId">]>, undefined>;
|
|
28
28
|
readonly previewText: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
29
29
|
readonly recipients: v.ArraySchema<v.ObjectSchema<{
|
|
30
|
-
readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
30
|
+
readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
31
31
|
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "RecipientId">]>, undefined>;
|
|
32
32
|
readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
33
33
|
readonly threadMessageId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "MessageId">]>, undefined>;
|
|
34
34
|
readonly type: v.PicklistSchema<readonly ["bcc", "cc", "to", "replyTo"], undefined>;
|
|
35
35
|
}, undefined>, undefined>;
|
|
36
|
-
readonly senderEmail: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
36
|
+
readonly senderEmail: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
37
37
|
readonly senderName: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
38
38
|
readonly threadId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "ThreadId">]>, undefined>;
|
|
39
39
|
readonly unsubscribeUrl: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
@@ -49,7 +49,7 @@ export declare const threadSchema: v.ObjectSchema<{
|
|
|
49
49
|
messageCount: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
50
50
|
previewText: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
51
51
|
seen: v.BooleanSchema<undefined>;
|
|
52
|
-
senderEmail: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
52
|
+
senderEmail: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
53
53
|
senderName: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
54
54
|
snoozedUntil: v.NullableSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
|
|
55
55
|
subject: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
@@ -67,7 +67,7 @@ export declare const threadListSchema: v.ObjectSchema<{
|
|
|
67
67
|
messageCount: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
68
68
|
previewText: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
69
69
|
seen: v.BooleanSchema<undefined>;
|
|
70
|
-
senderEmail: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
70
|
+
senderEmail: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
71
71
|
senderName: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
72
72
|
snoozedUntil: v.NullableSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
|
|
73
73
|
subject: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
@@ -89,13 +89,13 @@ export declare const threadFullSchema: v.ObjectSchema<{
|
|
|
89
89
|
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "MessageId">]>, undefined>;
|
|
90
90
|
readonly previewText: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
91
91
|
readonly recipients: v.ArraySchema<v.ObjectSchema<{
|
|
92
|
-
readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
92
|
+
readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
93
93
|
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "RecipientId">]>, undefined>;
|
|
94
94
|
readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
95
95
|
readonly threadMessageId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "MessageId">]>, undefined>;
|
|
96
96
|
readonly type: v.PicklistSchema<readonly ["bcc", "cc", "to", "replyTo"], undefined>;
|
|
97
97
|
}, undefined>, undefined>;
|
|
98
|
-
readonly senderEmail: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
98
|
+
readonly senderEmail: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
99
99
|
readonly senderName: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
100
100
|
readonly threadId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "ThreadId">]>, undefined>;
|
|
101
101
|
readonly unsubscribeUrl: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
@@ -110,7 +110,7 @@ export declare const threadFullSchema: v.ObjectSchema<{
|
|
|
110
110
|
readonly messageCount: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
111
111
|
readonly previewText: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
112
112
|
readonly seen: v.BooleanSchema<undefined>;
|
|
113
|
-
readonly senderEmail: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
113
|
+
readonly senderEmail: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
114
114
|
readonly senderName: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
115
115
|
readonly snoozedUntil: v.NullableSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
|
|
116
116
|
readonly subject: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
@@ -12,7 +12,7 @@ export const threadMessageAttachmentSchema = v.object({
|
|
|
12
12
|
threadMessageId: id.messageId.required(),
|
|
13
13
|
});
|
|
14
14
|
export const threadMessageRecipientSchema = v.object({
|
|
15
|
-
emailAddress: string.
|
|
15
|
+
emailAddress: string.mailboxAddress(),
|
|
16
16
|
id: id.recipientId.required(),
|
|
17
17
|
name: string.nullable(),
|
|
18
18
|
threadMessageId: id.messageId.required(),
|
|
@@ -26,7 +26,7 @@ export const threadMessageSchema = v.object({
|
|
|
26
26
|
id: id.messageId.required(),
|
|
27
27
|
previewText: string.required(messages.PREVIEW_TEXT_MAX_LENGTH),
|
|
28
28
|
recipients: v.array(threadMessageRecipientSchema),
|
|
29
|
-
senderEmail: string.
|
|
29
|
+
senderEmail: string.mailboxAddress(),
|
|
30
30
|
senderName: string.nullable(),
|
|
31
31
|
threadId: id.threadId.required(),
|
|
32
32
|
unsubscribeUrl: string.nullable(),
|
|
@@ -42,7 +42,7 @@ const threadBaseEntries = {
|
|
|
42
42
|
messageCount: number.positiveInteger(),
|
|
43
43
|
previewText: string.required(messages.PREVIEW_TEXT_MAX_LENGTH),
|
|
44
44
|
seen: v.boolean(),
|
|
45
|
-
senderEmail: string.
|
|
45
|
+
senderEmail: string.mailboxAddress(),
|
|
46
46
|
senderName: string.nullable(),
|
|
47
47
|
snoozedUntil: v.nullable(number.positiveInteger()),
|
|
48
48
|
subject: string.nullable(),
|
package/dist/schemas/string.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import * as v from 'valibot';
|
|
|
2
2
|
export declare const string: {
|
|
3
3
|
email: () => v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, undefined>;
|
|
4
4
|
enum: (values: Record<string, string>) => v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EnumSchema<Record<string, string>, undefined>]>, undefined>;
|
|
5
|
+
mailboxAddress: () => v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
5
6
|
matches: (regex: RegExp) => v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
|
|
6
7
|
nullable: (maxLength?: number) => v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
7
8
|
optional: (maxLength?: number) => v.UndefinedableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/schemas/string.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,eAAO,MAAM,MAAM;;mBAEF,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/schemas/string.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,eAAO,MAAM,MAAM;;mBAEF,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;;qBAEpB,MAAM;;;;CAIxB,CAAA"}
|
package/dist/schemas/string.js
CHANGED
|
@@ -2,6 +2,7 @@ import * as v from 'valibot';
|
|
|
2
2
|
export const string = {
|
|
3
3
|
email: () => v.nonOptional(v.pipe(v.string(), v.rfcEmail())),
|
|
4
4
|
enum: (values) => v.nonOptional(v.pipe(v.string(), v.enum(values))),
|
|
5
|
+
mailboxAddress: () => v.nonOptional(v.pipe(v.string(), v.rfcEmail(), v.maxLength(320))),
|
|
5
6
|
matches: (regex) => v.nonOptional(v.pipe(v.string(), v.regex(regex))),
|
|
6
7
|
nullable: (maxLength = 255) => v.nullable(v.pipe(v.string(), v.nonEmpty(), v.maxLength(maxLength))),
|
|
7
8
|
optional: (maxLength = 255) => v.undefinedable(v.pipe(v.string(), v.nonEmpty(), v.maxLength(maxLength))),
|