@marcoappio/marco-config 2.0.427 → 2.0.428
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/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/types/AuthData.d.ts +4 -0
- package/dist/types/AuthData.d.ts.map +1 -0
- package/dist/types/AuthData.js +1 -0
- package/dist/types/Zero.d.ts +18 -0
- package/dist/types/Zero.d.ts.map +1 -1
- package/dist/types/Zero.js +5 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/zero/index.d.ts +176 -184
- package/dist/zero/index.d.ts.map +1 -1
- package/dist/zero/index.js +0 -7
- package/dist/zero/{mutators → mutatorSchemas}/account.d.ts +4 -33
- package/dist/zero/mutatorSchemas/account.d.ts.map +1 -0
- package/dist/zero/{mutators → mutatorSchemas}/account.js +4 -7
- package/dist/zero/{mutators → mutatorSchemas}/draft.d.ts +1 -1
- package/dist/zero/{mutators → mutatorSchemas}/draft.d.ts.map +1 -1
- package/dist/zero/{mutators → mutatorSchemas}/draft.js +1 -1
- package/dist/zero/mutatorSchemas/index.d.ts +5 -0
- package/dist/zero/mutatorSchemas/index.d.ts.map +1 -0
- package/dist/zero/mutatorSchemas/index.js +4 -0
- package/dist/zero/{mutators → mutatorSchemas}/thread.d.ts +13 -26
- package/dist/zero/mutatorSchemas/thread.d.ts.map +1 -0
- package/dist/zero/{mutators → mutatorSchemas}/thread.js +13 -24
- package/dist/zero/{mutators → mutatorSchemas}/user.d.ts +1 -7
- package/dist/zero/mutatorSchemas/user.d.ts.map +1 -0
- package/dist/zero/{mutators → mutatorSchemas}/user.js +1 -7
- package/dist/zero/mutators/accountMutators/accountMutators.d.ts +8 -0
- package/dist/zero/mutators/accountMutators/accountMutators.d.ts.map +1 -0
- package/dist/zero/mutators/accountMutators/accountMutators.js +112 -0
- package/dist/zero/mutators/accountMutators/accountMutators.test.d.ts +2 -0
- package/dist/zero/mutators/accountMutators/accountMutators.test.d.ts.map +1 -0
- package/dist/zero/mutators/accountMutators/accountMutators.test.js +390 -0
- package/dist/zero/mutators/accountMutators/index.d.ts +2 -0
- package/dist/zero/mutators/accountMutators/index.d.ts.map +1 -0
- package/dist/zero/mutators/accountMutators/index.js +1 -0
- package/dist/zero/mutators/draftMutators/draftMutators.d.ts +8 -0
- package/dist/zero/mutators/draftMutators/draftMutators.d.ts.map +1 -0
- package/dist/zero/mutators/draftMutators/draftMutators.js +162 -0
- package/dist/zero/mutators/draftMutators/draftMutators.test.d.ts +2 -0
- package/dist/zero/mutators/draftMutators/draftMutators.test.d.ts.map +1 -0
- package/dist/zero/mutators/draftMutators/draftMutators.test.js +390 -0
- package/dist/zero/mutators/draftMutators/index.d.ts +2 -0
- package/dist/zero/mutators/draftMutators/index.d.ts.map +1 -0
- package/dist/zero/mutators/draftMutators/index.js +1 -0
- package/dist/zero/mutators/index.d.ts +6566 -0
- package/dist/zero/mutators/index.d.ts.map +1 -0
- package/dist/zero/mutators/index.js +17 -0
- package/dist/zero/mutators/mutators.d.ts +29 -0
- package/dist/zero/mutators/mutators.d.ts.map +1 -0
- package/dist/zero/{mutators.js → mutators/mutators.js} +10 -15
- package/dist/zero/mutators/threadMutators/index.d.ts +2 -0
- package/dist/zero/mutators/threadMutators/index.d.ts.map +1 -0
- package/dist/zero/mutators/threadMutators/index.js +1 -0
- package/dist/zero/mutators/threadMutators/threadMutators.d.ts +8 -0
- package/dist/zero/mutators/threadMutators/threadMutators.d.ts.map +1 -0
- package/dist/zero/mutators/threadMutators/threadMutators.js +238 -0
- package/dist/zero/mutators/threadMutators/threadMutators.test.d.ts +2 -0
- package/dist/zero/mutators/threadMutators/threadMutators.test.d.ts.map +1 -0
- package/dist/zero/mutators/threadMutators/threadMutators.test.js +465 -0
- package/dist/zero/mutators/userMutators/index.d.ts +2 -0
- package/dist/zero/mutators/userMutators/index.d.ts.map +1 -0
- package/dist/zero/mutators/userMutators/index.js +1 -0
- package/dist/zero/mutators/userMutators/userMutators.d.ts +8 -0
- package/dist/zero/mutators/userMutators/userMutators.d.ts.map +1 -0
- package/dist/zero/mutators/userMutators/userMutators.js +37 -0
- package/dist/zero/mutators/userMutators/userMutators.test.d.ts +2 -0
- package/dist/zero/mutators/userMutators/userMutators.test.d.ts.map +1 -0
- package/dist/zero/mutators/userMutators/userMutators.test.js +123 -0
- package/dist/zero/queries/getAccounts.d.ts +29 -29
- package/dist/zero/queries/getContacts.d.ts +29 -29
- package/dist/zero/queries/getDrafts.d.ts +29 -29
- package/dist/zero/queries/getThreads.d.ts +29 -29
- package/dist/zero/queries/getUser.d.ts +29 -29
- package/dist/zero/queries/index.d.ts +29 -29
- package/dist/zero/schema.d.ts +29 -29
- package/package.json +1 -1
- package/dist/zero/mutators/account.d.ts.map +0 -1
- package/dist/zero/mutators/thread.d.ts.map +0 -1
- package/dist/zero/mutators/user.d.ts.map +0 -1
- package/dist/zero/mutators.d.ts +0 -412
- package/dist/zero/mutators.d.ts.map +0 -1
- package/dist/zero/mutators.test.d.ts +0 -2
- package/dist/zero/mutators.test.d.ts.map +0 -1
- package/dist/zero/mutators.test.js +0 -33
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/zero/mutators/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAHE,CAAA;AAEV,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,mCAAmC,CAAA;AAE1C,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createMutators } from '../../zero/mutators';
|
|
2
|
+
import { getAccounts, getContacts, getDrafts, getThreads, getUser } from '../../zero/queries';
|
|
3
|
+
import { schema, zeroTables } from '../../zero/schema';
|
|
4
|
+
export const marcoZero = {
|
|
5
|
+
createMutators,
|
|
6
|
+
queries: {
|
|
7
|
+
getAccounts,
|
|
8
|
+
getContacts,
|
|
9
|
+
getDrafts,
|
|
10
|
+
getThreads,
|
|
11
|
+
getUser,
|
|
12
|
+
},
|
|
13
|
+
schema,
|
|
14
|
+
tables: zeroTables,
|
|
15
|
+
};
|
|
16
|
+
export { accountMutatorSchemas, draftMutatorSchemas, threadMutatorSchemas, userMutatorSchemas, } from '../../zero/mutatorSchemas';
|
|
17
|
+
export { createMutators, ZeroMutatorValidationError } from './mutators';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import type { MutatorMap } from '../../types';
|
|
3
|
+
import { accountMutatorSchemas, draftMutatorSchemas, threadMutatorSchemas, userMutatorSchemas } from '../../zero/mutatorSchemas';
|
|
4
|
+
import { type AccountMutatorCallbacks } from './accountMutators';
|
|
5
|
+
import { type DraftMutatorCallbacks } from './draftMutators';
|
|
6
|
+
import { type ThreadMutatorCallbacks } from './threadMutators';
|
|
7
|
+
import { type UserMutatorCallbacks } from './userMutators';
|
|
8
|
+
export type MutatorCallbacks = {
|
|
9
|
+
account?: AccountMutatorCallbacks;
|
|
10
|
+
draft?: DraftMutatorCallbacks;
|
|
11
|
+
thread?: ThreadMutatorCallbacks;
|
|
12
|
+
user?: UserMutatorCallbacks;
|
|
13
|
+
};
|
|
14
|
+
export declare class ZeroMutatorValidationError extends Error {
|
|
15
|
+
readonly issues: ReturnType<typeof v.flatten>;
|
|
16
|
+
constructor(issues: ReturnType<typeof v.flatten>);
|
|
17
|
+
}
|
|
18
|
+
export type MarcoZeroMutators = {
|
|
19
|
+
account: MutatorMap<typeof accountMutatorSchemas>;
|
|
20
|
+
draft: MutatorMap<typeof draftMutatorSchemas>;
|
|
21
|
+
thread: MutatorMap<typeof threadMutatorSchemas>;
|
|
22
|
+
user: MutatorMap<typeof userMutatorSchemas>;
|
|
23
|
+
};
|
|
24
|
+
export declare const createMutators: (authData?: AuthData, callbacks?: MutatorCallbacks) => MarcoZeroMutators;
|
|
25
|
+
export type { AccountMutatorCallbacks, DraftMutatorCallbacks, ThreadMutatorCallbacks, UserMutatorCallbacks };
|
|
26
|
+
export type AuthData = {
|
|
27
|
+
sub: string;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=mutators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutators.d.ts","sourceRoot":"","sources":["../../../src/zero/mutators/mutators.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,OAAO,KAAK,EAAkD,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrG,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,mCAAmC,CAAA;AAG1C,OAAO,EAAE,KAAK,uBAAuB,EAAyB,MAAM,mBAAmB,CAAA;AACvF,OAA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orSchemas, } from '../../zero/mutatorSchemas';
|
|
3
|
+
import { createAccountMutators } from './accountMutators';
|
|
4
|
+
import { createDraftMutators } from './draftMutators';
|
|
5
|
+
import { createThreadMutators } from './threadMutators';
|
|
6
|
+
import { createUserMutators } from './userMutators';
|
|
6
7
|
const validateArgs = (schema, input) => {
|
|
7
8
|
const parsed = v.safeParse(schema, input);
|
|
8
9
|
if (!parsed.success) {
|
|
@@ -30,15 +31,9 @@ export class ZeroMutatorValidationError extends Error {
|
|
|
30
31
|
this.issues = issues;
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
|
-
export const
|
|
34
|
-
account:
|
|
35
|
-
draft:
|
|
36
|
-
thread:
|
|
37
|
-
user:
|
|
38
|
-
};
|
|
39
|
-
export const createMutators = (handlers) => ({
|
|
40
|
-
account: buildMutatorMap(zeroMutatorSchemas.account, handlers.account),
|
|
41
|
-
draft: buildMutatorMap(zeroMutatorSchemas.draft, handlers.draft),
|
|
42
|
-
thread: buildMutatorMap(zeroMutatorSchemas.thread, handlers.thread),
|
|
43
|
-
user: buildMutatorMap(zeroMutatorSchemas.user, handlers.user),
|
|
34
|
+
export const createMutators = (authData, callbacks) => ({
|
|
35
|
+
account: buildMutatorMap(accountMutatorSchemas, createAccountMutators(authData, callbacks?.account)),
|
|
36
|
+
draft: buildMutatorMap(draftMutatorSchemas, createDraftMutators(authData, callbacks?.draft)),
|
|
37
|
+
thread: buildMutatorMap(threadMutatorSchemas, createThreadMutators(authData, callbacks?.thread)),
|
|
38
|
+
user: buildMutatorMap(userMutatorSchemas, createUserMutators(authData, callbacks?.user)),
|
|
44
39
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/zero/mutators/threadMutators/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './threadMutators';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as v from 'valibot';
|
|
2
|
+
import { type AuthData, type HandlerMap } from '../../../types';
|
|
3
|
+
import type { threadMutatorSchemas } from '../../../zero/mutatorSchemas';
|
|
4
|
+
export type ThreadMutatorCallbacks = {
|
|
5
|
+
[K in keyof typeof threadMutatorSchemas]?: (args: v.InferOutput<(typeof threadMutatorSchemas)[K]['delta']>) => Promise<void>;
|
|
6
|
+
};
|
|
7
|
+
export declare const createThreadMutators: (_authData: AuthData | undefined, callbacks?: ThreadMutatorCallbacks) => HandlerMap<typeof threadMutatorSchemas>;
|
|
8
|
+
//# sourceMappingURL=threadMutators.d.ts.map
|
|
@@ -0,0 +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,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AAE7E,MAAM,MAAM,sBAAsB,GAAG;KAClC,CAAC,IAAI,MAAM,OAAO,oBAAoB,CAAC,CAAC,EAAE,CACzC,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,KAC3D,OAAO,CAAC,IAAI,CAAC;CACnB,CAAA;AAED,eAAO,MAAM,oBAAoB,cACpB,QAAQ,GAAG,SAAS,cACnB,sBAAsB,KACjC,UAAU,CAAC,OAAO,oBAAoB,CA8RvC,CAAA"}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { MutationError } from '../../../types';
|
|
2
|
+
export const createThreadMutators = (_authData, callbacks) => ({
|
|
3
|
+
addLabel: async (tx, args) => {
|
|
4
|
+
for (const threadId of args.threadIds) {
|
|
5
|
+
const thread = await tx.query.thread.where('id', threadId).one().run();
|
|
6
|
+
if (!thread) {
|
|
7
|
+
throw new Error(MutationError.ENTITY_NOT_FOUND);
|
|
8
|
+
}
|
|
9
|
+
const label = await tx.query.accountLabel
|
|
10
|
+
.where('accountId', thread.accountId)
|
|
11
|
+
.where('path', args.labelPath)
|
|
12
|
+
.one()
|
|
13
|
+
.run();
|
|
14
|
+
if (!label) {
|
|
15
|
+
throw new Error(MutationError.ENTITY_NOT_FOUND);
|
|
16
|
+
}
|
|
17
|
+
const existing = await tx.query.threadLabel.where('threadId', threadId).where('labelId', label.id).one().run();
|
|
18
|
+
if (!existing) {
|
|
19
|
+
await tx.mutate.threadLabel.insert({
|
|
20
|
+
labelId: label.id,
|
|
21
|
+
threadId,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
await callbacks?.addLabel?.(args);
|
|
26
|
+
},
|
|
27
|
+
delete: async (tx, args) => {
|
|
28
|
+
for (const threadId of args.threadIds) {
|
|
29
|
+
await tx.mutate.thread.delete({
|
|
30
|
+
id: threadId,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
await callbacks?.delete?.(args);
|
|
34
|
+
},
|
|
35
|
+
removeLabel: async (tx, args) => {
|
|
36
|
+
for (const threadId of args.threadIds) {
|
|
37
|
+
const thread = await tx.query.thread.where('id', threadId).one().run();
|
|
38
|
+
if (!thread) {
|
|
39
|
+
throw new Error(MutationError.ENTITY_NOT_FOUND);
|
|
40
|
+
}
|
|
41
|
+
const label = await tx.query.accountLabel
|
|
42
|
+
.where('accountId', thread.accountId)
|
|
43
|
+
.where('path', args.labelPath)
|
|
44
|
+
.one()
|
|
45
|
+
.run();
|
|
46
|
+
if (!label) {
|
|
47
|
+
throw new Error(MutationError.ENTITY_NOT_FOUND);
|
|
48
|
+
}
|
|
49
|
+
const existing = await tx.query.threadLabel.where('threadId', threadId).where('labelId', label.id).one().run();
|
|
50
|
+
if (!existing) {
|
|
51
|
+
throw new Error(MutationError.ENTITY_NOT_FOUND);
|
|
52
|
+
}
|
|
53
|
+
await tx.mutate.threadLabel.delete({
|
|
54
|
+
labelId: label.id,
|
|
55
|
+
threadId,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
await callbacks?.removeLabel?.(args);
|
|
59
|
+
},
|
|
60
|
+
requestAttachmentDownload: async (tx, args) => {
|
|
61
|
+
const attachmentIds = 'attachmentIds' in args ? args.attachmentIds : [args.attachmentId];
|
|
62
|
+
for (const attachmentId of attachmentIds) {
|
|
63
|
+
const attachment = await tx.query.threadMessageAttachment.where('id', attachmentId).one().run();
|
|
64
|
+
if (!attachment) {
|
|
65
|
+
throw new Error(MutationError.ENTITY_NOT_FOUND);
|
|
66
|
+
}
|
|
67
|
+
await tx.mutate.threadMessageAttachment.update({
|
|
68
|
+
id: attachmentId,
|
|
69
|
+
status: 'DOWNLOAD_REQUESTED',
|
|
70
|
+
});
|
|
71
|
+
await callbacks?.requestAttachmentDownload?.(args);
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
setArchive: async (tx, args) => {
|
|
75
|
+
for (const threadId of args.threadIds) {
|
|
76
|
+
const thread = await tx.query.thread.where('id', threadId).one().run();
|
|
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
|
+
}
|
|
119
|
+
}
|
|
120
|
+
await callbacks?.setArchive?.(args);
|
|
121
|
+
},
|
|
122
|
+
setFlagged: async (tx, args) => {
|
|
123
|
+
const threadIds = 'threadId' in args ? [args.threadId] : args.threadIds;
|
|
124
|
+
for (const threadId of threadIds) {
|
|
125
|
+
await tx.mutate.thread.update({
|
|
126
|
+
flagged: args.flagged,
|
|
127
|
+
id: threadId,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
await callbacks?.setFlagged?.(args);
|
|
131
|
+
},
|
|
132
|
+
setInbox: async (tx, args) => {
|
|
133
|
+
for (const threadId of args.threadIds) {
|
|
134
|
+
const thread = await tx.query.thread.where('id', threadId).one().run();
|
|
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
|
+
}
|
|
174
|
+
}
|
|
175
|
+
await callbacks?.setInbox?.(args);
|
|
176
|
+
},
|
|
177
|
+
setSeen: async (tx, args) => {
|
|
178
|
+
for (const threadId of args.threadIds) {
|
|
179
|
+
await tx.mutate.thread.update({
|
|
180
|
+
id: threadId,
|
|
181
|
+
seen: args.seen,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
await callbacks?.setSeen?.(args);
|
|
185
|
+
},
|
|
186
|
+
setSpam: async (tx, args) => {
|
|
187
|
+
for (const threadId of args.threadIds) {
|
|
188
|
+
const thread = await tx.query.thread.where('id', threadId).one().run();
|
|
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
|
+
}
|
|
207
|
+
}
|
|
208
|
+
await callbacks?.setSpam?.(args);
|
|
209
|
+
},
|
|
210
|
+
setTrash: async (tx, args) => {
|
|
211
|
+
for (const threadId of args.threadIds) {
|
|
212
|
+
const thread = await tx.query.thread.where('id', threadId).one().run();
|
|
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
|
+
}
|
|
235
|
+
}
|
|
236
|
+
await callbacks?.setTrash?.(args);
|
|
237
|
+
},
|
|
238
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"threadMutators.test.d.ts","sourceRoot":"","sources":["../../../../src/zero/mutators/threadMutators/threadMutators.test.ts"],"names":[],"mappings":""}
|