@marcoappio/marco-config 2.0.494 → 2.0.496

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 (34) hide show
  1. package/dist/zero/index.d.ts +224 -0
  2. package/dist/zero/index.d.ts.map +1 -1
  3. package/dist/zero/index.js +2 -1
  4. package/dist/zero/mutators/accountMutators/accountMutators.d.ts +61 -0
  5. package/dist/zero/mutators/accountMutators/accountMutators.d.ts.map +1 -1
  6. package/dist/zero/mutators/accountMutators/accountMutators.js +79 -79
  7. package/dist/zero/mutators/accountMutators/index.d.ts +1 -1
  8. package/dist/zero/mutators/accountMutators/index.d.ts.map +1 -1
  9. package/dist/zero/mutators/accountMutators/index.js +1 -1
  10. package/dist/zero/mutators/draftMutators/draftMutators.d.ts +94 -0
  11. package/dist/zero/mutators/draftMutators/draftMutators.d.ts.map +1 -1
  12. package/dist/zero/mutators/draftMutators/draftMutators.js +76 -77
  13. package/dist/zero/mutators/draftMutators/index.d.ts +1 -1
  14. package/dist/zero/mutators/draftMutators/index.d.ts.map +1 -1
  15. package/dist/zero/mutators/draftMutators/index.js +1 -1
  16. package/dist/zero/mutators/index.d.ts +224 -0
  17. package/dist/zero/mutators/index.d.ts.map +1 -1
  18. package/dist/zero/mutators/index.js +10 -0
  19. package/dist/zero/mutators/threadMutators/index.d.ts +1 -1
  20. package/dist/zero/mutators/threadMutators/index.d.ts.map +1 -1
  21. package/dist/zero/mutators/threadMutators/index.js +1 -1
  22. package/dist/zero/mutators/threadMutators/threadMutators.d.ts +54 -2
  23. package/dist/zero/mutators/threadMutators/threadMutators.d.ts.map +1 -1
  24. package/dist/zero/mutators/threadMutators/threadMutators.js +42 -31
  25. package/dist/zero/mutators/typedMutator.d.ts +2056 -0
  26. package/dist/zero/mutators/typedMutator.d.ts.map +1 -0
  27. package/dist/zero/mutators/typedMutator.js +2 -0
  28. package/dist/zero/mutators/userMutators/index.d.ts +1 -1
  29. package/dist/zero/mutators/userMutators/index.d.ts.map +1 -1
  30. package/dist/zero/mutators/userMutators/index.js +1 -1
  31. package/dist/zero/mutators/userMutators/userMutators.d.ts +19 -0
  32. package/dist/zero/mutators/userMutators/userMutators.d.ts.map +1 -1
  33. package/dist/zero/mutators/userMutators/userMutators.js +26 -27
  34. package/package.json +1 -1
@@ -1,3 +1,227 @@
1
1
  export type { MarcoZeroMutators } from './mutators';
2
2
  export { mutators } from './mutators';
