bkper 4.31.3 → 5.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/README.md +12 -5
- package/lib/agent/startup-maintenance.d.ts +7 -4
- package/lib/agent/startup-maintenance.d.ts.map +1 -1
- package/lib/agent/startup-maintenance.js +13 -29
- package/lib/agent/startup-maintenance.js.map +1 -1
- package/lib/cli.js +8 -4
- package/lib/cli.js.map +1 -1
- package/lib/commands/accounts/batch-create.d.ts +1 -1
- package/lib/commands/accounts/batch-create.d.ts.map +1 -1
- package/lib/commands/accounts/batch-create.js +3 -3
- package/lib/commands/accounts/batch-create.js.map +1 -1
- package/lib/commands/accounts/list.d.ts +2 -3
- package/lib/commands/accounts/list.d.ts.map +1 -1
- package/lib/commands/accounts/list.js +2 -12
- package/lib/commands/accounts/list.js.map +1 -1
- package/lib/commands/accounts/register.js +13 -13
- package/lib/commands/accounts/register.js.map +1 -1
- package/lib/commands/action.d.ts +2 -3
- package/lib/commands/action.d.ts.map +1 -1
- package/lib/commands/action.js +2 -3
- package/lib/commands/action.js.map +1 -1
- package/lib/commands/apps/list.d.ts +2 -3
- package/lib/commands/apps/list.d.ts.map +1 -1
- package/lib/commands/apps/list.js +2 -14
- package/lib/commands/apps/list.js.map +1 -1
- package/lib/commands/apps/register.js +10 -10
- package/lib/commands/apps/register.js.map +1 -1
- package/lib/commands/balances/list.d.ts +0 -2
- package/lib/commands/balances/list.d.ts.map +1 -1
- package/lib/commands/balances/list.js +9 -17
- package/lib/commands/balances/list.js.map +1 -1
- package/lib/commands/balances/register.d.ts.map +1 -1
- package/lib/commands/balances/register.js +3 -4
- package/lib/commands/balances/register.js.map +1 -1
- package/lib/commands/books/list.d.ts +2 -4
- package/lib/commands/books/list.d.ts.map +1 -1
- package/lib/commands/books/list.js +2 -30
- package/lib/commands/books/list.js.map +1 -1
- package/lib/commands/books/register.js +12 -12
- package/lib/commands/books/register.js.map +1 -1
- package/lib/commands/cli-helpers.d.ts +9 -4
- package/lib/commands/cli-helpers.d.ts.map +1 -1
- package/lib/commands/cli-helpers.js +18 -12
- package/lib/commands/cli-helpers.js.map +1 -1
- package/lib/commands/collections/list.d.ts +2 -3
- package/lib/commands/collections/list.d.ts.map +1 -1
- package/lib/commands/collections/list.js +2 -14
- package/lib/commands/collections/list.js.map +1 -1
- package/lib/commands/collections/register.d.ts.map +1 -1
- package/lib/commands/collections/register.js +15 -25
- package/lib/commands/collections/register.js.map +1 -1
- package/lib/commands/events/event-json.d.ts +13 -0
- package/lib/commands/events/event-json.d.ts.map +1 -0
- package/lib/commands/events/event-json.js +33 -0
- package/lib/commands/events/event-json.js.map +1 -0
- package/lib/commands/events/list.d.ts +4 -3
- package/lib/commands/events/list.d.ts.map +1 -1
- package/lib/commands/events/list.js +15 -66
- package/lib/commands/events/list.js.map +1 -1
- package/lib/commands/events/register.d.ts.map +1 -1
- package/lib/commands/events/register.js +7 -6
- package/lib/commands/events/register.js.map +1 -1
- package/lib/commands/files/list.d.ts +3 -2
- package/lib/commands/files/list.d.ts.map +1 -1
- package/lib/commands/files/list.js +13 -42
- package/lib/commands/files/list.js.map +1 -1
- package/lib/commands/files/register.d.ts.map +1 -1
- package/lib/commands/files/register.js +13 -10
- package/lib/commands/files/register.js.map +1 -1
- package/lib/commands/groups/list.d.ts +2 -3
- package/lib/commands/groups/list.d.ts.map +1 -1
- package/lib/commands/groups/list.js +2 -12
- package/lib/commands/groups/list.js.map +1 -1
- package/lib/commands/groups/register.js +12 -12
- package/lib/commands/groups/register.js.map +1 -1
- package/lib/commands/transactions/batch-create.d.ts +1 -1
- package/lib/commands/transactions/batch-create.d.ts.map +1 -1
- package/lib/commands/transactions/batch-create.js +4 -3
- package/lib/commands/transactions/batch-create.js.map +1 -1
- package/lib/commands/transactions/batch-update.d.ts +1 -1
- package/lib/commands/transactions/batch-update.d.ts.map +1 -1
- package/lib/commands/transactions/batch-update.js +4 -3
- package/lib/commands/transactions/batch-update.js.map +1 -1
- package/lib/commands/transactions/list.d.ts +4 -7
- package/lib/commands/transactions/list.d.ts.map +1 -1
- package/lib/commands/transactions/list.js +15 -32
- package/lib/commands/transactions/list.js.map +1 -1
- package/lib/commands/transactions/register.d.ts +1 -1
- package/lib/commands/transactions/register.d.ts.map +1 -1
- package/lib/commands/transactions/register.js +27 -26
- package/lib/commands/transactions/register.js.map +1 -1
- package/lib/commands/transactions/transaction-json.d.ts +23 -0
- package/lib/commands/transactions/transaction-json.d.ts.map +1 -0
- package/lib/commands/transactions/transaction-json.js +56 -0
- package/lib/commands/transactions/transaction-json.js.map +1 -0
- package/lib/commands/upgrade.d.ts.map +1 -1
- package/lib/commands/upgrade.js +2 -3
- package/lib/commands/upgrade.js.map +1 -1
- package/lib/docs/apps/ai.md +2 -2
- package/lib/docs/apps/event-handlers.md +12 -0
- package/lib/docs/cli/app-management.md +1 -1
- package/lib/docs/cli/data-management.md +56 -54
- package/lib/docs/index.md +1 -1
- package/lib/docs/sdk/bkper-api-types.md +4 -2
- package/lib/docs/sdk/bkper-js.md +1 -0
- package/lib/docs-compliance/live-readme.d.ts.map +1 -1
- package/lib/docs-compliance/live-readme.js +0 -3
- package/lib/docs-compliance/live-readme.js.map +1 -1
- package/lib/docs-compliance/rules.d.ts.map +1 -1
- package/lib/docs-compliance/rules.js +9 -0
- package/lib/docs-compliance/rules.js.map +1 -1
- package/lib/render/index.d.ts +2 -4
- package/lib/render/index.d.ts.map +1 -1
- package/lib/render/index.js +1 -3
- package/lib/render/index.js.map +1 -1
- package/lib/render/output.d.ts +42 -22
- package/lib/render/output.d.ts.map +1 -1
- package/lib/render/output.js +62 -42
- package/lib/render/output.js.map +1 -1
- package/lib/upgrade/index.d.ts +5 -4
- package/lib/upgrade/index.d.ts.map +1 -1
- package/lib/upgrade/index.js +3 -2
- package/lib/upgrade/index.js.map +1 -1
- package/lib/upgrade/installation.d.ts +54 -20
- package/lib/upgrade/installation.d.ts.map +1 -1
- package/lib/upgrade/installation.js +222 -122
- package/lib/upgrade/installation.js.map +1 -1
- package/lib/upgrade/update-check.d.ts +69 -0
- package/lib/upgrade/update-check.d.ts.map +1 -0
- package/lib/upgrade/update-check.js +253 -0
- package/lib/upgrade/update-check.js.map +1 -0
- package/lib/upgrade/update-worker.d.ts +2 -0
- package/lib/upgrade/update-worker.d.ts.map +1 -0
- package/lib/upgrade/update-worker.js +6 -0
- package/lib/upgrade/update-worker.js.map +1 -0
- package/lib/upgrade/upgrade.d.ts +11 -28
- package/lib/upgrade/upgrade.d.ts.map +1 -1
- package/lib/upgrade/upgrade.js +49 -96
- package/lib/upgrade/upgrade.js.map +1 -1
- package/package.json +1 -1
- package/lib/render/csv-formatter.d.ts +0 -15
- package/lib/render/csv-formatter.d.ts.map +0 -1
- package/lib/render/csv-formatter.js +0 -37
- package/lib/render/csv-formatter.js.map +0 -1
- package/lib/render/table-formatter.d.ts +0 -34
- package/lib/render/table-formatter.d.ts.map +0 -1
- package/lib/render/table-formatter.js +0 -239
- package/lib/render/table-formatter.js.map +0 -1
package/lib/render/output.js
CHANGED
|
@@ -1,54 +1,74 @@
|
|
|
1
|
-
import { formatTable, formatItem } from './table-formatter.js';
|
|
2
|
-
import { formatCsv } from './csv-formatter.js';
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
2
|
+
* JSON-only output rendering.
|
|
3
|
+
*
|
|
4
|
+
* Contract:
|
|
5
|
+
* - stdout carries only the JSON result, so it is always parseable (e.g. by jq).
|
|
6
|
+
* - Lists use a stable `{"items":[...]}` envelope, adding `"cursor"` only when a
|
|
7
|
+
* next page exists. Each record is compact on its own line.
|
|
8
|
+
* - Matrices (balance reports) are bare 2D arrays with one row per line.
|
|
9
|
+
* - Single items are pretty-printed only on an interactive terminal.
|
|
10
|
+
* - Hints, notices, and warnings go to stderr.
|
|
5
11
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
renderTable(result.matrix, format);
|
|
13
|
-
if (result.footer && format === 'table') {
|
|
14
|
-
console.log(result.footer);
|
|
15
|
-
}
|
|
12
|
+
/**
|
|
13
|
+
* Serializes lines as a JSON array body with one entry per line.
|
|
14
|
+
*/
|
|
15
|
+
function formatLines(lines) {
|
|
16
|
+
return lines.length > 0 ? `[\n${lines.join(',\n')}\n]` : '[]';
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
18
|
-
*
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
19
|
+
* Formats list items in the `{"items":[...]}` envelope, one record per line.
|
|
20
|
+
*/
|
|
21
|
+
export function formatList(items, cursor) {
|
|
22
|
+
const body = formatLines(items.map(item => JSON.stringify(item)));
|
|
23
|
+
const cursorPart = cursor !== undefined ? `,"cursor":${JSON.stringify(cursor)}` : '';
|
|
24
|
+
return `{"items":${body}${cursorPart}}`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Formats a 2D matrix as JSON, one row per line.
|
|
28
|
+
*/
|
|
29
|
+
export function formatMatrix(matrix) {
|
|
30
|
+
return formatLines(matrix.map(row => JSON.stringify(row)));
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Formats a single item as pretty (2-space) or compact JSON.
|
|
34
|
+
*/
|
|
35
|
+
export function formatItem(item, pretty) {
|
|
36
|
+
return pretty ? JSON.stringify(item, null, 2) : JSON.stringify(item);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Whether stdout is an interactive terminal (a human is reading).
|
|
40
|
+
*/
|
|
41
|
+
export function isInteractiveOutput() {
|
|
42
|
+
return process.stdout.isTTY === true;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Renders a list result: JSON to stdout, hint to stderr.
|
|
46
|
+
*/
|
|
47
|
+
export function renderList(result) {
|
|
48
|
+
console.log(formatList(result.items, result.cursor));
|
|
49
|
+
if (result.hint) {
|
|
50
|
+
console.error(result.hint);
|
|
37
51
|
}
|
|
38
52
|
}
|
|
39
53
|
/**
|
|
40
|
-
* Renders a
|
|
41
|
-
|
|
54
|
+
* Renders a 2D matrix as JSON to stdout.
|
|
55
|
+
*/
|
|
56
|
+
export function renderMatrix(matrix) {
|
|
57
|
+
console.log(formatMatrix(matrix));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Renders a single item as JSON to stdout.
|
|
42
61
|
*
|
|
43
62
|
* @param item - Record to render
|
|
44
|
-
* @param
|
|
63
|
+
* @param pretty - Pretty-print; defaults to true only on an interactive terminal
|
|
45
64
|
*/
|
|
46
|
-
export function renderItem(item,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
65
|
+
export function renderItem(item, pretty = isInteractiveOutput()) {
|
|
66
|
+
console.log(formatItem(item, pretty));
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Renders a human-readable notice (e.g. success without a result) to stderr.
|
|
70
|
+
*/
|
|
71
|
+
export function renderNotice(message) {
|
|
72
|
+
console.error(message);
|
|
53
73
|
}
|
|
54
74
|
//# sourceMappingURL=output.js.map
|
package/lib/render/output.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/render/output.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/render/output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAaH;;GAEG;AACH,SAAS,WAAW,CAAC,KAAe;IAChC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,C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AC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,MAAmB;IAC5C,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;AACtC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,MAAM,GAAG,mBAAmB,EAAE;IACnE,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,OAAe;IACxC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC3B,CAAC"}
|
package/lib/upgrade/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
4
|
-
export type {
|
|
1
|
+
export { PACKAGE_DIR, VERSION, detectInstallMethod, fetchLatestVersion, getInstallCommand, getSelfUpdatePlan, } from './installation.js';
|
|
2
|
+
export { foregroundUpgrade, isNewerVersion, runUpgrade } from './upgrade.js';
|
|
3
|
+
export { formatUpdateNotice, getUpdateNotice, isUpdateCheckDisabled, maybeStartUpdateCheck, readUpdateState, runCommandUpdateCheck, } from './update-check.js';
|
|
4
|
+
export type { InstallMethod, SelfUpdatePlan } from './installation.js';
|
|
5
|
+
export type { UpdateNotice } from './update-check.js';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/upgrade/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,OAAO,EACP,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/upgrade/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,WAAW,EACX,OAAO,EACP,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EACH,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,qBAAqB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACvE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
package/lib/upgrade/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { PACKAGE_DIR, VERSION, detectInstallMethod, fetchLatestVersion, getInstallCommand, getSelfUpdatePlan, } from './installation.js';
|
|
2
|
+
export { foregroundUpgrade, isNewerVersion, runUpgrade } from './upgrade.js';
|
|
3
|
+
export { formatUpdateNotice, getUpdateNotice, isUpdateCheckDisabled, maybeStartUpdateCheck, readUpdateState, runCommandUpdateCheck, } from './update-check.js';
|
|
3
4
|
//# sourceMappingURL=index.js.map
|
package/lib/upgrade/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/upgrade/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,OAAO,EACP,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/upgrade/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,WAAW,EACX,OAAO,EACP,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EACH,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,qBAAqB,GACxB,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,38 +1,72 @@
|
|
|
1
1
|
/** Current installed version of the CLI. */
|
|
2
2
|
export declare const VERSION: string;
|
|
3
|
+
/** Directory of the running bkper package (the folder holding its package.json). */
|
|
4
|
+
export declare const PACKAGE_DIR: string;
|
|
3
5
|
/** Supported installation methods. */
|
|
4
|
-
export type InstallMethod = 'npm' | '
|
|
5
|
-
|
|
6
|
-
export
|
|
6
|
+
export type InstallMethod = 'npm' | 'pnpm' | 'yarn' | 'bun' | 'unknown';
|
|
7
|
+
/** Where the running CLI lives and how it was started. */
|
|
8
|
+
export interface RuntimeLocation {
|
|
9
|
+
packageDir: string;
|
|
10
|
+
/** process.argv[1], not symlink-resolved. */
|
|
11
|
+
entrypoint?: string;
|
|
12
|
+
execPath: string;
|
|
13
|
+
isBunRuntime: boolean;
|
|
14
|
+
platform: NodeJS.Platform;
|
|
15
|
+
}
|
|
16
|
+
/** Side effects needed to decide whether the running copy can upgrade itself. */
|
|
17
|
+
export interface SelfUpdateEnvironment {
|
|
18
|
+
homedir: string;
|
|
19
|
+
readCommandOutput: (command: string) => string | undefined;
|
|
20
|
+
isWritable: (dir: string) => boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface InstallPlan {
|
|
23
|
+
kind: 'install';
|
|
24
|
+
method: InstallMethod;
|
|
25
|
+
packageDir: string;
|
|
26
|
+
command: string;
|
|
27
|
+
/** package.json to read after installing, reached through the global root. */
|
|
28
|
+
packageJsonPath: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ManualPlan {
|
|
31
|
+
kind: 'manual';
|
|
32
|
+
method: InstallMethod;
|
|
33
|
+
packageDir: string;
|
|
34
|
+
instruction: string;
|
|
35
|
+
}
|
|
36
|
+
export type SelfUpdatePlan = InstallPlan | ManualPlan;
|
|
37
|
+
export declare function getRuntimeLocation(): RuntimeLocation;
|
|
7
38
|
/**
|
|
8
|
-
* Detects
|
|
9
|
-
*
|
|
39
|
+
* Detects the package manager from the location of the running code
|
|
40
|
+
* (same rules as Pi's detectInstallMethod).
|
|
10
41
|
*/
|
|
11
|
-
export declare function
|
|
42
|
+
export declare function detectInstallMethod(location?: RuntimeLocation): InstallMethod;
|
|
12
43
|
/**
|
|
13
|
-
*
|
|
44
|
+
* Infers the npm prefix from a `<prefix>/lib/node_modules/bkper` layout.
|
|
45
|
+
* Windows prefixes look like project installs, so they are never inferred.
|
|
14
46
|
*/
|
|
15
|
-
export declare function
|
|
47
|
+
export declare function inferNpmPrefix(packageDir: string, platform: NodeJS.Platform): string | undefined;
|
|
16
48
|
/**
|
|
17
|
-
*
|
|
49
|
+
* Returns the shell command that installs a version with a package manager.
|
|
18
50
|
*/
|
|
19
|
-
export declare function
|
|
51
|
+
export declare function getInstallCommand(method: InstallMethod, version: string, npmPrefix?: string): string | null;
|
|
20
52
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
53
|
+
* Decides whether the running copy can safely upgrade itself: it must be
|
|
54
|
+
* inside its package manager's global root and writable. Otherwise returns
|
|
55
|
+
* the manual instruction to show. Never suggests sudo.
|
|
23
56
|
*/
|
|
24
|
-
export declare function
|
|
57
|
+
export declare function getSelfUpdatePlan(version: string, location?: RuntimeLocation, environment?: SelfUpdateEnvironment): SelfUpdatePlan;
|
|
25
58
|
/**
|
|
26
|
-
*
|
|
59
|
+
* Reads a package version from disk, bypassing the module cache.
|
|
27
60
|
*/
|
|
28
|
-
export declare function
|
|
61
|
+
export declare function readInstalledVersion(packageJsonPath: string): string | undefined;
|
|
29
62
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
63
|
+
* Runs an install command synchronously. BKPER_AUTOUPDATE_COMMAND replaces
|
|
64
|
+
* the command (for tests) but never the safety checks that lead here.
|
|
32
65
|
*/
|
|
33
|
-
export declare function
|
|
66
|
+
export declare function runInstallCommand(command: string): void;
|
|
34
67
|
/**
|
|
35
|
-
*
|
|
68
|
+
* Fetches the latest published version from the npm registry.
|
|
69
|
+
* Returns null if the fetch fails.
|
|
36
70
|
*/
|
|
37
|
-
export declare function
|
|
71
|
+
export declare function fetchLatestVersion(timeoutMs?: number): Promise<string | null>;
|
|
38
72
|
//# sourceMappingURL=installation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../src/upgrade/installation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../src/upgrade/installation.ts"],"names":[],"mappings":"AAUA,4CAA4C;AAC5C,eAAO,MAAM,OAAO,EAAE,MAAoB,CAAC;AAK3C,oFAAoF;AACpF,eAAO,MAAM,WAAW,EAAE,MAGzB,CAAC;AAEF,sCAAsC;AACtC,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC;AAExE,0DAA0D;AAC1D,MAAM,WAAW,eAAe;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;CAC7B;AAED,iFAAiF;AACjF,MAAM,WAAW,qBAAqB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAC3D,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CACxC;AAED,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,aAAa,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,8EAA8E;IAC9E,eAAe,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,aAAa,CAAC;IACtB,UAAU,EAAE,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