@timbrix/sdk 1.3.0 → 1.4.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/dist/index.d.mts CHANGED
@@ -638,6 +638,16 @@ declare class InvoicesResource {
638
638
  * belong to `organizationId`).
639
639
  */
640
640
  create(organizationId: string, data: CreateInvoiceInput): Promise<Invoice>;
641
+ /**
642
+ * Generate a PDF preview of a CFDI 4.0 invoice without stamping
643
+ * (timbrar) it via the PAC. Nothing is persisted and no stamping quota
644
+ * is consumed. Accepts the same body shape as `create`. Works with
645
+ * either a Supabase bearer session (internal dashboard, the user must
646
+ * be a member of `organizationId`) or an API key (external
647
+ * integrations, requires the `write:invoices` scope — the key must
648
+ * belong to `organizationId`).
649
+ */
650
+ previewPdf(organizationId: string, data: CreateInvoiceInput): Promise<Blob>;
641
651
  /**
642
652
  * List invoices for an organization, newest first. Works with either a
643
653
  * Supabase bearer session or an API key (requires the `read:invoices`
package/dist/index.d.ts CHANGED
@@ -638,6 +638,16 @@ declare class InvoicesResource {
638
638
  * belong to `organizationId`).
639
639
  */
640
640
  create(organizationId: string, data: CreateInvoiceInput): Promise<Invoice>;
641
+ /**
642
+ * Generate a PDF preview of a CFDI 4.0 invoice without stamping
643
+ * (timbrar) it via the PAC. Nothing is persisted and no stamping quota
644
+ * is consumed. Accepts the same body shape as `create`. Works with
645
+ * either a Supabase bearer session (internal dashboard, the user must
646
+ * be a member of `organizationId`) or an API key (external
647
+ * integrations, requires the `write:invoices` scope — the key must
648
+ * belong to `organizationId`).
649
+ */
650
+ previewPdf(organizationId: string, data: CreateInvoiceInput): Promise<Blob>;
641
651
  /**
642
652
  * List invoices for an organization, newest first. Works with either a
643
653
  * Supabase bearer session or an API key (requires the `read:invoices`
package/dist/index.js CHANGED
@@ -223,6 +223,20 @@ var InvoicesResource = class {
223
223
  async create(organizationId, data) {
224
224
  return this.http.post(`organizations/${organizationId}/invoices`, { json: data }).json();
225
225
  }
226
+ /**
227
+ * Generate a PDF preview of a CFDI 4.0 invoice without stamping
228
+ * (timbrar) it via the PAC. Nothing is persisted and no stamping quota
229
+ * is consumed. Accepts the same body shape as `create`. Works with
230
+ * either a Supabase bearer session (internal dashboard, the user must
231
+ * be a member of `organizationId`) or an API key (external
232
+ * integrations, requires the `write:invoices` scope — the key must
233
+ * belong to `organizationId`).
234
+ */
235
+ async previewPdf(organizationId, data) {
236
+ return this.http.post(`organizations/${organizationId}/invoices/preview/pdf`, {
237
+ json: data
238
+ }).blob();
239
+ }
226
240
  /**
227
241
  * List invoices for an organization, newest first. Works with either a
228
242
  * Supabase bearer session or an API key (requires the `read:invoices`
package/dist/index.mjs CHANGED
@@ -175,6 +175,20 @@ var InvoicesResource = class {
175
175
  async create(organizationId, data) {
176
176
  return this.http.post(`organizations/${organizationId}/invoices`, { json: data }).json();
177
177
  }
178
+ /**
179
+ * Generate a PDF preview of a CFDI 4.0 invoice without stamping
180
+ * (timbrar) it via the PAC. Nothing is persisted and no stamping quota
181
+ * is consumed. Accepts the same body shape as `create`. Works with
182
+ * either a Supabase bearer session (internal dashboard, the user must
183
+ * be a member of `organizationId`) or an API key (external
184
+ * integrations, requires the `write:invoices` scope — the key must
185
+ * belong to `organizationId`).
186
+ */
187
+ async previewPdf(organizationId, data) {
188
+ return this.http.post(`organizations/${organizationId}/invoices/preview/pdf`, {
189
+ json: data
190
+ }).blob();
191
+ }
178
192
  /**
179
193
  * List invoices for an organization, newest first. Works with either a
180
194
  * Supabase bearer session or an API key (requires the `read:invoices`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timbrix/sdk",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "TypeScript SDK for Timbrix API",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",