house-types 1.0.11 → 2.0.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 CHANGED
@@ -1,39 +1,102 @@
1
- import { z } from 'zod';
2
- export declare const UserSchema: z.ZodObject<{
1
+ import { z } from "zod";
2
+ export declare const AlertSchema: z.ZodObject<{
3
3
  id: z.ZodString;
4
4
  city: z.ZodOptional<z.ZodString>;
5
5
  maxPrice: z.ZodEffects<z.ZodString, number, string>;
6
6
  minBedrooms: z.ZodEffects<z.ZodString, number, string>;
7
7
  furnishedOnly: z.ZodOptional<z.ZodBoolean>;
8
8
  propertyType: z.ZodOptional<z.ZodArray<z.ZodEnum<["house", "apartment", "studio", "shared-room"]>, "many">>;
9
- notificationsEnabled: z.ZodDefault<z.ZodBoolean>;
10
- frequency: z.ZodEffects<z.ZodEnum<["5", "15", "60", "180", "360", "1440"]>, number, "5" | "15" | "60" | "180" | "360" | "1440">;
11
- email: z.ZodString;
12
- lastNotified: z.ZodOptional<z.ZodString>;
13
9
  }, "strip", z.ZodTypeAny, {
14
10
  id: string;
15
11
  maxPrice: number;
16
12
  minBedrooms: number;
17
- notificationsEnabled: boolean;
18
- frequency: number;
19
- email: string;
20
13
  city?: string | undefined;
21
14
  furnishedOnly?: boolean | undefined;
22
15
  propertyType?: ("house" | "apartment" | "studio" | "shared-room")[] | undefined;
23
- lastNotified?: string | undefined;
24
16
  }, {
25
17
  id: string;
26
18
  maxPrice: string;
27
19
  minBedrooms: string;
28
- frequency: "5" | "15" | "60" | "180" | "360" | "1440";
29
- email: string;
30
20
  city?: string | undefined;
31
21
  furnishedOnly?: boolean | undefined;
32
22
  propertyType?: ("house" | "apartment" | "studio" | "shared-room")[] | undefined;
23
+ }>;
24
+ export type Alert = z.infer<typeof AlertSchema>;
25
+ export declare const UserSchema: z.ZodObject<{
26
+ id: z.ZodString;
27
+ notificationsEnabled: z.ZodDefault<z.ZodBoolean>;
28
+ frequency: z.ZodEffects<z.ZodEnum<["5", "15", "60", "180", "360", "1440"]>, number, "5" | "15" | "60" | "180" | "360" | "1440">;
29
+ email: z.ZodString;
30
+ lastNotified: z.ZodOptional<z.ZodString>;
31
+ alerts: z.ZodDefault<z.ZodArray<z.ZodObject<{
32
+ id: z.ZodString;
33
+ city: z.ZodOptional<z.ZodString>;
34
+ maxPrice: z.ZodEffects<z.ZodString, number, string>;
35
+ minBedrooms: z.ZodEffects<z.ZodString, number, string>;
36
+ furnishedOnly: z.ZodOptional<z.ZodBoolean>;
37
+ propertyType: z.ZodOptional<z.ZodArray<z.ZodEnum<["house", "apartment", "studio", "shared-room"]>, "many">>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ id: string;
40
+ maxPrice: number;
41
+ minBedrooms: number;
42
+ city?: string | undefined;
43
+ furnishedOnly?: boolean | undefined;
44
+ propertyType?: ("house" | "apartment" | "studio" | "shared-room")[] | undefined;
45
+ }, {
46
+ id: string;
47
+ maxPrice: string;
48
+ minBedrooms: string;
49
+ city?: string | undefined;
50
+ furnishedOnly?: boolean | undefined;
51
+ propertyType?: ("house" | "apartment" | "studio" | "shared-room")[] | undefined;
52
+ }>, "many">>;
53
+ }, "strip", z.ZodTypeAny, {
54
+ id: string;
55
+ notificationsEnabled: boolean;
56
+ frequency: number;
57
+ email: string;
58
+ alerts: {
59
+ id: string;
60
+ maxPrice: number;
61
+ minBedrooms: number;
62
+ city?: string | undefined;
63
+ furnishedOnly?: boolean | undefined;
64
+ propertyType?: ("house" | "apartment" | "studio" | "shared-room")[] | undefined;
65
+ }[];
66
+ lastNotified?: string | undefined;
67
+ }, {
68
+ id: string;
69
+ frequency: "5" | "15" | "60" | "180" | "360" | "1440";
70
+ email: string;
33
71
  notificationsEnabled?: boolean | undefined;
34
72
  lastNotified?: string | undefined;
73
+ alerts?: {
74
+ id: string;
75
+ maxPrice: string;
76
+ minBedrooms: string;
77
+ city?: string | undefined;
78
+ furnishedOnly?: boolean | undefined;
79
+ propertyType?: ("house" | "apartment" | "studio" | "shared-room")[] | undefined;
80
+ }[] | undefined;
35
81
  }>;
36
82
  export type User = z.infer<typeof UserSchema>;
83
+ export declare const RawHouseSchema: z.ZodObject<{
84
+ id: z.ZodString;
85
+ city: z.ZodString;
86
+ price: z.ZodString;
87
+ image: z.ZodString;
88
+ }, "strip", z.ZodTypeAny, {
89
+ id: string;
90
+ city: string;
91
+ price: string;
92
+ image: string;
93
+ }, {
94
+ id: string;
95
+ city: string;
96
+ price: string;
97
+ image: string;
98
+ }>;
99
+ export type RawHouse = z.infer<typeof RawHouseSchema>;
37
100
  export declare const HouseSchema: z.ZodObject<{
38
101
  id: z.ZodString;
39
102
  city: z.ZodString;
@@ -57,11 +120,11 @@ export declare const HouseSchema: z.ZodObject<{
57
120
  roommates: number;
58
121
  bathrooms: number;
59
122
  createdAt: string;
123
+ image?: string | undefined;
60
124
  availabilityDate?: string | undefined;
61
125
  gender?: "m" | "f" | "any" | undefined;
62
126
  propertyGender?: "m" | "f" | "mixed" | undefined;
63
127
  furnished?: boolean | undefined;
64
- image?: string | undefined;
65
128
  }, {
66
129
  id: string;
67
130
  city: string;
@@ -71,11 +134,11 @@ export declare const HouseSchema: z.ZodObject<{
71
134
  roommates: string;
72
135
  bathrooms: string;
73
136
  createdAt: string;
137
+ image?: string | undefined;
74
138
  availabilityDate?: string | undefined;
75
139
  gender?: "m" | "f" | "any" | undefined;
76
140
  propertyGender?: "m" | "f" | "mixed" | undefined;
77
141
  furnished?: boolean | undefined;
78
- image?: string | undefined;
79
142
  }>;
80
143
  export type House = z.infer<typeof HouseSchema>;
81
144
  //# 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;AAExB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWrB,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAE9C,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;AAExB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;EAStB,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEhD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOrB,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"}
package/dist/index.js CHANGED
@@ -1,26 +1,38 @@
1
- import { z } from 'zod';
2
- export const UserSchema = z.object({
1
+ import { z } from "zod";
2
+ export const AlertSchema = z.object({
3
3
  id: z.string(),
4
4
  city: z.string().optional(),
5
5
  maxPrice: z.string().regex(/^\d+$/).transform(Number),
6
6
  minBedrooms: z.string().regex(/^\d+$/).transform(Number),
7
7
  furnishedOnly: z.boolean().optional(),
8
- propertyType: z.array(z.enum(['house', 'apartment', 'studio', 'shared-room'])).optional(),
8
+ propertyType: z
9
+ .array(z.enum(["house", "apartment", "studio", "shared-room"]))
10
+ .optional(),
11
+ });
12
+ export const UserSchema = z.object({
13
+ id: z.string(),
9
14
  notificationsEnabled: z.boolean().default(true),
10
- frequency: z.enum(['5', '15', '60', '180', '360', '1440']).transform(Number),
15
+ frequency: z.enum(["5", "15", "60", "180", "360", "1440"]).transform(Number),
11
16
  email: z.string().email(),
12
17
  lastNotified: z.string().datetime().optional(),
18
+ alerts: z.array(AlertSchema).default([]),
19
+ });
20
+ export const RawHouseSchema = z.object({
21
+ id: z.string(),
22
+ city: z.string(),
23
+ price: z.string().regex(/^[\d\s€.,]+$/),
24
+ image: z.string(),
13
25
  });
14
26
  export const HouseSchema = z.object({
15
27
  id: z.string(),
16
28
  city: z.string(),
17
29
  price: z.string().regex(/^\d+$/).transform(Number),
18
30
  availabilityDate: z.string().datetime().optional(),
19
- propertyType: z.enum(['house', 'apartment', 'studio', 'shared-room']),
31
+ propertyType: z.enum(["house", "apartment", "studio", "shared-room"]),
20
32
  bedrooms: z.string().regex(/^\d+$/).transform(Number),
21
33
  roommates: z.string().regex(/^\d+$/).transform(Number),
22
- gender: z.enum(['m', 'f', 'any']).optional(),
23
- propertyGender: z.enum(['m', 'f', 'mixed']).optional(),
34
+ gender: z.enum(["m", "f", "any"]).optional(),
35
+ propertyGender: z.enum(["m", "f", "mixed"]).optional(),
24
36
  bathrooms: z.string().regex(/^\d+$/).transform(Number),
25
37
  furnished: z.boolean().optional(),
26
38
  image: z.string().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "house-types",
3
- "version": "1.0.11",
3
+ "version": "2.0.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -19,9 +19,6 @@
19
19
  "dependencies": {
20
20
  "zod": "^3.24.2"
21
21
  },
22
- "type": "module",
23
- "exports": {
24
- "import": "./esm/index.js",
25
- "require": "./cjs/index.cjs"
26
- }
22
+ "type": "module"
23
+
27
24
  }