alepha 0.11.9 → 0.11.11

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 (167) hide show
  1. package/README.md +61 -17
  2. package/dist/index.cjs +17089 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +1 -0
  5. package/dist/index.d.ts +2 -0
  6. package/dist/index.js +17088 -0
  7. package/dist/index.js.map +1 -0
  8. package/package.json +42 -365
  9. package/src/assets/biomeJson.ts +33 -0
  10. package/src/assets/tsconfigJson.ts +18 -0
  11. package/src/assets/viteConfigTs.ts +14 -0
  12. package/src/commands/BiomeCommands.ts +41 -0
  13. package/src/commands/CoreCommands.ts +169 -0
  14. package/src/commands/DrizzleCommands.ts +228 -0
  15. package/src/commands/VerifyCommands.ts +44 -0
  16. package/src/commands/ViteCommands.ts +119 -0
  17. package/src/index.ts +35 -0
  18. package/src/services/ProcessRunner.ts +89 -0
  19. package/src/services/ProjectUtils.ts +508 -0
  20. package/src/version.ts +7 -0
  21. package/api/files.cjs +0 -8
  22. package/api/files.d.ts +0 -438
  23. package/api/files.js +0 -1
  24. package/api/jobs.cjs +0 -8
  25. package/api/jobs.d.ts +0 -327
  26. package/api/jobs.js +0 -1
  27. package/api/notifications.cjs +0 -8
  28. package/api/notifications.d.ts +0 -263
  29. package/api/notifications.js +0 -1
  30. package/api/users.cjs +0 -8
  31. package/api/users.d.ts +0 -923
  32. package/api/users.js +0 -1
  33. package/api/verifications.cjs +0 -8
  34. package/api/verifications.d.ts +0 -1
  35. package/api/verifications.js +0 -1
  36. package/batch.cjs +0 -8
  37. package/batch.d.ts +0 -154
  38. package/batch.js +0 -1
  39. package/bucket.cjs +0 -8
  40. package/bucket.d.ts +0 -520
  41. package/bucket.js +0 -1
  42. package/cache/redis.cjs +0 -8
  43. package/cache/redis.d.ts +0 -40
  44. package/cache/redis.js +0 -1
  45. package/cache.cjs +0 -8
  46. package/cache.d.ts +0 -288
  47. package/cache.js +0 -1
  48. package/command.cjs +0 -8
  49. package/command.d.ts +0 -269
  50. package/command.js +0 -1
  51. package/core.cjs +0 -8
  52. package/core.d.ts +0 -1904
  53. package/core.js +0 -1
  54. package/datetime.cjs +0 -8
  55. package/datetime.d.ts +0 -144
  56. package/datetime.js +0 -1
  57. package/devtools.cjs +0 -8
  58. package/devtools.d.ts +0 -252
  59. package/devtools.js +0 -1
  60. package/email.cjs +0 -8
  61. package/email.d.ts +0 -187
  62. package/email.js +0 -1
  63. package/fake.cjs +0 -8
  64. package/fake.d.ts +0 -73
  65. package/fake.js +0 -1
  66. package/file.cjs +0 -8
  67. package/file.d.ts +0 -528
  68. package/file.js +0 -1
  69. package/lock/redis.cjs +0 -8
  70. package/lock/redis.d.ts +0 -24
  71. package/lock/redis.js +0 -1
  72. package/lock.cjs +0 -8
  73. package/lock.d.ts +0 -552
  74. package/lock.js +0 -1
  75. package/logger.cjs +0 -8
  76. package/logger.d.ts +0 -287
  77. package/logger.js +0 -1
  78. package/postgres.cjs +0 -8
  79. package/postgres.d.ts +0 -2143
  80. package/postgres.js +0 -1
  81. package/queue/redis.cjs +0 -8
  82. package/queue/redis.d.ts +0 -29
  83. package/queue/redis.js +0 -1
  84. package/queue.cjs +0 -8
  85. package/queue.d.ts +0 -760
  86. package/queue.js +0 -1
  87. package/react/auth.cjs +0 -8
  88. package/react/auth.d.ts +0 -504
  89. package/react/auth.js +0 -1
  90. package/react/form.cjs +0 -8
  91. package/react/form.d.ts +0 -211
  92. package/react/form.js +0 -1
  93. package/react/head.cjs +0 -8
  94. package/react/head.d.ts +0 -120
  95. package/react/head.js +0 -1
  96. package/react/i18n.cjs +0 -8
  97. package/react/i18n.d.ts +0 -168
  98. package/react/i18n.js +0 -1
  99. package/react.cjs +0 -8
  100. package/react.d.ts +0 -1263
  101. package/react.js +0 -1
  102. package/redis.cjs +0 -8
  103. package/redis.d.ts +0 -82
  104. package/redis.js +0 -1
  105. package/retry.cjs +0 -8
  106. package/retry.d.ts +0 -162
  107. package/retry.js +0 -1
  108. package/router.cjs +0 -8
  109. package/router.d.ts +0 -45
  110. package/router.js +0 -1
  111. package/scheduler.cjs +0 -8
  112. package/scheduler.d.ts +0 -145
  113. package/scheduler.js +0 -1
  114. package/security.cjs +0 -8
  115. package/security.d.ts +0 -586
  116. package/security.js +0 -1
  117. package/server/cache.cjs +0 -8
  118. package/server/cache.d.ts +0 -163
  119. package/server/cache.js +0 -1
  120. package/server/compress.cjs +0 -8
  121. package/server/compress.d.ts +0 -38
  122. package/server/compress.js +0 -1
  123. package/server/cookies.cjs +0 -8
  124. package/server/cookies.d.ts +0 -144
  125. package/server/cookies.js +0 -1
  126. package/server/cors.cjs +0 -8
  127. package/server/cors.d.ts +0 -45
  128. package/server/cors.js +0 -1
  129. package/server/health.cjs +0 -8
  130. package/server/health.d.ts +0 -58
  131. package/server/health.js +0 -1
  132. package/server/helmet.cjs +0 -8
  133. package/server/helmet.d.ts +0 -98
  134. package/server/helmet.js +0 -1
  135. package/server/links.cjs +0 -8
  136. package/server/links.d.ts +0 -322
  137. package/server/links.js +0 -1
  138. package/server/metrics.cjs +0 -8
  139. package/server/metrics.d.ts +0 -35
  140. package/server/metrics.js +0 -1
  141. package/server/multipart.cjs +0 -8
  142. package/server/multipart.d.ts +0 -42
  143. package/server/multipart.js +0 -1
  144. package/server/proxy.cjs +0 -8
  145. package/server/proxy.d.ts +0 -234
  146. package/server/proxy.js +0 -1
  147. package/server/security.cjs +0 -8
  148. package/server/security.d.ts +0 -92
  149. package/server/security.js +0 -1
  150. package/server/static.cjs +0 -8
  151. package/server/static.d.ts +0 -119
  152. package/server/static.js +0 -1
  153. package/server/swagger.cjs +0 -8
  154. package/server/swagger.d.ts +0 -161
  155. package/server/swagger.js +0 -1
  156. package/server.cjs +0 -8
  157. package/server.d.ts +0 -849
  158. package/server.js +0 -1
  159. package/topic/redis.cjs +0 -8
  160. package/topic/redis.d.ts +0 -42
  161. package/topic/redis.js +0 -1
  162. package/topic.cjs +0 -8
  163. package/topic.d.ts +0 -819
  164. package/topic.js +0 -1
  165. package/vite.cjs +0 -8
  166. package/vite.d.ts +0 -186
  167. package/vite.js +0 -1
