@oondemand/oon-core-front 0.3.74 → 0.3.75

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 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,34 @@ 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
 
1101
1106
  /**
1102
- * Esconde a UI quando o usuário não tem a permissão. NÃO é segurança real
1103
- * (Seção 6.2, item 3) — o back é a autoridade. Serve apenas para não exibir
1104
- * ações/menus que o usuário não pode usar.
1107
+ * Esconde a UI quando o usuário não tem a permissão. O backend continua sendo
1108
+ * a autoridade; este componente evita expor ações indisponíveis na interface.
1105
1109
  */
1106
1110
  declare function PermissionGate({ permission, fallback, children, }: {
1107
1111
  permission?: string | string[];
1108
1112
  fallback?: ReactNode;
1109
1113
  children: ReactNode;
1110
1114
  }): react.JSX.Element;
1115
+ /** Alias canônico e curto para uso declarativo nas Centrais. */
1116
+ declare const Can: typeof PermissionGate;
1111
1117
 
1112
1118
  /**
1113
1119
  * SDK do contrato /core/* (introspecção dirigida por metadata). É o que
@@ -1168,4 +1174,4 @@ declare function useCoreMetadata(): _tanstack_react_query.UseQueryResult<NoInfer
1168
1174
  /** Descrição de uma model específica — base do modo "dynamic". */
1169
1175
  declare function useModelSchema(name: string): _tanstack_react_query.UseQueryResult<NoInfer<ModelSummary>, Error>;
1170
1176
 
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 };
1177
+ 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 OonUiManifest, type OonUser, type OonViewDefinition, type PaginatedResult, type Pagination, PermissionGate, type PipelineViewDef, type ReactiveFormulaResult, applyReactiveFormulas, buildDomainMutationPayload, can, coerceDomainFormValue, createIntegrationModule, defineCollectionView, defineDashboard, defineDocumentView, defineOonModule, definePipelineView, evaluateDomainExpression, manifestToConfig, oonCoreFront, start, startCentralFromManifest, startFromManifest, useCoreMetadata, useModelSchema, useOonApi, useOonAuth, useOonResource };