@esb-market-contracts/backend 1.0.7 → 1.0.9
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/api.d.ts +99 -0
- package/package.json +1 -1
- package/types.d.ts +77 -4
package/api.d.ts
CHANGED
|
@@ -5,6 +5,105 @@ import { SessionPayload } from '@esb-market-contracts/admin-backend';
|
|
|
5
5
|
export type VariablesWithActor = {
|
|
6
6
|
actorSession: SessionPayload;
|
|
7
7
|
};
|
|
8
|
+
declare const brandsRouter: import("hono/hono-base").HonoBase<{
|
|
9
|
+
Variables: VariablesWithActor;
|
|
10
|
+
}, {
|
|
11
|
+
"/catalog/brands/one": {
|
|
12
|
+
$get: {
|
|
13
|
+
input: {
|
|
14
|
+
query: {
|
|
15
|
+
id: string | string[];
|
|
16
|
+
slug?: string | undefined;
|
|
17
|
+
} | {
|
|
18
|
+
slug: string | string[];
|
|
19
|
+
id?: number | undefined;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
|
|
23
|
+
brand: {
|
|
24
|
+
id: number;
|
|
25
|
+
slug: string;
|
|
26
|
+
name: Partial<Record<"ka" | "en" | "ru", string>>;
|
|
27
|
+
description: string | null;
|
|
28
|
+
logotypeUrl: string;
|
|
29
|
+
countryId: number;
|
|
30
|
+
updatedAt: Date | null;
|
|
31
|
+
createdAt: Date;
|
|
32
|
+
};
|
|
33
|
+
}>;
|
|
34
|
+
outputFormat: "json";
|
|
35
|
+
status: 200;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
} & {
|
|
39
|
+
"/catalog/brands/create": {
|
|
40
|
+
$post: {
|
|
41
|
+
input: {
|
|
42
|
+
form: {
|
|
43
|
+
slug: import("hono/types").ParsedFormValue | import("hono/types").ParsedFormValue[];
|
|
44
|
+
name: import("hono/types").ParsedFormValue | import("hono/types").ParsedFormValue[];
|
|
45
|
+
countryId: import("hono/types").ParsedFormValue | import("hono/types").ParsedFormValue[];
|
|
46
|
+
logotype: import("hono/types").ParsedFormValue | import("hono/types").ParsedFormValue[];
|
|
47
|
+
description?: string | null | undefined;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<Record<string, never>>;
|
|
51
|
+
outputFormat: "json";
|
|
52
|
+
status: 201;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
} & {
|
|
56
|
+
"/catalog/brands/search": {
|
|
57
|
+
$post: {
|
|
58
|
+
input: {
|
|
59
|
+
json: {
|
|
60
|
+
pagination: {
|
|
61
|
+
offset?: unknown;
|
|
62
|
+
limit?: unknown;
|
|
63
|
+
};
|
|
64
|
+
where?: {
|
|
65
|
+
countryId?: number | undefined;
|
|
66
|
+
} | undefined;
|
|
67
|
+
query?: string | undefined;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
|
|
71
|
+
brands: {
|
|
72
|
+
id: number;
|
|
73
|
+
slug: string;
|
|
74
|
+
name: Partial<Record<"ka" | "en" | "ru", string>>;
|
|
75
|
+
description: string | null;
|
|
76
|
+
logotypeUrl: string;
|
|
77
|
+
countryId: number;
|
|
78
|
+
updatedAt: Date | null;
|
|
79
|
+
createdAt: Date;
|
|
80
|
+
}[];
|
|
81
|
+
total: number;
|
|
82
|
+
}>;
|
|
83
|
+
outputFormat: "json";
|
|
84
|
+
status: 200;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
} & {
|
|
88
|
+
"/catalog/brands/update-metadata": {
|
|
89
|
+
$post: {
|
|
90
|
+
input: {
|
|
91
|
+
form: {
|
|
92
|
+
slug: import("hono/types").ParsedFormValue | import("hono/types").ParsedFormValue[];
|
|
93
|
+
name: import("hono/types").ParsedFormValue | import("hono/types").ParsedFormValue[];
|
|
94
|
+
countryId: import("hono/types").ParsedFormValue | import("hono/types").ParsedFormValue[];
|
|
95
|
+
brandId: import("hono/types").ParsedFormValue | import("hono/types").ParsedFormValue[];
|
|
96
|
+
description?: string | null | undefined;
|
|
97
|
+
logotype?: import("zod/v4/core").File | undefined;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<Record<string, never>>;
|
|
101
|
+
outputFormat: "json";
|
|
102
|
+
status: 200;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
}, "/catalog/brands", "/catalog/brands/update-metadata">;
|
|
106
|
+
export type BrandsRouter = typeof brandsRouter;
|
|
8
107
|
declare const categoriesRouter: import("hono/hono-base").HonoBase<{
|
|
9
108
|
Variables: VariablesWithActor;
|
|
10
109
|
}, {
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -2,6 +2,79 @@
|
|
|
2
2
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
|
+
declare const brandSchema: z.ZodObject<{
|
|
6
|
+
id: z.ZodInt;
|
|
7
|
+
slug: z.ZodString;
|
|
8
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
9
|
+
ka: "ka";
|
|
10
|
+
en: "en";
|
|
11
|
+
ru: "ru";
|
|
12
|
+
}> & z.core.$partial, z.ZodString>;
|
|
13
|
+
description: z.ZodNullable<z.ZodString>;
|
|
14
|
+
logotypeUrl: z.ZodString;
|
|
15
|
+
countryId: z.ZodInt;
|
|
16
|
+
updatedAt: z.ZodNullable<z.ZodDate>;
|
|
17
|
+
createdAt: z.ZodDate;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type Brand = z.infer<typeof brandSchema>;
|
|
20
|
+
declare const brandSearchOptionsSchema: z.ZodObject<{
|
|
21
|
+
where: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
22
|
+
countryId: z.ZodOptional<z.ZodInt>;
|
|
23
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
24
|
+
countryId: number;
|
|
25
|
+
}, {
|
|
26
|
+
countryId?: number | undefined;
|
|
27
|
+
}>>>;
|
|
28
|
+
query: z.ZodOptional<z.ZodString>;
|
|
29
|
+
pagination: z.ZodObject<{
|
|
30
|
+
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
31
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
declare const brandSelectOneQuerySchema: z.ZodPipe<z.ZodObject<{
|
|
35
|
+
id: z.ZodOptional<z.ZodInt>;
|
|
36
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
38
|
+
id: number;
|
|
39
|
+
slug?: string | undefined;
|
|
40
|
+
} | {
|
|
41
|
+
slug: string;
|
|
42
|
+
id?: number | undefined;
|
|
43
|
+
}, {
|
|
44
|
+
id?: number | undefined;
|
|
45
|
+
slug?: string | undefined;
|
|
46
|
+
}>>;
|
|
47
|
+
declare const brandCreatePayloadSchema: z.ZodObject<{
|
|
48
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
49
|
+
slug: z.ZodString;
|
|
50
|
+
name: z.ZodPreprocess<z.ZodRecord<z.ZodEnum<{
|
|
51
|
+
ka: "ka";
|
|
52
|
+
en: "en";
|
|
53
|
+
ru: "ru";
|
|
54
|
+
}> & z.core.$partial, z.ZodString>>;
|
|
55
|
+
countryId: z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodInt>;
|
|
56
|
+
logotype: z.ZodFile;
|
|
57
|
+
}, z.core.$strict>;
|
|
58
|
+
declare const brandUpdatePayloadSchema: z.ZodObject<{
|
|
59
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
60
|
+
slug: z.ZodString;
|
|
61
|
+
name: z.ZodPreprocess<z.ZodRecord<z.ZodEnum<{
|
|
62
|
+
ka: "ka";
|
|
63
|
+
en: "en";
|
|
64
|
+
ru: "ru";
|
|
65
|
+
}> & z.core.$partial, z.ZodString>>;
|
|
66
|
+
countryId: z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodInt>;
|
|
67
|
+
logotype: z.ZodOptional<z.ZodFile>;
|
|
68
|
+
brandId: z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodInt>;
|
|
69
|
+
}, z.core.$strict>;
|
|
70
|
+
export type BrandSearchOptions = z.infer<typeof brandSearchOptionsSchema>;
|
|
71
|
+
export type BrandSearchResult = {
|
|
72
|
+
brands: Brand[];
|
|
73
|
+
total: number;
|
|
74
|
+
};
|
|
75
|
+
export type BrandSelectOneQuery = z.infer<typeof brandSelectOneQuerySchema>;
|
|
76
|
+
export type BrandCreatePayload = z.infer<typeof brandCreatePayloadSchema>;
|
|
77
|
+
export type BrandUpdatePayload = z.infer<typeof brandUpdatePayloadSchema>;
|
|
5
78
|
declare const categorySchema: z.ZodObject<{
|
|
6
79
|
id: z.ZodInt;
|
|
7
80
|
slug: z.ZodString;
|
|
@@ -122,20 +195,20 @@ declare const countrySelectOneQuerySchema: z.ZodObject<{
|
|
|
122
195
|
}, z.core.$strict>;
|
|
123
196
|
declare const countryCreatePayloadSchema: z.ZodObject<{
|
|
124
197
|
code: z.ZodString;
|
|
125
|
-
name: z.ZodRecord<z.ZodEnum<{
|
|
198
|
+
name: z.ZodPreprocess<z.ZodRecord<z.ZodEnum<{
|
|
126
199
|
ka: "ka";
|
|
127
200
|
en: "en";
|
|
128
201
|
ru: "ru";
|
|
129
|
-
}> & z.core.$partial, z.ZodString
|
|
202
|
+
}> & z.core.$partial, z.ZodString>>;
|
|
130
203
|
flagImage: z.ZodFile;
|
|
131
204
|
}, z.core.$strict>;
|
|
132
205
|
declare const countryUpdatePayloadSchema: z.ZodObject<{
|
|
133
206
|
code: z.ZodString;
|
|
134
|
-
name: z.ZodRecord<z.ZodEnum<{
|
|
207
|
+
name: z.ZodPreprocess<z.ZodRecord<z.ZodEnum<{
|
|
135
208
|
ka: "ka";
|
|
136
209
|
en: "en";
|
|
137
210
|
ru: "ru";
|
|
138
|
-
}> & z.core.$partial, z.ZodString
|
|
211
|
+
}> & z.core.$partial, z.ZodString>>;
|
|
139
212
|
flagImage: z.ZodOptional<z.ZodFile>;
|
|
140
213
|
countryId: z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodInt>;
|
|
141
214
|
}, z.core.$strict>;
|