@privateaim/kit 0.8.14 → 0.8.16
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/CHANGELOG.md +21 -0
- package/dist/crypto/asymmetric/helpers.d.ts +0 -2
- package/dist/crypto/asymmetric/helpers.d.ts.map +1 -1
- package/dist/crypto/asymmetric/module.d.ts +1 -7
- package/dist/crypto/asymmetric/module.d.ts.map +1 -1
- package/dist/crypto/index.d.ts +0 -1
- package/dist/crypto/index.d.ts.map +1 -1
- package/dist/domains/constants.d.ts +7 -0
- package/dist/domains/constants.d.ts.map +1 -0
- package/dist/domains/helpers.d.ts +3 -0
- package/dist/domains/helpers.d.ts.map +1 -0
- package/dist/domains/index.d.ts +2 -0
- package/dist/domains/index.d.ts.map +1 -1
- package/dist/domains/permission/constants.d.ts +6 -0
- package/dist/domains/permission/constants.d.ts.map +1 -1
- package/dist/index.cjs +93 -266
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +88 -264
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.ts +7 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/nanoseconds.d.ts +2 -0
- package/dist/utils/nanoseconds.d.ts.map +1 -0
- package/dist/utils/wait.d.ts +2 -0
- package/dist/utils/wait.d.ts.map +1 -0
- package/package.json +5 -3
- package/src/crypto/asymmetric/helpers.ts +0 -30
- package/src/crypto/asymmetric/module.ts +1 -141
- package/src/crypto/index.ts +0 -1
- package/src/{log/index.ts → domains/constants.ts} +7 -1
- package/src/domains/helpers.ts +24 -0
- package/src/domains/index.ts +3 -0
- package/src/domains/permission/constants.ts +8 -0
- package/src/index.ts +0 -1
- package/src/types.ts +8 -1
- package/src/utils/index.ts +2 -0
- package/src/utils/nanoseconds.ts +14 -0
- package/src/utils/wait.ts +12 -0
- package/dist/crypto/symmetric/index.d.ts +0 -3
- package/dist/crypto/symmetric/index.d.ts.map +0 -1
- package/dist/crypto/symmetric/module.d.ts +0 -10
- package/dist/crypto/symmetric/module.d.ts.map +0 -1
- package/dist/crypto/symmetric/types.d.ts +0 -3
- package/dist/crypto/symmetric/types.d.ts.map +0 -1
- package/dist/log/constants.d.ts +0 -43
- package/dist/log/constants.d.ts.map +0 -1
- package/dist/log/index.d.ts +0 -2
- package/dist/log/index.d.ts.map +0 -1
- package/src/crypto/symmetric/index.ts +0 -9
- package/src/crypto/symmetric/module.ts +0 -71
- package/src/crypto/symmetric/types.ts +0 -10
- package/src/log/constants.ts +0 -56
package/dist/log/constants.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export declare enum LogLevel {
|
|
2
|
-
/**
|
|
3
|
-
* indicates that the system is unusable
|
|
4
|
-
* and requires immediate attention
|
|
5
|
-
*/
|
|
6
|
-
EMERGENCE = "emerg",
|
|
7
|
-
/**
|
|
8
|
-
* indicates that immediate action is necessary
|
|
9
|
-
* to resolve a critical issue.
|
|
10
|
-
*/
|
|
11
|
-
ALERT = "alert",
|
|
12
|
-
/**
|
|
13
|
-
* signifies critical conditions in the program that demand
|
|
14
|
-
* intervention to prevent system failure.
|
|
15
|
-
*/
|
|
16
|
-
CRITICAL = "crit",
|
|
17
|
-
/**
|
|
18
|
-
* indicates error conditions that impair
|
|
19
|
-
* some operation but are less severe than critical situations.
|
|
20
|
-
*/
|
|
21
|
-
ERROR = "error",
|
|
22
|
-
/**
|
|
23
|
-
* signifies potential issues that may lead to errors
|
|
24
|
-
* or unexpected behavior in the future if not addressed.
|
|
25
|
-
*/
|
|
26
|
-
WARNING = "warn",
|
|
27
|
-
/**
|
|
28
|
-
* applies to normal but significant
|
|
29
|
-
* conditions that may require monitoring
|
|
30
|
-
*/
|
|
31
|
-
NOTICE = "notice",
|
|
32
|
-
/**
|
|
33
|
-
* includes messages that provide a record
|
|
34
|
-
* of the normal operation of the system.
|
|
35
|
-
*/
|
|
36
|
-
INFORMATIONAL = "info",
|
|
37
|
-
/**
|
|
38
|
-
* intended for logging detailed information about the system
|
|
39
|
-
* for debugging purposes.
|
|
40
|
-
*/
|
|
41
|
-
DEBUG = "debug"
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/log/constants.ts"],"names":[],"mappings":"AAOA,oBAAY,QAAQ;IAChB;;;OAGG;IACH,SAAS,UAAU;IAEnB;;;OAGG;IACH,KAAK,UAAU;IAEf;;;OAGG;IACH,QAAQ,SAAS;IAEjB;;;OAGG;IACH,KAAK,UAAU;IAEf;;;OAGG;IACH,OAAO,SAAS;IAEhB;;;OAGG;IACH,MAAM,WAAW;IAEjB;;;OAGG;IACH,aAAa,SAAS;IAEtB;;;OAGG;IACH,KAAK,UAAU;CAClB"}
|
package/dist/log/index.d.ts
DELETED
package/dist/log/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/log/index.ts"],"names":[],"mappings":"AAOA,cAAc,aAAa,CAAC"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2024.
|
|
3
|
-
* Author Peter Placzek (tada5hi)
|
|
4
|
-
* For the full copyright and license information,
|
|
5
|
-
* view the LICENSE file that was distributed with this source code.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type { SymmetricAlgorithmParams } from './types';
|
|
9
|
-
|
|
10
|
-
export class CryptoSymmetricAlgorithm {
|
|
11
|
-
protected algorithm : SymmetricAlgorithmParams;
|
|
12
|
-
|
|
13
|
-
constructor(algorithm: SymmetricAlgorithmParams) {
|
|
14
|
-
this.algorithm = algorithm;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
async generateKey() : Promise<CryptoKey> {
|
|
18
|
-
return crypto.subtle.generateKey(
|
|
19
|
-
{
|
|
20
|
-
name: this.algorithm.name,
|
|
21
|
-
length: 256,
|
|
22
|
-
},
|
|
23
|
-
true,
|
|
24
|
-
['encrypt', 'decrypt'],
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
async importKey(buffer: Buffer | ArrayBuffer) : Promise<CryptoKey> {
|
|
29
|
-
return crypto.subtle.importKey(
|
|
30
|
-
'raw',
|
|
31
|
-
buffer,
|
|
32
|
-
{
|
|
33
|
-
name: this.algorithm.name,
|
|
34
|
-
length: 256,
|
|
35
|
-
},
|
|
36
|
-
true,
|
|
37
|
-
['encrypt', 'decrypt'],
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
async encrypt(key: CryptoKey, iv: Buffer, data: Buffer) : Promise<Buffer> {
|
|
42
|
-
const arrayBuffer = await crypto.subtle.encrypt(
|
|
43
|
-
{
|
|
44
|
-
name: this.algorithm.name,
|
|
45
|
-
length: 256,
|
|
46
|
-
iv,
|
|
47
|
-
},
|
|
48
|
-
key,
|
|
49
|
-
data,
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
const buffer = Buffer.from(arrayBuffer);
|
|
53
|
-
|
|
54
|
-
return Buffer.concat([iv, buffer]);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
async decrypt(key: CryptoKey, data: Buffer) : Promise<Buffer> {
|
|
58
|
-
const iv = data.slice(0, 16);
|
|
59
|
-
const arrayBuffer = await crypto.subtle.decrypt(
|
|
60
|
-
{
|
|
61
|
-
name: this.algorithm.name,
|
|
62
|
-
length: 256,
|
|
63
|
-
iv,
|
|
64
|
-
},
|
|
65
|
-
key,
|
|
66
|
-
data.slice(16),
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
return Buffer.from(arrayBuffer);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2024.
|
|
3
|
-
* Author Peter Placzek (tada5hi)
|
|
4
|
-
* For the full copyright and license information,
|
|
5
|
-
* view the LICENSE file that was distributed with this source code.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type { webcrypto } from 'crypto';
|
|
9
|
-
|
|
10
|
-
export type SymmetricAlgorithmParams = webcrypto.AesKeyGenParams;
|
package/src/log/constants.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2025.
|
|
3
|
-
* Author Peter Placzek (tada5hi)
|
|
4
|
-
* For the full copyright and license information,
|
|
5
|
-
* view the LICENSE file that was distributed with this source code.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export enum LogLevel {
|
|
9
|
-
/**
|
|
10
|
-
* indicates that the system is unusable
|
|
11
|
-
* and requires immediate attention
|
|
12
|
-
*/
|
|
13
|
-
EMERGENCE = 'emerg',
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* indicates that immediate action is necessary
|
|
17
|
-
* to resolve a critical issue.
|
|
18
|
-
*/
|
|
19
|
-
ALERT = 'alert',
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* signifies critical conditions in the program that demand
|
|
23
|
-
* intervention to prevent system failure.
|
|
24
|
-
*/
|
|
25
|
-
CRITICAL = 'crit',
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* indicates error conditions that impair
|
|
29
|
-
* some operation but are less severe than critical situations.
|
|
30
|
-
*/
|
|
31
|
-
ERROR = 'error',
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* signifies potential issues that may lead to errors
|
|
35
|
-
* or unexpected behavior in the future if not addressed.
|
|
36
|
-
*/
|
|
37
|
-
WARNING = 'warn',
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* applies to normal but significant
|
|
41
|
-
* conditions that may require monitoring
|
|
42
|
-
*/
|
|
43
|
-
NOTICE = 'notice',
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* includes messages that provide a record
|
|
47
|
-
* of the normal operation of the system.
|
|
48
|
-
*/
|
|
49
|
-
INFORMATIONAL = 'info',
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* intended for logging detailed information about the system
|
|
53
|
-
* for debugging purposes.
|
|
54
|
-
*/
|
|
55
|
-
DEBUG = 'debug',
|
|
56
|
-
}
|