@fluwa-tool/sdk 1.0.34 → 1.0.35
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.
|
@@ -115,6 +115,10 @@ class FetchInterceptor {
|
|
|
115
115
|
requestMetadata.source = types_1.RequestSource.MOCK;
|
|
116
116
|
requestMetadata.response = mockResponse.response;
|
|
117
117
|
requestMetadata.status = mockResponse.status;
|
|
118
|
+
this.logger.debug(`✅ Retornando mock para ${method} ${url}`, {
|
|
119
|
+
status: mockResponse.status,
|
|
120
|
+
response: mockResponse.response
|
|
121
|
+
});
|
|
118
122
|
// Aplicar delay se configurado
|
|
119
123
|
if (mockResponse.delay) {
|
|
120
124
|
await this.delay(mockResponse.delay);
|
|
@@ -124,11 +128,16 @@ class FetchInterceptor {
|
|
|
124
128
|
// Registrar completamento
|
|
125
129
|
await this.requestLogger.logComplete(requestMetadata);
|
|
126
130
|
// Retornar mock como Response
|
|
127
|
-
|
|
131
|
+
const mockResponseObj = new Response(JSON.stringify(mockResponse.response), {
|
|
128
132
|
status: mockResponse.status || 200,
|
|
129
133
|
statusText: 'Mock',
|
|
130
134
|
headers: { 'Content-Type': 'application/json' },
|
|
131
135
|
});
|
|
136
|
+
this.logger.debug(`📤 Mock Response criada:`, {
|
|
137
|
+
status: mockResponseObj.status,
|
|
138
|
+
statusText: mockResponseObj.statusText
|
|
139
|
+
});
|
|
140
|
+
return mockResponseObj;
|
|
132
141
|
}
|
|
133
142
|
// Fazer request real
|
|
134
143
|
const response = await this.originalFetch.apply(globalThis, args);
|