@timbrix/sdk 1.1.0 → 1.2.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
@@ -455,6 +455,8 @@ interface InvoiceTaxInput {
455
455
  rate?: string;
456
456
  base?: number;
457
457
  amount?: number;
458
+ /** true = retención, false/omitted = traslado */
459
+ withholding?: boolean;
458
460
  }
459
461
  interface InvoiceItemInput {
460
462
  quantity: number;
@@ -476,6 +478,8 @@ interface InvoiceItemInput {
476
478
  interface CreateInvoiceInput {
477
479
  /** Ingreso, Egreso, or Traslado — default: I */
478
480
  type?: "I" | "E" | "T";
481
+ /** Required when type is "E" — UUID fiscal of the original Ingreso CFDI */
482
+ relatedInvoiceUuid?: string;
479
483
  series: string;
480
484
  folioNumber: string;
481
485
  date: string;
@@ -507,6 +511,8 @@ interface Invoice {
507
511
  id: string;
508
512
  uuid: string;
509
513
  status: "valid";
514
+ /** I = Ingreso, E = Egreso, T = Traslado */
515
+ type: "I" | "E" | "T";
510
516
  series: string;
511
517
  folioNumber: string;
512
518
  total: number;
@@ -519,6 +525,10 @@ interface ListInvoicesParams {
519
525
  page?: number;
520
526
  /** Results per page (1-100). Default: 20 */
521
527
  limit?: number;
528
+ /** Filter by tipo de comprobante */
529
+ type?: "I" | "E" | "T";
530
+ /** Filter by status */
531
+ status?: "vigente" | "cancelado";
522
532
  }
523
533
  interface InvoiceListItem {
524
534
  id: string;
package/dist/index.d.ts CHANGED
@@ -455,6 +455,8 @@ interface InvoiceTaxInput {
455
455
  rate?: string;
456
456
  base?: number;
457
457
  amount?: number;
458
+ /** true = retención, false/omitted = traslado */
459
+ withholding?: boolean;
458
460
  }
459
461
  interface InvoiceItemInput {
460
462
  quantity: number;
@@ -476,6 +478,8 @@ interface InvoiceItemInput {
476
478
  interface CreateInvoiceInput {
477
479
  /** Ingreso, Egreso, or Traslado — default: I */
478
480
  type?: "I" | "E" | "T";
481
+ /** Required when type is "E" — UUID fiscal of the original Ingreso CFDI */
482
+ relatedInvoiceUuid?: string;
479
483
  series: string;
480
484
  folioNumber: string;
481
485
  date: string;
@@ -507,6 +511,8 @@ interface Invoice {
507
511
  id: string;
508
512
  uuid: string;
509
513
  status: "valid";
514
+ /** I = Ingreso, E = Egreso, T = Traslado */
515
+ type: "I" | "E" | "T";
510
516
  series: string;
511
517
  folioNumber: string;
512
518
  total: number;
@@ -519,6 +525,10 @@ interface ListInvoicesParams {
519
525
  page?: number;
520
526
  /** Results per page (1-100). Default: 20 */
521
527
  limit?: number;
528
+ /** Filter by tipo de comprobante */
529
+ type?: "I" | "E" | "T";
530
+ /** Filter by status */
531
+ status?: "vigente" | "cancelado";
522
532
  }
523
533
  interface InvoiceListItem {
524
534
  id: string;
package/dist/index.js CHANGED
@@ -232,6 +232,8 @@ var InvoicesResource = class {
232
232
  const searchParams = {};
233
233
  if (params?.page !== void 0) searchParams.page = String(params.page);
234
234
  if (params?.limit !== void 0) searchParams.limit = String(params.limit);
235
+ if (params?.type !== void 0) searchParams.type = params.type;
236
+ if (params?.status !== void 0) searchParams.status = params.status;
235
237
  return this.http.get(`organizations/${organizationId}/invoices`, {
236
238
  searchParams: Object.keys(searchParams).length > 0 ? searchParams : void 0
237
239
  }).json();
package/dist/index.mjs CHANGED
@@ -184,6 +184,8 @@ var InvoicesResource = class {
184
184
  const searchParams = {};
185
185
  if (params?.page !== void 0) searchParams.page = String(params.page);
186
186
  if (params?.limit !== void 0) searchParams.limit = String(params.limit);
187
+ if (params?.type !== void 0) searchParams.type = params.type;
188
+ if (params?.status !== void 0) searchParams.status = params.status;
187
189
  return this.http.get(`organizations/${organizationId}/invoices`, {
188
190
  searchParams: Object.keys(searchParams).length > 0 ? searchParams : void 0
189
191
  }).json();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timbrix/sdk",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "TypeScript SDK for Timbrix API",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",