@@ -1,92 +0,0 @@
1
- import * as _alepha_core1 from "alepha";
2
- import { Alepha } from "alepha";
3
- import { JwtProvider, Permission, SecurityProvider, UserAccount, UserAccountToken } from "alepha/security";
4
- import { FetchOptions } from "alepha/server";
5
- import * as _alepha_logger0 from "alepha/logger";
6
-
7
- //#region src/providers/ServerSecurityProvider.d.ts
8
- declare class ServerSecurityProvider {
9
- protected readonly log: _alepha_logger0.Logger;
10
- protected readonly securityProvider: SecurityProvider;
11
- protected readonly jwtProvider: JwtProvider;
12
- protected readonly alepha: Alepha;
13
- protected readonly onConfigure: _alepha_core1.HookDescriptor<"configure">;
14
- protected readonly onActionRequest: _alepha_core1.HookDescriptor<"action:onRequest">;
15
- protected readonly onRequest: _alepha_core1.HookDescriptor<"server:onRequest">;
16
- protected check(user: UserAccountToken, secure: ServerRouteSecure): void;
17
- /**
18
- * Get the user account token for a local action call.
19
- * There are three possible sources for the user:
20
- * - `options.user`: the user passed in the options
21
- * - `"system"`: the system user from the state (you MUST set state `server.security.system.user`)
22
- * - `"context"`: the user from the request context (you MUST be in an HTTP request context)
23
- *
24
- * Priority order: `options.user` > `"system"` > `"context"`.
25
- *
26
- * In testing environment, if no user is provided, a test user is created based on the SecurityProvider's roles.
27
- */
28
- protected createUserFromLocalFunctionContext(options: {
29
- user?: UserAccountToken | "system" | "context";
30
- }, permission?: Permission): UserAccountToken;
31
- protected createTestUser(): UserAccountToken;
32
- protected readonly onClientRequest: _alepha_core1.HookDescriptor<"client:onRequest">;
33
- }
34
- type ServerRouteSecure = {
35
- realm?: string;
36
- };
37
- //#endregion
38
- //#region src/index.d.ts
39
- declare module "alepha" {
40
- interface State {
41
- /**
42
- * Real (or fake) user account, used for internal actions.
43
- *
44
- * If you define this, you assume that all actions are executed by this user by default.
45
- * > To force a different user, you need to pass it explicitly in the options.
46
- */
47
- "alepha.server.security.system.user"?: UserAccountToken;
48
- /**
49
- * The authenticated user account attached to the server request state.
50
- *
51
- * @internal
52
- */
53
- "alepha.server.request.user"?: UserAccount;
54
- }
55
- }
56
- declare module "alepha/server" {
57
- interface ServerRequest<TConfig> {
58
- user?: UserAccountToken;
59
- }
60
- interface ServerActionRequest<TConfig> {
61
- user: UserAccountToken;
62
- }
63
- interface ServerRoute {
64
- /**
65
- * If true, the route will be protected by the security provider.
66
- * All actions are secure by default, but you can disable it for specific actions.
67
- */
68
- secure?: boolean | ServerRouteSecure;
69
- }
70
- interface ClientRequestOptions extends FetchOptions {
71
- /**
72
- * Forward user from the previous request.
73
- * If "system", use system user. @see {ServerSecurityProvider.localSystemUser}
74
- * If "context", use the user from the current context (e.g. request).
75
- *
76
- * @default "system" if provided, else "context" if available.
77
- */
78
- user?: UserAccountToken | "system" | "context";
79
- }
80
- }
81
- /**
82
- * Plugin for Alepha Server that provides security features. Based on the Alepha Security module.
83
- *
84
- * By default, all $action will be guarded by a permission check.
85
- *
86
- * @see {@link ServerSecurityProvider}
87
- * @module alepha.server.security
88
- */
89
- declare const AlephaServerSecurity: _alepha_core1.Service<_alepha_core1.Module>;
90
- //#endregion
91
- export { AlephaServerSecurity, ServerRouteSecure, ServerSecurityProvider };
92
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- export * from '@alepha/server-security'
package/server/static.cjs DELETED
@@ -1,8 +0,0 @@
1
- 'use strict';
2
- var m = require('@alepha/server-static');
3
- Object.keys(m).forEach(function (k) {
4
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
5
- enumerable: true,
6
- get: function () { return m[k]; }
7
- });
8
- });
@@ -1,119 +0,0 @@
1
- import * as _alepha_core1 from "alepha";
2
- import { Alepha, Descriptor, KIND } from "alepha";
3
- import { ServerHandler, ServerRouterProvider } from "alepha/server";
4
- import { DateTimeProvider, DurationLike } from "alepha/datetime";
5
- import * as _alepha_logger0 from "alepha/logger";
6
-
7
- //#region src/descriptors/$serve.d.ts
8
- /**
9
- * Create a new static file handler.
10
- */
11
- declare const $serve: {
12
- (options?: ServeDescriptorOptions): ServeDescriptor;
13
- [KIND]: typeof ServeDescriptor;
14
- };
15
- interface ServeDescriptorOptions {
16
- /**
17
- * Prefix for the served path.
18
- *
19
- * @default "/"
20
- */
21
- path?: string;
22
- /**
23
- * Path to the directory to serve.
24
- *
25
- * @default process.cwd()
26
- */
27
- root?: string;
28
- /**
29
- * If true, descriptor will be ignored.
30
- *
31
- * @default false
32
- */
33
- disabled?: boolean;
34
- /**
35
- * Whether to keep dot files (e.g. `.gitignore`, `.env`) in the served directory.
36
- *
37
- * @default true
38
- */
39
- ignoreDotEnvFiles?: boolean;
40
- /**
41
- * Whether to use the index.html file when the path is a directory.
42
- *
43
- * @default true
44
- */
45
- indexFallback?: boolean;
46
- /**
47
- * Force all requests "not found" to be served with the index.html file.
48
- * This is useful for single-page applications (SPAs) that use client-side only routing.
49
- */
50
- historyApiFallback?: boolean;
51
- /**
52
- * Optional name of the descriptor.
53
- * This is used for logging and debugging purposes.
54
- *
55
- * @default Key name.
56
- */
57
- name?: string;
58
- /**
59
- * Whether to use cache control headers.
60
- *
61
- * @default {}
62
- */
63
- cacheControl?: Partial<CacheControlOptions> | false;
64
- }
65
- interface CacheControlOptions {
66
- /**
67
- * Whether to use cache control headers.
68
- *
69
- * @default [.js, .css]
70
- */
71
- fileTypes: string[];
72
- /**
73
- * The maximum age of the cache in seconds.
74
- *
75
- * @default 60 * 60 * 24 * 2 // 2 days
76
- */
77
- maxAge: DurationLike;
78
- /**
79
- * Whether to use immutable cache control headers.
80
- *
81
- * @default true
82
- */
83
- immutable: boolean;
84
- }
85
- declare class ServeDescriptor extends Descriptor<ServeDescriptorOptions> {}
86
- //#endregion
87
- //#region src/providers/ServerStaticProvider.d.ts
88
- declare class ServerStaticProvider {
89
- protected readonly alepha: Alepha;
90
- protected readonly routerProvider: ServerRouterProvider;
91
- protected readonly dateTimeProvider: DateTimeProvider;
92
- protected readonly log: _alepha_logger0.Logger;
93
- protected readonly directories: ServeDirectory[];
94
- protected readonly configure: _alepha_core1.HookDescriptor<"configure">;
95
- createStaticServer(options: ServeDescriptorOptions): Promise<void>;
96
- createFileHandler(filepath: string, options: ServeDescriptorOptions): Promise<ServerHandler>;
97
- protected getCacheFileTypes(): string[];
98
- protected getCacheControl(filename: string, options: ServeDescriptorOptions): {
99
- maxAge: number;
100
- immutable: boolean;
101
- } | undefined;
102
- getAllFiles(dir: string, ignoreDotEnvFiles?: boolean): Promise<string[]>;
103
- }
104
- interface ServeDirectory {
105
- options: ServeDescriptorOptions;
106
- files: string[];
107
- }
108
- //#endregion
109
- //#region src/index.d.ts
110
- /**
111
- * Create static file server with `$static()`.
112
- *
113
- * @see {@link ServerStaticProvider}
114
- * @module alepha.server.static
115
- */
116
- declare const AlephaServerStatic: _alepha_core1.Service<_alepha_core1.Module>;
117
- //#endregion
118
- export { $serve, AlephaServerStatic, CacheControlOptions, ServeDescriptor, ServeDescriptorOptions, ServeDirectory, ServerStaticProvider };
119
- //# sourceMappingURL=index.d.ts.map
package/server/static.js DELETED
@@ -1 +0,0 @@
1
- export * from '@alepha/server-static'
@@ -1,8 +0,0 @@
1
- 'use strict';
2
- var m = require('@alepha/server-swagger');
3
- Object.keys(m).forEach(function (k) {
4
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
5
- enumerable: true,
6
- get: function () { return m[k]; }
7
- });
8
- });
@@ -1,161 +0,0 @@
1
- import "alepha/server/security";
2
- import * as _alepha_core1 from "alepha";
3
- import { Alepha, Descriptor, KIND, Static, TObject } from "alepha";
4
- import { ActionDescriptor, RequestConfigSchema, ServerProvider, ServerRouterProvider } from "alepha/server";
5
- import { ServerStaticProvider } from "alepha/server/static";
6
- import * as _alepha_logger0 from "alepha/logger";
7
- import { OpenAPIV3 } from "openapi-types";
8
- import * as typebox0 from "typebox";
9
-
10
- //#region src/descriptors/$swagger.d.ts
11
- /**
12
- * Create a new OpenAPI.
13
- */
14
- declare const $swagger: {
15
- (options?: SwaggerDescriptorOptions): SwaggerDescriptor;
16
- [KIND]: typeof SwaggerDescriptor;
17
- };
18
- interface SwaggerDescriptorOptions {
19
- info?: OpenAPIV3.InfoObject;
20
- /**
21
- * @default: "/docs"
22
- */
23
- prefix?: string;
24
- /**
25
- * If true, docs will be disabled.
26
- */
27
- disabled?: boolean;
28
- /**
29
- * Tags to exclude from the documentation.
30
- */
31
- excludeTags?: string[];
32
- /**
33
- * Enable Swagger UI.
34
- *
35
- * @default true
36
- */
37
- ui?: boolean | SwaggerUiOptions;
38
- /**
39
- * Function to rewrite the OpenAPI document before serving it.
40
- */
41
- rewrite?: (doc: OpenAPIV3.Document) => void;
42
- }
43
- interface SwaggerUiOptions {
44
- root?: string;
45
- initOAuth?: {
46
- /**
47
- * Default clientId.
48
- */
49
- clientId?: string;
50
- /**
51
- * realm query parameter (for oauth1) added to authorizationUrl and tokenUrl.
52
- */
53
- realm?: string;
54
- /**
55
- * application name, displayed in authorization popup.
56
- */
57
- appName?: string;
58
- /**
59
- * scope separator for passing scopes, encoded before calling, default
60
- * value is a space (encoded value %20).
61
- *
62
- * @default ' '
63
- */
64
- scopeSeparator?: string;
65
- /**
66
- * string array or scope separator (i.e. space) separated string of
67
- * initially selected oauth scopes
68
- *
69
- * @default []
70
- */
71
- scopes?: string | string[];
72
- /**
73
- * Additional query parameters added to authorizationUrl and tokenUrl.
74
- * MUST be an object
75
- */
76
- additionalQueryStringParams?: {
77
- [key: string]: any;
78
- };
79
- /**
80
- * Only activated for the accessCode flow. During the authorization_code
81
- * request to the tokenUrl, pass the Client Password using the HTTP Basic
82
- * Authentication scheme (Authorization header with Basic
83
- * base64encode(client_id + client_secret)).
84
- *
85
- * @default false
86
- */
87
- useBasicAuthenticationWithAccessCodeGrant?: boolean;
88
- /**
89
- * Only applies to Authorization Code flows. Proof Key for Code Exchange
90
- * brings enhanced security for OAuth public clients.
91
- *
92
- * @default false
93
- */
94
- usePkceWithAuthorizationCodeGrant?: boolean;
95
- };
96
- }
97
- declare class SwaggerDescriptor extends Descriptor<SwaggerDescriptorOptions> {}
98
- //#endregion
99
- //#region src/ServerSwaggerProvider.d.ts
100
- /**
101
- * Swagger provider configuration atom
102
- */
103
- declare const swaggerOptions: _alepha_core1.Atom<TObject<{
104
- excludeKeys: typebox0.TOptional<typebox0.TArray<typebox0.TString>>;
105
- }>, "alepha.server.swagger.options">;
106
- type ServerSwaggerProviderOptions = Static<typeof swaggerOptions.schema>;
107
- declare module "alepha" {
108
- interface State {
109
- [swaggerOptions.key]: ServerSwaggerProviderOptions;
110
- }
111
- }
112
- declare class ServerSwaggerProvider {
113
- protected readonly serverStaticProvider: ServerStaticProvider;
114
- protected readonly serverRouterProvider: ServerRouterProvider;
115
- protected readonly serverProvider: ServerProvider;
116
- protected readonly alepha: Alepha;
117
- protected readonly log: _alepha_logger0.Logger;
118
- protected readonly options: Readonly<{
119
- excludeKeys?: string[] | undefined;
120
- }>;
121
- json?: OpenAPIV3.Document;
122
- protected readonly configure: _alepha_core1.HookDescriptor<"configure">;
123
- createSwagger(options: SwaggerDescriptorOptions): Promise<OpenAPIV3.Document | undefined>;
124
- protected configureOpenApi(actions: ActionDescriptor<RequestConfigSchema>[], doc: SwaggerDescriptorOptions): OpenAPIV3.Document;
125
- isBodyMultipart(schema: TObject): boolean;
126
- replacePathParams(url: string): string;
127
- getResponseSchema(route: ActionDescriptor<RequestConfigSchema>): {
128
- type?: string;
129
- schema?: any;
130
- status: number;
131
- } | undefined;
132
- protected configureSwaggerApi(prefix: string, json: OpenAPIV3.Document): void;
133
- protected configureSwaggerUi(prefix: string, options: SwaggerDescriptorOptions): Promise<void>;
134
- removePrivateFields<T extends Record<string, any>>(obj: T, excludeList: string[]): T;
135
- }
136
- //#endregion
137
- //#region src/index.d.ts
138
- declare module "alepha/server" {
139
- interface ActionDescriptorOptions<TConfig extends RequestConfigSchema> {
140
- /**
141
- * Short description of the route.
142
- */
143
- summary?: string;
144
- /**
145
- * Don't include this action in the Swagger documentation.
146
- */
147
- hide?: boolean;
148
- }
149
- }
150
- /**
151
- * Plugin for Alepha Server that provides Swagger documentation capabilities.
152
- * It generates OpenAPI v3 documentation for the server's endpoints ($action).
153
- * It also provides a Swagger UI for interactive API documentation.
154
- *
155
- * @see {@link ServerSwaggerProvider}
156
- * @module alepha.server.swagger
157
- */
158
- declare const AlephaServerSwagger: _alepha_core1.Service<_alepha_core1.Module>;
159
- //#endregion
160
- export { $swagger, AlephaServerSwagger, ServerSwaggerProvider, ServerSwaggerProviderOptions, SwaggerDescriptor, SwaggerDescriptorOptions, SwaggerUiOptions, swaggerOptions };
161
- //# sourceMappingURL=index.d.ts.map
package/server/swagger.js DELETED
@@ -1 +0,0 @@
1
- export * from '@alepha/server-swagger'
package/server.cjs DELETED
@@ -1,8 +0,0 @@
1
- 'use strict';
2
- var m = require('@alepha/server');
3
- Object.keys(m).forEach(function (k) {
4
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
5
- enumerable: true,
6
- get: function () { return m[k]; }
7
- });
8
- });