@base44-preview/cli 0.0.31-pr.211.cb90710 → 0.0.31-pr.211.de9d890

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/cli/index.js CHANGED
@@ -194298,55 +194298,9 @@ defineLazyProperty(apps, "safari", () => detectPlatformBinary({
194298
194298
  var open_default = open;
194299
194299
 
194300
194300
  // src/cli/commands/connectors/oauth-prompt.ts
194301
- var POLL_INTERVAL_MS = 2000;
194302
- var POLL_TIMEOUT_MS = 2 * 60 * 1000;
194303
194301
  function filterPendingOAuth(results) {
194304
194302
  return results.filter((r2) => r2.action === "needs_oauth" && !!r2.redirectUrl && !!r2.connectionId);
194305
194303
  }
194306
- async function runOAuthFlowWithSkip(connector2) {
194307
- await open_default(connector2.redirectUrl);
194308
- let finalStatus = "PENDING";
194309
- let skipped = false;
194310
- const s = Y2();
194311
- const originalExit = process.exit;
194312
- process.exit = () => {
194313
- skipped = true;
194314
- s.stop(`${connector2.type} skipped`);
194315
- };
194316
- s.start(`Waiting for ${connector2.type} authorization... (Esc to skip)`);
194317
- try {
194318
- await pWaitFor(async () => {
194319
- if (skipped) {
194320
- finalStatus = "SKIPPED";
194321
- return true;
194322
- }
194323
- const response = await getOAuthStatus(connector2.type, connector2.connectionId);
194324
- finalStatus = response.status;
194325
- return response.status !== "PENDING";
194326
- }, {
194327
- interval: POLL_INTERVAL_MS,
194328
- timeout: POLL_TIMEOUT_MS
194329
- });
194330
- } catch (err) {
194331
- if (err instanceof TimeoutError2) {
194332
- finalStatus = "PENDING";
194333
- } else {
194334
- throw err;
194335
- }
194336
- } finally {
194337
- process.exit = originalExit;
194338
- if (!skipped) {
194339
- if (finalStatus === "ACTIVE") {
194340
- s.stop(`${connector2.type} authorization complete`);
194341
- } else if (finalStatus === "FAILED") {
194342
- s.stop(`${connector2.type} authorization failed`);
194343
- } else {
194344
- s.stop(`${connector2.type} authorization timed out`);
194345
- }
194346
- }
194347
- }
194348
- return finalStatus;
194349
- }
194350
194304
  async function promptOAuthFlows(pending, options) {
194351
194305
  const outcomes = new Map;
194352
194306
  if (pending.length === 0) {
@@ -194366,15 +194320,30 @@ async function promptOAuthFlows(pending, options) {
194366
194320
  return outcomes;
194367
194321
  }
194368
194322
  for (const connector2 of pending) {
194369
- try {
194370
- M2.info(`
194323
+ M2.info(`
194371
194324
  Opening browser for ${connector2.type}...`);
194372
- const status = await runOAuthFlowWithSkip(connector2);
194373
- outcomes.set(connector2.type, status);
194374
- } catch (err) {
194375
- M2.error(`Failed to authorize ${connector2.type}: ${err instanceof Error ? err.message : String(err)}`);
194376
- outcomes.set(connector2.type, "FAILED");
194377
- }
194325
+ await open_default(connector2.redirectUrl);
194326
+ let finalStatus = "PENDING";
194327
+ await runTask(`Waiting for ${connector2.type} authorization...`, async () => {
194328
+ await pWaitFor(async () => {
194329
+ const response = await getOAuthStatus(connector2.type, connector2.connectionId);
194330
+ finalStatus = response.status;
194331
+ return response.status !== "PENDING";
194332
+ }, {
194333
+ interval: 2000,
194334
+ timeout: 2 * 60 * 1000
194335
+ });
194336
+ }, {
194337
+ successMessage: `${connector2.type} authorization complete`,
194338
+ errorMessage: `${connector2.type} authorization failed`
194339
+ }).catch((err) => {
194340
+ if (err instanceof TimeoutError2) {
194341
+ finalStatus = "PENDING";
194342
+ } else {
194343
+ throw err;
194344
+ }
194345
+ });
194346
+ outcomes.set(connector2.type, finalStatus);
194378
194347
  }
194379
194348
  return outcomes;
194380
194349
  }
@@ -194384,7 +194353,6 @@ function printSummary(results, oauthOutcomes) {
194384
194353
  const synced = [];
194385
194354
  const added = [];
194386
194355
  const removed = [];
194387
- const skipped = [];
194388
194356
  const failed = [];
194389
194357
  for (const r2 of results) {
194390
194358
  const oauthStatus = oauthOutcomes.get(r2.type);
@@ -194397,8 +194365,6 @@ function printSummary(results, oauthOutcomes) {
194397
194365
  } else if (r2.action === "needs_oauth") {
194398
194366
  if (oauthStatus === "ACTIVE") {
194399
194367
  added.push(r2.type);
194400
- } else if (oauthStatus === "SKIPPED") {
194401
- skipped.push(r2.type);
194402
194368
  } else if (oauthStatus === "PENDING") {
194403
194369
  failed.push({ type: r2.type, error: "authorization timed out" });
194404
194370
  } else if (oauthStatus === "FAILED") {
@@ -194418,9 +194384,6 @@ function printSummary(results, oauthOutcomes) {
194418
194384
  if (removed.length > 0) {
194419
194385
  M2.info(theme.styles.dim(`Removed: ${removed.join(", ")}`));
194420
194386
  }
194421
- if (skipped.length > 0) {
194422
- M2.warn(`Skipped: ${skipped.join(", ")}`);
194423
- }
194424
194387
  for (const r2 of failed) {
194425
194388
  M2.error(`Failed: ${r2.type}${r2.error ? ` - ${r2.error}` : ""}`);
194426
194389
  }
@@ -199678,4 +199641,4 @@ export {
199678
199641
  CLIExitError
199679
199642
  };
199680
199643
 
199681
- //# debugId=3B396D1D0D9A865164756E2164756E21
199644
+ //# debugId=3AF0A883AF7DD29464756E2164756E21