@zerosls/clm-sdk 2.0.0 → 2.1.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/core/api-client.js +19 -0
- package/package.json +1 -1
- package/src/core/api-client.ts +24 -0
package/dist/core/api-client.js
CHANGED
|
@@ -93,6 +93,14 @@ export class ApiClient {
|
|
|
93
93
|
method,
|
|
94
94
|
data,
|
|
95
95
|
});
|
|
96
|
+
// Colocado
|
|
97
|
+
if (this.debug) {
|
|
98
|
+
console.log("🍪 Cookies Debug:", {
|
|
99
|
+
credentials: this.credentials,
|
|
100
|
+
documentCookie: typeof document !== "undefined" ? document.cookie : "N/A",
|
|
101
|
+
url: url,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
96
104
|
try {
|
|
97
105
|
const fetchOptions = {
|
|
98
106
|
method,
|
|
@@ -104,7 +112,18 @@ export class ApiClient {
|
|
|
104
112
|
console.log(`📤 ${method} Body:`, data);
|
|
105
113
|
}
|
|
106
114
|
console.log(`🌐 ${method} ${url}`, fetchOptions);
|
|
115
|
+
// Colocado
|
|
116
|
+
console.log(`🌐 ${method} ${url}`, {
|
|
117
|
+
...fetchOptions,
|
|
118
|
+
cookieHeader: headers.get("Cookie"),
|
|
119
|
+
});
|
|
107
120
|
const response = await fetch(url, fetchOptions);
|
|
121
|
+
// Colocado
|
|
122
|
+
if (this.debug) {
|
|
123
|
+
console.log("📥 Response Headers:", {
|
|
124
|
+
setCookie: response.headers.get("Set-Cookie"),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
108
127
|
if (!response.ok) {
|
|
109
128
|
let errorData;
|
|
110
129
|
try {
|
package/package.json
CHANGED
package/src/core/api-client.ts
CHANGED
|
@@ -176,6 +176,16 @@ export class ApiClient {
|
|
|
176
176
|
data,
|
|
177
177
|
});
|
|
178
178
|
|
|
179
|
+
// Colocado
|
|
180
|
+
if (this.debug) {
|
|
181
|
+
console.log("🍪 Cookies Debug:", {
|
|
182
|
+
credentials: this.credentials,
|
|
183
|
+
documentCookie:
|
|
184
|
+
typeof document !== "undefined" ? document.cookie : "N/A",
|
|
185
|
+
url: url,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
179
189
|
try {
|
|
180
190
|
const fetchOptions: RequestInit = {
|
|
181
191
|
method,
|
|
@@ -189,8 +199,22 @@ export class ApiClient {
|
|
|
189
199
|
}
|
|
190
200
|
|
|
191
201
|
console.log(`🌐 ${method} ${url}`, fetchOptions);
|
|
202
|
+
|
|
203
|
+
// Colocado
|
|
204
|
+
console.log(`🌐 ${method} ${url}`, {
|
|
205
|
+
...fetchOptions,
|
|
206
|
+
cookieHeader: headers.get("Cookie"),
|
|
207
|
+
});
|
|
208
|
+
|
|
192
209
|
const response = await fetch(url, fetchOptions);
|
|
193
210
|
|
|
211
|
+
// Colocado
|
|
212
|
+
if (this.debug) {
|
|
213
|
+
console.log("📥 Response Headers:", {
|
|
214
|
+
setCookie: response.headers.get("Set-Cookie"),
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
|
|
194
218
|
if (!response.ok) {
|
|
195
219
|
let errorData;
|
|
196
220
|
try {
|