@clickraft/cli 0.1.0 → 0.1.2
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/CHANGELOG.md +6 -0
- package/dist/cli.js +22 -14
- package/dist/cli.js.map +1 -1
- package/dist/index.js +22 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [0.1.2](https://github.com/clickraft/cli/compare/v0.1.1...v0.1.2) (2026-05-22)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **tokens:** align tokens list schema with server (camelCase + envelope) ([#7](https://github.com/clickraft/cli/issues/7)) ([9a16093](https://github.com/clickraft/cli/commit/9a16093edeb2f468fc3b4a339d3dc5d337d06606))
|
|
6
|
+
|
|
1
7
|
# Changelog
|
|
2
8
|
|
|
3
9
|
All notable changes to the Clickraft CLI are documented here.
|
package/dist/cli.js
CHANGED
|
@@ -923,7 +923,7 @@ var DeviceAuthorizationRequestSchema = z4.object({
|
|
|
923
923
|
});
|
|
924
924
|
var DeviceAuthorizationResponseSchema = z4.object({
|
|
925
925
|
device_code: z4.string(),
|
|
926
|
-
user_code: z4.string().
|
|
926
|
+
user_code: z4.string().min(1),
|
|
927
927
|
verification_uri: z4.string().url(),
|
|
928
928
|
verification_uri_complete: z4.string().url().optional(),
|
|
929
929
|
expires_in: z4.number().int().positive(),
|
|
@@ -1740,9 +1740,14 @@ async function requestDeviceAuthorization(opts) {
|
|
|
1740
1740
|
const parsed = parseJson(text, "authorization");
|
|
1741
1741
|
const validated = DeviceAuthorizationResponseSchema.safeParse(parsed);
|
|
1742
1742
|
if (!validated.success) {
|
|
1743
|
-
throw new
|
|
1744
|
-
"
|
|
1745
|
-
"Authorization endpoint response
|
|
1743
|
+
throw new ApiError(
|
|
1744
|
+
"SCHEMA_MISMATCH",
|
|
1745
|
+
"Authorization endpoint response did not match the expected schema.",
|
|
1746
|
+
{
|
|
1747
|
+
status: resp.statusCode,
|
|
1748
|
+
retryable: false,
|
|
1749
|
+
redactedBody: redactTokenLikeFields(truncate(text))
|
|
1750
|
+
},
|
|
1746
1751
|
validated.error
|
|
1747
1752
|
);
|
|
1748
1753
|
}
|
|
@@ -2143,16 +2148,19 @@ function inspectTelemetry(options = {}) {
|
|
|
2143
2148
|
// src/commands/tokens/list.ts
|
|
2144
2149
|
import { z as z6 } from "zod";
|
|
2145
2150
|
var TokenRowSchema = z6.object({
|
|
2146
|
-
id: z6.string(),
|
|
2147
|
-
|
|
2151
|
+
id: z6.string().uuid(),
|
|
2152
|
+
organizationId: z6.string().uuid(),
|
|
2153
|
+
userId: z6.string().uuid(),
|
|
2154
|
+
clientId: z6.string(),
|
|
2155
|
+
tokenPrefix: z6.string(),
|
|
2148
2156
|
name: z6.string().nullable(),
|
|
2149
2157
|
scopes: z6.array(z6.string()),
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2158
|
+
lastUsedAt: z6.string().nullable(),
|
|
2159
|
+
expiresAt: z6.string(),
|
|
2160
|
+
createdAt: z6.string()
|
|
2153
2161
|
}).strict();
|
|
2154
2162
|
var TokensListResponseSchema = z6.object({
|
|
2155
|
-
|
|
2163
|
+
tokens: z6.array(TokenRowSchema)
|
|
2156
2164
|
}).strict();
|
|
2157
2165
|
async function listTokens(options) {
|
|
2158
2166
|
const config = await loadConfig({
|
|
@@ -2170,7 +2178,7 @@ async function listTokens(options) {
|
|
|
2170
2178
|
responseSchema: TokensListResponseSchema,
|
|
2171
2179
|
signal: options.signal
|
|
2172
2180
|
});
|
|
2173
|
-
return data.
|
|
2181
|
+
return data.tokens;
|
|
2174
2182
|
}
|
|
2175
2183
|
|
|
2176
2184
|
// src/errors/format.ts
|
|
@@ -2474,11 +2482,11 @@ function renderTokensList(rows, out) {
|
|
|
2474
2482
|
}
|
|
2475
2483
|
const headers = ["PREFIX", "NAME", "SCOPES", "LAST USED", "EXPIRES"];
|
|
2476
2484
|
const data = rows.map((row) => [
|
|
2477
|
-
row.
|
|
2485
|
+
row.tokenPrefix,
|
|
2478
2486
|
row.name ?? "\u2014",
|
|
2479
2487
|
row.scopes.join(",") || "\u2014",
|
|
2480
|
-
row.
|
|
2481
|
-
row.
|
|
2488
|
+
row.lastUsedAt ?? "never",
|
|
2489
|
+
row.expiresAt
|
|
2482
2490
|
]);
|
|
2483
2491
|
const widths = headers.map(
|
|
2484
2492
|
(header, i) => Math.max(header.length, ...data.map((cells) => cells[i].length))
|