3
+ export declare const mutatorSchemas: {
4
+ account: {
5
+ createAccount: import("valibot").ObjectSchema<{
6
+ readonly aliasId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
7
+ readonly color: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
8
+ readonly emailAddress: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>;
9
+ readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
10
+ }, undefined>;
11
+ createAlias: import("valibot").ObjectSchema<{
12
+ readonly accountId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
13
+ readonly alias: import("valibot").ObjectSchema<{
14
+ readonly emailAddress: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>;
15
+ readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
16
+ readonly name: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
17
+ }, undefined>;
18
+ }, undefined>;
19
+ deleteAccount: import("valibot").ObjectSchema<{
20
+ readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
21
+ }, undefined>;
22
+ deleteAlias: import("valibot").ObjectSchema<{
23
+ readonly accountId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
24
+ readonly aliasId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
25
+ }, undefined>;
26
+ setAliasName: import("valibot").ObjectSchema<{
27
+ readonly accountId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
28
+ readonly aliasId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
29
+ readonly displayName: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
30
+ }, undefined>;
31
+ setAliasPrimary: import("valibot").ObjectSchema<{
32
+ readonly accountId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
33
+ readonly aliasId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
34
+ }, undefined>;
35
+ setConnectionConfigImapRaw: import("valibot").ObjectSchema<{
36
+ readonly connectionConfig: import("valibot").ObjectSchema<{
37
+ readonly imapHost: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
38
+ readonly imapPassword: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
39
+ readonly imapPort: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").MinValueAction<number, number, undefined>, import("valibot").MaxValueAction<number, number, undefined>]>, undefined>;
40
+ readonly imapSocketType: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"STARTTLS", undefined>, import("valibot").LiteralSchema<"SSL", undefined>], undefined>;
41
+ readonly imapUser: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
42
+ readonly smtpHost: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
43
+ readonly smtpPassword: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
44
+ readonly smtpPort: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").MinValueAction<number, number, undefined>, import("valibot").MaxValueAction<number, number, undefined>]>, undefined>;
45
+ readonly smtpSocketType: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"STARTTLS", undefined>, import("valibot").LiteralSchema<"SSL", undefined>], undefined>;
46
+ readonly smtpUser: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
47
+ }, undefined>;
48
+ readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
49
+ }, undefined>;
50
+ setConnectionConfigOauth: import("valibot").ObjectSchema<{
51
+ readonly connectionConfig: import("valibot").ObjectSchema<{
52
+ readonly code: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
53
+ readonly provider: import("valibot").PicklistSchema<readonly ["GOOGLE", "OUTLOOK"], undefined>;
54
+ readonly user: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
55
+ }, undefined>;
56
+ readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
57
+ }, undefined>;
58
+ setSettings: import("valibot").ObjectSchema<{
59
+ readonly color: import("valibot").OptionalSchema<import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
60
+ readonly displayName: import("valibot").OptionalSchema<import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
61
+ readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
62
+ }, undefined>;
63
+ };
64
+ draft: {
65
+ cancelSend: import("valibot").ObjectSchema<{
66
+ readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
67
+ readonly updatedAt: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
68
+ }, undefined>;
69
+ createAttachment: import("valibot").ObjectSchema<{
70
+ readonly attachment: import("valibot").ObjectSchema<{
71
+ readonly fileName: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
72
+ readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
73
+ readonly mimeType: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
74
+ readonly status: import("valibot").PicklistSchema<readonly ["PENDING", "COMPLETE", "FAILED"], undefined>;
75
+ readonly totalSize: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
76
+ }, undefined>;
77
+ readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
78
+ readonly updatedAt: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
79
+ }, undefined>;
80
+ deleteAttachment: import("valibot").ObjectSchema<{
81
+ readonly attachmentId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
82
+ readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
83
+ readonly updatedAt: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
84
+ }, undefined>;
85
+ deleteDraft: import("valibot").ObjectSchema<{
86
+ readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
87
+ }, undefined>;
88
+ setContent: import("valibot").ObjectSchema<{
89
+ readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
90
+ readonly patch: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
91
+ readonly index: import("valibot").NumberSchema<undefined>;
92
+ readonly type: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"INSERTION", undefined>, import("valibot").LiteralSchema<"DELETION", undefined>], undefined>;
93
+ readonly value: import("valibot").StringSchema<undefined>;
94
+ }, undefined>, undefined>;
95
+ readonly updatedAt: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
96
+ }, undefined>;
97
+ setEnvelope: import("valibot").ObjectSchema<{
98
+ readonly envelope: Omit<import("valibot").ObjectSchema<{
99
+ readonly bcc: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
100
+ readonly cc: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
101
+ readonly content: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MaxLengthAction<string, 384000, undefined>]>;
102
+ readonly subject: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
103
+ readonly to: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
104
+ }, undefined>, "~standard" | "~run" | "~types" | "entries"> & {
105
+ readonly entries: Omit<{
106
+ readonly bcc: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
107
+ readonly cc: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
108
+ readonly content: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MaxLengthAction<string, 384000, undefined>]>;
109
+ readonly subject: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
110
+ readonly to: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
111
+ }, "content">;
112
+ readonly '~standard': import("valibot").StandardProps<{
113
+ bcc: string[];
114
+ cc: string[];
115
+ to: string[];
116
+ subject: string | null;
117
+ }, {
118
+ bcc: string[];
119
+ cc: string[];
120
+ to: string[];
121
+ subject: string | null;
122
+ }>;
123
+ readonly '~run': (dataset: import("valibot").UnknownDataset, config: import("valibot").Config<import("valibot").BaseIssue<unknown>>) => import("valibot").OutputDataset<{
124
+ bcc: string[];
125
+ cc: string[];
126
+ to: string[];
127
+ subject: string | null;
128
+ }, import("valibot").StringIssue | import("valibot").EmailIssue<string> | import("valibot").MaxLengthIssue<string, 255> | import("valibot").NonEmptyIssue<string> | import("valibot").MaxLengthIssue<string, number> | import("valibot").ObjectIssue | import("valibot").ArrayIssue | import("valibot").NonOptionalIssue>;
129
+ readonly '~types'?: {
130
+ readonly input: {
131
+ bcc: string[];
132
+ cc: string[];
133
+ to: string[];
134
+ subject: string | null;
135
+ };
136
+ readonly output: {
137
+ bcc: string[];
138
+ cc: string[];
139
+ to: string[];
140
+ subject: string | null;
141
+ };
142
+ readonly issue: import("valibot").StringIssue | import("valibot").EmailIssue<string> | import("valibot").MaxLengthIssue<string, 255> | import("valibot").NonEmptyIssue<string> | import("valibot").MaxLengthIssue<string, number> | import("valibot").ObjectIssue | import("valibot").ArrayIssue | import("valibot").NonOptionalIssue;
143
+ } | undefined;
144
+ };
145
+ readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
146
+ readonly updatedAt: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
147
+ }, undefined>;
148
+ setFrom: import("valibot").ObjectSchema<{
149
+ readonly accountId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
150
+ readonly aliasId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
151
+ readonly from: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").EmailAction<string, undefined>, import("valibot").MaxLengthAction<string, 255, undefined>]>, undefined>;
152
+ readonly fromName: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
153
+ readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
154
+ readonly updatedAt: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
155
+ }, undefined>;
156
+ };
157
+ thread: {
158
+ addLabel: import("valibot").ObjectSchema<{
159
+ readonly accounts: import("valibot").RecordSchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, import("valibot").ObjectSchema<{
160
+ readonly threadIds: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
161
+ }, undefined>, undefined>;
162
+ readonly labelPath: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
163
+ }, undefined>;
164
+ delete: import("valibot").ObjectSchema<{
165
+ readonly accounts: import("valibot").RecordSchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, import("valibot").ObjectSchema<{
166
+ readonly threadIds: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
167
+ }, undefined>, undefined>;
168
+ }, undefined>;
169
+ removeLabel: import("valibot").ObjectSchema<{
170
+ readonly accounts: import("valibot").RecordSchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, import("valibot").ObjectSchema<{
171
+ readonly threadIds: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
172
+ }, undefined>, undefined>;
173
+ readonly labelPath: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
174
+ }, undefined>;
175
+ setArchive: import("valibot").ObjectSchema<{
176
+ readonly accounts: import("valibot").RecordSchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, import("valibot").ObjectSchema<{
177
+ readonly threadIds: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
178
+ }, undefined>, undefined>;
179
+ }, undefined>;
180
+ setFlagged: import("valibot").ObjectSchema<{
181
+ readonly accounts: import("valibot").RecordSchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, import("valibot").ObjectSchema<{
182
+ readonly threadIds: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
183
+ }, undefined>, undefined>;
184
+ readonly flagged: import("valibot").NonOptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
185
+ }, undefined>;
186
+ setInbox: import("valibot").ObjectSchema<{
187
+ readonly accounts: import("valibot").RecordSchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, import("valibot").ObjectSchema<{
188
+ readonly threadIds: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
189
+ }, undefined>, undefined>;
190
+ }, undefined>;
191
+ setSeen: import("valibot").ObjectSchema<{
192
+ readonly accounts: import("valibot").RecordSchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, import("valibot").ObjectSchema<{
193
+ readonly threadIds: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
194
+ }, undefined>, undefined>;
195
+ readonly seen: import("valibot").BooleanSchema<undefined>;
196
+ }, undefined>;
197
+ setSpam: import("valibot").ObjectSchema<{
198
+ readonly accounts: import("valibot").RecordSchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, import("valibot").ObjectSchema<{
199
+ readonly threadIds: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
200
+ }, undefined>, undefined>;
201
+ }, undefined>;
202
+ setTrash: import("valibot").ObjectSchema<{
203
+ readonly accounts: import("valibot").RecordSchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, import("valibot").ObjectSchema<{
204
+ readonly threadIds: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
205
+ }, undefined>, undefined>;
206
+ }, undefined>;
207
+ };
208
+ user: {
209
+ deleteSettingsPushNotificationToken: import("valibot").ObjectSchema<{
210
+ readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
211
+ readonly token: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
212
+ }, undefined>;
213
+ setSettingsName: import("valibot").ObjectSchema<{
214
+ readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
215
+ readonly name: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
216
+ }, undefined>;
217
+ setSettingsPushNotificationToken: import("valibot").ObjectSchema<{
218
+ readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
219
+ readonly pushNotificationToken: import("valibot").ObjectSchema<{
220
+ readonly createdAt: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
221
+ readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
222
+ readonly token: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
223
+ }, undefined>;
224
+ }, undefined>;
225
+ };
226
+ };
3
227
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/zero/mutators/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/zero/mutators/index.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAK1B,CAAA"}
@@ -1 +1,11 @@
1
+ import { accountMutatorSchemas } from './accountMutators';
2
+ import { draftMutatorSchemas } from './draftMutators';
3
+ import { threadMutatorSchemas } from './threadMutators';
4
+ import { userMutatorSchemas } from './userMutators';
1
5
  export { mutators } from './mutators';
