trucontext 0.8.3 → 0.8.4
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/package.json +1 -1
- package/src/commands/apps.js +2 -2
- package/src/commands/billing.js +1 -2
- package/src/commands/login.js +1 -1
package/package.json
CHANGED
package/src/commands/apps.js
CHANGED
|
@@ -5,7 +5,7 @@ import { getActiveApp, setActiveApp } from '../config.js';
|
|
|
5
5
|
export async function appsCommand() {
|
|
6
6
|
try {
|
|
7
7
|
const res = await controlPlane('GET', '/apps');
|
|
8
|
-
const apps = res.data
|
|
8
|
+
const apps = Array.isArray(res.data) ? res.data : [];
|
|
9
9
|
const activeApp = getActiveApp();
|
|
10
10
|
|
|
11
11
|
if (apps.length === 0) {
|
|
@@ -27,7 +27,7 @@ export async function appsCommand() {
|
|
|
27
27
|
export async function useCommand(appId) {
|
|
28
28
|
try {
|
|
29
29
|
const res = await controlPlane('GET', '/apps');
|
|
30
|
-
const apps = res.data
|
|
30
|
+
const apps = Array.isArray(res.data) ? res.data : [];
|
|
31
31
|
const app = apps.find(a => a.appId === appId || a.name.toLowerCase() === appId.toLowerCase());
|
|
32
32
|
|
|
33
33
|
if (!app) {
|
package/src/commands/billing.js
CHANGED
|
@@ -135,8 +135,7 @@ export async function usageHistoryCommand(options) {
|
|
|
135
135
|
export async function plansCommand() {
|
|
136
136
|
try {
|
|
137
137
|
const res = await controlPlane('GET', '/billing/plans');
|
|
138
|
-
const
|
|
139
|
-
const plans = plansData.plans || [];
|
|
138
|
+
const plans = Array.isArray(res.data) ? res.data : [];
|
|
140
139
|
|
|
141
140
|
if (plans.length === 0) {
|
|
142
141
|
console.log(chalk.yellow('No plans available.'));
|
package/src/commands/login.js
CHANGED
|
@@ -96,7 +96,7 @@ export async function loginCommand(options) {
|
|
|
96
96
|
// Fetch apps and select or create one
|
|
97
97
|
try {
|
|
98
98
|
const res = await controlPlane('GET', '/apps');
|
|
99
|
-
const apps = res.data
|
|
99
|
+
const apps = Array.isArray(res.data) ? res.data : [];
|
|
100
100
|
|
|
101
101
|
if (apps.length === 1) {
|
|
102
102
|
setActiveApp(apps[0].appId);
|