siteplane 0.1.38 → 0.1.39
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/bin/siteplane.js +31 -1
- package/dist/index.js +3 -1
- package/dist/next.js +3 -1
- package/package.json +1 -1
package/dist/bin/siteplane.js
CHANGED
|
@@ -2921,6 +2921,7 @@ async function bookingTestCommand(input) {
|
|
|
2921
2921
|
}
|
|
2922
2922
|
|
|
2923
2923
|
// ../cli/dist/commands/connect.js
|
|
2924
|
+
import { spawn } from "child_process";
|
|
2924
2925
|
import { randomBytes } from "crypto";
|
|
2925
2926
|
import { z as z27 } from "zod";
|
|
2926
2927
|
|
|
@@ -3196,7 +3197,8 @@ var claimResponseSchema = z27.object({
|
|
|
3196
3197
|
ok: z27.literal(true),
|
|
3197
3198
|
data: z27.object({
|
|
3198
3199
|
pairingId: z27.string().uuid(),
|
|
3199
|
-
status: z27.literal("approval_required")
|
|
3200
|
+
status: z27.literal("approval_required"),
|
|
3201
|
+
approvalUrl: z27.string().url()
|
|
3200
3202
|
}).passthrough()
|
|
3201
3203
|
}).strict();
|
|
3202
3204
|
var waitingResponseSchema = z27.object({
|
|
@@ -3236,6 +3238,16 @@ async function connectCommand(input) {
|
|
|
3236
3238
|
if (!claimResponse.ok || !claim.success) {
|
|
3237
3239
|
throw new Error(readErrorMessage2(claimPayload) ?? "Siteplane pairing failed.");
|
|
3238
3240
|
}
|
|
3241
|
+
let browserOpened = false;
|
|
3242
|
+
try {
|
|
3243
|
+
await (input.openBrowser ?? openInDefaultBrowser)(claim.data.data.approvalUrl);
|
|
3244
|
+
browserOpened = true;
|
|
3245
|
+
} catch {
|
|
3246
|
+
}
|
|
3247
|
+
input.onApprovalRequired?.({
|
|
3248
|
+
approvalUrl: claim.data.data.approvalUrl,
|
|
3249
|
+
browserOpened
|
|
3250
|
+
});
|
|
3239
3251
|
const wait = input.wait ?? ((milliseconds) => new Promise((resolve2) => setTimeout(resolve2, milliseconds)));
|
|
3240
3252
|
let bootstrap = null;
|
|
3241
3253
|
for (; ; ) {
|
|
@@ -3289,6 +3301,18 @@ async function connectCommand(input) {
|
|
|
3289
3301
|
]
|
|
3290
3302
|
};
|
|
3291
3303
|
}
|
|
3304
|
+
async function openInDefaultBrowser(url) {
|
|
3305
|
+
const command = process.platform === "darwin" ? "open" : process.platform === "win32" ? "rundll32.exe" : "xdg-open";
|
|
3306
|
+
const args = process.platform === "win32" ? ["url.dll,FileProtocolHandler", url] : [url];
|
|
3307
|
+
await new Promise((resolve2, reject) => {
|
|
3308
|
+
const child = spawn(command, args, { detached: true, stdio: "ignore" });
|
|
3309
|
+
child.once("error", reject);
|
|
3310
|
+
child.once("spawn", () => {
|
|
3311
|
+
child.unref();
|
|
3312
|
+
resolve2();
|
|
3313
|
+
});
|
|
3314
|
+
});
|
|
3315
|
+
}
|
|
3292
3316
|
function createHeaders(input) {
|
|
3293
3317
|
return new Headers({
|
|
3294
3318
|
"content-type": "application/json",
|
|
@@ -4192,6 +4216,12 @@ async function runSiteplaneCli(args, dependencies = createDefaultDependencies())
|
|
|
4192
4216
|
projectDir: dependencies.cwd(),
|
|
4193
4217
|
pairingCode,
|
|
4194
4218
|
apiBaseUrl,
|
|
4219
|
+
onApprovalRequired: ({ approvalUrl, browserOpened }) => {
|
|
4220
|
+
dependencies.stdout(
|
|
4221
|
+
browserOpened ? "Opened Siteplane in your browser. Approve the connection there:" : "Could not open a browser automatically. Approve the connection here:"
|
|
4222
|
+
);
|
|
4223
|
+
dependencies.stdout(approvalUrl);
|
|
4224
|
+
},
|
|
4195
4225
|
...readOptionalVercelAutomationBypassSecret(dependencies.env)
|
|
4196
4226
|
});
|
|
4197
4227
|
dependencies.stdout(`Wrote ${result.configPath}`);
|
package/dist/index.js
CHANGED
|
@@ -1990,6 +1990,7 @@ async function bookingTestCommand(input) {
|
|
|
1990
1990
|
}
|
|
1991
1991
|
|
|
1992
1992
|
// ../cli/dist/commands/connect.js
|
|
1993
|
+
import { spawn } from "child_process";
|
|
1993
1994
|
import { randomBytes } from "crypto";
|
|
1994
1995
|
import { z as z27 } from "zod";
|
|
1995
1996
|
|
|
@@ -2265,7 +2266,8 @@ var claimResponseSchema = z27.object({
|
|
|
2265
2266
|
ok: z27.literal(true),
|
|
2266
2267
|
data: z27.object({
|
|
2267
2268
|
pairingId: z27.string().uuid(),
|
|
2268
|
-
status: z27.literal("approval_required")
|
|
2269
|
+
status: z27.literal("approval_required"),
|
|
2270
|
+
approvalUrl: z27.string().url()
|
|
2269
2271
|
}).passthrough()
|
|
2270
2272
|
}).strict();
|
|
2271
2273
|
var waitingResponseSchema = z27.object({
|
package/dist/next.js
CHANGED
|
@@ -1898,6 +1898,7 @@ alwaysApply: true
|
|
|
1898
1898
|
${bookingRulesTemplate}`;
|
|
1899
1899
|
|
|
1900
1900
|
// ../cli/dist/commands/connect.js
|
|
1901
|
+
import { spawn } from "child_process";
|
|
1901
1902
|
import { randomBytes } from "crypto";
|
|
1902
1903
|
import { z as z27 } from "zod";
|
|
1903
1904
|
|
|
@@ -1962,7 +1963,8 @@ var claimResponseSchema = z27.object({
|
|
|
1962
1963
|
ok: z27.literal(true),
|
|
1963
1964
|
data: z27.object({
|
|
1964
1965
|
pairingId: z27.string().uuid(),
|
|
1965
|
-
status: z27.literal("approval_required")
|
|
1966
|
+
status: z27.literal("approval_required"),
|
|
1967
|
+
approvalUrl: z27.string().url()
|
|
1966
1968
|
}).passthrough()
|
|
1967
1969
|
}).strict();
|
|
1968
1970
|
var waitingResponseSchema = z27.object({
|