@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/database/query.d.ts
CHANGED
|
@@ -1,101 +1,101 @@
|
|
|
1
1
|
import type { Flatten, StringMap } from "../types";
|
|
2
2
|
import type { Geometry } from "../types/geo-json";
|
|
3
|
-
export
|
|
3
|
+
export type QueryOptions<T = any> = {
|
|
4
4
|
sort?: Sort<T>[];
|
|
5
5
|
skip?: number;
|
|
6
6
|
limit?: number;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
9
|
-
export
|
|
8
|
+
export type LogicalQuery<T = any> = LogicalAndQuery<T> | LogicalOrQuery<T> | LogicalNorQuery<T>;
|
|
9
|
+
export type LogicalQueryTypes = keyof (LogicalAndQuery & LogicalOrQuery & LogicalNorQuery);
|
|
10
10
|
export declare const allLogicalQueryTypes: LogicalQueryTypes[];
|
|
11
|
-
export
|
|
11
|
+
export type ComparisonQueryBody<T = any> = {
|
|
12
12
|
[P in keyof T]?: ComparisonQueryOrValue<T[P]>;
|
|
13
13
|
} & StringMap<ComparisonQueryOrValue>;
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
14
|
+
export type ComparisonQueryOrValue<T = any> = ComparisonQuery<T> | T | Flatten<T>;
|
|
15
|
+
export type ComparisonQuery<T = any> = Partial<ComparisonNotQuery<T> & ComparisonEqualsQuery<T> & ComparisonNotEqualsQuery<T> & ComparisonExistsQuery & ComparisonItemQuery<T> & ComparisonInQuery<T> & ComparisonNotInQuery<T> & ComparisonAllQuery<T> & ComparisonGreaterThanQuery<T> & ComparisonGreaterThanOrEqualsQuery<T> & ComparisonLessThanQuery<T> & ComparisonLessThanOrEqualsQuery<T> & ComparisonRegexQuery & ComparisonTextQuery & ComparisonGeoShapeQuery & ComparisonGeoDistanceQuery>;
|
|
16
|
+
export type ComparisonQueryTypes = keyof ComparisonQuery;
|
|
17
17
|
export declare const allComparisonQueryTypes: ComparisonQueryTypes[];
|
|
18
|
-
export
|
|
19
|
-
export
|
|
18
|
+
export type SpecialQuery<T = any> = Partial<TextSpanQuery<T>>;
|
|
19
|
+
export type SpecialQueryTypes = keyof SpecialQuery;
|
|
20
20
|
export declare const allSpecialQueryTypes: SpecialQueryTypes[];
|
|
21
|
-
export
|
|
22
|
-
export
|
|
21
|
+
export type Query<T = any> = LogicalQuery<T> | (ComparisonQueryBody<T> & SpecialQuery<T>);
|
|
22
|
+
export type QueryTypes = LogicalQueryTypes | ComparisonQueryTypes | SpecialQueryTypes;
|
|
23
23
|
export declare const allQueryTypes: ("$and" | "$or" | "$nor" | "$not" | "$eq" | "$neq" | "$exists" | "$item" | "$in" | "$nin" | "$all" | "$gt" | "$gte" | "$lt" | "$lte" | "$regex" | "$text" | "$geoShape" | "$geoDistance" | "$textSpan")[];
|
|
24
|
-
export
|
|
24
|
+
export type Order = 'asc' | 'desc';
|
|
25
25
|
export declare const allOrders: Order[];
|
|
26
|
-
export
|
|
26
|
+
export type Operator = 'and' | 'or';
|
|
27
27
|
export declare const allOperators: Operator[];
|
|
28
|
-
export
|
|
28
|
+
export type Sort<T = any> = {
|
|
29
29
|
field: (Extract<keyof T, string> | '$score');
|
|
30
30
|
order?: Order;
|
|
31
31
|
};
|
|
32
|
-
export
|
|
32
|
+
export type LogicalAndQuery<T = any> = {
|
|
33
33
|
$and: Query<T>[];
|
|
34
34
|
};
|
|
35
|
-
export
|
|
35
|
+
export type LogicalOrQuery<T = any> = {
|
|
36
36
|
$or: Query<T>[];
|
|
37
37
|
};
|
|
38
|
-
export
|
|
38
|
+
export type LogicalNorQuery<T = any> = {
|
|
39
39
|
$nor: Query<T>[];
|
|
40
40
|
};
|
|
41
|
-
export
|
|
42
|
-
export
|
|
43
|
-
export
|
|
41
|
+
export type ComparisonValue<T> = T | Flatten<T>;
|
|
42
|
+
export type ComparisonValueWithRegex<T> = T extends string ? ComparisonValue<T | RegExp> : T extends string[] ? ComparisonValue<(Flatten<T> | RegExp)[]> : (T | Flatten<T>);
|
|
43
|
+
export type ComparisonNotQuery<T = any> = {
|
|
44
44
|
$not: ComparisonQuery<T>;
|
|
45
45
|
};
|
|
46
|
-
export
|
|
46
|
+
export type ComparisonEqualsQuery<T = any> = {
|
|
47
47
|
$eq: ComparisonValueWithRegex<T>;
|
|
48
48
|
};
|
|
49
|
-
export
|
|
49
|
+
export type ComparisonNotEqualsQuery<T = any> = {
|
|
50
50
|
$neq: ComparisonValueWithRegex<T>;
|
|
51
51
|
};
|
|
52
|
-
export
|
|
52
|
+
export type ComparisonExistsQuery = {
|
|
53
53
|
$exists: ComparisonValue<boolean>;
|
|
54
54
|
};
|
|
55
|
-
export
|
|
55
|
+
export type ComparisonItemQuery<T = any> = {
|
|
56
56
|
$item: T extends (infer U)[] ? U extends Record<any, any> ? Query<U> : ComparisonQuery<U> : never;
|
|
57
57
|
};
|
|
58
|
-
export
|
|
58
|
+
export type ComparisonInQuery<T = any> = {
|
|
59
59
|
$in: ComparisonValueWithRegex<T>[];
|
|
60
60
|
};
|
|
61
|
-
export
|
|
61
|
+
export type ComparisonNotInQuery<T = any> = {
|
|
62
62
|
$nin: ComparisonValueWithRegex<T>[];
|
|
63
63
|
};
|
|
64
|
-
export
|
|
64
|
+
export type ComparisonAllQuery<T = any> = {
|
|
65
65
|
$all: ComparisonValueWithRegex<T>[];
|
|
66
66
|
};
|
|
67
|
-
export
|
|
67
|
+
export type ComparisonGreaterThanQuery<T = any> = {
|
|
68
68
|
$gt: ComparisonValue<T>;
|
|
69
69
|
};
|
|
70
|
-
export
|
|
70
|
+
export type ComparisonGreaterThanOrEqualsQuery<T = any> = {
|
|
71
71
|
$gte: ComparisonValue<T>;
|
|
72
72
|
};
|
|
73
|
-
export
|
|
73
|
+
export type ComparisonLessThanQuery<T = any> = {
|
|
74
74
|
$lt: ComparisonValue<T>;
|
|
75
75
|
};
|
|
76
|
-
export
|
|
76
|
+
export type ComparisonLessThanOrEqualsQuery<T = any> = {
|
|
77
77
|
$lte: ComparisonValue<T>;
|
|
78
78
|
};
|
|
79
|
-
export
|
|
79
|
+
export type ComparisonRegexQuery = {
|
|
80
80
|
$regex: string | RegExp | {
|
|
81
81
|
pattern: string;
|
|
82
82
|
flags: string;
|
|
83
83
|
};
|
|
84
84
|
};
|
|
85
|
-
export
|
|
85
|
+
export type ComparisonTextQuery = {
|
|
86
86
|
$text: string | {
|
|
87
87
|
text: string;
|
|
88
88
|
operator?: Operator;
|
|
89
89
|
};
|
|
90
90
|
};
|
|
91
|
-
export
|
|
92
|
-
export
|
|
91
|
+
export type GeoShapeRelation = 'intersects' | 'within' | 'disjoint' | 'contains';
|
|
92
|
+
export type ComparisonGeoShapeQuery = {
|
|
93
93
|
$geoShape: {
|
|
94
94
|
geometry: Geometry;
|
|
95
95
|
relation: GeoShapeRelation;
|
|
96
96
|
};
|
|
97
97
|
};
|
|
98
|
-
export
|
|
98
|
+
export type ComparisonGeoDistanceQuery = {
|
|
99
99
|
$geoDistance: {
|
|
100
100
|
longitude: number;
|
|
101
101
|
latitude: number;
|
|
@@ -109,9 +109,9 @@ export declare type ComparisonGeoDistanceQuery = {
|
|
|
109
109
|
minDistance?: number;
|
|
110
110
|
};
|
|
111
111
|
};
|
|
112
|
-
export
|
|
112
|
+
export type TextSpanQueryMode = 'best' | 'most' | 'cross';
|
|
113
113
|
export declare const allTextSpanQueryModes: TextSpanQueryMode[];
|
|
114
|
-
export
|
|
114
|
+
export type TextSpanQuery<T = any> = {
|
|
115
115
|
$textSpan: {
|
|
116
116
|
fields: (Extract<keyof T, string>)[];
|
|
117
117
|
text: string;
|
|
@@ -3,12 +3,12 @@ import { CancellationToken } from '../utils/cancellation-token';
|
|
|
3
3
|
import type { AsyncDisposable, Disposable } from './disposable';
|
|
4
4
|
import { disposeAsync } from './disposable';
|
|
5
5
|
declare const deferrerToken: unique symbol;
|
|
6
|
-
export
|
|
7
|
-
export
|
|
6
|
+
export type TaskFunction = () => any;
|
|
7
|
+
export type Task = {
|
|
8
8
|
priority: number;
|
|
9
9
|
taskFunction: TaskFunction;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type Deferrer = {
|
|
12
12
|
[deferrerToken]: CancellationToken;
|
|
13
13
|
yield(): void;
|
|
14
14
|
};
|
|
@@ -3,9 +3,9 @@ import { resolveArgumentType } from "../container";
|
|
|
3
3
|
import { LockProvider } from "../lock";
|
|
4
4
|
import type { ReadonlyCancellationToken } from "../utils/cancellation-token";
|
|
5
5
|
import type { LoopController } from './controller';
|
|
6
|
-
export
|
|
6
|
+
export type LoopFunction = (controller: LoopController) => any | Promise<any>;
|
|
7
7
|
/** loop key */
|
|
8
|
-
export
|
|
8
|
+
export type DistributedLoopArgument = string;
|
|
9
9
|
export declare class DistributedLoop implements Injectable<DistributedLoopArgument> {
|
|
10
10
|
private readonly key;
|
|
11
11
|
private readonly lockProvider;
|
package/error/custom.error.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Dispatcher } from 'undici';
|
|
|
2
2
|
import type { HttpClientRequest } from '../http-client-request';
|
|
3
3
|
import { HttpClientResponse } from '../http-client-response';
|
|
4
4
|
import { HttpClientAdapter } from '../http-client.adapter';
|
|
5
|
-
export
|
|
5
|
+
export type UndiciHttpClientAdapterOptions = {
|
|
6
6
|
dispatcher?: Dispatcher;
|
|
7
7
|
};
|
|
8
8
|
export declare class UndiciHttpClientAdapter extends HttpClientAdapter {
|
|
@@ -12,7 +12,7 @@ import type { HttpUrlParametersObject } from '../http-url-parameters';
|
|
|
12
12
|
import { HttpUrlParameters } from '../http-url-parameters';
|
|
13
13
|
import type { HttpMethod } from '../types';
|
|
14
14
|
/** only one type at a time is supported. If multiple are set, behaviour is undefined */
|
|
15
|
-
export
|
|
15
|
+
export type HttpRequestBody = {
|
|
16
16
|
text?: string;
|
|
17
17
|
json?: UndefinableJson;
|
|
18
18
|
form?: HttpForm;
|
|
@@ -20,7 +20,7 @@ export declare type HttpRequestBody = {
|
|
|
20
20
|
blob?: Blob;
|
|
21
21
|
stream?: ReadableStream<Uint8Array>;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
23
|
+
export type HttpRequestAuthorization = {
|
|
24
24
|
basic?: {
|
|
25
25
|
username: string;
|
|
26
26
|
password: string;
|
|
@@ -28,7 +28,7 @@ export declare type HttpRequestAuthorization = {
|
|
|
28
28
|
bearer?: string;
|
|
29
29
|
token?: string;
|
|
30
30
|
};
|
|
31
|
-
export
|
|
31
|
+
export type HttpClientRequestOptions = Partial<TypedOmit<HttpClientRequest, 'url' | 'method' | 'abortToken' | 'abort' | 'headers' | 'query' | 'body'>> & {
|
|
32
32
|
urlParameter?: HttpUrlParametersObject | HttpUrlParameters;
|
|
33
33
|
headers?: HttpHeadersObject | HttpHeaders;
|
|
34
34
|
query?: HttpQueryObject | HttpQuery;
|
|
@@ -42,11 +42,11 @@ export declare type HttpClientRequestOptions = Partial<TypedOmit<HttpClientReque
|
|
|
42
42
|
};
|
|
43
43
|
abortToken?: ReadonlyCancellationToken;
|
|
44
44
|
};
|
|
45
|
-
export
|
|
45
|
+
export type HttpClientRequestObject = HttpClientRequestOptions & {
|
|
46
46
|
url: string;
|
|
47
47
|
method?: HttpMethod;
|
|
48
48
|
};
|
|
49
|
-
export
|
|
49
|
+
export type CredentialsOptions = 'omit' | 'same-origin' | 'include';
|
|
50
50
|
export declare class HttpClientRequest implements Disposable {
|
|
51
51
|
private readonly _abortToken;
|
|
52
52
|
url: string;
|
|
@@ -4,11 +4,11 @@ import { HttpBody } from '../http-body';
|
|
|
4
4
|
import type { HttpHeadersObject } from '../http-headers';
|
|
5
5
|
import { HttpHeaders } from '../http-headers';
|
|
6
6
|
import type { HttpClientRequest, HttpClientRequestObject } from './http-client-request';
|
|
7
|
-
export
|
|
7
|
+
export type HttpClientResponseObject = TypedOmit<HttpClientResponse, 'hasBody' | 'request' | 'headers' | 'close' | 'asObject'> & {
|
|
8
8
|
request: HttpClientRequestObject;
|
|
9
9
|
headers: HttpHeadersObject;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type HttpClientResponseOptions = {
|
|
12
12
|
request: HttpClientRequest;
|
|
13
13
|
statusCode: number;
|
|
14
14
|
statusMessage: string;
|
|
@@ -7,7 +7,7 @@ import type { HttpClientRequestOptions } from './http-client-request';
|
|
|
7
7
|
import { HttpClientRequest } from './http-client-request';
|
|
8
8
|
import type { HttpClientResponse } from './http-client-response';
|
|
9
9
|
import { HttpClientAdapter } from './http-client.adapter';
|
|
10
|
-
export
|
|
10
|
+
export type HttpClientOptions = {
|
|
11
11
|
/**
|
|
12
12
|
* base url for requests when only path is provided
|
|
13
13
|
*/
|
|
@@ -22,11 +22,11 @@ export declare type HttpClientOptions = {
|
|
|
22
22
|
*/
|
|
23
23
|
enableErrorHandling?: boolean;
|
|
24
24
|
};
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export
|
|
25
|
+
export type HttpClientHandler = AsyncMiddlewareHandler<HttpClientRequest, HttpClientResponse>;
|
|
26
|
+
export type HttpClientMiddleware = AsyncMiddleware<HttpClientRequest, HttpClientResponse>;
|
|
27
|
+
export type HttpClientMiddlewareNext = AsyncMiddlewareNext<HttpClientRequest, HttpClientResponse>;
|
|
28
28
|
export declare const HTTP_CLIENT_OPTIONS: import("../../container").InjectionToken<HttpClientOptions, any>;
|
|
29
|
-
export
|
|
29
|
+
export type HttpClientArgument = HttpClientOptions;
|
|
30
30
|
export declare class HttpClient implements Injectable<HttpClientArgument> {
|
|
31
31
|
private readonly adapter;
|
|
32
32
|
private readonly options;
|
package/http/http-body.d.ts
CHANGED
|
@@ -2,10 +2,11 @@ import type { UndefinableJson } from "../types";
|
|
|
2
2
|
import type { AnyIterable } from "../utils/any-iterable-iterator";
|
|
3
3
|
import type { HttpHeaders } from './http-headers';
|
|
4
4
|
import type { ReadBodyOptions } from './utils';
|
|
5
|
-
export
|
|
5
|
+
export type HttpBodySource = undefined | Uint8Array | Blob | AnyIterable<Uint8Array> | ReadableStream<Uint8Array>;
|
|
6
6
|
export declare class HttpBody {
|
|
7
7
|
private readonly body;
|
|
8
8
|
private readonly headers;
|
|
9
|
+
private bodyAlreadyRead;
|
|
9
10
|
get available(): boolean;
|
|
10
11
|
get byteLength(): number | undefined;
|
|
11
12
|
constructor(body: HttpBodySource, headers: HttpHeaders);
|
|
@@ -16,4 +17,5 @@ export declare class HttpBody {
|
|
|
16
17
|
readAsBinaryStream(options?: ReadBodyOptions): ReadableStream<Uint8Array>;
|
|
17
18
|
readAsTextStream(options?: ReadBodyOptions): ReadableStream<string>;
|
|
18
19
|
readAsStream(options?: ReadBodyOptions): ReadableStream<string> | ReadableStream<Uint8Array>;
|
|
20
|
+
private prepareBodyRead;
|
|
19
21
|
}
|
package/http/http-body.js
CHANGED
|
@@ -6,6 +6,7 @@ const utils_1 = require("./utils");
|
|
|
6
6
|
class HttpBody {
|
|
7
7
|
body;
|
|
8
8
|
headers;
|
|
9
|
+
bodyAlreadyRead;
|
|
9
10
|
get available() {
|
|
10
11
|
return (0, type_guards_1.isNotNullOrUndefined)(this.body);
|
|
11
12
|
}
|
|
@@ -15,40 +16,45 @@ class HttpBody {
|
|
|
15
16
|
constructor(body, headers) {
|
|
16
17
|
this.body = body;
|
|
17
18
|
this.headers = headers;
|
|
19
|
+
this.bodyAlreadyRead = false;
|
|
18
20
|
}
|
|
19
21
|
async readAsBuffer(options) {
|
|
20
|
-
|
|
22
|
+
this.prepareBodyRead();
|
|
21
23
|
return (0, utils_1.readBodyAsBuffer)(this.body, this.headers, options);
|
|
22
24
|
}
|
|
23
25
|
async readAsText(options) {
|
|
24
|
-
|
|
26
|
+
this.prepareBodyRead();
|
|
25
27
|
return (0, utils_1.readBodyAsText)(this.body, this.headers, options);
|
|
26
28
|
}
|
|
27
29
|
async readAsJson(options) {
|
|
28
|
-
|
|
30
|
+
this.prepareBodyRead();
|
|
29
31
|
return (0, utils_1.readBodyAsJson)(this.body, this.headers, options);
|
|
30
32
|
}
|
|
31
33
|
async read(options) {
|
|
32
|
-
|
|
34
|
+
this.prepareBodyRead();
|
|
33
35
|
return (0, utils_1.readBody)(this.body, this.headers, options);
|
|
34
36
|
}
|
|
35
37
|
readAsBinaryStream(options) {
|
|
36
|
-
|
|
38
|
+
this.prepareBodyRead();
|
|
37
39
|
return (0, utils_1.readBodyAsBinaryStream)(this.body, this.headers, options);
|
|
38
40
|
}
|
|
39
41
|
readAsTextStream(options) {
|
|
40
|
-
|
|
42
|
+
this.prepareBodyRead();
|
|
41
43
|
return (0, utils_1.readBodyAsTextStream)(this.body, this.headers, options);
|
|
42
44
|
}
|
|
43
45
|
readAsStream(options) {
|
|
44
|
-
|
|
46
|
+
this.prepareBodyRead();
|
|
45
47
|
return (0, utils_1.readBodyAsStream)(this.body, this.headers, options);
|
|
46
48
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
prepareBodyRead() {
|
|
50
|
+
if ((0, type_guards_1.isNullOrUndefined)(this.body)) {
|
|
51
|
+
throw new Error('Body not available.');
|
|
52
|
+
}
|
|
53
|
+
if (this.bodyAlreadyRead) {
|
|
54
|
+
throw new Error('Body was already read.');
|
|
55
|
+
}
|
|
56
|
+
this.bodyAlreadyRead = true;
|
|
52
57
|
}
|
|
53
58
|
}
|
|
59
|
+
exports.HttpBody = HttpBody;
|
|
54
60
|
//# sourceMappingURL=http-body.js.map
|
package/http/http-body.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-body.js","sourceRoot":"","sources":["../../source/http/http-body.ts"],"names":[],"mappings":";;;AAEA,sDAA8E;AAG9E,mCAAqJ;AAIrJ,MAAa,QAAQ;IACF,IAAI,CAAiB;IACrB,OAAO,CAAc;
|
|
1
|
+
{"version":3,"file":"http-body.js","sourceRoot":"","sources":["../../source/http/http-body.ts"],"names":[],"mappings":";;;AAEA,sDAA8E;AAG9E,mCAAqJ;AAIrJ,MAAa,QAAQ;IACF,IAAI,CAAiB;IACrB,OAAO,CAAc;IAE9B,eAAe,CAAU;IAEjC,IAAI,SAAS;QACX,OAAO,IAAA,kCAAoB,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;IACpC,CAAC;IAED,YAAY,IAAoB,EAAE,OAAoB;QACpD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAAyB;QAC1C,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,IAAA,wBAAgB,EAAC,IAAI,CAAC,IAAK,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,OAAyB;QACxC,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,IAAA,sBAAc,EAAC,IAAI,CAAC,IAAK,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;IAED,KAAK,CAAC,UAAU,CAAsB,OAAyB;QAC7D,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,IAAA,sBAAc,EAAC,IAAI,CAAC,IAAK,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAe,CAAC;IACzE,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAyB;QAClC,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,IAAA,gBAAQ,EAAC,IAAI,CAAC,IAAK,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAED,kBAAkB,CAAC,OAAyB;QAC1C,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,IAAA,8BAAsB,EAAC,IAAI,CAAC,IAAK,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;IAED,gBAAgB,CAAC,OAAyB;QACxC,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,IAAA,4BAAoB,EAAC,IAAI,CAAC,IAAK,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAED,YAAY,CAAC,OAAyB;QACpC,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,IAAA,wBAAgB,EAAC,IAAI,CAAC,IAAK,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAEO,eAAe;QACrB,IAAI,IAAA,+BAAiB,EAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAChC,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;SACxC;QAED,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;SAC3C;QAED,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;IAC9B,CAAC;CACF;AAnED,4BAmEC"}
|
package/http/http-form.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { HttpValueMapInput } from './http-value-map';
|
|
2
2
|
import { HttpValueMap } from './http-value-map';
|
|
3
3
|
import type { HttpValueObject, NormalizedHttpValueObject } from './types';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type HttpFormObject = HttpValueObject;
|
|
5
|
+
export type NormalizedHttpFormObject = NormalizedHttpValueObject;
|
|
6
6
|
export declare class HttpForm extends HttpValueMap<HttpForm> {
|
|
7
7
|
constructor(input?: HttpValueMapInput);
|
|
8
8
|
static fromURLSearchParams(urlSearchParams: URLSearchParams): HttpForm;
|
package/http/http-headers.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { HttpValueMapInput } from './http-value-map';
|
|
2
2
|
import { HttpValueMap } from './http-value-map';
|
|
3
3
|
import type { HttpValueObject, NormalizedHttpValueObject } from './types';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
4
|
+
export type HttpHeadersObject = HttpValueObject;
|
|
5
|
+
export type HttpHeadersInput = HttpValueMapInput;
|
|
6
|
+
export type NormalizedHttpHeadersObject = NormalizedHttpValueObject;
|
|
7
7
|
export declare class HttpHeaders extends HttpValueMap<HttpHeaders> {
|
|
8
8
|
get accept(): string | undefined;
|
|
9
9
|
set accept(value: string | undefined);
|
package/http/http-query.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { HttpValueMapInput } from './http-value-map';
|
|
2
2
|
import { HttpValueMap } from './http-value-map';
|
|
3
3
|
import type { HttpValueObject, NormalizedHttpValueObject } from './types';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type HttpQueryObject = HttpValueObject;
|
|
5
|
+
export type NormalizedHttpQueryObject = NormalizedHttpValueObject;
|
|
6
6
|
export declare class HttpQuery extends HttpValueMap<HttpQuery> {
|
|
7
7
|
constructor(input?: HttpValueMapInput);
|
|
8
8
|
static fromURLSearchParams(urlSearchParams: URLSearchParams): HttpQuery;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { HttpValueMapInput } from './http-value-map';
|
|
2
2
|
import { HttpValueMap } from './http-value-map';
|
|
3
3
|
import type { HttpValueObject, NormalizedHttpValueObject } from './types';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type HttpUrlParametersObject = HttpValueObject;
|
|
5
|
+
export type NormalizedHttpUrlParametersObject = NormalizedHttpValueObject;
|
|
6
6
|
export declare class HttpUrlParameters extends HttpValueMap<HttpUrlParameters> {
|
|
7
7
|
constructor(input?: HttpValueMapInput);
|
|
8
8
|
clone(): HttpUrlParameters;
|
package/http/http-value-map.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { OneOrMany, Record } from "../types";
|
|
2
2
|
import type { HttpValue, NormalizedHttpValue, NormalizedHttpValueObject } from './types';
|
|
3
|
-
export
|
|
3
|
+
export type HttpValueMapInput = Record<string, OneOrMany<HttpValue> | undefined> | Iterable<[string, OneOrMany<HttpValue> | undefined]>;
|
|
4
4
|
export declare abstract class HttpValueMap<TThis extends HttpValueMap<any>> implements Iterable<[string, OneOrMany<HttpValue>]> {
|
|
5
5
|
private readonly valueType;
|
|
6
6
|
private readonly caseInsensitive;
|
|
@@ -5,7 +5,7 @@ import { HttpBody } from '../http-body';
|
|
|
5
5
|
import type { HttpHeaders } from '../http-headers';
|
|
6
6
|
import type { HttpQuery } from '../http-query';
|
|
7
7
|
import type { HttpMethod } from '../types';
|
|
8
|
-
export
|
|
8
|
+
export type HttpServerRequestObject = Pick<HttpServerRequest, 'url' | 'method' | 'headers' | 'query' | 'ip'> & {
|
|
9
9
|
body: HttpBody | HttpBodySource;
|
|
10
10
|
context?: StringMap;
|
|
11
11
|
};
|
|
@@ -2,7 +2,7 @@ import type { SeverSentEvents } from "../../sse";
|
|
|
2
2
|
import type { UndefinableJson } from "../../types";
|
|
3
3
|
import type { HttpHeadersInput } from '../http-headers';
|
|
4
4
|
import { HttpHeaders } from '../http-headers';
|
|
5
|
-
export
|
|
5
|
+
export type HttpServerResponseOptions = {
|
|
6
6
|
statusCode?: number | undefined;
|
|
7
7
|
statusMessage?: string | undefined;
|
|
8
8
|
headers?: HttpHeadersInput | HttpHeaders;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AsyncDisposable } from "../../disposable";
|
|
2
2
|
import { disposeAsync } from "../../disposable";
|
|
3
3
|
import type { HttpServerRequest, HttpServerResponse } from "./";
|
|
4
|
-
export
|
|
4
|
+
export type HttpServerRequestContext<Context = unknown> = {
|
|
5
5
|
request: HttpServerRequest;
|
|
6
6
|
context: Context;
|
|
7
7
|
respond(response: HttpServerResponse): Promise<void>;
|
|
@@ -7,7 +7,7 @@ import { Logger } from "../../../logger";
|
|
|
7
7
|
import * as Http from 'http';
|
|
8
8
|
import type { HttpServerRequestContext } from '../http-server';
|
|
9
9
|
import { HttpServer } from '../http-server';
|
|
10
|
-
export
|
|
10
|
+
export type NodeHttpServerContext = {
|
|
11
11
|
nodeRequest: Http.IncomingMessage;
|
|
12
12
|
nodeResponse: Http.ServerResponse;
|
|
13
13
|
};
|
package/http/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { OneOrMany } from "../types";
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
2
|
+
export type HttpValue = string | number | boolean | null;
|
|
3
|
+
export type NormalizedHttpValue = string;
|
|
4
|
+
export type HttpValueObject = Record<string, OneOrMany<HttpValue>>;
|
|
5
|
+
export type NormalizedHttpValueObject = Record<string, OneOrMany<string>>;
|
|
6
|
+
export type HttpMethod = 'HEAD' | 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS';
|
|
7
7
|
export declare function normalizeHttpValue(value: OneOrMany<HttpValue>): OneOrMany<string>;
|
|
8
8
|
export declare function normalizeSingleHttpValue(value: HttpValue): string;
|
|
9
9
|
export declare function denormalizeHttpValue(value: OneOrMany<HttpValue>): OneOrMany<HttpValue>;
|
package/http/utils.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { HttpHeaders } from "./http-headers";
|
|
2
2
|
import type { UndefinableJson } from "../types";
|
|
3
3
|
import type { AnyIterable } from "../utils/any-iterable-iterator";
|
|
4
|
-
|
|
5
|
-
export
|
|
4
|
+
type Body = Uint8Array | Blob | AnyIterable<Uint8Array> | ReadableStream<Uint8Array>;
|
|
5
|
+
export type ReadBodyOptions = {
|
|
6
6
|
maxBytes?: number;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type ReadBodyAsJsonOptions = ReadBodyOptions & {
|
|
9
9
|
fallbackToText?: boolean;
|
|
10
10
|
};
|
|
11
11
|
export declare function readBodyAsBinaryStream(body: Body, headers: HttpHeaders, options?: ReadBodyOptions): ReadableStream<Uint8Array>;
|
|
@@ -2,7 +2,7 @@ import type { Injectable } from "../../container";
|
|
|
2
2
|
import { resolveArgumentType } from "../../container";
|
|
3
3
|
import type { ImageOptions } from '../image-service';
|
|
4
4
|
import { ImageService } from '../image-service';
|
|
5
|
-
export
|
|
5
|
+
export type ImgproxyImageServiceConfig = {
|
|
6
6
|
endpoint: string;
|
|
7
7
|
key: string;
|
|
8
8
|
salt: string;
|
package/json-path/json-path.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type JsonPathNode = PropertyKey;
|
|
2
|
+
export type JsonPathInput = string | JsonPath | Iterable<JsonPathNode>;
|
|
3
3
|
export declare class JsonPath<T = any> implements Iterable<JsonPathNode> {
|
|
4
4
|
private readonly _options;
|
|
5
5
|
private _path;
|
|
@@ -26,7 +26,7 @@ export declare class JsonPath<T = any> implements Iterable<JsonPathNode> {
|
|
|
26
26
|
options(options: JsonPathOptions): JsonPath;
|
|
27
27
|
[Symbol.iterator](): Iterator<PropertyKey>;
|
|
28
28
|
}
|
|
29
|
-
export
|
|
29
|
+
export type JsonPathOptions = {
|
|
30
30
|
/** encode as array.0 instead of array[0] */
|
|
31
31
|
treatArrayAsObject?: boolean;
|
|
32
32
|
/** encode as ['foo'] instead of .foo */
|
|
@@ -34,7 +34,7 @@ export declare type JsonPathOptions = {
|
|
|
34
34
|
/** dont prepend $ */
|
|
35
35
|
noDollar?: boolean;
|
|
36
36
|
};
|
|
37
|
-
export
|
|
37
|
+
export type JsonPathContext = {
|
|
38
38
|
/** if path contains symbols, they are required in order to be mapped, otherwise they are created from global symbol registry */
|
|
39
39
|
symbols?: symbol[];
|
|
40
40
|
};
|
|
@@ -2,7 +2,7 @@ import type { Injectable } from "../container";
|
|
|
2
2
|
import { resolveArgumentType } from "../container";
|
|
3
3
|
import type { StringMap } from '../types';
|
|
4
4
|
/** key value store module */
|
|
5
|
-
export
|
|
5
|
+
export type KeyValueStoreArgument = string;
|
|
6
6
|
export declare abstract class KeyValueStore<KV extends StringMap> implements Injectable<KeyValueStoreArgument> {
|
|
7
7
|
readonly module: string;
|
|
8
8
|
readonly [resolveArgumentType]: KeyValueStoreArgument;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MongoRepositoryConfig } from "../../database/mongo";
|
|
2
2
|
import type { MongoKeyValue } from './mongo-key-value.model';
|
|
3
|
-
export
|
|
3
|
+
export type MongoKeyValueStoreModuleConfig = {
|
|
4
4
|
defaultKeyValueRepositoryConfig: MongoRepositoryConfig<MongoKeyValue> | undefined;
|
|
5
5
|
};
|
|
6
6
|
export declare const mongoKeyValueStoreModuleConfig: MongoKeyValueStoreModuleConfig;
|
package/lock/lock.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Injectable } from "../container";
|
|
2
2
|
import { resolveArgumentType } from "../container";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
3
|
+
export type LockedFunction<R> = (controller: LockController) => R | Promise<R>;
|
|
4
|
+
export type AcquireResult<Throw extends boolean> = Throw extends true ? LockController : (LockController | false);
|
|
5
|
+
export type UsingResult<Throw extends boolean, R> = Throw extends true ? ({
|
|
6
6
|
success: true;
|
|
7
7
|
result: R;
|
|
8
8
|
}) : ({
|
|
@@ -22,7 +22,7 @@ export interface LockController {
|
|
|
22
22
|
release(): Promise<void>;
|
|
23
23
|
}
|
|
24
24
|
/** resource */
|
|
25
|
-
export
|
|
25
|
+
export type LockArgument = string | {
|
|
26
26
|
prefix?: string;
|
|
27
27
|
resource: string;
|
|
28
28
|
};
|
package/lock/mongo/model.d.ts
CHANGED
package/lock/mongo/module.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MongoRepositoryConfig } from "../../database/mongo";
|
|
2
2
|
import type { MongoLockEntity } from './model';
|
|
3
|
-
export
|
|
3
|
+
export type MongoLockModuleConfig = {
|
|
4
4
|
lockEntityRepositoryConfig: MongoRepositoryConfig<MongoLockEntity> | undefined;
|
|
5
5
|
};
|
|
6
6
|
export declare const mongoLockModuleConfig: MongoLockModuleConfig;
|
package/lock/provider.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Injectable } from "../container";
|
|
|
2
2
|
import { resolveArgumentType } from "../container";
|
|
3
3
|
import type { Lock } from './lock';
|
|
4
4
|
/** prefix */
|
|
5
|
-
export
|
|
5
|
+
export type LockProviderArgument = string;
|
|
6
6
|
export declare abstract class LockProvider implements Injectable<LockProviderArgument> {
|
|
7
7
|
readonly [resolveArgumentType]: LockProviderArgument;
|
|
8
8
|
abstract prefix(prefix: string): LockProvider;
|