sinfactura-types 1.5.6 → 1.6.1

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.
Files changed (70) hide show
  1. package/README.md +42 -6
  2. package/dist/account.d.ts +2 -0
  3. package/dist/basket.d.ts +2 -0
  4. package/dist/currency.d.ts +0 -6
  5. package/dist/invoice.d.ts +1 -0
  6. package/dist/order.d.ts +2 -0
  7. package/dist/payment.d.ts +2 -0
  8. package/dist/product.d.ts +2 -0
  9. package/dist/store.d.ts +13 -12
  10. package/dist/supplier.d.ts +4 -0
  11. package/package.json +1 -1
  12. package/dist/src/account.d.ts +0 -21
  13. package/dist/src/account.js +0 -1
  14. package/dist/src/afip.d.ts +0 -82
  15. package/dist/src/afip.js +0 -1
  16. package/dist/src/api.d.ts +0 -11
  17. package/dist/src/api.js +0 -1
  18. package/dist/src/audit.d.ts +0 -35
  19. package/dist/src/audit.js +0 -1
  20. package/dist/src/auth.d.ts +0 -20
  21. package/dist/src/auth.js +0 -1
  22. package/dist/src/basket.d.ts +0 -27
  23. package/dist/src/basket.js +0 -1
  24. package/dist/src/brands.d.ts +0 -14
  25. package/dist/src/brands.js +0 -1
  26. package/dist/src/cash.d.ts +0 -14
  27. package/dist/src/cash.js +0 -1
  28. package/dist/src/categories.d.ts +0 -14
  29. package/dist/src/categories.js +0 -1
  30. package/dist/src/currency.d.ts +0 -39
  31. package/dist/src/currency.js +0 -1
  32. package/dist/src/customer.d.ts +0 -63
  33. package/dist/src/customer.js +0 -1
  34. package/dist/src/imports.d.ts +0 -21
  35. package/dist/src/imports.js +0 -1
  36. package/dist/src/index.d.ts +0 -28
  37. package/dist/src/index.js +0 -28
  38. package/dist/src/invoice.d.ts +0 -63
  39. package/dist/src/invoice.js +0 -1
  40. package/dist/src/log.d.ts +0 -22
  41. package/dist/src/log.js +0 -1
  42. package/dist/src/maintenance.d.ts +0 -14
  43. package/dist/src/maintenance.js +0 -1
  44. package/dist/src/mercadopago.d.ts +0 -66
  45. package/dist/src/mercadopago.js +0 -1
  46. package/dist/src/notification.d.ts +0 -26
  47. package/dist/src/notification.js +0 -1
  48. package/dist/src/order.d.ts +0 -74
  49. package/dist/src/order.js +0 -1
  50. package/dist/src/payment.d.ts +0 -105
  51. package/dist/src/payment.js +0 -1
  52. package/dist/src/product.d.ts +0 -50
  53. package/dist/src/product.js +0 -1
  54. package/dist/src/provinces.d.ts +0 -2
  55. package/dist/src/provinces.js +0 -27
  56. package/dist/src/return.d.ts +0 -35
  57. package/dist/src/return.js +0 -1
  58. package/dist/src/stock.d.ts +0 -22
  59. package/dist/src/stock.js +0 -1
  60. package/dist/src/store.d.ts +0 -257
  61. package/dist/src/store.js +0 -1
  62. package/dist/src/subscription.d.ts +0 -292
  63. package/dist/src/subscription.js +0 -24
  64. package/dist/src/supplier.d.ts +0 -57
  65. package/dist/src/supplier.js +0 -1
  66. package/dist/src/user.d.ts +0 -49
  67. package/dist/src/user.js +0 -1
  68. package/dist/src/whatsapp.d.ts +0 -92
  69. package/dist/src/whatsapp.js +0 -1
  70. package/dist/tsconfig.tsbuildinfo +0 -1
package/README.md CHANGED
@@ -23,8 +23,26 @@ The package contains only TypeScript type declarations — no runtime code. Zod
23
23
 
24
24
  ## Installation
