@lukoweb/apitogo 0.2.41 → 0.2.42
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/cli.js
CHANGED
|
@@ -10371,7 +10371,7 @@ import {
|
|
|
10371
10371
|
// package.json
|
|
10372
10372
|
var package_default = {
|
|
10373
10373
|
name: "@lukoweb/apitogo",
|
|
10374
|
-
version: "0.2.
|
|
10374
|
+
version: "0.2.42",
|
|
10375
10375
|
type: "module",
|
|
10376
10376
|
sideEffects: [
|
|
10377
10377
|
"**/*.css",
|
|
@@ -24497,6 +24497,33 @@ async function handleDeleteProject(client, config2, args, progress) {
|
|
|
24497
24497
|
}
|
|
24498
24498
|
|
|
24499
24499
|
// src/cli/platform/tools/lifecycle.ts
|
|
24500
|
+
function shouldRetryActivation(infrastructureStatus, context) {
|
|
24501
|
+
const status2 = infrastructureStatus?.toLowerCase() ?? "";
|
|
24502
|
+
if (status2 === "failed") return true;
|
|
24503
|
+
if (!context.resumed) return false;
|
|
24504
|
+
return status2 === "none" || status2 === "" || context.timedOut;
|
|
24505
|
+
}
|
|
24506
|
+
async function retryActivation(client, projectId, steps, progress) {
|
|
24507
|
+
await progress?.onStep("Retrying hosting activation");
|
|
24508
|
+
try {
|
|
24509
|
+
const started = await client.retryAzureInfrastructure(projectId);
|
|
24510
|
+
steps.push({
|
|
24511
|
+
step: "retry_activation",
|
|
24512
|
+
status: "pending",
|
|
24513
|
+
detail: started
|
|
24514
|
+
});
|
|
24515
|
+
return true;
|
|
24516
|
+
} catch (error) {
|
|
24517
|
+
steps.push({
|
|
24518
|
+
step: "retry_activation",
|
|
24519
|
+
status: "skipped",
|
|
24520
|
+
detail: {
|
|
24521
|
+
reason: error instanceof Error ? error.message : String(error)
|
|
24522
|
+
}
|
|
24523
|
+
});
|
|
24524
|
+
return false;
|
|
24525
|
+
}
|
|
24526
|
+
}
|
|
24500
24527
|
async function findExistingProjectByName(client, name) {
|
|
24501
24528
|
const projects = await client.listProjects();
|
|
24502
24529
|
return findProjectByNormalizedName(projects, name);
|
|
@@ -24601,11 +24628,27 @@ async function handleBootstrapProject(client, config2, args, progress) {
|
|
|
24601
24628
|
const projectBeforeModules = await client.getProject(projectId);
|
|
24602
24629
|
const planSelected = !isPlatformPlanUnselected(projectBeforeModules.planTier);
|
|
24603
24630
|
if (wait && planSelected) {
|
|
24604
|
-
|
|
24631
|
+
if (resumed && shouldRetryActivation(projectBeforeModules.infrastructureStatus, {
|
|
24632
|
+
resumed,
|
|
24633
|
+
timedOut: false
|
|
24634
|
+
})) {
|
|
24635
|
+
await retryActivation(client, projectId, steps, bootstrapProgress);
|
|
24636
|
+
}
|
|
24637
|
+
let binding = await waitForWarmPoolBinding(client, projectId, {
|
|
24605
24638
|
timeoutMs: args.timeoutMs,
|
|
24606
24639
|
pollIntervalMs: args.pollIntervalMs,
|
|
24607
24640
|
progress: bootstrapProgress?.child("Waiting for warm pool binding")
|
|
24608
24641
|
});
|
|
24642
|
+
if (shouldRetryActivation(binding.project.infrastructureStatus, {
|
|
24643
|
+
resumed,
|
|
24644
|
+
timedOut: binding.timedOut
|
|
24645
|
+
}) && await retryActivation(client, projectId, steps, bootstrapProgress)) {
|
|
24646
|
+
binding = await waitForWarmPoolBinding(client, projectId, {
|
|
24647
|
+
timeoutMs: args.timeoutMs,
|
|
24648
|
+
pollIntervalMs: args.pollIntervalMs,
|
|
24649
|
+
progress: bootstrapProgress?.child("Waiting for warm pool binding")
|
|
24650
|
+
});
|
|
24651
|
+
}
|
|
24609
24652
|
steps.push({
|
|
24610
24653
|
step: "wait_warm_pool_binding",
|
|
24611
24654
|
status: binding.timedOut ? "running" : binding.status,
|
|
@@ -6,6 +6,10 @@ interface BootstrapStep {
|
|
|
6
6
|
status: string;
|
|
7
7
|
detail?: unknown;
|
|
8
8
|
}
|
|
9
|
+
export declare function shouldRetryActivation(infrastructureStatus: string | null | undefined, context: {
|
|
10
|
+
resumed: boolean;
|
|
11
|
+
timedOut: boolean;
|
|
12
|
+
}): boolean;
|
|
9
13
|
export declare function resolveBootstrapProjectId(client: PlatformApiClient, args: {
|
|
10
14
|
name: string;
|
|
11
15
|
description?: string;
|