@yolean/evidence-sdk 0.0.0-stage → 4.1.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/CHANGELOG.md +538 -0
- package/LICENSE.md +9 -0
- package/README.md +237 -2
- package/package.json +161 -3
- package/src/build-dev/cli/add/addServerHook.js +30 -0
- package/src/build-dev/cli/add/addTypeRef.js +19 -0
- package/src/build-dev/cli/add/updateGitIgnore.js +33 -0
- package/src/build-dev/cli/add/updatePackageJson.js +26 -0
- package/src/build-dev/cli/add/updateSvelteConfig.js +199 -0
- package/src/build-dev/cli/add/updateViteConfig.js +152 -0
- package/src/build-dev/cli/add.js +95 -0
- package/src/build-dev/cli/build.js +30 -0
- package/src/build-dev/cli/dev.js +49 -0
- package/src/build-dev/cli/index.js +14 -0
- package/src/build-dev/cli/upgrade.js +54 -0
- package/src/build-dev/svelte/index.js +54 -0
- package/src/build-dev/svelte/lib/isTargetFile.js +6 -0
- package/src/build-dev/svelte/metadatas.js +39 -0
- package/src/build-dev/svelte/processors/addBasePathToHrefAndSrc/addBasePathToHrefAndSrc.js +29 -0
- package/src/build-dev/svelte/processors/addBasePathToHrefAndSrc/addBasePathToHrefAndSrc.spec.js +82 -0
- package/src/build-dev/svelte/processors/addScriptTags.js +17 -0
- package/src/build-dev/svelte/processors/convertToHtml/convertToHtml.js +19 -0
- package/src/build-dev/svelte/processors/convertToHtml/convertToHtml.spec.js +123 -0
- package/src/build-dev/svelte/processors/convertToHtml/processMarkdown.js +59 -0
- package/src/build-dev/svelte/processors/extractQueries/extractQueries.js +49 -0
- package/src/build-dev/svelte/processors/extractQueries/extractQueries.spec.js +54 -0
- package/src/build-dev/svelte/processors/highlight/highlight.js +52 -0
- package/src/build-dev/svelte/processors/highlight/highlight.spec.js +31 -0
- package/src/build-dev/svelte/processors/initializeUniversalSql.js +15 -0
- package/src/build-dev/svelte/processors/injectComponents/injectComponents.js +56 -0
- package/src/build-dev/svelte/processors/injectHighlightStyles.js +14 -0
- package/src/build-dev/svelte/processors/injectQueries/injectQueries.js +77 -0
- package/src/build-dev/svelte/processors/markRootLayoutPrerenderable.js +56 -0
- package/src/build-dev/svelte/processors/obfuscateCode/obfuscateCode.js +17 -0
- package/src/build-dev/svelte/processors/obfuscateCode/obfuscateCode.spec.js +21 -0
- package/src/build-dev/svelte/processors/transformQueries/transformQueries.js +58 -0
- package/src/build-dev/vite/config-virtual.js +24 -0
- package/src/build-dev/vite/constants.js +7 -0
- package/src/build-dev/vite/datasource-plugins/source-query-hmr.js +117 -0
- package/src/build-dev/vite/evidence-config.d.ts +6 -0
- package/src/build-dev/vite/index.js +214 -0
- package/src/build-dev/vite/layout-plugins/copy-to-layout.js +71 -0
- package/src/build-dev/vite/plugins.js +4 -0
- package/src/build-dev/vite/query-directory-hmr.js +32 -0
- package/src/build-dev/vite/sidecar-app.js +79 -0
- package/src/build-dev/vite/virtuals/QuerySSR.svelte +13 -0
- package/src/build-dev/vite/virtuals/__tests/proxyStack.spec.js +52 -0
- package/src/build-dev/vite/virtuals/bootstrapContexts.svelte.js +27 -0
- package/src/build-dev/vite/virtuals/browser/static-assets.js +3 -0
- package/src/build-dev/vite/virtuals/contextKeys.js +3 -0
- package/src/build-dev/vite/virtuals/initUsql.js +23 -0
- package/src/build-dev/vite/virtuals/node/static-assets.js +56 -0
- package/src/build-dev/vite/virtuals/proxyStack.js +37 -0
- package/src/build-dev/vite/virtuals/queries.svelte.js +150 -0
- package/src/build-dev/vite/virtuals/ssrHook.svelte.js +60 -0
- package/src/build-dev/vite/virtuals/updateQueryContext.svelte.js +31 -0
- package/src/build-dev/vite/virtuals-dynamic.js +12 -0
- package/src/cli.js +5 -0
- package/src/cli.root.js +90 -0
- package/src/configuration/cli/create.js +20 -0
- package/src/configuration/cli/index.js +12 -0
- package/src/configuration/createEvidenceConfig.js +51 -0
- package/src/configuration/getEvidenceConfig.js +60 -0
- package/src/configuration/getEvidenceConfig.legacy.js +27 -0
- package/src/configuration/index.js +1 -0
- package/src/configuration/schemas/config.schema.js +11 -0
- package/src/configuration/schemas/deployment.schema.js +9 -0
- package/src/configuration/schemas/deployment.schema.spec.js +34 -0
- package/src/configuration/updateEvidenceConfig.js +25 -0
- package/src/legacy-compat.js +8 -0
- package/src/lib/EvidenceError.js +35 -0
- package/src/lib/b64Deep.js +55 -0
- package/src/lib/check-import.js +12 -0
- package/src/lib/cleanZodErrors.js +22 -0
- package/src/lib/cli/cmdFail.js +33 -0
- package/src/lib/cli/notices.js +44 -0
- package/src/lib/debug.js +40 -0
- package/src/lib/flows.d.ts +21 -0
- package/src/lib/forceLink.js +28 -0
- package/src/lib/history/index.js +70 -0
- package/src/lib/history/types.d.ts +8 -0
- package/src/lib/pkg-types.helpers.js +16 -0
- package/src/lib/processing-queue.js +96 -0
- package/src/lib/processing-queue.spec.js +148 -0
- package/src/lib/projectPaths.js +29 -0
- package/src/lib/projectRoot.js +12 -0
- package/src/lib/sharedPromise.js +77 -0
- package/src/lib/sharedPromise.spec.js +23 -0
- package/src/lib/strict.js +19 -0
- package/src/lib/tests/fs.js +21 -0
- package/src/lib/tokens.js +7 -0
- package/src/lib/unnest-zod-error.js +14 -0
- package/src/logger/EvidenceLogger.js +164 -0
- package/src/logger/index.js +4 -0
- package/src/meta.js +8 -0
- package/src/plugins/cli/index.js +13 -0
- package/src/plugins/cli/install.js +26 -0
- package/src/plugins/cli/install.prompt.js +121 -0
- package/src/plugins/components/getAllComponents.js +82 -0
- package/src/plugins/components/getComponentsInPlugin.js +33 -0
- package/src/plugins/components/loadComponentPlugins.js +48 -0
- package/src/plugins/components/loaders/file-loader.js +125 -0
- package/src/plugins/components/loaders/manifest-loader.js +53 -0
- package/src/plugins/components/schemas/component-manifest.schema.js +5 -0
- package/src/plugins/components/types.d.ts +21 -0
- package/src/plugins/components/validateOverrides.js +30 -0
- package/src/plugins/components/validateOverrides.spec.js +32 -0
- package/src/plugins/datasources/Datasources.js +85 -0
- package/src/plugins/datasources/Datasources.spec.js +78 -0
- package/src/plugins/datasources/SourceResultCache.js +62 -0
- package/src/plugins/datasources/buildSourceDirectoryProxy.js +21 -0
- package/src/plugins/datasources/cli/edit/Options.fixtures.js +69 -0
- package/src/plugins/datasources/cli/edit/Options.js +253 -0
- package/src/plugins/datasources/cli/edit/Options.spec.js +496 -0
- package/src/plugins/datasources/cli/edit/editSourceConfig.js +201 -0
- package/src/plugins/datasources/cli/edit.js +20 -0
- package/src/plugins/datasources/cli/edit.prompt.js +100 -0
- package/src/plugins/datasources/cli/index.js +18 -0
- package/src/plugins/datasources/cli/sources.js +77 -0
- package/src/plugins/datasources/evalSources.js +257 -0
- package/src/plugins/datasources/getPublishedDatasources.js +62 -0
- package/src/plugins/datasources/index.js +6 -0
- package/src/plugins/datasources/loadSourceConfig.js +147 -0
- package/src/plugins/datasources/loadSourceConfig.spec.js +127 -0
- package/src/plugins/datasources/loadSourcePlugins.js +49 -0
- package/src/plugins/datasources/loadSources.js +48 -0
- package/src/plugins/datasources/schemas/datasource.schema.js +52 -0
- package/src/plugins/datasources/schemas/datasourceCache.schema.js +3 -0
- package/src/plugins/datasources/schemas/datasourcePlugin.schema.js +37 -0
- package/src/plugins/datasources/schemas/datasourcePluginOptions.schema.js +64 -0
- package/src/plugins/datasources/schemas/index.js +2 -0
- package/src/plugins/datasources/schemas/manifest.schema.js +8 -0
- package/src/plugins/datasources/schemas/results.schema.js +126 -0
- package/src/plugins/datasources/sub-source-vars.js +55 -0
- package/src/plugins/datasources/sub-source-vars.spec.js +46 -0
- package/src/plugins/datasources/types.d.ts +53 -0
- package/src/plugins/datasources/updateManifest.js +115 -0
- package/src/plugins/datasources/updateManifest.spec.js +200 -0
- package/src/plugins/datasources/wrapSimpleConnector.js +95 -0
- package/src/plugins/datasources/writeSourceConfig.js +60 -0
- package/src/plugins/index.js +2 -0
- package/src/plugins/layouts/copyMethods/index.js +10 -0
- package/src/plugins/layouts/copyMethods/svelte.js +53 -0
- package/src/plugins/layouts/copyMethods/sveltekit.js +75 -0
- package/src/plugins/layouts/copyToLayout.js +106 -0
- package/src/plugins/layouts/loadLayoutPlugin.js +23 -0
- package/src/plugins/loadPluginPackage.js +77 -0
- package/src/plugins/schemas/index.js +1 -0
- package/src/plugins/schemas/plugin-config.schema.js +41 -0
- package/src/plugins/schemas/plugin-config.schema.spec.js +21 -0
- package/src/plugins/schemas/plugin-package.schema.js +154 -0
- package/src/plugins/schemas/plugin-package.schema.spec.js +30 -0
- package/src/query-builder.d.ts +1 -0
- package/src/query-builder.js +1 -0
- package/src/types/duckdb-wellknown.d.ts +35 -0
- package/src/types/html-attributes.ts +13 -0
- package/src/types/index.d.ts +18 -0
- package/src/types/mosaic-sql.d.ts +27 -0
- package/src/types/sveltekit-autoimport.d.ts +13 -0
- package/src/types/virtuals.d.ts +113 -0
- package/src/types.d.ts +1 -0
- package/src/usql/index.d.ts +4 -0
- package/src/usql/index.js +3 -0
- package/src/usql/query/Query.js +1391 -0
- package/src/usql/query/Query.spec.js +827 -0
- package/src/usql/query/queryScore.js +92 -0
- package/src/usql/query/queryScore.spec.js +26 -0
- package/src/usql/query/sterilizeQuery.js +89 -0
- package/src/usql/query/sterilizeQuery.spec.js +172 -0
- package/src/usql/setTrackProxy/setTrackProxy.js +80 -0
- package/src/usql/setTrackProxy/setTrackProxy.spec.js +166 -0
- package/src/usql/types.ts +86 -0
- package/src/usql/utilities/duckdbSerialize.js +29 -0
- package/src/usql/utilities/index.js +2 -0
- package/src/usql/utilities/resolveMaybePromise.js +30 -0
- package/src/utils/batchUp.js +22 -0
- package/src/utils/batchUp.spec.js +69 -0
- package/src/utils/browserDebounce.js +16 -0
- package/src/utils/index.js +7 -0
- package/src/utils/svelte/addBasePath.js +45 -0
- package/src/utils/svelte/addBasePath.spec.js +86 -0
- package/src/utils/svelte/index.js +5 -0
- package/src/utils/svelte/inputs.js +138 -0
- package/tsconfig.json +22 -0
- package/vite.config.js +3 -0
- package/vitest.config.js +15 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { resetFs, writeFs } from '../../lib/tests/fs.js';
|
|
2
|
+
|
|
3
|
+
import { afterEach, beforeEach, describe, it, expect, vi } from 'vitest';
|
|
4
|
+
import yaml from 'yaml';
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
loadConnection,
|
|
8
|
+
loadConnectionOptions,
|
|
9
|
+
loadConnectionEnvironment
|
|
10
|
+
} from './loadSourceConfig.js';
|
|
11
|
+
|
|
12
|
+
afterEach(() => {
|
|
13
|
+
resetFs();
|
|
14
|
+
vi.resetAllMocks();
|
|
15
|
+
vi.unstubAllEnvs();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
describe('loadConnectionEnvironment', () => {
|
|
19
|
+
it('should load nothing when no variables are given', async () => {
|
|
20
|
+
expect(await loadConnectionEnvironment('source')).toEqual({});
|
|
21
|
+
});
|
|
22
|
+
it('should load nothing when no properly formatted variables are given', async () => {
|
|
23
|
+
vi.stubEnv('EVIDENCE_SOURCE_notsource_SOMEVAR', '10');
|
|
24
|
+
expect(await loadConnectionEnvironment('source')).toEqual({});
|
|
25
|
+
});
|
|
26
|
+
it('should load vars when properly formatted variables are given', async () => {
|
|
27
|
+
vi.stubEnv('EVIDENCE_SOURCE__source__SOMEVAR', '10');
|
|
28
|
+
expect(await loadConnectionEnvironment('source')).toEqual({ SOMEVAR: '10' });
|
|
29
|
+
});
|
|
30
|
+
it('should load vars when properly formatted variables are given (with nesting)', async () => {
|
|
31
|
+
vi.stubEnv('EVIDENCE_SOURCE__source__SOMEVAR', '10');
|
|
32
|
+
vi.stubEnv('EVIDENCE_SOURCE__source__SOMEOBJ__KEY', '10');
|
|
33
|
+
expect(await loadConnectionEnvironment('source')).toEqual({
|
|
34
|
+
SOMEVAR: '10',
|
|
35
|
+
SOMEOBJ: { KEY: '10' }
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
describe('loadSourceOptions', () => {
|
|
40
|
+
beforeEach(() => {
|
|
41
|
+
writeFs(
|
|
42
|
+
{
|
|
43
|
+
sources: {
|
|
44
|
+
noOptions: {},
|
|
45
|
+
options: {
|
|
46
|
+
'connection.options.yaml': 'x: 5'
|
|
47
|
+
},
|
|
48
|
+
invalidB64: {
|
|
49
|
+
'connection.options.yaml': yaml.stringify({ x: btoa('hello world').substring(0, 5) })
|
|
50
|
+
},
|
|
51
|
+
validB64: {
|
|
52
|
+
'connection.options.yaml': yaml.stringify({ x: btoa('hello world') })
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
process.cwd()
|
|
57
|
+
);
|
|
58
|
+
});
|
|
59
|
+
it('should return an empty object when given a directory w/o an options.yaml', async () => {
|
|
60
|
+
expect(await loadConnectionOptions('./sources/noOptions')).toEqual({});
|
|
61
|
+
});
|
|
62
|
+
it('should return an object when given a directory w/o an options.yaml', async () => {
|
|
63
|
+
expect(await loadConnectionOptions('./sources/options')).toEqual({ x: 5 });
|
|
64
|
+
});
|
|
65
|
+
it('should throw if an invalid base64 error occurs', async () => {
|
|
66
|
+
expect(loadConnectionOptions('./sources/invalidB64')).rejects.toThrowError(
|
|
67
|
+
'Error parsing connection.options.yaml file'
|
|
68
|
+
);
|
|
69
|
+
});
|
|
70
|
+
it('should return b64 decoded options', async () => {
|
|
71
|
+
expect(await loadConnectionOptions('./sources/validB64')).toEqual({ x: 'hello world' });
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
describe('loadConnection', () => {
|
|
75
|
+
beforeEach(() => {
|
|
76
|
+
writeFs(
|
|
77
|
+
{
|
|
78
|
+
sources: {
|
|
79
|
+
invalidYaml: {
|
|
80
|
+
'connection.yaml': 'text foobar\nnumber: 2'
|
|
81
|
+
},
|
|
82
|
+
malformedConnection: {
|
|
83
|
+
'connection.yaml': yaml.stringify({ NaMe: 'malformed' })
|
|
84
|
+
},
|
|
85
|
+
source1dir: {
|
|
86
|
+
'connection.yaml': yaml.stringify({
|
|
87
|
+
name: 'source1',
|
|
88
|
+
type: 'fake-source',
|
|
89
|
+
options: { x: 1 }
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
process.cwd()
|
|
95
|
+
);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it('should return false when given a directory that does not exist', async () => {
|
|
99
|
+
expect(await loadConnection('fake-dir')).toBe(false);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it('should throw an error when given a directory with an invalid connection.yaml', async () => {
|
|
103
|
+
expect(loadConnection('./sources/invalidYaml')).rejects.toThrowError(
|
|
104
|
+
'Error parsing connection.yaml file'
|
|
105
|
+
);
|
|
106
|
+
});
|
|
107
|
+
it('should throw an error when given a directory with a malformed connection.yaml', async () => {
|
|
108
|
+
expect(loadConnection('./sources/malformedConnection')).rejects.toThrowError(
|
|
109
|
+
'Unable to load connection.yaml'
|
|
110
|
+
);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it('should load a valid configuration', async () => {
|
|
114
|
+
const result = await loadConnection('sources/source1dir');
|
|
115
|
+
expect(typeof result).not.toEqual('boolean');
|
|
116
|
+
if (result === false) return; // already failed
|
|
117
|
+
expect(result.name).toEqual('source1');
|
|
118
|
+
expect(result.type).toEqual('fake-source');
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it('should include options from a valid configuration', async () => {
|
|
122
|
+
const result = await loadConnection('sources/source1dir');
|
|
123
|
+
expect(typeof result).not.toEqual('boolean');
|
|
124
|
+
if (result === false) return; // already failed
|
|
125
|
+
expect(result.options.x).toEqual(1);
|
|
126
|
+
});
|
|
127
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { getEvidenceConfig } from '../../configuration/getEvidenceConfig.js';
|
|
3
|
+
import { isDatasourcePlugin } from '../schemas/plugin-package.schema.js';
|
|
4
|
+
import { Datasources } from './Datasources.js';
|
|
5
|
+
import { DatasourceSchema } from './schemas/datasourcePlugin.schema.js';
|
|
6
|
+
import { loadPluginPackage } from '../loadPluginPackage.js';
|
|
7
|
+
import path from 'path';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @returns {Promise<Datasources>}
|
|
11
|
+
*/
|
|
12
|
+
export const loadSourcePlugins = async () => {
|
|
13
|
+
const { plugins } = getEvidenceConfig();
|
|
14
|
+
|
|
15
|
+
const datasources = new Datasources();
|
|
16
|
+
for (const [name, spec] of Object.entries(plugins.datasources ?? {})) {
|
|
17
|
+
const pack = await loadPluginPackage(name);
|
|
18
|
+
if (pack === null) continue;
|
|
19
|
+
// First, locate the package
|
|
20
|
+
if (!isDatasourcePlugin(pack)) {
|
|
21
|
+
console.warn(
|
|
22
|
+
chalk.yellow(
|
|
23
|
+
`Datasource package ${chalk.bold(`"${name}"`)} is an invalid Datasource plugin`
|
|
24
|
+
)
|
|
25
|
+
);
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const packageMainpath = path.join(pack.dir.replace('package.json', ''), pack.main);
|
|
30
|
+
|
|
31
|
+
const plugin = await import(new URL('file://' + packageMainpath).toString());
|
|
32
|
+
const source = DatasourceSchema.safeParse(plugin);
|
|
33
|
+
if (!source.success) {
|
|
34
|
+
console.warn(
|
|
35
|
+
chalk.yellow(
|
|
36
|
+
`Datasource package ${chalk.bold(
|
|
37
|
+
`"${name}"`
|
|
38
|
+
)} is an invalid Datasource plugin, run again with --debug for more information`
|
|
39
|
+
)
|
|
40
|
+
);
|
|
41
|
+
console.debug(source.error.format());
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
datasources.add(pack, source.data, spec?.overrides);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return datasources;
|
|
49
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import fs from 'fs/promises';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { loadSourceConfig } from './loadSourceConfig.js';
|
|
5
|
+
import { sourcesDirectory } from '../../lib/projectPaths.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param {string} sourcePath
|
|
10
|
+
*/
|
|
11
|
+
const loadSource = async (sourcePath) => {
|
|
12
|
+
const isDir = await fs.stat(sourcePath).then((stat) => stat.isDirectory());
|
|
13
|
+
if (!isDir) {
|
|
14
|
+
console.debug(
|
|
15
|
+
chalk.dim.yellow(`Source @ ${path.relative(process.cwd(), sourcePath)} is not a directory!`)
|
|
16
|
+
);
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
return loadSourceConfig(sourcePath);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @param {import('ora').Ora} [spinner]
|
|
24
|
+
* @returns {Promise<Array<import('./schemas/datasource.schema.js').DatasourceSpec & {dir: string}>>}
|
|
25
|
+
*/
|
|
26
|
+
export const loadSources = async (spinner) => {
|
|
27
|
+
/** @type {string[]} */
|
|
28
|
+
let sourceDirs = [];
|
|
29
|
+
try {
|
|
30
|
+
sourceDirs = await fs
|
|
31
|
+
.readdir(sourcesDirectory)
|
|
32
|
+
.then((dirs) => dirs.map((dir) => path.join(sourcesDirectory, dir)));
|
|
33
|
+
} catch (e) {
|
|
34
|
+
spinner?.stopAndPersist({
|
|
35
|
+
symbol: '⚠',
|
|
36
|
+
text: chalk.yellow('No sources directory found, no sources to run')
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return /** @type {Array<import('./schemas/datasource.schema.js').DatasourceSpec & {dir: string}>}*/ (
|
|
41
|
+
await Promise.all(
|
|
42
|
+
sourceDirs.map(async (dir) => ({
|
|
43
|
+
dir,
|
|
44
|
+
...(await loadSource(dir))
|
|
45
|
+
}))
|
|
46
|
+
).then((sources) => sources.filter((source) => Boolean(source.name)))
|
|
47
|
+
);
|
|
48
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/** @typedef {z.infer<typeof DatasourceSpecFileSchema>} DatasourceSpec */
|
|
4
|
+
|
|
5
|
+
export const DatasourceSpecFileSchema = z
|
|
6
|
+
.object({
|
|
7
|
+
type: z.string(),
|
|
8
|
+
name: z.string().refine((s) => s?.toString().match(/^[a-zA-Z0-9_-]+$/)?.length),
|
|
9
|
+
options: z.any(),
|
|
10
|
+
buildOptions: z
|
|
11
|
+
.object({
|
|
12
|
+
batchSize: z
|
|
13
|
+
.number()
|
|
14
|
+
.min(1)
|
|
15
|
+
.optional()
|
|
16
|
+
.default(1000 * 1000)
|
|
17
|
+
})
|
|
18
|
+
.optional()
|
|
19
|
+
.default({})
|
|
20
|
+
})
|
|
21
|
+
.transform((datasource) => ({
|
|
22
|
+
...datasource,
|
|
23
|
+
environmentVariables: getDatasourceEnvironmentVariables(datasource.name)
|
|
24
|
+
}));
|
|
25
|
+
|
|
26
|
+
const keyRegex = /^EVIDENCE_SOURCE__([a-zA-Z0-9_]+)$/;
|
|
27
|
+
|
|
28
|
+
/** @param {string} sourceName */
|
|
29
|
+
const getDatasourceEnvironmentVariables = (sourceName) => {
|
|
30
|
+
/** @type {Record<string, any>} */
|
|
31
|
+
const environmentVariables = {};
|
|
32
|
+
|
|
33
|
+
for (const [key, value] of Object.entries(process.env)) {
|
|
34
|
+
const parts = keyRegex.exec(key);
|
|
35
|
+
if (!parts) continue;
|
|
36
|
+
if (parts?.length < 2) continue;
|
|
37
|
+
if (!parts[1].toLowerCase().startsWith(sourceName.toLowerCase())) continue;
|
|
38
|
+
const rawOptKey = parts[1].substring(sourceName.length + 2).split('__');
|
|
39
|
+
|
|
40
|
+
let temp = environmentVariables;
|
|
41
|
+
rawOptKey.forEach((key, i) => {
|
|
42
|
+
if (i < rawOptKey.length - 1) {
|
|
43
|
+
// We haven't reached the final key
|
|
44
|
+
if (!temp[key]) temp[key] = {};
|
|
45
|
+
temp = temp[key];
|
|
46
|
+
} else {
|
|
47
|
+
temp[key] = value;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return environmentVariables;
|
|
52
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { DatasourceOptionSpecSchema } from './datasourcePluginOptions.schema.js';
|
|
3
|
+
import { QueryRunnerSchema } from './results.schema.js';
|
|
4
|
+
|
|
5
|
+
const BaseDatasourceSchema = z.object({
|
|
6
|
+
options: DatasourceOptionSpecSchema,
|
|
7
|
+
testConnection: z
|
|
8
|
+
.function()
|
|
9
|
+
.args(
|
|
10
|
+
z.any({ description: 'Connection Options' }),
|
|
11
|
+
z.string({ description: 'Datasource directory' })
|
|
12
|
+
)
|
|
13
|
+
.returns(z.promise(z.union([z.literal(true), z.object({ reason: z.string() })])))
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const SimpleDatasourceSchema = BaseDatasourceSchema.extend({
|
|
17
|
+
// getRunner
|
|
18
|
+
getRunner: z
|
|
19
|
+
.function()
|
|
20
|
+
.args(
|
|
21
|
+
z.any({ description: 'Connection Options' }),
|
|
22
|
+
z.string({ description: 'Datasource directory' })
|
|
23
|
+
)
|
|
24
|
+
.returns(z.promise(QueryRunnerSchema))
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const AdvancedDatasourceSchema = BaseDatasourceSchema.extend({
|
|
28
|
+
// processSource
|
|
29
|
+
processSource: z.function().returns(
|
|
30
|
+
z.custom((d) => d && typeof d === 'object' && Symbol.asyncIterator in d, {
|
|
31
|
+
message: 'Expected AsyncIterator result'
|
|
32
|
+
})
|
|
33
|
+
)
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
/** @typedef {z.infer<typeof DatasourceSchema>} Datasource */
|
|
37
|
+
export const DatasourceSchema = AdvancedDatasourceSchema.or(SimpleDatasourceSchema);
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** @typedef {string|number|boolean} Primitive */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {Object} IDatasourceOptionSpec
|
|
6
|
+
* @property {string} title
|
|
7
|
+
* @property {'string' | 'multiline' | 'number' | 'boolean' | 'select' | 'file'} type
|
|
8
|
+
* @property {boolean} [secret]
|
|
9
|
+
* @property {boolean} [shown]
|
|
10
|
+
* @property {string} [description]
|
|
11
|
+
* @property {boolean} [virtual]
|
|
12
|
+
* @property {string} [references]
|
|
13
|
+
* @property {boolean} [forceReference]
|
|
14
|
+
* @property {'json' | 'yaml'} [fileFormat]
|
|
15
|
+
* @property {boolean} [nest]
|
|
16
|
+
* @property {string | number | boolean | undefined} [default]
|
|
17
|
+
* @property {Record<string | number | symbol, Record<string, IDatasourceOptionSpec>> | undefined} [children]
|
|
18
|
+
* @property {Array<string | { value: Primitive, label: string}>} [options]
|
|
19
|
+
* @property {boolean} [required]
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const primitive = z.union([z.string(), z.number(), z.boolean()]);
|
|
23
|
+
|
|
24
|
+
/** @type {z.ZodRecord<z.ZodType<string>, z.ZodType<IDatasourceOptionSpec>>} */
|
|
25
|
+
export const DatasourceOptionSpecSchema = z.record(
|
|
26
|
+
z.string(),
|
|
27
|
+
z.object({
|
|
28
|
+
title: z.string({ description: 'Title of the option (UI)' }),
|
|
29
|
+
type: z.enum(['string', 'multiline', 'number', 'boolean', 'select', 'file'], {
|
|
30
|
+
description: 'Control type to show'
|
|
31
|
+
}),
|
|
32
|
+
secret: z.boolean({ description: 'If true, will not be source controlled' }).default(false),
|
|
33
|
+
shown: z
|
|
34
|
+
.boolean({ description: 'Only used for secret values, overrides hiding them by default' })
|
|
35
|
+
.optional(),
|
|
36
|
+
/**
|
|
37
|
+
* Indicates that the field should not actually be persisted. Should be combined with `references`
|
|
38
|
+
*/
|
|
39
|
+
virtual: z
|
|
40
|
+
.boolean({
|
|
41
|
+
description:
|
|
42
|
+
'Indicates that the field is only for form logic, should be combined with references'
|
|
43
|
+
})
|
|
44
|
+
.default(false),
|
|
45
|
+
/**
|
|
46
|
+
* Indicates that the field should get its value from another field if it is available
|
|
47
|
+
*/
|
|
48
|
+
references: z.string().optional(),
|
|
49
|
+
/**
|
|
50
|
+
* Indicates that the field can only get its value from the references
|
|
51
|
+
*/
|
|
52
|
+
forceReference: z.boolean().default(false),
|
|
53
|
+
fileFormat: z.enum(['json', 'yaml']).optional(),
|
|
54
|
+
description: z.string().optional(),
|
|
55
|
+
children: z.lazy(() => z.record(z.string(), DatasourceOptionSpecSchema)).optional(),
|
|
56
|
+
required: z.boolean().default(false),
|
|
57
|
+
options: z
|
|
58
|
+
.union([z.string(), z.object({ value: primitive, label: z.string() })])
|
|
59
|
+
.array()
|
|
60
|
+
.optional(),
|
|
61
|
+
nest: z.boolean().optional(),
|
|
62
|
+
default: primitive.optional()
|
|
63
|
+
})
|
|
64
|
+
);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const ManifestSchema = z.object({
|
|
4
|
+
// TODO: Refactor to tables instead of files
|
|
5
|
+
renderedFiles: z.record(z.array(z.string())),
|
|
6
|
+
locatedFiles: z.record(z.array(z.string())).optional(),
|
|
7
|
+
locatedSchemas: z.array(z.string()).optional()
|
|
8
|
+
});
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// Note that this only validates that the first item in the array
|
|
3
|
+
// is a record with string keys. If the connector returns some
|
|
4
|
+
// inconsistent array (e.g. [{}, 1]), it will not detect the
|
|
5
|
+
// invalid row.
|
|
6
|
+
const QueryResultArraySchema = z.any().refine(
|
|
7
|
+
(data) => {
|
|
8
|
+
// result is not an array, fail
|
|
9
|
+
if (!Array.isArray(data)) return false;
|
|
10
|
+
// result has no rows, we can't validate this
|
|
11
|
+
// but this is a correct result set
|
|
12
|
+
if (data.length === 0) return true;
|
|
13
|
+
return z.record(z.string(), z.any()).safeParse(data[0]).success;
|
|
14
|
+
},
|
|
15
|
+
{ message: 'Data connector returned invalid rows' }
|
|
16
|
+
);
|
|
17
|
+
const QueryResultGeneratorSchema = z.function();
|
|
18
|
+
|
|
19
|
+
const QueryResultMetaSchema = z.object({
|
|
20
|
+
columnTypes: z.array(
|
|
21
|
+
z.object({
|
|
22
|
+
name: z.string(),
|
|
23
|
+
evidenceType: z.enum(['boolean', 'number', 'string', 'date']),
|
|
24
|
+
typeFidelity: z.union([z.literal('precise'), z.literal('inferred')])
|
|
25
|
+
})
|
|
26
|
+
),
|
|
27
|
+
expectedRowCount: z.number().optional()
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const QueryResultDataSchema = QueryResultMetaSchema.extend({
|
|
31
|
+
// Note that this only validates that the first item in the array
|
|
32
|
+
// is a record with string keys. If the connector returns some
|
|
33
|
+
// inconsistent array (e.g. [{}, 1]), it will not detect the
|
|
34
|
+
// invalid row.
|
|
35
|
+
rows: QueryResultArraySchema.or(QueryResultGeneratorSchema)
|
|
36
|
+
})
|
|
37
|
+
.refine(
|
|
38
|
+
(data) => {
|
|
39
|
+
// We can't dig into generator functions
|
|
40
|
+
if (typeof data.rows === 'function') return true;
|
|
41
|
+
|
|
42
|
+
const rows = data.rows;
|
|
43
|
+
|
|
44
|
+
// Validate that all columnTypes appear
|
|
45
|
+
if (rows.length) {
|
|
46
|
+
// Filter to column types where name is not in row
|
|
47
|
+
// Then map columnTypes to their names to make things easier
|
|
48
|
+
// If there are any columns that were not filtered out; provide an error to zod
|
|
49
|
+
const missingColumns = data.columnTypes
|
|
50
|
+
.filter((ct) => !(ct.name in rows[0]))
|
|
51
|
+
.map((ct) => ct.name);
|
|
52
|
+
|
|
53
|
+
if (missingColumns.length) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return true;
|
|
58
|
+
},
|
|
59
|
+
(data) => {
|
|
60
|
+
// We can't dig into generator functions
|
|
61
|
+
if (typeof data.rows === 'function')
|
|
62
|
+
return {
|
|
63
|
+
path: ['columnTypes']
|
|
64
|
+
};
|
|
65
|
+
const rows = data.rows;
|
|
66
|
+
|
|
67
|
+
const missingColumns = data.columnTypes
|
|
68
|
+
.filter((ct) => !(ct.name in rows[0]))
|
|
69
|
+
.map((ct) => ct.name);
|
|
70
|
+
return {
|
|
71
|
+
path: ['columnTypes'],
|
|
72
|
+
message: `Datasource result has columns declared that are missing from results: ${missingColumns.join(
|
|
73
|
+
', '
|
|
74
|
+
)}`
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
.refine(
|
|
79
|
+
(data) => {
|
|
80
|
+
// We can't dig into generator functions
|
|
81
|
+
if (typeof data.rows === 'function') return true;
|
|
82
|
+
|
|
83
|
+
// Validate that all columns in the returned rows have declared column types
|
|
84
|
+
if (data.rows.length) {
|
|
85
|
+
const colNames = data.columnTypes.map((ct) => ct.name);
|
|
86
|
+
const extraColumns = Object.keys(data.rows[0]).filter(
|
|
87
|
+
(rowKey) => !colNames.includes(rowKey)
|
|
88
|
+
);
|
|
89
|
+
if (extraColumns.length) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return true;
|
|
94
|
+
},
|
|
95
|
+
(data) => {
|
|
96
|
+
// We can't dig into generator functions
|
|
97
|
+
if (typeof data.rows === 'function')
|
|
98
|
+
return {
|
|
99
|
+
path: ['rows']
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const colNames = data.columnTypes.map((ct) => ct.name);
|
|
103
|
+
const extraColumns = Object.keys(data.rows[0]).filter((rowKey) => !colNames.includes(rowKey));
|
|
104
|
+
return {
|
|
105
|
+
path: ['rows'],
|
|
106
|
+
message: `First row of results columns not provided in columnTypes: ${extraColumns.join(
|
|
107
|
+
', '
|
|
108
|
+
)}`
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
const QueryResultUrlSchema = QueryResultMetaSchema.extend({
|
|
114
|
+
url: z.string()
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
export const QueryResultSchema = QueryResultUrlSchema.or(QueryResultDataSchema);
|
|
118
|
+
|
|
119
|
+
export const QueryRunnerSchema = z
|
|
120
|
+
.function()
|
|
121
|
+
.args(
|
|
122
|
+
z.string({ description: 'QueryString' }).or(z.null({ description: 'ExceededSizeQueryString' })),
|
|
123
|
+
z.string({ description: 'QueryFilepath' }),
|
|
124
|
+
z.number({ description: 'Batch Size' }).or(z.null())
|
|
125
|
+
)
|
|
126
|
+
.returns(z.promise(QueryResultSchema.or(z.null())).or(QueryResultSchema));
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replaces all ${var} patterns in a string with the matching EVIDENCE_VAR__[var] environment variables
|
|
3
|
+
* @param {string} queryString
|
|
4
|
+
* @returns {string}
|
|
5
|
+
*/
|
|
6
|
+
export const subSourceVariables = (queryString) => {
|
|
7
|
+
const envPrefix = 'EVIDENCE_VAR__';
|
|
8
|
+
|
|
9
|
+
if (queryString.length > 1024 * 1024) {
|
|
10
|
+
if (process.env.VITE_EVIDENCE_DEBUG) {
|
|
11
|
+
console.log(
|
|
12
|
+
`Skipping variable interpolation for file; has more than ${1024 * 1024} characters`
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
return queryString;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const validVars = Object.fromEntries(
|
|
19
|
+
Object.entries(process.env)
|
|
20
|
+
.filter(([k]) => k.startsWith(envPrefix))
|
|
21
|
+
.map(([k, v]) => {
|
|
22
|
+
const name = k.substring(envPrefix.length);
|
|
23
|
+
const value = v?.toString();
|
|
24
|
+
return [name, value];
|
|
25
|
+
})
|
|
26
|
+
);
|
|
27
|
+
let output = queryString;
|
|
28
|
+
// This regex is prefixed with a negative lookbehind to disqualify $${var} patterns
|
|
29
|
+
const regex = RegExp(/(?<!\$)\$\{(.+?)\}/, 'g');
|
|
30
|
+
|
|
31
|
+
let match;
|
|
32
|
+
while ((match = regex.exec(output)) !== null) {
|
|
33
|
+
const fullMatch = match[0]; // e.g. ${variable}
|
|
34
|
+
const varName = match[1]; // e.g. variable
|
|
35
|
+
const start = match.index;
|
|
36
|
+
const end = match[0].length + start;
|
|
37
|
+
|
|
38
|
+
if (varName in validVars && validVars[varName]) {
|
|
39
|
+
const value = validVars[varName];
|
|
40
|
+
if (!value) throw new Error('Value somehow became undefined');
|
|
41
|
+
const before = output.substring(0, start);
|
|
42
|
+
const after = output.substring(end);
|
|
43
|
+
output = `${before}${value}${after}`;
|
|
44
|
+
// Update the lastIndex of the regular expression to continue the search from the end of the replacement
|
|
45
|
+
regex.lastIndex = start + value.length;
|
|
46
|
+
} else
|
|
47
|
+
console.warn(
|
|
48
|
+
`Missed substition for ${fullMatch}, do you need to set EVIDENCE_VAR__${varName}?`
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
output = output.replaceAll('$${', '${');
|
|
53
|
+
|
|
54
|
+
return output;
|
|
55
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { beforeEach, it, expect, describe, vi } from 'vitest';
|
|
2
|
+
import { subSourceVariables } from './sub-source-vars';
|
|
3
|
+
|
|
4
|
+
describe('subSourceVars', () => {
|
|
5
|
+
beforeEach(() => {
|
|
6
|
+
vi.unstubAllEnvs();
|
|
7
|
+
});
|
|
8
|
+
it('should leave queries without any variables untouched', () => {
|
|
9
|
+
expect(subSourceVariables('Hi!')).toEqual('Hi!');
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('should replace variables that are found in the environment', () => {
|
|
13
|
+
vi.stubEnv('EVIDENCE_VAR__test', 'var-val');
|
|
14
|
+
expect(subSourceVariables('${test}')).toEqual('var-val');
|
|
15
|
+
});
|
|
16
|
+
it('should replace the same variables that are found in multiple places', () => {
|
|
17
|
+
vi.stubEnv('EVIDENCE_VAR__test', 'var-val');
|
|
18
|
+
|
|
19
|
+
expect(subSourceVariables('${test}\n${test}')).toEqual('var-val\nvar-val');
|
|
20
|
+
});
|
|
21
|
+
it('should replace $${ with ${ but not sub the variable', () => {
|
|
22
|
+
vi.stubEnv('EVIDENCE_VAR__test', 'var-val');
|
|
23
|
+
expect(subSourceVariables('$${test}\n${test}')).toEqual('${test}\nvar-val');
|
|
24
|
+
});
|
|
25
|
+
it('should replace different variables that are found in multiple places', () => {
|
|
26
|
+
vi.stubEnv('EVIDENCE_VAR__var_a', 'abc');
|
|
27
|
+
vi.stubEnv('EVIDENCE_VAR__var_b', 'def');
|
|
28
|
+
expect(subSourceVariables('|${var_a}|${var_b}|')).toEqual('|abc|def|');
|
|
29
|
+
});
|
|
30
|
+
it('should convert 3 different variables', () => {
|
|
31
|
+
vi.stubEnv('EVIDENCE_VAR__test', 'var-val');
|
|
32
|
+
vi.stubEnv('EVIDENCE_VAR__test2', 'var-val2');
|
|
33
|
+
vi.stubEnv('EVIDENCE_VAR__test3', 'var-val3');
|
|
34
|
+
expect(subSourceVariables('|${test}|${test2}|${test3}|')).toEqual(
|
|
35
|
+
'|var-val|var-val2|var-val3|'
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
it('should convert 2 different variables and fail 1', () => {
|
|
39
|
+
vi.stubEnv('EVIDENCE_VAR__test', 'var-val');
|
|
40
|
+
vi.stubEnv('EVIDENCE_VAR__test2', 'var-val2');
|
|
41
|
+
vi.stubEnv('EVIDENCE_VAR__test3', 'var-val3');
|
|
42
|
+
expect(subSourceVariables('${test}\n${testZ}\n${test3}')).toEqual(
|
|
43
|
+
'var-val\n${testZ}\nvar-val3'
|
|
44
|
+
);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ManifestSchema } from './schemas/manifest.schema.js';
|
|
3
|
+
import { EvidenceError } from '../../lib/EvidenceError.js';
|
|
4
|
+
|
|
5
|
+
type FileContent = () => Promise<string>;
|
|
6
|
+
|
|
7
|
+
type QueryResultMeta = {
|
|
8
|
+
columnTypes: {
|
|
9
|
+
name: string;
|
|
10
|
+
evidenceType: 'string' | 'number' | 'boolean' | 'date';
|
|
11
|
+
typeFidelity: 'precise' | 'inferred';
|
|
12
|
+
}[];
|
|
13
|
+
expectedRowCount?: number | undefined;
|
|
14
|
+
};
|
|
15
|
+
type QueryResultData<T extends Record<string, unknown>[] = Record<string, unknown>[]> = {
|
|
16
|
+
rows?: T;
|
|
17
|
+
} & QueryResultMeta;
|
|
18
|
+
|
|
19
|
+
type QueryResultUrl = {
|
|
20
|
+
url: string;
|
|
21
|
+
} & QueryResultMeta;
|
|
22
|
+
|
|
23
|
+
export type QueryResult<T extends Record<string, unknown[]>> = QueryResultData<T> | QueryResultUrl;
|
|
24
|
+
|
|
25
|
+
export type QueryResultTable<T extends Record<string, unknown>[] = Record<string, unknown>[]> =
|
|
26
|
+
QueryResult<T> & { name: string; content: string };
|
|
27
|
+
|
|
28
|
+
export interface SourceDirectory {
|
|
29
|
+
[filename: string]: SourceDirectory | FileContent;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type SourceUtils = {
|
|
33
|
+
isCached: (name: string, content: string) => boolean;
|
|
34
|
+
isFiltered: (name: string) => boolean;
|
|
35
|
+
shouldRun: (name: string, content: string) => boolean;
|
|
36
|
+
addToCache: (name: string, content: string) => void;
|
|
37
|
+
subSourceVariables: (query: string) => string;
|
|
38
|
+
escape: (tableName: string, tableContent: string) => QueryResultTable;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type ProcessSourceFn<T extends Record<string, unknown> = Record<string, unknown>> = (
|
|
42
|
+
opts: T,
|
|
43
|
+
files: SourceDirectory,
|
|
44
|
+
utils: SourceUtils
|
|
45
|
+
) => AsyncIterable<QueryResultTable | EvidenceError>;
|
|
46
|
+
|
|
47
|
+
export type Manifest = z.infer<typeof ManifestSchema>;
|
|
48
|
+
|
|
49
|
+
export type SourceFilters = {
|
|
50
|
+
sources: Set<string> | null;
|
|
51
|
+
queries: Set<string> | null;
|
|
52
|
+
only_changed: boolean;
|
|
53
|
+
};
|