@canonical/jujulib
Version:
Juju API client
58 lines (57 loc) • 1.55 kB
JavaScript
/**
Juju CharmHub version 1.
This facade is available on:
Controller-machine-agent
Machine-agent
Unit-agent
Models
NOTE: This file was generated using the Juju schema
from Juju 3.0-beta1 at the git SHA 61c87ab7e1.
Do not manually edit this file.
*/
import { autoBind } from "../../utils.js";
/**
CharmHubAPI API provides the CharmHub API facade for version 1.
*/
class CharmHubV1 {
constructor(transport, info) {
this.NAME = "CharmHub";
this.VERSION = 1;
this._transport = transport;
this._info = info;
// Automatically bind all methods to instances.
autoBind(this);
}
/**
Find queries the CharmHub API with a given entity ID.
*/
find(params) {
return new Promise((resolve, reject) => {
const req = {
type: "CharmHub",
request: "Find",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Info queries the CharmHub API with a given entity ID.
*/
info(params) {
return new Promise((resolve, reject) => {
const req = {
type: "CharmHub",
request: "Info",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
CharmHubV1.NAME = "CharmHub";
CharmHubV1.VERSION = 1;
export default CharmHubV1;
//# sourceMappingURL=CharmHubV1.js.map