backend v4 half
This commit is contained in:
+6
-2
@@ -89,6 +89,9 @@ var createConfigValueProvider = /* @__PURE__ */ __name((configKey, canonicalEndp
|
||||
}
|
||||
if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") {
|
||||
return async () => {
|
||||
if (config.isCustomEndpoint === false) {
|
||||
return void 0;
|
||||
}
|
||||
const endpoint = await configProvider();
|
||||
if (endpoint && typeof endpoint === "object") {
|
||||
if ("url" in endpoint) {
|
||||
@@ -122,7 +125,7 @@ var toEndpointV1 = /* @__PURE__ */ __name((endpoint) => {
|
||||
|
||||
// src/adaptors/getEndpointFromInstructions.ts
|
||||
var getEndpointFromInstructions = /* @__PURE__ */ __name(async (commandInput, instructionsSupplier, clientConfig, context) => {
|
||||
if (!clientConfig.endpoint) {
|
||||
if (!clientConfig.isCustomEndpoint) {
|
||||
let endpointFromConfig;
|
||||
if (clientConfig.serviceConfiguredEndpoint) {
|
||||
endpointFromConfig = await clientConfig.serviceConfiguredEndpoint();
|
||||
@@ -131,6 +134,7 @@ var getEndpointFromInstructions = /* @__PURE__ */ __name(async (commandInput, in
|
||||
}
|
||||
if (endpointFromConfig) {
|
||||
clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig));
|
||||
clientConfig.isCustomEndpoint = true;
|
||||
}
|
||||
}
|
||||
const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig);
|
||||
@@ -179,7 +183,7 @@ var endpointMiddleware = /* @__PURE__ */ __name(({
|
||||
instructions
|
||||
}) => {
|
||||
return (next, context) => async (args) => {
|
||||
if (config.endpoint) {
|
||||
if (config.isCustomEndpoint) {
|
||||
(0, import_core.setFeature)(context, "ENDPOINT_OVERRIDE", "N");
|
||||
}
|
||||
const endpoint = await getEndpointFromInstructions(
|
||||
|
||||
Reference in New Issue
Block a user