@contrail/cli 3.6.0-alpha-8-alpha.de819d3 → 3.6.0-alpha-8-alpha.fb40acc
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/README.md
CHANGED
|
@@ -17,7 +17,7 @@ $ npm install -g @contrail/cli
|
|
|
17
17
|
$ contrail COMMAND
|
|
18
18
|
running command...
|
|
19
19
|
$ contrail (--version)
|
|
20
|
-
@contrail/cli/3.6.0-alpha-8-alpha.
|
|
20
|
+
@contrail/cli/3.6.0-alpha-8-alpha.fb40acc linux-x64 node-v24.21.0
|
|
21
21
|
$ contrail --help [COMMAND]
|
|
22
22
|
USAGE
|
|
23
23
|
$ contrail COMMAND
|
package/dist/auth/login.js
CHANGED
|
@@ -161,7 +161,7 @@ async function refreshCurrentUserOrg() {
|
|
|
161
161
|
const currentUser = await (0, sdk_1.getCurrentUser)().catch((e) => {
|
|
162
162
|
console.error('error getting current user', e.message);
|
|
163
163
|
if (isExpiredTokenError(e)) {
|
|
164
|
-
console.
|
|
164
|
+
console.error('access token expired; attempting refresh');
|
|
165
165
|
return;
|
|
166
166
|
}
|
|
167
167
|
throw e;
|
|
@@ -176,7 +176,8 @@ async function refreshCurrentUserOrg() {
|
|
|
176
176
|
apiGateway: config.apiGateway,
|
|
177
177
|
orgSlug: config.orgSlug,
|
|
178
178
|
};
|
|
179
|
-
|
|
179
|
+
(0, sdk_1.setConfig)(sdk_1.Auth.config);
|
|
180
|
+
console.error('fetched new access token from refresh token');
|
|
180
181
|
}
|
|
181
182
|
catch (e) {
|
|
182
183
|
throw Error(`Could not get refresh token: ${e}`);
|
|
@@ -215,9 +216,11 @@ async function requestRefreshedAccessToken(vibeRefreshToken, apiGateway) {
|
|
|
215
216
|
},
|
|
216
217
|
body: JSON.stringify({ refreshToken: vibeRefreshToken }),
|
|
217
218
|
});
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
219
|
+
const data = await response.json();
|
|
220
|
+
if (!response.ok || !data.accessToken) {
|
|
221
|
+
throw new Error(`jwt_refresh returned ${response.status} with no access token`);
|
|
222
|
+
}
|
|
223
|
+
return data.accessToken;
|
|
221
224
|
}
|
|
222
225
|
function getVersionFromPackageJson() {
|
|
223
226
|
// Get the path to the package.json file
|
|
@@ -35,7 +35,7 @@ class GetAPIKeyApp extends basecommand_1.BaseCommand {
|
|
|
35
35
|
},
|
|
36
36
|
];
|
|
37
37
|
const answers = await inquirer_1.default.prompt(questions);
|
|
38
|
-
|
|
38
|
+
this.log(`App API key: (app:${answers.appApiKey})`);
|
|
39
39
|
}
|
|
40
40
|
else {
|
|
41
41
|
const appFound = installedApps.find((x) => x.app.identifier === this.flags.appIdentifier);
|
|
@@ -43,7 +43,7 @@ class GetAPIKeyApp extends basecommand_1.BaseCommand {
|
|
|
43
43
|
logger_1.default.info('You do not have such an app installed');
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
this.log(`App API key: (app:${appFound.apiKey.apiKey})`);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -224,8 +224,9 @@ async function find(entityName, options = {}) {
|
|
|
224
224
|
queryOptions.customParams = { propertySlugs: propertySlugs.join(',') };
|
|
225
225
|
}
|
|
226
226
|
const payload = id ? { id, ...queryOptions } : { criteria, ...queryOptions };
|
|
227
|
-
// a suffix names a specific sub-route
|
|
228
|
-
|
|
227
|
+
// a suffix names a specific sub-route and an id names one entity; both always go
|
|
228
|
+
// through the plain client (batch-fetch only understands criteria)
|
|
229
|
+
if ((0, batchFetch_1.canBatchFetchEntity)(entityName) && !suffix && !id) {
|
|
229
230
|
return (0, batchFetch_1.batchFetch)(entityName, payload);
|
|
230
231
|
}
|
|
231
232
|
else {
|
package/oclif.manifest.json
CHANGED