alepha 0.7.5 → 0.7.7

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 (111) hide show
  1. package/cache/redis.cjs +4 -8
  2. package/cache/redis.d.ts +28 -89
  3. package/cache/redis.js +1 -1
  4. package/cache.cjs +4 -8
  5. package/cache.d.ts +189 -265
  6. package/cache.js +1 -1
  7. package/core.cjs +4 -8
  8. package/core.d.ts +951 -929
  9. package/core.js +1 -1
  10. package/datetime.cjs +4 -8
  11. package/datetime.d.ts +151 -146
  12. package/datetime.js +1 -1
  13. package/lock/redis.cjs +7 -49
  14. package/lock/redis.d.ts +15 -12
  15. package/lock/redis.js +1 -47
  16. package/lock.cjs +4 -8
  17. package/lock.d.ts +117 -170
  18. package/lock.js +1 -1
  19. package/package.json +105 -39
  20. package/postgres.cjs +4 -8
  21. package/postgres.d.ts +1410 -4433
  22. package/postgres.js +1 -1
  23. package/queue/redis.cjs +8 -0
  24. package/queue/redis.d.ts +31 -0
  25. package/queue/redis.js +1 -0
  26. package/queue.cjs +4 -8
  27. package/queue.d.ts +162 -205
  28. package/queue.js +1 -1
  29. package/react/auth.cjs +4 -8
  30. package/react/auth.d.ts +161 -282
  31. package/react/auth.js +1 -1
  32. package/react/head.cjs +8 -0
  33. package/react/head.d.ts +86 -0
  34. package/react/head.js +1 -0
  35. package/react.cjs +4 -8
  36. package/react.d.ts +468 -559
  37. package/react.js +1 -1
  38. package/redis.cjs +4 -8
  39. package/redis.d.ts +59 -132
  40. package/redis.js +1 -1
  41. package/retry.cjs +4 -8
  42. package/retry.d.ts +34 -31
  43. package/retry.js +1 -1
  44. package/scheduler.cjs +4 -8
  45. package/scheduler.d.ts +124 -182
  46. package/scheduler.js +1 -1
  47. package/security.cjs +4 -8
  48. package/security.d.ts +459 -595
  49. package/security.js +1 -1
  50. package/server/cache.cjs +4 -8
  51. package/server/cache.d.ts +43 -40
  52. package/server/cache.js +1 -1
  53. package/server/cookies.cjs +4 -8
  54. package/server/cookies.d.ts +49 -41
  55. package/server/cookies.js +1 -1
  56. package/server/cors.cjs +8 -0
  57. package/server/cors.d.ts +25 -0
  58. package/server/cors.js +1 -0
  59. package/server/health.cjs +8 -0
  60. package/server/health.d.ts +42 -0
  61. package/server/health.js +1 -0
  62. package/server/links.cjs +8 -0
  63. package/server/links.d.ts +188 -0
  64. package/server/links.js +1 -0
  65. package/server/proxy.cjs +8 -0
  66. package/server/proxy.d.ts +41 -0
  67. package/server/proxy.js +1 -0
  68. package/server/static.cjs +4 -8
  69. package/server/static.d.ts +98 -95
  70. package/server/static.js +1 -1
  71. package/server/swagger.cjs +4 -8
  72. package/server/swagger.d.ts +96 -92
  73. package/server/swagger.js +1 -1
  74. package/server.cjs +4 -8
  75. package/server.d.ts +602 -1087
  76. package/server.js +1 -1
  77. package/testing.cjs +8 -0
  78. package/testing.d.ts +1 -0
  79. package/testing.js +1 -0
  80. package/topic/redis.cjs +8 -0
  81. package/topic/redis.d.ts +45 -0
  82. package/topic/redis.js +1 -0
  83. package/topic.cjs +4 -8
  84. package/topic.d.ts +161 -169
  85. package/topic.js +1 -1
  86. package/vite.cjs +4 -8
  87. package/vite.d.ts +89 -82
  88. package/vite.js +1 -1
  89. package/src/cache/redis.ts +0 -1
  90. package/src/cache.ts +0 -1
  91. package/src/core.ts +0 -1
  92. package/src/datetime.ts +0 -1
  93. package/src/lock/redis.ts +0 -1
  94. package/src/lock.ts +0 -1
  95. package/src/postgres.ts +0 -1
  96. package/src/queue/redis.ts +0 -1
  97. package/src/queue.ts +0 -1
  98. package/src/react/auth.ts +0 -1
  99. package/src/react.ts +0 -1
  100. package/src/redis.ts +0 -1
  101. package/src/retry.ts +0 -1
  102. package/src/scheduler.ts +0 -1
  103. package/src/security.ts +0 -1
  104. package/src/server/cache.ts +0 -1
  105. package/src/server/cookies.ts +0 -1
  106. package/src/server/static.ts +0 -1
  107. package/src/server/swagger.ts +0 -1
  108. package/src/server.ts +0 -1
  109. package/src/topic/redis.ts +0 -1
  110. package/src/topic.ts +0 -1
  111. package/src/vite.ts +0 -1
