@punks/backend-entity-manager 0.0.114 → 0.0.115
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/types/abstractions/authentication.d.ts +0 -1
- package/dist/cjs/types/platforms/nest/__test__/server/app/{setup/setup.controller.d.ts → appAdmin/appAdmin.controller.d.ts} +1 -1
- package/dist/cjs/types/platforms/nest/__test__/server/app/appAdmin/appAdmin.module.d.ts +2 -0
- package/dist/cjs/types/platforms/nest/__test__/server/app/appAdmin/templates/user-update/index.d.ts +13 -0
- package/dist/cjs/types/platforms/nest/__test__/server/app/appAdmin/templates/user-update/models.d.ts +12 -0
- package/dist/cjs/types/platforms/nest/__test__/server/index.d.ts +1 -0
- package/dist/cjs/types/platforms/nest/__test__/server/infrastructure/authentication/types.d.ts +4 -0
- package/dist/cjs/types/platforms/nest/__test__/server/testing/authentication/index.d.ts +10 -0
- package/dist/cjs/types/platforms/nest/__test__/server/testing/authentication/types.d.ts +8 -0
- package/dist/esm/types/abstractions/authentication.d.ts +0 -1
- package/dist/esm/types/platforms/nest/__test__/server/app/{setup/setup.controller.d.ts → appAdmin/appAdmin.controller.d.ts} +1 -1
- package/dist/esm/types/platforms/nest/__test__/server/app/appAdmin/appAdmin.module.d.ts +2 -0
- package/dist/esm/types/platforms/nest/__test__/server/app/appAdmin/templates/tenant-initialize/tenant-initialize.pipeline.test.d.ts +1 -0
- package/dist/esm/types/platforms/nest/__test__/server/app/appAdmin/templates/user-update/index.d.ts +13 -0
- package/dist/esm/types/platforms/nest/__test__/server/app/appAdmin/templates/user-update/models.d.ts +12 -0
- package/dist/esm/types/platforms/nest/__test__/server/app/appAdmin/templates/user-update/user-update.pipeline.spec.d.ts +1 -0
- package/dist/esm/types/platforms/nest/__test__/server/index.d.ts +1 -0
- package/dist/esm/types/platforms/nest/__test__/server/infrastructure/authentication/types.d.ts +4 -0
- package/dist/esm/types/platforms/nest/__test__/server/testing/authentication/index.d.ts +10 -0
- package/dist/esm/types/platforms/nest/__test__/server/testing/authentication/types.d.ts +8 -0
- package/dist/index.d.ts +0 -1
- package/package.json +2 -1
- package/dist/cjs/types/platforms/nest/__test__/server/app/setup/setup.module.d.ts +0 -2
- package/dist/esm/types/platforms/nest/__test__/server/app/setup/setup.module.d.ts +0 -2
- /package/dist/cjs/types/platforms/nest/__test__/server/app/{setup → appAdmin}/templates/index.d.ts +0 -0
- /package/dist/cjs/types/platforms/nest/__test__/server/app/{setup → appAdmin}/templates/instance-initialize/index.d.ts +0 -0
- /package/dist/cjs/types/platforms/nest/__test__/server/app/{setup → appAdmin}/templates/instance-initialize/instance-initialize.pipeline.test.d.ts +0 -0
- /package/dist/cjs/types/platforms/nest/__test__/server/app/{setup → appAdmin}/templates/instance-initialize/models.d.ts +0 -0
- /package/dist/cjs/types/platforms/nest/__test__/server/app/{setup → appAdmin}/templates/organization-register/index.d.ts +0 -0
- /package/dist/cjs/types/platforms/nest/__test__/server/app/{setup → appAdmin}/templates/organization-register/models.d.ts +0 -0
- /package/dist/cjs/types/platforms/nest/__test__/server/app/{setup → appAdmin}/templates/organization-register/organization-register.pipeline.test.d.ts +0 -0
- /package/dist/cjs/types/platforms/nest/__test__/server/app/{setup → appAdmin}/templates/tenant-initialize/index.d.ts +0 -0
- /package/dist/cjs/types/platforms/nest/__test__/server/app/{setup → appAdmin}/templates/tenant-initialize/models.d.ts +0 -0
- /package/dist/cjs/types/platforms/nest/__test__/server/app/{setup → appAdmin}/templates/tenant-initialize/tenant-initialize.pipeline.test.d.ts +0 -0
- /package/dist/{esm/types/platforms/nest/__test__/server/app/setup/templates/instance-initialize/instance-initialize.pipeline.test.d.ts → cjs/types/platforms/nest/__test__/server/app/appAdmin/templates/user-update/user-update.pipeline.spec.d.ts} +0 -0
- /package/dist/esm/types/platforms/nest/__test__/server/app/{setup → appAdmin}/templates/index.d.ts +0 -0
- /package/dist/esm/types/platforms/nest/__test__/server/app/{setup → appAdmin}/templates/instance-initialize/index.d.ts +0 -0
- /package/dist/esm/types/platforms/nest/__test__/server/app/{setup/templates/organization-register/organization-register.pipeline.test.d.ts → appAdmin/templates/instance-initialize/instance-initialize.pipeline.test.d.ts} +0 -0
- /package/dist/esm/types/platforms/nest/__test__/server/app/{setup → appAdmin}/templates/instance-initialize/models.d.ts +0 -0
- /package/dist/esm/types/platforms/nest/__test__/server/app/{setup → appAdmin}/templates/organization-register/index.d.ts +0 -0
- /package/dist/esm/types/platforms/nest/__test__/server/app/{setup → appAdmin}/templates/organization-register/models.d.ts +0 -0
- /package/dist/esm/types/platforms/nest/__test__/server/app/{setup/templates/tenant-initialize/tenant-initialize.pipeline.test.d.ts → appAdmin/templates/organization-register/organization-register.pipeline.test.d.ts} +0 -0
- /package/dist/esm/types/platforms/nest/__test__/server/app/{setup → appAdmin}/templates/tenant-initialize/index.d.ts +0 -0
- /package/dist/esm/types/platforms/nest/__test__/server/app/{setup → appAdmin}/templates/tenant-initialize/models.d.ts +0 -0
|
@@ -3,7 +3,7 @@ import { TenantInitializeTemplate } from "./templates/tenant-initialize";
|
|
|
3
3
|
import { InstanceInitializeTemplate } from "./templates/instance-initialize";
|
|
4
4
|
import { OrganizationInitializeRequest, OrganizationInitializeResponse } from "./templates/organization-register/models";
|
|
5
5
|
import { OrganizationRegisterTemplate } from "./templates/organization-register";
|
|
6
|
-
export declare class
|
|
6
|
+
export declare class AppAdminController {
|
|
7
7
|
private readonly tenantInit;
|
|
8
8
|
private readonly instanceInit;
|
|
9
9
|
private readonly organizationInit;
|
package/dist/cjs/types/platforms/nest/__test__/server/app/appAdmin/templates/user-update/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PipelineDefinition } from "../../../../../../../../types";
|
|
2
|
+
import { AuthenticationService } from "../../../../../../extensions";
|
|
3
|
+
import { IPipelineTemplateBuilder, NestPipelineTemplate } from "../../../../../../pipelines";
|
|
4
|
+
import { AppUserEntityManager } from "../../../../entities/appUsers/appUser.manager";
|
|
5
|
+
import { AppAuthContext } from "../../../../infrastructure/authentication";
|
|
6
|
+
import { UserUpdatePipelineInput } from "./models";
|
|
7
|
+
export declare class UserUpdateTemplate extends NestPipelineTemplate<UserUpdatePipelineInput, void, AppAuthContext> {
|
|
8
|
+
private readonly auth;
|
|
9
|
+
private readonly users;
|
|
10
|
+
constructor(auth: AuthenticationService, users: AppUserEntityManager);
|
|
11
|
+
protected isAuthorized(context: AppAuthContext): boolean;
|
|
12
|
+
protected buildTemplate(builder: IPipelineTemplateBuilder<UserUpdatePipelineInput, AppAuthContext>): PipelineDefinition<UserUpdatePipelineInput, void, AppAuthContext>;
|
|
13
|
+
}
|
package/dist/cjs/types/platforms/nest/__test__/server/app/appAdmin/templates/user-update/models.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class UserUpdateRequest {
|
|
2
|
+
email: string;
|
|
3
|
+
userName: string;
|
|
4
|
+
fistName: string;
|
|
5
|
+
lastName: string;
|
|
6
|
+
roleUid: string;
|
|
7
|
+
birthDate?: string;
|
|
8
|
+
}
|
|
9
|
+
export type UserUpdatePipelineInput = {
|
|
10
|
+
userId: string;
|
|
11
|
+
data: UserUpdateRequest;
|
|
12
|
+
};
|
package/dist/cjs/types/platforms/nest/__test__/server/infrastructure/authentication/types.d.ts
CHANGED
|
@@ -10,10 +10,14 @@ export type AppUserContext = {
|
|
|
10
10
|
tenantId: string;
|
|
11
11
|
tenantUid: string;
|
|
12
12
|
};
|
|
13
|
+
export type AppUserRole = {
|
|
14
|
+
uid: string;
|
|
15
|
+
};
|
|
13
16
|
export declare class AppAuthContext implements IAuthenticationContext<AppUserContext> {
|
|
14
17
|
isAuthenticated: boolean;
|
|
15
18
|
isAnonymous: boolean;
|
|
16
19
|
userId?: string;
|
|
17
20
|
userContext?: AppUserContext;
|
|
18
21
|
userInfo?: AppUserInfo;
|
|
22
|
+
userRoles?: AppUserRole[];
|
|
19
23
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { INestApplication } from "@nestjs/common";
|
|
2
|
+
import { DataSource } from "typeorm";
|
|
3
|
+
import { ApplicationAuthenticationContext } from "./types";
|
|
4
|
+
import { AppAuthContextProvider } from "../../infrastructure/authentication";
|
|
5
|
+
import { AuthGuard } from "../../../../extensions";
|
|
6
|
+
export declare const mockAuthenticatedUser: (auth: AppAuthContextProvider, guard: AuthGuard) => void;
|
|
7
|
+
export declare const createAuthenticationContext: (app: INestApplication<any>, dataSource: DataSource) => Promise<ApplicationAuthenticationContext>;
|
|
8
|
+
export declare const createUser: (app: INestApplication<any>, context: ApplicationAuthenticationContext, data: {
|
|
9
|
+
roleUid?: string;
|
|
10
|
+
}) => Promise<import("../../../../extensions").IAuthUser>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AppDirectoryEntity } from "../../database/core/entities/appDirectory.entity";
|
|
2
|
+
import { AppOrganizationEntity } from "../../database/core/entities/appOrganization.entity";
|
|
3
|
+
import { AppTenantEntity } from "../../database/core/entities/appTenant.entity";
|
|
4
|
+
export type ApplicationAuthenticationContext = {
|
|
5
|
+
tenant: AppTenantEntity;
|
|
6
|
+
organization: AppOrganizationEntity;
|
|
7
|
+
directory: AppDirectoryEntity;
|
|
8
|
+
};
|
|
@@ -3,7 +3,7 @@ import { TenantInitializeTemplate } from "./templates/tenant-initialize";
|
|
|
3
3
|
import { InstanceInitializeTemplate } from "./templates/instance-initialize";
|
|
4
4
|
import { OrganizationInitializeRequest, OrganizationInitializeResponse } from "./templates/organization-register/models";
|
|
5
5
|
import { OrganizationRegisterTemplate } from "./templates/organization-register";
|
|
6
|
-
export declare class
|
|
6
|
+
export declare class AppAdminController {
|
|
7
7
|
private readonly tenantInit;
|
|
8
8
|
private readonly instanceInit;
|
|
9
9
|
private readonly organizationInit;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/types/platforms/nest/__test__/server/app/appAdmin/templates/user-update/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PipelineDefinition } from "../../../../../../../../types";
|
|
2
|
+
import { AuthenticationService } from "../../../../../../extensions";
|
|
3
|
+
import { IPipelineTemplateBuilder, NestPipelineTemplate } from "../../../../../../pipelines";
|
|
4
|
+
import { AppUserEntityManager } from "../../../../entities/appUsers/appUser.manager";
|
|
5
|
+
import { AppAuthContext } from "../../../../infrastructure/authentication";
|
|
6
|
+
import { UserUpdatePipelineInput } from "./models";
|
|
7
|
+
export declare class UserUpdateTemplate extends NestPipelineTemplate<UserUpdatePipelineInput, void, AppAuthContext> {
|
|
8
|
+
private readonly auth;
|
|
9
|
+
private readonly users;
|
|
10
|
+
constructor(auth: AuthenticationService, users: AppUserEntityManager);
|
|
11
|
+
protected isAuthorized(context: AppAuthContext): boolean;
|
|
12
|
+
protected buildTemplate(builder: IPipelineTemplateBuilder<UserUpdatePipelineInput, AppAuthContext>): PipelineDefinition<UserUpdatePipelineInput, void, AppAuthContext>;
|
|
13
|
+
}
|
package/dist/esm/types/platforms/nest/__test__/server/app/appAdmin/templates/user-update/models.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class UserUpdateRequest {
|
|
2
|
+
email: string;
|
|
3
|
+
userName: string;
|
|
4
|
+
fistName: string;
|
|
5
|
+
lastName: string;
|
|
6
|
+
roleUid: string;
|
|
7
|
+
birthDate?: string;
|
|
8
|
+
}
|
|
9
|
+
export type UserUpdatePipelineInput = {
|
|
10
|
+
userId: string;
|
|
11
|
+
data: UserUpdateRequest;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/types/platforms/nest/__test__/server/infrastructure/authentication/types.d.ts
CHANGED
|
@@ -10,10 +10,14 @@ export type AppUserContext = {
|
|
|
10
10
|
tenantId: string;
|
|
11
11
|
tenantUid: string;
|
|
12
12
|
};
|
|
13
|
+
export type AppUserRole = {
|
|
14
|
+
uid: string;
|
|
15
|
+
};
|
|
13
16
|
export declare class AppAuthContext implements IAuthenticationContext<AppUserContext> {
|
|
14
17
|
isAuthenticated: boolean;
|
|
15
18
|
isAnonymous: boolean;
|
|
16
19
|
userId?: string;
|
|
17
20
|
userContext?: AppUserContext;
|
|
18
21
|
userInfo?: AppUserInfo;
|
|
22
|
+
userRoles?: AppUserRole[];
|
|
19
23
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { INestApplication } from "@nestjs/common";
|
|
2
|
+
import { DataSource } from "typeorm";
|
|
3
|
+
import { ApplicationAuthenticationContext } from "./types";
|
|
4
|
+
import { AppAuthContextProvider } from "../../infrastructure/authentication";
|
|
5
|
+
import { AuthGuard } from "../../../../extensions";
|
|
6
|
+
export declare const mockAuthenticatedUser: (auth: AppAuthContextProvider, guard: AuthGuard) => void;
|
|
7
|
+
export declare const createAuthenticationContext: (app: INestApplication<any>, dataSource: DataSource) => Promise<ApplicationAuthenticationContext>;
|
|
8
|
+
export declare const createUser: (app: INestApplication<any>, context: ApplicationAuthenticationContext, data: {
|
|
9
|
+
roleUid?: string;
|
|
10
|
+
}) => Promise<import("../../../../extensions").IAuthUser>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AppDirectoryEntity } from "../../database/core/entities/appDirectory.entity";
|
|
2
|
+
import { AppOrganizationEntity } from "../../database/core/entities/appOrganization.entity";
|
|
3
|
+
import { AppTenantEntity } from "../../database/core/entities/appTenant.entity";
|
|
4
|
+
export type ApplicationAuthenticationContext = {
|
|
5
|
+
tenant: AppTenantEntity;
|
|
6
|
+
organization: AppOrganizationEntity;
|
|
7
|
+
directory: AppDirectoryEntity;
|
|
8
|
+
};
|
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@punks/backend-entity-manager",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.115",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"@aws-sdk/client-ses": "^3.405.0",
|
|
31
31
|
"@aws-sdk/s3-request-presigner": "^3.405.0",
|
|
32
32
|
"@babel/core": "^7.21.0",
|
|
33
|
+
"@faker-js/faker": "^8.1.0",
|
|
33
34
|
"@nestjs/common": "^10.1.0",
|
|
34
35
|
"@nestjs/core": "^10.1.0",
|
|
35
36
|
"@nestjs/event-emitter": "^2.0.0",
|
/package/dist/cjs/types/platforms/nest/__test__/server/app/{setup → appAdmin}/templates/index.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/esm/types/platforms/nest/__test__/server/app/{setup → appAdmin}/templates/index.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|