UNPKG

@gooddata/api-client-bear

Version:
56 lines 1.36 kB
// (C) 2023 GoodData Corporation import isEmpty from "lodash/isEmpty.js"; export function decoratedSdk(sdk, decorators) { if (isEmpty(decorators)) { return sdk; } return new SDKWithDecoratedModules(sdk, decorators); } class SDKWithDecoratedModules { sdk; config; xhr; user; md; mdExt; execution; project; report; dashboard; catalogue; ldm; configStorage; organization; utils; constructor(sdk, decorators) { this.sdk = sdk; this.configStorage = sdk.configStorage; this.config = sdk.config; this.xhr = sdk.xhr; if (decorators.user) { this.user = decorators.user(sdk.user); } else { this.user = sdk.user; } this.md = sdk.md; this.mdExt = sdk.mdExt; this.execution = sdk.execution; if (decorators.project) { this.project = decorators.project(sdk.project); } else { this.project = sdk.project; } this.report = sdk.report; this.dashboard = sdk.dashboard; this.catalogue = sdk.catalogue; this.ldm = sdk.ldm; this.organization = sdk.organization; this.utils = sdk.utils; } clone() { return this.sdk.clone(); } } //# sourceMappingURL=index.js.map