alepha 0.13.3 → 0.13.4
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/README.md +7 -7
- package/dist/api-files/index.d.ts +175 -175
- package/dist/api-jobs/index.d.ts +156 -156
- package/dist/api-notifications/index.d.ts +147 -147
- package/dist/api-verifications/index.d.ts +12 -12
- package/dist/core/index.browser.js +5 -1
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +221 -219
- package/dist/core/index.js +5 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +5 -1
- package/dist/core/index.native.js.map +1 -1
- package/dist/email/index.d.ts +4 -4
- package/dist/orm/index.d.ts +19 -19
- package/dist/server-auth/index.d.ts +152 -152
- package/dist/server-security/index.d.ts +9 -9
- package/package.json +1 -1
- package/src/core/Alepha.ts +14 -0
- package/src/core/primitives/$module.ts +1 -1
package/dist/email/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as alepha1 from "alepha";
|
|
2
2
|
import { InstantiableClass, KIND, Primitive } from "alepha";
|
|
3
|
-
import * as
|
|
3
|
+
import * as alepha_logger1 from "alepha/logger";
|
|
4
4
|
import { Transporter } from "nodemailer";
|
|
5
5
|
|
|
6
6
|
//#region src/email/providers/EmailProvider.d.ts
|
|
@@ -73,7 +73,7 @@ interface LocalEmailProviderOptions {
|
|
|
73
73
|
directory?: string;
|
|
74
74
|
}
|
|
75
75
|
declare class LocalEmailProvider implements EmailProvider {
|
|
76
|
-
protected readonly log:
|
|
76
|
+
protected readonly log: alepha_logger1.Logger;
|
|
77
77
|
protected readonly directory: string;
|
|
78
78
|
constructor(options?: LocalEmailProviderOptions);
|
|
79
79
|
send(options: EmailSendOptions): Promise<void>;
|
|
@@ -93,7 +93,7 @@ interface EmailRecord {
|
|
|
93
93
|
sentAt: Date;
|
|
94
94
|
}
|
|
95
95
|
declare class MemoryEmailProvider implements EmailProvider {
|
|
96
|
-
protected readonly log:
|
|
96
|
+
protected readonly log: alepha_logger1.Logger;
|
|
97
97
|
records: EmailRecord[];
|
|
98
98
|
send(options: EmailSendOptions): Promise<void>;
|
|
99
99
|
/**
|
|
@@ -134,7 +134,7 @@ declare class NodemailerEmailProvider implements EmailProvider {
|
|
|
134
134
|
EMAIL_FROM: string;
|
|
135
135
|
EMAIL_SECURE: boolean;
|
|
136
136
|
};
|
|
137
|
-
protected readonly log:
|
|
137
|
+
protected readonly log: alepha_logger1.Logger;
|
|
138
138
|
protected transporter: Transporter;
|
|
139
139
|
protected fromAddress: string;
|
|
140
140
|
readonly options: NodemailerEmailProviderOptions;
|
package/dist/orm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as alepha6 from "alepha";
|
|
2
2
|
import { Alepha, AlephaError, KIND, Page, Page as Page$1, PageQuery, PageQuery as PageQuery$1, Primitive, Service, Static, StaticEncode, TBigInt, TInteger, TNull, TNumber, TNumberOptions, TObject, TObjectOptions, TOptional, TPage, TSchema, TString, TStringOptions, TUnion, TUnsafe, pageQuerySchema, pageSchema } from "alepha";
|
|
3
3
|
import { DateTime, DateTimeProvider } from "alepha/datetime";
|
|
4
4
|
import * as drizzle_orm0 from "drizzle-orm";
|
|
@@ -1061,11 +1061,11 @@ declare class DrizzleKitProvider {
|
|
|
1061
1061
|
*/
|
|
1062
1062
|
importDrizzleKit(): typeof DrizzleKit;
|
|
1063
1063
|
}
|
|
1064
|
-
declare const devMigrationsSchema:
|
|
1065
|
-
id:
|
|
1066
|
-
name:
|
|
1067
|
-
snapshot:
|
|
1068
|
-
created_at:
|
|
1064
|
+
declare const devMigrationsSchema: alepha6.TObject<{
|
|
1065
|
+
id: alepha6.TNumber;
|
|
1066
|
+
name: alepha6.TString;
|
|
1067
|
+
snapshot: alepha6.TString;
|
|
1068
|
+
created_at: alepha6.TString;
|
|
1069
1069
|
}>;
|
|
1070
1070
|
type DevMigrations = Static<typeof devMigrationsSchema>;
|
|
1071
1071
|
//#endregion
|
|
@@ -1262,7 +1262,7 @@ declare class QueryManager {
|
|
|
1262
1262
|
createPagination<T>(entities: T[], limit?: number, offset?: number, sort?: Array<{
|
|
1263
1263
|
column: string;
|
|
1264
1264
|
direction: "asc" | "desc";
|
|
1265
|
-
}>):
|
|
1265
|
+
}>): alepha6.Page<T>;
|
|
1266
1266
|
}
|
|
1267
1267
|
interface PgJoin {
|
|
1268
1268
|
table: string;
|
|
@@ -1732,7 +1732,7 @@ declare class PostgresModelBuilder extends ModelBuilder {
|
|
|
1732
1732
|
declare module "alepha" {
|
|
1733
1733
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
1734
1734
|
}
|
|
1735
|
-
declare const envSchema:
|
|
1735
|
+
declare const envSchema: alepha6.TObject<{
|
|
1736
1736
|
/**
|
|
1737
1737
|
* Main configuration for database connection.
|
|
1738
1738
|
* Accept a string in the format of a Postgres connection URL.
|
|
@@ -1740,13 +1740,13 @@ declare const envSchema: alepha1.TObject<{
|
|
|
1740
1740
|
* or
|
|
1741
1741
|
* Example: postgres://user:password@localhost:5432/database?sslmode=require
|
|
1742
1742
|
*/
|
|
1743
|
-
DATABASE_URL:
|
|
1743
|
+
DATABASE_URL: alepha6.TOptional<alepha6.TString>;
|
|
1744
1744
|
/**
|
|
1745
1745
|
* In addition to the DATABASE_URL, you can specify the postgres schema name.
|
|
1746
1746
|
*
|
|
1747
1747
|
* It will monkey patch drizzle tables.
|
|
1748
1748
|
*/
|
|
1749
|
-
POSTGRES_SCHEMA:
|
|
1749
|
+
POSTGRES_SCHEMA: alepha6.TOptional<alepha6.TString>;
|
|
1750
1750
|
}>;
|
|
1751
1751
|
declare class NodePostgresProvider extends DatabaseProvider {
|
|
1752
1752
|
static readonly SSL_MODES: readonly ["require", "allow", "prefer", "verify-full"];
|
|
@@ -1779,8 +1779,8 @@ declare class NodePostgresProvider extends DatabaseProvider {
|
|
|
1779
1779
|
*/
|
|
1780
1780
|
get db(): PostgresJsDatabase;
|
|
1781
1781
|
protected executeMigrations(migrationsFolder: string): Promise<void>;
|
|
1782
|
-
protected readonly onStart:
|
|
1783
|
-
protected readonly onStop:
|
|
1782
|
+
protected readonly onStart: alepha6.HookPrimitive<"start">;
|
|
1783
|
+
protected readonly onStop: alepha6.HookPrimitive<"stop">;
|
|
1784
1784
|
connect(): Promise<void>;
|
|
1785
1785
|
close(): Promise<void>;
|
|
1786
1786
|
protected migrate: alepha_lock0.LockPrimitive<() => Promise<void>>;
|
|
@@ -1955,8 +1955,8 @@ type SchemaToSqliteBuilder<T extends TObject> = { [key in keyof T["properties"]]
|
|
|
1955
1955
|
/**
|
|
1956
1956
|
* Configuration options for the Node.js SQLite database provider.
|
|
1957
1957
|
*/
|
|
1958
|
-
declare const nodeSqliteOptions:
|
|
1959
|
-
path:
|
|
1958
|
+
declare const nodeSqliteOptions: alepha6.Atom<alepha6.TObject<{
|
|
1959
|
+
path: alepha6.TOptional<alepha6.TString>;
|
|
1960
1960
|
}>, "alepha.postgres.node-sqlite.options">;
|
|
1961
1961
|
type NodeSqliteProviderOptions = Static<typeof nodeSqliteOptions.schema>;
|
|
1962
1962
|
declare module "alepha" {
|
|
@@ -1986,7 +1986,7 @@ declare class NodeSqliteProvider extends DatabaseProvider {
|
|
|
1986
1986
|
get url(): string;
|
|
1987
1987
|
execute(query: SQLLike): Promise<Array<Record<string, unknown>>>;
|
|
1988
1988
|
readonly db: PgDatabase<any>;
|
|
1989
|
-
protected readonly onStart:
|
|
1989
|
+
protected readonly onStart: alepha6.HookPrimitive<"start">;
|
|
1990
1990
|
protected executeMigrations(migrationsFolder: string): Promise<void>;
|
|
1991
1991
|
}
|
|
1992
1992
|
//#endregion
|
|
@@ -2045,7 +2045,7 @@ declare class PostgresTypeProvider {
|
|
|
2045
2045
|
* This is used to mark rows as deleted without actually removing them from the database.
|
|
2046
2046
|
* The column is nullable - NULL means not deleted, timestamp means deleted.
|
|
2047
2047
|
*/
|
|
2048
|
-
readonly deletedAt: (options?: TStringOptions) => PgAttr<
|
|
2048
|
+
readonly deletedAt: (options?: TStringOptions) => PgAttr<alepha6.TOptional<TString>, typeof PG_DELETED_AT>;
|
|
2049
2049
|
/**
|
|
2050
2050
|
* Creates a Postgres ENUM type.
|
|
2051
2051
|
*
|
|
@@ -2077,7 +2077,7 @@ declare const pg: PostgresTypeProvider;
|
|
|
2077
2077
|
declare class RepositoryProvider {
|
|
2078
2078
|
protected readonly alepha: Alepha;
|
|
2079
2079
|
protected readonly registry: Map<EntityPrimitive<any>, Service<Repository<any>>>;
|
|
2080
|
-
getRepositories(provider?: DatabaseProvider): Repository<TObject<
|
|
2080
|
+
getRepositories(provider?: DatabaseProvider): Repository<TObject<alepha6.TProperties>>[];
|
|
2081
2081
|
getRepository<T extends TObject>(entity: EntityPrimitive<T>): Repository<T>;
|
|
2082
2082
|
createClassRepository<T extends TObject>(entity: EntityPrimitive<T>): Service<Repository<T>>;
|
|
2083
2083
|
}
|
|
@@ -2086,7 +2086,7 @@ declare class RepositoryProvider {
|
|
|
2086
2086
|
/**
|
|
2087
2087
|
* @deprecated Use `pg.primaryKey()` instead.
|
|
2088
2088
|
*/
|
|
2089
|
-
declare const legacyIdSchema: PgAttr<PgAttr<PgAttr<
|
|
2089
|
+
declare const legacyIdSchema: PgAttr<PgAttr<PgAttr<alepha6.TInteger, typeof PG_PRIMARY_KEY>, typeof PG_SERIAL>, typeof PG_DEFAULT>;
|
|
2090
2090
|
//#endregion
|
|
2091
2091
|
//#region src/orm/types/schema.d.ts
|
|
2092
2092
|
/**
|
|
@@ -2207,7 +2207,7 @@ declare module "alepha" {
|
|
|
2207
2207
|
* @see {@link $transaction}
|
|
2208
2208
|
* @module alepha.postgres
|
|
2209
2209
|
*/
|
|
2210
|
-
declare const AlephaPostgres:
|
|
2210
|
+
declare const AlephaPostgres: alepha6.Service<alepha6.Module>;
|
|
2211
2211
|
//#endregion
|
|
2212
2212
|
export { $entity, $repository, $sequence, $transaction, AlephaPostgres, DatabaseProvider, DbConflictError, DbEntityNotFoundError, DbError, DbMigrationError, DbVersionMismatchError, DrizzleKitProvider, EntityColumn, EntityColumns, EntityPrimitive, EntityPrimitiveOptions, FilterOperators, FromSchema, NodePostgresProvider, NodeSqliteProvider, NodeSqliteProviderOptions, OrderBy, OrderByClause, OrderDirection, PG_CREATED_AT, PG_DEFAULT, PG_DELETED_AT, PG_ENUM, PG_IDENTITY, PG_PRIMARY_KEY, PG_REF, PG_SERIAL, PG_UPDATED_AT, PG_VERSION, type Page, type PageQuery, PgAttr, PgAttrField, PgDefault, PgEnumOptions, PgIdentityOptions, PgPrimaryKey, PgQuery, PgQueryRelations, PgQueryWhere, PgQueryWhereOrSQL, PgRef, PgRefOptions, PgRelation, PgRelationMap, PgStatic, PgSymbolKeys, PgSymbols, PostgresTypeProvider, Repository, RepositoryProvider, SQLLike, SchemaToTableConfig, SequencePrimitive, SequencePrimitiveOptions, StatementOptions, TObjectInsert, TObjectUpdate, TransactionContext, TransactionPrimitiveOptions, buildQueryString, drizzle_orm0 as drizzle, getAttrFields, insertSchema, legacyIdSchema, nodeSqliteOptions, pageQuerySchema, pageSchema, parseQueryString, pg, pgAttr, schema, sql, updateSchema };
|
|
2213
2213
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as alepha182 from "alepha";
|
|
2
2
|
import { Alepha, Async, KIND, Primitive, Static } from "alepha";
|
|
3
3
|
import * as alepha_server_cookies0 from "alepha/server/cookies";
|
|
4
4
|
import { Cookies, ServerCookiesProvider } from "alepha/server/cookies";
|
|
@@ -20,82 +20,82 @@ declare const alephaServerAuthRoutes: {
|
|
|
20
20
|
};
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/server-auth/schemas/authenticationProviderSchema.d.ts
|
|
23
|
-
declare const authenticationProviderSchema:
|
|
24
|
-
name:
|
|
25
|
-
type:
|
|
23
|
+
declare const authenticationProviderSchema: alepha182.TObject<{
|
|
24
|
+
name: alepha182.TString;
|
|
25
|
+
type: alepha182.TUnsafe<"OAUTH2" | "OIDC" | "CREDENTIALS">;
|
|
26
26
|
}>;
|
|
27
27
|
type AuthenticationProvider = Static<typeof authenticationProviderSchema>;
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region src/server-auth/schemas/tokenResponseSchema.d.ts
|
|
30
|
-
declare const tokenResponseSchema:
|
|
31
|
-
provider:
|
|
32
|
-
access_token:
|
|
33
|
-
issued_at:
|
|
34
|
-
expires_in:
|
|
35
|
-
refresh_token:
|
|
36
|
-
refresh_token_expires_in:
|
|
37
|
-
refresh_expires_in:
|
|
38
|
-
id_token:
|
|
39
|
-
scope:
|
|
40
|
-
user:
|
|
41
|
-
id:
|
|
42
|
-
name:
|
|
43
|
-
email:
|
|
44
|
-
username:
|
|
45
|
-
picture:
|
|
46
|
-
sessionId:
|
|
47
|
-
organizations:
|
|
48
|
-
roles:
|
|
30
|
+
declare const tokenResponseSchema: alepha182.TObject<{
|
|
31
|
+
provider: alepha182.TString;
|
|
32
|
+
access_token: alepha182.TString;
|
|
33
|
+
issued_at: alepha182.TNumber;
|
|
34
|
+
expires_in: alepha182.TOptional<alepha182.TNumber>;
|
|
35
|
+
refresh_token: alepha182.TOptional<alepha182.TString>;
|
|
36
|
+
refresh_token_expires_in: alepha182.TOptional<alepha182.TNumber>;
|
|
37
|
+
refresh_expires_in: alepha182.TOptional<alepha182.TNumber>;
|
|
38
|
+
id_token: alepha182.TOptional<alepha182.TString>;
|
|
39
|
+
scope: alepha182.TOptional<alepha182.TString>;
|
|
40
|
+
user: alepha182.TObject<{
|
|
41
|
+
id: alepha182.TString;
|
|
42
|
+
name: alepha182.TOptional<alepha182.TString>;
|
|
43
|
+
email: alepha182.TOptional<alepha182.TString>;
|
|
44
|
+
username: alepha182.TOptional<alepha182.TString>;
|
|
45
|
+
picture: alepha182.TOptional<alepha182.TString>;
|
|
46
|
+
sessionId: alepha182.TOptional<alepha182.TString>;
|
|
47
|
+
organizations: alepha182.TOptional<alepha182.TArray<alepha182.TString>>;
|
|
48
|
+
roles: alepha182.TOptional<alepha182.TArray<alepha182.TString>>;
|
|
49
49
|
}>;
|
|
50
|
-
api:
|
|
51
|
-
prefix:
|
|
52
|
-
links:
|
|
53
|
-
name:
|
|
54
|
-
group:
|
|
55
|
-
path:
|
|
56
|
-
method:
|
|
57
|
-
requestBodyType:
|
|
58
|
-
service:
|
|
50
|
+
api: alepha182.TObject<{
|
|
51
|
+
prefix: alepha182.TOptional<alepha182.TString>;
|
|
52
|
+
links: alepha182.TArray<alepha182.TObject<{
|
|
53
|
+
name: alepha182.TString;
|
|
54
|
+
group: alepha182.TOptional<alepha182.TString>;
|
|
55
|
+
path: alepha182.TString;
|
|
56
|
+
method: alepha182.TOptional<alepha182.TString>;
|
|
57
|
+
requestBodyType: alepha182.TOptional<alepha182.TString>;
|
|
58
|
+
service: alepha182.TOptional<alepha182.TString>;
|
|
59
59
|
}>>;
|
|
60
60
|
}>;
|
|
61
61
|
}>;
|
|
62
62
|
type TokenResponse = Static<typeof tokenResponseSchema>;
|
|
63
63
|
//#endregion
|
|
64
64
|
//#region src/server-auth/schemas/tokensSchema.d.ts
|
|
65
|
-
declare const tokensSchema:
|
|
66
|
-
provider:
|
|
67
|
-
access_token:
|
|
68
|
-
issued_at:
|
|
69
|
-
expires_in:
|
|
70
|
-
refresh_token:
|
|
71
|
-
refresh_token_expires_in:
|
|
72
|
-
refresh_expires_in:
|
|
73
|
-
id_token:
|
|
74
|
-
scope:
|
|
65
|
+
declare const tokensSchema: alepha182.TObject<{
|
|
66
|
+
provider: alepha182.TString;
|
|
67
|
+
access_token: alepha182.TString;
|
|
68
|
+
issued_at: alepha182.TNumber;
|
|
69
|
+
expires_in: alepha182.TOptional<alepha182.TNumber>;
|
|
70
|
+
refresh_token: alepha182.TOptional<alepha182.TString>;
|
|
71
|
+
refresh_token_expires_in: alepha182.TOptional<alepha182.TNumber>;
|
|
72
|
+
refresh_expires_in: alepha182.TOptional<alepha182.TNumber>;
|
|
73
|
+
id_token: alepha182.TOptional<alepha182.TString>;
|
|
74
|
+
scope: alepha182.TOptional<alepha182.TString>;
|
|
75
75
|
}>;
|
|
76
76
|
type Tokens = Static<typeof tokensSchema>;
|
|
77
77
|
//#endregion
|
|
78
78
|
//#region src/server-auth/schemas/userinfoResponseSchema.d.ts
|
|
79
|
-
declare const userinfoResponseSchema:
|
|
80
|
-
user:
|
|
81
|
-
id:
|
|
82
|
-
name:
|
|
83
|
-
email:
|
|
84
|
-
username:
|
|
85
|
-
picture:
|
|
86
|
-
sessionId:
|
|
87
|
-
organizations:
|
|
88
|
-
roles:
|
|
79
|
+
declare const userinfoResponseSchema: alepha182.TObject<{
|
|
80
|
+
user: alepha182.TOptional<alepha182.TObject<{
|
|
81
|
+
id: alepha182.TString;
|
|
82
|
+
name: alepha182.TOptional<alepha182.TString>;
|
|
83
|
+
email: alepha182.TOptional<alepha182.TString>;
|
|
84
|
+
username: alepha182.TOptional<alepha182.TString>;
|
|
85
|
+
picture: alepha182.TOptional<alepha182.TString>;
|
|
86
|
+
sessionId: alepha182.TOptional<alepha182.TString>;
|
|
87
|
+
organizations: alepha182.TOptional<alepha182.TArray<alepha182.TString>>;
|
|
88
|
+
roles: alepha182.TOptional<alepha182.TArray<alepha182.TString>>;
|
|
89
89
|
}>>;
|
|
90
|
-
api:
|
|
91
|
-
prefix:
|
|
92
|
-
links:
|
|
93
|
-
name:
|
|
94
|
-
group:
|
|
95
|
-
path:
|
|
96
|
-
method:
|
|
97
|
-
requestBodyType:
|
|
98
|
-
service:
|
|
90
|
+
api: alepha182.TObject<{
|
|
91
|
+
prefix: alepha182.TOptional<alepha182.TString>;
|
|
92
|
+
links: alepha182.TArray<alepha182.TObject<{
|
|
93
|
+
name: alepha182.TString;
|
|
94
|
+
group: alepha182.TOptional<alepha182.TString>;
|
|
95
|
+
path: alepha182.TString;
|
|
96
|
+
method: alepha182.TOptional<alepha182.TString>;
|
|
97
|
+
requestBodyType: alepha182.TOptional<alepha182.TString>;
|
|
98
|
+
service: alepha182.TOptional<alepha182.TString>;
|
|
99
99
|
}>>;
|
|
100
100
|
}>;
|
|
101
101
|
}>;
|
|
@@ -108,34 +108,34 @@ declare class ServerAuthProvider {
|
|
|
108
108
|
protected readonly serverCookiesProvider: ServerCookiesProvider;
|
|
109
109
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
110
110
|
protected readonly serverLinksProvider: ServerLinksProvider;
|
|
111
|
-
protected readonly authorizationCode: alepha_server_cookies0.AbstractCookiePrimitive<
|
|
112
|
-
provider:
|
|
113
|
-
codeVerifier:
|
|
114
|
-
redirectUri:
|
|
115
|
-
state:
|
|
116
|
-
nonce:
|
|
111
|
+
protected readonly authorizationCode: alepha_server_cookies0.AbstractCookiePrimitive<alepha182.TObject<{
|
|
112
|
+
provider: alepha182.TString;
|
|
113
|
+
codeVerifier: alepha182.TOptional<alepha182.TString>;
|
|
114
|
+
redirectUri: alepha182.TOptional<alepha182.TString>;
|
|
115
|
+
state: alepha182.TOptional<alepha182.TString>;
|
|
116
|
+
nonce: alepha182.TOptional<alepha182.TString>;
|
|
117
117
|
}>>;
|
|
118
|
-
readonly tokens: alepha_server_cookies0.AbstractCookiePrimitive<
|
|
119
|
-
provider:
|
|
120
|
-
access_token:
|
|
121
|
-
issued_at:
|
|
122
|
-
expires_in:
|
|
123
|
-
refresh_token:
|
|
124
|
-
refresh_token_expires_in:
|
|
125
|
-
refresh_expires_in:
|
|
126
|
-
id_token:
|
|
127
|
-
scope:
|
|
118
|
+
readonly tokens: alepha_server_cookies0.AbstractCookiePrimitive<alepha182.TObject<{
|
|
119
|
+
provider: alepha182.TString;
|
|
120
|
+
access_token: alepha182.TString;
|
|
121
|
+
issued_at: alepha182.TNumber;
|
|
122
|
+
expires_in: alepha182.TOptional<alepha182.TNumber>;
|
|
123
|
+
refresh_token: alepha182.TOptional<alepha182.TString>;
|
|
124
|
+
refresh_token_expires_in: alepha182.TOptional<alepha182.TNumber>;
|
|
125
|
+
refresh_expires_in: alepha182.TOptional<alepha182.TNumber>;
|
|
126
|
+
id_token: alepha182.TOptional<alepha182.TString>;
|
|
127
|
+
scope: alepha182.TOptional<alepha182.TString>;
|
|
128
128
|
}>>;
|
|
129
129
|
get identities(): Array<AuthPrimitive>;
|
|
130
130
|
getAuthenticationProviders(filters?: {
|
|
131
131
|
realmName?: string;
|
|
132
132
|
}): AuthenticationProvider[];
|
|
133
|
-
protected readonly configure:
|
|
133
|
+
protected readonly configure: alepha182.HookPrimitive<"configure">;
|
|
134
134
|
protected getAccessTokens(tokens: Tokens): string | undefined;
|
|
135
135
|
/**
|
|
136
136
|
* Fill request headers with access token from cookies or fallback to provider's fallback function.
|
|
137
137
|
*/
|
|
138
|
-
protected readonly onRequest:
|
|
138
|
+
protected readonly onRequest: alepha182.HookPrimitive<"server:onRequest">;
|
|
139
139
|
/**
|
|
140
140
|
* Convert cookies to tokens.
|
|
141
141
|
* If the tokens are expired, try to refresh them using the refresh token.
|
|
@@ -146,26 +146,26 @@ declare class ServerAuthProvider {
|
|
|
146
146
|
* Get user information.
|
|
147
147
|
*/
|
|
148
148
|
readonly userinfo: alepha_server0.RoutePrimitive<{
|
|
149
|
-
response:
|
|
150
|
-
user:
|
|
151
|
-
id:
|
|
152
|
-
name:
|
|
153
|
-
email:
|
|
154
|
-
username:
|
|
155
|
-
picture:
|
|
156
|
-
sessionId:
|
|
157
|
-
organizations:
|
|
158
|
-
roles:
|
|
149
|
+
response: alepha182.TObject<{
|
|
150
|
+
user: alepha182.TOptional<alepha182.TObject<{
|
|
151
|
+
id: alepha182.TString;
|
|
152
|
+
name: alepha182.TOptional<alepha182.TString>;
|
|
153
|
+
email: alepha182.TOptional<alepha182.TString>;
|
|
154
|
+
username: alepha182.TOptional<alepha182.TString>;
|
|
155
|
+
picture: alepha182.TOptional<alepha182.TString>;
|
|
156
|
+
sessionId: alepha182.TOptional<alepha182.TString>;
|
|
157
|
+
organizations: alepha182.TOptional<alepha182.TArray<alepha182.TString>>;
|
|
158
|
+
roles: alepha182.TOptional<alepha182.TArray<alepha182.TString>>;
|
|
159
159
|
}>>;
|
|
160
|
-
api:
|
|
161
|
-
prefix:
|
|
162
|
-
links:
|
|
163
|
-
name:
|
|
164
|
-
group:
|
|
165
|
-
path:
|
|
166
|
-
method:
|
|
167
|
-
requestBodyType:
|
|
168
|
-
service:
|
|
160
|
+
api: alepha182.TObject<{
|
|
161
|
+
prefix: alepha182.TOptional<alepha182.TString>;
|
|
162
|
+
links: alepha182.TArray<alepha182.TObject<{
|
|
163
|
+
name: alepha182.TString;
|
|
164
|
+
group: alepha182.TOptional<alepha182.TString>;
|
|
165
|
+
path: alepha182.TString;
|
|
166
|
+
method: alepha182.TOptional<alepha182.TString>;
|
|
167
|
+
requestBodyType: alepha182.TOptional<alepha182.TString>;
|
|
168
|
+
service: alepha182.TOptional<alepha182.TString>;
|
|
169
169
|
}>>;
|
|
170
170
|
}>;
|
|
171
171
|
}>;
|
|
@@ -174,65 +174,65 @@ declare class ServerAuthProvider {
|
|
|
174
174
|
* Refresh a token for internal providers.
|
|
175
175
|
*/
|
|
176
176
|
readonly refresh: alepha_server0.RoutePrimitive<{
|
|
177
|
-
query:
|
|
178
|
-
provider:
|
|
177
|
+
query: alepha182.TObject<{
|
|
178
|
+
provider: alepha182.TString;
|
|
179
179
|
}>;
|
|
180
|
-
body:
|
|
181
|
-
refresh_token:
|
|
182
|
-
access_token:
|
|
180
|
+
body: alepha182.TObject<{
|
|
181
|
+
refresh_token: alepha182.TString;
|
|
182
|
+
access_token: alepha182.TOptional<alepha182.TString>;
|
|
183
183
|
}>;
|
|
184
|
-
response:
|
|
185
|
-
provider:
|
|
186
|
-
access_token:
|
|
187
|
-
issued_at:
|
|
188
|
-
expires_in:
|
|
189
|
-
refresh_token:
|
|
190
|
-
refresh_token_expires_in:
|
|
191
|
-
refresh_expires_in:
|
|
192
|
-
id_token:
|
|
193
|
-
scope:
|
|
184
|
+
response: alepha182.TObject<{
|
|
185
|
+
provider: alepha182.TString;
|
|
186
|
+
access_token: alepha182.TString;
|
|
187
|
+
issued_at: alepha182.TNumber;
|
|
188
|
+
expires_in: alepha182.TOptional<alepha182.TNumber>;
|
|
189
|
+
refresh_token: alepha182.TOptional<alepha182.TString>;
|
|
190
|
+
refresh_token_expires_in: alepha182.TOptional<alepha182.TNumber>;
|
|
191
|
+
refresh_expires_in: alepha182.TOptional<alepha182.TNumber>;
|
|
192
|
+
id_token: alepha182.TOptional<alepha182.TString>;
|
|
193
|
+
scope: alepha182.TOptional<alepha182.TString>;
|
|
194
194
|
}>;
|
|
195
195
|
}>;
|
|
196
196
|
/**
|
|
197
197
|
* Login for local password-based authentication.
|
|
198
198
|
*/
|
|
199
199
|
readonly token: alepha_server0.RoutePrimitive<{
|
|
200
|
-
query:
|
|
201
|
-
provider:
|
|
200
|
+
query: alepha182.TObject<{
|
|
201
|
+
provider: alepha182.TString;
|
|
202
202
|
}>;
|
|
203
|
-
body:
|
|
204
|
-
username:
|
|
205
|
-
password:
|
|
203
|
+
body: alepha182.TObject<{
|
|
204
|
+
username: alepha182.TString;
|
|
205
|
+
password: alepha182.TString;
|
|
206
206
|
}>;
|
|
207
|
-
response:
|
|
208
|
-
provider:
|
|
209
|
-
access_token:
|
|
210
|
-
issued_at:
|
|
211
|
-
expires_in:
|
|
212
|
-
refresh_token:
|
|
213
|
-
refresh_token_expires_in:
|
|
214
|
-
refresh_expires_in:
|
|
215
|
-
id_token:
|
|
216
|
-
scope:
|
|
217
|
-
user:
|
|
218
|
-
id:
|
|
219
|
-
name:
|
|
220
|
-
email:
|
|
221
|
-
username:
|
|
222
|
-
picture:
|
|
223
|
-
sessionId:
|
|
224
|
-
organizations:
|
|
225
|
-
roles:
|
|
207
|
+
response: alepha182.TObject<{
|
|
208
|
+
provider: alepha182.TString;
|
|
209
|
+
access_token: alepha182.TString;
|
|
210
|
+
issued_at: alepha182.TNumber;
|
|
211
|
+
expires_in: alepha182.TOptional<alepha182.TNumber>;
|
|
212
|
+
refresh_token: alepha182.TOptional<alepha182.TString>;
|
|
213
|
+
refresh_token_expires_in: alepha182.TOptional<alepha182.TNumber>;
|
|
214
|
+
refresh_expires_in: alepha182.TOptional<alepha182.TNumber>;
|
|
215
|
+
id_token: alepha182.TOptional<alepha182.TString>;
|
|
216
|
+
scope: alepha182.TOptional<alepha182.TString>;
|
|
217
|
+
user: alepha182.TObject<{
|
|
218
|
+
id: alepha182.TString;
|
|
219
|
+
name: alepha182.TOptional<alepha182.TString>;
|
|
220
|
+
email: alepha182.TOptional<alepha182.TString>;
|
|
221
|
+
username: alepha182.TOptional<alepha182.TString>;
|
|
222
|
+
picture: alepha182.TOptional<alepha182.TString>;
|
|
223
|
+
sessionId: alepha182.TOptional<alepha182.TString>;
|
|
224
|
+
organizations: alepha182.TOptional<alepha182.TArray<alepha182.TString>>;
|
|
225
|
+
roles: alepha182.TOptional<alepha182.TArray<alepha182.TString>>;
|
|
226
226
|
}>;
|
|
227
|
-
api:
|
|
228
|
-
prefix:
|
|
229
|
-
links:
|
|
230
|
-
name:
|
|
231
|
-
group:
|
|
232
|
-
path:
|
|
233
|
-
method:
|
|
234
|
-
requestBodyType:
|
|
235
|
-
service:
|
|
227
|
+
api: alepha182.TObject<{
|
|
228
|
+
prefix: alepha182.TOptional<alepha182.TString>;
|
|
229
|
+
links: alepha182.TArray<alepha182.TObject<{
|
|
230
|
+
name: alepha182.TString;
|
|
231
|
+
group: alepha182.TOptional<alepha182.TString>;
|
|
232
|
+
path: alepha182.TString;
|
|
233
|
+
method: alepha182.TOptional<alepha182.TString>;
|
|
234
|
+
requestBodyType: alepha182.TOptional<alepha182.TString>;
|
|
235
|
+
service: alepha182.TOptional<alepha182.TString>;
|
|
236
236
|
}>>;
|
|
237
237
|
}>;
|
|
238
238
|
}>;
|
|
@@ -241,9 +241,9 @@ declare class ServerAuthProvider {
|
|
|
241
241
|
* Oauth2/OIDC login route.
|
|
242
242
|
*/
|
|
243
243
|
readonly login: alepha_server0.RoutePrimitive<{
|
|
244
|
-
query:
|
|
245
|
-
provider:
|
|
246
|
-
redirect_uri:
|
|
244
|
+
query: alepha182.TObject<{
|
|
245
|
+
provider: alepha182.TString;
|
|
246
|
+
redirect_uri: alepha182.TOptional<alepha182.TString>;
|
|
247
247
|
}>;
|
|
248
248
|
}>;
|
|
249
249
|
/**
|
|
@@ -255,8 +255,8 @@ declare class ServerAuthProvider {
|
|
|
255
255
|
* Logout route for OAuth2/OIDC providers.
|
|
256
256
|
*/
|
|
257
257
|
readonly logout: alepha_server0.RoutePrimitive<{
|
|
258
|
-
query:
|
|
259
|
-
post_logout_redirect_uri:
|
|
258
|
+
query: alepha182.TObject<{
|
|
259
|
+
post_logout_redirect_uri: alepha182.TOptional<alepha182.TString>;
|
|
260
260
|
}>;
|
|
261
261
|
}>;
|
|
262
262
|
protected provider(opts: string | {
|
|
@@ -577,7 +577,7 @@ declare module "alepha" {
|
|
|
577
577
|
* @see {@link ServerAuthProvider}
|
|
578
578
|
* @module alepha.server.auth
|
|
579
579
|
*/
|
|
580
|
-
declare const AlephaServerAuth:
|
|
580
|
+
declare const AlephaServerAuth: alepha182.Service<alepha182.Module>;
|
|
581
581
|
//#endregion
|
|
582
582
|
export { $auth, $authCredentials, $authGithub, $authGoogle, AccessToken, AlephaServerAuth, AuthExternal, AuthInternal, AuthPrimitive, AuthPrimitiveOptions, AuthenticationProvider, Credentials, CredentialsFn, CredentialsOptions, LinkAccountFn, LinkAccountOptions, OAuth2Options, OAuth2Profile, OidcOptions, ServerAuthProvider, TokenResponse, Tokens, UserinfoResponse, WithLinkFn, WithLoginFn, alephaServerAuthRoutes, authenticationProviderSchema, tokenResponseSchema, tokensSchema, userinfoResponseSchema };
|
|
583
583
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as alepha1 from "alepha";
|
|
2
2
|
import { Alepha, KIND, Primitive } from "alepha";
|
|
3
3
|
import { JwtProvider, Permission, SecurityProvider, UserAccount, UserAccountToken } from "alepha/security";
|
|
4
4
|
import { FetchOptions, ServerRequest, ServerRouterProvider } from "alepha/server";
|
|
@@ -28,15 +28,15 @@ declare class ServerBasicAuthProvider {
|
|
|
28
28
|
* Register a basic auth configuration (called by primitives)
|
|
29
29
|
*/
|
|
30
30
|
registerAuth(config: BasicAuthPrimitiveConfig): void;
|
|
31
|
-
readonly onStart:
|
|
31
|
+
readonly onStart: alepha1.HookPrimitive<"start">;
|
|
32
32
|
/**
|
|
33
33
|
* Hook into server:onRequest to check basic auth
|
|
34
34
|
*/
|
|
35
|
-
readonly onRequest:
|
|
35
|
+
readonly onRequest: alepha1.HookPrimitive<"server:onRequest">;
|
|
36
36
|
/**
|
|
37
37
|
* Hook into action:onRequest to check basic auth for actions
|
|
38
38
|
*/
|
|
39
|
-
readonly onActionRequest:
|
|
39
|
+
readonly onActionRequest: alepha1.HookPrimitive<"action:onRequest">;
|
|
40
40
|
/**
|
|
41
41
|
* Check basic authentication
|
|
42
42
|
*/
|
|
@@ -66,9 +66,9 @@ declare class ServerSecurityProvider {
|
|
|
66
66
|
protected readonly securityProvider: SecurityProvider;
|
|
67
67
|
protected readonly jwtProvider: JwtProvider;
|
|
68
68
|
protected readonly alepha: Alepha;
|
|
69
|
-
protected readonly onConfigure:
|
|
70
|
-
protected readonly onActionRequest:
|
|
71
|
-
protected readonly onRequest:
|
|
69
|
+
protected readonly onConfigure: alepha1.HookPrimitive<"configure">;
|
|
70
|
+
protected readonly onActionRequest: alepha1.HookPrimitive<"action:onRequest">;
|
|
71
|
+
protected readonly onRequest: alepha1.HookPrimitive<"server:onRequest">;
|
|
72
72
|
protected check(user: UserAccountToken, secure: ServerRouteSecure): void;
|
|
73
73
|
/**
|
|
74
74
|
* Get the user account token for a local action call.
|
|
@@ -85,7 +85,7 @@ declare class ServerSecurityProvider {
|
|
|
85
85
|
user?: UserAccountToken | "system" | "context";
|
|
86
86
|
}, permission?: Permission): UserAccountToken;
|
|
87
87
|
protected createTestUser(): UserAccountToken;
|
|
88
|
-
protected readonly onClientRequest:
|
|
88
|
+
protected readonly onClientRequest: alepha1.HookPrimitive<"client:onRequest">;
|
|
89
89
|
}
|
|
90
90
|
type ServerRouteSecure = {
|
|
91
91
|
realm?: string;
|
|
@@ -167,7 +167,7 @@ declare module "alepha/server" {
|
|
|
167
167
|
* @see {@link ServerSecurityProvider}
|
|
168
168
|
* @module alepha.server.security
|
|
169
169
|
*/
|
|
170
|
-
declare const AlephaServerSecurity:
|
|
170
|
+
declare const AlephaServerSecurity: alepha1.Service<alepha1.Module>;
|
|
171
171
|
//#endregion
|
|
172
172
|
export { $basicAuth, AbstractBasicAuthPrimitive, AlephaServerSecurity, BasicAuthOptions, BasicAuthPrimitive, BasicAuthPrimitiveConfig, ServerBasicAuthProvider, ServerRouteSecure, ServerSecurityProvider, isBasicAuth };
|
|
173
173
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED