alepha 0.9.3 → 0.9.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.
@@ -1,28 +1,29 @@
1
- import * as _alepha_core0 from "alepha";
2
- import { Alepha, HookDescriptor } from "alepha";
1
+ import * as _alepha_core1 from "alepha";
2
+ import { Alepha } from "alepha";
3
3
 
4
4
  //#region src/providers/ServerHelmetProvider.d.ts
5
5
  type CspDirective = string | string[];
6
+ interface CspDirectives {
7
+ "default-src"?: CspDirective;
8
+ "script-src"?: CspDirective;
9
+ "style-src"?: CspDirective;
10
+ "img-src"?: CspDirective;
11
+ "connect-src"?: CspDirective;
12
+ "font-src"?: CspDirective;
13
+ "object-src"?: CspDirective;
14
+ "media-src"?: CspDirective;
15
+ "frame-src"?: CspDirective;
16
+ sandbox?: CspDirective | boolean;
17
+ "report-uri"?: string;
18
+ "child-src"?: CspDirective;
19
+ "form-action"?: CspDirective;
20
+ "frame-ancestors"?: CspDirective;
21
+ "plugin-types"?: CspDirective;
22
+ "base-uri"?: CspDirective;
23
+ [key: string]: CspDirective | undefined | boolean;
24
+ }
6
25
  interface CspOptions {
7
- directives: {
8
- "default-src"?: CspDirective;
9
- "script-src"?: CspDirective;
10
- "style-src"?: CspDirective;
11
- "img-src"?: CspDirective;
12
- "connect-src"?: CspDirective;
13
- "font-src"?: CspDirective;
14
- "object-src"?: CspDirective;
15
- "media-src"?: CspDirective;
16
- "frame-src"?: CspDirective;
17
- sandbox?: CspDirective | boolean;
18
- "report-uri"?: string;
19
- "child-src"?: CspDirective;
20
- "form-action"?: CspDirective;
21
- "frame-ancestors"?: CspDirective;
22
- "plugin-types"?: CspDirective;
23
- "base-uri"?: CspDirective;
24
- [key: string]: CspDirective | undefined | boolean;
25
- };
26
+ directives: CspDirectives;
26
27
  }
27
28
  interface HstsOptions {
28
29
  maxAge?: number;
@@ -35,7 +36,7 @@ interface HelmetOptions {
35
36
  xContentTypeOptions?: false;
36
37
  xFrameOptions?: "DENY" | "SAMEORIGIN" | false;
37
38
  xXssProtection?: false;
38
- contentSecurityPolicy?: CspOptions | false;
39
+ contentSecurityPolicy?: CspOptions | false | "default";
39
40
  referrerPolicy?: "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url" | false;
40
41
  }
41
42
  /**
@@ -49,8 +50,9 @@ declare class ServerHelmetProvider {
49
50
  * the application's configuration phase using `alepha.configure()`.
50
51
  */
51
52
  options: HelmetOptions;
52
- private buildHeaders;
53
- protected readonly onResponse: HookDescriptor<"server:onResponse">;
53
+ protected defaultCspDirectives(): CspDirectives;
54
+ protected buildHeaders(): Record<string, string>;
55
+ protected readonly onResponse: _alepha_core1.HookDescriptor<"server:onResponse">;
54
56
  }
55
57
  //#endregion
56
58
  //#region src/index.d.ts
@@ -61,9 +63,7 @@ declare class ServerHelmetProvider {
61
63
  * @see {@link ServerHelmetProvider}
62
64
  * @module alepha.server.helmet
63
65
  */
64
- declare const AlephaServerHelmet: _alepha_core0.Service<_alepha_core0.Module>;
65
- //# sourceMappingURL=index.d.ts.map
66
-
66
+ declare const AlephaServerHelmet: _alepha_core1.Service<_alepha_core1.Module>;
67
67
  //#endregion
68
- export { AlephaServerHelmet, CspOptions, HelmetOptions, HstsOptions, ServerHelmetProvider };
68
+ export { AlephaServerHelmet, CspDirectives, CspOptions, HelmetOptions, HstsOptions, ServerHelmetProvider };
69
69
  //# sourceMappingURL=index.d.ts.map
package/server/links.d.ts CHANGED
@@ -1,33 +1,83 @@
1
+ import "alepha/server/security";
1
2
  import * as _alepha_core2 from "alepha";
2
- import * as _alepha_core1 from "alepha";
3
- import * as _alepha_core0 from "alepha";
4
- import { Alepha, Descriptor, KIND, Logger } from "alepha";
3
+ import { Alepha, Descriptor, KIND, Static } from "alepha";
5
4
  import * as _alepha_server0 from "alepha/server";
6
- import { ActionDescriptor, ApiLink, ApiLinksResponse, ClientRequestEntry, ClientRequestOptions, ClientRequestResponse, FetchResponse, HttpClient, RequestConfigSchema, ServerHandler, ServerRequestConfigEntry } from "alepha/server";
5
+ import { ActionDescriptor, ClientRequestEntry, ClientRequestOptions, ClientRequestResponse, FetchResponse, HttpClient, RequestConfigSchema, ServerHandler, ServerRequestConfigEntry, ServerTimingProvider } from "alepha/server";
6
+ import * as _alepha_logger0 from "alepha/logger";
7
7
  import * as _alepha_retry0 from "alepha/retry";
8
8
  import { ProxyDescriptorOptions, ServerProxyProvider } from "alepha/server/proxy";
9
9
  import { ServiceAccountDescriptor, UserAccountToken } from "alepha/security";
10
- import * as _sinclair_typebox0 from "@sinclair/typebox";
10
+ import * as _sinclair_typebox19 from "@sinclair/typebox";
11
11
 
12
+ //#region src/schemas/apiLinksResponseSchema.d.ts
13
+ declare const apiLinkSchema: _sinclair_typebox19.TObject<{
14
+ name: _sinclair_typebox19.TString;
15
+ group: _sinclair_typebox19.TOptional<_sinclair_typebox19.TString>;
16
+ path: _sinclair_typebox19.TString;
17
+ method: _sinclair_typebox19.TOptional<_sinclair_typebox19.TString>;
18
+ requestBodyType: _sinclair_typebox19.TOptional<_sinclair_typebox19.TString>;
19
+ service: _sinclair_typebox19.TOptional<_sinclair_typebox19.TString>;
20
+ }>;
21
+ declare const apiLinksResponseSchema: _sinclair_typebox19.TObject<{
22
+ prefix: _sinclair_typebox19.TOptional<_sinclair_typebox19.TString>;
23
+ links: _sinclair_typebox19.TArray<_sinclair_typebox19.TObject<{
24
+ name: _sinclair_typebox19.TString;
25
+ group: _sinclair_typebox19.TOptional<_sinclair_typebox19.TString>;
26
+ path: _sinclair_typebox19.TString;
27
+ method: _sinclair_typebox19.TOptional<_sinclair_typebox19.TString>;
28
+ requestBodyType: _sinclair_typebox19.TOptional<_sinclair_typebox19.TString>;
29
+ service: _sinclair_typebox19.TOptional<_sinclair_typebox19.TString>;
30
+ }>>;
31
+ }>;
32
+ type ApiLinksResponse = Static<typeof apiLinksResponseSchema>;
33
+ type ApiLink = Static<typeof apiLinkSchema>;
34
+ //#endregion
12
35
  //#region src/providers/LinkProvider.d.ts
36
+ /**
37
+ * Browser, SSR friendly, service to handle links.
38
+ */
13
39
  declare class LinkProvider {
14
- readonly URL_LINKS = "/api/_links";
15
- protected readonly log: Logger;
40
+ static path: {
41
+ apiLinks: string;
42
+ apiSchema: string;
43
+ };
44
+ protected readonly log: _alepha_logger0.Logger;
16
45
  protected readonly alepha: Alepha;
17
46
  protected readonly httpClient: HttpClient;
18
- links?: Array<HttpClientLink>;
19
- pushLink(link: HttpClientLink): void;
20
- getLinks(force?: boolean): Promise<HttpClientLink[]>;
47
+ protected serverLinks: Array<HttpClientLink>;
48
+ /**
49
+ * Get applicative links registered on the server.
50
+ * This does not include lazy-loaded remote links.
51
+ */
52
+ getServerLinks(): HttpClientLink[];
53
+ /**
54
+ * Register a new link for the application.
55
+ */
56
+ registerLink(link: HttpClientLink): void;
57
+ get links(): HttpClientLink[];
58
+ /**
59
+ * Force browser to refresh links from the server.
60
+ */
61
+ fetchLinks(): Promise<HttpClientLink[]>;
62
+ /**
63
+ * Create a virtual client that can be used to call actions.
64
+ *
65
+ * Use js Proxy under the hood.
66
+ */
21
67
  client<T extends object>(scope?: ClientScope): HttpVirtualClient<T>;
22
- protected createVirtualAction<T extends RequestConfigSchema>(name: string, scope?: ClientScope): VirtualAction<T>;
68
+ /**
69
+ * Check if a link with the given name exists.
70
+ * @param name
71
+ */
72
+ can(name: string): boolean;
23
73
  /**
24
74
  * Resolve a link by its name and call it.
25
75
  * - If link is local, it will call the local handler.
26
76
  * - If link is remote, it will make a fetch request to the remote server.
27
77
  */
28
78
  follow(name: string, config?: Partial<ServerRequestConfigEntry>, options?: ClientRequestOptions & ClientScope): Promise<any>;
79
+ protected createVirtualAction<T extends RequestConfigSchema>(name: string, scope?: ClientScope): VirtualAction<T>;
29
80
  protected followRemote(link: HttpClientLink, config?: Partial<ServerRequestConfigEntry>, options?: ClientRequestOptions): Promise<FetchResponse>;
30
- can(name: string): boolean;
31
81
  protected getLinkByName(name: string, options?: ClientScope): Promise<HttpClientLink>;
32
82
  }
33
83
  interface HttpClientLink extends ApiLink {
@@ -41,13 +91,13 @@ interface HttpClientLink extends ApiLink {
41
91
  interface ClientScope {
42
92
  group?: string;
43
93
  service?: string;
94
+ hostname?: string;
44
95
  }
45
96
  type HttpVirtualClient<T> = { [K in keyof T as T[K] extends ActionDescriptor<RequestConfigSchema> ? K : never]: T[K] extends ActionDescriptor<infer Schema> ? VirtualAction<Schema> : never };
46
97
  interface VirtualAction<T extends RequestConfigSchema> extends Pick<ActionDescriptor<T>, "name" | "run" | "fetch"> {
47
98
  (config?: ClientRequestEntry<T>, opts?: ClientRequestOptions): Promise<ClientRequestResponse<T>>;
48
99
  can: () => boolean;
49
100
  }
50
- //# sourceMappingURL=LinkProvider.d.ts.map
51
101
  //#endregion
52
102
  //#region src/descriptors/$client.d.ts
53
103
  /**
@@ -57,8 +107,6 @@ declare const $client: {
57
107
  <T extends object>(scope?: ClientScope): HttpVirtualClient<T>;
58
108
  [KIND]: string;
59
109
  };
60
- //# sourceMappingURL=$client.d.ts.map
61
-
62
110
  //#endregion
63
111
  //#region src/descriptors/$remote.d.ts
64
112
  /**
@@ -121,18 +169,17 @@ interface RemoteDescriptorOptions {
121
169
  declare class RemoteDescriptor extends Descriptor<RemoteDescriptorOptions> {
122
170
  get name(): string;
123
171
  }
124
- //# sourceMappingURL=$remote.d.ts.map
125
172
  //#endregion
126
173
  //#region src/providers/RemoteDescriptorProvider.d.ts
127
174
  declare class RemoteDescriptorProvider {
128
- static path: {
129
- apiLinks: string;
175
+ protected readonly env: {
176
+ SERVER_API_PREFIX: string;
130
177
  };
131
178
  protected readonly alepha: Alepha;
132
- protected readonly client: LinkProvider;
133
179
  protected readonly proxyProvider: ServerProxyProvider;
180
+ protected readonly linkProvider: LinkProvider;
134
181
  protected readonly remotes: Array<ServerRemote>;
135
- protected readonly log: Logger;
182
+ protected readonly log: _alepha_logger0.Logger;
136
183
  getRemotes(): ServerRemote[];
137
184
  readonly configure: _alepha_core2.HookDescriptor<"configure">;
138
185
  readonly start: _alepha_core2.HookDescriptor<"start">;
@@ -140,64 +187,119 @@ declare class RemoteDescriptorProvider {
140
187
  protected readonly fetchLinks: _alepha_retry0.RetryDescriptorFn<(opts: FetchLinksOptions) => Promise<ApiLinksResponse>>;
141
188
  }
142
189
  interface FetchLinksOptions {
190
+ /**
191
+ * Name of the remote service.
192
+ */
143
193
  service: string;
194
+ /**
195
+ * URL to fetch links from.
196
+ */
144
197
  url: string;
198
+ /**
199
+ * Authorization header containing access token.
200
+ */
145
201
  authorization?: string;
146
202
  }
147
203
  interface ServerRemote {
204
+ /**
205
+ * URL of the remote service.
206
+ */
148
207
  url: string;
208
+ /**
209
+ * Name of the remote service.
210
+ */
149
211
  name: string;
212
+ /**
213
+ * Expose links as endpoint. It's not only internal.
214
+ */
150
215
  proxy: boolean;
216
+ /**
217
+ * It's only used inside the application.
218
+ */
151
219
  internal: boolean;
220
+ /**
221
+ * Links fetcher.
222
+ */
152
223
  links: (args: {
153
224
  authorization?: string;
154
225
  }) => Promise<ApiLinksResponse>;
226
+ /**
227
+ * Fetches schema for the remote service.
228
+ */
155
229
  schema: (args: {
156
230
  name: string;
157
231
  authorization?: string;
158
232
  }) => Promise<any>;
233
+ /**
234
+ * Force a default access token provider when not provided.
235
+ */
159
236
  serviceAccount?: ServiceAccountDescriptor;
237
+ /**
238
+ * Prefix for the remote service links.
239
+ */
160
240
  prefix: string;
161
241
  }
162
- //# sourceMappingURL=RemoteDescriptorProvider.d.ts.map
163
242
  //#endregion
164
243
  //#region src/providers/ServerLinksProvider.d.ts
165
244
  declare class ServerLinksProvider {
245
+ protected readonly env: {
246
+ SERVER_API_PREFIX: string;
247
+ };
166
248
  protected readonly alepha: Alepha;
167
- protected readonly client: LinkProvider;
249
+ protected readonly linkProvider: LinkProvider;
168
250
  protected readonly remoteProvider: RemoteDescriptorProvider;
169
- readonly onRoute: _alepha_core1.HookDescriptor<"configure">;
251
+ protected readonly serverTimingProvider: ServerTimingProvider;
252
+ get prefix(): string;
253
+ readonly onRoute: _alepha_core2.HookDescriptor<"configure">;
254
+ /**
255
+ * First API - Get all API links for the user.
256
+ *
257
+ * This is based on the user's permissions.
258
+ */
170
259
  readonly links: _alepha_server0.RouteDescriptor<{
171
- response: _sinclair_typebox0.TObject<{
172
- prefix: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
173
- links: _sinclair_typebox0.TArray<_sinclair_typebox0.TObject<{
174
- name: _sinclair_typebox0.TString;
175
- path: _sinclair_typebox0.TString;
176
- method: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
177
- group: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
178
- requestBodyType: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
179
- service: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
260
+ response: _sinclair_typebox19.TObject<{
261
+ prefix: _sinclair_typebox19.TOptional<_sinclair_typebox19.TString>;
262
+ links: _sinclair_typebox19.TArray<_sinclair_typebox19.TObject<{
263
+ name: _sinclair_typebox19.TString;
264
+ group: _sinclair_typebox19.TOptional<_sinclair_typebox19.TString>;
265
+ path: _sinclair_typebox19.TString;
266
+ method: _sinclair_typebox19.TOptional<_sinclair_typebox19.TString>;
267
+ requestBodyType: _sinclair_typebox19.TOptional<_sinclair_typebox19.TString>;
268
+ service: _sinclair_typebox19.TOptional<_sinclair_typebox19.TString>;
180
269
  }>>;
181
270
  }>;
182
271
  }>;
272
+ /**
273
+ * Second API - Get schema for a specific API link.
274
+ *
275
+ * Note: Body/Response schema are not included in `links` API because it's TOO BIG.
276
+ * I mean for 150+ links, you got 50ms of serialization time.
277
+ */
183
278
  readonly schema: _alepha_server0.RouteDescriptor<{
184
- params: _sinclair_typebox0.TObject<{
185
- name: _sinclair_typebox0.TString;
279
+ params: _sinclair_typebox19.TObject<{
280
+ name: _sinclair_typebox19.TString;
186
281
  }>;
187
- response: _sinclair_typebox0.TRecord<_sinclair_typebox0.TString, _sinclair_typebox0.TAny>;
282
+ response: _sinclair_typebox19.TRecord<_sinclair_typebox19.TString, _sinclair_typebox19.TAny>;
188
283
  }>;
189
- getLinks(options: GetLinksOptions): Promise<ApiLinksResponse>;
284
+ getSchemaByName(name: string, options?: GetApiLinksOptions): Promise<RequestConfigSchema>;
285
+ /**
286
+ * Retrieves API links for the user based on their permissions.
287
+ * Will check on local links and remote links.
288
+ */
289
+ getUserApiLinks(options: GetApiLinksOptions): Promise<ApiLinksResponse>;
190
290
  }
191
- interface GetLinksOptions {
291
+ interface GetApiLinksOptions {
192
292
  user?: UserAccountToken;
193
293
  authorization?: string;
194
294
  }
195
- //# sourceMappingURL=ServerLinksProvider.d.ts.map
196
295
  //#endregion
197
296
  //#region src/index.d.ts
198
- declare const AlephaServerLinks: _alepha_core0.Service<_alepha_core0.Module>;
199
- //# sourceMappingURL=index.d.ts.map
200
-
297
+ declare module "alepha" {
298
+ interface State {
299
+ api?: ApiLinksResponse;
300
+ }
301
+ }
302
+ declare const AlephaServerLinks: _alepha_core2.Service<_alepha_core2.Module>;
201
303
  //#endregion
202
- export { $client, $remote, AlephaServerLinks, ClientScope, FetchLinksOptions, GetLinksOptions, HttpClientLink, HttpVirtualClient, LinkProvider, RemoteDescriptor, RemoteDescriptorOptions, RemoteDescriptorProvider, ServerLinksProvider, ServerRemote, VirtualAction };
304
+ export { $client, $remote, AlephaServerLinks, ApiLink, ApiLinksResponse, ClientScope, FetchLinksOptions, GetApiLinksOptions, HttpClientLink, HttpVirtualClient, LinkProvider, RemoteDescriptor, RemoteDescriptorOptions, RemoteDescriptorProvider, ServerLinksProvider, ServerRemote, VirtualAction, apiLinkSchema, apiLinksResponseSchema };
203
305
  //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,4 @@
1
1
  import * as _alepha_core1 from "alepha";
2
- import * as _alepha_core0 from "alepha";
3
2
  import { Alepha } from "alepha";
4
3
  import * as _alepha_server0 from "alepha/server";
5
4
  import { Histogram, Registry } from "prom-client";
@@ -21,7 +20,6 @@ interface ServerMetricsProviderOptions {
21
20
  eventLoopMonitoringPrecision?: number;
22
21
  labels?: object;
23
22
  }
24
- //# sourceMappingURL=ServerMetricsProvider.d.ts.map
25
23
  //#endregion
26
24
  //#region src/index.d.ts
27
25
  /**
@@ -31,9 +29,7 @@ interface ServerMetricsProviderOptions {
31
29
  * @see {@link ServerMetricsProvider}
32
30
  * @module alepha.server.metrics
33
31
  */
34
- declare const AlephaServerMetrics: _alepha_core0.Service<_alepha_core0.Module>;
35
- //# sourceMappingURL=index.d.ts.map
36
-
32
+ declare const AlephaServerMetrics: _alepha_core1.Service<_alepha_core1.Module>;
37
33
  //#endregion
38
34
  export { AlephaServerMetrics, ServerMetricsProvider, ServerMetricsProviderOptions };
39
35
  //# sourceMappingURL=index.d.ts.map
@@ -37,8 +37,6 @@ interface HybridFile extends FileLike {
37
37
  * @module alepha.server.multipart
38
38
  */
39
39
  declare const AlephaServerMultipart: _alepha_core0.Service<_alepha_core0.Module>;
40
- //# sourceMappingURL=index.d.ts.map
41
-
42
40
  //#endregion
43
41
  export { AlephaServerMultipart, ServerMultipartProvider };
44
42
  //# sourceMappingURL=index.d.ts.map
package/server/proxy.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _alepha_core1 from "alepha";
2
- import * as _alepha_core0 from "alepha";
3
2
  import { Alepha, Async, Descriptor, KIND } from "alepha";
4
3
  import { ServerHandler, ServerRequest, ServerRouterProvider } from "alepha/server";
4
+ import * as _alepha_logger0 from "alepha/logger";
5
5
 
6
6
  //#region src/descriptors/$proxy.d.ts
7
7
  declare const $proxy: {
@@ -17,11 +17,10 @@ type ProxyDescriptorOptions = {
17
17
  rewrite?: (url: URL) => void;
18
18
  };
19
19
  declare class ProxyDescriptor extends Descriptor<ProxyDescriptorOptions> {}
20
- //# sourceMappingURL=$proxy.d.ts.map
21
20
  //#endregion
22
21
  //#region src/providers/ServerProxyProvider.d.ts
23
22
  declare class ServerProxyProvider {
24
- protected readonly log: _alepha_core1.Logger;
23
+ protected readonly log: _alepha_logger0.Logger;
25
24
  protected readonly routerProvider: ServerRouterProvider;
26
25
  protected readonly alepha: Alepha;
27
26
  protected readonly configure: _alepha_core1.HookDescriptor<"configure">;
@@ -29,7 +28,6 @@ declare class ServerProxyProvider {
29
28
  createProxyHandler(target: string, options: Omit<ProxyDescriptorOptions, "path">): ServerHandler;
30
29
  private getRawRequestBody;
31
30
  }
32
- //# sourceMappingURL=ServerProxyProvider.d.ts.map
33
31
  //#endregion
34
32
  //#region src/index.d.ts
35
33
  /**
@@ -38,9 +36,7 @@ declare class ServerProxyProvider {
38
36
  * @see {@link $proxy}
39
37
  * @module alepha.server.proxy
40
38
  */
41
- declare const AlephaServerProxy: _alepha_core0.Service<_alepha_core0.Module>;
42
- //# sourceMappingURL=index.d.ts.map
43
-
39
+ declare const AlephaServerProxy: _alepha_core1.Service<_alepha_core1.Module>;
44
40
  //#endregion
45
41
  export { $proxy, AlephaServerProxy, ProxyDescriptor, ProxyDescriptorOptions, ServerProxyProvider };
46
42
  //# sourceMappingURL=index.d.ts.map
@@ -1,12 +1,12 @@
1
1
  import * as _alepha_core1 from "alepha";
2
- import * as _alepha_core0 from "alepha";
3
2
  import { Alepha } from "alepha";
4
- import { JwtProvider, Permission, SecurityProvider, UserAccountToken } from "alepha/security";
3
+ import { JwtProvider, Permission, SecurityProvider, UserAccount, UserAccountToken } from "alepha/security";
5
4
  import { FetchOptions } from "alepha/server";
5
+ import * as _alepha_logger0 from "alepha/logger";
6
6
 
7
7
  //#region src/providers/ServerSecurityProvider.d.ts
8
8
  declare class ServerSecurityProvider {
9
- protected readonly log: _alepha_core1.Logger;
9
+ protected readonly log: _alepha_logger0.Logger;
10
10
  protected readonly securityProvider: SecurityProvider;
11
11
  protected readonly jwtProvider: JwtProvider;
12
12
  protected readonly alepha: Alepha;
@@ -36,7 +36,6 @@ type ServerRouteSecure = boolean | {
36
36
  realms?: string[];
37
37
  organizations?: string[];
38
38
  };
39
- //# sourceMappingURL=ServerSecurityProvider.d.ts.map
40
39
  //#endregion
41
40
  //#region src/index.d.ts
42
41
  declare module "alepha" {
@@ -48,6 +47,7 @@ declare module "alepha" {
48
47
  * > To force a different user, you need to pass it explicitly in the options.
49
48
  */
50
49
  "server.security.system.user"?: UserAccountToken;
50
+ user?: UserAccount;
51
51
  }
52
52
  }
53
53
  declare module "alepha/server" {
@@ -70,7 +70,7 @@ declare module "alepha/server" {
70
70
  * If "system", use system user. @see {ServerSecurityProvider.localSystemUser}
71
71
  * If "context", use the user from the current context (e.g. request).
72
72
  *
73
- * @default "system" is provided, else "context" is used.
73
+ * @default "system" if provided, else "context" if available.
74
74
  */
75
75
  user?: UserAccountToken | "system" | "context";
76
76
  }
@@ -83,8 +83,7 @@ declare module "alepha/server" {
83
83
  * @see {@link ServerSecurityProvider}
84
84
  * @module alepha.server.security
85
85
  */
86
- declare const AlephaServerSecurity: _alepha_core0.Service<_alepha_core0.Module>;
87
- //# sourceMappingURL=index.d.ts.map
86
+ declare const AlephaServerSecurity: _alepha_core1.Service<_alepha_core1.Module>;
88
87
  //#endregion
89
88
  export { AlephaServerSecurity, ServerRouteSecure, ServerSecurityProvider };
90
89
  //# sourceMappingURL=index.d.ts.map
@@ -1,8 +1,8 @@
1
1
  import * as _alepha_core1 from "alepha";
2
- import * as _alepha_core0 from "alepha";
3
- import { Alepha, Descriptor, KIND, Logger } from "alepha";
2
+ import { Alepha, Descriptor, KIND } from "alepha";
4
3
  import { ServerHandler, ServerRouterProvider } from "alepha/server";
5
4
  import { DateTimeProvider, DurationLike } from "alepha/datetime";
5
+ import * as _alepha_logger0 from "alepha/logger";
6
6
 
7
7
  //#region src/descriptors/$serve.d.ts
8
8
  /**
@@ -83,14 +83,13 @@ interface CacheControlOptions {
83
83
  immutable: boolean;
84
84
  }
85
85
  declare class ServeDescriptor extends Descriptor<ServeDescriptorOptions> {}
86
- //# sourceMappingURL=$serve.d.ts.map
87
86
  //#endregion
88
87
  //#region src/providers/ServerStaticProvider.d.ts
89
88
  declare class ServerStaticProvider {
90
89
  protected readonly alepha: Alepha;
91
90
  protected readonly routerProvider: ServerRouterProvider;
92
91
  protected readonly dateTimeProvider: DateTimeProvider;
93
- protected readonly log: Logger;
92
+ protected readonly log: _alepha_logger0.Logger;
94
93
  protected readonly directories: ServeDirectory[];
95
94
  protected readonly configure: _alepha_core1.HookDescriptor<"configure">;
96
95
  createStaticServer(options: ServeDescriptorOptions): Promise<void>;
@@ -106,7 +105,6 @@ interface ServeDirectory {
106
105
  options: ServeDescriptorOptions;
107
106
  files: string[];
108
107
  }
109
- //# sourceMappingURL=ServerStaticProvider.d.ts.map
110
108
  //#endregion
111
109
  //#region src/index.d.ts
112
110
  /**
@@ -115,9 +113,7 @@ interface ServeDirectory {
115
113
  * @see {@link ServerStaticProvider}
116
114
  * @module alepha.server.static
117
115
  */
118
- declare const AlephaServerStatic: _alepha_core0.Service<_alepha_core0.Module>;
119
- //# sourceMappingURL=index.d.ts.map
120
-
116
+ declare const AlephaServerStatic: _alepha_core1.Service<_alepha_core1.Module>;
121
117
  //#endregion
122
118
  export { $serve, AlephaServerStatic, CacheControlOptions, ServeDescriptor, ServeDescriptorOptions, ServeDirectory, ServerStaticProvider };
123
119
  //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,5 @@
1
+ import "alepha/server/security";
1
2
  import * as _alepha_core1 from "alepha";
2
- import * as _alepha_core0 from "alepha";
3
3
  import { Alepha, Descriptor, KIND, TObject } from "alepha";
4
4
  import { ActionDescriptor, RequestConfigSchema, ServerRouterProvider } from "alepha/server";
5
5
  import { ServerStaticProvider } from "alepha/server/static";
@@ -82,7 +82,6 @@ interface SwaggerUiOptions {
82
82
  };
83
83
  }
84
84
  declare class SwaggerDescriptor extends Descriptor<SwaggerDescriptorOptions> {}
85
- //# sourceMappingURL=$swagger.d.ts.map
86
85
  //#endregion
87
86
  //#region src/ServerSwaggerProvider.d.ts
88
87
  declare class ServerSwaggerProvider {
@@ -103,7 +102,6 @@ declare class ServerSwaggerProvider {
103
102
  protected configureSwaggerApi(prefix: string, json: OpenAPIV3.Document): void;
104
103
  protected configureSwaggerUi(prefix: string, options: SwaggerDescriptorOptions): Promise<void>;
105
104
  }
106
- //# sourceMappingURL=ServerSwaggerProvider.d.ts.map
107
105
  //#endregion
108
106
  //#region src/index.d.ts
109
107
  declare module "alepha/server" {
@@ -126,9 +124,7 @@ declare module "alepha/server" {
126
124
  * @see {@link ServerSwaggerProvider}
127
125
  * @module alepha.server.swagger
128
126
  */
129
- declare const AlephaServerSwagger: _alepha_core0.Service<_alepha_core0.Module>;
130
- //# sourceMappingURL=index.d.ts.map
131
-
127
+ declare const AlephaServerSwagger: _alepha_core1.Service<_alepha_core1.Module>;
132
128
  //#endregion
133
129
  export { $swagger, AlephaServerSwagger, ServerSwaggerProvider, SwaggerDescriptor, SwaggerDescriptorOptions, SwaggerUiOptions };
134
130
  //# sourceMappingURL=index.d.ts.map