@datenkraft/bb-fulfillment-shopify-service-ts-client
Version:
The fulfillment-shopify-service API TS Client enables you to work with the fulfillment-shopify-service API
28 lines (27 loc) • 1.76 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.FulfillmentShopifyServiceClient = void 0;
const bb_base_api_ts_client_1 = require("@datenkraft/bb-base-api-ts-client");
const Generated_1 = require("./Generated");
var FulfillmentShopifyServiceClient;
(function (FulfillmentShopifyServiceClient) {
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_SHOPIFY_SERVICE_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(),
});
});
}
FulfillmentShopifyServiceClient.getApiConfig = getApiConfig;
})(FulfillmentShopifyServiceClient = exports.FulfillmentShopifyServiceClient || (exports.FulfillmentShopifyServiceClient = {}));