@krak-stack/auth 0.1.56 → 0.1.58
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/dist/access.d.ts +93 -0
- package/dist/access.js +97 -0
- package/dist/admin/api.group.d.ts +7 -0
- package/dist/admin/api.group.js +1 -1
- package/dist/admin/schema.d.ts +2 -0
- package/dist/admin/schema.js +4 -0
- package/dist/api.d.ts +23 -0
- package/dist/components/api-key-edit-form.d.ts +20 -0
- package/dist/components/api-key-edit-form.js +50 -0
- package/dist/components/api-key-rate-limit.d.ts +18 -0
- package/dist/components/api-key-rate-limit.js +29 -0
- package/dist/components/api-key-referrers.d.ts +8 -0
- package/dist/components/api-key-referrers.js +24 -0
- package/dist/components/api-key.d.ts +1 -0
- package/dist/components/api-key.js +20 -1
- package/dist/components/auth-client-api.d.ts +15 -0
- package/dist/components/auth-provider.d.ts +11 -1
- package/dist/components/auth-provider.js +29 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.js +2 -1
- package/dist/components/organization-switcher.d.ts +58 -3
- package/dist/components/organization-switcher.js +253 -70
- package/dist/components/user-button.d.ts +41 -3
- package/dist/components/user-button.js +134 -33
- package/dist/extra/api.group.d.ts +112 -103
- package/dist/extra/api.group.js +20 -1
- package/dist/extra/schema.d.ts +7 -0
- package/dist/extra/schema.js +18 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.js +1 -0
- package/dist/service.d.ts +26 -0
- package/package.json +5 -1
|
@@ -5,22 +5,26 @@ import {} from "@tanstack/react-table";
|
|
|
5
5
|
import { useNavigate, useRouterState, } from "@tanstack/react-router";
|
|
6
6
|
import { Effect, Schema } from "effect";
|
|
7
7
|
import { AsyncResult, Atom } from "effect/unstable/reactivity";
|
|
8
|
-
import {
|
|
8
|
+
import { ArrowLeft, Building2, KeyRound, Loader2, LogOutIcon, Pencil, Plus, ShieldCheck, StopCircle, Trash2, UserCircleIcon, Users, UserIcon, } from "lucide-react";
|
|
9
9
|
import { QRCode } from "react-qr-code";
|
|
10
10
|
import { createContext, useContext, useRef, useState, } from "react";
|
|
11
11
|
import { DataTable } from "@/components/ui/data-table";
|
|
12
12
|
import { AppBrand } from "@/components/ui/app-brand";
|
|
13
|
-
import { effectFormMessages, ImageField, SubmitButton, SubmitError, TextField, } from "@/components/ui/effect-form";
|
|
13
|
+
import { effectFormMessages, ImageField, SubmitButton, SubmitError, TextAreaField, TextField, } from "@/components/ui/effect-form";
|
|
14
14
|
import { Badge } from "@/components/ui/badge";
|
|
15
15
|
import { Button } from "@/components/ui/button";
|
|
16
16
|
import { Checkbox } from "@/components/ui/checkbox";
|
|
17
|
+
import { CopyButton } from "@/components/ui/copy-button";
|
|
17
18
|
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "@/components/ui/dialog";
|
|
18
19
|
import { Field, FieldContent, FieldDescription, FieldGroup, FieldLabel, FieldLegend, FieldSet, } from "@/components/ui/field";
|
|
19
20
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu";
|
|
20
21
|
import { Separator } from "@/components/ui/separator";
|
|
21
22
|
import { authClientApi } from "./auth-client-api";
|
|
22
23
|
import { useKrakstackAuth } from "./auth-provider";
|
|
23
|
-
import { createApiKey } from "./api-key";
|
|
24
|
+
import { createApiKey, parseApiKeyReferrers } from "./api-key";
|
|
25
|
+
import { ApiKeyEditForm } from "./api-key-edit-form";
|
|
26
|
+
import { ApiKeyRateLimit, apiKeyUsagePercent } from "./api-key-rate-limit";
|
|
27
|
+
import { ApiKeyReferrers } from "./api-key-referrers";
|
|
24
28
|
import { useOpenedOnce } from "./hooks";
|
|
25
29
|
import { ExtraUploadedAsset } from "../extra/schema";
|
|
26
30
|
import { assetPath, assetUrl } from "./utils";
|
|
@@ -28,7 +32,6 @@ import { AdminOrganizationsTable } from "./admin-organizations";
|
|
|
28
32
|
import { AdminUsersTable } from "./admin-users";
|
|
29
33
|
const messages = {
|
|
30
34
|
en: {
|
|
31
|
-
api_key_rate_limit_notice: "API keys are subject to the same rate limits as your account.",
|
|
32
35
|
table_empty: "No results.",
|
|
33
36
|
user_account_cancel: "Cancel",
|
|
34
37
|
user_account_confirm_revoke: "Revoke account",
|
|
@@ -60,18 +63,38 @@ const messages = {
|
|
|
60
63
|
user_accounts_title: "Accounts",
|
|
61
64
|
user_api_key_copied: "Copied",
|
|
62
65
|
user_api_key_copy: "Copy",
|
|
66
|
+
user_api_key_back: "Back",
|
|
67
|
+
user_api_key_create_description: "Configure a new API key for your user account.",
|
|
63
68
|
user_api_key_create_error: "Could not create the API key.",
|
|
69
|
+
user_api_key_create_title: "Create API key",
|
|
64
70
|
user_api_key_created_description: "Copy this key now. You will not be able to see it again.",
|
|
65
71
|
user_api_key_created_title: "API key created",
|
|
66
72
|
user_api_key_delete_error: "Could not delete the API key.",
|
|
67
73
|
user_api_key_disabled: "Disabled",
|
|
74
|
+
user_api_key_edit_description: "Update the key name, status, and allowed referrers.",
|
|
75
|
+
user_api_key_edit_title: "Edit API key",
|
|
68
76
|
user_api_key_enabled: "Enabled",
|
|
69
77
|
user_api_key_hidden: "Secret hidden",
|
|
70
78
|
user_api_key_name: "Key name",
|
|
71
79
|
user_api_key_no_permissions: "No permissions",
|
|
72
80
|
user_api_key_permissions: "Permissions",
|
|
73
81
|
user_api_key_permissions_description: "Choose the permissions this API key should receive.",
|
|
82
|
+
user_api_key_rate_limit: "Rate limit",
|
|
83
|
+
user_api_key_referrers: "Allowed referrers (optional)",
|
|
84
|
+
user_api_key_referrers_any: "Any referrer",
|
|
85
|
+
user_api_key_referrers_column: "Referrers",
|
|
86
|
+
user_api_key_referrers_description: "Enter any number of URLs, separated by commas or new lines. Leave empty to allow any referrer.",
|
|
87
|
+
user_api_key_referrers_error: "{referrer} is not a valid HTTP(S) URL.",
|
|
88
|
+
user_api_key_referrers_placeholder: "https://app.example.com\nhttps://admin.example.com",
|
|
74
89
|
user_api_key_status: "Status",
|
|
90
|
+
user_api_key_unlimited: "Unlimited",
|
|
91
|
+
user_api_key_update_error: "Could not update the API key.",
|
|
92
|
+
user_api_key_usage: "API key usage",
|
|
93
|
+
user_api_key_window_days: "{count}d",
|
|
94
|
+
user_api_key_window_hours: "{count}h",
|
|
95
|
+
user_api_key_window_minutes: "{count}m",
|
|
96
|
+
user_api_key_window_none: "None",
|
|
97
|
+
user_api_key_window_seconds: "{count}s",
|
|
75
98
|
user_api_keys_description: "Create and manage API keys for your user account.",
|
|
76
99
|
user_api_keys_export_file_name: "api-keys.csv",
|
|
77
100
|
user_api_keys_load_error: "Could not load API keys.",
|
|
@@ -116,7 +139,6 @@ const messages = {
|
|
|
116
139
|
user_two_factor_verify_error: "Could not verify the code.",
|
|
117
140
|
},
|
|
118
141
|
fr: {
|
|
119
|
-
api_key_rate_limit_notice: "Les clés API sont soumises aux mêmes limites de débit que votre compte.",
|
|
120
142
|
table_empty: "Aucun résultat.",
|
|
121
143
|
user_account_cancel: "Annuler",
|
|
122
144
|
user_account_confirm_revoke: "Révoquer le compte",
|
|
@@ -148,18 +170,38 @@ const messages = {
|
|
|
148
170
|
user_accounts_title: "Comptes",
|
|
149
171
|
user_api_key_copied: "Copié",
|
|
150
172
|
user_api_key_copy: "Copier",
|
|
173
|
+
user_api_key_back: "Retour",
|
|
174
|
+
user_api_key_create_description: "Configurez une nouvelle clé API pour votre compte utilisateur.",
|
|
151
175
|
user_api_key_create_error: "Impossible de créer la clé API.",
|
|
176
|
+
user_api_key_create_title: "Créer une clé API",
|
|
152
177
|
user_api_key_created_description: "Copiez cette clé maintenant. Vous ne pourrez plus la voir.",
|
|
153
178
|
user_api_key_created_title: "Clé API créée",
|
|
154
179
|
user_api_key_delete_error: "Impossible de supprimer la clé API.",
|
|
155
180
|
user_api_key_disabled: "Désactivée",
|
|
181
|
+
user_api_key_edit_description: "Mettez à jour le nom, le statut et les référents autorisés de la clé.",
|
|
182
|
+
user_api_key_edit_title: "Modifier la clé API",
|
|
156
183
|
user_api_key_enabled: "Activée",
|
|
157
184
|
user_api_key_hidden: "Secret masqué",
|
|
158
185
|
user_api_key_name: "Nom de la clé",
|
|
159
186
|
user_api_key_no_permissions: "Aucune autorisation",
|
|
160
187
|
user_api_key_permissions: "Autorisations",
|
|
161
188
|
user_api_key_permissions_description: "Choisissez les autorisations que cette clé API doit recevoir.",
|
|
189
|
+
user_api_key_rate_limit: "Limite de débit",
|
|
190
|
+
user_api_key_referrers: "Référents autorisés (facultatifs)",
|
|
191
|
+
user_api_key_referrers_any: "Tout référent",
|
|
192
|
+
user_api_key_referrers_column: "Référents",
|
|
193
|
+
user_api_key_referrers_description: "Saisissez autant d'URL que nécessaire, séparées par des virgules ou des sauts de ligne. Laissez vide pour autoriser tout référent.",
|
|
194
|
+
user_api_key_referrers_error: "{referrer} n'est pas une URL HTTP(S) valide.",
|
|
195
|
+
user_api_key_referrers_placeholder: "https://app.example.com\nhttps://admin.example.com",
|
|
162
196
|
user_api_key_status: "Statut",
|
|
197
|
+
user_api_key_unlimited: "Illimitée",
|
|
198
|
+
user_api_key_update_error: "Impossible de mettre à jour la clé API.",
|
|
199
|
+
user_api_key_usage: "Utilisation de la clé API",
|
|
200
|
+
user_api_key_window_days: "{count} j",
|
|
201
|
+
user_api_key_window_hours: "{count} h",
|
|
202
|
+
user_api_key_window_minutes: "{count} min",
|
|
203
|
+
user_api_key_window_none: "Aucune",
|
|
204
|
+
user_api_key_window_seconds: "{count} s",
|
|
163
205
|
user_api_keys_description: "Créez et gérez des clés API pour votre compte utilisateur.",
|
|
164
206
|
user_api_keys_export_file_name: "cles-api.csv",
|
|
165
207
|
user_api_keys_load_error: "Impossible de charger les clés API.",
|
|
@@ -237,7 +279,9 @@ const userFormBuilder = FormBuilder.empty
|
|
|
237
279
|
.addField("name", Schema.NonEmptyString)
|
|
238
280
|
.addField("image", Schema.UndefinedOr(Schema.NullOr(Schema.Union([Schema.String, Schema.instanceOf(File)]))));
|
|
239
281
|
const totpCodeFormBuilder = FormBuilder.empty.addField("code", Schema.NonEmptyString);
|
|
240
|
-
const apiKeyFormBuilder = FormBuilder.empty
|
|
282
|
+
const apiKeyFormBuilder = FormBuilder.empty
|
|
283
|
+
.addField("name", Schema.NonEmptyString)
|
|
284
|
+
.addField("referrers", Schema.String);
|
|
241
285
|
const isFile = (value) => value instanceof File;
|
|
242
286
|
const decodeUploadedAsset = Schema.decodeUnknownPromise(ExtraUploadedAsset);
|
|
243
287
|
const uploadUserImageAsset = async (file, m, uploadUserImage) => {
|
|
@@ -374,7 +418,7 @@ export const UserButton = ({ authClient: providedAuthClient, baseUrl, signOutRed
|
|
|
374
418
|
};
|
|
375
419
|
return (_jsxs(UserButtonMessagesContext.Provider, { value: m, children: [hideTrigger ? null : (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { render: _jsxs(Button, { variant: "outline", size: "icon", children: [displayImage ? (_jsx("img", { src: displayImage, alt: displayName || displayEmail, className: "size-full rounded-md object-cover" })) : (_jsx(UserIcon, { className: "size-4.5" })), _jsx("span", { className: "sr-only", children: m.user_button_aria_label() })] }) }), _jsx(DropdownMenuContent, { className: "w-56 rounded-lg", side: side, align: "end", sideOffset: 4, children: _jsxs(DropdownMenuGroup, { children: [isImpersonating ? (_jsx("div", { className: "px-1 py-0.5", children: _jsx(Badge, { variant: "secondary", className: "text-xs font-normal", children: m.user_button_impersonating() }) })) : null, _jsx(DropdownMenuLabel, { className: "p-0 font-normal", children: _jsx(AppBrand, { to: null, label: displayName || displayEmail, subtitle: displayName ? displayEmail : m.user_button_account(), icon: UserIcon, className: "px-1 py-1.5 text-left text-sm", ...(displayImage ? { imageSrc: displayImage } : {}) }) }), _jsx(DropdownMenuSeparator, {}), canManageUserSettings ? (_jsxs(_Fragment, { children: [_jsxs(DropdownMenuItem, { disabled: isPending, onClick: () => setSettingsDialog("account"), children: [_jsx(UserCircleIcon, {}), m.user_button_account()] }), _jsxs(DropdownMenuItem, { onClick: () => setSettingsDialog("security"), children: [_jsx(ShieldCheck, {}), m.user_button_security()] }), _jsxs(DropdownMenuItem, { onClick: () => setSettingsDialog("apiKeys"), children: [_jsx(KeyRound, {}), m.user_button_api_keys()] }), _jsx(DropdownMenuSeparator, {})] })) : null, (isAdmin && canUseAdminSettings) || isImpersonating ? (_jsxs(_Fragment, { children: [isAdmin && canUseAdminSettings ? (_jsxs(_Fragment, { children: [_jsxs(DropdownMenuItem, { onClick: () => setSettingsDialog("adminUsers"), children: [_jsx(Users, {}), m.user_button_admin_users()] }), _jsxs(DropdownMenuItem, { onClick: () => setSettingsDialog("adminOrganizations"), children: [_jsx(Building2, {}), m.user_button_admin_organizations()] })] })) : null, isImpersonating ? (_jsxs(DropdownMenuItem, { disabled: isStoppingImpersonation, onClick: stopImpersonating, children: [_jsx(StopCircle, {}), m.user_button_stop_impersonating()] })) : null, _jsx(DropdownMenuSeparator, {})] })) : null, _jsxs(DropdownMenuItem, { onClick: signOut, children: [_jsx(LogOutIcon, {}), m.user_button_logout()] })] }) })] })), _jsx(Dialog, { open: canManageUserSettings && settingsDialog === "account", onOpenChange: (open) => {
|
|
376
420
|
setSettingsDialog((current) => open ? "account" : current === "account" ? null : current);
|
|
377
|
-
}, children: _jsxs(DialogContent, { className: "max-h-[85vh] overflow-y-auto sm:max-w-3xl", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { className: "text-2xl", children: m.user_form_title() }), _jsx(DialogDescription, { children: m.user_form_description() })] }), _jsx(Separator, {}), isPending ? (_jsx("p", { className: "text-muted-foreground text-sm", children: m.user_loading() })) : (_jsxs("div", { className: "flex flex-col gap-6", children: [_jsx(UserForm, { defaultValues: {
|
|
421
|
+
}, children: _jsxs(DialogContent, { className: "max-h-[85vh] min-w-0 overflow-x-hidden overflow-y-auto sm:max-w-3xl", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { className: "text-2xl", children: m.user_form_title() }), _jsx(DialogDescription, { children: m.user_form_description() })] }), _jsx(Separator, {}), isPending ? (_jsx("p", { className: "text-muted-foreground text-sm", children: m.user_loading() })) : (_jsxs("div", { className: "flex flex-col gap-6", children: [_jsx(UserForm, { defaultValues: {
|
|
378
422
|
name: displayName ?? "",
|
|
379
423
|
image: displayImage || null,
|
|
380
424
|
}, error: formError, onSubmit: async (data) => {
|
|
@@ -390,7 +434,7 @@ export const UserButton = ({ authClient: providedAuthClient, baseUrl, signOutRed
|
|
|
390
434
|
setSettingsDialog((current) => open ? "security" : current === "security" ? null : current);
|
|
391
435
|
}, children: _jsxs(DialogContent, { className: "max-h-[85vh] overflow-y-auto sm:max-w-3xl", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { className: "text-2xl", children: m.user_security_title() }), _jsx(DialogDescription, { children: m.user_security_description() })] }), _jsx(Separator, {}), _jsxs("div", { className: "flex flex-col gap-6", children: [_jsx(PasswordSettings, { authClient: authClient, baseUrl: baseUrl, accountCache: accountCache }), _jsx(Separator, {}), _jsx(AccountSecuritySettings, { authClient: authClient, accountCache: accountCache })] })] }) }), _jsx(Dialog, { open: canManageUserSettings && settingsDialog === "apiKeys", onOpenChange: (open) => {
|
|
392
436
|
setSettingsDialog((current) => open ? "apiKeys" : current === "apiKeys" ? null : current);
|
|
393
|
-
}, children:
|
|
437
|
+
}, children: _jsx(DialogContent, { className: "max-h-[85vh] min-w-0 overflow-x-hidden overflow-y-auto sm:max-w-3xl", children: _jsx(ApiKeyManager, { authClient: authClient, active: settingsDialog === "apiKeys", permissions: apiKeyPermissions ?? auth?.access?.userApiKeyPermissions ?? {} }) }) }), isAdmin ? (_jsxs(_Fragment, { children: [_jsx(Dialog, { open: settingsDialog === "adminUsers", onOpenChange: (open) => {
|
|
394
438
|
setSettingsDialog((current) => open ? "adminUsers" : current === "adminUsers" ? null : current);
|
|
395
439
|
}, children: _jsxs(DialogContent, { className: "flex h-[85vh] flex-col overflow-y-auto sm:max-w-6xl", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { className: "text-2xl", children: m.user_button_admin_users() }), _jsx(DialogDescription, { children: m.user_button_admin_users_description() })] }), _jsx(Separator, {}), _jsx("div", { className: "min-h-0 flex-1", children: _jsx(AdminUsersTable, {}) })] }) }), _jsx(Dialog, { open: settingsDialog === "adminOrganizations", onOpenChange: (open) => {
|
|
396
440
|
setSettingsDialog((current) => open
|
|
@@ -716,7 +760,8 @@ function ApiKeyManager({ authClient, active, permissions = {}, }) {
|
|
|
716
760
|
const keysResult = useAtomValue(keysAtom);
|
|
717
761
|
const refreshKeys = useAtomRefresh(keysAtom);
|
|
718
762
|
const [createdKey, setCreatedKey] = useState(null);
|
|
719
|
-
const [
|
|
763
|
+
const [creating, setCreating] = useState(false);
|
|
764
|
+
const [editingKey, setEditingKey] = useState(null);
|
|
720
765
|
const [error, setError] = useState(null);
|
|
721
766
|
const permissionOptions = getPermissionOptions(permissions);
|
|
722
767
|
const [selectedPermissions, setSelectedPermissions] = useState({});
|
|
@@ -736,16 +781,16 @@ function ApiKeyManager({ authClient, active, permissions = {}, }) {
|
|
|
736
781
|
permissionOptionsRef.current = permissionOptions;
|
|
737
782
|
selectedPermissionsRef.current = selectedPermissions;
|
|
738
783
|
const [createForm] = useState(() => FormReact.make(apiKeyFormBuilder, {
|
|
739
|
-
fields: { name: TextField },
|
|
784
|
+
fields: { name: TextField, referrers: TextAreaField },
|
|
740
785
|
mode: { validation: "onSubmit" },
|
|
741
786
|
onSubmit: (_, { decoded }) => Effect.tryPromise({
|
|
742
787
|
try: async () => {
|
|
743
788
|
setCreatedKey(null);
|
|
744
|
-
setCopiedKey(false);
|
|
745
789
|
const created = await createApiKey({
|
|
746
790
|
configId: "user",
|
|
747
791
|
name: decoded.name.trim(),
|
|
748
792
|
permissions: getSelectedPermissionObject(permissionOptionsRef.current, selectedPermissionsRef.current),
|
|
793
|
+
referrers: parseApiKeyReferrers(decoded.referrers, m.user_api_key_referrers_error()),
|
|
749
794
|
}, m.user_api_key_create_error());
|
|
750
795
|
setCreatedKey(created.key);
|
|
751
796
|
resetCreateForm();
|
|
@@ -763,13 +808,6 @@ function ApiKeyManager({ authClient, active, permissions = {}, }) {
|
|
|
763
808
|
const togglePermission = (id, checked) => {
|
|
764
809
|
setSelectedPermissions((current) => ({ ...current, [id]: checked }));
|
|
765
810
|
};
|
|
766
|
-
const copyCreatedKey = async () => {
|
|
767
|
-
if (!createdKey)
|
|
768
|
-
return;
|
|
769
|
-
await navigator.clipboard.writeText(createdKey);
|
|
770
|
-
setCopiedKey(true);
|
|
771
|
-
window.setTimeout(() => setCopiedKey(false), 2000);
|
|
772
|
-
};
|
|
773
811
|
const deleteKey = async (key) => {
|
|
774
812
|
const result = await authClient.apiKey.delete({
|
|
775
813
|
configId: "user",
|
|
@@ -781,20 +819,57 @@ function ApiKeyManager({ authClient, active, permissions = {}, }) {
|
|
|
781
819
|
}
|
|
782
820
|
refreshKeys();
|
|
783
821
|
};
|
|
784
|
-
return (_jsxs(
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
822
|
+
return (_jsxs(_Fragment, { children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { className: "text-2xl", children: editingKey
|
|
823
|
+
? m.user_api_key_edit_title()
|
|
824
|
+
: createdKey
|
|
825
|
+
? m.user_api_key_created_title()
|
|
826
|
+
: creating
|
|
827
|
+
? m.user_api_key_create_title()
|
|
828
|
+
: m.user_api_keys_title() }), _jsx(DialogDescription, { children: editingKey
|
|
829
|
+
? m.user_api_key_edit_description()
|
|
830
|
+
: createdKey
|
|
831
|
+
? m.user_api_key_created_description()
|
|
832
|
+
: creating
|
|
833
|
+
? m.user_api_key_create_description()
|
|
834
|
+
: m.user_api_keys_description() }), creating || editingKey ? (_jsxs(Button, { className: "mt-2 w-fit", onClick: () => {
|
|
835
|
+
setCreating(false);
|
|
836
|
+
setCreatedKey(null);
|
|
837
|
+
setEditingKey(null);
|
|
838
|
+
}, type: "button", variant: "secondary", children: [_jsx(ArrowLeft, {}), m.user_api_key_back()] })) : (_jsxs(Button, { className: "mt-2 w-fit", onClick: () => {
|
|
839
|
+
setCreatedKey(null);
|
|
840
|
+
setCreating(true);
|
|
841
|
+
}, type: "button", children: [_jsx(Plus, {}), m.user_api_key_create_title()] }))] }), _jsx(Separator, {}), _jsxs("div", { className: "flex min-w-0 flex-col gap-5", children: [creating && !createdKey ? (_jsx("section", { className: "w-full", children: _jsx(createForm.Initialize, { defaultValues: { name: "", referrers: "" }, children: _jsxs("form", { className: "flex flex-col gap-4", onSubmit: (event) => {
|
|
842
|
+
event.preventDefault();
|
|
843
|
+
event.stopPropagation();
|
|
844
|
+
submitCreateForm();
|
|
845
|
+
}, children: [_jsx(createForm.name, { label: m.user_api_key_name(), required: true }), _jsx(createForm.referrers, { label: m.user_api_key_referrers(), description: m.user_api_key_referrers_description(), placeholder: m.user_api_key_referrers_placeholder(), rows: 3 }), permissionOptions.length > 0 ? (_jsxs(FieldSet, { children: [_jsx(FieldLegend, { children: m.user_api_key_permissions() }), _jsx(FieldDescription, { children: m.user_api_key_permissions_description() }), _jsx(FieldGroup, { "data-slot": "checkbox-group", className: "gap-3", children: permissionOptions.map((permission) => (_jsxs(Field, { orientation: "horizontal", children: [_jsx(Checkbox, { id: permission.id, checked: selectedPermissions[permission.id] ?? false, onCheckedChange: (checked) => togglePermission(permission.id, checked) }), _jsx(FieldContent, { children: _jsx(FieldLabel, { htmlFor: permission.id, children: permission.id }) })] }, permission.id))) })] })) : null, _jsx(SubmitError, { result: createSubmitResult }), _jsx(SubmitButton, { form: createForm })] }) }) })) : null, creating && createdKey ? (_jsx("div", { className: "flex min-w-0 flex-col gap-3", children: _jsxs("div", { className: "bg-muted/50 flex min-w-0 items-center justify-between gap-3 rounded-md border px-3 py-2", children: [_jsx("code", { className: "block min-w-0 flex-1 overflow-x-auto text-sm whitespace-nowrap", children: createdKey }), _jsx(CopyButton, { className: "shrink-0", messages: {
|
|
846
|
+
copied: m.user_api_key_copied(),
|
|
847
|
+
copy: m.user_api_key_copy(),
|
|
848
|
+
}, value: createdKey, variant: "ghost" })] }) })) : null, !creating && !editingKey && keysError ? (_jsx("p", { className: "text-destructive text-sm", children: keysError })) : null, !creating && !editingKey && error ? (_jsx("p", { className: "text-destructive text-sm", children: error })) : null, !creating && !editingKey ? (_jsx("div", { className: "max-w-full min-w-0 overflow-x-hidden", children: _jsx(DataTable, { columns: apiKeyColumns({ m }), data: keys, features: {
|
|
849
|
+
export: { baseName: m.user_api_keys_export_file_name() },
|
|
850
|
+
gallery: false,
|
|
851
|
+
rowActions: {
|
|
852
|
+
items: apiKeyRowActions({
|
|
853
|
+
m,
|
|
854
|
+
onDelete: deleteKey,
|
|
855
|
+
onEdit: (key) => setEditingKey(key),
|
|
856
|
+
}),
|
|
857
|
+
},
|
|
858
|
+
}, searchState: "local", state: {
|
|
859
|
+
empty: loading ? m.user_loading() : m.table_empty(),
|
|
860
|
+
loading,
|
|
861
|
+
} }) })) : null, editingKey ? (_jsx(ApiKeyEditForm, { authClient: authClient, configId: "user", keyData: editingKey, messages: {
|
|
862
|
+
enabled: m.user_api_key_enabled(),
|
|
863
|
+
name: m.user_api_key_name(),
|
|
864
|
+
referrers: m.user_api_key_referrers(),
|
|
865
|
+
referrersDescription: m.user_api_key_referrers_description(),
|
|
866
|
+
referrersError: m.user_api_key_referrers_error(),
|
|
867
|
+
referrersPlaceholder: m.user_api_key_referrers_placeholder(),
|
|
868
|
+
updateError: m.user_api_key_update_error(),
|
|
869
|
+
}, onSaved: () => {
|
|
870
|
+
refreshKeys();
|
|
871
|
+
setEditingKey(null);
|
|
872
|
+
} }, editingKey.id)) : null] })] }));
|
|
798
873
|
}
|
|
799
874
|
const apiKeyColumns = ({ m, }) => [
|
|
800
875
|
{
|
|
@@ -809,6 +884,27 @@ const apiKeyColumns = ({ m, }) => [
|
|
|
809
884
|
? m.user_api_key_enabled()
|
|
810
885
|
: m.user_api_key_disabled() })),
|
|
811
886
|
},
|
|
887
|
+
{
|
|
888
|
+
id: "referrers",
|
|
889
|
+
accessorFn: (keyData) => keyData.metadata,
|
|
890
|
+
header: m.user_api_key_referrers_column(),
|
|
891
|
+
cell: ({ row }) => (_jsx(ApiKeyReferrers, { metadata: row.original.metadata, unrestrictedLabel: m.user_api_key_referrers_any() })),
|
|
892
|
+
},
|
|
893
|
+
{
|
|
894
|
+
id: "rateLimit",
|
|
895
|
+
accessorFn: apiKeyUsagePercent,
|
|
896
|
+
header: m.user_api_key_rate_limit(),
|
|
897
|
+
cell: ({ row }) => (_jsx(ApiKeyRateLimit, { keyData: row.original, messages: {
|
|
898
|
+
disabled: m.user_api_key_disabled(),
|
|
899
|
+
none: m.user_api_key_window_none(),
|
|
900
|
+
unlimited: m.user_api_key_unlimited(),
|
|
901
|
+
usage: m.user_api_key_usage(),
|
|
902
|
+
windowDays: (count) => m.user_api_key_window_days({ count }),
|
|
903
|
+
windowHours: (count) => m.user_api_key_window_hours({ count }),
|
|
904
|
+
windowMinutes: (count) => m.user_api_key_window_minutes({ count }),
|
|
905
|
+
windowSeconds: (count) => m.user_api_key_window_seconds({ count }),
|
|
906
|
+
} })),
|
|
907
|
+
},
|
|
812
908
|
{
|
|
813
909
|
accessorKey: "permissions",
|
|
814
910
|
header: m.user_api_key_permissions(),
|
|
@@ -821,7 +917,12 @@ const apiKeyColumns = ({ m, }) => [
|
|
|
821
917
|
},
|
|
822
918
|
},
|
|
823
919
|
];
|
|
824
|
-
const apiKeyRowActions = ({ m, onDelete, }) => [
|
|
920
|
+
const apiKeyRowActions = ({ m, onDelete, onEdit, }) => [
|
|
921
|
+
{
|
|
922
|
+
name: m.user_api_key_edit_title(),
|
|
923
|
+
icon: _jsx(Pencil, {}),
|
|
924
|
+
onClick: onEdit,
|
|
925
|
+
},
|
|
825
926
|
{
|
|
826
927
|
name: m.user_delete(),
|
|
827
928
|
icon: _jsx(Trash2, {}),
|
|
@@ -1,121 +1,130 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
1
2
|
import { HttpApiEndpoint, HttpApiError, HttpApiGroup } from "effect/unstable/httpapi";
|
|
2
3
|
import { ExtraBadRequest } from "./schema";
|
|
3
4
|
export * from "./schema";
|
|
4
5
|
export type { Organization, OrganizationMetadata } from "../schema";
|
|
5
|
-
export declare const ExtraApiGroup: HttpApiGroup.HttpApiGroup<"authExtra", HttpApiEndpoint.HttpApiEndpoint<"createApiKey", "POST", "/auth/create-api-key", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<
|
|
6
|
-
readonly configId:
|
|
7
|
-
readonly name:
|
|
8
|
-
readonly organizationId:
|
|
9
|
-
readonly permissions:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
readonly
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
readonly
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
readonly
|
|
19
|
-
readonly
|
|
20
|
-
readonly
|
|
21
|
-
readonly
|
|
22
|
-
readonly
|
|
23
|
-
|
|
24
|
-
readonly
|
|
25
|
-
|
|
26
|
-
readonly
|
|
6
|
+
export declare const ExtraApiGroup: HttpApiGroup.HttpApiGroup<"authExtra", HttpApiEndpoint.HttpApiEndpoint<"createApiKey", "POST", "/auth/create-api-key", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
7
|
+
readonly configId: Schema.Union<readonly [Schema.Literal<"user">, Schema.Literal<"organization">, Schema.Literal<"service">]>;
|
|
8
|
+
readonly name: Schema.optional<Schema.NonEmptyString>;
|
|
9
|
+
readonly organizationId: Schema.optional<Schema.String>;
|
|
10
|
+
readonly permissions: Schema.optional<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>;
|
|
11
|
+
readonly referrers: Schema.optional<Schema.$Array<Schema.String>>;
|
|
12
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
13
|
+
readonly id: Schema.String;
|
|
14
|
+
readonly key: Schema.String;
|
|
15
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getOrganizationPublicProfile", "GET", "/auth/organization-profile", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
16
|
+
readonly organizationId: Schema.String;
|
|
17
|
+
readonly locale: Schema.optional<Schema.Union<readonly [Schema.Literal<"en">, Schema.Literal<"fr">]>>;
|
|
18
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
19
|
+
readonly id: Schema.String;
|
|
20
|
+
readonly name: Schema.String;
|
|
21
|
+
readonly slug: Schema.String;
|
|
22
|
+
readonly displayName: Schema.String;
|
|
23
|
+
readonly contactEmail: Schema.NullOr<Schema.String>;
|
|
24
|
+
readonly emails: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
25
|
+
readonly email: Schema.NonEmptyString;
|
|
26
|
+
readonly translations: Schema.$Array<Schema.Struct<{
|
|
27
|
+
readonly locale: Schema.Union<readonly [Schema.Literal<"en">, Schema.Literal<"fr">]>;
|
|
28
|
+
readonly label: Schema.NonEmptyString;
|
|
27
29
|
}>>;
|
|
28
30
|
}>>>;
|
|
29
|
-
readonly phones:
|
|
30
|
-
readonly number:
|
|
31
|
-
readonly extension:
|
|
32
|
-
readonly translations:
|
|
33
|
-
readonly locale:
|
|
34
|
-
readonly label:
|
|
31
|
+
readonly phones: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
32
|
+
readonly number: Schema.NonEmptyString;
|
|
33
|
+
readonly extension: Schema.optional<Schema.String>;
|
|
34
|
+
readonly translations: Schema.$Array<Schema.Struct<{
|
|
35
|
+
readonly locale: Schema.Union<readonly [Schema.Literal<"en">, Schema.Literal<"fr">]>;
|
|
36
|
+
readonly label: Schema.NonEmptyString;
|
|
35
37
|
}>>;
|
|
36
38
|
}>>>;
|
|
37
|
-
readonly websites:
|
|
38
|
-
readonly url:
|
|
39
|
-
readonly translations:
|
|
40
|
-
readonly locale:
|
|
41
|
-
readonly label:
|
|
39
|
+
readonly websites: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
40
|
+
readonly url: Schema.NonEmptyString;
|
|
41
|
+
readonly translations: Schema.$Array<Schema.Struct<{
|
|
42
|
+
readonly locale: Schema.Union<readonly [Schema.Literal<"en">, Schema.Literal<"fr">]>;
|
|
43
|
+
readonly label: Schema.NonEmptyString;
|
|
42
44
|
}>>;
|
|
43
45
|
}>>>;
|
|
44
|
-
readonly socials:
|
|
45
|
-
readonly platform:
|
|
46
|
-
readonly url:
|
|
47
|
-
readonly translations:
|
|
48
|
-
readonly locale:
|
|
49
|
-
readonly label:
|
|
46
|
+
readonly socials: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
47
|
+
readonly platform: Schema.Literals<readonly ["facebook", "github", "instagram", "linkedin", "tiktok", "x", "youtube"]>;
|
|
48
|
+
readonly url: Schema.NonEmptyString;
|
|
49
|
+
readonly translations: Schema.$Array<Schema.Struct<{
|
|
50
|
+
readonly locale: Schema.Union<readonly [Schema.Literal<"en">, Schema.Literal<"fr">]>;
|
|
51
|
+
readonly label: Schema.NonEmptyString;
|
|
50
52
|
}>>;
|
|
51
53
|
}>>>;
|
|
52
|
-
readonly addresses:
|
|
53
|
-
readonly streetAddress:
|
|
54
|
-
readonly locality:
|
|
55
|
-
readonly region:
|
|
56
|
-
readonly postalCode:
|
|
57
|
-
readonly country:
|
|
58
|
-
readonly translations:
|
|
59
|
-
readonly locale:
|
|
60
|
-
readonly label:
|
|
54
|
+
readonly addresses: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
55
|
+
readonly streetAddress: Schema.optional<Schema.String>;
|
|
56
|
+
readonly locality: Schema.optional<Schema.String>;
|
|
57
|
+
readonly region: Schema.optional<Schema.String>;
|
|
58
|
+
readonly postalCode: Schema.optional<Schema.String>;
|
|
59
|
+
readonly country: Schema.optional<Schema.String>;
|
|
60
|
+
readonly translations: Schema.$Array<Schema.Struct<{
|
|
61
|
+
readonly locale: Schema.Union<readonly [Schema.Literal<"en">, Schema.Literal<"fr">]>;
|
|
62
|
+
readonly label: Schema.NonEmptyString;
|
|
61
63
|
}>>;
|
|
62
|
-
readonly formatted:
|
|
64
|
+
readonly formatted: Schema.String;
|
|
63
65
|
}>>>;
|
|
64
|
-
readonly logo:
|
|
65
|
-
readonly icon:
|
|
66
|
-
}>>, HttpApiEndpoint.Json<typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getProjectPublicConfig", "GET", "/auth/project-config", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<
|
|
67
|
-
readonly projectId:
|
|
68
|
-
readonly clientId:
|
|
69
|
-
readonly host:
|
|
70
|
-
readonly rootHost:
|
|
71
|
-
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<
|
|
72
|
-
readonly projectKey:
|
|
73
|
-
readonly name:
|
|
74
|
-
readonly logoUrl:
|
|
75
|
-
readonly authDomain:
|
|
76
|
-
readonly rootDomain:
|
|
77
|
-
readonly themeCss:
|
|
78
|
-
readonly authOptions:
|
|
79
|
-
readonly emailPassword:
|
|
80
|
-
readonly emailOtp:
|
|
81
|
-
readonly google:
|
|
82
|
-
readonly signUp:
|
|
83
|
-
readonly signUpName:
|
|
66
|
+
readonly logo: Schema.NullOr<Schema.String>;
|
|
67
|
+
readonly icon: Schema.NullOr<Schema.String>;
|
|
68
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getProjectPublicConfig", "GET", "/auth/project-config", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
69
|
+
readonly projectId: Schema.optional<Schema.String>;
|
|
70
|
+
readonly clientId: Schema.optional<Schema.String>;
|
|
71
|
+
readonly host: Schema.optional<Schema.String>;
|
|
72
|
+
readonly rootHost: Schema.optional<Schema.String>;
|
|
73
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
74
|
+
readonly projectKey: Schema.String;
|
|
75
|
+
readonly name: Schema.NullOr<Schema.String>;
|
|
76
|
+
readonly logoUrl: Schema.NullOr<Schema.String>;
|
|
77
|
+
readonly authDomain: Schema.NullOr<Schema.String>;
|
|
78
|
+
readonly rootDomain: Schema.NullOr<Schema.String>;
|
|
79
|
+
readonly themeCss: Schema.NullOr<Schema.String>;
|
|
80
|
+
readonly authOptions: Schema.Struct<{
|
|
81
|
+
readonly emailPassword: Schema.Boolean;
|
|
82
|
+
readonly emailOtp: Schema.Boolean;
|
|
83
|
+
readonly google: Schema.Boolean;
|
|
84
|
+
readonly signUp: Schema.Boolean;
|
|
85
|
+
readonly signUpName: Schema.Boolean;
|
|
84
86
|
}>;
|
|
85
|
-
}>>, HttpApiEndpoint.Json<typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"setPassword", "POST", "/auth/set-password", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<
|
|
86
|
-
readonly newPassword:
|
|
87
|
-
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<
|
|
88
|
-
readonly ok:
|
|
89
|
-
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"
|
|
90
|
-
readonly
|
|
91
|
-
}
|
|
92
|
-
readonly
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
readonly
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
readonly
|
|
100
|
-
|
|
101
|
-
|
|
87
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"setPassword", "POST", "/auth/set-password", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
88
|
+
readonly newPassword: Schema.NonEmptyString;
|
|
89
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
90
|
+
readonly ok: Schema.Boolean;
|
|
91
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"updateApiKeyPermissions", "PATCH", "/auth/api-key/:keyId/permissions", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
92
|
+
readonly keyId: Schema.NonEmptyString;
|
|
93
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
94
|
+
readonly configId: Schema.Union<readonly [Schema.Literal<"user">, Schema.Literal<"organization">, Schema.Literal<"service">]>;
|
|
95
|
+
readonly permissions: Schema.$Record<Schema.String, Schema.$Array<Schema.String>>;
|
|
96
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
97
|
+
readonly ok: Schema.Boolean;
|
|
98
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"uploadUserImage", "POST", "/auth/image/upload", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/unstable/httpapi/HttpApiSchema").asMultipartStream<Schema.Struct<{
|
|
99
|
+
readonly file: Schema.decodeTo<import("effect/unstable/http/Multipart").PersistedFileSchema, Schema.$Array<import("effect/unstable/http/Multipart").PersistedFileSchema>, never, never>;
|
|
100
|
+
}>>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
101
|
+
readonly url: Schema.String;
|
|
102
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"verifyApiKey", "POST", "/auth/verify-api-key", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
103
|
+
readonly key: Schema.NonEmptyString;
|
|
104
|
+
readonly configId: Schema.optional<Schema.Union<readonly [Schema.Literal<"user">, Schema.Literal<"organization">, Schema.Literal<"service">]>>;
|
|
105
|
+
readonly permissions: Schema.optional<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>;
|
|
106
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
107
|
+
readonly valid: Schema.Boolean;
|
|
108
|
+
readonly error: Schema.NullOr<Schema.Struct<{
|
|
109
|
+
readonly message: Schema.String;
|
|
110
|
+
readonly code: Schema.String;
|
|
102
111
|
}>>;
|
|
103
|
-
readonly key:
|
|
104
|
-
readonly id:
|
|
105
|
-
readonly configId:
|
|
106
|
-
readonly name:
|
|
107
|
-
readonly start:
|
|
108
|
-
readonly prefix:
|
|
109
|
-
readonly referenceId:
|
|
110
|
-
readonly enabled:
|
|
111
|
-
readonly expiresAt:
|
|
112
|
-
readonly createdAt:
|
|
113
|
-
readonly updatedAt:
|
|
114
|
-
readonly permissions:
|
|
115
|
-
readonly metadata:
|
|
112
|
+
readonly key: Schema.NullOr<Schema.Struct<{
|
|
113
|
+
readonly id: Schema.String;
|
|
114
|
+
readonly configId: Schema.String;
|
|
115
|
+
readonly name: Schema.NullOr<Schema.String>;
|
|
116
|
+
readonly start: Schema.NullOr<Schema.String>;
|
|
117
|
+
readonly prefix: Schema.NullOr<Schema.String>;
|
|
118
|
+
readonly referenceId: Schema.String;
|
|
119
|
+
readonly enabled: Schema.NullOr<Schema.Boolean>;
|
|
120
|
+
readonly expiresAt: Schema.NullOr<Schema.Date>;
|
|
121
|
+
readonly createdAt: Schema.Date;
|
|
122
|
+
readonly updatedAt: Schema.Date;
|
|
123
|
+
readonly permissions: Schema.NullOr<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>;
|
|
124
|
+
readonly metadata: Schema.NullOr<Schema.Unknown>;
|
|
116
125
|
}>>;
|
|
117
|
-
}>>, HttpApiEndpoint.Json<typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"verifyPassword", "POST", "/auth/verify-password", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<
|
|
118
|
-
readonly password:
|
|
119
|
-
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<
|
|
120
|
-
readonly ok:
|
|
126
|
+
}>>, HttpApiEndpoint.Json<typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"verifyPassword", "POST", "/auth/verify-password", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
127
|
+
readonly password: Schema.NonEmptyString;
|
|
128
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
129
|
+
readonly ok: Schema.Boolean;
|
|
121
130
|
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof ExtraBadRequest>, never, never>, false>;
|