@ecomiq/core 0.1.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/README.md +42 -0
- package/dist/api.cjs +99 -0
- package/dist/api.cjs.map +1 -0
- package/dist/api.d.cts +52 -0
- package/dist/api.d.ts +52 -0
- package/dist/api.js +93 -0
- package/dist/api.js.map +1 -0
- package/dist/client.cjs +1344 -0
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.cts +82 -0
- package/dist/client.d.ts +82 -0
- package/dist/client.js +1341 -0
- package/dist/client.js.map +1 -0
- package/dist/index.cjs +1611 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1109 -0
- package/dist/index.d.ts +1109 -0
- package/dist/index.js +1450 -0
- package/dist/index.js.map +1 -0
- package/dist/models/collections.cjs +20 -0
- package/dist/models/collections.cjs.map +1 -0
- package/dist/models/collections.d.cts +56 -0
- package/dist/models/collections.d.ts +56 -0
- package/dist/models/collections.js +17 -0
- package/dist/models/collections.js.map +1 -0
- package/dist/models/geo.cjs +62 -0
- package/dist/models/geo.cjs.map +1 -0
- package/dist/models/geo.d.cts +279 -0
- package/dist/models/geo.d.ts +279 -0
- package/dist/models/geo.js +48 -0
- package/dist/models/geo.js.map +1 -0
- package/dist/models/products.cjs +212 -0
- package/dist/models/products.cjs.map +1 -0
- package/dist/models/products.d.cts +1421 -0
- package/dist/models/products.d.ts +1421 -0
- package/dist/models/products.js +187 -0
- package/dist/models/products.js.map +1 -0
- package/dist/models/search.cjs +200 -0
- package/dist/models/search.cjs.map +1 -0
- package/dist/models/search.d.cts +51 -0
- package/dist/models/search.d.ts +51 -0
- package/dist/models/search.js +196 -0
- package/dist/models/search.js.map +1 -0
- package/dist/models/settings.cjs +285 -0
- package/dist/models/settings.cjs.map +1 -0
- package/dist/models/settings.d.cts +7039 -0
- package/dist/models/settings.d.ts +7039 -0
- package/dist/models/settings.js +239 -0
- package/dist/models/settings.js.map +1 -0
- package/dist/models/storefront-cart.cjs +148 -0
- package/dist/models/storefront-cart.cjs.map +1 -0
- package/dist/models/storefront-cart.d.cts +747 -0
- package/dist/models/storefront-cart.d.ts +747 -0
- package/dist/models/storefront-cart.js +133 -0
- package/dist/models/storefront-cart.js.map +1 -0
- package/dist/models/storefront-checkout.cjs +307 -0
- package/dist/models/storefront-checkout.cjs.map +1 -0
- package/dist/models/storefront-checkout.d.cts +4122 -0
- package/dist/models/storefront-checkout.d.ts +4122 -0
- package/dist/models/storefront-checkout.js +288 -0
- package/dist/models/storefront-checkout.js.map +1 -0
- package/dist/models/storefront-reviews.cjs +223 -0
- package/dist/models/storefront-reviews.cjs.map +1 -0
- package/dist/models/storefront-reviews.d.cts +147 -0
- package/dist/models/storefront-reviews.d.ts +147 -0
- package/dist/models/storefront-reviews.js +218 -0
- package/dist/models/storefront-reviews.js.map +1 -0
- package/package.json +109 -0
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/** País ISO 3166-1 alpha-2 (`GET /v1/geo/countries`). */
|
|
4
|
+
declare const CountrySchema: z.ZodObject<{
|
|
5
|
+
code: z.ZodString;
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
}, "strict", z.ZodTypeAny, {
|
|
8
|
+
code: string;
|
|
9
|
+
name: string;
|
|
10
|
+
}, {
|
|
11
|
+
code: string;
|
|
12
|
+
name: string;
|
|
13
|
+
}>;
|
|
14
|
+
type Country = z.infer<typeof CountrySchema>;
|
|
15
|
+
declare const CountriesSchema: z.ZodArray<z.ZodObject<{
|
|
16
|
+
code: z.ZodString;
|
|
17
|
+
name: z.ZodString;
|
|
18
|
+
}, "strict", z.ZodTypeAny, {
|
|
19
|
+
code: string;
|
|
20
|
+
name: string;
|
|
21
|
+
}, {
|
|
22
|
+
code: string;
|
|
23
|
+
name: string;
|
|
24
|
+
}>, "many">;
|
|
25
|
+
type Countries = z.infer<typeof CountriesSchema>;
|
|
26
|
+
/** Nivel administrativo geo (`level1` = departamento, etc.). */
|
|
27
|
+
declare const GeoDivisionTypeSchema: z.ZodEnum<["level1", "level2", "level3"]>;
|
|
28
|
+
type GeoDivisionType = z.infer<typeof GeoDivisionTypeSchema>;
|
|
29
|
+
/** División administrativa (`GET /v1/geo/departments`, …). */
|
|
30
|
+
declare const GeoDivisionSchema: z.ZodObject<{
|
|
31
|
+
id: z.ZodString;
|
|
32
|
+
countryCode: z.ZodString;
|
|
33
|
+
type: z.ZodEnum<["level1", "level2", "level3"]>;
|
|
34
|
+
code: z.ZodString;
|
|
35
|
+
name: z.ZodString;
|
|
36
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
37
|
+
source: z.ZodString;
|
|
38
|
+
}, "strict", z.ZodTypeAny, {
|
|
39
|
+
code: string;
|
|
40
|
+
type: "level1" | "level2" | "level3";
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
countryCode: string;
|
|
44
|
+
parentId: string | null;
|
|
45
|
+
source: string;
|
|
46
|
+
}, {
|
|
47
|
+
code: string;
|
|
48
|
+
type: "level1" | "level2" | "level3";
|
|
49
|
+
id: string;
|
|
50
|
+
name: string;
|
|
51
|
+
countryCode: string;
|
|
52
|
+
parentId: string | null;
|
|
53
|
+
source: string;
|
|
54
|
+
}>;
|
|
55
|
+
type GeoDivision = z.infer<typeof GeoDivisionSchema>;
|
|
56
|
+
/** Alias de departamento (level1). */
|
|
57
|
+
declare const DepartmentSchema: z.ZodObject<{
|
|
58
|
+
id: z.ZodString;
|
|
59
|
+
countryCode: z.ZodString;
|
|
60
|
+
type: z.ZodEnum<["level1", "level2", "level3"]>;
|
|
61
|
+
code: z.ZodString;
|
|
62
|
+
name: z.ZodString;
|
|
63
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
64
|
+
source: z.ZodString;
|
|
65
|
+
}, "strict", z.ZodTypeAny, {
|
|
66
|
+
code: string;
|
|
67
|
+
type: "level1" | "level2" | "level3";
|
|
68
|
+
id: string;
|
|
69
|
+
name: string;
|
|
70
|
+
countryCode: string;
|
|
71
|
+
parentId: string | null;
|
|
72
|
+
source: string;
|
|
73
|
+
}, {
|
|
74
|
+
code: string;
|
|
75
|
+
type: "level1" | "level2" | "level3";
|
|
76
|
+
id: string;
|
|
77
|
+
name: string;
|
|
78
|
+
countryCode: string;
|
|
79
|
+
parentId: string | null;
|
|
80
|
+
source: string;
|
|
81
|
+
}>;
|
|
82
|
+
type Department = GeoDivision;
|
|
83
|
+
declare const DepartmentsSchema: z.ZodArray<z.ZodObject<{
|
|
84
|
+
id: z.ZodString;
|
|
85
|
+
countryCode: z.ZodString;
|
|
86
|
+
type: z.ZodEnum<["level1", "level2", "level3"]>;
|
|
87
|
+
code: z.ZodString;
|
|
88
|
+
name: z.ZodString;
|
|
89
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
90
|
+
source: z.ZodString;
|
|
91
|
+
}, "strict", z.ZodTypeAny, {
|
|
92
|
+
code: string;
|
|
93
|
+
type: "level1" | "level2" | "level3";
|
|
94
|
+
id: string;
|
|
95
|
+
name: string;
|
|
96
|
+
countryCode: string;
|
|
97
|
+
parentId: string | null;
|
|
98
|
+
source: string;
|
|
99
|
+
}, {
|
|
100
|
+
code: string;
|
|
101
|
+
type: "level1" | "level2" | "level3";
|
|
102
|
+
id: string;
|
|
103
|
+
name: string;
|
|
104
|
+
countryCode: string;
|
|
105
|
+
parentId: string | null;
|
|
106
|
+
source: string;
|
|
107
|
+
}>, "many">;
|
|
108
|
+
type Departments = z.infer<typeof DepartmentsSchema>;
|
|
109
|
+
/** Query de `GET /v1/geo/departments`. */
|
|
110
|
+
declare const GetDepartmentsParamsSchema: z.ZodObject<{
|
|
111
|
+
countryCode: z.ZodString;
|
|
112
|
+
source: z.ZodDefault<z.ZodString>;
|
|
113
|
+
search: z.ZodDefault<z.ZodString>;
|
|
114
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
search: string;
|
|
117
|
+
limit: number;
|
|
118
|
+
countryCode: string;
|
|
119
|
+
source: string;
|
|
120
|
+
}, {
|
|
121
|
+
countryCode: string;
|
|
122
|
+
search?: string | undefined;
|
|
123
|
+
limit?: number | undefined;
|
|
124
|
+
source?: string | undefined;
|
|
125
|
+
}>;
|
|
126
|
+
type GetDepartmentsParams = z.input<typeof GetDepartmentsParamsSchema>;
|
|
127
|
+
type GetDepartmentsParamsParsed = z.output<typeof GetDepartmentsParamsSchema>;
|
|
128
|
+
/** Alias de provincia (level2). */
|
|
129
|
+
declare const ProvinceSchema: z.ZodObject<{
|
|
130
|
+
id: z.ZodString;
|
|
131
|
+
countryCode: z.ZodString;
|
|
132
|
+
type: z.ZodEnum<["level1", "level2", "level3"]>;
|
|
133
|
+
code: z.ZodString;
|
|
134
|
+
name: z.ZodString;
|
|
135
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
136
|
+
source: z.ZodString;
|
|
137
|
+
}, "strict", z.ZodTypeAny, {
|
|
138
|
+
code: string;
|
|
139
|
+
type: "level1" | "level2" | "level3";
|
|
140
|
+
id: string;
|
|
141
|
+
name: string;
|
|
142
|
+
countryCode: string;
|
|
143
|
+
parentId: string | null;
|
|
144
|
+
source: string;
|
|
145
|
+
}, {
|
|
146
|
+
code: string;
|
|
147
|
+
type: "level1" | "level2" | "level3";
|
|
148
|
+
id: string;
|
|
149
|
+
name: string;
|
|
150
|
+
countryCode: string;
|
|
151
|
+
parentId: string | null;
|
|
152
|
+
source: string;
|
|
153
|
+
}>;
|
|
154
|
+
type Province = GeoDivision;
|
|
155
|
+
declare const ProvincesSchema: z.ZodArray<z.ZodObject<{
|
|
156
|
+
id: z.ZodString;
|
|
157
|
+
countryCode: z.ZodString;
|
|
158
|
+
type: z.ZodEnum<["level1", "level2", "level3"]>;
|
|
159
|
+
code: z.ZodString;
|
|
160
|
+
name: z.ZodString;
|
|
161
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
162
|
+
source: z.ZodString;
|
|
163
|
+
}, "strict", z.ZodTypeAny, {
|
|
164
|
+
code: string;
|
|
165
|
+
type: "level1" | "level2" | "level3";
|
|
166
|
+
id: string;
|
|
167
|
+
name: string;
|
|
168
|
+
countryCode: string;
|
|
169
|
+
parentId: string | null;
|
|
170
|
+
source: string;
|
|
171
|
+
}, {
|
|
172
|
+
code: string;
|
|
173
|
+
type: "level1" | "level2" | "level3";
|
|
174
|
+
id: string;
|
|
175
|
+
name: string;
|
|
176
|
+
countryCode: string;
|
|
177
|
+
parentId: string | null;
|
|
178
|
+
source: string;
|
|
179
|
+
}>, "many">;
|
|
180
|
+
type Provinces = z.infer<typeof ProvincesSchema>;
|
|
181
|
+
/** Query de `GET /v1/geo/provinces`. */
|
|
182
|
+
declare const GetProvincesParamsSchema: z.ZodObject<{
|
|
183
|
+
countryCode: z.ZodString;
|
|
184
|
+
departmentCode: z.ZodString;
|
|
185
|
+
source: z.ZodDefault<z.ZodString>;
|
|
186
|
+
search: z.ZodDefault<z.ZodString>;
|
|
187
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
188
|
+
}, "strip", z.ZodTypeAny, {
|
|
189
|
+
search: string;
|
|
190
|
+
limit: number;
|
|
191
|
+
countryCode: string;
|
|
192
|
+
departmentCode: string;
|
|
193
|
+
source: string;
|
|
194
|
+
}, {
|
|
195
|
+
countryCode: string;
|
|
196
|
+
departmentCode: string;
|
|
197
|
+
search?: string | undefined;
|
|
198
|
+
limit?: number | undefined;
|
|
199
|
+
source?: string | undefined;
|
|
200
|
+
}>;
|
|
201
|
+
type GetProvincesParams = z.input<typeof GetProvincesParamsSchema>;
|
|
202
|
+
type GetProvincesParamsParsed = z.output<typeof GetProvincesParamsSchema>;
|
|
203
|
+
/** Alias de distrito (level3). */
|
|
204
|
+
declare const DistrictSchema: z.ZodObject<{
|
|
205
|
+
id: z.ZodString;
|
|
206
|
+
countryCode: z.ZodString;
|
|
207
|
+
type: z.ZodEnum<["level1", "level2", "level3"]>;
|
|
208
|
+
code: z.ZodString;
|
|
209
|
+
name: z.ZodString;
|
|
210
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
211
|
+
source: z.ZodString;
|
|
212
|
+
}, "strict", z.ZodTypeAny, {
|
|
213
|
+
code: string;
|
|
214
|
+
type: "level1" | "level2" | "level3";
|
|
215
|
+
id: string;
|
|
216
|
+
name: string;
|
|
217
|
+
countryCode: string;
|
|
218
|
+
parentId: string | null;
|
|
219
|
+
source: string;
|
|
220
|
+
}, {
|
|
221
|
+
code: string;
|
|
222
|
+
type: "level1" | "level2" | "level3";
|
|
223
|
+
id: string;
|
|
224
|
+
name: string;
|
|
225
|
+
countryCode: string;
|
|
226
|
+
parentId: string | null;
|
|
227
|
+
source: string;
|
|
228
|
+
}>;
|
|
229
|
+
type District = GeoDivision;
|
|
230
|
+
declare const DistrictsSchema: z.ZodArray<z.ZodObject<{
|
|
231
|
+
id: z.ZodString;
|
|
232
|
+
countryCode: z.ZodString;
|
|
233
|
+
type: z.ZodEnum<["level1", "level2", "level3"]>;
|
|
234
|
+
code: z.ZodString;
|
|
235
|
+
name: z.ZodString;
|
|
236
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
237
|
+
source: z.ZodString;
|
|
238
|
+
}, "strict", z.ZodTypeAny, {
|
|
239
|
+
code: string;
|
|
240
|
+
type: "level1" | "level2" | "level3";
|
|
241
|
+
id: string;
|
|
242
|
+
name: string;
|
|
243
|
+
countryCode: string;
|
|
244
|
+
parentId: string | null;
|
|
245
|
+
source: string;
|
|
246
|
+
}, {
|
|
247
|
+
code: string;
|
|
248
|
+
type: "level1" | "level2" | "level3";
|
|
249
|
+
id: string;
|
|
250
|
+
name: string;
|
|
251
|
+
countryCode: string;
|
|
252
|
+
parentId: string | null;
|
|
253
|
+
source: string;
|
|
254
|
+
}>, "many">;
|
|
255
|
+
type Districts = z.infer<typeof DistrictsSchema>;
|
|
256
|
+
/** Query de `GET /v1/geo/districts`. */
|
|
257
|
+
declare const GetDistrictsParamsSchema: z.ZodObject<{
|
|
258
|
+
countryCode: z.ZodString;
|
|
259
|
+
provinceCode: z.ZodString;
|
|
260
|
+
source: z.ZodDefault<z.ZodString>;
|
|
261
|
+
search: z.ZodDefault<z.ZodString>;
|
|
262
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
263
|
+
}, "strip", z.ZodTypeAny, {
|
|
264
|
+
search: string;
|
|
265
|
+
limit: number;
|
|
266
|
+
countryCode: string;
|
|
267
|
+
provinceCode: string;
|
|
268
|
+
source: string;
|
|
269
|
+
}, {
|
|
270
|
+
countryCode: string;
|
|
271
|
+
provinceCode: string;
|
|
272
|
+
search?: string | undefined;
|
|
273
|
+
limit?: number | undefined;
|
|
274
|
+
source?: string | undefined;
|
|
275
|
+
}>;
|
|
276
|
+
type GetDistrictsParams = z.input<typeof GetDistrictsParamsSchema>;
|
|
277
|
+
type GetDistrictsParamsParsed = z.output<typeof GetDistrictsParamsSchema>;
|
|
278
|
+
|
|
279
|
+
export { type Countries, CountriesSchema, type Country, CountrySchema, type Department, DepartmentSchema, type Departments, DepartmentsSchema, type District, DistrictSchema, type Districts, DistrictsSchema, type GeoDivision, GeoDivisionSchema, type GeoDivisionType, GeoDivisionTypeSchema, type GetDepartmentsParams, type GetDepartmentsParamsParsed, GetDepartmentsParamsSchema, type GetDistrictsParams, type GetDistrictsParamsParsed, GetDistrictsParamsSchema, type GetProvincesParams, type GetProvincesParamsParsed, GetProvincesParamsSchema, type Province, ProvinceSchema, type Provinces, ProvincesSchema };
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/** País ISO 3166-1 alpha-2 (`GET /v1/geo/countries`). */
|
|
4
|
+
declare const CountrySchema: z.ZodObject<{
|
|
5
|
+
code: z.ZodString;
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
}, "strict", z.ZodTypeAny, {
|
|
8
|
+
code: string;
|
|
9
|
+
name: string;
|
|
10
|
+
}, {
|
|
11
|
+
code: string;
|
|
12
|
+
name: string;
|
|
13
|
+
}>;
|
|
14
|
+
type Country = z.infer<typeof CountrySchema>;
|
|
15
|
+
declare const CountriesSchema: z.ZodArray<z.ZodObject<{
|
|
16
|
+
code: z.ZodString;
|
|
17
|
+
name: z.ZodString;
|
|
18
|
+
}, "strict", z.ZodTypeAny, {
|
|
19
|
+
code: string;
|
|
20
|
+
name: string;
|
|
21
|
+
}, {
|
|
22
|
+
code: string;
|
|
23
|
+
name: string;
|
|
24
|
+
}>, "many">;
|
|
25
|
+
type Countries = z.infer<typeof CountriesSchema>;
|
|
26
|
+
/** Nivel administrativo geo (`level1` = departamento, etc.). */
|
|
27
|
+
declare const GeoDivisionTypeSchema: z.ZodEnum<["level1", "level2", "level3"]>;
|
|
28
|
+
type GeoDivisionType = z.infer<typeof GeoDivisionTypeSchema>;
|
|
29
|
+
/** División administrativa (`GET /v1/geo/departments`, …). */
|
|
30
|
+
declare const GeoDivisionSchema: z.ZodObject<{
|
|
31
|
+
id: z.ZodString;
|
|
32
|
+
countryCode: z.ZodString;
|
|
33
|
+
type: z.ZodEnum<["level1", "level2", "level3"]>;
|
|
34
|
+
code: z.ZodString;
|
|
35
|
+
name: z.ZodString;
|
|
36
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
37
|
+
source: z.ZodString;
|
|
38
|
+
}, "strict", z.ZodTypeAny, {
|
|
39
|
+
code: string;
|
|
40
|
+
type: "level1" | "level2" | "level3";
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
countryCode: string;
|
|
44
|
+
parentId: string | null;
|
|
45
|
+
source: string;
|
|
46
|
+
}, {
|
|
47
|
+
code: string;
|
|
48
|
+
type: "level1" | "level2" | "level3";
|
|
49
|
+
id: string;
|
|
50
|
+
name: string;
|
|
51
|
+
countryCode: string;
|
|
52
|
+
parentId: string | null;
|
|
53
|
+
source: string;
|
|
54
|
+
}>;
|
|
55
|
+
type GeoDivision = z.infer<typeof GeoDivisionSchema>;
|
|
56
|
+
/** Alias de departamento (level1). */
|
|
57
|
+
declare const DepartmentSchema: z.ZodObject<{
|
|
58
|
+
id: z.ZodString;
|
|
59
|
+
countryCode: z.ZodString;
|
|
60
|
+
type: z.ZodEnum<["level1", "level2", "level3"]>;
|
|
61
|
+
code: z.ZodString;
|
|
62
|
+
name: z.ZodString;
|
|
63
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
64
|
+
source: z.ZodString;
|
|
65
|
+
}, "strict", z.ZodTypeAny, {
|
|
66
|
+
code: string;
|
|
67
|
+
type: "level1" | "level2" | "level3";
|
|
68
|
+
id: string;
|
|
69
|
+
name: string;
|
|
70
|
+
countryCode: string;
|
|
71
|
+
parentId: string | null;
|
|
72
|
+
source: string;
|
|
73
|
+
}, {
|
|
74
|
+
code: string;
|
|
75
|
+
type: "level1" | "level2" | "level3";
|
|
76
|
+
id: string;
|
|
77
|
+
name: string;
|
|
78
|
+
countryCode: string;
|
|
79
|
+
parentId: string | null;
|
|
80
|
+
source: string;
|
|
81
|
+
}>;
|
|
82
|
+
type Department = GeoDivision;
|
|
83
|
+
declare const DepartmentsSchema: z.ZodArray<z.ZodObject<{
|
|
84
|
+
id: z.ZodString;
|
|
85
|
+
countryCode: z.ZodString;
|
|
86
|
+
type: z.ZodEnum<["level1", "level2", "level3"]>;
|
|
87
|
+
code: z.ZodString;
|
|
88
|
+
name: z.ZodString;
|
|
89
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
90
|
+
source: z.ZodString;
|
|
91
|
+
}, "strict", z.ZodTypeAny, {
|
|
92
|
+
code: string;
|
|
93
|
+
type: "level1" | "level2" | "level3";
|
|
94
|
+
id: string;
|
|
95
|
+
name: string;
|
|
96
|
+
countryCode: string;
|
|
97
|
+
parentId: string | null;
|
|
98
|
+
source: string;
|
|
99
|
+
}, {
|
|
100
|
+
code: string;
|
|
101
|
+
type: "level1" | "level2" | "level3";
|
|
102
|
+
id: string;
|
|
103
|
+
name: string;
|
|
104
|
+
countryCode: string;
|
|
105
|
+
parentId: string | null;
|
|
106
|
+
source: string;
|
|
107
|
+
}>, "many">;
|
|
108
|
+
type Departments = z.infer<typeof DepartmentsSchema>;
|
|
109
|
+
/** Query de `GET /v1/geo/departments`. */
|
|
110
|
+
declare const GetDepartmentsParamsSchema: z.ZodObject<{
|
|
111
|
+
countryCode: z.ZodString;
|
|
112
|
+
source: z.ZodDefault<z.ZodString>;
|
|
113
|
+
search: z.ZodDefault<z.ZodString>;
|
|
114
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
search: string;
|
|
117
|
+
limit: number;
|
|
118
|
+
countryCode: string;
|
|
119
|
+
source: string;
|
|
120
|
+
}, {
|
|
121
|
+
countryCode: string;
|
|
122
|
+
search?: string | undefined;
|
|
123
|
+
limit?: number | undefined;
|
|
124
|
+
source?: string | undefined;
|
|
125
|
+
}>;
|
|
126
|
+
type GetDepartmentsParams = z.input<typeof GetDepartmentsParamsSchema>;
|
|
127
|
+
type GetDepartmentsParamsParsed = z.output<typeof GetDepartmentsParamsSchema>;
|
|
128
|
+
/** Alias de provincia (level2). */
|
|
129
|
+
declare const ProvinceSchema: z.ZodObject<{
|
|
130
|
+
id: z.ZodString;
|
|
131
|
+
countryCode: z.ZodString;
|
|
132
|
+
type: z.ZodEnum<["level1", "level2", "level3"]>;
|
|
133
|
+
code: z.ZodString;
|
|
134
|
+
name: z.ZodString;
|
|
135
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
136
|
+
source: z.ZodString;
|
|
137
|
+
}, "strict", z.ZodTypeAny, {
|
|
138
|
+
code: string;
|
|
139
|
+
type: "level1" | "level2" | "level3";
|
|
140
|
+
id: string;
|
|
141
|
+
name: string;
|
|
142
|
+
countryCode: string;
|
|
143
|
+
parentId: string | null;
|
|
144
|
+
source: string;
|
|
145
|
+
}, {
|
|
146
|
+
code: string;
|
|
147
|
+
type: "level1" | "level2" | "level3";
|
|
148
|
+
id: string;
|
|
149
|
+
name: string;
|
|
150
|
+
countryCode: string;
|
|
151
|
+
parentId: string | null;
|
|
152
|
+
source: string;
|
|
153
|
+
}>;
|
|
154
|
+
type Province = GeoDivision;
|
|
155
|
+
declare const ProvincesSchema: z.ZodArray<z.ZodObject<{
|
|
156
|
+
id: z.ZodString;
|
|
157
|
+
countryCode: z.ZodString;
|
|
158
|
+
type: z.ZodEnum<["level1", "level2", "level3"]>;
|
|
159
|
+
code: z.ZodString;
|
|
160
|
+
name: z.ZodString;
|
|
161
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
162
|
+
source: z.ZodString;
|
|
163
|
+
}, "strict", z.ZodTypeAny, {
|
|
164
|
+
code: string;
|
|
165
|
+
type: "level1" | "level2" | "level3";
|
|
166
|
+
id: string;
|
|
167
|
+
name: string;
|
|
168
|
+
countryCode: string;
|
|
169
|
+
parentId: string | null;
|
|
170
|
+
source: string;
|
|
171
|
+
}, {
|
|
172
|
+
code: string;
|
|
173
|
+
type: "level1" | "level2" | "level3";
|
|
174
|
+
id: string;
|
|
175
|
+
name: string;
|
|
176
|
+
countryCode: string;
|
|
177
|
+
parentId: string | null;
|
|
178
|
+
source: string;
|
|
179
|
+
}>, "many">;
|
|
180
|
+
type Provinces = z.infer<typeof ProvincesSchema>;
|
|
181
|
+
/** Query de `GET /v1/geo/provinces`. */
|
|
182
|
+
declare const GetProvincesParamsSchema: z.ZodObject<{
|
|
183
|
+
countryCode: z.ZodString;
|
|
184
|
+
departmentCode: z.ZodString;
|
|
185
|
+
source: z.ZodDefault<z.ZodString>;
|
|
186
|
+
search: z.ZodDefault<z.ZodString>;
|
|
187
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
188
|
+
}, "strip", z.ZodTypeAny, {
|
|
189
|
+
search: string;
|
|
190
|
+
limit: number;
|
|
191
|
+
countryCode: string;
|
|
192
|
+
departmentCode: string;
|
|
193
|
+
source: string;
|
|
194
|
+
}, {
|
|
195
|
+
countryCode: string;
|
|
196
|
+
departmentCode: string;
|
|
197
|
+
search?: string | undefined;
|
|
198
|
+
limit?: number | undefined;
|
|
199
|
+
source?: string | undefined;
|
|
200
|
+
}>;
|
|
201
|
+
type GetProvincesParams = z.input<typeof GetProvincesParamsSchema>;
|
|
202
|
+
type GetProvincesParamsParsed = z.output<typeof GetProvincesParamsSchema>;
|
|
203
|
+
/** Alias de distrito (level3). */
|
|
204
|
+
declare const DistrictSchema: z.ZodObject<{
|
|
205
|
+
id: z.ZodString;
|
|
206
|
+
countryCode: z.ZodString;
|
|
207
|
+
type: z.ZodEnum<["level1", "level2", "level3"]>;
|
|
208
|
+
code: z.ZodString;
|
|
209
|
+
name: z.ZodString;
|
|
210
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
211
|
+
source: z.ZodString;
|
|
212
|
+
}, "strict", z.ZodTypeAny, {
|
|
213
|
+
code: string;
|
|
214
|
+
type: "level1" | "level2" | "level3";
|
|
215
|
+
id: string;
|
|
216
|
+
name: string;
|
|
217
|
+
countryCode: string;
|
|
218
|
+
parentId: string | null;
|
|
219
|
+
source: string;
|
|
220
|
+
}, {
|
|
221
|
+
code: string;
|
|
222
|
+
type: "level1" | "level2" | "level3";
|
|
223
|
+
id: string;
|
|
224
|
+
name: string;
|
|
225
|
+
countryCode: string;
|
|
226
|
+
parentId: string | null;
|
|
227
|
+
source: string;
|
|
228
|
+
}>;
|
|
229
|
+
type District = GeoDivision;
|
|
230
|
+
declare const DistrictsSchema: z.ZodArray<z.ZodObject<{
|
|
231
|
+
id: z.ZodString;
|
|
232
|
+
countryCode: z.ZodString;
|
|
233
|
+
type: z.ZodEnum<["level1", "level2", "level3"]>;
|
|
234
|
+
code: z.ZodString;
|
|
235
|
+
name: z.ZodString;
|
|
236
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
237
|
+
source: z.ZodString;
|
|
238
|
+
}, "strict", z.ZodTypeAny, {
|
|
239
|
+
code: string;
|
|
240
|
+
type: "level1" | "level2" | "level3";
|
|
241
|
+
id: string;
|
|
242
|
+
name: string;
|
|
243
|
+
countryCode: string;
|
|
244
|
+
parentId: string | null;
|
|
245
|
+
source: string;
|
|
246
|
+
}, {
|
|
247
|
+
code: string;
|
|
248
|
+
type: "level1" | "level2" | "level3";
|
|
249
|
+
id: string;
|
|
250
|
+
name: string;
|
|
251
|
+
countryCode: string;
|
|
252
|
+
parentId: string | null;
|
|
253
|
+
source: string;
|
|
254
|
+
}>, "many">;
|
|
255
|
+
type Districts = z.infer<typeof DistrictsSchema>;
|
|
256
|
+
/** Query de `GET /v1/geo/districts`. */
|
|
257
|
+
declare const GetDistrictsParamsSchema: z.ZodObject<{
|
|
258
|
+
countryCode: z.ZodString;
|
|
259
|
+
provinceCode: z.ZodString;
|
|
260
|
+
source: z.ZodDefault<z.ZodString>;
|
|
261
|
+
search: z.ZodDefault<z.ZodString>;
|
|
262
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
263
|
+
}, "strip", z.ZodTypeAny, {
|
|
264
|
+
search: string;
|
|
265
|
+
limit: number;
|
|
266
|
+
countryCode: string;
|
|
267
|
+
provinceCode: string;
|
|
268
|
+
source: string;
|
|
269
|
+
}, {
|
|
270
|
+
countryCode: string;
|
|
271
|
+
provinceCode: string;
|
|
272
|
+
search?: string | undefined;
|
|
273
|
+
limit?: number | undefined;
|
|
274
|
+
source?: string | undefined;
|
|
275
|
+
}>;
|
|
276
|
+
type GetDistrictsParams = z.input<typeof GetDistrictsParamsSchema>;
|
|
277
|
+
type GetDistrictsParamsParsed = z.output<typeof GetDistrictsParamsSchema>;
|
|
278
|
+
|
|
279
|
+
export { type Countries, CountriesSchema, type Country, CountrySchema, type Department, DepartmentSchema, type Departments, DepartmentsSchema, type District, DistrictSchema, type Districts, DistrictsSchema, type GeoDivision, GeoDivisionSchema, type GeoDivisionType, GeoDivisionTypeSchema, type GetDepartmentsParams, type GetDepartmentsParamsParsed, GetDepartmentsParamsSchema, type GetDistrictsParams, type GetDistrictsParamsParsed, GetDistrictsParamsSchema, type GetProvincesParams, type GetProvincesParamsParsed, GetProvincesParamsSchema, type Province, ProvinceSchema, type Provinces, ProvincesSchema };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// src/models/geo.ts
|
|
4
|
+
var CountrySchema = z.object({
|
|
5
|
+
code: z.string().length(2),
|
|
6
|
+
name: z.string().min(1)
|
|
7
|
+
}).strict();
|
|
8
|
+
var CountriesSchema = z.array(CountrySchema);
|
|
9
|
+
var GeoDivisionTypeSchema = z.enum(["level1", "level2", "level3"]);
|
|
10
|
+
var GeoDivisionSchema = z.object({
|
|
11
|
+
id: z.string().uuid(),
|
|
12
|
+
countryCode: z.string().length(2),
|
|
13
|
+
type: GeoDivisionTypeSchema,
|
|
14
|
+
code: z.string().min(1),
|
|
15
|
+
name: z.string().min(1),
|
|
16
|
+
parentId: z.string().uuid().nullable(),
|
|
17
|
+
source: z.string().min(1)
|
|
18
|
+
}).strict();
|
|
19
|
+
var DepartmentSchema = GeoDivisionSchema;
|
|
20
|
+
var DepartmentsSchema = z.array(DepartmentSchema);
|
|
21
|
+
var GetDepartmentsParamsSchema = z.object({
|
|
22
|
+
countryCode: z.string().length(2),
|
|
23
|
+
source: z.string().min(1).default("inei"),
|
|
24
|
+
search: z.string().default(""),
|
|
25
|
+
limit: z.number().int().positive().max(500).default(200)
|
|
26
|
+
});
|
|
27
|
+
var ProvinceSchema = GeoDivisionSchema;
|
|
28
|
+
var ProvincesSchema = z.array(ProvinceSchema);
|
|
29
|
+
var GetProvincesParamsSchema = z.object({
|
|
30
|
+
countryCode: z.string().length(2),
|
|
31
|
+
departmentCode: z.string().min(1),
|
|
32
|
+
source: z.string().min(1).default("inei"),
|
|
33
|
+
search: z.string().default(""),
|
|
34
|
+
limit: z.number().int().positive().max(500).default(200)
|
|
35
|
+
});
|
|
36
|
+
var DistrictSchema = GeoDivisionSchema;
|
|
37
|
+
var DistrictsSchema = z.array(DistrictSchema);
|
|
38
|
+
var GetDistrictsParamsSchema = z.object({
|
|
39
|
+
countryCode: z.string().length(2),
|
|
40
|
+
provinceCode: z.string().min(1),
|
|
41
|
+
source: z.string().min(1).default("inei"),
|
|
42
|
+
search: z.string().default(""),
|
|
43
|
+
limit: z.number().int().positive().max(500).default(200)
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export { CountriesSchema, CountrySchema, DepartmentSchema, DepartmentsSchema, DistrictSchema, DistrictsSchema, GeoDivisionSchema, GeoDivisionTypeSchema, GetDepartmentsParamsSchema, GetDistrictsParamsSchema, GetProvincesParamsSchema, ProvinceSchema, ProvincesSchema };
|
|
47
|
+
//# sourceMappingURL=geo.js.map
|
|
48
|
+
//# sourceMappingURL=geo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/models/geo.ts"],"names":[],"mappings":"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","file":"geo.js","sourcesContent":["import { z } from 'zod'\n\n/** País ISO 3166-1 alpha-2 (`GET /v1/geo/countries`). */\nexport const CountrySchema = z\n .object({\n code: z.string().length(2),\n name: z.string().min(1),\n })\n .strict()\n\nexport type Country = z.infer<typeof CountrySchema>\n\nexport const CountriesSchema = z.array(CountrySchema)\n\nexport type Countries = z.infer<typeof CountriesSchema>\n\n/** Nivel administrativo geo (`level1` = departamento, etc.). */\nexport const GeoDivisionTypeSchema = z.enum(['level1', 'level2', 'level3'])\n\nexport type GeoDivisionType = z.infer<typeof GeoDivisionTypeSchema>\n\n/** División administrativa (`GET /v1/geo/departments`, …). */\nexport const GeoDivisionSchema = z\n .object({\n id: z.string().uuid(),\n countryCode: z.string().length(2),\n type: GeoDivisionTypeSchema,\n code: z.string().min(1),\n name: z.string().min(1),\n parentId: z.string().uuid().nullable(),\n source: z.string().min(1),\n })\n .strict()\n\nexport type GeoDivision = z.infer<typeof GeoDivisionSchema>\n\n/** Alias de departamento (level1). */\nexport const DepartmentSchema = GeoDivisionSchema\nexport type Department = GeoDivision\n\nexport const DepartmentsSchema = z.array(DepartmentSchema)\nexport type Departments = z.infer<typeof DepartmentsSchema>\n\n/** Query de `GET /v1/geo/departments`. */\nexport const GetDepartmentsParamsSchema = z.object({\n countryCode: z.string().length(2),\n source: z.string().min(1).default('inei'),\n search: z.string().default(''),\n limit: z.number().int().positive().max(500).default(200),\n})\n\nexport type GetDepartmentsParams = z.input<typeof GetDepartmentsParamsSchema>\nexport type GetDepartmentsParamsParsed = z.output<typeof GetDepartmentsParamsSchema>\n\n/** Alias de provincia (level2). */\nexport const ProvinceSchema = GeoDivisionSchema\nexport type Province = GeoDivision\n\nexport const ProvincesSchema = z.array(ProvinceSchema)\nexport type Provinces = z.infer<typeof ProvincesSchema>\n\n/** Query de `GET /v1/geo/provinces`. */\nexport const GetProvincesParamsSchema = z.object({\n countryCode: z.string().length(2),\n departmentCode: z.string().min(1),\n source: z.string().min(1).default('inei'),\n search: z.string().default(''),\n limit: z.number().int().positive().max(500).default(200),\n})\n\nexport type GetProvincesParams = z.input<typeof GetProvincesParamsSchema>\nexport type GetProvincesParamsParsed = z.output<typeof GetProvincesParamsSchema>\n\n/** Alias de distrito (level3). */\nexport const DistrictSchema = GeoDivisionSchema\nexport type District = GeoDivision\n\nexport const DistrictsSchema = z.array(DistrictSchema)\nexport type Districts = z.infer<typeof DistrictsSchema>\n\n/** Query de `GET /v1/geo/districts`. */\nexport const GetDistrictsParamsSchema = z.object({\n countryCode: z.string().length(2),\n provinceCode: z.string().min(1),\n source: z.string().min(1).default('inei'),\n search: z.string().default(''),\n limit: z.number().int().positive().max(500).default(200),\n})\n\nexport type GetDistrictsParams = z.input<typeof GetDistrictsParamsSchema>\nexport type GetDistrictsParamsParsed = z.output<typeof GetDistrictsParamsSchema>\n"]}
|