@marcoappio/marco-config 4.0.12 → 4.0.14

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.
Files changed (56) hide show
  1. package/dist/appwrite/appwrite.d.ts +34 -47
  2. package/dist/appwrite/appwrite.d.ts.map +1 -1
  3. package/dist/appwrite/appwrite.js +4 -17
  4. package/dist/appwrite/appwrite.test.js +42 -0
  5. package/dist/appwrite/commands.d.ts +9 -9
  6. package/dist/appwrite/commands.d.ts.map +1 -1
  7. package/dist/appwrite/commands.js +8 -15
  8. package/dist/appwrite/commands.test.js +50 -0
  9. package/dist/appwrite/decodedSchemas.d.ts +35 -0
  10. package/dist/appwrite/decodedSchemas.d.ts.map +1 -0
  11. package/dist/appwrite/decodedSchemas.js +18 -0
  12. package/dist/appwrite/functions.d.ts +16 -16
  13. package/dist/appwrite/functions.d.ts.map +1 -1
  14. package/dist/appwrite/functions.js +3 -9
  15. package/dist/appwrite/tableContract/identity.d.ts +2 -2
  16. package/dist/appwrite/tableContract/identity.d.ts.map +1 -1
  17. package/dist/appwrite/tableContract/identity.js +12 -12
  18. package/dist/appwrite/tableContract/index.d.ts +36 -36
  19. package/dist/appwrite/tableContract/index.js +3 -3
  20. package/dist/appwrite/tableContract/mailbox.d.ts +10 -10
  21. package/dist/appwrite/tableContract/mailbox.d.ts.map +1 -1
  22. package/dist/appwrite/tableContract/mailbox.js +12 -12
  23. package/dist/appwrite/tableContract/operational.d.ts +12 -12
  24. package/dist/appwrite/tableContract/operational.d.ts.map +1 -1
  25. package/dist/appwrite/tableContract/operational.js +12 -12
  26. package/dist/appwrite/tableContract/shared.d.ts +1 -7
  27. package/dist/appwrite/tableContract/shared.d.ts.map +1 -1
  28. package/dist/appwrite/tableContract/shared.js +1 -7
  29. package/dist/schemas/emailAccount.d.ts +6 -6
  30. package/dist/schemas/emailAccount.d.ts.map +1 -1
  31. package/dist/schemas/emailAccount.js +4 -4
  32. package/dist/schemas/index.d.ts +35 -34
  33. package/dist/schemas/index.d.ts.map +1 -1
  34. package/dist/schemas/models/account.d.ts +2 -2
  35. package/dist/schemas/models/account.js +3 -3
  36. package/dist/schemas/models/contact.d.ts +1 -1
  37. package/dist/schemas/models/draft.d.ts +8 -8
  38. package/dist/schemas/models/draft.js +1 -1
  39. package/dist/schemas/models/numericSemantics.test.d.ts +2 -0
  40. package/dist/schemas/models/numericSemantics.test.d.ts.map +1 -0
  41. package/dist/schemas/models/numericSemantics.test.js +24 -0
  42. package/dist/schemas/models/thread.d.ts +16 -16
  43. package/dist/schemas/models/thread.js +2 -2
  44. package/dist/schemas/number.d.ts +2 -1
  45. package/dist/schemas/number.d.ts.map +1 -1
  46. package/dist/schemas/number.js +3 -1
  47. package/dist/schemas/scalars.d.ts +13 -0
  48. package/dist/schemas/scalars.d.ts.map +1 -0
  49. package/dist/schemas/scalars.js +15 -0
  50. package/dist/schemas/scalars.test.d.ts +2 -0
  51. package/dist/schemas/scalars.test.d.ts.map +1 -0
  52. package/dist/schemas/scalars.test.js +44 -0
  53. package/dist/schemas/string.d.ts +1 -1
  54. package/dist/schemas/string.d.ts.map +1 -1
  55. package/dist/schemas/string.js +3 -2
  56. package/package.json +1 -1
@@ -333,6 +333,56 @@ describe('appwriteCommands', () => {
333
333
  expect(v.safeParse(appwriteCommands.requestSchema, command).success).toBe(true);
334
334
  expect(v.safeParse(appwriteCommands.requestSchema, { ...command, payload: { ...command.payload, to: [overlongAddress] } }).success).toBe(false);
335
335
  });
