alepha 0.11.2 → 0.11.3
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/api/jobs.d.ts +130 -130
- package/api/users.d.ts +493 -493
- package/core.d.ts +24 -23
- package/datetime.d.ts +3 -2
- package/package.json +49 -56
- package/postgres.d.ts +19 -19
- package/react/i18n.d.ts +35 -10
- package/react.d.ts +22 -22
- package/security.d.ts +4 -4
- package/ui.cjs +0 -8
- package/ui.d.ts +0 -619
- package/ui.js +0 -1
package/core.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ import * as TypeBoxValue from "typebox/value";
|
|
|
4
4
|
import * as TypeBox from "typebox";
|
|
5
5
|
import { Static as Static$1, StaticDecode, StaticDecode as Static, StaticDecode as StaticDecode$1, StaticEncode, StaticEncode as StaticEncode$1, TAny, TAny as TAny$1, TArray, TArray as TArray$1, TArrayOptions, TBigInt, TBoolean, TBoolean as TBoolean$1, TInteger, TInteger as TInteger$1, TKeysToIndexer, TKeysToIndexer as TKeysToIndexer$1, TNull, TNull as TNull$1, TNumber, TNumber as TNumber$1, TNumberOptions, TNumberOptions as TNumberOptions$1, TObject, TObject as TObject$1, TObjectOptions, TObjectOptions as TObjectOptions$1, TOmit, TOptional, TOptionalAdd, TOptionalAdd as TOptionalAdd$1, TPick, TPick as TPick$1, TProperties, TProperties as TProperties$1, TRecord, TRecord as TRecord$1, TSchema, TSchema as TSchema$1, TSchemaOptions, TString, TString as TString$1, TStringOptions, TStringOptions as TStringOptions$1, TTuple, TUnion, TUnion as TUnion$1, TUnsafe, TUnsafe as TUnsafe$1, TVoid } from "typebox";
|
|
6
6
|
import TypeBoxFormat from "typebox/format";
|
|
7
|
+
import { TLocalizedValidationError } from "typebox/error";
|
|
7
8
|
import { Readable } from "node:stream";
|
|
8
9
|
import { ReadableStream as ReadableStream$1 } from "node:stream/web";
|
|
9
|
-
import { TLocalizedValidationError } from "typebox/error";
|
|
10
10
|
|
|
11
11
|
//#region src/constants/KIND.d.ts
|
|
12
12
|
/**
|
|
@@ -283,6 +283,28 @@ declare class Json {
|
|
|
283
283
|
parse(text: string, reviver?: (this: any, key: string, value: any) => any): any;
|
|
284
284
|
}
|
|
285
285
|
//#endregion
|
|
286
|
+
//#region src/errors/AlephaError.d.ts
|
|
287
|
+
/**
|
|
288
|
+
* Default error class for Alepha.
|
|
289
|
+
*/
|
|
290
|
+
declare class AlephaError extends Error {
|
|
291
|
+
name: string;
|
|
292
|
+
}
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region src/errors/TypeBoxError.d.ts
|
|
295
|
+
declare class TypeBoxError extends AlephaError {
|
|
296
|
+
readonly name = "TypeBoxError";
|
|
297
|
+
readonly cause: TLocalizedValidationError;
|
|
298
|
+
readonly value: {
|
|
299
|
+
path: string;
|
|
300
|
+
message: string;
|
|
301
|
+
};
|
|
302
|
+
constructor(error: TLocalizedValidationError);
|
|
303
|
+
}
|
|
304
|
+
interface TypeBoxErrorParams {
|
|
305
|
+
requiredProperties?: string[];
|
|
306
|
+
}
|
|
307
|
+
//#endregion
|
|
286
308
|
//#region src/helpers/FileLike.d.ts
|
|
287
309
|
interface FileLike {
|
|
288
310
|
/**
|
|
@@ -384,6 +406,7 @@ declare module "typebox" {
|
|
|
384
406
|
}
|
|
385
407
|
declare class TypeProvider {
|
|
386
408
|
static format: typeof TypeBoxFormat;
|
|
409
|
+
static translateError(error: TypeBoxError, locale?: string): string;
|
|
387
410
|
static setLocale(locale: string): void;
|
|
388
411
|
static isValidBigInt(value: string | number): boolean;
|
|
389
412
|
/**
|
|
@@ -1496,14 +1519,6 @@ declare class HookDescriptor<T extends keyof Hooks> extends Descriptor<HookOptio
|
|
|
1496
1519
|
protected onInit(): void;
|
|
1497
1520
|
}
|
|
1498
1521
|
//#endregion
|
|
1499
|
-
//#region src/errors/AlephaError.d.ts
|
|
1500
|
-
/**
|
|
1501
|
-
* Default error class for Alepha.
|
|
1502
|
-
*/
|
|
1503
|
-
declare class AlephaError extends Error {
|
|
1504
|
-
name: string;
|
|
1505
|
-
}
|
|
1506
|
-
//#endregion
|
|
1507
1522
|
//#region src/errors/AppNotStartedError.d.ts
|
|
1508
1523
|
declare class AppNotStartedError extends AlephaError {
|
|
1509
1524
|
readonly name = "AppNotStartedError";
|
|
@@ -1528,20 +1543,6 @@ declare class TooLateSubstitutionError extends AlephaError {
|
|
|
1528
1543
|
constructor(original: string, substitution: string);
|
|
1529
1544
|
}
|
|
1530
1545
|
//#endregion
|
|
1531
|
-
//#region src/errors/TypeBoxError.d.ts
|
|
1532
|
-
declare class TypeBoxError extends AlephaError {
|
|
1533
|
-
readonly name = "TypeBoxError";
|
|
1534
|
-
readonly cause: TLocalizedValidationError;
|
|
1535
|
-
readonly value: {
|
|
1536
|
-
path: string;
|
|
1537
|
-
message: string;
|
|
1538
|
-
};
|
|
1539
|
-
constructor(error: TLocalizedValidationError);
|
|
1540
|
-
}
|
|
1541
|
-
interface TypeBoxErrorParams {
|
|
1542
|
-
requiredProperties?: string[];
|
|
1543
|
-
}
|
|
1544
|
-
//#endregion
|
|
1545
1546
|
//#region src/index.d.ts
|
|
1546
1547
|
/**
|
|
1547
1548
|
* Run Alepha application, trigger start lifecycle.
|
package/datetime.d.ts
CHANGED
|
@@ -22,7 +22,6 @@ declare const isTimeSchema: (schema: unknown) => schema is ReturnType<typeof tim
|
|
|
22
22
|
declare const isDurationSchema: (schema: unknown) => schema is ReturnType<typeof duration>;
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/providers/DateTimeProvider.d.ts
|
|
25
|
-
type DateTimeApi = typeof dayjs;
|
|
26
25
|
type DateTime = DayjsApi.Dayjs;
|
|
27
26
|
type Duration = dayjsDuration.Duration;
|
|
28
27
|
type DurationLike = number | dayjsDuration.Duration | [number, ManipulateType];
|
|
@@ -36,6 +35,8 @@ declare class DateTimeProvider {
|
|
|
36
35
|
constructor();
|
|
37
36
|
protected readonly onStart: _alepha_core1.HookDescriptor<"start">;
|
|
38
37
|
protected readonly onStop: _alepha_core1.HookDescriptor<"stop">;
|
|
38
|
+
setLocale(locale: string): void;
|
|
39
|
+
isDateTime(value: unknown): value is DateTime;
|
|
39
40
|
/**
|
|
40
41
|
* Create a new UTC DateTime instance.
|
|
41
42
|
*/
|
|
@@ -163,5 +164,5 @@ declare module "alepha" {
|
|
|
163
164
|
}
|
|
164
165
|
declare const AlephaDateTime: _alepha_core1.Service<_alepha_core1.Module<{}>>;
|
|
165
166
|
//#endregion
|
|
166
|
-
export { $interval, AlephaDateTime, DateTime,
|
|
167
|
+
export { $interval, AlephaDateTime, DateTime, DateTimeProvider, Duration, DurationLike, Interval, IntervalDescriptor, IntervalDescriptorOptions, Timeout, date, datetime, dayjs, duration, isDateSchema, isDateTimeSchema, isDurationSchema, isTimeSchema, time };
|
|
167
168
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alepha",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22.0.0"
|
|
@@ -15,55 +15,54 @@
|
|
|
15
15
|
"main": "./core.js",
|
|
16
16
|
"types": "./core.d.ts",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@alepha/api-files": "0.11.
|
|
19
|
-
"@alepha/api-jobs": "0.11.
|
|
20
|
-
"@alepha/api-notifications": "0.11.
|
|
21
|
-
"@alepha/api-users": "0.11.
|
|
22
|
-
"@alepha/api-verifications": "0.11.
|
|
23
|
-
"@alepha/batch": "0.11.
|
|
24
|
-
"@alepha/bucket": "0.11.
|
|
25
|
-
"@alepha/cache": "0.11.
|
|
26
|
-
"@alepha/cache-redis": "0.11.
|
|
27
|
-
"@alepha/command": "0.11.
|
|
28
|
-
"@alepha/core": "0.11.
|
|
29
|
-
"@alepha/datetime": "0.11.
|
|
30
|
-
"@alepha/devtools": "0.11.
|
|
31
|
-
"@alepha/email": "0.11.
|
|
32
|
-
"@alepha/file": "0.11.
|
|
33
|
-
"@alepha/lock": "0.11.
|
|
34
|
-
"@alepha/lock-redis": "0.11.
|
|
35
|
-
"@alepha/logger": "0.11.
|
|
36
|
-
"@alepha/postgres": "0.11.
|
|
37
|
-
"@alepha/queue": "0.11.
|
|
38
|
-
"@alepha/queue-redis": "0.11.
|
|
39
|
-
"@alepha/react": "0.11.
|
|
40
|
-
"@alepha/react-auth": "0.11.
|
|
41
|
-
"@alepha/react-form": "0.11.
|
|
42
|
-
"@alepha/react-head": "0.11.
|
|
43
|
-
"@alepha/react-i18n": "0.11.
|
|
44
|
-
"@alepha/redis": "0.11.
|
|
45
|
-
"@alepha/retry": "0.11.
|
|
46
|
-
"@alepha/router": "0.11.
|
|
47
|
-
"@alepha/scheduler": "0.11.
|
|
48
|
-
"@alepha/security": "0.11.
|
|
49
|
-
"@alepha/server": "0.11.
|
|
50
|
-
"@alepha/server-cache": "0.11.
|
|
51
|
-
"@alepha/server-compress": "0.11.
|
|
52
|
-
"@alepha/server-cookies": "0.11.
|
|
53
|
-
"@alepha/server-cors": "0.11.
|
|
54
|
-
"@alepha/server-health": "0.11.
|
|
55
|
-
"@alepha/server-helmet": "0.11.
|
|
56
|
-
"@alepha/server-links": "0.11.
|
|
57
|
-
"@alepha/server-metrics": "0.11.
|
|
58
|
-
"@alepha/server-multipart": "0.11.
|
|
59
|
-
"@alepha/server-proxy": "0.11.
|
|
60
|
-
"@alepha/server-security": "0.11.
|
|
61
|
-
"@alepha/server-static": "0.11.
|
|
62
|
-
"@alepha/server-swagger": "0.11.
|
|
63
|
-
"@alepha/topic": "0.11.
|
|
64
|
-
"@alepha/topic-redis": "0.11.
|
|
65
|
-
"@alepha/
|
|
66
|
-
"@alepha/vite": "0.11.2",
|
|
18
|
+
"@alepha/api-files": "0.11.3",
|
|
19
|
+
"@alepha/api-jobs": "0.11.3",
|
|
20
|
+
"@alepha/api-notifications": "0.11.3",
|
|
21
|
+
"@alepha/api-users": "0.11.3",
|
|
22
|
+
"@alepha/api-verifications": "0.11.3",
|
|
23
|
+
"@alepha/batch": "0.11.3",
|
|
24
|
+
"@alepha/bucket": "0.11.3",
|
|
25
|
+
"@alepha/cache": "0.11.3",
|
|
26
|
+
"@alepha/cache-redis": "0.11.3",
|
|
27
|
+
"@alepha/command": "0.11.3",
|
|
28
|
+
"@alepha/core": "0.11.3",
|
|
29
|
+
"@alepha/datetime": "0.11.3",
|
|
30
|
+
"@alepha/devtools": "0.11.3",
|
|
31
|
+
"@alepha/email": "0.11.3",
|
|
32
|
+
"@alepha/file": "0.11.3",
|
|
33
|
+
"@alepha/lock": "0.11.3",
|
|
34
|
+
"@alepha/lock-redis": "0.11.3",
|
|
35
|
+
"@alepha/logger": "0.11.3",
|
|
36
|
+
"@alepha/postgres": "0.11.3",
|
|
37
|
+
"@alepha/queue": "0.11.3",
|
|
38
|
+
"@alepha/queue-redis": "0.11.3",
|
|
39
|
+
"@alepha/react": "0.11.3",
|
|
40
|
+
"@alepha/react-auth": "0.11.3",
|
|
41
|
+
"@alepha/react-form": "0.11.3",
|
|
42
|
+
"@alepha/react-head": "0.11.3",
|
|
43
|
+
"@alepha/react-i18n": "0.11.3",
|
|
44
|
+
"@alepha/redis": "0.11.3",
|
|
45
|
+
"@alepha/retry": "0.11.3",
|
|
46
|
+
"@alepha/router": "0.11.3",
|
|
47
|
+
"@alepha/scheduler": "0.11.3",
|
|
48
|
+
"@alepha/security": "0.11.3",
|
|
49
|
+
"@alepha/server": "0.11.3",
|
|
50
|
+
"@alepha/server-cache": "0.11.3",
|
|
51
|
+
"@alepha/server-compress": "0.11.3",
|
|
52
|
+
"@alepha/server-cookies": "0.11.3",
|
|
53
|
+
"@alepha/server-cors": "0.11.3",
|
|
54
|
+
"@alepha/server-health": "0.11.3",
|
|
55
|
+
"@alepha/server-helmet": "0.11.3",
|
|
56
|
+
"@alepha/server-links": "0.11.3",
|
|
57
|
+
"@alepha/server-metrics": "0.11.3",
|
|
58
|
+
"@alepha/server-multipart": "0.11.3",
|
|
59
|
+
"@alepha/server-proxy": "0.11.3",
|
|
60
|
+
"@alepha/server-security": "0.11.3",
|
|
61
|
+
"@alepha/server-static": "0.11.3",
|
|
62
|
+
"@alepha/server-swagger": "0.11.3",
|
|
63
|
+
"@alepha/topic": "0.11.3",
|
|
64
|
+
"@alepha/topic-redis": "0.11.3",
|
|
65
|
+
"@alepha/vite": "0.11.3",
|
|
67
66
|
"react": "^19.2.0",
|
|
68
67
|
"react-dom": "^19.2.0"
|
|
69
68
|
},
|
|
@@ -316,11 +315,6 @@
|
|
|
316
315
|
"require": "./topic/redis.cjs",
|
|
317
316
|
"types": "./topic/redis.d.ts"
|
|
318
317
|
},
|
|
319
|
-
"./ui": {
|
|
320
|
-
"import": "./ui.js",
|
|
321
|
-
"require": "./ui.cjs",
|
|
322
|
-
"types": "./ui.d.ts"
|
|
323
|
-
},
|
|
324
318
|
"./vite": {
|
|
325
319
|
"import": "./vite.js",
|
|
326
320
|
"require": "./vite.cjs",
|
|
@@ -376,7 +370,6 @@
|
|
|
376
370
|
"server-swagger",
|
|
377
371
|
"topic",
|
|
378
372
|
"topic-redis",
|
|
379
|
-
"ui",
|
|
380
373
|
"vite"
|
|
381
374
|
]
|
|
382
375
|
}
|
package/postgres.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import * as _alepha_core1 from "alepha";
|
|
2
2
|
import { Alepha, AlephaError, Descriptor, DescriptorArgs, KIND, Static, StaticEncode, TArray, TBigInt, TBoolean, TInteger, TNull, TNumber, TNumberOptions, TObject, TObjectOptions, TOptional, TOptionalAdd, TRecord, TSchema, TString, TStringOptions, TUnion, TUnsafe } from "alepha";
|
|
3
3
|
import { DateTime, DateTimeProvider } from "alepha/datetime";
|
|
4
|
-
import * as _alepha_logger0 from "alepha/logger";
|
|
5
|
-
import * as _alepha_lock0 from "alepha/lock";
|
|
6
|
-
import * as _alepha_retry0 from "alepha/retry";
|
|
7
4
|
import * as drizzle_orm0 from "drizzle-orm";
|
|
8
5
|
import { BuildExtraConfigColumns, SQL, SQLWrapper, sql } from "drizzle-orm";
|
|
9
6
|
import * as drizzle_orm_pg_core0 from "drizzle-orm/pg-core";
|
|
10
7
|
import { LockConfig, LockStrength, PgColumn, PgColumnBuilderBase, PgDatabase, PgInsertValue, PgSchema, PgSelectBase, PgSequenceOptions, PgTableExtraConfigValue, PgTableWithColumns, PgTransaction, PgTransactionConfig, UpdateDeleteAction } from "drizzle-orm/pg-core";
|
|
11
|
-
import * as
|
|
8
|
+
import * as _alepha_logger0 from "alepha/logger";
|
|
9
|
+
import * as _alepha_lock0 from "alepha/lock";
|
|
10
|
+
import { PostgresJsDatabase } from "drizzle-orm/postgres-js";
|
|
11
|
+
import postgres from "postgres";
|
|
12
|
+
import * as _alepha_retry0 from "alepha/retry";
|
|
13
|
+
import * as typebox8 from "typebox";
|
|
12
14
|
import { PgTransactionConfig as PgTransactionConfig$1 } from "drizzle-orm/pg-core/session";
|
|
13
15
|
import * as DrizzleKit from "drizzle-kit/api";
|
|
14
16
|
import { MigrationConfig } from "drizzle-orm/migrator";
|
|
15
|
-
import { PostgresJsDatabase } from "drizzle-orm/postgres-js";
|
|
16
|
-
import postgres from "postgres";
|
|
17
17
|
import * as dayjs0 from "dayjs";
|
|
18
18
|
import { UpdateDeleteAction as UpdateDeleteAction$1 } from "drizzle-orm/pg-core/foreign-keys";
|
|
19
19
|
export * from "drizzle-orm/pg-core";
|
|
@@ -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:
|
|
887
|
-
page:
|
|
888
|
-
size:
|
|
889
|
-
sort:
|
|
886
|
+
declare const pageQuerySchema: typebox8.TObject<{
|
|
887
|
+
page: typebox8.TOptional<typebox8.TInteger>;
|
|
888
|
+
size: typebox8.TOptional<typebox8.TInteger>;
|
|
889
|
+
sort: typebox8.TOptional<typebox8.TString>;
|
|
890
890
|
}>;
|
|
891
891
|
type PageQuery = Static<typeof pageQuerySchema>;
|
|
892
892
|
//#endregion
|
|
@@ -1661,11 +1661,11 @@ declare class DrizzleKitProvider {
|
|
|
1661
1661
|
*/
|
|
1662
1662
|
protected importDrizzleKit(): typeof DrizzleKit;
|
|
1663
1663
|
}
|
|
1664
|
-
declare const devMigrationsSchema:
|
|
1665
|
-
id:
|
|
1666
|
-
name:
|
|
1667
|
-
snapshot:
|
|
1668
|
-
created_at:
|
|
1664
|
+
declare const devMigrationsSchema: typebox8.TObject<{
|
|
1665
|
+
id: typebox8.TNumber;
|
|
1666
|
+
name: typebox8.TString;
|
|
1667
|
+
snapshot: typebox8.TString;
|
|
1668
|
+
created_at: typebox8.TString;
|
|
1669
1669
|
}>;
|
|
1670
1670
|
type DevMigrations = Static<typeof devMigrationsSchema>;
|
|
1671
1671
|
//#endregion
|
|
@@ -1828,17 +1828,17 @@ declare class PostgresTypeProvider {
|
|
|
1828
1828
|
/**
|
|
1829
1829
|
* Creates a column Created At. So just a datetime column with a default value of the current timestamp.
|
|
1830
1830
|
*/
|
|
1831
|
-
readonly createdAt: (options?: TStringOptions) => PgAttr<PgAttr<
|
|
1831
|
+
readonly createdAt: (options?: TStringOptions) => PgAttr<PgAttr<typebox8.TCodec<TString, dayjs0.Dayjs>, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
1832
1832
|
/**
|
|
1833
1833
|
* Creates a column Updated At. Like createdAt, but it is updated on every update of the row.
|
|
1834
1834
|
*/
|
|
1835
|
-
readonly updatedAt: (options?: TStringOptions) => PgAttr<PgAttr<
|
|
1835
|
+
readonly updatedAt: (options?: TStringOptions) => PgAttr<PgAttr<typebox8.TCodec<TString, dayjs0.Dayjs>, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
1836
1836
|
/**
|
|
1837
1837
|
* Creates a column Deleted At for soft delete functionality.
|
|
1838
1838
|
* This is used to mark rows as deleted without actually removing them from the database.
|
|
1839
1839
|
* The column is nullable - NULL means not deleted, timestamp means deleted.
|
|
1840
1840
|
*/
|
|
1841
|
-
readonly deletedAt: (options?: TStringOptions) => PgAttr<
|
|
1841
|
+
readonly deletedAt: (options?: TStringOptions) => PgAttr<typebox8.TOptional<typebox8.TCodec<TString, dayjs0.Dayjs>>, typeof PG_DELETED_AT>;
|
|
1842
1842
|
/**
|
|
1843
1843
|
* Creates a Postgres ENUM type.
|
|
1844
1844
|
*
|
|
@@ -1870,7 +1870,7 @@ declare const pg: PostgresTypeProvider;
|
|
|
1870
1870
|
/**
|
|
1871
1871
|
* @deprecated Use `pg.primaryKey()` instead.
|
|
1872
1872
|
*/
|
|
1873
|
-
declare const legacyIdSchema: PgAttr<PgAttr<PgAttr<
|
|
1873
|
+
declare const legacyIdSchema: PgAttr<PgAttr<PgAttr<typebox8.TInteger, typeof PG_PRIMARY_KEY>, typeof PG_SERIAL>, typeof PG_DEFAULT>;
|
|
1874
1874
|
//#endregion
|
|
1875
1875
|
//#region src/types/schema.d.ts
|
|
1876
1876
|
/**
|
package/react/i18n.d.ts
CHANGED
|
@@ -1,25 +1,49 @@
|
|
|
1
1
|
import * as _alepha_core1 from "alepha";
|
|
2
|
-
import { Alepha, Descriptor, KIND } from "alepha";
|
|
2
|
+
import { Alepha, Descriptor, KIND, TypeBoxError } from "alepha";
|
|
3
|
+
import { DateTime, DateTimeProvider } from "alepha/datetime";
|
|
3
4
|
import * as _alepha_logger0 from "alepha/logger";
|
|
4
5
|
import * as _alepha_server_cookies0 from "alepha/server/cookies";
|
|
5
6
|
import * as typebox0 from "typebox";
|
|
6
7
|
|
|
8
|
+
//#region src/components/Localize.d.ts
|
|
9
|
+
interface LocalizeProps {
|
|
10
|
+
value: string | number | Date | DateTime | TypeBoxError;
|
|
11
|
+
/**
|
|
12
|
+
* Options for number formatting (when value is a number)
|
|
13
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat
|
|
14
|
+
*/
|
|
15
|
+
number?: Intl.NumberFormatOptions;
|
|
16
|
+
/**
|
|
17
|
+
* Options for date formatting (when value is a Date or DateTime)
|
|
18
|
+
* Can be:
|
|
19
|
+
* - A dayjs format string (e.g., "LLL", "YYYY-MM-DD", "dddd, MMMM D YYYY")
|
|
20
|
+
* - "fromNow" for relative time (e.g., "2 hours ago")
|
|
21
|
+
* - Intl.DateTimeFormatOptions for native formatting
|
|
22
|
+
* @see https://day.js.org/docs/en/display/format
|
|
23
|
+
* @see https://day.js.org/docs/en/display/from-now
|
|
24
|
+
*/
|
|
25
|
+
date?: string | "fromNow" | Intl.DateTimeFormatOptions;
|
|
26
|
+
/**
|
|
27
|
+
* Timezone to display dates in (when value is a Date or DateTime)
|
|
28
|
+
* Uses IANA timezone names (e.g., "America/New_York", "Europe/Paris", "Asia/Tokyo")
|
|
29
|
+
* @see https://day.js.org/docs/en/timezone/timezone
|
|
30
|
+
*/
|
|
31
|
+
timezone?: string;
|
|
32
|
+
}
|
|
33
|
+
declare const Localize: (props: LocalizeProps) => string;
|
|
34
|
+
//#endregion
|
|
7
35
|
//#region src/hooks/useI18n.d.ts
|
|
8
36
|
/**
|
|
9
37
|
* Hook to access the i18n service.
|
|
10
38
|
*/
|
|
11
|
-
declare const useI18n: <S extends object, K$1 extends keyof ServiceDictionary<S>>() => I18nProvider<S, K$1
|
|
12
|
-
tr(key: keyof ServiceDictionary<S>[K$1] | string, options?: {
|
|
13
|
-
args?: string[];
|
|
14
|
-
default?: string;
|
|
15
|
-
}): string;
|
|
16
|
-
};
|
|
39
|
+
declare const useI18n: <S extends object, K$1 extends keyof ServiceDictionary<S>>() => I18nProvider<S, K$1>;
|
|
17
40
|
type ServiceDictionary<T extends object> = { [K in keyof T]: T[K] extends DictionaryDescriptor<infer U> ? U : never };
|
|
18
41
|
//#endregion
|
|
19
42
|
//#region src/providers/I18nProvider.d.ts
|
|
20
43
|
declare class I18nProvider<S extends object, K$1 extends keyof ServiceDictionary<S>> {
|
|
21
44
|
protected logger: _alepha_logger0.Logger;
|
|
22
45
|
protected alepha: Alepha;
|
|
46
|
+
protected dateTimeProvider: DateTimeProvider;
|
|
23
47
|
protected cookie: _alepha_server_cookies0.AbstractCookieDescriptor<typebox0.TString>;
|
|
24
48
|
readonly registry: Array<{
|
|
25
49
|
name: string;
|
|
@@ -37,14 +61,15 @@ declare class I18nProvider<S extends object, K$1 extends keyof ServiceDictionary
|
|
|
37
61
|
format: (value: number) => string;
|
|
38
62
|
};
|
|
39
63
|
get languages(): string[];
|
|
64
|
+
constructor();
|
|
40
65
|
protected readonly onRender: _alepha_core1.HookDescriptor<"server:onRequest">;
|
|
41
66
|
protected readonly onStart: _alepha_core1.HookDescriptor<"start">;
|
|
42
|
-
protected
|
|
67
|
+
protected refreshLocale(): void;
|
|
43
68
|
setLang: (lang: string) => Promise<void>;
|
|
44
69
|
protected readonly mutate: _alepha_core1.HookDescriptor<"state:mutate">;
|
|
45
70
|
get lang(): string;
|
|
46
71
|
translate: (key: string, args?: string[]) => string;
|
|
47
|
-
readonly tr: (key: keyof ServiceDictionary<S>[K$1]
|
|
72
|
+
readonly tr: (key: keyof ServiceDictionary<S>[K$1], options?: {
|
|
48
73
|
args?: string[];
|
|
49
74
|
default?: string;
|
|
50
75
|
}) => string;
|
|
@@ -114,5 +139,5 @@ declare module "alepha" {
|
|
|
114
139
|
*/
|
|
115
140
|
declare const AlephaReactI18n: _alepha_core1.Service<_alepha_core1.Module<{}>>;
|
|
116
141
|
//#endregion
|
|
117
|
-
export { $dictionary, AlephaReactI18n, DictionaryDescriptor, DictionaryDescriptorOptions, I18nProvider, ServiceDictionary, useI18n };
|
|
142
|
+
export { $dictionary, AlephaReactI18n, DictionaryDescriptor, DictionaryDescriptorOptions, I18nProvider, Localize, type LocalizeProps, ServiceDictionary, useI18n };
|
|
118
143
|
//# sourceMappingURL=index.d.ts.map
|
package/react.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alepha_core1 from "alepha";
|
|
2
2
|
import { Alepha, Async, Configurable, Descriptor, Hooks, KIND, Service, State, Static, TObject, TSchema } from "alepha";
|
|
3
3
|
import { RequestConfigSchema, ServerHandler, ServerProvider, ServerRequest, ServerRouterProvider, ServerTimingProvider } from "alepha/server";
|
|
4
4
|
import { ServerRouteCache } from "alepha/server/cache";
|
|
5
5
|
import { ClientScope, HttpVirtualClient, LinkProvider, VirtualAction } from "alepha/server/links";
|
|
6
|
-
import * as
|
|
6
|
+
import * as _alepha_logger0 from "alepha/logger";
|
|
7
7
|
import * as react0 from "react";
|
|
8
8
|
import React, { AnchorHTMLAttributes, CSSProperties, ErrorInfo, FC, PropsWithChildren, ReactNode } from "react";
|
|
9
9
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
@@ -40,14 +40,14 @@ declare class Redirection extends Error {
|
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
42
|
//#region src/providers/ReactPageProvider.d.ts
|
|
43
|
-
declare const envSchema$2:
|
|
44
|
-
REACT_STRICT_MODE:
|
|
43
|
+
declare const envSchema$2: _alepha_core1.TObject<{
|
|
44
|
+
REACT_STRICT_MODE: _alepha_core1.TBoolean;
|
|
45
45
|
}>;
|
|
46
46
|
declare module "alepha" {
|
|
47
47
|
interface Env extends Partial<Static<typeof envSchema$2>> {}
|
|
48
48
|
}
|
|
49
49
|
declare class ReactPageProvider {
|
|
50
|
-
protected readonly log:
|
|
50
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
51
51
|
protected readonly env: {
|
|
52
52
|
REACT_STRICT_MODE: boolean;
|
|
53
53
|
};
|
|
@@ -83,7 +83,7 @@ declare class ReactPageProvider {
|
|
|
83
83
|
}, params?: Record<string, any>): string;
|
|
84
84
|
compile(path: string, params?: Record<string, string>): string;
|
|
85
85
|
protected renderView(index: number, path: string, view: ReactNode | undefined, page: PageRoute): ReactNode;
|
|
86
|
-
protected readonly configure:
|
|
86
|
+
protected readonly configure: _alepha_core1.HookDescriptor<"configure">;
|
|
87
87
|
protected map(pages: Array<PageDescriptor>, target: PageDescriptor): PageRouteEntry;
|
|
88
88
|
add(entry: PageRouteEntry): void;
|
|
89
89
|
protected createMatch(page: PageRoute): string;
|
|
@@ -489,18 +489,18 @@ interface BrowserRoute extends Route {
|
|
|
489
489
|
page: PageRoute;
|
|
490
490
|
}
|
|
491
491
|
declare class ReactBrowserRouterProvider extends RouterProvider<BrowserRoute> {
|
|
492
|
-
protected readonly log:
|
|
492
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
493
493
|
protected readonly alepha: Alepha;
|
|
494
494
|
protected readonly pageApi: ReactPageProvider;
|
|
495
495
|
add(entry: PageRouteEntry): void;
|
|
496
|
-
protected readonly configure:
|
|
496
|
+
protected readonly configure: _alepha_core1.HookDescriptor<"configure">;
|
|
497
497
|
transition(url: URL, previous?: PreviousLayerData[], meta?: {}): Promise<string | void>;
|
|
498
498
|
root(state: ReactRouterState): ReactNode;
|
|
499
499
|
}
|
|
500
500
|
//#endregion
|
|
501
501
|
//#region src/providers/ReactBrowserProvider.d.ts
|
|
502
|
-
declare const envSchema$1:
|
|
503
|
-
REACT_ROOT_ID:
|
|
502
|
+
declare const envSchema$1: _alepha_core1.TObject<{
|
|
503
|
+
REACT_ROOT_ID: _alepha_core1.TString;
|
|
504
504
|
}>;
|
|
505
505
|
declare module "alepha" {
|
|
506
506
|
interface Env extends Partial<Static<typeof envSchema$1>> {}
|
|
@@ -512,7 +512,7 @@ declare class ReactBrowserProvider {
|
|
|
512
512
|
protected readonly env: {
|
|
513
513
|
REACT_ROOT_ID: string;
|
|
514
514
|
};
|
|
515
|
-
protected readonly log:
|
|
515
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
516
516
|
protected readonly client: LinkProvider;
|
|
517
517
|
protected readonly alepha: Alepha;
|
|
518
518
|
protected readonly router: ReactBrowserRouterProvider;
|
|
@@ -546,8 +546,8 @@ declare class ReactBrowserProvider {
|
|
|
546
546
|
* Get embedded layers from the server.
|
|
547
547
|
*/
|
|
548
548
|
protected getHydrationState(): ReactHydrationState | undefined;
|
|
549
|
-
protected readonly onTransitionEnd:
|
|
550
|
-
readonly ready:
|
|
549
|
+
protected readonly onTransitionEnd: _alepha_core1.HookDescriptor<"react:transition:end">;
|
|
550
|
+
readonly ready: _alepha_core1.HookDescriptor<"ready">;
|
|
551
551
|
}
|
|
552
552
|
interface RouterGoOptions {
|
|
553
553
|
replace?: boolean;
|
|
@@ -800,12 +800,12 @@ declare const ssrSchemaLoading: (alepha: Alepha, name: string) => RequestConfigS
|
|
|
800
800
|
declare const useStore: <Key extends keyof State>(key: Key, defaultValue?: State[Key]) => [State[Key], (value: State[Key]) => void];
|
|
801
801
|
//#endregion
|
|
802
802
|
//#region src/providers/ReactServerProvider.d.ts
|
|
803
|
-
declare const envSchema:
|
|
804
|
-
REACT_SERVER_DIST:
|
|
805
|
-
REACT_SERVER_PREFIX:
|
|
806
|
-
REACT_SSR_ENABLED:
|
|
807
|
-
REACT_ROOT_ID:
|
|
808
|
-
REACT_SERVER_TEMPLATE:
|
|
803
|
+
declare const envSchema: _alepha_core1.TObject<{
|
|
804
|
+
REACT_SERVER_DIST: _alepha_core1.TString;
|
|
805
|
+
REACT_SERVER_PREFIX: _alepha_core1.TString;
|
|
806
|
+
REACT_SSR_ENABLED: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
|
|
807
|
+
REACT_ROOT_ID: _alepha_core1.TString;
|
|
808
|
+
REACT_SERVER_TEMPLATE: _alepha_core1.TOptional<_alepha_core1.TString>;
|
|
809
809
|
}>;
|
|
810
810
|
declare module "alepha" {
|
|
811
811
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
@@ -821,7 +821,7 @@ interface ReactServerProviderOptions {
|
|
|
821
821
|
static?: Partial<Omit<ServeDescriptorOptions, "root">>;
|
|
822
822
|
}
|
|
823
823
|
declare class ReactServerProvider implements Configurable {
|
|
824
|
-
protected readonly log:
|
|
824
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
825
825
|
protected readonly alepha: Alepha;
|
|
826
826
|
protected readonly env: {
|
|
827
827
|
REACT_SSR_ENABLED?: boolean | undefined;
|
|
@@ -841,7 +841,7 @@ declare class ReactServerProvider implements Configurable {
|
|
|
841
841
|
/**
|
|
842
842
|
* Configure the React server provider.
|
|
843
843
|
*/
|
|
844
|
-
readonly onConfigure:
|
|
844
|
+
readonly onConfigure: _alepha_core1.HookDescriptor<"configure">;
|
|
845
845
|
get template(): string;
|
|
846
846
|
protected registerPages(templateLoader: TemplateLoader): Promise<void>;
|
|
847
847
|
/**
|
|
@@ -923,7 +923,7 @@ declare module "alepha" {
|
|
|
923
923
|
* @see {@link $page}
|
|
924
924
|
* @module alepha.react
|
|
925
925
|
*/
|
|
926
|
-
declare const AlephaReact:
|
|
926
|
+
declare const AlephaReact: _alepha_core1.Service<_alepha_core1.Module<{}>>;
|
|
927
927
|
//#endregion
|
|
928
928
|
export { $page, AlephaContext, AlephaReact, AnchorProps, ClientOnly, CreateLayersResult, ErrorBoundary, ErrorHandler, ErrorViewer, Layer, Link, LinkProps, _default as NestedView, NotFoundPage as NotFound, PageAnimation, PageConfigSchema, PageDescriptor, PageDescriptorOptions, PageDescriptorRenderOptions, PageDescriptorRenderResult, PageRequestConfig, PageResolve, PageRoute, PageRouteEntry, PreviousLayerData, ReactBrowserProvider, ReactBrowserRendererOptions, ReactHydrationState, ReactPageProvider, ReactRouter, ReactRouterState, ReactServerProvider, ReactServerProviderOptions, Redirection, RouterGoOptions, RouterLayerContext, RouterLayerContextValue, RouterRenderOptions, RouterStackItem, TPropsDefault, TPropsParentDefault, TransitionOptions, UseActiveHook, UseActiveOptions, UseQueryParamsHookOptions, UseSchemaReturn, VirtualRouter, isPageRoute, ssrSchemaLoading, useActive, useAlepha, useClient, useInject, useQueryParams, useRouter, useRouterEvents, useRouterState, useSchema, useStore };
|
|
929
929
|
//# 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
|
|
3
|
+
import * as _alepha_logger1 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:
|
|
71
|
+
protected readonly log: _alepha_logger1.Logger;
|
|
72
72
|
protected readonly keystore: KeyLoaderHolder[];
|
|
73
73
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
74
74
|
protected readonly encoder: TextEncoder;
|
|
@@ -141,7 +141,7 @@ declare class SecurityProvider {
|
|
|
141
141
|
protected readonly UNKNOWN_USER_NAME = "Anonymous User";
|
|
142
142
|
protected readonly PERMISSION_REGEXP: RegExp;
|
|
143
143
|
protected readonly PERMISSION_REGEXP_WILDCARD: RegExp;
|
|
144
|
-
protected readonly log:
|
|
144
|
+
protected readonly log: _alepha_logger1.Logger;
|
|
145
145
|
protected readonly jwt: JwtProvider;
|
|
146
146
|
protected readonly env: {
|
|
147
147
|
APP_SECRET: string;
|
|
@@ -400,7 +400,7 @@ declare class RealmDescriptor extends Descriptor<RealmDescriptorOptions> {
|
|
|
400
400
|
protected readonly securityProvider: SecurityProvider;
|
|
401
401
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
402
402
|
protected readonly jwt: JwtProvider;
|
|
403
|
-
protected readonly log:
|
|
403
|
+
protected readonly log: _alepha_logger1.Logger;
|
|
404
404
|
get name(): string;
|
|
405
405
|
get accessTokenExpiration(): Duration;
|
|
406
406
|
get refreshTokenExpiration(): Duration;
|
package/ui.cjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var m = require('@alepha/ui');
|
|
3
|
-
Object.keys(m).forEach(function (k) {
|
|
4
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
5
|
-
enumerable: true,
|
|
6
|
-
get: function () { return m[k]; }
|
|
7
|
-
});
|
|
8
|
-
});
|