@thallylabs/migrate 0.2.41 → 0.2.43

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 CHANGED
@@ -10,6 +10,12 @@ ordered navigation and binary assets), or uses ordinary local fetching. Hosted
10
10
  callers must inject their own network-safe text/capture and binary boundaries.
11
11
  No browser, model, credentials, sandbox or publishing provider is bundled here.
12
12
 
13
+ Default page requests advertise HTML to retain rendered content and declared
14
+ alternates. An explicit same-origin, same-route Markdown alternate shares the
15
+ article's destination; the rendered article takes precedence even when the
16
+ Markdown URL was discovered first or restored from an interrupted checkpoint.
17
+ Independent pages still report destination collisions.
18
+
13
19
  Server applications should import `@thallylabs/migrate/svg-policy` for the passive
14
20
  SVG validator, or `@thallylabs/migrate/url-migration` for the URL runner, renderer
15
21
  and their types. These independent entries avoid tracing repository cloning and
@@ -99,8 +105,13 @@ Missing primary counterparts and projected path collisions require review; the
99
105
  engine does not invent translations. Fresh HTML captures also observe `html lang`; conflicting or unsupported
100
106
  language evidence requires review. Capture adapters can supply `locale` when
101
107
  no language is declared in HTML or identified by the scoped URL path.
102
- The `url-evidence-v6` converter rejects earlier journals: replay retained raw
108
+ The `url-evidence-v7` converter rejects earlier journals: replay retained raw
103
109
  captures into a new journal rather than relabelling previously hashed pages.
110
+ Distinct observed redirect routes can retain their own sidebar titles through
111
+ noindex page metadata and portable internal redirects to the captured article.
112
+ Conflicting labels on the same route still require review. Markdown image and
113
+ link destinations are localized by source spans, including escaped query strings,
114
+ without changing matching labels, titles, or fenced examples.
104
115
 
105
116
  `stopReason` distinguishes a resumable `capture-limit` from hard `page-limit`
106
117
  or `byte-limit` outcomes. Hosts must not automatically retry a hard limit as an
@@ -723,3 +734,11 @@ initialized one at a time, best-effort,
723
734
  after a successful clone — a submodule that can't be fetched (private,
724
735
  deleted, network trouble) is named in a warning instead of failing the
725
736
  whole migration.
737
+
738
+ `migrateUrl({ sourceUrl, openapiUrl })` accepts an explicit HTTPS OpenAPI URL,
739
+ using the same bounded specification fetch boundary as repository imports.
740
+ A single publisher-linked `openapi.json` or `openapi.yaml` can also be discovered.
741
+ Crawled endpoint pages with a unique tag/title route become interactive while
742
+ retaining their prose; generated API navigation lists only unrepresented operations.
743
+ This HTTP adapter never reads local paths. Trusted local CLI imports use a separate
744
+ bounded snapshot before calling the existing repository converter.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { M as MigrationPage, a as MigrationAsset, b as MigrationNavigationGroup, R as RenderedMigrationFile, c as MigrationWarning, d as MigrationFetcher, e as MigrationPlatform, f as MigrationBundle, g as MigrationDocsConfig, E as EndpointTabSlot } from './url-run-mSKFqHx_.js';
2
- export { h as MigrationCapture, i as MigrationCaptureProvider, j as MigrationCaptureState, k as MigrationCapturedAsset, l as MigrationEvidence, m as MigrationFetchRequest, n as MigrationFetchResponse, o as MigrationJournalAsset, p as MigrationNavigationOccurrence, q as MigrationNavigationTab, U as UrlMigrationCheckpoint, r as UrlMigrationCheckpointDelta, s as UrlMigrationIssue, t as UrlMigrationRecord, u as UrlMigrationRun, v as UrlMigrationRunOptions, w as UrlMigrationValidation, x as classifyMigrationResponse, y as mergeMigrationConfig, z as renderMigrationFiles, A as runUrlMigration, B as validateUrlMigration } from './url-run-mSKFqHx_.js';
1
+ import { M as MigrationPage, a as MigrationAsset, b as MigrationNavigationGroup, R as RenderedMigrationFile, c as MigrationWarning, d as MigrationFetcher, e as MigrationPlatform, f as MigrationBundle, g as MigrationDocsConfig, E as EndpointTabSlot } from './url-run-CPzQfjRW.js';
2
+ export { h as MigrationCapture, i as MigrationCaptureProvider, j as MigrationCaptureState, k as MigrationCapturedAsset, l as MigrationEvidence, m as MigrationFetchRequest, n as MigrationFetchResponse, o as MigrationJournalAsset, p as MigrationNavigationOccurrence, q as MigrationNavigationTab, U as UrlMigrationCheckpoint, r as UrlMigrationCheckpointDelta, s as UrlMigrationIssue, t as UrlMigrationRecord, u as UrlMigrationRun, v as UrlMigrationRunOptions, w as UrlMigrationValidation, x as classifyMigrationResponse, y as mergeMigrationConfig, z as renderMigrationFiles, A as runUrlMigration, B as validateUrlMigration } from './url-run-CPzQfjRW.js';
3
3
  export { isPassiveSvg } from './svg-policy.js';
