@onexapis/cli 1.1.55 → 1.1.59
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/cli.js +2 -15
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +2 -15
- package/dist/cli.mjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1796,7 +1796,7 @@ function getValidCategories() {
|
|
|
1796
1796
|
var AUTH_DIR = path9__default.default.join(os__default.default.homedir(), ".onexthm");
|
|
1797
1797
|
var AUTH_FILE = path9__default.default.join(AUTH_DIR, "auth.json");
|
|
1798
1798
|
function getApiUrl() {
|
|
1799
|
-
return process.env.ONEXTHM_API_URL ||
|
|
1799
|
+
return process.env.ONEXTHM_API_URL || "https://platform-dev.onexeos.com";
|
|
1800
1800
|
}
|
|
1801
1801
|
async function saveAuthTokens(tokens) {
|
|
1802
1802
|
await fs__default.default.ensureDir(AUTH_DIR);
|
|
@@ -1823,7 +1823,7 @@ async function clearAuthTokens() {
|
|
|
1823
1823
|
}
|
|
1824
1824
|
}
|
|
1825
1825
|
function isTokenExpired(tokens) {
|
|
1826
|
-
return Date.now() / 1e3 > tokens.expiresAt -
|
|
1826
|
+
return Date.now() / 1e3 > tokens.expiresAt - 300;
|
|
1827
1827
|
}
|
|
1828
1828
|
async function getValidTokens() {
|
|
1829
1829
|
const tokens = loadAuthTokens();
|
|
@@ -4756,18 +4756,6 @@ async function publishCommand(options) {
|
|
|
4756
4756
|
process.exit(1);
|
|
4757
4757
|
}
|
|
4758
4758
|
logger.info(`Logged in as: ${tokens.user.email}`);
|
|
4759
|
-
try {
|
|
4760
|
-
const payload = JSON.parse(
|
|
4761
|
-
Buffer.from(tokens.idToken.split(".")[1], "base64").toString("utf-8")
|
|
4762
|
-
);
|
|
4763
|
-
logger.info(`[DEBUG] Token sub=${payload.sub}`);
|
|
4764
|
-
logger.info(`[DEBUG] Token company=${payload["custom:company_id"] || "(none)"}`);
|
|
4765
|
-
logger.info(`[DEBUG] Token exp=${new Date((payload.exp || 0) * 1e3).toISOString()}`);
|
|
4766
|
-
logger.info(`[DEBUG] Token iat=${new Date((payload.iat || 0) * 1e3).toISOString()}`);
|
|
4767
|
-
logger.info(`[DEBUG] API URL=${getApiUrl()}`);
|
|
4768
|
-
} catch {
|
|
4769
|
-
logger.info("[DEBUG] Could not decode token payload");
|
|
4770
|
-
}
|
|
4771
4759
|
let themePath;
|
|
4772
4760
|
if (options.theme) {
|
|
4773
4761
|
themePath = path9__default.default.resolve(options.theme);
|
|
@@ -4836,7 +4824,6 @@ async function publishCommand(options) {
|
|
|
4836
4824
|
);
|
|
4837
4825
|
const regData = await regResponse.json();
|
|
4838
4826
|
const regBody = regData.statusCode ? regData.body : regData;
|
|
4839
|
-
logger.info(`[DEBUG] Register status=${regResponse.status} body=${JSON.stringify(regBody).slice(0, 300)}`);
|
|
4840
4827
|
if (!regResponse.ok) {
|
|
4841
4828
|
const errMsg = regBody.error || regBody.message || "Registration failed";
|
|
4842
4829
|
if (!errMsg.includes("already registered")) {
|