@artinstack/migrator 0.1.8 → 0.1.9

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.
Files changed (32) hide show
  1. package/dist/{bundle-uAAHehbv.d.ts → bundle-B3XS20r_.d.ts} +1 -1
  2. package/dist/{chunk-KYNKJ4XV.js → chunk-BONZ3U3I.js} +2 -2
  3. package/dist/{chunk-CB5KRANW.js → chunk-FB3MMCHY.js} +86 -23
  4. package/dist/chunk-FB3MMCHY.js.map +1 -0
  5. package/dist/{chunk-HI7JHWZU.js → chunk-KTQGOM45.js} +1 -1
  6. package/dist/chunk-KTQGOM45.js.map +1 -0
  7. package/dist/{chunk-Z3L6N63Y.js → chunk-PPT5RIZ4.js} +47 -8
  8. package/dist/chunk-PPT5RIZ4.js.map +1 -0
  9. package/dist/{chunk-WHGUE5FC.js → chunk-S4GMDRGX.js} +39 -4
  10. package/dist/chunk-S4GMDRGX.js.map +1 -0
  11. package/dist/{chunk-ALLFBWBO.js → chunk-S4SUJT2D.js} +2 -2
  12. package/dist/cli/index.js +5 -5
  13. package/dist/index.d.ts +6 -6
  14. package/dist/index.js +10 -6
  15. package/dist/lib/index.d.ts +1 -1
  16. package/dist/lib/index.js +3 -1
  17. package/dist/{media-urls-w46-CWUp.d.ts → media-urls-u49RCyPn.d.ts} +15 -1
  18. package/dist/normalizer/index.d.ts +4 -4
  19. package/dist/normalizer/index.js +1 -1
  20. package/dist/{rewrite-inline-images-DyxKUNs3.d.ts → rewrite-inline-images-BsgSquzV.d.ts} +1 -1
  21. package/dist/sinks/index.d.ts +21 -6
  22. package/dist/sinks/index.js +6 -4
  23. package/dist/transformers/index.d.ts +3 -3
  24. package/dist/transformers/index.js +3 -3
  25. package/dist/{types-DWOP8Dcy.d.ts → types-Ce4r6zqt.d.ts} +4 -0
  26. package/package.json +1 -1
  27. package/dist/chunk-CB5KRANW.js.map +0 -1
  28. package/dist/chunk-HI7JHWZU.js.map +0 -1
  29. package/dist/chunk-WHGUE5FC.js.map +0 -1
  30. package/dist/chunk-Z3L6N63Y.js.map +0 -1
  31. /package/dist/{chunk-KYNKJ4XV.js.map → chunk-BONZ3U3I.js.map} +0 -0
  32. /package/dist/{chunk-ALLFBWBO.js.map → chunk-S4SUJT2D.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { M as MigrationAdapter, g as MigrationPlatform } from './types-DWOP8Dcy.js';
2
- export { A as AdapterContext, E as EntityKey, h as EntityType, i as MigrationCursor, b as NormalizedAsset, j as NormalizedAssetExif, d as NormalizedCategory, f as NormalizedEntity, a as NormalizedPage, c as NormalizedPortfolio, N as NormalizedPost, e as NormalizedTag, P as PortfolioMediaLink, k as PublishStatus, S as SourceMetadata, V as ValidationIssue, l as ValidationResult, m as entityKey } from './types-DWOP8Dcy.js';
1
+ import { M as MigrationAdapter, g as MigrationPlatform } from './types-Ce4r6zqt.js';
2
+ export { A as AdapterContext, E as EntityKey, h as EntityType, i as MigrationCursor, b as NormalizedAsset, j as NormalizedAssetExif, d as NormalizedCategory, f as NormalizedEntity, a as NormalizedPage, c as NormalizedPortfolio, N as NormalizedPost, e as NormalizedTag, P as PortfolioMediaLink, k as PublishStatus, S as SourceMetadata, V as ValidationIssue, l as ValidationResult, m as entityKey } from './types-Ce4r6zqt.js';
3
3
  export { EntityState, MigrationCheckpoint, TrackedEntity, buildPortfolioMediaLinks, isTerminalState, normalizedAssetExifSchema, normalizedAssetSchema, normalizedCategorySchema, normalizedEntitySchema, normalizedPageSchema, normalizedPortfolioSchema, normalizedPostSchema, normalizedTagSchema, shouldProcessEntity, sourceMetadataSchema, validateNormalizedAsset, validateNormalizedCategory, validateNormalizedEntity, validateNormalizedPage, validateNormalizedPortfolio, validateNormalizedPost, validateNormalizedTag } from './normalizer/index.js';
4
- export { B as BundleCounts, E as EntityBundle, b as bundleCounts, c as collectEntities, e as emptyBundle } from './bundle-uAAHehbv.js';
5
- export { ConflictReport, DryRunOptions, DryRunResult, FALLBACK_ASSET_BYTES, FilesystemMigrationSink, MIGRATION_WRITE_STAGES, MigrationRedirect, MigrationReport, MigrationRunMode, MigrationRunOptions, MigrationRunResult, MigrationSink, MigrationWriteStage, StorageEstimate, UploadAssetInput, UploadAssetResult, WriteFilesystemOptions, analyzeConflicts, buildMigrationReport, buildRedirectMap, bundleToCombinedJson, createFilesystemMigrationSink, detectRedirectLoops, emptyConflictReport, estimateStorage, hasBlockingConflicts, hasWarnings, portfolioMediaMatchesBundle, runDryRun, runMigration, runMigrationFromBundle, staleUrlsFromEstimate, writeFilesystemExport } from './sinks/index.js';
6
- export { R as RewriteInlineImageRef, a as RewriteInlineImagesOptions, b as RewriteInlineImagesResult, S as StampMigrationMediaRefsOptions, U as UploadedAssetRef, r as rewriteInlineImages, s as stampMigrationMediaRefs } from './rewrite-inline-images-DyxKUNs3.js';
4
+ export { B as BundleCounts, E as EntityBundle, b as bundleCounts, c as collectEntities, e as emptyBundle } from './bundle-B3XS20r_.js';
5
+ export { AssetDiscoverySummary, ConflictReport, DryRunOptions, DryRunResult, FALLBACK_ASSET_BYTES, FilesystemMigrationSink, MIGRATION_WRITE_STAGES, MigrationRedirect, MigrationReport, MigrationRunMode, MigrationRunOptions, MigrationRunResult, MigrationSink, MigrationWriteStage, StorageEstimate, UploadAssetInput, UploadAssetResult, WriteFilesystemOptions, analyzeConflicts, buildMigrationReport, buildRedirectMap, bundleToCombinedJson, createFilesystemMigrationSink, detectRedirectLoops, emptyConflictReport, estimateStorage, hasBlockingConflicts, hasWarnings, portfolioMediaMatchesBundle, runDryRun, runMigration, runMigrationFromBundle, staleUrlsFromEstimate, summarizeAssetDiscovery, writeFilesystemExport } from './sinks/index.js';
6
+ export { R as RewriteInlineImageRef, a as RewriteInlineImagesOptions, b as RewriteInlineImagesResult, S as StampMigrationMediaRefsOptions, U as UploadedAssetRef, r as rewriteInlineImages, s as stampMigrationMediaRefs } from './rewrite-inline-images-BsgSquzV.js';
7
7
  export { ExpandMigrationMediaRefsResult, GrapesComponent, GrapesProjectSnapshot, GrapesStyleRule, HtmlToGrapesOptions, HtmlToTiptapOptions, LayoutKind, LayoutTypeMap, TiptapDoc, TiptapMark, TiptapNode, ValidateGrapesProjectSnapshotOptions, ValidateTiptapDocOptions, cssToStyles, expandMigrationMediaRefs, grapesComponentSchema, grapesProjectSnapshotSchema, grapesStyleRuleSchema, htmlToGrapes, htmlToTiptap, tiptapDocSchema, tiptapMarkSchema, tiptapNodeSchema, validateGrapesProjectSnapshot, validateTiptapDoc } from './transformers/index.js';
8
- export { C as CanonicalInlineAssetUrl, M as MIGRATION_MEDIA_REF_SCHEME, O as OriginUrlRewriteConfig, a as OriginUrlRewriteRule, b as buildContentMediaUrlIndex, c as buildMigrationMediaUrlIndex, d as canonicalizeInlineAssetUrl, e as createMigrationMediaRefReplaceWith, f as createWpContentGatewayRewrite, g as discoverContentAssetUrls, h as discoverFeaturedAssetCandidateUrls, i as discoverRawImgSrcs, j as extractInlineImageSrcs, k as formatMigrationMediaRef, l as isLikelyImageUrl, m as isMigrationMediaRef, n as normalizeAssetUrl, p as parseMigrationMediaRef, r as resolveFeaturedContentAssetUrl, o as resolveMigrationMediaSourceId, q as rewriteOriginUrlsInText } from './media-urls-w46-CWUp.js';
8
+ export { C as CanonicalInlineAssetUrl, a as ContentAssetDiscovery, M as MIGRATION_MEDIA_REF_SCHEME, O as OriginUrlRewriteConfig, b as OriginUrlRewriteRule, c as buildContentMediaUrlIndex, d as buildMigrationMediaUrlIndex, e as canonicalizeInlineAssetUrl, f as createMigrationMediaRefReplaceWith, g as createWpContentGatewayRewrite, h as discoverContentAssetUrls, i as discoverContentAssets, j as discoverFeaturedAssetCandidateUrls, k as discoverRawImgSrcs, l as extractInlineImageSrcs, m as formatMigrationMediaRef, n as isLikelyImageUrl, o as isMigrationMediaRef, p as normalizeAssetUrl, q as parseMigrationMediaRef, r as resolveFeaturedContentAssetUrl, s as resolveMigrationMediaSourceId, t as rewriteOriginUrlsInText } from './media-urls-u49RCyPn.js';
9
9
  export { linkToPath, sanitizeSlug } from './lib/index.js';
10
10
  import { z } from 'zod';
11
11
  import 'node:stream';
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  squarespaceAdapter,
14
14
  wixAdapter,
15
15
  wordpressAdapter
16
- } from "./chunk-CB5KRANW.js";
16
+ } from "./chunk-FB3MMCHY.js";
17
17
  import {
18
18
  normalizedAssetExifSchema,
19
19
  normalizedAssetSchema,
@@ -55,8 +55,9 @@ import {
55
55
  runMigration,
56
56
  runMigrationFromBundle,
57
57
  staleUrlsFromEstimate,
58
+ summarizeAssetDiscovery,
58
59
  writeFilesystemExport
59
- } from "./chunk-Z3L6N63Y.js";
60
+ } from "./chunk-PPT5RIZ4.js";
60
61
  import {
61
62
  buildPortfolioMediaLinks,
62
63
  bundleCounts,
@@ -65,7 +66,7 @@ import {
65
66
  entityKey,
66
67
  isTerminalState,
67
68
  shouldProcessEntity
68
- } from "./chunk-HI7JHWZU.js";
69
+ } from "./chunk-KTQGOM45.js";
69
70
  import {
70
71
  cssToStyles,
71
72
  expandMigrationMediaRefs,
@@ -79,11 +80,11 @@ import {
79
80
  tiptapNodeSchema,
80
81
  validateGrapesProjectSnapshot,
81
82
  validateTiptapDoc
82
- } from "./chunk-ALLFBWBO.js";
83
+ } from "./chunk-S4SUJT2D.js";
83
84
  import {
84
85
  rewriteInlineImages,
85
86
  stampMigrationMediaRefs
86
- } from "./chunk-KYNKJ4XV.js";
87
+ } from "./chunk-BONZ3U3I.js";
87
88
  import "./chunk-EJTWYEAX.js";
