@prenta/import 0.5.0
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/CHANGELOG.md +686 -0
- package/LICENSE +21 -0
- package/README.md +24 -0
- package/dist/adapter.d.ts +47 -0
- package/dist/adapter.d.ts.map +1 -0
- package/dist/adapter.js +60 -0
- package/dist/adapter.js.map +1 -0
- package/dist/adapters/contentful/asset.d.ts +47 -0
- package/dist/adapters/contentful/asset.d.ts.map +1 -0
- package/dist/adapters/contentful/asset.js +88 -0
- package/dist/adapters/contentful/asset.js.map +1 -0
- package/dist/adapters/contentful/index.d.ts +24 -0
- package/dist/adapters/contentful/index.d.ts.map +1 -0
- package/dist/adapters/contentful/index.js +242 -0
- package/dist/adapters/contentful/index.js.map +1 -0
- package/dist/adapters/contentful/locale.d.ts +66 -0
- package/dist/adapters/contentful/locale.d.ts.map +1 -0
- package/dist/adapters/contentful/locale.js +125 -0
- package/dist/adapters/contentful/locale.js.map +1 -0
- package/dist/adapters/contentful/map.d.ts +69 -0
- package/dist/adapters/contentful/map.d.ts.map +1 -0
- package/dist/adapters/contentful/map.js +174 -0
- package/dist/adapters/contentful/map.js.map +1 -0
- package/dist/adapters/contentful/rich-text.d.ts +52 -0
- package/dist/adapters/contentful/rich-text.d.ts.map +1 -0
- package/dist/adapters/contentful/rich-text.js +95 -0
- package/dist/adapters/contentful/rich-text.js.map +1 -0
- package/dist/adapters/contentful/types.d.ts +189 -0
- package/dist/adapters/contentful/types.d.ts.map +1 -0
- package/dist/adapters/contentful/types.js +26 -0
- package/dist/adapters/contentful/types.js.map +1 -0
- package/dist/adapters/identity.d.ts +27 -0
- package/dist/adapters/identity.d.ts.map +1 -0
- package/dist/adapters/identity.js +116 -0
- package/dist/adapters/identity.js.map +1 -0
- package/dist/adapters/sanity/asset.d.ts +45 -0
- package/dist/adapters/sanity/asset.d.ts.map +1 -0
- package/dist/adapters/sanity/asset.js +79 -0
- package/dist/adapters/sanity/asset.js.map +1 -0
- package/dist/adapters/sanity/index.d.ts +19 -0
- package/dist/adapters/sanity/index.d.ts.map +1 -0
- package/dist/adapters/sanity/index.js +165 -0
- package/dist/adapters/sanity/index.js.map +1 -0
- package/dist/adapters/sanity/map.d.ts +75 -0
- package/dist/adapters/sanity/map.d.ts.map +1 -0
- package/dist/adapters/sanity/map.js +245 -0
- package/dist/adapters/sanity/map.js.map +1 -0
- package/dist/adapters/sanity/parse.d.ts +64 -0
- package/dist/adapters/sanity/parse.d.ts.map +1 -0
- package/dist/adapters/sanity/parse.js +71 -0
- package/dist/adapters/sanity/parse.js.map +1 -0
- package/dist/adapters/sanity/portable-text.d.ts +64 -0
- package/dist/adapters/sanity/portable-text.d.ts.map +1 -0
- package/dist/adapters/sanity/portable-text.js +112 -0
- package/dist/adapters/sanity/portable-text.js.map +1 -0
- package/dist/adapters/sanity/types.d.ts +182 -0
- package/dist/adapters/sanity/types.d.ts.map +1 -0
- package/dist/adapters/sanity/types.js +17 -0
- package/dist/adapters/sanity/types.js.map +1 -0
- package/dist/adapters/strapi/asset.d.ts +56 -0
- package/dist/adapters/strapi/asset.d.ts.map +1 -0
- package/dist/adapters/strapi/asset.js +94 -0
- package/dist/adapters/strapi/asset.js.map +1 -0
- package/dist/adapters/strapi/index.d.ts +20 -0
- package/dist/adapters/strapi/index.d.ts.map +1 -0
- package/dist/adapters/strapi/index.js +205 -0
- package/dist/adapters/strapi/index.js.map +1 -0
- package/dist/adapters/strapi/links.d.ts +79 -0
- package/dist/adapters/strapi/links.d.ts.map +1 -0
- package/dist/adapters/strapi/links.js +98 -0
- package/dist/adapters/strapi/links.js.map +1 -0
- package/dist/adapters/strapi/loader.d.ts +68 -0
- package/dist/adapters/strapi/loader.d.ts.map +1 -0
- package/dist/adapters/strapi/loader.js +177 -0
- package/dist/adapters/strapi/loader.js.map +1 -0
- package/dist/adapters/strapi/map.d.ts +53 -0
- package/dist/adapters/strapi/map.d.ts.map +1 -0
- package/dist/adapters/strapi/map.js +193 -0
- package/dist/adapters/strapi/map.js.map +1 -0
- package/dist/adapters/strapi/types.d.ts +174 -0
- package/dist/adapters/strapi/types.d.ts.map +1 -0
- package/dist/adapters/strapi/types.js +31 -0
- package/dist/adapters/strapi/types.js.map +1 -0
- package/dist/adapters/strapi/uid.d.ts +44 -0
- package/dist/adapters/strapi/uid.d.ts.map +1 -0
- package/dist/adapters/strapi/uid.js +58 -0
- package/dist/adapters/strapi/uid.js.map +1 -0
- package/dist/adapters/wordpress/attachments.d.ts +37 -0
- package/dist/adapters/wordpress/attachments.d.ts.map +1 -0
- package/dist/adapters/wordpress/attachments.js +134 -0
- package/dist/adapters/wordpress/attachments.js.map +1 -0
- package/dist/adapters/wordpress/authors.d.ts +24 -0
- package/dist/adapters/wordpress/authors.d.ts.map +1 -0
- package/dist/adapters/wordpress/authors.js +40 -0
- package/dist/adapters/wordpress/authors.js.map +1 -0
- package/dist/adapters/wordpress/index.d.ts +19 -0
- package/dist/adapters/wordpress/index.d.ts.map +1 -0
- package/dist/adapters/wordpress/index.js +281 -0
- package/dist/adapters/wordpress/index.js.map +1 -0
- package/dist/adapters/wordpress/map.d.ts +61 -0
- package/dist/adapters/wordpress/map.d.ts.map +1 -0
- package/dist/adapters/wordpress/map.js +265 -0
- package/dist/adapters/wordpress/map.js.map +1 -0
- package/dist/adapters/wordpress/parse.d.ts +50 -0
- package/dist/adapters/wordpress/parse.d.ts.map +1 -0
- package/dist/adapters/wordpress/parse.js +141 -0
- package/dist/adapters/wordpress/parse.js.map +1 -0
- package/dist/adapters/wordpress/terms.d.ts +46 -0
- package/dist/adapters/wordpress/terms.d.ts.map +1 -0
- package/dist/adapters/wordpress/terms.js +87 -0
- package/dist/adapters/wordpress/terms.js.map +1 -0
- package/dist/adapters/wordpress/types.d.ts +201 -0
- package/dist/adapters/wordpress/types.d.ts.map +1 -0
- package/dist/adapters/wordpress/types.js +24 -0
- package/dist/adapters/wordpress/types.js.map +1 -0
- package/dist/cli.d.ts +16 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +266 -0
- package/dist/cli.js.map +1 -0
- package/dist/formatter.d.ts +12 -0
- package/dist/formatter.d.ts.map +1 -0
- package/dist/formatter.js +48 -0
- package/dist/formatter.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/migrate.d.ts +151 -0
- package/dist/migrate.d.ts.map +1 -0
- package/dist/migrate.js +255 -0
- package/dist/migrate.js.map +1 -0
- package/dist/registry.d.ts +39 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +62 -0
- package/dist/registry.js.map +1 -0
- package/dist/runner.d.ts +33 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +61 -0
- package/dist/runner.js.map +1 -0
- package/dist/types.d.ts +173 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +17 -0
- package/dist/types.js.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for the structural shapes the WordPress adapter
|
|
3
|
+
* recognizes in a **WXR** (WordPress eXtended RSS) export.
|
|
4
|
+
*
|
|
5
|
+
* WXR is RSS 2.0 with a handful of namespaces piled on
|
|
6
|
+
* (`wp:`, `content:`, `dc:`, `excerpt:`). Every WP install can
|
|
7
|
+
* produce one from `Tools → Export`; it's the de-facto interchange
|
|
8
|
+
* format every other WP-aware tool reads, which is why the
|
|
9
|
+
* adapter targets it rather than the REST API.
|
|
10
|
+
*
|
|
11
|
+
* Two things drive the design:
|
|
12
|
+
*
|
|
13
|
+
* - **HTML content is the source of truth.** Body, excerpt, and
|
|
14
|
+
* sometimes title come through as raw HTML inside CDATA. The
|
|
15
|
+
* adapter passes them through verbatim — block conversion is
|
|
16
|
+
* explicitly out of scope (operators run an HTML → MDX /
|
|
17
|
+
* portable-text pass downstream).
|
|
18
|
+
* - **Authors, categories, tags, and attachments are first-class
|
|
19
|
+
* siblings of posts** in WXR, not annotations. They each get
|
|
20
|
+
* their own slot in the channel and can become their own
|
|
21
|
+
* Prenta collections (configurable).
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Top-level shape after XML parsing. `fast-xml-parser` is
|
|
25
|
+
* configured to emit arrays for known repeating elements
|
|
26
|
+
* (`item`, `wp:author`, `wp:category`, `wp:tag`, `wp:postmeta`,
|
|
27
|
+
* `category`) so the adapter never has to test `Array.isArray`
|
|
28
|
+
* on the hot path.
|
|
29
|
+
*/
|
|
30
|
+
export interface WxrChannel {
|
|
31
|
+
title?: string;
|
|
32
|
+
link?: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
pubDate?: string;
|
|
35
|
+
language?: string;
|
|
36
|
+
'wp:wxr_version'?: string;
|
|
37
|
+
'wp:base_site_url'?: string;
|
|
38
|
+
'wp:base_blog_url'?: string;
|
|
39
|
+
'wp:author'?: WxrAuthor[];
|
|
40
|
+
'wp:category'?: WxrTerm[];
|
|
41
|
+
'wp:tag'?: WxrTerm[];
|
|
42
|
+
'wp:term'?: WxrCustomTerm[];
|
|
43
|
+
item?: WxrItem[];
|
|
44
|
+
}
|
|
45
|
+
export interface WxrAuthor {
|
|
46
|
+
'wp:author_id'?: number | string;
|
|
47
|
+
'wp:author_login'?: string;
|
|
48
|
+
'wp:author_email'?: string;
|
|
49
|
+
'wp:author_display_name'?: string;
|
|
50
|
+
'wp:author_first_name'?: string;
|
|
51
|
+
'wp:author_last_name'?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface WxrTerm {
|
|
54
|
+
'wp:term_id'?: number | string;
|
|
55
|
+
/** Slug of the category. */
|
|
56
|
+
'wp:category_nicename'?: string;
|
|
57
|
+
/** Display name of the category. */
|
|
58
|
+
'wp:cat_name'?: string;
|
|
59
|
+
/** Slug of the tag. */
|
|
60
|
+
'wp:tag_slug'?: string;
|
|
61
|
+
/** Display name of the tag. */
|
|
62
|
+
'wp:tag_name'?: string;
|
|
63
|
+
/** Parent category nicename — empty string when top-level. */
|
|
64
|
+
'wp:category_parent'?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface WxrCustomTerm {
|
|
67
|
+
'wp:term_id'?: number | string;
|
|
68
|
+
'wp:term_taxonomy'?: string;
|
|
69
|
+
'wp:term_slug'?: string;
|
|
70
|
+
'wp:term_parent'?: string;
|
|
71
|
+
'wp:term_name'?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A single `<item>` inside the channel. Items represent posts,
|
|
75
|
+
* pages, attachments, nav menu items, custom post types — WP
|
|
76
|
+
* exports them all uniformly. `wp:post_type` discriminates.
|
|
77
|
+
*
|
|
78
|
+
* `category` (without the `wp:` prefix) is the per-item array of
|
|
79
|
+
* `{ domain: 'category'|'post_tag'|<taxonomy>, nicename, '#text' }`
|
|
80
|
+
* objects. Distinct from the channel-level `wp:category` array
|
|
81
|
+
* which carries the taxonomy terms themselves.
|
|
82
|
+
*/
|
|
83
|
+
export interface WxrItem {
|
|
84
|
+
title?: string;
|
|
85
|
+
link?: string;
|
|
86
|
+
pubDate?: string;
|
|
87
|
+
'dc:creator'?: string;
|
|
88
|
+
guid?: string | {
|
|
89
|
+
'#text'?: string;
|
|
90
|
+
};
|
|
91
|
+
description?: string;
|
|
92
|
+
'content:encoded'?: string;
|
|
93
|
+
'excerpt:encoded'?: string;
|
|
94
|
+
'wp:post_id'?: number | string;
|
|
95
|
+
'wp:post_date'?: string;
|
|
96
|
+
'wp:post_date_gmt'?: string;
|
|
97
|
+
'wp:post_modified'?: string;
|
|
98
|
+
'wp:post_modified_gmt'?: string;
|
|
99
|
+
'wp:comment_status'?: string;
|
|
100
|
+
'wp:ping_status'?: string;
|
|
101
|
+
'wp:post_name'?: string;
|
|
102
|
+
'wp:status'?: string;
|
|
103
|
+
'wp:post_parent'?: number | string;
|
|
104
|
+
'wp:menu_order'?: number | string;
|
|
105
|
+
'wp:post_type'?: string;
|
|
106
|
+
'wp:post_password'?: string;
|
|
107
|
+
'wp:is_sticky'?: number | string;
|
|
108
|
+
'wp:attachment_url'?: string;
|
|
109
|
+
'wp:postmeta'?: WxrPostMeta[];
|
|
110
|
+
category?: WxrItemCategory[];
|
|
111
|
+
}
|
|
112
|
+
export interface WxrPostMeta {
|
|
113
|
+
'wp:meta_key'?: string;
|
|
114
|
+
'wp:meta_value'?: string | number | boolean | null;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Per-item term reference. `domain` tells us whether the ref is a
|
|
118
|
+
* category, a tag, or a custom taxonomy (e.g. `post_tag`,
|
|
119
|
+
* `category`, `post_format`). `nicename` is the slug; the `#text`
|
|
120
|
+
* is the display name.
|
|
121
|
+
*/
|
|
122
|
+
export interface WxrItemCategory {
|
|
123
|
+
'@_domain'?: string;
|
|
124
|
+
'@_nicename'?: string;
|
|
125
|
+
'#text'?: string;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Per-import config. Loaded via
|
|
129
|
+
* `prenta-import wordpress ./export.xml --config ./wordpress.json`.
|
|
130
|
+
*/
|
|
131
|
+
export interface WordPressAdapterConfig {
|
|
132
|
+
/**
|
|
133
|
+
* `wp:post_type` → Prenta collection slug. Untyped: silent
|
|
134
|
+
* fall-through to the post type itself. Typed: warns on unmapped
|
|
135
|
+
* post types.
|
|
136
|
+
*/
|
|
137
|
+
typeMap?: Record<string, string>;
|
|
138
|
+
/**
|
|
139
|
+
* Only import items with `wp:status === 'publish'`. Default
|
|
140
|
+
* `true`. Set `false` to include drafts, private, pending,
|
|
141
|
+
* scheduled, etc.
|
|
142
|
+
*/
|
|
143
|
+
publishedOnly?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Post types to skip entirely. Default skips
|
|
146
|
+
* `attachment` (kept for URL-map building only),
|
|
147
|
+
* `nav_menu_item`, `revision`, `customize_changeset`,
|
|
148
|
+
* `oembed_cache`, `user_request`, `wp_block`,
|
|
149
|
+
* `wp_navigation`, `wp_template`, `wp_template_part`,
|
|
150
|
+
* `wp_global_styles`.
|
|
151
|
+
*/
|
|
152
|
+
ignoreTypes?: string[];
|
|
153
|
+
/**
|
|
154
|
+
* Emit author entities as their own documents. Default `true` —
|
|
155
|
+
* WP authors are full records and downstream consumers want to
|
|
156
|
+
* render bylines.
|
|
157
|
+
*/
|
|
158
|
+
importAuthors?: boolean;
|
|
159
|
+
/** Collection slug for author docs. Default `'authors'`. */
|
|
160
|
+
authorsCollection?: string;
|
|
161
|
+
/**
|
|
162
|
+
* Emit category and tag terms as their own documents. Default
|
|
163
|
+
* `true` — same reasoning as authors.
|
|
164
|
+
*/
|
|
165
|
+
importTerms?: boolean;
|
|
166
|
+
/** Collection slug for category docs. Default `'categories'`. */
|
|
167
|
+
categoriesCollection?: string;
|
|
168
|
+
/** Collection slug for tag docs. Default `'tags'`. */
|
|
169
|
+
tagsCollection?: string;
|
|
170
|
+
/**
|
|
171
|
+
* Emit attachments as their own documents. Default `false` —
|
|
172
|
+
* attachments are consumed as the asset URL map for
|
|
173
|
+
* `_thumbnail_id` resolution by default.
|
|
174
|
+
*/
|
|
175
|
+
importAttachments?: boolean;
|
|
176
|
+
/** Collection slug for attachment docs. Default `'media'`. */
|
|
177
|
+
attachmentsCollection?: string;
|
|
178
|
+
/**
|
|
179
|
+
* Preserve `wp:post_id`, `wp:post_date`, `wp:post_modified`,
|
|
180
|
+
* `wp:comment_status`, etc. on `data` when `true`. Default
|
|
181
|
+
* `false`.
|
|
182
|
+
*/
|
|
183
|
+
includeSystemFields?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* How `wp:postmeta` rows merge into `data`.
|
|
186
|
+
*
|
|
187
|
+
* - `'object'` (default) — every meta row goes onto
|
|
188
|
+
* `data.meta[key]`. Keys starting with `_` (internal) are
|
|
189
|
+
* excluded by default.
|
|
190
|
+
* - `'fields'` — meta rows are promoted to top-level `data`
|
|
191
|
+
* fields. Internal keys still excluded by default.
|
|
192
|
+
* - `'none'` — meta is dropped entirely.
|
|
193
|
+
*/
|
|
194
|
+
postMetaStrategy?: 'object' | 'fields' | 'none';
|
|
195
|
+
/**
|
|
196
|
+
* When `true`, includes meta rows whose key starts with `_`.
|
|
197
|
+
* Default `false`.
|
|
198
|
+
*/
|
|
199
|
+
includeInternalMeta?: boolean;
|
|
200
|
+
}
|
|
201
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/adapters/wordpress/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,WAAW,CAAC,EAAE,SAAS,EAAE,CAAA;IACzB,aAAa,CAAC,EAAE,OAAO,EAAE,CAAA;IACzB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAA;IACpB,SAAS,CAAC,EAAE,aAAa,EAAE,CAAA;IAC3B,IAAI,CAAC,EAAE,OAAO,EAAE,CAAA;CACjB;AAED,MAAM,WAAW,SAAS;IACxB,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAA;CAC/B;AAED,MAAM,WAAW,OAAO;IACtB,YAAY,CAAC,EAAE,MAAM,GA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C9D,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAA;IAC/C;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for the structural shapes the WordPress adapter
|
|
3
|
+
* recognizes in a **WXR** (WordPress eXtended RSS) export.
|
|
4
|
+
*
|
|
5
|
+
* WXR is RSS 2.0 with a handful of namespaces piled on
|
|
6
|
+
* (`wp:`, `content:`, `dc:`, `excerpt:`). Every WP install can
|
|
7
|
+
* produce one from `Tools → Export`; it's the de-facto interchange
|
|
8
|
+
* format every other WP-aware tool reads, which is why the
|
|
9
|
+
* adapter targets it rather than the REST API.
|
|
10
|
+
*
|
|
11
|
+
* Two things drive the design:
|
|
12
|
+
*
|
|
13
|
+
* - **HTML content is the source of truth.** Body, excerpt, and
|
|
14
|
+
* sometimes title come through as raw HTML inside CDATA. The
|
|
15
|
+
* adapter passes them through verbatim — block conversion is
|
|
16
|
+
* explicitly out of scope (operators run an HTML → MDX /
|
|
17
|
+
* portable-text pass downstream).
|
|
18
|
+
* - **Authors, categories, tags, and attachments are first-class
|
|
19
|
+
* siblings of posts** in WXR, not annotations. They each get
|
|
20
|
+
* their own slot in the channel and can become their own
|
|
21
|
+
* Prenta collections (configurable).
|
|
22
|
+
*/
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/adapters/wordpress/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `prenta-import` — CLI for content migration into Prenta.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* prenta-import list
|
|
7
|
+
* prenta-import <adapter> <input> [--out <file>] [--write] [--json]
|
|
8
|
+
* prenta-import <adapter> <input> --config <config.json>
|
|
9
|
+
*
|
|
10
|
+
* Exit codes (mirror the rest of the toolchain — diff, migrate, etc.):
|
|
11
|
+
* 0 import is clean (no unresolved fields)
|
|
12
|
+
* 1 user error (unknown adapter, missing file, malformed config)
|
|
13
|
+
* 2 import surfaced unresolved fields — CI gate signal
|
|
14
|
+
*/
|
|
15
|
+
export declare function runCli(argv?: string[]): Promise<number>;
|
|
16
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;GAYG;AAkJH,wBAAsB,MAAM,CAAC,IAAI,GAAE,MAAM,EAA0B,GAAG,OAAO,CAAC,MAAM,CAAC,CA2IpF"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `prenta-import` — CLI for content migration into Prenta.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* prenta-import list
|
|
7
|
+
* prenta-import <adapter> <input> [--out <file>] [--write] [--json]
|
|
8
|
+
* prenta-import <adapter> <input> --config <config.json>
|
|
9
|
+
*
|
|
10
|
+
* Exit codes (mirror the rest of the toolchain — diff, migrate, etc.):
|
|
11
|
+
* 0 import is clean (no unresolved fields)
|
|
12
|
+
* 1 user error (unknown adapter, missing file, malformed config)
|
|
13
|
+
* 2 import surfaced unresolved fields — CI gate signal
|
|
14
|
+
*/
|
|
15
|
+
import { readFileSync } from 'node:fs';
|
|
16
|
+
import { formatImportSummary } from './formatter.js';
|
|
17
|
+
import { MigrationLoadError, MigrationOutputError, MigrationRunError, applyMigrations, loadMigration, } from './migrate.js';
|
|
18
|
+
import { listAdapters } from './registry.js';
|
|
19
|
+
import { UnknownAdapterError, runImport, writeImportResult } from './runner.js';
|
|
20
|
+
/**
|
|
21
|
+
* Pull a value off the back of a value-taking flag, refusing to silently
|
|
22
|
+
* swallow the next flag or run off the end of argv. Returns either the
|
|
23
|
+
* value or pushes a structured error onto `errors`.
|
|
24
|
+
*
|
|
25
|
+
* Without this, `prenta-import foo ./input --config --json` would
|
|
26
|
+
* read `--json` as the config path (then fail opaquely later) and
|
|
27
|
+
* `prenta-import foo ./input --config` at the end of argv would
|
|
28
|
+
* silently skip config loading entirely.
|
|
29
|
+
*/
|
|
30
|
+
function consumeValue(argv, i, flag, errors) {
|
|
31
|
+
const next = argv[i + 1];
|
|
32
|
+
if (next === undefined) {
|
|
33
|
+
errors.push(`flag '${flag}' requires a value`);
|
|
34
|
+
return { value: undefined, next: i };
|
|
35
|
+
}
|
|
36
|
+
if (next.startsWith('-')) {
|
|
37
|
+
errors.push(`flag '${flag}' requires a value (got '${next}', which looks like another flag)`);
|
|
38
|
+
return { value: undefined, next: i };
|
|
39
|
+
}
|
|
40
|
+
return { value: next, next: i + 1 };
|
|
41
|
+
}
|
|
42
|
+
function parseArgs(argv) {
|
|
43
|
+
// Pull the command off the front of argv, but ONLY if it's not a flag.
|
|
44
|
+
// That way `prenta-import --help` resolves to "help" rather than
|
|
45
|
+
// setting command='--help' and crashing the dispatcher.
|
|
46
|
+
const args = { command: 'help', positional: [], migratePaths: [] };
|
|
47
|
+
const errors = [];
|
|
48
|
+
let i = 0;
|
|
49
|
+
if (argv[0] !== undefined && !argv[0].startsWith('-')) {
|
|
50
|
+
args.command = argv[0];
|
|
51
|
+
i = 1;
|
|
52
|
+
}
|
|
53
|
+
for (; i < argv.length; i++) {
|
|
54
|
+
const a = argv[i];
|
|
55
|
+
if (a === '--help' || a === '-h')
|
|
56
|
+
args.help = true;
|
|
57
|
+
else if (a === '--json')
|
|
58
|
+
args.json = true;
|
|
59
|
+
else if (a === '--write')
|
|
60
|
+
args.write = true;
|
|
61
|
+
else if (a === '--validate')
|
|
62
|
+
args.validate = true;
|
|
63
|
+
else if (a === '--out') {
|
|
64
|
+
const { value, next } = consumeValue(argv, i, '--out', errors);
|
|
65
|
+
args.out = value;
|
|
66
|
+
i = next;
|
|
67
|
+
}
|
|
68
|
+
else if (a === '--config') {
|
|
69
|
+
const { value, next } = consumeValue(argv, i, '--config', errors);
|
|
70
|
+
args.configPath = value;
|
|
71
|
+
i = next;
|
|
72
|
+
}
|
|
73
|
+
else if (a === '--migrate') {
|
|
74
|
+
// `--migrate` is repeatable — each occurrence appends one
|
|
75
|
+
// path to the chain. Same missing-value protection as
|
|
76
|
+
// `--out` / `--config` so an operator who typed
|
|
77
|
+
// `--migrate --json` gets a clean error instead of silently
|
|
78
|
+
// skipping the migration that was meant to run.
|
|
79
|
+
const { value, next } = consumeValue(argv, i, '--migrate', errors);
|
|
80
|
+
if (value !== undefined)
|
|
81
|
+
args.migratePaths.push(value);
|
|
82
|
+
i = next;
|
|
83
|
+
}
|
|
84
|
+
else if (a.startsWith('--')) {
|
|
85
|
+
// Anything else starting with `--` is an unknown flag. Don't push
|
|
86
|
+
// it onto `positional` (where it would either be filtered out and
|
|
87
|
+
// ignored, or worse, treated as the input path); report it instead.
|
|
88
|
+
errors.push(`unknown flag '${a}'`);
|
|
89
|
+
}
|
|
90
|
+
else
|
|
91
|
+
args.positional.push(a);
|
|
92
|
+
}
|
|
93
|
+
return { args, errors };
|
|
94
|
+
}
|
|
95
|
+
const USAGE = `prenta-import <command> [options]
|
|
96
|
+
|
|
97
|
+
Commands:
|
|
98
|
+
list Print every registered adapter.
|
|
99
|
+
<adapter> <input> Run the named adapter against <input>.
|
|
100
|
+
|
|
101
|
+
Options:
|
|
102
|
+
--out <file> Destination for --write (defaults to <input>.imported.json).
|
|
103
|
+
--write Write the result envelope to disk.
|
|
104
|
+
Without --write the command is a dry-run.
|
|
105
|
+
--json Emit the full ImportResult JSON to stdout.
|
|
106
|
+
Compatible with --write.
|
|
107
|
+
--config <file> Load adapter-specific config from a JSON file.
|
|
108
|
+
--migrate <file> Apply a migration script after the adapter runs.
|
|
109
|
+
Repeatable: --migrate a.js --migrate b.js
|
|
110
|
+
applies a then b. Script must export a default
|
|
111
|
+
function, a named 'migrate' export, or a default
|
|
112
|
+
{ name, migrate } object.
|
|
113
|
+
--validate Dry-run: run the adapter (and any --migrate
|
|
114
|
+
scripts) but never write. Useful for CI gating
|
|
115
|
+
without producing artifacts. Conflicts with --write.
|
|
116
|
+
--help Show this message.
|
|
117
|
+
|
|
118
|
+
Examples:
|
|
119
|
+
prenta-import list
|
|
120
|
+
prenta-import identity ./content.json
|
|
121
|
+
prenta-import identity ./content.json --write --out ./content.imported.json
|
|
122
|
+
prenta-import identity ./content.json --json
|
|
123
|
+
prenta-import wordpress ./export.xml \\
|
|
124
|
+
--migrate ./migrations/01-rename-hero-cta.js \\
|
|
125
|
+
--migrate ./migrations/02-rewrite-asset-urls.js \\
|
|
126
|
+
--write --out ./content.json
|
|
127
|
+
prenta-import sanity ./export.ndjson --validate
|
|
128
|
+
|
|
129
|
+
Exit codes:
|
|
130
|
+
0 import clean (no unresolved fields)
|
|
131
|
+
1 invalid invocation (unknown adapter, missing file, malformed config,
|
|
132
|
+
missing migration script, conflicting flags)
|
|
133
|
+
2 at least one unresolved field — CI gate signal
|
|
134
|
+
`;
|
|
135
|
+
export async function runCli(argv = process.argv.slice(2)) {
|
|
136
|
+
const { args, errors } = parseArgs(argv);
|
|
137
|
+
if (args.help || args.command === 'help' || !args.command) {
|
|
138
|
+
process.stdout.write(USAGE);
|
|
139
|
+
return 0;
|
|
140
|
+
}
|
|
141
|
+
// Short-circuit on parse errors BEFORE consulting any of the parsed
|
|
142
|
+
// values. We want operators to learn about a missing flag value the
|
|
143
|
+
// first time they run, not after the adapter has already partially
|
|
144
|
+
// worked. Listing every error in one shot saves a fix-then-rerun loop.
|
|
145
|
+
if (errors.length > 0) {
|
|
146
|
+
for (const e of errors)
|
|
147
|
+
process.stderr.write(`error: ${e}\n`);
|
|
148
|
+
process.stderr.write('\n' + USAGE);
|
|
149
|
+
return 1;
|
|
150
|
+
}
|
|
151
|
+
if (args.command === 'list') {
|
|
152
|
+
const adapters = listAdapters();
|
|
153
|
+
if (adapters.length === 0) {
|
|
154
|
+
process.stdout.write('No adapters registered.\n');
|
|
155
|
+
return 0;
|
|
156
|
+
}
|
|
157
|
+
const longest = Math.max(...adapters.map((a) => a.name.length));
|
|
158
|
+
for (const adapter of adapters) {
|
|
159
|
+
process.stdout.write(` ${adapter.name.padEnd(longest)} ${adapter.description}\n`);
|
|
160
|
+
}
|
|
161
|
+
return 0;
|
|
162
|
+
}
|
|
163
|
+
// Anything else is an "adapter run" invocation. `args.positional`
|
|
164
|
+
// is now guaranteed not to contain stray `--*` tokens because
|
|
165
|
+
// parseArgs rejects unknown flags up front.
|
|
166
|
+
const adapter = args.command;
|
|
167
|
+
if (args.positional.length !== 1) {
|
|
168
|
+
process.stderr.write(`error: '${adapter}' expects one positional argument (input path)\n\n` + USAGE);
|
|
169
|
+
return 1;
|
|
170
|
+
}
|
|
171
|
+
const input = args.positional[0];
|
|
172
|
+
if (args.validate && args.write) {
|
|
173
|
+
process.stderr.write(`error: --validate and --write are mutually exclusive — --validate is a dry-run gate\n`);
|
|
174
|
+
return 1;
|
|
175
|
+
}
|
|
176
|
+
let config;
|
|
177
|
+
if (args.configPath) {
|
|
178
|
+
let parsed;
|
|
179
|
+
try {
|
|
180
|
+
parsed = JSON.parse(readFileSync(args.configPath, 'utf-8'));
|
|
181
|
+
}
|
|
182
|
+
catch (err) {
|
|
183
|
+
process.stderr.write(`error: could not read --config '${args.configPath}': ${err.message}\n`);
|
|
184
|
+
return 1;
|
|
185
|
+
}
|
|
186
|
+
// The framework treats the config as a string-keyed map and forwards
|
|
187
|
+
// it untouched to the adapter. A JSON array or scalar at the top
|
|
188
|
+
// level can't satisfy that contract.
|
|
189
|
+
if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
190
|
+
process.stderr.write(`error: --config '${args.configPath}' must contain a JSON object at the top level\n`);
|
|
191
|
+
return 1;
|
|
192
|
+
}
|
|
193
|
+
config = parsed;
|
|
194
|
+
}
|
|
195
|
+
let result;
|
|
196
|
+
try {
|
|
197
|
+
result = await runImport({
|
|
198
|
+
adapter,
|
|
199
|
+
input,
|
|
200
|
+
...(config !== undefined ? { config } : {}),
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
catch (err) {
|
|
204
|
+
if (err instanceof UnknownAdapterError) {
|
|
205
|
+
process.stderr.write(`error: ${err.message}\n`);
|
|
206
|
+
process.stderr.write(`Try: prenta-import list\n`);
|
|
207
|
+
return 1;
|
|
208
|
+
}
|
|
209
|
+
process.stderr.write(`error: ${err.message}\n`);
|
|
210
|
+
return 1;
|
|
211
|
+
}
|
|
212
|
+
// Load + apply migrations, if any. Migration loads + runs are
|
|
213
|
+
// user errors (exit 1) rather than unresolved-field errors
|
|
214
|
+
// (exit 2) — the operator picked the script, and a broken
|
|
215
|
+
// script is a configuration problem, not lossy data.
|
|
216
|
+
if (args.migratePaths.length > 0) {
|
|
217
|
+
try {
|
|
218
|
+
const migrations = [];
|
|
219
|
+
for (const path of args.migratePaths) {
|
|
220
|
+
migrations.push(await loadMigration(path));
|
|
221
|
+
}
|
|
222
|
+
result = await applyMigrations(result, migrations);
|
|
223
|
+
}
|
|
224
|
+
catch (err) {
|
|
225
|
+
if (err instanceof MigrationLoadError ||
|
|
226
|
+
err instanceof MigrationRunError ||
|
|
227
|
+
err instanceof MigrationOutputError) {
|
|
228
|
+
process.stderr.write(`error: ${err.message}\n`);
|
|
229
|
+
return 1;
|
|
230
|
+
}
|
|
231
|
+
process.stderr.write(`error: ${err.message}\n`);
|
|
232
|
+
return 1;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
if (args.json) {
|
|
236
|
+
process.stdout.write(JSON.stringify(result, null, 2) + '\n');
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
process.stdout.write(formatImportSummary(result) + '\n');
|
|
240
|
+
}
|
|
241
|
+
if (args.write) {
|
|
242
|
+
const outPath = args.out ?? `${input}.imported.json`;
|
|
243
|
+
try {
|
|
244
|
+
writeImportResult(outPath, result);
|
|
245
|
+
if (!args.json) {
|
|
246
|
+
process.stdout.write(`\nWrote import envelope to ${outPath}\n`);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
catch (err) {
|
|
250
|
+
process.stderr.write(`error: could not write '${outPath}': ${err.message}\n`);
|
|
251
|
+
return 1;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
// Exit 2 on unresolved fields — CI integrations gate on this so a
|
|
255
|
+
// partial-data import never sneaks through to production. The
|
|
256
|
+
// result file is still written with --write so operators can
|
|
257
|
+
// review and finish what the adapter started.
|
|
258
|
+
return result.unresolved.length > 0 ? 2 : 0;
|
|
259
|
+
}
|
|
260
|
+
const isCliEntry = typeof process !== 'undefined' &&
|
|
261
|
+
Array.isArray(process.argv) &&
|
|
262
|
+
process.argv[1]?.endsWith('cli.js');
|
|
263
|
+
if (isCliEntry) {
|
|
264
|
+
runCli().then((code) => process.exit(code));
|
|
265
|
+
}
|
|
266
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,aAAa,GACd,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,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CAAC,IAAI,EAAE,CAAC;gBACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,8BAA8B,OAAO,IAAI,CAAC,CAAA;YACjE,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,2BAA2B,OAAO,MAAO,GAAa,CAAC,OAAO,IAAI,CAAC,CAAA;YACxF,OAAO,CAAC,CAAA;QACV,CAAC;IACH,CAAC;IAED,kEAAkE;IAClE,8DAA8D;IAC9D,6DAA6D;IAC7D,8CAA8C;IAC9C,OAAO,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAC7C,CAAC;AAED,MAAM,UAAU,GACd,OAAO,OAAO,KAAK,WAAW;IAC9B,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAA;AAErC,IAAI,UAAU,EAAE,CAAC;IACf,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;AAC7C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Human-readable rendering of {@link ImportResult}. Used by the CLI
|
|
3
|
+
* for the default text output and also intended for PR comments / CI
|
|
4
|
+
* logs.
|
|
5
|
+
*
|
|
6
|
+
* Keep this dependency-free (no chalk, no ANSI codes) so the output
|
|
7
|
+
* is stable across terminals and so the same string can be embedded
|
|
8
|
+
* in markdown, Slack messages, or GitHub comments without escaping.
|
|
9
|
+
*/
|
|
10
|
+
import type { ImportResult } from './types.js';
|
|
11
|
+
export declare function formatImportSummary(result: ImportResult): string;
|
|
12
|
+
//# sourceMappingURL=formatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAiChE"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Human-readable rendering of {@link ImportResult}. Used by the CLI
|
|
3
|
+
* for the default text output and also intended for PR comments / CI
|
|
4
|
+
* logs.
|
|
5
|
+
*
|
|
6
|
+
* Keep this dependency-free (no chalk, no ANSI codes) so the output
|
|
7
|
+
* is stable across terminals and so the same string can be embedded
|
|
8
|
+
* in markdown, Slack messages, or GitHub comments without escaping.
|
|
9
|
+
*/
|
|
10
|
+
export function formatImportSummary(result) {
|
|
11
|
+
const lines = [];
|
|
12
|
+
const { summary } = result;
|
|
13
|
+
lines.push(`Import via '${summary.adapter}' — ${summary.totalRead} record(s) read, ${summary.converted} converted, ${summary.skipped} skipped.`);
|
|
14
|
+
if (result.warnings.length > 0) {
|
|
15
|
+
lines.push('');
|
|
16
|
+
lines.push(`Warnings (${result.warnings.length}):`);
|
|
17
|
+
for (const w of result.warnings) {
|
|
18
|
+
const where = describeSource(w.source);
|
|
19
|
+
lines.push(` - [${w.code}] ${where}: ${w.message}`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (result.unresolved.length > 0) {
|
|
23
|
+
lines.push('');
|
|
24
|
+
lines.push(`Unresolved fields (${result.unresolved.length}) — operator action required:`);
|
|
25
|
+
for (const u of result.unresolved) {
|
|
26
|
+
const where = describeSource({ ...u.source });
|
|
27
|
+
lines.push(` - [${u.code}] ${where}: ${u.reason}`);
|
|
28
|
+
if (u.hint)
|
|
29
|
+
lines.push(` hint: ${u.hint}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (result.warnings.length === 0 && result.unresolved.length === 0) {
|
|
33
|
+
lines.push('');
|
|
34
|
+
lines.push('No warnings or unresolved fields. Import is clean.');
|
|
35
|
+
}
|
|
36
|
+
return lines.join('\n');
|
|
37
|
+
}
|
|
38
|
+
function describeSource(source) {
|
|
39
|
+
const parts = [];
|
|
40
|
+
if (source.type)
|
|
41
|
+
parts.push(source.type);
|
|
42
|
+
if (source.id)
|
|
43
|
+
parts.push(`id=${source.id}`);
|
|
44
|
+
if (source.field)
|
|
45
|
+
parts.push(`field=${source.field}`);
|
|
46
|
+
return parts.length > 0 ? parts.join(' ') : '<unknown source>';
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,MAAM,UAAU,mBAAmB,CAAC,MAAoB;IACtD,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAA;IAE1B,KAAK,CAAC,IAAI,CACR,eAAe,OAAO,CAAC,OAAO,OAAO,OAAO,CAAC,SAAS,oBAAoB,OAAO,CAAC,SAAS,eAAe,OAAO,CAAC,OAAO,WAAW,CACrI,CAAA;IAED,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QACd,KAAK,CAAC,IAAI,CAAC,aAAa,MAAM,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,CAAA;QACnD,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAChC,MAAM,KAAK,GAAG,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;YACtC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,KAAK,KAAK,KAAK,CAAC,CAAC,OAAO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AC,SAAS,MAAM,CAAC,KAAK,EAAE,CAAC,CAAA;IACrD,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAA;AAChE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@prenta/import` — public entry.
|
|
3
|
+
*
|
|
4
|
+
* Programmatic API for migrating content from external CMSs into
|
|
5
|
+
* Prenta. The CLI (`prenta-import`) is a thin wrapper around
|
|
6
|
+
* {@link runImport} + {@link writeImportResult}; build / migration
|
|
7
|
+
* scripts can call those directly.
|
|
8
|
+
*
|
|
9
|
+
* Authors of third-party adapters should import from
|
|
10
|
+
* `@prenta/import/adapter` to get the narrow set of helpers
|
|
11
|
+
* an adapter implementation needs — that submodule is intentionally
|
|
12
|
+
* dependency-light and CLI-free, so adapter packages don't ship the
|
|
13
|
+
* full framework surface.
|
|
14
|
+
*/
|
|
15
|
+
export { buildResult, buildSummary, isImportedDocument } from './adapter.js';
|
|
16
|
+
export { contentfulAdapter } from './adapters/contentful/index.js';
|
|
17
|
+
export type { ContentfulAdapterConfig } from './adapters/contentful/types.js';
|
|
18
|
+
export { identityAdapter } from './adapters/identity.js';
|
|
19
|
+
export { sanityAdapter } from './adapters/sanity/index.js';
|
|
20
|
+
export type { SanityAdapterConfig } from './adapters/sanity/types.js';
|
|
21
|
+
export { strapiAdapter } from './adapters/strapi/index.js';
|
|
22
|
+
export type { StrapiAdapterConfig } from './adapters/strapi/types.js';
|
|
23
|
+
export { wordpressAdapter } from './adapters/wordpress/index.js';
|
|
24
|
+
export type { WordPressAdapterConfig } from './adapters/wordpress/types.js';
|
|
25
|
+
export { formatImportSummary } from './formatter.js';
|
|
26
|
+
export { MigrationLoadError, MigrationOutputError, MigrationRunError, applyMigrations, loadMigration, } from './migrate.js';
|
|
27
|
+
export type { Migration, MigrationOutput, NamedMigration } from './migrate.js';
|
|
28
|
+
export { getAdapter, listAdapters, registerAdapter, unregisterAdapter } from './registry.js';
|
|
29
|
+
export { UnknownAdapterError, runImport, writeImportResult } from './runner.js';
|
|
30
|
+
export type { AdapterOptions, ImportAdapter, ImportInvocation, ImportResult, ImportSummary, ImportWarning, ImportedDocument, UnresolvedField, } from './types.js';
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,YAAY,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,YAAY,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,YAAY,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAChE,YAAY,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,aAAa,GACd,MAAM,cAAc,CAAA;AACrB,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC9E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAA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