336
+ it('shares persisted draft envelope and attachment boundaries', () => {
337
+ const envelopeCommand = {
338
+ ...commandMetadata,
339
+ accountId: 'account_1',
340
+ kind: 'draft.envelope.set',
341
+ payload: { bcc: [], cc: [], draftId: 'draft_1', subject: 'a'.repeat(998), to: ['recipient@example.com'] },
342
+ };
343
+ const attachmentCommand = {
344
+ ...commandMetadata,
345
+ accountId: 'account_1',
346
+ kind: 'draft.attachment.link',
347
+ payload: { draftId: 'draft_1', fileId: 'test-file-id-1', fileName: 'proposal.pdf', mimeType: 'application/pdf', size: 0 },
348
+ };
349
+ expect(v.safeParse(appwriteCommands.requestSchema, envelopeCommand).success).toBe(true);
350
+ expect(v.safeParse(appwriteCommands.requestSchema, { ...envelopeCommand, payload: { ...envelopeCommand.payload, subject: 'a'.repeat(999) } }).success).toBe(false);
351
+ expect(v.safeParse(appwriteCommands.requestSchema, attachmentCommand).success).toBe(true);
352
+ for (const payload of [
353
+ { ...attachmentCommand.payload, fileId: '-invalid' },
354
+ { ...attachmentCommand.payload, fileName: 'a'.repeat(256) },
355
+ { ...attachmentCommand.payload, mimeType: 'x' },
356
+ { ...attachmentCommand.payload, size: -1 },
357
+ { ...attachmentCommand.payload, unexpected: true },
358
+ ]) {
359
+ expect(v.safeParse(appwriteCommands.requestSchema, { ...attachmentCommand, payload }).success).toBe(false);
360
+ }
361
+ expect(v.safeParse(appwriteCommands.requestSchema, {
362
+ ...commandMetadata,
363
+ accountId: 'account_1',
364
+ kind: 'draft.attachment.delete',
365
+ payload: { draftId: 'draft_1', fileId: '-invalid' },
366
+ }).success).toBe(false);
367
+ });
368
+ it('rejects non-canonical scheduled command timestamps', () => {
369
+ for (const command of [
370
+ {
371
+ ...commandMetadata,
372
+ accountId: 'account_1',
373
+ kind: 'draft.send.schedule',
374
+ payload: { draftId: 'draft_1', scheduledAt: '2026-06-31T00:00:00.000Z' },
375
+ },
376
+ {
377
+ ...commandMetadata,
378
+ accountId: 'account_1',
379
+ kind: 'thread.snooze.set',
380
+ payload: { snoozedUntil: '2026-07-16T00:00:00.000+00:00', threadIds: ['thread_1'] },
381
+ },
382
+ ]) {
383
+ expect(v.safeParse(appwriteCommands.requestSchema, command).success).toBe(false);
384
+ }
385
+ });
336
386
  for (const { command } of commandFixtures) {
337
387
  it(`accepts ${command.kind}`, () => {
338
388
  expect(v.safeParse(appwriteCommands.requestSchema, command).success).toBe(true);
@@ -0,0 +1,35 @@
1
+ import type { ReadonlyDeep } from 'type-fest';
2
+ import * as v from 'valibot';
3
+ export declare const appwriteDraftAttachmentSchema: v.StrictObjectSchema<{
4
+ readonly fileId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
5
+ readonly fileName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
6
+ readonly mimeType: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 3, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
7
+ readonly size: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
8
+ }, undefined>;
9
+ export declare const appwriteDraftAttachmentsSchema: v.ArraySchema<v.StrictObjectSchema<{
10
+ readonly fileId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
11
+ readonly fileName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
12
+ readonly mimeType: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 3, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
13
+ readonly size: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
14
+ }, undefined>, undefined>;
15
+ export declare const persistedDraftAttachmentsSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.ParseJsonAction<string, undefined, undefined>, v.ArraySchema<v.StrictObjectSchema<{
16
+ readonly fileId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
17
+ readonly fileName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
18
+ readonly mimeType: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 3, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
19
+ readonly size: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
20
+ }, undefined>, undefined>]>;
21
+ export declare const appwriteDraftEnvelopeSchema: v.StrictObjectSchema<{
22
+ readonly bcc: v.ArraySchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
23
+ readonly cc: v.ArraySchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
24
+ readonly subject: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 998, undefined>]>, undefined>;
25
+ readonly to: v.ArraySchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
26
+ }, undefined>;
27
+ export declare const persistedDraftEnvelopeSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.ParseJsonAction<string, undefined, undefined>, v.StrictObjectSchema<{
28
+ readonly bcc: v.ArraySchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
29
+ readonly cc: v.ArraySchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
30
+ readonly subject: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 998, undefined>]>, undefined>;
31
+ readonly to: v.ArraySchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
32
+ }, undefined>]>;
33
+ export type AppwriteDraftAttachment = ReadonlyDeep<v.InferOutput<typeof appwriteDraftAttachmentSchema>>;
34
+ export type AppwriteDraftEnvelope = ReadonlyDeep<v.InferOutput<typeof appwriteDraftEnvelopeSchema>>;
35
+ //# sourceMappingURL=decodedSchemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decodedSchemas.d.ts","sourceRoot":"","sources":["../../src/appwrite/decodedSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAM5B,eAAO,MAAM,6BAA6B;;;;;aAKxC,CAAA;AACF,eAAO,MAAM,8BAA8B;;;;;yBAAyC,CAAA;AACpF,eAAO,MAAM,+BAA+B;;;;;2BAAoE,CAAA;AAEhH,eAAO,MAAM,2BAA2B;;;;;aAKtC,CAAA;AACF,eAAO,MAAM,4BAA4B;;;;;eAAiE,CAAA;AAE1G,MAAM,MAAM,uBAAuB,GAAG,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,6BAA6B,CAAC,CAAC,CAAA;AACvG,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,2BAA2B,CAAC,CAAC,CAAA"}
@@ -0,0 +1,18 @@
1
+ import * as v from 'valibot';
2
+ import { mailboxAddressSchema, nonNegativeIntegerSchema } from '../schemas/scalars';
3
+ import { appwriteRowIdSchema } from './tableContract';
4
+ export const appwriteDraftAttachmentSchema = v.strictObject({
5
+ fileId: appwriteRowIdSchema,
6
+ fileName: v.pipe(v.string(), v.minLength(1), v.maxLength(255)),
7
+ mimeType: v.pipe(v.string(), v.minLength(3), v.maxLength(255)),
8
+ size: nonNegativeIntegerSchema,
9
+ });
10
+ export const appwriteDraftAttachmentsSchema = v.array(appwriteDraftAttachmentSchema);
11
+ export const persistedDraftAttachmentsSchema = v.pipe(v.string(), v.parseJson(), appwriteDraftAttachmentsSchema);
12
+ export const appwriteDraftEnvelopeSchema = v.strictObject({
13
+ bcc: v.array(mailboxAddressSchema),
14
+ cc: v.array(mailboxAddressSchema),
15
+ subject: v.nullable(v.pipe(v.string(), v.maxLength(998))),
16
+ to: v.array(mailboxAddressSchema),
17
+ });
18
+ export const persistedDraftEnvelopeSchema = v.pipe(v.string(), v.parseJson(), appwriteDraftEnvelopeSchema);
@@ -23,7 +23,7 @@ export declare const appwriteFunctions: {
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>;
25
25
  readonly password: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
26
- readonly port: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 65535, undefined>]>;
26
+ readonly port: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, v.MaxValueAction<number, 65535, undefined>]>;
27
27
  readonly socketType: v.PicklistSchema<readonly ["SSL", "STARTTLS"], undefined>;
