@frogbotai/plugin-api-keys 0.28.0 → 0.30.0
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 +5 -6
- package/dist/client/ApiKeysManager.js +184 -21
- package/dist/client/ApiKeysManager.js.map +1 -1
- package/dist/client/styles.css +78 -76
- package/dist/client.d.ts +0 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +219 -110
- package/dist/collection.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +61 -48
- package/dist/index.js.map +1 -1
- package/dist/server/services.js +63 -28
- package/dist/server/services.js.map +1 -1
- package/dist/server/token.d.ts +1 -1
- package/dist/server/token.d.ts.map +1 -1
- package/dist/server/token.js +16 -11
- package/dist/server/token.js.map +1 -1
- package/dist/strategy.d.ts +5 -4
- package/dist/strategy.d.ts.map +1 -1
- package/dist/strategy.js +58 -29
- package/dist/strategy.js.map +1 -1
- package/package.json +7 -7
- package/dist/client/CostUSD.d.ts +0 -11
- package/dist/client/CostUSD.d.ts.map +0 -1
- package/dist/client/CostUSD.js +0 -19
- package/dist/client/CostUSD.js.map +0 -1
package/README.md
CHANGED
|
@@ -17,13 +17,13 @@ export default buildConfig({
|
|
|
17
17
|
The plugin adds an `api-keys` collection, owner-scoped management endpoints, API-key authentication, and default admin controls. `frogbot dev` generates the admin import map before starting, so the key-creation controls appear on the first load. Create a key in the API Keys admin collection, then authenticate requests with either header:
|
|
18
18
|
|
|
19
19
|
```http
|
|
20
|
-
Authorization: Bearer
|
|
21
|
-
X-API-Key:
|
|
20
|
+
Authorization: Bearer fb_...
|
|
21
|
+
X-API-Key: fb_...
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
Plaintext keys are returned only when created. The collection stores SHA-256 hashes and supports multiple independently revoked keys per user.
|
|
25
25
|
|
|
26
|
-
With AI configured, usage rows include an optional `apiKey` relationship to the authenticating key. Cookie-authenticated requests omit it, and the relationship follows `collectionSlug`.
|
|
26
|
+
A key has no budget or model limits of its own; requests use the owner's AI policy. With AI configured, usage rows include an optional `apiKey` relationship to the authenticating key. Cookie-authenticated requests omit it, and the relationship follows `collectionSlug`.
|
|
27
27
|
|
|
28
28
|
Build and start-only workflows must run `frogbot generate:importmap` after adding the plugin. Add it as a `prebuild` step when CI invokes `next build` directly. If the server console reports a component missing from the import map, run `frogbot generate:importmap` and rebuild, or restart `frogbot dev`.
|
|
29
29
|
|
|
@@ -40,15 +40,14 @@ apiKeysPlugin({
|
|
|
40
40
|
});
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
Collection overrides merge with the generated fields, access, endpoints, hooks, admin components, and transforms applied by other plugins. The manager uses
|
|
43
|
+
Collection overrides merge with the generated fields, access, endpoints, hooks, admin components, and transforms applied by other plugins. The manager uses the default admin components, and the token dialog ships a small stylesheet built on the admin theme variables.
|
|
44
44
|
|
|
45
|
-
The plugin has no role system of its own. Keys are owner-scoped
|
|
45
|
+
The plugin has no role system of its own. Keys are owner-scoped. To layer roles on top, install `@frogbotai/plugin-roles`, list it after `apiKeysPlugin()`, and pass `canRevokeAnyKey` and collection access:
|
|
46
46
|
|
|
47
47
|
```ts
|
|
48
48
|
import { allow, hasRole } from '@frogbotai/plugin-roles';
|
|
49
49
|
|
|
50
50
|
apiKeysPlugin({
|
|
51
|
-
policyAccess: allow('admin'),
|
|
52
51
|
canRevokeAnyKey: (req) => hasRole(req, 'admin', 'support'),
|
|
53
52
|
collection: {
|
|
54
53
|
access: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import './styles.css';
|
|
4
|
-
import { Button, CopyIcon, Modal, TextInput, Tooltip, useConfig, useListQuery, useModal, useRouteCache
|
|
4
|
+
import { Button, CopyIcon, Modal, TextInput, Tooltip, useConfig, useListQuery, useModal, useRouteCache } from '@payloadcms/ui';
|
|
5
5
|
import { useState } from 'react';
|
|
6
6
|
const modalSlug = 'create-api-key-modal';
|
|
7
7
|
export function ApiKeysManager() {
|
|
@@ -24,20 +24,22 @@ export function ApiKeysManager() {
|
|
|
24
24
|
}
|
|
25
25
|
function close() {
|
|
26
26
|
closeModal(modalSlug);
|
|
27
|
-
if (token)
|
|
28
|
-
clearRouteCache();
|
|
27
|
+
if (token) clearRouteCache();
|
|
29
28
|
}
|
|
30
29
|
async function createKey() {
|
|
31
|
-
if (loading || !name.trim())
|
|
32
|
-
return;
|
|
30
|
+
if (loading || !name.trim()) return;
|
|
33
31
|
setLoading(true);
|
|
34
32
|
setError(undefined);
|
|
35
33
|
const response = await fetch(`${config.routes.api}/${collectionSlug}/mint`, {
|
|
36
34
|
method: 'POST',
|
|
37
|
-
headers: {
|
|
38
|
-
|
|
35
|
+
headers: {
|
|
36
|
+
'content-type': 'application/json'
|
|
37
|
+
},
|
|
38
|
+
body: JSON.stringify({
|
|
39
|
+
name
|
|
40
|
+
})
|
|
39
41
|
});
|
|
40
|
-
const result =
|
|
42
|
+
const result = await response.json();
|
|
41
43
|
setLoading(false);
|
|
42
44
|
if (!response.ok || !result.token) {
|
|
43
45
|
setError(result.error ?? 'Unable to create API key');
|
|
@@ -46,32 +48,133 @@ export function ApiKeysManager() {
|
|
|
46
48
|
setToken(result.token);
|
|
47
49
|
}
|
|
48
50
|
async function copyToken() {
|
|
49
|
-
if (!token)
|
|
50
|
-
return;
|
|
51
|
+
if (!token) return;
|
|
51
52
|
await navigator.clipboard.writeText(token);
|
|
52
53
|
setCopied(true);
|
|
53
54
|
}
|
|
54
55
|
function copyHandlers(control) {
|
|
55
56
|
return {
|
|
56
57
|
onClick: copyToken,
|
|
57
|
-
onMouseEnter: ()
|
|
58
|
+
onMouseEnter: ()=>{
|
|
58
59
|
setHoveredControl(control);
|
|
59
60
|
setCopied(false);
|
|
60
61
|
},
|
|
61
|
-
onMouseLeave: ()
|
|
62
|
+
onMouseLeave: ()=>{
|
|
62
63
|
setHoveredControl(undefined);
|
|
63
64
|
setCopied(false);
|
|
64
|
-
}
|
|
65
|
+
}
|
|
65
66
|
};
|
|
66
67
|
}
|
|
67
|
-
return
|
|
68
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
69
|
+
children: [
|
|
70
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
71
|
+
buttonStyle: "secondary",
|
|
72
|
+
margin: false,
|
|
73
|
+
onClick: open,
|
|
74
|
+
type: "button",
|
|
75
|
+
children: "Create API key"
|
|
76
|
+
}),
|
|
77
|
+
/*#__PURE__*/ _jsx(Modal, {
|
|
78
|
+
className: "api-keys-modal",
|
|
79
|
+
closeOnBlur: true,
|
|
80
|
+
onClose: close,
|
|
81
|
+
slug: modalSlug,
|
|
82
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
83
|
+
className: "api-keys-modal__wrapper",
|
|
84
|
+
children: [
|
|
85
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
86
|
+
className: "api-keys-modal__content",
|
|
87
|
+
children: [
|
|
88
|
+
/*#__PURE__*/ _jsx("h1", {
|
|
89
|
+
children: "Create API Key"
|
|
90
|
+
}),
|
|
91
|
+
token ? /*#__PURE__*/ _jsxs(_Fragment, {
|
|
92
|
+
children: [
|
|
93
|
+
/*#__PURE__*/ _jsx("p", {
|
|
94
|
+
className: "api-keys-modal__warning",
|
|
95
|
+
role: "alert",
|
|
96
|
+
children: "Key generated! Copy it now — you won't see it again."
|
|
97
|
+
}),
|
|
98
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
99
|
+
className: "api-keys-modal__token-row",
|
|
100
|
+
children: [
|
|
101
|
+
/*#__PURE__*/ _jsxs("button", {
|
|
102
|
+
"aria-label": "Click to copy API key",
|
|
103
|
+
className: "api-keys-clear-button api-keys-modal__token",
|
|
104
|
+
type: "button",
|
|
105
|
+
...copyHandlers('token'),
|
|
106
|
+
children: [
|
|
107
|
+
/*#__PURE__*/ _jsx("code", {
|
|
108
|
+
children: token
|
|
109
|
+
}),
|
|
110
|
+
/*#__PURE__*/ _jsx(Tooltip, {
|
|
111
|
+
delay: copied ? 0 : undefined,
|
|
112
|
+
show: hoveredControl === 'token',
|
|
113
|
+
children: copied ? 'Copied' : 'Click to copy'
|
|
114
|
+
})
|
|
115
|
+
]
|
|
116
|
+
}),
|
|
117
|
+
/*#__PURE__*/ _jsxs("button", {
|
|
118
|
+
"aria-label": "Copy API key",
|
|
119
|
+
className: "api-keys-clear-button api-keys-slide-up-1 api-keys-modal__copy",
|
|
120
|
+
type: "button",
|
|
121
|
+
...copyHandlers('icon'),
|
|
122
|
+
children: [
|
|
123
|
+
/*#__PURE__*/ _jsx(CopyIcon, {}),
|
|
124
|
+
/*#__PURE__*/ _jsx(Tooltip, {
|
|
125
|
+
delay: copied ? 0 : undefined,
|
|
126
|
+
show: hoveredControl === 'icon',
|
|
127
|
+
children: copied ? 'Copied' : 'Copy'
|
|
128
|
+
})
|
|
129
|
+
]
|
|
130
|
+
})
|
|
131
|
+
]
|
|
132
|
+
})
|
|
133
|
+
]
|
|
134
|
+
}) : /*#__PURE__*/ _jsx(TextInput, {
|
|
135
|
+
label: "Key name",
|
|
136
|
+
path: "api-key-name",
|
|
137
|
+
placeholder: "Key name (e.g. My MacBook CLI)",
|
|
138
|
+
readOnly: loading,
|
|
139
|
+
value: name,
|
|
140
|
+
onChange: (event)=>setName(event.target.value),
|
|
141
|
+
onKeyDown: (event)=>{
|
|
68
142
|
if (event.key === 'Enter') {
|
|
69
143
|
event.preventDefault();
|
|
70
144
|
void createKey();
|
|
71
145
|
}
|
|
72
|
-
}
|
|
146
|
+
}
|
|
147
|
+
}),
|
|
148
|
+
error ? /*#__PURE__*/ _jsx("p", {
|
|
149
|
+
role: "alert",
|
|
150
|
+
children: error
|
|
151
|
+
}) : null
|
|
152
|
+
]
|
|
153
|
+
}),
|
|
154
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
155
|
+
className: "api-keys-modal__controls",
|
|
156
|
+
children: [
|
|
157
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
158
|
+
buttonStyle: "secondary",
|
|
159
|
+
onClick: close,
|
|
160
|
+
type: "button",
|
|
161
|
+
children: token ? 'Close' : 'Dismiss'
|
|
162
|
+
}),
|
|
163
|
+
token ? null : /*#__PURE__*/ _jsx(Button, {
|
|
164
|
+
disabled: loading || !name.trim(),
|
|
165
|
+
onClick: createKey,
|
|
166
|
+
type: "button",
|
|
167
|
+
children: loading ? 'Generating…' : 'Generate'
|
|
168
|
+
})
|
|
169
|
+
]
|
|
170
|
+
})
|
|
171
|
+
]
|
|
172
|
+
})
|
|
173
|
+
})
|
|
174
|
+
]
|
|
175
|
+
});
|
|
73
176
|
}
|
|
74
|
-
export function RevokeApiKey({ rowData
|
|
177
|
+
export function RevokeApiKey({ rowData }) {
|
|
75
178
|
const { config } = useConfig();
|
|
76
179
|
const { collectionSlug } = useListQuery();
|
|
77
180
|
const { closeModal, openModal } = useModal();
|
|
@@ -84,11 +187,11 @@ export function RevokeApiKey({ rowData, }) {
|
|
|
84
187
|
setLoading(true);
|
|
85
188
|
setError(undefined);
|
|
86
189
|
const response = await fetch(`${config.routes.api}/${collectionSlug}/${rowData.id}/revoke`, {
|
|
87
|
-
method: 'POST'
|
|
190
|
+
method: 'POST'
|
|
88
191
|
});
|
|
89
192
|
setLoading(false);
|
|
90
193
|
if (!response.ok) {
|
|
91
|
-
const result =
|
|
194
|
+
const result = await response.json();
|
|
92
195
|
setError(result.error ?? 'Unable to revoke API key');
|
|
93
196
|
return;
|
|
94
197
|
}
|
|
@@ -96,8 +199,68 @@ export function RevokeApiKey({ rowData, }) {
|
|
|
96
199
|
setRevoked(true);
|
|
97
200
|
clearRouteCache();
|
|
98
201
|
}
|
|
99
|
-
if (revoked || rowData.revokedAt)
|
|
100
|
-
|
|
101
|
-
|
|
202
|
+
if (revoked || rowData.revokedAt) return /*#__PURE__*/ _jsx("span", {
|
|
203
|
+
children: "Revoked"
|
|
204
|
+
});
|
|
205
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
206
|
+
children: [
|
|
207
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
208
|
+
margin: false,
|
|
209
|
+
buttonStyle: "secondary",
|
|
210
|
+
onClick: ()=>openModal(confirmSlug),
|
|
211
|
+
size: "small",
|
|
212
|
+
type: "button",
|
|
213
|
+
children: "Revoke"
|
|
214
|
+
}),
|
|
215
|
+
/*#__PURE__*/ _jsx(Modal, {
|
|
216
|
+
className: "api-keys-modal",
|
|
217
|
+
closeOnBlur: true,
|
|
218
|
+
onClose: ()=>closeModal(confirmSlug),
|
|
219
|
+
slug: confirmSlug,
|
|
220
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
221
|
+
className: "api-keys-modal__wrapper",
|
|
222
|
+
children: [
|
|
223
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
224
|
+
className: "api-keys-modal__content",
|
|
225
|
+
children: [
|
|
226
|
+
/*#__PURE__*/ _jsx("h1", {
|
|
227
|
+
children: "Revoke API Key"
|
|
228
|
+
}),
|
|
229
|
+
/*#__PURE__*/ _jsxs("p", {
|
|
230
|
+
children: [
|
|
231
|
+
"This will immediately disable ",
|
|
232
|
+
rowData.name ?? 'this key',
|
|
233
|
+
". Any scripts or tools using this key will stop working. This cannot be undone."
|
|
234
|
+
]
|
|
235
|
+
}),
|
|
236
|
+
error ? /*#__PURE__*/ _jsx("p", {
|
|
237
|
+
role: "alert",
|
|
238
|
+
children: error
|
|
239
|
+
}) : null
|
|
240
|
+
]
|
|
241
|
+
}),
|
|
242
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
243
|
+
className: "api-keys-modal__controls",
|
|
244
|
+
children: [
|
|
245
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
246
|
+
buttonStyle: "secondary",
|
|
247
|
+
onClick: ()=>closeModal(confirmSlug),
|
|
248
|
+
type: "button",
|
|
249
|
+
children: "Cancel"
|
|
250
|
+
}),
|
|
251
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
252
|
+
disabled: loading,
|
|
253
|
+
onClick: revoke,
|
|
254
|
+
type: "button",
|
|
255
|
+
children: loading ? 'Revoking…' : 'Revoke key'
|
|
256
|
+
})
|
|
257
|
+
]
|
|
258
|
+
})
|
|
259
|
+
]
|
|
260
|
+
})
|
|
261
|
+
})
|
|
262
|
+
]
|
|
263
|
+
});
|
|
102
264
|
}
|
|
265
|
+
|
|
103
266
|
//# sourceMappingURL=ApiKeysManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/client/ApiKeysManager.tsx"],"names":["Button","CopyIcon","Modal","TextInput","Tooltip","useConfig","useListQuery","useModal","useRouteCache","useState","modalSlug","ApiKeysManager","config","collectionSlug","closeModal","openModal","clearRouteCache","name","setName","token","setToken","error","setError","loading","setLoading","copied","setCopied","hoveredControl","setHoveredControl","open","undefined","close","createKey","trim","response","fetch","routes","api","method","headers","body","JSON","stringify","result","json","ok","copyToken","navigator","clipboard","writeText","copyHandlers","control","onClick","onMouseEnter","onMouseLeave","buttonStyle","margin","type","className","closeOnBlur","onClose","slug","div","h1","p","role","button","aria-label","code","delay","show","label","path","placeholder","readOnly","value","onChange","event","target","onKeyDown","key","preventDefault","disabled","RevokeApiKey","rowData","revoked","setRevoked","confirmSlug","id","revoke","revokedAt","span","size"],"mappings":"AAAA;;AAEA,OAAO,eAAe;AAEtB,SACEA,MAAM,EACNC,QAAQ,EACRC,KAAK,EACLC,SAAS,EACTC,OAAO,EACPC,SAAS,EACTC,YAAY,EACZC,QAAQ,EACRC,aAAa,QACR,iBAAiB;AACxB,SAA+CC,QAAQ,QAAQ,QAAQ;AAEvE,MAAMC,YAAY;AAElB,OAAO,SAASC;IACd,MAAM,EAAEC,MAAM,EAAE,GAAGP;IACnB,MAAM,EAAEQ,cAAc,EAAE,G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EN,cAAA,MAACzB;oBAAIJ,WAAU;;sCACb,MAACI;4BAAIJ,WAAU;;8CACb,KAACK;8CAAG;;8CACJ,MAACC;;wCAAE;wCAC8BoB,QAAQnE,IAAI,IAAI;wCAAW;;;gCAG3DI,sBAAQ,KAAC2C;oCAAEC,MAAK;8CAAS5C;qCAAa;;;sCAEzC,MAACyC;4BAAIJ,WAAU;;8CACb,KAAC1D;oCAAOuD,aAAY;oCAAYH,SAAS,IAAMtC,WAAWyE;oCAAc9B,MAAK;8CAAS;;8CAGtF,KAACzD;oCAAOkF,UAAU3D;oCAAS6B,SAASqC;oCAAQhC,MAAK;8CAC9ClC,UAAU,cAAc;;;;;;;;;AAOvC","file":"ApiKeysManager.js"}
|
package/dist/client/styles.css
CHANGED
|
@@ -1,89 +1,91 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
@layer frogbot {
|
|
2
|
+
.api-keys-modal {
|
|
3
|
+
align-items: center;
|
|
4
|
+
backdrop-filter: blur(8px);
|
|
5
|
+
background: color-mix(in srgb, var(--theme-elevation-0) 80%, transparent);
|
|
6
|
+
display: flex;
|
|
7
|
+
height: 100%;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
}
|
|
9
10
|
|
|
10
|
-
.api-keys-modal__wrapper {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
11
|
+
.api-keys-modal__wrapper {
|
|
12
|
+
background: var(--theme-elevation-50);
|
|
13
|
+
border: 1px solid var(--theme-elevation-150);
|
|
14
|
+
border-radius: var(--style-radius-m);
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
gap: 24px;
|
|
18
|
+
max-width: 720px;
|
|
19
|
+
padding: 32px;
|
|
20
|
+
position: relative;
|
|
21
|
+
width: min(90vw, 720px);
|
|
22
|
+
z-index: 1;
|
|
23
|
+
}
|
|
23
24
|
|
|
24
|
-
.api-keys-modal__content {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
25
|
+
.api-keys-modal__content {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
gap: 12px;
|
|
29
|
+
}
|
|
29
30
|
|
|
30
|
-
.api-keys-modal__content > * {
|
|
31
|
-
|
|
32
|
-
}
|
|
31
|
+
.api-keys-modal__content > * {
|
|
32
|
+
margin: 0;
|
|
33
|
+
}
|
|
33
34
|
|
|
34
|
-
.api-keys-modal__warning {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
35
|
+
.api-keys-modal__warning {
|
|
36
|
+
color: var(--theme-success-500);
|
|
37
|
+
font-weight: 600;
|
|
38
|
+
}
|
|
38
39
|
|
|
39
|
-
.api-keys-modal__token-row {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
40
|
+
.api-keys-modal__token-row {
|
|
41
|
+
align-items: center;
|
|
42
|
+
background: var(--theme-elevation-0);
|
|
43
|
+
border: 1px solid var(--theme-elevation-150);
|
|
44
|
+
border-radius: var(--style-radius-m);
|
|
45
|
+
display: flex;
|
|
46
|
+
gap: 8px;
|
|
47
|
+
padding: 4px 4px 4px 16px;
|
|
48
|
+
transition: border-color 200ms ease-out;
|
|
49
|
+
}
|
|
49
50
|
|
|
50
|
-
.api-keys-modal__token-row:hover {
|
|
51
|
-
|
|
52
|
-
}
|
|
51
|
+
.api-keys-modal__token-row:hover {
|
|
52
|
+
border-color: var(--theme-elevation-400);
|
|
53
|
+
}
|
|
53
54
|
|
|
54
|
-
.api-keys-modal__token {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
55
|
+
.api-keys-modal__token {
|
|
56
|
+
flex: 1;
|
|
57
|
+
overflow-wrap: anywhere;
|
|
58
|
+
padding: 8px 0;
|
|
59
|
+
position: relative;
|
|
60
|
+
text-align: left;
|
|
61
|
+
}
|
|
61
62
|
|
|
62
|
-
.api-keys-modal__copy {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
63
|
+
.api-keys-modal__copy {
|
|
64
|
+
padding: 9px;
|
|
65
|
+
position: relative;
|
|
66
|
+
}
|
|
66
67
|
|
|
67
|
-
.api-keys-modal__controls {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
68
|
+
.api-keys-modal__controls {
|
|
69
|
+
display: flex;
|
|
70
|
+
gap: 12px;
|
|
71
|
+
}
|
|
71
72
|
|
|
72
|
-
.api-keys-clear-button {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
73
|
+
.api-keys-clear-button {
|
|
74
|
+
background: none;
|
|
75
|
+
border: none;
|
|
76
|
+
box-shadow: none;
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
line-height: 1;
|
|
80
|
+
margin: 0;
|
|
81
|
+
outline: none;
|
|
82
|
+
}
|
|
82
83
|
|
|
83
|
-
.api-keys-slide-up-1 {
|
|
84
|
-
|
|
85
|
-
}
|
|
84
|
+
.api-keys-slide-up-1 {
|
|
85
|
+
transition: transform 200ms ease-out;
|
|
86
|
+
}
|
|
86
87
|
|
|
87
|
-
.api-keys-slide-up-1:hover {
|
|
88
|
-
|
|
88
|
+
.api-keys-slide-up-1:hover {
|
|
89
|
+
transform: translateY(-4px);
|
|
90
|
+
}
|
|
89
91
|
}
|
package/dist/client.d.ts
CHANGED
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC"}
|
package/dist/client.js
CHANGED
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/client.ts"],"names":["ApiKeysManager","RevokeApiKey"],"mappings":"AAAA,SAASA,cAAc,EAAEC,YAAY,QAAQ,6BAA6B","file":"client.js"}
|
package/dist/collection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../src/collection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,gBAAgB,EAIhB,cAAc,EACf,MAAM,SAAS,CAAC;AAMjB,KAAK,iBAAiB,GAAG;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACtE,UAAU,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACvC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC7B,CAAC;AAoIF,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,
|
|
1
|
+
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../src/collection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,gBAAgB,EAIhB,cAAc,EACf,MAAM,SAAS,CAAC;AAMjB,KAAK,iBAAiB,GAAG;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACtE,UAAU,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACvC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC7B,CAAC;AAoIF,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,CAsHpF"}
|