@simitgroup/simpleapp-generator 2.0.1-r-alpha → 2.0.1-s-alpha
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/ReleaseNote.md +5 -0
- package/package.json +1 -1
- package/templates/nest/src/simple-app/_core/features/user-context/robot-user.service.ts.eta +10 -10
- package/templates/nest/src/simple-app/_core/features/user-context/user.context.ts.eta +1 -1
- /package/templates/nest/src/simple-app/{cron/cron.module.ts.eta → crons/cron.module.ts._eta} +0 -0
package/ReleaseNote.md
CHANGED
package/package.json
CHANGED
|
@@ -21,12 +21,12 @@ export class SimpleAppRobotUserService {
|
|
|
21
21
|
logger = new Logger();
|
|
22
22
|
|
|
23
23
|
constructor(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
) {
|
|
24
|
+
@InjectModel('User') private readonly userModel: Model<User>,
|
|
25
|
+
@InjectModel('Permission') private readonly permModel: Model<Permission>,
|
|
26
|
+
// @InjectModel('Appintegration') private readonly appmodel: Model<Appintegration>;
|
|
27
|
+
@InjectModel('MiniAppInstallation') private readonly miniAppInstallationModel: Model<MiniAppInstallation>,
|
|
28
|
+
@InjectModel('Environment') private envModel: Model<Environment>,
|
|
29
|
+
) {
|
|
30
30
|
this.init();
|
|
31
31
|
// console.log('init SimpleAppRobotUserService');
|
|
32
32
|
}
|
|
@@ -94,10 +94,10 @@ export class SimpleAppRobotUserService {
|
|
|
94
94
|
|
|
95
95
|
async createDumyAppUser(userContext: BaseUserContext) {
|
|
96
96
|
const envs = await this.envModel.find();
|
|
97
|
-
|
|
98
|
-
const appUser = new UserContext(this.userModel, this.permModel, this.miniAppInstallationModel,envs[0]);
|
|
97
|
+
|
|
98
|
+
const appUser = new UserContext(this.userModel, this.permModel, this.miniAppInstallationModel, envs[0]);
|
|
99
99
|
const user = userContext;
|
|
100
|
-
const xorg = appUser.generateXOrg(user.tenantId, user.orgId, user.branchId);
|
|
100
|
+
const xorg = appUser.generateXOrg(user.tenantId ?? 0, user.orgId ?? 0, user.branchId ?? 0);
|
|
101
101
|
|
|
102
102
|
await appUser.setAsStaticUser(user.uid ?? '00000000-0000-0000-0000-000000000000', user.uname ?? 'robot', user.fullName ?? 'Robot', user.email ?? 'robot@a.org', xorg);
|
|
103
103
|
appUser.setTimeZone(user.timeZone ?? this.defaultTimeZone);
|
|
@@ -110,7 +110,7 @@ export class SimpleAppRobotUserService {
|
|
|
110
110
|
const envs = await this.envModel.find();
|
|
111
111
|
// console.log('prepareAppUserprepareAppUser');
|
|
112
112
|
// this.appmodel,
|
|
113
|
-
const appuser = new UserContext(this.userModel, this.permModel, this.miniAppInstallationModel,envs[0]);
|
|
113
|
+
const appuser = new UserContext(this.userModel, this.permModel, this.miniAppInstallationModel, envs[0]);
|
|
114
114
|
await appuser.setAsStaticUser('00000000-0000-0000-0000-000000000000', 'robot', 'Robot', 'robot@a.org', Base64URL.encodeText('0-0-0'));
|
|
115
115
|
|
|
116
116
|
const tenantId = data?.tenantId ?? 0;
|
|
@@ -1069,7 +1069,7 @@ export class UserContext extends UserContextInfo {
|
|
|
1069
1069
|
orgId: this.orgId,
|
|
1070
1070
|
branchId: this.branchId,
|
|
1071
1071
|
});
|
|
1072
|
-
return miniAppInstallation.miniApp;
|
|
1072
|
+
return miniAppInstallation ? miniAppInstallation.miniApp : null;
|
|
1073
1073
|
}
|
|
1074
1074
|
|
|
1075
1075
|
async setUserProfileFromDB() {
|
/package/templates/nest/src/simple-app/{cron/cron.module.ts.eta → crons/cron.module.ts._eta}
RENAMED
|
File without changes
|