zele 0.3.0 → 0.3.5

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.
Files changed (157) hide show
  1. package/README.md +1 -1
  2. package/bin/zele +27 -0
  3. package/dist/api-utils.d.ts +51 -2
  4. package/dist/api-utils.js +89 -3
  5. package/dist/api-utils.js.map +1 -1
  6. package/dist/auth.d.ts +27 -6
  7. package/dist/auth.js +185 -129
  8. package/dist/auth.js.map +1 -1
  9. package/dist/calendar-client.d.ts +16 -9
  10. package/dist/calendar-client.js +163 -59
  11. package/dist/calendar-client.js.map +1 -1
  12. package/dist/cli.js +26 -1
  13. package/dist/cli.js.map +1 -1
  14. package/dist/commands/attachment.js +17 -15
  15. package/dist/commands/attachment.js.map +1 -1
  16. package/dist/commands/auth-cmd.js +20 -9
  17. package/dist/commands/auth-cmd.js.map +1 -1
  18. package/dist/commands/calendar.js +67 -78
  19. package/dist/commands/calendar.js.map +1 -1
  20. package/dist/commands/draft.js +25 -18
  21. package/dist/commands/draft.js.map +1 -1
  22. package/dist/commands/label.js +33 -45
  23. package/dist/commands/label.js.map +1 -1
  24. package/dist/commands/mail-actions.js +11 -13
  25. package/dist/commands/mail-actions.js.map +1 -1
  26. package/dist/commands/mail.js +112 -126
  27. package/dist/commands/mail.js.map +1 -1
  28. package/dist/commands/profile.js +18 -21
  29. package/dist/commands/profile.js.map +1 -1
  30. package/dist/commands/watch.js +33 -261
  31. package/dist/commands/watch.js.map +1 -1
  32. package/dist/db.js +12 -13
  33. package/dist/db.js.map +1 -1
  34. package/dist/generated/browser.d.ts +12 -27
  35. package/dist/generated/client.d.ts +13 -28
  36. package/dist/generated/client.js +1 -1
  37. package/dist/generated/commonInputTypes.d.ts +90 -26
  38. package/dist/generated/enums.d.ts +0 -4
  39. package/dist/generated/enums.js +0 -3
  40. package/dist/generated/enums.js.map +1 -1
  41. package/dist/generated/internal/class.d.ts +22 -55
  42. package/dist/generated/internal/class.js +12 -4
  43. package/dist/generated/internal/class.js.map +1 -1
  44. package/dist/generated/internal/prismaNamespace.d.ts +272 -511
  45. package/dist/generated/internal/prismaNamespace.js +54 -66
  46. package/dist/generated/internal/prismaNamespace.js.map +1 -1
  47. package/dist/generated/internal/prismaNamespaceBrowser.d.ts +60 -74
  48. package/dist/generated/internal/prismaNamespaceBrowser.js +50 -62
  49. package/dist/generated/internal/prismaNamespaceBrowser.js.map +1 -1
  50. package/dist/generated/models/Account.d.ts +1637 -0
  51. package/dist/generated/models/Account.js +2 -0
  52. package/dist/generated/models/Account.js.map +1 -0
  53. package/dist/generated/models/CalendarList.d.ts +1161 -0
  54. package/dist/generated/models/CalendarList.js +2 -0
  55. package/dist/generated/models/CalendarList.js.map +1 -0
  56. package/dist/generated/models/Label.d.ts +1161 -0
  57. package/dist/generated/models/Label.js +2 -0
  58. package/dist/generated/models/Label.js.map +1 -0
  59. package/dist/generated/models/Profile.d.ts +1269 -0
  60. package/dist/generated/models/Profile.js +2 -0
  61. package/dist/generated/models/Profile.js.map +1 -0
  62. package/dist/generated/models/SyncState.d.ts +1130 -0
  63. package/dist/generated/models/SyncState.js +2 -0
  64. package/dist/generated/models/SyncState.js.map +1 -0
  65. package/dist/generated/models/Thread.d.ts +1608 -0
  66. package/dist/generated/models/Thread.js +2 -0
  67. package/dist/generated/models/Thread.js.map +1 -0
  68. package/dist/generated/models.d.ts +6 -9
  69. package/dist/gmail-client.d.ts +119 -94
  70. package/dist/gmail-client.js +862 -322
  71. package/dist/gmail-client.js.map +1 -1
  72. package/dist/mail-tui.d.ts +1 -0
  73. package/dist/mail-tui.js +517 -0
  74. package/dist/mail-tui.js.map +1 -0
  75. package/dist/output.d.ts +6 -0
  76. package/dist/output.js +124 -11
  77. package/dist/output.js.map +1 -1
  78. package/package.json +39 -11
  79. package/schema.prisma +81 -113
  80. package/src/api-utils.ts +103 -5
  81. package/src/auth.ts +224 -143
  82. package/src/calendar-client.ts +196 -89
  83. package/src/cli.ts +30 -1
  84. package/src/commands/attachment.ts +18 -19
  85. package/src/commands/auth-cmd.ts +19 -9
  86. package/src/commands/calendar.ts +42 -85
  87. package/src/commands/draft.ts +19 -22
  88. package/src/commands/label.ts +21 -57
  89. package/src/commands/mail-actions.ts +11 -19
  90. package/src/commands/mail.ts +102 -147
  91. package/src/commands/profile.ts +12 -28
  92. package/src/commands/watch.ts +37 -304
  93. package/src/db.ts +13 -16
  94. package/src/generated/browser.ts +49 -0
  95. package/src/generated/client.ts +71 -0
  96. package/src/generated/commonInputTypes.ts +332 -0
  97. package/src/generated/enums.ts +17 -0
  98. package/src/generated/internal/class.ts +250 -0
  99. package/src/generated/internal/prismaNamespace.ts +1198 -0
  100. package/src/generated/internal/prismaNamespaceBrowser.ts +169 -0
  101. package/src/generated/models/Account.ts +1848 -0
  102. package/src/generated/models/CalendarList.ts +1331 -0
  103. package/src/generated/models/Label.ts +1331 -0
  104. package/src/generated/models/Profile.ts +1439 -0
  105. package/src/generated/models/SyncState.ts +1300 -0
  106. package/src/generated/models/Thread.ts +1787 -0
  107. package/src/generated/models.ts +17 -0
  108. package/src/gmail-client.test.ts +59 -0
  109. package/src/gmail-client.ts +1034 -429
  110. package/src/mail-tui.tsx +1061 -0
  111. package/src/output.test.ts +1093 -0
  112. package/src/output.ts +128 -13
  113. package/src/schema.sql +58 -68
  114. package/src/test-fixtures/email-html/safe-claude-event.html +28 -0
  115. package/src/test-fixtures/email-html/safe-product-announcement.html +25 -0
  116. package/src/test-fixtures/email-html/safe-tracked-links.html +27 -0
  117. package/src/test-fixtures/email-html-snapshots/safe-claude-event.html.md +9 -0
  118. package/src/test-fixtures/email-html-snapshots/safe-product-announcement.html.md +13 -0
  119. package/src/test-fixtures/email-html-snapshots/safe-tracked-links.html.md +7 -0
  120. package/AGENTS.md +0 -26
  121. package/CHANGELOG.md +0 -43
  122. package/dist/generated/models/accounts.d.ts +0 -2000
  123. package/dist/generated/models/accounts.js +0 -2
  124. package/dist/generated/models/accounts.js.map +0 -1
  125. package/dist/generated/models/calendar_events.d.ts +0 -1433
  126. package/dist/generated/models/calendar_events.js +0 -2
  127. package/dist/generated/models/calendar_events.js.map +0 -1
  128. package/dist/generated/models/calendar_lists.d.ts +0 -1131
  129. package/dist/generated/models/calendar_lists.js +0 -2
  130. package/dist/generated/models/calendar_lists.js.map +0 -1
  131. package/dist/generated/models/label_counts.d.ts +0 -1131
  132. package/dist/generated/models/label_counts.js +0 -2
  133. package/dist/generated/models/label_counts.js.map +0 -1
  134. package/dist/generated/models/labels.d.ts +0 -1131
  135. package/dist/generated/models/labels.js +0 -2
  136. package/dist/generated/models/labels.js.map +0 -1
  137. package/dist/generated/models/profiles.d.ts +0 -1131
  138. package/dist/generated/models/profiles.js +0 -2
  139. package/dist/generated/models/profiles.js.map +0 -1
  140. package/dist/generated/models/sync_states.d.ts +0 -1107
  141. package/dist/generated/models/sync_states.js +0 -2
  142. package/dist/generated/models/sync_states.js.map +0 -1
  143. package/dist/generated/models/thread_lists.d.ts +0 -1404
  144. package/dist/generated/models/thread_lists.js +0 -2
  145. package/dist/generated/models/thread_lists.js.map +0 -1
  146. package/dist/generated/models/threads.d.ts +0 -1247
  147. package/dist/generated/models/threads.js +0 -2
  148. package/dist/generated/models/threads.js.map +0 -1
  149. package/dist/gmail-cache.d.ts +0 -60
  150. package/dist/gmail-cache.js +0 -264
  151. package/dist/gmail-cache.js.map +0 -1
  152. package/docs/gogcli-gmail-implementation.md +0 -599
  153. package/scripts/test-device-code-clients.ts +0 -186
  154. package/scripts/test-micropython-scopes.ts +0 -72
  155. package/scripts/test-oauth-clients.ts +0 -257
  156. package/src/gmail-cache.ts +0 -339
  157. package/tsconfig.json +0 -16