88
89
  import {
89
90
  linkToPath,
@@ -97,6 +98,7 @@ import {
97
98
  createMigrationMediaRefReplaceWith,
98
99
  createWpContentGatewayRewrite,
99
100
  discoverContentAssetUrls,
101
+ discoverContentAssets,
100
102
  discoverFeaturedAssetCandidateUrls,
101
103
  discoverRawImgSrcs,
102
104
  extractInlineImageSrcs,
@@ -108,7 +110,7 @@ import {
108
110
  resolveFeaturedContentAssetUrl,
109
111
  resolveMigrationMediaSourceId,
110
112
  rewriteOriginUrlsInText
111
- } from "./chunk-WHGUE5FC.js";
113
+ } from "./chunk-S4GMDRGX.js";
112
114
  export {
113
115
  FALLBACK_ASSET_BYTES,
114
116
  FilesystemMigrationSink,
@@ -139,6 +141,7 @@ export {
139
141
  cssToStyles,
140
142
  detectRedirectLoops,
141
143
  discoverContentAssetUrls,
144
+ discoverContentAssets,
142
145
  discoverFeaturedAssetCandidateUrls,
143
146
  discoverRawImgSrcs,
144
147
  emptyBundle,
@@ -189,6 +192,7 @@ export {
189
192
  squarespaceAdapter,
190
193
  staleUrlsFromEstimate,
191
194
  stampMigrationMediaRefs,
195
+ summarizeAssetDiscovery,
192
196
  tiptapDocSchema,
193
197
  tiptapMarkSchema,
194
198
  tiptapNodeSchema,
@@ -1,4 +1,4 @@
1
- export { C as CanonicalInlineAssetUrl, M as MIGRATION_MEDIA_REF_SCHEME, O as OriginUrlRewriteConfig, a as OriginUrlRewriteRule, b as buildContentMediaUrlIndex, c as buildMigrationMediaUrlIndex, d as canonicalizeInlineAssetUrl, e as createMigrationMediaRefReplaceWith, f as createWpContentGatewayRewrite, g as discoverContentAssetUrls, h as discoverFeaturedAssetCandidateUrls, i as discoverRawImgSrcs, j as extractInlineImageSrcs, k as formatMigrationMediaRef, l as isLikelyImageUrl, m as isMigrationMediaRef, n as normalizeAssetUrl, p as parseMigrationMediaRef, r as resolveFeaturedContentAssetUrl, o as resolveMigrationMediaSourceId, q as rewriteOriginUrlsInText } from '../media-urls-w46-CWUp.js';
1
+ export { C as CanonicalInlineAssetUrl, a as ContentAssetDiscovery, M as MIGRATION_MEDIA_REF_SCHEME, O as OriginUrlRewriteConfig, b as OriginUrlRewriteRule, c as buildContentMediaUrlIndex, d as buildMigrationMediaUrlIndex, e as canonicalizeInlineAssetUrl, f as createMigrationMediaRefReplaceWith, g as createWpContentGatewayRewrite, h as discoverContentAssetUrls, i as discoverContentAssets, j as discoverFeaturedAssetCandidateUrls, k as discoverRawImgSrcs, l as extractInlineImageSrcs, m as formatMigrationMediaRef, n as isLikelyImageUrl, o as isMigrationMediaRef, p as normalizeAssetUrl, q as parseMigrationMediaRef, r as resolveFeaturedContentAssetUrl, s as resolveMigrationMediaSourceId, t as rewriteOriginUrlsInText } from '../media-urls-u49RCyPn.js';
2
2
 
3
3
  /** Lowercase URL-safe slug from WordPress post_name or title. */
4
4
  declare function sanitizeSlug(raw: string): string;
package/dist/lib/index.js CHANGED
@@ -11,6 +11,7 @@ import {
11
11
  createMigrationMediaRefReplaceWith,
12
12
  createWpContentGatewayRewrite,
13
13
  discoverContentAssetUrls,
14
+ discoverContentAssets,
14
15
  discoverFeaturedAssetCandidateUrls,
15
16
  discoverRawImgSrcs,
16
17
  extractInlineImageSrcs,
@@ -22,7 +23,7 @@ import {
22
23
  resolveFeaturedContentAssetUrl,
23
24
  resolveMigrationMediaSourceId,
24
25
  rewriteOriginUrlsInText
25
- } from "../chunk-WHGUE5FC.js";
26
+ } from "../chunk-S4GMDRGX.js";
26
27
  export {
27
28
  MIGRATION_MEDIA_REF_SCHEME,
28
29
  buildContentMediaUrlIndex,
@@ -31,6 +32,7 @@ export {
31
32
  createMigrationMediaRefReplaceWith,
32
33
  createWpContentGatewayRewrite,
33
34
  discoverContentAssetUrls,
35
+ discoverContentAssets,
34
36
  discoverFeaturedAssetCandidateUrls,
35
37
  discoverRawImgSrcs,
36
38
  extractInlineImageSrcs,
@@ -10,6 +10,15 @@ interface OriginUrlRewriteConfig {
10
10
  declare function rewriteOriginUrlsInText(text: string, config: OriginUrlRewriteConfig): string;
11
11
  /** Build a rule that rewrites API-gateway `/prod/wp-content/` paths to a public origin. */
12
12
  declare function createWpContentGatewayRewrite(gatewayBase: string, publicOrigin: string): OriginUrlRewriteConfig;
13
+ interface ContentAssetDiscovery {
14
+ /** Network-resolvable image paths (`<img>`, backgrounds, shortcode `image=` attrs, …). */
15
+ urls: string[];
16
+ /**
17
+ * WordPress attachment post ids referenced in content without an inline URL in this
18
+ * file context (`data-wp-attachment-id`, `[gallery ids=…]`, `[oshine_gallery ids=…]`, …).
19
+ */
20
+ unresolvedAttachmentIds: string[];
21
+ }
13
22
  /** All `<img src>` values (including those not ingested as vault assets). */
14
23
  declare function discoverRawImgSrcs(content: string): string[];
15
24
  /** Normalize protocol-relative and trim; skip data URIs. */
@@ -25,6 +34,11 @@ declare function isLikelyImageUrl(url: string): boolean;
25
34
  declare function discoverFeaturedAssetCandidateUrls(content: string): string[];
26
35
  /** Best featured-image URL from post/page HTML when attachment id is unavailable. */
27
36
  declare function resolveFeaturedContentAssetUrl(content: string): string | undefined;
37
+ /**
38
+ * Generic content-discovery pass: collect resolvable image URLs and attachment ids
39
+ * that still need an index / REST / crawl resolution step.
40
+ */
41
+ declare function discoverContentAssets(content: string): ContentAssetDiscovery;
28
42
  /**
29
43
  * Generic content-discovery pass: collect image URLs from HTML `<img>` tags,
30
44
  * section hero markers (`data-bg-image`), inline CSS backgrounds, and common
@@ -71,4 +85,4 @@ declare function buildContentMediaUrlIndex(entries: Iterable<{
71
85
  sourceId: string;
72
86
  }>, originUrlRewrite?: OriginUrlRewriteConfig): Map<string, string>;
73
87
 
74
- export { type CanonicalInlineAssetUrl as C, MIGRATION_MEDIA_REF_SCHEME as M, type OriginUrlRewriteConfig as O, type OriginUrlRewriteRule as a, buildContentMediaUrlIndex as b, buildMigrationMediaUrlIndex as c, canonicalizeInlineAssetUrl as d, createMigrationMediaRefReplaceWith as e, createWpContentGatewayRewrite as f, discoverContentAssetUrls as g, discoverFeaturedAssetCandidateUrls as h, discoverRawImgSrcs as i, extractInlineImageSrcs as j, formatMigrationMediaRef as k, isLikelyImageUrl as l, isMigrationMediaRef as m, normalizeAssetUrl as n, resolveMigrationMediaSourceId as o, parseMigrationMediaRef as p, rewriteOriginUrlsInText as q, resolveFeaturedContentAssetUrl as r };
88
+ export { type CanonicalInlineAssetUrl as C, MIGRATION_MEDIA_REF_SCHEME as M, type OriginUrlRewriteConfig as O, type ContentAssetDiscovery as a, type OriginUrlRewriteRule as b, buildContentMediaUrlIndex as c, buildMigrationMediaUrlIndex as d, canonicalizeInlineAssetUrl as e, createMigrationMediaRefReplaceWith as f, createWpContentGatewayRewrite as g, discoverContentAssetUrls as h, discoverContentAssets as i, discoverFeaturedAssetCandidateUrls as j, discoverRawImgSrcs as k, extractInlineImageSrcs as l, formatMigrationMediaRef as m, isLikelyImageUrl as n, isMigrationMediaRef as o, normalizeAssetUrl as p, parseMigrationMediaRef as q, resolveFeaturedContentAssetUrl as r, resolveMigrationMediaSourceId as s, rewriteOriginUrlsInText as t };
@@ -1,7 +1,7 @@
1
- import { i as MigrationCursor, E as EntityKey, P as PortfolioMediaLink, l as ValidationResult } from '../types-DWOP8Dcy.js';
2
- export { A as AdapterContext, h as EntityType, M as MigrationAdapter, g as MigrationPlatform, b as NormalizedAsset, j as NormalizedAssetExif, d as NormalizedCategory, f as NormalizedEntity, a as NormalizedPage, c as NormalizedPortfolio, N as NormalizedPost, e as NormalizedTag, k as PublishStatus, S as SourceMetadata, V as ValidationIssue, m as entityKey } from '../types-DWOP8Dcy.js';
3
- import { E as EntityBundle } from '../bundle-uAAHehbv.js';
4
- export { B as BundleCounts, b as bundleCounts, c as collectEntities, e as emptyBundle } from '../bundle-uAAHehbv.js';
1
+ import { i as MigrationCursor, E as EntityKey, P as PortfolioMediaLink, l as ValidationResult } from '../types-Ce4r6zqt.js';
2
+ export { A as AdapterContext, h as EntityType, M as MigrationAdapter, g as MigrationPlatform, b as NormalizedAsset, j as NormalizedAssetExif, d as NormalizedCategory, f as NormalizedEntity, a as NormalizedPage, c as NormalizedPortfolio, N as NormalizedPost, e as NormalizedTag, k as PublishStatus, S as SourceMetadata, V as ValidationIssue, m as entityKey } from '../types-Ce4r6zqt.js';
3
+ import { E as EntityBundle } from '../bundle-B3XS20r_.js';
4
+ export { B as BundleCounts, b as bundleCounts, c as collectEntities, e as emptyBundle } from '../bundle-B3XS20r_.js';
5
5
  import { z } from 'zod';
6
6
 
7
7
  /** Portable entity state for resume / idempotency (not Directus field names). */
@@ -24,7 +24,7 @@ import {
24
24
  entityKey,
25
25
  isTerminalState,
26
26
  shouldProcessEntity
27
- } from "../chunk-HI7JHWZU.js";
27
+ } from "../chunk-KTQGOM45.js";
28
28
  export {
29
29
  buildPortfolioMediaLinks,
30
30
  bundleCounts,
@@ -1,4 +1,4 @@
1
- import { O as OriginUrlRewriteConfig } from './media-urls-w46-CWUp.js';
1
+ import { O as OriginUrlRewriteConfig } from './media-urls-u49RCyPn.js';
2
2
 
3
3
  interface RewriteInlineImageRef {
4
4
  originalSrc: string;
@@ -1,9 +1,9 @@
1
- import { d as NormalizedCategory, e as NormalizedTag, b as NormalizedAsset, c as NormalizedPortfolio, N as NormalizedPost, a as NormalizedPage, P as PortfolioMediaLink, E as EntityKey, f as NormalizedEntity, g as MigrationPlatform, M as MigrationAdapter } from '../types-DWOP8Dcy.js';
1
+ import { d as NormalizedCategory, e as NormalizedTag, b as NormalizedAsset, c as NormalizedPortfolio, N as NormalizedPost, a as NormalizedPage, P as PortfolioMediaLink, E as EntityKey, f as NormalizedEntity, g as MigrationPlatform, M as MigrationAdapter } from '../types-Ce4r6zqt.js';
2
2
  import { Readable } from 'node:stream';
3
- import { a as RewriteInlineImagesOptions } from '../rewrite-inline-images-DyxKUNs3.js';
4
- export { b as RewriteInlineImagesResult, r as rewriteInlineImages } from '../rewrite-inline-images-DyxKUNs3.js';
5
- import { E as EntityBundle } from '../bundle-uAAHehbv.js';
6
- import '../media-urls-w46-CWUp.js';
3
+ import { a as RewriteInlineImagesOptions } from '../rewrite-inline-images-BsgSquzV.js';
4
+ export { b as RewriteInlineImagesResult, r as rewriteInlineImages } from '../rewrite-inline-images-BsgSquzV.js';
5
+ import { E as EntityBundle } from '../bundle-B3XS20r_.js';
6
+ import '../media-urls-u49RCyPn.js';
7
7
 
8
8
  interface CreatePostResult {
9
9
  targetId: string;
@@ -116,6 +116,18 @@ interface RedirectLoopConflict {
116
116
  toPath: string;
117
117
  blocked: boolean;
118
118
  }
119
+ interface AssetDiscoverySummary {
120
+ /** Unique resolvable image URLs found in post/page HTML. */
121
+ urlsDiscovered: number;
122
+ /** Unique WordPress attachment ids referenced in content (`data-wp-attachment-id`, gallery `ids=`). */
123
+ attachmentRefs: number;
124
+ /** Attachment ids that resolved to a `media.json` row in this job. */
125
+ attachmentRefsResolved: number;
126
+ /** Attachment ids still lacking a URL in this export context. */
127
+ attachmentRefsUnresolved: number;
128
+ /** Sorted unresolved ids (for scan UI / follow-up REST export). */
129
+ unresolvedAttachmentIds: string[];
130
+ }
119
131
  interface ConflictReport {
120
132
  duplicatePostSlugs: DuplicateSlugConflict[];
121
133
  duplicatePageSlugs: DuplicateSlugConflict[];
@@ -125,7 +137,9 @@ interface ConflictReport {
125
137
  unresolvedInlineImages: UnresolvedInlineImageConflict[];
126
138
  unsupportedBlocks: UnsupportedBlockConflict[];
127
139
  redirectLoops: RedirectLoopConflict[];
140
+ assetDiscovery: AssetDiscoverySummary;
128
141
  }
142
+ declare function summarizeAssetDiscovery(bundle: EntityBundle): AssetDiscoverySummary;
129
143
  declare function emptyConflictReport(): ConflictReport;
130
144
  declare function analyzeConflicts(bundle: EntityBundle, options?: {
131
145
  staleAssetUrls?: StaleAssetUrlConflict[];
@@ -158,6 +172,7 @@ interface MigrationReport {
158
172
  categories: number;
159
173
  tags: number;
160
174
  storageBytesEstimated?: number;
175
+ assetDiscovery?: AssetDiscoverySummary;
161
176
  };
162
177
  warnings: string[];
163
178
  errors: string[];
@@ -260,4 +275,4 @@ declare function staleUrlsFromEstimate(estimate: StorageEstimate): {
260
275
  reason: string;
261
276
  }[];
262
277
 
263
- export { type ConflictReport, type DryRunOptions, type DryRunResult, FALLBACK_ASSET_BYTES, FilesystemMigrationSink, MIGRATION_WRITE_STAGES, type MigrationRedirect, type MigrationReport, type MigrationRunMode, type MigrationRunOptions, type MigrationRunResult, type MigrationSink, type MigrationWriteStage, RewriteInlineImagesOptions, type StorageEstimate, type UploadAssetInput, type UploadAssetResult, type WriteFilesystemOptions, analyzeConflicts, buildMigrationReport, buildRedirectMap, bundleToCombinedJson, createFilesystemMigrationSink, detectRedirectLoops, emptyConflictReport, estimateStorage, hasBlockingConflicts, hasWarnings, portfolioMediaMatchesBundle, runDryRun, runMigration, runMigrationFromBundle, staleUrlsFromEstimate, writeFilesystemExport };
278
+ export { type AssetDiscoverySummary, type ConflictReport, type DryRunOptions, type DryRunResult, FALLBACK_ASSET_BYTES, FilesystemMigrationSink, MIGRATION_WRITE_STAGES, type MigrationRedirect, type MigrationReport, type MigrationRunMode, type MigrationRunOptions, type MigrationRunResult, type MigrationSink, type MigrationWriteStage, RewriteInlineImagesOptions, type StorageEstimate, type UploadAssetInput, type UploadAssetResult, type WriteFilesystemOptions, analyzeConflicts, buildMigrationReport, buildRedirectMap, bundleToCombinedJson, createFilesystemMigrationSink, detectRedirectLoops, emptyConflictReport, estimateStorage, hasBlockingConflicts, hasWarnings, portfolioMediaMatchesBundle, runDryRun, runMigration, runMigrationFromBundle, staleUrlsFromEstimate, summarizeAssetDiscovery, writeFilesystemExport };
@@ -17,14 +17,15 @@ import {
17
17
  runMigration,
18
18
  runMigrationFromBundle,
19
19
  staleUrlsFromEstimate,
20
+ summarizeAssetDiscovery,
20
21
  writeFilesystemExport
21
- } from "../chunk-Z3L6N63Y.js";
22
- import "../chunk-HI7JHWZU.js";
22
+ } from "../chunk-PPT5RIZ4.js";
23
+ import "../chunk-KTQGOM45.js";
23
24
  import {
24
25
  rewriteInlineImages
25
- } from "../chunk-KYNKJ4XV.js";
26
+ } from "../chunk-BONZ3U3I.js";
26
27
  import "../chunk-XRCF73DA.js";
27
- import "../chunk-WHGUE5FC.js";
28
+ import "../chunk-S4GMDRGX.js";
28
29
  export {
29
30
  FALLBACK_ASSET_BYTES,
30
31
  FilesystemMigrationSink,
@@ -45,6 +46,7 @@ export {
45
46
  runMigration,
46
47
  runMigrationFromBundle,
47
48
  staleUrlsFromEstimate,
49
+ summarizeAssetDiscovery,
48
50
  writeFilesystemExport
49
51
  };
50
52
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
- import { l as ValidationResult } from '../types-DWOP8Dcy.js';
3
- export { R as RewriteInlineImageRef, a as RewriteInlineImagesOptions, b as RewriteInlineImagesResult, S as StampMigrationMediaRefsOptions, U as UploadedAssetRef, r as rewriteInlineImages, s as stampMigrationMediaRefs } from '../rewrite-inline-images-DyxKUNs3.js';
4
- export { c as buildMigrationMediaUrlIndex } from '../media-urls-w46-CWUp.js';
2
+ import { l as ValidationResult } from '../types-Ce4r6zqt.js';
3
+ export { R as RewriteInlineImageRef, a as RewriteInlineImagesOptions, b as RewriteInlineImagesResult, S as StampMigrationMediaRefsOptions, U as UploadedAssetRef, r as rewriteInlineImages, s as stampMigrationMediaRefs } from '../rewrite-inline-images-BsgSquzV.js';
4
+ export { d as buildMigrationMediaUrlIndex } from '../media-urls-u49RCyPn.js';
5
5
 
6
6
  type LayoutKind = "section" | "row" | "column";
7
7
  /** Map OSS-2 `data-layout` markers to Grapes component types (host may override). */
@@ -11,14 +11,14 @@ import {
11
11
  tiptapNodeSchema,
12
12
  validateGrapesProjectSnapshot,
13
13
  validateTiptapDoc
14
- } from "../chunk-ALLFBWBO.js";
14
+ } from "../chunk-S4SUJT2D.js";
15
15
  import {
16
16
  rewriteInlineImages,
17
17
  stampMigrationMediaRefs
18
- } from "../chunk-KYNKJ4XV.js";
18
+ } from "../chunk-BONZ3U3I.js";
19
19
  import {
20
20
  buildMigrationMediaUrlIndex
21
- } from "../chunk-WHGUE5FC.js";
21
+ } from "../chunk-S4GMDRGX.js";
22
22
  export {
23
23
  buildMigrationMediaUrlIndex,
24
24
  cssToStyles,
@@ -7,6 +7,8 @@ interface SourceMetadata {
7
7
  url?: string;
8
8
  path?: string;
9
9
  exportedAt?: string;
10
+ /** WordPress `post_type` when the DTO shape differs (e.g. portfolio CPT emitted as `page`). */
11
+ postType?: string;
10
12
  }
11
13
  /** Canonical post DTO — raw HTML; sanitize at host sink. */
12
14
  interface NormalizedPost {
@@ -106,6 +108,8 @@ interface ValidationResult {
106
108
  pages?: number;
107
109
  assets?: number;
108
110
  portfolios?: number;
111
+ /** WordPress `post_type=portfolio` (and configured CPT slugs) in raw WXR. */
112
+ portfolioCpt?: number;
109
113
  categories?: number;
110
114
  tags?: number;
111
115
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artinstack/migrator",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Stateless content normalizer and migration framework — WordPress, SmugMug, Squarespace → platform-agnostic schema",
5
5
  "license": "MIT",
6
6
  "author": "ArtInStack",