4
4
 
5
5
  /**
@@ -113,9 +113,37 @@ options?: {
113
113
  declare function detectRepositoryPlatform(repositoryDir: string, docsDir?: string): MigrationPlatform;
114
114
  /** Pick the first conventional content root containing Markdown. */
115
115
  declare function detectRepositoryDocsDir(repositoryDir: string): string;
116
+ /** Enumerate generated endpoint routes using the same spec visibility, tab ids and slugs as migration linking. */
117
+ declare function migrationApiRoutes(bundle: Pick<MigrationBundle, 'docsConfig' | 'assets'>): Array<string>;
116
118
  /** Import an already-available repository directory into a canonical bundle. */
117
119
  declare function migrateRepository(options: RepositoryMigrationOptions): MigrationBundle;
118
120
 
121
+ /**
122
+ * Final pass over a migrated redirect set. Next.js applies a redirect before it
123
+ * looks for a page, so a redirect whose source is a served page hides that page,
124
+ * and two redirects that point at each other never settle. Next also parses a
125
+ * redirect source as a route pattern, so one with pattern operators fails the
126
+ * whole build. Every platform and every step that adds redirects (source
127
+ * config, generated aliases, remote API specs) is checked here once, instead of
128
+ * each caller guarding its own additions.
129
+ *
130
+ * A site runs on either of two servers: `next start` matches a redirect source
131
+ * without regard to letter case, while the Cloudflare build matches it exactly.
132
+ * A conflict is judged by the stricter reading, so a redirect that would hide a
133
+ * page or loop on either server is left out.
134
+ */
135
+
136
+ /** `exactRoute` in lower case: the form routes are compared in, so `/Guide` and `/guide` are one address. */
137
+ declare function literalRoute(route: string): string | null;
138
+ /**
139
+ * Every address that opens a page. That is `pageRoutes`, plus the site root for
140
+ * the home document: the runtime serves `introduction` at `/` (`navigationPagePath`
141
+ * in `@thallylabs/core`, which is also what its sidebar links to) and still accepts
142
+ * `/introduction` as an alias (`matchesNavigationPath`). A redirect that has to take
143
+ * a page over must cover all of them.
144
+ */
145
+ declare function pageEntryRoutes(page: Pick<MigrationPage, 'id'>): Array<string>;
146
+
119
147
  /**
120
148
  * Mintlify-only helpers: page access rules, site-wide CSS/JS/font assets,
121
149
  * and appearance settings. Kept apart from the generic repository walk so the
@@ -342,6 +370,8 @@ declare function validateIntegrations(integrations: unknown): Array<string>;
342
370
 
343
371
  interface UrlMigrationOptions {
344
372
  sourceUrl: string;
373
+ /** Explicit HTTPS OpenAPI specification when the publisher has no operation mirrors. */
374
+ openapiUrl?: string;
345
375
  /** Explicit caller selection; omitted callers retain source auto-detection. */
