alepha 0.10.5 → 0.10.6
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/files.d.ts +198 -121
- package/api/jobs.d.ts +170 -170
- package/api/users.d.ts +216 -216
- package/command.d.ts +1 -1
- package/devtools.d.ts +247 -247
- package/email.d.ts +5 -5
- package/package.json +48 -48
- package/postgres.d.ts +36 -13
- package/react.d.ts +26 -26
- package/security.d.ts +4 -7
- package/server/cache.d.ts +16 -7
- package/server/links.d.ts +31 -31
- package/server/security.d.ts +4 -6
- package/server.d.ts +20 -20
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alepha",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22.0.0"
|
|
@@ -15,55 +15,55 @@
|
|
|
15
15
|
"main": "./core.js",
|
|
16
16
|
"types": "./core.d.ts",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@alepha/api-files": "0.10.
|
|
19
|
-
"@alepha/api-jobs": "0.10.
|
|
20
|
-
"@alepha/api-users": "0.10.
|
|
21
|
-
"@alepha/batch": "0.10.
|
|
22
|
-
"@alepha/bucket": "0.10.
|
|
23
|
-
"@alepha/cache": "0.10.
|
|
24
|
-
"@alepha/cache-redis": "0.10.
|
|
25
|
-
"@alepha/command": "0.10.
|
|
26
|
-
"@alepha/core": "0.10.
|
|
27
|
-
"@alepha/datetime": "0.10.
|
|
28
|
-
"@alepha/devtools": "0.10.
|
|
29
|
-
"@alepha/email": "0.10.
|
|
30
|
-
"@alepha/file": "0.10.
|
|
31
|
-
"@alepha/lock": "0.10.
|
|
32
|
-
"@alepha/lock-redis": "0.10.
|
|
33
|
-
"@alepha/logger": "0.10.
|
|
34
|
-
"@alepha/postgres": "0.10.
|
|
35
|
-
"@alepha/queue": "0.10.
|
|
36
|
-
"@alepha/queue-redis": "0.10.
|
|
37
|
-
"@alepha/react": "0.10.
|
|
38
|
-
"@alepha/react-auth": "0.10.
|
|
39
|
-
"@alepha/react-form": "0.10.
|
|
40
|
-
"@alepha/react-head": "0.10.
|
|
41
|
-
"@alepha/react-i18n": "0.10.
|
|
42
|
-
"@alepha/redis": "0.10.
|
|
43
|
-
"@alepha/retry": "0.10.
|
|
44
|
-
"@alepha/router": "0.10.
|
|
45
|
-
"@alepha/scheduler": "0.10.
|
|
46
|
-
"@alepha/security": "0.10.
|
|
47
|
-
"@alepha/server": "0.10.
|
|
48
|
-
"@alepha/server-cache": "0.10.
|
|
49
|
-
"@alepha/server-compress": "0.10.
|
|
50
|
-
"@alepha/server-cookies": "0.10.
|
|
51
|
-
"@alepha/server-cors": "0.10.
|
|
52
|
-
"@alepha/server-health": "0.10.
|
|
53
|
-
"@alepha/server-helmet": "0.10.
|
|
54
|
-
"@alepha/server-links": "0.10.
|
|
55
|
-
"@alepha/server-metrics": "0.10.
|
|
56
|
-
"@alepha/server-multipart": "0.10.
|
|
57
|
-
"@alepha/server-proxy": "0.10.
|
|
58
|
-
"@alepha/server-security": "0.10.
|
|
59
|
-
"@alepha/server-static": "0.10.
|
|
60
|
-
"@alepha/server-swagger": "0.10.
|
|
61
|
-
"@alepha/topic": "0.10.
|
|
62
|
-
"@alepha/topic-redis": "0.10.
|
|
63
|
-
"@alepha/vite": "0.10.
|
|
18
|
+
"@alepha/api-files": "0.10.6",
|
|
19
|
+
"@alepha/api-jobs": "0.10.6",
|
|
20
|
+
"@alepha/api-users": "0.10.6",
|
|
21
|
+
"@alepha/batch": "0.10.6",
|
|
22
|
+
"@alepha/bucket": "0.10.6",
|
|
23
|
+
"@alepha/cache": "0.10.6",
|
|
24
|
+
"@alepha/cache-redis": "0.10.6",
|
|
25
|
+
"@alepha/command": "0.10.6",
|
|
26
|
+
"@alepha/core": "0.10.6",
|
|
27
|
+
"@alepha/datetime": "0.10.6",
|
|
28
|
+
"@alepha/devtools": "0.10.6",
|
|
29
|
+
"@alepha/email": "0.10.6",
|
|
30
|
+
"@alepha/file": "0.10.6",
|
|
31
|
+
"@alepha/lock": "0.10.6",
|
|
32
|
+
"@alepha/lock-redis": "0.10.6",
|
|
33
|
+
"@alepha/logger": "0.10.6",
|
|
34
|
+
"@alepha/postgres": "0.10.6",
|
|
35
|
+
"@alepha/queue": "0.10.6",
|
|
36
|
+
"@alepha/queue-redis": "0.10.6",
|
|
37
|
+
"@alepha/react": "0.10.6",
|
|
38
|
+
"@alepha/react-auth": "0.10.6",
|
|
39
|
+
"@alepha/react-form": "0.10.6",
|
|
40
|
+
"@alepha/react-head": "0.10.6",
|
|
41
|
+
"@alepha/react-i18n": "0.10.6",
|
|
42
|
+
"@alepha/redis": "0.10.6",
|
|
43
|
+
"@alepha/retry": "0.10.6",
|
|
44
|
+
"@alepha/router": "0.10.6",
|
|
45
|
+
"@alepha/scheduler": "0.10.6",
|
|
46
|
+
"@alepha/security": "0.10.6",
|
|
47
|
+
"@alepha/server": "0.10.6",
|
|
48
|
+
"@alepha/server-cache": "0.10.6",
|
|
49
|
+
"@alepha/server-compress": "0.10.6",
|
|
50
|
+
"@alepha/server-cookies": "0.10.6",
|
|
51
|
+
"@alepha/server-cors": "0.10.6",
|
|
52
|
+
"@alepha/server-health": "0.10.6",
|
|
53
|
+
"@alepha/server-helmet": "0.10.6",
|
|
54
|
+
"@alepha/server-links": "0.10.6",
|
|
55
|
+
"@alepha/server-metrics": "0.10.6",
|
|
56
|
+
"@alepha/server-multipart": "0.10.6",
|
|
57
|
+
"@alepha/server-proxy": "0.10.6",
|
|
58
|
+
"@alepha/server-security": "0.10.6",
|
|
59
|
+
"@alepha/server-static": "0.10.6",
|
|
60
|
+
"@alepha/server-swagger": "0.10.6",
|
|
61
|
+
"@alepha/topic": "0.10.6",
|
|
62
|
+
"@alepha/topic-redis": "0.10.6",
|
|
63
|
+
"@alepha/vite": "0.10.6"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"tsdown": "^0.15.
|
|
66
|
+
"tsdown": "^0.15.7"
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|
|
69
69
|
"build": "node build.ts"
|
package/postgres.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _alepha_core1 from "alepha";
|
|
2
2
|
import { Alepha, AlephaError, Descriptor, KIND, Service, Static, TArray, TBigInt, TBoolean, TInteger, TNull, TNumber, TNumberOptions, TObject, TObjectOptions, TOptional, TOptionalAdd, TRecord, TSchema as TSchema$1, TString, TStringOptions, TUnion } from "alepha";
|
|
3
|
-
import * as
|
|
3
|
+
import * as drizzle_orm6 from "drizzle-orm";
|
|
4
4
|
import { BuildColumns, BuildExtraConfigColumns, SQL, SQLWrapper, TableConfig, sql } from "drizzle-orm";
|
|
5
5
|
import * as pg$1 from "drizzle-orm/pg-core";
|
|
6
6
|
import { AnyPgColumn, AnyPgTable, LockConfig, LockStrength, PgColumn, PgColumnBuilderBase, PgDatabase, PgInsertValue, PgSequenceOptions, PgTableExtraConfigValue, PgTableWithColumns, PgTransaction, PgTransactionConfig, SelectedFields, TableConfig as TableConfig$1, UpdateDeleteAction } from "drizzle-orm/pg-core";
|
|
@@ -116,14 +116,14 @@ declare const schemaToPgColumns: <T extends TObject>(schema: T) => FromSchema<T>
|
|
|
116
116
|
* @param value The value of the field.
|
|
117
117
|
* @returns The PG column.
|
|
118
118
|
*/
|
|
119
|
-
declare const mapFieldToColumn: (name: string, value: TSchema$1) => pg$1.PgSerialBuilderInitial<string> | pg$1.PgIntegerBuilderInitial<string> |
|
|
119
|
+
declare const mapFieldToColumn: (name: string, value: TSchema$1) => pg$1.PgSerialBuilderInitial<string> | pg$1.PgIntegerBuilderInitial<string> | drizzle_orm6.IsIdentity<pg$1.PgBigInt64BuilderInitial<"">, "byDefault"> | drizzle_orm6.IsIdentity<pg$1.PgBigInt64BuilderInitial<"">, "always"> | pg$1.PgBigInt53BuilderInitial<string> | pg$1.PgNumericBuilderInitial<string> | pg$1.PgDateStringBuilderInitial<string> | pg$1.PgUUIDBuilderInitial<string> | pg$1.PgCustomColumnBuilder<{
|
|
120
120
|
name: string;
|
|
121
121
|
dataType: "custom";
|
|
122
122
|
columnType: "PgCustomColumn";
|
|
123
123
|
data: Buffer<ArrayBufferLike>;
|
|
124
124
|
driverParam: unknown;
|
|
125
125
|
enumValues: undefined;
|
|
126
|
-
}> | pg$1.PgTimestampStringBuilderInitial<string> | pg$1.
|
|
126
|
+
}> | pg$1.PgTimestampStringBuilderInitial<string> | pg$1.PgTextBuilderInitial<string, [string, ...string[]]> | pg$1.PgBooleanBuilderInitial<string> | drizzle_orm6.$Type<pg$1.PgCustomColumnBuilder<{
|
|
127
127
|
name: string;
|
|
128
128
|
dataType: "custom";
|
|
129
129
|
columnType: "PgCustomColumn";
|
|
@@ -138,14 +138,14 @@ declare const mapFieldToColumn: (name: string, value: TSchema$1) => pg$1.PgSeria
|
|
|
138
138
|
[x: string]: unknown;
|
|
139
139
|
[x: number]: unknown;
|
|
140
140
|
[x: symbol]: unknown;
|
|
141
|
-
}> |
|
|
141
|
+
}> | drizzle_orm6.$Type<pg$1.PgCustomColumnBuilder<{
|
|
142
142
|
name: string;
|
|
143
143
|
dataType: "custom";
|
|
144
144
|
columnType: "PgCustomColumn";
|
|
145
145
|
data: Record<string, unknown>;
|
|
146
146
|
driverParam: string;
|
|
147
147
|
enumValues: undefined;
|
|
148
|
-
}>, Record<string, unknown>> |
|
|
148
|
+
}>, Record<string, unknown>> | drizzle_orm6.$Type<pg$1.PgCustomColumnBuilder<{
|
|
149
149
|
name: string;
|
|
150
150
|
dataType: "custom";
|
|
151
151
|
columnType: "PgCustomColumn";
|
|
@@ -251,14 +251,14 @@ declare const mapFieldToColumn: (name: string, value: TSchema$1) => pg$1.PgSeria
|
|
|
251
251
|
* @param key The key of the field.
|
|
252
252
|
* @param value The value of the field.
|
|
253
253
|
*/
|
|
254
|
-
declare const mapStringToColumn: (key: string, value: TSchema$1) => pg$1.PgUUIDBuilderInitial<string> | pg$1.PgCustomColumnBuilder<{
|
|
254
|
+
declare const mapStringToColumn: (key: string, value: TSchema$1) => pg$1.PgDateStringBuilderInitial<string> | pg$1.PgUUIDBuilderInitial<string> | pg$1.PgCustomColumnBuilder<{
|
|
255
255
|
name: string;
|
|
256
256
|
dataType: "custom";
|
|
257
257
|
columnType: "PgCustomColumn";
|
|
258
258
|
data: Buffer<ArrayBufferLike>;
|
|
259
259
|
driverParam: unknown;
|
|
260
260
|
enumValues: undefined;
|
|
261
|
-
}> | pg$1.PgTimestampStringBuilderInitial<string> | pg$1.
|
|
261
|
+
}> | pg$1.PgTimestampStringBuilderInitial<string> | pg$1.PgTextBuilderInitial<string, [string, ...string[]]>;
|
|
262
262
|
declare const camelToSnakeCase: (str: string) => string;
|
|
263
263
|
/**
|
|
264
264
|
* Convert a schema to columns.
|
|
@@ -1505,7 +1505,7 @@ declare class RepositoryDescriptor<EntityTableConfig extends TableConfig, Entity
|
|
|
1505
1505
|
/**
|
|
1506
1506
|
* Getter for the database connection from the database provider.
|
|
1507
1507
|
*/
|
|
1508
|
-
protected get db(): PgDatabase<any, Record<string, never>,
|
|
1508
|
+
protected get db(): PgDatabase<any, Record<string, never>, drizzle_orm6.ExtractTablesWithRelations<Record<string, never>>>;
|
|
1509
1509
|
/**
|
|
1510
1510
|
* Execute a SQL query.
|
|
1511
1511
|
*/
|
|
@@ -1530,10 +1530,10 @@ declare class RepositoryDescriptor<EntityTableConfig extends TableConfig, Entity
|
|
|
1530
1530
|
*
|
|
1531
1531
|
* @returns The SELECT query builder.
|
|
1532
1532
|
*/
|
|
1533
|
-
protected select(opts?: StatementOptions): pg$1.PgSelectBase<string, Record<string, PgColumn<
|
|
1533
|
+
protected select(opts?: StatementOptions): pg$1.PgSelectBase<string, Record<string, PgColumn<drizzle_orm6.ColumnBaseConfig<drizzle_orm6.ColumnDataType, string>, {}, {}>>, "single", Record<string, "not-null">, false, never, {
|
|
1534
1534
|
[x: string]: unknown;
|
|
1535
1535
|
}[], {
|
|
1536
|
-
[x: string]: PgColumn<
|
|
1536
|
+
[x: string]: PgColumn<drizzle_orm6.ColumnBaseConfig<drizzle_orm6.ColumnDataType, string>, {}, {}>;
|
|
1537
1537
|
}>;
|
|
1538
1538
|
protected selectDistinct(opts: StatementOptions | undefined, fields: SelectedFields): pg$1.PgSelectBase<string, SelectedFields, "partial", Record<string, "not-null">, false, never, {
|
|
1539
1539
|
[x: string]: unknown;
|
|
@@ -1750,7 +1750,7 @@ declare class RepositoryDescriptor<EntityTableConfig extends TableConfig, Entity
|
|
|
1750
1750
|
*/
|
|
1751
1751
|
protected getPrimaryKey(schema: TObject): {
|
|
1752
1752
|
key: string;
|
|
1753
|
-
col: PgColumn<
|
|
1753
|
+
col: PgColumn<drizzle_orm6.ColumnBaseConfig<drizzle_orm6.ColumnDataType, string>, {}, {}>;
|
|
1754
1754
|
type: TSchema$1;
|
|
1755
1755
|
};
|
|
1756
1756
|
}
|
|
@@ -2268,6 +2268,12 @@ interface TransactionDescriptorOptions<T extends any[], R> {
|
|
|
2268
2268
|
}
|
|
2269
2269
|
type TransactionContext = PgTransaction<any, any, any>;
|
|
2270
2270
|
//#endregion
|
|
2271
|
+
//#region src/errors/PgConflictError.d.ts
|
|
2272
|
+
declare class PgConflictError extends PgError {
|
|
2273
|
+
readonly name = "PgConflictError";
|
|
2274
|
+
readonly status = 409;
|
|
2275
|
+
}
|
|
2276
|
+
//#endregion
|
|
2271
2277
|
//#region src/errors/PgEntityNotFoundError.d.ts
|
|
2272
2278
|
declare class PgEntityNotFoundError extends PgError {
|
|
2273
2279
|
readonly name = "EntityNotFoundError";
|
|
@@ -2275,6 +2281,23 @@ declare class PgEntityNotFoundError extends PgError {
|
|
|
2275
2281
|
constructor(entityName: string);
|
|
2276
2282
|
}
|
|
2277
2283
|
//#endregion
|
|
2284
|
+
//#region src/errors/PgMigrationError.d.ts
|
|
2285
|
+
declare class PgMigrationError extends PgError {
|
|
2286
|
+
readonly name = "PgMigrationError";
|
|
2287
|
+
constructor(cause?: unknown);
|
|
2288
|
+
}
|
|
2289
|
+
//#endregion
|
|
2290
|
+
//#region src/errors/PgVersionMismatchError.d.ts
|
|
2291
|
+
/**
|
|
2292
|
+
* Error thrown when there is a version mismatch.
|
|
2293
|
+
* It's thrown by {@link RepositoryDescriptor#save} when the updated entity version does not match the one in the database.
|
|
2294
|
+
* This is used for optimistic concurrency control.
|
|
2295
|
+
*/
|
|
2296
|
+
declare class PgVersionMismatchError extends PgError {
|
|
2297
|
+
readonly name = "PgVersionMismatchError";
|
|
2298
|
+
constructor(table: string, id: any);
|
|
2299
|
+
}
|
|
2300
|
+
//#endregion
|
|
2278
2301
|
//#region src/providers/RepositoryProvider.d.ts
|
|
2279
2302
|
declare class RepositoryProvider {
|
|
2280
2303
|
protected readonly log: _alepha_logger1.Logger;
|
|
@@ -2508,7 +2531,7 @@ declare const legacyIdSchema: PgAttr<PgAttr<PgAttr<typebox1.TInteger, typeof PG_
|
|
|
2508
2531
|
/**
|
|
2509
2532
|
* Postgres schema type.
|
|
2510
2533
|
*/
|
|
2511
|
-
declare const schema: <TDocument extends TSchema$1>(name: string, document: TDocument) =>
|
|
2534
|
+
declare const schema: <TDocument extends TSchema$1>(name: string, document: TDocument) => drizzle_orm6.$Type<pg$1.PgCustomColumnBuilder<{
|
|
2512
2535
|
name: string;
|
|
2513
2536
|
dataType: "custom";
|
|
2514
2537
|
columnType: "PgCustomColumn";
|
|
@@ -2560,5 +2583,5 @@ declare const schema: <TDocument extends TSchema$1>(name: string, document: TDoc
|
|
|
2560
2583
|
*/
|
|
2561
2584
|
declare const AlephaPostgres: _alepha_core1.Service<_alepha_core1.Module<{}>>;
|
|
2562
2585
|
//#endregion
|
|
2563
|
-
export { $entity, $repository, $sequence, $transaction, AlephaPostgres, DrizzleKitProvider, Entity, EntityDescriptorOptions, ExtractManyRelations, FilterOperators, FromSchema, NodePostgresProvider, NodePostgresProviderOptions, OrderBy, OrderByClause, OrderDirection, PG_CREATED_AT, PG_DEFAULT, PG_DELETED_AT, PG_IDENTITY, PG_MANY, PG_ONE, PG_PRIMARY_KEY, PG_REF, PG_SCHEMA, PG_SERIAL, PG_UPDATED_AT, PG_VERSION, Page, PageQuery, PgAttr, PgAttrField, PgDefault, PgEntityNotFoundError, PgIdentityOptions, PgMany, PgManyOptions, PgOne, PgPrimaryKey, PgQuery, PgQueryWhere, PgQueryWhereOrSQL, PgQueryWhereWithMany, PgQueryWhereWithManyOrSQL, PgQueryWithMany, PgQueryWithMap, PgQueryWithOne, PgRef, PgRefOptions, PgSymbolKeys, PgSymbols, PgTableConfig, PgTableWithColumnsAndSchema, PostgresProvider, PostgresTypeProvider, RelField, RemoveManyRelations, RepositoryDescriptor, RepositoryDescriptorOptions, RepositoryProvider, SQLLike, SequenceDescriptor, SequenceDescriptorOptions, StatementOptions, TObjectInsert, TObjectUpdate, TPage, TransactionContext, TransactionDescriptorOptions, camelToSnakeCase,
|
|
2586
|
+
export { $entity, $repository, $sequence, $transaction, AlephaPostgres, DrizzleKitProvider, Entity, EntityDescriptorOptions, ExtractManyRelations, FilterOperators, FromSchema, NodePostgresProvider, NodePostgresProviderOptions, OrderBy, OrderByClause, OrderDirection, PG_CREATED_AT, PG_DEFAULT, PG_DELETED_AT, PG_IDENTITY, PG_MANY, PG_ONE, PG_PRIMARY_KEY, PG_REF, PG_SCHEMA, PG_SERIAL, PG_UPDATED_AT, PG_VERSION, Page, PageQuery, PgAttr, PgAttrField, PgConflictError, PgDefault, PgEntityNotFoundError, PgError, PgIdentityOptions, PgMany, PgManyOptions, PgMigrationError, PgOne, PgPrimaryKey, PgQuery, PgQueryWhere, PgQueryWhereOrSQL, PgQueryWhereWithMany, PgQueryWhereWithManyOrSQL, PgQueryWithMany, PgQueryWithMap, PgQueryWithOne, PgRef, PgRefOptions, PgSymbolKeys, PgSymbols, PgTableConfig, PgTableWithColumnsAndSchema, PgVersionMismatchError, PostgresProvider, PostgresTypeProvider, RelField, RemoveManyRelations, RepositoryDescriptor, RepositoryDescriptorOptions, RepositoryProvider, SQLLike, SequenceDescriptor, SequenceDescriptorOptions, StatementOptions, TObjectInsert, TObjectUpdate, TPage, TransactionContext, TransactionDescriptorOptions, camelToSnakeCase, drizzle_orm6 as drizzle, getAttrFields, insertSchema, legacyIdSchema, mapFieldToColumn, mapStringToColumn, pageQuerySchema, pageSchema, pg, pgAttr, schema, schemaToPgColumns, sql, updateSchema };
|
|
2564
2587
|
//# sourceMappingURL=index.d.ts.map
|
package/react.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alepha_core14 from "alepha";
|
|
2
2
|
import { Alepha, Async, 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
|
|
7
|
-
import * as
|
|
6
|
+
import * as _alepha_logger1 from "alepha/logger";
|
|
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";
|
|
10
10
|
import { ServerStaticProvider } from "alepha/server/static";
|
|
@@ -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_core14.TObject<{
|
|
44
|
+
REACT_STRICT_MODE: _alepha_core14.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_logger1.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_core14.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_logger1.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_core14.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_core14.TObject<{
|
|
503
|
+
REACT_ROOT_ID: _alepha_core14.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_logger1.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_core14.HookDescriptor<"react:transition:end">;
|
|
550
|
+
readonly ready: _alepha_core14.HookDescriptor<"ready">;
|
|
551
551
|
}
|
|
552
552
|
interface RouterGoOptions {
|
|
553
553
|
replace?: boolean;
|
|
@@ -632,7 +632,7 @@ interface NestedViewProps {
|
|
|
632
632
|
children?: ReactNode;
|
|
633
633
|
errorBoundary?: false | ((error: Error) => ReactNode);
|
|
634
634
|
}
|
|
635
|
-
declare const _default:
|
|
635
|
+
declare const _default: react0.MemoExoticComponent<(props: NestedViewProps) => react_jsx_runtime0.JSX.Element>;
|
|
636
636
|
//#endregion
|
|
637
637
|
//#region src/components/NotFound.d.ts
|
|
638
638
|
declare function NotFoundPage(props: {
|
|
@@ -640,14 +640,14 @@ declare function NotFoundPage(props: {
|
|
|
640
640
|
}): react_jsx_runtime0.JSX.Element;
|
|
641
641
|
//#endregion
|
|
642
642
|
//#region src/contexts/AlephaContext.d.ts
|
|
643
|
-
declare const AlephaContext:
|
|
643
|
+
declare const AlephaContext: react0.Context<Alepha | undefined>;
|
|
644
644
|
//#endregion
|
|
645
645
|
//#region src/contexts/RouterLayerContext.d.ts
|
|
646
646
|
interface RouterLayerContextValue {
|
|
647
647
|
index: number;
|
|
648
648
|
path: string;
|
|
649
649
|
}
|
|
650
|
-
declare const RouterLayerContext:
|
|
650
|
+
declare const RouterLayerContext: react0.Context<RouterLayerContextValue | undefined>;
|
|
651
651
|
//#endregion
|
|
652
652
|
//#region src/hooks/useActive.d.ts
|
|
653
653
|
interface UseActiveOptions {
|
|
@@ -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_core14.TObject<{
|
|
804
|
+
REACT_SERVER_DIST: _alepha_core14.TString;
|
|
805
|
+
REACT_SERVER_PREFIX: _alepha_core14.TString;
|
|
806
|
+
REACT_SSR_ENABLED: _alepha_core14.TOptional<_alepha_core14.TBoolean>;
|
|
807
|
+
REACT_ROOT_ID: _alepha_core14.TString;
|
|
808
|
+
REACT_SERVER_TEMPLATE: _alepha_core14.TOptional<_alepha_core14.TString>;
|
|
809
809
|
}>;
|
|
810
810
|
declare module "alepha" {
|
|
811
811
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
@@ -814,7 +814,7 @@ declare module "alepha" {
|
|
|
814
814
|
}
|
|
815
815
|
}
|
|
816
816
|
declare class ReactServerProvider {
|
|
817
|
-
protected readonly log:
|
|
817
|
+
protected readonly log: _alepha_logger1.Logger;
|
|
818
818
|
protected readonly alepha: Alepha;
|
|
819
819
|
protected readonly pageApi: ReactPageProvider;
|
|
820
820
|
protected readonly serverProvider: ServerProvider;
|
|
@@ -830,7 +830,7 @@ declare class ReactServerProvider {
|
|
|
830
830
|
};
|
|
831
831
|
protected readonly ROOT_DIV_REGEX: RegExp;
|
|
832
832
|
protected preprocessedTemplate: PreprocessedTemplate | null;
|
|
833
|
-
readonly onConfigure:
|
|
833
|
+
readonly onConfigure: _alepha_core14.HookDescriptor<"configure">;
|
|
834
834
|
get template(): string;
|
|
835
835
|
protected registerPages(templateLoader: TemplateLoader): Promise<void>;
|
|
836
836
|
protected getPublicDirectory(): string;
|
|
@@ -903,7 +903,7 @@ declare module "alepha" {
|
|
|
903
903
|
* @see {@link $page}
|
|
904
904
|
* @module alepha.react
|
|
905
905
|
*/
|
|
906
|
-
declare const AlephaReact:
|
|
906
|
+
declare const AlephaReact: _alepha_core14.Service<_alepha_core14.Module<{}>>;
|
|
907
907
|
//#endregion
|
|
908
908
|
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, 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 };
|
|
909
909
|
//# 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;
|
|
@@ -140,7 +140,7 @@ declare class SecurityProvider {
|
|
|
140
140
|
protected readonly UNKNOWN_USER_NAME = "Anonymous User";
|
|
141
141
|
protected readonly PERMISSION_REGEXP: RegExp;
|
|
142
142
|
protected readonly PERMISSION_REGEXP_WILDCARD: RegExp;
|
|
143
|
-
protected readonly log:
|
|
143
|
+
protected readonly log: _alepha_logger1.Logger;
|
|
144
144
|
protected readonly jwt: JwtProvider;
|
|
145
145
|
protected readonly env: {
|
|
146
146
|
APP_SECRET: string;
|
|
@@ -199,9 +199,6 @@ declare class SecurityProvider {
|
|
|
199
199
|
checkPermission(permissionLike: string | Permission, ...roleEntries: string[]): SecurityCheckResult;
|
|
200
200
|
/**
|
|
201
201
|
* Creates a user account from the provided payload.
|
|
202
|
-
*
|
|
203
|
-
* @param headerOrToken
|
|
204
|
-
* @param permissionLike
|
|
205
202
|
*/
|
|
206
203
|
createUserFromToken(headerOrToken?: string, options?: {
|
|
207
204
|
permission?: Permission | string;
|
|
@@ -402,7 +399,7 @@ declare class RealmDescriptor extends Descriptor<RealmDescriptorOptions> {
|
|
|
402
399
|
protected readonly securityProvider: SecurityProvider;
|
|
403
400
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
404
401
|
protected readonly jwt: JwtProvider;
|
|
405
|
-
protected readonly log:
|
|
402
|
+
protected readonly log: _alepha_logger1.Logger;
|
|
406
403
|
get name(): string;
|
|
407
404
|
get accessTokenExpiration(): Duration;
|
|
408
405
|
get refreshTokenExpiration(): Duration;
|
package/server/cache.d.ts
CHANGED
|
@@ -9,8 +9,22 @@ import { RequestConfigSchema, ServerRequest, ServerRoute } from "alepha/server";
|
|
|
9
9
|
//#region src/providers/ServerCacheProvider.d.ts
|
|
10
10
|
declare module "alepha/server" {
|
|
11
11
|
interface ServerRoute {
|
|
12
|
+
/**
|
|
13
|
+
* Enable caching for this route.
|
|
14
|
+
* If set to true, a default cache configuration will be applied (5 minutes TTL).
|
|
15
|
+
* If a DurationLike is provided, it will be used as the TTL for the cache.
|
|
16
|
+
*
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
12
19
|
cache?: ServerRouteCache;
|
|
13
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Enable ETag support for this route.
|
|
22
|
+
* If set to true, the server will generate and manage ETags automatically.
|
|
23
|
+
* If a string is provided, it will be used as a static ETag value.
|
|
24
|
+
*
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
etag?: boolean | string;
|
|
14
28
|
}
|
|
15
29
|
interface ActionDescriptor<TConfig extends RequestConfigSchema> {
|
|
16
30
|
invalidate: () => Promise<void>;
|
|
@@ -26,13 +40,8 @@ declare class ServerCacheProvider {
|
|
|
26
40
|
protected readonly onActionRequest: _alepha_core1.HookDescriptor<"action:onRequest">;
|
|
27
41
|
protected readonly onActionResponse: _alepha_core1.HookDescriptor<"action:onResponse">;
|
|
28
42
|
protected readonly onRequest: _alepha_core1.HookDescriptor<"server:onRequest">;
|
|
43
|
+
protected readonly onSend: _alepha_core1.HookDescriptor<"server:onSend">;
|
|
29
44
|
protected readonly onResponse: _alepha_core1.HookDescriptor<"server:onResponse">;
|
|
30
|
-
protected getCacheOptions(cache: ServerRouteCache): {
|
|
31
|
-
provider?: (_alepha_core1.InstantiableClass<_alepha_cache0.CacheProvider> | "memory") | undefined;
|
|
32
|
-
name?: string | undefined;
|
|
33
|
-
ttl?: DurationLike | undefined;
|
|
34
|
-
disabled?: boolean | undefined;
|
|
35
|
-
};
|
|
36
45
|
protected createCacheKey(route: ServerRoute, config?: ServerRequest): string;
|
|
37
46
|
}
|
|
38
47
|
type ServerRouteCache = boolean | DurationLike | Omit<CacheDescriptorOptions<any>, "handler" | "key">;
|
package/server/links.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "alepha/server/security";
|
|
1
|
+
import { ServerRouteSecure } from "alepha/server/security";
|
|
2
2
|
import * as _alepha_core2 from "alepha";
|
|
3
3
|
import { Alepha, Descriptor, KIND, Static } from "alepha";
|
|
4
4
|
import * as _alepha_server0 from "alepha/server";
|
|
@@ -7,26 +7,26 @@ import * as _alepha_logger0 from "alepha/logger";
|
|
|
7
7
|
import * as _alepha_retry0 from "alepha/retry";
|
|
8
8
|
import { ProxyDescriptorOptions, ServerProxyProvider } from "alepha/server/proxy";
|
|
9
9
|
import { ServiceAccountDescriptor, UserAccountToken } from "alepha/security";
|
|
10
|
-
import * as
|
|
10
|
+
import * as typebox18 from "typebox";
|
|
11
11
|
|
|
12
12
|
//#region src/schemas/apiLinksResponseSchema.d.ts
|
|
13
|
-
declare const apiLinkSchema:
|
|
14
|
-
name:
|
|
15
|
-
group:
|
|
16
|
-
path:
|
|
17
|
-
method:
|
|
18
|
-
requestBodyType:
|
|
19
|
-
service:
|
|
13
|
+
declare const apiLinkSchema: typebox18.TObject<{
|
|
14
|
+
name: typebox18.TString;
|
|
15
|
+
group: typebox18.TOptional<typebox18.TString>;
|
|
16
|
+
path: typebox18.TString;
|
|
17
|
+
method: typebox18.TOptional<typebox18.TString>;
|
|
18
|
+
requestBodyType: typebox18.TOptional<typebox18.TString>;
|
|
19
|
+
service: typebox18.TOptional<typebox18.TString>;
|
|
20
20
|
}>;
|
|
21
|
-
declare const apiLinksResponseSchema:
|
|
22
|
-
prefix:
|
|
23
|
-
links:
|
|
24
|
-
name:
|
|
25
|
-
group:
|
|
26
|
-
path:
|
|
27
|
-
method:
|
|
28
|
-
requestBodyType:
|
|
29
|
-
service:
|
|
21
|
+
declare const apiLinksResponseSchema: typebox18.TObject<{
|
|
22
|
+
prefix: typebox18.TOptional<typebox18.TString>;
|
|
23
|
+
links: typebox18.TArray<typebox18.TObject<{
|
|
24
|
+
name: typebox18.TString;
|
|
25
|
+
group: typebox18.TOptional<typebox18.TString>;
|
|
26
|
+
path: typebox18.TString;
|
|
27
|
+
method: typebox18.TOptional<typebox18.TString>;
|
|
28
|
+
requestBodyType: typebox18.TOptional<typebox18.TString>;
|
|
29
|
+
service: typebox18.TOptional<typebox18.TString>;
|
|
30
30
|
}>>;
|
|
31
31
|
}>;
|
|
32
32
|
type ApiLinksResponse = Static<typeof apiLinksResponseSchema>;
|
|
@@ -81,7 +81,7 @@ declare class LinkProvider {
|
|
|
81
81
|
protected getLinkByName(name: string, options?: ClientScope): Promise<HttpClientLink>;
|
|
82
82
|
}
|
|
83
83
|
interface HttpClientLink extends ApiLink {
|
|
84
|
-
secured?: boolean;
|
|
84
|
+
secured?: boolean | ServerRouteSecure;
|
|
85
85
|
prefix?: string;
|
|
86
86
|
host?: string;
|
|
87
87
|
service?: string;
|
|
@@ -257,15 +257,15 @@ declare class ServerLinksProvider {
|
|
|
257
257
|
* This is based on the user's permissions.
|
|
258
258
|
*/
|
|
259
259
|
readonly links: _alepha_server0.RouteDescriptor<{
|
|
260
|
-
response:
|
|
261
|
-
prefix:
|
|
262
|
-
links:
|
|
263
|
-
name:
|
|
264
|
-
group:
|
|
265
|
-
path:
|
|
266
|
-
method:
|
|
267
|
-
requestBodyType:
|
|
268
|
-
service:
|
|
260
|
+
response: typebox18.TObject<{
|
|
261
|
+
prefix: typebox18.TOptional<typebox18.TString>;
|
|
262
|
+
links: typebox18.TArray<typebox18.TObject<{
|
|
263
|
+
name: typebox18.TString;
|
|
264
|
+
group: typebox18.TOptional<typebox18.TString>;
|
|
265
|
+
path: typebox18.TString;
|
|
266
|
+
method: typebox18.TOptional<typebox18.TString>;
|
|
267
|
+
requestBodyType: typebox18.TOptional<typebox18.TString>;
|
|
268
|
+
service: typebox18.TOptional<typebox18.TString>;
|
|
269
269
|
}>>;
|
|
270
270
|
}>;
|
|
271
271
|
}>;
|
|
@@ -276,10 +276,10 @@ declare class ServerLinksProvider {
|
|
|
276
276
|
* I mean for 150+ links, you got 50ms of serialization time.
|
|
277
277
|
*/
|
|
278
278
|
readonly schema: _alepha_server0.RouteDescriptor<{
|
|
279
|
-
params:
|
|
280
|
-
name:
|
|
279
|
+
params: typebox18.TObject<{
|
|
280
|
+
name: typebox18.TString;
|
|
281
281
|
}>;
|
|
282
|
-
response:
|
|
282
|
+
response: typebox18.TRecord<string, typebox18.TAny>;
|
|
283
283
|
}>;
|
|
284
284
|
getSchemaByName(name: string, options?: GetApiLinksOptions): Promise<RequestConfigSchema>;
|
|
285
285
|
/**
|
package/server/security.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ declare class ServerSecurityProvider {
|
|
|
13
13
|
protected readonly onConfigure: _alepha_core1.HookDescriptor<"configure">;
|
|
14
14
|
protected readonly onActionRequest: _alepha_core1.HookDescriptor<"action:onRequest">;
|
|
15
15
|
protected readonly onRequest: _alepha_core1.HookDescriptor<"server:onRequest">;
|
|
16
|
+
protected check(user: UserAccountToken, secure: ServerRouteSecure): void;
|
|
16
17
|
/**
|
|
17
18
|
* Get the user account token for a local action call.
|
|
18
19
|
* There are three possible sources for the user:
|
|
@@ -30,11 +31,8 @@ declare class ServerSecurityProvider {
|
|
|
30
31
|
protected createTestUser(): UserAccountToken;
|
|
31
32
|
protected readonly onClientRequest: _alepha_core1.HookDescriptor<"client:onRequest">;
|
|
32
33
|
}
|
|
33
|
-
type ServerRouteSecure =
|
|
34
|
-
|
|
35
|
-
roles?: string[];
|
|
36
|
-
realms?: string[];
|
|
37
|
-
organizations?: string[];
|
|
34
|
+
type ServerRouteSecure = {
|
|
35
|
+
realm?: string;
|
|
38
36
|
};
|
|
39
37
|
//#endregion
|
|
40
38
|
//#region src/index.d.ts
|
|
@@ -62,7 +60,7 @@ declare module "alepha/server" {
|
|
|
62
60
|
* If true, the route will be protected by the security provider.
|
|
63
61
|
* All actions are secure by default, but you can disable it for specific actions.
|
|
64
62
|
*/
|
|
65
|
-
secure?: boolean;
|
|
63
|
+
secure?: boolean | ServerRouteSecure;
|
|
66
64
|
}
|
|
67
65
|
interface ClientRequestOptions extends FetchOptions {
|
|
68
66
|
/**
|