6
+ export const mutatorSchemas = {
7
+ account: accountMutatorSchemas,
8
+ draft: draftMutatorSchemas,
9
+ thread: threadMutatorSchemas,
10
+ user: userMutatorSchemas,
11
+ };
@@ -1,2 +1,2 @@
1
- export * from './threadMutators';
1
+ export { threadMutatorSchemas, threadMutators } from './threadMutators';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/zero/mutators/threadMutators/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/zero/mutators/threadMutators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA"}
@@ -1 +1 @@
1
- export * from './threadMutators';
1
+ export { threadMutatorSchemas, threadMutators } from './threadMutators';
@@ -1,6 +1,58 @@
1
- import { type Transaction } from '@rocicorp/zero';
1
+ import * as v from 'valibot';
2
2
  import type { LabelSpecialUse } from '../../../types';
3
- export declare const setSystemLabel: (tx: Transaction, threadId: string, targetSpecialUse: LabelSpecialUse) => Promise<void>;
3
+ import { type MarcoTransaction } from '../../../zero/mutators/typedMutator';
4
+ export declare const threadMutatorSchemas: {
5
+ addLabel: v.ObjectSchema<{
6
+ readonly accounts: v.RecordSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, v.ObjectSchema<{
7
+ readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
8
+ }, undefined>, undefined>;
9
+ readonly labelPath: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
10
+ }, undefined>;
11
+ delete: v.ObjectSchema<{
12
+ readonly accounts: v.RecordSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, v.ObjectSchema<{
13
+ readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
14
+ }, undefined>, undefined>;
15
+ }, undefined>;
16
+ removeLabel: v.ObjectSchema<{
17
+ readonly accounts: v.RecordSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, v.ObjectSchema<{
18
+ readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
19
+ }, undefined>, undefined>;
20
+ readonly labelPath: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
21
+ }, undefined>;
22
+ setArchive: v.ObjectSchema<{
23
+ readonly accounts: v.RecordSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, v.ObjectSchema<{
24
+ readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
25
+ }, undefined>, undefined>;
26
+ }, undefined>;
27
+ setFlagged: v.ObjectSchema<{
28
+ readonly accounts: v.RecordSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, v.ObjectSchema<{
29
+ readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
30
+ }, undefined>, undefined>;
31
+ readonly flagged: v.NonOptionalSchema<v.BooleanSchema<undefined>, undefined>;
32
+ }, undefined>;
33
+ setInbox: v.ObjectSchema<{
34
+ readonly accounts: v.RecordSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, v.ObjectSchema<{
35
+ readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
36
+ }, undefined>, undefined>;
37
+ }, undefined>;
38
+ setSeen: v.ObjectSchema<{
39
+ readonly accounts: v.RecordSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, v.ObjectSchema<{
40
+ readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
41
+ }, undefined>, undefined>;
42
+ readonly seen: v.BooleanSchema<undefined>;
43
+ }, undefined>;
44
+ setSpam: v.ObjectSchema<{
45
+ readonly accounts: v.RecordSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, v.ObjectSchema<{
46
+ readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
47
+ }, undefined>, undefined>;
48
+ }, undefined>;
49
+ setTrash: v.ObjectSchema<{
50
+ readonly accounts: v.RecordSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, v.ObjectSchema<{
51
+ readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
52
+ }, undefined>, undefined>;
53
+ }, undefined>;
54
+ };
55
+ export declare const setSystemLabel: (tx: MarcoTransaction, threadId: string, targetSpecialUse: LabelSpecialUse) => Promise<void>;
4
56
  export declare const threadMutators: {
5
57
  addLabel: import("@rocicorp/zero").MutatorDefinition<{
6
58
  accounts: {
@@ -1 +1 @@
1
- {"version":3,"file":"threadMutators.d.ts","sourceRoot":"","sources":["../../../../src/zero/mutators/threadMutators/threadMutators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAIhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAuB1D,eAAO,MAAM,cAAc,OACrB,WAAW,YACL,MAAM,oBACE,eAAe,KAChC,OAAO,CAAC,IAAI,CAqGd,CAAA;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgR1B,CAAA"}
1
+ {"version":3,"file":"threadMutators.d.ts","sourceRoot":"","sources":["../../../../src/zero/mutators/threadMutators/threadMutators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAG5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAI1D,OAAO,EAAiB,KAAK,gBAAgB,EAAE,MAAM,0CAA0C,CAAA;AAoB/F,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBhC,CAAA;AAED,eAAO,MAAM,cAAc,OACrB,gBAAgB,YACV,MAAM,oBACE,eAAe,KAChC,OAAO,CAAC,IAAI,CAqGd,CAAA;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoQ1B,CAAA"}
@@ -1,9 +1,9 @@
1
- import { defineMutator } from '@rocicorp/zero';
2
1
  import * as v from 'valibot';
3
2
  import { marcoSchemas } from '../../../schemas';
4
3
  import { MutationError } from '../../../types';
5
4
  import { threadsUtils } from '../../../utils/threads';
6
5
  import { zeroCRUD } from '../../../zero/crud';
6
+ import { defineMutator } from '../../../zero/mutators/typedMutator';
7
7
  const buildLabelIdList = (x) => (x.length === 0 ? '' : ` ${[...new Set(x)].join(' ')} `);
8
8
  const accountsSchema = v.record(marcoSchemas.string.required(), v.object({
9
9
  threadIds: v.array(marcoSchemas.string.required()),
@@ -15,6 +15,23 @@ const threadChangeLabelSchema = v.object({
15
15
  accounts: accountsSchema,
16
16
  labelPath: marcoSchemas.string.required(),
17
17
  });
18
+ export const threadMutatorSchemas = {
19
+ addLabel: threadChangeLabelSchema,
20
+ delete: baseThreadSchema,
21
+ removeLabel: threadChangeLabelSchema,
22
+ setArchive: baseThreadSchema,
23
+ setFlagged: v.object({
24
+ accounts: accountsSchema,
25
+ flagged: v.nonOptional(v.boolean()),
26
+ }),
27
+ setInbox: baseThreadSchema,
28
+ setSeen: v.object({
29
+ accounts: accountsSchema,
30
+ seen: v.boolean(),
31
+ }),
32
+ setSpam: baseThreadSchema,
33
+ setTrash: baseThreadSchema,
34
+ };
18
35
  export const setSystemLabel = async (tx, threadId, targetSpecialUse) => {
19
36
  const thread = await tx.query.thread.where('id', threadId).one().run();
20
37
  if (!thread) {
@@ -85,9 +102,9 @@ export const setSystemLabel = async (tx, threadId, targetSpecialUse) => {
85
102
  }));
86
103
  };
87
104
  export const threadMutators = {
88
- addLabel: defineMutator(threadChangeLabelSchema, async ({ tx, args }) => {
89
- for (const [accountId, { threadIds }] of Object.entries(args.accounts)) {
90
- const label = await tx.query.accountLabel.where('accountId', accountId).where('path', args.labelPath).one().run();
105
+ addLabel: defineMutator(threadMutatorSchemas.addLabel, async ({ tx, args: { accounts, labelPath } }) => {
106
+ for (const [accountId, { threadIds }] of Object.entries(accounts)) {
107
+ const label = await tx.query.accountLabel.where('accountId', accountId).where('path', labelPath).one().run();
91
108
  if (!label) {
92
109
  throw new Error(MutationError.ENTITY_NOT_FOUND);
93
110
  }
@@ -139,8 +156,8 @@ export const threadMutators = {
139
156
  }
140
157
  }
141
158
  }),
142
- delete: defineMutator(baseThreadSchema, async ({ tx, args }) => {
143
- for (const [, { threadIds }] of Object.entries(args.accounts)) {
159
+ delete: defineMutator(threadMutatorSchemas.delete, async ({ tx, args: { accounts } }) => {
160
+ for (const [, { threadIds }] of Object.entries(accounts)) {
144
161
  for (const threadId of threadIds) {
145
162
  const thread = await tx.query.thread.where('id', threadId).one().run();
146
163
  if (thread) {
@@ -161,9 +178,9 @@ export const threadMutators = {
161
178
  }
162
179
  }
163
180
  }),
164
- removeLabel: defineMutator(threadChangeLabelSchema, async ({ tx, args }) => {
165
- for (const [accountId, { threadIds }] of Object.entries(args.accounts)) {
166
- const label = await tx.query.accountLabel.where('accountId', accountId).where('path', args.labelPath).one().run();
181
+ removeLabel: defineMutator(threadMutatorSchemas.removeLabel, async ({ tx, args: { accounts, labelPath } }) => {
182
+ for (const [accountId, { threadIds }] of Object.entries(accounts)) {
183
+ const label = await tx.query.accountLabel.where('accountId', accountId).where('path', labelPath).one().run();
167
184
  if (!label) {
168
185
  throw new Error(MutationError.ENTITY_NOT_FOUND);
169
186
  }
@@ -206,40 +223,34 @@ export const threadMutators = {
206
223
  }
207
224
  }
208
225
  }),
209
- setArchive: defineMutator(baseThreadSchema, async ({ tx, args }) => {
210
- for (const [, { threadIds }] of Object.entries(args.accounts)) {
226
+ setArchive: defineMutator(threadMutatorSchemas.setArchive, async ({ tx, args: { accounts } }) => {
227
+ for (const [, { threadIds }] of Object.entries(accounts)) {
211
228
  for (const threadId of threadIds) {
212
229
  await setSystemLabel(tx, threadId, 'ARCHIVE');
213
230
  }
214
231
  }
215
232
  }),
216
- setFlagged: defineMutator(v.object({
217
- accounts: accountsSchema,
218
- flagged: v.nonOptional(v.boolean()),
219
- }), async ({ tx, args }) => {
220
- for (const [, { threadIds }] of Object.entries(args.accounts)) {
233
+ setFlagged: defineMutator(threadMutatorSchemas.setFlagged, async ({ tx, args: { accounts, flagged } }) => {
234
+ for (const [, { threadIds }] of Object.entries(accounts)) {
221
235
  await Promise.all(threadIds.map(threadId => tx.mutate(zeroCRUD.thread.update({
222
- flagged: args.flagged,
236
+ flagged,
223
237
  id: threadId,
224
238
  }))));
225
239
  }
226
240
  }),
227
- setInbox: defineMutator(baseThreadSchema, async ({ tx, args }) => {
228
- for (const [, { threadIds }] of Object.entries(args.accounts)) {
241
+ setInbox: defineMutator(threadMutatorSchemas.setInbox, async ({ tx, args: { accounts } }) => {
242
+ for (const [, { threadIds }] of Object.entries(accounts)) {
229
243
  for (const threadId of threadIds) {
230
244
  await setSystemLabel(tx, threadId, 'INBOX');
231
245
  }
232
246
  }
233
247
  }),
234
- setSeen: defineMutator(v.object({
235
- accounts: accountsSchema,
236
- seen: v.boolean(),
237
- }), async ({ tx, args }) => {
238
- const allThreadIds = Object.values(args.accounts).flatMap(x => x.threadIds);
248
+ setSeen: defineMutator(threadMutatorSchemas.setSeen, async ({ tx, args: { accounts, seen } }) => {
249
+ const allThreadIds = Object.values(accounts).flatMap(x => x.threadIds);
239
250
  const threads = await tx.query.thread.where('id', 'IN', allThreadIds).run();
240
251
  const labelCounts = new Map();
241
252
  for (const thread of threads) {
242
- if (thread.seen !== args.seen) {
253
+ if (thread.seen !== seen) {
243
254
  for (const labelId of threadsUtils.parseLabelIdList(thread.labelIdList)) {
244
255
  labelCounts.set(labelId, (labelCounts.get(labelId) ?? 0) + 1);
245
256
  }
@@ -247,7 +258,7 @@ export const threadMutators = {
247
258
  }
248
259
  if (labelCounts.size > 0) {
249
260
  const labels = await tx.query.accountLabel.where('id', 'IN', [...labelCounts.keys()]).run();
250
- const delta = args.seen ? -1 : 1;
261
+ const delta = seen ? -1 : 1;
251
262
  await Promise.all(labels
252
263
  .filter(x => labelCounts.has(x.id))
253
264
  .map(x => tx.mutate(zeroCRUD.accountLabel.update({
@@ -257,18 +268,18 @@ export const threadMutators = {
257
268
  }
258
269
  await Promise.all(allThreadIds.map(threadId => tx.mutate(zeroCRUD.thread.update({
259
270
  id: threadId,
260
- seen: args.seen,
271
+ seen,
261
272
  }))));
262
273
  }),
263
- setSpam: defineMutator(baseThreadSchema, async ({ tx, args }) => {
264
- for (const [, { threadIds }] of Object.entries(args.accounts)) {
274
+ setSpam: defineMutator(threadMutatorSchemas.setSpam, async ({ tx, args: { accounts } }) => {
275
+ for (const [, { threadIds }] of Object.entries(accounts)) {
265
276
  for (const threadId of threadIds) {
266
277
  await setSystemLabel(tx, threadId, 'SPAM');
267
278
  }
268
279
  }
269
280
  }),
270
- setTrash: defineMutator(baseThreadSchema, async ({ tx, args }) => {
271
- for (const [, { threadIds }] of Object.entries(args.accounts)) {
281
+ setTrash: defineMutator(threadMutatorSchemas.setTrash, async ({ tx, args: { accounts } }) => {
282
+ for (const [, { threadIds }] of Object.entries(accounts)) {
272
283
  for (const threadId of threadIds) {
273
284
  await setSystemLabel(tx, threadId, 'TRASH');
274
285
  }