zele 0.3.16 → 0.3.20
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/README.md +155 -36
- package/dist/api-utils.d.ts +14 -0
- package/dist/api-utils.js +20 -0
- package/dist/api-utils.js.map +1 -1
- package/dist/auth.d.ts +71 -9
- package/dist/auth.js +186 -10
- package/dist/auth.js.map +1 -1
- package/dist/cli-types.d.ts +4 -0
- package/dist/cli-types.js +6 -0
- package/dist/cli-types.js.map +1 -0
- package/dist/cli.js +1 -5
- package/dist/cli.js.map +1 -1
- package/dist/commands/attachment.d.ts +2 -2
- package/dist/commands/attachment.js +2 -0
- package/dist/commands/attachment.js.map +1 -1
- package/dist/commands/auth-cmd.d.ts +2 -2
- package/dist/commands/auth-cmd.js +104 -6
- package/dist/commands/auth-cmd.js.map +1 -1
- package/dist/commands/calendar.d.ts +2 -2
- package/dist/commands/calendar.js.map +1 -1
- package/dist/commands/draft.d.ts +2 -2
- package/dist/commands/draft.js +58 -4
- package/dist/commands/draft.js.map +1 -1
- package/dist/commands/filter.d.ts +2 -2
- package/dist/commands/filter.js +7 -2
- package/dist/commands/filter.js.map +1 -1
- package/dist/commands/label.d.ts +2 -2
- package/dist/commands/label.js +19 -9
- package/dist/commands/label.js.map +1 -1
- package/dist/commands/mail-actions.d.ts +2 -2
- package/dist/commands/mail-actions.js +290 -1
- package/dist/commands/mail-actions.js.map +1 -1
- package/dist/commands/mail.d.ts +2 -2
- package/dist/commands/mail.js +90 -23
- package/dist/commands/mail.js.map +1 -1
- package/dist/commands/profile.d.ts +2 -2
- package/dist/commands/profile.js +25 -18
- package/dist/commands/profile.js.map +1 -1
- package/dist/commands/watch.d.ts +2 -2
- package/dist/commands/watch.js.map +1 -1
- package/dist/db.js +24 -0
- package/dist/db.js.map +1 -1
- package/dist/generated/internal/class.js +2 -2
- package/dist/generated/internal/class.js.map +1 -1
- package/dist/generated/internal/prismaNamespace.d.ts +2 -0
- package/dist/generated/internal/prismaNamespace.js +2 -0
- package/dist/generated/internal/prismaNamespace.js.map +1 -1
- package/dist/generated/internal/prismaNamespaceBrowser.d.ts +2 -0
- package/dist/generated/internal/prismaNamespaceBrowser.js +2 -0
- package/dist/generated/internal/prismaNamespaceBrowser.js.map +1 -1
- package/dist/generated/models/Account.d.ts +97 -1
- package/dist/gmail-client.d.ts +73 -3
- package/dist/gmail-client.js +165 -5
- package/dist/gmail-client.js.map +1 -1
- package/dist/imap-smtp-client.d.ts +306 -0
- package/dist/imap-smtp-client.js +1349 -0
- package/dist/imap-smtp-client.js.map +1 -0
- package/dist/mail-tui.js.map +1 -1
- package/dist/unsubscribe.d.ts +76 -0
- package/dist/unsubscribe.js +224 -0
- package/dist/unsubscribe.js.map +1 -0
- package/package.json +6 -3
- package/schema.prisma +7 -5
- package/skills/zele/SKILL.md +26 -96
- package/src/api-utils.ts +20 -0
- package/src/auth.ts +282 -14
- package/src/cli-types.ts +8 -0
- package/src/cli.ts +2 -7
- package/src/commands/attachment.ts +3 -2
- package/src/commands/auth-cmd.ts +114 -8
- package/src/commands/calendar.ts +2 -2
- package/src/commands/draft.ts +65 -6
- package/src/commands/filter.ts +11 -5
- package/src/commands/label.ts +24 -13
- package/src/commands/mail-actions.ts +317 -5
- package/src/commands/mail.ts +97 -25
- package/src/commands/profile.ts +29 -19
- package/src/commands/watch.ts +2 -2
- package/src/db.ts +28 -0
- package/src/generated/internal/class.ts +2 -2
- package/src/generated/internal/prismaNamespace.ts +2 -0
- package/src/generated/internal/prismaNamespaceBrowser.ts +2 -0
- package/src/generated/models/Account.ts +97 -1
- package/src/gmail-client.test.ts +155 -2
- package/src/gmail-client.ts +258 -6
- package/src/imap-smtp-client.ts +1560 -0
- package/src/mail-tui.tsx +2 -1
- package/src/schema.sql +2 -0
- package/src/unsubscribe.test.ts +487 -0
- package/src/unsubscribe.ts +255 -0
|
@@ -14,6 +14,8 @@ export type AggregateAccount = {
|
|
|
14
14
|
export type AccountMinAggregateOutputType = {
|
|
15
15
|
email: string | null;
|
|
16
16
|
appId: string | null;
|
|
17
|
+
accountType: string | null;
|
|
18
|
+
capabilities: string | null;
|
|
17
19
|
accountStatus: $Enums.AccountStatus | null;
|
|
18
20
|
tokens: string | null;
|
|
19
21
|
createdAt: Date | null;
|
|
@@ -22,6 +24,8 @@ export type AccountMinAggregateOutputType = {
|
|
|
22
24
|
export type AccountMaxAggregateOutputType = {
|
|
23
25
|
email: string | null;
|
|
24
26
|
appId: string | null;
|
|
27
|
+
accountType: string | null;
|
|
28
|
+
capabilities: string | null;
|
|
25
29
|
accountStatus: $Enums.AccountStatus | null;
|
|
26
30
|
tokens: string | null;
|
|
27
31
|
createdAt: Date | null;
|
|
@@ -30,6 +34,8 @@ export type AccountMaxAggregateOutputType = {
|
|
|
30
34
|
export type AccountCountAggregateOutputType = {
|
|
31
35
|
email: number;
|
|
32
36
|
appId: number;
|
|
37
|
+
accountType: number;
|
|
38
|
+
capabilities: number;
|
|
33
39
|
accountStatus: number;
|
|
34
40
|
tokens: number;
|
|
35
41
|
createdAt: number;
|
|
@@ -39,6 +45,8 @@ export type AccountCountAggregateOutputType = {
|
|
|
39
45
|
export type AccountMinAggregateInputType = {
|
|
40
46
|
email?: true;
|
|
41
47
|
appId?: true;
|
|
48
|
+
accountType?: true;
|
|
49
|
+
capabilities?: true;
|
|
42
50
|
accountStatus?: true;
|
|
43
51
|
tokens?: true;
|
|
44
52
|
createdAt?: true;
|
|
@@ -47,6 +55,8 @@ export type AccountMinAggregateInputType = {
|
|
|
47
55
|
export type AccountMaxAggregateInputType = {
|
|
48
56
|
email?: true;
|
|
49
57
|
appId?: true;
|
|
58
|
+
accountType?: true;
|
|
59
|
+
capabilities?: true;
|
|
50
60
|
accountStatus?: true;
|
|
51
61
|
tokens?: true;
|
|
52
62
|
createdAt?: true;
|
|
@@ -55,6 +65,8 @@ export type AccountMaxAggregateInputType = {
|
|
|
55
65
|
export type AccountCountAggregateInputType = {
|
|
56
66
|
email?: true;
|
|
57
67
|
appId?: true;
|
|
68
|
+
accountType?: true;
|
|
69
|
+
capabilities?: true;
|
|
58
70
|
accountStatus?: true;
|
|
59
71
|
tokens?: true;
|
|
60
72
|
createdAt?: true;
|
|
@@ -126,6 +138,8 @@ export type AccountGroupByArgs<ExtArgs extends runtime.Types.Extensions.Internal
|
|
|
126
138
|
export type AccountGroupByOutputType = {
|
|
127
139
|
email: string;
|
|
128
140
|
appId: string;
|
|
141
|
+
accountType: string;
|
|
142
|
+
capabilities: string;
|
|
129
143
|
accountStatus: $Enums.AccountStatus;
|
|
130
144
|
tokens: string;
|
|
131
145
|
createdAt: Date;
|
|
@@ -143,6 +157,8 @@ export type AccountWhereInput = {
|
|
|
143
157
|
NOT?: Prisma.AccountWhereInput | Prisma.AccountWhereInput[];
|
|
144
158
|
email?: Prisma.StringFilter<"Account"> | string;
|
|
145
159
|
appId?: Prisma.StringFilter<"Account"> | string;
|
|
160
|
+
accountType?: Prisma.StringFilter<"Account"> | string;
|
|
161
|
+
capabilities?: Prisma.StringFilter<"Account"> | string;
|
|
146
162
|
accountStatus?: Prisma.EnumAccountStatusFilter<"Account"> | $Enums.AccountStatus;
|
|
147
163
|
tokens?: Prisma.StringFilter<"Account"> | string;
|
|
148
164
|
createdAt?: Prisma.DateTimeFilter<"Account"> | Date | string;
|
|
@@ -156,6 +172,8 @@ export type AccountWhereInput = {
|
|
|
156
172
|
export type AccountOrderByWithRelationInput = {
|
|
157
173
|
email?: Prisma.SortOrder;
|
|
158
174
|
appId?: Prisma.SortOrder;
|
|
175
|
+
accountType?: Prisma.SortOrder;
|
|
176
|
+
capabilities?: Prisma.SortOrder;
|
|
159
177
|
accountStatus?: Prisma.SortOrder;
|
|
160
178
|
tokens?: Prisma.SortOrder;
|
|
161
179
|
createdAt?: Prisma.SortOrder;
|
|
@@ -173,6 +191,8 @@ export type AccountWhereUniqueInput = Prisma.AtLeast<{
|
|
|
173
191
|
NOT?: Prisma.AccountWhereInput | Prisma.AccountWhereInput[];
|
|
174
192
|
email?: Prisma.StringFilter<"Account"> | string;
|
|
175
193
|
appId?: Prisma.StringFilter<"Account"> | string;
|
|
194
|
+
accountType?: Prisma.StringFilter<"Account"> | string;
|
|
195
|
+
capabilities?: Prisma.StringFilter<"Account"> | string;
|
|
176
196
|
accountStatus?: Prisma.EnumAccountStatusFilter<"Account"> | $Enums.AccountStatus;
|
|
177
197
|
tokens?: Prisma.StringFilter<"Account"> | string;
|
|
178
198
|
createdAt?: Prisma.DateTimeFilter<"Account"> | Date | string;
|
|
@@ -186,6 +206,8 @@ export type AccountWhereUniqueInput = Prisma.AtLeast<{
|
|
|
186
206
|
export type AccountOrderByWithAggregationInput = {
|
|
187
207
|
email?: Prisma.SortOrder;
|
|
188
208
|
appId?: Prisma.SortOrder;
|
|
209
|
+
accountType?: Prisma.SortOrder;
|
|
210
|
+
capabilities?: Prisma.SortOrder;
|
|
189
211
|
accountStatus?: Prisma.SortOrder;
|
|
190
212
|
tokens?: Prisma.SortOrder;
|
|
191
213
|
createdAt?: Prisma.SortOrder;
|
|
@@ -200,6 +222,8 @@ export type AccountScalarWhereWithAggregatesInput = {
|
|
|
200
222
|
NOT?: Prisma.AccountScalarWhereWithAggregatesInput | Prisma.AccountScalarWhereWithAggregatesInput[];
|
|
201
223
|
email?: Prisma.StringWithAggregatesFilter<"Account"> | string;
|
|
202
224
|
appId?: Prisma.StringWithAggregatesFilter<"Account"> | string;
|
|
225
|
+
accountType?: Prisma.StringWithAggregatesFilter<"Account"> | string;
|
|
226
|
+
capabilities?: Prisma.StringWithAggregatesFilter<"Account"> | string;
|
|
203
227
|
accountStatus?: Prisma.EnumAccountStatusWithAggregatesFilter<"Account"> | $Enums.AccountStatus;
|
|
204
228
|
tokens?: Prisma.StringWithAggregatesFilter<"Account"> | string;
|
|
205
229
|
createdAt?: Prisma.DateTimeWithAggregatesFilter<"Account"> | Date | string;
|
|
@@ -208,6 +232,8 @@ export type AccountScalarWhereWithAggregatesInput = {
|
|
|
208
232
|
export type AccountCreateInput = {
|
|
209
233
|
email: string;
|
|
210
234
|
appId: string;
|
|
235
|
+
accountType?: string;
|
|
236
|
+
capabilities?: string;
|
|
211
237
|
accountStatus: $Enums.AccountStatus;
|
|
212
238
|
tokens: string;
|
|
213
239
|
createdAt: Date | string;
|
|
@@ -221,6 +247,8 @@ export type AccountCreateInput = {
|
|
|
221
247
|
export type AccountUncheckedCreateInput = {
|
|
222
248
|
email: string;
|
|
223
249
|
appId: string;
|
|
250
|
+
accountType?: string;
|
|
251
|
+
capabilities?: string;
|
|
224
252
|
accountStatus: $Enums.AccountStatus;
|
|
225
253
|
tokens: string;
|
|
226
254
|
createdAt: Date | string;
|
|
@@ -234,6 +262,8 @@ export type AccountUncheckedCreateInput = {
|
|
|
234
262
|
export type AccountUpdateInput = {
|
|
235
263
|
email?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
236
264
|
appId?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
265
|
+
accountType?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
266
|
+
capabilities?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
237
267
|
accountStatus?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus;
|
|
238
268
|
tokens?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
239
269
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
|
|
@@ -247,6 +277,8 @@ export type AccountUpdateInput = {
|
|
|
247
277
|
export type AccountUncheckedUpdateInput = {
|
|
248
278
|
email?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
249
279
|
appId?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
280
|
+
accountType?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
281
|
+
capabilities?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
250
282
|
accountStatus?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus;
|
|
251
283
|
tokens?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
252
284
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
|
|
@@ -260,6 +292,8 @@ export type AccountUncheckedUpdateInput = {
|
|
|
260
292
|
export type AccountCreateManyInput = {
|
|
261
293
|
email: string;
|
|
262
294
|
appId: string;
|
|
295
|
+
accountType?: string;
|
|
296
|
+
capabilities?: string;
|
|
263
297
|
accountStatus: $Enums.AccountStatus;
|
|
264
298
|
tokens: string;
|
|
265
299
|
createdAt: Date | string;
|
|
@@ -268,6 +302,8 @@ export type AccountCreateManyInput = {
|
|
|
268
302
|
export type AccountUpdateManyMutationInput = {
|
|
269
303
|
email?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
270
304
|
appId?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
305
|
+
accountType?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
306
|
+
capabilities?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
271
307
|
accountStatus?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus;
|
|
272
308
|
tokens?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
273
309
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
|
|
@@ -276,6 +312,8 @@ export type AccountUpdateManyMutationInput = {
|
|
|
276
312
|
export type AccountUncheckedUpdateManyInput = {
|
|
277
313
|
email?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
278
314
|
appId?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
315
|
+
accountType?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
316
|
+
capabilities?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
279
317
|
accountStatus?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus;
|
|
280
318
|
tokens?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
281
319
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
|
|
@@ -288,6 +326,8 @@ export type AccountEmailAppIdCompoundUniqueInput = {
|
|
|
288
326
|
export type AccountCountOrderByAggregateInput = {
|
|
289
327
|
email?: Prisma.SortOrder;
|
|
290
328
|
appId?: Prisma.SortOrder;
|
|
329
|
+
accountType?: Prisma.SortOrder;
|
|
330
|
+
capabilities?: Prisma.SortOrder;
|
|
291
331
|
accountStatus?: Prisma.SortOrder;
|
|
292
332
|
tokens?: Prisma.SortOrder;
|
|
293
333
|
createdAt?: Prisma.SortOrder;
|
|
@@ -296,6 +336,8 @@ export type AccountCountOrderByAggregateInput = {
|
|
|
296
336
|
export type AccountMaxOrderByAggregateInput = {
|
|
297
337
|
email?: Prisma.SortOrder;
|
|
298
338
|
appId?: Prisma.SortOrder;
|
|
339
|
+
accountType?: Prisma.SortOrder;
|
|
340
|
+
capabilities?: Prisma.SortOrder;
|
|
299
341
|
accountStatus?: Prisma.SortOrder;
|
|
300
342
|
tokens?: Prisma.SortOrder;
|
|
301
343
|
createdAt?: Prisma.SortOrder;
|
|
@@ -304,6 +346,8 @@ export type AccountMaxOrderByAggregateInput = {
|
|
|
304
346
|
export type AccountMinOrderByAggregateInput = {
|
|
305
347
|
email?: Prisma.SortOrder;
|
|
306
348
|
appId?: Prisma.SortOrder;
|
|
349
|
+
accountType?: Prisma.SortOrder;
|
|
350
|
+
capabilities?: Prisma.SortOrder;
|
|
307
351
|
accountStatus?: Prisma.SortOrder;
|
|
308
352
|
tokens?: Prisma.SortOrder;
|
|
309
353
|
createdAt?: Prisma.SortOrder;
|
|
@@ -385,6 +429,8 @@ export type AccountUpdateOneRequiredWithoutSyncStatesNestedInput = {
|
|
|
385
429
|
export type AccountCreateWithoutThreadsInput = {
|
|
386
430
|
email: string;
|
|
387
431
|
appId: string;
|
|
432
|
+
accountType?: string;
|
|
433
|
+
capabilities?: string;
|
|
388
434
|
accountStatus: $Enums.AccountStatus;
|
|
389
435
|
tokens: string;
|
|
390
436
|
createdAt: Date | string;
|
|
@@ -397,6 +443,8 @@ export type AccountCreateWithoutThreadsInput = {
|
|
|
397
443
|
export type AccountUncheckedCreateWithoutThreadsInput = {
|
|
398
444
|
email: string;
|
|
399
445
|
appId: string;
|
|
446
|
+
accountType?: string;
|
|
447
|
+
capabilities?: string;
|
|
400
448
|
accountStatus: $Enums.AccountStatus;
|
|
401
449
|
tokens: string;
|
|
402
450
|
createdAt: Date | string;
|
|
@@ -422,6 +470,8 @@ export type AccountUpdateToOneWithWhereWithoutThreadsInput = {
|
|
|
422
470
|
export type AccountUpdateWithoutThreadsInput = {
|
|
423
471
|
email?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
424
472
|
appId?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
473
|
+
accountType?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
474
|
+
capabilities?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
425
475
|
accountStatus?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus;
|
|
426
476
|
tokens?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
427
477
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
|
|
@@ -434,6 +484,8 @@ export type AccountUpdateWithoutThreadsInput = {
|
|
|
434
484
|
export type AccountUncheckedUpdateWithoutThreadsInput = {
|
|
435
485
|
email?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
436
486
|
appId?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
487
|
+
accountType?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
488
|
+
capabilities?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
437
489
|
accountStatus?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus;
|
|
438
490
|
tokens?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
439
491
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
|
|
@@ -446,6 +498,8 @@ export type AccountUncheckedUpdateWithoutThreadsInput = {
|
|
|
446
498
|
export type AccountCreateWithoutLabelsInput = {
|
|
447
499
|
email: string;
|
|
448
500
|
appId: string;
|
|
501
|
+
accountType?: string;
|
|
502
|
+
capabilities?: string;
|
|
449
503
|
accountStatus: $Enums.AccountStatus;
|
|
450
504
|
tokens: string;
|
|
451
505
|
createdAt: Date | string;
|
|
@@ -458,6 +512,8 @@ export type AccountCreateWithoutLabelsInput = {
|
|
|
458
512
|
export type AccountUncheckedCreateWithoutLabelsInput = {
|
|
459
513
|
email: string;
|
|
460
514
|
appId: string;
|
|
515
|
+
accountType?: string;
|
|
516
|
+
capabilities?: string;
|
|
461
517
|
accountStatus: $Enums.AccountStatus;
|
|
462
518
|
tokens: string;
|
|
463
519
|
createdAt: Date | string;
|
|
@@ -483,6 +539,8 @@ export type AccountUpdateToOneWithWhereWithoutLabelsInput = {
|
|
|
483
539
|
export type AccountUpdateWithoutLabelsInput = {
|
|
484
540
|
email?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
485
541
|
appId?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
542
|
+
accountType?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
543
|
+
capabilities?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
486
544
|
accountStatus?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus;
|
|
487
545
|
tokens?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
488
546
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
|
|
@@ -495,6 +553,8 @@ export type AccountUpdateWithoutLabelsInput = {
|
|
|
495
553
|
export type AccountUncheckedUpdateWithoutLabelsInput = {
|
|
496
554
|
email?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
497
555
|
appId?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
556
|
+
accountType?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
557
|
+
capabilities?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
498
558
|
accountStatus?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus;
|
|
499
559
|
tokens?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
500
560
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
|
|
@@ -507,6 +567,8 @@ export type AccountUncheckedUpdateWithoutLabelsInput = {
|
|
|
507
567
|
export type AccountCreateWithoutProfilesInput = {
|
|
508
568
|
email: string;
|
|
509
569
|
appId: string;
|
|
570
|
+
accountType?: string;
|
|
571
|
+
capabilities?: string;
|
|
510
572
|
accountStatus: $Enums.AccountStatus;
|
|
511
573
|
tokens: string;
|
|
512
574
|
createdAt: Date | string;
|
|
@@ -519,6 +581,8 @@ export type AccountCreateWithoutProfilesInput = {
|
|
|
519
581
|
export type AccountUncheckedCreateWithoutProfilesInput = {
|
|
520
582
|
email: string;
|
|
521
583
|
appId: string;
|
|
584
|
+
accountType?: string;
|
|
585
|
+
capabilities?: string;
|
|
522
586
|
accountStatus: $Enums.AccountStatus;
|
|
523
587
|
tokens: string;
|
|
524
588
|
createdAt: Date | string;
|
|
@@ -544,6 +608,8 @@ export type AccountUpdateToOneWithWhereWithoutProfilesInput = {
|
|
|
544
608
|
export type AccountUpdateWithoutProfilesInput = {
|
|
545
609
|
email?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
546
610
|
appId?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
611
|
+
accountType?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
612
|
+
capabilities?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
547
613
|
accountStatus?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus;
|
|
548
614
|
tokens?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
549
615
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
|
|
@@ -556,6 +622,8 @@ export type AccountUpdateWithoutProfilesInput = {
|
|
|
556
622
|
export type AccountUncheckedUpdateWithoutProfilesInput = {
|
|
557
623
|
email?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
558
624
|
appId?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
625
|
+
accountType?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
626
|
+
capabilities?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
559
627
|
accountStatus?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus;
|
|
560
628
|
tokens?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
561
629
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
|
|
@@ -568,6 +636,8 @@ export type AccountUncheckedUpdateWithoutProfilesInput = {
|
|
|
568
636
|
export type AccountCreateWithoutCalendarListsInput = {
|
|
569
637
|
email: string;
|
|
570
638
|
appId: string;
|
|
639
|
+
accountType?: string;
|
|
640
|
+
capabilities?: string;
|
|
571
641
|
accountStatus: $Enums.AccountStatus;
|
|
572
642
|
tokens: string;
|
|
573
643
|
createdAt: Date | string;
|
|
@@ -580,6 +650,8 @@ export type AccountCreateWithoutCalendarListsInput = {
|
|
|
580
650
|
export type AccountUncheckedCreateWithoutCalendarListsInput = {
|
|
581
651
|
email: string;
|
|
582
652
|
appId: string;
|
|
653
|
+
accountType?: string;
|
|
654
|
+
capabilities?: string;
|
|
583
655
|
accountStatus: $Enums.AccountStatus;
|
|
584
656
|
tokens: string;
|
|
585
657
|
createdAt: Date | string;
|
|
@@ -605,6 +677,8 @@ export type AccountUpdateToOneWithWhereWithoutCalendarListsInput = {
|
|
|
605
677
|
export type AccountUpdateWithoutCalendarListsInput = {
|
|
606
678
|
email?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
607
679
|
appId?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
680
|
+
accountType?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
681
|
+
capabilities?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
608
682
|
accountStatus?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus;
|
|
609
683
|
tokens?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
610
684
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
|
|
@@ -617,6 +691,8 @@ export type AccountUpdateWithoutCalendarListsInput = {
|
|
|
617
691
|
export type AccountUncheckedUpdateWithoutCalendarListsInput = {
|
|
618
692
|
email?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
619
693
|
appId?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
694
|
+
accountType?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
695
|
+
capabilities?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
620
696
|
accountStatus?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus;
|
|
621
697
|
tokens?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
622
698
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
|
|
@@ -629,6 +705,8 @@ export type AccountUncheckedUpdateWithoutCalendarListsInput = {
|
|
|
629
705
|
export type AccountCreateWithoutSyncStatesInput = {
|
|
630
706
|
email: string;
|
|
631
707
|
appId: string;
|
|
708
|
+
accountType?: string;
|
|
709
|
+
capabilities?: string;
|
|
632
710
|
accountStatus: $Enums.AccountStatus;
|
|
633
711
|
tokens: string;
|
|
634
712
|
createdAt: Date | string;
|
|
@@ -641,6 +719,8 @@ export type AccountCreateWithoutSyncStatesInput = {
|
|
|
641
719
|
export type AccountUncheckedCreateWithoutSyncStatesInput = {
|
|
642
720
|
email: string;
|
|
643
721
|
appId: string;
|
|
722
|
+
accountType?: string;
|
|
723
|
+
capabilities?: string;
|
|
644
724
|
accountStatus: $Enums.AccountStatus;
|
|
645
725
|
tokens: string;
|
|
646
726
|
createdAt: Date | string;
|
|
@@ -666,6 +746,8 @@ export type AccountUpdateToOneWithWhereWithoutSyncStatesInput = {
|
|
|
666
746
|
export type AccountUpdateWithoutSyncStatesInput = {
|
|
667
747
|
email?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
668
748
|
appId?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
749
|
+
accountType?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
750
|
+
capabilities?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
669
751
|
accountStatus?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus;
|
|
670
752
|
tokens?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
671
753
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
|
|
@@ -678,6 +760,8 @@ export type AccountUpdateWithoutSyncStatesInput = {
|
|
|
678
760
|
export type AccountUncheckedUpdateWithoutSyncStatesInput = {
|
|
679
761
|
email?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
680
762
|
appId?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
763
|
+
accountType?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
764
|
+
capabilities?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
681
765
|
accountStatus?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus;
|
|
682
766
|
tokens?: Prisma.StringFieldUpdateOperationsInput | string;
|
|
683
767
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
|
|
@@ -722,6 +806,8 @@ export type AccountCountOutputTypeCountSyncStatesArgs<ExtArgs extends runtime.Ty
|
|
|
722
806
|
export type AccountSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
|
723
807
|
email?: boolean;
|
|
724
808
|
appId?: boolean;
|
|
809
|
+
accountType?: boolean;
|
|
810
|
+
capabilities?: boolean;
|
|
725
811
|
accountStatus?: boolean;
|
|
726
812
|
tokens?: boolean;
|
|
727
813
|
createdAt?: boolean;
|
|
@@ -736,6 +822,8 @@ export type AccountSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
|
|
736
822
|
export type AccountSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
|
737
823
|
email?: boolean;
|
|
738
824
|
appId?: boolean;
|
|
825
|
+
accountType?: boolean;
|
|
826
|
+
capabilities?: boolean;
|
|
739
827
|
accountStatus?: boolean;
|
|
740
828
|
tokens?: boolean;
|
|
741
829
|
createdAt?: boolean;
|
|
@@ -744,6 +832,8 @@ export type AccountSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Exten
|
|
|
744
832
|
export type AccountSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
|
745
833
|
email?: boolean;
|
|
746
834
|
appId?: boolean;
|
|
835
|
+
accountType?: boolean;
|
|
836
|
+
capabilities?: boolean;
|
|
747
837
|
accountStatus?: boolean;
|
|
748
838
|
tokens?: boolean;
|
|
749
839
|
createdAt?: boolean;
|
|
@@ -752,12 +842,14 @@ export type AccountSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Exten
|
|
|
752
842
|
export type AccountSelectScalar = {
|
|
753
843
|
email?: boolean;
|
|
754
844
|
appId?: boolean;
|
|
845
|
+
accountType?: boolean;
|
|
846
|
+
capabilities?: boolean;
|
|
755
847
|
accountStatus?: boolean;
|
|
756
848
|
tokens?: boolean;
|
|
757
849
|
createdAt?: boolean;
|
|
758
850
|
updatedAt?: boolean;
|
|
759
851
|
};
|
|
760
|
-
export type AccountOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"email" | "appId" | "accountStatus" | "tokens" | "createdAt" | "updatedAt", ExtArgs["result"]["account"]>;
|
|
852
|
+
export type AccountOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"email" | "appId" | "accountType" | "capabilities" | "accountStatus" | "tokens" | "createdAt" | "updatedAt", ExtArgs["result"]["account"]>;
|
|
761
853
|
export type AccountInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
|
762
854
|
threads?: boolean | Prisma.Account$threadsArgs<ExtArgs>;
|
|
763
855
|
labels?: boolean | Prisma.Account$labelsArgs<ExtArgs>;
|
|
@@ -780,6 +872,8 @@ export type $AccountPayload<ExtArgs extends runtime.Types.Extensions.InternalArg
|
|
|
780
872
|
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
|
781
873
|
email: string;
|
|
782
874
|
appId: string;
|
|
875
|
+
accountType: string;
|
|
876
|
+
capabilities: string;
|
|
783
877
|
accountStatus: $Enums.AccountStatus;
|
|
784
878
|
tokens: string;
|
|
785
879
|
createdAt: Date;
|
|
@@ -1145,6 +1239,8 @@ export interface Prisma__AccountClient<T, Null = never, ExtArgs extends runtime.
|
|
|
1145
1239
|
export interface AccountFieldRefs {
|
|
1146
1240
|
readonly email: Prisma.FieldRef<"Account", 'String'>;
|
|
1147
1241
|
readonly appId: Prisma.FieldRef<"Account", 'String'>;
|
|
1242
|
+
readonly accountType: Prisma.FieldRef<"Account", 'String'>;
|
|
1243
|
+
readonly capabilities: Prisma.FieldRef<"Account", 'String'>;
|
|
1148
1244
|
readonly accountStatus: Prisma.FieldRef<"Account", 'AccountStatus'>;
|
|
1149
1245
|
readonly tokens: Prisma.FieldRef<"Account", 'String'>;
|
|
1150
1246
|
readonly createdAt: Prisma.FieldRef<"Account", 'DateTime'>;
|
package/dist/gmail-client.d.ts
CHANGED
|
@@ -2,6 +2,16 @@ import { type gmail_v1 } from '@googleapis/gmail';
|
|
|
2
2
|
import type { OAuth2Client } from 'google-auth-library';
|
|
3
3
|
import { AuthError, ApiError, NotFoundError, EmptyThreadError, MissingDataError } from './api-utils.js';
|
|
4
4
|
import type { AccountId } from './auth.js';
|
|
5
|
+
export type AuthVerdict = 'pass' | 'fail' | 'softfail' | 'neutral' | 'none' | 'temperror' | 'permerror' | 'bestguesspass';
|
|
6
|
+
export interface AuthResult {
|
|
7
|
+
spf: AuthVerdict;
|
|
8
|
+
dkim: AuthVerdict;
|
|
9
|
+
dmarc: AuthVerdict;
|
|
10
|
+
/** true when all three are 'pass' — the email is fully authenticated */
|
|
11
|
+
authentic: boolean;
|
|
12
|
+
/** raw Authentication-Results header value */
|
|
13
|
+
raw: string;
|
|
14
|
+
}
|
|
5
15
|
export interface Sender {
|
|
6
16
|
name?: string;
|
|
7
17
|
email: string;
|
|
@@ -25,10 +35,13 @@ export interface ParsedMessage {
|
|
|
25
35
|
inReplyTo?: string;
|
|
26
36
|
references?: string;
|
|
27
37
|
listUnsubscribe?: string;
|
|
38
|
+
listUnsubscribePost?: string;
|
|
28
39
|
body: string;
|
|
29
40
|
mimeType: string;
|
|
30
41
|
textBody: string | null;
|
|
31
42
|
attachments: AttachmentMeta[];
|
|
43
|
+
/** SPF/DKIM/DMARC authentication results from Gmail. null for sent/draft messages. */
|
|
44
|
+
auth: AuthResult | null;
|
|
32
45
|
}
|
|
33
46
|
export interface AttachmentMeta {
|
|
34
47
|
attachmentId: string;
|
|
@@ -64,6 +77,7 @@ export interface ThreadListItem {
|
|
|
64
77
|
inReplyTo: string | null;
|
|
65
78
|
hasAttachments: boolean;
|
|
66
79
|
listUnsubscribe: string | null;
|
|
80
|
+
listUnsubscribePost: string | null;
|
|
67
81
|
}
|
|
68
82
|
export interface ThreadListResult {
|
|
69
83
|
threads: ThreadListItem[];
|
|
@@ -199,9 +213,9 @@ export declare class GmailClient {
|
|
|
199
213
|
}): Promise<NotFoundError | AuthError | ApiError | {
|
|
200
214
|
id: string;
|
|
201
215
|
message: ParsedMessage;
|
|
202
|
-
to:
|
|
203
|
-
cc:
|
|
204
|
-
bcc:
|
|
216
|
+
to: Sender[];
|
|
217
|
+
cc: Sender[];
|
|
218
|
+
bcc: Sender[];
|
|
205
219
|
}>;
|
|
206
220
|
listDrafts({ query, maxResults, pageToken, }?: {
|
|
207
221
|
query?: string;
|
|
@@ -224,6 +238,60 @@ export declare class GmailClient {
|
|
|
224
238
|
deleteDraft({ draftId }: {
|
|
225
239
|
draftId: string;
|
|
226
240
|
}): Promise<void>;
|
|
241
|
+
/**
|
|
242
|
+
* Update an existing draft. Gmail replaces the entire message content,
|
|
243
|
+
* so the caller must provide all fields (merge with existing draft before calling).
|
|
244
|
+
*/
|
|
245
|
+
updateDraft({ draftId, to, subject, body, cc, bcc, threadId, fromEmail, attachments, }: {
|
|
246
|
+
draftId: string;
|
|
247
|
+
to: Array<{
|
|
248
|
+
name?: string;
|
|
249
|
+
email: string;
|
|
250
|
+
}>;
|
|
251
|
+
subject: string;
|
|
252
|
+
body: string;
|
|
253
|
+
cc?: Array<{
|
|
254
|
+
name?: string;
|
|
255
|
+
email: string;
|
|
256
|
+
}>;
|
|
257
|
+
bcc?: Array<{
|
|
258
|
+
name?: string;
|
|
259
|
+
email: string;
|
|
260
|
+
}>;
|
|
261
|
+
threadId?: string;
|
|
262
|
+
fromEmail?: string;
|
|
263
|
+
attachments?: Array<{
|
|
264
|
+
filename: string;
|
|
265
|
+
mimeType: string;
|
|
266
|
+
content: Buffer;
|
|
267
|
+
}>;
|
|
268
|
+
}): Promise<AuthError | ApiError | gmail_v1.Schema$Draft>;
|
|
269
|
+
/**
|
|
270
|
+
* Create a draft reply to a thread. Reuses the same reply-to resolution,
|
|
271
|
+
* reply-all CC computation, and In-Reply-To/References header logic as
|
|
272
|
+
* replyToThread(), but saves as a draft instead of sending.
|
|
273
|
+
*/
|
|
274
|
+
createDraftReply({ threadId, body, replyAll, cc, fromEmail, }: {
|
|
275
|
+
threadId: string;
|
|
276
|
+
body: string;
|
|
277
|
+
replyAll?: boolean;
|
|
278
|
+
cc?: Array<{
|
|
279
|
+
email: string;
|
|
280
|
+
}>;
|
|
281
|
+
fromEmail?: string;
|
|
282
|
+
}): Promise<EmptyThreadError | AuthError | ApiError | gmail_v1.Schema$Draft>;
|
|
283
|
+
/**
|
|
284
|
+
* Create a draft forwarding a thread. Reuses the same forwarded-message body
|
|
285
|
+
* building logic as forwardThread(), but saves as a draft instead of sending.
|
|
286
|
+
*/
|
|
287
|
+
createDraftForward({ threadId, to, body, fromEmail, }: {
|
|
288
|
+
threadId: string;
|
|
289
|
+
to: Array<{
|
|
290
|
+
email: string;
|
|
291
|
+
}>;
|
|
292
|
+
body?: string;
|
|
293
|
+
fromEmail?: string;
|
|
294
|
+
}): Promise<EmptyThreadError | AuthError | ApiError | gmail_v1.Schema$Draft>;
|
|
227
295
|
markAsRead({ threadIds }: {
|
|
228
296
|
threadIds: string[];
|
|
229
297
|
}): Promise<void | AuthError | ApiError>;
|
|
@@ -394,3 +462,5 @@ export declare class GmailClient {
|
|
|
394
462
|
private getHeaderAll;
|
|
395
463
|
private getHeaderValues;
|
|
396
464
|
}
|
|
465
|
+
/** Parse a Gmail Authentication-Results header into structured verdicts. */
|
|
466
|
+
export declare function parseAuthResults(header: string): AuthResult;
|