@holo-js/core 0.1.4 → 0.1.6
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/dist/{chunk-4VPELMZN.mjs → chunk-OAA4RKVE.mjs} +468 -331
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +40 -11
- package/dist/runtime/index.d.ts +112 -28
- package/dist/runtime/index.mjs +1 -1
- package/package.json +40 -23
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GeneratedProjectRegistry, HoloRuntime, HoloSessionRuntimeBinding, HoloAuthRuntimeBinding, CreateHoloOptions } from './runtime/index.js';
|
|
2
|
-
export { HoloQueueRuntimeBinding, HoloServerViewRenderInput, HoloServerViewRenderer, configureHoloRenderingRuntime, createHolo, ensureHolo, getHolo, holoRuntimeInternals, initializeHolo, loadGeneratedBroadcastManifest, loadGeneratedProjectRegistry, peekHolo, reconfigureOptionalHoloSubsystems, registryInternals, resetHoloRenderingRuntime, resetHoloRuntime, resetOptionalHoloSubsystems, resolveGeneratedProjectRegistryPath } from './runtime/index.js';
|
|
2
|
+
export { GeneratedBroadcastManifest, GeneratedBroadcastManifestChannel, GeneratedBroadcastManifestEvent, HoloQueueRuntimeBinding, HoloServerViewRenderInput, HoloServerViewRenderer, configureHoloRenderingRuntime, createHolo, ensureHolo, getHolo, holoRuntimeInternals, initializeHolo, loadGeneratedBroadcastManifest, loadGeneratedProjectRegistry, peekHolo, reconfigureOptionalHoloSubsystems, registryInternals, resetHoloRenderingRuntime, resetHoloRuntime, resetOptionalHoloSubsystems, resolveGeneratedProjectRegistryPath } from './runtime/index.js';
|
|
3
3
|
import { HoloConfigMap, LoadedHoloConfig, DotPath, ValueAtPath } from '@holo-js/config';
|
|
4
4
|
export { createRuntimeConnectionOptions, resolveRuntimeConnectionManagerOptions } from '@holo-js/db';
|
|
5
5
|
|
package/dist/index.mjs
CHANGED
|
@@ -17,11 +17,11 @@ import {
|
|
|
17
17
|
resolveGeneratedProjectRegistryPath,
|
|
18
18
|
resolveRuntimeConnectionManagerOptions,
|
|
19
19
|
resolveStorageKeyPath
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-OAA4RKVE.mjs";
|
|
21
21
|
|
|
22
22
|
// src/adapter.ts
|
|
23
|
-
import { readdir, stat } from "fs/promises";
|
|
24
|
-
import { extname, join, resolve } from "path";
|
|
23
|
+
import { readdir, stat } from "node:fs/promises";
|
|
24
|
+
import { extname, join, resolve } from "node:path";
|
|
25
25
|
import { configureConfigRuntime, resolveEnvironmentFileOrder } from "@holo-js/config";
|
|
26
26
|
import { configureDB } from "@holo-js/db";
|
|
27
27
|
var HOLO_MINIMUM_ADAPTER_CAPABILITIES = Object.freeze({
|
|
@@ -82,6 +82,8 @@ function resolveHoloFrameworkOptions(options = {}) {
|
|
|
82
82
|
preferCache: options.preferCache ?? processEnv.NODE_ENV === "production",
|
|
83
83
|
processEnv,
|
|
84
84
|
renderView: options.renderView,
|
|
85
|
+
authRequest: options.authRequest,
|
|
86
|
+
authorizationError: options.authorizationError,
|
|
85
87
|
registerProjectQueueJobs: options.registerProjectQueueJobs
|
|
86
88
|
}
|
|
87
89
|
};
|
|
@@ -112,6 +114,12 @@ function createHoloProjectAccessors(resolveProject) {
|
|
|
112
114
|
async function initializeSingletonFrameworkProject(stateKey, displayName, options, createProject) {
|
|
113
115
|
const resolved = resolveHoloFrameworkOptions(options);
|
|
114
116
|
const state = getFrameworkAdapterStateContainer(stateKey);
|
|
117
|
+
if (state.initialization) {
|
|
118
|
+
if (state.initialization.projectRoot !== resolved.projectRoot) {
|
|
119
|
+
throw new Error(`${displayName} Holo project already initialized for "${state.initialization.projectRoot}".`);
|
|
120
|
+
}
|
|
121
|
+
return state.initialization.promise;
|
|
122
|
+
}
|
|
115
123
|
if (state.project) {
|
|
116
124
|
if (state.projectRoot !== resolved.projectRoot) {
|
|
117
125
|
throw new Error(`${displayName} Holo project already initialized for "${state.projectRoot}".`);
|
|
@@ -136,10 +144,11 @@ async function initializeSingletonFrameworkProject(stateKey, displayName, option
|
|
|
136
144
|
configureConfigRuntime(currentRuntime.loadedConfig.all);
|
|
137
145
|
configureDB(currentRuntime.manager);
|
|
138
146
|
await reconfigureOptionalHoloSubsystems(state.project.projectRoot, currentRuntime.loadedConfig, {
|
|
139
|
-
renderView: resolved.runtime.renderView
|
|
147
|
+
renderView: resolved.runtime.renderView,
|
|
148
|
+
authRequest: resolved.runtime.authRequest,
|
|
149
|
+
authorizationError: resolved.runtime.authorizationError
|
|
140
150
|
});
|
|
141
151
|
if (state.project.runtime !== currentRuntime) {
|
|
142
|
-
;
|
|
143
152
|
state.project = {
|
|
144
153
|
...state.project,
|
|
145
154
|
config: currentRuntime.loadedConfig,
|
|
@@ -149,20 +158,38 @@ async function initializeSingletonFrameworkProject(stateKey, displayName, option
|
|
|
149
158
|
}
|
|
150
159
|
return state.project;
|
|
151
160
|
}
|
|
152
|
-
;
|
|
153
161
|
state.project = void 0;
|
|
154
162
|
}
|
|
155
|
-
const project = await createProject(resolved);
|
|
156
163
|
state.projectRoot = resolved.projectRoot;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
164
|
+
const initialization = Promise.resolve().then(() => createProject(resolved)).then(async (project) => {
|
|
165
|
+
state.projectRoot = resolved.projectRoot;
|
|
166
|
+
state.project = project;
|
|
167
|
+
state.sourceSignature = resolved.runtime.preferCache === false ? await resolveProjectSourceSignature(resolved.projectRoot, project.config.environment.name) : void 0;
|
|
168
|
+
return project;
|
|
169
|
+
}).catch((error) => {
|
|
170
|
+
if (state.initialization?.promise === initialization) {
|
|
171
|
+
state.project = void 0;
|
|
172
|
+
state.projectRoot = void 0;
|
|
173
|
+
state.sourceSignature = void 0;
|
|
174
|
+
}
|
|
175
|
+
throw error;
|
|
176
|
+
}).finally(() => {
|
|
177
|
+
if (state.initialization?.promise === initialization) {
|
|
178
|
+
state.initialization = void 0;
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
state.initialization = {
|
|
182
|
+
projectRoot: resolved.projectRoot,
|
|
183
|
+
promise: initialization
|
|
184
|
+
};
|
|
185
|
+
return initialization;
|
|
160
186
|
}
|
|
161
187
|
async function resetSingletonFrameworkProject(stateKey) {
|
|
162
188
|
const state = getFrameworkAdapterStateContainer(stateKey);
|
|
163
189
|
state.project = void 0;
|
|
164
190
|
state.projectRoot = void 0;
|
|
165
191
|
state.sourceSignature = void 0;
|
|
192
|
+
state.initialization = void 0;
|
|
166
193
|
await resetOptionalHoloSubsystems();
|
|
167
194
|
await resetHoloRuntime();
|
|
168
195
|
}
|
|
@@ -211,7 +238,9 @@ async function initializeHoloAdapterProject(projectRoot, options = {}) {
|
|
|
211
238
|
const project = await createHoloAdapterProject(projectRoot, options);
|
|
212
239
|
const runtime = await ensureHolo(project.projectRoot, options);
|
|
213
240
|
await reconfigureOptionalHoloSubsystems(project.projectRoot, runtime.loadedConfig, {
|
|
214
|
-
renderView: options.renderView
|
|
241
|
+
renderView: options.renderView,
|
|
242
|
+
authRequest: options.authRequest,
|
|
243
|
+
authorizationError: options.authorizationError
|
|
215
244
|
});
|
|
216
245
|
return {
|
|
217
246
|
...project,
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HoloConfigMap, LoadedHoloConfig, DotPath, ValueAtPath } from '@holo-js/config';
|
|
1
|
+
import { HoloConfigMap, LoadedHoloConfig, DotPath, ValueAtPath, AuthHostedIdentityStore } from '@holo-js/config';
|
|
2
2
|
import { resolveRuntimeConnectionManagerOptions } from '@holo-js/db';
|
|
3
3
|
export { RuntimeConfigInput, RuntimeConnectionConfig, RuntimeDatabaseConfig, RuntimeHoloConfig, SupportedDatabaseDriver, createAdapter, createDialect, createRuntimeConnectionOptions, createRuntimeLogger, isSupportedDatabaseDriver, parseDatabaseDriver, resolveRuntimeConnectionManagerOptions } from '@holo-js/db';
|
|
4
4
|
|
|
@@ -147,6 +147,33 @@ interface CoreNotificationDatabaseRoute {
|
|
|
147
147
|
readonly id: string | number;
|
|
148
148
|
readonly type: string;
|
|
149
149
|
}
|
|
150
|
+
type HoloAuthResult<TData> = {
|
|
151
|
+
readonly data: TData;
|
|
152
|
+
readonly error: null;
|
|
153
|
+
} | {
|
|
154
|
+
readonly data: null;
|
|
155
|
+
readonly error: {
|
|
156
|
+
readonly code: string;
|
|
157
|
+
readonly message: string;
|
|
158
|
+
readonly status: number;
|
|
159
|
+
readonly fields: Readonly<Partial<Record<string, readonly string[]>>>;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
type CoreHostedIdentityRecord = {
|
|
163
|
+
readonly provider: string;
|
|
164
|
+
readonly providerUserId: string;
|
|
165
|
+
readonly guard: string;
|
|
166
|
+
readonly authProvider: string;
|
|
167
|
+
readonly userId: string | number;
|
|
168
|
+
readonly email?: string;
|
|
169
|
+
readonly emailVerified: boolean;
|
|
170
|
+
readonly profile: Readonly<Record<string, unknown>>;
|
|
171
|
+
readonly linkedAt: Date;
|
|
172
|
+
readonly updatedAt: Date;
|
|
173
|
+
};
|
|
174
|
+
type CoreHostedIdentityStore = AuthHostedIdentityStore & {
|
|
175
|
+
claim(record: CoreHostedIdentityRecord): Promise<CoreHostedIdentityRecord>;
|
|
176
|
+
};
|
|
150
177
|
interface CoreNotificationRecord<TData extends CoreNotificationJsonValue = CoreNotificationJsonValue> {
|
|
151
178
|
readonly id: string;
|
|
152
179
|
readonly type?: string;
|
|
@@ -207,13 +234,13 @@ interface HoloAuthRuntimeBinding {
|
|
|
207
234
|
login(credentials: Readonly<Record<string, unknown>> & {
|
|
208
235
|
readonly password: string;
|
|
209
236
|
readonly remember?: boolean;
|
|
210
|
-
}): Promise<{
|
|
237
|
+
}): Promise<HoloAuthResult<{
|
|
211
238
|
readonly guard: string;
|
|
212
239
|
readonly user: unknown;
|
|
213
240
|
readonly sessionId: string;
|
|
214
241
|
readonly rememberToken?: string;
|
|
215
242
|
readonly cookies: readonly string[];
|
|
216
|
-
}
|
|
243
|
+
}>>;
|
|
217
244
|
loginUsing(user: unknown, options?: {
|
|
218
245
|
readonly remember?: boolean;
|
|
219
246
|
}): Promise<{
|
|
@@ -262,7 +289,7 @@ interface HoloAuthRuntimeBinding {
|
|
|
262
289
|
readonly password: string;
|
|
263
290
|
readonly passwordConfirmation: string;
|
|
264
291
|
readonly remember?: boolean;
|
|
265
|
-
}): Promise<unknown
|
|
292
|
+
}): Promise<HoloAuthResult<unknown>>;
|
|
266
293
|
logoutAll(guardName?: string): Promise<readonly {
|
|
267
294
|
readonly guard: string;
|
|
268
295
|
readonly cookies: readonly string[];
|
|
@@ -276,13 +303,13 @@ interface HoloAuthRuntimeBinding {
|
|
|
276
303
|
login(credentials: Readonly<Record<string, unknown>> & {
|
|
277
304
|
readonly password: string;
|
|
278
305
|
readonly remember?: boolean;
|
|
279
|
-
}): Promise<{
|
|
306
|
+
}): Promise<HoloAuthResult<{
|
|
280
307
|
readonly guard: string;
|
|
281
308
|
readonly user: unknown;
|
|
282
309
|
readonly sessionId: string;
|
|
283
310
|
readonly rememberToken?: string;
|
|
284
311
|
readonly cookies: readonly string[];
|
|
285
|
-
}
|
|
312
|
+
}>>;
|
|
286
313
|
loginUsing(user: unknown, options?: {
|
|
287
314
|
readonly remember?: boolean;
|
|
288
315
|
}): Promise<{
|
|
@@ -352,20 +379,51 @@ interface HoloAuthRuntimeBinding {
|
|
|
352
379
|
readonly guard?: string;
|
|
353
380
|
readonly expiresAt?: Date;
|
|
354
381
|
}): Promise<unknown>;
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
passwords: {
|
|
358
|
-
request(email: string, options?: {
|
|
359
|
-
readonly broker?: string;
|
|
382
|
+
resend(options?: {
|
|
383
|
+
readonly guard?: string;
|
|
360
384
|
readonly expiresAt?: Date;
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
385
|
+
readonly email?: string;
|
|
386
|
+
}): Promise<HoloAuthResult<unknown>>;
|
|
387
|
+
consume(plainTextToken: string): Promise<HoloAuthResult<unknown>>;
|
|
388
|
+
};
|
|
389
|
+
verifyEmail(token: string): Promise<HoloAuthResult<unknown>>;
|
|
390
|
+
sendEmailVerification(email?: string, options?: {
|
|
391
|
+
readonly guard?: string;
|
|
392
|
+
readonly expiresAt?: Date;
|
|
393
|
+
}): Promise<HoloAuthResult<unknown>>;
|
|
394
|
+
resendEmailVerification(email?: string, options?: {
|
|
395
|
+
readonly guard?: string;
|
|
396
|
+
readonly expiresAt?: Date;
|
|
397
|
+
}): Promise<HoloAuthResult<unknown>>;
|
|
398
|
+
requestPasswordReset(input: {
|
|
399
|
+
readonly email: string;
|
|
400
|
+
}, options?: {
|
|
401
|
+
readonly broker?: string;
|
|
402
|
+
readonly expiresAt?: Date;
|
|
403
|
+
}): Promise<HoloAuthResult<void>>;
|
|
404
|
+
resetPassword(input: {
|
|
405
|
+
readonly token: string;
|
|
406
|
+
readonly password: string;
|
|
407
|
+
readonly passwordConfirmation: string;
|
|
408
|
+
}): Promise<HoloAuthResult<unknown>>;
|
|
409
|
+
}
|
|
410
|
+
interface HoloAuthAuthorizationTargetConstructor<TInstance = object> {
|
|
411
|
+
readonly prototype: TInstance;
|
|
412
|
+
}
|
|
413
|
+
interface HoloAuthAuthorizationTargetModelDefinition {
|
|
414
|
+
readonly name: string;
|
|
415
|
+
readonly table?: {
|
|
416
|
+
readonly tableName?: string;
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
interface HoloAuthAuthorizationTargetModel<TInstance extends object = object> {
|
|
420
|
+
readonly definition: HoloAuthAuthorizationTargetModelDefinition;
|
|
421
|
+
query(): {
|
|
422
|
+
first(): Promise<TInstance | undefined>;
|
|
423
|
+
firstOrFail(): Promise<TInstance>;
|
|
367
424
|
};
|
|
368
425
|
}
|
|
426
|
+
type HoloAuthAuthorizationSubject = object | HoloAuthAuthorizationTargetConstructor | HoloAuthAuthorizationTargetModel;
|
|
369
427
|
interface HoloQueueRuntimeBinding {
|
|
370
428
|
readonly config: LoadedHoloConfig['queue'];
|
|
371
429
|
readonly drivers: ReadonlyMap<string, HoloQueueDriverBinding>;
|
|
@@ -614,6 +672,9 @@ type MailModule = {
|
|
|
614
672
|
type AuthorizationModule = {
|
|
615
673
|
isAuthorizationPolicyDefinition(value: unknown): boolean;
|
|
616
674
|
isAuthorizationAbilityDefinition(value: unknown): boolean;
|
|
675
|
+
forUser(actor: object | null): {
|
|
676
|
+
can(action: string, target: HoloAuthAuthorizationSubject): Promise<boolean>;
|
|
677
|
+
};
|
|
617
678
|
authorizationInternals: {
|
|
618
679
|
getAuthorizationRuntimeState(): {
|
|
619
680
|
policiesByName: Map<string, unknown>;
|
|
@@ -623,6 +684,10 @@ type AuthorizationModule = {
|
|
|
623
684
|
hasGuard(guardName: string): boolean;
|
|
624
685
|
resolveDefaultActor(): Promise<object | null> | object | null;
|
|
625
686
|
resolveGuardActor(guardName: string): Promise<object | null> | object | null;
|
|
687
|
+
createError?(decision: {
|
|
688
|
+
readonly message?: string;
|
|
689
|
+
readonly status: 200 | 403 | 404;
|
|
690
|
+
}): Error;
|
|
626
691
|
};
|
|
627
692
|
registerPolicyDefinition?(definition: unknown): unknown;
|
|
628
693
|
registerAbilityDefinition?(definition: unknown): unknown;
|
|
@@ -630,6 +695,10 @@ type AuthorizationModule = {
|
|
|
630
695
|
hasGuard(guardName: string): boolean;
|
|
631
696
|
resolveDefaultActor(): Promise<object | null> | object | null;
|
|
632
697
|
resolveGuardActor(guardName: string): Promise<object | null> | object | null;
|
|
698
|
+
createError?(decision: {
|
|
699
|
+
readonly message?: string;
|
|
700
|
+
readonly status: 200 | 403 | 404;
|
|
701
|
+
}): Error;
|
|
633
702
|
}): void;
|
|
634
703
|
resetAuthorizationAuthIntegration(): void;
|
|
635
704
|
resetAuthorizationRuntimeState(): void;
|
|
@@ -651,6 +720,18 @@ interface CreateHoloOptions {
|
|
|
651
720
|
readonly processEnv?: NodeJS.ProcessEnv;
|
|
652
721
|
readonly registerProjectQueueJobs?: boolean;
|
|
653
722
|
readonly renderView?: HoloServerViewRenderer;
|
|
723
|
+
readonly authRequest?: {
|
|
724
|
+
readonly getCookie?: (name: string) => string | undefined | Promise<string | undefined>;
|
|
725
|
+
readonly getHeader?: (name: string) => string | undefined | Promise<string | undefined>;
|
|
726
|
+
readonly appendResponseCookie?: (cookie: string) => void | Promise<void>;
|
|
727
|
+
readonly redirectResponse?: (url: string, status?: 301 | 302 | 303 | 307 | 308) => void | Promise<void>;
|
|
728
|
+
};
|
|
729
|
+
readonly authorizationError?: {
|
|
730
|
+
readonly createError?: (decision: {
|
|
731
|
+
readonly message?: string;
|
|
732
|
+
readonly status: 200 | 403 | 404;
|
|
733
|
+
}) => Error;
|
|
734
|
+
};
|
|
654
735
|
}
|
|
655
736
|
interface HoloRuntime<TCustom extends HoloConfigMap = HoloConfigMap> {
|
|
656
737
|
readonly projectRoot: string;
|
|
@@ -675,9 +756,6 @@ declare function resetHoloRenderingRuntime(): void;
|
|
|
675
756
|
declare function importOptionalModule<TModule>(specifier: string, options?: {
|
|
676
757
|
readonly projectRoot?: string;
|
|
677
758
|
}): Promise<TModule | undefined>;
|
|
678
|
-
declare function bindAuthRuntimeToContext(runtime: HoloAuthRuntimeBinding, authContext: {
|
|
679
|
-
activate(): void;
|
|
680
|
-
}): HoloAuthRuntimeBinding;
|
|
681
759
|
declare function loadAuthorizationModule(required?: boolean): Promise<AuthorizationModule | undefined>;
|
|
682
760
|
declare function resolveAuthorizationDefinitionExport(moduleValue: unknown, exportName: string | undefined, matcher: (value: unknown) => boolean): unknown | undefined;
|
|
683
761
|
declare function normalizeNotificationRecordFromRow(row: Record<string, unknown>): CoreNotificationRecord<CoreNotificationJsonValue>;
|
|
@@ -698,7 +776,7 @@ declare function createCoreSessionStores<TCustom extends HoloConfigMap>(projectR
|
|
|
698
776
|
delete(sessionId: string): Promise<void>;
|
|
699
777
|
}>>>;
|
|
700
778
|
declare function createCoreNotificationStore<TCustom extends HoloConfigMap>(loadedConfig: LoadedHoloConfig<TCustom>): CoreNotificationStore;
|
|
701
|
-
declare function createAuthNotificationsDeliveryHook(notificationsModule: NotificationsModule): {
|
|
779
|
+
declare function createAuthNotificationsDeliveryHook(notificationsModule: NotificationsModule, appUrl: string, projectRoot?: string): {
|
|
702
780
|
sendEmailVerification(input: {
|
|
703
781
|
readonly provider: string;
|
|
704
782
|
readonly user: unknown;
|
|
@@ -708,8 +786,10 @@ declare function createAuthNotificationsDeliveryHook(notificationsModule: Notifi
|
|
|
708
786
|
readonly plainTextToken: string;
|
|
709
787
|
readonly expiresAt: Date;
|
|
710
788
|
};
|
|
789
|
+
readonly route: string;
|
|
711
790
|
}): Promise<void>;
|
|
712
791
|
sendPasswordReset(input: {
|
|
792
|
+
readonly broker: string;
|
|
713
793
|
readonly provider: string;
|
|
714
794
|
readonly email: string;
|
|
715
795
|
readonly token: {
|
|
@@ -717,6 +797,7 @@ declare function createAuthNotificationsDeliveryHook(notificationsModule: Notifi
|
|
|
717
797
|
readonly plainTextToken: string;
|
|
718
798
|
readonly expiresAt: Date;
|
|
719
799
|
};
|
|
800
|
+
readonly route: string;
|
|
720
801
|
}): Promise<void>;
|
|
721
802
|
};
|
|
722
803
|
declare function createCoreNotificationBroadcaster(broadcastModule: BroadcastModule): {
|
|
@@ -755,7 +836,7 @@ declare function createCoreNotificationMailSender(mailModule: MailModule): {
|
|
|
755
836
|
};
|
|
756
837
|
}): Promise<void>;
|
|
757
838
|
};
|
|
758
|
-
declare function createAuthMailDeliveryHook(mailModule: MailModule): {
|
|
839
|
+
declare function createAuthMailDeliveryHook(mailModule: MailModule, appUrl: string): {
|
|
759
840
|
sendEmailVerification(input: {
|
|
760
841
|
readonly provider: string;
|
|
761
842
|
readonly user: unknown;
|
|
@@ -765,8 +846,10 @@ declare function createAuthMailDeliveryHook(mailModule: MailModule): {
|
|
|
765
846
|
readonly plainTextToken: string;
|
|
766
847
|
readonly expiresAt: Date;
|
|
767
848
|
};
|
|
849
|
+
readonly route: string;
|
|
768
850
|
}): Promise<void>;
|
|
769
851
|
sendPasswordReset(input: {
|
|
852
|
+
readonly broker: string;
|
|
770
853
|
readonly provider: string;
|
|
771
854
|
readonly email: string;
|
|
772
855
|
readonly token: {
|
|
@@ -774,6 +857,7 @@ declare function createAuthMailDeliveryHook(mailModule: MailModule): {
|
|
|
774
857
|
readonly plainTextToken: string;
|
|
775
858
|
readonly expiresAt: Date;
|
|
776
859
|
};
|
|
860
|
+
readonly route: string;
|
|
777
861
|
}): Promise<void>;
|
|
778
862
|
};
|
|
779
863
|
declare function loadConfiguredSocialProviders<TCustom extends HoloConfigMap>(projectRootOrLoadedConfig: string | LoadedHoloConfig<TCustom>, maybeLoadedConfig?: LoadedHoloConfig<TCustom>): Promise<Readonly<Record<string, unknown>>>;
|
|
@@ -805,6 +889,7 @@ declare function createCoreSocialBindings<TCustom extends HoloConfigMap>(project
|
|
|
805
889
|
readonly state: string;
|
|
806
890
|
readonly codeVerifier: string;
|
|
807
891
|
readonly guard: string;
|
|
892
|
+
readonly browserBinding?: string;
|
|
808
893
|
readonly createdAt: Date;
|
|
809
894
|
}): Promise<void>;
|
|
810
895
|
read(provider: string, state: string): Promise<{
|
|
@@ -812,6 +897,7 @@ declare function createCoreSocialBindings<TCustom extends HoloConfigMap>(project
|
|
|
812
897
|
readonly state: string;
|
|
813
898
|
readonly codeVerifier: string;
|
|
814
899
|
readonly guard: string;
|
|
900
|
+
readonly browserBinding?: string;
|
|
815
901
|
readonly createdAt: Date;
|
|
816
902
|
} | null>;
|
|
817
903
|
delete(provider: string, state: string): Promise<void>;
|
|
@@ -822,11 +908,7 @@ declare function createCoreSocialBindings<TCustom extends HoloConfigMap>(project
|
|
|
822
908
|
};
|
|
823
909
|
}>;
|
|
824
910
|
declare function fromHostedIdentityProviderValue(namespace: string, provider: string): string;
|
|
825
|
-
declare function createCoreHostedIdentityStore(namespace: string):
|
|
826
|
-
findByProviderUserId(provider: string, providerUserId: string): Promise<unknown | null>;
|
|
827
|
-
findByUserId(provider: string, authProvider: string, userId: string | number): Promise<unknown | null>;
|
|
828
|
-
save(record: unknown): Promise<void>;
|
|
829
|
-
};
|
|
911
|
+
declare function createCoreHostedIdentityStore(namespace: string): CoreHostedIdentityStore;
|
|
830
912
|
declare function createCoreAuthStores<TCustom extends HoloConfigMap>(loadedConfig: LoadedHoloConfig<TCustom>): {
|
|
831
913
|
readonly tokens: {
|
|
832
914
|
create(record: unknown): Promise<void>;
|
|
@@ -864,12 +946,15 @@ declare function registerProjectAuthorizationDefinitions(projectRoot: string, re
|
|
|
864
946
|
declare function unregisterProjectAuthorizationDefinitions(authorizationModule: AuthorizationModule | undefined, policyNames: readonly string[], abilityNames: readonly string[]): void;
|
|
865
947
|
declare function reconfigureOptionalHoloSubsystems<TCustom extends HoloConfigMap = HoloConfigMap>(projectRoot: string, loadedConfig: LoadedHoloConfig<TCustom>, options?: {
|
|
866
948
|
readonly renderView?: HoloServerViewRenderer;
|
|
949
|
+
readonly authRequest?: CreateHoloOptions['authRequest'];
|
|
950
|
+
readonly authorizationError?: CreateHoloOptions['authorizationError'];
|
|
867
951
|
}): Promise<{
|
|
868
952
|
readonly queueModule?: QueueModule;
|
|
869
953
|
readonly session?: HoloSessionRuntimeBinding;
|
|
870
954
|
readonly auth?: HoloAuthRuntimeBinding;
|
|
871
955
|
readonly authContext?: {
|
|
872
956
|
activate(): void;
|
|
957
|
+
setRequestAccessors?(accessors?: CreateHoloOptions['authRequest']): void;
|
|
873
958
|
};
|
|
874
959
|
}>;
|
|
875
960
|
declare function resetOptionalHoloSubsystems(): Promise<void>;
|
|
@@ -886,7 +971,6 @@ declare const holoRuntimeInternals: {
|
|
|
886
971
|
createAuthNotificationsDeliveryHook: typeof createAuthNotificationsDeliveryHook;
|
|
887
972
|
createCoreNotificationBroadcaster: typeof createCoreNotificationBroadcaster;
|
|
888
973
|
createCoreNotificationMailSender: typeof createCoreNotificationMailSender;
|
|
889
|
-
bindAuthRuntimeToContext: typeof bindAuthRuntimeToContext;
|
|
890
974
|
createCoreAuthProviders: typeof createCoreAuthProviders;
|
|
891
975
|
createCoreAuthStores: typeof createCoreAuthStores;
|
|
892
976
|
createCoreHostedIdentityStore: typeof createCoreHostedIdentityStore;
|
package/dist/runtime/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holo-js/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Holo-JS Framework - Portable runtime core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,22 +28,26 @@
|
|
|
28
28
|
"test": "vitest --run"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@holo-js/config": "^0.1.
|
|
32
|
-
"@holo-js/db": "^0.1.
|
|
31
|
+
"@holo-js/config": "^0.1.6",
|
|
32
|
+
"@holo-js/db": "^0.1.6",
|
|
33
33
|
"esbuild": "^0.27.4"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@holo-js/auth": "^0.1.
|
|
37
|
-
"@holo-js/auth-clerk": "^0.1.
|
|
38
|
-
"@holo-js/auth-social": "^0.1.
|
|
39
|
-
"@holo-js/auth-workos": "^0.1.
|
|
40
|
-
"@holo-js/authorization": "^0.1.
|
|
41
|
-
"@holo-js/
|
|
42
|
-
"@holo-js/
|
|
43
|
-
"@holo-js/
|
|
44
|
-
"@holo-js/
|
|
45
|
-
"@holo-js/
|
|
46
|
-
"@holo-js/
|
|
36
|
+
"@holo-js/auth": "^0.1.6",
|
|
37
|
+
"@holo-js/auth-clerk": "^0.1.6",
|
|
38
|
+
"@holo-js/auth-social": "^0.1.6",
|
|
39
|
+
"@holo-js/auth-workos": "^0.1.6",
|
|
40
|
+
"@holo-js/authorization": "^0.1.6",
|
|
41
|
+
"@holo-js/broadcast": "^0.1.6",
|
|
42
|
+
"@holo-js/cache": "^0.1.6",
|
|
43
|
+
"@holo-js/events": "^0.1.6",
|
|
44
|
+
"@holo-js/mail": "^0.1.6",
|
|
45
|
+
"@holo-js/notifications": "^0.1.6",
|
|
46
|
+
"@holo-js/queue": "^0.1.6",
|
|
47
|
+
"@holo-js/queue-db": "^0.1.6",
|
|
48
|
+
"@holo-js/security": "^0.1.6",
|
|
49
|
+
"@holo-js/session": "^0.1.6",
|
|
50
|
+
"@holo-js/storage": "^0.1.6"
|
|
47
51
|
},
|
|
48
52
|
"peerDependenciesMeta": {
|
|
49
53
|
"@holo-js/auth": {
|
|
@@ -61,6 +65,15 @@
|
|
|
61
65
|
"@holo-js/authorization": {
|
|
62
66
|
"optional": true
|
|
63
67
|
},
|
|
68
|
+
"@holo-js/broadcast": {
|
|
69
|
+
"optional": true
|
|
70
|
+
},
|
|
71
|
+
"@holo-js/cache": {
|
|
72
|
+
"optional": true
|
|
73
|
+
},
|
|
74
|
+
"@holo-js/events": {
|
|
75
|
+
"optional": true
|
|
76
|
+
},
|
|
64
77
|
"@holo-js/mail": {
|
|
65
78
|
"optional": true
|
|
66
79
|
},
|
|
@@ -70,6 +83,9 @@
|
|
|
70
83
|
"@holo-js/queue": {
|
|
71
84
|
"optional": true
|
|
72
85
|
},
|
|
86
|
+
"@holo-js/queue-db": {
|
|
87
|
+
"optional": true
|
|
88
|
+
},
|
|
73
89
|
"@holo-js/security": {
|
|
74
90
|
"optional": true
|
|
75
91
|
},
|
|
@@ -81,17 +97,18 @@
|
|
|
81
97
|
}
|
|
82
98
|
},
|
|
83
99
|
"devDependencies": {
|
|
84
|
-
"@holo-js/auth": "^0.1.
|
|
85
|
-
"@holo-js/
|
|
86
|
-
"@holo-js/
|
|
87
|
-
"@holo-js/
|
|
88
|
-
"@holo-js/
|
|
89
|
-
"@holo-js/
|
|
90
|
-
"@holo-js/
|
|
91
|
-
"@holo-js/
|
|
100
|
+
"@holo-js/auth": "^0.1.6",
|
|
101
|
+
"@holo-js/auth-social-google": "^0.1.6",
|
|
102
|
+
"@holo-js/authorization": "^0.1.6",
|
|
103
|
+
"@holo-js/events": "^0.1.6",
|
|
104
|
+
"@holo-js/mail": "^0.1.6",
|
|
105
|
+
"@holo-js/notifications": "^0.1.6",
|
|
106
|
+
"@holo-js/queue-db": "^0.1.6",
|
|
107
|
+
"@holo-js/session": "^0.1.6",
|
|
108
|
+
"@holo-js/storage": "^0.1.6",
|
|
92
109
|
"@types/node": "^22.10.2",
|
|
93
110
|
"tsup": "^8.3.5",
|
|
94
111
|
"typescript": "^5.7.2",
|
|
95
|
-
"vitest": "^
|
|
112
|
+
"vitest": "^4.1.5"
|
|
96
113
|
}
|
|
97
114
|
}
|