@bgord/bun 0.8.1 → 0.9.0
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/prerequisites.service.d.ts +2 -2
- package/dist/prerequisites.service.d.ts.map +1 -1
- package/dist/prerequisites.service.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/prerequisites.service.ts +2 -2
- package/dist/api-key-shield.d.ts +0 -14
- package/dist/api-key-shield.d.ts.map +0 -1
- package/dist/api-key-shield.js +0 -19
- package/dist/api-key-shield.js.map +0 -1
- package/dist/api-version.d.ts +0 -6
- package/dist/api-version.d.ts.map +0 -1
- package/dist/api-version.js +0 -12
- package/dist/api-version.js.map +0 -1
- package/dist/auth-shield.d.ts +0 -31
- package/dist/auth-shield.d.ts.map +0 -1
- package/dist/auth-shield.js +0 -83
- package/dist/auth-shield.js.map +0 -1
- package/dist/basic-auth-shield.d.ts +0 -14
- package/dist/basic-auth.d.ts +0 -14
- package/dist/basic-auth.d.ts.map +0 -1
- package/dist/basic-auth.js +0 -13
- package/dist/basic-auth.js.map +0 -1
- package/dist/bgord-bun.cjs +0 -2
- package/dist/bgord-bun.cjs.map +0 -1
- package/dist/bgord-bun.modern.js +0 -2
- package/dist/bgord-bun.modern.js.map +0 -1
- package/dist/bgord-bun.module.js +0 -2
- package/dist/bgord-bun.module.js.map +0 -1
- package/dist/bgord-bun.umd.js +0 -2
- package/dist/bgord-bun.umd.js.map +0 -1
- package/dist/build-info-repository.d.ts +0 -10
- package/dist/build-info-repository.d.ts.map +0 -1
- package/dist/build-info-repository.js +0 -18
- package/dist/build-info-repository.js.map +0 -1
- package/dist/bun/api-key-shield.d.ts +0 -16
- package/dist/bun/api-version.d.ts +0 -8
- package/dist/bun/context.d.ts +0 -12
- package/dist/bun/etag-extractor.d.ts +0 -17
- package/dist/bun/graceful-shutdown.d.ts +0 -6
- package/dist/bun/healthcheck.d.ts +0 -22
- package/dist/bun/http-logger.d.ts +0 -9
- package/dist/bun/index.d.ts +0 -9
- package/dist/bun/rate-limit-shield.d.ts +0 -11
- package/dist/bun/time-zone-offset.d.ts +0 -16
- package/dist/cache-resolver.d.ts +0 -46
- package/dist/cache-resolver.d.ts.map +0 -1
- package/dist/cache-resolver.js +0 -44
- package/dist/cache-resolver.js.map +0 -1
- package/dist/cache-response.d.ts +0 -9
- package/dist/cache-response.d.ts.map +0 -1
- package/dist/cache-response.js +0 -25
- package/dist/cache-response.js.map +0 -1
- package/dist/cache-static-files.d.ts +0 -9
- package/dist/cache-static-files.d.ts.map +0 -1
- package/dist/cache-static-files.js +0 -25
- package/dist/cache-static-files.js.map +0 -1
- package/dist/cache.d.ts +0 -1
- package/dist/clock.d.ts +0 -49
- package/dist/context.d.ts +0 -14
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js +0 -11
- package/dist/context.js.map +0 -1
- package/dist/correlation-id.d.ts +0 -4
- package/dist/correlation-id.d.ts.map +0 -1
- package/dist/correlation-id.js +0 -3
- package/dist/correlation-id.js.map +0 -1
- package/dist/credentials.d.ts +0 -28
- package/dist/dates.d.ts +0 -37
- package/dist/decorators.d.ts +0 -12
- package/dist/decorators.d.ts.map +0 -1
- package/dist/decorators.js +0 -62
- package/dist/decorators.js.map +0 -1
- package/dist/deep-merge.d.ts +0 -7
- package/dist/dll.d.ts +0 -29
- package/dist/download-file.d.ts +0 -13
- package/dist/download-file.d.ts.map +0 -1
- package/dist/download-file.js +0 -11
- package/dist/download-file.js.map +0 -1
- package/dist/email-censor.d.ts +0 -4
- package/dist/encryption.d.ts +0 -25
- package/dist/encryption.d.ts.map +0 -1
- package/dist/encryption.js +0 -37
- package/dist/encryption.js.map +0 -1
- package/dist/env-validator.d.ts +0 -21
- package/dist/env-validator.d.ts.map +0 -1
- package/dist/env-validator.js +0 -28
- package/dist/env-validator.js.map +0 -1
- package/dist/environment-validator.d.ts +0 -23
- package/dist/errors.d.ts +0 -49
- package/dist/etag-extractor.d.ts +0 -11
- package/dist/etag-extractor.d.ts.map +0 -1
- package/dist/etag-extractor.js +0 -18
- package/dist/etag-extractor.js.map +0 -1
- package/dist/etag.d.ts +0 -19
- package/dist/event-handler.d.ts +0 -8
- package/dist/event-handler.d.ts.map +0 -1
- package/dist/event-handler.js +0 -21
- package/dist/event-handler.js.map +0 -1
- package/dist/event-logger.d.ts +0 -8
- package/dist/event-logger.d.ts.map +0 -1
- package/dist/event-logger.js +0 -19
- package/dist/event-logger.js.map +0 -1
- package/dist/event.d.ts +0 -20
- package/dist/event.d.ts.map +0 -1
- package/dist/event.js +0 -23
- package/dist/event.js.map +0 -1
- package/dist/express-essentials.d.ts +0 -35
- package/dist/feature-flag.d.ts +0 -5
- package/dist/file-location.d.ts +0 -32
- package/dist/file-location.d.ts.map +0 -1
- package/dist/file-location.js +0 -46
- package/dist/file-location.js.map +0 -1
- package/dist/file-uploader.d.ts +0 -13
- package/dist/file-uploader.d.ts.map +0 -1
- package/dist/file-uploader.js +0 -35
- package/dist/file-uploader.js.map +0 -1
- package/dist/file.d.ts +0 -4
- package/dist/filter.d.ts +0 -17
- package/dist/graceful-shutdown.d.ts +0 -7
- package/dist/graceful-shutdown.d.ts.map +0 -1
- package/dist/graceful-shutdown.js +0 -32
- package/dist/graceful-shutdown.js.map +0 -1
- package/dist/gzip.d.ts +0 -13
- package/dist/gzip.d.ts.map +0 -1
- package/dist/gzip.js +0 -18
- package/dist/gzip.js.map +0 -1
- package/dist/handlebars.d.ts +0 -10
- package/dist/hcaptcha-shield.d.ts +0 -23
- package/dist/hcaptcha-shield.d.ts.map +0 -1
- package/dist/hcaptcha-shield.js +0 -34
- package/dist/hcaptcha-shield.js.map +0 -1
- package/dist/healthcheck.d.ts +0 -22
- package/dist/healthcheck.d.ts.map +0 -1
- package/dist/healthcheck.js +0 -35
- package/dist/healthcheck.js.map +0 -1
- package/dist/http-logger.d.ts +0 -7
- package/dist/http-logger.d.ts.map +0 -1
- package/dist/http-logger.js +0 -89
- package/dist/http-logger.js.map +0 -1
- package/dist/i18n.d.ts +0 -22
- package/dist/i18n.d.ts.map +0 -1
- package/dist/i18n.js +0 -35
- package/dist/i18n.js.map +0 -1
- package/dist/image-compressor.d.ts +0 -15
- package/dist/image-compressor.d.ts.map +0 -1
- package/dist/image-compressor.js +0 -13
- package/dist/image-compressor.js.map +0 -1
- package/dist/image-converter.d.ts +0 -11
- package/dist/image-exif.d.ts +0 -19
- package/dist/image-exif.d.ts.map +0 -1
- package/dist/image-exif.js +0 -21
- package/dist/image-exif.js.map +0 -1
- package/dist/image-processor.d.ts +0 -5
- package/dist/image-processor.d.ts.map +0 -1
- package/dist/image-processor.js +0 -5
- package/dist/image-processor.js.map +0 -1
- package/dist/image-resizer.d.ts +0 -16
- package/dist/jobs.d.ts +0 -33
- package/dist/jobs.d.ts.map +0 -1
- package/dist/jobs.js +0 -72
- package/dist/jobs.js.map +0 -1
- package/dist/leap-year-checker.d.ts +0 -4
- package/dist/logger.d.ts +0 -69
- package/dist/logger.d.ts.map +0 -1
- package/dist/logger.js +0 -87
- package/dist/logger.js.map +0 -1
- package/dist/mailer.d.ts +0 -38
- package/dist/mailer.d.ts.map +0 -1
- package/dist/mailer.js +0 -33
- package/dist/mailer.js.map +0 -1
- package/dist/mean.d.ts +0 -4
- package/dist/memory-consumption.d.ts +0 -5
- package/dist/memory-consumption.d.ts.map +0 -1
- package/dist/memory-consumption.js +0 -8
- package/dist/memory-consumption.js.map +0 -1
- package/dist/method-override.d.ts +0 -4
- package/dist/mime-types.d.ts +0 -2
- package/dist/mime.d.ts +0 -10
- package/dist/min-max-scaler.d.ts +0 -36
- package/dist/money.d.ts +0 -24
- package/dist/new-uuid.d.ts +0 -4
- package/dist/new-uuid.d.ts.map +0 -1
- package/dist/new-uuid.js +0 -6
- package/dist/new-uuid.js.map +0 -1
- package/dist/noop.d.ts +0 -2
- package/dist/open-graph.d.ts +0 -110
- package/dist/open-graph.d.ts.map +0 -1
- package/dist/open-graph.js +0 -172
- package/dist/open-graph.js.map +0 -1
- package/dist/outlier-detector.d.ts +0 -6
- package/dist/package-version.d.ts +0 -20
- package/dist/pagination.d.ts +0 -58
- package/dist/passwords.d.ts +0 -21
- package/dist/passwords.d.ts.map +0 -1
- package/dist/passwords.js +0 -42
- package/dist/passwords.js.map +0 -1
- package/dist/path.d.ts +0 -4
- package/dist/path.d.ts.map +0 -1
- package/dist/path.js +0 -3
- package/dist/path.js.map +0 -1
- package/dist/percentage.d.ts +0 -4
- package/dist/policy.d.ts +0 -11
- package/dist/polyfills.d.ts +0 -0
- package/dist/population-standard-deviation.d.ts +0 -4
- package/dist/port.d.ts +0 -4
- package/dist/port.d.ts.map +0 -1
- package/dist/port.js +0 -3
- package/dist/port.js.map +0 -1
- package/dist/prerequisites.d.ts +0 -48
- package/dist/prerequisites.d.ts.map +0 -1
- package/dist/prerequisites.js +0 -85
- package/dist/prerequisites.js.map +0 -1
- package/dist/random.d.ts +0 -8
- package/dist/rate-limit-shield.d.ts +0 -9
- package/dist/rate-limit-shield.d.ts.map +0 -1
- package/dist/rate-limit-shield.js +0 -18
- package/dist/rate-limit-shield.js.map +0 -1
- package/dist/rate-limiter.d.ts +0 -18
- package/dist/recaptcha-shield.d.ts +0 -20
- package/dist/recaptcha-shield.d.ts.map +0 -1
- package/dist/recaptcha-shield.js +0 -50
- package/dist/recaptcha-shield.js.map +0 -1
- package/dist/redirector.d.ts +0 -4
- package/dist/reordering.d.ts +0 -49
- package/dist/request-id.d.ts +0 -13
- package/dist/response-body-in-locals.d.ts +0 -4
- package/dist/revision.d.ts +0 -12
- package/dist/rounding.d.ts +0 -17
- package/dist/schema.d.ts +0 -189
- package/dist/server-timing.d.ts +0 -7
- package/dist/session-id.d.ts +0 -7
- package/dist/session-id.d.ts.map +0 -1
- package/dist/session-id.js +0 -10
- package/dist/session-id.js.map +0 -1
- package/dist/setup.d.ts +0 -9
- package/dist/setup.d.ts.map +0 -1
- package/dist/setup.js +0 -39
- package/dist/setup.js.map +0 -1
- package/dist/simple-linear-regression.d.ts +0 -18
- package/dist/simulated-error.d.ts +0 -4
- package/dist/simulated-error.d.ts.map +0 -1
- package/dist/simulated-error.js +0 -7
- package/dist/simulated-error.js.map +0 -1
- package/dist/sitemap.d.ts +0 -29
- package/dist/sitemap.d.ts.map +0 -1
- package/dist/sitemap.js +0 -57
- package/dist/sitemap.js.map +0 -1
- package/dist/size.d.ts +0 -31
- package/dist/sleep.d.ts +0 -3
- package/dist/slower.d.ts +0 -5
- package/dist/slower.d.ts.map +0 -1
- package/dist/slower.js +0 -8
- package/dist/slower.js.map +0 -1
- package/dist/static-files.d.ts +0 -14
- package/dist/stepper.d.ts +0 -23
- package/dist/stopwatch.d.ts +0 -14
- package/dist/streak-calculator.d.ts +0 -14
- package/dist/sum.d.ts +0 -3
- package/dist/thousands-separator.d.ts +0 -4
- package/dist/time-zone-offset.d.ts +0 -15
- package/dist/time-zone-offset.d.ts.map +0 -1
- package/dist/time-zone-offset.js +0 -22
- package/dist/time-zone-offset.js.map +0 -1
- package/dist/time.d.ts +0 -21
- package/dist/timeout.d.ts +0 -9
- package/dist/ts-utils.d.ts +0 -3
- package/dist/uploaded-file-location.d.ts +0 -10
- package/dist/uptime.d.ts +0 -9
- package/dist/uptime.d.ts.map +0 -1
- package/dist/uptime.js +0 -10
- package/dist/uptime.js.map +0 -1
- package/dist/url-wo-trailing-slash.d.ts +0 -4
- package/dist/url-wo-trailing-slash.d.ts.map +0 -1
- package/dist/url-wo-trailing-slash.js +0 -9
- package/dist/url-wo-trailing-slash.js.map +0 -1
- package/dist/username.d.ts +0 -11
- package/dist/username.d.ts.map +0 -1
- package/dist/username.js +0 -13
- package/dist/username.js.map +0 -1
- package/dist/uuid.d.ts +0 -4
- package/dist/uuid.d.ts.map +0 -1
- package/dist/uuid.js +0 -4
- package/dist/uuid.js.map +0 -1
- package/dist/visually-unambiguous-characters-generator.d.ts +0 -4
- package/dist/weak-etag-extractor.d.ts +0 -7
- package/dist/weak-etag-extractor.d.ts.map +0 -1
- package/dist/weak-etag-extractor.js +0 -18
- package/dist/weak-etag-extractor.js.map +0 -1
- package/dist/z-score.d.ts +0 -8
package/dist/percentage.d.ts
DELETED
package/dist/policy.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as ts from "./ts-utils";
|
|
2
|
-
type BasePolicyConfig = Record<string, unknown>;
|
|
3
|
-
export declare abstract class Policy<T extends BasePolicyConfig> {
|
|
4
|
-
abstract fails(config: T): Promise<boolean> | boolean;
|
|
5
|
-
abstract error: ts.Constructor<Error>;
|
|
6
|
-
abstract message: string;
|
|
7
|
-
throw(): void;
|
|
8
|
-
perform(config: T): Promise<void>;
|
|
9
|
-
passes(config: T): Promise<boolean>;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
package/dist/polyfills.d.ts
DELETED
|
File without changes
|
package/dist/port.d.ts
DELETED
package/dist/port.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"port.d.ts","sourceRoot":"","sources":["../src/port.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,eAAO,MAAM,IAAI,6BAAsC,CAAC;AAExD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC"}
|
package/dist/port.js
DELETED
package/dist/port.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"port.js","sourceRoot":"","sources":["../src/port.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC"}
|
package/dist/prerequisites.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export type PrerequisiteLabelType = string;
|
|
2
|
-
export declare enum PrerequisiteStrategyEnum {
|
|
3
|
-
binary = "binary",
|
|
4
|
-
mailer = "mailer",
|
|
5
|
-
self = "self",
|
|
6
|
-
timezoneUTC = "timezoneUTC",
|
|
7
|
-
path = "path",
|
|
8
|
-
node = "node",
|
|
9
|
-
bun = "bun",
|
|
10
|
-
RAM = "RAM",
|
|
11
|
-
space = "space",
|
|
12
|
-
translations = "translations",
|
|
13
|
-
port = "port",
|
|
14
|
-
jobs = "jobs",
|
|
15
|
-
memory = "memory",
|
|
16
|
-
outsideConnectivity = "outsideConnectivity",
|
|
17
|
-
sslCertificateExpiry = "sslCertificateExpiry",
|
|
18
|
-
logFile = "logFile",
|
|
19
|
-
dependencyVulnerabilities = "dependencyVulnerabilities",
|
|
20
|
-
externalApi = "externalApi",
|
|
21
|
-
/** @public */
|
|
22
|
-
custom = "custom"
|
|
23
|
-
}
|
|
24
|
-
export declare enum PrerequisiteStatusEnum {
|
|
25
|
-
success = "success",
|
|
26
|
-
failure = "failure",
|
|
27
|
-
undetermined = "undetermined"
|
|
28
|
-
}
|
|
29
|
-
export type BasePrerequisiteConfig = {
|
|
30
|
-
label: PrerequisiteLabelType;
|
|
31
|
-
enabled?: boolean;
|
|
32
|
-
} & Record<string, unknown>;
|
|
33
|
-
export declare abstract class AbstractPrerequisite<T extends BasePrerequisiteConfig> {
|
|
34
|
-
readonly label: PrerequisiteLabelType;
|
|
35
|
-
readonly enabled: boolean;
|
|
36
|
-
abstract readonly strategy: PrerequisiteStrategyEnum;
|
|
37
|
-
abstract readonly config: T;
|
|
38
|
-
status: PrerequisiteStatusEnum;
|
|
39
|
-
constructor(config: T);
|
|
40
|
-
abstract verify(): Promise<PrerequisiteStatusEnum>;
|
|
41
|
-
protected pass(): PrerequisiteStatusEnum.success;
|
|
42
|
-
protected reject(): PrerequisiteStatusEnum.failure;
|
|
43
|
-
report(): void;
|
|
44
|
-
}
|
|
45
|
-
export declare class Prerequisites {
|
|
46
|
-
static check(prerequisites: AbstractPrerequisite<BasePrerequisiteConfig>[]): Promise<void>;
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=prerequisites.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prerequisites.d.ts","sourceRoot":"","sources":["../src/prerequisites.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE3C,oBAAY,wBAAwB;IAClC,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,WAAW,gBAAgB;IAC3B,IAAI,SAAS;IACb,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,YAAY,iBAAiB;IAC7B,IAAI,SAAS;IACb,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,mBAAmB,wBAAwB;IAC3C,oBAAoB,yBAAyB;IAC7C,OAAO,YAAY;IACnB,yBAAyB,8BAA8B;IACvD,WAAW,gBAAgB;IAC3B,cAAc;IACd,MAAM,WAAW;CAClB;AAED,oBAAY,sBAAsB;IAChC,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,YAAY,iBAAiB;CAC9B;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,qBAAqB,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5B,8BAAsB,oBAAoB,CAAC,CAAC,SAAS,sBAAsB;IACzE,QAAQ,CAAC,KAAK,EAAE,qBAAqB,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAQ;IACjC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;IACrD,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAE5B,MAAM,EAAE,sBAAsB,CAAuC;gBAEzD,MAAM,EAAE,CAAC;IAKrB,QAAQ,CAAC,MAAM,IAAI,OAAO,CAAC,sBAAsB,CAAC;IAElD,SAAS,CAAC,IAAI,IAAI,sBAAsB,CAAC,OAAO;IAKhD,SAAS,CAAC,MAAM,IAAI,sBAAsB,CAAC,OAAO;IAKlD,MAAM;CAgBP;AAED,qBAAa,aAAa;WACX,KAAK,CAAC,aAAa,EAAE,oBAAoB,CAAC,sBAAsB,CAAC,EAAE;CA0BjF"}
|
package/dist/prerequisites.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
export var PrerequisiteStrategyEnum;
|
|
2
|
-
(function (PrerequisiteStrategyEnum) {
|
|
3
|
-
PrerequisiteStrategyEnum["binary"] = "binary";
|
|
4
|
-
PrerequisiteStrategyEnum["mailer"] = "mailer";
|
|
5
|
-
PrerequisiteStrategyEnum["self"] = "self";
|
|
6
|
-
PrerequisiteStrategyEnum["timezoneUTC"] = "timezoneUTC";
|
|
7
|
-
PrerequisiteStrategyEnum["path"] = "path";
|
|
8
|
-
PrerequisiteStrategyEnum["node"] = "node";
|
|
9
|
-
PrerequisiteStrategyEnum["bun"] = "bun";
|
|
10
|
-
PrerequisiteStrategyEnum["RAM"] = "RAM";
|
|
11
|
-
PrerequisiteStrategyEnum["space"] = "space";
|
|
12
|
-
PrerequisiteStrategyEnum["translations"] = "translations";
|
|
13
|
-
PrerequisiteStrategyEnum["port"] = "port";
|
|
14
|
-
PrerequisiteStrategyEnum["jobs"] = "jobs";
|
|
15
|
-
PrerequisiteStrategyEnum["memory"] = "memory";
|
|
16
|
-
PrerequisiteStrategyEnum["outsideConnectivity"] = "outsideConnectivity";
|
|
17
|
-
PrerequisiteStrategyEnum["sslCertificateExpiry"] = "sslCertificateExpiry";
|
|
18
|
-
PrerequisiteStrategyEnum["logFile"] = "logFile";
|
|
19
|
-
PrerequisiteStrategyEnum["dependencyVulnerabilities"] = "dependencyVulnerabilities";
|
|
20
|
-
PrerequisiteStrategyEnum["externalApi"] = "externalApi";
|
|
21
|
-
/** @public */
|
|
22
|
-
PrerequisiteStrategyEnum["custom"] = "custom";
|
|
23
|
-
})(PrerequisiteStrategyEnum || (PrerequisiteStrategyEnum = {}));
|
|
24
|
-
export var PrerequisiteStatusEnum;
|
|
25
|
-
(function (PrerequisiteStatusEnum) {
|
|
26
|
-
PrerequisiteStatusEnum["success"] = "success";
|
|
27
|
-
PrerequisiteStatusEnum["failure"] = "failure";
|
|
28
|
-
PrerequisiteStatusEnum["undetermined"] = "undetermined";
|
|
29
|
-
})(PrerequisiteStatusEnum || (PrerequisiteStatusEnum = {}));
|
|
30
|
-
export class AbstractPrerequisite {
|
|
31
|
-
label;
|
|
32
|
-
enabled = true;
|
|
33
|
-
status = PrerequisiteStatusEnum.undetermined;
|
|
34
|
-
constructor(config) {
|
|
35
|
-
this.label = config.label;
|
|
36
|
-
this.enabled = config.enabled ?? true;
|
|
37
|
-
}
|
|
38
|
-
pass() {
|
|
39
|
-
this.status = PrerequisiteStatusEnum.success;
|
|
40
|
-
return PrerequisiteStatusEnum.success;
|
|
41
|
-
}
|
|
42
|
-
reject() {
|
|
43
|
-
this.status = PrerequisiteStatusEnum.failure;
|
|
44
|
-
return PrerequisiteStatusEnum.failure;
|
|
45
|
-
}
|
|
46
|
-
report() {
|
|
47
|
-
if (this.status === PrerequisiteStatusEnum.success) {
|
|
48
|
-
// biome-ignore lint: lint/suspicious/noConsoleLog
|
|
49
|
-
console.log(`[x] ${this.config.label} verified correctly with ${this.strategy} strategy`);
|
|
50
|
-
}
|
|
51
|
-
if (this.status === PrerequisiteStatusEnum.failure) {
|
|
52
|
-
// biome-ignore lint: lint/suspicious/noConsoleLog
|
|
53
|
-
console.log(`[-] ${this.config.label} not verified correctly with ${this.strategy} strategy`);
|
|
54
|
-
}
|
|
55
|
-
if (this.status === PrerequisiteStatusEnum.undetermined) {
|
|
56
|
-
// biome-ignore lint: lint/suspicious/noConsoleLog
|
|
57
|
-
console.log(`[?] ${this.config.label} not enabled with ${this.strategy} strategy`);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
export class Prerequisites {
|
|
62
|
-
static async check(prerequisites) {
|
|
63
|
-
try {
|
|
64
|
-
const failedPrerequisiteLabels = [];
|
|
65
|
-
for (const prerequisite of prerequisites) {
|
|
66
|
-
await prerequisite.verify();
|
|
67
|
-
prerequisite.report();
|
|
68
|
-
if (prerequisite.status === PrerequisiteStatusEnum.failure) {
|
|
69
|
-
failedPrerequisiteLabels.push(prerequisite.label);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
if (failedPrerequisiteLabels.length > 0) {
|
|
73
|
-
const failedPrerequisiteLabelsFormatted = failedPrerequisiteLabels.join(", ");
|
|
74
|
-
// biome-ignore lint: lint/suspicious/noConsoleLog
|
|
75
|
-
console.log(`Prerequisites failed: ${failedPrerequisiteLabelsFormatted}, quitting...`);
|
|
76
|
-
process.exit(1);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
// biome-ignore lint: lint/suspicious/noConsoleLog
|
|
81
|
-
console.log("Prerequisites error", String(error));
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=prerequisites.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prerequisites.js","sourceRoot":"","sources":["../src/prerequisites.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,wBAqBX;AArBD,WAAY,wBAAwB;IAClC,6CAAiB,CAAA;IACjB,6CAAiB,CAAA;IACjB,yCAAa,CAAA;IACb,uDAA2B,CAAA;IAC3B,yCAAa,CAAA;IACb,yCAAa,CAAA;IACb,uCAAW,CAAA;IACX,uCAAW,CAAA;IACX,2CAAe,CAAA;IACf,yDAA6B,CAAA;IAC7B,yCAAa,CAAA;IACb,yCAAa,CAAA;IACb,6CAAiB,CAAA;IACjB,uEAA2C,CAAA;IAC3C,yEAA6C,CAAA;IAC7C,+CAAmB,CAAA;IACnB,mFAAuD,CAAA;IACvD,uDAA2B,CAAA;IAC3B,cAAc;IACd,6CAAiB,CAAA;AACnB,CAAC,EArBW,wBAAwB,KAAxB,wBAAwB,QAqBnC;AAED,MAAM,CAAN,IAAY,sBAIX;AAJD,WAAY,sBAAsB;IAChC,6CAAmB,CAAA;IACnB,6CAAmB,CAAA;IACnB,uDAA6B,CAAA;AAC/B,CAAC,EAJW,sBAAsB,KAAtB,sBAAsB,QAIjC;AAOD,MAAM,OAAgB,oBAAoB;IAC/B,KAAK,CAAwB;IAC7B,OAAO,GAAY,IAAI,CAAC;IAIjC,MAAM,GAA2B,sBAAsB,CAAC,YAAY,CAAC;IAErE,YAAY,MAAS;QACnB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,IAAI,CAAC;IACxC,CAAC;IAIS,IAAI;QACZ,IAAI,CAAC,MAAM,GAAG,sBAAsB,CAAC,OAAO,CAAC;QAC7C,OAAO,sBAAsB,CAAC,OAAO,CAAC;IACxC,CAAC;IAES,MAAM;QACd,IAAI,CAAC,MAAM,GAAG,sBAAsB,CAAC,OAAO,CAAC;QAC7C,OAAO,sBAAsB,CAAC,OAAO,CAAC;IACxC,CAAC;IAED,MAAM;QACJ,IAAI,IAAI,CAAC,MAAM,KAAK,sBAAsB,CAAC,OAAO,EAAE,CAAC;YACnD,kDAAkD;YAClD,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,4BAA4B,IAAI,CAAC,QAAQ,WAAW,CAAC,CAAC;QAC5F,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,KAAK,sBAAsB,CAAC,OAAO,EAAE,CAAC;YACnD,kDAAkD;YAClD,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,gCAAgC,IAAI,CAAC,QAAQ,WAAW,CAAC,CAAC;QAChG,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,KAAK,sBAAsB,CAAC,YAAY,EAAE,CAAC;YACxD,kDAAkD;YAClD,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,qBAAqB,IAAI,CAAC,QAAQ,WAAW,CAAC,CAAC;QACrF,CAAC;IACH,CAAC;CACF;AAED,MAAM,OAAO,aAAa;IACxB,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,aAA6D;QAC9E,IAAI,CAAC;YACH,MAAM,wBAAwB,GAA4B,EAAE,CAAC;YAE7D,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE,CAAC;gBACzC,MAAM,YAAY,CAAC,MAAM,EAAE,CAAC;gBAC5B,YAAY,CAAC,MAAM,EAAE,CAAC;gBAEtB,IAAI,YAAY,CAAC,MAAM,KAAK,sBAAsB,CAAC,OAAO,EAAE,CAAC;oBAC3D,wBAAwB,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;gBACpD,CAAC;YACH,CAAC;YAED,IAAI,wBAAwB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACxC,MAAM,iCAAiC,GAAG,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAE9E,kDAAkD;gBAClD,OAAO,CAAC,GAAG,CAAC,yBAAyB,iCAAiC,eAAe,CAAC,CAAC;gBAEvF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,kDAAkD;YAClD,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;CACF"}
|
package/dist/random.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as tools from "@bgord/tools";
|
|
2
|
-
import { HTTPException } from "hono/http-exception";
|
|
3
|
-
type RateLimitShieldOptionsType = {
|
|
4
|
-
ms: tools.TimestampType;
|
|
5
|
-
};
|
|
6
|
-
export declare const TooManyRequestsError: HTTPException;
|
|
7
|
-
export declare const rateLimitShield: (options: RateLimitShieldOptionsType) => import("hono").MiddlewareHandler<any, string, {}>;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=rate-limit-shield.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rate-limit-shield.d.ts","sourceRoot":"","sources":["../src/rate-limit-shield.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,KAAK,0BAA0B,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC,aAAa,CAAA;CAAE,CAAC;AAE9D,eAAO,MAAM,oBAAoB,eAE/B,CAAC;AAEH,eAAO,MAAM,eAAe,GAAI,SAAS,0BAA0B,sDAalE,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as tools from "@bgord/tools";
|
|
2
|
-
import { createMiddleware } from "hono/factory";
|
|
3
|
-
import { HTTPException } from "hono/http-exception";
|
|
4
|
-
export const TooManyRequestsError = new HTTPException(429, {
|
|
5
|
-
message: "app.too_many_requests",
|
|
6
|
-
});
|
|
7
|
-
export const rateLimitShield = (options) => {
|
|
8
|
-
const rateLimiter = new tools.RateLimiter(options);
|
|
9
|
-
return createMiddleware(async (_c, next) => {
|
|
10
|
-
const currentTimestampMs = Date.now();
|
|
11
|
-
const check = rateLimiter.verify(currentTimestampMs);
|
|
12
|
-
if (!check.allowed) {
|
|
13
|
-
throw TooManyRequestsError;
|
|
14
|
-
}
|
|
15
|
-
return next();
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=rate-limit-shield.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rate-limit-shield.js","sourceRoot":"","sources":["../src/rate-limit-shield.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIpD,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,aAAa,CAAC,GAAG,EAAE;IACzD,OAAO,EAAE,uBAAuB;CACjC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAmC,EAAE,EAAE;IACrE,MAAM,WAAW,GAAG,IAAI,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAEnD,OAAO,gBAAgB,CAAC,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE;QACzC,MAAM,kBAAkB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACtC,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;QAErD,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,MAAM,oBAAoB,CAAC;QAC7B,CAAC;QAED,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
package/dist/rate-limiter.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { TimestampType } from "./schema";
|
|
2
|
-
export type RateLimiterOptionsType = {
|
|
3
|
-
ms: TimestampType;
|
|
4
|
-
};
|
|
5
|
-
export type RateLimiterResultSuccessType = {
|
|
6
|
-
allowed: true;
|
|
7
|
-
};
|
|
8
|
-
export type RateLimiterResultErrorType = {
|
|
9
|
-
allowed: false;
|
|
10
|
-
remainingMs: TimestampType;
|
|
11
|
-
};
|
|
12
|
-
export type RateLimiterResultType = RateLimiterResultSuccessType | RateLimiterResultErrorType;
|
|
13
|
-
export declare class RateLimiter {
|
|
14
|
-
private readonly options;
|
|
15
|
-
private lastInvocationTimestampMs;
|
|
16
|
-
constructor(options: RateLimiterOptionsType);
|
|
17
|
-
verify(currentTimestampMs: TimestampType): RateLimiterResultType;
|
|
18
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { HTTPException } from "hono/http-exception";
|
|
2
|
-
import { z } from "zod/v4";
|
|
3
|
-
export declare const RecaptchaSiteKey: z.ZodString;
|
|
4
|
-
export type RecaptchaSiteKeyType = z.infer<typeof RecaptchaSiteKey>;
|
|
5
|
-
export declare const RecaptchaSecretKey: z.ZodString;
|
|
6
|
-
export type RecaptchaSecretKeyType = z.infer<typeof RecaptchaSecretKey>;
|
|
7
|
-
export type RecaptchaVerifierConfigType = {
|
|
8
|
-
secretKey: RecaptchaSecretKeyType;
|
|
9
|
-
};
|
|
10
|
-
export type RecaptchaResultType = {
|
|
11
|
-
success: boolean;
|
|
12
|
-
score: number;
|
|
13
|
-
};
|
|
14
|
-
export declare const AccessDeniedRecaptchaError: HTTPException;
|
|
15
|
-
export declare class RecaptchaShield {
|
|
16
|
-
private readonly secretKey;
|
|
17
|
-
constructor(config: RecaptchaVerifierConfigType);
|
|
18
|
-
build: import("hono").MiddlewareHandler<any, string, {}>;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=recaptcha-shield.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"recaptcha-shield.d.ts","sourceRoot":"","sources":["../src/recaptcha-shield.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,eAAO,MAAM,gBAAgB,aAA+B,CAAC;AAE7D,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEpE,eAAO,MAAM,kBAAkB,aAA+B,CAAC;AAE/D,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAExE,MAAM,MAAM,2BAA2B,GAAG;IACxC,SAAS,EAAE,sBAAsB,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,0BAA0B,eAErC,CAAC;AAEH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA2C;gBAEzD,MAAM,EAAE,2BAA2B;IAI/C,KAAK,oDA0CF;CACJ"}
|
package/dist/recaptcha-shield.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { createMiddleware } from "hono/factory";
|
|
2
|
-
import { HTTPException } from "hono/http-exception";
|
|
3
|
-
import { z } from "zod/v4";
|
|
4
|
-
export const RecaptchaSiteKey = z.string().trim().length(40);
|
|
5
|
-
export const RecaptchaSecretKey = z.string().trim().length(40);
|
|
6
|
-
export const AccessDeniedRecaptchaError = new HTTPException(403, {
|
|
7
|
-
message: "access_denied_recaptcha",
|
|
8
|
-
});
|
|
9
|
-
export class RecaptchaShield {
|
|
10
|
-
secretKey;
|
|
11
|
-
constructor(config) {
|
|
12
|
-
this.secretKey = config.secretKey;
|
|
13
|
-
}
|
|
14
|
-
build = createMiddleware(async (c, next) => {
|
|
15
|
-
try {
|
|
16
|
-
const recaptchaTokenHeader = c.req.header("x-recaptcha-token");
|
|
17
|
-
const recaptchaTokenQuery = c.req.query("recaptchaToken");
|
|
18
|
-
const form = await c.req.formData();
|
|
19
|
-
const recaptchaTokenFormData = form.get("g-recaptcha-response")?.toString();
|
|
20
|
-
const xForwardedForHeader = c.req.header("x-forwarded-for");
|
|
21
|
-
// cSpell:ignore remoteip
|
|
22
|
-
const remoteip = xForwardedForHeader ?? "";
|
|
23
|
-
const token = recaptchaTokenHeader ?? recaptchaTokenQuery ?? recaptchaTokenFormData;
|
|
24
|
-
if (!token) {
|
|
25
|
-
throw AccessDeniedRecaptchaError;
|
|
26
|
-
}
|
|
27
|
-
const params = new URLSearchParams({
|
|
28
|
-
secret: this.secretKey,
|
|
29
|
-
response: token,
|
|
30
|
-
remoteip,
|
|
31
|
-
});
|
|
32
|
-
const response = await fetch("https://www.google.com/recaptcha/api/siteverify", {
|
|
33
|
-
method: "POST",
|
|
34
|
-
headers: {
|
|
35
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
36
|
-
},
|
|
37
|
-
body: params,
|
|
38
|
-
});
|
|
39
|
-
const result = (await response.json());
|
|
40
|
-
if (!result.success || result.score < 0.5) {
|
|
41
|
-
throw AccessDeniedRecaptchaError;
|
|
42
|
-
}
|
|
43
|
-
await next();
|
|
44
|
-
}
|
|
45
|
-
catch (error) {
|
|
46
|
-
throw AccessDeniedRecaptchaError;
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=recaptcha-shield.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"recaptcha-shield.js","sourceRoot":"","sources":["../src/recaptcha-shield.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAI7D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAa/D,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,aAAa,CAAC,GAAG,EAAE;IAC/D,OAAO,EAAE,yBAAyB;CACnC,CAAC,CAAC;AAEH,MAAM,OAAO,eAAe;IACT,SAAS,CAA2C;IAErE,YAAY,MAAmC;QAC7C,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;IACpC,CAAC;IAED,KAAK,GAAG,gBAAgB,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE;QACzC,IAAI,CAAC;YACH,MAAM,oBAAoB,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;YAC/D,MAAM,mBAAmB,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YAE1D,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;YACpC,MAAM,sBAAsB,GAAG,IAAI,CAAC,GAAG,CAAC,sBAAsB,CAAC,EAAE,QAAQ,EAAE,CAAC;YAE5E,MAAM,mBAAmB,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;YAC5D,yBAAyB;YACzB,MAAM,QAAQ,GAAG,mBAAmB,IAAI,EAAE,CAAC;YAE3C,MAAM,KAAK,GAAG,oBAAoB,IAAI,mBAAmB,IAAI,sBAAsB,CAAC;YAEpF,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,MAAM,0BAA0B,CAAC;YACnC,CAAC;YAED,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;gBACjC,MAAM,EAAE,IAAI,CAAC,SAAS;gBACtB,QAAQ,EAAE,KAAK;gBACf,QAAQ;aACT,CAAC,CAAC;YAEH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,iDAAiD,EAAE;gBAC9E,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACP,cAAc,EAAE,mCAAmC;iBACpD;gBACD,IAAI,EAAE,MAAM;aACb,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAwB,CAAC;YAE9D,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,KAAK,GAAG,GAAG,EAAE,CAAC;gBAC1C,MAAM,0BAA0B,CAAC;YACnC,CAAC;YAED,MAAM,IAAI,EAAE,CAAC;QACf,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,0BAA0B,CAAC;QACnC,CAAC;IACH,CAAC,CAAC,CAAC;CACJ"}
|
package/dist/redirector.d.ts
DELETED
package/dist/reordering.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import * as Schema from "./schema";
|
|
2
|
-
export type WithReorderingPositionValue<T> = T & {
|
|
3
|
-
position: Schema.ReorderingItemPositionValueType;
|
|
4
|
-
};
|
|
5
|
-
export declare class ReorderingPosition {
|
|
6
|
-
readonly value: Schema.ReorderingItemPositionValueType;
|
|
7
|
-
constructor(value: Schema.ReorderingItemPositionValueType);
|
|
8
|
-
eq(another: ReorderingPosition): boolean;
|
|
9
|
-
}
|
|
10
|
-
declare class ReorderingItem {
|
|
11
|
-
readonly id: Schema.ReorderingItemIdType;
|
|
12
|
-
readonly position: ReorderingPosition;
|
|
13
|
-
constructor(id: Schema.ReorderingItemIdType, position: ReorderingPosition);
|
|
14
|
-
eq(anotherItemId: ReorderingItem["id"]): boolean;
|
|
15
|
-
}
|
|
16
|
-
declare enum ReorderingTransferDirection {
|
|
17
|
-
upwards = "upwards",
|
|
18
|
-
downwards = "downwards",
|
|
19
|
-
noop = "noop"
|
|
20
|
-
}
|
|
21
|
-
export declare class ReorderingTransfer {
|
|
22
|
-
readonly id: ReorderingItem["id"];
|
|
23
|
-
readonly to: ReorderingPosition;
|
|
24
|
-
constructor(config: {
|
|
25
|
-
id: ReorderingItem["id"];
|
|
26
|
-
to: Schema.ReorderingItemPositionValueType;
|
|
27
|
-
});
|
|
28
|
-
getDirection(currentPosition: ReorderingPosition): ReorderingTransferDirection;
|
|
29
|
-
}
|
|
30
|
-
export declare class ReorderingCalculator {
|
|
31
|
-
private dll;
|
|
32
|
-
constructor();
|
|
33
|
-
static fromArray(ids: ReorderingItem["id"][]): ReorderingCalculator;
|
|
34
|
-
add(id: ReorderingItem["id"]): ReorderingItem;
|
|
35
|
-
delete(id: ReorderingItem["id"]): void;
|
|
36
|
-
transfer(transfer: ReorderingTransfer): ReturnType<ReorderingCalculator["read"]>;
|
|
37
|
-
read(): {
|
|
38
|
-
ids: string[];
|
|
39
|
-
items: ReorderingItem[];
|
|
40
|
-
};
|
|
41
|
-
private recalculate;
|
|
42
|
-
}
|
|
43
|
-
export declare class ReorderingIntegrator {
|
|
44
|
-
static appendPosition(reordering: Schema.ReorderingType[]): <T extends {
|
|
45
|
-
id: Schema.ReorderingItemIdType;
|
|
46
|
-
}>(item: T) => WithReorderingPositionValue<T>;
|
|
47
|
-
static sortByPosition(): (a: WithReorderingPositionValue<unknown>, b: WithReorderingPositionValue<unknown>) => number;
|
|
48
|
-
}
|
|
49
|
-
export {};
|
package/dist/request-id.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import express from "express";
|
|
2
|
-
import * as Schema from "./schema";
|
|
3
|
-
declare global {
|
|
4
|
-
namespace Express {
|
|
5
|
-
interface Request {
|
|
6
|
-
requestId: Schema.CorrelationIdType;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export declare class RequestId {
|
|
11
|
-
static CONTINUE_HEADER: string;
|
|
12
|
-
static applyTo(app: express.Application): void;
|
|
13
|
-
}
|
package/dist/revision.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as Schema from "./schema";
|
|
2
|
-
import { ETag, WeakETag } from "./etag";
|
|
3
|
-
export declare class Revision {
|
|
4
|
-
readonly value: Schema.RevisionType;
|
|
5
|
-
static initial: Schema.RevisionType;
|
|
6
|
-
constructor(value: unknown);
|
|
7
|
-
matches(another: Schema.RevisionType): boolean;
|
|
8
|
-
validate(another: Schema.RevisionType): void;
|
|
9
|
-
next(): Revision;
|
|
10
|
-
static fromETag(etag: ETag | null): Revision;
|
|
11
|
-
static fromWeakETag(weakEtag: WeakETag | null): Revision;
|
|
12
|
-
}
|
package/dist/rounding.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare abstract class RoundingStrategy {
|
|
2
|
-
abstract round(value: number): number;
|
|
3
|
-
}
|
|
4
|
-
export declare class RoundToNearest extends RoundingStrategy {
|
|
5
|
-
round(value: number): number;
|
|
6
|
-
}
|
|
7
|
-
export declare class RoundUp extends RoundingStrategy {
|
|
8
|
-
round(value: number): number;
|
|
9
|
-
}
|
|
10
|
-
export declare class RoundDown extends RoundingStrategy {
|
|
11
|
-
round(value: number): number;
|
|
12
|
-
}
|
|
13
|
-
export declare class RoundToDecimal extends RoundingStrategy {
|
|
14
|
-
private readonly decimals;
|
|
15
|
-
constructor(decimals: number);
|
|
16
|
-
round(value: number): number;
|
|
17
|
-
}
|
package/dist/schema.d.ts
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
/** @public */
|
|
3
|
-
export declare enum NodeEnvironmentEnum {
|
|
4
|
-
local = "local",
|
|
5
|
-
test = "test",
|
|
6
|
-
staging = "staging",
|
|
7
|
-
production = "production"
|
|
8
|
-
}
|
|
9
|
-
export declare const NodeEnvironment: z.ZodNativeEnum<typeof NodeEnvironmentEnum>;
|
|
10
|
-
export declare const Port: z.ZodNumber;
|
|
11
|
-
export type PortType = z.infer<typeof Port>;
|
|
12
|
-
export declare const HCaptchaSecretKey: z.ZodString;
|
|
13
|
-
export declare const HCaptchaSiteKey: z.ZodString;
|
|
14
|
-
export declare const HCaptchaResponseToken: z.ZodString;
|
|
15
|
-
export declare const UUID: z.ZodDefault<z.ZodString>;
|
|
16
|
-
export type UUIDType = z.infer<typeof UUID>;
|
|
17
|
-
export declare const SmtpHost: z.ZodString;
|
|
18
|
-
export type SmtpHostType = z.infer<typeof SmtpHost>;
|
|
19
|
-
export declare const SmtpPort: z.ZodNumber;
|
|
20
|
-
export type SmtpPortType = z.infer<typeof SmtpPort>;
|
|
21
|
-
export declare const SmtpUser: z.ZodString;
|
|
22
|
-
export type SmtpUserType = z.infer<typeof SmtpUser>;
|
|
23
|
-
export declare const SmtpPass: z.ZodString;
|
|
24
|
-
export type SmtpPassType = z.infer<typeof SmtpPass>;
|
|
25
|
-
export declare const Email: z.ZodString;
|
|
26
|
-
export type EmailType = z.infer<typeof Email>;
|
|
27
|
-
export declare const CookieSecret: z.ZodString;
|
|
28
|
-
export type CookieSecretType = z.infer<typeof CookieSecret>;
|
|
29
|
-
export declare const ContentfulSpaceId: z.ZodString;
|
|
30
|
-
export type ContentfulSpaceIdType = z.infer<typeof ContentfulSpaceId>;
|
|
31
|
-
export declare const ContentfulAccessToken: z.ZodString;
|
|
32
|
-
export type ContentfulAccessTokenType = z.infer<typeof ContentfulAccessToken>;
|
|
33
|
-
export declare const UrlWithoutTrailingSlash: z.ZodEffects<z.ZodString, string, string>;
|
|
34
|
-
export type UrlWithoutTrailingSlashType = z.infer<typeof UrlWithoutTrailingSlash>;
|
|
35
|
-
export declare const TwitterApiBearerToken: z.ZodString;
|
|
36
|
-
export type TwitterApiBearerTokenType = z.infer<typeof TwitterApiBearerToken>;
|
|
37
|
-
export declare const ApiKey: z.ZodString;
|
|
38
|
-
export type ApiKeyType = z.infer<typeof ApiKey>;
|
|
39
|
-
export declare const TwitterAppKey: z.ZodString;
|
|
40
|
-
export type TwitterAppKeyType = z.infer<typeof TwitterAppKey>;
|
|
41
|
-
export declare const TwitterAppSecret: z.ZodString;
|
|
42
|
-
export type TwitterAppSecretType = z.infer<typeof TwitterAppSecret>;
|
|
43
|
-
export declare const TwitterAccessToken: z.ZodString;
|
|
44
|
-
export type TwitterAccessTokenType = z.infer<typeof TwitterAccessToken>;
|
|
45
|
-
export declare const TwitterAccessSecret: z.ZodString;
|
|
46
|
-
export type TwitterAccessSecretType = z.infer<typeof TwitterAccessSecret>;
|
|
47
|
-
export declare const RecaptchaSiteKey: z.ZodString;
|
|
48
|
-
export type RecaptchaSiteKeyType = z.infer<typeof RecaptchaSiteKey>;
|
|
49
|
-
export declare const RecaptchaSecretKey: z.ZodString;
|
|
50
|
-
export type RecaptchaSecretKeyType = z.infer<typeof RecaptchaSecretKey>;
|
|
51
|
-
export declare enum FeatureFlagEnum {
|
|
52
|
-
yes = "yes",
|
|
53
|
-
no = "no"
|
|
54
|
-
}
|
|
55
|
-
export declare const FeatureFlag: z.ZodNativeEnum<typeof FeatureFlagEnum>;
|
|
56
|
-
export type FeatureFlagType = z.infer<typeof FeatureFlag>;
|
|
57
|
-
export declare const Localhost: z.ZodLiteral<"127.0.0.1">;
|
|
58
|
-
export type LocalhostType = z.infer<typeof Localhost>;
|
|
59
|
-
export declare const AdminUsername: z.ZodString;
|
|
60
|
-
export type AdminUsernameType = z.infer<typeof AdminUsername>;
|
|
61
|
-
export declare const AdminPassword: z.ZodString;
|
|
62
|
-
export type AdminPasswordType = z.infer<typeof AdminPassword>;
|
|
63
|
-
export declare const Path: z.ZodBranded<z.ZodString, "path">;
|
|
64
|
-
export type PathType = z.infer<typeof Path>;
|
|
65
|
-
export declare const Timestamp: z.ZodDefault<z.ZodNumber>;
|
|
66
|
-
export type TimestampType = z.infer<typeof Timestamp>;
|
|
67
|
-
export declare const SizeInBytes: z.ZodBranded<z.ZodNumber, "size-in-bytes">;
|
|
68
|
-
export type SizeInBytesType = z.infer<typeof SizeInBytes>;
|
|
69
|
-
export declare const UploadedFile: z.ZodObject<{
|
|
70
|
-
fieldName: z.ZodString;
|
|
71
|
-
originalFilename: z.ZodString;
|
|
72
|
-
path: z.ZodBranded<z.ZodString, "path">;
|
|
73
|
-
headers: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
74
|
-
size: z.ZodBranded<z.ZodNumber, "size-in-bytes">;
|
|
75
|
-
}, "strip", z.ZodTypeAny, {
|
|
76
|
-
path: string & z.BRAND<"path">;
|
|
77
|
-
fieldName: string;
|
|
78
|
-
originalFilename: string;
|
|
79
|
-
headers: Record<string, string>;
|
|
80
|
-
size: number & z.BRAND<"size-in-bytes">;
|
|
81
|
-
}, {
|
|
82
|
-
path: string;
|
|
83
|
-
fieldName: string;
|
|
84
|
-
originalFilename: string;
|
|
85
|
-
headers: Record<string, string>;
|
|
86
|
-
size: number;
|
|
87
|
-
}>;
|
|
88
|
-
export type UploadedFileType = z.infer<typeof UploadedFile>;
|
|
89
|
-
export declare const TimeZoneOffsetHeaderValue: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodUndefined]>, number, string | undefined>, number, string | undefined>;
|
|
90
|
-
export type TimeZoneOffsetType = z.infer<typeof TimeZoneOffsetHeaderValue>;
|
|
91
|
-
export declare const TimeZoneOffsetValue: z.ZodNumber;
|
|
92
|
-
export type TimeZoneOffsetValueType = z.infer<typeof TimeZoneOffsetValue>;
|
|
93
|
-
export declare const Language: z.ZodDefault<z.ZodString>;
|
|
94
|
-
export type LanguageType = z.infer<typeof Language>;
|
|
95
|
-
export declare const Width: z.ZodBranded<z.ZodNumber, "width">;
|
|
96
|
-
export type WidthType = z.infer<typeof Width>;
|
|
97
|
-
export declare const Height: z.ZodBranded<z.ZodNumber, "height">;
|
|
98
|
-
export type HeightType = z.infer<typeof Height>;
|
|
99
|
-
export declare const ImageCompressionQuality: z.ZodBranded<z.ZodDefault<z.ZodNumber>, "image-compression-quality">;
|
|
100
|
-
export type ImageCompressionQualityType = z.infer<typeof ImageCompressionQuality>;
|
|
101
|
-
export declare const OpenGraphTitleValue: z.ZodString;
|
|
102
|
-
export type OpenGraphTitleValueType = z.infer<typeof OpenGraphTitleValue>;
|
|
103
|
-
export declare const OpenGraphDescriptionValue: z.ZodString;
|
|
104
|
-
export type OpenGraphDescriptionValueType = z.infer<typeof OpenGraphDescriptionValue>;
|
|
105
|
-
export declare const OpenGraphUrlValue: z.ZodString;
|
|
106
|
-
export type OpenGraphUrlValueType = z.infer<typeof OpenGraphUrlValue>;
|
|
107
|
-
export declare const OpenGraphTypeValue: z.ZodUnion<[z.ZodLiteral<"website">, z.ZodLiteral<"article">]>;
|
|
108
|
-
export type OpenGraphTypeValueType = z.infer<typeof OpenGraphTypeValue>;
|
|
109
|
-
export declare const OpenGraphImageUrlValue: z.ZodString;
|
|
110
|
-
export type OpenGraphImageUrlValueType = z.infer<typeof OpenGraphImageUrlValue>;
|
|
111
|
-
export declare const OpenGraphImageTypeValue: z.ZodString;
|
|
112
|
-
export type OpenGraphImageTypeValueType = z.infer<typeof OpenGraphImageTypeValue>;
|
|
113
|
-
export declare const OpenGraphImageWidthValue: z.ZodEffects<z.ZodBranded<z.ZodNumber, "width">, number & z.BRAND<"width">, number>;
|
|
114
|
-
export type OpenGraphImageWidthValueType = z.infer<typeof OpenGraphImageWidthValue>;
|
|
115
|
-
export declare const OpenGraphImageHeightValue: z.ZodEffects<z.ZodBranded<z.ZodNumber, "height">, number & z.BRAND<"height">, number>;
|
|
116
|
-
export type OpenGraphImageHeightValueType = z.infer<typeof OpenGraphImageHeightValue>;
|
|
117
|
-
export declare const CorrelationId: z.ZodBranded<z.ZodDefault<z.ZodString>, "correlation-id">;
|
|
118
|
-
export type CorrelationIdType = z.infer<typeof CorrelationId>;
|
|
119
|
-
export declare enum LogLevelEnum {
|
|
120
|
-
/** @public */
|
|
121
|
-
silent = "silent",
|
|
122
|
-
error = "error",
|
|
123
|
-
warn = "warn",
|
|
124
|
-
info = "info",
|
|
125
|
-
http = "http",
|
|
126
|
-
verbose = "verbose"
|
|
127
|
-
}
|
|
128
|
-
export declare const LogLevel: z.ZodNativeEnum<typeof LogLevelEnum>;
|
|
129
|
-
export declare const AuthorizationHeader: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, {
|
|
130
|
-
username: string;
|
|
131
|
-
password: string;
|
|
132
|
-
}, string>;
|
|
133
|
-
export type AuthorizationHeaderType = z.infer<typeof AuthorizationHeader>;
|
|
134
|
-
export declare const BasicAuthUsername: z.ZodBranded<z.ZodString, "basic-auth-username">;
|
|
135
|
-
export type BasicAuthUsernameType = z.infer<typeof BasicAuthUsername>;
|
|
136
|
-
export declare const BasicAuthPassword: z.ZodBranded<z.ZodString, "basic-auth-password">;
|
|
137
|
-
export type BasicAuthPasswordType = z.infer<typeof BasicAuthPassword>;
|
|
138
|
-
export declare const EmailSubject: z.ZodBranded<z.ZodString, "email-subject">;
|
|
139
|
-
export type EmailSubjectType = z.infer<typeof EmailSubject>;
|
|
140
|
-
export declare const EmailContentHtml: z.ZodBranded<z.ZodString, "email-content-html">;
|
|
141
|
-
export type EmailContentHtmlType = z.infer<typeof EmailContentHtml>;
|
|
142
|
-
export declare const EmailTo: z.ZodBranded<z.ZodString, "email-to">;
|
|
143
|
-
export type EmailToType = z.infer<typeof EmailTo>;
|
|
144
|
-
export declare const EmailAttachment: z.ZodBranded<z.ZodObject<{
|
|
145
|
-
filename: z.ZodBranded<z.ZodString, "path">;
|
|
146
|
-
path: z.ZodBranded<z.ZodString, "path">;
|
|
147
|
-
}, "strip", z.ZodTypeAny, {
|
|
148
|
-
path: string & z.BRAND<"path">;
|
|
149
|
-
filename: string & z.BRAND<"path">;
|
|
150
|
-
}, {
|
|
151
|
-
path: string;
|
|
152
|
-
filename: string;
|
|
153
|
-
}>, "email-attachment">;
|
|
154
|
-
export type EmailAttachmentType = z.infer<typeof EmailAttachment>;
|
|
155
|
-
export declare const hours: number[];
|
|
156
|
-
export declare const Hour: z.ZodEffects<z.ZodNumber, number, number>;
|
|
157
|
-
export type HourType = z.infer<typeof Hour>;
|
|
158
|
-
export declare const Timezone: z.ZodEffects<z.ZodString, string, string>;
|
|
159
|
-
export type TimezoneType = z.infer<typeof Timezone>;
|
|
160
|
-
export declare const TimezoneUTC: z.ZodLiteral<"UTC">;
|
|
161
|
-
export type TimezoneUTCType = z.infer<typeof TimezoneUTC>;
|
|
162
|
-
export declare const BuildVersion: z.ZodBranded<z.ZodString, "build-version">;
|
|
163
|
-
export type BuildVersionType = z.infer<typeof BuildVersion>;
|
|
164
|
-
export declare const EncryptionIV: z.ZodEffects<z.ZodString, Buffer, string>;
|
|
165
|
-
export type EncryptionIVType = z.infer<typeof EncryptionIV>;
|
|
166
|
-
export declare const EncryptionSecret: z.ZodString;
|
|
167
|
-
export type EncryptionSecretType = z.infer<typeof EncryptionSecret>;
|
|
168
|
-
export declare const ReorderingItemPositionValue: z.ZodNumber;
|
|
169
|
-
export type ReorderingItemPositionValueType = z.infer<typeof ReorderingItemPositionValue>;
|
|
170
|
-
export declare const ReorderingCorrelationId: z.ZodString;
|
|
171
|
-
export type ReorderingCorrelationIdType = z.infer<typeof ReorderingCorrelationId>;
|
|
172
|
-
export declare const ReorderingItemId: z.ZodDefault<z.ZodString>;
|
|
173
|
-
export type ReorderingItemIdType = z.infer<typeof ReorderingItemId>;
|
|
174
|
-
export declare const Reordering: z.ZodObject<{
|
|
175
|
-
correlationId: z.ZodString;
|
|
176
|
-
id: z.ZodDefault<z.ZodString>;
|
|
177
|
-
position: z.ZodNumber;
|
|
178
|
-
}, "strip", z.ZodTypeAny, {
|
|
179
|
-
correlationId: string;
|
|
180
|
-
id: string;
|
|
181
|
-
position: number;
|
|
182
|
-
}, {
|
|
183
|
-
correlationId: string;
|
|
184
|
-
position: number;
|
|
185
|
-
id?: string | undefined;
|
|
186
|
-
}>;
|
|
187
|
-
export type ReorderingType = z.infer<typeof Reordering>;
|
|
188
|
-
export declare const Revision: z.ZodNumber;
|
|
189
|
-
export type RevisionType = z.infer<typeof Revision>;
|
package/dist/server-timing.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import express from "express";
|
|
2
|
-
export declare class ServerTiming {
|
|
3
|
-
static HEADER: string;
|
|
4
|
-
static MS_HEADER: string;
|
|
5
|
-
static applyTo(app: express.Application): void;
|
|
6
|
-
static handle(_request: express.Request, response: express.Response, next: express.NextFunction): Promise<void>;
|
|
7
|
-
}
|