@plyaz/config 1.0.4 → 1.0.5
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/dist/api.d.ts +22 -0
- package/dist/app.d.ts +12 -0
- package/dist/chains/contracts.d.ts +18 -0
- package/dist/chains/index.d.ts +2 -0
- package/dist/chains/supportedChains.d.ts +178 -0
- package/dist/constants.d.ts +3 -0
- package/dist/display/constants.d.ts +50 -0
- package/dist/display/index.d.ts +6 -0
- package/dist/domains.d.ts +4 -0
- package/dist/env.d.ts +4 -0
- package/dist/features.d.ts +30 -0
- package/dist/http/constants.d.ts +53 -0
- package/dist/http/index.d.ts +6 -0
- package/dist/index.cjs +3 -481
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +16 -0
- package/dist/index.mjs +3 -447
- package/dist/index.mjs.map +1 -1
- package/dist/math/constants.d.ts +82 -0
- package/dist/math/index.d.ts +6 -0
- package/dist/network/constants.d.ts +37 -0
- package/dist/network/index.d.ts +6 -0
- package/dist/performance/index.d.ts +30 -0
- package/dist/providers/alchemy.d.ts +11 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/oauth.d.ts +20 -0
- package/dist/security.d.ts +3 -0
- package/dist/time/constants.d.ts +69 -0
- package/dist/time/index.d.ts +6 -0
- package/dist/utils/collection/constants.d.ts +33 -0
- package/dist/utils/collection/index.d.ts +6 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/string/constants.d.ts +37 -0
- package/dist/utils/string/index.d.ts +6 -0
- package/package.json +2 -2
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network-related Constants
|
|
3
|
+
*
|
|
4
|
+
* Constants for network operations including IP addresses,
|
|
5
|
+
* byte ranges, and process identifiers.
|
|
6
|
+
*
|
|
7
|
+
* @module network/constants
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Network and connection constants
|
|
11
|
+
*/
|
|
12
|
+
export declare const NETWORK_CONSTANTS: {
|
|
13
|
+
/**
|
|
14
|
+
* Minimum value for an IPv4 octet (excluding 0 for first octet)
|
|
15
|
+
*/
|
|
16
|
+
readonly IPV4_OCTET_MIN: 1;
|
|
17
|
+
/**
|
|
18
|
+
* Maximum value for an IPv4 octet
|
|
19
|
+
*/
|
|
20
|
+
readonly IPV4_OCTET_MAX: 255;
|
|
21
|
+
/**
|
|
22
|
+
* Number of octets in an IPv4 address
|
|
23
|
+
*/
|
|
24
|
+
readonly IPV4_OCTET_COUNT: 4;
|
|
25
|
+
/**
|
|
26
|
+
* Maximum value for a random byte (256 exclusive)
|
|
27
|
+
*/
|
|
28
|
+
readonly RANDOM_BYTE_MAX: 256;
|
|
29
|
+
/**
|
|
30
|
+
* Default maximum process ID for testing
|
|
31
|
+
*/
|
|
32
|
+
readonly DEFAULT_PROCESS_ID_MAX: 10000;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Type for network constant values
|
|
36
|
+
*/
|
|
37
|
+
export type NetworkConstant = (typeof NETWORK_CONSTANTS)[keyof typeof NETWORK_CONSTANTS];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performance Module
|
|
3
|
+
*
|
|
4
|
+
* Performance monitoring and benchmarking constants used for
|
|
5
|
+
* measuring application performance, detecting memory leaks,
|
|
6
|
+
* and configuring performance tests.
|
|
7
|
+
*
|
|
8
|
+
* @module performance
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Performance measurement constants
|
|
12
|
+
*/
|
|
13
|
+
export declare const PERFORMANCE_CONSTANTS: {
|
|
14
|
+
/**
|
|
15
|
+
* Threshold for detecting memory leaks (10% growth)
|
|
16
|
+
*/
|
|
17
|
+
readonly MEMORY_LEAK_THRESHOLD: 0.1;
|
|
18
|
+
/**
|
|
19
|
+
* Default number of benchmark runs for performance testing
|
|
20
|
+
*/
|
|
21
|
+
readonly DEFAULT_BENCHMARK_RUNS: 100;
|
|
22
|
+
/**
|
|
23
|
+
* Default number of warmup runs before benchmarking
|
|
24
|
+
*/
|
|
25
|
+
readonly DEFAULT_WARMUP_RUNS: 10;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Type for performance constant values
|
|
29
|
+
*/
|
|
30
|
+
export type PerformanceConstant = (typeof PERFORMANCE_CONSTANTS)[keyof typeof PERFORMANCE_CONSTANTS];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const OAUTH_PROVIDERS: {
|
|
2
|
+
readonly google: {
|
|
3
|
+
readonly clientId: string;
|
|
4
|
+
readonly clientSecret: string;
|
|
5
|
+
readonly redirectUri: string;
|
|
6
|
+
readonly scopes: readonly ["openid", "profile", "email"];
|
|
7
|
+
};
|
|
8
|
+
readonly discord: {
|
|
9
|
+
readonly clientId: string;
|
|
10
|
+
readonly clientSecret: string;
|
|
11
|
+
readonly redirectUri: string;
|
|
12
|
+
readonly scopes: readonly ["identify", "email"];
|
|
13
|
+
};
|
|
14
|
+
readonly facebook: {
|
|
15
|
+
readonly clientId: string;
|
|
16
|
+
readonly clientSecret: string;
|
|
17
|
+
readonly redirectUri: string;
|
|
18
|
+
readonly scopes: readonly ["public_profile", "email"];
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time-related Constants
|
|
3
|
+
*
|
|
4
|
+
* Common time values and durations used throughout the application
|
|
5
|
+
* for timeouts, delays, caching, and other time-based operations.
|
|
6
|
+
*
|
|
7
|
+
* @module time/constants
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Time conversion and duration constants
|
|
11
|
+
*/
|
|
12
|
+
export declare const TIME_CONSTANTS: {
|
|
13
|
+
/**
|
|
14
|
+
* Number of milliseconds in one second
|
|
15
|
+
*/
|
|
16
|
+
readonly MILLISECONDS_PER_SECOND: 1000;
|
|
17
|
+
/**
|
|
18
|
+
* Number of seconds in one minute
|
|
19
|
+
*/
|
|
20
|
+
readonly SECONDS_PER_MINUTE: 60;
|
|
21
|
+
/**
|
|
22
|
+
* Number of minutes in one hour
|
|
23
|
+
*/
|
|
24
|
+
readonly MINUTES_PER_HOUR: 60;
|
|
25
|
+
/**
|
|
26
|
+
* Number of hours in one day
|
|
27
|
+
*/
|
|
28
|
+
readonly HOURS_PER_DAY: 24;
|
|
29
|
+
/**
|
|
30
|
+
* Default timeout duration in milliseconds (5 seconds)
|
|
31
|
+
*/
|
|
32
|
+
readonly DEFAULT_TIMEOUT: 5000;
|
|
33
|
+
/**
|
|
34
|
+
* Default retry delay in milliseconds (100ms)
|
|
35
|
+
*/
|
|
36
|
+
readonly DEFAULT_RETRY_DELAY: 100;
|
|
37
|
+
/**
|
|
38
|
+
* Default number of retry attempts
|
|
39
|
+
*/
|
|
40
|
+
readonly DEFAULT_RETRY_ATTEMPTS: 3;
|
|
41
|
+
/**
|
|
42
|
+
* Default debounce delay in milliseconds (50ms)
|
|
43
|
+
*/
|
|
44
|
+
readonly DEFAULT_DEBOUNCE_DELAY: 50;
|
|
45
|
+
/**
|
|
46
|
+
* Default animation frame duration in milliseconds (~60fps)
|
|
47
|
+
*/
|
|
48
|
+
readonly DEFAULT_ANIMATION_FRAME: 16.67;
|
|
49
|
+
/**
|
|
50
|
+
* Default cache time-to-live in seconds (5 minutes)
|
|
51
|
+
*/
|
|
52
|
+
readonly DEFAULT_CACHE_TTL: 300;
|
|
53
|
+
/**
|
|
54
|
+
* Default port number for servers
|
|
55
|
+
*/
|
|
56
|
+
readonly DEFAULT_PORT: 3000;
|
|
57
|
+
/**
|
|
58
|
+
* WebSocket abnormal closure code
|
|
59
|
+
*/
|
|
60
|
+
readonly WEBSOCKET_CLOSE_ABNORMAL: 1006;
|
|
61
|
+
/**
|
|
62
|
+
* WebSocket retry delay in milliseconds (500ms)
|
|
63
|
+
*/
|
|
64
|
+
readonly WEBSOCKET_RETRY_DELAY: 500;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Type for time constant values
|
|
68
|
+
*/
|
|
69
|
+
export type TimeConstant = (typeof TIME_CONSTANTS)[keyof typeof TIME_CONSTANTS];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collection and Array Constants
|
|
3
|
+
*
|
|
4
|
+
* Constants for array operations, pagination,
|
|
5
|
+
* and collection manipulation.
|
|
6
|
+
*
|
|
7
|
+
* @module utils/collection/constants
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Array and collection operation constants
|
|
11
|
+
*/
|
|
12
|
+
export declare const COLLECTION_CONSTANTS: {
|
|
13
|
+
/**
|
|
14
|
+
* Center point for array splitting (50%)
|
|
15
|
+
*/
|
|
16
|
+
readonly ARRAY_SPLIT_CENTER: 0.5;
|
|
17
|
+
/**
|
|
18
|
+
* Default page size for pagination
|
|
19
|
+
*/
|
|
20
|
+
readonly DEFAULT_PAGE_SIZE: 10;
|
|
21
|
+
/**
|
|
22
|
+
* Default maximum number of retries for operations
|
|
23
|
+
*/
|
|
24
|
+
readonly DEFAULT_MAX_RETRIES: 3;
|
|
25
|
+
/**
|
|
26
|
+
* Constant for three items (used in various contexts)
|
|
27
|
+
*/
|
|
28
|
+
readonly THREE_ITEMS: 3;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Type for collection constant values
|
|
32
|
+
*/
|
|
33
|
+
export type CollectionConstant = (typeof COLLECTION_CONSTANTS)[keyof typeof COLLECTION_CONSTANTS];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities - Main Export
|
|
3
|
+
*
|
|
4
|
+
* Exports all utility constants organized by category.
|
|
5
|
+
* These utilities can be reused across different parts of the application.
|
|
6
|
+
*
|
|
7
|
+
* @fileoverview Main utilities export
|
|
8
|
+
* @version 1.0.0
|
|
9
|
+
*/
|
|
10
|
+
export * from './string';
|
|
11
|
+
export * from './collection';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* String Manipulation Constants
|
|
3
|
+
*
|
|
4
|
+
* Constants used for string generation, manipulation,
|
|
5
|
+
* and UUID-related operations.
|
|
6
|
+
*
|
|
7
|
+
* @module utils/string/constants
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* String generation and manipulation constants
|
|
11
|
+
*/
|
|
12
|
+
export declare const STRING_CONSTANTS: {
|
|
13
|
+
/**
|
|
14
|
+
* Starting position for random string extraction
|
|
15
|
+
*/
|
|
16
|
+
readonly RANDOM_STRING_START: 2;
|
|
17
|
+
/**
|
|
18
|
+
* Length of random string segment
|
|
19
|
+
*/
|
|
20
|
+
readonly RANDOM_STRING_LENGTH: 9;
|
|
21
|
+
/**
|
|
22
|
+
* Multiplier for UUID random value generation
|
|
23
|
+
*/
|
|
24
|
+
readonly UUID_RANDOM_MULTIPLIER: 16;
|
|
25
|
+
/**
|
|
26
|
+
* Hexadecimal mask for UUID generation
|
|
27
|
+
*/
|
|
28
|
+
readonly UUID_HEX_MASK: 3;
|
|
29
|
+
/**
|
|
30
|
+
* OR value for UUID hexadecimal operations
|
|
31
|
+
*/
|
|
32
|
+
readonly UUID_HEX_OR_VALUE: 8;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Type for string constant values
|
|
36
|
+
*/
|
|
37
|
+
export type StringConstant = (typeof STRING_CONSTANTS)[keyof typeof STRING_CONSTANTS];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plyaz/config",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"author": "Redeemer Pace",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"description": "Provides shared configs and constants for @playz ecosystem.",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"scripts": {
|
|
103
103
|
"build": "pnpm clean && pnpm build:js && pnpm build:types",
|
|
104
104
|
"build:js": "tsup",
|
|
105
|
-
"build:types": "tsc
|
|
105
|
+
"build:types": "tsc src/index.ts --emitDeclarationOnly --esModuleInterop --outDir dist --declaration --skipLibCheck",
|
|
106
106
|
"build:watch": "tsup --watch",
|
|
107
107
|
"dev": "tsup --watch",
|
|
108
108
|
"lint": "eslint ./src ./tests",
|