@esb-market-contracts/backend 1.0.1 → 1.0.4
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 +11 -15
- package/enums.d.ts +11 -0
- package/enums.js +18 -3
- package/package.json +1 -1
- package/types.d.ts +11 -14
package/api.d.ts
CHANGED
|
@@ -22,11 +22,10 @@ declare const categoriesRouter: import("hono/hono-base").HonoBase<{
|
|
|
22
22
|
output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
|
|
23
23
|
category: {
|
|
24
24
|
id: number;
|
|
25
|
-
parentId: number | null;
|
|
26
25
|
slug: string;
|
|
26
|
+
parentId: number | null;
|
|
27
27
|
status: "active" | "archived";
|
|
28
28
|
name: Partial<Record<"ka" | "en" | "ru", string>>;
|
|
29
|
-
logotypeImageSource: string;
|
|
30
29
|
updatedAt: Date | null;
|
|
31
30
|
createdAt: Date;
|
|
32
31
|
};
|
|
@@ -39,11 +38,10 @@ declare const categoriesRouter: import("hono/hono-base").HonoBase<{
|
|
|
39
38
|
"/catalog/categories/create": {
|
|
40
39
|
$post: {
|
|
41
40
|
input: {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
parentId?: import("hono/types").ParsedFormValue | import("hono/types").ParsedFormValue[] | undefined;
|
|
41
|
+
json: {
|
|
42
|
+
name: Partial<Record<"ka" | "en" | "ru", string>>;
|
|
43
|
+
slug: string;
|
|
44
|
+
parentId?: number | null | undefined;
|
|
47
45
|
};
|
|
48
46
|
};
|
|
49
47
|
output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<Record<string, never>>;
|
|
@@ -70,11 +68,10 @@ declare const categoriesRouter: import("hono/hono-base").HonoBase<{
|
|
|
70
68
|
output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
|
|
71
69
|
categories: {
|
|
72
70
|
id: number;
|
|
73
|
-
parentId: number | null;
|
|
74
71
|
slug: string;
|
|
72
|
+
parentId: number | null;
|
|
75
73
|
status: "active" | "archived";
|
|
76
74
|
name: Partial<Record<"ka" | "en" | "ru", string>>;
|
|
77
|
-
logotypeImageSource: string;
|
|
78
75
|
updatedAt: Date | null;
|
|
79
76
|
createdAt: Date;
|
|
80
77
|
}[];
|
|
@@ -88,12 +85,11 @@ declare const categoriesRouter: import("hono/hono-base").HonoBase<{
|
|
|
88
85
|
"/catalog/categories/update-metadata": {
|
|
89
86
|
$post: {
|
|
90
87
|
input: {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
categoryId:
|
|
95
|
-
parentId?:
|
|
96
|
-
logotype?: import("zod/v4/core").File | undefined;
|
|
88
|
+
json: {
|
|
89
|
+
name: Partial<Record<"ka" | "en" | "ru", string>>;
|
|
90
|
+
slug: string;
|
|
91
|
+
categoryId: number;
|
|
92
|
+
parentId?: number | null | undefined;
|
|
97
93
|
};
|
|
98
94
|
};
|
|
99
95
|
output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<Record<string, never>>;
|
package/enums.d.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
|
+
export declare const localesArray: readonly [
|
|
4
|
+
"ka",
|
|
5
|
+
"en",
|
|
6
|
+
"ru"
|
|
7
|
+
];
|
|
8
|
+
export declare const locale: Readonly<{
|
|
9
|
+
KA: "ka";
|
|
10
|
+
EN: "en";
|
|
11
|
+
RU: "ru";
|
|
12
|
+
}>;
|
|
13
|
+
export type Locale = (typeof localesArray)[number];
|
|
3
14
|
declare const entityStatusesArray: readonly [
|
|
4
15
|
"active",
|
|
5
16
|
"archived"
|
package/enums.js
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/internal/localization/localization.config.ts
|
|
2
2
|
import { createStringEnumRecord } from "@kalutskii/foundation";
|
|
3
|
+
var localesArray = ["ka", "en", "ru"];
|
|
4
|
+
var localesRecord = createStringEnumRecord(localesArray);
|
|
5
|
+
var locale = localesRecord;
|
|
6
|
+
|
|
7
|
+
// src/internal/localization/localization.schemas.ts
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
var AT_LEAST_ONE_LOCALIZED_VALUE_ERROR = "At least one localized value is required";
|
|
10
|
+
var localizedStringSchema = z.partialRecord(z.enum(localesArray), z.string()).refine((value) => Object.values(value).some((localizedValue) => localizedValue.trim().length > 0), {
|
|
11
|
+
message: AT_LEAST_ONE_LOCALIZED_VALUE_ERROR
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
// src/app/domain/global/global.enums.ts
|
|
15
|
+
import { createStringEnumRecord as createStringEnumRecord2 } from "@kalutskii/foundation";
|
|
3
16
|
import { pgEnum } from "drizzle-orm/pg-core";
|
|
4
17
|
var entityStatusesArray = ["active", "archived"];
|
|
5
18
|
var entityStatusPGEnum = pgEnum("entity_status", entityStatusesArray);
|
|
6
|
-
var entityStatusesRecord =
|
|
19
|
+
var entityStatusesRecord = createStringEnumRecord2(entityStatusesArray);
|
|
7
20
|
export {
|
|
8
|
-
entityStatusesRecord as entityStatus
|
|
21
|
+
entityStatusesRecord as entityStatus,
|
|
22
|
+
locale,
|
|
23
|
+
localesArray
|
|
9
24
|
};
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { z } from 'zod';
|
|
|
4
4
|
|
|
5
5
|
declare const categorySchema: z.ZodObject<{
|
|
6
6
|
id: z.ZodInt;
|
|
7
|
-
parentId: z.ZodNullable<z.ZodInt>;
|
|
8
7
|
slug: z.ZodString;
|
|
8
|
+
parentId: z.ZodNullable<z.ZodInt>;
|
|
9
9
|
status: z.ZodEnum<{
|
|
10
10
|
active: "active";
|
|
11
11
|
archived: "archived";
|
|
@@ -15,7 +15,6 @@ declare const categorySchema: z.ZodObject<{
|
|
|
15
15
|
en: "en";
|
|
16
16
|
ru: "ru";
|
|
17
17
|
}> & z.core.$partial, z.ZodString>;
|
|
18
|
-
logotypeImageSource: z.ZodString;
|
|
19
18
|
updatedAt: z.ZodNullable<z.ZodDate>;
|
|
20
19
|
createdAt: z.ZodDate;
|
|
21
20
|
}, z.core.$strip>;
|
|
@@ -57,25 +56,23 @@ declare const categorySelectOneQuerySchema: z.ZodPipe<z.ZodObject<{
|
|
|
57
56
|
slug?: string | undefined;
|
|
58
57
|
}>>;
|
|
59
58
|
declare const categoryCreatePayloadSchema: z.ZodObject<{
|
|
60
|
-
|
|
61
|
-
name: z.ZodPreprocess<z.ZodRecord<z.ZodEnum<{
|
|
59
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
62
60
|
ka: "ka";
|
|
63
61
|
en: "en";
|
|
64
62
|
ru: "ru";
|
|
65
|
-
}> & z.core.$partial, z.ZodString
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
}> & z.core.$partial, z.ZodString>;
|
|
64
|
+
slug: z.ZodString;
|
|
65
|
+
parentId: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
68
66
|
}, z.core.$strict>;
|
|
69
67
|
declare const categoryUpdatePayloadSchema: z.ZodObject<{
|
|
70
|
-
|
|
71
|
-
name: z.ZodPreprocess<z.ZodRecord<z.ZodEnum<{
|
|
68
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
72
69
|
ka: "ka";
|
|
73
70
|
en: "en";
|
|
74
71
|
ru: "ru";
|
|
75
|
-
}> & z.core.$partial, z.ZodString
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
categoryId: z.
|
|
72
|
+
}> & z.core.$partial, z.ZodString>;
|
|
73
|
+
slug: z.ZodString;
|
|
74
|
+
parentId: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
75
|
+
categoryId: z.ZodInt;
|
|
79
76
|
}, z.core.$strict>;
|
|
80
77
|
declare const categorySwitchStatusPayloadSchema: z.ZodObject<{
|
|
81
78
|
categoryId: z.ZodInt;
|
|
@@ -85,11 +82,11 @@ declare const categorySwitchStatusPayloadSchema: z.ZodObject<{
|
|
|
85
82
|
}>;
|
|
86
83
|
}, z.core.$strict>;
|
|
87
84
|
export type CategorySearchOptions = z.infer<typeof categorySearchOptionsSchema>;
|
|
88
|
-
export type CategorySelectOneQuery = z.infer<typeof categorySelectOneQuerySchema>;
|
|
89
85
|
export type CategorySearchResult = {
|
|
90
86
|
categories: Category[];
|
|
91
87
|
total: number;
|
|
92
88
|
};
|
|
89
|
+
export type CategorySelectOneQuery = z.infer<typeof categorySelectOneQuerySchema>;
|
|
93
90
|
export type CategoryCreatePayload = z.infer<typeof categoryCreatePayloadSchema>;
|
|
94
91
|
export type CategoryUpdatePayload = z.infer<typeof categoryUpdatePayloadSchema>;
|
|
95
92
|
export type CategorySwitchStatusPayload = z.infer<typeof categorySwitchStatusPayloadSchema>;
|