Bundled output for commit 9342903d68

Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
This commit is contained in:
flarum-bot 2023-02-21 13:29:36 +00:00
parent 9342903d68
commit 598ff21d7d
12 changed files with 135 additions and 5 deletions

View File

@ -1,6 +1,7 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" />
import type Mithril from 'mithril';
import type User from '../../common/models/User';
import type { IPageAttrs } from '../../common/components/Page';
import ItemList from '../../common/utils/ItemList';
import AdminPage from './AdminPage';
declare type ColumnData = {
@ -27,6 +28,10 @@ export default class UserListPage extends AdminPage {
* Current page number. Zero-indexed.
*/
private pageNumber;
/**
* Page number being loaded. Zero-indexed.
*/
private loadingPageNumber;
/**
* Total number of forum users.
*
@ -50,6 +55,7 @@ export default class UserListPage extends AdminPage {
*/
private moreData;
private isLoadingPage;
oninit(vnode: Mithril.Vnode<IPageAttrs, this>): void;
/**
* Component to render.
*/
@ -78,10 +84,15 @@ export default class UserListPage extends AdminPage {
*
* Uses the `this.numPerPage` as the response limit, and automatically calculates the offset required from `pageNumber`.
*
* @param pageNumber The page number to load and display
* @param pageNumber The **zero-based** page number to load and display
*/
loadPage(pageNumber: number): Promise<void>;
nextPage(): void;
previousPage(): void;
/**
* @param page The **1-based** page number
*/
goToPage(page: number): void;
private setPageNumberInUrl;
}
export {};

View File

@ -0,0 +1,15 @@
import Component, { ComponentAttrs } from '../Component';
import type Mithril from 'mithril';
export interface ILabelValueAttrs extends ComponentAttrs {
label: Mithril.Children;
value: Mithril.Children;
}
/**
* A generic component for displaying a label and value inline.
* Created to avoid reinventing the wheel.
*
* `label: value`
*/
export default class LabelValue<CustomAttrs extends ILabelValueAttrs = ILabelValueAttrs> extends Component<CustomAttrs> {
view(vnode: Mithril.Vnode<CustomAttrs, this>): Mithril.Children;
}

View File

@ -0,0 +1,13 @@
import Model from '../Model';
export default class AccessToken extends Model {
token(): string | undefined;
userId(): string;
title(): string | null;
type(): string;
createdAt(): Date;
lastActivityAt(): Date;
lastIpAddress(): string;
device(): string;
isCurrent(): boolean;
isSessionToken(): boolean;
}

View File

@ -27,4 +27,8 @@ export declare namespace getPlainContent {
* Make a string's first character uppercase.
*/
export declare function ucfirst(string: string): string;
/**
* Transform a camel case string to snake case.
*/
export declare function camelCaseToSnakeCase(str: string): string;
export {};

View File

@ -0,0 +1,24 @@
import Component, { ComponentAttrs } from '../../common/Component';
import ItemList from '../../common/utils/ItemList';
import type Mithril from 'mithril';
import type AccessToken from '../../common/models/AccessToken';
import { NestedStringArray } from '@askvortsov/rich-icu-message-formatter';
export interface IAccessTokensListAttrs extends ComponentAttrs {
tokens: AccessToken[];
type: 'session' | 'developer_token';
hideTokens?: boolean;
icon?: string;
ondelete?: (token: AccessToken) => void;
}
export default class AccessTokensList<CustomAttrs extends IAccessTokensListAttrs = IAccessTokensListAttrs> extends Component<CustomAttrs> {
protected loading: Record<string, boolean | undefined>;
protected showingTokens: Record<string, boolean | undefined>;
view(vnode: Mithril.Vnode<CustomAttrs, this>): Mithril.Children;
tokenView(token: AccessToken): Mithril.Children;
tokenViewItems(token: AccessToken): ItemList<Mithril.Children>;
tokenInfoItems(token: AccessToken): ItemList<Mithril.Children>;
tokenActionItems(token: AccessToken): ItemList<Mithril.Children>;
revoke(token: AccessToken): Promise<void>;
generateTokenTitle(token: AccessToken): NestedStringArray;
tokenValueDisplay(token: AccessToken): Mithril.Children;
}

View File

@ -0,0 +1,16 @@
import Modal, { IInternalModalAttrs } from '../../common/components/Modal';
import Stream from '../../common/utils/Stream';
import type AccessToken from '../../common/models/AccessToken';
import type { SaveAttributes } from '../../common/Model';
import type Mithril from 'mithril';
export interface INewAccessTokenModalAttrs extends IInternalModalAttrs {
onsuccess: (token: AccessToken) => void;
}
export default class NewAccessTokenModal<CustomAttrs extends INewAccessTokenModalAttrs = INewAccessTokenModalAttrs> extends Modal<CustomAttrs> {
protected titleInput: Stream<string>;
className(): string;
title(): Mithril.Children;
content(): Mithril.Children;
submitData(): SaveAttributes;
onsubmit(e: SubmitEvent): void;
}

View File

@ -0,0 +1,27 @@
import UserPage, { IUserPageAttrs } from './UserPage';
import ItemList from '../../common/utils/ItemList';
import type Mithril from 'mithril';
import UserSecurityPageState from '../states/UserSecurityPageState';
/**
* The `UserSecurityPage` component displays the user's security control panel, in
* the context of their user profile.
*/
export default class UserSecurityPage<CustomAttrs extends IUserPageAttrs = IUserPageAttrs> extends UserPage<CustomAttrs, UserSecurityPageState> {
state: UserSecurityPageState;
oninit(vnode: Mithril.Vnode<CustomAttrs, this>): void;
content(): JSX.Element;
/**
* Build an item list for the user's settings controls.
*/
settingsItems(): ItemList<Mithril.Children>;
/**
* Build an item list for the user's access accessToken settings.
*/
developerTokensItems(): ItemList<Mithril.Children>;
/**
* Build an item list for the user's access accessToken settings.
*/
sessionsItems(): ItemList<Mithril.Children>;
loadTokens(): Promise<void>;
terminateAllOtherSessions(): Promise<void> | undefined;
}

View File

@ -0,0 +1,20 @@
import AccessToken from '../../common/models/AccessToken';
export default class UserSecurityPageState {
protected tokens: AccessToken[] | null;
protected loading: boolean;
isLoading(): boolean;
hasLoadedTokens(): boolean;
setLoading(loading: boolean): void;
getTokens(): AccessToken[] | null;
setTokens(tokens: AccessToken[]): void;
pushToken(token: AccessToken): void;
removeToken(token: AccessToken): void;
getSessionTokens(): AccessToken[];
getDeveloperTokens(): AccessToken[] | null;
/**
* Look up session tokens other than the current one.
*/
getOtherSessionTokens(): AccessToken[];
hasOtherActiveSessions(): boolean;
removeOtherSessionTokens(): void;
}

2
framework/core/js/dist/admin.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
framework/core/js/dist/forum.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long