@extension.dev/deploy 0.3.0 → 1.1.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/dist/module.mjs CHANGED
@@ -1,28 +1,35 @@
1
1
  import external_node_fs_default from "node:fs";
2
2
  import external_node_path_default from "node:path";
3
3
  import { z } from "zod";
4
+ import external_node_crypto_default from "node:crypto";
4
5
  import promises_default from "node:fs/promises";
5
6
  import external_pintor_default from "pintor";
6
- import external_node_crypto_default from "node:crypto";
7
7
  import external_node_readline_default from "node:readline";
8
8
  const chromeOptionsSchema = z.object({
9
9
  zip: z.string().min(1),
10
10
  extensionId: z.string().min(1).trim(),
11
- clientId: z.string().min(1).trim(),
12
- clientSecret: z.string().min(1).trim(),
13
- refreshToken: z.string().min(1).trim(),
14
- publishTarget: z["enum"]([
15
- "default",
16
- "trustedTesters"
17
- ]).default("default"),
11
+ serviceAccountJson: z.string().trim().default(""),
12
+ clientId: z.string().trim().default(""),
13
+ clientSecret: z.string().trim().default(""),
14
+ refreshToken: z.string().trim().default(""),
15
+ publisherId: z.string().min(1).trim(),
18
16
  deployPercentage: z.number().int().min(1).max(100).optional(),
19
17
  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()
18
+ skipSubmitReview: z.boolean().default(false)
19
+ }).superRefine((val, ctx)=>{
20
+ if (val.serviceAccountJson) return;
21
+ const missing = [
22
+ "clientId",
23
+ "clientSecret",
24
+ "refreshToken"
25
+ ].filter((k)=>!val[k]);
26
+ for (const key of missing)ctx.addIssue({
27
+ code: z.ZodIssueCode.custom,
28
+ path: [
29
+ key
30
+ ],
31
+ message: "Required unless a service account key is provided (CHROME_SERVICE_ACCOUNT_JSON)."
32
+ });
26
33
  });