28
28
  readonly user: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
29
29
  }, undefined>;
@@ -31,7 +31,7 @@ export declare const appwriteFunctions: {
31
31
  readonly smtp: v.StrictObjectSchema<{
32
32
  readonly host: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
33
33
  readonly password: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
34
- readonly port: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 65535, undefined>]>;
34
+ readonly port: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, v.MaxValueAction<number, 65535, undefined>]>;
35
35
  readonly socketType: v.PicklistSchema<readonly ["SSL", "STARTTLS"], undefined>;
36
36
  readonly user: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
37
37
  }, undefined>;
@@ -40,7 +40,7 @@ export declare const appwriteFunctions: {
40
40
  responseSchema: v.StrictObjectSchema<{
41
41
  readonly accountId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "AccountId">]>, undefined>;
42
42
  readonly authorizationUrl: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>, undefined>;
43
- readonly state: v.PicklistSchema<readonly ["AWAITING_CONNECTION", "CONNECTED", "DISCONNECTED", "ERROR"], undefined>;
43
+ readonly state: v.PicklistSchema<readonly ["AWAITING_CONNECTION", "CONNECTED", "ERROR", "DISCONNECTED"], undefined>;
44
44
  }, undefined>;
45
45
  };
46
46
  readonly accountDelete: {
@@ -74,7 +74,7 @@ export declare const appwriteFunctions: {
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>;
76
76
  readonly password: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
77
- readonly port: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 65535, undefined>]>;
77
+ readonly port: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, v.MaxValueAction<number, 65535, undefined>]>;
78
78
  readonly socketType: v.PicklistSchema<readonly ["SSL", "STARTTLS"], undefined>;