346
376
  platform?: MigrationPlatform;
347
377
  fetcher?: MigrationFetcher;
@@ -356,6 +386,9 @@ declare const defaultMigrationFetcher: MigrationFetcher;
356
386
  /** Crawl one public docs origin into a canonical, caller-independent bundle. */
357
387
  declare function migrateUrl(options: UrlMigrationOptions): Promise<MigrationBundle>;
358
388
 
389
+ /** Bind unique crawled endpoints in place and generate only missing operation navigation. */
390
+ declare function hydrateUrlOpenApi(bundle: MigrationBundle, specUrl: string, fetcher?: MigrationFetcher): Promise<MigrationBundle>;
391
+
359
392
  /**
360
393
  * Attach safely downloaded specs to the exact authored API tabs. A spec
361
394
  * mounted under Mintlify `directory` folders gets a redirect from each
@@ -371,4 +404,4 @@ declare function migrateUrl(options: UrlMigrationOptions): Promise<MigrationBund
371
404
  */
372
405
  declare function hydrateRemoteApiSpecs(bundle: MigrationBundle, fetcher?: MigrationFetcher): Promise<MigrationBundle>;
373
406
 
374
- export { type GitHubRepositorySource, MigrationAsset, MigrationBundle, MigrationDocsConfig, MigrationFetcher, MigrationNavigationGroup, MigrationPage, MigrationPlatform, MigrationWarning, RenderedMigrationFile, type RepositoryMigrationOptions, SOURCE_REF_MAX_BYTES, SOURCE_REF_MAX_FILES, SOURCE_REF_MAX_REPOSITORY_KB, type SourceRefImport, type SourceRefMapping, type UrlMigrationOptions, addMintlifyDirectoryRedirects, buildNavigationFromPages, cloneGitHubRepository, defaultMigrationFetcher, detectRepositoryDocsDir, detectRepositoryPlatform, gitmodulePaths, hydrateRemoteApiSpecs, importSourceRef, migrateRepository, migrateUrl, normalizeMdx, parseGitHubRepositoryUrl, parseMarkdownPage, parseSourceRefFlags, projectFernNavigation, projectMintlifyIntegrations, projectMintlifyNavigation, pruneMissingNavigationPages, readFernConfig, readMintlifyConfig, sourceRefOversizeReason, validateIntegrations, validateMigrationUrl };
407
+ export { type GitHubRepositorySource, MigrationAsset, MigrationBundle, MigrationDocsConfig, MigrationFetcher, MigrationNavigationGroup, MigrationPage, MigrationPlatform, MigrationWarning, RenderedMigrationFile, type RepositoryMigrationOptions, SOURCE_REF_MAX_BYTES, SOURCE_REF_MAX_FILES, SOURCE_REF_MAX_REPOSITORY_KB, type SourceRefImport, type SourceRefMapping, type UrlMigrationOptions, addMintlifyDirectoryRedirects, buildNavigationFromPages, cloneGitHubRepository, defaultMigrationFetcher, detectRepositoryDocsDir, detectRepositoryPlatform, gitmodulePaths, hydrateRemoteApiSpecs, hydrateUrlOpenApi, importSourceRef, literalRoute, migrateRepository, migrateUrl, migrationApiRoutes, normalizeMdx, pageEntryRoutes, parseGitHubRepositoryUrl, parseMarkdownPage, parseSourceRefFlags, projectFernNavigation, projectMintlifyIntegrations, projectMintlifyNavigation, pruneMissingNavigationPages, readFernConfig, readMintlifyConfig, sourceRefOversizeReason, validateIntegrations, validateMigrationUrl };