@esb-market-contracts/admin-backend 1.8.19 → 1.8.21
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 +16 -10
- package/enums.d.ts +9 -1
- package/enums.js +9 -1
- package/package.json +1 -1
- package/types.d.ts +31 -10
package/api.d.ts
CHANGED
|
@@ -45,18 +45,22 @@ export type AuthRouter = typeof authRouter;
|
|
|
45
45
|
declare const sessionPayloadSchema: z.ZodObject<{
|
|
46
46
|
employee: z.ZodObject<{
|
|
47
47
|
id: z.ZodInt;
|
|
48
|
-
email: z.ZodString;
|
|
49
|
-
fullName: z.ZodString;
|
|
50
48
|
status: z.ZodEnum<{
|
|
51
49
|
active: "active";
|
|
52
50
|
suspended: "suspended";
|
|
53
51
|
}>;
|
|
54
52
|
updatedAt: z.ZodNullable<z.ZodDate>;
|
|
55
53
|
createdAt: z.ZodDate;
|
|
54
|
+
email: z.ZodString;
|
|
55
|
+
fullName: z.ZodString;
|
|
56
56
|
grants: z.ZodArray<z.ZodEnum<{
|
|
57
57
|
"employee.create": "employee.create";
|
|
58
58
|
"employee.read": "employee.read";
|
|
59
59
|
"employee.update": "employee.update";
|
|
60
|
+
"inventory.create": "inventory.create";
|
|
61
|
+
"inventory.read": "inventory.read";
|
|
62
|
+
"inventory.update": "inventory.update";
|
|
63
|
+
"inventory.write_off": "inventory.write_off";
|
|
60
64
|
}>>;
|
|
61
65
|
}, {
|
|
62
66
|
out: {};
|
|
@@ -81,21 +85,23 @@ declare const managementRouter: import("hono/hono-base").HonoBase<{
|
|
|
81
85
|
};
|
|
82
86
|
};
|
|
83
87
|
} & {
|
|
84
|
-
"/iam/management/employees/
|
|
85
|
-
$
|
|
88
|
+
"/iam/management/employees/search": {
|
|
89
|
+
$post: {
|
|
86
90
|
input: {
|
|
87
|
-
|
|
88
|
-
|
|
91
|
+
json?: {
|
|
92
|
+
where: {
|
|
93
|
+
status?: "active" | "suspended" | undefined;
|
|
94
|
+
};
|
|
89
95
|
} | undefined;
|
|
90
96
|
};
|
|
91
97
|
output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
|
|
92
98
|
employees: {
|
|
93
99
|
id: string;
|
|
94
|
-
email: string;
|
|
95
|
-
fullName: string;
|
|
96
100
|
status: string;
|
|
97
101
|
updatedAt: string | null;
|
|
98
102
|
createdAt: string;
|
|
103
|
+
email: string;
|
|
104
|
+
fullName: string;
|
|
99
105
|
grants: string[];
|
|
100
106
|
}[];
|
|
101
107
|
}>;
|
|
@@ -111,7 +117,7 @@ declare const managementRouter: import("hono/hono-base").HonoBase<{
|
|
|
111
117
|
email: string;
|
|
112
118
|
fullName: string;
|
|
113
119
|
password: string;
|
|
114
|
-
grants: ("employee.create" | "employee.read" | "employee.update")[];
|
|
120
|
+
grants: ("employee.create" | "employee.read" | "employee.update" | "inventory.create" | "inventory.read" | "inventory.update" | "inventory.write_off")[];
|
|
115
121
|
};
|
|
116
122
|
};
|
|
117
123
|
output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
|
|
@@ -159,7 +165,7 @@ declare const managementRouter: import("hono/hono-base").HonoBase<{
|
|
|
159
165
|
input: {
|
|
160
166
|
json: {
|
|
161
167
|
employeeId: number;
|
|
162
|
-
grants: ("employee.create" | "employee.read" | "employee.update")[];
|
|
168
|
+
grants: ("employee.create" | "employee.read" | "employee.update" | "inventory.create" | "inventory.read" | "inventory.update" | "inventory.write_off")[];
|
|
163
169
|
};
|
|
164
170
|
};
|
|
165
171
|
output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
|
package/enums.d.ts
CHANGED
|
@@ -3,12 +3,20 @@
|
|
|
3
3
|
declare const grantsArray: readonly [
|
|
4
4
|
"employee.create",
|
|
5
5
|
"employee.read",
|
|
6
|
-
"employee.update"
|
|
6
|
+
"employee.update",
|
|
7
|
+
"inventory.create",
|
|
8
|
+
"inventory.read",
|
|
9
|
+
"inventory.update",
|
|
10
|
+
"inventory.write_off"
|
|
7
11
|
];
|
|
8
12
|
declare const grantsRecord: Readonly<{
|
|
9
13
|
EMPLOYEE_CREATE: "employee.create";
|
|
10
14
|
EMPLOYEE_READ: "employee.read";
|
|
11
15
|
EMPLOYEE_UPDATE: "employee.update";
|
|
16
|
+
INVENTORY_CREATE: "inventory.create";
|
|
17
|
+
INVENTORY_READ: "inventory.read";
|
|
18
|
+
INVENTORY_UPDATE: "inventory.update";
|
|
19
|
+
INVENTORY_WRITE_OFF: "inventory.write_off";
|
|
12
20
|
}>;
|
|
13
21
|
export type Grant = (typeof grantsArray)[number];
|
|
14
22
|
declare const employeeStatusesArray: readonly [
|
package/enums.js
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
// src/app/domain/(iam)/permissions/permissions.enums.ts
|
|
2
2
|
import { createStringEnumRecord } from "@kalutskii/foundation";
|
|
3
3
|
import z from "zod";
|
|
4
|
-
var grantsArray = [
|
|
4
|
+
var grantsArray = [
|
|
5
|
+
"employee.create",
|
|
6
|
+
"employee.read",
|
|
7
|
+
"employee.update",
|
|
8
|
+
"inventory.create",
|
|
9
|
+
"inventory.read",
|
|
10
|
+
"inventory.update",
|
|
11
|
+
"inventory.write_off"
|
|
12
|
+
];
|
|
5
13
|
var grantsZodArray = z.array(z.enum(grantsArray));
|
|
6
14
|
var grantsRecord = createStringEnumRecord(grantsArray);
|
|
7
15
|
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -9,18 +9,22 @@ declare const signinPayloadSchema: z.ZodObject<{
|
|
|
9
9
|
declare const sessionPayloadSchema: z.ZodObject<{
|
|
10
10
|
employee: z.ZodObject<{
|
|
11
11
|
id: z.ZodInt;
|
|
12
|
-
email: z.ZodString;
|
|
13
|
-
fullName: z.ZodString;
|
|
14
12
|
status: z.ZodEnum<{
|
|
15
13
|
active: "active";
|
|
16
14
|
suspended: "suspended";
|
|
17
15
|
}>;
|
|
18
16
|
updatedAt: z.ZodNullable<z.ZodDate>;
|
|
19
17
|
createdAt: z.ZodDate;
|
|
18
|
+
email: z.ZodString;
|
|
19
|
+
fullName: z.ZodString;
|
|
20
20
|
grants: z.ZodArray<z.ZodEnum<{
|
|
21
21
|
"employee.create": "employee.create";
|
|
22
22
|
"employee.read": "employee.read";
|
|
23
23
|
"employee.update": "employee.update";
|
|
24
|
+
"inventory.create": "inventory.create";
|
|
25
|
+
"inventory.read": "inventory.read";
|
|
26
|
+
"inventory.update": "inventory.update";
|
|
27
|
+
"inventory.write_off": "inventory.write_off";
|
|
24
28
|
}>>;
|
|
25
29
|
}, {
|
|
26
30
|
out: {};
|
|
@@ -31,28 +35,37 @@ export type SigninPayload = z.infer<typeof signinPayloadSchema>;
|
|
|
31
35
|
export type SessionPayload = z.infer<typeof sessionPayloadSchema>;
|
|
32
36
|
declare const employeeSafeSchema: z.ZodObject<{
|
|
33
37
|
id: z.ZodInt;
|
|
34
|
-
email: z.ZodString;
|
|
35
|
-
fullName: z.ZodString;
|
|
36
38
|
status: z.ZodEnum<{
|
|
37
39
|
active: "active";
|
|
38
40
|
suspended: "suspended";
|
|
39
41
|
}>;
|
|
40
42
|
updatedAt: z.ZodNullable<z.ZodDate>;
|
|
41
43
|
createdAt: z.ZodDate;
|
|
44
|
+
email: z.ZodString;
|
|
45
|
+
fullName: z.ZodString;
|
|
42
46
|
grants: z.ZodArray<z.ZodEnum<{
|
|
43
47
|
"employee.create": "employee.create";
|
|
44
48
|
"employee.read": "employee.read";
|
|
45
49
|
"employee.update": "employee.update";
|
|
50
|
+
"inventory.create": "inventory.create";
|
|
51
|
+
"inventory.read": "inventory.read";
|
|
52
|
+
"inventory.update": "inventory.update";
|
|
53
|
+
"inventory.write_off": "inventory.write_off";
|
|
46
54
|
}>>;
|
|
47
55
|
}, {
|
|
48
56
|
out: {};
|
|
49
57
|
in: {};
|
|
50
58
|
}>;
|
|
51
|
-
declare const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
declare const employeeSearchPayloadSchema: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
where: z.ZodObject<{
|
|
61
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
62
|
+
active: "active";
|
|
63
|
+
suspended: "suspended";
|
|
64
|
+
}>>;
|
|
65
|
+
}, {
|
|
66
|
+
out: {};
|
|
67
|
+
in: {};
|
|
68
|
+
}>;
|
|
56
69
|
}, z.core.$strict>>;
|
|
57
70
|
declare const employeeCreatePayloadSchema: z.ZodObject<{
|
|
58
71
|
email: z.ZodString;
|
|
@@ -62,6 +75,10 @@ declare const employeeCreatePayloadSchema: z.ZodObject<{
|
|
|
62
75
|
"employee.create": "employee.create";
|
|
63
76
|
"employee.read": "employee.read";
|
|
64
77
|
"employee.update": "employee.update";
|
|
78
|
+
"inventory.create": "inventory.create";
|
|
79
|
+
"inventory.read": "inventory.read";
|
|
80
|
+
"inventory.update": "inventory.update";
|
|
81
|
+
"inventory.write_off": "inventory.write_off";
|
|
65
82
|
}>>;
|
|
66
83
|
}, z.core.$strict>;
|
|
67
84
|
declare const employeeSwitchStatusPayloadSchema: z.ZodObject<{
|
|
@@ -81,10 +98,14 @@ declare const employeeUpdateGrantsPayloadSchema: z.ZodObject<{
|
|
|
81
98
|
"employee.create": "employee.create";
|
|
82
99
|
"employee.read": "employee.read";
|
|
83
100
|
"employee.update": "employee.update";
|
|
101
|
+
"inventory.create": "inventory.create";
|
|
102
|
+
"inventory.read": "inventory.read";
|
|
103
|
+
"inventory.update": "inventory.update";
|
|
104
|
+
"inventory.write_off": "inventory.write_off";
|
|
84
105
|
}>>;
|
|
85
106
|
}, z.core.$strict>;
|
|
86
107
|
export type EmployeeSafe = z.infer<typeof employeeSafeSchema>;
|
|
87
|
-
export type
|
|
108
|
+
export type EmployeeSearchPayload = z.infer<typeof employeeSearchPayloadSchema>;
|
|
88
109
|
export type EmployeeCreatePayload = z.infer<typeof employeeCreatePayloadSchema>;
|
|
89
110
|
export type EmployeeSwitchStatusPayload = z.infer<typeof employeeSwitchStatusPayloadSchema>;
|
|
90
111
|
export type EmployeeUpdatePasswordPayload = z.infer<typeof employeeUpdatePasswordPayloadSchema>;
|