@beel_es/sdk 1.1.0 → 1.3.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.
- package/README.md +136 -4
- package/dist/index.d.mts +30313 -6857
- package/dist/index.d.ts +30313 -6857
- package/dist/index.js +1007 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +987 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -4
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/http/client.ts","../src/http/middleware.ts","../src/core/errors.ts","../src/resources/invoices.ts","../src/resources/customers.ts","../src/resources/products.ts","../src/resources/configuration.ts","../src/resources/series.ts","../src/resources/nif.ts","../src/client.ts","../src/webhooks/verifier.ts","../src/builders/customer-builder.ts","../src/builders/invoice-builder.ts"],"sourcesContent":["// ── Client ─────────────────────────────────────────────\nexport { BeeL } from './client';\nexport type { BeeLConfig } from './http/client';\n\n// ── Typed errors ───────────────────────────────────────\nexport {\n BeeLApiError,\n BeeLRateLimitError,\n BeeLValidationError,\n BeeLAuthError,\n BeeLNotFoundError,\n BeeLConflictError,\n} from './core/errors';\n\n// ── Webhook verification ───────────────────────────────\nexport { WebhookVerifier, WebhookVerificationError } from './webhooks/verifier';\nexport type { WebhookEvent } from './webhooks/verifier';\n\n// ── Webhook event types (auto-generated) ───────────────\nexport type {\n WebhookEventEnvelope,\n VeriFactuStatusUpdatedEvent,\n VeriFactuStatusUpdatedData,\n VeriFactuStatus,\n} from './generated-webhooks';\n\n// ── Builders ───────────────────────────────────────────\nexport { CustomerBuilder } from './builders/customer-builder';\nexport { InvoiceBuilder } from './builders/invoice-builder';\n\n// ── Generated types ────────────────────────────────────\nexport type { components, operations, paths } from './generated/schema';\n","import createClient from 'openapi-fetch';\nimport type { paths } from '../generated/schema';\nimport { requestMiddleware, errorMiddleware, createRetryMiddleware } from './middleware';\n\nexport interface BeeLConfig {\n /** API key (beel_sk_live_* or beel_sk_test_*) */\n apiKey: string;\n /** Base URL. Defaults to https://app.beel.es/api */\n baseUrl?: string;\n /** Max retries on 429/5xx. Default: 3 */\n maxRetries?: number;\n /** Initial retry delay in ms. Default: 500 */\n retryDelayMs?: number;\n /** Max retry delay in ms. Default: 30000 */\n maxRetryDelayMs?: number;\n /** Auto-generate Idempotency-Key for POST requests. Default: true */\n autoIdempotencyKey?: boolean;\n}\n\nexport function createBeeLClient(config: BeeLConfig) {\n const client = createClient<paths>({\n baseUrl: config.baseUrl ?? 'https://app.beel.es/api',\n headers: {\n Authorization: `Bearer ${config.apiKey}`,\n },\n });\n\n // Register middleware in order\n client.use(requestMiddleware);\n\n client.use(errorMiddleware);\n\n client.use(\n createRetryMiddleware({\n maxRetries: config.maxRetries ?? 3,\n initialDelayMs: config.retryDelayMs ?? 500,\n maxDelayMs: config.maxRetryDelayMs ?? 30_000,\n }),\n );\n\n return client;\n}\n\nexport type BeeLClient = ReturnType<typeof createBeeLClient>;\n","import { randomUUID } from 'crypto';\nimport type { Middleware } from 'openapi-fetch';\nimport {\n throwApiError,\n BeeLApiError,\n BeeLRateLimitError,\n} from '../core/errors';\n\n/**\n * Ensures POST/PUT/PATCH requests always have a JSON body and Content-Type.\n * Also adds Idempotency-Key to POST requests.\n */\nexport const requestMiddleware: Middleware = {\n async onRequest({ request }) {\n const method = request.method;\n\n // Ensure POST/PUT/PATCH always send a JSON body (API rejects empty body)\n if (['POST', 'PUT', 'PATCH'].includes(method)) {\n const hasBody = request.headers.get('content-type')?.includes('application/json');\n if (!hasBody) {\n const clone = new Request(request, {\n body: request.body ?? '{}',\n headers: new Headers(request.headers),\n });\n clone.headers.set('Content-Type', 'application/json');\n\n if (method === 'POST' && !clone.headers.has('Idempotency-Key')) {\n clone.headers.set('Idempotency-Key', randomUUID());\n }\n return clone;\n }\n }\n\n // Add Idempotency-Key to POST requests that already have a body\n if (method === 'POST' && !request.headers.has('Idempotency-Key')) {\n request.headers.set('Idempotency-Key', randomUUID());\n }\n\n return request;\n },\n};\n\n/**\n * Maps non-2xx responses to typed BeeLApiError subclasses.\n */\nexport const errorMiddleware: Middleware = {\n async onResponse({ response }) {\n if (!response.ok) {\n const body = await response.json().catch(() => null);\n throwApiError(response.status, body);\n }\n return response;\n },\n};\n\n/**\n * Creates a retry middleware with exponential backoff.\n * Retries on 429 and 5xx. Does NOT retry 4xx client errors.\n */\nexport function createRetryMiddleware(options: {\n maxRetries: number;\n initialDelayMs: number;\n maxDelayMs: number;\n}): Middleware {\n return {\n async onError({ error, request }) {\n // Only retry retryable errors\n if (!(error instanceof BeeLApiError)) return;\n if (!(error instanceof BeeLRateLimitError) && error.statusCode < 500) return;\n\n for (let attempt = 0; attempt < options.maxRetries; attempt++) {\n const delay =\n error instanceof BeeLRateLimitError\n ? error.retryAfterSeconds * 1000\n : Math.min(\n options.initialDelayMs * Math.pow(2, attempt) + Math.random() * options.initialDelayMs,\n options.maxDelayMs,\n );\n\n await new Promise((r) => setTimeout(r, delay));\n\n try {\n // Re-generate idempotency key for POST retries\n if (request.method === 'POST') {\n request.headers.set('Idempotency-Key', randomUUID());\n }\n const response = await fetch(request.clone());\n if (response.ok) return response;\n\n const body = await response.json().catch(() => null);\n throwApiError(response.status, body);\n } catch (retryError) {\n if (!(retryError instanceof BeeLApiError)) throw retryError;\n if (!(retryError instanceof BeeLRateLimitError) && retryError.statusCode < 500) throw retryError;\n // Continue retrying\n if (attempt === options.maxRetries - 1) throw retryError;\n }\n }\n },\n };\n}\n","/**\n * Base error for all BeeL API errors.\n */\nexport class BeeLApiError extends Error {\n public readonly statusCode: number;\n public readonly code: string;\n public readonly details?: Record<string, string>;\n public readonly requestId?: string;\n\n constructor(\n message: string,\n statusCode: number,\n code: string,\n details?: Record<string, string>,\n requestId?: string,\n ) {\n super(message);\n this.name = 'BeeLApiError';\n this.statusCode = statusCode;\n this.code = code;\n this.details = details;\n this.requestId = requestId;\n }\n}\n\n/** 429 — Rate limit exceeded */\nexport class BeeLRateLimitError extends BeeLApiError {\n public readonly retryAfterSeconds: number;\n\n constructor(message: string, retryAfterSeconds: number, requestId?: string) {\n super(message, 429, 'RATE_LIMIT_EXCEEDED', undefined, requestId);\n this.name = 'BeeLRateLimitError';\n this.retryAfterSeconds = retryAfterSeconds;\n }\n}\n\n/** 422 — Validation or business rule error */\nexport class BeeLValidationError extends BeeLApiError {\n constructor(\n message: string,\n details?: Record<string, string>,\n requestId?: string,\n ) {\n super(message, 422, 'UNPROCESSABLE_ENTITY', details, requestId);\n this.name = 'BeeLValidationError';\n }\n}\n\n/** 401 / 403 — Authentication or authorization error */\nexport class BeeLAuthError extends BeeLApiError {\n constructor(message: string, statusCode: 401 | 403, requestId?: string) {\n super(\n message,\n statusCode,\n statusCode === 401 ? 'UNAUTHORIZED' : 'FORBIDDEN',\n undefined,\n requestId,\n );\n this.name = 'BeeLAuthError';\n }\n}\n\n/** 404 — Resource not found */\nexport class BeeLNotFoundError extends BeeLApiError {\n constructor(message: string, requestId?: string) {\n super(message, 404, 'NOT_FOUND', undefined, requestId);\n this.name = 'BeeLNotFoundError';\n }\n}\n\n/** 409 — Conflict (e.g. duplicate resource) */\nexport class BeeLConflictError extends BeeLApiError {\n constructor(message: string, requestId?: string) {\n super(message, 409, 'CONFLICT', undefined, requestId);\n this.name = 'BeeLConflictError';\n }\n}\n\n/**\n * Maps a raw HTTP error response to a typed BeeLApiError subclass.\n */\nexport function throwApiError(status: number, body: unknown): never {\n const parsed = body as Record<string, any> | null;\n const errorData = parsed?.error ?? parsed;\n const message = errorData?.message ?? `API error ${status}`;\n const code = errorData?.code ?? 'UNKNOWN';\n const details = errorData?.details;\n const requestId = parsed?.meta?.request_id;\n\n switch (status) {\n case 401:\n case 403:\n throw new BeeLAuthError(message, status as 401 | 403, requestId);\n case 404:\n throw new BeeLNotFoundError(message, requestId);\n case 409:\n throw new BeeLConflictError(message, requestId);\n case 422:\n throw new BeeLValidationError(message, details, requestId);\n case 429: {\n const retryAfter = errorData?.retry_after ?? 60;\n throw new BeeLRateLimitError(message, retryAfter, requestId);\n }\n default:\n throw new BeeLApiError(message, status, code, details, requestId);\n }\n}\n","import type { BeeLClient } from '../http/client';\nimport type { components, operations } from '../generated/schema';\n\ntype Invoice = components['schemas']['Invoice'];\ntype Pagination = components['schemas']['Pagination'];\ntype ListParams = operations['listInvoices']['parameters']['query'];\n\nexport class InvoicesResource {\n constructor(private client: BeeLClient) {}\n\n /**\n * List invoices with optional filters and pagination.\n *\n * @example\n * const { invoices, pagination } = await beel.invoices.list({ status: 'ISSUED', limit: 20 });\n */\n async list(params?: ListParams) {\n const { data } = await this.client.GET('/v1/invoices', { params: { query: params } });\n return data!.data as { invoices: Invoice[]; pagination: Pagination };\n }\n\n /**\n * Create a new invoice. An idempotency key is automatically added.\n *\n * @example\n * const invoice = await beel.invoices.create({\n * type: 'STANDARD',\n * recipient: { customer_id: 'uuid' },\n * lines: [{ description: 'Service', quantity: 1, unit_price: 100, discount_percentage: 0 }],\n * });\n */\n async create(body: components['schemas']['CreateInvoiceRequest']) {\n const { data } = await this.client.POST('/v1/invoices', { body });\n return data!.data as Invoice;\n }\n\n /** Get an invoice by ID. */\n async get(id: string) {\n const { data } = await this.client.GET('/v1/invoices/{invoice_id}', { params: { path: { invoice_id: id } } });\n return data!.data as Invoice;\n }\n\n /** Update a draft invoice. Only draft invoices can be updated. */\n async update(id: string, body: components['schemas']['UpdateInvoiceRequest']) {\n const { data } = await this.client.PUT('/v1/invoices/{invoice_id}', { params: { path: { invoice_id: id } }, body });\n return data!.data as Invoice;\n }\n\n /** Delete a draft invoice. Only draft invoices can be deleted. */\n async delete(id: string) {\n await this.client.DELETE('/v1/invoices/{invoice_id}', { params: { path: { invoice_id: id } } });\n }\n\n /** Duplicate an invoice, optionally into a different series. */\n async duplicate(id: string, options?: { series_id?: string; notes?: string }) {\n const { data } = await this.client.POST('/v1/invoices/{invoice_id}/duplicate', { params: { path: { invoice_id: id } }, body: options as any });\n return data!.data as Invoice;\n }\n\n /**\n * Issue a draft invoice. Assigns an invoice number and triggers VeriFactu submission.\n * @param options.wait_for_pdf - If true, waits for PDF generation before returning.\n */\n async issue(id: string, options?: { wait_for_pdf?: boolean }) {\n const { data } = await this.client.POST('/v1/invoices/{invoice_id}/issue', { params: { path: { invoice_id: id }, query: options } });\n return data!.data as Invoice;\n }\n\n /**\n * Mark an invoice as paid.\n * @param options.payment_date - Payment date (defaults to today).\n * @param options.payment_method - Payment method details.\n */\n async markPaid(id: string, options?: { payment_date?: string; payment_method?: any }) {\n const { data } = await this.client.POST('/v1/invoices/{invoice_id}/mark-paid', { params: { path: { invoice_id: id } }, body: options as any });\n return data!.data as Invoice;\n }\n\n /** Mark an invoice as sent (e.g. delivered by other means). */\n async markSent(id: string, options?: { sent_at?: string }) {\n const { data } = await this.client.POST('/v1/invoices/{invoice_id}/mark-sent', { params: { path: { invoice_id: id } }, body: options as any });\n return data!.data as Invoice;\n }\n\n /** Revert a paid/sent invoice back to issued status. */\n async revertToIssued(id: string) {\n const { data } = await this.client.POST('/v1/invoices/{invoice_id}/revert-to-issued', { params: { path: { invoice_id: id } } });\n return data!.data as Invoice;\n }\n\n /**\n * Void an issued invoice. Requires a reason (min 10 chars).\n *\n * @example\n * await beel.invoices.void('id', { reason: 'Duplicate invoice sent in error' });\n */\n async void(id: string, params: { reason: string; void_date?: string }) {\n const { data } = await this.client.POST('/v1/invoices/{invoice_id}/void', { params: { path: { invoice_id: id } }, body: params as any });\n return data!.data as Invoice;\n }\n\n /** Create a corrective invoice that references the original. */\n async createCorrective(id: string, body: components['schemas']['CreateCorrectiveInvoiceRequest']) {\n const { data } = await this.client.POST('/v1/invoices/{invoice_id}/corrective', { params: { path: { invoice_id: id } }, body });\n return data!.data as Invoice;\n }\n\n /** Schedule a draft invoice to be issued on a future date. */\n async schedule(id: string, params: { scheduled_for: string; action?: string }) {\n const { data } = await this.client.POST('/v1/invoices/{invoice_id}/schedule', { params: { path: { invoice_id: id } }, body: params as any });\n return data!.data as Invoice;\n }\n\n /** Cancel a scheduled invoice, returning it to draft. */\n async unschedule(id: string) {\n const { data } = await this.client.POST('/v1/invoices/{invoice_id}/unschedule', { params: { path: { invoice_id: id } } });\n return data!.data as Invoice;\n }\n\n /** Change the scheduled date of a scheduled invoice. */\n async reschedule(id: string, params: { scheduled_for: string }) {\n const { data } = await this.client.PATCH('/v1/invoices/{invoice_id}/reschedule', { params: { path: { invoice_id: id } }, body: params as any });\n return data!.data as Invoice;\n }\n\n /**\n * Get a pre-signed URL to download the invoice PDF.\n * The URL expires in 5 minutes. Use `beel.downloadPdf(id)` for a simpler Buffer download.\n */\n async getPdf(id: string) {\n const { data } = await this.client.GET('/v1/invoices/{invoice_id}/pdf', { params: { path: { invoice_id: id } } });\n return data!.data as { download_url: string; expires_in_seconds: number; file_name: string };\n }\n\n /** Send an invoice by email. Uses the customer's email by default. */\n async sendEmail(id: string, options?: { to?: string[]; cc?: string[]; subject?: string; message?: string }) {\n const { data } = await this.client.POST('/v1/invoices/{invoice_id}/send', { params: { path: { invoice_id: id } }, body: options as any });\n return data!.data;\n }\n}\n","import type { BeeLClient } from '../http/client';\nimport type { components, operations } from '../generated/schema';\n\ntype Customer = components['schemas']['Customer'];\ntype Pagination = components['schemas']['Pagination'];\ntype ListParams = operations['listCustomers']['parameters']['query'];\n\nexport class CustomersResource {\n constructor(private client: BeeLClient) {}\n\n /**\n * List customers with optional filters and pagination.\n *\n * @example\n * const { customers, pagination } = await beel.customers.list({ search: 'Acme', limit: 10 });\n */\n async list(params?: ListParams) {\n const { data } = await this.client.GET('/v1/customers', { params: { query: params } });\n return data!.data as { customers: Customer[]; pagination: Pagination };\n }\n\n /**\n * Create a new customer.\n *\n * @example\n * const customer = await beel.customers.create({\n * legal_name: 'Acme SL',\n * nif: 'B12345678',\n * address: { street: 'Calle Mayor', number: '1', postal_code: '28001', city: 'Madrid', province: 'Madrid', country: 'Spain', country_code: 'ES' },\n * });\n */\n async create(body: components['schemas']['CreateCustomerRequest']) {\n const { data } = await this.client.POST('/v1/customers', { body });\n return data!.data as Customer;\n }\n\n /** Get a customer by ID. */\n async get(id: string) {\n const { data } = await this.client.GET('/v1/customers/{customer_id}', { params: { path: { customer_id: id } } });\n return data!.data as Customer;\n }\n\n /** Update a customer. Only provided fields are changed. */\n async update(id: string, body: components['schemas']['UpdateCustomerRequest']) {\n const { data } = await this.client.PUT('/v1/customers/{customer_id}', { params: { path: { customer_id: id } }, body });\n return data!.data as Customer;\n }\n\n /** Deactivate (soft-delete) a customer. */\n async deactivate(id: string) {\n await this.client.DELETE('/v1/customers/{customer_id}', { params: { path: { customer_id: id } } });\n }\n}\n","import type { BeeLClient } from '../http/client';\nimport type { components, operations } from '../generated/schema';\n\ntype Product = components['schemas']['Product'];\ntype Pagination = components['schemas']['Pagination'];\ntype ListParams = operations['listProducts']['parameters']['query'];\n\nexport class ProductsResource {\n constructor(private client: BeeLClient) {}\n\n /**\n * List products with optional filters and pagination.\n *\n * @example\n * const { products, pagination } = await beel.products.list({ category: 'SERVICE' });\n */\n async list(params?: ListParams) {\n const { data } = await this.client.GET('/v1/products', { params: { query: params } });\n return data!.data as { products: Product[]; pagination: Pagination };\n }\n\n /**\n * Create a new product or service.\n *\n * @example\n * const product = await beel.products.create({\n * name: 'Consulting',\n * code: 'CONS-001',\n * category: 'SERVICE',\n * default_price: 100,\n * main_tax: { type: 'IVA', percentage: 21 },\n * });\n */\n async create(body: components['schemas']['CreateProductRequest']) {\n const { data } = await this.client.POST('/v1/products', { body });\n return data!.data as Product;\n }\n\n /** Get a product by ID. */\n async get(id: string) {\n const { data } = await this.client.GET('/v1/products/{product_id}', { params: { path: { product_id: id } } });\n return data!.data as Product;\n }\n\n /** Update a product. Only provided fields are changed. */\n async update(id: string, body: components['schemas']['UpdateProductRequest']) {\n const { data } = await this.client.PUT('/v1/products/{product_id}', { params: { path: { product_id: id } }, body });\n return data!.data as Product;\n }\n\n /** Delete a product permanently. */\n async delete(id: string) {\n await this.client.DELETE('/v1/products/{product_id}', { params: { path: { product_id: id } } });\n }\n\n /**\n * Search products by name or code. Returns up to `limit` results.\n *\n * @example\n * const results = await beel.products.search('consulting', 5);\n */\n async search(q: string, limit?: number) {\n const { data } = await this.client.GET('/v1/products/search', { params: { query: { q, limit } } });\n return data!.data as Product[];\n }\n}\n","import type { BeeLClient } from '../http/client';\n\nexport class ConfigurationResource {\n constructor(private client: BeeLClient) {}\n\n /** Get the current tax configuration (default VAT, IRPF, etc.). */\n async getTaxConfig() {\n const { data } = await this.client.GET('/v1/configuration/taxes');\n return data!.data;\n }\n\n /** Update tax configuration. */\n async updateTaxConfig(body: any) {\n const { data } = await this.client.PUT('/v1/configuration/taxes', { body });\n return data!.data;\n }\n\n /** Get available tax types (IVA/IGIC rates, IRPF types, equivalence surcharges). */\n async getTaxTypes() {\n const { data } = await this.client.GET('/v1/configuration/tax-types');\n return data!.data;\n }\n\n /** Get invoice customization options (logo, colors, footer text, etc.). */\n async getInvoiceCustomizationOptions() {\n const { data } = await this.client.GET('/v1/configuration/invoice-customization-options');\n return data!.data;\n }\n\n /** Update the user's preferred language (es, en, ca). */\n async updateLanguage(language: string) {\n const { data } = await this.client.PUT('/v1/configuration/language', { body: { language } as any });\n return data!.data;\n }\n\n /** Get VeriFactu configuration (enabled, certificate status, etc.). */\n async getVerifactu() {\n const { data } = await this.client.GET('/v1/configuration/verifactu');\n return data!.data;\n }\n\n /** Update VeriFactu configuration. */\n async updateVerifactu(body: any) {\n const { data } = await this.client.PUT('/v1/configuration/verifactu', { body });\n return data!.data;\n }\n}\n","import type { BeeLClient } from '../http/client';\n\nexport class SeriesResource {\n constructor(private client: BeeLClient) {}\n\n /**\n * List all invoice series. Optionally filter by active status.\n *\n * @example\n * const series = await beel.series.list();\n * const activeSeries = await beel.series.list(true);\n */\n async list(active?: boolean) {\n const { data } = await this.client.GET('/v1/configuration/series', {\n params: { query: active !== undefined ? { active } : undefined },\n });\n return data!.data;\n }\n\n /** Create a new invoice series (e.g. \"A-2026\", \"RECT\"). */\n async create(body: any) {\n const { data } = await this.client.POST('/v1/configuration/series', { body });\n return data!.data;\n }\n\n /** Update a series (name, description, etc.). */\n async update(id: string, body: any) {\n const { data } = await this.client.PUT('/v1/configuration/series/{series_id}', {\n params: { path: { series_id: id } },\n body,\n });\n return data!.data;\n }\n\n /** Delete an invoice series. Only empty series can be deleted. */\n async delete(id: string) {\n await this.client.DELETE('/v1/configuration/series/{series_id}', {\n params: { path: { series_id: id } },\n });\n }\n\n /** Set a series as the default for new invoices. */\n async setDefault(id: string) {\n const { data } = await this.client.POST('/v1/configuration/series/{series_id}/default', {\n params: { path: { series_id: id } },\n });\n return data!.data;\n }\n}\n","import type { BeeLClient } from '../http/client';\n\nexport class NifResource {\n constructor(private client: BeeLClient) {}\n\n /**\n * Validate a Spanish NIF/CIF against the AEAT tax registry.\n *\n * @example\n * const result = await beel.nif.validate('B12345678');\n * console.log(result.valid, result.name);\n */\n async validate(nif: string) {\n const { data } = await this.client.POST('/v1/nif/validate', { body: { nif } as any });\n return data!.data;\n }\n}\n","import { createBeeLClient, type BeeLConfig } from './http/client';\nimport { InvoicesResource } from './resources/invoices';\nimport { CustomersResource } from './resources/customers';\nimport { ProductsResource } from './resources/products';\nimport { ConfigurationResource } from './resources/configuration';\nimport { SeriesResource } from './resources/series';\nimport { NifResource } from './resources/nif';\n\n/**\n * BeeL SDK Client\n *\n * @example\n * ```typescript\n * import { BeeL } from '@beel_es/sdk';\n *\n * const beel = new BeeL({ apiKey: 'beel_sk_live_...' });\n *\n * const invoice = await beel.invoices.create({\n * type: 'STANDARD',\n * recipient: { customer_id: 'uuid' },\n * lines: [{ description: 'Service', quantity: 1, unit_price: 100 }],\n * });\n * ```\n */\nexport class BeeL {\n readonly invoices: InvoicesResource;\n readonly customers: CustomersResource;\n readonly products: ProductsResource;\n readonly configuration: ConfigurationResource;\n readonly series: SeriesResource;\n readonly nif: NifResource;\n\n constructor(config: BeeLConfig) {\n const client = createBeeLClient(config);\n this.invoices = new InvoicesResource(client);\n this.customers = new CustomersResource(client);\n this.products = new ProductsResource(client);\n this.configuration = new ConfigurationResource(client);\n this.series = new SeriesResource(client);\n this.nif = new NifResource(client);\n }\n\n /**\n * Download an invoice PDF as a Buffer.\n *\n * @example\n * ```typescript\n * const { buffer, fileName } = await beel.downloadPdf('invoice-uuid');\n * fs.writeFileSync(fileName, buffer);\n * ```\n */\n async downloadPdf(invoiceId: string): Promise<{ buffer: Buffer; fileName: string }> {\n const pdf = await this.invoices.getPdf(invoiceId);\n const response = await fetch(pdf.download_url);\n if (!response.ok) throw new Error(`Failed to download PDF: ${response.status}`);\n const arrayBuffer = await response.arrayBuffer();\n return { buffer: Buffer.from(arrayBuffer), fileName: pdf.file_name };\n }\n}\n","import { createHmac, timingSafeEqual } from 'crypto';\n\n/**\n * Webhook signature verification for BeeL webhooks\n * \n * Every webhook delivery includes a `BeeL-Signature` header that must be verified\n * to ensure the webhook came from BeeL and hasn't been tampered with.\n * \n * ## Security Requirements\n * \n * 1. **Always verify** the signature before processing the webhook\n * 2. **Use constant-time comparison** to prevent timing attacks\n * 3. **Reject old events** (older than 5 minutes)\n * 4. **Use raw request body** (before parsing JSON)\n * \n * ## Header Format\n * \n * ```\n * BeeL-Signature: t=1741362026,v1=3c4f7a2e1b9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d0e9f8a7b6c5d4e3f\n * ```\n * \n * Where:\n * - `t` = Unix timestamp when the webhook was sent\n * - `v1` = HMAC-SHA256 signature of the payload\n * \n * @example Express.js\n * ```typescript\n * import express from 'express';\n * import { WebhookVerifier } from '@beel/sdk';\n * \n * const verifier = new WebhookVerifier('your_webhook_secret');\n * \n * app.post('/webhooks/beel', express.raw({ type: 'application/json' }), (req, res) => {\n * const signature = req.headers['beel-signature'] as string;\n * const rawBody = req.body.toString('utf8');\n * \n * try {\n * const event = verifier.verify(rawBody, signature);\n * \n * if (event.type === 'verifactu.status.updated') {\n * console.log('VeriFactu status:', event.data.new_status);\n * if (event.data.new_status === 'ACCEPTED') {\n * console.log('QR URL:', event.data.qr_url);\n * }\n * }\n * \n * res.status(200).send('OK');\n * } catch (error) {\n * console.error('Invalid webhook:', error.message);\n * res.status(400).send('Invalid signature');\n * }\n * });\n * ```\n */\nexport class WebhookVerifier {\n private readonly secret: string;\n private readonly toleranceSeconds: number;\n \n /**\n * Creates a new WebhookVerifier\n * \n * @param secret - Your webhook secret from BeeL dashboard\n * @param toleranceSeconds - Maximum age of webhook events (default: 300 = 5 minutes)\n */\n constructor(secret: string, toleranceSeconds: number = 300) {\n if (!secret || secret.trim().length === 0) {\n throw new Error('Webhook secret is required');\n }\n this.secret = secret;\n this.toleranceSeconds = toleranceSeconds;\n }\n \n /**\n * Verify a webhook signature and return the parsed event\n * \n * @param rawBody - Raw request body (string or Buffer, before JSON parsing)\n * @param signatureHeader - Value of the `BeeL-Signature` header\n * @returns Parsed webhook event\n * @throws {WebhookVerificationError} If signature is invalid or event is too old\n * \n * @example Basic usage\n * ```typescript\n * const verifier = new WebhookVerifier('your_secret');\n * const event = verifier.verify(rawBody, signature);\n * \n * if (event.type === 'verifactu.status.updated') {\n * console.log('Invoice:', event.data.invoice_number);\n * console.log('Status:', event.data.new_status);\n * }\n * ```\n */\n verify<T extends WebhookEvent = WebhookEvent>(\n rawBody: string | Buffer,\n signatureHeader: string | undefined\n ): T {\n if (!signatureHeader) {\n throw new WebhookVerificationError('Missing BeeL-Signature header');\n }\n \n // Parse signature header\n const { timestamp, signature } = this.parseSignatureHeader(signatureHeader);\n \n // Check timestamp tolerance\n const now = Math.floor(Date.now() / 1000);\n const age = Math.abs(now - timestamp);\n \n if (age > this.toleranceSeconds) {\n throw new WebhookVerificationError(\n `Webhook timestamp too old (${age}s ago, max ${this.toleranceSeconds}s allowed)`\n );\n }\n \n // Verify signature\n const bodyString = Buffer.isBuffer(rawBody) ? rawBody.toString('utf8') : rawBody;\n const expectedSignature = this.computeSignature(timestamp, bodyString);\n \n if (!this.secureCompare(signature, expectedSignature)) {\n throw new WebhookVerificationError('Invalid webhook signature');\n }\n \n // Parse and return event\n try {\n return JSON.parse(bodyString);\n } catch (error) {\n throw new WebhookVerificationError('Invalid JSON in webhook body');\n }\n }\n \n /**\n * Parse the BeeL-Signature header\n * \n * Format: `t=1741362026,v1=3c4f7a2e...`\n */\n private parseSignatureHeader(header: string): { timestamp: number; signature: string } {\n const parts = header.split(',');\n let timestamp: number | undefined;\n let signature: string | undefined;\n \n for (const part of parts) {\n const [key, value] = part.split('=', 2);\n if (key === 't') {\n timestamp = parseInt(value, 10);\n } else if (key === 'v1') {\n signature = value;\n }\n }\n \n if (!timestamp || !signature) {\n throw new WebhookVerificationError(\n 'Invalid signature header format (expected: t=timestamp,v1=signature)'\n );\n }\n \n if (isNaN(timestamp)) {\n throw new WebhookVerificationError('Invalid timestamp in signature header');\n }\n \n return { timestamp, signature };\n }\n \n /**\n * Compute HMAC-SHA256 signature\n * \n * Algorithm:\n * 1. Build signed payload: `{timestamp}.{raw_body}`\n * 2. Compute: HMAC-SHA256(secret, signed_payload)\n * 3. Return hex digest\n */\n private computeSignature(timestamp: number, body: string): string {\n const signedPayload = `${timestamp}.${body}`;\n return createHmac('sha256', this.secret)\n .update(signedPayload, 'utf8')\n .digest('hex');\n }\n \n /**\n * Constant-time string comparison to prevent timing attacks\n */\n private secureCompare(a: string, b: string): boolean {\n if (a.length !== b.length) {\n return false;\n }\n \n const bufferA = Buffer.from(a, 'utf8');\n const bufferB = Buffer.from(b, 'utf8');\n \n return timingSafeEqual(bufferA, bufferB);\n }\n}\n\n/**\n * Webhook verification error\n */\nexport class WebhookVerificationError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'WebhookVerificationError';\n }\n}\n\n/**\n * Webhook event types (auto-generated from webhook-receiver-api.yaml)\n * \n * These types are generated by running `npm run generate:webhooks`\n * from openapi/webhook-receiver-api.yaml\n */\nexport type {\n WebhookEventEnvelope,\n VeriFactuStatusUpdatedEvent,\n VeriFactuStatusUpdatedData,\n VeriFactuStatus,\n} from '../generated-webhooks';\n\n/**\n * Union type of all possible webhook events\n */\nexport type WebhookEvent = VeriFactuStatusUpdatedEvent;\n\n// Import for internal use\nimport type {\n VeriFactuStatusUpdatedEvent,\n} from '../generated-webhooks';\n","import type { components } from '../generated/schema';\n\ntype CreateCustomerRequest = components['schemas']['CreateCustomerRequest'];\ntype Address = components['schemas']['Address'];\n\n/**\n * Fluent builder for creating customers with a clean, readable API.\n *\n * @example\n * ```typescript\n * const customer = CustomerBuilder.create()\n * .name('Acme Corporation SL')\n * .nif('B12345678')\n * .email('contact@acme.com')\n * .address('Calle Mayor', '1', '28001', 'Madrid', 'Madrid', 'Spain')\n * .build();\n * ```\n */\nexport class CustomerBuilder {\n private _name?: string;\n private _nif?: string;\n private _email?: string;\n private _phone?: string;\n private _address?: Address;\n private _notes?: string;\n\n private constructor() {}\n\n static create(): CustomerBuilder {\n return new CustomerBuilder();\n }\n\n name(name: string): this {\n this._name = name;\n return this;\n }\n\n nif(nif: string): this {\n this._nif = nif;\n return this;\n }\n\n email(email: string): this {\n this._email = email;\n return this;\n }\n\n phone(phone: string): this {\n this._phone = phone;\n return this;\n }\n\n address(street: string, number: string, postalCode: string, city: string, province: string, country: string, countryCode: string = 'ES'): this {\n this._address = { street, number, postal_code: postalCode, city, province, country, country_code: countryCode };\n return this;\n }\n\n notes(notes: string): this {\n this._notes = notes;\n return this;\n }\n\n build(): CreateCustomerRequest {\n if (!this._name || this._name.trim().length === 0) throw new Error('Legal name is required');\n if (!this._nif || this._nif.trim().length === 0) throw new Error('NIF/CIF is required');\n if (!this._address) throw new Error('Address is required');\n\n return {\n legal_name: this._name,\n nif: this._nif,\n email: this._email,\n phone: this._phone,\n address: this._address,\n notes: this._notes,\n };\n }\n}\n","import type { components } from '../generated/schema';\n\ntype CreateInvoiceRequest = components['schemas']['CreateInvoiceRequest'];\ntype InvoiceType = components['schemas']['InvoiceType'];\ntype Recipient = components['schemas']['Recipient'];\ntype InvoiceLine = CreateInvoiceRequest['lines'][number];\n\n/**\n * Fluent builder for creating invoices with a clean, readable API.\n *\n * @example\n * ```typescript\n * const invoice = InvoiceBuilder.create()\n * .forCustomer('customer-uuid')\n * .addLine('Consulting services', 10, 85.50)\n * .build();\n * ```\n */\nexport class InvoiceBuilder {\n private _type: InvoiceType = 'STANDARD';\n private _operationDate?: string;\n private _dueDate?: string;\n private _customerId?: string;\n private _lines: InvoiceLine[] = [];\n private _notes?: string;\n private _seriesId?: string;\n private _metadata?: Record<string, any>;\n\n private constructor() {}\n\n static create(): InvoiceBuilder {\n return new InvoiceBuilder();\n }\n\n type(type: InvoiceType): this {\n this._type = type;\n return this;\n }\n\n forCustomer(customerId: string): this {\n this._customerId = customerId;\n return this;\n }\n\n operationDate(date: string | Date): this {\n this._operationDate = date instanceof Date ? date.toISOString().split('T')[0] : date;\n return this;\n }\n\n dueDate(date: string | Date): this {\n this._dueDate = date instanceof Date ? date.toISOString().split('T')[0] : date;\n return this;\n }\n\n addLine(description: string, quantity: number, unitPrice: number, discountPercentage: number = 0): this {\n this._lines.push({ description, quantity, unit_price: unitPrice, discount_percentage: discountPercentage });\n return this;\n }\n\n addLineObject(line: InvoiceLine): this {\n this._lines.push(line);\n return this;\n }\n\n notes(notes: string): this {\n this._notes = notes;\n return this;\n }\n\n series(id: string): this {\n this._seriesId = id;\n return this;\n }\n\n metadata(data: Record<string, any>): this {\n this._metadata = data;\n return this;\n }\n\n build(): CreateInvoiceRequest {\n if (!this._customerId) throw new Error('Customer ID is required');\n if (this._lines.length === 0) throw new Error('At least one invoice line is required');\n\n const recipient: Recipient = { customer_id: this._customerId };\n\n return {\n type: this._type,\n operation_date: this._operationDate,\n due_date: this._dueDate,\n recipient,\n lines: this._lines,\n notes: this._notes,\n series_id: this._seriesId,\n metadata: this._metadata,\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;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,MAAiC;AACxC,SAAK,YAAY;AACjB,WAAO;AAAA,EACT;AAAA,EAEA,QAA8B;AAC5B,QAAI,CAAC,KAAK,YAAa,OAAM,IAAI,MAAM,yBAAyB;AAChE,QAAI,KAAK,OAAO,WAAW,EAAG,OAAM,IAAI,MAAM,uCAAuC;AAErF,UAAM,YAAuB,EAAE,aAAa,KAAK,YAAY;AAE7D,WAAO;AAAA,MACL,MAAM,KAAK;AAAA,MACX,gBAAgB,KAAK;AAAA,MACrB,UAAU,KAAK;AAAA,MACf;AAAA,MACA,OAAO,KAAK;AAAA,MACZ,OAAO,KAAK;AAAA,MACZ,WAAW,KAAK;AAAA,MAChB,UAAU,KAAK;AAAA,IACjB;AAAA,EACF;AACF;","names":["createClient","import_crypto"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/http/client.ts","../src/http/middleware.ts","../src/core/errors.ts","../src/resources/invoices.ts","../src/resources/customers.ts","../src/resources/products.ts","../src/resources/configuration.ts","../src/resources/series.ts","../src/resources/nif.ts","../src/resources/accounts.ts","../src/resources/payment-connections.ts","../src/resources/company.ts","../src/client.ts","../src/webhooks/verifier.ts","../src/generated-webhooks/models/AccountClaimedEvent.ts","../src/generated-webhooks/models/CompanyCreatedEvent.ts","../src/generated-webhooks/models/InvoiceEmailSentEvent.ts","../src/generated-webhooks/models/InvoiceIssuedEvent.ts","../src/generated-webhooks/models/InvoiceVoidedEvent.ts","../src/generated-webhooks/models/RecurringInvoicePausedEvent.ts","../src/generated-webhooks/models/RepresentationSignedEvent.ts","../src/generated-webhooks/models/VeriFactuStatusUpdatedEvent.ts","../src/generated-webhooks/models/VeriFactuSubmissionStatus.ts","../src/generated-webhooks/models/WebhookEventType.ts","../src/builders/customer-builder.ts","../src/builders/invoice-builder.ts"],"sourcesContent":["// ── Client ─────────────────────────────────────────────\nexport { BeeL } from './client';\nexport type { BeeLConfig } from './http/client';\n\n// ── Typed errors ───────────────────────────────────────\nexport {\n BeeLApiError,\n BeeLRateLimitError,\n BeeLValidationError,\n BeeLAuthError,\n BeeLNotFoundError,\n BeeLConflictError,\n} from './core/errors';\n\n// ── Webhook verification ───────────────────────────────\nexport { WebhookVerifier, WebhookVerificationError } from './webhooks/verifier';\nexport type { WebhookEvent } from './webhooks/verifier';\n\n// ── Webhook event types (auto-generated) ───────────────\nexport type {\n WebhookEventEnvelope,\n VeriFactuStatusUpdatedEvent,\n InvoiceIssuedEvent,\n InvoiceVoidedEvent,\n InvoiceEmailSentEvent,\n RecurringInvoicePausedEvent,\n AccountClaimedEvent,\n CompanyCreatedEvent,\n RepresentationSignedEvent,\n WebhookTestEvent,\n WebhookEventDataVeriFactuStatusUpdated,\n WebhookEventDataInvoiceIssued,\n WebhookEventDataInvoiceVoided,\n WebhookEventDataInvoiceEmailSent,\n WebhookEventDataRecurringInvoicePaused,\n WebhookEventDataAccountClaimed,\n WebhookEventDataCompanyCreated,\n WebhookEventDataRepresentationSigned,\n} from './generated-webhooks';\nexport { VeriFactuSubmissionStatus, WebhookEventType } from './generated-webhooks';\n\n// Backwards-compatible aliases for names removed by the webhook spec regeneration\nimport type {\n WebhookEventDataVeriFactuStatusUpdated as _VeriFactuData,\n VeriFactuSubmissionStatus as _VeriFactuStatus,\n} from './generated-webhooks';\n/** @deprecated Renamed in the contract — use `WebhookEventDataVeriFactuStatusUpdated`. */\nexport type VeriFactuStatusUpdatedData = _VeriFactuData;\n/** @deprecated Renamed in the contract — use `VeriFactuSubmissionStatus`. */\nexport type VeriFactuStatus = _VeriFactuStatus;\n\n// ── Accounts & companies (multi-NIF) ───────────────────\nexport {\n AccountsResource,\n AccountScope,\n AccountMembersResource,\n AccountInvitationsResource,\n AccountWebhooksResource,\n AccountCompaniesResource,\n} from './resources/accounts';\nexport {\n CompanyScope,\n CompanyInvoicesResource,\n CompanyCustomersResource,\n CompanyProductsResource,\n CompanySeriesResource,\n CompanyRecurringInvoicesResource,\n CompanyInvoiceScheduleResource,\n} from './resources/company';\nexport { CatalogsResource } from './resources/configuration';\nexport {\n CompanyTaxConfigurationResource,\n CompanyVeriFactuConfigurationResource,\n} from './resources/company';\nexport {\n CompanyPaymentConnectionsResource,\n CompanyPaymentEventsResource,\n} from './resources/payment-connections';\n\n// ── Builders ───────────────────────────────────────────\nexport { CustomerBuilder } from './builders/customer-builder';\nexport { InvoiceBuilder } from './builders/invoice-builder';\n\n// ── Generated types ────────────────────────────────────\nexport type { components, operations, paths } from './generated/schema';\n","import createClient from 'openapi-fetch';\nimport type { paths } from '../generated/schema';\nimport { requestMiddleware, errorMiddleware, createRetryMiddleware } from './middleware';\n\nexport interface BeeLConfig {\n /** API key (beel_sk_live_* or beel_sk_test_*) */\n apiKey: string;\n /** Base URL. Defaults to https://app.beel.es/api */\n baseUrl?: string;\n /** Max retries on 429/5xx. Default: 3 */\n maxRetries?: number;\n /** Initial retry delay in ms. Default: 500 */\n retryDelayMs?: number;\n /** Max retry delay in ms. Default: 30000 */\n maxRetryDelayMs?: number;\n /** Auto-generate Idempotency-Key for POST requests. Default: true */\n autoIdempotencyKey?: boolean;\n}\n\nexport function createBeeLClient(config: BeeLConfig) {\n const client = createClient<paths>({\n baseUrl: config.baseUrl ?? 'https://app.beel.es/api',\n headers: {\n Authorization: `Bearer ${config.apiKey}`,\n },\n });\n\n // Register middleware in order\n client.use(requestMiddleware);\n\n client.use(errorMiddleware);\n\n client.use(\n createRetryMiddleware({\n maxRetries: config.maxRetries ?? 3,\n initialDelayMs: config.retryDelayMs ?? 500,\n maxDelayMs: config.maxRetryDelayMs ?? 30_000,\n }),\n );\n\n return client;\n}\n\nexport type BeeLClient = ReturnType<typeof createBeeLClient>;\n","import { randomUUID } from 'crypto';\nimport type { Middleware } from 'openapi-fetch';\nimport {\n throwApiError,\n BeeLApiError,\n BeeLRateLimitError,\n} from '../core/errors';\n\n/**\n * Ensures POST/PUT/PATCH requests always have a JSON body and Content-Type.\n * Also adds Idempotency-Key to POST requests.\n */\nexport const requestMiddleware: Middleware = {\n async onRequest({ request }) {\n const method = request.method;\n\n // Ensure POST/PUT/PATCH always send a JSON body (API rejects empty body)\n if (['POST', 'PUT', 'PATCH'].includes(method)) {\n const hasBody = request.headers.get('content-type')?.includes('application/json');\n if (!hasBody) {\n const clone = new Request(request, {\n body: request.body ?? '{}',\n headers: new Headers(request.headers),\n });\n clone.headers.set('Content-Type', 'application/json');\n\n if (method === 'POST' && !clone.headers.has('Idempotency-Key')) {\n clone.headers.set('Idempotency-Key', randomUUID());\n }\n return clone;\n }\n }\n\n // Add Idempotency-Key to POST requests that already have a body\n if (method === 'POST' && !request.headers.has('Idempotency-Key')) {\n request.headers.set('Idempotency-Key', randomUUID());\n }\n\n return request;\n },\n};\n\n/**\n * Maps non-2xx responses to typed BeeLApiError subclasses.\n */\nexport const errorMiddleware: Middleware = {\n async onResponse({ response }) {\n if (!response.ok) {\n const body = await response.json().catch(() => null);\n throwApiError(response.status, body);\n }\n return response;\n },\n};\n\n/**\n * Creates a retry middleware with exponential backoff.\n * Retries on 429 and 5xx. Does NOT retry 4xx client errors.\n */\nexport function createRetryMiddleware(options: {\n maxRetries: number;\n initialDelayMs: number;\n maxDelayMs: number;\n}): Middleware {\n return {\n async onError({ error, request }) {\n // Only retry retryable errors\n if (!(error instanceof BeeLApiError)) return;\n if (!(error instanceof BeeLRateLimitError) && error.statusCode < 500) return;\n\n for (let attempt = 0; attempt < options.maxRetries; attempt++) {\n const delay =\n error instanceof BeeLRateLimitError\n ? error.retryAfterSeconds * 1000\n : Math.min(\n options.initialDelayMs * Math.pow(2, attempt) + Math.random() * options.initialDelayMs,\n options.maxDelayMs,\n );\n\n await new Promise((r) => setTimeout(r, delay));\n\n try {\n // Re-generate idempotency key for POST retries\n if (request.method === 'POST') {\n request.headers.set('Idempotency-Key', randomUUID());\n }\n const response = await fetch(request.clone());\n if (response.ok) return response;\n\n const body = await response.json().catch(() => null);\n throwApiError(response.status, body);\n } catch (retryError) {\n if (!(retryError instanceof BeeLApiError)) throw retryError;\n if (!(retryError instanceof BeeLRateLimitError) && retryError.statusCode < 500) throw retryError;\n // Continue retrying\n if (attempt === options.maxRetries - 1) throw retryError;\n }\n }\n },\n };\n}\n","/**\n * Base error for all BeeL API errors.\n */\nexport class BeeLApiError extends Error {\n public readonly statusCode: number;\n public readonly code: string;\n public readonly details?: Record<string, string>;\n public readonly requestId?: string;\n\n constructor(\n message: string,\n statusCode: number,\n code: string,\n details?: Record<string, string>,\n requestId?: string,\n ) {\n super(message);\n this.name = 'BeeLApiError';\n this.statusCode = statusCode;\n this.code = code;\n this.details = details;\n this.requestId = requestId;\n }\n}\n\n/** 429 — Rate limit exceeded */\nexport class BeeLRateLimitError extends BeeLApiError {\n public readonly retryAfterSeconds: number;\n\n constructor(message: string, retryAfterSeconds: number, requestId?: string) {\n super(message, 429, 'RATE_LIMIT_EXCEEDED', undefined, requestId);\n this.name = 'BeeLRateLimitError';\n this.retryAfterSeconds = retryAfterSeconds;\n }\n}\n\n/** 422 — Validation or business rule error */\nexport class BeeLValidationError extends BeeLApiError {\n constructor(\n message: string,\n details?: Record<string, string>,\n requestId?: string,\n ) {\n super(message, 422, 'UNPROCESSABLE_ENTITY', details, requestId);\n this.name = 'BeeLValidationError';\n }\n}\n\n/** 401 / 403 — Authentication or authorization error */\nexport class BeeLAuthError extends BeeLApiError {\n constructor(message: string, statusCode: 401 | 403, requestId?: string) {\n super(\n message,\n statusCode,\n statusCode === 401 ? 'UNAUTHORIZED' : 'FORBIDDEN',\n undefined,\n requestId,\n );\n this.name = 'BeeLAuthError';\n }\n}\n\n/** 404 — Resource not found */\nexport class BeeLNotFoundError extends BeeLApiError {\n constructor(message: string, requestId?: string) {\n super(message, 404, 'NOT_FOUND', undefined, requestId);\n this.name = 'BeeLNotFoundError';\n }\n}\n\n/** 409 — Conflict (e.g. duplicate resource) */\nexport class BeeLConflictError extends BeeLApiError {\n constructor(message: string, requestId?: string) {\n super(message, 409, 'CONFLICT', undefined, requestId);\n this.name = 'BeeLConflictError';\n }\n}\n\n/**\n * Maps a raw HTTP error response to a typed BeeLApiError subclass.\n */\nexport function throwApiError(status: number, body: unknown): never {\n const parsed = body as Record<string, any> | null;\n const errorData = parsed?.error ?? parsed;\n const message = errorData?.message ?? `API error ${status}`;\n const code = errorData?.code ?? 'UNKNOWN';\n const details = errorData?.details;\n const requestId = parsed?.meta?.request_id;\n\n switch (status) {\n case 401:\n case 403:\n throw new BeeLAuthError(message, status as 401 | 403, requestId);\n case 404:\n throw new BeeLNotFoundError(message, requestId);\n case 409:\n throw new BeeLConflictError(message, requestId);\n case 422:\n throw new BeeLValidationError(message, details, requestId);\n case 429: {\n const retryAfter = errorData?.retry_after ?? 60;\n throw new BeeLRateLimitError(message, retryAfter, requestId);\n }\n default:\n throw new BeeLApiError(message, status, code, details, requestId);\n }\n}\n","import type { BeeLClient } from '../http/client';\nimport type { components, operations } from '../generated/schema';\n\ntype Invoice = components['schemas']['Invoice'];\ntype Pagination = components['schemas']['Pagination'];\ntype ListParams = operations['listInvoices']['parameters']['query'];\n\nexport class InvoicesResource {\n constructor(private client: BeeLClient) {}\n\n /**\n * List invoices with optional filters and pagination.\n *\n * @example\n * const { invoices, pagination } = await beel.invoices.list({ status: 'ISSUED', limit: 20 });\n */\n async list(params?: ListParams) {\n const { data } = await this.client.GET('/v1/invoices', { params: { query: params } });\n return data!.data as { invoices: Invoice[]; pagination: Pagination };\n }\n\n /**\n * Create a new invoice. An idempotency key is automatically added.\n *\n * @example\n * const invoice = await beel.invoices.create({\n * type: 'STANDARD',\n * recipient: { customer_id: 'uuid' },\n * lines: [{ description: 'Service', quantity: 1, unit_price: 100, discount_percentage: 0 }],\n * });\n */\n async create(body: components['schemas']['CreateInvoiceRequest']) {\n const { data } = await this.client.POST('/v1/invoices', { body });\n return data!.data as Invoice;\n }\n\n /** Get an invoice by ID. */\n async get(id: string) {\n const { data } = await this.client.GET('/v1/invoices/{invoice_id}', { params: { path: { invoice_id: id } } });\n return data!.data as Invoice;\n }\n\n /** Update a draft invoice. Only draft invoices can be updated. */\n async update(id: string, body: components['schemas']['UpdateInvoiceRequest']) {\n const { data } = await this.client.PUT('/v1/invoices/{invoice_id}', { params: { path: { invoice_id: id } }, body });\n return data!.data as Invoice;\n }\n\n /** Delete a draft invoice. Only draft invoices can be deleted. */\n async delete(id: string) {\n await this.client.DELETE('/v1/invoices/{invoice_id}', { params: { path: { invoice_id: id } } });\n }\n\n /** Duplicate an invoice, optionally into a different series. */\n async duplicate(id: string, options?: { series_id?: string; notes?: string }) {\n const { data } = await this.client.POST('/v1/invoices/{invoice_id}/duplicate', { params: { path: { invoice_id: id } }, body: options as any });\n return data!.data as Invoice;\n }\n\n /**\n * Issue a draft invoice. Assigns an invoice number and triggers VeriFactu submission.\n * @param options.wait_for_pdf - If true, waits for PDF generation before returning.\n */\n async issue(id: string, options?: { wait_for_pdf?: boolean }) {\n const { data } = await this.client.POST('/v1/invoices/{invoice_id}/issue', { params: { path: { invoice_id: id }, query: options } });\n return data!.data as Invoice;\n }\n\n /**\n * Mark an invoice as paid.\n * @param options.payment_date - Payment date (defaults to today).\n * @param options.payment_method - Payment method details.\n */\n async markPaid(id: string, options?: { payment_date?: string; payment_method?: any }) {\n const { data } = await this.client.POST('/v1/invoices/{invoice_id}/mark-paid', { params: { path: { invoice_id: id } }, body: options as any });\n return data!.data as Invoice;\n }\n\n /** Mark an invoice as sent (e.g. delivered by other means). */\n async markSent(id: string, options?: { sent_at?: string }) {\n const { data } = await this.client.POST('/v1/invoices/{invoice_id}/mark-sent', { params: { path: { invoice_id: id } }, body: options as any });\n return data!.data as Invoice;\n }\n\n /** Revert a paid/sent invoice back to issued status. */\n async revertToIssued(id: string) {\n const { data } = await this.client.POST('/v1/invoices/{invoice_id}/revert-to-issued', { params: { path: { invoice_id: id } } });\n return data!.data as Invoice;\n }\n\n /**\n * Void an issued invoice. Requires a reason (min 10 chars).\n *\n * @example\n * await beel.invoices.void('id', { reason: 'Duplicate invoice sent in error' });\n */\n async void(id: string, params: { reason: string; void_date?: string }) {\n const { data } = await this.client.POST('/v1/invoices/{invoice_id}/void', { params: { path: { invoice_id: id } }, body: params as any });\n return data!.data as Invoice;\n }\n\n /** Create a corrective invoice that references the original. */\n async createCorrective(id: string, body: components['schemas']['CreateCorrectiveInvoiceRequest']) {\n const { data } = await this.client.POST('/v1/invoices/{invoice_id}/corrective', { params: { path: { invoice_id: id } }, body });\n return data!.data as Invoice;\n }\n\n /** Schedule a draft invoice to be issued on a future date. */\n async schedule(id: string, params: { scheduled_for: string; action?: string }) {\n const { data } = await this.client.POST('/v1/invoices/{invoice_id}/schedule', { params: { path: { invoice_id: id } }, body: params as any });\n return data!.data as Invoice;\n }\n\n /** Cancel a scheduled invoice, returning it to draft. */\n async unschedule(id: string) {\n const { data } = await this.client.POST('/v1/invoices/{invoice_id}/unschedule', { params: { path: { invoice_id: id } } });\n return data!.data as Invoice;\n }\n\n /** Change the scheduled date of a scheduled invoice. */\n async reschedule(id: string, params: { scheduled_for: string }) {\n const { data } = await this.client.PATCH('/v1/invoices/{invoice_id}/reschedule', { params: { path: { invoice_id: id } }, body: params as any });\n return data!.data as Invoice;\n }\n\n /**\n * Get a pre-signed URL to download the invoice PDF.\n * The URL expires in 5 minutes. Use `beel.downloadPdf(id)` for a simpler Buffer download.\n */\n async getPdf(id: string) {\n const { data } = await this.client.GET('/v1/invoices/{invoice_id}/pdf', { params: { path: { invoice_id: id } } });\n return data!.data as { download_url: string; expires_in_seconds: number; file_name: string };\n }\n\n /** Send an invoice by email. Uses the customer's email by default. */\n async sendEmail(id: string, options?: { to?: string[]; cc?: string[]; subject?: string; message?: string }) {\n const { data } = await this.client.POST('/v1/invoices/{invoice_id}/send', { params: { path: { invoice_id: id } }, body: options as any });\n return data!.data;\n }\n}\n","import type { BeeLClient } from '../http/client';\nimport type { components, operations } from '../generated/schema';\n\ntype Customer = components['schemas']['Customer'];\ntype Pagination = components['schemas']['Pagination'];\ntype ListParams = operations['listCustomers']['parameters']['query'];\n\nexport class CustomersResource {\n constructor(private client: BeeLClient) {}\n\n /**\n * List customers with optional filters and pagination.\n *\n * @example\n * const { customers, pagination } = await beel.customers.list({ search: 'Acme', limit: 10 });\n */\n async list(params?: ListParams) {\n const { data } = await this.client.GET('/v1/customers', { params: { query: params } });\n return data!.data as { customers: Customer[]; pagination: Pagination };\n }\n\n /**\n * Create a new customer.\n *\n * @example\n * const customer = await beel.customers.create({\n * legal_name: 'Acme SL',\n * nif: 'B12345678',\n * address: { street: 'Calle Mayor', number: '1', postal_code: '28001', city: 'Madrid', province: 'Madrid', country: 'Spain', country_code: 'ES' },\n * });\n */\n async create(body: components['schemas']['CreateCustomerRequest']) {\n const { data } = await this.client.POST('/v1/customers', { body });\n return data!.data as Customer;\n }\n\n /** Get a customer by ID. */\n async get(id: string) {\n const { data } = await this.client.GET('/v1/customers/{customer_id}', { params: { path: { customer_id: id } } });\n return data!.data as Customer;\n }\n\n /** Update a customer. Only provided fields are changed. */\n async update(id: string, body: components['schemas']['UpdateCustomerRequest']) {\n const { data } = await this.client.PUT('/v1/customers/{customer_id}', { params: { path: { customer_id: id } }, body });\n return data!.data as Customer;\n }\n\n /** Deactivate (soft-delete) a customer. */\n async deactivate(id: string) {\n await this.client.DELETE('/v1/customers/{customer_id}', { params: { path: { customer_id: id } } });\n }\n}\n","import type { BeeLClient } from '../http/client';\nimport type { components, operations } from '../generated/schema';\n\ntype Product = components['schemas']['Product'];\ntype Pagination = components['schemas']['Pagination'];\ntype ListParams = operations['listProducts']['parameters']['query'];\n\nexport class ProductsResource {\n constructor(private client: BeeLClient) {}\n\n /**\n * List products with optional filters and pagination.\n *\n * @example\n * const { products, pagination } = await beel.products.list({ category: 'SERVICE' });\n */\n async list(params?: ListParams) {\n const { data } = await this.client.GET('/v1/products', { params: { query: params } });\n return data!.data as { products: Product[]; pagination: Pagination };\n }\n\n /**\n * Create a new product or service.\n *\n * @example\n * const product = await beel.products.create({\n * name: 'Consulting',\n * code: 'CONS-001',\n * category: 'SERVICE',\n * default_price: 100,\n * main_tax: { type: 'IVA', percentage: 21 },\n * });\n */\n async create(body: components['schemas']['CreateProductRequest']) {\n const { data } = await this.client.POST('/v1/products', { body });\n return data!.data as Product;\n }\n\n /** Get a product by ID. */\n async get(id: string) {\n const { data } = await this.client.GET('/v1/products/{product_id}', { params: { path: { product_id: id } } });\n return data!.data as Product;\n }\n\n /** Update a product. Only provided fields are changed. */\n async update(id: string, body: components['schemas']['UpdateProductRequest']) {\n const { data } = await this.client.PUT('/v1/products/{product_id}', { params: { path: { product_id: id } }, body });\n return data!.data as Product;\n }\n\n /** Delete a product permanently. */\n async delete(id: string) {\n await this.client.DELETE('/v1/products/{product_id}', { params: { path: { product_id: id } } });\n }\n\n /**\n * Search products by name or code. Returns up to `limit` results.\n *\n * @example\n * const results = await beel.products.search('consulting', 5);\n */\n async search(q: string, limit?: number) {\n const { data } = await this.client.GET('/v1/products/search', { params: { query: { q, limit } } });\n return data!.data as Product[];\n }\n}\n","import type { BeeLClient } from '../http/client';\nimport type { components } from '../generated/schema';\n\nexport class ConfigurationResource {\n constructor(private client: BeeLClient) {}\n\n /** Get the current tax configuration (default VAT, IRPF, etc.). */\n async getTaxConfig() {\n const { data } = await this.client.GET('/v1/configuration/taxes');\n return data!.data;\n }\n\n /** Update tax configuration. */\n async updateTaxConfig(body: any) {\n const { data } = await this.client.PUT('/v1/configuration/taxes', { body });\n return data!.data;\n }\n\n /** Get available tax types (IVA/IGIC rates, IRPF types, equivalence surcharges). */\n async getTaxTypes() {\n const { data } = await this.client.GET('/v1/configuration/tax-types');\n return data!.data;\n }\n\n /** Get invoice customization options (logo, colors, footer text, etc.). */\n async getInvoiceCustomizationOptions() {\n const { data } = await this.client.GET('/v1/configuration/invoice-customization-options');\n return data!.data;\n }\n\n /** Update the user's preferred language (es, en, ca). */\n async updateLanguage(language: string) {\n const { data } = await this.client.PUT('/v1/configuration/language', { body: { language } as any });\n return data!.data;\n }\n\n /** Get VeriFactu configuration (enabled, certificate status, etc.). */\n async getVerifactu() {\n const { data } = await this.client.GET('/v1/configuration/verifactu');\n return data!.data;\n }\n\n /** Update VeriFactu configuration. */\n async updateVerifactu(body: any) {\n const { data } = await this.client.PUT('/v1/configuration/verifactu', { body });\n return data!.data;\n }\n}\n\n/**\n * Account-wide catalogs and personal preferences, on their canonical paths.\n *\n * These replace the `/v1/configuration/*` reads on {@link ConfigurationResource},\n * whose flat routes are deprecated.\n */\nexport class CatalogsResource {\n constructor(private client: BeeLClient) {}\n\n /** Tax types the API accepts. Canonical form of `configuration/tax-types`. */\n async taxTypes() {\n const { data } = await this.client.GET('/v1/tax-types');\n return data!.data;\n }\n\n /** Invoice customization options. Canonical form of the `configuration` read. */\n async invoiceCustomizationOptions() {\n const { data } = await this.client.GET('/v1/invoice-customization-options');\n return data!.data;\n }\n\n /**\n * The signed-in person's preferences. Canonical form of\n * `PUT /v1/configuration/language`: the language belongs to the person, not to a company.\n */\n async updateMe(body: components['schemas']['UpdateMeRequest']) {\n const { data } = await this.client.PATCH('/v1/me', { body });\n return data!.data;\n }\n}\n","import type { BeeLClient } from '../http/client';\n\nexport class SeriesResource {\n constructor(private client: BeeLClient) {}\n\n /**\n * List all invoice series. Optionally filter by active status.\n *\n * @example\n * const series = await beel.series.list();\n * const activeSeries = await beel.series.list(true);\n */\n async list(active?: boolean) {\n const { data } = await this.client.GET('/v1/configuration/series', {\n params: { query: active !== undefined ? { active } : undefined },\n });\n return data!.data;\n }\n\n /** Create a new invoice series (e.g. \"A-2026\", \"RECT\"). */\n async create(body: any) {\n const { data } = await this.client.POST('/v1/configuration/series', { body });\n return data!.data;\n }\n\n /** Update a series (name, description, etc.). */\n async update(id: string, body: any) {\n const { data } = await this.client.PUT('/v1/configuration/series/{series_id}', {\n params: { path: { series_id: id } },\n body,\n });\n return data!.data;\n }\n\n /** Delete an invoice series. Only empty series can be deleted. */\n async delete(id: string) {\n await this.client.DELETE('/v1/configuration/series/{series_id}', {\n params: { path: { series_id: id } },\n });\n }\n\n /** Set a series as the default for new invoices. */\n async setDefault(id: string) {\n const { data } = await this.client.POST('/v1/configuration/series/{series_id}/default', {\n params: { path: { series_id: id } },\n });\n return data!.data;\n }\n}\n","import type { BeeLClient } from '../http/client';\n\nexport class NifResource {\n constructor(private client: BeeLClient) {}\n\n /**\n * Validate a Spanish NIF/CIF against the AEAT tax registry.\n *\n * @example\n * const result = await beel.nif.validate('B12345678');\n * console.log(result.valid, result.name);\n */\n async validate(nif: string) {\n const { data } = await this.client.POST('/v1/nif/validate', { body: { nif } as any });\n return data!.data;\n }\n}\n","import type { BeeLClient } from '../http/client';\nimport type { components, operations } from '../generated/schema';\n\ntype ManagedAccountSummary = components['schemas']['ManagedAccountSummary'];\ntype AccountMember = components['schemas']['AccountMember'];\ntype Invitation = components['schemas']['Invitation'];\ntype WebhookSubscription = components['schemas']['WebhookSubscription'];\ntype ProvisioningUsage = components['schemas']['ProvisioningUsage'];\ntype CompanyData = components['schemas']['CompanyData'];\ntype Pagination = components['schemas']['Pagination'];\n\n/**\n * Accounts managed by the API key holder (multi-account / OpenFleet-style provisioning).\n *\n * @example\n * ```typescript\n * const { accounts } = await beel.accounts.list();\n * const account = beel.accounts.scope(accounts[0].account_id);\n * const members = await account.members.list();\n * ```\n */\nexport class AccountsResource {\n constructor(private client: BeeLClient) {}\n\n /** List accounts reachable with this API key (cursor-paginated). */\n async list(params?: operations['listAccounts']['parameters']['query']) {\n const { data } = await this.client.GET('/v1/accounts', { params: { query: params } });\n return data!.data as { accounts: ManagedAccountSummary[]; next_cursor?: string | null };\n }\n\n /** Provision a new managed account. */\n async provision(body: operations['provisionAccount']['requestBody']['content']['application/json']) {\n const { data } = await this.client.POST('/v1/accounts', { body });\n return data!.data as ManagedAccountSummary;\n }\n\n /** Get a managed account by ID. */\n async get(accountId: string) {\n const { data } = await this.client.GET('/v1/accounts/{account_id}', {\n params: { path: { account_id: accountId } },\n });\n return data!.data as ManagedAccountSummary;\n }\n\n /** Alias of `beel.account(accountId)` — returns an account-scoped facade. */\n scope(accountId: string): AccountScope {\n return new AccountScope(this.client, accountId);\n }\n}\n\n/** Operations scoped to a single account. */\nexport class AccountScope {\n readonly members: AccountMembersResource;\n readonly invitations: AccountInvitationsResource;\n readonly webhooks: AccountWebhooksResource;\n readonly companies: AccountCompaniesResource;\n\n constructor(private client: BeeLClient, readonly accountId: string) {\n this.members = new AccountMembersResource(client, accountId);\n this.invitations = new AccountInvitationsResource(client, accountId);\n this.webhooks = new AccountWebhooksResource(client, accountId);\n this.companies = new AccountCompaniesResource(client, accountId);\n }\n\n private path() {\n return { account_id: this.accountId };\n }\n\n /** Get the account summary. */\n async get() {\n const { data } = await this.client.GET('/v1/accounts/{account_id}', { params: { path: this.path() } });\n return data!.data as ManagedAccountSummary;\n }\n\n /** Provisioning usage counters (accounts, NIFs) for billing purposes. */\n async usage() {\n const { data } = await this.client.GET('/v1/accounts/{account_id}/usage', { params: { path: this.path() } });\n return data!.data as ProvisioningUsage;\n }\n\n /** Change the manager's access level over this account. */\n async changeAccessLevel(body: NonNullable<operations['changeManagedAccountAccessLevel']['requestBody']>['content']['application/json']) {\n await this.client.PATCH('/v1/accounts/{account_id}/access-level', {\n params: { path: this.path() },\n body,\n });\n }\n\n /** End the management relationship with this account. */\n async endManagement() {\n await this.client.DELETE('/v1/accounts/{account_id}/management', { params: { path: this.path() } });\n }\n\n /** Create a claim token so the end user can take ownership of the account. */\n async createClaimToken(body?: NonNullable<operations['createAccountClaimToken']['requestBody']>['content']['application/json']) {\n const { data } = await this.client.POST('/v1/accounts/{account_id}/claim-tokens', {\n params: { path: this.path() },\n body: body ?? {},\n });\n return data!.data;\n }\n\n /** Transfer account ownership to an existing member. */\n async setOwner(body: operations['putAccountOwner']['requestBody']['content']['application/json']) {\n await this.client.PUT('/v1/accounts/{account_id}/owner', {\n params: { path: this.path() },\n body,\n });\n }\n}\n\n/** Members of an account and their per-company grants. */\nexport class AccountMembersResource {\n constructor(private client: BeeLClient, private accountId: string) {}\n\n async list() {\n const { data } = await this.client.GET('/v1/accounts/{account_id}/members', {\n params: { path: { account_id: this.accountId } },\n });\n return (data!.data as { members: AccountMember[] }).members;\n }\n\n async get(memberId: string) {\n const { data } = await this.client.GET('/v1/accounts/{account_id}/members/{member_id}', {\n params: { path: { account_id: this.accountId, member_id: memberId } },\n });\n return data!.data as AccountMember;\n }\n\n /** Update a member's account role. */\n async update(memberId: string, body: operations['patchAccountMember']['requestBody']['content']['application/json']) {\n const { data } = await this.client.PATCH('/v1/accounts/{account_id}/members/{member_id}', {\n params: { path: { account_id: this.accountId, member_id: memberId } },\n body,\n });\n return data!.data as AccountMember;\n }\n\n /** Remove a member from the account. */\n async remove(memberId: string) {\n await this.client.DELETE('/v1/accounts/{account_id}/members/{member_id}', {\n params: { path: { account_id: this.accountId, member_id: memberId } },\n });\n }\n\n /** List a member's per-company grants. */\n async listGrants(memberId: string) {\n const { data } = await this.client.GET('/v1/accounts/{account_id}/members/{member_id}/grants', {\n params: { path: { account_id: this.accountId, member_id: memberId } },\n });\n return data!.data;\n }\n\n /** Grant (or replace) a member's permissions over one company. */\n async putGrant(\n memberId: string,\n companyId: string,\n body: operations['putAccountMemberGrant']['requestBody']['content']['application/json'],\n ) {\n const { data } = await this.client.PUT('/v1/accounts/{account_id}/members/{member_id}/grants/{company_id}', {\n params: { path: { account_id: this.accountId, member_id: memberId, company_id: companyId } },\n body,\n });\n return data!.data;\n }\n\n /** Revoke a member's grant over one company. */\n async removeGrant(memberId: string, companyId: string) {\n await this.client.DELETE('/v1/accounts/{account_id}/members/{member_id}/grants/{company_id}', {\n params: { path: { account_id: this.accountId, member_id: memberId, company_id: companyId } },\n });\n }\n}\n\n/** Invitations to join an account. */\nexport class AccountInvitationsResource {\n constructor(private client: BeeLClient, private accountId: string) {}\n\n async list() {\n const { data } = await this.client.GET('/v1/accounts/{account_id}/invitations', {\n params: { path: { account_id: this.accountId } },\n });\n return data!.data;\n }\n\n async create(body: operations['createAccountInvitation']['requestBody']['content']['application/json']) {\n const { data } = await this.client.POST('/v1/accounts/{account_id}/invitations', {\n params: { path: { account_id: this.accountId } },\n body,\n });\n return data!.data as Invitation;\n }\n\n async get(invitationId: string) {\n const { data } = await this.client.GET('/v1/accounts/{account_id}/invitations/{invitation_id}', {\n params: { path: { account_id: this.accountId, invitation_id: invitationId } },\n });\n return data!.data;\n }\n\n async revoke(invitationId: string) {\n await this.client.DELETE('/v1/accounts/{account_id}/invitations/{invitation_id}', {\n params: { path: { account_id: this.accountId, invitation_id: invitationId } },\n });\n }\n}\n\n/** Webhook subscriptions scoped to a managed account. */\nexport class AccountWebhooksResource {\n constructor(private client: BeeLClient, private accountId: string) {}\n\n async list(params?: operations['listAccountWebhookSubscriptions']['parameters']['query']) {\n const { data } = await this.client.GET('/v1/accounts/{account_id}/webhooks', {\n params: { path: { account_id: this.accountId }, query: params },\n });\n return data!.data as { webhooks?: WebhookSubscription[]; pagination?: Pagination };\n }\n\n async create(body: operations['createAccountWebhookSubscription']['requestBody']['content']['application/json']) {\n const { data } = await this.client.POST('/v1/accounts/{account_id}/webhooks', {\n params: { path: { account_id: this.accountId } },\n body,\n });\n return data!.data;\n }\n\n async get(webhookId: string) {\n const { data } = await this.client.GET('/v1/accounts/{account_id}/webhooks/{webhook_id}', {\n params: { path: { account_id: this.accountId, webhook_id: webhookId } },\n });\n return data!.data as WebhookSubscription;\n }\n\n async update(webhookId: string, body: operations['patchAccountWebhookSubscription']['requestBody']['content']['application/json']) {\n const { data } = await this.client.PATCH('/v1/accounts/{account_id}/webhooks/{webhook_id}', {\n params: { path: { account_id: this.accountId, webhook_id: webhookId } },\n body,\n });\n return data!.data as WebhookSubscription;\n }\n\n async delete(webhookId: string) {\n await this.client.DELETE('/v1/accounts/{account_id}/webhooks/{webhook_id}', {\n params: { path: { account_id: this.accountId, webhook_id: webhookId } },\n });\n }\n\n /** Send a test event to the webhook endpoint. */\n async test(webhookId: string) {\n const { data } = await this.client.POST('/v1/accounts/{account_id}/webhooks/{webhook_id}/test', {\n params: { path: { account_id: this.accountId, webhook_id: webhookId } },\n });\n return data!.data;\n }\n\n /** Rotate the webhook signing secret. */\n async rotateSecret(webhookId: string) {\n const { data } = await this.client.POST('/v1/accounts/{account_id}/webhooks/{webhook_id}/secret', {\n params: { path: { account_id: this.accountId, webhook_id: webhookId } },\n });\n return data!.data;\n }\n\n async listDeliveries(webhookId: string, params?: operations['listAccountWebhookDeliveries']['parameters']['query']) {\n const { data } = await this.client.GET('/v1/accounts/{account_id}/webhooks/{webhook_id}/deliveries', {\n params: { path: { account_id: this.accountId, webhook_id: webhookId }, query: params },\n });\n return data!.data;\n }\n\n async retryDelivery(webhookId: string, deliveryId: string) {\n const { data } = await this.client.POST('/v1/accounts/{account_id}/webhooks/{webhook_id}/deliveries/{delivery_id}/retry', {\n params: { path: { account_id: this.accountId, webhook_id: webhookId, delivery_id: deliveryId } },\n });\n return data!.data;\n }\n}\n\n/** Companies (NIFs) that live under a managed account. */\nexport class AccountCompaniesResource {\n constructor(private client: BeeLClient, private accountId: string) {}\n\n async list(params?: operations['listCompanies']['parameters']['query']) {\n const { data } = await this.client.GET('/v1/accounts/{account_id}/companies', {\n params: { path: { account_id: this.accountId }, query: params },\n });\n // The collection is wrapped: `data.companies` + `data.pagination`, not a bare array.\n return {\n companies: (data!.data?.companies ?? []) as CompanyData[],\n pagination: data!.data?.pagination as Pagination | undefined,\n };\n }\n\n /** Register a new company (NIF) under the account. */\n async create(body: components['schemas']['CreateCompanyRequest']) {\n const { data } = await this.client.POST('/v1/accounts/{account_id}/companies', {\n params: { path: { account_id: this.accountId } },\n body,\n });\n return data!.data as CompanyData;\n }\n\n /** Aggregated per-company stats for the account. */\n async stats() {\n const { data } = await this.client.GET('/v1/accounts/{account_id}/companies/stats', {\n params: { path: { account_id: this.accountId } },\n });\n return data!.data;\n }\n}\n","import type { BeeLClient } from '../http/client';\nimport type { components, operations } from '../generated/schema';\n\ntype ManagedPaymentConnection = components['schemas']['ManagedPaymentConnection'];\ntype CompanyPaymentConnection = components['schemas']['CompanyPaymentConnection'];\ntype ManagedPaymentEvent = components['schemas']['ManagedPaymentEvent'];\ntype Pagination = components['schemas']['Pagination'];\ntype PaymentEventCounts = components['schemas']['PaymentEventCounts'];\n\n/**\n * Payment connections of a company (NIF): the Stripe Connect link whose charges\n * auto-generate invoices under that NIF.\n *\n * A connection is addressed by **its own UUID**, not by the provider slug — a NIF can\n * hold several connections of the same provider, so the slug does not name one. Take\n * `id` from {@link list}. The slug only appears when you *start* an authorization.\n *\n * @example\n * ```typescript\n * const company = beel.company('company-uuid');\n * const { connections } = await company.paymentConnections.list();\n * const events = await company.paymentConnections.events(connections[0].id).list({\n * needs_action: true,\n * });\n * ```\n */\nexport class CompanyPaymentConnectionsResource {\n constructor(private client: BeeLClient, private companyId: string) {}\n\n private path() {\n return { company_id: this.companyId };\n }\n\n /** Every payment connection of this company. */\n async list() {\n const { data } = await this.client.GET('/v1/companies/{company_id}/payment-connections', {\n params: { path: this.path() },\n });\n return data!.data as { connections: ManagedPaymentConnection[] };\n }\n\n /**\n * Start an authorization and get the URL where the NIF's holder approves it.\n *\n * This is the one place the provider slug is used — currently only `stripe`.\n */\n async authorize(\n body: components['schemas']['InitiatePaymentConnectionRequest'],\n ): Promise<{ authorization_url: string }> {\n const { data } = await this.client.POST(\n '/v1/companies/{company_id}/payment-connections/authorizations',\n { params: { path: this.path() }, body },\n );\n return data!.data as { authorization_url: string };\n }\n\n /** Update one connection, addressed by its UUID. */\n async update(\n connectionId: string,\n body: components['schemas']['UpdateCompanyPaymentConnectionRequest'],\n ) {\n const { data } = await this.client.PATCH(\n '/v1/companies/{company_id}/payment-connections/{connection_id}',\n { params: { path: { ...this.path(), connection_id: connectionId } }, body },\n );\n return data!.data as CompanyPaymentConnection;\n }\n\n /**\n * Disconnect one connection. Tokens are revoked and auto-invoicing stops;\n * already-issued invoices are untouched.\n */\n async disconnect(connectionId: string): Promise<void> {\n await this.client.DELETE('/v1/companies/{company_id}/payment-connections/{connection_id}', {\n params: { path: { ...this.path(), connection_id: connectionId } },\n });\n }\n\n /** The payment events of one connection — where you audit what did and didn't invoice. */\n events(connectionId: string) {\n return new CompanyPaymentEventsResource(this.client, this.companyId, connectionId);\n }\n}\n\n/**\n * Payment events received through a connection, and the recovery levers for the ones\n * that did not produce an invoice.\n */\nexport class CompanyPaymentEventsResource {\n constructor(\n private client: BeeLClient,\n private companyId: string,\n private connectionId: string,\n ) {}\n\n private path() {\n return { company_id: this.companyId, connection_id: this.connectionId };\n }\n\n /**\n * Events of the connection, most recent first. Nothing is hidden by default:\n * skipped events, duplicates and disputes are all returned — narrow with the\n * filters. `charges_only` returns one row per money movement instead.\n */\n async list(params?: operations['listCompanyPaymentEvents']['parameters']['query']) {\n const { data } = await this.client.GET(\n '/v1/companies/{company_id}/payment-connections/{connection_id}/events',\n { params: { path: this.path(), query: params } },\n );\n return data!.data as {\n events: ManagedPaymentEvent[];\n pagination?: Pagination;\n counts?: PaymentEventCounts;\n };\n }\n\n /** One event. */\n async get(eventId: string) {\n const { data } = await this.client.GET(\n '/v1/companies/{company_id}/payment-connections/{connection_id}/events/{event_id}',\n { params: { path: { ...this.path(), event_id: eventId } } },\n );\n return data!.data as ManagedPaymentEvent;\n }\n\n /**\n * Reprocess an event whose automatic invoicing didn't complete, applying the NIF's\n * **current** configuration. Only retryable states qualify and the retry budget is\n * finite: otherwise `400`.\n */\n async retry(eventId: string) {\n const { data } = await this.client.POST(\n '/v1/companies/{company_id}/payment-connections/{connection_id}/events/{event_id}/retry',\n { params: { path: { ...this.path(), event_id: eventId } } },\n );\n return data!.data as ManagedPaymentEvent;\n }\n\n /**\n * Build a **draft** invoice from an event that couldn't be invoiced automatically,\n * so you can review it before issuing. Returns the draft's id.\n */\n async draft(eventId: string): Promise<{ invoice_id: string }> {\n const { data } = await this.client.POST(\n '/v1/companies/{company_id}/payment-connections/{connection_id}/events/{event_id}/draft',\n { params: { path: { ...this.path(), event_id: eventId } } },\n );\n return data!.data as { invoice_id: string };\n }\n\n /** Mark an event as dealt with outside the automatic flow. */\n async resolve(eventId: string) {\n const { data } = await this.client.POST(\n '/v1/companies/{company_id}/payment-connections/{connection_id}/events/{event_id}/resolve',\n { params: { path: { ...this.path(), event_id: eventId } } },\n );\n return data!.data as ManagedPaymentEvent;\n }\n\n /** Discard an event so it stops asking for attention. Reversible with {@link restore}. */\n async discard(eventId: string) {\n const { data } = await this.client.POST(\n '/v1/companies/{company_id}/payment-connections/{connection_id}/events/{event_id}/discard',\n { params: { path: { ...this.path(), event_id: eventId } } },\n );\n return data!.data as ManagedPaymentEvent;\n }\n\n /** Bring a discarded event back into the list. */\n async restore(eventId: string) {\n const { data } = await this.client.POST(\n '/v1/companies/{company_id}/payment-connections/{connection_id}/events/{event_id}/restore',\n { params: { path: { ...this.path(), event_id: eventId } } },\n );\n return data!.data as ManagedPaymentEvent;\n }\n}\n","import type { BeeLClient } from '../http/client';\nimport type { components, operations } from '../generated/schema';\nimport { CompanyPaymentConnectionsResource } from './payment-connections';\n\ntype Invoice = components['schemas']['Invoice'];\ntype Customer = components['schemas']['Customer'];\ntype Product = components['schemas']['Product'];\ntype CompanyData = components['schemas']['CompanyData'];\ntype Pagination = components['schemas']['Pagination'];\n\n/**\n * Operations scoped to a single company (NIF). This is the explicit multi-NIF surface:\n * the company is addressed in the path, so no session focus or `BeeL-Active-Company`\n * header is needed.\n *\n * @example\n * ```typescript\n * const company = beel.company('company-uuid');\n * const invoice = await company.invoices.create({ ... });\n * await company.invoices.issue(invoice.id);\n * ```\n */\nexport class CompanyScope {\n readonly invoices: CompanyInvoicesResource;\n readonly customers: CompanyCustomersResource;\n readonly products: CompanyProductsResource;\n readonly series: CompanySeriesResource;\n readonly recurringInvoices: CompanyRecurringInvoicesResource;\n readonly paymentConnections: CompanyPaymentConnectionsResource;\n readonly taxConfiguration: CompanyTaxConfigurationResource;\n readonly verifactuConfiguration: CompanyVeriFactuConfigurationResource;\n\n constructor(private client: BeeLClient, readonly companyId: string) {\n this.invoices = new CompanyInvoicesResource(client, companyId);\n this.customers = new CompanyCustomersResource(client, companyId);\n this.products = new CompanyProductsResource(client, companyId);\n this.series = new CompanySeriesResource(client, companyId);\n this.recurringInvoices = new CompanyRecurringInvoicesResource(client, companyId);\n this.paymentConnections = new CompanyPaymentConnectionsResource(client, companyId);\n this.taxConfiguration = new CompanyTaxConfigurationResource(client, companyId);\n this.verifactuConfiguration = new CompanyVeriFactuConfigurationResource(client, companyId);\n }\n\n private path() {\n return { company_id: this.companyId };\n }\n\n /** Get the company. */\n async get(params?: operations['getCompanyById']['parameters']['query']) {\n const { data } = await this.client.GET('/v1/companies/{company_id}', {\n params: { path: this.path(), query: params },\n });\n return data!.data as CompanyData;\n }\n\n /** Update company data. */\n async update(body: components['schemas']['UpdateCompanyRequest']) {\n const { data } = await this.client.PATCH('/v1/companies/{company_id}', {\n params: { path: this.path() },\n body,\n });\n return data!.data as CompanyData;\n }\n\n /** Delete the company. */\n async delete() {\n await this.client.DELETE('/v1/companies/{company_id}', { params: { path: this.path() } });\n }\n\n /** Fiscal summary (VAT/IRPF aggregates) for the company. */\n async fiscalSummary(params?: operations['getCompanyFiscalSummary']['parameters']['query']) {\n const { data } = await this.client.GET('/v1/companies/{company_id}/fiscal-summary', {\n params: { path: this.path(), query: params },\n });\n return data!.data as components['schemas']['FiscalSummaryResponse'];\n }\n\n /** Whether the company can already issue invoices, and what is missing if not. */\n async issuingReadiness() {\n const { data } = await this.client.GET('/v1/companies/{company_id}/issuing-readiness', {\n params: { path: this.path() },\n });\n return data!.data as components['schemas']['IssuingReadinessData'];\n }\n}\n\n/** Invoice lifecycle addressed per company. */\nexport class CompanyInvoicesResource {\n readonly schedule: CompanyInvoiceScheduleResource;\n\n constructor(private client: BeeLClient, private companyId: string) {\n this.schedule = new CompanyInvoiceScheduleResource(client, companyId);\n }\n\n /**\n * Derive a new invoice from an existing one — the canonical form of `duplicate`.\n */\n async derive(body: components['schemas']['CreateInvoiceDerivationRequest']) {\n const { data } = await this.client.POST('/v1/companies/{company_id}/invoices/derivations', {\n params: { path: { company_id: this.companyId } },\n body,\n });\n return data!.data as Invoice;\n }\n\n private path(): { company_id: string };\n private path<T extends Record<string, string>>(rest: T): { company_id: string } & T;\n private path(rest?: Record<string, string>) {\n return { company_id: this.companyId, ...rest };\n }\n\n async list(params?: operations['listCompanyInvoices']['parameters']['query']) {\n const { data } = await this.client.GET('/v1/companies/{company_id}/invoices', {\n params: { path: this.path(), query: params },\n });\n return data!.data as { invoices: Invoice[]; pagination: Pagination };\n }\n\n async create(\n body: components['schemas']['CreateInvoiceRequest'],\n params?: operations['createCompanyInvoice']['parameters']['query'],\n ) {\n const { data } = await this.client.POST('/v1/companies/{company_id}/invoices', {\n params: { path: this.path(), query: params },\n body,\n });\n return data!.data as Invoice;\n }\n\n async get(invoiceId: string) {\n const { data } = await this.client.GET('/v1/companies/{company_id}/invoices/{invoice_id}', {\n params: { path: this.path({ invoice_id: invoiceId }) },\n });\n return data!.data as Invoice;\n }\n\n /** Update a draft invoice. */\n async update(invoiceId: string, body: operations['patchCompanyInvoice']['requestBody']['content']['application/json']) {\n const { data } = await this.client.PATCH('/v1/companies/{company_id}/invoices/{invoice_id}', {\n params: { path: this.path({ invoice_id: invoiceId }) },\n body,\n });\n return data!.data as Invoice;\n }\n\n /** Delete a draft invoice. */\n async delete(invoiceId: string) {\n await this.client.DELETE('/v1/companies/{company_id}/invoices/{invoice_id}', {\n params: { path: this.path({ invoice_id: invoiceId }) },\n });\n }\n\n /** Issue a draft invoice (assigns number, submits to VeriFactu when configured). */\n async issue(invoiceId: string, params?: operations['issueCompanyInvoice']['parameters']['query']) {\n const { data } = await this.client.POST('/v1/companies/{company_id}/invoices/{invoice_id}/issue', {\n params: { path: this.path({ invoice_id: invoiceId }), query: params },\n });\n return data!.data as Invoice;\n }\n\n /** Void an issued invoice. */\n async void(invoiceId: string, body: NonNullable<operations['voidCompanyInvoice']['requestBody']>['content']['application/json']) {\n const { data } = await this.client.POST('/v1/companies/{company_id}/invoices/{invoice_id}/void', {\n params: { path: this.path({ invoice_id: invoiceId }) },\n body,\n });\n return data!.data as Invoice;\n }\n\n /** Create a corrective (rectificativa) for an issued invoice. */\n async createCorrective(\n invoiceId: string,\n body: operations['createCompanyCorrectiveInvoice']['requestBody']['content']['application/json'],\n ) {\n const { data } = await this.client.POST('/v1/companies/{company_id}/invoices/{invoice_id}/corrective', {\n params: { path: this.path({ invoice_id: invoiceId }) },\n body,\n });\n return data!.data as Invoice;\n }\n\n /** Convert a proforma into an invoice. */\n async convertToInvoice(\n invoiceId: string,\n body?: NonNullable<operations['convertCompanyProformaToInvoice']['requestBody']>['content']['application/json'],\n ) {\n const { data } = await this.client.POST('/v1/companies/{company_id}/invoices/{invoice_id}/convert-to-invoice', {\n params: { path: this.path({ invoice_id: invoiceId }) },\n body,\n });\n return data!.data as Invoice;\n }\n\n /** Update payment status (e.g. mark as paid). */\n async setStatus(invoiceId: string, body: operations['setCompanyInvoiceStatus']['requestBody']['content']['application/json']) {\n const { data } = await this.client.PUT('/v1/companies/{company_id}/invoices/{invoice_id}/status', {\n params: { path: this.path({ invoice_id: invoiceId }) },\n body,\n });\n return data!.data as Invoice;\n }\n\n /** Get PDF metadata and download URL. */\n async getPdf(invoiceId: string) {\n const { data } = await this.client.GET('/v1/companies/{company_id}/invoices/{invoice_id}/pdf', {\n params: { path: this.path({ invoice_id: invoiceId }) },\n });\n return data!.data;\n }\n\n /** Send the invoice by email to the customer. */\n async send(invoiceId: string, body: NonNullable<operations['sendCompanyInvoice']['requestBody']>['content']['application/json']) {\n const { data } = await this.client.POST('/v1/companies/{company_id}/invoices/{invoice_id}/send', {\n params: { path: this.path({ invoice_id: invoiceId }) },\n body,\n });\n return data!.data;\n }\n}\n\n/** Customers addressed per company. */\n/** Schedule of one invoice: read it, set it, clear it. */\nexport class CompanyInvoiceScheduleResource {\n constructor(private client: BeeLClient, private companyId: string) {}\n\n async get(invoiceId: string) {\n const { data } = await this.client.GET(\n '/v1/companies/{company_id}/invoices/{invoice_id}/schedule',\n { params: { path: { company_id: this.companyId, invoice_id: invoiceId } } },\n );\n return data!.data;\n }\n\n /**\n * Set or move the schedule. One `PUT` replaces the three legacy calls\n * (`schedule`, `reschedule`, `unschedule`): setting it again moves it.\n */\n async set(invoiceId: string, body: components['schemas']['SetInvoiceScheduleRequest']) {\n const { data } = await this.client.PUT(\n '/v1/companies/{company_id}/invoices/{invoice_id}/schedule',\n { params: { path: { company_id: this.companyId, invoice_id: invoiceId } }, body },\n );\n return data!.data;\n }\n\n /** Clear the schedule — the canonical form of `unschedule`. */\n async clear(invoiceId: string): Promise<void> {\n await this.client.DELETE('/v1/companies/{company_id}/invoices/{invoice_id}/schedule', {\n params: { path: { company_id: this.companyId, invoice_id: invoiceId } },\n });\n }\n}\n\nexport class CompanyCustomersResource {\n constructor(private client: BeeLClient, private companyId: string) {}\n\n async list(params?: operations['listCompanyCustomers']['parameters']['query']) {\n const { data } = await this.client.GET('/v1/companies/{company_id}/customers', {\n params: { path: { company_id: this.companyId }, query: params },\n });\n return data!.data as { customers: Customer[]; pagination: Pagination };\n }\n\n async create(body: components['schemas']['CreateCustomerRequest']) {\n const { data } = await this.client.POST('/v1/companies/{company_id}/customers', {\n params: { path: { company_id: this.companyId } },\n body,\n });\n return data!.data as Customer;\n }\n\n async createBulk(body: operations['createCompanyCustomersBulk']['requestBody']['content']['application/json']) {\n const { data } = await this.client.POST('/v1/companies/{company_id}/customers/bulk', {\n params: { path: { company_id: this.companyId } },\n body,\n });\n return data!.data;\n }\n\n async get(customerId: string) {\n const { data } = await this.client.GET('/v1/companies/{company_id}/customers/{customer_id}', {\n params: { path: { company_id: this.companyId, customer_id: customerId } },\n });\n return data!.data as Customer;\n }\n\n async update(customerId: string, body: operations['patchCompanyCustomer']['requestBody']['content']['application/json']) {\n const { data } = await this.client.PATCH('/v1/companies/{company_id}/customers/{customer_id}', {\n params: { path: { company_id: this.companyId, customer_id: customerId } },\n body,\n });\n return data!.data as Customer;\n }\n\n async delete(customerId: string) {\n await this.client.DELETE('/v1/companies/{company_id}/customers/{customer_id}', {\n params: { path: { company_id: this.companyId, customer_id: customerId } },\n });\n }\n}\n\n/** Products addressed per company. */\nexport class CompanyProductsResource {\n constructor(private client: BeeLClient, private companyId: string) {}\n\n async list(params?: operations['listCompanyProducts']['parameters']['query']) {\n const { data } = await this.client.GET('/v1/companies/{company_id}/products', {\n params: { path: { company_id: this.companyId }, query: params },\n });\n return data!.data as { products: Product[]; pagination: Pagination };\n }\n\n async create(body: components['schemas']['CreateProductRequest']) {\n const { data } = await this.client.POST('/v1/companies/{company_id}/products', {\n params: { path: { company_id: this.companyId } },\n body,\n });\n return data!.data as Product;\n }\n\n async get(productId: string) {\n const { data } = await this.client.GET('/v1/companies/{company_id}/products/{product_id}', {\n params: { path: { company_id: this.companyId, product_id: productId } },\n });\n return data!.data as Product;\n }\n\n async update(productId: string, body: operations['patchCompanyProduct']['requestBody']['content']['application/json']) {\n const { data } = await this.client.PATCH('/v1/companies/{company_id}/products/{product_id}', {\n params: { path: { company_id: this.companyId, product_id: productId } },\n body,\n });\n return data!.data as Product;\n }\n\n async delete(productId: string) {\n await this.client.DELETE('/v1/companies/{company_id}/products/{product_id}', {\n params: { path: { company_id: this.companyId, product_id: productId } },\n });\n }\n}\n\n/** Invoice series addressed per company. */\nexport class CompanySeriesResource {\n constructor(private client: BeeLClient, private companyId: string) {}\n\n async list(params?: operations['listCompanySeries']['parameters']['query']) {\n const { data } = await this.client.GET('/v1/companies/{company_id}/series', {\n params: { path: { company_id: this.companyId }, query: params },\n });\n return data!.data;\n }\n\n async create(body: operations['createCompanySeries']['requestBody']['content']['application/json']) {\n const { data } = await this.client.POST('/v1/companies/{company_id}/series', {\n params: { path: { company_id: this.companyId } },\n body,\n });\n return data!.data;\n }\n\n async update(seriesId: string, body: operations['patchCompanySeries']['requestBody']['content']['application/json']) {\n const { data } = await this.client.PATCH('/v1/companies/{company_id}/series/{series_id}', {\n params: { path: { company_id: this.companyId, series_id: seriesId } },\n body,\n });\n return data!.data;\n }\n\n async delete(seriesId: string) {\n await this.client.DELETE('/v1/companies/{company_id}/series/{series_id}', {\n params: { path: { company_id: this.companyId, series_id: seriesId } },\n });\n }\n\n /** Current default series per invoice type. */\n async getDefaults() {\n const { data } = await this.client.GET('/v1/companies/{company_id}/series/defaults', {\n params: { path: { company_id: this.companyId } },\n });\n return data!.data;\n }\n\n /** Ensure the three typed default series exist (idempotent seeding). */\n async ensureDefaults() {\n const { data } = await this.client.PUT('/v1/companies/{company_id}/series/defaults', {\n params: { path: { company_id: this.companyId } },\n });\n return data!.data;\n }\n\n /** Mark a series as the default for its invoice type. */\n async setDefault(seriesId: string) {\n const { data } = await this.client.PUT('/v1/companies/{company_id}/series/{series_id}/default', {\n params: { path: { company_id: this.companyId, series_id: seriesId } },\n });\n return data!.data;\n }\n}\n\n/** Recurring invoices addressed per company. */\nexport class CompanyRecurringInvoicesResource {\n constructor(private client: BeeLClient, private companyId: string) {}\n\n private path(): { company_id: string };\n private path<T extends Record<string, string>>(rest: T): { company_id: string } & T;\n private path(rest?: Record<string, string>) {\n return { company_id: this.companyId, ...rest };\n }\n\n async list(params?: operations['listCompanyRecurringInvoices']['parameters']['query']) {\n const { data } = await this.client.GET('/v1/companies/{company_id}/recurring-invoices', {\n params: { path: this.path(), query: params },\n });\n return data!.data;\n }\n\n async create(body: operations['createCompanyRecurringInvoice']['requestBody']['content']['application/json']) {\n const { data } = await this.client.POST('/v1/companies/{company_id}/recurring-invoices', {\n params: { path: this.path() },\n body,\n });\n return data!.data;\n }\n\n async get(recurringInvoiceId: string) {\n const { data } = await this.client.GET('/v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}', {\n params: { path: this.path({ recurring_invoice_id: recurringInvoiceId }) },\n });\n return data!.data;\n }\n\n async update(\n recurringInvoiceId: string,\n body: operations['patchCompanyRecurringInvoice']['requestBody']['content']['application/json'],\n ) {\n const { data } = await this.client.PATCH('/v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}', {\n params: { path: this.path({ recurring_invoice_id: recurringInvoiceId }) },\n body,\n });\n return data!.data;\n }\n\n async delete(recurringInvoiceId: string) {\n await this.client.DELETE('/v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}', {\n params: { path: this.path({ recurring_invoice_id: recurringInvoiceId }) },\n });\n }\n\n /** Pause or resume the schedule. */\n async setStatus(\n recurringInvoiceId: string,\n body: operations['setCompanyRecurringInvoiceStatus']['requestBody']['content']['application/json'],\n ) {\n const { data } = await this.client.PUT('/v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}/status', {\n params: { path: this.path({ recurring_invoice_id: recurringInvoiceId }) },\n body,\n });\n return data!.data;\n }\n\n /** Skip the next scheduled occurrence. */\n async skip(recurringInvoiceId: string) {\n const { data } = await this.client.POST('/v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}/skip', {\n params: { path: this.path({ recurring_invoice_id: recurringInvoiceId }) },\n });\n return data!.data;\n }\n\n /** Generate the next invoice now instead of waiting for the schedule. */\n async generateNow(recurringInvoiceId: string) {\n const { data } = await this.client.POST('/v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}/generate', {\n params: { path: this.path({ recurring_invoice_id: recurringInvoiceId }) },\n });\n return data!.data;\n }\n\n async nextOccurrence(recurringInvoiceId: string) {\n const { data } = await this.client.GET('/v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}/next-occurrence', {\n params: { path: this.path({ recurring_invoice_id: recurringInvoiceId }) },\n });\n return data!.data;\n }\n\n async history(recurringInvoiceId: string, params?: operations['getCompanyRecurringInvoiceHistory']['parameters']['query']) {\n const { data } = await this.client.GET('/v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}/history', {\n params: { path: this.path({ recurring_invoice_id: recurringInvoiceId }), query: params },\n });\n return data!.data;\n }\n}\n\n/**\n * Tax defaults of one company. The canonical replacement for the account-wide\n * `beel.configuration.getTaxes()`, whose flat route is deprecated.\n */\nexport class CompanyTaxConfigurationResource {\n constructor(private client: BeeLClient, private companyId: string) {}\n\n async get() {\n const { data } = await this.client.GET('/v1/companies/{company_id}/tax-configuration', {\n params: { path: { company_id: this.companyId } },\n });\n return data!.data;\n }\n\n /** Replaces the whole state — this is a `PUT`, not a merge. */\n async update(body: components['schemas']['UpdateTaxConfigurationRequest']) {\n const { data } = await this.client.PUT('/v1/companies/{company_id}/tax-configuration', {\n params: { path: { company_id: this.companyId } },\n body,\n });\n return data!.data;\n }\n}\n\n/**\n * VeriFactu configuration of one company. The canonical replacement for\n * `beel.configuration.getVerifactu()`, whose flat route is deprecated.\n *\n * Whether an invoice reaches AEAT is a fact of this NIF resolved at issue time, not a\n * per-invoice choice: `enabled` is the only writable field. Everything else — `status`,\n * `nif_status`, `signed`, `activated`, `pdf_generated` — is resolved server-side.\n */\nexport class CompanyVeriFactuConfigurationResource {\n constructor(private client: BeeLClient, private companyId: string) {}\n\n async get() {\n const { data } = await this.client.GET('/v1/companies/{company_id}/verifactu-configuration', {\n params: { path: { company_id: this.companyId } },\n });\n return data!.data;\n }\n\n /** Flip VeriFactu for this NIF. `enabled` is the only field you can write. */\n async update(body: components['schemas']['UpdateVeriFactuConfigurationRequest']) {\n const { data } = await this.client.PUT('/v1/companies/{company_id}/verifactu-configuration', {\n params: { path: { company_id: this.companyId } },\n body,\n });\n return data!.data;\n }\n}\n","import { createBeeLClient, type BeeLConfig } from './http/client';\nimport { InvoicesResource } from './resources/invoices';\nimport { CustomersResource } from './resources/customers';\nimport { ProductsResource } from './resources/products';\nimport { ConfigurationResource, CatalogsResource } from './resources/configuration';\nimport { SeriesResource } from './resources/series';\nimport { NifResource } from './resources/nif';\nimport { AccountsResource, AccountScope } from './resources/accounts';\nimport { CompanyScope } from './resources/company';\n\n/**\n * BeeL SDK Client\n *\n * @example\n * ```typescript\n * import { BeeL } from '@beel_es/sdk';\n *\n * const beel = new BeeL({ apiKey: 'beel_sk_live_...' });\n *\n * const invoice = await beel.company('company-uuid').invoices.create({\n * type: 'STANDARD',\n * recipient: { customer_id: 'uuid' },\n * lines: [{ line_type: 'NORMAL', description: 'Service', quantity: 1, unit_price: 100 }],\n * });\n * ```\n */\nexport class BeeL {\n /** @deprecated Session-focus endpoints are deprecated in the API contract. Use `beel.company(companyId).invoices` instead. */\n readonly invoices: InvoicesResource;\n /** @deprecated Session-focus endpoints are deprecated in the API contract. Use `beel.company(companyId).customers` instead. */\n readonly customers: CustomersResource;\n /** @deprecated Session-focus endpoints are deprecated in the API contract. Use `beel.company(companyId).products` instead. */\n readonly products: ProductsResource;\n /** @deprecated Session-focus configuration endpoints are deprecated in the API contract. Use the company-scoped equivalents on `beel.company(companyId)`. */\n readonly configuration: ConfigurationResource;\n /** @deprecated Session-focus endpoints are deprecated in the API contract. Use `beel.company(companyId).series` instead. */\n readonly series: SeriesResource;\n /** Account-wide catalogs and personal preferences, on their canonical paths. */\n readonly catalogs: CatalogsResource;\n readonly nif: NifResource;\n /** Accounts you manage (multi-account provisioning: members, invitations, webhooks, companies). */\n readonly accounts: AccountsResource;\n\n /**\n * The typed client underneath, for any endpoint this SDK does not wrap yet.\n *\n * A new route reaches the generated types as soon as the contract is synced, but its\n * ergonomic wrapper is written by hand — so without this you would have to wait for a\n * release to call it. Here you can call it today, and still typed: the path, its\n * parameters and the body are checked against the contract, a wrong one does not\n * compile. What you give up is the sugar (grouping, unwrapping of `data`, the\n * builders) and the naming stability the wrappers provide.\n *\n * Retries, the `Authorization` header and `Idempotency-Key` still apply: it is the\n * same client the resources use, middleware included.\n *\n * @example\n * ```typescript\n * const { data } = await beel.raw.GET('/v1/companies/{company_id}/logo', {\n * params: { path: { company_id: 'uuid' } },\n * });\n * ```\n */\n readonly raw: ReturnType<typeof createBeeLClient>;\n\n constructor(config: BeeLConfig) {\n const client = createBeeLClient(config);\n this.raw = client;\n this.invoices = new InvoicesResource(client);\n this.customers = new CustomersResource(client);\n this.products = new ProductsResource(client);\n this.configuration = new ConfigurationResource(client);\n this.catalogs = new CatalogsResource(client);\n this.series = new SeriesResource(client);\n this.nif = new NifResource(client);\n this.accounts = new AccountsResource(client);\n }\n\n /**\n * Returns a facade scoped to one company (NIF) — the explicit multi-NIF surface.\n * All operations address the company in the path, no session focus needed.\n *\n * @example\n * ```typescript\n * const company = beel.company('company-uuid');\n * const { invoices } = await company.invoices.list({ status: 'ISSUED' });\n * ```\n */\n company(companyId: string): CompanyScope {\n return new CompanyScope(this.raw, companyId);\n }\n\n /**\n * Returns a facade scoped to one managed account — members, invitations,\n * account webhooks, companies, usage. Symmetric with {@link company}.\n *\n * @example\n * ```typescript\n * const account = beel.account('account-uuid');\n * const members = await account.members.list();\n * ```\n */\n account(accountId: string): AccountScope {\n return new AccountScope(this.raw, accountId);\n }\n\n /**\n * Download an invoice PDF as a Buffer.\n *\n * @deprecated Relies on the deprecated session-focus PDF endpoint. Use\n * `beel.company(companyId).invoices.getPdf(invoiceId)` and fetch `download_url` instead.\n *\n * @example\n * ```typescript\n * const { buffer, fileName } = await beel.downloadPdf('invoice-uuid');\n * fs.writeFileSync(fileName, buffer);\n * ```\n */\n async downloadPdf(invoiceId: string): Promise<{ buffer: Buffer; fileName: string }> {\n const pdf = await this.invoices.getPdf(invoiceId);\n const response = await fetch(pdf.download_url);\n if (!response.ok) throw new Error(`Failed to download PDF: ${response.status}`);\n const arrayBuffer = await response.arrayBuffer();\n return { buffer: Buffer.from(arrayBuffer), fileName: pdf.file_name };\n }\n}\n","import { createHmac, timingSafeEqual } from 'crypto';\n\n/**\n * Webhook signature verification for BeeL webhooks\n * \n * Every webhook delivery includes a `BeeL-Signature` header that must be verified\n * to ensure the webhook came from BeeL and hasn't been tampered with.\n * \n * ## Security Requirements\n * \n * 1. **Always verify** the signature before processing the webhook\n * 2. **Use constant-time comparison** to prevent timing attacks\n * 3. **Reject old events** (older than 5 minutes)\n * 4. **Use raw request body** (before parsing JSON)\n * \n * ## Header Format\n * \n * ```\n * BeeL-Signature: t=1741362026,v1=3c4f7a2e1b9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d0e9f8a7b6c5d4e3f\n * ```\n * \n * Where:\n * - `t` = Unix timestamp when the webhook was sent\n * - `v1` = HMAC-SHA256 signature of the payload\n * \n * @example Express.js\n * ```typescript\n * import express from 'express';\n * import { WebhookVerifier } from '@beel/sdk';\n * \n * const verifier = new WebhookVerifier('your_webhook_secret');\n * \n * app.post('/webhooks/beel', express.raw({ type: 'application/json' }), (req, res) => {\n * const signature = req.headers['beel-signature'] as string;\n * const rawBody = req.body.toString('utf8');\n * \n * try {\n * const event = verifier.verify(rawBody, signature);\n * \n * if (event.type === 'verifactu.status.updated') {\n * console.log('VeriFactu status:', event.data.new_status);\n * if (event.data.new_status === 'ACCEPTED') {\n * console.log('QR URL:', event.data.qr_url);\n * }\n * }\n * \n * res.status(200).send('OK');\n * } catch (error) {\n * console.error('Invalid webhook:', error.message);\n * res.status(400).send('Invalid signature');\n * }\n * });\n * ```\n */\nexport class WebhookVerifier {\n private readonly secret: string;\n private readonly toleranceSeconds: number;\n \n /**\n * Creates a new WebhookVerifier\n * \n * @param secret - Your webhook secret from BeeL dashboard\n * @param toleranceSeconds - Maximum age of webhook events (default: 300 = 5 minutes)\n */\n constructor(secret: string, toleranceSeconds: number = 300) {\n if (!secret || secret.trim().length === 0) {\n throw new Error('Webhook secret is required');\n }\n this.secret = secret;\n this.toleranceSeconds = toleranceSeconds;\n }\n \n /**\n * Verify a webhook signature and return the parsed event\n * \n * @param rawBody - Raw request body (string or Buffer, before JSON parsing)\n * @param signatureHeader - Value of the `BeeL-Signature` header\n * @returns Parsed webhook event\n * @throws {WebhookVerificationError} If signature is invalid or event is too old\n * \n * @example Basic usage\n * ```typescript\n * const verifier = new WebhookVerifier('your_secret');\n * const event = verifier.verify(rawBody, signature);\n * \n * if (event.type === 'verifactu.status.updated') {\n * console.log('Invoice:', event.data.invoice_number);\n * console.log('Status:', event.data.new_status);\n * }\n * ```\n */\n verify<T extends WebhookEvent = WebhookEvent>(\n rawBody: string | Buffer,\n signatureHeader: string | undefined\n ): T {\n if (!signatureHeader) {\n throw new WebhookVerificationError('Missing BeeL-Signature header');\n }\n \n // Parse signature header\n const { timestamp, signature } = this.parseSignatureHeader(signatureHeader);\n \n // Check timestamp tolerance\n const now = Math.floor(Date.now() / 1000);\n const age = Math.abs(now - timestamp);\n \n if (age > this.toleranceSeconds) {\n throw new WebhookVerificationError(\n `Webhook timestamp too old (${age}s ago, max ${this.toleranceSeconds}s allowed)`\n );\n }\n \n // Verify signature\n const bodyString = Buffer.isBuffer(rawBody) ? rawBody.toString('utf8') : rawBody;\n const expectedSignature = this.computeSignature(timestamp, bodyString);\n \n if (!this.secureCompare(signature, expectedSignature)) {\n throw new WebhookVerificationError('Invalid webhook signature');\n }\n \n // Parse and return event\n try {\n return JSON.parse(bodyString);\n } catch (error) {\n throw new WebhookVerificationError('Invalid JSON in webhook body');\n }\n }\n \n /**\n * Parse the BeeL-Signature header\n * \n * Format: `t=1741362026,v1=3c4f7a2e...`\n */\n private parseSignatureHeader(header: string): { timestamp: number; signature: string } {\n const parts = header.split(',');\n let timestamp: number | undefined;\n let signature: string | undefined;\n \n for (const part of parts) {\n const [key, value] = part.split('=', 2);\n if (key === 't') {\n timestamp = parseInt(value, 10);\n } else if (key === 'v1') {\n signature = value;\n }\n }\n \n if (!timestamp || !signature) {\n throw new WebhookVerificationError(\n 'Invalid signature header format (expected: t=timestamp,v1=signature)'\n );\n }\n \n if (isNaN(timestamp)) {\n throw new WebhookVerificationError('Invalid timestamp in signature header');\n }\n \n return { timestamp, signature };\n }\n \n /**\n * Compute HMAC-SHA256 signature\n * \n * Algorithm:\n * 1. Build signed payload: `{timestamp}.{raw_body}`\n * 2. Compute: HMAC-SHA256(secret, signed_payload)\n * 3. Return hex digest\n */\n private computeSignature(timestamp: number, body: string): string {\n const signedPayload = `${timestamp}.${body}`;\n return createHmac('sha256', this.secret)\n .update(signedPayload, 'utf8')\n .digest('hex');\n }\n \n /**\n * Constant-time string comparison to prevent timing attacks\n */\n private secureCompare(a: string, b: string): boolean {\n if (a.length !== b.length) {\n return false;\n }\n \n const bufferA = Buffer.from(a, 'utf8');\n const bufferB = Buffer.from(b, 'utf8');\n \n return timingSafeEqual(bufferA, bufferB);\n }\n}\n\n/**\n * Webhook verification error\n */\nexport class WebhookVerificationError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'WebhookVerificationError';\n }\n}\n\n/**\n * Webhook event types (auto-generated from webhook-receiver-api.yaml)\n * \n * These types are generated by running `npm run generate:webhooks`\n * from openapi/webhook-receiver-api.yaml\n */\nexport type {\n WebhookEventEnvelope,\n VeriFactuStatusUpdatedEvent,\n InvoiceIssuedEvent,\n InvoiceVoidedEvent,\n InvoiceEmailSentEvent,\n RecurringInvoicePausedEvent,\n AccountClaimedEvent,\n CompanyCreatedEvent,\n RepresentationSignedEvent,\n WebhookTestEvent,\n} from '../generated-webhooks';\n\n/**\n * Union type of all possible webhook events\n */\nexport type WebhookEvent =\n | VeriFactuStatusUpdatedEvent\n | InvoiceIssuedEvent\n | InvoiceVoidedEvent\n | InvoiceEmailSentEvent\n | RecurringInvoicePausedEvent\n | AccountClaimedEvent\n | CompanyCreatedEvent\n | RepresentationSignedEvent\n | WebhookTestEvent;\n\n// Import for internal use\nimport type {\n VeriFactuStatusUpdatedEvent,\n InvoiceIssuedEvent,\n InvoiceVoidedEvent,\n InvoiceEmailSentEvent,\n RecurringInvoicePausedEvent,\n AccountClaimedEvent,\n CompanyCreatedEvent,\n RepresentationSignedEvent,\n WebhookTestEvent,\n} from '../generated-webhooks';\n","/* generated using openapi-typescript-codegen -- do not edit */\n/* istanbul ignore file */\n/* tslint:disable */\n/* eslint-disable */\nimport type { WebhookEventDataAccountClaimed } from './WebhookEventDataAccountClaimed';\nimport type { WebhookEventEnvelope } from './WebhookEventEnvelope';\nexport type AccountClaimedEvent = (WebhookEventEnvelope & {\n type?: AccountClaimedEvent.type;\n data: WebhookEventDataAccountClaimed;\n});\nexport namespace AccountClaimedEvent {\n export enum type {\n ACCOUNT_CLAIMED = 'account.claimed',\n }\n}\n\n","/* generated using openapi-typescript-codegen -- do not edit */\n/* istanbul ignore file */\n/* tslint:disable */\n/* eslint-disable */\nimport type { WebhookEventDataCompanyCreated } from './WebhookEventDataCompanyCreated';\nimport type { WebhookEventEnvelope } from './WebhookEventEnvelope';\nexport type CompanyCreatedEvent = (WebhookEventEnvelope & {\n type?: CompanyCreatedEvent.type;\n data: WebhookEventDataCompanyCreated;\n});\nexport namespace CompanyCreatedEvent {\n export enum type {\n COMPANY_CREATED = 'company.created',\n }\n}\n\n","/* generated using openapi-typescript-codegen -- do not edit */\n/* istanbul ignore file */\n/* tslint:disable */\n/* eslint-disable */\nimport type { WebhookEventDataInvoiceEmailSent } from './WebhookEventDataInvoiceEmailSent';\nimport type { WebhookEventEnvelope } from './WebhookEventEnvelope';\nexport type InvoiceEmailSentEvent = (WebhookEventEnvelope & {\n type?: InvoiceEmailSentEvent.type;\n data: WebhookEventDataInvoiceEmailSent;\n});\nexport namespace InvoiceEmailSentEvent {\n export enum type {\n INVOICE_EMAIL_SENT = 'invoice.email.sent',\n }\n}\n\n","/* generated using openapi-typescript-codegen -- do not edit */\n/* istanbul ignore file */\n/* tslint:disable */\n/* eslint-disable */\nimport type { WebhookEventDataInvoiceIssued } from './WebhookEventDataInvoiceIssued';\nimport type { WebhookEventEnvelope } from './WebhookEventEnvelope';\nexport type InvoiceIssuedEvent = (WebhookEventEnvelope & {\n type?: InvoiceIssuedEvent.type;\n data: WebhookEventDataInvoiceIssued;\n});\nexport namespace InvoiceIssuedEvent {\n export enum type {\n INVOICE_ISSUED = 'invoice.issued',\n }\n}\n\n","/* generated using openapi-typescript-codegen -- do not edit */\n/* istanbul ignore file */\n/* tslint:disable */\n/* eslint-disable */\nimport type { WebhookEventDataInvoiceVoided } from './WebhookEventDataInvoiceVoided';\nimport type { WebhookEventEnvelope } from './WebhookEventEnvelope';\nexport type InvoiceVoidedEvent = (WebhookEventEnvelope & {\n type?: InvoiceVoidedEvent.type;\n data: WebhookEventDataInvoiceVoided;\n});\nexport namespace InvoiceVoidedEvent {\n export enum type {\n INVOICE_VOIDED = 'invoice.voided',\n }\n}\n\n","/* generated using openapi-typescript-codegen -- do not edit */\n/* istanbul ignore file */\n/* tslint:disable */\n/* eslint-disable */\nimport type { WebhookEventDataRecurringInvoicePaused } from './WebhookEventDataRecurringInvoicePaused';\nimport type { WebhookEventEnvelope } from './WebhookEventEnvelope';\nexport type RecurringInvoicePausedEvent = (WebhookEventEnvelope & {\n type?: RecurringInvoicePausedEvent.type;\n data: WebhookEventDataRecurringInvoicePaused;\n});\nexport namespace RecurringInvoicePausedEvent {\n export enum type {\n RECURRING_INVOICE_PAUSED = 'recurring_invoice.paused',\n }\n}\n\n","/* generated using openapi-typescript-codegen -- do not edit */\n/* istanbul ignore file */\n/* tslint:disable */\n/* eslint-disable */\nimport type { WebhookEventDataRepresentationSigned } from './WebhookEventDataRepresentationSigned';\nimport type { WebhookEventEnvelope } from './WebhookEventEnvelope';\nexport type RepresentationSignedEvent = (WebhookEventEnvelope & {\n type?: RepresentationSignedEvent.type;\n data: WebhookEventDataRepresentationSigned;\n});\nexport namespace RepresentationSignedEvent {\n export enum type {\n REPRESENTATION_SIGNED = 'representation.signed',\n }\n}\n\n","/* generated using openapi-typescript-codegen -- do not edit */\n/* istanbul ignore file */\n/* tslint:disable */\n/* eslint-disable */\nimport type { WebhookEventDataVeriFactuStatusUpdated } from './WebhookEventDataVeriFactuStatusUpdated';\nimport type { WebhookEventEnvelope } from './WebhookEventEnvelope';\nexport type VeriFactuStatusUpdatedEvent = (WebhookEventEnvelope & {\n type?: VeriFactuStatusUpdatedEvent.type;\n data: WebhookEventDataVeriFactuStatusUpdated;\n});\nexport namespace VeriFactuStatusUpdatedEvent {\n export enum type {\n VERIFACTU_STATUS_UPDATED = 'verifactu.status.updated',\n }\n}\n\n","/* generated using openapi-typescript-codegen -- do not edit */\n/* istanbul ignore file */\n/* tslint:disable */\n/* eslint-disable */\n/**\n * VeriFactu registration status. Same four values as the `verifactu.submission_status`\n * field of the invoice resource in the BeeL. API, so a status read from a webhook can be\n * fed straight back into the `verifactu_status` filter of `GET /v1/invoices`.\n * - `PENDING` — queued or submitted, awaiting a final AEAT response.\n * - `ACCEPTED` — accepted by the AEAT (with or without non-blocking remarks).\n * - `VOIDED` — cancellation record accepted by the AEAT.\n * - `REJECTED` — rejected by the AEAT, or the record never made it there.\n *\n */\nexport enum VeriFactuSubmissionStatus {\n PENDING = 'PENDING',\n ACCEPTED = 'ACCEPTED',\n VOIDED = 'VOIDED',\n REJECTED = 'REJECTED',\n}\n","/* generated using openapi-typescript-codegen -- do not edit */\n/* istanbul ignore file */\n/* tslint:disable */\n/* eslint-disable */\n/**\n * Canonical set of event types BeeL. can deliver. Subscribe to the ones your\n * integration cares about via `POST /v1/webhooks` in the Public API.\n *\n */\nexport enum WebhookEventType {\n VERIFACTU_STATUS_UPDATED = 'verifactu.status.updated',\n INVOICE_ISSUED = 'invoice.issued',\n INVOICE_EMAIL_SENT = 'invoice.email.sent',\n INVOICE_VOIDED = 'invoice.voided',\n RECURRING_INVOICE_PAUSED = 'recurring_invoice.paused',\n ACCOUNT_CLAIMED = 'account.claimed',\n COMPANY_CREATED = 'company.created',\n REPRESENTATION_SIGNED = 'representation.signed',\n}\n","import type { components } from '../generated/schema';\n\ntype CreateCustomerRequest = components['schemas']['CreateCustomerRequest'];\ntype Address = components['schemas']['Address'];\n\n/**\n * Fluent builder for creating customers with a clean, readable API.\n *\n * @example\n * ```typescript\n * const customer = CustomerBuilder.create()\n * .name('Acme Corporation SL')\n * .nif('B12345678')\n * .email('contact@acme.com')\n * .address('Calle Mayor', '1', '28001', 'Madrid', 'Madrid', 'Spain')\n * .build();\n * ```\n */\nexport class CustomerBuilder {\n private _name?: string;\n private _nif?: string;\n private _email?: string;\n private _phone?: string;\n private _address?: Address;\n private _notes?: string;\n\n private constructor() {}\n\n static create(): CustomerBuilder {\n return new CustomerBuilder();\n }\n\n name(name: string): this {\n this._name = name;\n return this;\n }\n\n nif(nif: string): this {\n this._nif = nif;\n return this;\n }\n\n email(email: string): this {\n this._email = email;\n return this;\n }\n\n phone(phone: string): this {\n this._phone = phone;\n return this;\n }\n\n address(street: string, number: string, postalCode: string, city: string, province: string, country: string, countryCode: string = 'ES'): this {\n this._address = { street, number, postal_code: postalCode, city, province, country, country_code: countryCode };\n return this;\n }\n\n notes(notes: string): this {\n this._notes = notes;\n return this;\n }\n\n build(): CreateCustomerRequest {\n if (!this._name || this._name.trim().length === 0) throw new Error('Legal name is required');\n if (!this._nif || this._nif.trim().length === 0) throw new Error('NIF/CIF is required');\n if (!this._address) throw new Error('Address is required');\n\n return {\n legal_name: this._name,\n nif: this._nif,\n email: this._email,\n phone: this._phone,\n address: this._address,\n notes: this._notes,\n };\n }\n}\n","import type { components } from '../generated/schema';\n\ntype CreateInvoiceRequest = components['schemas']['CreateInvoiceRequest'];\ntype InvoiceType = components['schemas']['InvoiceType'];\ntype Recipient = components['schemas']['Recipient'];\ntype InvoiceLine = CreateInvoiceRequest['lines'][number];\n\n/**\n * Fluent builder for creating invoices with a clean, readable API.\n *\n * @example\n * ```typescript\n * const invoice = InvoiceBuilder.create()\n * .forCustomer('customer-uuid')\n * .addLine('Consulting services', 10, 85.50)\n * .build();\n * ```\n */\nexport class InvoiceBuilder {\n private _type: InvoiceType = 'STANDARD';\n private _operationDate?: string;\n private _dueDate?: string;\n private _customerId?: string;\n private _lines: InvoiceLine[] = [];\n private _notes?: string;\n private _seriesId?: string;\n private _metadata?: Record<string, any>;\n\n private constructor() {}\n\n static create(): InvoiceBuilder {\n return new InvoiceBuilder();\n }\n\n type(type: InvoiceType): this {\n this._type = type;\n return this;\n }\n\n forCustomer(customerId: string): this {\n this._customerId = customerId;\n return this;\n }\n\n operationDate(date: string | Date): this {\n this._operationDate = date instanceof Date ? date.toISOString().split('T')[0] : date;\n return this;\n }\n\n dueDate(date: string | Date): this {\n this._dueDate = date instanceof Date ? date.toISOString().split('T')[0] : date;\n return this;\n }\n\n addLine(description: string, quantity: number, unitPrice: number, discountPercentage: number = 0): this {\n this._lines.push({ line_type: 'NORMAL', description, quantity, unit_price: unitPrice, discount_percentage: discountPercentage });\n return this;\n }\n\n addLineObject(line: InvoiceLine): this {\n this._lines.push(line);\n return this;\n }\n\n notes(notes: string): this {\n this._notes = notes;\n return this;\n }\n\n series(id: string): this {\n this._seriesId = id;\n return this;\n }\n\n metadata(data: Record<string, any>): this {\n this._metadata = data;\n return this;\n }\n\n build(): CreateInvoiceRequest {\n if (!this._customerId) throw new Error('Customer ID is required');\n if (this._lines.length === 0) throw new Error('At least one invoice line is required');\n\n const recipient: Recipient = { customer_id: this._customerId };\n\n return {\n type: this._type,\n operation_date: this._operationDate,\n due_date: this._dueDate,\n recipient,\n lines: this._lines,\n notes: this._notes,\n series_id: this._seriesId,\n metadata: this._metadata,\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,2BAAyB;;;ACAzB,oBAA2B;;;ACGpB,IAAM,eAAN,cAA2B,MAAM;AAAA,EAMtC,YACE,SACA,YACA,MACA,SACA,WACA;AACA,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,aAAa;AAClB,SAAK,OAAO;AACZ,SAAK,UAAU;AACf,SAAK,YAAY;AAAA,EACnB;AACF;AAGO,IAAM,qBAAN,cAAiC,aAAa;AAAA,EAGnD,YAAY,SAAiB,mBAA2B,WAAoB;AAC1E,UAAM,SAAS,KAAK,uBAAuB,QAAW,SAAS;AAC/D,SAAK,OAAO;AACZ,SAAK,oBAAoB;AAAA,EAC3B;AACF;AAGO,IAAM,sBAAN,cAAkC,aAAa;AAAA,EACpD,YACE,SACA,SACA,WACA;AACA,UAAM,SAAS,KAAK,wB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cAAc,MAA2B;AACvC,SAAK,iBAAiB,gBAAgB,OAAO,KAAK,YAAY,EAAE,MAAM,GAAG,EAAE,CAAC,IAAI;AAChF,WAAO;AAAA,EACT;AAAA,EAEA,QAAQ,MAA2B;AACjC,SAAK,WAAW,gBAAgB,OAAO,KAAK,YAAY,EAAE,MAAM,GAAG,EAAE,CAAC,IAAI;AAC1E,WAAO;AAAA,EACT;AAAA,EAEA,QAAQ,aAAqB,UAAkB,WAAmB,qBAA6B,GAAS;AACtG,SAAK,OAAO,KAAK,EAAE,WAAW,UAAU,aAAa,UAAU,YAAY,WAAW,qBAAqB,mBAAmB,CAAC;AAC/H,WAAO;AAAA,EACT;AAAA,EAEA,cAAc,MAAyB;AACrC,SAAK,OAAO,KAAK,IAAI;AACrB,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,OAAqB;AACzB,SAAK,SAAS;AACd,WAAO;AAAA,EACT;AAAA,EAEA,OAAO,IAAkB;AACvB,SAAK,YAAY;AACjB,WAAO;AAAA,EACT;AAAA,EAEA,SAAS,MAAiC;AACxC,SAAK,YAAY;AACjB,WAAO;AAAA,EACT;AAAA,EAEA,QAA8B;AAC5B,QAAI,CAAC,KAAK,YAAa,OAAM,IAAI,MAAM,yBAAyB;AAChE,QAAI,KAAK,OAAO,WAAW,EAAG,OAAM,IAAI,MAAM,uCAAuC;AAErF,UAAM,YAAuB,EAAE,aAAa,KAAK,YAAY;AAE7D,WAAO;AAAA,MACL,MAAM,KAAK;AAAA,MACX,gBAAgB,KAAK;AAAA,MACrB,UAAU,KAAK;AAAA,MACf;AAAA,MACA,OAAO,KAAK;AAAA,MACZ,OAAO,KAAK;AAAA,MACZ,WAAW,KAAK;AAAA,MAChB,UAAU,KAAK;AAAA,IACjB;AAAA,EACF;AACF;","names":["createClient","import_crypto","AccountClaimedEvent","type","CompanyCreatedEvent","type","InvoiceEmailSentEvent","type","InvoiceIssuedEvent","type","InvoiceVoidedEvent","type","RecurringInvoicePausedEvent","type","RepresentationSignedEvent","type","VeriFactuStatusUpdatedEvent","type","VeriFactuSubmissionStatus","WebhookEventType"]}
|