@thallylabs/migrate 0.2.42 → 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
@@ -734,3 +734,11 @@ initialized one at a time, best-effort,
734
734
  after a successful clone — a submodule that can't be fetched (private,
735
735
  deleted, network trouble) is named in a warning instead of failing the
736
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
@@ -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 };