package/react/auth.d.ts CHANGED
@@ -1,307 +1,185 @@
1
- import * as _alepha_core from '@alepha/core';
2
- import { Async, KIND, OPTIONS, Alepha, Module } from '@alepha/core';
3
- import { UserAccountToken } from '@alepha/security';
4
- import * as _alepha_server from '@alepha/server';
5
- import { HttpVirtualClient, HttpClient } from '@alepha/server';
6
- import * as _alepha_server_cookies from '@alepha/server-cookies';
7
- import { ServerCookiesProvider, Cookies } from '@alepha/server-cookies';
8
- import { Configuration } from 'openid-client';
9
-
10
- /** Symbol key applied to readonly types */
11
- declare const ReadonlyKind: unique symbol;
12
- /** Symbol key applied to optional types */
13
- declare const OptionalKind: unique symbol;
14
- /** Symbol key applied to types */
15
- declare const Hint: unique symbol;
16
- /** Symbol key applied to types */
17
- declare const Kind: unique symbol;
18
-
19
- type TReadonly<T extends TSchema> = T & {
20
- [ReadonlyKind]: 'Readonly';
21
- };
22
-
23
- type StringFormatOption = 'date-time' | 'time' | 'date' | 'email' | 'idn-email' | 'hostname' | 'idn-hostname' | 'ipv4' | 'ipv6' | 'uri' | 'uri-reference' | 'iri' | 'uuid' | 'iri-reference' | 'uri-template' | 'json-pointer' | 'relative-json-pointer' | 'regex' | ({} & string);
24
- type StringContentEncodingOption = '7bit' | '8bit' | 'binary' | 'quoted-printable' | 'base64' | ({} & string);
25
- interface StringOptions extends SchemaOptions {
26
- /** The maximum string length */
27
- maxLength?: number;
28
- /** The minimum string length */
29
- minLength?: number;
30
- /** A regular expression pattern this string should match */
31
- pattern?: string;
32
- /** A format this string should match */
33
- format?: StringFormatOption;
34
- /** The content encoding for this string */
35
- contentEncoding?: StringContentEncodingOption;
36
- /** The content media type for this string */
37
- contentMediaType?: string;
38
- }
39
- interface TString extends TSchema, StringOptions {
40
- [Kind]: 'String';
41
- static: string;
42
- type: 'string';
43
- }
44
-
45
- interface NumberOptions extends SchemaOptions {
46
- exclusiveMaximum?: number;
47
- exclusiveMinimum?: number;
48
- maximum?: number;
49
- minimum?: number;
50
- multipleOf?: number;
51
- }
52
- interface TNumber extends TSchema, NumberOptions {
53
- [Kind]: 'Number';
54
- static: number;
55
- type: 'number';
56
- }
57
-
58
- type TOptional<T extends TSchema> = T & {
59
- [OptionalKind]: 'Optional';
60
- };
61
-
62
- /** Creates a static type from a TypeBox type */
63
- type Static<Type extends TSchema, Params extends unknown[] = [], Result = (Type & {
64
- params: Params;
65
- })['static']> = Result;
66
-
67
- type ReadonlyOptionalPropertyKeys<T extends TProperties> = {
68
- [K in keyof T]: T[K] extends TReadonly<TSchema> ? (T[K] extends TOptional<T[K]> ? K : never) : never;
69
- }[keyof T];
70
- type ReadonlyPropertyKeys<T extends TProperties> = {
71
- [K in keyof T]: T[K] extends TReadonly<TSchema> ? (T[K] extends TOptional<T[K]> ? never : K) : never;
72
- }[keyof T];
73
- type OptionalPropertyKeys<T extends TProperties> = {
74
- [K in keyof T]: T[K] extends TOptional<TSchema> ? (T[K] extends TReadonly<T[K]> ? never : K) : never;
75
- }[keyof T];
76
- type RequiredPropertyKeys<T extends TProperties> = keyof Omit<T, ReadonlyOptionalPropertyKeys<T> | ReadonlyPropertyKeys<T> | OptionalPropertyKeys<T>>;
77
- type ObjectStaticProperties<T extends TProperties, R extends Record<keyof any, unknown>> = Evaluate<(Readonly<Partial<Pick<R, ReadonlyOptionalPropertyKeys<T>>>> & Readonly<Pick<R, ReadonlyPropertyKeys<T>>> & Partial<Pick<R, OptionalPropertyKeys<T>>> & Required<Pick<R, RequiredPropertyKeys<T>>>)>;
78
- type ObjectStatic<T extends TProperties, P extends unknown[]> = ObjectStaticProperties<T, {
79
- [K in keyof T]: Static<T[K], P>;
80
- }>;
81
- type TPropertyKey = string | number;
82
- type TProperties = Record<TPropertyKey, TSchema>;
83
- type TAdditionalProperties = undefined | TSchema | boolean;
84
- interface ObjectOptions extends SchemaOptions {
85
- /** Additional property constraints for this object */
86
- additionalProperties?: TAdditionalProperties;
87
- /** The minimum number of properties allowed on this object */
88
- minProperties?: number;
89
- /** The maximum number of properties allowed on this object */
90
- maxProperties?: number;
91
- }
92
- interface TObject<T extends TProperties = TProperties> extends TSchema, ObjectOptions {
93
- [Kind]: 'Object';
94
- static: ObjectStatic<T, this['params']>;
95
- additionalProperties?: TAdditionalProperties;
96
- type: 'object';
97
- properties: T;
98
- required?: string[];
99
- }
100
-
101
- type Evaluate<T> = T extends infer O ? {
102
- [K in keyof O]: O[K];
103
- } : never;
104
-
105
- interface SchemaOptions {
106
- $schema?: string;
107
- /** Id for this schema */
108
- $id?: string;
109
- /** Title of this schema */
110
- title?: string;
111
- /** Description of this schema */
112
- description?: string;
113
- /** Default value for this schema */
114
- default?: any;
115
- /** Example values matching this schema */
116
- examples?: any;
117
- /** Optional annotation for readOnly */
118
- readOnly?: boolean;
119
- /** Optional annotation for writeOnly */
120
- writeOnly?: boolean;
121
- [prop: string]: any;
122
- }
123
- interface TKind {
124
- [Kind]: string;
125
- }
126
- interface TSchema extends TKind, SchemaOptions {
127
- [ReadonlyKind]?: string;
128
- [OptionalKind]?: string;
129
- [Hint]?: string;
130
- params: unknown[];
131
- static: unknown;
132
- }
1
+ import * as _alepha_core1 from "@alepha/core";
2
+ import * as _alepha_core52 from "@alepha/core";
3
+ import { Alepha, Async, KIND, Module, OPTIONS } from "@alepha/core";
4
+ import * as _alepha_server_cookies7 from "@alepha/server-cookies";
5
+ import { Cookies, ServerCookiesProvider } from "@alepha/server-cookies";
6
+ import * as _alepha_server41 from "@alepha/server";
7
+ import { HttpClient } from "@alepha/server";
8
+ import { Configuration } from "openid-client";
9
+ import { HttpVirtualClient } from "@alepha/server-links";
10
+ import { UserAccountToken } from "@alepha/security";
11
+ import * as _sinclair_typebox2 from "@sinclair/typebox";
133
12
 
