@vellumai/cli 0.12.3 → 0.12.4-staging.1
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/package.json
CHANGED
package/src/commands/restore.ts
CHANGED
|
@@ -334,7 +334,12 @@ async function restorePlatform(
|
|
|
334
334
|
);
|
|
335
335
|
|
|
336
336
|
try {
|
|
337
|
-
await rollbackPlatformAssistant(
|
|
337
|
+
await rollbackPlatformAssistant(
|
|
338
|
+
token,
|
|
339
|
+
entry.assistantId,
|
|
340
|
+
opts.version,
|
|
341
|
+
entry.runtimeUrl,
|
|
342
|
+
);
|
|
338
343
|
} catch (err) {
|
|
339
344
|
const msg = err instanceof Error ? err.message : String(err);
|
|
340
345
|
if (msg.includes("401") || msg.includes("403")) {
|
|
@@ -628,14 +633,7 @@ async function runLocalRestore(opts: {
|
|
|
628
633
|
stagedRelativePath: string | undefined;
|
|
629
634
|
bundleData: Buffer | undefined;
|
|
630
635
|
}): Promise<void> {
|
|
631
|
-
const {
|
|
632
|
-
entry,
|
|
633
|
-
name,
|
|
634
|
-
version,
|
|
635
|
-
dryRun,
|
|
636
|
-
stagedRelativePath,
|
|
637
|
-
bundleData,
|
|
638
|
-
} = opts;
|
|
636
|
+
const { entry, name, version, dryRun, stagedRelativePath, bundleData } = opts;
|
|
639
637
|
let accessToken = opts.accessToken;
|
|
640
638
|
|
|
641
639
|
if (dryRun) {
|
|
@@ -762,18 +760,15 @@ async function runLocalRestore(opts: {
|
|
|
762
760
|
accessToken,
|
|
763
761
|
stagedRelativePath,
|
|
764
762
|
)
|
|
765
|
-
: await loopbackSafeFetch(
|
|
766
|
-
|
|
767
|
-
{
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
Authorization: `Bearer ${accessToken}`,
|
|
771
|
-
"Content-Type": "application/octet-stream",
|
|
772
|
-
},
|
|
773
|
-
body: bundleData ? new Uint8Array(bundleData) : undefined,
|
|
774
|
-
signal: AbortSignal.timeout(120_000),
|
|
763
|
+
: await loopbackSafeFetch(`${entry.runtimeUrl}/v1/migrations/import`, {
|
|
764
|
+
method: "POST",
|
|
765
|
+
headers: {
|
|
766
|
+
Authorization: `Bearer ${accessToken}`,
|
|
767
|
+
"Content-Type": "application/octet-stream",
|
|
775
768
|
},
|
|
776
|
-
|
|
769
|
+
body: bundleData ? new Uint8Array(bundleData) : undefined,
|
|
770
|
+
signal: AbortSignal.timeout(120_000),
|
|
771
|
+
});
|
|
777
772
|
if (!response.ok) {
|
|
778
773
|
const body = await response.text();
|
|
779
774
|
console.error(`Error: Import failed (${response.status}): ${body}`);
|
package/src/commands/rollback.ts
CHANGED
|
@@ -156,7 +156,12 @@ async function rollbackPlatformViaEndpoint(
|
|
|
156
156
|
|
|
157
157
|
let result: { detail: string; version: string | null };
|
|
158
158
|
try {
|
|
159
|
-
result = await rollbackPlatformAssistant(
|
|
159
|
+
result = await rollbackPlatformAssistant(
|
|
160
|
+
token,
|
|
161
|
+
entry.assistantId,
|
|
162
|
+
version,
|
|
163
|
+
entry.runtimeUrl,
|
|
164
|
+
);
|
|
160
165
|
} catch (err) {
|
|
161
166
|
const detail = err instanceof Error ? err.message : String(err);
|
|
162
167
|
|
|
@@ -829,12 +829,13 @@ export async function fetchCurrentUser(
|
|
|
829
829
|
|
|
830
830
|
export async function rollbackPlatformAssistant(
|
|
831
831
|
token: string,
|
|
832
|
+
assistantId: string,
|
|
832
833
|
version?: string,
|
|
833
834
|
platformUrl?: string,
|
|
834
835
|
): Promise<{ detail: string; version: string | null }> {
|
|
835
836
|
const resolvedUrl = platformUrl || getPlatformUrl();
|
|
836
837
|
const response = await loopbackSafeFetch(
|
|
837
|
-
`${resolvedUrl}/v1/assistants/rollback/`,
|
|
838
|
+
`${resolvedUrl}/v1/assistants/${encodeURIComponent(assistantId)}/rollback/`,
|
|
838
839
|
{
|
|
839
840
|
method: "POST",
|
|
840
841
|
headers: await authHeaders(token, platformUrl),
|