@topgroup/diginext
Version:
A BUILD SERVER & CLI to deploy apps to any Kubernetes clusters.
37 lines (36 loc) • 1.57 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.dxJoinWorkspace = exports.dxCreateWorkspace = void 0;
const dayjs_1 = __importDefault(require("dayjs"));
const app_config_1 = require("../../app.config");
const dx_api_1 = require("./dx-api");
async function dxCreateWorkspace(params, options) {
return (0, dx_api_1.dxApi)({ url: "/workspaces", data: params, method: "POST", isDebugging: options === null || options === void 0 ? void 0 : options.isDebugging });
}
exports.dxCreateWorkspace = dxCreateWorkspace;
async function dxJoinWorkspace(email, slug, dxKey, options) {
console.log("JOIN WORKSPACE", dxKey);
if ((0, app_config_1.IsTest)())
return {
status: 1,
data: {
name: email,
slug: slug,
subscriptionId: "xxx",
createdAt: (0, dayjs_1.default)().format(),
updatedAt: (0, dayjs_1.default)().format(),
},
messages: ["Ok"],
};
return (0, dx_api_1.dxApi)({ url: "/join-workspace", data: { email, slug }, method: "POST", dxKey, isDebugging: options === null || options === void 0 ? void 0 : options.isDebugging });
}
exports.dxJoinWorkspace = dxJoinWorkspace;
// export async function dxIsOnwerWorkspace(userId: string, workspaceId: string) {
// console.log("CHECK IS OWNER WORKSPACE");
// if (IsTest()) {
// return
// }
// }