79
79
  readonly user: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
80
80
  }, undefined>;
@@ -82,7 +82,7 @@ export declare const appwriteFunctions: {
82
82
  readonly smtp: v.StrictObjectSchema<{
83
83
  readonly host: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
84
84
  readonly password: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
85
- readonly port: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 65535, undefined>]>;
85
+ readonly port: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, v.MaxValueAction<number, 65535, undefined>]>;
86
86
  readonly socketType: v.PicklistSchema<readonly ["SSL", "STARTTLS"], undefined>;
87
87
  readonly user: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
88
88
  }, undefined>;
@@ -91,7 +91,7 @@ export declare const appwriteFunctions: {
91
91
  responseSchema: v.StrictObjectSchema<{
92
92
  readonly accountId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "AccountId">]>, undefined>;
93
93
  readonly authorizationUrl: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>, undefined>;
94
- readonly state: v.PicklistSchema<readonly ["AWAITING_CONNECTION", "CONNECTED", "DISCONNECTED", "ERROR"], undefined>;
94
+ readonly state: v.PicklistSchema<readonly ["AWAITING_CONNECTION", "CONNECTED", "ERROR", "DISCONNECTED"], undefined>;
95
95
  }, undefined>;
96
96
  };
97
97
  readonly accountsPoll: {
@@ -226,7 +226,7 @@ export declare const appwriteFunctions: {
226
226
  readonly kind: v.LiteralSchema<"draft.attachment.delete", undefined>;
227
227
  readonly payload: v.StrictObjectSchema<{
228
228
  readonly draftId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "DraftId">]>, undefined>;
229
- readonly fileId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
229
+ readonly fileId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
230
230
  }, undefined>;
231
231
  readonly submittedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
232
232
  readonly version: v.LiteralSchema<1, undefined>;
@@ -236,9 +236,9 @@ export declare const appwriteFunctions: {
236
236
  readonly kind: v.LiteralSchema<"draft.attachment.link", undefined>;
237
237
  readonly payload: v.StrictObjectSchema<{
238
238
  readonly draftId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "DraftId">]>, undefined>;
239
- readonly fileId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
240
- readonly fileName: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
241
- readonly mimeType: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
239
+ readonly fileId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
240
+ readonly fileName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
241
+ readonly mimeType: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 3, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
242
242
  readonly size: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
243
243
  }, undefined>;
244
244
  readonly submittedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
@@ -279,11 +279,11 @@ export declare const appwriteFunctions: {
279
279
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.BrandAction<string, "CommandId">]>;
280
280
  readonly kind: v.LiteralSchema<"draft.envelope.set", undefined>;
281
281
  readonly payload: v.StrictObjectSchema<{
282
- readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
283
- readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
284
282
  readonly draftId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "DraftId">]>, undefined>;
283
+ readonly bcc: v.ArraySchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
284
+ readonly cc: v.ArraySchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
285
285
  readonly subject: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 998, undefined>]>, undefined>;
286
- readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
286
+ readonly to: v.ArraySchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
287
287
  }, undefined>;
288
288
  readonly submittedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
289
289
  readonly version: v.LiteralSchema<1, undefined>;
@@ -322,7 +322,7 @@ export declare const appwriteFunctions: {
322
322
  readonly kind: v.LiteralSchema<"draft.send.schedule", undefined>;
323
323
  readonly payload: v.StrictObjectSchema<{
324
324
  readonly draftId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "DraftId">]>, undefined>;
325
- readonly scheduledAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
325
+ readonly scheduledAt: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.CheckAction<string, undefined>]>;
326
326
  }, undefined>;
327
327
  readonly submittedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
