@esb-market-contracts/backend 1.0.8 → 1.0.10

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.
Files changed (3) hide show
  1. package/api.d.ts +95 -0
  2. package/package.json +1 -1
  3. package/types.d.ts +70 -0
package/api.d.ts CHANGED
@@ -5,6 +5,101 @@ 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
+ logotypeUrl: string;
28
+ countryId: number;
29
+ updatedAt: Date | null;
30
+ createdAt: Date;
31
+ };
32
+ }>;
33
+ outputFormat: "json";
34
+ status: 200;
35
+ };
36
+ };
37
+ } & {
38
+ "/catalog/brands/create": {
39
+ $post: {
40
+ input: {
41
+ form: {
42
+ slug: import("hono/types").ParsedFormValue | import("hono/types").ParsedFormValue[];
43
+ name: import("hono/types").ParsedFormValue | import("hono/types").ParsedFormValue[];
44
+ countryId: import("hono/types").ParsedFormValue | import("hono/types").ParsedFormValue[];
45
+ logotype: import("hono/types").ParsedFormValue | import("hono/types").ParsedFormValue[];
46
+ };
47
+ };
48
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<Record<string, never>>;
49
+ outputFormat: "json";
50
+ status: 201;
51
+ };
52
+ };
53
+ } & {
54
+ "/catalog/brands/search": {
55
+ $post: {
56
+ input: {
57
+ json: {
58
+ pagination: {
59
+ offset?: unknown;
60
+ limit?: unknown;
61
+ };
62
+ where?: {
63
+ countryId?: number | undefined;
64
+ } | undefined;
65
+ query?: string | undefined;
66
+ };
67
+ };
68
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
69
+ brands: {
70
+ id: number;
71
+ slug: string;
72
+ name: Partial<Record<"ka" | "en" | "ru", string>>;
73
+ logotypeUrl: string;
74
+ countryId: number;
75
+ updatedAt: Date | null;
76
+ createdAt: Date;
77
+ }[];
78
+ total: number;
79
+ }>;
80
+ outputFormat: "json";
81
+ status: 200;
82
+ };
83
+ };
84
+ } & {
85
+ "/catalog/brands/update-metadata": {
86
+ $post: {
87
+ input: {
88
+ form: {
89
+ slug: import("hono/types").ParsedFormValue | import("hono/types").ParsedFormValue[];
90
+ name: import("hono/types").ParsedFormValue | import("hono/types").ParsedFormValue[];
91
+ countryId: import("hono/types").ParsedFormValue | import("hono/types").ParsedFormValue[];
92
+ brandId: import("hono/types").ParsedFormValue | import("hono/types").ParsedFormValue[];
93
+ logotype?: import("zod/v4/core").File | undefined;
94
+ };
95
+ };
96
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<Record<string, never>>;
97
+ outputFormat: "json";
98
+ status: 200;
99
+ };
100
+ };
101
+ }, "/catalog/brands", "/catalog/brands/update-metadata">;
102
+ export type BrandsRouter = typeof brandsRouter;
8
103
  declare const categoriesRouter: import("hono/hono-base").HonoBase<{
9
104
  Variables: VariablesWithActor;
10
105
  }, {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@esb-market-contracts/backend",
3
3
  "description": "Shared TypeScript contract definitions for backend.",
4
- "version": "1.0.8",
4
+ "version": "1.0.10",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "sideEffects": false,
package/types.d.ts CHANGED
@@ -2,6 +2,76 @@
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
+ logotypeUrl: z.ZodString;
14
+ countryId: z.ZodInt;
15
+ updatedAt: z.ZodNullable<z.ZodDate>;
16
+ createdAt: z.ZodDate;
17
+ }, z.core.$strip>;
18
+ export type Brand = z.infer<typeof brandSchema>;
19
+ declare const brandSearchOptionsSchema: z.ZodObject<{
20
+ where: z.ZodOptional<z.ZodPipe<z.ZodObject<{
21
+ countryId: z.ZodOptional<z.ZodInt>;
22
+ }, z.core.$strip>, z.ZodTransform<{
23
+ countryId: number;
24
+ }, {
25
+ countryId?: number | undefined;
26
+ }>>>;
27
+ query: z.ZodOptional<z.ZodString>;
28
+ pagination: z.ZodObject<{
29
+ offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
30
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
31
+ }, z.core.$strip>;
32
+ }, z.core.$strict>;
33
+ declare const brandSelectOneQuerySchema: z.ZodPipe<z.ZodObject<{
34
+ id: z.ZodOptional<z.ZodInt>;
35
+ slug: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$strict>, z.ZodTransform<{
37
+ id: number;
38
+ slug?: string | undefined;
39
+ } | {
40
+ slug: string;
41
+ id?: number | undefined;
42
+ }, {
43
+ id?: number | undefined;
44
+ slug?: string | undefined;
45
+ }>>;
46
+ declare const brandCreatePayloadSchema: z.ZodObject<{
47
+ slug: z.ZodString;
48
+ name: z.ZodPreprocess<z.ZodRecord<z.ZodEnum<{
49
+ ka: "ka";
50
+ en: "en";
51
+ ru: "ru";
52
+ }> & z.core.$partial, z.ZodString>>;
53
+ countryId: z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodInt>;
54
+ logotype: z.ZodFile;
55
+ }, z.core.$strict>;
56
+ declare const brandUpdatePayloadSchema: z.ZodObject<{
57
+ slug: z.ZodString;
58
+ name: z.ZodPreprocess<z.ZodRecord<z.ZodEnum<{
59
+ ka: "ka";
60
+ en: "en";
61
+ ru: "ru";
62
+ }> & z.core.$partial, z.ZodString>>;
63
+ countryId: z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodInt>;
64
+ logotype: z.ZodOptional<z.ZodFile>;
65
+ brandId: z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodInt>;
66
+ }, z.core.$strict>;
67
+ export type BrandSearchOptions = z.infer<typeof brandSearchOptionsSchema>;
68
+ export type BrandSearchResult = {
69
+ brands: Brand[];
70
+ total: number;
71
+ };
72
+ export type BrandSelectOneQuery = z.infer<typeof brandSelectOneQuerySchema>;
73
+ export type BrandCreatePayload = z.infer<typeof brandCreatePayloadSchema>;
74
+ export type BrandUpdatePayload = z.infer<typeof brandUpdatePayloadSchema>;
5
75
  declare const categorySchema: z.ZodObject<{
6
76
  id: z.ZodInt;
7
77
  slug: z.ZodString;