@oondemand/oon-core-front 0.3.74 → 0.3.76
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.d.ts +29 -5
- package/dist/index.js +1968 -1615
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1038,6 +1038,8 @@ interface CoreDashboardProps {
|
|
|
1038
1038
|
/** Dashboard declarativo com agregações executadas integralmente no backend. */
|
|
1039
1039
|
declare function CoreDashboard({ label, widgets }: CoreDashboardProps): react.JSX.Element;
|
|
1040
1040
|
|
|
1041
|
+
declare function CoreUsersAccess(): react.JSX.Element;
|
|
1042
|
+
|
|
1041
1043
|
declare function CorePage({ page, registry }: {
|
|
1042
1044
|
page: OonPageDef;
|
|
1043
1045
|
registry?: OonComponentRegistry;
|
|
@@ -1084,30 +1086,52 @@ declare function CoreLoadingState({ label }: {
|
|
|
1084
1086
|
label?: string;
|
|
1085
1087
|
}): react.JSX.Element;
|
|
1086
1088
|
|
|
1087
|
-
type AuthStatus = "loading" | "authenticated" | "unauthenticated" | "forbidden" | "error";
|
|
1089
|
+
type AuthStatus = "loading" | "authenticated" | "first-access" | "unauthenticated" | "forbidden" | "error";
|
|
1088
1090
|
interface AuthContextValue {
|
|
1089
1091
|
user: OonUser | null;
|
|
1090
1092
|
roles: string[];
|
|
1091
1093
|
capabilities: string[];
|
|
1094
|
+
permissions: string[];
|
|
1092
1095
|
status: AuthStatus;
|
|
1093
1096
|
isAuthenticated: boolean;
|
|
1094
1097
|
hasPermission: (permission?: string | string[]) => boolean;
|
|
1095
1098
|
login: (email: string, password: string) => Promise<void>;
|
|
1099
|
+
completeFirstAccess: (password: string) => Promise<void>;
|
|
1096
1100
|
retry: () => Promise<void>;
|
|
1097
1101
|
logout: () => void;
|
|
1098
1102
|
}
|
|
1103
|
+
declare function can(user: OonUser | null, permission?: string | string[]): boolean;
|
|
1099
1104
|
declare function useOonAuth(): AuthContextValue;
|
|
1100
1105
|
|
|
1106
|
+
interface TenantStorage {
|
|
1107
|
+
get(): string | null;
|
|
1108
|
+
set(tenantId: string): void;
|
|
1109
|
+
clear(): void;
|
|
1110
|
+
}
|
|
1111
|
+
/**
|
|
1112
|
+
* Guarda somente a seleção de tenant do usuário. O valor persistido não é
|
|
1113
|
+
* autoridade: o backend/Control Plane precisa validar o header a cada request.
|
|
1114
|
+
*/
|
|
1115
|
+
declare function createTenantStorage(appId: string): TenantStorage;
|
|
1116
|
+
|
|
1117
|
+
interface OonTenantContextValue {
|
|
1118
|
+
activeTenantId: string | null;
|
|
1119
|
+
switchTenant(tenantId: string): void;
|
|
1120
|
+
clearTenant(): void;
|
|
1121
|
+
}
|
|
1122
|
+
declare function useOonTenant(): OonTenantContextValue;
|
|
1123
|
+
|
|
1101
1124
|
/**
|
|
1102
|
-
* Esconde a UI quando o usuário não tem a permissão.
|
|
1103
|
-
*
|
|
1104
|
-
* ações/menus que o usuário não pode usar.
|
|
1125
|
+
* Esconde a UI quando o usuário não tem a permissão. O backend continua sendo
|
|
1126
|
+
* a autoridade; este componente evita expor ações indisponíveis na interface.
|
|
1105
1127
|
*/
|
|
1106
1128
|
declare function PermissionGate({ permission, fallback, children, }: {
|
|
1107
1129
|
permission?: string | string[];
|
|
1108
1130
|
fallback?: ReactNode;
|
|
1109
1131
|
children: ReactNode;
|
|
1110
1132
|
}): react.JSX.Element;
|
|
1133
|
+
/** Alias canônico e curto para uso declarativo nas Centrais. */
|
|
1134
|
+
declare const Can: typeof PermissionGate;
|
|
1111
1135
|
|
|
1112
1136
|
/**
|
|
1113
1137
|
* SDK do contrato /core/* (introspecção dirigida por metadata). É o que
|
|
@@ -1168,4 +1192,4 @@ declare function useCoreMetadata(): _tanstack_react_query.UseQueryResult<NoInfer
|
|
|
1168
1192
|
/** Descrição de uma model específica — base do modo "dynamic". */
|
|
1169
1193
|
declare function useModelSchema(name: string): _tanstack_react_query.UseQueryResult<NoInfer<ModelSummary>, Error>;
|
|
1170
1194
|
|
|
1171
|
-
export { type CentralAppManifest, type CentralFormFieldDef, type CentralManifestBundle, type CentralUiManifest, type CentralUiOnlyManifest, type CollectionMode, type CollectionViewDef, CoreActions, CoreAssistant, CoreCards, CoreCollection, CoreCurrency, CoreDashboard, CoreDataGrid, CoreDocument, CoreEmptyState, CoreField, CoreForm, CoreIntegration, CoreLoadingState, type CoreMetadata, CorePage, CorePageHeader, CorePipeline, CoreRelationField, CoreToolbar, type DashboardViewDef, type DashboardWidgetDef, type DocumentViewDef, DomainExpressionError, type FieldKind, type FieldMeta, type ListParams, type ManifestRuntime, type ModelSummary, type OonActionDef, type OonApiConfig, type OonAppConfig, type OonAppKind, type OonAuthConfig, type OonAuthMode, type OonBlockDef, type OonColumnDef, type OonComponentRegistry, type OonComputedFieldDefinition, type OonCoreFrontConfig, type OonDomainExpression, type OonDomainExpressionOperator, type OonError, type OonFormFieldDef, type OonLayoutConfig, type OonMenuItem, type OonModule, type OonNavigationConfig, type OonNavigationMode, type OonPageDef, type OonPipelineActionDef, type OonPipelineActionGroup, type OonPipelineActionTone, type OonPipelineDefaultActionsConfig, type OonPipelineDefaultActionsDef, type OonPipelineTicketModalConfig, type OonPipelineViewDef, type OonReactiveFormField, type OonRoute, type OonSchemaVersion, type OonSecurityConfig, type OonUiManifest, type OonUser, type OonViewDefinition, type PaginatedResult, type Pagination, PermissionGate, type PipelineViewDef, type ReactiveFormulaResult, applyReactiveFormulas, buildDomainMutationPayload, coerceDomainFormValue, createIntegrationModule, defineCollectionView, defineDashboard, defineDocumentView, defineOonModule, definePipelineView, evaluateDomainExpression, manifestToConfig, oonCoreFront, start, startCentralFromManifest, startFromManifest, useCoreMetadata, useModelSchema, useOonApi, useOonAuth, useOonResource };
|
|
1195
|
+
export { Can, type CentralAppManifest, type CentralFormFieldDef, type CentralManifestBundle, type CentralUiManifest, type CentralUiOnlyManifest, type CollectionMode, type CollectionViewDef, CoreActions, CoreAssistant, CoreCards, CoreCollection, CoreCurrency, CoreDashboard, CoreDataGrid, CoreDocument, CoreEmptyState, CoreField, CoreForm, CoreIntegration, CoreLoadingState, type CoreMetadata, CorePage, CorePageHeader, CorePipeline, CoreRelationField, CoreToolbar, CoreUsersAccess, type DashboardViewDef, type DashboardWidgetDef, type DocumentViewDef, DomainExpressionError, type FieldKind, type FieldMeta, type ListParams, type ManifestRuntime, type ModelSummary, type OonActionDef, type OonApiConfig, type OonAppConfig, type OonAppKind, type OonAuthConfig, type OonAuthMode, type OonBlockDef, type OonColumnDef, type OonComponentRegistry, type OonComputedFieldDefinition, type OonCoreFrontConfig, type OonDomainExpression, type OonDomainExpressionOperator, type OonError, type OonFormFieldDef, type OonLayoutConfig, type OonMenuItem, type OonModule, type OonNavigationConfig, type OonNavigationMode, type OonPageDef, type OonPipelineActionDef, type OonPipelineActionGroup, type OonPipelineActionTone, type OonPipelineDefaultActionsConfig, type OonPipelineDefaultActionsDef, type OonPipelineTicketModalConfig, type OonPipelineViewDef, type OonReactiveFormField, type OonRoute, type OonSchemaVersion, type OonSecurityConfig, type OonTenantContextValue, type OonUiManifest, type OonUser, type OonViewDefinition, type PaginatedResult, type Pagination, PermissionGate, type PipelineViewDef, type ReactiveFormulaResult, type TenantStorage, applyReactiveFormulas, buildDomainMutationPayload, can, coerceDomainFormValue, createIntegrationModule, createTenantStorage, defineCollectionView, defineDashboard, defineDocumentView, defineOonModule, definePipelineView, evaluateDomainExpression, manifestToConfig, oonCoreFront, start, startCentralFromManifest, startFromManifest, useCoreMetadata, useModelSchema, useOonApi, useOonAuth, useOonResource, useOonTenant };
|