@poli-page/cli 0.11.0 → 0.13.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 +141 -40
- package/dist/api-client.d.ts +85 -8
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +157 -4
- package/dist/api-client.js.map +1 -1
- package/dist/cloud-context.d.ts +1 -1
- package/dist/cloud-context.js +1 -1
- package/dist/commands/auth.d.ts +4 -0
- package/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/auth.js +6 -2
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/clone.d.ts +32 -0
- package/dist/commands/clone.d.ts.map +1 -0
- package/dist/commands/clone.js +266 -0
- package/dist/commands/clone.js.map +1 -0
- package/dist/commands/dev.d.ts +57 -4
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +318 -46
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/env.d.ts.map +1 -1
- package/dist/commands/env.js +11 -4
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +14 -9
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/link.d.ts +41 -2
- package/dist/commands/link.d.ts.map +1 -1
- package/dist/commands/link.js +107 -16
- package/dist/commands/link.js.map +1 -1
- package/dist/commands/new.d.ts.map +1 -1
- package/dist/commands/new.js +1 -7
- package/dist/commands/new.js.map +1 -1
- package/dist/commands/publish.js +2 -2
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/sync.d.ts +52 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +224 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -0
- package/dist/constants.js.map +1 -1
- package/dist/credentials.d.ts +6 -1
- package/dist/credentials.d.ts.map +1 -1
- package/dist/credentials.js +28 -10
- package/dist/credentials.js.map +1 -1
- package/dist/dev-page.d.ts.map +1 -1
- package/dist/dev-page.js +24 -0
- package/dist/dev-page.js.map +1 -1
- package/dist/draft-bases.d.ts +54 -0
- package/dist/draft-bases.d.ts.map +1 -0
- package/dist/draft-bases.js +253 -0
- package/dist/draft-bases.js.map +1 -0
- package/dist/draft-files.d.ts +96 -0
- package/dist/draft-files.d.ts.map +1 -0
- package/dist/draft-files.js +447 -0
- package/dist/draft-files.js.map +1 -0
- package/dist/exit-codes.d.ts +4 -3
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +9 -5
- package/dist/exit-codes.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +6 -3
- package/dist/program.js.map +1 -1
- package/dist/project-files.d.ts +8 -1
- package/dist/project-files.d.ts.map +1 -1
- package/dist/project-files.js +22 -1
- package/dist/project-files.js.map +1 -1
- package/dist/project-sync.d.ts +88 -16
- package/dist/project-sync.d.ts.map +1 -1
- package/dist/project-sync.js +283 -46
- package/dist/project-sync.js.map +1 -1
- package/dist/slug.d.ts +8 -0
- package/dist/slug.d.ts.map +1 -0
- package/dist/slug.js +15 -0
- package/dist/slug.js.map +1 -0
- package/dist/sync-engine.d.ts +14 -9
- package/dist/sync-engine.d.ts.map +1 -1
- package/dist/sync-engine.js +26 -29
- package/dist/sync-engine.js.map +1 -1
- package/package.json +1 -1
- package/dist/commands/watch.d.ts +0 -29
- package/dist/commands/watch.d.ts.map +0 -1
- package/dist/commands/watch.js +0 -108
- package/dist/commands/watch.js.map +0 -1
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { lstat, readFile, unlink } from 'node:fs/promises';
|
|
3
|
+
import { MANIFEST_FILENAME } from './constants.js';
|
|
4
|
+
import { manifestsEquivalent, readPending, updateBases, writeBases, } from './draft-bases.js';
|
|
5
|
+
import { ExitCode } from './exit-codes.js';
|
|
6
|
+
import { oneLine } from './output.js';
|
|
7
|
+
import { isAcceptedProjectPath, isPortableProjectPath, projectFileEncoding, } from './project-files.js';
|
|
8
|
+
import { readSyncableFiles } from './project-sync.js';
|
|
9
|
+
import { assertSafeRelativePath, resolveInside, resolveWritable, safeWriteFile, } from './security/paths.js';
|
|
10
|
+
import { hashContent } from './sync-engine.js';
|
|
11
|
+
/** A draft file that could not be downloaded as listed. Names the path, never the URL. */
|
|
12
|
+
export class DownloadError extends Error {
|
|
13
|
+
exitCode = ExitCode.NETWORK_OR_API_ERROR;
|
|
14
|
+
}
|
|
15
|
+
/** A draft listing the CLI refuses to write: an unsafe path, or over the clone caps. */
|
|
16
|
+
export class DraftListingError extends Error {
|
|
17
|
+
exitCode = ExitCode.NETWORK_OR_API_ERROR;
|
|
18
|
+
}
|
|
19
|
+
/** The API's cap on the files of one project. */
|
|
20
|
+
export const MAX_CLONE_FILES = 1000;
|
|
21
|
+
/** What one clone holds in memory before it writes anything. */
|
|
22
|
+
export const MAX_CLONE_BYTES = 20 * 1024 * 1024;
|
|
23
|
+
/**
|
|
24
|
+
* Per file, request and body together. A file is at most 5 MiB: 60 s lets
|
|
25
|
+
* it through at about 700 kbit/s, and still ends a stalled transfer well
|
|
26
|
+
* before the listing's URLs (valid at least 15 minutes) expire.
|
|
27
|
+
*/
|
|
28
|
+
const DOWNLOAD_TIMEOUT_MS = 60_000;
|
|
29
|
+
export function sha256Hex(bytes) {
|
|
30
|
+
return createHash('sha256').update(bytes).digest('hex');
|
|
31
|
+
}
|
|
32
|
+
function quote(path) {
|
|
33
|
+
return JSON.stringify(oneLine(path));
|
|
34
|
+
}
|
|
35
|
+
function downloadError(path, reason) {
|
|
36
|
+
return new DownloadError(`Could not download ${quote(path)}: ${reason}.`);
|
|
37
|
+
}
|
|
38
|
+
async function fetchVerified(file, url, fetchFn) {
|
|
39
|
+
let response;
|
|
40
|
+
try {
|
|
41
|
+
// Presigned: the URL is the credential, so no Authorization header,
|
|
42
|
+
// and no redirect that could take the request elsewhere.
|
|
43
|
+
response = await fetchFn(url, {
|
|
44
|
+
redirect: 'error',
|
|
45
|
+
signal: AbortSignal.timeout(DOWNLOAD_TIMEOUT_MS),
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
// The error may quote the URL: never pass it on.
|
|
50
|
+
throw downloadError(file.path, 'the request failed');
|
|
51
|
+
}
|
|
52
|
+
if (response.status === 403) {
|
|
53
|
+
await response.body?.cancel().catch(() => { });
|
|
54
|
+
return { forbidden: true };
|
|
55
|
+
}
|
|
56
|
+
if (!response.ok) {
|
|
57
|
+
await response.body?.cancel().catch(() => { });
|
|
58
|
+
throw downloadError(file.path, `the storage answered HTTP ${response.status}`);
|
|
59
|
+
}
|
|
60
|
+
const chunks = [];
|
|
61
|
+
let total = 0;
|
|
62
|
+
if (response.body) {
|
|
63
|
+
const reader = response.body.getReader();
|
|
64
|
+
try {
|
|
65
|
+
for (;;) {
|
|
66
|
+
const { done, value } = await reader.read();
|
|
67
|
+
if (done)
|
|
68
|
+
break;
|
|
69
|
+
total += value.byteLength;
|
|
70
|
+
if (total > file.size) {
|
|
71
|
+
await reader.cancel().catch(() => { });
|
|
72
|
+
throw downloadError(file.path, 'it is larger than listed');
|
|
73
|
+
}
|
|
74
|
+
chunks.push(value);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
catch (err) {
|
|
78
|
+
if (err instanceof DownloadError)
|
|
79
|
+
throw err;
|
|
80
|
+
throw downloadError(file.path, 'the transfer failed');
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const bytes = Buffer.concat(chunks, total);
|
|
84
|
+
if (bytes.length !== file.size)
|
|
85
|
+
throw downloadError(file.path, 'it is smaller than listed');
|
|
86
|
+
if (sha256Hex(bytes) !== file.sha256) {
|
|
87
|
+
throw downloadError(file.path, 'its content does not match the listed hash');
|
|
88
|
+
}
|
|
89
|
+
return { bytes };
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Downloads one listed file and checks its size and SHA-256 against the
|
|
93
|
+
* listing, reading at most `file.size` bytes. A `403` (the presigned URL
|
|
94
|
+
* expired) lists the draft again once and retries with the new URL; the
|
|
95
|
+
* bytes must still match the original listing, so a file changed in the
|
|
96
|
+
* meantime fails rather than mixing two states of the draft.
|
|
97
|
+
*/
|
|
98
|
+
export async function downloadDraftFile(file, relist, fetchFn = fetch) {
|
|
99
|
+
const first = await fetchVerified(file, file.url, fetchFn);
|
|
100
|
+
if ('bytes' in first)
|
|
101
|
+
return first.bytes;
|
|
102
|
+
let fresh;
|
|
103
|
+
try {
|
|
104
|
+
fresh = (await relist()).find((f) => f.path === file.path);
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
throw downloadError(file.path, 'access was refused and the draft could not be listed again');
|
|
108
|
+
}
|
|
109
|
+
if (!fresh)
|
|
110
|
+
throw downloadError(file.path, 'it is no longer in the draft');
|
|
111
|
+
if (fresh.sha256 !== file.sha256 || fresh.size !== file.size) {
|
|
112
|
+
throw downloadError(file.path, 'it changed in the cloud during the download; try again');
|
|
113
|
+
}
|
|
114
|
+
const second = await fetchVerified(file, fresh.url, fetchFn);
|
|
115
|
+
if ('bytes' in second)
|
|
116
|
+
return second.bytes;
|
|
117
|
+
throw downloadError(file.path, 'access was refused');
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Throws unless every listed path is one the CLI may write on any OS, and
|
|
121
|
+
* the listing fits the clone caps. Checked as a whole before any download:
|
|
122
|
+
* the paths come from the server and are untrusted.
|
|
123
|
+
*/
|
|
124
|
+
export function checkDraftListing(files) {
|
|
125
|
+
if (files.length > MAX_CLONE_FILES) {
|
|
126
|
+
throw new DraftListingError(`The draft lists ${files.length} files, over the limit of ${MAX_CLONE_FILES}.`);
|
|
127
|
+
}
|
|
128
|
+
const total = files.reduce((sum, f) => sum + f.size, 0);
|
|
129
|
+
if (total > MAX_CLONE_BYTES) {
|
|
130
|
+
throw new DraftListingError('The draft is larger than 20 MiB, the most a clone downloads.');
|
|
131
|
+
}
|
|
132
|
+
const seen = new Set();
|
|
133
|
+
const folders = new Set();
|
|
134
|
+
for (const { path } of files) {
|
|
135
|
+
let safe = isAcceptedProjectPath(path) && isPortableProjectPath(path);
|
|
136
|
+
if (safe) {
|
|
137
|
+
try {
|
|
138
|
+
assertSafeRelativePath(path);
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
safe = false;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (!safe) {
|
|
145
|
+
throw new DraftListingError(`The draft has a file this CLI will not write: ${quote(path)}. Rename it in the editor, then clone again.`);
|
|
146
|
+
}
|
|
147
|
+
// Two paths one file system may treat as one (case, Unicode form).
|
|
148
|
+
const key = path.normalize('NFC').toLowerCase();
|
|
149
|
+
if (seen.has(key)) {
|
|
150
|
+
throw new DraftListingError(`The draft lists ${quote(path)} more than once, or with another letter case.`);
|
|
151
|
+
}
|
|
152
|
+
seen.add(key);
|
|
153
|
+
const segments = key.split('/');
|
|
154
|
+
for (let i = 1; i < segments.length; i++)
|
|
155
|
+
folders.add(segments.slice(0, i).join('/'));
|
|
156
|
+
}
|
|
157
|
+
for (const { path } of files) {
|
|
158
|
+
if (folders.has(path.normalize('NFC').toLowerCase())) {
|
|
159
|
+
throw new DraftListingError(`The draft lists ${quote(path)} both as a file and as a folder.`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/** How many downloads run at once. */
|
|
164
|
+
const DOWNLOAD_CONCURRENCY = 6;
|
|
165
|
+
/**
|
|
166
|
+
* Downloads every listed file into memory, `DOWNLOAD_CONCURRENCY` at a
|
|
167
|
+
* time; the first failure fails the whole. `list` is called at most once
|
|
168
|
+
* more, shared by every file that meets a `403`.
|
|
169
|
+
*/
|
|
170
|
+
export async function downloadDraft(files, list, fetchFn = fetch) {
|
|
171
|
+
let relisted;
|
|
172
|
+
const relist = () => (relisted ??= list());
|
|
173
|
+
const out = new Map();
|
|
174
|
+
let next = 0;
|
|
175
|
+
let failed = false;
|
|
176
|
+
const worker = async () => {
|
|
177
|
+
while (!failed && next < files.length) {
|
|
178
|
+
const file = files[next++];
|
|
179
|
+
try {
|
|
180
|
+
out.set(file.path, await downloadDraftFile(file, relist, fetchFn));
|
|
181
|
+
}
|
|
182
|
+
catch (err) {
|
|
183
|
+
failed = true;
|
|
184
|
+
throw err;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
await Promise.all(Array.from({ length: Math.min(DOWNLOAD_CONCURRENCY, files.length) }, worker));
|
|
189
|
+
return out;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* A path from the server the sync may compare, write or delete: in the
|
|
193
|
+
* file set and portable, as the sync's own files are. Every write or
|
|
194
|
+
* delete still goes through `resolveInside` / `resolveWritable`.
|
|
195
|
+
*/
|
|
196
|
+
function isSyncablePath(path) {
|
|
197
|
+
return isAcceptedProjectPath(path) && isPortableProjectPath(path);
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* The hash the sync will see for `bytes` once they are on disk at `path`:
|
|
201
|
+
* a text file is read as UTF-8, so bytes that are not valid UTF-8 hash
|
|
202
|
+
* differently from the draft's.
|
|
203
|
+
*/
|
|
204
|
+
export function localHashOf(path, bytes) {
|
|
205
|
+
const encoding = projectFileEncoding(path);
|
|
206
|
+
return hashContent({
|
|
207
|
+
encoding,
|
|
208
|
+
content: bytes.toString(encoding === 'base64' ? 'base64' : 'utf-8'),
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
function byPath(a, b) {
|
|
212
|
+
return a.path < b.path ? -1 : a.path > b.path ? 1 : 0;
|
|
213
|
+
}
|
|
214
|
+
/** `true` when the draft's manifest `file` stores the same as the local `content`. */
|
|
215
|
+
async function sameManifest(file, content, relist) {
|
|
216
|
+
const bytes = await downloadDraftFile(file, relist);
|
|
217
|
+
return manifestsEquivalent(content, bytes.toString('utf-8'));
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* First agreement of a folder that has no bases with the cloud draft
|
|
221
|
+
* (a folder linked by an older CLI, `poli link --existing`, `poli init
|
|
222
|
+
* --starter`). A local file with the draft's hash, or a manifest that
|
|
223
|
+
* stores the same, gets that base; a file only the folder has stays
|
|
224
|
+
* unbased (sent later with base `null`); a file that differs, or one only
|
|
225
|
+
* the draft has, is a conflict. Records the bases and the conflicts (as
|
|
226
|
+
* pending, so a later process still finds them), sends nothing, and
|
|
227
|
+
* returns the conflicts sorted by path.
|
|
228
|
+
*/
|
|
229
|
+
export async function reconcileDraft(ctx, cwd, client, homeDir) {
|
|
230
|
+
// Local first: a file set over the limits fails before any request.
|
|
231
|
+
const local = await readSyncableFiles(cwd);
|
|
232
|
+
const list = () => client.listDraftFiles(ctx.session, ctx.orgId, ctx.projectId);
|
|
233
|
+
const listing = await list();
|
|
234
|
+
const bases = {};
|
|
235
|
+
const conflicts = [];
|
|
236
|
+
for (const file of listing) {
|
|
237
|
+
// A path this CLI would never write is not this folder's to settle.
|
|
238
|
+
if (!isSyncablePath(file.path))
|
|
239
|
+
continue;
|
|
240
|
+
const hash = local.hashes.get(file.path);
|
|
241
|
+
const same = hash !== undefined &&
|
|
242
|
+
(hash === file.sha256 ||
|
|
243
|
+
(file.path === MANIFEST_FILENAME &&
|
|
244
|
+
(await sameManifest(file, local.contents.get(file.path), list))));
|
|
245
|
+
if (same)
|
|
246
|
+
bases[file.path] = { server: file.sha256, local: hash };
|
|
247
|
+
else
|
|
248
|
+
conflicts.push({ path: file.path, remoteSha256: file.sha256 });
|
|
249
|
+
}
|
|
250
|
+
conflicts.sort(byPath);
|
|
251
|
+
const pending = conflicts.map((c) => ({
|
|
252
|
+
...c,
|
|
253
|
+
localSha256: local.hashes.get(c.path) ?? null,
|
|
254
|
+
reconciled: true,
|
|
255
|
+
}));
|
|
256
|
+
await writeBases(cwd, ctx.projectId, bases, homeDir, pending);
|
|
257
|
+
return conflicts;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Settles, without asking, the conflicts of a refused sync that are not
|
|
261
|
+
* one (decision: same bytes are the same file): the draft already holds the
|
|
262
|
+
* local bytes (a sync whose answer was lost), the manifest stores the same,
|
|
263
|
+
* or the file is gone on both sides. Records their bases and returns the
|
|
264
|
+
* others.
|
|
265
|
+
*/
|
|
266
|
+
export async function settleConflicts(ctx, cwd, client, conflicts, local, homeDir) {
|
|
267
|
+
const list = () => client.listDraftFiles(ctx.session, ctx.orgId, ctx.projectId);
|
|
268
|
+
let listing;
|
|
269
|
+
const set = {};
|
|
270
|
+
const remove = [];
|
|
271
|
+
const left = [];
|
|
272
|
+
for (const conflict of conflicts) {
|
|
273
|
+
const hash = local.hashes.get(conflict.path);
|
|
274
|
+
if (conflict.remoteSha256 === null && hash === undefined) {
|
|
275
|
+
remove.push(conflict.path);
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
if (hash !== undefined && conflict.remoteSha256 === hash) {
|
|
279
|
+
set[conflict.path] = { server: hash, local: hash };
|
|
280
|
+
continue;
|
|
281
|
+
}
|
|
282
|
+
if (conflict.path === MANIFEST_FILENAME && hash !== undefined) {
|
|
283
|
+
const file = (await (listing ??= list())).find((f) => f.path === conflict.path && f.sha256 === conflict.remoteSha256);
|
|
284
|
+
if (file && (await sameManifest(file, local.contents.get(file.path), list))) {
|
|
285
|
+
set[file.path] = { server: file.sha256, local: hash };
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
left.push(conflict);
|
|
290
|
+
}
|
|
291
|
+
if (Object.keys(set).length > 0 || remove.length > 0) {
|
|
292
|
+
await updateBases(cwd, ctx.projectId, { set, remove, removePending: [...Object.keys(set), ...remove] }, homeDir);
|
|
293
|
+
}
|
|
294
|
+
return left;
|
|
295
|
+
}
|
|
296
|
+
function isRecord(value) {
|
|
297
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
298
|
+
}
|
|
299
|
+
const PAGINATION_KEYS = ['orphanThreshold', 'cssRenderingPrecision'];
|
|
300
|
+
/**
|
|
301
|
+
* The local manifest with the fields the API stores (`manifestProjection`)
|
|
302
|
+
* taken from the cloud's: `cloud` and every other key stay as they are.
|
|
303
|
+
*/
|
|
304
|
+
function mergeCloudManifest(localText, serverText) {
|
|
305
|
+
let server;
|
|
306
|
+
try {
|
|
307
|
+
server = JSON.parse(serverText);
|
|
308
|
+
}
|
|
309
|
+
catch {
|
|
310
|
+
server = undefined;
|
|
311
|
+
}
|
|
312
|
+
if (!isRecord(server)) {
|
|
313
|
+
throw new DownloadError(`The cloud's ${MANIFEST_FILENAME} is not a JSON object.`);
|
|
314
|
+
}
|
|
315
|
+
let local;
|
|
316
|
+
try {
|
|
317
|
+
local = localText === null ? undefined : JSON.parse(localText);
|
|
318
|
+
}
|
|
319
|
+
catch {
|
|
320
|
+
local = undefined;
|
|
321
|
+
}
|
|
322
|
+
const out = isRecord(local) ? { ...local } : {};
|
|
323
|
+
const project = isRecord(out.project) ? { ...out.project } : {};
|
|
324
|
+
const name = isRecord(server.project) ? server.project.name : undefined;
|
|
325
|
+
if (name === undefined)
|
|
326
|
+
delete project.name;
|
|
327
|
+
else
|
|
328
|
+
project.name = name;
|
|
329
|
+
out.project = project;
|
|
330
|
+
const engine = isRecord(out.engine) ? { ...out.engine } : {};
|
|
331
|
+
const pagination = isRecord(engine.paginationOptions) ? { ...engine.paginationOptions } : {};
|
|
332
|
+
const serverEngine = isRecord(server.engine) ? server.engine : {};
|
|
333
|
+
const serverPagination = isRecord(serverEngine.paginationOptions)
|
|
334
|
+
? serverEngine.paginationOptions
|
|
335
|
+
: {};
|
|
336
|
+
for (const key of PAGINATION_KEYS) {
|
|
337
|
+
if (serverPagination[key] === undefined)
|
|
338
|
+
delete pagination[key];
|
|
339
|
+
else
|
|
340
|
+
pagination[key] = serverPagination[key];
|
|
341
|
+
}
|
|
342
|
+
if (Object.keys(pagination).length > 0)
|
|
343
|
+
engine.paginationOptions = pagination;
|
|
344
|
+
else
|
|
345
|
+
delete engine.paginationOptions;
|
|
346
|
+
if (Object.keys(engine).length > 0)
|
|
347
|
+
out.engine = engine;
|
|
348
|
+
else
|
|
349
|
+
delete out.engine;
|
|
350
|
+
for (const key of ['fonts', 'templates']) {
|
|
351
|
+
if (Array.isArray(server[key]))
|
|
352
|
+
out[key] = server[key];
|
|
353
|
+
else
|
|
354
|
+
delete out[key];
|
|
355
|
+
}
|
|
356
|
+
return JSON.stringify(out, null, '\t') + '\n';
|
|
357
|
+
}
|
|
358
|
+
async function readLocalText(cwd, path) {
|
|
359
|
+
try {
|
|
360
|
+
return await readFile(await resolveWritable(cwd, path), 'utf-8');
|
|
361
|
+
}
|
|
362
|
+
catch (err) {
|
|
363
|
+
if (err.code === 'ENOENT')
|
|
364
|
+
return null;
|
|
365
|
+
throw err;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
/** Deletes a regular file of the project; a symlink or anything else at `path` is left alone. */
|
|
369
|
+
async function removeLocalFile(cwd, path) {
|
|
370
|
+
const target = await resolveInside(cwd, path);
|
|
371
|
+
const stats = await lstat(target).catch(() => null);
|
|
372
|
+
if (stats?.isFile())
|
|
373
|
+
await unlink(target);
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Applies the user's choice to each conflict and records both hashes:
|
|
377
|
+
*
|
|
378
|
+
* - `mine`: the draft's current hash becomes the base, so the next sync
|
|
379
|
+
* sends the local file over it (or, `null`, sends it as new).
|
|
380
|
+
* - `theirs`: the draft is listed afresh; a file whose hash moved again
|
|
381
|
+
* since the conflict, or whose local file changed since then, is not
|
|
382
|
+
* written and comes back as still in conflict. Otherwise the verified
|
|
383
|
+
* download replaces the local file (the manifest keeps `cloud` and its
|
|
384
|
+
* client-only keys), or, `null`, the local file is deleted.
|
|
385
|
+
*
|
|
386
|
+
* Resolved paths leave the folder's pending conflicts. A folder with no
|
|
387
|
+
* entry in the store (never reconciled, or forgotten) is left untouched:
|
|
388
|
+
* every resolution comes back as still open, and the next sync reconciles.
|
|
389
|
+
*
|
|
390
|
+
* Returns the conflicts still open, with the draft's current hash.
|
|
391
|
+
*/
|
|
392
|
+
export async function resolveConflicts(ctx, cwd, client, resolutions, homeDir) {
|
|
393
|
+
for (const { path } of resolutions) {
|
|
394
|
+
if (!isSyncablePath(path)) {
|
|
395
|
+
throw new DraftListingError(`This CLI will not write ${quote(path)}.`);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
const pending = await readPending(cwd, ctx.projectId, homeDir);
|
|
399
|
+
if (!pending)
|
|
400
|
+
return resolutions.map(({ path, remoteSha256 }) => ({ path, remoteSha256 }));
|
|
401
|
+
const atConflict = new Map(pending.map((p) => [p.path, p]));
|
|
402
|
+
const list = () => client.listDraftFiles(ctx.session, ctx.orgId, ctx.projectId);
|
|
403
|
+
let fresh;
|
|
404
|
+
let local;
|
|
405
|
+
const set = {};
|
|
406
|
+
const remove = [];
|
|
407
|
+
const left = [];
|
|
408
|
+
for (const { path, choice, remoteSha256 } of resolutions) {
|
|
409
|
+
if (choice === 'mine') {
|
|
410
|
+
if (remoteSha256 === null)
|
|
411
|
+
remove.push(path);
|
|
412
|
+
// `local` is set to the draft's hash too: unless the local bytes
|
|
413
|
+
// are the draft's, it differs from them, so the next sync sends
|
|
414
|
+
// the file, with the draft's hash as its base.
|
|
415
|
+
else
|
|
416
|
+
set[path] = { server: remoteSha256, local: remoteSha256 };
|
|
417
|
+
continue;
|
|
418
|
+
}
|
|
419
|
+
fresh ??= new Map((await list()).map((f) => [f.path, f]));
|
|
420
|
+
local ??= await readSyncableFiles(cwd);
|
|
421
|
+
const now = fresh.get(path);
|
|
422
|
+
const localNow = local.hashes.get(path) ?? null;
|
|
423
|
+
const localThen = atConflict.get(path)?.localSha256;
|
|
424
|
+
// Either side moved since the user saw the conflict: taking the
|
|
425
|
+
// draft's now would drop a change they never saw.
|
|
426
|
+
if ((now?.sha256 ?? null) !== remoteSha256 ||
|
|
427
|
+
(localThen !== undefined && localThen !== localNow)) {
|
|
428
|
+
left.push({ path, remoteSha256: now?.sha256 ?? null, localSha256: localNow });
|
|
429
|
+
continue;
|
|
430
|
+
}
|
|
431
|
+
if (!now) {
|
|
432
|
+
await removeLocalFile(cwd, path);
|
|
433
|
+
remove.push(path);
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
const bytes = await downloadDraftFile(now, list);
|
|
437
|
+
const written = path === MANIFEST_FILENAME
|
|
438
|
+
? Buffer.from(mergeCloudManifest(await readLocalText(cwd, path), bytes.toString('utf-8')))
|
|
439
|
+
: bytes;
|
|
440
|
+
await safeWriteFile(cwd, path, written);
|
|
441
|
+
set[path] = { server: now.sha256, local: localHashOf(path, written) };
|
|
442
|
+
}
|
|
443
|
+
const resolved = resolutions.map((r) => r.path).filter((p) => !left.some((l) => l.path === p));
|
|
444
|
+
await updateBases(cwd, ctx.projectId, { set, remove, removePending: resolved, addPending: left }, homeDir);
|
|
445
|
+
return left.map(({ path, remoteSha256 }) => ({ path, remoteSha256 }));
|
|
446
|
+
}
|
|
447
|
+
//# sourceMappingURL=draft-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft-files.js","sourceRoot":"","sources":["../src/draft-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACN,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,UAAU,GAGV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EACN,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAsB,MAAM,mBAAmB,CAAC;AAC1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,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,EAC1D,OAAO,CACP,CAAC;IACF,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;AACvE,CAAC"}
|
package/dist/exit-codes.d.ts
CHANGED
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
* - SUCCESS (0) is the default; `process.exitCode` does not need to be
|
|
9
9
|
* set explicitly when a command returns normally.
|
|
10
10
|
* - INCONSISTENT (1) is used for recoverable user errors where the
|
|
11
|
-
* current state already satisfies the request (e.g. already
|
|
12
|
-
* already linked).
|
|
11
|
+
* current state already satisfies the request (e.g. already linked).
|
|
13
12
|
*/
|
|
14
13
|
export declare const ExitCode: {
|
|
15
14
|
readonly SUCCESS: 0;
|
|
@@ -19,6 +18,8 @@ export declare const ExitCode: {
|
|
|
19
18
|
readonly NOT_AUTHENTICATED: 4;
|
|
20
19
|
readonly NOT_AUTHORIZED: 5;
|
|
21
20
|
readonly INVALID_LOCAL_STATE: 6;
|
|
21
|
+
/** A sync refused for files someone else changed, still unresolved. */
|
|
22
|
+
readonly CONFLICT: 7;
|
|
22
23
|
};
|
|
23
24
|
export type ExitCodeValue = (typeof ExitCode)[keyof typeof ExitCode];
|
|
24
25
|
/** Bad arguments or flags: exits with INVALID_USAGE through `errorToExitCode`. */
|
|
@@ -30,7 +31,7 @@ export declare class UsageError extends Error {
|
|
|
30
31
|
* catch blocks instead of hardcoding `process.exitCode = 1`.
|
|
31
32
|
*
|
|
32
33
|
* Honours an explicit `exitCode` property on the error if present (used
|
|
33
|
-
* by sentinels like
|
|
34
|
+
* by sentinels like UsageError).
|
|
34
35
|
*/
|
|
35
36
|
export declare function errorToExitCode(err: unknown): ExitCodeValue;
|
|
36
37
|
//# sourceMappingURL=exit-codes.d.ts.map
|
package/dist/exit-codes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exit-codes.d.ts","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"exit-codes.d.ts","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,QAAQ;;;;;;;;IAQpB,uEAAuE;;CAE9D,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAErE,kFAAkF;AAClF,qBAAa,UAAW,SAAQ,KAAK;IACpC,QAAQ,CAAC,QAAQ,IAA0B;CAC3C;AA2BD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,aAAa,CAsE3D"}
|
package/dist/exit-codes.js
CHANGED
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
* - SUCCESS (0) is the default; `process.exitCode` does not need to be
|
|
9
9
|
* set explicitly when a command returns normally.
|
|
10
10
|
* - INCONSISTENT (1) is used for recoverable user errors where the
|
|
11
|
-
* current state already satisfies the request (e.g. already
|
|
12
|
-
* already linked).
|
|
11
|
+
* current state already satisfies the request (e.g. already linked).
|
|
13
12
|
*/
|
|
14
13
|
export const ExitCode = {
|
|
15
14
|
SUCCESS: 0,
|
|
@@ -19,19 +18,21 @@ export const ExitCode = {
|
|
|
19
18
|
NOT_AUTHENTICATED: 4,
|
|
20
19
|
NOT_AUTHORIZED: 5,
|
|
21
20
|
INVALID_LOCAL_STATE: 6,
|
|
21
|
+
/** A sync refused for files someone else changed, still unresolved. */
|
|
22
|
+
CONFLICT: 7,
|
|
22
23
|
};
|
|
23
24
|
/** Bad arguments or flags: exits with INVALID_USAGE through `errorToExitCode`. */
|
|
24
25
|
export class UsageError extends Error {
|
|
25
26
|
exitCode = ExitCode.INVALID_USAGE;
|
|
26
27
|
}
|
|
27
|
-
import { ApiError, NotAMemberError, OrgCancelledError, OrgPaymentGraceError, OrgPurgedError, OrgMigratingError, ThumbnailsNotAvailableError, DocumentNotFoundError, DocumentGoneError, MissingOrgContextError, EnvironmentProtectedError, EnvironmentNotFoundError, UnsupportedFileTypeError, InsufficientRoleError, MissingApiKeyError, InvalidApiKeyError, ApiKeyExpiredError, ProjectOutOfScopeError, } from './api-client.js';
|
|
28
|
+
import { ApiError, NotAMemberError, OrgCancelledError, OrgPaymentGraceError, OrgPurgedError, OrgMigratingError, ThumbnailsNotAvailableError, DocumentNotFoundError, DocumentGoneError, MissingOrgContextError, EnvironmentProtectedError, EnvironmentNotFoundError, UnsupportedFileTypeError, InsufficientRoleError, MissingApiKeyError, InvalidApiKeyError, ApiKeyExpiredError, ProjectOutOfScopeError, ProjectNotFoundError, ProjectRoleRequiredError, ProjectAccessRequiresProError, } from './api-client.js';
|
|
28
29
|
import { ManifestValidationError } from './manifest.schema.js';
|
|
29
30
|
/**
|
|
30
31
|
* Map a thrown value to a CLI exit code. Use this in command handlers'
|
|
31
32
|
* catch blocks instead of hardcoding `process.exitCode = 1`.
|
|
32
33
|
*
|
|
33
34
|
* Honours an explicit `exitCode` property on the error if present (used
|
|
34
|
-
* by sentinels like
|
|
35
|
+
* by sentinels like UsageError).
|
|
35
36
|
*/
|
|
36
37
|
export function errorToExitCode(err) {
|
|
37
38
|
if (err && typeof err === 'object' && 'exitCode' in err) {
|
|
@@ -49,7 +50,9 @@ export function errorToExitCode(err) {
|
|
|
49
50
|
err instanceof OrgCancelledError ||
|
|
50
51
|
err instanceof OrgPurgedError ||
|
|
51
52
|
err instanceof ThumbnailsNotAvailableError ||
|
|
52
|
-
err instanceof ProjectOutOfScopeError
|
|
53
|
+
err instanceof ProjectOutOfScopeError ||
|
|
54
|
+
err instanceof ProjectRoleRequiredError ||
|
|
55
|
+
err instanceof ProjectAccessRequiresProError) {
|
|
53
56
|
return ExitCode.NOT_AUTHORIZED;
|
|
54
57
|
}
|
|
55
58
|
// Local state — manifest missing or invalid, project not linked, etc.
|
|
@@ -68,6 +71,7 @@ export function errorToExitCode(err) {
|
|
|
68
71
|
// Invalid usage — bad args, format errors, validation failures.
|
|
69
72
|
if (err instanceof MissingOrgContextError ||
|
|
70
73
|
err instanceof DocumentNotFoundError ||
|
|
74
|
+
err instanceof ProjectNotFoundError ||
|
|
71
75
|
err instanceof EnvironmentNotFoundError ||
|
|
72
76
|
err instanceof UnsupportedFileTypeError ||
|
|
73
77
|
/Template .+ not found|template not found|Missing <documentId>/i.test(err.message)) {
|
package/dist/exit-codes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exit-codes.js","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"exit-codes.js","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACvB,OAAO,EAAE,CAAC;IACV,YAAY,EAAE,CAAC;IACf,aAAa,EAAE,CAAC;IAChB,oBAAoB,EAAE,CAAC;IACvB,iBAAiB,EAAE,CAAC;IACpB,cAAc,EAAE,CAAC;IACjB,mBAAmB,EAAE,CAAC;IACtB,uEAAuE;IACvE,QAAQ,EAAE,CAAC;CACF,CAAC;AAIX,kFAAkF;AAClF,MAAM,OAAO,UAAW,SAAQ,KAAK;IAC3B,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC;CAC3C;AAED,OAAO,EACN,QAAQ,EACR,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,iBAAiB,EACjB,2BAA2B,EAC3B,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,oB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ED,gEAAgE;QAChE,IACC,GAAG,YAAY,sBAAsB;YACrC,GAAG,YAAY,qBAAqB;YACpC,GAAG,YAAY,oBAAoB;YACnC,GAAG,YAAY,wBAAwB;YACvC,GAAG,YAAY,wBAAwB;YACvC,gEAAgE,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EACjF,CAAC;YACF,OAAO,QAAQ,CAAC,aAAa,CAAC;QAC/B,CAAC;QAED,sDAAsD;QACtD,IAAI,GAAG,YAAY,QAAQ,IAAI,GAAG,YAAY,iBAAiB,EAAE,CAAC;YACjE,OAAO,QAAQ,CAAC,oBAAoB,CAAC;QACtC,CAAC;QAED,mEAAmE;QACnE,4BAA4B;QAC5B,IAAI,GAAG,YAAY,iBAAiB,EAAE,CAAC;YACtC,OAAO,QAAQ,CAAC,oBAAoB,CAAC;QACtC,CAAC;IACF,CAAC;IAED,OAAO,QAAQ,CAAC,YAAY,CAAC;AAC9B,CAAC"}
|
package/dist/program.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBpC,wBAAgB,aAAa,YAuD5B"}
|
package/dist/program.js
CHANGED
|
@@ -8,8 +8,9 @@ import { registerLinkCommands } from './commands/link.js';
|
|
|
8
8
|
import { registerPublishCommand } from './commands/publish.js';
|
|
9
9
|
import { registerEnvCommands } from './commands/env.js';
|
|
10
10
|
import { registerDocumentsCommands } from './commands/documents/index.js';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { registerDevCommand, registerRemovedWatchCommand } from './commands/dev.js';
|
|
12
|
+
import { registerCloneCommand } from './commands/clone.js';
|
|
13
|
+
import { registerSyncCommand } from './commands/sync.js';
|
|
13
14
|
import { readCredentials } from './credentials.js';
|
|
14
15
|
import { readManifest } from './manifest.js';
|
|
15
16
|
import { apiOrigin, DEFAULT_API_URL, setLoginApiUrl } from './api-origin.js';
|
|
@@ -61,11 +62,13 @@ export function createProgram() {
|
|
|
61
62
|
registerRenderCommand(program);
|
|
62
63
|
registerAuthCommands(program);
|
|
63
64
|
registerLinkCommands(program);
|
|
65
|
+
registerCloneCommand(program);
|
|
64
66
|
registerPublishCommand(program);
|
|
65
67
|
registerEnvCommands(program);
|
|
66
68
|
registerDocumentsCommands(program);
|
|
67
|
-
registerWatchCommand(program);
|
|
68
69
|
registerDevCommand(program);
|
|
70
|
+
registerRemovedWatchCommand(program);
|
|
71
|
+
registerSyncCommand(program);
|
|
69
72
|
return program;
|
|
70
73
|
}
|
|
71
74
|
/**
|
package/dist/program.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OA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AAY,EAAE,IAAI,EAAE,CAAC;IACxF,OAAO,CAAC,KAAK,CACZ,0BAA0B,WAAW,6EAA6E,CAClH,CAAC;IACF,OAAO,MAAM,CAAC;AACf,CAAC"}
|
package/dist/project-files.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ProjectFileEntry } from './api-client.js';
|
|
2
2
|
/**
|
|
3
|
-
* The project file set, shared by the draft sync (`poli
|
|
3
|
+
* The project file set, shared by the draft sync (`poli dev`)
|
|
4
4
|
* and `poli publish`. It mirrors the API's classifier: a path outside it is
|
|
5
5
|
* refused with `400 UNSUPPORTED_FILE_TYPE`, which fails the whole request, so
|
|
6
6
|
* the CLI leaves such files out instead of sending them.
|
|
@@ -19,6 +19,13 @@ export declare const IMAGE_EXTENSIONS: ReadonlySet<string>;
|
|
|
19
19
|
/** A file path inside `assets/images/` or `assets/icons/`, accepted or not. */
|
|
20
20
|
export declare function isImageFolderPath(path: string): boolean;
|
|
21
21
|
export declare function isAcceptedProjectPath(path: string): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* A path every OS can write as given: no leading `/`, no backslash, no `:`, no
|
|
24
|
+
* empty, `.` or `..` segment, no segment ending in `.` or a space (Windows
|
|
25
|
+
* drops those), no Windows device name (`con`, `nul`, `com1`...) before the
|
|
26
|
+
* first dot of a segment. Server-supplied paths must pass it before a write.
|
|
27
|
+
*/
|
|
28
|
+
export declare function isPortableProjectPath(path: string): boolean;
|
|
22
29
|
/**
|
|
23
30
|
* Everything under `assets/` (images, icons, fonts) is binary and travels as
|
|
24
31
|
* base64; the rest of the accepted set is text and travels as utf8.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-files.d.ts","sourceRoot":"","sources":["../src/project-files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGxD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,QAAoC,CAAC;AAGl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