@marcoappio/marco-config 2.0.441 → 2.0.442
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/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.js +10 -10
- package/dist/zero/mutators/userMutators/userMutators.js +3 -3
- package/package.json +1 -1
|
@@ -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
|
});
|
|
@@ -22,7 +22,7 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
callbacks?.addLabel?.(args);
|
|
26
26
|
},
|
|
27
27
|
delete: async (tx, args) => {
|
|
28
28
|
for (const threadId of args.threadIds) {
|
|
@@ -30,7 +30,7 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
30
30
|
id: threadId,
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
callbacks?.delete?.(args);
|
|
34
34
|
},
|
|
35
35
|
removeLabel: async (tx, args) => {
|
|
36
36
|
for (const threadId of args.threadIds) {
|
|
@@ -55,7 +55,7 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
55
55
|
threadId,
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
callbacks?.removeLabel?.(args);
|
|
59
59
|
},
|
|
60
60
|
requestAttachmentDownload: async (tx, args) => {
|
|
61
61
|
const attachmentIds = 'attachmentIds' in args ? args.attachmentIds : [args.attachmentId];
|
|
@@ -68,7 +68,7 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
68
68
|
id: attachmentId,
|
|
69
69
|
status: 'DOWNLOAD_REQUESTED',
|
|
70
70
|
});
|
|
71
|
-
|
|
71
|
+
callbacks?.requestAttachmentDownload?.(args);
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
setArchive: async (tx, args) => {
|
|
@@ -117,7 +117,7 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
|
|
120
|
+
callbacks?.setArchive?.(args);
|
|
121
121
|
},
|
|
122
122
|
setFlagged: async (tx, args) => {
|
|
123
123
|
const threadIds = 'threadId' in args ? [args.threadId] : args.threadIds;
|
|
@@ -127,7 +127,7 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
127
127
|
id: threadId,
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
|
|
130
|
+
callbacks?.setFlagged?.(args);
|
|
131
131
|
},
|
|
132
132
|
setInbox: async (tx, args) => {
|
|
133
133
|
for (const threadId of args.threadIds) {
|
|
@@ -172,7 +172,7 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
|
|
175
|
+
callbacks?.setInbox?.(args);
|
|
176
176
|
},
|
|
177
177
|
setSeen: async (tx, args) => {
|
|
178
178
|
for (const threadId of args.threadIds) {
|
|
@@ -181,7 +181,7 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
181
181
|
seen: args.seen,
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
|
-
|
|
184
|
+
callbacks?.setSeen?.(args);
|
|
185
185
|
},
|
|
186
186
|
setSpam: async (tx, args) => {
|
|
187
187
|
for (const threadId of args.threadIds) {
|
|
@@ -205,7 +205,7 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
205
205
|
});
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
|
|
208
|
+
callbacks?.setSpam?.(args);
|
|
209
209
|
},
|
|
210
210
|
setTrash: async (tx, args) => {
|
|
211
211
|
for (const threadId of args.threadIds) {
|
|
@@ -233,6 +233,6 @@ export const createThreadMutators = (_authData, callbacks) => ({
|
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
|
|
236
|
+
callbacks?.setTrash?.(args);
|
|
237
237
|
},
|
|
238
238
|
});
|
|
@@ -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
|
});
|