25
25
 
26
+ Two distribution channels:
27
+
28
+ ### Git (preferred — no NPM publish step)
29
+
30
+ Consumers reference the auto-built `dist` branch directly:
31
+
32
+ ```jsonc
33
+ // app/package.json (and api, web, landing)
34
+ {
35
+ "devDependencies": {
36
+ "sinfactura-types": "github:sinfactura/types#dist"
37
+ }
38
+ }
39
+ ```
40
+
41
+ The [`build-dist`](.github/workflows/build-dist.yml) GitHub Actions workflow runs on every push to `main`, builds `dist/`, and force-pushes a clean orphan commit to the `dist` branch. Consumers fetch a ready-to-use package — no build step required at install time.
42
+
43
+ ### npm (legacy — being phased out)
44
+
26
45
  ```bash
27
- # In a SINFACTURA consumer repo (app, web, etc.)
28
46
  yarn add --dev sinfactura-types
29
47
  ```
30
48
 
@@ -34,16 +52,34 @@ yarn add --dev sinfactura-types
34
52
  import type { IUser, IOrder, IInvoice, IProduct } from "sinfactura-types";
35
53
  ```
36
54
 
37
- ## Publishing a New Version
55
+ ## Updating Types
38
56
 
39
- 1. Bump the `version` field in `package.json` (follow semver)
40
- 2. Publish to npm:
57
+ ### Authoring side (this repo)
58
+
59
+ 1. Edit types in `src/`.
60
+ 2. Commit + push to `main`.
61
+ 3. The `build-dist` workflow runs automatically, force-pushes the new build to `dist`.
62
+
63
+ No manual version bump, no NPM publish. (The `version` field in `package.json` still gets bumped for npm publishing if/when needed; consumers using the git URL ignore it — they pin commit hashes via their lockfiles.)
64
+
65
+ ### Consumer side (app, api, web, landing)
66
+
67
+ After a new types build lands, consumers explicitly pull it:
41
68
 
42
69
  ```bash
43
- yarn publish
70
+ yarn up "sinfactura-types@github:sinfactura/types#dist"
44
71
  ```
45
72
 
46
- 3. In each consumer repo, bump the `sinfactura-types` dependency (e.g. `app` currently uses `^1.0.90`)
73
+ This re-resolves the git ref to the latest commit on `dist` and pins it in the lockfile. Commit the lockfile change.
74
+
75
+ > **Why explicit?** `yarn install` does NOT re-resolve git branch refs to their current HEAD — it reuses the cached resolution for reproducibility. Consumers that want auto-bump-on-pull can add a `post-merge` Husky hook that runs `yarn up sinfactura-types@github:sinfactura/types#dist` whenever `package.json`/`yarn.lock` changed in the merge.
76
+
77
+ ## Legacy: Publishing a New NPM Version
78
+
79
+ Kept for reference / external consumers. New SINFACTURA repos should use the git URL instead.
80
+
81
+ 1. Bump the `version` field in `package.json` (follow semver)
82
+ 2. Publish to npm: `yarn publish`
47
83
 
48
84
  ## License
49
85
 
