@abpjs/ui 0.2.0-next.14 → 0.2.0-next.16
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 +16 -0
- package/dist/guard.d.ts +87 -7
- package/dist/guard.js +856 -360
- 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,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.0-next.16
|
|
4
|
+
|
|
5
|
+
A prerelease under npm's `next` tag.
|
|
6
|
+
|
|
7
|
+
- guard: `CreateAccountPanel` and `CreateGroupPanel` exported, for a host that keeps its own accounts or groups list
|
|
8
|
+
(saved views, column choice) and takes the rest of the area.
|
|
9
|
+
|
|
10
|
+
## 0.2.0-next.15
|
|
11
|
+
|
|
12
|
+
A prerelease under npm's `next` tag.
|
|
13
|
+
|
|
14
|
+
- guard: a person's own second factors (`MySecondFactorsPanel`): passkeys added, renamed and removed, the authenticator
|
|
15
|
+
app set up, factors removed, new recovery codes; the step-ups through the foundation's dialog. `StrongFactorBanner`
|
|
16
|
+
for a site admin's strong-factor deadline, from the host's `me`. A host names its own code senders through
|
|
17
|
+
`secondFactor.sender.{method}`. The area uses the foundation's `ListFooter` and `useSettledValue`.
|
|
18
|
+
|
|
3
19
|
## 0.2.0-next.14
|
|
4
20
|
|
|
5
21
|
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'];
|
|
@@ -1285,6 +1287,14 @@ interface AccountsScreenProps {
|
|
|
1285
1287
|
* by any column but the directory. A site admin creates internal accounts here, and sees accounts that share an address.
|
|
1286
1288
|
*/
|
|
1287
1289
|
declare function AccountsScreen({ routes, source }: AccountsScreenProps): react.JSX.Element;
|
|
1290
|
+
/**
|
|
1291
|
+
* Creating an internal account: username, display name, an optional address and a password, in AbpGuard's own internal
|
|
1292
|
+
* directory or another internal one when there are several. For a host's own accounts page too.
|
|
1293
|
+
*/
|
|
1294
|
+
declare function CreateAccountPanel({ onDone, onCancel }: {
|
|
1295
|
+
onDone: (created: AccountDto) => void;
|
|
1296
|
+
onCancel: () => void;
|
|
1297
|
+
}): react.JSX.Element;
|
|
1288
1298
|
|
|
1289
1299
|
/**
|
|
1290
1300
|
* Anonymous access, for site admins: every role given to anonymous visitors, in one place, because anyone on the
|
|
@@ -1368,6 +1378,15 @@ interface GroupsScreenProps {
|
|
|
1368
1378
|
* A site admin creates groups here: a group, or an organization customers join by their address's domain.
|
|
1369
1379
|
*/
|
|
1370
1380
|
declare function GroupsScreen({ routes, source }: GroupsScreenProps): react.JSX.Element;
|
|
1381
|
+
/**
|
|
1382
|
+
* Creating a group: its name by language, a description, the directory it's in (the internal one by default), and its
|
|
1383
|
+
* kind; an organization takes the email domains whose people join it. For a host's own groups page too.
|
|
1384
|
+
*/
|
|
1385
|
+
declare function CreateGroupPanel({ directories, onDone, onCancel }: {
|
|
1386
|
+
directories: DirectoryDto[];
|
|
1387
|
+
onDone: (created: GroupDto) => void;
|
|
1388
|
+
onCancel: () => void;
|
|
1389
|
+
}): react.JSX.Element;
|
|
1371
1390
|
|
|
1372
1391
|
interface GroupTreeProps {
|
|
1373
1392
|
rootId: string;
|
|
@@ -1389,11 +1408,6 @@ declare function GroupTwoFactorPanel({ group, onSaved }: {
|
|
|
1389
1408
|
onSaved: (updated: GroupDto) => void;
|
|
1390
1409
|
}): react.JSX.Element;
|
|
1391
1410
|
|
|
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
1411
|
/**
|
|
1398
1412
|
* A count as a person reads it: `merge.count.{key}` with its dots as underscores (`records.reporter` as
|
|
1399
1413
|
* `merge.count.records_reporter`), which a host gives for its own modules' counts through `AbpHost.texts.guard`; else
|
|
@@ -1432,12 +1446,62 @@ interface MergeScreenProps {
|
|
|
1432
1446
|
*/
|
|
1433
1447
|
declare function MergeScreen({ id, into, routes }: MergeScreenProps): react.JSX.Element;
|
|
1434
1448
|
|
|
1449
|
+
interface MySecondFactorsPanelProps {
|
|
1450
|
+
/** Start setting up an authenticator app at once (signing in sent the person here because a group offers one). */
|
|
1451
|
+
setUpNow?: boolean;
|
|
1452
|
+
/** The person opened or closed the setup: a host that asked through its address forgets it, so a reload doesn't start again. */
|
|
1453
|
+
onSetUpChosen?: (settingUp: boolean) => void;
|
|
1454
|
+
/** Their factors changed: a host refreshes what it knows of the person (whether they have a strong factor). */
|
|
1455
|
+
onChange?: () => void;
|
|
1456
|
+
}
|
|
1457
|
+
/**
|
|
1458
|
+
* The person's own two-factor sign-in: what their groups ask, their passkeys (named, so they know which device) and
|
|
1459
|
+
* authenticator apps, and the recovery codes left. Adding one, removing one and new recovery codes each are a step-up,
|
|
1460
|
+
* a strong one once they have a strong factor, asked by the foundation's step-up dialog.
|
|
1461
|
+
*/
|
|
1462
|
+
declare function MySecondFactorsPanel({ setUpNow, onSetUpChosen, onChange }: MySecondFactorsPanelProps): react.JSX.Element;
|
|
1463
|
+
|
|
1435
1464
|
/**
|
|
1436
1465
|
* 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
1466
|
* written, which is the English one.
|
|
1438
1467
|
*/
|
|
1439
1468
|
declare function useWrittenName(): (name: string, names?: Record<string, string> | null) => string;
|
|
1440
1469
|
|
|
1470
|
+
/** The authenticator app's base32 key in groups of four, easier to type into an app. */
|
|
1471
|
+
declare function groupedKey(secret: string): string;
|
|
1472
|
+
/**
|
|
1473
|
+
* A way a code is sent, in the person's language: `secondFactor.sender.{method}` when the host gives it (its non-word
|
|
1474
|
+
* characters as underscores: `acme.messaging:sms` is `secondFactor.sender.acme_messaging_sms`), email by name, else the
|
|
1475
|
+
* name the sender gives itself.
|
|
1476
|
+
*/
|
|
1477
|
+
declare function useSenderName(): (sender: SecondFactorSenderDto) => string;
|
|
1478
|
+
/** A code field for six digits, or a recovery code: what a phone's keyboard and a password manager should offer. */
|
|
1479
|
+
declare function CodeInput({ recovery, value, onChange, autoFocus, }: {
|
|
1480
|
+
recovery?: boolean;
|
|
1481
|
+
value: string;
|
|
1482
|
+
onChange: (v: string) => void;
|
|
1483
|
+
autoFocus?: boolean;
|
|
1484
|
+
}): react.JSX.Element;
|
|
1485
|
+
interface AppSetupProps {
|
|
1486
|
+
/** Makes the secret: the key, its `otpauth:` address and its QR code. */
|
|
1487
|
+
start: () => Promise<AppEnrolmentDto>;
|
|
1488
|
+
/** Checks the first code: the recovery codes (null when the person has some already), or false for a wrong code. */
|
|
1489
|
+
confirm: (code: string) => Promise<string[] | null | false>;
|
|
1490
|
+
onDone: (recoveryCodes: string[] | null) => void;
|
|
1491
|
+
onCancel?: () => void;
|
|
1492
|
+
}
|
|
1493
|
+
/**
|
|
1494
|
+
* Setting up an authenticator app: the QR code to scan, the key to type in, a link that opens an app on this device,
|
|
1495
|
+
* and the first code.
|
|
1496
|
+
*/
|
|
1497
|
+
declare function AppSetup({ start, confirm, onDone, onCancel }: AppSetupProps): react.JSX.Element;
|
|
1498
|
+
/** Recovery codes, shown once: to copy or download, and a button for when they're saved. */
|
|
1499
|
+
declare function RecoveryCodes({ codes, onSaved, savedLabel }: {
|
|
1500
|
+
codes: string[];
|
|
1501
|
+
onSaved: () => void;
|
|
1502
|
+
savedLabel?: string;
|
|
1503
|
+
}): react.JSX.Element;
|
|
1504
|
+
|
|
1441
1505
|
/**
|
|
1442
1506
|
* Sign-up, for site admins: off by default. On, people create their own accounts in the internal directory chosen
|
|
1443
1507
|
* here, optionally only with an email in some domains; an account is active once its email is confirmed. Which places
|
|
@@ -1445,6 +1509,22 @@ declare function useWrittenName(): (name: string, names?: Record<string, string>
|
|
|
1445
1509
|
*/
|
|
1446
1510
|
declare function SignUpScreen(): react.JSX.Element;
|
|
1447
1511
|
|
|
1512
|
+
/** What AbpGuard says of a person's strong factor (`me.strongFactor`): whether they have one, and by when they must. */
|
|
1513
|
+
interface StrongFactorState {
|
|
1514
|
+
has: boolean;
|
|
1515
|
+
requiredBy?: string | null;
|
|
1516
|
+
overdue?: boolean;
|
|
1517
|
+
}
|
|
1518
|
+
/**
|
|
1519
|
+
* A site admin the operator requires a strong factor of, who has none yet: by when to set up a passkey or an
|
|
1520
|
+
* authenticator app, at the top of every page until they have. After the date, signing in asks them to set one up
|
|
1521
|
+
* before going on; until then it's this, never in the way of their work. Draws nothing otherwise.
|
|
1522
|
+
*/
|
|
1523
|
+
declare function StrongFactorBanner({ strongFactor, setUpHref }: {
|
|
1524
|
+
strongFactor?: StrongFactorState | null;
|
|
1525
|
+
setUpHref: string;
|
|
1526
|
+
}): react.JSX.Element | null;
|
|
1527
|
+
|
|
1448
1528
|
/** The API sends the status as a string; one this version doesn't know is shown as sent. */
|
|
1449
1529
|
declare function AccountStatusPill({ status }: {
|
|
1450
1530
|
status: string;
|
|
@@ -1481,4 +1561,4 @@ declare function useGuardNs(namespace: string): GuardText;
|
|
|
1481
1561
|
*/
|
|
1482
1562
|
declare function withParts(text: string, parts: Record<string, ReactNode>): ReactNode;
|
|
1483
1563
|
|
|
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,
|
|
1564
|
+
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, CreateAccountPanel, CreateGroupPanel, 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 };
|