runcloud 0.2.147 → 0.2.149

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.
@@ -67,7 +67,8 @@ export async function runDomainBuy(client, projectId, domainName, opts, log = co
67
67
  }));
68
68
  if (!result.checkout_url)
69
69
  throw new Error('Backend did not return a checkout URL.');
70
- log(`Checkout: ${result.checkout_url}`);
70
+ log(`Payment required — open this URL in a browser to complete the purchase:`);
71
+ log(` ${result.checkout_url}`);
71
72
  if (result.order?.id)
72
73
  log(`Order: ${result.order.id} (${result.order.status ?? 'checkout_created'})`);
73
74
  }
@@ -85,6 +86,13 @@ export async function runDomainConnect(client, projectId, hostname, opts, log =
85
86
  log(renderProjectDomain(result.domain));
86
87
  log(JSON.stringify(result.dns_instructions, null, 2));
87
88
  }
89
+ export async function runDomainConnectRegistered(client, projectId, hostname, log = console.log) {
90
+ const result = await client.post(`/projects/${projectId}/domains/connect-registered`, {
91
+ hostname,
92
+ });
93
+ log(renderProjectDomain(result.domain));
94
+ log(JSON.stringify(result.dns_instructions, null, 2));
95
+ }
88
96
  export async function runDomainStatus(client, projectId, hostnameOrId, log = console.log) {
89
97
  const list = (await client.get(`/projects/${projectId}/domains`));
90
98
  const projectDomains = list.domains ?? [];
@@ -137,7 +145,7 @@ export function registerDomains(program) {
137
145
  .option('--years <n>', 'registration term in years', '1')
138
146
  .option('--project <id>', 'project id (defaults to the linked directory)')
139
147
  .option('--yes', 'confirm purchase without an interactive prompt', false)
140
- .description('Buy a domain through Cloudflare Registrar')
148
+ .description('Buy a domain through Cloudflare Registrar — it prints a Stripe checkout URL the account owner opens in a browser to pay.')
141
149
  .action(async (domainName, opts) => {
142
150
  try {
143
151
  const { client, projectId, appUrl } = makeClient(opts.project);
@@ -183,6 +191,21 @@ export function registerDomains(program) {
183
191
  process.exitCode = 1;
184
192
  }
185
193
  });
194
+ domains
195
+ .command('connect-registered')
196
+ .argument('<hostname>')
197
+ .option('--project <id>', 'project id (defaults to the linked directory)')
198
+ .description('Connect a domain Newly already registered for this project to the published website (retries the automatic connect)')
199
+ .action(async (hostname, opts) => {
200
+ try {
201
+ const { client, projectId } = makeClient(opts.project);
202
+ await runDomainConnectRegistered(client, projectId, hostname);
203
+ }
204
+ catch (e) {
205
+ console.error(friendlyApiError(e));
206
+ process.exitCode = 1;
207
+ }
208
+ });
186
209
  domains
187
210
  .command('status')
188
211
  .argument('[hostname-or-id]')
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLI_VERSION = '0.2.147';
1
+ export const CLI_VERSION = '0.2.149';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runcloud",
3
- "version": "0.2.147",
3
+ "version": "0.2.149",
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