alepha 0.11.2 → 0.11.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 (50) hide show
  1. package/api/files.d.ts +1 -439
  2. package/api/jobs.d.ts +1 -218
  3. package/api/notifications.d.ts +1 -264
  4. package/api/users.d.ts +1 -924
  5. package/batch.d.ts +1 -585
  6. package/bucket.d.ts +1 -507
  7. package/cache/redis.d.ts +1 -40
  8. package/cache.d.ts +1 -288
  9. package/command.d.ts +1 -238
  10. package/core.d.ts +1 -1563
  11. package/datetime.d.ts +5 -3
  12. package/devtools.d.ts +1 -368
  13. package/email.d.ts +1 -144
  14. package/fake.cjs +8 -0
  15. package/fake.d.ts +1 -0
  16. package/fake.js +1 -0
  17. package/file.d.ts +1 -53
  18. package/lock/redis.d.ts +1 -24
  19. package/lock.d.ts +1 -552
  20. package/logger.d.ts +1 -284
  21. package/package.json +57 -50
  22. package/postgres.d.ts +1 -1931
  23. package/queue/redis.d.ts +1 -29
  24. package/queue.d.ts +1 -760
  25. package/react/auth.d.ts +1 -499
  26. package/react/form.d.ts +1 -188
  27. package/react/head.d.ts +1 -120
  28. package/react/i18n.d.ts +1 -118
  29. package/react.d.ts +1 -929
  30. package/redis.d.ts +1 -82
  31. package/scheduler.d.ts +1 -145
  32. package/security.d.ts +1 -586
  33. package/server/cache.d.ts +1 -163
  34. package/server/compress.d.ts +1 -32
  35. package/server/cookies.d.ts +1 -144
  36. package/server/cors.d.ts +1 -27
  37. package/server/health.d.ts +1 -59
  38. package/server/helmet.d.ts +1 -69
  39. package/server/links.d.ts +1 -316
  40. package/server/metrics.d.ts +1 -35
  41. package/server/multipart.d.ts +1 -42
  42. package/server/proxy.d.ts +1 -234
  43. package/server/security.d.ts +1 -87
  44. package/server/static.d.ts +1 -119
  45. package/server/swagger.d.ts +1 -148
  46. package/server.d.ts +1 -849
  47. package/topic/redis.d.ts +1 -42
  48. package/topic.d.ts +1 -819
  49. package/ui.d.ts +1 -619
  50. package/vite.d.ts +1 -197
