@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 CHANGED
@@ -1,3 +1,8 @@
1
+ [2.0.1s-alpha]
2
+
3
+ 1. Fix cron set xorg failed. undefined-undefined-undefined
4
+ 2. Fix findInstalledMiniAppCode
5
+
1
6
  [2.0.1r-alpha]
2
7
 
3
8
  1. Add findIdThenUnsetField
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simitgroup/simpleapp-generator",
3
- "version": "2.0.1r-alpha",
3
+ "version": "2.0.1s-alpha",
4
4
  "description": "frontend nuxtjs and backend nests code generator using jsonschema",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -21,12 +21,12 @@ export class SimpleAppRobotUserService {
21
21
  logger = new Logger();
22
22
 
23
23
  constructor(
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
- ) {
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() {