328
328
  readonly version: v.LiteralSchema<1, undefined>;
@@ -438,7 +438,7 @@ export declare const appwriteFunctions: {
438
438
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.BrandAction<string, "CommandId">]>;
439
439
  readonly kind: v.LiteralSchema<"thread.snooze.set", undefined>;
440
440
  readonly payload: v.StrictObjectSchema<{
441
- readonly snoozedUntil: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
441
+ readonly snoozedUntil: v.NullableSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.CheckAction<string, undefined>]>, undefined>;
442
442
  readonly threadIds: v.SchemaWithPipe<readonly [v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>, v.BrandAction<string, "ThreadId">]>, undefined>, undefined>, v.MinLengthAction<(string & v.Brand<"ThreadId">)[], 1, undefined>, v.MaxLengthAction<(string & v.Brand<"ThreadId">)[], 100, undefined>]>;
443
443
  }, undefined>;
444
444
  readonly submittedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
@@ -514,7 +514,7 @@ export declare const appwriteFunctions: {
514
514
  method: "POST";
515
515
  path: "/polls/run";
516
516
  requestSchema: v.StrictObjectSchema<{
517
- readonly scheduledFor: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>, v.CheckAction<string, undefined>]>;
517
+ readonly scheduledFor: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.CheckAction<string, undefined>]>;
518
518
  readonly shardId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
519
519
  }, undefined>;
