@marcoappio/marco-config 2.0.169 → 2.0.171

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 (38) hide show
  1. package/dist/clients/account.d.ts +3 -3
  2. package/dist/clients/draft.d.ts +73 -5
  3. package/dist/clients/draft.d.ts.map +1 -1
  4. package/dist/clients/draft.js +34 -14
  5. package/dist/clients/index.d.ts +79 -11
  6. package/dist/clients/index.d.ts.map +1 -1
  7. package/dist/clients/user.d.ts +3 -3
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +1 -1
  11. package/dist/schemas.d.ts +26 -11
  12. package/dist/schemas.d.ts.map +1 -1
  13. package/dist/schemas.js +34 -20
  14. package/dist/sdk/endpoints/index.d.ts +27 -7
  15. package/dist/sdk/endpoints/index.d.ts.map +1 -1
  16. package/dist/sdk/endpoints/private/index.d.ts +27 -7
  17. package/dist/sdk/endpoints/private/index.d.ts.map +1 -1
  18. package/dist/sdk/endpoints/private/sync/index.d.ts +27 -7
  19. package/dist/sdk/endpoints/private/sync/index.d.ts.map +1 -1
  20. package/dist/sdk/endpoints/private/sync/push/account.d.ts +3 -3
  21. package/dist/sdk/endpoints/private/sync/push/draft.d.ts +21 -1
  22. package/dist/sdk/endpoints/private/sync/push/draft.d.ts.map +1 -1
  23. package/dist/sdk/endpoints/private/sync/push/draft.js +14 -2
  24. package/dist/sdk/endpoints/private/sync/push/index.d.ts +27 -7
  25. package/dist/sdk/endpoints/private/sync/push/index.d.ts.map +1 -1
  26. package/dist/sdk/endpoints/private/sync/push/user.d.ts +3 -3
  27. package/dist/sdk/index.d.ts +27 -7
  28. package/dist/sdk/index.d.ts.map +1 -1
  29. package/dist/utils/index.d.ts +1 -0
  30. package/dist/utils/index.d.ts.map +1 -1
  31. package/dist/utils/index.js +1 -0
  32. package/dist/utils/stringPatch/index.d.ts +2 -0
  33. package/dist/utils/stringPatch/index.d.ts.map +1 -0
  34. package/dist/utils/stringPatch/index.js +1 -0
  35. package/dist/utils/stringPatch/stringPatch.d.ts +3 -6
  36. package/dist/utils/stringPatch/stringPatch.d.ts.map +1 -1
  37. package/dist/utils/stringPatch/stringPatch.test.js +38 -0
  38. package/package.json +1 -1
@@ -56,7 +56,7 @@ export declare const account: {
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>;
58
58
  readonly lastName: v.NullableSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
59
- }, undefined>, "entries" | "~standard" | "~run" | "~types"> & {
59
+ }, undefined>, "~types" | "~run" | "~standard" | "entries"> & {
60
60
  readonly entries: {
61
61
  readonly color: v.OptionalSchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
62
62
  readonly firstName: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
@@ -75,7 +75,7 @@ export declare const account: {
75
75
  color?: string | undefined;
76
76
  firstName?: string | null | undefined;
77
77
  lastName?: string | null | undefined;
78
- }, v.StringIssue | v.MaxLengthIssue<string, 255> | v.NonEmptyIssue<string> | v.ObjectIssue | v.NonOptionalIssue>;
78
+ }, v.StringIssue | v.ObjectIssue | v.MaxLengthIssue<string, 255> | v.NonEmptyIssue<string> | v.NonOptionalIssue>;
79
79
  readonly '~types'?: {
80
80
  readonly input: {
81
81
  color?: string | undefined;
@@ -87,7 +87,7 @@ export declare const account: {
87
87
  firstName?: string | null | undefined;
88
88
  lastName?: string | null | undefined;
89
89
  };
90
- readonly issue: v.StringIssue | v.MaxLengthIssue<string, 255> | v.NonEmptyIssue<string> | v.ObjectIssue | v.NonOptionalIssue;
90
+ readonly issue: v.StringIssue | v.ObjectIssue | v.MaxLengthIssue<string, 255> | v.NonEmptyIssue<string> | v.NonOptionalIssue;
91
91
  } | undefined;
92
92
  };
93
93
  }, undefined>;
