@extension.dev/deploy 0.3.0 → 1.0.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/README.md +1 -1
- package/dist/module.js +54 -131
- package/dist/module.mjs +54 -131
- package/dist/src/chrome.d.ts +2 -16
- package/dist/src/chrome.d.ts.map +1 -1
- package/dist/src/cli-commands.d.ts.map +1 -1
- package/dist/src/config.d.ts +3 -8
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/init-chrome.d.ts +1 -0
- package/dist/src/init-chrome.d.ts.map +1 -1
- package/dist/src/init.d.ts.map +1 -1
- package/dist/src/types.d.ts +8 -24
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/watch.d.ts +1 -0
- package/dist/src/watch.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -78,10 +78,10 @@ Run `extension-deploy --help` for the full list of flags.
|
|
|
78
78
|
| ---------------------------------- | --------------------------- | --------------------------------- |
|
|
79
79
|
| `--chrome-zip <path>` | `CHROME_ZIP` | Path to the extension ZIP file |
|
|
80
80
|
| `--chrome-extension-id <id>` | `CHROME_EXTENSION_ID` | Chrome Web Store extension ID |
|
|
81
|
+
| `--chrome-publisher-id <uuid>` | `CHROME_PUBLISHER_ID` | Publisher UUID from the dev console (required) |
|
|
81
82
|
| `--chrome-client-id <id>` | `CHROME_CLIENT_ID` | OAuth2 client ID |
|
|
82
83
|
| `--chrome-client-secret <secret>` | `CHROME_CLIENT_SECRET` | OAuth2 client secret |
|
|
83
84
|
| `--chrome-refresh-token <token>` | `CHROME_REFRESH_TOKEN` | OAuth2 refresh token |
|
|
84
|
-
| `--chrome-publish-target <target>` | `CHROME_PUBLISH_TARGET` | `"default"` or `"trustedTesters"` |
|
|
85
85
|
| `--chrome-deploy-percentage <n>` | `CHROME_DEPLOY_PERCENTAGE` | Staged rollout percentage (1-100) |
|
|
86
86
|
| `--chrome-review-exemption` | `CHROME_REVIEW_EXEMPTION` | Request expedited review |
|
|
87
87
|
| `--chrome-skip-submit-review` | `CHROME_SKIP_SUBMIT_REVIEW` | Upload only, skip publish step |
|
package/dist/module.js
CHANGED
|
@@ -62,18 +62,10 @@ const chromeOptionsSchema = external_zod_namespaceObject.z.object({
|
|
|
62
62
|
clientId: external_zod_namespaceObject.z.string().min(1).trim(),
|
|
63
63
|
clientSecret: external_zod_namespaceObject.z.string().min(1).trim(),
|
|
64
64
|
refreshToken: external_zod_namespaceObject.z.string().min(1).trim(),
|
|
65
|
-
|
|
66
|
-
"default",
|
|
67
|
-
"trustedTesters"
|
|
68
|
-
]).default("default"),
|
|
65
|
+
publisherId: external_zod_namespaceObject.z.string().min(1).trim(),
|
|
69
66
|
deployPercentage: external_zod_namespaceObject.z.number().int().min(1).max(100).optional(),
|
|
70
67
|
reviewExemption: external_zod_namespaceObject.z.boolean().default(false),
|
|
71
|
-
skipSubmitReview: external_zod_namespaceObject.z.boolean().default(false)
|
|
72
|
-
publisherId: external_zod_namespaceObject.z.string().trim().optional(),
|
|
73
|
-
apiVersion: external_zod_namespaceObject.z["enum"]([
|
|
74
|
-
"v1.1",
|
|
75
|
-
"v2"
|
|
76
|
-
]).optional()
|
|
68
|
+
skipSubmitReview: external_zod_namespaceObject.z.boolean().default(false)
|
|
77
69
|
});
|
|
78
70
|
const firefoxOptionsSchema = external_zod_namespaceObject.z.object({
|
|
79
71
|
zip: external_zod_namespaceObject.z.string().min(1),
|
|
@@ -120,12 +112,10 @@ function resolveConfig(flags) {
|
|
|
120
112
|
clientId: flags.chromeClientId ?? envStr("CHROME_CLIENT_ID") ?? "",
|
|
121
113
|
clientSecret: flags.chromeClientSecret ?? envStr("CHROME_CLIENT_SECRET") ?? "",
|
|
122
114
|
refreshToken: flags.chromeRefreshToken ?? envStr("CHROME_REFRESH_TOKEN") ?? "",
|
|
123
|
-
|
|
115
|
+
publisherId: flags.chromePublisherId ?? envStr("CHROME_PUBLISHER_ID") ?? "",
|
|
124
116
|
deployPercentage: flags.chromeDeployPercentage ?? envInt("CHROME_DEPLOY_PERCENTAGE"),
|
|
125
117
|
reviewExemption: flags.chromeReviewExemption ?? envBool("CHROME_REVIEW_EXEMPTION"),
|
|
126
|
-
skipSubmitReview: flags.chromeSkipSubmitReview ?? envBool("CHROME_SKIP_SUBMIT_REVIEW")
|
|
127
|
-
publisherId: flags.chromePublisherId ?? envStr("CHROME_PUBLISHER_ID"),
|
|
128
|
-
apiVersion: flags.chromeApiVersion ?? envStr("CHROME_API_VERSION")
|
|
118
|
+
skipSubmitReview: flags.chromeSkipSubmitReview ?? envBool("CHROME_SKIP_SUBMIT_REVIEW")
|
|
129
119
|
},
|
|
130
120
|
firefox: null == firefoxZip ? void 0 : {
|
|
131
121
|
zip: firefoxZip,
|
|
@@ -152,7 +142,7 @@ const SETUP_HINTS = {
|
|
|
152
142
|
CHROME_CLIENT_ID: "Create OAuth 2.0 credentials at https://console.cloud.google.com/apis/credentials",
|
|
153
143
|
CHROME_CLIENT_SECRET: "Generated alongside the Client ID in the Google Cloud Console.",
|
|
154
144
|
CHROME_REFRESH_TOKEN: "Obtain by completing the OAuth consent flow. See the Chrome Web Store API docs.",
|
|
155
|
-
CHROME_PUBLISHER_ID: "The publisher UUID from your Chrome Web Store dev console URL (chrome.google.com/webstore/devconsole/<UUID>).
|
|
145
|
+
CHROME_PUBLISHER_ID: "The publisher UUID from your Chrome Web Store dev console URL (chrome.google.com/webstore/devconsole/<UUID>).",
|
|
156
146
|
CHROME_ZIP: "Path to the .zip file built for Chrome Web Store upload.",
|
|
157
147
|
FIREFOX_EXTENSION_ID: "The addon GUID ({uuid} format) or email-style ID from your addon's AMO page.",
|
|
158
148
|
FIREFOX_JWT_ISSUER: "API key from https://addons.mozilla.org/developers/addon/api/key/",
|
|
@@ -268,21 +258,14 @@ function logDryStep(scope, step, details) {
|
|
|
268
258
|
const UPLOAD_TIMEOUT_MS = 120000;
|
|
269
259
|
const PUBLISH_TIMEOUT_MS = 60000;
|
|
270
260
|
const CWS_OAUTH_URL = "https://oauth2.googleapis.com/token";
|
|
271
|
-
const CWS_UPLOAD_BASE = "https://www.googleapis.com/upload/chromewebstore/v1.1/items";
|
|
272
|
-
const CWS_PUBLISH_BASE = "https://www.googleapis.com/chromewebstore/v1.1/items";
|
|
273
|
-
const CWS_ITEMS_BASE = "https://www.googleapis.com/chromewebstore/v1.1/items";
|
|
274
261
|
const CWS_V2_BASE = "https://chromewebstore.googleapis.com/v2";
|
|
275
262
|
const CWS_V2_UPLOAD_BASE = "https://chromewebstore.googleapis.com/upload/v2";
|
|
276
|
-
function resolveChromeApiVersion(opts) {
|
|
277
|
-
if ("v1.1" === opts.apiVersion || "v2" === opts.apiVersion) return opts.apiVersion;
|
|
278
|
-
return String(opts.publisherId || "").trim() ? "v2" : "v1.1";
|
|
279
|
-
}
|
|
280
263
|
function v2ItemName(publisherId, extensionId) {
|
|
281
264
|
return `publishers/${encodeURIComponent(publisherId)}/items/${encodeURIComponent(extensionId)}`;
|
|
282
265
|
}
|
|
283
266
|
function requirePublisherId(publisherId, op) {
|
|
284
267
|
const id = String(publisherId || "").trim();
|
|
285
|
-
if (!id) throw new Error(`Chrome ${op}
|
|
268
|
+
if (!id) throw new Error(`Chrome ${op} needs a publisher ID (the UUID from your Chrome Web Store dev console URL).`);
|
|
286
269
|
return id;
|
|
287
270
|
}
|
|
288
271
|
function chromeStoreUrl(extensionId) {
|
|
@@ -303,27 +286,16 @@ async function authenticate(clientId, clientSecret, refreshToken) {
|
|
|
303
286
|
}
|
|
304
287
|
});
|
|
305
288
|
}
|
|
306
|
-
async function chrome_upload(extensionId, zipPath, token
|
|
289
|
+
async function chrome_upload(extensionId, publisherId, zipPath, token) {
|
|
307
290
|
const body = await promises_default().readFile(zipPath);
|
|
308
|
-
|
|
309
|
-
let method;
|
|
310
|
-
const headers = {
|
|
311
|
-
Authorization: `${token.token_type} ${token.access_token}`,
|
|
312
|
-
"Content-Type": "application/zip"
|
|
313
|
-
};
|
|
314
|
-
if ("v2" === ctx.apiVersion) {
|
|
315
|
-
const pub = requirePublisherId(ctx.publisherId, "upload");
|
|
316
|
-
url = `${CWS_V2_UPLOAD_BASE}/${v2ItemName(pub, extensionId)}:upload`;
|
|
317
|
-
method = "POST";
|
|
318
|
-
} else {
|
|
319
|
-
url = `${CWS_UPLOAD_BASE}/${extensionId}`;
|
|
320
|
-
method = "PUT";
|
|
321
|
-
headers["x-goog-api-version"] = "2";
|
|
322
|
-
}
|
|
291
|
+
const url = `${CWS_V2_UPLOAD_BASE}/${v2ItemName(publisherId, extensionId)}:upload`;
|
|
323
292
|
const res = await fetch(url, {
|
|
324
|
-
method,
|
|
293
|
+
method: "POST",
|
|
325
294
|
body,
|
|
326
|
-
headers
|
|
295
|
+
headers: {
|
|
296
|
+
Authorization: `${token.token_type} ${token.access_token}`,
|
|
297
|
+
"Content-Type": "application/zip"
|
|
298
|
+
},
|
|
327
299
|
signal: AbortSignal.timeout(UPLOAD_TIMEOUT_MS)
|
|
328
300
|
});
|
|
329
301
|
if (!res.ok) {
|
|
@@ -332,44 +304,22 @@ async function chrome_upload(extensionId, zipPath, token, ctx) {
|
|
|
332
304
|
}
|
|
333
305
|
}
|
|
334
306
|
async function publish(params) {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
if (null != params.deployPercentage) reqBody.deployInfos = [
|
|
342
|
-
{
|
|
343
|
-
deployPercentage: params.deployPercentage
|
|
344
|
-
}
|
|
345
|
-
];
|
|
346
|
-
if (params.reviewExemption) reqBody.skipReview = true;
|
|
347
|
-
const res = await fetch(`${CWS_V2_BASE}/${v2ItemName(pub, params.extensionId)}:publish`, {
|
|
348
|
-
method: "POST",
|
|
349
|
-
headers: {
|
|
350
|
-
Authorization: `${params.token.token_type} ${params.token.access_token}`,
|
|
351
|
-
"Content-Type": "application/json"
|
|
352
|
-
},
|
|
353
|
-
body: JSON.stringify(reqBody),
|
|
354
|
-
signal: AbortSignal.timeout(PUBLISH_TIMEOUT_MS)
|
|
355
|
-
});
|
|
356
|
-
if (!res.ok) {
|
|
357
|
-
const text = await res.text().catch(()=>"");
|
|
358
|
-
throw new Error(`Chrome publish failed: ${res.status} ${res.statusText}\n${text}`);
|
|
307
|
+
const reqBody = {
|
|
308
|
+
publishType: "DEFAULT_PUBLISH"
|
|
309
|
+
};
|
|
310
|
+
if (null != params.deployPercentage) reqBody.deployInfos = [
|
|
311
|
+
{
|
|
312
|
+
deployPercentage: params.deployPercentage
|
|
359
313
|
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
const
|
|
363
|
-
url.searchParams.set("publishTarget", params.publishTarget);
|
|
364
|
-
if (null != params.deployPercentage) url.searchParams.set("deployPercentage", String(params.deployPercentage));
|
|
365
|
-
if (null != params.reviewExemption) url.searchParams.set("reviewExemption", String(params.reviewExemption));
|
|
366
|
-
const res = await fetch(url.href, {
|
|
314
|
+
];
|
|
315
|
+
if (params.reviewExemption) reqBody.skipReview = true;
|
|
316
|
+
const res = await fetch(`${CWS_V2_BASE}/${v2ItemName(params.publisherId, params.extensionId)}:publish`, {
|
|
367
317
|
method: "POST",
|
|
368
318
|
headers: {
|
|
369
319
|
Authorization: `${params.token.token_type} ${params.token.access_token}`,
|
|
370
|
-
"
|
|
371
|
-
"Content-Length": "0"
|
|
320
|
+
"Content-Type": "application/json"
|
|
372
321
|
},
|
|
322
|
+
body: JSON.stringify(reqBody),
|
|
373
323
|
signal: AbortSignal.timeout(PUBLISH_TIMEOUT_MS)
|
|
374
324
|
});
|
|
375
325
|
if (!res.ok) {
|
|
@@ -380,8 +330,8 @@ async function publish(params) {
|
|
|
380
330
|
async function publishChrome(options, dryRun) {
|
|
381
331
|
await assertFilePresent(options.zip);
|
|
382
332
|
const zipSize = await getFileSize(options.zip);
|
|
383
|
-
const
|
|
384
|
-
log("chrome",
|
|
333
|
+
const publisherId = requirePublisherId(options.publisherId, "submit");
|
|
334
|
+
log("chrome", "Authenticating with Chrome Web Store (API v2)");
|
|
385
335
|
const token = await authenticate(options.clientId, options.clientSecret, options.refreshToken);
|
|
386
336
|
const outcome = {
|
|
387
337
|
storeUrl: chromeStoreUrl(options.extensionId),
|
|
@@ -390,17 +340,13 @@ async function publishChrome(options, dryRun) {
|
|
|
390
340
|
if (dryRun) {
|
|
391
341
|
logDryStep("chrome", "Authentication succeeded", {
|
|
392
342
|
tokenType: token.token_type,
|
|
393
|
-
scope: "chromewebstore"
|
|
394
|
-
apiVersion
|
|
343
|
+
scope: "chromewebstore"
|
|
395
344
|
});
|
|
396
345
|
logDryStep("chrome", "Would upload ZIP", {
|
|
397
346
|
file: options.zip,
|
|
398
|
-
size: formatBytes(zipSize)
|
|
399
|
-
apiVersion
|
|
347
|
+
size: formatBytes(zipSize)
|
|
400
348
|
});
|
|
401
349
|
options.skipSubmitReview ? logDryStep("chrome", "Would skip publish (skipSubmitReview=true)") : logDryStep("chrome", "Would publish for review", {
|
|
402
|
-
apiVersion,
|
|
403
|
-
publishTarget: options.publishTarget ?? "default",
|
|
404
350
|
deployPercentage: options.deployPercentage,
|
|
405
351
|
reviewExemption: options.reviewExemption
|
|
406
352
|
});
|
|
@@ -408,10 +354,7 @@ async function publishChrome(options, dryRun) {
|
|
|
408
354
|
return outcome;
|
|
409
355
|
}
|
|
410
356
|
log("chrome", `Uploading ZIP file (${formatBytes(zipSize)})`);
|
|
411
|
-
await chrome_upload(options.extensionId, options.zip, token
|
|
412
|
-
apiVersion,
|
|
413
|
-
publisherId: options.publisherId
|
|
414
|
-
});
|
|
357
|
+
await chrome_upload(options.extensionId, publisherId, options.zip, token);
|
|
415
358
|
if (options.skipSubmitReview) {
|
|
416
359
|
log("chrome", "Skipping publish step (skipSubmitReview=true)");
|
|
417
360
|
return outcome;
|
|
@@ -419,42 +362,30 @@ async function publishChrome(options, dryRun) {
|
|
|
419
362
|
log("chrome", "Publishing extension");
|
|
420
363
|
await publish({
|
|
421
364
|
extensionId: options.extensionId,
|
|
422
|
-
|
|
365
|
+
publisherId,
|
|
423
366
|
token,
|
|
424
367
|
deployPercentage: options.deployPercentage,
|
|
425
|
-
reviewExemption: options.reviewExemption
|
|
426
|
-
apiVersion,
|
|
427
|
-
publisherId: options.publisherId
|
|
368
|
+
reviewExemption: options.reviewExemption
|
|
428
369
|
});
|
|
429
370
|
return outcome;
|
|
430
371
|
}
|
|
431
372
|
async function getChromeItem(params) {
|
|
373
|
+
var _rev_distributionChannels_, _rev_distributionChannels;
|
|
432
374
|
const token = await authenticate(params.clientId, params.clientSecret, params.refreshToken);
|
|
433
375
|
const auth = {
|
|
434
376
|
Authorization: `${token.token_type} ${token.access_token}`
|
|
435
377
|
};
|
|
436
|
-
const
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
const pub = requirePublisherId(params.publisherId, "status");
|
|
440
|
-
const status = await fetchJson(`${CWS_V2_BASE}/${v2ItemName(pub, params.extensionId)}:fetchStatus`, {
|
|
441
|
-
headers: auth
|
|
442
|
-
});
|
|
443
|
-
const rev = status.submittedItemRevisionStatus || status.publishedItemRevisionStatus;
|
|
444
|
-
return {
|
|
445
|
-
uploadState: status.lastAsyncUploadState,
|
|
446
|
-
crxVersion: null == rev ? void 0 : null == (_rev_distributionChannels = rev.distributionChannels) ? void 0 : null == (_rev_distributionChannels_ = _rev_distributionChannels[0]) ? void 0 : _rev_distributionChannels_.crxVersion,
|
|
447
|
-
publicKey: status.publicKey,
|
|
448
|
-
state: null == rev ? void 0 : rev.state
|
|
449
|
-
};
|
|
450
|
-
}
|
|
451
|
-
const url = `${CWS_ITEMS_BASE}/${encodeURIComponent(params.extensionId)}?projection=${params.projection ?? "DRAFT"}`;
|
|
452
|
-
return fetchJson(url, {
|
|
453
|
-
headers: {
|
|
454
|
-
...auth,
|
|
455
|
-
"x-goog-api-version": "2"
|
|
456
|
-
}
|
|
378
|
+
const pub = requirePublisherId(params.publisherId, "status");
|
|
379
|
+
const status = await fetchJson(`${CWS_V2_BASE}/${v2ItemName(pub, params.extensionId)}:fetchStatus`, {
|
|
380
|
+
headers: auth
|
|
457
381
|
});
|
|
382
|
+
const rev = status.submittedItemRevisionStatus || status.publishedItemRevisionStatus;
|
|
383
|
+
return {
|
|
384
|
+
uploadState: status.lastAsyncUploadState,
|
|
385
|
+
crxVersion: null == rev ? void 0 : null == (_rev_distributionChannels = rev.distributionChannels) ? void 0 : null == (_rev_distributionChannels_ = _rev_distributionChannels[0]) ? void 0 : _rev_distributionChannels_.crxVersion,
|
|
386
|
+
publicKey: status.publicKey,
|
|
387
|
+
state: null == rev ? void 0 : rev.state
|
|
388
|
+
};
|
|
458
389
|
}
|
|
459
390
|
async function verifyChromeCredentials(params) {
|
|
460
391
|
let token;
|
|
@@ -469,27 +400,15 @@ async function verifyChromeCredentials(params) {
|
|
|
469
400
|
const auth = {
|
|
470
401
|
Authorization: `${token.token_type} ${token.access_token}`
|
|
471
402
|
};
|
|
472
|
-
const version = resolveChromeApiVersion(params);
|
|
473
403
|
try {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
const status = await fetchJson(`${CWS_V2_BASE}/${v2ItemName(pub, params.extensionId)}:fetchStatus`, {
|
|
477
|
-
headers: auth
|
|
478
|
-
});
|
|
479
|
-
const rev = status.submittedItemRevisionStatus || status.publishedItemRevisionStatus;
|
|
480
|
-
return {
|
|
481
|
-
ok: true,
|
|
482
|
-
message: `Credentials verified (Chrome v2 API). Item state: ${(null == rev ? void 0 : rev.state) || "unknown"}.`
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
|
-
const item = await fetchJson(`${CWS_ITEMS_BASE}/${encodeURIComponent(params.extensionId)}?projection=DRAFT`, {
|
|
404
|
+
const pub = requirePublisherId(params.publisherId, "verify");
|
|
405
|
+
const status = await fetchJson(`${CWS_V2_BASE}/${v2ItemName(pub, params.extensionId)}:fetchStatus`, {
|
|
486
406
|
headers: auth
|
|
487
407
|
});
|
|
488
|
-
const
|
|
408
|
+
const rev = status.submittedItemRevisionStatus || status.publishedItemRevisionStatus;
|
|
489
409
|
return {
|
|
490
410
|
ok: true,
|
|
491
|
-
message: `Credentials verified.
|
|
492
|
-
extensionTitle: title
|
|
411
|
+
message: `Credentials verified (Chrome Web Store API v2). Item state: ${(null == rev ? void 0 : rev.state) || "unknown"}.`
|
|
493
412
|
};
|
|
494
413
|
} catch (err) {
|
|
495
414
|
const msg = err instanceof Error ? err.message : String(err);
|
|
@@ -499,7 +418,7 @@ async function verifyChromeCredentials(params) {
|
|
|
499
418
|
};
|
|
500
419
|
if (msg.includes("403")) return {
|
|
501
420
|
ok: false,
|
|
502
|
-
message: "
|
|
421
|
+
message: "Access denied. Check the publisher ID matches this extension's account, and that the extension ID is correct."
|
|
503
422
|
};
|
|
504
423
|
return {
|
|
505
424
|
ok: false,
|
|
@@ -989,10 +908,10 @@ GLOBAL
|
|
|
989
908
|
CHROME
|
|
990
909
|
--chrome-zip <path> Path to Chrome extension ZIP
|
|
991
910
|
--chrome-extension-id <id> Chrome extension ID
|
|
911
|
+
--chrome-publisher-id <uuid> Publisher UUID from the dev console (required)
|
|
992
912
|
--chrome-client-id <id> OAuth2 client ID
|
|
993
913
|
--chrome-client-secret <secret> OAuth2 client secret
|
|
994
914
|
--chrome-refresh-token <token> OAuth2 refresh token
|
|
995
|
-
--chrome-publish-target <target> "default" or "trustedTesters"
|
|
996
915
|
--chrome-deploy-percentage <n> Staged rollout percentage (1-100)
|
|
997
916
|
--chrome-review-exemption Request expedited review
|
|
998
917
|
--chrome-skip-submit-review Upload only, skip publish
|
|
@@ -1257,11 +1176,13 @@ async function collectChromeCredentials(deps) {
|
|
|
1257
1176
|
io.log(" 2. OAuth 2.0 credentials (application type: Desktop app):");
|
|
1258
1177
|
io.log(" https://console.cloud.google.com/apis/credentials");
|
|
1259
1178
|
io.log(" 3. Your extension ID from the Chrome Web Store Developer Dashboard.");
|
|
1179
|
+
io.log(" 4. Your publisher ID (the UUID in your dev console URL: chrome.google.com/webstore/devconsole/<UUID>).");
|
|
1260
1180
|
io.log("");
|
|
1261
1181
|
io.log("This wizard will take your Client ID + Secret and walk you through");
|
|
1262
1182
|
io.log("generating a refresh token automatically.");
|
|
1263
1183
|
io.log("");
|
|
1264
1184
|
const extensionId = await requireValue(io, "Chrome extension ID", "(32-character ID from the CWS dashboard URL)");
|
|
1185
|
+
const publisherId = await requireValue(io, "Chrome publisher ID", "(UUID from your dev console URL)");
|
|
1265
1186
|
const clientId = await requireValue(io, "OAuth Client ID");
|
|
1266
1187
|
const clientSecret = await requireValue(io, "OAuth Client Secret", void 0, {
|
|
1267
1188
|
secret: true
|
|
@@ -1269,6 +1190,7 @@ async function collectChromeCredentials(deps) {
|
|
|
1269
1190
|
const refreshToken = await obtainChromeRefreshToken(deps, clientId, clientSecret);
|
|
1270
1191
|
return {
|
|
1271
1192
|
extensionId,
|
|
1193
|
+
publisherId,
|
|
1272
1194
|
clientId,
|
|
1273
1195
|
clientSecret,
|
|
1274
1196
|
refreshToken
|
|
@@ -1400,7 +1322,7 @@ async function runInit(deps, options = {}) {
|
|
|
1400
1322
|
io.log("");
|
|
1401
1323
|
if ("chrome" === store) {
|
|
1402
1324
|
const creds = await collectChromeCredentials(deps);
|
|
1403
|
-
envLines.push(`CHROME_EXTENSION_ID=${creds.extensionId}`, `CHROME_CLIENT_ID=${creds.clientId}`, `CHROME_CLIENT_SECRET=${creds.clientSecret}`, `CHROME_REFRESH_TOKEN=${creds.refreshToken}`, "");
|
|
1325
|
+
envLines.push(`CHROME_EXTENSION_ID=${creds.extensionId}`, `CHROME_PUBLISHER_ID=${creds.publisherId}`, `CHROME_CLIENT_ID=${creds.clientId}`, `CHROME_CLIENT_SECRET=${creds.clientSecret}`, `CHROME_REFRESH_TOKEN=${creds.refreshToken}`, "");
|
|
1404
1326
|
if (!options.skipVerify) {
|
|
1405
1327
|
const verify = deps.verifyChrome ?? verifyChromeCredentials;
|
|
1406
1328
|
verified.chrome = normalizeVerify(await verify(creds));
|
|
@@ -1586,7 +1508,8 @@ async function runWatch(flags) {
|
|
|
1586
1508
|
clientId: mustEnv("CHROME_CLIENT_ID", flags.chromeClientId),
|
|
1587
1509
|
clientSecret: mustEnv("CHROME_CLIENT_SECRET", flags.chromeClientSecret),
|
|
1588
1510
|
refreshToken: mustEnv("CHROME_REFRESH_TOKEN", flags.chromeRefreshToken),
|
|
1589
|
-
extensionId: mustEnv("CHROME_EXTENSION_ID", flags.chromeExtensionId)
|
|
1511
|
+
extensionId: mustEnv("CHROME_EXTENSION_ID", flags.chromeExtensionId),
|
|
1512
|
+
publisherId: mustEnv("CHROME_PUBLISHER_ID", flags.chromePublisherId)
|
|
1590
1513
|
}, {
|
|
1591
1514
|
pollIntervalMs,
|
|
1592
1515
|
timeoutMs,
|
package/dist/module.mjs
CHANGED
|
@@ -11,18 +11,10 @@ const chromeOptionsSchema = z.object({
|
|
|
11
11
|
clientId: z.string().min(1).trim(),
|
|
12
12
|
clientSecret: z.string().min(1).trim(),
|
|
13
13
|
refreshToken: z.string().min(1).trim(),
|
|
14
|
-
|
|
15
|
-
"default",
|
|
16
|
-
"trustedTesters"
|
|
17
|
-
]).default("default"),
|
|
14
|
+
publisherId: z.string().min(1).trim(),
|
|
18
15
|
deployPercentage: z.number().int().min(1).max(100).optional(),
|
|
19
16
|
reviewExemption: z.boolean().default(false),
|
|
20
|
-
skipSubmitReview: z.boolean().default(false)
|
|
21
|
-
publisherId: z.string().trim().optional(),
|
|
22
|
-
apiVersion: z["enum"]([
|
|
23
|
-
"v1.1",
|
|
24
|
-
"v2"
|
|
25
|
-
]).optional()
|
|
17
|
+
skipSubmitReview: z.boolean().default(false)
|
|
26
18
|
});
|
|
27
19
|
const firefoxOptionsSchema = z.object({
|
|
28
20
|
zip: z.string().min(1),
|
|
@@ -69,12 +61,10 @@ function resolveConfig(flags) {
|
|
|
69
61
|
clientId: flags.chromeClientId ?? envStr("CHROME_CLIENT_ID") ?? "",
|
|
70
62
|
clientSecret: flags.chromeClientSecret ?? envStr("CHROME_CLIENT_SECRET") ?? "",
|
|
71
63
|
refreshToken: flags.chromeRefreshToken ?? envStr("CHROME_REFRESH_TOKEN") ?? "",
|
|
72
|
-
|
|
64
|
+
publisherId: flags.chromePublisherId ?? envStr("CHROME_PUBLISHER_ID") ?? "",
|
|
73
65
|
deployPercentage: flags.chromeDeployPercentage ?? envInt("CHROME_DEPLOY_PERCENTAGE"),
|
|
74
66
|
reviewExemption: flags.chromeReviewExemption ?? envBool("CHROME_REVIEW_EXEMPTION"),
|
|
75
|
-
skipSubmitReview: flags.chromeSkipSubmitReview ?? envBool("CHROME_SKIP_SUBMIT_REVIEW")
|
|
76
|
-
publisherId: flags.chromePublisherId ?? envStr("CHROME_PUBLISHER_ID"),
|
|
77
|
-
apiVersion: flags.chromeApiVersion ?? envStr("CHROME_API_VERSION")
|
|
67
|
+
skipSubmitReview: flags.chromeSkipSubmitReview ?? envBool("CHROME_SKIP_SUBMIT_REVIEW")
|
|
78
68
|
},
|
|
79
69
|
firefox: null == firefoxZip ? void 0 : {
|
|
80
70
|
zip: firefoxZip,
|
|
@@ -101,7 +91,7 @@ const SETUP_HINTS = {
|
|
|
101
91
|
CHROME_CLIENT_ID: "Create OAuth 2.0 credentials at https://console.cloud.google.com/apis/credentials",
|
|
102
92
|
CHROME_CLIENT_SECRET: "Generated alongside the Client ID in the Google Cloud Console.",
|
|
103
93
|
CHROME_REFRESH_TOKEN: "Obtain by completing the OAuth consent flow. See the Chrome Web Store API docs.",
|
|
104
|
-
CHROME_PUBLISHER_ID: "The publisher UUID from your Chrome Web Store dev console URL (chrome.google.com/webstore/devconsole/<UUID>).
|
|
94
|
+
CHROME_PUBLISHER_ID: "The publisher UUID from your Chrome Web Store dev console URL (chrome.google.com/webstore/devconsole/<UUID>).",
|
|
105
95
|
CHROME_ZIP: "Path to the .zip file built for Chrome Web Store upload.",
|
|
106
96
|
FIREFOX_EXTENSION_ID: "The addon GUID ({uuid} format) or email-style ID from your addon's AMO page.",
|
|
107
97
|
FIREFOX_JWT_ISSUER: "API key from https://addons.mozilla.org/developers/addon/api/key/",
|
|
@@ -213,21 +203,14 @@ function logDryStep(scope, step, details) {
|
|
|
213
203
|
const UPLOAD_TIMEOUT_MS = 120000;
|
|
214
204
|
const PUBLISH_TIMEOUT_MS = 60000;
|
|
215
205
|
const CWS_OAUTH_URL = "https://oauth2.googleapis.com/token";
|
|
216
|
-
const CWS_UPLOAD_BASE = "https://www.googleapis.com/upload/chromewebstore/v1.1/items";
|
|
217
|
-
const CWS_PUBLISH_BASE = "https://www.googleapis.com/chromewebstore/v1.1/items";
|
|
218
|
-
const CWS_ITEMS_BASE = "https://www.googleapis.com/chromewebstore/v1.1/items";
|
|
219
206
|
const CWS_V2_BASE = "https://chromewebstore.googleapis.com/v2";
|
|
220
207
|
const CWS_V2_UPLOAD_BASE = "https://chromewebstore.googleapis.com/upload/v2";
|
|
221
|
-
function resolveChromeApiVersion(opts) {
|
|
222
|
-
if ("v1.1" === opts.apiVersion || "v2" === opts.apiVersion) return opts.apiVersion;
|
|
223
|
-
return String(opts.publisherId || "").trim() ? "v2" : "v1.1";
|
|
224
|
-
}
|
|
225
208
|
function v2ItemName(publisherId, extensionId) {
|
|
226
209
|
return `publishers/${encodeURIComponent(publisherId)}/items/${encodeURIComponent(extensionId)}`;
|
|
227
210
|
}
|
|
228
211
|
function requirePublisherId(publisherId, op) {
|
|
229
212
|
const id = String(publisherId || "").trim();
|
|
230
|
-
if (!id) throw new Error(`Chrome ${op}
|
|
213
|
+
if (!id) throw new Error(`Chrome ${op} needs a publisher ID (the UUID from your Chrome Web Store dev console URL).`);
|
|
231
214
|
return id;
|
|
232
215
|
}
|
|
233
216
|
function chromeStoreUrl(extensionId) {
|
|
@@ -248,27 +231,16 @@ async function authenticate(clientId, clientSecret, refreshToken) {
|
|
|
248
231
|
}
|
|
249
232
|
});
|
|
250
233
|
}
|
|
251
|
-
async function chrome_upload(extensionId, zipPath, token
|
|
234
|
+
async function chrome_upload(extensionId, publisherId, zipPath, token) {
|
|
252
235
|
const body = await promises_default.readFile(zipPath);
|
|
253
|
-
|
|
254
|
-
let method;
|
|
255
|
-
const headers = {
|
|
256
|
-
Authorization: `${token.token_type} ${token.access_token}`,
|
|
257
|
-
"Content-Type": "application/zip"
|
|
258
|
-
};
|
|
259
|
-
if ("v2" === ctx.apiVersion) {
|
|
260
|
-
const pub = requirePublisherId(ctx.publisherId, "upload");
|
|
261
|
-
url = `${CWS_V2_UPLOAD_BASE}/${v2ItemName(pub, extensionId)}:upload`;
|
|
262
|
-
method = "POST";
|
|
263
|
-
} else {
|
|
264
|
-
url = `${CWS_UPLOAD_BASE}/${extensionId}`;
|
|
265
|
-
method = "PUT";
|
|
266
|
-
headers["x-goog-api-version"] = "2";
|
|
267
|
-
}
|
|
236
|
+
const url = `${CWS_V2_UPLOAD_BASE}/${v2ItemName(publisherId, extensionId)}:upload`;
|
|
268
237
|
const res = await fetch(url, {
|
|
269
|
-
method,
|
|
238
|
+
method: "POST",
|
|
270
239
|
body,
|
|
271
|
-
headers
|
|
240
|
+
headers: {
|
|
241
|
+
Authorization: `${token.token_type} ${token.access_token}`,
|
|
242
|
+
"Content-Type": "application/zip"
|
|
243
|
+
},
|
|
272
244
|
signal: AbortSignal.timeout(UPLOAD_TIMEOUT_MS)
|
|
273
245
|
});
|
|
274
246
|
if (!res.ok) {
|
|
@@ -277,44 +249,22 @@ async function chrome_upload(extensionId, zipPath, token, ctx) {
|
|
|
277
249
|
}
|
|
278
250
|
}
|
|
279
251
|
async function publish(params) {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
if (null != params.deployPercentage) reqBody.deployInfos = [
|
|
287
|
-
{
|
|
288
|
-
deployPercentage: params.deployPercentage
|
|
289
|
-
}
|
|
290
|
-
];
|
|
291
|
-
if (params.reviewExemption) reqBody.skipReview = true;
|
|
292
|
-
const res = await fetch(`${CWS_V2_BASE}/${v2ItemName(pub, params.extensionId)}:publish`, {
|
|
293
|
-
method: "POST",
|
|
294
|
-
headers: {
|
|
295
|
-
Authorization: `${params.token.token_type} ${params.token.access_token}`,
|
|
296
|
-
"Content-Type": "application/json"
|
|
297
|
-
},
|
|
298
|
-
body: JSON.stringify(reqBody),
|
|
299
|
-
signal: AbortSignal.timeout(PUBLISH_TIMEOUT_MS)
|
|
300
|
-
});
|
|
301
|
-
if (!res.ok) {
|
|
302
|
-
const text = await res.text().catch(()=>"");
|
|
303
|
-
throw new Error(`Chrome publish failed: ${res.status} ${res.statusText}\n${text}`);
|
|
252
|
+
const reqBody = {
|
|
253
|
+
publishType: "DEFAULT_PUBLISH"
|
|
254
|
+
};
|
|
255
|
+
if (null != params.deployPercentage) reqBody.deployInfos = [
|
|
256
|
+
{
|
|
257
|
+
deployPercentage: params.deployPercentage
|
|
304
258
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
const
|
|
308
|
-
url.searchParams.set("publishTarget", params.publishTarget);
|
|
309
|
-
if (null != params.deployPercentage) url.searchParams.set("deployPercentage", String(params.deployPercentage));
|
|
310
|
-
if (null != params.reviewExemption) url.searchParams.set("reviewExemption", String(params.reviewExemption));
|
|
311
|
-
const res = await fetch(url.href, {
|
|
259
|
+
];
|
|
260
|
+
if (params.reviewExemption) reqBody.skipReview = true;
|
|
261
|
+
const res = await fetch(`${CWS_V2_BASE}/${v2ItemName(params.publisherId, params.extensionId)}:publish`, {
|
|
312
262
|
method: "POST",
|
|
313
263
|
headers: {
|
|
314
264
|
Authorization: `${params.token.token_type} ${params.token.access_token}`,
|
|
315
|
-
"
|
|
316
|
-
"Content-Length": "0"
|
|
265
|
+
"Content-Type": "application/json"
|
|
317
266
|
},
|
|
267
|
+
body: JSON.stringify(reqBody),
|
|
318
268
|
signal: AbortSignal.timeout(PUBLISH_TIMEOUT_MS)
|
|
319
269
|
});
|
|
320
270
|
if (!res.ok) {
|
|
@@ -325,8 +275,8 @@ async function publish(params) {
|
|
|
325
275
|
async function publishChrome(options, dryRun) {
|
|
326
276
|
await assertFilePresent(options.zip);
|
|
327
277
|
const zipSize = await getFileSize(options.zip);
|
|
328
|
-
const
|
|
329
|
-
log("chrome",
|
|
278
|
+
const publisherId = requirePublisherId(options.publisherId, "submit");
|
|
279
|
+
log("chrome", "Authenticating with Chrome Web Store (API v2)");
|
|
330
280
|
const token = await authenticate(options.clientId, options.clientSecret, options.refreshToken);
|
|
331
281
|
const outcome = {
|
|
332
282
|
storeUrl: chromeStoreUrl(options.extensionId),
|
|
@@ -335,17 +285,13 @@ async function publishChrome(options, dryRun) {
|
|
|
335
285
|
if (dryRun) {
|
|
336
286
|
logDryStep("chrome", "Authentication succeeded", {
|
|
337
287
|
tokenType: token.token_type,
|
|
338
|
-
scope: "chromewebstore"
|
|
339
|
-
apiVersion
|
|
288
|
+
scope: "chromewebstore"
|
|
340
289
|
});
|
|
341
290
|
logDryStep("chrome", "Would upload ZIP", {
|
|
342
291
|
file: options.zip,
|
|
343
|
-
size: formatBytes(zipSize)
|
|
344
|
-
apiVersion
|
|
292
|
+
size: formatBytes(zipSize)
|
|
345
293
|
});
|
|
346
294
|
options.skipSubmitReview ? logDryStep("chrome", "Would skip publish (skipSubmitReview=true)") : logDryStep("chrome", "Would publish for review", {
|
|
347
|
-
apiVersion,
|
|
348
|
-
publishTarget: options.publishTarget ?? "default",
|
|
349
295
|
deployPercentage: options.deployPercentage,
|
|
350
296
|
reviewExemption: options.reviewExemption
|
|
351
297
|
});
|
|
@@ -353,10 +299,7 @@ async function publishChrome(options, dryRun) {
|
|
|
353
299
|
return outcome;
|
|
354
300
|
}
|
|
355
301
|
log("chrome", `Uploading ZIP file (${formatBytes(zipSize)})`);
|
|
356
|
-
await chrome_upload(options.extensionId, options.zip, token
|
|
357
|
-
apiVersion,
|
|
358
|
-
publisherId: options.publisherId
|
|
359
|
-
});
|
|
302
|
+
await chrome_upload(options.extensionId, publisherId, options.zip, token);
|
|
360
303
|
if (options.skipSubmitReview) {
|
|
361
304
|
log("chrome", "Skipping publish step (skipSubmitReview=true)");
|
|
362
305
|
return outcome;
|
|
@@ -364,42 +307,30 @@ async function publishChrome(options, dryRun) {
|
|
|
364
307
|
log("chrome", "Publishing extension");
|
|
365
308
|
await publish({
|
|
366
309
|
extensionId: options.extensionId,
|
|
367
|
-
|
|
310
|
+
publisherId,
|
|
368
311
|
token,
|
|
369
312
|
deployPercentage: options.deployPercentage,
|
|
370
|
-
reviewExemption: options.reviewExemption
|
|
371
|
-
apiVersion,
|
|
372
|
-
publisherId: options.publisherId
|
|
313
|
+
reviewExemption: options.reviewExemption
|
|
373
314
|
});
|
|
374
315
|
return outcome;
|
|
375
316
|
}
|
|
376
317
|
async function getChromeItem(params) {
|
|
318
|
+
var _rev_distributionChannels_, _rev_distributionChannels;
|
|
377
319
|
const token = await authenticate(params.clientId, params.clientSecret, params.refreshToken);
|
|
378
320
|
const auth = {
|
|
379
321
|
Authorization: `${token.token_type} ${token.access_token}`
|
|
380
322
|
};
|
|
381
|
-
const
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
const pub = requirePublisherId(params.publisherId, "status");
|
|
385
|
-
const status = await fetchJson(`${CWS_V2_BASE}/${v2ItemName(pub, params.extensionId)}:fetchStatus`, {
|
|
386
|
-
headers: auth
|
|
387
|
-
});
|
|
388
|
-
const rev = status.submittedItemRevisionStatus || status.publishedItemRevisionStatus;
|
|
389
|
-
return {
|
|
390
|
-
uploadState: status.lastAsyncUploadState,
|
|
391
|
-
crxVersion: null == rev ? void 0 : null == (_rev_distributionChannels = rev.distributionChannels) ? void 0 : null == (_rev_distributionChannels_ = _rev_distributionChannels[0]) ? void 0 : _rev_distributionChannels_.crxVersion,
|
|
392
|
-
publicKey: status.publicKey,
|
|
393
|
-
state: null == rev ? void 0 : rev.state
|
|
394
|
-
};
|
|
395
|
-
}
|
|
396
|
-
const url = `${CWS_ITEMS_BASE}/${encodeURIComponent(params.extensionId)}?projection=${params.projection ?? "DRAFT"}`;
|
|
397
|
-
return fetchJson(url, {
|
|
398
|
-
headers: {
|
|
399
|
-
...auth,
|
|
400
|
-
"x-goog-api-version": "2"
|
|
401
|
-
}
|
|
323
|
+
const pub = requirePublisherId(params.publisherId, "status");
|
|
324
|
+
const status = await fetchJson(`${CWS_V2_BASE}/${v2ItemName(pub, params.extensionId)}:fetchStatus`, {
|
|
325
|
+
headers: auth
|
|
402
326
|
});
|
|
327
|
+
const rev = status.submittedItemRevisionStatus || status.publishedItemRevisionStatus;
|
|
328
|
+
return {
|
|
329
|
+
uploadState: status.lastAsyncUploadState,
|
|
330
|
+
crxVersion: null == rev ? void 0 : null == (_rev_distributionChannels = rev.distributionChannels) ? void 0 : null == (_rev_distributionChannels_ = _rev_distributionChannels[0]) ? void 0 : _rev_distributionChannels_.crxVersion,
|
|
331
|
+
publicKey: status.publicKey,
|
|
332
|
+
state: null == rev ? void 0 : rev.state
|
|
333
|
+
};
|
|
403
334
|
}
|
|
404
335
|
async function verifyChromeCredentials(params) {
|
|
405
336
|
let token;
|
|
@@ -414,27 +345,15 @@ async function verifyChromeCredentials(params) {
|
|
|
414
345
|
const auth = {
|
|
415
346
|
Authorization: `${token.token_type} ${token.access_token}`
|
|
416
347
|
};
|
|
417
|
-
const version = resolveChromeApiVersion(params);
|
|
418
348
|
try {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
const status = await fetchJson(`${CWS_V2_BASE}/${v2ItemName(pub, params.extensionId)}:fetchStatus`, {
|
|
422
|
-
headers: auth
|
|
423
|
-
});
|
|
424
|
-
const rev = status.submittedItemRevisionStatus || status.publishedItemRevisionStatus;
|
|
425
|
-
return {
|
|
426
|
-
ok: true,
|
|
427
|
-
message: `Credentials verified (Chrome v2 API). Item state: ${(null == rev ? void 0 : rev.state) || "unknown"}.`
|
|
428
|
-
};
|
|
429
|
-
}
|
|
430
|
-
const item = await fetchJson(`${CWS_ITEMS_BASE}/${encodeURIComponent(params.extensionId)}?projection=DRAFT`, {
|
|
349
|
+
const pub = requirePublisherId(params.publisherId, "verify");
|
|
350
|
+
const status = await fetchJson(`${CWS_V2_BASE}/${v2ItemName(pub, params.extensionId)}:fetchStatus`, {
|
|
431
351
|
headers: auth
|
|
432
352
|
});
|
|
433
|
-
const
|
|
353
|
+
const rev = status.submittedItemRevisionStatus || status.publishedItemRevisionStatus;
|
|
434
354
|
return {
|
|
435
355
|
ok: true,
|
|
436
|
-
message: `Credentials verified.
|
|
437
|
-
extensionTitle: title
|
|
356
|
+
message: `Credentials verified (Chrome Web Store API v2). Item state: ${(null == rev ? void 0 : rev.state) || "unknown"}.`
|
|
438
357
|
};
|
|
439
358
|
} catch (err) {
|
|
440
359
|
const msg = err instanceof Error ? err.message : String(err);
|
|
@@ -444,7 +363,7 @@ async function verifyChromeCredentials(params) {
|
|
|
444
363
|
};
|
|
445
364
|
if (msg.includes("403")) return {
|
|
446
365
|
ok: false,
|
|
447
|
-
message: "
|
|
366
|
+
message: "Access denied. Check the publisher ID matches this extension's account, and that the extension ID is correct."
|
|
448
367
|
};
|
|
449
368
|
return {
|
|
450
369
|
ok: false,
|
|
@@ -932,10 +851,10 @@ GLOBAL
|
|
|
932
851
|
CHROME
|
|
933
852
|
--chrome-zip <path> Path to Chrome extension ZIP
|
|
934
853
|
--chrome-extension-id <id> Chrome extension ID
|
|
854
|
+
--chrome-publisher-id <uuid> Publisher UUID from the dev console (required)
|
|
935
855
|
--chrome-client-id <id> OAuth2 client ID
|
|
936
856
|
--chrome-client-secret <secret> OAuth2 client secret
|
|
937
857
|
--chrome-refresh-token <token> OAuth2 refresh token
|
|
938
|
-
--chrome-publish-target <target> "default" or "trustedTesters"
|
|
939
858
|
--chrome-deploy-percentage <n> Staged rollout percentage (1-100)
|
|
940
859
|
--chrome-review-exemption Request expedited review
|
|
941
860
|
--chrome-skip-submit-review Upload only, skip publish
|
|
@@ -1200,11 +1119,13 @@ async function collectChromeCredentials(deps) {
|
|
|
1200
1119
|
io.log(" 2. OAuth 2.0 credentials (application type: Desktop app):");
|
|
1201
1120
|
io.log(" https://console.cloud.google.com/apis/credentials");
|
|
1202
1121
|
io.log(" 3. Your extension ID from the Chrome Web Store Developer Dashboard.");
|
|
1122
|
+
io.log(" 4. Your publisher ID (the UUID in your dev console URL: chrome.google.com/webstore/devconsole/<UUID>).");
|
|
1203
1123
|
io.log("");
|
|
1204
1124
|
io.log("This wizard will take your Client ID + Secret and walk you through");
|
|
1205
1125
|
io.log("generating a refresh token automatically.");
|
|
1206
1126
|
io.log("");
|
|
1207
1127
|
const extensionId = await requireValue(io, "Chrome extension ID", "(32-character ID from the CWS dashboard URL)");
|
|
1128
|
+
const publisherId = await requireValue(io, "Chrome publisher ID", "(UUID from your dev console URL)");
|
|
1208
1129
|
const clientId = await requireValue(io, "OAuth Client ID");
|
|
1209
1130
|
const clientSecret = await requireValue(io, "OAuth Client Secret", void 0, {
|
|
1210
1131
|
secret: true
|
|
@@ -1212,6 +1133,7 @@ async function collectChromeCredentials(deps) {
|
|
|
1212
1133
|
const refreshToken = await obtainChromeRefreshToken(deps, clientId, clientSecret);
|
|
1213
1134
|
return {
|
|
1214
1135
|
extensionId,
|
|
1136
|
+
publisherId,
|
|
1215
1137
|
clientId,
|
|
1216
1138
|
clientSecret,
|
|
1217
1139
|
refreshToken
|
|
@@ -1343,7 +1265,7 @@ async function runInit(deps, options = {}) {
|
|
|
1343
1265
|
io.log("");
|
|
1344
1266
|
if ("chrome" === store) {
|
|
1345
1267
|
const creds = await collectChromeCredentials(deps);
|
|
1346
|
-
envLines.push(`CHROME_EXTENSION_ID=${creds.extensionId}`, `CHROME_CLIENT_ID=${creds.clientId}`, `CHROME_CLIENT_SECRET=${creds.clientSecret}`, `CHROME_REFRESH_TOKEN=${creds.refreshToken}`, "");
|
|
1268
|
+
envLines.push(`CHROME_EXTENSION_ID=${creds.extensionId}`, `CHROME_PUBLISHER_ID=${creds.publisherId}`, `CHROME_CLIENT_ID=${creds.clientId}`, `CHROME_CLIENT_SECRET=${creds.clientSecret}`, `CHROME_REFRESH_TOKEN=${creds.refreshToken}`, "");
|
|
1347
1269
|
if (!options.skipVerify) {
|
|
1348
1270
|
const verify = deps.verifyChrome ?? verifyChromeCredentials;
|
|
1349
1271
|
verified.chrome = normalizeVerify(await verify(creds));
|
|
@@ -1527,7 +1449,8 @@ async function runWatch(flags) {
|
|
|
1527
1449
|
clientId: mustEnv("CHROME_CLIENT_ID", flags.chromeClientId),
|
|
1528
1450
|
clientSecret: mustEnv("CHROME_CLIENT_SECRET", flags.chromeClientSecret),
|
|
1529
1451
|
refreshToken: mustEnv("CHROME_REFRESH_TOKEN", flags.chromeRefreshToken),
|
|
1530
|
-
extensionId: mustEnv("CHROME_EXTENSION_ID", flags.chromeExtensionId)
|
|
1452
|
+
extensionId: mustEnv("CHROME_EXTENSION_ID", flags.chromeExtensionId),
|
|
1453
|
+
publisherId: mustEnv("CHROME_PUBLISHER_ID", flags.chromePublisherId)
|
|
1531
1454
|
}, {
|
|
1532
1455
|
pollIntervalMs,
|
|
1533
1456
|
timeoutMs,
|
package/dist/src/chrome.d.ts
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
import type { ChromeOptions } from "./types";
|
|
2
|
-
export type ChromeApiVersion = "v1.1" | "v2";
|
|
3
|
-
/**
|
|
4
|
-
* Pick the Chrome Web Store API version. v2 needs the publisher UUID, so we use
|
|
5
|
-
* v2 whenever one is configured (or when explicitly forced), and otherwise stay
|
|
6
|
-
* on v1.1. This makes the migration opt-in per project: add a publisher ID to
|
|
7
|
-
* move to v2; everything else keeps working on v1.1 until the sunset.
|
|
8
|
-
*/
|
|
9
|
-
export declare function resolveChromeApiVersion(opts: {
|
|
10
|
-
publisherId?: string;
|
|
11
|
-
apiVersion?: ChromeApiVersion;
|
|
12
|
-
}): ChromeApiVersion;
|
|
13
2
|
/** Build the v2 resource name `publishers/{pub}/items/{id}`. */
|
|
14
3
|
export declare function v2ItemName(publisherId: string, extensionId: string): string;
|
|
15
4
|
export declare function chromeStoreUrl(extensionId: string): string;
|
|
@@ -46,16 +35,13 @@ export declare function getChromeItem(params: {
|
|
|
46
35
|
clientSecret: string;
|
|
47
36
|
refreshToken: string;
|
|
48
37
|
extensionId: string;
|
|
49
|
-
|
|
50
|
-
publisherId?: string;
|
|
51
|
-
apiVersion?: ChromeApiVersion;
|
|
38
|
+
publisherId: string;
|
|
52
39
|
}): Promise<ChromeItemStatus>;
|
|
53
40
|
export declare function verifyChromeCredentials(params: {
|
|
54
41
|
clientId: string;
|
|
55
42
|
clientSecret: string;
|
|
56
43
|
refreshToken: string;
|
|
57
44
|
extensionId: string;
|
|
58
|
-
publisherId
|
|
59
|
-
apiVersion?: ChromeApiVersion;
|
|
45
|
+
publisherId: string;
|
|
60
46
|
}): Promise<ChromeVerifyResult>;
|
|
61
47
|
//# sourceMappingURL=chrome.d.ts.map
|
package/dist/src/chrome.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chrome.d.ts","sourceRoot":"","sources":["../../src/chrome.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"chrome.d.ts","sourceRoot":"","sources":["../../src/chrome.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAoB7C,gEAAgE;AAChE,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAI3E;AAeD,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,OAAO,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AA+ED,MAAM,WAAW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;AAED,wBAAsB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"cli-commands.d.ts","sourceRoot":"","sources":["../../src/cli-commands.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAKzC,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAGxE;AAED,wBAAsB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAiFtE;AAmBD,wBAAsB,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB5E"}
|
package/dist/src/config.d.ts
CHANGED
|
@@ -8,12 +8,10 @@ export declare function validateConfig(raw: DeployConfig): {
|
|
|
8
8
|
clientId: string;
|
|
9
9
|
clientSecret: string;
|
|
10
10
|
refreshToken: string;
|
|
11
|
-
|
|
11
|
+
publisherId: string;
|
|
12
12
|
reviewExemption: boolean;
|
|
13
13
|
skipSubmitReview: boolean;
|
|
14
14
|
deployPercentage?: number | undefined;
|
|
15
|
-
publisherId?: string | undefined;
|
|
16
|
-
apiVersion?: "v1.1" | "v2" | undefined;
|
|
17
15
|
} | undefined;
|
|
18
16
|
firefox?: {
|
|
19
17
|
zip: string;
|
|
@@ -51,14 +49,11 @@ export interface CliFlags {
|
|
|
51
49
|
chromeClientId: string;
|
|
52
50
|
chromeClientSecret: string;
|
|
53
51
|
chromeRefreshToken: string;
|
|
54
|
-
|
|
52
|
+
/** Publisher UUID from the Chrome dev console (required by the v2 API). */
|
|
53
|
+
chromePublisherId: string;
|
|
55
54
|
chromeDeployPercentage: number;
|
|
56
55
|
chromeReviewExemption: boolean;
|
|
57
56
|
chromeSkipSubmitReview: boolean;
|
|
58
|
-
/** Publisher UUID from the Chrome dev console; presence selects the v2 API. */
|
|
59
|
-
chromePublisherId: string;
|
|
60
|
-
/** Force the Chrome API version ("v1.1" | "v2"); auto-selected otherwise. */
|
|
61
|
-
chromeApiVersion: string;
|
|
62
57
|
firefoxZip: string;
|
|
63
58
|
firefoxSourcesZip: string;
|
|
64
59
|
firefoxExtensionId: string;
|
package/dist/src/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAEhE,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAEhE,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,YAAY,CA8DpE;AAyCD,wBAAgB,cAAc,CAAC,GAAG,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB/C;AAiBD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,yEAAyE;IACzE,UAAU,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,OAAO,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IACrC,8CAA8C;IAC9C,UAAU,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;IAC1C,4EAA4E;IAC5E,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gDAAgD;IAChD,aAAa,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAi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d.ts","sourceRoot":"","sources":["../../src/init-chrome.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAQvC,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,QAAQ,GACb,OAAO,CAAC,iBAAiB,CAAC,CA8C5B;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAU3D;AAED,wBAAsB,sBAAsB,CAAC,KAAK,EAAE;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B,GAAG,OAAO,CAAC,MAAM,CAAC,CAiClB"}
|
package/dist/src/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/init.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAA2B,MAAM,UAAU,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAA4B,MAAM,WAAW,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAyB,MAAM,QAAQ,CAAC;AAMtE,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,EACxB,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,yBAAyB,EACzB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAE3E,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG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AO,CAAC,MAAM,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAC3D,KAAK,EAAE,OAAO,CAAC;CAChB;AAQD,wBAAsB,OAAO,CAC3B,IAAI,EAAE,QAAQ,EACd,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,UAAU,CAAC,CA0IrB"}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -6,36 +6,30 @@ export declare const chromeOptionsSchema: z.ZodObject<{
|
|
|
6
6
|
clientId: z.ZodString;
|
|
7
7
|
clientSecret: z.ZodString;
|
|
8
8
|
refreshToken: z.ZodString;
|
|
9
|
-
|
|
9
|
+
publisherId: z.ZodString;
|
|
10
10
|
deployPercentage: z.ZodOptional<z.ZodNumber>;
|
|
11
11
|
reviewExemption: z.ZodDefault<z.ZodBoolean>;
|
|
12
12
|
skipSubmitReview: z.ZodDefault<z.ZodBoolean>;
|
|
13
|
-
publisherId: z.ZodOptional<z.ZodString>;
|
|
14
|
-
apiVersion: z.ZodOptional<z.ZodEnum<["v1.1", "v2"]>>;
|
|
15
13
|
}, "strip", z.ZodTypeAny, {
|
|
16
14
|
zip: string;
|
|
17
15
|
extensionId: string;
|
|
18
16
|
clientId: string;
|
|
19
17
|
clientSecret: string;
|
|
20
18
|
refreshToken: string;
|
|
21
|
-
|
|
19
|
+
publisherId: string;
|
|
22
20
|
reviewExemption: boolean;
|
|
23
21
|
skipSubmitReview: boolean;
|
|
24
22
|
deployPercentage?: number | undefined;
|
|
25
|
-
publisherId?: string | undefined;
|
|
26
|
-
apiVersion?: "v1.1" | "v2" | undefined;
|
|
27
23
|
}, {
|
|
28
24
|
zip: string;
|
|
29
25
|
extensionId: string;
|
|
30
26
|
clientId: string;
|
|
31
27
|
clientSecret: string;
|
|
32
28
|
refreshToken: string;
|
|
33
|
-
|
|
29
|
+
publisherId: string;
|
|
34
30
|
deployPercentage?: number | undefined;
|
|
35
31
|
reviewExemption?: boolean | undefined;
|
|
36
32
|
skipSubmitReview?: boolean | undefined;
|
|
37
|
-
publisherId?: string | undefined;
|
|
38
|
-
apiVersion?: "v1.1" | "v2" | undefined;
|
|
39
33
|
}>;
|
|
40
34
|
export type ChromeOptions = z.infer<typeof chromeOptionsSchema>;
|
|
41
35
|
export declare const firefoxOptionsSchema: z.ZodEffects<z.ZodObject<{
|
|
@@ -103,36 +97,30 @@ export declare const deployConfigSchema: z.ZodObject<{
|
|
|
103
97
|
clientId: z.ZodString;
|
|
104
98
|
clientSecret: z.ZodString;
|
|
105
99
|
refreshToken: z.ZodString;
|
|
106
|
-
|
|
100
|
+
publisherId: z.ZodString;
|
|
107
101
|
deployPercentage: z.ZodOptional<z.ZodNumber>;
|
|
108
102
|
reviewExemption: z.ZodDefault<z.ZodBoolean>;
|
|
109
103
|
skipSubmitReview: z.ZodDefault<z.ZodBoolean>;
|
|
110
|
-
publisherId: z.ZodOptional<z.ZodString>;
|
|
111
|
-
apiVersion: z.ZodOptional<z.ZodEnum<["v1.1", "v2"]>>;
|
|
112
104
|
}, "strip", z.ZodTypeAny, {
|
|
113
105
|
zip: string;
|
|
114
106
|
extensionId: string;
|
|
115
107
|
clientId: string;
|
|
116
108
|
clientSecret: string;
|
|
117
109
|
refreshToken: string;
|
|
118
|
-
|
|
110
|
+
publisherId: string;
|
|
119
111
|
reviewExemption: boolean;
|
|
120
112
|
skipSubmitReview: boolean;
|
|
121
113
|
deployPercentage?: number | undefined;
|
|
122
|
-
publisherId?: string | undefined;
|
|
123
|
-
apiVersion?: "v1.1" | "v2" | undefined;
|
|
124
114
|
}, {
|
|
125
115
|
zip: string;
|
|
126
116
|
extensionId: string;
|
|
127
117
|
clientId: string;
|
|
128
118
|
clientSecret: string;
|
|
129
119
|
refreshToken: string;
|
|
130
|
-
|
|
120
|
+
publisherId: string;
|
|
131
121
|
deployPercentage?: number | undefined;
|
|
132
122
|
reviewExemption?: boolean | undefined;
|
|
133
123
|
skipSubmitReview?: boolean | undefined;
|
|
134
|
-
publisherId?: string | undefined;
|
|
135
|
-
apiVersion?: "v1.1" | "v2" | undefined;
|
|
136
124
|
}>>;
|
|
137
125
|
firefox: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
138
126
|
zip: z.ZodString;
|
|
@@ -197,12 +185,10 @@ export declare const deployConfigSchema: z.ZodObject<{
|
|
|
197
185
|
clientId: string;
|
|
198
186
|
clientSecret: string;
|
|
199
187
|
refreshToken: string;
|
|
200
|
-
|
|
188
|
+
publisherId: string;
|
|
201
189
|
reviewExemption: boolean;
|
|
202
190
|
skipSubmitReview: boolean;
|
|
203
191
|
deployPercentage?: number | undefined;
|
|
204
|
-
publisherId?: string | undefined;
|
|
205
|
-
apiVersion?: "v1.1" | "v2" | undefined;
|
|
206
192
|
} | undefined;
|
|
207
193
|
firefox?: {
|
|
208
194
|
zip: string;
|
|
@@ -226,12 +212,10 @@ export declare const deployConfigSchema: z.ZodObject<{
|
|
|
226
212
|
clientId: string;
|
|
227
213
|
clientSecret: string;
|
|
228
214
|
refreshToken: string;
|
|
229
|
-
|
|
215
|
+
publisherId: string;
|
|
230
216
|
deployPercentage?: number | undefined;
|
|
231
217
|
reviewExemption?: boolean | undefined;
|
|
232
218
|
skipSubmitReview?: boolean | undefined;
|
|
233
|
-
publisherId?: string | undefined;
|
|
234
|
-
apiVersion?: "v1.1" | "v2" | undefined;
|
|
235
219
|
} | undefined;
|
|
236
220
|
firefox?: {
|
|
237
221
|
zip: string;
|
package/dist/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAErD,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC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GACT,WAAW,GACX,YAAY,GACZ,WAAW,GACX,UAAU,GACV,QAAQ,CAAC;AAEb,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,QAAQ,CAAC;IAChB,MAAM,EAAE,WAAW,CAAC;IACpB,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC"}
|
package/dist/src/watch.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export interface ChromeWatchInput {
|
|
|
19
19
|
clientSecret: string;
|
|
20
20
|
refreshToken: string;
|
|
21
21
|
extensionId: string;
|
|
22
|
+
publisherId: string;
|
|
22
23
|
}
|
|
23
24
|
export declare function getChromeSubmissionEvent(input: ChromeWatchInput): Promise<WatchEvent>;
|
|
24
25
|
export declare function watchChromeSubmission(input: ChromeWatchInput, options?: WatchLoopOptions): Promise<WatchEvent>;
|
package/dist/src/watch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/watch.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAY,UAAU,EAAe,MAAM,SAAS,CAAC;AAajE,MAAM,WAAW,gBAAgB;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;CACvC;AAUD,MAAM,WAAW,gBAAgB;IAC/B,QA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