@nubitio/admin 0.11.4 → 1.0.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/dist/index.cjs +779 -66
- package/dist/index.d.cts +60 -3
- package/dist/index.d.mts +60 -3
- package/dist/index.mjs +780 -71
- package/package.json +6 -6
package/dist/index.d.cts
CHANGED
|
@@ -151,12 +151,20 @@ type SessionFeatureEntitlement = {
|
|
|
151
151
|
enabled: boolean;
|
|
152
152
|
config: Record<string, unknown>;
|
|
153
153
|
};
|
|
154
|
+
type SessionPermissionLimit = {
|
|
155
|
+
amount: string;
|
|
156
|
+
currency: string;
|
|
157
|
+
scale: number;
|
|
158
|
+
};
|
|
154
159
|
type SessionProfile = {
|
|
155
160
|
username: string;
|
|
156
161
|
roles: string[]; /** Present when the backend runs nubitio/admin-bundle ≥ 0.1 session contract. */
|
|
157
162
|
appProfile?: AppProfile;
|
|
158
163
|
tenant?: SessionTenant;
|
|
159
|
-
features?: Record<string, SessionFeatureEntitlement>;
|
|
164
|
+
features?: Record<string, SessionFeatureEntitlement>; /** Effective `resource.action` names when the authorization module is on. */
|
|
165
|
+
permissions?: string[]; /** Permission name → amount cap, as `/api/me` publishes it. */
|
|
166
|
+
limits?: Record<string, SessionPermissionLimit>; /** IANA zone the UI must render timestamps in. Storage is always UTC. */
|
|
167
|
+
timeZone?: string;
|
|
160
168
|
};
|
|
161
169
|
type SessionState = {
|
|
162
170
|
status: 'loading';
|
|
@@ -343,6 +351,10 @@ declare function NotificationPanel({
|
|
|
343
351
|
}: NotificationPanelProps): React$1.JSX.Element;
|
|
344
352
|
//#endregion
|
|
345
353
|
//#region packages/admin/auth/LoginPage.d.ts
|
|
354
|
+
interface LoginOidcProvider {
|
|
355
|
+
id: string;
|
|
356
|
+
label: string;
|
|
357
|
+
}
|
|
346
358
|
interface LoginPageProps {
|
|
347
359
|
onLoggedIn: () => void;
|
|
348
360
|
apiBaseUrl?: string;
|
|
@@ -350,6 +362,8 @@ interface LoginPageProps {
|
|
|
350
362
|
title?: string;
|
|
351
363
|
hint?: string;
|
|
352
364
|
defaultUsername?: string;
|
|
365
|
+
oidcProviders?: LoginOidcProvider[];
|
|
366
|
+
forgotPasswordTo?: string;
|
|
353
367
|
}
|
|
354
368
|
declare function LoginPage({
|
|
355
369
|
onLoggedIn,
|
|
@@ -357,9 +371,43 @@ declare function LoginPage({
|
|
|
357
371
|
loginPath,
|
|
358
372
|
title,
|
|
359
373
|
hint,
|
|
360
|
-
defaultUsername
|
|
374
|
+
defaultUsername,
|
|
375
|
+
oidcProviders,
|
|
376
|
+
forgotPasswordTo
|
|
361
377
|
}: LoginPageProps): import("react").JSX.Element;
|
|
362
378
|
//#endregion
|
|
379
|
+
//#region packages/admin/auth/ForgotPasswordPage.d.ts
|
|
380
|
+
interface ForgotPasswordPageProps {
|
|
381
|
+
apiBaseUrl?: string;
|
|
382
|
+
}
|
|
383
|
+
declare function ForgotPasswordPage({
|
|
384
|
+
apiBaseUrl
|
|
385
|
+
}: ForgotPasswordPageProps): import("react").JSX.Element;
|
|
386
|
+
//#endregion
|
|
387
|
+
//#region packages/admin/auth/ResetPasswordPage.d.ts
|
|
388
|
+
interface ResetPasswordPageProps {
|
|
389
|
+
apiBaseUrl?: string;
|
|
390
|
+
}
|
|
391
|
+
declare function ResetPasswordPage({
|
|
392
|
+
apiBaseUrl
|
|
393
|
+
}: ResetPasswordPageProps): import("react").JSX.Element;
|
|
394
|
+
//#endregion
|
|
395
|
+
//#region packages/admin/auth/AcceptInvitationPage.d.ts
|
|
396
|
+
interface AcceptInvitationPageProps {
|
|
397
|
+
apiBaseUrl?: string;
|
|
398
|
+
}
|
|
399
|
+
declare function AcceptInvitationPage({
|
|
400
|
+
apiBaseUrl
|
|
401
|
+
}: AcceptInvitationPageProps): import("react").JSX.Element;
|
|
402
|
+
//#endregion
|
|
403
|
+
//#region packages/admin/auth/AccountPage.d.ts
|
|
404
|
+
interface AccountPageProps {
|
|
405
|
+
apiBaseUrl?: string;
|
|
406
|
+
}
|
|
407
|
+
declare function AccountPage({
|
|
408
|
+
apiBaseUrl
|
|
409
|
+
}: AccountPageProps): import("react").JSX.Element;
|
|
410
|
+
//#endregion
|
|
363
411
|
//#region packages/admin/auth/RegisterPage.d.ts
|
|
364
412
|
type RegisterFieldType = 'text' | 'email' | 'password' | 'select';
|
|
365
413
|
interface RegisterSelectOption {
|
|
@@ -379,6 +427,11 @@ interface RegisterPageProps {
|
|
|
379
427
|
fields: RegisterField[];
|
|
380
428
|
onRegistered: () => void;
|
|
381
429
|
apiBaseUrl?: string;
|
|
430
|
+
/**
|
|
431
|
+
* Relative to `apiBaseUrl`. The bundle does not ship open registration —
|
|
432
|
+
* invitations (`/api/invitations`) are the signup path. Pass the application's
|
|
433
|
+
* own endpoint; the default only exists so existing apps keep compiling.
|
|
434
|
+
*/
|
|
382
435
|
registerPath?: string;
|
|
383
436
|
title?: string;
|
|
384
437
|
hint?: string;
|
|
@@ -500,6 +553,10 @@ type CreateNubitAppConfig = {
|
|
|
500
553
|
title?: string;
|
|
501
554
|
hint?: string;
|
|
502
555
|
defaultUsername?: string;
|
|
556
|
+
oidcProviders?: {
|
|
557
|
+
id: string;
|
|
558
|
+
label: string;
|
|
559
|
+
}[];
|
|
503
560
|
};
|
|
504
561
|
shell?: Pick<AdminShellProps, 'headerActions' | 'footer'>;
|
|
505
562
|
renderThemeSwitcher?: () => ReactNode;
|
|
@@ -533,4 +590,4 @@ declare function hasAnyRole(required: string | string[] | undefined, roles: stri
|
|
|
533
590
|
*/
|
|
534
591
|
declare function filterMenuByRoles(items: NubitAppMenuItem[], roles: string[]): AdminMenuItem[];
|
|
535
592
|
//#endregion
|
|
536
|
-
export { AdminHeader, type AdminHeaderAction, type AdminHeaderProps, type AdminMenuItem, type AdminMenuSubItem, AdminShell, type AdminShellProps, AdminSidebarMenu, type AdminSidebarMenuProps, type AdminSidebarMenuSelectEvent, type AppProfile, type CreateNubitAppConfig, FeatureGate, type FeatureGateProps, type FeatureHubBanner, type FeatureHubDensity, FeatureHubLayout, type FeatureHubLayoutProps, type FeatureHubTab, LoginPage, type LoginPageProps, type NotificationItem, NotificationPanel, type NotificationPanelProps, type NotificationType, type NubitApp, type NubitAppMenuContext, type NubitAppMenuItem, type NubitAppMenuSubItem, type NubitAppRoute, type NubitAppUserMenuContext, NubitDevToolsPanel, type ParsedQuotaError, type PlanDefinition, PlanPanel, type PlanPanelLabels, type PlanPanelProps, QuotaUsageBanner, type QuotaUsageBannerProps, type RegisterField, type RegisterFieldType, RegisterPage, type RegisterPageProps, type RegisterSelectOption, type RuntimeConfig, type RuntimeConfigState, type SessionContextValue, type SessionFeatureEntitlement, type SessionProfile, SessionProvider, type SessionProviderConfig, type SessionState, type SessionTenant, StaticSessionProvider, ToastHost, type ToastHostProps, type ToastItem, type UseNotificationsOptions, type UseQuotaUsageOptions, type UseRuntimeConfigOptions, createNubitApp, filterMenuByRoles, hasAnyRole, parseQuotaError, quotaErrorToastMessage, quotaUsageAboveGrid, useAppRuntime, useFeature, useFeatureConfig, useNotifications, useQuotaUsage, useRuntimeConfig, useScreenSize, useScreenSizeClass, useSession };
|
|
593
|
+
export { AcceptInvitationPage, type AcceptInvitationPageProps, AccountPage, type AccountPageProps, AdminHeader, type AdminHeaderAction, type AdminHeaderProps, type AdminMenuItem, type AdminMenuSubItem, AdminShell, type AdminShellProps, AdminSidebarMenu, type AdminSidebarMenuProps, type AdminSidebarMenuSelectEvent, type AppProfile, type CreateNubitAppConfig, FeatureGate, type FeatureGateProps, type FeatureHubBanner, type FeatureHubDensity, FeatureHubLayout, type FeatureHubLayoutProps, type FeatureHubTab, ForgotPasswordPage, type ForgotPasswordPageProps, type LoginOidcProvider, LoginPage, type LoginPageProps, type NotificationItem, NotificationPanel, type NotificationPanelProps, type NotificationType, type NubitApp, type NubitAppMenuContext, type NubitAppMenuItem, type NubitAppMenuSubItem, type NubitAppRoute, type NubitAppUserMenuContext, NubitDevToolsPanel, type ParsedQuotaError, type PlanDefinition, PlanPanel, type PlanPanelLabels, type PlanPanelProps, QuotaUsageBanner, type QuotaUsageBannerProps, type RegisterField, type RegisterFieldType, RegisterPage, type RegisterPageProps, type RegisterSelectOption, ResetPasswordPage, type ResetPasswordPageProps, type RuntimeConfig, type RuntimeConfigState, type SessionContextValue, type SessionFeatureEntitlement, type SessionPermissionLimit, type SessionProfile, SessionProvider, type SessionProviderConfig, type SessionState, type SessionTenant, StaticSessionProvider, ToastHost, type ToastHostProps, type ToastItem, type UseNotificationsOptions, type UseQuotaUsageOptions, type UseRuntimeConfigOptions, createNubitApp, filterMenuByRoles, hasAnyRole, parseQuotaError, quotaErrorToastMessage, quotaUsageAboveGrid, useAppRuntime, useFeature, useFeatureConfig, useNotifications, useQuotaUsage, useRuntimeConfig, useScreenSize, useScreenSizeClass, useSession };
|
package/dist/index.d.mts
CHANGED
|
@@ -151,12 +151,20 @@ type SessionFeatureEntitlement = {
|
|
|
151
151
|
enabled: boolean;
|
|
152
152
|
config: Record<string, unknown>;
|
|
153
153
|
};
|
|
154
|
+
type SessionPermissionLimit = {
|
|
155
|
+
amount: string;
|
|
156
|
+
currency: string;
|
|
157
|
+
scale: number;
|
|
158
|
+
};
|
|
154
159
|
type SessionProfile = {
|
|
155
160
|
username: string;
|
|
156
161
|
roles: string[]; /** Present when the backend runs nubitio/admin-bundle ≥ 0.1 session contract. */
|
|
157
162
|
appProfile?: AppProfile;
|
|
158
163
|
tenant?: SessionTenant;
|
|
159
|
-
features?: Record<string, SessionFeatureEntitlement>;
|
|
164
|
+
features?: Record<string, SessionFeatureEntitlement>; /** Effective `resource.action` names when the authorization module is on. */
|
|
165
|
+
permissions?: string[]; /** Permission name → amount cap, as `/api/me` publishes it. */
|
|
166
|
+
limits?: Record<string, SessionPermissionLimit>; /** IANA zone the UI must render timestamps in. Storage is always UTC. */
|
|
167
|
+
timeZone?: string;
|
|
160
168
|
};
|
|
161
169
|
type SessionState = {
|
|
162
170
|
status: 'loading';
|
|
@@ -343,6 +351,10 @@ declare function NotificationPanel({
|
|
|
343
351
|
}: NotificationPanelProps): React$1.JSX.Element;
|
|
344
352
|
//#endregion
|
|
345
353
|
//#region packages/admin/auth/LoginPage.d.ts
|
|
354
|
+
interface LoginOidcProvider {
|
|
355
|
+
id: string;
|
|
356
|
+
label: string;
|
|
357
|
+
}
|
|
346
358
|
interface LoginPageProps {
|
|
347
359
|
onLoggedIn: () => void;
|
|
348
360
|
apiBaseUrl?: string;
|
|
@@ -350,6 +362,8 @@ interface LoginPageProps {
|
|
|
350
362
|
title?: string;
|
|
351
363
|
hint?: string;
|
|
352
364
|
defaultUsername?: string;
|
|
365
|
+
oidcProviders?: LoginOidcProvider[];
|
|
366
|
+
forgotPasswordTo?: string;
|
|
353
367
|
}
|
|
354
368
|
declare function LoginPage({
|
|
355
369
|
onLoggedIn,
|
|
@@ -357,9 +371,43 @@ declare function LoginPage({
|
|
|
357
371
|
loginPath,
|
|
358
372
|
title,
|
|
359
373
|
hint,
|
|
360
|
-
defaultUsername
|
|
374
|
+
defaultUsername,
|
|
375
|
+
oidcProviders,
|
|
376
|
+
forgotPasswordTo
|
|
361
377
|
}: LoginPageProps): import("react").JSX.Element;
|
|
362
378
|
//#endregion
|
|
379
|
+
//#region packages/admin/auth/ForgotPasswordPage.d.ts
|
|
380
|
+
interface ForgotPasswordPageProps {
|
|
381
|
+
apiBaseUrl?: string;
|
|
382
|
+
}
|
|
383
|
+
declare function ForgotPasswordPage({
|
|
384
|
+
apiBaseUrl
|
|
385
|
+
}: ForgotPasswordPageProps): import("react").JSX.Element;
|
|
386
|
+
//#endregion
|
|
387
|
+
//#region packages/admin/auth/ResetPasswordPage.d.ts
|
|
388
|
+
interface ResetPasswordPageProps {
|
|
389
|
+
apiBaseUrl?: string;
|
|
390
|
+
}
|
|
391
|
+
declare function ResetPasswordPage({
|
|
392
|
+
apiBaseUrl
|
|
393
|
+
}: ResetPasswordPageProps): import("react").JSX.Element;
|
|
394
|
+
//#endregion
|
|
395
|
+
//#region packages/admin/auth/AcceptInvitationPage.d.ts
|
|
396
|
+
interface AcceptInvitationPageProps {
|
|
397
|
+
apiBaseUrl?: string;
|
|
398
|
+
}
|
|
399
|
+
declare function AcceptInvitationPage({
|
|
400
|
+
apiBaseUrl
|
|
401
|
+
}: AcceptInvitationPageProps): import("react").JSX.Element;
|
|
402
|
+
//#endregion
|
|
403
|
+
//#region packages/admin/auth/AccountPage.d.ts
|
|
404
|
+
interface AccountPageProps {
|
|
405
|
+
apiBaseUrl?: string;
|
|
406
|
+
}
|
|
407
|
+
declare function AccountPage({
|
|
408
|
+
apiBaseUrl
|
|
409
|
+
}: AccountPageProps): import("react").JSX.Element;
|
|
410
|
+
//#endregion
|
|
363
411
|
//#region packages/admin/auth/RegisterPage.d.ts
|
|
364
412
|
type RegisterFieldType = 'text' | 'email' | 'password' | 'select';
|
|
365
413
|
interface RegisterSelectOption {
|
|
@@ -379,6 +427,11 @@ interface RegisterPageProps {
|
|
|
379
427
|
fields: RegisterField[];
|
|
380
428
|
onRegistered: () => void;
|
|
381
429
|
apiBaseUrl?: string;
|
|
430
|
+
/**
|
|
431
|
+
* Relative to `apiBaseUrl`. The bundle does not ship open registration —
|
|
432
|
+
* invitations (`/api/invitations`) are the signup path. Pass the application's
|
|
433
|
+
* own endpoint; the default only exists so existing apps keep compiling.
|
|
434
|
+
*/
|
|
382
435
|
registerPath?: string;
|
|
383
436
|
title?: string;
|
|
384
437
|
hint?: string;
|
|
@@ -500,6 +553,10 @@ type CreateNubitAppConfig = {
|
|
|
500
553
|
title?: string;
|
|
501
554
|
hint?: string;
|
|
502
555
|
defaultUsername?: string;
|
|
556
|
+
oidcProviders?: {
|
|
557
|
+
id: string;
|
|
558
|
+
label: string;
|
|
559
|
+
}[];
|
|
503
560
|
};
|
|
504
561
|
shell?: Pick<AdminShellProps, 'headerActions' | 'footer'>;
|
|
505
562
|
renderThemeSwitcher?: () => ReactNode;
|
|
@@ -533,4 +590,4 @@ declare function hasAnyRole(required: string | string[] | undefined, roles: stri
|
|
|
533
590
|
*/
|
|
534
591
|
declare function filterMenuByRoles(items: NubitAppMenuItem[], roles: string[]): AdminMenuItem[];
|
|
535
592
|
//#endregion
|
|
536
|
-
export { AdminHeader, type AdminHeaderAction, type AdminHeaderProps, type AdminMenuItem, type AdminMenuSubItem, AdminShell, type AdminShellProps, AdminSidebarMenu, type AdminSidebarMenuProps, type AdminSidebarMenuSelectEvent, type AppProfile, type CreateNubitAppConfig, FeatureGate, type FeatureGateProps, type FeatureHubBanner, type FeatureHubDensity, FeatureHubLayout, type FeatureHubLayoutProps, type FeatureHubTab, LoginPage, type LoginPageProps, type NotificationItem, NotificationPanel, type NotificationPanelProps, type NotificationType, type NubitApp, type NubitAppMenuContext, type NubitAppMenuItem, type NubitAppMenuSubItem, type NubitAppRoute, type NubitAppUserMenuContext, NubitDevToolsPanel, type ParsedQuotaError, type PlanDefinition, PlanPanel, type PlanPanelLabels, type PlanPanelProps, QuotaUsageBanner, type QuotaUsageBannerProps, type RegisterField, type RegisterFieldType, RegisterPage, type RegisterPageProps, type RegisterSelectOption, type RuntimeConfig, type RuntimeConfigState, type SessionContextValue, type SessionFeatureEntitlement, type SessionProfile, SessionProvider, type SessionProviderConfig, type SessionState, type SessionTenant, StaticSessionProvider, ToastHost, type ToastHostProps, type ToastItem, type UseNotificationsOptions, type UseQuotaUsageOptions, type UseRuntimeConfigOptions, createNubitApp, filterMenuByRoles, hasAnyRole, parseQuotaError, quotaErrorToastMessage, quotaUsageAboveGrid, useAppRuntime, useFeature, useFeatureConfig, useNotifications, useQuotaUsage, useRuntimeConfig, useScreenSize, useScreenSizeClass, useSession };
|
|
593
|
+
export { AcceptInvitationPage, type AcceptInvitationPageProps, AccountPage, type AccountPageProps, AdminHeader, type AdminHeaderAction, type AdminHeaderProps, type AdminMenuItem, type AdminMenuSubItem, AdminShell, type AdminShellProps, AdminSidebarMenu, type AdminSidebarMenuProps, type AdminSidebarMenuSelectEvent, type AppProfile, type CreateNubitAppConfig, FeatureGate, type FeatureGateProps, type FeatureHubBanner, type FeatureHubDensity, FeatureHubLayout, type FeatureHubLayoutProps, type FeatureHubTab, ForgotPasswordPage, type ForgotPasswordPageProps, type LoginOidcProvider, LoginPage, type LoginPageProps, type NotificationItem, NotificationPanel, type NotificationPanelProps, type NotificationType, type NubitApp, type NubitAppMenuContext, type NubitAppMenuItem, type NubitAppMenuSubItem, type NubitAppRoute, type NubitAppUserMenuContext, NubitDevToolsPanel, type ParsedQuotaError, type PlanDefinition, PlanPanel, type PlanPanelLabels, type PlanPanelProps, QuotaUsageBanner, type QuotaUsageBannerProps, type RegisterField, type RegisterFieldType, RegisterPage, type RegisterPageProps, type RegisterSelectOption, ResetPasswordPage, type ResetPasswordPageProps, type RuntimeConfig, type RuntimeConfigState, type SessionContextValue, type SessionFeatureEntitlement, type SessionPermissionLimit, type SessionProfile, SessionProvider, type SessionProviderConfig, type SessionState, type SessionTenant, StaticSessionProvider, ToastHost, type ToastHostProps, type ToastItem, type UseNotificationsOptions, type UseQuotaUsageOptions, type UseRuntimeConfigOptions, createNubitApp, filterMenuByRoles, hasAnyRole, parseQuotaError, quotaErrorToastMessage, quotaUsageAboveGrid, useAppRuntime, useFeature, useFeatureConfig, useNotifications, useQuotaUsage, useRuntimeConfig, useScreenSize, useScreenSizeClass, useSession };
|