UNPKG

@doczilla/node

Version:
640 lines (618 loc) 22 kB
var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); var __async = (__this, __arguments, generator) => { return new Promise((resolve, reject) => { var fulfilled = (value) => { try { step(generator.next(value)); } catch (e) { reject(e); } }; var rejected = (value) => { try { step(generator.throw(value)); } catch (e) { reject(e); } }; var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); step((generator = generator.apply(__this, __arguments)).next()); }); }; // src/Doczilla.ts import axios from "axios"; // package.json var version = "1.2.0"; // src/services/BaseService.ts import { AxiosHeaders, isAxiosError } from "axios"; var BaseService = class { constructor(client) { this.client = client; this.rateLimit = { limit: 60, remaining: 30, resetIn: 0 }; this.rateLimitHeaders = { limit: "x-ratelimit-limit", reset: "x-ratelimit-reset", remaining: "x-ratelimit-remaining" }; } request(_0, _1, _2) { return __async(this, arguments, function* (method, url, requestBody, config = {}, retries = 1) { try { yield this.waitForRateLimit(); const axiosResponse = yield this.client.request(__spreadValues({ method, url, data: requestBody ? this.encodeRequestBody(requestBody) : void 0 }, config)); this.processRateLimit(new AxiosHeaders(axiosResponse.headers)); if (config.responseType === "arraybuffer") { return Buffer.from(axiosResponse.data); } return axiosResponse.data; } catch (err) { if (isAxiosError(err) && err.status === 429 && retries > 0) { return this.request(method, url, requestBody, config, retries - 1); } throw err; } }); } encodeRequestBody(requestBody) { var _a, _b; if (this.isGenerateRequest(requestBody)) { if (requestBody.page.html) { requestBody.page.html = this.baseEncodeContent(requestBody.page.html); } if (requestBody.page.htmlTemplate) { requestBody.page.htmlTemplate = this.baseEncodeContent(requestBody.page.htmlTemplate); } } if (this.isPdfRequest(requestBody)) { if ((_a = requestBody.pdf) == null ? void 0 : _a.headerHtml) { requestBody.pdf.headerHtml = this.baseEncodeContent(requestBody.pdf.headerHtml); } if ((_b = requestBody.pdf) == null ? void 0 : _b.footerHtml) { requestBody.pdf.footerHtml = this.baseEncodeContent(requestBody.pdf.footerHtml); } } return requestBody; } waitForRateLimit() { return __async(this, null, function* () { if (this.rateLimit.remaining - 1 <= 0) { yield new Promise((resolve) => { setTimeout(() => { resolve(); }, this.rateLimit.resetIn + 100); }); } }); } processRateLimit(headers) { this.rateLimit = { limit: parseInt(`${headers.get(this.rateLimitHeaders.limit)}`, 10) || this.rateLimit.limit, remaining: parseInt(`${headers.get(this.rateLimitHeaders.remaining)}`, 10) || this.rateLimit.remaining, resetIn: parseInt(`${headers.get(this.rateLimitHeaders.reset)}`, 10) * 1e3 // seconds to milliseconds }; } baseEncodeContent(content) { return Buffer.from(content).toString("base64"); } isPdfRequest(requestBody) { return requestBody && "pdf" in requestBody; } isGenerateRequest(requestBody) { return requestBody && "page" in requestBody; } }; // src/services/PdfService.ts var PdfService = class extends BaseService { /** * Create a PDF and directly return the result. * @param requestBody * @returns Buffer * @throws AxiosError */ direct(requestBody) { return this.request("POST", "/v1/pdf", requestBody, { responseType: "arraybuffer" }); } /** * Create a PDF and write the result directly in your bucket. * @param requestBody * @returns SyncJob * @throws AxiosError */ sync(requestBody) { return __async(this, null, function* () { return this.request("POST", "/v1/pdf/sync", requestBody); }); } /** * Queue the creation of a PDF and call the webhook with the result. * @param requestBody * @returns AsyncJob * @throws AxiosError */ async(requestBody) { return this.request("POST", "/v1/pdf/async", requestBody); } }; // src/services/ScreenshotService.ts var ScreenshotService = class extends BaseService { /** * Create a screenshot and directly return the result. * @param requestBody * @returns binary * @throws AxiosError */ direct(requestBody) { return this.request("POST", "/v1/screenshot", requestBody, { responseType: "arraybuffer" }); } /** * Create a screenshot and write the result directly in your bucket. * @param requestBody * @returns SyncJob * @throws AxiosError */ sync(requestBody) { return this.request("POST", "/v1/screenshot/sync", requestBody); } /** * Queue the creation of a screenshot and call the webhook with the result. * @param requestBody * @returns AsyncJob * @throws AxiosError */ async(requestBody) { return this.request("POST", "/v1/screenshot/async", requestBody); } }; // src/services/TemplateService.ts var TemplateService = class extends BaseService { /** * Create the template and directly return the raw result. * @param id * @param requestBody * @returns Buffer * @throws AxiosError */ direct(id, requestBody) { return this.request("POST", `/v1/template/${id}`, requestBody, { responseType: "arraybuffer" }); } /** * Create the template and write the result directly in your bucket. * @param id * @param requestBody * @returns SyncJob * @throws AxiosError */ sync(id, requestBody) { return __async(this, null, function* () { return this.request("POST", `/v1/template/${id}/sync`, requestBody); }); } /** * Queue the creation of the template and call the webhook with the result. * @param id * @param requestBody * @returns AsyncJob * @throws AxiosError */ async(id, requestBody) { return this.request("POST", `/v1/template/${id}/async`, requestBody); } /** * List all available templates. * @param params * @returns ListTemplateResponse * @throws AxiosError */ list(params = {}) { return this.request("GET", "/v1/templates", void 0, { params }); } /** * Creates a new template with the provided request body. * @param requestBody * @returns Template * @throws AxiosError */ create(requestBody) { return this.request("POST", "/v1/templates", __spreadProps(__spreadValues({}, requestBody), { variables: this.encodeRequestBody(requestBody.variables) })); } /** * Get one template. * @param id * @returns Template * @throws AxiosError */ get(id) { return this.request("GET", `/v1/templates/${id}`); } /** * Update one template. * @param id * @param requestBody * @throws AxiosError */ update(id, requestBody) { return this.request("POST", `/v1/templates/${id}`, __spreadValues(__spreadValues({}, requestBody), requestBody.variables && { variables: this.encodeRequestBody(requestBody.variables) })); } /** * Delete one template. * @param id * @throws AxiosError */ delete(id) { return this.request("DELETE", `/v1/templates/${id}`); } }; // src/services/WebhookService.ts import crypto from "crypto"; var WebhookService = class { verifyPayload(payload, signature, webhookSecret) { const payloadSignature = crypto.createHmac("sha256", webhookSecret).update(payload, "utf8").digest("hex"); if (payloadSignature === signature) { return JSON.parse(payload.toString()); } throw new Error("Signature does not match!"); } }; // src/Doczilla.ts var Doczilla = class { constructor(token, options = {}) { if (!token) { throw new Error("No token provided!"); } this.client = axios.create({ baseURL: options.baseURL || "https://api.doczilla.app", headers: { "User-Agent": `Doczilla Node.js / ${version}`, Authorization: `Bearer ${token}` } }); this.pdf = new PdfService(this.client); this.screenshot = new ScreenshotService(this.client); this.template = new TemplateService(this.client); this.webhook = new WebhookService(); } }; // src/generated/models/AsyncJob.ts var AsyncJob; ((AsyncJob2) => { let status; ((status2) => { status2["PENDING"] = "PENDING"; status2["RUNNING"] = "RUNNING"; status2["FAILED"] = "FAILED"; status2["COMPLETED"] = "COMPLETED"; })(status = AsyncJob2.status || (AsyncJob2.status = {})); })(AsyncJob || (AsyncJob = {})); // src/generated/models/CreateTemplate.ts var CreateTemplate; ((CreateTemplate2) => { let output; ((output2) => { output2["PDF"] = "PDF"; output2["IMAGE"] = "IMAGE"; })(output = CreateTemplate2.output || (CreateTemplate2.output = {})); })(CreateTemplate || (CreateTemplate = {})); // src/generated/models/ListTemplate.ts var ListTemplate; ((ListTemplate2) => { let output; ((output2) => { output2["PDF"] = "PDF"; output2["IMAGE"] = "IMAGE"; })(output = ListTemplate2.output || (ListTemplate2.output = {})); })(ListTemplate || (ListTemplate = {})); // src/generated/models/PageCookie.ts var PageCookie; ((PageCookie2) => { let sameSite; ((sameSite2) => { sameSite2["STRICT"] = "Strict"; sameSite2["LAX"] = "Lax"; sameSite2["NONE"] = "None"; })(sameSite = PageCookie2.sameSite || (PageCookie2.sameSite = {})); })(PageCookie || (PageCookie = {})); // src/generated/models/PageOptions.ts var PageOptions; ((PageOptions2) => { let waitUntil; ((waitUntil2) => { waitUntil2["AUTO"] = "auto"; waitUntil2["LOAD"] = "load"; waitUntil2["DOMCONTENTLOADED"] = "domcontentloaded"; waitUntil2["NETWORKIDLE0"] = "networkidle0"; waitUntil2["NETWORKIDLE2"] = "networkidle2"; })(waitUntil = PageOptions2.waitUntil || (PageOptions2.waitUntil = {})); let mediaType; ((mediaType2) => { mediaType2["SCREEN"] = "screen"; mediaType2["PRINT"] = "print"; })(mediaType = PageOptions2.mediaType || (PageOptions2.mediaType = {})); })(PageOptions || (PageOptions = {})); // src/generated/models/PdfOptions.ts var PdfOptions; ((PdfOptions2) => { let format; ((format2) => { format2["LETTER"] = "letter"; format2["LEGAL"] = "legal"; format2["TABLOID"] = "tabloid"; format2["LEDGER"] = "ledger"; format2["A0"] = "a0"; format2["A1"] = "a1"; format2["A2"] = "a2"; format2["A3"] = "a3"; format2["A4"] = "a4"; format2["A5"] = "a5"; format2["A6"] = "a6"; })(format = PdfOptions2.format || (PdfOptions2.format = {})); })(PdfOptions || (PdfOptions = {})); // src/generated/models/ScreenshotOptions.ts var ScreenshotOptions; ((ScreenshotOptions2) => { let type; ((type2) => { type2["PNG"] = "png"; type2["JPEG"] = "jpeg"; type2["WEBP"] = "webp"; })(type = ScreenshotOptions2.type || (ScreenshotOptions2.type = {})); let device; ((device2) => { device2["BLACKBERRY_PLAY_BOOK"] = "Blackberry PlayBook"; device2["BLACKBERRY_PLAY_BOOK_LANDSCAPE"] = "Blackberry PlayBook landscape"; device2["BLACK_BERRY_Z30"] = "BlackBerry Z30"; device2["BLACK_BERRY_Z30_LANDSCAPE"] = "BlackBerry Z30 landscape"; device2["GALAXY_NOTE_3"] = "Galaxy Note 3"; device2["GALAXY_NOTE_3_LANDSCAPE"] = "Galaxy Note 3 landscape"; device2["GALAXY_NOTE_II"] = "Galaxy Note II"; device2["GALAXY_NOTE_II_LANDSCAPE"] = "Galaxy Note II landscape"; device2["GALAXY_S_III"] = "Galaxy S III"; device2["GALAXY_S_III_LANDSCAPE"] = "Galaxy S III landscape"; device2["GALAXY_S5"] = "Galaxy S5"; device2["GALAXY_S5_LANDSCAPE"] = "Galaxy S5 landscape"; device2["GALAXY_S8"] = "Galaxy S8"; device2["GALAXY_S8_LANDSCAPE"] = "Galaxy S8 landscape"; device2["GALAXY_S9_"] = "Galaxy S9+"; device2["GALAXY_S9_LANDSCAPE"] = "Galaxy S9+ landscape"; device2["GALAXY_TAB_S4"] = "Galaxy Tab S4"; device2["GALAXY_TAB_S4_LANDSCAPE"] = "Galaxy Tab S4 landscape"; device2["I_PAD"] = "iPad"; device2["I_PAD_LANDSCAPE"] = "iPad landscape"; device2["I_PAD_GEN_6_"] = "iPad (gen 6)"; device2["I_PAD_GEN_6_LANDSCAPE"] = "iPad (gen 6) landscape"; device2["I_PAD_GEN_7_"] = "iPad (gen 7)"; device2["I_PAD_GEN_7_LANDSCAPE"] = "iPad (gen 7) landscape"; device2["I_PAD_MINI"] = "iPad Mini"; device2["I_PAD_MINI_LANDSCAPE"] = "iPad Mini landscape"; device2["I_PAD_PRO"] = "iPad Pro"; device2["I_PAD_PRO_LANDSCAPE"] = "iPad Pro landscape"; device2["I_PAD_PRO_11"] = "iPad Pro 11"; device2["I_PAD_PRO_11_LANDSCAPE"] = "iPad Pro 11 landscape"; device2["I_PHONE_4"] = "iPhone 4"; device2["I_PHONE_4_LANDSCAPE"] = "iPhone 4 landscape"; device2["I_PHONE_5"] = "iPhone 5"; device2["I_PHONE_5_LANDSCAPE"] = "iPhone 5 landscape"; device2["I_PHONE_6"] = "iPhone 6"; device2["I_PHONE_6_LANDSCAPE"] = "iPhone 6 landscape"; device2["I_PHONE_6_PLUS"] = "iPhone 6 Plus"; device2["I_PHONE_6_PLUS_LANDSCAPE"] = "iPhone 6 Plus landscape"; device2["I_PHONE_7"] = "iPhone 7"; device2["I_PHONE_7_LANDSCAPE"] = "iPhone 7 landscape"; device2["I_PHONE_7_PLUS"] = "iPhone 7 Plus"; device2["I_PHONE_7_PLUS_LANDSCAPE"] = "iPhone 7 Plus landscape"; device2["I_PHONE_8"] = "iPhone 8"; device2["I_PHONE_8_LANDSCAPE"] = "iPhone 8 landscape"; device2["I_PHONE_8_PLUS"] = "iPhone 8 Plus"; device2["I_PHONE_8_PLUS_LANDSCAPE"] = "iPhone 8 Plus landscape"; device2["I_PHONE_SE"] = "iPhone SE"; device2["I_PHONE_SE_LANDSCAPE"] = "iPhone SE landscape"; device2["I_PHONE_X"] = "iPhone X"; device2["I_PHONE_X_LANDSCAPE"] = "iPhone X landscape"; device2["I_PHONE_XR"] = "iPhone XR"; device2["I_PHONE_XR_LANDSCAPE"] = "iPhone XR landscape"; device2["I_PHONE_11"] = "iPhone 11"; device2["I_PHONE_11_LANDSCAPE"] = "iPhone 11 landscape"; device2["I_PHONE_11_PRO"] = "iPhone 11 Pro"; device2["I_PHONE_11_PRO_LANDSCAPE"] = "iPhone 11 Pro landscape"; device2["I_PHONE_11_PRO_MAX"] = "iPhone 11 Pro Max"; device2["I_PHONE_11_PRO_MAX_LANDSCAPE"] = "iPhone 11 Pro Max landscape"; device2["I_PHONE_12"] = "iPhone 12"; device2["I_PHONE_12_LANDSCAPE"] = "iPhone 12 landscape"; device2["I_PHONE_12_PRO"] = "iPhone 12 Pro"; device2["I_PHONE_12_PRO_LANDSCAPE"] = "iPhone 12 Pro landscape"; device2["I_PHONE_12_PRO_MAX"] = "iPhone 12 Pro Max"; device2["I_PHONE_12_PRO_MAX_LANDSCAPE"] = "iPhone 12 Pro Max landscape"; device2["I_PHONE_12_MINI"] = "iPhone 12 Mini"; device2["I_PHONE_12_MINI_LANDSCAPE"] = "iPhone 12 Mini landscape"; device2["I_PHONE_13"] = "iPhone 13"; device2["I_PHONE_13_LANDSCAPE"] = "iPhone 13 landscape"; device2["I_PHONE_13_PRO"] = "iPhone 13 Pro"; device2["I_PHONE_13_PRO_LANDSCAPE"] = "iPhone 13 Pro landscape"; device2["I_PHONE_13_PRO_MAX"] = "iPhone 13 Pro Max"; device2["I_PHONE_13_PRO_MAX_LANDSCAPE"] = "iPhone 13 Pro Max landscape"; device2["I_PHONE_13_MINI"] = "iPhone 13 Mini"; device2["I_PHONE_13_MINI_LANDSCAPE"] = "iPhone 13 Mini landscape"; device2["I_PHONE_14"] = "iPhone 14"; device2["I_PHONE_14_LANDSCAPE"] = "iPhone 14 landscape"; device2["I_PHONE_14_PLUS"] = "iPhone 14 Plus"; device2["I_PHONE_14_PLUS_LANDSCAPE"] = "iPhone 14 Plus landscape"; device2["I_PHONE_14_PRO"] = "iPhone 14 Pro"; device2["I_PHONE_14_PRO_LANDSCAPE"] = "iPhone 14 Pro landscape"; device2["I_PHONE_14_PRO_MAX"] = "iPhone 14 Pro Max"; device2["I_PHONE_14_PRO_MAX_LANDSCAPE"] = "iPhone 14 Pro Max landscape"; device2["I_PHONE_15"] = "iPhone 15"; device2["I_PHONE_15_LANDSCAPE"] = "iPhone 15 landscape"; device2["I_PHONE_15_PLUS"] = "iPhone 15 Plus"; device2["I_PHONE_15_PLUS_LANDSCAPE"] = "iPhone 15 Plus landscape"; device2["I_PHONE_15_PRO"] = "iPhone 15 Pro"; device2["I_PHONE_15_PRO_LANDSCAPE"] = "iPhone 15 Pro landscape"; device2["I_PHONE_15_PRO_MAX"] = "iPhone 15 Pro Max"; device2["I_PHONE_15_PRO_MAX_LANDSCAPE"] = "iPhone 15 Pro Max landscape"; device2["JIO_PHONE_2"] = "JioPhone 2"; device2["JIO_PHONE_2_LANDSCAPE"] = "JioPhone 2 landscape"; device2["KINDLE_FIRE_HDX"] = "Kindle Fire HDX"; device2["KINDLE_FIRE_HDX_LANDSCAPE"] = "Kindle Fire HDX landscape"; device2["LG_OPTIMUS_L70"] = "LG Optimus L70"; device2["LG_OPTIMUS_L70_LANDSCAPE"] = "LG Optimus L70 landscape"; device2["MICROSOFT_LUMIA_550"] = "Microsoft Lumia 550"; device2["MICROSOFT_LUMIA_950"] = "Microsoft Lumia 950"; device2["MICROSOFT_LUMIA_950_LANDSCAPE"] = "Microsoft Lumia 950 landscape"; device2["NEXUS_10"] = "Nexus 10"; device2["NEXUS_10_LANDSCAPE"] = "Nexus 10 landscape"; device2["NEXUS_4"] = "Nexus 4"; device2["NEXUS_4_LANDSCAPE"] = "Nexus 4 landscape"; device2["NEXUS_5"] = "Nexus 5"; device2["NEXUS_5_LANDSCAPE"] = "Nexus 5 landscape"; device2["NEXUS_5X"] = "Nexus 5X"; device2["NEXUS_5X_LANDSCAPE"] = "Nexus 5X landscape"; device2["NEXUS_6"] = "Nexus 6"; device2["NEXUS_6_LANDSCAPE"] = "Nexus 6 landscape"; device2["NEXUS_6P"] = "Nexus 6P"; device2["NEXUS_6P_LANDSCAPE"] = "Nexus 6P landscape"; device2["NEXUS_7"] = "Nexus 7"; device2["NEXUS_7_LANDSCAPE"] = "Nexus 7 landscape"; device2["NOKIA_LUMIA_520"] = "Nokia Lumia 520"; device2["NOKIA_LUMIA_520_LANDSCAPE"] = "Nokia Lumia 520 landscape"; device2["NOKIA_N9"] = "Nokia N9"; device2["NOKIA_N9_LANDSCAPE"] = "Nokia N9 landscape"; device2["PIXEL_2"] = "Pixel 2"; device2["PIXEL_2_LANDSCAPE"] = "Pixel 2 landscape"; device2["PIXEL_2_XL"] = "Pixel 2 XL"; device2["PIXEL_2_XL_LANDSCAPE"] = "Pixel 2 XL landscape"; device2["PIXEL_3"] = "Pixel 3"; device2["PIXEL_3_LANDSCAPE"] = "Pixel 3 landscape"; device2["PIXEL_4"] = "Pixel 4"; device2["PIXEL_4_LANDSCAPE"] = "Pixel 4 landscape"; device2["PIXEL_4A_5G_"] = "Pixel 4a (5G)"; device2["PIXEL_4A_5G_LANDSCAPE"] = "Pixel 4a (5G) landscape"; device2["PIXEL_5"] = "Pixel 5"; device2["PIXEL_5_LANDSCAPE"] = "Pixel 5 landscape"; device2["MOTO_G4"] = "Moto G4"; device2["MOTO_G4_LANDSCAPE"] = "Moto G4 landscape"; device2["MACBOOK_PRO_13"] = "Macbook Pro 13"; device2["MACBOOK_PRO_15"] = "Macbook Pro 15"; device2["MACBOOK_PRO_16"] = "Macbook Pro 16"; device2["I_MAC_21"] = "iMac 21"; device2["I_MAC_21_4K"] = "iMac 21 4K"; device2["I_MAC_24_4_5K"] = "iMac 24 4.5K"; device2["I_MAC_27"] = "iMac 27"; device2["I_MAC_27_5K"] = "iMac 27 5K"; })(device = ScreenshotOptions2.device || (ScreenshotOptions2.device = {})); })(ScreenshotOptions || (ScreenshotOptions = {})); // src/generated/models/ScreenshotOverlay.ts var ScreenshotOverlay; ((ScreenshotOverlay2) => { let browser; ((browser2) => { browser2["LIGHT"] = "light"; browser2["DARK"] = "dark"; })(browser = ScreenshotOverlay2.browser || (ScreenshotOverlay2.browser = {})); })(ScreenshotOverlay || (ScreenshotOverlay = {})); // src/generated/models/SyncJob.ts var SyncJob; ((SyncJob2) => { let status; ((status2) => { status2["PENDING"] = "PENDING"; status2["RUNNING"] = "RUNNING"; status2["FAILED"] = "FAILED"; status2["COMPLETED"] = "COMPLETED"; })(status = SyncJob2.status || (SyncJob2.status = {})); })(SyncJob || (SyncJob = {})); // src/generated/models/Template.ts var Template; ((Template2) => { let output; ((output2) => { output2["PDF"] = "PDF"; output2["IMAGE"] = "IMAGE"; })(output = Template2.output || (Template2.output = {})); })(Template || (Template = {})); // src/generated/models/UpdateTemplate.ts var UpdateTemplate; ((UpdateTemplate2) => { let output; ((output2) => { output2["PDF"] = "PDF"; output2["IMAGE"] = "IMAGE"; })(output = UpdateTemplate2.output || (UpdateTemplate2.output = {})); })(UpdateTemplate || (UpdateTemplate = {})); // src/generated/models/WebhookEvent.ts var WebhookEvent; ((WebhookEvent2) => { let status; ((status2) => { status2["PENDING"] = "PENDING"; status2["RUNNING"] = "RUNNING"; status2["FAILED"] = "FAILED"; status2["COMPLETED"] = "COMPLETED"; })(status = WebhookEvent2.status || (WebhookEvent2.status = {})); })(WebhookEvent || (WebhookEvent = {})); // src/generated/models/WebhookOptions.ts var WebhookOptions; ((WebhookOptions2) => { let receiveType; ((receiveType2) => { receiveType2["BASE64"] = "base64"; receiveType2["URL"] = "URL"; })(receiveType = WebhookOptions2.receiveType || (WebhookOptions2.receiveType = {})); let method; ((method2) => { method2["POST"] = "POST"; method2["PUT"] = "PUT"; })(method = WebhookOptions2.method || (WebhookOptions2.method = {})); })(WebhookOptions || (WebhookOptions = {})); export { AsyncJob, CreateTemplate, ListTemplate, PageCookie, PageOptions, PdfOptions, ScreenshotOptions, ScreenshotOverlay, SyncJob, Template, UpdateTemplate, WebhookEvent, WebhookOptions, Doczilla as default };