@plyaz/types 1.5.2 → 1.5.4
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/index.js.map +1 -1
- package/dist/testing/common/mocks/types.d.ts +69 -48
- package/dist/testing/common/utils/types.d.ts +2675 -236
- package/package.json +4 -3
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/auth/enums.ts","../src/errors/enums.ts","../src/events/enums.ts","../src/web3/enums.ts"],"names":[],"mappings":";;;AAYO,IAAM,SAAA,GAAY;AAAA;AAAA,EAEvB,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,IAAA,EAAM,MAAA;AAAA;AAAA,EAGN,GAAA,EAAK,KAAA;AAAA;AAAA,EAGL,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,UAAA,EAAY;AACd;AAcO,IAAM,WAAA,GAAc;AAAA;AAAA,EAEzB,MAAA,EAAQ,QAAA;AAAA;AAAA,EAGR,QAAA,EAAU,UAAA;AAAA;AAAA,EAGV,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,SAAA,EAAW,WAAA;AAAA;AAAA,EAGX,MAAA,EAAQ;AACV;AAcO,IAAM,aAAA,GAAgB;AAAA;AAAA,EAE3B,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,MAAA,EAAQ;AACV;;;AClEO,IAAM,UAAA,GAAa;AAAA;AAAA,EAExB,eAAA,EAAiB,kBAAA;AAAA;AAAA,EAGjB,qBAAA,EAAuB,yBAAA;AAAA;AAAA,EAGvB,aAAA,EAAe,uBAAA;AAAA;AAAA,EAGf,kBAAA,EAAoB,4BAAA;AAAA;AAAA,EAGpB,YAAA,EAAc,gBAAA;AAAA;AAAA,EAGd,iBAAA,EAAmB;AACrB;AAcO,IAAM,cAAA,GAAiB;AAAA;AAAA,EAE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les are used to determine access levels, permissions, and user-specific experiences.\n *\n * @example\n * ```typescript\n * import { USER_ROLE } from '@plyaz/types';\n *\n * const userRole = USER_ROLE.Athlete; // 'athlete'\n * const isAdmin = userRole === USER_ROLE.Admin || userRole === USER_ROLE.SuperAdmin;\n * ```\n */\nexport const USER_ROLE = {\n /** A user who is an athlete and participates in sports activities. */\n Athlete: 'athlete',\n\n /** A user who scouts and discovers talent. */\n Scout: 'scout',\n\n /** A user who acts as an agent representing athletes or clubs. */\n Agent: 'agent',\n\n /** A user representing a sports club or organization. */\n Club: 'club',\n\n /** A fan or supporter of athletes or clubs. */\n Fan: 'fan',\n\n /** A system administrator with access to management tools. */\n Admin: 'admin',\n\n /** A super admin with the highest level of access and control. */\n SuperAdmin: 'super.admin',\n} as const;\n\n/**\n * Enum representing the current status of a user account.\n * @description Statuses are used to determine login availability, visibility, and user flow.\n *\n * @example\n * ```typescript\n * import { USER_STATUS } from '@plyaz/types';\n *\n * const isAccessible = status === USER_STATUS.Active;\n * const needsReview = status === USER_STATUS.Pending;\n * ```\n */\nexport const USER_STATUS = {\n /** Active user with full access. */\n Active: 'active',\n\n /** Inactive user, typically not currently using the platform. */\n Inactive: 'inactive',\n\n /** User account is awaiting approval or completion of setup. */\n Pending: 'pending',\n\n /** User has been temporarily suspended due to policy violations or manual review. */\n Suspended: 'suspended',\n\n /** User has been permanently banned from the platform. */\n Banned: 'banned',\n} as const;\n\n/**\n * Enum representing the supported authentication providers for user login.\n * @description Auth Providers allowed such as Email, Wallet, etc.\n *\n * @example\n * ```typescript\n * import { AUTH_PROVIDER } from '@plyaz/types';\n *\n * const provider = AUTH_PROVIDER.Wallet; // 'wallet'\n * const isWeb3Auth = provider === AUTH_PROVIDER.Wallet;\n * ```\n */\nexport const AUTH_PROVIDER = {\n /** Authentication via email and password. */\n Email: 'email',\n\n /** Authentication via connected blockchain wallet. */\n Wallet: 'wallet',\n} as const;\n","/**\n * Enum representing standardized error types used across the application.\n * @description These error types help classify different categories of errors such as validation issues and system-level failures.\n *\n * @example\n * ```typescript\n * import { ERROR_TYPE } from '@plyaz/types';\n *\n * const errorType = ERROR_TYPE.ValidationError; // 'validation.error'\n *\n * // Error handling example\n * if (error.type === ERROR_TYPE.RateLimitExceeded) {\n * // Handle rate limiting\n * }\n * ```\n */\nexport const ERROR_TYPE = {\n /** A general validation error (e.g., form or input errors). */\n ValidationError: 'validation.error',\n\n /** Error related to schema validation, such as JSON schema or API payload checks. */\n SchemaValidationError: 'validation.schema.error',\n\n /** Unhandled or unexpected system error. */\n InternalError: 'system.internal.error',\n\n /** System dependency is currently unavailable (e.g., database or external API). */\n ServiceUnavailable: 'system.service.unavailable',\n\n /** The request took too long and timed out. */\n TimeoutError: 'system.timeout',\n\n /** Too many requests made in a short period of time. */\n RateLimitExceeded: 'system.rate.limit.exceeded',\n} as const;\n\n/**\n * Enum representing the severity level of an error.\n * @description This allows categorization of errors by their potential impact on the system or user.\n *\n * @example\n * ```typescript\n * import { ERROR_SEVERITY } from '@plyaz/types';\n *\n * const severity = ERROR_SEVERITY.Critical; // 'critical'\n * const shouldAlert = severity === ERROR_SEVERITY.High || severity === ERROR_SEVERITY.Critical;\n * ```\n */\nexport const ERROR_SEVERITY = {\n /** Low severity - does not impact functionality significantly. */\n Low: 'low',\n\n /** Medium severity - minor disruption or warning. */\n Medium: 'medium',\n\n /** High severity - major issue requiring attention. */\n High: 'high',\n\n /** Critical severity - blocking or crashing issue. */\n Critical: 'critical',\n} as const;\n\n/**\n * Enum representing the category or origin of an error.\n * @description Useful for filtering or logging errors based on their source or nature.\n *\n * @example\n * ```typescript\n * import { ERROR_CATEGORY } from '@plyaz/types';\n *\n * const category = ERROR_CATEGORY.Blockchain; // 'blockchain'\n * const isClientError = category === ERROR_CATEGORY.Client;\n * ```\n */\nexport const ERROR_CATEGORY = {\n /** Client-side error (e.g., invalid request). */\n Client: 'client',\n\n /** Server-side error (e.g., logic failure or exception). */\n Server: 'server',\n\n /** Network-related error (e.g., unreachable endpoint). */\n Network: 'network',\n\n /** Blockchain-related error (e.g., transaction failure, gas limit). */\n Blockchain: 'blockchain',\n\n // Validation-specific error (e.g., failed constraints or field errors).\n Validation: 'validation',\n} as const;\n","/**\n * Enum representing the types of events in the application.\n * Uses dot notation for event naming convention.\n *\n * @example\n * ```typescript\n * import { EVENT_TYPE } from '@plyaz/types';\n *\n * const eventType = EVENT_TYPE.AppInit; // 'app.init'\n * ```\n */\nexport const EVENT_TYPE = {\n /** Application initialization event. */\n AppInit: 'app.init',\n} as const;\n\n/**\n * Const representing the priority levels for events.\n * Used to determine processing order and resource allocation.\n *\n * @example\n * ```typescript\n * import { EVENT_PRIORITY } from '@plyaz/types';\n *\n * const priority = EVENT_PRIORITY.High; // 'high'\n * ```\n */\nexport const EVENT_PRIORITY = {\n /** Low priority event. */\n Low: 'low',\n /** Normal priority event. */\n Normal: 'normal',\n /** High priority event. */\n High: 'high',\n /** Critical priority event. */\n Critical: 'critical',\n} as const;\n\n/**\n * Const representing the status of an event.\n * Tracks the lifecycle of event processing from creation to completion.\n *\n * @example\n * ```typescript\n * import { EVENT_STATUS } from '@plyaz/types';\n *\n * const status = EVENT_STATUS.Processing; // 'processing'\n *\n * // Typical event lifecycle:\n * // Pending -> Processing -> Completed\n * // or\n * // Pending -> Processing -> Failed -> Retrying -> Processing -> Completed\n * ```\n */\nexport const EVENT_STATUS = {\n /** Event is pending and has not started processing. */\n Pending: 'pending',\n /** Event is currently being processed. */\n Processing: 'processing',\n /** Event has been completed successfully. */\n Completed: 'completed',\n /** Event processing failed. */\n Failed: 'failed',\n /** Event is being retried after a failure. */\n Retrying: 'retrying',\n} as const;\n","/**\n * Enum representing supported EVM-compatible blockchain networks by their numeric chain IDs.\n * @description These IDs are used to identify the specific network when interacting with wallets or smart contracts.\n * @see https://chainlist.org for reference chain IDs\n *\n * @example\n * ```typescript\n * import { CHAIN_ID } from '@plyaz/types';\n *\n * const chainId = CHAIN_ID.EthereumMainnet; // 1\n * const isTestnet = chainId === CHAIN_ID.EthereumSepolia || chainId === CHAIN_ID.PolygonAmoy;\n * ```\n */\nexport const CHAIN_ID = {\n /** Ethereum Mainnet (Chain ID: 1). */\n EthereumMainnet: 1,\n\n /** Ethereum Sepolia Testnet (Chain ID: 11155111). */\n EthereumSepolia: 11_155_111,\n\n /** Optimism Mainnet (Chain ID: 10). */\n Optimism: 10,\n\n /** Optimism Sepolia Testnet (Chain ID: 11155420). */\n OptimismSepolia: 11_155_420,\n\n /** Arbitrum One Mainnet (Chain ID: 42161). */\n Arbitrum: 42_161,\n\n /** Arbitrum Sepolia Testnet (Chain ID: 421614). */\n ArbitrumSepolia: 421_614,\n\n /** Polygon Mainnet (Chain ID: 137). */\n Polygon: 137,\n\n /** Polygon Amoy Testnet (Chain ID: 80002). */\n PolygonAmoy: 80_002,\n\n /** Base Mainnet (Chain ID: 8453). */\n Base: 8_453,\n\n /** Base Sepolia Testnet (Chain ID: 84532). */\n BaseSepolia: 84_532,\n} as const;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/auth/enums.ts","../src/errors/enums.ts","../src/events/enums.ts","../src/web3/enums.ts"],"names":[],"mappings":";;;AAYO,IAAM,SAAY,GAAA;AAAA;AAAA,EAEvB,OAAS,EAAA,SAAA;AAAA;AAAA,EAGT,KAAO,EAAA,OAAA;AAAA;AAAA,EAGP,KAAO,EAAA,OAAA;AAAA;AAAA,EAGP,IAAM,EAAA,MAAA;AAAA;AAAA,EAGN,GAAK,EAAA,KAAA;AAAA;AAAA,EAGL,KAAO,EAAA,OAAA;AAAA;AAAA,EAGP,UAAY,EAAA;AACd;AAcO,IAAM,WAAc,GAAA;AAAA;AAAA,EAEzB,MAAQ,EAAA,QAAA;AAAA;AAAA,EAGR,QAAU,EAAA,UAAA;AAAA;AAAA,EAGV,OAAS,EAAA,SAAA;AAAA;AAAA,EAGT,SAAW,EAAA,WAAA;AAAA;AAAA,EAGX,MAAQ,EAAA;AACV;AAcO,IAAM,aAAgB,GAAA;AAAA;AAAA,EAE3B,KAA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QAAA;AAAA;AAAA,EAGjB,QAAU,EAAA,EAAA;AAAA;AAAA,EAGV,eAAiB,EAAA,QAAA;AAAA;AAAA,EAGjB,QAAU,EAAA,KAAA;AAAA;AAAA,EAGV,eAAiB,EAAA,MAAA;AAAA;AAAA,EAGjB,OAAS,EAAA,GAAA;AAAA;AAAA,EAGT,WAAa,EAAA,KAAA;AAAA;AAAA,EAGb,IAAM,EAAA,IAAA;AAAA;AAAA,EAGN,WAAa,EAAA;AACf","file":"index.js","sourcesContent":["/**\n * Enum representing the different roles a user can have within the system.\n * @description Roles are used to determine access levels, permissions, and user-specific experiences.\n *\n * @example\n * ```typescript\n * import { USER_ROLE } from '@plyaz/types';\n *\n * const userRole = USER_ROLE.Athlete; // 'athlete'\n * const isAdmin = userRole === USER_ROLE.Admin || userRole === USER_ROLE.SuperAdmin;\n * ```\n */\nexport const USER_ROLE = {\n /** A user who is an athlete and participates in sports activities. */\n Athlete: 'athlete',\n\n /** A user who scouts and discovers talent. */\n Scout: 'scout',\n\n /** A user who acts as an agent representing athletes or clubs. */\n Agent: 'agent',\n\n /** A user representing a sports club or organization. */\n Club: 'club',\n\n /** A fan or supporter of athletes or clubs. */\n Fan: 'fan',\n\n /** A system administrator with access to management tools. */\n Admin: 'admin',\n\n /** A super admin with the highest level of access and control. */\n SuperAdmin: 'super.admin',\n} as const;\n\n/**\n * Enum representing the current status of a user account.\n * @description Statuses are used to determine login availability, visibility, and user flow.\n *\n * @example\n * ```typescript\n * import { USER_STATUS } from '@plyaz/types';\n *\n * const isAccessible = status === USER_STATUS.Active;\n * const needsReview = status === USER_STATUS.Pending;\n * ```\n */\nexport const USER_STATUS = {\n /** Active user with full access. */\n Active: 'active',\n\n /** Inactive user, typically not currently using the platform. */\n Inactive: 'inactive',\n\n /** User account is awaiting approval or completion of setup. */\n Pending: 'pending',\n\n /** User has been temporarily suspended due to policy violations or manual review. */\n Suspended: 'suspended',\n\n /** User has been permanently banned from the platform. */\n Banned: 'banned',\n} as const;\n\n/**\n * Enum representing the supported authentication providers for user login.\n * @description Auth Providers allowed such as Email, Wallet, etc.\n *\n * @example\n * ```typescript\n * import { AUTH_PROVIDER } from '@plyaz/types';\n *\n * const provider = AUTH_PROVIDER.Wallet; // 'wallet'\n * const isWeb3Auth = provider === AUTH_PROVIDER.Wallet;\n * ```\n */\nexport const AUTH_PROVIDER = {\n /** Authentication via email and password. */\n Email: 'email',\n\n /** Authentication via connected blockchain wallet. */\n Wallet: 'wallet',\n} as const;\n","/**\n * Enum representing standardized error types used across the application.\n * @description These error types help classify different categories of errors such as validation issues and system-level failures.\n *\n * @example\n * ```typescript\n * import { ERROR_TYPE } from '@plyaz/types';\n *\n * const errorType = ERROR_TYPE.ValidationError; // 'validation.error'\n *\n * // Error handling example\n * if (error.type === ERROR_TYPE.RateLimitExceeded) {\n * // Handle rate limiting\n * }\n * ```\n */\nexport const ERROR_TYPE = {\n /** A general validation error (e.g., form or input errors). */\n ValidationError: 'validation.error',\n\n /** Error related to schema validation, such as JSON schema or API payload checks. */\n SchemaValidationError: 'validation.schema.error',\n\n /** Unhandled or unexpected system error. */\n InternalError: 'system.internal.error',\n\n /** System dependency is currently unavailable (e.g., database or external API). */\n ServiceUnavailable: 'system.service.unavailable',\n\n /** The request took too long and timed out. */\n TimeoutError: 'system.timeout',\n\n /** Too many requests made in a short period of time. */\n RateLimitExceeded: 'system.rate.limit.exceeded',\n} as const;\n\n/**\n * Enum representing the severity level of an error.\n * @description This allows categorization of errors by their potential impact on the system or user.\n *\n * @example\n * ```typescript\n * import { ERROR_SEVERITY } from '@plyaz/types';\n *\n * const severity = ERROR_SEVERITY.Critical; // 'critical'\n * const shouldAlert = severity === ERROR_SEVERITY.High || severity === ERROR_SEVERITY.Critical;\n * ```\n */\nexport const ERROR_SEVERITY = {\n /** Low severity - does not impact functionality significantly. */\n Low: 'low',\n\n /** Medium severity - minor disruption or warning. */\n Medium: 'medium',\n\n /** High severity - major issue requiring attention. */\n High: 'high',\n\n /** Critical severity - blocking or crashing issue. */\n Critical: 'critical',\n} as const;\n\n/**\n * Enum representing the category or origin of an error.\n * @description Useful for filtering or logging errors based on their source or nature.\n *\n * @example\n * ```typescript\n * import { ERROR_CATEGORY } from '@plyaz/types';\n *\n * const category = ERROR_CATEGORY.Blockchain; // 'blockchain'\n * const isClientError = category === ERROR_CATEGORY.Client;\n * ```\n */\nexport const ERROR_CATEGORY = {\n /** Client-side error (e.g., invalid request). */\n Client: 'client',\n\n /** Server-side error (e.g., logic failure or exception). */\n Server: 'server',\n\n /** Network-related error (e.g., unreachable endpoint). */\n Network: 'network',\n\n /** Blockchain-related error (e.g., transaction failure, gas limit). */\n Blockchain: 'blockchain',\n\n // Validation-specific error (e.g., failed constraints or field errors).\n Validation: 'validation',\n} as const;\n","/**\n * Enum representing the types of events in the application.\n * Uses dot notation for event naming convention.\n *\n * @example\n * ```typescript\n * import { EVENT_TYPE } from '@plyaz/types';\n *\n * const eventType = EVENT_TYPE.AppInit; // 'app.init'\n * ```\n */\nexport const EVENT_TYPE = {\n /** Application initialization event. */\n AppInit: 'app.init',\n} as const;\n\n/**\n * Const representing the priority levels for events.\n * Used to determine processing order and resource allocation.\n *\n * @example\n * ```typescript\n * import { EVENT_PRIORITY } from '@plyaz/types';\n *\n * const priority = EVENT_PRIORITY.High; // 'high'\n * ```\n */\nexport const EVENT_PRIORITY = {\n /** Low priority event. */\n Low: 'low',\n /** Normal priority event. */\n Normal: 'normal',\n /** High priority event. */\n High: 'high',\n /** Critical priority event. */\n Critical: 'critical',\n} as const;\n\n/**\n * Const representing the status of an event.\n * Tracks the lifecycle of event processing from creation to completion.\n *\n * @example\n * ```typescript\n * import { EVENT_STATUS } from '@plyaz/types';\n *\n * const status = EVENT_STATUS.Processing; // 'processing'\n *\n * // Typical event lifecycle:\n * // Pending -> Processing -> Completed\n * // or\n * // Pending -> Processing -> Failed -> Retrying -> Processing -> Completed\n * ```\n */\nexport const EVENT_STATUS = {\n /** Event is pending and has not started processing. */\n Pending: 'pending',\n /** Event is currently being processed. */\n Processing: 'processing',\n /** Event has been completed successfully. */\n Completed: 'completed',\n /** Event processing failed. */\n Failed: 'failed',\n /** Event is being retried after a failure. */\n Retrying: 'retrying',\n} as const;\n","/**\n * Enum representing supported EVM-compatible blockchain networks by their numeric chain IDs.\n * @description These IDs are used to identify the specific network when interacting with wallets or smart contracts.\n * @see https://chainlist.org for reference chain IDs\n *\n * @example\n * ```typescript\n * import { CHAIN_ID } from '@plyaz/types';\n *\n * const chainId = CHAIN_ID.EthereumMainnet; // 1\n * const isTestnet = chainId === CHAIN_ID.EthereumSepolia || chainId === CHAIN_ID.PolygonAmoy;\n * ```\n */\nexport const CHAIN_ID = {\n /** Ethereum Mainnet (Chain ID: 1). */\n EthereumMainnet: 1,\n\n /** Ethereum Sepolia Testnet (Chain ID: 11155111). */\n EthereumSepolia: 11_155_111,\n\n /** Optimism Mainnet (Chain ID: 10). */\n Optimism: 10,\n\n /** Optimism Sepolia Testnet (Chain ID: 11155420). */\n OptimismSepolia: 11_155_420,\n\n /** Arbitrum One Mainnet (Chain ID: 42161). */\n Arbitrum: 42_161,\n\n /** Arbitrum Sepolia Testnet (Chain ID: 421614). */\n ArbitrumSepolia: 421_614,\n\n /** Polygon Mainnet (Chain ID: 137). */\n Polygon: 137,\n\n /** Polygon Amoy Testnet (Chain ID: 80002). */\n PolygonAmoy: 80_002,\n\n /** Base Mainnet (Chain ID: 8453). */\n Base: 8_453,\n\n /** Base Sepolia Testnet (Chain ID: 84532). */\n BaseSepolia: 84_532,\n} as const;\n"]}
|
|
@@ -1717,24 +1717,17 @@ export interface AdvancedConsoleMock {
|
|
|
1717
1717
|
* ```
|
|
1718
1718
|
*/
|
|
1719
1719
|
export interface MockFormData {
|
|
1720
|
-
/** Append field */
|
|
1721
1720
|
append: Vitest.Mock;
|
|
1722
|
-
/** Delete field */
|
|
1723
1721
|
delete: Vitest.Mock;
|
|
1724
|
-
/** Get field value */
|
|
1725
1722
|
get: Vitest.Mock;
|
|
1726
|
-
/** Get all field values */
|
|
1727
1723
|
getAll: Vitest.Mock;
|
|
1728
|
-
/** Check if field exists */
|
|
1729
1724
|
has: Vitest.Mock;
|
|
1730
|
-
/** Set field value */
|
|
1731
1725
|
set: Vitest.Mock;
|
|
1732
|
-
/** Iterate entries */
|
|
1733
1726
|
entries: Vitest.Mock;
|
|
1734
|
-
/** Iterate keys */
|
|
1735
1727
|
keys: Vitest.Mock;
|
|
1736
|
-
/** Iterate values */
|
|
1737
1728
|
values: Vitest.Mock;
|
|
1729
|
+
forEach: Vitest.Mock;
|
|
1730
|
+
_entries: Map<string, Array<string | Blob>>;
|
|
1738
1731
|
}
|
|
1739
1732
|
/**
|
|
1740
1733
|
* Mock Axios implementation for testing HTTP requests.
|
|
@@ -1758,31 +1751,51 @@ export interface MockFormData {
|
|
|
1758
1751
|
* ```
|
|
1759
1752
|
*/
|
|
1760
1753
|
export interface MockAxios {
|
|
1761
|
-
/** GET request */
|
|
1762
1754
|
get: Vitest.Mock;
|
|
1763
|
-
/** POST request */
|
|
1764
1755
|
post: Vitest.Mock;
|
|
1765
|
-
/** PUT request */
|
|
1766
1756
|
put: Vitest.Mock;
|
|
1767
|
-
/** PATCH request */
|
|
1768
1757
|
patch: Vitest.Mock;
|
|
1769
|
-
/** DELETE request */
|
|
1770
1758
|
delete: Vitest.Mock;
|
|
1771
|
-
/** HEAD request */
|
|
1772
1759
|
head: Vitest.Mock;
|
|
1773
|
-
/** OPTIONS request */
|
|
1774
1760
|
options: Vitest.Mock;
|
|
1775
|
-
|
|
1761
|
+
request: Vitest.Mock;
|
|
1762
|
+
create: Vitest.Mock;
|
|
1763
|
+
defaults: {
|
|
1764
|
+
headers: {
|
|
1765
|
+
common: Record<string, string>;
|
|
1766
|
+
get: Record<string, string>;
|
|
1767
|
+
post: Record<string, string>;
|
|
1768
|
+
put: Record<string, string>;
|
|
1769
|
+
patch: Record<string, string>;
|
|
1770
|
+
delete: Record<string, string>;
|
|
1771
|
+
};
|
|
1772
|
+
baseURL?: string;
|
|
1773
|
+
timeout?: number;
|
|
1774
|
+
withCredentials?: boolean;
|
|
1775
|
+
};
|
|
1776
1776
|
interceptors: {
|
|
1777
1777
|
request: {
|
|
1778
1778
|
use: Vitest.Mock;
|
|
1779
1779
|
eject: Vitest.Mock;
|
|
1780
|
+
handlers: Array<{
|
|
1781
|
+
fulfilled: Function;
|
|
1782
|
+
rejected?: Function;
|
|
1783
|
+
}>;
|
|
1780
1784
|
};
|
|
1781
1785
|
response: {
|
|
1782
1786
|
use: Vitest.Mock;
|
|
1783
1787
|
eject: Vitest.Mock;
|
|
1788
|
+
handlers: Array<{
|
|
1789
|
+
fulfilled: Function;
|
|
1790
|
+
rejected?: Function;
|
|
1791
|
+
}>;
|
|
1784
1792
|
};
|
|
1785
1793
|
};
|
|
1794
|
+
mockResponse: Vitest.Mock;
|
|
1795
|
+
mockError: Vitest.Mock;
|
|
1796
|
+
mockResponseOnce: Vitest.Mock;
|
|
1797
|
+
mockErrorOnce: Vitest.Mock;
|
|
1798
|
+
reset: Vitest.Mock;
|
|
1786
1799
|
}
|
|
1787
1800
|
/**
|
|
1788
1801
|
* Mock Headers implementation for testing HTTP headers.
|
|
@@ -1807,22 +1820,16 @@ export interface MockAxios {
|
|
|
1807
1820
|
* ```
|
|
1808
1821
|
*/
|
|
1809
1822
|
export interface MockHeaders {
|
|
1810
|
-
/** Append header */
|
|
1811
1823
|
append: Vitest.Mock;
|
|
1812
|
-
/** Delete header */
|
|
1813
1824
|
delete: Vitest.Mock;
|
|
1814
|
-
/** Get header value */
|
|
1815
1825
|
get: Vitest.Mock;
|
|
1816
|
-
/** Check if header exists */
|
|
1817
1826
|
has: Vitest.Mock;
|
|
1818
|
-
/** Set header value */
|
|
1819
1827
|
set: Vitest.Mock;
|
|
1820
|
-
/** Iterate entries */
|
|
1821
1828
|
entries: Vitest.Mock;
|
|
1822
|
-
/** Iterate keys */
|
|
1823
1829
|
keys: Vitest.Mock;
|
|
1824
|
-
/** Iterate values */
|
|
1825
1830
|
values: Vitest.Mock;
|
|
1831
|
+
forEach: Vitest.Mock;
|
|
1832
|
+
_headers: Map<string, string>;
|
|
1826
1833
|
}
|
|
1827
1834
|
/**
|
|
1828
1835
|
* Mock cookie manager for testing cookie operations.
|
|
@@ -1844,20 +1851,18 @@ export interface MockHeaders {
|
|
|
1844
1851
|
* ```
|
|
1845
1852
|
*/
|
|
1846
1853
|
export interface MockCookie {
|
|
1847
|
-
/** Get cookie */
|
|
1848
1854
|
get: Vitest.Mock;
|
|
1849
|
-
/** Set cookie */
|
|
1850
1855
|
set: Vitest.Mock;
|
|
1851
|
-
/** Delete cookie */
|
|
1852
1856
|
delete: Vitest.Mock;
|
|
1853
|
-
/** Get all cookies */
|
|
1854
|
-
getAll: Vitest.Mock;
|
|
1855
|
-
/** Clear cookies */
|
|
1856
1857
|
clear: Vitest.Mock;
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
/** Serialize cookie */
|
|
1858
|
+
getAll: Vitest.Mock;
|
|
1859
|
+
has: Vitest.Mock;
|
|
1860
1860
|
serialize: Vitest.Mock;
|
|
1861
|
+
parse: Vitest.Mock;
|
|
1862
|
+
_cookies: Map<string, {
|
|
1863
|
+
value: string;
|
|
1864
|
+
options?: unknown;
|
|
1865
|
+
}>;
|
|
1861
1866
|
}
|
|
1862
1867
|
/**
|
|
1863
1868
|
* Mock session implementation for testing session management.
|
|
@@ -1881,20 +1886,20 @@ export interface MockCookie {
|
|
|
1881
1886
|
* ```
|
|
1882
1887
|
*/
|
|
1883
1888
|
export interface MockSession {
|
|
1884
|
-
/** Get session value */
|
|
1885
1889
|
get: Vitest.Mock;
|
|
1886
|
-
/** Set session value */
|
|
1887
1890
|
set: Vitest.Mock;
|
|
1888
|
-
/** Delete session value */
|
|
1889
1891
|
delete: Vitest.Mock;
|
|
1890
|
-
/** Clear session */
|
|
1891
1892
|
clear: Vitest.Mock;
|
|
1892
|
-
|
|
1893
|
+
has: Vitest.Mock;
|
|
1893
1894
|
save: Vitest.Mock;
|
|
1894
|
-
/** Destroy session */
|
|
1895
1895
|
destroy: Vitest.Mock;
|
|
1896
|
-
|
|
1896
|
+
regenerate: Vitest.Mock;
|
|
1897
1897
|
touch: Vitest.Mock;
|
|
1898
|
+
reload: Vitest.Mock;
|
|
1899
|
+
id: string;
|
|
1900
|
+
_data: Record<string, unknown>;
|
|
1901
|
+
_dirty: boolean;
|
|
1902
|
+
_destroyed: boolean;
|
|
1898
1903
|
}
|
|
1899
1904
|
/**
|
|
1900
1905
|
* Mock HTTP interceptor for testing request/response interception.
|
|
@@ -1918,16 +1923,32 @@ export interface MockSession {
|
|
|
1918
1923
|
* ```
|
|
1919
1924
|
*/
|
|
1920
1925
|
export interface MockInterceptor {
|
|
1921
|
-
/** Intercept requests */
|
|
1922
1926
|
intercept: Vitest.Mock;
|
|
1923
|
-
/** Capture requests */
|
|
1924
1927
|
capture: Vitest.Mock;
|
|
1925
|
-
/** Reply to requests */
|
|
1926
1928
|
reply: Vitest.Mock;
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1929
|
+
replyWithError: Vitest.Mock;
|
|
1930
|
+
delay: Vitest.Mock;
|
|
1931
|
+
times: Vitest.Mock;
|
|
1932
|
+
persist: Vitest.Mock;
|
|
1933
|
+
once: Vitest.Mock;
|
|
1934
|
+
reset: Vitest.Mock;
|
|
1935
|
+
isDone: Vitest.Mock;
|
|
1936
|
+
_matches: Array<{
|
|
1937
|
+
method: string;
|
|
1938
|
+
path: string;
|
|
1939
|
+
response?: unknown;
|
|
1940
|
+
error?: Error;
|
|
1941
|
+
delay?: number;
|
|
1942
|
+
times?: number;
|
|
1943
|
+
persistent?: boolean;
|
|
1944
|
+
}>;
|
|
1945
|
+
_captured: Array<{
|
|
1946
|
+
method: string;
|
|
1947
|
+
url: string;
|
|
1948
|
+
headers: Record<string, string>;
|
|
1949
|
+
body?: unknown;
|
|
1950
|
+
timestamp: number;
|
|
1951
|
+
}>;
|
|
1931
1952
|
}
|
|
1932
1953
|
/**
|
|
1933
1954
|
* Mock OS module interface for testing OS-specific functionality.
|