@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
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
declare function serializeDate(value: Date | string): string;
|
|
2
|
-
declare function toResourceCollection<TInput, TOutput>(items: readonly TInput[], transformer: (item: TInput) => TOutput): TOutput[];
|
|
3
|
-
declare function toPaginatedResourceCollection<TInput, TOutput, TMeta extends object>(items: readonly TInput[], meta: TMeta, transformer: (item: TInput) => TOutput): {
|
|
4
|
-
data: TOutput[];
|
|
5
|
-
meta: TMeta;
|
|
6
|
-
};
|
|
7
|
-
export { serializeDate, toPaginatedResourceCollection, toResourceCollection };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
type RouteRequest<TParams extends Record<string, string>> = Request & {
|
|
2
|
-
params: TParams;
|
|
3
|
-
};
|
|
4
|
-
declare function getRouteParams<TParams extends Record<string, string>>(request: RouteRequest<TParams>): TParams;
|
|
5
|
-
export type { RouteRequest };
|
|
6
|
-
export { getRouteParams };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { RouteRequest } from "./route";
|
|
2
|
-
declare function bindRouteModel<TParams extends Record<string, string>, TModel, TParam extends keyof TParams & string>(param: TParam, resolver: (id: number, request: RouteRequest<TParams>) => Promise<TModel>, handler: (request: RouteRequest<TParams>, model: TModel) => Response | Promise<Response>): (request: RouteRequest<TParams>) => Promise<Response>;
|
|
3
|
-
export { bindRouteModel };
|
|
@@ -1,9 +0,0 @@
|
|
|
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 };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Policy } from "../auth/policy";
|
|
2
|
-
import type { RouteRequest } from "./route";
|
|
3
|
-
interface RouteModelAuthorization {
|
|
4
|
-
resource: string;
|
|
5
|
-
action: keyof Policy;
|
|
6
|
-
requireIfMatch?: boolean;
|
|
7
|
-
}
|
|
8
|
-
declare function securedBindRouteModel<TParams extends Record<string, string>, TModel, TParam extends keyof TParams & string>(param: TParam, resolver: (id: number, request: RouteRequest<TParams>) => Promise<TModel>, authorization: RouteModelAuthorization, handler: (request: RouteRequest<TParams>, model: TModel) => Response | Promise<Response>): (request: RouteRequest<TParams>) => Promise<Response>;
|
|
9
|
-
declare function securedBindRouteModelByKey<TParams extends Record<string, string>, TModel, TParam extends keyof TParams & string>(param: TParam, resolver: (key: string, request: RouteRequest<TParams>) => Promise<TModel>, authorization: RouteModelAuthorization, handler: (request: RouteRequest<TParams>, model: TModel) => Response | Promise<Response>): (request: RouteRequest<TParams>) => Promise<Response>;
|
|
10
|
-
export type { RouteModelAuthorization };
|
|
11
|
-
export { securedBindRouteModel, securedBindRouteModelByKey };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Middleware } from "./middleware";
|
|
2
|
-
interface ThrottleOptions {
|
|
3
|
-
redisUrl: string;
|
|
4
|
-
maxAttempts: number;
|
|
5
|
-
decaySeconds: number;
|
|
6
|
-
keyPrefix?: string;
|
|
7
|
-
}
|
|
8
|
-
declare function resolveThrottleIdentity(request: Request): string;
|
|
9
|
-
declare function createThrottleMiddleware(options: ThrottleOptions): Middleware;
|
|
10
|
-
export type { ThrottleOptions };
|
|
11
|
-
export { createThrottleMiddleware, resolveThrottleIdentity };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
declare function buildRequestCacheKey(fallbackPath: string, request?: Request): string;
|
|
2
|
-
declare function getQueryParams(request?: Request): URLSearchParams;
|
|
3
|
-
declare function parseOptionalPositiveIntQueryParam(params: URLSearchParams, name: string): number | undefined;
|
|
4
|
-
declare function parseOptionalBooleanQueryParam(params: URLSearchParams, name: string): boolean | undefined;
|
|
5
|
-
declare function parseOptionalEnumQueryParam<TValue extends string>(params: URLSearchParams, name: string, allowedValues: readonly TValue[]): TValue | undefined;
|
|
6
|
-
declare function expectObject(value: unknown, label?: string): Record<string, unknown>;
|
|
7
|
-
declare function parseJsonBody<TValue>(request: Request, validator: (payload: unknown) => TValue): Promise<TValue>;
|
|
8
|
-
declare function readRequiredString(payload: Record<string, unknown>, field: string, options?: {
|
|
9
|
-
minLength?: number;
|
|
10
|
-
maxLength?: number;
|
|
11
|
-
pattern?: RegExp;
|
|
12
|
-
}): string;
|
|
13
|
-
declare function readOptionalString(payload: Record<string, unknown>, field: string, options?: {
|
|
14
|
-
minLength?: number;
|
|
15
|
-
maxLength?: number;
|
|
16
|
-
pattern?: RegExp;
|
|
17
|
-
}): string | undefined;
|
|
18
|
-
declare function readRequiredEnum<TValue extends string>(payload: Record<string, unknown>, field: string, allowedValues: readonly TValue[]): TValue;
|
|
19
|
-
declare function readOptionalEnum<TValue extends string>(payload: Record<string, unknown>, field: string, allowedValues: readonly TValue[]): TValue | undefined;
|
|
20
|
-
declare function readRequiredPositiveInt(payload: Record<string, unknown>, field: string): number;
|
|
21
|
-
declare function readOptionalPositiveInt(payload: Record<string, unknown>, field: string): number | undefined;
|
|
22
|
-
declare function parsePositiveIntParam(value: string, name?: string): number;
|
|
23
|
-
export { buildRequestCacheKey, expectObject, getQueryParams, parseJsonBody, parseOptionalBooleanQueryParam, parseOptionalEnumQueryParam, parseOptionalPositiveIntQueryParam, parsePositiveIntParam, readOptionalEnum, readOptionalPositiveInt, readOptionalString, readRequiredEnum, readRequiredPositiveInt, readRequiredString, };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
type FieldErrors = Record<string, string[]>;
|
|
2
|
-
declare function normalizeFieldErrors(details: unknown): FieldErrors;
|
|
3
|
-
declare function webErrorResponse(error: unknown, request?: Request): Response | null;
|
|
4
|
-
export type { FieldErrors };
|
|
5
|
-
export { normalizeFieldErrors, webErrorResponse };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
declare abstract class WebFormRequest<TOutput> {
|
|
2
|
-
authorize(_request: Request): boolean | Promise<boolean>;
|
|
3
|
-
protected abstract parse(payload: unknown): TOutput;
|
|
4
|
-
validatePayload(payload: unknown): TOutput;
|
|
5
|
-
validate(request: Request): Promise<TOutput>;
|
|
6
|
-
}
|
|
7
|
-
export { WebFormRequest };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Job } from "../queue";
|
|
2
|
-
interface DispatchWebhookPayload {
|
|
3
|
-
webhookId: number;
|
|
4
|
-
event: string;
|
|
5
|
-
payload: Record<string, unknown>;
|
|
6
|
-
}
|
|
7
|
-
declare class DispatchWebhookJob extends Job<DispatchWebhookPayload> {
|
|
8
|
-
readonly maxAttempts = 3;
|
|
9
|
-
readonly backoffMs = 2000;
|
|
10
|
-
handle(payload: DispatchWebhookPayload): Promise<void>;
|
|
11
|
-
}
|
|
12
|
-
export default DispatchWebhookJob;
|
|
13
|
-
export type { DispatchWebhookPayload };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { CacheLike } from "../../types/services";
|
|
2
|
-
import { Job } from "../queue";
|
|
3
|
-
interface InvalidateCacheTagsPayload {
|
|
4
|
-
tags: string[];
|
|
5
|
-
}
|
|
6
|
-
declare class InvalidateCacheTagsJob extends Job<InvalidateCacheTagsPayload> {
|
|
7
|
-
private readonly cache;
|
|
8
|
-
constructor(cache: CacheLike);
|
|
9
|
-
handle(payload: InvalidateCacheTagsPayload): Promise<void>;
|
|
10
|
-
}
|
|
11
|
-
export default InvalidateCacheTagsJob;
|
|
12
|
-
export type { InvalidateCacheTagsPayload };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
type ShutdownHandler = () => void | Promise<void>;
|
|
2
|
-
declare function registerShutdownHandler(name: string, handler: ShutdownHandler): () => void;
|
|
3
|
-
declare function runGracefulShutdown(signal: string): Promise<void>;
|
|
4
|
-
declare function installGracefulShutdownSignals(signals?: NodeJS.Signals[]): void;
|
|
5
|
-
declare function resetGracefulShutdownForTests(): void;
|
|
6
|
-
export { installGracefulShutdownSignals, registerShutdownHandler, resetGracefulShutdownForTests, runGracefulShutdown, };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
type LogLevel = "debug" | "info" | "warn" | "error";
|
|
2
|
-
interface LogContext {
|
|
3
|
-
requestId?: string;
|
|
4
|
-
[key: string]: unknown;
|
|
5
|
-
}
|
|
6
|
-
declare class Logger {
|
|
7
|
-
private readonly channel;
|
|
8
|
-
constructor(channel?: string);
|
|
9
|
-
private write;
|
|
10
|
-
debug(message: string, context?: LogContext): void;
|
|
11
|
-
info(message: string, context?: LogContext): void;
|
|
12
|
-
warn(message: string, context?: LogContext): void;
|
|
13
|
-
error(message: string, context?: LogContext): void;
|
|
14
|
-
}
|
|
15
|
-
declare const appLogger: Logger;
|
|
16
|
-
export type { LogContext, LogLevel };
|
|
17
|
-
export { appLogger, Logger };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
interface MailMessage {
|
|
2
|
-
to: string;
|
|
3
|
-
subject: string;
|
|
4
|
-
body: string;
|
|
5
|
-
html?: string;
|
|
6
|
-
}
|
|
7
|
-
interface MailDriver {
|
|
8
|
-
send(message: MailMessage): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
interface SmtpConfig {
|
|
11
|
-
host: string;
|
|
12
|
-
port: number;
|
|
13
|
-
username?: string;
|
|
14
|
-
password?: string;
|
|
15
|
-
from: string;
|
|
16
|
-
secure: boolean;
|
|
17
|
-
}
|
|
18
|
-
type SmtpTransport = (config: SmtpConfig, message: MailMessage) => Promise<void>;
|
|
19
|
-
declare function resolveSmtpConfig(): SmtpConfig;
|
|
20
|
-
declare function buildSmtpPayload(from: string, message: MailMessage): string;
|
|
21
|
-
declare class LogMailDriver implements MailDriver {
|
|
22
|
-
send(message: MailMessage): Promise<void>;
|
|
23
|
-
}
|
|
24
|
-
declare class SmtpMailDriver implements MailDriver {
|
|
25
|
-
private readonly config;
|
|
26
|
-
private readonly transport;
|
|
27
|
-
constructor(config: SmtpConfig, transport?: SmtpTransport);
|
|
28
|
-
send(message: MailMessage): Promise<void>;
|
|
29
|
-
}
|
|
30
|
-
declare class Mailer {
|
|
31
|
-
private readonly driver;
|
|
32
|
-
constructor(driver: MailDriver);
|
|
33
|
-
send(message: MailMessage): Promise<void>;
|
|
34
|
-
}
|
|
35
|
-
declare function createMailDriver(): MailDriver;
|
|
36
|
-
declare function mailer(): Mailer;
|
|
37
|
-
export type { MailDriver, MailMessage, SmtpConfig, SmtpTransport };
|
|
38
|
-
export { buildSmtpPayload, createMailDriver, LogMailDriver, Mailer, mailer, resolveSmtpConfig, SmtpMailDriver, };
|
|
@@ -1,15 +0,0 @@
|
|
|
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 };
|
|
@@ -1,12 +0,0 @@
|
|
|
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 };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
interface MetricLabels {
|
|
2
|
-
method: string;
|
|
3
|
-
path: string;
|
|
4
|
-
status: string;
|
|
5
|
-
}
|
|
6
|
-
declare class PrometheusRegistry {
|
|
7
|
-
private readonly httpRequestsTotal;
|
|
8
|
-
private readonly httpRequestDurationMs;
|
|
9
|
-
incrementHttpRequest(labels: MetricLabels): void;
|
|
10
|
-
observeHttpDuration(labels: MetricLabels, durationMs: number): void;
|
|
11
|
-
renderMetrics(): string;
|
|
12
|
-
resetForTests(): void;
|
|
13
|
-
getHttpRequestSummary(): {
|
|
14
|
-
totalRequests: number;
|
|
15
|
-
byStatus: Record<string, number>;
|
|
16
|
-
topPaths: Array<{
|
|
17
|
-
method: string;
|
|
18
|
-
path: string;
|
|
19
|
-
count: number;
|
|
20
|
-
}>;
|
|
21
|
-
};
|
|
22
|
-
private metricKey;
|
|
23
|
-
}
|
|
24
|
-
declare const prometheusRegistry: PrometheusRegistry;
|
|
25
|
-
export type { MetricLabels };
|
|
26
|
-
export { PrometheusRegistry, prometheusRegistry };
|
|
@@ -1,13 +0,0 @@
|
|
|
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 };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { createNotificationDispatcher, NotificationDispatcher } from "./dispatcher.ts";
|
|
2
|
-
export { Notification } from "./notification.ts";
|
|
3
|
-
export type { DatabaseNotificationPayload, DatabaseNotificationStore, MailNotificationMessage, Notifiable, NotificationChannelName, } from "./types.ts";
|
|
@@ -1,7 +0,0 @@
|
|
|
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 };
|
|
@@ -1,25 +0,0 @@
|
|
|
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, };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
interface PaginationMeta {
|
|
2
|
-
page: number;
|
|
3
|
-
per_page: number;
|
|
4
|
-
total: number;
|
|
5
|
-
last_page: number;
|
|
6
|
-
}
|
|
7
|
-
interface PaginatedResult<T> {
|
|
8
|
-
data: T[];
|
|
9
|
-
meta: PaginationMeta;
|
|
10
|
-
}
|
|
11
|
-
interface CursorPaginationMeta<Cursor = unknown> {
|
|
12
|
-
per_page: number;
|
|
13
|
-
next_cursor: Cursor | null;
|
|
14
|
-
prev_cursor: Cursor | null;
|
|
15
|
-
has_more: boolean;
|
|
16
|
-
}
|
|
17
|
-
interface CursorPaginatedResult<T, Cursor = unknown> {
|
|
18
|
-
data: T[];
|
|
19
|
-
meta: CursorPaginationMeta<Cursor>;
|
|
20
|
-
}
|
|
21
|
-
declare function buildPaginationMeta(input: {
|
|
22
|
-
page: number;
|
|
23
|
-
perPage: number;
|
|
24
|
-
total: number;
|
|
25
|
-
}): PaginationMeta;
|
|
26
|
-
export type { CursorPaginatedResult, CursorPaginationMeta, PaginatedResult, PaginationMeta };
|
|
27
|
-
export { buildPaginationMeta };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Queue } from "./index";
|
|
2
|
-
import { createFailedJobService, createQueueWorker, createTrackedJob, type FailedJobService } from "./publicQueue";
|
|
3
|
-
declare const FAILED_JOB_SERVICE_TOKEN = "core.failedJobs";
|
|
4
|
-
declare function createAppQueue(driver: "sync" | "async" | "redis", redisUrl?: string, failedJobs?: FailedJobService, registerJobs?: () => void): Queue;
|
|
5
|
-
export { createAppQueue, createFailedJobService, createQueueWorker, createTrackedJob, FAILED_JOB_SERVICE_TOKEN, };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type FailedJobRepository from "./failedJobRepository";
|
|
2
|
-
import type { FailedJobRecord } from "./types";
|
|
3
|
-
declare class FailedJobService {
|
|
4
|
-
private readonly repository;
|
|
5
|
-
constructor(repository: FailedJobRepository);
|
|
6
|
-
recordFailure(input: {
|
|
7
|
-
jobName: string;
|
|
8
|
-
payload: Record<string, unknown>;
|
|
9
|
-
exception: string;
|
|
10
|
-
}): Promise<FailedJobRecord>;
|
|
11
|
-
listRecent(limit?: number): Promise<FailedJobRecord[]>;
|
|
12
|
-
retry(id: number): Promise<FailedJobRecord>;
|
|
13
|
-
delete(id: number): Promise<void>;
|
|
14
|
-
flush(): Promise<number>;
|
|
15
|
-
}
|
|
16
|
-
export default FailedJobService;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
type QueuePriority = "high" | "default" | "low";
|
|
2
|
-
declare abstract class Job<TPayload extends object = object> {
|
|
3
|
-
readonly maxAttempts?: number;
|
|
4
|
-
readonly backoffMs?: number;
|
|
5
|
-
readonly priority?: QueuePriority;
|
|
6
|
-
abstract handle(payload: TPayload): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
interface Queue {
|
|
9
|
-
dispatch<TPayload extends object>(job: Job<TPayload>, payload: TPayload): Promise<void>;
|
|
10
|
-
}
|
|
11
|
-
declare class SyncQueue implements Queue {
|
|
12
|
-
dispatch<TPayload extends object>(job: Job<TPayload>, payload: TPayload): Promise<void>;
|
|
13
|
-
}
|
|
14
|
-
declare class AsyncQueue implements Queue {
|
|
15
|
-
dispatch<TPayload extends object>(job: Job<TPayload>, payload: TPayload): Promise<void>;
|
|
16
|
-
}
|
|
17
|
-
declare function createQueue(driver: "sync" | "async"): Queue;
|
|
18
|
-
export type { Queue, QueuePriority };
|
|
19
|
-
export { AsyncQueue, createQueue, Job, SyncQueue };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Job } from "./index";
|
|
2
|
-
type JobFactory = () => Job;
|
|
3
|
-
declare class JobRegistry {
|
|
4
|
-
private readonly factories;
|
|
5
|
-
private readonly instances;
|
|
6
|
-
register(name: string, factory: JobFactory): void;
|
|
7
|
-
resolveName(job: Job): string | undefined;
|
|
8
|
-
track(name: string, job: Job): Job;
|
|
9
|
-
create(name: string): Job | undefined;
|
|
10
|
-
names(): string[];
|
|
11
|
-
}
|
|
12
|
-
declare const jobRegistry: JobRegistry;
|
|
13
|
-
export { JobRegistry, jobRegistry };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type FailedJobService from "./failedJobService";
|
|
2
|
-
interface QueueJobEnvelope {
|
|
3
|
-
name: string;
|
|
4
|
-
payload: Record<string, unknown>;
|
|
5
|
-
attempts?: number;
|
|
6
|
-
}
|
|
7
|
-
declare function runQueueJob(envelope: QueueJobEnvelope, failedJobs: FailedJobService): Promise<void>;
|
|
8
|
-
export type { QueueJobEnvelope };
|
|
9
|
-
export { runQueueJob };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import FailedJobRepository from "./failedJobRepository.ts";
|
|
2
|
-
import FailedJobService from "./failedJobService.ts";
|
|
3
|
-
import type { Job, Queue } from "./index.ts";
|
|
4
|
-
import { jobRegistry } from "./jobRegistry.ts";
|
|
5
|
-
import { runQueueJob } from "./jobRunner.ts";
|
|
6
|
-
import { QueueWorker, RedisQueue } from "./redisQueue.ts";
|
|
7
|
-
import { ResilientQueue } from "./resilientQueue.ts";
|
|
8
|
-
declare function createFailedJobService(): FailedJobService;
|
|
9
|
-
declare function createTrackedJob<TPayload extends object>(name: string, job: Job<TPayload>): Job<TPayload>;
|
|
10
|
-
declare function createProductionQueue(driver: "sync" | "async" | "redis", options?: {
|
|
11
|
-
redisUrl?: string;
|
|
12
|
-
failedJobs?: FailedJobService;
|
|
13
|
-
registerJobs?: () => void;
|
|
14
|
-
}): Queue;
|
|
15
|
-
declare function createQueueWorker(redisUrl: string, failedJobs?: FailedJobService): QueueWorker;
|
|
16
|
-
export { createFailedJobService, createProductionQueue, createQueueWorker, createTrackedJob, FailedJobRepository, FailedJobService, jobRegistry, QueueWorker, RedisQueue, ResilientQueue, runQueueJob, };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
interface QueueDepthMetrics {
|
|
2
|
-
high: number;
|
|
3
|
-
default: number;
|
|
4
|
-
low: number;
|
|
5
|
-
total: number;
|
|
6
|
-
}
|
|
7
|
-
interface QueueMetricsSnapshot {
|
|
8
|
-
driver: string;
|
|
9
|
-
pending: QueueDepthMetrics;
|
|
10
|
-
failedCount: number;
|
|
11
|
-
}
|
|
12
|
-
declare function readRedisQueueDepth(redisUrl: string): Promise<QueueDepthMetrics>;
|
|
13
|
-
declare function collectQueueMetrics(): Promise<QueueMetricsSnapshot>;
|
|
14
|
-
export type { QueueDepthMetrics, QueueMetricsSnapshot };
|
|
15
|
-
export { collectQueueMetrics, readRedisQueueDepth };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type FailedJobService from "./failedJobService";
|
|
2
|
-
import type { Job, Queue, QueuePriority } from "./index";
|
|
3
|
-
import { type QueueJobEnvelope } from "./jobRunner";
|
|
4
|
-
declare const QUEUE_LIST_KEY = "workhub:queue:default";
|
|
5
|
-
declare const QUEUE_HIGH_KEY = "workhub:queue:high";
|
|
6
|
-
declare const QUEUE_LOW_KEY = "workhub:queue:low";
|
|
7
|
-
declare function queueKeyForPriority(priority?: QueuePriority): string;
|
|
8
|
-
declare function parseQueueJobEnvelope(rawPayload: string): QueueJobEnvelope | null;
|
|
9
|
-
declare class RedisQueue implements Queue {
|
|
10
|
-
private readonly client;
|
|
11
|
-
constructor(redisUrl: string);
|
|
12
|
-
dispatch<TPayload extends object>(job: Job<TPayload>, payload: TPayload): Promise<void>;
|
|
13
|
-
}
|
|
14
|
-
declare class QueueWorker {
|
|
15
|
-
private readonly failedJobs;
|
|
16
|
-
private readonly timeoutSeconds;
|
|
17
|
-
private running;
|
|
18
|
-
private stopping;
|
|
19
|
-
private readonly client;
|
|
20
|
-
constructor(redisUrl: string, failedJobs: FailedJobService, timeoutSeconds?: number);
|
|
21
|
-
requestStop(): void;
|
|
22
|
-
isRunning(): boolean;
|
|
23
|
-
processNext(): Promise<boolean>;
|
|
24
|
-
run(): Promise<void>;
|
|
25
|
-
close(): void;
|
|
26
|
-
}
|
|
27
|
-
declare function countPendingQueueJobs(redisUrl: string): Promise<number>;
|
|
28
|
-
export type { QueueJobEnvelope };
|
|
29
|
-
export { countPendingQueueJobs, parseQueueJobEnvelope, QUEUE_HIGH_KEY, QUEUE_LIST_KEY, QUEUE_LOW_KEY, QueueWorker, queueKeyForPriority, RedisQueue, };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type FailedJobService from "./failedJobService";
|
|
2
|
-
import type { Job, Queue } from "./index";
|
|
3
|
-
declare class ResilientQueue implements Queue {
|
|
4
|
-
private readonly failedJobs;
|
|
5
|
-
private readonly asyncDispatch;
|
|
6
|
-
constructor(failedJobs: FailedJobService, asyncDispatch?: boolean);
|
|
7
|
-
dispatch<TPayload extends object>(job: Job<TPayload>, payload: TPayload): Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
export { ResilientQueue };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { CacheLike } from "../../types/services";
|
|
2
|
-
import type { AuthManager } from "../auth/guard";
|
|
3
|
-
import type { PolicyGate } from "../auth/policy";
|
|
4
|
-
import type { AppContext } from "../contracts/di";
|
|
5
|
-
import type { EventBus } from "../events";
|
|
6
|
-
import { type Logger } from "../logging/logger";
|
|
7
|
-
import type { Queue } from "../queue";
|
|
8
|
-
declare function setActiveApplicationContext(context: AppContext): void;
|
|
9
|
-
declare function resolveApplicationCache(): CacheLike;
|
|
10
|
-
declare function resolveApplicationQueue(): Queue;
|
|
11
|
-
declare function resolveApplicationEventBus(): EventBus;
|
|
12
|
-
declare function resolveApplicationAuth(): AuthManager;
|
|
13
|
-
declare function resolveApplicationPolicyGate(): PolicyGate;
|
|
14
|
-
declare function resolveApplicationConfig(): import("../contracts/container").ConfigStoreLike;
|
|
15
|
-
declare function resolveApplicationLogger(): Logger;
|
|
16
|
-
declare function resolveApplicationDependencies(): import("../contracts/di").AppDependencies;
|
|
17
|
-
export { resolveApplicationAuth, resolveApplicationCache, resolveApplicationConfig, resolveApplicationDependencies, resolveApplicationEventBus, resolveApplicationLogger, resolveApplicationPolicyGate, resolveApplicationQueue, setActiveApplicationContext, };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
type ScheduledTask = {
|
|
2
|
-
expression: string;
|
|
3
|
-
name: string;
|
|
4
|
-
run: () => void | Promise<void>;
|
|
5
|
-
};
|
|
6
|
-
declare class Schedule {
|
|
7
|
-
private readonly tasks;
|
|
8
|
-
command(expression: string, name: string, run: () => void | Promise<void>): this;
|
|
9
|
-
dueTasks(now?: Date): ScheduledTask[];
|
|
10
|
-
tasksList(): ScheduledTask[];
|
|
11
|
-
}
|
|
12
|
-
declare const appSchedule: Schedule;
|
|
13
|
-
declare function runDueScheduledTasks(schedule?: Schedule, now?: Date): Promise<number>;
|
|
14
|
-
export type { ScheduledTask };
|
|
15
|
-
export { appSchedule, runDueScheduledTasks, Schedule };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
declare const DEFAULT_FETCH_TIMEOUT_MS = 10000;
|
|
2
|
-
interface SafeFetchOptions {
|
|
3
|
-
timeoutMs?: number;
|
|
4
|
-
maxRedirects?: number;
|
|
5
|
-
allowHttp?: boolean;
|
|
6
|
-
resolveDns?: boolean;
|
|
7
|
-
}
|
|
8
|
-
declare function safeFetch(input: string, init?: RequestInit, options?: SafeFetchOptions): Promise<Response>;
|
|
9
|
-
export type { SafeFetchOptions };
|
|
10
|
-
export { DEFAULT_FETCH_TIMEOUT_MS, safeFetch };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
type DnsLookupResult = {
|
|
2
|
-
address: string;
|
|
3
|
-
family: number;
|
|
4
|
-
};
|
|
5
|
-
type DnsLookup = (hostname: string, options: {
|
|
6
|
-
all: true;
|
|
7
|
-
verbatim: true;
|
|
8
|
-
}) => Promise<DnsLookupResult[]>;
|
|
9
|
-
declare function isBlockedHostname(hostname: string): boolean;
|
|
10
|
-
declare function assertSafeOutboundUrl(rawUrl: string, options?: {
|
|
11
|
-
allowHttp?: boolean;
|
|
12
|
-
}): URL;
|
|
13
|
-
declare function isBlockedIpAddress(address: string): boolean;
|
|
14
|
-
declare function assertSafeOutboundUrlResolved(rawUrl: string, options?: {
|
|
15
|
-
allowHttp?: boolean;
|
|
16
|
-
resolveDns?: boolean;
|
|
17
|
-
}): Promise<URL>;
|
|
18
|
-
declare function setDnsLookupForTests(lookupFn: DnsLookup): void;
|
|
19
|
-
declare function resetDnsLookupForTests(): void;
|
|
20
|
-
export { assertSafeOutboundUrl, assertSafeOutboundUrlResolved, isBlockedHostname, isBlockedIpAddress, resetDnsLookupForTests, setDnsLookupForTests, };
|