@punks/backend-entity-manager 0.0.115 → 0.0.117
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/dist/cjs/index.js +7 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/platforms/nest/__test__/server/app/appAdmin/templates/index.d.ts +2 -1
- package/dist/cjs/types/platforms/nest/__test__/server/app/appAdmin/templates/user-update/index.d.ts +3 -1
- package/dist/cjs/types/platforms/nest/extensions/authentication/types/index.d.ts +1 -1
- package/dist/esm/index.js +7 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/platforms/nest/__test__/server/app/appAdmin/templates/index.d.ts +2 -1
- package/dist/esm/types/platforms/nest/__test__/server/app/appAdmin/templates/user-update/index.d.ts +3 -1
- package/dist/esm/types/platforms/nest/extensions/authentication/types/index.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InstanceInitializeTemplate } from "./instance-initialize";
|
|
2
2
|
import { OrganizationRegisterTemplate } from "./organization-register";
|
|
3
3
|
import { TenantInitializeTemplate } from "./tenant-initialize";
|
|
4
|
-
|
|
4
|
+
import { UserUpdateTemplate } from "./user-update";
|
|
5
|
+
export declare const SetupTemplates: (typeof InstanceInitializeTemplate | typeof OrganizationRegisterTemplate | typeof TenantInitializeTemplate | typeof UserUpdateTemplate)[];
|
package/dist/cjs/types/platforms/nest/__test__/server/app/appAdmin/templates/user-update/index.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { PipelineDefinition } from "../../../../../../../../types";
|
|
2
2
|
import { AuthenticationService } from "../../../../../../extensions";
|
|
3
3
|
import { IPipelineTemplateBuilder, NestPipelineTemplate } from "../../../../../../pipelines";
|
|
4
|
+
import { AppUserProfileEntityManager } from "../../../../entities/appUserProfiles/appUserProfile.manager";
|
|
4
5
|
import { AppUserEntityManager } from "../../../../entities/appUsers/appUser.manager";
|
|
5
6
|
import { AppAuthContext } from "../../../../infrastructure/authentication";
|
|
6
7
|
import { UserUpdatePipelineInput } from "./models";
|
|
7
8
|
export declare class UserUpdateTemplate extends NestPipelineTemplate<UserUpdatePipelineInput, void, AppAuthContext> {
|
|
8
9
|
private readonly auth;
|
|
9
10
|
private readonly users;
|
|
10
|
-
|
|
11
|
+
private readonly userProfiles;
|
|
12
|
+
constructor(auth: AuthenticationService, users: AppUserEntityManager, userProfiles: AppUserProfileEntityManager);
|
|
11
13
|
protected isAuthorized(context: AppAuthContext): boolean;
|
|
12
14
|
protected buildTemplate(builder: IPipelineTemplateBuilder<UserUpdatePipelineInput, AppAuthContext>): PipelineDefinition<UserUpdatePipelineInput, void, AppAuthContext>;
|
|
13
15
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -2363,7 +2363,7 @@ const Public = () => SetMetadata(AuthenticationGuardsSymbols.Public, true);
|
|
|
2363
2363
|
const Authenticated = () => SetMetadata(AuthenticationGuardsSymbols.Authenticated, true);
|
|
2364
2364
|
const Roles = (...roles) => SetMetadata(AuthenticationGuardsSymbols.Roles, roles);
|
|
2365
2365
|
const MemberOf = (...groups) => SetMetadata(AuthenticationGuardsSymbols.MemberOf, groups);
|
|
2366
|
-
const buildRolesGuard = ({ mainRole, inheritedRoles, }, options) => Roles(mainRole.uid, ...(options?.
|
|
2366
|
+
const buildRolesGuard = ({ mainRole, inheritedRoles, }, options) => Roles(mainRole.uid, ...(!options?.exact && inheritedRoles
|
|
2367
2367
|
? inheritedRoles.map((role) => role.uid)
|
|
2368
2368
|
: []));
|
|
2369
2369
|
|
|
@@ -2496,11 +2496,7 @@ let AuthGuard = AuthGuard_1 = class AuthGuard {
|
|
|
2496
2496
|
id: user.id,
|
|
2497
2497
|
userName: user.userName,
|
|
2498
2498
|
email: user.email,
|
|
2499
|
-
roles: roles?.map((role) =>
|
|
2500
|
-
id: role.id,
|
|
2501
|
-
name: role.name,
|
|
2502
|
-
uid: role.uid,
|
|
2503
|
-
})),
|
|
2499
|
+
roles: roles?.map((role) => role.uid),
|
|
2504
2500
|
},
|
|
2505
2501
|
}
|
|
2506
2502
|
: {}),
|
|
@@ -22019,6 +22015,11 @@ class TypeOrmRepository {
|
|
|
22019
22015
|
throw new Error("Invalid 'id' parameter.");
|
|
22020
22016
|
}
|
|
22021
22017
|
this.logger.debug("Updating entity", { id, entity });
|
|
22018
|
+
// await this.innerRepository.preload(id as any)
|
|
22019
|
+
// await this.innerRepository.save({
|
|
22020
|
+
// id,
|
|
22021
|
+
// ...entity,
|
|
22022
|
+
// } as unknown as TEntity)
|
|
22022
22023
|
await this.innerRepository.update(id, entity);
|
|
22023
22024
|
const current = await this.get(id);
|
|
22024
22025
|
if (!current) {
|