-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.ts
More file actions
294 lines (262 loc) · 6.41 KB
/
main.ts
File metadata and controls
294 lines (262 loc) · 6.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
import type { ColumnType } from "kysely"
export enum AccessType {
owner = "owner",
viewer = "viewer",
}
export enum DataType {
boolean = "boolean",
number = "number",
numberArray = "number_array",
text = "text",
textArray = "text_array",
json = "json",
}
export enum DefaultColumnBehavior {
create = "create",
hide = "hide",
include = "include",
}
export enum ExtractionStatus {
degraded = "degraded",
dispatched = "dispatched",
failure = "failure",
success = "success",
}
export enum Field {
availableAt = "available_at",
baths = "baths",
beds = "beds",
bodyStyle = "body_style",
cabType = "cab_type",
certifiedPreowned = "certified_preowned",
cityMpg = "city_mpg",
cleanTitle = "clean_title",
cylinderCount = "cylinder_count",
dateListed = "date_listed",
doorCount = "door_count",
drivetrain = "drivetrain",
engine = "engine",
exteriorColor = "exterior_color",
externalId = "external_id",
financingEligible = "financing_eligible",
fuelType = "fuel_type",
highwayMpg = "highway_mpg",
homeDelivery = "home_delivery",
images = "images",
interiorColor = "interior_color",
isAvailable = "is_available",
location = "location",
make = "make",
mileage = "mileage",
model = "model",
noAccidents = "no_accidents",
numReviews = "num_reviews",
oneOwner = "one_owner",
openRecall = "open_recall",
personalUse = "personal_use",
predictedPriceUsd = "predicted_price_usd",
priceGbp = "price_gbp",
priceUsd = "price_usd",
rating = "rating",
seatCount = "seat_count",
sellerName = "seller_name",
sellerPhone = "seller_phone",
sellerType = "seller_type",
sellerUrl = "seller_url",
source = "source",
sqft = "sqft",
title = "title",
trim = "trim",
url = "url",
usageStatus = "usage_status",
year = "year",
notes = "notes",
}
export enum IdentityProvider {
auth0 = "auth0",
}
export enum ListingType {
apartment = "apartment",
automobile = "automobile",
furniture = "furniture",
homestay = "homestay",
hostel = "hostel",
house = "house",
}
export enum Source {
airbnb = "airbnb",
apartmentsCom = "apartments_com",
cars = "cars",
corcoran = "corcoran",
craigslist = "craigslist",
genericLink = "generic_link",
hostelworld = "hostelworld",
manual = "manual",
noSource = "no_source",
realtor = "realtor",
redfin = "redfin",
streetEasy = "street_easy",
trulia = "trulia",
vrbo = "vrbo",
wayfair = "wayfair",
zillow = "zillow",
zooplaCouk = "zoopla_couk",
}
export enum UserType {
admin = "admin",
regular = "regular",
}
export type Generated<T> = T extends ColumnType<infer S, infer I, infer U>
? ColumnType<S, I | undefined, U>
: ColumnType<T, T | undefined, T>
export type Json = JsonValue
export type JsonArray = JsonValue[]
export type JsonObject = {
[K in string]?: JsonValue
}
export type JsonPrimitive = boolean | number | string | null
export type JsonValue = JsonArray | JsonObject | JsonPrimitive
export type Timestamp = ColumnType<Date, Date | string, Date | string>
export interface CachedFuncCalls {
created: Generated<Timestamp>
id: Generated<string>
serializedFuncCall: Json
updated: Generated<Timestamp>
value: Json | null
}
export interface Cells {
created: Generated<Timestamp>
id: Generated<string>
sheetColumnId: string
sheetRowId: string
updated: Generated<Timestamp>
value: Generated<Json>
}
export interface ColumnDefinitions {
created: Generated<Timestamp>
dataType: DataType
field: Field | null
formatSpec: Json
generatorSpec: string | null
id: Generated<string>
updated: Generated<Timestamp>
}
export interface ExtractedData {
created: Generated<Timestamp>
field: Field
id: Generated<string>
source: Source
sourceKey: string
updated: Generated<Timestamp>
value: Json | null
}
export interface ExtractionLogs {
created: Generated<Timestamp>
extractionStatus: ExtractionStatus
id: Generated<string>
log: string | null
source: Source
sourceKey: string
updated: Generated<Timestamp>
}
export interface FieldSettings {
defaultColumnBehavior: DefaultColumnBehavior
refName: Field
sortedOrder: number
}
export interface ProxySettings {
config: Json
created: Generated<Timestamp>
id: Generated<string>
source: Source
updated: Generated<Timestamp>
}
export interface SheetColumns {
columnDefinitionId: string
created: Generated<Timestamp>
hidden: Generated<boolean>
id: Generated<string>
name: string
sheetId: string
sortedOrder: Generated<number>
updated: Generated<Timestamp>
}
export interface SheetGlobals {
columnDefinitionId: string
columnScoped: boolean | null
created: Generated<Timestamp>
id: Generated<string>
sheetId: string
updated: Generated<Timestamp>
value: Json | null
varName: string
}
export interface SheetRows {
created: Generated<Timestamp>
id: Generated<string>
originalInput: string | null
sheetId: string
sortedOrder: Generated<number>
source: Source
sourceKey: string
updated: Generated<Timestamp>
}
export interface Sheets {
created: Generated<Timestamp>
defaultAccessType: Generated<AccessType>
id: Generated<string>
listingType: ListingType | null
name: string
updated: Generated<Timestamp>
}
export interface SheetViews {
created: Generated<Timestamp>
filters: Json | null
grouping: Json | null
id: Generated<string>
sheetId: string
updated: Generated<Timestamp>
userAccountId: string
}
export interface UserAccountLinks {
created: Generated<Timestamp>
email: string
id: Generated<string>
identityProvider: IdentityProvider
sub: string
updated: Generated<Timestamp>
userAccountId: string
}
export interface UserAccounts {
created: Generated<Timestamp>
id: Generated<string>
name: string
updated: Generated<Timestamp>
userType: Generated<UserType>
}
export interface UserAccountSheets {
accessType: AccessType
activeSheetViewId: string | null
created: Generated<Timestamp>
id: Generated<string>
sheetId: string
updated: Generated<Timestamp>
userAccountId: string
}
export interface DB {
cachedFuncCalls: CachedFuncCalls
cells: Cells
columnDefinitions: ColumnDefinitions
extractedData: ExtractedData
extractionLogs: ExtractionLogs
fieldSettings: FieldSettings
proxySettings: ProxySettings
sheetColumns: SheetColumns
sheetGlobals: SheetGlobals
sheetRows: SheetRows
sheets: Sheets
sheetViews: SheetViews
userAccountLinks: UserAccountLinks
userAccounts: UserAccounts
userAccountSheets: UserAccountSheets
}