@marcoappio/marco-config 2.0.163 → 2.0.165

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 (59) hide show
  1. package/dist/clients/account.d.ts +7 -7
  2. package/dist/clients/account.js +6 -6
  3. package/dist/clients/contact.d.ts +1 -1
  4. package/dist/clients/contact.js +1 -1
  5. package/dist/clients/draft.d.ts +12 -132
  6. package/dist/clients/draft.d.ts.map +1 -1
  7. package/dist/clients/draft.js +24 -33
  8. package/dist/clients/index.d.ts +27 -148
  9. package/dist/clients/index.d.ts.map +1 -1
  10. package/dist/clients/thread.d.ts +5 -5
  11. package/dist/clients/thread.js +5 -5
  12. package/dist/clients/user.d.ts +3 -3
  13. package/dist/clients/user.js +2 -2
  14. package/dist/index.d.ts +1 -1
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/schemas.d.ts +1 -0
  17. package/dist/schemas.d.ts.map +1 -1
  18. package/dist/schemas.js +2 -1
  19. package/dist/sdk/endpoints/index.d.ts +39 -162
  20. package/dist/sdk/endpoints/index.d.ts.map +1 -1
  21. package/dist/sdk/endpoints/private/emailMessage/getEmailMessageHTML.d.ts +1 -1
  22. package/dist/sdk/endpoints/private/emailMessage/index.d.ts +1 -1
  23. package/dist/sdk/endpoints/private/index.d.ts +35 -158
  24. package/dist/sdk/endpoints/private/index.d.ts.map +1 -1
  25. package/dist/sdk/endpoints/private/sync/index.d.ts +33 -156
  26. package/dist/sdk/endpoints/private/sync/index.d.ts.map +1 -1
  27. package/dist/sdk/endpoints/private/sync/pull/account.d.ts +3 -3
  28. package/dist/sdk/endpoints/private/sync/pull/contact.d.ts +2 -2
  29. package/dist/sdk/endpoints/private/sync/pull/draft.d.ts +4 -10
  30. package/dist/sdk/endpoints/private/sync/pull/draft.d.ts.map +1 -1
  31. package/dist/sdk/endpoints/private/sync/pull/index.d.ts +15 -21
  32. package/dist/sdk/endpoints/private/sync/pull/index.d.ts.map +1 -1
  33. package/dist/sdk/endpoints/private/sync/pull/thread.d.ts +4 -4
  34. package/dist/sdk/endpoints/private/sync/pull/user.d.ts +2 -2
  35. package/dist/sdk/endpoints/private/sync/push/account.d.ts +6 -6
  36. package/dist/sdk/endpoints/private/sync/push/draft.d.ts +6 -123
  37. package/dist/sdk/endpoints/private/sync/push/draft.d.ts.map +1 -1
  38. package/dist/sdk/endpoints/private/sync/push/draft.js +2 -8
  39. package/dist/sdk/endpoints/private/sync/push/index.d.ts +18 -135
  40. package/dist/sdk/endpoints/private/sync/push/index.d.ts.map +1 -1
  41. package/dist/sdk/endpoints/private/sync/push/thread.d.ts +3 -3
  42. package/dist/sdk/endpoints/private/sync/push/user.d.ts +3 -3
  43. package/dist/sdk/endpoints/private/user/deleteUser.d.ts +1 -1
  44. package/dist/sdk/endpoints/private/user/index.d.ts +1 -1
  45. package/dist/sdk/endpoints/public/auth/index.d.ts +3 -3
  46. package/dist/sdk/endpoints/public/auth/refreshAuth.d.ts +1 -1
  47. package/dist/sdk/endpoints/public/auth/sendAuthCode.d.ts +1 -1
  48. package/dist/sdk/endpoints/public/auth/verifyAuthCode.d.ts +1 -1
  49. package/dist/sdk/endpoints/public/healthcheck/index.d.ts +1 -1
  50. package/dist/sdk/endpoints/public/index.d.ts +4 -4
  51. package/dist/sdk/index.d.ts +39 -162
  52. package/dist/sdk/index.d.ts.map +1 -1
  53. package/dist/types/JSONContent.d.ts +11 -0
  54. package/dist/types/JSONContent.d.ts.map +1 -0
  55. package/dist/types/JSONContent.js +1 -0
  56. package/dist/types/index.d.ts +1 -0
  57. package/dist/types/index.d.ts.map +1 -1
  58. package/dist/types/index.js +1 -0
  59. package/package.json +2 -2
