@adonis-agora/authkit-react 0.25.2 → 1.0.0-rc.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/CHANGELOG.md +678 -0
- package/README.md +29 -19
- package/build/index.d.ts +7 -18
- package/build/index.js +4 -9
- package/build/src/client/client.d.ts +12 -21
- package/build/src/client/client.js +7 -15
- package/build/src/client/types.d.ts +39 -7
- package/build/src/components/authorized_apps.js +17 -13
- package/build/src/components/last_used_badge.d.ts +288 -0
- package/build/src/components/last_used_badge.js +10 -0
- package/build/src/components/organization_profile.js +31 -39
- package/build/src/components/organization_switcher.js +25 -9
- package/build/src/components/user_profile.js +13 -7
- package/build/src/config.d.ts +0 -6
- package/build/src/config.js +0 -12
- package/build/src/hooks/use_resource.d.ts +0 -8
- package/build/src/hooks/use_resource.js +0 -22
- package/build/src/interaction/last_used.d.ts +2 -0
- package/build/src/interaction/last_used.js +5 -0
- package/build/src/queries/account/index.d.ts +11 -1
- package/build/src/queries/account/index.js +14 -0
- package/build/src/queries/admin/index.d.ts +6 -21
- package/build/src/queries/keys.d.ts +1 -0
- package/build/src/queries/keys.js +1 -0
- package/package.json +11 -10
- package/skills/authkit-react-auth/SKILL.md +39 -22
- package/styles.css +12 -0
- package/build/src/hooks/use_authorized_apps.d.ts +0 -16
- package/build/src/hooks/use_authorized_apps.js +0 -15
- package/build/src/hooks/use_org_invitations.d.ts +0 -19
- package/build/src/hooks/use_org_invitations.js +0 -20
- package/build/src/hooks/use_organization.d.ts +0 -23
- package/build/src/hooks/use_organization.js +0 -10
- package/build/src/hooks/use_organizations.d.ts +0 -18
- package/build/src/hooks/use_organizations.js +0 -14
- package/build/src/hooks/use_profile.d.ts +0 -13
- package/build/src/hooks/use_profile.js +0 -32
- package/build/src/hooks/use_sessions.d.ts +0 -16
- package/build/src/hooks/use_sessions.js +0 -15
- package/build/src/hooks/use_switch_organization.d.ts +0 -7
- package/build/src/hooks/use_switch_organization.js +0 -42
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type LastLoginMethod } from '../interaction/last_used.js';
|
|
3
|
+
export interface LastUsedBadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
lastUsed: string | null | undefined;
|
|
5
|
+
method: LastLoginMethod | readonly LastLoginMethod[];
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function LastUsedBadge({ lastUsed, method, children, className, ...rest }: LastUsedBadgeProps): import("react").DetailedReactHTMLElement<{
|
|
9
|
+
dangerouslySetInnerHTML?: {
|
|
10
|
+
__html: string | TrustedHTML;
|
|
11
|
+
} | undefined;
|
|
12
|
+
onCopy?: import("react").ClipboardEventHandler<HTMLSpanElement> | undefined;
|
|
13
|
+
onCopyCapture?: import("react").ClipboardEventHandler<HTMLSpanElement> | undefined;
|
|
14
|
+
onCut?: import("react").ClipboardEventHandler<HTMLSpanElement> | undefined;
|
|
15
|
+
onCutCapture?: import("react").ClipboardEventHandler<HTMLSpanElement> | undefined;
|
|
16
|
+
onPaste?: import("react").ClipboardEventHandler<HTMLSpanElement> | undefined;
|
|
17
|
+
onPasteCapture?: import("react").ClipboardEventHandler<HTMLSpanElement> | undefined;
|
|
18
|
+
onCompositionEnd?: import("react").CompositionEventHandler<HTMLSpanElement> | undefined;
|
|
19
|
+
onCompositionEndCapture?: import("react").CompositionEventHandler<HTMLSpanElement> | undefined;
|
|
20
|
+
onCompositionStart?: import("react").CompositionEventHandler<HTMLSpanElement> | undefined;
|
|
21
|
+
onCompositionStartCapture?: import("react").CompositionEventHandler<HTMLSpanElement> | undefined;
|
|
22
|
+
onCompositionUpdate?: import("react").CompositionEventHandler<HTMLSpanElement> | undefined;
|
|
23
|
+
onCompositionUpdateCapture?: import("react").CompositionEventHandler<HTMLSpanElement> | undefined;
|
|
24
|
+
onFocus?: import("react").FocusEventHandler<HTMLSpanElement> | undefined;
|
|
25
|
+
onFocusCapture?: import("react").FocusEventHandler<HTMLSpanElement> | undefined;
|
|
26
|
+
onBlur?: import("react").FocusEventHandler<HTMLSpanElement> | undefined;
|
|
27
|
+
onBlurCapture?: import("react").FocusEventHandler<HTMLSpanElement> | undefined;
|
|
28
|
+
onChange?: import("react").ChangeEventHandler<HTMLSpanElement, Element> | undefined;
|
|
29
|
+
onChangeCapture?: import("react").ChangeEventHandler<HTMLSpanElement, Element> | undefined;
|
|
30
|
+
onBeforeInput?: import("react").InputEventHandler<HTMLSpanElement> | undefined;
|
|
31
|
+
onBeforeInputCapture?: import("react").InputEventHandler<HTMLSpanElement> | undefined;
|
|
32
|
+
onInput?: import("react").InputEventHandler<HTMLSpanElement> | undefined;
|
|
33
|
+
onInputCapture?: import("react").InputEventHandler<HTMLSpanElement> | undefined;
|
|
34
|
+
onReset?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
35
|
+
onResetCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
36
|
+
onSubmit?: import("react").SubmitEventHandler<HTMLSpanElement> | undefined;
|
|
37
|
+
onSubmitCapture?: import("react").SubmitEventHandler<HTMLSpanElement> | undefined;
|
|
38
|
+
onInvalid?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
39
|
+
onInvalidCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
40
|
+
onLoad?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
41
|
+
onLoadCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
42
|
+
onError?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
43
|
+
onErrorCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
44
|
+
onKeyDown?: import("react").KeyboardEventHandler<HTMLSpanElement> | undefined;
|
|
45
|
+
onKeyDownCapture?: import("react").KeyboardEventHandler<HTMLSpanElement> | undefined;
|
|
46
|
+
onKeyPress?: import("react").KeyboardEventHandler<HTMLSpanElement> | undefined;
|
|
47
|
+
onKeyPressCapture?: import("react").KeyboardEventHandler<HTMLSpanElement> | undefined;
|
|
48
|
+
onKeyUp?: import("react").KeyboardEventHandler<HTMLSpanElement> | undefined;
|
|
49
|
+
onKeyUpCapture?: import("react").KeyboardEventHandler<HTMLSpanElement> | undefined;
|
|
50
|
+
onAbort?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
51
|
+
onAbortCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
52
|
+
onCanPlay?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
53
|
+
onCanPlayCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
54
|
+
onCanPlayThrough?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
55
|
+
onCanPlayThroughCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
56
|
+
onDurationChange?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
57
|
+
onDurationChangeCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
58
|
+
onEmptied?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
59
|
+
onEmptiedCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
60
|
+
onEncrypted?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
61
|
+
onEncryptedCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
62
|
+
onEnded?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
63
|
+
onEndedCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
64
|
+
onLoadedData?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
65
|
+
onLoadedDataCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
66
|
+
onLoadedMetadata?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
67
|
+
onLoadedMetadataCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
68
|
+
onLoadStart?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
69
|
+
onLoadStartCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
70
|
+
onPause?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
71
|
+
onPauseCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
72
|
+
onPlay?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
73
|
+
onPlayCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
74
|
+
onPlaying?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
75
|
+
onPlayingCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
76
|
+
onProgress?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
77
|
+
onProgressCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
78
|
+
onRateChange?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
79
|
+
onRateChangeCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
80
|
+
onSeeked?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
81
|
+
onSeekedCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
82
|
+
onSeeking?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
83
|
+
onSeekingCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
84
|
+
onStalled?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
85
|
+
onStalledCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
86
|
+
onSuspend?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
87
|
+
onSuspendCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
88
|
+
onTimeUpdate?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
89
|
+
onTimeUpdateCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
90
|
+
onVolumeChange?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
91
|
+
onVolumeChangeCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
92
|
+
onWaiting?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
93
|
+
onWaitingCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
94
|
+
onAuxClick?: import("react").MouseEventHandler<HTMLSpanElement> | undefined;
|
|
95
|
+
onAuxClickCapture?: import("react").MouseEventHandler<HTMLSpanElement> | undefined;
|
|
96
|
+
onClick?: import("react").MouseEventHandler<HTMLSpanElement> | undefined;
|
|
97
|
+
onClickCapture?: import("react").MouseEventHandler<HTMLSpanElement> | undefined;
|
|
98
|
+
onContextMenu?: import("react").MouseEventHandler<HTMLSpanElement> | undefined;
|
|
99
|
+
onContextMenuCapture?: import("react").MouseEventHandler<HTMLSpanElement> | undefined;
|
|
100
|
+
onDoubleClick?: import("react").MouseEventHandler<HTMLSpanElement> | undefined;
|
|
101
|
+
onDoubleClickCapture?: import("react").MouseEventHandler<HTMLSpanElement> | undefined;
|
|
102
|
+
onDrag?: import("react").DragEventHandler<HTMLSpanElement> | undefined;
|
|
103
|
+
onDragCapture?: import("react").DragEventHandler<HTMLSpanElement> | undefined;
|
|
104
|
+
onDragEnd?: import("react").DragEventHandler<HTMLSpanElement> | undefined;
|
|
105
|
+
onDragEndCapture?: import("react").DragEventHandler<HTMLSpanElement> | undefined;
|
|
106
|
+
onDragEnter?: import("react").DragEventHandler<HTMLSpanElement> | undefined;
|
|
107
|
+
onDragEnterCapture?: import("react").DragEventHandler<HTMLSpanElement> | undefined;
|
|
108
|
+
onDragExit?: import("react").DragEventHandler<HTMLSpanElement> | undefined;
|
|
109
|
+
onDragExitCapture?: import("react").DragEventHandler<HTMLSpanElement> | undefined;
|
|
110
|
+
onDragLeave?: import("react").DragEventHandler<HTMLSpanElement> | undefined;
|
|
111
|
+
onDragLeaveCapture?: import("react").DragEventHandler<HTMLSpanElement> | undefined;
|
|
112
|
+
onDragOver?: import("react").DragEventHandler<HTMLSpanElement> | undefined;
|
|
113
|
+
onDragOverCapture?: import("react").DragEventHandler<HTMLSpanElement> | undefined;
|
|
114
|
+
onDragStart?: import("react").DragEventHandler<HTMLSpanElement> | undefined;
|
|
115
|
+
onDragStartCapture?: import("react").DragEventHandler<HTMLSpanElement> | undefined;
|
|
116
|
+
onDrop?: import("react").DragEventHandler<HTMLSpanElement> | undefined;
|
|
117
|
+
onDropCapture?: import("react").DragEventHandler<HTMLSpanElement> | undefined;
|
|
118
|
+
onMouseDown?: import("react").MouseEventHandler<HTMLSpanElement> | undefined;
|
|
119
|
+
onMouseDownCapture?: import("react").MouseEventHandler<HTMLSpanElement> | undefined;
|
|
120
|
+
onMouseEnter?: import("react").MouseEventHandler<HTMLSpanElement> | undefined;
|
|
121
|
+
onMouseLeave?: import("react").MouseEventHandler<HTMLSpanElement> | undefined;
|
|
122
|
+
onMouseMove?: import("react").MouseEventHandler<HTMLSpanElement> | undefined;
|
|
123
|
+
onMouseMoveCapture?: import("react").MouseEventHandler<HTMLSpanElement> | undefined;
|
|
124
|
+
onMouseOut?: import("react").MouseEventHandler<HTMLSpanElement> | undefined;
|
|
125
|
+
onMouseOutCapture?: import("react").MouseEventHandler<HTMLSpanElement> | undefined;
|
|
126
|
+
onMouseOver?: import("react").MouseEventHandler<HTMLSpanElement> | undefined;
|
|
127
|
+
onMouseOverCapture?: import("react").MouseEventHandler<HTMLSpanElement> | undefined;
|
|
128
|
+
onMouseUp?: import("react").MouseEventHandler<HTMLSpanElement> | undefined;
|
|
129
|
+
onMouseUpCapture?: import("react").MouseEventHandler<HTMLSpanElement> | undefined;
|
|
130
|
+
onSelect?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
131
|
+
onSelectCapture?: import("react").ReactEventHandler<HTMLSpanElement> | undefined;
|
|
132
|
+
onTouchCancel?: import("react").TouchEventHandler<HTMLSpanElement> | undefined;
|
|
133
|
+
onTouchCancelCapture?: import("react").TouchEventHandler<HTMLSpanElement> | undefined;
|
|
134
|
+
onTouchEnd?: import("react").TouchEventHandler<HTMLSpanElement> | undefined;
|
|
135
|
+
onTouchEndCapture?: import("react").TouchEventHandler<HTMLSpanElement> | undefined;
|
|
136
|
+
onTouchMove?: import("react").TouchEventHandler<HTMLSpanElement> | undefined;
|
|
137
|
+
onTouchMoveCapture?: import("react").TouchEventHandler<HTMLSpanElement> | undefined;
|
|
138
|
+
onTouchStart?: import("react").TouchEventHandler<HTMLSpanElement> | undefined;
|
|
139
|
+
onTouchStartCapture?: import("react").TouchEventHandler<HTMLSpanElement> | undefined;
|
|
140
|
+
onPointerDown?: import("react").PointerEventHandler<HTMLSpanElement> | undefined;
|
|
141
|
+
onPointerDownCapture?: import("react").PointerEventHandler<HTMLSpanElement> | undefined;
|
|
142
|
+
onPointerMove?: import("react").PointerEventHandler<HTMLSpanElement> | undefined;
|
|
143
|
+
onPointerMoveCapture?: import("react").PointerEventHandler<HTMLSpanElement> | undefined;
|
|
144
|
+
onPointerUp?: import("react").PointerEventHandler<HTMLSpanElement> | undefined;
|
|
145
|
+
onPointerUpCapture?: import("react").PointerEventHandler<HTMLSpanElement> | undefined;
|
|
146
|
+
onPointerCancel?: import("react").PointerEventHandler<HTMLSpanElement> | undefined;
|
|
147
|
+
onPointerCancelCapture?: import("react").PointerEventHandler<HTMLSpanElement> | undefined;
|
|
148
|
+
onPointerEnter?: import("react").PointerEventHandler<HTMLSpanElement> | undefined;
|
|
149
|
+
onPointerLeave?: import("react").PointerEventHandler<HTMLSpanElement> | undefined;
|
|
150
|
+
onPointerOver?: import("react").PointerEventHandler<HTMLSpanElement> | undefined;
|
|
151
|
+
onPointerOverCapture?: import("react").PointerEventHandler<HTMLSpanElement> | undefined;
|
|
152
|
+
onPointerOut?: import("react").PointerEventHandler<HTMLSpanElement> | undefined;
|
|
153
|
+
onPointerOutCapture?: import("react").PointerEventHandler<HTMLSpanElement> | undefined;
|
|
154
|
+
onGotPointerCapture?: import("react").PointerEventHandler<HTMLSpanElement> | undefined;
|
|
155
|
+
onGotPointerCaptureCapture?: import("react").PointerEventHandler<HTMLSpanElement> | undefined;
|
|
156
|
+
onLostPointerCapture?: import("react").PointerEventHandler<HTMLSpanElement> | undefined;
|
|
157
|
+
onLostPointerCaptureCapture?: import("react").PointerEventHandler<HTMLSpanElement> | undefined;
|
|
158
|
+
onScroll?: import("react").UIEventHandler<HTMLSpanElement> | undefined;
|
|
159
|
+
onScrollCapture?: import("react").UIEventHandler<HTMLSpanElement> | undefined;
|
|
160
|
+
onScrollEnd?: import("react").UIEventHandler<HTMLSpanElement> | undefined;
|
|
161
|
+
onScrollEndCapture?: import("react").UIEventHandler<HTMLSpanElement> | undefined;
|
|
162
|
+
onWheel?: import("react").WheelEventHandler<HTMLSpanElement> | undefined;
|
|
163
|
+
onWheelCapture?: import("react").WheelEventHandler<HTMLSpanElement> | undefined;
|
|
164
|
+
onAnimationStart?: import("react").AnimationEventHandler<HTMLSpanElement> | undefined;
|
|
165
|
+
onAnimationStartCapture?: import("react").AnimationEventHandler<HTMLSpanElement> | undefined;
|
|
166
|
+
onAnimationEnd?: import("react").AnimationEventHandler<HTMLSpanElement> | undefined;
|
|
167
|
+
onAnimationEndCapture?: import("react").AnimationEventHandler<HTMLSpanElement> | undefined;
|
|
168
|
+
onAnimationIteration?: import("react").AnimationEventHandler<HTMLSpanElement> | undefined;
|
|
169
|
+
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLSpanElement> | undefined;
|
|
170
|
+
onToggle?: import("react").ToggleEventHandler<HTMLSpanElement> | undefined;
|
|
171
|
+
onBeforeToggle?: import("react").ToggleEventHandler<HTMLSpanElement> | undefined;
|
|
172
|
+
onTransitionCancel?: import("react").TransitionEventHandler<HTMLSpanElement> | undefined;
|
|
173
|
+
onTransitionCancelCapture?: import("react").TransitionEventHandler<HTMLSpanElement> | undefined;
|
|
174
|
+
onTransitionEnd?: import("react").TransitionEventHandler<HTMLSpanElement> | undefined;
|
|
175
|
+
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLSpanElement> | undefined;
|
|
176
|
+
onTransitionRun?: import("react").TransitionEventHandler<HTMLSpanElement> | undefined;
|
|
177
|
+
onTransitionRunCapture?: import("react").TransitionEventHandler<HTMLSpanElement> | undefined;
|
|
178
|
+
onTransitionStart?: import("react").TransitionEventHandler<HTMLSpanElement> | undefined;
|
|
179
|
+
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLSpanElement> | undefined;
|
|
180
|
+
"aria-activedescendant"?: string | undefined;
|
|
181
|
+
"aria-atomic"?: ("false" | "true" | boolean) | undefined;
|
|
182
|
+
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
|
|
183
|
+
"aria-braillelabel"?: string | undefined;
|
|
184
|
+
"aria-brailleroledescription"?: string | undefined;
|
|
185
|
+
"aria-busy"?: ("false" | "true" | boolean) | undefined;
|
|
186
|
+
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
187
|
+
"aria-colcount"?: number | undefined;
|
|
188
|
+
"aria-colindex"?: number | undefined;
|
|
189
|
+
"aria-colindextext"?: string | undefined;
|
|
190
|
+
"aria-colspan"?: number | undefined;
|
|
191
|
+
"aria-controls"?: string | undefined;
|
|
192
|
+
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
|
|
193
|
+
"aria-describedby"?: string | undefined;
|
|
194
|
+
"aria-description"?: string | undefined;
|
|
195
|
+
"aria-details"?: string | undefined;
|
|
196
|
+
"aria-disabled"?: ("false" | "true" | boolean) | undefined;
|
|
197
|
+
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
|
|
198
|
+
"aria-errormessage"?: string | undefined;
|
|
199
|
+
"aria-expanded"?: ("false" | "true" | boolean) | undefined;
|
|
200
|
+
"aria-flowto"?: string | undefined;
|
|
201
|
+
"aria-grabbed"?: ("false" | "true" | boolean) | undefined;
|
|
202
|
+
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
|
|
203
|
+
"aria-hidden"?: ("false" | "true" | boolean) | undefined;
|
|
204
|
+
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
|
205
|
+
"aria-keyshortcuts"?: string | undefined;
|
|
206
|
+
"aria-label"?: string | undefined;
|
|
207
|
+
"aria-labelledby"?: string | undefined;
|
|
208
|
+
"aria-level"?: number | undefined;
|
|
209
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
210
|
+
"aria-modal"?: ("false" | "true" | boolean) | undefined;
|
|
211
|
+
"aria-multiline"?: ("false" | "true" | boolean) | undefined;
|
|
212
|
+
"aria-multiselectable"?: ("false" | "true" | boolean) | undefined;
|
|
213
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
214
|
+
"aria-owns"?: string | undefined;
|
|
215
|
+
"aria-placeholder"?: string | undefined;
|
|
216
|
+
"aria-posinset"?: number | undefined;
|
|
217
|
+
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
218
|
+
"aria-readonly"?: ("false" | "true" | boolean) | undefined;
|
|
219
|
+
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
|
|
220
|
+
"aria-required"?: ("false" | "true" | boolean) | undefined;
|
|
221
|
+
"aria-roledescription"?: string | undefined;
|
|
222
|
+
"aria-rowcount"?: number | undefined;
|
|
223
|
+
"aria-rowindex"?: number | undefined;
|
|
224
|
+
"aria-rowindextext"?: string | undefined;
|
|
225
|
+
"aria-rowspan"?: number | undefined;
|
|
226
|
+
"aria-selected"?: ("false" | "true" | boolean) | undefined;
|
|
227
|
+
"aria-setsize"?: number | undefined;
|
|
228
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
229
|
+
"aria-valuemax"?: number | undefined;
|
|
230
|
+
"aria-valuemin"?: number | undefined;
|
|
231
|
+
"aria-valuenow"?: number | undefined;
|
|
232
|
+
"aria-valuetext"?: string | undefined;
|
|
233
|
+
defaultChecked?: boolean | undefined;
|
|
234
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
235
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
236
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
237
|
+
accessKey?: string | undefined;
|
|
238
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {});
|
|
239
|
+
autoFocus?: boolean | undefined;
|
|
240
|
+
contentEditable?: ("false" | "true" | boolean) | "inherit" | "plaintext-only" | undefined;
|
|
241
|
+
contextMenu?: string | undefined;
|
|
242
|
+
dir?: string | undefined;
|
|
243
|
+
draggable?: ("false" | "true" | boolean) | undefined;
|
|
244
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
|
245
|
+
hidden?: boolean | undefined;
|
|
246
|
+
id?: string | undefined;
|
|
247
|
+
lang?: string | undefined;
|
|
248
|
+
nonce?: string | undefined;
|
|
249
|
+
slot?: string | undefined;
|
|
250
|
+
spellCheck?: ("false" | "true" | boolean) | undefined;
|
|
251
|
+
style?: import("react").CSSProperties | undefined;
|
|
252
|
+
tabIndex?: number | undefined;
|
|
253
|
+
title?: string | undefined;
|
|
254
|
+
translate?: "yes" | "no" | undefined;
|
|
255
|
+
radioGroup?: string | undefined;
|
|
256
|
+
role?: import("react").AriaRole | undefined;
|
|
257
|
+
about?: string | undefined;
|
|
258
|
+
content?: string | undefined;
|
|
259
|
+
datatype?: string | undefined;
|
|
260
|
+
inlist?: any;
|
|
261
|
+
prefix?: string | undefined;
|
|
262
|
+
property?: string | undefined;
|
|
263
|
+
rel?: string | undefined;
|
|
264
|
+
resource?: string | undefined;
|
|
265
|
+
rev?: string | undefined;
|
|
266
|
+
typeof?: string | undefined;
|
|
267
|
+
vocab?: string | undefined;
|
|
268
|
+
autoCorrect?: string | undefined;
|
|
269
|
+
autoSave?: string | undefined;
|
|
270
|
+
color?: string | undefined;
|
|
271
|
+
itemProp?: string | undefined;
|
|
272
|
+
itemScope?: boolean | undefined;
|
|
273
|
+
itemType?: string | undefined;
|
|
274
|
+
itemID?: string | undefined;
|
|
275
|
+
itemRef?: string | undefined;
|
|
276
|
+
results?: number | undefined;
|
|
277
|
+
security?: string | undefined;
|
|
278
|
+
unselectable?: "on" | "off" | undefined;
|
|
279
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined;
|
|
280
|
+
popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
|
|
281
|
+
popoverTarget?: string | undefined;
|
|
282
|
+
inert?: boolean | undefined;
|
|
283
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
284
|
+
is?: string | undefined;
|
|
285
|
+
exportparts?: string | undefined;
|
|
286
|
+
part?: string | undefined;
|
|
287
|
+
className: string;
|
|
288
|
+
}, HTMLElement> | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createElement } from 'react';
|
|
2
|
+
import { isLastUsedLoginMethod } from '../interaction/last_used.js';
|
|
3
|
+
export function LastUsedBadge({ lastUsed, method, children = 'Último usado', className, ...rest }) {
|
|
4
|
+
if (!isLastUsedLoginMethod(lastUsed, method))
|
|
5
|
+
return null;
|
|
6
|
+
return createElement('span', {
|
|
7
|
+
className: className ? `authkit-last-used ${className}` : 'authkit-last-used',
|
|
8
|
+
...rest,
|
|
9
|
+
}, children);
|
|
10
|
+
}
|
|
@@ -1,61 +1,53 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
2
3
|
import { createElement, useState } from 'react';
|
|
3
4
|
import { useAuthkitConfig } from '../config.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { jsonRequest } from '../hooks/use_resource.js';
|
|
5
|
+
import { useAccountInviteOrgMemberMutationOptions, useAccountLeaveOrgMutationOptions, useAccountOrgQueryOptions, useAccountOrgsQueryOptions, } from '../queries/account/index.js';
|
|
6
|
+
import { authkitKeys } from '../queries/keys.js';
|
|
7
7
|
import { useAuth } from '../use_auth.js';
|
|
8
8
|
function OrganizationProfileInner({ inviteLabel = 'Convidar membro', leaveLabel = 'Sair da organização', className, }) {
|
|
9
9
|
const { isAuthenticated } = useAuth();
|
|
10
|
-
const
|
|
11
|
-
const {
|
|
12
|
-
const
|
|
10
|
+
const qc = useQueryClient();
|
|
11
|
+
const orgs = useQuery({ ...useAccountOrgsQueryOptions(), enabled: isAuthenticated });
|
|
12
|
+
const activeOrgId = orgs.data?.activeOrgId ?? null;
|
|
13
|
+
const orgQuery = useAccountOrgQueryOptions(activeOrgId ?? '');
|
|
14
|
+
const detail = useQuery({ ...orgQuery, enabled: isAuthenticated && activeOrgId !== null });
|
|
15
|
+
const invite = useMutation({
|
|
16
|
+
...useAccountInviteOrgMemberMutationOptions(),
|
|
17
|
+
onSuccess: () => qc.invalidateQueries({ queryKey: orgQuery.queryKey }),
|
|
18
|
+
});
|
|
19
|
+
const leave = useMutation({
|
|
20
|
+
...useAccountLeaveOrgMutationOptions(),
|
|
21
|
+
onSuccess: () => Promise.all([
|
|
22
|
+
qc.invalidateQueries({ queryKey: authkitKeys.account.orgs() }),
|
|
23
|
+
qc.invalidateQueries({ queryKey: authkitKeys.account.me() }),
|
|
24
|
+
]),
|
|
25
|
+
});
|
|
13
26
|
const [inviteEmail, setInviteEmail] = useState('');
|
|
14
27
|
const [inviteRole, setInviteRole] = useState('member');
|
|
15
|
-
const [inviteLoading, setInviteLoading] = useState(false);
|
|
16
|
-
const [inviteError, setInviteError] = useState(null);
|
|
17
28
|
if (!isAuthenticated || !activeOrgId)
|
|
18
29
|
return null;
|
|
19
|
-
if (
|
|
30
|
+
if (detail.isLoading)
|
|
20
31
|
return createElement('div', { className: 'authkit-org-profile__loading' }, 'Carregando…');
|
|
21
|
-
if (error)
|
|
22
|
-
return createElement('div', { className: 'authkit-error' }, error.message);
|
|
32
|
+
if (detail.error)
|
|
33
|
+
return createElement('div', { className: 'authkit-error' }, detail.error.message);
|
|
34
|
+
const org = detail.data;
|
|
23
35
|
if (!org)
|
|
24
36
|
return null;
|
|
25
|
-
const base = config.endpoints.orgs.replace('/json', '');
|
|
26
37
|
const handleInvite = async (e) => {
|
|
27
38
|
e.preventDefault();
|
|
28
39
|
if (!inviteEmail.trim())
|
|
29
40
|
return;
|
|
30
|
-
setInviteLoading(true);
|
|
31
|
-
setInviteError(null);
|
|
32
41
|
try {
|
|
33
|
-
await
|
|
34
|
-
method: 'POST',
|
|
35
|
-
body: JSON.stringify({ email: inviteEmail.trim(), role: inviteRole }),
|
|
36
|
-
csrfToken: config.csrfToken,
|
|
37
|
-
});
|
|
42
|
+
await invite.mutateAsync({ orgId: activeOrgId, email: inviteEmail.trim(), role: inviteRole });
|
|
38
43
|
setInviteEmail('');
|
|
39
|
-
await actions.refetch();
|
|
40
|
-
}
|
|
41
|
-
catch (err) {
|
|
42
|
-
setInviteError(err);
|
|
43
|
-
}
|
|
44
|
-
finally {
|
|
45
|
-
setInviteLoading(false);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
const handleLeave = async () => {
|
|
49
|
-
try {
|
|
50
|
-
await jsonRequest(`${base}/${encodeURIComponent(activeOrgId)}/leave`, {
|
|
51
|
-
method: 'POST',
|
|
52
|
-
csrfToken: config.csrfToken,
|
|
53
|
-
});
|
|
54
|
-
await orgListActions.refetch();
|
|
55
44
|
}
|
|
56
45
|
catch {
|
|
57
46
|
}
|
|
58
47
|
};
|
|
48
|
+
const handleLeave = () => {
|
|
49
|
+
leave.mutate(activeOrgId);
|
|
50
|
+
};
|
|
59
51
|
const memberList = createElement('div', { className: 'authkit-org-profile__members' }, createElement('h3', { className: 'authkit-org-profile__section-title' }, 'Membros'), ...(org.members.length === 0
|
|
60
52
|
? [createElement('p', { className: 'authkit-org-profile__empty' }, 'Nenhum membro.')]
|
|
61
53
|
: org.members.map((m) => createElement('div', { key: m.accountId, className: 'authkit-org-profile__member' }, createElement('div', { className: 'authkit-org-profile__member-info' }, createElement('span', { className: 'authkit-org-profile__member-email' }, m.email ?? m.accountId), createElement('span', { className: 'authkit-org-profile__member-role' }, m.role))))));
|
|
@@ -71,13 +63,13 @@ function OrganizationProfileInner({ inviteLabel = 'Convidar membro', leaveLabel
|
|
|
71
63
|
placeholder: 'Papel (ex: member)',
|
|
72
64
|
value: inviteRole,
|
|
73
65
|
onChange: (e) => setInviteRole(e.target.value),
|
|
74
|
-
}),
|
|
75
|
-
? createElement('p', { className: 'authkit-error', role: 'alert' },
|
|
66
|
+
}), invite.error
|
|
67
|
+
? createElement('p', { className: 'authkit-error', role: 'alert' }, invite.error.message)
|
|
76
68
|
: null, createElement('button', {
|
|
77
69
|
type: 'submit',
|
|
78
70
|
className: 'authkit-button authkit-button--primary',
|
|
79
|
-
disabled:
|
|
80
|
-
},
|
|
71
|
+
disabled: invite.isPending,
|
|
72
|
+
}, invite.isPending ? 'Enviando…' : inviteLabel))
|
|
81
73
|
: null;
|
|
82
74
|
const leaveButton = createElement('button', {
|
|
83
75
|
type: 'button',
|
|
@@ -1,17 +1,33 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
2
3
|
import { createElement, useState } from 'react';
|
|
3
4
|
import { useAuthkitConfig } from '../config.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
5
|
+
import { useAccountActivateOrgMutationOptions, useAccountDeactivateOrgMutationOptions, useAccountOrgsQueryOptions, } from '../queries/account/index.js';
|
|
6
|
+
import { authkitKeys } from '../queries/keys.js';
|
|
6
7
|
import { useAuth } from '../use_auth.js';
|
|
7
8
|
function OrganizationSwitcherInner({ personalAccountLabel = 'Conta pessoal', className, }) {
|
|
8
9
|
const { isAuthenticated } = useAuth();
|
|
9
|
-
const
|
|
10
|
-
const {
|
|
10
|
+
const qc = useQueryClient();
|
|
11
|
+
const query = useQuery({ ...useAccountOrgsQueryOptions(), enabled: isAuthenticated });
|
|
12
|
+
const onSwitched = () => Promise.all([
|
|
13
|
+
qc.invalidateQueries({ queryKey: authkitKeys.account.orgs() }),
|
|
14
|
+
qc.invalidateQueries({ queryKey: authkitKeys.account.me() }),
|
|
15
|
+
]);
|
|
16
|
+
const activate = useMutation({
|
|
17
|
+
...useAccountActivateOrgMutationOptions(),
|
|
18
|
+
onSuccess: onSwitched,
|
|
19
|
+
});
|
|
20
|
+
const deactivate = useMutation({
|
|
21
|
+
...useAccountDeactivateOrgMutationOptions(),
|
|
22
|
+
onSuccess: onSwitched,
|
|
23
|
+
});
|
|
11
24
|
const [open, setOpen] = useState(false);
|
|
12
|
-
if (!isAuthenticated || !supported)
|
|
25
|
+
if (!isAuthenticated || !query.data?.supported)
|
|
13
26
|
return null;
|
|
14
|
-
const
|
|
27
|
+
const orgs = query.data.orgs;
|
|
28
|
+
const activeOrgId = query.data.activeOrgId;
|
|
29
|
+
const switching = activate.isPending || deactivate.isPending;
|
|
30
|
+
const activeOrg = orgs.find((o) => o.id === activeOrgId) ?? null;
|
|
15
31
|
const label = activeOrg ? activeOrg.name : personalAccountLabel;
|
|
16
32
|
const trigger = createElement('button', {
|
|
17
33
|
type: 'button',
|
|
@@ -35,9 +51,9 @@ function OrganizationSwitcherInner({ personalAccountLabel = 'Conta pessoal', cla
|
|
|
35
51
|
onClick: async () => {
|
|
36
52
|
setOpen(false);
|
|
37
53
|
if (activeOrgId)
|
|
38
|
-
await deactivate();
|
|
54
|
+
await deactivate.mutateAsync();
|
|
39
55
|
},
|
|
40
|
-
}, createElement('span', { className: 'authkit-orgswitcher__item-name' }, personalAccountLabel)), ...
|
|
56
|
+
}, createElement('span', { className: 'authkit-orgswitcher__item-name' }, personalAccountLabel)), ...orgs.map((org) => createElement('button', {
|
|
41
57
|
key: org.id,
|
|
42
58
|
type: 'button',
|
|
43
59
|
className: [
|
|
@@ -51,7 +67,7 @@ function OrganizationSwitcherInner({ personalAccountLabel = 'Conta pessoal', cla
|
|
|
51
67
|
onClick: async () => {
|
|
52
68
|
setOpen(false);
|
|
53
69
|
if (!org.isActive)
|
|
54
|
-
await activate(org.id);
|
|
70
|
+
await activate.mutateAsync(org.id);
|
|
55
71
|
},
|
|
56
72
|
}, createElement('span', { className: 'authkit-orgswitcher__item-name' }, org.name), createElement('span', { className: 'authkit-orgswitcher__item-role' }, org.role))))
|
|
57
73
|
: null;
|
|
@@ -1,31 +1,37 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
3
|
import { createElement, useState } from 'react';
|
|
3
4
|
import { useAuthkitConfig } from '../config.js';
|
|
4
|
-
import {
|
|
5
|
+
import { useUpdateProfileMutationOptions } from '../queries/account/index.js';
|
|
6
|
+
import { authkitKeys } from '../queries/keys.js';
|
|
5
7
|
import { useAuth } from '../use_auth.js';
|
|
6
8
|
import { Avatar } from './avatar.js';
|
|
7
9
|
function UserProfileInner({ className }) {
|
|
8
10
|
const { user, isAuthenticated } = useAuth();
|
|
9
|
-
const
|
|
11
|
+
const qc = useQueryClient();
|
|
12
|
+
const update = useMutation({
|
|
13
|
+
...useUpdateProfileMutationOptions(),
|
|
14
|
+
onSuccess: () => qc.invalidateQueries({ queryKey: authkitKeys.account.me() }),
|
|
15
|
+
});
|
|
10
16
|
const [name, setName] = useState(user?.name ?? '');
|
|
11
17
|
if (!isAuthenticated || !user)
|
|
12
18
|
return null;
|
|
13
19
|
const onSubmit = (e) => {
|
|
14
20
|
e.preventDefault();
|
|
15
|
-
|
|
21
|
+
update.mutate({ name });
|
|
16
22
|
};
|
|
17
23
|
return createElement('div', { className: ['authkit-card', 'authkit-profile', className].filter(Boolean).join(' ') }, createElement('div', { className: 'authkit-profile__header' }, createElement(Avatar, { user, size: 56 }), createElement('div', null, createElement('div', { className: 'authkit-profile__name' }, user.name ?? user.email), createElement('div', { className: 'authkit-profile__email' }, user.email))), createElement('form', { className: 'authkit-profile__form', onSubmit }, createElement('label', { className: 'authkit-label', htmlFor: 'authkit-profile-name' }, 'Nome'), createElement('input', {
|
|
18
24
|
id: 'authkit-profile-name',
|
|
19
25
|
className: 'authkit-input',
|
|
20
26
|
value: name,
|
|
21
27
|
onChange: (e) => setName(e.target.value),
|
|
22
|
-
}), error
|
|
23
|
-
? createElement('p', { className: 'authkit-error', role: 'alert' }, error.message)
|
|
28
|
+
}), update.error
|
|
29
|
+
? createElement('p', { className: 'authkit-error', role: 'alert' }, update.error.message)
|
|
24
30
|
: null, createElement('button', {
|
|
25
31
|
type: 'submit',
|
|
26
32
|
className: 'authkit-button authkit-button--primary',
|
|
27
|
-
disabled:
|
|
28
|
-
},
|
|
33
|
+
disabled: update.isPending,
|
|
34
|
+
}, update.isPending ? 'Salvando…' : 'Salvar')));
|
|
29
35
|
}
|
|
30
36
|
export function UserProfile(props) {
|
|
31
37
|
const { idp } = useAuthkitConfig();
|
package/build/src/config.d.ts
CHANGED
package/build/src/config.js
CHANGED
|
@@ -5,12 +5,6 @@ export const DEFAULT_CONFIG = {
|
|
|
5
5
|
logoutUrl: '/account/logout',
|
|
6
6
|
profileUrl: '/account/security',
|
|
7
7
|
endpoints: {
|
|
8
|
-
profile: '/account/security/profile',
|
|
9
|
-
sessions: '/account/security',
|
|
10
|
-
apps: '/account/apps',
|
|
11
|
-
passkeys: '/account/mfa/passkeys',
|
|
12
|
-
orgs: '/account/orgs/json',
|
|
13
|
-
orgInvitations: '/account/orgs/invitations/json',
|
|
14
8
|
can: '/authz/can',
|
|
15
9
|
},
|
|
16
10
|
};
|
|
@@ -20,12 +14,6 @@ export function resolveConfig(config) {
|
|
|
20
14
|
logoutUrl: config?.logoutUrl ?? DEFAULT_CONFIG.logoutUrl,
|
|
21
15
|
profileUrl: config?.profileUrl ?? DEFAULT_CONFIG.profileUrl,
|
|
22
16
|
endpoints: {
|
|
23
|
-
profile: config?.endpoints?.profile ?? DEFAULT_CONFIG.endpoints.profile,
|
|
24
|
-
sessions: config?.endpoints?.sessions ?? DEFAULT_CONFIG.endpoints.sessions,
|
|
25
|
-
apps: config?.endpoints?.apps ?? DEFAULT_CONFIG.endpoints.apps,
|
|
26
|
-
passkeys: config?.endpoints?.passkeys ?? DEFAULT_CONFIG.endpoints.passkeys,
|
|
27
|
-
orgs: config?.endpoints?.orgs ?? DEFAULT_CONFIG.endpoints.orgs,
|
|
28
|
-
orgInvitations: config?.endpoints?.orgInvitations ?? DEFAULT_CONFIG.endpoints.orgInvitations,
|
|
29
17
|
can: config?.endpoints?.can ?? config?.canPath ?? DEFAULT_CONFIG.endpoints.can,
|
|
30
18
|
},
|
|
31
19
|
csrfToken: config?.csrfToken,
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
export interface ResourceState<T> {
|
|
2
|
-
data: T | null;
|
|
3
|
-
loading: boolean;
|
|
4
|
-
error: Error | null;
|
|
5
|
-
}
|
|
6
1
|
export declare function jsonRequest<T>(url: string, init?: RequestInit & {
|
|
7
2
|
csrfToken?: string;
|
|
8
3
|
}): Promise<T>;
|
|
9
|
-
export declare function useResource<T>(url: string, csrfToken?: string): ResourceState<T> & {
|
|
10
|
-
refetch: () => Promise<void>;
|
|
11
|
-
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
2
1
|
export async function jsonRequest(url, init = {}) {
|
|
3
2
|
const { csrfToken, headers, ...rest } = init;
|
|
4
3
|
const res = await fetch(url, {
|
|
@@ -25,24 +24,3 @@ export async function jsonRequest(url, init = {}) {
|
|
|
25
24
|
const text = await res.text();
|
|
26
25
|
return (text ? JSON.parse(text) : null);
|
|
27
26
|
}
|
|
28
|
-
export function useResource(url, csrfToken) {
|
|
29
|
-
const [state, setState] = useState({
|
|
30
|
-
data: null,
|
|
31
|
-
loading: true,
|
|
32
|
-
error: null,
|
|
33
|
-
});
|
|
34
|
-
const refetch = useCallback(async () => {
|
|
35
|
-
setState((s) => ({ ...s, loading: true, error: null }));
|
|
36
|
-
try {
|
|
37
|
-
const data = await jsonRequest(url, { csrfToken });
|
|
38
|
-
setState({ data, loading: false, error: null });
|
|
39
|
-
}
|
|
40
|
-
catch (err) {
|
|
41
|
-
setState({ data: null, loading: false, error: err });
|
|
42
|
-
}
|
|
43
|
-
}, [url, csrfToken]);
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
void refetch();
|
|
46
|
-
}, [refetch]);
|
|
47
|
-
return { ...state, refetch };
|
|
48
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AcceptOrgInvitationResult, AccountAppsResult, AccountLoginMethodsResult, AccountMe, AccountMfaStatus, AccountOrgDetail, AccountOrgInvitationsResult, AccountOrgsResult, AccountPasskeysResult, AccountSecurityOverview, AccountSessionsResult, AccountTokensResult, ActivateOrgResult, ChangePasswordInput, CreateAccountOrgInput, CreatedAccountOrgResult, CreatedOrgInvitationResult, CreatedPatResult, CreateTokenInput, DeactivateOrgResult, EmailChangeResult, LeaveOrgResult, MfaConfirmResult, MfaDisableResult, MfaEnrollResult, MfaRecoveryCodesResult, OkResult, RemoveOrgMemberResult, RemovePasskeyResult, RequestEmailChangeInput, RevokeAllResult, RevokeAppResult, RevokeOrgInvitationResult, RevokeOthersResult, RevokeSessionResult, RevokeTokenResult, UpdateLoginMethodsResult, UpdateOrgMemberRoleResult, UpdateProfileInput, UpdateProfileResult, UserLoginMethodsInput } from '../../client/types.js';
|
|
1
|
+
import type { AcceptOrgInvitationResult, AccountAgentsResult, AccountAppsResult, AccountLoginMethodsResult, AccountMe, AccountMfaStatus, AccountOrgDetail, AccountOrgInvitationsResult, AccountOrgsResult, AccountPasskeysResult, AccountSecurityOverview, AccountSessionsResult, AccountTokensResult, ActivateOrgResult, ChangePasswordInput, CreateAccountOrgInput, CreatedAccountOrgResult, CreatedOrgInvitationResult, CreatedPatResult, CreateTokenInput, DeactivateOrgResult, EmailChangeResult, LeaveOrgResult, MfaConfirmResult, MfaDisableResult, MfaEnrollResult, MfaRecoveryCodesResult, OkResult, RemoveOrgMemberResult, RemovePasskeyResult, RequestEmailChangeInput, RevokeAllResult, RevokeAppResult, RevokeOrgInvitationResult, RevokeOthersResult, RevokeSessionResult, RevokeTokenResult, UpdateLoginMethodsResult, UpdateOrgMemberRoleResult, UpdateProfileInput, UpdateProfileResult, UserLoginMethodsInput } from '../../client/types.js';
|
|
2
2
|
import { type RegisterPasskeyJsonDeps } from '../../passkey/json_registration.js';
|
|
3
3
|
export declare function useMeQueryOptions(): {
|
|
4
4
|
queryKey: readonly ["authkit", "account", "me"];
|
|
@@ -48,6 +48,16 @@ export declare function useRevokeAppMutationOptions(): {
|
|
|
48
48
|
mutationKey: string[];
|
|
49
49
|
mutationFn: (clientId: string) => Promise<RevokeAppResult>;
|
|
50
50
|
};
|
|
51
|
+
export declare function useAccountAgentsQueryOptions(): {
|
|
52
|
+
queryKey: readonly ["authkit", "account", "agents"];
|
|
53
|
+
queryFn: () => Promise<AccountAgentsResult>;
|
|
54
|
+
};
|
|
55
|
+
export declare function useRevokeAccountAgentMutationOptions(): {
|
|
56
|
+
mutationKey: string[];
|
|
57
|
+
mutationFn: (grantId: string) => Promise<{
|
|
58
|
+
ok: true;
|
|
59
|
+
}>;
|
|
60
|
+
};
|
|
51
61
|
export declare function useMfaQueryOptions(): {
|
|
52
62
|
queryKey: readonly ["authkit", "account", "mfa"];
|
|
53
63
|
queryFn: () => Promise<AccountMfaStatus>;
|