alepha 0.6.10 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -3
- package/assets/logo.png +0 -0
- package/cache.cjs +0 -1
- package/cache.d.ts +30 -13
- package/cache.js +0 -1
- package/core.cjs +0 -1
- package/core.d.ts +465 -183
- package/core.js +0 -1
- package/datetime.cjs +0 -1
- package/datetime.d.ts +32 -31
- package/datetime.js +0 -1
- package/lock.cjs +0 -1
- package/lock.d.ts +2 -2
- package/lock.js +0 -1
- package/package.json +55 -47
- package/postgres.cjs +0 -1
- package/postgres.d.ts +3276 -124
- package/postgres.js +0 -1
- package/queue.cjs +0 -1
- package/queue.d.ts +2 -2
- package/queue.js +0 -1
- package/react/auth.cjs +0 -1
- package/react/auth.d.ts +40 -32
- package/react/auth.js +0 -1
- package/react.cjs +0 -1
- package/react.d.ts +417 -234
- package/react.js +0 -1
- package/redis.cjs +0 -1
- package/redis.js +0 -1
- package/retry.cjs +12 -0
- package/retry.d.ts +68 -0
- package/retry.js +1 -0
- package/scheduler.cjs +0 -1
- package/scheduler.js +0 -1
- package/security.cjs +0 -1
- package/security.d.ts +71 -17
- package/security.js +0 -1
- package/server/cookies.cjs +0 -1
- package/server/cookies.d.ts +1 -1
- package/server/cookies.js +0 -1
- package/server/metrics.cjs +0 -1
- package/server/metrics.d.ts +1 -1
- package/server/metrics.js +0 -1
- package/server/proxy.cjs +0 -1
- package/server/proxy.d.ts +1 -35
- package/server/proxy.js +0 -1
- package/server/static.cjs +0 -1
- package/server/static.d.ts +6 -0
- package/server/static.js +0 -1
- package/server/swagger.cjs +0 -1
- package/server/swagger.d.ts +1 -0
- package/server/swagger.js +0 -1
- package/server.cjs +0 -1
- package/server.d.ts +639 -346
- package/server.js +0 -1
- package/src/retry.ts +1 -0
- package/topic.cjs +0 -1
- package/topic.d.ts +3 -3
- package/topic.js +0 -1
- package/vite.cjs +0 -1
- package/vite.d.ts +29 -30
- package/vite.js +0 -1
- package/cache.cjs.map +0 -1
- package/cache.js.map +0 -1
- package/core.cjs.map +0 -1
- package/core.js.map +0 -1
- package/datetime.cjs.map +0 -1
- package/datetime.js.map +0 -1
- package/lock.cjs.map +0 -1
- package/lock.js.map +0 -1
- package/postgres.cjs.map +0 -1
- package/postgres.js.map +0 -1
- package/queue.cjs.map +0 -1
- package/queue.js.map +0 -1
- package/react/auth.cjs.map +0 -1
- package/react/auth.js.map +0 -1
- package/react.cjs.map +0 -1
- package/react.js.map +0 -1
- package/redis.cjs.map +0 -1
- package/redis.js.map +0 -1
- package/scheduler.cjs.map +0 -1
- package/scheduler.js.map +0 -1
- package/security.cjs.map +0 -1
- package/security.js.map +0 -1
- package/server/cookies.cjs.map +0 -1
- package/server/cookies.js.map +0 -1
- package/server/metrics.cjs.map +0 -1
- package/server/metrics.js.map +0 -1
- package/server/proxy.cjs.map +0 -1
- package/server/proxy.js.map +0 -1
- package/server/static.cjs.map +0 -1
- package/server/static.js.map +0 -1
- package/server/swagger.cjs.map +0 -1
- package/server/swagger.js.map +0 -1
- package/server.cjs.map +0 -1
- package/server.js.map +0 -1
- package/topic.cjs.map +0 -1
- package/topic.js.map +0 -1
- package/vite.cjs.map +0 -1
- package/vite.js.map +0 -1
package/postgres.js
CHANGED
package/queue.cjs
CHANGED
package/queue.d.ts
CHANGED
|
@@ -67,14 +67,14 @@ declare class QueueProvider {
|
|
|
67
67
|
* @param queue - The queue name.
|
|
68
68
|
* @param message - The message to push.
|
|
69
69
|
*/
|
|
70
|
-
push(
|
|
70
|
+
push(_queue: string, _message: string): Promise<void>;
|
|
71
71
|
/**
|
|
72
72
|
* Pop a message from the queue.
|
|
73
73
|
*
|
|
74
74
|
* @param queue - The queue name.
|
|
75
75
|
* @returns The message popped.
|
|
76
76
|
*/
|
|
77
|
-
pop(
|
|
77
|
+
pop(_queue: string): Promise<string | undefined>;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
declare const KEY$1 = "QUEUE";
|
package/queue.js
CHANGED
package/react/auth.cjs
CHANGED
package/react/auth.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _alepha_core from '@alepha/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Async, KIND, OPTIONS, Alepha } from '@alepha/core';
|
|
3
3
|
import { UserAccountToken } from '@alepha/security';
|
|
4
4
|
import * as _alepha_server from '@alepha/server';
|
|
5
|
-
import { HttpClient } from '@alepha/server';
|
|
5
|
+
import { HttpVirtualClient, HttpClient } from '@alepha/server';
|
|
6
6
|
import * as _alepha_server_cookies from '@alepha/server-cookies';
|
|
7
7
|
import { ServerCookiesProvider, Cookies } from '@alepha/server-cookies';
|
|
8
8
|
import { Configuration } from 'openid-client';
|
|
@@ -131,6 +131,29 @@ interface TSchema extends TKind, SchemaOptions {
|
|
|
131
131
|
static: unknown;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
declare const KEY = "AUTH";
|
|
135
|
+
type AccessToken = string;
|
|
136
|
+
interface AuthDescriptorOptions {
|
|
137
|
+
name?: string;
|
|
138
|
+
fallback?: () => Async<AccessToken>;
|
|
139
|
+
oidc?: {
|
|
140
|
+
issuer: string;
|
|
141
|
+
clientId: string;
|
|
142
|
+
clientSecret?: string;
|
|
143
|
+
redirectUri?: string;
|
|
144
|
+
useIdToken?: boolean;
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
interface AuthDescriptor {
|
|
148
|
+
[KIND]: typeof KEY;
|
|
149
|
+
[OPTIONS]: AuthDescriptorOptions;
|
|
150
|
+
jwks: () => string;
|
|
151
|
+
}
|
|
152
|
+
declare const $auth: {
|
|
153
|
+
(options: AuthDescriptorOptions): AuthDescriptor;
|
|
154
|
+
[KIND]: string;
|
|
155
|
+
};
|
|
156
|
+
|
|
134
157
|
declare class ReactAuthProvider {
|
|
135
158
|
protected readonly log: _alepha_core.Logger;
|
|
136
159
|
protected readonly alepha: Alepha;
|
|
@@ -141,6 +164,7 @@ declare class ReactAuthProvider {
|
|
|
141
164
|
redirectUri: TOptional<TString>;
|
|
142
165
|
}>>;
|
|
143
166
|
protected readonly tokens: _alepha_server_cookies.CookieDescriptor<TObject<{
|
|
167
|
+
provider: TOptional<TString>;
|
|
144
168
|
access_token: TOptional<TString>;
|
|
145
169
|
expires_in: TOptional<TNumber>;
|
|
146
170
|
refresh_token: TOptional<TString>;
|
|
@@ -152,9 +176,11 @@ declare class ReactAuthProvider {
|
|
|
152
176
|
id: TString;
|
|
153
177
|
name: TOptional<TString>;
|
|
154
178
|
email: TOptional<TString>;
|
|
179
|
+
picture: TOptional<TString>;
|
|
155
180
|
}>>;
|
|
156
181
|
readonly onRender: _alepha_core.HookDescriptor<"react:server:render">;
|
|
157
182
|
protected readonly configure: _alepha_core.HookDescriptor<"configure">;
|
|
183
|
+
protected getAccessTokenFromCookies(tokens: SessionTokens): Promise<string | undefined>;
|
|
158
184
|
/**
|
|
159
185
|
* Configure Fastify to forward Session Access Token to Header Authorization.
|
|
160
186
|
*/
|
|
@@ -191,10 +217,8 @@ declare class ReactAuthProvider {
|
|
|
191
217
|
id: any;
|
|
192
218
|
name: any;
|
|
193
219
|
email: any;
|
|
220
|
+
picture: any;
|
|
194
221
|
} | undefined;
|
|
195
|
-
/**
|
|
196
|
-
*
|
|
197
|
-
*/
|
|
198
222
|
readonly logout: _alepha_server.RouteDescriptor<{
|
|
199
223
|
query: TObject<{
|
|
200
224
|
redirect: TOptional<TString>;
|
|
@@ -210,6 +234,8 @@ declare class ReactAuthProvider {
|
|
|
210
234
|
client: Configuration;
|
|
211
235
|
name: string;
|
|
212
236
|
redirectUri: string;
|
|
237
|
+
fallback?: () => Async<AccessToken>;
|
|
238
|
+
useIdToken?: boolean;
|
|
213
239
|
}>;
|
|
214
240
|
/**
|
|
215
241
|
*
|
|
@@ -225,6 +251,7 @@ interface SessionTokens {
|
|
|
225
251
|
id_token?: string;
|
|
226
252
|
scope?: string;
|
|
227
253
|
issued_at?: number;
|
|
254
|
+
provider?: string;
|
|
228
255
|
}
|
|
229
256
|
interface AuthProvider {
|
|
230
257
|
name: string;
|
|
@@ -232,6 +259,8 @@ interface AuthProvider {
|
|
|
232
259
|
client: {
|
|
233
260
|
get: () => Promise<Configuration>;
|
|
234
261
|
};
|
|
262
|
+
fallback?: () => Async<AccessToken>;
|
|
263
|
+
useIdToken?: boolean;
|
|
235
264
|
}
|
|
236
265
|
interface ReactUser {
|
|
237
266
|
id: string;
|
|
@@ -239,46 +268,25 @@ interface ReactUser {
|
|
|
239
268
|
email?: string;
|
|
240
269
|
}
|
|
241
270
|
|
|
242
|
-
declare const KEY = "AUTH";
|
|
243
|
-
interface AuthDescriptorOptions {
|
|
244
|
-
name?: string;
|
|
245
|
-
oidc?: {
|
|
246
|
-
issuer: string;
|
|
247
|
-
clientId: string;
|
|
248
|
-
clientSecret?: string;
|
|
249
|
-
redirectUri?: string;
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
interface AuthDescriptor {
|
|
253
|
-
[KIND]: typeof KEY;
|
|
254
|
-
[OPTIONS]: AuthDescriptorOptions;
|
|
255
|
-
jwks: () => string;
|
|
256
|
-
}
|
|
257
|
-
declare const $auth: {
|
|
258
|
-
(options: AuthDescriptorOptions): AuthDescriptor;
|
|
259
|
-
[KIND]: string;
|
|
260
|
-
};
|
|
261
|
-
|
|
262
271
|
declare const useAuth: () => AuthHook;
|
|
263
272
|
interface AuthHook {
|
|
264
273
|
user?: UserAccountToken;
|
|
265
274
|
logout: () => void;
|
|
266
275
|
login: (provider?: string) => void;
|
|
267
|
-
can: (
|
|
268
|
-
can: () => boolean;
|
|
269
|
-
}) => boolean;
|
|
276
|
+
can: <T extends object>(name: keyof HttpVirtualClient<T>) => boolean;
|
|
270
277
|
}
|
|
271
278
|
|
|
272
279
|
declare class ReactAuth {
|
|
273
280
|
protected readonly log: _alepha_core.Logger;
|
|
274
281
|
protected readonly alepha: Alepha;
|
|
275
282
|
protected readonly client: HttpClient;
|
|
276
|
-
|
|
283
|
+
static path: {
|
|
277
284
|
login: string;
|
|
285
|
+
callback: string;
|
|
278
286
|
logout: string;
|
|
279
287
|
};
|
|
280
|
-
readonly
|
|
281
|
-
|
|
288
|
+
readonly onRender: _alepha_core.HookDescriptor<"react:transition:begin">;
|
|
289
|
+
get user(): UserAccountToken | undefined;
|
|
282
290
|
protected getUserFromCookies(): UserAccountToken | undefined;
|
|
283
291
|
login(): void;
|
|
284
292
|
logout(): void;
|
|
@@ -297,4 +305,4 @@ declare class ReactAuthModule {
|
|
|
297
305
|
constructor();
|
|
298
306
|
}
|
|
299
307
|
|
|
300
|
-
export { $auth, type AuthDescriptor, type AuthDescriptorOptions, type AuthHook, type AuthProvider, ReactAuth, ReactAuthModule, ReactAuthProvider, type ReactUser, type SessionTokens, useAuth };
|
|
308
|
+
export { $auth, type AccessToken, type AuthDescriptor, type AuthDescriptorOptions, type AuthHook, type AuthProvider, ReactAuth, ReactAuthModule, ReactAuthProvider, type ReactUser, type SessionTokens, useAuth };
|
package/react/auth.js
CHANGED
package/react.cjs
CHANGED