alepha 0.13.2 → 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.
Files changed (91) hide show
  1. package/README.md +7 -7
  2. package/dist/api-files/index.browser.js +80 -0
  3. package/dist/api-files/index.browser.js.map +1 -0
  4. package/dist/api-files/index.d.ts +175 -175
  5. package/dist/api-jobs/index.browser.js +56 -0
  6. package/dist/api-jobs/index.browser.js.map +1 -0
  7. package/dist/api-jobs/index.d.ts +156 -156
  8. package/dist/api-notifications/index.browser.js +382 -0
  9. package/dist/api-notifications/index.browser.js.map +1 -0
  10. package/dist/api-notifications/index.d.ts +221 -166
  11. package/dist/api-notifications/index.js +107 -55
  12. package/dist/api-notifications/index.js.map +1 -1
  13. package/dist/api-parameters/index.browser.js +29 -0
  14. package/dist/api-parameters/index.browser.js.map +1 -0
  15. package/dist/api-users/index.d.ts +16 -3
  16. package/dist/api-users/index.js +75 -28
  17. package/dist/api-users/index.js.map +1 -1
  18. package/dist/api-verifications/index.browser.js +52 -0
  19. package/dist/api-verifications/index.browser.js.map +1 -0
  20. package/dist/api-verifications/index.d.ts +120 -98
  21. package/dist/api-verifications/index.js +1 -1
  22. package/dist/api-verifications/index.js.map +1 -1
  23. package/dist/batch/index.js +0 -5
  24. package/dist/batch/index.js.map +1 -1
  25. package/dist/bucket/index.js +7 -5
  26. package/dist/bucket/index.js.map +1 -1
  27. package/dist/cli/{dist-Dl9Vl7Ur.js → dist-lGnqsKpu.js} +11 -15
  28. package/dist/cli/dist-lGnqsKpu.js.map +1 -0
  29. package/dist/cli/index.d.ts +26 -45
  30. package/dist/cli/index.js +40 -58
  31. package/dist/cli/index.js.map +1 -1
  32. package/dist/command/index.d.ts +1 -0
  33. package/dist/command/index.js +9 -0
  34. package/dist/command/index.js.map +1 -1
  35. package/dist/core/index.browser.js +5 -1
  36. package/dist/core/index.browser.js.map +1 -1
  37. package/dist/core/index.d.ts +221 -219
  38. package/dist/core/index.js +5 -1
  39. package/dist/core/index.js.map +1 -1
  40. package/dist/core/index.native.js +5 -1
  41. package/dist/core/index.native.js.map +1 -1
  42. package/dist/email/index.d.ts +4 -4
  43. package/dist/email/index.js +5 -0
  44. package/dist/email/index.js.map +1 -1
  45. package/dist/orm/index.d.ts +19 -19
  46. package/dist/orm/index.js +3 -3
  47. package/dist/orm/index.js.map +1 -1
  48. package/dist/redis/index.d.ts +10 -10
  49. package/dist/security/index.d.ts +28 -28
  50. package/dist/security/index.js +3 -3
  51. package/dist/security/index.js.map +1 -1
  52. package/dist/server/index.d.ts +9 -9
  53. package/dist/server-auth/index.d.ts +152 -152
  54. package/dist/server-cookies/index.js +2 -2
  55. package/dist/server-cookies/index.js.map +1 -1
  56. package/dist/server-links/index.d.ts +33 -33
  57. package/dist/server-security/index.d.ts +9 -9
  58. package/dist/server-static/index.js +18 -2
  59. package/dist/server-static/index.js.map +1 -1
  60. package/package.json +16 -6
  61. package/src/api-files/index.browser.ts +17 -0
  62. package/src/api-jobs/index.browser.ts +15 -0
  63. package/src/api-notifications/controllers/NotificationController.ts +26 -1
  64. package/src/api-notifications/index.browser.ts +17 -0
  65. package/src/api-notifications/index.ts +1 -0
  66. package/src/api-notifications/schemas/notificationQuerySchema.ts +13 -0
  67. package/src/api-notifications/services/NotificationService.ts +45 -2
  68. package/src/api-parameters/index.browser.ts +12 -0
  69. package/src/api-users/atoms/realmAuthSettingsAtom.ts +3 -1
  70. package/src/api-users/controllers/UserController.ts +21 -1
  71. package/src/api-users/primitives/$userRealm.ts +33 -10
  72. package/src/api-users/providers/UserRealmProvider.ts +1 -0
  73. package/src/api-users/services/SessionService.ts +2 -0
  74. package/src/api-users/services/UserService.ts +56 -16
  75. package/src/api-verifications/index.browser.ts +15 -0
  76. package/src/api-verifications/index.ts +1 -0
  77. package/src/batch/providers/BatchProvider.ts +0 -7
  78. package/src/bucket/index.ts +7 -5
  79. package/src/cli/apps/AlephaCli.ts +27 -1
  80. package/src/cli/apps/AlephaPackageBuilderCli.ts +3 -0
  81. package/src/cli/commands/CoreCommands.ts +6 -2
  82. package/src/cli/commands/ViteCommands.ts +2 -1
  83. package/src/cli/services/ProjectUtils.ts +40 -75
  84. package/src/command/helpers/Asker.ts +10 -0
  85. package/src/core/Alepha.ts +14 -0
  86. package/src/core/primitives/$module.ts +1 -1
  87. package/src/email/index.ts +13 -5
  88. package/src/orm/providers/drivers/NodeSqliteProvider.ts +3 -3
  89. package/src/server-cookies/providers/ServerCookiesProvider.ts +2 -1
  90. package/src/server-static/providers/ServerStaticProvider.ts +18 -3
  91. package/dist/cli/dist-Dl9Vl7Ur.js.map +0 -1
