@marcoappio/marco-config 2.0.450 → 2.0.452
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/types/{ImapConnectionStatus.d.ts → IMAPConnectionStatus.d.ts} +2 -2
- package/dist/types/IMAPConnectionStatus.d.ts.map +1 -0
- package/dist/types/IMAPSourceLocation.d.ts +7 -0
- package/dist/types/IMAPSourceLocation.d.ts.map +1 -0
- package/dist/types/IMAPSourceLocation.js +1 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -1
- package/dist/zero/index.d.ts +263 -42
- package/dist/zero/index.d.ts.map +1 -1
- package/dist/zero/mutatorSchemas/index.d.ts +36 -0
- package/dist/zero/mutatorSchemas/index.d.ts.map +1 -1
- package/dist/zero/mutatorSchemas/thread.d.ts +36 -0
- package/dist/zero/mutatorSchemas/thread.d.ts.map +1 -1
- package/dist/zero/mutatorSchemas/thread.js +18 -7
- package/dist/zero/mutators/threadMutators/threadMutators.d.ts +4 -2
- package/dist/zero/mutators/threadMutators/threadMutators.d.ts.map +1 -1
- package/dist/zero/mutators/threadMutators/threadMutators.js +59 -19
- package/dist/zero/mutators/threadMutators/threadMutators.test.js +18 -12
- package/dist/zero/queries/getAccounts.d.ts +34 -7
- package/dist/zero/queries/getAccounts.d.ts.map +1 -1
- package/dist/zero/queries/getContacts.d.ts +33 -7
- package/dist/zero/queries/getContacts.d.ts.map +1 -1
- package/dist/zero/queries/getDrafts.d.ts +33 -7
- package/dist/zero/queries/getDrafts.d.ts.map +1 -1
- package/dist/zero/queries/getThreads.d.ts +34 -7
- package/dist/zero/queries/getThreads.d.ts.map +1 -1
- package/dist/zero/queries/getUser.d.ts +34 -7
- package/dist/zero/queries/getUser.d.ts.map +1 -1
- package/dist/zero/queries/index.d.ts +33 -7
- package/dist/zero/queries/index.d.ts.map +1 -1
- package/dist/zero/schema.d.ts +59 -7
- package/dist/zero/schema.d.ts.map +1 -1
- package/dist/zero/schema.js +4 -0
- package/package.json +1 -1
- package/dist/types/ImapConnectionStatus.d.ts.map +0 -1
- /package/dist/types/{ImapConnectionStatus.js → IMAPConnectionStatus.js} +0 -0
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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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAM,CAAA;AAEV,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -241,6 +241,12 @@ export declare const zeroMutatorSchemas: {
|
|
|
241
241
|
readonly addLabel: {
|
|
242
242
|
readonly delta: import("valibot").ObjectSchema<{
|
|
243
243
|
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>;
|
|
244
|
+
readonly sourceLocations: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
245
|
+
readonly labelId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
246
|
+
readonly threadMessageId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
247
|
+
readonly uid: import("valibot").NumberSchema<undefined>;
|
|
248
|
+
readonly uidValidity: import("valibot").NumberSchema<undefined>;
|
|
249
|
+
}, undefined>, undefined>;
|
|
244
250
|
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>;
|
|
245
251
|
}, undefined>;
|
|
246
252
|
};
|
|
@@ -252,6 +258,12 @@ export declare const zeroMutatorSchemas: {
|
|
|
252
258
|
readonly removeLabel: {
|
|
253
259
|
readonly delta: import("valibot").ObjectSchema<{
|
|
254
260
|
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>;
|
|
261
|
+
readonly sourceLocations: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
262
|
+
readonly labelId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
263
|
+
readonly threadMessageId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
264
|
+
readonly uid: import("valibot").NumberSchema<undefined>;
|
|
265
|
+
readonly uidValidity: import("valibot").NumberSchema<undefined>;
|
|
266
|
+
}, undefined>, undefined>;
|
|
255
267
|
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>;
|
|
256
268
|
}, undefined>;
|
|
257
269
|
};
|
|
@@ -263,6 +275,12 @@ export declare const zeroMutatorSchemas: {
|
|
|
263
275
|
};
|
|
264
276
|
readonly setArchive: {
|
|
265
277
|
readonly delta: import("valibot").ObjectSchema<{
|
|
278
|
+
readonly sourceLocations: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
279
|
+
readonly labelId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
280
|
+
readonly threadMessageId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
281
|
+
readonly uid: import("valibot").NumberSchema<undefined>;
|
|
282
|
+
readonly uidValidity: import("valibot").NumberSchema<undefined>;
|
|
283
|
+
}, undefined>, undefined>;
|
|
266
284
|
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>;
|
|
267
285
|
}, undefined>;
|
|
268
286
|
};
|
|
@@ -274,6 +292,12 @@ export declare const zeroMutatorSchemas: {
|
|
|
274
292
|
};
|
|
275
293
|
readonly setInbox: {
|
|
276
294
|
readonly delta: import("valibot").ObjectSchema<{
|
|
295
|
+
readonly sourceLocations: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
296
|
+
readonly labelId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
297
|
+
readonly threadMessageId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
298
|
+
readonly uid: import("valibot").NumberSchema<undefined>;
|
|
299
|
+
readonly uidValidity: import("valibot").NumberSchema<undefined>;
|
|
300
|
+
}, undefined>, undefined>;
|
|
277
301
|
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>;
|
|
278
302
|
}, undefined>;
|
|
279
303
|
};
|
|
@@ -285,11 +309,23 @@ export declare const zeroMutatorSchemas: {
|
|
|
285
309
|
};
|
|
286
310
|
readonly setSpam: {
|
|
287
311
|
readonly delta: import("valibot").ObjectSchema<{
|
|
312
|
+
readonly sourceLocations: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
313
|
+
readonly labelId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
314
|
+
readonly threadMessageId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
315
|
+
readonly uid: import("valibot").NumberSchema<undefined>;
|
|
316
|
+
readonly uidValidity: import("valibot").NumberSchema<undefined>;
|
|
317
|
+
}, undefined>, undefined>;
|
|
288
318
|
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>;
|
|
289
319
|
}, undefined>;
|
|
290
320
|
};
|
|
291
321
|
readonly setTrash: {
|
|
292
322
|
readonly delta: import("valibot").ObjectSchema<{
|
|
323
|
+
readonly sourceLocations: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
324
|
+
readonly labelId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
325
|
+
readonly threadMessageId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
326
|
+
readonly uid: import("valibot").NumberSchema<undefined>;
|
|
327
|
+
readonly uidValidity: import("valibot").NumberSchema<undefined>;
|
|
328
|
+
}, undefined>, undefined>;
|
|
293
329
|
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>;
|
|
294
330
|
}, undefined>;
|
|
295
331
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/zero/mutatorSchemas/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/zero/mutatorSchemas/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKrB,CAAA;AAEV,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAA"}
|
|
@@ -3,6 +3,12 @@ export declare const threadMutatorSchemas: {
|
|
|
3
3
|
readonly addLabel: {
|
|
4
4
|
readonly delta: v.ObjectSchema<{
|
|
5
5
|
readonly labelPath: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
6
|
+
readonly sourceLocations: v.ArraySchema<v.ObjectSchema<{
|
|
7
|
+
readonly labelId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
8
|
+
readonly threadMessageId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
9
|
+
readonly uid: v.NumberSchema<undefined>;
|
|
10
|
+
readonly uidValidity: v.NumberSchema<undefined>;
|
|
11
|
+
}, undefined>, undefined>;
|
|
6
12
|
readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
7
13
|
}, undefined>;
|
|
8
14
|
};
|
|
@@ -14,6 +20,12 @@ export declare const threadMutatorSchemas: {
|
|
|
14
20
|
readonly removeLabel: {
|
|
15
21
|
readonly delta: v.ObjectSchema<{
|
|
16
22
|
readonly labelPath: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
23
|
+
readonly sourceLocations: v.ArraySchema<v.ObjectSchema<{
|
|
24
|
+
readonly labelId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
25
|
+
readonly threadMessageId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
26
|
+
readonly uid: v.NumberSchema<undefined>;
|
|
27
|
+
readonly uidValidity: v.NumberSchema<undefined>;
|
|
28
|
+
}, undefined>, undefined>;
|
|
17
29
|
readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
18
30
|
}, undefined>;
|
|
19
31
|
};
|
|
@@ -25,6 +37,12 @@ export declare const threadMutatorSchemas: {
|
|
|
25
37
|
};
|
|
26
38
|
readonly setArchive: {
|
|
27
39
|
readonly delta: v.ObjectSchema<{
|
|
40
|
+
readonly sourceLocations: v.ArraySchema<v.ObjectSchema<{
|
|
41
|
+
readonly labelId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
42
|
+
readonly threadMessageId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
43
|
+
readonly uid: v.NumberSchema<undefined>;
|
|
44
|
+
readonly uidValidity: v.NumberSchema<undefined>;
|
|
45
|
+
}, undefined>, undefined>;
|
|
28
46
|
readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
29
47
|
}, undefined>;
|
|
30
48
|
};
|
|
@@ -36,6 +54,12 @@ export declare const threadMutatorSchemas: {
|
|
|
36
54
|
};
|
|
37
55
|
readonly setInbox: {
|
|
38
56
|
readonly delta: v.ObjectSchema<{
|
|
57
|
+
readonly sourceLocations: v.ArraySchema<v.ObjectSchema<{
|
|
58
|
+
readonly labelId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
59
|
+
readonly threadMessageId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
60
|
+
readonly uid: v.NumberSchema<undefined>;
|
|
61
|
+
readonly uidValidity: v.NumberSchema<undefined>;
|
|
62
|
+
}, undefined>, undefined>;
|
|
39
63
|
readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
40
64
|
}, undefined>;
|
|
41
65
|
};
|
|
@@ -47,11 +71,23 @@ export declare const threadMutatorSchemas: {
|
|
|
47
71
|
};
|
|
48
72
|
readonly setSpam: {
|
|
49
73
|
readonly delta: v.ObjectSchema<{
|
|
74
|
+
readonly sourceLocations: v.ArraySchema<v.ObjectSchema<{
|
|
75
|
+
readonly labelId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
76
|
+
readonly threadMessageId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
77
|
+
readonly uid: v.NumberSchema<undefined>;
|
|
78
|
+
readonly uidValidity: v.NumberSchema<undefined>;
|
|
79
|
+
}, undefined>, undefined>;
|
|
50
80
|
readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
51
81
|
}, undefined>;
|
|
52
82
|
};
|
|
53
83
|
readonly setTrash: {
|
|
54
84
|
readonly delta: v.ObjectSchema<{
|
|
85
|
+
readonly sourceLocations: v.ArraySchema<v.ObjectSchema<{
|
|
86
|
+
readonly labelId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
87
|
+
readonly threadMessageId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
88
|
+
readonly uid: v.NumberSchema<undefined>;
|
|
89
|
+
readonly uidValidity: v.NumberSchema<undefined>;
|
|
90
|
+
}, undefined>, undefined>;
|
|
55
91
|
readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
56
92
|
}, undefined>;
|
|
57
93
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thread.d.ts","sourceRoot":"","sources":["../../../src/zero/mutatorSchemas/thread.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"thread.d.ts","sourceRoot":"","sources":["../../../src/zero/mutatorSchemas/thread.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AA0B5B,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCvB,CAAA"}
|
|
@@ -3,19 +3,30 @@ import { marcoSchemas } from '../../schemas';
|
|
|
3
3
|
const threadIdsSchema = v.object({
|
|
4
4
|
threadIds: v.array(marcoSchemas.string.required()),
|
|
5
5
|
});
|
|
6
|
-
const
|
|
6
|
+
const imapSourceLocationSchema = v.object({
|
|
7
|
+
labelId: marcoSchemas.string.required(),
|
|
8
|
+
threadMessageId: marcoSchemas.string.required(),
|
|
9
|
+
uid: v.number(),
|
|
10
|
+
uidValidity: v.number(),
|
|
11
|
+
});
|
|
12
|
+
const specialUseLabelChangeDeltaSchema = v.object({
|
|
13
|
+
sourceLocations: v.array(imapSourceLocationSchema),
|
|
14
|
+
threadIds: v.array(marcoSchemas.string.required()),
|
|
15
|
+
});
|
|
16
|
+
const threadChangeLabelSchema = v.object({
|
|
7
17
|
labelPath: marcoSchemas.string.required(),
|
|
18
|
+
sourceLocations: v.array(imapSourceLocationSchema),
|
|
8
19
|
threadIds: v.array(marcoSchemas.string.required()),
|
|
9
20
|
});
|
|
10
21
|
export const threadMutatorSchemas = {
|
|
11
22
|
addLabel: {
|
|
12
|
-
delta:
|
|
23
|
+
delta: threadChangeLabelSchema,
|
|
13
24
|
},
|
|
14
25
|
delete: {
|
|
15
26
|
delta: threadIdsSchema,
|
|
16
27
|
},
|
|
17
28
|
removeLabel: {
|
|
18
|
-
delta:
|
|
29
|
+
delta: threadChangeLabelSchema,
|
|
19
30
|
},
|
|
20
31
|
requestAttachmentDownload: {
|
|
21
32
|
delta: v.object({
|
|
@@ -24,7 +35,7 @@ export const threadMutatorSchemas = {
|
|
|
24
35
|
}),
|
|
25
36
|
},
|
|
26
37
|
setArchive: {
|
|
27
|
-
delta:
|
|
38
|
+
delta: specialUseLabelChangeDeltaSchema,
|
|
28
39
|
},
|
|
29
40
|
setFlagged: {
|
|
30
41
|
delta: v.object({
|
|
@@ -33,7 +44,7 @@ export const threadMutatorSchemas = {
|
|
|
33
44
|
}),
|
|
34
45
|
},
|
|
35
46
|
setInbox: {
|
|
36
|
-
delta:
|
|
47
|
+
delta: specialUseLabelChangeDeltaSchema,
|
|
37
48
|
},
|
|
38
49
|
setSeen: {
|
|
39
50
|
delta: v.object({
|
|
@@ -42,9 +53,9 @@ export const threadMutatorSchemas = {
|
|
|
42
53
|
}),
|
|
43
54
|
},
|
|
44
55
|
setSpam: {
|
|
45
|
-
delta:
|
|
56
|
+
delta: specialUseLabelChangeDeltaSchema,
|
|
46
57
|
},
|
|
47
58
|
setTrash: {
|
|
48
|
-
delta:
|
|
59
|
+
delta: specialUseLabelChangeDeltaSchema,
|
|
49
60
|
},
|
|
50
61
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import type { Transaction } from '@rocicorp/zero';
|
|
1
2
|
import type * as v from 'valibot';
|
|
2
|
-
import type { LabelSpecialUse } from '../../../types';
|
|
3
|
+
import type { IMAPSourceLocation, LabelSpecialUse } from '../../../types';
|
|
3
4
|
import { type AuthData, type HandlerMap } from '../../../types';
|
|
4
5
|
import type { ZeroMutatorSchemas } from '../../../zero/mutatorSchemas';
|
|
6
|
+
import type { MarcoZeroSchema } from '../../../zero/schema';
|
|
5
7
|
export type ThreadMutatorCallbacks = {
|
|
6
8
|
[K in keyof ZeroMutatorSchemas['thread']]?: (args: v.InferOutput<ZeroMutatorSchemas['thread'][K]['delta']>) => Promise<void>;
|
|
7
9
|
};
|
|
8
|
-
export declare const setSystemLabel: (tx:
|
|
10
|
+
export declare const setSystemLabel: (tx: Transaction<MarcoZeroSchema>, threadId: string, targetSpecialUse: LabelSpecialUse) => Promise<IMAPSourceLocation[]>;
|
|
9
11
|
export declare const createThreadMutators: (_authData: AuthData | undefined, callbacks?: ThreadMutatorCallbacks) => HandlerMap<ZeroMutatorSchemas["thread"]>;
|
|
10
12
|
//# sourceMappingURL=threadMutators.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threadMutators.d.ts","sourceRoot":"","sources":["../../../../src/zero/mutators/threadMutators/threadMutators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,CAAC,MAAM,SAAS,CAAA;AAEjC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"threadMutators.d.ts","sourceRoot":"","sources":["../../../../src/zero/mutators/threadMutators/threadMutators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,KAAK,CAAC,MAAM,SAAS,CAAA;AAEjC,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC9E,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAiB,MAAM,qBAAqB,CAAA;AACnF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAEhE,MAAM,MAAM,sBAAsB,GAAG;KAClC,CAAC,IAAI,MAAM,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAC1C,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,KAC1D,OAAO,CAAC,IAAI,CAAC;CACnB,CAAA;AAED,eAAO,MAAM,cAAc,OACrB,WAAW,CAAC,eAAe,CAAC,YACtB,MAAM,oBACE,eAAe,KAChC,OAAO,CAAC,kBAAkB,EAAE,CAoE9B,CAAA;AAED,eAAO,MAAM,oBAAoB,cACpB,QAAQ,GAAG,SAAS,cACnB,sBAAsB,KACjC,UAAU,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAoLxC,CAAA"}
|
|
@@ -4,40 +4,57 @@ export const setSystemLabel = async (tx, threadId, targetSpecialUse) => {
|
|
|
4
4
|
if (!thread) {
|
|
5
5
|
throw new Error(MutationError.ENTITY_NOT_FOUND);
|
|
6
6
|
}
|
|
7
|
-
const { accountId } = thread;
|
|
8
7
|
const targetLabel = await tx.query.accountLabel
|
|
9
|
-
.where('accountId', accountId)
|
|
8
|
+
.where('accountId', thread.accountId)
|
|
10
9
|
.where('specialUse', targetSpecialUse)
|
|
11
10
|
.one()
|
|
12
11
|
.run();
|
|
13
12
|
if (!targetLabel) {
|
|
14
13
|
throw new Error(MutationError.ENTITY_NOT_FOUND);
|
|
15
14
|
}
|
|
16
|
-
const
|
|
15
|
+
const threadLabels = await tx.query.threadLabel.where('threadId', threadId).run();
|
|
16
|
+
const sourceLocations = [];
|
|
17
|
+
const labelsToDelete = [];
|
|
17
18
|
let hasTarget = false;
|
|
18
|
-
for (const label of
|
|
19
|
+
for (const label of threadLabels) {
|
|
19
20
|
if (label.labelId === targetLabel.id) {
|
|
20
21
|
hasTarget = true;
|
|
22
|
+
continue;
|
|
21
23
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
labelsToDelete.push(label);
|
|
25
|
+
if (label.uid > 0 && label.uidValidity > 0) {
|
|
26
|
+
sourceLocations.push({
|
|
25
27
|
labelId: label.labelId,
|
|
26
28
|
threadMessageId: label.threadMessageId,
|
|
29
|
+
uid: label.uid,
|
|
30
|
+
uidValidity: label.uidValidity,
|
|
27
31
|
});
|
|
28
32
|
}
|
|
29
33
|
}
|
|
34
|
+
for (const label of labelsToDelete) {
|
|
35
|
+
await tx.mutate.threadLabel.delete({
|
|
36
|
+
accountId: thread.accountId,
|
|
37
|
+
labelId: label.labelId,
|
|
38
|
+
threadMessageId: label.threadMessageId,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
30
41
|
if (!hasTarget) {
|
|
31
42
|
const messages = await tx.query.threadMessage.where('threadId', threadId).run();
|
|
32
|
-
|
|
43
|
+
const baseTimestamp = Date.now();
|
|
44
|
+
for (let i = 0; i < messages.length; i++) {
|
|
45
|
+
const message = messages[i];
|
|
33
46
|
await tx.mutate.threadLabel.insert({
|
|
34
|
-
accountId,
|
|
47
|
+
accountId: thread.accountId,
|
|
35
48
|
labelId: targetLabel.id,
|
|
49
|
+
lastSyncedAt: 0,
|
|
36
50
|
threadId,
|
|
37
51
|
threadMessageId: message.id,
|
|
52
|
+
uid: -(baseTimestamp + i),
|
|
53
|
+
uidValidity: targetLabel.uidValidity ?? 0,
|
|
38
54
|
});
|
|
39
55
|
}
|
|
40
56
|
}
|
|
57
|
+
return sourceLocations;
|
|
41
58
|
};
|
|
42
59
|
export const createThreadMutators = (_authData, callbacks) => ({
|
|
43
60
|
addLabel: async (tx, args) => {
|
|
@@ -55,6 +72,8 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
55
72
|
throw new Error(MutationError.ENTITY_NOT_FOUND);
|
|
56
73
|
}
|
|
57
74
|
const messages = await tx.query.threadMessage.where('threadId', threadId).run();
|
|
75
|
+
const baseTimestamp = Date.now();
|
|
76
|
+
let insertIndex = 0;
|
|
58
77
|
for (const message of messages) {
|
|
59
78
|
const existing = await tx.query.threadLabel
|
|
60
79
|
.where('threadMessageId', message.id)
|
|
@@ -65,13 +84,17 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
65
84
|
await tx.mutate.threadLabel.insert({
|
|
66
85
|
accountId: thread.accountId,
|
|
67
86
|
labelId: label.id,
|
|
87
|
+
lastSyncedAt: 0,
|
|
68
88
|
threadId,
|
|
69
89
|
threadMessageId: message.id,
|
|
90
|
+
uid: -(baseTimestamp + insertIndex),
|
|
91
|
+
uidValidity: label.uidValidity ?? 0,
|
|
70
92
|
});
|
|
93
|
+
insertIndex++;
|
|
71
94
|
}
|
|
72
95
|
}
|
|
73
96
|
}
|
|
74
|
-
callbacks?.addLabel?.(args);
|
|
97
|
+
callbacks?.addLabel?.({ ...args, sourceLocations: [] });
|
|
75
98
|
},
|
|
76
99
|
delete: async (tx, args) => {
|
|
77
100
|
for (const threadId of args.threadIds) {
|
|
@@ -82,6 +105,7 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
82
105
|
callbacks?.delete?.(args);
|
|
83
106
|
},
|
|
84
107
|
removeLabel: async (tx, args) => {
|
|
108
|
+
const allSourceLocations = [];
|
|
85
109
|
for (const threadId of args.threadIds) {
|
|
86
110
|
const thread = await tx.query.thread.where('id', threadId).one().run();
|
|
87
111
|
if (!thread) {
|
|
@@ -100,6 +124,14 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
100
124
|
throw new Error(MutationError.ENTITY_NOT_FOUND);
|
|
101
125
|
}
|
|
102
126
|
for (const existing of existingLabels) {
|
|
127
|
+
if (existing.uid > 0 && existing.uidValidity > 0) {
|
|
128
|
+
allSourceLocations.push({
|
|
129
|
+
labelId: existing.labelId,
|
|
130
|
+
threadMessageId: existing.threadMessageId,
|
|
131
|
+
uid: existing.uid,
|
|
132
|
+
uidValidity: existing.uidValidity,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
103
135
|
await tx.mutate.threadLabel.delete({
|
|
104
136
|
accountId: thread.accountId,
|
|
105
137
|
labelId: label.id,
|
|
@@ -107,7 +139,7 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
107
139
|
});
|
|
108
140
|
}
|
|
109
141
|
}
|
|
110
|
-
callbacks?.removeLabel?.(args);
|
|
142
|
+
callbacks?.removeLabel?.({ ...args, sourceLocations: allSourceLocations });
|
|
111
143
|
},
|
|
112
144
|
requestAttachmentDownload: async (tx, args) => {
|
|
113
145
|
for (const attachmentId of args.attachmentIds) {
|
|
@@ -123,10 +155,12 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
123
155
|
}
|
|
124
156
|
},
|
|
125
157
|
setArchive: async (tx, args) => {
|
|
158
|
+
const allSourceLocations = [];
|
|
126
159
|
for (const threadId of args.threadIds) {
|
|
127
|
-
await setSystemLabel(tx, threadId, 'ARCHIVE');
|
|
160
|
+
const sourceLocations = await setSystemLabel(tx, threadId, 'ARCHIVE');
|
|
161
|
+
allSourceLocations.push(...sourceLocations);
|
|
128
162
|
}
|
|
129
|
-
callbacks?.setArchive?.(args);
|
|
163
|
+
callbacks?.setArchive?.({ ...args, sourceLocations: allSourceLocations });
|
|
130
164
|
},
|
|
131
165
|
setFlagged: async (tx, args) => {
|
|
132
166
|
for (const threadId of args.threadIds) {
|
|
@@ -138,10 +172,12 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
138
172
|
callbacks?.setFlagged?.(args);
|
|
139
173
|
},
|
|
140
174
|
setInbox: async (tx, args) => {
|
|
175
|
+
const allSourceLocations = [];
|
|
141
176
|
for (const threadId of args.threadIds) {
|
|
142
|
-
await setSystemLabel(tx, threadId, 'INBOX');
|
|
177
|
+
const sourceLocations = await setSystemLabel(tx, threadId, 'INBOX');
|
|
178
|
+
allSourceLocations.push(...sourceLocations);
|
|
143
179
|
}
|
|
144
|
-
callbacks?.setInbox?.(args);
|
|
180
|
+
callbacks?.setInbox?.({ ...args, sourceLocations: allSourceLocations });
|
|
145
181
|
},
|
|
146
182
|
setSeen: async (tx, args) => {
|
|
147
183
|
for (const threadId of args.threadIds) {
|
|
@@ -153,15 +189,19 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
153
189
|
callbacks?.setSeen?.(args);
|
|
154
190
|
},
|
|
155
191
|
setSpam: async (tx, args) => {
|
|
192
|
+
const allSourceLocations = [];
|
|
156
193
|
for (const threadId of args.threadIds) {
|
|
157
|
-
await setSystemLabel(tx, threadId, 'SPAM');
|
|
194
|
+
const sourceLocations = await setSystemLabel(tx, threadId, 'SPAM');
|
|
195
|
+
allSourceLocations.push(...sourceLocations);
|
|
158
196
|
}
|
|
159
|
-
callbacks?.setSpam?.(args);
|
|
197
|
+
callbacks?.setSpam?.({ ...args, sourceLocations: allSourceLocations });
|
|
160
198
|
},
|
|
161
199
|
setTrash: async (tx, args) => {
|
|
200
|
+
const allSourceLocations = [];
|
|
162
201
|
for (const threadId of args.threadIds) {
|
|
163
|
-
await setSystemLabel(tx, threadId, 'TRASH');
|
|
202
|
+
const sourceLocations = await setSystemLabel(tx, threadId, 'TRASH');
|
|
203
|
+
allSourceLocations.push(...sourceLocations);
|
|
164
204
|
}
|
|
165
|
-
callbacks?.setTrash?.(args);
|
|
205
|
+
callbacks?.setTrash?.({ ...args, sourceLocations: allSourceLocations });
|
|
166
206
|
},
|
|
167
207
|
});
|
|
@@ -52,21 +52,22 @@ describe('threadMutators', () => {
|
|
|
52
52
|
const mutators = createMutators();
|
|
53
53
|
await mutators.thread.addLabel(transaction, {
|
|
54
54
|
labelPath: 'Work',
|
|
55
|
+
sourceLocations: [],
|
|
55
56
|
threadIds: ['test-thread-id-1'],
|
|
56
57
|
});
|
|
57
58
|
expect(threadLabelInsert).toHaveBeenCalledTimes(2);
|
|
58
|
-
expect(threadLabelInsert).toHaveBeenCalledWith({
|
|
59
|
+
expect(threadLabelInsert).toHaveBeenCalledWith(expect.objectContaining({
|
|
59
60
|
accountId: 'test-account-id-1',
|
|
60
61
|
labelId: 'test-label-id-1',
|
|
61
62
|
threadId: 'test-thread-id-1',
|
|
62
63
|
threadMessageId: 'test-message-id-1',
|
|
63
|
-
});
|
|
64
|
-
expect(threadLabelInsert).toHaveBeenCalledWith({
|
|
64
|
+
}));
|
|
65
|
+
expect(threadLabelInsert).toHaveBeenCalledWith(expect.objectContaining({
|
|
65
66
|
accountId: 'test-account-id-1',
|
|
66
67
|
labelId: 'test-label-id-1',
|
|
67
68
|
threadId: 'test-thread-id-1',
|
|
68
69
|
threadMessageId: 'test-message-id-2',
|
|
69
|
-
});
|
|
70
|
+
}));
|
|
70
71
|
});
|
|
71
72
|
});
|
|
72
73
|
describe('delete', () => {
|
|
@@ -148,6 +149,7 @@ describe('threadMutators', () => {
|
|
|
148
149
|
const mutators = createMutators();
|
|
149
150
|
await mutators.thread.removeLabel(transaction, {
|
|
150
151
|
labelPath: 'Work',
|
|
152
|
+
sourceLocations: [],
|
|
151
153
|
threadIds: ['test-thread-id-1'],
|
|
152
154
|
});
|
|
153
155
|
expect(threadLabelDelete).toHaveBeenCalledTimes(2);
|
|
@@ -247,6 +249,7 @@ describe('threadMutators', () => {
|
|
|
247
249
|
};
|
|
248
250
|
const mutators = createMutators();
|
|
249
251
|
await mutators.thread.setArchive(transaction, {
|
|
252
|
+
sourceLocations: [],
|
|
250
253
|
threadIds: ['test-thread-id-1'],
|
|
251
254
|
});
|
|
252
255
|
expect(threadLabelDelete).toHaveBeenCalledWith({
|
|
@@ -254,12 +257,12 @@ describe('threadMutators', () => {
|
|
|
254
257
|
labelId: 'test-inbox-label-id',
|
|
255
258
|
threadMessageId: 'test-message-id-1',
|
|
256
259
|
});
|
|
257
|
-
expect(threadLabelInsert).toHaveBeenCalledWith({
|
|
260
|
+
expect(threadLabelInsert).toHaveBeenCalledWith(expect.objectContaining({
|
|
258
261
|
accountId: 'test-account-id-1',
|
|
259
262
|
labelId: 'test-archive-label-id',
|
|
260
263
|
threadId: 'test-thread-id-1',
|
|
261
264
|
threadMessageId: 'test-message-id-1',
|
|
262
|
-
});
|
|
265
|
+
}));
|
|
263
266
|
});
|
|
264
267
|
});
|
|
265
268
|
describe('setFlagged', () => {
|
|
@@ -335,6 +338,7 @@ describe('threadMutators', () => {
|
|
|
335
338
|
};
|
|
336
339
|
const mutators = createMutators();
|
|
337
340
|
await mutators.thread.setInbox(transaction, {
|
|
341
|
+
sourceLocations: [],
|
|
338
342
|
threadIds: ['test-thread-id-1'],
|
|
339
343
|
});
|
|
340
344
|
expect(threadLabelDelete).toHaveBeenCalledWith({
|
|
@@ -342,12 +346,12 @@ describe('threadMutators', () => {
|
|
|
342
346
|
labelId: 'test-archive-label-id',
|
|
343
347
|
threadMessageId: 'test-message-id-1',
|
|
344
348
|
});
|
|
345
|
-
expect(threadLabelInsert).toHaveBeenCalledWith({
|
|
349
|
+
expect(threadLabelInsert).toHaveBeenCalledWith(expect.objectContaining({
|
|
346
350
|
accountId: 'test-account-id-1',
|
|
347
351
|
labelId: 'test-inbox-label-id',
|
|
348
352
|
threadId: 'test-thread-id-1',
|
|
349
353
|
threadMessageId: 'test-message-id-1',
|
|
350
|
-
});
|
|
354
|
+
}));
|
|
351
355
|
});
|
|
352
356
|
});
|
|
353
357
|
describe('setSeen', () => {
|
|
@@ -424,14 +428,15 @@ describe('threadMutators', () => {
|
|
|
424
428
|
};
|
|
425
429
|
const mutators = createMutators();
|
|
426
430
|
await mutators.thread.setSpam(transaction, {
|
|
431
|
+
sourceLocations: [],
|
|
427
432
|
threadIds: ['test-thread-id-1'],
|
|
428
433
|
});
|
|
429
|
-
expect(threadLabelInsert).toHaveBeenCalledWith({
|
|
434
|
+
expect(threadLabelInsert).toHaveBeenCalledWith(expect.objectContaining({
|
|
430
435
|
accountId: 'test-account-id-1',
|
|
431
436
|
labelId: 'test-spam-label-id',
|
|
432
437
|
threadId: 'test-thread-id-1',
|
|
433
438
|
threadMessageId: 'test-message-id-1',
|
|
434
|
-
});
|
|
439
|
+
}));
|
|
435
440
|
});
|
|
436
441
|
});
|
|
437
442
|
describe('setTrash', () => {
|
|
@@ -481,14 +486,15 @@ describe('threadMutators', () => {
|
|
|
481
486
|
};
|
|
482
487
|
const mutators = createMutators();
|
|
483
488
|
await mutators.thread.setTrash(transaction, {
|
|
489
|
+
sourceLocations: [],
|
|
484
490
|
threadIds: ['test-thread-id-1'],
|
|
485
491
|
});
|
|
486
|
-
expect(threadLabelInsert).toHaveBeenCalledWith({
|
|
492
|
+
expect(threadLabelInsert).toHaveBeenCalledWith(expect.objectContaining({
|
|
487
493
|
accountId: 'test-account-id-1',
|
|
488
494
|
labelId: 'test-trash-label-id',
|
|
489
495
|
threadId: 'test-thread-id-1',
|
|
490
496
|
threadMessageId: 'test-message-id-1',
|
|
491
|
-
});
|
|
497
|
+
}));
|
|
492
498
|
});
|
|
493
499
|
});
|
|
494
500
|
});
|