@esb-market-contracts/admin-backend 1.2.10 → 1.3.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 CHANGED
@@ -14,7 +14,6 @@ declare const authRouter: import("hono/hono-base").HonoBase<import("hono/types")
14
14
  status: "active" | "inactive" | "suspended";
15
15
  lastLoginAt: string | null;
16
16
  };
17
- permissions: string[];
18
17
  };
19
18
  }>;
20
19
  outputFormat: "json";
@@ -50,5 +49,71 @@ declare const authRouter: import("hono/hono-base").HonoBase<import("hono/types")
50
49
  };
51
50
  }, "/iam/authentication", "/iam/authentication/logout">;
52
51
  export type AuthRouter = typeof authRouter;
52
+ declare const employeesRouter: import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, {
53
+ "/iam/employees/table-metadata": {
54
+ $get: {
55
+ input: {};
56
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
57
+ filters: {
58
+ statuses: {
59
+ label: string;
60
+ value: string;
61
+ }[];
62
+ roles: {
63
+ label: string;
64
+ value: string;
65
+ }[];
66
+ };
67
+ sorting: {
68
+ fields: {
69
+ label: string;
70
+ value: string;
71
+ }[];
72
+ default: {
73
+ field: string;
74
+ direction: "desc" | "asc";
75
+ };
76
+ };
77
+ pagination: {
78
+ defaultLimit: number;
79
+ availableLimits: number[];
80
+ };
81
+ }>;
82
+ outputFormat: "json";
83
+ status: 200;
84
+ };
85
+ };
86
+ } & {
87
+ "/iam/employees": {
88
+ $get: {
89
+ input: {};
90
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
91
+ items: {
92
+ id: number;
93
+ email: string;
94
+ fullName: string;
95
+ status: "active" | "inactive" | "suspended";
96
+ lastLoginAt: string | null;
97
+ updatedAt: string;
98
+ createdAt: string;
99
+ roles: {
100
+ id: number;
101
+ name: string;
102
+ code: string;
103
+ }[];
104
+ }[];
105
+ meta: {
106
+ page: number;
107
+ limit: number;
108
+ total: number;
109
+ totalPages: number;
110
+ };
111
+ }>;
112
+ outputFormat: "json";
113
+ status: 200;
114
+ };
115
+ };
116
+ }, "/iam/employees", "/iam/employees">;
117
+ export type EmployeesRouter = typeof employeesRouter;
53
118
 
54
119
  export {};
package/enums.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ export declare const PBACPermissionsRecord: {
4
+ "ORDERS.CREATE": "orders.create";
5
+ "ORDERS.READ": "orders.read";
6
+ "ORDERS.UPDATE": "orders.update";
7
+ "ORDERS.DELETE": "orders.delete";
8
+ };
9
+
10
+ export {};
package/enums.js ADDED
@@ -0,0 +1,12 @@
1
+ // @bun
2
+ // src/utilities/enum.utils.ts
3
+ function createStringEnumObject(values) {
4
+ return Object.fromEntries(values.map((value) => [value.toUpperCase(), value]));
5
+ }
6
+
7
+ // src/app/domain/(iam)/permissions/permissions.enums.ts
8
+ var PBACPermissions = ["orders.create", "orders.read", "orders.update", "orders.delete"];
9
+ var PBACPermissionsRecord = createStringEnumObject(PBACPermissions);
10
+ export {
11
+ PBACPermissionsRecord
12
+ };
package/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export type * from './api';
2
- export type * from './types';
2
+ export type * from './types';
3
+ export type * from './enums';
package/index.js CHANGED
@@ -1 +1 @@
1
- export {};
1
+ export * from './enums.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@esb-market-contracts/admin-backend",
3
3
  "description": "Shared TypeScript contract definitions for admin-backend.",
4
- "version": "1.2.10",
4
+ "version": "1.3.0",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "sideEffects": false,
@@ -11,7 +11,9 @@
11
11
  "api.d.ts",
12
12
  "api.js",
13
13
  "types.d.ts",
14
- "types.js"
14
+ "types.js",
15
+ "enums.d.ts",
16
+ "enums.js"
15
17
  ],
