@plyaz/api 1.2.2 → 1.3.0
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/client/clientEventManager.d.ts +8 -2
- package/dist/api/client/clientEventManager.d.ts.map +1 -1
- package/dist/api/client/createApiClient.d.ts.map +1 -1
- package/dist/api/client/helpers/interceptors.d.ts +2 -2
- package/dist/api/client/helpers/interceptors.d.ts.map +1 -1
- package/dist/api/config/global.d.ts.map +1 -1
- package/dist/api/debugger/DebugReport.d.ts.map +1 -1
- package/dist/api/debugger/UnifiedDebugger.d.ts.map +1 -1
- package/dist/api/debugger/queue/DebuggerQueueManager.d.ts.map +1 -1
- package/dist/api/debugger/queue/OperationTracker.d.ts.map +1 -1
- package/dist/api/endpoints/campaigns.d.ts.map +1 -1
- package/dist/api/endpoints/index.d.ts +55 -0
- package/dist/api/endpoints/index.d.ts.map +1 -1
- package/dist/api/endpoints/infobip.d.ts +209 -0
- package/dist/api/endpoints/infobip.d.ts.map +1 -0
- package/dist/api/errors/adapter.d.ts +71 -0
- package/dist/api/errors/adapter.d.ts.map +1 -0
- package/dist/api/errors/index.d.ts +3 -15
- package/dist/api/errors/index.d.ts.map +1 -1
- package/dist/api/events/EventManager.d.ts.map +1 -1
- package/dist/api/events/factories/base.d.ts +11 -3
- package/dist/api/events/factories/base.d.ts.map +1 -1
- package/dist/api/events/factories/errors.d.ts +10 -10
- package/dist/api/events/factories/errors.d.ts.map +1 -1
- package/dist/api/events/queue/ConfigUpdateQueueManager.d.ts.map +1 -1
- package/dist/api/events/queue/EventQueueManager.d.ts.map +1 -1
- package/dist/api/headers/headerBuilder.d.ts.map +1 -1
- package/dist/api/hooks/factories/createApiMutation.d.ts +3 -3
- package/dist/api/hooks/factories/createApiMutation.d.ts.map +1 -1
- package/dist/api/hooks/factories/createApiQuery.d.ts +3 -3
- package/dist/api/hooks/factories/createApiQuery.d.ts.map +1 -1
- package/dist/api/hooks/index.d.ts +0 -1
- package/dist/api/hooks/index.d.ts.map +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/network/frameworks/express.d.ts.map +1 -1
- package/dist/api/network/frameworks/nestjs/decorators.d.ts +9 -1
- package/dist/api/network/frameworks/nestjs/decorators.d.ts.map +1 -1
- package/dist/api/network/frameworks/nestjs/enrichedHeadersGuard.d.ts.map +1 -1
- package/dist/api/network/frameworks/nestjs/enrichedHeadersInterceptor.d.ts.map +1 -1
- package/dist/api/network/networkConfigurationManager.d.ts.map +1 -1
- package/dist/api/network/status.d.ts +1 -4
- package/dist/api/network/status.d.ts.map +1 -1
- package/dist/api/performance/performanceMonitor.d.ts.map +1 -1
- package/dist/api/polling/index.d.ts +1 -1
- package/dist/api/polling/index.d.ts.map +1 -1
- package/dist/api/polling/strategies.d.ts +1 -5
- package/dist/api/polling/strategies.d.ts.map +1 -1
- package/dist/api/polling/utils.d.ts.map +1 -1
- package/dist/api/pubsub/index.d.ts.map +1 -1
- package/dist/api/pubsub/react.d.ts +6 -10
- package/dist/api/pubsub/react.d.ts.map +1 -1
- package/dist/api/queue/BaseOperationTracker.d.ts.map +1 -1
- package/dist/api/queue/EventQueueManager.d.ts.map +1 -1
- package/dist/api/queue/QueueOrchestrator.d.ts.map +1 -1
- package/dist/api/services/campaigns/GET/useCampaign.d.ts +1 -1
- package/dist/api/services/campaigns/GET/useCampaign.d.ts.map +1 -1
- package/dist/api/services/campaigns/GET/useCampaignParticipants.d.ts +1 -11
- package/dist/api/services/campaigns/GET/useCampaignParticipants.d.ts.map +1 -1
- package/dist/api/services/campaigns/GET/useCampaignStats.d.ts +1 -1
- package/dist/api/services/campaigns/GET/useCampaignStats.d.ts.map +1 -1
- package/dist/api/services/campaigns/GET/useCampaigns.d.ts +1 -1
- package/dist/api/services/campaigns/GET/useCampaigns.d.ts.map +1 -1
- package/dist/api/services/campaigns/PUT/useUpdateCampaign.d.ts +1 -9
- package/dist/api/services/campaigns/PUT/useUpdateCampaign.d.ts.map +1 -1
- package/dist/api/services/index.d.ts +1 -0
- package/dist/api/services/index.d.ts.map +1 -1
- package/dist/api/services/infobip/email/GET/fetchEmailLogs.d.ts +50 -0
- package/dist/api/services/infobip/email/GET/fetchEmailLogs.d.ts.map +1 -0
- package/dist/api/services/infobip/email/GET/fetchEmailReports.d.ts +44 -0
- package/dist/api/services/infobip/email/GET/fetchEmailReports.d.ts.map +1 -0
- package/dist/api/services/infobip/email/GET/fetchScheduledEmailStatuses.d.ts +28 -0
- package/dist/api/services/infobip/email/GET/fetchScheduledEmailStatuses.d.ts.map +1 -0
- package/dist/api/services/infobip/email/GET/fetchScheduledEmails.d.ts +27 -0
- package/dist/api/services/infobip/email/GET/fetchScheduledEmails.d.ts.map +1 -0
- package/dist/api/services/infobip/email/GET/fetchValidations.d.ts +60 -0
- package/dist/api/services/infobip/email/GET/fetchValidations.d.ts.map +1 -0
- package/dist/api/services/infobip/email/GET/index.d.ts +10 -0
- package/dist/api/services/infobip/email/GET/index.d.ts.map +1 -0
- package/dist/api/services/infobip/email/POST/bulkValidateEmails.d.ts +50 -0
- package/dist/api/services/infobip/email/POST/bulkValidateEmails.d.ts.map +1 -0
- package/dist/api/services/infobip/email/POST/index.d.ts +9 -0
- package/dist/api/services/infobip/email/POST/index.d.ts.map +1 -0
- package/dist/api/services/infobip/email/POST/sendAdvancedEmail.d.ts +67 -0
- package/dist/api/services/infobip/email/POST/sendAdvancedEmail.d.ts.map +1 -0
- package/dist/api/services/infobip/email/POST/sendEmail.d.ts +60 -0
- package/dist/api/services/infobip/email/POST/sendEmail.d.ts.map +1 -0
- package/dist/api/services/infobip/email/POST/validateEmail.d.ts +40 -0
- package/dist/api/services/infobip/email/POST/validateEmail.d.ts.map +1 -0
- package/dist/api/services/infobip/email/PUT/index.d.ts +7 -0
- package/dist/api/services/infobip/email/PUT/index.d.ts.map +1 -0
- package/dist/api/services/infobip/email/PUT/rescheduleEmails.d.ts +29 -0
- package/dist/api/services/infobip/email/PUT/rescheduleEmails.d.ts.map +1 -0
- package/dist/api/services/infobip/email/PUT/updateScheduledEmailStatuses.d.ts +36 -0
- package/dist/api/services/infobip/email/PUT/updateScheduledEmailStatuses.d.ts.map +1 -0
- package/dist/api/services/infobip/email/index.d.ts +8 -0
- package/dist/api/services/infobip/email/index.d.ts.map +1 -0
- package/dist/api/services/infobip/index.d.ts +6 -0
- package/dist/api/services/infobip/index.d.ts.map +1 -0
- package/dist/api/utils/index.d.ts +0 -3
- package/dist/api/utils/index.d.ts.map +1 -1
- package/dist/index.cjs +1130 -1395
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1079 -1349
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -5
- package/dist/api/errors/ApiPackageError.d.ts +0 -101
- package/dist/api/errors/ApiPackageError.d.ts.map +0 -1
- package/dist/api/errors/definitions.d.ts +0 -24
- package/dist/api/errors/definitions.d.ts.map +0 -1
- package/dist/api/errors/error-codes.d.ts +0 -116
- package/dist/api/errors/error-codes.d.ts.map +0 -1
- package/dist/api/errors/error-events.d.ts +0 -63
- package/dist/api/errors/error-events.d.ts.map +0 -1
- package/dist/api/errors/types-constants.d.ts +0 -64
- package/dist/api/errors/types-constants.d.ts.map +0 -1
- package/dist/api/hooks/types.d.ts +0 -82
- package/dist/api/hooks/types.d.ts.map +0 -1
- package/dist/api/utils/generation/correlation-id.d.ts +0 -206
- package/dist/api/utils/generation/correlation-id.d.ts.map +0 -1
- package/dist/api/utils/generation/id-generator.d.ts +0 -133
- package/dist/api/utils/generation/id-generator.d.ts.map +0 -1
- package/dist/api/utils/generation/request-id.d.ts +0 -106
- package/dist/api/utils/generation/request-id.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plyaz/api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "@plyaz/api ⚡ Core Plyaz API client enabling seamless Web3 interactions, authentication, and data access across apps and services. Built for scalability, reliability, and tokenized fan engagement experiences.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [],
|
|
@@ -27,9 +27,11 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@nestjs/common": "^11.1.
|
|
31
|
-
"@plyaz/config": "^1.
|
|
32
|
-
"@
|
|
30
|
+
"@nestjs/common": "^11.1.7",
|
|
31
|
+
"@plyaz/config": "^1.7.0",
|
|
32
|
+
"@plyaz/errors": "^1.3.1",
|
|
33
|
+
"@plyaz/logger": "^1.3.2",
|
|
34
|
+
"@tanstack/react-query": "5.85.6",
|
|
33
35
|
"@tanstack/react-query-devtools": "^5.85.6",
|
|
34
36
|
"express": "^5.1.0",
|
|
35
37
|
"fetchff": "^4.1.0",
|
|
@@ -49,7 +51,7 @@
|
|
|
49
51
|
"@next/eslint-plugin-next": "^15.0.3",
|
|
50
52
|
"@plyaz/devtools": "^1.8.5",
|
|
51
53
|
"@plyaz/testing": "^1.5.1",
|
|
52
|
-
"@plyaz/types": "^1.
|
|
54
|
+
"@plyaz/types": "^1.14.4",
|
|
53
55
|
"@testing-library/jest-dom": "^6.6.3",
|
|
54
56
|
"@testing-library/react": "^16.3.0",
|
|
55
57
|
"@testing-library/user-event": "^14.6.1",
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Main error class for @plyaz/api package
|
|
3
|
-
*/
|
|
4
|
-
import type { ResponseError, RequestConfig } from 'fetchff';
|
|
5
|
-
import type { ApiPackageErrorOptions, ErrorContext, ApiClientInstance, ApiPackageErrorLike, ErrorCategoryValue, ApiErrorCodeValue, StatusCodeValue } from '@plyaz/types/api';
|
|
6
|
-
import type { ErrorResponse, ErrorDetail } from '@plyaz/types';
|
|
7
|
-
import type { EndpointsList } from '../endpoints';
|
|
8
|
-
/**
|
|
9
|
-
* Enhanced error class that implements ErrorResponse interface
|
|
10
|
-
* Wraps fetchff's ResponseError for compatibility
|
|
11
|
-
*/
|
|
12
|
-
export declare class ApiPackageError extends Error implements ApiPackageErrorLike {
|
|
13
|
-
readonly statusCode: StatusCodeValue;
|
|
14
|
-
readonly errorCode: ApiErrorCodeValue;
|
|
15
|
-
readonly message: string;
|
|
16
|
-
readonly errors?: ErrorDetail<unknown, unknown, unknown>[];
|
|
17
|
-
readonly correlationId?: string;
|
|
18
|
-
readonly timestamp: string;
|
|
19
|
-
readonly responseError?: ResponseError;
|
|
20
|
-
readonly category: ErrorCategoryValue;
|
|
21
|
-
readonly cause?: Error;
|
|
22
|
-
readonly context?: ErrorContext;
|
|
23
|
-
readonly requestConfig?: RequestConfig;
|
|
24
|
-
readonly responseData?: ResponseError['response'];
|
|
25
|
-
readonly details?: ErrorDetail<unknown, unknown, unknown>[];
|
|
26
|
-
readonly originalError?: Error;
|
|
27
|
-
readonly metadata?: Record<string, string | number | boolean | null>;
|
|
28
|
-
/**
|
|
29
|
-
* Getter for code property (alias for errorCode)
|
|
30
|
-
* Provides compatibility with standard error patterns
|
|
31
|
-
*/
|
|
32
|
-
get code(): string;
|
|
33
|
-
constructor(message: string, statusCode?: StatusCodeValue | 0, errorCode?: ApiErrorCodeValue, options?: ApiPackageErrorOptions<EndpointsList>);
|
|
34
|
-
/**
|
|
35
|
-
* Resolves the status code from the provided value or error definitions
|
|
36
|
-
*/
|
|
37
|
-
private resolveStatusCode;
|
|
38
|
-
/**
|
|
39
|
-
* Emit error event for this error
|
|
40
|
-
* Can be called with a specific client context or uses global handlers
|
|
41
|
-
*/
|
|
42
|
-
private emitEvent;
|
|
43
|
-
/**
|
|
44
|
-
* Creates an ApiPackageError from a fetchff ResponseError
|
|
45
|
-
*/
|
|
46
|
-
static fromResponseError(responseError: ResponseError, config?: RequestConfig, clientContext?: ApiClientInstance<EndpointsList>): ApiPackageError;
|
|
47
|
-
/**
|
|
48
|
-
* Creates an ApiPackageError from a standard Error
|
|
49
|
-
*/
|
|
50
|
-
static fromError(error: Error, statusCode?: StatusCodeValue | 0, errorCode?: ApiErrorCodeValue, context?: ApiClientInstance<EndpointsList>): ApiPackageError;
|
|
51
|
-
/**
|
|
52
|
-
* Classifies an error and returns appropriate code and status
|
|
53
|
-
*/
|
|
54
|
-
private static classifyError;
|
|
55
|
-
/**
|
|
56
|
-
* Determines appropriate error code from ResponseError by looking up status in ERROR_DEFINITIONS
|
|
57
|
-
*/
|
|
58
|
-
private static determineErrorCode;
|
|
59
|
-
/**
|
|
60
|
-
* Gets a generic error code based on HTTP status range
|
|
61
|
-
*/
|
|
62
|
-
private static getGenericErrorCode;
|
|
63
|
-
/**
|
|
64
|
-
* Gets the error category from ERROR_DEFINITIONS
|
|
65
|
-
*/
|
|
66
|
-
private categorizeError;
|
|
67
|
-
/**
|
|
68
|
-
* Checks if this is a specific category of error
|
|
69
|
-
*/
|
|
70
|
-
isAuthError(): boolean;
|
|
71
|
-
isValidationError(): boolean;
|
|
72
|
-
isNetworkError(): boolean;
|
|
73
|
-
isServerError(): boolean;
|
|
74
|
-
isClientError(): boolean;
|
|
75
|
-
isRetryable(): boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Converts to ErrorResponse format (as per task-020)
|
|
78
|
-
*/
|
|
79
|
-
toJSON(): ErrorResponse;
|
|
80
|
-
/**
|
|
81
|
-
* Creates a string representation
|
|
82
|
-
*/
|
|
83
|
-
toString(): string;
|
|
84
|
-
/**
|
|
85
|
-
* Check if error is an ApiPackageError
|
|
86
|
-
*/
|
|
87
|
-
static isApiPackageError(error: Error | ApiPackageError): error is ApiPackageError;
|
|
88
|
-
/**
|
|
89
|
-
* Get user-friendly message for display
|
|
90
|
-
*/
|
|
91
|
-
getUserMessage(): string;
|
|
92
|
-
/**
|
|
93
|
-
* Gets custom user message from error details if available
|
|
94
|
-
*/
|
|
95
|
-
private getCustomUserMessage;
|
|
96
|
-
/**
|
|
97
|
-
* Gets default user message based on error category
|
|
98
|
-
*/
|
|
99
|
-
private getDefaultUserMessage;
|
|
100
|
-
}
|
|
101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M,CAAC,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,eAAe,GAAG,KAAK,IAAI,eAAe;IAIlF;;OAEG;IACH,cAAc,IAAI,MAAM;IAWxB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAS5B;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAwB9B"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Centralized error definitions mapping for @plyaz/api package
|
|
3
|
-
* Maps error codes to their HTTP status and metadata
|
|
4
|
-
*/
|
|
5
|
-
import type { ErrorDefinitions, ErrorDefinition } from '@plyaz/types/api';
|
|
6
|
-
import { ERROR_CATEGORY } from '@plyaz/types';
|
|
7
|
-
/**
|
|
8
|
-
* Centralized error definitions mapping
|
|
9
|
-
* Maps error codes to their HTTP status and metadata
|
|
10
|
-
*/
|
|
11
|
-
export declare const ERROR_DEFINITIONS: ErrorDefinitions;
|
|
12
|
-
/**
|
|
13
|
-
* Helper function to get error definition by code
|
|
14
|
-
*/
|
|
15
|
-
export declare function getErrorDefinition(errorCode: string): ErrorDefinition | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* Helper function to get error code by status
|
|
18
|
-
*/
|
|
19
|
-
export declare function getErrorCodeByStatus(status: number): string | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* Helper function to get category for error code
|
|
22
|
-
*/
|
|
23
|
-
export declare function getErrorCategory(errorCode: string): (typeof ERROR_CATEGORY)[keyof typeof ERROR_CATEGORY];
|
|
24
|
-
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../src/api/errors/definitions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI9C;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,gBA0RtB,CAAC;AAEX;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAEjF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKvE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,GAChB,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAEtD"}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Domain-specific error codes for @plyaz/api package
|
|
3
|
-
* Following the error code pattern from Confluence architecture
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* API Error Codes - domain-specific and grouped by category
|
|
7
|
-
*/
|
|
8
|
-
export declare const API_ERROR_CODES: {
|
|
9
|
-
readonly CLIENT_INITIALIZATION_FAILED: "CLIENT_INITIALIZATION_FAILED";
|
|
10
|
-
readonly CLIENT_INVALID_CONFIG: "CLIENT_INVALID_CONFIG";
|
|
11
|
-
readonly CLIENT_MISSING_BASE_URL: "CLIENT_MISSING_BASE_URL";
|
|
12
|
-
readonly CLIENT_CANCELLED: "CLIENT_CANCELLED";
|
|
13
|
-
readonly CONFIG_VALIDATION_FAILED: "CONFIG_VALIDATION_FAILED";
|
|
14
|
-
readonly HEADER_PROCESSING_FAILED: "HEADER_PROCESSING_FAILED";
|
|
15
|
-
readonly NETWORK_OVERRIDE_FAILED: "NETWORK_OVERRIDE_FAILED";
|
|
16
|
-
readonly REQUEST_TIMEOUT: "REQUEST_TIMEOUT";
|
|
17
|
-
readonly REQUEST_ABORTED: "REQUEST_ABORTED";
|
|
18
|
-
readonly REQUEST_INVALID_PARAMS: "REQUEST_INVALID_PARAMS";
|
|
19
|
-
readonly REQUEST_PREPARATION_FAILED: "REQUEST_PREPARATION_FAILED";
|
|
20
|
-
readonly RESPONSE_INVALID_FORMAT: "RESPONSE_INVALID_FORMAT";
|
|
21
|
-
readonly RESPONSE_PARSING_FAILED: "RESPONSE_PARSING_FAILED";
|
|
22
|
-
readonly NETWORK_CONNECTION_FAILED: "NETWORK_CONNECTION_FAILED";
|
|
23
|
-
readonly NETWORK_OFFLINE: "NETWORK_OFFLINE";
|
|
24
|
-
readonly NETWORK_DNS_FAILED: "NETWORK_DNS_FAILED";
|
|
25
|
-
readonly NETWORK_TIMEOUT: "NETWORK_TIMEOUT";
|
|
26
|
-
readonly NETWORK_ERROR: "NETWORK_ERROR";
|
|
27
|
-
readonly NETWORK_PRESET_NOT_FOUND: "NETWORK_PRESET_NOT_FOUND";
|
|
28
|
-
readonly NETWORK_CONFIGURATION_INVALID: "NETWORK_CONFIGURATION_INVALID";
|
|
29
|
-
readonly REGIONAL_PRESET_NOT_FOUND: "REGIONAL_PRESET_NOT_FOUND";
|
|
30
|
-
readonly REGION_DETECTION_FAILED: "REGION_DETECTION_FAILED";
|
|
31
|
-
readonly HEADERS_ENRICHMENT_FAILED: "HEADERS_ENRICHMENT_FAILED";
|
|
32
|
-
readonly HEADERS_VALIDATION_FAILED: "HEADERS_VALIDATION_FAILED";
|
|
33
|
-
readonly HEADERS_MERGE_CONFLICT: "HEADERS_MERGE_CONFLICT";
|
|
34
|
-
readonly CACHE_STORAGE_FAILED: "CACHE_STORAGE_FAILED";
|
|
35
|
-
readonly CACHE_RETRIEVAL_FAILED: "CACHE_RETRIEVAL_FAILED";
|
|
36
|
-
readonly CACHE_INVALIDATION_FAILED: "CACHE_INVALIDATION_FAILED";
|
|
37
|
-
readonly RETRY_EXHAUSTED: "RETRY_EXHAUSTED";
|
|
38
|
-
readonly RETRY_STRATEGY_INVALID: "RETRY_STRATEGY_INVALID";
|
|
39
|
-
readonly STRATEGY_INVALID: "STRATEGY_INVALID";
|
|
40
|
-
readonly STRATEGY_CONFLICT: "STRATEGY_CONFLICT";
|
|
41
|
-
readonly STRATEGY_EXECUTION_FAILED: "STRATEGY_EXECUTION_FAILED";
|
|
42
|
-
readonly POLLING_TIMEOUT: "POLLING_TIMEOUT";
|
|
43
|
-
readonly POLLING_CANCELLED: "POLLING_CANCELLED";
|
|
44
|
-
readonly POLLING_INVALID_CONFIG: "POLLING_INVALID_CONFIG";
|
|
45
|
-
readonly PUBSUB_SUBSCRIPTION_FAILED: "PUBSUB_SUBSCRIPTION_FAILED";
|
|
46
|
-
readonly PUBSUB_PUBLICATION_FAILED: "PUBSUB_PUBLICATION_FAILED";
|
|
47
|
-
readonly PUBSUB_INVALID_TOPIC: "PUBSUB_INVALID_TOPIC";
|
|
48
|
-
readonly PUBSUB_CHANNEL_ERROR: "PUBSUB_CHANNEL_ERROR";
|
|
49
|
-
readonly REVALIDATION_FAILED: "REVALIDATION_FAILED";
|
|
50
|
-
readonly REVALIDATION_IN_PROGRESS: "REVALIDATION_IN_PROGRESS";
|
|
51
|
-
readonly DEBUG_TRACKING_FAILED: "DEBUG_TRACKING_FAILED";
|
|
52
|
-
readonly DEBUG_OVERRIDE_FAILED: "DEBUG_OVERRIDE_FAILED";
|
|
53
|
-
readonly DEBUG_CONFLICT_DETECTED: "DEBUG_CONFLICT_DETECTED";
|
|
54
|
-
readonly ENDPOINT_BUILD_FAILED: "ENDPOINT_BUILD_FAILED";
|
|
55
|
-
readonly ENDPOINT_NOT_FOUND: "ENDPOINT_NOT_FOUND";
|
|
56
|
-
readonly ENDPOINT_INVALID_CONFIG: "ENDPOINT_INVALID_CONFIG";
|
|
57
|
-
readonly EVENT_HANDLER_FAILED: "EVENT_HANDLER_FAILED";
|
|
58
|
-
readonly EVENT_EMISSION_FAILED: "EVENT_EMISSION_FAILED";
|
|
59
|
-
readonly MONITORING_FAILED: "MONITORING_FAILED";
|
|
60
|
-
readonly CONTEXT_OPERATION_FAILED: "CONTEXT_OPERATION_FAILED";
|
|
61
|
-
readonly AUTH_TOKEN_EXPIRED: "AUTH_TOKEN_EXPIRED";
|
|
62
|
-
readonly AUTH_UNAUTHORIZED: "AUTH_UNAUTHORIZED";
|
|
63
|
-
readonly AUTH_FORBIDDEN: "AUTH_FORBIDDEN";
|
|
64
|
-
readonly AUTH_INVALID_CREDENTIALS: "AUTH_INVALID_CREDENTIALS";
|
|
65
|
-
readonly RATE_LIMIT_EXCEEDED: "RATE_LIMIT_EXCEEDED";
|
|
66
|
-
readonly RESOURCE_NOT_FOUND: "RESOURCE_NOT_FOUND";
|
|
67
|
-
readonly INTERNAL_SERVER_ERROR: "INTERNAL_SERVER_ERROR";
|
|
68
|
-
readonly SERVICE_UNAVAILABLE: "SERVICE_UNAVAILABLE";
|
|
69
|
-
readonly EXTERNAL_SERVICE_ERROR: "EXTERNAL_SERVICE_ERROR";
|
|
70
|
-
readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
|
|
71
|
-
readonly VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
72
|
-
readonly VALIDATION_FAILED: "VALIDATION_FAILED";
|
|
73
|
-
readonly REQUIRED_FIELD_MISSING: "REQUIRED_FIELD_MISSING";
|
|
74
|
-
readonly INVALID_FORMAT: "INVALID_FORMAT";
|
|
75
|
-
readonly VALIDATION_INVALID_FORMAT: "INVALID_FORMAT";
|
|
76
|
-
readonly STRING_TOO_SHORT: "STRING_TOO_SHORT";
|
|
77
|
-
readonly STRING_TOO_LONG: "STRING_TOO_LONG";
|
|
78
|
-
readonly CLIENT_ERROR: "CLIENT_ERROR";
|
|
79
|
-
readonly SERVER_ERROR: "SERVER_ERROR";
|
|
80
|
-
readonly TIMEOUT: "TIMEOUT";
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* Type for API error codes
|
|
84
|
-
*/
|
|
85
|
-
export type ApiErrorCode = (typeof API_ERROR_CODES)[keyof typeof API_ERROR_CODES];
|
|
86
|
-
/**
|
|
87
|
-
* Internal package status codes (non-HTTP)
|
|
88
|
-
* Used for internal configuration and validation errors that aren't HTTP-related
|
|
89
|
-
*/
|
|
90
|
-
export declare const PACKAGE_STATUS_CODES: {
|
|
91
|
-
readonly INVALID_CONFIGURATION: 1001;
|
|
92
|
-
readonly MISSING_CONFIGURATION: 1002;
|
|
93
|
-
readonly CONFIGURATION_CONFLICT: 1003;
|
|
94
|
-
readonly CONFIGURATION_TRACKING_FAILED: 1004;
|
|
95
|
-
readonly DEBUG_TRACKING_FAILED: 1005;
|
|
96
|
-
readonly RESOURCE_NOT_FOUND: 1010;
|
|
97
|
-
readonly RESOURCE_ALREADY_EXISTS: 1011;
|
|
98
|
-
readonly RESOURCE_UNAVAILABLE: 1012;
|
|
99
|
-
readonly INVALID_PARAMETER: 1020;
|
|
100
|
-
readonly MISSING_PARAMETER: 1021;
|
|
101
|
-
readonly PARAMETER_OUT_OF_RANGE: 1022;
|
|
102
|
-
readonly STRATEGY_NOT_FOUND: 1030;
|
|
103
|
-
readonly PRESET_NOT_FOUND: 1031;
|
|
104
|
-
readonly INVALID_STRATEGY: 1032;
|
|
105
|
-
readonly REQUEST_FAILED: 1035;
|
|
106
|
-
readonly INITIALIZATION_FAILED: 1040;
|
|
107
|
-
readonly OPERATION_FAILED: 1041;
|
|
108
|
-
readonly STATE_CORRUPTION: 1042;
|
|
109
|
-
readonly SERIALIZATION_FAILED: 1043;
|
|
110
|
-
readonly DESERIALIZATION_FAILED: 1044;
|
|
111
|
-
readonly CONFIGURATION_INVALID: 1045;
|
|
112
|
-
readonly HEADER_PROCESSING_ERROR: 1046;
|
|
113
|
-
readonly REGION_DETECTION_ERROR: 1047;
|
|
114
|
-
readonly NETWORK_OVERRIDE_ERROR: 1048;
|
|
115
|
-
};
|
|
116
|
-
//# sourceMappingURL=error-codes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../../src/api/errors/error-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoHlB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;CAoCvB,CAAC"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error event management for @plyaz/api package
|
|
3
|
-
* Simplified to use shared event emitter and factories
|
|
4
|
-
*/
|
|
5
|
-
import type { ErrorEventHandlers, ErrorHandlerOptions, ERROR_EVENTS, ApiPackageErrorLike } from '@plyaz/types/api';
|
|
6
|
-
import { HANDLER_SCOPES } from '@plyaz/types/api';
|
|
7
|
-
/**
|
|
8
|
-
* Register an error handler for any scope
|
|
9
|
-
* @param eventType - The event type (e.g., ERROR_EVENTS.NETWORK_ERROR, 'network', '*')
|
|
10
|
-
* @param handler - The handler function
|
|
11
|
-
* @param options - Registration options (scope defaults to 'GLOBAL' - app-wide handlers that persist across all instances)
|
|
12
|
-
* @returns Cleanup function to unregister the handler
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* // Register a global handler (default)
|
|
16
|
-
* registerErrorHandler(ERROR_EVENTS.NETWORK_ERROR, handleNetworkError);
|
|
17
|
-
*
|
|
18
|
-
* // Register a client-specific handler
|
|
19
|
-
* registerErrorHandler(ERROR_EVENTS.NETWORK_ERROR, handleNetworkError, { scope: 'CLIENT' });
|
|
20
|
-
*/
|
|
21
|
-
export declare function registerErrorHandler(eventType: string | (typeof ERROR_EVENTS)[keyof typeof ERROR_EVENTS], handler: (error: ApiPackageErrorLike) => void, options?: ErrorHandlerOptions): () => void;
|
|
22
|
-
/**
|
|
23
|
-
* Set error handlers for a specific scope
|
|
24
|
-
* @param handlers - The error handlers to register
|
|
25
|
-
* @param scope - The scope to register handlers at (defaults to GLOBAL - lowest priority, persists across all instances)
|
|
26
|
-
*/
|
|
27
|
-
export declare function setErrorHandlers(handlers: ErrorEventHandlers, scope?: keyof typeof HANDLER_SCOPES): void;
|
|
28
|
-
/**
|
|
29
|
-
* Get error handlers for a specific scope
|
|
30
|
-
* @param scope - The scope to retrieve handlers from (defaults to GLOBAL)
|
|
31
|
-
* @returns The registered error handlers for the specified scope
|
|
32
|
-
*/
|
|
33
|
-
export declare function getErrorHandlers(scope?: keyof typeof HANDLER_SCOPES): ErrorEventHandlers;
|
|
34
|
-
/**
|
|
35
|
-
* Register multiple error handlers at once
|
|
36
|
-
* @param handlers - The error handlers to register
|
|
37
|
-
* @param options - Registration options (scope defaults to 'GLOBAL' - app-wide handlers)
|
|
38
|
-
*/
|
|
39
|
-
export declare function registerErrorHandlers(handlers: ErrorEventHandlers, options?: ErrorHandlerOptions): void;
|
|
40
|
-
/**
|
|
41
|
-
* Unregister error handlers
|
|
42
|
-
* @param eventTypes - Optional array of event types to remove (can use ERROR_EVENTS values or plain types)
|
|
43
|
-
* If not provided, all handlers for the scope are removed.
|
|
44
|
-
* @param options - Options including scope (defaults to 'GLOBAL')
|
|
45
|
-
*/
|
|
46
|
-
export declare function unregisterErrorHandlers(eventTypes?: Array<string | (typeof ERROR_EVENTS)[keyof typeof ERROR_EVENTS]>, options?: Pick<ErrorHandlerOptions, 'scope'>): void;
|
|
47
|
-
/**
|
|
48
|
-
* Clear error handlers
|
|
49
|
-
* @param options - Options including scope(s) to clear (defaults to ['GLOBAL'])
|
|
50
|
-
*/
|
|
51
|
-
export declare function clearErrorHandlers(options?: {
|
|
52
|
-
scopes?: Array<keyof typeof HANDLER_SCOPES>;
|
|
53
|
-
}): void;
|
|
54
|
-
/**
|
|
55
|
-
* Register a one-time error handler
|
|
56
|
-
* Handler will be automatically removed after first execution
|
|
57
|
-
* @param eventType - The event type (e.g., ERROR_EVENTS.NETWORK_ERROR, 'network', '*')
|
|
58
|
-
* @param handler - The handler function
|
|
59
|
-
* @param options - Registration options (scope defaults to 'GLOBAL')
|
|
60
|
-
*/
|
|
61
|
-
export declare function onceErrorHandler(eventType: string | (typeof ERROR_EVENTS)[keyof typeof ERROR_EVENTS], handler: (error: ApiPackageErrorLike) => void, options?: Pick<ErrorHandlerOptions, 'scope'>): void;
|
|
62
|
-
export declare function emitErrorEvent(error: ApiPackageErrorLike): Promise<void>;
|
|
63
|
-
//# sourceMappingURL=error-events.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-events.d.ts","sourceRoot":"","sources":["../../../src/api/errors/error-events.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,KAAK,EACV,kBAAkB,EAElB,mBAAmB,EAGnB,YAAY,EACZ,mBAAmB,EAEpB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAiC,MAAM,kBAAkB,CAAC;AAsGjF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,EACpE,OAAO,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,EAC7C,OAAO,GAAE,mBAAwB,GAChC,MAAM,IAAI,CA0BZ;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,GAAE,MAAM,OAAO,cAAyB,GAC5C,IAAI,CAEN;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,GAAE,MAAM,OAAO,cAAyB,GAC5C,kBAAkB,CAEpB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,GAAE,mBAAwB,GAChC,IAAI,CAGN;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC,EAC7E,OAAO,GAAE,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAM,GAC/C,IAAI,CAmBN;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,OAAO,cAAc,CAAC,CAAA;CAAO,GAC5D,IAAI,CAQN;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,EACpE,OAAO,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,EAC7C,OAAO,GAAE,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAM,GAC/C,IAAI,CAaN;AAuID,wBAAsB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ9E"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Typed constants for error handling
|
|
3
|
-
*/
|
|
4
|
-
export declare const OPERATIONS: {
|
|
5
|
-
readonly STORAGE: "storage";
|
|
6
|
-
readonly RETRIEVAL: "retrieval";
|
|
7
|
-
readonly INVALIDATION: "invalidation";
|
|
8
|
-
readonly ENRICHMENT: "enrichment";
|
|
9
|
-
readonly VALIDATION: "validation";
|
|
10
|
-
readonly PRESET_LOOKUP: "preset-lookup";
|
|
11
|
-
readonly INITIALIZATION: "initialization";
|
|
12
|
-
readonly CONFIGURATION: "configuration";
|
|
13
|
-
readonly REQUEST: "request";
|
|
14
|
-
readonly RESPONSE: "response";
|
|
15
|
-
readonly RETRY: "retry";
|
|
16
|
-
readonly REVALIDATION: "revalidation";
|
|
17
|
-
readonly STRATEGY_EXECUTION: "strategy-execution";
|
|
18
|
-
readonly POLLING: "polling";
|
|
19
|
-
readonly SUBSCRIPTION: "subscription";
|
|
20
|
-
readonly PUBLICATION: "publication";
|
|
21
|
-
readonly DEBUG: "debug";
|
|
22
|
-
readonly DEBUG_TRACKING: "debug-tracking";
|
|
23
|
-
readonly ENDPOINT_BUILD: "endpoint-build";
|
|
24
|
-
readonly TRACKING: "tracking";
|
|
25
|
-
readonly NETWORK_CHECK: "network-check";
|
|
26
|
-
readonly EVENT_HANDLING: "event-handling";
|
|
27
|
-
readonly SERIALIZATION: "serialization";
|
|
28
|
-
readonly DESERIALIZATION: "deserialization";
|
|
29
|
-
readonly REGIONAL_DETECTION: "regional-detection";
|
|
30
|
-
readonly MONITORING: "monitoring";
|
|
31
|
-
readonly CONTEXT_SETUP: "context-setup";
|
|
32
|
-
readonly FALLBACK: "fallback";
|
|
33
|
-
};
|
|
34
|
-
export type Operation = (typeof OPERATIONS)[keyof typeof OPERATIONS];
|
|
35
|
-
export declare const ERROR_FIELDS: {
|
|
36
|
-
readonly STORAGE: "storage";
|
|
37
|
-
readonly CACHE: "cache";
|
|
38
|
-
readonly HEADERS: "headers";
|
|
39
|
-
readonly PRESET_NAME: "presetName";
|
|
40
|
-
readonly PRESET_ID: "presetId";
|
|
41
|
-
readonly CONFIG: "config";
|
|
42
|
-
readonly URL: "url";
|
|
43
|
-
readonly METHOD: "method";
|
|
44
|
-
readonly STRATEGY: "strategy";
|
|
45
|
-
readonly RETRY_COUNT: "retryCount";
|
|
46
|
-
readonly MAX_RETRIES: "maxRetries";
|
|
47
|
-
readonly POLLING_INTERVAL: "pollingInterval";
|
|
48
|
-
readonly TOPIC: "topic";
|
|
49
|
-
readonly CHANNEL: "channel";
|
|
50
|
-
readonly ENDPOINT: "endpoint";
|
|
51
|
-
readonly CLIENT: "client";
|
|
52
|
-
readonly NETWORK_TYPE: "networkType";
|
|
53
|
-
readonly TIME_INTERVAL: "timeInterval";
|
|
54
|
-
};
|
|
55
|
-
export type ErrorField = (typeof ERROR_FIELDS)[keyof typeof ERROR_FIELDS];
|
|
56
|
-
export declare const STORAGE_TYPES: {
|
|
57
|
-
readonly PRIMARY: "primary";
|
|
58
|
-
readonly FALLBACK: "fallback";
|
|
59
|
-
readonly MEMORY: "memory";
|
|
60
|
-
readonly SESSION: "session";
|
|
61
|
-
readonly LOCAL: "local";
|
|
62
|
-
};
|
|
63
|
-
export type StorageType = (typeof STORAGE_TYPES)[keyof typeof STORAGE_TYPES];
|
|
64
|
-
//# sourceMappingURL=types-constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-constants.d.ts","sourceRoot":"","sources":["../../../src/api/errors/types-constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6Bb,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAGrE,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;CAmBf,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAG1E,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hook Types and Options
|
|
3
|
-
* TypeScript types for React Query hooks with API configuration support
|
|
4
|
-
*/
|
|
5
|
-
import type { UseQueryOptions, UseMutationOptions, QueryKey, UseQueryResult, UseMutationResult } from '@tanstack/react-query';
|
|
6
|
-
import type { ApiConfig, ApiClientWithEvents } from '@plyaz/types/api';
|
|
7
|
-
import type { ClientEventManager } from '../client/clientEventManager';
|
|
8
|
-
import type { EndpointsList } from '../endpoints';
|
|
9
|
-
/**
|
|
10
|
-
* Options for query hooks (GET requests)
|
|
11
|
-
* Extends React Query's UseQueryOptions with API-specific options
|
|
12
|
-
*
|
|
13
|
-
* @template TData - The type of data returned by the query
|
|
14
|
-
* @template TError - The type of error that can be thrown (defaults to Error)
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* const queryOptions: ApiQueryOptions<Campaign> = {
|
|
19
|
-
* staleTime: 5 * 60 * 1000,
|
|
20
|
-
* apiConfig: { timeout: 10000 },
|
|
21
|
-
* enabled: !!campaignId,
|
|
22
|
-
* };
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export interface ApiQueryOptions<TData, TError = Error, OverrideEndpointsList = EndpointsList> extends Omit<UseQueryOptions<TData, TError>, 'queryKey' | 'queryFn'> {
|
|
26
|
-
/**
|
|
27
|
-
* Optional API client instance to use for this query
|
|
28
|
-
* Overrides the default client instance
|
|
29
|
-
*/
|
|
30
|
-
apiClient?: ApiClientWithEvents<ClientEventManager, OverrideEndpointsList>;
|
|
31
|
-
/**
|
|
32
|
-
* Optional API configuration for this specific query
|
|
33
|
-
* Applied temporarily using updateConfig({ strategy: 'temporary' })
|
|
34
|
-
*/
|
|
35
|
-
apiConfig?: Partial<ApiConfig>;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Options for mutation hooks (POST, PUT, PATCH, DELETE)
|
|
39
|
-
* Extends React Query's UseMutationOptions with API-specific options
|
|
40
|
-
*
|
|
41
|
-
* @template TData - The type of data returned by the mutation
|
|
42
|
-
* @template TVariables - The type of variables passed to the mutation
|
|
43
|
-
* @template TError - The type of error that can be thrown (defaults to Error)
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```typescript
|
|
47
|
-
* const mutationOptions: ApiMutationOptions<Campaign, CreateCampaignDto> = {
|
|
48
|
-
* apiConfig: { timeout: 30000 },
|
|
49
|
-
* onSuccess: (data) => {
|
|
50
|
-
* console.log('Campaign created:', data.id);
|
|
51
|
-
* },
|
|
52
|
-
* };
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
export interface ApiMutationOptions<TData, TVariables, TError = Error, OverrideEndpointsList = EndpointsList> extends Omit<UseMutationOptions<TData, TError, TVariables>, 'mutationFn'> {
|
|
56
|
-
/**
|
|
57
|
-
* Optional API client instance to use for this mutation
|
|
58
|
-
* Overrides the default client instance
|
|
59
|
-
*/
|
|
60
|
-
apiClient?: ApiClientWithEvents<ClientEventManager, OverrideEndpointsList>;
|
|
61
|
-
/**
|
|
62
|
-
* Optional API configuration for this specific mutation
|
|
63
|
-
* Applied temporarily using updateConfig({ strategy: 'temporary' })
|
|
64
|
-
*/
|
|
65
|
-
apiConfig?: Partial<ApiConfig>;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Return type for query hooks
|
|
69
|
-
* Re-export from React Query for convenience
|
|
70
|
-
*/
|
|
71
|
-
export type { UseQueryResult };
|
|
72
|
-
/**
|
|
73
|
-
* Return type for mutation hooks
|
|
74
|
-
* Re-export from React Query for convenience
|
|
75
|
-
*/
|
|
76
|
-
export type { UseMutationResult };
|
|
77
|
-
/**
|
|
78
|
-
* Query key type
|
|
79
|
-
* Re-export from React Query for convenience
|
|
80
|
-
*/
|
|
81
|
-
export type { QueryKey };
|
|
82
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/api/hooks/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,QAAQ,EACR,cAAc,EACd,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,eAAe,CAAC,KAAK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