2023-07-13 14:13:48 -03:00
|
|
|
|
|
|
|
|
2018-09-16 17:00:17 -03:00
|
|
|
/*****************************************************************************\
|
|
|
|
| ( )_ _ |
|
|
|
|
| _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ _ |
|
2020-07-01 15:00:40 -03:00
|
|
|
| ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' v `\ /'_`\ |
|
2019-03-09 16:59:31 -03:00
|
|
|
| | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| (˅) |( (_) ) |
|
2018-09-16 17:00:17 -03:00
|
|
|
| | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/' |
|
|
|
|
| | | ( )_) | |
|
|
|
|
| (_) \___/' |
|
|
|
|
| |
|
|
|
|
| General Bots Copyright (c) Pragmatismo.io. All rights reserved. |
|
|
|
|
| Licensed under the AGPL-3.0. |
|
2018-11-11 19:09:18 -02:00
|
|
|
| |
|
2018-09-16 17:00:17 -03:00
|
|
|
| According to our dual licensing model, this program can be used either |
|
|
|
|
| under the terms of the GNU Affero General Public License, version 3, |
|
|
|
|
| or under a proprietary license. |
|
|
|
|
| |
|
|
|
|
| The texts of the GNU Affero General Public License with an additional |
|
|
|
|
| permission and of our proprietary license can be found at and |
|
|
|
|
| in the LICENSE file you have received along with this program. |
|
|
|
|
| |
|
|
|
|
| This program is distributed in the hope that it will be useful, |
|
|
|
|
| but WITHOUT ANY WARRANTY, without even the implied warranty of |
|
|
|
|
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
|
|
| GNU Affero General Public License for more details. |
|
|
|
|
| |
|
|
|
|
| "General Bots" is a registered trademark of Pragmatismo.io. |
|
|
|
|
| The licensing of the program under the AGPLv3 does not imply a |
|
|
|
|
| trademark license. Therefore any rights, title and interest in |
|
|
|
|
| our trademarks remain entirely with us. |
|
|
|
|
| |
|
|
|
|
\*****************************************************************************/
|
|
|
|
|
2018-11-11 19:09:18 -02:00
|
|
|
/**
|
|
|
|
* @fileoverview General Bots server core.
|
|
|
|
*/
|
|
|
|
|
|
|
|
'use strict';
|
2018-09-16 17:00:17 -03:00
|
|
|
|
2018-11-12 12:20:44 -02:00
|
|
|
import { AuthenticationContext, TokenResponse } from 'adal-node';
|
2023-01-29 12:02:14 -03:00
|
|
|
import { GBError, GBLog, GBMinInstance, IGBAdminService, IGBCoreService, IGBDeployer, IGBInstance } from 'botlib';
|
2022-01-03 13:11:21 -03:00
|
|
|
import { FindOptions } from 'sequelize/types';
|
2022-11-19 23:34:58 -03:00
|
|
|
import urlJoin from 'url-join';
|
2022-11-18 22:39:14 -03:00
|
|
|
import { AzureDeployerService } from '../../azuredeployer.gbapp/services/AzureDeployerService.js';
|
|
|
|
import { GuaribasInstance } from '../../core.gbapp/models/GBModel.js';
|
|
|
|
import { GBConfigService } from '../../core.gbapp/services/GBConfigService.js';
|
|
|
|
import { GBDeployer } from '../../core.gbapp/services/GBDeployer.js';
|
|
|
|
import { GBImporter } from '../../core.gbapp/services/GBImporterService.js';
|
|
|
|
import { GBSharePointService } from '../../sharepoint.gblib/services/SharePointService.js';
|
|
|
|
import { GuaribasAdmin } from '../models/AdminModel.js';
|
|
|
|
import msRestAzure from 'ms-rest-azure';
|
|
|
|
import Path from 'path';
|
2023-01-03 11:24:08 -03:00
|
|
|
import { caseSensitive_Numbs_SpecialCharacters_PW, lowercase_PW } from 'super-strong-password-generator'
|
2022-11-19 23:34:58 -03:00
|
|
|
import crypto from 'crypto';
|
2022-12-22 20:55:49 -03:00
|
|
|
import Fs from 'fs';
|
2022-12-23 08:23:08 -03:00
|
|
|
import { GBServer } from '../../../src/app.js';
|
2023-02-26 15:03:24 -03:00
|
|
|
import { GuaribasUser } from '../../security.gbapp/models/index.js';
|
2023-03-09 17:46:34 -03:00
|
|
|
import { DialogKeywords } from '../../basic.gblib/services/DialogKeywords.js';
|
2018-10-15 19:05:43 -03:00
|
|
|
|
2019-01-31 11:32:33 -02:00
|
|
|
/**
|
|
|
|
* Services for server administration.
|
|
|
|
*/
|
2019-03-08 06:37:13 -03:00
|
|
|
export class GBAdminService implements IGBAdminService {
|
2018-11-12 12:20:44 -02:00
|
|
|
public static GB_PROMPT: string = 'GeneralBots: ';
|
|
|
|
public static masterBotInstanceId = 0;
|
2018-10-15 19:05:43 -03:00
|
|
|
|
2019-01-31 11:32:33 -02:00
|
|
|
public static StrongRegex = new RegExp('^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*+_-])(?=.{8,})');
|
2018-09-16 17:00:17 -03:00
|
|
|
|
2018-11-12 12:20:44 -02:00
|
|
|
public core: IGBCoreService;
|
2018-09-24 11:04:36 -03:00
|
|
|
|
2023-01-03 11:24:08 -03:00
|
|
|
constructor(core: IGBCoreService) {
|
2018-09-24 11:04:36 -03:00
|
|
|
this.core = core;
|
|
|
|
}
|
|
|
|
|
2023-01-03 11:24:08 -03:00
|
|
|
public static generateUuid(): string {
|
2022-11-18 22:39:14 -03:00
|
|
|
return crypto.randomUUID();
|
2018-11-12 12:20:44 -02:00
|
|
|
}
|
|
|
|
|
2023-01-03 11:24:08 -03:00
|
|
|
public static getNodeVersion() {
|
2019-05-26 20:25:08 -03:00
|
|
|
const packageJson = urlJoin(process.cwd(), 'package.json');
|
2022-12-22 20:55:49 -03:00
|
|
|
const pkg = JSON.parse(Fs.readFileSync(packageJson, 'utf8'));
|
|
|
|
return pkg.engines.node.replace('=', '');
|
2019-05-26 20:25:08 -03:00
|
|
|
}
|
|
|
|
|
2023-01-03 11:24:08 -03:00
|
|
|
public static async getADALTokenFromUsername(username: string, password: string) {
|
2019-01-31 11:32:33 -02:00
|
|
|
const credentials = await GBAdminService.getADALCredentialsFromUsername(username, password);
|
|
|
|
|
2022-11-18 22:39:14 -03:00
|
|
|
return (credentials as any).tokenCache._entries[0].accessToken;
|
2018-11-12 12:20:44 -02:00
|
|
|
}
|
|
|
|
|
2023-01-03 11:24:08 -03:00
|
|
|
public static async getADALCredentialsFromUsername(username: string, password: string) {
|
2023-07-19 10:21:38 -03:00
|
|
|
|
2022-11-19 23:34:58 -03:00
|
|
|
return await msRestAzure.loginWithUsernamePassword(username, password);
|
2018-11-12 12:20:44 -02:00
|
|
|
}
|
2020-10-24 18:56:55 -03:00
|
|
|
|
2023-01-03 11:24:08 -03:00
|
|
|
public static getMobileCode() {
|
|
|
|
|
2023-07-18 12:46:50 -03:00
|
|
|
return this.getNumberIdentifier(6);
|
2020-07-26 16:46:37 -03:00
|
|
|
}
|
|
|
|
|
2023-01-03 11:24:08 -03:00
|
|
|
public static getRndPassword(): string {
|
2022-12-29 14:47:19 -03:00
|
|
|
let password = caseSensitive_Numbs_SpecialCharacters_PW(15);
|
2021-11-29 18:39:42 -03:00
|
|
|
password = password.replace(/[\@\[\=\:\;\?\"\'\#]/gi, '*');
|
2019-03-08 06:49:22 -03:00
|
|
|
|
2018-11-12 12:20:44 -02:00
|
|
|
return password;
|
|
|
|
}
|
|
|
|
|
2023-01-10 12:06:14 -03:00
|
|
|
public static getRndReadableIdentifier(): string {
|
2022-12-29 14:47:19 -03:00
|
|
|
|
2023-01-03 11:24:08 -03:00
|
|
|
return lowercase_PW(14);
|
2020-12-04 13:44:33 -03:00
|
|
|
}
|
|
|
|
|
2023-07-18 13:41:49 -03:00
|
|
|
public static getNumberIdentifier(digits: number = 14): string {
|
|
|
|
|
2023-07-19 10:21:38 -03:00
|
|
|
if (digits <= 0) {
|
|
|
|
throw new Error('Number of digits should be greater than 0.');
|
|
|
|
}
|
|
|
|
|
|
|
|
const min = 10 ** (digits - 1);
|
|
|
|
const max = 10 ** digits - 1;
|
|
|
|
const randomNumber = Math.floor(Math.random() * (max - min + 1)) + min;
|
|
|
|
return randomNumber.toString();
|
2018-11-12 12:20:44 -02:00
|
|
|
}
|
|
|
|
|
2021-01-20 18:23:42 -03:00
|
|
|
/**
|
|
|
|
* @see https://stackoverflow.com/a/52171480
|
|
|
|
*/
|
2023-01-03 11:24:08 -03:00
|
|
|
public static getHash(str: string, seed = 0) {
|
2022-11-19 23:34:58 -03:00
|
|
|
let h1 = 0xdeadbeef ^ seed,
|
|
|
|
h2 = 0x41c6ce57 ^ seed;
|
2021-01-20 18:23:42 -03:00
|
|
|
for (let i = 0, ch; i < str.length; i++) {
|
|
|
|
ch = str.charCodeAt(i);
|
|
|
|
h1 = Math.imul(h1 ^ ch, 2654435761);
|
|
|
|
h2 = Math.imul(h2 ^ ch, 1597334677);
|
|
|
|
}
|
|
|
|
h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^ Math.imul(h2 ^ (h2 >>> 13), 3266489909);
|
|
|
|
h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^ Math.imul(h1 ^ (h1 >>> 13), 3266489909);
|
|
|
|
return 4294967296 * (2097151 & h2) + (h1 >>> 0);
|
|
|
|
}
|
|
|
|
|
2023-01-03 11:24:08 -03:00
|
|
|
public static async undeployPackageCommand(text: string, min: GBMinInstance) {
|
2023-07-19 10:21:38 -03:00
|
|
|
|
2020-12-31 15:36:19 -03:00
|
|
|
const packageName = text.split(' ')[1];
|
|
|
|
const importer = new GBImporter(min.core);
|
|
|
|
const deployer = new GBDeployer(min.core, importer);
|
2023-03-09 17:46:34 -03:00
|
|
|
const path = DialogKeywords.getGBAIPath(min.botId, null, packageName);
|
|
|
|
const localFolder = Path.join('work', path);
|
2020-12-31 15:36:19 -03:00
|
|
|
await deployer.undeployPackageFromLocalPath(min.instance, localFolder);
|
|
|
|
}
|
|
|
|
|
2023-01-03 11:24:08 -03:00
|
|
|
public static isSharePointPath(path: string) {
|
2021-04-22 12:12:05 -03:00
|
|
|
return path.indexOf('sharepoint.com') !== -1;
|
2020-12-31 15:36:19 -03:00
|
|
|
}
|
2023-02-26 15:03:24 -03:00
|
|
|
public static async deployPackageCommand(min: GBMinInstance, user: GuaribasUser, text: string, deployer: IGBDeployer) {
|
2020-12-31 15:36:19 -03:00
|
|
|
const packageName = text.split(' ')[1];
|
|
|
|
|
|
|
|
if (!this.isSharePointPath(packageName)) {
|
|
|
|
const additionalPath = GBConfigService.get('ADDITIONAL_DEPLOY_PATH');
|
|
|
|
if (additionalPath === undefined) {
|
|
|
|
throw new Error('ADDITIONAL_DEPLOY_PATH is not set and deployPackage was called.');
|
|
|
|
}
|
2023-02-26 15:03:24 -03:00
|
|
|
await deployer['deployPackage2'](min, user, urlJoin(additionalPath, packageName));
|
2020-12-31 15:36:19 -03:00
|
|
|
} else {
|
2023-07-19 10:21:38 -03:00
|
|
|
const folderName = text.split(' ')[2];
|
2023-03-10 15:49:30 -03:00
|
|
|
const packageType = Path.extname(folderName).substr(1);
|
|
|
|
const gbaiPath = DialogKeywords.getGBAIPath(min.instance.botId, packageType, null);
|
2023-03-09 17:46:34 -03:00
|
|
|
const localFolder = Path.join('work', gbaiPath);
|
2021-01-07 19:42:03 -03:00
|
|
|
|
|
|
|
// .gbot packages are handled using storage API, so no download
|
|
|
|
// of local resources is required.
|
2023-07-19 10:21:38 -03:00
|
|
|
const gbai = DialogKeywords.getGBAIPath(min.instance.botId);
|
2023-09-14 12:10:47 -03:00
|
|
|
|
|
|
|
if (packageType === 'gbkb') {
|
|
|
|
await deployer['cleanupPackage'](min.instance, packageName);
|
|
|
|
}
|
|
|
|
|
2023-07-19 10:21:38 -03:00
|
|
|
await deployer['downloadFolder'](min,
|
|
|
|
Path.join('work', `${gbai}`),
|
2023-03-10 15:49:30 -03:00
|
|
|
Path.basename(localFolder));
|
2023-02-26 15:03:24 -03:00
|
|
|
await deployer['deployPackage2'](min, user, localFolder);
|
2020-12-31 15:36:19 -03:00
|
|
|
}
|
|
|
|
}
|
2023-01-03 11:24:08 -03:00
|
|
|
public static async rebuildIndexPackageCommand(min: GBMinInstance, deployer: GBDeployer) {
|
2022-12-15 10:56:27 -03:00
|
|
|
const service = await AzureDeployerService.createInstance(deployer);
|
2023-09-10 22:42:32 -03:00
|
|
|
const searchIndex = min.instance.searchIndex ? min.instance.searchIndex : GBServer.globals.minBoot.instance.searchIndex;
|
2020-12-31 15:36:19 -03:00
|
|
|
await deployer.rebuildIndex(
|
|
|
|
min.instance,
|
2023-09-10 22:42:32 -03:00
|
|
|
service.getKBSearchSchema(searchIndex)
|
2020-12-31 15:36:19 -03:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-01-03 11:24:08 -03:00
|
|
|
public static async syncBotServerCommand(min: GBMinInstance, deployer: GBDeployer) {
|
2020-12-31 15:36:19 -03:00
|
|
|
const serverName = `${min.instance.botId}-server`;
|
2023-01-03 11:24:08 -03:00
|
|
|
const service = await AzureDeployerService.createInstance(deployer);
|
2020-12-31 15:36:19 -03:00
|
|
|
service.syncBotServerRepository(min.instance.botId, serverName);
|
|
|
|
}
|
|
|
|
|
2023-01-03 11:24:08 -03:00
|
|
|
public async setValue(instanceId: number, key: string, value: string) {
|
2022-01-03 13:11:21 -03:00
|
|
|
const options = <FindOptions>{ where: {} };
|
2023-07-19 07:53:44 -03:00
|
|
|
options.where = { key: key, instanceId: instanceId };
|
2018-09-16 17:00:17 -03:00
|
|
|
let admin = await GuaribasAdmin.findOne(options);
|
2019-01-31 11:32:33 -02:00
|
|
|
if (admin === null) {
|
2018-09-16 17:00:17 -03:00
|
|
|
admin = new GuaribasAdmin();
|
|
|
|
admin.key = key;
|
|
|
|
}
|
|
|
|
admin.value = value;
|
2018-09-24 11:04:36 -03:00
|
|
|
admin.instanceId = instanceId;
|
2019-03-08 06:37:13 -03:00
|
|
|
await admin.save();
|
2018-09-16 17:00:17 -03:00
|
|
|
}
|
|
|
|
|
2023-01-03 11:24:08 -03:00
|
|
|
public async updateSecurityInfo(
|
2019-01-31 11:32:33 -02:00
|
|
|
instanceId: number,
|
|
|
|
authenticatorTenant: string,
|
2020-05-14 17:16:27 -03:00
|
|
|
authenticatorAuthorityHostUrl: string
|
2019-03-09 16:59:31 -03:00
|
|
|
): Promise<IGBInstance> {
|
2022-01-03 13:11:21 -03:00
|
|
|
const options = <FindOptions>{ where: {} };
|
2019-01-31 11:32:33 -02:00
|
|
|
options.where = { instanceId: instanceId };
|
|
|
|
const item = await GuaribasInstance.findOne(options);
|
|
|
|
item.authenticatorTenant = authenticatorTenant;
|
|
|
|
item.authenticatorAuthorityHostUrl = authenticatorAuthorityHostUrl;
|
|
|
|
|
|
|
|
return item.save();
|
|
|
|
}
|
|
|
|
|
2023-01-03 11:24:08 -03:00
|
|
|
public async getValue(instanceId: number, key: string): Promise<string> {
|
2022-01-03 13:11:21 -03:00
|
|
|
const options = <FindOptions>{ where: {} };
|
2018-09-24 11:04:36 -03:00
|
|
|
options.where = { key: key, instanceId: instanceId };
|
2018-11-12 12:20:44 -02:00
|
|
|
const obj = await GuaribasAdmin.findOne(options);
|
2020-08-19 13:00:21 -03:00
|
|
|
return obj.value;
|
2018-09-16 17:00:17 -03:00
|
|
|
}
|
2018-09-24 11:04:36 -03:00
|
|
|
|
2023-11-17 14:27:12 -03:00
|
|
|
public async acquireElevatedToken(instanceId: number, root: boolean = false,
|
2023-11-19 17:56:13 -03:00
|
|
|
tokenName: string = '',
|
2023-11-17 14:27:12 -03:00
|
|
|
clientId: string = null,
|
|
|
|
clientSecret: string = null,
|
|
|
|
host: string = null,
|
|
|
|
tenant: string = null
|
|
|
|
): Promise<string> {
|
2023-07-19 07:53:02 -03:00
|
|
|
|
2023-11-20 11:29:36 -03:00
|
|
|
|
2023-07-19 10:21:38 -03:00
|
|
|
if (root) {
|
2023-07-19 07:53:02 -03:00
|
|
|
const minBoot = GBServer.globals.minBoot;
|
|
|
|
instanceId = minBoot.instance.instanceId;
|
|
|
|
}
|
2023-11-17 14:27:12 -03:00
|
|
|
GBLog.info(`Acquiring token for instanceId: ${instanceId} ${tokenName} (root: ${root}).`);
|
2023-07-19 10:20:53 -03:00
|
|
|
|
2023-01-29 12:02:14 -03:00
|
|
|
let expiresOnV;
|
|
|
|
try {
|
2023-11-17 14:27:12 -03:00
|
|
|
expiresOnV = await this.getValue(instanceId, `${tokenName}expiresOn`);
|
2023-01-29 12:02:14 -03:00
|
|
|
} catch (error) {
|
|
|
|
throw new Error(`/setupSecurity is required before running /publish.`);
|
|
|
|
}
|
2020-05-12 09:06:47 -03:00
|
|
|
|
2023-11-20 11:29:36 -03:00
|
|
|
|
2018-09-24 11:04:36 -03:00
|
|
|
return new Promise<string>(async (resolve, reject) => {
|
2018-11-12 12:20:44 -02:00
|
|
|
const instance = await this.core.loadInstanceById(instanceId);
|
2018-09-24 11:04:36 -03:00
|
|
|
|
2023-01-29 12:02:14 -03:00
|
|
|
const expiresOn = new Date(expiresOnV);
|
2018-09-24 11:04:36 -03:00
|
|
|
if (expiresOn.getTime() > new Date().getTime()) {
|
2023-11-17 14:27:12 -03:00
|
|
|
const accessToken = await this.getValue(instanceId, `${tokenName}accessToken`);
|
2018-09-24 11:04:36 -03:00
|
|
|
resolve(accessToken);
|
|
|
|
} else {
|
2023-11-20 11:29:36 -03:00
|
|
|
|
|
|
|
if (tokenName && !root) {
|
|
|
|
|
|
|
|
const refreshToken = await this.getValue(instanceId, `${tokenName}refreshToken`);
|
|
|
|
|
|
|
|
let url = urlJoin(
|
|
|
|
host,
|
|
|
|
tenant, 'oauth/token');
|
|
|
|
let buff = new Buffer(`${clientId}:${clientSecret}`);
|
|
|
|
const base64 = buff.toString('base64');
|
|
|
|
|
|
|
|
const options = {
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
Accept: '1.0',
|
|
|
|
Authorization: `Basic ${base64}`,
|
|
|
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
|
|
},
|
|
|
|
body: new URLSearchParams({
|
|
|
|
'grant_type': 'refresh_token',
|
|
|
|
'refresh_token': refreshToken
|
|
|
|
})
|
|
|
|
};
|
|
|
|
const result = await fetch(url, options);
|
|
|
|
|
|
|
|
if (result.status != 200) {
|
2023-12-12 13:51:11 -03:00
|
|
|
const text = await result.text();
|
|
|
|
throw new Error(`acquireElevatedToken error: ${result.status}: ${result.statusText} ${text}.`);
|
2023-11-20 11:29:36 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
const text = await result.text();
|
|
|
|
const token = JSON.parse(text);
|
|
|
|
|
|
|
|
// Saves token to the database.
|
|
|
|
|
|
|
|
await this.setValue(instanceId, `${tokenName}accessToken`, token['access_token']);
|
|
|
|
await this.setValue(instanceId, `${tokenName}refreshToken`, token['refresh_token']);
|
|
|
|
await this.setValue(instanceId, `${tokenName}expiresOn`,
|
|
|
|
new Date(Date.now() + token['expires_in']).toString());
|
|
|
|
await this.setValue(instanceId, `${tokenName}AntiCSRFAttackState`, null);
|
|
|
|
|
|
|
|
resolve(token['access_token']);
|
|
|
|
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
|
|
|
|
const oauth2 = tokenName ? 'oauth' : 'oauth2';
|
|
|
|
const authorizationUrl = urlJoin(
|
|
|
|
tokenName ? host : instance.authenticatorAuthorityHostUrl,
|
|
|
|
tokenName ? tenant : instance.authenticatorTenant,
|
|
|
|
`/${oauth2}/authorize`
|
|
|
|
);
|
|
|
|
|
|
|
|
const refreshToken = await this.getValue(instanceId, `${tokenName}refreshToken`);
|
|
|
|
const resource = tokenName ? '' : 'https://graph.microsoft.com';
|
|
|
|
const authenticationContext = new AuthenticationContext(authorizationUrl);
|
|
|
|
|
|
|
|
authenticationContext.acquireTokenWithRefreshToken(
|
|
|
|
refreshToken,
|
|
|
|
tokenName ? clientId : instance.marketplaceId,
|
|
|
|
tokenName ? clientSecret : instance.marketplacePassword,
|
|
|
|
resource,
|
|
|
|
async (err, res) => {
|
|
|
|
if (err !== null) {
|
2020-10-17 23:03:27 -03:00
|
|
|
reject(err);
|
2023-11-20 11:29:36 -03:00
|
|
|
} else {
|
|
|
|
const token = res as TokenResponse;
|
|
|
|
try {
|
|
|
|
await this.setValue(instanceId, `${tokenName}accessToken`, token.accessToken);
|
|
|
|
await this.setValue(instanceId, `${tokenName}refreshToken`, token.refreshToken);
|
|
|
|
await this.setValue(instanceId, `${tokenName}expiresOn`, token.expiresOn.toString());
|
|
|
|
resolve(token.accessToken);
|
|
|
|
} catch (error) {
|
|
|
|
reject(err);
|
|
|
|
}
|
2020-10-17 23:03:27 -03:00
|
|
|
}
|
2018-09-24 11:04:36 -03:00
|
|
|
}
|
2023-11-20 11:29:36 -03:00
|
|
|
);
|
|
|
|
}
|
2018-09-24 11:04:36 -03:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2020-04-01 15:42:57 -03:00
|
|
|
|
2023-01-03 11:24:08 -03:00
|
|
|
public async publish(min: GBMinInstance, packageName: string, republish: boolean): Promise<void> { }
|
2018-09-16 17:00:17 -03:00
|
|
|
}
|