windmill-cli 1.449.3 → 1.450.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/gen/core/OpenAPI.js +1 -1
- package/esm/main.js +1 -1
- package/esm/metadata.js +19 -20
- package/esm/script.js +36 -19
- package/esm/sync.js +168 -72
- package/esm/types.js +1 -1
- package/package.json +1 -1
- package/types/main.d.ts +1 -1
- package/types/metadata.d.ts +1 -1
- package/types/metadata.d.ts.map +1 -1
- package/types/script.d.ts +2 -1
- package/types/script.d.ts.map +1 -1
- package/types/sync.d.ts +2 -9
- package/types/sync.d.ts.map +1 -1
- package/types/types.d.ts.map +1 -1
package/esm/gen/core/OpenAPI.js
CHANGED
package/esm/main.js
CHANGED
|
@@ -33,7 +33,7 @@ export { flow, app, script, workspace, resource, user, variable, hub, folder, sc
|
|
|
33
33
|
// console.error(JSON.stringify(event.error, null, 4));
|
|
34
34
|
// }
|
|
35
35
|
// });
|
|
36
|
-
export const VERSION = "1.
|
|
36
|
+
export const VERSION = "1.450.1";
|
|
37
37
|
const command = new Command()
|
|
38
38
|
.name("wmill")
|
|
39
39
|
.action(() => log.info(`Welcome to Windmill CLI ${VERSION}. Use -h for help.`))
|
package/esm/metadata.js
CHANGED
|
@@ -50,20 +50,22 @@ async function generateFlowHash(folder) {
|
|
|
50
50
|
}
|
|
51
51
|
return { ...hashes, [TOP_HASH]: await generateHash(JSON.stringify(hashes)) };
|
|
52
52
|
}
|
|
53
|
-
export async function generateFlowLockInternal(folder, dryRun, workspace, justUpdateMetadataLock) {
|
|
53
|
+
export async function generateFlowLockInternal(folder, dryRun, workspace, justUpdateMetadataLock, noStaleMessage) {
|
|
54
54
|
if (folder.endsWith(SEP)) {
|
|
55
55
|
folder = folder.substring(0, folder.length - 1);
|
|
56
56
|
}
|
|
57
57
|
const remote_path = folder
|
|
58
58
|
.replaceAll(SEP, "/")
|
|
59
59
|
.substring(0, folder.length - ".flow".length);
|
|
60
|
-
if (!justUpdateMetadataLock) {
|
|
60
|
+
if (!justUpdateMetadataLock && !noStaleMessage) {
|
|
61
61
|
log.info(`Generating lock for flow ${folder} at ${remote_path}`);
|
|
62
62
|
}
|
|
63
63
|
let hashes = await generateFlowHash(folder);
|
|
64
64
|
const conf = await readLockfile();
|
|
65
65
|
if (await checkifMetadataUptodate(folder, hashes[TOP_HASH], conf, TOP_HASH)) {
|
|
66
|
-
|
|
66
|
+
if (!noStaleMessage) {
|
|
67
|
+
log.info(colors.green(`Flow ${remote_path} metadata is up-to-date, skipping`));
|
|
68
|
+
}
|
|
67
69
|
return;
|
|
68
70
|
}
|
|
69
71
|
else if (dryRun) {
|
|
@@ -115,11 +117,7 @@ export async function generateScriptMetadataInternal(scriptPath, workspace, opts
|
|
|
115
117
|
const metadataWithType = await parseMetadataFile(remotePath, undefined, globalDeps, codebases);
|
|
116
118
|
// read script content
|
|
117
119
|
const scriptContent = await dntShim.Deno.readTextFile(scriptPath);
|
|
118
|
-
|
|
119
|
-
const c = findCodebase(scriptPath, codebases);
|
|
120
|
-
if (c) {
|
|
121
|
-
metadataContent += c.digest ?? "";
|
|
122
|
-
}
|
|
120
|
+
const metadataContent = await dntShim.Deno.readTextFile(metadataWithType.path);
|
|
123
121
|
let hash = await generateScriptHash(rawReqs, scriptContent, metadataContent);
|
|
124
122
|
if (await checkifMetadataUptodate(remotePath, hash, undefined)) {
|
|
125
123
|
if (!noStaleMessage) {
|
|
@@ -138,13 +136,12 @@ export async function generateScriptMetadataInternal(scriptPath, workspace, opts
|
|
|
138
136
|
await updateScriptSchema(scriptContent, language, metadataParsedContent, scriptPath);
|
|
139
137
|
}
|
|
140
138
|
if (!opts.schemaOnly && !justUpdateMetadataLock) {
|
|
141
|
-
|
|
139
|
+
const hasCodebase = findCodebase(scriptPath, codebases) != undefined;
|
|
140
|
+
if (!hasCodebase) {
|
|
142
141
|
await updateScriptLock(workspace, scriptContent, language, remotePath, metadataParsedContent, rawReqs);
|
|
143
|
-
metadataParsedContent.codebase = undefined;
|
|
144
142
|
}
|
|
145
143
|
else {
|
|
146
|
-
metadataParsedContent.
|
|
147
|
-
metadataParsedContent.lock = "";
|
|
144
|
+
metadataParsedContent.lock = '';
|
|
148
145
|
}
|
|
149
146
|
}
|
|
150
147
|
else {
|
|
@@ -157,10 +154,7 @@ export async function generateScriptMetadataInternal(scriptPath, workspace, opts
|
|
|
157
154
|
metaPath = remotePath + ".script.json";
|
|
158
155
|
newMetadataContent = JSON.stringify(metadataParsedContent);
|
|
159
156
|
}
|
|
160
|
-
|
|
161
|
-
if (c) {
|
|
162
|
-
metadataContentUsedForHash += c.digest ?? "";
|
|
163
|
-
}
|
|
157
|
+
const metadataContentUsedForHash = newMetadataContent;
|
|
164
158
|
hash = await generateScriptHash(rawReqs, scriptContent, metadataContentUsedForHash);
|
|
165
159
|
await updateMetadataGlobalLock(remotePath, hash);
|
|
166
160
|
if (!justUpdateMetadataLock) {
|
|
@@ -173,9 +167,9 @@ export async function updateScriptSchema(scriptContent, language, metadataConten
|
|
|
173
167
|
await instantiateWasm();
|
|
174
168
|
const result = inferSchema(language, scriptContent, metadataContent.schema, path);
|
|
175
169
|
metadataContent.schema = result.schema;
|
|
176
|
-
if (result.has_preprocessor
|
|
170
|
+
if (result.has_preprocessor == true)
|
|
177
171
|
metadataContent.has_preprocessor = result.has_preprocessor;
|
|
178
|
-
if (result.no_main_func
|
|
172
|
+
if (result.no_main_func === true)
|
|
179
173
|
metadataContent.no_main_func = result.no_main_func;
|
|
180
174
|
}
|
|
181
175
|
async function updateScriptLock(workspace, scriptContent, language, remotePath, metadataContent, rawDeps) {
|
|
@@ -360,8 +354,11 @@ export function inferSchema(language, content, currentSchema, path) {
|
|
|
360
354
|
no_main_func: false,
|
|
361
355
|
};
|
|
362
356
|
}
|
|
357
|
+
if (!currentSchema) {
|
|
358
|
+
currentSchema = {};
|
|
359
|
+
}
|
|
363
360
|
currentSchema.required = [];
|
|
364
|
-
const oldProperties = JSON.parse(JSON.stringify(currentSchema
|
|
361
|
+
const oldProperties = JSON.parse(JSON.stringify(currentSchema?.properties ?? {}));
|
|
365
362
|
currentSchema.properties = {};
|
|
366
363
|
for (const arg of inferedSchema.args) {
|
|
367
364
|
if (!(arg.name in oldProperties)) {
|
|
@@ -634,7 +631,9 @@ export async function parseMetadataFile(scriptPath, generateMetadataIfMissing, g
|
|
|
634
631
|
try {
|
|
635
632
|
await generateScriptMetadataInternal(generateMetadataIfMissing.path, generateMetadataIfMissing.workspaceRemote, generateMetadataIfMissing, false, false, globalDeps, codebases, false);
|
|
636
633
|
scriptInitialMetadata = (await yamlParseFile(metadataFilePath));
|
|
637
|
-
|
|
634
|
+
if (!generateMetadataIfMissing.schemaOnly) {
|
|
635
|
+
replaceLock(scriptInitialMetadata);
|
|
636
|
+
}
|
|
638
637
|
}
|
|
639
638
|
catch (e) {
|
|
640
639
|
log.info(colors.yellow(`Failed to generate lockfile and schema for ${metadataFilePath}: ${e}`));
|
package/esm/script.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
// deno-lint-ignore-file no-explicit-any
|
|
2
2
|
import * as dntShim from "./_dnt.shims.js";
|
|
3
|
-
import { showDiff } from "./types.js";
|
|
4
3
|
import { requireLogin, resolveWorkspace, validatePath } from "./context.js";
|
|
5
4
|
import { colors, Command, Confirm, log, readAll, SEP, Table, writeAllSync, yamlStringify, } from "./deps.js";
|
|
6
5
|
import { deepEqual } from "./utils.js";
|
|
7
6
|
import * as wmill from "./gen/services.gen.js";
|
|
8
7
|
import { defaultScriptMetadata, scriptBootstrapCode, } from "./bootstrap/script_bootstrap.js";
|
|
9
|
-
import { generateScriptMetadataInternal, parseMetadataFile,
|
|
8
|
+
import { generateScriptMetadataInternal, parseMetadataFile, } from "./metadata.js";
|
|
10
9
|
import { inferContentTypeFromFilePath, } from "./script_common.js";
|
|
11
10
|
import { elementsToMap, findCodebase, readDirRecursiveWithIgnore, yamlOptions, } from "./sync.js";
|
|
12
11
|
import { ignoreF } from "./sync.js";
|
|
@@ -122,14 +121,15 @@ export async function handleFile(path, workspace, alreadySynced, message, opts,
|
|
|
122
121
|
}
|
|
123
122
|
log.info(`Finished building the bundle for ${path}`);
|
|
124
123
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
124
|
+
let typed = opts?.skipScriptsMetadata ? undefined :
|
|
125
|
+
(await parseMetadataFile(remotePath, opts
|
|
126
|
+
? {
|
|
127
|
+
...opts,
|
|
128
|
+
path,
|
|
129
|
+
workspaceRemote: workspace,
|
|
130
|
+
schemaOnly: codebase ? true : undefined,
|
|
131
|
+
}
|
|
132
|
+
: undefined, globalDeps, codebases))?.payload;
|
|
133
133
|
const workspaceId = workspace.workspaceId;
|
|
134
134
|
let remote = undefined;
|
|
135
135
|
try {
|
|
@@ -143,14 +143,28 @@ export async function handleFile(path, workspace, alreadySynced, message, opts,
|
|
|
143
143
|
log.debug(`Script ${remotePath} does not exist on remote`);
|
|
144
144
|
}
|
|
145
145
|
const content = await dntShim.Deno.readTextFile(path);
|
|
146
|
-
if (
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
146
|
+
if (opts?.skipScriptsMetadata) {
|
|
147
|
+
// if (codebase) {
|
|
148
|
+
// const typedBefore = JSON.parse(JSON.stringify(typed.schema));
|
|
149
|
+
// await updateScriptSchema(content, language, typed, path);
|
|
150
|
+
// if (typedBefore != typed.schema) {
|
|
151
|
+
// log.info(`Updated metadata for bundle ${path}`);
|
|
152
|
+
// showDiff(
|
|
153
|
+
// yamlStringify(typedBefore, yamlOptions),
|
|
154
|
+
// yamlStringify(typed.schema, yamlOptions)
|
|
155
|
+
// );
|
|
156
|
+
// await Deno.writeTextFile(
|
|
157
|
+
// remotePath + ".script.yaml",
|
|
158
|
+
// yamlStringify(typed as Record<string, any>, yamlOptions)
|
|
159
|
+
// );
|
|
160
|
+
// }
|
|
161
|
+
// }
|
|
162
|
+
// else {
|
|
163
|
+
typed = structuredClone(remote);
|
|
164
|
+
// }
|
|
165
|
+
}
|
|
166
|
+
if (typed && codebase) {
|
|
167
|
+
typed.codebase = codebase.digest;
|
|
154
168
|
}
|
|
155
169
|
const requestBodyCommon = {
|
|
156
170
|
content,
|
|
@@ -179,6 +193,8 @@ export async function handleFile(path, workspace, alreadySynced, message, opts,
|
|
|
179
193
|
timeout: typed?.timeout,
|
|
180
194
|
on_behalf_of_email: typed?.on_behalf_of_email,
|
|
181
195
|
};
|
|
196
|
+
// log.info(JSON.stringify(requestBodyCommon, null, 2))
|
|
197
|
+
// log.info(JSON.stringify(opts, null, 2))
|
|
182
198
|
if (remote) {
|
|
183
199
|
if (content === remote.content) {
|
|
184
200
|
if (typed == undefined ||
|
|
@@ -632,6 +648,7 @@ export async function findGlobalDeps() {
|
|
|
632
648
|
return { pkgs, reqs, composers };
|
|
633
649
|
}
|
|
634
650
|
async function generateMetadata(opts, scriptPath) {
|
|
651
|
+
log.info("This command only works for workspace scripts, for flows inline scripts use `wmill flow generate-locks`");
|
|
635
652
|
if (scriptPath == "") {
|
|
636
653
|
scriptPath = undefined;
|
|
637
654
|
}
|
|
@@ -702,7 +719,7 @@ const command = new Command()
|
|
|
702
719
|
.option("--summary <summary:string>", "script summary")
|
|
703
720
|
.option("--description <description:string>", "script description")
|
|
704
721
|
.action(bootstrap)
|
|
705
|
-
.command("generate-metadata", "re-generate the metadata file updating the lock and the script schema")
|
|
722
|
+
.command("generate-metadata", "re-generate the metadata file updating the lock and the script schema (for flows, use `wmill flow generate-locks`)")
|
|
706
723
|
.arguments("[script:file]")
|
|
707
724
|
.option("--yes", "Skip confirmation prompt")
|
|
708
725
|
.option("--lock-only", "re-generate only the lock")
|
package/esm/sync.js
CHANGED
|
@@ -52,8 +52,9 @@ async function addCodebaseDigestIfRelevant(path, content, codebases) {
|
|
|
52
52
|
return content;
|
|
53
53
|
}
|
|
54
54
|
let isTs = true;
|
|
55
|
+
const replacedPath = path.replace(".script.yaml", ".ts");
|
|
55
56
|
try {
|
|
56
|
-
await dntShim.Deno.stat(
|
|
57
|
+
await dntShim.Deno.stat(replacedPath);
|
|
57
58
|
}
|
|
58
59
|
catch {
|
|
59
60
|
isTs = false;
|
|
@@ -62,12 +63,12 @@ async function addCodebaseDigestIfRelevant(path, content, codebases) {
|
|
|
62
63
|
return content;
|
|
63
64
|
}
|
|
64
65
|
if (isTs) {
|
|
65
|
-
const c = findCodebase(
|
|
66
|
+
const c = findCodebase(replacedPath, codebases);
|
|
66
67
|
if (c) {
|
|
67
68
|
const parsed = yamlParseContent(path, content);
|
|
68
69
|
if (parsed && typeof parsed == "object") {
|
|
69
70
|
parsed["codebase"] = c.digest;
|
|
70
|
-
parsed["lock"] =
|
|
71
|
+
parsed["lock"] = '';
|
|
71
72
|
return yamlStringify(parsed, yamlOptions);
|
|
72
73
|
}
|
|
73
74
|
else {
|
|
@@ -99,8 +100,8 @@ export async function FSFSElement(p, codebases) {
|
|
|
99
100
|
// },
|
|
100
101
|
async getContentText() {
|
|
101
102
|
const content = await dntShim.Deno.readTextFile(localP);
|
|
102
|
-
const
|
|
103
|
-
|
|
103
|
+
const itemPath = localP.substring(p.length + 1);
|
|
104
|
+
const r = await addCodebaseDigestIfRelevant(itemPath, content, codebases);
|
|
104
105
|
return r;
|
|
105
106
|
},
|
|
106
107
|
};
|
|
@@ -570,7 +571,7 @@ export async function elementsToMap(els, ignore, json, skips) {
|
|
|
570
571
|
}
|
|
571
572
|
return map;
|
|
572
573
|
}
|
|
573
|
-
async function compareDynFSElement(els1, els2, ignore, json, skips, ignoreMetadataDeletion) {
|
|
574
|
+
async function compareDynFSElement(els1, els2, ignore, json, skips, ignoreMetadataDeletion, codebases) {
|
|
574
575
|
const [m1, m2] = els2
|
|
575
576
|
? await Promise.all([
|
|
576
577
|
elementsToMap(els1, ignore, json, skips),
|
|
@@ -608,21 +609,80 @@ async function compareDynFSElement(els1, els2, ignore, json, skips, ignoreMetada
|
|
|
608
609
|
return yamlParseContent(k, v);
|
|
609
610
|
}
|
|
610
611
|
}
|
|
611
|
-
|
|
612
|
+
const codebaseChanges = {};
|
|
613
|
+
for (let [k, v] of Object.entries(m1)) {
|
|
614
|
+
const isScriptMetadata = k.endsWith(".script.yaml") || k.endsWith(".script.json");
|
|
615
|
+
const skipMetadata = skips.skipScriptsMetadata && isScriptMetadata;
|
|
612
616
|
if (m2[k] === undefined) {
|
|
617
|
+
if (skipMetadata) {
|
|
618
|
+
continue;
|
|
619
|
+
}
|
|
613
620
|
changes.push({ name: "added", path: k, content: v });
|
|
614
621
|
}
|
|
615
|
-
else
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
622
|
+
else {
|
|
623
|
+
if (m2[k] == v) {
|
|
624
|
+
continue;
|
|
625
|
+
}
|
|
626
|
+
else if (k.endsWith(".json")) {
|
|
627
|
+
if (deepEqual(JSON.parse(v), JSON.parse(m2[k]))) {
|
|
628
|
+
continue;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
else if (k.endsWith(".yaml")) {
|
|
632
|
+
const before = parseYaml(k, m2[k]);
|
|
633
|
+
const after = parseYaml(k, v);
|
|
634
|
+
if (deepEqual(before, after)) {
|
|
635
|
+
continue;
|
|
636
|
+
}
|
|
637
|
+
if (before.codebase != undefined) {
|
|
638
|
+
delete before.codebase;
|
|
639
|
+
m2[k] = yamlStringify(before, yamlOptions);
|
|
640
|
+
}
|
|
641
|
+
if (after.codebase != undefined) {
|
|
642
|
+
if (before.codebase != after.codebase) {
|
|
643
|
+
codebaseChanges[k] = after.codebase;
|
|
644
|
+
}
|
|
645
|
+
delete after.codebase;
|
|
646
|
+
v = yamlStringify(after, yamlOptions);
|
|
647
|
+
}
|
|
648
|
+
if (skipMetadata) {
|
|
649
|
+
continue;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
changes.push({ name: "edited", path: k, after: v, before: m2[k], codebase: codebaseChanges[k] });
|
|
619
653
|
}
|
|
620
654
|
}
|
|
655
|
+
const remoteCodebase = {};
|
|
621
656
|
for (const [k] of Object.entries(m2)) {
|
|
622
|
-
if (m1[k] === undefined
|
|
623
|
-
(!ignoreMetadataDeletion ||
|
|
624
|
-
(
|
|
625
|
-
|
|
657
|
+
if (m1[k] === undefined) {
|
|
658
|
+
if (!ignoreMetadataDeletion || (!k?.endsWith(".script.yaml") && !k?.endsWith(".script.json"))) {
|
|
659
|
+
changes.push({ name: "deleted", path: k });
|
|
660
|
+
}
|
|
661
|
+
else if (k?.endsWith(".script.yaml")) {
|
|
662
|
+
let o = parseYaml(k, m2[k]);
|
|
663
|
+
if (o.codebase != undefined) {
|
|
664
|
+
remoteCodebase[k] = o.codebase;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
for (const [k, v] of Object.entries(remoteCodebase)) {
|
|
670
|
+
const tsFile = k.replace(".script.yaml", ".ts");
|
|
671
|
+
if (changes.find(c => c.path == tsFile && (c.name == "edited" || c.name == "deleted"))) {
|
|
672
|
+
continue;
|
|
673
|
+
}
|
|
674
|
+
let c = findCodebase(tsFile, codebases);
|
|
675
|
+
if (c?.digest != v) {
|
|
676
|
+
changes.push({ name: "edited", path: tsFile, codebase: v, before: m1[tsFile], after: m2[tsFile] });
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
for (const change of changes) {
|
|
680
|
+
const codebase = codebaseChanges[change.path];
|
|
681
|
+
if (!codebase)
|
|
682
|
+
continue;
|
|
683
|
+
const tsFile = change.path.replace(".script.yaml", ".ts");
|
|
684
|
+
if (change.name == "edited" && change.path == tsFile) {
|
|
685
|
+
change.codebase = codebase;
|
|
626
686
|
}
|
|
627
687
|
}
|
|
628
688
|
changes.sort((a, b) => getOrderFromPath(a.path) == getOrderFromPath(b.path)
|
|
@@ -740,6 +800,55 @@ export async function ignoreF(wmillconf) {
|
|
|
740
800
|
(!isDirectory && whitelist != undefined && !whitelist.approve(p))));
|
|
741
801
|
};
|
|
742
802
|
}
|
|
803
|
+
// deno-lint-ignore no-inner-declarations
|
|
804
|
+
async function addToChangedIfNotExists(p, tracker) {
|
|
805
|
+
const isScript = exts.some((e) => p.endsWith(e));
|
|
806
|
+
if (isScript) {
|
|
807
|
+
if (p.includes(".flow" + SEP)) {
|
|
808
|
+
const folder = p.substring(0, p.indexOf(".flow" + SEP)) + ".flow" + SEP;
|
|
809
|
+
if (!tracker.flows.includes(folder)) {
|
|
810
|
+
tracker.flows.push(folder);
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
else if (p.includes(".app" + SEP)) {
|
|
814
|
+
const folder = p.substring(0, p.indexOf(".app" + SEP)) + ".app" + SEP;
|
|
815
|
+
if (!tracker.apps.includes(folder)) {
|
|
816
|
+
tracker.apps.push(folder);
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
else {
|
|
820
|
+
if (!tracker.scripts.includes(p)) {
|
|
821
|
+
tracker.scripts.push(p);
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
else if (p.endsWith(".script.yaml") || p.endsWith(".script.json")) {
|
|
826
|
+
try {
|
|
827
|
+
const contentPath = await findContentFile(p);
|
|
828
|
+
if (!contentPath)
|
|
829
|
+
return;
|
|
830
|
+
if (tracker.scripts.includes(contentPath))
|
|
831
|
+
return;
|
|
832
|
+
tracker.scripts.push(contentPath);
|
|
833
|
+
}
|
|
834
|
+
catch {
|
|
835
|
+
// ignore
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
async function buildTracker(changes) {
|
|
840
|
+
const tracker = {
|
|
841
|
+
scripts: [],
|
|
842
|
+
flows: [],
|
|
843
|
+
apps: [],
|
|
844
|
+
};
|
|
845
|
+
for (const change of changes) {
|
|
846
|
+
if (change.name == "added" || change.name == "edited") {
|
|
847
|
+
await addToChangedIfNotExists(change.path, tracker);
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
return tracker;
|
|
851
|
+
}
|
|
743
852
|
export async function pull(opts) {
|
|
744
853
|
opts = await mergeConfigWithConfigFile(opts);
|
|
745
854
|
if (opts.stateful) {
|
|
@@ -762,7 +871,7 @@ export async function pull(opts) {
|
|
|
762
871
|
const local = !opts.stateful
|
|
763
872
|
? await FSFSElement(dntShim.Deno.cwd(), codebases)
|
|
764
873
|
: await FSFSElement(path.join(dntShim.Deno.cwd(), ".wmill"), []);
|
|
765
|
-
const changes = await compareDynFSElement(remote, local, await ignoreF(opts), opts.json ?? false, opts, false);
|
|
874
|
+
const changes = await compareDynFSElement(remote, local, await ignoreF(opts), opts.json ?? false, opts, false, codebases);
|
|
766
875
|
log.info(`remote (${workspace.name}) -> local: ${changes.length} changes to apply`);
|
|
767
876
|
if (changes.length > 0) {
|
|
768
877
|
prettyChanges(changes);
|
|
@@ -774,45 +883,6 @@ export async function pull(opts) {
|
|
|
774
883
|
return;
|
|
775
884
|
}
|
|
776
885
|
const conflicts = [];
|
|
777
|
-
const changedScripts = [];
|
|
778
|
-
const changedFlows = [];
|
|
779
|
-
const changedApps = [];
|
|
780
|
-
// deno-lint-ignore no-inner-declarations
|
|
781
|
-
async function addToChangedIfNotExists(p) {
|
|
782
|
-
const isScript = exts.some((e) => p.endsWith(e));
|
|
783
|
-
if (isScript) {
|
|
784
|
-
if (p.includes(".flow" + SEP)) {
|
|
785
|
-
const folder = p.substring(0, p.indexOf(".flow" + SEP)) + ".flow" + SEP;
|
|
786
|
-
if (!changedFlows.includes(folder)) {
|
|
787
|
-
changedFlows.push(folder);
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
else if (p.includes(".app" + SEP)) {
|
|
791
|
-
const folder = p.substring(0, p.indexOf(".app" + SEP)) + ".app" + SEP;
|
|
792
|
-
if (!changedApps.includes(folder)) {
|
|
793
|
-
changedApps.push(folder);
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
else {
|
|
797
|
-
if (!changedScripts.includes(p)) {
|
|
798
|
-
changedScripts.push(p);
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
else if (p.endsWith(".script.yaml") || p.endsWith(".script.json")) {
|
|
803
|
-
try {
|
|
804
|
-
const contentPath = await findContentFile(p);
|
|
805
|
-
if (!contentPath)
|
|
806
|
-
return;
|
|
807
|
-
if (changedScripts.includes(contentPath))
|
|
808
|
-
return;
|
|
809
|
-
changedScripts.push(contentPath);
|
|
810
|
-
}
|
|
811
|
-
catch {
|
|
812
|
-
// ignore
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
886
|
log.info(colors.gray(`Applying changes to files ...`));
|
|
817
887
|
for await (const change of changes) {
|
|
818
888
|
const target = path.join(dntShim.Deno.cwd(), change.path);
|
|
@@ -859,7 +929,6 @@ export async function pull(opts) {
|
|
|
859
929
|
await ensureDir(path.dirname(stateTarget));
|
|
860
930
|
await dntShim.Deno.copyFile(target, stateTarget);
|
|
861
931
|
}
|
|
862
|
-
await addToChangedIfNotExists(change.path);
|
|
863
932
|
}
|
|
864
933
|
else if (change.name === "added") {
|
|
865
934
|
await ensureDir(path.dirname(target));
|
|
@@ -872,7 +941,6 @@ export async function pull(opts) {
|
|
|
872
941
|
if (opts.stateful) {
|
|
873
942
|
await dntShim.Deno.copyFile(target, stateTarget);
|
|
874
943
|
}
|
|
875
|
-
await addToChangedIfNotExists(change.path);
|
|
876
944
|
}
|
|
877
945
|
else if (change.name === "deleted") {
|
|
878
946
|
try {
|
|
@@ -905,15 +973,16 @@ export async function pull(opts) {
|
|
|
905
973
|
}
|
|
906
974
|
log.info("All local changes pulled, now updating wmill-lock.yaml");
|
|
907
975
|
const globalDeps = await findGlobalDeps();
|
|
908
|
-
|
|
976
|
+
const tracker = await buildTracker(changes);
|
|
977
|
+
for (const change of tracker.scripts) {
|
|
909
978
|
await generateScriptMetadataInternal(change, workspace, opts, false, true, globalDeps, codebases, true);
|
|
910
979
|
}
|
|
911
|
-
for (const change of
|
|
980
|
+
for (const change of tracker.flows) {
|
|
912
981
|
log.info(`Updating lock for flow ${change}`);
|
|
913
982
|
await generateFlowLockInternal(change, false, workspace, true);
|
|
914
983
|
}
|
|
915
|
-
if (
|
|
916
|
-
log.info(`Apps ${
|
|
984
|
+
if (tracker.apps.length > 0) {
|
|
985
|
+
log.info(`Apps ${tracker.apps.join(", ")} scripts were changed but ignoring for now`);
|
|
917
986
|
}
|
|
918
987
|
log.info(colors.bold.green.underline(`\nDone! All ${changes.length} changes applied locally and wmill-lock.yaml updated.`));
|
|
919
988
|
}
|
|
@@ -927,8 +996,10 @@ function prettyChanges(changes) {
|
|
|
927
996
|
log.info(colors.red(`- ${getTypeStrFromPath(change.path)} ` + change.path));
|
|
928
997
|
}
|
|
929
998
|
else if (change.name === "edited") {
|
|
930
|
-
log.info(colors.yellow(`~ ${getTypeStrFromPath(change.path)} ` + change.path));
|
|
931
|
-
|
|
999
|
+
log.info(colors.yellow(`~ ${getTypeStrFromPath(change.path)} ` + change.path + (change.codebase ? ` (codebase changed)` : "")));
|
|
1000
|
+
if (change.before != change.after) {
|
|
1001
|
+
showDiff(change.before, change.after);
|
|
1002
|
+
}
|
|
932
1003
|
}
|
|
933
1004
|
}
|
|
934
1005
|
}
|
|
@@ -984,7 +1055,38 @@ export async function push(opts) {
|
|
|
984
1055
|
}
|
|
985
1056
|
const remote = ZipFSElement((await downloadZip(workspace, opts.plainSecrets, opts.skipVariables, opts.skipResources, opts.skipSecrets, opts.includeSchedules, opts.includeUsers, opts.includeGroups, opts.includeSettings, opts.includeKey, opts.defaultTs)), !opts.json, opts.defaultTs ?? "bun", resourceTypeToFormatExtension);
|
|
986
1057
|
const local = await FSFSElement(path.join(dntShim.Deno.cwd(), ""), codebases);
|
|
987
|
-
const changes = await compareDynFSElement(local, remote, await ignoreF(opts), opts.json ?? false, opts, true);
|
|
1058
|
+
const changes = await compareDynFSElement(local, remote, await ignoreF(opts), opts.json ?? false, opts, true, codebases);
|
|
1059
|
+
const globalDeps = await findGlobalDeps();
|
|
1060
|
+
const tracker = await buildTracker(changes);
|
|
1061
|
+
const staleScripts = [];
|
|
1062
|
+
const staleFlows = [];
|
|
1063
|
+
for (const change of tracker.scripts) {
|
|
1064
|
+
const stale = await generateScriptMetadataInternal(change, workspace, opts, true, true, globalDeps, codebases, false);
|
|
1065
|
+
if (stale) {
|
|
1066
|
+
staleScripts.push(stale);
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
if (staleScripts.length > 0) {
|
|
1070
|
+
log.info("");
|
|
1071
|
+
log.warn("Stale scripts metadata found, you may want to update them using 'wmill script generate-metadata' before pushing:");
|
|
1072
|
+
for (const stale of staleScripts) {
|
|
1073
|
+
log.warn(stale);
|
|
1074
|
+
}
|
|
1075
|
+
log.info("");
|
|
1076
|
+
}
|
|
1077
|
+
for (const change of tracker.flows) {
|
|
1078
|
+
const stale = await generateFlowLockInternal(change, true, workspace, false, true);
|
|
1079
|
+
if (stale) {
|
|
1080
|
+
staleFlows.push(stale);
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
if (staleFlows.length > 0) {
|
|
1084
|
+
log.warn("Stale flows locks found, you may want to update them using 'wmill flow generate-locks' before pushing:");
|
|
1085
|
+
for (const stale of staleFlows) {
|
|
1086
|
+
log.warn(stale);
|
|
1087
|
+
}
|
|
1088
|
+
log.info("");
|
|
1089
|
+
}
|
|
988
1090
|
const version = await fetchVersion(workspace.remote);
|
|
989
1091
|
log.info(colors.gray("Remote version: " + version));
|
|
990
1092
|
log.info(`remote (${workspace.name}) <- local: ${changes.length} changes to apply`);
|
|
@@ -999,7 +1101,6 @@ export async function push(opts) {
|
|
|
999
1101
|
}
|
|
1000
1102
|
log.info(colors.gray(`Applying changes to files ...`));
|
|
1001
1103
|
const alreadySynced = [];
|
|
1002
|
-
const globalDeps = await findGlobalDeps();
|
|
1003
1104
|
for await (const change of changes) {
|
|
1004
1105
|
const stateTarget = path.join(dntShim.Deno.cwd(), ".wmill", change.path);
|
|
1005
1106
|
let stateExists = true;
|
|
@@ -1172,15 +1273,13 @@ const command = new Command()
|
|
|
1172
1273
|
.action(() => log.info("2 actions available, pull and push. Use -h to display help."))
|
|
1173
1274
|
.command("pull")
|
|
1174
1275
|
.description("Pull any remote changes and apply them locally.")
|
|
1175
|
-
.option("--fail-conflicts", "Error on conflicts (both remote and local have changes on the same item)")
|
|
1176
|
-
.option("--raw", "Push without using state, just overwrite. (Default, has no effect)")
|
|
1177
1276
|
.option("--yes", "Pull without needing confirmation")
|
|
1178
|
-
.option("--stateful", "Pull using state tracking (create .wmill folder and needed for --fail-conflicts)")
|
|
1179
1277
|
.option("--plain-secrets", "Pull secrets as plain text")
|
|
1180
1278
|
.option("--json", "Use JSON instead of YAML")
|
|
1181
1279
|
.option("--skip-variables", "Skip syncing variables (including secrets)")
|
|
1182
1280
|
.option("--skip-secrets", "Skip syncing only secrets variables")
|
|
1183
1281
|
.option("--skip-resources", "Skip syncing resources")
|
|
1282
|
+
// .option("--skip-scripts-metadata", "Skip syncing scripts metadata, focus solely on logic")
|
|
1184
1283
|
.option("--include-schedules", "Include syncing schedules")
|
|
1185
1284
|
.option("--include-users", "Include syncing users")
|
|
1186
1285
|
.option("--include-groups", "Include syncing groups")
|
|
@@ -1193,16 +1292,13 @@ const command = new Command()
|
|
|
1193
1292
|
.action(pull)
|
|
1194
1293
|
.command("push")
|
|
1195
1294
|
.description("Push any local changes and apply them remotely.")
|
|
1196
|
-
.option("--fail-conflicts", "Error on conflicts (both remote and local have changes on the same item)")
|
|
1197
|
-
.option("--raw", "Push without using state, just overwrite. (Default, has no effect)")
|
|
1198
|
-
.option("--stateful", "Pull using state tracking (use .wmill folder and needed for --fail-conflicts)w")
|
|
1199
|
-
.option("--skip-pull", "(stateful only) Push without pulling first")
|
|
1200
1295
|
.option("--yes", "Push without needing confirmation")
|
|
1201
1296
|
.option("--plain-secrets", "Push secrets as plain text")
|
|
1202
1297
|
.option("--json", "Use JSON instead of YAML")
|
|
1203
1298
|
.option("--skip-variables", "Skip syncing variables (including secrets)")
|
|
1204
1299
|
.option("--skip-secrets", "Skip syncing only secrets variables")
|
|
1205
1300
|
.option("--skip-resources", "Skip syncing resources")
|
|
1301
|
+
// .option("--skip-scripts-metadata", "Skip syncing scripts metadata, focus solely on logic")
|
|
1206
1302
|
.option("--include-schedules", "Include syncing schedules")
|
|
1207
1303
|
.option("--include-users", "Include syncing users")
|
|
1208
1304
|
.option("--include-groups", "Include syncing groups")
|
package/esm/types.js
CHANGED
|
@@ -37,7 +37,7 @@ export function showDiff(local, remote) {
|
|
|
37
37
|
log.info("Diff too large to display");
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
for (const part of Diff.diffLines(local, remote)) {
|
|
40
|
+
for (const part of Diff.diffLines(local ?? '', remote ?? '')) {
|
|
41
41
|
if (part.removed) {
|
|
42
42
|
// print red if removed without newline
|
|
43
43
|
finalString += `\x1b[31m${part.value}\x1b[0m`;
|
package/package.json
CHANGED
package/types/main.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ import { pull as hubPull } from "./hub.js";
|
|
|
19
19
|
import { pull, push } from "./sync.js";
|
|
20
20
|
import { add as workspaceAdd } from "./workspace.js";
|
|
21
21
|
export { flow, app, script, workspace, resource, user, variable, hub, folder, schedule, sync, instance, dev, hubPull, pull, push, workspaceAdd, };
|
|
22
|
-
export declare const VERSION = "1.
|
|
22
|
+
export declare const VERSION = "1.450.1";
|
|
23
23
|
declare const command: Command<{
|
|
24
24
|
workspace?: (import("./deps/jsr.io/@windmill-labs/cliffy-command/1.0.0-rc.5/mod.js").StringType & string) | undefined;
|
|
25
25
|
} & {
|
package/types/metadata.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { GlobalDeps } from "./script.js";
|
|
|
6
6
|
import { SyncCodebase } from "./codebase.js";
|
|
7
7
|
import { FlowValue } from "./gen/types.gen.js";
|
|
8
8
|
export declare function generateAllMetadata(): Promise<void>;
|
|
9
|
-
export declare function generateFlowLockInternal(folder: string, dryRun: boolean, workspace: Workspace, justUpdateMetadataLock?: boolean): Promise<string | undefined>;
|
|
9
|
+
export declare function generateFlowLockInternal(folder: string, dryRun: boolean, workspace: Workspace, justUpdateMetadataLock?: boolean, noStaleMessage?: boolean): Promise<string | undefined>;
|
|
10
10
|
export declare function generateScriptMetadataInternal(scriptPath: string, workspace: Workspace, opts: GlobalOptions & {
|
|
11
11
|
lockOnly?: boolean | undefined;
|
|
12
12
|
schemaOnly?: boolean | undefined;
|
package/types/metadata.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../src/metadata.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAgC3C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAQ,MAAM,aAAa,CAAC;AAS/C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,wBAAsB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../src/metadata.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAgC3C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAQ,MAAM,aAAa,CAAC;AAS/C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,EAAE,SAAS,EAAE,M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AAE,MAAM,CAAA;CAAE,CAAC,CA4E1D;AAED,UAAU,IAAI;IACZ,KAAK,CAAC,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG;YAAE,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;CACpE;AAGD,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAalD;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,IAAI,GAAG,SAAS,EACtB,OAAO,CAAC,EAAE,MAAM,oBAWjB;AAED,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,aAAa,EAAE,MAAM,EACrB,kBAAkB,EAAE,MAAM,mBAK3B;AAED,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAoBf"}
|
package/types/script.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { GlobalOptions } from "./types.js";
|
|
|
2
2
|
import { Command } from "./deps.js";
|
|
3
3
|
import { Workspace } from "./workspace.js";
|
|
4
4
|
import { ScriptLanguage } from "./script_common.js";
|
|
5
|
+
import { Skips } from "./sync.js";
|
|
5
6
|
import { SyncCodebase } from "./codebase.js";
|
|
6
7
|
export interface ScriptFile {
|
|
7
8
|
parent_hash?: string;
|
|
@@ -16,7 +17,7 @@ export declare function findResourceFile(path: string): Promise<string>;
|
|
|
16
17
|
export declare function handleScriptMetadata(path: string, workspace: Workspace, alreadySynced: string[], message: string | undefined, globalDeps: GlobalDeps, codebases: SyncCodebase[], opts: GlobalOptions): Promise<boolean>;
|
|
17
18
|
export declare function handleFile(path: string, workspace: Workspace, alreadySynced: string[], message: string | undefined, opts: (GlobalOptions & {
|
|
18
19
|
defaultTs?: "bun" | "deno";
|
|
19
|
-
}) | undefined, globalDeps: GlobalDeps, codebases: SyncCodebase[]): Promise<boolean>;
|
|
20
|
+
} & Skips) | undefined, globalDeps: GlobalDeps, codebases: SyncCodebase[]): Promise<boolean>;
|
|
20
21
|
export declare function findContentFile(filePath: string): Promise<string>;
|
|
21
22
|
export declare function filePathExtensionFromContentType(language: ScriptLanguage, defaultTs: "bun" | "deno" | undefined): string;
|
|
22
23
|
export declare const exts: string[];
|
package/types/script.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../src/script.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../src/script.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAEL,OAAO,EAQR,MAAM,WAAW,CAAC;AASnB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,OAAO,EACL,cAAc,EAEf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAIL,KAAK,EAEN,MAAM,WAAW,CAAC;AAQnB,OAAO,EAAE,YAAY,EAAqB,MAAM,eAAe,CAAC;AAOhE,MAAM,WAAW,UAAU;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;CAClE;AAsCD,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,mBA8BlD;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM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C,CAAC;CACnC,CAAC;AACF,wBAAsB,cAAc,IAAI,OAAO,CAAC,UAAU,CAAC,CA2B1D;AAiGD,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;oBA6CqB,CAAC;AAEnC,eAAe,OAAO,CAAC"}
|
package/types/sync.d.ts
CHANGED
|
@@ -36,10 +36,11 @@ export declare function readDirRecursiveWithIgnore(ignore: (path: string, isDire
|
|
|
36
36
|
export declare function elementsToMap(els: DynFSElement, ignore: (path: string, isDirectory: boolean) => boolean, json: boolean, skips: Skips): Promise<{
|
|
37
37
|
[key: string]: string;
|
|
38
38
|
}>;
|
|
39
|
-
interface Skips {
|
|
39
|
+
export interface Skips {
|
|
40
40
|
skipVariables?: boolean | undefined;
|
|
41
41
|
skipResources?: boolean | undefined;
|
|
42
42
|
skipSecrets?: boolean | undefined;
|
|
43
|
+
skipScriptsMetadata?: boolean | undefined;
|
|
43
44
|
includeSchedules?: boolean | undefined;
|
|
44
45
|
includeUsers?: boolean | undefined;
|
|
45
46
|
includeGroups?: boolean | undefined;
|
|
@@ -55,14 +56,6 @@ export declare function ignoreF(wmillconf: {
|
|
|
55
56
|
export declare function pull(opts: GlobalOptions & SyncOptions): Promise<void>;
|
|
56
57
|
export declare function push(opts: GlobalOptions & SyncOptions): Promise<void>;
|
|
57
58
|
declare const command: Command<void, void, {
|
|
58
|
-
failConflicts?: true | undefined;
|
|
59
|
-
} & {
|
|
60
|
-
raw?: true | undefined;
|
|
61
|
-
} & {
|
|
62
|
-
stateful?: true | undefined;
|
|
63
|
-
} & {
|
|
64
|
-
skipPull?: true | undefined;
|
|
65
|
-
} & {
|
|
66
59
|
yes?: true | undefined;
|
|
67
60
|
} & {
|
|
68
61
|
plainSecrets?: true | undefined;
|
package/types/sync.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,OAAO,EAUR,MAAM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