@@ -14,23 +14,91 @@ export declare const draft: {
14
14
  readonly status: v.UnionSchema<[v.LiteralSchema<"DRAFT", undefined>, v.LiteralSchema<"SENDING", undefined>, v.LiteralSchema<"SENDING_FAILED", undefined>], undefined>;
15
15
  }, undefined>;
16
16
  mutators: {
17
+ create: {
18
+ delta: v.ObjectSchema<{
19
+ readonly body: v.ObjectSchema<{
20
+ readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
21
+ readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
22
+ readonly content: v.StringSchema<undefined>;
23
+ readonly subject: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
24
+ readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
25
+ }, undefined>;
26
+ readonly emailAccountId: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.UuidAction<string, undefined>]>, undefined>;
27
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.UuidAction<string, undefined>]>, undefined>;
28
+ readonly referencedMessageId: v.NullableSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
29
+ readonly status: v.UnionSchema<[v.LiteralSchema<"DRAFT", undefined>, v.LiteralSchema<"SENDING", undefined>, v.LiteralSchema<"SENDING_FAILED", undefined>], undefined>;
30
+ }, undefined>;
31
+ };
17
32
  delete: {
18
33
  delta: v.ObjectSchema<{
19
34
  readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.UuidAction<string, undefined>]>, undefined>;
20
35
  }, undefined>;
21
36
  };
