@bgord/bun 0.8.2 → 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/package.json +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
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as tools from "@bgord/tools";
|
|
2
|
-
import { createMiddleware } from "hono/factory";
|
|
3
|
-
export var CacheStaticFilesStrategy;
|
|
4
|
-
(function (CacheStaticFilesStrategy) {
|
|
5
|
-
CacheStaticFilesStrategy["never"] = "never";
|
|
6
|
-
CacheStaticFilesStrategy["always"] = "always";
|
|
7
|
-
CacheStaticFilesStrategy["five_minutes"] = "five_minutes";
|
|
8
|
-
})(CacheStaticFilesStrategy || (CacheStaticFilesStrategy = {}));
|
|
9
|
-
export class CacheStaticFiles {
|
|
10
|
-
static handle(strategy) {
|
|
11
|
-
return createMiddleware(async (c, next) => {
|
|
12
|
-
if (strategy === CacheStaticFilesStrategy.never) {
|
|
13
|
-
c.res.headers.set("cache-control", "private, no-cache, no-store, must-revalidate");
|
|
14
|
-
}
|
|
15
|
-
if (strategy === CacheStaticFilesStrategy.always) {
|
|
16
|
-
c.res.headers.set("cache-control", `public, max-age=${tools.Time.Days(365).seconds}, immutable`);
|
|
17
|
-
}
|
|
18
|
-
if (strategy === CacheStaticFilesStrategy.five_minutes) {
|
|
19
|
-
c.res.headers.set("cache-control", `public, max-age=${tools.Time.Minutes(5).seconds}`);
|
|
20
|
-
}
|
|
21
|
-
return next();
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=cache-static-files.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cache-static-files.js","sourceRoot":"","sources":["../src/cache-static-files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,CAAN,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,2CAAe,CAAA;IACf,6CAAiB,CAAA;IACjB,yDAA6B,CAAA;AAC/B,CAAC,EAJW,wBAAwB,KAAxB,wBAAwB,QAInC;AAED,MAAM,OAAO,gBAAgB;IAC3B,MAAM,CAAC,MAAM,CAAC,QAAkC;QAC9C,OAAO,gBAAgB,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE;YACxC,IAAI,QAAQ,KAAK,wBAAwB,CAAC,KAAK,EAAE,CAAC;gBAChD,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,8CAA8C,CAAC,CAAC;YACrF,CAAC;YACD,IAAI,QAAQ,KAAK,wBAAwB,CAAC,MAAM,EAAE,CAAC;gBACjD,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,mBAAmB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,aAAa,CAAC,CAAC;YACnG,CAAC;YACD,IAAI,QAAQ,KAAK,wBAAwB,CAAC,YAAY,EAAE,CAAC;gBACvD,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,mBAAmB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YACzF,CAAC;YACD,OAAO,IAAI,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/dist/cache.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const Cache: typeof import("node-cache");
|
package/dist/clock.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
export type HourFormatter = (value: Hour["value"]) => string;
|
|
2
|
-
export declare const HourFormatters: Record<string, HourFormatter>;
|
|
3
|
-
export declare class Hour {
|
|
4
|
-
private readonly value;
|
|
5
|
-
private readonly formatter;
|
|
6
|
-
static readonly ZERO: Hour;
|
|
7
|
-
static readonly MAX: Hour;
|
|
8
|
-
constructor(candidate: number, formatter?: HourFormatter);
|
|
9
|
-
get(formatter?: HourFormatter): {
|
|
10
|
-
raw: number;
|
|
11
|
-
formatted: string;
|
|
12
|
-
};
|
|
13
|
-
equals(another: Hour): boolean;
|
|
14
|
-
isAfter(another: Hour): boolean;
|
|
15
|
-
isBefore(another: Hour): boolean;
|
|
16
|
-
static list(formatter?: HourFormatter): Hour[];
|
|
17
|
-
}
|
|
18
|
-
export declare class Minute {
|
|
19
|
-
private readonly value;
|
|
20
|
-
static readonly ZERO: Minute;
|
|
21
|
-
static readonly MAX: Minute;
|
|
22
|
-
constructor(candidate: number);
|
|
23
|
-
get(): {
|
|
24
|
-
raw: number;
|
|
25
|
-
formatted: string;
|
|
26
|
-
};
|
|
27
|
-
equals(another: Minute): boolean;
|
|
28
|
-
isAfter(another: Minute): boolean;
|
|
29
|
-
isBefore(another: Minute): boolean;
|
|
30
|
-
static list(): Minute[];
|
|
31
|
-
}
|
|
32
|
-
export type ClockFormatter = (hour: Hour, minute: Minute) => string;
|
|
33
|
-
export declare const ClockFormatters: Record<string, ClockFormatter>;
|
|
34
|
-
export declare class Clock {
|
|
35
|
-
private readonly hour;
|
|
36
|
-
private readonly minute;
|
|
37
|
-
private readonly formatter;
|
|
38
|
-
constructor(hour: Hour, minute: Minute, formatter?: ClockFormatter);
|
|
39
|
-
get(formatter?: ClockFormatter): {
|
|
40
|
-
raw: {
|
|
41
|
-
hour: number;
|
|
42
|
-
minute: number;
|
|
43
|
-
};
|
|
44
|
-
formatted: string;
|
|
45
|
-
};
|
|
46
|
-
equals(another: Clock): boolean;
|
|
47
|
-
isAfter(another: Clock): boolean;
|
|
48
|
-
isBefore(another: Clock): boolean;
|
|
49
|
-
}
|
package/dist/context.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CorrelationIdType } from "./correlation-id";
|
|
2
|
-
import { TimeZoneOffsetVariables } from "./time-zone-offset";
|
|
3
|
-
export type ContextType = {
|
|
4
|
-
requestId: CorrelationIdType;
|
|
5
|
-
timeZoneOffset: TimeZoneOffsetVariables["timeZoneOffset"];
|
|
6
|
-
};
|
|
7
|
-
export type ContextVariables = {
|
|
8
|
-
context: ContextType;
|
|
9
|
-
requestId: CorrelationIdType;
|
|
10
|
-
} & TimeZoneOffsetVariables;
|
|
11
|
-
export declare class Context {
|
|
12
|
-
static attach: import("hono").MiddlewareHandler<any, string, {}>;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=context.d.ts.map
|
package/dist/context.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,cAAc,EAAE,uBAAuB,CAAC,gBAAgB,CAAC,CAAC;CAC3D,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,iBAAiB,CAAC;CAC9B,GAAG,uBAAuB,CAAC;AAE5B,qBAAa,OAAO;IAClB,MAAM,CAAC,MAAM,oDAOV;CACJ"}
|
package/dist/context.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createMiddleware } from "hono/factory";
|
|
2
|
-
export class Context {
|
|
3
|
-
static attach = createMiddleware(async (c, next) => {
|
|
4
|
-
c.set("context", {
|
|
5
|
-
requestId: c.get("requestId"),
|
|
6
|
-
timeZoneOffset: c.get("timeZoneOffset"),
|
|
7
|
-
});
|
|
8
|
-
await next();
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=context.js.map
|
package/dist/context.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAehD,MAAM,OAAO,OAAO;IAClB,MAAM,CAAC,MAAM,GAAG,gBAAgB,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE;QACjD,CAAC,CAAC,GAAG,CAAC,SAAS,EAAE;YACf,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,WAAW,CAAsB;YAClD,cAAc,EAAE,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC;SACxC,CAAC,CAAC;QAEH,MAAM,IAAI,EAAE,CAAC;IACf,CAAC,CAAC,CAAC"}
|
package/dist/correlation-id.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"correlation-id.d.ts","sourceRoot":"","sources":["../src/correlation-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAI3B,eAAO,MAAM,aAAa,yBAAO,CAAC;AAElC,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
package/dist/correlation-id.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"correlation-id.js","sourceRoot":"","sources":["../src/correlation-id.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC"}
|
package/dist/credentials.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
export type IdType = string;
|
|
3
|
-
export type PasswordType = string;
|
|
4
|
-
type UsernameType = string;
|
|
5
|
-
type HashedPasswordType = string;
|
|
6
|
-
export declare class Username {
|
|
7
|
-
private readonly schema;
|
|
8
|
-
private readonly value;
|
|
9
|
-
constructor(value: UsernameType, schema?: z.ZodSchema);
|
|
10
|
-
read(): UsernameType;
|
|
11
|
-
}
|
|
12
|
-
export declare class Password {
|
|
13
|
-
private schema;
|
|
14
|
-
private value;
|
|
15
|
-
constructor(value: PasswordType, schema?: z.ZodSchema);
|
|
16
|
-
hash(): Promise<HashedPassword>;
|
|
17
|
-
read(): PasswordType;
|
|
18
|
-
}
|
|
19
|
-
export declare class HashedPassword {
|
|
20
|
-
private value;
|
|
21
|
-
private constructor();
|
|
22
|
-
static fromPassword(password: Password): Promise<HashedPassword>;
|
|
23
|
-
static fromHash(value: HashedPasswordType): Promise<HashedPassword>;
|
|
24
|
-
read(): HashedPasswordType;
|
|
25
|
-
matches(password: Password): Promise<boolean>;
|
|
26
|
-
matchesOrThrow(password: Password): Promise<true>;
|
|
27
|
-
}
|
|
28
|
-
export {};
|
package/dist/dates.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { format } from "date-fns";
|
|
2
|
-
import * as Schema from "./schema";
|
|
3
|
-
import { Falsy } from "./ts-utils";
|
|
4
|
-
export type FormattedDateType = string;
|
|
5
|
-
export type DateFormattersInputType = Parameters<typeof format>[0];
|
|
6
|
-
export declare class DateFormatters {
|
|
7
|
-
static datetime(date: DateFormattersInputType): FormattedDateType;
|
|
8
|
-
static date(date: DateFormattersInputType): FormattedDateType;
|
|
9
|
-
static monthDay(date: DateFormattersInputType): FormattedDateType;
|
|
10
|
-
static relative(date: DateFormattersInputType): string;
|
|
11
|
-
}
|
|
12
|
-
export type RelativeDateType = {
|
|
13
|
-
raw: Schema.TimestampType;
|
|
14
|
-
relative: string;
|
|
15
|
-
};
|
|
16
|
-
export declare class RelativeDate {
|
|
17
|
-
static truthy(timestampMs: Schema.TimestampType): RelativeDateType;
|
|
18
|
-
static falsy(timestampMs: Falsy<Schema.TimestampType>): RelativeDateType | null;
|
|
19
|
-
private static _format;
|
|
20
|
-
}
|
|
21
|
-
export declare enum DayOfTheWeekEnum {
|
|
22
|
-
Monday = 1,
|
|
23
|
-
Tuesday = 2,
|
|
24
|
-
Wednesday = 3,
|
|
25
|
-
Thursday = 4,
|
|
26
|
-
Friday = 5,
|
|
27
|
-
Saturday = 6,
|
|
28
|
-
Sunday = 0
|
|
29
|
-
}
|
|
30
|
-
type GetStartOfDayTsInTzConfigType = {
|
|
31
|
-
now: Schema.TimestampType;
|
|
32
|
-
timeZoneOffsetMs: Schema.TimeZoneOffsetValueType;
|
|
33
|
-
};
|
|
34
|
-
export declare class DateCalculator {
|
|
35
|
-
static getStartOfDayTsInTz(config: GetStartOfDayTsInTzConfigType): number;
|
|
36
|
-
}
|
|
37
|
-
export {};
|
package/dist/decorators.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Logger } from "./logger";
|
|
2
|
-
export declare class DecoratorTimeoutError extends Error {
|
|
3
|
-
}
|
|
4
|
-
export declare class Decorators {
|
|
5
|
-
private readonly logger;
|
|
6
|
-
private readonly rounding;
|
|
7
|
-
constructor(logger: Logger);
|
|
8
|
-
duration(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
9
|
-
inspector(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
10
|
-
timeout(ms: number): (_target: any, _key: string, descriptor: PropertyDescriptor) => void;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=decorators.d.ts.map
|
package/dist/decorators.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,qBAAa,qBAAsB,SAAQ,KAAK;CAAG;AAEnD,qBAAa,UAAU;IAGT,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA+B;gBAE3B,MAAM,EAAE,MAAM;IAE3C,QAAQ,KAGW,QAAQ,GAAG,EAAE,aAAa,MAAM,EAAE,YAAY,kBAAkB;IAyBnF,SAAS,KAGU,QAAQ,GAAG,EAAE,aAAa,MAAM,EAAE,YAAY,kBAAkB;IAuBnF,OAAO,CAAC,EAAE,EAAE,MAAM,IACR,SAAS,GAAG,EAAE,MAAM,MAAM,EAAE,YAAY,kBAAkB;CAWrE"}
|
package/dist/decorators.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import * as tools from "@bgord/tools";
|
|
2
|
-
export class DecoratorTimeoutError extends Error {
|
|
3
|
-
}
|
|
4
|
-
export class Decorators {
|
|
5
|
-
logger;
|
|
6
|
-
rounding = new tools.RoundToDecimal(2);
|
|
7
|
-
constructor(logger) {
|
|
8
|
-
this.logger = logger;
|
|
9
|
-
}
|
|
10
|
-
duration() {
|
|
11
|
-
const that = this;
|
|
12
|
-
return function (target, propertyKey, descriptor) {
|
|
13
|
-
const className =
|
|
14
|
-
// @ts-expect-error
|
|
15
|
-
this?.constructor?.name || target?.name || target?.constructor?.name || "UnknownClass";
|
|
16
|
-
const original = descriptor.value;
|
|
17
|
-
const label = `${className}.${propertyKey}`;
|
|
18
|
-
descriptor.value = function (...args) {
|
|
19
|
-
const before = performance.now();
|
|
20
|
-
const value = original.apply(this, args);
|
|
21
|
-
const after = performance.now();
|
|
22
|
-
that.logger.info({
|
|
23
|
-
message: `${label} duration`,
|
|
24
|
-
operation: "decorators_duration_ms",
|
|
25
|
-
metadata: { durationMs: that.rounding.round(after - before) },
|
|
26
|
-
});
|
|
27
|
-
return value;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
inspector() {
|
|
32
|
-
const that = this;
|
|
33
|
-
return function (target, propertyKey, descriptor) {
|
|
34
|
-
const className =
|
|
35
|
-
// @ts-expect-error
|
|
36
|
-
this?.constructor?.name || target?.name || target?.constructor?.name || "UnknownClass";
|
|
37
|
-
const original = descriptor.value;
|
|
38
|
-
const label = `${className}.${propertyKey}`;
|
|
39
|
-
descriptor.value = async function (...args) {
|
|
40
|
-
const value = await original.apply(this, args);
|
|
41
|
-
that.logger.info({
|
|
42
|
-
message: `${label} inspector`,
|
|
43
|
-
operation: "decorators_inspector",
|
|
44
|
-
metadata: { arguments: args, output: value },
|
|
45
|
-
});
|
|
46
|
-
return value;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
timeout(ms) {
|
|
51
|
-
return (_target, _key, descriptor) => {
|
|
52
|
-
const original = descriptor.value;
|
|
53
|
-
descriptor.value = async function (...args) {
|
|
54
|
-
return await Promise.race([
|
|
55
|
-
original.apply(this, args),
|
|
56
|
-
new Promise((_, reject) => setTimeout(() => reject(new DecoratorTimeoutError()), ms)),
|
|
57
|
-
]);
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=decorators.js.map
|
package/dist/decorators.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"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"}
|
package/dist/deep-merge.d.ts
DELETED
package/dist/dll.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export declare class Node<T> {
|
|
2
|
-
data: T;
|
|
3
|
-
prev: Node<T> | null;
|
|
4
|
-
next: Node<T> | null;
|
|
5
|
-
constructor(data: Node<T>["data"]);
|
|
6
|
-
forward(n: number): Node<T> | null;
|
|
7
|
-
backward(n: number): Node<T> | null;
|
|
8
|
-
}
|
|
9
|
-
export declare class DoublyLinkedList<T> {
|
|
10
|
-
static EMPTY_SIZE: number;
|
|
11
|
-
private size;
|
|
12
|
-
private head;
|
|
13
|
-
private tail;
|
|
14
|
-
getSize(): DoublyLinkedList<T>["size"];
|
|
15
|
-
isEmpty(): boolean;
|
|
16
|
-
getHead(): DoublyLinkedList<T>["head"];
|
|
17
|
-
getTail(): DoublyLinkedList<T>["tail"];
|
|
18
|
-
append(node: Node<T>): void;
|
|
19
|
-
prepend(node: Node<T>): void;
|
|
20
|
-
clear(): void;
|
|
21
|
-
remove(node: Node<T>): void;
|
|
22
|
-
insertAfter(node: Node<T>, target: Node<T>): void;
|
|
23
|
-
insertBefore(node: Node<T>, target: Node<T>): void;
|
|
24
|
-
find(callback: (node: Node<T>) => boolean): Node<T> | null;
|
|
25
|
-
reverse(): void;
|
|
26
|
-
toArray(): Node<T>[];
|
|
27
|
-
static fromArray<T>(array: T[]): DoublyLinkedList<T>;
|
|
28
|
-
[Symbol.iterator](): IterableIterator<Node<T>>;
|
|
29
|
-
}
|
package/dist/download-file.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { PathLike } from "node:fs";
|
|
2
|
-
import * as tools from "@bgord/tools";
|
|
3
|
-
type DownloadFileConfigType = {
|
|
4
|
-
filename: PathLike;
|
|
5
|
-
mime: tools.Mime;
|
|
6
|
-
};
|
|
7
|
-
export declare class DownloadFile {
|
|
8
|
-
static attach(config: DownloadFileConfigType): {
|
|
9
|
-
headers: Headers;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=download-file.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"download-file.d.ts","sourceRoot":"","sources":["../src/download-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,KAAK,sBAAsB,GAAG;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAA;CAAE,CAAC;AAEvE,qBAAa,YAAY;IACvB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,sBAAsB;;;CAQ7C"}
|
package/dist/download-file.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export class DownloadFile {
|
|
2
|
-
static attach(config) {
|
|
3
|
-
return {
|
|
4
|
-
headers: new Headers({
|
|
5
|
-
"Content-Disposition": `attachment; filename="${config.filename}"`,
|
|
6
|
-
"Content-Type": config.mime.raw,
|
|
7
|
-
}),
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=download-file.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"download-file.js","sourceRoot":"","sources":["../src/download-file.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,YAAY;IACvB,MAAM,CAAC,MAAM,CAAC,MAA8B;QAC1C,OAAO;YACL,OAAO,EAAE,IAAI,OAAO,CAAC;gBACnB,qBAAqB,EAAE,yBAAyB,MAAM,CAAC,QAAQ,GAAG;gBAClE,cAAc,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG;aAChC,CAAC;SACH,CAAC;IACJ,CAAC;CACF"}
|
package/dist/email-censor.d.ts
DELETED
package/dist/encryption.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as crypto from "node:crypto";
|
|
2
|
-
import * as fs from "node:fs";
|
|
3
|
-
import { z } from "zod/v4";
|
|
4
|
-
export declare const EncryptionIV: z.ZodPipe<z.ZodString, z.ZodTransform<Buffer<ArrayBuffer>, string>>;
|
|
5
|
-
export type EncryptionIVType = z.infer<typeof EncryptionIV>;
|
|
6
|
-
export declare const EncryptionSecret: z.ZodString;
|
|
7
|
-
export type EncryptionSecretType = z.infer<typeof EncryptionSecret>;
|
|
8
|
-
export type EncryptionConfig = {
|
|
9
|
-
secret: EncryptionSecretType;
|
|
10
|
-
iv: EncryptionIVType;
|
|
11
|
-
};
|
|
12
|
-
export type EncryptionOperationConfig = {
|
|
13
|
-
input: fs.PathLike;
|
|
14
|
-
output: fs.PathLike;
|
|
15
|
-
};
|
|
16
|
-
export declare class Encryption {
|
|
17
|
-
private readonly config;
|
|
18
|
-
private readonly algorithm;
|
|
19
|
-
constructor(config: EncryptionConfig);
|
|
20
|
-
createEncrypt(): Promise<crypto.Cipher>;
|
|
21
|
-
createDecrypt(): Promise<crypto.Decipher>;
|
|
22
|
-
encrypt(config: EncryptionOperationConfig): Promise<void>;
|
|
23
|
-
decrypt(config: EncryptionOperationConfig): Promise<void>;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=encryption.d.ts.map
|
package/dist/encryption.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"encryption.d.ts","sourceRoot":"","sources":["../src/encryption.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAG9B,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,eAAO,MAAM,YAAY,qEAGyC,CAAC;AAEnE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAE5D,eAAO,MAAM,gBAAgB,aAAwB,CAAC;AAEtD,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEpE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,oBAAoB,CAAC;IAC7B,EAAE,EAAE,gBAAgB,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC;IACnB,MAAM,EAAE,EAAE,CAAC,QAAQ,CAAC;CACrB,CAAC;AAIF,qBAAa,UAAU;IAGT,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAiB;gBAEd,MAAM,EAAE,gBAAgB;IAE/C,aAAa;IAOb,aAAa;IAOb,OAAO,CAAC,MAAM,EAAE,yBAAyB;IAMzC,OAAO,CAAC,MAAM,EAAE,yBAAyB;CAKhD"}
|
package/dist/encryption.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import * as crypto from "node:crypto";
|
|
2
|
-
import * as fs from "node:fs";
|
|
3
|
-
import { pipeline } from "node:stream/promises";
|
|
4
|
-
import * as util from "node:util";
|
|
5
|
-
import { z } from "zod/v4";
|
|
6
|
-
export const EncryptionIV = z
|
|
7
|
-
.string()
|
|
8
|
-
.min(1)
|
|
9
|
-
.transform((value) => Buffer.from(value.split(",").map(Number)));
|
|
10
|
-
export const EncryptionSecret = z.string().length(64);
|
|
11
|
-
const scrypt = util.promisify(crypto.scrypt);
|
|
12
|
-
export class Encryption {
|
|
13
|
-
config;
|
|
14
|
-
algorithm = "aes-192-cbc";
|
|
15
|
-
constructor(config) {
|
|
16
|
-
this.config = config;
|
|
17
|
-
}
|
|
18
|
-
async createEncrypt() {
|
|
19
|
-
const key = (await scrypt(this.config.secret, "salt", 24));
|
|
20
|
-
// @ts-ignore
|
|
21
|
-
return crypto.createCipheriv(this.algorithm, key, this.config.iv);
|
|
22
|
-
}
|
|
23
|
-
async createDecrypt() {
|
|
24
|
-
const key = (await scrypt(this.config.secret, "salt", 24));
|
|
25
|
-
// @ts-ignore
|
|
26
|
-
return crypto.createDecipheriv(this.algorithm, key, this.config.iv);
|
|
27
|
-
}
|
|
28
|
-
async encrypt(config) {
|
|
29
|
-
const encrypt = await this.createEncrypt();
|
|
30
|
-
return pipeline(fs.createReadStream(config.input), encrypt, fs.createWriteStream(config.output));
|
|
31
|
-
}
|
|
32
|
-
async decrypt(config) {
|
|
33
|
-
const decrypt = await this.createDecrypt();
|
|
34
|
-
return pipeline(fs.createReadStream(config.input), decrypt, fs.createWriteStream(config.output));
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=encryption.js.map
|
package/dist/encryption.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"encryption.js","sourceRoot":"","sources":["../src/encryption.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC;KAC1B,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAInE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AActD,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAE7C,MAAM,OAAO,UAAU;IAGQ;IAFZ,SAAS,GAAG,aAAa,CAAC;IAE3C,YAA6B,MAAwB;QAAxB,WAAM,GAAN,MAAM,CAAkB;IAAG,CAAC;IAEzD,KAAK,CAAC,aAAa;QACjB,MAAM,GAAG,GAAG,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,CAAW,CAAC;QAErE,aAAa;QACb,OAAO,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,MAAM,GAAG,GAAG,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,CAAW,CAAC;QAErE,aAAa;QACb,OAAO,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,MAAiC;QAC7C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QAE3C,OAAO,QAAQ,CAAC,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACnG,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,MAAiC;QAC7C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QAE3C,OAAO,QAAQ,CAAC,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACnG,CAAC;CACF"}
|
package/dist/env-validator.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { z } from "zod/v4";
|
|
2
|
-
import { NodeEnvironment } from "../src/node-env.vo";
|
|
3
|
-
type NodeEnvironmentEnumType = z.infer<typeof NodeEnvironment>;
|
|
4
|
-
type AnyZodSchema = z.ZodSchema<any, any>;
|
|
5
|
-
type QuitType = boolean;
|
|
6
|
-
type EnvironmentValidatorConfig = {
|
|
7
|
-
type: unknown;
|
|
8
|
-
schema: AnyZodSchema;
|
|
9
|
-
quit?: QuitType;
|
|
10
|
-
};
|
|
11
|
-
export declare class EnvironmentValidator<SchemaType> {
|
|
12
|
-
type: NodeEnvironmentEnumType;
|
|
13
|
-
schema: z.Schema<SchemaType>;
|
|
14
|
-
quit: QuitType;
|
|
15
|
-
constructor(config: EnvironmentValidatorConfig);
|
|
16
|
-
load(): SchemaType & {
|
|
17
|
-
type: NodeEnvironmentEnumType;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export {};
|
|
21
|
-
//# sourceMappingURL=env-validator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env-validator.d.ts","sourceRoot":"","sources":["../src/env-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,KAAK,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE/D,KAAK,YAAY,GAAG,CAAC,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC1C,KAAK,QAAQ,GAAG,OAAO,CAAC;AAExB,KAAK,0BAA0B,GAAG;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,YAAY,CAAC;IACrB,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB,CAAC;AAEF,qBAAa,oBAAoB,CAAC,UAAU;IAC1C,IAAI,EAAE,uBAAuB,CAAC;IAC9B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAC7B,IAAI,EAAE,QAAQ,CAAC;gBAEH,MAAM,EAAE,0BAA0B;IAiB9C,IAAI,IAAI,UAAU,GAAG;QAAE,IAAI,EAAE,uBAAuB,CAAA;KAAE;CAGvD"}
|
package/dist/env-validator.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { NodeEnvironment } from "../src/node-env.vo";
|
|
2
|
-
export class EnvironmentValidator {
|
|
3
|
-
type;
|
|
4
|
-
schema;
|
|
5
|
-
quit;
|
|
6
|
-
constructor(config) {
|
|
7
|
-
this.schema = config.schema;
|
|
8
|
-
this.quit = config?.quit ?? true;
|
|
9
|
-
const result = NodeEnvironment.safeParse(config.type);
|
|
10
|
-
if (result.success) {
|
|
11
|
-
this.type = result.data;
|
|
12
|
-
}
|
|
13
|
-
else if (this.quit) {
|
|
14
|
-
// biome-ignore lint: lint/suspicious/noConsoleLog
|
|
15
|
-
console.log(`Invalid EnvironmentType: ${config.type}`);
|
|
16
|
-
process.exit(1);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
throw new NodeEnvironmentError();
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
load() {
|
|
23
|
-
return { ...this.schema.parse(process.env), type: this.type };
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
class NodeEnvironmentError extends Error {
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=env-validator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env-validator.js","sourceRoot":"","sources":["../src/env-validator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAarD,MAAM,OAAO,oBAAoB;IAC/B,IAAI,CAA0B;IAC9B,MAAM,CAAuB;IAC7B,IAAI,CAAW;IAEf,YAAY,MAAkC;QAC5C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,MAAM,EAAE,IAAI,IAAI,IAAI,CAAC;QAEjC,MAAM,MAAM,GAAG,eAAe,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAEtD,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QAC1B,CAAC;aAAM,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,kDAAkD;YAClD,OAAO,CAAC,GAAG,CAAC,4BAA4B,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;YACvD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,oBAAoB,EAAE,CAAC;QACnC,CAAC;IACH,CAAC;IAED,IAAI;QACF,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IAChE,CAAC;CACF;AAED,MAAM,oBAAqB,SAAQ,KAAK;CAAG"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as z from "zod";
|
|
2
|
-
import { NodeEnvironment } from "./schema";
|
|
3
|
-
type NodeEnvironmentEnumType = z.infer<typeof NodeEnvironment>;
|
|
4
|
-
type AnyZodSchema = z.ZodSchema<any, any>;
|
|
5
|
-
type QuietType = boolean;
|
|
6
|
-
type QuitType = boolean;
|
|
7
|
-
type EnvironmentValidatorConfig = {
|
|
8
|
-
type: unknown;
|
|
9
|
-
schema: AnyZodSchema;
|
|
10
|
-
quiet?: QuietType;
|
|
11
|
-
quit?: QuitType;
|
|
12
|
-
};
|
|
13
|
-
export declare class EnvironmentValidator<SchemaType> {
|
|
14
|
-
type: NodeEnvironmentEnumType;
|
|
15
|
-
schema: z.Schema<SchemaType>;
|
|
16
|
-
quiet: QuietType;
|
|
17
|
-
quit: QuitType;
|
|
18
|
-
constructor(config: EnvironmentValidatorConfig);
|
|
19
|
-
load(): SchemaType & {
|
|
20
|
-
type: NodeEnvironmentEnumType;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export {};
|
package/dist/errors.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { MimeRawType } from "./mime";
|
|
2
|
-
import { TimestampType } from "./schema";
|
|
3
|
-
export declare enum AccessDeniedErrorReasonType {
|
|
4
|
-
hcaptcha = "hcaptcha",
|
|
5
|
-
/** @public */
|
|
6
|
-
csrf = "csrf",
|
|
7
|
-
"api-key" = "api-key",
|
|
8
|
-
recaptcha = "recaptcha",
|
|
9
|
-
auth = "auth",
|
|
10
|
-
/** @public */
|
|
11
|
-
"basic-auth" = "basic-auth"
|
|
12
|
-
}
|
|
13
|
-
export type AccessDeniedErrorConfigType = {
|
|
14
|
-
reason: AccessDeniedErrorReasonType;
|
|
15
|
-
};
|
|
16
|
-
export declare class AccessDeniedError extends Error {
|
|
17
|
-
reason: AccessDeniedErrorConfigType["reason"];
|
|
18
|
-
constructor(config: AccessDeniedErrorConfigType);
|
|
19
|
-
}
|
|
20
|
-
export declare class InvalidCredentialsError extends Error {
|
|
21
|
-
constructor();
|
|
22
|
-
}
|
|
23
|
-
export declare class FileNotFoundError extends Error {
|
|
24
|
-
constructor();
|
|
25
|
-
}
|
|
26
|
-
export declare class InvalidMimeError extends Error {
|
|
27
|
-
constructor();
|
|
28
|
-
}
|
|
29
|
-
export declare class NotAcceptedMimeError extends Error {
|
|
30
|
-
mime: MimeRawType;
|
|
31
|
-
constructor(mime: MimeRawType);
|
|
32
|
-
}
|
|
33
|
-
export declare class TooManyRequestsError extends Error {
|
|
34
|
-
remainingMs: number;
|
|
35
|
-
constructor(remainingMs: number);
|
|
36
|
-
}
|
|
37
|
-
export type RequestTimerErrorConfigType = {
|
|
38
|
-
ms: TimestampType;
|
|
39
|
-
};
|
|
40
|
-
export declare class RequestTimeoutError extends Error {
|
|
41
|
-
ms: RequestTimerErrorConfigType["ms"];
|
|
42
|
-
constructor(config: RequestTimerErrorConfigType);
|
|
43
|
-
}
|
|
44
|
-
export declare class InvalidRevisionError extends Error {
|
|
45
|
-
constructor();
|
|
46
|
-
}
|
|
47
|
-
export declare class RevisionMismatchError extends Error {
|
|
48
|
-
constructor();
|
|
49
|
-
}
|
package/dist/etag-extractor.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as tools from "@bgord/tools";
|
|
2
|
-
export type EtagVariables = {
|
|
3
|
-
ETag: tools.ETag | null;
|
|
4
|
-
WeakETag: tools.WeakETag | null;
|
|
5
|
-
};
|
|
6
|
-
export declare class ETagExtractor {
|
|
7
|
-
static attach: import("hono").MiddlewareHandler<{
|
|
8
|
-
Variables: EtagVariables;
|
|
9
|
-
}, string, {}>;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=etag-extractor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"etag-extractor.d.ts","sourceRoot":"","sources":["../src/etag-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;CACjC,CAAC;AAEF,qBAAa,aAAa;IACxB,MAAM,CAAC,MAAM;mBAAiC,aAAa;mBAWxD;CACJ"}
|
package/dist/etag-extractor.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as tools from "@bgord/tools";
|
|
2
|
-
import { createMiddleware } from "hono/factory";
|
|
3
|
-
export class ETagExtractor {
|
|
4
|
-
static attach = createMiddleware(async (c, next) => {
|
|
5
|
-
try {
|
|
6
|
-
const header = String(c.req.header(tools.ETag.IF_MATCH_HEADER_NAME));
|
|
7
|
-
if (!header || header === "undefined")
|
|
8
|
-
c.set("ETag", null);
|
|
9
|
-
else
|
|
10
|
-
c.set("ETag", tools.ETag.fromHeader(header));
|
|
11
|
-
}
|
|
12
|
-
catch (error) {
|
|
13
|
-
c.set("ETag", null);
|
|
14
|
-
}
|
|
15
|
-
await next();
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=etag-extractor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"etag-extractor.js","sourceRoot":"","sources":["../src/etag-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAOhD,MAAM,OAAO,aAAa;IACxB,MAAM,CAAC,MAAM,GAAG,gBAAgB,CAA+B,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE;QAC/E,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;YAErE,IAAI,CAAC,MAAM,IAAI,MAAM,KAAK,WAAW;gBAAE,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;;gBACtD,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QACpD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACtB,CAAC;QAED,MAAM,IAAI,EAAE,CAAC;IACf,CAAC,CAAC,CAAC"}
|
package/dist/etag.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { RevisionType } from "./schema";
|
|
2
|
-
export type ETagValueType = string;
|
|
3
|
-
export declare class ETag {
|
|
4
|
-
readonly revision: RevisionType;
|
|
5
|
-
static HEADER_NAME: string;
|
|
6
|
-
static IF_MATCH_HEADER_NAME: string;
|
|
7
|
-
readonly value: ETagValueType;
|
|
8
|
-
private constructor();
|
|
9
|
-
static fromHeader(value?: ETagValueType): ETag | null;
|
|
10
|
-
}
|
|
11
|
-
export type WeakETagValueType = string;
|
|
12
|
-
export declare class WeakETag {
|
|
13
|
-
readonly revision: RevisionType;
|
|
14
|
-
static HEADER_NAME: string;
|
|
15
|
-
static IF_MATCH_HEADER_NAME: string;
|
|
16
|
-
readonly value: WeakETagValueType;
|
|
17
|
-
private constructor();
|
|
18
|
-
static fromHeader(value?: WeakETagValueType): WeakETag | null;
|
|
19
|
-
}
|