@marcoappio/marco-config 2.0.491 → 2.0.493

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 (70) hide show
  1. package/dist/types/Zero.d.ts +0 -14
  2. package/dist/types/Zero.d.ts.map +1 -1
  3. package/dist/types/index.d.ts +0 -1
  4. package/dist/types/index.d.ts.map +1 -1
  5. package/dist/types/index.js +0 -1
  6. package/dist/zero/index.d.ts +1553 -1439
  7. package/dist/zero/index.d.ts.map +1 -1
  8. package/dist/zero/index.js +2 -4
  9. package/dist/zero/mutators/accountMutators/accountMutators.d.ts +108 -6
  10. package/dist/zero/mutators/accountMutators/accountMutators.d.ts.map +1 -1
  11. package/dist/zero/mutators/accountMutators/accountMutators.js +59 -34
  12. package/dist/zero/mutators/defineMutator.d.ts +16 -0
  13. package/dist/zero/mutators/defineMutator.d.ts.map +1 -0
  14. package/dist/zero/mutators/defineMutator.js +7 -0
  15. package/dist/zero/mutators/draftMutators/draftMutators.d.ts +166 -6
  16. package/dist/zero/mutators/draftMutators/draftMutators.d.ts.map +1 -1
  17. package/dist/zero/mutators/draftMutators/draftMutators.js +101 -40
  18. package/dist/zero/mutators/index.d.ts +2 -1
  19. package/dist/zero/mutators/index.d.ts.map +1 -1
  20. package/dist/zero/mutators/index.js +2 -1
  21. package/dist/zero/mutators/mutators.d.ts +438 -28
  22. package/dist/zero/mutators/mutators.d.ts.map +1 -1
  23. package/dist/zero/mutators/mutators.js +11 -38
  24. package/dist/zero/mutators/threadMutators/threadMutators.d.ts +127 -7
  25. package/dist/zero/mutators/threadMutators/threadMutators.d.ts.map +1 -1
  26. package/dist/zero/mutators/threadMutators/threadMutators.js +40 -30
  27. package/dist/zero/mutators/userMutators/userMutators.d.ts +30 -6
  28. package/dist/zero/mutators/userMutators/userMutators.d.ts.map +1 -1
  29. package/dist/zero/mutators/userMutators/userMutators.js +25 -11
  30. package/dist/zero/queries/getAccounts.d.ts +134 -134
  31. package/dist/zero/queries/getContacts.d.ts +134 -134
  32. package/dist/zero/queries/getDrafts.d.ts +134 -134
  33. package/dist/zero/queries/getThread.d.ts +134 -134
  34. package/dist/zero/queries/getThreadList.d.ts +134 -134
  35. package/dist/zero/queries/getThreads.d.ts +134 -134
  36. package/dist/zero/queries/getUser.d.ts +134 -134
  37. package/dist/zero/queries/index.d.ts +132 -132
  38. package/dist/zero/schema.d.ts +132 -132
  39. package/dist/zero/schema.d.ts.map +1 -1
  40. package/package.json +2 -2
  41. package/dist/types/AuthData.d.ts +0 -4
  42. package/dist/types/AuthData.d.ts.map +0 -1
  43. package/dist/types/AuthData.js +0 -1
  44. package/dist/zero/mutatorSchemas/account.d.ts +0 -80
  45. package/dist/zero/mutatorSchemas/account.d.ts.map +0 -1
  46. package/dist/zero/mutatorSchemas/account.js +0 -66
  47. package/dist/zero/mutatorSchemas/draft.d.ts +0 -150
  48. package/dist/zero/mutatorSchemas/draft.d.ts.map +0 -1
  49. package/dist/zero/mutatorSchemas/draft.js +0 -104
  50. package/dist/zero/mutatorSchemas/index.d.ts +0 -323
  51. package/dist/zero/mutatorSchemas/index.d.ts.map +0 -1
  52. package/dist/zero/mutatorSchemas/index.js +0 -10
  53. package/dist/zero/mutatorSchemas/thread.d.ts +0 -71
  54. package/dist/zero/mutatorSchemas/thread.d.ts.map +0 -1
  55. package/dist/zero/mutatorSchemas/thread.js +0 -47
  56. package/dist/zero/mutatorSchemas/user.d.ts +0 -26
  57. package/dist/zero/mutatorSchemas/user.d.ts.map +0 -1
  58. package/dist/zero/mutatorSchemas/user.js +0 -27
  59. package/dist/zero/mutators/accountMutators/accountMutators.test.d.ts +0 -2
  60. package/dist/zero/mutators/accountMutators/accountMutators.test.d.ts.map +0 -1
  61. package/dist/zero/mutators/accountMutators/accountMutators.test.js +0 -390
  62. package/dist/zero/mutators/draftMutators/draftMutators.test.d.ts +0 -2
  63. package/dist/zero/mutators/draftMutators/draftMutators.test.d.ts.map +0 -1
  64. package/dist/zero/mutators/draftMutators/draftMutators.test.js +0 -416
  65. package/dist/zero/mutators/threadMutators/threadMutators.test.d.ts +0 -2
  66. package/dist/zero/mutators/threadMutators/threadMutators.test.d.ts.map +0 -1
  67. package/dist/zero/mutators/threadMutators/threadMutators.test.js +0 -755
  68. package/dist/zero/mutators/userMutators/userMutators.test.d.ts +0 -2
  69. package/dist/zero/mutators/userMutators/userMutators.test.d.ts.map +0 -1
  70. package/dist/zero/mutators/userMutators/userMutators.test.js +0 -84