22
- upsert: {
37
+ setContent: {
23
38
  delta: v.ObjectSchema<{
24
- readonly body: v.ObjectSchema<{
39
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.UuidAction<string, undefined>]>, undefined>;
40
+ readonly patch: v.ArraySchema<v.ObjectSchema<{
41
+ readonly index: v.NumberSchema<undefined>;
42
+ readonly type: v.UnionSchema<[v.LiteralSchema<"INSERTION", undefined>, v.LiteralSchema<"DELETION", undefined>], undefined>;
43
+ readonly value: v.StringSchema<undefined>;
44
+ }, undefined>, undefined>;
45
+ }, undefined>;
46
+ };
47
+ setEnvelope: {
48
+ delta: v.ObjectSchema<{
49
+ readonly envelope: Omit<v.ObjectSchema<{
25
50
  readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
26
51
  readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
27
52
  readonly content: v.StringSchema<undefined>;
28
53
  readonly subject: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
29
54
  readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
30
- }, undefined>;
31
- readonly emailAccountId: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.UuidAction<string, undefined>]>, undefined>;
55
+ }, undefined>, "~types" | "~run" | "~standard" | "entries"> & {
56
+ readonly entries: Omit<{
57
+ readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
58
+ readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
59
+ readonly content: v.StringSchema<undefined>;
60
+ readonly subject: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
61
+ readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
62
+ }, "content">;
63
+ readonly '~standard': v.StandardSchemaProps<{
64
+ bcc: string[];
65
+ cc: string[];
66
+ to: string[];
67
+ subject: string;
68
+ }, {
69
+ bcc: string[];
70
+ cc: string[];
71
+ to: string[];
72
+ subject: string;
73
+ }>;
74
+ readonly '~run': (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
75
+ bcc: string[];
76
+ cc: string[];
77
+ to: string[];
78
+ subject: string;
79
+ }, v.StringIssue | v.ObjectIssue | v.EmailIssue<string> | v.MaxLengthIssue<string, 255> | v.NonEmptyIssue<string> | v.ArrayIssue | v.NonOptionalIssue>;
80
+ readonly '~types'?: {
81
+ readonly input: {
82
+ bcc: string[];
83
+ cc: string[];
84
+ to: string[];
85
+ subject: string;
86
+ };
87
+ readonly output: {
88
+ bcc: string[];
89
+ cc: string[];
90
+ to: string[];
91
+ subject: string;
92
+ };
93
+ readonly issue: v.StringIssue | v.ObjectIssue | v.EmailIssue<string> | v.MaxLengthIssue<string, 255> | v.NonEmptyIssue<string> | v.ArrayIssue | v.NonOptionalIssue;
94
+ } | undefined;
95
+ };
96
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.UuidAction<string, undefined>]>, undefined>;
97
+ }, undefined>;
98
+ };
99
+ setStatus: {
100
+ delta: v.ObjectSchema<{
32
101
  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>;
34
102
  readonly status: v.UnionSchema<[v.LiteralSchema<"DRAFT", undefined>, v.LiteralSchema<"SENDING", undefined>, v.LiteralSchema<"SENDING_FAILED", undefined>], undefined>;
35
103
  }, undefined>;
36
104
  };
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBK,CAAA"}
1
+ {"version":3,"file":"draft.d.ts","sourceRoot":"","sources":["../../src/clients/draft.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AA2B5B,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCK,CAAA"}
@@ -1,32 +1,52 @@
1
1
  import * as v from 'valibot';
2
2
  import { marcoSchemas } from '../schemas';
3
+ const draftStatusSchema = v.union([
4
+ v.literal('DRAFT'),
5
+ v.literal('SENDING'),
6
+ v.literal('SENDING_FAILED'),
7
+ ]);
8
+ const bodySchema = v.object({
9
+ bcc: v.array(marcoSchemas.string.email()),
10
+ cc: v.array(marcoSchemas.string.email()),
11
+ content: v.string(),
12
+ subject: marcoSchemas.string.required(),
13
+ to: v.array(marcoSchemas.string.email()),
14
+ });
3
15
  const draftSchema = v.object({
4
- body: v.object({
5
- bcc: v.array(marcoSchemas.string.email()),
6
- cc: v.array(marcoSchemas.string.email()),
7
- content: v.string(),
8
- subject: marcoSchemas.string.required(),
9
- to: v.array(marcoSchemas.string.email()),
10
- }),
16
+ body: bodySchema,
11
17
  emailAccountId: marcoSchemas.string.uuid(),
12
18
  id: marcoSchemas.string.uuid(),
13
19
  referencedMessageId: marcoSchemas.string.nullable(),
14
- status: v.union([
15
- v.literal('DRAFT'),
16
- v.literal('SENDING'),
17
- v.literal('SENDING_FAILED'),
18
- ]),
20
+ status: draftStatusSchema,
19
21
  });
20
22
  export const draft = {
21
23
  model: draftSchema,
22
24
  mutators: {
25
+ create: {
26
+ delta: draftSchema,
27
+ },
23
28
  delete: {
24
29
  delta: v.object({
25
30
  id: marcoSchemas.string.uuid(),
26
31
  }),
27
32
  },
28
- upsert: {
29
- delta: draftSchema,
33
+ setContent: {
34
+ delta: v.object({
35
+ id: marcoSchemas.string.uuid(),
36
+ patch: marcoSchemas.drafts.contentPatch.patch(),
37
+ }),
38
+ },
39
+ setEnvelope: {
40
+ delta: v.object({
41
+ envelope: v.omit(bodySchema, ['content']),
42
+ id: marcoSchemas.string.uuid(),
43
+ }),
44
+ },
45
+ setStatus: {
46
+ delta: v.object({
47
+ id: marcoSchemas.string.uuid(),
48
+ status: draftStatusSchema,
49
+ }),
30
50
  },
31
51
  },
32
52
  name: 'draft',
@@ -57,7 +57,7 @@ export declare const marcoClients: {
57
57
  readonly color: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>;
58
58
  readonly firstName: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>;
59
59
  readonly lastName: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>;
60
- }, undefined>, "entries" | "~standard" | "~run" | "~types"> & {
60
+ }, undefined>, "~types" | "~run" | "~standard" | "entries"> & {
61
61
  readonly entries: {
62
62
  readonly color: import("valibot").OptionalSchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
63
63
  readonly firstName: import("valibot").OptionalSchema<import("valibot").NullableSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
@@ -76,7 +76,7 @@ export declare const marcoClients: {
76
76
  color?: string | undefined;
77
77
  firstName?: string | null | undefined;
78
78
  lastName?: string | null | undefined;
79
- }, import("valibot").StringIssue | import("valibot").MaxLengthIssue<string, 255> | import("valibot").NonEmptyIssue<string> | import("valibot").ObjectIssue | import("valibot").NonOptionalIssue>;
79
+ }, import("valibot").StringIssue | import("valibot").ObjectIssue | import("valibot").MaxLengthIssue<string, 255> | import("valibot").NonEmptyIssue<string> | import("valibot").NonOptionalIssue>;
80
80
  readonly '~types'?: {
81
81
  readonly input: {
82
82
  color?: string | undefined;
@@ -88,7 +88,7 @@ export declare const marcoClients: {
88
88
  firstName?: string | null | undefined;
89
89
  lastName?: string | null | undefined;
90
90
  };
91
- readonly issue: import("valibot").StringIssue | import("valibot").MaxLengthIssue<string, 255> | import("valibot").NonEmptyIssue<string> | import("valibot").ObjectIssue | import("valibot").NonOptionalIssue;
91
+ readonly issue: import("valibot").StringIssue | import("valibot").ObjectIssue | import("valibot").MaxLengthIssue<string, 255> | import("valibot").NonEmptyIssue<string> | import("valibot").NonOptionalIssue;
92
92
  } | undefined;
93
93
  };
94
94
  }, undefined>;
@@ -126,23 +126,91 @@ export declare const marcoClients: {
126
126
  readonly status: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"DRAFT", undefined>, import("valibot").LiteralSchema<"SENDING", undefined>, import("valibot").LiteralSchema<"SENDING_FAILED", undefined>], undefined>;
127
127
  }, undefined>;
128
128
  mutators: {
129
+ create: {
130
+ delta: import("valibot").ObjectSchema<{
131
+ readonly body: import("valibot").ObjectSchema<{
132
+ readonly bcc: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
133
+ readonly cc: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
134
+ readonly content: import("valibot").StringSchema<undefined>;
135
+ readonly subject: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>;
136
+ readonly to: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
137
+ }, undefined>;
138
+ readonly emailAccountId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").UuidAction<string, undefined>]>, undefined>;
139
+ readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").UuidAction<string, undefined>]>, undefined>;
140
+ readonly referencedMessageId: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>;
141
+ readonly status: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"DRAFT", undefined>, import("valibot").LiteralSchema<"SENDING", undefined>, import("valibot").LiteralSchema<"SENDING_FAILED", undefined>], undefined>;
142
+ }, undefined>;
143
+ };
129
144
  delete: {
130
145
  delta: import("valibot").ObjectSchema<{
131
146
  readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").UuidAction<string, undefined>]>, undefined>;
132
147
  }, undefined>;
133
148
  };
134
- upsert: {
149
+ setContent: {
135
150
  delta: import("valibot").ObjectSchema<{
136
- readonly body: import("valibot").ObjectSchema<{
151
+ readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").UuidAction<string, undefined>]>, undefined>;
152
+ readonly patch: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
153
+ readonly index: import("valibot").NumberSchema<undefined>;
154
+ readonly type: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"INSERTION", undefined>, import("valibot").LiteralSchema<"DELETION", undefined>], undefined>;
155
+ readonly value: import("valibot").StringSchema<undefined>;
156
+ }, undefined>, undefined>;
157
+ }, undefined>;
158
+ };
159
+ setEnvelope: {
160
+ delta: import("valibot").ObjectSchema<{
161
+ readonly envelope: Omit<import("valibot").ObjectSchema<{
137
162
  readonly bcc: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
138
163
  readonly cc: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
139
164
  readonly content: import("valibot").StringSchema<undefined>;
140
165
  readonly subject: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>;
141
166
  readonly to: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
142
- }, undefined>;
143
- readonly emailAccountId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").UuidAction<string, undefined>]>, undefined>;
167
+ }, undefined>, "~types" | "~run" | "~standard" | "entries"> & {
168
+ readonly entries: Omit<{
169
+ readonly bcc: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
170
+ readonly cc: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
171
+ readonly content: import("valibot").StringSchema<undefined>;
172
+ readonly subject: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>;
173
+ readonly to: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
174
+ }, "content">;
175
+ readonly '~standard': import("valibot").StandardSchemaProps<{
176
+ bcc: string[];
177
+ cc: string[];
178
+ to: string[];
179
+ subject: string;
180
+ }, {
181
+ bcc: string[];
182
+ cc: string[];
183
+ to: string[];
184
+ subject: string;
185
+ }>;
186
+ readonly '~run': (dataset: import("valibot").UnknownDataset, config: import("valibot").Config<import("valibot").BaseIssue<unknown>>) => import("valibot").OutputDataset<{
187
+ bcc: string[];
188
+ cc: string[];
189
+ to: string[];
190
+ subject: string;
191
+ }, import("valibot").StringIssue | import("valibot").ObjectIssue | import("valibot").EmailIssue<string> | import("valibot").MaxLengthIssue<string, 255> | import("valibot").NonEmptyIssue<string> | import("valibot").ArrayIssue | import("valibot").NonOptionalIssue>;
192
+ readonly '~types'?: {
193
+ readonly input: {
194
+ bcc: string[];
195
+ cc: string[];
196
+ to: string[];
197
+ subject: string;
198
+ };
199
+ readonly output: {
200
+ bcc: string[];
201
+ cc: string[];
202
+ to: string[];
203
+ subject: string;
204
+ };
205
+ readonly issue: import("valibot").StringIssue | import("valibot").ObjectIssue | import("valibot").EmailIssue<string> | import("valibot").MaxLengthIssue<string, 255> | import("valibot").NonEmptyIssue<string> | import("valibot").ArrayIssue | import("valibot").NonOptionalIssue;
206
+ } | undefined;
207
+ };
208
+ readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").UuidAction<string, undefined>]>, undefined>;
209
+ }, undefined>;
210
+ };
211
+ setStatus: {
212
+ delta: import("valibot").ObjectSchema<{
144
213
  readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").UuidAction<string, undefined>]>, undefined>;
145
- readonly referencedMessageId: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>;
146
214
  readonly status: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"DRAFT", undefined>, import("valibot").LiteralSchema<"SENDING", undefined>, import("valibot").LiteralSchema<"SENDING_FAILED", undefined>], undefined>;
147
215
  }, undefined>;
148
216
  };