package/dist/account.d.ts CHANGED
@@ -12,7 +12,9 @@ declare global {
12
12
  debit?: number;
13
13
  credit?: number;
14
14
  amount?: number;
15
+ currency?: string;
15
16
  currencyValue?: number;
17
+ currencyValueAt?: number;
16
18
  balance?: number;
17
19
  userId: string;
18
20
  deleted?: boolean;
package/dist/basket.d.ts CHANGED
@@ -7,6 +7,8 @@ declare global {
7
7
  updatedAt: number;
8
8
  quantity: number;
9
9
  currency: string;
10
+ currencyValue?: number;
11
+ currencyValueAt?: number;
10
12
  cost: number;
11
13
  total: number;
12
14
  items: BasketItem[];
@@ -15,12 +15,6 @@ declare global {
15
15
  catalogId: string;
16
16
  value: number;
17
17
  order?: number;
18
- autoUpdate?: {
19
- sourceId: string;
20
- strategy: "overwrite" | "overwrite-if-stale" | "notify-only";
21
- lastUpdatedAt?: number;
22
- lastValue?: number;
23
- };
24
18
  }
25
19
  interface StoreCurrencySubscriptionView extends StoreCurrencySubscription {
26
20
  isoCode: string;
package/dist/invoice.d.ts CHANGED
@@ -17,6 +17,7 @@ declare global {
17
17
  cuit: string;
18
18
  currency?: string;
19
19
  currencyValue?: number;
20
+ currencyValueAt?: number;
20
21
  fiscalCondition: string;
21
22
  paymentCondition: string;
22
23
  deliveryCondition: string;
package/dist/order.d.ts CHANGED
@@ -11,6 +11,8 @@ declare global {
11
11
  deliveredDate?: number;
12
12
  comments?: string;
13
13
  currency: string;
14
+ currencyValue?: number;
15
+ currencyValueAt?: number;
14
16
  paymentMethod: number;
15
17
  deliveryMethod: number;
16
18
  invoiceMethod?: {
package/dist/payment.d.ts CHANGED
@@ -33,6 +33,8 @@ export interface PaymentReceived {
33
33
  source: PaymentReceivedSource;
34
34
  total: number;
35
35
  currency: string;
36
+ currencyValue?: number;
37
+ currencyValueAt?: number;
36
38
  payerName?: string;
37
39
  payerEmail?: string;
38
40
  payerCuit?: string;
package/dist/product.d.ts CHANGED
@@ -34,6 +34,8 @@ declare global {
34
34
  totalSales?: number;
35
35
  zone?: string;
36
36
  currency: string;
37
+ currencyValue?: number;
38
+ currencyValueAt?: number;
37
39
  ivaType: number;
38
40
  categoryId: string;
39
41
  brandId: string;
package/dist/store.d.ts CHANGED
@@ -148,19 +148,8 @@ declare global {
148
148
  products?: number;
149
149
  users?: number;
150
150
  };
151
- /**
152
- * @deprecated api#890 — use `store.integrations.mercadopago`. This
153
- * top-level field is dual-written for one release window and removed
154
- * in the api#890 cleanup PR.
155
- */
156
- mercadopago?: Mercadopago;
157
- /**
158
- * @deprecated api#890 — use `store.integrations.afip`. This top-level
159
- * field is dual-written for one release window and removed in the
160
- * api#890 cleanup PR.
161
- */
162
- afip: Afip;
163
151
  integrations?: StoreIntegrations;
152
+ fxAutoUpdate?: StoreFxAutoUpdate;
164
153
  appVersion: number;
165
154
  fiscalConditions: FiscalCondition[];
166
155
  ivaTypes: Method[];
@@ -173,6 +162,18 @@ declare global {
173
162
  afip?: Afip;
174
163
  mercadopago?: Mercadopago;
175
164
  }
165
+ type FxAutoUpdateStrategy = "overwrite" | "overwrite-if-stale" | "notify-only";
166
+ interface FxAutoUpdateBinding {
167
+ catalogId: string;
168
+ sourceId: string;
169
+ strategy: FxAutoUpdateStrategy;
170
+ lastUpdatedAt?: number;
171
+ lastValue?: number;
172
+ }
173
+ interface StoreFxAutoUpdate {
174
+ enabled: boolean;
175
+ bindings: FxAutoUpdateBinding[];
176
+ }
176
177
  interface Mercadopago {
177
178
  userId?: string;
178
179
  accessToken?: string;
@@ -34,7 +34,9 @@ declare global {
34
34
  per_iibb: number;
35
35
  per_iva: number;
36
36
  file: string;
37
+ currency?: string;
37
38
  currencyValue: number;
39
+ currencyValueAt?: number;
38
40
  }
39
41
  interface SupplierAccount {
40
42
  storeId: string;
@@ -49,7 +51,9 @@ declare global {
49
51
  debit: number;
50
52
  credit: number;
51
53
  amount: number;
54
+ currency?: string;
52
55
  currencyValue: number;
56
+ currencyValueAt?: number;
53
57
  balance: number;
54
58
  deleted: boolean;
55
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.5.6",
3
+ "version": "1.6.1",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -1,21 +0,0 @@
1
- declare global {
2
- interface Account {
3
- storeId: string;
4
- accountId: string;
5
- orderId?: string;
6
- createdAt: number;
7
- dated: number;
8
- customerId?: string;
9
- fullName?: string;
10
- subject?: string;
11
- details: string;
12
- debit?: number;
13
- credit?: number;
14
- amount?: number;
15
- currencyValue?: number;
16
- balance?: number;
17
- userId: string;
18
- deleted?: boolean;
19
- }
20
- }
21
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,82 +0,0 @@
1
- declare global {
2
- interface AfipImpuesto {
3
- descripcionImpuesto: string;
4
- idImpuesto: number;
5
- periodo: number;
6
- }
7
- interface AfipActividad {
8
- descripcionActividad: string;
9
- idActividad: number;
10
- nomenclador: number;
11
- orden: number;
12
- periodo: number;
13
- }
14
- interface AfipErrorConstancia {
15
- apellido?: string;
16
- error: string[];
17
- idPersona: number;
18
- nombre?: string;
19
- razonSocial?: string;
20
- }
21
- interface AfipDomicilioFiscal {
22
- codPostal: string;
23
- datoAdicional?: string;
24
- descripcionProvincia: string;
25
- direccion: string;
26
- idProvincia: number;
27
- localidad?: string;
28
- tipoDatoAdicional?: string;
29
- tipoDomicilio: string;
30
- }
31
- interface AfipDatosGenerales {
32
- apellido?: string;
33
- domicilioFiscal: AfipDomicilioFiscal;
34
- esSucesion: string;
35
- estadoClave: string;
36
- fechaContratoSocial?: string;
37
- idPersona: number;
38
- mesCierre: number;
39
- razonSocial?: string;
40
- nombre?: string;
41
- tipoClave: string;
42
- tipoPersona: "FISICA" | "JURIDICA";
43
- }
44
- interface AfipCategoria {
45
- descripcionCategoria: string;
46
- idCategoria: number;
47
- idImpuesto: number;
48
- perdiodo: number;
49
- }
50
- interface AfipRegimen {
51
- descripcionRegimen: string;
52
- idImpuesto: number;
53
- idRegimen: number;
54
- periodo: number;
55
- tipoRegimen?: string;
56
- }
57
- interface AfipDatosMonotributo {
58
- actividad?: AfipActividad[];
59
- actividadMonotributista: AfipActividad;
60
- categoriaMonotributo: AfipCategoria;
61
- impuestos?: AfipImpuesto[];
62
- impuesto: AfipImpuesto[];
63
- }
64
- interface AfipDatosRegimenGeneral {
65
- actividad: AfipActividad[];
66
- categoriaAutonomo?: AfipCategoria;
67
- impuesto: AfipImpuesto[];
68
- regimen?: AfipRegimen[];
69
- }
70
- interface AfipErrorRegimenGeneral {
71
- error: string[];
72
- mensaje: string;
73
- }
74
- interface CuitAfip {
75
- datosGenerales?: AfipDatosGenerales;
76
- datosMonotributo?: AfipDatosMonotributo;
77
- datosRegimenGeneral?: AfipDatosRegimenGeneral;
78
- errorConstancia?: AfipErrorConstancia;
79
- errorRegimenGeneral?: AfipErrorRegimenGeneral;
80
- }
81
- }
82
- export {};
package/dist/src/afip.js DELETED
@@ -1 +0,0 @@
1
- export {};
package/dist/src/api.d.ts DELETED
@@ -1,11 +0,0 @@
1
- declare global {
2
- interface ResponseApi<T = Record<string, string>> {
3
- status: boolean;
4
- error: string | null;
5
- message: string | null;
6
- data: T;
7
- ConsumedCapacity?: Record<string, string | number>;
8
- LastEvaluatedKey?: Record<string, string>;
9
- }
10
- }
11
- export {};
package/dist/src/api.js DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,35 +0,0 @@
1
- declare global {
2
- interface OrderAudit {
3
- storeId: string;
4
- auditId: string;
5
- orderId: string;
6
- userId: string;
7
- fullName?: string;
8
- action: OrderAuditAction;
9
- createdAt: number;
10
- dated: number;
11
- changes?: OrderAuditChange[];
12
- itemChanges?: {
13
- added: Partial<BasketItem>[];
14
- removed: Partial<BasketItem>[];
15
- modified: Array<{
16
- productId: string;
17
- name?: string;
18
- oldQuantity: number;
19
- newQuantity: number;
20
- oldPrice: number;
21
- newPrice: number;
22
- }>;
23
- };
24
- oldTotal?: number;
25
- newTotal?: number;
26
- returnId?: string;
27
- }
28
- interface OrderAuditChange {
29
- field: string;
30
- oldValue: unknown;
31
- newValue: unknown;
32
- }
33
- type OrderAuditAction = 'order_created' | 'order_edited' | 'order_ready' | 'order_delivered' | 'order_delivery_cancelled' | 'order_disabled' | 'order_enabled' | 'order_returned' | 'discount_changed' | 'payment_method_changed' | 'delivery_method_changed' | 'delivery_address_changed' | 'invoice_created' | 'credit_note_created';
34
- }
35
- export {};
package/dist/src/audit.js DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,20 +0,0 @@
1
- declare global {
2
- interface Login {
3
- email: string;
4
- password: string;
5
- }
6
- interface Social {
7
- accessToken?: string;
8
- }
9
- interface Register {
10
- email: string;
11
- password: string;
12
- cuit: string;
13
- fullName: string;
14
- phone?: number;
15
- }
16
- interface Recover {
17
- email: string;
18
- }
19
- }
20
- export {};
package/dist/src/auth.js DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,27 +0,0 @@
1
- declare global {
2
- interface Basket {
3
- storeId: string;
4
- customerId: string;
5
- customer: Partial<Customer>;
6
- createdAt: number;
7
- updatedAt: number;
8
- quantity: number;
9
- currency: string;
10
- cost: number;
11
- total: number;
12
- items: BasketItem[];
13
- }
14
- interface BasketItem {
15
- dated: number;
16
- productId: string;
17
- sku: string;
18
- pictures: Product['pictures'];
19
- name: string;
20
- zone?: string;
21
- quantity: number;
22
- ivaType: number;
23
- cost: number;
24
- price: number;
25
- }
26
- }
27
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,14 +0,0 @@
1
- declare global {
2
- interface Brand {
3
- storeId: string;
4
- brandId: string;
5
- name: string;
6
- photoURL?: string;
7
- photoData?: string;
8
- removePhotoURL?: string;
9
- isFather: boolean;
10
- father?: string;
11
- disabled: boolean;
12
- }
13
- }
14
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,14 +0,0 @@
1
- declare global {
2
- interface Cash {
3
- storeId: string;
4
- cashId: string;
5
- createdAt: number;
6
- dated: number;
7
- description: string;
8
- income?: number;
9
- outcome?: number;
10
- balance?: number;
11
- subject?: string;
12
- }
13
- }
14
- export {};
package/dist/src/cash.js DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,14 +0,0 @@
1
- declare global {
2
- interface Category {
3
- storeId: string;
4
- categoryId: string;
5
- name: string;
6
- photoURL?: string;
7
- photoData?: string;
8
- removePhotoURL?: string;
9
- isFather: boolean;
10
- father?: string;
11
- disabled: boolean;
12
- }
13
- }
14
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,39 +0,0 @@
1
- declare global {
2
- type CurrencyVariant = "oficial" | "blue" | "mep" | "ccl" | "turista" | "informal" | "cripto" | "oficial-bcra";
3
- interface PlatformCurrency {
4
- catalogId: string;
5
- isoCode: string;
6
- variant: CurrencyVariant;
7
- displayName: string;
8
- afipCode: "PES" | "DOL" | null;
9
- decimals: number;
10
- enabled: boolean;
11
- createdAt: number;
12
- updatedAt?: number;
13
- }
14
- interface StoreCurrencySubscription {
15
- catalogId: string;
16
- value: number;
17
- order?: number;
18
- autoUpdate?: {
19
- sourceId: string;
20
- strategy: "overwrite" | "overwrite-if-stale" | "notify-only";
21
- lastUpdatedAt?: number;
22
- lastValue?: number;
23
- };
24
- }
25
- interface StoreCurrencySubscriptionView extends StoreCurrencySubscription {
26
- isoCode: string;
27
- variant: CurrencyVariant;
28
- displayName: string;
29
- afipCode?: "PES" | "DOL" | null;
30
- decimals?: number;
31
- }
32
- interface Currency {
33
- catalogId: string;
34
- dated: string;
35
- value: number;
36
- source?: string;
37
- }
38
- }
39
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,63 +0,0 @@
1
- declare global {
2
- interface CustomerAfip {
3
- cuit: string;
4
- razonSocial: string;
5
- condFiscal: number;
6
- condFiscalName: string;
7
- address: string;
8
- postalCode: string;
9
- city: string;
10
- province: string;
11
- }
12
- interface CustomerMarketing {
13
- adds?: boolean;
14
- email?: boolean;
15
- phone?: boolean;
16
- sms?: boolean;
17
- whatsapp?: boolean;
18
- }
19
- interface Customer {
20
- storeId: string;
21
- customerId: string;
22
- address: string;
23
- afip: CustomerAfip[];
24
- balance?: number;
25
- city: string;
26
- createdAt: number;
27
- cuit: string;
28
- deliveryMethod: number;
29
- disabled: boolean;
30
- discount: number;
31
- email: string;
32
- favorites?: Partial<Product>[];
33
- fullName: string;
34
- hash?: string;
35
- lastBuy?: number;
36
- lastLog?: number;
37
- marketing?: CustomerMarketing;
38
- minBuy?: number;
39
- paymentMethod: number;
40
- phone: string;
41
- photoURL: string;
42
- postalCode: string;
43
- priceList: number;
44
- province: string;
45
- salt?: string;
46
- search: string;
47
- updatedAt?: number;
48
- currencyId?: string;
49
- deliveryAddress?: {
50
- fullName: string;
51
- address: string;
52
- phone: string;
53
- city: string;
54
- province: string;
55
- postalCode: string;
56
- };
57
- }
58
- interface AuthCustomer extends Customer {
59
- accessToken: string;
60
- refreshToken: string;
61
- }
62
- }
63
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,21 +0,0 @@
1
- declare global {
2
- interface ProductSale {
3
- pk: string;
4
- sk: string;
5
- orderId: string;
6
- customerId: string;
7
- fullName: string;
8
- quantity: number;
9
- price: number;
10
- }
11
- interface ProductIncome {
12
- pk: string;
13
- sk: string;
14
- orderId?: string;
15
- supplierId: string;
16
- supplierName?: string;
17
- quantity: number;
18
- cost: number;
19
- }
20
- }
21
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,28 +0,0 @@
1
- export * from "./account";
2
- export * from "./afip";
3
- export * from "./api";
4
- export * from "./audit";
5
- export * from "./auth";
6
- export * from "./basket";
7
- export * from "./brands";
8
- export * from "./cash";
9
- export * from "./categories";
10
- export * from "./currency";
11
- export * from "./customer";
12
- export * from "./imports";
13
- export * from "./invoice";
14
- export * from "./log";
15
- export * from "./maintenance";
16
- export * from "./mercadopago";
17
- export * from "./notification";
18
- export * from "./order";
19
- export * from "./payment";
20
- export * from "./product";
21
- export * from "./return";
22
- export * from "./stock";
23
- export * from "./store";
24
- export * from "./subscription";
25
- export * from "./supplier";
26
- export * from "./user";
27
- export * from "./whatsapp";
28
- export * from "./provinces";