@esb-market-contracts/admin-backend 1.3.0 → 1.4.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
@@ -1,36 +1,22 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
- declare const authRouter: import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, {
4
- "/iam/authentication/session": {
5
- $get: {
3
+ declare const authRouter: import("hono/hono-base").HonoBase<{}, {
4
+ "/iam/authentication/authorize": {
5
+ $post: {
6
6
  input: {};
7
7
  output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
8
- session: {
9
- expiresAt: string;
10
- user: {
11
- id: number;
12
- email: string;
13
- fullName: string;
14
- status: "active" | "inactive" | "suspended";
15
- lastLoginAt: string | null;
16
- };
17
- };
8
+ [x: string]: never;
18
9
  }>;
19
10
  outputFormat: "json";
20
11
  status: 200;
21
12
  };
22
13
  };
23
14
  } & {
24
- "/iam/authentication/login": {
15
+ "/iam/authentication/refresh": {
25
16
  $post: {
26
- input: {
27
- json: {
28
- email: string;
29
- password: string;
30
- };
31
- };
17
+ input: {};
32
18
  output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
33
- [x: string]: never;
19
+ accessToken: string;
34
20
  }>;
35
21
  outputFormat: "json";
36
22
  status: 200;
@@ -49,71 +35,5 @@ declare const authRouter: import("hono/hono-base").HonoBase<import("hono/types")
49
35
  };
50
36
  }, "/iam/authentication", "/iam/authentication/logout">;
51
37
  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;
118
38
 
119
39
  export {};
package/enums.d.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
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";
3
+ export declare const PBACPermissions: {
4
+ "EMPLOYEE.CREATE": "employee.create";
5
+ "EMPLOYEE.READ": "employee.read";
6
+ "EMPLOYEE.UPDATE": "employee.update";
8
7
  };
9
8
 
10
9
  export {};
package/enums.js CHANGED
@@ -1,12 +1,12 @@
1
1
  // @bun
2
- // src/utilities/enum.utils.ts
3
- function createStringEnumObject(values) {
2
+ // src/utilities/enums.utilities.ts
3
+ function createStringEnumRecord(values) {
4
4
  return Object.fromEntries(values.map((value) => [value.toUpperCase(), value]));
5
5
  }
6
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);
7
+ // src/app/domain/(iam)/employees-permissions/employees-permissions.enums.ts
8
+ var PBACPermissionItems = ["employee.create", "employee.read", "employee.update"];
9
+ var PBACPermissions = createStringEnumRecord(PBACPermissionItems);
10
10
  export {
11
- PBACPermissionsRecord
11
+ PBACPermissions
12
12
  };
package/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
1
  export type * from './api';
2
- export type * from './types';
3
- export type * from './enums';
2
+ export type * from './enums';
3
+ export type * from './schemas';
4
+ export * from './enums';
5
+ export * from './schemas';
package/index.js CHANGED
@@ -1 +1,2 @@
1
- export * from './enums.js';
1
+ export * from './enums.js';
2
+ export * from './schemas.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.3.0",
4
+ "version": "1.4.0",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "sideEffects": false,
@@ -10,10 +10,10 @@
10
10
  "index.js",
11
11
  "api.d.ts",
12
12
  "api.js",
13
- "types.d.ts",
14
- "types.js",
15
13
  "enums.d.ts",
16
- "enums.js"
14
+ "enums.js",
15
+ "schemas.d.ts",
16
+ "schemas.js"
17
17
  ],
18
18
  "exports": {
19
19
  ".": {
@@ -24,13 +24,13 @@
24
24
  "types": "./api.d.ts",
25
25
  "default": "./api.js"
26
26
  },
27
- "./types": {
28
- "types": "./types.d.ts",
29
- "default": "./types.js"
30
- },
31
27
  "./enums": {
32
28
  "types": "./enums.d.ts",
33
29
  "default": "./enums.js"
30
+ },
31
+ "./schemas": {
32
+ "types": "./schemas.d.ts",
33
+ "default": "./schemas.js"
34
34
  }
35
35
  },
36
36
  "types": "./index.d.ts"
package/schemas.d.ts ADDED
@@ -0,0 +1,23 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ import { z } from 'zod';
4
+
5
+ /** Schema for the payload of an authentication token. */
6
+ export declare const authPayloadSchema: z.ZodObject<{
7
+ employee: z.ZodObject<{
8
+ id: z.ZodInt;
9
+ email: z.ZodString;
10
+ fullName: z.ZodString;
11
+ }, {
12
+ out: {};
13
+ in: {};
14
+ }>;
15
+ permissions: z.ZodArray<z.ZodEnum<{
16
+ "employee.create": "employee.create";
17
+ "employee.read": "employee.read";
18
+ "employee.update": "employee.update";
19
+ }>>;
20
+ }, z.core.$strip>;
21
+ export type AuthPayload = z.infer<typeof authPayloadSchema>;
22
+
23
+ export {};