house-types 2.4.0 → 2.5.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,23 +1,20 @@
1
1
  import { z } from "zod";
2
2
  export declare const AlertSchema: z.ZodObject<{
3
- id: z.ZodString;
4
3
  city: z.ZodString;
5
4
  maxPrice: z.ZodEffects<z.ZodString, number, string>;
6
- minBedrooms: z.ZodEffects<z.ZodString, number, string>;
5
+ minBedrooms: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
7
6
  furnishedOnly: z.ZodOptional<z.ZodBoolean>;
8
7
  propertyType: z.ZodOptional<z.ZodArray<z.ZodEnum<["house", "apartment", "studio", "shared-room"]>, "many">>;
9
8
  }, "strip", z.ZodTypeAny, {
10
- id: string;
11
9
  city: string;
12
10
  maxPrice: number;
13
- minBedrooms: number;
11
+ minBedrooms?: number | undefined;
14
12
  furnishedOnly?: boolean | undefined;
15
13
  propertyType?: ("house" | "apartment" | "studio" | "shared-room")[] | undefined;
16
14
  }, {
17
- id: string;
18
15
  city: string;
19
16
  maxPrice: string;
20
- minBedrooms: string;
17
+ minBedrooms?: string | undefined;
21
18
  furnishedOnly?: boolean | undefined;
22
19
  propertyType?: ("house" | "apartment" | "studio" | "shared-room")[] | undefined;
23
20
  }>;
@@ -27,54 +24,49 @@ export declare const UserSchema: z.ZodObject<{
27
24
  frequency: z.ZodEffects<z.ZodEnum<["5", "15", "60", "180", "360", "1440", "10080"]>, number, "5" | "15" | "60" | "180" | "360" | "1440" | "10080">;
28
25
  email: z.ZodString;
29
26
  lastNotified: z.ZodOptional<z.ZodString>;
30
- alerts: z.ZodDefault<z.ZodArray<z.ZodObject<{
31
- id: z.ZodString;
27
+ alert: z.ZodObject<{
32
28
  city: z.ZodString;
33
29
  maxPrice: z.ZodEffects<z.ZodString, number, string>;
34
- minBedrooms: z.ZodEffects<z.ZodString, number, string>;
30
+ minBedrooms: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
35
31
  furnishedOnly: z.ZodOptional<z.ZodBoolean>;
36
32
  propertyType: z.ZodOptional<z.ZodArray<z.ZodEnum<["house", "apartment", "studio", "shared-room"]>, "many">>;
37
33
  }, "strip", z.ZodTypeAny, {
38
- id: string;
39
34
  city: string;
40
35
  maxPrice: number;
41
- minBedrooms: number;
36
+ minBedrooms?: number | undefined;
42
37
  furnishedOnly?: boolean | undefined;
43
38
  propertyType?: ("house" | "apartment" | "studio" | "shared-room")[] | undefined;
44
39
  }, {
45
- id: string;
46
40
  city: string;
47
41
  maxPrice: string;
48
- minBedrooms: string;
42
+ minBedrooms?: string | undefined;
49
43
  furnishedOnly?: boolean | undefined;
50
44
  propertyType?: ("house" | "apartment" | "studio" | "shared-room")[] | undefined;
51
- }>, "many">>;
45
+ }>;
52
46
  }, "strip", z.ZodTypeAny, {
53
47
  notificationsEnabled: boolean;
54
48
  frequency: number;
55
49
  email: string;
56
- alerts: {
57
- id: string;
50
+ alert: {
58
51
  city: string;
59
52
  maxPrice: number;
60
- minBedrooms: number;
53
+ minBedrooms?: number | undefined;
61
54
  furnishedOnly?: boolean | undefined;
62
55
  propertyType?: ("house" | "apartment" | "studio" | "shared-room")[] | undefined;
63
- }[];
56
+ };
64
57
  lastNotified?: string | undefined;
65
58
  }, {
66
59
  frequency: "5" | "15" | "60" | "180" | "360" | "1440" | "10080";
67
60
  email: string;
68
- notificationsEnabled?: boolean | undefined;
69
- lastNotified?: string | undefined;
70
- alerts?: {
71
- id: string;
61
+ alert: {
72
62
  city: string;
73
63
  maxPrice: string;
74
- minBedrooms: string;
64
+ minBedrooms?: string | undefined;
75
65
  furnishedOnly?: boolean | undefined;
76
66
  propertyType?: ("house" | "apartment" | "studio" | "shared-room")[] | undefined;
77
- }[] | undefined;
67
+ };
68
+ notificationsEnabled?: boolean | undefined;
69
+ lastNotified?: string | undefined;
78
70
  }>;
79
71
  export type User = z.infer<typeof UserSchema>;
80
72
  export declare const RawHouseSchema: z.ZodObject<{
@@ -83,13 +75,13 @@ export declare const RawHouseSchema: z.ZodObject<{
83
75
  price: z.ZodEffects<z.ZodString, number, string>;
84
76
  image: z.ZodString;
85
77
  }, "strip", z.ZodTypeAny, {
86
- id: string;
87
78
  city: string;
79
+ id: string;
88
80
  price: number;
89
81
  image: string;
90
82
  }, {
91
- id: string;
92
83
  city: string;
84
+ id: string;
93
85
  price: string;
94
86
  image: string;
95
87
  }>;
@@ -109,9 +101,9 @@ export declare const HouseSchema: z.ZodObject<{
109
101
  image: z.ZodOptional<z.ZodString>;
110
102
  createdAt: z.ZodString;
111
103
  }, "strip", z.ZodTypeAny, {
112
- id: string;
113
104
  city: string;
114
105
  propertyType: "house" | "apartment" | "studio" | "shared-room";
106
+ id: string;
115
107
  price: number;
116
108
  bedrooms: number;
117
109
  roommates: number;
@@ -123,9 +115,9 @@ export declare const HouseSchema: z.ZodObject<{
123
115
  propertyGender?: "m" | "f" | "mixed" | undefined;
124
116
  furnished?: boolean | undefined;
125
117
  }, {
126
- id: string;
127
118
  city: string;
128
119
  propertyType: "house" | "apartment" | "studio" | "shared-room";
120
+ id: string;
129
121
  price: string;
130
122
  bedrooms: string;
131
123
  roommates: string;
@@ -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,WAAW;;;;;;;;;;;;;;;;;;;;;EAStB,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;AAExB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;EAQtB,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"}
package/dist/index.js CHANGED
@@ -1,9 +1,8 @@
1
1
  import { z } from "zod";
2
2
  export const AlertSchema = z.object({
3
- id: z.string(),
4
3
  city: z.string(),
5
4
  maxPrice: z.string().regex(/^\d+$/).transform(Number),
6
- minBedrooms: z.string().regex(/^\d+$/).transform(Number),
5
+ minBedrooms: z.string().regex(/^\d+$/).transform(Number).optional(),
7
6
  furnishedOnly: z.boolean().optional(),
8
7
  propertyType: z
9
8
  .array(z.enum(["house", "apartment", "studio", "shared-room"]))
@@ -16,7 +15,7 @@ export const UserSchema = z.object({
16
15
  .transform(Number),
17
16
  email: z.string().email(),
18
17
  lastNotified: z.string().datetime().optional(),
19
- alerts: z.array(AlertSchema).default([]),
18
+ alert: AlertSchema,
20
19
  });
21
20
  export const RawHouseSchema = z.object({
22
21
  id: z.string(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "house-types",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",