@plyaz/types 1.7.16 → 1.7.17
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/cache/index.d.ts +5 -0
- package/dist/api/cache/types.d.ts +22 -0
- package/dist/api/client/index.d.ts +5 -0
- package/dist/api/client/types.d.ts +31 -0
- package/dist/api/config/index.d.ts +5 -0
- package/dist/api/config/types.d.ts +634 -0
- package/dist/api/errors/index.d.ts +5 -0
- package/dist/api/errors/types.d.ts +129 -0
- package/dist/api/events/index.d.ts +5 -0
- package/dist/api/events/types.d.ts +723 -0
- package/dist/api/headers/index.d.ts +5 -0
- package/dist/api/headers/types.d.ts +59 -0
- package/dist/api/index.d.ts +19 -1
- package/dist/api/network/enums.d.ts +14 -0
- package/dist/api/network/index.d.ts +6 -0
- package/dist/api/network/types.d.ts +121 -0
- package/dist/api/performance/index.d.ts +5 -0
- package/dist/api/performance/types.d.ts +137 -0
- package/dist/api/polling/index.d.ts +5 -0
- package/dist/api/polling/types.d.ts +74 -0
- package/dist/api/queue/enums.d.ts +31 -0
- package/dist/api/queue/index.d.ts +6 -0
- package/dist/api/queue/types.d.ts +65 -0
- package/dist/api/regional/index.d.ts +5 -0
- package/dist/api/regional/types.d.ts +50 -0
- package/dist/api/retry/index.d.ts +5 -0
- package/dist/api/retry/types.d.ts +26 -0
- package/dist/api/revalidation/index.d.ts +5 -0
- package/dist/api/revalidation/types.d.ts +33 -0
- package/dist/api/strategies/index.d.ts +5 -0
- package/dist/api/strategies/types.d.ts +27 -0
- package/dist/api/utils/enums.d.ts +23 -0
- package/dist/api/utils/index.d.ts +5 -0
- package/dist/auth/index.cjs +0 -41
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.js +0 -38
- package/dist/auth/index.js.map +1 -1
- package/dist/common/types.d.ts +1 -4
- package/dist/errors/enums.d.ts +27 -0
- package/dist/errors/index.cjs +0 -43
- package/dist/errors/index.cjs.map +1 -1
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +0 -40
- package/dist/errors/index.js.map +1 -1
- package/dist/events/index.cjs +0 -33
- package/dist/events/index.cjs.map +1 -1
- package/dist/events/index.d.ts +1 -1
- package/dist/events/index.js +0 -30
- package/dist/events/index.js.map +1 -1
- package/dist/events/types.d.ts +2 -2
- package/dist/index.cjs +0 -138
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +0 -128
- package/dist/index.js.map +1 -1
- package/dist/testing/common/utils/types.d.ts +2 -1
- package/dist/testing/features/api/types.d.ts +173 -21
- package/dist/web3/index.cjs +0 -27
- package/dist/web3/index.cjs.map +1 -1
- package/dist/web3/index.d.ts +1 -1
- package/dist/web3/index.js +0 -26
- package/dist/web3/index.js.map +1 -1
- package/package.json +3 -2
- package/dist/api/types.d.ts +0 -51
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Revalidation Configuration Types
|
|
3
|
+
* Configuration options for fetchff's revalidation features
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Revalidation configuration options
|
|
7
|
+
* These are passed through to fetchff for automatic cache revalidation
|
|
8
|
+
*/
|
|
9
|
+
export interface RevalidationConfig {
|
|
10
|
+
/** Revalidate when window gets focus (tab switching) */
|
|
11
|
+
refetchOnFocus?: boolean;
|
|
12
|
+
/** Revalidate when network reconnects after offline */
|
|
13
|
+
refetchOnReconnect?: boolean;
|
|
14
|
+
/** Time before cached data is considered stale (seconds) */
|
|
15
|
+
staleTime?: number;
|
|
16
|
+
/** Time to keep data in cache (seconds) */
|
|
17
|
+
cacheTime?: number;
|
|
18
|
+
/** Deduplication window for identical requests (milliseconds) */
|
|
19
|
+
dedupeTime?: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Available revalidation strategy names
|
|
23
|
+
*/
|
|
24
|
+
export type RevalidationStrategyName = 'realtime' | 'aggressive' | 'balanced' | 'relaxed' | 'static' | 'offlineFirst' | 'manual';
|
|
25
|
+
/**
|
|
26
|
+
* Revalidation option type for flexible configuration
|
|
27
|
+
*/
|
|
28
|
+
export type RevalidationOption = RevalidationConfig | RevalidationStrategyName | false;
|
|
29
|
+
/**
|
|
30
|
+
* Generic preset names included by default
|
|
31
|
+
* These are the built-in presets that cover common patterns
|
|
32
|
+
*/
|
|
33
|
+
export type GenericPresetName = 'dashboard' | 'chat' | 'notifications' | 'analytics' | 'feed' | 'content' | 'profile' | 'settings' | 'documentation' | 'assets' | 'config' | 'pwa' | 'mobile';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified API Strategies Types
|
|
3
|
+
* Type definitions for unified strategies (implementations remain in @plyaz/api)
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Unified strategy combines strategies from different domains
|
|
7
|
+
* This provides a convenience layer while keeping individual strategies independent
|
|
8
|
+
*/
|
|
9
|
+
export interface UnifiedStrategy {
|
|
10
|
+
cache: string;
|
|
11
|
+
retry: string;
|
|
12
|
+
polling?: string;
|
|
13
|
+
performance?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Unified strategy names for common API usage patterns
|
|
17
|
+
*/
|
|
18
|
+
export type UnifiedStrategyName = 'realtime' | 'interactive' | 'background' | 'static' | 'offline';
|
|
19
|
+
/**
|
|
20
|
+
* Configuration object with resolved strategy names
|
|
21
|
+
*/
|
|
22
|
+
export interface UnifiedStrategyConfig {
|
|
23
|
+
cache: string;
|
|
24
|
+
retry: string;
|
|
25
|
+
polling?: string;
|
|
26
|
+
performance?: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility Enums for API Package
|
|
3
|
+
* Enums used across API utilities
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Correlation ID types for different contexts
|
|
7
|
+
*/
|
|
8
|
+
export declare enum CORRELATION_TYPE {
|
|
9
|
+
/** Network event correlation */
|
|
10
|
+
NETWORK = "net",
|
|
11
|
+
/** API request correlation */
|
|
12
|
+
API = "api",
|
|
13
|
+
/** User session correlation */
|
|
14
|
+
SESSION = "session",
|
|
15
|
+
/** Transaction correlation */
|
|
16
|
+
TRANSACTION = "txn",
|
|
17
|
+
/** Event correlation */
|
|
18
|
+
EVENT = "evt",
|
|
19
|
+
/** Trace correlation */
|
|
20
|
+
TRACE = "trace",
|
|
21
|
+
/** Generic correlation */
|
|
22
|
+
GENERIC = "corr"
|
|
23
|
+
}
|
package/dist/auth/index.cjs
CHANGED
|
@@ -1,45 +1,4 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
// @plyaz package - Built with tsup
|
|
4
|
-
|
|
5
|
-
// src/auth/enums.ts
|
|
6
|
-
var USER_ROLE = {
|
|
7
|
-
/** A user who is an athlete and participates in sports activities. */
|
|
8
|
-
Athlete: "athlete",
|
|
9
|
-
/** A user who scouts and discovers talent. */
|
|
10
|
-
Scout: "scout",
|
|
11
|
-
/** A user who acts as an agent representing athletes or clubs. */
|
|
12
|
-
Agent: "agent",
|
|
13
|
-
/** A user representing a sports club or organization. */
|
|
14
|
-
Club: "club",
|
|
15
|
-
/** A fan or supporter of athletes or clubs. */
|
|
16
|
-
Fan: "fan",
|
|
17
|
-
/** A system administrator with access to management tools. */
|
|
18
|
-
Admin: "admin",
|
|
19
|
-
/** A super admin with the highest level of access and control. */
|
|
20
|
-
SuperAdmin: "super.admin"
|
|
21
|
-
};
|
|
22
|
-
var USER_STATUS = {
|
|
23
|
-
/** Active user with full access. */
|
|
24
|
-
Active: "active",
|
|
25
|
-
/** Inactive user, typically not currently using the platform. */
|
|
26
|
-
Inactive: "inactive",
|
|
27
|
-
/** User account is awaiting approval or completion of setup. */
|
|
28
|
-
Pending: "pending",
|
|
29
|
-
/** User has been temporarily suspended due to policy violations or manual review. */
|
|
30
|
-
Suspended: "suspended",
|
|
31
|
-
/** User has been permanently banned from the platform. */
|
|
32
|
-
Banned: "banned"
|
|
33
|
-
};
|
|
34
|
-
var AUTH_PROVIDER = {
|
|
35
|
-
/** Authentication via email and password. */
|
|
36
|
-
Email: "email",
|
|
37
|
-
/** Authentication via connected blockchain wallet. */
|
|
38
|
-
Wallet: "wallet"
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
exports.AUTH_PROVIDER = AUTH_PROVIDER;
|
|
42
|
-
exports.USER_ROLE = USER_ROLE;
|
|
43
|
-
exports.USER_STATUS = USER_STATUS;
|
|
44
3
|
//# sourceMappingURL=index.cjs.map
|
|
45
4
|
//# sourceMappingURL=index.cjs.map
|
package/dist/auth/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
package/dist/auth/index.d.ts
CHANGED
package/dist/auth/index.js
CHANGED
|
@@ -1,41 +1,3 @@
|
|
|
1
|
-
// @plyaz package - Built with tsup
|
|
2
1
|
|
|
3
|
-
// src/auth/enums.ts
|
|
4
|
-
var USER_ROLE = {
|
|
5
|
-
/** A user who is an athlete and participates in sports activities. */
|
|
6
|
-
Athlete: "athlete",
|
|
7
|
-
/** A user who scouts and discovers talent. */
|
|
8
|
-
Scout: "scout",
|
|
9
|
-
/** A user who acts as an agent representing athletes or clubs. */
|
|
10
|
-
Agent: "agent",
|
|
11
|
-
/** A user representing a sports club or organization. */
|
|
12
|
-
Club: "club",
|
|
13
|
-
/** A fan or supporter of athletes or clubs. */
|
|
14
|
-
Fan: "fan",
|
|
15
|
-
/** A system administrator with access to management tools. */
|
|
16
|
-
Admin: "admin",
|
|
17
|
-
/** A super admin with the highest level of access and control. */
|
|
18
|
-
SuperAdmin: "super.admin"
|
|
19
|
-
};
|
|
20
|
-
var USER_STATUS = {
|
|
21
|
-
/** Active user with full access. */
|
|
22
|
-
Active: "active",
|
|
23
|
-
/** Inactive user, typically not currently using the platform. */
|
|
24
|
-
Inactive: "inactive",
|
|
25
|
-
/** User account is awaiting approval or completion of setup. */
|
|
26
|
-
Pending: "pending",
|
|
27
|
-
/** User has been temporarily suspended due to policy violations or manual review. */
|
|
28
|
-
Suspended: "suspended",
|
|
29
|
-
/** User has been permanently banned from the platform. */
|
|
30
|
-
Banned: "banned"
|
|
31
|
-
};
|
|
32
|
-
var AUTH_PROVIDER = {
|
|
33
|
-
/** Authentication via email and password. */
|
|
34
|
-
Email: "email",
|
|
35
|
-
/** Authentication via connected blockchain wallet. */
|
|
36
|
-
Wallet: "wallet"
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export { AUTH_PROVIDER, USER_ROLE, USER_STATUS };
|
|
40
2
|
//# sourceMappingURL=index.js.map
|
|
41
3
|
//# sourceMappingURL=index.js.map
|
package/dist/auth/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/dist/common/types.d.ts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
15
|
import type { Arrayable, SetOptional, Tagged } from 'type-fest';
|
|
16
|
+
import type { HttpMethod } from '../api';
|
|
16
17
|
export type Brand<T, B extends PropertyKey> = Tagged<T, B>;
|
|
17
18
|
/**
|
|
18
19
|
* Branded `string` type representing a unique identifier.
|
|
@@ -1343,10 +1344,6 @@ export interface WithValidationError<Context = unknown> extends WithErrorCode, W
|
|
|
1343
1344
|
/** Additional context about the validation error */
|
|
1344
1345
|
context?: Context;
|
|
1345
1346
|
}
|
|
1346
|
-
/**
|
|
1347
|
-
* Base interface for HTTP methods.
|
|
1348
|
-
*/
|
|
1349
|
-
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
|
|
1350
1347
|
/**
|
|
1351
1348
|
* Base interface for entities with HTTP method.
|
|
1352
1349
|
*
|
package/dist/errors/enums.d.ts
CHANGED
|
@@ -71,5 +71,32 @@ export declare const ERROR_CATEGORY: {
|
|
|
71
71
|
readonly Network: "network";
|
|
72
72
|
/** Blockchain-related error (e.g., transaction failure, gas limit). */
|
|
73
73
|
readonly Blockchain: "blockchain";
|
|
74
|
+
/** Validation-specific error (e.g., failed constraints or field errors). */
|
|
74
75
|
readonly Validation: "validation";
|
|
76
|
+
/** Authentication-related error (e.g., invalid credentials, expired token). */
|
|
77
|
+
readonly Authentication: "authentication";
|
|
78
|
+
/** Authorization-related error (e.g., insufficient permissions). */
|
|
79
|
+
readonly Authorization: "authorization";
|
|
80
|
+
/** Resource not found error. */
|
|
81
|
+
readonly NotFound: "not.found";
|
|
82
|
+
/** Rate limiting error (too many requests). */
|
|
83
|
+
readonly RateLimit: "rate.limit";
|
|
84
|
+
/** External service error (e.g., third-party API failure). */
|
|
85
|
+
readonly ExternalService: "external.service";
|
|
86
|
+
/** Timeout error (request exceeded time limit). */
|
|
87
|
+
readonly Timeout: "timeout";
|
|
88
|
+
/** Conflict error (e.g., resource state conflict). */
|
|
89
|
+
readonly Conflict: "conflict";
|
|
90
|
+
/** Cache-related error. */
|
|
91
|
+
readonly Cache: "cache";
|
|
92
|
+
/** Headers-related error (e.g., missing or invalid headers). */
|
|
93
|
+
readonly Headers: "headers";
|
|
94
|
+
/** Retry-related error (e.g., max retries exceeded). */
|
|
95
|
+
readonly Retry: "retry";
|
|
96
|
+
/** Strategy-related error (e.g., invalid retry or caching strategy). */
|
|
97
|
+
readonly Strategy: "strategy";
|
|
98
|
+
/** Regional-related error (e.g., region detection failure). */
|
|
99
|
+
readonly Regional: "regional";
|
|
100
|
+
/** Unknown or unclassified error. */
|
|
101
|
+
readonly Unknown: "unknown";
|
|
75
102
|
};
|
package/dist/errors/index.cjs
CHANGED
|
@@ -1,47 +1,4 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
// @plyaz package - Built with tsup
|
|
4
|
-
|
|
5
|
-
// src/errors/enums.ts
|
|
6
|
-
var ERROR_TYPE = {
|
|
7
|
-
/** A general validation error (e.g., form or input errors). */
|
|
8
|
-
ValidationError: "validation.error",
|
|
9
|
-
/** Error related to schema validation, such as JSON schema or API payload checks. */
|
|
10
|
-
SchemaValidationError: "validation.schema.error",
|
|
11
|
-
/** Unhandled or unexpected system error. */
|
|
12
|
-
InternalError: "system.internal.error",
|
|
13
|
-
/** System dependency is currently unavailable (e.g., database or external API). */
|
|
14
|
-
ServiceUnavailable: "system.service.unavailable",
|
|
15
|
-
/** The request took too long and timed out. */
|
|
16
|
-
TimeoutError: "system.timeout",
|
|
17
|
-
/** Too many requests made in a short period of time. */
|
|
18
|
-
RateLimitExceeded: "system.rate.limit.exceeded"
|
|
19
|
-
};
|
|
20
|
-
var ERROR_SEVERITY = {
|
|
21
|
-
/** Low severity - does not impact functionality significantly. */
|
|
22
|
-
Low: "low",
|
|
23
|
-
/** Medium severity - minor disruption or warning. */
|
|
24
|
-
Medium: "medium",
|
|
25
|
-
/** High severity - major issue requiring attention. */
|
|
26
|
-
High: "high",
|
|
27
|
-
/** Critical severity - blocking or crashing issue. */
|
|
28
|
-
Critical: "critical"
|
|
29
|
-
};
|
|
30
|
-
var ERROR_CATEGORY = {
|
|
31
|
-
/** Client-side error (e.g., invalid request). */
|
|
32
|
-
Client: "client",
|
|
33
|
-
/** Server-side error (e.g., logic failure or exception). */
|
|
34
|
-
Server: "server",
|
|
35
|
-
/** Network-related error (e.g., unreachable endpoint). */
|
|
36
|
-
Network: "network",
|
|
37
|
-
/** Blockchain-related error (e.g., transaction failure, gas limit). */
|
|
38
|
-
Blockchain: "blockchain",
|
|
39
|
-
// Validation-specific error (e.g., failed constraints or field errors).
|
|
40
|
-
Validation: "validation"
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
exports.ERROR_CATEGORY = ERROR_CATEGORY;
|
|
44
|
-
exports.ERROR_SEVERITY = ERROR_SEVERITY;
|
|
45
|
-
exports.ERROR_TYPE = ERROR_TYPE;
|
|
46
3
|
//# sourceMappingURL=index.cjs.map
|
|
47
4
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
package/dist/errors/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './enums';
|
|
1
|
+
export type * from './enums';
|
|
2
2
|
export type * from './types';
|
package/dist/errors/index.js
CHANGED
|
@@ -1,43 +1,3 @@
|
|
|
1
|
-
// @plyaz package - Built with tsup
|
|
2
1
|
|
|
3
|
-
// src/errors/enums.ts
|
|
4
|
-
var ERROR_TYPE = {
|
|
5
|
-
/** A general validation error (e.g., form or input errors). */
|
|
6
|
-
ValidationError: "validation.error",
|
|
7
|
-
/** Error related to schema validation, such as JSON schema or API payload checks. */
|
|
8
|
-
SchemaValidationError: "validation.schema.error",
|
|
9
|
-
/** Unhandled or unexpected system error. */
|
|
10
|
-
InternalError: "system.internal.error",
|
|
11
|
-
/** System dependency is currently unavailable (e.g., database or external API). */
|
|
12
|
-
ServiceUnavailable: "system.service.unavailable",
|
|
13
|
-
/** The request took too long and timed out. */
|
|
14
|
-
TimeoutError: "system.timeout",
|
|
15
|
-
/** Too many requests made in a short period of time. */
|
|
16
|
-
RateLimitExceeded: "system.rate.limit.exceeded"
|
|
17
|
-
};
|
|
18
|
-
var ERROR_SEVERITY = {
|
|
19
|
-
/** Low severity - does not impact functionality significantly. */
|
|
20
|
-
Low: "low",
|
|
21
|
-
/** Medium severity - minor disruption or warning. */
|
|
22
|
-
Medium: "medium",
|
|
23
|
-
/** High severity - major issue requiring attention. */
|
|
24
|
-
High: "high",
|
|
25
|
-
/** Critical severity - blocking or crashing issue. */
|
|
26
|
-
Critical: "critical"
|
|
27
|
-
};
|
|
28
|
-
var ERROR_CATEGORY = {
|
|
29
|
-
/** Client-side error (e.g., invalid request). */
|
|
30
|
-
Client: "client",
|
|
31
|
-
/** Server-side error (e.g., logic failure or exception). */
|
|
32
|
-
Server: "server",
|
|
33
|
-
/** Network-related error (e.g., unreachable endpoint). */
|
|
34
|
-
Network: "network",
|
|
35
|
-
/** Blockchain-related error (e.g., transaction failure, gas limit). */
|
|
36
|
-
Blockchain: "blockchain",
|
|
37
|
-
// Validation-specific error (e.g., failed constraints or field errors).
|
|
38
|
-
Validation: "validation"
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export { ERROR_CATEGORY, ERROR_SEVERITY, ERROR_TYPE };
|
|
42
2
|
//# sourceMappingURL=index.js.map
|
|
43
3
|
//# sourceMappingURL=index.js.map
|
package/dist/errors/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/dist/events/index.cjs
CHANGED
|
@@ -1,37 +1,4 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
// @plyaz package - Built with tsup
|
|
4
|
-
|
|
5
|
-
// src/events/enums.ts
|
|
6
|
-
var EVENT_TYPE = {
|
|
7
|
-
/** Application initialization event. */
|
|
8
|
-
AppInit: "app.init"
|
|
9
|
-
};
|
|
10
|
-
var EVENT_PRIORITY = {
|
|
11
|
-
/** Low priority event. */
|
|
12
|
-
Low: "low",
|
|
13
|
-
/** Normal priority event. */
|
|
14
|
-
Normal: "normal",
|
|
15
|
-
/** High priority event. */
|
|
16
|
-
High: "high",
|
|
17
|
-
/** Critical priority event. */
|
|
18
|
-
Critical: "critical"
|
|
19
|
-
};
|
|
20
|
-
var EVENT_STATUS = {
|
|
21
|
-
/** Event is pending and has not started processing. */
|
|
22
|
-
Pending: "pending",
|
|
23
|
-
/** Event is currently being processed. */
|
|
24
|
-
Processing: "processing",
|
|
25
|
-
/** Event has been completed successfully. */
|
|
26
|
-
Completed: "completed",
|
|
27
|
-
/** Event processing failed. */
|
|
28
|
-
Failed: "failed",
|
|
29
|
-
/** Event is being retried after a failure. */
|
|
30
|
-
Retrying: "retrying"
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
exports.EVENT_PRIORITY = EVENT_PRIORITY;
|
|
34
|
-
exports.EVENT_STATUS = EVENT_STATUS;
|
|
35
|
-
exports.EVENT_TYPE = EVENT_TYPE;
|
|
36
3
|
//# sourceMappingURL=index.cjs.map
|
|
37
4
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
package/dist/events/index.d.ts
CHANGED
package/dist/events/index.js
CHANGED
|
@@ -1,33 +1,3 @@
|
|
|
1
|
-
// @plyaz package - Built with tsup
|
|
2
1
|
|
|
3
|
-
// src/events/enums.ts
|
|
4
|
-
var EVENT_TYPE = {
|
|
5
|
-
/** Application initialization event. */
|
|
6
|
-
AppInit: "app.init"
|
|
7
|
-
};
|
|
8
|
-
var EVENT_PRIORITY = {
|
|
9
|
-
/** Low priority event. */
|
|
10
|
-
Low: "low",
|
|
11
|
-
/** Normal priority event. */
|
|
12
|
-
Normal: "normal",
|
|
13
|
-
/** High priority event. */
|
|
14
|
-
High: "high",
|
|
15
|
-
/** Critical priority event. */
|
|
16
|
-
Critical: "critical"
|
|
17
|
-
};
|
|
18
|
-
var EVENT_STATUS = {
|
|
19
|
-
/** Event is pending and has not started processing. */
|
|
20
|
-
Pending: "pending",
|
|
21
|
-
/** Event is currently being processed. */
|
|
22
|
-
Processing: "processing",
|
|
23
|
-
/** Event has been completed successfully. */
|
|
24
|
-
Completed: "completed",
|
|
25
|
-
/** Event processing failed. */
|
|
26
|
-
Failed: "failed",
|
|
27
|
-
/** Event is being retried after a failure. */
|
|
28
|
-
Retrying: "retrying"
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export { EVENT_PRIORITY, EVENT_STATUS, EVENT_TYPE };
|
|
32
2
|
//# sourceMappingURL=index.js.map
|
|
33
3
|
//# sourceMappingURL=index.js.map
|
package/dist/events/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/dist/events/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SetOptional } from 'type-fest';
|
|
2
2
|
import type { EVENT_PRIORITY, EVENT_STATUS, EVENT_TYPE } from './enums';
|
|
3
3
|
import type { Identifiable, WithUserId, WithSessionId, WithUserAgent, WithRetryTracking, WithTimestamp, WithCorrelationId, Versioned, WithSource, WithStatus, WithPriority, WithMetadata, WithIpAddress, WithPayload, SubscriptionWithHandler } from '../common/types';
|
|
4
4
|
/**
|
|
@@ -31,7 +31,7 @@ export type EventMetadata = SetOptional<WithUserId & WithSessionId & WithUserAge
|
|
|
31
31
|
* @description A handler function that processes an event of type `T`.
|
|
32
32
|
* @template T - The event payload type.
|
|
33
33
|
*/
|
|
34
|
-
export type EventHandler<T = unknown> = (event:
|
|
34
|
+
export type EventHandler<T = unknown> = (event: T) => void;
|
|
35
35
|
/**
|
|
36
36
|
* Represents a subscription to a specific topic on the event bus.
|
|
37
37
|
* Uses the common SubscriptionWithHandler pattern with EventHandler type.
|
package/dist/index.cjs
CHANGED
|
@@ -1,142 +1,4 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
// @plyaz package - Built with tsup
|
|
4
|
-
|
|
5
|
-
// src/auth/enums.ts
|
|
6
|
-
var USER_ROLE = {
|
|
7
|
-
/** A user who is an athlete and participates in sports activities. */
|
|
8
|
-
Athlete: "athlete",
|
|
9
|
-
/** A user who scouts and discovers talent. */
|
|
10
|
-
Scout: "scout",
|
|
11
|
-
/** A user who acts as an agent representing athletes or clubs. */
|
|
12
|
-
Agent: "agent",
|
|
13
|
-
/** A user representing a sports club or organization. */
|
|
14
|
-
Club: "club",
|
|
15
|
-
/** A fan or supporter of athletes or clubs. */
|
|
16
|
-
Fan: "fan",
|
|
17
|
-
/** A system administrator with access to management tools. */
|
|
18
|
-
Admin: "admin",
|
|
19
|
-
/** A super admin with the highest level of access and control. */
|
|
20
|
-
SuperAdmin: "super.admin"
|
|
21
|
-
};
|
|
22
|
-
var USER_STATUS = {
|
|
23
|
-
/** Active user with full access. */
|
|
24
|
-
Active: "active",
|
|
25
|
-
/** Inactive user, typically not currently using the platform. */
|
|
26
|
-
Inactive: "inactive",
|
|
27
|
-
/** User account is awaiting approval or completion of setup. */
|
|
28
|
-
Pending: "pending",
|
|
29
|
-
/** User has been temporarily suspended due to policy violations or manual review. */
|
|
30
|
-
Suspended: "suspended",
|
|
31
|
-
/** User has been permanently banned from the platform. */
|
|
32
|
-
Banned: "banned"
|
|
33
|
-
};
|
|
34
|
-
var AUTH_PROVIDER = {
|
|
35
|
-
/** Authentication via email and password. */
|
|
36
|
-
Email: "email",
|
|
37
|
-
/** Authentication via connected blockchain wallet. */
|
|
38
|
-
Wallet: "wallet"
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// src/errors/enums.ts
|
|
42
|
-
var ERROR_TYPE = {
|
|
43
|
-
/** A general validation error (e.g., form or input errors). */
|
|
44
|
-
ValidationError: "validation.error",
|
|
45
|
-
/** Error related to schema validation, such as JSON schema or API payload checks. */
|
|
46
|
-
SchemaValidationError: "validation.schema.error",
|
|
47
|
-
/** Unhandled or unexpected system error. */
|
|
48
|
-
InternalError: "system.internal.error",
|
|
49
|
-
/** System dependency is currently unavailable (e.g., database or external API). */
|
|
50
|
-
ServiceUnavailable: "system.service.unavailable",
|
|
51
|
-
/** The request took too long and timed out. */
|
|
52
|
-
TimeoutError: "system.timeout",
|
|
53
|
-
/** Too many requests made in a short period of time. */
|
|
54
|
-
RateLimitExceeded: "system.rate.limit.exceeded"
|
|
55
|
-
};
|
|
56
|
-
var ERROR_SEVERITY = {
|
|
57
|
-
/** Low severity - does not impact functionality significantly. */
|
|
58
|
-
Low: "low",
|
|
59
|
-
/** Medium severity - minor disruption or warning. */
|
|
60
|
-
Medium: "medium",
|
|
61
|
-
/** High severity - major issue requiring attention. */
|
|
62
|
-
High: "high",
|
|
63
|
-
/** Critical severity - blocking or crashing issue. */
|
|
64
|
-
Critical: "critical"
|
|
65
|
-
};
|
|
66
|
-
var ERROR_CATEGORY = {
|
|
67
|
-
/** Client-side error (e.g., invalid request). */
|
|
68
|
-
Client: "client",
|
|
69
|
-
/** Server-side error (e.g., logic failure or exception). */
|
|
70
|
-
Server: "server",
|
|
71
|
-
/** Network-related error (e.g., unreachable endpoint). */
|
|
72
|
-
Network: "network",
|
|
73
|
-
/** Blockchain-related error (e.g., transaction failure, gas limit). */
|
|
74
|
-
Blockchain: "blockchain",
|
|
75
|
-
// Validation-specific error (e.g., failed constraints or field errors).
|
|
76
|
-
Validation: "validation"
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
// src/events/enums.ts
|
|
80
|
-
var EVENT_TYPE = {
|
|
81
|
-
/** Application initialization event. */
|
|
82
|
-
AppInit: "app.init"
|
|
83
|
-
};
|
|
84
|
-
var EVENT_PRIORITY = {
|
|
85
|
-
/** Low priority event. */
|
|
86
|
-
Low: "low",
|
|
87
|
-
/** Normal priority event. */
|
|
88
|
-
Normal: "normal",
|
|
89
|
-
/** High priority event. */
|
|
90
|
-
High: "high",
|
|
91
|
-
/** Critical priority event. */
|
|
92
|
-
Critical: "critical"
|
|
93
|
-
};
|
|
94
|
-
var EVENT_STATUS = {
|
|
95
|
-
/** Event is pending and has not started processing. */
|
|
96
|
-
Pending: "pending",
|
|
97
|
-
/** Event is currently being processed. */
|
|
98
|
-
Processing: "processing",
|
|
99
|
-
/** Event has been completed successfully. */
|
|
100
|
-
Completed: "completed",
|
|
101
|
-
/** Event processing failed. */
|
|
102
|
-
Failed: "failed",
|
|
103
|
-
/** Event is being retried after a failure. */
|
|
104
|
-
Retrying: "retrying"
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
// src/web3/enums.ts
|
|
108
|
-
var CHAIN_ID = {
|
|
109
|
-
/** Ethereum Mainnet (Chain ID: 1). */
|
|
110
|
-
EthereumMainnet: 1,
|
|
111
|
-
/** Ethereum Sepolia Testnet (Chain ID: 11155111). */
|
|
112
|
-
EthereumSepolia: 11155111,
|
|
113
|
-
/** Optimism Mainnet (Chain ID: 10). */
|
|
114
|
-
Optimism: 10,
|
|
115
|
-
/** Optimism Sepolia Testnet (Chain ID: 11155420). */
|
|
116
|
-
OptimismSepolia: 11155420,
|
|
117
|
-
/** Arbitrum One Mainnet (Chain ID: 42161). */
|
|
118
|
-
Arbitrum: 42161,
|
|
119
|
-
/** Arbitrum Sepolia Testnet (Chain ID: 421614). */
|
|
120
|
-
ArbitrumSepolia: 421614,
|
|
121
|
-
/** Polygon Mainnet (Chain ID: 137). */
|
|
122
|
-
Polygon: 137,
|
|
123
|
-
/** Polygon Amoy Testnet (Chain ID: 80002). */
|
|
124
|
-
PolygonAmoy: 80002,
|
|
125
|
-
/** Base Mainnet (Chain ID: 8453). */
|
|
126
|
-
Base: 8453,
|
|
127
|
-
/** Base Sepolia Testnet (Chain ID: 84532). */
|
|
128
|
-
BaseSepolia: 84532
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
exports.AUTH_PROVIDER = AUTH_PROVIDER;
|
|
132
|
-
exports.CHAIN_ID = CHAIN_ID;
|
|
133
|
-
exports.ERROR_CATEGORY = ERROR_CATEGORY;
|
|
134
|
-
exports.ERROR_SEVERITY = ERROR_SEVERITY;
|
|
135
|
-
exports.ERROR_TYPE = ERROR_TYPE;
|
|
136
|
-
exports.EVENT_PRIORITY = EVENT_PRIORITY;
|
|
137
|
-
exports.EVENT_STATUS = EVENT_STATUS;
|
|
138
|
-
exports.EVENT_TYPE = EVENT_TYPE;
|
|
139
|
-
exports.USER_ROLE = USER_ROLE;
|
|
140
|
-
exports.USER_STATUS = USER_STATUS;
|
|
141
3
|
//# sourceMappingURL=index.cjs.map
|
|
142
4
|
//# sourceMappingURL=index.cjs.map
|