@forklaunch/implementation-iam-base 0.1.11 → 0.1.13
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/lib/__test__/schemaEquality.test.d.ts +1 -1
- package/lib/__test__/schemaEquality.test.js +135 -235
- package/lib/jest.config.d.ts +1 -1
- package/lib/jest.config.js +16 -16
- package/lib/schemas/index.d.ts +1 -1
- package/lib/schemas/organization.schema.d.ts +146 -357
- package/lib/schemas/organization.schema.js +1 -4
- package/lib/schemas/permission.schema.d.ts +34 -88
- package/lib/schemas/permission.schema.js +1 -4
- package/lib/schemas/role.schema.d.ts +48 -137
- package/lib/schemas/role.schema.js +1 -4
- package/lib/schemas/typebox/organization.schema.d.ts +103 -405
- package/lib/schemas/typebox/organization.schema.js +17 -27
- package/lib/schemas/typebox/permission.schema.d.ts +38 -122
- package/lib/schemas/typebox/permission.schema.js +17 -24
- package/lib/schemas/typebox/role.schema.d.ts +50 -190
- package/lib/schemas/typebox/role.schema.js +17 -24
- package/lib/schemas/typebox/user.schema.d.ts +94 -330
- package/lib/schemas/typebox/user.schema.js +32 -40
- package/lib/schemas/user.schema.d.ts +114 -260
- package/lib/schemas/user.schema.js +1 -4
- package/lib/schemas/zod/organization.schema.d.ts +211 -301
- package/lib/schemas/zod/organization.schema.js +17 -27
- package/lib/schemas/zod/permission.schema.d.ts +38 -54
- package/lib/schemas/zod/permission.schema.js +17 -24
- package/lib/schemas/zod/role.schema.d.ts +64 -94
- package/lib/schemas/zod/role.schema.js +17 -24
- package/lib/schemas/zod/user.schema.d.ts +138 -184
- package/lib/schemas/zod/user.schema.js +32 -40
- package/lib/services/index.d.ts +1 -1
- package/lib/services/organization.service.d.ts +33 -106
- package/lib/services/organization.service.js +32 -47
- package/lib/services/permission.service.d.ts +41 -117
- package/lib/services/permission.service.js +149 -193
- package/lib/services/role.service.d.ts +35 -104
- package/lib/services/role.service.js +54 -70
- package/lib/services/user.service.d.ts +37 -121
- package/lib/services/user.service.js +80 -121
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/vitest.config.d.ts +2 -2
- package/lib/vitest.config.js +4 -4
- package/package.json +5 -5
|
@@ -1,225 +1,179 @@
|
|
|
1
1
|
export declare const CreateUserSchema: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
email: import("zod").ZodString;
|
|
3
|
+
password: import("zod").ZodString;
|
|
4
|
+
firstName: import("zod").ZodString;
|
|
5
|
+
lastName: import("zod").ZodString;
|
|
6
|
+
organizationId: import("zod").ZodString;
|
|
7
|
+
roleIds: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
8
|
+
phoneNumber: import("zod").ZodOptional<import("zod").ZodString>;
|
|
9
|
+
subscription: import("zod").ZodOptional<import("zod").ZodString>;
|
|
10
|
+
extraFields: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
11
11
|
};
|
|
12
|
-
export declare const UpdateUserSchema: ({
|
|
13
|
-
|
|
14
|
-
}: {
|
|
15
|
-
uuidId: boolean;
|
|
12
|
+
export declare const UpdateUserSchema: ({ uuidId }: {
|
|
13
|
+
uuidId: boolean;
|
|
16
14
|
}) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
import(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
subscription: import('zod').ZodOptional<import('zod').ZodString>;
|
|
27
|
-
extraFields: import('zod').ZodOptional<import('zod').ZodUnknown>;
|
|
15
|
+
id: import("zod").ZodString;
|
|
16
|
+
email: import("zod").ZodOptional<import("zod").ZodString>;
|
|
17
|
+
password: import("zod").ZodOptional<import("zod").ZodString>;
|
|
18
|
+
firstName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
19
|
+
lastName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
20
|
+
roleIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
21
|
+
phoneNumber: import("zod").ZodOptional<import("zod").ZodString>;
|
|
22
|
+
subscription: import("zod").ZodOptional<import("zod").ZodString>;
|
|
23
|
+
extraFields: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
28
24
|
};
|
|
29
|
-
export declare const UserSchema: ({
|
|
30
|
-
|
|
31
|
-
}: {
|
|
32
|
-
uuidId: boolean;
|
|
25
|
+
export declare const UserSchema: ({ uuidId }: {
|
|
26
|
+
uuidId: boolean;
|
|
33
27
|
}) => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
extraFields?: unknown;
|
|
65
|
-
createdAt?: Date | undefined;
|
|
66
|
-
updatedAt?: Date | undefined;
|
|
67
|
-
}
|
|
68
|
-
>,
|
|
69
|
-
'many'
|
|
70
|
-
>;
|
|
71
|
-
extraFields: import('zod').ZodOptional<import('zod').ZodUnknown>;
|
|
72
|
-
createdAt: import('zod').ZodOptional<import('zod').ZodDate>;
|
|
73
|
-
updatedAt: import('zod').ZodOptional<import('zod').ZodDate>;
|
|
74
|
-
},
|
|
75
|
-
import('zod').UnknownKeysParam,
|
|
76
|
-
import('zod').ZodTypeAny,
|
|
77
|
-
{
|
|
28
|
+
id: import("zod").ZodString;
|
|
29
|
+
email: import("zod").ZodString;
|
|
30
|
+
firstName: import("zod").ZodString;
|
|
31
|
+
lastName: import("zod").ZodString;
|
|
32
|
+
roles: import("zod").ZodArray<import("zod").ZodObject<{
|
|
33
|
+
id: import("zod").ZodString;
|
|
34
|
+
name: import("zod").ZodString;
|
|
35
|
+
permissions: import("zod").ZodArray<import("zod").ZodObject<{
|
|
36
|
+
id: import("zod").ZodString;
|
|
37
|
+
slug: import("zod").ZodString;
|
|
38
|
+
extraFields: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
39
|
+
createdAt: import("zod").ZodOptional<import("zod").ZodDate>;
|
|
40
|
+
updatedAt: import("zod").ZodOptional<import("zod").ZodDate>;
|
|
41
|
+
}, import("zod").UnknownKeysParam, import("zod").ZodTypeAny, {
|
|
42
|
+
id: string;
|
|
43
|
+
slug: string;
|
|
44
|
+
extraFields?: unknown;
|
|
45
|
+
createdAt?: Date | undefined;
|
|
46
|
+
updatedAt?: Date | undefined;
|
|
47
|
+
}, {
|
|
48
|
+
id: string;
|
|
49
|
+
slug: string;
|
|
50
|
+
extraFields?: unknown;
|
|
51
|
+
createdAt?: Date | undefined;
|
|
52
|
+
updatedAt?: Date | undefined;
|
|
53
|
+
}>, "many">;
|
|
54
|
+
extraFields: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
55
|
+
createdAt: import("zod").ZodOptional<import("zod").ZodDate>;
|
|
56
|
+
updatedAt: import("zod").ZodOptional<import("zod").ZodDate>;
|
|
57
|
+
}, import("zod").UnknownKeysParam, import("zod").ZodTypeAny, {
|
|
78
58
|
id: string;
|
|
79
59
|
name: string;
|
|
80
60
|
permissions: {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
61
|
+
id: string;
|
|
62
|
+
slug: string;
|
|
63
|
+
extraFields?: unknown;
|
|
64
|
+
createdAt?: Date | undefined;
|
|
65
|
+
updatedAt?: Date | undefined;
|
|
86
66
|
}[];
|
|
87
67
|
extraFields?: unknown;
|
|
88
68
|
createdAt?: Date | undefined;
|
|
89
69
|
updatedAt?: Date | undefined;
|
|
90
|
-
|
|
91
|
-
{
|
|
70
|
+
}, {
|
|
92
71
|
id: string;
|
|
93
72
|
name: string;
|
|
94
73
|
permissions: {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
74
|
+
id: string;
|
|
75
|
+
slug: string;
|
|
76
|
+
extraFields?: unknown;
|
|
77
|
+
createdAt?: Date | undefined;
|
|
78
|
+
updatedAt?: Date | undefined;
|
|
100
79
|
}[];
|
|
101
80
|
extraFields?: unknown;
|
|
102
81
|
createdAt?: Date | undefined;
|
|
103
82
|
updatedAt?: Date | undefined;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
extraFields: import('zod').ZodOptional<import('zod').ZodUnknown>;
|
|
111
|
-
createdAt: import('zod').ZodOptional<import('zod').ZodDate>;
|
|
112
|
-
updatedAt: import('zod').ZodOptional<import('zod').ZodDate>;
|
|
83
|
+
}>, "many">;
|
|
84
|
+
phoneNumber: import("zod").ZodOptional<import("zod").ZodString>;
|
|
85
|
+
subscription: import("zod").ZodOptional<import("zod").ZodString>;
|
|
86
|
+
extraFields: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
87
|
+
createdAt: import("zod").ZodOptional<import("zod").ZodDate>;
|
|
88
|
+
updatedAt: import("zod").ZodOptional<import("zod").ZodDate>;
|
|
113
89
|
};
|
|
114
90
|
export declare const BaseUserServiceSchemas: (options: {
|
|
115
|
-
|
|
91
|
+
uuidId: boolean;
|
|
116
92
|
}) => {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
id: import('zod').ZodString;
|
|
155
|
-
slug: import('zod').ZodString;
|
|
156
|
-
extraFields: import('zod').ZodOptional<
|
|
157
|
-
import('zod').ZodUnknown
|
|
158
|
-
>;
|
|
159
|
-
createdAt: import('zod').ZodOptional<import('zod').ZodDate>;
|
|
160
|
-
updatedAt: import('zod').ZodOptional<import('zod').ZodDate>;
|
|
161
|
-
},
|
|
162
|
-
import('zod').UnknownKeysParam,
|
|
163
|
-
import('zod').ZodTypeAny,
|
|
164
|
-
{
|
|
93
|
+
CreateUserSchema: {
|
|
94
|
+
email: import("zod").ZodString;
|
|
95
|
+
password: import("zod").ZodString;
|
|
96
|
+
firstName: import("zod").ZodString;
|
|
97
|
+
lastName: import("zod").ZodString;
|
|
98
|
+
organizationId: import("zod").ZodString;
|
|
99
|
+
roleIds: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
100
|
+
phoneNumber: import("zod").ZodOptional<import("zod").ZodString>;
|
|
101
|
+
subscription: import("zod").ZodOptional<import("zod").ZodString>;
|
|
102
|
+
extraFields: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
103
|
+
};
|
|
104
|
+
UpdateUserSchema: {
|
|
105
|
+
id: import("zod").ZodString;
|
|
106
|
+
email: import("zod").ZodOptional<import("zod").ZodString>;
|
|
107
|
+
password: import("zod").ZodOptional<import("zod").ZodString>;
|
|
108
|
+
firstName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
109
|
+
lastName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
110
|
+
roleIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
111
|
+
phoneNumber: import("zod").ZodOptional<import("zod").ZodString>;
|
|
112
|
+
subscription: import("zod").ZodOptional<import("zod").ZodString>;
|
|
113
|
+
extraFields: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
114
|
+
};
|
|
115
|
+
UserSchema: {
|
|
116
|
+
id: import("zod").ZodString;
|
|
117
|
+
email: import("zod").ZodString;
|
|
118
|
+
firstName: import("zod").ZodString;
|
|
119
|
+
lastName: import("zod").ZodString;
|
|
120
|
+
roles: import("zod").ZodArray<import("zod").ZodObject<{
|
|
121
|
+
id: import("zod").ZodString;
|
|
122
|
+
name: import("zod").ZodString;
|
|
123
|
+
permissions: import("zod").ZodArray<import("zod").ZodObject<{
|
|
124
|
+
id: import("zod").ZodString;
|
|
125
|
+
slug: import("zod").ZodString;
|
|
126
|
+
extraFields: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
127
|
+
createdAt: import("zod").ZodOptional<import("zod").ZodDate>;
|
|
128
|
+
updatedAt: import("zod").ZodOptional<import("zod").ZodDate>;
|
|
129
|
+
}, import("zod").UnknownKeysParam, import("zod").ZodTypeAny, {
|
|
165
130
|
id: string;
|
|
166
131
|
slug: string;
|
|
167
132
|
extraFields?: unknown;
|
|
168
133
|
createdAt?: Date | undefined;
|
|
169
134
|
updatedAt?: Date | undefined;
|
|
170
|
-
|
|
171
|
-
{
|
|
135
|
+
}, {
|
|
172
136
|
id: string;
|
|
173
137
|
slug: string;
|
|
174
138
|
extraFields?: unknown;
|
|
175
139
|
createdAt?: Date | undefined;
|
|
176
140
|
updatedAt?: Date | undefined;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
createdAt: import('zod').ZodOptional<import('zod').ZodDate>;
|
|
183
|
-
updatedAt: import('zod').ZodOptional<import('zod').ZodDate>;
|
|
184
|
-
},
|
|
185
|
-
import('zod').UnknownKeysParam,
|
|
186
|
-
import('zod').ZodTypeAny,
|
|
187
|
-
{
|
|
188
|
-
id: string;
|
|
189
|
-
name: string;
|
|
190
|
-
permissions: {
|
|
141
|
+
}>, "many">;
|
|
142
|
+
extraFields: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
143
|
+
createdAt: import("zod").ZodOptional<import("zod").ZodDate>;
|
|
144
|
+
updatedAt: import("zod").ZodOptional<import("zod").ZodDate>;
|
|
145
|
+
}, import("zod").UnknownKeysParam, import("zod").ZodTypeAny, {
|
|
191
146
|
id: string;
|
|
192
|
-
|
|
147
|
+
name: string;
|
|
148
|
+
permissions: {
|
|
149
|
+
id: string;
|
|
150
|
+
slug: string;
|
|
151
|
+
extraFields?: unknown;
|
|
152
|
+
createdAt?: Date | undefined;
|
|
153
|
+
updatedAt?: Date | undefined;
|
|
154
|
+
}[];
|
|
193
155
|
extraFields?: unknown;
|
|
194
156
|
createdAt?: Date | undefined;
|
|
195
157
|
updatedAt?: Date | undefined;
|
|
196
|
-
|
|
197
|
-
extraFields?: unknown;
|
|
198
|
-
createdAt?: Date | undefined;
|
|
199
|
-
updatedAt?: Date | undefined;
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
id: string;
|
|
203
|
-
name: string;
|
|
204
|
-
permissions: {
|
|
158
|
+
}, {
|
|
205
159
|
id: string;
|
|
206
|
-
|
|
160
|
+
name: string;
|
|
161
|
+
permissions: {
|
|
162
|
+
id: string;
|
|
163
|
+
slug: string;
|
|
164
|
+
extraFields?: unknown;
|
|
165
|
+
createdAt?: Date | undefined;
|
|
166
|
+
updatedAt?: Date | undefined;
|
|
167
|
+
}[];
|
|
207
168
|
extraFields?: unknown;
|
|
208
169
|
createdAt?: Date | undefined;
|
|
209
170
|
updatedAt?: Date | undefined;
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
>;
|
|
218
|
-
phoneNumber: import('zod').ZodOptional<import('zod').ZodString>;
|
|
219
|
-
subscription: import('zod').ZodOptional<import('zod').ZodString>;
|
|
220
|
-
extraFields: import('zod').ZodOptional<import('zod').ZodUnknown>;
|
|
221
|
-
createdAt: import('zod').ZodOptional<import('zod').ZodDate>;
|
|
222
|
-
updatedAt: import('zod').ZodOptional<import('zod').ZodDate>;
|
|
223
|
-
};
|
|
171
|
+
}>, "many">;
|
|
172
|
+
phoneNumber: import("zod").ZodOptional<import("zod").ZodString>;
|
|
173
|
+
subscription: import("zod").ZodOptional<import("zod").ZodString>;
|
|
174
|
+
extraFields: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
175
|
+
createdAt: import("zod").ZodOptional<import("zod").ZodDate>;
|
|
176
|
+
updatedAt: import("zod").ZodOptional<import("zod").ZodDate>;
|
|
177
|
+
};
|
|
224
178
|
};
|
|
225
|
-
//# sourceMappingURL=user.schema.d.ts.map
|
|
179
|
+
//# sourceMappingURL=user.schema.d.ts.map
|
|
@@ -1,49 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
array,
|
|
3
|
-
date,
|
|
4
|
-
email,
|
|
5
|
-
optional,
|
|
6
|
-
string,
|
|
7
|
-
unknown,
|
|
8
|
-
uuid
|
|
9
|
-
} from '@forklaunch/validator/zod';
|
|
1
|
+
import { array, date, email, optional, string, unknown, uuid } from '@forklaunch/validator/zod';
|
|
10
2
|
import { RoleSchema } from './role.schema';
|
|
11
3
|
export const CreateUserSchema = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
email: email,
|
|
5
|
+
password: string,
|
|
6
|
+
firstName: string,
|
|
7
|
+
lastName: string,
|
|
8
|
+
organizationId: string,
|
|
9
|
+
roleIds: array(string),
|
|
10
|
+
phoneNumber: optional(string),
|
|
11
|
+
subscription: optional(string),
|
|
12
|
+
extraFields: optional(unknown)
|
|
21
13
|
};
|
|
22
14
|
export const UpdateUserSchema = ({ uuidId }) => ({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
15
|
+
id: uuidId ? uuid : string,
|
|
16
|
+
email: optional(email),
|
|
17
|
+
password: optional(string),
|
|
18
|
+
firstName: optional(string),
|
|
19
|
+
lastName: optional(string),
|
|
20
|
+
roleIds: optional(array(string)),
|
|
21
|
+
phoneNumber: optional(string),
|
|
22
|
+
subscription: optional(string),
|
|
23
|
+
extraFields: optional(unknown)
|
|
32
24
|
});
|
|
33
25
|
export const UserSchema = ({ uuidId }) => ({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
26
|
+
id: uuidId ? uuid : string,
|
|
27
|
+
email: email,
|
|
28
|
+
firstName: string,
|
|
29
|
+
lastName: string,
|
|
30
|
+
roles: array(RoleSchema({ uuidId })),
|
|
31
|
+
phoneNumber: optional(string),
|
|
32
|
+
subscription: optional(string),
|
|
33
|
+
extraFields: optional(unknown),
|
|
34
|
+
createdAt: optional(date),
|
|
35
|
+
updatedAt: optional(date)
|
|
44
36
|
});
|
|
45
37
|
export const BaseUserServiceSchemas = (options) => ({
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
CreateUserSchema,
|
|
39
|
+
UpdateUserSchema: UpdateUserSchema(options),
|
|
40
|
+
UserSchema: UserSchema(options)
|
|
49
41
|
});
|
package/lib/services/index.d.ts
CHANGED
|
@@ -1,118 +1,45 @@
|
|
|
1
1
|
import { IdDto } from '@forklaunch/common';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
ResponseDtoMapperConstructor
|
|
5
|
-
} from '@forklaunch/core/mappers';
|
|
6
|
-
import {
|
|
7
|
-
MetricsDefinition,
|
|
8
|
-
OpenTelemetryCollector
|
|
9
|
-
} from '@forklaunch/core/http';
|
|
2
|
+
import { RequestDtoMapperConstructor, ResponseDtoMapperConstructor } from '@forklaunch/core/mappers';
|
|
3
|
+
import { MetricsDefinition, OpenTelemetryCollector } from '@forklaunch/core/http';
|
|
10
4
|
import { MapNestedDtoArraysToCollections } from '@forklaunch/core/services';
|
|
11
5
|
import { OrganizationService } from '@forklaunch/interfaces-iam/interfaces';
|
|
12
|
-
import {
|
|
13
|
-
CreateOrganizationDto,
|
|
14
|
-
OrganizationDto,
|
|
15
|
-
UpdateOrganizationDto
|
|
16
|
-
} from '@forklaunch/interfaces-iam/types';
|
|
6
|
+
import { CreateOrganizationDto, OrganizationDto, UpdateOrganizationDto } from '@forklaunch/interfaces-iam/types';
|
|
17
7
|
import { AnySchemaValidator } from '@forklaunch/validator';
|
|
18
8
|
import { EntityManager } from '@mikro-orm/core';
|
|
19
|
-
export declare class BaseOrganizationService<
|
|
20
|
-
SchemaValidator extends AnySchemaValidator,
|
|
21
|
-
OrganizationStatus,
|
|
22
|
-
Metrics extends MetricsDefinition = MetricsDefinition,
|
|
23
|
-
Dto extends {
|
|
9
|
+
export declare class BaseOrganizationService<SchemaValidator extends AnySchemaValidator, OrganizationStatus, Metrics extends MetricsDefinition = MetricsDefinition, Dto extends {
|
|
24
10
|
OrganizationDtoMapper: OrganizationDto<OrganizationStatus>;
|
|
25
11
|
CreateOrganizationDtoMapper: CreateOrganizationDto;
|
|
26
12
|
UpdateOrganizationDtoMapper: UpdateOrganizationDto;
|
|
27
|
-
|
|
13
|
+
} = {
|
|
28
14
|
OrganizationDtoMapper: OrganizationDto<OrganizationStatus>;
|
|
29
15
|
CreateOrganizationDtoMapper: CreateOrganizationDto;
|
|
30
16
|
UpdateOrganizationDtoMapper: UpdateOrganizationDto;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
>;
|
|
37
|
-
CreateOrganizationDtoMapper: MapNestedDtoArraysToCollections<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
>;
|
|
58
|
-
}
|
|
59
|
-
> implements OrganizationService<OrganizationStatus>
|
|
60
|
-
{
|
|
61
|
-
#private;
|
|
62
|
-
em: EntityManager;
|
|
63
|
-
protected openTelemetryCollector: OpenTelemetryCollector<Metrics>;
|
|
64
|
-
protected schemaValidator: SchemaValidator;
|
|
65
|
-
protected mapperss: {
|
|
66
|
-
OrganizationDtoMapper: ResponseDtoMapperConstructor<
|
|
67
|
-
SchemaValidator,
|
|
68
|
-
Dto['OrganizationDtoMapper'],
|
|
69
|
-
Entities['OrganizationDtoMapper']
|
|
70
|
-
>;
|
|
71
|
-
CreateOrganizationDtoMapper: RequestDtoMapperConstructor<
|
|
72
|
-
SchemaValidator,
|
|
73
|
-
Dto['CreateOrganizationDtoMapper'],
|
|
74
|
-
Entities['CreateOrganizationDtoMapper']
|
|
75
|
-
>;
|
|
76
|
-
UpdateOrganizationDtoMapper: RequestDtoMapperConstructor<
|
|
77
|
-
SchemaValidator,
|
|
78
|
-
Dto['UpdateOrganizationDtoMapper'],
|
|
79
|
-
Entities['UpdateOrganizationDtoMapper']
|
|
80
|
-
>;
|
|
81
|
-
};
|
|
82
|
-
constructor(
|
|
83
|
-
em: EntityManager,
|
|
84
|
-
openTelemetryCollector: OpenTelemetryCollector<Metrics>,
|
|
85
|
-
schemaValidator: SchemaValidator,
|
|
86
|
-
mapperss: {
|
|
87
|
-
OrganizationDtoMapper: ResponseDtoMapperConstructor<
|
|
88
|
-
SchemaValidator,
|
|
89
|
-
Dto['OrganizationDtoMapper'],
|
|
90
|
-
Entities['OrganizationDtoMapper']
|
|
91
|
-
>;
|
|
92
|
-
CreateOrganizationDtoMapper: RequestDtoMapperConstructor<
|
|
93
|
-
SchemaValidator,
|
|
94
|
-
Dto['CreateOrganizationDtoMapper'],
|
|
95
|
-
Entities['CreateOrganizationDtoMapper']
|
|
96
|
-
>;
|
|
97
|
-
UpdateOrganizationDtoMapper: RequestDtoMapperConstructor<
|
|
98
|
-
SchemaValidator,
|
|
99
|
-
Dto['UpdateOrganizationDtoMapper'],
|
|
100
|
-
Entities['UpdateOrganizationDtoMapper']
|
|
101
|
-
>;
|
|
102
|
-
}
|
|
103
|
-
);
|
|
104
|
-
createOrganization(
|
|
105
|
-
organizationDto: Dto['CreateOrganizationDtoMapper'],
|
|
106
|
-
em?: EntityManager
|
|
107
|
-
): Promise<Dto['OrganizationDtoMapper']>;
|
|
108
|
-
getOrganization(
|
|
109
|
-
idDto: IdDto,
|
|
110
|
-
em?: EntityManager
|
|
111
|
-
): Promise<Dto['OrganizationDtoMapper']>;
|
|
112
|
-
updateOrganization(
|
|
113
|
-
organizationDto: Dto['UpdateOrganizationDtoMapper'],
|
|
114
|
-
em?: EntityManager
|
|
115
|
-
): Promise<Dto['OrganizationDtoMapper']>;
|
|
116
|
-
deleteOrganization(idDto: IdDto, em?: EntityManager): Promise<void>;
|
|
17
|
+
}, Entities extends {
|
|
18
|
+
OrganizationDtoMapper: MapNestedDtoArraysToCollections<OrganizationDto<OrganizationStatus>, 'users'>;
|
|
19
|
+
CreateOrganizationDtoMapper: MapNestedDtoArraysToCollections<OrganizationDto<OrganizationStatus>, 'users'>;
|
|
20
|
+
UpdateOrganizationDtoMapper: MapNestedDtoArraysToCollections<OrganizationDto<OrganizationStatus>, 'users'>;
|
|
21
|
+
} = {
|
|
22
|
+
OrganizationDtoMapper: MapNestedDtoArraysToCollections<OrganizationDto<OrganizationStatus>, 'users'>;
|
|
23
|
+
CreateOrganizationDtoMapper: MapNestedDtoArraysToCollections<OrganizationDto<OrganizationStatus>, 'users'>;
|
|
24
|
+
UpdateOrganizationDtoMapper: MapNestedDtoArraysToCollections<OrganizationDto<OrganizationStatus>, 'users'>;
|
|
25
|
+
}> implements OrganizationService<OrganizationStatus> {
|
|
26
|
+
#private;
|
|
27
|
+
em: EntityManager;
|
|
28
|
+
protected openTelemetryCollector: OpenTelemetryCollector<Metrics>;
|
|
29
|
+
protected schemaValidator: SchemaValidator;
|
|
30
|
+
protected mapperss: {
|
|
31
|
+
OrganizationDtoMapper: ResponseDtoMapperConstructor<SchemaValidator, Dto['OrganizationDtoMapper'], Entities['OrganizationDtoMapper']>;
|
|
32
|
+
CreateOrganizationDtoMapper: RequestDtoMapperConstructor<SchemaValidator, Dto['CreateOrganizationDtoMapper'], Entities['CreateOrganizationDtoMapper']>;
|
|
33
|
+
UpdateOrganizationDtoMapper: RequestDtoMapperConstructor<SchemaValidator, Dto['UpdateOrganizationDtoMapper'], Entities['UpdateOrganizationDtoMapper']>;
|
|
34
|
+
};
|
|
35
|
+
constructor(em: EntityManager, openTelemetryCollector: OpenTelemetryCollector<Metrics>, schemaValidator: SchemaValidator, mapperss: {
|
|
36
|
+
OrganizationDtoMapper: ResponseDtoMapperConstructor<SchemaValidator, Dto['OrganizationDtoMapper'], Entities['OrganizationDtoMapper']>;
|
|
37
|
+
CreateOrganizationDtoMapper: RequestDtoMapperConstructor<SchemaValidator, Dto['CreateOrganizationDtoMapper'], Entities['CreateOrganizationDtoMapper']>;
|
|
38
|
+
UpdateOrganizationDtoMapper: RequestDtoMapperConstructor<SchemaValidator, Dto['UpdateOrganizationDtoMapper'], Entities['UpdateOrganizationDtoMapper']>;
|
|
39
|
+
});
|
|
40
|
+
createOrganization(organizationDto: Dto['CreateOrganizationDtoMapper'], em?: EntityManager): Promise<Dto['OrganizationDtoMapper']>;
|
|
41
|
+
getOrganization(idDto: IdDto, em?: EntityManager): Promise<Dto['OrganizationDtoMapper']>;
|
|
42
|
+
updateOrganization(organizationDto: Dto['UpdateOrganizationDtoMapper'], em?: EntityManager): Promise<Dto['OrganizationDtoMapper']>;
|
|
43
|
+
deleteOrganization(idDto: IdDto, em?: EntityManager): Promise<void>;
|
|
117
44
|
}
|
|
118
|
-
//# sourceMappingURL=organization.service.d.ts.map
|
|
45
|
+
//# sourceMappingURL=organization.service.d.ts.map
|