new(basic.gblib): SEND FILE pdf as temporary images ViewOnce.

This commit is contained in:
me@rodrigorodriguez.com 2024-10-12 16:28:33 -03:00
parent d5cb4bd559
commit 24c8d5c625
2 changed files with 8 additions and 10 deletions

View file

@ -38,7 +38,7 @@ import { createRequire } from 'module';
const require = createRequire(import.meta.url);
import path from 'path';
import fs from 'fs/promises';
import fs from 'fs/promises';
import { NextFunction, Request, Response } from 'express';
import urljoin from 'url-join';
import { GBMinInstance } from 'botlib';
@ -110,7 +110,7 @@ export class GBSSR {
const file = await fs.readFile(preferences, 'utf8');
const data = JSON.parse(file);
data['profile']['exit_type'] = 'none';
await fs.writeFile(preferences, JSON.stringify(data));
await fs.writeFile(preferences, JSON.stringify(data));
}
}
@ -308,7 +308,7 @@ export class GBSSR {
// Checks if the bot has an .gbui published or use default.gbui.
if (!await GBUtil.exists(packagePath)) {
packagePath = GBUtil.getGBAIPath(minBoot.botId, `gbui`);
packagePath = path.join(process.env.PWD, 'packages', `default.gbui`);
}
let parts = req.url.replace(`/${botId}`, '').split('?');
let url = parts[0];
@ -344,12 +344,11 @@ export class GBSSR {
html = html.replace(/\{p\}/gi, min.botId);
html = html.replace(/\{botId\}/gi, min.botId);
const theme =
`theme-${
await (min.core as any)['getParam'](min.instance, 'Theme Color','grey' )}`;
const theme =
`theme-${await (min.core as any)['getParam'](min.instance, 'Theme Color', 'grey')}`;
html = html.replace(/\{themeColor\}/gi, theme);
html = html.replace(/\{theme\}/gi, min.instance.theme ? min.instance.theme :
'default.gbtheme');
html = html.replace(/\{title\}/gi, min.instance.title);

View file

@ -6,5 +6,4 @@ PARAM address AS string LIKE "Rua das Flores, 123, São Paulo, SP" DESCRIPTION "
DESCRIPTION "This is a the enrollment process, called when the user wants to enrol. Once all information is collected, confirm the details and inform them that their enrollment request has been successfully submitted. Provide a polite and professional tone throughout the interaction."
SAVE "enrollments.csv", id, name, birthday, email, personalid, address
SAVE "enrollments.csv", id, name, birthday, email, personalid, address