27
34
  const firefoxOptionsSchema = z.object({
28
35
  zip: z.string().min(1),
@@ -66,15 +73,14 @@ function resolveConfig(flags) {
66
73
  chrome: null == chromeZip ? void 0 : {
67
74
  zip: chromeZip,
68
75
  extensionId: flags.chromeExtensionId ?? envStr("CHROME_EXTENSION_ID") ?? "",
76
+ serviceAccountJson: flags.chromeServiceAccountJson ?? envStr("CHROME_SERVICE_ACCOUNT_JSON") ?? "",
69
77
  clientId: flags.chromeClientId ?? envStr("CHROME_CLIENT_ID") ?? "",
70
78
  clientSecret: flags.chromeClientSecret ?? envStr("CHROME_CLIENT_SECRET") ?? "",
71
79
  refreshToken: flags.chromeRefreshToken ?? envStr("CHROME_REFRESH_TOKEN") ?? "",
72
- publishTarget: flags.chromePublishTarget ?? envStr("CHROME_PUBLISH_TARGET"),
80
+ publisherId: flags.chromePublisherId ?? envStr("CHROME_PUBLISHER_ID") ?? "",
73
81
  deployPercentage: flags.chromeDeployPercentage ?? envInt("CHROME_DEPLOY_PERCENTAGE"),
74
82
  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")
83
+ skipSubmitReview: flags.chromeSkipSubmitReview ?? envBool("CHROME_SKIP_SUBMIT_REVIEW")
78
84
  },
79
85
  firefox: null == firefoxZip ? void 0 : {
80
86
  zip: firefoxZip,
@@ -98,10 +104,11 @@ function pathToEnvName(segments) {
98
104
  }
99
105
  const SETUP_HINTS = {
100
106
  CHROME_EXTENSION_ID: "Find this in the Chrome Web Store Developer Dashboard URL for your extension.",
107
+ CHROME_SERVICE_ACCOUNT_JSON: "Optional alternative to OAuth: a Google Cloud service account JSON key (content or file path), added to your publisher under dev console > Account.",
101
108
  CHROME_CLIENT_ID: "Create OAuth 2.0 credentials at https://console.cloud.google.com/apis/credentials",
102
109
  CHROME_CLIENT_SECRET: "Generated alongside the Client ID in the Google Cloud Console.",
103
110
  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>). Required for the v2 API.",
111
+ CHROME_PUBLISHER_ID: "The publisher UUID from your Chrome Web Store dev console URL (chrome.google.com/webstore/devconsole/<UUID>).",
105
112
  CHROME_ZIP: "Path to the .zip file built for Chrome Web Store upload.",
106
113
  FIREFOX_EXTENSION_ID: "The addon GUID ({uuid} format) or email-style ID from your addon's AMO page.",
107
114
  FIREFOX_JWT_ISSUER: "API key from https://addons.mozilla.org/developers/addon/api/key/",
@@ -213,27 +220,64 @@ function logDryStep(scope, step, details) {
213
220
  const UPLOAD_TIMEOUT_MS = 120000;
214
221
  const PUBLISH_TIMEOUT_MS = 60000;
215
222
  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
223
  const CWS_V2_BASE = "https://chromewebstore.googleapis.com/v2";
220
224
  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
225
  function v2ItemName(publisherId, extensionId) {
226
226
  return `publishers/${encodeURIComponent(publisherId)}/items/${encodeURIComponent(extensionId)}`;
227
227
  }
228
228
  function requirePublisherId(publisherId, op) {
229
229
  const id = String(publisherId || "").trim();
230
- if (!id) throw new Error(`Chrome ${op} on the v2 API needs a publisher ID (the UUID from your Chrome Web Store dev console URL).`);
230
+ if (!id) throw new Error(`Chrome ${op} needs a publisher ID (the UUID from your Chrome Web Store dev console URL).`);
231
231
  return id;
232
232
  }
233
233
  function chromeStoreUrl(extensionId) {
234
234
  return `https://chromewebstore.google.com/detail/${extensionId}`;
235
235
  }
236
- async function authenticate(clientId, clientSecret, refreshToken) {
236
+ const CWS_SCOPE = "https://www.googleapis.com/auth/chromewebstore";
237
+ async function resolveServiceAccountKey(value) {
238
+ const trimmed = value.trim();
239
+ const raw = trimmed.startsWith("{") ? trimmed : await promises_default.readFile(trimmed, "utf-8").catch(()=>{
240
+ throw new Error(`Chrome service account key: "${trimmed.slice(0, 80)}" is neither JSON nor a readable file path.`);
241
+ });
242
+ let parsed;
243
+ try {
244
+ parsed = JSON.parse(raw);
245
+ } catch {
246
+ throw new Error("Chrome service account key is not valid JSON.");
247
+ }
248
+ if (!parsed.client_email || !parsed.private_key) throw new Error("Chrome service account key is missing client_email or private_key. Download the JSON key from the Google Cloud Console.");
249
+ return {
250
+ client_email: parsed.client_email,
251
+ private_key: parsed.private_key
252
+ };
253
+ }
254
+ async function authenticateServiceAccount(serviceAccountJson) {
255
+ const key = await resolveServiceAccountKey(serviceAccountJson);
256
+ const iat = Math.floor(Date.now() / 1000);
257
+ const encode = (obj)=>Buffer.from(JSON.stringify(obj)).toString("base64url");
258
+ const unsigned = `${encode({
259
+ alg: "RS256",
260
+ typ: "JWT"
261
+ })}.${encode({
262
+ iss: key.client_email,
263
+ scope: CWS_SCOPE,
264
+ aud: CWS_OAUTH_URL,
265
+ iat,
266
+ exp: iat + 3600
267
+ })}`;
268
+ const signature = external_node_crypto_default.createSign("RSA-SHA256").update(unsigned).sign(key.private_key).toString("base64url");
269
+ return fetchJson(CWS_OAUTH_URL, {
270
+ method: "POST",
271
+ body: new URLSearchParams({
272
+ grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer",
273
+ assertion: `${unsigned}.${signature}`
274
+ }).toString(),
275
+ headers: {
276
+ "Content-Type": "application/x-www-form-urlencoded"
277
+ }
278
+ });
279
+ }
280
+ async function authenticateOauth(clientId, clientSecret, refreshToken) {
237
281
  return fetchJson(CWS_OAUTH_URL, {
238
282
  method: "POST",
239
283
  body: JSON.stringify({
@@ -248,27 +292,21 @@ async function authenticate(clientId, clientSecret, refreshToken) {
248
292
  }
249
293
  });
250
294
  }
251
- async function chrome_upload(extensionId, zipPath, token, ctx) {
295
+ async function authenticate(creds) {
296
+ if (creds.serviceAccountJson) return authenticateServiceAccount(creds.serviceAccountJson);
297
+ if (creds.clientId && creds.clientSecret && creds.refreshToken) return authenticateOauth(creds.clientId, creds.clientSecret, creds.refreshToken);
298
+ throw new Error("Chrome credentials missing: provide a service account key (CHROME_SERVICE_ACCOUNT_JSON) or the OAuth client ID, client secret, and refresh token.");
299
+ }
300
+ async function chrome_upload(extensionId, publisherId, zipPath, token) {
252
301
  const body = await promises_default.readFile(zipPath);
253
- let url;
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
- }
302
+ const url = `${CWS_V2_UPLOAD_BASE}/${v2ItemName(publisherId, extensionId)}:upload`;
268
303
  const res = await fetch(url, {
269
- method,
304
+ method: "POST",
270
305
  body,
271
- headers,
306
+ headers: {
307
+ Authorization: `${token.token_type} ${token.access_token}`,
308
+ "Content-Type": "application/zip"
309
+ },
272
310
  signal: AbortSignal.timeout(UPLOAD_TIMEOUT_MS)
273
311
  });
274
312
  if (!res.ok) {
@@ -277,44 +315,22 @@ async function chrome_upload(extensionId, zipPath, token, ctx) {
277
315
  }
278
316
  }
279
317
  async function publish(params) {
280
- if ("v2" === params.apiVersion) {
281
- const pub = requirePublisherId(params.publisherId, "publish");
282
- if ("trustedTesters" === params.publishTarget) throw new Error("The Chrome v2 API has no trusted-tester publish target. Use staged publish, or keep this project on the v1.1 API for trusted-tester releases.");
283
- const reqBody = {
284
- publishType: "DEFAULT_PUBLISH"
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}`);
318
+ const reqBody = {
319
+ publishType: "DEFAULT_PUBLISH"
320
+ };
321
+ if (null != params.deployPercentage) reqBody.deployInfos = [
322
+ {
323
+ deployPercentage: params.deployPercentage
304
324
  }
305
- return;
306
- }
307
- const url = new URL(`${CWS_PUBLISH_BASE}/${params.extensionId}/publish`);
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, {
325
+ ];
326
+ if (params.reviewExemption) reqBody.skipReview = true;
327
+ const res = await fetch(`${CWS_V2_BASE}/${v2ItemName(params.publisherId, params.extensionId)}:publish`, {
312
328
  method: "POST",
313
329
  headers: {
314
330
  Authorization: `${params.token.token_type} ${params.token.access_token}`,
315
- "x-goog-api-version": "2",
316
- "Content-Length": "0"
331
+ "Content-Type": "application/json"
317
332
  },
333
+ body: JSON.stringify(reqBody),
318
334
  signal: AbortSignal.timeout(PUBLISH_TIMEOUT_MS)
319
335
  });
320
336
  if (!res.ok) {
@@ -325,9 +341,9 @@ async function publish(params) {
325
341
  async function publishChrome(options, dryRun) {
326
342
  await assertFilePresent(options.zip);
327
343
  const zipSize = await getFileSize(options.zip);
328
- const apiVersion = resolveChromeApiVersion(options);
329
- log("chrome", `Authenticating with Chrome Web Store (API ${apiVersion})`);
330
- const token = await authenticate(options.clientId, options.clientSecret, options.refreshToken);
344
+ const publisherId = requirePublisherId(options.publisherId, "submit");
345
+ log("chrome", `Authenticating with Chrome Web Store (API v2, ${options.serviceAccountJson ? "service account" : "OAuth"})`);
346
+ const token = await authenticate(options);
331
347
  const outcome = {
332
348
  storeUrl: chromeStoreUrl(options.extensionId),
333
349
  submissionId: options.extensionId
@@ -335,17 +351,13 @@ async function publishChrome(options, dryRun) {
335
351
  if (dryRun) {
336
352
  logDryStep("chrome", "Authentication succeeded", {
337
353
  tokenType: token.token_type,
338
- scope: "chromewebstore",
339
- apiVersion
354
+ scope: "chromewebstore"
340
355
  });
341
356
  logDryStep("chrome", "Would upload ZIP", {
342
357
  file: options.zip,
343
- size: formatBytes(zipSize),
344
- apiVersion
358
+ size: formatBytes(zipSize)
345
359
  });
346
360
  options.skipSubmitReview ? logDryStep("chrome", "Would skip publish (skipSubmitReview=true)") : logDryStep("chrome", "Would publish for review", {
347
- apiVersion,
348
- publishTarget: options.publishTarget ?? "default",
349
361
  deployPercentage: options.deployPercentage,
350
362
  reviewExemption: options.reviewExemption
351
363
  });
@@ -353,10 +365,7 @@ async function publishChrome(options, dryRun) {
353
365
  return outcome;
354
366
  }
355
367
  log("chrome", `Uploading ZIP file (${formatBytes(zipSize)})`);
356
- await chrome_upload(options.extensionId, options.zip, token, {
357
- apiVersion,
358
- publisherId: options.publisherId
359
- });
368
+ await chrome_upload(options.extensionId, publisherId, options.zip, token);
360
369
  if (options.skipSubmitReview) {
361
370
  log("chrome", "Skipping publish step (skipSubmitReview=true)");
362
371
  return outcome;
@@ -364,77 +373,54 @@ async function publishChrome(options, dryRun) {
364
373
  log("chrome", "Publishing extension");
365
374
  await publish({
366
375
  extensionId: options.extensionId,
367
- publishTarget: options.publishTarget,
376
+ publisherId,
368
377
  token,
369
378
  deployPercentage: options.deployPercentage,
370
- reviewExemption: options.reviewExemption,
371
- apiVersion,
372
- publisherId: options.publisherId
379
+ reviewExemption: options.reviewExemption
373
380
  });
374
381
  return outcome;
375
382
  }
376
383
  async function getChromeItem(params) {
377
- const token = await authenticate(params.clientId, params.clientSecret, params.refreshToken);
384
+ var _rev_distributionChannels_, _rev_distributionChannels;
385
+ const token = await authenticate(params);
378
386
  const auth = {
379
387
  Authorization: `${token.token_type} ${token.access_token}`
380
388
  };
381
- const version = resolveChromeApiVersion(params);
382
- if ("v2" === version) {
383
- var _rev_distributionChannels_, _rev_distributionChannels;
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
- }
389
+ const pub = requirePublisherId(params.publisherId, "status");
390
+ const status = await fetchJson(`${CWS_V2_BASE}/${v2ItemName(pub, params.extensionId)}:fetchStatus`, {
391
+ headers: auth
402
392
  });
393
+ const rev = status.submittedItemRevisionStatus || status.publishedItemRevisionStatus;
394
+ return {
395
+ uploadState: status.lastAsyncUploadState,
396
+ crxVersion: null == rev ? void 0 : null == (_rev_distributionChannels = rev.distributionChannels) ? void 0 : null == (_rev_distributionChannels_ = _rev_distributionChannels[0]) ? void 0 : _rev_distributionChannels_.crxVersion,
397
+ publicKey: status.publicKey,
398
+ state: null == rev ? void 0 : rev.state
399
+ };
403
400
  }
404
401
  async function verifyChromeCredentials(params) {
405
402
  let token;
406
403
  try {
407
- token = await authenticate(params.clientId, params.clientSecret, params.refreshToken);
404
+ token = await authenticate(params);
408
405
  } catch (err) {
406
+ const detail = err instanceof Error ? err.message : String(err);
409
407
  return {
410
408
  ok: false,
411
- message: `OAuth token exchange failed. Verify your Client ID, Client Secret, and Refresh Token are correct.\n${err instanceof Error ? err.message : err}`
409
+ message: params.serviceAccountJson ? `Service account token exchange failed. Verify the JSON key is intact and the account was added to your publisher (dev console > Account).\n${detail}` : `OAuth token exchange failed. Verify your Client ID, Client Secret, and Refresh Token are correct.\n${detail}`
412
410
  };
413
411
  }
414
412
  const auth = {
415
413
  Authorization: `${token.token_type} ${token.access_token}`
416
414
  };
417
- const version = resolveChromeApiVersion(params);
418
415
  try {
419
- if ("v2" === version) {
420
- const pub = requirePublisherId(params.publisherId, "verify");
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`, {
416
+ const pub = requirePublisherId(params.publisherId, "verify");
417
+ const status = await fetchJson(`${CWS_V2_BASE}/${v2ItemName(pub, params.extensionId)}:fetchStatus`, {
431
418
  headers: auth
432
419
  });
433
- const title = (null == item ? void 0 : item.title) || params.extensionId;
420
+ const rev = status.submittedItemRevisionStatus || status.publishedItemRevisionStatus;
434
421
  return {
435
422
  ok: true,
436
- message: `Credentials verified. You have access to "${title}".`,
437
- extensionTitle: title
423
+ message: `Credentials verified (Chrome Web Store API v2). Item state: ${(null == rev ? void 0 : rev.state) || "unknown"}.`
438
424
  };
439
425
  } catch (err) {
440
426
  const msg = err instanceof Error ? err.message : String(err);
@@ -444,7 +430,7 @@ async function verifyChromeCredentials(params) {
444
430
  };
445
431
  if (msg.includes("403")) return {
446
432
  ok: false,
447
- message: "v2" === version ? "Access denied. Check the publisher ID matches this extension's account, and that the extension ID is correct." : `Access denied to extension ${params.extensionId}. You may not be the owner or a developer on this item.`
433
+ message: params.serviceAccountJson ? "Access denied. Check the publisher ID, and that this service account's email was added to the publisher (dev console > Account)." : "Access denied. Check the publisher ID matches this extension's account, and that the extension ID is correct."
448
434
  };
449
435
  return {
450
436
  ok: false,
@@ -932,10 +918,12 @@ GLOBAL
932
918
  CHROME
933
919
  --chrome-zip <path> Path to Chrome extension ZIP
934
920
  --chrome-extension-id <id> Chrome extension ID
921
+ --chrome-publisher-id <uuid> Publisher UUID from the dev console (required)
922
+ --chrome-service-account-json <v> Service account JSON key content or file path
923
+ (alternative to the OAuth flags below)
935
924
  --chrome-client-id <id> OAuth2 client ID
936
925
  --chrome-client-secret <secret> OAuth2 client secret
937
926
  --chrome-refresh-token <token> OAuth2 refresh token
938
- --chrome-publish-target <target> "default" or "trustedTesters"
939
927
  --chrome-deploy-percentage <n> Staged rollout percentage (1-100)
940
928
  --chrome-review-exemption Request expedited review
941
929
  --chrome-skip-submit-review Upload only, skip publish
@@ -1200,11 +1188,13 @@ async function collectChromeCredentials(deps) {
1200
1188
  io.log(" 2. OAuth 2.0 credentials (application type: Desktop app):");
1201
1189
  io.log(" https://console.cloud.google.com/apis/credentials");
1202
1190
  io.log(" 3. Your extension ID from the Chrome Web Store Developer Dashboard.");
1191
+ io.log(" 4. Your publisher ID (the UUID in your dev console URL: chrome.google.com/webstore/devconsole/<UUID>).");
1203
1192
  io.log("");
1204
1193
  io.log("This wizard will take your Client ID + Secret and walk you through");
1205
1194
  io.log("generating a refresh token automatically.");
1206
1195
  io.log("");
1207
1196
  const extensionId = await requireValue(io, "Chrome extension ID", "(32-character ID from the CWS dashboard URL)");
1197
+ const publisherId = await requireValue(io, "Chrome publisher ID", "(UUID from your dev console URL)");
1208
1198
  const clientId = await requireValue(io, "OAuth Client ID");
1209
1199
  const clientSecret = await requireValue(io, "OAuth Client Secret", void 0, {
1210
1200
  secret: true
@@ -1212,6 +1202,7 @@ async function collectChromeCredentials(deps) {
1212
1202
  const refreshToken = await obtainChromeRefreshToken(deps, clientId, clientSecret);
1213
1203
  return {
1214
1204
  extensionId,
1205
+ publisherId,
1215
1206
  clientId,
1216
1207
  clientSecret,
1217
1208
  refreshToken
@@ -1343,7 +1334,7 @@ async function runInit(deps, options = {}) {
1343
1334
  io.log("");
1344
1335
  if ("chrome" === store) {
1345
1336
  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}`, "");
1337
+ 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
1338
  if (!options.skipVerify) {
1348
1339
  const verify = deps.verifyChrome ?? verifyChromeCredentials;
1349
1340
  verified.chrome = normalizeVerify(await verify(creds));
@@ -1523,16 +1514,21 @@ async function runWatch(flags) {
1523
1514
  const timeoutMs = (flags.watchTimeout ?? 3600) * 1000;
1524
1515
  let terminal;
1525
1516
  try {
1526
- terminal = "chrome" === store ? await watchChromeSubmission({
1527
- clientId: mustEnv("CHROME_CLIENT_ID", flags.chromeClientId),
1528
- clientSecret: mustEnv("CHROME_CLIENT_SECRET", flags.chromeClientSecret),
1529
- refreshToken: mustEnv("CHROME_REFRESH_TOKEN", flags.chromeRefreshToken),
1530
- extensionId: mustEnv("CHROME_EXTENSION_ID", flags.chromeExtensionId)
1531
- }, {
1532
- pollIntervalMs,
1533
- timeoutMs,
1534
- onEvent
1535
- }) : "firefox" === store ? await watchFirefoxSubmission({
1517
+ if ("chrome" === store) {
1518
+ const serviceAccountJson = flags.chromeServiceAccountJson ?? process.env.CHROME_SERVICE_ACCOUNT_JSON;
1519
+ terminal = await watchChromeSubmission({
1520
+ serviceAccountJson,
1521
+ clientId: serviceAccountJson ? flags.chromeClientId : mustEnv("CHROME_CLIENT_ID", flags.chromeClientId),
1522
+ clientSecret: serviceAccountJson ? flags.chromeClientSecret : mustEnv("CHROME_CLIENT_SECRET", flags.chromeClientSecret),
1523
+ refreshToken: serviceAccountJson ? flags.chromeRefreshToken : mustEnv("CHROME_REFRESH_TOKEN", flags.chromeRefreshToken),
1524
+ extensionId: mustEnv("CHROME_EXTENSION_ID", flags.chromeExtensionId),
1525
+ publisherId: mustEnv("CHROME_PUBLISHER_ID", flags.chromePublisherId)
1526
+ }, {
1527
+ pollIntervalMs,
1528
+ timeoutMs,
1529
+ onEvent
1530
+ });
1531
+ } else terminal = "firefox" === store ? await watchFirefoxSubmission({
1536
1532
  jwtIssuer: mustEnv("FIREFOX_JWT_ISSUER", flags.firefoxJwtIssuer),
1537
1533
  jwtSecret: mustEnv("FIREFOX_JWT_SECRET", flags.firefoxJwtSecret),
1538
1534
  extensionId: mustEnv("FIREFOX_EXTENSION_ID", flags.firefoxExtensionId),
@@ -1,23 +1,13 @@
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;
16
5
  export interface CwsAccessToken {
17
6
  access_token: string;
18
7
  expires_in: number;
19
- refresh_token: string;
20
- scope: string;
8
+ /** Absent for service-account (JWT bearer) grants. */
9
+ refresh_token?: string;
10
+ scope?: string;
21
11
  token_type: string;
22
12
  }
23
13
  export interface ChromeVerifyResult {
@@ -25,6 +15,14 @@ export interface ChromeVerifyResult {
25
15
  message: string;
26
16
  extensionTitle?: string;
27
17
  }
18
+ /** Credential fields shared by every Chrome API entry point. */
19
+ export interface ChromeCredentials {
20
+ serviceAccountJson?: string;
21
+ clientId?: string;
22
+ clientSecret?: string;
23
+ refreshToken?: string;
24
+ }
25
+ export declare function authenticate(creds: ChromeCredentials): Promise<CwsAccessToken>;
28
26
  export interface ChromePublishOutcome {
29
27
  storeUrl: string;
30
28
  submissionId: string;
@@ -41,21 +39,12 @@ export interface ChromeItemStatus {
41
39
  /** v2 review state (PENDING_REVIEW | STAGED | PUBLISHED | REJECTED | ...). */
42
40
  state?: string;
43
41
  }
44
- export declare function getChromeItem(params: {
45
- clientId: string;
46
- clientSecret: string;
47
- refreshToken: string;
42
+ export declare function getChromeItem(params: ChromeCredentials & {
48
43
  extensionId: string;
49
- projection?: "DRAFT" | "PUBLISHED";
50
- publisherId?: string;
51
- apiVersion?: ChromeApiVersion;
44
+ publisherId: string;
52
45
  }): Promise<ChromeItemStatus>;
53
- export declare function verifyChromeCredentials(params: {
54
- clientId: string;
55
- clientSecret: string;
56
- refreshToken: string;
46
+ export declare function verifyChromeCredentials(params: ChromeCredentials & {
57
47
  extensionId: string;
58
- publisherId?: string;
59
- apiVersion?: ChromeApiVersion;
48
+ publisherId: string;
60
49
  }): Promise<ChromeVerifyResult>;
61
50
  //# sourceMappingURL=chrome.d.ts.map
@@ -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;AAwB7C,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAAC;AAE7C;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B,GAAG,gBAAgB,CAKnB;AAED,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;AA8HD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAsB,aAAa,CACjC,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,OAAO,GACd,OAAO,CAAC,oBAAoB,CAAC,CAiE/B;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,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W,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB,GACA,OAAO,CAAC,kBAAkB,CAAC,CAkD7B"}
@@ -1 +1 @@
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,CAgFtE;AAmBD,wBAAsB,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB5E"}
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,CAqFtE;AAmBD,wBAAsB,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB5E"}
@@ -1 +1 @@
1
- {"version":3,"file":"cli-usage.d.ts","sourceRoot":"","sources":["../../src/cli-usage.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,IAAI,MAAM,CA0D9B"}
1
+ {"version":3,"file":"cli-usage.d.ts","sourceRoot":"","sources":["../../src/cli-usage.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,IAAI,MAAM,CA4D9B"}
@@ -5,15 +5,14 @@ export declare function validateConfig(raw: DeployConfig): {
5
5
  chrome?: {
6
6
  zip: string;
7
7
  extensionId: string;
8
+ serviceAccountJson: string;
8
9
  clientId: string;
9
10
  clientSecret: string;
10
11
  refreshToken: string;
11
- publishTarget: "default" | "trustedTesters";
12
+ publisherId: string;
12
13
  reviewExemption: boolean;
13
14
  skipSubmitReview: boolean;
14
15
  deployPercentage?: number | undefined;
15
- publisherId?: string | undefined;
16
- apiVersion?: "v1.1" | "v2" | undefined;
17
16
  } | undefined;
18
17
  firefox?: {
19
18
  zip: string;
@@ -48,17 +47,16 @@ export interface CliFlags {
48
47
  watchTimeout: number;
49
48
  chromeZip: string;
50
49
  chromeExtensionId: string;
50
+ /** Service account JSON key content or file path (alternative to OAuth). */
51
+ chromeServiceAccountJson: string;
51
52
  chromeClientId: string;
52
53
  chromeClientSecret: string;
53
54
  chromeRefreshToken: string;
54
- chromePublishTarget: string;
55
+ /** Publisher UUID from the Chrome dev console (required by the v2 API). */
56
+ chromePublisherId: string;
55
57
  chromeDeployPercentage: number;
56
58
  chromeReviewExemption: boolean;
57
59
  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
60
  firefoxZip: string;
63
61
  firefoxSourcesZip: string;
64
62
  firefoxExtensionId: string;
@@ -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,CAqEpE;AAyCD,wBAAgB,cAAc,CAAC,GAAG,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB/C;AAiBD,MAAM,WAAW,QAAQ;IACvB,I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C;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,mFAAmF;IACnF,UAAU,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,cAAc,EAAE,OAAO,CAAC;IACxB,2DAA2D;IAC3D,SAAS,EAAE,OAAO,CAAC;CACpB"}
@@ -1,6 +1,7 @@
1
1
  import type { InitDeps } from "./init";
2
2
  export interface ChromeCredentials {
3
3
  extensionId: string;
4
+ publisherId: string;
4
5
  clientId: string;
5
6
  clientSecret: string;
6
7
  refreshToken: string;
@@ -1 +1 @@
1
- {"version":3,"file":"init-chrome.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,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,CAsC5B;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"}
1
+ {"version":3,"file":"init-chrome.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"}
@@ -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,Q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