16
18
  "exports": {
17
19
  ".": {
@@ -25,6 +27,10 @@
25
27
  "./types": {
26
28
  "types": "./types.d.ts",
27
29
  "default": "./types.js"
30
+ },
31
+ "./enums": {
32
+ "types": "./enums.d.ts",
33
+ "default": "./enums.js"
28
34
  }
29
35
  },
30
36
  "types": "./index.d.ts"
package/types.d.ts CHANGED
@@ -24,7 +24,6 @@ declare const AuthSessionSchema: z.ZodObject<{
24
24
  out: {};
25
25
  in: {};
26
26
  }>;
27
- permissions: z.ZodArray<z.ZodString>;
28
27
  }, {
29
28
  out: {};
30
29
  in: {};
@@ -36,5 +35,109 @@ export type AuthSessionResponse = SerializeDates<AuthSession>;
36
35
  export type AuthClientSession = AuthSession;
37
36
  export type AuthLogoutRequest = Record<string, never>;
38
37
  export type AuthLogoutResponse = Record<string, never>;
38
+ declare const EmployeeSchema: z.ZodObject<{
39
+ id: z.ZodInt;
40
+ email: z.ZodString;
41
+ fullName: z.ZodString;
42
+ status: z.ZodEnum<{
43
+ active: "active";
44
+ inactive: "inactive";
45
+ suspended: "suspended";
46
+ }>;
47
+ lastLoginAt: z.ZodNullable<z.ZodDate>;
48
+ updatedAt: z.ZodDate;
49
+ createdAt: z.ZodDate;
50
+ roles: z.ZodArray<z.ZodObject<{
51
+ id: z.ZodInt;
52
+ name: z.ZodString;
53
+ code: z.ZodString;
54
+ }, {
55
+ out: {};
56
+ in: {};
57
+ }>>;
58
+ }, {
59
+ out: {};
60
+ in: {};
61
+ }>;
62
+ export type Employee = z.infer<typeof EmployeeSchema>;
63
+ declare const EmployeeListResultSchema: z.ZodObject<{
64
+ items: z.ZodArray<z.ZodObject<{
65
+ id: z.ZodInt;
66
+ email: z.ZodString;
67
+ fullName: z.ZodString;
68
+ status: z.ZodEnum<{
69
+ active: "active";
70
+ inactive: "inactive";
71
+ suspended: "suspended";
72
+ }>;
73
+ lastLoginAt: z.ZodNullable<z.ZodDate>;
74
+ updatedAt: z.ZodDate;
75
+ createdAt: z.ZodDate;
76
+ roles: z.ZodArray<z.ZodObject<{
77
+ id: z.ZodInt;
78
+ name: z.ZodString;
79
+ code: z.ZodString;
80
+ }, {
81
+ out: {};
82
+ in: {};
83
+ }>>;
84
+ }, {
85
+ out: {};
86
+ in: {};
87
+ }>>;
88
+ meta: z.ZodObject<{
89
+ page: z.ZodNumber;
90
+ limit: z.ZodNumber;
91
+ total: z.ZodNumber;
92
+ totalPages: z.ZodNumber;
93
+ }, z.core.$strip>;
94
+ }, z.core.$strip>;
95
+ export type EmployeeListResult = z.infer<typeof EmployeeListResultSchema>;
96
+ declare const EmployeesQuerySchema: z.ZodObject<{
97
+ page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
98
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown> & z.ZodType<100 | 10 | 20 | 50, unknown, z.core.$ZodTypeInternals<100 | 10 | 20 | 50, unknown>>>;
99
+ sort: z.ZodOptional<z.ZodString>;
100
+ status: z.ZodOptional<z.ZodArray<z.ZodEnum<{
101
+ active: "active";
102
+ inactive: "inactive";
103
+ suspended: "suspended";
104
+ }>>>;
105
+ role: z.ZodOptional<z.ZodArray<z.ZodString>>;
106
+ search: z.ZodOptional<z.ZodString>;
107
+ }, z.core.$strip>;
108
+ export type EmployeesQuery = z.infer<typeof EmployeesQuerySchema>;
109
+ declare const EmployeesTableMetadataSchema: z.ZodObject<{
110
+ filters: z.ZodObject<{
111
+ statuses: z.ZodArray<z.ZodObject<{
112
+ label: z.ZodString;
113
+ value: z.ZodString;
114
+ }, z.core.$strip>>;
115
+ roles: z.ZodArray<z.ZodObject<{
116
+ label: z.ZodString;
117
+ value: z.ZodString;
118
+ }, z.core.$strip>>;
119
+ }, z.core.$strip>;
120
+ sorting: z.ZodObject<{
121
+ fields: z.ZodArray<z.ZodObject<{
122
+ label: z.ZodString;
123
+ value: z.ZodString;
124
+ }, z.core.$strip>>;
125
+ default: z.ZodObject<{
126
+ field: z.ZodString;
127
+ direction: z.ZodEnum<{
128
+ asc: "asc";
129
+ desc: "desc";
130
+ }>;
131
+ }, z.core.$strip>;
132
+ }, z.core.$strip>;
133
+ pagination: z.ZodObject<{
134
+ defaultLimit: z.ZodNumber;
135
+ availableLimits: z.ZodArray<z.ZodNumber>;
136
+ }, z.core.$strip>;
137
+ }, z.core.$strip>;
138
+ export type EmployeesTableMetadata = z.infer<typeof EmployeesTableMetadataSchema>;
139
+ export type EmployeesListRequest = EmployeesQuery;
140
+ export type EmployeesListResponse = SerializeDates<EmployeeListResult>;
141
+ export type EmployeesTableMetadataResponse = EmployeesTableMetadata;
39
142
 
40
143
  export {};