@basaltkit/api-keys-ui 1.4.1 → 1.4.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.
Files changed (2) hide show
  1. package/dist/html.js +3 -2
  2. package/package.json +7 -7
package/dist/html.js CHANGED
@@ -53,7 +53,8 @@ document.getElementById('create').addEventListener('submit', async (e) => {
53
53
  const expiration = String(f.get('expiresAt') || '');
54
54
  const expiresAt = expiration ? new Date(expiration).getTime() : undefined;
55
55
  if (expiration && !Number.isFinite(expiresAt)) { showError('Choose a valid expiration date.'); return; }
56
- const body = JSON.stringify({ name: f.get('name'), ...(scopes.length ? { scopes } : {}), ...(expiresAt !== undefined ? { expiresAt } : {}) });
56
+ if (!scopes.length) { showError('Name at least one scope, or * for a key with every permission you have.'); return; }
57
+ const body = JSON.stringify({ name: f.get('name'), scopes, ...(expiresAt !== undefined ? { expiresAt } : {}) });
57
58
  try {
58
59
  const created = await fetch(API + '/apikeys', { ...opts, method: 'POST', body }).then(json);
59
60
  document.getElementById('error').style.display = 'none';
@@ -128,7 +129,7 @@ export function apiKeysPageHtml(options = {}) {
128
129
  <div class="card">
129
130
  <form id="create">
130
131
  <label>Name<input name="name" placeholder="CI pipeline" required /></label>
131
- <label>Scopes (comma-separated)<input name="scopes" placeholder="read, write" /></label>
132
+ <label>Scopes (comma-separated; * for every permission you have)<input name="scopes" placeholder="reports:read, invoices:write" required /></label>
132
133
  <label>Expires (optional)<input name="expiresAt" type="datetime-local" /></label>
133
134
  <button class="primary" type="submit">Create key</button>
134
135
  </form>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basaltkit/api-keys-ui",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "engines": {
5
5
  "node": ">=22.5.0"
6
6
  },
@@ -19,16 +19,16 @@
19
19
  ],
20
20
  "dependencies": {
21
21
  "@basaltkit/core": "^1.6.0",
22
- "@basaltkit/http": "^3.0.0"
22
+ "@basaltkit/http": "^3.0.1"
23
23
  },
24
24
  "devDependencies": {
25
- "@types/node": "^26.6.1",
25
+ "@types/node": "^26.6.5",
26
26
  "typescript": "^7.0.2",
27
- "vitest": "^5.0.1",
28
- "zod": "^4.6.5",
29
- "@basaltkit/auth": "^5.0.0",
27
+ "vitest": "^5.0.5",
28
+ "zod": "^4.6.7",
29
+ "@basaltkit/auth": "^5.2.0",
30
30
  "@basaltkit/fastify": "^3.0.0",
31
- "@basaltkit/tenancy": "^4.0.0",
31
+ "@basaltkit/tenancy": "^4.4.0",
32
32
  "@basaltkit/tsconfig": "^0.24.0"
33
33
  },
34
34
  "publishConfig": {