@datenkraft/bb-fulfillment-api-ts-client
Version:
The fulfillment API TS Client enables you to work with the fulfillment API
28 lines (27 loc) • 1.67 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FulfillmentApiClient = void 0;
const bb_base_api_ts_client_1 = require("@datenkraft/bb-base-api-ts-client");
const Generated_1 = require("./Generated");
var FulfillmentApiClient;
(function (FulfillmentApiClient) {
function getApiConfig(configOption, endpointUrl = null) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
return new Generated_1.Configuration({
basePath: (_a = endpointUrl !== null && endpointUrl !== void 0 ? endpointUrl : process.env.X_DATENKRAFT_FULFILLMENT_API_URL) !== null && _a !== void 0 ? _a : "",
accessToken: yield new bb_base_api_ts_client_1.Auth(new bb_base_api_ts_client_1.Config(configOption)).getAccessToken(),
});
});
}
FulfillmentApiClient.getApiConfig = getApiConfig;
})(FulfillmentApiClient = exports.FulfillmentApiClient || (exports.FulfillmentApiClient = {}));