alepha 0.11.0 → 0.11.1

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/postgres.d.ts CHANGED
@@ -8,7 +8,7 @@ import * as drizzle_orm0 from "drizzle-orm";
8
8
  import { BuildExtraConfigColumns, SQL, SQLWrapper, sql } from "drizzle-orm";
9
9
  import * as drizzle_orm_pg_core0 from "drizzle-orm/pg-core";
10
10
  import { LockConfig, LockStrength, PgColumn, PgColumnBuilderBase, PgDatabase, PgInsertValue, PgSchema, PgSelectBase, PgSequenceOptions, PgTableExtraConfigValue, PgTableWithColumns, PgTransaction, PgTransactionConfig, UpdateDeleteAction } from "drizzle-orm/pg-core";
11
- import * as typebox9 from "typebox";
11
+ import * as typebox4 from "typebox";
12
12
  import { PgTransactionConfig as PgTransactionConfig$1 } from "drizzle-orm/pg-core/session";
13
13
  import * as DrizzleKit from "drizzle-kit/api";
14
14
  import { MigrationConfig } from "drizzle-orm/migrator";
@@ -883,10 +883,10 @@ declare abstract class DatabaseProvider {
883
883
  }
884
884
  //#endregion
885
885
  //#region src/schemas/pageQuerySchema.d.ts