@@ -2,7 +2,7 @@ import * as v from 'valibot';
2
2
  export declare const account: {
3
3
  model: v.ObjectSchema<{
4
4
  readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
5
- readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
5
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.UuidAction<string, undefined>]>, undefined>;
6
6
  readonly imapPasswordConfig: v.NullableSchema<v.ObjectSchema<{
7
7
  readonly host: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
8
8
  readonly password: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
@@ -10,7 +10,7 @@ export declare const account: {
10
10
  readonly status: v.UnionSchema<[v.LiteralSchema<"AWAITING_CONNECTION", undefined>, v.LiteralSchema<"CONNECTED", undefined>, v.LiteralSchema<"CONNECTION_FAILED", undefined>], undefined>;
11
11
  }, undefined>, undefined>;
12
12
  readonly labels: v.ArraySchema<v.ObjectSchema<{
13
- readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
13
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.UuidAction<string, undefined>]>, undefined>;
14
14
  readonly name: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
15
15
  readonly path: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
16
16
  readonly specialUse: v.NullableSchema<v.UnionSchema<[v.LiteralSchema<"ARCHIVE", undefined>, v.LiteralSchema<"INBOX", undefined>, v.LiteralSchema<"SENT", undefined>, v.LiteralSchema<"SPAM", undefined>, v.LiteralSchema<"TRASH", undefined>], undefined>, undefined>;
@@ -30,17 +30,17 @@ export declare const account: {
30
30
  delta: v.ObjectSchema<{
31
31
  readonly color: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
32
32
  readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
33
- readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
33
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.UuidAction<string, undefined>]>, undefined>;
34
34
  }, undefined>;
35
35
  };
36
36
  delete: {
37
37
  delta: v.ObjectSchema<{
38
- readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
38
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.UuidAction<string, undefined>]>, undefined>;
39
39
  }, undefined>;
40
40
  };
