@accounter-toolkit/green-invoice-graphql
Version:
Graphql proxy for Green Invoice API
23 lines (22 loc) • 782 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.init = void 0;
const tslib_1 = require("tslib");
const index_js_1 = require("./mesh-artifacts/index.js");
const init = async (id, secret) => {
const authParams = {
id,
secret,
};
const greenInvoiceToken = await fetch('https://api.greeninvoice.co.il/api/v1/account/token', {
method: 'POST',
body: JSON.stringify(authParams),
headers: { 'Content-Type': 'application/json' },
})
.then(res => res.json())
.then((res) => res.token);
const sdk = await (0, index_js_1.getMeshSDK)({ authToken: greenInvoiceToken });
return { sdk };
};
exports.init = init;
tslib_1.__exportStar(require("./mesh-artifacts/index.js"), exports);