13
+ //#region src/descriptors/$auth.d.ts
134
14
  declare const KEY = "AUTH";
135
15
  type AccessToken = string;
136
16
  interface AuthDescriptorOptions {
137
- name?: string;
138
- fallback?: () => Async<AccessToken>;
139
- oidc?: {
140
- issuer: string;
141
- clientId: string;
142
- clientSecret?: string;
143
- redirectUri?: string;
144
- useIdToken?: boolean;
145
- logoutUri?: string;
146
- };
17
+ name?: string;
18
+ fallback?: () => Async<AccessToken>;
19
+ oidc?: {
20
+ issuer: string;
21
+ clientId: string;
22
+ clientSecret?: string;
23
+ redirectUri?: string;
24
+ useIdToken?: boolean;
25
+ logoutUri?: string;
26
+ };
147
27
  }
148
28
  interface AuthDescriptor {
149
- [KIND]: typeof KEY;
150
- [OPTIONS]: AuthDescriptorOptions;
151
- jwks: () => string;
29
+ [KIND]: typeof KEY;
30
+ [OPTIONS]: AuthDescriptorOptions;
31
+ jwks: () => string;
152
32
  }
153
33
  declare const $auth: {
154
- (options: AuthDescriptorOptions): AuthDescriptor;
155
- [KIND]: string;
34
+ (options: AuthDescriptorOptions): AuthDescriptor;
35
+ [KIND]: string;
156
36
  };
