antelope-cli 1.2.2 → 1.2.4
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/ansible/onboarding-ca/README.md +105 -105
- package/ansible/onboarding-ca/onboard-ca.yml +43 -51
- package/ansible/onboarding-ca/requirements.yml +8 -8
- package/ansible/onboarding-ca/roles/onboard_ca/defaults/main.yml +77 -49
- package/ansible/onboarding-ca/roles/onboard_ca/meta/main.yml +10 -10
- package/ansible/onboarding-ca/roles/onboard_ca/tasks/main.yml +311 -193
- package/ansible/onboarding-ca/roles/onboard_ca/tasks/per_branch.yml +114 -107
- package/ansible/onboarding-ca/roles/onboard_ca/vars/main.yml +9 -9
- package/ansible/onboarding-crm/README.md +107 -0
- package/ansible/onboarding-crm/onboard-crm.yml +60 -0
- package/ansible/onboarding-crm/requirements.yml +8 -0
- package/ansible/onboarding-crm/roles/onboard_crm/defaults/main.yml +99 -0
- package/ansible/onboarding-crm/roles/onboard_crm/meta/main.yml +10 -0
- package/ansible/onboarding-crm/roles/onboard_crm/tasks/main.yml +324 -0
- package/ansible/onboarding-crm/roles/onboard_crm/tasks/per_branch.yml +121 -0
- package/ansible/onboarding-crm/roles/onboard_crm/vars/main.yml +9 -0
- package/index.js +12 -12
- package/onboarding/brand.js +21 -21
- package/onboarding/createConfig.js +71 -71
- package/onboarding/favicon.js +24 -24
- package/onboarding/index.js +62 -62
- package/onboarding/logo.js +16 -16
- package/onboarding/themes.js +92 -92
- package/onboarding/translations.js +41 -41
- package/onboarding/variablesColors.js +58 -58
- package/onboarding-ca/brand.js +13 -13
- package/onboarding-ca/index.js +94 -94
- package/onboarding-ca/riskDisclaimer.js +27 -27
- package/onboarding-ca/scss.js +24 -24
- package/onboarding-ca/templates/risk-disclaimer.html +12 -12
- package/onboarding-crm/brand.js +22 -22
- package/onboarding-crm/brandLogos.js +31 -0
- package/onboarding-crm/createConfig.js +40 -40
- package/onboarding-crm/index.js +175 -171
- package/onboarding-crm/themes.js +1 -1
- package/onboarding-crm/variablesColors.js +2 -3
- package/package.json +30 -30
package/onboarding-ca/index.js
CHANGED
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
const readline = require('readline');
|
|
2
|
-
const chalk = require('chalk');
|
|
3
|
-
const brandModule = require('./brand.js');
|
|
4
|
-
const scss = require('./scss.js');
|
|
5
|
-
const riskDisclaimer = require('./riskDisclaimer.js');
|
|
6
|
-
|
|
7
|
-
const HELP = `
|
|
8
|
-
Usage: ant-cli onboarding-ca --brand_assets_folder <folder>
|
|
9
|
-
|
|
10
|
-
Creates the Client Area brand assets in the current web-client-area checkout:
|
|
11
|
-
src/assets/other/<folder>/<folder>.scss (empty)
|
|
12
|
-
src/assets/other/<folder>/legal/risk-disclaimer.html
|
|
13
|
-
|
|
14
|
-
Options:
|
|
15
|
-
--brand_assets_folder Brand assets folder name, e.g. "zenithhorizongroup"
|
|
16
|
-
(required in non-interactive mode). This is the value used for
|
|
17
|
-
ENV_branding.brand_assets_folder. Normalized to lowercase, spaces removed.
|
|
18
|
-
-h, --help Show this help
|
|
19
|
-
|
|
20
|
-
Run from the root of a web-client-area checkout — files are written relative to the current directory.
|
|
21
|
-
`;
|
|
22
|
-
|
|
23
|
-
// Normalize to the folder convention used across the brand repos (connectedBrandName):
|
|
24
|
-
// lowercase, no spaces. Harmless when a clean folder name is already supplied.
|
|
25
|
-
const normalizeFolder = (value) => value.trim().toLowerCase().replace(/ /g, '');
|
|
26
|
-
|
|
27
|
-
function parseArgs(argv) {
|
|
28
|
-
const opts = {};
|
|
29
|
-
for (let i = 0; i < argv.length; i++) {
|
|
30
|
-
const a = argv[i];
|
|
31
|
-
if (a === '--brand_assets_folder') opts.brandAssetsFolder = argv[++i];
|
|
32
|
-
else if (a === '--help' || a === '-h') opts.help = true;
|
|
33
|
-
}
|
|
34
|
-
return opts;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function promptFolder(rl) {
|
|
38
|
-
return new Promise((resolve) => {
|
|
39
|
-
rl.question('Enter the brand assets folder name (e.g. zenithhorizongroup):\n', (name) => resolve(name));
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
async function run() {
|
|
44
|
-
// process.argv: [node, index.js, "onboarding-ca", ...flags]
|
|
45
|
-
const opts = parseArgs(process.argv.slice(3));
|
|
46
|
-
if (opts.help) {
|
|
47
|
-
console.log(HELP);
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
console.log(chalk.underline(chalk.cyan('Antelope Client-Area on-boarding\n')));
|
|
52
|
-
|
|
53
|
-
// Interactive only in a real terminal and when not forced non-interactive (CI / Ansible).
|
|
54
|
-
const interactive = Boolean(process.stdin.isTTY) && !process.env.CI;
|
|
55
|
-
|
|
56
|
-
let rl;
|
|
57
|
-
let rawFolder = opts.brandAssetsFolder;
|
|
58
|
-
if (!rawFolder) {
|
|
59
|
-
if (!interactive) {
|
|
60
|
-
console.error(chalk.red('Error: --brand_assets_folder is required in non-interactive mode.'));
|
|
61
|
-
console.log(HELP);
|
|
62
|
-
process.exitCode = 1;
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
66
|
-
rawFolder = await promptFolder(rl);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const brandAssetsFolder = normalizeFolder(rawFolder || '');
|
|
70
|
-
if (!brandAssetsFolder) {
|
|
71
|
-
console.error(chalk.red('Error: brand assets folder must not be empty.'));
|
|
72
|
-
if (rl) rl.close();
|
|
73
|
-
process.exitCode = 1;
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
brandModule.updateBrand({ brandAssetsFolder });
|
|
78
|
-
|
|
79
|
-
try {
|
|
80
|
-
console.log(chalk.bold(chalk.yellow(`\nOnboarding brand assets folder "${brandAssetsFolder}"`)));
|
|
81
|
-
console.log(chalk.bold(chalk.yellow('\nStep 1: Create brand stylesheet')));
|
|
82
|
-
await scss.start();
|
|
83
|
-
console.log(chalk.bold(chalk.yellow('\nStep 2: Create legal/risk-disclaimer.html')));
|
|
84
|
-
await riskDisclaimer.start();
|
|
85
|
-
console.log(chalk.green('\nClient-Area onboarding completed!'));
|
|
86
|
-
} catch (err) {
|
|
87
|
-
console.error(chalk.red(err) + '\n Please delete files added by this failed session.');
|
|
88
|
-
process.exitCode = 1;
|
|
89
|
-
} finally {
|
|
90
|
-
if (rl) rl.close();
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
run();
|
|
1
|
+
const readline = require('readline');
|
|
2
|
+
const chalk = require('chalk');
|
|
3
|
+
const brandModule = require('./brand.js');
|
|
4
|
+
const scss = require('./scss.js');
|
|
5
|
+
const riskDisclaimer = require('./riskDisclaimer.js');
|
|
6
|
+
|
|
7
|
+
const HELP = `
|
|
8
|
+
Usage: ant-cli onboarding-ca --brand_assets_folder <folder>
|
|
9
|
+
|
|
10
|
+
Creates the Client Area brand assets in the current web-client-area checkout:
|
|
11
|
+
src/assets/other/<folder>/<folder>.scss (empty)
|
|
12
|
+
src/assets/other/<folder>/legal/risk-disclaimer.html
|
|
13
|
+
|
|
14
|
+
Options:
|
|
15
|
+
--brand_assets_folder Brand assets folder name, e.g. "zenithhorizongroup"
|
|
16
|
+
(required in non-interactive mode). This is the value used for
|
|
17
|
+
ENV_branding.brand_assets_folder. Normalized to lowercase, spaces removed.
|
|
18
|
+
-h, --help Show this help
|
|
19
|
+
|
|
20
|
+
Run from the root of a web-client-area checkout — files are written relative to the current directory.
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
// Normalize to the folder convention used across the brand repos (connectedBrandName):
|
|
24
|
+
// lowercase, no spaces. Harmless when a clean folder name is already supplied.
|
|
25
|
+
const normalizeFolder = (value) => value.trim().toLowerCase().replace(/ /g, '');
|
|
26
|
+
|
|
27
|
+
function parseArgs(argv) {
|
|
28
|
+
const opts = {};
|
|
29
|
+
for (let i = 0; i < argv.length; i++) {
|
|
30
|
+
const a = argv[i];
|
|
31
|
+
if (a === '--brand_assets_folder') opts.brandAssetsFolder = argv[++i];
|
|
32
|
+
else if (a === '--help' || a === '-h') opts.help = true;
|
|
33
|
+
}
|
|
34
|
+
return opts;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function promptFolder(rl) {
|
|
38
|
+
return new Promise((resolve) => {
|
|
39
|
+
rl.question('Enter the brand assets folder name (e.g. zenithhorizongroup):\n', (name) => resolve(name));
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async function run() {
|
|
44
|
+
// process.argv: [node, index.js, "onboarding-ca", ...flags]
|
|
45
|
+
const opts = parseArgs(process.argv.slice(3));
|
|
46
|
+
if (opts.help) {
|
|
47
|
+
console.log(HELP);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
console.log(chalk.underline(chalk.cyan('Antelope Client-Area on-boarding\n')));
|
|
52
|
+
|
|
53
|
+
// Interactive only in a real terminal and when not forced non-interactive (CI / Ansible).
|
|
54
|
+
const interactive = Boolean(process.stdin.isTTY) && !process.env.CI;
|
|
55
|
+
|
|
56
|
+
let rl;
|
|
57
|
+
let rawFolder = opts.brandAssetsFolder;
|
|
58
|
+
if (!rawFolder) {
|
|
59
|
+
if (!interactive) {
|
|
60
|
+
console.error(chalk.red('Error: --brand_assets_folder is required in non-interactive mode.'));
|
|
61
|
+
console.log(HELP);
|
|
62
|
+
process.exitCode = 1;
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
66
|
+
rawFolder = await promptFolder(rl);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const brandAssetsFolder = normalizeFolder(rawFolder || '');
|
|
70
|
+
if (!brandAssetsFolder) {
|
|
71
|
+
console.error(chalk.red('Error: brand assets folder must not be empty.'));
|
|
72
|
+
if (rl) rl.close();
|
|
73
|
+
process.exitCode = 1;
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
brandModule.updateBrand({ brandAssetsFolder });
|
|
78
|
+
|
|
79
|
+
try {
|
|
80
|
+
console.log(chalk.bold(chalk.yellow(`\nOnboarding brand assets folder "${brandAssetsFolder}"`)));
|
|
81
|
+
console.log(chalk.bold(chalk.yellow('\nStep 1: Create brand stylesheet')));
|
|
82
|
+
await scss.start();
|
|
83
|
+
console.log(chalk.bold(chalk.yellow('\nStep 2: Create legal/risk-disclaimer.html')));
|
|
84
|
+
await riskDisclaimer.start();
|
|
85
|
+
console.log(chalk.green('\nClient-Area onboarding completed!'));
|
|
86
|
+
} catch (err) {
|
|
87
|
+
console.error(chalk.red(err) + '\n Please delete files added by this failed session.');
|
|
88
|
+
process.exitCode = 1;
|
|
89
|
+
} finally {
|
|
90
|
+
if (rl) rl.close();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
run();
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const chalk = require('chalk');
|
|
4
|
-
const brandModule = require('./brand.js');
|
|
5
|
-
|
|
6
|
-
// The disclaimer is the same fixed markup for every brand. Read the bundled template
|
|
7
|
-
// via __dirname (resolves inside the installed package, regardless of the cwd we write to).
|
|
8
|
-
const templatePath = path.join(__dirname, 'templates', 'risk-disclaimer.html');
|
|
9
|
-
|
|
10
|
-
function start() {
|
|
11
|
-
return new Promise((resolve, reject) => {
|
|
12
|
-
try {
|
|
13
|
-
const { brandAssetsFolder } = brandModule.getBrand();
|
|
14
|
-
const dir = path.join('src', 'assets', 'other', brandAssetsFolder, 'legal');
|
|
15
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
16
|
-
const file = path.join(dir, 'risk-disclaimer.html');
|
|
17
|
-
const template = fs.readFileSync(templatePath, 'utf8');
|
|
18
|
-
fs.writeFileSync(file, template, 'utf8');
|
|
19
|
-
console.log(chalk.cyan(`Created ${file}`));
|
|
20
|
-
resolve(file);
|
|
21
|
-
} catch (error) {
|
|
22
|
-
reject(error);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
module.exports = { start };
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const chalk = require('chalk');
|
|
4
|
+
const brandModule = require('./brand.js');
|
|
5
|
+
|
|
6
|
+
// The disclaimer is the same fixed markup for every brand. Read the bundled template
|
|
7
|
+
// via __dirname (resolves inside the installed package, regardless of the cwd we write to).
|
|
8
|
+
const templatePath = path.join(__dirname, 'templates', 'risk-disclaimer.html');
|
|
9
|
+
|
|
10
|
+
function start() {
|
|
11
|
+
return new Promise((resolve, reject) => {
|
|
12
|
+
try {
|
|
13
|
+
const { brandAssetsFolder } = brandModule.getBrand();
|
|
14
|
+
const dir = path.join('src', 'assets', 'other', brandAssetsFolder, 'legal');
|
|
15
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
16
|
+
const file = path.join(dir, 'risk-disclaimer.html');
|
|
17
|
+
const template = fs.readFileSync(templatePath, 'utf8');
|
|
18
|
+
fs.writeFileSync(file, template, 'utf8');
|
|
19
|
+
console.log(chalk.cyan(`Created ${file}`));
|
|
20
|
+
resolve(file);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
reject(error);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
module.exports = { start };
|
package/onboarding-ca/scss.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const chalk = require('chalk');
|
|
4
|
-
const brandModule = require('./brand.js');
|
|
5
|
-
|
|
6
|
-
// Creates the brand stylesheet. It is intentionally EMPTY — matches every existing
|
|
7
|
-
// brand in web-client-area (git blob e69de29b). brands.ts require()s it dynamically.
|
|
8
|
-
function start() {
|
|
9
|
-
return new Promise((resolve, reject) => {
|
|
10
|
-
try {
|
|
11
|
-
const { brandAssetsFolder } = brandModule.getBrand();
|
|
12
|
-
const dir = path.join('src', 'assets', 'other', brandAssetsFolder);
|
|
13
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
14
|
-
const file = path.join(dir, `${brandAssetsFolder}.scss`);
|
|
15
|
-
fs.writeFileSync(file, '', 'utf8');
|
|
16
|
-
console.log(chalk.cyan(`Created ${file}`));
|
|
17
|
-
resolve(file);
|
|
18
|
-
} catch (error) {
|
|
19
|
-
reject(error);
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
module.exports = { start };
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const chalk = require('chalk');
|
|
4
|
+
const brandModule = require('./brand.js');
|
|
5
|
+
|
|
6
|
+
// Creates the brand stylesheet. It is intentionally EMPTY — matches every existing
|
|
7
|
+
// brand in web-client-area (git blob e69de29b). brands.ts require()s it dynamically.
|
|
8
|
+
function start() {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
try {
|
|
11
|
+
const { brandAssetsFolder } = brandModule.getBrand();
|
|
12
|
+
const dir = path.join('src', 'assets', 'other', brandAssetsFolder);
|
|
13
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
14
|
+
const file = path.join(dir, `${brandAssetsFolder}.scss`);
|
|
15
|
+
fs.writeFileSync(file, '', 'utf8');
|
|
16
|
+
console.log(chalk.cyan(`Created ${file}`));
|
|
17
|
+
resolve(file);
|
|
18
|
+
} catch (error) {
|
|
19
|
+
reject(error);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
module.exports = { start };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<div class="page-wrapper push-up">
|
|
2
|
-
<a
|
|
3
|
-
class="disclaimer__top-image push-down"
|
|
4
|
-
href="{{ 'RISK.DISCLAIMER.SPONSOR.URL' | translate }}"
|
|
5
|
-
target="_blank"
|
|
6
|
-
layout="row"
|
|
7
|
-
layout-align="center center"
|
|
8
|
-
><img alt=""
|
|
9
|
-
/></a>
|
|
10
|
-
<div class="disclaimer__title"><span translate="COMMON.RISK_DISCLAIMER"></span>:</div>
|
|
11
|
-
<p translate="DISCLAIMER" translate-value-risk="{{$ctrl.risk}}"></p>
|
|
12
|
-
</div>
|
|
1
|
+
<div class="page-wrapper push-up">
|
|
2
|
+
<a
|
|
3
|
+
class="disclaimer__top-image push-down"
|
|
4
|
+
href="{{ 'RISK.DISCLAIMER.SPONSOR.URL' | translate }}"
|
|
5
|
+
target="_blank"
|
|
6
|
+
layout="row"
|
|
7
|
+
layout-align="center center"
|
|
8
|
+
><img alt=""
|
|
9
|
+
/></a>
|
|
10
|
+
<div class="disclaimer__title"><span translate="COMMON.RISK_DISCLAIMER"></span>:</div>
|
|
11
|
+
<p translate="DISCLAIMER" translate-value-risk="{{$ctrl.risk}}"></p>
|
|
12
|
+
</div>
|
package/onboarding-crm/brand.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
let brand = {
|
|
2
|
-
brandId: '',
|
|
3
|
-
brandName: '',
|
|
4
|
-
connectedBrandName: '',
|
|
5
|
-
color: '',
|
|
6
|
-
logo: '',
|
|
7
|
-
languages: null,
|
|
8
|
-
favicon: '',
|
|
9
|
-
FCMSenderId: '',
|
|
10
|
-
type: '',
|
|
11
|
-
baseUrl: ''
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
function updateBrand(updatedBrand) {
|
|
15
|
-
brand = { ...brand, ...updatedBrand };
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function getBrand() {
|
|
19
|
-
return brand;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
module.exports = { updateBrand, getBrand };
|
|
1
|
+
let brand = {
|
|
2
|
+
brandId: '',
|
|
3
|
+
brandName: '',
|
|
4
|
+
connectedBrandName: '',
|
|
5
|
+
color: '',
|
|
6
|
+
logo: '',
|
|
7
|
+
languages: null,
|
|
8
|
+
favicon: '',
|
|
9
|
+
FCMSenderId: '',
|
|
10
|
+
type: '',
|
|
11
|
+
baseUrl: ''
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
function updateBrand(updatedBrand) {
|
|
15
|
+
brand = { ...brand, ...updatedBrand };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function getBrand() {
|
|
19
|
+
return brand;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
module.exports = { updateBrand, getBrand };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const chalk = require('chalk');
|
|
3
|
+
const brandModule = require('./brand.js');
|
|
4
|
+
|
|
5
|
+
const brandLogosPath = 'src/configs/brand-logos.json';
|
|
6
|
+
|
|
7
|
+
// Register the brand's logo in src/configs/brand-logos.json under the
|
|
8
|
+
// "theme-template-<connectedBrandName>" key (matches the templateTheme written to configs.ts).
|
|
9
|
+
// This is the COMMITTED logo registry (configs.ts is gitignored). Idempotent: re-running with
|
|
10
|
+
// the same logo leaves the file unchanged.
|
|
11
|
+
function start() {
|
|
12
|
+
return new Promise((resolve, reject) => {
|
|
13
|
+
try {
|
|
14
|
+
if (!fs.existsSync(brandLogosPath)) {
|
|
15
|
+
console.log(chalk.yellow(`${brandLogosPath} not found — skipping logo registration.`));
|
|
16
|
+
return resolve(null);
|
|
17
|
+
}
|
|
18
|
+
const { connectedBrandName, logo } = brandModule.getBrand();
|
|
19
|
+
const key = `theme-template-${connectedBrandName}`;
|
|
20
|
+
const logos = JSON.parse(fs.readFileSync(brandLogosPath, 'utf8'));
|
|
21
|
+
logos[key] = logo;
|
|
22
|
+
fs.writeFileSync(brandLogosPath, JSON.stringify(logos, null, 2) + '\n', 'utf8');
|
|
23
|
+
console.log(chalk.cyan(`brand-logos.json updated: ${key} -> ${logo}`));
|
|
24
|
+
resolve(null);
|
|
25
|
+
} catch (error) {
|
|
26
|
+
reject(error);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
module.exports = { start };
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const brandModule = require('./brand.js');
|
|
3
|
-
const chalk = require('chalk');
|
|
4
|
-
const configsFilePath = 'src/configs/configs.ts';
|
|
5
|
-
|
|
6
|
-
// Writes configs.ts (devops copy-paste this into the env's Consul config).
|
|
7
|
-
// Brand references use the Antelope ID (connectedBrandName = brand_id); baseUrl comes from the flag.
|
|
8
|
-
function start() {
|
|
9
|
-
return new Promise((resolve, reject) => {
|
|
10
|
-
fs.mkdirSync('src/configs', { recursive: true });
|
|
11
|
-
fs.writeFile(configsFilePath, updateConfigFile(), 'utf8', (error) => {
|
|
12
|
-
if (error) {
|
|
13
|
-
reject(error);
|
|
14
|
-
} else {
|
|
15
|
-
console.log(chalk.cyan('configs.ts file updated successfully!'));
|
|
16
|
-
resolve(null);
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const updateConfigFile = () => {
|
|
23
|
-
const brand = brandModule.getBrand();
|
|
24
|
-
return `export const configs: WebCrmConfig = {
|
|
25
|
-
baseUrl: '${brand.baseUrl}',
|
|
26
|
-
appId: 0,
|
|
27
|
-
type: '${brand.type}',
|
|
28
|
-
defaultLanguage: 'en',
|
|
29
|
-
gaTrackingID: 'UA-70456753-2',
|
|
30
|
-
colorTheme: 'theme-${brand.connectedBrandName}',
|
|
31
|
-
templateTheme: 'theme-template-${brand.connectedBrandName}',
|
|
32
|
-
title: '${brand.
|
|
33
|
-
favicon: '${brand.favicon}',
|
|
34
|
-
|
|
35
|
-
FCMSenderId: '${brand.FCMSenderId}',
|
|
36
|
-
brandAssetsFolder: '${brand.connectedBrandName}'
|
|
37
|
-
};`;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
module.exports = { start };
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const brandModule = require('./brand.js');
|
|
3
|
+
const chalk = require('chalk');
|
|
4
|
+
const configsFilePath = 'src/configs/configs.ts';
|
|
5
|
+
|
|
6
|
+
// Writes configs.ts (devops copy-paste this into the env's Consul config).
|
|
7
|
+
// Brand references use the Antelope ID (connectedBrandName = brand_id); baseUrl comes from the flag.
|
|
8
|
+
function start() {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
fs.mkdirSync('src/configs', { recursive: true });
|
|
11
|
+
fs.writeFile(configsFilePath, updateConfigFile(), 'utf8', (error) => {
|
|
12
|
+
if (error) {
|
|
13
|
+
reject(error);
|
|
14
|
+
} else {
|
|
15
|
+
console.log(chalk.cyan('configs.ts file updated successfully!'));
|
|
16
|
+
resolve(null);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const updateConfigFile = () => {
|
|
23
|
+
const brand = brandModule.getBrand();
|
|
24
|
+
return `export const configs: WebCrmConfig = {
|
|
25
|
+
baseUrl: '${brand.baseUrl}',
|
|
26
|
+
appId: 0,
|
|
27
|
+
type: '${brand.type}',
|
|
28
|
+
defaultLanguage: 'en',
|
|
29
|
+
gaTrackingID: 'UA-70456753-2',
|
|
30
|
+
colorTheme: 'theme-${brand.connectedBrandName}',
|
|
31
|
+
templateTheme: 'theme-template-${brand.connectedBrandName}',
|
|
32
|
+
title: '${brand.brandName}',
|
|
33
|
+
favicon: '${brand.favicon}',
|
|
34
|
+
logo: '${brand.logo}',
|
|
35
|
+
FCMSenderId: '${brand.FCMSenderId}',
|
|
36
|
+
brandAssetsFolder: '${brand.connectedBrandName}'
|
|
37
|
+
};`;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
module.exports = { start };
|