house-types 2.7.2 → 2.8.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 +87 -33
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,43 @@
|
|
|
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
|
+
createdAt: z.ZodString;
|
|
11
17
|
}, "strip", z.ZodTypeAny, {
|
|
12
18
|
city: string;
|
|
19
|
+
radius: number;
|
|
13
20
|
maxPrice: number;
|
|
21
|
+
createdAt: string;
|
|
22
|
+
propertyType?: ("House" | "Apartment" | "Studio" | "Room")[] | undefined;
|
|
23
|
+
surface?: number | undefined;
|
|
14
24
|
minBedrooms?: number | undefined;
|
|
15
|
-
|
|
16
|
-
|
|
25
|
+
furnished?: boolean | undefined;
|
|
26
|
+
flatmates?: boolean | undefined;
|
|
27
|
+
flatmatesGender?: "Male" | "Female" | "Mixed" | undefined;
|
|
28
|
+
gender?: "Male" | "Female" | "Other" | undefined;
|
|
17
29
|
}, {
|
|
18
30
|
city: string;
|
|
31
|
+
radius: string;
|
|
19
32
|
maxPrice: string;
|
|
33
|
+
createdAt: string;
|
|
34
|
+
propertyType?: ("House" | "Apartment" | "Studio" | "Room")[] | undefined;
|
|
35
|
+
surface?: string | undefined;
|
|
20
36
|
minBedrooms?: string | undefined;
|
|
21
|
-
|
|
22
|
-
|
|
37
|
+
furnished?: boolean | undefined;
|
|
38
|
+
flatmates?: boolean | undefined;
|
|
39
|
+
flatmatesGender?: "Male" | "Female" | "Mixed" | undefined;
|
|
40
|
+
gender?: "Male" | "Female" | "Other" | undefined;
|
|
23
41
|
}>;
|
|
24
42
|
export type Alert = z.infer<typeof AlertSchema>;
|
|
25
43
|
export declare const UserSchema: z.ZodObject<{
|
|
@@ -29,22 +47,40 @@ export declare const UserSchema: z.ZodObject<{
|
|
|
29
47
|
lastNotified: z.ZodOptional<z.ZodString>;
|
|
30
48
|
alert: z.ZodObject<{
|
|
31
49
|
city: z.ZodString;
|
|
50
|
+
radius: z.ZodEffects<z.ZodString, number, string>;
|
|
51
|
+
propertyType: z.ZodOptional<z.ZodArray<z.ZodEnum<["House", "Apartment", "Studio", "Room"]>, "many">>;
|
|
32
52
|
maxPrice: z.ZodEffects<z.ZodString, number, string>;
|
|
53
|
+
surface: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
|
|
33
54
|
minBedrooms: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
|
|
34
|
-
|
|
35
|
-
|
|
55
|
+
furnished: z.ZodOptional<z.ZodBoolean>;
|
|
56
|
+
flatmates: z.ZodOptional<z.ZodBoolean>;
|
|
57
|
+
flatmatesGender: z.ZodOptional<z.ZodEnum<["Male", "Female", "Mixed"]>>;
|
|
58
|
+
gender: z.ZodOptional<z.ZodEnum<["Male", "Female", "Other"]>>;
|
|
59
|
+
createdAt: z.ZodString;
|
|
36
60
|
}, "strip", z.ZodTypeAny, {
|
|
37
61
|
city: string;
|
|
62
|
+
radius: number;
|
|
38
63
|
maxPrice: number;
|
|
64
|
+
createdAt: string;
|
|
65
|
+
propertyType?: ("House" | "Apartment" | "Studio" | "Room")[] | undefined;
|
|
66
|
+
surface?: number | undefined;
|
|
39
67
|
minBedrooms?: number | undefined;
|
|
40
|
-
|
|
41
|
-
|
|
68
|
+
furnished?: boolean | undefined;
|
|
69
|
+
flatmates?: boolean | undefined;
|
|
70
|
+
flatmatesGender?: "Male" | "Female" | "Mixed" | undefined;
|
|
71
|
+
gender?: "Male" | "Female" | "Other" | undefined;
|
|
42
72
|
}, {
|
|
43
73
|
city: string;
|
|
74
|
+
radius: string;
|
|
44
75
|
maxPrice: string;
|
|
76
|
+
createdAt: string;
|
|
77
|
+
propertyType?: ("House" | "Apartment" | "Studio" | "Room")[] | undefined;
|
|
78
|
+
surface?: string | undefined;
|
|
45
79
|
minBedrooms?: string | undefined;
|
|
46
|
-
|
|
47
|
-
|
|
80
|
+
furnished?: boolean | undefined;
|
|
81
|
+
flatmates?: boolean | undefined;
|
|
82
|
+
flatmatesGender?: "Male" | "Female" | "Mixed" | undefined;
|
|
83
|
+
gender?: "Male" | "Female" | "Other" | undefined;
|
|
48
84
|
}>;
|
|
49
85
|
}, "strip", z.ZodTypeAny, {
|
|
50
86
|
notificationsEnabled: boolean;
|
|
@@ -52,10 +88,16 @@ export declare const UserSchema: z.ZodObject<{
|
|
|
52
88
|
email: string;
|
|
53
89
|
alert: {
|
|
54
90
|
city: string;
|
|
91
|
+
radius: number;
|
|
55
92
|
maxPrice: number;
|
|
93
|
+
createdAt: string;
|
|
94
|
+
propertyType?: ("House" | "Apartment" | "Studio" | "Room")[] | undefined;
|
|
95
|
+
surface?: number | undefined;
|
|
56
96
|
minBedrooms?: number | undefined;
|
|
57
|
-
|
|
58
|
-
|
|
97
|
+
furnished?: boolean | undefined;
|
|
98
|
+
flatmates?: boolean | undefined;
|
|
99
|
+
flatmatesGender?: "Male" | "Female" | "Mixed" | undefined;
|
|
100
|
+
gender?: "Male" | "Female" | "Other" | undefined;
|
|
59
101
|
};
|
|
60
102
|
lastNotified?: string | undefined;
|
|
61
103
|
}, {
|
|
@@ -63,16 +105,23 @@ export declare const UserSchema: z.ZodObject<{
|
|
|
63
105
|
email: string;
|
|
64
106
|
alert: {
|
|
65
107
|
city: string;
|
|
108
|
+
radius: string;
|
|
66
109
|
maxPrice: string;
|
|
110
|
+
createdAt: string;
|
|
111
|
+
propertyType?: ("House" | "Apartment" | "Studio" | "Room")[] | undefined;
|
|
112
|
+
surface?: string | undefined;
|
|
67
113
|
minBedrooms?: string | undefined;
|
|
68
|
-
|
|
69
|
-
|
|
114
|
+
furnished?: boolean | undefined;
|
|
115
|
+
flatmates?: boolean | undefined;
|
|
116
|
+
flatmatesGender?: "Male" | "Female" | "Mixed" | undefined;
|
|
117
|
+
gender?: "Male" | "Female" | "Other" | undefined;
|
|
70
118
|
};
|
|
71
119
|
notificationsEnabled?: boolean | undefined;
|
|
72
120
|
lastNotified?: string | undefined;
|
|
73
121
|
}>;
|
|
74
122
|
export type User = z.infer<typeof UserSchema>;
|
|
75
123
|
export declare const ParsedHouseSchema: z.ZodObject<{
|
|
124
|
+
source: z.ZodString;
|
|
76
125
|
id: z.ZodString;
|
|
77
126
|
city: z.ZodString;
|
|
78
127
|
price: z.ZodString;
|
|
@@ -89,38 +138,41 @@ export declare const ParsedHouseSchema: z.ZodObject<{
|
|
|
89
138
|
}, "strip", z.ZodTypeAny, {
|
|
90
139
|
city: string;
|
|
91
140
|
propertyType: string;
|
|
141
|
+
createdAt: string;
|
|
142
|
+
source: string;
|
|
92
143
|
id: string;
|
|
93
144
|
price: string;
|
|
94
145
|
bedrooms: string;
|
|
95
|
-
|
|
146
|
+
furnished?: boolean | undefined;
|
|
147
|
+
gender?: string | undefined;
|
|
96
148
|
availabilityDate?: string | undefined;
|
|
97
149
|
roommates?: string | undefined;
|
|
98
|
-
gender?: string | undefined;
|
|
99
150
|
propertyGender?: string | undefined;
|
|
100
151
|
bathrooms?: string | undefined;
|
|
101
|
-
furnished?: boolean | undefined;
|
|
102
152
|
image?: string | undefined;
|
|
103
153
|
}, {
|
|
104
154
|
city: string;
|
|
105
155
|
propertyType: string;
|
|
156
|
+
createdAt: string;
|
|
157
|
+
source: string;
|
|
106
158
|
id: string;
|
|
107
159
|
price: string;
|
|
108
160
|
bedrooms: string;
|
|
109
|
-
|
|
161
|
+
furnished?: boolean | undefined;
|
|
162
|
+
gender?: string | undefined;
|
|
110
163
|
availabilityDate?: string | undefined;
|
|
111
164
|
roommates?: string | undefined;
|
|
112
|
-
gender?: string | undefined;
|
|
113
165
|
propertyGender?: string | undefined;
|
|
114
166
|
bathrooms?: string | undefined;
|
|
115
|
-
furnished?: boolean | undefined;
|
|
116
167
|
image?: string | undefined;
|
|
117
168
|
}>;
|
|
118
169
|
export type ParsedHouse = z.infer<typeof ParsedHouseSchema>;
|
|
119
170
|
export declare const TransformedHouseSchema: z.ZodObject<{
|
|
120
171
|
price: z.ZodNumber;
|
|
121
|
-
propertyType: z.ZodEnum<["
|
|
172
|
+
propertyType: z.ZodEnum<["House", "Apartment", "Studio", "Room"]>;
|
|
122
173
|
bedrooms: z.ZodNumber;
|
|
123
174
|
roommates: z.ZodOptional<z.ZodNumber>;
|
|
175
|
+
source: z.ZodString;
|
|
124
176
|
id: z.ZodString;
|
|
125
177
|
city: z.ZodString;
|
|
126
178
|
availabilityDate: z.ZodOptional<z.ZodString>;
|
|
@@ -132,31 +184,33 @@ export declare const TransformedHouseSchema: z.ZodObject<{
|
|
|
132
184
|
createdAt: z.ZodString;
|
|
133
185
|
}, "strip", z.ZodTypeAny, {
|
|
134
186
|
city: string;
|
|
135
|
-
propertyType: "
|
|
187
|
+
propertyType: "House" | "Apartment" | "Studio" | "Room";
|
|
188
|
+
createdAt: string;
|
|
189
|
+
source: string;
|
|
136
190
|
id: string;
|
|
137
191
|
price: number;
|
|
138
192
|
bedrooms: number;
|
|
139
|
-
|
|
193
|
+
furnished?: boolean | undefined;
|
|
194
|
+
gender?: string | undefined;
|
|
140
195
|
availabilityDate?: string | undefined;
|
|
141
196
|
roommates?: number | undefined;
|
|
142
|
-
gender?: string | undefined;
|
|
143
197
|
propertyGender?: string | undefined;
|
|
144
198
|
bathrooms?: string | undefined;
|
|
145
|
-
furnished?: boolean | undefined;
|
|
146
199
|
image?: string | undefined;
|
|
147
200
|
}, {
|
|
148
201
|
city: string;
|
|
149
|
-
propertyType: "
|
|
202
|
+
propertyType: "House" | "Apartment" | "Studio" | "Room";
|
|
203
|
+
createdAt: string;
|
|
204
|
+
source: string;
|
|
150
205
|
id: string;
|
|
151
206
|
price: number;
|
|
152
207
|
bedrooms: number;
|
|
153
|
-
|
|
208
|
+
furnished?: boolean | undefined;
|
|
209
|
+
gender?: string | undefined;
|
|
154
210
|
availabilityDate?: string | undefined;
|
|
155
211
|
roommates?: number | undefined;
|
|
156
|
-
gender?: string | undefined;
|
|
157
212
|
propertyGender?: string | undefined;
|
|
158
213
|
bathrooms?: string | undefined;
|
|
159
|
-
furnished?: boolean | undefined;
|
|
160
214
|
image?: string | undefined;
|
|
161
215
|
}>;
|
|
162
216
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAetB,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEhD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQrB,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,12 +1,18 @@
|
|
|
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
|
-
|
|
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(),
|
|
15
|
+
createdAt: z.string().datetime(),
|
|
10
16
|
});
|
|
11
17
|
export const UserSchema = z.object({
|
|
12
18
|
notificationsEnabled: z.boolean().default(true),
|
|
@@ -18,6 +24,7 @@ export const UserSchema = z.object({
|
|
|
18
24
|
alert: 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,
|