trainfabric 0.1.41 → 0.1.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/index.cjs +10 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -8925,6 +8925,7 @@ var idPatterns = {
|
|
|
8925
8925
|
supplier: /^[A-Za-z][A-Za-z0-9_-]*$/
|
|
8926
8926
|
};
|
|
8927
8927
|
var allowedBillingUnits = /* @__PURE__ */ new Set(["normalized_tflop_seconds", "reserved_gpu_seconds", "usd"]);
|
|
8928
|
+
var allowedApiKeyOwnerTypes = /* @__PURE__ */ new Set(["user", "service_account"]);
|
|
8928
8929
|
function collectRuntimeFiles(repoPath) {
|
|
8929
8930
|
const manifestFiles = /* @__PURE__ */ new Set([
|
|
8930
8931
|
"training.yaml",
|
|
@@ -9162,6 +9163,13 @@ function normalizeOptionalBillingUnit(value) {
|
|
|
9162
9163
|
}
|
|
9163
9164
|
return unit;
|
|
9164
9165
|
}
|
|
9166
|
+
function normalizeApiKeyOwnerType(value) {
|
|
9167
|
+
const ownerType = String(value ?? "").trim();
|
|
9168
|
+
if (!allowedApiKeyOwnerTypes.has(ownerType)) {
|
|
9169
|
+
throw new Error("Owner type is invalid. Use user or service_account.");
|
|
9170
|
+
}
|
|
9171
|
+
return ownerType;
|
|
9172
|
+
}
|
|
9165
9173
|
|
|
9166
9174
|
// src/run_input.ts
|
|
9167
9175
|
var BASE_MODEL_ALIASES = {
|
|
@@ -9283,7 +9291,7 @@ function buildComputeSpec(options) {
|
|
|
9283
9291
|
|
|
9284
9292
|
// src/index.ts
|
|
9285
9293
|
var DEFAULT_TRAINFABRIC_API_URL2 = "https://api.trainfabric.com";
|
|
9286
|
-
var CLI_VERSION = "0.1.
|
|
9294
|
+
var CLI_VERSION = "0.1.42";
|
|
9287
9295
|
var CONFIG_DIR = import_node_path3.default.join(import_node_os2.default.homedir(), ".trainfabric");
|
|
9288
9296
|
var CONFIG_PATH = import_node_path3.default.join(CONFIG_DIR, "config.json");
|
|
9289
9297
|
var FALLBACK_SECRET_PATH = import_node_path3.default.join(CONFIG_DIR, "session.enc");
|
|
@@ -10204,7 +10212,7 @@ program2.command("api-keys:create").requiredOption("--name <name>").option("--ow
|
|
|
10204
10212
|
const session = await createClient(config).auth.me();
|
|
10205
10213
|
const apiKey = await createClient(config).apiKeys.create({
|
|
10206
10214
|
name: normalizeHumanName(options.name, "API key name"),
|
|
10207
|
-
ownerType: options.ownerType,
|
|
10215
|
+
ownerType: normalizeApiKeyOwnerType(options.ownerType),
|
|
10208
10216
|
ownerId: options.ownerId ?? session.user.id,
|
|
10209
10217
|
scopes: parseApiKeyScopes(String(options.scopes))
|
|
10210
10218
|
});
|