@remit/drizzle-pg-schema 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/schema.d.ts +138 -138
- package/dist/schema.js +22 -22
- package/package.json +1 -1
- package/schema.ts +27 -27
package/dist/schema.d.ts
CHANGED
|
@@ -1010,7 +1010,7 @@ export declare const accounts: import("drizzle-orm/pg-core").PgTableWithColumns<
|
|
|
1010
1010
|
data: number;
|
|
1011
1011
|
driverParam: string | number;
|
|
1012
1012
|
notNull: true;
|
|
1013
|
-
hasDefault:
|
|
1013
|
+
hasDefault: true;
|
|
1014
1014
|
isPrimaryKey: false;
|
|
1015
1015
|
isAutoincrement: false;
|
|
1016
1016
|
hasRuntimeDefault: false;
|
|
@@ -1992,6 +1992,134 @@ export declare const filters: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
1992
1992
|
};
|
|
1993
1993
|
dialect: "pg";
|
|
1994
1994
|
}>;
|
|
1995
|
+
export declare const labels: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
1996
|
+
name: "label";
|
|
1997
|
+
schema: undefined;
|
|
1998
|
+
columns: {
|
|
1999
|
+
labelId: import("drizzle-orm/pg-core").PgColumn<{
|
|
2000
|
+
name: "label_id";
|
|
2001
|
+
tableName: "label";
|
|
2002
|
+
dataType: "string";
|
|
2003
|
+
columnType: "PgText";
|
|
2004
|
+
data: string;
|
|
2005
|
+
driverParam: string;
|
|
2006
|
+
notNull: true;
|
|
2007
|
+
hasDefault: true;
|
|
2008
|
+
isPrimaryKey: true;
|
|
2009
|
+
isAutoincrement: false;
|
|
2010
|
+
hasRuntimeDefault: true;
|
|
2011
|
+
enumValues: [string, ...string[]];
|
|
2012
|
+
baseColumn: never;
|
|
2013
|
+
identity: undefined;
|
|
2014
|
+
generated: undefined;
|
|
2015
|
+
}, {}, {}>;
|
|
2016
|
+
accountConfigId: import("drizzle-orm/pg-core").PgColumn<{
|
|
2017
|
+
name: "account_config_id";
|
|
2018
|
+
tableName: "label";
|
|
2019
|
+
dataType: "string";
|
|
2020
|
+
columnType: "PgText";
|
|
2021
|
+
data: string;
|
|
2022
|
+
driverParam: string;
|
|
2023
|
+
notNull: true;
|
|
2024
|
+
hasDefault: false;
|
|
2025
|
+
isPrimaryKey: false;
|
|
2026
|
+
isAutoincrement: false;
|
|
2027
|
+
hasRuntimeDefault: false;
|
|
2028
|
+
enumValues: [string, ...string[]];
|
|
2029
|
+
baseColumn: never;
|
|
2030
|
+
identity: undefined;
|
|
2031
|
+
generated: undefined;
|
|
2032
|
+
}, {}, {}>;
|
|
2033
|
+
name: import("drizzle-orm/pg-core").PgColumn<{
|
|
2034
|
+
name: "name";
|
|
2035
|
+
tableName: "label";
|
|
2036
|
+
dataType: "string";
|
|
2037
|
+
columnType: "PgText";
|
|
2038
|
+
data: string;
|
|
2039
|
+
driverParam: string;
|
|
2040
|
+
notNull: true;
|
|
2041
|
+
hasDefault: false;
|
|
2042
|
+
isPrimaryKey: false;
|
|
2043
|
+
isAutoincrement: false;
|
|
2044
|
+
hasRuntimeDefault: false;
|
|
2045
|
+
enumValues: [string, ...string[]];
|
|
2046
|
+
baseColumn: never;
|
|
2047
|
+
identity: undefined;
|
|
2048
|
+
generated: undefined;
|
|
2049
|
+
}, {}, {}>;
|
|
2050
|
+
normalizedName: import("drizzle-orm/pg-core").PgColumn<{
|
|
2051
|
+
name: "normalized_name";
|
|
2052
|
+
tableName: "label";
|
|
2053
|
+
dataType: "string";
|
|
2054
|
+
columnType: "PgText";
|
|
2055
|
+
data: string;
|
|
2056
|
+
driverParam: string;
|
|
2057
|
+
notNull: true;
|
|
2058
|
+
hasDefault: false;
|
|
2059
|
+
isPrimaryKey: false;
|
|
2060
|
+
isAutoincrement: false;
|
|
2061
|
+
hasRuntimeDefault: false;
|
|
2062
|
+
enumValues: [string, ...string[]];
|
|
2063
|
+
baseColumn: never;
|
|
2064
|
+
identity: undefined;
|
|
2065
|
+
generated: undefined;
|
|
2066
|
+
}, {}, {}>;
|
|
2067
|
+
color: import("drizzle-orm/pg-core").PgColumn<{
|
|
2068
|
+
name: "color";
|
|
2069
|
+
tableName: "label";
|
|
2070
|
+
dataType: "string";
|
|
2071
|
+
columnType: "PgText";
|
|
2072
|
+
data: "Default" | "Red" | "Orange" | "Yellow" | "Green" | "Teal" | "Blue" | "Purple" | "Gray";
|
|
2073
|
+
driverParam: string;
|
|
2074
|
+
notNull: true;
|
|
2075
|
+
hasDefault: true;
|
|
2076
|
+
isPrimaryKey: false;
|
|
2077
|
+
isAutoincrement: false;
|
|
2078
|
+
hasRuntimeDefault: false;
|
|
2079
|
+
enumValues: [string, ...string[]];
|
|
2080
|
+
baseColumn: never;
|
|
2081
|
+
identity: undefined;
|
|
2082
|
+
generated: undefined;
|
|
2083
|
+
}, {}, {
|
|
2084
|
+
$type: "Default" | "Red" | "Orange" | "Yellow" | "Green" | "Teal" | "Blue" | "Purple" | "Gray";
|
|
2085
|
+
}>;
|
|
2086
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
2087
|
+
name: "created_at";
|
|
2088
|
+
tableName: "label";
|
|
2089
|
+
dataType: "number";
|
|
2090
|
+
columnType: "PgBigInt53";
|
|
2091
|
+
data: number;
|
|
2092
|
+
driverParam: string | number;
|
|
2093
|
+
notNull: true;
|
|
2094
|
+
hasDefault: false;
|
|
2095
|
+
isPrimaryKey: false;
|
|
2096
|
+
isAutoincrement: false;
|
|
2097
|
+
hasRuntimeDefault: false;
|
|
2098
|
+
enumValues: undefined;
|
|
2099
|
+
baseColumn: never;
|
|
2100
|
+
identity: undefined;
|
|
2101
|
+
generated: undefined;
|
|
2102
|
+
}, {}, {}>;
|
|
2103
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
2104
|
+
name: "updated_at";
|
|
2105
|
+
tableName: "label";
|
|
2106
|
+
dataType: "number";
|
|
2107
|
+
columnType: "PgBigInt53";
|
|
2108
|
+
data: number;
|
|
2109
|
+
driverParam: string | number;
|
|
2110
|
+
notNull: true;
|
|
2111
|
+
hasDefault: false;
|
|
2112
|
+
isPrimaryKey: false;
|
|
2113
|
+
isAutoincrement: false;
|
|
2114
|
+
hasRuntimeDefault: false;
|
|
2115
|
+
enumValues: undefined;
|
|
2116
|
+
baseColumn: never;
|
|
2117
|
+
identity: undefined;
|
|
2118
|
+
generated: undefined;
|
|
2119
|
+
}, {}, {}>;
|
|
2120
|
+
};
|
|
2121
|
+
dialect: "pg";
|
|
2122
|
+
}>;
|
|
1995
2123
|
export declare const organizeJobRequests: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
1996
2124
|
name: "organize_job_request";
|
|
1997
2125
|
schema: undefined;
|
|
@@ -2127,7 +2255,7 @@ export declare const organizeJobRequests: import("drizzle-orm/pg-core").PgTableW
|
|
|
2127
2255
|
data: number;
|
|
2128
2256
|
driverParam: string | number;
|
|
2129
2257
|
notNull: true;
|
|
2130
|
-
hasDefault:
|
|
2258
|
+
hasDefault: true;
|
|
2131
2259
|
isPrimaryKey: false;
|
|
2132
2260
|
isAutoincrement: false;
|
|
2133
2261
|
hasRuntimeDefault: false;
|
|
@@ -2178,7 +2306,7 @@ export declare const organizeJobRequests: import("drizzle-orm/pg-core").PgTableW
|
|
|
2178
2306
|
data: number;
|
|
2179
2307
|
driverParam: string | number;
|
|
2180
2308
|
notNull: true;
|
|
2181
|
-
hasDefault:
|
|
2309
|
+
hasDefault: true;
|
|
2182
2310
|
isPrimaryKey: false;
|
|
2183
2311
|
isAutoincrement: false;
|
|
2184
2312
|
hasRuntimeDefault: false;
|
|
@@ -2195,7 +2323,7 @@ export declare const organizeJobRequests: import("drizzle-orm/pg-core").PgTableW
|
|
|
2195
2323
|
data: number;
|
|
2196
2324
|
driverParam: string | number;
|
|
2197
2325
|
notNull: true;
|
|
2198
|
-
hasDefault:
|
|
2326
|
+
hasDefault: true;
|
|
2199
2327
|
isPrimaryKey: false;
|
|
2200
2328
|
isAutoincrement: false;
|
|
2201
2329
|
hasRuntimeDefault: false;
|
|
@@ -2212,7 +2340,7 @@ export declare const organizeJobRequests: import("drizzle-orm/pg-core").PgTableW
|
|
|
2212
2340
|
data: number;
|
|
2213
2341
|
driverParam: string | number;
|
|
2214
2342
|
notNull: true;
|
|
2215
|
-
hasDefault:
|
|
2343
|
+
hasDefault: true;
|
|
2216
2344
|
isPrimaryKey: false;
|
|
2217
2345
|
isAutoincrement: false;
|
|
2218
2346
|
hasRuntimeDefault: false;
|
|
@@ -3278,7 +3406,7 @@ export declare const addresses: import("drizzle-orm/pg-core").PgTableWithColumns
|
|
|
3278
3406
|
data: number;
|
|
3279
3407
|
driverParam: string | number;
|
|
3280
3408
|
notNull: true;
|
|
3281
|
-
hasDefault:
|
|
3409
|
+
hasDefault: true;
|
|
3282
3410
|
isPrimaryKey: false;
|
|
3283
3411
|
isAutoincrement: false;
|
|
3284
3412
|
hasRuntimeDefault: false;
|
|
@@ -3295,7 +3423,7 @@ export declare const addresses: import("drizzle-orm/pg-core").PgTableWithColumns
|
|
|
3295
3423
|
data: number;
|
|
3296
3424
|
driverParam: string | number;
|
|
3297
3425
|
notNull: true;
|
|
3298
|
-
hasDefault:
|
|
3426
|
+
hasDefault: true;
|
|
3299
3427
|
isPrimaryKey: false;
|
|
3300
3428
|
isAutoincrement: false;
|
|
3301
3429
|
hasRuntimeDefault: false;
|
|
@@ -3312,7 +3440,7 @@ export declare const addresses: import("drizzle-orm/pg-core").PgTableWithColumns
|
|
|
3312
3440
|
data: number;
|
|
3313
3441
|
driverParam: string | number;
|
|
3314
3442
|
notNull: true;
|
|
3315
|
-
hasDefault:
|
|
3443
|
+
hasDefault: true;
|
|
3316
3444
|
isPrimaryKey: false;
|
|
3317
3445
|
isAutoincrement: false;
|
|
3318
3446
|
hasRuntimeDefault: false;
|
|
@@ -3329,7 +3457,7 @@ export declare const addresses: import("drizzle-orm/pg-core").PgTableWithColumns
|
|
|
3329
3457
|
data: number;
|
|
3330
3458
|
driverParam: string | number;
|
|
3331
3459
|
notNull: true;
|
|
3332
|
-
hasDefault:
|
|
3460
|
+
hasDefault: true;
|
|
3333
3461
|
isPrimaryKey: false;
|
|
3334
3462
|
isAutoincrement: false;
|
|
3335
3463
|
hasRuntimeDefault: false;
|
|
@@ -3365,7 +3493,7 @@ export declare const addresses: import("drizzle-orm/pg-core").PgTableWithColumns
|
|
|
3365
3493
|
data: number;
|
|
3366
3494
|
driverParam: string | number;
|
|
3367
3495
|
notNull: true;
|
|
3368
|
-
hasDefault:
|
|
3496
|
+
hasDefault: true;
|
|
3369
3497
|
isPrimaryKey: false;
|
|
3370
3498
|
isAutoincrement: false;
|
|
3371
3499
|
hasRuntimeDefault: false;
|
|
@@ -6235,134 +6363,6 @@ export declare const bodyPartContents: import("drizzle-orm/pg-core").PgTableWith
|
|
|
6235
6363
|
};
|
|
6236
6364
|
dialect: "pg";
|
|
6237
6365
|
}>;
|
|
6238
|
-
export declare const labels: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
6239
|
-
name: "label";
|
|
6240
|
-
schema: undefined;
|
|
6241
|
-
columns: {
|
|
6242
|
-
labelId: import("drizzle-orm/pg-core").PgColumn<{
|
|
6243
|
-
name: "label_id";
|
|
6244
|
-
tableName: "label";
|
|
6245
|
-
dataType: "string";
|
|
6246
|
-
columnType: "PgText";
|
|
6247
|
-
data: string;
|
|
6248
|
-
driverParam: string;
|
|
6249
|
-
notNull: true;
|
|
6250
|
-
hasDefault: true;
|
|
6251
|
-
isPrimaryKey: true;
|
|
6252
|
-
isAutoincrement: false;
|
|
6253
|
-
hasRuntimeDefault: true;
|
|
6254
|
-
enumValues: [string, ...string[]];
|
|
6255
|
-
baseColumn: never;
|
|
6256
|
-
identity: undefined;
|
|
6257
|
-
generated: undefined;
|
|
6258
|
-
}, {}, {}>;
|
|
6259
|
-
accountConfigId: import("drizzle-orm/pg-core").PgColumn<{
|
|
6260
|
-
name: "account_config_id";
|
|
6261
|
-
tableName: "label";
|
|
6262
|
-
dataType: "string";
|
|
6263
|
-
columnType: "PgText";
|
|
6264
|
-
data: string;
|
|
6265
|
-
driverParam: string;
|
|
6266
|
-
notNull: true;
|
|
6267
|
-
hasDefault: false;
|
|
6268
|
-
isPrimaryKey: false;
|
|
6269
|
-
isAutoincrement: false;
|
|
6270
|
-
hasRuntimeDefault: false;
|
|
6271
|
-
enumValues: [string, ...string[]];
|
|
6272
|
-
baseColumn: never;
|
|
6273
|
-
identity: undefined;
|
|
6274
|
-
generated: undefined;
|
|
6275
|
-
}, {}, {}>;
|
|
6276
|
-
name: import("drizzle-orm/pg-core").PgColumn<{
|
|
6277
|
-
name: "name";
|
|
6278
|
-
tableName: "label";
|
|
6279
|
-
dataType: "string";
|
|
6280
|
-
columnType: "PgText";
|
|
6281
|
-
data: string;
|
|
6282
|
-
driverParam: string;
|
|
6283
|
-
notNull: true;
|
|
6284
|
-
hasDefault: false;
|
|
6285
|
-
isPrimaryKey: false;
|
|
6286
|
-
isAutoincrement: false;
|
|
6287
|
-
hasRuntimeDefault: false;
|
|
6288
|
-
enumValues: [string, ...string[]];
|
|
6289
|
-
baseColumn: never;
|
|
6290
|
-
identity: undefined;
|
|
6291
|
-
generated: undefined;
|
|
6292
|
-
}, {}, {}>;
|
|
6293
|
-
normalizedName: import("drizzle-orm/pg-core").PgColumn<{
|
|
6294
|
-
name: "normalized_name";
|
|
6295
|
-
tableName: "label";
|
|
6296
|
-
dataType: "string";
|
|
6297
|
-
columnType: "PgText";
|
|
6298
|
-
data: string;
|
|
6299
|
-
driverParam: string;
|
|
6300
|
-
notNull: true;
|
|
6301
|
-
hasDefault: false;
|
|
6302
|
-
isPrimaryKey: false;
|
|
6303
|
-
isAutoincrement: false;
|
|
6304
|
-
hasRuntimeDefault: false;
|
|
6305
|
-
enumValues: [string, ...string[]];
|
|
6306
|
-
baseColumn: never;
|
|
6307
|
-
identity: undefined;
|
|
6308
|
-
generated: undefined;
|
|
6309
|
-
}, {}, {}>;
|
|
6310
|
-
color: import("drizzle-orm/pg-core").PgColumn<{
|
|
6311
|
-
name: "color";
|
|
6312
|
-
tableName: "label";
|
|
6313
|
-
dataType: "string";
|
|
6314
|
-
columnType: "PgText";
|
|
6315
|
-
data: "Default" | "Red" | "Orange" | "Yellow" | "Green" | "Teal" | "Blue" | "Purple" | "Gray";
|
|
6316
|
-
driverParam: string;
|
|
6317
|
-
notNull: true;
|
|
6318
|
-
hasDefault: true;
|
|
6319
|
-
isPrimaryKey: false;
|
|
6320
|
-
isAutoincrement: false;
|
|
6321
|
-
hasRuntimeDefault: false;
|
|
6322
|
-
enumValues: [string, ...string[]];
|
|
6323
|
-
baseColumn: never;
|
|
6324
|
-
identity: undefined;
|
|
6325
|
-
generated: undefined;
|
|
6326
|
-
}, {}, {
|
|
6327
|
-
$type: "Default" | "Red" | "Orange" | "Yellow" | "Green" | "Teal" | "Blue" | "Purple" | "Gray";
|
|
6328
|
-
}>;
|
|
6329
|
-
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
6330
|
-
name: "created_at";
|
|
6331
|
-
tableName: "label";
|
|
6332
|
-
dataType: "number";
|
|
6333
|
-
columnType: "PgBigInt53";
|
|
6334
|
-
data: number;
|
|
6335
|
-
driverParam: string | number;
|
|
6336
|
-
notNull: true;
|
|
6337
|
-
hasDefault: false;
|
|
6338
|
-
isPrimaryKey: false;
|
|
6339
|
-
isAutoincrement: false;
|
|
6340
|
-
hasRuntimeDefault: false;
|
|
6341
|
-
enumValues: undefined;
|
|
6342
|
-
baseColumn: never;
|
|
6343
|
-
identity: undefined;
|
|
6344
|
-
generated: undefined;
|
|
6345
|
-
}, {}, {}>;
|
|
6346
|
-
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
6347
|
-
name: "updated_at";
|
|
6348
|
-
tableName: "label";
|
|
6349
|
-
dataType: "number";
|
|
6350
|
-
columnType: "PgBigInt53";
|
|
6351
|
-
data: number;
|
|
6352
|
-
driverParam: string | number;
|
|
6353
|
-
notNull: true;
|
|
6354
|
-
hasDefault: false;
|
|
6355
|
-
isPrimaryKey: false;
|
|
6356
|
-
isAutoincrement: false;
|
|
6357
|
-
hasRuntimeDefault: false;
|
|
6358
|
-
enumValues: undefined;
|
|
6359
|
-
baseColumn: never;
|
|
6360
|
-
identity: undefined;
|
|
6361
|
-
generated: undefined;
|
|
6362
|
-
}, {}, {}>;
|
|
6363
|
-
};
|
|
6364
|
-
dialect: "pg";
|
|
6365
|
-
}>;
|
|
6366
6366
|
export declare const messageLabels: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
6367
6367
|
name: "message_label";
|
|
6368
6368
|
schema: undefined;
|
package/dist/schema.js
CHANGED
|
@@ -68,7 +68,7 @@ export const accounts = pgTable("account", {
|
|
|
68
68
|
imapStartTls: boolean("imap_start_tls").notNull(),
|
|
69
69
|
smtpEnabled: boolean("smtp_enabled").notNull().default(false),
|
|
70
70
|
smtpHost: text("smtp_host").notNull().default(""),
|
|
71
|
-
smtpPort: integer("smtp_port").notNull(),
|
|
71
|
+
smtpPort: integer("smtp_port").notNull().default(587),
|
|
72
72
|
smtpTls: boolean("smtp_tls").notNull().default(false),
|
|
73
73
|
smtpStartTls: boolean("smtp_start_tls").notNull().default(true),
|
|
74
74
|
smtpUsername: text("smtp_username").notNull().default(""),
|
|
@@ -135,6 +135,18 @@ export const filters = pgTable("filter", {
|
|
|
135
135
|
index("filter_by_account_and_state").on(table.accountConfigId, table.state, table.filterId),
|
|
136
136
|
index("filter_primary").on(table.accountConfigId, table.filterId),
|
|
137
137
|
]);
|
|
138
|
+
export const labels = pgTable("label", {
|
|
139
|
+
labelId: text("label_id").primaryKey().$defaultFn(() => generateBase36Id()),
|
|
140
|
+
accountConfigId: text("account_config_id").notNull(),
|
|
141
|
+
name: text("name").notNull(),
|
|
142
|
+
normalizedName: text("normalized_name").notNull(),
|
|
143
|
+
color: text("color").$type().notNull().default("Default"),
|
|
144
|
+
createdAt: bigint("created_at", { mode: "number" }).notNull(),
|
|
145
|
+
updatedAt: bigint("updated_at", { mode: "number" }).notNull(),
|
|
146
|
+
}, (table) => [
|
|
147
|
+
index("label_by_normalized_name").on(table.accountConfigId, table.normalizedName),
|
|
148
|
+
index("label_primary").on(table.accountConfigId, table.labelId),
|
|
149
|
+
]);
|
|
138
150
|
export const organizeJobRequests = pgTable("organize_job_request", {
|
|
139
151
|
organizeJobId: text("organize_job_id").primaryKey().$defaultFn(() => generateBase36Id()),
|
|
140
152
|
accountConfigId: text("account_config_id").notNull(),
|
|
@@ -143,12 +155,12 @@ export const organizeJobRequests = pgTable("organize_job_request", {
|
|
|
143
155
|
anchorMessageId: text("anchor_message_id").notNull().default("None"),
|
|
144
156
|
matchOperator: text("match_operator").$type().notNull().default("And"),
|
|
145
157
|
literalClauses: jsonb("literal_clauses").notNull().default([]),
|
|
146
|
-
similarityThreshold: doublePrecision("similarity_threshold").notNull(),
|
|
158
|
+
similarityThreshold: doublePrecision("similarity_threshold").notNull().default(0.75),
|
|
147
159
|
actionLabelId: text("action_label_id").notNull().default("None"),
|
|
148
160
|
actionMailboxId: text("action_mailbox_id").notNull().default("None"),
|
|
149
|
-
matchedCount: integer("matched_count").notNull(),
|
|
150
|
-
appliedCount: integer("applied_count").notNull(),
|
|
151
|
-
failedCount: integer("failed_count").notNull(),
|
|
161
|
+
matchedCount: integer("matched_count").notNull().default(0),
|
|
162
|
+
appliedCount: integer("applied_count").notNull().default(0),
|
|
163
|
+
failedCount: integer("failed_count").notNull().default(0),
|
|
152
164
|
errorMessage: text("error_message").notNull().default(""),
|
|
153
165
|
ttl: bigint("ttl", { mode: "number" }).notNull(),
|
|
154
166
|
createdAt: bigint("created_at", { mode: "number" }).notNull(),
|
|
@@ -227,12 +239,12 @@ export const addresses = pgTable("address", {
|
|
|
227
239
|
normalizedEmail: text("normalized_email").notNull(),
|
|
228
240
|
normalizedCompound: text("normalized_compound").notNull(),
|
|
229
241
|
flags: jsonb("flags").notNull(),
|
|
230
|
-
inboundCount: integer("inbound_count").notNull(),
|
|
231
|
-
outboundCount: integer("outbound_count").notNull(),
|
|
232
|
-
replyCount: integer("reply_count").notNull(),
|
|
233
|
-
lastInboundAt: bigint("last_inbound_at", { mode: "number" }).notNull(),
|
|
242
|
+
inboundCount: integer("inbound_count").notNull().default(0),
|
|
243
|
+
outboundCount: integer("outbound_count").notNull().default(0),
|
|
244
|
+
replyCount: integer("reply_count").notNull().default(0),
|
|
245
|
+
lastInboundAt: bigint("last_inbound_at", { mode: "number" }).notNull().default(0),
|
|
234
246
|
lastOutboundAt: nullableBigint("last_outbound_at"),
|
|
235
|
-
lastReplyAt: bigint("last_reply_at", { mode: "number" }).notNull(),
|
|
247
|
+
lastReplyAt: bigint("last_reply_at", { mode: "number" }).notNull().default(0),
|
|
236
248
|
createdAt: bigint("created_at", { mode: "number" }).notNull(),
|
|
237
249
|
updatedAt: bigint("updated_at", { mode: "number" }).notNull(),
|
|
238
250
|
}, (table) => [
|
|
@@ -465,18 +477,6 @@ export const bodyPartContents = pgTable("body_part_content", {
|
|
|
465
477
|
}, (table) => [
|
|
466
478
|
index("body_part_content_by_message_id").on(table.messageId, table.bodyPartContentId),
|
|
467
479
|
]);
|
|
468
|
-
export const labels = pgTable("label", {
|
|
469
|
-
labelId: text("label_id").primaryKey().$defaultFn(() => generateBase36Id()),
|
|
470
|
-
accountConfigId: text("account_config_id").notNull(),
|
|
471
|
-
name: text("name").notNull(),
|
|
472
|
-
normalizedName: text("normalized_name").notNull(),
|
|
473
|
-
color: text("color").$type().notNull().default("Default"),
|
|
474
|
-
createdAt: bigint("created_at", { mode: "number" }).notNull(),
|
|
475
|
-
updatedAt: bigint("updated_at", { mode: "number" }).notNull(),
|
|
476
|
-
}, (table) => [
|
|
477
|
-
index("label_by_normalized_name").on(table.accountConfigId, table.normalizedName),
|
|
478
|
-
index("label_primary").on(table.accountConfigId, table.labelId),
|
|
479
|
-
]);
|
|
480
480
|
export const messageLabels = pgTable("message_label", {
|
|
481
481
|
messageLabelId: text("message_label_id").primaryKey().$defaultFn(() => generateBase36Id()),
|
|
482
482
|
messageId: text("message_id").notNull(),
|
package/package.json
CHANGED
package/schema.ts
CHANGED
|
@@ -86,7 +86,7 @@ export const accounts = pgTable(
|
|
|
86
86
|
imapStartTls: boolean("imap_start_tls").notNull(),
|
|
87
87
|
smtpEnabled: boolean("smtp_enabled").notNull().default(false),
|
|
88
88
|
smtpHost: text("smtp_host").notNull().default(""),
|
|
89
|
-
smtpPort: integer("smtp_port").notNull(),
|
|
89
|
+
smtpPort: integer("smtp_port").notNull().default(587),
|
|
90
90
|
smtpTls: boolean("smtp_tls").notNull().default(false),
|
|
91
91
|
smtpStartTls: boolean("smtp_start_tls").notNull().default(true),
|
|
92
92
|
smtpUsername: text("smtp_username").notNull().default(""),
|
|
@@ -166,6 +166,23 @@ export const filters = pgTable(
|
|
|
166
166
|
],
|
|
167
167
|
);
|
|
168
168
|
|
|
169
|
+
export const labels = pgTable(
|
|
170
|
+
"label",
|
|
171
|
+
{
|
|
172
|
+
labelId: text("label_id").primaryKey().$defaultFn(() => generateBase36Id()),
|
|
173
|
+
accountConfigId: text("account_config_id").notNull(),
|
|
174
|
+
name: text("name").notNull(),
|
|
175
|
+
normalizedName: text("normalized_name").notNull(),
|
|
176
|
+
color: text("color").$type<"Default" | "Red" | "Orange" | "Yellow" | "Green" | "Teal" | "Blue" | "Purple" | "Gray">().notNull().default("Default"),
|
|
177
|
+
createdAt: bigint("created_at", { mode: "number" }).notNull(),
|
|
178
|
+
updatedAt: bigint("updated_at", { mode: "number" }).notNull(),
|
|
179
|
+
},
|
|
180
|
+
(table) => [
|
|
181
|
+
index("label_by_normalized_name").on(table.accountConfigId, table.normalizedName),
|
|
182
|
+
index("label_primary").on(table.accountConfigId, table.labelId),
|
|
183
|
+
],
|
|
184
|
+
);
|
|
185
|
+
|
|
169
186
|
export const organizeJobRequests = pgTable(
|
|
170
187
|
"organize_job_request",
|
|
171
188
|
{
|
|
@@ -176,12 +193,12 @@ export const organizeJobRequests = pgTable(
|
|
|
176
193
|
anchorMessageId: text("anchor_message_id").notNull().default("None"),
|
|
177
194
|
matchOperator: text("match_operator").$type<"And" | "Or">().notNull().default("And"),
|
|
178
195
|
literalClauses: jsonb("literal_clauses").notNull().default([]),
|
|
179
|
-
similarityThreshold: doublePrecision("similarity_threshold").notNull(),
|
|
196
|
+
similarityThreshold: doublePrecision("similarity_threshold").notNull().default(0.75),
|
|
180
197
|
actionLabelId: text("action_label_id").notNull().default("None"),
|
|
181
198
|
actionMailboxId: text("action_mailbox_id").notNull().default("None"),
|
|
182
|
-
matchedCount: integer("matched_count").notNull(),
|
|
183
|
-
appliedCount: integer("applied_count").notNull(),
|
|
184
|
-
failedCount: integer("failed_count").notNull(),
|
|
199
|
+
matchedCount: integer("matched_count").notNull().default(0),
|
|
200
|
+
appliedCount: integer("applied_count").notNull().default(0),
|
|
201
|
+
failedCount: integer("failed_count").notNull().default(0),
|
|
185
202
|
errorMessage: text("error_message").notNull().default(""),
|
|
186
203
|
ttl: bigint("ttl", { mode: "number" }).notNull(),
|
|
187
204
|
createdAt: bigint("created_at", { mode: "number" }).notNull(),
|
|
@@ -275,12 +292,12 @@ export const addresses = pgTable(
|
|
|
275
292
|
normalizedEmail: text("normalized_email").notNull(),
|
|
276
293
|
normalizedCompound: text("normalized_compound").notNull(),
|
|
277
294
|
flags: jsonb("flags").notNull(),
|
|
278
|
-
inboundCount: integer("inbound_count").notNull(),
|
|
279
|
-
outboundCount: integer("outbound_count").notNull(),
|
|
280
|
-
replyCount: integer("reply_count").notNull(),
|
|
281
|
-
lastInboundAt: bigint("last_inbound_at", { mode: "number" }).notNull(),
|
|
295
|
+
inboundCount: integer("inbound_count").notNull().default(0),
|
|
296
|
+
outboundCount: integer("outbound_count").notNull().default(0),
|
|
297
|
+
replyCount: integer("reply_count").notNull().default(0),
|
|
298
|
+
lastInboundAt: bigint("last_inbound_at", { mode: "number" }).notNull().default(0),
|
|
282
299
|
lastOutboundAt: nullableBigint("last_outbound_at"),
|
|
283
|
-
lastReplyAt: bigint("last_reply_at", { mode: "number" }).notNull(),
|
|
300
|
+
lastReplyAt: bigint("last_reply_at", { mode: "number" }).notNull().default(0),
|
|
284
301
|
createdAt: bigint("created_at", { mode: "number" }).notNull(),
|
|
285
302
|
updatedAt: bigint("updated_at", { mode: "number" }).notNull(),
|
|
286
303
|
},
|
|
@@ -601,23 +618,6 @@ export const bodyPartContents = pgTable(
|
|
|
601
618
|
],
|
|
602
619
|
);
|
|
603
620
|
|
|
604
|
-
export const labels = pgTable(
|
|
605
|
-
"label",
|
|
606
|
-
{
|
|
607
|
-
labelId: text("label_id").primaryKey().$defaultFn(() => generateBase36Id()),
|
|
608
|
-
accountConfigId: text("account_config_id").notNull(),
|
|
609
|
-
name: text("name").notNull(),
|
|
610
|
-
normalizedName: text("normalized_name").notNull(),
|
|
611
|
-
color: text("color").$type<"Default" | "Red" | "Orange" | "Yellow" | "Green" | "Teal" | "Blue" | "Purple" | "Gray">().notNull().default("Default"),
|
|
612
|
-
createdAt: bigint("created_at", { mode: "number" }).notNull(),
|
|
613
|
-
updatedAt: bigint("updated_at", { mode: "number" }).notNull(),
|
|
614
|
-
},
|
|
615
|
-
(table) => [
|
|
616
|
-
index("label_by_normalized_name").on(table.accountConfigId, table.normalizedName),
|
|
617
|
-
index("label_primary").on(table.accountConfigId, table.labelId),
|
|
618
|
-
],
|
|
619
|
-
);
|
|
620
|
-
|
|
621
621
|
export const messageLabels = pgTable(
|
|
622
622
|
"message_label",
|
|
623
623
|
{
|