bitfab-cli 0.2.434 → 0.2.436
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/index.js +18 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -29231,21 +29231,22 @@ var saveSimPlan = {
|
|
|
29231
29231
|
})).min(1).max(500)).describe("Nodes to change (1-500). `name` is the span name; `captureContent` false stops recording that span's inputs and outputs and does the same for every node beneath it, true records them again for that node only.")
|
|
29232
29232
|
}
|
|
29233
29233
|
};
|
|
29234
|
-
var
|
|
29234
|
+
var scenarioTargetSchema = {
|
|
29235
|
+
traceId: external_exports.uuid().optional().describe("ID of a trace whose scenario to use. Send this or scenarioId, not both."),
|
|
29236
|
+
scenarioId: external_exports.uuid().optional().describe("ID of the scenario, as get_scenario prints it. Send this or traceId, not both.")
|
|
29237
|
+
};
|
|
29235
29238
|
var getScenario = {
|
|
29236
29239
|
name: "get_scenario",
|
|
29237
29240
|
title: "Get Scenario",
|
|
29238
|
-
description: "Read
|
|
29239
|
-
inputSchema:
|
|
29240
|
-
traceId: scenarioTraceIdSchema
|
|
29241
|
-
}
|
|
29241
|
+
description: "Read one scenario, found by its id or by a trace it was built from: the situation the trace function's run was in, as the trigger that started the run and the data available when it arrived, with a name and a description. It describes the situation only, never what the run did or should do. Returns the trigger and data summaries, then the name, description, trigger, and data as JSON in exactly the shape save_scenario accepts. Call it before save_scenario so an edit starts from what is saved.",
|
|
29242
|
+
inputSchema: scenarioTargetSchema
|
|
29242
29243
|
};
|
|
29243
29244
|
var saveScenario = {
|
|
29244
29245
|
name: "save_scenario",
|
|
29245
29246
|
title: "Save Scenario",
|
|
29246
|
-
description: "Update
|
|
29247
|
+
description: "Update one scenario, found by its id or by a trace it was built from, for example to add history the run had available, record data it was missing, or correct the trigger. name, description, trigger, and data each replace the saved value whole, and fields left out are kept. To add to the data without resending it, use appendData instead of data: its history entries go after the saved ones and its missing items after the saved missing items, in one step that cannot lose another caller's append made at the same time. Send data or appendData, not both. trigger, data, and appendData entries must keep the shape get_scenario returns. A history entry's source names the span its text came from, on any trace linked to the scenario (a trace that finds it by traceId is one); set it to null or leave it out when the text is not in such a trace, and the entry still counts as data the run had but cannot be cited as evidence when the scenario is turned into assertions. A source naming a span on any other trace is refused. The trigger and data summaries are rebuilt from what is saved. It only updates a scenario that already exists; a trace with no scenario, or a scenario id that does not exist, is refused. Returns the saved scenario.",
|
|
29247
29248
|
inputSchema: {
|
|
29248
|
-
|
|
29249
|
+
...scenarioTargetSchema,
|
|
29249
29250
|
name: external_exports.string().min(1).optional().describe("The scenario's name."),
|
|
29250
29251
|
description: external_exports.string().min(1).optional().describe("The scenario's description."),
|
|
29251
29252
|
trigger: external_exports.preprocess(parseJsonString, external_exports.record(external_exports.string(), external_exports.unknown())).optional().describe("The whole trigger object, in the shape get_scenario returns: what started the run."),
|
|
@@ -31273,6 +31274,13 @@ Run ${platform2.loginHint} to re-authenticate.`);
|
|
|
31273
31274
|
}
|
|
31274
31275
|
|
|
31275
31276
|
// ../bitfab-plugin-lib/dist/commands/switchOrg.js
|
|
31277
|
+
async function switchFailureMessage(res) {
|
|
31278
|
+
const body = await res.json().catch(() => null);
|
|
31279
|
+
if (typeof body?.error === "string") {
|
|
31280
|
+
return body.error;
|
|
31281
|
+
}
|
|
31282
|
+
return `Failed to switch organization (HTTP ${res.status})`;
|
|
31283
|
+
}
|
|
31276
31284
|
async function requestSwitch(serviceUrl, apiKey, authOrganizationId) {
|
|
31277
31285
|
const res = await fetch(`${serviceUrl}/api/plugin/organizations/switch`, {
|
|
31278
31286
|
method: "POST",
|
|
@@ -31280,13 +31288,10 @@ async function requestSwitch(serviceUrl, apiKey, authOrganizationId) {
|
|
|
31280
31288
|
Authorization: `Bearer ${apiKey}`,
|
|
31281
31289
|
"Content-Type": "application/json"
|
|
31282
31290
|
},
|
|
31283
|
-
body: JSON.stringify({
|
|
31284
|
-
authOrganizationId,
|
|
31285
|
-
clerkOrganizationId: authOrganizationId
|
|
31286
|
-
})
|
|
31291
|
+
body: JSON.stringify({ authOrganizationId })
|
|
31287
31292
|
});
|
|
31288
31293
|
if (!res.ok) {
|
|
31289
|
-
throw new Error(
|
|
31294
|
+
throw new Error(await switchFailureMessage(res));
|
|
31290
31295
|
}
|
|
31291
31296
|
return await res.json();
|
|
31292
31297
|
}
|
|
@@ -31317,7 +31322,7 @@ async function runSwitchOrg(platform2) {
|
|
|
31317
31322
|
emitJson({
|
|
31318
31323
|
event: "switched",
|
|
31319
31324
|
status: result.status,
|
|
31320
|
-
authOrganizationId: result.authOrganizationId
|
|
31325
|
+
authOrganizationId: result.authOrganizationId,
|
|
31321
31326
|
organizationName: result.organizationName,
|
|
31322
31327
|
apiKey: result.apiKey
|
|
31323
31328
|
});
|
package/package.json
CHANGED