convex
Version:
Client for the Convex Cloud
29 lines (28 loc) • 822 B
JavaScript
;
import chalk from "chalk";
import { bigBrainAPI } from "./utils.js";
export async function getUrlAndAdminKey(ctx, projectSlug, teamSlug, deploymentType) {
const authorizeArgs = {
projectSlug,
teamSlug,
deploymentType
};
const data = await bigBrainAPI(
ctx,
"POST",
"deployment/authorize",
authorizeArgs
);
const adminKey = data.adminKey;
const url = data.url;
if (adminKey === void 0 || url === void 0) {
const msg = "Unknown error during authorization: " + JSON.stringify(data);
console.error(chalk.red(msg));
return await ctx.fatalError(1, "network", new Error(msg));
}
return { adminKey, url };
}
export async function getDevDeployment(ctx, args) {
return await bigBrainAPI(ctx, "PUT", "dev_deployment", args);
}
//# sourceMappingURL=api.js.map