dequanto 0.1.13 → 0.1.14
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/lib/cjs/config/ConfigProvider.d.ts +11 -2
- package/lib/cjs/config/ConfigProvider.js +75 -2
- package/lib/cjs/config/ConfigProvider.js.map +1 -1
- package/lib/esm/config/ConfigProvider.d.ts +11 -2
- package/lib/esm/config/ConfigProvider.js.map +1 -1
- package/lib/esm/config/ConfigProvider.mjs +71 -2
- package/package.json +3 -3
- package/src/config/ConfigProvider.ts +88 -2
- package/lib/cjs/config/ConfigProviderBrowser.d.ts +0 -8
- package/lib/cjs/config/ConfigProviderBrowser.js +0 -20
- package/lib/cjs/config/ConfigProviderBrowser.js.map +0 -1
- package/lib/cjs/config/ConfigProviderIsoPlatform.d.ts +0 -11
- package/lib/cjs/config/ConfigProviderIsoPlatform.js +0 -80
- package/lib/cjs/config/ConfigProviderIsoPlatform.js.map +0 -1
- package/lib/esm/config/ConfigProviderBrowser.d.ts +0 -8
- package/lib/esm/config/ConfigProviderBrowser.js.map +0 -1
- package/lib/esm/config/ConfigProviderBrowser.mjs +0 -13
- package/lib/esm/config/ConfigProviderIsoPlatform.d.ts +0 -11
- package/lib/esm/config/ConfigProviderIsoPlatform.js.map +0 -1
- package/lib/esm/config/ConfigProviderIsoPlatform.mjs +0 -73
- package/src/config/ConfigProviderBrowser.ts +0 -21
- package/src/config/ConfigProviderIsoPlatform.ts +0 -90
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import AppConfig from 'appcfg';
|
|
2
|
+
import { Config as Appcfg } from 'appcfg/Config';
|
|
3
|
+
import { IConfigProvider, TConfigParamsNode } from './AConfigBase';
|
|
4
|
+
import { IConfigData } from './interface/IConfigData';
|
|
5
|
+
export declare class ConfigProvider implements IConfigProvider {
|
|
6
|
+
config: Appcfg<IConfigData>;
|
|
7
|
+
fetch(parameters?: TConfigParamsNode): Promise<AppConfig<any> & IConfigData>;
|
|
8
|
+
extend(json: Partial<IConfigData>): Promise<void>;
|
|
9
|
+
private getSourcesNode;
|
|
10
|
+
private getSourcesBrowser;
|
|
11
|
+
}
|
|
@@ -1,7 +1,80 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.ConfigProvider = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
7
|
+
const appcfg_1 = __importDefault(require("appcfg"));
|
|
8
|
+
const _cli_1 = require("../utils/$cli.js");
|
|
9
|
+
const _secret_1 = require("../utils/$secret.js");
|
|
10
|
+
const _require_1 = require("../utils/$require.js");
|
|
11
|
+
const _const_1 = require("../utils/$const.js");
|
|
12
|
+
const ConfigDefaults_1 = require("./ConfigDefaults.js");
|
|
13
|
+
class ConfigProvider {
|
|
14
|
+
async fetch(parameters) {
|
|
15
|
+
let sources = _const_1.is_BROWSER
|
|
16
|
+
? await this.getSourcesBrowser(parameters)
|
|
17
|
+
: await this.getSourcesNode(parameters);
|
|
18
|
+
let cfg = await appcfg_1.default.fetch(sources);
|
|
19
|
+
if (this.config != null) {
|
|
20
|
+
this.config.$extend(cfg.toJSON());
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
this.config = cfg;
|
|
24
|
+
}
|
|
25
|
+
return this.config = cfg;
|
|
26
|
+
}
|
|
27
|
+
async extend(json) {
|
|
28
|
+
_require_1.$require.notNull(this.config, `Config was not fetched yet. Call fetch() first.`);
|
|
29
|
+
await this.config.$write(json);
|
|
30
|
+
}
|
|
31
|
+
async getSourcesNode(parameters) {
|
|
32
|
+
let unlockedAccountsKey = await _secret_1.$secret.getPin(parameters);
|
|
33
|
+
let configPathAccounts = _cli_1.$cli.getParamValue('config-accounts', parameters) ?? '%APPDATA%/.dequanto/accounts.json';
|
|
34
|
+
let configPathGlobal = _cli_1.$cli.getParamValue('config-global', parameters) ?? '%APPDATA%/.dequanto/config.yml';
|
|
35
|
+
return [
|
|
36
|
+
{
|
|
37
|
+
config: ConfigDefaults_1.ConfigDefaults,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
path: `./configs/dequanto.yml`,
|
|
41
|
+
optional: true,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
path: configPathGlobal,
|
|
45
|
+
writable: true,
|
|
46
|
+
optional: true,
|
|
47
|
+
extendArrays: false,
|
|
48
|
+
},
|
|
49
|
+
unlockedAccountsKey ? {
|
|
50
|
+
name: 'accounts',
|
|
51
|
+
path: configPathAccounts,
|
|
52
|
+
writable: true,
|
|
53
|
+
optional: true,
|
|
54
|
+
secret: unlockedAccountsKey
|
|
55
|
+
} : null,
|
|
56
|
+
{
|
|
57
|
+
path: 'package.json',
|
|
58
|
+
getterProperty: 'dequanto',
|
|
59
|
+
optional: true,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
path: 'dequanto.yml',
|
|
63
|
+
optional: true
|
|
64
|
+
},
|
|
65
|
+
parameters?.dotenv ? {
|
|
66
|
+
dotenv: true
|
|
67
|
+
} : null,
|
|
68
|
+
];
|
|
69
|
+
}
|
|
70
|
+
async getSourcesBrowser(parameters) {
|
|
71
|
+
return [
|
|
72
|
+
{
|
|
73
|
+
config: ConfigDefaults_1.ConfigDefaults
|
|
74
|
+
}
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.ConfigProvider = ConfigProvider;
|
|
6
79
|
//# sourceMappingURL=ConfigProvider.js.map
|
|
7
80
|
//# sourceMappingURL=ConfigProvider.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigProvider.js","sourceRoot":"","sources":["../../../src/config/ConfigProvider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConfigProvider.js","sourceRoot":"","sources":["../../../src/config/ConfigProvider.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA8B;AAK9B,wCAAqC;AACrC,8CAA2C;AAC3C,uDAAoD;AACpD,mDAAoD;AACpD,qDAAkD;AAGlD,MAAa,cAAc;IAIvB,KAAK,CAAC,KAAK,CAAE,UAA8B;QAEvC,IAAI,OAAO,GAAG,mBAAU;YACpB,CAAC,CAAC,MAAM,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC;YAC1C,CAAC,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CACtC;QAEL,IAAI,GAAG,GAAG,MAAM,gBAAS,CAAC,KAAK,CAAc,OAAO,CAAC,CAAC;QAEtD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE;YACrB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;SACrC;aAAM;YACH,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;SACrB;QAED,OAAO,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,MAAM,CAAE,IAA0B;QACpC,mBAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,iDAAiD,CAAC,CAAC;QACjF,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAGO,KAAK,CAAC,cAAc,CAAE,UAA6B;QACvD,IAAI,mBAAmB,GAAG,MAAM,iBAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC3D,IAAI,kBAAkB,GAAG,WAAI,CAAC,aAAa,CAAC,iBAAiB,EAAE,UAAU,CAAC,IAAI,mCAAmC,CAAC;QAClH,IAAI,gBAAgB,GAAG,WAAI,CAAC,aAAa,CAAC,eAAe,EAAE,UAAU,CAAC,IAAI,gCAAgC,CAAC;QAE3G,OAAO;YACH;gBACI,MAAM,EAAE,+BAAc;aACzB;YACD;gBACI,IAAI,EAAE,wBAAwB;gBAC9B,QAAQ,EAAE,IAAI;aACjB;YACD;gBACI,IAAI,EAAE,gBAAgB;gBACtB,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,IAAI;gBACd,YAAY,EAAE,KAAK;aACtB;YACD,mBAAmB,CAAC,CAAC,CAAC;gBAClB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,kBAAkB;gBACxB,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE,mBAAmB;aAC9B,CAAC,CAAC,CAAC,IAAI;YACR;gBACI,IAAI,EAAE,cAAc;gBACpB,cAAc,EAAE,UAAU;gBAC1B,QAAQ,EAAE,IAAI;aACjB;YACD;gBACI,IAAI,EAAE,cAAc;gBACpB,QAAQ,EAAE,IAAI;aACjB;YACD,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;gBACjB,MAAM,EAAE,IAAI;aACf,CAAC,CAAC,CAAC,IAAI;SACX,CAAC;IACN,CAAC;IAEO,KAAK,CAAC,iBAAiB,CAAE,UAA6B;QAC1D,OAAO;YACH;gBACI,MAAM,EAAE,+BAAc;aACzB;SACJ,CAAC;IACN,CAAC;CACJ;AA5ED,wCA4EC"}
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import AppConfig from 'appcfg';
|
|
2
|
+
import { Config as Appcfg } from 'appcfg/Config';
|
|
3
|
+
import { IConfigProvider, TConfigParamsNode } from './AConfigBase';
|
|
4
|
+
import { IConfigData } from './interface/IConfigData';
|
|
5
|
+
export declare class ConfigProvider implements IConfigProvider {
|
|
6
|
+
config: Appcfg<IConfigData>;
|
|
7
|
+
fetch(parameters?: TConfigParamsNode): Promise<AppConfig<any> & IConfigData>;
|
|
8
|
+
extend(json: Partial<IConfigData>): Promise<void>;
|
|
9
|
+
private getSourcesNode;
|
|
10
|
+
private getSourcesBrowser;
|
|
11
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigProvider.js","sourceRoot":"","sources":["../../../src/config/ConfigProvider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConfigProvider.js","sourceRoot":"","sources":["../../../src/config/ConfigProvider.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA8B;AAK9B,wCAAqC;AACrC,8CAA2C;AAC3C,uDAAoD;AACpD,mDAAoD;AACpD,qDAAkD;AAGlD,MAAa,cAAc;IAIvB,KAAK,CAAC,KAAK,CAAE,UAA8B;QAEvC,IAAI,OAAO,GAAG,mBAAU;YACpB,CAAC,CAAC,MAAM,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC;YAC1C,CAAC,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CACtC;QAEL,IAAI,GAAG,GAAG,MAAM,gBAAS,CAAC,KAAK,CAAc,OAAO,CAAC,CAAC;QAEtD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE;YACrB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;SACrC;aAAM;YACH,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;SACrB;QAED,OAAO,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,MAAM,CAAE,IAA0B;QACpC,mBAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,iDAAiD,CAAC,CAAC;QACjF,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAGO,KAAK,CAAC,cAAc,CAAE,UAA6B;QACvD,IAAI,mBAAmB,GAAG,MAAM,iBAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC3D,IAAI,kBAAkB,GAAG,WAAI,CAAC,aAAa,CAAC,iBAAiB,EAAE,UAAU,CAAC,IAAI,mCAAmC,CAAC;QAClH,IAAI,gBAAgB,GAAG,WAAI,CAAC,aAAa,CAAC,eAAe,EAAE,UAAU,CAAC,IAAI,gCAAgC,CAAC;QAE3G,OAAO;YACH;gBACI,MAAM,EAAE,+BAAc;aACzB;YACD;gBACI,IAAI,EAAE,wBAAwB;gBAC9B,QAAQ,EAAE,IAAI;aACjB;YACD;gBACI,IAAI,EAAE,gBAAgB;gBACtB,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,IAAI;gBACd,YAAY,EAAE,KAAK;aACtB;YACD,mBAAmB,CAAC,CAAC,CAAC;gBAClB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,kBAAkB;gBACxB,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE,mBAAmB;aAC9B,CAAC,CAAC,CAAC,IAAI;YACR;gBACI,IAAI,EAAE,cAAc;gBACpB,cAAc,EAAE,UAAU;gBAC1B,QAAQ,EAAE,IAAI;aACjB;YACD;gBACI,IAAI,EAAE,cAAc;gBACpB,QAAQ,EAAE,IAAI;aACjB;YACD,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;gBACjB,MAAM,EAAE,IAAI;aACf,CAAC,CAAC,CAAC,IAAI;SACX,CAAC;IACN,CAAC;IAEO,KAAK,CAAC,iBAAiB,CAAE,UAA6B;QAC1D,OAAO;YACH;gBACI,MAAM,EAAE,+BAAc;aACzB;SACJ,CAAC;IACN,CAAC;CACJ;AA5ED,wCA4EC"}
|
|
@@ -1,4 +1,73 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import AppConfig from 'appcfg';
|
|
2
|
+
import { $cli } from '../utils/$cli.mjs';
|
|
3
|
+
import { $secret } from '../utils/$secret.mjs';
|
|
4
|
+
import { $require } from '../utils/$require.mjs';
|
|
5
|
+
import { is_BROWSER } from '../utils/$const.mjs';
|
|
6
|
+
import { ConfigDefaults } from './ConfigDefaults.mjs';
|
|
7
|
+
export class ConfigProvider {
|
|
8
|
+
async fetch(parameters) {
|
|
9
|
+
let sources = is_BROWSER
|
|
10
|
+
? await this.getSourcesBrowser(parameters)
|
|
11
|
+
: await this.getSourcesNode(parameters);
|
|
12
|
+
let cfg = await AppConfig.fetch(sources);
|
|
13
|
+
if (this.config != null) {
|
|
14
|
+
this.config.$extend(cfg.toJSON());
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
this.config = cfg;
|
|
18
|
+
}
|
|
19
|
+
return this.config = cfg;
|
|
20
|
+
}
|
|
21
|
+
async extend(json) {
|
|
22
|
+
$require.notNull(this.config, `Config was not fetched yet. Call fetch() first.`);
|
|
23
|
+
await this.config.$write(json);
|
|
24
|
+
}
|
|
25
|
+
async getSourcesNode(parameters) {
|
|
26
|
+
let unlockedAccountsKey = await $secret.getPin(parameters);
|
|
27
|
+
let configPathAccounts = $cli.getParamValue('config-accounts', parameters) ?? '%APPDATA%/.dequanto/accounts.json';
|
|
28
|
+
let configPathGlobal = $cli.getParamValue('config-global', parameters) ?? '%APPDATA%/.dequanto/config.yml';
|
|
29
|
+
return [
|
|
30
|
+
{
|
|
31
|
+
config: ConfigDefaults,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
path: `./configs/dequanto.yml`,
|
|
35
|
+
optional: true,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
path: configPathGlobal,
|
|
39
|
+
writable: true,
|
|
40
|
+
optional: true,
|
|
41
|
+
extendArrays: false,
|
|
42
|
+
},
|
|
43
|
+
unlockedAccountsKey ? {
|
|
44
|
+
name: 'accounts',
|
|
45
|
+
path: configPathAccounts,
|
|
46
|
+
writable: true,
|
|
47
|
+
optional: true,
|
|
48
|
+
secret: unlockedAccountsKey
|
|
49
|
+
} : null,
|
|
50
|
+
{
|
|
51
|
+
path: 'package.json',
|
|
52
|
+
getterProperty: 'dequanto',
|
|
53
|
+
optional: true,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
path: 'dequanto.yml',
|
|
57
|
+
optional: true
|
|
58
|
+
},
|
|
59
|
+
parameters?.dotenv ? {
|
|
60
|
+
dotenv: true
|
|
61
|
+
} : null,
|
|
62
|
+
];
|
|
63
|
+
}
|
|
64
|
+
async getSourcesBrowser(parameters) {
|
|
65
|
+
return [
|
|
66
|
+
{
|
|
67
|
+
config: ConfigDefaults
|
|
68
|
+
}
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
3
72
|
//# sourceMappingURL=ConfigProvider.js.map
|
|
4
73
|
//# sourceMappingURL=ConfigProvider.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dequanto",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Alex Kit",
|
|
6
6
|
"email": "alex.kit@atmajs.com"
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@types/node": "^20.12.11",
|
|
38
38
|
"@types/sinon": "^10.0.13",
|
|
39
39
|
"app-bundler": "^0.2.13",
|
|
40
|
+
"atma": "^0.15.22",
|
|
40
41
|
"atma-io-middleware-base": "^1.0.51",
|
|
41
42
|
"atma-io-middleware-importer": "^1.1.38",
|
|
42
43
|
"atma-io-middleware-uglify": "^1.1.25",
|
|
@@ -47,6 +48,7 @@
|
|
|
47
48
|
"hardhat": "^2.19.2",
|
|
48
49
|
"shellbee": "^0.5.29",
|
|
49
50
|
"ts-nameof": "^5.0.0",
|
|
51
|
+
"typescript": "^5.3.3",
|
|
50
52
|
"web3": "^1.6.0"
|
|
51
53
|
},
|
|
52
54
|
"dependencies": {
|
|
@@ -59,13 +61,11 @@
|
|
|
59
61
|
"a-di": "^1.0.29",
|
|
60
62
|
"alot": "^0.3.11",
|
|
61
63
|
"appcfg": "^0.5.4",
|
|
62
|
-
"atma": "^0.15.22",
|
|
63
64
|
"atma-io": "^1.3.4",
|
|
64
65
|
"atma-utils": "^0.2.65",
|
|
65
66
|
"class-json": "^0.4.1",
|
|
66
67
|
"includejs": "^0.17.4",
|
|
67
68
|
"memd": "^0.3.15",
|
|
68
|
-
"typescript": "^5.3.3",
|
|
69
69
|
"ws": "^8.16.0"
|
|
70
70
|
},
|
|
71
71
|
"app-bundler": {
|
|
@@ -1,4 +1,90 @@
|
|
|
1
|
-
import
|
|
1
|
+
import AppConfig from 'appcfg'
|
|
2
|
+
import { Config as Appcfg } from 'appcfg/Config';
|
|
2
3
|
|
|
4
|
+
import { IConfigProvider, TConfigParamsNode } from './AConfigBase';
|
|
5
|
+
import { IConfigData } from './interface/IConfigData';
|
|
6
|
+
import { $cli } from '../utils/$cli';
|
|
7
|
+
import { $secret } from '../utils/$secret';
|
|
8
|
+
import { $require } from '@dequanto/utils/$require';
|
|
9
|
+
import { is_BROWSER } from '@dequanto/utils/$const';
|
|
10
|
+
import { ConfigDefaults } from './ConfigDefaults';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export class ConfigProvider implements IConfigProvider {
|
|
14
|
+
|
|
15
|
+
config: Appcfg<IConfigData>
|
|
16
|
+
|
|
17
|
+
async fetch (parameters?: TConfigParamsNode) {
|
|
18
|
+
|
|
19
|
+
let sources = is_BROWSER
|
|
20
|
+
? await this.getSourcesBrowser(parameters)
|
|
21
|
+
: await this.getSourcesNode(parameters)
|
|
22
|
+
;
|
|
23
|
+
|
|
24
|
+
let cfg = await AppConfig.fetch<IConfigData>(sources);
|
|
25
|
+
|
|
26
|
+
if (this.config != null) {
|
|
27
|
+
this.config.$extend(cfg.toJSON());
|
|
28
|
+
} else {
|
|
29
|
+
this.config = cfg;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return this.config = cfg;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async extend (json: Partial<IConfigData>): Promise<void> {
|
|
36
|
+
$require.notNull(this.config, `Config was not fetched yet. Call fetch() first.`);
|
|
37
|
+
await this.config.$write(json);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
private async getSourcesNode (parameters: TConfigParamsNode) {
|
|
42
|
+
let unlockedAccountsKey = await $secret.getPin(parameters);
|
|
43
|
+
let configPathAccounts = $cli.getParamValue('config-accounts', parameters) ?? '%APPDATA%/.dequanto/accounts.json';
|
|
44
|
+
let configPathGlobal = $cli.getParamValue('config-global', parameters) ?? '%APPDATA%/.dequanto/config.yml';
|
|
45
|
+
|
|
46
|
+
return [
|
|
47
|
+
{
|
|
48
|
+
config: ConfigDefaults,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
path: `./configs/dequanto.yml`,
|
|
52
|
+
optional: true,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
path: configPathGlobal,
|
|
56
|
+
writable: true,
|
|
57
|
+
optional: true,
|
|
58
|
+
extendArrays: false,
|
|
59
|
+
},
|
|
60
|
+
unlockedAccountsKey ? {
|
|
61
|
+
name: 'accounts',
|
|
62
|
+
path: configPathAccounts,
|
|
63
|
+
writable: true,
|
|
64
|
+
optional: true,
|
|
65
|
+
secret: unlockedAccountsKey
|
|
66
|
+
} : null,
|
|
67
|
+
{
|
|
68
|
+
path: 'package.json',
|
|
69
|
+
getterProperty: 'dequanto',
|
|
70
|
+
optional: true,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
path: 'dequanto.yml',
|
|
74
|
+
optional: true
|
|
75
|
+
},
|
|
76
|
+
parameters?.dotenv ? {
|
|
77
|
+
dotenv: true
|
|
78
|
+
} : null,
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
private async getSourcesBrowser (parameters: TConfigParamsNode) {
|
|
83
|
+
return [
|
|
84
|
+
{
|
|
85
|
+
config: ConfigDefaults
|
|
86
|
+
}
|
|
87
|
+
];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
3
90
|
|
|
4
|
-
export const ConfigProvider = ConfigProviderPlatform;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type AppConfig from 'appcfg';
|
|
2
|
-
import type { IConfigProvider, TConfigParamsBrowser } from './AConfigBase';
|
|
3
|
-
import type { IConfigData } from './interface/IConfigData';
|
|
4
|
-
export declare class ConfigProviderPlatform implements IConfigProvider {
|
|
5
|
-
config: AppConfig<IConfigData>;
|
|
6
|
-
fetch(parameters?: TConfigParamsBrowser): Promise<IConfigData>;
|
|
7
|
-
extend(json: Partial<IConfigData>): Promise<void>;
|
|
8
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ConfigProviderPlatform = void 0;
|
|
7
|
-
const _require_1 = require("../utils/$require.js");
|
|
8
|
-
const dequanto_yml_1 = __importDefault({"accounts":null,"settings":null,"tokens":null,"blockchainExplorer":{"bsc":{"key":"MB1EM53BDJFKDIHUZ5JJT946BJJUQIHFP2","host":"https://api.bscscan.com","www":"https://bscscan.com"},"eth":{"key":"FGCTXVXMZAPPW91KCZ91AMZFGBY1GZZB51","host":"https://api.etherscan.io","www":"https://etherscan.io"},"eth:goerli":{"key":"FGCTXVXMZAPPW91KCZ91AMZFGBY1GZZB51","host":"https://api-goerli.etherscan.io","www":"https://goerli.etherscan.io"},"eth:sepolia":{"key":"FGCTXVXMZAPPW91KCZ91AMZFGBY1GZZB51","host":"https://api-sepolia.etherscan.io","www":"https://sepolia.etherscan.io"},"polygon":{"key":"AQHXXI3KIU5FC8Y1WXX8A346PENKUX7BCE","host":"https://api.polygonscan.com","www":"https://polygonscan.com"},"polygon:mumbai":{"key":"AQHXXI3KIU5FC8Y1WXX8A346PENKUX7BCE","host":"https://api-testnet.polygonscan.com","www":"https://mumbai.polygonscan.com"},"xdai":{"key":"123","host":"https://blockscout.com/xdai/mainnet","www":"https://blockscout.com/xdai/mainnet"},"gnosis":{"key":"V6ENPXHS2E74MCBUXWG8WGYTA3ZPYN2WT3","host":"https://api.gnosisscan.io/","www":"https://gnosisscan.io"},"celo":{"key":"3A9ZR89MEUQ51YC3SI1VAYAATFW419EEYR","host":"https://api.celoscan.io","www":"https://celoscan.io"},"heco":{"key":"123","host":"https://api.hecoinfo.com","www":"https://www.hecoinfo.com"},"optimism":{"key":"8SG776V5FEBDJMHTMETG3PT6KT1921X6AS","host":"https://api-optimistic.etherscan.io","www":"https://optimistic.etherscan.io"},"avalanche":{"key":"TMEXUDTD37PNTAIDJACPHQTP5BB42XD8Q3","host":"https://api.snowtrace.io","www":"https://snowtrace.io"},"cronos":{"key":"V5A6VRJ5TR9KIQEI7HIHVGK5C9NYCQS36E","host":"https://api.cronoscan.com","www":"https://cronoscan.com"},"fantom":{"key":"9PFA8WNHPCRAZS2GEJXPNN83SZS84JWGG7","host":"https://api.ftmscan.com","www":"https://ftmscan.com"},"aurora":{"key":"123","host":"https://explorer.aurora.dev","www":"https://explorer.aurora.dev"},"arbitrum":{"key":"SD1353XFNU8QYTP4KDK58AHMZBQCE79Q1J","host":"https://api.arbiscan.io","www":"https://arbiscan.io"},"metis":{"key":"123","host":"https://andromeda-explorer.metis.io/api","www":"https://andromeda-explorer.metis.io"},"base":{"key":"GS1M3QWY41Z36RTV56MV3N1BRKCJ9GWI3C","host":"https://api.basescan.org","www":"https://basescan.org"},"base:test":{"key":"GS1M3QWY41Z36RTV56MV3N1BRKCJ9GWI3C","host":"https://api-goerli.basescan.org","www":"https://goerli.basescan.org"}},"web3":{"eth":{"endpoints":[{"url":"https://eth.public-rpc.com"},{"url":"https://main-light.eth.linkpool.io","rateLimit":"2000/5m"},{"url":"wss://main-light.eth.linkpool.io/ws","rateLimit":"2000/5m"}]},"eth:goerli":{"endpoints":[{"url":"https://goerli.infura.io/v3/a83f91c556054576a4c608ad4312720b"},{"url":"wss://goerli.infura.io/ws/v3/a83f91c556054576a4c608ad4312720b"}]},"eth:sepolia":{"chainId":11155111,"endpoints":[{"url":"https://1rpc.io/sepolia"},{"url":"wss://ethereum-sepolia.publicnode.com"}]},"polygon":{"endpoints":[{"url":"https://polygon-rpc.com"}]},"polygon:mumbai":{"chainId":80001,"endpoints":[{"url":"https://rpc-mumbai.maticvigil.com"}]},"bsc":{"endpoints":[{"url":"https://bscrpc.com"},{"url":"https://bsc-dataseed.binance.org/"},{"url":"https://bsc-dataseed1.defibit.io/"},{"url":"wss://bsc-ws-node.nariox.org:443"}]},"xdai":{"endpoints":[{"url":"https://rpc.gnosischain.com/"},{"url":"wss://rpc.gnosischain.com/wss"}]},"gnosis":{"chainId":100,"chainToken":"xDAI","endpoints":[{"url":"https://rpc.gnosischain.com/"},{"url":"wss://rpc.gnosischain.com/wss"}]},"arbitrum":{"chainId":42161,"endpoints":[{"url":"https://arbitrum.public-rpc.com"}]},"optimism":{"chainId":10,"endpoints":[{"url":"https://mainnet.optimism.io"}]},"avalanche":{"chainId":43114,"chainToken":"AVAX","endpoints":[{"url":"https://avalanche-evm.publicnode.com"},{"url":"https://api.avax.network/ext/bc/C/rpc"}]},"cronos":{"chainId":25,"chainToken":"CRO","endpoints":[{"url":"https://evm.cronos.org"}]},"hardhat":{"endpoints":[{"url":"http://127.0.0.1:8545/"}]},"celo":{"chainId":42220,"chainToken":"CELO","endpoints":[{"url":"https://forno.celo.org"},{"url":"wss://forno.celo.org/ws"}]},"heco":{"chainId":128,"chainToken":"HT","endpoints":[{"url":"https://http-mainnet.hecochain.com"},{"url":"wss://ws-mainnet.hecochain.com"}]},"fantom":{"chainId":250,"chainToken":"FTM","endpoints":[{"url":"https://rpc.fantom.network"},{"url":"https://rpcapi.fantom.network"}]},"aurora":{"chainId":1313161554,"endpoints":[{"url":"https://mainnet.aurora.dev"}]},"metis":{"chainId":1088,"chainToken":"METIS","endpoints":[{"url":"https://andromeda.metis.io/?owner=1088"}]},"base":{"chainId":8453,"chainToken":"ETH","endpoints":[{"url":"https://mainnet.base.org"},{"url":"https://1rpc.io/base"}]},"base:test":{"chainId":84531,"chainToken":"ETH","endpoints":[{"url":"https://goerli.base.org"},{"url":"https://base-goerli.public.blastapi.io"}]}},"ns":{"ens":{"eth":{"registry":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"}},"sid":{"bsc":{"registry":"0x08CEd32a7f3eeC915Ba84415e9C07a7286977956"},"bsc:test":{"registry":"0xfFB52185b56603e0fd71De9de4F6f902f05EEA23"}},"ud":{"eth":{"resolver":"0x049aba7510f45BA5b64ea9E658E342F904DB358D","registry":"0x58034A288D2E56B661c9056A0C27273E5460B63c"},"polygon":{"resolver":"0xa9a6A3626993D487d2Dbda3173cf58cA1a9D9e9f","registry":"0x423F2531bd5d3C3D4EF7C318c2D1d9BEDE67c680"}}},"oracles":{"coingecko":{"root":"https://api.coingecko.com/api/v3","key":null}},"erc4337":[{"name":"default","contracts":{"entryPoint":"0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789","accountFactory":"0x09c58cf6be8e25560d479bd52b4417d15bca2845"},"platforms":["eth","eth:goerli","polygon","polygon:mumbai"]}],"flashbots":{"eth":{"url":"https://relay.flashbots.net"},"eth:goerli":{"url":"https://relay-goerli.flashbots.net"},"eth:sepolia":{"url":"https://relay-sepolia.flashbots.net"}},"safe":{"transactionService":{"arbitrum":"https://safe-transaction-arbitrum.safe.global","aurora":"https://safe-transaction-aurora.safe.global","avalanche":"https://safe-transaction-avalanche.safe.global","base":"https://safe-transaction-base.safe.global","base:goerli":"https://safe-transaction-base-testnet.safe.global","celo":"https://safe-transaction-celo.safe.global","eth":"https://safe-transaction-mainnet.safe.global","gnosis":"https://safe-transaction-gnosis-chain.safe.global","eth:goerli":"https://safe-transaction-goerli.safe.global","optimism":"https://safe-transaction-optimism.safe.global","polygon":"https://safe-transaction-polygon.safe.global","polygon:zkevm":"https://safe-transaction-zkevm.safe.global","zksync":"https://safe-transaction-zksync.safe.global","opbnb":"https://safe-transaction-opbnb-mainnet.bnbchain.org","opbnb:test":"https://safe-transaction-opbnb-testnet.bnbchain.org","bsc":"https://safe-transaction-bsc.safe.global"},"contracts":{"eth":{"Safe":"0x41675C099F32341bf84BFc5382aF534df5C7461a","SafeL2":"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762","SafeProxyFactory":"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67","MultiSend":"0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526","CreateCall":"0x9b35Af71d77eaf8d7e40252370304687390A1A52"},"eth:goerli":{"Safe":"0x41675C099F32341bf84BFc5382aF534df5C7461a","SafeL2":"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762","SafeProxyFactory":"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67","MultiSend":"0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526","CreateCall":"0x9b35Af71d77eaf8d7e40252370304687390A1A52"},"bsc":{"Safe":"0x41675C099F32341bf84BFc5382aF534df5C7461a","SafeL2":"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762","SafeProxyFactory":"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67","MultiSend":"0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526","CreateCall":"0x9b35Af71d77eaf8d7e40252370304687390A1A52"},"gnosis":{"Safe":"0x41675C099F32341bf84BFc5382aF534df5C7461a","SafeL2":"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762","SafeProxyFactory":"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67","MultiSend":"0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526","CreateCall":"0x9b35Af71d77eaf8d7e40252370304687390A1A52"},"polygon":{"Safe":"0x41675C099F32341bf84BFc5382aF534df5C7461a","SafeL2":"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762","SafeProxyFactory":"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67","MultiSend":"0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526","CreateCall":"0x9b35Af71d77eaf8d7e40252370304687390A1A52"},"polygon:zkevm":{"Safe":"0x41675C099F32341bf84BFc5382aF534df5C7461a","SafeL2":"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762","SafeProxyFactory":"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67","MultiSend":"0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526","CreateCall":"0x9b35Af71d77eaf8d7e40252370304687390A1A52"},"polygon:mumbai":{"Safe":"0x41675C099F32341bf84BFc5382aF534df5C7461a","SafeL2":"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762","SafeProxyFactory":"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67","MultiSend":"0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526","CreateCall":"0x9b35Af71d77eaf8d7e40252370304687390A1A52"},"torus:test":{"Safe":"0x41675C099F32341bf84BFc5382aF534df5C7461a","SafeL2":"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762","SafeProxyFactory":"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67","MultiSend":"0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526","CreateCall":"0x9b35Af71d77eaf8d7e40252370304687390A1A52"},"base:test":{"Safe":"0x41675C099F32341bf84BFc5382aF534df5C7461a","SafeL2":"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762","SafeProxyFactory":"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67","MultiSend":"0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526","CreateCall":"0x9b35Af71d77eaf8d7e40252370304687390A1A52"},"opbnb":{"Safe":null,"SafeL2":"0xE2CF742b554F466d5E7a37C371FD47C786d2FBc0","SafeProxyFactory":"0x9fea7F7C69f14aa1a7d62cC9D468fEB2F9371CB3","MultiSend":"0xDeB0467cCfAda493902C8D279A2F41f26b813AC9","CreateCall":"0x392e2F66c3BBF0046c861e0065fB7C7917b18078"},"opbnb:test":{"Safe":null,"SafeL2":"0xE2CF742b554F466d5E7a37C371FD47C786d2FBc0","SafeProxyFactory":"0x9fea7F7C69f14aa1a7d62cC9D468fEB2F9371CB3","MultiSend":"0xDeB0467cCfAda493902C8D279A2F41f26b813AC9","CreateCall":"0x392e2F66c3BBF0046c861e0065fB7C7917b18078"},"bsc:test":{"Safe":null,"SafeL2":"0xE2CF742b554F466d5E7a37C371FD47C786d2FBc0","SafeProxyFactory":"0x9fea7F7C69f14aa1a7d62cC9D468fEB2F9371CB3","MultiSend":"0xDeB0467cCfAda493902C8D279A2F41f26b813AC9","CreateCall":"0x392e2F66c3BBF0046c861e0065fB7C7917b18078"}}}});
|
|
9
|
-
class ConfigProviderPlatform {
|
|
10
|
-
async fetch(parameters) {
|
|
11
|
-
return dequanto_yml_1.default;
|
|
12
|
-
}
|
|
13
|
-
async extend(json) {
|
|
14
|
-
_require_1.$require.notNull(this.config, `Config was not fetched yet. Call fetch() first.`);
|
|
15
|
-
await this.config.$write(json);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.ConfigProviderPlatform = ConfigProviderPlatform;
|
|
19
|
-
//# sourceMappingURL=ConfigProviderBrowser.js.map
|
|
20
|
-
//# sourceMappingURL=ConfigProviderBrowser.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigProviderBrowser.js","sourceRoot":"","sources":["../../../src/config/ConfigProviderBrowser.ts"],"names":[],"mappings":";;;;;;AAGA,uDAAoD;AAEpD,8EAAuD;AAGvD,MAAa,sBAAsB;IAI/B,KAAK,CAAC,KAAK,CAAE,UAAiC;QAC1C,OAAO,sBAAa,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,MAAM,CAAE,IAA0B;QACpC,mBAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,iDAAiD,CAAC,CAAC;QACjF,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;CACJ;AAZD,wDAYC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import AppConfig from 'appcfg';
|
|
2
|
-
import { Config as Appcfg } from 'appcfg/Config';
|
|
3
|
-
import { IConfigProvider, TConfigParamsNode } from './AConfigBase';
|
|
4
|
-
import { IConfigData } from './interface/IConfigData';
|
|
5
|
-
export declare class ConfigProviderPlatform implements IConfigProvider {
|
|
6
|
-
config: Appcfg<IConfigData>;
|
|
7
|
-
fetch(parameters?: TConfigParamsNode): Promise<AppConfig<any> & IConfigData>;
|
|
8
|
-
extend(json: Partial<IConfigData>): Promise<void>;
|
|
9
|
-
private getSourcesNode;
|
|
10
|
-
private getSourcesBrowser;
|
|
11
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ConfigProviderPlatform = void 0;
|
|
7
|
-
const appcfg_1 = __importDefault(require("appcfg"));
|
|
8
|
-
const _cli_1 = require("../utils/$cli.js");
|
|
9
|
-
const _secret_1 = require("../utils/$secret.js");
|
|
10
|
-
const _require_1 = require("../utils/$require.js");
|
|
11
|
-
const _const_1 = require("../utils/$const.js");
|
|
12
|
-
const ConfigDefaults_1 = require("./ConfigDefaults.js");
|
|
13
|
-
class ConfigProviderPlatform {
|
|
14
|
-
async fetch(parameters) {
|
|
15
|
-
let sources = _const_1.is_BROWSER
|
|
16
|
-
? await this.getSourcesBrowser(parameters)
|
|
17
|
-
: await this.getSourcesNode(parameters);
|
|
18
|
-
let cfg = await appcfg_1.default.fetch(sources);
|
|
19
|
-
if (this.config != null) {
|
|
20
|
-
this.config.$extend(cfg.toJSON());
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
this.config = cfg;
|
|
24
|
-
}
|
|
25
|
-
return this.config = cfg;
|
|
26
|
-
}
|
|
27
|
-
async extend(json) {
|
|
28
|
-
_require_1.$require.notNull(this.config, `Config was not fetched yet. Call fetch() first.`);
|
|
29
|
-
await this.config.$write(json);
|
|
30
|
-
}
|
|
31
|
-
async getSourcesNode(parameters) {
|
|
32
|
-
let unlockedAccountsKey = await _secret_1.$secret.getPin(parameters);
|
|
33
|
-
let configPathAccounts = _cli_1.$cli.getParamValue('config-accounts', parameters) ?? '%APPDATA%/.dequanto/accounts.json';
|
|
34
|
-
let configPathGlobal = _cli_1.$cli.getParamValue('config-global', parameters) ?? '%APPDATA%/.dequanto/config.yml';
|
|
35
|
-
return [
|
|
36
|
-
{
|
|
37
|
-
config: ConfigDefaults_1.ConfigDefaults,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
path: `./configs/dequanto.yml`,
|
|
41
|
-
optional: true,
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
path: configPathGlobal,
|
|
45
|
-
writable: true,
|
|
46
|
-
optional: true,
|
|
47
|
-
extendArrays: false,
|
|
48
|
-
},
|
|
49
|
-
unlockedAccountsKey ? {
|
|
50
|
-
name: 'accounts',
|
|
51
|
-
path: configPathAccounts,
|
|
52
|
-
writable: true,
|
|
53
|
-
optional: true,
|
|
54
|
-
secret: unlockedAccountsKey
|
|
55
|
-
} : null,
|
|
56
|
-
{
|
|
57
|
-
path: 'package.json',
|
|
58
|
-
getterProperty: 'dequanto',
|
|
59
|
-
optional: true,
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
path: 'dequanto.yml',
|
|
63
|
-
optional: true
|
|
64
|
-
},
|
|
65
|
-
parameters?.dotenv ? {
|
|
66
|
-
dotenv: true
|
|
67
|
-
} : null,
|
|
68
|
-
];
|
|
69
|
-
}
|
|
70
|
-
async getSourcesBrowser(parameters) {
|
|
71
|
-
return [
|
|
72
|
-
{
|
|
73
|
-
config: ConfigDefaults_1.ConfigDefaults
|
|
74
|
-
}
|
|
75
|
-
];
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
exports.ConfigProviderPlatform = ConfigProviderPlatform;
|
|
79
|
-
//# sourceMappingURL=ConfigProviderIsoPlatform.js.map
|
|
80
|
-
//# sourceMappingURL=ConfigProviderIsoPlatform.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigProviderIsoPlatform.js","sourceRoot":"","sources":["../../../src/config/ConfigProviderIsoPlatform.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA8B;AAK9B,wCAAqC;AACrC,8CAA2C;AAC3C,uDAAoD;AACpD,mDAAoD;AACpD,qDAAkD;AAGlD,MAAa,sBAAsB;IAI/B,KAAK,CAAC,KAAK,CAAE,UAA8B;QAEvC,IAAI,OAAO,GAAG,mBAAU;YACpB,CAAC,CAAC,MAAM,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC;YAC1C,CAAC,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CACtC;QAEL,IAAI,GAAG,GAAG,MAAM,gBAAS,CAAC,KAAK,CAAc,OAAO,CAAC,CAAC;QAEtD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE;YACrB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;SACrC;aAAM;YACH,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;SACrB;QAED,OAAO,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,MAAM,CAAE,IAA0B;QACpC,mBAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,iDAAiD,CAAC,CAAC;QACjF,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAGO,KAAK,CAAC,cAAc,CAAE,UAA6B;QACvD,IAAI,mBAAmB,GAAG,MAAM,iBAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC3D,IAAI,kBAAkB,GAAG,WAAI,CAAC,aAAa,CAAC,iBAAiB,EAAE,UAAU,CAAC,IAAI,mCAAmC,CAAC;QAClH,IAAI,gBAAgB,GAAG,WAAI,CAAC,aAAa,CAAC,eAAe,EAAE,UAAU,CAAC,IAAI,gCAAgC,CAAC;QAE3G,OAAO;YACH;gBACI,MAAM,EAAE,+BAAc;aACzB;YACD;gBACI,IAAI,EAAE,wBAAwB;gBAC9B,QAAQ,EAAE,IAAI;aACjB;YACD;gBACI,IAAI,EAAE,gBAAgB;gBACtB,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,IAAI;gBACd,YAAY,EAAE,KAAK;aACtB;YACD,mBAAmB,CAAC,CAAC,CAAC;gBAClB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,kBAAkB;gBACxB,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE,mBAAmB;aAC9B,CAAC,CAAC,CAAC,IAAI;YACR;gBACI,IAAI,EAAE,cAAc;gBACpB,cAAc,EAAE,UAAU;gBAC1B,QAAQ,EAAE,IAAI;aACjB;YACD;gBACI,IAAI,EAAE,cAAc;gBACpB,QAAQ,EAAE,IAAI;aACjB;YACD,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;gBACjB,MAAM,EAAE,IAAI;aACf,CAAC,CAAC,CAAC,IAAI;SACX,CAAC;IACN,CAAC;IAEO,KAAK,CAAC,iBAAiB,CAAE,UAA6B;QAC1D,OAAO;YACH;gBACI,MAAM,EAAE,+BAAc;aACzB;SACJ,CAAC;IACN,CAAC;CACJ;AA5ED,wDA4EC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type AppConfig from 'appcfg';
|
|
2
|
-
import type { IConfigProvider, TConfigParamsBrowser } from './AConfigBase';
|
|
3
|
-
import type { IConfigData } from './interface/IConfigData';
|
|
4
|
-
export declare class ConfigProviderPlatform implements IConfigProvider {
|
|
5
|
-
config: AppConfig<IConfigData>;
|
|
6
|
-
fetch(parameters?: TConfigParamsBrowser): Promise<IConfigData>;
|
|
7
|
-
extend(json: Partial<IConfigData>): Promise<void>;
|
|
8
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigProviderBrowser.js","sourceRoot":"","sources":["../../../src/config/ConfigProviderBrowser.ts"],"names":[],"mappings":";;;;;;AAGA,uDAAoD;AAEpD,8EAAuD;AAGvD,MAAa,sBAAsB;IAI/B,KAAK,CAAC,KAAK,CAAE,UAAiC;QAC1C,OAAO,sBAAa,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,MAAM,CAAE,IAA0B;QACpC,mBAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,iDAAiD,CAAC,CAAC;QACjF,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;CACJ;AAZD,wDAYC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { $require } from '../utils/$require.mjs';
|
|
2
|
-
const configDefault = {"accounts":null,"settings":null,"tokens":null,"blockchainExplorer":{"bsc":{"key":"MB1EM53BDJFKDIHUZ5JJT946BJJUQIHFP2","host":"https://api.bscscan.com","www":"https://bscscan.com"},"eth":{"key":"FGCTXVXMZAPPW91KCZ91AMZFGBY1GZZB51","host":"https://api.etherscan.io","www":"https://etherscan.io"},"eth:goerli":{"key":"FGCTXVXMZAPPW91KCZ91AMZFGBY1GZZB51","host":"https://api-goerli.etherscan.io","www":"https://goerli.etherscan.io"},"eth:sepolia":{"key":"FGCTXVXMZAPPW91KCZ91AMZFGBY1GZZB51","host":"https://api-sepolia.etherscan.io","www":"https://sepolia.etherscan.io"},"polygon":{"key":"AQHXXI3KIU5FC8Y1WXX8A346PENKUX7BCE","host":"https://api.polygonscan.com","www":"https://polygonscan.com"},"polygon:mumbai":{"key":"AQHXXI3KIU5FC8Y1WXX8A346PENKUX7BCE","host":"https://api-testnet.polygonscan.com","www":"https://mumbai.polygonscan.com"},"xdai":{"key":"123","host":"https://blockscout.com/xdai/mainnet","www":"https://blockscout.com/xdai/mainnet"},"gnosis":{"key":"V6ENPXHS2E74MCBUXWG8WGYTA3ZPYN2WT3","host":"https://api.gnosisscan.io/","www":"https://gnosisscan.io"},"celo":{"key":"3A9ZR89MEUQ51YC3SI1VAYAATFW419EEYR","host":"https://api.celoscan.io","www":"https://celoscan.io"},"heco":{"key":"123","host":"https://api.hecoinfo.com","www":"https://www.hecoinfo.com"},"optimism":{"key":"8SG776V5FEBDJMHTMETG3PT6KT1921X6AS","host":"https://api-optimistic.etherscan.io","www":"https://optimistic.etherscan.io"},"avalanche":{"key":"TMEXUDTD37PNTAIDJACPHQTP5BB42XD8Q3","host":"https://api.snowtrace.io","www":"https://snowtrace.io"},"cronos":{"key":"V5A6VRJ5TR9KIQEI7HIHVGK5C9NYCQS36E","host":"https://api.cronoscan.com","www":"https://cronoscan.com"},"fantom":{"key":"9PFA8WNHPCRAZS2GEJXPNN83SZS84JWGG7","host":"https://api.ftmscan.com","www":"https://ftmscan.com"},"aurora":{"key":"123","host":"https://explorer.aurora.dev","www":"https://explorer.aurora.dev"},"arbitrum":{"key":"SD1353XFNU8QYTP4KDK58AHMZBQCE79Q1J","host":"https://api.arbiscan.io","www":"https://arbiscan.io"},"metis":{"key":"123","host":"https://andromeda-explorer.metis.io/api","www":"https://andromeda-explorer.metis.io"},"base":{"key":"GS1M3QWY41Z36RTV56MV3N1BRKCJ9GWI3C","host":"https://api.basescan.org","www":"https://basescan.org"},"base:test":{"key":"GS1M3QWY41Z36RTV56MV3N1BRKCJ9GWI3C","host":"https://api-goerli.basescan.org","www":"https://goerli.basescan.org"}},"web3":{"eth":{"endpoints":[{"url":"https://eth.public-rpc.com"},{"url":"https://main-light.eth.linkpool.io","rateLimit":"2000/5m"},{"url":"wss://main-light.eth.linkpool.io/ws","rateLimit":"2000/5m"}]},"eth:goerli":{"endpoints":[{"url":"https://goerli.infura.io/v3/a83f91c556054576a4c608ad4312720b"},{"url":"wss://goerli.infura.io/ws/v3/a83f91c556054576a4c608ad4312720b"}]},"eth:sepolia":{"chainId":11155111,"endpoints":[{"url":"https://1rpc.io/sepolia"},{"url":"wss://ethereum-sepolia.publicnode.com"}]},"polygon":{"endpoints":[{"url":"https://polygon-rpc.com"}]},"polygon:mumbai":{"chainId":80001,"endpoints":[{"url":"https://rpc-mumbai.maticvigil.com"}]},"bsc":{"endpoints":[{"url":"https://bscrpc.com"},{"url":"https://bsc-dataseed.binance.org/"},{"url":"https://bsc-dataseed1.defibit.io/"},{"url":"wss://bsc-ws-node.nariox.org:443"}]},"xdai":{"endpoints":[{"url":"https://rpc.gnosischain.com/"},{"url":"wss://rpc.gnosischain.com/wss"}]},"gnosis":{"chainId":100,"chainToken":"xDAI","endpoints":[{"url":"https://rpc.gnosischain.com/"},{"url":"wss://rpc.gnosischain.com/wss"}]},"arbitrum":{"chainId":42161,"endpoints":[{"url":"https://arbitrum.public-rpc.com"}]},"optimism":{"chainId":10,"endpoints":[{"url":"https://mainnet.optimism.io"}]},"avalanche":{"chainId":43114,"chainToken":"AVAX","endpoints":[{"url":"https://avalanche-evm.publicnode.com"},{"url":"https://api.avax.network/ext/bc/C/rpc"}]},"cronos":{"chainId":25,"chainToken":"CRO","endpoints":[{"url":"https://evm.cronos.org"}]},"hardhat":{"endpoints":[{"url":"http://127.0.0.1:8545/"}]},"celo":{"chainId":42220,"chainToken":"CELO","endpoints":[{"url":"https://forno.celo.org"},{"url":"wss://forno.celo.org/ws"}]},"heco":{"chainId":128,"chainToken":"HT","endpoints":[{"url":"https://http-mainnet.hecochain.com"},{"url":"wss://ws-mainnet.hecochain.com"}]},"fantom":{"chainId":250,"chainToken":"FTM","endpoints":[{"url":"https://rpc.fantom.network"},{"url":"https://rpcapi.fantom.network"}]},"aurora":{"chainId":1313161554,"endpoints":[{"url":"https://mainnet.aurora.dev"}]},"metis":{"chainId":1088,"chainToken":"METIS","endpoints":[{"url":"https://andromeda.metis.io/?owner=1088"}]},"base":{"chainId":8453,"chainToken":"ETH","endpoints":[{"url":"https://mainnet.base.org"},{"url":"https://1rpc.io/base"}]},"base:test":{"chainId":84531,"chainToken":"ETH","endpoints":[{"url":"https://goerli.base.org"},{"url":"https://base-goerli.public.blastapi.io"}]}},"ns":{"ens":{"eth":{"registry":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"}},"sid":{"bsc":{"registry":"0x08CEd32a7f3eeC915Ba84415e9C07a7286977956"},"bsc:test":{"registry":"0xfFB52185b56603e0fd71De9de4F6f902f05EEA23"}},"ud":{"eth":{"resolver":"0x049aba7510f45BA5b64ea9E658E342F904DB358D","registry":"0x58034A288D2E56B661c9056A0C27273E5460B63c"},"polygon":{"resolver":"0xa9a6A3626993D487d2Dbda3173cf58cA1a9D9e9f","registry":"0x423F2531bd5d3C3D4EF7C318c2D1d9BEDE67c680"}}},"oracles":{"coingecko":{"root":"https://api.coingecko.com/api/v3","key":null}},"erc4337":[{"name":"default","contracts":{"entryPoint":"0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789","accountFactory":"0x09c58cf6be8e25560d479bd52b4417d15bca2845"},"platforms":["eth","eth:goerli","polygon","polygon:mumbai"]}],"flashbots":{"eth":{"url":"https://relay.flashbots.net"},"eth:goerli":{"url":"https://relay-goerli.flashbots.net"},"eth:sepolia":{"url":"https://relay-sepolia.flashbots.net"}},"safe":{"transactionService":{"arbitrum":"https://safe-transaction-arbitrum.safe.global","aurora":"https://safe-transaction-aurora.safe.global","avalanche":"https://safe-transaction-avalanche.safe.global","base":"https://safe-transaction-base.safe.global","base:goerli":"https://safe-transaction-base-testnet.safe.global","celo":"https://safe-transaction-celo.safe.global","eth":"https://safe-transaction-mainnet.safe.global","gnosis":"https://safe-transaction-gnosis-chain.safe.global","eth:goerli":"https://safe-transaction-goerli.safe.global","optimism":"https://safe-transaction-optimism.safe.global","polygon":"https://safe-transaction-polygon.safe.global","polygon:zkevm":"https://safe-transaction-zkevm.safe.global","zksync":"https://safe-transaction-zksync.safe.global","opbnb":"https://safe-transaction-opbnb-mainnet.bnbchain.org","opbnb:test":"https://safe-transaction-opbnb-testnet.bnbchain.org","bsc":"https://safe-transaction-bsc.safe.global"},"contracts":{"eth":{"Safe":"0x41675C099F32341bf84BFc5382aF534df5C7461a","SafeL2":"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762","SafeProxyFactory":"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67","MultiSend":"0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526","CreateCall":"0x9b35Af71d77eaf8d7e40252370304687390A1A52"},"eth:goerli":{"Safe":"0x41675C099F32341bf84BFc5382aF534df5C7461a","SafeL2":"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762","SafeProxyFactory":"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67","MultiSend":"0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526","CreateCall":"0x9b35Af71d77eaf8d7e40252370304687390A1A52"},"bsc":{"Safe":"0x41675C099F32341bf84BFc5382aF534df5C7461a","SafeL2":"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762","SafeProxyFactory":"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67","MultiSend":"0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526","CreateCall":"0x9b35Af71d77eaf8d7e40252370304687390A1A52"},"gnosis":{"Safe":"0x41675C099F32341bf84BFc5382aF534df5C7461a","SafeL2":"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762","SafeProxyFactory":"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67","MultiSend":"0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526","CreateCall":"0x9b35Af71d77eaf8d7e40252370304687390A1A52"},"polygon":{"Safe":"0x41675C099F32341bf84BFc5382aF534df5C7461a","SafeL2":"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762","SafeProxyFactory":"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67","MultiSend":"0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526","CreateCall":"0x9b35Af71d77eaf8d7e40252370304687390A1A52"},"polygon:zkevm":{"Safe":"0x41675C099F32341bf84BFc5382aF534df5C7461a","SafeL2":"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762","SafeProxyFactory":"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67","MultiSend":"0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526","CreateCall":"0x9b35Af71d77eaf8d7e40252370304687390A1A52"},"polygon:mumbai":{"Safe":"0x41675C099F32341bf84BFc5382aF534df5C7461a","SafeL2":"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762","SafeProxyFactory":"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67","MultiSend":"0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526","CreateCall":"0x9b35Af71d77eaf8d7e40252370304687390A1A52"},"torus:test":{"Safe":"0x41675C099F32341bf84BFc5382aF534df5C7461a","SafeL2":"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762","SafeProxyFactory":"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67","MultiSend":"0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526","CreateCall":"0x9b35Af71d77eaf8d7e40252370304687390A1A52"},"base:test":{"Safe":"0x41675C099F32341bf84BFc5382aF534df5C7461a","SafeL2":"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762","SafeProxyFactory":"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67","MultiSend":"0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526","CreateCall":"0x9b35Af71d77eaf8d7e40252370304687390A1A52"},"opbnb":{"Safe":null,"SafeL2":"0xE2CF742b554F466d5E7a37C371FD47C786d2FBc0","SafeProxyFactory":"0x9fea7F7C69f14aa1a7d62cC9D468fEB2F9371CB3","MultiSend":"0xDeB0467cCfAda493902C8D279A2F41f26b813AC9","CreateCall":"0x392e2F66c3BBF0046c861e0065fB7C7917b18078"},"opbnb:test":{"Safe":null,"SafeL2":"0xE2CF742b554F466d5E7a37C371FD47C786d2FBc0","SafeProxyFactory":"0x9fea7F7C69f14aa1a7d62cC9D468fEB2F9371CB3","MultiSend":"0xDeB0467cCfAda493902C8D279A2F41f26b813AC9","CreateCall":"0x392e2F66c3BBF0046c861e0065fB7C7917b18078"},"bsc:test":{"Safe":null,"SafeL2":"0xE2CF742b554F466d5E7a37C371FD47C786d2FBc0","SafeProxyFactory":"0x9fea7F7C69f14aa1a7d62cC9D468fEB2F9371CB3","MultiSend":"0xDeB0467cCfAda493902C8D279A2F41f26b813AC9","CreateCall":"0x392e2F66c3BBF0046c861e0065fB7C7917b18078"}}}}
|
|
3
|
-
export class ConfigProviderPlatform {
|
|
4
|
-
async fetch(parameters) {
|
|
5
|
-
return configDefault;
|
|
6
|
-
}
|
|
7
|
-
async extend(json) {
|
|
8
|
-
$require.notNull(this.config, `Config was not fetched yet. Call fetch() first.`);
|
|
9
|
-
await this.config.$write(json);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=ConfigProviderBrowser.js.map
|
|
13
|
-
//# sourceMappingURL=ConfigProviderBrowser.ts.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import AppConfig from 'appcfg';
|
|
2
|
-
import { Config as Appcfg } from 'appcfg/Config';
|
|
3
|
-
import { IConfigProvider, TConfigParamsNode } from './AConfigBase';
|
|
4
|
-
import { IConfigData } from './interface/IConfigData';
|
|
5
|
-
export declare class ConfigProviderPlatform implements IConfigProvider {
|
|
6
|
-
config: Appcfg<IConfigData>;
|
|
7
|
-
fetch(parameters?: TConfigParamsNode): Promise<AppConfig<any> & IConfigData>;
|
|
8
|
-
extend(json: Partial<IConfigData>): Promise<void>;
|
|
9
|
-
private getSourcesNode;
|
|
10
|
-
private getSourcesBrowser;
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigProviderIsoPlatform.js","sourceRoot":"","sources":["../../../src/config/ConfigProviderIsoPlatform.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA8B;AAK9B,wCAAqC;AACrC,8CAA2C;AAC3C,uDAAoD;AACpD,mDAAoD;AACpD,qDAAkD;AAGlD,MAAa,sBAAsB;IAI/B,KAAK,CAAC,KAAK,CAAE,UAA8B;QAEvC,IAAI,OAAO,GAAG,mBAAU;YACpB,CAAC,CAAC,MAAM,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC;YAC1C,CAAC,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CACtC;QAEL,IAAI,GAAG,GAAG,MAAM,gBAAS,CAAC,KAAK,CAAc,OAAO,CAAC,CAAC;QAEtD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE;YACrB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;SACrC;aAAM;YACH,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;SACrB;QAED,OAAO,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,MAAM,CAAE,IAA0B;QACpC,mBAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,iDAAiD,CAAC,CAAC;QACjF,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAGO,KAAK,CAAC,cAAc,CAAE,UAA6B;QACvD,IAAI,mBAAmB,GAAG,MAAM,iBAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC3D,IAAI,kBAAkB,GAAG,WAAI,CAAC,aAAa,CAAC,iBAAiB,EAAE,UAAU,CAAC,IAAI,mCAAmC,CAAC;QAClH,IAAI,gBAAgB,GAAG,WAAI,CAAC,aAAa,CAAC,eAAe,EAAE,UAAU,CAAC,IAAI,gCAAgC,CAAC;QAE3G,OAAO;YACH;gBACI,MAAM,EAAE,+BAAc;aACzB;YACD;gBACI,IAAI,EAAE,wBAAwB;gBAC9B,QAAQ,EAAE,IAAI;aACjB;YACD;gBACI,IAAI,EAAE,gBAAgB;gBACtB,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,IAAI;gBACd,YAAY,EAAE,KAAK;aACtB;YACD,mBAAmB,CAAC,CAAC,CAAC;gBAClB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,kBAAkB;gBACxB,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE,mBAAmB;aAC9B,CAAC,CAAC,CAAC,IAAI;YACR;gBACI,IAAI,EAAE,cAAc;gBACpB,cAAc,EAAE,UAAU;gBAC1B,QAAQ,EAAE,IAAI;aACjB;YACD;gBACI,IAAI,EAAE,cAAc;gBACpB,QAAQ,EAAE,IAAI;aACjB;YACD,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;gBACjB,MAAM,EAAE,IAAI;aACf,CAAC,CAAC,CAAC,IAAI;SACX,CAAC;IACN,CAAC;IAEO,KAAK,CAAC,iBAAiB,CAAE,UAA6B;QAC1D,OAAO;YACH;gBACI,MAAM,EAAE,+BAAc;aACzB;SACJ,CAAC;IACN,CAAC;CACJ;AA5ED,wDA4EC"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import AppConfig from 'appcfg';
|
|
2
|
-
import { $cli } from '../utils/$cli.mjs';
|
|
3
|
-
import { $secret } from '../utils/$secret.mjs';
|
|
4
|
-
import { $require } from '../utils/$require.mjs';
|
|
5
|
-
import { is_BROWSER } from '../utils/$const.mjs';
|
|
6
|
-
import { ConfigDefaults } from './ConfigDefaults.mjs';
|
|
7
|
-
export class ConfigProviderPlatform {
|
|
8
|
-
async fetch(parameters) {
|
|
9
|
-
let sources = is_BROWSER
|
|
10
|
-
? await this.getSourcesBrowser(parameters)
|
|
11
|
-
: await this.getSourcesNode(parameters);
|
|
12
|
-
let cfg = await AppConfig.fetch(sources);
|
|
13
|
-
if (this.config != null) {
|
|
14
|
-
this.config.$extend(cfg.toJSON());
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
this.config = cfg;
|
|
18
|
-
}
|
|
19
|
-
return this.config = cfg;
|
|
20
|
-
}
|
|
21
|
-
async extend(json) {
|
|
22
|
-
$require.notNull(this.config, `Config was not fetched yet. Call fetch() first.`);
|
|
23
|
-
await this.config.$write(json);
|
|
24
|
-
}
|
|
25
|
-
async getSourcesNode(parameters) {
|
|
26
|
-
let unlockedAccountsKey = await $secret.getPin(parameters);
|
|
27
|
-
let configPathAccounts = $cli.getParamValue('config-accounts', parameters) ?? '%APPDATA%/.dequanto/accounts.json';
|
|
28
|
-
let configPathGlobal = $cli.getParamValue('config-global', parameters) ?? '%APPDATA%/.dequanto/config.yml';
|
|
29
|
-
return [
|
|
30
|
-
{
|
|
31
|
-
config: ConfigDefaults,
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
path: `./configs/dequanto.yml`,
|
|
35
|
-
optional: true,
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
path: configPathGlobal,
|
|
39
|
-
writable: true,
|
|
40
|
-
optional: true,
|
|
41
|
-
extendArrays: false,
|
|
42
|
-
},
|
|
43
|
-
unlockedAccountsKey ? {
|
|
44
|
-
name: 'accounts',
|
|
45
|
-
path: configPathAccounts,
|
|
46
|
-
writable: true,
|
|
47
|
-
optional: true,
|
|
48
|
-
secret: unlockedAccountsKey
|
|
49
|
-
} : null,
|
|
50
|
-
{
|
|
51
|
-
path: 'package.json',
|
|
52
|
-
getterProperty: 'dequanto',
|
|
53
|
-
optional: true,
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
path: 'dequanto.yml',
|
|
57
|
-
optional: true
|
|
58
|
-
},
|
|
59
|
-
parameters?.dotenv ? {
|
|
60
|
-
dotenv: true
|
|
61
|
-
} : null,
|
|
62
|
-
];
|
|
63
|
-
}
|
|
64
|
-
async getSourcesBrowser(parameters) {
|
|
65
|
-
return [
|
|
66
|
-
{
|
|
67
|
-
config: ConfigDefaults
|
|
68
|
-
}
|
|
69
|
-
];
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=ConfigProviderIsoPlatform.js.map
|
|
73
|
-
//# sourceMappingURL=ConfigProviderIsoPlatform.ts.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type AppConfig from 'appcfg';
|
|
2
|
-
import type { IConfigProvider, TConfigParamsBrowser } from './AConfigBase';
|
|
3
|
-
import type { IConfigData } from './interface/IConfigData';
|
|
4
|
-
import { $require } from '@dequanto/utils/$require';
|
|
5
|
-
|
|
6
|
-
import configDefault from '../../configs/dequanto.yml';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export class ConfigProviderPlatform implements IConfigProvider {
|
|
10
|
-
|
|
11
|
-
config: AppConfig<IConfigData>
|
|
12
|
-
|
|
13
|
-
async fetch (parameters?: TConfigParamsBrowser): Promise<IConfigData> {
|
|
14
|
-
return configDefault;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
async extend (json: Partial<IConfigData>): Promise<void> {
|
|
18
|
-
$require.notNull(this.config, `Config was not fetched yet. Call fetch() first.`);
|
|
19
|
-
await this.config.$write(json);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import AppConfig from 'appcfg'
|
|
2
|
-
import { Config as Appcfg } from 'appcfg/Config';
|
|
3
|
-
|
|
4
|
-
import { IConfigProvider, TConfigParamsNode } from './AConfigBase';
|
|
5
|
-
import { IConfigData } from './interface/IConfigData';
|
|
6
|
-
import { $cli } from '../utils/$cli';
|
|
7
|
-
import { $secret } from '../utils/$secret';
|
|
8
|
-
import { $require } from '@dequanto/utils/$require';
|
|
9
|
-
import { is_BROWSER } from '@dequanto/utils/$const';
|
|
10
|
-
import { ConfigDefaults } from './ConfigDefaults';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export class ConfigProviderPlatform implements IConfigProvider {
|
|
14
|
-
|
|
15
|
-
config: Appcfg<IConfigData>
|
|
16
|
-
|
|
17
|
-
async fetch (parameters?: TConfigParamsNode) {
|
|
18
|
-
|
|
19
|
-
let sources = is_BROWSER
|
|
20
|
-
? await this.getSourcesBrowser(parameters)
|
|
21
|
-
: await this.getSourcesNode(parameters)
|
|
22
|
-
;
|
|
23
|
-
|
|
24
|
-
let cfg = await AppConfig.fetch<IConfigData>(sources);
|
|
25
|
-
|
|
26
|
-
if (this.config != null) {
|
|
27
|
-
this.config.$extend(cfg.toJSON());
|
|
28
|
-
} else {
|
|
29
|
-
this.config = cfg;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return this.config = cfg;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async extend (json: Partial<IConfigData>): Promise<void> {
|
|
36
|
-
$require.notNull(this.config, `Config was not fetched yet. Call fetch() first.`);
|
|
37
|
-
await this.config.$write(json);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
private async getSourcesNode (parameters: TConfigParamsNode) {
|
|
42
|
-
let unlockedAccountsKey = await $secret.getPin(parameters);
|
|
43
|
-
let configPathAccounts = $cli.getParamValue('config-accounts', parameters) ?? '%APPDATA%/.dequanto/accounts.json';
|
|
44
|
-
let configPathGlobal = $cli.getParamValue('config-global', parameters) ?? '%APPDATA%/.dequanto/config.yml';
|
|
45
|
-
|
|
46
|
-
return [
|
|
47
|
-
{
|
|
48
|
-
config: ConfigDefaults,
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
path: `./configs/dequanto.yml`,
|
|
52
|
-
optional: true,
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
path: configPathGlobal,
|
|
56
|
-
writable: true,
|
|
57
|
-
optional: true,
|
|
58
|
-
extendArrays: false,
|
|
59
|
-
},
|
|
60
|
-
unlockedAccountsKey ? {
|
|
61
|
-
name: 'accounts',
|
|
62
|
-
path: configPathAccounts,
|
|
63
|
-
writable: true,
|
|
64
|
-
optional: true,
|
|
65
|
-
secret: unlockedAccountsKey
|
|
66
|
-
} : null,
|
|
67
|
-
{
|
|
68
|
-
path: 'package.json',
|
|
69
|
-
getterProperty: 'dequanto',
|
|
70
|
-
optional: true,
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
path: 'dequanto.yml',
|
|
74
|
-
optional: true
|
|
75
|
-
},
|
|
76
|
-
parameters?.dotenv ? {
|
|
77
|
-
dotenv: true
|
|
78
|
-
} : null,
|
|
79
|
-
];
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
private async getSourcesBrowser (parameters: TConfigParamsNode) {
|
|
83
|
-
return [
|
|
84
|
-
{
|
|
85
|
-
config: ConfigDefaults
|
|
86
|
-
}
|
|
87
|
-
];
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|