520
520
  responseSchema: v.StrictObjectSchema<{
@@ -1 +1 @@
1
- {"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../src/appwrite/functions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAS5B,KAAK,uBAAuB,GAAG,eAAe,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAA;AA6MlF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC5I,MAAM,MAAM,wBAAwB,CAAC,SAAS,SAAS,oBAAoB,EAAE,MAAM,SAAS,yBAAyB,CAAC,SAAS,CAAC,IAC9H,qBAAqB,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS;IAAE,cAAc,EAAE,MAAM,OAAO,SAAS,CAAC,CAAC,aAAa,CAAA;CAAE,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,KAAK,CAAA"}
@@ -4,7 +4,7 @@ import { id } from '../schemas/id';
4
4
  import { string } from '../schemas/string';
5
5
  import { appwrite, appwriteRowIdSchema } from './appwrite';
6
6
  import { appwriteCommands } from './commands';
7
- const accountStates = ['AWAITING_CONNECTION', 'CONNECTED', 'DISCONNECTED', 'ERROR'];
7
+ import { accountStates, canonicalTimestampSchema, portSchema, socketTypes, webEmailSchema } from './tableContract';
8
8
  const functionErrorCodes = [
9
9
  'AUTHENTICATION_FAILED',
10
10
  'AUTHORIZATION_FAILED',
@@ -15,12 +15,10 @@ const functionErrorCodes = [
15
15
  'TRANSIENT_FAILURE',
16
16
  'INTERNAL_ERROR',
17
17
  ];
18
- const socketTypes = ['SSL', 'STARTTLS'];
19
18
  const functionErrorSchema = v.strictObject({
20
19
  code: v.picklist(functionErrorCodes),
21
20
  retryable: v.boolean(),
22
21
  });
23
- const portSchema = v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(65_535));
24
22
  const providerCredentialSchema = v.strictObject({
25
23
  host: string.required(4096),
26
24
  password: string.required(4096),
@@ -30,7 +28,7 @@ const providerCredentialSchema = v.strictObject({
30
28
  });
31
29
  const connectionSchema = v.variant('kind', [
32
30
  v.strictObject({
33
- email: v.pipe(v.string(), v.email()),
31
+ email: webEmailSchema,
34
32
  kind: v.literal('OAUTH'),
35
33
  provider: v.picklist(['GMAIL', 'OUTLOOK']),
36
34
  returnUri: appwrite.oauth.returnUriSchema,
@@ -63,10 +61,6 @@ const authVerifyCodeResponseSchema = v.strictObject({
63
61
  secret: string.required(4096),
64
62
  userId: authUserIdSchema,
65
63
  });
66
- const timestampSchema = v.pipe(v.string(), v.isoTimestamp(), v.check(timestamp => {
67
- const milliseconds = Date.parse(timestamp);
68
- return Number.isFinite(milliseconds) && new Date(milliseconds).toISOString() === timestamp;
69
- }));
70
64
  const createRoute = (route) => ({
71
65
  ...route,
72
66
  errorSchema: functionErrorSchema,
@@ -145,7 +139,7 @@ const apiRoutes = {
145
139
  method: 'POST',
146
140
  path: '/polls/run',
147
141
  requestSchema: v.strictObject({
148
- scheduledFor: timestampSchema,
142
+ scheduledFor: canonicalTimestampSchema,
149
143
  shardId: appwriteRowIdSchema,
150
144
  }),
151
145
  responseSchema: completedSchema,
@@ -143,7 +143,7 @@ export declare const credentialsTable: {
143
143
  readonly provider: import("./shared").AppwriteColumnSchema<v.PicklistSchema<readonly ["GMAIL", "OUTLOOK", "IMAP"], undefined>>;
144
144
  readonly encryptedPayload: import("./shared").AppwriteColumnSchema<v.StringSchema<undefined>>;
145
145
  readonly expiresAt: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>>;
146
- readonly refreshLeaseExpiresAt: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>>;
146
+ readonly refreshLeaseExpiresAt: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.CheckAction<string, undefined>]>, undefined>>;
147
147
  readonly refreshLeaseId: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>>;
148
148
  };
149
149
  readonly id: "credentials";
@@ -318,7 +318,7 @@ export declare const identityTableInputs: {
318
318
  readonly provider: import("./shared").AppwriteColumnSchema<v.PicklistSchema<readonly ["GMAIL", "OUTLOOK", "IMAP"], undefined>>;
319
319
  readonly encryptedPayload: import("./shared").AppwriteColumnSchema<v.StringSchema<undefined>>;
320
320
  readonly expiresAt: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>>;
321
- readonly refreshLeaseExpiresAt: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>>;
321
+ readonly refreshLeaseExpiresAt: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.CheckAction<string, undefined>]>, undefined>>;
322
322
  readonly refreshLeaseId: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>>;
323
323
  };
324
324
  readonly id: "credentials";
@@ -1 +1 @@
1
- {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../src/appwrite/tableContract/identity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AA0B5B,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;CAaxB,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;CAYrC,CAAA;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;CAW1B,CAAA;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BxB,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;CAgB3B,CAAA;AAEF,eAAO,MAAM,gBAAg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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAStB,CAAA"}
@@ -1,12 +1,12 @@
1
1
  import * as v from 'valibot';
2
2
  /* oxlint-disable eslint/sort-keys */
3
- import { accountProviders, accountStates, appwriteColumnDefinitions, appwriteIds, appwriteRelationship, appwriteRelationshipIdSchema, colourSchema, defineAppwriteTable, emailSchema, identifierSchema, labelSpecialUses, oauthOperations, oauthProviders, oauthReturnUriSchema, appwriteRowIdSchema, timestampSchema, nonNegativeIntegerSchema, } from './shared';
3
+ import { accountProviders, accountStates, appwriteColumnDefinitions, appwriteIds, appwriteRelationship, appwriteRelationshipIdSchema, canonicalTimestampSchema, colourSchema, defineAppwriteTable, webEmailSchema, identifierSchema, labelSpecialUses, oauthOperations, oauthProviders, oauthReturnUriSchema, appwriteRowIdSchema, isoTimestampSchema, nonNegativeIntegerSchema, } from './shared';
4
4
  const { boolean, dateTime, enumValue, identifier, integer, longText, string: stringColumn, stringArray, text } = appwriteColumnDefinitions;
5
5
  export const profilesTable = defineAppwriteTable({
6
6
  fields: {
7
- email: stringColumn(emailSchema, true, 320),
7
+ email: stringColumn(webEmailSchema, true, 320),
8
8
  avatarFileId: stringColumn(v.nullable(appwriteRowIdSchema), false, 36),
9
- deletionRequestedAt: dateTime(v.nullable(timestampSchema), false),
9
+ deletionRequestedAt: dateTime(v.nullable(isoTimestampSchema), false),
10
10
  name: stringColumn(v.nullable(identifierSchema), false),
11
11
  onboardingState: stringColumn(v.nullable(identifierSchema), false),
12
12
  timezone: stringColumn(v.nullable(identifierSchema), false),
@@ -20,7 +20,7 @@ export const profileAvatarCleanupsTable = defineAppwriteTable({
20
20
  fields: {
21
21
  fileId: stringColumn(identifierSchema, true, 36),
22
22
  claimId: stringColumn(v.nullable(identifierSchema), false),
23
- claimedAt: dateTime(v.nullable(timestampSchema), false),
23
+ claimedAt: dateTime(v.nullable(isoTimestampSchema), false),
24
24
  profile: appwriteRelationship(appwriteRelationshipIdSchema, 'profiles'),
25
25
  },
26
26
  id: appwriteIds.tables.profileAvatarCleanups,
@@ -46,16 +46,16 @@ export const accountsTable = defineAppwriteTable({
46
46
  profileAssignmentKey: identifier(identifierSchema),
47
47
  provider: enumValue(v.picklist(accountProviders), accountProviders),
48
48
  state: enumValue(v.picklist(accountStates), accountStates),
49
- primaryEmail: stringColumn(emailSchema, true, 320),
49
+ primaryEmail: stringColumn(webEmailSchema, true, 320),
50
50
  displayName: stringColumn(v.nullable(identifierSchema), false),
51
51
  colour: stringColumn(colourSchema, true, 64),
52
52
  pollShardAssignmentId: identifier(v.nullable(identifierSchema), false),
53
53
  pollShardId: identifier(v.nullable(identifierSchema), false),
54
- lastSuccessfulSyncAt: dateTime(v.nullable(timestampSchema), false),
54
+ lastSuccessfulSyncAt: dateTime(v.nullable(isoTimestampSchema), false),
55
55
  lastErrorCode: stringColumn(v.nullable(identifierSchema), false),
56
56
  mailProcessedCount: integer(nonNegativeIntegerSchema),
57
57
  mailTotalCount: integer(nonNegativeIntegerSchema),
58
- initialSyncCompletedAt: dateTime(v.nullable(timestampSchema), false),
58
+ initialSyncCompletedAt: dateTime(v.nullable(isoTimestampSchema), false),
59
59
  credential: appwriteRelationship(v.nullable(appwriteRelationshipIdSchema), 'credentials', 'oneToOne'),
60
60
  mailboxSyncState: appwriteRelationship(v.nullable(appwriteRelationshipIdSchema), 'mailboxSyncStates', 'oneToOne'),
61
61
  primaryAlias: appwriteRelationship(v.nullable(appwriteRelationshipIdSchema), 'aliases', 'oneToOne', 'setNull'),
@@ -77,8 +77,8 @@ export const oauthStatesTable = defineAppwriteTable({
77
77
  fields: {
78
78
  userId: stringColumn(identifierSchema),
79
79
  accountId: stringColumn(identifierSchema),
80
- email: stringColumn(emailSchema, true, 320),
81
- expiresAt: dateTime(timestampSchema),
80
+ email: stringColumn(webEmailSchema, true, 320),
81
+ expiresAt: dateTime(isoTimestampSchema),
82
82
  nonceHash: stringColumn(identifierSchema),
83
83
  operation: enumValue(v.picklist(oauthOperations), oauthOperations),
84
84
  provider: enumValue(v.picklist(oauthProviders), oauthProviders),
@@ -96,8 +96,8 @@ export const credentialsTable = defineAppwriteTable({
96
96
  accountId: stringColumn(identifierSchema),
97
97
  provider: enumValue(v.picklist(accountProviders), accountProviders),
98
98
  encryptedPayload: longText(v.string()),
99
- expiresAt: dateTime(v.nullable(timestampSchema), false),
100
- refreshLeaseExpiresAt: dateTime(v.nullable(timestampSchema), false),
99
+ expiresAt: dateTime(v.nullable(isoTimestampSchema), false),
100
+ refreshLeaseExpiresAt: dateTime(v.nullable(canonicalTimestampSchema), false),
101
101
  refreshLeaseId: stringColumn(v.nullable(identifierSchema), false, 36),
102
102
  },
103
103
  id: appwriteIds.tables.credentials,
@@ -112,7 +112,7 @@ export const aliasesTable = defineAppwriteTable({
112
112
  fields: {
113
113
  accountAssignmentKey: identifier(identifierSchema),
114
114
  providerId: stringColumn(identifierSchema),
115
- email: stringColumn(emailSchema, true, 320),
115
+ email: stringColumn(webEmailSchema, true, 320),
116
116
  name: stringColumn(v.nullable(identifierSchema), false),
117
117
  signature: text(v.nullable(v.string()), false),
118
118
  isPrimary: boolean(v.boolean()),