UNPKG

connect-sdk-nodejs

Version:

SDK to communicate with the Worldline Global Collect platform using the Worldline Connect Server API

28 lines 1.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.assertSuccess = exports.obfuscate = exports.webhooks = exports.init = void 0; const model_1 = require("./model"); const context_1 = require("./utils/context"); const obfuscate_1 = require("./utils/obfuscate"); const client_1 = require("./client"); const wh = require("./webhooks"); function init(configuration) { const sdkContext = (0, context_1.newSdkContext)(configuration); return (0, client_1.newClient)(sdkContext); } exports.init = init; exports.webhooks = Object.assign({}, wh); exports.obfuscate = { all: obfuscate_1.all, allButLast: obfuscate_1.allButLast, allButFirst: obfuscate_1.allButFirst, withFixedLength: obfuscate_1.withFixedLength }; function assertSuccess(response) { if (response.isSuccess) { return response; } throw new model_1.SdkApiError("the Worldline Global Collect platform returned an error response", response.status, response.body); } exports.assertSuccess = assertSuccess; //# sourceMappingURL=index.js.map