house-types 2.5.6 → 2.6.1

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 CHANGED
@@ -69,34 +69,61 @@ export declare const UserSchema: z.ZodObject<{
69
69
  lastNotified?: string | undefined;
70
70
  }>;
71
71
  export type User = z.infer<typeof UserSchema>;
72
- export declare const RawHouseSchema: z.ZodObject<{
72
+ export declare const ParsedHouseSchema: z.ZodObject<{
73
73
  id: z.ZodString;
74
74
  city: z.ZodString;
75
- price: z.ZodEffects<z.ZodString, number, string>;
76
- image: z.ZodString;
75
+ price: z.ZodString;
76
+ availabilityDate: z.ZodOptional<z.ZodString>;
77
+ propertyType: z.ZodString;
78
+ bedrooms: z.ZodString;
79
+ roommates: z.ZodOptional<z.ZodString>;
80
+ gender: z.ZodOptional<z.ZodString>;
81
+ propertyGender: z.ZodOptional<z.ZodString>;
82
+ bathrooms: z.ZodOptional<z.ZodString>;
83
+ furnished: z.ZodOptional<z.ZodBoolean>;
84
+ image: z.ZodOptional<z.ZodString>;
85
+ createdAt: z.ZodString;
77
86
  }, "strip", z.ZodTypeAny, {
78
87
  city: string;
88
+ propertyType: string;
79
89
  id: string;
80
- price: number;
81
- image: string;
90
+ price: string;
91
+ bedrooms: string;
92
+ createdAt: string;
93
+ availabilityDate?: string | undefined;
94
+ roommates?: string | undefined;
95
+ gender?: string | undefined;
96
+ propertyGender?: string | undefined;
97
+ bathrooms?: string | undefined;
98
+ furnished?: boolean | undefined;
99
+ image?: string | undefined;
82
100
  }, {
83
101
  city: string;
102
+ propertyType: string;
84
103
  id: string;
85
104
  price: string;
86
- image: string;
105
+ bedrooms: string;
106
+ createdAt: string;
107
+ availabilityDate?: string | undefined;
108
+ roommates?: string | undefined;
109
+ gender?: string | undefined;
110
+ propertyGender?: string | undefined;
111
+ bathrooms?: string | undefined;
112
+ furnished?: boolean | undefined;
113
+ image?: string | undefined;
87
114
  }>;
88
- export type RawHouse = z.infer<typeof RawHouseSchema>;
89
- export declare const HouseSchema: z.ZodObject<{
115
+ export type ParsedHouse = z.infer<typeof ParsedHouseSchema>;
116
+ export declare const TransformedHouseSchema: z.ZodObject<{
117
+ price: z.ZodNumber;
118
+ propertyType: z.ZodEnum<["house", "apartment", "studio", "room"]>;
119
+ bedrooms: z.ZodNumber;
120
+ roommates: z.ZodOptional<z.ZodNumber>;
90
121
  id: z.ZodString;
91
122
  city: z.ZodString;
92
- price: z.ZodString;
93
123
  availabilityDate: z.ZodOptional<z.ZodString>;
94
- propertyType: z.ZodEnum<["house", "apartment", "studio", "room"]>;
95
- bedrooms: z.ZodString;
96
- roommates: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
97
- gender: z.ZodOptional<z.ZodEnum<["m", "f", "any"]>>;
98
- propertyGender: z.ZodOptional<z.ZodEnum<["m", "f", "mixed"]>>;
99
- bathrooms: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
124
+ gender: z.ZodOptional<z.ZodString>;
125
+ propertyGender: z.ZodOptional<z.ZodString>;
126
+ bathrooms: z.ZodOptional<z.ZodString>;
100
127
  furnished: z.ZodOptional<z.ZodBoolean>;
101
128
  image: z.ZodOptional<z.ZodString>;
102
129
  createdAt: z.ZodString;
@@ -104,30 +131,30 @@ export declare const HouseSchema: z.ZodObject<{
104
131
  city: string;
105
132
  propertyType: "house" | "apartment" | "studio" | "room";
106
133
  id: string;
107
- price: string;
108
- bedrooms: string;
134
+ price: number;
135
+ bedrooms: number;
109
136
  createdAt: string;
110
- image?: string | undefined;
111
137
  availabilityDate?: string | undefined;
112
138
  roommates?: number | undefined;
113
- gender?: "m" | "f" | "any" | undefined;
114
- propertyGender?: "m" | "f" | "mixed" | undefined;
115
- bathrooms?: number | undefined;
139
+ gender?: string | undefined;
140
+ propertyGender?: string | undefined;
141
+ bathrooms?: string | undefined;
116
142
  furnished?: boolean | undefined;
143
+ image?: string | undefined;
117
144
  }, {
118
145
  city: string;
119
146
  propertyType: "house" | "apartment" | "studio" | "room";
120
147
  id: string;
121
- price: string;
122
- bedrooms: string;
148
+ price: number;
149
+ bedrooms: number;
123
150
  createdAt: string;
124
- image?: string | undefined;
125
151
  availabilityDate?: string | undefined;
126
- roommates?: string | undefined;
127
- gender?: "m" | "f" | "any" | undefined;
128
- propertyGender?: "m" | "f" | "mixed" | undefined;
152
+ roommates?: number | undefined;
153
+ gender?: string | undefined;
154
+ propertyGender?: string | undefined;
129
155
  bathrooms?: string | undefined;
130
156
  furnished?: boolean | undefined;
157
+ image?: string | undefined;
131
158
  }>;
132
- export type House = z.infer<typeof HouseSchema>;
159
+ export type TransformedHouse = z.infer<typeof TransformedHouseSchema>;
133
160
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;EAMtB,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;AAE9C,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;EAKzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EActB,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;EAMtB,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;AAkB9C,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
@@ -16,24 +16,28 @@ export const UserSchema = z.object({
16
16
  lastNotified: z.string().datetime().optional(),
17
17
  alert: AlertSchema,
18
18
  });
19
- export const RawHouseSchema = z.object({
20
- id: z.string(),
21
- city: z.string(),
22
- price: z.string().regex(/^\d+$/).transform(Number),
23
- image: z.string(),
24
- });
25
- export const HouseSchema = z.object({
19
+ const parsedHouseSchema = {
26
20
  id: z.string(),
27
21
  city: z.string(),
28
22
  price: z.string(),
29
23
  availabilityDate: z.string().datetime().optional(),
30
- propertyType,
24
+ propertyType: z.string(),
31
25
  bedrooms: z.string(),
32
- roommates: z.string().regex(/^\d+$/).transform(Number).optional(),
33
- gender: z.enum(["m", "f", "any"]).optional(),
34
- propertyGender: z.enum(["m", "f", "mixed"]).optional(),
35
- bathrooms: z.string().regex(/^\d+$/).transform(Number).optional(),
26
+ roommates: z.string().optional(),
27
+ gender: z.string().optional(),
28
+ propertyGender: z.string().optional(),
29
+ bathrooms: z.string().optional(),
36
30
  furnished: z.boolean().optional(),
37
31
  image: z.string().optional(),
38
32
  createdAt: z.string().datetime(),
33
+ };
34
+ export const ParsedHouseSchema = z.object({
35
+ ...parsedHouseSchema
36
+ });
37
+ export const TransformedHouseSchema = z.object({
38
+ ...parsedHouseSchema,
39
+ price: z.number(),
40
+ propertyType,
41
+ bedrooms: z.number(),
42
+ roommates: z.number().optional(),
39
43
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "house-types",
3
- "version": "2.5.6",
3
+ "version": "2.6.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",