@@ -1,13 +1,13 @@
1
- import * as alepha1 from "alepha";
1
+ import * as alepha3 from "alepha";
2
2
  import { Alepha, Static } from "alepha";
3
3
  import { RedisClientType, SetOptions, createClient } from "@redis/client";
4
4
  import * as alepha_logger0 from "alepha/logger";
5
5
 
6
6
  //#region src/redis/providers/RedisProvider.d.ts
7
- declare const envSchema: alepha1.TObject<{
8
- REDIS_PORT: alepha1.TInteger;
9
- REDIS_HOST: alepha1.TString;
10
- REDIS_PASSWORD: alepha1.TOptional<alepha1.TString>;
7
+ declare const envSchema: alepha3.TObject<{
8
+ REDIS_PORT: alepha3.TInteger;
9
+ REDIS_HOST: alepha3.TString;
10
+ REDIS_PASSWORD: alepha3.TOptional<alepha3.TString>;
11
11
  }>;
12
12
  declare module "alepha" {
13
13
  interface Env extends Partial<Static<typeof envSchema>> {}
@@ -30,8 +30,8 @@ declare class RedisProvider {
30
30
  };
31
31
  protected readonly client: RedisClient;
32
32
  get publisher(): RedisClient;
33
- protected readonly start: alepha1.HookPrimitive<"start">;
34
- protected readonly stop: alepha1.HookPrimitive<"stop">;
33
+ protected readonly start: alepha3.HookPrimitive<"start">;
34
+ protected readonly stop: alepha3.HookPrimitive<"stop">;
35
35
  /**
36
36
  * Connect to the Redis server.
37
37
  */
@@ -59,8 +59,8 @@ declare class RedisSubscriberProvider {
59
59
  protected readonly redisProvider: RedisProvider;
60
60
  protected readonly client: RedisClient;
61
61
  get subscriber(): RedisClient;
62
- protected readonly start: alepha1.HookPrimitive<"start">;
63
- protected readonly stop: alepha1.HookPrimitive<"stop">;
62
+ protected readonly start: alepha3.HookPrimitive<"start">;
63
+ protected readonly stop: alepha3.HookPrimitive<"stop">;
64
64
  connect(): Promise<void>;
65
65
  close(): Promise<void>;
66
66
  /**
@@ -76,7 +76,7 @@ declare class RedisSubscriberProvider {
76
76
  * @see {@link RedisProvider}
77
77
  * @module alepha.redis
78
78
  */
79
- declare const AlephaRedis: alepha1.Service<alepha1.Module>;
79
+ declare const AlephaRedis: alepha3.Service<alepha3.Module>;
80
80
  //#endregion
81
81
  export { AlephaRedis, RedisClient, RedisClientOptions, RedisProvider, RedisSetOptions, RedisSubscriberProvider };
82
82
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import * as alepha1 from "alepha";
1
+ import * as alepha15 from "alepha";
2
2
  import { Alepha, KIND, Primitive, Static } from "alepha";
3
3
  import * as alepha_logger0 from "alepha/logger";
4
4
  import { DateTimeProvider, Duration, DurationLike } from "alepha/datetime";
@@ -7,15 +7,15 @@ import { CryptoKey, FlattenedJWSInput, JSONWebKeySet, JWSHeaderParameters, JWTHe
7
7
  import { JWTVerifyOptions } from "jose/jwt/verify";
8
8
 
9
9
  //#region src/security/schemas/userAccountInfoSchema.d.ts
10
- declare const userAccountInfoSchema: alepha1.TObject<{
11
- id: alepha1.TString;
12
- name: alepha1.TOptional<alepha1.TString>;
13
- email: alepha1.TOptional<alepha1.TString>;
14
- username: alepha1.TOptional<alepha1.TString>;
15
- picture: alepha1.TOptional<alepha1.TString>;
16
- sessionId: alepha1.TOptional<alepha1.TString>;
17
- organizations: alepha1.TOptional<alepha1.TArray<alepha1.TString>>;
18
- roles: alepha1.TOptional<alepha1.TArray<alepha1.TString>>;
10
+ declare const userAccountInfoSchema: alepha15.TObject<{
11
+ id: alepha15.TString;
12
+ name: alepha15.TOptional<alepha15.TString>;
13
+ email: alepha15.TOptional<alepha15.TString>;
14
+ username: alepha15.TOptional<alepha15.TString>;
15
+ picture: alepha15.TOptional<alepha15.TString>;
16
+ sessionId: alepha15.TOptional<alepha15.TString>;
17
+ organizations: alepha15.TOptional<alepha15.TArray<alepha15.TString>>;
18
+ roles: alepha15.TOptional<alepha15.TArray<alepha15.TString>>;
19
19
  }>;
20
20
  type UserAccount = Static<typeof userAccountInfoSchema>;
21
21
  //#endregion
@@ -64,24 +64,24 @@ interface UserAccountToken extends UserAccount {
64
64
  }
65
65
  //#endregion
66
66
  //#region src/security/schemas/permissionSchema.d.ts
67
- declare const permissionSchema: alepha1.TObject<{
68
- name: alepha1.TString;
69
- group: alepha1.TOptional<alepha1.TString>;
70
- description: alepha1.TOptional<alepha1.TString>;
71
- method: alepha1.TOptional<alepha1.TString>;
72
- path: alepha1.TOptional<alepha1.TString>;
67
+ declare const permissionSchema: alepha15.TObject<{
68
+ name: alepha15.TString;
69
+ group: alepha15.TOptional<alepha15.TString>;
70
+ description: alepha15.TOptional<alepha15.TString>;
71
+ method: alepha15.TOptional<alepha15.TString>;
72
+ path: alepha15.TOptional<alepha15.TString>;
73
73
  }>;
74
74
  type Permission = Static<typeof permissionSchema>;
75
75
  //#endregion
76
76
  //#region src/security/schemas/roleSchema.d.ts
77
- declare const roleSchema: alepha1.TObject<{
78
- name: alepha1.TString;
79
- description: alepha1.TOptional<alepha1.TString>;
80
- default: alepha1.TOptional<alepha1.TBoolean>;
81
- permissions: alepha1.TArray<alepha1.TObject<{
82
- name: alepha1.TString;
83
- ownership: alepha1.TOptional<alepha1.TBoolean>;
84
- exclude: alepha1.TOptional<alepha1.TArray<alepha1.TString>>;
77
+ declare const roleSchema: alepha15.TObject<{
78
+ name: alepha15.TString;
79
+ description: alepha15.TOptional<alepha15.TString>;
80
+ default: alepha15.TOptional<alepha15.TBoolean>;
81
+ permissions: alepha15.TArray<alepha15.TObject<{
82
+ name: alepha15.TString;
83
+ ownership: alepha15.TOptional<alepha15.TBoolean>;
84
+ exclude: alepha15.TOptional<alepha15.TArray<alepha15.TString>>;
85
85
  }>>;
86
86
  }>;
87
87
  type Role = Static<typeof roleSchema>;
@@ -154,8 +154,8 @@ interface JwtParseResult {
154
154
  //#endregion
155
155
  //#region src/security/providers/SecurityProvider.d.ts
156
156
  declare const DEFAULT_APP_SECRET = "05759934015388327323179852515731";
157
- declare const envSchema: alepha1.TObject<{
158
- APP_SECRET: alepha1.TString;
157
+ declare const envSchema: alepha15.TObject<{
158
+ APP_SECRET: alepha15.TString;
159
159
  }>;
160
160
  declare module "alepha" {
161
161
  interface Env extends Partial<Static<typeof envSchema>> {}
@@ -179,7 +179,7 @@ declare class SecurityProvider {
179
179
  * The realms configured for the security provider.
180
180
  */
181
181
  protected readonly realms: Realm[];
182
- protected start: alepha1.HookPrimitive<"start">;
182
+ protected start: alepha15.HookPrimitive<"start">;
183
183
  /**
184
184
  * Adds a role to one or more realms.
185
185
  *
@@ -592,7 +592,7 @@ declare module "alepha" {
592
592
  * @see {@link $permission}
593
593
  * @module alepha.security
594
594
  */
595
- declare const AlephaSecurity: alepha1.Service<alepha1.Module>;
595
+ declare const AlephaSecurity: alepha15.Service<alepha15.Module>;
596
596
  //#endregion
597
597
  export { $permission, $realm, $role, $serviceAccount, AccessTokenResponse, AlephaSecurity, CreateTokenOptions, CryptoProvider, DEFAULT_APP_SECRET, ExtendedJWTPayload, InvalidCredentialsError, InvalidPermissionError, JwtParseResult, JwtProvider, JwtSignOptions, KeyLoader, KeyLoaderHolder, Oauth2ServiceAccountPrimitiveOptions, Permission, PermissionPrimitive, PermissionPrimitiveOptions, Realm, RealmExternal, RealmInternal, RealmPrimitive, RealmPrimitiveOptions, RealmSettings, Role, RolePrimitive, RolePrimitiveOptions, SecurityCheckResult, SecurityError, SecurityProvider, ServiceAccountPrimitive, ServiceAccountPrimitiveOptions, ServiceAccountStore, UserAccount, UserAccountToken, permissionSchema, roleSchema, userAccountInfoSchema };
598
598
  //# sourceMappingURL=index.d.ts.map
@@ -700,11 +700,11 @@ const asymmetricTypeCheck = (alg, key, usage) => {
700
700
  case "decrypt":
701
701
  case "sign":
702
702
  if (isPrivateJWK(key) && jwkMatchesOp(alg, key, usage)) return;
703
- throw new TypeError(`JSON Web Key for this operation be a private JWK`);
703
+ throw new TypeError(`JSON Web Key for this operation must be a private JWK`);
704
704
  case "encrypt":
705
705
  case "verify":
706
706
  if (isPublicJWK(key) && jwkMatchesOp(alg, key, usage)) return;
707
- throw new TypeError(`JSON Web Key for this operation be a public JWK`);
707
+ throw new TypeError(`JSON Web Key for this operation must be a public JWK`);
708
708
  }
709
709
  if (!isKeyLike(key)) throw new TypeError(withAlg(alg, key, "CryptoKey", "KeyObject", "JSON Web Key"));
710
710
  if (key.type === "secret") throw new TypeError(`${tag(key)} instances for asymmetric algorithms must not be of type "secret"`);
@@ -1310,7 +1310,7 @@ function isCloudflareWorkers() {
1310
1310
  return typeof WebSocketPair !== "undefined" || typeof navigator !== "undefined" && navigator.userAgent === "Cloudflare-Workers" || typeof EdgeRuntime !== "undefined" && EdgeRuntime === "vercel";
1311
1311
  }
1312
1312
  let USER_AGENT;
1313
- if (typeof navigator === "undefined" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) USER_AGENT = `jose/v6.1.2`;
1313
+ if (typeof navigator === "undefined" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) USER_AGENT = `jose/v6.1.3`;
1314
1314
  const customFetch = Symbol();
1315
1315
  async function fetchJwks(url, headers, signal, fetchImpl = fetch) {
1316
1316
  const response = await fetchImpl(url, {