@tstdl/base 0.88.7 → 0.89.1
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/index.d.ts +7 -3
- package/api/index.js +7 -3
- package/application/index.d.ts +5 -0
- package/application/index.js +5 -0
- package/authentication/client/authentication.service.d.ts +1 -1
- package/authentication/client/authentication.service.js +4 -4
- package/authentication/client/http-client.middleware.d.ts +2 -2
- package/authentication/client/module.d.ts +2 -2
- package/authentication/client/module.js +2 -2
- package/authentication/index.d.ts +7 -0
- package/authentication/index.js +7 -0
- package/browser/index.d.ts +5 -0
- package/browser/index.js +5 -0
- package/cancellation/index.d.ts +4 -0
- package/cancellation/index.js +4 -0
- package/collections/index.d.ts +5 -0
- package/collections/index.js +5 -0
- package/cookie/index.d.ts +5 -0
- package/cookie/index.js +5 -0
- package/data-structures/index.d.ts +5 -0
- package/data-structures/index.js +5 -0
- package/database/index.d.ts +5 -0
- package/database/index.js +5 -0
- package/database/mongo/index.d.ts +5 -0
- package/database/mongo/index.js +5 -0
- package/database/mongo/module.js +1 -1
- package/decorators/index.d.ts +5 -0
- package/decorators/index.js +5 -0
- package/disposable/index.d.ts +5 -0
- package/disposable/index.js +5 -0
- package/distributed-loop/index.d.ts +5 -0
- package/distributed-loop/index.js +5 -0
- package/enumerable/index.d.ts +5 -0
- package/enumerable/index.js +5 -0
- package/error/index.d.ts +5 -0
- package/error/index.js +5 -0
- package/examples/api/authentication.js +2 -2
- package/examples/api/basic-overview.js +1 -1
- package/examples/api/custom-authentication.js +2 -2
- package/examples/api/streaming.js +1 -1
- package/examples/http/client.js +1 -1
- package/function/index.d.ts +5 -0
- package/function/index.js +5 -0
- package/http/client/adapters/{undici-http-client.adapter.d.ts → undici.adapter.d.ts} +4 -2
- package/http/client/adapters/{undici-http-client.adapter.js → undici.adapter.js} +3 -15
- package/http/index.d.ts +6 -0
- package/http/index.js +6 -0
- package/http/server/index.d.ts +2 -1
- package/http/server/index.js +2 -1
- package/image-service/index.d.ts +6 -0
- package/image-service/index.js +6 -0
- package/index.d.ts +5 -0
- package/index.js +5 -0
- package/injector/index.d.ts +5 -0
- package/injector/index.js +5 -0
- package/json-path/index.d.ts +5 -0
- package/json-path/index.js +5 -0
- package/key-value-store/index.d.ts +6 -0
- package/key-value-store/index.js +6 -0
- package/lock/index.d.ts +7 -0
- package/lock/index.js +7 -0
- package/lock/mongo/lock.d.ts +1 -2
- package/lock/mongo/lock.js +9 -9
- package/lock/mongo/provider.d.ts +3 -7
- package/lock/mongo/provider.js +14 -24
- package/logger/index.d.ts +7 -0
- package/logger/index.js +7 -0
- package/mail/index.d.ts +6 -1
- package/mail/index.js +6 -1
- package/mail/repositories/index.d.ts +2 -1
- package/mail/repositories/index.js +2 -1
- package/memory/index.d.ts +5 -0
- package/memory/index.js +5 -0
- package/message-bus/index.d.ts +7 -0
- package/message-bus/index.js +7 -0
- package/migration/index.d.ts +6 -0
- package/migration/index.js +6 -0
- package/module/index.d.ts +6 -0
- package/module/index.js +6 -0
- package/object-storage/index.d.ts +8 -2
- package/object-storage/index.js +8 -2
- package/openid-connect/index.d.ts +5 -0
- package/openid-connect/index.js +5 -0
- package/package.json +7 -24
- package/password/index.d.ts +5 -0
- package/password/index.js +5 -0
- package/pdf/pdf.service.d.ts +5 -0
- package/pdf/pdf.service.js +5 -0
- package/pool/index.d.ts +5 -0
- package/pool/index.js +5 -0
- package/promise/cancelable-promise.d.ts +10 -2
- package/promise/cancelable-promise.js +23 -19
- package/promise/custom-promise.d.ts +6 -0
- package/promise/custom-promise.js +14 -0
- package/promise/deferred-promise.d.ts +3 -3
- package/promise/deferred-promise.js +5 -8
- package/promise/index.d.ts +6 -0
- package/promise/index.js +6 -0
- package/promise/lazy-promise.d.ts +6 -6
- package/promise/lazy-promise.js +23 -15
- package/promise/types.d.ts +3 -0
- package/promise/types.js +1 -0
- package/utils/type-guards.d.ts +6 -0
- package/utils/type-guards.js +7 -0
- package/container/decorators.d.ts +0 -2
- package/container/decorators.js +0 -1
- package/container/index.d.ts +0 -3
- package/container/index.js +0 -3
- package/container/interfaces.d.ts +0 -2
- package/container/interfaces.js +0 -1
- package/container/token.d.ts +0 -2
- package/container/token.js +0 -1
- package/http/client/adapters/index.d.ts +0 -1
- package/http/client/adapters/index.js +0 -1
package/injector/index.js
CHANGED
package/json-path/index.d.ts
CHANGED
package/json-path/index.js
CHANGED
package/key-value-store/index.js
CHANGED
package/lock/index.d.ts
CHANGED
package/lock/index.js
CHANGED
package/lock/mongo/lock.d.ts
CHANGED
|
@@ -3,8 +3,7 @@ import { Lock } from '../../lock/index.js';
|
|
|
3
3
|
import { Logger } from '../../logger/index.js';
|
|
4
4
|
import { MongoLockRepository } from './mongo-lock-repository.js';
|
|
5
5
|
export declare class MongoLock extends Lock {
|
|
6
|
-
private
|
|
7
|
-
private readonly logger;
|
|
6
|
+
#private;
|
|
8
7
|
constructor(lockRepository: MongoLockRepository, resource: string, logger: Logger);
|
|
9
8
|
acquire<Throw extends boolean>(timeout: number | undefined, throwOnFail: Throw): Promise<AcquireResult<Throw>>;
|
|
10
9
|
use<Throw extends boolean, R>(timeout: number | undefined, throwOnFail: Throw, func: LockedFunction<R>): Promise<UsingResult<Throw, R>>;
|
package/lock/mongo/lock.js
CHANGED
|
@@ -22,12 +22,12 @@ import { MongoLockProvider } from './provider.js';
|
|
|
22
22
|
const expirationTime = 10000;
|
|
23
23
|
const renewBuffer = expirationTime / 2;
|
|
24
24
|
let MongoLock = class MongoLock extends Lock {
|
|
25
|
-
lockRepository;
|
|
26
|
-
logger;
|
|
25
|
+
#lockRepository;
|
|
26
|
+
#logger;
|
|
27
27
|
constructor(lockRepository, resource, logger) {
|
|
28
28
|
super(resource);
|
|
29
|
-
this
|
|
30
|
-
this
|
|
29
|
+
this.#lockRepository = lockRepository;
|
|
30
|
+
this.#logger = logger;
|
|
31
31
|
}
|
|
32
32
|
async acquire(timeout, throwOnFail) {
|
|
33
33
|
const key = getRandomString(15, Alphabet.LowerUpperCaseNumbers);
|
|
@@ -69,7 +69,7 @@ let MongoLock = class MongoLock extends Lock {
|
|
|
69
69
|
expiration = (refreshResult == false) ? new Date(0) : refreshResult; // eslint-disable-line require-atomic-updates
|
|
70
70
|
}
|
|
71
71
|
catch (error) {
|
|
72
|
-
this
|
|
72
|
+
this.#logger.error(error);
|
|
73
73
|
}
|
|
74
74
|
finally {
|
|
75
75
|
await cancelableTimeoutUntil(Math.max(currentTimestamp() + 1000, expiration.valueOf() - renewBuffer), releaseToken);
|
|
@@ -92,18 +92,18 @@ let MongoLock = class MongoLock extends Lock {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
async exists() {
|
|
95
|
-
return this
|
|
95
|
+
return this.#lockRepository.exists(this.resource);
|
|
96
96
|
}
|
|
97
97
|
async tryAcquireOrRefresh(resource, key) {
|
|
98
98
|
const expirationDate = getExpirationDate();
|
|
99
|
-
return this
|
|
99
|
+
return this.#lockRepository.tryInsertOrRefresh(resource, key, expirationDate);
|
|
100
100
|
}
|
|
101
101
|
async tryRefresh(resource, key) {
|
|
102
102
|
const expiration = getExpirationDate();
|
|
103
|
-
return this
|
|
103
|
+
return this.#lockRepository.tryUpdateExpiration(resource, key, expiration);
|
|
104
104
|
}
|
|
105
105
|
async release(resource, key) {
|
|
106
|
-
return this
|
|
106
|
+
return this.#lockRepository.deleteByResource(resource, key);
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
109
|
MongoLock = __decorate([
|
package/lock/mongo/provider.d.ts
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import type { Lock } from '../../lock/index.js';
|
|
2
2
|
import { LockProvider } from '../../lock/index.js';
|
|
3
|
-
import { Logger } from '../../logger/index.js';
|
|
4
|
-
import { MongoLockRepository } from './mongo-lock-repository.js';
|
|
5
3
|
export declare class MongoLockProvider extends LockProvider {
|
|
6
|
-
private
|
|
7
|
-
|
|
8
|
-
private readonly _prefix;
|
|
9
|
-
constructor(lockRepository: MongoLockRepository, logger: Logger, prefix?: string);
|
|
10
|
-
prefix(prefix: string): LockProvider;
|
|
4
|
+
#private;
|
|
5
|
+
prefix(prefix: string): MongoLockProvider;
|
|
11
6
|
get(resource: string): Lock;
|
|
7
|
+
private getResourceString;
|
|
12
8
|
}
|
package/lock/mongo/provider.js
CHANGED
|
@@ -4,43 +4,33 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
-
};
|
|
13
7
|
var MongoLockProvider_1;
|
|
14
|
-
import {
|
|
8
|
+
import { Singleton } from '../../injector/decorators.js';
|
|
9
|
+
import { inject, injectArgument } from '../../injector/inject.js';
|
|
10
|
+
import { Injector } from '../../injector/injector.js';
|
|
15
11
|
import { LockProvider } from '../../lock/index.js';
|
|
16
12
|
import { Logger } from '../../logger/index.js';
|
|
17
13
|
import { assertDefinedPass } from '../../utils/type-guards.js';
|
|
18
14
|
import { MongoLock } from './lock.js';
|
|
19
15
|
import { mongoLockModuleConfig } from './module.js';
|
|
20
16
|
import { MongoLockRepository } from './mongo-lock-repository.js';
|
|
21
|
-
const collectionArgumentProvider = () => assertDefinedPass(mongoLockModuleConfig.lockEntityRepositoryConfig, 'mongo lock module not configured');
|
|
22
17
|
let MongoLockProvider = MongoLockProvider_1 = class MongoLockProvider extends LockProvider {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
super();
|
|
28
|
-
this.lockRepository = lockRepository;
|
|
29
|
-
this.logger = logger;
|
|
30
|
-
this._prefix = prefix;
|
|
31
|
-
}
|
|
18
|
+
#injector = inject(Injector);
|
|
19
|
+
#lockRepository = inject(MongoLockRepository, assertDefinedPass(mongoLockModuleConfig.lockEntityRepositoryConfig, 'mongo lock module not configured'));
|
|
20
|
+
#logger = inject(Logger, 'MongoLock');
|
|
21
|
+
#prefix = injectArgument(this);
|
|
32
22
|
prefix(prefix) {
|
|
33
|
-
return
|
|
23
|
+
return this.#injector.resolve(MongoLockProvider_1, this.getResourceString(prefix));
|
|
34
24
|
}
|
|
35
25
|
get(resource) {
|
|
36
|
-
return new MongoLock(this
|
|
26
|
+
return new MongoLock(this.#lockRepository, this.getResourceString(resource), this.#logger);
|
|
27
|
+
}
|
|
28
|
+
getResourceString(resource) {
|
|
29
|
+
const prefixDivider = (this.#prefix.length > 0) ? ':' : '';
|
|
30
|
+
return `${this.#prefix}${prefixDivider}${resource}`;
|
|
37
31
|
}
|
|
38
32
|
};
|
|
39
33
|
MongoLockProvider = MongoLockProvider_1 = __decorate([
|
|
40
|
-
Singleton()
|
|
41
|
-
__param(0, ResolveArgProvider(collectionArgumentProvider)),
|
|
42
|
-
__param(1, ResolveArg('MongoLock')),
|
|
43
|
-
__param(2, InjectArg()),
|
|
44
|
-
__metadata("design:paramtypes", [MongoLockRepository, Logger, String])
|
|
34
|
+
Singleton()
|
|
45
35
|
], MongoLockProvider);
|
|
46
36
|
export { MongoLockProvider };
|
package/logger/index.d.ts
CHANGED
package/logger/index.js
CHANGED
package/mail/index.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Send mails with template support
|
|
3
|
+
*
|
|
4
|
+
* @module Mail
|
|
5
|
+
*/
|
|
6
|
+
export * from './clients/index.js';
|
|
1
7
|
export * from './mail.client.js';
|
|
2
8
|
export * from './mail.service.js';
|
|
3
9
|
export * from './models/index.js';
|
|
4
10
|
export * from './module.js';
|
|
5
11
|
export * from './repositories/index.js';
|
|
6
|
-
export * from './repositories/mail-log.repository.js';
|
|
7
12
|
export * from './tokens.js';
|
package/mail/index.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Send mails with template support
|
|
3
|
+
*
|
|
4
|
+
* @module Mail
|
|
5
|
+
*/
|
|
6
|
+
export * from './clients/index.js';
|
|
1
7
|
export * from './mail.client.js';
|
|
2
8
|
export * from './mail.service.js';
|
|
3
9
|
export * from './models/index.js';
|
|
4
10
|
export * from './module.js';
|
|
5
11
|
export * from './repositories/index.js';
|
|
6
|
-
export * from './repositories/mail-log.repository.js';
|
|
7
12
|
export * from './tokens.js';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './mail-log.repository.js';
|
|
2
|
+
export * from './mongo/index.js';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './mail-log.repository.js';
|
|
2
|
+
export * from './mongo/index.js';
|
package/memory/index.d.ts
CHANGED
package/memory/index.js
CHANGED
package/message-bus/index.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message broadcasting
|
|
3
|
+
*
|
|
4
|
+
* @module Message Bus
|
|
5
|
+
*/
|
|
6
|
+
export * from './broadcast-channel/index.js';
|
|
7
|
+
export * from './local/index.js';
|
|
1
8
|
export * from './message-bus-base.js';
|
|
2
9
|
export * from './message-bus-provider.js';
|
|
3
10
|
export * from './message-bus.js';
|
package/message-bus/index.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message broadcasting
|
|
3
|
+
*
|
|
4
|
+
* @module Message Bus
|
|
5
|
+
*/
|
|
6
|
+
export * from './broadcast-channel/index.js';
|
|
7
|
+
export * from './local/index.js';
|
|
1
8
|
export * from './message-bus-base.js';
|
|
2
9
|
export * from './message-bus-provider.js';
|
|
3
10
|
export * from './message-bus.js';
|
package/migration/index.d.ts
CHANGED
package/migration/index.js
CHANGED
package/module/index.d.ts
CHANGED
package/module/index.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Storage for objects/files
|
|
3
|
+
*
|
|
4
|
+
* @module Object Storage
|
|
5
|
+
*/
|
|
3
6
|
export * from './object-storage-provider.js';
|
|
7
|
+
export * from './object-storage.js';
|
|
8
|
+
export * from './object.js';
|
|
9
|
+
export * from './s3/index.js';
|
package/object-storage/index.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Storage for objects/files
|
|
3
|
+
*
|
|
4
|
+
* @module Object Storage
|
|
5
|
+
*/
|
|
3
6
|
export * from './object-storage-provider.js';
|
|
7
|
+
export * from './object-storage.js';
|
|
8
|
+
export * from './object.js';
|
|
9
|
+
export * from './s3/index.js';
|
package/openid-connect/index.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OIDC (OAuth 2.0) client implementation
|
|
3
|
+
*
|
|
4
|
+
* @module OpenID Connect
|
|
5
|
+
*/
|
|
1
6
|
import { Injector } from '../injector/injector.js';
|
|
2
7
|
import { CachedOidcConfigurationService } from './cached-oidc-configuration.service.js';
|
|
3
8
|
import { OidcConfigurationService } from './oidc-configuration.service.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tstdl/base",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.89.1",
|
|
4
4
|
"author": "Patrick Hein",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"build:production": "rm -rf dist && npm run build && npm run build:production:copy-files",
|
|
13
13
|
"build:production:copy-files": "cp package.json .eslintrc.json tsconfig.server.json dist/ && cp tsconfig.base.json dist/tsconfig.json",
|
|
14
14
|
"build:docs": "typedoc",
|
|
15
|
-
"build:docs
|
|
15
|
+
"build:docs:watch": "typedoc --watch",
|
|
16
16
|
"lint": "eslint -c .eslintrc.json --ext .ts .",
|
|
17
17
|
"pub": "npm run build:production && rm -vf dist/test* && npm publish dist/",
|
|
18
18
|
"tsc:watch": "tsc --watch",
|
|
@@ -32,12 +32,8 @@
|
|
|
32
32
|
"./web-types": "./web-types.js",
|
|
33
33
|
|
|
34
34
|
"./api": "./api/index.js",
|
|
35
|
-
"./api/client": "./api/client/index.js",
|
|
36
|
-
"./api/server": "./api/server/index.js",
|
|
37
35
|
"./application": "./application/index.js",
|
|
38
36
|
"./authentication": "./authentication/index.js",
|
|
39
|
-
"./authentication/client": "./authentication/client/index.js",
|
|
40
|
-
"./authentication/server": "./authentication/server/index.js",
|
|
41
37
|
"./browser": "./browser/index.js",
|
|
42
38
|
"./cancellation": "./cancellation/index.js",
|
|
43
39
|
"./cookie": "./cookie/index.js",
|
|
@@ -51,34 +47,19 @@
|
|
|
51
47
|
"./error": "./error/index.js",
|
|
52
48
|
"./function": "./function/index.js",
|
|
53
49
|
"./http": "./http/index.js",
|
|
54
|
-
"./http/
|
|
55
|
-
"./http/server": "./http/server/index.js",
|
|
56
|
-
"./http/server/node": "./http/server/node/index.js",
|
|
50
|
+
"./http/adapters/undici": "./http/client/adapters/undici.adapter.ts",
|
|
57
51
|
"./image-service": "./image-service/index.js",
|
|
58
|
-
"./image-service/imgproxy": "./image-service/imgproxy/index.js",
|
|
59
52
|
"./injector": "./injector/index.js",
|
|
60
53
|
"./json-path": "./json-path/index.js",
|
|
61
54
|
"./key-value-store": "./key-value-store/index.js",
|
|
62
|
-
"./key-value-store/mongo": "./key-value-store/mongo/index.js",
|
|
63
55
|
"./lock": "./lock/index.js",
|
|
64
|
-
"./lock/mongo": "./lock/mongo/index.js",
|
|
65
|
-
"./lock/web": "./lock/web/index.js",
|
|
66
56
|
"./logger": "./logger/index.js",
|
|
67
|
-
"./logger/console": "./logger/console/index.js",
|
|
68
|
-
"./logger/noop": "./logger/noop/index.js",
|
|
69
57
|
"./mail": "./mail/index.js",
|
|
70
|
-
"./mail/clients": "./mail/clients/index.js",
|
|
71
|
-
"./mail/repositories/mongo": "./mail/repositories/mongo/index.js",
|
|
72
58
|
"./memory": "./memory/index.js",
|
|
73
59
|
"./message-bus": "./message-bus/index.js",
|
|
74
|
-
"./message-bus/broadcast-channel": "./message-bus/broadcast-channel/index.js",
|
|
75
|
-
"./message-bus/local": "./message-bus/local/index.js",
|
|
76
60
|
"./migration": "./migration/index.js",
|
|
77
|
-
"./migration/mongo": "./migration/mongo/index.js",
|
|
78
61
|
"./module": "./module/index.js",
|
|
79
|
-
"./module/modules": "./module/modules/index.js",
|
|
80
62
|
"./object-storage": "./object-storage/index.js",
|
|
81
|
-
"./object-storage/s3": "./object-storage/s3/index.js",
|
|
82
63
|
"./openid-connect": "./openid-connect/index.js",
|
|
83
64
|
"./password": "./password/index.js",
|
|
84
65
|
"./pdf": "./pdf/index.js",
|
|
@@ -127,6 +108,7 @@
|
|
|
127
108
|
"type-fest": "^4.3"
|
|
128
109
|
},
|
|
129
110
|
"devDependencies": {
|
|
111
|
+
"@mxssfd/typedoc-theme": "1.1",
|
|
130
112
|
"@types/chroma-js": "2.4",
|
|
131
113
|
"@types/koa__router": "12.0",
|
|
132
114
|
"@types/luxon": "3.3",
|
|
@@ -143,12 +125,13 @@
|
|
|
143
125
|
"eslint-plugin-import": "2.28",
|
|
144
126
|
"tsc-alias": "1.8",
|
|
145
127
|
"typedoc": "0.25",
|
|
128
|
+
"typedoc-plugin-missing-exports": "2.1",
|
|
146
129
|
"typescript": "5.2"
|
|
147
130
|
},
|
|
148
131
|
"peerDependencies": {
|
|
149
132
|
"@elastic/elasticsearch": "^8.9",
|
|
150
133
|
"@koa/router": "^12.0",
|
|
151
|
-
"@tstdl/angular": "^0.
|
|
134
|
+
"@tstdl/angular": "^0.89",
|
|
152
135
|
"@zxcvbn-ts/core": "^3.0",
|
|
153
136
|
"@zxcvbn-ts/language-common": "^3.0",
|
|
154
137
|
"@zxcvbn-ts/language-de": "^3.0",
|
|
@@ -164,7 +147,7 @@
|
|
|
164
147
|
"playwright": "^1.38",
|
|
165
148
|
"preact": "^10.17",
|
|
166
149
|
"preact-render-to-string": "^6.2",
|
|
167
|
-
"undici": "^5.
|
|
150
|
+
"undici": "^5.25",
|
|
168
151
|
"urlpattern-polyfill": "^9.0"
|
|
169
152
|
},
|
|
170
153
|
"peerDependenciesMeta": {
|
package/password/index.d.ts
CHANGED
package/password/index.js
CHANGED
package/pdf/pdf.service.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PDF generation
|
|
3
|
+
*
|
|
4
|
+
* @module PDF
|
|
5
|
+
*/
|
|
1
6
|
import { BrowserContextController } from '../browser/browser-context-controller.js';
|
|
2
7
|
import type { BrowserControllerArgument } from '../browser/browser-controller.js';
|
|
3
8
|
import { BrowserController } from '../browser/browser-controller.js';
|
package/pdf/pdf.service.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PDF generation
|
|
3
|
+
*
|
|
4
|
+
* @module PDF
|
|
5
|
+
*/
|
|
1
6
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
7
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
8
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
package/pool/index.d.ts
CHANGED
package/pool/index.js
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import { type CancellationSignal } from '../cancellation/token.js';
|
|
2
|
+
import { CustomPromise } from './custom-promise.js';
|
|
3
|
+
export type CancelablePromiseExecutor<T> = (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void, cancellationSignal: CancellationSignal) => void;
|
|
4
|
+
export type CancelablePromiseResult<T, R> = {
|
|
2
5
|
canceled: true;
|
|
6
|
+
reason: R;
|
|
3
7
|
} | {
|
|
4
8
|
canceled: false;
|
|
5
9
|
value: T;
|
|
6
10
|
};
|
|
7
|
-
export declare
|
|
11
|
+
export declare class CancelablePromise<T, R = void> extends CustomPromise<CancelablePromiseResult<T, R>> {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(executor: CancelablePromiseExecutor<T>);
|
|
14
|
+
cancel(reason: R): void;
|
|
15
|
+
}
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { CancellationToken } from '../cancellation/token.js';
|
|
2
|
+
import { CustomPromise } from './custom-promise.js';
|
|
3
|
+
export class CancelablePromise extends CustomPromise {
|
|
4
|
+
#cancellationToken = new CancellationToken();
|
|
5
|
+
#resolve;
|
|
6
|
+
#reject;
|
|
7
|
+
#pending = true;
|
|
8
|
+
constructor(executor) {
|
|
9
|
+
super();
|
|
10
|
+
this.#resolve = (value) => {
|
|
11
|
+
if (this.#pending) {
|
|
12
|
+
this.resolve(value);
|
|
13
|
+
this.#pending = false;
|
|
9
14
|
}
|
|
10
15
|
};
|
|
11
|
-
|
|
12
|
-
if (pending) {
|
|
13
|
-
reject(reason);
|
|
14
|
-
pending = false;
|
|
16
|
+
this.#reject = (reason) => {
|
|
17
|
+
if (this.#pending) {
|
|
18
|
+
this.reject(reason);
|
|
19
|
+
this.#pending = false;
|
|
15
20
|
}
|
|
16
21
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
22
|
+
executor((value) => this.#resolve(Promise.resolve(value).then((result) => ({ canceled: false, value: result }))), this.#reject, this.#cancellationToken.signal);
|
|
23
|
+
}
|
|
24
|
+
cancel(reason) {
|
|
25
|
+
this.#cancellationToken.set();
|
|
26
|
+
this.#resolve({ canceled: true, reason });
|
|
27
|
+
}
|
|
24
28
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PromiseRejectFunction, PromiseResolveFunction } from './types.js';
|
|
2
|
+
export declare class CustomPromise<T> extends Promise<T> {
|
|
3
|
+
protected readonly resolve: PromiseResolveFunction<T>;
|
|
4
|
+
protected readonly reject: PromiseRejectFunction;
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class CustomPromise extends Promise {
|
|
2
|
+
resolve;
|
|
3
|
+
reject;
|
|
4
|
+
constructor() {
|
|
5
|
+
let _resolve;
|
|
6
|
+
let _reject;
|
|
7
|
+
super((resolve, reject) => {
|
|
8
|
+
_resolve = resolve;
|
|
9
|
+
_reject = reject;
|
|
10
|
+
});
|
|
11
|
+
this.resolve = _resolve;
|
|
12
|
+
this.reject = _reject;
|
|
13
|
+
}
|
|
14
|
+
}
|