@marcoappio/marco-config 2.0.527 → 2.0.529
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.
- package/dist/constants/index.d.ts +4 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/user.d.ts +4 -0
- package/dist/constants/user.d.ts.map +1 -1
- package/dist/constants/user.js +4 -0
- package/dist/zero/index.d.ts +232 -54
- package/dist/zero/index.d.ts.map +1 -1
- package/dist/zero/mutatorSchemas.d.ts +47 -0
- package/dist/zero/mutatorSchemas.d.ts.map +1 -1
- package/dist/zero/mutatorSchemas.js +22 -0
- package/dist/zero/mutators.d.ts +75 -18
- package/dist/zero/mutators.d.ts.map +1 -1
- package/dist/zero/mutators.js +38 -0
- package/dist/zero/mutators.test.js +221 -0
- package/dist/zero/queries.d.ts +46 -18
- package/dist/zero/queries.d.ts.map +1 -1
- package/dist/zero/schema.d.ts +58 -18
- package/dist/zero/schema.d.ts.map +1 -1
- package/dist/zero/schema.js +2 -0
- package/package.json +1 -1
package/dist/zero/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/zero/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/zero/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMZ,CAAA"}
|
|
@@ -242,10 +242,22 @@ export declare const mutatorSchemas: {
|
|
|
242
242
|
}, undefined>;
|
|
243
243
|
};
|
|
244
244
|
user: {
|
|
245
|
+
createView: v.ObjectSchema<{
|
|
246
|
+
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
247
|
+
readonly view: v.ObjectSchema<{
|
|
248
|
+
readonly aliasEmails: v.SchemaWithPipe<readonly [v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, undefined>, undefined>, v.MinLengthAction<string[], 1, undefined>, v.MaxLengthAction<string[], number, undefined>]>;
|
|
249
|
+
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
250
|
+
readonly name: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
251
|
+
}, undefined>;
|
|
252
|
+
}, undefined>;
|
|
245
253
|
deleteSettingsPushNotificationToken: v.ObjectSchema<{
|
|
246
254
|
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
247
255
|
readonly token: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
248
256
|
}, undefined>;
|
|
257
|
+
deleteView: v.ObjectSchema<{
|
|
258
|
+
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
259
|
+
readonly viewId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
260
|
+
}, undefined>;
|
|
249
261
|
setSettingsName: v.ObjectSchema<{
|
|
250
262
|
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
251
263
|
readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
@@ -258,6 +270,41 @@ export declare const mutatorSchemas: {
|
|
|
258
270
|
readonly token: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
259
271
|
}, undefined>;
|
|
260
272
|
}, undefined>;
|
|
273
|
+
updateView: v.ObjectSchema<{
|
|
274
|
+
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
275
|
+
readonly updates: Omit<v.ObjectSchema<{
|
|
276
|
+
readonly aliasEmails: v.SchemaWithPipe<readonly [v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, undefined>, undefined>, v.MinLengthAction<string[], 1, undefined>, v.MaxLengthAction<string[], number, undefined>]>;
|
|
277
|
+
readonly name: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
278
|
+
}, undefined>, "~standard" | "~run" | "~types" | "entries"> & {
|
|
279
|
+
readonly entries: {
|
|
280
|
+
readonly aliasEmails: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, undefined>, undefined>, v.MinLengthAction<string[], 1, undefined>, v.MaxLengthAction<string[], number, undefined>]>, undefined>;
|
|
281
|
+
readonly name: v.OptionalSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
282
|
+
};
|
|
283
|
+
readonly '~standard': v.StandardProps<{
|
|
284
|
+
aliasEmails?: string[] | undefined;
|
|
285
|
+
name?: string | undefined;
|
|
286
|
+
}, {
|
|
287
|
+
aliasEmails?: string[] | undefined;
|
|
288
|
+
name?: string | undefined;
|
|
289
|
+
}>;
|
|
290
|
+
readonly '~run': (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
291
|
+
aliasEmails?: string[] | undefined;
|
|
292
|
+
name?: string | undefined;
|
|
293
|
+
}, v.StringIssue | v.RfcEmailIssue<string> | v.NonEmptyIssue<string> | v.MaxLengthIssue<string, number> | v.ObjectIssue | v.ArrayIssue | v.NonOptionalIssue | v.MinLengthIssue<string[], 1> | v.MaxLengthIssue<string[], number>>;
|
|
294
|
+
readonly '~types'?: {
|
|
295
|
+
readonly input: {
|
|
296
|
+
aliasEmails?: string[] | undefined;
|
|
297
|
+
name?: string | undefined;
|
|
298
|
+
};
|
|
299
|
+
readonly output: {
|
|
300
|
+
aliasEmails?: string[] | undefined;
|
|
301
|
+
name?: string | undefined;
|
|
302
|
+
};
|
|
303
|
+
readonly issue: v.StringIssue | v.RfcEmailIssue<string> | v.NonEmptyIssue<string> | v.MaxLengthIssue<string, number> | v.ObjectIssue | v.ArrayIssue | v.NonOptionalIssue | v.MinLengthIssue<string[], 1> | v.MaxLengthIssue<string[], number>;
|
|
304
|
+
} | undefined;
|
|
305
|
+
};
|
|
306
|
+
readonly viewId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
307
|
+
}, undefined>;
|
|
261
308
|
};
|
|
262
309
|
};
|
|
263
310
|
//# sourceMappingURL=mutatorSchemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutatorSchemas.d.ts","sourceRoot":"","sources":["../../src/zero/mutatorSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"mutatorSchemas.d.ts","sourceRoot":"","sources":["../../src/zero/mutatorSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAgF5B,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgK1B,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
+
import { marcoConstants } from '../constants';
|
|
2
3
|
import { marcoSchemas } from '../schemas';
|
|
3
4
|
import { socketTypeSchema } from '../schemas/emailAccount';
|
|
4
5
|
import { DRAFT_ATTACHMENT_UPLOAD_STATUSES, DRAFT_STATUSES, DRAFT_TYPES } from '../types';
|
|
@@ -53,6 +54,11 @@ const connectionConfigImapRawSchema = v.object({
|
|
|
53
54
|
smtpSocketType: socketTypeSchema,
|
|
54
55
|
smtpUser: marcoSchemas.string.required(),
|
|
55
56
|
});
|
|
57
|
+
const userViewSchema = v.object({
|
|
58
|
+
aliasEmails: v.pipe(v.array(marcoSchemas.string.email()), v.minLength(1), v.maxLength(marcoConstants.user.views.maxAliasEmailsPerView)),
|
|
59
|
+
id: marcoSchemas.string.required(),
|
|
60
|
+
name: marcoSchemas.string.required(),
|
|
61
|
+
});
|
|
56
62
|
export const mutatorSchemas = {
|
|
57
63
|
account: {
|
|
58
64
|
createAccount: v.object({
|
|
@@ -178,10 +184,18 @@ export const mutatorSchemas = {
|
|
|
178
184
|
setTrash: baseThreadSchema,
|
|
179
185
|
},
|
|
180
186
|
user: {
|
|
187
|
+
createView: v.object({
|
|
188
|
+
id: marcoSchemas.string.required(),
|
|
189
|
+
view: userViewSchema,
|
|
190
|
+
}),
|
|
181
191
|
deleteSettingsPushNotificationToken: v.object({
|
|
182
192
|
id: marcoSchemas.string.required(),
|
|
183
193
|
token: marcoSchemas.string.required(),
|
|
184
194
|
}),
|
|
195
|
+
deleteView: v.object({
|
|
196
|
+
id: marcoSchemas.string.required(),
|
|
197
|
+
viewId: marcoSchemas.string.required(),
|
|
198
|
+
}),
|
|
185
199
|
setSettingsName: v.object({
|
|
186
200
|
id: marcoSchemas.string.required(),
|
|
187
201
|
name: marcoSchemas.string.nullable(),
|
|
@@ -190,5 +204,13 @@ export const mutatorSchemas = {
|
|
|
190
204
|
id: marcoSchemas.string.required(),
|
|
191
205
|
pushNotificationToken: userPushNotificationTokenSchema,
|
|
192
206
|
}),
|
|
207
|
+
updateView: v.object({
|
|
208
|
+
id: marcoSchemas.string.required(),
|
|
209
|
+
updates: v.partial(v.object({
|
|
210
|
+
aliasEmails: v.pipe(v.array(marcoSchemas.string.email()), v.minLength(1), v.maxLength(marcoConstants.user.views.maxAliasEmailsPerView)),
|
|
211
|
+
name: marcoSchemas.string.required(),
|
|
212
|
+
})),
|
|
213
|
+
viewId: marcoSchemas.string.required(),
|
|
214
|
+
}),
|
|
193
215
|
},
|
|
194
216
|
};
|
package/dist/zero/mutators.d.ts
CHANGED
|
@@ -406,6 +406,21 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
406
406
|
}, Context, unknown>;
|
|
407
407
|
};
|
|
408
408
|
readonly user: {
|
|
409
|
+
readonly createView: import("@rocicorp/zero").MutatorDefinition<{
|
|
410
|
+
id: string;
|
|
411
|
+
view: {
|
|
412
|
+
aliasEmails: string[];
|
|
413
|
+
id: string;
|
|
414
|
+
name: string;
|
|
415
|
+
};
|
|
416
|
+
}, {
|
|
417
|
+
id: string;
|
|
418
|
+
view: {
|
|
419
|
+
aliasEmails: string[];
|
|
420
|
+
id: string;
|
|
421
|
+
name: string;
|
|
422
|
+
};
|
|
423
|
+
}, Context, unknown>;
|
|
409
424
|
readonly deleteSettingsPushNotificationToken: import("@rocicorp/zero").MutatorDefinition<{
|
|
410
425
|
id: string;
|
|
411
426
|
token: string;
|
|
@@ -413,6 +428,13 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
413
428
|
id: string;
|
|
414
429
|
token: string;
|
|
415
430
|
}, Context, unknown>;
|
|
431
|
+
readonly deleteView: import("@rocicorp/zero").MutatorDefinition<{
|
|
432
|
+
id: string;
|
|
433
|
+
viewId: string;
|
|
434
|
+
}, {
|
|
435
|
+
id: string;
|
|
436
|
+
viewId: string;
|
|
437
|
+
}, Context, unknown>;
|
|
416
438
|
readonly setSettingsName: import("@rocicorp/zero").MutatorDefinition<{
|
|
417
439
|
id: string;
|
|
418
440
|
name: string | null;
|
|
@@ -435,6 +457,21 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
435
457
|
token: string;
|
|
436
458
|
};
|
|
437
459
|
}, Context, unknown>;
|
|
460
|
+
readonly updateView: import("@rocicorp/zero").MutatorDefinition<{
|
|
461
|
+
id: string;
|
|
462
|
+
updates: {
|
|
463
|
+
aliasEmails?: string[] | undefined;
|
|
464
|
+
name?: string | undefined;
|
|
465
|
+
};
|
|
466
|
+
viewId: string;
|
|
467
|
+
}, {
|
|
468
|
+
id: string;
|
|
469
|
+
updates: {
|
|
470
|
+
aliasEmails?: string[] | undefined;
|
|
471
|
+
name?: string | undefined;
|
|
472
|
+
};
|
|
473
|
+
viewId: string;
|
|
474
|
+
}, Context, unknown>;
|
|
438
475
|
};
|
|
439
476
|
}, {
|
|
440
477
|
tables: {
|
|
@@ -469,6 +506,17 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
469
506
|
} & {
|
|
470
507
|
serverName: string;
|
|
471
508
|
};
|
|
509
|
+
readonly views: Omit<{
|
|
510
|
+
type: "json";
|
|
511
|
+
optional: false;
|
|
512
|
+
customType: {
|
|
513
|
+
id: string;
|
|
514
|
+
name: string;
|
|
515
|
+
aliasEmails: string[];
|
|
516
|
+
}[];
|
|
517
|
+
}, "optional"> & {
|
|
518
|
+
optional: true;
|
|
519
|
+
};
|
|
472
520
|
};
|
|
473
521
|
primaryKey: readonly [string, ...string[]];
|
|
474
522
|
} & {
|
|
@@ -1111,6 +1159,15 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
1111
1159
|
} & {
|
|
1112
1160
|
serverName: string;
|
|
1113
1161
|
};
|
|
1162
|
+
readonly unsubscribeUrl: Omit<{
|
|
1163
|
+
type: "string";
|
|
1164
|
+
optional: false;
|
|
1165
|
+
customType: string;
|
|
1166
|
+
}, "optional"> & {
|
|
1167
|
+
optional: true;
|
|
1168
|
+
} & {
|
|
1169
|
+
serverName: string;
|
|
1170
|
+
};
|
|
1114
1171
|
};
|
|
1115
1172
|
primaryKey: readonly [string, ...string[]];
|
|
1116
1173
|
} & {
|
|
@@ -1198,31 +1255,31 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
1198
1255
|
relationships: {
|
|
1199
1256
|
readonly user: {
|
|
1200
1257
|
accounts: [{
|
|
1201
|
-
readonly sourceField: readonly ("id" | "profilePicture" | "undoSendEnabled" | "name")[];
|
|
1258
|
+
readonly sourceField: readonly ("id" | "profilePicture" | "undoSendEnabled" | "name" | "views")[];
|
|
1202
1259
|
readonly destField: readonly ("id" | "userId" | "color" | "displayName" | "imapConnectionStatus" | "mailProcessedCount" | "mailTotalCount" | "primaryAliasId")[];
|
|
1203
1260
|
readonly destSchema: "account";
|
|
1204
1261
|
readonly cardinality: "many";
|
|
1205
1262
|
}];
|
|
1206
1263
|
contacts: [{
|
|
1207
|
-
readonly sourceField: readonly ("id" | "profilePicture" | "undoSendEnabled" | "name")[];
|
|
1264
|
+
readonly sourceField: readonly ("id" | "profilePicture" | "undoSendEnabled" | "name" | "views")[];
|
|
1208
1265
|
readonly destField: readonly ("id" | "name" | "userId" | "emailAddress")[];
|
|
1209
1266
|
readonly destSchema: "contact";
|
|
1210
1267
|
readonly cardinality: "many";
|
|
1211
1268
|
}];
|
|
1212
1269
|
drafts: [{
|
|
1213
|
-
readonly sourceField: readonly ("id" | "profilePicture" | "undoSendEnabled" | "name")[];
|
|
1270
|
+
readonly sourceField: readonly ("id" | "profilePicture" | "undoSendEnabled" | "name" | "views")[];
|
|
1214
1271
|
readonly destField: readonly ("type" | "status" | "id" | "userId" | "accountId" | "fromAliasId" | "fromEmail" | "fromName" | "referencedMessageId" | "scheduledFor" | "updatedAt" | "body" | "error" | "subject")[];
|
|
1215
1272
|
readonly destSchema: "draft";
|
|
1216
1273
|
readonly cardinality: "many";
|
|
1217
1274
|
}];
|
|
1218
1275
|
pushNotificationTokens: [{
|
|
1219
|
-
readonly sourceField: readonly ("id" | "profilePicture" | "undoSendEnabled" | "name")[];
|
|
1276
|
+
readonly sourceField: readonly ("id" | "profilePicture" | "undoSendEnabled" | "name" | "views")[];
|
|
1220
1277
|
readonly destField: readonly ("id" | "createdAt" | "token" | "userId")[];
|
|
1221
1278
|
readonly destSchema: "userPushNotificationToken";
|
|
1222
1279
|
readonly cardinality: "many";
|
|
1223
1280
|
}];
|
|
1224
1281
|
threads: [{
|
|
1225
|
-
readonly sourceField: readonly ("id" | "profilePicture" | "undoSendEnabled" | "name")[];
|
|
1282
|
+
readonly sourceField: readonly ("id" | "profilePicture" | "undoSendEnabled" | "name" | "views")[];
|
|
1226
1283
|
readonly destField: readonly ("id" | "userId" | "accountId" | "subject" | "flagged" | "hasAttachments" | "labelIdList" | "latestMessageDate" | "latestMessageId" | "messageCount" | "previewText" | "seen" | "senderEmail" | "senderName" | "words")[];
|
|
1227
1284
|
readonly destSchema: "thread";
|
|
1228
1285
|
readonly cardinality: "many";
|
|
@@ -1231,7 +1288,7 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
1231
1288
|
readonly userPushNotificationToken: {
|
|
1232
1289
|
user: [{
|
|
1233
1290
|
readonly sourceField: readonly ("id" | "createdAt" | "token" | "userId")[];
|
|
1234
|
-
readonly destField: readonly ("id" | "profilePicture" | "undoSendEnabled" | "name")[];
|
|
1291
|
+
readonly destField: readonly ("id" | "profilePicture" | "undoSendEnabled" | "name" | "views")[];
|
|
1235
1292
|
readonly destSchema: "user";
|
|
1236
1293
|
readonly cardinality: "one";
|
|
1237
1294
|
}];
|
|
@@ -1239,7 +1296,7 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
1239
1296
|
readonly contact: {
|
|
1240
1297
|
user: [{
|
|
1241
1298
|
readonly sourceField: readonly ("id" | "name" | "userId" | "emailAddress")[];
|
|
1242
|
-
readonly destField: readonly ("id" | "profilePicture" | "undoSendEnabled" | "name")[];
|
|
1299
|
+
readonly destField: readonly ("id" | "profilePicture" | "undoSendEnabled" | "name" | "views")[];
|
|
1243
1300
|
readonly destSchema: "user";
|
|
1244
1301
|
readonly cardinality: "one";
|
|
1245
1302
|
}];
|
|
@@ -1277,7 +1334,7 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
1277
1334
|
}];
|
|
1278
1335
|
user: [{
|
|
1279
1336
|
readonly sourceField: readonly ("id" | "userId" | "color" | "displayName" | "imapConnectionStatus" | "mailProcessedCount" | "mailTotalCount" | "primaryAliasId")[];
|
|
1280
|
-
readonly destField: readonly ("id" | "profilePicture" | "undoSendEnabled" | "name")[];
|
|
1337
|
+
readonly destField: readonly ("id" | "profilePicture" | "undoSendEnabled" | "name" | "views")[];
|
|
1281
1338
|
readonly destSchema: "user";
|
|
1282
1339
|
readonly cardinality: "one";
|
|
1283
1340
|
}];
|
|
@@ -1324,7 +1381,7 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
1324
1381
|
}];
|
|
1325
1382
|
user: [{
|
|
1326
1383
|
readonly sourceField: readonly ("type" | "status" | "id" | "userId" | "accountId" | "fromAliasId" | "fromEmail" | "fromName" | "referencedMessageId" | "scheduledFor" | "updatedAt" | "body" | "error" | "subject")[];
|
|
1327
|
-
readonly destField: readonly ("id" | "profilePicture" | "undoSendEnabled" | "name")[];
|
|
1384
|
+
readonly destField: readonly ("id" | "profilePicture" | "undoSendEnabled" | "name" | "views")[];
|
|
1328
1385
|
readonly destSchema: "user";
|
|
1329
1386
|
readonly cardinality: "one";
|
|
1330
1387
|
}];
|
|
@@ -1357,7 +1414,7 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
1357
1414
|
}];
|
|
1358
1415
|
messages: [{
|
|
1359
1416
|
readonly sourceField: readonly ("id" | "userId" | "accountId" | "subject" | "flagged" | "hasAttachments" | "labelIdList" | "latestMessageDate" | "latestMessageId" | "messageCount" | "previewText" | "seen" | "senderEmail" | "senderName" | "words")[];
|
|
1360
|
-
readonly destField: readonly ("id" | "accountId" | "previewText" | "senderEmail" | "senderName" | "threadId" | "envelopeDate" | "envelopeSubject")[];
|
|
1417
|
+
readonly destField: readonly ("id" | "accountId" | "previewText" | "senderEmail" | "senderName" | "threadId" | "envelopeDate" | "envelopeSubject" | "unsubscribeUrl")[];
|
|
1361
1418
|
readonly destSchema: "threadMessage";
|
|
1362
1419
|
readonly cardinality: "many";
|
|
1363
1420
|
}];
|
|
@@ -1369,7 +1426,7 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
1369
1426
|
}];
|
|
1370
1427
|
user: [{
|
|
1371
1428
|
readonly sourceField: readonly ("id" | "userId" | "accountId" | "subject" | "flagged" | "hasAttachments" | "labelIdList" | "latestMessageDate" | "latestMessageId" | "messageCount" | "previewText" | "seen" | "senderEmail" | "senderName" | "words")[];
|
|
1372
|
-
readonly destField: readonly ("id" | "profilePicture" | "undoSendEnabled" | "name")[];
|
|
1429
|
+
readonly destField: readonly ("id" | "profilePicture" | "undoSendEnabled" | "name" | "views")[];
|
|
1373
1430
|
readonly destSchema: "user";
|
|
1374
1431
|
readonly cardinality: "one";
|
|
1375
1432
|
}];
|
|
@@ -1383,7 +1440,7 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
1383
1440
|
}];
|
|
1384
1441
|
message: [{
|
|
1385
1442
|
readonly sourceField: readonly ("accountId" | "uidValidity" | "labelId" | "lastSyncedAt" | "threadId" | "threadMessageId" | "uid")[];
|
|
1386
|
-
readonly destField: readonly ("id" | "accountId" | "previewText" | "senderEmail" | "senderName" | "threadId" | "envelopeDate" | "envelopeSubject")[];
|
|
1443
|
+
readonly destField: readonly ("id" | "accountId" | "previewText" | "senderEmail" | "senderName" | "threadId" | "envelopeDate" | "envelopeSubject" | "unsubscribeUrl")[];
|
|
1387
1444
|
readonly destSchema: "threadMessage";
|
|
1388
1445
|
readonly cardinality: "one";
|
|
1389
1446
|
}];
|
|
@@ -1410,13 +1467,13 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
1410
1467
|
};
|
|
1411
1468
|
readonly threadMessage: {
|
|
1412
1469
|
attachments: [{
|
|
1413
|
-
readonly sourceField: readonly ("id" | "accountId" | "previewText" | "senderEmail" | "senderName" | "threadId" | "envelopeDate" | "envelopeSubject")[];
|
|
1470
|
+
readonly sourceField: readonly ("id" | "accountId" | "previewText" | "senderEmail" | "senderName" | "threadId" | "envelopeDate" | "envelopeSubject" | "unsubscribeUrl")[];
|
|
1414
1471
|
readonly destField: readonly ("id" | "fileName" | "mimeType" | "threadMessageId" | "size")[];
|
|
1415
1472
|
readonly destSchema: "threadMessageAttachment";
|
|
1416
1473
|
readonly cardinality: "many";
|
|
1417
1474
|
}];
|
|
1418
1475
|
labels: [{
|
|
1419
|
-
readonly sourceField: readonly ("id" | "accountId" | "previewText" | "senderEmail" | "senderName" | "threadId" | "envelopeDate" | "envelopeSubject")[];
|
|
1476
|
+
readonly sourceField: readonly ("id" | "accountId" | "previewText" | "senderEmail" | "senderName" | "threadId" | "envelopeDate" | "envelopeSubject" | "unsubscribeUrl")[];
|
|
1420
1477
|
readonly destField: readonly ("accountId" | "uidValidity" | "labelId" | "lastSyncedAt" | "threadId" | "threadMessageId" | "uid")[];
|
|
1421
1478
|
readonly destSchema: "threadLabel";
|
|
1422
1479
|
readonly cardinality: "many";
|
|
@@ -1427,13 +1484,13 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
1427
1484
|
readonly cardinality: "many";
|
|
1428
1485
|
}];
|
|
1429
1486
|
recipients: [{
|
|
1430
|
-
readonly sourceField: readonly ("id" | "accountId" | "previewText" | "senderEmail" | "senderName" | "threadId" | "envelopeDate" | "envelopeSubject")[];
|
|
1487
|
+
readonly sourceField: readonly ("id" | "accountId" | "previewText" | "senderEmail" | "senderName" | "threadId" | "envelopeDate" | "envelopeSubject" | "unsubscribeUrl")[];
|
|
1431
1488
|
readonly destField: readonly ("type" | "id" | "name" | "emailAddress" | "threadMessageId")[];
|
|
1432
1489
|
readonly destSchema: "threadMessageRecipient";
|
|
1433
1490
|
readonly cardinality: "many";
|
|
1434
1491
|
}];
|
|
1435
1492
|
thread: [{
|
|
1436
|
-
readonly sourceField: readonly ("id" | "accountId" | "previewText" | "senderEmail" | "senderName" | "threadId" | "envelopeDate" | "envelopeSubject")[];
|
|
1493
|
+
readonly sourceField: readonly ("id" | "accountId" | "previewText" | "senderEmail" | "senderName" | "threadId" | "envelopeDate" | "envelopeSubject" | "unsubscribeUrl")[];
|
|
1437
1494
|
readonly destField: readonly ("id" | "userId" | "accountId" | "subject" | "flagged" | "hasAttachments" | "labelIdList" | "latestMessageDate" | "latestMessageId" | "messageCount" | "previewText" | "seen" | "senderEmail" | "senderName" | "words")[];
|
|
1438
1495
|
readonly destSchema: "thread";
|
|
1439
1496
|
readonly cardinality: "one";
|
|
@@ -1442,7 +1499,7 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
1442
1499
|
readonly threadMessageRecipient: {
|
|
1443
1500
|
message: [{
|
|
1444
1501
|
readonly sourceField: readonly ("type" | "id" | "name" | "emailAddress" | "threadMessageId")[];
|
|
1445
|
-
readonly destField: readonly ("id" | "accountId" | "previewText" | "senderEmail" | "senderName" | "threadId" | "envelopeDate" | "envelopeSubject")[];
|
|
1502
|
+
readonly destField: readonly ("id" | "accountId" | "previewText" | "senderEmail" | "senderName" | "threadId" | "envelopeDate" | "envelopeSubject" | "unsubscribeUrl")[];
|
|
1446
1503
|
readonly destSchema: "threadMessage";
|
|
1447
1504
|
readonly cardinality: "one";
|
|
1448
1505
|
}];
|
|
@@ -1450,7 +1507,7 @@ export declare const mutators: import("@rocicorp/zero").MutatorRegistry<{
|
|
|
1450
1507
|
readonly threadMessageAttachment: {
|
|
1451
1508
|
message: [{
|
|
1452
1509
|
readonly sourceField: readonly ("id" | "fileName" | "mimeType" | "threadMessageId" | "size")[];
|
|
1453
|
-
readonly destField: readonly ("id" | "accountId" | "previewText" | "senderEmail" | "senderName" | "threadId" | "envelopeDate" | "envelopeSubject")[];
|
|
1510
|
+
readonly destField: readonly ("id" | "accountId" | "previewText" | "senderEmail" | "senderName" | "threadId" | "envelopeDate" | "envelopeSubject" | "unsubscribeUrl")[];
|
|
1454
1511
|
readonly destSchema: "threadMessage";
|
|
1455
1512
|
readonly cardinality: "one";
|
|
1456
1513
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutators.d.ts","sourceRoot":"","sources":["../../src/zero/mutators.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mutators.d.ts","sourceRoot":"","sources":["../../src/zero/mutators.ts"],"names":[],"mappings":"AASA,KAAK,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAqGjC,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0iBnB,CAAA"}
|
package/dist/zero/mutators.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createBuilder, defineMutators, defineMutatorWithType } from '@rocicorp/zero';
|
|
2
|
+
import { marcoConstants } from '../constants';
|
|
2
3
|
import { stringPatch } from '../utils';
|
|
3
4
|
import { threadsUtils } from '../utils/threads';
|
|
4
5
|
import { mutatorSchemas } from '../zero/mutatorSchemas';
|
|
@@ -487,11 +488,33 @@ export const mutators = defineMutators({
|
|
|
487
488
|
}),
|
|
488
489
|
},
|
|
489
490
|
user: {
|
|
491
|
+
createView: defineMutator(mutatorSchemas.user.createView, async ({ tx, args }) => {
|
|
492
|
+
const user = await tx.run(zql.user.where('id', args.id).one());
|
|
493
|
+
if (user) {
|
|
494
|
+
const currentViews = user.views ?? [];
|
|
495
|
+
const existingView = currentViews.find(x => x.id === args.view.id);
|
|
496
|
+
if (!existingView && currentViews.length < marcoConstants.user.views.maxViews) {
|
|
497
|
+
await tx.mutate.user.update({
|
|
498
|
+
id: args.id,
|
|
499
|
+
views: [...currentViews, { ...args.view, aliasEmails: [...new Set(args.view.aliasEmails)] }],
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
}),
|
|
490
504
|
deleteSettingsPushNotificationToken: defineMutator(mutatorSchemas.user.deleteSettingsPushNotificationToken, async ({ tx, args }) => {
|
|
491
505
|
await tx.mutate.userPushNotificationToken.delete({
|
|
492
506
|
id: args.id,
|
|
493
507
|
});
|
|
494
508
|
}),
|
|
509
|
+
deleteView: defineMutator(mutatorSchemas.user.deleteView, async ({ tx, args }) => {
|
|
510
|
+
const user = await tx.run(zql.user.where('id', args.id).one());
|
|
511
|
+
if (user) {
|
|
512
|
+
await tx.mutate.user.update({
|
|
513
|
+
id: args.id,
|
|
514
|
+
views: (user.views ?? []).filter(x => x.id !== args.viewId),
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
}),
|
|
495
518
|
setSettingsName: defineMutator(mutatorSchemas.user.setSettingsName, async ({ tx, args }) => {
|
|
496
519
|
await tx.mutate.user.update({
|
|
497
520
|
id: args.id,
|
|
@@ -509,5 +532,20 @@ export const mutators = defineMutators({
|
|
|
509
532
|
});
|
|
510
533
|
}
|
|
511
534
|
}),
|
|
535
|
+
updateView: defineMutator(mutatorSchemas.user.updateView, async ({ tx, args }) => {
|
|
536
|
+
const user = await tx.run(zql.user.where('id', args.id).one());
|
|
537
|
+
if (user) {
|
|
538
|
+
const viewExists = (user.views ?? []).some(x => x.id === args.viewId);
|
|
539
|
+
if (viewExists) {
|
|
540
|
+
const deduplicatedEmails = args.updates.aliasEmails ? [...new Set(args.updates.aliasEmails)] : undefined;
|
|
541
|
+
await tx.mutate.user.update({
|
|
542
|
+
id: args.id,
|
|
543
|
+
views: (user.views ?? []).map(x => x.id === args.viewId
|
|
544
|
+
? { ...x, aliasEmails: deduplicatedEmails ?? x.aliasEmails, name: args.updates.name ?? x.name }
|
|
545
|
+
: x),
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}),
|
|
512
550
|
},
|
|
513
551
|
});
|