@riddledc/riddle-proof 0.7.113 → 0.7.114
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/{chunk-OI57LO6Y.js → chunk-7GHBRZHQ.js} +58 -14
- package/dist/cli.cjs +58 -14
- package/dist/cli.js +1 -1
- package/dist/index.cjs +58 -14
- package/dist/index.js +1 -1
- package/dist/proof-run-engine.d.cts +3 -3
- package/dist/proof-run-engine.d.ts +3 -3
- package/dist/riddle-client.cjs +58 -14
- package/dist/riddle-client.d.cts +2 -0
- package/dist/riddle-client.d.ts +2 -0
- package/dist/riddle-client.js +1 -1
- package/package.json +1 -1
|
@@ -14,6 +14,9 @@ var RiddleApiError = class extends Error {
|
|
|
14
14
|
this.path = pathname;
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
+
var PREVIEW_PUBLISH_RECOVERY_STATUSES = /* @__PURE__ */ new Set([408, 429, 500, 502, 503, 504]);
|
|
18
|
+
var PREVIEW_PUBLISH_RECOVERY_ATTEMPTS = 30;
|
|
19
|
+
var PREVIEW_PUBLISH_RECOVERY_INTERVAL_MS = 2e3;
|
|
17
20
|
function normalizeBaseUrl(value) {
|
|
18
21
|
return (value || DEFAULT_RIDDLE_API_BASE_URL).replace(/\/$/, "");
|
|
19
22
|
}
|
|
@@ -48,6 +51,45 @@ async function riddleRequestJson(config, pathname, init = {}) {
|
|
|
48
51
|
if (!response.ok) throw new RiddleApiError(pathname, response.status, text);
|
|
49
52
|
return json ?? text;
|
|
50
53
|
}
|
|
54
|
+
function previewDeployResultFromRecord(input) {
|
|
55
|
+
const { record, id, label, framework, expiresAt, publishRecovered, publishError } = input;
|
|
56
|
+
return {
|
|
57
|
+
ok: true,
|
|
58
|
+
id: String(record.id || record.preview_id || id),
|
|
59
|
+
label,
|
|
60
|
+
framework,
|
|
61
|
+
preview_url: String(record.preview_url || ""),
|
|
62
|
+
file_count: typeof record.file_count === "number" ? record.file_count : void 0,
|
|
63
|
+
total_bytes: typeof record.total_bytes === "number" ? record.total_bytes : void 0,
|
|
64
|
+
expires_at: expiresAt,
|
|
65
|
+
publish_recovered: publishRecovered || void 0,
|
|
66
|
+
publish_error: publishError,
|
|
67
|
+
raw: record
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function canRecoverPreviewPublish(error) {
|
|
71
|
+
return error instanceof RiddleApiError && PREVIEW_PUBLISH_RECOVERY_STATUSES.has(error.status);
|
|
72
|
+
}
|
|
73
|
+
async function waitForPublishedPreview(config, input) {
|
|
74
|
+
for (let attempt = 1; attempt <= PREVIEW_PUBLISH_RECOVERY_ATTEMPTS; attempt += 1) {
|
|
75
|
+
const status = await riddleRequestJson(config, `/v1/preview/${input.id}`);
|
|
76
|
+
if (String(status.status || "") === "ready" && String(status.preview_url || "").trim()) {
|
|
77
|
+
return previewDeployResultFromRecord({
|
|
78
|
+
record: status,
|
|
79
|
+
id: input.id,
|
|
80
|
+
label: input.label,
|
|
81
|
+
framework: input.framework,
|
|
82
|
+
expiresAt: input.expiresAt,
|
|
83
|
+
publishRecovered: true,
|
|
84
|
+
publishError: input.publishError.message
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
if (attempt < PREVIEW_PUBLISH_RECOVERY_ATTEMPTS) {
|
|
88
|
+
await new Promise((resolve) => setTimeout(resolve, PREVIEW_PUBLISH_RECOVERY_INTERVAL_MS));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
throw input.publishError;
|
|
92
|
+
}
|
|
51
93
|
async function deployRiddlePreview(config, directory, label, framework = "static") {
|
|
52
94
|
if (!directory?.trim()) throw new Error("directory is required");
|
|
53
95
|
if (!label?.trim()) throw new Error("label is required");
|
|
@@ -74,20 +116,22 @@ async function deployRiddlePreview(config, directory, label, framework = "static
|
|
|
74
116
|
} finally {
|
|
75
117
|
rmSync(scratch, { recursive: true, force: true });
|
|
76
118
|
}
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
119
|
+
const expiresAt = typeof created.expires_at === "string" ? created.expires_at : void 0;
|
|
120
|
+
try {
|
|
121
|
+
const published = await riddleRequestJson(config, `/v1/preview/${id}/publish`, {
|
|
122
|
+
method: "POST"
|
|
123
|
+
});
|
|
124
|
+
return previewDeployResultFromRecord({ record: published, id, label, framework, expiresAt });
|
|
125
|
+
} catch (error) {
|
|
126
|
+
if (!canRecoverPreviewPublish(error)) throw error;
|
|
127
|
+
return waitForPublishedPreview(config, {
|
|
128
|
+
id,
|
|
129
|
+
label,
|
|
130
|
+
framework,
|
|
131
|
+
expiresAt,
|
|
132
|
+
publishError: error
|
|
133
|
+
});
|
|
134
|
+
}
|
|
91
135
|
}
|
|
92
136
|
async function deployRiddleStaticPreview(config, directory, label) {
|
|
93
137
|
return deployRiddlePreview(config, directory, label, "static");
|
package/dist/cli.cjs
CHANGED
|
@@ -6575,6 +6575,9 @@ var RiddleApiError = class extends Error {
|
|
|
6575
6575
|
this.path = pathname;
|
|
6576
6576
|
}
|
|
6577
6577
|
};
|
|
6578
|
+
var PREVIEW_PUBLISH_RECOVERY_STATUSES = /* @__PURE__ */ new Set([408, 429, 500, 502, 503, 504]);
|
|
6579
|
+
var PREVIEW_PUBLISH_RECOVERY_ATTEMPTS = 30;
|
|
6580
|
+
var PREVIEW_PUBLISH_RECOVERY_INTERVAL_MS = 2e3;
|
|
6578
6581
|
function normalizeBaseUrl(value) {
|
|
6579
6582
|
return (value || DEFAULT_RIDDLE_API_BASE_URL).replace(/\/$/, "");
|
|
6580
6583
|
}
|
|
@@ -6609,6 +6612,45 @@ async function riddleRequestJson(config, pathname, init = {}) {
|
|
|
6609
6612
|
if (!response.ok) throw new RiddleApiError(pathname, response.status, text);
|
|
6610
6613
|
return json ?? text;
|
|
6611
6614
|
}
|
|
6615
|
+
function previewDeployResultFromRecord(input) {
|
|
6616
|
+
const { record, id, label, framework, expiresAt, publishRecovered, publishError } = input;
|
|
6617
|
+
return {
|
|
6618
|
+
ok: true,
|
|
6619
|
+
id: String(record.id || record.preview_id || id),
|
|
6620
|
+
label,
|
|
6621
|
+
framework,
|
|
6622
|
+
preview_url: String(record.preview_url || ""),
|
|
6623
|
+
file_count: typeof record.file_count === "number" ? record.file_count : void 0,
|
|
6624
|
+
total_bytes: typeof record.total_bytes === "number" ? record.total_bytes : void 0,
|
|
6625
|
+
expires_at: expiresAt,
|
|
6626
|
+
publish_recovered: publishRecovered || void 0,
|
|
6627
|
+
publish_error: publishError,
|
|
6628
|
+
raw: record
|
|
6629
|
+
};
|
|
6630
|
+
}
|
|
6631
|
+
function canRecoverPreviewPublish(error) {
|
|
6632
|
+
return error instanceof RiddleApiError && PREVIEW_PUBLISH_RECOVERY_STATUSES.has(error.status);
|
|
6633
|
+
}
|
|
6634
|
+
async function waitForPublishedPreview(config, input) {
|
|
6635
|
+
for (let attempt = 1; attempt <= PREVIEW_PUBLISH_RECOVERY_ATTEMPTS; attempt += 1) {
|
|
6636
|
+
const status = await riddleRequestJson(config, `/v1/preview/${input.id}`);
|
|
6637
|
+
if (String(status.status || "") === "ready" && String(status.preview_url || "").trim()) {
|
|
6638
|
+
return previewDeployResultFromRecord({
|
|
6639
|
+
record: status,
|
|
6640
|
+
id: input.id,
|
|
6641
|
+
label: input.label,
|
|
6642
|
+
framework: input.framework,
|
|
6643
|
+
expiresAt: input.expiresAt,
|
|
6644
|
+
publishRecovered: true,
|
|
6645
|
+
publishError: input.publishError.message
|
|
6646
|
+
});
|
|
6647
|
+
}
|
|
6648
|
+
if (attempt < PREVIEW_PUBLISH_RECOVERY_ATTEMPTS) {
|
|
6649
|
+
await new Promise((resolve) => setTimeout(resolve, PREVIEW_PUBLISH_RECOVERY_INTERVAL_MS));
|
|
6650
|
+
}
|
|
6651
|
+
}
|
|
6652
|
+
throw input.publishError;
|
|
6653
|
+
}
|
|
6612
6654
|
async function deployRiddlePreview(config, directory, label, framework = "static") {
|
|
6613
6655
|
if (!directory?.trim()) throw new Error("directory is required");
|
|
6614
6656
|
if (!label?.trim()) throw new Error("label is required");
|
|
@@ -6635,20 +6677,22 @@ async function deployRiddlePreview(config, directory, label, framework = "static
|
|
|
6635
6677
|
} finally {
|
|
6636
6678
|
(0, import_node_fs5.rmSync)(scratch, { recursive: true, force: true });
|
|
6637
6679
|
}
|
|
6638
|
-
const
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6680
|
+
const expiresAt = typeof created.expires_at === "string" ? created.expires_at : void 0;
|
|
6681
|
+
try {
|
|
6682
|
+
const published = await riddleRequestJson(config, `/v1/preview/${id}/publish`, {
|
|
6683
|
+
method: "POST"
|
|
6684
|
+
});
|
|
6685
|
+
return previewDeployResultFromRecord({ record: published, id, label, framework, expiresAt });
|
|
6686
|
+
} catch (error) {
|
|
6687
|
+
if (!canRecoverPreviewPublish(error)) throw error;
|
|
6688
|
+
return waitForPublishedPreview(config, {
|
|
6689
|
+
id,
|
|
6690
|
+
label,
|
|
6691
|
+
framework,
|
|
6692
|
+
expiresAt,
|
|
6693
|
+
publishError: error
|
|
6694
|
+
});
|
|
6695
|
+
}
|
|
6652
6696
|
}
|
|
6653
6697
|
async function deployRiddleStaticPreview(config, directory, label) {
|
|
6654
6698
|
return deployRiddlePreview(config, directory, label, "static");
|
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -14476,6 +14476,9 @@ var RiddleApiError = class extends Error {
|
|
|
14476
14476
|
this.path = pathname;
|
|
14477
14477
|
}
|
|
14478
14478
|
};
|
|
14479
|
+
var PREVIEW_PUBLISH_RECOVERY_STATUSES = /* @__PURE__ */ new Set([408, 429, 500, 502, 503, 504]);
|
|
14480
|
+
var PREVIEW_PUBLISH_RECOVERY_ATTEMPTS = 30;
|
|
14481
|
+
var PREVIEW_PUBLISH_RECOVERY_INTERVAL_MS = 2e3;
|
|
14479
14482
|
function normalizeBaseUrl(value) {
|
|
14480
14483
|
return (value || DEFAULT_RIDDLE_API_BASE_URL).replace(/\/$/, "");
|
|
14481
14484
|
}
|
|
@@ -14510,6 +14513,45 @@ async function riddleRequestJson(config, pathname, init = {}) {
|
|
|
14510
14513
|
if (!response.ok) throw new RiddleApiError(pathname, response.status, text);
|
|
14511
14514
|
return json ?? text;
|
|
14512
14515
|
}
|
|
14516
|
+
function previewDeployResultFromRecord(input) {
|
|
14517
|
+
const { record, id, label, framework, expiresAt, publishRecovered, publishError } = input;
|
|
14518
|
+
return {
|
|
14519
|
+
ok: true,
|
|
14520
|
+
id: String(record.id || record.preview_id || id),
|
|
14521
|
+
label,
|
|
14522
|
+
framework,
|
|
14523
|
+
preview_url: String(record.preview_url || ""),
|
|
14524
|
+
file_count: typeof record.file_count === "number" ? record.file_count : void 0,
|
|
14525
|
+
total_bytes: typeof record.total_bytes === "number" ? record.total_bytes : void 0,
|
|
14526
|
+
expires_at: expiresAt,
|
|
14527
|
+
publish_recovered: publishRecovered || void 0,
|
|
14528
|
+
publish_error: publishError,
|
|
14529
|
+
raw: record
|
|
14530
|
+
};
|
|
14531
|
+
}
|
|
14532
|
+
function canRecoverPreviewPublish(error) {
|
|
14533
|
+
return error instanceof RiddleApiError && PREVIEW_PUBLISH_RECOVERY_STATUSES.has(error.status);
|
|
14534
|
+
}
|
|
14535
|
+
async function waitForPublishedPreview(config, input) {
|
|
14536
|
+
for (let attempt = 1; attempt <= PREVIEW_PUBLISH_RECOVERY_ATTEMPTS; attempt += 1) {
|
|
14537
|
+
const status = await riddleRequestJson(config, `/v1/preview/${input.id}`);
|
|
14538
|
+
if (String(status.status || "") === "ready" && String(status.preview_url || "").trim()) {
|
|
14539
|
+
return previewDeployResultFromRecord({
|
|
14540
|
+
record: status,
|
|
14541
|
+
id: input.id,
|
|
14542
|
+
label: input.label,
|
|
14543
|
+
framework: input.framework,
|
|
14544
|
+
expiresAt: input.expiresAt,
|
|
14545
|
+
publishRecovered: true,
|
|
14546
|
+
publishError: input.publishError.message
|
|
14547
|
+
});
|
|
14548
|
+
}
|
|
14549
|
+
if (attempt < PREVIEW_PUBLISH_RECOVERY_ATTEMPTS) {
|
|
14550
|
+
await new Promise((resolve) => setTimeout(resolve, PREVIEW_PUBLISH_RECOVERY_INTERVAL_MS));
|
|
14551
|
+
}
|
|
14552
|
+
}
|
|
14553
|
+
throw input.publishError;
|
|
14554
|
+
}
|
|
14513
14555
|
async function deployRiddlePreview(config, directory, label, framework = "static") {
|
|
14514
14556
|
if (!directory?.trim()) throw new Error("directory is required");
|
|
14515
14557
|
if (!label?.trim()) throw new Error("label is required");
|
|
@@ -14536,20 +14578,22 @@ async function deployRiddlePreview(config, directory, label, framework = "static
|
|
|
14536
14578
|
} finally {
|
|
14537
14579
|
(0, import_node_fs5.rmSync)(scratch, { recursive: true, force: true });
|
|
14538
14580
|
}
|
|
14539
|
-
const
|
|
14540
|
-
|
|
14541
|
-
|
|
14542
|
-
|
|
14543
|
-
|
|
14544
|
-
|
|
14545
|
-
|
|
14546
|
-
|
|
14547
|
-
|
|
14548
|
-
|
|
14549
|
-
|
|
14550
|
-
|
|
14551
|
-
|
|
14552
|
-
|
|
14581
|
+
const expiresAt = typeof created.expires_at === "string" ? created.expires_at : void 0;
|
|
14582
|
+
try {
|
|
14583
|
+
const published = await riddleRequestJson(config, `/v1/preview/${id}/publish`, {
|
|
14584
|
+
method: "POST"
|
|
14585
|
+
});
|
|
14586
|
+
return previewDeployResultFromRecord({ record: published, id, label, framework, expiresAt });
|
|
14587
|
+
} catch (error) {
|
|
14588
|
+
if (!canRecoverPreviewPublish(error)) throw error;
|
|
14589
|
+
return waitForPublishedPreview(config, {
|
|
14590
|
+
id,
|
|
14591
|
+
label,
|
|
14592
|
+
framework,
|
|
14593
|
+
expiresAt,
|
|
14594
|
+
publishError: error
|
|
14595
|
+
});
|
|
14596
|
+
}
|
|
14553
14597
|
}
|
|
14554
14598
|
async function deployRiddleStaticPreview(config, directory, label) {
|
|
14555
14599
|
return deployRiddlePreview(config, directory, label, "static");
|
package/dist/index.js
CHANGED
|
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
292
292
|
blocking?: boolean;
|
|
293
293
|
details?: Record<string, unknown>;
|
|
294
294
|
ok: boolean;
|
|
295
|
-
action: "
|
|
295
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
296
296
|
state_path: string;
|
|
297
297
|
stage: any;
|
|
298
298
|
summary: string;
|
|
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
382
382
|
continueWithStage?: WorkflowStage | null;
|
|
383
383
|
blocking?: boolean;
|
|
384
384
|
details?: Record<string, unknown>;
|
|
385
|
-
action: "
|
|
385
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
386
386
|
state_path: string;
|
|
387
387
|
stage: any;
|
|
388
388
|
checkpoint: string;
|
|
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
659
659
|
error?: undefined;
|
|
660
660
|
} | {
|
|
661
661
|
ok: boolean;
|
|
662
|
-
action: "
|
|
662
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
663
663
|
state_path: string;
|
|
664
664
|
stage: any;
|
|
665
665
|
summary: string;
|
|
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
292
292
|
blocking?: boolean;
|
|
293
293
|
details?: Record<string, unknown>;
|
|
294
294
|
ok: boolean;
|
|
295
|
-
action: "
|
|
295
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
296
296
|
state_path: string;
|
|
297
297
|
stage: any;
|
|
298
298
|
summary: string;
|
|
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
382
382
|
continueWithStage?: WorkflowStage | null;
|
|
383
383
|
blocking?: boolean;
|
|
384
384
|
details?: Record<string, unknown>;
|
|
385
|
-
action: "
|
|
385
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
386
386
|
state_path: string;
|
|
387
387
|
stage: any;
|
|
388
388
|
checkpoint: string;
|
|
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
659
659
|
error?: undefined;
|
|
660
660
|
} | {
|
|
661
661
|
ok: boolean;
|
|
662
|
-
action: "
|
|
662
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
663
663
|
state_path: string;
|
|
664
664
|
stage: any;
|
|
665
665
|
summary: string;
|
package/dist/riddle-client.cjs
CHANGED
|
@@ -60,6 +60,9 @@ var RiddleApiError = class extends Error {
|
|
|
60
60
|
this.path = pathname;
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
+
var PREVIEW_PUBLISH_RECOVERY_STATUSES = /* @__PURE__ */ new Set([408, 429, 500, 502, 503, 504]);
|
|
64
|
+
var PREVIEW_PUBLISH_RECOVERY_ATTEMPTS = 30;
|
|
65
|
+
var PREVIEW_PUBLISH_RECOVERY_INTERVAL_MS = 2e3;
|
|
63
66
|
function normalizeBaseUrl(value) {
|
|
64
67
|
return (value || DEFAULT_RIDDLE_API_BASE_URL).replace(/\/$/, "");
|
|
65
68
|
}
|
|
@@ -94,6 +97,45 @@ async function riddleRequestJson(config, pathname, init = {}) {
|
|
|
94
97
|
if (!response.ok) throw new RiddleApiError(pathname, response.status, text);
|
|
95
98
|
return json ?? text;
|
|
96
99
|
}
|
|
100
|
+
function previewDeployResultFromRecord(input) {
|
|
101
|
+
const { record, id, label, framework, expiresAt, publishRecovered, publishError } = input;
|
|
102
|
+
return {
|
|
103
|
+
ok: true,
|
|
104
|
+
id: String(record.id || record.preview_id || id),
|
|
105
|
+
label,
|
|
106
|
+
framework,
|
|
107
|
+
preview_url: String(record.preview_url || ""),
|
|
108
|
+
file_count: typeof record.file_count === "number" ? record.file_count : void 0,
|
|
109
|
+
total_bytes: typeof record.total_bytes === "number" ? record.total_bytes : void 0,
|
|
110
|
+
expires_at: expiresAt,
|
|
111
|
+
publish_recovered: publishRecovered || void 0,
|
|
112
|
+
publish_error: publishError,
|
|
113
|
+
raw: record
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function canRecoverPreviewPublish(error) {
|
|
117
|
+
return error instanceof RiddleApiError && PREVIEW_PUBLISH_RECOVERY_STATUSES.has(error.status);
|
|
118
|
+
}
|
|
119
|
+
async function waitForPublishedPreview(config, input) {
|
|
120
|
+
for (let attempt = 1; attempt <= PREVIEW_PUBLISH_RECOVERY_ATTEMPTS; attempt += 1) {
|
|
121
|
+
const status = await riddleRequestJson(config, `/v1/preview/${input.id}`);
|
|
122
|
+
if (String(status.status || "") === "ready" && String(status.preview_url || "").trim()) {
|
|
123
|
+
return previewDeployResultFromRecord({
|
|
124
|
+
record: status,
|
|
125
|
+
id: input.id,
|
|
126
|
+
label: input.label,
|
|
127
|
+
framework: input.framework,
|
|
128
|
+
expiresAt: input.expiresAt,
|
|
129
|
+
publishRecovered: true,
|
|
130
|
+
publishError: input.publishError.message
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
if (attempt < PREVIEW_PUBLISH_RECOVERY_ATTEMPTS) {
|
|
134
|
+
await new Promise((resolve) => setTimeout(resolve, PREVIEW_PUBLISH_RECOVERY_INTERVAL_MS));
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
throw input.publishError;
|
|
138
|
+
}
|
|
97
139
|
async function deployRiddlePreview(config, directory, label, framework = "static") {
|
|
98
140
|
if (!directory?.trim()) throw new Error("directory is required");
|
|
99
141
|
if (!label?.trim()) throw new Error("label is required");
|
|
@@ -120,20 +162,22 @@ async function deployRiddlePreview(config, directory, label, framework = "static
|
|
|
120
162
|
} finally {
|
|
121
163
|
(0, import_node_fs.rmSync)(scratch, { recursive: true, force: true });
|
|
122
164
|
}
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
165
|
+
const expiresAt = typeof created.expires_at === "string" ? created.expires_at : void 0;
|
|
166
|
+
try {
|
|
167
|
+
const published = await riddleRequestJson(config, `/v1/preview/${id}/publish`, {
|
|
168
|
+
method: "POST"
|
|
169
|
+
});
|
|
170
|
+
return previewDeployResultFromRecord({ record: published, id, label, framework, expiresAt });
|
|
171
|
+
} catch (error) {
|
|
172
|
+
if (!canRecoverPreviewPublish(error)) throw error;
|
|
173
|
+
return waitForPublishedPreview(config, {
|
|
174
|
+
id,
|
|
175
|
+
label,
|
|
176
|
+
framework,
|
|
177
|
+
expiresAt,
|
|
178
|
+
publishError: error
|
|
179
|
+
});
|
|
180
|
+
}
|
|
137
181
|
}
|
|
138
182
|
async function deployRiddleStaticPreview(config, directory, label) {
|
|
139
183
|
return deployRiddlePreview(config, directory, label, "static");
|
package/dist/riddle-client.d.cts
CHANGED
package/dist/riddle-client.d.ts
CHANGED
package/dist/riddle-client.js
CHANGED