@c8y/client
Version:
Client application programming interface to access the Cumulocity IoT-Platform REST services.
52 lines • 1.42 kB
JavaScript
import { __awaiter } from "tslib";
import { Service } from '../core';
/**
* This class allows reading a feature toggles for current tenant.
*/
export class FeatureService extends Service {
constructor() {
super(...arguments);
this.baseUrl = '';
this.listUrl = 'features';
}
/**
* Retrieve list of feature toggles with values for current tenant.
*
* **Example**
* ```typescript
*
* (async () => {
* const {data, res} = await featureService.list();
* })();
* ```
*/
list() {
const _super = Object.create(null, {
list: { get: () => super.list }
});
return __awaiter(this, void 0, void 0, function* () {
return _super.list.call(this);
});
}
/**
* Retrieve a specific feature toggle with value for current tenant.
*
* **Example**
* ```typescript
*
* (async () => {
* const featureToggleKey = 'my-custom-feature';
* const {data, res} = await featureService.detail(featureToggleKey);
* })();
* ```
*/
detail(key) {
const _super = Object.create(null, {
detail: { get: () => super.detail }
});
return __awaiter(this, void 0, void 0, function* () {
return _super.detail.call(this, key);
});
}
}
//# sourceMappingURL=FeatureService.js.map