@esb-market-contracts/backend 1.0.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/api.d.ts ADDED
@@ -0,0 +1,121 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ import { SessionPayload } from '@esb-market-contracts/admin-backend';
4
+
5
+ export type VariablesWithActor = {
6
+ actorSession: SessionPayload;
7
+ };
8
+ declare const categoriesRouter: import("hono/hono-base").HonoBase<{
9
+ Variables: VariablesWithActor;
10
+ }, {
11
+ "/backoffice/categories/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
+ category: {
24
+ id: number;
25
+ parentId: number | null;
26
+ slug: string;
27
+ status: "active" | "archived";
28
+ name: Partial<Record<"ka" | "en" | "ru", string>>;
29
+ logotypeImageSource: string;
30
+ updatedAt: Date | null;
31
+ createdAt: Date;
32
+ };
33
+ }>;
34
+ outputFormat: "json";
35
+ status: 200;
36
+ };
37
+ };
38
+ } & {
39
+ "/backoffice/categories/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
+ logotype: import("hono/types").ParsedFormValue | import("hono/types").ParsedFormValue[];
46
+ parentId?: import("hono/types").ParsedFormValue | import("hono/types").ParsedFormValue[] | undefined;
47
+ };
48
+ };
49
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<Record<string, never>>;
50
+ outputFormat: "json";
51
+ status: 201;
52
+ };
53
+ };
54
+ } & {
55
+ "/backoffice/categories/search": {
56
+ $post: {
57
+ input: {
58
+ json: {
59
+ pagination: {
60
+ offset?: unknown;
61
+ limit?: unknown;
62
+ };
63
+ where?: {
64
+ parentId?: number | null | undefined;
65
+ status?: "active" | "archived" | undefined;
66
+ } | undefined;
67
+ query?: string | undefined;
68
+ };
69
+ };
70
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
71
+ categories: {
72
+ id: number;
73
+ parentId: number | null;
74
+ slug: string;
75
+ status: "active" | "archived";
76
+ name: Partial<Record<"ka" | "en" | "ru", string>>;
77
+ logotypeImageSource: string;
78
+ updatedAt: Date | null;
79
+ createdAt: Date;
80
+ }[];
81
+ total: number;
82
+ }>;
83
+ outputFormat: "json";
84
+ status: 200;
85
+ };
86
+ };
87
+ } & {
88
+ "/backoffice/categories/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
+ categoryId: import("hono/types").ParsedFormValue | import("hono/types").ParsedFormValue[];
95
+ parentId?: import("hono/types").ParsedFormValue | import("hono/types").ParsedFormValue[] | undefined;
96
+ logotype?: import("zod/v4/core").File | undefined;
97
+ };
98
+ };
99
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<Record<string, never>>;
100
+ outputFormat: "json";
101
+ status: 200;
102
+ };
103
+ };
104
+ } & {
105
+ "/backoffice/categories/switch-status": {
106
+ $post: {
107
+ input: {
108
+ json: {
109
+ categoryId: number;
110
+ status: "active" | "archived";
111
+ };
112
+ };
113
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<Record<string, never>>;
114
+ outputFormat: "json";
115
+ status: 200;
116
+ };
117
+ };
118
+ }, "/backoffice/categories", "/backoffice/categories/switch-status">;
119
+ export type CategoriesRouter = typeof categoriesRouter;
120
+
121
+ export {};
package/api.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/constants.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ export {};
package/constants.js ADDED
File without changes
package/enums.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ declare const entityStatusesArray: readonly [
4
+ "active",
5
+ "archived"
6
+ ];
7
+ declare const entityStatusesRecord: Readonly<{
8
+ ACTIVE: "active";
9
+ ARCHIVED: "archived";
10
+ }>;
11
+ export type EntityStatus = (typeof entityStatusesArray)[number];
12
+
13
+ export {
14
+ entityStatusesRecord as entityStatus,
15
+ };
16
+
17
+ export {};
package/enums.js ADDED
@@ -0,0 +1,9 @@
1
+ // src/app/domain/global/global.enums.ts
2
+ import { createStringEnumRecord } from "@kalutskii/foundation";
3
+ import { pgEnum } from "drizzle-orm/pg-core";
4
+ var entityStatusesArray = ["active", "archived"];
5
+ var entityStatusPGEnum = pgEnum("entity_status", entityStatusesArray);
6
+ var entityStatusesRecord = createStringEnumRecord(entityStatusesArray);
7
+ export {
8
+ entityStatusesRecord as entityStatus
9
+ };
package/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ export type * from './api';
2
+ export type * from './enums';
3
+ export type * from './types';
4
+ export type * from './constants';
5
+ export * from './enums';
6
+ export * from './constants';
package/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from './enums.js';
2
+ export * from './constants.js';
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@esb-market-contracts/backend",
3
+ "description": "Shared TypeScript contract definitions for backend.",
4
+ "version": "1.0.0",
5
+ "private": false,
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "files": [
9
+ "index.d.ts",
10
+ "index.js",
11
+ "api.d.ts",
12
+ "api.js",
13
+ "enums.d.ts",
14
+ "enums.js",
15
+ "types.d.ts",
16
+ "types.js",
17
+ "constants.d.ts",
18
+ "constants.js"
19
+ ],
20
+ "exports": {
21
+ ".": {
22
+ "types": "./index.d.ts",
23
+ "default": "./index.js"
24
+ },
25
+ "./api": {
26
+ "types": "./api.d.ts",
27
+ "default": "./api.js"
28
+ },
29
+ "./enums": {
30
+ "types": "./enums.d.ts",
31
+ "default": "./enums.js"
32
+ },
33
+ "./types": {
34
+ "types": "./types.d.ts",
35
+ "default": "./types.js"
36
+ },
37
+ "./constants": {
38
+ "types": "./constants.d.ts",
39
+ "default": "./constants.js"
40
+ }
41
+ },
42
+ "types": "./index.d.ts"
43
+ }
package/types.d.ts ADDED
@@ -0,0 +1,97 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ import { z } from 'zod';
4
+
5
+ declare const categorySchema: z.ZodObject<{
6
+ id: z.ZodInt;
7
+ parentId: z.ZodNullable<z.ZodInt>;
8
+ slug: z.ZodString;
9
+ status: z.ZodEnum<{
10
+ active: "active";
11
+ archived: "archived";
12
+ }>;
13
+ name: z.ZodRecord<z.ZodEnum<{
14
+ ka: "ka";
15
+ en: "en";
16
+ ru: "ru";
17
+ }> & z.core.$partial, z.ZodString>;
18
+ logotypeImageSource: z.ZodString;
19
+ updatedAt: z.ZodNullable<z.ZodDate>;
20
+ createdAt: z.ZodDate;
21
+ }, z.core.$strip>;
22
+ export type Category = z.infer<typeof categorySchema>;
23
+ declare const categorySearchOptionsSchema: z.ZodObject<{
24
+ where: z.ZodOptional<z.ZodPipe<z.ZodObject<{
25
+ parentId: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
26
+ status: z.ZodOptional<z.ZodEnum<{
27
+ active: "active";
28
+ archived: "archived";
29
+ }>>;
30
+ }, z.core.$strip>, z.ZodTransform<{
31
+ parentId: number | null;
32
+ status?: "active" | "archived" | undefined;
33
+ } | {
34
+ status: "active" | "archived";
35
+ parentId?: number | null | undefined;
36
+ }, {
37
+ parentId?: number | null | undefined;
38
+ status?: "active" | "archived" | undefined;
39
+ }>>>;
40
+ query: z.ZodOptional<z.ZodString>;
41
+ pagination: z.ZodObject<{
42
+ offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
43
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
44
+ }, z.core.$strip>;
45
+ }, z.core.$strict>;
46
+ declare const categorySelectOneQuerySchema: z.ZodPipe<z.ZodObject<{
47
+ id: z.ZodOptional<z.ZodInt>;
48
+ slug: z.ZodOptional<z.ZodString>;
49
+ }, z.core.$strict>, z.ZodTransform<{
50
+ id: number;
51
+ slug?: string | undefined;
52
+ } | {
53
+ slug: string;
54
+ id?: number | undefined;
55
+ }, {
56
+ id?: number | undefined;
57
+ slug?: string | undefined;
58
+ }>>;
59
+ declare const categoryCreatePayloadSchema: z.ZodObject<{
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
+ parentId: z.ZodOptional<z.ZodPreprocess<z.ZodNullable<z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodInt>>>>;
67
+ logotype: z.ZodFile;
68
+ }, z.core.$strict>;
69
+ declare const categoryUpdatePayloadSchema: z.ZodObject<{
70
+ slug: z.ZodString;
71
+ name: z.ZodPreprocess<z.ZodRecord<z.ZodEnum<{
72
+ ka: "ka";
73
+ en: "en";
74
+ ru: "ru";
75
+ }> & z.core.$partial, z.ZodString>>;
76
+ parentId: z.ZodOptional<z.ZodPreprocess<z.ZodNullable<z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodInt>>>>;
77
+ logotype: z.ZodOptional<z.ZodFile>;
78
+ categoryId: z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodInt>;
79
+ }, z.core.$strict>;
80
+ declare const categorySwitchStatusPayloadSchema: z.ZodObject<{
81
+ categoryId: z.ZodInt;
82
+ status: z.ZodEnum<{
83
+ active: "active";
84
+ archived: "archived";
85
+ }>;
86
+ }, z.core.$strict>;
87
+ export type CategorySearchOptions = z.infer<typeof categorySearchOptionsSchema>;
88
+ export type CategorySelectOneQuery = z.infer<typeof categorySelectOneQuerySchema>;
89
+ export type CategorySearchResult = {
90
+ categories: Category[];
91
+ total: number;
92
+ };
93
+ export type CategoryCreatePayload = z.infer<typeof categoryCreatePayloadSchema>;
94
+ export type CategoryUpdatePayload = z.infer<typeof categoryUpdatePayloadSchema>;
95
+ export type CategorySwitchStatusPayload = z.infer<typeof categorySwitchStatusPayloadSchema>;
96
+
97
+ export {};
package/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};