157
-
37
+ //#endregion
38
+ //#region src/providers/ReactAuthProvider.d.ts
158
39
  declare class ReactAuthProvider {
159
- protected readonly log: _alepha_core.Logger;
160
- protected readonly alepha: Alepha;
161
- protected readonly serverCookiesProvider: ServerCookiesProvider;
162
- protected authProviders: AuthProvider[];
163
- protected readonly authorizationCode: _alepha_server_cookies.CookieDescriptor<TObject<{
164
- codeVerifier: TOptional<TString>;
165
- redirectUri: TOptional<TString>;
166
- }>>;
167
- protected readonly tokens: _alepha_server_cookies.CookieDescriptor<TObject<{
168
- provider: TOptional<TString>;
169
- access_token: TOptional<TString>;
170
- expires_in: TOptional<TNumber>;
171
- refresh_token: TOptional<TString>;
172
- id_token: TOptional<TString>;
173
- scope: TOptional<TString>;
174
- issued_at: TOptional<TNumber>;
175
- }>>;
176
- readonly user: _alepha_server_cookies.CookieDescriptor<TObject<{
177
- id: TString;
178
- name: TOptional<TString>;
179
- email: TOptional<TString>;
180
- picture: TOptional<TString>;
181
- }>>;
182
- readonly onRender: _alepha_core.HookDescriptor<"react:server:render">;
183
- protected readonly configure: _alepha_core.HookDescriptor<"configure">;
184
- protected getAccessTokenFromCookies(tokens: SessionTokens): Promise<string | undefined>;
185
- /**
186
- * Configure Fastify to forward Session Access Token to Header Authorization.
187
- */
188
- protected readonly onRequest: _alepha_core.HookDescriptor<"server:onRequest">;
189
- /**
190
- *
191
- * @param cookies
192
- * @protected
193
- */
194
- protected refresh(cookies: Cookies): Promise<SessionTokens | undefined>;
195
- /**
196
- *
197
- */
198
- readonly login: _alepha_server.RouteDescriptor<{
199
- query: TObject<{
200
- redirect: TOptional<TString>;
201
- provider: TOptional<TString>;
202
- }>;
203
- }>;
204
- /**
205
- *
206
- */
207
- readonly callback: _alepha_server.RouteDescriptor<{
208
- query: TObject<{
209
- provider: TOptional<TString>;
210
- }>;
40
+ protected readonly log: _alepha_core1.Logger;
41
+ protected readonly alepha: Alepha;
42
+ protected readonly serverCookiesProvider: ServerCookiesProvider;
43
+ protected authProviders: AuthProvider[];
44
+ protected readonly authorizationCode: _alepha_server_cookies7.CookieDescriptor<_sinclair_typebox2.TObject<{
45
+ codeVerifier: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
46
+ redirectUri: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
47
+ }>>;
48
+ protected readonly tokens: _alepha_server_cookies7.CookieDescriptor<_sinclair_typebox2.TObject<{
49
+ provider: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
50
+ access_token: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
51
+ expires_in: _sinclair_typebox2.TOptional<_sinclair_typebox2.TNumber>;
52
+ refresh_token: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
53
+ id_token: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
54
+ scope: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
55
+ issued_at: _sinclair_typebox2.TOptional<_sinclair_typebox2.TNumber>;
56
+ }>>;
57
+ readonly user: _alepha_server_cookies7.CookieDescriptor<_sinclair_typebox2.TObject<{
58
+ id: _sinclair_typebox2.TString;
59
+ name: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
60
+ email: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
61
+ picture: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
62
+ }>>;
63
+ readonly onRender: _alepha_core1.HookDescriptor<"react:server:render:begin">;
64
+ protected readonly configure: _alepha_core1.HookDescriptor<"configure">;
65
+ protected getAccessTokenFromCookies(tokens: SessionTokens): Promise<string | undefined>;
66
+ /**
67
+ * Configure Fastify to forward Session Access Token to Header Authorization.
68
+ */
69
+ protected readonly onRequest: _alepha_core1.HookDescriptor<"server:onRequest">;
70
+ /**
71
+ *
72
+ * @param cookies
73
+ * @protected
74
+ */
75
+ protected refresh(cookies: Cookies): Promise<SessionTokens | undefined>;
76
+ readonly login: _alepha_server41.RouteDescriptor<{
77
+ query: _sinclair_typebox2.TObject<{
78
+ redirect: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
79
+ provider: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
211
80
  }>;
212
- /**
213
- *
214
- * @param accessToken
215
- * @protected
216
- */
217
- protected userFromAccessToken(accessToken: string): {
218
- id: any;
219
- name: any;
220
- email: any;
221
- picture: any;
222
- } | undefined;
223
- readonly logout: _alepha_server.RouteDescriptor<{
224
- query: TObject<{
225
- redirect: TOptional<TString>;
226
- provider: TOptional<TString>;
227
- }>;
81
+ }>;
82
+ readonly callback: _alepha_server41.RouteDescriptor<{
83
+ query: _sinclair_typebox2.TObject<{
84
+ provider: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
228
85
  }>;
229
- /**
230
- *
231
- * @param name
232
- * @protected
233
- */
234
- protected provider(name?: string): Promise<{
235
- client: Configuration;
236
- name: string;
237
- redirectUri: string;
238
- fallback?: () => Async<AccessToken>;
239
- useIdToken?: boolean;
240
- logoutUri?: string;
86
+ }>;
87
+ /**
88
+ *
89
+ * @param accessToken
90
+ * @protected
91
+ */
92
+ protected userFromAccessToken(accessToken: string): {
93
+ id: any;
94
+ name: any;
95
+ email: any;
96
+ picture: any;
97
+ } | undefined;
98
+ readonly logout: _alepha_server41.RouteDescriptor<{
99
+ query: _sinclair_typebox2.TObject<{
100
+ redirect: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
101
+ provider: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
241
102
  }>;
242
- /**
243
- *
244
- * @param file
245
- * @protected
246
- */
247
- protected isViteFile(file: string): boolean;
248
- }
249
- interface SessionTokens {
250
- access_token?: string;
251
- expires_in?: number;
252
- refresh_token?: string;
253
- id_token?: string;
254
- scope?: string;
255
- issued_at?: number;
256
- provider?: string;
257
- }
258
- interface AuthProvider {
103
+ }>;
104
+ /**
105
+ *
106
+ * @param name
107
+ * @protected
108
+ */
109
+ protected provider(name?: string): Promise<{
110
+ client: Configuration;
259
111
  name: string;
260
112
  redirectUri: string;
261
- client: {
262
- get: () => Promise<Configuration>;
263
- };
264
113
  fallback?: () => Async<AccessToken>;
265
114
  useIdToken?: boolean;
266
115
  logoutUri?: string;
116
+ }>;
117
+ /**
118
+ *
119
+ * @param file
120
+ * @protected
121
+ */
122
+ protected isViteFile(file: string): boolean;
123
+ }
124
+ interface SessionTokens {
125
+ access_token?: string;
126
+ expires_in?: number;
127
+ refresh_token?: string;
128
+ id_token?: string;
129
+ scope?: string;
130
+ issued_at?: number;
131
+ provider?: string;
132
+ }
133
+ interface AuthProvider {
134
+ name: string;
135
+ redirectUri: string;
136
+ client: {
137
+ get: () => Promise<Configuration>;
138
+ };
139
+ fallback?: () => Async<AccessToken>;
140
+ useIdToken?: boolean;
141
+ logoutUri?: string;
267
142
  }
268
143
  interface ReactUser {
269
- id: string;
270
- name?: string;
271
- email?: string;
144
+ id: string;
145
+ name?: string;
146
+ email?: string;
272
147
  }
273
-
148
+ //#endregion
149
+ //#region src/hooks/useAuth.d.ts
274
150
  declare const useAuth: () => AuthHook;
275
151
  interface AuthHook {
276
- user?: UserAccountToken;
277
- logout: () => void;
278
- login: (provider?: string) => void;
279
- can: <T extends object>(name: keyof HttpVirtualClient<T>) => boolean;
152
+ user?: UserAccountToken;
153
+ logout: () => void;
154
+ login: (provider?: string) => void;
155
+ can: <T extends object>(name: keyof HttpVirtualClient<T>) => boolean;
280
156
  }
281
-
157
+ //#endregion
158
+ //#region src/services/ReactAuth.d.ts
282
159
  declare class ReactAuth {
283
- protected readonly log: _alepha_core.Logger;
284
- protected readonly alepha: Alepha;
285
- protected readonly client: HttpClient;
286
- static path: {
287
- login: string;
288
- callback: string;
289
- logout: string;
290
- };
291
- readonly onRender: _alepha_core.HookDescriptor<"react:transition:begin">;
292
- get user(): UserAccountToken | undefined;
293
- protected getUserFromCookies(): UserAccountToken | undefined;
294
- login(): void;
295
- logout(): void;
296
- }
297
-
160
+ protected readonly log: _alepha_core52.Logger;
161
+ protected readonly alepha: Alepha;
162
+ protected readonly client: HttpClient;
163
+ static path: {
164
+ login: string;
165
+ callback: string;
166
+ logout: string;
167
+ };
168
+ readonly onRender: _alepha_core52.HookDescriptor<"react:transition:begin">;
169
+ get user(): UserAccountToken | undefined;
170
+ protected getUserFromCookies(): UserAccountToken | undefined;
171
+ login(): void;
172
+ logout(): void;
173
+ }
174
+ //#endregion
175
+ //#region src/index.d.ts
298
176
  declare module "alepha/react" {
299
- interface PageReactContext {
300
- user?: UserAccountToken;
301
- }
302
- interface ReactHydrationState {
303
- user?: ReactUser;
304
- }
177
+ interface PageReactContext {
178
+ user?: UserAccountToken;
179
+ }
180
+ interface ReactHydrationState {
181
+ user?: ReactUser;
182
+ }
305
183
  }
306
184
  /**
307
185
  * Alepha React Authentication Module
@@ -312,8 +190,9 @@ declare module "alepha/react" {
312
190
  * @module alepha.react.auth
313
191
  */
314
192
  declare class AlephaReactAuth implements Module {
315
- readonly name = "alepha.react.auth";
316
- readonly $services: (alepha: Alepha) => void;
193
+ readonly name = "alepha.react.auth";
194
+ readonly $services: (alepha: Alepha) => void;
317
195
  }
318
-
319
- export { $auth, type AccessToken, AlephaReactAuth, type AuthDescriptor, type AuthDescriptorOptions, type AuthHook, type AuthProvider, ReactAuth, ReactAuthProvider, type ReactUser, type SessionTokens, useAuth };
196
+ //#endregion
197
+ export { $auth, AccessToken, AlephaReactAuth, AuthDescriptor, AuthDescriptorOptions, AuthHook, AuthProvider, ReactAuth, ReactAuthProvider, ReactUser, SessionTokens, useAuth };
198
+ //# sourceMappingURL=index.d.ts.map
package/react/auth.js CHANGED
@@ -1 +1 @@
1
- export * from '@alepha/react-auth';
1
+ export * from '@alepha/react-auth'
package/react/head.cjs ADDED
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+ var m = require('@alepha/react-head');
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
+ });
@@ -0,0 +1,86 @@
1
+ import { PageConfigSchema, PageReactContext, PageRoute, RouterState, TPropsDefault, TPropsParentDefault } from "@alepha/react";
2
+ import * as _alepha_core1 from "@alepha/core";
3
+ import { Alepha, Module } from "@alepha/core";
4
+
5
+ //#region src/interfaces/Head.d.ts
6
+ interface Head extends SimpleHead {
7
+ description?: string;
8
+ keywords?: string[];
9
+ author?: string;
10
+ robots?: string;
11
+ themeColor?: string;
12
+ viewport?: string | {
13
+ width?: string;
14
+ height?: string;
15
+ initialScale?: string;
16
+ maximumScale?: string;
17
+ userScalable?: "no" | "yes" | "0" | "1";
18
+ interactiveWidget?: "resizes-visual" | "resizes-content" | "overlays-content";
19
+ };
20
+ og?: {
21
+ title?: string;
22
+ description?: string;
23
+ image?: string;
24
+ url?: string;
25
+ type?: string;
26
+ };
27
+ twitter?: {
28
+ card?: string;
29
+ title?: string;
30
+ description?: string;
31
+ image?: string;
32
+ site?: string;
33
+ };
34
+ }
35
+ interface SimpleHead {
36
+ title?: string;
37
+ titleSeparator?: string;
38
+ htmlAttributes?: Record<string, string>;
39
+ bodyAttributes?: Record<string, string>;
40
+ meta?: Array<{
41
+ name: string;
42
+ content: string;
43
+ }>;
44
+ }
45
+ //#endregion
46
+ //#region src/hooks/useHead.d.ts
47
+ declare const useHead: (head?: Head | ((previous?: Head) => Head)) => void;
48
+ //#endregion
49
+ //#region src/providers/HeadProvider.d.ts
50
+ declare class HeadProvider {
51
+ fillHead(state: RouterState, context: PageReactContext): void;
52
+ protected fillHeadByPage(page: PageRoute, context: PageReactContext, props: Record<string, any>): void;
53
+ }
54
+ //#endregion
55
+ //#region src/providers/ServerHeadProvider.d.ts
56
+ declare class ServerHeadProvider {
57
+ protected readonly headProvider: HeadProvider;
58
+ protected readonly onServerRenderEnd: _alepha_core1.HookDescriptor<"react:server:render:end">;
59
+ renderHead(template: string, head: SimpleHead): string;
60
+ protected mergeAttributes(existing: string, attrs: Record<string, string>): string;
61
+ protected parseAttributes(attrStr: string): Record<string, string>;
62
+ protected escapeHtml(str: string): string;
63
+ }
64
+ //#endregion
65
+ //#region src/index.d.ts
66
+ declare module "alepha/react" {
67
+ interface PageDescriptorOptions<TConfig extends PageConfigSchema = PageConfigSchema, TProps extends object = TPropsDefault, TPropsParent extends object = TPropsParentDefault> {
68
+ head?: Head | ((props: TProps, previous?: Head) => Head);
69
+ }
70
+ interface PageReactContext {
71
+ head: Head;
72
+ }
73
+ }
74
+ /**
75
+ * Alepha React Head Module
76
+ *
77
+ * @see {@link ServerHeadProvider}
78
+ * @module alepha.react.head
79
+ */
80
+ declare class AlephaReactHead implements Module {
81
+ readonly name = "alepha.react.head";
82
+ readonly $services: (alepha: Alepha) => Alepha;
83
+ }
84
+ //#endregion
85
+ export { AlephaReactHead, Head, ServerHeadProvider, SimpleHead, useHead };
86
+ //# sourceMappingURL=index.d.ts.map
package/react/head.js ADDED
@@ -0,0 +1 @@
1
+ export * from '@alepha/react-head'
package/react.cjs CHANGED
@@ -1,12 +1,8 @@
1
1
  'use strict';
2
-
3
- var react = require('@alepha/react');
4
-
5
-
6
-
7
- Object.keys(react).forEach(function (k) {
2
+ var m = require('@alepha/react');
3
+ Object.keys(m).forEach(function (k) {
8
4
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
9
5
  enumerable: true,
10
- get: function () { return react[k]; }
6
+ get: function () { return m[k]; }
11
7
  });
12
- });
8
+ });