@@ -1,7 +1,57 @@
1
- import { MutationError } from '../../../types';
1
+ import * as v from 'valibot';
2
+ import { marcoSchemas } from '../../../schemas';
3
+ import { DRAFT_ATTACHMENT_UPLOAD_STATUSES, DRAFT_STATUSES, DRAFT_TYPES, MutationError } from '../../../types';
2
4
  import { stringPatch } from '../../../utils';
3
- export const createDraftMutators = (authData, callbacks) => ({
4
- cancelSend: async (tx, args) => {
5
+ import { defineMutator } from '../../../zero/mutators/defineMutator';
6
+ const draftStatusSchema = v.picklist(DRAFT_STATUSES);
7
+ const draftTypeSchema = v.picklist(DRAFT_TYPES);
8
+ const draftBodySchema = v.object({
9
+ bcc: v.array(marcoSchemas.string.email()),
10
+ cc: v.array(marcoSchemas.string.email()),
11
+ content: v.pipe(v.string(), v.maxLength(384000)),
12
+ subject: marcoSchemas.string.nullable(),
13
+ to: v.array(marcoSchemas.string.email()),
14
+ });
15
+ const draftAttachmentSchema = v.object({
16
+ fileName: marcoSchemas.string.required(),
17
+ id: marcoSchemas.string.required(),
18
+ mimeType: marcoSchemas.string.required(),
19
+ status: v.picklist(DRAFT_ATTACHMENT_UPLOAD_STATUSES),
20
+ totalSize: marcoSchemas.number.positiveInteger(),
21
+ });
22
+ const draftScheduleSchema = v.union([
23
+ v.object({
24
+ id: marcoSchemas.string.required(),
25
+ kind: v.literal('IMMEDIATE'),
26
+ undoMs: marcoSchemas.number.positiveInteger(),
27
+ updatedAt: marcoSchemas.number.positiveInteger(),
28
+ }),
29
+ v.object({
30
+ id: marcoSchemas.string.required(),
31
+ kind: v.literal('SCHEDULED'),
32
+ scheduledFor: marcoSchemas.number.positiveInteger(),
33
+ updatedAt: marcoSchemas.number.positiveInteger(),
34
+ }),
35
+ ]);
36
+ const draftModelSchema = v.object({
37
+ accountId: marcoSchemas.string.required(),
38
+ attachments: v.array(draftAttachmentSchema),
39
+ body: draftBodySchema,
40
+ error: marcoSchemas.string.nullable(),
41
+ from: marcoSchemas.string.email(),
42
+ fromName: marcoSchemas.string.nullable(),
43
+ id: marcoSchemas.string.required(),
44
+ referencedMessageId: marcoSchemas.string.nullable(),
45
+ scheduledFor: v.nullable(marcoSchemas.number.positiveInteger()),
46
+ status: draftStatusSchema,
47
+ type: draftTypeSchema,
48
+ updatedAt: marcoSchemas.number.positiveInteger(),
49
+ });
50
+ export const draftMutators = {
51
+ cancelSend: defineMutator(v.object({
52
+ id: marcoSchemas.string.required(),
53
+ updatedAt: marcoSchemas.number.positiveInteger(),
54
+ }), async ({ tx, args }) => {
5
55
  const draft = await tx.query.draft.where('id', args.id).one().run();
6
56
  if (!draft) {
7
57
  throw new Error(MutationError.ENTITY_NOT_FOUND);
@@ -15,9 +65,12 @@ export const createDraftMutators = (authData, callbacks) => ({
15
65
  status: 'DRAFT',
16
66
  updatedAt: args.updatedAt,
17
67
  });
18
- callbacks?.cancelSend?.(args);
19
- },
20
- createAttachment: async (tx, args) => {
68
+ }),
69
+ createAttachment: defineMutator(v.object({
70
+ attachment: draftAttachmentSchema,
71
+ id: marcoSchemas.string.required(),
72
+ updatedAt: marcoSchemas.number.positiveInteger(),
73
+ }), async ({ tx, args }) => {
21
74
  await tx.mutate.draftAttachment.insert({
22
75
  draftId: args.id,
23
76
  fileName: args.attachment.fileName,
@@ -30,12 +83,8 @@ export const createDraftMutators = (authData, callbacks) => ({
30
83
  id: args.id,
31
84
  updatedAt: args.updatedAt,
32
85
  });
33
- callbacks?.createAttachment?.(args);
34
- },
35
- createDraft: async (tx, args) => {
36
- if (!authData) {
37
- throw new Error(MutationError.AUTHENTICATION_REQUIRED);
38
- }
86
+ }),
87
+ createDraft: defineMutator(draftModelSchema, async ({ tx, ctx: { userId }, args }) => {
39
88
  await tx.mutate.draft.insert({
40
89
  accountId: args.accountId,
41
90
  body: {
@@ -55,7 +104,7 @@ export const createDraftMutators = (authData, callbacks) => ({
55
104
  subject: args.body.subject,
56
105
  type: args.type,
57
106
  updatedAt: args.updatedAt,
58
- userId: authData.sub,
107
+ userId,
59
108
  });
60
109
  for (const attachment of args.attachments) {
61
110
  await tx.mutate.draftAttachment.insert({
@@ -67,9 +116,12 @@ export const createDraftMutators = (authData, callbacks) => ({
67
116
  totalSize: attachment.totalSize,
68
117
  });
69
118
  }
70
- callbacks?.createDraft?.(args);
71
- },
72
- deleteAttachment: async (tx, args) => {
119
+ }),
120
+ deleteAttachment: defineMutator(v.object({
121
+ attachmentId: marcoSchemas.string.required(),
122
+ id: marcoSchemas.string.required(),
123
+ updatedAt: marcoSchemas.number.positiveInteger(),
124
+ }), async ({ tx, args }) => {
73
125
  await tx.mutate.draftAttachment.delete({
74
126
  id: args.attachmentId,
75
127
  });
@@ -77,15 +129,15 @@ export const createDraftMutators = (authData, callbacks) => ({
77
129
  id: args.id,
78
130
  updatedAt: args.updatedAt,
79
131
  });
80
- callbacks?.deleteAttachment?.(args);
81
- },
82
- deleteDraft: async (tx, args) => {
132
+ }),
133
+ deleteDraft: defineMutator(v.object({
134
+ id: marcoSchemas.string.required(),
135
+ }), async ({ tx, args }) => {
83
136
  await tx.mutate.draft.delete({
84
137
  id: args.id,
85
138
  });
86
- callbacks?.deleteDraft?.(args);
87
- },
88
- scheduleSend: async (tx, args) => {
139
+ }),
140
+ scheduleSend: defineMutator(draftScheduleSchema, async ({ tx, args }) => {
89
141
  if (args.kind === 'IMMEDIATE') {
90
142
  await tx.mutate.draft.update({
91
143
  id: args.id,
@@ -102,26 +154,30 @@ export const createDraftMutators = (authData, callbacks) => ({
102
154
  updatedAt: args.updatedAt,
103
155
  });
104
156
  }
105
- callbacks?.scheduleSend?.(args);
106
- },
107
- setContent: async (tx, args) => {
157
+ }),
158
+ setContent: defineMutator(v.object({
159
+ id: marcoSchemas.string.required(),
160
+ patch: marcoSchemas.drafts.contentPatch.patch(),
161
+ updatedAt: marcoSchemas.number.positiveInteger(),
162
+ }), async ({ tx, args }) => {
108
163
  const draft = await tx.query.draft.where('id', args.id).one().run();
109
164
  if (!draft) {
110
165
  throw new Error(MutationError.ENTITY_NOT_FOUND);
111
166
  }
112
- const currentContent = typeof draft.body?.content === 'string' ? draft.body.content : '';
113
- const updatedBody = {
114
- ...draft.body,
115
- content: stringPatch.apply(currentContent, args.patch),
116
- };
117
167
  await tx.mutate.draft.update({
118
- body: updatedBody,
168
+ body: {
169
+ ...draft.body,
170
+ content: stringPatch.apply(typeof draft.body?.content === 'string' ? draft.body.content : '', args.patch),
171
+ },
119
172
  id: args.id,
120
173
  updatedAt: args.updatedAt,
121
174
  });
122
- callbacks?.setContent?.(args);
123
- },
124
- setEnvelope: async (tx, args) => {
175
+ }),
176
+ setEnvelope: defineMutator(v.object({
177
+ envelope: v.omit(draftBodySchema, ['content']),
178
+ id: marcoSchemas.string.required(),
179
+ updatedAt: marcoSchemas.number.positiveInteger(),
180
+ }), async ({ tx, args }) => {
125
181
  const draft = await tx.query.draft.where('id', args.id).one().run();
126
182
  if (!draft) {
127
183
  throw new Error(MutationError.ENTITY_NOT_FOUND);
@@ -137,9 +193,15 @@ export const createDraftMutators = (authData, callbacks) => ({
137
193
  subject: args.envelope.subject,
138
194
  updatedAt: args.updatedAt,
139
195
  });
140
- callbacks?.setEnvelope?.(args);
141
- },
142
- setFrom: async (tx, args) => {
196
+ }),
197
+ setFrom: defineMutator(v.object({
198
+ accountId: marcoSchemas.string.required(),
199
+ aliasId: marcoSchemas.string.required(),
200
+ from: marcoSchemas.string.email(),
201
+ fromName: marcoSchemas.string.nullable(),
202
+ id: marcoSchemas.string.required(),
203
+ updatedAt: marcoSchemas.number.positiveInteger(),
204
+ }), async ({ tx, args }) => {
143
205
  await tx.mutate.draft.update({
144
206
  accountId: args.accountId,
145
207
  fromAliasId: args.aliasId,
@@ -148,6 +210,5 @@ export const createDraftMutators = (authData, callbacks) => ({
148
210
  id: args.id,
149
211
  updatedAt: args.updatedAt,
150
212
  });
151
- callbacks?.setFrom?.(args);
152
- },
153
- });
213
+ }),
214
+ };
@@ -1,3 +1,4 @@
1
+ export { defineMutator, type MarcoZeroContext } from './defineMutator';
1
2
  export type { MarcoZeroMutators } from './mutators';
2
- export { createMutators, ZeroMutatorValidationError } from './mutators';
3
+ export { mutators } from './mutators';
3
4
  //# 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,cAAc,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/zero/mutators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACtE,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA"}
@@ -1 +1,2 @@
1
- export { createMutators, ZeroMutatorValidationError } from './mutators';
1
+ export { defineMutator } from './defineMutator';
2
+ export { mutators } from './mutators';
@@ -1,29 +1,439 @@
1
- import * as v from 'valibot';
2
- import type { MutatorMap } from '../../types';
3
- import { type ZeroMutatorSchemas } from '../../zero/mutatorSchemas';
4
- import { type AccountMutatorCallbacks } from './accountMutators';
5
- import { type DraftMutatorCallbacks } from './draftMutators';
6
- import { type ThreadMutatorCallbacks } from './threadMutators';
7
- import { type UserMutatorCallbacks } from './userMutators';
8
- export type MutatorCallbacks = {
9
- account?: AccountMutatorCallbacks;
10
- draft?: DraftMutatorCallbacks;
11
- thread?: ThreadMutatorCallbacks;
12
- user?: UserMutatorCallbacks;
13
- };
14
- export declare class ZeroMutatorValidationError extends Error {
15
- readonly issues: ReturnType<typeof v.flatten>;
16
- constructor(issues: ReturnType<typeof v.flatten>);
17
- }
18
- export type MarcoZeroMutators = {
19
- account: MutatorMap<ZeroMutatorSchemas['account']>;
20
- draft: MutatorMap<ZeroMutatorSchemas['draft']>;
21
- thread: MutatorMap<ZeroMutatorSchemas['thread']>;
22
- user: MutatorMap<ZeroMutatorSchemas['user']>;
23
- };
24
- export declare const createMutators: (authData?: AuthData, callbacks?: MutatorCallbacks) => MarcoZeroMutators;
25
- export type { AccountMutatorCallbacks, DraftMutatorCallbacks, ThreadMutatorCallbacks, UserMutatorCallbacks };
26
- export type AuthData = {
27
- sub: string;
28
- };
1
+ export { defineMutator, type MarcoZeroContext } from './defineMutator';
2
+ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
3
+ readonly account: {
4
+ createAccount: import("@rocicorp/zero").MutatorDefinition<{
5
+ aliasId: string;
6
+ color: string;
7
+ emailAddress: string;
8
+ id: string;
9
+ }, {
10
+ aliasId: string;
11
+ color: string;
12
+ emailAddress: string;
13
+ id: string;
14
+ }, import("./defineMutator").MarcoZeroContext>;
15
+ createAlias: import("@rocicorp/zero").MutatorDefinition<{
16
+ accountId: string;
17
+ alias: {
18
+ emailAddress: string;
19
+ id: string;
20
+ name: string | null;
21
+ };
22
+ }, {
23
+ accountId: string;
24
+ alias: {
25
+ emailAddress: string;
26
+ id: string;
27
+ name: string | null;
28
+ };
29
+ }, import("./defineMutator").MarcoZeroContext>;
30
+ deleteAccount: import("@rocicorp/zero").MutatorDefinition<{
31
+ id: string;
32
+ }, {
33
+ id: string;
34
+ }, import("./defineMutator").MarcoZeroContext>;
35
+ deleteAlias: import("@rocicorp/zero").MutatorDefinition<{
36
+ accountId: string;
37
+ aliasId: string;
38
+ }, {
39
+ accountId: string;
40
+ aliasId: string;
41
+ }, import("./defineMutator").MarcoZeroContext>;
42
+ setAliasName: import("@rocicorp/zero").MutatorDefinition<{
43
+ accountId: string;
44
+ aliasId: string;
45
+ displayName: string | null;
46
+ }, {
47
+ accountId: string;
48
+ aliasId: string;
49
+ displayName: string | null;
50
+ }, import("./defineMutator").MarcoZeroContext>;
51
+ setAliasPrimary: import("@rocicorp/zero").MutatorDefinition<{
52
+ accountId: string;
53
+ aliasId: string;
54
+ }, {
55
+ accountId: string;
56
+ aliasId: string;
57
+ }, import("./defineMutator").MarcoZeroContext>;
58
+ setConnectionConfigImapRaw: import("@rocicorp/zero").MutatorDefinition<{
59
+ connectionConfig: {
60
+ imapHost: string;
61
+ imapPassword: string;
62
+ imapPort: number;
63
+ imapSocketType: "STARTTLS" | "SSL";
64
+ imapUser: string;
65
+ smtpHost: string;
66
+ smtpPassword: string;
67
+ smtpPort: number;
68
+ smtpSocketType: "STARTTLS" | "SSL";
69
+ smtpUser: string;
70
+ };
71
+ id: string;
72
+ }, {
73
+ connectionConfig: {
74
+ imapHost: string;
75
+ imapPassword: string;
76
+ imapPort: number;
77
+ imapSocketType: "STARTTLS" | "SSL";
78
+ imapUser: string;
79
+ smtpHost: string;
80
+ smtpPassword: string;
81
+ smtpPort: number;
82
+ smtpSocketType: "STARTTLS" | "SSL";
83
+ smtpUser: string;
84
+ };
85
+ id: string;
86
+ }, import("./defineMutator").MarcoZeroContext>;
87
+ setConnectionConfigOauth: import("@rocicorp/zero").MutatorDefinition<{
88
+ connectionConfig: {
89
+ code: string;
90
+ provider: "GOOGLE" | "OUTLOOK";
91
+ user: string;
92
+ };
93
+ id: string;
94
+ }, {
95
+ connectionConfig: {
96
+ code: string;
97
+ provider: "GOOGLE" | "OUTLOOK";
98
+ user: string;
99
+ };
100
+ id: string;
101
+ }, import("./defineMutator").MarcoZeroContext>;
102
+ setSettings: import("@rocicorp/zero").MutatorDefinition<{
103
+ color?: string | null | undefined;
104
+ displayName?: string | null | undefined;
105
+ id: string;
106
+ }, {
107
+ color?: string | null | undefined;
108
+ displayName?: string | null | undefined;
109
+ id: string;
110
+ }, import("./defineMutator").MarcoZeroContext>;
111
+ };
112
+ readonly draft: {
113
+ cancelSend: import("@rocicorp/zero").MutatorDefinition<{
114
+ id: string;
115
+ updatedAt: number;
116
+ }, {
117
+ id: string;
118
+ updatedAt: number;
119
+ }, import("./defineMutator").MarcoZeroContext>;
120
+ createAttachment: import("@rocicorp/zero").MutatorDefinition<{
121
+ attachment: {
122
+ fileName: string;
123
+ id: string;
124
+ mimeType: string;
125
+ status: "PENDING" | "COMPLETE" | "FAILED";
126
+ totalSize: number;
127
+ };
128
+ id: string;
129
+ updatedAt: number;
130
+ }, {
131
+ attachment: {
132
+ fileName: string;
133
+ id: string;
134
+ mimeType: string;
135
+ status: "PENDING" | "COMPLETE" | "FAILED";
136
+ totalSize: number;
137
+ };
138
+ id: string;
139
+ updatedAt: number;
140
+ }, import("./defineMutator").MarcoZeroContext>;
141
+ createDraft: import("@rocicorp/zero").MutatorDefinition<{
142
+ accountId: string;
143
+ attachments: {
144
+ fileName: string;
145
+ id: string;
146
+ mimeType: string;
147
+ status: "PENDING" | "COMPLETE" | "FAILED";
148
+ totalSize: number;
149
+ }[];
150
+ body: {
151
+ bcc: string[];
152
+ cc: string[];
153
+ content: string;
154
+ subject: string | null;
155
+ to: string[];
156
+ };
157
+ error: string | null;
158
+ from: string;
159
+ fromName: string | null;
160
+ id: string;
161
+ referencedMessageId: string | null;
162
+ scheduledFor: number | null;
163
+ status: "DRAFT" | "SEND_REQUESTED" | "SEND_CONFIRMED" | "SEND_FAILED";
164
+ type: "NEW" | "REPLY" | "FORWARD";
165
+ updatedAt: number;
166
+ }, {
167
+ accountId: string;
168
+ attachments: {
169
+ fileName: string;
170
+ id: string;
171
+ mimeType: string;
172
+ status: "PENDING" | "COMPLETE" | "FAILED";
173
+ totalSize: number;
174
+ }[];
175
+ body: {
176
+ bcc: string[];
177
+ cc: string[];
178
+ content: string;
179
+ subject: string | null;
180
+ to: string[];
181
+ };
182
+ error: string | null;
183
+ from: string;
184
+ fromName: string | null;
185
+ id: string;
186
+ referencedMessageId: string | null;
187
+ scheduledFor: number | null;
188
+ status: "DRAFT" | "SEND_REQUESTED" | "SEND_CONFIRMED" | "SEND_FAILED";
189
+ type: "NEW" | "REPLY" | "FORWARD";
190
+ updatedAt: number;
191
+ }, import("./defineMutator").MarcoZeroContext>;
192
+ deleteAttachment: import("@rocicorp/zero").MutatorDefinition<{
193
+ attachmentId: string;
194
+ id: string;
195
+ updatedAt: number;
196
+ }, {
197
+ attachmentId: string;
198
+ id: string;
199
+ updatedAt: number;
200
+ }, import("./defineMutator").MarcoZeroContext>;
201
+ deleteDraft: import("@rocicorp/zero").MutatorDefinition<{
202
+ id: string;
203
+ }, {
204
+ id: string;
205
+ }, import("./defineMutator").MarcoZeroContext>;
206
+ scheduleSend: import("@rocicorp/zero").MutatorDefinition<{
207
+ id: string;
208
+ kind: "IMMEDIATE";
209
+ undoMs: number;
210
+ updatedAt: number;
211
+ } | {
212
+ id: string;
213
+ kind: "SCHEDULED";
214
+ scheduledFor: number;
215
+ updatedAt: number;
216
+ }, {
217
+ id: string;
218
+ kind: "IMMEDIATE";
219
+ undoMs: number;
220
+ updatedAt: number;
221
+ } | {
222
+ id: string;
223
+ kind: "SCHEDULED";
224
+ scheduledFor: number;
225
+ updatedAt: number;
226
+ }, import("./defineMutator").MarcoZeroContext>;
227
+ setContent: import("@rocicorp/zero").MutatorDefinition<{
228
+ id: string;
229
+ patch: {
230
+ index: number;
231
+ type: "INSERTION" | "DELETION";
232
+ value: string;
233
+ }[];
234
+ updatedAt: number;
235
+ }, {
236
+ id: string;
237
+ patch: {
238
+ index: number;
239
+ type: "INSERTION" | "DELETION";
240
+ value: string;
241
+ }[];
242
+ updatedAt: number;
243
+ }, import("./defineMutator").MarcoZeroContext>;
244
+ setEnvelope: import("@rocicorp/zero").MutatorDefinition<{
245
+ envelope: {
246
+ bcc: string[];
247
+ cc: string[];
248
+ to: string[];
249
+ subject: string | null;
250
+ };
251
+ id: string;
252
+ updatedAt: number;
253
+ }, {
254
+ envelope: {
255
+ bcc: string[];
256
+ cc: string[];
257
+ to: string[];
258
+ subject: string | null;
259
+ };
260
+ id: string;
261
+ updatedAt: number;
262
+ }, import("./defineMutator").MarcoZeroContext>;
263
+ setFrom: import("@rocicorp/zero").MutatorDefinition<{
264
+ accountId: string;
265
+ aliasId: string;
266
+ from: string;
267
+ fromName: string | null;
268
+ id: string;
269
+ updatedAt: number;
270
+ }, {
271
+ accountId: string;
272
+ aliasId: string;
273
+ from: string;
274
+ fromName: string | null;
275
+ id: string;
276
+ updatedAt: number;
277
+ }, import("./defineMutator").MarcoZeroContext>;
278
+ };
279
+ readonly thread: {
280
+ addLabel: import("@rocicorp/zero").MutatorDefinition<{
281
+ accounts: {
282
+ [x: string]: {
283
+ threadIds: string[];
284
+ };
285
+ };
286
+ labelPath: string;
287
+ }, {
288
+ accounts: {
289
+ [x: string]: {
290
+ threadIds: string[];
291
+ };
292
+ };
293
+ labelPath: string;
294
+ }, import("./defineMutator").MarcoZeroContext>;
295
+ delete: import("@rocicorp/zero").MutatorDefinition<{
296
+ accounts: {
297
+ [x: string]: {
298
+ threadIds: string[];
299
+ };
300
+ };
301
+ }, {
302
+ accounts: {
303
+ [x: string]: {
304
+ threadIds: string[];
305
+ };
306
+ };
307
+ }, import("./defineMutator").MarcoZeroContext>;
308
+ removeLabel: import("@rocicorp/zero").MutatorDefinition<{
309
+ accounts: {
310
+ [x: string]: {
311
+ threadIds: string[];
312
+ };
313
+ };
314
+ labelPath: string;
315
+ }, {
316
+ accounts: {
317
+ [x: string]: {
318
+ threadIds: string[];
319
+ };
320
+ };
321
+ labelPath: string;
322
+ }, import("./defineMutator").MarcoZeroContext>;
323
+ setArchive: import("@rocicorp/zero").MutatorDefinition<{
324
+ accounts: {
325
+ [x: string]: {
326
+ threadIds: string[];
327
+ };
328
+ };
329
+ }, {
330
+ accounts: {
331
+ [x: string]: {
332
+ threadIds: string[];
333
+ };
334
+ };
335
+ }, import("./defineMutator").MarcoZeroContext>;
336
+ setFlagged: import("@rocicorp/zero").MutatorDefinition<{
337
+ accounts: {
338
+ [x: string]: {
339
+ threadIds: string[];
340
+ };
341
+ };
342
+ flagged: boolean;
343
+ }, {
344
+ accounts: {
345
+ [x: string]: {
346
+ threadIds: string[];
347
+ };
348
+ };
349
+ flagged: boolean;
350
+ }, import("./defineMutator").MarcoZeroContext>;
351
+ setInbox: import("@rocicorp/zero").MutatorDefinition<{
352
+ accounts: {
353
+ [x: string]: {
354
+ threadIds: string[];
355
+ };
356
+ };
357
+ }, {
358
+ accounts: {
359
+ [x: string]: {
360
+ threadIds: string[];
361
+ };
362
+ };
363
+ }, import("./defineMutator").MarcoZeroContext>;
364
+ setSeen: import("@rocicorp/zero").MutatorDefinition<{
365
+ accounts: {
366
+ [x: string]: {
367
+ threadIds: string[];
368
+ };
369
+ };
370
+ seen: boolean;
371
+ }, {
372
+ accounts: {
373
+ [x: string]: {
374
+ threadIds: string[];
375
+ };
376
+ };
377
+ seen: boolean;
378
+ }, import("./defineMutator").MarcoZeroContext>;
379
+ setSpam: import("@rocicorp/zero").MutatorDefinition<{
380
+ accounts: {
381
+ [x: string]: {
382
+ threadIds: string[];
383
+ };
384
+ };
385
+ }, {
386
+ accounts: {
387
+ [x: string]: {
388
+ threadIds: string[];
389
+ };
390
+ };
391
+ }, import("./defineMutator").MarcoZeroContext>;
392
+ setTrash: import("@rocicorp/zero").MutatorDefinition<{
393
+ accounts: {
394
+ [x: string]: {
395
+ threadIds: string[];
396
+ };
397
+ };
398
+ }, {
399
+ accounts: {
400
+ [x: string]: {
401
+ threadIds: string[];
402
+ };
403
+ };
404
+ }, import("./defineMutator").MarcoZeroContext>;
405
+ };
406
+ readonly user: {
407
+ deleteSettingsPushNotificationToken: import("@rocicorp/zero").MutatorDefinition<{
408
+ id: string;
409
+ token: string;
410
+ }, {
411
+ id: string;
412
+ token: string;
413
+ }, import("./defineMutator").MarcoZeroContext>;
414
+ setSettingsName: import("@rocicorp/zero").MutatorDefinition<{
415
+ id: string;
416
+ name: string | null;
417
+ }, {
418
+ id: string;
419
+ name: string | null;
420
+ }, import("./defineMutator").MarcoZeroContext>;
421
+ setSettingsPushNotificationToken: import("@rocicorp/zero").MutatorDefinition<{
422
+ id: string;
423
+ pushNotificationToken: {
424
+ createdAt: number;
425
+ id: string;
426
+ token: string;
427
+ };
428
+ }, {
429
+ id: string;
430
+ pushNotificationToken: {
431
+ createdAt: number;
432
+ id: string;
433
+ token: string;
434
+ };
435
+ }, import("./defineMutator").MarcoZeroContext>;
436
+ };
437
+ }, import("@rocicorp/zero").Schema>;
438
+ export type MarcoZeroMutators = typeof mutators;
29
439
  //# sourceMappingURL=mutators.d.ts.map