@getstrata/bootstrap 0.2.22 → 0.2.25
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/applicationRegistry.d.ts +1 -1
- package/dist/bootstrap/buildModuleRoutes.d.ts +10 -0
- package/dist/bootstrap/buildWebModuleRoutes.d.ts +9 -0
- package/dist/bootstrap/config.d.ts +1 -1
- package/dist/bootstrap/contracts.d.ts +4 -4
- package/dist/bootstrap/env.d.ts +1 -1
- package/dist/bootstrap/membershipService.d.ts +1 -1
- package/dist/bootstrap/public-api.d.ts +6 -2
- package/dist/bootstrap/routeRegistry.d.ts +1 -1
- package/dist/entries/applicationRegistry.js +12 -115
- package/dist/entries/buildModuleRoutes.js +411 -0
- package/dist/entries/buildWebModuleRoutes.js +435 -0
- package/dist/entries/config.js +9 -9
- package/dist/entries/context.js +112 -192
- package/dist/entries/contracts.js +10 -85
- package/dist/entries/createWebRoutes.js +100 -682
- package/dist/entries/dependencies.js +112 -192
- package/dist/entries/http/securedRouteModelBinding.js +0 -37
- package/dist/entries/httpKernel.js +9 -9
- package/dist/entries/membershipService.js +2 -426
- package/dist/entries/providers/view.js +9 -20
- package/dist/entries/providers.js +102 -129
- package/dist/entries/queue/defaultJobs.js +0 -37
- package/dist/entries/web/routing.js +16 -44
- package/dist/index.js +507 -730
- package/package.json +14 -4
- package/dist/cli/commands/scheduleRun.d.ts +0 -3
- package/dist/config/app.d.ts +0 -10
- package/dist/config/auth.d.ts +0 -7
- package/dist/config/contentSecurityPolicy.d.ts +0 -5
- package/dist/config/cors.d.ts +0 -9
- package/dist/config/database.d.ts +0 -10
- package/dist/config/features.d.ts +0 -18
- package/dist/config/frontend.d.ts +0 -6
- package/dist/config/queue.d.ts +0 -8
- package/dist/config/rateLimit.d.ts +0 -10
- package/dist/config/uploads.d.ts +0 -5
- package/dist/core/admin/formatValue.d.ts +0 -3
- package/dist/core/admin/index.d.ts +0 -3
- package/dist/core/admin/registry.d.ts +0 -11
- package/dist/core/admin/types.d.ts +0 -24
- package/dist/core/audit/exportAuditLogs.d.ts +0 -8
- package/dist/core/audit/siemFormatter.d.ts +0 -30
- package/dist/core/auth/abilityChecker.d.ts +0 -6
- package/dist/core/auth/accessControl.d.ts +0 -8
- package/dist/core/auth/authContext.d.ts +0 -11
- package/dist/core/auth/guard.d.ts +0 -36
- package/dist/core/auth/membershipContext.d.ts +0 -15
- package/dist/core/auth/membershipContextMiddleware.d.ts +0 -3
- package/dist/core/auth/membershipMiddleware.d.ts +0 -2
- package/dist/core/auth/membershipScope.d.ts +0 -16
- package/dist/core/auth/membershipService.d.ts +0 -23
- package/dist/core/auth/oauth/oidcProvider.d.ts +0 -18
- package/dist/core/auth/oauth/providers.d.ts +0 -22
- package/dist/core/auth/oauth/samlProvider.d.ts +0 -9
- package/dist/core/auth/oauth/types.d.ts +0 -11
- package/dist/core/auth/password.d.ts +0 -3
- package/dist/core/auth/policy.d.ts +0 -15
- package/dist/core/auth/resolveMembershipService.d.ts +0 -3
- package/dist/core/auth/scimAuthMiddleware.d.ts +0 -3
- package/dist/core/auth/sessionCookie.d.ts +0 -6
- package/dist/core/auth/sessionGuard.d.ts +0 -9
- package/dist/core/auth/tokenHash.d.ts +0 -3
- package/dist/core/cache/createCacheStore.d.ts +0 -11
- package/dist/core/cache/redisCacheStore.d.ts +0 -23
- package/dist/core/cache/repository.d.ts +0 -17
- package/dist/core/cache/simpleCache.d.ts +0 -23
- package/dist/core/cache/simpleCacheStore.d.ts +0 -16
- package/dist/core/cache/store.d.ts +0 -12
- package/dist/core/cache/taggedCache.d.ts +0 -9
- package/dist/core/cache/tags.d.ts +0 -11
- package/dist/core/config/envSchema.d.ts +0 -12
- package/dist/core/contracts/container.d.ts +0 -30
- package/dist/core/contracts/di.d.ts +0 -31
- package/dist/core/contracts/serviceContainer.d.ts +0 -1
- package/dist/core/contracts/serviceTokens.d.ts +0 -8
- package/dist/core/crypto/fieldEncryption.d.ts +0 -13
- package/dist/core/crypto/mfaSecret.d.ts +0 -3
- package/dist/core/crypto/nonCryptographicHash.d.ts +0 -2
- package/dist/core/database/baseRepository.d.ts +0 -67
- package/dist/core/database/bindConnection.d.ts +0 -3
- package/dist/core/database/boundConnection.d.ts +0 -5
- package/dist/core/database/connection.d.ts +0 -7
- package/dist/core/database/connectionContext.d.ts +0 -8
- package/dist/core/database/defaultConnection.d.ts +0 -6
- package/dist/core/database/errors.d.ts +0 -12
- package/dist/core/database/index.d.ts +0 -18
- package/dist/core/database/migrations/advisoryLock.d.ts +0 -6
- package/dist/core/database/migrations/runner.d.ts +0 -25
- package/dist/core/database/migrations/types.d.ts +0 -15
- package/dist/core/database/model.d.ts +0 -57
- package/dist/core/database/query.d.ts +0 -63
- package/dist/core/database/queryProxy.d.ts +0 -3
- package/dist/core/database/relationships.d.ts +0 -100
- package/dist/core/database/repositoryConnection.d.ts +0 -4
- package/dist/core/database/repositoryQuery.d.ts +0 -38
- package/dist/core/database/schema/blueprint.d.ts +0 -47
- package/dist/core/database/schema/columnDefinition.d.ts +0 -36
- package/dist/core/database/schema/driver.d.ts +0 -8
- package/dist/core/database/schema/errors.d.ts +0 -4
- package/dist/core/database/schema/grammars/compileStatements.d.ts +0 -8
- package/dist/core/database/schema/grammars/createGrammar.d.ts +0 -4
- package/dist/core/database/schema/grammars/grammar.d.ts +0 -10
- package/dist/core/database/schema/grammars/index.d.ts +0 -7
- package/dist/core/database/schema/grammars/mysqlGrammar.d.ts +0 -2
- package/dist/core/database/schema/grammars/postgresGrammar.d.ts +0 -2
- package/dist/core/database/schema/grammars/sqliteGrammar.d.ts +0 -2
- package/dist/core/database/schema/index.d.ts +0 -12
- package/dist/core/database/schema/schema.d.ts +0 -21
- package/dist/core/database/seeders/runner.d.ts +0 -6
- package/dist/core/database/seeders/types.d.ts +0 -8
- package/dist/core/database/table.d.ts +0 -13
- package/dist/core/database/transaction.d.ts +0 -3
- package/dist/core/database/types.d.ts +0 -66
- package/dist/core/database/whereBuilder.d.ts +0 -17
- package/dist/core/errors/http.d.ts +0 -33
- package/dist/core/events/eventBus.d.ts +0 -10
- package/dist/core/events/index.d.ts +0 -4
- package/dist/core/facades/index.d.ts +0 -10
- package/dist/core/http/authMiddleware.d.ts +0 -5
- package/dist/core/http/authorizeMiddleware.d.ts +0 -5
- package/dist/core/http/bodySizeLimitMiddleware.d.ts +0 -4
- package/dist/core/http/conditionalResponse.d.ts +0 -2
- package/dist/core/http/contentNegotiation.d.ts +0 -2
- package/dist/core/http/cookies.d.ts +0 -4
- package/dist/core/http/corsMiddleware.d.ts +0 -3
- package/dist/core/http/csrfMiddleware.d.ts +0 -3
- package/dist/core/http/csrfProtection.d.ts +0 -12
- package/dist/core/http/csrfToken.d.ts +0 -14
- package/dist/core/http/etag.d.ts +0 -18
- package/dist/core/http/flashMiddleware.d.ts +0 -3
- package/dist/core/http/flashSession.d.ts +0 -12
- package/dist/core/http/formRequest.d.ts +0 -10
- package/dist/core/http/index.d.ts +0 -27
- package/dist/core/http/loginThrottleMiddleware.d.ts +0 -11
- package/dist/core/http/memoryThrottleMiddleware.d.ts +0 -9
- package/dist/core/http/metricsMiddleware.d.ts +0 -4
- package/dist/core/http/middleware.d.ts +0 -8
- package/dist/core/http/pagination.d.ts +0 -11
- package/dist/core/http/parseFormBody.d.ts +0 -6
- package/dist/core/http/parseMultipartUpload.d.ts +0 -10
- package/dist/core/http/requestMetaContext.d.ts +0 -15
- package/dist/core/http/requireAbilityMiddleware.d.ts +0 -4
- package/dist/core/http/requireAuthMiddleware.d.ts +0 -4
- package/dist/core/http/requireGlobalAdminMiddleware.d.ts +0 -3
- package/dist/core/http/requireWebAuthMiddleware.d.ts +0 -4
- package/dist/core/http/resources.d.ts +0 -7
- package/dist/core/http/route.d.ts +0 -6
- package/dist/core/http/routeMiddleware.d.ts +0 -3
- package/dist/core/http/routeModelBinding.d.ts +0 -3
- package/dist/core/http/scimThrottleMiddleware.d.ts +0 -9
- package/dist/core/http/securedRouteModelBinding.d.ts +0 -11
- package/dist/core/http/securityHeadersMiddleware.d.ts +0 -3
- package/dist/core/http/throttleMiddleware.d.ts +0 -11
- package/dist/core/http/validation.d.ts +0 -23
- package/dist/core/http/webErrorResponse.d.ts +0 -5
- package/dist/core/http/webFormRequest.d.ts +0 -7
- package/dist/core/jobs/dispatchWebhookJob.d.ts +0 -13
- package/dist/core/jobs/invalidateCacheTagsJob.d.ts +0 -12
- package/dist/core/lifecycle/gracefulShutdown.d.ts +0 -6
- package/dist/core/logging/logger.d.ts +0 -17
- package/dist/core/logging/requestLoggingMiddleware.d.ts +0 -3
- package/dist/core/mail/mailer.d.ts +0 -38
- package/dist/core/mail/markdownMail.d.ts +0 -15
- package/dist/core/mail/markdownMailable.d.ts +0 -12
- package/dist/core/metrics/prometheus.d.ts +0 -26
- package/dist/core/notifications/dispatcher.d.ts +0 -13
- package/dist/core/notifications/index.d.ts +0 -3
- package/dist/core/notifications/notification.d.ts +0 -7
- package/dist/core/notifications/types.d.ts +0 -25
- package/dist/core/openapi/registeredRoute.d.ts +0 -6
- package/dist/core/pagination/index.d.ts +0 -27
- package/dist/core/queue/createAppQueue.d.ts +0 -5
- package/dist/core/queue/failedJobRepository.d.ts +0 -6
- package/dist/core/queue/failedJobService.d.ts +0 -16
- package/dist/core/queue/failedJobTable.d.ts +0 -3
- package/dist/core/queue/index.d.ts +0 -19
- package/dist/core/queue/jobRegistry.d.ts +0 -13
- package/dist/core/queue/jobRunner.d.ts +0 -9
- package/dist/core/queue/publicQueue.d.ts +0 -16
- package/dist/core/queue/queueMetrics.d.ts +0 -15
- package/dist/core/queue/redisQueue.d.ts +0 -29
- package/dist/core/queue/resilientQueue.d.ts +0 -9
- package/dist/core/queue/types.d.ts +0 -8
- package/dist/core/runtime/applicationRegistry.d.ts +0 -17
- package/dist/core/runtime/asyncContextStore.d.ts +0 -3
- package/dist/core/scheduler/schedule.d.ts +0 -15
- package/dist/core/security/publicReads.d.ts +0 -3
- package/dist/core/security/safeFetch.d.ts +0 -10
- package/dist/core/security/safeUrl.d.ts +0 -20
- package/dist/core/security/scimTenantTokens.d.ts +0 -3
- package/dist/core/security/securityEvents.d.ts +0 -6
- package/dist/core/security/timingSafeCompare.d.ts +0 -2
- package/dist/core/security/tokenExpiry.d.ts +0 -2
- package/dist/core/security/totp.d.ts +0 -3
- package/dist/core/storage/storage.d.ts +0 -44
- package/dist/core/tenant/databaseTenantContext.d.ts +0 -2
- package/dist/core/tenant/resolveTenant.d.ts +0 -3
- package/dist/core/tenant/tenantContext.d.ts +0 -13
- package/dist/core/tenant/tenantDatabaseScope.d.ts +0 -8
- package/dist/core/tenant/tenantMiddleware.d.ts +0 -6
- package/dist/core/tracing/otel.d.ts +0 -26
- package/dist/core/tracing/traceContext.d.ts +0 -9
- package/dist/core/tracing/tracingMiddleware.d.ts +0 -3
- package/dist/core/validation/rules.d.ts +0 -17
- package/dist/core/view/etaViewEngine.d.ts +0 -15
- package/dist/core/view/htmlResponse.d.ts +0 -6
- package/dist/core/view/index.d.ts +0 -5
- package/dist/core/view/viewEngine.d.ts +0 -6
- package/dist/core/view/webLayoutData.d.ts +0 -17
- package/dist/db/connection/createConnection.d.ts +0 -6
- package/dist/db/connection/index.d.ts +0 -11
- package/dist/domain/abilities.d.ts +0 -5
- package/dist/domain/auth.d.ts +0 -4
- package/dist/domain/scim.d.ts +0 -9
- package/dist/domain/workhub.d.ts +0 -35
- package/dist/framework/public-api.d.ts +0 -116
- package/dist/modules/organization/memberRepository.d.ts +0 -14
- package/dist/modules/organization/memberTypes.d.ts +0 -9
- package/dist/modules/organization/repository.d.ts +0 -14
- package/dist/modules/organization/table.d.ts +0 -3
- package/dist/modules/organization/types.d.ts +0 -10
- package/dist/modules/scim/controller.d.ts +0 -16
- package/dist/modules/scim/scimResponse.d.ts +0 -10
- package/dist/modules/scim/service.d.ts +0 -214
- package/dist/modules/user/apiTokenRepository.d.ts +0 -8
- package/dist/modules/user/apiTokenTable.d.ts +0 -3
- package/dist/modules/user/authService.d.ts +0 -23
- package/dist/modules/user/notificationRepository.d.ts +0 -6
- package/dist/modules/user/notificationService.d.ts +0 -25
- package/dist/modules/user/notificationTable.d.ts +0 -3
- package/dist/modules/user/notificationTypes.d.ts +0 -12
- package/dist/modules/user/oauthIdentityRepository.d.ts +0 -9
- package/dist/modules/user/provider.d.ts +0 -11
- package/dist/modules/user/repository.d.ts +0 -13
- package/dist/modules/user/table.d.ts +0 -3
- package/dist/modules/user/tokenService.d.ts +0 -29
- package/dist/modules/user/types.d.ts +0 -46
- package/dist/types/services.d.ts +0 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getstrata/bootstrap",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.25",
|
|
4
4
|
"description": "Strata application bootstrap — HttpKernel, DI, web session helpers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,6 +20,16 @@
|
|
|
20
20
|
"import": "./dist/entries/applicationRegistry.js",
|
|
21
21
|
"default": "./dist/entries/applicationRegistry.js"
|
|
22
22
|
},
|
|
23
|
+
"./buildModuleRoutes": {
|
|
24
|
+
"types": "./dist/bootstrap/buildModuleRoutes.d.ts",
|
|
25
|
+
"import": "./dist/entries/buildModuleRoutes.js",
|
|
26
|
+
"default": "./dist/entries/buildModuleRoutes.js"
|
|
27
|
+
},
|
|
28
|
+
"./buildWebModuleRoutes": {
|
|
29
|
+
"types": "./dist/bootstrap/buildWebModuleRoutes.d.ts",
|
|
30
|
+
"import": "./dist/entries/buildWebModuleRoutes.js",
|
|
31
|
+
"default": "./dist/entries/buildWebModuleRoutes.js"
|
|
32
|
+
},
|
|
23
33
|
"./cache/modelCacheTags": {
|
|
24
34
|
"types": "./dist/bootstrap/cache/modelCacheTags.d.ts",
|
|
25
35
|
"import": "./dist/entries/cache/modelCacheTags.js",
|
|
@@ -130,16 +140,16 @@
|
|
|
130
140
|
"scripts": {
|
|
131
141
|
"build": "bun run build:bundle && bun run build:shims && bun run build:subpaths && bun run build:types",
|
|
132
142
|
"build:bundle": "bun build index.ts --outdir dist --target bun --external bun --external eta --external @getstrata/core",
|
|
133
|
-
"build:types": "tsc -p tsconfig.types.json",
|
|
143
|
+
"build:types": "tsc -p tsconfig.types.json && bun ../../scripts/prune-bootstrap-dist-types.ts",
|
|
134
144
|
"prepublishOnly": "bun run build",
|
|
135
|
-
"build:subpaths": "bun build entries/applicationRegistry.ts entries/cache/modelCacheTags.ts entries/config.ts entries/context.ts entries/contracts.ts entries/createWebRoutes.ts entries/dependencies.ts entries/discoverModules.ts entries/http/securedRouteModelBinding.ts entries/httpKernel.ts entries/membershipService.ts entries/queue/defaultJobs.ts entries/providers.ts entries/providers/view.ts entries/routeRegistry.ts entries/secretsGuard.ts entries/web/forms.ts entries/web/routing.ts entries/web/server.ts entries/web/session.ts entries/web/slug.ts --outdir dist --root . --target bun --external bun --external eta --external @getstrata/core",
|
|
145
|
+
"build:subpaths": "bun build entries/applicationRegistry.ts entries/buildModuleRoutes.ts entries/buildWebModuleRoutes.ts entries/cache/modelCacheTags.ts entries/config.ts entries/context.ts entries/contracts.ts entries/createWebRoutes.ts entries/dependencies.ts entries/discoverModules.ts entries/http/securedRouteModelBinding.ts entries/httpKernel.ts entries/membershipService.ts entries/queue/defaultJobs.ts entries/providers.ts entries/providers/view.ts entries/routeRegistry.ts entries/secretsGuard.ts entries/web/forms.ts entries/web/routing.ts entries/web/server.ts entries/web/session.ts entries/web/slug.ts --outdir dist --root . --target bun --external bun --external eta --external @getstrata/core",
|
|
136
146
|
"build:shims": "true"
|
|
137
147
|
},
|
|
138
148
|
"publishConfig": {
|
|
139
149
|
"access": "public"
|
|
140
150
|
},
|
|
141
151
|
"peerDependencies": {
|
|
142
|
-
"@getstrata/core": "^0.5.
|
|
152
|
+
"@getstrata/core": "^0.5.33",
|
|
143
153
|
"typescript": "^5.9.0"
|
|
144
154
|
}
|
|
145
155
|
}
|
package/dist/config/app.d.ts
DELETED
package/dist/config/auth.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
declare function strictApiContentSecurityPolicy(): string;
|
|
2
|
-
declare function serverHtmxContentSecurityPolicy(): string;
|
|
3
|
-
declare function spaContentSecurityPolicy(): string;
|
|
4
|
-
declare function resolveContentSecurityPolicy(response: Response): string;
|
|
5
|
-
export { resolveContentSecurityPolicy, serverHtmxContentSecurityPolicy, spaContentSecurityPolicy, strictApiContentSecurityPolicy, };
|
package/dist/config/cors.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface DatabaseConfig {
|
|
2
|
-
url: string;
|
|
3
|
-
poolMax: number;
|
|
4
|
-
idleTimeoutSeconds: number;
|
|
5
|
-
maxLifetimeSeconds: number;
|
|
6
|
-
connectionTimeoutSeconds: number;
|
|
7
|
-
}
|
|
8
|
-
declare const databaseConfig: DatabaseConfig;
|
|
9
|
-
export type { DatabaseConfig };
|
|
10
|
-
export { databaseConfig };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
interface FeatureFlags {
|
|
2
|
-
webhooks: boolean;
|
|
3
|
-
fullTextSearch: boolean;
|
|
4
|
-
auditLog: boolean;
|
|
5
|
-
oauthLogin: boolean;
|
|
6
|
-
samlLogin: boolean;
|
|
7
|
-
scim: boolean;
|
|
8
|
-
billing: boolean;
|
|
9
|
-
siemExport: boolean;
|
|
10
|
-
publicReads: boolean;
|
|
11
|
-
emailVerification: boolean;
|
|
12
|
-
mfa: boolean;
|
|
13
|
-
}
|
|
14
|
-
declare function readFeatureFlags(): FeatureFlags;
|
|
15
|
-
declare const featureFlags: FeatureFlags;
|
|
16
|
-
declare function isFeatureEnabled(feature: keyof FeatureFlags): boolean;
|
|
17
|
-
export type { FeatureFlags };
|
|
18
|
-
export { featureFlags, isFeatureEnabled, readFeatureFlags };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
type FrontendMode = "api" | "server-htmx" | "spa-react";
|
|
2
|
-
declare function readFrontendMode(): FrontendMode;
|
|
3
|
-
declare function isViewsEnabled(): boolean;
|
|
4
|
-
declare function isSpaEnabled(): boolean;
|
|
5
|
-
export type { FrontendMode };
|
|
6
|
-
export { isSpaEnabled, isViewsEnabled, readFrontendMode };
|
package/dist/config/queue.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface LoginRateLimitConfig {
|
|
2
|
-
maxAttempts: number;
|
|
3
|
-
decaySeconds: number;
|
|
4
|
-
}
|
|
5
|
-
declare const LOCAL_LOGIN_RATE_LIMIT: LoginRateLimitConfig;
|
|
6
|
-
declare const PRODUCTION_LOGIN_RATE_LIMIT: LoginRateLimitConfig;
|
|
7
|
-
declare function resolveLoginRateLimit(): LoginRateLimitConfig;
|
|
8
|
-
declare function resolveRegisterRateLimit(): LoginRateLimitConfig;
|
|
9
|
-
export type { LoginRateLimitConfig };
|
|
10
|
-
export { LOCAL_LOGIN_RATE_LIMIT, PRODUCTION_LOGIN_RATE_LIMIT, resolveLoginRateLimit, resolveRegisterRateLimit, };
|
package/dist/config/uploads.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
declare const DEFAULT_MAX_UPLOAD_BYTES: number;
|
|
2
|
-
declare const ALLOWED_UPLOAD_MIME_TYPES: Set<string>;
|
|
3
|
-
declare function resolveMaxUploadBytes(): number;
|
|
4
|
-
declare function isAllowedMimeType(mimeType: string): boolean;
|
|
5
|
-
export { ALLOWED_UPLOAD_MIME_TYPES, DEFAULT_MAX_UPLOAD_BYTES, isAllowedMimeType, resolveMaxUploadBytes, };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { AdminResource, AdminResourceDefinition } from "./types.ts";
|
|
2
|
-
declare class AdminResourceRegistry {
|
|
3
|
-
private readonly resources;
|
|
4
|
-
constructor();
|
|
5
|
-
register<TEntity extends object>(resource: AdminResource<TEntity>): void;
|
|
6
|
-
get(name: string): AdminResource<object> | undefined;
|
|
7
|
-
list(): AdminResourceDefinition[];
|
|
8
|
-
all(): AdminResource<object>[];
|
|
9
|
-
clear(): void;
|
|
10
|
-
}
|
|
11
|
-
export { AdminResourceRegistry };
|
|
@@ -1,24 +0,0 @@
|
|
|
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,8 +0,0 @@
|
|
|
1
|
-
interface AuditExportConfig {
|
|
2
|
-
endpoint: string;
|
|
3
|
-
format: "json" | "cef";
|
|
4
|
-
batchSize: number;
|
|
5
|
-
}
|
|
6
|
-
declare function resolveAuditExportConfig(): AuditExportConfig | null;
|
|
7
|
-
declare function exportPendingAuditLogs(): Promise<number>;
|
|
8
|
-
export { exportPendingAuditLogs, resolveAuditExportConfig };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
interface SiemAuditEvent {
|
|
2
|
-
timestamp: string;
|
|
3
|
-
event_type: string;
|
|
4
|
-
actor_user_id: number | null;
|
|
5
|
-
tenant_id: number | null;
|
|
6
|
-
trace_id: string | null;
|
|
7
|
-
action: string;
|
|
8
|
-
subject_type: string;
|
|
9
|
-
subject_id: number | null;
|
|
10
|
-
ip_address: string | null;
|
|
11
|
-
user_agent: string | null;
|
|
12
|
-
checksum: string | null;
|
|
13
|
-
payload: Record<string, unknown>;
|
|
14
|
-
}
|
|
15
|
-
declare function formatSiemAuditEvent(input: {
|
|
16
|
-
action: string;
|
|
17
|
-
subject_type: string;
|
|
18
|
-
subject_id: number | null;
|
|
19
|
-
user_id: number | null;
|
|
20
|
-
tenant_id?: number | null;
|
|
21
|
-
trace_id?: string | null;
|
|
22
|
-
ip_address?: string | null;
|
|
23
|
-
user_agent?: string | null;
|
|
24
|
-
checksum?: string | null;
|
|
25
|
-
payload?: Record<string, unknown>;
|
|
26
|
-
created_at: Date;
|
|
27
|
-
}): SiemAuditEvent;
|
|
28
|
-
declare function formatCefLine(event: SiemAuditEvent): string;
|
|
29
|
-
export type { SiemAuditEvent };
|
|
30
|
-
export { formatCefLine, formatSiemAuditEvent };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { OrganizationMemberRole } from "../../modules/organization/memberTypes";
|
|
2
|
-
import { type AuthUser } from "./authContext";
|
|
3
|
-
declare const ROLE_RANK: Record<OrganizationMemberRole, number>;
|
|
4
|
-
declare function isGlobalAdmin(user: AuthUser | null): boolean;
|
|
5
|
-
declare function hasMinimumOrgRole(role: OrganizationMemberRole | null | undefined, minimum: OrganizationMemberRole): boolean;
|
|
6
|
-
declare function requireAuthenticatedUser(): AuthUser;
|
|
7
|
-
declare function resolveUserId(user: AuthUser): number;
|
|
8
|
-
export { hasMinimumOrgRole, isGlobalAdmin, ROLE_RANK, requireAuthenticatedUser, resolveUserId };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
type AuthUser = {
|
|
2
|
-
id: number | string;
|
|
3
|
-
role?: string;
|
|
4
|
-
abilities?: string[];
|
|
5
|
-
tokenId?: number;
|
|
6
|
-
};
|
|
7
|
-
declare const authContext: import("node:async_hooks").AsyncLocalStorage<AuthUser | null>;
|
|
8
|
-
declare function runWithAuthUser<T>(user: AuthUser | null, callback: () => T | Promise<T>): T | Promise<T>;
|
|
9
|
-
declare function currentAuthUser(): AuthUser | null;
|
|
10
|
-
export type { AuthUser };
|
|
11
|
-
export { authContext, currentAuthUser, runWithAuthUser };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { ServiceContainerLike } from "../contracts/serviceContainer";
|
|
2
|
-
import type { AuthUser } from "./authContext";
|
|
3
|
-
interface AuthGuard {
|
|
4
|
-
resolve(request: Request): AuthUser | null | Promise<AuthUser | null>;
|
|
5
|
-
}
|
|
6
|
-
declare class GuestGuard implements AuthGuard {
|
|
7
|
-
resolve(request: Request): AuthUser | null;
|
|
8
|
-
}
|
|
9
|
-
declare class ApiTokenGuard implements AuthGuard {
|
|
10
|
-
private readonly options;
|
|
11
|
-
constructor(options: {
|
|
12
|
-
token: string;
|
|
13
|
-
user: AuthUser;
|
|
14
|
-
});
|
|
15
|
-
resolve(request: Request): AuthUser | null;
|
|
16
|
-
}
|
|
17
|
-
declare class DatabaseTokenGuard implements AuthGuard {
|
|
18
|
-
private readonly container;
|
|
19
|
-
constructor(container: ServiceContainerLike);
|
|
20
|
-
resolve(request: Request): Promise<AuthUser | null>;
|
|
21
|
-
}
|
|
22
|
-
declare class CompositeGuard implements AuthGuard {
|
|
23
|
-
private readonly guards;
|
|
24
|
-
constructor(guards: AuthGuard[]);
|
|
25
|
-
resolve(request: Request): Promise<AuthUser | null>;
|
|
26
|
-
}
|
|
27
|
-
declare class AuthManager {
|
|
28
|
-
private readonly guard;
|
|
29
|
-
constructor(guard: AuthGuard);
|
|
30
|
-
resolve(request?: Request): Promise<AuthUser | null>;
|
|
31
|
-
user(request?: Request): Promise<AuthUser | null>;
|
|
32
|
-
check(request?: Request): Promise<boolean>;
|
|
33
|
-
requireUser(request?: Request): Promise<AuthUser>;
|
|
34
|
-
}
|
|
35
|
-
export type { AuthGuard, AuthUser };
|
|
36
|
-
export { ApiTokenGuard, AuthManager, CompositeGuard, DatabaseTokenGuard, GuestGuard };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import OrganizationMemberRepository from "../../modules/organization/memberRepository";
|
|
2
|
-
import type { OrganizationMemberRole } from "../../modules/organization/memberTypes";
|
|
3
|
-
type MembershipContext = {
|
|
4
|
-
organizationIds: number[];
|
|
5
|
-
rolesByOrganizationId: Map<number, OrganizationMemberRole>;
|
|
6
|
-
};
|
|
7
|
-
declare const membershipContext: import("node:async_hooks").AsyncLocalStorage<MembershipContext>;
|
|
8
|
-
declare const membershipRepository: OrganizationMemberRepository;
|
|
9
|
-
declare function runWithMembershipContext<T>(callback: () => T | Promise<T>): Promise<T | Promise<T>>;
|
|
10
|
-
declare function currentOrgRole(organizationId: number): OrganizationMemberRole | null;
|
|
11
|
-
declare function hasOrgMembership(organizationId: number): boolean;
|
|
12
|
-
declare function currentOrganizationIds(): number[];
|
|
13
|
-
declare function hasMinimumOrgRole(organizationId: number, minimum: OrganizationMemberRole): boolean;
|
|
14
|
-
export type { MembershipContext };
|
|
15
|
-
export { currentOrganizationIds, currentOrgRole, hasMinimumOrgRole, hasOrgMembership, membershipContext, membershipRepository, runWithMembershipContext, };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
declare function resolveOrganizationScope(): number[] | null;
|
|
2
|
-
declare function scopedOrganizationIds(requestedOrganizationId?: number): number[] | null;
|
|
3
|
-
declare function appendOrganizationScope<T extends object>(where: T, requestedOrganizationId?: number): T;
|
|
4
|
-
declare function appendProjectScope<T extends object>(where: T, accessibleProjectIds: number[] | null, requestedProjectId?: number): T;
|
|
5
|
-
declare function emptyPaginateResult<T>(page: number, perPage: number): {
|
|
6
|
-
data: T[];
|
|
7
|
-
meta: {
|
|
8
|
-
page: number;
|
|
9
|
-
per_page: number;
|
|
10
|
-
total: number;
|
|
11
|
-
last_page: number;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
declare function assertResourceInCurrentTenant(resourceTenantId: number, resourceLabel: string, resourceId: number): void;
|
|
15
|
-
declare function assertOrganizationReadable(organizationId: number): void;
|
|
16
|
-
export { appendOrganizationScope, appendProjectScope, assertOrganizationReadable, assertResourceInCurrentTenant, emptyPaginateResult, resolveOrganizationScope, scopedOrganizationIds, };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { OrganizationMemberRole } from "../../modules/organization/memberTypes";
|
|
2
|
-
import { type AuthUser } from "./authContext";
|
|
3
|
-
import { membershipRepository as defaultMembershipRepository } from "./membershipContext";
|
|
4
|
-
type MembershipRepositoryLike = Pick<typeof defaultMembershipRepository, "listForUser" | "findMembership" | "listForOrganization" | "addMember" | "removeMember">;
|
|
5
|
-
declare class MembershipService {
|
|
6
|
-
private readonly members;
|
|
7
|
-
constructor(members?: MembershipRepositoryLike);
|
|
8
|
-
listOrganizationIdsForUser(userId: number): Promise<number[]>;
|
|
9
|
-
getOrgRole(userId: number, organizationId: number): Promise<OrganizationMemberRole | null>;
|
|
10
|
-
requireOrgAccess(organizationId: number, minimumRole?: OrganizationMemberRole, user?: AuthUser | null): Promise<OrganizationMemberRole>;
|
|
11
|
-
filterAccessibleOrganizationIds(organizationIds: number[], user?: AuthUser | null): Promise<number[]>;
|
|
12
|
-
addOwnerOnOrganizationCreate(organizationId: number, userId: number): Promise<void>;
|
|
13
|
-
listMembersForOrganization(organizationId: number): Promise<import("../../modules/organization/memberTypes").OrganizationMemberRecord[]>;
|
|
14
|
-
addMember(input: {
|
|
15
|
-
organizationId: number;
|
|
16
|
-
userId: number;
|
|
17
|
-
role?: OrganizationMemberRole;
|
|
18
|
-
}): Promise<import("../../modules/organization/memberTypes").OrganizationMemberRecord>;
|
|
19
|
-
removeMember(organizationId: number, userId: number): Promise<boolean>;
|
|
20
|
-
}
|
|
21
|
-
export type { MembershipRepositoryLike };
|
|
22
|
-
export default MembershipService;
|
|
23
|
-
export { resolveMembershipService } from "./resolveMembershipService.ts";
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { OAuthProfile, OAuthProvider } from "./types";
|
|
2
|
-
interface OidcProviderOptions {
|
|
3
|
-
name: string;
|
|
4
|
-
issuer: string;
|
|
5
|
-
clientId: string;
|
|
6
|
-
clientSecret: string;
|
|
7
|
-
redirectUri: string;
|
|
8
|
-
scopes?: string[];
|
|
9
|
-
}
|
|
10
|
-
declare class OidcProvider implements OAuthProvider {
|
|
11
|
-
private readonly options;
|
|
12
|
-
readonly name: string;
|
|
13
|
-
constructor(options: OidcProviderOptions);
|
|
14
|
-
getAuthorizationUrl(state: string): string;
|
|
15
|
-
exchangeCode(code: string): Promise<OAuthProfile>;
|
|
16
|
-
}
|
|
17
|
-
export type { OidcProviderOptions };
|
|
18
|
-
export { OidcProvider };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { OAuthProfile, OAuthProvider } from "./types";
|
|
2
|
-
interface GitHubOAuthOptions {
|
|
3
|
-
clientId: string;
|
|
4
|
-
clientSecret: string;
|
|
5
|
-
redirectUri: string;
|
|
6
|
-
}
|
|
7
|
-
declare class GitHubOAuthProvider implements OAuthProvider {
|
|
8
|
-
private readonly options;
|
|
9
|
-
readonly name = "github";
|
|
10
|
-
constructor(options: GitHubOAuthOptions);
|
|
11
|
-
getAuthorizationUrl(state: string): string;
|
|
12
|
-
exchangeCode(code: string): Promise<OAuthProfile>;
|
|
13
|
-
}
|
|
14
|
-
declare class MockOAuthProvider implements OAuthProvider {
|
|
15
|
-
private readonly profile;
|
|
16
|
-
readonly name = "mock";
|
|
17
|
-
constructor(profile: OAuthProfile);
|
|
18
|
-
getAuthorizationUrl(state: string): string;
|
|
19
|
-
exchangeCode(code: string): Promise<OAuthProfile>;
|
|
20
|
-
}
|
|
21
|
-
export type { GitHubOAuthOptions };
|
|
22
|
-
export { GitHubOAuthProvider, MockOAuthProvider };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { OAuthProfile, OAuthProvider } from "./types";
|
|
2
|
-
declare class SamlProvider implements OAuthProvider {
|
|
3
|
-
private readonly loginUrl;
|
|
4
|
-
readonly name = "saml";
|
|
5
|
-
constructor(loginUrl: string);
|
|
6
|
-
getAuthorizationUrl(state: string): string;
|
|
7
|
-
exchangeCode(code: string): Promise<OAuthProfile>;
|
|
8
|
-
}
|
|
9
|
-
export { SamlProvider };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
interface OAuthProfile {
|
|
2
|
-
providerUserId: string;
|
|
3
|
-
email: string;
|
|
4
|
-
name: string;
|
|
5
|
-
}
|
|
6
|
-
interface OAuthProvider {
|
|
7
|
-
readonly name: string;
|
|
8
|
-
getAuthorizationUrl(state: string): string;
|
|
9
|
-
exchangeCode(code: string): Promise<OAuthProfile>;
|
|
10
|
-
}
|
|
11
|
-
export type { OAuthProfile, OAuthProvider };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
declare abstract class Policy {
|
|
2
|
-
constructor();
|
|
3
|
-
view(_user?: unknown, _resource?: unknown): boolean;
|
|
4
|
-
create(_user?: unknown): boolean;
|
|
5
|
-
update(_user?: unknown, _resource?: unknown): boolean;
|
|
6
|
-
delete(_user?: unknown, _resource?: unknown): boolean;
|
|
7
|
-
}
|
|
8
|
-
declare class PolicyGate {
|
|
9
|
-
constructor();
|
|
10
|
-
private readonly policies;
|
|
11
|
-
register(resource: string, policy: Policy): void;
|
|
12
|
-
allows(resource: string, action: string, user?: unknown, model?: unknown): boolean;
|
|
13
|
-
authorize(resource: string, action: string, user?: unknown, model?: unknown): void;
|
|
14
|
-
}
|
|
15
|
-
export { Policy, PolicyGate };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
declare const SESSION_COOKIE = "workhub_session";
|
|
2
|
-
declare const SESSION_TTL_SECONDS: number;
|
|
3
|
-
declare function readSessionUserId(request: Request): number | null;
|
|
4
|
-
declare function createSessionCookie(userId: number): string;
|
|
5
|
-
declare function clearSessionCookie(): string;
|
|
6
|
-
export { clearSessionCookie, createSessionCookie, readSessionUserId, SESSION_COOKIE, SESSION_TTL_SECONDS, };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ServiceContainerLike } from "../contracts/serviceContainer";
|
|
2
|
-
import type { AuthUser } from "./authContext";
|
|
3
|
-
import type { AuthGuard } from "./guard";
|
|
4
|
-
declare class SessionGuard implements AuthGuard {
|
|
5
|
-
private readonly container;
|
|
6
|
-
constructor(container: ServiceContainerLike);
|
|
7
|
-
resolve(request: Request): Promise<AuthUser | null>;
|
|
8
|
-
}
|
|
9
|
-
export { SessionGuard };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { CacheStore } from "./store";
|
|
2
|
-
type CacheDriver = "array" | "redis";
|
|
3
|
-
interface CreateCacheStoreOptions {
|
|
4
|
-
driver: CacheDriver;
|
|
5
|
-
ttlMs: number;
|
|
6
|
-
maxEntries: number;
|
|
7
|
-
redisUrl?: string;
|
|
8
|
-
}
|
|
9
|
-
declare function createCacheStore(options: CreateCacheStoreOptions): CacheStore;
|
|
10
|
-
export type { CacheDriver, CreateCacheStoreOptions };
|
|
11
|
-
export { createCacheStore };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { CacheStore } from "./store";
|
|
2
|
-
declare class RedisCacheStore implements CacheStore {
|
|
3
|
-
private readonly ttlMs;
|
|
4
|
-
private readonly maxEntries;
|
|
5
|
-
private readonly client;
|
|
6
|
-
private readonly inflight;
|
|
7
|
-
private readonly keyTags;
|
|
8
|
-
constructor(redisUrl: string, ttlMs: number, maxEntries: number);
|
|
9
|
-
get<T>(key: string): Promise<T | undefined>;
|
|
10
|
-
set<T>(key: string, value: T, ttlMs?: number): Promise<void>;
|
|
11
|
-
getOrSet<T>(key: string, loader: () => Promise<T>, ttlMs?: number): Promise<T>;
|
|
12
|
-
attachTags(key: string, tags: string[]): Promise<void>;
|
|
13
|
-
flushTags(tags: string[]): Promise<number>;
|
|
14
|
-
invalidate(key: string): Promise<boolean>;
|
|
15
|
-
invalidateByPrefix(prefix: string): Promise<number>;
|
|
16
|
-
clear(): Promise<void>;
|
|
17
|
-
size(): Promise<number>;
|
|
18
|
-
private storageKey;
|
|
19
|
-
private tagKey;
|
|
20
|
-
private detachKeyFromTags;
|
|
21
|
-
private enforceMaxEntries;
|
|
22
|
-
}
|
|
23
|
-
export default RedisCacheStore;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { CacheStore } from "./store";
|
|
2
|
-
import TaggedCache from "./taggedCache";
|
|
3
|
-
declare class CacheRepository {
|
|
4
|
-
private readonly store;
|
|
5
|
-
constructor(store: CacheStore);
|
|
6
|
-
get<T>(key: string): Promise<T | undefined>;
|
|
7
|
-
remember<T>(key: string, callback: () => Promise<T>, ttlMs?: number): Promise<T>;
|
|
8
|
-
forget(key: string): Promise<boolean>;
|
|
9
|
-
flush(): Promise<void>;
|
|
10
|
-
tags(...names: string[]): TaggedCache;
|
|
11
|
-
getOrSet<T>(key: string, loader: () => Promise<T>, ttlMs?: number): Promise<T>;
|
|
12
|
-
invalidate(key: string): Promise<boolean>;
|
|
13
|
-
invalidateByPrefix(prefix: string): Promise<number>;
|
|
14
|
-
clear(): Promise<void>;
|
|
15
|
-
size(): Promise<number>;
|
|
16
|
-
}
|
|
17
|
-
export default CacheRepository;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
declare class SimpleCache {
|
|
2
|
-
private readonly ttlMs;
|
|
3
|
-
private readonly maxEntries;
|
|
4
|
-
private readonly cache;
|
|
5
|
-
private readonly inflight;
|
|
6
|
-
private readonly tagIndex;
|
|
7
|
-
private readonly keyTags;
|
|
8
|
-
constructor(ttlMs?: number, maxEntries?: number);
|
|
9
|
-
get<T>(key: string): T | undefined;
|
|
10
|
-
set<T>(key: string, value: T, ttlMs?: number): void;
|
|
11
|
-
getOrSet<T>(key: string, loader: () => Promise<T>, ttlMs?: number): Promise<T>;
|
|
12
|
-
attachTags(key: string, tags: string[]): void;
|
|
13
|
-
flushTags(tags: string[]): number;
|
|
14
|
-
invalidate(key: string): boolean;
|
|
15
|
-
invalidateByPrefix(prefix: string): number;
|
|
16
|
-
clear(): void;
|
|
17
|
-
size(): number;
|
|
18
|
-
private detachKeyFromTags;
|
|
19
|
-
private getFreshEntry;
|
|
20
|
-
private pruneExpired;
|
|
21
|
-
private evictOverflow;
|
|
22
|
-
}
|
|
23
|
-
export default SimpleCache;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type SimpleCache from "./simpleCache";
|
|
2
|
-
import type { CacheStore } from "./store";
|
|
3
|
-
declare class SimpleCacheStore implements CacheStore {
|
|
4
|
-
private readonly cache;
|
|
5
|
-
constructor(cache: SimpleCache);
|
|
6
|
-
get<T>(key: string): Promise<T | undefined>;
|
|
7
|
-
set<T>(key: string, value: T, ttlMs?: number): Promise<void>;
|
|
8
|
-
getOrSet<T>(key: string, loader: () => Promise<T>, ttlMs?: number): Promise<T>;
|
|
9
|
-
attachTags(key: string, tags: string[]): Promise<void>;
|
|
10
|
-
flushTags(tags: string[]): Promise<number>;
|
|
11
|
-
invalidate(key: string): Promise<boolean>;
|
|
12
|
-
invalidateByPrefix(prefix: string): Promise<number>;
|
|
13
|
-
clear(): Promise<void>;
|
|
14
|
-
size(): Promise<number>;
|
|
15
|
-
}
|
|
16
|
-
export default SimpleCacheStore;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
interface CacheStore {
|
|
2
|
-
get<T>(key: string): Promise<T | undefined>;
|
|
3
|
-
set<T>(key: string, value: T, ttlMs?: number): Promise<void>;
|
|
4
|
-
getOrSet<T>(key: string, loader: () => Promise<T>, ttlMs?: number): Promise<T>;
|
|
5
|
-
attachTags(key: string, tags: string[]): Promise<void>;
|
|
6
|
-
flushTags(tags: string[]): Promise<number>;
|
|
7
|
-
invalidate(key: string): Promise<boolean>;
|
|
8
|
-
invalidateByPrefix(prefix: string): Promise<number>;
|
|
9
|
-
clear(): Promise<void>;
|
|
10
|
-
size(): Promise<number>;
|
|
11
|
-
}
|
|
12
|
-
export type { CacheStore };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { CacheStore } from "./store";
|
|
2
|
-
declare class TaggedCache {
|
|
3
|
-
private readonly store;
|
|
4
|
-
private readonly tags;
|
|
5
|
-
constructor(store: CacheStore, tags: string[]);
|
|
6
|
-
remember<T>(key: string, callback: () => Promise<T>, ttlMs?: number): Promise<T>;
|
|
7
|
-
flush(): Promise<number>;
|
|
8
|
-
}
|
|
9
|
-
export default TaggedCache;
|