@thallylabs/migrate 0.2.39 → 0.2.41
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 +104 -5
- package/dist/index.d.ts +10 -2
- package/dist/index.js +8574 -6482
- package/dist/index.js.map +1 -1
- package/dist/svg-policy.js +6 -0
- package/dist/svg-policy.js.map +1 -1
- package/dist/url-migration.d.ts +2 -2
- package/dist/url-migration.js +1825 -113
- package/dist/url-migration.js.map +1 -1
- package/dist/{url-run-BOZvcGs1.d.ts → url-run-mSKFqHx_.d.ts} +47 -3
- package/package.json +1 -1
|
@@ -28,6 +28,8 @@ interface MigrationCapturedAsset {
|
|
|
28
28
|
unavailable?: {
|
|
29
29
|
status: 404 | 410;
|
|
30
30
|
};
|
|
31
|
+
/** Original SVG digest when a trusted host supplied an inert PNG rendering. */
|
|
32
|
+
derivedFromSha256?: string;
|
|
31
33
|
}
|
|
32
34
|
interface MigrationCapture extends MigrationFetchResponse {
|
|
33
35
|
/** Capture adapters expand only safe read-only states; no forms or API actions. */
|
|
@@ -61,6 +63,12 @@ interface MigrationEvidence {
|
|
|
61
63
|
code: Array<string>;
|
|
62
64
|
anchors: Array<string>;
|
|
63
65
|
links: Array<string>;
|
|
66
|
+
/** Exact observed canonical/article equality proof; never inferred from query names. */
|
|
67
|
+
articleIdentity?: {
|
|
68
|
+
canonicalUrl: string;
|
|
69
|
+
articleSha256: string;
|
|
70
|
+
sectionAnchor?: string;
|
|
71
|
+
};
|
|
64
72
|
}
|
|
65
73
|
interface MigrationJournalAsset {
|
|
66
74
|
url: string;
|
|
@@ -69,6 +77,8 @@ interface MigrationJournalAsset {
|
|
|
69
77
|
sha256: string;
|
|
70
78
|
/** Base64 keeps checkpoints portable through JSON persistence. */
|
|
71
79
|
base64: string;
|
|
80
|
+
/** Binds an optional trusted SVG rasterization to the original source bytes. */
|
|
81
|
+
derivedFromSha256?: string;
|
|
72
82
|
}
|
|
73
83
|
interface UrlMigrationRecord {
|
|
74
84
|
url: string;
|
|
@@ -76,6 +86,8 @@ interface UrlMigrationRecord {
|
|
|
76
86
|
outcome: 'pending' | 'imported' | 'excluded' | 'failed' | 'alias';
|
|
77
87
|
reason?: string;
|
|
78
88
|
aliasOf?: string;
|
|
89
|
+
/** A proven query section is projected to its captured article anchor. */
|
|
90
|
+
aliasAnchor?: string;
|
|
79
91
|
/** Observed redirect destination; external pages are links, never captured articles. */
|
|
80
92
|
redirectTo?: string;
|
|
81
93
|
/** Publisher-declared Markdown representation of this exact same-origin article. */
|
|
@@ -145,6 +157,8 @@ interface UrlMigrationRunOptions {
|
|
|
145
157
|
fetcher?: MigrationFetcher;
|
|
146
158
|
/** Hosts that inject text fetching must also inject their safe binary boundary. */
|
|
147
159
|
assetFetcher?: (url: URL, signal?: AbortSignal) => Promise<MigrationCapturedAsset>;
|
|
160
|
+
/** Optional trusted, offline SVG renderer. Unsupported SVG stays rejected by default. */
|
|
161
|
+
rasterizeSvg?: (asset: MigrationCapturedAsset, signal?: AbortSignal) => Promise<MigrationCapturedAsset>;
|
|
148
162
|
captureProvider?: MigrationCaptureProvider;
|
|
149
163
|
/** Change this when browser/extraction policy changes; prevents stale reuse. */
|
|
150
164
|
captureVersion?: string;
|
|
@@ -181,6 +195,25 @@ interface MigrationApiGroup {
|
|
|
181
195
|
icon?: string;
|
|
182
196
|
pages: Array<string | MigrationApiGroup>;
|
|
183
197
|
}
|
|
198
|
+
/**
|
|
199
|
+
* Where an API tab sat in the source navigation, kept for the tab that lists its operations as pages: the tab as the projection
|
|
200
|
+
* built it (label, icon, presentation; no content) and the labels of the tabs before it, nearest first. Its API tab is not in
|
|
201
|
+
* `docsConfig.tabs` until the spec is bound (a remote spec only after its download), so the tab is put back after the first
|
|
202
|
+
* of those that is still there, or first when it had none.
|
|
203
|
+
*/
|
|
204
|
+
interface EndpointTabSlot {
|
|
205
|
+
tab: MigrationNavigationTab;
|
|
206
|
+
preceding: Array<string>;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* A spec whose `METHOD /path` operations docs.json lists, served by Mintlify as one generated page each at
|
|
210
|
+
* `/<directory>/<first tag>/<summary>`: they become pages of that tab rather than an API-bound tab's operations.
|
|
211
|
+
*/
|
|
212
|
+
interface EndpointPagesTarget {
|
|
213
|
+
/** Mintlify's output folder for the generated pages (no surrounding slashes); `api-reference`, Mintlify's default, when docs.json names none. */
|
|
214
|
+
directory: string;
|
|
215
|
+
slot?: EndpointTabSlot;
|
|
216
|
+
}
|
|
184
217
|
interface MigrationNavigationTab {
|
|
185
218
|
tab: string;
|
|
186
219
|
/** Reader-facing label when `tab` includes a version for unique identity. */
|
|
@@ -257,10 +290,14 @@ interface MigrationDocsConfig {
|
|
|
257
290
|
breadcrumbs?: boolean;
|
|
258
291
|
/** `path` shows the full group path above the title (Mintlify `styling.eyebrows: "breadcrumbs"`); the default shows the nearest group. */
|
|
259
292
|
eyebrow?: 'group' | 'path';
|
|
293
|
+
/** `true` renders straight quotes in prose as curly ones, as Mintlify does. */
|
|
294
|
+
smartQuotes?: boolean;
|
|
260
295
|
tabs: Array<MigrationNavigationTab>;
|
|
261
296
|
navigation?: {
|
|
262
297
|
/** How sibling documentation collections are presented to readers. */
|
|
263
298
|
display?: 'tabs' | 'dropdown';
|
|
299
|
+
/** `all` keeps the heading of a sidebar group named after its tab, as Mintlify does. */
|
|
300
|
+
groupHeadings?: 'all';
|
|
264
301
|
versions?: Array<{
|
|
265
302
|
label: string;
|
|
266
303
|
prefix: string;
|
|
@@ -400,13 +437,15 @@ interface MigrationPage {
|
|
|
400
437
|
icon?: string;
|
|
401
438
|
iconType?: 'regular' | 'solid' | 'outline' | 'brands';
|
|
402
439
|
description: string;
|
|
403
|
-
/** Keep SEO/search
|
|
404
|
-
descriptionPlacement?: 'body';
|
|
440
|
+
/** Keep the SEO/search summary while prose is already in the body, or comes from the bound operation. */
|
|
441
|
+
descriptionPlacement?: 'body' | 'operation';
|
|
405
442
|
badge?: string;
|
|
406
443
|
keywords: Array<string>;
|
|
407
444
|
mode?: 'default' | 'wide' | 'custom' | 'center' | 'home';
|
|
408
445
|
hidden?: boolean;
|
|
409
446
|
noindex?: boolean;
|
|
447
|
+
/** Mintlify frontmatter `url`: a web address the page's sidebar entry leaves for, which the page's own path redirects to. */
|
|
448
|
+
externalUrl?: string;
|
|
410
449
|
/**
|
|
411
450
|
* Reader access groups (frontmatter `groups`): trimmed, non-empty names the
|
|
412
451
|
* runtime matches exactly. The page needs a signed-in reader in one of them.
|
|
@@ -463,6 +502,8 @@ interface RemoteApiSpec {
|
|
|
463
502
|
groups?: Array<MigrationApiGroup>;
|
|
464
503
|
/** Every reference sharing the tab lists operations and none survives (all hidden or restricted): no endpoint navigation is generated for it. */
|
|
465
504
|
navigation?: false;
|
|
505
|
+
/** With `groups`: the listed operations become pages under this directory, in the tab's place, once the spec is downloaded. */
|
|
506
|
+
endpointPages?: EndpointPagesTarget;
|
|
466
507
|
/** Operation keys (`get /x`) only access-restricted pages document; marked `x-excluded` after download. */
|
|
467
508
|
withheldOperations?: Array<string>;
|
|
468
509
|
/** Operation keys published pages or docs.json also name; keeps a shared `$ref` path item public. */
|
|
@@ -480,11 +521,14 @@ interface MigrationBundle {
|
|
|
480
521
|
* Repository OpenAPI specs docs.json mounts under a `directory` (no surrounding slashes), with the tab each is bound to; the remote ones are in
|
|
481
522
|
* `remoteApiSpecs[].directories`. Present only alongside remote specs: a spec's id depends on which remote tabs bind ahead of it, so
|
|
482
523
|
* hydration links the local and remote mounts together once every download has settled, and the links stay as authored until then.
|
|
524
|
+
* `endpointOperations` marks a mount whose listed operations are already pages of the site (those operations, in listed order): its endpoint
|
|
525
|
+
* URLs are those pages, so nothing is redirected from them.
|
|
483
526
|
*/
|
|
484
527
|
localApiMounts?: Array<{
|
|
485
528
|
filename: string;
|
|
486
529
|
directory: string;
|
|
487
530
|
tab?: string;
|
|
531
|
+
endpointOperations?: Array<string>;
|
|
488
532
|
}>;
|
|
489
533
|
/** Customer-owned component source and registry; paths are repository-relative. */
|
|
490
534
|
componentFiles?: Array<RenderedMigrationFile>;
|
|
@@ -566,4 +610,4 @@ declare function validateUrlMigration(checkpoint: UrlMigrationCheckpoint, cancel
|
|
|
566
610
|
/** Run capture/conversion in bounded batches and resume only reconciled artifacts. */
|
|
567
611
|
declare function runUrlMigration(options: UrlMigrationRunOptions): Promise<UrlMigrationRun>;
|
|
568
612
|
|
|
569
|
-
export { runUrlMigration as A, validateUrlMigration as B, type MigrationPage as M, type RenderedMigrationFile as R, type UrlMigrationCheckpoint as U, type MigrationAsset as a, type MigrationNavigationGroup as b, type MigrationWarning as c, type MigrationFetcher as d, type MigrationPlatform as e, type MigrationBundle as f, type MigrationDocsConfig as g, type MigrationCapture as h, type MigrationCaptureProvider as i, type MigrationCaptureState as j, type MigrationCapturedAsset as k, type MigrationEvidence as l, type MigrationFetchRequest as m, type MigrationFetchResponse as n, type MigrationJournalAsset as o, type MigrationNavigationOccurrence as p, type MigrationNavigationTab as q, type UrlMigrationCheckpointDelta as r, type UrlMigrationIssue as s, type UrlMigrationRecord as t, type UrlMigrationRun as u, type UrlMigrationRunOptions as v, type UrlMigrationValidation as w, classifyMigrationResponse as x, mergeMigrationConfig as y, renderMigrationFiles as z };
|
|
613
|
+
export { runUrlMigration as A, validateUrlMigration as B, type EndpointTabSlot as E, type MigrationPage as M, type RenderedMigrationFile as R, type UrlMigrationCheckpoint as U, type MigrationAsset as a, type MigrationNavigationGroup as b, type MigrationWarning as c, type MigrationFetcher as d, type MigrationPlatform as e, type MigrationBundle as f, type MigrationDocsConfig as g, type MigrationCapture as h, type MigrationCaptureProvider as i, type MigrationCaptureState as j, type MigrationCapturedAsset as k, type MigrationEvidence as l, type MigrationFetchRequest as m, type MigrationFetchResponse as n, type MigrationJournalAsset as o, type MigrationNavigationOccurrence as p, type MigrationNavigationTab as q, type UrlMigrationCheckpointDelta as r, type UrlMigrationIssue as s, type UrlMigrationRecord as t, type UrlMigrationRun as u, type UrlMigrationRunOptions as v, type UrlMigrationValidation as w, classifyMigrationResponse as x, mergeMigrationConfig as y, renderMigrationFiles as z };
|