@dxos/config 2.26.1 → 2.27.0
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/dist/src/config.d.ts +6 -6
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +1 -1
- package/dist/src/config.js.map +1 -1
- package/dist/src/config.test.js +32 -20
- package/dist/src/config.test.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/config.d.ts +176 -254
- package/dist/src/proto/gen/dxos/config.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/config.js +26 -23
- package/dist/src/proto/gen/dxos/config.js.map +1 -1
- package/dist/src/proto/gen/google/protobuf.d.ts +0 -2
- package/dist/src/proto/gen/google/protobuf.d.ts.map +1 -1
- package/dist/src/proto/gen/google/protobuf.js.map +1 -1
- package/dist/src/proto/gen/index.d.ts +26 -50
- package/dist/src/proto/gen/index.d.ts.map +1 -1
- package/dist/src/proto/gen/index.js +6 -2
- package/dist/src/proto/gen/index.js.map +1 -1
- package/dist/src/proto/substitutions.d.ts +8 -0
- package/dist/src/proto/substitutions.d.ts.map +1 -0
- package/dist/src/proto/substitutions.js +18 -0
- package/dist/src/proto/substitutions.js.map +1 -0
- package/dist/src/sanitizer.d.ts +1 -3
- package/dist/src/sanitizer.d.ts.map +1 -1
- package/dist/src/sanitizer.js +11 -6
- package/dist/src/sanitizer.js.map +1 -1
- package/dist/src/testing/env_map.json +3 -3
- package/dist/src/types.d.ts +2 -3
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/dist/src/proto/gen/dxos/configv1.d.ts +0 -203
- package/dist/src/proto/gen/dxos/configv1.d.ts.map +0 -1
- package/dist/src/proto/gen/dxos/configv1.js +0 -29
- package/dist/src/proto/gen/dxos/configv1.js.map +0 -1
package/dist/src/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ConfigObject, ConfigKey, DeepIndex, ParseKey } from './types';
|
|
2
2
|
declare type MappingSpec = Record<string, {
|
|
3
3
|
path: string;
|
|
4
4
|
type?: string;
|
|
@@ -20,18 +20,18 @@ export declare function mapToKeyValues(spec: MappingSpec, values: any): Record<s
|
|
|
20
20
|
* Global configuration object.
|
|
21
21
|
* NOTE: Config objects are immutable.
|
|
22
22
|
*/
|
|
23
|
-
export declare class Config
|
|
23
|
+
export declare class Config {
|
|
24
24
|
private readonly _config;
|
|
25
25
|
/**
|
|
26
26
|
* Creates an immutable instance.
|
|
27
27
|
* @constructor
|
|
28
28
|
* @param objects
|
|
29
29
|
*/
|
|
30
|
-
constructor(...objects: [
|
|
30
|
+
constructor(...objects: [ConfigObject, ...ConfigObject[]]);
|
|
31
31
|
/**
|
|
32
32
|
* Returns an immutable config JSON object.
|
|
33
33
|
*/
|
|
34
|
-
get values():
|
|
34
|
+
get values(): ConfigObject;
|
|
35
35
|
/**
|
|
36
36
|
* Returns the given config property.
|
|
37
37
|
*
|
|
@@ -39,7 +39,7 @@ export declare class Config<T = ConfigV1Object> {
|
|
|
39
39
|
* @param defaultValue Default value to return if option is not present in the config.
|
|
40
40
|
* @returns The config value or undefined if the option is not present.
|
|
41
41
|
*/
|
|
42
|
-
get<K extends ConfigKey>(key: K, defaultValue?: DeepIndex<
|
|
42
|
+
get<K extends ConfigKey>(key: K, defaultValue?: DeepIndex<ConfigObject, ParseKey<K>>): DeepIndex<ConfigObject, ParseKey<K>>;
|
|
43
43
|
/**
|
|
44
44
|
* Returns config key without type checking.
|
|
45
45
|
*
|
|
@@ -51,7 +51,7 @@ export declare class Config<T = ConfigV1Object> {
|
|
|
51
51
|
*
|
|
52
52
|
* @param key A key in the config object. Can be a nested property with keys separated by dots: 'services.signal.server'.
|
|
53
53
|
*/
|
|
54
|
-
getOrThrow<K extends ConfigKey>(key: K): Exclude<DeepIndex<
|
|
54
|
+
getOrThrow<K extends ConfigKey>(key: K): Exclude<DeepIndex<ConfigObject, ParseKey<K>>, undefined>;
|
|
55
55
|
}
|
|
56
56
|
export {};
|
|
57
57
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/src/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEvE,aAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEnE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAuC/E;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,uBAiB7D;AAED;;;GAGG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAM;IAE9B;;;;OAIG;gBACU,GAAG,OAAO,EAAE,CAAC,YAAY,EAAE,GAAG,YAAY,EAAE,CAAC;IAI1D;;OAEG;IACH,IAAI,MAAM,IAAK,YAAY,CAE1B;IAED;;;;;;OAMG;IACH,GAAG,CAAE,CAAC,SAAS,SAAS,EAAG,GAAG,EAAE,CAAC,EAAE,YAAY,CAAC,EAAE,SAAS,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAI7H;;;;OAIG;IACH,YAAY,CAAC,CAAC,EAAG,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC;IAIlD;;;;OAIG;IACH,UAAU,CAAE,CAAC,SAAS,SAAS,EAAG,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC;CAOpG"}
|
package/dist/src/config.js
CHANGED
|
@@ -84,7 +84,7 @@ class Config {
|
|
|
84
84
|
* @param objects
|
|
85
85
|
*/
|
|
86
86
|
constructor(...objects) {
|
|
87
|
-
this._config = (0, sanitizer_1.sanitizeConfig)((0, lodash_defaultsdeep_1.default)(...objects));
|
|
87
|
+
this._config = (0, sanitizer_1.sanitizeConfig)((0, lodash_defaultsdeep_1.default)(...objects, { version: 1 }));
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
90
|
* Returns an immutable config JSON object.
|
package/dist/src/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,qCAAkC;AAClC,8EAA+C;AAC/C,4DAA6B;AAC7B,4DAA6B;AAE7B,2CAA6C;AAK7C;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAE,IAAiB,EAAE,MAA2B;IAC9E,MAAM,MAAM,GAAG,EAAE,CAAC;IAElB,KAAK,MAAM,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACxD,IAAI,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAExB,IAAI,KAAK,KAAK,SAAS,EAAE;YACvB,IAAI,IAAI,EAAE;gBACR,QAAQ,IAAI,EAAE;oBACZ,KAAK,SAAS,CAAC,CAAC;wBACd,KAAK,GAAG,IAAA,iBAAO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AAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACrC,IAAI,CAAC,KAAK,EAAE;YACV,MAAM,IAAI,KAAK,CAAC,8BAA8B,GAAG,EAAE,CAAC,CAAC;SACtD;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAnDD,wBAmDC"}
|
package/dist/src/config.test.js
CHANGED
|
@@ -19,24 +19,32 @@ const test_json_1 = __importDefault(require("./testing/test.json"));
|
|
|
19
19
|
});
|
|
20
20
|
(0, mocha_1.it)('Basic config', () => {
|
|
21
21
|
const config = new config_1.Config({
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
runtime: {
|
|
23
|
+
props: {
|
|
24
|
+
title: 'testing'
|
|
25
|
+
}
|
|
24
26
|
}
|
|
25
27
|
}, {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
runtime: {
|
|
29
|
+
app: {
|
|
30
|
+
theme: 'light'
|
|
31
|
+
}
|
|
28
32
|
}
|
|
29
33
|
});
|
|
30
34
|
(0, expect_1.default)(config.values).toEqual({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
version: 1,
|
|
36
|
+
runtime: {
|
|
37
|
+
app: {
|
|
38
|
+
theme: 'light'
|
|
39
|
+
},
|
|
40
|
+
props: {
|
|
41
|
+
title: 'testing'
|
|
42
|
+
}
|
|
34
43
|
}
|
|
35
44
|
});
|
|
36
45
|
});
|
|
37
|
-
(0, mocha_1.it)('
|
|
46
|
+
(0, mocha_1.it)('Runtime and module config', () => {
|
|
38
47
|
const config = new config_1.Config({
|
|
39
|
-
version: 1,
|
|
40
48
|
module: {
|
|
41
49
|
name: 'dxos:app.tasks',
|
|
42
50
|
record: {
|
|
@@ -73,21 +81,25 @@ const test_json_1 = __importDefault(require("./testing/test.json"));
|
|
|
73
81
|
}
|
|
74
82
|
});
|
|
75
83
|
});
|
|
76
|
-
|
|
84
|
+
mocha_1.it.skip('Mapping', () => {
|
|
77
85
|
process.env.TEST_CLIENT_ID = '900';
|
|
78
86
|
process.env.TEST_SERVER_ENDPOINT = 'http://localhost';
|
|
79
87
|
const config = new config_1.Config({
|
|
80
|
-
|
|
81
|
-
|
|
88
|
+
runtime: {
|
|
89
|
+
client: {
|
|
90
|
+
tag: 'testing'
|
|
91
|
+
}
|
|
82
92
|
}
|
|
83
93
|
}, (0, config_1.mapFromKeyValues)(env_map_json_1.default, process.env));
|
|
84
94
|
(0, expect_1.default)(config.values).toEqual({
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
95
|
+
runtime: {
|
|
96
|
+
client: {
|
|
97
|
+
id: 900,
|
|
98
|
+
tag: 'testing'
|
|
99
|
+
},
|
|
100
|
+
server: {
|
|
101
|
+
endpoint: 'http://localhost'
|
|
102
|
+
}
|
|
91
103
|
}
|
|
92
104
|
});
|
|
93
105
|
const values = (0, config_1.mapToKeyValues)(env_map_json_1.default, config.values);
|
|
@@ -97,7 +109,7 @@ const test_json_1 = __importDefault(require("./testing/test.json"));
|
|
|
97
109
|
TEST_SERVER_ENDPOINT: 'http://localhost'
|
|
98
110
|
});
|
|
99
111
|
});
|
|
100
|
-
|
|
112
|
+
mocha_1.it.skip('mapToKeyValuesping', () => {
|
|
101
113
|
const config = new config_1.Config({
|
|
102
114
|
client: {
|
|
103
115
|
tag: 'testing'
|
|
@@ -118,6 +130,6 @@ const test_json_1 = __importDefault(require("./testing/test.json"));
|
|
|
118
130
|
}
|
|
119
131
|
}
|
|
120
132
|
});
|
|
121
|
-
(0, expect_1.default)(config.get('runtime.client.mode')).toEqual(config_2.
|
|
133
|
+
(0, expect_1.default)(config.get('runtime.client.mode')).toEqual(config_2.Runtime.Client.Mode.LOCAL);
|
|
122
134
|
});
|
|
123
135
|
//# sourceMappingURL=config.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.test.js","sourceRoot":"","sources":["../../src/config.test.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0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C,MAAM,CAAC,CAAC;IAErD,IAAA,gBAAM,EAAC,MAAM,CAAC,CAAC,OAAO,CAAC;QACrB,cAAc,EAAE,GAAG;QACnB,eAAe,EAAE,SAAS;QAC1B,oBAAoB,EAAE,kBAAkB;KACzC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,UAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,GAAG,EAAE;IACnC,MAAM,MAAM,GAAG,IAAI,eAAM,CAAC;QACxB,MAAM,EAAE;YACN,GAAG,EAAE,SAAS;SACf;KACK,EAAE,mBAAe,CAAC,CAAC;IAE3B,MAAM,MAAM,GAAG,IAAA,uBAAc,EAAC,sBAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAErD,IAAA,gBAAM,EAAC,MAAM,CAAC,CAAC,OAAO,CAAC;QACrB,cAAc,EAAE,GAAG;QACnB,eAAe,EAAE,SAAS;KAC3B,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,IAAA,UAAI,EAAC,oCAAoC,EAAE,GAAG,EAAE;IAC9C,MAAM,MAAM,GAAG,IAAI,eAAM,CAAC;QACxB,OAAO,EAAE,CAAC;QACV,OAAO,EAAE;YACP,MAAM,EAAE;gBACN,IAAI,EAAE,OAAO;aACd;SACF;KACK,CAAC,CAAC;IAEV,IAAA,gBAAM,EAAC,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAO,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC/E,CAAC,CAAC,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,281 +1,203 @@
|
|
|
1
|
-
import
|
|
1
|
+
import substitutions from "../../substitutions";
|
|
2
2
|
export interface Config {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* - (env) = "SYSTEM"
|
|
6
|
-
*/
|
|
7
|
-
system?: System;
|
|
8
|
-
services?: Services;
|
|
9
|
-
/**
|
|
10
|
-
* Build metdata
|
|
11
|
-
*/
|
|
3
|
+
version?: number;
|
|
4
|
+
module?: Module;
|
|
12
5
|
build?: Build;
|
|
13
|
-
|
|
14
|
-
* App configuration. Incuded if this configuration is for an app.
|
|
15
|
-
*
|
|
16
|
-
* Options:
|
|
17
|
-
* - (env) = "APP"
|
|
18
|
-
*/
|
|
19
|
-
app?: App;
|
|
20
|
-
/**
|
|
21
|
-
* App configuration. Incuded if this configuration is for a bot.
|
|
22
|
-
*
|
|
23
|
-
* Options:
|
|
24
|
-
* - (env) = "BOT"
|
|
25
|
-
*/
|
|
26
|
-
bot?: Bot;
|
|
27
|
-
/**
|
|
28
|
-
* CLI configuration.
|
|
29
|
-
*/
|
|
30
|
-
cli?: CLI;
|
|
31
|
-
/**
|
|
32
|
-
* Custom configuration as string key-value pairs.
|
|
33
|
-
*/
|
|
34
|
-
custom?: Partial<Record<string, string>>;
|
|
6
|
+
runtime?: Runtime;
|
|
35
7
|
}
|
|
36
|
-
export interface
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
* Milliseconds
|
|
51
|
-
*/
|
|
52
|
-
invitationExpiration?: number;
|
|
53
|
-
mode?: System.Mode;
|
|
8
|
+
export interface Module {
|
|
9
|
+
name?: string;
|
|
10
|
+
type?: string;
|
|
11
|
+
version?: string;
|
|
12
|
+
author?: string;
|
|
13
|
+
license?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
repository?: string;
|
|
16
|
+
repositoryVersion?: string;
|
|
17
|
+
keywords?: string[];
|
|
18
|
+
displayName?: string;
|
|
19
|
+
npmUrl?: string;
|
|
20
|
+
build?: Module.Build;
|
|
21
|
+
record?: Module.Record;
|
|
54
22
|
}
|
|
55
|
-
export declare namespace
|
|
56
|
-
interface
|
|
57
|
-
|
|
58
|
-
storageType?: System.Storage.StorageDriver;
|
|
59
|
-
keyStorage?: System.Storage.StorageDriver;
|
|
60
|
-
path?: string;
|
|
23
|
+
export declare namespace Module {
|
|
24
|
+
interface Record {
|
|
25
|
+
app?: Module.Record.App;
|
|
61
26
|
}
|
|
62
|
-
namespace
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
IDB = 1,
|
|
66
|
-
CHROME = 2,
|
|
67
|
-
FIREFOX = 3,
|
|
68
|
-
NODE = 4,
|
|
69
|
-
LEVELJS = 11,
|
|
70
|
-
JSONDOWN = 12
|
|
27
|
+
namespace Record {
|
|
28
|
+
interface App {
|
|
29
|
+
contentType?: string[];
|
|
71
30
|
}
|
|
72
31
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
32
|
+
interface Build {
|
|
33
|
+
version?: string;
|
|
34
|
+
commitHash?: string;
|
|
35
|
+
timestamp?: ReturnType<typeof substitutions["google.protobuf.Timestamp"]["decode"]>;
|
|
77
36
|
}
|
|
78
37
|
}
|
|
79
|
-
/**
|
|
80
|
-
* Services provided to all DXOS agents
|
|
81
|
-
*/
|
|
82
|
-
export interface Services {
|
|
83
|
-
kube?: Services.Kube;
|
|
84
|
-
app?: Services.AppServer;
|
|
85
|
-
dxns?: Services.Dxns;
|
|
86
|
-
ipfs?: Services.Ipfs;
|
|
87
|
-
signal?: Services.Signal;
|
|
88
|
-
ice?: Services.Ice[];
|
|
89
|
-
machine?: Services.Machine;
|
|
90
|
-
bot?: Services.BotFactoryClient;
|
|
91
|
-
}
|
|
92
|
-
export declare namespace Services {
|
|
93
|
-
interface Kube {
|
|
94
|
-
endpoints?: Services.Kube.Endpoints;
|
|
95
|
-
publicUrl?: string;
|
|
96
|
-
}
|
|
97
|
-
namespace Kube {
|
|
98
|
-
interface Endpoints {
|
|
99
|
-
logs?: string;
|
|
100
|
-
services?: string;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
interface AppServer {
|
|
104
|
-
prefix?: string;
|
|
105
|
-
server?: string;
|
|
106
|
-
}
|
|
107
|
-
interface Dxns {
|
|
108
|
-
/**
|
|
109
|
-
* DXNS endpoint.
|
|
110
|
-
*/
|
|
111
|
-
server?: string;
|
|
112
|
-
/**
|
|
113
|
-
* Substrate account URI. This is a secret.
|
|
114
|
-
* KUBEs do not serve this with the config but we store it in profile.yml.
|
|
115
|
-
*
|
|
116
|
-
* TODO(dmaretskyi): Deprecate this and move it to keyring.
|
|
117
|
-
*/
|
|
118
|
-
accountUri?: string;
|
|
119
|
-
}
|
|
120
|
-
interface Ipfs {
|
|
121
|
-
server?: string;
|
|
122
|
-
gateway?: string;
|
|
123
|
-
}
|
|
124
|
-
interface Signal {
|
|
125
|
-
server?: string;
|
|
126
|
-
api?: string;
|
|
127
|
-
}
|
|
128
|
-
interface Ice {
|
|
129
|
-
urls?: string;
|
|
130
|
-
username?: string;
|
|
131
|
-
credential?: string;
|
|
132
|
-
}
|
|
133
|
-
interface Machine {
|
|
134
|
-
doAccessToken?: string;
|
|
135
|
-
githubAccessToken?: string;
|
|
136
|
-
githubUsername?: string;
|
|
137
|
-
dnsDomain?: string;
|
|
138
|
-
npmAccessToken?: string;
|
|
139
|
-
}
|
|
140
|
-
interface BotFactoryClient {
|
|
141
|
-
topic?: string;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Build metadata
|
|
146
|
-
*/
|
|
147
38
|
export interface Build {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
timestamp?: google_protobuf.Timestamp;
|
|
39
|
+
command?: string;
|
|
40
|
+
out?: string;
|
|
151
41
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
website?: string;
|
|
160
|
-
/**
|
|
161
|
-
* Options:
|
|
162
|
-
* - (env) = "PUBLIC_URL"
|
|
163
|
-
*/
|
|
164
|
-
publicUrl?: string;
|
|
42
|
+
export interface Runtime {
|
|
43
|
+
client?: Runtime.Client;
|
|
44
|
+
app?: Runtime.App;
|
|
45
|
+
cli?: Runtime.CLI;
|
|
46
|
+
props?: Runtime.Props;
|
|
47
|
+
services?: Runtime.Services;
|
|
48
|
+
system?: Runtime.System;
|
|
165
49
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
*/
|
|
169
|
-
export interface Bot {
|
|
170
|
-
/**
|
|
171
|
-
* Options:
|
|
172
|
-
* - (env) = "UID"
|
|
173
|
-
*/
|
|
174
|
-
uid?: string;
|
|
175
|
-
/**
|
|
176
|
-
* Options:
|
|
177
|
-
* - (env) = "NAME"
|
|
178
|
-
*/
|
|
179
|
-
name?: string;
|
|
180
|
-
/**
|
|
181
|
-
* Options:
|
|
182
|
-
* - (env) = "CWD"
|
|
183
|
-
*/
|
|
184
|
-
cwd?: string;
|
|
185
|
-
/**
|
|
186
|
-
* Options:
|
|
187
|
-
* - (env) = "RESTARTED"
|
|
188
|
-
*/
|
|
189
|
-
restarted?: boolean;
|
|
190
|
-
/**
|
|
191
|
-
* Options:
|
|
192
|
-
* - (env) = "RESET"
|
|
193
|
-
*/
|
|
194
|
-
reset?: boolean;
|
|
195
|
-
/**
|
|
196
|
-
* Options:
|
|
197
|
-
* - (env) = "PEER_ID"
|
|
198
|
-
*/
|
|
199
|
-
peerId?: string;
|
|
200
|
-
/**
|
|
201
|
-
* Options:
|
|
202
|
-
* - (env) = "TOPIC"
|
|
203
|
-
*/
|
|
204
|
-
topic?: string;
|
|
205
|
-
/**
|
|
206
|
-
* Options:
|
|
207
|
-
* - (env) = "SECRET_KEY"
|
|
208
|
-
*/
|
|
209
|
-
secretKey?: string;
|
|
210
|
-
/**
|
|
211
|
-
* Options:
|
|
212
|
-
* - (env) = "LOCAL_DEV"
|
|
213
|
-
*/
|
|
214
|
-
localDev?: boolean;
|
|
215
|
-
/**
|
|
216
|
-
* Options:
|
|
217
|
-
* - (env) = "NODE_PATH"
|
|
218
|
-
*/
|
|
219
|
-
nodePath?: string;
|
|
220
|
-
/**
|
|
221
|
-
* Options:
|
|
222
|
-
* - (env) = "CONTROL_TOPIC"
|
|
223
|
-
*/
|
|
224
|
-
controlTopic?: string;
|
|
225
|
-
/**
|
|
226
|
-
* Options:
|
|
227
|
-
* - (env) = "DUMP_FILE"
|
|
228
|
-
*/
|
|
229
|
-
dumpFile?: string;
|
|
230
|
-
/**
|
|
231
|
-
* Options:
|
|
232
|
-
* - (env) = "IPC"
|
|
233
|
-
*/
|
|
234
|
-
ipc?: Bot.Ipc;
|
|
235
|
-
}
|
|
236
|
-
export declare namespace Bot {
|
|
237
|
-
interface Ipc {
|
|
50
|
+
export declare namespace Runtime {
|
|
51
|
+
interface Client {
|
|
238
52
|
/**
|
|
239
53
|
* Options:
|
|
240
|
-
* - (env) = "
|
|
54
|
+
* - (env) = "DEBUG"
|
|
241
55
|
*/
|
|
242
|
-
|
|
56
|
+
debug?: string;
|
|
57
|
+
storage?: Runtime.Client.Storage;
|
|
58
|
+
enableSnapshots?: boolean;
|
|
243
59
|
/**
|
|
244
|
-
*
|
|
245
|
-
* - (env) = "PORT_TO"
|
|
60
|
+
* Milliseconds
|
|
246
61
|
*/
|
|
247
|
-
|
|
62
|
+
snapshotInterval?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Milliseconds
|
|
65
|
+
*/
|
|
66
|
+
invitationExpiration?: number;
|
|
67
|
+
mode?: Runtime.Client.Mode;
|
|
68
|
+
}
|
|
69
|
+
namespace Client {
|
|
70
|
+
enum Mode {
|
|
71
|
+
AUTOMATIC = 0,
|
|
72
|
+
LOCAL = 1,
|
|
73
|
+
REMOTE = 2
|
|
74
|
+
}
|
|
75
|
+
interface Storage {
|
|
76
|
+
persistent?: boolean;
|
|
77
|
+
storageType?: Runtime.Client.Storage.StorageDriver;
|
|
78
|
+
keyStorage?: Runtime.Client.Storage.StorageDriver;
|
|
79
|
+
path?: string;
|
|
80
|
+
}
|
|
81
|
+
namespace Storage {
|
|
82
|
+
enum StorageDriver {
|
|
83
|
+
RAM = 0,
|
|
84
|
+
IDB = 1,
|
|
85
|
+
CHROME = 2,
|
|
86
|
+
FIREFOX = 3,
|
|
87
|
+
NODE = 4,
|
|
88
|
+
LEVELJS = 11,
|
|
89
|
+
JSONDOWN = 12
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
interface App {
|
|
94
|
+
org?: string;
|
|
95
|
+
theme?: string;
|
|
96
|
+
website?: string;
|
|
248
97
|
/**
|
|
249
98
|
* Options:
|
|
250
|
-
* - (env) = "
|
|
99
|
+
* - (env) = "PUBLIC_URL"
|
|
251
100
|
*/
|
|
252
|
-
|
|
101
|
+
publicUrl?: string;
|
|
253
102
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
channel?: string;
|
|
263
|
-
}
|
|
264
|
-
export declare namespace CLI {
|
|
265
|
-
interface AppServe {
|
|
266
|
-
serve?: CLI.AppServe.Serve;
|
|
103
|
+
interface CLI {
|
|
104
|
+
nodePath?: string;
|
|
105
|
+
app?: Runtime.CLI.AppServe;
|
|
106
|
+
console?: Runtime.CLI.Package;
|
|
107
|
+
mdns?: Runtime.CLI.Package;
|
|
108
|
+
signal?: Runtime.CLI.Package;
|
|
109
|
+
npmClient?: string;
|
|
110
|
+
channel?: string;
|
|
267
111
|
}
|
|
268
|
-
namespace
|
|
269
|
-
interface
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
112
|
+
namespace CLI {
|
|
113
|
+
interface AppServe {
|
|
114
|
+
serve?: Runtime.CLI.AppServe.Serve;
|
|
115
|
+
}
|
|
116
|
+
namespace AppServe {
|
|
117
|
+
interface Serve {
|
|
118
|
+
config?: string;
|
|
119
|
+
loginApp?: string;
|
|
120
|
+
keyPhrase?: string;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
interface Package {
|
|
124
|
+
package?: string;
|
|
125
|
+
channel?: string;
|
|
126
|
+
bin?: string;
|
|
273
127
|
}
|
|
274
128
|
}
|
|
275
|
-
interface
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
129
|
+
interface Props {
|
|
130
|
+
title?: string;
|
|
131
|
+
}
|
|
132
|
+
interface System {
|
|
133
|
+
debug?: string;
|
|
134
|
+
}
|
|
135
|
+
interface Services {
|
|
136
|
+
kube?: Runtime.Services.Kube;
|
|
137
|
+
app?: Runtime.Services.AppServer;
|
|
138
|
+
dxns?: Runtime.Services.Dxns;
|
|
139
|
+
ipfs?: Runtime.Services.Ipfs;
|
|
140
|
+
signal?: Runtime.Services.Signal;
|
|
141
|
+
ice?: Runtime.Services.Ice[];
|
|
142
|
+
machine?: Runtime.Services.Machine;
|
|
143
|
+
bot?: Runtime.Services.BotFactory;
|
|
144
|
+
}
|
|
145
|
+
namespace Services {
|
|
146
|
+
interface Kube {
|
|
147
|
+
endpoints?: Runtime.Services.Kube.Endpoints;
|
|
148
|
+
publicUrl?: string;
|
|
149
|
+
}
|
|
150
|
+
namespace Kube {
|
|
151
|
+
interface Endpoints {
|
|
152
|
+
logs?: string;
|
|
153
|
+
services?: string;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
interface AppServer {
|
|
157
|
+
prefix?: string;
|
|
158
|
+
server?: string;
|
|
159
|
+
}
|
|
160
|
+
interface Dxns {
|
|
161
|
+
/**
|
|
162
|
+
* DXNS endpoint.
|
|
163
|
+
*/
|
|
164
|
+
server?: string;
|
|
165
|
+
/**
|
|
166
|
+
* Substrate account URI. This is a secret.
|
|
167
|
+
* KUBEs do not serve this with the config but we store it in profile.yml.
|
|
168
|
+
*
|
|
169
|
+
* TODO(dmaretskyi): Deprecate this and move it to keyring.
|
|
170
|
+
*/
|
|
171
|
+
accountUri?: string;
|
|
172
|
+
/**
|
|
173
|
+
* Public address of the DXNS Account - not a secret.
|
|
174
|
+
*/
|
|
175
|
+
account?: string;
|
|
176
|
+
}
|
|
177
|
+
interface Ipfs {
|
|
178
|
+
server?: string;
|
|
179
|
+
gateway?: string;
|
|
180
|
+
}
|
|
181
|
+
interface Signal {
|
|
182
|
+
server?: string;
|
|
183
|
+
api?: string;
|
|
184
|
+
status?: string;
|
|
185
|
+
}
|
|
186
|
+
interface Ice {
|
|
187
|
+
urls?: string;
|
|
188
|
+
username?: string;
|
|
189
|
+
credential?: string;
|
|
190
|
+
}
|
|
191
|
+
interface Machine {
|
|
192
|
+
doAccessToken?: string;
|
|
193
|
+
githubAccessToken?: string;
|
|
194
|
+
githubUsername?: string;
|
|
195
|
+
dnsDomain?: string;
|
|
196
|
+
npmAccessToken?: string;
|
|
197
|
+
}
|
|
198
|
+
interface BotFactory {
|
|
199
|
+
topic?: string;
|
|
200
|
+
}
|
|
279
201
|
}
|
|
280
202
|
}
|
|
281
203
|
//# sourceMappingURL=config.d.ts.map
|