@abpjs/ui 0.2.0-next.4 → 0.2.0-next.6
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 +26 -0
- package/dist/index.d.ts +50 -18
- package/dist/index.js +670 -273
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.0-next.6
|
|
4
|
+
|
|
5
|
+
A prerelease under npm's `next` tag.
|
|
6
|
+
|
|
7
|
+
- `StepUpDialog`: an authenticator code alone where the server lets one pass (`appCodeAlone` in `step_up_required`'s
|
|
8
|
+
data, the operator's setting): the strong level asks for the code alone (a passkey still first when the person has
|
|
9
|
+
one), and the password level offers it instead of the password. Without the field, a code goes with the password, as
|
|
10
|
+
before. `StepUpNeed.appCodeAlone`.
|
|
11
|
+
|
|
12
|
+
## 0.2.0-next.5
|
|
13
|
+
|
|
14
|
+
A prerelease under npm's `next` tag: the step-up dialog for AbpGuard 0.7.0's strong step-up and passkeys. Against an
|
|
15
|
+
older AbpGuard nothing changes (no level means the password level).
|
|
16
|
+
|
|
17
|
+
- `StepUpDialog` reads the level the server asks for (`step_up_required` with `level`, `methods`). At `strong`, it
|
|
18
|
+
offers a passkey first when the person has one, or the password with an authenticator code. Asked of someone with no
|
|
19
|
+
strong factor (`strong_factor_required`), it takes the password, then sets up a passkey or the app (QR and key) right
|
|
20
|
+
there, with the recovery codes shown once for a first factor; the call then asks again and they confirm with it.
|
|
21
|
+
- Passkeys in the browser's own JSON both ways (`createPasskey`, `getPasskey`, `passkeysSupported`), with a base64url
|
|
22
|
+
fallback for browsers without `PublicKeyCredential.parse*FromJSON`.
|
|
23
|
+
- `requestStepUp(need)` and `StepUpHandler` take the server's need (`StepUpNeed`, `stepUpNeedOf`). `createHostRequest`
|
|
24
|
+
and `createHostEvents` pass it on and ask again when the server asks for more (a factor set up, then the strong step-up),
|
|
25
|
+
up to three times. `HostRequestInit.stepUp: false` throws a step-up refusal instead of asking (the dialog's own calls).
|
|
26
|
+
`needsStepUp` and `STRONG_FACTOR_REQUIRED` beside `isStepUp`.
|
|
27
|
+
- `createHostEvents` asks the step-up dialog by default, as `createHostRequest` does.
|
|
28
|
+
|
|
3
29
|
## 0.2.0-next.4
|
|
4
30
|
|
|
5
31
|
A prerelease under npm's `next` tag, for a host's scope page on the `ai` area.
|
package/dist/index.d.ts
CHANGED
|
@@ -218,6 +218,37 @@ declare function readAbpError(res: Response): Promise<AbpApiError>;
|
|
|
218
218
|
/** An error as a person reads it. */
|
|
219
219
|
declare function errorText(e: unknown): string;
|
|
220
220
|
declare const isStepUp: (e: unknown) => boolean;
|
|
221
|
+
/** A strong step-up asked of someone with no strong factor yet (AbpGuard 0.7.0): they set one up, then step up. */
|
|
222
|
+
declare const STRONG_FACTOR_REQUIRED = "strong_factor_required";
|
|
223
|
+
/** A refusal the step-up dialog answers: a step-up, or a strong factor to set up first. */
|
|
224
|
+
declare const needsStepUp: (e: unknown) => e is AbpApiError;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* What the server asked for (AbpGuard 0.7.0, ADR 0110 in the application it came from): a step-up at a level, with the
|
|
228
|
+
* person's ways best first, or a strong factor they don't have yet. Older servers send no level: the password level.
|
|
229
|
+
*/
|
|
230
|
+
interface StepUpNeed {
|
|
231
|
+
/** `step_up_required`, or `strong_factor_required` when a strong step-up is asked of someone with no strong factor. */
|
|
232
|
+
code: string;
|
|
233
|
+
/** `password` (the password, with a code of a second factor when the person has one) or `strong` (a passkey, or the password and an authenticator code). */
|
|
234
|
+
level: 'password' | 'strong';
|
|
235
|
+
category: string | null;
|
|
236
|
+
/** The person's ways at that level, best first: `passkey`, `app`, `password`, `email`… Empty when the server doesn't say. */
|
|
237
|
+
methods: string[];
|
|
238
|
+
/** An authenticator code alone passes (the operator's setting, AbpGuard's `appCodeAlone`); else it goes with the password. */
|
|
239
|
+
appCodeAlone: boolean;
|
|
240
|
+
}
|
|
241
|
+
/** What asks the person to confirm who they are: true once confirmed (or a strong factor set up), false if they gave up. */
|
|
242
|
+
type StepUpHandler = (need: StepUpNeed) => Promise<boolean>;
|
|
243
|
+
/** The step-up dialog registers itself here (`StepUpDialog`, drawn by `AbpProvider`); null when it goes. */
|
|
244
|
+
declare function setStepUpHandler(next: StepUpHandler | null): void;
|
|
245
|
+
/** The need an error carries: its code, and the level and methods in its data. */
|
|
246
|
+
declare function stepUpNeedOf(code: string, data: Record<string, unknown> | null | undefined): StepUpNeed;
|
|
247
|
+
/**
|
|
248
|
+
* Asks the person to confirm who they are, once however many calls are waiting for it (ADR 0109 amendment). False when
|
|
249
|
+
* nothing is registered to ask with: the call then fails with the server's refusal, as it would without.
|
|
250
|
+
*/
|
|
251
|
+
declare function requestStepUp(need?: StepUpNeed): Promise<boolean>;
|
|
221
252
|
|
|
222
253
|
/** What a call sends: its method, a JSON body (or FormData as is), headers, and a way to stop it. */
|
|
223
254
|
interface HostRequestInit {
|
|
@@ -227,6 +258,8 @@ interface HostRequestInit {
|
|
|
227
258
|
signal?: AbortSignal;
|
|
228
259
|
/** The answer as a file (a Blob and the name Content-Disposition gives) rather than JSON. */
|
|
229
260
|
as?: 'json' | 'file';
|
|
261
|
+
/** False: a refusal that asks for a step-up is thrown, not asked (the step-up dialog's own calls). */
|
|
262
|
+
stepUp?: false;
|
|
230
263
|
}
|
|
231
264
|
/** A file the server answered with. */
|
|
232
265
|
interface HostFile {
|
|
@@ -250,7 +283,7 @@ interface HostRequestOptions {
|
|
|
250
283
|
* A 403 `step_up_required`: the host confirms the person again; true retries the call once. By default the step-up
|
|
251
284
|
* dialog `AbpProvider` draws asks (`requestStepUp`), and without one the call fails as the server answered.
|
|
252
285
|
*/
|
|
253
|
-
stepUp?: () => Promise<boolean>;
|
|
286
|
+
stepUp?: (need: StepUpNeed) => Promise<boolean>;
|
|
254
287
|
/** More headers on every call (a development user, a tenant). */
|
|
255
288
|
headers?: () => Record<string, string>;
|
|
256
289
|
fetch?: typeof fetch;
|
|
@@ -276,7 +309,7 @@ type HostEvents = (path: string, onEvent: HostEventHandler, options?: {
|
|
|
276
309
|
}) => Promise<string | null>;
|
|
277
310
|
/** Reads a response's server-sent events to its end. */
|
|
278
311
|
declare function readEvents(res: Response, onEvent: HostEventHandler): Promise<void>;
|
|
279
|
-
/** Server-sent events for a host without its own reader: same origin, its headers, a 401 handed back,
|
|
312
|
+
/** Server-sent events for a host without its own reader: same origin, its headers, a 401 handed back, a step-up (the dialog's by default). */
|
|
280
313
|
declare function createHostEvents(options?: Pick<HostRequestOptions, 'onUnauthorized' | 'stepUp' | 'headers' | 'fetch'>): HostEvents;
|
|
281
314
|
|
|
282
315
|
/** A scope as a host knows it: a project, an org unit. */
|
|
@@ -1520,24 +1553,23 @@ declare function useSlotSaves(): {
|
|
|
1520
1553
|
run: () => Promise<void>;
|
|
1521
1554
|
};
|
|
1522
1555
|
|
|
1523
|
-
/** What asks the person to confirm who they are: true once confirmed, false if they gave up. */
|
|
1524
|
-
type StepUpHandler = () => Promise<boolean>;
|
|
1525
|
-
/** The step-up dialog registers itself here (`StepUpDialog`, drawn by `AbpProvider`); null when it goes. */
|
|
1526
|
-
declare function setStepUpHandler(next: StepUpHandler | null): void;
|
|
1527
|
-
/**
|
|
1528
|
-
* Asks the person to confirm who they are, once however many calls are waiting for it (ADR 0109 amendment). False when
|
|
1529
|
-
* nothing is registered to ask with: the call then fails with the server's `step_up_required`, as it would without.
|
|
1530
|
-
*/
|
|
1531
|
-
declare function requestStepUp(): Promise<boolean>;
|
|
1532
|
-
|
|
1533
1556
|
/** Whether what was typed can be a code yet: six digits (spaces between are fine), or a recovery code's ten characters. */
|
|
1534
1557
|
declare function looksLikeCode(value: string, recovery: boolean): boolean;
|
|
1535
1558
|
/**
|
|
1536
|
-
*
|
|
1537
|
-
*
|
|
1538
|
-
*
|
|
1539
|
-
* the
|
|
1540
|
-
*
|
|
1559
|
+
* Confirms the person before a sensitive action (ADR 0109 amendment, on AbpGuard's step-up): the server answers 403
|
|
1560
|
+
* `step_up_required`, the host's request asks here, and the call is tried again once confirmed.
|
|
1561
|
+
*
|
|
1562
|
+
* - At the password level: the password, and a code of their second factor when they have one (their app, a recovery
|
|
1563
|
+
* code, or one the site sends).
|
|
1564
|
+
* - At the strong level (AbpGuard 0.7.0): a passkey first when they have one, or an authenticator code: alone where the
|
|
1565
|
+
* server says one passes alone (`appCodeAlone`, the operator's setting), else with the password. Where a code passes
|
|
1566
|
+
* alone it's offered at the password level too.
|
|
1567
|
+
* - Asked for a strong step-up with no strong factor (`strong_factor_required`): the password, then setting up a passkey
|
|
1568
|
+
* or the app here (with recovery codes, shown once, for a first factor); the call then asks again, and they confirm
|
|
1569
|
+
* with what they set up.
|
|
1570
|
+
*
|
|
1571
|
+
* Too many wrong passwords end the session (401), which the host's request hands to the host. `AbpProvider` draws it
|
|
1572
|
+
* when the host gives `paths.guard`; a host with its own dialog sets `stepUpDialog: false`.
|
|
1541
1573
|
*/
|
|
1542
1574
|
declare function StepUpDialog(): react.JSX.Element;
|
|
1543
1575
|
|
|
@@ -2763,4 +2795,4 @@ interface TooltipProps extends Omit<Tooltip$1.RootProps, 'children'> {
|
|
|
2763
2795
|
*/
|
|
2764
2796
|
declare const Tooltip: react.ForwardRefExoticComponent<TooltipProps & react.RefAttributes<HTMLDivElement>>;
|
|
2765
2797
|
|
|
2766
|
-
export { ABP_UI_VERSION, AbpApiError, type AbpBrand, type AbpHost, type AbpLabels, AbpProvider, type AbpProviderProps, type AbpSystemOptions, type ApiQuery, AppLink, type AppLinkProps, AppShell, type AppShellBrand, type AppShellNavItem, type AppShellNavSection, type AppShellPlace, type AppShellProps, type AppShellSidebar, type AreaTexts, type Arrival, ArriveOnChange, type ArriveOnChangeProps, AttentionChip, type AttentionChipProps, type AvatarPerson, AvatarStack, type AvatarStackProps, Bone, type BoneProps, type BreadcrumbItem, Breadcrumbs, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CalendarGrid, type CalendarGridProps, type CalendarItem, type CardDates, CategoryProgress, type CategoryProgressProps, type CelebrateTarget, Chart, type ChartProps, type ChartSeries, CheckboxField, type CheckboxFieldProps, Collapse, type CollapseProps, type ColorMode, ColorModeProvider, ColorModeToggle, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmOptions, ConfirmProvider, CountBadge, type CountBadgeProps, Counter, type CounterProps, DashboardGrid, type DashboardGridProps, DataTable, type DataTableColumn, type DataTableProps, type DataTableSelection, type DataTableSort, type Direction, DirectionalIcon, DropHint, type DropHintProps, type DropZoneOptions, type DropZoneState, type DroppedFile, EMPTY_VALUE, EmptyState, type EmptyStateProps, FadeIn, type FadeInProps, Field, type FieldProps, FileDropArea, type FileDropAreaProps, FormDialog, type FormDialogProps, FormField, type GridItem, HighlightText, type HostEventHandler, type HostEvents, type HostFile, type HostLanguage, HostProvider, type HostRequest, type HostRequestInit, type HostRequestOptions, type HostScope, HostSlot, IconButton, type IconButtonProps, IconTile, type IconTileProps, Indicator, type IndicatorProps, InlineAlert, type InlineAlertProps, KanbanBoard, type KanbanBoardProps, type KanbanColumn, type KanbanItem, type KanbanLane, type KanbanMove, type LinkComponent, Loading, type LoadingProps, LoadingState, MotionProvider, type MotionSetting, type MotionState, Nudge, type NudgeProps, PageHeader, type PageHeaderProps, PageTitleProvider, Pagination, type PaginationProps, Panel, type PanelProps, PanelTone, type Particle, PathChips, type PathChipsProps, PersonChip, type PersonChipProps, type PlacedCard, PluginTextsProvider, type Pose, Presence, PresenceItem, type PresenceItemProps, PresenceList, type PresenceListProps, type PresenceProps, Pressable, type PressableProps, PriorityMark, type PriorityMarkProps, type PropertyItem, PropertyList, type PropertyListProps, type QueryConditionJson, type QueryExportFormat, type QueryField, type QueryGroup, type QueryJson, type QueryListLabels, type QueryNodeJson, type QueryRow, type QuerySuggestion, type QuerySuggestions, type QueryValueEditor, QueryableList, type QueryableListError, type QueryableListExport, type QueryableListProps, type QueryableListState, type QueryableListView, type QueueProgress, RecordKey, type RecordKeyProps, type RegisterSlotSave, Reveal, RevealItem, type RevealItemProps, type RevealProps, SHOWN, STEP_UP_REQUIRED, type Scale, SearchInput, type SearchInputProps, type SectionMove, SegmentedControl, type SegmentedControlProps, type SegmentedItem, SelectField, type SelectFieldProps, type SelectOption, type SettingsArea, SettingsLayout, type SettingsLayoutProps, type SettingsPage, type SettingsSection, SlideItem, type SlideItemProps, SlideList, type SlideListProps, type SlotSave, type SortDirection, type SortableSection, SortableSections, type SortableSectionsProps, type StatusCategory, StatusPill, type StatusPillProps, type StatusTone, StepUpDialog, type StepUpHandler, Swap, type SwapProps, SwitchField, type SwitchFieldProps, TITLE_SEPARATOR, TextBone, type TextBoneProps, TextSlot, type TextSlotProps, type TimelineCardItem, TimelineCards, type TimelineCardsProps, TimelineChart, type TimelineChartProps, type TimelineItem, type TimelineRow, type TimelineScale, type TitleParts, Toaster, Tooltip, type TooltipProps, UPLOADS_AT_ONCE, type UploadJob, UploadList, type UploadListProps, type UploadRow, type UploadState, abpConfig, arriveCss, asMotionSetting, avatarPalette, basicConditions, boneWidth, burst, compactLayout, compareOrdinal, composeTitle, covers, createAbpSystem, createAreaTexts, createHostEvents, createHostRequest, curves, defaultBrand, defaultLabels, defaultQueryListLabels, directionOf, droppedFiles, errorText, fileNameOf, findSettingsPage, folderOf, foldersFor, formatDateTime, formatMessage, formatNumber, ghostCss, groupKey, heavierFirst, hiddenPose, inSections, isStepUp, looksLikeCode, durations as motionDurations, notify, pageList, partsOf, pastedName, placeCards, placeItem, priorityLevel, progressOf, readAbpError, readEvents, refusal, requestStepUp, setStepUpHandler, settingsArea, shineCss, springs, staggerDelay, targetOf, toStart, toaster, useAbpLabels, useAbpLocale, useAbpTimeZone, useApiAction, useApiDownload, useApiQuery, useAreaEvents, useAreaRequest, useArriving, useCan, useCelebrate, useColorMode, useConfirm, useDropZone, useFilesOverPage, useFormatters, useHost, useHostLanguages, useLinkComponent, useLoading, useMe, useMotionSetting, useNames, useNavigate, useOptionalHost, usePageDrop, usePageTitle, usePageTitleParts, usePageTitleSite, usePastedFiles, usePluginTexts, useProductName, useSlotSaves, useTokenVar };
|
|
2798
|
+
export { ABP_UI_VERSION, AbpApiError, type AbpBrand, type AbpHost, type AbpLabels, AbpProvider, type AbpProviderProps, type AbpSystemOptions, type ApiQuery, AppLink, type AppLinkProps, AppShell, type AppShellBrand, type AppShellNavItem, type AppShellNavSection, type AppShellPlace, type AppShellProps, type AppShellSidebar, type AreaTexts, type Arrival, ArriveOnChange, type ArriveOnChangeProps, AttentionChip, type AttentionChipProps, type AvatarPerson, AvatarStack, type AvatarStackProps, Bone, type BoneProps, type BreadcrumbItem, Breadcrumbs, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CalendarGrid, type CalendarGridProps, type CalendarItem, type CardDates, CategoryProgress, type CategoryProgressProps, type CelebrateTarget, Chart, type ChartProps, type ChartSeries, CheckboxField, type CheckboxFieldProps, Collapse, type CollapseProps, type ColorMode, ColorModeProvider, ColorModeToggle, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmOptions, ConfirmProvider, CountBadge, type CountBadgeProps, Counter, type CounterProps, DashboardGrid, type DashboardGridProps, DataTable, type DataTableColumn, type DataTableProps, type DataTableSelection, type DataTableSort, type Direction, DirectionalIcon, DropHint, type DropHintProps, type DropZoneOptions, type DropZoneState, type DroppedFile, EMPTY_VALUE, EmptyState, type EmptyStateProps, FadeIn, type FadeInProps, Field, type FieldProps, FileDropArea, type FileDropAreaProps, FormDialog, type FormDialogProps, FormField, type GridItem, HighlightText, type HostEventHandler, type HostEvents, type HostFile, type HostLanguage, HostProvider, type HostRequest, type HostRequestInit, type HostRequestOptions, type HostScope, HostSlot, IconButton, type IconButtonProps, IconTile, type IconTileProps, Indicator, type IndicatorProps, InlineAlert, type InlineAlertProps, KanbanBoard, type KanbanBoardProps, type KanbanColumn, type KanbanItem, type KanbanLane, type KanbanMove, type LinkComponent, Loading, type LoadingProps, LoadingState, MotionProvider, type MotionSetting, type MotionState, Nudge, type NudgeProps, PageHeader, type PageHeaderProps, PageTitleProvider, Pagination, type PaginationProps, Panel, type PanelProps, PanelTone, type Particle, PathChips, type PathChipsProps, PersonChip, type PersonChipProps, type PlacedCard, PluginTextsProvider, type Pose, Presence, PresenceItem, type PresenceItemProps, PresenceList, type PresenceListProps, type PresenceProps, Pressable, type PressableProps, PriorityMark, type PriorityMarkProps, type PropertyItem, PropertyList, type PropertyListProps, type QueryConditionJson, type QueryExportFormat, type QueryField, type QueryGroup, type QueryJson, type QueryListLabels, type QueryNodeJson, type QueryRow, type QuerySuggestion, type QuerySuggestions, type QueryValueEditor, QueryableList, type QueryableListError, type QueryableListExport, type QueryableListProps, type QueryableListState, type QueryableListView, type QueueProgress, RecordKey, type RecordKeyProps, type RegisterSlotSave, Reveal, RevealItem, type RevealItemProps, type RevealProps, SHOWN, STEP_UP_REQUIRED, STRONG_FACTOR_REQUIRED, type Scale, SearchInput, type SearchInputProps, type SectionMove, SegmentedControl, type SegmentedControlProps, type SegmentedItem, SelectField, type SelectFieldProps, type SelectOption, type SettingsArea, SettingsLayout, type SettingsLayoutProps, type SettingsPage, type SettingsSection, SlideItem, type SlideItemProps, SlideList, type SlideListProps, type SlotSave, type SortDirection, type SortableSection, SortableSections, type SortableSectionsProps, type StatusCategory, StatusPill, type StatusPillProps, type StatusTone, StepUpDialog, type StepUpHandler, type StepUpNeed, Swap, type SwapProps, SwitchField, type SwitchFieldProps, TITLE_SEPARATOR, TextBone, type TextBoneProps, TextSlot, type TextSlotProps, type TimelineCardItem, TimelineCards, type TimelineCardsProps, TimelineChart, type TimelineChartProps, type TimelineItem, type TimelineRow, type TimelineScale, type TitleParts, Toaster, Tooltip, type TooltipProps, UPLOADS_AT_ONCE, type UploadJob, UploadList, type UploadListProps, type UploadRow, type UploadState, abpConfig, arriveCss, asMotionSetting, avatarPalette, basicConditions, boneWidth, burst, compactLayout, compareOrdinal, composeTitle, covers, createAbpSystem, createAreaTexts, createHostEvents, createHostRequest, curves, defaultBrand, defaultLabels, defaultQueryListLabels, directionOf, droppedFiles, errorText, fileNameOf, findSettingsPage, folderOf, foldersFor, formatDateTime, formatMessage, formatNumber, ghostCss, groupKey, heavierFirst, hiddenPose, inSections, isStepUp, looksLikeCode, durations as motionDurations, needsStepUp, notify, pageList, partsOf, pastedName, placeCards, placeItem, priorityLevel, progressOf, readAbpError, readEvents, refusal, requestStepUp, setStepUpHandler, settingsArea, shineCss, springs, staggerDelay, stepUpNeedOf, targetOf, toStart, toaster, useAbpLabels, useAbpLocale, useAbpTimeZone, useApiAction, useApiDownload, useApiQuery, useAreaEvents, useAreaRequest, useArriving, useCan, useCelebrate, useColorMode, useConfirm, useDropZone, useFilesOverPage, useFormatters, useHost, useHostLanguages, useLinkComponent, useLoading, useMe, useMotionSetting, useNames, useNavigate, useOptionalHost, usePageDrop, usePageTitle, usePageTitleParts, usePageTitleSite, usePastedFiles, usePluginTexts, useProductName, useSlotSaves, useTokenVar };
|