@abpjs/ui 0.2.0-next.14 → 0.2.0-next.15
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 +9 -0
- package/dist/guard.d.ts +70 -7
- package/dist/guard.js +850 -356
- package/dist/guard.js.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.0-next.15
|
|
4
|
+
|
|
5
|
+
A prerelease under npm's `next` tag.
|
|
6
|
+
|
|
7
|
+
- guard: a person's own second factors (`MySecondFactorsPanel`): passkeys added, renamed and removed, the authenticator
|
|
8
|
+
app set up, factors removed, new recovery codes; the step-ups through the foundation's dialog. `StrongFactorBanner`
|
|
9
|
+
for a site admin's strong-factor deadline, from the host's `me`. A host names its own code senders through
|
|
10
|
+
`secondFactor.sender.{method}`. The area uses the foundation's `ListFooter` and `useSettledValue`.
|
|
11
|
+
|
|
3
12
|
## 0.2.0-next.14
|
|
4
13
|
|
|
5
14
|
A prerelease under npm's `next` tag: the third area, `guard`.
|
package/dist/guard.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { ListSource
|
|
3
|
+
import { ListSource } from '@abpjs/ui';
|
|
4
4
|
|
|
5
5
|
interface components {
|
|
6
6
|
schemas: {
|
|
@@ -1171,6 +1171,8 @@ type EffectiveGroupDto = Schemas['EffectiveGroupDto'];
|
|
|
1171
1171
|
type EffectiveMemberDto = Schemas['EffectiveMemberDto'];
|
|
1172
1172
|
type SecondFactorDto = Schemas['SecondFactorDto'];
|
|
1173
1173
|
type MySecondFactorsDto = Schemas['MySecondFactorsDto'];
|
|
1174
|
+
type AppEnrolmentDto = Schemas['AppEnrolmentDto'];
|
|
1175
|
+
type SecondFactorSenderDto = Schemas['SecondFactorSenderDto'];
|
|
1174
1176
|
type SignUpSettingsDto = Schemas['SignUpSettingsDto'];
|
|
1175
1177
|
type SignUpSettingsInput = Schemas['SignUpSettingsInput'];
|
|
1176
1178
|
type AnonymousGrantDto = Schemas['AnonymousGrantDto'];
|
|
@@ -1389,11 +1391,6 @@ declare function GroupTwoFactorPanel({ group, onSaved }: {
|
|
|
1389
1391
|
onSaved: (updated: GroupDto) => void;
|
|
1390
1392
|
}): react.JSX.Element;
|
|
1391
1393
|
|
|
1392
|
-
/** A paged list's foot: its pages, and which rows of how many show, in the foundation's words. */
|
|
1393
|
-
declare function ListFooter<T>({ list }: {
|
|
1394
|
-
list: ListState<T>;
|
|
1395
|
-
}): react.JSX.Element | null;
|
|
1396
|
-
|
|
1397
1394
|
/**
|
|
1398
1395
|
* A count as a person reads it: `merge.count.{key}` with its dots as underscores (`records.reporter` as
|
|
1399
1396
|
* `merge.count.records_reporter`), which a host gives for its own modules' counts through `AbpHost.texts.guard`; else
|
|
@@ -1432,12 +1429,62 @@ interface MergeScreenProps {
|
|
|
1432
1429
|
*/
|
|
1433
1430
|
declare function MergeScreen({ id, into, routes }: MergeScreenProps): react.JSX.Element;
|
|
1434
1431
|
|
|
1432
|
+
interface MySecondFactorsPanelProps {
|
|
1433
|
+
/** Start setting up an authenticator app at once (signing in sent the person here because a group offers one). */
|
|
1434
|
+
setUpNow?: boolean;
|
|
1435
|
+
/** The person opened or closed the setup: a host that asked through its address forgets it, so a reload doesn't start again. */
|
|
1436
|
+
onSetUpChosen?: (settingUp: boolean) => void;
|
|
1437
|
+
/** Their factors changed: a host refreshes what it knows of the person (whether they have a strong factor). */
|
|
1438
|
+
onChange?: () => void;
|
|
1439
|
+
}
|
|
1440
|
+
/**
|
|
1441
|
+
* The person's own two-factor sign-in: what their groups ask, their passkeys (named, so they know which device) and
|
|
1442
|
+
* authenticator apps, and the recovery codes left. Adding one, removing one and new recovery codes each are a step-up,
|
|
1443
|
+
* a strong one once they have a strong factor, asked by the foundation's step-up dialog.
|
|
1444
|
+
*/
|
|
1445
|
+
declare function MySecondFactorsPanel({ setUpNow, onSetUpChosen, onChange }: MySecondFactorsPanelProps): react.JSX.Element;
|
|
1446
|
+
|
|
1435
1447
|
/**
|
|
1436
1448
|
* A name as the reader sees it: in their language when one was written for it (a person's, a group's), else the name as
|
|
1437
1449
|
* written, which is the English one.
|
|
1438
1450
|
*/
|
|
1439
1451
|
declare function useWrittenName(): (name: string, names?: Record<string, string> | null) => string;
|
|
1440
1452
|
|
|
1453
|
+
/** The authenticator app's base32 key in groups of four, easier to type into an app. */
|
|
1454
|
+
declare function groupedKey(secret: string): string;
|
|
1455
|
+
/**
|
|
1456
|
+
* A way a code is sent, in the person's language: `secondFactor.sender.{method}` when the host gives it (its non-word
|
|
1457
|
+
* characters as underscores: `acme.messaging:sms` is `secondFactor.sender.acme_messaging_sms`), email by name, else the
|
|
1458
|
+
* name the sender gives itself.
|
|
1459
|
+
*/
|
|
1460
|
+
declare function useSenderName(): (sender: SecondFactorSenderDto) => string;
|
|
1461
|
+
/** A code field for six digits, or a recovery code: what a phone's keyboard and a password manager should offer. */
|
|
1462
|
+
declare function CodeInput({ recovery, value, onChange, autoFocus, }: {
|
|
1463
|
+
recovery?: boolean;
|
|
1464
|
+
value: string;
|
|
1465
|
+
onChange: (v: string) => void;
|
|
1466
|
+
autoFocus?: boolean;
|
|
1467
|
+
}): react.JSX.Element;
|
|
1468
|
+
interface AppSetupProps {
|
|
1469
|
+
/** Makes the secret: the key, its `otpauth:` address and its QR code. */
|
|
1470
|
+
start: () => Promise<AppEnrolmentDto>;
|
|
1471
|
+
/** Checks the first code: the recovery codes (null when the person has some already), or false for a wrong code. */
|
|
1472
|
+
confirm: (code: string) => Promise<string[] | null | false>;
|
|
1473
|
+
onDone: (recoveryCodes: string[] | null) => void;
|
|
1474
|
+
onCancel?: () => void;
|
|
1475
|
+
}
|
|
1476
|
+
/**
|
|
1477
|
+
* Setting up an authenticator app: the QR code to scan, the key to type in, a link that opens an app on this device,
|
|
1478
|
+
* and the first code.
|
|
1479
|
+
*/
|
|
1480
|
+
declare function AppSetup({ start, confirm, onDone, onCancel }: AppSetupProps): react.JSX.Element;
|
|
1481
|
+
/** Recovery codes, shown once: to copy or download, and a button for when they're saved. */
|
|
1482
|
+
declare function RecoveryCodes({ codes, onSaved, savedLabel }: {
|
|
1483
|
+
codes: string[];
|
|
1484
|
+
onSaved: () => void;
|
|
1485
|
+
savedLabel?: string;
|
|
1486
|
+
}): react.JSX.Element;
|
|
1487
|
+
|
|
1441
1488
|
/**
|
|
1442
1489
|
* Sign-up, for site admins: off by default. On, people create their own accounts in the internal directory chosen
|
|
1443
1490
|
* here, optionally only with an email in some domains; an account is active once its email is confirmed. Which places
|
|
@@ -1445,6 +1492,22 @@ declare function useWrittenName(): (name: string, names?: Record<string, string>
|
|
|
1445
1492
|
*/
|
|
1446
1493
|
declare function SignUpScreen(): react.JSX.Element;
|
|
1447
1494
|
|
|
1495
|
+
/** What AbpGuard says of a person's strong factor (`me.strongFactor`): whether they have one, and by when they must. */
|
|
1496
|
+
interface StrongFactorState {
|
|
1497
|
+
has: boolean;
|
|
1498
|
+
requiredBy?: string | null;
|
|
1499
|
+
overdue?: boolean;
|
|
1500
|
+
}
|
|
1501
|
+
/**
|
|
1502
|
+
* A site admin the operator requires a strong factor of, who has none yet: by when to set up a passkey or an
|
|
1503
|
+
* authenticator app, at the top of every page until they have. After the date, signing in asks them to set one up
|
|
1504
|
+
* before going on; until then it's this, never in the way of their work. Draws nothing otherwise.
|
|
1505
|
+
*/
|
|
1506
|
+
declare function StrongFactorBanner({ strongFactor, setUpHref }: {
|
|
1507
|
+
strongFactor?: StrongFactorState | null;
|
|
1508
|
+
setUpHref: string;
|
|
1509
|
+
}): react.JSX.Element | null;
|
|
1510
|
+
|
|
1448
1511
|
/** The API sends the status as a string; one this version doesn't know is shown as sent. */
|
|
1449
1512
|
declare function AccountStatusPill({ status }: {
|
|
1450
1513
|
status: string;
|
|
@@ -1481,4 +1544,4 @@ declare function useGuardNs(namespace: string): GuardText;
|
|
|
1481
1544
|
*/
|
|
1482
1545
|
declare function withParts(text: string, parts: Record<string, ReactNode>): ReactNode;
|
|
1483
1546
|
|
|
1484
|
-
export { type AccountAction, type AccountCanDto, type AccountDetailDto, type AccountDto, type AccountEmailsDto, AccountEmailsPanel, type AccountEmailsPanelProps, type AccountMergeDto, type AccountNameDto, AccountNameEditor, type AccountNameEditorProps, type AccountPage, AccountScreen, type AccountScreenProps, AccountSecondFactorPanel, type AccountSecondFactorPanelProps, type AccountStatus, AccountStatusPill, type AccountSummaryDto, AccountsScreen, type AccountsScreenProps, type AnonymousGrantDto, AnonymousScreen, type ConnectionTestResult, CountList, DirectoriesScreen, type DirectoryDto, DirectoryForm, type DirectoryFormProps, type DirectoryInput, DirectoryScreen, type DirectorySettingDefinition, type DirectoryTypeDto, DirectoryWarnings, type DuplicateDto, DuplicatesPanel, type EffectiveGroupDto, type EffectiveMemberDto, FlagPill, type GroupDetailDto, type GroupDto, type GroupMemberDto, type GroupPage, GroupScreen, type GroupScreenProps, GroupTree, type GroupTreeProps, GroupTwoFactorPanel, GroupsScreen, type GroupsScreenProps, type GuardRoutes, type GuardText, type GuardTypes, type IdentityDto,
|
|
1547
|
+
export { type AccountAction, type AccountCanDto, type AccountDetailDto, type AccountDto, type AccountEmailsDto, AccountEmailsPanel, type AccountEmailsPanelProps, type AccountMergeDto, type AccountNameDto, AccountNameEditor, type AccountNameEditorProps, type AccountPage, AccountScreen, type AccountScreenProps, AccountSecondFactorPanel, type AccountSecondFactorPanelProps, type AccountStatus, AccountStatusPill, type AccountSummaryDto, AccountsScreen, type AccountsScreenProps, type AnonymousGrantDto, AnonymousScreen, type AppEnrolmentDto, AppSetup, type AppSetupProps, CodeInput, type ConnectionTestResult, CountList, DirectoriesScreen, type DirectoryDto, DirectoryForm, type DirectoryFormProps, type DirectoryInput, DirectoryScreen, type DirectorySettingDefinition, type DirectoryTypeDto, DirectoryWarnings, type DuplicateDto, DuplicatesPanel, type EffectiveGroupDto, type EffectiveMemberDto, FlagPill, type GroupDetailDto, type GroupDto, type GroupMemberDto, type GroupPage, GroupScreen, type GroupScreenProps, GroupTree, type GroupTreeProps, GroupTwoFactorPanel, GroupsScreen, type GroupsScreenProps, type GuardRoutes, type GuardText, type GuardTypes, type IdentityDto, type MergeCountDto, type MergePreviewDto, MergeScreen, type MergeScreenProps, MergesPanel, type MergesPanelProps, type MySecondFactorsDto, MySecondFactorsPanel, type MySecondFactorsPanelProps, PassFail, type PluginState, PluginStatePill, RecoveryCodes, type SecondFactorDto, type SecondFactorSenderDto, SignUpScreen, type SignUpSettingsDto, type SignUpSettingsInput, StrongFactorBanner, type StrongFactorState, SyncResultPill, type SyncRunDto, SyncStatus, TWO_FACTOR_MODES, type TestLoginResult, type TestLoginStepName, groupedKey, guardRoutes, num, useAccountCan, useCountLabel, useGuardNs, useGuardTexts, usePartLabel, useSenderName, useWrittenName, withParts };
|