41
41
  setIMAPPasswordConfig: {
42
42
  delta: v.ObjectSchema<{
43
- readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
43
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.UuidAction<string, undefined>]>, undefined>;
44
44
  readonly imapPasswordConfig: v.ObjectSchema<{
45
45
  readonly status: v.LiteralSchema<"AWAITING_CONNECTION", undefined>;
46
46
  readonly host: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
@@ -51,7 +51,7 @@ export declare const account: {
51
51
  };
52
52
  setSettings: {
53
53
  delta: v.ObjectSchema<{
54
- readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
54
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.UuidAction<string, undefined>]>, undefined>;
55
55
  readonly settings: Omit<v.ObjectSchema<{
56
56
  readonly color: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
57
57
  readonly firstName: v.NullableSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
@@ -62,7 +62,7 @@ export declare const account: {
62
62
  readonly firstName: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
63
63
  readonly lastName: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
64
64
  };
65
- readonly '~standard': v.StandardSchemaProps<{
65
+ readonly '~standard': v.StandardProps<{
66
66
  color?: string | undefined;
67
67
  firstName?: string | null | undefined;
68
68
  lastName?: string | null | undefined;
@@ -14,10 +14,10 @@ const accountSettings = v.object({
14
14
  export const account = {
15
15
  model: v.object({
16
16
  emailAddress: marcoSchemas.string.email(),
17
- id: marcoSchemas.string.required(),
17
+ id: marcoSchemas.string.uuid(),
18
18
  imapPasswordConfig: v.nullable(imapPasswordConfig),
19
19
  labels: v.array(v.object({
20
- id: marcoSchemas.string.required(),
20
+ id: marcoSchemas.string.uuid(),
21
21
  name: marcoSchemas.string.required(),
22
22
  path: marcoSchemas.string.required(),
23
23
  specialUse: v.nullable(marcoSchemas.labelSpecialUse()),
@@ -33,17 +33,17 @@ export const account = {
33
33
  delta: v.object({
34
34
  color: marcoSchemas.string.required(),
35
35
  emailAddress: marcoSchemas.string.email(),
36
- id: marcoSchemas.string.required(),
36
+ id: marcoSchemas.string.uuid(),
37
37
  }),
38
38
  },
39
39
  delete: {
40
40
  delta: v.object({
41
- id: marcoSchemas.string.required(),
41
+ id: marcoSchemas.string.uuid(),
42
42
  }),
43
43
  },
44
44
  setIMAPPasswordConfig: {
45
45
  delta: v.object({
46
- id: marcoSchemas.string.required(),
46
+ id: marcoSchemas.string.uuid(),
47
47
  imapPasswordConfig: v.object({
48
48
  ...imapPasswordConfig.entries,
49
49
  status: v.literal('AWAITING_CONNECTION'),
@@ -52,7 +52,7 @@ export const account = {
52
52
  },
53
53
  setSettings: {
54
54
  delta: v.object({
55
- id: marcoSchemas.string.required(),
55
+ id: marcoSchemas.string.uuid(),
56
56
  settings: v.partial(accountSettings),
57
57
  }),
58
58
  },
@@ -1,7 +1,7 @@
1
1
  import * as v from 'valibot';
2
2
  export declare const contact: {
3
3
  model: v.ObjectSchema<{
4
- readonly emailAccountId: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
4
+ readonly emailAccountId: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.UuidAction<string, undefined>]>, undefined>;
5
5
  readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
6
6
  readonly name: v.NullableSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
7
7
  }, undefined>;
@@ -2,7 +2,7 @@ import * as v from 'valibot';
2
2
  import { marcoSchemas } from '../schemas';
3
3
  export const contact = {
4
4
  model: v.object({
5
- emailAccountId: marcoSchemas.string.required(),
5
+ emailAccountId: marcoSchemas.string.uuid(),
6
6
  emailAddress: marcoSchemas.string.email(),
7
7
  name: marcoSchemas.string.nullable(),
8
8
  }),
@@ -1,156 +1,36 @@
1
1
  import * as v from 'valibot';
2
+ import { JSONContent } from '../types';
2
3
  export declare const draft: {
3
4
  model: v.ObjectSchema<{
4
5
  readonly body: v.ObjectSchema<{
5
6
  readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
6
7
  readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
7
- readonly content: v.ObjectSchema<{
8
- readonly content: v.ArraySchema<v.LooseObjectSchema<{
9
- readonly type: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
10
- }, undefined>, undefined>;
11
- readonly type: v.UnionSchema<[v.LiteralSchema<"doc", undefined>], undefined>;
12
- }, undefined>;
13
- readonly replyTo: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
8
+ readonly content: v.GenericSchema<JSONContent>;
14
9
  readonly subject: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
15
10
  readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
16
11
  }, undefined>;
17
- readonly emailAccountId: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
18
- readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
12
+ readonly emailAccountId: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.UuidAction<string, undefined>]>, undefined>;
13
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.UuidAction<string, undefined>]>, undefined>;
19
14
  readonly referencedMessageId: v.NullableSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
20
15
  }, undefined>;
21
16
  mutators: {
22
- create: {
23
- delta: v.ObjectSchema<{
24
- readonly body: v.ObjectSchema<{
25
- readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
26
- readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
27
- readonly content: v.ObjectSchema<{
28
- readonly content: v.ArraySchema<v.LooseObjectSchema<{
29
- readonly type: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
30
- }, undefined>, undefined>;
31
- readonly type: v.UnionSchema<[v.LiteralSchema<"doc", undefined>], undefined>;
32
- }, undefined>;
33
- readonly replyTo: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
34
- readonly subject: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
35
- readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
36
- }, undefined>;
37
- readonly emailAccountId: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
38
- readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
39
- readonly referencedMessageId: v.NullableSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
40
- }, undefined>;
41
- };
42
17
  delete: {
43
18
  delta: v.ObjectSchema<{
44
- readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
19
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.UuidAction<string, undefined>]>, undefined>;
45
20
  }, undefined>;
46
21
  };
47
- update: {
22
+ upsert: {
48
23
  delta: v.ObjectSchema<{
49
- readonly body: Omit<v.ObjectSchema<{
24
+ readonly body: v.ObjectSchema<{
50
25
  readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
51
26
  readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
52
- readonly content: v.ObjectSchema<{
53
- readonly content: v.ArraySchema<v.LooseObjectSchema<{
54
- readonly type: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
55
- }, undefined>, undefined>;
56
- readonly type: v.UnionSchema<[v.LiteralSchema<"doc", undefined>], undefined>;
57
- }, undefined>;
58
- readonly replyTo: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
27
+ readonly content: v.GenericSchema<JSONContent>;
59
28
  readonly subject: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
60
29
  readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
61
- }, undefined>, "entries" | "~standard" | "~run" | "~types"> & {
62
- readonly entries: {
63
- readonly bcc: v.OptionalSchema<v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>, undefined>;
64
- readonly cc: v.OptionalSchema<v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>, undefined>;
65
- readonly content: v.OptionalSchema<v.ObjectSchema<{
66
- readonly content: v.ArraySchema<v.LooseObjectSchema<{
67
- readonly type: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
68
- }, undefined>, undefined>;
69
- readonly type: v.UnionSchema<[v.LiteralSchema<"doc", undefined>], undefined>;
70
- }, undefined>, undefined>;
71
- readonly replyTo: v.OptionalSchema<v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>, undefined>;
72
- readonly subject: v.OptionalSchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
73
- readonly to: v.OptionalSchema<v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>, undefined>;
74
- };
75
- readonly '~standard': v.StandardSchemaProps<{
76
- bcc?: string[] | undefined;
77
- cc?: string[] | undefined;
78
- content?: {
79
- type: "doc";
80
- content: ({
81
- type: string;
82
- } & {
83
- [key: string]: unknown;
84
- })[];
85
- } | undefined;
86
- replyTo?: string[] | undefined;
87
- to?: string[] | undefined;
88
- subject?: string | undefined;
89
- }, {
90
- bcc?: string[] | undefined;
91
- cc?: string[] | undefined;
92
- content?: {
93
- type: "doc";
94
- content: ({
95
- type: string;
96
- } & {
97
- [key: string]: unknown;
98
- })[];
99
- } | undefined;
100
- replyTo?: string[] | undefined;
101
- to?: string[] | undefined;
102
- subject?: string | undefined;
103
- }>;
104
- readonly '~run': (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
105
- bcc?: string[] | undefined;
106
- cc?: string[] | undefined;
107
- content?: {
108
- type: "doc";
109
- content: ({
110
- type: string;
111
- } & {
112
- [key: string]: unknown;
113
- })[];
114
- } | undefined;
115
- replyTo?: string[] | undefined;
116
- to?: string[] | undefined;
117
- subject?: string | undefined;
118
- }, v.LiteralIssue | v.StringIssue | v.EmailIssue<string> | v.MaxLengthIssue<string, 255> | v.NonEmptyIssue<string> | v.ObjectIssue | v.UnionIssue<v.LiteralIssue> | v.NonOptionalIssue | v.ArrayIssue | v.LooseObjectIssue>;
119
- readonly '~types'?: {
120
- readonly input: {
121
- bcc?: string[] | undefined;
122
- cc?: string[] | undefined;
123
- content?: {
124
- type: "doc";
125
- content: ({
126
- type: string;
127
- } & {
128
- [key: string]: unknown;
129
- })[];
130
- } | undefined;
131
- replyTo?: string[] | undefined;
132
- to?: string[] | undefined;
133
- subject?: string | undefined;
134
- };
135
- readonly output: {
136
- bcc?: string[] | undefined;
137
- cc?: string[] | undefined;
138
- content?: {
139
- type: "doc";
140
- content: ({
141
- type: string;
142
- } & {
143
- [key: string]: unknown;
144
- })[];
145
- } | undefined;
146
- replyTo?: string[] | undefined;
147
- to?: string[] | undefined;
148
- subject?: string | undefined;
149
- };
150
- readonly issue: v.LiteralIssue | v.StringIssue | v.EmailIssue<string> | v.MaxLengthIssue<string, 255> | v.NonEmptyIssue<string> | v.ObjectIssue | v.UnionIssue<v.LiteralIssue> | v.NonOptionalIssue | v.ArrayIssue | v.LooseObjectIssue;
151
- } | undefined;
152
- };
153
- readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
30
+ }, undefined>;
31
+ readonly emailAccountId: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.UuidAction<string, undefined>]>, undefined>;
32
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.UuidAction<string, undefined>]>, undefined>;
33
+ readonly referencedMessageId: v.NullableSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
154
34
  }, undefined>;
155
35
  };
156
36
  };
@@ -1 +1 @@
1
- {"version":3,"file":"draft.d.ts","sourceRoot":"","sources":["../../src/clients/draft.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAuB5B,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCK,CAAA"}
1
+ {"version":3,"file":"draft.d.ts","sourceRoot":"","sources":["../../src/clients/draft.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAG5B,OAAO,EAAE,WAAW,EAAe,MAAM,qBAAqB,CAAA;AA4B9D,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBK,CAAA"}
@@ -1,46 +1,37 @@
1
1
  import * as v from 'valibot';
2
2
  import { marcoSchemas } from '../schemas';
3
- const body = v.object({
4
- bcc: v.array(marcoSchemas.string.email()),
5
- cc: v.array(marcoSchemas.string.email()),
6
- content: v.object({
7
- content: v.array(v.looseObject({
8
- type: marcoSchemas.string.required(),
9
- })),
10
- type: v.union([
11
- v.literal('doc'),
12
- ]),
3
+ const jsonContentSchema = v.lazy(() => v.object({
4
+ attrs: v.optional(v.record(v.string(), v.unknown())),
5
+ content: v.optional(v.array(jsonContentSchema)),
6
+ marks: v.optional(v.array(v.object({
7
+ attrs: v.optional(v.record(v.string(), v.unknown())),
8
+ type: v.string(),
9
+ }))),
10
+ text: v.optional(v.string()),
11
+ type: v.optional(v.string()),
12
+ }));
13
+ const draftSchema = v.object({
14
+ body: v.object({
15
+ bcc: v.array(marcoSchemas.string.email()),
16
+ cc: v.array(marcoSchemas.string.email()),
17
+ content: jsonContentSchema,
18
+ subject: marcoSchemas.string.required(),
19
+ to: v.array(marcoSchemas.string.email()),
13
20
  }),
14
- replyTo: v.array(marcoSchemas.string.email()),
15
- subject: marcoSchemas.string.required(),
16
- to: v.array(marcoSchemas.string.email()),
21
+ emailAccountId: marcoSchemas.string.uuid(),
22
+ id: marcoSchemas.string.uuid(),
23
+ referencedMessageId: marcoSchemas.string.nullable(),
17
24
  });
18
25
  export const draft = {
19
- model: v.object({
20
- body: body,
21
- emailAccountId: marcoSchemas.string.required(),
22
- id: marcoSchemas.string.required(),
23
- referencedMessageId: marcoSchemas.string.nullable(),
24
- }),
26
+ model: draftSchema,
25
27
  mutators: {
26
- create: {
27
- delta: v.object({
28
- body: body,
29
- emailAccountId: marcoSchemas.string.required(),
30
- id: marcoSchemas.string.required(),
31
- referencedMessageId: marcoSchemas.string.nullable(),
32
- }),
33
- },
34
28
  delete: {
35
29
  delta: v.object({
36
- id: marcoSchemas.string.required(),
30
+ id: marcoSchemas.string.uuid(),
37
31
  }),
38
32
  },
39
- update: {
40
- delta: v.object({
41
- body: v.partial(body),
42
- id: marcoSchemas.string.required(),
43
- }),
33
+ upsert: {
34
+ delta: draftSchema,
44
35
  },
45
36
  },
46
37
  name: 'draft',