alepha 0.13.4 → 0.13.5
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/dist/api-files/index.browser.js +5 -5
- package/dist/api-files/index.d.ts +191 -191
- package/dist/api-files/index.js +9 -9
- package/dist/api-jobs/index.browser.js +5 -5
- package/dist/api-jobs/index.d.ts +173 -173
- package/dist/api-jobs/index.js +9 -9
- package/dist/api-notifications/index.browser.js +11 -11
- package/dist/api-notifications/index.d.ts +11 -11
- package/dist/api-notifications/index.js +11 -11
- package/dist/api-parameters/index.browser.js +2 -2
- package/dist/api-parameters/index.d.ts +3 -3
- package/dist/api-parameters/index.js +3 -3
- package/dist/api-users/index.browser.js +6 -6
- package/dist/api-users/index.d.ts +55 -55
- package/dist/api-users/index.js +36 -36
- package/dist/api-verifications/index.browser.js +5 -5
- package/dist/api-verifications/index.d.ts +21 -21
- package/dist/api-verifications/index.js +10 -10
- package/dist/batch/index.d.ts +3 -3
- package/dist/batch/index.js +3 -3
- package/dist/bin/index.js +1 -1
- package/dist/bucket/index.d.ts +6 -6
- package/dist/bucket/index.js +7 -7
- package/dist/cache/index.d.ts +4 -4
- package/dist/cache/index.js +5 -5
- package/dist/cache-redis/index.d.ts +2 -2
- package/dist/cache-redis/index.js +2 -2
- package/dist/cli/{dist-lGnqsKpu.js → dist-BlfFtOk2.js} +16 -16
- package/dist/cli/{dist-lGnqsKpu.js.map → dist-BlfFtOk2.js.map} +1 -1
- package/dist/cli/index.d.ts +31 -75
- package/dist/cli/index.js +94 -171
- package/dist/cli/index.js.map +1 -1
- package/dist/command/index.d.ts +8 -8
- package/dist/command/index.js +11 -10
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js +35 -35
- package/dist/core/index.d.ts +39 -39
- package/dist/core/index.js +35 -35
- package/dist/core/index.native.js +35 -35
- package/dist/datetime/index.d.ts +3 -3
- package/dist/datetime/index.js +3 -3
- package/dist/email/index.d.ts +11 -11
- package/dist/email/index.js +42 -42
- package/dist/fake/index.d.ts +2 -2
- package/dist/fake/index.js +5 -5
- package/dist/file/index.d.ts +4 -4
- package/dist/file/index.js +4 -4
- package/dist/lock/index.d.ts +5 -5
- package/dist/lock/index.js +5 -5
- package/dist/lock-redis/index.d.ts +2 -2
- package/dist/lock-redis/index.js +2 -2
- package/dist/logger/index.d.ts +11 -11
- package/dist/logger/index.js +12 -12
- package/dist/orm/index.browser.js +12 -12
- package/dist/orm/index.d.ts +52 -52
- package/dist/orm/index.js +32 -32
- package/dist/queue/index.d.ts +7 -7
- package/dist/queue/index.js +6 -6
- package/dist/queue-redis/index.d.ts +2 -2
- package/dist/queue-redis/index.js +2 -2
- package/dist/redis/index.d.ts +13 -13
- package/dist/redis/index.js +3 -3
- package/dist/retry/index.d.ts +5 -5
- package/dist/retry/index.js +5 -5
- package/dist/router/index.d.ts +1 -1
- package/dist/router/index.js +1 -1
- package/dist/scheduler/index.d.ts +4 -4
- package/dist/scheduler/index.js +7 -7
- package/dist/security/index.browser.js +7 -7
- package/dist/security/index.d.ts +15 -15
- package/dist/security/index.js +46 -46
- package/dist/server/index.browser.js +14 -14
- package/dist/server/index.d.ts +26 -26
- package/dist/server/index.js +26 -26
- package/dist/server-auth/index.browser.js +6 -6
- package/dist/server-auth/index.d.ts +163 -163
- package/dist/server-auth/index.js +13 -13
- package/dist/server-cache/index.d.ts +2 -2
- package/dist/server-cache/index.js +2 -2
- package/dist/server-compress/index.d.ts +2 -2
- package/dist/server-compress/index.js +2 -2
- package/dist/server-cookies/index.browser.js +3 -3
- package/dist/server-cookies/index.d.ts +4 -4
- package/dist/server-cookies/index.js +4 -4
- package/dist/server-cors/index.d.ts +3 -3
- package/dist/server-cors/index.js +3 -3
- package/dist/server-health/index.d.ts +3 -3
- package/dist/server-health/index.js +3 -3
- package/dist/server-helmet/index.d.ts +2 -2
- package/dist/server-helmet/index.js +2 -2
- package/dist/server-links/index.browser.js +5 -5
- package/dist/server-links/index.d.ts +40 -40
- package/dist/server-links/index.js +7 -7
- package/dist/server-metrics/index.d.ts +2 -2
- package/dist/server-metrics/index.js +86 -86
- package/dist/server-multipart/index.d.ts +2 -2
- package/dist/server-multipart/index.js +2 -2
- package/dist/server-proxy/index.d.ts +3 -3
- package/dist/server-proxy/index.js +3 -3
- package/dist/server-rate-limit/index.d.ts +3 -3
- package/dist/server-rate-limit/index.js +3 -3
- package/dist/server-security/index.browser.js +1 -1
- package/dist/server-security/index.d.ts +13 -13
- package/dist/server-security/index.js +4 -4
- package/dist/server-static/index.d.ts +3 -3
- package/dist/server-static/index.js +3 -3
- package/dist/server-swagger/index.d.ts +3 -3
- package/dist/server-swagger/index.js +3 -3
- package/dist/sms/index.d.ts +6 -6
- package/dist/sms/index.js +6 -6
- package/dist/thread/index.d.ts +3 -3
- package/dist/thread/index.js +3 -3
- package/dist/topic/index.d.ts +6 -6
- package/dist/topic/index.js +6 -6
- package/dist/topic-redis/index.d.ts +2 -2
- package/dist/topic-redis/index.js +2 -2
- package/dist/vite/index.d.ts +17 -17
- package/dist/vite/index.js +20 -20
- package/dist/websocket/index.browser.js +9 -9
- package/dist/websocket/index.d.ts +17 -17
- package/dist/websocket/index.js +10 -10
- package/package.json +5 -4
- package/src/cli/apps/AlephaCli.ts +1 -2
- package/src/cli/commands/BiomeCommands.ts +4 -6
- package/src/cli/commands/CoreCommands.ts +2 -2
- package/src/cli/commands/DrizzleCommands.ts +76 -78
- package/src/cli/commands/VerifyCommands.ts +3 -5
- package/src/cli/commands/ViteCommands.ts +6 -8
- package/src/cli/index.ts +1 -1
- package/src/cli/services/{ProjectUtils.ts → AlephaCliUtils.ts} +101 -16
- package/src/command/providers/CliProvider.ts +12 -4
- package/src/cli/services/ProcessRunner.ts +0 -89
package/dist/scheduler/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { $lock, AlephaLock } from "alepha/lock";
|
|
|
3
3
|
import { DateTimeProvider } from "alepha/datetime";
|
|
4
4
|
import { $logger } from "alepha/logger";
|
|
5
5
|
|
|
6
|
-
//#region
|
|
6
|
+
//#region ../../../../node_modules/cron-schedule/dist/utils.js
|
|
7
7
|
function extractDateElements(date) {
|
|
8
8
|
return {
|
|
9
9
|
second: date.getSeconds(),
|
|
@@ -24,7 +24,7 @@ function getDaysBetweenWeekdays(weekday1, weekday2) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
//#endregion
|
|
27
|
-
//#region
|
|
27
|
+
//#region ../../../../node_modules/cron-schedule/dist/cron.js
|
|
28
28
|
var Cron = class {
|
|
29
29
|
constructor({ seconds, minutes, hours, days, months, weekdays }) {
|
|
30
30
|
if (!seconds || seconds.size === 0) throw new Error("There must be at least one allowed second.");
|
|
@@ -274,7 +274,7 @@ var Cron = class {
|
|
|
274
274
|
};
|
|
275
275
|
|
|
276
276
|
//#endregion
|
|
277
|
-
//#region
|
|
277
|
+
//#region ../../../../node_modules/cron-schedule/dist/cron-parser.js
|
|
278
278
|
const secondConstraint = {
|
|
279
279
|
min: 0,
|
|
280
280
|
max: 59
|
|
@@ -396,7 +396,7 @@ function parseCronExpression(cronExpression) {
|
|
|
396
396
|
}
|
|
397
397
|
|
|
398
398
|
//#endregion
|
|
399
|
-
//#region src/scheduler/providers/CronProvider.ts
|
|
399
|
+
//#region ../../src/scheduler/providers/CronProvider.ts
|
|
400
400
|
var CronProvider = class {
|
|
401
401
|
dt = $inject(DateTimeProvider);
|
|
402
402
|
alepha = $inject(Alepha);
|
|
@@ -479,7 +479,7 @@ var CronProvider = class {
|
|
|
479
479
|
};
|
|
480
480
|
|
|
481
481
|
//#endregion
|
|
482
|
-
//#region src/scheduler/primitives/$scheduler.ts
|
|
482
|
+
//#region ../../src/scheduler/primitives/$scheduler.ts
|
|
483
483
|
/**
|
|
484
484
|
* Scheduler primitive.
|
|
485
485
|
*/
|
|
@@ -543,7 +543,7 @@ var SchedulerPrimitive = class extends Primitive {
|
|
|
543
543
|
$scheduler[KIND] = SchedulerPrimitive;
|
|
544
544
|
|
|
545
545
|
//#endregion
|
|
546
|
-
//#region src/scheduler/constants/CRON.ts
|
|
546
|
+
//#region ../../src/scheduler/constants/CRON.ts
|
|
547
547
|
const CRON = {
|
|
548
548
|
EVERY_MINUTE: "* * * * *",
|
|
549
549
|
EVERY_5_MINUTES: "*/5 * * * *",
|
|
@@ -554,7 +554,7 @@ const CRON = {
|
|
|
554
554
|
};
|
|
555
555
|
|
|
556
556
|
//#endregion
|
|
557
|
-
//#region src/scheduler/index.ts
|
|
557
|
+
//#region ../../src/scheduler/index.ts
|
|
558
558
|
/**
|
|
559
559
|
* Generic interface for scheduling tasks.
|
|
560
560
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $module, t } from "alepha";
|
|
2
2
|
import { UnauthorizedError } from "alepha/server";
|
|
3
3
|
|
|
4
|
-
//#region src/security/errors/InvalidCredentialsError.ts
|
|
4
|
+
//#region ../../src/security/errors/InvalidCredentialsError.ts
|
|
5
5
|
/**
|
|
6
6
|
* Error thrown when the provided credentials are invalid.
|
|
7
7
|
*
|
|
@@ -16,7 +16,7 @@ var InvalidCredentialsError = class extends UnauthorizedError {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
//#endregion
|
|
19
|
-
//#region src/security/errors/InvalidPermissionError.ts
|
|
19
|
+
//#region ../../src/security/errors/InvalidPermissionError.ts
|
|
20
20
|
var InvalidPermissionError = class extends Error {
|
|
21
21
|
constructor(name) {
|
|
22
22
|
super(`Permission '${name}' is invalid`);
|
|
@@ -24,14 +24,14 @@ var InvalidPermissionError = class extends Error {
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
//#endregion
|
|
27
|
-
//#region src/security/errors/SecurityError.ts
|
|
27
|
+
//#region ../../src/security/errors/SecurityError.ts
|
|
28
28
|
var SecurityError = class extends Error {
|
|
29
29
|
name = "SecurityError";
|
|
30
30
|
status = 403;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
//#endregion
|
|
34
|
-
//#region src/security/schemas/permissionSchema.ts
|
|
34
|
+
//#region ../../src/security/schemas/permissionSchema.ts
|
|
35
35
|
const permissionSchema = t.object({
|
|
36
36
|
name: t.text({ description: "Name of the permission." }),
|
|
37
37
|
group: t.optional(t.text({ description: "Group of the permission." })),
|
|
@@ -41,7 +41,7 @@ const permissionSchema = t.object({
|
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
//#endregion
|
|
44
|
-
//#region src/security/schemas/roleSchema.ts
|
|
44
|
+
//#region ../../src/security/schemas/roleSchema.ts
|
|
45
45
|
const roleSchema = t.object({
|
|
46
46
|
name: t.text({ description: "Name of the role." }),
|
|
47
47
|
description: t.optional(t.text({ description: "Describe the role." })),
|
|
@@ -54,7 +54,7 @@ const roleSchema = t.object({
|
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
//#endregion
|
|
57
|
-
//#region src/security/schemas/userAccountInfoSchema.ts
|
|
57
|
+
//#region ../../src/security/schemas/userAccountInfoSchema.ts
|
|
58
58
|
const userAccountInfoSchema = t.object({
|
|
59
59
|
id: t.text({ description: "Unique identifier for the user." }),
|
|
60
60
|
name: t.optional(t.text({ description: "Full name of the user." })),
|
|
@@ -70,7 +70,7 @@ const userAccountInfoSchema = t.object({
|
|
|
70
70
|
});
|
|
71
71
|
|
|
72
72
|
//#endregion
|
|
73
|
-
//#region src/security/index.browser.ts
|
|
73
|
+
//#region ../../src/security/index.browser.ts
|
|
74
74
|
const AlephaSecurity = $module({ name: "alepha.security" });
|
|
75
75
|
|
|
76
76
|
//#endregion
|
package/dist/security/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { UnauthorizedError } from "alepha/server";
|
|
|
6
6
|
import { CryptoKey, FlattenedJWSInput, JSONWebKeySet, JWSHeaderParameters, JWTHeaderParameters, JWTPayload, JWTVerifyResult, KeyObject } from "jose";
|
|
7
7
|
import { JWTVerifyOptions } from "jose/jwt/verify";
|
|
8
8
|
|
|
9
|
-
//#region src/security/schemas/userAccountInfoSchema.d.ts
|
|
9
|
+
//#region ../../src/security/schemas/userAccountInfoSchema.d.ts
|
|
10
10
|
declare const userAccountInfoSchema: alepha15.TObject<{
|
|
11
11
|
id: alepha15.TString;
|
|
12
12
|
name: alepha15.TOptional<alepha15.TString>;
|
|
@@ -19,7 +19,7 @@ declare const userAccountInfoSchema: alepha15.TObject<{
|
|
|
19
19
|
}>;
|
|
20
20
|
type UserAccount = Static<typeof userAccountInfoSchema>;
|
|
21
21
|
//#endregion
|
|
22
|
-
//#region src/security/errors/InvalidCredentialsError.d.ts
|
|
22
|
+
//#region ../../src/security/errors/InvalidCredentialsError.d.ts
|
|
23
23
|
/**
|
|
24
24
|
* Error thrown when the provided credentials are invalid.
|
|
25
25
|
*
|
|
@@ -31,18 +31,18 @@ declare class InvalidCredentialsError extends UnauthorizedError {
|
|
|
31
31
|
constructor();
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
|
-
//#region src/security/errors/InvalidPermissionError.d.ts
|
|
34
|
+
//#region ../../src/security/errors/InvalidPermissionError.d.ts
|
|
35
35
|
declare class InvalidPermissionError extends Error {
|
|
36
36
|
constructor(name: string);
|
|
37
37
|
}
|
|
38
38
|
//#endregion
|
|
39
|
-
//#region src/security/errors/SecurityError.d.ts
|
|
39
|
+
//#region ../../src/security/errors/SecurityError.d.ts
|
|
40
40
|
declare class SecurityError extends Error {
|
|
41
41
|
name: string;
|
|
42
42
|
readonly status = 403;
|
|
43
43
|
}
|
|
44
44
|
//#endregion
|
|
45
|
-
//#region src/security/interfaces/UserAccountToken.d.ts
|
|
45
|
+
//#region ../../src/security/interfaces/UserAccountToken.d.ts
|
|
46
46
|
/**
|
|
47
47
|
* Add contextual metadata to a user account info.
|
|
48
48
|
* E.g. UserAccountToken is a UserAccountInfo during a request.
|
|
@@ -63,7 +63,7 @@ interface UserAccountToken extends UserAccount {
|
|
|
63
63
|
ownership?: string | boolean;
|
|
64
64
|
}
|
|
65
65
|
//#endregion
|
|
66
|
-
//#region src/security/schemas/permissionSchema.d.ts
|
|
66
|
+
//#region ../../src/security/schemas/permissionSchema.d.ts
|
|
67
67
|
declare const permissionSchema: alepha15.TObject<{
|
|
68
68
|
name: alepha15.TString;
|
|
69
69
|
group: alepha15.TOptional<alepha15.TString>;
|
|
@@ -73,7 +73,7 @@ declare const permissionSchema: alepha15.TObject<{
|
|
|
73
73
|
}>;
|
|
74
74
|
type Permission = Static<typeof permissionSchema>;
|
|
75
75
|
//#endregion
|
|
76
|
-
//#region src/security/schemas/roleSchema.d.ts
|
|
76
|
+
//#region ../../src/security/schemas/roleSchema.d.ts
|
|
77
77
|
declare const roleSchema: alepha15.TObject<{
|
|
78
78
|
name: alepha15.TString;
|
|
79
79
|
description: alepha15.TOptional<alepha15.TString>;
|
|
@@ -86,7 +86,7 @@ declare const roleSchema: alepha15.TObject<{
|
|
|
86
86
|
}>;
|
|
87
87
|
type Role = Static<typeof roleSchema>;
|
|
88
88
|
//#endregion
|
|
89
|
-
//#region src/security/providers/JwtProvider.d.ts
|
|
89
|
+
//#region ../../src/security/providers/JwtProvider.d.ts
|
|
90
90
|
/**
|
|
91
91
|
* Provides utilities for working with JSON Web Tokens (JWT).
|
|
92
92
|
*/
|
|
@@ -152,7 +152,7 @@ interface JwtParseResult {
|
|
|
152
152
|
result: JWTVerifyResult<ExtendedJWTPayload>;
|
|
153
153
|
}
|
|
154
154
|
//#endregion
|
|
155
|
-
//#region src/security/providers/SecurityProvider.d.ts
|
|
155
|
+
//#region ../../src/security/providers/SecurityProvider.d.ts
|
|
156
156
|
declare const DEFAULT_APP_SECRET = "05759934015388327323179852515731";
|
|
157
157
|
declare const envSchema: alepha15.TObject<{
|
|
158
158
|
APP_SECRET: alepha15.TString;
|
|
@@ -314,7 +314,7 @@ interface SecurityCheckResult {
|
|
|
314
314
|
ownership: string | boolean | undefined;
|
|
315
315
|
}
|
|
316
316
|
//#endregion
|
|
317
|
-
//#region src/security/primitives/$permission.d.ts
|
|
317
|
+
//#region ../../src/security/primitives/$permission.d.ts
|
|
318
318
|
/**
|
|
319
319
|
* Create a new permission.
|
|
320
320
|
*/
|
|
@@ -348,7 +348,7 @@ declare class PermissionPrimitive extends Primitive<PermissionPrimitiveOptions>
|
|
|
348
348
|
can(user: UserAccount): boolean;
|
|
349
349
|
}
|
|
350
350
|
//#endregion
|
|
351
|
-
//#region src/security/primitives/$realm.d.ts
|
|
351
|
+
//#region ../../src/security/primitives/$realm.d.ts
|
|
352
352
|
/**
|
|
353
353
|
* Create a new realm.
|
|
354
354
|
*/
|
|
@@ -469,7 +469,7 @@ interface AccessTokenResponse {
|
|
|
469
469
|
scope?: string;
|
|
470
470
|
}
|
|
471
471
|
//#endregion
|
|
472
|
-
//#region src/security/primitives/$role.d.ts
|
|
472
|
+
//#region ../../src/security/primitives/$role.d.ts
|
|
473
473
|
/**
|
|
474
474
|
* Create a new role.
|
|
475
475
|
*/
|
|
@@ -505,7 +505,7 @@ declare class RolePrimitive extends Primitive<RolePrimitiveOptions> {
|
|
|
505
505
|
check(permission: string | PermissionPrimitive): SecurityCheckResult;
|
|
506
506
|
}
|
|
507
507
|
//#endregion
|
|
508
|
-
//#region src/security/primitives/$serviceAccount.d.ts
|
|
508
|
+
//#region ../../src/security/primitives/$serviceAccount.d.ts
|
|
509
509
|
/**
|
|
510
510
|
* Allow to get an access token for a service account.
|
|
511
511
|
*
|
|
@@ -564,14 +564,14 @@ interface ServiceAccountStore {
|
|
|
564
564
|
response?: AccessTokenResponse;
|
|
565
565
|
}
|
|
566
566
|
//#endregion
|
|
567
|
-
//#region src/security/providers/CryptoProvider.d.ts
|
|
567
|
+
//#region ../../src/security/providers/CryptoProvider.d.ts
|
|
568
568
|
declare class CryptoProvider {
|
|
569
569
|
hashPassword(password: string): Promise<string>;
|
|
570
570
|
verifyPassword(password: string, stored: string): Promise<boolean>;
|
|
571
571
|
randomUUID(): string;
|
|
572
572
|
}
|
|
573
573
|
//#endregion
|
|
574
|
-
//#region src/security/index.d.ts
|
|
574
|
+
//#region ../../src/security/index.d.ts
|
|
575
575
|
declare module "alepha" {
|
|
576
576
|
interface Hooks {
|
|
577
577
|
"security:user:created": {
|
package/dist/security/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { DateTimeProvider } from "alepha/datetime";
|
|
|
5
5
|
import { promisify } from "node:util";
|
|
6
6
|
import { UnauthorizedError } from "alepha/server";
|
|
7
7
|
|
|
8
|
-
//#region src/security/errors/InvalidPermissionError.ts
|
|
8
|
+
//#region ../../src/security/errors/InvalidPermissionError.ts
|
|
9
9
|
var InvalidPermissionError = class extends Error {
|
|
10
10
|
constructor(name) {
|
|
11
11
|
super(`Permission '${name}' is invalid`);
|
|
@@ -13,13 +13,13 @@ var InvalidPermissionError = class extends Error {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
//#endregion
|
|
16
|
-
//#region src/security/errors/InvalidTokenError.ts
|
|
16
|
+
//#region ../../src/security/errors/InvalidTokenError.ts
|
|
17
17
|
var InvalidTokenError = class extends Error {
|
|
18
18
|
status = 401;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
//#endregion
|
|
22
|
-
//#region src/security/errors/RealmNotFoundError.ts
|
|
22
|
+
//#region ../../src/security/errors/RealmNotFoundError.ts
|
|
23
23
|
var RealmNotFoundError = class extends Error {
|
|
24
24
|
constructor(realm) {
|
|
25
25
|
super(`Realm '${realm}' not found`);
|
|
@@ -27,14 +27,14 @@ var RealmNotFoundError = class extends Error {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
//#endregion
|
|
30
|
-
//#region src/security/errors/SecurityError.ts
|
|
30
|
+
//#region ../../src/security/errors/SecurityError.ts
|
|
31
31
|
var SecurityError = class extends Error {
|
|
32
32
|
name = "SecurityError";
|
|
33
33
|
status = 403;
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
//#endregion
|
|
37
|
-
//#region
|
|
37
|
+
//#region ../../../../node_modules/jose/dist/webapi/lib/buffer_utils.js
|
|
38
38
|
const encoder = new TextEncoder();
|
|
39
39
|
const decoder = new TextDecoder();
|
|
40
40
|
const MAX_INT32 = 2 ** 32;
|
|
@@ -59,7 +59,7 @@ function encode$1(string) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
//#endregion
|
|
62
|
-
//#region
|
|
62
|
+
//#region ../../../../node_modules/jose/dist/webapi/lib/base64.js
|
|
63
63
|
function encodeBase64(input) {
|
|
64
64
|
if (Uint8Array.prototype.toBase64) return input.toBase64();
|
|
65
65
|
const CHUNK_SIZE = 32768;
|
|
@@ -76,7 +76,7 @@ function decodeBase64(encoded) {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
//#endregion
|
|
79
|
-
//#region
|
|
79
|
+
//#region ../../../../node_modules/jose/dist/webapi/util/base64url.js
|
|
80
80
|
function decode(input) {
|
|
81
81
|
if (Uint8Array.fromBase64) return Uint8Array.fromBase64(typeof input === "string" ? input : decoder.decode(input), { alphabet: "base64url" });
|
|
82
82
|
let encoded = input;
|
|
@@ -99,7 +99,7 @@ function encode(input) {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
//#endregion
|
|
102
|
-
//#region
|
|
102
|
+
//#region ../../../../node_modules/jose/dist/webapi/util/errors.js
|
|
103
103
|
var JOSEError = class extends Error {
|
|
104
104
|
static code = "ERR_JOSE_GENERIC";
|
|
105
105
|
code = "ERR_JOSE_GENERIC";
|
|
@@ -194,7 +194,7 @@ var JWSSignatureVerificationFailed = class extends JOSEError {
|
|
|
194
194
|
};
|
|
195
195
|
|
|
196
196
|
//#endregion
|
|
197
|
-
//#region
|
|
197
|
+
//#region ../../../../node_modules/jose/dist/webapi/lib/crypto_key.js
|
|
198
198
|
const unusable = (name, prop = "algorithm.name") => /* @__PURE__ */ new TypeError(`CryptoKey does not support this operation, its ${prop} must be ${name}`);
|
|
199
199
|
const isAlgorithm = (algorithm, name) => algorithm.name === name;
|
|
200
200
|
function getHashLength(hash) {
|
|
@@ -260,7 +260,7 @@ function checkSigCryptoKey(key, alg, usage) {
|
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
//#endregion
|
|
263
|
-
//#region
|
|
263
|
+
//#region ../../../../node_modules/jose/dist/webapi/lib/invalid_key_input.js
|
|
264
264
|
function message(msg, actual, ...types) {
|
|
265
265
|
types = types.filter(Boolean);
|
|
266
266
|
if (types.length > 2) {
|
|
@@ -279,7 +279,7 @@ const invalidKeyInput = (actual, ...types) => message("Key must be ", actual, ..
|
|
|
279
279
|
const withAlg = (alg, actual, ...types) => message(`Key for the ${alg} algorithm must be `, actual, ...types);
|
|
280
280
|
|
|
281
281
|
//#endregion
|
|
282
|
-
//#region
|
|
282
|
+
//#region ../../../../node_modules/jose/dist/webapi/lib/is_key_like.js
|
|
283
283
|
const isCryptoKey = (key) => {
|
|
284
284
|
if (key?.[Symbol.toStringTag] === "CryptoKey") return true;
|
|
285
285
|
try {
|
|
@@ -292,7 +292,7 @@ const isKeyObject = (key) => key?.[Symbol.toStringTag] === "KeyObject";
|
|
|
292
292
|
const isKeyLike = (key) => isCryptoKey(key) || isKeyObject(key);
|
|
293
293
|
|
|
294
294
|
//#endregion
|
|
295
|
-
//#region
|
|
295
|
+
//#region ../../../../node_modules/jose/dist/webapi/lib/is_disjoint.js
|
|
296
296
|
function isDisjoint(...headers) {
|
|
297
297
|
const sources = headers.filter(Boolean);
|
|
298
298
|
if (sources.length === 0 || sources.length === 1) return true;
|
|
@@ -312,7 +312,7 @@ function isDisjoint(...headers) {
|
|
|
312
312
|
}
|
|
313
313
|
|
|
314
314
|
//#endregion
|
|
315
|
-
//#region
|
|
315
|
+
//#region ../../../../node_modules/jose/dist/webapi/lib/is_object.js
|
|
316
316
|
const isObjectLike = (value) => typeof value === "object" && value !== null;
|
|
317
317
|
function isObject(input) {
|
|
318
318
|
if (!isObjectLike(input) || Object.prototype.toString.call(input) !== "[object Object]") return false;
|
|
@@ -323,7 +323,7 @@ function isObject(input) {
|
|
|
323
323
|
}
|
|
324
324
|
|
|
325
325
|
//#endregion
|
|
326
|
-
//#region
|
|
326
|
+
//#region ../../../../node_modules/jose/dist/webapi/lib/check_key_length.js
|
|
327
327
|
function checkKeyLength(alg, key) {
|
|
328
328
|
if (alg.startsWith("RS") || alg.startsWith("PS")) {
|
|
329
329
|
const { modulusLength } = key.algorithm;
|
|
@@ -332,7 +332,7 @@ function checkKeyLength(alg, key) {
|
|
|
332
332
|
}
|
|
333
333
|
|
|
334
334
|
//#endregion
|
|
335
|
-
//#region
|
|
335
|
+
//#region ../../../../node_modules/jose/dist/webapi/lib/jwk_to_key.js
|
|
336
336
|
function subtleMapping(jwk) {
|
|
337
337
|
let algorithm;
|
|
338
338
|
let keyUsages;
|
|
@@ -451,7 +451,7 @@ async function jwkToKey(jwk) {
|
|
|
451
451
|
}
|
|
452
452
|
|
|
453
453
|
//#endregion
|
|
454
|
-
//#region
|
|
454
|
+
//#region ../../../../node_modules/jose/dist/webapi/key/import.js
|
|
455
455
|
async function importJWK(jwk, alg, options) {
|
|
456
456
|
if (!isObject(jwk)) throw new TypeError("JWK must be an object");
|
|
457
457
|
let ext;
|
|
@@ -486,7 +486,7 @@ async function importJWK(jwk, alg, options) {
|
|
|
486
486
|
}
|
|
487
487
|
|
|
488
488
|
//#endregion
|
|
489
|
-
//#region
|
|
489
|
+
//#region ../../../../node_modules/jose/dist/webapi/lib/validate_crit.js
|
|
490
490
|
function validateCrit(Err, recognizedDefault, recognizedOption, protectedHeader, joseHeader) {
|
|
491
491
|
if (joseHeader.crit !== void 0 && protectedHeader?.crit === void 0) throw new Err("\"crit\" (Critical) Header Parameter MUST be integrity protected");
|
|
492
492
|
if (!protectedHeader || protectedHeader.crit === void 0) return /* @__PURE__ */ new Set();
|
|
@@ -503,7 +503,7 @@ function validateCrit(Err, recognizedDefault, recognizedOption, protectedHeader,
|
|
|
503
503
|
}
|
|
504
504
|
|
|
505
505
|
//#endregion
|
|
506
|
-
//#region
|
|
506
|
+
//#region ../../../../node_modules/jose/dist/webapi/lib/validate_algorithms.js
|
|
507
507
|
function validateAlgorithms(option, algorithms) {
|
|
508
508
|
if (algorithms !== void 0 && (!Array.isArray(algorithms) || algorithms.some((s) => typeof s !== "string"))) throw new TypeError(`"${option}" option must be an array of strings`);
|
|
509
509
|
if (!algorithms) return;
|
|
@@ -511,14 +511,14 @@ function validateAlgorithms(option, algorithms) {
|
|
|
511
511
|
}
|
|
512
512
|
|
|
513
513
|
//#endregion
|
|
514
|
-
//#region
|
|
514
|
+
//#region ../../../../node_modules/jose/dist/webapi/lib/is_jwk.js
|
|
515
515
|
const isJWK = (key) => isObject(key) && typeof key.kty === "string";
|
|
516
516
|
const isPrivateJWK = (key) => key.kty !== "oct" && (key.kty === "AKP" && typeof key.priv === "string" || typeof key.d === "string");
|
|
517
517
|
const isPublicJWK = (key) => key.kty !== "oct" && key.d === void 0 && key.priv === void 0;
|
|
518
518
|
const isSecretJWK = (key) => key.kty === "oct" && typeof key.k === "string";
|
|
519
519
|
|
|
520
520
|
//#endregion
|
|
521
|
-
//#region
|
|
521
|
+
//#region ../../../../node_modules/jose/dist/webapi/lib/normalize_key.js
|
|
522
522
|
let cache;
|
|
523
523
|
const handleJWK = async (key, jwk, alg, freeze = false) => {
|
|
524
524
|
cache ||= /* @__PURE__ */ new WeakMap();
|
|
@@ -642,7 +642,7 @@ async function normalizeKey(key, alg) {
|
|
|
642
642
|
}
|
|
643
643
|
|
|
644
644
|
//#endregion
|
|
645
|
-
//#region
|
|
645
|
+
//#region ../../../../node_modules/jose/dist/webapi/lib/check_key_type.js
|
|
646
646
|
const tag = (key) => key?.[Symbol.toStringTag];
|
|
647
647
|
const jwkMatchesOp = (alg, key, usage) => {
|
|
648
648
|
if (key.use !== void 0) {
|
|
@@ -731,7 +731,7 @@ function checkKeyType(alg, key, usage) {
|
|
|
731
731
|
}
|
|
732
732
|
|
|
733
733
|
//#endregion
|
|
734
|
-
//#region
|
|
734
|
+
//#region ../../../../node_modules/jose/dist/webapi/lib/subtle_dsa.js
|
|
735
735
|
function subtleAlgorithm(alg, algorithm) {
|
|
736
736
|
const hash = `SHA-${alg.slice(-3)}`;
|
|
737
737
|
switch (alg) {
|
|
@@ -771,7 +771,7 @@ function subtleAlgorithm(alg, algorithm) {
|
|
|
771
771
|
}
|
|
772
772
|
|
|
773
773
|
//#endregion
|
|
774
|
-
//#region
|
|
774
|
+
//#region ../../../../node_modules/jose/dist/webapi/lib/get_sign_verify_key.js
|
|
775
775
|
async function getSigKey(alg, key, usage) {
|
|
776
776
|
if (key instanceof Uint8Array) {
|
|
777
777
|
if (!alg.startsWith("HS")) throw new TypeError(invalidKeyInput(key, "CryptoKey", "KeyObject", "JSON Web Key"));
|
|
@@ -785,7 +785,7 @@ async function getSigKey(alg, key, usage) {
|
|
|
785
785
|
}
|
|
786
786
|
|
|
787
787
|
//#endregion
|
|
788
|
-
//#region
|
|
788
|
+
//#region ../../../../node_modules/jose/dist/webapi/lib/verify.js
|
|
789
789
|
async function verify(alg, key, signature, data) {
|
|
790
790
|
const cryptoKey = await getSigKey(alg, key, "verify");
|
|
791
791
|
checkKeyLength(alg, cryptoKey);
|
|
@@ -798,7 +798,7 @@ async function verify(alg, key, signature, data) {
|
|
|
798
798
|
}
|
|
799
799
|
|
|
800
800
|
//#endregion
|
|
801
|
-
//#region
|
|
801
|
+
//#region ../../../../node_modules/jose/dist/webapi/jws/flattened/verify.js
|
|
802
802
|
async function flattenedVerify(jws, key, options) {
|
|
803
803
|
if (!isObject(jws)) throw new JWSInvalid("Flattened JWS must be an object");
|
|
804
804
|
if (jws.protected === void 0 && jws.header === void 0) throw new JWSInvalid("Flattened JWS must have either of the \"protected\" or \"header\" members");
|
|
@@ -865,7 +865,7 @@ async function flattenedVerify(jws, key, options) {
|
|
|
865
865
|
}
|
|
866
866
|
|
|
867
867
|
//#endregion
|
|
868
|
-
//#region
|
|
868
|
+
//#region ../../../../node_modules/jose/dist/webapi/jws/compact/verify.js
|
|
869
869
|
async function compactVerify(jws, key, options) {
|
|
870
870
|
if (jws instanceof Uint8Array) jws = decoder.decode(jws);
|
|
871
871
|
if (typeof jws !== "string") throw new JWSInvalid("Compact JWS must be a string or Uint8Array");
|
|
@@ -888,7 +888,7 @@ async function compactVerify(jws, key, options) {
|
|
|
888
888
|
}
|
|
889
889
|
|
|
890
890
|
//#endregion
|
|
891
|
-
//#region
|
|
891
|
+
//#region ../../../../node_modules/jose/dist/webapi/lib/jwt_claims_set.js
|
|
892
892
|
const epoch = (date) => Math.floor(date.getTime() / 1e3);
|
|
893
893
|
const minute = 60;
|
|
894
894
|
const hour = minute * 60;
|
|
@@ -1053,7 +1053,7 @@ var JWTClaimsBuilder = class {
|
|
|
1053
1053
|
};
|
|
1054
1054
|
|
|
1055
1055
|
//#endregion
|
|
1056
|
-
//#region
|
|
1056
|
+
//#region ../../../../node_modules/jose/dist/webapi/jwt/verify.js
|
|
1057
1057
|
async function jwtVerify(jwt, key, options) {
|
|
1058
1058
|
const verified = await compactVerify(jwt, key, options);
|
|
1059
1059
|
if (verified.protectedHeader.crit?.includes("b64") && verified.protectedHeader.b64 === false) throw new JWTInvalid("JWTs MUST NOT use unencoded payload");
|
|
@@ -1069,7 +1069,7 @@ async function jwtVerify(jwt, key, options) {
|
|
|
1069
1069
|
}
|
|
1070
1070
|
|
|
1071
1071
|
//#endregion
|
|
1072
|
-
//#region
|
|
1072
|
+
//#region ../../../../node_modules/jose/dist/webapi/lib/sign.js
|
|
1073
1073
|
async function sign(alg, key, data) {
|
|
1074
1074
|
const cryptoKey = await getSigKey(alg, key, "sign");
|
|
1075
1075
|
checkKeyLength(alg, cryptoKey);
|
|
@@ -1078,7 +1078,7 @@ async function sign(alg, key, data) {
|
|
|
1078
1078
|
}
|
|
1079
1079
|
|
|
1080
1080
|
//#endregion
|
|
1081
|
-
//#region
|
|
1081
|
+
//#region ../../../../node_modules/jose/dist/webapi/jws/flattened/sign.js
|
|
1082
1082
|
var FlattenedSign = class {
|
|
1083
1083
|
#payload;
|
|
1084
1084
|
#protectedHeader;
|
|
@@ -1143,7 +1143,7 @@ var FlattenedSign = class {
|
|
|
1143
1143
|
};
|
|
1144
1144
|
|
|
1145
1145
|
//#endregion
|
|
1146
|
-
//#region
|
|
1146
|
+
//#region ../../../../node_modules/jose/dist/webapi/jws/compact/sign.js
|
|
1147
1147
|
var CompactSign = class {
|
|
1148
1148
|
#flattened;
|
|
1149
1149
|
constructor(payload) {
|
|
@@ -1161,7 +1161,7 @@ var CompactSign = class {
|
|
|
1161
1161
|
};
|
|
1162
1162
|
|
|
1163
1163
|
//#endregion
|
|
1164
|
-
//#region
|
|
1164
|
+
//#region ../../../../node_modules/jose/dist/webapi/jwt/sign.js
|
|
1165
1165
|
var SignJWT = class {
|
|
1166
1166
|
#protectedHeader;
|
|
1167
1167
|
#jwt;
|
|
@@ -1209,7 +1209,7 @@ var SignJWT = class {
|
|
|
1209
1209
|
};
|
|
1210
1210
|
|
|
1211
1211
|
//#endregion
|
|
1212
|
-
//#region
|
|
1212
|
+
//#region ../../../../node_modules/jose/dist/webapi/jwks/local.js
|
|
1213
1213
|
function getKtyFromAlg(alg) {
|
|
1214
1214
|
switch (typeof alg === "string" && alg.slice(0, 2)) {
|
|
1215
1215
|
case "RS":
|
|
@@ -1305,7 +1305,7 @@ function createLocalJWKSet(jwks) {
|
|
|
1305
1305
|
}
|
|
1306
1306
|
|
|
1307
1307
|
//#endregion
|
|
1308
|
-
//#region
|
|
1308
|
+
//#region ../../../../node_modules/jose/dist/webapi/jwks/remote.js
|
|
1309
1309
|
function isCloudflareWorkers() {
|
|
1310
1310
|
return typeof WebSocketPair !== "undefined" || typeof navigator !== "undefined" && navigator.userAgent === "Cloudflare-Workers" || typeof EdgeRuntime !== "undefined" && EdgeRuntime === "vercel";
|
|
1311
1311
|
}
|
|
@@ -1447,7 +1447,7 @@ function createRemoteJWKSet(url, options) {
|
|
|
1447
1447
|
}
|
|
1448
1448
|
|
|
1449
1449
|
//#endregion
|
|
1450
|
-
//#region src/security/providers/JwtProvider.ts
|
|
1450
|
+
//#region ../../src/security/providers/JwtProvider.ts
|
|
1451
1451
|
/**
|
|
1452
1452
|
* Provides utilities for working with JSON Web Tokens (JWT).
|
|
1453
1453
|
*/
|
|
@@ -1549,7 +1549,7 @@ var JwtProvider = class {
|
|
|
1549
1549
|
};
|
|
1550
1550
|
|
|
1551
1551
|
//#endregion
|
|
1552
|
-
//#region src/security/providers/SecurityProvider.ts
|
|
1552
|
+
//#region ../../src/security/providers/SecurityProvider.ts
|
|
1553
1553
|
const DEFAULT_APP_SECRET = "05759934015388327323179852515731";
|
|
1554
1554
|
const envSchema = t.object({ APP_SECRET: t.text({ default: DEFAULT_APP_SECRET }) });
|
|
1555
1555
|
var SecurityProvider = class {
|
|
@@ -1941,7 +1941,7 @@ var SecurityProvider = class {
|
|
|
1941
1941
|
};
|
|
1942
1942
|
|
|
1943
1943
|
//#endregion
|
|
1944
|
-
//#region src/security/primitives/$permission.ts
|
|
1944
|
+
//#region ../../src/security/primitives/$permission.ts
|
|
1945
1945
|
/**
|
|
1946
1946
|
* Create a new permission.
|
|
1947
1947
|
*/
|
|
@@ -1977,7 +1977,7 @@ var PermissionPrimitive = class extends Primitive {
|
|
|
1977
1977
|
$permission[KIND] = PermissionPrimitive;
|
|
1978
1978
|
|
|
1979
1979
|
//#endregion
|
|
1980
|
-
//#region src/security/primitives/$realm.ts
|
|
1980
|
+
//#region ../../src/security/primitives/$realm.ts
|
|
1981
1981
|
/**
|
|
1982
1982
|
* Create a new realm.
|
|
1983
1983
|
*/
|
|
@@ -2132,7 +2132,7 @@ var RealmPrimitive = class extends Primitive {
|
|
|
2132
2132
|
$realm[KIND] = RealmPrimitive;
|
|
2133
2133
|
|
|
2134
2134
|
//#endregion
|
|
2135
|
-
//#region src/security/primitives/$role.ts
|
|
2135
|
+
//#region ../../src/security/primitives/$role.ts
|
|
2136
2136
|
/**
|
|
2137
2137
|
* Create a new role.
|
|
2138
2138
|
*/
|
|
@@ -2170,7 +2170,7 @@ var RolePrimitive = class extends Primitive {
|
|
|
2170
2170
|
$role[KIND] = RolePrimitive;
|
|
2171
2171
|
|
|
2172
2172
|
//#endregion
|
|
2173
|
-
//#region src/security/providers/CryptoProvider.ts
|
|
2173
|
+
//#region ../../src/security/providers/CryptoProvider.ts
|
|
2174
2174
|
const scryptAsync = promisify(scrypt);
|
|
2175
2175
|
var CryptoProvider = class {
|
|
2176
2176
|
async hashPassword(password) {
|
|
@@ -2199,7 +2199,7 @@ var CryptoProvider = class {
|
|
|
2199
2199
|
};
|
|
2200
2200
|
|
|
2201
2201
|
//#endregion
|
|
2202
|
-
//#region src/security/errors/InvalidCredentialsError.ts
|
|
2202
|
+
//#region ../../src/security/errors/InvalidCredentialsError.ts
|
|
2203
2203
|
/**
|
|
2204
2204
|
* Error thrown when the provided credentials are invalid.
|
|
2205
2205
|
*
|
|
@@ -2214,7 +2214,7 @@ var InvalidCredentialsError = class extends UnauthorizedError {
|
|
|
2214
2214
|
};
|
|
2215
2215
|
|
|
2216
2216
|
//#endregion
|
|
2217
|
-
//#region src/security/primitives/$serviceAccount.ts
|
|
2217
|
+
//#region ../../src/security/primitives/$serviceAccount.ts
|
|
2218
2218
|
/**
|
|
2219
2219
|
* Allow to get an access token for a service account.
|
|
2220
2220
|
*
|
|
@@ -2314,7 +2314,7 @@ const $serviceAccount = (options) => {
|
|
|
2314
2314
|
};
|
|
2315
2315
|
|
|
2316
2316
|
//#endregion
|
|
2317
|
-
//#region src/security/schemas/permissionSchema.ts
|
|
2317
|
+
//#region ../../src/security/schemas/permissionSchema.ts
|
|
2318
2318
|
const permissionSchema = t.object({
|
|
2319
2319
|
name: t.text({ description: "Name of the permission." }),
|
|
2320
2320
|
group: t.optional(t.text({ description: "Group of the permission." })),
|
|
@@ -2324,7 +2324,7 @@ const permissionSchema = t.object({
|
|
|
2324
2324
|
});
|
|
2325
2325
|
|
|
2326
2326
|
//#endregion
|
|
2327
|
-
//#region src/security/schemas/roleSchema.ts
|
|
2327
|
+
//#region ../../src/security/schemas/roleSchema.ts
|
|
2328
2328
|
const roleSchema = t.object({
|
|
2329
2329
|
name: t.text({ description: "Name of the role." }),
|
|
2330
2330
|
description: t.optional(t.text({ description: "Describe the role." })),
|
|
@@ -2337,7 +2337,7 @@ const roleSchema = t.object({
|
|
|
2337
2337
|
});
|
|
2338
2338
|
|
|
2339
2339
|
//#endregion
|
|
2340
|
-
//#region src/security/schemas/userAccountInfoSchema.ts
|
|
2340
|
+
//#region ../../src/security/schemas/userAccountInfoSchema.ts
|
|
2341
2341
|
const userAccountInfoSchema = t.object({
|
|
2342
2342
|
id: t.text({ description: "Unique identifier for the user." }),
|
|
2343
2343
|
name: t.optional(t.text({ description: "Full name of the user." })),
|
|
@@ -2353,7 +2353,7 @@ const userAccountInfoSchema = t.object({
|
|
|
2353
2353
|
});
|
|
2354
2354
|
|
|
2355
2355
|
//#endregion
|
|
2356
|
-
//#region src/security/index.ts
|
|
2356
|
+
//#region ../../src/security/index.ts
|
|
2357
2357
|
/**
|
|
2358
2358
|
* Provides comprehensive authentication and authorization capabilities with JWT tokens, role-based access control, and user management.
|
|
2359
2359
|
*
|