886
- declare const pageQuerySchema: typebox9.TObject<{
887
- page: typebox9.TOptional<typebox9.TInteger>;
888
- size: typebox9.TOptional<typebox9.TInteger>;
889
- sort: typebox9.TOptional<typebox9.TString>;
886
+ declare const pageQuerySchema: typebox4.TObject<{
887
+ page: typebox4.TOptional<typebox4.TInteger>;
888
+ size: typebox4.TOptional<typebox4.TInteger>;
889
+ sort: typebox4.TOptional<typebox4.TString>;
890
890
  }>;
891
891
  type PageQuery = Static<typeof pageQuerySchema>;
892
892
  //#endregion
@@ -1657,11 +1657,11 @@ declare class DrizzleKitProvider {
1657
1657
  */
1658
1658
  protected importDrizzleKit(): typeof DrizzleKit;
1659
1659
  }
1660
- declare const devMigrationsSchema: typebox9.TObject<{
1661
- id: typebox9.TNumber;
1662
- name: typebox9.TString;
1663
- snapshot: typebox9.TString;
1664
- created_at: typebox9.TString;
1660
+ declare const devMigrationsSchema: typebox4.TObject<{
1661
+ id: typebox4.TNumber;
1662
+ name: typebox4.TString;
1663
+ snapshot: typebox4.TString;
1664
+ created_at: typebox4.TString;
1665
1665
  }>;
1666
1666
  type DevMigrations = Static<typeof devMigrationsSchema>;
1667
1667
  //#endregion
@@ -1824,17 +1824,17 @@ declare class PostgresTypeProvider {
1824
1824
  /**
1825
1825
  * Creates a column Created At. So just a datetime column with a default value of the current timestamp.
1826
1826
  */
1827
- readonly createdAt: (options?: TStringOptions) => PgAttr<PgAttr<typebox9.TCodec<TString, dayjs0.Dayjs>, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1827
+ readonly createdAt: (options?: TStringOptions) => PgAttr<PgAttr<typebox4.TCodec<TString, dayjs0.Dayjs>, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1828
1828
  /**
1829
1829
  * Creates a column Updated At. Like createdAt, but it is updated on every update of the row.
1830
1830
  */
1831
- readonly updatedAt: (options?: TStringOptions) => PgAttr<PgAttr<typebox9.TCodec<TString, dayjs0.Dayjs>, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
1831
+ readonly updatedAt: (options?: TStringOptions) => PgAttr<PgAttr<typebox4.TCodec<TString, dayjs0.Dayjs>, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
1832
1832
  /**
1833
1833
  * Creates a column Deleted At for soft delete functionality.
1834
1834
  * This is used to mark rows as deleted without actually removing them from the database.
1835
1835
  * The column is nullable - NULL means not deleted, timestamp means deleted.
1836
1836
  */
1837
- readonly deletedAt: (options?: TStringOptions) => PgAttr<typebox9.TOptional<typebox9.TCodec<TString, dayjs0.Dayjs>>, typeof PG_DELETED_AT>;
1837
+ readonly deletedAt: (options?: TStringOptions) => PgAttr<typebox4.TOptional<typebox4.TCodec<TString, dayjs0.Dayjs>>, typeof PG_DELETED_AT>;
1838
1838
  /**
1839
1839
  * Creates a Postgres ENUM type.
1840
1840
  *
@@ -1866,7 +1866,7 @@ declare const pg: PostgresTypeProvider;
1866
1866
  /**
1867
1867
  * @deprecated Use `pg.primaryKey()` instead.
1868
1868
  */
1869
- declare const legacyIdSchema: PgAttr<PgAttr<PgAttr<typebox9.TInteger, typeof PG_PRIMARY_KEY>, typeof PG_SERIAL>, typeof PG_DEFAULT>;
1869
+ declare const legacyIdSchema: PgAttr<PgAttr<PgAttr<typebox4.TInteger, typeof PG_PRIMARY_KEY>, typeof PG_SERIAL>, typeof PG_DEFAULT>;
1870
1870
  //#endregion
1871
1871
  //#region src/types/schema.d.ts
1872
1872
  /**
package/scheduler.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as _alepha_core4 from "alepha";
1
+ import * as _alepha_core1 from "alepha";
2
2
  import { Alepha, Async, Descriptor, KIND, Static } from "alepha";
3
3
  import * as _alepha_lock0 from "alepha/lock";
4
4
  import { DateTime, DateTimeProvider, DurationLike } from "alepha/datetime";
@@ -23,8 +23,8 @@ declare class CronProvider {
23
23
  protected readonly log: _alepha_logger0.Logger;
24
24
  protected readonly cronJobs: Array<CronJob>;
25
25
  getCronJobs(): Array<CronJob>;
26
- protected readonly start: _alepha_core4.HookDescriptor<"start">;
27
- protected readonly stop: _alepha_core4.HookDescriptor<"stop">;
26
+ protected readonly start: _alepha_core1.HookDescriptor<"start">;
27
+ protected readonly stop: _alepha_core1.HookDescriptor<"stop">;
28
28
  protected boot(name: string | CronJob): void;
29
29
  abort(name: string | CronJob): void;
30
30
  /**
@@ -87,8 +87,8 @@ type SchedulerDescriptorOptions = {
87
87
  */
88
88
  lock?: boolean;
89
89
  };
90
- declare const envSchema: _alepha_core4.TObject<{
91
- SCHEDULER_PREFIX: _alepha_core4.TOptional<_alepha_core4.TString>;
90
+ declare const envSchema: _alepha_core1.TObject<{
91
+ SCHEDULER_PREFIX: _alepha_core1.TOptional<_alepha_core1.TString>;
92
92
  }>;
93
93
  declare module "alepha" {
94
94
  interface Env extends Partial<Static<typeof envSchema>> {}
@@ -139,7 +139,7 @@ declare module "alepha" {
139
139
  * @see {@link $scheduler}
140
140
  * @module alepha.scheduler
141
141
  */
142
- declare const AlephaScheduler: _alepha_core4.Service<_alepha_core4.Module<{}>>;
142
+ declare const AlephaScheduler: _alepha_core1.Service<_alepha_core1.Module<{}>>;
143
143
  //#endregion
144
144
  export { $scheduler, AlephaScheduler, CRON, CronJob, CronProvider, SchedulerDescriptor, SchedulerDescriptorOptions, SchedulerHandlerArguments };
145
145
  //# sourceMappingURL=index.d.ts.map
package/security.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _alepha_core1 from "alepha";
2
2
  import { Alepha, Descriptor, KIND, Static } from "alepha";
3
- import * as _alepha_logger1 from "alepha/logger";
3
+ import * as _alepha_logger0 from "alepha/logger";
4
4
  import { DateTimeProvider, Duration, DurationLike } from "alepha/datetime";
5
5
  import { CryptoKey, FlattenedJWSInput, JSONWebKeySet, JWSHeaderParameters, JWTHeaderParameters, JWTPayload, JWTVerifyResult, KeyObject } from "jose";
6
6
  import * as typebox0 from "typebox";
@@ -68,7 +68,7 @@ type Role = Static<typeof roleSchema>;
68
68
  * Provides utilities for working with JSON Web Tokens (JWT).
69
69
  */
70
70
  declare class JwtProvider {
71
- protected readonly log: _alepha_logger1.Logger;
71
+ protected readonly log: _alepha_logger0.Logger;
72
72
  protected readonly keystore: KeyLoaderHolder[];
73
73
  protected readonly dateTimeProvider: DateTimeProvider;
74
74
  protected readonly encoder: TextEncoder;
@@ -130,6 +130,7 @@ interface JwtParseResult {
130
130
  }
131
131
  //#endregion
132
132
  //#region src/providers/SecurityProvider.d.ts
133
+ declare const DEFAULT_APP_SECRET = "05759934015388327323179852515731";
133
134
  declare const envSchema: _alepha_core1.TObject<{
134
135
  APP_SECRET: _alepha_core1.TString;
135
136
  }>;
@@ -140,7 +141,7 @@ declare class SecurityProvider {
140
141
  protected readonly UNKNOWN_USER_NAME = "Anonymous User";
141
142
  protected readonly PERMISSION_REGEXP: RegExp;
142
143
  protected readonly PERMISSION_REGEXP_WILDCARD: RegExp;
143
- protected readonly log: _alepha_logger1.Logger;
144
+ protected readonly log: _alepha_logger0.Logger;
144
145
  protected readonly jwt: JwtProvider;
145
146
  protected readonly env: {
146
147
  APP_SECRET: string;
@@ -399,7 +400,7 @@ declare class RealmDescriptor extends Descriptor<RealmDescriptorOptions> {
399
400
  protected readonly securityProvider: SecurityProvider;
400
401
  protected readonly dateTimeProvider: DateTimeProvider;
401
402
  protected readonly jwt: JwtProvider;
402
- protected readonly log: _alepha_logger1.Logger;
403
+ protected readonly log: _alepha_logger0.Logger;
403
404
  get name(): string;
404
405
  get accessTokenExpiration(): Duration;
405
406
  get refreshTokenExpiration(): Duration;
@@ -581,5 +582,5 @@ declare module "alepha" {
581
582
  */
582
583
  declare const AlephaSecurity: _alepha_core1.Service<_alepha_core1.Module<{}>>;
583
584
  //#endregion
584
- export { $permission, $realm, $role, $serviceAccount, AccessTokenResponse, AlephaSecurity, CreateTokenOptions, CryptoProvider, ExtendedJWTPayload, InvalidPermissionError, JwtParseResult, JwtProvider, JwtSignOptions, KeyLoader, KeyLoaderHolder, Oauth2ServiceAccountDescriptorOptions, Permission, PermissionDescriptor, PermissionDescriptorOptions, Realm, RealmDescriptor, RealmDescriptorOptions, RealmExternal, RealmInternal, RealmSettings, Role, RoleDescriptor, RoleDescriptorOptions, SecurityCheckResult, SecurityError, SecurityProvider, ServiceAccountDescriptor, ServiceAccountDescriptorOptions, ServiceAccountStore, UserAccount, UserAccountToken, permissionSchema, roleSchema, userAccountInfoSchema };
585
+ export { $permission, $realm, $role, $serviceAccount, AccessTokenResponse, AlephaSecurity, CreateTokenOptions, CryptoProvider, DEFAULT_APP_SECRET, ExtendedJWTPayload, InvalidPermissionError, JwtParseResult, JwtProvider, JwtSignOptions, KeyLoader, KeyLoaderHolder, Oauth2ServiceAccountDescriptorOptions, Permission, PermissionDescriptor, PermissionDescriptorOptions, Realm, RealmDescriptor, RealmDescriptorOptions, RealmExternal, RealmInternal, RealmSettings, Role, RoleDescriptor, RoleDescriptorOptions, SecurityCheckResult, SecurityError, SecurityProvider, ServiceAccountDescriptor, ServiceAccountDescriptorOptions, ServiceAccountStore, UserAccount, UserAccountToken, permissionSchema, roleSchema, userAccountInfoSchema };
585
586
  //# sourceMappingURL=index.d.ts.map
@@ -2,7 +2,6 @@ import * as _alepha_core1 from "alepha";
2
2
  import { Alepha, Descriptor, KIND, Static, TSchema } from "alepha";
3
3
  import { DateTimeProvider, DurationLike } from "alepha/datetime";
4
4
  import * as _alepha_logger0 from "alepha/logger";
5
- import { SecurityProvider } from "alepha/security";
6
5
 
7
6
  //#region src/services/CookieParser.d.ts
8
7
  declare class CookieParser {
@@ -17,7 +16,9 @@ declare class ServerCookiesProvider {
17
16
  protected readonly log: _alepha_logger0.Logger;
18
17
  protected readonly cookieParser: CookieParser;
19
18
  protected readonly dateTimeProvider: DateTimeProvider;
20
- protected readonly securityProvider: SecurityProvider;
19
+ protected readonly env: {
20
+ APP_SECRET: string;
21
+ };
21
22
  protected readonly ALGORITHM = "aes-256-gcm";
22
23
  protected readonly IV_LENGTH = 16;
23
24
  protected readonly AUTH_TAG_LENGTH = 16;
package/ui.d.ts CHANGED
@@ -4,8 +4,8 @@ import * as _alepha_react0 from "alepha/react";
4
4
  import { RouterGoOptions, UseActiveOptions } from "alepha/react";
5
5
  import { ModalsProviderProps } from "@mantine/modals";
6
6
  import { AutocompleteProps, ButtonProps, ColorInputProps, ColorSchemeScriptProps, FileInputProps, Flex, MantineProviderProps, ModalProps, MultiSelectProps, NumberInputProps, PasswordInputProps, SegmentedControlProps, SelectProps, SwitchProps, TableProps, TagsInputProps, TextInputProps, TextareaProps, TooltipProps } from "@mantine/core";
7
- import * as react_jsx_runtime4 from "react/jsx-runtime";
8
- import React$1, { ComponentType, ReactNode } from "react";
7
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
8
+ import React$1, { ComponentType, FC, ReactNode } from "react";
9
9
  import * as _mantine_notifications0 from "@mantine/notifications";
10
10
  import { NotificationData, NotificationsProps } from "@mantine/notifications";
11
11
  import { FormModel, InputField } from "alepha/react/form";
@@ -48,7 +48,7 @@ interface ControlSelectProps extends GenericControlProps {
48
48
  *
49
49
  * Automatically detects enum values and array types from schema.
50
50
  */
51
- declare const ControlSelect: (props: ControlSelectProps) => react_jsx_runtime4.JSX.Element | null;
51
+ declare const ControlSelect: (props: ControlSelectProps) => react_jsx_runtime6.JSX.Element | null;
52
52
  //#endregion
53
53
  //#region src/components/Control.d.ts
54
54
  interface ControlProps extends GenericControlProps {
@@ -86,7 +86,7 @@ interface ControlProps extends GenericControlProps {
86
86
  *
87
87
  * Automatically handles labels, descriptions, error messages, required state, and default icons.
88
88
  */
89
- declare const Control: (_props: ControlProps) => react_jsx_runtime4.JSX.Element | null;
89
+ declare const Control: (_props: ControlProps) => react_jsx_runtime6.JSX.Element | null;
90
90
  type CustomControlProps = {
91
91
  defaultValue: any;
92
92
  onChange: (value: any) => void;
@@ -161,7 +161,7 @@ interface ActionCommonProps extends ButtonProps {
161
161
  };
162
162
  }
163
163
  type ActionProps = ActionCommonProps & (ActiveHrefProps | ActionClickProps | ActionSubmitProps | {});
164
- declare const Action: (_props: ActionProps) => react_jsx_runtime4.JSX.Element;
164
+ declare const Action: (_props: ActionProps) => react_jsx_runtime6.JSX.Element;
165
165
  interface ActionSubmitProps extends ButtonProps {
166
166
  form: FormModel<any>;
167
167
  }
@@ -181,7 +181,7 @@ interface OmnibarProps {
181
181
  searchPlaceholder?: string;
182
182
  nothingFound?: ReactNode;
183
183
  }
184
- declare const Omnibar: (props: OmnibarProps) => react_jsx_runtime4.JSX.Element;
184
+ declare const Omnibar: (props: OmnibarProps) => react_jsx_runtime6.JSX.Element;
185
185
  //#endregion
186
186
  //#region src/components/AlephaMantineProvider.d.ts
187
187
  interface AlephaMantineProviderProps {
@@ -193,7 +193,7 @@ interface AlephaMantineProviderProps {
193
193
  modals?: ModalsProviderProps;
194
194
  omnibar?: OmnibarProps;
195
195
  }
196
- declare const AlephaMantineProvider: (props: AlephaMantineProviderProps) => react_jsx_runtime4.JSX.Element;
196
+ declare const AlephaMantineProvider: (props: AlephaMantineProviderProps) => react_jsx_runtime6.JSX.Element;
197
197
  //#endregion
198
198
  //#region src/components/ControlDate.d.ts
199
199
  interface ControlDateProps extends GenericControlProps {
@@ -211,7 +211,7 @@ interface ControlDateProps extends GenericControlProps {
211
211
  *
212
212
  * Automatically detects date formats from schema and renders appropriate picker.
213
213
  */
214
- declare const ControlDate: (props: ControlDateProps) => react_jsx_runtime4.JSX.Element | null;
214
+ declare const ControlDate: (props: ControlDateProps) => react_jsx_runtime6.JSX.Element | null;
215
215
  //#endregion
216
216
  //#region src/components/DarkModeButton.d.ts
217
217
  interface DarkModeButtonProps {
@@ -219,7 +219,7 @@ interface DarkModeButtonProps {
219
219
  size?: string | number;
220
220
  variant?: "filled" | "light" | "outline" | "default" | "subtle" | "transparent";
221
221
  }
222
- declare const DarkModeButton: (props: DarkModeButtonProps) => react_jsx_runtime4.JSX.Element;
222
+ declare const DarkModeButton: (props: DarkModeButtonProps) => react_jsx_runtime6.JSX.Element;
223
223
  //#endregion
224
224
  //#region src/components/DataTable.d.ts
225
225
  type SortDirection = "asc" | "desc" | null;
@@ -330,7 +330,7 @@ declare function DataTable<T = any>({
330
330
  minHeight,
331
331
  maxHeight,
332
332
  ...tableProps
333
- }: DataTableProps<T>): react_jsx_runtime4.JSX.Element;
333
+ }: DataTableProps<T>): react_jsx_runtime6.JSX.Element;
334
334
  //#endregion
335
335
  //#region src/services/DialogService.d.ts
336
336
  interface BaseDialogOptions extends Partial<ModalProps> {
@@ -425,25 +425,25 @@ declare class DialogService {
425
425
  declare function AlertDialog({
426
426
  options,
427
427
  onClose
428
- }: AlertDialogProps): react_jsx_runtime4.JSX.Element;
428
+ }: AlertDialogProps): react_jsx_runtime6.JSX.Element;
429
429
  //#endregion
430
430
  //#region src/components/dialogs/ConfirmDialog.d.ts
431
431
  declare function ConfirmDialog({
432
432
  options,
433
433
  onConfirm
434
- }: ConfirmDialogProps): react_jsx_runtime4.JSX.Element;
434
+ }: ConfirmDialogProps): react_jsx_runtime6.JSX.Element;
435
435
  //#endregion
436
436
  //#region src/components/dialogs/PromptDialog.d.ts
437
437
  declare function PromptDialog({
438
438
  options,
439
439
  onSubmit
440
- }: PromptDialogProps): react_jsx_runtime4.JSX.Element;
440
+ }: PromptDialogProps): react_jsx_runtime6.JSX.Element;
441
441
  //#endregion
442
442
  //#region src/components/Sidebar.d.ts
443
443
  interface MenuItem {
444
444
  id: string;
445
445
  label: string;
446
- icon?: React.ReactNode;
446
+ icon?: ReactNode;
447
447
  href?: string;
448
448
  activeStartsWith?: boolean;
449
449
  onClick?: () => void;
@@ -456,7 +456,7 @@ interface SidebarProps {
456
456
  showSearchButton?: boolean;
457
457
  onSearchClick?: () => void;
458
458
  }
459
- declare const Sidebar: React.FC<SidebarProps>;
459
+ declare const Sidebar: FC<SidebarProps>;
460
460
  interface SidebarItemProps {
461
461
  item: MenuItem;
462
462
  level: number;
@@ -509,7 +509,7 @@ interface TypeFormProps<T extends TObject> {
509
509
  * return <TypeForm form={form} columns={2} />;
510
510
  * ```
511
511
  */
512
- declare const TypeForm: <T extends TObject>(props: TypeFormProps<T>) => react_jsx_runtime4.JSX.Element | null;
512
+ declare const TypeForm: <T extends TObject>(props: TypeFormProps<T>) => react_jsx_runtime6.JSX.Element | null;
513
513
  //#endregion
514
514
  //#region src/hooks/useDialog.d.ts
515
515
  /**