@unifetch/fortnox 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-fortnox-BRQXlzrc.cjs","names":[],"sources":["../src/request.ts","../src/types/resource-operations.gen.ts","../src/create-fortnox.ts"],"sourcesContent":["export const METHODS = [\"get\", \"post\", \"put\", \"delete\", \"patch\"] as const;\r\n\r\ntype RequestMethod = (typeof METHODS)[number];\r\n\r\ntype RequestOptions = {\r\n\tpath: string;\r\n\tmethod: RequestMethod;\r\n\tquery?: Record<string, unknown>;\r\n\tparams?: Record<string, unknown>;\r\n\tbody?: unknown;\r\n};\r\n\r\ntype FortnoxErrorResponse = {\r\n\tErrorInformation: {\r\n\t\terror: number;\r\n\t\tmessage: string;\r\n\t\tcode: number;\r\n\t};\r\n};\r\n\r\nexport type ErrorResponse = {\r\n\tErrorSource: \"fortnox\" | \"unknown\";\r\n\tErrorInformation: {\r\n\t\terror: number;\r\n\t\tmessage: string;\r\n\t\tcode: number;\r\n\t};\r\n};\r\n\r\nexport type InitFortnoxOptions =\r\n\t| { accessToken: string }\r\n\t| { proxy: { baseUrl: string; apiKey: string; tenantId: string } };\r\n\r\nexport async function request(\r\n\treqOptions: RequestOptions,\r\n\tinitOptions: InitFortnoxOptions,\r\n) {\r\n\ttry {\r\n\t\tlet headers: Record<string, string>;\r\n\t\tlet baseUrl: string;\r\n\r\n\t\tif (\"accessToken\" in initOptions) {\r\n\t\t\theaders = {\r\n\t\t\t\tAuthorization: `Bearer ${initOptions.accessToken}`,\r\n\t\t\t};\r\n\t\t\tbaseUrl = \"https://api.fortnox.se\";\r\n\t\t} else {\r\n\t\t\theaders = {\r\n\t\t\t\t\"x-api-key\": initOptions.proxy.apiKey,\r\n\t\t\t\t\"x-tenant-id\": initOptions.proxy.tenantId,\r\n\t\t\t};\r\n\t\t\tbaseUrl = initOptions.proxy.baseUrl;\r\n\t\t}\r\n\r\n\t\tconst searchParams = new URLSearchParams();\r\n\t\tif (reqOptions.query) {\r\n\t\t\tObject.entries(reqOptions.query).forEach(([key, value]) => {\r\n\t\t\t\tsearchParams.append(key, String(value));\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tlet path = reqOptions.path;\r\n\t\tif (reqOptions.params) {\r\n\t\t\tObject.entries(reqOptions.params).forEach(([key, value]) => {\r\n\t\t\t\tpath = path.replace(`{${key}}`, encodeURIComponent(String(value)));\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tconst url = `${baseUrl}${path}${searchParams.size > 0 ? `?${searchParams.toString()}` : \"\"}`;\r\n\r\n\t\tconst response = await fetch(url, {\r\n\t\t\tmethod: reqOptions.method.toUpperCase(),\r\n\t\t\tbody: reqOptions.body ? JSON.stringify(reqOptions.body) : null,\r\n\t\t\theaders,\r\n\t\t});\r\n\r\n\t\tconst responseData = await response.json();\r\n\r\n\t\tif (response.status < 300) {\r\n\t\t\treturn { error: null, data: responseData };\r\n\t\t} else {\r\n\t\t\treturn {\r\n\t\t\t\terror: {\r\n\t\t\t\t\tErrorSource: \"fortnox\" as const,\r\n\t\t\t\t\tErrorInformation: (responseData as FortnoxErrorResponse)\r\n\t\t\t\t\t\t.ErrorInformation,\r\n\t\t\t\t} satisfies ErrorResponse,\r\n\t\t\t\tdata: null,\r\n\t\t\t};\r\n\t\t}\r\n\t} catch (e: unknown) {\r\n\t\treturn {\r\n\t\t\terror: {\r\n\t\t\t\tErrorSource: \"unknown\" as const,\r\n\t\t\t\tErrorInformation: {\r\n\t\t\t\t\tmessage: e instanceof Error ? e.message : String(e),\r\n\t\t\t\t\terror: -1,\r\n\t\t\t\t\tcode: -1,\r\n\t\t\t\t},\r\n\t\t\t} satisfies ErrorResponse,\r\n\t\t\tdata: null,\r\n\t\t};\r\n\t}\r\n}\r\n","// This file is auto-generated. Do not edit manually.\n// Run scripts/generate.ts to regenerate.\n\nexport const RESOURCE_OPERATIONS = {\n \"absencetransactions\": {\n \"getList\": { path: \"/3/absencetransactions\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/absencetransactions\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/absencetransactions/{id}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/absencetransactions/{id}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/absencetransactions/{id}\" as const, method: \"delete\" as const },\n \"listByEmployeeDateCode\": { path: \"/3/absencetransactions/{id}/{Date}/{Code}\" as const, method: \"get\" as const },\n },\n \"accountcharts\": {\n \"getList\": { path: \"/3/accountcharts\" as const, method: \"get\" as const },\n },\n \"accounts\": {\n \"getList\": { path: \"/3/accounts\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/accounts\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/accounts/{Number}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/accounts/{Number}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/accounts/{Number}\" as const, method: \"delete\" as const },\n },\n \"archive\": {\n \"getByPath\": { path: \"/3/archive\" as const, method: \"get\" as const },\n \"upload\": { path: \"/3/archive\" as const, method: \"post\" as const },\n \"deleteByPath\": { path: \"/3/archive\" as const, method: \"delete\" as const },\n \"getById\": { path: \"/3/archive/{id}\" as const, method: \"get\" as const },\n \"deleteById\": { path: \"/3/archive/{id}\" as const, method: \"delete\" as const },\n },\n \"articlefileconnections\": {\n \"getList\": { path: \"/3/articlefileconnections\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/articlefileconnections\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/articlefileconnections/{FileId}\" as const, method: \"get\" as const },\n \"delete\": { path: \"/3/articlefileconnections/{FileId}\" as const, method: \"delete\" as const },\n },\n \"articles\": {\n \"getList\": { path: \"/3/articles\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/articles\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/articles/{ArticleNumber}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/articles/{ArticleNumber}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/articles/{ArticleNumber}\" as const, method: \"delete\" as const },\n },\n \"articleurlconnections\": {\n \"getList\": { path: \"/3/articleurlconnections\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/articleurlconnections\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/articleurlconnections/{id}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/articleurlconnections/{id}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/articleurlconnections/{id}\" as const, method: \"delete\" as const },\n },\n \"assetfileconnections\": {\n \"getList\": { path: \"/3/assetfileconnections\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/assetfileconnections\" as const, method: \"post\" as const },\n \"delete\": { path: \"/3/assetfileconnections/{FileId}\" as const, method: \"delete\" as const },\n },\n \"assets\": {\n \"getList\": { path: \"/3/assets\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/assets\" as const, method: \"post\" as const },\n \"changeOb\": { path: \"/3/assets/changeob/{Id}\" as const, method: \"put\" as const },\n \"depreciate\": { path: \"/3/assets/depreciate\" as const, method: \"post\" as const },\n \"listDepreciations\": { path: \"/3/assets/depreciations/{ToDate}\" as const, method: \"get\" as const },\n \"scrap\": { path: \"/3/assets/scrap/{Id}\" as const, method: \"put\" as const },\n \"sell\": { path: \"/3/assets/sell/{Id}\" as const, method: \"put\" as const },\n \"listTypes\": { path: \"/3/assets/types\" as const, method: \"get\" as const },\n \"createType\": { path: \"/3/assets/types\" as const, method: \"post\" as const },\n \"getType\": { path: \"/3/assets/types/{id}\" as const, method: \"get\" as const },\n \"updateType\": { path: \"/3/assets/types/{id}\" as const, method: \"put\" as const },\n \"deleteType\": { path: \"/3/assets/types/{id}\" as const, method: \"delete\" as const },\n \"writeDown\": { path: \"/3/assets/writedown/{Id}\" as const, method: \"put\" as const },\n \"writeUp\": { path: \"/3/assets/writeup/{Id}\" as const, method: \"put\" as const },\n \"get\": { path: \"/3/assets/{Id}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/assets/{Id}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/assets/{Id}\" as const, method: \"delete\" as const },\n },\n \"attendancetransactions\": {\n \"getList\": { path: \"/3/attendancetransactions\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/attendancetransactions\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/attendancetransactions/{id}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/attendancetransactions/{id}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/attendancetransactions/{id}\" as const, method: \"delete\" as const },\n \"listByEmployeeDateCode\": { path: \"/3/attendancetransactions/{id}/{Date}/{Code}\" as const, method: \"get\" as const },\n },\n \"companyinformation\": {\n \"get\": { path: \"/3/companyinformation\" as const, method: \"get\" as const },\n },\n \"contractaccruals\": {\n \"getList\": { path: \"/3/contractaccruals\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/contractaccruals\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/contractaccruals/{DocumentNumber}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/contractaccruals/{DocumentNumber}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/contractaccruals/{DocumentNumber}\" as const, method: \"delete\" as const },\n },\n \"contracts\": {\n \"getList\": { path: \"/3/contracts\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/contracts\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/contracts/{DocumentNumber}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/contracts/{DocumentNumber}\" as const, method: \"put\" as const },\n \"createInvoice\": { path: \"/3/contracts/{DocumentNumber}/createinvoice\" as const, method: \"put\" as const },\n \"finish\": { path: \"/3/contracts/{DocumentNumber}/finish\" as const, method: \"put\" as const },\n \"increaseInvoiceCount\": { path: \"/3/contracts/{DocumentNumber}/increaseinvoicecount\" as const, method: \"put\" as const },\n },\n \"contracttemplates\": {\n \"getList\": { path: \"/3/contracttemplates\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/contracttemplates\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/contracttemplates/{TemplateNumber}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/contracttemplates/{TemplateNumber}\" as const, method: \"put\" as const },\n },\n \"costcenters\": {\n \"getList\": { path: \"/3/costcenters\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/costcenters\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/costcenters/{Code}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/costcenters/{Code}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/costcenters/{Code}\" as const, method: \"delete\" as const },\n },\n \"currencies\": {\n \"getList\": { path: \"/3/currencies\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/currencies\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/currencies/{Code}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/currencies/{Code}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/currencies/{Code}\" as const, method: \"delete\" as const },\n },\n \"customerreferences\": {\n \"getList\": { path: \"/3/customerreferences\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/customerreferences\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/customerreferences/{CustomerReferenceRowId}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/customerreferences/{CustomerReferenceRowId}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/customerreferences/{CustomerReferenceRowId}\" as const, method: \"delete\" as const },\n },\n \"customers\": {\n \"getList\": { path: \"/3/customers\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/customers\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/customers/{CustomerNumber}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/customers/{CustomerNumber}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/customers/{CustomerNumber}\" as const, method: \"delete\" as const },\n },\n \"emailsenders\": {\n \"getList\": { path: \"/3/emailsenders\" as const, method: \"get\" as const },\n \"addTrusted\": { path: \"/3/emailsenders/trusted\" as const, method: \"post\" as const },\n \"removeTrusted\": { path: \"/3/emailsenders/trusted/{Id}\" as const, method: \"delete\" as const },\n },\n \"employees\": {\n \"getList\": { path: \"/3/employees\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/employees\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/employees/{EmployeeId}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/employees/{EmployeeId}\" as const, method: \"put\" as const },\n },\n \"euvatlimitregulation\": {\n \"get\": { path: \"/3/euvatlimitregulation\" as const, method: \"get\" as const },\n },\n \"expenses\": {\n \"getList\": { path: \"/3/expenses\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/expenses\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/expenses/{ExpenseCode}\" as const, method: \"get\" as const },\n },\n \"fileattachments\": {\n \"getList\": { path: \"/api/fileattachments/attachments-v1\" as const, method: \"get\" as const },\n \"attach\": { path: \"/api/fileattachments/attachments-v1\" as const, method: \"post\" as const },\n \"getNumberOfAttachments\": { path: \"/api/fileattachments/attachments-v1/numberofattachments\" as const, method: \"get\" as const },\n \"validateIncludedOnSend\": { path: \"/api/fileattachments/attachments-v1/validateincludedonsend\" as const, method: \"post\" as const },\n \"update\": { path: \"/api/fileattachments/attachments-v1/{attachmentId}\" as const, method: \"put\" as const },\n \"detach\": { path: \"/api/fileattachments/attachments-v1/{attachmentId}\" as const, method: \"delete\" as const },\n },\n \"financialyears\": {\n \"getList\": { path: \"/3/financialyears\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/financialyears\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/financialyears/{Id}\" as const, method: \"get\" as const },\n },\n \"inbox\": {\n \"getList\": { path: \"/3/inbox\" as const, method: \"get\" as const },\n \"upload\": { path: \"/3/inbox\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/inbox/{Id}\" as const, method: \"get\" as const },\n \"delete\": { path: \"/3/inbox/{Id}\" as const, method: \"delete\" as const },\n },\n \"integrationDeveloper\": {\n \"listRatings\": { path: \"/api/integration-developer/ratings-v1\" as const, method: \"get\" as const },\n \"getSalesForIntegration\": { path: \"/api/integration-developer/sales-v1/{integrationId}\" as const, method: \"get\" as const },\n \"getUsersForIntegrationAndTenant\": { path: \"/api/integration-developer/users/users-v1/{integrationId}/{tenantId}\" as const, method: \"get\" as const },\n },\n \"integrationPartner\": {\n \"getSalesForApp\": { path: \"/api/integration-partner/apps/sales-v1/{appId}\" as const, method: \"get\" as const },\n \"getSalesForAppAndTenant\": { path: \"/api/integration-partner/apps/sales-v1/{appId}/{tenantId}\" as const, method: \"get\" as const },\n },\n \"invoiceaccruals\": {\n \"getList\": { path: \"/3/invoiceaccruals\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/invoiceaccruals\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/invoiceaccruals/{InvoiceNumber}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/invoiceaccruals/{InvoiceNumber}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/invoiceaccruals/{InvoiceNumber}\" as const, method: \"delete\" as const },\n },\n \"invoicepayments\": {\n \"getList\": { path: \"/3/invoicepayments\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/invoicepayments\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/invoicepayments/{Number}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/invoicepayments/{Number}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/invoicepayments/{Number}\" as const, method: \"delete\" as const },\n \"bookkeep\": { path: \"/3/invoicepayments/{Number}/bookkeep\" as const, method: \"put\" as const },\n },\n \"invoices\": {\n \"getList\": { path: \"/3/invoices\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/invoices\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/invoices/{DocumentNumber}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/invoices/{DocumentNumber}\" as const, method: \"put\" as const },\n \"bookkeep\": { path: \"/3/invoices/{DocumentNumber}/bookkeep\" as const, method: \"put\" as const },\n \"cancel\": { path: \"/3/invoices/{DocumentNumber}/cancel\" as const, method: \"put\" as const },\n \"credit\": { path: \"/3/invoices/{DocumentNumber}/credit\" as const, method: \"put\" as const },\n \"sendEinvoice\": { path: \"/3/invoices/{DocumentNumber}/einvoice\" as const, method: \"get\" as const },\n \"sendEmail\": { path: \"/3/invoices/{DocumentNumber}/email\" as const, method: \"get\" as const },\n \"sendEprint\": { path: \"/3/invoices/{DocumentNumber}/eprint\" as const, method: \"get\" as const },\n \"markAsSent\": { path: \"/3/invoices/{DocumentNumber}/externalprint\" as const, method: \"put\" as const },\n \"getPreview\": { path: \"/3/invoices/{DocumentNumber}/preview\" as const, method: \"get\" as const },\n \"print\": { path: \"/3/invoices/{DocumentNumber}/print\" as const, method: \"get\" as const },\n \"printReminder\": { path: \"/3/invoices/{DocumentNumber}/printreminder\" as const, method: \"get\" as const },\n \"setWarehouseReady\": { path: \"/3/invoices/{DocumentNumber}/warehouseready\" as const, method: \"put\" as const },\n },\n \"labels\": {\n \"getList\": { path: \"/3/labels\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/labels\" as const, method: \"post\" as const },\n \"update\": { path: \"/3/labels/{Id}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/labels/{Id}\" as const, method: \"delete\" as const },\n },\n \"me\": {\n \"get\": { path: \"/3/me\" as const, method: \"get\" as const },\n },\n \"modesofpayments\": {\n \"getList\": { path: \"/3/modesofpayments\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/modesofpayments\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/modesofpayments/{Code}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/modesofpayments/{Code}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/modesofpayments/{Code}\" as const, method: \"delete\" as const },\n },\n \"noxfinansinvoices\": {\n \"send\": { path: \"/3/noxfinansinvoices\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/noxfinansinvoices/{InvoiceNumber}\" as const, method: \"get\" as const },\n \"pause\": { path: \"/3/noxfinansinvoices/{InvoiceNumber}/pause\" as const, method: \"put\" as const },\n \"reportPayment\": { path: \"/3/noxfinansinvoices/{InvoiceNumber}/report-payment\" as const, method: \"put\" as const },\n \"stop\": { path: \"/3/noxfinansinvoices/{InvoiceNumber}/stop\" as const, method: \"put\" as const },\n \"takeFees\": { path: \"/3/noxfinansinvoices/{InvoiceNumber}/take-fees\" as const, method: \"put\" as const },\n \"unpause\": { path: \"/3/noxfinansinvoices/{InvoiceNumber}/unpause\" as const, method: \"put\" as const },\n },\n \"offers\": {\n \"getList\": { path: \"/3/offers\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/offers\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/offers/{DocumentNumber}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/offers/{DocumentNumber}\" as const, method: \"put\" as const },\n \"cancel\": { path: \"/3/offers/{DocumentNumber}/cancel\" as const, method: \"put\" as const },\n \"createInvoice\": { path: \"/3/offers/{DocumentNumber}/createinvoice\" as const, method: \"put\" as const },\n \"createOrder\": { path: \"/3/offers/{DocumentNumber}/createorder\" as const, method: \"put\" as const },\n \"sendEmail\": { path: \"/3/offers/{DocumentNumber}/email\" as const, method: \"get\" as const },\n \"markAsSent\": { path: \"/3/offers/{DocumentNumber}/externalprint\" as const, method: \"put\" as const },\n \"getPreview\": { path: \"/3/offers/{DocumentNumber}/preview\" as const, method: \"get\" as const },\n \"print\": { path: \"/3/offers/{DocumentNumber}/print\" as const, method: \"get\" as const },\n },\n \"orders\": {\n \"getList\": { path: \"/3/orders\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/orders\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/orders/{DocumentNumber}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/orders/{DocumentNumber}\" as const, method: \"put\" as const },\n \"cancel\": { path: \"/3/orders/{DocumentNumber}/cancel\" as const, method: \"put\" as const },\n \"createInvoice\": { path: \"/3/orders/{DocumentNumber}/createinvoice\" as const, method: \"put\" as const },\n \"sendEmail\": { path: \"/3/orders/{DocumentNumber}/email\" as const, method: \"get\" as const },\n \"markAsSent\": { path: \"/3/orders/{DocumentNumber}/externalprint\" as const, method: \"put\" as const },\n \"getPreview\": { path: \"/3/orders/{DocumentNumber}/preview\" as const, method: \"get\" as const },\n \"print\": { path: \"/3/orders/{DocumentNumber}/print\" as const, method: \"get\" as const },\n },\n \"predefinedaccounts\": {\n \"getList\": { path: \"/3/predefinedaccounts\" as const, method: \"get\" as const },\n \"get\": { path: \"/3/predefinedaccounts/{name}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/predefinedaccounts/{name}\" as const, method: \"put\" as const },\n },\n \"predefinedvoucherseries\": {\n \"getList\": { path: \"/3/predefinedvoucherseries\" as const, method: \"get\" as const },\n \"get\": { path: \"/3/predefinedvoucherseries/{Name}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/predefinedvoucherseries/{Name}\" as const, method: \"put\" as const },\n },\n \"pricelists\": {\n \"getList\": { path: \"/3/pricelists\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/pricelists\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/pricelists/{Code}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/pricelists/{Code}\" as const, method: \"put\" as const },\n },\n \"prices\": {\n \"getList\": { path: \"/3/prices\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/prices\" as const, method: \"post\" as const },\n \"getSubList\": { path: \"/3/prices/sublist/{PriceList}/{ArticleNumber}\" as const, method: \"get\" as const },\n \"get\": { path: \"/3/prices/{PriceList}/{ArticleNumber}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/prices/{PriceList}/{ArticleNumber}\" as const, method: \"put\" as const },\n \"getByFromQuantity\": { path: \"/3/prices/{PriceList}/{ArticleNumber}/{FromQuantity}\" as const, method: \"get\" as const },\n \"updateByFromQuantity\": { path: \"/3/prices/{PriceList}/{ArticleNumber}/{FromQuantity}\" as const, method: \"put\" as const },\n \"deleteByFromQuantity\": { path: \"/3/prices/{PriceList}/{ArticleNumber}/{FromQuantity}\" as const, method: \"delete\" as const },\n },\n \"printtemplates\": {\n \"getList\": { path: \"/3/printtemplates\" as const, method: \"get\" as const },\n },\n \"projects\": {\n \"getList\": { path: \"/3/projects\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/projects\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/projects/{ProjectNumber}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/projects/{ProjectNumber}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/projects/{ProjectNumber}\" as const, method: \"delete\" as const },\n },\n \"salarytransactions\": {\n \"getList\": { path: \"/3/salarytransactions\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/salarytransactions\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/salarytransactions/{SalaryRow}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/salarytransactions/{SalaryRow}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/salarytransactions/{SalaryRow}\" as const, method: \"delete\" as const },\n },\n \"scheduletimes\": {\n \"get\": { path: \"/3/scheduletimes/{EmployeeId}/{Date}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/scheduletimes/{EmployeeId}/{Date}\" as const, method: \"put\" as const },\n \"resetDay\": { path: \"/3/scheduletimes/{EmployeeId}/{Date}/resetday\" as const, method: \"put\" as const },\n },\n \"settings\": {\n \"getCompanySettings\": { path: \"/3/settings/company\" as const, method: \"get\" as const },\n \"getLockedPeriod\": { path: \"/3/settings/lockedperiod\" as const, method: \"get\" as const },\n },\n \"sie\": {\n \"get\": { path: \"/3/sie/{Type}\" as const, method: \"get\" as const },\n },\n \"supplierinvoiceaccruals\": {\n \"getList\": { path: \"/3/supplierinvoiceaccruals\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/supplierinvoiceaccruals\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/supplierinvoiceaccruals/{SupplierInvoiceNumber}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/supplierinvoiceaccruals/{SupplierInvoiceNumber}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/supplierinvoiceaccruals/{SupplierInvoiceNumber}\" as const, method: \"delete\" as const },\n },\n \"supplierinvoiceexternalurlconnections\": {\n \"create\": { path: \"/3/supplierinvoiceexternalurlconnections\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/supplierinvoiceexternalurlconnections/{Id}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/supplierinvoiceexternalurlconnections/{Id}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/supplierinvoiceexternalurlconnections/{Id}\" as const, method: \"delete\" as const },\n },\n \"supplierinvoicefileconnections\": {\n \"getList\": { path: \"/3/supplierinvoicefileconnections\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/supplierinvoicefileconnections\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/supplierinvoicefileconnections/{FileId}\" as const, method: \"get\" as const },\n \"delete\": { path: \"/3/supplierinvoicefileconnections/{FileId}\" as const, method: \"delete\" as const },\n },\n \"supplierinvoicepayments\": {\n \"getList\": { path: \"/3/supplierinvoicepayments\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/supplierinvoicepayments\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/supplierinvoicepayments/{Number}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/supplierinvoicepayments/{Number}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/supplierinvoicepayments/{Number}\" as const, method: \"delete\" as const },\n \"bookkeep\": { path: \"/3/supplierinvoicepayments/{Number}/bookkeep\" as const, method: \"put\" as const },\n },\n \"supplierinvoices\": {\n \"getList\": { path: \"/3/supplierinvoices\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/supplierinvoices\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/supplierinvoices/{GivenNumber}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/supplierinvoices/{GivenNumber}\" as const, method: \"put\" as const },\n \"approvalBookkeep\": { path: \"/3/supplierinvoices/{GivenNumber}/approvalbookkeep\" as const, method: \"put\" as const },\n \"approvalPayment\": { path: \"/3/supplierinvoices/{GivenNumber}/approvalpayment\" as const, method: \"put\" as const },\n \"bookkeep\": { path: \"/3/supplierinvoices/{GivenNumber}/bookkeep\" as const, method: \"put\" as const },\n \"cancel\": { path: \"/3/supplierinvoices/{GivenNumber}/cancel\" as const, method: \"put\" as const },\n \"credit\": { path: \"/3/supplierinvoices/{GivenNumber}/credit\" as const, method: \"put\" as const },\n },\n \"suppliers\": {\n \"getList\": { path: \"/3/suppliers\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/suppliers\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/suppliers/{SupplierNumber}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/suppliers/{SupplierNumber}\" as const, method: \"put\" as const },\n },\n \"taxreductions\": {\n \"getList\": { path: \"/3/taxreductions\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/taxreductions\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/taxreductions/{Id}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/taxreductions/{Id}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/taxreductions/{Id}\" as const, method: \"delete\" as const },\n },\n \"termsofdeliveries\": {\n \"getList\": { path: \"/3/termsofdeliveries\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/termsofdeliveries\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/termsofdeliveries/{Code}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/termsofdeliveries/{Code}\" as const, method: \"put\" as const },\n },\n \"termsofpayments\": {\n \"getList\": { path: \"/3/termsofpayments\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/termsofpayments\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/termsofpayments/{Code}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/termsofpayments/{Code}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/termsofpayments/{Code}\" as const, method: \"delete\" as const },\n },\n \"time\": {\n \"listArticles\": { path: \"/api/time/articles-v1\" as const, method: \"get\" as const },\n \"listRegistrations\": { path: \"/api/time/registrations-v2\" as const, method: \"get\" as const },\n },\n \"units\": {\n \"getList\": { path: \"/3/units\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/units\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/units/{Code}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/units/{Code}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/units/{Code}\" as const, method: \"delete\" as const },\n },\n \"vacationdebtbasis\": {\n \"get\": { path: \"/3/vacationdebtbasis/{Year}/{Month}\" as const, method: \"get\" as const },\n },\n \"voucherfileconnections\": {\n \"getList\": { path: \"/3/voucherfileconnections\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/voucherfileconnections\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/voucherfileconnections/{FileId}\" as const, method: \"get\" as const },\n \"delete\": { path: \"/3/voucherfileconnections/{FileId}\" as const, method: \"delete\" as const },\n },\n \"vouchers\": {\n \"getList\": { path: \"/3/vouchers\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/vouchers\" as const, method: \"post\" as const },\n \"getSubList\": { path: \"/3/vouchers/sublist\" as const, method: \"get\" as const },\n \"getSubListBySeries\": { path: \"/3/vouchers/sublist/{VoucherSeries}\" as const, method: \"get\" as const },\n \"get\": { path: \"/3/vouchers/{VoucherSeries}/{VoucherNumber}\" as const, method: \"get\" as const },\n },\n \"voucherseries\": {\n \"getList\": { path: \"/3/voucherseries\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/voucherseries\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/voucherseries/{Code}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/voucherseries/{Code}\" as const, method: \"put\" as const },\n },\n \"warehouse\": {\n \"listDeliveries\": { path: \"/api/warehouse/deliveries-v1\" as const, method: \"get\" as const },\n \"createInbound\": { path: \"/api/warehouse/deliveries-v1/inbounddeliveries\" as const, method: \"post\" as const },\n \"getInbound\": { path: \"/api/warehouse/deliveries-v1/inbounddeliveries/{id}\" as const, method: \"get\" as const },\n \"updateInbound\": { path: \"/api/warehouse/deliveries-v1/inbounddeliveries/{id}\" as const, method: \"put\" as const },\n \"updateInboundNote\": { path: \"/api/warehouse/deliveries-v1/inbounddeliveries/{id}\" as const, method: \"patch\" as const },\n \"releaseInbound\": { path: \"/api/warehouse/deliveries-v1/inbounddeliveries/{id}/release\" as const, method: \"put\" as const },\n \"voidInbound\": { path: \"/api/warehouse/deliveries-v1/inbounddeliveries/{id}/void\" as const, method: \"put\" as const },\n \"createOutbound\": { path: \"/api/warehouse/deliveries-v1/outbounddeliveries\" as const, method: \"post\" as const },\n \"getOutbound\": { path: \"/api/warehouse/deliveries-v1/outbounddeliveries/{id}\" as const, method: \"get\" as const },\n \"updateOutbound\": { path: \"/api/warehouse/deliveries-v1/outbounddeliveries/{id}\" as const, method: \"put\" as const },\n \"updateOutboundNote\": { path: \"/api/warehouse/deliveries-v1/outbounddeliveries/{id}\" as const, method: \"patch\" as const },\n \"releaseOutbound\": { path: \"/api/warehouse/deliveries-v1/outbounddeliveries/{id}/release\" as const, method: \"put\" as const },\n \"voidOutbound\": { path: \"/api/warehouse/deliveries-v1/outbounddeliveries/{id}/void\" as const, method: \"put\" as const },\n \"listDocumentTypes\": { path: \"/api/warehouse/documentdeliveries/custom/documenttypes-v1\" as const, method: \"get\" as const },\n \"createDocumentType\": { path: \"/api/warehouse/documentdeliveries/custom/documenttypes-v1\" as const, method: \"post\" as const },\n \"getDocumentType\": { path: \"/api/warehouse/documentdeliveries/custom/documenttypes-v1/{type}\" as const, method: \"get\" as const },\n \"getCustomInbound\": { path: \"/api/warehouse/documentdeliveries/custom/inbound-v1/{type}/{id}\" as const, method: \"get\" as const },\n \"saveCustomInbound\": { path: \"/api/warehouse/documentdeliveries/custom/inbound-v1/{type}/{id}\" as const, method: \"put\" as const },\n \"releaseCustomInbound\": { path: \"/api/warehouse/documentdeliveries/custom/inbound-v1/{type}/{id}/release\" as const, method: \"put\" as const },\n \"voidCustomInbound\": { path: \"/api/warehouse/documentdeliveries/custom/inbound-v1/{type}/{id}/void\" as const, method: \"put\" as const },\n \"getCustomOutbound\": { path: \"/api/warehouse/documentdeliveries/custom/outbound-v1/{type}/{id}\" as const, method: \"get\" as const },\n \"saveCustomOutbound\": { path: \"/api/warehouse/documentdeliveries/custom/outbound-v1/{type}/{id}\" as const, method: \"put\" as const },\n \"releaseCustomOutbound\": { path: \"/api/warehouse/documentdeliveries/custom/outbound-v1/{type}/{id}/release\" as const, method: \"put\" as const },\n \"voidCustomOutbound\": { path: \"/api/warehouse/documentdeliveries/custom/outbound-v1/{type}/{id}/void\" as const, method: \"put\" as const },\n \"listIncomingGoods\": { path: \"/api/warehouse/incominggoods-v1\" as const, method: \"get\" as const },\n \"createIncomingGoods\": { path: \"/api/warehouse/incominggoods-v1\" as const, method: \"post\" as const },\n \"getIncomingGoods\": { path: \"/api/warehouse/incominggoods-v1/{id}\" as const, method: \"get\" as const },\n \"saveIncomingGoods\": { path: \"/api/warehouse/incominggoods-v1/{id}\" as const, method: \"put\" as const },\n \"updateIncomingGoodsNote\": { path: \"/api/warehouse/incominggoods-v1/{id}\" as const, method: \"patch\" as const },\n \"setIncomingGoodsCompleted\": { path: \"/api/warehouse/incominggoods-v1/{id}/completed\" as const, method: \"put\" as const },\n \"releaseIncomingGoods\": { path: \"/api/warehouse/incominggoods-v1/{id}/release\" as const, method: \"put\" as const },\n \"voidIncomingGoods\": { path: \"/api/warehouse/incominggoods-v1/{id}/void\" as const, method: \"put\" as const },\n \"listProductionOrders\": { path: \"/api/warehouse/productionorders-v1\" as const, method: \"get\" as const },\n \"createProductionOrder\": { path: \"/api/warehouse/productionorders-v1\" as const, method: \"post\" as const },\n \"getBillOfMaterials\": { path: \"/api/warehouse/productionorders-v1/billofmaterials/{itemId}\" as const, method: \"get\" as const },\n \"releaseProductionOrder\": { path: \"/api/warehouse/productionorders-v1/release/{id}\" as const, method: \"put\" as const },\n \"voidProductionOrder\": { path: \"/api/warehouse/productionorders-v1/void/{id}\" as const, method: \"put\" as const },\n \"getProductionOrder\": { path: \"/api/warehouse/productionorders-v1/{id}\" as const, method: \"get\" as const },\n \"updateProductionOrder\": { path: \"/api/warehouse/productionorders-v1/{id}\" as const, method: \"put\" as const },\n \"updateProductionOrderNote\": { path: \"/api/warehouse/productionorders-v1/{id}\" as const, method: \"patch\" as const },\n \"listPurchaseOrders\": { path: \"/api/warehouse/purchaseorders-v1\" as const, method: \"get\" as const },\n \"createPurchaseOrder\": { path: \"/api/warehouse/purchaseorders-v1\" as const, method: \"post\" as const },\n \"getCsvReport\": { path: \"/api/warehouse/purchaseorders-v1/csv\" as const, method: \"get\" as const },\n \"batchUpdateResponseState\": { path: \"/api/warehouse/purchaseorders-v1/response\" as const, method: \"put\" as const },\n \"sendMany\": { path: \"/api/warehouse/purchaseorders-v1/sendpurchaseorders\" as const, method: \"post\" as const },\n \"getPurchaseOrder\": { path: \"/api/warehouse/purchaseorders-v1/{id}\" as const, method: \"get\" as const },\n \"updatePurchaseOrder\": { path: \"/api/warehouse/purchaseorders-v1/{id}\" as const, method: \"put\" as const },\n \"setManuallyCompleted\": { path: \"/api/warehouse/purchaseorders-v1/{id}/complete\" as const, method: \"put\" as const },\n \"setDropshipCompleted\": { path: \"/api/warehouse/purchaseorders-v1/{id}/dropshipcomplete\" as const, method: \"put\" as const },\n \"getMatchedDocuments\": { path: \"/api/warehouse/purchaseorders-v1/{id}/matches\" as const, method: \"get\" as const },\n \"getNotes\": { path: \"/api/warehouse/purchaseorders-v1/{id}/notes\" as const, method: \"get\" as const },\n \"updatePartial\": { path: \"/api/warehouse/purchaseorders-v1/{id}/partial\" as const, method: \"patch\" as const },\n \"updateResponseState\": { path: \"/api/warehouse/purchaseorders-v1/{id}/response\" as const, method: \"put\" as const },\n \"send\": { path: \"/api/warehouse/purchaseorders-v1/{id}/send\" as const, method: \"post\" as const },\n \"voidPurchaseOrder\": { path: \"/api/warehouse/purchaseorders-v1/{id}/void\" as const, method: \"put\" as const },\n \"getStockBalance\": { path: \"/api/warehouse/status-v1/stockbalance\" as const, method: \"get\" as const },\n \"listStockPoints\": { path: \"/api/warehouse/stockpoints-v1\" as const, method: \"get\" as const },\n \"createStockPoint\": { path: \"/api/warehouse/stockpoints-v1\" as const, method: \"post\" as const },\n \"getManyStockPoints\": { path: \"/api/warehouse/stockpoints-v1/multi\" as const, method: \"get\" as const },\n \"getStockPoint\": { path: \"/api/warehouse/stockpoints-v1/{id}\" as const, method: \"get\" as const },\n \"appendStockLocations\": { path: \"/api/warehouse/stockpoints-v1/{id}\" as const, method: \"post\" as const },\n \"updateStockPoint\": { path: \"/api/warehouse/stockpoints-v1/{id}\" as const, method: \"put\" as const },\n \"deleteStockPoint\": { path: \"/api/warehouse/stockpoints-v1/{id}\" as const, method: \"delete\" as const },\n \"listStockLocations\": { path: \"/api/warehouse/stockpoints-v1/{id}/stocklocations\" as const, method: \"get\" as const },\n \"listStockTakings\": { path: \"/api/warehouse/stocktaking-v1\" as const, method: \"get\" as const },\n \"createStockTaking\": { path: \"/api/warehouse/stocktaking-v1\" as const, method: \"post\" as const },\n \"getStockTaking\": { path: \"/api/warehouse/stocktaking-v1/{id}\" as const, method: \"get\" as const },\n \"updateStockTaking\": { path: \"/api/warehouse/stocktaking-v1/{id}\" as const, method: \"put\" as const },\n \"deleteStockTaking\": { path: \"/api/warehouse/stocktaking-v1/{id}\" as const, method: \"delete\" as const },\n \"addRowsByFilter\": { path: \"/api/warehouse/stocktaking-v1/{id}/addrows\" as const, method: \"post\" as const },\n \"getCandidateRows\": { path: \"/api/warehouse/stocktaking-v1/{id}/candidates\" as const, method: \"get\" as const },\n \"releaseStockTaking\": { path: \"/api/warehouse/stocktaking-v1/{id}/release\" as const, method: \"put\" as const },\n \"listRows\": { path: \"/api/warehouse/stocktaking-v1/{id}/rows\" as const, method: \"get\" as const },\n \"addRows\": { path: \"/api/warehouse/stocktaking-v1/{id}/rows\" as const, method: \"post\" as const },\n \"deleteRowsByFilter\": { path: \"/api/warehouse/stocktaking-v1/{id}/rows\" as const, method: \"delete\" as const },\n \"deleteRow\": { path: \"/api/warehouse/stocktaking-v1/{id}/rows/{rowId}\" as const, method: \"delete\" as const },\n \"voidStockTaking\": { path: \"/api/warehouse/stocktaking-v1/{id}/void\" as const, method: \"put\" as const },\n \"createStockTransfer\": { path: \"/api/warehouse/stocktransfer-v1\" as const, method: \"post\" as const },\n \"getStockTransfer\": { path: \"/api/warehouse/stocktransfer-v1/{id}\" as const, method: \"get\" as const },\n \"updateStockTransfer\": { path: \"/api/warehouse/stocktransfer-v1/{id}\" as const, method: \"put\" as const },\n \"releaseStockTransfer\": { path: \"/api/warehouse/stocktransfer-v1/{id}/release\" as const, method: \"put\" as const },\n \"voidStockTransfer\": { path: \"/api/warehouse/stocktransfer-v1/{id}/void\" as const, method: \"put\" as const },\n \"getActivationStatus\": { path: \"/api/warehouse/tenants-v4\" as const, method: \"get\" as const },\n },\n \"wayofdeliveries\": {\n \"getList\": { path: \"/3/wayofdeliveries\" as const, method: \"get\" as const },\n \"create\": { path: \"/3/wayofdeliveries\" as const, method: \"post\" as const },\n \"get\": { path: \"/3/wayofdeliveries/{Code}\" as const, method: \"get\" as const },\n \"update\": { path: \"/3/wayofdeliveries/{Code}\" as const, method: \"put\" as const },\n \"delete\": { path: \"/3/wayofdeliveries/{Code}\" as const, method: \"delete\" as const },\n },\n} as const;\n\nexport type ResourceOperations = typeof RESOURCE_OPERATIONS;\n","import {\r\n\ttype ErrorResponse,\r\n\ttype InitFortnoxOptions,\r\n\tMETHODS,\r\n\trequest,\r\n} from \"./request\";\r\nimport {\r\n\tRESOURCE_OPERATIONS,\r\n\ttype ResourceOperations,\r\n} from \"./types/resource-operations.gen\";\r\nimport type { OmitNever } from \"./types/utility-types\";\r\n\r\ntype FortnoxInput<\r\n\tTRoutes extends object,\r\n\tTPath extends keyof TRoutes,\r\n\tTMethod extends keyof TRoutes[TPath],\r\n> = TRoutes[TPath][TMethod] extends { request: infer R } ? R : never;\r\n\r\ntype FortnoxInputCleaned<\r\n\tTRoutes extends object,\r\n\tTPath extends keyof TRoutes,\r\n\tTMethod extends keyof TRoutes[TPath],\r\n> = OmitNever<FortnoxInput<TRoutes, TPath, TMethod>>;\r\n\r\ntype FortnoxOutput<\r\n\tTRoutes extends object,\r\n\tTPath extends keyof TRoutes,\r\n\tTMethod extends keyof TRoutes[TPath],\r\n> = TRoutes[TPath][TMethod] extends { response: { body: infer B } } ? B : never;\r\n\r\ntype FortnoxResult<TData> = Promise<\r\n\t{ error: ErrorResponse; data: null } | { error: null; data: TData }\r\n>;\r\n\r\ntype FortnoxMethods<TRoutes extends object, TPath extends keyof TRoutes> = {\r\n\t[TMethod in keyof TRoutes[TPath]]: TRoutes[TPath][TMethod] extends {\r\n\t\trequest: { params: never; body: never };\r\n\t}\r\n\t\t? (\r\n\t\t\t\toptions?: FortnoxInputCleaned<TRoutes, TPath, TMethod>,\r\n\t\t\t) => FortnoxResult<FortnoxOutput<TRoutes, TPath, TMethod>>\r\n\t\t: (\r\n\t\t\t\toptions: FortnoxInputCleaned<TRoutes, TPath, TMethod>,\r\n\t\t\t) => FortnoxResult<FortnoxOutput<TRoutes, TPath, TMethod>>;\r\n};\r\n\r\n/** Resolves the callable type for a single resource operation (path + method pair). */\r\ntype FortnoxOpMethod<\r\n\tTRoutes extends object,\r\n\tTPath,\r\n\tTMethod,\r\n> = TPath extends keyof TRoutes\r\n\t? TMethod extends keyof TRoutes[TPath]\r\n\t\t? TRoutes[TPath][TMethod] extends {\r\n\t\t\t\trequest: { params: never; body: never };\r\n\t\t\t}\r\n\t\t\t? (\r\n\t\t\t\t\toptions?: FortnoxInputCleaned<TRoutes, TPath, TMethod>,\r\n\t\t\t\t) => FortnoxResult<FortnoxOutput<TRoutes, TPath, TMethod>>\r\n\t\t\t: (\r\n\t\t\t\t\toptions: FortnoxInputCleaned<TRoutes, TPath, TMethod>,\r\n\t\t\t\t) => FortnoxResult<FortnoxOutput<TRoutes, TPath, TMethod>>\r\n\t\t: never\r\n\t: never;\r\n\r\n/** Methods for a single resource, keyed by operation ID, filtered to only those present in TRoutes. */\r\ntype FortnoxResourceMethods<\r\n\tTRoutes extends object,\r\n\tTResource extends keyof ResourceOperations,\r\n> = OmitNever<{\r\n\t[TOp in keyof ResourceOperations[TResource]]: ResourceOperations[TResource][TOp] extends {\r\n\t\tpath: infer P;\r\n\t\tmethod: infer M;\r\n\t}\r\n\t\t? FortnoxOpMethod<TRoutes, P, M>\r\n\t\t: never;\r\n}>;\r\n\r\n/** Resource-based accessor shape: fortnox.invoices.getList(...) */\r\ntype FortnoxResources<TRoutes extends object> = {\r\n\t[TResource in keyof ResourceOperations]: FortnoxResourceMethods<\r\n\t\tTRoutes,\r\n\t\tTResource\r\n\t>;\r\n};\r\n\r\n/** Path-based accessor: fortnox.path(\"/3/invoices\").get(...) */\r\nexport type FortnoxPathFn<TRoutes extends object> = <\r\n\tTPath extends keyof TRoutes,\r\n>(\r\n\tpath: TPath,\r\n) => FortnoxMethods<TRoutes, TPath>;\r\n\r\n/** Full Fortnox client with both resource accessors and path-based fallback. */\r\nexport type FortnoxClient<TRoutes extends object> =\r\n\tFortnoxResources<TRoutes> & {\r\n\t\tpath: FortnoxPathFn<TRoutes>;\r\n\t};\r\n\r\nexport function createInitFortnox<TRoutes extends object>(): {\r\n\t(options: { accessToken: string }): FortnoxClient<TRoutes>;\r\n\t(options: {\r\n\t\tproxy: { baseUrl: string; apiKey: string; tenantId: string };\r\n\t}): FortnoxClient<TRoutes>;\r\n} {\r\n\tfunction initFortnox(options: {\r\n\t\taccessToken: string;\r\n\t}): FortnoxClient<TRoutes>;\r\n\tfunction initFortnox(options: {\r\n\t\tproxy: { baseUrl: string; apiKey: string; tenantId: string };\r\n\t}): FortnoxClient<TRoutes>;\r\n\tfunction initFortnox(\r\n\t\tinitOptions: InitFortnoxOptions,\r\n\t): FortnoxClient<TRoutes> {\r\n\t\tconst pathFn = <TPath extends keyof TRoutes>(\r\n\t\t\tpath: TPath,\r\n\t\t): FortnoxMethods<TRoutes, TPath> => {\r\n\t\t\treturn Object.fromEntries(\r\n\t\t\t\tMETHODS.map((method) => [\r\n\t\t\t\t\tmethod,\r\n\t\t\t\t\t(options: Record<string, unknown>) =>\r\n\t\t\t\t\t\trequest({ path: path as string, method, ...options }, initOptions),\r\n\t\t\t\t]),\r\n\t\t\t) as unknown as FortnoxMethods<TRoutes, TPath>;\r\n\t\t};\r\n\r\n\t\tconst client = { path: pathFn } as unknown as FortnoxClient<TRoutes>;\r\n\r\n\t\tfor (const [resource, ops] of Object.entries(RESOURCE_OPERATIONS)) {\r\n\t\t\tconst resourceMethods: Record<string, unknown> = {};\r\n\t\t\tfor (const [opId, { path, method }] of Object.entries(\r\n\t\t\t\tops as Record<string, { path: string; method: string }>,\r\n\t\t\t)) {\r\n\t\t\t\tresourceMethods[opId] = (options: Record<string, unknown> = {}) =>\r\n\t\t\t\t\trequest(\r\n\t\t\t\t\t\t{ path, method: method as (typeof METHODS)[number], ...options },\r\n\t\t\t\t\t\tinitOptions,\r\n\t\t\t\t\t);\r\n\t\t\t}\r\n\t\t\t(client as unknown as Record<string, unknown>)[resource] =\r\n\t\t\t\tresourceMethods;\r\n\t\t}\r\n\r\n\t\treturn client;\r\n\t}\r\n\treturn initFortnox;\r\n}\r\n"],"mappings":";;AAAA,MAAa,UAAU;CAAC;CAAO;CAAQ;CAAO;CAAU;CAAQ;AAiChE,eAAsB,QACrB,YACA,aACC;AACD,KAAI;EACH,IAAI;EACJ,IAAI;AAEJ,MAAI,iBAAiB,aAAa;AACjC,aAAU,EACT,eAAe,UAAU,YAAY,eACrC;AACD,aAAU;SACJ;AACN,aAAU;IACT,aAAa,YAAY,MAAM;IAC/B,eAAe,YAAY,MAAM;IACjC;AACD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