@@ -215,7 +283,7 @@ export declare const marcoClients: {
215
283
  readonly settings: Omit<import("valibot").ObjectSchema<{
216
284
  readonly firstName: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>;
217
285
  readonly lastName: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>;
218
- }, undefined>, "entries" | "~standard" | "~run" | "~types"> & {
286
+ }, undefined>, "~types" | "~run" | "~standard" | "entries"> & {
219
287
  readonly entries: {
220
288
  readonly firstName: import("valibot").OptionalSchema<import("valibot").NullableSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
221
289
  readonly lastName: import("valibot").OptionalSchema<import("valibot").NullableSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
@@ -230,7 +298,7 @@ export declare const marcoClients: {
230
298
  readonly '~run': (dataset: import("valibot").UnknownDataset, config: import("valibot").Config<import("valibot").BaseIssue<unknown>>) => import("valibot").OutputDataset<{
231
299
  firstName?: string | null | undefined;
232
300
  lastName?: string | null | undefined;
233
- }, import("valibot").StringIssue | import("valibot").MaxLengthIssue<string, 255> | import("valibot").ObjectIssue>;
301
+ }, import("valibot").StringIssue | import("valibot").ObjectIssue | import("valibot").MaxLengthIssue<string, 255>>;
234
302
  readonly '~types'?: {
235
303
  readonly input: {
236
304
  firstName?: string | null | undefined;
@@ -240,7 +308,7 @@ export declare const marcoClients: {
240
308
  firstName?: string | null | undefined;
241
309
  lastName?: string | null | undefined;
242
310
  };
243
- readonly issue: import("valibot").StringIssue | import("valibot").MaxLengthIssue<string, 255> | import("valibot").ObjectIssue;
311
+ readonly issue: import("valibot").StringIssue | import("valibot").ObjectIssue | import("valibot").MaxLengthIssue<string, 255>;
244
312
  } | undefined;
245
313
  };
246
314
  }, undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/clients/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAE3C,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/clients/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAE3C,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMc,CAAA"}
@@ -14,7 +14,7 @@ export declare const user: {
14
14
  readonly settings: Omit<v.ObjectSchema<{
15
15
  readonly firstName: v.NullableSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
16
16
  readonly lastName: v.NullableSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
17
- }, undefined>, "entries" | "~standard" | "~run" | "~types"> & {
17
+ }, undefined>, "~types" | "~run" | "~standard" | "entries"> & {
18
18
  readonly entries: {
19
19
  readonly firstName: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
20
20
  readonly lastName: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
@@ -29,7 +29,7 @@ export declare const user: {
29
29
  readonly '~run': (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
30
30
  firstName?: string | null | undefined;
31
31
  lastName?: string | null | undefined;
32
- }, v.StringIssue | v.MaxLengthIssue<string, 255> | v.ObjectIssue>;
32
+ }, v.StringIssue | v.ObjectIssue | v.MaxLengthIssue<string, 255>>;
33
33
  readonly '~types'?: {
34
34
  readonly input: {
35
35
  firstName?: string | null | undefined;
@@ -39,7 +39,7 @@ export declare const user: {
39
39
  firstName?: string | null | undefined;
40
40
  lastName?: string | null | undefined;
41
41
  };
42
- readonly issue: v.StringIssue | v.MaxLengthIssue<string, 255> | v.ObjectIssue;
42
+ readonly issue: v.StringIssue | v.ObjectIssue | v.MaxLengthIssue<string, 255>;
43
43
  } | undefined;
44
44
  };
45
45
  }, undefined>;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { accountUtils } from './utils';
1
+ export { accountUtils, stringPatch } from './utils';
2
2
  export { marcoClients, marcoClientsUtils } from './clients';
3
3
  export { marcoPublicConfig, MARCO_ENV, MarcoEnvironment } from './marcoPublicConfig';
4
4
  export { marcoSchemas } from './schemas';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAC9B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAC9B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { accountUtils } from './utils';
1
+ export { accountUtils, stringPatch } from './utils';
2
2
  export { marcoClients, marcoClientsUtils } from './clients';
3
3
  export { marcoPublicConfig, MARCO_ENV } from './marcoPublicConfig';
4
4
  export { marcoSchemas } from './schemas';
package/dist/schemas.d.ts CHANGED
@@ -1,18 +1,33 @@
1
+ import * as v from 'valibot';
1
2
  export declare const marcoSchemas: {
2
- emailAccountConnectionState: () => import("valibot").UnionSchema<[import("valibot").LiteralSchema<"AWAITING_CONNECTION", undefined>, import("valibot").LiteralSchema<"CONNECTED", undefined>, import("valibot").LiteralSchema<"CONNECTION_FAILED", undefined>], undefined>;
3
- labelSpecialUse: () => import("valibot").UnionSchema<[import("valibot").LiteralSchema<"ARCHIVE", undefined>, import("valibot").LiteralSchema<"INBOX", undefined>, import("valibot").LiteralSchema<"SENT", undefined>, import("valibot").LiteralSchema<"SPAM", undefined>, import("valibot").LiteralSchema<"TRASH", undefined>], undefined>;
3
+ drafts: {
4
+ contentPatch: {
5
+ instruction: () => v.ObjectSchema<{
6
+ readonly index: v.NumberSchema<undefined>;
7
+ readonly type: v.UnionSchema<[v.LiteralSchema<"INSERTION", undefined>, v.LiteralSchema<"DELETION", undefined>], undefined>;
8
+ readonly value: v.StringSchema<undefined>;
9
+ }, undefined>;
10
+ patch: () => v.ArraySchema<v.ObjectSchema<{
11
+ readonly index: v.NumberSchema<undefined>;
12
+ readonly type: v.UnionSchema<[v.LiteralSchema<"INSERTION", undefined>, v.LiteralSchema<"DELETION", undefined>], undefined>;
13
+ readonly value: v.StringSchema<undefined>;
14
+ }, undefined>, undefined>;
15
+ };
16
+ };
17
+ emailAccountConnectionState: () => v.UnionSchema<[v.LiteralSchema<"AWAITING_CONNECTION", undefined>, v.LiteralSchema<"CONNECTED", undefined>, v.LiteralSchema<"CONNECTION_FAILED", undefined>], undefined>;
18
+ labelSpecialUse: () => v.UnionSchema<[v.LiteralSchema<"ARCHIVE", undefined>, v.LiteralSchema<"INBOX", undefined>, v.LiteralSchema<"SENT", undefined>, v.LiteralSchema<"SPAM", undefined>, v.LiteralSchema<"TRASH", undefined>], undefined>;
4
19
  number: {
5
- minMax: (min: number, max: number) => import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").MinValueAction<number, number, undefined>, import("valibot").MaxValueAction<number, number, undefined>]>, undefined>;
6
- positiveInteger: () => import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
20
+ minMax: (min: number, max: number) => v.NonOptionalSchema<v.SchemaWithPipe<[v.NumberSchema<undefined>, v.MinValueAction<number, number, undefined>, v.MaxValueAction<number, number, undefined>]>, undefined>;
21
+ positiveInteger: () => v.NonOptionalSchema<v.SchemaWithPipe<[v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
7
22
  };
8
23
  string: {
9
- email: () => import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>;
10
- enum: (values: Record<string, string>) => import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").EnumSchema<Record<string, string>, undefined>]>, undefined>;
11
- matches: (regex: RegExp) => import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").RegexAction<string, undefined>]>, undefined>;
12
- nullable: () => import("valibot").NullableSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>;
13
- optional: () => import("valibot").UndefinedableSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>;
14
- required: () => import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>;
15
- uuid: () => import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").UuidAction<string, undefined>]>, undefined>;
24
+ email: () => v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
25
+ enum: (values: Record<string, string>) => v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.EnumSchema<Record<string, string>, undefined>]>, undefined>;
26
+ matches: (regex: RegExp) => v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
27
+ nullable: () => v.NullableSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
28
+ optional: () => v.UndefinedableSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
29
+ required: () => v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
30
+ uuid: () => v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.UuidAction<string, undefined>]>, undefined>;
16
31
  };
17
32
  };
18
33
  //# sourceMappingURL=schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;sBAcP,MAAM,OAAO,MAAM;;;;;uBAQlB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;yBAEpB,MAAM;;;;;;CAW1B,CAAA"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAW5B,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;sBAoBP,MAAM,OAAO,MAAM;;;;;uBAQlB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;yBAEpB,MAAM;;;;;;CAW1B,CAAA"}
package/dist/schemas.js CHANGED
@@ -1,28 +1,42 @@
1
- import { email, enum as enumValidator, integer, literal, maxLength, maxValue, minValue, nonEmpty, nonOptional, nullable, number, pipe, string, undefinedable, union, uuid, regex as v_regex } from 'valibot';
1
+ import * as v from 'valibot';
2
+ const patchInstructionSchema = v.object({
3
+ index: v.number(),
4
+ type: v.union([
5
+ v.literal('INSERTION'),
6
+ v.literal('DELETION'),
7
+ ]),
8
+ value: v.string(),
9
+ });
2
10
  export const marcoSchemas = {
3
- emailAccountConnectionState: () => union([
4
- literal('AWAITING_CONNECTION'),
5
- literal('CONNECTED'),
6
- literal('CONNECTION_FAILED'),
11
+ drafts: {
12
+ contentPatch: {
13
+ instruction: () => patchInstructionSchema,
14
+ patch: () => v.array(patchInstructionSchema),
15
+ },
16
+ },
17
+ emailAccountConnectionState: () => v.union([
18
+ v.literal('AWAITING_CONNECTION'),
19
+ v.literal('CONNECTED'),
20
+ v.literal('CONNECTION_FAILED'),
7
21
  ]),
8
- labelSpecialUse: () => union([
9
- literal('ARCHIVE'),
10
- literal('INBOX'),
11
- literal('SENT'),
12
- literal('SPAM'),
13
- literal('TRASH'),
22
+ labelSpecialUse: () => v.union([
23
+ v.literal('ARCHIVE'),
24
+ v.literal('INBOX'),
25
+ v.literal('SENT'),
26
+ v.literal('SPAM'),
27
+ v.literal('TRASH'),
14
28
  ]),
15
29
  number: {
16
- minMax: (min, max) => nonOptional(pipe(number(), minValue(min), maxValue(max))),
17
- positiveInteger: () => nonOptional(pipe(number(), integer(), minValue(0))),
30
+ minMax: (min, max) => v.nonOptional(v.pipe(v.number(), v.minValue(min), v.maxValue(max))),
31
+ positiveInteger: () => v.nonOptional(v.pipe(v.number(), v.integer(), v.minValue(0))),
18
32
  },
19
33
  string: {
20
- email: () => nonOptional(pipe(string(), email(), maxLength(255))),
21
- enum: (values) => nonOptional(pipe(string(), enumValidator(values))),
22
- matches: (regex) => nonOptional(pipe(string(), v_regex(regex))),
23
- nullable: () => nullable(pipe(string(), maxLength(255))),
24
- optional: () => undefinedable(pipe(string(), maxLength(255))),
25
- required: () => nonOptional(pipe(string(), nonEmpty(), maxLength(255))),
26
- uuid: () => nonOptional(pipe(string(), nonEmpty(), uuid())),
34
+ email: () => v.nonOptional(v.pipe(v.string(), v.email(), v.maxLength(255))),
35
+ enum: (values) => v.nonOptional(v.pipe(v.string(), v.enum(values))),
36
+ matches: (regex) => v.nonOptional(v.pipe(v.string(), v.regex(regex))),
37
+ nullable: () => v.nullable(v.pipe(v.string(), v.maxLength(255))),
38
+ optional: () => v.undefinedable(v.pipe(v.string(), v.maxLength(255))),
39
+ required: () => v.nonOptional(v.pipe(v.string(), v.nonEmpty(), v.maxLength(255))),
40
+ uuid: () => v.nonOptional(v.pipe(v.string(), v.nonEmpty(), v.uuid())),
27
41
  },
28
42
  };