@dxos/config 0.10.0 → 0.11.1
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/lib/chunk-config.mjs +123 -0
- package/dist/lib/chunk-config.mjs.map +1 -0
- package/dist/lib/chunk-definitions.mjs +97 -0
- package/dist/lib/chunk-definitions.mjs.map +1 -0
- package/dist/lib/chunk-types.mjs +8 -0
- package/dist/lib/chunk-types.mjs.map +1 -0
- package/dist/lib/index.mjs +171 -0
- package/dist/lib/index.mjs.map +1 -0
- package/dist/lib/loaders/browser.mjs +82 -0
- package/dist/lib/loaders/browser.mjs.map +1 -0
- package/dist/lib/loaders.mjs +66 -0
- package/dist/lib/loaders.mjs.map +1 -0
- package/dist/lib/plugin/browser.mjs +8 -0
- package/dist/lib/plugin/browser.mjs.map +1 -0
- package/dist/lib/plugin/esbuild-plugin.mjs +22 -0
- package/dist/lib/plugin/esbuild-plugin.mjs.map +1 -0
- package/dist/lib/plugin/rollup-plugin.mjs +15 -0
- package/dist/lib/plugin/rollup-plugin.mjs.map +1 -0
- package/dist/lib/plugin/vite-plugin.mjs +24 -0
- package/dist/lib/plugin/vite-plugin.mjs.map +1 -0
- package/dist/lib/plugin.mjs +2 -0
- package/dist/lib/savers/browser.mjs +33 -0
- package/dist/lib/savers/browser.mjs.map +1 -0
- package/dist/lib/savers.mjs +6 -0
- package/dist/lib/savers.mjs.map +1 -0
- package/dist/{lib/node-esm/plugin/index.mjs → plugin/node-esm/chunk-PAYIP2UD.mjs} +49 -9
- package/dist/plugin/node-esm/chunk-PAYIP2UD.mjs.map +7 -0
- package/dist/plugin/node-esm/esbuild-plugin.mjs +1 -1
- package/dist/plugin/node-esm/meta.json +1 -1
- package/dist/plugin/node-esm/rollup-plugin.mjs +1 -1
- package/dist/plugin/node-esm/vite-plugin.mjs +1 -1
- package/dist/types/src/config.d.ts +0 -1
- package/dist/types/src/config.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +21 -28
- package/src/config-service.ts +3 -3
- package/src/config.ts +0 -4
- package/src/edge-services.ts +1 -1
- package/src/preset.ts +1 -1
- package/dist/lib/browser/chunk-VQRJY4AQ.mjs +0 -11
- package/dist/lib/browser/chunk-VQRJY4AQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZY4D4E3Q.mjs +0 -146
- package/dist/lib/browser/chunk-ZY4D4E3Q.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -197
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/loaders/browser.mjs +0 -73
- package/dist/lib/browser/loaders/browser.mjs.map +0 -7
- package/dist/lib/browser/loaders/index.mjs +0 -66
- package/dist/lib/browser/loaders/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/plugin/browser.mjs +0 -8
- package/dist/lib/browser/plugin/browser.mjs.map +0 -7
- package/dist/lib/browser/plugin/index.mjs +0 -98
- package/dist/lib/browser/plugin/index.mjs.map +0 -7
- package/dist/lib/browser/savers/browser.mjs +0 -25
- package/dist/lib/browser/savers/browser.mjs.map +0 -7
- package/dist/lib/browser/savers/index.mjs +0 -7
- package/dist/lib/browser/savers/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-T6NFH3CC.mjs +0 -13
- package/dist/lib/node-esm/chunk-T6NFH3CC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WIJROCKQ.mjs +0 -148
- package/dist/lib/node-esm/chunk-WIJROCKQ.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -198
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/loaders/browser.mjs +0 -75
- package/dist/lib/node-esm/loaders/browser.mjs.map +0 -7
- package/dist/lib/node-esm/loaders/index.mjs +0 -67
- package/dist/lib/node-esm/loaders/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/plugin/browser.mjs +0 -10
- package/dist/lib/node-esm/plugin/browser.mjs.map +0 -7
- package/dist/lib/node-esm/plugin/index.mjs.map +0 -7
- package/dist/lib/node-esm/savers/browser.mjs +0 -27
- package/dist/lib/node-esm/savers/browser.mjs.map +0 -7
- package/dist/lib/node-esm/savers/index.mjs +0 -9
- package/dist/lib/node-esm/savers/index.mjs.map +0 -7
- package/dist/plugin/node-esm/chunk-XCZNYAQT.mjs +0 -221
- package/dist/plugin/node-esm/chunk-XCZNYAQT.mjs.map +0 -7
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// src/loaders/browser.ts
|
|
2
|
-
import localforage from "localforage";
|
|
3
|
-
import { log } from "@dxos/log";
|
|
4
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/sdk/config/src/loaders/browser.ts";
|
|
5
|
-
var CONFIG_ENDPOINT = "/.well-known/dx/config";
|
|
6
|
-
var Profile = (_profile = "default") => ({});
|
|
7
|
-
var Local = () => {
|
|
8
|
-
return typeof __CONFIG_LOCAL__ !== "undefined" ? __CONFIG_LOCAL__ : {};
|
|
9
|
-
};
|
|
10
|
-
var Dynamics = async () => {
|
|
11
|
-
const { publicUrl = "", dynamic } = __DXOS_CONFIG__;
|
|
12
|
-
if (!dynamic) {
|
|
13
|
-
log("dynamics disabled", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 14, S: void 0 });
|
|
14
|
-
return {};
|
|
15
|
-
}
|
|
16
|
-
log("fetching config...", {
|
|
17
|
-
publicUrl
|
|
18
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 17, S: void 0 });
|
|
19
|
-
return await fetch(`${publicUrl}${CONFIG_ENDPOINT}`).then((res) => res.json()).catch((error) => {
|
|
20
|
-
log.warn("Failed to fetch dynamic config.", error, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 21, S: void 0 });
|
|
21
|
-
return {};
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
var Envs = (_basePath) => {
|
|
25
|
-
return typeof __CONFIG_ENVS__ !== "undefined" ? __CONFIG_ENVS__ : {};
|
|
26
|
-
};
|
|
27
|
-
var Defaults = (_basePath) => {
|
|
28
|
-
return typeof __CONFIG_DEFAULTS__ !== "undefined" ? __CONFIG_DEFAULTS__ : {};
|
|
29
|
-
};
|
|
30
|
-
var Storage = async () => {
|
|
31
|
-
try {
|
|
32
|
-
const config = await localforage.getItem("org.dxos.settings.config");
|
|
33
|
-
if (config) {
|
|
34
|
-
return config;
|
|
35
|
-
}
|
|
36
|
-
} catch (err) {
|
|
37
|
-
log.warn("Failed to load config", {
|
|
38
|
-
err
|
|
39
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 40, S: void 0 });
|
|
40
|
-
}
|
|
41
|
-
return {};
|
|
42
|
-
};
|
|
43
|
-
var Remote = (target, authenticationToken) => {
|
|
44
|
-
if (!target) {
|
|
45
|
-
return {};
|
|
46
|
-
}
|
|
47
|
-
try {
|
|
48
|
-
const url = new URL(target);
|
|
49
|
-
const protocol = url.protocol.slice(0, -1);
|
|
50
|
-
return {
|
|
51
|
-
runtime: {
|
|
52
|
-
client: {
|
|
53
|
-
// TODO(burdon): Remove vault.html.
|
|
54
|
-
remoteSource: url.origin + (protocol.startsWith("http") ? "/vault.html" : ""),
|
|
55
|
-
remoteSourceAuthenticationToken: authenticationToken
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
} catch (err) {
|
|
60
|
-
log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 63, S: void 0 });
|
|
61
|
-
return {};
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
export {
|
|
65
|
-
Defaults,
|
|
66
|
-
Dynamics,
|
|
67
|
-
Envs,
|
|
68
|
-
Local,
|
|
69
|
-
Profile,
|
|
70
|
-
Remote,
|
|
71
|
-
Storage
|
|
72
|
-
};
|
|
73
|
-
//# sourceMappingURL=browser.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/loaders/browser.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2021 DXOS.org\n//\n\n/* THIS FILE WILL BE LOADED BY CONTEXT REPLACEMENT PLUGIN IN BROWSER ENVS. */\n\nimport localforage from 'localforage';\n\nimport { log } from '@dxos/log';\nimport { type Config as ConfigProto } from '@dxos/protocols/proto/dxos/config';\n\ndeclare const __DXOS_CONFIG__: { publicUrl?: string; dynamic?: boolean };\ndeclare const __CONFIG_ENVS__: Partial<ConfigProto> | undefined;\ndeclare const __CONFIG_DEFAULTS__: Partial<ConfigProto> | undefined;\ndeclare const __CONFIG_LOCAL__: Partial<ConfigProto> | undefined;\n\nconst CONFIG_ENDPOINT = '/.well-known/dx/config';\n\nexport const Profile = (_profile = 'default'): Partial<ConfigProto> => ({});\n\nexport const Local = (): Partial<ConfigProto> => {\n return typeof __CONFIG_LOCAL__ !== 'undefined' ? __CONFIG_LOCAL__ : {};\n};\n\nexport const Dynamics = async (): Promise<Partial<ConfigProto>> => {\n const { publicUrl = '', dynamic } = __DXOS_CONFIG__;\n if (!dynamic) {\n log('dynamics disabled');\n return {};\n }\n\n log('fetching config...', { publicUrl });\n return await fetch(`${publicUrl}${CONFIG_ENDPOINT}`)\n .then((res) => res.json())\n .catch((error) => {\n log.warn('Failed to fetch dynamic config.', error);\n return {};\n });\n};\n\nexport const Envs = (_basePath?: string): Partial<ConfigProto> => {\n return typeof __CONFIG_ENVS__ !== 'undefined' ? __CONFIG_ENVS__ : {};\n};\n\nexport const Defaults = (_basePath?: string): Partial<ConfigProto> => {\n return typeof __CONFIG_DEFAULTS__ !== 'undefined' ? __CONFIG_DEFAULTS__ : {};\n};\n\n/**\n * Settings config from browser storage.\n */\nexport const Storage = async (): Promise<Partial<ConfigProto>> => {\n try {\n const config = await localforage.getItem<Partial<ConfigProto>>('org.dxos.settings.config');\n if (config) {\n return config;\n }\n } catch (err) {\n log.warn('Failed to load config', { err });\n }\n return {};\n};\n\nexport const Remote = (target: string | undefined, authenticationToken?: string): Partial<ConfigProto> => {\n if (!target) {\n return {};\n }\n\n try {\n const url = new URL(target);\n const protocol = url.protocol.slice(0, -1);\n\n return {\n runtime: {\n client: {\n // TODO(burdon): Remove vault.html.\n remoteSource: url.origin + (protocol.startsWith('http') ? '/vault.html' : ''),\n remoteSourceAuthenticationToken: authenticationToken,\n },\n },\n };\n } catch (err) {\n log.catch(err);\n return {};\n }\n};\n"],
|
|
5
|
-
"mappings": ";AAMA,OAAOA,iBAAiB;AAExB,SAASC,WAAW;AAQpB,IAAA,eAAMC;AAIN,IAAA,kBAAqB;AACnB,IAAO,UAAOC,CAAAA,WAAAA,eAAqB,CAAA;AACnC,IAAA,QAAA,MAAA;AAEF,SAAO,OAAMC,qBAAW,cAAA,mBAAA,CAAA;;AAEtB,IAAKC,WAAS,YAAA;QACZJ,EAAI,YAAA,IAAA,QAAA,IAAA;MACJ,CAAA,SAAQ;AACV,QAAA,qBAAA,QAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,OAAA,CAAA;AAEI,WAAA,CAAA;;AAAkC,MAAA,sBAAA;IACtC;mBAGa,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,OAAmCK,CAAAA;SAC5C,MAAQ,MAAA,GAAA,SAAA,GAAA,eAAA,EAAA,EAAA,KAAA,CAAA,QAAA,IAAA,KAAA,CAAA,EAAA,MAAA,CAAA,UAAA;AACV,QAAA,KAAA,mCAAA,OAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,OAAA,CAAA;AACF,WAAA,CAAA;EAEF,CAAA;;AAEE,IAAA,OAAA,CAAA,cAAA;AAEF,SAAO,OAAMC,oBAAYC,cAAAA,kBAAAA,CAAAA;;AAEvB,IAAA,WAAA,CAAA,cAAA;AAEF,SAAA,OAAA,wBAAA,cAAA,sBAAA,CAAA;;AAKI,IAAMC,UAAS,YAAMT;MACrB;UACE,SAAOS,MAAAA,YAAAA,QAAAA,0BAAAA;AACT,QAAA,QAAA;AACA,aAAY;IACZR;WAAoCS,KAAAA;AAAI,QAAA,KAAA,yBAAA;MAC1C;IACA,GAAA,EAAO,YAAC,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,OAAA,CAAA;EACR;AAEF,SAAO,CAAA;;IAEH,SAAQ,CAAA,QAAA,wBAAA;AACV,MAAA,CAAA,QAAA;AAEI,WAAA,CAAA;;MAEF;AAEA,UAAA,MAAO,IAAA,IAAA,MAAA;UACLC,WAAS,IAAA,SAAA,MAAA,GAAA,EAAA;;eAEL;gBACAC;;UAEF,cAAA,IAAA,UAAA,SAAA,WAAA,MAAA,IAAA,gBAAA;UACF,iCAAA;QACF;MACA;IACAX;WACA,KAAQ;AACV,QAAA,MAAA,KAAA,QAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,OAAA,CAAA;AACA,WAAA,CAAA;;;",
|
|
6
|
-
"names": ["localforage", "log", "CONFIG_ENDPOINT", "__CONFIG_LOCAL__", "Dynamics", "dynamic", "error", "Defaults", "_basePath", "config", "err", "runtime", "remoteSource"]
|
|
7
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FILE_DEFAULTS,
|
|
3
|
-
FILE_ENVS
|
|
4
|
-
} from "../chunk-VQRJY4AQ.mjs";
|
|
5
|
-
import {
|
|
6
|
-
mapFromKeyValues
|
|
7
|
-
} from "../chunk-ZY4D4E3Q.mjs";
|
|
8
|
-
|
|
9
|
-
// src/loaders/index.ts
|
|
10
|
-
import fs from "@dxos/node-std/fs";
|
|
11
|
-
import path from "@dxos/node-std/path";
|
|
12
|
-
import { parse } from "yaml";
|
|
13
|
-
import { log } from "@dxos/log";
|
|
14
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/sdk/config/src/loaders/index.ts";
|
|
15
|
-
var DEFAULT_BASE_PATH = path.resolve(process.cwd(), "config");
|
|
16
|
-
var maybeLoadFile = (file) => {
|
|
17
|
-
try {
|
|
18
|
-
return parse(fs.readFileSync(file, {
|
|
19
|
-
encoding: "utf8"
|
|
20
|
-
}));
|
|
21
|
-
} catch (err) {
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
var Profile = (profile = "default") => {
|
|
25
|
-
const configFile = path.join(process.env.HOME ?? "~", `.config/dx/profile/${profile}.yml`);
|
|
26
|
-
return maybeLoadFile(configFile);
|
|
27
|
-
};
|
|
28
|
-
var Local = () => ({});
|
|
29
|
-
var Dynamics = () => ({});
|
|
30
|
-
var Envs = (basePath = DEFAULT_BASE_PATH) => {
|
|
31
|
-
const content = maybeLoadFile(path.resolve(basePath, FILE_ENVS));
|
|
32
|
-
return content ? mapFromKeyValues(content, process.env) : {};
|
|
33
|
-
};
|
|
34
|
-
var Defaults = (basePath = DEFAULT_BASE_PATH) => maybeLoadFile(path.resolve(basePath, FILE_DEFAULTS)) ?? {};
|
|
35
|
-
var Storage = async () => ({});
|
|
36
|
-
var Remote = (target, authenticationToken) => {
|
|
37
|
-
if (!target) {
|
|
38
|
-
return {};
|
|
39
|
-
}
|
|
40
|
-
try {
|
|
41
|
-
const url = new URL(target);
|
|
42
|
-
const protocol = url.protocol.slice(0, -1);
|
|
43
|
-
return {
|
|
44
|
-
runtime: {
|
|
45
|
-
client: {
|
|
46
|
-
// TODO(burdon): Remove vault.html.
|
|
47
|
-
remoteSource: url.origin + (protocol.startsWith("http") ? "/vault.html" : ""),
|
|
48
|
-
remoteSourceAuthenticationToken: authenticationToken
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
} catch (err) {
|
|
53
|
-
log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 66, S: void 0 });
|
|
54
|
-
return {};
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
export {
|
|
58
|
-
Defaults,
|
|
59
|
-
Dynamics,
|
|
60
|
-
Envs,
|
|
61
|
-
Local,
|
|
62
|
-
Profile,
|
|
63
|
-
Remote,
|
|
64
|
-
Storage
|
|
65
|
-
};
|
|
66
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/loaders/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2021 DXOS.org\n//\n\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { parse } from 'yaml';\n\nimport { log } from '@dxos/log';\nimport { type Config as ConfigProto } from '@dxos/protocols/proto/dxos/config';\n\nimport { mapFromKeyValues } from '../config';\nimport { FILE_DEFAULTS, FILE_ENVS } from '../types';\n\n// TODO(burdon): Move code out of index file.\n\nconst DEFAULT_BASE_PATH = path.resolve(process.cwd(), 'config');\n\nconst maybeLoadFile = (file: string): any => {\n try {\n return parse(fs.readFileSync(file, { encoding: 'utf8' }));\n } catch (err: any) {\n // Ignored.\n }\n};\n\n//\n// NOTE: Export LocalStorage and Dynamics for typescript to typecheck browser code (see ConfigPlugin).\n//\n\n/**\n * Profile\n */\nexport const Profile = (profile = 'default') => {\n const configFile = path.join(process.env.HOME ?? '~', `.config/dx/profile/${profile}.yml`);\n return maybeLoadFile(configFile) as ConfigProto;\n};\n\n/**\n * Development config.\n */\n// TODO(burdon): Rename or reconcile with Profile above?\nexport const Local = (): Partial<ConfigProto> => ({});\n\n/**\n * Provided dynamically by server.\n */\nexport const Dynamics = (): Partial<ConfigProto> => ({});\n\n/**\n * ENV variable (key/value) map.\n */\nexport const Envs = (basePath = DEFAULT_BASE_PATH): Partial<ConfigProto> => {\n const content = maybeLoadFile(path.resolve(basePath, FILE_ENVS));\n return content ? mapFromKeyValues(content, process.env) : {};\n};\n\n/**\n * JSON config.\n */\nexport const Defaults = (basePath = DEFAULT_BASE_PATH): Partial<ConfigProto> =>\n maybeLoadFile(path.resolve(basePath, FILE_DEFAULTS)) ?? {};\n\n/**\n * Load config from storage.\n */\nexport const Storage = async (): Promise<Partial<ConfigProto>> => ({});\n\nexport const Remote = (target: string | undefined, authenticationToken?: string): Partial<ConfigProto> => {\n if (!target) {\n return {};\n }\n\n try {\n const url = new URL(target);\n const protocol = url.protocol.slice(0, -1);\n return {\n runtime: {\n client: {\n // TODO(burdon): Remove vault.html.\n remoteSource: url.origin + (protocol.startsWith('http') ? '/vault.html' : ''),\n remoteSourceAuthenticationToken: authenticationToken,\n },\n },\n };\n } catch (err) {\n log.catch(err);\n return {};\n }\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;AAIA,OAAOA,QAAQ;AACf,OAAOC,UAAU;AACjB,SAASC,aAAa;AAEtB,SAASC,WAAW;AAMpB,IAAA,eAAA;IAKE,oBAAI,KAAA,QAAA,QAAA,IAAA,GAAA,QAAA;oBACWC,CAAAA,SAAGC;;AAAsC,WAAA,MAAA,GAAA,aAAA,MAAA;MACtD,UAAiB;IACjB,CAAA,CAAA;EACF,SAAA,KAAA;EAGA;AACF;AAQSC,IAAAA,UAAcC,CAAAA,UAAAA,cAAAA;AACrB,QAAA,aAAA,KAAA,KAAA,QAAA,IAAA,QAAA,KAAA,sBAAA,OAAA,MAAA;AAEF,SAAA,cAAA,UAAA;;;;AAgBSC,IAAAA,OAAUC,CAAAA,WAAAA,sBAAkCC;AACnD,QAAA,UAAA,cAAA,KAAA,QAAA,UAAA,SAAA,CAAA;AAEF,SAAA,UAAA,iBAAA,SAAA,QAAA,GAAA,IAAA,CAAA;;;AAYOC,IAAQ,UAAA,aAAA,CAAA;IACX,SAAQ,CAAA,QAAA,wBAAA;AACV,MAAA,CAAA,QAAA;AAEI,WAAA,CAAA;;MAEF;AACA,UAAA,MAAO,IAAA,IAAA,MAAA;UACLC,WAAS,IAAA,SAAA,MAAA,GAAA,EAAA;;eAEL;gBACAC;;UAEF,cAAA,IAAA,UAAA,SAAA,WAAA,MAAA,IAAA,gBAAA;UACF,iCAAA;QACF;MACA;IACAC;WACA,KAAQ;AACV,QAAA,MAAA,KAAA,QAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,OAAA,CAAA;AACA,WAAA,CAAA;;;",
|
|
6
|
-
"names": ["fs", "path", "parse", "log", "fs", "readFileSync", "maybeLoadFile", "configFile", "content", "mapFromKeyValues", "env", "target", "runtime", "remoteSource", "log"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"inputs":{"src/config.ts":{"bytes":15941,"imports":[{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"lodash.ismatch","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/config-service.ts":{"bytes":12251,"imports":[{"path":"@effect/platform/FileSystem","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/client-protocol","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"./config"}],"format":"esm"},"src/edge-services.ts":{"bytes":6244,"imports":[],"format":"esm"},"src/telemetry.ts":{"bytes":2724,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/types.ts":{"bytes":2665,"imports":[],"format":"esm"},"src/preset.ts":{"bytes":5424,"imports":[{"path":"effect/Match","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"./config"}],"format":"esm"},"src/index.ts":{"bytes":1517,"imports":[{"path":"@dxos/protocols/proto/dxos/config","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"./config"},{"path":"src/config-service.ts","kind":"import-statement","original":"./config-service"},{"path":"src/edge-services.ts","kind":"import-statement","original":"./edge-services"},{"path":"#loaders","kind":"import-statement","external":true},{"path":"#savers","kind":"import-statement","external":true},{"path":"#plugin","kind":"import-statement","external":true},{"path":"src/telemetry.ts","kind":"import-statement","original":"./telemetry"},{"path":"src/types.ts","kind":"import-statement","original":"./types"},{"path":"src/preset.ts","kind":"import-statement","original":"./preset"}],"format":"esm"},"src/loaders/index.ts":{"bytes":8152,"imports":[{"path":"@dxos/node-std/fs","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"../config"},{"path":"src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/loaders/browser.ts":{"bytes":8287,"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/savers/index.ts":{"bytes":589,"imports":[],"format":"esm"},"src/savers/browser.ts":{"bytes":2564,"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/plugin/definitions.ts":{"bytes":11702,"imports":[{"path":"@dxos/node-std/child_process","kind":"import-statement","external":true},{"path":"@dxos/node-std/fs","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"pkg-up","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"../config"}],"format":"esm"},"src/plugin/index.ts":{"bytes":427,"imports":[{"path":"src/plugin/definitions.ts","kind":"import-statement","original":"./definitions"}],"format":"esm"},"src/plugin/browser.ts":{"bytes":924,"imports":[],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":13402},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-VQRJY4AQ.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-ZY4D4E3Q.mjs","kind":"import-statement"},{"path":"@dxos/protocols/proto/dxos/config","kind":"import-statement","external":true},{"path":"@effect/platform/FileSystem","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/client-protocol","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"#loaders","kind":"import-statement","external":true},{"path":"#savers","kind":"import-statement","external":true},{"path":"#plugin","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"effect/Match","kind":"import-statement","external":true}],"exports":["Config","ConfigResource","ConfigService","EDGE_SERVICE_DEFAULTS","EdgeServiceName","FILE_DEFAULTS","FILE_DYNAMICS","FILE_ENVS","configPreset","defaultConfig","defs","getEdgeServiceEndpoint","mapFromKeyValues","mapToKeyValues","memoryConfig","resolveTelemetryTag","validateConfig"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":135},"src/config-service.ts":{"bytesInOutput":3257},"src/edge-services.ts":{"bytesInOutput":1060},"src/telemetry.ts":{"bytesInOutput":192},"src/preset.ts":{"bytesInOutput":1106}},"bytes":6427},"dist/lib/browser/loaders/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3507},"dist/lib/browser/loaders/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-VQRJY4AQ.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-ZY4D4E3Q.mjs","kind":"import-statement"},{"path":"@dxos/node-std/fs","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Defaults","Dynamics","Envs","Local","Profile","Remote","Storage"],"entryPoint":"src/loaders/index.ts","inputs":{"src/loaders/index.ts":{"bytesInOutput":1541}},"bytes":1815},"dist/lib/browser/chunk-VQRJY4AQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1813},"dist/lib/browser/chunk-VQRJY4AQ.mjs":{"imports":[],"exports":["FILE_DEFAULTS","FILE_DYNAMICS","FILE_ENVS"],"inputs":{"src/types.ts":{"bytesInOutput":102}},"bytes":221},"dist/lib/browser/loaders/browser.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4097},"dist/lib/browser/loaders/browser.mjs":{"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Defaults","Dynamics","Envs","Local","Profile","Remote","Storage"],"entryPoint":"src/loaders/browser.ts","inputs":{"src/loaders/browser.ts":{"bytesInOutput":2028}},"bytes":2175},"dist/lib/browser/savers/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":358},"dist/lib/browser/savers/index.mjs":{"imports":[],"exports":["SaveConfig"],"entryPoint":"src/savers/index.ts","inputs":{"src/savers/index.ts":{"bytesInOutput":35}},"bytes":118},"dist/lib/browser/savers/browser.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1302},"dist/lib/browser/savers/browser.mjs":{"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["SaveConfig"],"entryPoint":"src/savers/browser.ts","inputs":{"src/savers/browser.ts":{"bytesInOutput":694}},"bytes":781},"dist/lib/browser/plugin/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5396},"dist/lib/browser/plugin/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-ZY4D4E3Q.mjs","kind":"import-statement"},{"path":"@dxos/node-std/child_process","kind":"import-statement","external":true},{"path":"@dxos/node-std/fs","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"pkg-up","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["definitions"],"entryPoint":"src/plugin/index.ts","inputs":{"src/plugin/definitions.ts":{"bytesInOutput":3096},"src/plugin/index.ts":{"bytesInOutput":0}},"bytes":3247},"dist/lib/browser/chunk-ZY4D4E3Q.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7811},"dist/lib/browser/chunk-ZY4D4E3Q.mjs":{"imports":[{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"lodash.ismatch","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["Config","ConfigResource","mapFromKeyValues","mapToKeyValues","validateConfig"],"inputs":{"src/config.ts":{"bytesInOutput":4083}},"bytes":4240},"dist/lib/browser/plugin/browser.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":494},"dist/lib/browser/plugin/browser.mjs":{"imports":[],"exports":["definitions"],"entryPoint":"src/plugin/browser.ts","inputs":{"src/plugin/browser.ts":{"bytesInOutput":110}},"bytes":198}}}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/plugin/browser.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\n// Browser stub for plugin module - plugins are build-time only.\n\nexport type * from './types';\n\nexport const definitions = (): Record<string, unknown> => {\n throw new Error('Config plugin definitions are not available in the browser');\n};\n"],
|
|
5
|
-
"mappings": ";AAQO,IAAMA,cAAc,MAAA;AACzB,QAAM,IAAIC,MAAM,4DAAA;AAClB;",
|
|
6
|
-
"names": ["definitions", "Error"]
|
|
7
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
mapFromKeyValues
|
|
3
|
-
} from "../chunk-ZY4D4E3Q.mjs";
|
|
4
|
-
|
|
5
|
-
// src/plugin/definitions.ts
|
|
6
|
-
import { execSync } from "@dxos/node-std/child_process";
|
|
7
|
-
import { readFileSync } from "@dxos/node-std/fs";
|
|
8
|
-
import { resolve } from "@dxos/node-std/path";
|
|
9
|
-
import pkgUp from "pkg-up";
|
|
10
|
-
import { parse } from "yaml";
|
|
11
|
-
import { invariant } from "@dxos/invariant";
|
|
12
|
-
import { log } from "@dxos/log";
|
|
13
|
-
import { setDeep } from "@dxos/util";
|
|
14
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/sdk/config/src/plugin/definitions.ts";
|
|
15
|
-
var CWD = process.cwd();
|
|
16
|
-
var definitions = ({ configPath, envPath, devPath, mode = "development", publicUrl = "", env }) => {
|
|
17
|
-
const KEYS_TO_FILE = {
|
|
18
|
-
__CONFIG_DEFAULTS__: configPath?.length ? configPath : resolve(CWD, "dx.yml"),
|
|
19
|
-
__CONFIG_ENVS__: envPath?.length ? envPath : resolve(CWD, "dx-env.yml")
|
|
20
|
-
};
|
|
21
|
-
if (mode !== "production") {
|
|
22
|
-
KEYS_TO_FILE.__CONFIG_LOCAL__ = devPath ?? resolve(CWD, "dx-local.yml");
|
|
23
|
-
}
|
|
24
|
-
return Object.entries(KEYS_TO_FILE).reduce((prev, [key, value]) => {
|
|
25
|
-
invariant(key, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 23, S: void 0, A: ["key", ""] });
|
|
26
|
-
let content = {};
|
|
27
|
-
try {
|
|
28
|
-
content = parse(readFileSync(value, "utf-8"));
|
|
29
|
-
if (key === "__CONFIG_ENVS__") {
|
|
30
|
-
content = mapFromKeyValues(content, process.env);
|
|
31
|
-
}
|
|
32
|
-
if (key === "__CONFIG_DEFAULTS__") {
|
|
33
|
-
Object.entries(process.env).forEach(([key2, value2]) => {
|
|
34
|
-
if (key2.startsWith("DX_") || env?.includes(key2)) {
|
|
35
|
-
setDeep(content, [
|
|
36
|
-
"runtime",
|
|
37
|
-
"app",
|
|
38
|
-
"env",
|
|
39
|
-
key2
|
|
40
|
-
], value2);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
try {
|
|
44
|
-
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
45
|
-
const commitHash = process.env.DX_COMMIT_HASH ?? execSync("git rev-parse --short HEAD", {
|
|
46
|
-
encoding: "utf-8"
|
|
47
|
-
}).replace("\n", "");
|
|
48
|
-
const packagePath = pkgUp.sync();
|
|
49
|
-
const packageJson = packagePath && JSON.parse(readFileSync(packagePath, "utf-8"));
|
|
50
|
-
setDeep(content, [
|
|
51
|
-
"runtime",
|
|
52
|
-
"app",
|
|
53
|
-
"build",
|
|
54
|
-
"timestamp"
|
|
55
|
-
], timestamp);
|
|
56
|
-
setDeep(content, [
|
|
57
|
-
"runtime",
|
|
58
|
-
"app",
|
|
59
|
-
"build",
|
|
60
|
-
"commitHash"
|
|
61
|
-
], commitHash);
|
|
62
|
-
setDeep(content, [
|
|
63
|
-
"runtime",
|
|
64
|
-
"app",
|
|
65
|
-
"build",
|
|
66
|
-
"version"
|
|
67
|
-
], packageJson?.version);
|
|
68
|
-
} catch {
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
} catch (err) {
|
|
72
|
-
if (err.message.includes("YAMLException")) {
|
|
73
|
-
log.error(`Failed to parse file ${value}:`, err, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 73, S: void 0 });
|
|
74
|
-
} else {
|
|
75
|
-
log(`Failed to load file ${value}:`, err, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 75, S: void 0 });
|
|
76
|
-
}
|
|
77
|
-
if (key === "__CONFIG_DEFAULTS__") {
|
|
78
|
-
throw new Error(`Failed to load default config file from ${value}`);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return {
|
|
82
|
-
...prev,
|
|
83
|
-
[key]: content
|
|
84
|
-
};
|
|
85
|
-
}, {
|
|
86
|
-
__CONFIG_DEFAULTS__: {},
|
|
87
|
-
__CONFIG_ENVS__: {},
|
|
88
|
-
__CONFIG_LOCAL__: {},
|
|
89
|
-
__DXOS_CONFIG__: {
|
|
90
|
-
dynamic: mode === "production",
|
|
91
|
-
publicUrl
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
export {
|
|
96
|
-
definitions
|
|
97
|
-
};
|
|
98
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/plugin/definitions.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nimport { execSync } from 'node:child_process';\nimport { readFileSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport pkgUp from 'pkg-up';\nimport { parse } from 'yaml';\n\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\nimport { setDeep } from '@dxos/util';\n\nimport { mapFromKeyValues } from '../config';\nimport { type ConfigPluginOpts } from './types';\n\nconst CWD = process.cwd();\n\nexport const definitions = ({\n configPath,\n envPath,\n devPath,\n mode = process.env.NODE_ENV,\n publicUrl = '',\n env,\n}: ConfigPluginOpts) => {\n const KEYS_TO_FILE = {\n __CONFIG_DEFAULTS__: configPath?.length ? configPath : resolve(CWD, 'dx.yml'),\n __CONFIG_ENVS__: envPath?.length ? envPath : resolve(CWD, 'dx-env.yml'),\n } as { [key: string]: string };\n if (mode !== 'production') {\n KEYS_TO_FILE.__CONFIG_LOCAL__ = devPath ?? resolve(CWD, 'dx-local.yml');\n }\n\n return Object.entries(KEYS_TO_FILE).reduce(\n (prev, [key, value]) => {\n invariant(key);\n let content = {};\n try {\n content = parse(readFileSync(value, 'utf-8')) as any;\n\n // Map environment variables to config values.\n if (key === '__CONFIG_ENVS__') {\n content = mapFromKeyValues(content, process.env);\n }\n\n if (key === '__CONFIG_DEFAULTS__') {\n // Load app environment variables into default config.\n Object.entries(process.env).forEach(([key, value]) => {\n if (key.startsWith('DX_') || env?.includes(key)) {\n setDeep(content, ['runtime', 'app', 'env', key], value);\n }\n });\n\n // Set build info automatically if available.\n try {\n const timestamp = new Date().toISOString();\n const commitHash =\n process.env.DX_COMMIT_HASH ??\n execSync('git rev-parse --short HEAD', { encoding: 'utf-8' }).replace('\\n', '');\n const packagePath = pkgUp.sync();\n const packageJson = packagePath && JSON.parse(readFileSync(packagePath, 'utf-8'));\n setDeep(content, ['runtime', 'app', 'build', 'timestamp'], timestamp);\n setDeep(content, ['runtime', 'app', 'build', 'commitHash'], commitHash);\n setDeep(content, ['runtime', 'app', 'build', 'version'], packageJson?.version);\n } catch {}\n }\n } catch (err: any) {\n if (err.message.includes('YAMLException')) {\n log.error(`Failed to parse file ${value}:`, err);\n } else {\n log(`Failed to load file ${value}:`, err);\n }\n\n if (key === '__CONFIG_DEFAULTS__') {\n // Default config is required.\n throw new Error(`Failed to load default config file from ${value}`);\n }\n }\n\n return {\n ...prev,\n [key]: content,\n };\n },\n {\n __CONFIG_DEFAULTS__: {},\n __CONFIG_ENVS__: {},\n __CONFIG_LOCAL__: {},\n __DXOS_CONFIG__: { dynamic: mode === 'production', publicUrl },\n },\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,SAASA,gBAAgB;AACzB,SAASC,oBAAoB;AAC7B,SAASC,eAAe;AACxB,OAAOC,WAAW;AAClB,SAASC,aAAa;AAEtB,SAASC,iBAAiB;AAC1B,SAASC,WAAW;AACpB,SAASC,eAAe;AAKxB,IAAA,eAAYC;IAUV,MAAMC,QAAAA,IAAAA;IACJC,cAAAA,CAAAA,EAAqBC,YAAYC,SAASD,SAAAA,OAAaE,eAAa,YAAA,IAAA,IAAA,MAAA;QACpEC,eAAiBC;IACnB,qBAAA,YAAA,SAAA,aAAA,QAAA,KAAA,QAAA;IACIC,iBAAS,SAAc,SAAA,UAAA,QAAA,KAAA,YAAA;;AAE3B,MAAA,SAAA,cAAA;AAEA,iBAAcC,mBAAsBC,WACjCC,QAAOC,KAAKC,cAAM;;SAEjB,OAAIC,QAAW,YAAA,EAAA,OAAA,CAAA,MAAA,CAAA,KAAA,KAAA,MAAA;AACf,cAAI,KAAA,QAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,QAAA,GAAA,CAAA,OAAA,EAAA,EAAA,CAAA;QACFA,UAAUC,CAAAA;QAEV;AACA,gBAAIH,MAAQ,aAAA,OAAmB,OAAA,CAAA;AAE/B,UAAA,QAAA,mBAAA;AAEIA,kBAAQ,iBAAA,SAAuB,QAAA,GAAA;;UAEjCI,QAAOP,uBAAqBQ;uBAExBC,QAAQJ,GAAS,EAAA,QAAA,CAAA,CAAAF,MAAAC,MAAA,MAAA;mBAAC,WAAA,KAAA,KAAA,KAAA,SAAAD,IAAA,GAAA;oBAAW,SAAA;cAAO;cAAOA;cAAMC;cACnDD;YACF,GAAAC,MAAA;UAEA;QACA,CAAA;YAEE;gBAE2CM,aAAU,oBAAA,KAAA,GAAA,YAAA;AAAQ,gBAAGC,aAAc,QAAA,IAAA,kBAAA,SAAA,8BAAA;YAC9E,UAAMC;UACN,CAAA,EAAA,QAAMC,MAAAA,EAAAA;AACNJ,gBAAAA,cAAiB,MAAA,KAAA;gBAAC,cAAA,eAAA,KAAA,MAAA,aAAA,aAAA,OAAA,CAAA;kBAAW,SAAA;YAAO;YAAS;YAAcK;YAC3DL;sBAAkB;kBAAW,SAAA;YAAO;YAAS;YAAeM;YAC5DN;uBAAkB;kBAAW,SAAA;YAAO;YAAS;YAAYI;YACzD;UACJ,GAAA,aAAA,OAAA;QACA,QAAiB;QAAA;MACjB;aACEG,KAAIC;AACN,UAAA,IAAO,QAAA,SAAA,eAAA,GAAA;AACLD,YAAI,MAAC,wBAA6B,KAAGE,KAAAA,KAAAA,EAAAA,YAAAA,YAAAA,GAAAA,cAAAA,GAAAA,IAAAA,GAAAA,OAAAA,CAAAA;MACvC,OAAA;AAEIf,YAAAA,uBAAQ,KAAuB,KAAA,KAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,OAAA,CAAA;;UAEjC,QAAM,uBAAW;AAErB,cAAA,IAAA,MAAA,2CAAA,KAAA,EAAA;MAEA;;WAEGA;MACH,GAAA;MAEF,CAAA,GAAA,GAAA;IACEV;;IAEA0B,qBAAmB,CAAA;IACnBC,iBAAiB,CAAA;sBAAWrB,CAAAA;qBAAuBsB;MAAU,SAAA,SAAA;MAC/D;IAEF;;;",
|
|
6
|
-
"names": ["execSync", "readFileSync", "resolve", "pkgUp", "parse", "invariant", "log", "setDeep", "process", "KEYS_TO_FILE", "__CONFIG_DEFAULTS__", "configPath", "length", "resolve", "__CONFIG_ENVS__", "envPath", "mode", "entries", "reduce", "prev", "key", "value", "content", "parse", "Object", "forEach", "setDeep", "encoding", "replace", "packagePath", "packageJson", "timestamp", "commitHash", "log", "error", "err", "__CONFIG_LOCAL__", "__DXOS_CONFIG__", "publicUrl"]
|
|
7
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// src/savers/browser.ts
|
|
2
|
-
import localforage from "localforage";
|
|
3
|
-
import { log } from "@dxos/log";
|
|
4
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/sdk/config/src/savers/browser.ts";
|
|
5
|
-
var PERFORMING_CONFIG_SAVE = false;
|
|
6
|
-
var SaveConfig = async (config) => {
|
|
7
|
-
if (PERFORMING_CONFIG_SAVE) {
|
|
8
|
-
log.warn("Already performing config save", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 9, S: void 0 });
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
PERFORMING_CONFIG_SAVE = true;
|
|
12
|
-
try {
|
|
13
|
-
await localforage.setItem("org.dxos.settings.config", config);
|
|
14
|
-
} catch (err) {
|
|
15
|
-
log.warn("Failed to save config", {
|
|
16
|
-
err
|
|
17
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 16, S: void 0 });
|
|
18
|
-
} finally {
|
|
19
|
-
PERFORMING_CONFIG_SAVE = false;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
SaveConfig
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=browser.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/savers/browser.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2021 DXOS.org\n//\n\n/* THIS FILE WILL BE LOADED BY CONTEXT REPLACEMENT PLUGIN IN BROWSER ENVS. */\n\nimport localforage from 'localforage';\n\nimport { log } from '@dxos/log';\nimport { type Config as ConfigProto } from '@dxos/protocols/proto/dxos/config';\n\nlet PERFORMING_CONFIG_SAVE = false;\n\nexport const SaveConfig = async (config: ConfigProto): Promise<void> => {\n if (PERFORMING_CONFIG_SAVE) {\n log.warn('Already performing config save');\n return;\n }\n PERFORMING_CONFIG_SAVE = true;\n\n try {\n await localforage.setItem('org.dxos.settings.config', config);\n } catch (err) {\n log.warn('Failed to save config', { err });\n } finally {\n PERFORMING_CONFIG_SAVE = false;\n }\n};\n"],
|
|
5
|
-
"mappings": ";AAMA,OAAOA,iBAAiB;AAExB,SAASC,WAAW;AAGpB,IAAIC,eAAAA;IAGF,yBAAIA;IACEC,aAAK,OAAA,WAAA;MACT,wBAAA;AACF,QAAA,KAAA,kCAAA,QAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,GAAA,GAAA,OAAA,CAAA;AACAD;EAEA;2BACoBE;AACpB,MAAE;AACAH,UAAIE,YAAK,QAAA,4BAAyB,MAAA;WAAEE,KAAAA;AAAI,QAAA,KAAA,yBAAA;MAC1C;IACEH,GAAAA,EAAAA,YAAAA,YAAyB,GAAA,cAAA,GAAA,IAAA,GAAA,OAAA,CAAA;EAC3B,UAAA;AACA,6BAAA;;;",
|
|
6
|
-
"names": ["localforage", "log", "PERFORMING_CONFIG_SAVE", "warn", "setItem", "err"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/savers/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Config as ConfigProto } from '@dxos/protocols/proto/dxos/config';\n\nexport const SaveConfig = async (_: ConfigProto) => {};\n"],
|
|
5
|
-
"mappings": ";AAMO,IAAMA,aAAa,OAAOC,MAAAA;AAAoB;",
|
|
6
|
-
"names": ["SaveConfig", "_"]
|
|
7
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/types.ts
|
|
4
|
-
var FILE_DEFAULTS = "defaults.yml";
|
|
5
|
-
var FILE_ENVS = "envs-map.yml";
|
|
6
|
-
var FILE_DYNAMICS = "config.yml";
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
FILE_DEFAULTS,
|
|
10
|
-
FILE_ENVS,
|
|
11
|
-
FILE_DYNAMICS
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=chunk-T6NFH3CC.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2021 DXOS.org\n//\n\nimport { type Config as ConfigProto } from '@dxos/protocols/proto/dxos/config';\n\nexport const FILE_DEFAULTS = 'defaults.yml';\nexport const FILE_ENVS = 'envs-map.yml';\nexport const FILE_DYNAMICS = 'config.yml';\n\ntype DotPrefix<T extends string> = T extends '' ? '' : `.${T}`;\n\n/**\n * Returns all dot-separated nested keys for an object.\n *\n * Read more: https://stackoverflow.com/a/68404823.\n */\ntype DotNestedKeys<T> = (\n T extends object\n ? {\n [K in Exclude<keyof T, symbol>]: `${K}${DotPrefix<DotNestedKeys<T[K]>>}`;\n }[Exclude<keyof T, symbol>]\n : ''\n) extends infer D\n ? Extract<D, string>\n : never;\n\n/**\n * Parse a dot separated nested key into an array of keys.\n *\n * Example: 'services.signal.server' -> ['services', 'signal', 'server'].\n */\nexport type ParseKey<K extends string> = K extends `${infer L}.${infer Rest}` ? [L, ...ParseKey<Rest>] : [K];\n\n/**\n * Array of types that can act as an object key.\n */\ntype Keys = (keyof any)[];\n\n/**\n * Retrieves a property type in a series of nested objects.\n *\n * Read more: https://stackoverflow.com/a/61648690.\n */\nexport type DeepIndex<T, KS extends Keys, Fail = undefined> = KS extends [infer F, ...infer R]\n ? F extends keyof Exclude<T, undefined>\n ? R extends Keys\n ? DeepIndex<Exclude<T, undefined>[F], R, Fail>\n : Fail\n : Fail\n : T;\n\n/**\n * Any nested dot separated key that can be in config.\n */\n// TODO(egorgripasov): Clean once old config deprecated.\nexport type ConfigKey = DotNestedKeys<ConfigProto>;\n"],
|
|
5
|
-
"mappings": ";;;AAMO,IAAMA,gBAAgB;AACtB,IAAMC,YAAY;AAClB,IAAMC,gBAAgB;",
|
|
6
|
-
"names": ["FILE_DEFAULTS", "FILE_ENVS", "FILE_DYNAMICS"]
|
|
7
|
-
}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/config.ts
|
|
4
|
-
import defaultsDeep from "lodash.defaultsdeep";
|
|
5
|
-
import isMatch from "lodash.ismatch";
|
|
6
|
-
import { InvalidConfigError } from "@dxos/protocols";
|
|
7
|
-
import { schema } from "@dxos/protocols/proto";
|
|
8
|
-
import { trace } from "@dxos/tracing";
|
|
9
|
-
import { getDeep, setDeep } from "@dxos/util";
|
|
10
|
-
function _ts_decorate(decorators, target, key, desc) {
|
|
11
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
12
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
13
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
|
-
}
|
|
16
|
-
var configRootType = schema.getCodecForType("dxos.config.Config");
|
|
17
|
-
var mapFromKeyValues = (spec, values) => {
|
|
18
|
-
const config = {};
|
|
19
|
-
for (const [key, { path, type }] of Object.entries(spec)) {
|
|
20
|
-
let value = values[key];
|
|
21
|
-
if (value !== void 0) {
|
|
22
|
-
if (type) {
|
|
23
|
-
switch (type) {
|
|
24
|
-
case "boolean": {
|
|
25
|
-
value = String(value).toLowerCase() === "true" || value === "1";
|
|
26
|
-
break;
|
|
27
|
-
}
|
|
28
|
-
case "number": {
|
|
29
|
-
value = Number(value);
|
|
30
|
-
break;
|
|
31
|
-
}
|
|
32
|
-
case "string": {
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
case "json": {
|
|
36
|
-
value = value ? JSON.parse(value) : null;
|
|
37
|
-
break;
|
|
38
|
-
}
|
|
39
|
-
default: {
|
|
40
|
-
throw new Error(`Invalid type: ${type}`);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
setDeep(config, path.split("."), value);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return config;
|
|
48
|
-
};
|
|
49
|
-
var mapToKeyValues = (spec, values) => {
|
|
50
|
-
const config = {};
|
|
51
|
-
for (const [key, { path, type }] of Object.entries(spec)) {
|
|
52
|
-
const value = getDeep(values, path.split("."));
|
|
53
|
-
if (value !== void 0) {
|
|
54
|
-
switch (type) {
|
|
55
|
-
case "json":
|
|
56
|
-
config[key] = JSON.stringify(value);
|
|
57
|
-
break;
|
|
58
|
-
default:
|
|
59
|
-
config[key] = value;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return config;
|
|
64
|
-
};
|
|
65
|
-
var validateConfig = (config) => {
|
|
66
|
-
if (!("version" in config)) {
|
|
67
|
-
throw new InvalidConfigError({
|
|
68
|
-
message: "Version not specified"
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
if (config?.version !== 1) {
|
|
72
|
-
throw new InvalidConfigError({
|
|
73
|
-
message: `Invalid config version: ${config.version}`
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
const error = configRootType.protoType.verify(config);
|
|
77
|
-
if (error) {
|
|
78
|
-
throw new InvalidConfigError({
|
|
79
|
-
message: String(error)
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
return config;
|
|
83
|
-
};
|
|
84
|
-
var ConfigResource = /* @__PURE__ */ Symbol.for("dxos.resource.Config");
|
|
85
|
-
var Config = class {
|
|
86
|
-
_config;
|
|
87
|
-
/**
|
|
88
|
-
* Creates an immutable instance.
|
|
89
|
-
* @constructor
|
|
90
|
-
*/
|
|
91
|
-
constructor(config = {}, ...objects) {
|
|
92
|
-
this._config = validateConfig(defaultsDeep(config, ...objects, {
|
|
93
|
-
version: 1
|
|
94
|
-
}));
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Returns an immutable config JSON object.
|
|
98
|
-
*/
|
|
99
|
-
get values() {
|
|
100
|
-
return this._config;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Returns the given config property.
|
|
104
|
-
*
|
|
105
|
-
* @param key A key in the config object. Can be a nested property with keys separated by dots: 'services.signal.server'.
|
|
106
|
-
* @param defaultValue Default value to return if option is not present in the config.
|
|
107
|
-
* @returns The config value or undefined if the option is not present.
|
|
108
|
-
*/
|
|
109
|
-
get(key, defaultValue) {
|
|
110
|
-
return getDeep(this._config, key.split(".")) ?? defaultValue;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Get unique key.
|
|
114
|
-
*/
|
|
115
|
-
find(path, test) {
|
|
116
|
-
const values = getDeep(this._config, path.split("."));
|
|
117
|
-
if (!Array.isArray(values)) {
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
return values.find((value) => isMatch(value, test));
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Returns the given config property or throw if it doesn't exist.
|
|
124
|
-
*
|
|
125
|
-
* @param key A key in the config object. Can be a nested property with keys separated by dots: 'services.signal.server'.
|
|
126
|
-
*/
|
|
127
|
-
getOrThrow(key) {
|
|
128
|
-
const value = getDeep(this._config, key.split("."));
|
|
129
|
-
if (!value) {
|
|
130
|
-
throw new Error(`Config option not present: ${key}`);
|
|
131
|
-
}
|
|
132
|
-
return value;
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
Config = _ts_decorate([
|
|
136
|
-
trace.resource({
|
|
137
|
-
annotation: ConfigResource
|
|
138
|
-
})
|
|
139
|
-
], Config);
|
|
140
|
-
|
|
141
|
-
export {
|
|
142
|
-
mapFromKeyValues,
|
|
143
|
-
mapToKeyValues,
|
|
144
|
-
validateConfig,
|
|
145
|
-
ConfigResource,
|
|
146
|
-
Config
|
|
147
|
-
};
|
|
148
|
-
//# sourceMappingURL=chunk-WIJROCKQ.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/config.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2021 DXOS.org\n//\n\nimport defaultsDeep from 'lodash.defaultsdeep';\nimport isMatch from 'lodash.ismatch';\n\nimport { InvalidConfigError } from '@dxos/protocols';\nimport { schema } from '@dxos/protocols/proto';\nimport { type Config as ConfigProto } from '@dxos/protocols/proto/dxos/config';\nimport { trace } from '@dxos/tracing';\nimport { getDeep, setDeep } from '@dxos/util';\n\nimport { type ConfigKey, type DeepIndex, type ParseKey } from './types';\n\ntype MappingSpec = Record<string, { path: string; type?: string }>;\nconst configRootType = schema.getCodecForType('dxos.config.Config');\n\n/**\n * Maps the given objects onto a flattened set of (key x values).\n * Expects parsed yaml content of the form:\n *\n * ```\n * ENV_VAR:\n * path: config.selector.path\n * ```\n *\n * @param {object} spec\n * @param {object} values\n * @return {object}\n */\nexport const mapFromKeyValues = (spec: MappingSpec, values: Record<string, any>) => {\n const config = {};\n\n for (const [key, { path, type }] of Object.entries(spec)) {\n let value = values[key];\n if (value !== undefined) {\n if (type) {\n switch (type) {\n case 'boolean': {\n value = String(value).toLowerCase() === 'true' || value === '1';\n break;\n }\n\n case 'number': {\n value = Number(value);\n break;\n }\n\n case 'string': {\n break;\n }\n\n case 'json': {\n value = value ? JSON.parse(value) : null;\n break;\n }\n\n default: {\n throw new Error(`Invalid type: ${type}`);\n }\n }\n }\n\n setDeep(config, path.split('.'), value);\n }\n }\n\n return config;\n};\n\n/**\n * Maps the given flattend set of (key x values) onto a JSON object.\n * @param {object} spec\n * @param {object} values\n */\nexport const mapToKeyValues = (spec: MappingSpec, values: any) => {\n const config: Record<string, any> = {};\n\n for (const [key, { path, type }] of Object.entries(spec)) {\n const value = getDeep(values, path.split('.'));\n if (value !== undefined) {\n switch (type) {\n case 'json':\n config[key] = JSON.stringify(value);\n break;\n default:\n config[key] = value;\n }\n }\n }\n\n return config;\n};\n\n/**\n * Validate config object.\n */\nexport const validateConfig = (config: ConfigProto): ConfigProto => {\n if (!('version' in config)) {\n throw new InvalidConfigError({ message: 'Version not specified' });\n }\n\n if (config?.version !== 1) {\n throw new InvalidConfigError({ message: `Invalid config version: ${config.version}` });\n }\n\n const error = configRootType.protoType.verify(config);\n if (error) {\n throw new InvalidConfigError({ message: String(error) });\n }\n\n return config;\n};\n\nexport const ConfigResource = Symbol.for('dxos.resource.Config');\n\n/**\n * Global configuration object.\n * NOTE: Config objects are immutable.\n */\n@trace.resource({ annotation: ConfigResource })\nexport class Config {\n private readonly _config: any;\n\n /**\n * Creates an immutable instance.\n * @constructor\n */\n constructor(config: ConfigProto = {}, ...objects: ConfigProto[]) {\n this._config = validateConfig(defaultsDeep(config, ...objects, { version: 1 }));\n }\n\n /**\n * Returns an immutable config JSON object.\n */\n get values(): ConfigProto {\n return this._config;\n }\n\n /**\n * Returns the given config property.\n *\n * @param key A key in the config object. Can be a nested property with keys separated by dots: 'services.signal.server'.\n * @param defaultValue Default value to return if option is not present in the config.\n * @returns The config value or undefined if the option is not present.\n */\n get<K extends ConfigKey>(\n key: K,\n defaultValue?: DeepIndex<ConfigProto, ParseKey<K>>,\n ): DeepIndex<ConfigProto, ParseKey<K>> | undefined {\n return getDeep(this._config, key.split('.')) ?? defaultValue;\n }\n\n /**\n * Get unique key.\n */\n find<T = any>(path: string, test: object): T | undefined {\n const values = getDeep(this._config, path.split('.'));\n if (!Array.isArray(values)) {\n return;\n }\n\n return values.find((value) => isMatch(value, test));\n }\n\n /**\n * Returns the given config property or throw if it doesn't exist.\n *\n * @param key A key in the config object. Can be a nested property with keys separated by dots: 'services.signal.server'.\n */\n getOrThrow<K extends ConfigKey>(key: K): Exclude<DeepIndex<ConfigProto, ParseKey<K>>, undefined> {\n const value: DeepIndex<ConfigProto, ParseKey<K>> | undefined = getDeep(this._config, key.split('.'));\n if (!value) {\n throw new Error(`Config option not present: ${key}`);\n }\n return value;\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;AAIA,OAAOA,kBAAkB;AACzB,OAAOC,aAAa;AAEpB,SAASC,0BAA0B;AACnC,SAASC,cAAc;AAEvB,SAASC,aAAa;AACtB,SAASC,SAASC,eAAe;;;;;;;AAKjC,IAAMC,iBAAiBJ,OAAOK,gBAAgB,oBAAA;AAevC,IAAMC,mBAAmB,CAACC,MAAmBC,WAAAA;AAClD,QAAMC,SAAS,CAAC;AAEhB,aAAW,CAACC,KAAK,EAAEC,MAAMC,KAAI,CAAE,KAAKC,OAAOC,QAAQP,IAAAA,GAAO;AACxD,QAAIQ,QAAQP,OAAOE,GAAAA;AACnB,QAAIK,UAAUC,QAAW;AACvB,UAAIJ,MAAM;AACR,gBAAQA,MAAAA;UACN,KAAK,WAAW;AACdG,oBAAQE,OAAOF,KAAAA,EAAOG,YAAW,MAAO,UAAUH,UAAU;AAC5D;UACF;UAEA,KAAK,UAAU;AACbA,oBAAQI,OAAOJ,KAAAA;AACf;UACF;UAEA,KAAK,UAAU;AACb;UACF;UAEA,KAAK,QAAQ;AACXA,oBAAQA,QAAQK,KAAKC,MAAMN,KAAAA,IAAS;AACpC;UACF;UAEA,SAAS;AACP,kBAAM,IAAIO,MAAM,iBAAiBV,IAAAA,EAAM;UACzC;QACF;MACF;AAEAT,cAAQM,QAAQE,KAAKY,MAAM,GAAA,GAAMR,KAAAA;IACnC;EACF;AAEA,SAAON;AACT;AAOO,IAAMe,iBAAiB,CAACjB,MAAmBC,WAAAA;AAChD,QAAMC,SAA8B,CAAC;AAErC,aAAW,CAACC,KAAK,EAAEC,MAAMC,KAAI,CAAE,KAAKC,OAAOC,QAAQP,IAAAA,GAAO;AACxD,UAAMQ,QAAQb,QAAQM,QAAQG,KAAKY,MAAM,GAAA,CAAA;AACzC,QAAIR,UAAUC,QAAW;AACvB,cAAQJ,MAAAA;QACN,KAAK;AACHH,iBAAOC,GAAAA,IAAOU,KAAKK,UAAUV,KAAAA;AAC7B;QACF;AACEN,iBAAOC,GAAAA,IAAOK;MAClB;IACF;EACF;AAEA,SAAON;AACT;AAKO,IAAMiB,iBAAiB,CAACjB,WAAAA;AAC7B,MAAI,EAAE,aAAaA,SAAS;AAC1B,UAAM,IAAIV,mBAAmB;MAAE4B,SAAS;IAAwB,CAAA;EAClE;AAEA,MAAIlB,QAAQmB,YAAY,GAAG;AACzB,UAAM,IAAI7B,mBAAmB;MAAE4B,SAAS,2BAA2BlB,OAAOmB,OAAO;IAAG,CAAA;EACtF;AAEA,QAAMC,QAAQzB,eAAe0B,UAAUC,OAAOtB,MAAAA;AAC9C,MAAIoB,OAAO;AACT,UAAM,IAAI9B,mBAAmB;MAAE4B,SAASV,OAAOY,KAAAA;IAAO,CAAA;EACxD;AAEA,SAAOpB;AACT;AAEO,IAAMuB,iBAAiBC,uBAAOC,IAAI,sBAAA;AAOlC,IAAMC,SAAN,MAAMA;EACMC;;;;;EAMjB,YAAY3B,SAAsB,CAAC,MAAM4B,SAAwB;AAC/D,SAAKD,UAAUV,eAAe7B,aAAaY,QAAAA,GAAW4B,SAAS;MAAET,SAAS;IAAE,CAAA,CAAA;EAC9E;;;;EAKA,IAAIpB,SAAsB;AACxB,WAAO,KAAK4B;EACd;;;;;;;;EASAE,IACE5B,KACA6B,cACiD;AACjD,WAAOrC,QAAQ,KAAKkC,SAAS1B,IAAIa,MAAM,GAAA,CAAA,KAASgB;EAClD;;;;EAKAC,KAAc7B,MAAc8B,MAA6B;AACvD,UAAMjC,SAASN,QAAQ,KAAKkC,SAASzB,KAAKY,MAAM,GAAA,CAAA;AAChD,QAAI,CAACmB,MAAMC,QAAQnC,MAAAA,GAAS;AAC1B;IACF;AAEA,WAAOA,OAAOgC,KAAK,CAACzB,UAAUjB,QAAQiB,OAAO0B,IAAAA,CAAAA;EAC/C;;;;;;EAOAG,WAAgClC,KAAiE;AAC/F,UAAMK,QAAyDb,QAAQ,KAAKkC,SAAS1B,IAAIa,MAAM,GAAA,CAAA;AAC/F,QAAI,CAACR,OAAO;AACV,YAAM,IAAIO,MAAM,8BAA8BZ,GAAAA,EAAK;IACrD;AACA,WAAOK;EACT;AACF;;QAzDO8B,SAAAA;IAAWC,YAAYd;;;",
|
|
6
|
-
"names": ["defaultsDeep", "isMatch", "InvalidConfigError", "schema", "trace", "getDeep", "setDeep", "configRootType", "getCodecForType", "mapFromKeyValues", "spec", "values", "config", "key", "path", "type", "Object", "entries", "value", "undefined", "String", "toLowerCase", "Number", "JSON", "parse", "Error", "split", "mapToKeyValues", "stringify", "validateConfig", "message", "version", "error", "protoType", "verify", "ConfigResource", "Symbol", "for", "Config", "_config", "objects", "get", "defaultValue", "find", "test", "Array", "isArray", "getOrThrow", "resource", "annotation"]
|
|
7
|
-
}
|