@shipengine/connect
Version:
The official developer tooling for building ShipEngine connect apps
47 lines • 1.34 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class Configuration {
client;
constructor(apiClient) {
this.client = apiClient;
}
async list(appId) {
try {
const response = await this.client.call({
endpoint: `apps/${appId}/configuration/keys`,
method: 'GET',
});
return response;
}
catch (error) {
return Promise.reject(error.response.data);
}
}
async set(appId, configurationKey) {
try {
const response = await this.client.call({
endpoint: `apps/${appId}/configuration/keys`,
method: 'PUT',
body: configurationKey,
});
return response;
}
catch (error) {
return Promise.reject(error.response.data);
}
}
async unset(appId, name) {
try {
const response = await this.client.call({
endpoint: `apps/${appId}/configuration/keys/${name}`,
method: 'DELETE',
});
return response;
}
catch (error) {
return Promise.reject(error.response.data);
}
}
}
exports.default = Configuration;
//# sourceMappingURL=configuration.js.map