adk-typescript
Version:
TypeScript port of Google's Agent Development Kit (ADK)
72 lines (71 loc) • 1.67 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BasicCredential = exports.BearerCredential = exports.ApiKeyCredential = void 0;
/**
* API key credential implementation
*/
class ApiKeyCredential {
/**
* Initialize the API key credential
* @param apiKey The API key value
*/
constructor(apiKey) {
this.type = 'apiKey';
this.apiKey = apiKey;
}
/**
* Get the API key value
* @returns The API key
*/
getValue() {
return this.apiKey;
}
}
exports.ApiKeyCredential = ApiKeyCredential;
/**
* Bearer token credential implementation
*/
class BearerCredential {
/**
* Initialize the bearer token credential
* @param token The bearer token value
*/
constructor(token) {
this.type = 'bearer';
this.token = token;
}
/**
* Get the bearer token value
* @returns The bearer token
*/
getValue() {
return this.token;
}
}
exports.BearerCredential = BearerCredential;
/**
* Basic auth credential implementation
*/
class BasicCredential {
/**
* Initialize the basic auth credential
* @param username The username
* @param password The password
*/
constructor(username, password) {
this.type = 'basic';
this.username = username;
this.password = password;
}
/**
* Get the basic auth credentials
* @returns An object containing the username and password
*/
getValue() {
return {
username: this.username,
password: this.password
};
}
}
exports.BasicCredential = BasicCredential;