@getstrata/bootstrap 0.2.3 → 0.2.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/dist/bootstrap/app.d.ts +7 -0
- package/dist/bootstrap/createRoutes.d.ts +3 -0
- package/dist/bootstrap/createSpaRoutes.d.ts +5 -0
- package/dist/bootstrap/dependencies.d.ts +4 -0
- package/dist/bootstrap/health.d.ts +8 -0
- package/dist/bootstrap/metricsRoutes.d.ts +4 -0
- package/dist/bootstrap/middleware.d.ts +4 -0
- package/dist/bootstrap/public-api.d.ts +1 -1
- package/dist/bootstrap/routes.d.ts +2 -0
- package/dist/bootstrap/scimRoutes.d.ts +24 -0
- package/dist/bootstrap/server.d.ts +1 -0
- package/dist/bootstrap/web/index.d.ts +1 -0
- package/dist/bootstrap/web/routing.d.ts +21 -0
- package/dist/bootstrap/web/session.d.ts +1 -0
- package/dist/core/admin/formatValue.d.ts +3 -0
- package/dist/core/admin/index.d.ts +3 -0
- package/dist/core/admin/registry.d.ts +10 -0
- package/dist/core/admin/types.d.ts +24 -0
- package/dist/core/auth/scimAuthMiddleware.d.ts +3 -0
- package/dist/core/database/baseRepository.d.ts +4 -1
- package/dist/core/database/index.d.ts +2 -2
- package/dist/core/database/relationships.d.ts +46 -2
- package/dist/core/database/repositoryQuery.d.ts +4 -1
- package/dist/core/http/scimThrottleMiddleware.d.ts +9 -0
- package/dist/core/mail/mailer.d.ts +3 -1
- package/dist/core/mail/markdownMail.d.ts +15 -0
- package/dist/core/mail/markdownMailable.d.ts +12 -0
- package/dist/core/notifications/dispatcher.d.ts +13 -0
- package/dist/core/notifications/index.d.ts +3 -0
- package/dist/core/notifications/notification.d.ts +7 -0
- package/dist/core/notifications/types.d.ts +25 -0
- package/dist/core/queue/failedJobService.d.ts +1 -0
- package/dist/core/queue/publicQueue.d.ts +2 -1
- package/dist/core/security/scimTenantTokens.d.ts +3 -0
- package/dist/core/security/timingSafeCompare.d.ts +2 -0
- package/dist/framework/public-api.d.ts +12 -4
- package/dist/index.js +203 -5
- package/dist/modules/scim/controller.d.ts +15 -0
- package/dist/modules/scim/scimResponse.d.ts +10 -0
- package/dist/modules/scim/service.d.ts +217 -0
- package/package.json +10 -10
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AppDependencies, AppRouteMap } from "./contracts";
|
|
2
|
+
declare const SPA_DIST_DIRECTORY: string;
|
|
3
|
+
declare function createSpaRoutes(_dependencies: AppDependencies): AppRouteMap;
|
|
4
|
+
declare function mergeSpaRoutes(dependencies: AppDependencies, routes: AppRouteMap): AppRouteMap;
|
|
5
|
+
export { createSpaRoutes, mergeSpaRoutes, SPA_DIST_DIRECTORY };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AppDependencies } from "./contracts";
|
|
2
|
+
declare function checkDatabase(): Promise<boolean>;
|
|
3
|
+
declare function checkRedis(redisUrl: string): Promise<boolean>;
|
|
4
|
+
declare function createHealthRoutes(dependencies: AppDependencies): {
|
|
5
|
+
"/health": () => Promise<Response>;
|
|
6
|
+
"/ready": () => Promise<Response>;
|
|
7
|
+
};
|
|
8
|
+
export { checkDatabase, checkRedis, createHealthRoutes };
|
|
@@ -13,4 +13,4 @@ export { createWebRoutes, mergeWebRoutes } from "./createWebRoutes.ts";
|
|
|
13
13
|
export { createHttpKernel, type HttpKernel, type MiddlewareGroupName } from "./httpKernel.ts";
|
|
14
14
|
export { prefixRouteMap } from "./prefixRouteMap.ts";
|
|
15
15
|
export { coreProviders } from "./providers/index.ts";
|
|
16
|
-
export { CookieSessionStore, createCsrfProtection, createWebServer, type ParsedForm, parseFormBody, type SessionUser, slugify, type WebServerOptions, } from "./web/index.ts";
|
|
16
|
+
export { CookieSessionStore, createCsrfProtection, createRouteKernel, createWebServer, type ParsedForm, parseFormBody, routeParams, type SessionUser, slugify, toRouteRequest, type WebServerOptions, wrapSecuredRouteModelByKey, wrapWebLogin, wrapWebRegister, } from "./web/index.ts";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { RouteHandler } from "../core/http/middleware";
|
|
2
|
+
import type { AppDependencies } from "./contracts";
|
|
3
|
+
declare function createScimRoutes(dependencies: AppDependencies): {
|
|
4
|
+
"/scim/v2/ServiceProviderConfig": {
|
|
5
|
+
GET: RouteHandler;
|
|
6
|
+
};
|
|
7
|
+
"/scim/v2/Users": {
|
|
8
|
+
GET: RouteHandler;
|
|
9
|
+
POST: RouteHandler;
|
|
10
|
+
};
|
|
11
|
+
"/scim/v2/Users/:id": {
|
|
12
|
+
GET: RouteHandler;
|
|
13
|
+
PATCH: RouteHandler;
|
|
14
|
+
DELETE: RouteHandler;
|
|
15
|
+
};
|
|
16
|
+
"/scim/v2/Groups": {
|
|
17
|
+
GET: RouteHandler;
|
|
18
|
+
};
|
|
19
|
+
"/scim/v2/Groups/:id": {
|
|
20
|
+
GET: RouteHandler;
|
|
21
|
+
PATCH: RouteHandler;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export { createScimRoutes };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Web-focused bootstrap utilities for sibling apps (getstrata, marketing sites).
|
|
3
3
|
*/
|
|
4
4
|
export { createCsrfProtection, type ParsedForm, parseFormBody } from "./forms.ts";
|
|
5
|
+
export { createRouteKernel, routeParams, toRouteRequest, wrapSecuredRouteModelByKey, wrapWebLogin, wrapWebRegister, } from "./routing.ts";
|
|
5
6
|
export { convertAppRoutesToBunRoutes, createWebServer, type WebServerOptions } from "./server.ts";
|
|
6
7
|
export { CookieSessionStore, type SessionUser } from "./session.ts";
|
|
7
8
|
export { slugify } from "./slug.ts";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { RouteHandler, RouteRequest } from "@getstrata/core";
|
|
2
|
+
import type { AppDependencies } from "../contracts.ts";
|
|
3
|
+
import type { HttpKernel } from "../httpKernel.ts";
|
|
4
|
+
/** Read Bun native `:param` values from a route handler request. */
|
|
5
|
+
export declare function routeParams(request: Request): Record<string, string>;
|
|
6
|
+
/**
|
|
7
|
+
* Attach decoded route params to Bun's native Request for RouteRequest handlers.
|
|
8
|
+
* Mutates the request in place so instanceof Request and Bun internals stay valid.
|
|
9
|
+
*/
|
|
10
|
+
export declare function toRouteRequest<TParams extends Record<string, string>>(request: Request): RouteRequest<TParams>;
|
|
11
|
+
/** Laravel-style secured route-model binding for string keys (slugs, UUIDs). */
|
|
12
|
+
export declare function wrapSecuredRouteModelByKey<TParams extends Record<string, string>, TModel, TParam extends keyof TParams & string>(param: TParam, resolver: (key: string, request: RouteRequest<TParams>) => Promise<TModel>, authorization: {
|
|
13
|
+
resource: string;
|
|
14
|
+
action: "view" | "create" | "update" | "delete";
|
|
15
|
+
}, handler: (request: RouteRequest<TParams>, model: TModel) => Response | Promise<Response>): RouteHandler;
|
|
16
|
+
/** Converts kernel login throttle 429 JSON into an HTML response for web forms. */
|
|
17
|
+
export declare function wrapWebLogin(kernel: HttpKernel, handler: RouteHandler, onThrottled: (request: Request) => Response | Promise<Response>): RouteHandler;
|
|
18
|
+
/** Converts kernel register throttle 429 JSON into an HTML response for web forms. */
|
|
19
|
+
export declare function wrapWebRegister(kernel: HttpKernel, handler: RouteHandler, onThrottled: (request: Request) => Response | Promise<Response>): RouteHandler;
|
|
20
|
+
/** Convenience alias: HttpKernel is the Laravel-style router middleware wrapper. */
|
|
21
|
+
export declare function createRouteKernel(dependencies: AppDependencies): HttpKernel;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AdminResource, AdminResourceDefinition } from "./types.ts";
|
|
2
|
+
declare class AdminResourceRegistry {
|
|
3
|
+
private readonly resources;
|
|
4
|
+
register<TEntity extends object>(resource: AdminResource<TEntity>): void;
|
|
5
|
+
get(name: string): AdminResource<object> | undefined;
|
|
6
|
+
list(): AdminResourceDefinition[];
|
|
7
|
+
all(): AdminResource<object>[];
|
|
8
|
+
clear(): void;
|
|
9
|
+
}
|
|
10
|
+
export { AdminResourceRegistry };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { PaginatedResult } from "../pagination/index.ts";
|
|
2
|
+
type AdminColumnType = "text" | "number" | "boolean" | "datetime" | "code";
|
|
3
|
+
interface AdminColumn {
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
type?: AdminColumnType;
|
|
7
|
+
}
|
|
8
|
+
interface AdminResourceHandlers<TEntity extends object> {
|
|
9
|
+
paginate(options: {
|
|
10
|
+
page: number;
|
|
11
|
+
perPage: number;
|
|
12
|
+
}): Promise<PaginatedResult<TEntity>>;
|
|
13
|
+
findById?(id: number): Promise<TEntity | null>;
|
|
14
|
+
}
|
|
15
|
+
interface AdminResourceDefinition {
|
|
16
|
+
name: string;
|
|
17
|
+
label: string;
|
|
18
|
+
labelPlural: string;
|
|
19
|
+
columns: AdminColumn[];
|
|
20
|
+
}
|
|
21
|
+
interface AdminResource<TEntity extends object> extends AdminResourceDefinition {
|
|
22
|
+
handlers: AdminResourceHandlers<TEntity>;
|
|
23
|
+
}
|
|
24
|
+
export type { AdminColumn, AdminColumnType, AdminResource, AdminResourceDefinition, AdminResourceHandlers, };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CursorPaginatedResult, type PaginatedResult } from "../pagination/index.ts";
|
|
2
|
-
import { type BelongsToRelation, type HasManyRelation } from "./relationships.ts";
|
|
2
|
+
import { type BelongsToRelation, type HasManyRelation, type MorphManyRelation, type MorphOneRelation, type MorphToRelation } from "./relationships.ts";
|
|
3
3
|
import { RepositoryQuery } from "./repositoryQuery.ts";
|
|
4
4
|
import type { TableDefinition } from "./table.ts";
|
|
5
5
|
import type { MutationValues, QueryOptions, QueryWhere, UpdateValues } from "./types.ts";
|
|
@@ -54,6 +54,9 @@ declare class BaseRepository<TEntity extends object, PrimaryKey extends keyof TE
|
|
|
54
54
|
findByHasManyRelation<TParent extends object, LocalKey extends keyof TParent & string, ForeignKey extends keyof TEntity & string>(relation: HasManyRelation<TParent, TEntity, LocalKey, ForeignKey>, parentId: TParent[LocalKey], options?: Omit<QueryOptions<TEntity>, "where">): Promise<TEntity[]>;
|
|
55
55
|
loadHasManyForParents<TParent extends object, LocalKey extends keyof TParent & string, ForeignKey extends keyof TEntity & string>(parents: readonly TParent[], relation: HasManyRelation<TParent, TEntity, LocalKey, ForeignKey>, options?: Omit<QueryOptions<TEntity>, "where">): Promise<Map<TParent[LocalKey], TEntity[]>>;
|
|
56
56
|
loadBelongsToForParents<TChild extends object, TParent extends object, ForeignKey extends keyof TChild & string, OwnerKey extends keyof TParent & string>(children: readonly TChild[], relation: BelongsToRelation<TChild, TParent, ForeignKey, OwnerKey>, parentRepository: BaseRepository<TParent, OwnerKey>, options?: Omit<QueryOptions<TParent>, "where">): Promise<Map<TChild[ForeignKey], TParent>>;
|
|
57
|
+
loadMorphManyForParents<TParent extends object, LocalKey extends keyof TParent & string, MorphTypeKey extends keyof TEntity & string, MorphIdKey extends keyof TEntity & string>(parents: readonly TParent[], relation: MorphManyRelation<TParent, TEntity, LocalKey, MorphTypeKey, MorphIdKey>, options?: Omit<QueryOptions<TEntity>, "where">): Promise<Map<TParent[LocalKey], TEntity[]>>;
|
|
58
|
+
loadMorphOneForParents<TParent extends object, LocalKey extends keyof TParent & string, MorphTypeKey extends keyof TEntity & string, MorphIdKey extends keyof TEntity & string>(parents: readonly TParent[], relation: MorphOneRelation<TParent, TEntity, LocalKey, MorphTypeKey, MorphIdKey>, options?: Omit<QueryOptions<TEntity>, "where">): Promise<Map<TParent[LocalKey], TEntity | undefined>>;
|
|
59
|
+
loadMorphToForChildren<TChild extends object, TParent extends object, MorphTypeKey extends keyof TChild & string, MorphIdKey extends keyof TChild & string, OwnerKey extends keyof TParent & string>(children: readonly TChild[], relation: MorphToRelation<TChild, MorphTypeKey, MorphIdKey>, repositoriesByType: ReadonlyMap<string, BaseRepository<TParent, OwnerKey>>, options?: Omit<QueryOptions<TParent>, "where">): Promise<Map<TChild[MorphIdKey], TParent>>;
|
|
57
60
|
}
|
|
58
61
|
export default BaseRepository;
|
|
59
62
|
export type { DatabaseConnection };
|
|
@@ -5,8 +5,8 @@ export { mapDatabaseError, withDatabaseErrorHandling } from "./errors.ts";
|
|
|
5
5
|
export type { CastType, GlobalScopeFn, ModelConstructor } from "./model.ts";
|
|
6
6
|
export { applyCasts, dehydrateValue, filterMassAssignable, hydrateValue, Model, registerModelRepository, } from "./model.ts";
|
|
7
7
|
export { buildAdvancedWhereClause, buildCountQuery, buildDeleteByIdQuery, buildGroupedCountQuery, buildInsertQuery, buildJoinClause, buildOrderByClause, buildProjectionQuery, buildQueryWhereClause, buildRestoreByIdQuery, buildSelectQuery, buildSoftDeleteByIdQuery, buildUpdateQuery, buildWhereClause, parseQualifiedColumn, qualifyColumn, quoteIdentifier, resolveQualifiedColumn, resolveSoftDeleteColumn, } from "./query.ts";
|
|
8
|
-
export type { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasOneRelation, } from "./relationships.ts";
|
|
9
|
-
export { belongsTo, belongsToMany, hasMany, hasOne, indexBelongsToManyRelation, indexBelongsToRelation, indexHasManyRelation, indexHasOneRelation, } from "./relationships.ts";
|
|
8
|
+
export type { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasOneRelation, MorphManyRelation, MorphOneRelation, MorphToRelation, } from "./relationships.ts";
|
|
9
|
+
export { belongsTo, belongsToMany, hasMany, hasOne, indexBelongsToManyRelation, indexBelongsToRelation, indexHasManyRelation, indexHasOneRelation, indexMorphManyRelation, indexMorphOneRelation, indexMorphToRelation, morphMany, morphOne, morphTo, } from "./relationships.ts";
|
|
10
10
|
export { RepositoryQuery } from "./repositoryQuery.ts";
|
|
11
11
|
export type { BlueprintAction, BlueprintCallback, ColumnKind, DatabaseDriver, ForeignKeyOptions, Grammar, IndexDefinition, IndexKind, ResolveDatabaseDriverOptions, SchemaBuilder, } from "./schema/index.ts";
|
|
12
12
|
export { Blueprint, ColumnDefinition, compileBlueprint, createSchemaBuilder, ForeignIdColumnDefinition, grammarForDriver, inferReferencedTable, MySqlGrammar, PostgresGrammar, resolveDatabaseDriver, Schema, SqliteGrammar, UnsupportedSchemaFeatureError, } from "./schema/index.ts";
|
|
@@ -52,5 +52,49 @@ declare function indexHasManyRelation<TParent, TChild, LocalKey extends keyof TP
|
|
|
52
52
|
declare function indexHasOneRelation<TParent, TChild, LocalKey extends keyof TParent & string, ForeignKey extends keyof TChild & string>(parents: readonly TParent[], children: readonly TChild[], relation: HasOneRelation<TParent, TChild, LocalKey, ForeignKey>): Map<TParent[LocalKey], TChild | undefined>;
|
|
53
53
|
declare function indexBelongsToRelation<TChild, TParent, ForeignKey extends keyof TChild & string, OwnerKey extends keyof TParent & string>(children: readonly TChild[], parents: readonly TParent[], relation: BelongsToRelation<TChild, TParent, ForeignKey, OwnerKey>): Map<TChild[ForeignKey], TParent>;
|
|
54
54
|
declare function indexBelongsToManyRelation<TParent, TRelated, Pivot extends object, ParentKey extends keyof TParent & string, RelatedKey extends keyof TRelated & string, ForeignPivotKey extends keyof Pivot & string, RelatedPivotKey extends keyof Pivot & string>(parents: readonly TParent[], pivotRows: readonly Pivot[], relatedRows: readonly TRelated[], relation: BelongsToManyRelation<TParent, TRelated, Pivot, ParentKey, RelatedKey, ForeignPivotKey, RelatedPivotKey>): Map<TParent[ParentKey], TRelated[]>;
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
interface MorphManyRelation<TParent, TChild, LocalKey extends keyof TParent & string = keyof TParent & string, MorphTypeKey extends keyof TChild & string = keyof TChild & string, MorphIdKey extends keyof TChild & string = keyof TChild & string> {
|
|
56
|
+
type: "morphMany";
|
|
57
|
+
name: string;
|
|
58
|
+
localKey: LocalKey;
|
|
59
|
+
morphTypeKey: MorphTypeKey;
|
|
60
|
+
morphIdKey: MorphIdKey;
|
|
61
|
+
morphType: string;
|
|
62
|
+
}
|
|
63
|
+
interface MorphOneRelation<TParent, TChild, LocalKey extends keyof TParent & string = keyof TParent & string, MorphTypeKey extends keyof TChild & string = keyof TChild & string, MorphIdKey extends keyof TChild & string = keyof TChild & string> {
|
|
64
|
+
type: "morphOne";
|
|
65
|
+
name: string;
|
|
66
|
+
localKey: LocalKey;
|
|
67
|
+
morphTypeKey: MorphTypeKey;
|
|
68
|
+
morphIdKey: MorphIdKey;
|
|
69
|
+
morphType: string;
|
|
70
|
+
}
|
|
71
|
+
interface MorphToRelation<TChild, MorphTypeKey extends keyof TChild & string = keyof TChild & string, MorphIdKey extends keyof TChild & string = keyof TChild & string> {
|
|
72
|
+
type: "morphTo";
|
|
73
|
+
name: string;
|
|
74
|
+
morphTypeKey: MorphTypeKey;
|
|
75
|
+
morphIdKey: MorphIdKey;
|
|
76
|
+
}
|
|
77
|
+
declare function morphMany<TParent, TChild, LocalKey extends keyof TParent & string = keyof TParent & string, MorphTypeKey extends keyof TChild & string = keyof TChild & string, MorphIdKey extends keyof TChild & string = keyof TChild & string>(definition: {
|
|
78
|
+
name: string;
|
|
79
|
+
localKey: LocalKey;
|
|
80
|
+
morphTypeKey: MorphTypeKey;
|
|
81
|
+
morphIdKey: MorphIdKey;
|
|
82
|
+
morphType: string;
|
|
83
|
+
}): MorphManyRelation<TParent, TChild, LocalKey, MorphTypeKey, MorphIdKey>;
|
|
84
|
+
declare function morphOne<TParent, TChild, LocalKey extends keyof TParent & string = keyof TParent & string, MorphTypeKey extends keyof TChild & string = keyof TChild & string, MorphIdKey extends keyof TChild & string = keyof TChild & string>(definition: {
|
|
85
|
+
name: string;
|
|
86
|
+
localKey: LocalKey;
|
|
87
|
+
morphTypeKey: MorphTypeKey;
|
|
88
|
+
morphIdKey: MorphIdKey;
|
|
89
|
+
morphType: string;
|
|
90
|
+
}): MorphOneRelation<TParent, TChild, LocalKey, MorphTypeKey, MorphIdKey>;
|
|
91
|
+
declare function morphTo<TChild, MorphTypeKey extends keyof TChild & string = keyof TChild & string, MorphIdKey extends keyof TChild & string = keyof TChild & string>(definition: {
|
|
92
|
+
name: string;
|
|
93
|
+
morphTypeKey: MorphTypeKey;
|
|
94
|
+
morphIdKey: MorphIdKey;
|
|
95
|
+
}): MorphToRelation<TChild, MorphTypeKey, MorphIdKey>;
|
|
96
|
+
declare function indexMorphManyRelation<TParent, TChild, LocalKey extends keyof TParent & string, MorphTypeKey extends keyof TChild & string, MorphIdKey extends keyof TChild & string>(parents: readonly TParent[], children: readonly TChild[], relation: MorphManyRelation<TParent, TChild, LocalKey, MorphTypeKey, MorphIdKey>): Map<TParent[LocalKey], TChild[]>;
|
|
97
|
+
declare function indexMorphOneRelation<TParent, TChild, LocalKey extends keyof TParent & string, MorphTypeKey extends keyof TChild & string, MorphIdKey extends keyof TChild & string>(parents: readonly TParent[], children: readonly TChild[], relation: MorphOneRelation<TParent, TChild, LocalKey, MorphTypeKey, MorphIdKey>): Map<TParent[LocalKey], TChild | undefined>;
|
|
98
|
+
declare function indexMorphToRelation<TChild, TParent extends object, MorphTypeKey extends keyof TChild & string, MorphIdKey extends keyof TChild & string, OwnerKey extends keyof TParent & string>(children: readonly TChild[], parentsByType: ReadonlyMap<string, ReadonlyMap<TParent[OwnerKey], TParent>>, relation: MorphToRelation<TChild, MorphTypeKey, MorphIdKey>): Map<TChild[MorphIdKey], TParent>;
|
|
99
|
+
export type { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasOneRelation, MorphManyRelation, MorphOneRelation, MorphToRelation, };
|
|
100
|
+
export { belongsTo, belongsToMany, hasMany, hasOne, indexBelongsToManyRelation, indexBelongsToRelation, indexHasManyRelation, indexHasOneRelation, indexMorphManyRelation, indexMorphOneRelation, indexMorphToRelation, morphMany, morphOne, morphTo, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PaginatedResult } from "../pagination/index.ts";
|
|
2
2
|
import type BaseRepository from "./baseRepository.ts";
|
|
3
|
-
import type { BelongsToRelation, HasManyRelation } from "./relationships.ts";
|
|
3
|
+
import type { BelongsToRelation, HasManyRelation, MorphManyRelation, MorphOneRelation, MorphToRelation } from "./relationships.ts";
|
|
4
4
|
import type { QueryOptions, QueryWhere } from "./types.ts";
|
|
5
5
|
import { WhereBuilder } from "./whereBuilder.ts";
|
|
6
6
|
type LoadedRow = Record<string, unknown>;
|
|
@@ -22,6 +22,9 @@ declare class RepositoryQuery<TEntity extends object, PrimaryKey extends keyof T
|
|
|
22
22
|
having(having: QueryWhere<TEntity>): this;
|
|
23
23
|
withHasMany<TChild extends object, LocalKey extends keyof TEntity & string, ForeignKey extends keyof TChild & string, Alias extends string>(as: Alias, relation: HasManyRelation<TEntity, TChild, LocalKey, ForeignKey>, childRepository: BaseRepository<TChild, keyof TChild & string>, options?: Omit<QueryOptions<TChild>, "where">): this;
|
|
24
24
|
withBelongsTo<TParent extends object, ForeignKey extends keyof TEntity & string, OwnerKey extends keyof TParent & string, Alias extends string>(as: Alias, relation: BelongsToRelation<TEntity, TParent, ForeignKey, OwnerKey>, parentRepository: BaseRepository<TParent, OwnerKey>, options?: Omit<QueryOptions<TParent>, "where">): this;
|
|
25
|
+
withMorphMany<TChild extends object, LocalKey extends keyof TEntity & string, MorphTypeKey extends keyof TChild & string, MorphIdKey extends keyof TChild & string, Alias extends string>(as: Alias, relation: MorphManyRelation<TEntity, TChild, LocalKey, MorphTypeKey, MorphIdKey>, childRepository: BaseRepository<TChild, keyof TChild & string>, options?: Omit<QueryOptions<TChild>, "where">): this;
|
|
26
|
+
withMorphOne<TChild extends object, LocalKey extends keyof TEntity & string, MorphTypeKey extends keyof TChild & string, MorphIdKey extends keyof TChild & string, Alias extends string>(as: Alias, relation: MorphOneRelation<TEntity, TChild, LocalKey, MorphTypeKey, MorphIdKey>, childRepository: BaseRepository<TChild, keyof TChild & string>, options?: Omit<QueryOptions<TChild>, "where">): this;
|
|
27
|
+
withMorphTo<TParent extends object, MorphTypeKey extends keyof TEntity & string, MorphIdKey extends keyof TEntity & string, Alias extends string>(as: Alias, relation: MorphToRelation<TEntity, MorphTypeKey, MorphIdKey>, repositoriesByType: ReadonlyMap<string, BaseRepository<TParent, keyof TParent & string>>, options?: Omit<QueryOptions<TParent>, "where">): this;
|
|
25
28
|
get(): Promise<Array<TEntity & LoadedRow>>;
|
|
26
29
|
first(): Promise<(TEntity & LoadedRow) | null>;
|
|
27
30
|
paginate(options: {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Middleware } from "./middleware";
|
|
2
|
+
interface ScimThrottleOptions {
|
|
3
|
+
redisUrl?: string;
|
|
4
|
+
maxAttempts: number;
|
|
5
|
+
decaySeconds: number;
|
|
6
|
+
}
|
|
7
|
+
declare function createScimThrottleMiddleware(options: ScimThrottleOptions): Middleware;
|
|
8
|
+
export type { ScimThrottleOptions };
|
|
9
|
+
export { createScimThrottleMiddleware };
|
|
@@ -2,6 +2,7 @@ interface MailMessage {
|
|
|
2
2
|
to: string;
|
|
3
3
|
subject: string;
|
|
4
4
|
body: string;
|
|
5
|
+
html?: string;
|
|
5
6
|
}
|
|
6
7
|
interface MailDriver {
|
|
7
8
|
send(message: MailMessage): Promise<void>;
|
|
@@ -16,6 +17,7 @@ interface SmtpConfig {
|
|
|
16
17
|
}
|
|
17
18
|
type SmtpTransport = (config: SmtpConfig, message: MailMessage) => Promise<void>;
|
|
18
19
|
declare function resolveSmtpConfig(): SmtpConfig;
|
|
20
|
+
declare function buildSmtpPayload(from: string, message: MailMessage): string;
|
|
19
21
|
declare class LogMailDriver implements MailDriver {
|
|
20
22
|
send(message: MailMessage): Promise<void>;
|
|
21
23
|
}
|
|
@@ -33,4 +35,4 @@ declare class Mailer {
|
|
|
33
35
|
declare function createMailDriver(): MailDriver;
|
|
34
36
|
declare function mailer(): Mailer;
|
|
35
37
|
export type { MailDriver, MailMessage, SmtpConfig, SmtpTransport };
|
|
36
|
-
export { createMailDriver, LogMailDriver, Mailer, mailer, resolveSmtpConfig, SmtpMailDriver };
|
|
38
|
+
export { buildSmtpPayload, createMailDriver, LogMailDriver, Mailer, mailer, resolveSmtpConfig, SmtpMailDriver, };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface MarkdownMailLayoutOptions {
|
|
2
|
+
title?: string;
|
|
3
|
+
preview?: string;
|
|
4
|
+
footer?: string;
|
|
5
|
+
}
|
|
6
|
+
interface RenderedMarkdownMail {
|
|
7
|
+
html: string;
|
|
8
|
+
text: string;
|
|
9
|
+
}
|
|
10
|
+
declare function stripMarkdown(markdown: string): string;
|
|
11
|
+
declare function markdownToHtml(markdown: string): string;
|
|
12
|
+
declare function wrapMarkdownMailLayout(bodyHtml: string, options?: MarkdownMailLayoutOptions): string;
|
|
13
|
+
declare function renderMarkdownMail(markdown: string, options?: MarkdownMailLayoutOptions): RenderedMarkdownMail;
|
|
14
|
+
export type { MarkdownMailLayoutOptions, RenderedMarkdownMail };
|
|
15
|
+
export { markdownToHtml, renderMarkdownMail, stripMarkdown, wrapMarkdownMailLayout };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Mailer, MailMessage } from "./mailer.ts";
|
|
2
|
+
import { type MarkdownMailLayoutOptions } from "./markdownMail.ts";
|
|
3
|
+
interface MarkdownMailableInput {
|
|
4
|
+
to: string;
|
|
5
|
+
subject: string;
|
|
6
|
+
markdown: string;
|
|
7
|
+
layout?: MarkdownMailLayoutOptions;
|
|
8
|
+
}
|
|
9
|
+
declare function buildMarkdownMailMessage(input: MarkdownMailableInput): MailMessage;
|
|
10
|
+
declare function sendMarkdownMail(mailer: Mailer, input: MarkdownMailableInput): Promise<void>;
|
|
11
|
+
export type { MarkdownMailableInput };
|
|
12
|
+
export { buildMarkdownMailMessage, sendMarkdownMail };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Mailer } from "../mail/mailer.ts";
|
|
2
|
+
import type { Notification } from "./notification.ts";
|
|
3
|
+
import type { DatabaseNotificationStore, Notifiable } from "./types.ts";
|
|
4
|
+
declare class NotificationDispatcher {
|
|
5
|
+
private readonly mailer;
|
|
6
|
+
private readonly databaseStore;
|
|
7
|
+
constructor(mailer: Mailer, databaseStore?: DatabaseNotificationStore | null);
|
|
8
|
+
send(notifiable: Notifiable, notification: Notification): Promise<void>;
|
|
9
|
+
private sendMail;
|
|
10
|
+
private sendDatabase;
|
|
11
|
+
}
|
|
12
|
+
declare function createNotificationDispatcher(mailer: Mailer, databaseStore?: DatabaseNotificationStore): NotificationDispatcher;
|
|
13
|
+
export { createNotificationDispatcher, NotificationDispatcher };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { createNotificationDispatcher, NotificationDispatcher } from "./dispatcher.ts";
|
|
2
|
+
export { Notification } from "./notification.ts";
|
|
3
|
+
export type { DatabaseNotificationPayload, DatabaseNotificationStore, MailNotificationMessage, Notifiable, NotificationChannelName, } from "./types.ts";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DatabaseNotificationPayload, MailNotificationMessage, NotificationChannelName } from "./types.ts";
|
|
2
|
+
declare abstract class Notification<TNotifiable = unknown> {
|
|
3
|
+
via(_notifiable: TNotifiable): NotificationChannelName[];
|
|
4
|
+
toMail(_notifiable: TNotifiable): MailNotificationMessage | null;
|
|
5
|
+
toDatabase(_notifiable: TNotifiable): DatabaseNotificationPayload | null;
|
|
6
|
+
}
|
|
7
|
+
export { Notification };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type NotificationChannelName = "mail" | "database";
|
|
2
|
+
interface MailNotificationMessage {
|
|
3
|
+
subject: string;
|
|
4
|
+
markdown?: string;
|
|
5
|
+
body?: string;
|
|
6
|
+
html?: string;
|
|
7
|
+
}
|
|
8
|
+
interface DatabaseNotificationPayload {
|
|
9
|
+
type: string;
|
|
10
|
+
title: string;
|
|
11
|
+
body: string;
|
|
12
|
+
data?: Record<string, unknown>;
|
|
13
|
+
notifiableType?: string | null;
|
|
14
|
+
notifiableId?: number | null;
|
|
15
|
+
}
|
|
16
|
+
interface DatabaseNotificationStore {
|
|
17
|
+
create(input: DatabaseNotificationPayload & {
|
|
18
|
+
userId: number;
|
|
19
|
+
}): Promise<Record<string, unknown>>;
|
|
20
|
+
}
|
|
21
|
+
interface Notifiable {
|
|
22
|
+
getNotificationKey(): string | number;
|
|
23
|
+
routeNotificationFor(channel: NotificationChannelName): string | number | null;
|
|
24
|
+
}
|
|
25
|
+
export type { DatabaseNotificationPayload, DatabaseNotificationStore, MailNotificationMessage, Notifiable, NotificationChannelName, };
|
|
@@ -10,6 +10,7 @@ declare class FailedJobService {
|
|
|
10
10
|
}): Promise<FailedJobRecord>;
|
|
11
11
|
listRecent(limit?: number): Promise<FailedJobRecord[]>;
|
|
12
12
|
retry(id: number): Promise<FailedJobRecord>;
|
|
13
|
+
delete(id: number): Promise<void>;
|
|
13
14
|
flush(): Promise<number>;
|
|
14
15
|
}
|
|
15
16
|
export default FailedJobService;
|
|
@@ -2,6 +2,7 @@ import FailedJobRepository from "./failedJobRepository.ts";
|
|
|
2
2
|
import FailedJobService from "./failedJobService.ts";
|
|
3
3
|
import type { Job, Queue } from "./index.ts";
|
|
4
4
|
import { jobRegistry } from "./jobRegistry.ts";
|
|
5
|
+
import { runQueueJob } from "./jobRunner.ts";
|
|
5
6
|
import { QueueWorker, RedisQueue } from "./redisQueue.ts";
|
|
6
7
|
import { ResilientQueue } from "./resilientQueue.ts";
|
|
7
8
|
declare function createFailedJobService(): FailedJobService;
|
|
@@ -12,4 +13,4 @@ declare function createProductionQueue(driver: "sync" | "async" | "redis", optio
|
|
|
12
13
|
registerJobs?: () => void;
|
|
13
14
|
}): Queue;
|
|
14
15
|
declare function createQueueWorker(redisUrl: string, failedJobs?: FailedJobService): QueueWorker;
|
|
15
|
-
export { createFailedJobService, createProductionQueue, createQueueWorker, createTrackedJob, FailedJobRepository, FailedJobService, jobRegistry, QueueWorker, RedisQueue, ResilientQueue, };
|
|
16
|
+
export { createFailedJobService, createProductionQueue, createQueueWorker, createTrackedJob, FailedJobRepository, FailedJobService, jobRegistry, QueueWorker, RedisQueue, ResilientQueue, runQueueJob, };
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
export { resolveApplicationAuth, resolveApplicationCache, resolveApplicationConfig, resolveApplicationDependencies, resolveApplicationLogger, resolveApplicationPolicyGate, resolveApplicationQueue, setActiveApplicationContext, } from "../bootstrap/applicationRegistry.ts";
|
|
6
6
|
export type { ServiceProvider } from "../bootstrap/contracts.ts";
|
|
7
7
|
export { ConfigStore, resolveService, ServiceContainer, } from "../bootstrap/contracts.ts";
|
|
8
|
+
export type { AdminColumn, AdminColumnType, AdminResource, AdminResourceDefinition, AdminResourceHandlers, } from "../core/admin/index.ts";
|
|
9
|
+
export { AdminResourceRegistry, formatAdminValue, } from "../core/admin/index.ts";
|
|
8
10
|
export type { AbilityChecker } from "../core/auth/abilityChecker.ts";
|
|
9
11
|
export type { AuthUser } from "../core/auth/authContext.ts";
|
|
10
12
|
export { currentAuthUser, runWithAuthUser } from "../core/auth/authContext.ts";
|
|
@@ -21,8 +23,8 @@ export { freshDatabase, getMigrationStatus, loadMigrationsFromDirectory, migrate
|
|
|
21
23
|
export type { Migration, MigrationDatabase, MigrationStatus, } from "../core/database/migrations/types.ts";
|
|
22
24
|
export type { CastType, GlobalScopeFn, ModelConstructor } from "../core/database/model.ts";
|
|
23
25
|
export { applyCasts, dehydrateValue, filterMassAssignable, hydrateValue, Model, registerModelRepository, } from "../core/database/model.ts";
|
|
24
|
-
export type { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasOneRelation, } from "../core/database/relationships.ts";
|
|
25
|
-
export { belongsTo, belongsToMany, hasMany, hasOne, indexBelongsToManyRelation, indexBelongsToRelation, indexHasManyRelation, indexHasOneRelation, } from "../core/database/relationships.ts";
|
|
26
|
+
export type { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasOneRelation, MorphManyRelation, MorphOneRelation, MorphToRelation, } from "../core/database/relationships.ts";
|
|
27
|
+
export { belongsTo, belongsToMany, hasMany, hasOne, indexBelongsToManyRelation, indexBelongsToRelation, indexHasManyRelation, indexHasOneRelation, indexMorphManyRelation, indexMorphOneRelation, indexMorphToRelation, morphMany, morphOne, morphTo, } from "../core/database/relationships.ts";
|
|
26
28
|
export { RepositoryQuery } from "../core/database/repositoryQuery.ts";
|
|
27
29
|
export type { BlueprintAction, BlueprintCallback, ColumnKind, DatabaseDriver, ForeignKeyOptions, Grammar, IndexDefinition, IndexKind, ResolveDatabaseDriverOptions, SchemaBuilder, } from "../core/database/schema/index.ts";
|
|
28
30
|
export { Blueprint, ColumnDefinition, compileBlueprint, createSchemaBuilder, ForeignIdColumnDefinition, grammarForDriver, inferReferencedTable, MySqlGrammar, PostgresGrammar, resolveDatabaseDriver, Schema, SqliteGrammar, UnsupportedSchemaFeatureError, } from "../core/database/schema/index.ts";
|
|
@@ -56,13 +58,19 @@ export { createThrottleMiddleware } from "../core/http/throttleMiddleware.ts";
|
|
|
56
58
|
export { WebFormRequest } from "../core/http/webFormRequest.ts";
|
|
57
59
|
export { installGracefulShutdownSignals, registerShutdownHandler, runGracefulShutdown, } from "../core/lifecycle/gracefulShutdown.ts";
|
|
58
60
|
export type { MailDriver, MailMessage } from "../core/mail/mailer.ts";
|
|
59
|
-
export { LogMailDriver, Mailer, mailer } from "../core/mail/mailer.ts";
|
|
61
|
+
export { buildSmtpPayload, LogMailDriver, Mailer, mailer, } from "../core/mail/mailer.ts";
|
|
62
|
+
export type { MarkdownMailLayoutOptions, RenderedMarkdownMail } from "../core/mail/markdownMail.ts";
|
|
63
|
+
export { markdownToHtml, renderMarkdownMail, stripMarkdown, wrapMarkdownMailLayout, } from "../core/mail/markdownMail.ts";
|
|
64
|
+
export type { MarkdownMailableInput } from "../core/mail/markdownMailable.ts";
|
|
65
|
+
export { buildMarkdownMailMessage, sendMarkdownMail } from "../core/mail/markdownMailable.ts";
|
|
60
66
|
export type { MetricLabels } from "../core/metrics/prometheus.ts";
|
|
61
67
|
export { PrometheusRegistry, prometheusRegistry } from "../core/metrics/prometheus.ts";
|
|
68
|
+
export type { DatabaseNotificationPayload, DatabaseNotificationStore, MailNotificationMessage, Notifiable, NotificationChannelName, } from "../core/notifications/index.ts";
|
|
69
|
+
export { createNotificationDispatcher, Notification, NotificationDispatcher, } from "../core/notifications/index.ts";
|
|
62
70
|
export type { CursorPaginatedResult, PaginatedResult, PaginationMeta, } from "../core/pagination/index.ts";
|
|
63
71
|
export type { Queue, QueuePriority } from "../core/queue/index.ts";
|
|
64
72
|
export { AsyncQueue, createQueue, Job, SyncQueue } from "../core/queue/index.ts";
|
|
65
|
-
export { createFailedJobService, createProductionQueue, createQueueWorker, createTrackedJob, FailedJobRepository, FailedJobService, jobRegistry, QueueWorker, RedisQueue, ResilientQueue, } from "../core/queue/publicQueue.ts";
|
|
73
|
+
export { createFailedJobService, createProductionQueue, createQueueWorker, createTrackedJob, FailedJobRepository, FailedJobService, jobRegistry, QueueWorker, RedisQueue, ResilientQueue, runQueueJob, } from "../core/queue/publicQueue.ts";
|
|
66
74
|
export type { ScheduledTask } from "../core/scheduler/schedule.ts";
|
|
67
75
|
export { appSchedule, runDueScheduledTasks, Schedule } from "../core/scheduler/schedule.ts";
|
|
68
76
|
export type { StorageDriver } from "../core/storage/storage.ts";
|
package/dist/index.js
CHANGED
|
@@ -2347,6 +2347,39 @@ function indexBelongsToRelation(children, parents, relation) {
|
|
|
2347
2347
|
}
|
|
2348
2348
|
return result;
|
|
2349
2349
|
}
|
|
2350
|
+
function indexMorphManyRelation(parents, children, relation) {
|
|
2351
|
+
const groups = new Map;
|
|
2352
|
+
for (const parent of parents) {
|
|
2353
|
+
groups.set(parent[relation.localKey], []);
|
|
2354
|
+
}
|
|
2355
|
+
for (const child of children) {
|
|
2356
|
+
if (child[relation.morphTypeKey] !== relation.morphType) {
|
|
2357
|
+
continue;
|
|
2358
|
+
}
|
|
2359
|
+
const key = child[relation.morphIdKey];
|
|
2360
|
+
const group = groups.get(key);
|
|
2361
|
+
if (!group) {
|
|
2362
|
+
continue;
|
|
2363
|
+
}
|
|
2364
|
+
group.push(child);
|
|
2365
|
+
}
|
|
2366
|
+
return groups;
|
|
2367
|
+
}
|
|
2368
|
+
function indexMorphToRelation(children, parentsByType, relation) {
|
|
2369
|
+
const result = new Map;
|
|
2370
|
+
for (const child of children) {
|
|
2371
|
+
const morphType = String(child[relation.morphTypeKey]);
|
|
2372
|
+
const parents = parentsByType.get(morphType);
|
|
2373
|
+
if (!parents) {
|
|
2374
|
+
continue;
|
|
2375
|
+
}
|
|
2376
|
+
const parent = parents.get(child[relation.morphIdKey]);
|
|
2377
|
+
if (parent) {
|
|
2378
|
+
result.set(child[relation.morphIdKey], parent);
|
|
2379
|
+
}
|
|
2380
|
+
}
|
|
2381
|
+
return result;
|
|
2382
|
+
}
|
|
2350
2383
|
|
|
2351
2384
|
// ../../src/core/database/boundConnection.ts
|
|
2352
2385
|
var boundConnectionHolder = {
|
|
@@ -2477,6 +2510,37 @@ class RepositoryQuery {
|
|
|
2477
2510
|
});
|
|
2478
2511
|
return this;
|
|
2479
2512
|
}
|
|
2513
|
+
withMorphMany(as, relation, childRepository, options = {}) {
|
|
2514
|
+
this.eagerLoads.push({
|
|
2515
|
+
kind: "morphMany",
|
|
2516
|
+
as,
|
|
2517
|
+
relation,
|
|
2518
|
+
repository: childRepository,
|
|
2519
|
+
options
|
|
2520
|
+
});
|
|
2521
|
+
return this;
|
|
2522
|
+
}
|
|
2523
|
+
withMorphOne(as, relation, childRepository, options = {}) {
|
|
2524
|
+
this.eagerLoads.push({
|
|
2525
|
+
kind: "morphOne",
|
|
2526
|
+
as,
|
|
2527
|
+
relation,
|
|
2528
|
+
repository: childRepository,
|
|
2529
|
+
options
|
|
2530
|
+
});
|
|
2531
|
+
return this;
|
|
2532
|
+
}
|
|
2533
|
+
withMorphTo(as, relation, repositoriesByType, options = {}) {
|
|
2534
|
+
this.eagerLoads.push({
|
|
2535
|
+
kind: "morphTo",
|
|
2536
|
+
as,
|
|
2537
|
+
relation,
|
|
2538
|
+
repository: this.repository,
|
|
2539
|
+
morphRepositories: repositoriesByType,
|
|
2540
|
+
options
|
|
2541
|
+
});
|
|
2542
|
+
return this;
|
|
2543
|
+
}
|
|
2480
2544
|
async get() {
|
|
2481
2545
|
const rows = await this.repository.findAll(this.buildOptions());
|
|
2482
2546
|
return await this.attach(rows);
|
|
@@ -2537,6 +2601,33 @@ class RepositoryQuery {
|
|
|
2537
2601
|
}));
|
|
2538
2602
|
continue;
|
|
2539
2603
|
}
|
|
2604
|
+
if (load.kind === "morphMany") {
|
|
2605
|
+
const relation2 = load.relation;
|
|
2606
|
+
const grouped2 = await load.repository.withConnection(this.repository.getConnection()).loadMorphManyForParents(rows, relation2, load.options);
|
|
2607
|
+
result = result.map((row) => ({
|
|
2608
|
+
...row,
|
|
2609
|
+
[load.as]: grouped2.get(row[relation2.localKey]) ?? []
|
|
2610
|
+
}));
|
|
2611
|
+
continue;
|
|
2612
|
+
}
|
|
2613
|
+
if (load.kind === "morphOne") {
|
|
2614
|
+
const relation2 = load.relation;
|
|
2615
|
+
const grouped2 = await load.repository.withConnection(this.repository.getConnection()).loadMorphOneForParents(rows, relation2, load.options);
|
|
2616
|
+
result = result.map((row) => ({
|
|
2617
|
+
...row,
|
|
2618
|
+
[load.as]: grouped2.get(row[relation2.localKey])
|
|
2619
|
+
}));
|
|
2620
|
+
continue;
|
|
2621
|
+
}
|
|
2622
|
+
if (load.kind === "morphTo") {
|
|
2623
|
+
const relation2 = load.relation;
|
|
2624
|
+
const grouped2 = await this.repository.loadMorphToForChildren(rows, relation2, load.morphRepositories ?? new Map, load.options);
|
|
2625
|
+
result = result.map((row) => ({
|
|
2626
|
+
...row,
|
|
2627
|
+
[load.as]: grouped2.get(row[relation2.morphIdKey])
|
|
2628
|
+
}));
|
|
2629
|
+
continue;
|
|
2630
|
+
}
|
|
2540
2631
|
const relation = load.relation;
|
|
2541
2632
|
const grouped = await this.repository.loadBelongsToForParents(rows, relation, load.repository, load.options);
|
|
2542
2633
|
result = result.map((row) => ({
|
|
@@ -2813,6 +2904,56 @@ class BaseRepository5 {
|
|
|
2813
2904
|
}, options);
|
|
2814
2905
|
return indexBelongsToRelation(children, parents, relation);
|
|
2815
2906
|
}
|
|
2907
|
+
async loadMorphManyForParents(parents, relation, options = {}) {
|
|
2908
|
+
if (parents.length === 0) {
|
|
2909
|
+
return indexMorphManyRelation(parents, [], relation);
|
|
2910
|
+
}
|
|
2911
|
+
const parentIds = [...new Set(parents.map((parent) => parent[relation.localKey]))];
|
|
2912
|
+
const children = await this.findWhere({
|
|
2913
|
+
[relation.morphTypeKey]: relation.morphType,
|
|
2914
|
+
[relation.morphIdKey]: parentIds
|
|
2915
|
+
}, options);
|
|
2916
|
+
return indexMorphManyRelation(parents, children, relation);
|
|
2917
|
+
}
|
|
2918
|
+
async loadMorphOneForParents(parents, relation, options = {}) {
|
|
2919
|
+
const grouped = await this.loadMorphManyForParents(parents, relation, options);
|
|
2920
|
+
const result = new Map;
|
|
2921
|
+
for (const parent of parents) {
|
|
2922
|
+
const matches = grouped.get(parent[relation.localKey]) ?? [];
|
|
2923
|
+
result.set(parent[relation.localKey], matches[0]);
|
|
2924
|
+
}
|
|
2925
|
+
return result;
|
|
2926
|
+
}
|
|
2927
|
+
async loadMorphToForChildren(children, relation, repositoriesByType, options = {}) {
|
|
2928
|
+
if (children.length === 0) {
|
|
2929
|
+
return new Map;
|
|
2930
|
+
}
|
|
2931
|
+
const idsByType = new Map;
|
|
2932
|
+
for (const child of children) {
|
|
2933
|
+
const morphType = String(child[relation.morphTypeKey]);
|
|
2934
|
+
const morphId = child[relation.morphIdKey];
|
|
2935
|
+
const ids = idsByType.get(morphType) ?? new Set;
|
|
2936
|
+
ids.add(morphId);
|
|
2937
|
+
idsByType.set(morphType, ids);
|
|
2938
|
+
}
|
|
2939
|
+
const parentsByType = new Map;
|
|
2940
|
+
for (const [morphType, ids] of idsByType) {
|
|
2941
|
+
const repository = repositoriesByType.get(morphType);
|
|
2942
|
+
if (!repository) {
|
|
2943
|
+
continue;
|
|
2944
|
+
}
|
|
2945
|
+
const ownerKey = repository.getTable().primaryKey;
|
|
2946
|
+
const parents = await repository.withConnection(this.connection).findWhere({
|
|
2947
|
+
[ownerKey]: [...ids]
|
|
2948
|
+
}, options);
|
|
2949
|
+
const indexed = new Map;
|
|
2950
|
+
for (const parent of parents) {
|
|
2951
|
+
indexed.set(parent[ownerKey], parent);
|
|
2952
|
+
}
|
|
2953
|
+
parentsByType.set(morphType, indexed);
|
|
2954
|
+
}
|
|
2955
|
+
return indexMorphToRelation(children, parentsByType, relation);
|
|
2956
|
+
}
|
|
2816
2957
|
}
|
|
2817
2958
|
var baseRepository_default = BaseRepository5;
|
|
2818
2959
|
// ../../src/core/database/model.ts
|
|
@@ -3429,6 +3570,12 @@ class FailedJobService {
|
|
|
3429
3570
|
await this.repository.deleteById(id);
|
|
3430
3571
|
return failedJob;
|
|
3431
3572
|
}
|
|
3573
|
+
async delete(id) {
|
|
3574
|
+
const deleted = await this.repository.deleteById(id);
|
|
3575
|
+
if (!deleted) {
|
|
3576
|
+
throw new Error(`Failed job ${id} not found.`);
|
|
3577
|
+
}
|
|
3578
|
+
}
|
|
3432
3579
|
async flush() {
|
|
3433
3580
|
const jobs = await this.repository.findAll();
|
|
3434
3581
|
let deleted = 0;
|
|
@@ -3442,9 +3589,6 @@ class FailedJobService {
|
|
|
3442
3589
|
}
|
|
3443
3590
|
var failedJobService_default = FailedJobService;
|
|
3444
3591
|
|
|
3445
|
-
// ../../src/core/queue/redisQueue.ts
|
|
3446
|
-
var {RedisClient: RedisClient2 } = globalThis.Bun;
|
|
3447
|
-
|
|
3448
3592
|
// ../../src/core/queue/jobRunner.ts
|
|
3449
3593
|
async function runQueueJob(envelope, failedJobs) {
|
|
3450
3594
|
const job = jobRegistry.create(envelope.name);
|
|
@@ -3476,6 +3620,7 @@ async function runQueueJob(envelope, failedJobs) {
|
|
|
3476
3620
|
}
|
|
3477
3621
|
|
|
3478
3622
|
// ../../src/core/queue/redisQueue.ts
|
|
3623
|
+
var {RedisClient: RedisClient2 } = globalThis.Bun;
|
|
3479
3624
|
var QUEUE_LIST_KEY = "workhub:queue:default";
|
|
3480
3625
|
var QUEUE_HIGH_KEY = "workhub:queue:high";
|
|
3481
3626
|
var QUEUE_LOW_KEY = "workhub:queue:low";
|
|
@@ -5333,6 +5478,51 @@ async function parseFormBody(request) {
|
|
|
5333
5478
|
}
|
|
5334
5479
|
return { fields, files };
|
|
5335
5480
|
}
|
|
5481
|
+
// ../../src/bootstrap/web/routing.ts
|
|
5482
|
+
import { securedBindRouteModelByKey, withErrorHandling } from "@getstrata/core";
|
|
5483
|
+
function routeParams(request) {
|
|
5484
|
+
const normalized = {};
|
|
5485
|
+
const raw = request.params;
|
|
5486
|
+
if (raw && typeof raw === "object") {
|
|
5487
|
+
for (const [key, value] of Object.entries(raw)) {
|
|
5488
|
+
normalized[key] = decodeURIComponent(String(value));
|
|
5489
|
+
}
|
|
5490
|
+
}
|
|
5491
|
+
return normalized;
|
|
5492
|
+
}
|
|
5493
|
+
function toRouteRequest(request) {
|
|
5494
|
+
const params = routeParams(request);
|
|
5495
|
+
Object.defineProperty(request, "params", {
|
|
5496
|
+
value: params,
|
|
5497
|
+
enumerable: true,
|
|
5498
|
+
configurable: true,
|
|
5499
|
+
writable: true
|
|
5500
|
+
});
|
|
5501
|
+
return request;
|
|
5502
|
+
}
|
|
5503
|
+
function wrapSecuredRouteModelByKey(param, resolver, authorization, handler) {
|
|
5504
|
+
const bound = withErrorHandling(securedBindRouteModelByKey(param, resolver, authorization, handler));
|
|
5505
|
+
return async (request) => bound(toRouteRequest(request));
|
|
5506
|
+
}
|
|
5507
|
+
function wrapWebLogin(kernel, handler, onThrottled) {
|
|
5508
|
+
return wrapWebThrottle(kernel, "login", handler, onThrottled);
|
|
5509
|
+
}
|
|
5510
|
+
function wrapWebRegister(kernel, handler, onThrottled) {
|
|
5511
|
+
return wrapWebThrottle(kernel, "register", handler, onThrottled);
|
|
5512
|
+
}
|
|
5513
|
+
function wrapWebThrottle(kernel, scope, handler, onThrottled) {
|
|
5514
|
+
const throttled = scope === "login" ? kernel.wrapLogin(handler) : kernel.wrapRegister(handler);
|
|
5515
|
+
return async (request) => {
|
|
5516
|
+
const response = await throttled(request);
|
|
5517
|
+
if (response.status === 429) {
|
|
5518
|
+
return onThrottled(request);
|
|
5519
|
+
}
|
|
5520
|
+
return response;
|
|
5521
|
+
};
|
|
5522
|
+
}
|
|
5523
|
+
function createRouteKernel(dependencies) {
|
|
5524
|
+
return createHttpKernel(dependencies);
|
|
5525
|
+
}
|
|
5336
5526
|
// ../../src/bootstrap/web/server.ts
|
|
5337
5527
|
function wrapRouteHandler2(handler) {
|
|
5338
5528
|
return async (request) => {
|
|
@@ -5433,7 +5623,8 @@ class CookieSessionStore {
|
|
|
5433
5623
|
if (!sessionId || !signature || signature !== this.sign(sessionId)) {
|
|
5434
5624
|
return null;
|
|
5435
5625
|
}
|
|
5436
|
-
const rows = await this.sql.unsafe(`SELECT s.id, s.user_id, s.expires_at, u.name, u.email, u.learn_subscriber
|
|
5626
|
+
const rows = await this.sql.unsafe(`SELECT s.id, s.user_id, s.expires_at, u.name, u.email, u.learn_subscriber,
|
|
5627
|
+
COALESCE(u.is_admin, false) AS is_admin
|
|
5437
5628
|
FROM sessions s
|
|
5438
5629
|
INNER JOIN users u ON u.id = s.user_id
|
|
5439
5630
|
WHERE s.id = $1 AND s.expires_at > NOW()`, [sessionId]);
|
|
@@ -5444,7 +5635,8 @@ class CookieSessionStore {
|
|
|
5444
5635
|
id: row.user_id,
|
|
5445
5636
|
name: row.name,
|
|
5446
5637
|
email: row.email,
|
|
5447
|
-
learn_subscriber: row.learn_subscriber
|
|
5638
|
+
learn_subscriber: row.learn_subscriber,
|
|
5639
|
+
is_admin: row.is_admin
|
|
5448
5640
|
};
|
|
5449
5641
|
}
|
|
5450
5642
|
sign(value) {
|
|
@@ -5456,11 +5648,16 @@ function slugify(value) {
|
|
|
5456
5648
|
return value.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 80);
|
|
5457
5649
|
}
|
|
5458
5650
|
export {
|
|
5651
|
+
wrapWebRegister,
|
|
5652
|
+
wrapWebLogin,
|
|
5653
|
+
wrapSecuredRouteModelByKey,
|
|
5654
|
+
toRouteRequest,
|
|
5459
5655
|
slugify,
|
|
5460
5656
|
setActiveApplicationContext2 as setActiveApplicationContext,
|
|
5461
5657
|
scheduleRunCommand,
|
|
5462
5658
|
runProviderPhase,
|
|
5463
5659
|
runDueScheduledTasks,
|
|
5660
|
+
routeParams,
|
|
5464
5661
|
resolveService,
|
|
5465
5662
|
resolveApplicationQueue2 as resolveApplicationQueue,
|
|
5466
5663
|
prefixRouteMap,
|
|
@@ -5469,6 +5666,7 @@ export {
|
|
|
5469
5666
|
getRequiredDependency,
|
|
5470
5667
|
createWebServer,
|
|
5471
5668
|
createWebRoutes,
|
|
5669
|
+
createRouteKernel,
|
|
5472
5670
|
createHttpKernel,
|
|
5473
5671
|
createCsrfProtection,
|
|
5474
5672
|
createAppContext,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AppDependencies } from "@getstrata/bootstrap/contracts";
|
|
2
|
+
declare class ScimController {
|
|
3
|
+
private readonly service;
|
|
4
|
+
constructor(dependencies: AppDependencies);
|
|
5
|
+
readonly serviceProviderConfig: () => Promise<Response>;
|
|
6
|
+
readonly listUsers: (request: Request) => Promise<Response>;
|
|
7
|
+
readonly createUser: (request: Request) => Promise<Response>;
|
|
8
|
+
readonly showUser: (request: Request) => Promise<Response>;
|
|
9
|
+
readonly patchUser: (request: Request) => Promise<Response>;
|
|
10
|
+
readonly deleteUser: (request: Request) => Promise<Response>;
|
|
11
|
+
readonly listGroups: (request: Request) => Promise<Response>;
|
|
12
|
+
readonly showGroup: (request: Request) => Promise<Response>;
|
|
13
|
+
readonly patchGroup: (request: Request) => Promise<Response>;
|
|
14
|
+
}
|
|
15
|
+
export default ScimController;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type EtagVersioned } from "@getstrata/core/http/etag";
|
|
2
|
+
interface ScimResponseOptions {
|
|
3
|
+
status?: number;
|
|
4
|
+
request?: Request;
|
|
5
|
+
etagSource?: EtagVersioned;
|
|
6
|
+
}
|
|
7
|
+
declare function scimResponse(data: unknown, options?: ScimResponseOptions): Response;
|
|
8
|
+
declare function assertScimIfMatch(request: Request, etagSource: EtagVersioned): void;
|
|
9
|
+
export type { ScimResponseOptions };
|
|
10
|
+
export { assertScimIfMatch, scimResponse };
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import type { AppDependencies } from "@getstrata/bootstrap/contracts";
|
|
2
|
+
import OrganizationMemberRepository from "../organization/memberRepository";
|
|
3
|
+
import type UserRepository from "../user/repository";
|
|
4
|
+
interface ScimUserPayload {
|
|
5
|
+
userName?: string;
|
|
6
|
+
name?: {
|
|
7
|
+
formatted?: string;
|
|
8
|
+
};
|
|
9
|
+
active?: boolean;
|
|
10
|
+
emails?: Array<{
|
|
11
|
+
value: string;
|
|
12
|
+
primary?: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
interface ScimPatchOperation {
|
|
16
|
+
op: string;
|
|
17
|
+
path?: string;
|
|
18
|
+
value?: unknown;
|
|
19
|
+
}
|
|
20
|
+
declare class ScimService {
|
|
21
|
+
private readonly users;
|
|
22
|
+
private readonly members;
|
|
23
|
+
constructor(users: UserRepository, members: OrganizationMemberRepository);
|
|
24
|
+
serviceProviderConfig(): {
|
|
25
|
+
schemas: "urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig"[];
|
|
26
|
+
patch: {
|
|
27
|
+
supported: boolean;
|
|
28
|
+
};
|
|
29
|
+
bulk: {
|
|
30
|
+
supported: boolean;
|
|
31
|
+
};
|
|
32
|
+
filter: {
|
|
33
|
+
supported: boolean;
|
|
34
|
+
};
|
|
35
|
+
changePassword: {
|
|
36
|
+
supported: boolean;
|
|
37
|
+
};
|
|
38
|
+
sort: {
|
|
39
|
+
supported: boolean;
|
|
40
|
+
};
|
|
41
|
+
etag: {
|
|
42
|
+
supported: boolean;
|
|
43
|
+
};
|
|
44
|
+
authenticationSchemes: {
|
|
45
|
+
type: string;
|
|
46
|
+
name: string;
|
|
47
|
+
description: string;
|
|
48
|
+
}[];
|
|
49
|
+
};
|
|
50
|
+
listUsers(startIndex?: number, count?: number): Promise<{
|
|
51
|
+
schemas: "urn:ietf:params:scim:api:messages:2.0:ListResponse"[];
|
|
52
|
+
totalResults: number;
|
|
53
|
+
startIndex: number;
|
|
54
|
+
itemsPerPage: number;
|
|
55
|
+
Resources: {
|
|
56
|
+
schemas: "urn:ietf:params:scim:schemas:core:2.0:User"[];
|
|
57
|
+
id: string;
|
|
58
|
+
userName: string;
|
|
59
|
+
name: {
|
|
60
|
+
formatted: string;
|
|
61
|
+
};
|
|
62
|
+
displayName: string;
|
|
63
|
+
active: boolean;
|
|
64
|
+
emails: {
|
|
65
|
+
value: string;
|
|
66
|
+
primary: boolean;
|
|
67
|
+
type: string;
|
|
68
|
+
}[];
|
|
69
|
+
roles: {
|
|
70
|
+
value: string;
|
|
71
|
+
primary: boolean;
|
|
72
|
+
}[];
|
|
73
|
+
meta: {
|
|
74
|
+
resourceType: string;
|
|
75
|
+
created: string | undefined;
|
|
76
|
+
lastModified: string | undefined;
|
|
77
|
+
};
|
|
78
|
+
}[];
|
|
79
|
+
}>;
|
|
80
|
+
getUser(id: number): Promise<{
|
|
81
|
+
schemas: "urn:ietf:params:scim:schemas:core:2.0:User"[];
|
|
82
|
+
id: string;
|
|
83
|
+
userName: string;
|
|
84
|
+
name: {
|
|
85
|
+
formatted: string;
|
|
86
|
+
};
|
|
87
|
+
displayName: string;
|
|
88
|
+
active: boolean;
|
|
89
|
+
emails: {
|
|
90
|
+
value: string;
|
|
91
|
+
primary: boolean;
|
|
92
|
+
type: string;
|
|
93
|
+
}[];
|
|
94
|
+
roles: {
|
|
95
|
+
value: string;
|
|
96
|
+
primary: boolean;
|
|
97
|
+
}[];
|
|
98
|
+
meta: {
|
|
99
|
+
resourceType: string;
|
|
100
|
+
created: string | undefined;
|
|
101
|
+
lastModified: string | undefined;
|
|
102
|
+
};
|
|
103
|
+
}>;
|
|
104
|
+
findUserRecord(id: number): Promise<import("../user/types").UserRecord>;
|
|
105
|
+
createUser(payload: ScimUserPayload): Promise<{
|
|
106
|
+
schemas: "urn:ietf:params:scim:schemas:core:2.0:User"[];
|
|
107
|
+
id: string;
|
|
108
|
+
userName: string;
|
|
109
|
+
name: {
|
|
110
|
+
formatted: string;
|
|
111
|
+
};
|
|
112
|
+
displayName: string;
|
|
113
|
+
active: boolean;
|
|
114
|
+
emails: {
|
|
115
|
+
value: string;
|
|
116
|
+
primary: boolean;
|
|
117
|
+
type: string;
|
|
118
|
+
}[];
|
|
119
|
+
roles: {
|
|
120
|
+
value: string;
|
|
121
|
+
primary: boolean;
|
|
122
|
+
}[];
|
|
123
|
+
meta: {
|
|
124
|
+
resourceType: string;
|
|
125
|
+
created: string | undefined;
|
|
126
|
+
lastModified: string | undefined;
|
|
127
|
+
};
|
|
128
|
+
}>;
|
|
129
|
+
patchUser(id: number, operations: ScimPatchOperation[]): Promise<{
|
|
130
|
+
schemas: "urn:ietf:params:scim:schemas:core:2.0:User"[];
|
|
131
|
+
id: string;
|
|
132
|
+
userName: string;
|
|
133
|
+
name: {
|
|
134
|
+
formatted: string;
|
|
135
|
+
};
|
|
136
|
+
displayName: string;
|
|
137
|
+
active: boolean;
|
|
138
|
+
emails: {
|
|
139
|
+
value: string;
|
|
140
|
+
primary: boolean;
|
|
141
|
+
type: string;
|
|
142
|
+
}[];
|
|
143
|
+
roles: {
|
|
144
|
+
value: string;
|
|
145
|
+
primary: boolean;
|
|
146
|
+
}[];
|
|
147
|
+
meta: {
|
|
148
|
+
resourceType: string;
|
|
149
|
+
created: string | undefined;
|
|
150
|
+
lastModified: string | undefined;
|
|
151
|
+
};
|
|
152
|
+
}>;
|
|
153
|
+
deleteUser(id: number): Promise<{
|
|
154
|
+
id: number;
|
|
155
|
+
updated_at: Date;
|
|
156
|
+
}>;
|
|
157
|
+
listGroups(startIndex?: number, count?: number): Promise<{
|
|
158
|
+
schemas: "urn:ietf:params:scim:api:messages:2.0:ListResponse"[];
|
|
159
|
+
totalResults: number;
|
|
160
|
+
startIndex: number;
|
|
161
|
+
itemsPerPage: number;
|
|
162
|
+
Resources: {
|
|
163
|
+
schemas: "urn:ietf:params:scim:schemas:core:2.0:Group"[];
|
|
164
|
+
id: string;
|
|
165
|
+
displayName: string;
|
|
166
|
+
externalId: string;
|
|
167
|
+
members: {
|
|
168
|
+
value: string;
|
|
169
|
+
display: string;
|
|
170
|
+
}[];
|
|
171
|
+
meta: {
|
|
172
|
+
resourceType: string;
|
|
173
|
+
lastModified: string;
|
|
174
|
+
};
|
|
175
|
+
}[];
|
|
176
|
+
}>;
|
|
177
|
+
getGroup(id: number): Promise<{
|
|
178
|
+
schemas: "urn:ietf:params:scim:schemas:core:2.0:Group"[];
|
|
179
|
+
id: string;
|
|
180
|
+
displayName: string;
|
|
181
|
+
externalId: string;
|
|
182
|
+
members: {
|
|
183
|
+
value: string;
|
|
184
|
+
display: string;
|
|
185
|
+
}[];
|
|
186
|
+
meta: {
|
|
187
|
+
resourceType: string;
|
|
188
|
+
lastModified: string;
|
|
189
|
+
};
|
|
190
|
+
}>;
|
|
191
|
+
findOrganizationRecord(id: number): Promise<{
|
|
192
|
+
id: number;
|
|
193
|
+
name: string;
|
|
194
|
+
slug: string;
|
|
195
|
+
updated_at: Date;
|
|
196
|
+
}>;
|
|
197
|
+
patchGroup(id: number, operations: ScimPatchOperation[]): Promise<{
|
|
198
|
+
schemas: "urn:ietf:params:scim:schemas:core:2.0:Group"[];
|
|
199
|
+
id: string;
|
|
200
|
+
displayName: string;
|
|
201
|
+
externalId: string;
|
|
202
|
+
members: {
|
|
203
|
+
value: string;
|
|
204
|
+
display: string;
|
|
205
|
+
}[];
|
|
206
|
+
meta: {
|
|
207
|
+
resourceType: string;
|
|
208
|
+
lastModified: string;
|
|
209
|
+
};
|
|
210
|
+
}>;
|
|
211
|
+
private toScimGroup;
|
|
212
|
+
private toScimUser;
|
|
213
|
+
}
|
|
214
|
+
declare function createScimService(dependencies: AppDependencies): ScimService;
|
|
215
|
+
export default ScimService;
|
|
216
|
+
export type { ScimPatchOperation, ScimUserPayload };
|
|
217
|
+
export { createScimService };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getstrata/bootstrap",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Strata application bootstrap — HttpKernel, DI, web session helpers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,42 +16,42 @@
|
|
|
16
16
|
"default": "./dist/index.js"
|
|
17
17
|
},
|
|
18
18
|
"./applicationRegistry": {
|
|
19
|
-
"types": "./dist/
|
|
19
|
+
"types": "./dist/bootstrap/applicationRegistry.d.ts",
|
|
20
20
|
"import": "./dist/entries/applicationRegistry.js",
|
|
21
21
|
"default": "./dist/entries/applicationRegistry.js"
|
|
22
22
|
},
|
|
23
23
|
"./config": {
|
|
24
|
-
"types": "./dist/
|
|
24
|
+
"types": "./dist/bootstrap/config.d.ts",
|
|
25
25
|
"import": "./dist/entries/config.js",
|
|
26
26
|
"default": "./dist/entries/config.js"
|
|
27
27
|
},
|
|
28
28
|
"./context": {
|
|
29
|
-
"types": "./dist/
|
|
29
|
+
"types": "./dist/bootstrap/context.d.ts",
|
|
30
30
|
"import": "./dist/entries/context.js",
|
|
31
31
|
"default": "./dist/entries/context.js"
|
|
32
32
|
},
|
|
33
33
|
"./contracts": {
|
|
34
|
-
"types": "./dist/
|
|
34
|
+
"types": "./dist/bootstrap/contracts.d.ts",
|
|
35
35
|
"import": "./dist/entries/contracts.js",
|
|
36
36
|
"default": "./dist/entries/contracts.js"
|
|
37
37
|
},
|
|
38
38
|
"./createWebRoutes": {
|
|
39
|
-
"types": "./dist/
|
|
39
|
+
"types": "./dist/bootstrap/createWebRoutes.d.ts",
|
|
40
40
|
"import": "./dist/entries/createWebRoutes.js",
|
|
41
41
|
"default": "./dist/entries/createWebRoutes.js"
|
|
42
42
|
},
|
|
43
43
|
"./httpKernel": {
|
|
44
|
-
"types": "./dist/
|
|
44
|
+
"types": "./dist/bootstrap/httpKernel.d.ts",
|
|
45
45
|
"import": "./dist/entries/httpKernel.js",
|
|
46
46
|
"default": "./dist/entries/httpKernel.js"
|
|
47
47
|
},
|
|
48
48
|
"./providers": {
|
|
49
|
-
"types": "./dist/
|
|
49
|
+
"types": "./dist/bootstrap/providers/index.d.ts",
|
|
50
50
|
"import": "./dist/entries/providers.js",
|
|
51
51
|
"default": "./dist/entries/providers.js"
|
|
52
52
|
},
|
|
53
53
|
"./providers/view": {
|
|
54
|
-
"types": "./dist/
|
|
54
|
+
"types": "./dist/bootstrap/providers/view/index.d.ts",
|
|
55
55
|
"import": "./dist/entries/providers/view.js",
|
|
56
56
|
"default": "./dist/entries/providers/view.js"
|
|
57
57
|
}
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"access": "public"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"@getstrata/core": "^0.5.
|
|
76
|
+
"@getstrata/core": "^0.5.9",
|
|
77
77
|
"typescript": "^5.9.0"
|
|
78
78
|
}
|
|
79
79
|
}
|