@better-update/cli 0.18.3 → 0.18.4

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/index.mjs CHANGED
@@ -32,7 +32,7 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
32
32
 
33
33
  //#endregion
34
34
  //#region package.json
35
- var version = "0.18.3";
35
+ var version = "0.18.4";
36
36
 
37
37
  //#endregion
38
38
  //#region src/lib/interactive-mode.ts
@@ -5126,6 +5126,17 @@ const setupIosViaAscKey = (api, input) => Effect.gen(function* () {
5126
5126
  //#region src/application/credentials-interactive.ts
5127
5127
  const hasTag = (cause) => typeof cause === "object" && cause !== null && "_tag" in cause;
5128
5128
  const isMissingResolveError = (cause) => hasTag(cause) && (cause._tag === "NotFound" || cause._tag === "BadRequest");
5129
+ const randomKeystoreSecret = () => randomBytes(24).toString("base64url");
5130
+ const generateKeystoreAuto = (api, applicationIdentifier) => Effect.gen(function* () {
5131
+ yield* Console.log("Generating a new Android Keystore...");
5132
+ return (yield* generateAndUploadKeystore(api, {
5133
+ keyAlias: "upload",
5134
+ storePassword: randomKeystoreSecret(),
5135
+ keyPassword: randomKeystoreSecret(),
5136
+ commonName: applicationIdentifier,
5137
+ organization: "better-update"
5138
+ })).id;
5139
+ });
5129
5140
  const generateKeystoreInteractive = (api) => Effect.gen(function* () {
5130
5141
  const alias = yield* promptText("Key alias", { placeholder: "upload-key" });
5131
5142
  const storePassword = yield* promptPassword("Keystore password");
@@ -5183,7 +5194,7 @@ const setupAndroidInteractive = (api, input) => Effect.gen(function* () {
5183
5194
  message: `Build aborted — no keystore bound to ${input.applicationIdentifier}.`,
5184
5195
  hint: "Run `better-update credentials generate keystore` or upload via the dashboard."
5185
5196
  }));
5186
- const keystoreId = yield* resolveAndroidKeystoreId(api, choice);
5197
+ const keystoreId = yield* choice === "generate" ? generateKeystoreAuto(api, input.applicationIdentifier) : pickExistingKeystore(api);
5187
5198
  yield* api.androidBuildCredentials.create({
5188
5199
  path: { applicationIdentifierId: appId },
5189
5200
  payload: {