@homespot-sdk/validators 0.0.617 → 0.0.620

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.js CHANGED
@@ -1,29 +1,25 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.api = exports.schemas = void 0;
4
- exports.createApiClient = createApiClient;
5
- const core_1 = require("@zodios/core");
6
- const zod_1 = require("zod");
7
- const SocialMediaRequest = zod_1.z
1
+ import { makeApi, Zodios } from '@zodios/core';
2
+ import { z } from 'zod';
3
+ const SocialMediaRequest = z
8
4
  .object({
9
- type: zod_1.z.enum([
5
+ type: z.enum([
10
6
  'FACEBOOK',
11
7
  'YOUTUBE',
12
8
  'INSTAGRAM',
13
9
  'TIKTOK',
14
10
  'LINKEDIN',
15
11
  ]),
16
- url: zod_1.z.string().optional(),
12
+ url: z.string().optional(),
17
13
  })
18
14
  .passthrough();
19
- const SocialMediasRequest = zod_1.z
20
- .object({ data: zod_1.z.array(SocialMediaRequest).min(1).max(5) })
15
+ const SocialMediasRequest = z
16
+ .object({ data: z.array(SocialMediaRequest).min(1).max(5) })
21
17
  .passthrough();
22
- const RolesRequest = zod_1.z
18
+ const RolesRequest = z
23
19
  .object({
24
- name: zod_1.z.string().min(1),
25
- description: zod_1.z.string().min(1),
26
- authorities: zod_1.z.array(zod_1.z.enum([
20
+ name: z.string().min(1),
21
+ description: z.string().min(1),
22
+ authorities: z.array(z.enum([
27
23
  'properties_read',
28
24
  'properties_write',
29
25
  'agents_read',
@@ -31,65 +27,65 @@ const RolesRequest = zod_1.z
31
27
  ])),
32
28
  })
33
29
  .passthrough();
34
- const PhotoRequest = zod_1.z
30
+ const PhotoRequest = z
35
31
  .object({
36
- photo: zod_1.z.string().min(0).max(255),
37
- type: zod_1.z.enum(['JPEG', 'JPG', 'PNG', 'WEBP']),
38
- width: zod_1.z.number().int().gte(10).lte(11000),
39
- height: zod_1.z.number().int().gte(10).lte(11000).optional(),
32
+ photo: z.string().min(0).max(255),
33
+ type: z.enum(['JPEG', 'JPG', 'PNG', 'WEBP']),
34
+ width: z.number().int().gte(10).lte(11000),
35
+ height: z.number().int().gte(10).lte(11000).optional(),
40
36
  })
41
37
  .passthrough();
42
- const AddressRequest = zod_1.z
38
+ const AddressRequest = z
43
39
  .object({
44
- country: zod_1.z.string().min(0).max(100),
45
- city: zod_1.z.string().min(0).max(100),
46
- district: zod_1.z.string().min(0).max(100),
47
- subdistrict: zod_1.z.string().min(0).max(100),
48
- street: zod_1.z.string().min(0).max(255),
40
+ country: z.string().min(0).max(100),
41
+ city: z.string().min(0).max(100),
42
+ district: z.string().min(0).max(100),
43
+ subdistrict: z.string().min(0).max(100),
44
+ street: z.string().min(0).max(255),
49
45
  })
50
46
  .passthrough();
51
- const CreateAgencyRequest = zod_1.z
47
+ const CreateAgencyRequest = z
52
48
  .object({
53
- name: zod_1.z.string().min(1),
54
- email: zod_1.z.string().min(1).email(),
55
- seats: zod_1.z.number().int(),
56
- subDomain: zod_1.z.string().min(1),
57
- phone: zod_1.z.string().min(1),
49
+ name: z.string().min(1),
50
+ email: z.string().min(1).email(),
51
+ seats: z.number().int(),
52
+ subDomain: z.string().min(1),
53
+ phone: z.string().min(1),
58
54
  address: AddressRequest,
59
- yearSince: zod_1.z.number().int(),
55
+ yearSince: z.number().int(),
60
56
  })
61
57
  .passthrough();
62
- const InviteMemberRequest = zod_1.z
63
- .object({ emails: zod_1.z.array(zod_1.z.string()).min(1) })
58
+ const InviteMemberRequest = z
59
+ .object({ emails: z.array(z.string()).min(1) })
64
60
  .passthrough();
65
- const PresignedUrlResponse = zod_1.z
66
- .object({ originalName: zod_1.z.string(), key: zod_1.z.string(), url: zod_1.z.string() })
61
+ const PresignedUrlResponse = z
62
+ .object({ originalName: z.string(), key: z.string(), url: z.string() })
67
63
  .passthrough();
68
- const PresignedUrlsResponse = zod_1.z
69
- .object({ data: zod_1.z.array(PresignedUrlResponse) })
64
+ const PresignedUrlsResponse = z
65
+ .object({ data: z.array(PresignedUrlResponse) })
70
66
  .passthrough();
71
- const IdResponse = zod_1.z.object({ id: zod_1.z.string() }).passthrough();
72
- const UploadAcknowledgmentResponse = zod_1.z
73
- .object({ success: zod_1.z.array(zod_1.z.string()), fail: zod_1.z.array(zod_1.z.string()) })
67
+ const IdResponse = z.object({ id: z.string() }).passthrough();
68
+ const UploadAcknowledgmentResponse = z
69
+ .object({ success: z.array(z.string()), fail: z.array(z.string()) })
74
70
  .passthrough();
75
- const InvitationViewResponse = zod_1.z
71
+ const InvitationViewResponse = z
76
72
  .object({
77
- invitationId: zod_1.z.string().uuid(),
78
- email: zod_1.z.string(),
79
- status: zod_1.z.enum([
73
+ invitationId: z.string().uuid(),
74
+ email: z.string(),
75
+ status: z.enum([
80
76
  'PENDING',
81
77
  'ACCEPTED',
82
78
  'REJECTED',
83
79
  'CANCELLED',
84
80
  'EXPIRED',
85
81
  ]),
86
- createdAt: zod_1.z.string().datetime({ offset: true }),
87
- expiresAt: zod_1.z.string().datetime({ offset: true }),
88
- acceptedAt: zod_1.z.string().datetime({ offset: true }).optional(),
89
- acceptedBy: zod_1.z.string().optional(),
82
+ createdAt: z.string().datetime({ offset: true }),
83
+ expiresAt: z.string().datetime({ offset: true }),
84
+ acceptedAt: z.string().datetime({ offset: true }).optional(),
85
+ acceptedBy: z.string().optional(),
90
86
  })
91
87
  .passthrough();
92
- exports.schemas = {
88
+ export const schemas = {
93
89
  SocialMediaRequest,
94
90
  SocialMediasRequest,
95
91
  RolesRequest,
@@ -103,7 +99,7 @@ exports.schemas = {
103
99
  UploadAcknowledgmentResponse,
104
100
  InvitationViewResponse,
105
101
  };
106
- const endpoints = (0, core_1.makeApi)([
102
+ const endpoints = makeApi([
107
103
  {
108
104
  method: 'post',
109
105
  path: '/agency',
@@ -116,7 +112,7 @@ const endpoints = (0, core_1.makeApi)([
116
112
  schema: CreateAgencyRequest,
117
113
  },
118
114
  ],
119
- response: zod_1.z.void(),
115
+ response: z.void(),
120
116
  },
121
117
  {
122
118
  method: 'get',
@@ -127,10 +123,10 @@ const endpoints = (0, core_1.makeApi)([
127
123
  {
128
124
  name: 'agencyId',
129
125
  type: 'Path',
130
- schema: zod_1.z.string().uuid(),
126
+ schema: z.string().uuid(),
131
127
  },
132
128
  ],
133
- response: zod_1.z.void(),
129
+ response: z.void(),
134
130
  },
135
131
  {
136
132
  method: 'post',
@@ -141,10 +137,10 @@ const endpoints = (0, core_1.makeApi)([
141
137
  {
142
138
  name: 'agencyId',
143
139
  type: 'Path',
144
- schema: zod_1.z.string().uuid(),
140
+ schema: z.string().uuid(),
145
141
  },
146
142
  ],
147
- response: zod_1.z.void(),
143
+ response: z.void(),
148
144
  },
149
145
  {
150
146
  method: 'get',
@@ -155,10 +151,10 @@ const endpoints = (0, core_1.makeApi)([
155
151
  {
156
152
  name: 'agencyId',
157
153
  type: 'Path',
158
- schema: zod_1.z.string().uuid(),
154
+ schema: z.string().uuid(),
159
155
  },
160
156
  ],
161
- response: zod_1.z.void(),
157
+ response: z.void(),
162
158
  },
163
159
  {
164
160
  method: 'post',
@@ -174,10 +170,10 @@ const endpoints = (0, core_1.makeApi)([
174
170
  {
175
171
  name: 'agencyId',
176
172
  type: 'Path',
177
- schema: zod_1.z.string().uuid(),
173
+ schema: z.string().uuid(),
178
174
  },
179
175
  ],
180
- response: zod_1.z.void(),
176
+ response: z.void(),
181
177
  },
182
178
  {
183
179
  method: 'post',
@@ -188,15 +184,15 @@ const endpoints = (0, core_1.makeApi)([
188
184
  {
189
185
  name: 'agencyId',
190
186
  type: 'Path',
191
- schema: zod_1.z.string().uuid(),
187
+ schema: z.string().uuid(),
192
188
  },
193
189
  {
194
190
  name: 'invitationId',
195
191
  type: 'Path',
196
- schema: zod_1.z.string().uuid(),
192
+ schema: z.string().uuid(),
197
193
  },
198
194
  ],
199
- response: zod_1.z.void(),
195
+ response: z.void(),
200
196
  },
201
197
  {
202
198
  method: 'put',
@@ -212,10 +208,10 @@ const endpoints = (0, core_1.makeApi)([
212
208
  {
213
209
  name: 'agencyId',
214
210
  type: 'Path',
215
- schema: zod_1.z.string().uuid(),
211
+ schema: z.string().uuid(),
216
212
  },
217
213
  ],
218
- response: zod_1.z.void(),
214
+ response: z.void(),
219
215
  },
220
216
  {
221
217
  method: 'post',
@@ -231,10 +227,10 @@ const endpoints = (0, core_1.makeApi)([
231
227
  {
232
228
  name: 'agencyId',
233
229
  type: 'Path',
234
- schema: zod_1.z.string().uuid(),
230
+ schema: z.string().uuid(),
235
231
  },
236
232
  ],
237
- response: zod_1.z.void(),
233
+ response: z.void(),
238
234
  },
239
235
  {
240
236
  method: 'post',
@@ -250,10 +246,10 @@ const endpoints = (0, core_1.makeApi)([
250
246
  {
251
247
  name: 'agencyId',
252
248
  type: 'Path',
253
- schema: zod_1.z.string().uuid(),
249
+ schema: z.string().uuid(),
254
250
  },
255
251
  ],
256
- response: zod_1.z.void(),
252
+ response: z.void(),
257
253
  },
258
254
  {
259
255
  method: 'post',
@@ -269,10 +265,10 @@ const endpoints = (0, core_1.makeApi)([
269
265
  {
270
266
  name: 'agencyId',
271
267
  type: 'Path',
272
- schema: zod_1.z.string().uuid(),
268
+ schema: z.string().uuid(),
273
269
  },
274
270
  ],
275
- response: zod_1.z.void(),
271
+ response: z.void(),
276
272
  },
277
273
  {
278
274
  method: 'put',
@@ -288,15 +284,15 @@ const endpoints = (0, core_1.makeApi)([
288
284
  {
289
285
  name: 'agencyId',
290
286
  type: 'Path',
291
- schema: zod_1.z.string().uuid(),
287
+ schema: z.string().uuid(),
292
288
  },
293
289
  {
294
290
  name: 'roleId',
295
291
  type: 'Path',
296
- schema: zod_1.z.number().int(),
292
+ schema: z.number().int(),
297
293
  },
298
294
  ],
299
- response: zod_1.z.void(),
295
+ response: z.void(),
300
296
  },
301
297
  {
302
298
  method: 'delete',
@@ -307,15 +303,15 @@ const endpoints = (0, core_1.makeApi)([
307
303
  {
308
304
  name: 'agencyId',
309
305
  type: 'Path',
310
- schema: zod_1.z.string().uuid(),
306
+ schema: z.string().uuid(),
311
307
  },
312
308
  {
313
309
  name: 'roleId',
314
310
  type: 'Path',
315
- schema: zod_1.z.number().int(),
311
+ schema: z.number().int(),
316
312
  },
317
313
  ],
318
- response: zod_1.z.void(),
314
+ response: z.void(),
319
315
  },
320
316
  {
321
317
  method: 'put',
@@ -331,13 +327,13 @@ const endpoints = (0, core_1.makeApi)([
331
327
  {
332
328
  name: 'agencyId',
333
329
  type: 'Path',
334
- schema: zod_1.z.string().uuid(),
330
+ schema: z.string().uuid(),
335
331
  },
336
332
  ],
337
- response: zod_1.z.void(),
333
+ response: z.void(),
338
334
  },
339
335
  ]);
340
- exports.api = new core_1.Zodios(endpoints);
341
- function createApiClient(baseUrl, options) {
342
- return new core_1.Zodios(baseUrl, endpoints, options);
336
+ export const api = new Zodios(endpoints);
337
+ export function createApiClient(baseUrl, options) {
338
+ return new Zodios(baseUrl, endpoints, options);
343
339
  }
package/package.json CHANGED
@@ -1,8 +1,16 @@
1
1
  {
2
2
  "name": "@homespot-sdk/validators",
3
- "version": "0.0.617",
3
+ "version": "0.0.620",
4
+ "type": "module",
4
5
  "main": "dist/index.js",
5
6
  "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js",
11
+ "require": "./dist/index.js"
12
+ }
13
+ },
6
14
  "scripts": {
7
15
  "build": "tsc"
8
16
  },
@@ -14,6 +22,7 @@
14
22
  "@zodios/core": "^10.9.6"
15
23
  },
16
24
  "devDependencies": {
17
- "typescript": "^5.0.0"
25
+ "typescript": "^5.0.0",
26
+ "@types/node": "^20.0.0"
18
27
  }
19
28
  }
package/tsconfig.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "ES2019",
4
- "module": "CommonJS",
3
+ "target": "ESNext",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
5
6
  "declaration": true,
6
7
  "outDir": "./dist",
7
8
  "strict": true,
8
9
  "noImplicitAny": true,
9
10
  "skipLibCheck": true,
10
- "esModuleInterop": true
11
+ "esModuleInterop": true,
12
+ "lib": ["ESNext", "DOM"]
11
13
  },
12
14
  "include": ["src"]
13
15
  }