supercompat 3.15.6 → 3.15.7
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.cjs +1 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -23
- package/dist/index.js.map +1 -1
- package/dist/supercompat.cjs +0 -9
- package/dist/supercompat.cjs.map +1 -1
- package/dist/supercompat.js +0 -9
- package/dist/supercompat.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -493,18 +493,13 @@ var requestHandlers = function(param) {
|
|
|
493
493
|
var findRequestHandler = function(param) {
|
|
494
494
|
var url = param.url, requestHandlers2 = param.requestHandlers;
|
|
495
495
|
var pathname = new URL(url).pathname;
|
|
496
|
-
console.log("[findRequestHandler] Looking for handler for pathname:", pathname);
|
|
497
|
-
console.log("[findRequestHandler] Available patterns:", Object.keys(requestHandlers2));
|
|
498
496
|
for(var key in requestHandlers2){
|
|
499
497
|
var regex = new RegExp(key);
|
|
500
498
|
var matches = regex.test(pathname);
|
|
501
|
-
console.log("[findRequestHandler] Testing pattern:", key, "- Matches:", matches);
|
|
502
499
|
if (matches) {
|
|
503
|
-
console.log("[findRequestHandler] Found handler!");
|
|
504
500
|
return requestHandlers2[key];
|
|
505
501
|
}
|
|
506
502
|
}
|
|
507
|
-
console.log("[findRequestHandler] No handler found for pathname:", pathname);
|
|
508
503
|
};
|
|
509
504
|
// src/supercompatFetch/originalFetch.ts
|
|
510
505
|
var originalFetch = function(param) {
|
|
@@ -567,13 +562,11 @@ var supercompatFetch = function(param) {
|
|
|
567
562
|
var _ref, _args, url, options, pathHandler, method, requestHandler;
|
|
568
563
|
return _ts_generator(this, function(_state) {
|
|
569
564
|
_args = _sliced_to_array(args, 2), url = _args[0], options = _args[1];
|
|
570
|
-
console.log("[supercompatFetch] Request:", (options === null || options === void 0 ? void 0 : options.method) || "GET", url);
|
|
571
565
|
pathHandler = findRequestHandler({
|
|
572
566
|
url: url,
|
|
573
567
|
requestHandlers: requestHandlers2
|
|
574
568
|
});
|
|
575
569
|
if (!pathHandler) {
|
|
576
|
-
console.log("[supercompatFetch] No handler found, using originalFetch");
|
|
577
570
|
return [
|
|
578
571
|
2,
|
|
579
572
|
originalFetch({
|
|
@@ -585,7 +578,6 @@ var supercompatFetch = function(param) {
|
|
|
585
578
|
method = (_ref = options === null || options === void 0 ? void 0 : options.method) !== null && _ref !== void 0 ? _ref : "";
|
|
586
579
|
requestHandler = pathHandler[method.toLowerCase()];
|
|
587
580
|
if (!requestHandler) {
|
|
588
|
-
console.log("[supercompatFetch] Handler found but no method handler, using originalFetch");
|
|
589
581
|
return [
|
|
590
582
|
2,
|
|
591
583
|
originalFetch({
|
|
@@ -594,7 +586,6 @@ var supercompatFetch = function(param) {
|
|
|
594
586
|
})
|
|
595
587
|
];
|
|
596
588
|
}
|
|
597
|
-
console.log("[supercompatFetch] Handler found, calling it");
|
|
598
589
|
return [
|
|
599
590
|
2,
|
|
600
591
|
requestHandler.apply(void 0, _to_consumable_array(args))
|
|
@@ -9150,26 +9141,22 @@ var azureResponsesStorageAdapter = function() {
|
|
|
9150
9141
|
};
|
|
9151
9142
|
var getAzureClient = function() {
|
|
9152
9143
|
return _async_to_generator(function() {
|
|
9153
|
-
var _aiProjectClient__options, aiProjectClient, apiVersion,
|
|
9144
|
+
var _aiProjectClient__options, aiProjectClient, apiVersion, azureClient, azureClient1;
|
|
9154
9145
|
return _ts_generator(this, function(_state) {
|
|
9155
9146
|
switch(_state.label){
|
|
9156
9147
|
case 0:
|
|
9157
|
-
console.log("[azureResponsesStorageAdapter] getAzureClient called");
|
|
9158
9148
|
if (cachedClient) {
|
|
9159
|
-
console.log("[azureResponsesStorageAdapter] Returning cached Azure client");
|
|
9160
9149
|
return [
|
|
9161
9150
|
2,
|
|
9162
9151
|
cachedClient
|
|
9163
9152
|
];
|
|
9164
9153
|
}
|
|
9165
9154
|
aiProjectClient = getAIProjectClient();
|
|
9166
|
-
console.log("[azureResponsesStorageAdapter] aiProjectClient obtained");
|
|
9167
9155
|
apiVersion = (typeof aiProjectClient === "undefined" ? "undefined" : _type_of(aiProjectClient)) === "object" ? (_aiProjectClient__options = aiProjectClient._options) === null || _aiProjectClient__options === void 0 ? void 0 : _aiProjectClient__options.apiVersion : void 0;
|
|
9168
9156
|
if (!(aiProjectClient && (typeof aiProjectClient === "undefined" ? "undefined" : _type_of(aiProjectClient)) === "object" && "getAzureOpenAIClient" in aiProjectClient && typeof aiProjectClient.getAzureOpenAIClient === "function")) return [
|
|
9169
9157
|
3,
|
|
9170
9158
|
2
|
|
9171
9159
|
];
|
|
9172
|
-
console.log("[azureResponsesStorageAdapter] Calling getAzureOpenAIClient()");
|
|
9173
9160
|
return [
|
|
9174
9161
|
4,
|
|
9175
9162
|
aiProjectClient.getAzureOpenAIClient(apiVersion ? {
|
|
@@ -9178,9 +9165,6 @@ var azureResponsesStorageAdapter = function() {
|
|
|
9178
9165
|
];
|
|
9179
9166
|
case 1:
|
|
9180
9167
|
azureClient = _state.sent();
|
|
9181
|
-
console.log("[azureResponsesStorageAdapter] Azure OpenAI client obtained");
|
|
9182
|
-
console.log("[azureResponsesStorageAdapter] Azure client baseURL:", azureClient.baseURL);
|
|
9183
|
-
console.log("[azureResponsesStorageAdapter] Azure client apiKey:", ((_azureClient_apiKey = azureClient.apiKey) === null || _azureClient_apiKey === void 0 ? void 0 : _azureClient_apiKey.substring(0, 20)) + "...");
|
|
9184
9168
|
cachedClient = azureClient;
|
|
9185
9169
|
return [
|
|
9186
9170
|
2,
|
|
@@ -9191,7 +9175,6 @@ var azureResponsesStorageAdapter = function() {
|
|
|
9191
9175
|
3,
|
|
9192
9176
|
4
|
|
9193
9177
|
];
|
|
9194
|
-
console.log("[azureResponsesStorageAdapter] Calling getOpenAIClient()");
|
|
9195
9178
|
return [
|
|
9196
9179
|
4,
|
|
9197
9180
|
aiProjectClient.getOpenAIClient(apiVersion ? {
|
|
@@ -9200,16 +9183,12 @@ var azureResponsesStorageAdapter = function() {
|
|
|
9200
9183
|
];
|
|
9201
9184
|
case 3:
|
|
9202
9185
|
azureClient1 = _state.sent();
|
|
9203
|
-
console.log("[azureResponsesStorageAdapter] Azure OpenAI client obtained");
|
|
9204
|
-
console.log("[azureResponsesStorageAdapter] Azure client baseURL:", azureClient1.baseURL);
|
|
9205
|
-
console.log("[azureResponsesStorageAdapter] Azure client apiKey:", ((_azureClient_apiKey1 = azureClient1.apiKey) === null || _azureClient_apiKey1 === void 0 ? void 0 : _azureClient_apiKey1.substring(0, 20)) + "...");
|
|
9206
9186
|
cachedClient = azureClient1;
|
|
9207
9187
|
return [
|
|
9208
9188
|
2,
|
|
9209
9189
|
azureClient1
|
|
9210
9190
|
];
|
|
9211
9191
|
case 4:
|
|
9212
|
-
console.log("[azureResponsesStorageAdapter] Not an AIProjectClient, treating as OpenAI client");
|
|
9213
9192
|
cachedClient = aiProjectClient;
|
|
9214
9193
|
return [
|
|
9215
9194
|
2,
|
|
@@ -9284,7 +9263,6 @@ var azureResponsesStorageAdapter = function() {
|
|
|
9284
9263
|
return _ts_generator(this, function(_state) {
|
|
9285
9264
|
switch(_state.label){
|
|
9286
9265
|
case 0:
|
|
9287
|
-
console.log("[azureResponsesStorageAdapter] Handler called for:", urlString);
|
|
9288
9266
|
return [
|
|
9289
9267
|
4,
|
|
9290
9268
|
getAzureClient()
|