@bluestep-systems/b6p-core 0.4.0 → 0.6.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 +29 -13
- package/dist/B6PCore.d.ts +38 -80
- package/dist/B6PCore.js +52 -385
- package/dist/B6PCore.js.map +1 -1
- package/dist/B6PUri.d.ts +147 -7
- package/dist/B6PUri.js +190 -12
- package/dist/B6PUri.js.map +1 -1
- package/dist/Err.js.map +1 -1
- package/dist/PlatformContext.d.ts +33 -0
- package/dist/PlatformContext.js +3 -0
- package/dist/PlatformContext.js.map +1 -0
- package/dist/auth/BearerAuthProvider.d.ts +64 -0
- package/dist/auth/BearerAuthProvider.js +148 -0
- package/dist/auth/BearerAuthProvider.js.map +1 -0
- package/dist/cache/OrgCache.d.ts +64 -7
- package/dist/cache/OrgCache.js +142 -23
- package/dist/cache/OrgCache.js.map +1 -1
- package/dist/cache/ScriptMetaDataStore.d.ts +2 -2
- package/dist/cache/ScriptMetaDataStore.js.map +1 -1
- package/dist/constants/ApiEndpoints.js.map +1 -1
- package/dist/constants/AuthTypes.d.ts +0 -1
- package/dist/constants/AuthTypes.js +0 -1
- package/dist/constants/AuthTypes.js.map +1 -1
- package/dist/constants/BlueHQ.js.map +1 -1
- package/dist/constants/CryptoAlgorithms.js.map +1 -1
- package/dist/constants/ExtensionConfig.js.map +1 -1
- package/dist/constants/FileExtensions.js.map +1 -1
- package/dist/constants/FolderNames.js.map +1 -1
- package/dist/constants/GitHubUrls.js.map +1 -1
- package/dist/constants/Http.js.map +1 -1
- package/dist/constants/MimeTypes.js.map +1 -1
- package/dist/constants/Numerical.js.map +1 -1
- package/dist/constants/OutputChannels.js.map +1 -1
- package/dist/constants/SettingsKeys.js.map +1 -1
- package/dist/constants/SpecialFiles.js.map +1 -1
- package/dist/constants/WebDAVElements.js.map +1 -1
- package/dist/data/DownstairsPathParser.js.map +1 -1
- package/dist/data/GlobMatcher.js.map +1 -1
- package/dist/data/IdUtility.d.ts +2 -2
- package/dist/data/IdUtility.js.map +1 -1
- package/dist/data/OrgWorker.js.map +1 -1
- package/dist/data/ScriptKey.js.map +1 -1
- package/dist/data/ScriptUrlParser.d.ts +4 -3
- package/dist/data/ScriptUrlParser.js +2 -1
- package/dist/data/ScriptUrlParser.js.map +1 -1
- package/dist/index.d.ts +9 -5
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/dist/network/HttpClient.js.map +1 -1
- package/dist/network/HttpClientProvider.js.map +1 -1
- package/dist/network/StatusCodes.js.map +1 -1
- package/dist/persistence/PersistablePseudoMap.d.ts +4 -4
- package/dist/persistence/PersistablePseudoMap.js +1 -1
- package/dist/persistence/PersistablePseudoMap.js.map +1 -1
- package/dist/persistence/PersistenceKeys.d.ts +0 -4
- package/dist/persistence/PersistenceKeys.js +0 -4
- package/dist/persistence/PersistenceKeys.js.map +1 -1
- package/dist/persistence/PrivatePersistanceMap.d.ts +4 -3
- package/dist/persistence/PrivatePersistanceMap.js +2 -1
- package/dist/persistence/PrivatePersistanceMap.js.map +1 -1
- package/dist/persistence/PseudoMap.js.map +1 -1
- package/dist/persistence/PublicPersistanceMap.d.ts +3 -3
- package/dist/persistence/PublicPersistanceMap.js +1 -1
- package/dist/persistence/PublicPersistanceMap.js.map +1 -1
- package/dist/persistence/Serializable.js.map +1 -1
- package/dist/persistence/SharedFilePersistence.d.ts +3 -3
- package/dist/persistence/SharedFilePersistence.js +1 -1
- package/dist/persistence/SharedFilePersistence.js.map +1 -1
- package/dist/persistence/TypedMap.js.map +1 -1
- package/dist/persistence/TypedPersistable.d.ts +5 -5
- package/dist/persistence/TypedPersistable.js +2 -2
- package/dist/persistence/TypedPersistable.js.map +1 -1
- package/dist/persistence/TypedPrivatePersistable.d.ts +3 -3
- package/dist/persistence/TypedPrivatePersistable.js +1 -1
- package/dist/persistence/TypedPrivatePersistable.js.map +1 -1
- package/dist/persistence/dirLockdown.js.map +1 -1
- package/dist/providers.d.ts +48 -14
- package/dist/script/ScriptContext.d.ts +17 -16
- package/dist/script/ScriptFactory.d.ts +23 -16
- package/dist/script/ScriptFactory.js +23 -44
- package/dist/script/ScriptFactory.js.map +1 -1
- package/dist/script/ScriptFile.d.ts +68 -3
- package/dist/script/ScriptFile.js +103 -10
- package/dist/script/ScriptFile.js.map +1 -1
- package/dist/script/ScriptFolder.d.ts +21 -0
- package/dist/script/ScriptFolder.js +28 -4
- package/dist/script/ScriptFolder.js.map +1 -1
- package/dist/script/ScriptNode.d.ts +15 -0
- package/dist/script/ScriptNode.js +35 -1
- package/dist/script/ScriptNode.js.map +1 -1
- package/dist/script/ScriptRoot.js +10 -6
- package/dist/script/ScriptRoot.js.map +1 -1
- package/dist/script/ScriptService.d.ts +143 -0
- package/dist/script/ScriptService.js +460 -0
- package/dist/script/ScriptService.js.map +1 -0
- package/dist/script/ScriptTranspiler.js.map +1 -1
- package/dist/script/SnapshotHistoryRecorder.d.ts +37 -2
- package/dist/script/SnapshotHistoryRecorder.js +82 -26
- package/dist/script/SnapshotHistoryRecorder.js.map +1 -1
- package/dist/script/TsConfig.js.map +1 -1
- package/dist/script/TsLibResolver.js.map +1 -1
- package/dist/script/push.d.ts +41 -0
- package/dist/{push.js → script/push.js} +23 -13
- package/dist/script/push.js.map +1 -0
- package/dist/session/SessionManager.d.ts +3 -2
- package/dist/session/SessionManager.js.map +1 -1
- package/dist/testing/MockFileSystem.d.ts +16 -3
- package/dist/testing/MockFileSystem.js +65 -42
- package/dist/testing/MockFileSystem.js.map +1 -1
- package/dist/testing/TestableFactory.d.ts +10 -6
- package/dist/types.d.ts +21 -5
- package/dist/update/UpdateService.d.ts +2 -2
- package/dist/update/UpdateService.js.map +1 -1
- package/package.json +12 -14
- package/dist/auth/BasicAuthProvider.d.ts +0 -39
- package/dist/auth/BasicAuthProvider.js +0 -106
- package/dist/auth/BasicAuthProvider.js.map +0 -1
- package/dist/push.d.ts +0 -20
- package/dist/push.js.map +0 -1
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { type PushResult } from "./push";
|
|
2
|
+
import type { ScriptContext } from "./ScriptContext";
|
|
3
|
+
import { ScriptFactory } from "./ScriptFactory";
|
|
4
|
+
/**
|
|
5
|
+
* Result returned by {@link ScriptService.audit}.
|
|
6
|
+
* @lastreviewed null
|
|
7
|
+
*/
|
|
8
|
+
export interface AuditResult {
|
|
9
|
+
changedFiles: string[];
|
|
10
|
+
baseUrl: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Outcome of a pull, for callers that need more signal than the human-facing
|
|
14
|
+
* messages — the pull-side counterpart of `PushResult`. A machine consumer
|
|
15
|
+
* (CLI `--json`, the VS Code LM tool) that only sees "the promise resolved"
|
|
16
|
+
* would otherwise report unqualified success for a pull that deliberately
|
|
17
|
+
* left locally-edited files unsynced.
|
|
18
|
+
* @lastreviewed null
|
|
19
|
+
*/
|
|
20
|
+
export interface PullResult {
|
|
21
|
+
/**
|
|
22
|
+
* Local file paths the divergence guard kept instead of overwriting —
|
|
23
|
+
* files whose content differed from both the platform copy and the recorded
|
|
24
|
+
* last-synced hash. Empty when everything synced.
|
|
25
|
+
* @lastreviewed null
|
|
26
|
+
*/
|
|
27
|
+
keptLocalPaths: string[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Shape of the JSON config file consumed by {@link ScriptService.deploy}.
|
|
31
|
+
* @lastreviewed null
|
|
32
|
+
*/
|
|
33
|
+
export interface DeployConfig {
|
|
34
|
+
/** Local path to the script root whose `draft/` folder is pushed. */
|
|
35
|
+
sourceRootPath: string;
|
|
36
|
+
/** One entry per destination formula URL. */
|
|
37
|
+
targets: Array<{
|
|
38
|
+
url: string;
|
|
39
|
+
snapshot?: boolean;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Every script-management operation: moving a script tree between the local
|
|
44
|
+
* filesystem and the BlueStep platform over WebDAV, and reasoning about the
|
|
45
|
+
* difference between the two.
|
|
46
|
+
*
|
|
47
|
+
* Reached as `B6PCore.script`. It is one subsystem of the SDK, not the whole of
|
|
48
|
+
* it — anything that is not about the script tree belongs beside it in its own
|
|
49
|
+
* service, rather than being added here.
|
|
50
|
+
*
|
|
51
|
+
* Everything it needs arrives through the constructor as a {@link ScriptContext}.
|
|
52
|
+
* It holds no reference to the orchestrator that built it, and this file must not
|
|
53
|
+
* import `B6PCore` — not even `import type` for a JSDoc `{@link}`, which is what
|
|
54
|
+
* previously created a source-level cycle here. Refer to it in plain backticks.
|
|
55
|
+
* @lastreviewed null
|
|
56
|
+
*/
|
|
57
|
+
export declare class ScriptService {
|
|
58
|
+
private readonly ctx;
|
|
59
|
+
private factory;
|
|
60
|
+
constructor(ctx: ScriptContext);
|
|
61
|
+
/**
|
|
62
|
+
* The lazily-created {@link ScriptFactory} bound to this service's context.
|
|
63
|
+
*
|
|
64
|
+
* Script-tree classes should not reach for this — a {@link ScriptRoot} mints its
|
|
65
|
+
* own factory from the context it already holds. It is here for callers that
|
|
66
|
+
* start from a bare path and need to enter the tree.
|
|
67
|
+
* @lastreviewed null
|
|
68
|
+
*/
|
|
69
|
+
getFactory(): ScriptFactory;
|
|
70
|
+
/**
|
|
71
|
+
* Create a {@link ScriptUrlParser} wired to this service's session and logger.
|
|
72
|
+
* @lastreviewed null
|
|
73
|
+
*/
|
|
74
|
+
private createParser;
|
|
75
|
+
/**
|
|
76
|
+
* Derive the base WebDAV URL from a local file path by parsing the
|
|
77
|
+
* downstairs path structure and looking up stored metadata.
|
|
78
|
+
* @lastreviewed null
|
|
79
|
+
*/
|
|
80
|
+
private deriveBaseUrl;
|
|
81
|
+
/**
|
|
82
|
+
* Derive the workspace folder (parent of the org folder) from a file path
|
|
83
|
+
* inside a script root. Returns null if the path can't be parsed.
|
|
84
|
+
* @lastreviewed null
|
|
85
|
+
*/
|
|
86
|
+
deriveWorkspacePath(filePath: string): string | null;
|
|
87
|
+
push(opts: {
|
|
88
|
+
targetUrl?: string;
|
|
89
|
+
rootPath: string;
|
|
90
|
+
snapshot?: boolean;
|
|
91
|
+
message?: string;
|
|
92
|
+
}): Promise<PushResult | null>;
|
|
93
|
+
pushCurrent(opts: {
|
|
94
|
+
filePath: string;
|
|
95
|
+
snapshot?: boolean;
|
|
96
|
+
message?: string;
|
|
97
|
+
}): Promise<PushResult | null>;
|
|
98
|
+
/**
|
|
99
|
+
* Pull a script tree from the platform into the workspace.
|
|
100
|
+
*
|
|
101
|
+
* @param opts.overwriteLocalPaths `downstairsPath` entries (as returned by the
|
|
102
|
+
* fetch walk and listed by {@link audit}) for which the platform copy may
|
|
103
|
+
* overwrite even a locally-edited file. Scoped per file — never the whole
|
|
104
|
+
* tree — so a confirmation shown to the user covers exactly the files that
|
|
105
|
+
* can be force-overwritten and nothing more.
|
|
106
|
+
* @returns The kept-files outcome, or `null` when the pull aborted before
|
|
107
|
+
* fetching (no URL, unreadable listing, or the wrong-directory guard).
|
|
108
|
+
* @lastreviewed null
|
|
109
|
+
*/
|
|
110
|
+
pull(opts: {
|
|
111
|
+
formulaUrl?: string;
|
|
112
|
+
workspacePath: string;
|
|
113
|
+
overwriteLocalPaths?: string[];
|
|
114
|
+
}): Promise<PullResult | null>;
|
|
115
|
+
pullCurrent(opts: {
|
|
116
|
+
filePath: string;
|
|
117
|
+
workspacePath: string;
|
|
118
|
+
}): Promise<PullResult | null>;
|
|
119
|
+
audit(opts: {
|
|
120
|
+
filePath: string;
|
|
121
|
+
workspacePath: string;
|
|
122
|
+
}): Promise<AuditResult | null>;
|
|
123
|
+
private auditWithUrl;
|
|
124
|
+
auditPull(opts: {
|
|
125
|
+
filePath: string;
|
|
126
|
+
workspacePath: string;
|
|
127
|
+
}): Promise<void>;
|
|
128
|
+
deploy(opts: {
|
|
129
|
+
configPath: string;
|
|
130
|
+
}): Promise<void>;
|
|
131
|
+
/**
|
|
132
|
+
* Builds the web-UI setup URL for a locally-pulled script, resolving its
|
|
133
|
+
* stored metadata (org, classid, seqnum) from the {@link ScriptMetaDataStore}
|
|
134
|
+
* the same way `audit` and `push` do.
|
|
135
|
+
* @param opts.filePath Absolute path to any file inside the pulled script root.
|
|
136
|
+
* @returns The setup URL, or `null` if no metadata is stored for the script
|
|
137
|
+
* (not yet pulled) or its script type has no known setup page.
|
|
138
|
+
* @lastreviewed null
|
|
139
|
+
*/
|
|
140
|
+
getSetupUrl(opts: {
|
|
141
|
+
filePath: string;
|
|
142
|
+
}): Promise<string | null>;
|
|
143
|
+
}
|
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.ScriptService = void 0;
|
|
37
|
+
const path = __importStar(require("path"));
|
|
38
|
+
const B6PUri_1 = require("../B6PUri");
|
|
39
|
+
const DownstairsPathParser_1 = require("../data/DownstairsPathParser");
|
|
40
|
+
const ScriptUrlParser_1 = require("../data/ScriptUrlParser");
|
|
41
|
+
const push_1 = require("./push");
|
|
42
|
+
const ScriptFactory_1 = require("./ScriptFactory");
|
|
43
|
+
/**
|
|
44
|
+
* Every script-management operation: moving a script tree between the local
|
|
45
|
+
* filesystem and the BlueStep platform over WebDAV, and reasoning about the
|
|
46
|
+
* difference between the two.
|
|
47
|
+
*
|
|
48
|
+
* Reached as `B6PCore.script`. It is one subsystem of the SDK, not the whole of
|
|
49
|
+
* it — anything that is not about the script tree belongs beside it in its own
|
|
50
|
+
* service, rather than being added here.
|
|
51
|
+
*
|
|
52
|
+
* Everything it needs arrives through the constructor as a {@link ScriptContext}.
|
|
53
|
+
* It holds no reference to the orchestrator that built it, and this file must not
|
|
54
|
+
* import `B6PCore` — not even `import type` for a JSDoc `{@link}`, which is what
|
|
55
|
+
* previously created a source-level cycle here. Refer to it in plain backticks.
|
|
56
|
+
* @lastreviewed null
|
|
57
|
+
*/
|
|
58
|
+
class ScriptService {
|
|
59
|
+
ctx;
|
|
60
|
+
factory = null;
|
|
61
|
+
constructor(ctx) {
|
|
62
|
+
this.ctx = ctx;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The lazily-created {@link ScriptFactory} bound to this service's context.
|
|
66
|
+
*
|
|
67
|
+
* Script-tree classes should not reach for this — a {@link ScriptRoot} mints its
|
|
68
|
+
* own factory from the context it already holds. It is here for callers that
|
|
69
|
+
* start from a bare path and need to enter the tree.
|
|
70
|
+
* @lastreviewed null
|
|
71
|
+
*/
|
|
72
|
+
getFactory() {
|
|
73
|
+
return (this.factory ??= new ScriptFactory_1.ScriptFactory(this.ctx));
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Create a {@link ScriptUrlParser} wired to this service's session and logger.
|
|
77
|
+
* @lastreviewed null
|
|
78
|
+
*/
|
|
79
|
+
createParser(url) {
|
|
80
|
+
return new ScriptUrlParser_1.ScriptUrlParser(url, this.ctx.sessionManager, this.ctx.logger, this.ctx.prompt);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Derive the base WebDAV URL from a local file path by parsing the
|
|
84
|
+
* downstairs path structure and looking up stored metadata.
|
|
85
|
+
* @lastreviewed null
|
|
86
|
+
*/
|
|
87
|
+
async deriveBaseUrl(filePath) {
|
|
88
|
+
try {
|
|
89
|
+
const sf = this.getFactory().createFile(B6PUri_1.B6PUri.fromFsPath(filePath));
|
|
90
|
+
return sf.getScriptRoot().getBaseWebDavUrlString();
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
this.ctx.logger.warn(`Could not parse downstairs path: ${filePath}`);
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Derive the workspace folder (parent of the org folder) from a file path
|
|
99
|
+
* inside a script root. Returns null if the path can't be parsed.
|
|
100
|
+
* @lastreviewed null
|
|
101
|
+
*/
|
|
102
|
+
deriveWorkspacePath(filePath) {
|
|
103
|
+
try {
|
|
104
|
+
const sf = this.getFactory().createFile(B6PUri_1.B6PUri.fromFsPath(filePath));
|
|
105
|
+
return sf.getScriptRoot().getOrgUri().dirname.fsPath;
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// ── Push / Pull ───────────────────────────────────────────────────
|
|
112
|
+
async push(opts) {
|
|
113
|
+
const targetUrl = opts.targetUrl ?? (await this.ctx.prompt.inputBox({ prompt: "Paste in the target formula URI" }));
|
|
114
|
+
if (targetUrl === undefined) {
|
|
115
|
+
this.ctx.prompt.error("No target formula URI provided");
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
this.ctx.logger.info(`Pushing script from ${opts.rootPath} to ${targetUrl}${opts.snapshot ? " (snapshot)" : ""}`);
|
|
119
|
+
return await (0, push_1.executePush)({
|
|
120
|
+
ctx: this.ctx,
|
|
121
|
+
targetUrl,
|
|
122
|
+
rootPath: opts.rootPath,
|
|
123
|
+
snapshot: opts.snapshot ?? false,
|
|
124
|
+
message: opts.message,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
async pushCurrent(opts) {
|
|
128
|
+
this.ctx.logger.info(`Push current for file: ${opts.filePath}`);
|
|
129
|
+
const baseUrl = await this.deriveBaseUrl(opts.filePath);
|
|
130
|
+
if (!baseUrl) {
|
|
131
|
+
const url = await this.ctx.prompt.inputBox({
|
|
132
|
+
prompt: "Could not determine script URL. Paste the target formula URI:",
|
|
133
|
+
});
|
|
134
|
+
if (!url) {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
// Derive rootPath from the file's path structure
|
|
138
|
+
const parser = new DownstairsPathParser_1.DownstairsPathParser(opts.filePath);
|
|
139
|
+
return await this.push({
|
|
140
|
+
targetUrl: url,
|
|
141
|
+
rootPath: parser.getShavedName(),
|
|
142
|
+
snapshot: opts.snapshot,
|
|
143
|
+
message: opts.message,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
const parser = new DownstairsPathParser_1.DownstairsPathParser(opts.filePath);
|
|
147
|
+
return await this.push({
|
|
148
|
+
targetUrl: baseUrl,
|
|
149
|
+
rootPath: parser.getShavedName(),
|
|
150
|
+
snapshot: opts.snapshot,
|
|
151
|
+
message: opts.message,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Pull a script tree from the platform into the workspace.
|
|
156
|
+
*
|
|
157
|
+
* @param opts.overwriteLocalPaths `downstairsPath` entries (as returned by the
|
|
158
|
+
* fetch walk and listed by {@link audit}) for which the platform copy may
|
|
159
|
+
* overwrite even a locally-edited file. Scoped per file — never the whole
|
|
160
|
+
* tree — so a confirmation shown to the user covers exactly the files that
|
|
161
|
+
* can be force-overwritten and nothing more.
|
|
162
|
+
* @returns The kept-files outcome, or `null` when the pull aborted before
|
|
163
|
+
* fetching (no URL, unreadable listing, or the wrong-directory guard).
|
|
164
|
+
* @lastreviewed null
|
|
165
|
+
*/
|
|
166
|
+
async pull(opts) {
|
|
167
|
+
const formulaUrl = opts.formulaUrl ?? (await this.ctx.prompt.inputBox({ prompt: "Paste in the desired formula URL" }));
|
|
168
|
+
if (formulaUrl === undefined) {
|
|
169
|
+
this.ctx.prompt.error("No formula URL provided");
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
this.ctx.logger.info(`Pulling script from ${formulaUrl} into ${opts.workspacePath}`);
|
|
173
|
+
const parser = this.createParser(formulaUrl);
|
|
174
|
+
const fetchedScriptObject = await parser.getScript();
|
|
175
|
+
if (!fetchedScriptObject) {
|
|
176
|
+
this.ctx.logger.warn("fetchedScriptObject is null");
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
const U = await parser.getU();
|
|
180
|
+
const scriptName = await parser.getScriptName();
|
|
181
|
+
this.ctx.logger.info(`Resolved script name: "${scriptName}" (webdavId: ${parser.webDavId})`);
|
|
182
|
+
// Guard against a known bug where getScriptName() returns the name of a
|
|
183
|
+
// recently-pulled script instead of the correct one (observed when two
|
|
184
|
+
// merge reports share a common name prefix, e.g. "Test_Green" and
|
|
185
|
+
// "Test_bp6_CLI"). If the resolved name is already linked to a *different*
|
|
186
|
+
// webdavId in local metadata, aborting here prevents overwriting the wrong
|
|
187
|
+
// directory and corrupting both scripts.
|
|
188
|
+
await this.ctx.scriptMetadataStore.whenReady();
|
|
189
|
+
const conflictingEntry = this.ctx.scriptMetadataStore.findByScriptName(U, scriptName);
|
|
190
|
+
if (conflictingEntry && conflictingEntry.webdavId !== parser.webDavId) {
|
|
191
|
+
this.ctx.prompt.error(`Pull aborted: the server returned script name "${scriptName}" for webdavId ${parser.webDavId}, ` +
|
|
192
|
+
`but that name is already linked locally to webdavId ${conflictingEntry.webdavId}. ` +
|
|
193
|
+
`Proceeding would overwrite the wrong directory. ` +
|
|
194
|
+
`Please report this issue — try pulling again or clearing your local metadata.`);
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
const factory = this.getFactory();
|
|
198
|
+
// Locally-edited files the divergence guard kept instead of overwriting;
|
|
199
|
+
// reported as one summary after the loop rather than one warning per file.
|
|
200
|
+
const keptLocalPaths = [];
|
|
201
|
+
const pullTasks = fetchedScriptObject.map((entry) => ({
|
|
202
|
+
execute: async () => {
|
|
203
|
+
const ultimatePath = path.join(opts.workspacePath, U, entry.downstairsPath);
|
|
204
|
+
const isDirectory = ultimatePath.endsWith("/") || entry.downstairsPath.endsWith("/");
|
|
205
|
+
if (isDirectory) {
|
|
206
|
+
const uri = B6PUri_1.B6PUri.fromFsPath(ultimatePath);
|
|
207
|
+
if (!(await this.ctx.fs.exists(uri))) {
|
|
208
|
+
await this.ctx.fs.createDirectory(uri);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
// Use ScriptFile.download() so that we get gitignore filtering, ETag-based
|
|
213
|
+
// integrity verification, and `lastPulled` metadata tracking — all the
|
|
214
|
+
// behaviour the previous inline fetch+writeFile loop was missing.
|
|
215
|
+
const fileUri = B6PUri_1.B6PUri.fromFsPath(ultimatePath);
|
|
216
|
+
const scriptRoot = factory.createScriptRoot(fileUri);
|
|
217
|
+
scriptRoot.withParser(parser);
|
|
218
|
+
const file = factory.createFile(fileUri, scriptRoot);
|
|
219
|
+
// Make sure the parent directory exists before download writes the file.
|
|
220
|
+
const parentUri = fileUri.dirname;
|
|
221
|
+
if (!(await this.ctx.fs.exists(parentUri))) {
|
|
222
|
+
await this.ctx.fs.createDirectory(parentUri);
|
|
223
|
+
}
|
|
224
|
+
await file.download(parser, {
|
|
225
|
+
overwriteLocal: opts.overwriteLocalPaths?.includes(entry.downstairsPath) ?? false,
|
|
226
|
+
onLocalKept: (fsPath) => keptLocalPaths.push(fsPath),
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
return ultimatePath;
|
|
230
|
+
},
|
|
231
|
+
description: "scripts",
|
|
232
|
+
}));
|
|
233
|
+
// Coalesce the per-script metadata writes into a single atomic write at the
|
|
234
|
+
// end of the pull. Each task's upsert would otherwise rewrite state.json in
|
|
235
|
+
// a rapid burst, which trips AV / ransomware heuristics on Windows (see the
|
|
236
|
+
// retry logic in SharedFilePersistence). On a failed pull the finally still
|
|
237
|
+
// makes a best-effort flush of what was pulled so far; if that flush also
|
|
238
|
+
// fails it is logged (not thrown) so the pull's own error is what surfaces.
|
|
239
|
+
await this.ctx.scriptMetadataStore.beginBatch();
|
|
240
|
+
let pullSucceeded = false;
|
|
241
|
+
try {
|
|
242
|
+
await this.ctx.progress.withProgress(pullTasks, {
|
|
243
|
+
title: "Pulling Script...",
|
|
244
|
+
cleanupMessage: "Cleaning up the downstairs folder...",
|
|
245
|
+
});
|
|
246
|
+
pullSucceeded = true;
|
|
247
|
+
}
|
|
248
|
+
finally {
|
|
249
|
+
// The kept-files report is emitted here — not after the try/finally — so
|
|
250
|
+
// it survives a pull that throws mid-loop. onLocalKept suppressed the
|
|
251
|
+
// per-file warnings on the promise that this aggregate would be shown;
|
|
252
|
+
// parking it after the block would break that promise on exactly the
|
|
253
|
+
// runs where files were already overwritten before the error.
|
|
254
|
+
if (keptLocalPaths.length > 0) {
|
|
255
|
+
const shown = keptLocalPaths.slice(0, 10);
|
|
256
|
+
const more = keptLocalPaths.length - shown.length;
|
|
257
|
+
this.ctx.prompt.warn(`Kept ${keptLocalPaths.length} file(s) that differ from what was last synced ` +
|
|
258
|
+
`(local edits, or a previously interrupted pull) — NOT synced:\n\n${shown.join("\n")}` +
|
|
259
|
+
`${more > 0 ? `\n…and ${more} more` : ""}\n\n` +
|
|
260
|
+
`Sync via an audit pull to take the platform versions, or delete a file and pull again.`);
|
|
261
|
+
}
|
|
262
|
+
try {
|
|
263
|
+
await this.ctx.scriptMetadataStore.flush();
|
|
264
|
+
}
|
|
265
|
+
catch (flushError) {
|
|
266
|
+
// If the pull itself failed, that error is the useful one — keep it and
|
|
267
|
+
// don't let a failed metadata flush mask it. Only surface the flush
|
|
268
|
+
// error when the pull otherwise succeeded.
|
|
269
|
+
if (pullSucceeded) {
|
|
270
|
+
throw flushError;
|
|
271
|
+
}
|
|
272
|
+
this.ctx.logger.error(`Failed to flush script metadata after a failed pull: ${String(flushError)}`);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
this.ctx.prompt.info("Pull complete!");
|
|
276
|
+
return { keptLocalPaths };
|
|
277
|
+
}
|
|
278
|
+
async pullCurrent(opts) {
|
|
279
|
+
const baseUrl = await this.deriveBaseUrl(opts.filePath);
|
|
280
|
+
if (!baseUrl) {
|
|
281
|
+
const url = await this.ctx.prompt.inputBox({ prompt: "Could not determine script URL. Paste the formula URL:" });
|
|
282
|
+
if (!url) {
|
|
283
|
+
return null;
|
|
284
|
+
}
|
|
285
|
+
return await this.pull({ formulaUrl: url, workspacePath: opts.workspacePath });
|
|
286
|
+
}
|
|
287
|
+
return await this.pull({ formulaUrl: baseUrl, workspacePath: opts.workspacePath });
|
|
288
|
+
}
|
|
289
|
+
// ── Audit ─────────────────────────────────────────────────────────
|
|
290
|
+
async audit(opts) {
|
|
291
|
+
this.ctx.logger.info(`Auditing file: ${opts.filePath}`);
|
|
292
|
+
const baseUrl = await this.deriveBaseUrl(opts.filePath);
|
|
293
|
+
if (!baseUrl) {
|
|
294
|
+
const url = await this.ctx.prompt.inputBox({ prompt: "Could not determine script URL. Paste the formula URL:" });
|
|
295
|
+
if (!url) {
|
|
296
|
+
return null;
|
|
297
|
+
}
|
|
298
|
+
return this.auditWithUrl(url, opts.workspacePath);
|
|
299
|
+
}
|
|
300
|
+
return this.auditWithUrl(baseUrl, opts.workspacePath);
|
|
301
|
+
}
|
|
302
|
+
async auditWithUrl(baseUrl, workspacePath) {
|
|
303
|
+
const parser = this.createParser(baseUrl);
|
|
304
|
+
const fetchedScriptObject = await parser.getScript();
|
|
305
|
+
if (!fetchedScriptObject) {
|
|
306
|
+
this.ctx.logger.warn("fetchedScriptObject is null during audit");
|
|
307
|
+
return null;
|
|
308
|
+
}
|
|
309
|
+
const U = await parser.getU();
|
|
310
|
+
const changedFiles = [];
|
|
311
|
+
const factory = this.getFactory();
|
|
312
|
+
for (const entry of fetchedScriptObject) {
|
|
313
|
+
const ultimatePath = path.join(workspacePath, U, entry.downstairsPath);
|
|
314
|
+
if (ultimatePath.endsWith("/") || entry.downstairsPath.endsWith("/")) {
|
|
315
|
+
continue; // skip directories
|
|
316
|
+
}
|
|
317
|
+
const fileUri = B6PUri_1.B6PUri.fromFsPath(ultimatePath);
|
|
318
|
+
if (!(await this.ctx.fs.exists(fileUri))) {
|
|
319
|
+
changedFiles.push(entry.downstairsPath + " (new)");
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
// Use ScriptFile.currentIntegrityStatus() so that we get the same robust ETag handling
|
|
323
|
+
// (standard / weak / numeric / complex) used by download(). Files served with numeric or
|
|
324
|
+
// complex ETags (declaration/library files) expose no content hash, so their status is
|
|
325
|
+
// "indeterminate" — we cannot assert a difference and must not report them as changed,
|
|
326
|
+
// exactly as download() skips their integrity verification. Only a genuine "mismatch",
|
|
327
|
+
// where both hashes are known and differ, counts as a changed file.
|
|
328
|
+
const scriptRoot = factory.createScriptRoot(fileUri);
|
|
329
|
+
scriptRoot.withParser(parser);
|
|
330
|
+
const file = factory.createFile(fileUri, scriptRoot);
|
|
331
|
+
const upstairsOverride = new URL(entry.upstairsPath);
|
|
332
|
+
const status = await file.currentIntegrityStatus({ upstairsOverride });
|
|
333
|
+
if (status === "mismatch") {
|
|
334
|
+
changedFiles.push(entry.downstairsPath);
|
|
335
|
+
}
|
|
336
|
+
else if (status === "indeterminate") {
|
|
337
|
+
this.ctx.logger.debug(`Skipping ${entry.downstairsPath}: server exposes no content hash to compare against`);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
if (changedFiles.length === 0) {
|
|
341
|
+
this.ctx.prompt.info("No differences detected. Local script is in sync with the server.");
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
this.ctx.prompt.info(`Detected ${changedFiles.length} file(s) with differences:\n\n${changedFiles.join("\n")}`);
|
|
345
|
+
}
|
|
346
|
+
return { changedFiles, baseUrl };
|
|
347
|
+
}
|
|
348
|
+
async auditPull(opts) {
|
|
349
|
+
const result = await this.audit(opts);
|
|
350
|
+
if (!result || result.changedFiles.length === 0) {
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
// "Cancel" is deliberately FIRST: prompt implementations answer with
|
|
354
|
+
// options[0] on an empty answer and under non-interactive auto-confirm
|
|
355
|
+
// (the CLI's --yes), and this prompt authorizes overwriting locally-edited
|
|
356
|
+
// files. An auto-supplied answer is not a human decision, so the default
|
|
357
|
+
// must be the safe branch; syncing requires typing "Sync" (or clicking it).
|
|
358
|
+
const SYNC = "Sync";
|
|
359
|
+
const CANCEL = "Cancel";
|
|
360
|
+
const response = await this.ctx.prompt.confirm(`Detected ${result.changedFiles.length} file(s) with differences:\n\n${result.changedFiles.join("\n")}\n\n` +
|
|
361
|
+
`Sync local copy with the server? Locally-edited files in this list will be OVERWRITTEN ` +
|
|
362
|
+
`with the platform copy.`, [CANCEL, SYNC]);
|
|
363
|
+
if (response !== SYNC) {
|
|
364
|
+
this.ctx.logger.info("User declined audit-pull sync");
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
// The user confirmed "Sync" over the explicit changed-file list, so the
|
|
368
|
+
// platform copy wins over local edits — but only for the files that were
|
|
369
|
+
// actually in that list. Scoping the overwrite to the confirmed set keeps
|
|
370
|
+
// the confirmation honest: files audit could not compare (no server content
|
|
371
|
+
// hash) were never disclosed, so they stay protected by the download-side
|
|
372
|
+
// divergence guard. "(new)" entries have no local file to overwrite.
|
|
373
|
+
const NEW_SUFFIX = " (new)";
|
|
374
|
+
const confirmedPaths = result.changedFiles.filter((f) => !f.endsWith(NEW_SUFFIX));
|
|
375
|
+
await this.pull({
|
|
376
|
+
formulaUrl: result.baseUrl,
|
|
377
|
+
workspacePath: opts.workspacePath,
|
|
378
|
+
overwriteLocalPaths: confirmedPaths,
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
// ── Deploy ────────────────────────────────────────────────────────
|
|
382
|
+
async deploy(opts) {
|
|
383
|
+
this.ctx.logger.info(`Quick deploy from config: ${opts.configPath}`);
|
|
384
|
+
// Read config file
|
|
385
|
+
const configUri = B6PUri_1.B6PUri.fromFsPath(opts.configPath);
|
|
386
|
+
if (!(await this.ctx.fs.exists(configUri))) {
|
|
387
|
+
this.ctx.prompt.error(`Config file not found: ${opts.configPath}`);
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
const configContent = await this.ctx.fs.readFile(configUri);
|
|
391
|
+
const configText = Buffer.from(configContent).toString("utf-8");
|
|
392
|
+
let config;
|
|
393
|
+
try {
|
|
394
|
+
config = JSON.parse(configText);
|
|
395
|
+
}
|
|
396
|
+
catch (error) {
|
|
397
|
+
this.ctx.prompt.error(`Failed to parse config file: ${error instanceof Error ? error.message : error}`);
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
if (!config.sourceRootPath || !config.targets || config.targets.length === 0) {
|
|
401
|
+
this.ctx.prompt.error("Invalid config file. Required fields: sourceRootPath, targets[]");
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
this.ctx.logger.info(`Deploying to ${config.targets.length} target(s)`);
|
|
405
|
+
for (const target of config.targets) {
|
|
406
|
+
this.ctx.logger.info(`Deploying to: ${target.url}`);
|
|
407
|
+
try {
|
|
408
|
+
await this.push({
|
|
409
|
+
targetUrl: target.url,
|
|
410
|
+
rootPath: config.sourceRootPath,
|
|
411
|
+
snapshot: target.snapshot ?? false,
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
catch (error) {
|
|
415
|
+
this.ctx.logger.error(`Failed to deploy to ${target.url}: ${error instanceof Error ? error.message : error}`);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
this.ctx.prompt.info("Deploy complete!");
|
|
419
|
+
}
|
|
420
|
+
// ── Setup URL ─────────────────────────────────────────────────────
|
|
421
|
+
/**
|
|
422
|
+
* Builds the web-UI setup URL for a locally-pulled script, resolving its
|
|
423
|
+
* stored metadata (org, classid, seqnum) from the {@link ScriptMetaDataStore}
|
|
424
|
+
* the same way `audit` and `push` do.
|
|
425
|
+
* @param opts.filePath Absolute path to any file inside the pulled script root.
|
|
426
|
+
* @returns The setup URL, or `null` if no metadata is stored for the script
|
|
427
|
+
* (not yet pulled) or its script type has no known setup page.
|
|
428
|
+
* @lastreviewed null
|
|
429
|
+
*/
|
|
430
|
+
async getSetupUrl(opts) {
|
|
431
|
+
try {
|
|
432
|
+
// Resolve stored metadata via the same script-root mechanism that `audit`
|
|
433
|
+
// and `push` use, rather than a raw `scriptMeta.<name>` persistence key
|
|
434
|
+
// that `pull` never writes. The metadata store is keyed by U + scriptName;
|
|
435
|
+
// the ScriptRoot derives both from the file path.
|
|
436
|
+
const root = this.getFactory().createFile(B6PUri_1.B6PUri.fromFsPath(opts.filePath)).getScriptRoot();
|
|
437
|
+
const meta = await root.getMetaData();
|
|
438
|
+
if (!meta) {
|
|
439
|
+
const scriptName = new DownstairsPathParser_1.DownstairsPathParser(opts.filePath).scriptName;
|
|
440
|
+
this.ctx.prompt.error(`No stored metadata found for script "${scriptName}". Pull the script first.`);
|
|
441
|
+
return null;
|
|
442
|
+
}
|
|
443
|
+
// The ScriptKey (classid + seqnum) knows its own setup page and can build
|
|
444
|
+
// the setup URL against the org's origin.
|
|
445
|
+
const scriptKey = await root.getScriptKey();
|
|
446
|
+
if (!scriptKey.setupPage) {
|
|
447
|
+
this.ctx.prompt.error(`Unknown script type (classid: ${scriptKey.classid}). Cannot generate setup URL.`);
|
|
448
|
+
return null;
|
|
449
|
+
}
|
|
450
|
+
const origin = await root.anyOrigin();
|
|
451
|
+
return scriptKey.buildSetupUrl(origin);
|
|
452
|
+
}
|
|
453
|
+
catch (error) {
|
|
454
|
+
this.ctx.logger.error(`Error generating setup URL: ${error instanceof Error ? error.message : error}`);
|
|
455
|
+
return null;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
exports.ScriptService = ScriptService;
|
|
460
|
+
//# sourceMappingURL=ScriptService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScriptService.js","sourceRoot":"","sources":["../../src/script/ScriptService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,IAAI,iCAAa;AAC7B,sCAAmC;AACnC,uEAAoE;AACpE,6DAA0D;AAC1D,iCAAsD;AAEtD,mDAAgD;AA2ChD;;;;;;;;;;;;;;GAcG;AACH;IAG+B,GAAG;IAFxB,OAAO,GAAyB,IAAI,CAAC;IAE7C,YAA6B,GAAkB;mBAAlB,GAAG;IAAkB,CAAC;IAEnD;;;;;;;OAOG;IACH,UAAU;QACR,OAAO,CAAC,IAAI,CAAC,OAAO,KAAK,IAAI,6BAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACxD,CAAC;IAED;;;OAGG;IACK,YAAY,CAAC,GAAW;QAC9B,OAAO,IAAI,iCAAe,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7F,CAAC;IAED;;;;OAIG;IACK,KAAK,CAAC,aAAa,CAAC,QAAgB;QAC1C,IAAI,C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G,OAAO,IAAI,CAAC;YACd,CAAC;YAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;YACtC,OAAO,SAAS,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QACzC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,+BAA+B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;YACvG,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScriptTranspiler.js","sourceRoot":"","sources":["../../src/script/ScriptTranspiler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAA4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"ScriptTranspiler.js","sourceRoot":"","sources":["../../src/script/ScriptTranspiler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAA4B;AAC5B,MAAY,IAAI,iCAAa;AAC7B,gCAA6B;AAG7B,4CAA2C;AAC3C,sCAAmC;AAEnC,mDAAgD;AAChD,mDAAgD;AAEhD;;;;GAIG;AACH;IAoB+B,GAAG;IAnBxB,QAAQ,GAA8B,IAAI,GAAG,EAAE,CAAC;IAChD,MAAM,CAAC,iBAAiB,GAAuB;QACrD,MAAM,EAAE,oBAAE,CAAC,UAAU,CAAC,MAAM;QAC5B,MAAM,EAAE,oBAAE,CAAC,YAAY,CAAC,MAAM;QAC9B,MAAM,EAAE,uBAAW,CAAC,SAAS;QAC7B,MAAM,EAAE,IAAI;QACZ,eAAe,EAAE,IAAI;QACrB,YAAY,EAAE,IAAI;QAClB,gCAAgC,EAAE,IAAI;QACtC,SAAS,EAAE,KAAK;QAChB,eAAe,EAAE,K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