runcloud 0.2.198 → 0.2.199

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.
@@ -50,6 +50,10 @@ export async function runDomainCheck(client, domainNames, log = console.log) {
50
50
  const candidates = result.domains ?? [];
51
51
  log(candidates.length ? candidates.map(summarizeDomain).join('\n') : 'No results.');
52
52
  }
53
+ export function checkoutReturnUrl(appUrl, projectId, domain, outcome) {
54
+ const query = new URLSearchParams({ domain_checkout: outcome, domain });
55
+ return `${appUrl}/projects/${encodeURIComponent(projectId)}/deploy?${query}`;
56
+ }
53
57
  export async function runDomainBuy(client, projectId, domainName, opts, log = console.log, confirmPurchase = confirm) {
54
58
  const quoteResult = (await client.post(`/projects/${projectId}/domains/registrations/quote`, {
55
59
  domain: domainName,
@@ -67,8 +71,8 @@ export async function runDomainBuy(client, projectId, domainName, opts, log = co
67
71
  const result = (await client.post(`/projects/${projectId}/domains/registrations/checkout`, {
68
72
  domain: domainName,
69
73
  years: opts.years,
70
- success_url: `${appUrl}/project/${projectId}/website?domain_checkout=success`,
71
- cancel_url: `${appUrl}/project/${projectId}/website?domain_checkout=cancel`,
74
+ success_url: checkoutReturnUrl(appUrl, projectId, domainName, 'success'),
75
+ cancel_url: checkoutReturnUrl(appUrl, projectId, domainName, 'cancel'),
72
76
  }));
73
77
  if (!result.checkout_url)
74
78
  throw new Error('Backend did not return a checkout URL.');
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLI_VERSION = '0.2.198';
1
+ export const CLI_VERSION = '0.2.199';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runcloud",
3
- "version": "0.2.198",
3
+ "version": "0.2.199",
4
4
  "description": "Create and control run.cloud remote mobile simulators and cloud sandboxes",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
Binary file
Binary file