@artinstack/migrator 0.1.24 → 0.1.26
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/dist/{bundle-BgoXkWMy.d.ts → bundle-CtVh_LGP.d.ts} +3 -1
- package/dist/{chunk-PD5AZX3B.js → chunk-FEDV5UFR.js} +8 -3
- package/dist/chunk-FEDV5UFR.js.map +1 -0
- package/dist/{chunk-GSKLJXU2.js → chunk-ISB7NAA4.js} +61 -2
- package/dist/chunk-ISB7NAA4.js.map +1 -0
- package/dist/{chunk-57VMPBUV.js → chunk-XJDLJM7Q.js} +147 -10
- package/dist/chunk-XJDLJM7Q.js.map +1 -0
- package/dist/{chunk-373TTCG7.js → chunk-YTLMN7HO.js} +25 -3
- package/dist/chunk-YTLMN7HO.js.map +1 -0
- package/dist/cli/index.js +3 -3
- package/dist/index.d.ts +32 -6
- package/dist/index.js +12 -4
- package/dist/normalizer/index.d.ts +156 -9
- package/dist/normalizer/index.js +6 -2
- package/dist/sinks/index.d.ts +10 -3
- package/dist/sinks/index.js +2 -2
- package/dist/transformers/index.d.ts +1 -1
- package/dist/{types-Bicgdp4Z.d.ts → types-Bhi-0uKs.d.ts} +31 -3
- package/package.json +8 -8
- package/dist/chunk-373TTCG7.js.map +0 -1
- package/dist/chunk-57VMPBUV.js.map +0 -1
- package/dist/chunk-GSKLJXU2.js.map +0 -1
- package/dist/chunk-PD5AZX3B.js.map +0 -1
|
@@ -24,7 +24,23 @@ var normalizedPostSchema = z.object({
|
|
|
24
24
|
sourceFeaturedMediaId: z.string().optional(),
|
|
25
25
|
featuredAssetSourceId: z.string().optional(),
|
|
26
26
|
seoTitle: z.string().optional(),
|
|
27
|
-
seoDescription: z.string().optional()
|
|
27
|
+
seoDescription: z.string().optional(),
|
|
28
|
+
sourceLikeCount: z.number().int().nonnegative().optional()
|
|
29
|
+
});
|
|
30
|
+
var commentModerationStatusSchema = z.enum(["approved", "pending", "spam", "rejected"]);
|
|
31
|
+
var normalizedCommentSchema = z.object({
|
|
32
|
+
type: z.literal("comment"),
|
|
33
|
+
source: sourceMetadataSchema,
|
|
34
|
+
sourceId: z.string().min(1),
|
|
35
|
+
postSourceId: z.string().min(1),
|
|
36
|
+
parentSourceId: z.string().min(1).optional(),
|
|
37
|
+
contentHtml: z.string().min(1),
|
|
38
|
+
status: commentModerationStatusSchema,
|
|
39
|
+
authorType: z.literal("guest"),
|
|
40
|
+
authorName: z.string().optional(),
|
|
41
|
+
authorEmail: z.string().optional(),
|
|
42
|
+
authorUrl: z.string().optional(),
|
|
43
|
+
publishedAt: z.string().optional()
|
|
28
44
|
});
|
|
29
45
|
var pageHeroSliderHintSchema = z.object({
|
|
30
46
|
plugin: z.enum(["revslider", "masterslider"]),
|
|
@@ -99,7 +115,8 @@ var normalizedEntitySchema = z.discriminatedUnion("type", [
|
|
|
99
115
|
normalizedAssetSchema,
|
|
100
116
|
normalizedPortfolioSchema,
|
|
101
117
|
normalizedCategorySchema,
|
|
102
|
-
normalizedTagSchema
|
|
118
|
+
normalizedTagSchema,
|
|
119
|
+
normalizedCommentSchema
|
|
103
120
|
]);
|
|
104
121
|
function zodIssuesToValidationIssues(issues) {
|
|
105
122
|
return issues.map((issue) => ({
|
|
@@ -133,6 +150,9 @@ function validateNormalizedCategory(category) {
|
|
|
133
150
|
function validateNormalizedTag(tag) {
|
|
134
151
|
return parseToValidationResult(normalizedTagSchema, tag);
|
|
135
152
|
}
|
|
153
|
+
function validateNormalizedComment(comment) {
|
|
154
|
+
return parseToValidationResult(normalizedCommentSchema, comment);
|
|
155
|
+
}
|
|
136
156
|
function validateNormalizedEntity(entity) {
|
|
137
157
|
return parseToValidationResult(normalizedEntitySchema, entity);
|
|
138
158
|
}
|
|
@@ -140,6 +160,7 @@ function validateNormalizedEntity(entity) {
|
|
|
140
160
|
export {
|
|
141
161
|
sourceMetadataSchema,
|
|
142
162
|
normalizedPostSchema,
|
|
163
|
+
normalizedCommentSchema,
|
|
143
164
|
normalizedPageSchema,
|
|
144
165
|
normalizedAssetExifSchema,
|
|
145
166
|
normalizedAssetSchema,
|
|
@@ -153,6 +174,7 @@ export {
|
|
|
153
174
|
validateNormalizedPortfolio,
|
|
154
175
|
validateNormalizedCategory,
|
|
155
176
|
validateNormalizedTag,
|
|
177
|
+
validateNormalizedComment,
|
|
156
178
|
validateNormalizedEntity
|
|
157
179
|
};
|
|
158
|
-
//# sourceMappingURL=chunk-
|
|
180
|
+
//# sourceMappingURL=chunk-YTLMN7HO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/normalizer/validate.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport type { ValidationIssue, ValidationResult } from \"./types.js\";\n\nconst migrationPlatformSchema = z.enum([\"wordpress\", \"smugmug\", \"squarespace\", \"wix\"]);\nconst publishStatusSchema = z.enum([\"draft\", \"published\", \"archived\"]);\n\nexport const sourceMetadataSchema = z.object({\n platform: migrationPlatformSchema,\n id: z.string().min(1),\n url: z.string().optional(),\n path: z.string().optional(),\n exportedAt: z.string().optional(),\n});\n\nexport const normalizedPostSchema = z.object({\n type: z.literal(\"post\"),\n source: sourceMetadataSchema,\n sourceId: z.string().min(1),\n title: z.string().min(1),\n slug: z.string().min(1),\n excerpt: z.string().optional(),\n contentHtml: z.string(),\n publishedAt: z.string().optional(),\n status: publishStatusSchema,\n categorySlugs: z.array(z.string().min(1)).optional(),\n tagSlugs: z.array(z.string().min(1)).optional(),\n sourceFeaturedMediaId: z.string().optional(),\n featuredAssetSourceId: z.string().optional(),\n seoTitle: z.string().optional(),\n seoDescription: z.string().optional(),\n sourceLikeCount: z.number().int().nonnegative().optional(),\n});\n\nconst commentModerationStatusSchema = z.enum([\"approved\", \"pending\", \"spam\", \"rejected\"]);\n\nexport const normalizedCommentSchema = z.object({\n type: z.literal(\"comment\"),\n source: sourceMetadataSchema,\n sourceId: z.string().min(1),\n postSourceId: z.string().min(1),\n parentSourceId: z.string().min(1).optional(),\n contentHtml: z.string().min(1),\n status: commentModerationStatusSchema,\n authorType: z.literal(\"guest\"),\n authorName: z.string().optional(),\n authorEmail: z.string().optional(),\n authorUrl: z.string().optional(),\n publishedAt: z.string().optional(),\n});\n\nconst pageHeroSliderHintSchema = z.object({\n plugin: z.enum([\"revslider\", \"masterslider\"]),\n alias: z.string().min(1),\n slidertitle: z.string().optional(),\n source: z.enum([\"meta-shortcode\", \"meta-slider-field\", \"tatsu-json\"]).optional(),\n});\n\nconst pageLayoutHintsSchema = z.object({\n heroSlider: pageHeroSliderHintSchema.optional(),\n});\n\nexport const normalizedPageSchema = z.object({\n type: z.literal(\"page\"),\n source: sourceMetadataSchema,\n sourceId: z.string().min(1),\n title: z.string().min(1),\n slug: z.string().min(1),\n contentHtml: z.string(),\n contentCss: z.string().optional(),\n isHomePage: z.boolean().optional(),\n isPortfolioPage: z.boolean().optional(),\n layoutHints: pageLayoutHintsSchema.optional(),\n status: publishStatusSchema,\n seoTitle: z.string().optional(),\n seoDescription: z.string().optional(),\n});\n\nexport const normalizedAssetExifSchema = z.object({\n iso: z.number().optional(),\n aperture: z.number().optional(),\n shutter: z.string().optional(),\n focalLength: z.number().optional(),\n});\n\nexport const normalizedAssetSchema = z.object({\n type: z.literal(\"asset\"),\n source: sourceMetadataSchema,\n sourceId: z.string().min(1),\n sourceUrl: z.string().min(1),\n filename: z.string().min(1),\n mimeType: z.string().optional(),\n caption: z.string().optional(),\n altText: z.string().optional(),\n keywords: z.array(z.string()).optional(),\n exif: normalizedAssetExifSchema.optional(),\n portfolioSourceId: z.string().optional(),\n sort: z.number().optional(),\n});\n\nexport const normalizedPortfolioSchema = z.object({\n type: z.literal(\"portfolio\"),\n source: sourceMetadataSchema,\n sourceId: z.string().min(1),\n title: z.string().min(1),\n slug: z.string().min(1),\n description: z.string().optional(),\n parentSourceId: z.string().optional(),\n});\n\nexport const normalizedCategorySchema = z.object({\n type: z.literal(\"category\"),\n source: sourceMetadataSchema,\n sourceId: z.string().min(1),\n name: z.string().min(1),\n slug: z.string().min(1),\n});\n\nexport const normalizedTagSchema = z.object({\n type: z.literal(\"tag\"),\n source: sourceMetadataSchema,\n sourceId: z.string().min(1),\n name: z.string().min(1),\n slug: z.string().min(1),\n});\n\nexport const normalizedEntitySchema = z.discriminatedUnion(\"type\", [\n normalizedPostSchema,\n normalizedPageSchema,\n normalizedAssetSchema,\n normalizedPortfolioSchema,\n normalizedCategorySchema,\n normalizedTagSchema,\n normalizedCommentSchema,\n]);\n\nfunction zodIssuesToValidationIssues(issues: z.ZodIssue[]): ValidationIssue[] {\n return issues.map((issue) => ({\n code: issue.code,\n message: issue.message,\n path: issue.path.length > 0 ? issue.path.join(\".\") : undefined,\n }));\n}\n\nfunction parseToValidationResult(schema: z.ZodTypeAny, value: unknown): ValidationResult {\n const result = schema.safeParse(value);\n if (result.success) {\n return { ok: true, issues: [] };\n }\n return { ok: false, issues: zodIssuesToValidationIssues(result.error.issues) };\n}\n\n/** Opt-in structural check for a normalized post DTO (no cross-entity FK validation). */\nexport function validateNormalizedPost(post: unknown): ValidationResult {\n return parseToValidationResult(normalizedPostSchema, post);\n}\n\n/** Opt-in structural check for a normalized page DTO (no cross-entity FK validation). */\nexport function validateNormalizedPage(page: unknown): ValidationResult {\n return parseToValidationResult(normalizedPageSchema, page);\n}\n\n/** Opt-in structural check for a normalized asset DTO. */\nexport function validateNormalizedAsset(asset: unknown): ValidationResult {\n return parseToValidationResult(normalizedAssetSchema, asset);\n}\n\n/** Opt-in structural check for a normalized portfolio DTO. */\nexport function validateNormalizedPortfolio(portfolio: unknown): ValidationResult {\n return parseToValidationResult(normalizedPortfolioSchema, portfolio);\n}\n\n/** Opt-in structural check for a normalized category DTO. */\nexport function validateNormalizedCategory(category: unknown): ValidationResult {\n return parseToValidationResult(normalizedCategorySchema, category);\n}\n\n/** Opt-in structural check for a normalized tag DTO. */\nexport function validateNormalizedTag(tag: unknown): ValidationResult {\n return parseToValidationResult(normalizedTagSchema, tag);\n}\n\n/** Opt-in structural check for a normalized comment DTO. */\nexport function validateNormalizedComment(comment: unknown): ValidationResult {\n return parseToValidationResult(normalizedCommentSchema, comment);\n}\n\n/** Opt-in structural check for any normalized entity discriminated by `type`. */\nexport function validateNormalizedEntity(entity: unknown): ValidationResult {\n return parseToValidationResult(normalizedEntitySchema, entity);\n}\n"],"mappings":";AAAA,SAAS,SAAS;AAIlB,IAAM,0BAA0B,EAAE,KAAK,CAAC,aAAa,WAAW,eAAe,KAAK,CAAC;AACrF,IAAM,sBAAsB,EAAE,KAAK,CAAC,SAAS,aAAa,UAAU,CAAC;AAE9D,IAAM,uBAAuB,EAAE,OAAO;AAAA,EAC3C,UAAU;AAAA,EACV,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACpB,KAAK,EAAE,OAAO,EAAE,SAAS;AAAA,EACzB,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,YAAY,EAAE,OAAO,EAAE,SAAS;AAClC,CAAC;AAEM,IAAM,uBAAuB,EAAE,OAAO;AAAA,EAC3C,MAAM,EAAE,QAAQ,MAAM;AAAA,EACtB,QAAQ;AAAA,EACR,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAC1B,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACvB,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACtB,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,aAAa,EAAE,OAAO;AAAA,EACtB,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,QAAQ;AAAA,EACR,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,SAAS;AAAA,EACnD,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,SAAS;AAAA,EAC9C,uBAAuB,EAAE,OAAO,EAAE,SAAS;AAAA,EAC3C,uBAAuB,EAAE,OAAO,EAAE,SAAS;AAAA,EAC3C,UAAU,EAAE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AAE,IAAI,MAAM,QAAQ,CAAC,EAAE;AAAA,EAChC;AACA,SAAO,EAAE,IAAI,OAAO,QAAQ,4BAA4B,OAAO,MAAM,MAAM,EAAE;AAC/E;AAGO,SAAS,uBAAuB,MAAiC;AACtE,SAAO,wBAAwB,sBAAsB,IAAI;AAC3D;AAGO,SAAS,uBAAuB,MAAiC;AACtE,SAAO,wBAAwB,sBAAsB,IAAI;AAC3D;AAGO,SAAS,wBAAwB,OAAkC;AACxE,SAAO,wBAAwB,uBAAuB,KAAK;AAC7D;AAGO,SAAS,4BAA4B,WAAsC;AAChF,SAAO,wBAAwB,2BAA2B,SAAS;AACrE;AAGO,SAAS,2BAA2B,UAAqC;AAC9E,SAAO,wBAAwB,0BAA0B,QAAQ;AACnE;AAGO,SAAS,sBAAsB,KAAgC;AACpE,SAAO,wBAAwB,qBAAqB,GAAG;AACzD;AAGO,SAAS,0BAA0B,SAAoC;AAC5E,SAAO,wBAAwB,yBAAyB,OAAO;AACjE;AAGO,SAAS,yBAAyB,QAAmC;AAC1E,SAAO,wBAAwB,wBAAwB,MAAM;AAC/D;","names":[]}
|
package/dist/cli/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
getAdapter
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-ISB7NAA4.js";
|
|
5
5
|
import {
|
|
6
6
|
analyzeConflicts,
|
|
7
7
|
buildMigrationReport,
|
|
@@ -17,10 +17,10 @@ import {
|
|
|
17
17
|
runMigration,
|
|
18
18
|
staleUrlsFromEstimate,
|
|
19
19
|
writeFilesystemExport
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-XJDLJM7Q.js";
|
|
21
21
|
import {
|
|
22
22
|
collectEntities
|
|
23
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-FEDV5UFR.js";
|
|
24
24
|
import "../chunk-7IGOKUKE.js";
|
|
25
25
|
import "../chunk-M6NY4OT7.js";
|
|
26
26
|
import "../chunk-XRCF73DA.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { M as MigrationAdapter,
|
|
2
|
-
export { A as AdapterContext, E as EntityKey,
|
|
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-
|
|
1
|
+
import { M as MigrationAdapter, h as MigrationPlatform } from './types-Bhi-0uKs.js';
|
|
2
|
+
export { A as AdapterContext, C as CommentModerationStatus, E as EntityKey, i as EntityType, j as MigrationCursor, b as NormalizedAsset, k as NormalizedAssetExif, d as NormalizedCategory, f as NormalizedComment, g as NormalizedEntity, a as NormalizedPage, c as NormalizedPortfolio, N as NormalizedPost, e as NormalizedTag, P as PageHeroSliderHint, l as PageLayoutHints, m as PortfolioMediaLink, n as PublishStatus, S as SourceMetadata, V as ValidationIssue, o as ValidationResult, W as WxrImportSummary, p as entityKey } from './types-Bhi-0uKs.js';
|
|
3
|
+
export { EntityState, MigrationCheckpoint, TrackedEntity, buildPortfolioMediaLinks, isTerminalState, normalizedAssetExifSchema, normalizedAssetSchema, normalizedCategorySchema, normalizedCommentSchema, normalizedEntitySchema, normalizedPageSchema, normalizedPortfolioSchema, normalizedPostSchema, normalizedTagSchema, shouldProcessEntity, sourceMetadataSchema, validateNormalizedAsset, validateNormalizedCategory, validateNormalizedComment, 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-CtVh_LGP.js';
|
|
5
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, resolveAdapterImportSummary, runDryRun, runMigration, runMigrationFromBundle, staleUrlsFromEstimate, summarizeAssetDiscovery, writeFilesystemExport } from './sinks/index.js';
|
|
6
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-escjz3gT.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';
|
|
@@ -432,7 +432,33 @@ declare function extractPageBodyHtml(html: string): string;
|
|
|
432
432
|
declare function extractPageContentFromHtml(html: string): Pick<SquarespacePage, "blocks" | "contentHtml">;
|
|
433
433
|
/** Parse rendered `body` HTML into block entries when wire JSON has no structured blocks. */
|
|
434
434
|
declare function extractBlocksFromBodyHtml(html: string): SquarespaceBlock[];
|
|
435
|
-
/**
|
|
435
|
+
/**
|
|
436
|
+
* Portfolio / gallery *item* shape (not URL path).
|
|
437
|
+
* - 7.1: `recordType: 59`, `recordTypeLabel: "portfolio-item"`
|
|
438
|
+
* - 7.0 gallery/project: `recordType: 2`, `recordTypeLabel: "image"`, `contentType: image/*`
|
|
439
|
+
*/
|
|
440
|
+
declare function isPortfolioOrGalleryItemRecord(item: WireRecord): boolean;
|
|
441
|
+
/**
|
|
442
|
+
* Structural fallback when `collection.typeName` is ambiguous: items are mostly
|
|
443
|
+
* cover/media rows (http image URL + empty body and/or portfolio/gallery item records),
|
|
444
|
+
* not blog posts with prose bodies.
|
|
445
|
+
*/
|
|
446
|
+
declare function collectionItemsLookLikeGalleryMedia(items: WireRecord[]): boolean;
|
|
447
|
+
/**
|
|
448
|
+
* Gallery / portfolio / project collection pages — items are media, not blog posts.
|
|
449
|
+
*
|
|
450
|
+
* Prefer Squarespace typeName/typeLabel (never URL path segments — slugs are user-defined).
|
|
451
|
+
*
|
|
452
|
+
* Verified against live Squarespace `?format=json-pretty` payloads:
|
|
453
|
+
* - 7.1 portfolio grids: `type: 23`, `typeName` like `portfolio-grid-basic`
|
|
454
|
+
* - 7.0 gallery: `type: 1`, `typeName: "gallery"`, items `recordTypeLabel: "image"`
|
|
455
|
+
* - 7.0 project: `type: 1`, `typeName: "project"`, image items
|
|
456
|
+
* - 7.0 index: `type: 1`, `typeName: "index"`, `folder: true` — **not** a media
|
|
457
|
+
* gallery (empty `items[]`; children are separate gallery/project collections)
|
|
458
|
+
*
|
|
459
|
+
* Note: hypothesized integers `type: 3|20|30` were **not** observed on these demos;
|
|
460
|
+
* 7.0 reuses `type: 1` across blog/gallery/index/project and discriminates via `typeName`.
|
|
461
|
+
*/
|
|
436
462
|
declare function isGalleryCollection(collection: WireRecord | undefined): boolean;
|
|
437
463
|
/** Map one Squarespace `?format=json-pretty` response into export partials. */
|
|
438
464
|
declare function mapJsonPrettyWire(wire: unknown, context?: {
|
|
@@ -665,4 +691,4 @@ declare const wixAdapter: MigrationAdapter;
|
|
|
665
691
|
|
|
666
692
|
declare function getAdapter(platform: MigrationPlatform): MigrationAdapter;
|
|
667
693
|
|
|
668
|
-
export { MigrationAdapter, MigrationPlatform, SMUGMUG_API_BASE, SMUGMUG_OAUTH_ENDPOINTS, SQUARESPACE_JSON_FORMAT, type SmugMugAccessLevel, SmugMugApiClient, type SmugMugAuthorizeUrlOptions, type SmugMugClientOptions, type SmugMugConsumerCredentials, type SmugMugCredentials, type SmugMugOAuthSession, type SmugMugOAuthSigningMaterial, type SmugMugOAuthTokenPair, type SmugMugPermissionLevel, type SmugMugRequestTokenResult, type SquarespaceClientOptions, type SquarespaceCollectTarget, SquarespaceCollectionClient, WixCollectionClient, WixPageSnapshotCollector, asSmugMugList, buildJsonPrettyUrl, buildSmugMugAuthorizationHeader, buildSmugMugAuthorizeUrl, createSmugMugOAuthSession, extractBlocksFromBodyHtml, extractPageBodyHtml, extractPageContentFromHtml, getAdapter, getSmugMugAccessToken, getSmugMugRequestToken, isEmptyClassicMainContent, isGalleryCollection, mapJsonPrettyWire, pageContentIsEmpty, parseSmugMugOAuthFormBody, readSmugMugCredentialsFromEnv, resolveSmugMugUriLink, signSmugMugOAuthRequest, smugMugConsumerCredentialsSchema, smugMugCredentialsSchema, smugmugAdapter, squarespaceAdapter, wixAdapter, wordpressAdapter };
|
|
694
|
+
export { MigrationAdapter, MigrationPlatform, SMUGMUG_API_BASE, SMUGMUG_OAUTH_ENDPOINTS, SQUARESPACE_JSON_FORMAT, type SmugMugAccessLevel, SmugMugApiClient, type SmugMugAuthorizeUrlOptions, type SmugMugClientOptions, type SmugMugConsumerCredentials, type SmugMugCredentials, type SmugMugOAuthSession, type SmugMugOAuthSigningMaterial, type SmugMugOAuthTokenPair, type SmugMugPermissionLevel, type SmugMugRequestTokenResult, type SquarespaceClientOptions, type SquarespaceCollectTarget, SquarespaceCollectionClient, WixCollectionClient, WixPageSnapshotCollector, asSmugMugList, buildJsonPrettyUrl, buildSmugMugAuthorizationHeader, buildSmugMugAuthorizeUrl, collectionItemsLookLikeGalleryMedia, createSmugMugOAuthSession, extractBlocksFromBodyHtml, extractPageBodyHtml, extractPageContentFromHtml, getAdapter, getSmugMugAccessToken, getSmugMugRequestToken, isEmptyClassicMainContent, isGalleryCollection, isPortfolioOrGalleryItemRecord, mapJsonPrettyWire, pageContentIsEmpty, parseSmugMugOAuthFormBody, readSmugMugCredentialsFromEnv, resolveSmugMugUriLink, signSmugMugOAuthRequest, smugMugConsumerCredentialsSchema, smugMugCredentialsSchema, smugmugAdapter, squarespaceAdapter, wixAdapter, wordpressAdapter };
|
package/dist/index.js
CHANGED
|
@@ -21,11 +21,12 @@ import {
|
|
|
21
21
|
squarespaceAdapter,
|
|
22
22
|
wixAdapter,
|
|
23
23
|
wordpressAdapter
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-ISB7NAA4.js";
|
|
25
25
|
import {
|
|
26
26
|
normalizedAssetExifSchema,
|
|
27
27
|
normalizedAssetSchema,
|
|
28
28
|
normalizedCategorySchema,
|
|
29
|
+
normalizedCommentSchema,
|
|
29
30
|
normalizedEntitySchema,
|
|
30
31
|
normalizedPageSchema,
|
|
31
32
|
normalizedPortfolioSchema,
|
|
@@ -34,12 +35,13 @@ import {
|
|
|
34
35
|
sourceMetadataSchema,
|
|
35
36
|
validateNormalizedAsset,
|
|
36
37
|
validateNormalizedCategory,
|
|
38
|
+
validateNormalizedComment,
|
|
37
39
|
validateNormalizedEntity,
|
|
38
40
|
validateNormalizedPage,
|
|
39
41
|
validateNormalizedPortfolio,
|
|
40
42
|
validateNormalizedPost,
|
|
41
43
|
validateNormalizedTag
|
|
42
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-YTLMN7HO.js";
|
|
43
45
|
import {
|
|
44
46
|
FALLBACK_ASSET_BYTES,
|
|
45
47
|
FilesystemMigrationSink,
|
|
@@ -51,6 +53,7 @@ import {
|
|
|
51
53
|
buildMigrationReport,
|
|
52
54
|
buildRedirectMap,
|
|
53
55
|
bundleToCombinedJson,
|
|
56
|
+
collectionItemsLookLikeGalleryMedia,
|
|
54
57
|
createFilesystemMigrationSink,
|
|
55
58
|
detectRedirectLoops,
|
|
56
59
|
emptyConflictReport,
|
|
@@ -62,6 +65,7 @@ import {
|
|
|
62
65
|
hasWarnings,
|
|
63
66
|
isEmptyClassicMainContent,
|
|
64
67
|
isGalleryCollection,
|
|
68
|
+
isPortfolioOrGalleryItemRecord,
|
|
65
69
|
mapJsonPrettyWire,
|
|
66
70
|
pageContentIsEmpty,
|
|
67
71
|
portfolioMediaMatchesBundle,
|
|
@@ -72,7 +76,7 @@ import {
|
|
|
72
76
|
staleUrlsFromEstimate,
|
|
73
77
|
summarizeAssetDiscovery,
|
|
74
78
|
writeFilesystemExport
|
|
75
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-XJDLJM7Q.js";
|
|
76
80
|
import {
|
|
77
81
|
buildPortfolioMediaLinks,
|
|
78
82
|
bundleCounts,
|
|
@@ -81,7 +85,7 @@ import {
|
|
|
81
85
|
entityKey,
|
|
82
86
|
isTerminalState,
|
|
83
87
|
shouldProcessEntity
|
|
84
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-FEDV5UFR.js";
|
|
85
89
|
import {
|
|
86
90
|
cssToStyles,
|
|
87
91
|
expandMigrationMediaRefs,
|
|
@@ -155,6 +159,7 @@ export {
|
|
|
155
159
|
bundleToCombinedJson,
|
|
156
160
|
canonicalizeInlineAssetUrl,
|
|
157
161
|
collectEntities,
|
|
162
|
+
collectionItemsLookLikeGalleryMedia,
|
|
158
163
|
createFilesystemMigrationSink,
|
|
159
164
|
createMigrationMediaRefReplaceWith,
|
|
160
165
|
createSmugMugOAuthSession,
|
|
@@ -191,6 +196,7 @@ export {
|
|
|
191
196
|
isLikelyImageUrl,
|
|
192
197
|
isLikelyVideoUrl,
|
|
193
198
|
isMigrationMediaRef,
|
|
199
|
+
isPortfolioOrGalleryItemRecord,
|
|
194
200
|
isTerminalState,
|
|
195
201
|
linkToPath,
|
|
196
202
|
mapJsonPrettyWire,
|
|
@@ -198,6 +204,7 @@ export {
|
|
|
198
204
|
normalizedAssetExifSchema,
|
|
199
205
|
normalizedAssetSchema,
|
|
200
206
|
normalizedCategorySchema,
|
|
207
|
+
normalizedCommentSchema,
|
|
201
208
|
normalizedEntitySchema,
|
|
202
209
|
normalizedPageSchema,
|
|
203
210
|
normalizedPortfolioSchema,
|
|
@@ -234,6 +241,7 @@ export {
|
|
|
234
241
|
validateGrapesProjectSnapshot,
|
|
235
242
|
validateNormalizedAsset,
|
|
236
243
|
validateNormalizedCategory,
|
|
244
|
+
validateNormalizedComment,
|
|
237
245
|
validateNormalizedEntity,
|
|
238
246
|
validateNormalizedPage,
|
|
239
247
|
validateNormalizedPortfolio,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as AdapterContext,
|
|
3
|
-
import { E as EntityBundle } from '../bundle-
|
|
4
|
-
export { B as BundleCounts, b as bundleCounts, c as collectEntities, e as emptyBundle } from '../bundle-
|
|
1
|
+
import { j as MigrationCursor, E as EntityKey, m as PortfolioMediaLink, o as ValidationResult } from '../types-Bhi-0uKs.js';
|
|
2
|
+
export { A as AdapterContext, C as CommentModerationStatus, i as EntityType, M as MigrationAdapter, h as MigrationPlatform, b as NormalizedAsset, k as NormalizedAssetExif, d as NormalizedCategory, f as NormalizedComment, g as NormalizedEntity, a as NormalizedPage, c as NormalizedPortfolio, N as NormalizedPost, e as NormalizedTag, P as PageHeroSliderHint, l as PageLayoutHints, n as PublishStatus, S as SourceMetadata, V as ValidationIssue, W as WxrImportSummary, p as entityKey } from '../types-Bhi-0uKs.js';
|
|
3
|
+
import { E as EntityBundle } from '../bundle-CtVh_LGP.js';
|
|
4
|
+
export { B as BundleCounts, b as bundleCounts, c as collectEntities, e as emptyBundle } from '../bundle-CtVh_LGP.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
|
|
7
7
|
/** Portable entity state for resume / idempotency (not Directus field names). */
|
|
@@ -76,6 +76,7 @@ declare const normalizedPostSchema: z.ZodObject<{
|
|
|
76
76
|
featuredAssetSourceId: z.ZodOptional<z.ZodString>;
|
|
77
77
|
seoTitle: z.ZodOptional<z.ZodString>;
|
|
78
78
|
seoDescription: z.ZodOptional<z.ZodString>;
|
|
79
|
+
sourceLikeCount: z.ZodOptional<z.ZodNumber>;
|
|
79
80
|
}, "strip", z.ZodTypeAny, {
|
|
80
81
|
type: "post";
|
|
81
82
|
status: "draft" | "published" | "archived";
|
|
@@ -98,6 +99,7 @@ declare const normalizedPostSchema: z.ZodObject<{
|
|
|
98
99
|
featuredAssetSourceId?: string | undefined;
|
|
99
100
|
seoTitle?: string | undefined;
|
|
100
101
|
seoDescription?: string | undefined;
|
|
102
|
+
sourceLikeCount?: number | undefined;
|
|
101
103
|
}, {
|
|
102
104
|
type: "post";
|
|
103
105
|
status: "draft" | "published" | "archived";
|
|
@@ -120,6 +122,77 @@ declare const normalizedPostSchema: z.ZodObject<{
|
|
|
120
122
|
featuredAssetSourceId?: string | undefined;
|
|
121
123
|
seoTitle?: string | undefined;
|
|
122
124
|
seoDescription?: string | undefined;
|
|
125
|
+
sourceLikeCount?: number | undefined;
|
|
126
|
+
}>;
|
|
127
|
+
declare const normalizedCommentSchema: z.ZodObject<{
|
|
128
|
+
type: z.ZodLiteral<"comment">;
|
|
129
|
+
source: z.ZodObject<{
|
|
130
|
+
platform: z.ZodEnum<["wordpress", "smugmug", "squarespace", "wix"]>;
|
|
131
|
+
id: z.ZodString;
|
|
132
|
+
url: z.ZodOptional<z.ZodString>;
|
|
133
|
+
path: z.ZodOptional<z.ZodString>;
|
|
134
|
+
exportedAt: z.ZodOptional<z.ZodString>;
|
|
135
|
+
}, "strip", z.ZodTypeAny, {
|
|
136
|
+
platform: "wordpress" | "smugmug" | "squarespace" | "wix";
|
|
137
|
+
id: string;
|
|
138
|
+
url?: string | undefined;
|
|
139
|
+
path?: string | undefined;
|
|
140
|
+
exportedAt?: string | undefined;
|
|
141
|
+
}, {
|
|
142
|
+
platform: "wordpress" | "smugmug" | "squarespace" | "wix";
|
|
143
|
+
id: string;
|
|
144
|
+
url?: string | undefined;
|
|
145
|
+
path?: string | undefined;
|
|
146
|
+
exportedAt?: string | undefined;
|
|
147
|
+
}>;
|
|
148
|
+
sourceId: z.ZodString;
|
|
149
|
+
postSourceId: z.ZodString;
|
|
150
|
+
parentSourceId: z.ZodOptional<z.ZodString>;
|
|
151
|
+
contentHtml: z.ZodString;
|
|
152
|
+
status: z.ZodEnum<["approved", "pending", "spam", "rejected"]>;
|
|
153
|
+
authorType: z.ZodLiteral<"guest">;
|
|
154
|
+
authorName: z.ZodOptional<z.ZodString>;
|
|
155
|
+
authorEmail: z.ZodOptional<z.ZodString>;
|
|
156
|
+
authorUrl: z.ZodOptional<z.ZodString>;
|
|
157
|
+
publishedAt: z.ZodOptional<z.ZodString>;
|
|
158
|
+
}, "strip", z.ZodTypeAny, {
|
|
159
|
+
type: "comment";
|
|
160
|
+
status: "approved" | "pending" | "spam" | "rejected";
|
|
161
|
+
source: {
|
|
162
|
+
platform: "wordpress" | "smugmug" | "squarespace" | "wix";
|
|
163
|
+
id: string;
|
|
164
|
+
url?: string | undefined;
|
|
165
|
+
path?: string | undefined;
|
|
166
|
+
exportedAt?: string | undefined;
|
|
167
|
+
};
|
|
168
|
+
sourceId: string;
|
|
169
|
+
contentHtml: string;
|
|
170
|
+
postSourceId: string;
|
|
171
|
+
authorType: "guest";
|
|
172
|
+
publishedAt?: string | undefined;
|
|
173
|
+
parentSourceId?: string | undefined;
|
|
174
|
+
authorName?: string | undefined;
|
|
175
|
+
authorEmail?: string | undefined;
|
|
176
|
+
authorUrl?: string | undefined;
|
|
177
|
+
}, {
|
|
178
|
+
type: "comment";
|
|
179
|
+
status: "approved" | "pending" | "spam" | "rejected";
|
|
180
|
+
source: {
|
|
181
|
+
platform: "wordpress" | "smugmug" | "squarespace" | "wix";
|
|
182
|
+
id: string;
|
|
183
|
+
url?: string | undefined;
|
|
184
|
+
path?: string | undefined;
|
|
185
|
+
exportedAt?: string | undefined;
|
|
186
|
+
};
|
|
187
|
+
sourceId: string;
|
|
188
|
+
contentHtml: string;
|
|
189
|
+
postSourceId: string;
|
|
190
|
+
authorType: "guest";
|
|
191
|
+
publishedAt?: string | undefined;
|
|
192
|
+
parentSourceId?: string | undefined;
|
|
193
|
+
authorName?: string | undefined;
|
|
194
|
+
authorEmail?: string | undefined;
|
|
195
|
+
authorUrl?: string | undefined;
|
|
123
196
|
}>;
|
|
124
197
|
declare const normalizedPageSchema: z.ZodObject<{
|
|
125
198
|
type: z.ZodLiteral<"page">;
|
|
@@ -388,8 +461,8 @@ declare const normalizedPortfolioSchema: z.ZodObject<{
|
|
|
388
461
|
sourceId: string;
|
|
389
462
|
title: string;
|
|
390
463
|
slug: string;
|
|
391
|
-
description?: string | undefined;
|
|
392
464
|
parentSourceId?: string | undefined;
|
|
465
|
+
description?: string | undefined;
|
|
393
466
|
}, {
|
|
394
467
|
type: "portfolio";
|
|
395
468
|
source: {
|
|
@@ -402,8 +475,8 @@ declare const normalizedPortfolioSchema: z.ZodObject<{
|
|
|
402
475
|
sourceId: string;
|
|
403
476
|
title: string;
|
|
404
477
|
slug: string;
|
|
405
|
-
description?: string | undefined;
|
|
406
478
|
parentSourceId?: string | undefined;
|
|
479
|
+
description?: string | undefined;
|
|
407
480
|
}>;
|
|
408
481
|
declare const normalizedCategorySchema: z.ZodObject<{
|
|
409
482
|
type: z.ZodLiteral<"category">;
|
|
@@ -537,6 +610,7 @@ declare const normalizedEntitySchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
537
610
|
featuredAssetSourceId: z.ZodOptional<z.ZodString>;
|
|
538
611
|
seoTitle: z.ZodOptional<z.ZodString>;
|
|
539
612
|
seoDescription: z.ZodOptional<z.ZodString>;
|
|
613
|
+
sourceLikeCount: z.ZodOptional<z.ZodNumber>;
|
|
540
614
|
}, "strip", z.ZodTypeAny, {
|
|
541
615
|
type: "post";
|
|
542
616
|
status: "draft" | "published" | "archived";
|
|
@@ -559,6 +633,7 @@ declare const normalizedEntitySchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
559
633
|
featuredAssetSourceId?: string | undefined;
|
|
560
634
|
seoTitle?: string | undefined;
|
|
561
635
|
seoDescription?: string | undefined;
|
|
636
|
+
sourceLikeCount?: number | undefined;
|
|
562
637
|
}, {
|
|
563
638
|
type: "post";
|
|
564
639
|
status: "draft" | "published" | "archived";
|
|
@@ -581,6 +656,7 @@ declare const normalizedEntitySchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
581
656
|
featuredAssetSourceId?: string | undefined;
|
|
582
657
|
seoTitle?: string | undefined;
|
|
583
658
|
seoDescription?: string | undefined;
|
|
659
|
+
sourceLikeCount?: number | undefined;
|
|
584
660
|
}>, z.ZodObject<{
|
|
585
661
|
type: z.ZodLiteral<"page">;
|
|
586
662
|
source: z.ZodObject<{
|
|
@@ -830,8 +906,8 @@ declare const normalizedEntitySchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
830
906
|
sourceId: string;
|
|
831
907
|
title: string;
|
|
832
908
|
slug: string;
|
|
833
|
-
description?: string | undefined;
|
|
834
909
|
parentSourceId?: string | undefined;
|
|
910
|
+
description?: string | undefined;
|
|
835
911
|
}, {
|
|
836
912
|
type: "portfolio";
|
|
837
913
|
source: {
|
|
@@ -844,8 +920,8 @@ declare const normalizedEntitySchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
844
920
|
sourceId: string;
|
|
845
921
|
title: string;
|
|
846
922
|
slug: string;
|
|
847
|
-
description?: string | undefined;
|
|
848
923
|
parentSourceId?: string | undefined;
|
|
924
|
+
description?: string | undefined;
|
|
849
925
|
}>, z.ZodObject<{
|
|
850
926
|
type: z.ZodLiteral<"category">;
|
|
851
927
|
source: z.ZodObject<{
|
|
@@ -942,6 +1018,75 @@ declare const normalizedEntitySchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
942
1018
|
sourceId: string;
|
|
943
1019
|
slug: string;
|
|
944
1020
|
name: string;
|
|
1021
|
+
}>, z.ZodObject<{
|
|
1022
|
+
type: z.ZodLiteral<"comment">;
|
|
1023
|
+
source: z.ZodObject<{
|
|
1024
|
+
platform: z.ZodEnum<["wordpress", "smugmug", "squarespace", "wix"]>;
|
|
1025
|
+
id: z.ZodString;
|
|
1026
|
+
url: z.ZodOptional<z.ZodString>;
|
|
1027
|
+
path: z.ZodOptional<z.ZodString>;
|
|
1028
|
+
exportedAt: z.ZodOptional<z.ZodString>;
|
|
1029
|
+
}, "strip", z.ZodTypeAny, {
|
|
1030
|
+
platform: "wordpress" | "smugmug" | "squarespace" | "wix";
|
|
1031
|
+
id: string;
|
|
1032
|
+
url?: string | undefined;
|
|
1033
|
+
path?: string | undefined;
|
|
1034
|
+
exportedAt?: string | undefined;
|
|
1035
|
+
}, {
|
|
1036
|
+
platform: "wordpress" | "smugmug" | "squarespace" | "wix";
|
|
1037
|
+
id: string;
|
|
1038
|
+
url?: string | undefined;
|
|
1039
|
+
path?: string | undefined;
|
|
1040
|
+
exportedAt?: string | undefined;
|
|
1041
|
+
}>;
|
|
1042
|
+
sourceId: z.ZodString;
|
|
1043
|
+
postSourceId: z.ZodString;
|
|
1044
|
+
parentSourceId: z.ZodOptional<z.ZodString>;
|
|
1045
|
+
contentHtml: z.ZodString;
|
|
1046
|
+
status: z.ZodEnum<["approved", "pending", "spam", "rejected"]>;
|
|
1047
|
+
authorType: z.ZodLiteral<"guest">;
|
|
1048
|
+
authorName: z.ZodOptional<z.ZodString>;
|
|
1049
|
+
authorEmail: z.ZodOptional<z.ZodString>;
|
|
1050
|
+
authorUrl: z.ZodOptional<z.ZodString>;
|
|
1051
|
+
publishedAt: z.ZodOptional<z.ZodString>;
|
|
1052
|
+
}, "strip", z.ZodTypeAny, {
|
|
1053
|
+
type: "comment";
|
|
1054
|
+
status: "approved" | "pending" | "spam" | "rejected";
|
|
1055
|
+
source: {
|
|
1056
|
+
platform: "wordpress" | "smugmug" | "squarespace" | "wix";
|
|
1057
|
+
id: string;
|
|
1058
|
+
url?: string | undefined;
|
|
1059
|
+
path?: string | undefined;
|
|
1060
|
+
exportedAt?: string | undefined;
|
|
1061
|
+
};
|
|
1062
|
+
sourceId: string;
|
|
1063
|
+
contentHtml: string;
|
|
1064
|
+
postSourceId: string;
|
|
1065
|
+
authorType: "guest";
|
|
1066
|
+
publishedAt?: string | undefined;
|
|
1067
|
+
parentSourceId?: string | undefined;
|
|
1068
|
+
authorName?: string | undefined;
|
|
1069
|
+
authorEmail?: string | undefined;
|
|
1070
|
+
authorUrl?: string | undefined;
|
|
1071
|
+
}, {
|
|
1072
|
+
type: "comment";
|
|
1073
|
+
status: "approved" | "pending" | "spam" | "rejected";
|
|
1074
|
+
source: {
|
|
1075
|
+
platform: "wordpress" | "smugmug" | "squarespace" | "wix";
|
|
1076
|
+
id: string;
|
|
1077
|
+
url?: string | undefined;
|
|
1078
|
+
path?: string | undefined;
|
|
1079
|
+
exportedAt?: string | undefined;
|
|
1080
|
+
};
|
|
1081
|
+
sourceId: string;
|
|
1082
|
+
contentHtml: string;
|
|
1083
|
+
postSourceId: string;
|
|
1084
|
+
authorType: "guest";
|
|
1085
|
+
publishedAt?: string | undefined;
|
|
1086
|
+
parentSourceId?: string | undefined;
|
|
1087
|
+
authorName?: string | undefined;
|
|
1088
|
+
authorEmail?: string | undefined;
|
|
1089
|
+
authorUrl?: string | undefined;
|
|
945
1090
|
}>]>;
|
|
946
1091
|
/** Opt-in structural check for a normalized post DTO (no cross-entity FK validation). */
|
|
947
1092
|
declare function validateNormalizedPost(post: unknown): ValidationResult;
|
|
@@ -955,7 +1100,9 @@ declare function validateNormalizedPortfolio(portfolio: unknown): ValidationResu
|
|
|
955
1100
|
declare function validateNormalizedCategory(category: unknown): ValidationResult;
|
|
956
1101
|
/** Opt-in structural check for a normalized tag DTO. */
|
|
957
1102
|
declare function validateNormalizedTag(tag: unknown): ValidationResult;
|
|
1103
|
+
/** Opt-in structural check for a normalized comment DTO. */
|
|
1104
|
+
declare function validateNormalizedComment(comment: unknown): ValidationResult;
|
|
958
1105
|
/** Opt-in structural check for any normalized entity discriminated by `type`. */
|
|
959
1106
|
declare function validateNormalizedEntity(entity: unknown): ValidationResult;
|
|
960
1107
|
|
|
961
|
-
export { EntityBundle, EntityKey, type EntityState, type MigrationCheckpoint, MigrationCursor, PortfolioMediaLink, type TrackedEntity, ValidationResult, buildPortfolioMediaLinks, isTerminalState, normalizedAssetExifSchema, normalizedAssetSchema, normalizedCategorySchema, normalizedEntitySchema, normalizedPageSchema, normalizedPortfolioSchema, normalizedPostSchema, normalizedTagSchema, shouldProcessEntity, sourceMetadataSchema, validateNormalizedAsset, validateNormalizedCategory, validateNormalizedEntity, validateNormalizedPage, validateNormalizedPortfolio, validateNormalizedPost, validateNormalizedTag };
|
|
1108
|
+
export { EntityBundle, EntityKey, type EntityState, type MigrationCheckpoint, MigrationCursor, PortfolioMediaLink, type TrackedEntity, ValidationResult, buildPortfolioMediaLinks, isTerminalState, normalizedAssetExifSchema, normalizedAssetSchema, normalizedCategorySchema, normalizedCommentSchema, normalizedEntitySchema, normalizedPageSchema, normalizedPortfolioSchema, normalizedPostSchema, normalizedTagSchema, shouldProcessEntity, sourceMetadataSchema, validateNormalizedAsset, validateNormalizedCategory, validateNormalizedComment, validateNormalizedEntity, validateNormalizedPage, validateNormalizedPortfolio, validateNormalizedPost, validateNormalizedTag };
|
package/dist/normalizer/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
normalizedAssetExifSchema,
|
|
3
3
|
normalizedAssetSchema,
|
|
4
4
|
normalizedCategorySchema,
|
|
5
|
+
normalizedCommentSchema,
|
|
5
6
|
normalizedEntitySchema,
|
|
6
7
|
normalizedPageSchema,
|
|
7
8
|
normalizedPortfolioSchema,
|
|
@@ -10,12 +11,13 @@ import {
|
|
|
10
11
|
sourceMetadataSchema,
|
|
11
12
|
validateNormalizedAsset,
|
|
12
13
|
validateNormalizedCategory,
|
|
14
|
+
validateNormalizedComment,
|
|
13
15
|
validateNormalizedEntity,
|
|
14
16
|
validateNormalizedPage,
|
|
15
17
|
validateNormalizedPortfolio,
|
|
16
18
|
validateNormalizedPost,
|
|
17
19
|
validateNormalizedTag
|
|
18
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-YTLMN7HO.js";
|
|
19
21
|
import {
|
|
20
22
|
buildPortfolioMediaLinks,
|
|
21
23
|
bundleCounts,
|
|
@@ -24,7 +26,7 @@ import {
|
|
|
24
26
|
entityKey,
|
|
25
27
|
isTerminalState,
|
|
26
28
|
shouldProcessEntity
|
|
27
|
-
} from "../chunk-
|
|
29
|
+
} from "../chunk-FEDV5UFR.js";
|
|
28
30
|
export {
|
|
29
31
|
buildPortfolioMediaLinks,
|
|
30
32
|
bundleCounts,
|
|
@@ -35,6 +37,7 @@ export {
|
|
|
35
37
|
normalizedAssetExifSchema,
|
|
36
38
|
normalizedAssetSchema,
|
|
37
39
|
normalizedCategorySchema,
|
|
40
|
+
normalizedCommentSchema,
|
|
38
41
|
normalizedEntitySchema,
|
|
39
42
|
normalizedPageSchema,
|
|
40
43
|
normalizedPortfolioSchema,
|
|
@@ -44,6 +47,7 @@ export {
|
|
|
44
47
|
sourceMetadataSchema,
|
|
45
48
|
validateNormalizedAsset,
|
|
46
49
|
validateNormalizedCategory,
|
|
50
|
+
validateNormalizedComment,
|
|
47
51
|
validateNormalizedEntity,
|
|
48
52
|
validateNormalizedPage,
|
|
49
53
|
validateNormalizedPortfolio,
|
package/dist/sinks/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { d as NormalizedCategory, e as NormalizedTag, b as NormalizedAsset, c as NormalizedPortfolio, N as NormalizedPost, a as NormalizedPage,
|
|
1
|
+
import { d as NormalizedCategory, e as NormalizedTag, b as NormalizedAsset, c as NormalizedPortfolio, N as NormalizedPost, a as NormalizedPage, f as NormalizedComment, m as PortfolioMediaLink, E as EntityKey, g as NormalizedEntity, h as MigrationPlatform, W as WxrImportSummary, M as MigrationAdapter } from '../types-Bhi-0uKs.js';
|
|
2
2
|
import { Readable } from 'node:stream';
|
|
3
3
|
import { a as RewriteInlineImagesOptions } from '../rewrite-inline-images-escjz3gT.js';
|
|
4
4
|
export { b as RewriteInlineImagesResult, r as rewriteInlineImages } from '../rewrite-inline-images-escjz3gT.js';
|
|
5
|
-
import { E as EntityBundle } from '../bundle-
|
|
5
|
+
import { E as EntityBundle } from '../bundle-CtVh_LGP.js';
|
|
6
6
|
import '../media-urls-ScJvYI7b.js';
|
|
7
7
|
|
|
8
8
|
interface CreatePostResult {
|
|
@@ -13,6 +13,9 @@ interface CreatePageResult {
|
|
|
13
13
|
targetId: string;
|
|
14
14
|
publicPath: string;
|
|
15
15
|
}
|
|
16
|
+
interface CreateCommentResult {
|
|
17
|
+
targetId: string;
|
|
18
|
+
}
|
|
16
19
|
interface UploadAssetInput {
|
|
17
20
|
asset: NormalizedAsset;
|
|
18
21
|
/** Byte stream from source URL or local file. Optional for metadata-only sinks. */
|
|
@@ -50,6 +53,8 @@ interface MigrationSink {
|
|
|
50
53
|
}>;
|
|
51
54
|
createPost(post: NormalizedPost): Promise<CreatePostResult>;
|
|
52
55
|
createPage(page: NormalizedPage): Promise<CreatePageResult>;
|
|
56
|
+
/** M-engagement — optional until host implements comment import. */
|
|
57
|
+
createComment?(comment: NormalizedComment): Promise<CreateCommentResult>;
|
|
53
58
|
linkPortfolioMedia?(link: PortfolioMediaLink): Promise<void>;
|
|
54
59
|
writeRedirect?(redirect: MigrationRedirect): Promise<void>;
|
|
55
60
|
reportProgress?(progress: MigrationProgress): Promise<void>;
|
|
@@ -75,7 +80,7 @@ interface MigrationRunResult {
|
|
|
75
80
|
failed: number;
|
|
76
81
|
skipped: number;
|
|
77
82
|
}
|
|
78
|
-
declare const MIGRATION_WRITE_STAGES: readonly ["taxonomy", "assets", "portfolios", "content", "bindings", "redirects"];
|
|
83
|
+
declare const MIGRATION_WRITE_STAGES: readonly ["taxonomy", "assets", "portfolios", "content", "engagement", "bindings", "redirects"];
|
|
79
84
|
type MigrationWriteStage = (typeof MIGRATION_WRITE_STAGES)[number];
|
|
80
85
|
|
|
81
86
|
declare function runMigration(options: MigrationRunOptions): Promise<MigrationRunResult>;
|
|
@@ -177,6 +182,7 @@ interface MigrationReport {
|
|
|
177
182
|
portfolios: number;
|
|
178
183
|
categories: number;
|
|
179
184
|
tags: number;
|
|
185
|
+
comments: number;
|
|
180
186
|
storageBytesEstimated?: number;
|
|
181
187
|
assetDiscovery?: AssetDiscoverySummary;
|
|
182
188
|
importableItemCount?: number;
|
|
@@ -236,6 +242,7 @@ declare class FilesystemMigrationSink implements MigrationSink {
|
|
|
236
242
|
}>;
|
|
237
243
|
createPost(post: NormalizedPost): Promise<CreatePostResult>;
|
|
238
244
|
createPage(page: NormalizedPage): Promise<CreatePageResult>;
|
|
245
|
+
createComment(comment: NormalizedComment): Promise<CreateCommentResult>;
|
|
239
246
|
linkPortfolioMedia(link: PortfolioMediaLink): Promise<void>;
|
|
240
247
|
writeRedirect(redirect: MigrationRedirect): Promise<void>;
|
|
241
248
|
flush(options: WriteFilesystemOptions): Promise<void>;
|
package/dist/sinks/index.js
CHANGED
|
@@ -20,8 +20,8 @@ import {
|
|
|
20
20
|
staleUrlsFromEstimate,
|
|
21
21
|
summarizeAssetDiscovery,
|
|
22
22
|
writeFilesystemExport
|
|
23
|
-
} from "../chunk-
|
|
24
|
-
import "../chunk-
|
|
23
|
+
} from "../chunk-XJDLJM7Q.js";
|
|
24
|
+
import "../chunk-FEDV5UFR.js";
|
|
25
25
|
import {
|
|
26
26
|
rewriteInlineImages
|
|
27
27
|
} from "../chunk-M6NY4OT7.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { o as ValidationResult } from '../types-Bhi-0uKs.js';
|
|
3
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-escjz3gT.js';
|
|
4
4
|
export { d as buildMigrationMediaUrlIndex } from '../media-urls-ScJvYI7b.js';
|
|
5
5
|
|