@@ -1,87 +1 @@
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
- "server.security.system.user"?: UserAccountToken;
48
- user?: UserAccount;
49
- }
50
- }
51
- declare module "alepha/server" {
52
- interface ServerRequest<TConfig> {
53
- user?: UserAccountToken;
54
- }
55
- interface ServerActionRequest<TConfig> {
56
- user: UserAccountToken;
57
- }
58
- interface ServerRoute {
59
- /**
60
- * If true, the route will be protected by the security provider.
61
- * All actions are secure by default, but you can disable it for specific actions.
62
- */
63
- secure?: boolean | ServerRouteSecure;
64
- }
65
- interface ClientRequestOptions extends FetchOptions {
66
- /**
67
- * Forward user from the previous request.
68
- * If "system", use system user. @see {ServerSecurityProvider.localSystemUser}
69
- * If "context", use the user from the current context (e.g. request).
70
- *
71
- * @default "system" if provided, else "context" if available.
72
- */
73
- user?: UserAccountToken | "system" | "context";
74
- }
75
- }
76
- /**
77
- * Plugin for Alepha Server that provides security features. Based on the Alepha Security module.
78
- *
79
- * By default, all $action will be guarded by a permission check.
80
- *
81
- * @see {@link ServerSecurityProvider}
82
- * @module alepha.server.security
83
- */
84
- declare const AlephaServerSecurity: _alepha_core1.Service<_alepha_core1.Module<{}>>;
85
- //#endregion
86
- export { AlephaServerSecurity, ServerRouteSecure, ServerSecurityProvider };
87
- //# sourceMappingURL=index.d.ts.map
1
+ export * from '@alepha/server-security';
@@ -1,119 +1 @@
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
1
+ export * from '@alepha/server-static';
@@ -1,148 +1 @@
1
- import "alepha/server/security";
2
- import * as _alepha_core1 from "alepha";
3
- import { Alepha, Descriptor, KIND, TObject } from "alepha";
4
- import { ActionDescriptor, RequestConfigSchema, ServerProvider, ServerRouterProvider } from "alepha/server";
5
- import * as _alepha_logger0 from "alepha/logger";
6
- import { ServerStaticProvider } from "alepha/server/static";
7
- import { OpenAPIV3 } from "openapi-types";
8
-
9
- //#region src/descriptors/$swagger.d.ts
10
- /**
11
- * Create a new OpenAPI.
12
- */
13
- declare const $swagger: {
14
- (options: SwaggerDescriptorOptions): SwaggerDescriptor;
15
- [KIND]: typeof SwaggerDescriptor;
16
- };
17
- interface SwaggerDescriptorOptions {
18
- info: OpenAPIV3.InfoObject;
19
- /**
20
- * @default: "/docs"
21
- */
22
- prefix?: string;
23
- /**
24
- * If true, docs will be disabled.
25
- */
26
- disabled?: boolean;
27
- /**
28
- * Tags to exclude from the documentation.
29
- */
30
- excludeTags?: string[];
31
- /**
32
- * Enable Swagger UI.
33
- *
34
- * @default true
35
- */
36
- ui?: boolean | SwaggerUiOptions;
37
- /**
38
- * Function to rewrite the OpenAPI document before serving it.
39
- */
40
- rewrite?: (doc: OpenAPIV3.Document) => void;
41
- }
42
- interface SwaggerUiOptions {
43
- root?: string;
44
- initOAuth?: {
45
- /**
46
- * Default clientId.
47
- */
48
- clientId?: string;
49
- /**
50
- * realm query parameter (for oauth1) added to authorizationUrl and tokenUrl.
51
- */
52
- realm?: string;
53
- /**
54
- * application name, displayed in authorization popup.
55
- */
56
- appName?: string;
57
- /**
58
- * scope separator for passing scopes, encoded before calling, default
59
- * value is a space (encoded value %20).
60
- *
61
- * @default ' '
62
- */
63
- scopeSeparator?: string;
64
- /**
65
- * string array or scope separator (i.e. space) separated string of
66
- * initially selected oauth scopes
67
- *
68
- * @default []
69
- */
70
- scopes?: string | string[];
71
- /**
72
- * Additional query parameters added to authorizationUrl and tokenUrl.
73
- * MUST be an object
74
- */
75
- additionalQueryStringParams?: {
76
- [key: string]: any;
77
- };
78
- /**
79
- * Only activated for the accessCode flow. During the authorization_code
80
- * request to the tokenUrl, pass the Client Password using the HTTP Basic
81
- * Authentication scheme (Authorization header with Basic
82
- * base64encode(client_id + client_secret)).
83
- *
84
- * @default false
85
- */
86
- useBasicAuthenticationWithAccessCodeGrant?: boolean;
87
- /**
88
- * Only applies to Authorization Code flows. Proof Key for Code Exchange
89
- * brings enhanced security for OAuth public clients.
90
- *
91
- * @default false
92
- */
93
- usePkceWithAuthorizationCodeGrant?: boolean;
94
- };
95
- }
96
- declare class SwaggerDescriptor extends Descriptor<SwaggerDescriptorOptions> {}
97
- //#endregion
98
- //#region src/ServerSwaggerProvider.d.ts
99
- declare class ServerSwaggerProvider {
100
- protected readonly serverStaticProvider: ServerStaticProvider;
101
- protected readonly serverRouterProvider: ServerRouterProvider;
102
- protected readonly serverProvider: ServerProvider;
103
- protected readonly alepha: Alepha;
104
- protected readonly log: _alepha_logger0.Logger;
105
- json?: OpenAPIV3.Document;
106
- options: {
107
- excludeKeys: string[];
108
- };
109
- protected readonly configure: _alepha_core1.HookDescriptor<"configure">;
110
- createSwagger(options: SwaggerDescriptorOptions): Promise<OpenAPIV3.Document | undefined>;
111
- protected configureOpenApi(actions: ActionDescriptor<RequestConfigSchema>[], doc: SwaggerDescriptorOptions): OpenAPIV3.Document;
112
- isBodyMultipart(schema: TObject): boolean;
113
- replacePathParams(url: string): string;
114
- getResponseSchema(route: ActionDescriptor<RequestConfigSchema>): {
115
- type?: string;
116
- schema?: any;
117
- status: number;
118
- } | undefined;
119
- protected configureSwaggerApi(prefix: string, json: OpenAPIV3.Document): void;
120
- protected configureSwaggerUi(prefix: string, options: SwaggerDescriptorOptions): Promise<void>;
121
- removePrivateFields<T extends Record<string, any>>(obj: T, excludeList: string[]): T;
122
- }
123
- //#endregion
124
- //#region src/index.d.ts
125
- declare module "alepha/server" {
126
- interface ActionDescriptorOptions<TConfig extends RequestConfigSchema> {
127
- /**
128
- * Short description of the route.
129
- */
130
- summary?: string;
131
- /**
132
- * Don't include this action in the Swagger documentation.
133
- */
134
- hide?: boolean;
135
- }
136
- }
137
- /**
138
- * Plugin for Alepha Server that provides Swagger documentation capabilities.
139
- * It generates OpenAPI v3 documentation for the server's endpoints ($action).
140
- * It also provides a Swagger UI for interactive API documentation.
141
- *
142
- * @see {@link ServerSwaggerProvider}
143
- * @module alepha.server.swagger
144
- */
145
- declare const AlephaServerSwagger: _alepha_core1.Service<_alepha_core1.Module<{}>>;
146
- //#endregion
147
- export { $swagger, AlephaServerSwagger, ServerSwaggerProvider, SwaggerDescriptor, SwaggerDescriptorOptions, SwaggerUiOptions };
148
- //# sourceMappingURL=index.d.ts.map
1
+ export * from '@alepha/server-swagger';