prisma 8.0.0-rc.27 → 8.0.0-rc.27-dev.167

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/prisma.js CHANGED
@@ -11504,6 +11504,9 @@ function formatDomainFailureFix(domain) {
11504
11504
  }
11505
11505
  //#endregion
11506
11506
  //#region ../cli/src/commands/service/errors.ts
11507
+ function domainRecoveryCommand(command, hostname, target) {
11508
+ return `service domain ${command} ${formatCommandArgument(hostname)} --service ${formatCommandArgument(target.service.id)} --project ${formatCommandArgument(target.project.id)} --branch ${formatCommandArgument(target.branch.name)}`;
11509
+ }
11507
11510
  function runCommandAction(label, command) {
11508
11511
  return {
11509
11512
  kind: "run-command",
@@ -11634,22 +11637,16 @@ function liveUrlUnavailableError(serviceName) {
11634
11637
  nextActions: [runCommandAction("Inspect the service state", `service show ${serviceName}`)]
11635
11638
  });
11636
11639
  }
11637
- function branchNotDeployableError(branchName) {
11638
- return new CliStructuredError("SERVICE.BRANCH_NOT_DEPLOYABLE", "Custom domains require the production branch", {
11639
- why: `Custom domains on preview branch "${branchName}" are not supported in Public Beta.`,
11640
- nextActions: [adviceAction("Use --branch production, or attach the domain after promoting/deploying to the production branch."), runCommandAction("Add on production", "service domain add <hostname> --service <name> --branch production")]
11641
- });
11642
- }
11643
- function domainHostnameInvalidError(hostname, why) {
11640
+ function domainHostnameInvalidError(hostname, branchName) {
11644
11641
  return new CliStructuredError("SERVICE.DOMAIN_HOSTNAME_INVALID", `Invalid custom domain "${hostname}"`, {
11645
- why: why ?? "Custom domains must be valid hostnames without protocol, path, wildcard, or port.",
11646
- nextActions: [adviceAction("Pass a hostname like shop.acme.com."), runCommandAction("Add a domain", "service domain add shop.acme.com --service <name>")]
11642
+ why: "Custom domains must be valid hostnames without protocol, path, wildcard, or port.",
11643
+ nextActions: [adviceAction("Pass a hostname like shop.acme.com."), runCommandAction("Add a domain", `service domain add shop.acme.com --service <name>${branchName === void 0 ? "" : ` --branch ${formatCommandArgument(branchName)}`}`)]
11647
11644
  });
11648
11645
  }
11649
- function domainNotFoundError(hostname) {
11646
+ function domainNotFoundError(hostname, target) {
11650
11647
  return new CliStructuredError("SERVICE.DOMAIN_NOT_FOUND", `Custom domain "${hostname}" not found`, {
11651
11648
  why: "The hostname is not attached to the service.",
11652
- nextActions: [adviceAction("Check the hostname and the service, or add the domain first."), runCommandAction("Add the domain", `service domain add ${hostname} --service <name>`)]
11649
+ nextActions: [adviceAction("Check the hostname and the service, or add the domain first."), runCommandAction("Add the domain", domainRecoveryCommand("add", hostname, target))]
11653
11650
  });
11654
11651
  }
11655
11652
  function formatDomainFailureWhy(domain) {
@@ -11657,28 +11654,28 @@ function formatDomainFailureWhy(domain) {
11657
11654
  if (!domain.failureCategory) return domain.failureReason;
11658
11655
  return `${domain.failureCategory}: ${domain.failureReason}`;
11659
11656
  }
11660
- function domainVerificationFailedError(hostname, domain) {
11657
+ function domainVerificationFailedError(hostname, domain, target) {
11661
11658
  const why = formatDomainFailureWhy(domain);
11662
11659
  const guidance = formatDomainFailureFix(domain);
11663
11660
  return new CliStructuredError("SERVICE.DOMAIN_VERIFICATION_FAILED", `Custom domain "${hostname}" failed verification`, {
11664
11661
  why,
11665
11662
  nextActions: [
11666
11663
  ...guidance ? [adviceAction(guidance)] : [],
11667
- runCommandAction("Show the domain", `service domain show ${hostname} --service <name>`),
11668
- runCommandAction("Retry verification", `service domain retry ${hostname} --service <name>`)
11664
+ runCommandAction("Show the domain", domainRecoveryCommand("show", hostname, target)),
11665
+ runCommandAction("Retry verification", domainRecoveryCommand("retry", hostname, target))
11669
11666
  ]
11670
11667
  });
11671
11668
  }
11672
- function domainVerificationTimeoutError(hostname, lastStatus) {
11669
+ function domainVerificationTimeoutError(hostname, lastStatus, target) {
11673
11670
  return new CliStructuredError("SERVICE.DOMAIN_VERIFICATION_TIMEOUT", `Timed out waiting for "${hostname}" to become active`, {
11674
11671
  why: `The domain is still "${lastStatus}".`,
11675
- nextActions: [runCommandAction("Show the domain", `service domain show ${hostname} --service <name>`), adviceAction("Retry wait with a longer --timeout.")]
11672
+ nextActions: [runCommandAction("Show the domain", domainRecoveryCommand("show", hostname, target)), adviceAction("Retry wait with a longer --timeout.")]
11676
11673
  });
11677
11674
  }
11678
- function timeoutInvalidError(value) {
11675
+ function timeoutInvalidError(value, branchName) {
11679
11676
  return new CliStructuredError("SERVICE.TIMEOUT_INVALID", `Invalid timeout "${value}"`, {
11680
11677
  why: "Timeout must be a duration such as 0, 30s, 15m, or 1h.",
11681
- nextActions: [runCommandAction("Wait with a valid timeout", "service domain wait shop.acme.com --service <name> --timeout 15m")]
11678
+ nextActions: [runCommandAction("Wait with a valid timeout", `service domain wait shop.acme.com --service <name> --timeout 15m${branchName === void 0 ? "" : ` --branch ${formatCommandArgument(branchName)}`}`)]
11682
11679
  });
11683
11680
  }
11684
11681
  function debugMeta(error) {
@@ -11689,44 +11686,56 @@ function debugMeta(error) {
11689
11686
  };
11690
11687
  return {};
11691
11688
  }
11692
- function domainCommandError(command, error, hostname) {
11689
+ function domainCommandError(command, error, hostname, target) {
11693
11690
  if (error instanceof DomainApiError) {
11694
- const known = domainApiFailure(command, error, hostname);
11691
+ const known = domainApiFailure(command, error, hostname, target);
11695
11692
  if (known) return known;
11696
11693
  }
11697
11694
  return new CliStructuredError("SERVICE.DEPLOY_FAILED", `Custom domain ${command} failed`, {
11698
11695
  why: error instanceof Error ? error.message : String(error),
11699
11696
  meta: debugMeta(error),
11700
- nextActions: [runCommandAction("Show the domain", `service domain show ${hostname} --service <name>`)],
11697
+ nextActions: [runCommandAction("Show the domain", domainRecoveryCommand("show", hostname, target))],
11701
11698
  cause: error
11702
11699
  });
11703
11700
  }
11704
- function domainApiFailure(command, error, hostname) {
11705
- if (command === "add") return domainAddFailure(error, hostname);
11706
- if (error.status === 404) return domainNotFoundError(hostname);
11707
- if (command === "retry" && error.status === 409) return domainRetryNotEligibleError(hostname, error);
11701
+ function domainApiFailure(command, error, hostname, target) {
11702
+ if (command === "add") return domainAddFailure(error, hostname, target);
11703
+ if (error.status === 404) return domainNotFoundError(hostname, target);
11704
+ if (command === "retry" && error.status === 409) return domainRetryNotEligibleError(hostname, error, target);
11708
11705
  return null;
11709
11706
  }
11710
- function domainAddFailure(error, hostname) {
11711
- if ((error.status === 400 || error.status === 422) && isDomainDnsError(error)) return domainDnsNotConfiguredError(hostname, error);
11712
- if (error.status === 400) return domainHostnameRejectedError(hostname, error);
11713
- if (error.status === 429 || isDomainQuotaError(error)) return domainQuotaExceededError(error);
11707
+ function domainAddFailure(error, hostname, target) {
11708
+ if (error.code === "domain-cloudflare-proxy") return new CliStructuredError("SERVICE.DOMAIN_CLOUDFLARE_PROXY", `Turn off Cloudflare's proxy to connect ${hostname}`, {
11709
+ why: error.message,
11710
+ meta: debugMeta(error),
11711
+ nextActions: [adviceAction(error.hint ?? "Set this DNS record to DNS only (gray cloud), then retry. After the domain is Active, you can turn Proxied back on with Full (strict) SSL/TLS. Keep /.well-known/acme-challenge/* accessible for certificate renewal."), runCommandAction("Verify and connect", domainRecoveryCommand("add", hostname, target))],
11712
+ cause: error
11713
+ });
11714
+ if (error.code === "domain-ownership-required") return new CliStructuredError("SERVICE.DOMAIN_OWNERSHIP_REQUIRED", `Verify ownership of ${hostname}`, {
11715
+ why: "DNS does not contain the TXT proof for this workspace.",
11716
+ meta: debugMeta(error),
11717
+ nextActions: [adviceAction(error.hint ?? "Add the workspace TXT record shown in Console's domain setup."), runCommandAction("Verify and connect", domainRecoveryCommand("add", hostname, target))],
11718
+ cause: error
11719
+ });
11720
+ if ((error.status === 400 || error.status === 422) && isDomainDnsError(error)) return domainDnsNotConfiguredError(hostname, error, target);
11721
+ if (error.status === 400) return domainHostnameRejectedError(hostname, error, target);
11722
+ if (error.status === 429 || isDomainQuotaError(error)) return domainQuotaExceededError(error, target);
11714
11723
  if (error.status === 409) return domainAlreadyRegisteredError(hostname, error);
11715
- if (error.status === 422) return domainRequiresDeploymentError(hostname, error);
11724
+ if (error.status === 422) return domainRequiresDeploymentError(hostname, error, target);
11716
11725
  return null;
11717
11726
  }
11718
- function domainHostnameRejectedError(hostname, error) {
11727
+ function domainHostnameRejectedError(hostname, error, target) {
11719
11728
  return new CliStructuredError("SERVICE.DOMAIN_HOSTNAME_INVALID", `Invalid custom domain "${hostname}"`, {
11720
11729
  why: error.message,
11721
11730
  meta: debugMeta(error),
11722
- nextActions: [adviceAction("Pass a valid hostname like shop.acme.com and make sure DNS can be verified."), runCommandAction("Add a domain", "service domain add shop.acme.com --service <name>")]
11731
+ nextActions: [adviceAction("Pass a valid hostname like shop.acme.com and make sure DNS can be verified."), runCommandAction("Add a domain", domainRecoveryCommand("add", hostname, target))]
11723
11732
  });
11724
11733
  }
11725
- function domainQuotaExceededError(error) {
11734
+ function domainQuotaExceededError(error, target) {
11726
11735
  return new CliStructuredError("SERVICE.DOMAIN_QUOTA_EXCEEDED", "Custom domain quota exceeded", {
11727
11736
  why: error.message,
11728
11737
  meta: debugMeta(error),
11729
- nextActions: [adviceAction("Delete an existing custom domain before adding another one."), runCommandAction("Delete a domain", "service domain delete <hostname> --service <name>")]
11738
+ nextActions: error.hint ? [adviceAction(error.hint)] : [adviceAction("Delete an existing custom domain before adding another one."), runCommandAction("Delete a domain", domainRecoveryCommand("delete", "<hostname>", target))]
11730
11739
  });
11731
11740
  }
11732
11741
  function domainAlreadyRegisteredError(hostname, error) {
@@ -11736,18 +11745,18 @@ function domainAlreadyRegisteredError(hostname, error) {
11736
11745
  nextActions: [adviceAction("Select the service that owns this hostname and delete it there, or contact Prisma support if you cannot access it.")]
11737
11746
  });
11738
11747
  }
11739
- function domainRequiresDeploymentError(hostname, error) {
11740
- return new CliStructuredError("SERVICE.NO_VERSIONS", "Custom domain requires a live production version", {
11741
- why: "The selected production service does not have a promoted version that can receive a custom domain.",
11748
+ function domainRequiresDeploymentError(hostname, error, target) {
11749
+ return new CliStructuredError("SERVICE.NO_VERSIONS", "Custom domain requires a live version", {
11750
+ why: "The selected service does not have a promoted version that can receive a custom domain.",
11742
11751
  meta: debugMeta(error),
11743
- nextActions: [adviceAction("Promote a version on the service's production branch, then add the domain again."), runCommandAction("Add the domain", `service domain add ${hostname} --service <name>`)]
11752
+ nextActions: [adviceAction("Promote a version on the selected branch, then add the domain again."), runCommandAction("Add the domain", domainRecoveryCommand("add", hostname, target))]
11744
11753
  });
11745
11754
  }
11746
- function domainRetryNotEligibleError(hostname, error) {
11755
+ function domainRetryNotEligibleError(hostname, error, target) {
11747
11756
  return new CliStructuredError("SERVICE.DOMAIN_RETRY_NOT_ELIGIBLE", `Custom domain "${hostname}" is not eligible for retry`, {
11748
11757
  why: error.message,
11749
11758
  meta: debugMeta(error),
11750
- nextActions: [adviceAction("Wait for the current verification or TLS step to finish, then rerun retry if the domain fails."), runCommandAction("Show the domain", `service domain show ${hostname} --service <name>`)]
11759
+ nextActions: [adviceAction("Wait for the current verification or TLS step to finish, then rerun retry if the domain fails."), runCommandAction("Show the domain", domainRecoveryCommand("show", hostname, target))]
11751
11760
  });
11752
11761
  }
11753
11762
  function isDomainQuotaError(error) {
@@ -11759,16 +11768,16 @@ function isDomainDnsError(error) {
11759
11768
  const text = `${error.message} ${error.hint ?? ""}`.toLowerCase();
11760
11769
  return text.includes("dns is not configured") || text.includes("dns verification failed") || text.includes("no cname") || text.includes("cname record") || text.includes("no a/aaaa") || CNAME_HINT.test(text);
11761
11770
  }
11762
- function domainDnsNotConfiguredError(hostname, error) {
11763
- const target = extractDomainDnsTarget(error);
11764
- const record = target ? `CNAME ${hostname} -> ${target}` : null;
11771
+ function domainDnsNotConfiguredError(hostname, error, target) {
11772
+ const dnsTarget = extractDomainDnsTarget(error);
11773
+ const record = dnsTarget ? `CNAME ${hostname} -> ${dnsTarget}` : null;
11765
11774
  return new CliStructuredError("SERVICE.DOMAIN_DNS_NOT_CONFIGURED", `DNS is not configured for "${hostname}"`, {
11766
11775
  why: error.hint ?? error.message,
11767
11776
  meta: {
11768
11777
  ...debugMeta(error),
11769
11778
  ...record ? { dnsRecord: record } : {}
11770
11779
  },
11771
- nextActions: record ? [adviceAction(`Add ${record} at your DNS provider, then rerun the domain command.`), runCommandAction("Add the domain", `service domain add ${hostname} --service <name>`)] : [adviceAction("The platform did not return the required DNS target. Re-run with --log-level verbose for the underlying API response details.")]
11780
+ nextActions: record ? [adviceAction(`Add ${record} at your DNS provider, then rerun the domain command.`), runCommandAction("Add the domain", domainRecoveryCommand("add", hostname, target))] : [adviceAction("The platform did not return the required DNS target. Re-run with --log-level verbose for the underlying API response details.")]
11772
11781
  });
11773
11782
  }
11774
11783
  function extractDomainDnsTarget(error) {
@@ -12621,9 +12630,9 @@ function toServiceDomainSummary(domain) {
12621
12630
  }))
12622
12631
  };
12623
12632
  }
12624
- function normalizeDomainHostname(hostname) {
12633
+ function normalizeDomainHostname(hostname, branchName) {
12625
12634
  const normalized = hostname.trim().replace(TRAILING_DOT, "").toLowerCase();
12626
- if (!isValidDomainHostname(normalized)) throw domainHostnameInvalidError(hostname);
12635
+ if (!isValidDomainHostname(normalized)) throw domainHostnameInvalidError(hostname, branchName);
12627
12636
  return normalized;
12628
12637
  }
12629
12638
  function isValidDomainHostname(hostname) {
@@ -12636,12 +12645,12 @@ function isValidDomainHostname(hostname) {
12636
12645
  function sameDomainHostname(left, right) {
12637
12646
  return left.trim().replace(TRAILING_DOT, "").toLowerCase() === right.trim().replace(TRAILING_DOT, "").toLowerCase();
12638
12647
  }
12639
- async function resolveDomainByHostname(provider, serviceId, hostname, command, signal) {
12640
- const matched = (await provider.listDomains(serviceId, { signal }).catch((error) => {
12641
- throw domainCommandError(command, error, hostname);
12648
+ async function resolveDomainByHostname(provider, target, hostname, command, signal) {
12649
+ const matched = (await provider.listDomains(target.service.id, { signal }).catch((error) => {
12650
+ throw domainCommandError(command, error, hostname, target);
12642
12651
  })).find((domain) => sameDomainHostname(domain.hostname, hostname));
12643
12652
  if (matched) return matched;
12644
- throw domainNotFoundError(hostname);
12653
+ throw domainNotFoundError(hostname, target);
12645
12654
  }
12646
12655
  /** Project + branch resolution, before the service match. */
12647
12656
  async function resolveServiceProjectState(ctx, options) {
@@ -12671,7 +12680,6 @@ async function resolveServiceReadState(ctx, options) {
12671
12680
  async function resolveServiceDomainTarget(ctx, options) {
12672
12681
  requireBranchFlagValue(options.branchName);
12673
12682
  const branchName = options.branchName?.trim() ?? "production";
12674
- if (toBranchKind(branchName) !== "production") throw branchNotDeployableError(branchName);
12675
12683
  const requested = requireServiceArgument(options.serviceName, options.commandName);
12676
12684
  const provider = serviceProvider(ctx);
12677
12685
  const target = await resolveServiceProjectContext(ctx, options.projectRef, {
@@ -12963,14 +12971,14 @@ function domainTargetArgs() {
12963
12971
  //#region ../cli/src/commands/service/domain-add.ts
12964
12972
  const serviceDomainAddCommand = defineCommand({
12965
12973
  help: {
12966
- summary: "Register a custom domain on the service's production branch",
12967
- description: "Points a hostname you own at the service instead of its generated URL. After registering, create the DNS record the platform asks for, then 'service domain wait' blocks until verification and TLS provisioning finish.",
12968
- examples: ["service domain add shop.acme.com --service my-service"]
12974
+ summary: "Register a custom domain on the selected service branch",
12975
+ description: "Points a hostname you own at the service instead of its generated URL. Add the routing CNAME and workspace TXT record shown by Console or the verification error, then rerun this command. Keep the TXT record for future attachments in this workspace. Use 'service domain wait' to wait for TLS provisioning.",
12976
+ examples: ["service domain add shop.acme.com --service my-service", "service domain add staging.acme.com --service my-service --branch staging"]
12969
12977
  },
12970
12978
  args: domainTargetArgs(),
12971
12979
  needs: { credentials: true },
12972
12980
  handler: async (args, ctx) => {
12973
- const hostname = normalizeDomainHostname(args.positionals.hostname);
12981
+ const hostname = normalizeDomainHostname(args.positionals.hostname, args.flags.branch);
12974
12982
  const target = await resolveServiceDomainTarget(ctx, {
12975
12983
  serviceName: args.flags.service,
12976
12984
  projectRef: args.flags.project,
@@ -12982,7 +12990,7 @@ const serviceDomainAddCommand = defineCommand({
12982
12990
  hostname,
12983
12991
  signal: ctx.signal
12984
12992
  }).catch((error) => {
12985
- throw domainCommandError("add", error, hostname);
12993
+ throw domainCommandError("add", error, hostname, target.resultTarget);
12986
12994
  });
12987
12995
  const result = {
12988
12996
  ...target.resultTarget,
@@ -13003,17 +13011,17 @@ const serviceDomainDeleteCommand = defineCommand({
13003
13011
  args: domainTargetArgs(),
13004
13012
  needs: { credentials: true },
13005
13013
  handler: async (args, ctx) => {
13006
- const hostname = normalizeDomainHostname(args.positionals.hostname);
13014
+ const hostname = normalizeDomainHostname(args.positionals.hostname, args.flags.branch);
13007
13015
  const target = await resolveServiceDomainTarget(ctx, {
13008
13016
  serviceName: args.flags.service,
13009
13017
  projectRef: args.flags.project,
13010
13018
  branchName: args.flags.branch,
13011
13019
  commandName: `service domain delete ${hostname}`
13012
13020
  });
13013
- const domain = await resolveDomainByHostname(target.provider, target.service.id, hostname, "delete", ctx.signal);
13021
+ const domain = await resolveDomainByHostname(target.provider, target.resultTarget, hostname, "delete", ctx.signal);
13014
13022
  if (!await ctx.prompt.consent(`Delete ${hostname} from Service "${target.resultTarget.service.name}"?`, { token: hostname })) throw userCancelledError("Custom domain deletion canceled");
13015
13023
  await target.provider.removeDomain(domain.id, { signal: ctx.signal }).catch((error) => {
13016
- throw domainCommandError("delete", error, hostname);
13024
+ throw domainCommandError("delete", error, hostname, target.resultTarget);
13017
13025
  });
13018
13026
  const result = {
13019
13027
  ...target.resultTarget,
@@ -13034,16 +13042,16 @@ const serviceDomainRetryCommand = defineCommand({
13034
13042
  args: domainTargetArgs(),
13035
13043
  needs: { credentials: true },
13036
13044
  handler: async (args, ctx) => {
13037
- const hostname = normalizeDomainHostname(args.positionals.hostname);
13045
+ const hostname = normalizeDomainHostname(args.positionals.hostname, args.flags.branch);
13038
13046
  const target = await resolveServiceDomainTarget(ctx, {
13039
13047
  serviceName: args.flags.service,
13040
13048
  projectRef: args.flags.project,
13041
13049
  branchName: args.flags.branch,
13042
13050
  commandName: `service domain retry ${hostname}`
13043
13051
  });
13044
- const domain = await resolveDomainByHostname(target.provider, target.service.id, hostname, "retry", ctx.signal);
13052
+ const domain = await resolveDomainByHostname(target.provider, target.resultTarget, hostname, "retry", ctx.signal);
13045
13053
  const retried = await target.provider.retryDomain(domain.id, { signal: ctx.signal }).catch((error) => {
13046
- throw domainCommandError("retry", error, hostname);
13054
+ throw domainCommandError("retry", error, hostname, target.resultTarget);
13047
13055
  });
13048
13056
  const result = {
13049
13057
  ...target.resultTarget,
@@ -13063,16 +13071,16 @@ const serviceDomainShowCommand = defineCommand({
13063
13071
  args: domainTargetArgs(),
13064
13072
  needs: { credentials: true },
13065
13073
  handler: async (args, ctx) => {
13066
- const hostname = normalizeDomainHostname(args.positionals.hostname);
13074
+ const hostname = normalizeDomainHostname(args.positionals.hostname, args.flags.branch);
13067
13075
  const target = await resolveServiceDomainTarget(ctx, {
13068
13076
  serviceName: args.flags.service,
13069
13077
  projectRef: args.flags.project,
13070
13078
  branchName: args.flags.branch,
13071
13079
  commandName: `service domain show ${hostname}`
13072
13080
  });
13073
- const domain = await resolveDomainByHostname(target.provider, target.service.id, hostname, "show", ctx.signal);
13081
+ const domain = await resolveDomainByHostname(target.provider, target.resultTarget, hostname, "show", ctx.signal);
13074
13082
  const detail = await target.provider.showDomain(domain.id, { signal: ctx.signal }).catch((error) => {
13075
- throw domainCommandError("show", error, hostname);
13083
+ throw domainCommandError("show", error, hostname, target.resultTarget);
13076
13084
  });
13077
13085
  const result = {
13078
13086
  ...target.resultTarget,
@@ -13091,12 +13099,12 @@ const UNIT_MULTIPLIER_MS = {
13091
13099
  m: 6e4,
13092
13100
  h: 36e5
13093
13101
  };
13094
- function parseWaitTimeout(value) {
13102
+ function parseWaitTimeout(value, branchName) {
13095
13103
  if (!value) return DEFAULT_TIMEOUT_MS;
13096
13104
  const trimmed = value.trim().toLowerCase();
13097
13105
  if (trimmed === "0") return 0;
13098
13106
  const match = DURATION.exec(trimmed);
13099
- if (!match) throw timeoutInvalidError(value);
13107
+ if (!match) throw timeoutInvalidError(value, branchName);
13100
13108
  return Number.parseInt(match[1], 10) * (UNIT_MULTIPLIER_MS[match[2]] ?? 1);
13101
13109
  }
13102
13110
  function pollIntervalMs$1(ctx) {
@@ -13140,15 +13148,15 @@ const serviceDomainWaitCommand = defineCommand({
13140
13148
  },
13141
13149
  needs: { credentials: true },
13142
13150
  handler: async (args, ctx) => {
13143
- const hostname = normalizeDomainHostname(args.positionals.hostname);
13144
- const timeoutMs = parseWaitTimeout(args.flags.timeout);
13151
+ const hostname = normalizeDomainHostname(args.positionals.hostname, args.flags.branch);
13152
+ const timeoutMs = parseWaitTimeout(args.flags.timeout, args.flags.branch);
13145
13153
  const target = await resolveServiceDomainTarget(ctx, {
13146
13154
  serviceName: args.flags.service,
13147
13155
  projectRef: args.flags.project,
13148
13156
  branchName: args.flags.branch,
13149
13157
  commandName: `service domain wait ${hostname}`
13150
13158
  });
13151
- const domain = await resolveDomainByHostname(target.provider, target.service.id, hostname, "wait", ctx.signal);
13159
+ const domain = await resolveDomainByHostname(target.provider, target.resultTarget, hostname, "wait", ctx.signal);
13152
13160
  const start = Date.now();
13153
13161
  const deadline = start + timeoutMs;
13154
13162
  const interval = pollIntervalMs$1(ctx);
@@ -13175,11 +13183,11 @@ const serviceDomainWaitCommand = defineCommand({
13175
13183
  };
13176
13184
  return ok(ctx.present({ data: result }, domainWaitPresentations(result)));
13177
13185
  }
13178
- if (current.status === "failed") throw domainVerificationFailedError(hostname, current);
13179
- if (timeoutMs === 0 || Date.now() >= deadline) throw domainVerificationTimeoutError(hostname, current.status);
13186
+ if (current.status === "failed") throw domainVerificationFailedError(hostname, current, target.resultTarget);
13187
+ if (timeoutMs === 0 || Date.now() >= deadline) throw domainVerificationTimeoutError(hostname, current.status, target.resultTarget);
13180
13188
  await sleep$1(Math.min(interval, Math.max(deadline - Date.now(), 0)), ctx.signal);
13181
13189
  current = await target.provider.showDomain(current.id, { signal: ctx.signal }).catch((error) => {
13182
- throw domainCommandError("wait", error, hostname);
13190
+ throw domainCommandError("wait", error, hostname, target.resultTarget);
13183
13191
  });
13184
13192
  }
13185
13193
  }
@@ -14242,7 +14250,7 @@ const cliGroups = {
14242
14250
  },
14243
14251
  "service domain": {
14244
14252
  brief: "Manage custom domains for a service. Register hostnames, drive DNS and TLS verification, inspect status",
14245
- description: "Custom domains point hostnames you own at a service's production branch. After add, create the DNS record the platform reports; wait and retry drive DNS verification and TLS provisioning to done.",
14253
+ description: "Custom domains point hostnames you own at a service on any branch. Commands default to production; use --branch to select another branch. After add, create the DNS record the platform reports; wait and retry drive DNS verification and TLS provisioning to done.",
14246
14254
  workflow: [
14247
14255
  {
14248
14256
  run: "service domain add shop.acme.com --service my-api",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prisma",
3
- "version": "8.0.0-rc.27",
3
+ "version": "8.0.0-rc.27-dev.167",
4
4
  "description": "The Prisma CLI: one binary for the ORM, Composer, and the Prisma Developer Platform.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -45,10 +45,10 @@
45
45
  "dependencies": {
46
46
  "@manypkg/tools": "^2.1.2",
47
47
  "@prisma/cli-engine": "0.9.0",
48
- "@prisma/composer-cli": "0.34.0",
48
+ "@prisma/composer-cli": "0.34.0-dev.3",
49
49
  "@prisma/compute-sdk": "0.43.0",
50
50
  "@prisma/management-api-sdk": "1.80.0",
51
- "@prisma/orm-toolchain": "8.0.0-rc.20",
51
+ "@prisma/orm-toolchain": "8.0.0-rc.20-dev.11",
52
52
  "@vercel/detect-agent": "^1.2.3",
53
53
  "better-result": "^2.9.2",
54
54
  "cross-spawn": "^7.0.6",
@@ -57,10 +57,10 @@
57
57
  "open": "^11.0.0"
58
58
  },
59
59
  "devDependencies": {
60
- "@prisma/cli": "8.0.0-rc.27",
60
+ "@prisma/cli": "8.0.0-rc.27-dev.167",
61
61
  "@prisma/credentials-store": "^7.8.0",
62
- "@repo/cli-telemetry": "8.0.0-rc.27",
63
- "@repo/tsconfig": "8.0.0-rc.27",
62
+ "@repo/cli-telemetry": "8.0.0-rc.27-dev.167",
63
+ "@repo/tsconfig": "8.0.0-rc.27-dev.167",
64
64
  "@types/node": "^22.19.19",
65
65
  "tsdown": "^0.21.10",
66
66
  "typescript": "^6.0.3",
@@ -2,7 +2,7 @@
2
2
  name: prisma-platform-core-concepts
3
3
  metadata:
4
4
  library: "prisma"
5
- library_version: "8.0.0-rc.27"
5
+ library_version: "8.0.0-rc.27-dev.167"
6
6
  version: 2026.9.2
7
7
  description: >-
8
8
  Use when hosting, deploying, or operating an app on the Prisma Platform: