alepha 0.10.3 → 0.10.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/queue.d.ts CHANGED
@@ -157,9 +157,9 @@ interface NextMessage {
157
157
  * const emailQueue = $queue({
158
158
  * name: "email-notifications",
159
159
  * schema: t.object({
160
- * to: t.string(),
161
- * subject: t.string(),
162
- * body: t.string(),
160
+ * to: t.text(),
161
+ * subject: t.text(),
162
+ * body: t.text(),
163
163
  * priority: t.optional(t.enum(["high", "normal"]))
164
164
  * }),
165
165
  * handler: async (message) => {
@@ -183,7 +183,7 @@ interface NextMessage {
183
183
  * name: "image-processing",
184
184
  * provider: RedisQueueProvider,
185
185
  * schema: t.object({
186
- * imageId: t.string(),
186
+ * imageId: t.text(),
187
187
  * operations: t.array(t.enum(["resize", "compress", "thumbnail"]))
188
188
  * }),
189
189
  * handler: async (message) => {
@@ -208,7 +208,7 @@ interface NextMessage {
208
208
  * provider: "memory",
209
209
  * schema: t.object({
210
210
  * taskType: t.enum(["cleanup", "backup", "report"]),
211
- * data: t.record(t.string(), t.any())
211
+ * data: t.record(t.text(), t.any())
212
212
  * }),
213
213
  * handler: async (message) => {
214
214
  * switch (message.payload.taskType) {
@@ -299,9 +299,9 @@ interface QueueDescriptorOptions<T extends TSchema> {
299
299
  * @example
300
300
  * ```ts
301
301
  * t.object({
302
- * userId: t.string(),
302
+ * userId: t.text(),
303
303
  * action: t.enum(["create", "update"]),
304
- * data: t.record(t.string(), t.any()),
304
+ * data: t.record(t.text(), t.any()),
305
305
  * timestamp: t.optional(t.number())
306
306
  * })
307
307
  * ```
@@ -404,10 +404,10 @@ interface QueueMessage<T extends TSchema> {
404
404
  * emailQueue = $queue({
405
405
  * name: "emails",
406
406
  * schema: t.object({
407
- * to: t.string(),
408
- * subject: t.string(),
409
- * body: t.string(),
410
- * template: t.optional(t.string())
407
+ * to: t.text(),
408
+ * subject: t.text(),
409
+ * body: t.text(),
410
+ * template: t.optional(t.text())
411
411
  * })
412
412
  * });
413
413
  *
@@ -447,9 +447,9 @@ interface QueueMessage<T extends TSchema> {
447
447
  * name: "notifications",
448
448
  * schema: t.object({
449
449
  * type: t.enum(["email", "sms", "push"]),
450
- * recipient: t.string(),
451
- * message: t.string(),
452
- * metadata: t.optional(t.record(t.string(), t.any()))
450
+ * recipient: t.text(),
451
+ * message: t.text(),
452
+ * metadata: t.optional(t.record(t.text(), t.any()))
453
453
  * })
454
454
  * });
455
455
  *
@@ -503,10 +503,10 @@ interface QueueMessage<T extends TSchema> {
503
503
  * orderQueue = $queue({
504
504
  * name: "order-processing",
505
505
  * schema: t.object({
506
- * orderId: t.string(),
507
- * customerId: t.string(),
506
+ * orderId: t.text(),
507
+ * customerId: t.text(),
508
508
  * items: t.array(t.object({
509
- * productId: t.string(),
509
+ * productId: t.text(),
510
510
  * quantity: t.number(),
511
511
  * price: t.number()
512
512
  * }))
@@ -566,10 +566,10 @@ interface QueueMessage<T extends TSchema> {
566
566
  * dataQueue = $queue({
567
567
  * name: "data-processing",
568
568
  * schema: t.object({
569
- * batchId: t.string(),
569
+ * batchId: t.text(),
570
570
  * records: t.array(t.object({
571
- * id: t.string(),
572
- * data: t.record(t.string(), t.any())
571
+ * id: t.text(),
572
+ * data: t.record(t.text(), t.any())
573
573
  * })),
574
574
  * processingOptions: t.object({
575
575
  * validateData: t.boolean(),
@@ -652,7 +652,7 @@ interface ConsumerDescriptorOptions<T extends TSchema> {
652
652
  * // First, define a queue
653
653
  * emailQueue = $queue({
654
654
  * name: "emails",
655
- * schema: t.object({ to: t.string(), subject: t.string() })
655
+ * schema: t.object({ to: t.text(), subject: t.text() })
656
656
  * });
657
657
  *
658
658
  * // Then, create a consumer for that queue
package/react/auth.d.ts CHANGED
@@ -43,6 +43,11 @@ declare class ReactAuth {
43
43
  };
44
44
  protected readonly onBeginTransition: _alepha_core4.HookDescriptor<"react:transition:begin">;
45
45
  protected readonly onFetchRequest: _alepha_core4.HookDescriptor<"client:onRequest">;
46
+ /**
47
+ * Get the current authenticated user.
48
+ *
49
+ * Alias for `alepha.state.get("user")`
50
+ */
46
51
  get user(): UserAccountToken | undefined;
47
52
  ping(): Promise<{
48
53
  name?: string | undefined;
package/react/form.d.ts CHANGED
@@ -106,8 +106,8 @@ declare const FormState: <T extends TObject>(props: {
106
106
  *
107
107
  * const form = useForm({
108
108
  * schema: t.object({
109
- * username: t.string(),
110
- * password: t.string(),
109
+ * username: t.text(),
110
+ * password: t.text(),
111
111
  * }),
112
112
  * handler: (values) => {
113
113
  * console.log("Form submitted with values:", values);
package/react.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import * as _alepha_core14 from "alepha";
1
+ import * as _alepha_core10 from "alepha";
2
2
  import { Alepha, Async, Descriptor, Hooks, KIND, Service, State, Static, TObject, TSchema } from "alepha";
3
3
  import { RequestConfigSchema, ServerHandler, ServerProvider, ServerRequest, ServerRouterProvider, ServerTimingProvider } from "alepha/server";
4
4
  import { ServerRouteCache } from "alepha/server/cache";
5
5
  import { ClientScope, HttpVirtualClient, LinkProvider, VirtualAction } from "alepha/server/links";
6
- import * as _alepha_logger1 from "alepha/logger";
7
- import * as react0 from "react";
6
+ import * as _alepha_logger0 from "alepha/logger";
7
+ import * as react1 from "react";
8
8
  import React, { AnchorHTMLAttributes, CSSProperties, ErrorInfo, FC, PropsWithChildren, ReactNode } from "react";
9
9
  import * as react_jsx_runtime0 from "react/jsx-runtime";
10
10
  import { ServerStaticProvider } from "alepha/server/static";
@@ -40,14 +40,14 @@ declare class Redirection extends Error {
40
40
  }
41
41
  //#endregion
42
42
  //#region src/providers/ReactPageProvider.d.ts
43
- declare const envSchema$2: _alepha_core14.TObject<{
44
- REACT_STRICT_MODE: _alepha_core14.TBoolean;
43
+ declare const envSchema$2: _alepha_core10.TObject<{
44
+ REACT_STRICT_MODE: _alepha_core10.TBoolean;
45
45
  }>;
46
46
  declare module "alepha" {
47
47
  interface Env extends Partial<Static<typeof envSchema$2>> {}
48
48
  }
49
49
  declare class ReactPageProvider {
50
- protected readonly log: _alepha_logger1.Logger;
50
+ protected readonly log: _alepha_logger0.Logger;
51
51
  protected readonly env: {
52
52
  REACT_STRICT_MODE: boolean;
53
53
  };
@@ -83,7 +83,7 @@ declare class ReactPageProvider {
83
83
  }, params?: Record<string, any>): string;
84
84
  compile(path: string, params?: Record<string, string>): string;
85
85
  protected renderView(index: number, path: string, view: ReactNode | undefined, page: PageRoute): ReactNode;
86
- protected readonly configure: _alepha_core14.HookDescriptor<"configure">;
86
+ protected readonly configure: _alepha_core10.HookDescriptor<"configure">;
87
87
  protected map(pages: Array<PageDescriptor>, target: PageDescriptor): PageRouteEntry;
88
88
  add(entry: PageRouteEntry): void;
89
89
  protected createMatch(page: PageRoute): string;
@@ -210,7 +210,7 @@ interface CreateLayersResult {
210
210
  * path: "/users/:id",
211
211
  * schema: {
212
212
  * params: t.object({ id: t.int() }),
213
- * query: t.object({ tab: t.optional(t.string()) })
213
+ * query: t.object({ tab: t.optional(t.text()) })
214
214
  * },
215
215
  * resolve: async ({ params }) => {
216
216
  * const user = await userApi.getUser(params.id);
@@ -489,18 +489,18 @@ interface BrowserRoute extends Route {
489
489
  page: PageRoute;
490
490
  }
491
491
  declare class ReactBrowserRouterProvider extends RouterProvider<BrowserRoute> {
492
- protected readonly log: _alepha_logger1.Logger;
492
+ protected readonly log: _alepha_logger0.Logger;
493
493
  protected readonly alepha: Alepha;
494
494
  protected readonly pageApi: ReactPageProvider;
495
495
  add(entry: PageRouteEntry): void;
496
- protected readonly configure: _alepha_core14.HookDescriptor<"configure">;
496
+ protected readonly configure: _alepha_core10.HookDescriptor<"configure">;
497
497
  transition(url: URL, previous?: PreviousLayerData[], meta?: {}): Promise<string | void>;
498
498
  root(state: ReactRouterState): ReactNode;
499
499
  }
500
500
  //#endregion
501
501
  //#region src/providers/ReactBrowserProvider.d.ts
502
- declare const envSchema$1: _alepha_core14.TObject<{
503
- REACT_ROOT_ID: _alepha_core14.TString;
502
+ declare const envSchema$1: _alepha_core10.TObject<{
503
+ REACT_ROOT_ID: _alepha_core10.TString;
504
504
  }>;
505
505
  declare module "alepha" {
506
506
  interface Env extends Partial<Static<typeof envSchema$1>> {}
@@ -512,7 +512,7 @@ declare class ReactBrowserProvider {
512
512
  protected readonly env: {
513
513
  REACT_ROOT_ID: string;
514
514
  };
515
- protected readonly log: _alepha_logger1.Logger;
515
+ protected readonly log: _alepha_logger0.Logger;
516
516
  protected readonly client: LinkProvider;
517
517
  protected readonly alepha: Alepha;
518
518
  protected readonly router: ReactBrowserRouterProvider;
@@ -546,8 +546,8 @@ declare class ReactBrowserProvider {
546
546
  * Get embedded layers from the server.
547
547
  */
548
548
  protected getHydrationState(): ReactHydrationState | undefined;
549
- protected readonly onTransitionEnd: _alepha_core14.HookDescriptor<"react:transition:end">;
550
- readonly ready: _alepha_core14.HookDescriptor<"ready">;
549
+ protected readonly onTransitionEnd: _alepha_core10.HookDescriptor<"react:transition:end">;
550
+ readonly ready: _alepha_core10.HookDescriptor<"ready">;
551
551
  }
552
552
  interface RouterGoOptions {
553
553
  replace?: boolean;
@@ -632,7 +632,7 @@ interface NestedViewProps {
632
632
  children?: ReactNode;
633
633
  errorBoundary?: false | ((error: Error) => ReactNode);
634
634
  }
635
- declare const _default: react0.MemoExoticComponent<(props: NestedViewProps) => react_jsx_runtime0.JSX.Element>;
635
+ declare const _default: react1.MemoExoticComponent<(props: NestedViewProps) => react_jsx_runtime0.JSX.Element>;
636
636
  //#endregion
637
637
  //#region src/components/NotFound.d.ts
638
638
  declare function NotFoundPage(props: {
@@ -640,14 +640,14 @@ declare function NotFoundPage(props: {
640
640
  }): react_jsx_runtime0.JSX.Element;
641
641
  //#endregion
642
642
  //#region src/contexts/AlephaContext.d.ts
643
- declare const AlephaContext: react0.Context<Alepha | undefined>;
643
+ declare const AlephaContext: react1.Context<Alepha | undefined>;
644
644
  //#endregion
645
645
  //#region src/contexts/RouterLayerContext.d.ts
646
646
  interface RouterLayerContextValue {
647
647
  index: number;
648
648
  path: string;
649
649
  }
650
- declare const RouterLayerContext: react0.Context<RouterLayerContextValue | undefined>;
650
+ declare const RouterLayerContext: react1.Context<RouterLayerContextValue | undefined>;
651
651
  //#endregion
652
652
  //#region src/hooks/useActive.d.ts
653
653
  interface UseActiveOptions {
@@ -800,12 +800,12 @@ declare const ssrSchemaLoading: (alepha: Alepha, name: string) => RequestConfigS
800
800
  declare const useStore: <Key extends keyof State>(key: Key, defaultValue?: State[Key]) => [State[Key], (value: State[Key]) => void];
801
801
  //#endregion
802
802
  //#region src/providers/ReactServerProvider.d.ts
803
- declare const envSchema: _alepha_core14.TObject<{
804
- REACT_SERVER_DIST: _alepha_core14.TString;
805
- REACT_SERVER_PREFIX: _alepha_core14.TString;
806
- REACT_SSR_ENABLED: _alepha_core14.TOptional<_alepha_core14.TBoolean>;
807
- REACT_ROOT_ID: _alepha_core14.TString;
808
- REACT_SERVER_TEMPLATE: _alepha_core14.TOptional<_alepha_core14.TString>;
803
+ declare const envSchema: _alepha_core10.TObject<{
804
+ REACT_SERVER_DIST: _alepha_core10.TString;
805
+ REACT_SERVER_PREFIX: _alepha_core10.TString;
806
+ REACT_SSR_ENABLED: _alepha_core10.TOptional<_alepha_core10.TBoolean>;
807
+ REACT_ROOT_ID: _alepha_core10.TString;
808
+ REACT_SERVER_TEMPLATE: _alepha_core10.TOptional<_alepha_core10.TString>;
809
809
  }>;
810
810
  declare module "alepha" {
811
811
  interface Env extends Partial<Static<typeof envSchema>> {}
@@ -814,7 +814,7 @@ declare module "alepha" {
814
814
  }
815
815
  }
816
816
  declare class ReactServerProvider {
817
- protected readonly log: _alepha_logger1.Logger;
817
+ protected readonly log: _alepha_logger0.Logger;
818
818
  protected readonly alepha: Alepha;
819
819
  protected readonly pageApi: ReactPageProvider;
820
820
  protected readonly serverProvider: ServerProvider;
@@ -830,7 +830,7 @@ declare class ReactServerProvider {
830
830
  };
831
831
  protected readonly ROOT_DIV_REGEX: RegExp;
832
832
  protected preprocessedTemplate: PreprocessedTemplate | null;
833
- readonly onConfigure: _alepha_core14.HookDescriptor<"configure">;
833
+ readonly onConfigure: _alepha_core10.HookDescriptor<"configure">;
834
834
  get template(): string;
835
835
  protected registerPages(templateLoader: TemplateLoader): Promise<void>;
836
836
  protected getPublicDirectory(): string;
@@ -903,7 +903,7 @@ declare module "alepha" {
903
903
  * @see {@link $page}
904
904
  * @module alepha.react
905
905
  */
906
- declare const AlephaReact: _alepha_core14.Service<_alepha_core14.Module<{}>>;
906
+ declare const AlephaReact: _alepha_core10.Service<_alepha_core10.Module<{}>>;
907
907
  //#endregion
908
908
  export { $page, AlephaContext, AlephaReact, AnchorProps, ClientOnly, CreateLayersResult, ErrorBoundary, ErrorHandler, ErrorViewer, Layer, Link, LinkProps, _default as NestedView, NotFoundPage as NotFound, PageAnimation, PageConfigSchema, PageDescriptor, PageDescriptorOptions, PageDescriptorRenderOptions, PageDescriptorRenderResult, PageRequestConfig, PageResolve, PageRoute, PageRouteEntry, PreviousLayerData, ReactBrowserProvider, ReactBrowserRendererOptions, ReactHydrationState, ReactPageProvider, ReactRouter, ReactRouterState, ReactServerProvider, Redirection, RouterGoOptions, RouterLayerContext, RouterLayerContextValue, RouterRenderOptions, RouterStackItem, TPropsDefault, TPropsParentDefault, TransitionOptions, UseActiveHook, UseActiveOptions, UseQueryParamsHookOptions, UseSchemaReturn, VirtualRouter, isPageRoute, ssrSchemaLoading, useActive, useAlepha, useClient, useInject, useQueryParams, useRouter, useRouterEvents, useRouterState, useSchema, useStore };
909
909
  //# sourceMappingURL=index.d.ts.map
package/scheduler.d.ts CHANGED
@@ -95,14 +95,34 @@ declare class SchedulerDescriptor extends Descriptor<SchedulerDescriptorOptions>
95
95
  protected onInit(): void;
96
96
  trigger(): Promise<void>;
97
97
  protected schedulerLock: _alepha_lock0.LockDescriptor<(args: SchedulerHandlerArguments) => Promise<void>>;
98
- protected prefix(key: string): string;
99
- protected getLockGracePeriod(options: SchedulerDescriptorOptions): number;
100
98
  }
101
99
  interface SchedulerHandlerArguments {
102
100
  now: DateTime;
103
101
  }
104
102
  //#endregion
105
103
  //#region src/index.d.ts
104
+ declare module "alepha" {
105
+ interface Hooks {
106
+ "scheduler:begin": {
107
+ name: string;
108
+ now: DateTime;
109
+ context: string;
110
+ };
111
+ "scheduler:success": {
112
+ name: string;
113
+ context: string;
114
+ };
115
+ "scheduler:error": {
116
+ name: string;
117
+ error: Error;
118
+ context: string;
119
+ };
120
+ "scheduler:end": {
121
+ name: string;
122
+ context: string;
123
+ };
124
+ }
125
+ }
106
126
  /**
107
127
  * Generic interface for scheduling tasks.
108
128
  *
package/security.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _alepha_core1 from "alepha";
2
2
  import { Alepha, Descriptor, KIND, Static } from "alepha";
3
- import * as _alepha_logger1 from "alepha/logger";
3
+ import * as _alepha_logger0 from "alepha/logger";
4
4
  import { DateTimeProvider, Duration, DurationLike } from "alepha/datetime";
5
5
  import { CryptoKey, FlattenedJWSInput, JSONWebKeySet, JWSHeaderParameters, JWTHeaderParameters, JWTPayload, JWTVerifyResult, KeyObject } from "jose";
6
6
  import * as typebox0 from "typebox";
@@ -68,7 +68,7 @@ type Role = Static<typeof roleSchema>;
68
68
  * Provides utilities for working with JSON Web Tokens (JWT).
69
69
  */
70
70
  declare class JwtProvider {
71
- protected readonly log: _alepha_logger1.Logger;
71
+ protected readonly log: _alepha_logger0.Logger;
72
72
  protected readonly keystore: KeyLoaderHolder[];
73
73
  protected readonly dateTimeProvider: DateTimeProvider;
74
74
  protected readonly encoder: TextEncoder;
@@ -140,7 +140,7 @@ declare class SecurityProvider {
140
140
  protected readonly UNKNOWN_USER_NAME = "Anonymous User";
141
141
  protected readonly PERMISSION_REGEXP: RegExp;
142
142
  protected readonly PERMISSION_REGEXP_WILDCARD: RegExp;
143
- protected readonly log: _alepha_logger1.Logger;
143
+ protected readonly log: _alepha_logger0.Logger;
144
144
  protected readonly jwt: JwtProvider;
145
145
  protected readonly env: {
146
146
  APP_SECRET: string;
@@ -319,6 +319,7 @@ declare class PermissionDescriptor extends Descriptor<PermissionDescriptorOption
319
319
  protected readonly securityProvider: SecurityProvider;
320
320
  get name(): string;
321
321
  get group(): string;
322
+ toString(): string;
322
323
  protected onInit(): void;
323
324
  /**
324
325
  * Check if the user has the permission.
@@ -348,6 +349,9 @@ type RealmDescriptorOptions = {
348
349
  * All roles available in the realm. Role is a string (role name) or a Role object (embedded role).
349
350
  */
350
351
  roles?: Array<string | Role>;
352
+ /**
353
+ * Realm settings.
354
+ */
351
355
  settings?: RealmSettings;
352
356
  /**
353
357
  * Parse the JWT payload to create a user account info.
@@ -398,7 +402,7 @@ declare class RealmDescriptor extends Descriptor<RealmDescriptorOptions> {
398
402
  protected readonly securityProvider: SecurityProvider;
399
403
  protected readonly dateTimeProvider: DateTimeProvider;
400
404
  protected readonly jwt: JwtProvider;
401
- protected readonly log: _alepha_logger1.Logger;
405
+ protected readonly log: _alepha_logger0.Logger;
402
406
  get name(): string;
403
407
  get accessTokenExpiration(): Duration;
404
408
  get refreshTokenExpiration(): Duration;
@@ -465,6 +469,7 @@ interface RoleDescriptorOptions {
465
469
  permissions?: Array<string | {
466
470
  name: string;
467
471
  ownership?: boolean;
472
+ exclude?: string[];
468
473
  }>;
469
474
  }
470
475
  declare class RoleDescriptor extends Descriptor<RoleDescriptorOptions> {
@@ -475,6 +480,8 @@ declare class RoleDescriptor extends Descriptor<RoleDescriptorOptions> {
475
480
  * Get the realm of the role.
476
481
  */
477
482
  get realm(): string | RealmDescriptor | undefined;
483
+ can(permission: string | PermissionDescriptor): boolean;
484
+ check(permission: string | PermissionDescriptor): SecurityCheckResult;
478
485
  }
479
486
  //#endregion
480
487
  //#region src/descriptors/$serviceAccount.d.ts
@@ -551,6 +558,7 @@ declare class SecurityError extends Error {
551
558
  declare class CryptoProvider {
552
559
  hashPassword(password: string): Promise<string>;
553
560
  verifyPassword(password: string, stored: string): Promise<boolean>;
561
+ randomUUID(): string;
554
562
  }
555
563
  //#endregion
556
564
  //#region src/index.d.ts
package/server/links.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import "alepha/server/security";
2
- import * as _alepha_core1 from "alepha";
2
+ import * as _alepha_core2 from "alepha";
3
3
  import { Alepha, Descriptor, KIND, Static } from "alepha";
4
4
  import * as _alepha_server0 from "alepha/server";
5
5
  import { ActionDescriptor, ClientRequestEntry, ClientRequestOptions, ClientRequestResponse, FetchResponse, HttpClient, RequestConfigSchema, ServerHandler, ServerRequestConfigEntry, ServerTimingProvider } from "alepha/server";
@@ -135,7 +135,7 @@ interface RemoteDescriptorOptions {
135
135
  *
136
136
  * class App {
137
137
  * env = $env(t.object({
138
- * REMOTE_URL: t.string({default: "http://localhost:3000"}),
138
+ * REMOTE_URL: t.text({default: "http://localhost:3000"}),
139
139
  * }));
140
140
  * remote = $remote({
141
141
  * url: this.env.REMOTE_URL,
@@ -181,8 +181,8 @@ declare class RemoteDescriptorProvider {
181
181
  protected readonly remotes: Array<ServerRemote>;
182
182
  protected readonly log: _alepha_logger0.Logger;
183
183
  getRemotes(): ServerRemote[];
184
- readonly configure: _alepha_core1.HookDescriptor<"configure">;
185
- readonly start: _alepha_core1.HookDescriptor<"start">;
184
+ readonly configure: _alepha_core2.HookDescriptor<"configure">;
185
+ readonly start: _alepha_core2.HookDescriptor<"start">;
186
186
  registerRemote(value: RemoteDescriptor): Promise<void>;
187
187
  protected readonly fetchLinks: _alepha_retry0.RetryDescriptorFn<(opts: FetchLinksOptions) => Promise<ApiLinksResponse>>;
188
188
  }
@@ -250,7 +250,7 @@ declare class ServerLinksProvider {
250
250
  protected readonly remoteProvider: RemoteDescriptorProvider;
251
251
  protected readonly serverTimingProvider: ServerTimingProvider;
252
252
  get prefix(): string;
253
- readonly onRoute: _alepha_core1.HookDescriptor<"configure">;
253
+ readonly onRoute: _alepha_core2.HookDescriptor<"configure">;
254
254
  /**
255
255
  * First API - Get all API links for the user.
256
256
  *
@@ -310,7 +310,7 @@ declare module "alepha" {
310
310
  * @see {@link $client}
311
311
  * @module alepha.server.links
312
312
  */
313
- declare const AlephaServerLinks: _alepha_core1.Service<_alepha_core1.Module<{}>>;
313
+ declare const AlephaServerLinks: _alepha_core2.Service<_alepha_core2.Module<{}>>;
314
314
  //#endregion
315
315
  export { $client, $remote, AlephaServerLinks, ApiLink, ApiLinksResponse, ClientScope, FetchLinksOptions, GetApiLinksOptions, HttpClientLink, HttpVirtualClient, LinkProvider, RemoteDescriptor, RemoteDescriptorOptions, RemoteDescriptorProvider, ServerLinksProvider, ServerRemote, VirtualAction, apiLinkSchema, apiLinksResponseSchema };
316
316
  //# sourceMappingURL=index.d.ts.map
package/server.d.ts CHANGED
@@ -46,7 +46,7 @@ declare class ServerReply {
46
46
  interface UserAgentInfo {
47
47
  os: "Windows" | "Android" | "Ubuntu" | "MacOS" | "iOS" | "Linux" | "FreeBSD" | "OpenBSD" | "ChromeOS" | "BlackBerry" | "Symbian" | "Windows Phone";
48
48
  browser: "Chrome" | "Firefox" | "Safari" | "Edge" | "Opera" | "Internet Explorer" | "Brave" | "Vivaldi" | "Samsung Browser" | "UC Browser" | "Yandex";
49
- device: "Mobile" | "Desktop" | "Tablet";
49
+ device: "MOBILE" | "DESKTOP" | "TABLET";
50
50
  }
51
51
  /**
52
52
  * Simple User-Agent parser to detect OS, browser, and device type.
@@ -72,7 +72,7 @@ interface ServerRequestConfig<TConfig extends RequestConfigSchema = RequestConfi
72
72
  body: TConfig["body"] extends TRequestBody ? Static<TConfig["body"]> : any;
73
73
  headers: TConfig["headers"] extends TObject ? Static<TConfig["headers"]> : Record<string, string>;
74
74
  params: TConfig["params"] extends TObject ? Static<TConfig["params"]> : Record<string, string>;
75
- query: TConfig["query"] extends TObject ? Static<TConfig["query"]> : Record<string, string>;
75
+ query: TConfig["query"] extends TObject ? Static<TConfig["query"]> : Record<string, any>;
76
76
  }
77
77
  type ServerRequestConfigEntry<TConfig extends RequestConfigSchema = RequestConfigSchema> = Partial<ServerRequestConfig<TConfig>>;
78
78
  interface ServerRequest<TConfig extends RequestConfigSchema = RequestConfigSchema> extends ServerRequestConfig<TConfig> {
@@ -342,13 +342,13 @@ interface HttpAction {
342
342
  * query: t.object({
343
343
  * page: t.optional(t.number({ default: 1 })),
344
344
  * limit: t.optional(t.number({ default: 10, maximum: 100 })),
345
- * search: t.optional(t.string())
345
+ * search: t.optional(t.text())
346
346
  * }),
347
347
  * response: t.object({
348
348
  * users: t.array(t.object({
349
- * id: t.string(),
350
- * name: t.string(),
351
- * email: t.string(),
349
+ * id: t.text(),
350
+ * name: t.text(),
351
+ * email: t.text(),
352
352
  * createdAt: t.datetime()
353
353
  * })),
354
354
  * total: t.number(),
@@ -373,16 +373,16 @@ interface HttpAction {
373
373
  * description: "Create a new user account",
374
374
  * schema: {
375
375
  * body: t.object({
376
- * name: t.string({ minLength: 2, maxLength: 100 }),
377
- * email: t.string({ format: "email" }),
378
- * password: t.string({ minLength: 8 }),
376
+ * name: t.text({ minLength: 2, maxLength: 100 }),
377
+ * email: t.text({ format: "email" }),
378
+ * password: t.text({ minLength: 8 }),
379
379
  * role: t.optional(t.enum(["user", "admin"]))
380
380
  * }),
381
381
  * response: t.object({
382
- * id: t.string(),
383
- * name: t.string(),
384
- * email: t.string(),
385
- * role: t.string(),
382
+ * id: t.text(),
383
+ * name: t.text(),
384
+ * email: t.text(),
385
+ * role: t.text(),
386
386
  * createdAt: t.datetime()
387
387
  * })
388
388
  * },
@@ -409,17 +409,17 @@ interface HttpAction {
409
409
  * description: "Retrieve user by ID",
410
410
  * schema: {
411
411
  * params: t.object({
412
- * id: t.string()
412
+ * id: t.text()
413
413
  * }),
414
414
  * response: t.object({
415
- * id: t.string(),
416
- * name: t.string(),
417
- * email: t.string(),
418
- * role: t.string(),
415
+ * id: t.text(),
416
+ * name: t.text(),
417
+ * email: t.text(),
418
+ * role: t.text(),
419
419
  * profile: t.optional(t.object({
420
- * bio: t.string(),
421
- * avatar: t.string({ format: "uri" }),
422
- * location: t.string()
420
+ * bio: t.text(),
421
+ * avatar: t.text({ format: "uri" }),
422
+ * location: t.text()
423
423
  * }))
424
424
  * })
425
425
  * },
@@ -437,20 +437,20 @@ interface HttpAction {
437
437
  * path: "/users/:id",
438
438
  * description: "Update user information",
439
439
  * schema: {
440
- * params: t.object({ id: t.string() }),
440
+ * params: t.object({ id: t.text() }),
441
441
  * body: t.object({
442
- * name: t.optional(t.string({ minLength: 2 })),
443
- * email: t.optional(t.string({ format: "email" })),
442
+ * name: t.optional(t.text({ minLength: 2 })),
443
+ * email: t.optional(t.text({ format: "email" })),
444
444
  * profile: t.optional(t.object({
445
- * bio: t.optional(t.string()),
446
- * avatar: t.optional(t.string({ format: "uri" })),
447
- * location: t.optional(t.string())
445
+ * bio: t.optional(t.text()),
446
+ * avatar: t.optional(t.text({ format: "uri" })),
447
+ * location: t.optional(t.text())
448
448
  * }))
449
449
  * }),
450
450
  * response: t.object({
451
- * id: t.string(),
452
- * name: t.string(),
453
- * email: t.string(),
451
+ * id: t.text(),
452
+ * name: t.text(),
453
+ * email: t.text(),
454
454
  * updatedAt: t.datetime()
455
455
  * })
456
456
  * },