@marcoappio/marco-config 2.0.504 → 2.0.506
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/schemas/auth.d.ts +1 -1
- package/dist/schemas/index.d.ts +2 -2
- package/dist/schemas/string.d.ts +1 -1
- package/dist/schemas/string.d.ts.map +1 -1
- package/dist/schemas/string.js +4 -1
- package/dist/sdk/endpoints/index.d.ts +4 -4
- package/dist/sdk/endpoints/public/auth/index.d.ts +4 -4
- package/dist/sdk/endpoints/public/auth/refreshAuth.d.ts +1 -1
- package/dist/sdk/endpoints/public/auth/sendAuthCode.d.ts +1 -1
- package/dist/sdk/endpoints/public/auth/verifyAuthCode.d.ts +2 -2
- package/dist/sdk/endpoints/public/index.d.ts +4 -4
- package/dist/sdk/index.d.ts +4 -4
- 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/IMAPSourceLocation.d.ts +7 -0
- package/dist/types/IMAPSourceLocation.d.ts.map +1 -0
- package/dist/types/IMAPSourceLocation.js +1 -0
- package/dist/types/Zero.d.ts +14 -8
- package/dist/types/Zero.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/zero/index.d.ts +7749 -3113
- package/dist/zero/index.d.ts.map +1 -1
- package/dist/zero/index.js +14 -5
- package/dist/zero/mutatorSchemas/account.d.ts +80 -0
- package/dist/zero/mutatorSchemas/account.d.ts.map +1 -0
- package/dist/zero/mutatorSchemas/account.js +66 -0
- package/dist/zero/mutatorSchemas/draft.d.ts +150 -0
- package/dist/zero/mutatorSchemas/draft.d.ts.map +1 -0
- package/dist/zero/mutatorSchemas/draft.js +104 -0
- package/dist/zero/mutatorSchemas/index.d.ts +323 -0
- package/dist/zero/mutatorSchemas/index.d.ts.map +1 -0
- package/dist/zero/mutatorSchemas/index.js +10 -0
- package/dist/zero/mutatorSchemas/thread.d.ts +71 -0
- package/dist/zero/mutatorSchemas/thread.d.ts.map +1 -0
- package/dist/zero/mutatorSchemas/thread.js +47 -0
- package/dist/zero/mutatorSchemas/user.d.ts +26 -0
- package/dist/zero/mutatorSchemas/user.d.ts.map +1 -0
- package/dist/zero/mutatorSchemas/user.js +27 -0
- package/dist/zero/mutators/accountMutators/accountMutators.d.ts +3 -188
- package/dist/zero/mutators/accountMutators/accountMutators.d.ts.map +1 -1
- package/dist/zero/mutators/accountMutators/accountMutators.js +82 -118
- 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 +372 -0
- package/dist/zero/mutators/accountMutators/index.d.ts +1 -1
- package/dist/zero/mutators/accountMutators/index.d.ts.map +1 -1
- package/dist/zero/mutators/accountMutators/index.js +1 -1
- package/dist/zero/mutators/draftMutators/draftMutators.d.ts +3 -305
- package/dist/zero/mutators/draftMutators/draftMutators.d.ts.map +1 -1
- package/dist/zero/mutators/draftMutators/draftMutators.js +83 -157
- 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 +416 -0
- package/dist/zero/mutators/draftMutators/index.d.ts +1 -1
- package/dist/zero/mutators/draftMutators/index.d.ts.map +1 -1
- package/dist/zero/mutators/draftMutators/index.js +1 -1
- package/dist/zero/mutators/index.d.ts +1 -251
- package/dist/zero/mutators/index.d.ts.map +1 -1
- package/dist/zero/mutators/index.js +1 -11
- package/dist/zero/mutators/mutators.d.ts +17 -1519
- package/dist/zero/mutators/mutators.d.ts.map +1 -1
- package/dist/zero/mutators/mutators.js +38 -11
- package/dist/zero/mutators/threadMutators/index.d.ts +1 -1
- package/dist/zero/mutators/threadMutators/index.d.ts.map +1 -1
- package/dist/zero/mutators/threadMutators/index.js +1 -1
- package/dist/zero/mutators/threadMutators/threadMutators.d.ts +6 -199
- package/dist/zero/mutators/threadMutators/threadMutators.d.ts.map +1 -1
- package/dist/zero/mutators/threadMutators/threadMutators.js +87 -119
- 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 +755 -0
- package/dist/zero/mutators/userMutators/index.d.ts +1 -1
- package/dist/zero/mutators/userMutators/index.d.ts.map +1 -1
- package/dist/zero/mutators/userMutators/index.js +1 -1
- package/dist/zero/mutators/userMutators/userMutators.d.ts +3 -56
- package/dist/zero/mutators/userMutators/userMutators.d.ts.map +1 -1
- package/dist/zero/mutators/userMutators/userMutators.js +26 -40
- 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 +84 -0
- package/dist/zero/queries/getAccounts.d.ts +1025 -4
- package/dist/zero/queries/getAccounts.d.ts.map +1 -1
- package/dist/zero/queries/getAccounts.js +3 -6
- package/dist/zero/queries/getContacts.d.ts +1033 -18
- package/dist/zero/queries/getContacts.d.ts.map +1 -1
- package/dist/zero/queries/getContacts.js +15 -11
- package/dist/zero/queries/getDrafts.d.ts +1031 -11
- package/dist/zero/queries/getDrafts.d.ts.map +1 -1
- package/dist/zero/queries/getDrafts.js +11 -7
- package/dist/zero/queries/getThread.d.ts +1028 -7
- package/dist/zero/queries/getThread.d.ts.map +1 -1
- package/dist/zero/queries/getThread.js +9 -5
- package/dist/zero/queries/getThreadList.d.ts +1035 -23
- package/dist/zero/queries/getThreadList.d.ts.map +1 -1
- package/dist/zero/queries/getThreadList.js +18 -14
- package/dist/zero/queries/getThreads.d.ts +1035 -23
- package/dist/zero/queries/getThreads.d.ts.map +1 -1
- package/dist/zero/queries/getThreads.js +18 -14
- package/dist/zero/queries/getUser.d.ts +1025 -4
- package/dist/zero/queries/getUser.d.ts.map +1 -1
- package/dist/zero/queries/getUser.js +7 -10
- package/dist/zero/queries/index.d.ts +141 -460
- package/dist/zero/queries/index.d.ts.map +1 -1
- package/dist/zero/queries/index.js +10 -18
- package/dist/zero/schema.d.ts +133 -133
- package/dist/zero/schema.d.ts.map +1 -1
- package/dist/zero/schema.js +1 -0
- package/package.json +3 -2
- package/dist/zero/crud.d.ts +0 -1024
- package/dist/zero/crud.d.ts.map +0 -1
- package/dist/zero/crud.js +0 -3
- package/dist/zero/mutators/typedMutator.d.ts +0 -2056
- package/dist/zero/mutators/typedMutator.d.ts.map +0 -1
- package/dist/zero/mutators/typedMutator.js +0 -2
- package/dist/zero/queries/z.d.ts +0 -14439
- package/dist/zero/queries/z.d.ts.map +0 -1
- package/dist/zero/queries/z.js +0 -3
|
@@ -1,189 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
readonly aliasId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
5
|
-
readonly color: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
6
|
-
readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
|
|
7
|
-
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
8
|
-
}, undefined>;
|
|
9
|
-
createAlias: v.ObjectSchema<{
|
|
10
|
-
readonly accountId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
11
|
-
readonly alias: v.ObjectSchema<{
|
|
12
|
-
readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
|
|
13
|
-
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
14
|
-
readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
15
|
-
}, undefined>;
|
|
16
|
-
}, undefined>;
|
|
17
|
-
deleteAccount: v.ObjectSchema<{
|
|
18
|
-
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
19
|
-
}, undefined>;
|
|
20
|
-
deleteAlias: v.ObjectSchema<{
|
|
21
|
-
readonly accountId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
22
|
-
readonly aliasId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
23
|
-
}, undefined>;
|
|
24
|
-
setAliasName: v.ObjectSchema<{
|
|
25
|
-
readonly accountId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
26
|
-
readonly aliasId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
27
|
-
readonly displayName: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
28
|
-
}, undefined>;
|
|
29
|
-
setAliasPrimary: v.ObjectSchema<{
|
|
30
|
-
readonly accountId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
31
|
-
readonly aliasId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
32
|
-
}, undefined>;
|
|
33
|
-
setConnectionConfigImapRaw: v.ObjectSchema<{
|
|
34
|
-
readonly connectionConfig: v.ObjectSchema<{
|
|
35
|
-
readonly imapHost: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
36
|
-
readonly imapPassword: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
37
|
-
readonly imapPort: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, number, undefined>, v.MaxValueAction<number, number, undefined>]>, undefined>;
|
|
38
|
-
readonly imapSocketType: v.UnionSchema<[v.LiteralSchema<"STARTTLS", undefined>, v.LiteralSchema<"SSL", undefined>], undefined>;
|
|
39
|
-
readonly imapUser: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
40
|
-
readonly smtpHost: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
41
|
-
readonly smtpPassword: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
42
|
-
readonly smtpPort: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, number, undefined>, v.MaxValueAction<number, number, undefined>]>, undefined>;
|
|
43
|
-
readonly smtpSocketType: v.UnionSchema<[v.LiteralSchema<"STARTTLS", undefined>, v.LiteralSchema<"SSL", undefined>], undefined>;
|
|
44
|
-
readonly smtpUser: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
45
|
-
}, undefined>;
|
|
46
|
-
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
47
|
-
}, undefined>;
|
|
48
|
-
setConnectionConfigOauth: v.ObjectSchema<{
|
|
49
|
-
readonly connectionConfig: v.ObjectSchema<{
|
|
50
|
-
readonly code: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
51
|
-
readonly provider: v.PicklistSchema<readonly ["GOOGLE", "OUTLOOK"], undefined>;
|
|
52
|
-
readonly user: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
53
|
-
}, undefined>;
|
|
54
|
-
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
55
|
-
}, undefined>;
|
|
56
|
-
setSettings: v.ObjectSchema<{
|
|
57
|
-
readonly color: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
58
|
-
readonly displayName: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
|
|
59
|
-
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
60
|
-
}, undefined>;
|
|
61
|
-
};
|
|
62
|
-
export declare const accountMutators: {
|
|
63
|
-
createAccount: import("@rocicorp/zero").MutatorDefinition<{
|
|
64
|
-
aliasId: string;
|
|
65
|
-
color: string;
|
|
66
|
-
emailAddress: string;
|
|
67
|
-
id: string;
|
|
68
|
-
}, {
|
|
69
|
-
aliasId: string;
|
|
70
|
-
color: string;
|
|
71
|
-
emailAddress: string;
|
|
72
|
-
id: string;
|
|
73
|
-
}, {
|
|
74
|
-
readonly userId: string;
|
|
75
|
-
}, unknown>;
|
|
76
|
-
createAlias: import("@rocicorp/zero").MutatorDefinition<{
|
|
77
|
-
accountId: string;
|
|
78
|
-
alias: {
|
|
79
|
-
emailAddress: string;
|
|
80
|
-
id: string;
|
|
81
|
-
name: string | null;
|
|
82
|
-
};
|
|
83
|
-
}, {
|
|
84
|
-
accountId: string;
|
|
85
|
-
alias: {
|
|
86
|
-
emailAddress: string;
|
|
87
|
-
id: string;
|
|
88
|
-
name: string | null;
|
|
89
|
-
};
|
|
90
|
-
}, {
|
|
91
|
-
readonly userId: string;
|
|
92
|
-
}, unknown>;
|
|
93
|
-
deleteAccount: import("@rocicorp/zero").MutatorDefinition<{
|
|
94
|
-
id: string;
|
|
95
|
-
}, {
|
|
96
|
-
id: string;
|
|
97
|
-
}, {
|
|
98
|
-
readonly userId: string;
|
|
99
|
-
}, unknown>;
|
|
100
|
-
deleteAlias: import("@rocicorp/zero").MutatorDefinition<{
|
|
101
|
-
accountId: string;
|
|
102
|
-
aliasId: string;
|
|
103
|
-
}, {
|
|
104
|
-
accountId: string;
|
|
105
|
-
aliasId: string;
|
|
106
|
-
}, {
|
|
107
|
-
readonly userId: string;
|
|
108
|
-
}, unknown>;
|
|
109
|
-
setAliasName: import("@rocicorp/zero").MutatorDefinition<{
|
|
110
|
-
accountId: string;
|
|
111
|
-
aliasId: string;
|
|
112
|
-
displayName: string | null;
|
|
113
|
-
}, {
|
|
114
|
-
accountId: string;
|
|
115
|
-
aliasId: string;
|
|
116
|
-
displayName: string | null;
|
|
117
|
-
}, {
|
|
118
|
-
readonly userId: string;
|
|
119
|
-
}, unknown>;
|
|
120
|
-
setAliasPrimary: import("@rocicorp/zero").MutatorDefinition<{
|
|
121
|
-
accountId: string;
|
|
122
|
-
aliasId: string;
|
|
123
|
-
}, {
|
|
124
|
-
accountId: string;
|
|
125
|
-
aliasId: string;
|
|
126
|
-
}, {
|
|
127
|
-
readonly userId: string;
|
|
128
|
-
}, unknown>;
|
|
129
|
-
setConnectionConfigImapRaw: import("@rocicorp/zero").MutatorDefinition<{
|
|
130
|
-
connectionConfig: {
|
|
131
|
-
imapHost: string;
|
|
132
|
-
imapPassword: string;
|
|
133
|
-
imapPort: number;
|
|
134
|
-
imapSocketType: "STARTTLS" | "SSL";
|
|
135
|
-
imapUser: string;
|
|
136
|
-
smtpHost: string;
|
|
137
|
-
smtpPassword: string;
|
|
138
|
-
smtpPort: number;
|
|
139
|
-
smtpSocketType: "STARTTLS" | "SSL";
|
|
140
|
-
smtpUser: string;
|
|
141
|
-
};
|
|
142
|
-
id: string;
|
|
143
|
-
}, {
|
|
144
|
-
connectionConfig: {
|
|
145
|
-
imapHost: string;
|
|
146
|
-
imapPassword: string;
|
|
147
|
-
imapPort: number;
|
|
148
|
-
imapSocketType: "STARTTLS" | "SSL";
|
|
149
|
-
imapUser: string;
|
|
150
|
-
smtpHost: string;
|
|
151
|
-
smtpPassword: string;
|
|
152
|
-
smtpPort: number;
|
|
153
|
-
smtpSocketType: "STARTTLS" | "SSL";
|
|
154
|
-
smtpUser: string;
|
|
155
|
-
};
|
|
156
|
-
id: string;
|
|
157
|
-
}, {
|
|
158
|
-
readonly userId: string;
|
|
159
|
-
}, unknown>;
|
|
160
|
-
setConnectionConfigOauth: import("@rocicorp/zero").MutatorDefinition<{
|
|
161
|
-
connectionConfig: {
|
|
162
|
-
code: string;
|
|
163
|
-
provider: "GOOGLE" | "OUTLOOK";
|
|
164
|
-
user: string;
|
|
165
|
-
};
|
|
166
|
-
id: string;
|
|
167
|
-
}, {
|
|
168
|
-
connectionConfig: {
|
|
169
|
-
code: string;
|
|
170
|
-
provider: "GOOGLE" | "OUTLOOK";
|
|
171
|
-
user: string;
|
|
172
|
-
};
|
|
173
|
-
id: string;
|
|
174
|
-
}, {
|
|
175
|
-
readonly userId: string;
|
|
176
|
-
}, unknown>;
|
|
177
|
-
setSettings: import("@rocicorp/zero").MutatorDefinition<{
|
|
178
|
-
color?: string | null | undefined;
|
|
179
|
-
displayName?: string | null | undefined;
|
|
180
|
-
id: string;
|
|
181
|
-
}, {
|
|
182
|
-
color?: string | null | undefined;
|
|
183
|
-
displayName?: string | null | undefined;
|
|
184
|
-
id: string;
|
|
185
|
-
}, {
|
|
186
|
-
readonly userId: string;
|
|
187
|
-
}, unknown>;
|
|
188
|
-
};
|
|
1
|
+
import { type AuthData, type HandlerMap } from '../../../types';
|
|
2
|
+
import type { ZeroMutatorSchemas } from '../../../zero/mutatorSchemas';
|
|
3
|
+
export declare const createAccountMutators: (authData: AuthData | undefined) => HandlerMap<ZeroMutatorSchemas["account"]>;
|
|
189
4
|
//# sourceMappingURL=accountMutators.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accountMutators.d.ts","sourceRoot":"","sources":["../../../../src/zero/mutators/accountMutators/accountMutators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"accountMutators.d.ts","sourceRoot":"","sources":["../../../../src/zero/mutators/accountMutators/accountMutators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAiB,MAAM,qBAAqB,CAAA;AACnF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAE3E,eAAO,MAAM,qBAAqB,aAAc,QAAQ,GAAG,SAAS,KAAG,UAAU,CAAC,kBAAkB,CAAC,SAAS,CAAC,CA2G7G,CAAA"}
|
|
@@ -1,139 +1,103 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
color: marcoSchemas.string.required(),
|
|
10
|
-
emailAddress: marcoSchemas.string.email(),
|
|
11
|
-
id: marcoSchemas.string.required(),
|
|
12
|
-
}),
|
|
13
|
-
createAlias: v.object({
|
|
14
|
-
accountId: marcoSchemas.string.required(),
|
|
15
|
-
alias: v.object({
|
|
16
|
-
emailAddress: marcoSchemas.string.email(),
|
|
17
|
-
id: marcoSchemas.string.required(),
|
|
18
|
-
name: marcoSchemas.string.nullable(),
|
|
19
|
-
}),
|
|
20
|
-
}),
|
|
21
|
-
deleteAccount: v.object({
|
|
22
|
-
id: marcoSchemas.string.required(),
|
|
23
|
-
}),
|
|
24
|
-
deleteAlias: v.object({
|
|
25
|
-
accountId: marcoSchemas.string.required(),
|
|
26
|
-
aliasId: marcoSchemas.string.required(),
|
|
27
|
-
}),
|
|
28
|
-
setAliasName: v.object({
|
|
29
|
-
accountId: marcoSchemas.string.required(),
|
|
30
|
-
aliasId: marcoSchemas.string.required(),
|
|
31
|
-
displayName: marcoSchemas.string.nullable(),
|
|
32
|
-
}),
|
|
33
|
-
setAliasPrimary: v.object({
|
|
34
|
-
accountId: marcoSchemas.string.required(),
|
|
35
|
-
aliasId: marcoSchemas.string.required(),
|
|
36
|
-
}),
|
|
37
|
-
setConnectionConfigImapRaw: v.object({
|
|
38
|
-
connectionConfig: marcoSchemas.emailAccount.connectionConfigImapRaw(),
|
|
39
|
-
id: marcoSchemas.string.required(),
|
|
40
|
-
}),
|
|
41
|
-
setConnectionConfigOauth: v.object({
|
|
42
|
-
connectionConfig: marcoSchemas.emailAccount.connectionConfigOauth(),
|
|
43
|
-
id: marcoSchemas.string.required(),
|
|
44
|
-
}),
|
|
45
|
-
setSettings: v.object({
|
|
46
|
-
color: v.optional(marcoSchemas.string.nullable()),
|
|
47
|
-
displayName: v.optional(marcoSchemas.string.nullable()),
|
|
48
|
-
id: marcoSchemas.string.required(),
|
|
49
|
-
}),
|
|
50
|
-
};
|
|
51
|
-
export const accountMutators = {
|
|
52
|
-
createAccount: defineMutator(accountMutatorSchemas.createAccount, async ({ tx, ctx: { userId }, args: { color, id, aliasId, emailAddress } }) => {
|
|
53
|
-
await tx.mutate(zeroCRUD.account.insert({
|
|
54
|
-
color,
|
|
1
|
+
import { MutationError } from '../../../types';
|
|
2
|
+
export const createAccountMutators = (authData) => ({
|
|
3
|
+
createAccount: async (tx, args) => {
|
|
4
|
+
if (!authData) {
|
|
5
|
+
throw new Error(MutationError.AUTHENTICATION_REQUIRED);
|
|
6
|
+
}
|
|
7
|
+
await tx.mutate.account.insert({
|
|
8
|
+
color: args.color,
|
|
55
9
|
displayName: null,
|
|
56
|
-
id,
|
|
10
|
+
id: args.id,
|
|
57
11
|
imapConnectionStatus: 'AWAITING_CONNECTION',
|
|
58
12
|
mailProcessedCount: 0,
|
|
59
13
|
mailTotalCount: 0,
|
|
60
|
-
primaryAliasId: aliasId,
|
|
61
|
-
userId,
|
|
62
|
-
})
|
|
63
|
-
await tx.mutate
|
|
64
|
-
accountId: id,
|
|
65
|
-
emailAddress,
|
|
66
|
-
id: aliasId,
|
|
14
|
+
primaryAliasId: args.aliasId,
|
|
15
|
+
userId: authData.sub,
|
|
16
|
+
});
|
|
17
|
+
await tx.mutate.accountAlias.insert({
|
|
18
|
+
accountId: args.id,
|
|
19
|
+
emailAddress: args.emailAddress,
|
|
20
|
+
id: args.aliasId,
|
|
67
21
|
isPrimary: true,
|
|
68
22
|
name: null,
|
|
69
|
-
})
|
|
70
|
-
}
|
|
71
|
-
createAlias:
|
|
72
|
-
await tx.mutate
|
|
73
|
-
accountId: accountId,
|
|
74
|
-
emailAddress: alias.emailAddress,
|
|
75
|
-
id: alias.id,
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
createAlias: async (tx, args) => {
|
|
26
|
+
await tx.mutate.accountAlias.insert({
|
|
27
|
+
accountId: args.accountId,
|
|
28
|
+
emailAddress: args.alias.emailAddress,
|
|
29
|
+
id: args.alias.id,
|
|
76
30
|
isPrimary: false,
|
|
77
|
-
name: alias.name ?? null,
|
|
78
|
-
})
|
|
79
|
-
}
|
|
80
|
-
deleteAccount:
|
|
81
|
-
await tx.mutate
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
31
|
+
name: args.alias.name ?? null,
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
deleteAccount: async (tx, args) => {
|
|
35
|
+
await tx.mutate.account.delete({
|
|
36
|
+
id: args.id,
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
deleteAlias: async (tx, args) => {
|
|
40
|
+
const alias = await tx.query.accountAlias.where('id', args.aliasId).one().run();
|
|
41
|
+
await tx.mutate.accountAlias.delete({
|
|
42
|
+
id: args.aliasId,
|
|
43
|
+
});
|
|
86
44
|
if (alias?.isPrimary) {
|
|
87
|
-
const remainingAliases = await tx.
|
|
45
|
+
const remainingAliases = await tx.query.accountAlias.where('accountId', args.accountId).run();
|
|
88
46
|
if (remainingAliases.length > 0) {
|
|
89
47
|
const newPrimaryAlias = remainingAliases[0];
|
|
90
|
-
await tx.mutate
|
|
48
|
+
await tx.mutate.accountAlias.update({
|
|
91
49
|
id: newPrimaryAlias.id,
|
|
92
50
|
isPrimary: true,
|
|
93
|
-
})
|
|
94
|
-
await tx.mutate
|
|
95
|
-
id: accountId,
|
|
51
|
+
});
|
|
52
|
+
await tx.mutate.account.update({
|
|
53
|
+
id: args.accountId,
|
|
96
54
|
primaryAliasId: newPrimaryAlias.id,
|
|
97
|
-
})
|
|
55
|
+
});
|
|
98
56
|
}
|
|
99
57
|
else {
|
|
100
|
-
await tx.mutate
|
|
101
|
-
id: accountId,
|
|
58
|
+
await tx.mutate.account.update({
|
|
59
|
+
id: args.accountId,
|
|
102
60
|
primaryAliasId: null,
|
|
103
|
-
})
|
|
61
|
+
});
|
|
104
62
|
}
|
|
105
63
|
}
|
|
106
|
-
}
|
|
107
|
-
setAliasName:
|
|
108
|
-
await tx.mutate
|
|
109
|
-
id: aliasId,
|
|
110
|
-
name: displayName,
|
|
111
|
-
})
|
|
112
|
-
}
|
|
113
|
-
setAliasPrimary:
|
|
114
|
-
const aliases = await tx.
|
|
64
|
+
},
|
|
65
|
+
setAliasName: async (tx, args) => {
|
|
66
|
+
await tx.mutate.accountAlias.update({
|
|
67
|
+
id: args.aliasId,
|
|
68
|
+
name: args.displayName,
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
setAliasPrimary: async (tx, args) => {
|
|
72
|
+
const aliases = await tx.query.accountAlias.where('accountId', args.accountId).run();
|
|
115
73
|
for (const alias of aliases) {
|
|
116
|
-
await tx.mutate
|
|
74
|
+
await tx.mutate.accountAlias.update({
|
|
117
75
|
id: alias.id,
|
|
118
|
-
isPrimary: alias.id === aliasId,
|
|
119
|
-
})
|
|
76
|
+
isPrimary: alias.id === args.aliasId,
|
|
77
|
+
});
|
|
120
78
|
}
|
|
121
|
-
await tx.mutate
|
|
122
|
-
id: accountId,
|
|
123
|
-
primaryAliasId: aliasId,
|
|
124
|
-
})
|
|
125
|
-
}
|
|
126
|
-
setConnectionConfigImapRaw:
|
|
127
|
-
await tx.mutate
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
await tx.mutate
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
79
|
+
await tx.mutate.account.update({
|
|
80
|
+
id: args.accountId,
|
|
81
|
+
primaryAliasId: args.aliasId,
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
setConnectionConfigImapRaw: async (tx, args) => {
|
|
85
|
+
await tx.mutate.account.update({
|
|
86
|
+
id: args.id,
|
|
87
|
+
imapConnectionStatus: 'AWAITING_CONNECTION',
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
setConnectionConfigOauth: async (tx, args) => {
|
|
91
|
+
await tx.mutate.account.update({
|
|
92
|
+
id: args.id,
|
|
93
|
+
imapConnectionStatus: 'AWAITING_CONNECTION',
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
setSettings: async (tx, args) => {
|
|
97
|
+
await tx.mutate.account.update({
|
|
98
|
+
color: args.color ? args.color : undefined,
|
|
99
|
+
displayName: args.displayName ? args.displayName : undefined,
|
|
100
|
+
id: args.id,
|
|
101
|
+
});
|
|
102
|
+
},
|
|
103
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accountMutators.test.d.ts","sourceRoot":"","sources":["../../../../src/zero/mutators/accountMutators/accountMutators.test.ts"],"names":[],"mappings":""}
|