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.js
CHANGED
|
@@ -372,18 +372,13 @@ var requestHandlers = function(param) {
|
|
|
372
372
|
var findRequestHandler = function(param) {
|
|
373
373
|
var url = param.url, requestHandlers2 = param.requestHandlers;
|
|
374
374
|
var pathname = new URL(url).pathname;
|
|
375
|
-
console.log("[findRequestHandler] Looking for handler for pathname:", pathname);
|
|
376
|
-
console.log("[findRequestHandler] Available patterns:", Object.keys(requestHandlers2));
|
|
377
375
|
for(var key in requestHandlers2){
|
|
378
376
|
var regex = new RegExp(key);
|
|
379
377
|
var matches = regex.test(pathname);
|
|
380
|
-
console.log("[findRequestHandler] Testing pattern:", key, "- Matches:", matches);
|
|
381
378
|
if (matches) {
|
|
382
|
-
console.log("[findRequestHandler] Found handler!");
|
|
383
379
|
return requestHandlers2[key];
|
|
384
380
|
}
|
|
385
381
|
}
|
|
386
|
-
console.log("[findRequestHandler] No handler found for pathname:", pathname);
|
|
387
382
|
};
|
|
388
383
|
// src/supercompatFetch/originalFetch.ts
|
|
389
384
|
var originalFetch = function(param) {
|
|
@@ -446,13 +441,11 @@ var supercompatFetch = function(param) {
|
|
|
446
441
|
var _ref, _args, url, options, pathHandler, method, requestHandler;
|
|
447
442
|
return _ts_generator(this, function(_state) {
|
|
448
443
|
_args = _sliced_to_array(args, 2), url = _args[0], options = _args[1];
|
|
449
|
-
console.log("[supercompatFetch] Request:", (options === null || options === void 0 ? void 0 : options.method) || "GET", url);
|
|
450
444
|
pathHandler = findRequestHandler({
|
|
451
445
|
url: url,
|
|
452
446
|
requestHandlers: requestHandlers2
|
|
453
447
|
});
|
|
454
448
|
if (!pathHandler) {
|
|
455
|
-
console.log("[supercompatFetch] No handler found, using originalFetch");
|
|
456
449
|
return [
|
|
457
450
|
2,
|
|
458
451
|
originalFetch({
|
|
@@ -464,7 +457,6 @@ var supercompatFetch = function(param) {
|
|
|
464
457
|
method = (_ref = options === null || options === void 0 ? void 0 : options.method) !== null && _ref !== void 0 ? _ref : "";
|
|
465
458
|
requestHandler = pathHandler[method.toLowerCase()];
|
|
466
459
|
if (!requestHandler) {
|
|
467
|
-
console.log("[supercompatFetch] Handler found but no method handler, using originalFetch");
|
|
468
460
|
return [
|
|
469
461
|
2,
|
|
470
462
|
originalFetch({
|
|
@@ -473,7 +465,6 @@ var supercompatFetch = function(param) {
|
|
|
473
465
|
})
|
|
474
466
|
];
|
|
475
467
|
}
|
|
476
|
-
console.log("[supercompatFetch] Handler found, calling it");
|
|
477
468
|
return [
|
|
478
469
|
2,
|
|
479
470
|
requestHandler.apply(void 0, _to_consumable_array(args))
|
|
@@ -9028,26 +9019,22 @@ var azureResponsesStorageAdapter = function() {
|
|
|
9028
9019
|
};
|
|
9029
9020
|
var getAzureClient = function() {
|
|
9030
9021
|
return _async_to_generator(function() {
|
|
9031
|
-
var _aiProjectClient__options, aiProjectClient, apiVersion,
|
|
9022
|
+
var _aiProjectClient__options, aiProjectClient, apiVersion, azureClient, azureClient1;
|
|
9032
9023
|
return _ts_generator(this, function(_state) {
|
|
9033
9024
|
switch(_state.label){
|
|
9034
9025
|
case 0:
|
|
9035
|
-
console.log("[azureResponsesStorageAdapter] getAzureClient called");
|
|
9036
9026
|
if (cachedClient) {
|
|
9037
|
-
console.log("[azureResponsesStorageAdapter] Returning cached Azure client");
|
|
9038
9027
|
return [
|
|
9039
9028
|
2,
|
|
9040
9029
|
cachedClient
|
|
9041
9030
|
];
|
|
9042
9031
|
}
|
|
9043
9032
|
aiProjectClient = getAIProjectClient();
|
|
9044
|
-
console.log("[azureResponsesStorageAdapter] aiProjectClient obtained");
|
|
9045
9033
|
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;
|
|
9046
9034
|
if (!(aiProjectClient && (typeof aiProjectClient === "undefined" ? "undefined" : _type_of(aiProjectClient)) === "object" && "getAzureOpenAIClient" in aiProjectClient && typeof aiProjectClient.getAzureOpenAIClient === "function")) return [
|
|
9047
9035
|
3,
|
|
9048
9036
|
2
|
|
9049
9037
|
];
|
|
9050
|
-
console.log("[azureResponsesStorageAdapter] Calling getAzureOpenAIClient()");
|
|
9051
9038
|
return [
|
|
9052
9039
|
4,
|
|
9053
9040
|
aiProjectClient.getAzureOpenAIClient(apiVersion ? {
|
|
@@ -9056,9 +9043,6 @@ var azureResponsesStorageAdapter = function() {
|
|
|
9056
9043
|
];
|
|
9057
9044
|
case 1:
|
|
9058
9045
|
azureClient = _state.sent();
|
|
9059
|
-
console.log("[azureResponsesStorageAdapter] Azure OpenAI client obtained");
|
|
9060
|
-
console.log("[azureResponsesStorageAdapter] Azure client baseURL:", azureClient.baseURL);
|
|
9061
|
-
console.log("[azureResponsesStorageAdapter] Azure client apiKey:", ((_azureClient_apiKey = azureClient.apiKey) === null || _azureClient_apiKey === void 0 ? void 0 : _azureClient_apiKey.substring(0, 20)) + "...");
|
|
9062
9046
|
cachedClient = azureClient;
|
|
9063
9047
|
return [
|
|
9064
9048
|
2,
|
|
@@ -9069,7 +9053,6 @@ var azureResponsesStorageAdapter = function() {
|
|
|
9069
9053
|
3,
|
|
9070
9054
|
4
|
|
9071
9055
|
];
|
|
9072
|
-
console.log("[azureResponsesStorageAdapter] Calling getOpenAIClient()");
|
|
9073
9056
|
return [
|
|
9074
9057
|
4,
|
|
9075
9058
|
aiProjectClient.getOpenAIClient(apiVersion ? {
|
|
@@ -9078,16 +9061,12 @@ var azureResponsesStorageAdapter = function() {
|
|
|
9078
9061
|
];
|
|
9079
9062
|
case 3:
|
|
9080
9063
|
azureClient1 = _state.sent();
|
|
9081
|
-
console.log("[azureResponsesStorageAdapter] Azure OpenAI client obtained");
|
|
9082
|
-
console.log("[azureResponsesStorageAdapter] Azure client baseURL:", azureClient1.baseURL);
|
|
9083
|
-
console.log("[azureResponsesStorageAdapter] Azure client apiKey:", ((_azureClient_apiKey1 = azureClient1.apiKey) === null || _azureClient_apiKey1 === void 0 ? void 0 : _azureClient_apiKey1.substring(0, 20)) + "...");
|
|
9084
9064
|
cachedClient = azureClient1;
|
|
9085
9065
|
return [
|
|
9086
9066
|
2,
|
|
9087
9067
|
azureClient1
|
|
9088
9068
|
];
|
|
9089
9069
|
case 4:
|
|
9090
|
-
console.log("[azureResponsesStorageAdapter] Not an AIProjectClient, treating as OpenAI client");
|
|
9091
9070
|
cachedClient = aiProjectClient;
|
|
9092
9071
|
return [
|
|
9093
9072
|
2,
|
|
@@ -9162,7 +9141,6 @@ var azureResponsesStorageAdapter = function() {
|
|
|
9162
9141
|
return _ts_generator(this, function(_state) {
|
|
9163
9142
|
switch(_state.label){
|
|
9164
9143
|
case 0:
|
|
9165
|
-
console.log("[azureResponsesStorageAdapter] Handler called for:", urlString);
|
|
9166
9144
|
return [
|
|
9167
9145
|
4,
|
|
9168
9146
|
getAzureClient()
|