house-types 2.7.2 → 2.9.0
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/index.d.ts +101 -42
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -8
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,78 +1,132 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const PROPERTY_TYPES: readonly ["
|
|
3
|
-
declare const propertyType: z.ZodEnum<["
|
|
2
|
+
export declare const PROPERTY_TYPES: readonly ["House", "Apartment", "Studio", "Room"];
|
|
3
|
+
declare const propertyType: z.ZodEnum<["House", "Apartment", "Studio", "Room"]>;
|
|
4
4
|
export type PropertyType = z.infer<typeof propertyType>;
|
|
5
5
|
export declare const AlertSchema: z.ZodObject<{
|
|
6
6
|
city: z.ZodString;
|
|
7
|
+
radius: z.ZodEffects<z.ZodString, number, string>;
|
|
8
|
+
propertyType: z.ZodOptional<z.ZodArray<z.ZodEnum<["House", "Apartment", "Studio", "Room"]>, "many">>;
|
|
7
9
|
maxPrice: z.ZodEffects<z.ZodString, number, string>;
|
|
10
|
+
surface: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
|
|
8
11
|
minBedrooms: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
furnished: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
flatmates: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
flatmatesGender: z.ZodOptional<z.ZodEnum<["Male", "Female", "Mixed"]>>;
|
|
15
|
+
gender: z.ZodOptional<z.ZodEnum<["Male", "Female", "Other"]>>;
|
|
16
|
+
frequency: z.ZodEffects<z.ZodEnum<["5", "15", "60", "180", "360", "1440", "10080"]>, number, "5" | "15" | "60" | "180" | "360" | "1440" | "10080">;
|
|
17
|
+
createdAt: z.ZodString;
|
|
11
18
|
}, "strip", z.ZodTypeAny, {
|
|
12
19
|
city: string;
|
|
20
|
+
radius: number;
|
|
13
21
|
maxPrice: number;
|
|
22
|
+
frequency: number;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
propertyType?: ("House" | "Apartment" | "Studio" | "Room")[] | undefined;
|
|
25
|
+
surface?: number | undefined;
|
|
14
26
|
minBedrooms?: number | undefined;
|
|
15
|
-
|
|
16
|
-
|
|
27
|
+
furnished?: boolean | undefined;
|
|
28
|
+
flatmates?: boolean | undefined;
|
|
29
|
+
flatmatesGender?: "Male" | "Female" | "Mixed" | undefined;
|
|
30
|
+
gender?: "Male" | "Female" | "Other" | undefined;
|
|
17
31
|
}, {
|
|
18
32
|
city: string;
|
|
33
|
+
radius: string;
|
|
19
34
|
maxPrice: string;
|
|
35
|
+
frequency: "5" | "15" | "60" | "180" | "360" | "1440" | "10080";
|
|
36
|
+
createdAt: string;
|
|
37
|
+
propertyType?: ("House" | "Apartment" | "Studio" | "Room")[] | undefined;
|
|
38
|
+
surface?: string | undefined;
|
|
20
39
|
minBedrooms?: string | undefined;
|
|
21
|
-
|
|
22
|
-
|
|
40
|
+
furnished?: boolean | undefined;
|
|
41
|
+
flatmates?: boolean | undefined;
|
|
42
|
+
flatmatesGender?: "Male" | "Female" | "Mixed" | undefined;
|
|
43
|
+
gender?: "Male" | "Female" | "Other" | undefined;
|
|
23
44
|
}>;
|
|
24
45
|
export type Alert = z.infer<typeof AlertSchema>;
|
|
25
46
|
export declare const UserSchema: z.ZodObject<{
|
|
26
47
|
notificationsEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
27
|
-
frequency: z.ZodEffects<z.ZodEnum<["5", "15", "60", "180", "360", "1440", "10080"]>, number, "5" | "15" | "60" | "180" | "360" | "1440" | "10080">;
|
|
28
48
|
email: z.ZodString;
|
|
29
49
|
lastNotified: z.ZodOptional<z.ZodString>;
|
|
30
|
-
|
|
50
|
+
alerts: z.ZodArray<z.ZodObject<{
|
|
31
51
|
city: z.ZodString;
|
|
52
|
+
radius: z.ZodEffects<z.ZodString, number, string>;
|
|
53
|
+
propertyType: z.ZodOptional<z.ZodArray<z.ZodEnum<["House", "Apartment", "Studio", "Room"]>, "many">>;
|
|
32
54
|
maxPrice: z.ZodEffects<z.ZodString, number, string>;
|
|
55
|
+
surface: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
|
|
33
56
|
minBedrooms: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
|
|
34
|
-
|
|
35
|
-
|
|
57
|
+
furnished: z.ZodOptional<z.ZodBoolean>;
|
|
58
|
+
flatmates: z.ZodOptional<z.ZodBoolean>;
|
|
59
|
+
flatmatesGender: z.ZodOptional<z.ZodEnum<["Male", "Female", "Mixed"]>>;
|
|
60
|
+
gender: z.ZodOptional<z.ZodEnum<["Male", "Female", "Other"]>>;
|
|
61
|
+
frequency: z.ZodEffects<z.ZodEnum<["5", "15", "60", "180", "360", "1440", "10080"]>, number, "5" | "15" | "60" | "180" | "360" | "1440" | "10080">;
|
|
62
|
+
createdAt: z.ZodString;
|
|
36
63
|
}, "strip", z.ZodTypeAny, {
|
|
37
64
|
city: string;
|
|
65
|
+
radius: number;
|
|
38
66
|
maxPrice: number;
|
|
67
|
+
frequency: number;
|
|
68
|
+
createdAt: string;
|
|
69
|
+
propertyType?: ("House" | "Apartment" | "Studio" | "Room")[] | undefined;
|
|
70
|
+
surface?: number | undefined;
|
|
39
71
|
minBedrooms?: number | undefined;
|
|
40
|
-
|
|
41
|
-
|
|
72
|
+
furnished?: boolean | undefined;
|
|
73
|
+
flatmates?: boolean | undefined;
|
|
74
|
+
flatmatesGender?: "Male" | "Female" | "Mixed" | undefined;
|
|
75
|
+
gender?: "Male" | "Female" | "Other" | undefined;
|
|
42
76
|
}, {
|
|
43
77
|
city: string;
|
|
78
|
+
radius: string;
|
|
44
79
|
maxPrice: string;
|
|
80
|
+
frequency: "5" | "15" | "60" | "180" | "360" | "1440" | "10080";
|
|
81
|
+
createdAt: string;
|
|
82
|
+
propertyType?: ("House" | "Apartment" | "Studio" | "Room")[] | undefined;
|
|
83
|
+
surface?: string | undefined;
|
|
45
84
|
minBedrooms?: string | undefined;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
85
|
+
furnished?: boolean | undefined;
|
|
86
|
+
flatmates?: boolean | undefined;
|
|
87
|
+
flatmatesGender?: "Male" | "Female" | "Mixed" | undefined;
|
|
88
|
+
gender?: "Male" | "Female" | "Other" | undefined;
|
|
89
|
+
}>, "many">;
|
|
49
90
|
}, "strip", z.ZodTypeAny, {
|
|
50
91
|
notificationsEnabled: boolean;
|
|
51
|
-
frequency: number;
|
|
52
92
|
email: string;
|
|
53
|
-
|
|
93
|
+
alerts: {
|
|
54
94
|
city: string;
|
|
95
|
+
radius: number;
|
|
55
96
|
maxPrice: number;
|
|
97
|
+
frequency: number;
|
|
98
|
+
createdAt: string;
|
|
99
|
+
propertyType?: ("House" | "Apartment" | "Studio" | "Room")[] | undefined;
|
|
100
|
+
surface?: number | undefined;
|
|
56
101
|
minBedrooms?: number | undefined;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
102
|
+
furnished?: boolean | undefined;
|
|
103
|
+
flatmates?: boolean | undefined;
|
|
104
|
+
flatmatesGender?: "Male" | "Female" | "Mixed" | undefined;
|
|
105
|
+
gender?: "Male" | "Female" | "Other" | undefined;
|
|
106
|
+
}[];
|
|
60
107
|
lastNotified?: string | undefined;
|
|
61
108
|
}, {
|
|
62
|
-
frequency: "5" | "15" | "60" | "180" | "360" | "1440" | "10080";
|
|
63
109
|
email: string;
|
|
64
|
-
|
|
110
|
+
alerts: {
|
|
65
111
|
city: string;
|
|
112
|
+
radius: string;
|
|
66
113
|
maxPrice: string;
|
|
114
|
+
frequency: "5" | "15" | "60" | "180" | "360" | "1440" | "10080";
|
|
115
|
+
createdAt: string;
|
|
116
|
+
propertyType?: ("House" | "Apartment" | "Studio" | "Room")[] | undefined;
|
|
117
|
+
surface?: string | undefined;
|
|
67
118
|
minBedrooms?: string | undefined;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
119
|
+
furnished?: boolean | undefined;
|
|
120
|
+
flatmates?: boolean | undefined;
|
|
121
|
+
flatmatesGender?: "Male" | "Female" | "Mixed" | undefined;
|
|
122
|
+
gender?: "Male" | "Female" | "Other" | undefined;
|
|
123
|
+
}[];
|
|
71
124
|
notificationsEnabled?: boolean | undefined;
|
|
72
125
|
lastNotified?: string | undefined;
|
|
73
126
|
}>;
|
|
74
127
|
export type User = z.infer<typeof UserSchema>;
|
|
75
128
|
export declare const ParsedHouseSchema: z.ZodObject<{
|
|
129
|
+
source: z.ZodString;
|
|
76
130
|
id: z.ZodString;
|
|
77
131
|
city: z.ZodString;
|
|
78
132
|
price: z.ZodString;
|
|
@@ -89,38 +143,41 @@ export declare const ParsedHouseSchema: z.ZodObject<{
|
|
|
89
143
|
}, "strip", z.ZodTypeAny, {
|
|
90
144
|
city: string;
|
|
91
145
|
propertyType: string;
|
|
146
|
+
createdAt: string;
|
|
147
|
+
source: string;
|
|
92
148
|
id: string;
|
|
93
149
|
price: string;
|
|
94
150
|
bedrooms: string;
|
|
95
|
-
|
|
151
|
+
furnished?: boolean | undefined;
|
|
152
|
+
gender?: string | undefined;
|
|
96
153
|
availabilityDate?: string | undefined;
|
|
97
154
|
roommates?: string | undefined;
|
|
98
|
-
gender?: string | undefined;
|
|
99
155
|
propertyGender?: string | undefined;
|
|
100
156
|
bathrooms?: string | undefined;
|
|
101
|
-
furnished?: boolean | undefined;
|
|
102
157
|
image?: string | undefined;
|
|
103
158
|
}, {
|
|
104
159
|
city: string;
|
|
105
160
|
propertyType: string;
|
|
161
|
+
createdAt: string;
|
|
162
|
+
source: string;
|
|
106
163
|
id: string;
|
|
107
164
|
price: string;
|
|
108
165
|
bedrooms: string;
|
|
109
|
-
|
|
166
|
+
furnished?: boolean | undefined;
|
|
167
|
+
gender?: string | undefined;
|
|
110
168
|
availabilityDate?: string | undefined;
|
|
111
169
|
roommates?: string | undefined;
|
|
112
|
-
gender?: string | undefined;
|
|
113
170
|
propertyGender?: string | undefined;
|
|
114
171
|
bathrooms?: string | undefined;
|
|
115
|
-
furnished?: boolean | undefined;
|
|
116
172
|
image?: string | undefined;
|
|
117
173
|
}>;
|
|
118
174
|
export type ParsedHouse = z.infer<typeof ParsedHouseSchema>;
|
|
119
175
|
export declare const TransformedHouseSchema: z.ZodObject<{
|
|
120
176
|
price: z.ZodNumber;
|
|
121
|
-
propertyType: z.ZodEnum<["
|
|
177
|
+
propertyType: z.ZodEnum<["House", "Apartment", "Studio", "Room"]>;
|
|
122
178
|
bedrooms: z.ZodNumber;
|
|
123
179
|
roommates: z.ZodOptional<z.ZodNumber>;
|
|
180
|
+
source: z.ZodString;
|
|
124
181
|
id: z.ZodString;
|
|
125
182
|
city: z.ZodString;
|
|
126
183
|
availabilityDate: z.ZodOptional<z.ZodString>;
|
|
@@ -132,31 +189,33 @@ export declare const TransformedHouseSchema: z.ZodObject<{
|
|
|
132
189
|
createdAt: z.ZodString;
|
|
133
190
|
}, "strip", z.ZodTypeAny, {
|
|
134
191
|
city: string;
|
|
135
|
-
propertyType: "
|
|
192
|
+
propertyType: "House" | "Apartment" | "Studio" | "Room";
|
|
193
|
+
createdAt: string;
|
|
194
|
+
source: string;
|
|
136
195
|
id: string;
|
|
137
196
|
price: number;
|
|
138
197
|
bedrooms: number;
|
|
139
|
-
|
|
198
|
+
furnished?: boolean | undefined;
|
|
199
|
+
gender?: string | undefined;
|
|
140
200
|
availabilityDate?: string | undefined;
|
|
141
201
|
roommates?: number | undefined;
|
|
142
|
-
gender?: string | undefined;
|
|
143
202
|
propertyGender?: string | undefined;
|
|
144
203
|
bathrooms?: string | undefined;
|
|
145
|
-
furnished?: boolean | undefined;
|
|
146
204
|
image?: string | undefined;
|
|
147
205
|
}, {
|
|
148
206
|
city: string;
|
|
149
|
-
propertyType: "
|
|
207
|
+
propertyType: "House" | "Apartment" | "Studio" | "Room";
|
|
208
|
+
createdAt: string;
|
|
209
|
+
source: string;
|
|
150
210
|
id: string;
|
|
151
211
|
price: number;
|
|
152
212
|
bedrooms: number;
|
|
153
|
-
|
|
213
|
+
furnished?: boolean | undefined;
|
|
214
|
+
gender?: string | undefined;
|
|
154
215
|
availabilityDate?: string | undefined;
|
|
155
216
|
roommates?: number | undefined;
|
|
156
|
-
gender?: string | undefined;
|
|
157
217
|
propertyGender?: string | undefined;
|
|
158
218
|
bathrooms?: string | undefined;
|
|
159
|
-
furnished?: boolean | undefined;
|
|
160
219
|
image?: string | undefined;
|
|
161
220
|
}>;
|
|
162
221
|
export type TransformedHouse = z.infer<typeof TransformedHouseSchema>;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc,mDAAoD,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc,mDAAoD,CAAC;AAEhF,QAAA,MAAM,YAAY,qDAAyB,CAAC;AAE5C,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBtB,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEhD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKrB,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAmB9C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export const PROPERTY_TYPES = ["
|
|
2
|
+
export const PROPERTY_TYPES = ["House", "Apartment", "Studio", "Room"];
|
|
3
3
|
const propertyType = z.enum(PROPERTY_TYPES);
|
|
4
4
|
export const AlertSchema = z.object({
|
|
5
5
|
city: z.string(),
|
|
6
|
+
radius: z.string().regex(/^\d+$/).transform(Number),
|
|
7
|
+
propertyType: z.array(propertyType).optional(),
|
|
6
8
|
maxPrice: z.string().regex(/^\d+$/).transform(Number),
|
|
9
|
+
surface: z.string().regex(/^\d+$/).transform(Number).optional(),
|
|
7
10
|
minBedrooms: z.string().regex(/^\d+$/).transform(Number).optional(),
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
notificationsEnabled: z.boolean().default(true),
|
|
11
|
+
furnished: z.boolean().optional(),
|
|
12
|
+
flatmates: z.boolean().optional(),
|
|
13
|
+
flatmatesGender: z.enum(["Male", "Female", "Mixed"]).optional(),
|
|
14
|
+
gender: z.enum(["Male", "Female", "Other"]).optional(),
|
|
13
15
|
frequency: z
|
|
14
16
|
.enum(["5", "15", "60", "180", "360", "1440", "10080"])
|
|
15
17
|
.transform(Number),
|
|
18
|
+
createdAt: z.string().datetime(),
|
|
19
|
+
});
|
|
20
|
+
export const UserSchema = z.object({
|
|
21
|
+
notificationsEnabled: z.boolean().default(true),
|
|
16
22
|
email: z.string().email(),
|
|
17
23
|
lastNotified: z.string().datetime().optional(),
|
|
18
|
-
|
|
24
|
+
alerts: z.array(AlertSchema),
|
|
19
25
|
});
|
|
20
26
|
const parsedHouseSchema = {
|
|
27
|
+
source: z.string(),
|
|
21
28
|
id: z.string(),
|
|
22
29
|
city: z.string(),
|
|
23
30
|
price: z.string(),
|
|
@@ -33,7 +40,7 @@ const parsedHouseSchema = {
|
|
|
33
40
|
createdAt: z.string().datetime(),
|
|
34
41
|
};
|
|
35
42
|
export const ParsedHouseSchema = z.object({
|
|
36
|
-
...parsedHouseSchema
|
|
43
|
+
...parsedHouseSchema,
|
|
37
44
|
});
|
|
38
45
|
export const TransformedHouseSchema = z.object({
|
|
39
46
|
...parsedHouseSchema,
|