@artinstack/migrator 0.1.17 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -1
- package/dist/{chunk-RLMYUUNK.js → chunk-5RKHB6GI.js} +180 -14
- package/dist/chunk-5RKHB6GI.js.map +1 -0
- package/dist/cli/index.js +1 -1
- package/dist/index.d.ts +102 -4
- package/dist/index.js +15 -1
- package/package.json +2 -2
- package/dist/chunk-RLMYUUNK.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -57,9 +57,21 @@ declare const SMUGMUG_OAUTH_ENDPOINTS: {
|
|
|
57
57
|
readonly authorize: "https://api.smugmug.com/services/oauth/1.0a/authorize";
|
|
58
58
|
readonly accessToken: "https://api.smugmug.com/services/oauth/1.0a/getAccessToken";
|
|
59
59
|
};
|
|
60
|
+
declare const smugMugConsumerCredentialsSchema: z.ZodObject<{
|
|
61
|
+
consumerKey: z.ZodString;
|
|
62
|
+
consumerSecret: z.ZodString;
|
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
|
64
|
+
consumerKey: string;
|
|
65
|
+
consumerSecret: string;
|
|
66
|
+
}, {
|
|
67
|
+
consumerKey: string;
|
|
68
|
+
consumerSecret: string;
|
|
69
|
+
}>;
|
|
70
|
+
type SmugMugConsumerCredentials = z.infer<typeof smugMugConsumerCredentialsSchema>;
|
|
60
71
|
declare const smugMugCredentialsSchema: z.ZodObject<{
|
|
61
72
|
consumerKey: z.ZodString;
|
|
62
73
|
consumerSecret: z.ZodString;
|
|
74
|
+
} & {
|
|
63
75
|
accessToken: z.ZodString;
|
|
64
76
|
accessTokenSecret: z.ZodString;
|
|
65
77
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -74,10 +86,44 @@ declare const smugMugCredentialsSchema: z.ZodObject<{
|
|
|
74
86
|
accessTokenSecret: string;
|
|
75
87
|
}>;
|
|
76
88
|
type SmugMugCredentials = z.infer<typeof smugMugCredentialsSchema>;
|
|
89
|
+
/** Material for HMAC-SHA1 signing — token fields omitted/empty during request-token phase. */
|
|
90
|
+
type SmugMugOAuthSigningMaterial = {
|
|
91
|
+
consumerKey: string;
|
|
92
|
+
consumerSecret: string;
|
|
93
|
+
accessToken?: string;
|
|
94
|
+
/** Empty string (or omitted) for `getRequestToken`. */
|
|
95
|
+
accessTokenSecret?: string;
|
|
96
|
+
};
|
|
97
|
+
type SmugMugOAuthTokenPair = {
|
|
98
|
+
token: string;
|
|
99
|
+
tokenSecret: string;
|
|
100
|
+
};
|
|
101
|
+
type SmugMugRequestTokenResult = SmugMugOAuthTokenPair & {
|
|
102
|
+
callbackConfirmed: boolean;
|
|
103
|
+
};
|
|
104
|
+
type SmugMugAccessLevel = "Full" | "Public";
|
|
105
|
+
type SmugMugPermissionLevel = "Read" | "Add" | "Modify";
|
|
106
|
+
type SmugMugAuthorizeUrlOptions = {
|
|
107
|
+
requestToken: string;
|
|
108
|
+
/** SmugMug Access query param (default Full for migration crawl). */
|
|
109
|
+
access?: SmugMugAccessLevel;
|
|
110
|
+
/** SmugMug Permissions query param (default Modify for migration crawl). */
|
|
111
|
+
permissions?: SmugMugPermissionLevel;
|
|
112
|
+
allowThirdPartyLogin?: boolean;
|
|
113
|
+
showSignUpButton?: boolean;
|
|
114
|
+
username?: string;
|
|
115
|
+
};
|
|
116
|
+
type SmugMugOAuthSession = {
|
|
117
|
+
requestToken: string;
|
|
118
|
+
requestTokenSecret: string;
|
|
119
|
+
authorizeUrl: string;
|
|
120
|
+
callbackConfirmed: boolean;
|
|
121
|
+
};
|
|
77
122
|
declare const smugMugClientOptionsSchema: z.ZodObject<{
|
|
78
123
|
credentials: z.ZodObject<{
|
|
79
124
|
consumerKey: z.ZodString;
|
|
80
125
|
consumerSecret: z.ZodString;
|
|
126
|
+
} & {
|
|
81
127
|
accessToken: z.ZodString;
|
|
82
128
|
accessTokenSecret: z.ZodString;
|
|
83
129
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -125,23 +171,75 @@ declare const smugMugClientOptionsSchema: z.ZodObject<{
|
|
|
125
171
|
pageSize?: number | undefined;
|
|
126
172
|
}>;
|
|
127
173
|
type SmugMugClientOptions = z.input<typeof smugMugClientOptionsSchema>;
|
|
128
|
-
/**
|
|
174
|
+
/** SmugMug URI link — string when `_shorturis` is used, otherwise `{ Uri }`. */
|
|
175
|
+
type SmugMugUriLink = string | {
|
|
176
|
+
Uri?: string;
|
|
177
|
+
};
|
|
178
|
+
/** Build OAuth 1.0a HMAC-SHA1 signature for a SmugMug API or handshake request. */
|
|
129
179
|
declare function signSmugMugOAuthRequest(input: {
|
|
130
180
|
method: string;
|
|
131
181
|
url: string;
|
|
132
|
-
credentials:
|
|
182
|
+
credentials: SmugMugOAuthSigningMaterial;
|
|
133
183
|
oauthParams: Record<string, string>;
|
|
134
184
|
bodyParams?: Record<string, string>;
|
|
135
185
|
}): string;
|
|
136
186
|
declare function buildSmugMugAuthorizationHeader(input: {
|
|
137
187
|
method: string;
|
|
138
188
|
url: string;
|
|
139
|
-
credentials:
|
|
189
|
+
credentials: SmugMugOAuthSigningMaterial;
|
|
140
190
|
nonce?: string;
|
|
141
191
|
timestamp?: string;
|
|
142
192
|
bodyParams?: Record<string, string>;
|
|
193
|
+
/** Extra oauth_* params (e.g. oauth_callback, oauth_verifier). */
|
|
194
|
+
oauthExtras?: Record<string, string>;
|
|
143
195
|
}): string;
|
|
196
|
+
/** Parse `application/x-www-form-urlencoded` OAuth token responses. */
|
|
197
|
+
declare function parseSmugMugOAuthFormBody(body: string): Record<string, string>;
|
|
198
|
+
/**
|
|
199
|
+
* Step 1 — temporary credentials.
|
|
200
|
+
* Signs with consumer secret + empty token secret; includes `oauth_callback` (URL or `oob`).
|
|
201
|
+
*/
|
|
202
|
+
declare function getSmugMugRequestToken(input: {
|
|
203
|
+
consumer: SmugMugConsumerCredentials;
|
|
204
|
+
callbackUrl: string;
|
|
205
|
+
fetchImpl?: typeof fetch;
|
|
206
|
+
nonce?: string;
|
|
207
|
+
timestamp?: string;
|
|
208
|
+
}): Promise<SmugMugRequestTokenResult>;
|
|
209
|
+
/** Step 2 — browser authorize URL (host redirects the photographer here). */
|
|
210
|
+
declare function buildSmugMugAuthorizeUrl(options: SmugMugAuthorizeUrlOptions): string;
|
|
211
|
+
/**
|
|
212
|
+
* Step 3 — exchange request token + verifier for long-lived access credentials.
|
|
213
|
+
* Signs with consumer secret + request token secret.
|
|
214
|
+
*/
|
|
215
|
+
declare function getSmugMugAccessToken(input: {
|
|
216
|
+
consumer: SmugMugConsumerCredentials;
|
|
217
|
+
requestToken: SmugMugOAuthTokenPair;
|
|
218
|
+
verifier: string;
|
|
219
|
+
fetchImpl?: typeof fetch;
|
|
220
|
+
nonce?: string;
|
|
221
|
+
timestamp?: string;
|
|
222
|
+
}): Promise<SmugMugOAuthTokenPair>;
|
|
223
|
+
/**
|
|
224
|
+
* Connect-UI start helper: request token + authorize URL.
|
|
225
|
+
* Host stores `requestTokenSecret` in session/cookie for the callback → `getSmugMugAccessToken`.
|
|
226
|
+
*/
|
|
227
|
+
declare function createSmugMugOAuthSession(input: {
|
|
228
|
+
consumerKey: string;
|
|
229
|
+
consumerSecret: string;
|
|
230
|
+
callbackUrl: string;
|
|
231
|
+
access?: SmugMugAccessLevel;
|
|
232
|
+
permissions?: SmugMugPermissionLevel;
|
|
233
|
+
fetchImpl?: typeof fetch;
|
|
234
|
+
nonce?: string;
|
|
235
|
+
timestamp?: string;
|
|
236
|
+
}): Promise<SmugMugOAuthSession>;
|
|
144
237
|
declare function readSmugMugCredentialsFromEnv(env?: Record<string, string | undefined>): SmugMugCredentials;
|
|
238
|
+
/**
|
|
239
|
+
* Resolve a SmugMug URI link. Default API responses use `{ Uri, Locator, … }`;
|
|
240
|
+
* `_shorturis` responses use a bare string.
|
|
241
|
+
*/
|
|
242
|
+
declare function resolveSmugMugUriLink(link: SmugMugUriLink | null | undefined, label: string): string;
|
|
145
243
|
/** Signed SmugMug API client — recursively discovers folders, albums, and images. */
|
|
146
244
|
declare class SmugMugApiClient {
|
|
147
245
|
readonly credentials: SmugMugCredentials;
|
|
@@ -509,4 +607,4 @@ declare const wixAdapter: MigrationAdapter;
|
|
|
509
607
|
|
|
510
608
|
declare function getAdapter(platform: MigrationPlatform): MigrationAdapter;
|
|
511
609
|
|
|
512
|
-
export { MigrationAdapter, MigrationPlatform, SMUGMUG_API_BASE, SMUGMUG_OAUTH_ENDPOINTS, SQUARESPACE_JSON_FORMAT, SmugMugApiClient, type SmugMugClientOptions, type SmugMugCredentials, type SquarespaceClientOptions, type SquarespaceCollectTarget, SquarespaceCollectionClient, WixCollectionClient, WixPageSnapshotCollector, buildJsonPrettyUrl, buildSmugMugAuthorizationHeader, getAdapter, mapJsonPrettyWire, readSmugMugCredentialsFromEnv, signSmugMugOAuthRequest, smugMugCredentialsSchema, smugmugAdapter, squarespaceAdapter, wixAdapter, wordpressAdapter };
|
|
610
|
+
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, buildJsonPrettyUrl, buildSmugMugAuthorizationHeader, buildSmugMugAuthorizeUrl, createSmugMugOAuthSession, getAdapter, getSmugMugAccessToken, getSmugMugRequestToken, mapJsonPrettyWire, parseSmugMugOAuthFormBody, readSmugMugCredentialsFromEnv, resolveSmugMugUriLink, signSmugMugOAuthRequest, smugMugConsumerCredentialsSchema, smugMugCredentialsSchema, smugmugAdapter, squarespaceAdapter, wixAdapter, wordpressAdapter };
|
package/dist/index.js
CHANGED
|
@@ -5,15 +5,22 @@ import {
|
|
|
5
5
|
WixCollectionClient,
|
|
6
6
|
WixPageSnapshotCollector,
|
|
7
7
|
buildSmugMugAuthorizationHeader,
|
|
8
|
+
buildSmugMugAuthorizeUrl,
|
|
9
|
+
createSmugMugOAuthSession,
|
|
8
10
|
getAdapter,
|
|
11
|
+
getSmugMugAccessToken,
|
|
12
|
+
getSmugMugRequestToken,
|
|
13
|
+
parseSmugMugOAuthFormBody,
|
|
9
14
|
readSmugMugCredentialsFromEnv,
|
|
15
|
+
resolveSmugMugUriLink,
|
|
10
16
|
signSmugMugOAuthRequest,
|
|
17
|
+
smugMugConsumerCredentialsSchema,
|
|
11
18
|
smugMugCredentialsSchema,
|
|
12
19
|
smugmugAdapter,
|
|
13
20
|
squarespaceAdapter,
|
|
14
21
|
wixAdapter,
|
|
15
22
|
wordpressAdapter
|
|
16
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-5RKHB6GI.js";
|
|
17
24
|
import {
|
|
18
25
|
normalizedAssetExifSchema,
|
|
19
26
|
normalizedAssetSchema,
|
|
@@ -135,12 +142,14 @@ export {
|
|
|
135
142
|
buildPortfolioMediaLinks,
|
|
136
143
|
buildRedirectMap,
|
|
137
144
|
buildSmugMugAuthorizationHeader,
|
|
145
|
+
buildSmugMugAuthorizeUrl,
|
|
138
146
|
bundleCounts,
|
|
139
147
|
bundleToCombinedJson,
|
|
140
148
|
canonicalizeInlineAssetUrl,
|
|
141
149
|
collectEntities,
|
|
142
150
|
createFilesystemMigrationSink,
|
|
143
151
|
createMigrationMediaRefReplaceWith,
|
|
152
|
+
createSmugMugOAuthSession,
|
|
144
153
|
createWpContentGatewayRewrite,
|
|
145
154
|
cssToStyles,
|
|
146
155
|
detectRedirectLoops,
|
|
@@ -156,6 +165,8 @@ export {
|
|
|
156
165
|
extractInlineImageSrcs,
|
|
157
166
|
formatMigrationMediaRef,
|
|
158
167
|
getAdapter,
|
|
168
|
+
getSmugMugAccessToken,
|
|
169
|
+
getSmugMugRequestToken,
|
|
159
170
|
grapesComponentSchema,
|
|
160
171
|
grapesProjectSnapshotSchema,
|
|
161
172
|
grapesStyleRuleSchema,
|
|
@@ -180,11 +191,13 @@ export {
|
|
|
180
191
|
normalizedPostSchema,
|
|
181
192
|
normalizedTagSchema,
|
|
182
193
|
parseMigrationMediaRef,
|
|
194
|
+
parseSmugMugOAuthFormBody,
|
|
183
195
|
portfolioMediaMatchesBundle,
|
|
184
196
|
readSmugMugCredentialsFromEnv,
|
|
185
197
|
resolveAdapterImportSummary,
|
|
186
198
|
resolveFeaturedContentAssetUrl,
|
|
187
199
|
resolveMigrationMediaSourceId,
|
|
200
|
+
resolveSmugMugUriLink,
|
|
188
201
|
rewriteInlineImages,
|
|
189
202
|
rewriteOriginUrlsInText,
|
|
190
203
|
runDryRun,
|
|
@@ -193,6 +206,7 @@ export {
|
|
|
193
206
|
sanitizeSlug,
|
|
194
207
|
shouldProcessEntity,
|
|
195
208
|
signSmugMugOAuthRequest,
|
|
209
|
+
smugMugConsumerCredentialsSchema,
|
|
196
210
|
smugMugCredentialsSchema,
|
|
197
211
|
smugmugAdapter,
|
|
198
212
|
sourceMetadataSchema,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artinstack/migrator",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.19",
|
|
4
|
+
"description": "MIT OSS migration framework — WordPress, SmugMug, Squarespace, Wix to portable DTOs. CLI + MigrationSink for any host; also powers import on artinstack.com",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ArtInStack",
|
|
7
7
|
"homepage": "https://github.com/naikondev/artinstack-migrator#readme",
|