@valentine-efagene/qshelter-common 2.0.127 → 2.0.131
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.
|
@@ -39,13 +39,22 @@ export class ConfigService {
|
|
|
39
39
|
return cached;
|
|
40
40
|
const pathPrefix = `/qshelter/${stage}/`;
|
|
41
41
|
try {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
// Paginate through all SSM parameters
|
|
43
|
+
const params = [];
|
|
44
|
+
let nextToken;
|
|
45
|
+
do {
|
|
46
|
+
const command = new GetParametersByPathCommand({
|
|
47
|
+
Path: pathPrefix,
|
|
48
|
+
Recursive: true,
|
|
49
|
+
WithDecryption: false,
|
|
50
|
+
NextToken: nextToken,
|
|
51
|
+
});
|
|
52
|
+
const response = await this.ssmClient.send(command);
|
|
53
|
+
if (response.Parameters) {
|
|
54
|
+
params.push(...response.Parameters);
|
|
55
|
+
}
|
|
56
|
+
nextToken = response.NextToken;
|
|
57
|
+
} while (nextToken);
|
|
49
58
|
const config = {
|
|
50
59
|
vpcId: this.getParamValue(params, `${pathPrefix}vpc-id`),
|
|
51
60
|
dbSecurityGroupId: this.getParamValue(params, `${pathPrefix}db-security-group-id`),
|
|
@@ -104,6 +104,7 @@ export declare function mockAuthHeaders(userId: string, tenantId: string, option
|
|
|
104
104
|
}): Record<string, string>;
|
|
105
105
|
/**
|
|
106
106
|
* Standard role names used across the platform.
|
|
107
|
+
* Supports both legacy names (SUPER_ADMIN) and bootstrap names (admin).
|
|
107
108
|
*/
|
|
108
109
|
export declare const ROLES: {
|
|
109
110
|
readonly SUPER_ADMIN: "SUPER_ADMIN";
|
|
@@ -117,12 +118,18 @@ export declare const ROLES: {
|
|
|
117
118
|
readonly LENDER: "LENDER";
|
|
118
119
|
/** Legal officers who upload final offer letters and handle legal documentation */
|
|
119
120
|
readonly LEGAL: "LEGAL";
|
|
121
|
+
readonly ADMIN: "admin";
|
|
122
|
+
readonly USER: "user";
|
|
123
|
+
readonly MORTGAGE_OPS: "mortgage_ops";
|
|
124
|
+
readonly FINANCE: "finance";
|
|
125
|
+
readonly LEGAL_TEAM: "legal";
|
|
120
126
|
};
|
|
121
127
|
export type RoleName = (typeof ROLES)[keyof typeof ROLES];
|
|
122
128
|
/**
|
|
123
129
|
* Roles that have admin privileges (can manage resources).
|
|
130
|
+
* Includes both legacy uppercase names and bootstrap lowercase names.
|
|
124
131
|
*/
|
|
125
|
-
export declare const ADMIN_ROLES:
|
|
132
|
+
export declare const ADMIN_ROLES: string[];
|
|
126
133
|
/**
|
|
127
134
|
* Check if user has any of the specified roles.
|
|
128
135
|
*/
|
|
@@ -174,8 +174,10 @@ export function mockAuthHeaders(userId, tenantId, options) {
|
|
|
174
174
|
}
|
|
175
175
|
/**
|
|
176
176
|
* Standard role names used across the platform.
|
|
177
|
+
* Supports both legacy names (SUPER_ADMIN) and bootstrap names (admin).
|
|
177
178
|
*/
|
|
178
179
|
export const ROLES = {
|
|
180
|
+
// Legacy role names (uppercase)
|
|
179
181
|
SUPER_ADMIN: 'SUPER_ADMIN',
|
|
180
182
|
TENANT_ADMIN: 'TENANT_ADMIN',
|
|
181
183
|
LOAN_OFFICER: 'LOAN_OFFICER',
|
|
@@ -187,11 +189,24 @@ export const ROLES = {
|
|
|
187
189
|
LENDER: 'LENDER',
|
|
188
190
|
/** Legal officers who upload final offer letters and handle legal documentation */
|
|
189
191
|
LEGAL: 'LEGAL',
|
|
192
|
+
// Bootstrap role names (lowercase) - created by tenant bootstrap
|
|
193
|
+
ADMIN: 'admin',
|
|
194
|
+
USER: 'user',
|
|
195
|
+
MORTGAGE_OPS: 'mortgage_ops',
|
|
196
|
+
FINANCE: 'finance',
|
|
197
|
+
LEGAL_TEAM: 'legal',
|
|
190
198
|
};
|
|
191
199
|
/**
|
|
192
200
|
* Roles that have admin privileges (can manage resources).
|
|
201
|
+
* Includes both legacy uppercase names and bootstrap lowercase names.
|
|
193
202
|
*/
|
|
194
|
-
export const ADMIN_ROLES = [
|
|
203
|
+
export const ADMIN_ROLES = [
|
|
204
|
+
ROLES.SUPER_ADMIN,
|
|
205
|
+
ROLES.TENANT_ADMIN,
|
|
206
|
+
ROLES.LOAN_OFFICER,
|
|
207
|
+
ROLES.ADMIN, // Bootstrap 'admin' role
|
|
208
|
+
ROLES.MORTGAGE_OPS, // Bootstrap 'mortgage_ops' role
|
|
209
|
+
];
|
|
195
210
|
/**
|
|
196
211
|
* Check if user has any of the specified roles.
|
|
197
212
|
*/
|
package/package.json
CHANGED