runcloud 0.2.149 → 0.2.150
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/commands/domains.js +15 -0
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/runcloud-0.2.150.tgz +0 -0
- package/runcloud-0.2.149.tgz +0 -0
package/dist/commands/domains.js
CHANGED
|
@@ -2,6 +2,11 @@ import { stdin as input, stdout as output } from 'node:process';
|
|
|
2
2
|
import { createInterface } from 'node:readline/promises';
|
|
3
3
|
import { ApiClient, friendlyApiError } from '../api.js';
|
|
4
4
|
import { requireCredentials, resolveProject } from '../config.js';
|
|
5
|
+
export function renderPendingRegistration(order) {
|
|
6
|
+
const action = `run \`newly domains connect-registered ${order.domain}\``;
|
|
7
|
+
const base = `${order.domain} ${order.status} (not connected) — ${action}`;
|
|
8
|
+
return order.error_message ? `${base} (error: ${order.error_message})` : base;
|
|
9
|
+
}
|
|
5
10
|
function makeClient(project) {
|
|
6
11
|
const creds = requireCredentials();
|
|
7
12
|
return {
|
|
@@ -76,6 +81,9 @@ export async function runDomainList(client, projectId, log = console.log) {
|
|
|
76
81
|
const result = (await client.get(`/projects/${projectId}/domains`));
|
|
77
82
|
const projectDomains = result.domains ?? [];
|
|
78
83
|
log(projectDomains.length ? projectDomains.map(renderProjectDomain).join('\n') : 'No domains.');
|
|
84
|
+
const pending = result.pending_registrations ?? [];
|
|
85
|
+
if (pending.length)
|
|
86
|
+
log(pending.map(renderPendingRegistration).join('\n'));
|
|
79
87
|
}
|
|
80
88
|
export async function runDomainConnect(client, projectId, hostname, opts, log = console.log) {
|
|
81
89
|
const result = await client.post(`/projects/${projectId}/domains/connect`, {
|
|
@@ -99,6 +107,13 @@ export async function runDomainStatus(client, projectId, hostnameOrId, log = con
|
|
|
99
107
|
const domain = hostnameOrId
|
|
100
108
|
? projectDomains.find((item) => item.id === hostnameOrId || item.hostname === hostnameOrId)
|
|
101
109
|
: projectDomains[0];
|
|
110
|
+
if (!domain && hostnameOrId) {
|
|
111
|
+
const pending = (list.pending_registrations ?? []).find((order) => order.domain === hostnameOrId);
|
|
112
|
+
if (pending) {
|
|
113
|
+
log(renderPendingRegistration(pending));
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
102
117
|
if (!domain)
|
|
103
118
|
throw new Error('Domain not found.');
|
|
104
119
|
const refreshed = await client.post(`/projects/${projectId}/domains/${domain.id}/refresh`, {});
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CLI_VERSION = '0.2.
|
|
1
|
+
export const CLI_VERSION = '0.2.150';
|
package/package.json
CHANGED
|
Binary file
|
package/runcloud-0.2.149.tgz
DELETED
|
Binary file
|