@@ -0,0 +1,1608 @@
1
+ import type * as runtime from "@prisma/client/runtime/client";
2
+ import type * as Prisma from "../internal/prismaNamespace.js";
3
+ /**
4
+ * Model Thread
5
+ *
6
+ */
7
+ export type ThreadModel = runtime.Types.Result.DefaultSelection<Prisma.$ThreadPayload>;
8
+ export type AggregateThread = {
9
+ _count: ThreadCountAggregateOutputType | null;
10
+ _avg: ThreadAvgAggregateOutputType | null;
11
+ _sum: ThreadSumAggregateOutputType | null;
12
+ _min: ThreadMinAggregateOutputType | null;
13
+ _max: ThreadMaxAggregateOutputType | null;
14
+ };
15
+ export type ThreadAvgAggregateOutputType = {
16
+ id: number | null;
17
+ msgCount: number | null;
18
+ ttlMs: number | null;
19
+ };
20
+ export type ThreadSumAggregateOutputType = {
21
+ id: number | null;
22
+ msgCount: number | null;
23
+ ttlMs: number | null;
24
+ };
25
+ export type ThreadMinAggregateOutputType = {
26
+ id: number | null;
27
+ email: string | null;
28
+ appId: string | null;
29
+ threadId: string | null;
30
+ subject: string | null;
31
+ snippet: string | null;
32
+ fromEmail: string | null;
33
+ fromName: string | null;
34
+ date: string | null;
35
+ labelIds: string | null;
36
+ hasUnread: boolean | null;
37
+ msgCount: number | null;
38
+ historyId: string | null;
39
+ rawData: string | null;
40
+ ttlMs: number | null;
41
+ createdAt: Date | null;
42
+ };
43
+ export type ThreadMaxAggregateOutputType = {
44
+ id: number | null;
45
+ email: string | null;
46
+ appId: string | null;
47
+ threadId: string | null;
48
+ subject: string | null;
49
+ snippet: string | null;
50
+ fromEmail: string | null;
51
+ fromName: string | null;
52
+ date: string | null;
53
+ labelIds: string | null;
54
+ hasUnread: boolean | null;
55
+ msgCount: number | null;
56
+ historyId: string | null;
57
+ rawData: string | null;
58
+ ttlMs: number | null;
59
+ createdAt: Date | null;
60
+ };
61
+ export type ThreadCountAggregateOutputType = {
62
+ id: number;
63
+ email: number;
64
+ appId: number;
65
+ threadId: number;
66
+ subject: number;
67
+ snippet: number;
68
+ fromEmail: number;
69
+ fromName: number;
70
+ date: number;
71
+ labelIds: number;
72
+ hasUnread: number;
73
+ msgCount: number;
74
+ historyId: number;
75
+ rawData: number;
76
+ ttlMs: number;
77
+ createdAt: number;
78
+ _all: number;
79
+ };
80
+ export type ThreadAvgAggregateInputType = {
81
+ id?: true;
82
+ msgCount?: true;
83
+ ttlMs?: true;
84
+ };
85
+ export type ThreadSumAggregateInputType = {
86
+ id?: true;
87
+ msgCount?: true;
88
+ ttlMs?: true;
89
+ };
90
+ export type ThreadMinAggregateInputType = {
91
+ id?: true;
92
+ email?: true;
93
+ appId?: true;
94
+ threadId?: true;
95
+ subject?: true;
96
+ snippet?: true;
97
+ fromEmail?: true;
98
+ fromName?: true;
99
+ date?: true;
100
+ labelIds?: true;
101
+ hasUnread?: true;
102
+ msgCount?: true;
103
+ historyId?: true;
104
+ rawData?: true;
105
+ ttlMs?: true;
106
+ createdAt?: true;
107
+ };
108
+ export type ThreadMaxAggregateInputType = {
109
+ id?: true;
110
+ email?: true;
111
+ appId?: true;
112
+ threadId?: true;
113
+ subject?: true;
114
+ snippet?: true;
115
+ fromEmail?: true;
116
+ fromName?: true;
117
+ date?: true;
118
+ labelIds?: true;
119
+ hasUnread?: true;
120
+ msgCount?: true;
121
+ historyId?: true;
122
+ rawData?: true;
123
+ ttlMs?: true;
124
+ createdAt?: true;
125
+ };
126
+ export type ThreadCountAggregateInputType = {
127
+ id?: true;
128
+ email?: true;
129
+ appId?: true;
130
+ threadId?: true;
131
+ subject?: true;
132
+ snippet?: true;
133
+ fromEmail?: true;
134
+ fromName?: true;
135
+ date?: true;
136
+ labelIds?: true;
137
+ hasUnread?: true;
138
+ msgCount?: true;
139
+ historyId?: true;
140
+ rawData?: true;
141
+ ttlMs?: true;
142
+ createdAt?: true;
143
+ _all?: true;
144
+ };
145
+ export type ThreadAggregateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
146
+ /**
147
+ * Filter which Thread to aggregate.
148
+ */
149
+ where?: Prisma.ThreadWhereInput;
150
+ /**
151
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
152
+ *
153
+ * Determine the order of Threads to fetch.
154
+ */
155
+ orderBy?: Prisma.ThreadOrderByWithRelationInput | Prisma.ThreadOrderByWithRelationInput[];
156
+ /**
157
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
158
+ *
159
+ * Sets the start position
160
+ */
161
+ cursor?: Prisma.ThreadWhereUniqueInput;
162
+ /**
163
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
164
+ *
165
+ * Take `±n` Threads from the position of the cursor.
166
+ */
167
+ take?: number;
168
+ /**
169
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
170
+ *
171
+ * Skip the first `n` Threads.
172
+ */
173
+ skip?: number;
174
+ /**
175
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
176
+ *
177
+ * Count returned Threads
178
+ **/
179
+ _count?: true | ThreadCountAggregateInputType;
180
+ /**
181
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
182
+ *
183
+ * Select which fields to average
184
+ **/
185
+ _avg?: ThreadAvgAggregateInputType;
186
+ /**
187
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
188
+ *
189
+ * Select which fields to sum
190
+ **/
191
+ _sum?: ThreadSumAggregateInputType;
192
+ /**
193
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
194
+ *
195
+ * Select which fields to find the minimum value
196
+ **/
197
+ _min?: ThreadMinAggregateInputType;
198
+ /**
199
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
200
+ *
201
+ * Select which fields to find the maximum value
202
+ **/
203
+ _max?: ThreadMaxAggregateInputType;
204
+ };
205
+ export type GetThreadAggregateType<T extends ThreadAggregateArgs> = {
206
+ [P in keyof T & keyof AggregateThread]: P extends '_count' | 'count' ? T[P] extends true ? number : Prisma.GetScalarType<T[P], AggregateThread[P]> : Prisma.GetScalarType<T[P], AggregateThread[P]>;
207
+ };
208
+ export type ThreadGroupByArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
209
+ where?: Prisma.ThreadWhereInput;
210
+ orderBy?: Prisma.ThreadOrderByWithAggregationInput | Prisma.ThreadOrderByWithAggregationInput[];
211
+ by: Prisma.ThreadScalarFieldEnum[] | Prisma.ThreadScalarFieldEnum;
212
+ having?: Prisma.ThreadScalarWhereWithAggregatesInput;
213
+ take?: number;
214
+ skip?: number;
215
+ _count?: ThreadCountAggregateInputType | true;
216
+ _avg?: ThreadAvgAggregateInputType;
217
+ _sum?: ThreadSumAggregateInputType;
218
+ _min?: ThreadMinAggregateInputType;
219
+ _max?: ThreadMaxAggregateInputType;
220
+ };
221
+ export type ThreadGroupByOutputType = {
222
+ id: number;
223
+ email: string;
224
+ appId: string;
225
+ threadId: string;
226
+ subject: string;
227
+ snippet: string;
228
+ fromEmail: string;
229
+ fromName: string;
230
+ date: string;
231
+ labelIds: string;
232
+ hasUnread: boolean;
233
+ msgCount: number;
234
+ historyId: string | null;
235
+ rawData: string;
236
+ ttlMs: number;
237
+ createdAt: Date;
238
+ _count: ThreadCountAggregateOutputType | null;
239
+ _avg: ThreadAvgAggregateOutputType | null;
240
+ _sum: ThreadSumAggregateOutputType | null;
241
+ _min: ThreadMinAggregateOutputType | null;
242
+ _max: ThreadMaxAggregateOutputType | null;
243
+ };
244
+ type GetThreadGroupByPayload<T extends ThreadGroupByArgs> = Prisma.PrismaPromise<Array<Prisma.PickEnumerable<ThreadGroupByOutputType, T['by']> & {
245
+ [P in ((keyof T) & (keyof ThreadGroupByOutputType))]: P extends '_count' ? T[P] extends boolean ? number : Prisma.GetScalarType<T[P], ThreadGroupByOutputType[P]> : Prisma.GetScalarType<T[P], ThreadGroupByOutputType[P]>;
246
+ }>>;
247
+ export type ThreadWhereInput = {
248
+ AND?: Prisma.ThreadWhereInput | Prisma.ThreadWhereInput[];
249
+ OR?: Prisma.ThreadWhereInput[];
250
+ NOT?: Prisma.ThreadWhereInput | Prisma.ThreadWhereInput[];
251
+ id?: Prisma.IntFilter<"Thread"> | number;
252
+ email?: Prisma.StringFilter<"Thread"> | string;
253
+ appId?: Prisma.StringFilter<"Thread"> | string;
254
+ threadId?: Prisma.StringFilter<"Thread"> | string;
255
+ subject?: Prisma.StringFilter<"Thread"> | string;
256
+ snippet?: Prisma.StringFilter<"Thread"> | string;
257
+ fromEmail?: Prisma.StringFilter<"Thread"> | string;
258
+ fromName?: Prisma.StringFilter<"Thread"> | string;
259
+ date?: Prisma.StringFilter<"Thread"> | string;
260
+ labelIds?: Prisma.StringFilter<"Thread"> | string;
261
+ hasUnread?: Prisma.BoolFilter<"Thread"> | boolean;
262
+ msgCount?: Prisma.IntFilter<"Thread"> | number;
263
+ historyId?: Prisma.StringNullableFilter<"Thread"> | string | null;
264
+ rawData?: Prisma.StringFilter<"Thread"> | string;
265
+ ttlMs?: Prisma.IntFilter<"Thread"> | number;
266
+ createdAt?: Prisma.DateTimeFilter<"Thread"> | Date | string;
267
+ account?: Prisma.XOR<Prisma.AccountScalarRelationFilter, Prisma.AccountWhereInput>;
268
+ };
269
+ export type ThreadOrderByWithRelationInput = {
270
+ id?: Prisma.SortOrder;
271
+ email?: Prisma.SortOrder;
272
+ appId?: Prisma.SortOrder;
273
+ threadId?: Prisma.SortOrder;
274
+ subject?: Prisma.SortOrder;
275
+ snippet?: Prisma.SortOrder;
276
+ fromEmail?: Prisma.SortOrder;
277
+ fromName?: Prisma.SortOrder;
278
+ date?: Prisma.SortOrder;
279
+ labelIds?: Prisma.SortOrder;
280
+ hasUnread?: Prisma.SortOrder;
281
+ msgCount?: Prisma.SortOrder;
282
+ historyId?: Prisma.SortOrderInput | Prisma.SortOrder;
283
+ rawData?: Prisma.SortOrder;
284
+ ttlMs?: Prisma.SortOrder;
285
+ createdAt?: Prisma.SortOrder;
286
+ account?: Prisma.AccountOrderByWithRelationInput;
287
+ };
288
+ export type ThreadWhereUniqueInput = Prisma.AtLeast<{
289
+ id?: number;
290
+ email_appId_threadId?: Prisma.ThreadEmailAppIdThreadIdCompoundUniqueInput;
291
+ AND?: Prisma.ThreadWhereInput | Prisma.ThreadWhereInput[];
292
+ OR?: Prisma.ThreadWhereInput[];
293
+ NOT?: Prisma.ThreadWhereInput | Prisma.ThreadWhereInput[];
294
+ email?: Prisma.StringFilter<"Thread"> | string;
295
+ appId?: Prisma.StringFilter<"Thread"> | string;
296
+ threadId?: Prisma.StringFilter<"Thread"> | string;
297
+ subject?: Prisma.StringFilter<"Thread"> | string;
298
+ snippet?: Prisma.StringFilter<"Thread"> | string;
299
+ fromEmail?: Prisma.StringFilter<"Thread"> | string;
300
+ fromName?: Prisma.StringFilter<"Thread"> | string;
301
+ date?: Prisma.StringFilter<"Thread"> | string;
302
+ labelIds?: Prisma.StringFilter<"Thread"> | string;
303
+ hasUnread?: Prisma.BoolFilter<"Thread"> | boolean;
304
+ msgCount?: Prisma.IntFilter<"Thread"> | number;
305
+ historyId?: Prisma.StringNullableFilter<"Thread"> | string | null;
306
+ rawData?: Prisma.StringFilter<"Thread"> | string;
307
+ ttlMs?: Prisma.IntFilter<"Thread"> | number;
308
+ createdAt?: Prisma.DateTimeFilter<"Thread"> | Date | string;
309
+ account?: Prisma.XOR<Prisma.AccountScalarRelationFilter, Prisma.AccountWhereInput>;
310
+ }, "id" | "email_appId_threadId">;
311
+ export type ThreadOrderByWithAggregationInput = {
312
+ id?: Prisma.SortOrder;
313
+ email?: Prisma.SortOrder;
314
+ appId?: Prisma.SortOrder;
315
+ threadId?: Prisma.SortOrder;
316
+ subject?: Prisma.SortOrder;
317
+ snippet?: Prisma.SortOrder;
318
+ fromEmail?: Prisma.SortOrder;
319
+ fromName?: Prisma.SortOrder;
320
+ date?: Prisma.SortOrder;
321
+ labelIds?: Prisma.SortOrder;
322
+ hasUnread?: Prisma.SortOrder;
323
+ msgCount?: Prisma.SortOrder;
324
+ historyId?: Prisma.SortOrderInput | Prisma.SortOrder;
325
+ rawData?: Prisma.SortOrder;
326
+ ttlMs?: Prisma.SortOrder;
327
+ createdAt?: Prisma.SortOrder;
328
+ _count?: Prisma.ThreadCountOrderByAggregateInput;
329
+ _avg?: Prisma.ThreadAvgOrderByAggregateInput;
330
+ _max?: Prisma.ThreadMaxOrderByAggregateInput;
331
+ _min?: Prisma.ThreadMinOrderByAggregateInput;
332
+ _sum?: Prisma.ThreadSumOrderByAggregateInput;
333
+ };
334
+ export type ThreadScalarWhereWithAggregatesInput = {
335
+ AND?: Prisma.ThreadScalarWhereWithAggregatesInput | Prisma.ThreadScalarWhereWithAggregatesInput[];
336
+ OR?: Prisma.ThreadScalarWhereWithAggregatesInput[];
337
+ NOT?: Prisma.ThreadScalarWhereWithAggregatesInput | Prisma.ThreadScalarWhereWithAggregatesInput[];
338
+ id?: Prisma.IntWithAggregatesFilter<"Thread"> | number;
339
+ email?: Prisma.StringWithAggregatesFilter<"Thread"> | string;
340
+ appId?: Prisma.StringWithAggregatesFilter<"Thread"> | string;
341
+ threadId?: Prisma.StringWithAggregatesFilter<"Thread"> | string;
342
+ subject?: Prisma.StringWithAggregatesFilter<"Thread"> | string;
343
+ snippet?: Prisma.StringWithAggregatesFilter<"Thread"> | string;
344
+ fromEmail?: Prisma.StringWithAggregatesFilter<"Thread"> | string;
345
+ fromName?: Prisma.StringWithAggregatesFilter<"Thread"> | string;
346
+ date?: Prisma.StringWithAggregatesFilter<"Thread"> | string;
347
+ labelIds?: Prisma.StringWithAggregatesFilter<"Thread"> | string;
348
+ hasUnread?: Prisma.BoolWithAggregatesFilter<"Thread"> | boolean;
349
+ msgCount?: Prisma.IntWithAggregatesFilter<"Thread"> | number;
350
+ historyId?: Prisma.StringNullableWithAggregatesFilter<"Thread"> | string | null;
351
+ rawData?: Prisma.StringWithAggregatesFilter<"Thread"> | string;
352
+ ttlMs?: Prisma.IntWithAggregatesFilter<"Thread"> | number;
353
+ createdAt?: Prisma.DateTimeWithAggregatesFilter<"Thread"> | Date | string;
354
+ };
355
+ export type ThreadCreateInput = {
356
+ threadId: string;
357
+ subject: string;
358
+ snippet: string;
359
+ fromEmail: string;
360
+ fromName: string;
361
+ date: string;
362
+ labelIds: string;
363
+ hasUnread: boolean;
364
+ msgCount: number;
365
+ historyId?: string | null;
366
+ rawData: string;
367
+ ttlMs: number;
368
+ createdAt: Date | string;
369
+ account: Prisma.AccountCreateNestedOneWithoutThreadsInput;
370
+ };
371
+ export type ThreadUncheckedCreateInput = {
372
+ id?: number;
373
+ email: string;
374
+ appId: string;
375
+ threadId: string;
376
+ subject: string;
377
+ snippet: string;
378
+ fromEmail: string;
379
+ fromName: string;
380
+ date: string;
381
+ labelIds: string;
382
+ hasUnread: boolean;
383
+ msgCount: number;
384
+ historyId?: string | null;
385
+ rawData: string;
386
+ ttlMs: number;
387
+ createdAt: Date | string;
388
+ };
389
+ export type ThreadUpdateInput = {
390
+ threadId?: Prisma.StringFieldUpdateOperationsInput | string;
391
+ subject?: Prisma.StringFieldUpdateOperationsInput | string;
392
+ snippet?: Prisma.StringFieldUpdateOperationsInput | string;
393
+ fromEmail?: Prisma.StringFieldUpdateOperationsInput | string;
394
+ fromName?: Prisma.StringFieldUpdateOperationsInput | string;
395
+ date?: Prisma.StringFieldUpdateOperationsInput | string;
396
+ labelIds?: Prisma.StringFieldUpdateOperationsInput | string;
397
+ hasUnread?: Prisma.BoolFieldUpdateOperationsInput | boolean;
398
+ msgCount?: Prisma.IntFieldUpdateOperationsInput | number;
399
+ historyId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
400
+ rawData?: Prisma.StringFieldUpdateOperationsInput | string;
401
+ ttlMs?: Prisma.IntFieldUpdateOperationsInput | number;
402
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
403
+ account?: Prisma.AccountUpdateOneRequiredWithoutThreadsNestedInput;
404
+ };
405
+ export type ThreadUncheckedUpdateInput = {
406
+ id?: Prisma.IntFieldUpdateOperationsInput | number;
407
+ email?: Prisma.StringFieldUpdateOperationsInput | string;
408
+ appId?: Prisma.StringFieldUpdateOperationsInput | string;
409
+ threadId?: Prisma.StringFieldUpdateOperationsInput | string;
410
+ subject?: Prisma.StringFieldUpdateOperationsInput | string;
411
+ snippet?: Prisma.StringFieldUpdateOperationsInput | string;
412
+ fromEmail?: Prisma.StringFieldUpdateOperationsInput | string;
413
+ fromName?: Prisma.StringFieldUpdateOperationsInput | string;
414
+ date?: Prisma.StringFieldUpdateOperationsInput | string;
415
+ labelIds?: Prisma.StringFieldUpdateOperationsInput | string;
416
+ hasUnread?: Prisma.BoolFieldUpdateOperationsInput | boolean;
417
+ msgCount?: Prisma.IntFieldUpdateOperationsInput | number;
418
+ historyId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
419
+ rawData?: Prisma.StringFieldUpdateOperationsInput | string;
420
+ ttlMs?: Prisma.IntFieldUpdateOperationsInput | number;
421
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
422
+ };
423
+ export type ThreadCreateManyInput = {
424
+ id?: number;
425
+ email: string;
426
+ appId: string;
427
+ threadId: string;
428
+ subject: string;
429
+ snippet: string;
430
+ fromEmail: string;
431
+ fromName: string;
432
+ date: string;
433
+ labelIds: string;
434
+ hasUnread: boolean;
435
+ msgCount: number;
436
+ historyId?: string | null;
437
+ rawData: string;
438
+ ttlMs: number;
439
+ createdAt: Date | string;
440
+ };
441
+ export type ThreadUpdateManyMutationInput = {
442
+ threadId?: Prisma.StringFieldUpdateOperationsInput | string;
443
+ subject?: Prisma.StringFieldUpdateOperationsInput | string;
444
+ snippet?: Prisma.StringFieldUpdateOperationsInput | string;
445
+ fromEmail?: Prisma.StringFieldUpdateOperationsInput | string;
446
+ fromName?: Prisma.StringFieldUpdateOperationsInput | string;
447
+ date?: Prisma.StringFieldUpdateOperationsInput | string;
448
+ labelIds?: Prisma.StringFieldUpdateOperationsInput | string;
449
+ hasUnread?: Prisma.BoolFieldUpdateOperationsInput | boolean;
450
+ msgCount?: Prisma.IntFieldUpdateOperationsInput | number;
451
+ historyId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
452
+ rawData?: Prisma.StringFieldUpdateOperationsInput | string;
453
+ ttlMs?: Prisma.IntFieldUpdateOperationsInput | number;
454
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
455
+ };
456
+ export type ThreadUncheckedUpdateManyInput = {
457
+ id?: Prisma.IntFieldUpdateOperationsInput | number;
458
+ email?: Prisma.StringFieldUpdateOperationsInput | string;
459
+ appId?: Prisma.StringFieldUpdateOperationsInput | string;
460
+ threadId?: Prisma.StringFieldUpdateOperationsInput | string;
461
+ subject?: Prisma.StringFieldUpdateOperationsInput | string;
462
+ snippet?: Prisma.StringFieldUpdateOperationsInput | string;
463
+ fromEmail?: Prisma.StringFieldUpdateOperationsInput | string;
464
+ fromName?: Prisma.StringFieldUpdateOperationsInput | string;
465
+ date?: Prisma.StringFieldUpdateOperationsInput | string;
466
+ labelIds?: Prisma.StringFieldUpdateOperationsInput | string;
467
+ hasUnread?: Prisma.BoolFieldUpdateOperationsInput | boolean;
468
+ msgCount?: Prisma.IntFieldUpdateOperationsInput | number;
469
+ historyId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
470
+ rawData?: Prisma.StringFieldUpdateOperationsInput | string;
471
+ ttlMs?: Prisma.IntFieldUpdateOperationsInput | number;
472
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
473
+ };
474
+ export type ThreadListRelationFilter = {
475
+ every?: Prisma.ThreadWhereInput;
476
+ some?: Prisma.ThreadWhereInput;
477
+ none?: Prisma.ThreadWhereInput;
478
+ };
479
+ export type ThreadOrderByRelationAggregateInput = {
480
+ _count?: Prisma.SortOrder;
481
+ };
482
+ export type ThreadEmailAppIdThreadIdCompoundUniqueInput = {
483
+ email: string;
484
+ appId: string;
485
+ threadId: string;
486
+ };
487
+ export type ThreadCountOrderByAggregateInput = {
488
+ id?: Prisma.SortOrder;
489
+ email?: Prisma.SortOrder;
490
+ appId?: Prisma.SortOrder;
491
+ threadId?: Prisma.SortOrder;
492
+ subject?: Prisma.SortOrder;
493
+ snippet?: Prisma.SortOrder;
494
+ fromEmail?: Prisma.SortOrder;
495
+ fromName?: Prisma.SortOrder;
496
+ date?: Prisma.SortOrder;
497
+ labelIds?: Prisma.SortOrder;
498
+ hasUnread?: Prisma.SortOrder;
499
+ msgCount?: Prisma.SortOrder;
500
+ historyId?: Prisma.SortOrder;
501
+ rawData?: Prisma.SortOrder;
502
+ ttlMs?: Prisma.SortOrder;
503
+ createdAt?: Prisma.SortOrder;
504
+ };
505
+ export type ThreadAvgOrderByAggregateInput = {
506
+ id?: Prisma.SortOrder;
507
+ msgCount?: Prisma.SortOrder;
508
+ ttlMs?: Prisma.SortOrder;
509
+ };
510
+ export type ThreadMaxOrderByAggregateInput = {
511
+ id?: Prisma.SortOrder;
512
+ email?: Prisma.SortOrder;
513
+ appId?: Prisma.SortOrder;
514
+ threadId?: Prisma.SortOrder;
515
+ subject?: Prisma.SortOrder;
516
+ snippet?: Prisma.SortOrder;
517
+ fromEmail?: Prisma.SortOrder;
518
+ fromName?: Prisma.SortOrder;
519
+ date?: Prisma.SortOrder;
520
+ labelIds?: Prisma.SortOrder;
521
+ hasUnread?: Prisma.SortOrder;
522
+ msgCount?: Prisma.SortOrder;
523
+ historyId?: Prisma.SortOrder;
524
+ rawData?: Prisma.SortOrder;
525
+ ttlMs?: Prisma.SortOrder;
526
+ createdAt?: Prisma.SortOrder;
527
+ };
528
+ export type ThreadMinOrderByAggregateInput = {
529
+ id?: Prisma.SortOrder;
530
+ email?: Prisma.SortOrder;
531
+ appId?: Prisma.SortOrder;
532
+ threadId?: Prisma.SortOrder;
533
+ subject?: Prisma.SortOrder;
534
+ snippet?: Prisma.SortOrder;
535
+ fromEmail?: Prisma.SortOrder;
536
+ fromName?: Prisma.SortOrder;
537
+ date?: Prisma.SortOrder;
538
+ labelIds?: Prisma.SortOrder;
539
+ hasUnread?: Prisma.SortOrder;
540
+ msgCount?: Prisma.SortOrder;
541
+ historyId?: Prisma.SortOrder;
542
+ rawData?: Prisma.SortOrder;
543
+ ttlMs?: Prisma.SortOrder;
544
+ createdAt?: Prisma.SortOrder;
545
+ };
546
+ export type ThreadSumOrderByAggregateInput = {
547
+ id?: Prisma.SortOrder;
548
+ msgCount?: Prisma.SortOrder;
549
+ ttlMs?: Prisma.SortOrder;
550
+ };
551
+ export type ThreadCreateNestedManyWithoutAccountInput = {
552
+ create?: Prisma.XOR<Prisma.ThreadCreateWithoutAccountInput, Prisma.ThreadUncheckedCreateWithoutAccountInput> | Prisma.ThreadCreateWithoutAccountInput[] | Prisma.ThreadUncheckedCreateWithoutAccountInput[];
553
+ connectOrCreate?: Prisma.ThreadCreateOrConnectWithoutAccountInput | Prisma.ThreadCreateOrConnectWithoutAccountInput[];
554
+ createMany?: Prisma.ThreadCreateManyAccountInputEnvelope;
555
+ connect?: Prisma.ThreadWhereUniqueInput | Prisma.ThreadWhereUniqueInput[];
556
+ };
557
+ export type ThreadUncheckedCreateNestedManyWithoutAccountInput = {
558
+ create?: Prisma.XOR<Prisma.ThreadCreateWithoutAccountInput, Prisma.ThreadUncheckedCreateWithoutAccountInput> | Prisma.ThreadCreateWithoutAccountInput[] | Prisma.ThreadUncheckedCreateWithoutAccountInput[];
559
+ connectOrCreate?: Prisma.ThreadCreateOrConnectWithoutAccountInput | Prisma.ThreadCreateOrConnectWithoutAccountInput[];
560
+ createMany?: Prisma.ThreadCreateManyAccountInputEnvelope;
561
+ connect?: Prisma.ThreadWhereUniqueInput | Prisma.ThreadWhereUniqueInput[];
562
+ };
563
+ export type ThreadUpdateManyWithoutAccountNestedInput = {
564
+ create?: Prisma.XOR<Prisma.ThreadCreateWithoutAccountInput, Prisma.ThreadUncheckedCreateWithoutAccountInput> | Prisma.ThreadCreateWithoutAccountInput[] | Prisma.ThreadUncheckedCreateWithoutAccountInput[];
565
+ connectOrCreate?: Prisma.ThreadCreateOrConnectWithoutAccountInput | Prisma.ThreadCreateOrConnectWithoutAccountInput[];
566
+ upsert?: Prisma.ThreadUpsertWithWhereUniqueWithoutAccountInput | Prisma.ThreadUpsertWithWhereUniqueWithoutAccountInput[];
567
+ createMany?: Prisma.ThreadCreateManyAccountInputEnvelope;
568
+ set?: Prisma.ThreadWhereUniqueInput | Prisma.ThreadWhereUniqueInput[];
569
+ disconnect?: Prisma.ThreadWhereUniqueInput | Prisma.ThreadWhereUniqueInput[];
570
+ delete?: Prisma.ThreadWhereUniqueInput | Prisma.ThreadWhereUniqueInput[];
571
+ connect?: Prisma.ThreadWhereUniqueInput | Prisma.ThreadWhereUniqueInput[];
572
+ update?: Prisma.ThreadUpdateWithWhereUniqueWithoutAccountInput | Prisma.ThreadUpdateWithWhereUniqueWithoutAccountInput[];
573
+ updateMany?: Prisma.ThreadUpdateManyWithWhereWithoutAccountInput | Prisma.ThreadUpdateManyWithWhereWithoutAccountInput[];
574
+ deleteMany?: Prisma.ThreadScalarWhereInput | Prisma.ThreadScalarWhereInput[];
575
+ };
576
+ export type ThreadUncheckedUpdateManyWithoutAccountNestedInput = {
577
+ create?: Prisma.XOR<Prisma.ThreadCreateWithoutAccountInput, Prisma.ThreadUncheckedCreateWithoutAccountInput> | Prisma.ThreadCreateWithoutAccountInput[] | Prisma.ThreadUncheckedCreateWithoutAccountInput[];
578
+ connectOrCreate?: Prisma.ThreadCreateOrConnectWithoutAccountInput | Prisma.ThreadCreateOrConnectWithoutAccountInput[];
579
+ upsert?: Prisma.ThreadUpsertWithWhereUniqueWithoutAccountInput | Prisma.ThreadUpsertWithWhereUniqueWithoutAccountInput[];
580
+ createMany?: Prisma.ThreadCreateManyAccountInputEnvelope;
581
+ set?: Prisma.ThreadWhereUniqueInput | Prisma.ThreadWhereUniqueInput[];
582
+ disconnect?: Prisma.ThreadWhereUniqueInput | Prisma.ThreadWhereUniqueInput[];
583
+ delete?: Prisma.ThreadWhereUniqueInput | Prisma.ThreadWhereUniqueInput[];
584
+ connect?: Prisma.ThreadWhereUniqueInput | Prisma.ThreadWhereUniqueInput[];
585
+ update?: Prisma.ThreadUpdateWithWhereUniqueWithoutAccountInput | Prisma.ThreadUpdateWithWhereUniqueWithoutAccountInput[];
586
+ updateMany?: Prisma.ThreadUpdateManyWithWhereWithoutAccountInput | Prisma.ThreadUpdateManyWithWhereWithoutAccountInput[];
587
+ deleteMany?: Prisma.ThreadScalarWhereInput | Prisma.ThreadScalarWhereInput[];
588
+ };
589
+ export type BoolFieldUpdateOperationsInput = {
590
+ set?: boolean;
591
+ };
592
+ export type IntFieldUpdateOperationsInput = {
593
+ set?: number;
594
+ increment?: number;
595
+ decrement?: number;
596
+ multiply?: number;
597
+ divide?: number;
598
+ };
599
+ export type NullableStringFieldUpdateOperationsInput = {
600
+ set?: string | null;
601
+ };
602
+ export type ThreadCreateWithoutAccountInput = {
603
+ threadId: string;
604
+ subject: string;
605
+ snippet: string;
606
+ fromEmail: string;
607
+ fromName: string;
608
+ date: string;
609
+ labelIds: string;
610
+ hasUnread: boolean;
611
+ msgCount: number;
612
+ historyId?: string | null;
613
+ rawData: string;
614
+ ttlMs: number;
615
+ createdAt: Date | string;
616
+ };
617
+ export type ThreadUncheckedCreateWithoutAccountInput = {
618
+ id?: number;
619
+ threadId: string;
620
+ subject: string;
621
+ snippet: string;
622
+ fromEmail: string;
623
+ fromName: string;
624
+ date: string;
625
+ labelIds: string;
626
+ hasUnread: boolean;
627
+ msgCount: number;
628
+ historyId?: string | null;
629
+ rawData: string;
630
+ ttlMs: number;
631
+ createdAt: Date | string;
632
+ };
633
+ export type ThreadCreateOrConnectWithoutAccountInput = {
634
+ where: Prisma.ThreadWhereUniqueInput;
635
+ create: Prisma.XOR<Prisma.ThreadCreateWithoutAccountInput, Prisma.ThreadUncheckedCreateWithoutAccountInput>;
636
+ };
637
+ export type ThreadCreateManyAccountInputEnvelope = {
638
+ data: Prisma.ThreadCreateManyAccountInput | Prisma.ThreadCreateManyAccountInput[];
639
+ };
640
+ export type ThreadUpsertWithWhereUniqueWithoutAccountInput = {
641
+ where: Prisma.ThreadWhereUniqueInput;
642
+ update: Prisma.XOR<Prisma.ThreadUpdateWithoutAccountInput, Prisma.ThreadUncheckedUpdateWithoutAccountInput>;
643
+ create: Prisma.XOR<Prisma.ThreadCreateWithoutAccountInput, Prisma.ThreadUncheckedCreateWithoutAccountInput>;
644
+ };
645
+ export type ThreadUpdateWithWhereUniqueWithoutAccountInput = {
646
+ where: Prisma.ThreadWhereUniqueInput;
647
+ data: Prisma.XOR<Prisma.ThreadUpdateWithoutAccountInput, Prisma.ThreadUncheckedUpdateWithoutAccountInput>;
648
+ };
649
+ export type ThreadUpdateManyWithWhereWithoutAccountInput = {
650
+ where: Prisma.ThreadScalarWhereInput;
651
+ data: Prisma.XOR<Prisma.ThreadUpdateManyMutationInput, Prisma.ThreadUncheckedUpdateManyWithoutAccountInput>;
652
+ };
653
+ export type ThreadScalarWhereInput = {
654
+ AND?: Prisma.ThreadScalarWhereInput | Prisma.ThreadScalarWhereInput[];
655
+ OR?: Prisma.ThreadScalarWhereInput[];
656
+ NOT?: Prisma.ThreadScalarWhereInput | Prisma.ThreadScalarWhereInput[];
657
+ id?: Prisma.IntFilter<"Thread"> | number;
658
+ email?: Prisma.StringFilter<"Thread"> | string;
659
+ appId?: Prisma.StringFilter<"Thread"> | string;
660
+ threadId?: Prisma.StringFilter<"Thread"> | string;
661
+ subject?: Prisma.StringFilter<"Thread"> | string;
662
+ snippet?: Prisma.StringFilter<"Thread"> | string;
663
+ fromEmail?: Prisma.StringFilter<"Thread"> | string;
664
+ fromName?: Prisma.StringFilter<"Thread"> | string;
665
+ date?: Prisma.StringFilter<"Thread"> | string;
666
+ labelIds?: Prisma.StringFilter<"Thread"> | string;
667
+ hasUnread?: Prisma.BoolFilter<"Thread"> | boolean;
668
+ msgCount?: Prisma.IntFilter<"Thread"> | number;
669
+ historyId?: Prisma.StringNullableFilter<"Thread"> | string | null;
670
+ rawData?: Prisma.StringFilter<"Thread"> | string;
671
+ ttlMs?: Prisma.IntFilter<"Thread"> | number;
672
+ createdAt?: Prisma.DateTimeFilter<"Thread"> | Date | string;
673
+ };
674
+ export type ThreadCreateManyAccountInput = {
675
+ id?: number;
676
+ threadId: string;
677
+ subject: string;
678
+ snippet: string;
679
+ fromEmail: string;
680
+ fromName: string;
681
+ date: string;
682
+ labelIds: string;
683
+ hasUnread: boolean;
684
+ msgCount: number;
685
+ historyId?: string | null;
686
+ rawData: string;
687
+ ttlMs: number;
688
+ createdAt: Date | string;
689
+ };
690
+ export type ThreadUpdateWithoutAccountInput = {
691
+ threadId?: Prisma.StringFieldUpdateOperationsInput | string;
692
+ subject?: Prisma.StringFieldUpdateOperationsInput | string;
693
+ snippet?: Prisma.StringFieldUpdateOperationsInput | string;
694
+ fromEmail?: Prisma.StringFieldUpdateOperationsInput | string;
695
+ fromName?: Prisma.StringFieldUpdateOperationsInput | string;
696
+ date?: Prisma.StringFieldUpdateOperationsInput | string;
697
+ labelIds?: Prisma.StringFieldUpdateOperationsInput | string;
698
+ hasUnread?: Prisma.BoolFieldUpdateOperationsInput | boolean;
699
+ msgCount?: Prisma.IntFieldUpdateOperationsInput | number;
700
+ historyId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
701
+ rawData?: Prisma.StringFieldUpdateOperationsInput | string;
702
+ ttlMs?: Prisma.IntFieldUpdateOperationsInput | number;
703
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
704
+ };
705
+ export type ThreadUncheckedUpdateWithoutAccountInput = {
706
+ id?: Prisma.IntFieldUpdateOperationsInput | number;
707
+ threadId?: Prisma.StringFieldUpdateOperationsInput | string;
708
+ subject?: Prisma.StringFieldUpdateOperationsInput | string;
709
+ snippet?: Prisma.StringFieldUpdateOperationsInput | string;
710
+ fromEmail?: Prisma.StringFieldUpdateOperationsInput | string;
711
+ fromName?: Prisma.StringFieldUpdateOperationsInput | string;
712
+ date?: Prisma.StringFieldUpdateOperationsInput | string;
713
+ labelIds?: Prisma.StringFieldUpdateOperationsInput | string;
714
+ hasUnread?: Prisma.BoolFieldUpdateOperationsInput | boolean;
715
+ msgCount?: Prisma.IntFieldUpdateOperationsInput | number;
716
+ historyId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
717
+ rawData?: Prisma.StringFieldUpdateOperationsInput | string;
718
+ ttlMs?: Prisma.IntFieldUpdateOperationsInput | number;
719
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
720
+ };
721
+ export type ThreadUncheckedUpdateManyWithoutAccountInput = {
722
+ id?: Prisma.IntFieldUpdateOperationsInput | number;
723
+ threadId?: Prisma.StringFieldUpdateOperationsInput | string;
724
+ subject?: Prisma.StringFieldUpdateOperationsInput | string;
725
+ snippet?: Prisma.StringFieldUpdateOperationsInput | string;
726
+ fromEmail?: Prisma.StringFieldUpdateOperationsInput | string;
727
+ fromName?: Prisma.StringFieldUpdateOperationsInput | string;
728
+ date?: Prisma.StringFieldUpdateOperationsInput | string;
729
+ labelIds?: Prisma.StringFieldUpdateOperationsInput | string;
730
+ hasUnread?: Prisma.BoolFieldUpdateOperationsInput | boolean;
731
+ msgCount?: Prisma.IntFieldUpdateOperationsInput | number;
732
+ historyId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
733
+ rawData?: Prisma.StringFieldUpdateOperationsInput | string;
734
+ ttlMs?: Prisma.IntFieldUpdateOperationsInput | number;
735
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
736
+ };
737
+ export type ThreadSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
738
+ id?: boolean;
739
+ email?: boolean;
740
+ appId?: boolean;
741
+ threadId?: boolean;
742
+ subject?: boolean;
743
+ snippet?: boolean;
744
+ fromEmail?: boolean;
745
+ fromName?: boolean;
746
+ date?: boolean;
747
+ labelIds?: boolean;
748
+ hasUnread?: boolean;
749
+ msgCount?: boolean;
750
+ historyId?: boolean;
751
+ rawData?: boolean;
752
+ ttlMs?: boolean;
753
+ createdAt?: boolean;
754
+ account?: boolean | Prisma.AccountDefaultArgs<ExtArgs>;
755
+ }, ExtArgs["result"]["thread"]>;
756
+ export type ThreadSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
757
+ id?: boolean;
758
+ email?: boolean;
759
+ appId?: boolean;
760
+ threadId?: boolean;
761
+ subject?: boolean;
762
+ snippet?: boolean;
763
+ fromEmail?: boolean;
764
+ fromName?: boolean;
765
+ date?: boolean;
766
+ labelIds?: boolean;
767
+ hasUnread?: boolean;
768
+ msgCount?: boolean;
769
+ historyId?: boolean;
770
+ rawData?: boolean;
771
+ ttlMs?: boolean;
772
+ createdAt?: boolean;
773
+ account?: boolean | Prisma.AccountDefaultArgs<ExtArgs>;
774
+ }, ExtArgs["result"]["thread"]>;
775
+ export type ThreadSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
776
+ id?: boolean;
777
+ email?: boolean;
778
+ appId?: boolean;
779
+ threadId?: boolean;
780
+ subject?: boolean;
781
+ snippet?: boolean;
782
+ fromEmail?: boolean;
783
+ fromName?: boolean;
784
+ date?: boolean;
785
+ labelIds?: boolean;
786
+ hasUnread?: boolean;
787
+ msgCount?: boolean;
788
+ historyId?: boolean;
789
+ rawData?: boolean;
790
+ ttlMs?: boolean;
791
+ createdAt?: boolean;
792
+ account?: boolean | Prisma.AccountDefaultArgs<ExtArgs>;
793
+ }, ExtArgs["result"]["thread"]>;
794
+ export type ThreadSelectScalar = {
795
+ id?: boolean;
796
+ email?: boolean;
797
+ appId?: boolean;
798
+ threadId?: boolean;
799
+ subject?: boolean;
800
+ snippet?: boolean;
801
+ fromEmail?: boolean;
802
+ fromName?: boolean;
803
+ date?: boolean;
804
+ labelIds?: boolean;
805
+ hasUnread?: boolean;
806
+ msgCount?: boolean;
807
+ historyId?: boolean;
808
+ rawData?: boolean;
809
+ ttlMs?: boolean;
810
+ createdAt?: boolean;
811
+ };
812
+ export type ThreadOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "email" | "appId" | "threadId" | "subject" | "snippet" | "fromEmail" | "fromName" | "date" | "labelIds" | "hasUnread" | "msgCount" | "historyId" | "rawData" | "ttlMs" | "createdAt", ExtArgs["result"]["thread"]>;
813
+ export type ThreadInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
814
+ account?: boolean | Prisma.AccountDefaultArgs<ExtArgs>;
815
+ };
816
+ export type ThreadIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
817
+ account?: boolean | Prisma.AccountDefaultArgs<ExtArgs>;
818
+ };
819
+ export type ThreadIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
820
+ account?: boolean | Prisma.AccountDefaultArgs<ExtArgs>;
821
+ };
822
+ export type $ThreadPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
823
+ name: "Thread";
824
+ objects: {
825
+ account: Prisma.$AccountPayload<ExtArgs>;
826
+ };
827
+ scalars: runtime.Types.Extensions.GetPayloadResult<{
828
+ id: number;
829
+ email: string;
830
+ appId: string;
831
+ threadId: string;
832
+ subject: string;
833
+ snippet: string;
834
+ fromEmail: string;
835
+ fromName: string;
836
+ date: string;
837
+ labelIds: string;
838
+ hasUnread: boolean;
839
+ msgCount: number;
840
+ historyId: string | null;
841
+ rawData: string;
842
+ ttlMs: number;
843
+ createdAt: Date;
844
+ }, ExtArgs["result"]["thread"]>;
845
+ composites: {};
846
+ };
847
+ export type ThreadGetPayload<S extends boolean | null | undefined | ThreadDefaultArgs> = runtime.Types.Result.GetResult<Prisma.$ThreadPayload, S>;
848
+ export type ThreadCountArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = Omit<ThreadFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
849
+ select?: ThreadCountAggregateInputType | true;
850
+ };
851
+ export interface ThreadDelegate<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> {
852
+ [K: symbol]: {
853
+ types: Prisma.TypeMap<ExtArgs>['model']['Thread'];
854
+ meta: {
855
+ name: 'Thread';
856
+ };
857
+ };
858
+ /**
859
+ * Find zero or one Thread that matches the filter.
860
+ * @param {ThreadFindUniqueArgs} args - Arguments to find a Thread
861
+ * @example
862
+ * // Get one Thread
863
+ * const thread = await prisma.thread.findUnique({
864
+ * where: {
865
+ * // ... provide filter here
866
+ * }
867
+ * })
868
+ */
869
+ findUnique<T extends ThreadFindUniqueArgs>(args: Prisma.SelectSubset<T, ThreadFindUniqueArgs<ExtArgs>>): Prisma.Prisma__ThreadClient<runtime.Types.Result.GetResult<Prisma.$ThreadPayload<ExtArgs>, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>;
870
+ /**
871
+ * Find one Thread that matches the filter or throw an error with `error.code='P2025'`
872
+ * if no matches were found.
873
+ * @param {ThreadFindUniqueOrThrowArgs} args - Arguments to find a Thread
874
+ * @example
875
+ * // Get one Thread
876
+ * const thread = await prisma.thread.findUniqueOrThrow({
877
+ * where: {
878
+ * // ... provide filter here
879
+ * }
880
+ * })
881
+ */
882
+ findUniqueOrThrow<T extends ThreadFindUniqueOrThrowArgs>(args: Prisma.SelectSubset<T, ThreadFindUniqueOrThrowArgs<ExtArgs>>): Prisma.Prisma__ThreadClient<runtime.Types.Result.GetResult<Prisma.$ThreadPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>;
883
+ /**
884
+ * Find the first Thread that matches the filter.
885
+ * Note, that providing `undefined` is treated as the value not being there.
886
+ * Read more here: https://pris.ly/d/null-undefined
887
+ * @param {ThreadFindFirstArgs} args - Arguments to find a Thread
888
+ * @example
889
+ * // Get one Thread
890
+ * const thread = await prisma.thread.findFirst({
891
+ * where: {
892
+ * // ... provide filter here
893
+ * }
894
+ * })
895
+ */
896
+ findFirst<T extends ThreadFindFirstArgs>(args?: Prisma.SelectSubset<T, ThreadFindFirstArgs<ExtArgs>>): Prisma.Prisma__ThreadClient<runtime.Types.Result.GetResult<Prisma.$ThreadPayload<ExtArgs>, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>;
897
+ /**
898
+ * Find the first Thread that matches the filter or
899
+ * throw `PrismaKnownClientError` with `P2025` code if no matches were found.
900
+ * Note, that providing `undefined` is treated as the value not being there.
901
+ * Read more here: https://pris.ly/d/null-undefined
902
+ * @param {ThreadFindFirstOrThrowArgs} args - Arguments to find a Thread
903
+ * @example
904
+ * // Get one Thread
905
+ * const thread = await prisma.thread.findFirstOrThrow({
906
+ * where: {
907
+ * // ... provide filter here
908
+ * }
909
+ * })
910
+ */
911
+ findFirstOrThrow<T extends ThreadFindFirstOrThrowArgs>(args?: Prisma.SelectSubset<T, ThreadFindFirstOrThrowArgs<ExtArgs>>): Prisma.Prisma__ThreadClient<runtime.Types.Result.GetResult<Prisma.$ThreadPayload<ExtArgs>, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>;
912
+ /**
913
+ * Find zero or more Threads that matches the filter.
914
+ * Note, that providing `undefined` is treated as the value not being there.
915
+ * Read more here: https://pris.ly/d/null-undefined
916
+ * @param {ThreadFindManyArgs} args - Arguments to filter and select certain fields only.
917
+ * @example
918
+ * // Get all Threads
919
+ * const threads = await prisma.thread.findMany()
920
+ *
921
+ * // Get first 10 Threads
922
+ * const threads = await prisma.thread.findMany({ take: 10 })
923
+ *
924
+ * // Only select the `id`
925
+ * const threadWithIdOnly = await prisma.thread.findMany({ select: { id: true } })
926
+ *
927
+ */
928
+ findMany<T extends ThreadFindManyArgs>(args?: Prisma.SelectSubset<T, ThreadFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ThreadPayload<ExtArgs>, T, "findMany", GlobalOmitOptions>>;
929
+ /**
930
+ * Create a Thread.
931
+ * @param {ThreadCreateArgs} args - Arguments to create a Thread.
932
+ * @example
933
+ * // Create one Thread
934
+ * const Thread = await prisma.thread.create({
935
+ * data: {
936
+ * // ... data to create a Thread
937
+ * }
938
+ * })
939
+ *
940
+ */
941
+ create<T extends ThreadCreateArgs>(args: Prisma.SelectSubset<T, ThreadCreateArgs<ExtArgs>>): Prisma.Prisma__ThreadClient<runtime.Types.Result.GetResult<Prisma.$ThreadPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>;
942
+ /**
943
+ * Create many Threads.
944
+ * @param {ThreadCreateManyArgs} args - Arguments to create many Threads.
945
+ * @example
946
+ * // Create many Threads
947
+ * const thread = await prisma.thread.createMany({
948
+ * data: [
949
+ * // ... provide data here
950
+ * ]
951
+ * })
952
+ *
953
+ */
954
+ createMany<T extends ThreadCreateManyArgs>(args?: Prisma.SelectSubset<T, ThreadCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>;
955
+ /**
956
+ * Create many Threads and returns the data saved in the database.
957
+ * @param {ThreadCreateManyAndReturnArgs} args - Arguments to create many Threads.
958
+ * @example
959
+ * // Create many Threads
960
+ * const thread = await prisma.thread.createManyAndReturn({
961
+ * data: [
962
+ * // ... provide data here
963
+ * ]
964
+ * })
965
+ *
966
+ * // Create many Threads and only return the `id`
967
+ * const threadWithIdOnly = await prisma.thread.createManyAndReturn({
968
+ * select: { id: true },
969
+ * data: [
970
+ * // ... provide data here
971
+ * ]
972
+ * })
973
+ * Note, that providing `undefined` is treated as the value not being there.
974
+ * Read more here: https://pris.ly/d/null-undefined
975
+ *
976
+ */
977
+ createManyAndReturn<T extends ThreadCreateManyAndReturnArgs>(args?: Prisma.SelectSubset<T, ThreadCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ThreadPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>;
978
+ /**
979
+ * Delete a Thread.
980
+ * @param {ThreadDeleteArgs} args - Arguments to delete one Thread.
981
+ * @example
982
+ * // Delete one Thread
983
+ * const Thread = await prisma.thread.delete({
984
+ * where: {
985
+ * // ... filter to delete one Thread
986
+ * }
987
+ * })
988
+ *
989
+ */
990
+ delete<T extends ThreadDeleteArgs>(args: Prisma.SelectSubset<T, ThreadDeleteArgs<ExtArgs>>): Prisma.Prisma__ThreadClient<runtime.Types.Result.GetResult<Prisma.$ThreadPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>;
991
+ /**
992
+ * Update one Thread.
993
+ * @param {ThreadUpdateArgs} args - Arguments to update one Thread.
994
+ * @example
995
+ * // Update one Thread
996
+ * const thread = await prisma.thread.update({
997
+ * where: {
998
+ * // ... provide filter here
999
+ * },
1000
+ * data: {
1001
+ * // ... provide data here
1002
+ * }
1003
+ * })
1004
+ *
1005
+ */
1006
+ update<T extends ThreadUpdateArgs>(args: Prisma.SelectSubset<T, ThreadUpdateArgs<ExtArgs>>): Prisma.Prisma__ThreadClient<runtime.Types.Result.GetResult<Prisma.$ThreadPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>;
1007
+ /**
1008
+ * Delete zero or more Threads.
1009
+ * @param {ThreadDeleteManyArgs} args - Arguments to filter Threads to delete.
1010
+ * @example
1011
+ * // Delete a few Threads
1012
+ * const { count } = await prisma.thread.deleteMany({
1013
+ * where: {
1014
+ * // ... provide filter here
1015
+ * }
1016
+ * })
1017
+ *
1018
+ */
1019
+ deleteMany<T extends ThreadDeleteManyArgs>(args?: Prisma.SelectSubset<T, ThreadDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>;
1020
+ /**
1021
+ * Update zero or more Threads.
1022
+ * Note, that providing `undefined` is treated as the value not being there.
1023
+ * Read more here: https://pris.ly/d/null-undefined
1024
+ * @param {ThreadUpdateManyArgs} args - Arguments to update one or more rows.
1025
+ * @example
1026
+ * // Update many Threads
1027
+ * const thread = await prisma.thread.updateMany({
1028
+ * where: {
1029
+ * // ... provide filter here
1030
+ * },
1031
+ * data: {
1032
+ * // ... provide data here
1033
+ * }
1034
+ * })
1035
+ *
1036
+ */
1037
+ updateMany<T extends ThreadUpdateManyArgs>(args: Prisma.SelectSubset<T, ThreadUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>;
1038
+ /**
1039
+ * Update zero or more Threads and returns the data updated in the database.
1040
+ * @param {ThreadUpdateManyAndReturnArgs} args - Arguments to update many Threads.
1041
+ * @example
1042
+ * // Update many Threads
1043
+ * const thread = await prisma.thread.updateManyAndReturn({
1044
+ * where: {
1045
+ * // ... provide filter here
1046
+ * },
1047
+ * data: [
1048
+ * // ... provide data here
1049
+ * ]
1050
+ * })
1051
+ *
1052
+ * // Update zero or more Threads and only return the `id`
1053
+ * const threadWithIdOnly = await prisma.thread.updateManyAndReturn({
1054
+ * select: { id: true },
1055
+ * where: {
1056
+ * // ... provide filter here
1057
+ * },
1058
+ * data: [
1059
+ * // ... provide data here
1060
+ * ]
1061
+ * })
1062
+ * Note, that providing `undefined` is treated as the value not being there.
1063
+ * Read more here: https://pris.ly/d/null-undefined
1064
+ *
1065
+ */
1066
+ updateManyAndReturn<T extends ThreadUpdateManyAndReturnArgs>(args: Prisma.SelectSubset<T, ThreadUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ThreadPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>;
1067
+ /**
1068
+ * Create or update one Thread.
1069
+ * @param {ThreadUpsertArgs} args - Arguments to update or create a Thread.
1070
+ * @example
1071
+ * // Update or create a Thread
1072
+ * const thread = await prisma.thread.upsert({
1073
+ * create: {
1074
+ * // ... data to create a Thread
1075
+ * },
1076
+ * update: {
1077
+ * // ... in case it already exists, update
1078
+ * },
1079
+ * where: {
1080
+ * // ... the filter for the Thread we want to update
1081
+ * }
1082
+ * })
1083
+ */
1084
+ upsert<T extends ThreadUpsertArgs>(args: Prisma.SelectSubset<T, ThreadUpsertArgs<ExtArgs>>): Prisma.Prisma__ThreadClient<runtime.Types.Result.GetResult<Prisma.$ThreadPayload<ExtArgs>, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>;
1085
+ /**
1086
+ * Count the number of Threads.
1087
+ * Note, that providing `undefined` is treated as the value not being there.
1088
+ * Read more here: https://pris.ly/d/null-undefined
1089
+ * @param {ThreadCountArgs} args - Arguments to filter Threads to count.
1090
+ * @example
1091
+ * // Count the number of Threads
1092
+ * const count = await prisma.thread.count({
1093
+ * where: {
1094
+ * // ... the filter for the Threads we want to count
1095
+ * }
1096
+ * })
1097
+ **/
1098
+ count<T extends ThreadCountArgs>(args?: Prisma.Subset<T, ThreadCountArgs>): Prisma.PrismaPromise<T extends runtime.Types.Utils.Record<'select', any> ? T['select'] extends true ? number : Prisma.GetScalarType<T['select'], ThreadCountAggregateOutputType> : number>;
1099
+ /**
1100
+ * Allows you to perform aggregations operations on a Thread.
1101
+ * Note, that providing `undefined` is treated as the value not being there.
1102
+ * Read more here: https://pris.ly/d/null-undefined
1103
+ * @param {ThreadAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
1104
+ * @example
1105
+ * // Ordered by age ascending
1106
+ * // Where email contains prisma.io
1107
+ * // Limited to the 10 users
1108
+ * const aggregations = await prisma.user.aggregate({
1109
+ * _avg: {
1110
+ * age: true,
1111
+ * },
1112
+ * where: {
1113
+ * email: {
1114
+ * contains: "prisma.io",
1115
+ * },
1116
+ * },
1117
+ * orderBy: {
1118
+ * age: "asc",
1119
+ * },
1120
+ * take: 10,
1121
+ * })
1122
+ **/
1123
+ aggregate<T extends ThreadAggregateArgs>(args: Prisma.Subset<T, ThreadAggregateArgs>): Prisma.PrismaPromise<GetThreadAggregateType<T>>;
1124
+ /**
1125
+ * Group by Thread.
1126
+ * Note, that providing `undefined` is treated as the value not being there.
1127
+ * Read more here: https://pris.ly/d/null-undefined
1128
+ * @param {ThreadGroupByArgs} args - Group by arguments.
1129
+ * @example
1130
+ * // Group by city, order by createdAt, get count
1131
+ * const result = await prisma.user.groupBy({
1132
+ * by: ['city', 'createdAt'],
1133
+ * orderBy: {
1134
+ * createdAt: true
1135
+ * },
1136
+ * _count: {
1137
+ * _all: true
1138
+ * },
1139
+ * })
1140
+ *
1141
+ **/
1142
+ groupBy<T extends ThreadGroupByArgs, HasSelectOrTake extends Prisma.Or<Prisma.Extends<'skip', Prisma.Keys<T>>, Prisma.Extends<'take', Prisma.Keys<T>>>, OrderByArg extends Prisma.True extends HasSelectOrTake ? {
1143
+ orderBy: ThreadGroupByArgs['orderBy'];
1144
+ } : {
1145
+ orderBy?: ThreadGroupByArgs['orderBy'];
1146
+ }, OrderFields extends Prisma.ExcludeUnderscoreKeys<Prisma.Keys<Prisma.MaybeTupleToUnion<T['orderBy']>>>, ByFields extends Prisma.MaybeTupleToUnion<T['by']>, ByValid extends Prisma.Has<ByFields, OrderFields>, HavingFields extends Prisma.GetHavingFields<T['having']>, HavingValid extends Prisma.Has<ByFields, HavingFields>, ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, InputErrors extends ByEmpty extends Prisma.True ? `Error: "by" must not be empty.` : HavingValid extends Prisma.False ? {
1147
+ [P in HavingFields]: P extends ByFields ? never : P extends string ? `Error: Field "${P}" used in "having" needs to be provided in "by".` : [
1148
+ Error,
1149
+ 'Field ',
1150
+ P,
1151
+ ` in "having" needs to be provided in "by"`
1152
+ ];
1153
+ }[HavingFields] : 'take' extends Prisma.Keys<T> ? 'orderBy' extends Prisma.Keys<T> ? ByValid extends Prisma.True ? {} : {
1154
+ [P in OrderFields]: P extends ByFields ? never : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`;
1155
+ }[OrderFields] : 'Error: If you provide "take", you also need to provide "orderBy"' : 'skip' extends Prisma.Keys<T> ? 'orderBy' extends Prisma.Keys<T> ? ByValid extends Prisma.True ? {} : {
1156
+ [P in OrderFields]: P extends ByFields ? never : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`;
1157
+ }[OrderFields] : 'Error: If you provide "skip", you also need to provide "orderBy"' : ByValid extends Prisma.True ? {} : {
1158
+ [P in OrderFields]: P extends ByFields ? never : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`;
1159
+ }[OrderFields]>(args: Prisma.SubsetIntersection<T, ThreadGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetThreadGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>;
1160
+ /**
1161
+ * Fields of the Thread model
1162
+ */
1163
+ readonly fields: ThreadFieldRefs;
1164
+ }
1165
+ /**
1166
+ * The delegate class that acts as a "Promise-like" for Thread.
1167
+ * Why is this prefixed with `Prisma__`?
1168
+ * Because we want to prevent naming conflicts as mentioned in
1169
+ * https://github.com/prisma/prisma-client-js/issues/707
1170
+ */
1171
+ export interface Prisma__ThreadClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
1172
+ readonly [Symbol.toStringTag]: "PrismaPromise";
1173
+ account<T extends Prisma.AccountDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AccountDefaultArgs<ExtArgs>>): Prisma.Prisma__AccountClient<runtime.Types.Result.GetResult<Prisma.$AccountPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>;
1174
+ /**
1175
+ * Attaches callbacks for the resolution and/or rejection of the Promise.
1176
+ * @param onfulfilled The callback to execute when the Promise is resolved.
1177
+ * @param onrejected The callback to execute when the Promise is rejected.
1178
+ * @returns A Promise for the completion of which ever callback is executed.
1179
+ */
1180
+ then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): runtime.Types.Utils.JsPromise<TResult1 | TResult2>;
1181
+ /**
1182
+ * Attaches a callback for only the rejection of the Promise.
1183
+ * @param onrejected The callback to execute when the Promise is rejected.
1184
+ * @returns A Promise for the completion of the callback.
1185
+ */
1186
+ catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): runtime.Types.Utils.JsPromise<T | TResult>;
1187
+ /**
1188
+ * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
1189
+ * resolved value cannot be modified from the callback.
1190
+ * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
1191
+ * @returns A Promise for the completion of the callback.
1192
+ */
1193
+ finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise<T>;
1194
+ }
1195
+ /**
1196
+ * Fields of the Thread model
1197
+ */
1198
+ export interface ThreadFieldRefs {
1199
+ readonly id: Prisma.FieldRef<"Thread", 'Int'>;
1200
+ readonly email: Prisma.FieldRef<"Thread", 'String'>;
1201
+ readonly appId: Prisma.FieldRef<"Thread", 'String'>;
1202
+ readonly threadId: Prisma.FieldRef<"Thread", 'String'>;
1203
+ readonly subject: Prisma.FieldRef<"Thread", 'String'>;
1204
+ readonly snippet: Prisma.FieldRef<"Thread", 'String'>;
1205
+ readonly fromEmail: Prisma.FieldRef<"Thread", 'String'>;
1206
+ readonly fromName: Prisma.FieldRef<"Thread", 'String'>;
1207
+ readonly date: Prisma.FieldRef<"Thread", 'String'>;
1208
+ readonly labelIds: Prisma.FieldRef<"Thread", 'String'>;
1209
+ readonly hasUnread: Prisma.FieldRef<"Thread", 'Boolean'>;
1210
+ readonly msgCount: Prisma.FieldRef<"Thread", 'Int'>;
1211
+ readonly historyId: Prisma.FieldRef<"Thread", 'String'>;
1212
+ readonly rawData: Prisma.FieldRef<"Thread", 'String'>;
1213
+ readonly ttlMs: Prisma.FieldRef<"Thread", 'Int'>;
1214
+ readonly createdAt: Prisma.FieldRef<"Thread", 'DateTime'>;
1215
+ }
1216
+ /**
1217
+ * Thread findUnique
1218
+ */
1219
+ export type ThreadFindUniqueArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1220
+ /**
1221
+ * Select specific fields to fetch from the Thread
1222
+ */
1223
+ select?: Prisma.ThreadSelect<ExtArgs> | null;
1224
+ /**
1225
+ * Omit specific fields from the Thread
1226
+ */
1227
+ omit?: Prisma.ThreadOmit<ExtArgs> | null;
1228
+ /**
1229
+ * Choose, which related nodes to fetch as well
1230
+ */
1231
+ include?: Prisma.ThreadInclude<ExtArgs> | null;
1232
+ /**
1233
+ * Filter, which Thread to fetch.
1234
+ */
1235
+ where: Prisma.ThreadWhereUniqueInput;
1236
+ };
1237
+ /**
1238
+ * Thread findUniqueOrThrow
1239
+ */
1240
+ export type ThreadFindUniqueOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1241
+ /**
1242
+ * Select specific fields to fetch from the Thread
1243
+ */
1244
+ select?: Prisma.ThreadSelect<ExtArgs> | null;
1245
+ /**
1246
+ * Omit specific fields from the Thread
1247
+ */
1248
+ omit?: Prisma.ThreadOmit<ExtArgs> | null;
1249
+ /**
1250
+ * Choose, which related nodes to fetch as well
1251
+ */
1252
+ include?: Prisma.ThreadInclude<ExtArgs> | null;
1253
+ /**
1254
+ * Filter, which Thread to fetch.
1255
+ */
1256
+ where: Prisma.ThreadWhereUniqueInput;
1257
+ };
1258
+ /**
1259
+ * Thread findFirst
1260
+ */
1261
+ export type ThreadFindFirstArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1262
+ /**
1263
+ * Select specific fields to fetch from the Thread
1264
+ */
1265
+ select?: Prisma.ThreadSelect<ExtArgs> | null;
1266
+ /**
1267
+ * Omit specific fields from the Thread
1268
+ */
1269
+ omit?: Prisma.ThreadOmit<ExtArgs> | null;
1270
+ /**
1271
+ * Choose, which related nodes to fetch as well
1272
+ */
1273
+ include?: Prisma.ThreadInclude<ExtArgs> | null;
1274
+ /**
1275
+ * Filter, which Thread to fetch.
1276
+ */
1277
+ where?: Prisma.ThreadWhereInput;
1278
+ /**
1279
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
1280
+ *
1281
+ * Determine the order of Threads to fetch.
1282
+ */
1283
+ orderBy?: Prisma.ThreadOrderByWithRelationInput | Prisma.ThreadOrderByWithRelationInput[];
1284
+ /**
1285
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
1286
+ *
1287
+ * Sets the position for searching for Threads.
1288
+ */
1289
+ cursor?: Prisma.ThreadWhereUniqueInput;
1290
+ /**
1291
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1292
+ *
1293
+ * Take `±n` Threads from the position of the cursor.
1294
+ */
1295
+ take?: number;
1296
+ /**
1297
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1298
+ *
1299
+ * Skip the first `n` Threads.
1300
+ */
1301
+ skip?: number;
1302
+ /**
1303
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
1304
+ *
1305
+ * Filter by unique combinations of Threads.
1306
+ */
1307
+ distinct?: Prisma.ThreadScalarFieldEnum | Prisma.ThreadScalarFieldEnum[];
1308
+ };
1309
+ /**
1310
+ * Thread findFirstOrThrow
1311
+ */
1312
+ export type ThreadFindFirstOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1313
+ /**
1314
+ * Select specific fields to fetch from the Thread
1315
+ */
1316
+ select?: Prisma.ThreadSelect<ExtArgs> | null;
1317
+ /**
1318
+ * Omit specific fields from the Thread
1319
+ */
1320
+ omit?: Prisma.ThreadOmit<ExtArgs> | null;
1321
+ /**
1322
+ * Choose, which related nodes to fetch as well
1323
+ */
1324
+ include?: Prisma.ThreadInclude<ExtArgs> | null;
1325
+ /**
1326
+ * Filter, which Thread to fetch.
1327
+ */
1328
+ where?: Prisma.ThreadWhereInput;
1329
+ /**
1330
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
1331
+ *
1332
+ * Determine the order of Threads to fetch.
1333
+ */
1334
+ orderBy?: Prisma.ThreadOrderByWithRelationInput | Prisma.ThreadOrderByWithRelationInput[];
1335
+ /**
1336
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
1337
+ *
1338
+ * Sets the position for searching for Threads.
1339
+ */
1340
+ cursor?: Prisma.ThreadWhereUniqueInput;
1341
+ /**
1342
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1343
+ *
1344
+ * Take `±n` Threads from the position of the cursor.
1345
+ */
1346
+ take?: number;
1347
+ /**
1348
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1349
+ *
1350
+ * Skip the first `n` Threads.
1351
+ */
1352
+ skip?: number;
1353
+ /**
1354
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
1355
+ *
1356
+ * Filter by unique combinations of Threads.
1357
+ */
1358
+ distinct?: Prisma.ThreadScalarFieldEnum | Prisma.ThreadScalarFieldEnum[];
1359
+ };
1360
+ /**
1361
+ * Thread findMany
1362
+ */
1363
+ export type ThreadFindManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1364
+ /**
1365
+ * Select specific fields to fetch from the Thread
1366
+ */
1367
+ select?: Prisma.ThreadSelect<ExtArgs> | null;
1368
+ /**
1369
+ * Omit specific fields from the Thread
1370
+ */
1371
+ omit?: Prisma.ThreadOmit<ExtArgs> | null;
1372
+ /**
1373
+ * Choose, which related nodes to fetch as well
1374
+ */
1375
+ include?: Prisma.ThreadInclude<ExtArgs> | null;
1376
+ /**
1377
+ * Filter, which Threads to fetch.
1378
+ */
1379
+ where?: Prisma.ThreadWhereInput;
1380
+ /**
1381
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
1382
+ *
1383
+ * Determine the order of Threads to fetch.
1384
+ */
1385
+ orderBy?: Prisma.ThreadOrderByWithRelationInput | Prisma.ThreadOrderByWithRelationInput[];
1386
+ /**
1387
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
1388
+ *
1389
+ * Sets the position for listing Threads.
1390
+ */
1391
+ cursor?: Prisma.ThreadWhereUniqueInput;
1392
+ /**
1393
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1394
+ *
1395
+ * Take `±n` Threads from the position of the cursor.
1396
+ */
1397
+ take?: number;
1398
+ /**
1399
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1400
+ *
1401
+ * Skip the first `n` Threads.
1402
+ */
1403
+ skip?: number;
1404
+ distinct?: Prisma.ThreadScalarFieldEnum | Prisma.ThreadScalarFieldEnum[];
1405
+ };
1406
+ /**
1407
+ * Thread create
1408
+ */
1409
+ export type ThreadCreateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1410
+ /**
1411
+ * Select specific fields to fetch from the Thread
1412
+ */
1413
+ select?: Prisma.ThreadSelect<ExtArgs> | null;
1414
+ /**
1415
+ * Omit specific fields from the Thread
1416
+ */
1417
+ omit?: Prisma.ThreadOmit<ExtArgs> | null;
1418
+ /**
1419
+ * Choose, which related nodes to fetch as well
1420
+ */
1421
+ include?: Prisma.ThreadInclude<ExtArgs> | null;
1422
+ /**
1423
+ * The data needed to create a Thread.
1424
+ */
1425
+ data: Prisma.XOR<Prisma.ThreadCreateInput, Prisma.ThreadUncheckedCreateInput>;
1426
+ };
1427
+ /**
1428
+ * Thread createMany
1429
+ */
1430
+ export type ThreadCreateManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1431
+ /**
1432
+ * The data used to create many Threads.
1433
+ */
1434
+ data: Prisma.ThreadCreateManyInput | Prisma.ThreadCreateManyInput[];
1435
+ };
1436
+ /**
1437
+ * Thread createManyAndReturn
1438
+ */
1439
+ export type ThreadCreateManyAndReturnArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1440
+ /**
1441
+ * Select specific fields to fetch from the Thread
1442
+ */
1443
+ select?: Prisma.ThreadSelectCreateManyAndReturn<ExtArgs> | null;
1444
+ /**
1445
+ * Omit specific fields from the Thread
1446
+ */
1447
+ omit?: Prisma.ThreadOmit<ExtArgs> | null;
1448
+ /**
1449
+ * The data used to create many Threads.
1450
+ */
1451
+ data: Prisma.ThreadCreateManyInput | Prisma.ThreadCreateManyInput[];
1452
+ /**
1453
+ * Choose, which related nodes to fetch as well
1454
+ */
1455
+ include?: Prisma.ThreadIncludeCreateManyAndReturn<ExtArgs> | null;
1456
+ };
1457
+ /**
1458
+ * Thread update
1459
+ */
1460
+ export type ThreadUpdateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1461
+ /**
1462
+ * Select specific fields to fetch from the Thread
1463
+ */
1464
+ select?: Prisma.ThreadSelect<ExtArgs> | null;
1465
+ /**
1466
+ * Omit specific fields from the Thread
1467
+ */
1468
+ omit?: Prisma.ThreadOmit<ExtArgs> | null;
1469
+ /**
1470
+ * Choose, which related nodes to fetch as well
1471
+ */
1472
+ include?: Prisma.ThreadInclude<ExtArgs> | null;
1473
+ /**
1474
+ * The data needed to update a Thread.
1475
+ */
1476
+ data: Prisma.XOR<Prisma.ThreadUpdateInput, Prisma.ThreadUncheckedUpdateInput>;
1477
+ /**
1478
+ * Choose, which Thread to update.
1479
+ */
1480
+ where: Prisma.ThreadWhereUniqueInput;
1481
+ };
1482
+ /**
1483
+ * Thread updateMany
1484
+ */
1485
+ export type ThreadUpdateManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1486
+ /**
1487
+ * The data used to update Threads.
1488
+ */
1489
+ data: Prisma.XOR<Prisma.ThreadUpdateManyMutationInput, Prisma.ThreadUncheckedUpdateManyInput>;
1490
+ /**
1491
+ * Filter which Threads to update
1492
+ */
1493
+ where?: Prisma.ThreadWhereInput;
1494
+ /**
1495
+ * Limit how many Threads to update.
1496
+ */
1497
+ limit?: number;
1498
+ };
1499
+ /**
1500
+ * Thread updateManyAndReturn
1501
+ */
1502
+ export type ThreadUpdateManyAndReturnArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1503
+ /**
1504
+ * Select specific fields to fetch from the Thread
1505
+ */
1506
+ select?: Prisma.ThreadSelectUpdateManyAndReturn<ExtArgs> | null;
1507
+ /**
1508
+ * Omit specific fields from the Thread
1509
+ */
1510
+ omit?: Prisma.ThreadOmit<ExtArgs> | null;
1511
+ /**
1512
+ * The data used to update Threads.
1513
+ */
1514
+ data: Prisma.XOR<Prisma.ThreadUpdateManyMutationInput, Prisma.ThreadUncheckedUpdateManyInput>;
1515
+ /**
1516
+ * Filter which Threads to update
1517
+ */
1518
+ where?: Prisma.ThreadWhereInput;
1519
+ /**
1520
+ * Limit how many Threads to update.
1521
+ */
1522
+ limit?: number;
1523
+ /**
1524
+ * Choose, which related nodes to fetch as well
1525
+ */
1526
+ include?: Prisma.ThreadIncludeUpdateManyAndReturn<ExtArgs> | null;
1527
+ };
1528
+ /**
1529
+ * Thread upsert
1530
+ */
1531
+ export type ThreadUpsertArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1532
+ /**
1533
+ * Select specific fields to fetch from the Thread
1534
+ */
1535
+ select?: Prisma.ThreadSelect<ExtArgs> | null;
1536
+ /**
1537
+ * Omit specific fields from the Thread
1538
+ */
1539
+ omit?: Prisma.ThreadOmit<ExtArgs> | null;
1540
+ /**
1541
+ * Choose, which related nodes to fetch as well
1542
+ */
1543
+ include?: Prisma.ThreadInclude<ExtArgs> | null;
1544
+ /**
1545
+ * The filter to search for the Thread to update in case it exists.
1546
+ */
1547
+ where: Prisma.ThreadWhereUniqueInput;
1548
+ /**
1549
+ * In case the Thread found by the `where` argument doesn't exist, create a new Thread with this data.
1550
+ */
1551
+ create: Prisma.XOR<Prisma.ThreadCreateInput, Prisma.ThreadUncheckedCreateInput>;
1552
+ /**
1553
+ * In case the Thread was found with the provided `where` argument, update it with this data.
1554
+ */
1555
+ update: Prisma.XOR<Prisma.ThreadUpdateInput, Prisma.ThreadUncheckedUpdateInput>;
1556
+ };
1557
+ /**
1558
+ * Thread delete
1559
+ */
1560
+ export type ThreadDeleteArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1561
+ /**
1562
+ * Select specific fields to fetch from the Thread
1563
+ */
1564
+ select?: Prisma.ThreadSelect<ExtArgs> | null;
1565
+ /**
1566
+ * Omit specific fields from the Thread
1567
+ */
1568
+ omit?: Prisma.ThreadOmit<ExtArgs> | null;
1569
+ /**
1570
+ * Choose, which related nodes to fetch as well
1571
+ */
1572
+ include?: Prisma.ThreadInclude<ExtArgs> | null;
1573
+ /**
1574
+ * Filter which Thread to delete.
1575
+ */
1576
+ where: Prisma.ThreadWhereUniqueInput;
1577
+ };
1578
+ /**
1579
+ * Thread deleteMany
1580
+ */
1581
+ export type ThreadDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1582
+ /**
1583
+ * Filter which Threads to delete
1584
+ */
1585
+ where?: Prisma.ThreadWhereInput;
1586
+ /**
1587
+ * Limit how many Threads to delete.
1588
+ */
1589
+ limit?: number;
1590
+ };
1591
+ /**
1592
+ * Thread without action
1593
+ */
1594
+ export type ThreadDefaultArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1595
+ /**
1596
+ * Select specific fields to fetch from the Thread
1597
+ */
1598
+ select?: Prisma.ThreadSelect<ExtArgs> | null;
1599
+ /**
1600
+ * Omit specific fields from the Thread
1601
+ */
1602
+ omit?: Prisma.ThreadOmit<ExtArgs> | null;
1603
+ /**
1604
+ * Choose, which related nodes to fetch as well
1605
+ */
1606
+ include?: Prisma.ThreadInclude<ExtArgs> | null;
1607
+ };
1608
+ export {};