UNPKG

@bunnyapp/api-client

Version:
71 lines 1.56 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = getTenantByCode; const query = `query tenant ($code: String!) { tenant (code: $code) { id code name subdomain account { accountTypeId addressValidated annualRevenue billingCity billingContactId billingCountry billingDay billingState billingStreet billingZip code createdAt currencyId description duns employees entityUseCode fax groupId id industryId name netPaymentDays ownerUserId phone shippingCity shippingCountry shippingState shippingStreet shippingZip taxNumber timezone updatedAt website } latestProvisioningChange { change createdAt features id updatedAt } } }`; /** * Fetches tenant information by code * @param {string} code - Unique code for the tenant * @returns {Promise<NonNullable<Query['tenant']>>} Tenant object */ async function getTenantByCode(code) { var _a; const variables = { code, }; const res = await this.query(query, variables); if (res === null || res === void 0 ? void 0 : res.errors) { throw new Error(res.errors.map((e) => e.message).join()); } return (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.tenant; } //# sourceMappingURL=tenant-by-code.js.map