@marcoappio/marco-config 2.0.441 → 2.0.443
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/zero/index.d.ts +4 -10
- package/dist/zero/index.d.ts.map +1 -1
- package/dist/zero/mutatorSchemas/index.d.ts +4 -10
- package/dist/zero/mutatorSchemas/index.d.ts.map +1 -1
- package/dist/zero/mutatorSchemas/thread.d.ts +4 -10
- package/dist/zero/mutatorSchemas/thread.d.ts.map +1 -1
- package/dist/zero/mutatorSchemas/thread.js +12 -27
- package/dist/zero/mutators/accountMutators/accountMutators.js +9 -9
- package/dist/zero/mutators/accountMutators/accountMutators.test.js +3 -3
- package/dist/zero/mutators/draftMutators/draftMutators.js +10 -10
- package/dist/zero/mutators/threadMutators/threadMutators.d.ts +2 -0
- package/dist/zero/mutators/threadMutators/threadMutators.d.ts.map +1 -1
- package/dist/zero/mutators/threadMutators/threadMutators.js +50 -139
- package/dist/zero/mutators/threadMutators/threadMutators.test.js +13 -51
- package/dist/zero/mutators/userMutators/userMutators.js +3 -3
- package/package.json +1 -1
package/dist/zero/index.d.ts
CHANGED
|
@@ -258,13 +258,10 @@ export declare const marcoZero: {
|
|
|
258
258
|
}, undefined>;
|
|
259
259
|
};
|
|
260
260
|
readonly requestAttachmentDownload: {
|
|
261
|
-
readonly delta: import("valibot").
|
|
262
|
-
readonly attachmentId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
263
|
-
readonly threadId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
264
|
-
}, undefined>, import("valibot").ObjectSchema<{
|
|
261
|
+
readonly delta: import("valibot").ObjectSchema<{
|
|
265
262
|
readonly attachmentIds: 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>;
|
|
266
263
|
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
|
-
}, undefined
|
|
264
|
+
}, undefined>;
|
|
268
265
|
};
|
|
269
266
|
readonly setArchive: {
|
|
270
267
|
readonly delta: import("valibot").ObjectSchema<{
|
|
@@ -272,13 +269,10 @@ export declare const marcoZero: {
|
|
|
272
269
|
}, undefined>;
|
|
273
270
|
};
|
|
274
271
|
readonly setFlagged: {
|
|
275
|
-
readonly delta: import("valibot").
|
|
276
|
-
readonly flagged: import("valibot").NonOptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
|
|
277
|
-
readonly threadId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
278
|
-
}, undefined>, import("valibot").ObjectSchema<{
|
|
272
|
+
readonly delta: import("valibot").ObjectSchema<{
|
|
279
273
|
readonly flagged: import("valibot").NonOptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
|
|
280
274
|
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>;
|
|
281
|
-
}, undefined
|
|
275
|
+
}, undefined>;
|
|
282
276
|
};
|
|
283
277
|
readonly setInbox: {
|
|
284
278
|
readonly delta: import("valibot").ObjectSchema<{
|
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"}
|
|
@@ -256,13 +256,10 @@ export declare const zeroMutatorSchemas: {
|
|
|
256
256
|
}, undefined>;
|
|
257
257
|
};
|
|
258
258
|
readonly requestAttachmentDownload: {
|
|
259
|
-
readonly delta: import("valibot").
|
|
260
|
-
readonly attachmentId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
261
|
-
readonly threadId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
262
|
-
}, undefined>, import("valibot").ObjectSchema<{
|
|
259
|
+
readonly delta: import("valibot").ObjectSchema<{
|
|
263
260
|
readonly attachmentIds: 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>;
|
|
264
261
|
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>;
|
|
265
|
-
}, undefined
|
|
262
|
+
}, undefined>;
|
|
266
263
|
};
|
|
267
264
|
readonly setArchive: {
|
|
268
265
|
readonly delta: import("valibot").ObjectSchema<{
|
|
@@ -270,13 +267,10 @@ export declare const zeroMutatorSchemas: {
|
|
|
270
267
|
}, undefined>;
|
|
271
268
|
};
|
|
272
269
|
readonly setFlagged: {
|
|
273
|
-
readonly delta: import("valibot").
|
|
274
|
-
readonly flagged: import("valibot").NonOptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
|
|
275
|
-
readonly threadId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
276
|
-
}, undefined>, import("valibot").ObjectSchema<{
|
|
270
|
+
readonly delta: import("valibot").ObjectSchema<{
|
|
277
271
|
readonly flagged: import("valibot").NonOptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
|
|
278
272
|
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>;
|
|
279
|
-
}, undefined
|
|
273
|
+
}, undefined>;
|
|
280
274
|
};
|
|
281
275
|
readonly setInbox: {
|
|
282
276
|
readonly delta: import("valibot").ObjectSchema<{
|
|
@@ -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"}
|
|
@@ -18,13 +18,10 @@ export declare const threadMutatorSchemas: {
|
|
|
18
18
|
}, undefined>;
|
|
19
19
|
};
|
|
20
20
|
readonly requestAttachmentDownload: {
|
|
21
|
-
readonly delta: v.
|
|
22
|
-
readonly attachmentId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
23
|
-
readonly threadId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
24
|
-
}, undefined>, v.ObjectSchema<{
|
|
21
|
+
readonly delta: v.ObjectSchema<{
|
|
25
22
|
readonly attachmentIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
26
23
|
readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
27
|
-
}, undefined
|
|
24
|
+
}, undefined>;
|
|
28
25
|
};
|
|
29
26
|
readonly setArchive: {
|
|
30
27
|
readonly delta: v.ObjectSchema<{
|
|
@@ -32,13 +29,10 @@ export declare const threadMutatorSchemas: {
|
|
|
32
29
|
}, undefined>;
|
|
33
30
|
};
|
|
34
31
|
readonly setFlagged: {
|
|
35
|
-
readonly delta: v.
|
|
36
|
-
readonly flagged: v.NonOptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
37
|
-
readonly threadId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
38
|
-
}, undefined>, v.ObjectSchema<{
|
|
32
|
+
readonly delta: v.ObjectSchema<{
|
|
39
33
|
readonly flagged: v.NonOptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
40
34
|
readonly threadIds: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
41
|
-
}, undefined
|
|
35
|
+
}, undefined>;
|
|
42
36
|
};
|
|
43
37
|
readonly setInbox: {
|
|
44
38
|
readonly delta: v.ObjectSchema<{
|
|
@@ -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;AAa5B,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCvB,CAAA"}
|
|
@@ -7,30 +7,6 @@ const threadAddRemoveLabelSchema = v.object({
|
|
|
7
7
|
labelPath: marcoSchemas.string.required(),
|
|
8
8
|
threadIds: v.array(marcoSchemas.string.required()),
|
|
9
9
|
});
|
|
10
|
-
const threadRequestAttachmentSchema = v.union([
|
|
11
|
-
v.object({
|
|
12
|
-
attachmentId: marcoSchemas.string.required(),
|
|
13
|
-
threadId: marcoSchemas.string.required(),
|
|
14
|
-
}),
|
|
15
|
-
v.object({
|
|
16
|
-
attachmentIds: v.array(marcoSchemas.string.required()),
|
|
17
|
-
threadIds: v.array(marcoSchemas.string.required()),
|
|
18
|
-
}),
|
|
19
|
-
]);
|
|
20
|
-
const threadSetFlaggedSchema = v.union([
|
|
21
|
-
v.object({
|
|
22
|
-
flagged: v.nonOptional(v.boolean()),
|
|
23
|
-
threadId: marcoSchemas.string.required(),
|
|
24
|
-
}),
|
|
25
|
-
v.object({
|
|
26
|
-
flagged: v.nonOptional(v.boolean()),
|
|
27
|
-
threadIds: v.array(marcoSchemas.string.required()),
|
|
28
|
-
}),
|
|
29
|
-
]);
|
|
30
|
-
const threadSetSeenSchema = v.object({
|
|
31
|
-
seen: v.boolean(),
|
|
32
|
-
threadIds: v.array(marcoSchemas.string.required()),
|
|
33
|
-
});
|
|
34
10
|
export const threadMutatorSchemas = {
|
|
35
11
|
addLabel: {
|
|
36
12
|
delta: threadAddRemoveLabelSchema,
|
|
@@ -42,19 +18,28 @@ export const threadMutatorSchemas = {
|
|
|
42
18
|
delta: threadAddRemoveLabelSchema,
|
|
43
19
|
},
|
|
44
20
|
requestAttachmentDownload: {
|
|
45
|
-
delta:
|
|
21
|
+
delta: v.object({
|
|
22
|
+
attachmentIds: v.array(marcoSchemas.string.required()),
|
|
23
|
+
threadIds: v.array(marcoSchemas.string.required()),
|
|
24
|
+
}),
|
|
46
25
|
},
|
|
47
26
|
setArchive: {
|
|
48
27
|
delta: threadIdsSchema,
|
|
49
28
|
},
|
|
50
29
|
setFlagged: {
|
|
51
|
-
delta:
|
|
30
|
+
delta: v.object({
|
|
31
|
+
flagged: v.nonOptional(v.boolean()),
|
|
32
|
+
threadIds: v.array(marcoSchemas.string.required()),
|
|
33
|
+
}),
|
|
52
34
|
},
|
|
53
35
|
setInbox: {
|
|
54
36
|
delta: threadIdsSchema,
|
|
55
37
|
},
|
|
56
38
|
setSeen: {
|
|
57
|
-
delta:
|
|
39
|
+
delta: v.object({
|
|
40
|
+
seen: v.boolean(),
|
|
41
|
+
threadIds: v.array(marcoSchemas.string.required()),
|
|
42
|
+
}),
|
|
58
43
|
},
|
|
59
44
|
setSpam: {
|
|
60
45
|
delta: threadIdsSchema,
|
|
@@ -21,7 +21,7 @@ export const createAccountMutators = (authData, callbacks) => ({
|
|
|
21
21
|
isPrimary: true,
|
|
22
22
|
name: null,
|
|
23
23
|
});
|
|
24
|
-
|
|
24
|
+
callbacks?.createAccount?.(args);
|
|
25
25
|
},
|
|
26
26
|
createAlias: async (tx, args) => {
|
|
27
27
|
await tx.mutate.accountAlias.insert({
|
|
@@ -31,13 +31,13 @@ export const createAccountMutators = (authData, callbacks) => ({
|
|
|
31
31
|
isPrimary: false,
|
|
32
32
|
name: args.alias.name ?? null,
|
|
33
33
|
});
|
|
34
|
-
|
|
34
|
+
callbacks?.createAlias?.(args);
|
|
35
35
|
},
|
|
36
36
|
deleteAccount: async (tx, args) => {
|
|
37
37
|
await tx.mutate.account.delete({
|
|
38
38
|
id: args.id,
|
|
39
39
|
});
|
|
40
|
-
|
|
40
|
+
callbacks?.deleteAccount?.(args);
|
|
41
41
|
},
|
|
42
42
|
deleteAlias: async (tx, args) => {
|
|
43
43
|
const alias = await tx.query.accountAlias.where('id', args.aliasId).one().run();
|
|
@@ -64,14 +64,14 @@ export const createAccountMutators = (authData, callbacks) => ({
|
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
callbacks?.deleteAlias?.(args);
|
|
68
68
|
},
|
|
69
69
|
setAliasName: async (tx, args) => {
|
|
70
70
|
await tx.mutate.accountAlias.update({
|
|
71
71
|
id: args.aliasId,
|
|
72
72
|
name: args.displayName,
|
|
73
73
|
});
|
|
74
|
-
|
|
74
|
+
callbacks?.setAliasName?.(args);
|
|
75
75
|
},
|
|
76
76
|
setAliasPrimary: async (tx, args) => {
|
|
77
77
|
const aliases = await tx.query.accountAlias.where('accountId', args.accountId).run();
|
|
@@ -85,21 +85,21 @@ export const createAccountMutators = (authData, callbacks) => ({
|
|
|
85
85
|
id: args.accountId,
|
|
86
86
|
primaryAliasId: args.aliasId,
|
|
87
87
|
});
|
|
88
|
-
|
|
88
|
+
callbacks?.setAliasPrimary?.(args);
|
|
89
89
|
},
|
|
90
90
|
setConnectionConfigImapRaw: async (tx, args) => {
|
|
91
91
|
await tx.mutate.account.update({
|
|
92
92
|
id: args.id,
|
|
93
93
|
imapConnectionStatus: 'AWAITING_CONNECTION',
|
|
94
94
|
});
|
|
95
|
-
|
|
95
|
+
callbacks?.setConnectionConfigImapRaw?.(args);
|
|
96
96
|
},
|
|
97
97
|
setConnectionConfigOauth: async (tx, args) => {
|
|
98
98
|
await tx.mutate.account.update({
|
|
99
99
|
id: args.id,
|
|
100
100
|
imapConnectionStatus: 'AWAITING_CONNECTION',
|
|
101
101
|
});
|
|
102
|
-
|
|
102
|
+
callbacks?.setConnectionConfigOauth?.(args);
|
|
103
103
|
},
|
|
104
104
|
setSettings: async (tx, args) => {
|
|
105
105
|
await tx.mutate.account.update({
|
|
@@ -107,6 +107,6 @@ export const createAccountMutators = (authData, callbacks) => ({
|
|
|
107
107
|
displayName: args.displayName ? args.displayName : undefined,
|
|
108
108
|
id: args.id,
|
|
109
109
|
});
|
|
110
|
-
|
|
110
|
+
callbacks?.setSettings?.(args);
|
|
111
111
|
},
|
|
112
112
|
});
|
|
@@ -5,7 +5,7 @@ describe('accountMutators', () => {
|
|
|
5
5
|
it('creates an account and invokes the callback', async () => {
|
|
6
6
|
const accountInsert = mock(async () => { });
|
|
7
7
|
const accountAliasInsert = mock(async () => { });
|
|
8
|
-
const createAccountCallback = mock(
|
|
8
|
+
const createAccountCallback = mock(() => { });
|
|
9
9
|
const mutators = createMutators({ sub: 'test-user-id' }, {
|
|
10
10
|
account: {
|
|
11
11
|
createAccount: createAccountCallback,
|
|
@@ -69,7 +69,7 @@ describe('accountMutators', () => {
|
|
|
69
69
|
describe('createAlias', () => {
|
|
70
70
|
it('creates an alias', async () => {
|
|
71
71
|
const accountAliasInsert = mock(async () => { });
|
|
72
|
-
const createAliasCallback = mock(
|
|
72
|
+
const createAliasCallback = mock(() => { });
|
|
73
73
|
const mutators = createMutators({ sub: 'test-user-id' }, {
|
|
74
74
|
account: {
|
|
75
75
|
createAlias: createAliasCallback,
|
|
@@ -106,7 +106,7 @@ describe('accountMutators', () => {
|
|
|
106
106
|
describe('deleteAccount', () => {
|
|
107
107
|
it('deletes an account', async () => {
|
|
108
108
|
const accountDelete = mock(async () => { });
|
|
109
|
-
const deleteAccountCallback = mock(
|
|
109
|
+
const deleteAccountCallback = mock(() => { });
|
|
110
110
|
const mutators = createMutators({ sub: 'test-user-id' }, {
|
|
111
111
|
account: {
|
|
112
112
|
deleteAccount: deleteAccountCallback,
|
|
@@ -8,7 +8,7 @@ export const createDraftMutators = (authData, callbacks) => ({
|
|
|
8
8
|
status: 'DRAFT',
|
|
9
9
|
updatedAt: args.updatedAt,
|
|
10
10
|
});
|
|
11
|
-
|
|
11
|
+
callbacks?.cancelSend?.(args);
|
|
12
12
|
},
|
|
13
13
|
createAttachment: async (tx, args) => {
|
|
14
14
|
await tx.mutate.draftAttachment.insert({
|
|
@@ -25,7 +25,7 @@ export const createDraftMutators = (authData, callbacks) => ({
|
|
|
25
25
|
id: args.id,
|
|
26
26
|
updatedAt: args.updatedAt,
|
|
27
27
|
});
|
|
28
|
-
|
|
28
|
+
callbacks?.createAttachment?.(args);
|
|
29
29
|
},
|
|
30
30
|
createDraft: async (tx, args) => {
|
|
31
31
|
if (!authData) {
|
|
@@ -64,7 +64,7 @@ export const createDraftMutators = (authData, callbacks) => ({
|
|
|
64
64
|
uploadedChunks: attachment.uploadedChunks,
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
callbacks?.createDraft?.(args);
|
|
68
68
|
},
|
|
69
69
|
deleteAttachment: async (tx, args) => {
|
|
70
70
|
await tx.mutate.draftAttachment.delete({
|
|
@@ -74,13 +74,13 @@ export const createDraftMutators = (authData, callbacks) => ({
|
|
|
74
74
|
id: args.id,
|
|
75
75
|
updatedAt: args.updatedAt,
|
|
76
76
|
});
|
|
77
|
-
|
|
77
|
+
callbacks?.deleteAttachment?.(args);
|
|
78
78
|
},
|
|
79
79
|
deleteDraft: async (tx, args) => {
|
|
80
80
|
await tx.mutate.draft.delete({
|
|
81
81
|
id: args.id,
|
|
82
82
|
});
|
|
83
|
-
|
|
83
|
+
callbacks?.deleteDraft?.(args);
|
|
84
84
|
},
|
|
85
85
|
scheduleSend: async (tx, args) => {
|
|
86
86
|
if (args.kind === 'IMMEDIATE') {
|
|
@@ -99,7 +99,7 @@ export const createDraftMutators = (authData, callbacks) => ({
|
|
|
99
99
|
updatedAt: args.updatedAt,
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
-
|
|
102
|
+
callbacks?.scheduleSend?.(args);
|
|
103
103
|
},
|
|
104
104
|
setContent: async (tx, args) => {
|
|
105
105
|
const draft = await tx.query.draft.where('id', args.id).one().run();
|
|
@@ -116,7 +116,7 @@ export const createDraftMutators = (authData, callbacks) => ({
|
|
|
116
116
|
id: args.id,
|
|
117
117
|
updatedAt: args.updatedAt,
|
|
118
118
|
});
|
|
119
|
-
|
|
119
|
+
callbacks?.setContent?.(args);
|
|
120
120
|
},
|
|
121
121
|
setEnvelope: async (tx, args) => {
|
|
122
122
|
const draft = await tx.query.draft.where('id', args.id).one().run();
|
|
@@ -134,7 +134,7 @@ export const createDraftMutators = (authData, callbacks) => ({
|
|
|
134
134
|
subject: args.envelope.subject,
|
|
135
135
|
updatedAt: args.updatedAt,
|
|
136
136
|
});
|
|
137
|
-
|
|
137
|
+
callbacks?.setEnvelope?.(args);
|
|
138
138
|
},
|
|
139
139
|
setFrom: async (tx, args) => {
|
|
140
140
|
await tx.mutate.draft.update({
|
|
@@ -145,7 +145,7 @@ export const createDraftMutators = (authData, callbacks) => ({
|
|
|
145
145
|
id: args.id,
|
|
146
146
|
updatedAt: args.updatedAt,
|
|
147
147
|
});
|
|
148
|
-
|
|
148
|
+
callbacks?.setFrom?.(args);
|
|
149
149
|
},
|
|
150
150
|
uploadAttachmentChunk: async (tx, args) => {
|
|
151
151
|
const attachment = await tx.query.draftAttachment.where('id', args.attachmentId).one().run();
|
|
@@ -157,6 +157,6 @@ export const createDraftMutators = (authData, callbacks) => ({
|
|
|
157
157
|
id: args.attachmentId,
|
|
158
158
|
uploadedChunks,
|
|
159
159
|
});
|
|
160
|
-
|
|
160
|
+
callbacks?.uploadAttachmentChunk?.(args);
|
|
161
161
|
},
|
|
162
162
|
});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type * as v from 'valibot';
|
|
2
|
+
import type { LabelSpecialUse } from '../../../types';
|
|
2
3
|
import { type AuthData, type HandlerMap } from '../../../types';
|
|
3
4
|
import type { ZeroMutatorSchemas } from '../../../zero/mutatorSchemas';
|
|
4
5
|
export type ThreadMutatorCallbacks = {
|
|
5
6
|
[K in keyof ZeroMutatorSchemas['thread']]?: (args: v.InferOutput<ZeroMutatorSchemas['thread'][K]['delta']>) => Promise<void>;
|
|
6
7
|
};
|
|
8
|
+
export declare const setSystemLabel: (tx: any, threadId: string, targetSpecialUse: LabelSpecialUse) => Promise<void>;
|
|
7
9
|
export declare const createThreadMutators: (_authData: AuthData | undefined, callbacks?: ThreadMutatorCallbacks) => HandlerMap<ZeroMutatorSchemas["thread"]>;
|
|
8
10
|
//# 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,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAiB,MAAM,qBAAqB,CAAA;AACnF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAE3E,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,oBAAoB,cACpB,QAAQ,GAAG,SAAS,cACnB,sBAAsB,KACjC,UAAU,CAAC,kBAAkB,CAAC,QAAQ,CAAC,
|
|
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;AAC1D,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAiB,MAAM,qBAAqB,CAAA;AACnF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAE3E,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,OAAc,GAAG,YAAY,MAAM,oBAAoB,eAAe,KAAG,OAAO,CAAC,IAAI,CAwC/G,CAAA;AAED,eAAO,MAAM,oBAAoB,cACpB,QAAQ,GAAG,SAAS,cACnB,sBAAsB,KACjC,UAAU,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAwIxC,CAAA"}
|
|
@@ -1,4 +1,38 @@
|
|
|
1
1
|
import { MutationError } from '../../../types';
|
|
2
|
+
export const setSystemLabel = async (tx, threadId, targetSpecialUse) => {
|
|
3
|
+
const thread = await tx.query.thread.where('id', threadId).one().run();
|
|
4
|
+
if (!thread) {
|
|
5
|
+
throw new Error(MutationError.ENTITY_NOT_FOUND);
|
|
6
|
+
}
|
|
7
|
+
const { accountId } = thread;
|
|
8
|
+
const targetLabel = await tx.query.accountLabel
|
|
9
|
+
.where('accountId', accountId)
|
|
10
|
+
.where('specialUse', targetSpecialUse)
|
|
11
|
+
.one()
|
|
12
|
+
.run();
|
|
13
|
+
if (!targetLabel) {
|
|
14
|
+
throw new Error(MutationError.ENTITY_NOT_FOUND);
|
|
15
|
+
}
|
|
16
|
+
const allThreadLabels = await tx.query.threadLabel.where('threadId', threadId).run();
|
|
17
|
+
let hasTarget = false;
|
|
18
|
+
for (const label of allThreadLabels) {
|
|
19
|
+
if (label.labelId === targetLabel.id) {
|
|
20
|
+
hasTarget = true;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
await tx.mutate.threadLabel.delete({
|
|
24
|
+
labelId: label.labelId,
|
|
25
|
+
threadId,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (!hasTarget) {
|
|
30
|
+
await tx.mutate.threadLabel.insert({
|
|
31
|
+
labelId: targetLabel.id,
|
|
32
|
+
threadId,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
};
|
|
2
36
|
export const createThreadMutators = (_authData, callbacks) => ({
|
|
3
37
|
addLabel: async (tx, args) => {
|
|
4
38
|
for (const threadId of args.threadIds) {
|
|
@@ -22,7 +56,7 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
22
56
|
});
|
|
23
57
|
}
|
|
24
58
|
}
|
|
25
|
-
|
|
59
|
+
callbacks?.addLabel?.(args);
|
|
26
60
|
},
|
|
27
61
|
delete: async (tx, args) => {
|
|
28
62
|
for (const threadId of args.threadIds) {
|
|
@@ -30,7 +64,7 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
30
64
|
id: threadId,
|
|
31
65
|
});
|
|
32
66
|
}
|
|
33
|
-
|
|
67
|
+
callbacks?.delete?.(args);
|
|
34
68
|
},
|
|
35
69
|
removeLabel: async (tx, args) => {
|
|
36
70
|
for (const threadId of args.threadIds) {
|
|
@@ -55,11 +89,10 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
55
89
|
threadId,
|
|
56
90
|
});
|
|
57
91
|
}
|
|
58
|
-
|
|
92
|
+
callbacks?.removeLabel?.(args);
|
|
59
93
|
},
|
|
60
94
|
requestAttachmentDownload: async (tx, args) => {
|
|
61
|
-
const
|
|
62
|
-
for (const attachmentId of attachmentIds) {
|
|
95
|
+
for (const attachmentId of args.attachmentIds) {
|
|
63
96
|
const attachment = await tx.query.threadMessageAttachment.where('id', attachmentId).one().run();
|
|
64
97
|
if (!attachment) {
|
|
65
98
|
throw new Error(MutationError.ENTITY_NOT_FOUND);
|
|
@@ -68,111 +101,29 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
68
101
|
id: attachmentId,
|
|
69
102
|
status: 'DOWNLOAD_REQUESTED',
|
|
70
103
|
});
|
|
71
|
-
|
|
104
|
+
callbacks?.requestAttachmentDownload?.(args);
|
|
72
105
|
}
|
|
73
106
|
},
|
|
74
107
|
setArchive: async (tx, args) => {
|
|
75
108
|
for (const threadId of args.threadIds) {
|
|
76
|
-
|
|
77
|
-
if (!thread) {
|
|
78
|
-
throw new Error(MutationError.ENTITY_NOT_FOUND);
|
|
79
|
-
}
|
|
80
|
-
const inboxLabel = await tx.query.accountLabel
|
|
81
|
-
.where('accountId', thread.accountId)
|
|
82
|
-
.where('specialUse', 'INBOX')
|
|
83
|
-
.one()
|
|
84
|
-
.run();
|
|
85
|
-
const archiveLabel = await tx.query.accountLabel
|
|
86
|
-
.where('accountId', thread.accountId)
|
|
87
|
-
.where('specialUse', 'ARCHIVE')
|
|
88
|
-
.one()
|
|
89
|
-
.run();
|
|
90
|
-
if (!inboxLabel || !archiveLabel) {
|
|
91
|
-
throw new Error(MutationError.ENTITY_NOT_FOUND);
|
|
92
|
-
}
|
|
93
|
-
if (inboxLabel) {
|
|
94
|
-
const existing = await tx.query.threadLabel
|
|
95
|
-
.where('threadId', threadId)
|
|
96
|
-
.where('labelId', inboxLabel.id)
|
|
97
|
-
.one()
|
|
98
|
-
.run();
|
|
99
|
-
if (existing) {
|
|
100
|
-
await tx.mutate.threadLabel.delete({
|
|
101
|
-
labelId: inboxLabel.id,
|
|
102
|
-
threadId,
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
if (archiveLabel) {
|
|
107
|
-
const existing = await tx.query.threadLabel
|
|
108
|
-
.where('threadId', threadId)
|
|
109
|
-
.where('labelId', archiveLabel.id)
|
|
110
|
-
.one()
|
|
111
|
-
.run();
|
|
112
|
-
if (!existing) {
|
|
113
|
-
await tx.mutate.threadLabel.insert({
|
|
114
|
-
labelId: archiveLabel.id,
|
|
115
|
-
threadId,
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
109
|
+
await setSystemLabel(tx, threadId, 'ARCHIVE');
|
|
119
110
|
}
|
|
120
|
-
|
|
111
|
+
callbacks?.setArchive?.(args);
|
|
121
112
|
},
|
|
122
113
|
setFlagged: async (tx, args) => {
|
|
123
|
-
const
|
|
124
|
-
for (const threadId of threadIds) {
|
|
114
|
+
for (const threadId of args.threadIds) {
|
|
125
115
|
await tx.mutate.thread.update({
|
|
126
116
|
flagged: args.flagged,
|
|
127
117
|
id: threadId,
|
|
128
118
|
});
|
|
129
119
|
}
|
|
130
|
-
|
|
120
|
+
callbacks?.setFlagged?.(args);
|
|
131
121
|
},
|
|
132
122
|
setInbox: async (tx, args) => {
|
|
133
123
|
for (const threadId of args.threadIds) {
|
|
134
|
-
|
|
135
|
-
if (!thread) {
|
|
136
|
-
throw new Error(MutationError.ENTITY_NOT_FOUND);
|
|
137
|
-
}
|
|
138
|
-
const inboxLabel = await tx.query.accountLabel
|
|
139
|
-
.where('accountId', thread.accountId)
|
|
140
|
-
.where('specialUse', 'INBOX')
|
|
141
|
-
.one()
|
|
142
|
-
.run();
|
|
143
|
-
const archiveLabel = await tx.query.accountLabel
|
|
144
|
-
.where('accountId', thread.accountId)
|
|
145
|
-
.where('specialUse', 'ARCHIVE')
|
|
146
|
-
.one()
|
|
147
|
-
.run();
|
|
148
|
-
if (archiveLabel) {
|
|
149
|
-
const existing = await tx.query.threadLabel
|
|
150
|
-
.where('threadId', threadId)
|
|
151
|
-
.where('labelId', archiveLabel.id)
|
|
152
|
-
.one()
|
|
153
|
-
.run();
|
|
154
|
-
if (existing) {
|
|
155
|
-
await tx.mutate.threadLabel.delete({
|
|
156
|
-
labelId: archiveLabel.id,
|
|
157
|
-
threadId,
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
if (inboxLabel) {
|
|
162
|
-
const existing = await tx.query.threadLabel
|
|
163
|
-
.where('threadId', threadId)
|
|
164
|
-
.where('labelId', inboxLabel.id)
|
|
165
|
-
.one()
|
|
166
|
-
.run();
|
|
167
|
-
if (!existing) {
|
|
168
|
-
await tx.mutate.threadLabel.insert({
|
|
169
|
-
labelId: inboxLabel.id,
|
|
170
|
-
threadId,
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
}
|
|
124
|
+
await setSystemLabel(tx, threadId, 'INBOX');
|
|
174
125
|
}
|
|
175
|
-
|
|
126
|
+
callbacks?.setInbox?.(args);
|
|
176
127
|
},
|
|
177
128
|
setSeen: async (tx, args) => {
|
|
178
129
|
for (const threadId of args.threadIds) {
|
|
@@ -181,58 +132,18 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
181
132
|
seen: args.seen,
|
|
182
133
|
});
|
|
183
134
|
}
|
|
184
|
-
|
|
135
|
+
callbacks?.setSeen?.(args);
|
|
185
136
|
},
|
|
186
137
|
setSpam: async (tx, args) => {
|
|
187
138
|
for (const threadId of args.threadIds) {
|
|
188
|
-
|
|
189
|
-
if (!thread) {
|
|
190
|
-
throw new Error(MutationError.ENTITY_NOT_FOUND);
|
|
191
|
-
}
|
|
192
|
-
const spamLabel = await tx.query.accountLabel
|
|
193
|
-
.where('accountId', thread.accountId)
|
|
194
|
-
.where('specialUse', 'SPAM')
|
|
195
|
-
.one()
|
|
196
|
-
.run();
|
|
197
|
-
if (!spamLabel) {
|
|
198
|
-
throw new Error(MutationError.ENTITY_NOT_FOUND);
|
|
199
|
-
}
|
|
200
|
-
const existing = await tx.query.threadLabel.where('threadId', threadId).where('labelId', spamLabel.id).one().run();
|
|
201
|
-
if (!existing) {
|
|
202
|
-
await tx.mutate.threadLabel.insert({
|
|
203
|
-
labelId: spamLabel.id,
|
|
204
|
-
threadId,
|
|
205
|
-
});
|
|
206
|
-
}
|
|
139
|
+
await setSystemLabel(tx, threadId, 'SPAM');
|
|
207
140
|
}
|
|
208
|
-
|
|
141
|
+
callbacks?.setSpam?.(args);
|
|
209
142
|
},
|
|
210
143
|
setTrash: async (tx, args) => {
|
|
211
144
|
for (const threadId of args.threadIds) {
|
|
212
|
-
|
|
213
|
-
if (!thread) {
|
|
214
|
-
throw new Error(MutationError.ENTITY_NOT_FOUND);
|
|
215
|
-
}
|
|
216
|
-
const trashLabel = await tx.query.accountLabel
|
|
217
|
-
.where('accountId', thread.accountId)
|
|
218
|
-
.where('specialUse', 'TRASH')
|
|
219
|
-
.one()
|
|
220
|
-
.run();
|
|
221
|
-
if (!trashLabel) {
|
|
222
|
-
throw new Error(MutationError.ENTITY_NOT_FOUND);
|
|
223
|
-
}
|
|
224
|
-
const existing = await tx.query.threadLabel
|
|
225
|
-
.where('threadId', threadId)
|
|
226
|
-
.where('labelId', trashLabel.id)
|
|
227
|
-
.one()
|
|
228
|
-
.run();
|
|
229
|
-
if (!existing) {
|
|
230
|
-
await tx.mutate.threadLabel.insert({
|
|
231
|
-
labelId: trashLabel.id,
|
|
232
|
-
threadId,
|
|
233
|
-
});
|
|
234
|
-
}
|
|
145
|
+
await setSystemLabel(tx, threadId, 'TRASH');
|
|
235
146
|
}
|
|
236
|
-
|
|
147
|
+
callbacks?.setTrash?.(args);
|
|
237
148
|
},
|
|
238
149
|
});
|
|
@@ -158,8 +158,8 @@ describe('threadMutators', () => {
|
|
|
158
158
|
};
|
|
159
159
|
const mutators = createMutators();
|
|
160
160
|
await mutators.thread.requestAttachmentDownload(transaction, {
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
attachmentIds: ['test-attachment-id-1'],
|
|
162
|
+
threadIds: ['test-thread-id-1'],
|
|
163
163
|
});
|
|
164
164
|
expect(attachmentUpdate).toHaveBeenCalledWith({
|
|
165
165
|
id: 'test-attachment-id-1',
|
|
@@ -169,17 +169,10 @@ describe('threadMutators', () => {
|
|
|
169
169
|
});
|
|
170
170
|
describe('setArchive', () => {
|
|
171
171
|
it('archives thread', async () => {
|
|
172
|
-
let labelQueryCount = 0;
|
|
173
|
-
let threadLabelQueryCount = 0;
|
|
174
172
|
const threadRecord = {
|
|
175
173
|
accountId: 'test-account-id-1',
|
|
176
174
|
id: 'test-thread-id-1',
|
|
177
175
|
};
|
|
178
|
-
const inboxLabel = {
|
|
179
|
-
accountId: 'test-account-id-1',
|
|
180
|
-
id: 'test-inbox-label-id',
|
|
181
|
-
specialUse: 'INBOX',
|
|
182
|
-
};
|
|
183
176
|
const archiveLabel = {
|
|
184
177
|
accountId: 'test-account-id-1',
|
|
185
178
|
id: 'test-archive-label-id',
|
|
@@ -188,22 +181,12 @@ describe('threadMutators', () => {
|
|
|
188
181
|
const runThread = mock(async () => threadRecord);
|
|
189
182
|
const oneThread = mock(() => ({ run: runThread }));
|
|
190
183
|
const whereThread = mock(() => ({ one: oneThread }));
|
|
191
|
-
const runLabel = mock(async () =>
|
|
192
|
-
const result = labelQueryCount === 0 ? inboxLabel : archiveLabel;
|
|
193
|
-
labelQueryCount++;
|
|
194
|
-
return result;
|
|
195
|
-
});
|
|
184
|
+
const runLabel = mock(async () => archiveLabel);
|
|
196
185
|
const oneLabel = mock(() => ({ run: runLabel }));
|
|
197
186
|
const whereSpecialUse = mock(() => ({ one: oneLabel }));
|
|
198
187
|
const whereLabelAccount = mock(() => ({ where: whereSpecialUse }));
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
threadLabelQueryCount++;
|
|
202
|
-
return result;
|
|
203
|
-
});
|
|
204
|
-
const oneExisting = mock(() => ({ run: runExisting }));
|
|
205
|
-
const whereLabel = mock(() => ({ one: oneExisting }));
|
|
206
|
-
const whereThreadLabel = mock(() => ({ where: whereLabel }));
|
|
188
|
+
const runAllThreadLabels = mock(async () => [{ labelId: 'test-inbox-label-id', threadId: 'test-thread-id-1' }]);
|
|
189
|
+
const whereThreadLabel = mock(() => ({ run: runAllThreadLabels }));
|
|
207
190
|
const threadLabelDelete = mock(async () => { });
|
|
208
191
|
const threadLabelInsert = mock(async () => { });
|
|
209
192
|
const transaction = {
|
|
@@ -253,7 +236,7 @@ describe('threadMutators', () => {
|
|
|
253
236
|
const mutators = createMutators();
|
|
254
237
|
await mutators.thread.setFlagged(transaction, {
|
|
255
238
|
flagged: true,
|
|
256
|
-
|
|
239
|
+
threadIds: ['test-thread-id-1'],
|
|
257
240
|
});
|
|
258
241
|
expect(threadUpdate).toHaveBeenCalledWith({
|
|
259
242
|
flagged: true,
|
|
@@ -263,8 +246,6 @@ describe('threadMutators', () => {
|
|
|
263
246
|
});
|
|
264
247
|
describe('setInbox', () => {
|
|
265
248
|
it('moves thread to inbox', async () => {
|
|
266
|
-
let labelQueryCount = 0;
|
|
267
|
-
let threadLabelQueryCount = 0;
|
|
268
249
|
const threadRecord = {
|
|
269
250
|
accountId: 'test-account-id-1',
|
|
270
251
|
id: 'test-thread-id-1',
|
|
@@ -274,30 +255,15 @@ describe('threadMutators', () => {
|
|
|
274
255
|
id: 'test-inbox-label-id',
|
|
275
256
|
specialUse: 'INBOX',
|
|
276
257
|
};
|
|
277
|
-
const archiveLabel = {
|
|
278
|
-
accountId: 'test-account-id-1',
|
|
279
|
-
id: 'test-archive-label-id',
|
|
280
|
-
specialUse: 'ARCHIVE',
|
|
281
|
-
};
|
|
282
258
|
const runThread = mock(async () => threadRecord);
|
|
283
259
|
const oneThread = mock(() => ({ run: runThread }));
|
|
284
260
|
const whereThread = mock(() => ({ one: oneThread }));
|
|
285
|
-
const runLabel = mock(async () =>
|
|
286
|
-
const result = labelQueryCount === 0 ? inboxLabel : archiveLabel;
|
|
287
|
-
labelQueryCount++;
|
|
288
|
-
return result;
|
|
289
|
-
});
|
|
261
|
+
const runLabel = mock(async () => inboxLabel);
|
|
290
262
|
const oneLabel = mock(() => ({ run: runLabel }));
|
|
291
263
|
const whereSpecialUse = mock(() => ({ one: oneLabel }));
|
|
292
264
|
const whereLabelAccount = mock(() => ({ where: whereSpecialUse }));
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
threadLabelQueryCount++;
|
|
296
|
-
return result;
|
|
297
|
-
});
|
|
298
|
-
const oneExisting = mock(() => ({ run: runExisting }));
|
|
299
|
-
const whereLabel = mock(() => ({ one: oneExisting }));
|
|
300
|
-
const whereThreadLabel = mock(() => ({ where: whereLabel }));
|
|
265
|
+
const runAllThreadLabels = mock(async () => [{ labelId: 'test-archive-label-id', threadId: 'test-thread-id-1' }]);
|
|
266
|
+
const whereThreadLabel = mock(() => ({ run: runAllThreadLabels }));
|
|
301
267
|
const threadLabelDelete = mock(async () => { });
|
|
302
268
|
const threadLabelInsert = mock(async () => { });
|
|
303
269
|
const transaction = {
|
|
@@ -378,10 +344,8 @@ describe('threadMutators', () => {
|
|
|
378
344
|
const oneLabel = mock(() => ({ run: runSpam }));
|
|
379
345
|
const whereSpecialUse = mock(() => ({ one: oneLabel }));
|
|
380
346
|
const whereLabelAccount = mock(() => ({ where: whereSpecialUse }));
|
|
381
|
-
const
|
|
382
|
-
const
|
|
383
|
-
const whereLabel = mock(() => ({ one: oneExisting }));
|
|
384
|
-
const whereThreadLabel = mock(() => ({ where: whereLabel }));
|
|
347
|
+
const runAllThreadLabels = mock(async () => []);
|
|
348
|
+
const whereThreadLabel = mock(() => ({ run: runAllThreadLabels }));
|
|
385
349
|
const threadLabelInsert = mock(async () => { });
|
|
386
350
|
const transaction = {
|
|
387
351
|
mutate: {
|
|
@@ -429,10 +393,8 @@ describe('threadMutators', () => {
|
|
|
429
393
|
const oneLabel = mock(() => ({ run: runTrash }));
|
|
430
394
|
const whereSpecialUse = mock(() => ({ one: oneLabel }));
|
|
431
395
|
const whereLabelAccount = mock(() => ({ where: whereSpecialUse }));
|
|
432
|
-
const
|
|
433
|
-
const
|
|
434
|
-
const whereLabel = mock(() => ({ one: oneExisting }));
|
|
435
|
-
const whereThreadLabel = mock(() => ({ where: whereLabel }));
|
|
396
|
+
const runAllThreadLabels = mock(async () => []);
|
|
397
|
+
const whereThreadLabel = mock(() => ({ run: runAllThreadLabels }));
|
|
436
398
|
const threadLabelInsert = mock(async () => { });
|
|
437
399
|
const transaction = {
|
|
438
400
|
mutate: {
|
|
@@ -3,14 +3,14 @@ export const createUserMutators = (_authData, callbacks) => ({
|
|
|
3
3
|
await tx.mutate.userPushNotificationToken.delete({
|
|
4
4
|
id: args.id,
|
|
5
5
|
});
|
|
6
|
-
|
|
6
|
+
callbacks?.deleteSettingsPushNotificationToken?.(args);
|
|
7
7
|
},
|
|
8
8
|
setSettingsName: async (tx, args) => {
|
|
9
9
|
await tx.mutate.user.update({
|
|
10
10
|
id: args.id,
|
|
11
11
|
name: args.name,
|
|
12
12
|
});
|
|
13
|
-
|
|
13
|
+
callbacks?.setSettingsName?.(args);
|
|
14
14
|
},
|
|
15
15
|
setSettingsPushNotificationToken: async (tx, args) => {
|
|
16
16
|
const existing = await tx.query.userPushNotificationToken
|
|
@@ -25,7 +25,7 @@ export const createUserMutators = (_authData, callbacks) => ({
|
|
|
25
25
|
token: args.pushNotificationToken.token,
|
|
26
26
|
userId: args.id,
|
|
27
27
|
});
|
|
28
|
-
|
|
28
|
+
callbacks?.setSettingsPushNotificationToken?.(args);
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
});
|