@tstdl/base 0.81.35 → 0.82.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/api/client/client.d.ts +3 -3
- package/api/default-error-handlers.d.ts +1 -1
- package/api/response.d.ts +8 -8
- package/api/server/api-controller.d.ts +1 -1
- package/api/server/gateway.d.ts +9 -9
- package/api/server/middlewares/cors.middleware.d.ts +1 -1
- package/api/server/module.d.ts +1 -1
- package/api/types.d.ts +30 -30
- package/api/utils.d.ts +1 -1
- package/authentication/authentication-credentials.service.d.ts +6 -0
- package/authentication/authentication-credentials.service.js +17 -0
- package/authentication/authentication-credentials.service.js.map +1 -0
- package/authentication/authentication-session.service.d.ts +6 -0
- package/authentication/authentication-session.service.js +17 -0
- package/authentication/authentication-session.service.js.map +1 -0
- package/authentication/authentication-token-payload.provider.d.ts +3 -0
- package/authentication/authentication-token-payload.provider.js +17 -0
- package/authentication/authentication-token-payload.provider.js.map +1 -0
- package/authentication/authentication.service.d.ts +42 -0
- package/authentication/authentication.service.js +133 -0
- package/authentication/authentication.service.js.map +1 -0
- package/authentication/models/authentication-credentials.model.d.ts +6 -0
- package/authentication/models/authentication-credentials.model.js +37 -0
- package/authentication/models/authentication-credentials.model.js.map +1 -0
- package/authentication/models/authentication-session.model.d.ts +9 -0
- package/authentication/models/authentication-session.model.js +52 -0
- package/authentication/models/authentication-session.model.js.map +1 -0
- package/authentication/models/index.d.ts +2 -0
- package/authentication/models/index.js +19 -0
- package/authentication/models/index.js.map +1 -0
- package/authentication/tokens.d.ts +2 -0
- package/authentication/tokens.js +6 -0
- package/authentication/tokens.js.map +1 -0
- package/collections/keyed-set.d.ts +1 -1
- package/collections/observable/observable-collection.d.ts +1 -1
- package/collections/observable/observable-list.d.ts +2 -2
- package/container/container.d.ts +3 -3
- package/container/decorators.d.ts +3 -3
- package/container/interfaces.d.ts +1 -1
- package/container/provider.d.ts +6 -6
- package/container/resolve-chain.d.ts +2 -2
- package/container/token.d.ts +3 -3
- package/container/type-info.d.ts +1 -1
- package/container/types.d.ts +4 -4
- package/core.d.ts +1 -1
- package/data-structures/linked-list.d.ts +1 -1
- package/data-structures/multi-key-map.d.ts +2 -2
- package/data-structures/sorted-array-list.d.ts +1 -1
- package/database/entity-repository.d.ts +2 -2
- package/database/entity.d.ts +3 -3
- package/database/module.d.ts +1 -1
- package/database/mongo/classes.d.ts +3 -3
- package/database/mongo/model/document.d.ts +3 -3
- package/database/mongo/module.d.ts +1 -1
- package/database/mongo/mongo-base.repository.d.ts +11 -11
- package/database/mongo/mongo-bulk.d.ts +1 -1
- package/database/mongo/mongo-entity-repository.d.ts +7 -7
- package/database/mongo/types.d.ts +16 -16
- package/database/query.d.ts +38 -38
- package/disposable/async-disposer.d.ts +3 -3
- package/distributed-loop/distributed-loop.d.ts +2 -2
- package/error/custom.error.d.ts +1 -1
- package/http/client/adapters/undici-http-client.adapter.d.ts +1 -1
- package/http/client/http-client-request.d.ts +5 -5
- package/http/client/http-client-response.d.ts +2 -2
- package/http/client/http-client.d.ts +5 -5
- package/http/http-body.d.ts +3 -1
- package/http/http-body.js +18 -12
- package/http/http-body.js.map +1 -1
- package/http/http-form.d.ts +2 -2
- package/http/http-headers.d.ts +3 -3
- package/http/http-query.d.ts +2 -2
- package/http/http-url-parameters.d.ts +2 -2
- package/http/http-value-map.d.ts +1 -1
- package/http/server/http-server-request.d.ts +1 -1
- package/http/server/http-server-response.d.ts +1 -1
- package/http/server/http-server.d.ts +1 -1
- package/http/server/node/node-http-server.d.ts +1 -1
- package/http/types.d.ts +5 -5
- package/http/utils.d.ts +3 -3
- package/image-service/imgproxy/imgproxy-image-service.d.ts +1 -1
- package/json-path/json-path.d.ts +4 -4
- package/key-value-store/key-value.store.d.ts +1 -1
- package/key-value-store/mongo/module.d.ts +1 -1
- package/key-value-store/mongo/mongo-key-value.model.d.ts +1 -1
- package/lock/lock.d.ts +4 -4
- package/lock/mongo/model.d.ts +1 -1
- package/lock/mongo/module.d.ts +1 -1
- package/lock/provider.d.ts +1 -1
- package/logger/logger.d.ts +6 -6
- package/mail/mail.client.d.ts +1 -1
- package/mail/models/mail-address.model.d.ts +1 -1
- package/mail/models/mail-content.model.d.ts +1 -1
- package/mail/models/mail-data.model.d.ts +1 -1
- package/mail/models/mail-log.model.d.ts +2 -2
- package/mail/models/mail-send-result.model.d.ts +1 -1
- package/mail/models/mail-template.model.d.ts +1 -1
- package/mail/module.d.ts +1 -1
- package/mail/repositories/mongo-mail-log.repository.d.ts +2 -2
- package/message-bus/local/types.d.ts +1 -1
- package/message-bus/message-bus.d.ts +1 -1
- package/migration/migration-state.d.ts +2 -2
- package/migration/migrator.d.ts +4 -4
- package/migration/mongo/module.d.ts +1 -1
- package/module/module-metric-reporter.d.ts +2 -2
- package/module/module.d.ts +1 -1
- package/module/modules/function.module.d.ts +1 -1
- package/module/modules/web-server.module.d.ts +1 -1
- package/notification/api.d.ts +1 -1
- package/notification/module.d.ts +1 -1
- package/object-storage/object-storage.d.ts +2 -2
- package/object-storage/object.d.ts +1 -1
- package/object-storage/s3/s3.object-storage-provider.d.ts +1 -1
- package/openid-connect/mongo-oidc-state.repository.d.ts +1 -1
- package/openid-connect/oidc-configuration.service.d.ts +1 -1
- package/openid-connect/oidc-state.model.d.ts +2 -2
- package/openid-connect/oidc.service-model.d.ts +8 -8
- package/orm/types.d.ts +4 -4
- package/package.json +3 -3
- package/pdf/pdf.service.d.ts +3 -3
- package/pool/pool.d.ts +4 -4
- package/promise/cancelable-promise.d.ts +1 -1
- package/promise/lazy-promise.d.ts +1 -1
- package/queue/mongo/job.d.ts +2 -2
- package/queue/mongo/queue.js +2 -2
- package/queue/mongo/queue.js.map +1 -1
- package/queue/queue.d.ts +11 -6
- package/queue/queue.js +2 -1
- package/queue/queue.js.map +1 -1
- package/reflection/registry.d.ts +9 -9
- package/reflection/types.d.ts +32 -32
- package/reflection/utils.d.ts +5 -5
- package/rpc/endpoints/message-port.rpc-endpoint.d.ts +3 -3
- package/rpc/model.d.ts +22 -22
- package/rpc/rpc.d.ts +1 -1
- package/rxjs/intersection-observer.d.ts +1 -1
- package/rxjs/mutation-observer.d.ts +1 -1
- package/rxjs/performance-observer.d.ts +1 -1
- package/rxjs/resize-observer.d.ts +1 -1
- package/rxjs/slow-array.d.ts +1 -1
- package/rxjs/touch.d.ts +1 -1
- package/schema/constraints/generic.d.ts +2 -2
- package/schema/constraints/length.d.ts +1 -1
- package/schema/decorators/types.d.ts +3 -3
- package/schema/schema.d.ts +4 -4
- package/schema/schema.error.d.ts +1 -1
- package/schema/schema.js +10 -13
- package/schema/schema.js.map +1 -1
- package/schema/schemas/any.d.ts +1 -1
- package/schema/schemas/array.d.ts +1 -1
- package/schema/schemas/boolean.d.ts +1 -1
- package/schema/schemas/date.d.ts +1 -1
- package/schema/schemas/enumeration.d.ts +1 -1
- package/schema/schemas/instance.d.ts +1 -1
- package/schema/schemas/literal.d.ts +1 -1
- package/schema/schemas/nullable.d.ts +1 -1
- package/schema/schemas/number.d.ts +1 -1
- package/schema/schemas/object.d.ts +1 -1
- package/schema/schemas/one-or-many.d.ts +2 -2
- package/schema/schemas/optional.d.ts +1 -1
- package/schema/schemas/readable-stream.d.ts +1 -1
- package/schema/schemas/record.d.ts +1 -1
- package/schema/schemas/regexp.d.ts +1 -1
- package/schema/schemas/string.d.ts +1 -1
- package/schema/schemas/uint8-array.d.ts +1 -1
- package/schema/schemas/union.d.ts +1 -1
- package/schema/schemas/unknown.d.ts +1 -1
- package/schema/transformers/generic.d.ts +1 -1
- package/schema/types.d.ts +31 -31
- package/search-index/elastic/config.d.ts +1 -1
- package/search-index/elastic/model/elastic-query.d.ts +15 -15
- package/search-index/elastic/model/index-mapping.d.ts +14 -14
- package/search-index/elastic/model/sort.d.ts +3 -3
- package/search-index/elastic/module.d.ts +1 -1
- package/search-index/search-index.d.ts +1 -1
- package/search-index/search-result.d.ts +2 -2
- package/serializer/handlers/error.d.ts +1 -1
- package/serializer/handlers/map.d.ts +1 -1
- package/serializer/handlers/regex.d.ts +1 -1
- package/serializer/handlers/set.d.ts +1 -1
- package/serializer/serializable.d.ts +6 -6
- package/serializer/serializer.d.ts +1 -1
- package/serializer/types.d.ts +15 -15
- package/sse/server-sent-events.d.ts +3 -3
- package/tailwind/theme-adapter.d.ts +1 -1
- package/templates/module.d.ts +1 -1
- package/templates/providers/file.provider-template.d.ts +2 -2
- package/templates/providers/file.provider-template.js +2 -1
- package/templates/providers/file.provider-template.js.map +1 -1
- package/templates/renderers/handlebars.template-renderer.d.ts +9 -9
- package/templates/renderers/mjml.template-renderer.d.ts +3 -3
- package/templates/renderers/string.template-renderer.d.ts +1 -1
- package/templates/resolvers/file.template-resolver.d.ts +2 -2
- package/templates/template.model.d.ts +1 -1
- package/templates/template.renderer.d.ts +4 -4
- package/templates/template.service.d.ts +1 -1
- package/text/dynamic-text.model.d.ts +1 -1
- package/text/localizable-text.model.d.ts +1 -1
- package/text/localization.service.d.ts +11 -11
- package/theme/theme-service.d.ts +6 -6
- package/threading/thread-pool.d.ts +1 -1
- package/threading/thread-worker.d.ts +1 -1
- package/types/geo-json.d.ts +12 -12
- package/types.d.ts +91 -91
- package/utils/any-iterable-iterator.d.ts +3 -3
- package/utils/async-iterable-helpers/parallel/types.d.ts +2 -2
- package/utils/async-iterable-helpers/types.d.ts +7 -7
- package/utils/backoff.d.ts +5 -5
- package/utils/benchmark.d.ts +1 -1
- package/utils/binary-search.d.ts +1 -1
- package/utils/binary.js.map +1 -1
- package/utils/cancellation-token.d.ts +1 -1
- package/utils/compression.d.ts +1 -1
- package/utils/cryptography.d.ts +11 -11
- package/utils/date-time.d.ts +8 -7
- package/utils/date-time.js +6 -2
- package/utils/date-time.js.map +1 -1
- package/utils/equals.d.ts +3 -3
- package/utils/factory-map.d.ts +1 -1
- package/utils/format-error.d.ts +1 -1
- package/utils/function/memoize.d.ts +1 -1
- package/utils/helpers.d.ts +1 -1
- package/utils/iterable-helpers/types.d.ts +6 -6
- package/utils/jwt.d.ts +4 -4
- package/utils/math.d.ts +1 -1
- package/utils/merge.d.ts +1 -1
- package/utils/middleware.d.ts +9 -9
- package/utils/moving-metric.d.ts +1 -1
- package/utils/object/decycle.d.ts +1 -1
- package/utils/object/dereference.d.ts +1 -1
- package/utils/object/forward-ref.d.ts +2 -2
- package/utils/object/lazy-property.d.ts +5 -5
- package/utils/object/merge.d.ts +1 -1
- package/utils/object/property-name.d.ts +5 -5
- package/utils/patch-worker.d.ts +1 -1
- package/utils/periodic-sampler.d.ts +1 -1
- package/utils/provider-function-iterable.d.ts +2 -2
- package/utils/proxy.d.ts +1 -1
- package/utils/singleton.d.ts +2 -2
- package/utils/sort.d.ts +2 -2
- package/utils/stream/stream-helper-types.d.ts +5 -5
- package/utils/type-guards.d.ts +3 -3
- package/utils/url-builder.d.ts +4 -4
- package/web-types.d.ts +4 -4
package/logger/logger.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { Injectable } from "../container";
|
|
2
2
|
import { resolveArgumentType } from "../container";
|
|
3
3
|
import { LogLevel } from './level';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
4
|
+
export type LogEntry = string;
|
|
5
|
+
export type LogEntryProvider = () => LogEntry;
|
|
6
|
+
export type LogEntryOrProvider = LogEntry | LogEntryProvider;
|
|
7
|
+
export type LoggerStatic = new (level: LogLevel) => Logger;
|
|
8
|
+
export type LogErrorOptions = {
|
|
9
9
|
includeRest?: boolean;
|
|
10
10
|
includeStack?: boolean;
|
|
11
11
|
};
|
|
12
12
|
/** either string as a module shorthand or object */
|
|
13
|
-
export
|
|
13
|
+
export type LoggerArgument = string | undefined | {
|
|
14
14
|
level?: LogLevel;
|
|
15
15
|
module?: string | string[];
|
|
16
16
|
prefix?: string;
|
package/mail/mail.client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Injectable } from "../container";
|
|
2
2
|
import { resolveArgumentType } from "../container";
|
|
3
3
|
import type { MailData, MailSendResult } from './models';
|
|
4
|
-
export
|
|
4
|
+
export type MailClientConfig = {
|
|
5
5
|
host: string;
|
|
6
6
|
port: number;
|
|
7
7
|
secure?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { OneOrMany } from "../../types";
|
|
2
2
|
import type { MailAddress } from './mail-address.model';
|
|
3
3
|
import type { MailContent } from './mail-content.model';
|
|
4
|
-
export
|
|
4
|
+
export type MailData = {
|
|
5
5
|
content: MailContent;
|
|
6
6
|
from?: MailAddress;
|
|
7
7
|
to?: OneOrMany<MailAddress>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Entity, NewEntity } from "../../database";
|
|
2
2
|
import type { MailData } from './mail-data.model';
|
|
3
3
|
import type { MailSendResult } from './mail-send-result.model';
|
|
4
|
-
export
|
|
4
|
+
export type MailLog = Entity & {
|
|
5
5
|
timestamp: number;
|
|
6
6
|
templateKey: string | null;
|
|
7
7
|
data: MailData;
|
|
8
8
|
sendResult: MailSendResult | null;
|
|
9
9
|
errors: string[] | null;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type NewMailLog = NewEntity<MailLog>;
|
package/mail/module.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Type } from "../types";
|
|
|
2
2
|
import { MailLogRepository } from './mail-log.repository';
|
|
3
3
|
import type { MailClientConfig } from './mail.client';
|
|
4
4
|
import { MailClient } from './mail.client';
|
|
5
|
-
export
|
|
5
|
+
export type MailModuleConfig = {
|
|
6
6
|
clientConfig: MailClientConfig;
|
|
7
7
|
client: Type<MailClient>;
|
|
8
8
|
logRepository: Type<MailLogRepository> | undefined;
|
|
@@ -4,10 +4,10 @@ import type { CollectionArgument } from "../../database/mongo";
|
|
|
4
4
|
import { Collection, MongoEntityRepository } from "../../database/mongo";
|
|
5
5
|
import { Logger } from "../../logger";
|
|
6
6
|
import type { MailLog } from '../models';
|
|
7
|
-
export
|
|
7
|
+
export type MongoMailLogRepositoryConfig = {
|
|
8
8
|
config?: MongoMailLogRepositoryArgument;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type MongoMailLogRepositoryArgument = CollectionArgument<MailLog>;
|
|
11
11
|
export declare const mongoMailLogRepositoryConfig: MongoMailLogRepositoryConfig;
|
|
12
12
|
export declare class MongoMailLogRepository extends MongoEntityRepository<MailLog> implements Injectable<MongoMailLogRepositoryArgument> {
|
|
13
13
|
[resolveArgumentType]: MongoMailLogRepositoryArgument;
|
|
@@ -3,7 +3,7 @@ import { resolveArgumentType } from "../container";
|
|
|
3
3
|
import type { Observable } from 'rxjs';
|
|
4
4
|
import type { AsyncDisposable } from '../disposable';
|
|
5
5
|
import { disposeAsync } from '../disposable';
|
|
6
|
-
export
|
|
6
|
+
export type MessageBusArgument = string;
|
|
7
7
|
export declare abstract class MessageBus<T> implements AsyncDisposable, Injectable<MessageBusArgument> {
|
|
8
8
|
readonly [resolveArgumentType]: string;
|
|
9
9
|
/** messages from other instances */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Entity, NewEntity } from "../database";
|
|
2
|
-
export
|
|
2
|
+
export type MigrationState = Entity & {
|
|
3
3
|
name: string;
|
|
4
4
|
revision: number;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type NewMigrationState = NewEntity<MigrationState>;
|
package/migration/migrator.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { LockProvider } from "../lock";
|
|
2
2
|
import { Logger } from "../logger";
|
|
3
3
|
import { MigrationStateRepository } from './migration-state-repository';
|
|
4
|
-
export
|
|
4
|
+
export type MigrationDefinition<T = void> = {
|
|
5
5
|
name: string;
|
|
6
6
|
migrations: Migration<T>[];
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type Migration<T = void> = {
|
|
9
9
|
from: 'init' | number | number[];
|
|
10
10
|
to: number;
|
|
11
11
|
migrator: (control: MigrationControl) => Promise<T> | T;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type MigrationControl = {
|
|
14
14
|
restart: () => void;
|
|
15
15
|
};
|
|
16
|
-
export
|
|
16
|
+
export type MigrationResult<T> = {
|
|
17
17
|
from: 'init' | number;
|
|
18
18
|
to: number;
|
|
19
19
|
time: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MongoRepositoryConfig } from "../../database/mongo";
|
|
2
2
|
import type { MigrationState } from "..";
|
|
3
|
-
export
|
|
3
|
+
export type MongoMigrationStateRepositoryModuleConfig = {
|
|
4
4
|
defaultMigrationStateRepositoryConfig: MongoRepositoryConfig<MigrationState> | undefined;
|
|
5
5
|
};
|
|
6
6
|
export declare const mongoMigrationStateRepositoryModuleConfig: MongoMigrationStateRepositoryModuleConfig;
|
|
@@ -2,12 +2,12 @@ import type { ReadonlyCancellationToken } from "../utils/cancellation-token";
|
|
|
2
2
|
import type { MetricAggregation, MetricAggregationOptions } from "../utils/moving-metric";
|
|
3
3
|
import { MovingMetric } from "../utils/moving-metric";
|
|
4
4
|
import type { ModuleMetric } from './module';
|
|
5
|
-
export
|
|
5
|
+
export type MetricReport<Aggregation extends MetricAggregation> = {
|
|
6
6
|
displayName: string;
|
|
7
7
|
aggregation: Aggregation;
|
|
8
8
|
aggregationOptions?: MetricAggregationOptions<Aggregation>;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type MetricReportRegistration = {
|
|
11
11
|
metric: ModuleMetric;
|
|
12
12
|
moving: MovingMetric;
|
|
13
13
|
reports: MetricReport<MetricAggregation>[];
|
package/module/module.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReadonlyCancellationToken } from "../../utils/cancellation-token";
|
|
2
2
|
import type { Module } from '../module';
|
|
3
3
|
import { ModuleBase } from '../module-base';
|
|
4
|
-
export
|
|
4
|
+
export type FunctionModuleFunction = (cancellationToken: ReadonlyCancellationToken) => void | Promise<void>;
|
|
5
5
|
export declare class FunctionModule extends ModuleBase implements Module {
|
|
6
6
|
private readonly fn;
|
|
7
7
|
readonly metrics: {};
|
|
@@ -7,7 +7,7 @@ import type { ReadonlyCancellationToken } from "../../utils/cancellation-token";
|
|
|
7
7
|
import type { Module } from '../module';
|
|
8
8
|
import { ModuleMetricType } from '../module';
|
|
9
9
|
import { ModuleBase } from '../module-base';
|
|
10
|
-
export
|
|
10
|
+
export type WebServerModuleConfiguration = {
|
|
11
11
|
port: number;
|
|
12
12
|
};
|
|
13
13
|
export declare const webServerModuleConfiguration: WebServerModuleConfiguration;
|
package/notification/api.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ declare const notificationApiDefinition: {
|
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
type NotificationApiDefinition = typeof notificationApiDefinition;
|
|
15
15
|
export declare class NotificationApi {
|
|
16
16
|
get(): Promise<ApiServerResult<NotificationApiDefinition, 'get'>>;
|
|
17
17
|
}
|
package/notification/module.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Injectable } from "../container";
|
|
2
2
|
import { resolveArgumentType } from "../container";
|
|
3
3
|
import type { ObjectMetadata, ObjectStorageObject } from './object';
|
|
4
|
-
export
|
|
4
|
+
export type UploadObjectOptions = {
|
|
5
5
|
metadata?: ObjectMetadata;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type ObjectStorageArgument = string;
|
|
8
8
|
export declare abstract class ObjectStorage implements Injectable<ObjectStorageArgument> {
|
|
9
9
|
/**
|
|
10
10
|
* object storage module
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ObjectStorageProvider } from "..";
|
|
2
2
|
import { S3ObjectStorage } from './s3.object-storage';
|
|
3
3
|
export declare const S3_OBJECT_STORAGE_PROVIDER_CONFIG: import("../../container").InjectionToken<S3ObjectStorageProviderConfig, any>;
|
|
4
|
-
export
|
|
4
|
+
export type S3ObjectStorageProviderConfig = {
|
|
5
5
|
/**
|
|
6
6
|
* s3 endpoint
|
|
7
7
|
*/
|
|
@@ -6,7 +6,7 @@ import { Logger } from "../logger";
|
|
|
6
6
|
import type { TypedOmit } from "../types";
|
|
7
7
|
import type { OidcState } from './oidc-state.model';
|
|
8
8
|
import { OidcStateRepository } from './oidc-state.repository';
|
|
9
|
-
export
|
|
9
|
+
export type MongoOidcState = TypedOmit<OidcState, 'expiration'> & {
|
|
10
10
|
expiration: Date;
|
|
11
11
|
};
|
|
12
12
|
export declare class MongoOidcStateRepository extends MongoEntityRepository<OidcState, MongoOidcState> implements OidcStateRepository, Injectable<CollectionArgument<MongoOidcState>> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Entity, NewEntity } from "../database";
|
|
2
|
-
export
|
|
2
|
+
export type OidcState<Data = any> = Entity & {
|
|
3
3
|
value: string;
|
|
4
4
|
codeVerifier: string;
|
|
5
5
|
endpoint: string;
|
|
@@ -8,4 +8,4 @@ export declare type OidcState<Data = any> = Entity & {
|
|
|
8
8
|
expiration: number;
|
|
9
9
|
data: Data;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type NewOidcState<Data = any> = NewEntity<OidcState<Data>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type OidcInitParameters<Data = void> = {
|
|
2
2
|
endpoint: string;
|
|
3
3
|
clientId: string;
|
|
4
4
|
clientSecret: string;
|
|
@@ -8,7 +8,7 @@ export declare type OidcInitParameters<Data = void> = {
|
|
|
8
8
|
/** custom data */
|
|
9
9
|
data: Data;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type OidcInitResult = {
|
|
12
12
|
authorizationEndpoint: string;
|
|
13
13
|
state: string;
|
|
14
14
|
clientId: string;
|
|
@@ -16,31 +16,31 @@ export declare type OidcInitResult = {
|
|
|
16
16
|
codeChallenge: string;
|
|
17
17
|
codeChallengeMethod: string;
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export type OidcToken<Raw = unknown> = {
|
|
20
20
|
tokenType: string;
|
|
21
21
|
accessToken: string;
|
|
22
22
|
idToken?: string;
|
|
23
23
|
refreshToken?: string;
|
|
24
24
|
raw: Raw;
|
|
25
25
|
};
|
|
26
|
-
export
|
|
26
|
+
export type OidcGetTokenParametersBase<GrantType extends string> = {
|
|
27
27
|
endpoint: string;
|
|
28
28
|
grantType: GrantType;
|
|
29
29
|
clientId: string;
|
|
30
30
|
clientSecret: string;
|
|
31
31
|
authType?: 'body' | 'basic-auth';
|
|
32
32
|
};
|
|
33
|
-
export
|
|
33
|
+
export type OidcGetTokenParametersWithClientCredentials = OidcGetTokenParametersBase<'client_credentials'> & {
|
|
34
34
|
scope?: string;
|
|
35
35
|
};
|
|
36
|
-
export
|
|
36
|
+
export type OidcGetTokenParametersWithAuthorizationCode = OidcGetTokenParametersBase<'authorization_code'> & {
|
|
37
37
|
scope?: string;
|
|
38
38
|
code: string;
|
|
39
39
|
codeVerifier: string;
|
|
40
40
|
redirectUri: string;
|
|
41
41
|
};
|
|
42
|
-
export
|
|
43
|
-
export
|
|
42
|
+
export type OidcGetTokenParameters = OidcGetTokenParametersWithClientCredentials | OidcGetTokenParametersWithAuthorizationCode;
|
|
43
|
+
export type OidcRefreshTokenParameters = {
|
|
44
44
|
endpoint: string;
|
|
45
45
|
clientId: string;
|
|
46
46
|
clientSecret: string;
|
package/orm/types.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { OneOrMany, Record, Type } from "../types";
|
|
2
|
-
export
|
|
2
|
+
export type EntityDefinition = {
|
|
3
3
|
name: string;
|
|
4
4
|
tableName?: string;
|
|
5
5
|
properties: Record;
|
|
6
6
|
indexes?: IndexDefinition[];
|
|
7
7
|
};
|
|
8
|
-
export
|
|
9
|
-
export
|
|
8
|
+
export type EntityPropertyType = 'any' | 'string' | 'number' | 'boolean';
|
|
9
|
+
export type PropertyDefinition = {
|
|
10
10
|
type: OneOrMany<EntityPropertyType>;
|
|
11
11
|
array?: boolean;
|
|
12
12
|
nullable?: boolean;
|
|
13
13
|
unique?: boolean;
|
|
14
14
|
};
|
|
15
|
-
export
|
|
15
|
+
export type IndexDefinition = {
|
|
16
16
|
properties: string[];
|
|
17
17
|
unique?: boolean;
|
|
18
18
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tstdl/base",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.82.0",
|
|
4
4
|
"author": "Patrick Hein",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"eslint": "8",
|
|
34
34
|
"ttypescript": "1.5",
|
|
35
35
|
"typedoc": "0.23",
|
|
36
|
-
"typescript": "4.
|
|
36
|
+
"typescript": "4.9",
|
|
37
37
|
"typescript-transform-paths": "3.4"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@elastic/elasticsearch": "^8.6",
|
|
41
41
|
"@koa/router": "^12.0",
|
|
42
|
-
"@tstdl/angular": "^0.
|
|
42
|
+
"@tstdl/angular": "^0.82.0",
|
|
43
43
|
"chroma-js": "^2.4",
|
|
44
44
|
"got": "^12.5",
|
|
45
45
|
"handlebars": "^4.7",
|
package/pdf/pdf.service.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export declare class PdfRenderOptions {
|
|
|
43
43
|
*/
|
|
44
44
|
timeout?: number;
|
|
45
45
|
}
|
|
46
|
-
export
|
|
46
|
+
export type PdfTemplateOptions = PdfRenderOptions;
|
|
47
47
|
export declare class PdfTemplate extends Template<{
|
|
48
48
|
header: false;
|
|
49
49
|
body: true;
|
|
@@ -51,10 +51,10 @@ export declare class PdfTemplate extends Template<{
|
|
|
51
51
|
}, PdfRenderOptions> {
|
|
52
52
|
options?: PdfTemplateOptions;
|
|
53
53
|
}
|
|
54
|
-
export
|
|
54
|
+
export type PdfServiceOptions = {
|
|
55
55
|
language?: string;
|
|
56
56
|
};
|
|
57
|
-
export
|
|
57
|
+
export type PdfServiceArgument = PdfServiceOptions;
|
|
58
58
|
export declare class PdfService implements AsyncDisposable, AfterResolve, Injectable<PdfServiceArgument> {
|
|
59
59
|
private readonly templateService;
|
|
60
60
|
private readonly logger;
|
package/pool/pool.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import type { AsyncDisposable } from "../disposable/disposable";
|
|
2
2
|
import { disposeAsync } from "../disposable/disposable";
|
|
3
3
|
import type { Logger } from "../logger";
|
|
4
|
-
export
|
|
4
|
+
export type PoolOptions = {
|
|
5
5
|
/**
|
|
6
6
|
* maximum number of instances
|
|
7
7
|
* @default number of cpu cores
|
|
8
8
|
*/
|
|
9
9
|
size?: number;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type PoolUseOptions = {
|
|
12
12
|
/**
|
|
13
13
|
* Dipose used instance on error instead of reusing it.
|
|
14
14
|
* @default false
|
|
15
15
|
*/
|
|
16
16
|
disposeOnError?: boolean;
|
|
17
17
|
};
|
|
18
|
-
export
|
|
19
|
-
export
|
|
18
|
+
export type PoolInstanceFactory<T> = () => T | Promise<T>;
|
|
19
|
+
export type PoolInstanceDisposer<T> = (instance: T) => any | Promise<any>;
|
|
20
20
|
export declare class Pool<T extends object> implements AsyncDisposable {
|
|
21
21
|
private readonly size;
|
|
22
22
|
private readonly disposeOnError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type PromiseExecutor<T> = (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void;
|
|
2
2
|
export declare class LazyPromise<T> implements Promise<T> {
|
|
3
3
|
static readonly [Symbol.species]: PromiseConstructor;
|
|
4
4
|
private readonly backingPromise;
|
package/queue/mongo/job.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Entity, NewEntity } from "../../database";
|
|
2
2
|
import type { Job } from "..";
|
|
3
3
|
import type { TypedOmit } from "../../types";
|
|
4
|
-
export
|
|
4
|
+
export type MongoJob<T = unknown> = Entity & TypedOmit<Job<T>, 'id'> & {
|
|
5
5
|
queue: string;
|
|
6
6
|
jobId: string;
|
|
7
7
|
enqueueTimestamp: number;
|
|
@@ -9,4 +9,4 @@ export declare type MongoJob<T = unknown> = Entity & TypedOmit<Job<T>, 'id'> & {
|
|
|
9
9
|
lastDequeueTimestamp: number;
|
|
10
10
|
batch: null | string;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type NewMongoJob<T> = NewEntity<MongoJob<T>>;
|
package/queue/mongo/queue.js
CHANGED
|
@@ -52,7 +52,7 @@ let MongoQueue = class MongoQueue extends queue_1.Queue {
|
|
|
52
52
|
this.messageBus = messageBusProvider.get(`MongoQueue:${repository.collection.collectionName}:${key}`);
|
|
53
53
|
}
|
|
54
54
|
async enqueue(data, options = {}) {
|
|
55
|
-
const { tag = null, uniqueTag, priority =
|
|
55
|
+
const { tag = null, uniqueTag, priority = queue_1.defaultJobPriority } = options;
|
|
56
56
|
const newJob = {
|
|
57
57
|
queue: this.queueKey,
|
|
58
58
|
jobId: (0, id_1.getNewId)(),
|
|
@@ -74,7 +74,7 @@ let MongoQueue = class MongoQueue extends queue_1.Queue {
|
|
|
74
74
|
const nonUnique = [];
|
|
75
75
|
const keepOld = [];
|
|
76
76
|
const takeNew = [];
|
|
77
|
-
for (const { data, tag = null, uniqueTag, priority =
|
|
77
|
+
for (const { data, tag = null, uniqueTag, priority = queue_1.defaultJobPriority } of items) {
|
|
78
78
|
const newMongoJob = {
|
|
79
79
|
queue: this.queueKey,
|
|
80
80
|
jobId: (0, id_1.getNewId)(),
|
package/queue/mongo/queue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../../../source/queue/mongo/queue.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAwC;AACxC,0CAAyC;AAEzC,qCAA8B;AAE9B,mDAAmD;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,CAAC,QAAQ;QAC3B,GAAG,EAAE,QAAQ,CAAC,GAAG;QACjB,IAAI,EAAE,QAAQ,CAAC,IAAI;KACpB,CAAC;IAEF,OAAO,GAAG,CAAC;AACb,CAAC;AAED,4EAA4E;AAC5E,SAAS,wBAAwB,CAAC,QAAgB,EAAE,QAAgB,EAAE,cAAsB,EAAE,QAAuB,IAAI;IACvH,MAAM,GAAG,GAAG,IAAA,4BAAgB,GAAE,CAAC;IAC/B,MAAM,2BAA2B,GAAG,GAAG,GAAG,cAAc,CAAC;IAEzD,MAAM,MAAM,GAA0B;QACpC,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE;QACxB,oBAAoB,EAAE,EAAE,IAAI,EAAE,2BAA2B,EAAE;KAC5D,CAAC;IAEF,MAAM,MAAM,GAAgC;QAC1C,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE;QAClB,IAAI,EAAE;YACJ,oBAAoB,EAAE,GAAG;YACzB,KAAK;SACN;KACF,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC5B,CAAC"}
|
package/queue/queue.d.ts
CHANGED
|
@@ -2,30 +2,35 @@ import type { Injectable } from "../container";
|
|
|
2
2
|
import { resolveArgumentType } from "../container";
|
|
3
3
|
import type { ReadonlyCancellationToken } from '../utils/cancellation-token';
|
|
4
4
|
import { QueueEnqueueBatch } from './enqueue-batch';
|
|
5
|
-
export
|
|
6
|
-
export
|
|
5
|
+
export type JobTag = string | number | null;
|
|
6
|
+
export type Job<T> = {
|
|
7
7
|
id: string;
|
|
8
|
+
/**
|
|
9
|
+
* The lower the number, the higher the priority.
|
|
10
|
+
* @default 1000
|
|
11
|
+
*/
|
|
8
12
|
priority: number;
|
|
9
13
|
tag: JobTag;
|
|
10
14
|
data: T;
|
|
11
15
|
};
|
|
16
|
+
export declare const defaultJobPriority = 1000;
|
|
12
17
|
export declare enum UniqueTagStrategy {
|
|
13
18
|
KeepOld = 0,
|
|
14
19
|
TakeNew = 1
|
|
15
20
|
}
|
|
16
|
-
export
|
|
21
|
+
export type EnqueueOptions = {
|
|
17
22
|
tag?: JobTag;
|
|
18
23
|
uniqueTag?: UniqueTagStrategy;
|
|
19
24
|
priority?: number;
|
|
20
25
|
};
|
|
21
|
-
export
|
|
26
|
+
export type EnqueueManyItem<T> = EnqueueOptions & {
|
|
22
27
|
data: T;
|
|
23
28
|
};
|
|
24
|
-
export
|
|
29
|
+
export type QueueConfig = {
|
|
25
30
|
processTimeout?: number;
|
|
26
31
|
maxTries?: number;
|
|
27
32
|
};
|
|
28
|
-
export
|
|
33
|
+
export type QueueArgument = string | (QueueConfig & {
|
|
29
34
|
key: string;
|
|
30
35
|
});
|
|
31
36
|
export declare const defaultQueueConfig: Required<QueueConfig>;
|
package/queue/queue.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Queue = exports.defaultQueueConfig = exports.UniqueTagStrategy = void 0;
|
|
3
|
+
exports.Queue = exports.defaultQueueConfig = exports.UniqueTagStrategy = exports.defaultJobPriority = void 0;
|
|
4
4
|
const container_1 = require("../container");
|
|
5
5
|
const units_1 = require("../utils/units");
|
|
6
6
|
const enqueue_batch_1 = require("./enqueue-batch");
|
|
7
|
+
exports.defaultJobPriority = 1000;
|
|
7
8
|
var UniqueTagStrategy;
|
|
8
9
|
(function (UniqueTagStrategy) {
|
|
9
10
|
UniqueTagStrategy[UniqueTagStrategy["KeepOld"] = 0] = "KeepOld";
|
package/queue/queue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../../source/queue/queue.ts"],"names":[],"mappings":";;;AACA,4CAAkD;AAClD,0CAAsD;AAEtD,mDAAoD;
|
|
1
|
+
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../../source/queue/queue.ts"],"names":[],"mappings":";;;AACA,4CAAkD;AAClD,0CAAsD;AAEtD,mDAAoD;AAiBvC,QAAA,kBAAkB,GAAG,IAAI,CAAC;AAEvC,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,+DAAW,CAAA;IACX,+DAAW,CAAA;AACb,CAAC,EAHW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAG5B;AAmBY,QAAA,kBAAkB,GAA0B;IACvD,cAAc,EAAE,6BAAqB;IACrC,QAAQ,EAAE,CAAC;CACZ,CAAC;AAEF,MAAsB,KAAK;IAChB,CAAC,+BAAmB,CAAC,CAAgB;IAE9C,KAAK;QACH,OAAO,IAAI,iCAAiB,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;CA2BF;AAhCD,sBAgCC"}
|