new(admin.gbapp): custom .gbapp /publish commands.
This commit is contained in:
		
							parent
							
								
									c36939e221
								
							
						
					
					
						commit
						a7712fba28
					
				
					 4 changed files with 19 additions and 14 deletions
				
			
		
							
								
								
									
										6
									
								
								.gitignore
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.gitignore
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -11,14 +11,10 @@
 | 
			
		|||
/packages/default.gbui/build
 | 
			
		||||
/packages/default.gbui/.env
 | 
			
		||||
/packages/default.gbui/node_modules
 | 
			
		||||
/tmp
 | 
			
		||||
/work
 | 
			
		||||
/packages/default.gbdialog/bot.js
 | 
			
		||||
/packages/default.gbdialog/bot.ts
 | 
			
		||||
*.vbs.compiled
 | 
			
		||||
*.vbs.js
 | 
			
		||||
*.vbs.ts
 | 
			
		||||
.env
 | 
			
		||||
teste.sql
 | 
			
		||||
poc/
 | 
			
		||||
*.env
 | 
			
		||||
.vscode/launch.json
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -273,8 +273,12 @@ export class AdminDialog extends IGBDialog {
 | 
			
		|||
 | 
			
		||||
          await CollectionUtil.asyncForEach(packages, async packageName => {
 | 
			
		||||
            try {
 | 
			
		||||
              const cmd1 = `deployPackage ${process.env.STORAGE_SITE} /${process.env.STORAGE_LIBRARY}/${botId}.gbai/${packageName}`;
 | 
			
		||||
 | 
			
		||||
              let cmd1;
 | 
			
		||||
              if (packageName.indexOf('.') !== -1) {
 | 
			
		||||
                cmd1 = `deployPackage ${process.env.STORAGE_SITE} /${process.env.STORAGE_LIBRARY}/${botId}.gbai/${packageName}`;
 | 
			
		||||
              } else {
 | 
			
		||||
                cmd1 = `deployPackage ${packageName}`; 
 | 
			
		||||
              }
 | 
			
		||||
              if ((await (deployer as any).getStoragePackageByName(min.instance.instanceId, packageName)) !== null) {
 | 
			
		||||
                const cmd2 = `undeployPackage ${packageName}`;
 | 
			
		||||
                await GBAdminService.undeployPackageCommand(cmd2, min);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -201,10 +201,14 @@ export class GBAdminService implements IGBAdminService {
 | 
			
		|||
              reject(err);
 | 
			
		||||
            } else {
 | 
			
		||||
              const token = res as TokenResponse;
 | 
			
		||||
              await this.setValue(instanceId, 'accessToken', token.accessToken);
 | 
			
		||||
              await this.setValue(instanceId, 'refreshToken', token.refreshToken);
 | 
			
		||||
              await this.setValue(instanceId, 'expiresOn', token.expiresOn.toString());
 | 
			
		||||
              resolve(token.accessToken);
 | 
			
		||||
              try {
 | 
			
		||||
                await this.setValue(instanceId, 'accessToken', token.accessToken);
 | 
			
		||||
                await this.setValue(instanceId, 'refreshToken', token.refreshToken);
 | 
			
		||||
                await this.setValue(instanceId, 'expiresOn', token.expiresOn.toString());
 | 
			
		||||
                resolve(token.accessToken);
 | 
			
		||||
              } catch (error) {
 | 
			
		||||
                reject(err);
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        );
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -330,8 +330,9 @@ export class GBMinService {
 | 
			
		|||
            GBLog.error(msg);
 | 
			
		||||
            res.send(msg);
 | 
			
		||||
          } else {
 | 
			
		||||
            this.adminService.setValue(instance.instanceId, 'refreshToken', token.refreshToken);
 | 
			
		||||
            // TODO: await these calls.
 | 
			
		||||
            this.adminService.setValue(instance.instanceId, 'accessToken', token.accessToken);
 | 
			
		||||
            this.adminService.setValue(instance.instanceId, 'refreshToken', token.refreshToken);
 | 
			
		||||
            this.adminService.setValue(instance.instanceId, 'expiresOn', token.expiresOn.toString());
 | 
			
		||||
            this.adminService.setValue(instance.instanceId, 'AntiCSRFAttackState', undefined);
 | 
			
		||||
            res.redirect(min.instance.botEndpoint);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue