Files
zCode-CLI-X/~/.npm-cache/@aws-sdk/credential-provider-http@3.972.26@@@1/dist-es/fromHttp/fromHttp.browser.js
admin 875c7f9b91 feat: Complete zCode CLI X with Telegram bot integration
- Add full Telegram bot functionality with Z.AI API integration
- Implement 4 tools: Bash, FileEdit, WebSearch, Git
- Add 3 agents: Code Reviewer, Architect, DevOps Engineer
- Add 6 skills for common coding tasks
- Add systemd service file for 24/7 operation
- Add nginx configuration for HTTPS webhook
- Add comprehensive documentation
- Implement WebSocket server for real-time updates
- Add logging system with Winston
- Add environment validation

🤖 zCode CLI X - Agentic coder with Z.AI + Telegram integration
2026-05-05 09:01:26 +00:00

28 lines
1.1 KiB
JavaScript

import { FetchHttpHandler } from "@smithy/fetch-http-handler";
import { CredentialsProviderError } from "@smithy/property-provider";
import { checkUrl } from "./checkUrl";
import { createGetRequest, getCredentials } from "./requestHelpers";
import { retryWrapper } from "./retry-wrapper";
export const fromHttp = (options = {}) => {
options.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");
let host;
const full = options.credentialsFullUri;
if (full) {
host = full;
}
else {
throw new CredentialsProviderError("No HTTP credential provider host provided.", { logger: options.logger });
}
const url = new URL(host);
checkUrl(url, options.logger);
const requestHandler = new FetchHttpHandler();
return retryWrapper(async () => {
const request = createGetRequest(url);
if (options.authorizationToken) {
request.headers.Authorization = options.authorizationToken;
}
const result = await requestHandler.handle(request);
return getCredentials(result.response);
}, options.maxRetries ?? 3, options.timeout ?? 1000);
};