@araitek/smartdocjs 0.1.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/CHANGELOG.md +37 -0
- package/LICENSE +21 -0
- package/README.md +207 -0
- package/dist/cjs/builders/associated.js +108 -0
- package/dist/cjs/builders/associated.js.map +1 -0
- package/dist/cjs/builders/index.js +13 -0
- package/dist/cjs/builders/index.js.map +1 -0
- package/dist/cjs/builders/items.js +204 -0
- package/dist/cjs/builders/items.js.map +1 -0
- package/dist/cjs/builders/recipient.js +252 -0
- package/dist/cjs/builders/recipient.js.map +1 -0
- package/dist/cjs/client.js +110 -0
- package/dist/cjs/client.js.map +1 -0
- package/dist/cjs/constants/apiErrors.js +45 -0
- package/dist/cjs/constants/apiErrors.js.map +1 -0
- package/dist/cjs/constants/catalog.js +126 -0
- package/dist/cjs/constants/catalog.js.map +1 -0
- package/dist/cjs/constants/countries.js +94 -0
- package/dist/cjs/constants/countries.js.map +1 -0
- package/dist/cjs/constants/countriesData.js +13 -0
- package/dist/cjs/constants/countriesData.js.map +1 -0
- package/dist/cjs/constants/documents.js +145 -0
- package/dist/cjs/constants/documents.js.map +1 -0
- package/dist/cjs/constants/events.js +103 -0
- package/dist/cjs/constants/events.js.map +1 -0
- package/dist/cjs/constants/index.js +108 -0
- package/dist/cjs/constants/index.js.map +1 -0
- package/dist/cjs/constants/permissions.js +63 -0
- package/dist/cjs/constants/permissions.js.map +1 -0
- package/dist/cjs/constants/sifen.js +159 -0
- package/dist/cjs/constants/sifen.js.map +1 -0
- package/dist/cjs/constants/statuses.js +171 -0
- package/dist/cjs/constants/statuses.js.map +1 -0
- package/dist/cjs/core/config.js +314 -0
- package/dist/cjs/core/config.js.map +1 -0
- package/dist/cjs/core/dates.js +70 -0
- package/dist/cjs/core/dates.js.map +1 -0
- package/dist/cjs/core/decimal.js +194 -0
- package/dist/cjs/core/decimal.js.map +1 -0
- package/dist/cjs/core/pagination.js +90 -0
- package/dist/cjs/core/pagination.js.map +1 -0
- package/dist/cjs/core/transport.js +283 -0
- package/dist/cjs/core/transport.js.map +1 -0
- package/dist/cjs/errors.js +150 -0
- package/dist/cjs/errors.js.map +1 -0
- package/dist/cjs/geo/data.js +13 -0
- package/dist/cjs/geo/data.js.map +1 -0
- package/dist/cjs/geo/index.js +207 -0
- package/dist/cjs/geo/index.js.map +1 -0
- package/dist/cjs/index.js +182 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/models.js +213 -0
- package/dist/cjs/models.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/resources/autoInvoices.js +91 -0
- package/dist/cjs/resources/autoInvoices.js.map +1 -0
- package/dist/cjs/resources/base.js +200 -0
- package/dist/cjs/resources/base.js.map +1 -0
- package/dist/cjs/resources/bodies.js +240 -0
- package/dist/cjs/resources/bodies.js.map +1 -0
- package/dist/cjs/resources/invoices.js +119 -0
- package/dist/cjs/resources/invoices.js.map +1 -0
- package/dist/cjs/resources/notes.js +82 -0
- package/dist/cjs/resources/notes.js.map +1 -0
- package/dist/cjs/resources/receipts.js +79 -0
- package/dist/cjs/resources/receipts.js.map +1 -0
- package/dist/cjs/resources/remissionNotes.js +183 -0
- package/dist/cjs/resources/remissionNotes.js.map +1 -0
- package/dist/cjs/resources/support.js +220 -0
- package/dist/cjs/resources/support.js.map +1 -0
- package/dist/cjs/webhooks/adapters.js +123 -0
- package/dist/cjs/webhooks/adapters.js.map +1 -0
- package/dist/cjs/webhooks/event.js +172 -0
- package/dist/cjs/webhooks/event.js.map +1 -0
- package/dist/cjs/webhooks/index.js +49 -0
- package/dist/cjs/webhooks/index.js.map +1 -0
- package/dist/cjs/webhooks/router.js +261 -0
- package/dist/cjs/webhooks/router.js.map +1 -0
- package/dist/cjs/webhooks/server.js +99 -0
- package/dist/cjs/webhooks/server.js.map +1 -0
- package/dist/esm/builders/associated.d.ts +66 -0
- package/dist/esm/builders/associated.d.ts.map +1 -0
- package/dist/esm/builders/associated.js +104 -0
- package/dist/esm/builders/associated.js.map +1 -0
- package/dist/esm/builders/index.d.ts +5 -0
- package/dist/esm/builders/index.d.ts.map +1 -0
- package/dist/esm/builders/index.js +5 -0
- package/dist/esm/builders/index.js.map +1 -0
- package/dist/esm/builders/items.d.ts +129 -0
- package/dist/esm/builders/items.d.ts.map +1 -0
- package/dist/esm/builders/items.js +199 -0
- package/dist/esm/builders/items.js.map +1 -0
- package/dist/esm/builders/recipient.d.ts +159 -0
- package/dist/esm/builders/recipient.d.ts.map +1 -0
- package/dist/esm/builders/recipient.js +215 -0
- package/dist/esm/builders/recipient.js.map +1 -0
- package/dist/esm/client.d.ts +103 -0
- package/dist/esm/client.d.ts.map +1 -0
- package/dist/esm/client.js +106 -0
- package/dist/esm/client.js.map +1 -0
- package/dist/esm/constants/apiErrors.d.ts +32 -0
- package/dist/esm/constants/apiErrors.d.ts.map +1 -0
- package/dist/esm/constants/apiErrors.js +42 -0
- package/dist/esm/constants/apiErrors.js.map +1 -0
- package/dist/esm/constants/catalog.d.ts +56 -0
- package/dist/esm/constants/catalog.d.ts.map +1 -0
- package/dist/esm/constants/catalog.js +122 -0
- package/dist/esm/constants/catalog.js.map +1 -0
- package/dist/esm/constants/countries.d.ts +27 -0
- package/dist/esm/constants/countries.d.ts.map +1 -0
- package/dist/esm/constants/countries.js +85 -0
- package/dist/esm/constants/countries.js.map +1 -0
- package/dist/esm/constants/countriesData.d.ts +4 -0
- package/dist/esm/constants/countriesData.d.ts.map +1 -0
- package/dist/esm/constants/countriesData.js +10 -0
- package/dist/esm/constants/countriesData.js.map +1 -0
- package/dist/esm/constants/documents.d.ts +137 -0
- package/dist/esm/constants/documents.d.ts.map +1 -0
- package/dist/esm/constants/documents.js +140 -0
- package/dist/esm/constants/documents.js.map +1 -0
- package/dist/esm/constants/events.d.ts +74 -0
- package/dist/esm/constants/events.d.ts.map +1 -0
- package/dist/esm/constants/events.js +97 -0
- package/dist/esm/constants/events.js.map +1 -0
- package/dist/esm/constants/index.d.ts +38 -0
- package/dist/esm/constants/index.d.ts.map +1 -0
- package/dist/esm/constants/index.js +38 -0
- package/dist/esm/constants/index.js.map +1 -0
- package/dist/esm/constants/permissions.d.ts +55 -0
- package/dist/esm/constants/permissions.d.ts.map +1 -0
- package/dist/esm/constants/permissions.js +60 -0
- package/dist/esm/constants/permissions.js.map +1 -0
- package/dist/esm/constants/sifen.d.ts +160 -0
- package/dist/esm/constants/sifen.d.ts.map +1 -0
- package/dist/esm/constants/sifen.js +156 -0
- package/dist/esm/constants/sifen.js.map +1 -0
- package/dist/esm/constants/statuses.d.ts +87 -0
- package/dist/esm/constants/statuses.d.ts.map +1 -0
- package/dist/esm/constants/statuses.js +165 -0
- package/dist/esm/constants/statuses.js.map +1 -0
- package/dist/esm/core/config.d.ts +148 -0
- package/dist/esm/core/config.d.ts.map +1 -0
- package/dist/esm/core/config.js +309 -0
- package/dist/esm/core/config.js.map +1 -0
- package/dist/esm/core/dates.d.ts +38 -0
- package/dist/esm/core/dates.d.ts.map +1 -0
- package/dist/esm/core/dates.js +63 -0
- package/dist/esm/core/dates.js.map +1 -0
- package/dist/esm/core/decimal.d.ts +63 -0
- package/dist/esm/core/decimal.d.ts.map +1 -0
- package/dist/esm/core/decimal.js +186 -0
- package/dist/esm/core/decimal.js.map +1 -0
- package/dist/esm/core/pagination.d.ts +58 -0
- package/dist/esm/core/pagination.d.ts.map +1 -0
- package/dist/esm/core/pagination.js +86 -0
- package/dist/esm/core/pagination.js.map +1 -0
- package/dist/esm/core/transport.d.ts +113 -0
- package/dist/esm/core/transport.d.ts.map +1 -0
- package/dist/esm/core/transport.js +276 -0
- package/dist/esm/core/transport.js.map +1 -0
- package/dist/esm/errors.d.ts +116 -0
- package/dist/esm/errors.d.ts.map +1 -0
- package/dist/esm/errors.js +135 -0
- package/dist/esm/errors.js.map +1 -0
- package/dist/esm/geo/data.d.ts +8 -0
- package/dist/esm/geo/data.d.ts.map +1 -0
- package/dist/esm/geo/data.js +10 -0
- package/dist/esm/geo/data.js.map +1 -0
- package/dist/esm/geo/index.d.ts +83 -0
- package/dist/esm/geo/index.d.ts.map +1 -0
- package/dist/esm/geo/index.js +199 -0
- package/dist/esm/geo/index.js.map +1 -0
- package/dist/esm/index.d.ts +46 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +58 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/models.d.ts +123 -0
- package/dist/esm/models.d.ts.map +1 -0
- package/dist/esm/models.js +203 -0
- package/dist/esm/models.js.map +1 -0
- package/dist/esm/resources/autoInvoices.d.ts +104 -0
- package/dist/esm/resources/autoInvoices.d.ts.map +1 -0
- package/dist/esm/resources/autoInvoices.js +86 -0
- package/dist/esm/resources/autoInvoices.js.map +1 -0
- package/dist/esm/resources/base.d.ts +136 -0
- package/dist/esm/resources/base.d.ts.map +1 -0
- package/dist/esm/resources/base.js +194 -0
- package/dist/esm/resources/base.js.map +1 -0
- package/dist/esm/resources/bodies.d.ts +140 -0
- package/dist/esm/resources/bodies.d.ts.map +1 -0
- package/dist/esm/resources/bodies.js +232 -0
- package/dist/esm/resources/bodies.js.map +1 -0
- package/dist/esm/resources/invoices.d.ts +128 -0
- package/dist/esm/resources/invoices.d.ts.map +1 -0
- package/dist/esm/resources/invoices.js +115 -0
- package/dist/esm/resources/invoices.js.map +1 -0
- package/dist/esm/resources/notes.d.ts +84 -0
- package/dist/esm/resources/notes.d.ts.map +1 -0
- package/dist/esm/resources/notes.js +77 -0
- package/dist/esm/resources/notes.js.map +1 -0
- package/dist/esm/resources/receipts.d.ts +83 -0
- package/dist/esm/resources/receipts.d.ts.map +1 -0
- package/dist/esm/resources/receipts.js +74 -0
- package/dist/esm/resources/receipts.js.map +1 -0
- package/dist/esm/resources/remissionNotes.d.ts +174 -0
- package/dist/esm/resources/remissionNotes.d.ts.map +1 -0
- package/dist/esm/resources/remissionNotes.js +175 -0
- package/dist/esm/resources/remissionNotes.js.map +1 -0
- package/dist/esm/resources/support.d.ts +171 -0
- package/dist/esm/resources/support.d.ts.map +1 -0
- package/dist/esm/resources/support.js +210 -0
- package/dist/esm/resources/support.js.map +1 -0
- package/dist/esm/webhooks/adapters.d.ts +45 -0
- package/dist/esm/webhooks/adapters.d.ts.map +1 -0
- package/dist/esm/webhooks/adapters.js +118 -0
- package/dist/esm/webhooks/adapters.js.map +1 -0
- package/dist/esm/webhooks/event.d.ts +93 -0
- package/dist/esm/webhooks/event.d.ts.map +1 -0
- package/dist/esm/webhooks/event.js +168 -0
- package/dist/esm/webhooks/event.js.map +1 -0
- package/dist/esm/webhooks/index.d.ts +37 -0
- package/dist/esm/webhooks/index.d.ts.map +1 -0
- package/dist/esm/webhooks/index.js +37 -0
- package/dist/esm/webhooks/index.js.map +1 -0
- package/dist/esm/webhooks/router.d.ts +164 -0
- package/dist/esm/webhooks/router.d.ts.map +1 -0
- package/dist/esm/webhooks/router.js +257 -0
- package/dist/esm/webhooks/router.js.map +1 -0
- package/dist/esm/webhooks/server.d.ts +41 -0
- package/dist/esm/webhooks/server.d.ts.map +1 -0
- package/dist/esm/webhooks/server.js +96 -0
- package/dist/esm/webhooks/server.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tipos de evento de webhook.
|
|
3
|
+
*
|
|
4
|
+
* Son 23, con formato `{entidad}.{subtipo}`: seis entidades por cuatro
|
|
5
|
+
* subtipos, menos `receipt.error`, que no existe —si falla la generación de un
|
|
6
|
+
* recibo, el recibo queda en `pending` y se reintenta, no pasa a un estado de
|
|
7
|
+
* error—.
|
|
8
|
+
*
|
|
9
|
+
* Un detalle que cambia cómo se escucha: **`receipt.approved` no significa
|
|
10
|
+
* aprobado por la DNIT.** El recibo no se envía a la DNIT, así que ese evento
|
|
11
|
+
* quiere decir "el recibo se generó y su KuDE ya está disponible", con el
|
|
12
|
+
* documento en estado `generated`. Esperar un `approved_by_set` para un recibo
|
|
13
|
+
* es esperar algo que nunca llega.
|
|
14
|
+
*/
|
|
15
|
+
import { type CatalogValueOf } from './catalog.js';
|
|
16
|
+
import { DocumentType } from './documents.js';
|
|
17
|
+
/** La entidad a la que pertenece un evento (campo `entityType`). */
|
|
18
|
+
export declare const EntityType: import("./catalog.js").Catalog<{
|
|
19
|
+
readonly INVOICE: readonly ["invoice", "Factura"];
|
|
20
|
+
readonly RECEIPT: readonly ["receipt", "Recibo"];
|
|
21
|
+
readonly CREDIT_NOTE: readonly ["credit_note", "Nota de crédito"];
|
|
22
|
+
readonly DEBIT_NOTE: readonly ["debit_note", "Nota de débito"];
|
|
23
|
+
readonly REMISSION_NOTE: readonly ["remission_note", "Nota de remisión"];
|
|
24
|
+
readonly AUTO_INVOICE: readonly ["auto_invoice", "Autofactura"];
|
|
25
|
+
}>;
|
|
26
|
+
export type EntityType = CatalogValueOf<typeof EntityType>;
|
|
27
|
+
/** El {@link DocumentType} equivalente a una entidad de evento. */
|
|
28
|
+
export declare function documentTypeOf(entity: EntityType): DocumentType;
|
|
29
|
+
/** El nombre del recurso del cliente que corresponde a una entidad. */
|
|
30
|
+
export declare const RESOURCE_OF: Readonly<Record<EntityType, string>>;
|
|
31
|
+
/** Tipo de evento de webhook. */
|
|
32
|
+
export declare const Event: import("./catalog.js").Catalog<{
|
|
33
|
+
readonly INVOICE_APPROVED: readonly ["invoice.approved", "Factura aprobada"];
|
|
34
|
+
readonly INVOICE_CANCELLED: readonly ["invoice.cancelled", "Factura anulada"];
|
|
35
|
+
readonly INVOICE_PENDING: readonly ["invoice.pending", "Factura en proceso"];
|
|
36
|
+
readonly INVOICE_ERROR: readonly ["invoice.error", "Factura en error"];
|
|
37
|
+
readonly RECEIPT_APPROVED: readonly ["receipt.approved", "Recibo generado"];
|
|
38
|
+
readonly RECEIPT_CANCELLED: readonly ["receipt.cancelled", "Recibo anulado"];
|
|
39
|
+
readonly RECEIPT_PENDING: readonly ["receipt.pending", "Recibo en proceso"];
|
|
40
|
+
readonly CREDIT_NOTE_APPROVED: readonly ["credit_note.approved", "Nota de crédito aprobada"];
|
|
41
|
+
readonly CREDIT_NOTE_CANCELLED: readonly ["credit_note.cancelled", "Nota de crédito anulada"];
|
|
42
|
+
readonly CREDIT_NOTE_PENDING: readonly ["credit_note.pending", "Nota de crédito en proceso"];
|
|
43
|
+
readonly CREDIT_NOTE_ERROR: readonly ["credit_note.error", "Nota de crédito en error"];
|
|
44
|
+
readonly DEBIT_NOTE_APPROVED: readonly ["debit_note.approved", "Nota de débito aprobada"];
|
|
45
|
+
readonly DEBIT_NOTE_CANCELLED: readonly ["debit_note.cancelled", "Nota de débito anulada"];
|
|
46
|
+
readonly DEBIT_NOTE_PENDING: readonly ["debit_note.pending", "Nota de débito en proceso"];
|
|
47
|
+
readonly DEBIT_NOTE_ERROR: readonly ["debit_note.error", "Nota de débito en error"];
|
|
48
|
+
readonly REMISSION_NOTE_APPROVED: readonly ["remission_note.approved", "Nota de remisión aprobada"];
|
|
49
|
+
readonly REMISSION_NOTE_CANCELLED: readonly ["remission_note.cancelled", "Nota de remisión anulada"];
|
|
50
|
+
readonly REMISSION_NOTE_PENDING: readonly ["remission_note.pending", "Nota de remisión en proceso"];
|
|
51
|
+
readonly REMISSION_NOTE_ERROR: readonly ["remission_note.error", "Nota de remisión en error"];
|
|
52
|
+
readonly AUTO_INVOICE_APPROVED: readonly ["auto_invoice.approved", "Autofactura aprobada"];
|
|
53
|
+
readonly AUTO_INVOICE_CANCELLED: readonly ["auto_invoice.cancelled", "Autofactura anulada"];
|
|
54
|
+
readonly AUTO_INVOICE_PENDING: readonly ["auto_invoice.pending", "Autofactura en proceso"];
|
|
55
|
+
readonly AUTO_INVOICE_ERROR: readonly ["auto_invoice.error", "Autofactura en error"];
|
|
56
|
+
}>;
|
|
57
|
+
export type Event = CatalogValueOf<typeof Event>;
|
|
58
|
+
/** La entidad de un evento: `invoice.approved` → `invoice`. */
|
|
59
|
+
export declare function entityOf(event: Event): EntityType;
|
|
60
|
+
/** El subtipo de un evento: `approved`, `cancelled`, `pending` o `error`. */
|
|
61
|
+
export declare function subtypeOf(event: Event | string): string;
|
|
62
|
+
/**
|
|
63
|
+
* Los 6 eventos `*.approved`.
|
|
64
|
+
*
|
|
65
|
+
* Para recibos significa "generado", no "aprobado por la DNIT".
|
|
66
|
+
*/
|
|
67
|
+
export declare const APPROVED: ReadonlySet<Event>;
|
|
68
|
+
/** Los 6 eventos `*.cancelled`. */
|
|
69
|
+
export declare const CANCELLED: ReadonlySet<Event>;
|
|
70
|
+
/** Los 6 eventos `*.pending`. No son estados finales. */
|
|
71
|
+
export declare const PENDING: ReadonlySet<Event>;
|
|
72
|
+
/** Los 5 eventos `*.error`. Son cinco y no seis: `receipt.error` no existe. */
|
|
73
|
+
export declare const ERROR: ReadonlySet<Event>;
|
|
74
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/constants/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,oEAAoE;AACpE,eAAO,MAAM,UAAU;;;;;;;EAOZ,CAAC;AAEZ,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAW3D,mEAAmE;AACnE,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,YAAY,CAE/D;AAED,uEAAuE;AACvE,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAO5D,CAAC;AAEF,iCAAiC;AACjC,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;EA6BP,CAAC;AAEZ,MAAM,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,KAAK,CAAC,CAAC;AAEjD,+DAA+D;AAC/D,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,UAAU,CAEjD;AAED,6EAA6E;AAC7E,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAGvD;AAMD;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,WAAW,CAAC,KAAK,CAA2B,CAAC;AAEpE,mCAAmC;AACnC,eAAO,MAAM,SAAS,EAAE,WAAW,CAAC,KAAK,CAA4B,CAAC;AAEtE,yDAAyD;AACzD,eAAO,MAAM,OAAO,EAAE,WAAW,CAAC,KAAK,CAA0B,CAAC;AAElE,+EAA+E;AAC/E,eAAO,MAAM,KAAK,EAAE,WAAW,CAAC,KAAK,CAAwB,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tipos de evento de webhook.
|
|
3
|
+
*
|
|
4
|
+
* Son 23, con formato `{entidad}.{subtipo}`: seis entidades por cuatro
|
|
5
|
+
* subtipos, menos `receipt.error`, que no existe —si falla la generación de un
|
|
6
|
+
* recibo, el recibo queda en `pending` y se reintenta, no pasa a un estado de
|
|
7
|
+
* error—.
|
|
8
|
+
*
|
|
9
|
+
* Un detalle que cambia cómo se escucha: **`receipt.approved` no significa
|
|
10
|
+
* aprobado por la DNIT.** El recibo no se envía a la DNIT, así que ese evento
|
|
11
|
+
* quiere decir "el recibo se generó y su KuDE ya está disponible", con el
|
|
12
|
+
* documento en estado `generated`. Esperar un `approved_by_set` para un recibo
|
|
13
|
+
* es esperar algo que nunca llega.
|
|
14
|
+
*/
|
|
15
|
+
import { makeCatalog } from './catalog.js';
|
|
16
|
+
import { DocumentType } from './documents.js';
|
|
17
|
+
/** La entidad a la que pertenece un evento (campo `entityType`). */
|
|
18
|
+
export const EntityType = makeCatalog('EntityType', {
|
|
19
|
+
INVOICE: ['invoice', 'Factura'],
|
|
20
|
+
RECEIPT: ['receipt', 'Recibo'],
|
|
21
|
+
CREDIT_NOTE: ['credit_note', 'Nota de crédito'],
|
|
22
|
+
DEBIT_NOTE: ['debit_note', 'Nota de débito'],
|
|
23
|
+
REMISSION_NOTE: ['remission_note', 'Nota de remisión'],
|
|
24
|
+
AUTO_INVOICE: ['auto_invoice', 'Autofactura'],
|
|
25
|
+
});
|
|
26
|
+
const TO_DOCUMENT_TYPE = {
|
|
27
|
+
[EntityType.INVOICE]: DocumentType.INVOICE,
|
|
28
|
+
[EntityType.RECEIPT]: DocumentType.RECEIPT,
|
|
29
|
+
[EntityType.CREDIT_NOTE]: DocumentType.CREDIT_NOTE,
|
|
30
|
+
[EntityType.DEBIT_NOTE]: DocumentType.DEBIT_NOTE,
|
|
31
|
+
[EntityType.REMISSION_NOTE]: DocumentType.REMISSION_NOTE,
|
|
32
|
+
[EntityType.AUTO_INVOICE]: DocumentType.AUTO_INVOICE,
|
|
33
|
+
};
|
|
34
|
+
/** El {@link DocumentType} equivalente a una entidad de evento. */
|
|
35
|
+
export function documentTypeOf(entity) {
|
|
36
|
+
return TO_DOCUMENT_TYPE[EntityType.coerce(entity)];
|
|
37
|
+
}
|
|
38
|
+
/** El nombre del recurso del cliente que corresponde a una entidad. */
|
|
39
|
+
export const RESOURCE_OF = {
|
|
40
|
+
[EntityType.INVOICE]: 'invoices',
|
|
41
|
+
[EntityType.RECEIPT]: 'receipts',
|
|
42
|
+
[EntityType.CREDIT_NOTE]: 'creditNotes',
|
|
43
|
+
[EntityType.DEBIT_NOTE]: 'debitNotes',
|
|
44
|
+
[EntityType.REMISSION_NOTE]: 'remissionNotes',
|
|
45
|
+
[EntityType.AUTO_INVOICE]: 'autoInvoices',
|
|
46
|
+
};
|
|
47
|
+
/** Tipo de evento de webhook. */
|
|
48
|
+
export const Event = makeCatalog('Event', {
|
|
49
|
+
INVOICE_APPROVED: ['invoice.approved', 'Factura aprobada'],
|
|
50
|
+
INVOICE_CANCELLED: ['invoice.cancelled', 'Factura anulada'],
|
|
51
|
+
INVOICE_PENDING: ['invoice.pending', 'Factura en proceso'],
|
|
52
|
+
INVOICE_ERROR: ['invoice.error', 'Factura en error'],
|
|
53
|
+
RECEIPT_APPROVED: ['receipt.approved', 'Recibo generado'],
|
|
54
|
+
RECEIPT_CANCELLED: ['receipt.cancelled', 'Recibo anulado'],
|
|
55
|
+
RECEIPT_PENDING: ['receipt.pending', 'Recibo en proceso'],
|
|
56
|
+
CREDIT_NOTE_APPROVED: ['credit_note.approved', 'Nota de crédito aprobada'],
|
|
57
|
+
CREDIT_NOTE_CANCELLED: ['credit_note.cancelled', 'Nota de crédito anulada'],
|
|
58
|
+
CREDIT_NOTE_PENDING: ['credit_note.pending', 'Nota de crédito en proceso'],
|
|
59
|
+
CREDIT_NOTE_ERROR: ['credit_note.error', 'Nota de crédito en error'],
|
|
60
|
+
DEBIT_NOTE_APPROVED: ['debit_note.approved', 'Nota de débito aprobada'],
|
|
61
|
+
DEBIT_NOTE_CANCELLED: ['debit_note.cancelled', 'Nota de débito anulada'],
|
|
62
|
+
DEBIT_NOTE_PENDING: ['debit_note.pending', 'Nota de débito en proceso'],
|
|
63
|
+
DEBIT_NOTE_ERROR: ['debit_note.error', 'Nota de débito en error'],
|
|
64
|
+
REMISSION_NOTE_APPROVED: ['remission_note.approved', 'Nota de remisión aprobada'],
|
|
65
|
+
REMISSION_NOTE_CANCELLED: ['remission_note.cancelled', 'Nota de remisión anulada'],
|
|
66
|
+
REMISSION_NOTE_PENDING: ['remission_note.pending', 'Nota de remisión en proceso'],
|
|
67
|
+
REMISSION_NOTE_ERROR: ['remission_note.error', 'Nota de remisión en error'],
|
|
68
|
+
AUTO_INVOICE_APPROVED: ['auto_invoice.approved', 'Autofactura aprobada'],
|
|
69
|
+
AUTO_INVOICE_CANCELLED: ['auto_invoice.cancelled', 'Autofactura anulada'],
|
|
70
|
+
AUTO_INVOICE_PENDING: ['auto_invoice.pending', 'Autofactura en proceso'],
|
|
71
|
+
AUTO_INVOICE_ERROR: ['auto_invoice.error', 'Autofactura en error'],
|
|
72
|
+
});
|
|
73
|
+
/** La entidad de un evento: `invoice.approved` → `invoice`. */
|
|
74
|
+
export function entityOf(event) {
|
|
75
|
+
return EntityType.coerce(String(event).split('.')[0]);
|
|
76
|
+
}
|
|
77
|
+
/** El subtipo de un evento: `approved`, `cancelled`, `pending` o `error`. */
|
|
78
|
+
export function subtypeOf(event) {
|
|
79
|
+
const parts = String(event).split('.');
|
|
80
|
+
return parts[parts.length - 1] ?? '';
|
|
81
|
+
}
|
|
82
|
+
function withSubtype(subtype) {
|
|
83
|
+
return new Set(Event.values().filter((event) => subtypeOf(event) === subtype));
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Los 6 eventos `*.approved`.
|
|
87
|
+
*
|
|
88
|
+
* Para recibos significa "generado", no "aprobado por la DNIT".
|
|
89
|
+
*/
|
|
90
|
+
export const APPROVED = withSubtype('approved');
|
|
91
|
+
/** Los 6 eventos `*.cancelled`. */
|
|
92
|
+
export const CANCELLED = withSubtype('cancelled');
|
|
93
|
+
/** Los 6 eventos `*.pending`. No son estados finales. */
|
|
94
|
+
export const PENDING = withSubtype('pending');
|
|
95
|
+
/** Los 5 eventos `*.error`. Son cinco y no seis: `receipt.error` no existe. */
|
|
96
|
+
export const ERROR = withSubtype('error');
|
|
97
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/constants/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,WAAW,EAAuB,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,oEAAoE;AACpE,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,CAAC,YAAY,EAAE;IAClD,OAAO,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;IAC/B,OAAO,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IAC9B,WAAW,EAAE,CAAC,aAAa,EAAE,iBAAiB,CAAC;IAC/C,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M,UAAU,QAAQ,CAAC,KAAY;IACnC,OAAO,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACxD,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACvC,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AACvC,CAAC;AAED,SAAS,WAAW,CAAC,OAAe;IAClC,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC;AACjF,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAuB,WAAW,CAAC,UAAU,CAAC,CAAC;AAEpE,mCAAmC;AACnC,MAAM,CAAC,MAAM,SAAS,GAAuB,WAAW,CAAC,WAAW,CAAC,CAAC;AAEtE,yDAAyD;AACzD,MAAM,CAAC,MAAM,OAAO,GAAuB,WAAW,CAAC,SAAS,CAAC,CAAC;AAElE,+EAA+E;AAC/E,MAAM,CAAC,MAAM,KAAK,GAAuB,WAAW,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catálogos y constantes de SmartDoc y SIFEN.
|
|
3
|
+
*
|
|
4
|
+
* Todo lo de acá se reexporta desde la raíz del paquete, así que en general
|
|
5
|
+
* alcanza con:
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { Iva, SaleType } from '@araitek/smartdocjs';
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* Hay tres familias:
|
|
12
|
+
*
|
|
13
|
+
* - `documents` — valores de texto propios de SmartDoc (IVA, moneda, condición
|
|
14
|
+
* de venta, tipo de cliente). Son **cerrados**.
|
|
15
|
+
* - `sifen` — códigos numéricos de la DNIT (tipo de transacción, unidad de
|
|
16
|
+
* medida, transporte). Son **abiertos**: aceptan códigos del catálogo oficial
|
|
17
|
+
* aunque el SDK no los liste.
|
|
18
|
+
* - `statuses`, `events`, `permissions` y `apiErrors` — el vocabulario de la
|
|
19
|
+
* propia API.
|
|
20
|
+
*
|
|
21
|
+
* Los catálogos grandes (países, geografía) van como datos: `countries` y el
|
|
22
|
+
* módulo `geo`.
|
|
23
|
+
*/
|
|
24
|
+
export * as apiErrors from './apiErrors.js';
|
|
25
|
+
export * as countries from './countries.js';
|
|
26
|
+
export * as documents from './documents.js';
|
|
27
|
+
export * as events from './events.js';
|
|
28
|
+
export * as permissions from './permissions.js';
|
|
29
|
+
export * as sifen from './sifen.js';
|
|
30
|
+
export * as statuses from './statuses.js';
|
|
31
|
+
export { makeCatalog, coerceOptional, type Catalog, type CatalogMethods, type CatalogSpec, type CatalogValue, type CatalogValueOf, type CatalogOptions, } from './catalog.js';
|
|
32
|
+
export { ErrorCode } from './apiErrors.js';
|
|
33
|
+
export { AssociatedDocumentType, ClientType, Currency, DocumentType, Iva, ProviderDocumentType, ProviderType, ReceiptPaymentMethod, SaleType, isMixedIva, ivaRate, } from './documents.js';
|
|
34
|
+
export { EntityType, Event, documentTypeOf, entityOf, subtypeOf } from './events.js';
|
|
35
|
+
export { Permission } from './permissions.js';
|
|
36
|
+
export { CarrierDocumentType, FreightResponsible, MeasureUnit, PrintedDocumentType, RemissionReason, RemissionResponsible, TransactionType, TransportMode, TransportType, VehicleIdentificationType, } from './sifen.js';
|
|
37
|
+
export { DocumentStatus, isError, isSuccess, isTerminal } from './statuses.js';
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"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álogos y constantes de SmartDoc y SIFEN.
|
|
3
|
+
*
|
|
4
|
+
* Todo lo de acá se reexporta desde la raíz del paquete, así que en general
|
|
5
|
+
* alcanza con:
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { Iva, SaleType } from '@araitek/smartdocjs';
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* Hay tres familias:
|
|
12
|
+
*
|
|
13
|
+
* - `documents` — valores de texto propios de SmartDoc (IVA, moneda, condición
|
|
14
|
+
* de venta, tipo de cliente). Son **cerrados**.
|
|
15
|
+
* - `sifen` — códigos numéricos de la DNIT (tipo de transacción, unidad de
|
|
16
|
+
* medida, transporte). Son **abiertos**: aceptan códigos del catálogo oficial
|
|
17
|
+
* aunque el SDK no los liste.
|
|
18
|
+
* - `statuses`, `events`, `permissions` y `apiErrors` — el vocabulario de la
|
|
19
|
+
* propia API.
|
|
20
|
+
*
|
|
21
|
+
* Los catálogos grandes (países, geografía) van como datos: `countries` y el
|
|
22
|
+
* módulo `geo`.
|
|
23
|
+
*/
|
|
24
|
+
export * as apiErrors from './apiErrors.js';
|
|
25
|
+
export * as countries from './countries.js';
|
|
26
|
+
export * as documents from './documents.js';
|
|
27
|
+
export * as events from './events.js';
|
|
28
|
+
export * as permissions from './permissions.js';
|
|
29
|
+
export * as sifen from './sifen.js';
|
|
30
|
+
export * as statuses from './statuses.js';
|
|
31
|
+
export { makeCatalog, coerceOptional, } from './catalog.js';
|
|
32
|
+
export { ErrorCode } from './apiErrors.js';
|
|
33
|
+
export { AssociatedDocumentType, ClientType, Currency, DocumentType, Iva, ProviderDocumentType, ProviderType, ReceiptPaymentMethod, SaleType, isMixedIva, ivaRate, } from './documents.js';
|
|
34
|
+
export { EntityType, Event, documentTypeOf, entityOf, subtypeOf } from './events.js';
|
|
35
|
+
export { Permission } from './permissions.js';
|
|
36
|
+
export { CarrierDocumentType, FreightResponsible, MeasureUnit, PrintedDocumentType, RemissionReason, RemissionResponsible, TransactionType, TransportMode, TransportType, VehicleIdentificationType, } from './sifen.js';
|
|
37
|
+
export { DocumentStatus, isError, isSuccess, isTerminal } from './statuses.js';
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,OAAO,EACL,WAAW,EACX,cAAc,GAOf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EACL,sBAAsB,EACtB,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,GAAG,EACH,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACpB,QAAQ,EACR,UAAU,EACV,OAAO,GACR,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAErF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,aAAa,EACb,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Permisos de una API Key.
|
|
3
|
+
*
|
|
4
|
+
* Dos cosas que sorprenden y hacen perder tiempo:
|
|
5
|
+
*
|
|
6
|
+
* - **No hay jerarquía.** `write_invoices` no habilita nada que pida
|
|
7
|
+
* `read_invoices`. La verificación es por coincidencia exacta, así que una
|
|
8
|
+
* clave que crea facturas y después las consulta necesita los dos permisos
|
|
9
|
+
* marcados.
|
|
10
|
+
* - **La clave pertenece al contribuyente, no al usuario.** Los permisos del
|
|
11
|
+
* usuario que la creó no influyen, y la clave sigue funcionando aunque ese
|
|
12
|
+
* usuario cambie de permisos o se dé de baja.
|
|
13
|
+
*
|
|
14
|
+
* Cuando falta un permiso la respuesta es `403` con código `FORBIDDEN`, y el SDK
|
|
15
|
+
* la convierte en `PermissionError`.
|
|
16
|
+
*/
|
|
17
|
+
import { type CatalogValueOf } from './catalog.js';
|
|
18
|
+
/** Permiso de una API Key, tal como se marca en el panel de SmartDoc. */
|
|
19
|
+
export declare const Permission: import("./catalog.js").Catalog<{
|
|
20
|
+
readonly READ_INVOICES: readonly ["read_invoices", "Leer facturas"];
|
|
21
|
+
readonly WRITE_INVOICES: readonly ["write_invoices", "Crear y modificar facturas"];
|
|
22
|
+
readonly READ_RECEIPTS: readonly ["read_receipts", "Leer recibos"];
|
|
23
|
+
readonly WRITE_RECEIPTS: readonly ["write_receipts", "Crear y modificar recibos"];
|
|
24
|
+
readonly READ_CREDIT_NOTES: readonly ["read_credit_notes", "Leer notas de crédito"];
|
|
25
|
+
readonly WRITE_CREDIT_NOTES: readonly ["write_credit_notes", "Crear y modificar notas de crédito"];
|
|
26
|
+
readonly READ_DEBIT_NOTES: readonly ["read_debit_notes", "Leer notas de débito"];
|
|
27
|
+
readonly WRITE_DEBIT_NOTES: readonly ["write_debit_notes", "Crear y modificar notas de débito"];
|
|
28
|
+
readonly READ_REMISSION_NOTES: readonly ["read_remission_notes", "Leer notas de remisión"];
|
|
29
|
+
readonly WRITE_REMISSION_NOTES: readonly ["write_remission_notes", "Crear y modificar notas de remisión"];
|
|
30
|
+
readonly READ_AUTO_INVOICES: readonly ["read_auto_invoices", "Leer autofacturas"];
|
|
31
|
+
readonly WRITE_AUTO_INVOICES: readonly ["write_auto_invoices", "Crear y modificar autofacturas"];
|
|
32
|
+
readonly READ_STAMPS: readonly ["read_stamps", "Leer timbrados"];
|
|
33
|
+
readonly WRITE_STAMPS: readonly ["write_stamps", "Crear y modificar timbrados"];
|
|
34
|
+
readonly READ_CLIENTS: readonly ["read_clients", "Leer clientes"];
|
|
35
|
+
readonly WRITE_CLIENTS: readonly ["write_clients", "Crear y modificar clientes"];
|
|
36
|
+
readonly READ_ESTABLISHMENTS: readonly ["read_establishments", "Leer establecimientos"];
|
|
37
|
+
readonly WRITE_ESTABLISHMENTS: readonly ["write_establishments", "Crear y modificar establecimientos"];
|
|
38
|
+
readonly READ_DISPATCH_POINTS: readonly ["read_dispatch_points", "Leer puntos de expedición"];
|
|
39
|
+
readonly WRITE_DISPATCH_POINTS: readonly ["write_dispatch_points", "Crear y modificar puntos de expedición"];
|
|
40
|
+
readonly READ_TAXPAYER: readonly ["read_taxpayer", "Leer datos del contribuyente"];
|
|
41
|
+
readonly READ_RECEIVED_DOCUMENTS: readonly ["read_received_documents", "Leer documentos recibidos"];
|
|
42
|
+
readonly WRITE_RECEIVED_DOCUMENTS: readonly ["write_received_documents", "Registrar y modificar documentos recibidos"];
|
|
43
|
+
}>;
|
|
44
|
+
export type Permission = CatalogValueOf<typeof Permission>;
|
|
45
|
+
/** Los 12 permisos de lectura. */
|
|
46
|
+
export declare const READ: ReadonlySet<Permission>;
|
|
47
|
+
/**
|
|
48
|
+
* Los 11 permisos de escritura. No incluyen los de lectura: no hay jerarquía.
|
|
49
|
+
*
|
|
50
|
+
* Son uno menos que los de lectura porque el contribuyente es de solo lectura.
|
|
51
|
+
*/
|
|
52
|
+
export declare const WRITE: ReadonlySet<Permission>;
|
|
53
|
+
/** Los 23 permisos. */
|
|
54
|
+
export declare const ALL: ReadonlySet<Permission>;
|
|
55
|
+
//# sourceMappingURL=permissions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../src/constants/permissions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAEhE,yEAAyE;AACzE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;EA8BZ,CAAC;AAEZ,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAE3D,kCAAkC;AAClC,eAAO,MAAM,IAAI,EAAE,WAAW,CAAC,UAAU,CAExC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,KAAK,EAAE,WAAW,CAAC,UAAU,CAEzC,CAAC;AAEF,uBAAuB;AACvB,eAAO,MAAM,GAAG,EAAE,WAAW,CAAC,UAAU,CAAgC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Permisos de una API Key.
|
|
3
|
+
*
|
|
4
|
+
* Dos cosas que sorprenden y hacen perder tiempo:
|
|
5
|
+
*
|
|
6
|
+
* - **No hay jerarquía.** `write_invoices` no habilita nada que pida
|
|
7
|
+
* `read_invoices`. La verificación es por coincidencia exacta, así que una
|
|
8
|
+
* clave que crea facturas y después las consulta necesita los dos permisos
|
|
9
|
+
* marcados.
|
|
10
|
+
* - **La clave pertenece al contribuyente, no al usuario.** Los permisos del
|
|
11
|
+
* usuario que la creó no influyen, y la clave sigue funcionando aunque ese
|
|
12
|
+
* usuario cambie de permisos o se dé de baja.
|
|
13
|
+
*
|
|
14
|
+
* Cuando falta un permiso la respuesta es `403` con código `FORBIDDEN`, y el SDK
|
|
15
|
+
* la convierte en `PermissionError`.
|
|
16
|
+
*/
|
|
17
|
+
import { makeCatalog } from './catalog.js';
|
|
18
|
+
/** Permiso de una API Key, tal como se marca en el panel de SmartDoc. */
|
|
19
|
+
export const Permission = makeCatalog('Permission', {
|
|
20
|
+
READ_INVOICES: ['read_invoices', 'Leer facturas'],
|
|
21
|
+
WRITE_INVOICES: ['write_invoices', 'Crear y modificar facturas'],
|
|
22
|
+
READ_RECEIPTS: ['read_receipts', 'Leer recibos'],
|
|
23
|
+
WRITE_RECEIPTS: ['write_receipts', 'Crear y modificar recibos'],
|
|
24
|
+
READ_CREDIT_NOTES: ['read_credit_notes', 'Leer notas de crédito'],
|
|
25
|
+
WRITE_CREDIT_NOTES: ['write_credit_notes', 'Crear y modificar notas de crédito'],
|
|
26
|
+
READ_DEBIT_NOTES: ['read_debit_notes', 'Leer notas de débito'],
|
|
27
|
+
WRITE_DEBIT_NOTES: ['write_debit_notes', 'Crear y modificar notas de débito'],
|
|
28
|
+
READ_REMISSION_NOTES: ['read_remission_notes', 'Leer notas de remisión'],
|
|
29
|
+
WRITE_REMISSION_NOTES: ['write_remission_notes', 'Crear y modificar notas de remisión'],
|
|
30
|
+
READ_AUTO_INVOICES: ['read_auto_invoices', 'Leer autofacturas'],
|
|
31
|
+
WRITE_AUTO_INVOICES: ['write_auto_invoices', 'Crear y modificar autofacturas'],
|
|
32
|
+
READ_STAMPS: ['read_stamps', 'Leer timbrados'],
|
|
33
|
+
WRITE_STAMPS: ['write_stamps', 'Crear y modificar timbrados'],
|
|
34
|
+
READ_CLIENTS: ['read_clients', 'Leer clientes'],
|
|
35
|
+
WRITE_CLIENTS: ['write_clients', 'Crear y modificar clientes'],
|
|
36
|
+
READ_ESTABLISHMENTS: ['read_establishments', 'Leer establecimientos'],
|
|
37
|
+
WRITE_ESTABLISHMENTS: ['write_establishments', 'Crear y modificar establecimientos'],
|
|
38
|
+
READ_DISPATCH_POINTS: ['read_dispatch_points', 'Leer puntos de expedición'],
|
|
39
|
+
WRITE_DISPATCH_POINTS: [
|
|
40
|
+
'write_dispatch_points',
|
|
41
|
+
'Crear y modificar puntos de expedición',
|
|
42
|
+
],
|
|
43
|
+
READ_TAXPAYER: ['read_taxpayer', 'Leer datos del contribuyente'],
|
|
44
|
+
READ_RECEIVED_DOCUMENTS: ['read_received_documents', 'Leer documentos recibidos'],
|
|
45
|
+
WRITE_RECEIVED_DOCUMENTS: [
|
|
46
|
+
'write_received_documents',
|
|
47
|
+
'Registrar y modificar documentos recibidos',
|
|
48
|
+
],
|
|
49
|
+
});
|
|
50
|
+
/** Los 12 permisos de lectura. */
|
|
51
|
+
export const READ = new Set(Permission.values().filter((p) => p.startsWith('read_')));
|
|
52
|
+
/**
|
|
53
|
+
* Los 11 permisos de escritura. No incluyen los de lectura: no hay jerarquía.
|
|
54
|
+
*
|
|
55
|
+
* Son uno menos que los de lectura porque el contribuyente es de solo lectura.
|
|
56
|
+
*/
|
|
57
|
+
export const WRITE = new Set(Permission.values().filter((p) => p.startsWith('write_')));
|
|
58
|
+
/** Los 23 permisos. */
|
|
59
|
+
export const ALL = new Set(Permission.values());
|
|
60
|
+
//# sourceMappingURL=permissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../../src/constants/permissions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,WAAW,EAAuB,MAAM,cAAc,CAAC;AAEhE,yEAAyE;AACzE,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,CAAC,YAAY,EAAE;IAClD,aAAa,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;IACjD,cAAc,EAAE,CAAC,gBAAgB,EAAE,4BAA4B,CAAC;IAChE,aAAa,EAAE,CAAC,eAAe,EAAE,cAAc,CAAC;IAChD,cAAc,EAAE,CAAC,gBAAgB,EAAE,2BAA2B,CAAC;IAC/D,iBAAiB,EAAE,CAAC,mBAAmB,EAAE,uBAAuB,CAAC;IACjE,kBAAkB,EA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AAI,GAAG,CACnD,UAAU,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAC1D,CAAC;AAEF,uBAAuB;AACvB,MAAM,CAAC,MAAM,GAAG,GAA4B,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catálogos oficiales de SIFEN (códigos numéricos de la DNIT).
|
|
3
|
+
*
|
|
4
|
+
* Están los catálogos completos de la DNIT, y solo aquellos que tienen un campo
|
|
5
|
+
* donde ir en el cuerpo de algún endpoint de la API v2.
|
|
6
|
+
*
|
|
7
|
+
* Todos son **abiertos**: si la DNIT agrega un código, se puede pasar el entero
|
|
8
|
+
* crudo sin esperar una versión nueva del SDK.
|
|
9
|
+
*/
|
|
10
|
+
import { type CatalogValueOf } from './catalog.js';
|
|
11
|
+
/**
|
|
12
|
+
* Tipo de transacción de una factura (`transactionTypeCode`).
|
|
13
|
+
*
|
|
14
|
+
* La API valida que esté entre 1 y 13, que es justo el rango de este catálogo.
|
|
15
|
+
*/
|
|
16
|
+
export declare const TransactionType: import("./catalog.js").Catalog<{
|
|
17
|
+
readonly MERCHANDISE_SALE: readonly [1, "Venta de mercadería"];
|
|
18
|
+
readonly SERVICES: readonly [2, "Prestación de servicios"];
|
|
19
|
+
readonly MIXED: readonly [3, "Mixto (Venta de mercadería y servicios)"];
|
|
20
|
+
readonly FIXED_ASSET_SALE: readonly [4, "Venta de activo fijo"];
|
|
21
|
+
readonly CURRENCY_SALE: readonly [5, "Venta de divisas"];
|
|
22
|
+
readonly CURRENCY_PURCHASE: readonly [6, "Compra de divisas"];
|
|
23
|
+
readonly PROMOTION_OR_SAMPLES: readonly [7, "Promoción o entrega de muestras"];
|
|
24
|
+
readonly DONATION: readonly [8, "Donación"];
|
|
25
|
+
readonly ADVANCE_PAYMENT: readonly [9, "Anticipo"];
|
|
26
|
+
readonly PRODUCT_PURCHASE: readonly [10, "Compra de productos"];
|
|
27
|
+
readonly SERVICES_PURCHASE: readonly [11, "Compra de servicios"];
|
|
28
|
+
readonly TAX_CREDIT_SALE: readonly [12, "Venta de crédito fiscal"];
|
|
29
|
+
readonly MEDICAL_SAMPLES: readonly [13, "Muestras médicas (Art. 3 RG 24/2014)"];
|
|
30
|
+
}>;
|
|
31
|
+
export type TransactionType = CatalogValueOf<typeof TransactionType>;
|
|
32
|
+
/**
|
|
33
|
+
* Unidad de medida de un ítem (`items[].measureUnit`).
|
|
34
|
+
*
|
|
35
|
+
* SmartDoc no ofrece un selector para esto: fija `UNIT` (77) en todos sus
|
|
36
|
+
* formularios. La API acepta cualquier código del catálogo.
|
|
37
|
+
*/
|
|
38
|
+
export declare const MeasureUnit: import("./catalog.js").Catalog<{
|
|
39
|
+
readonly UNIT: readonly [77, "Unidad"];
|
|
40
|
+
readonly GLOBAL_UNIT: readonly [885, "Unidad Medida Global"];
|
|
41
|
+
readonly INTERNATIONAL_UNIT: readonly [2329, "Unidad Internacional"];
|
|
42
|
+
readonly RATION: readonly [569, "Ración"];
|
|
43
|
+
readonly DETERMINATION: readonly [104, "Determinación"];
|
|
44
|
+
readonly COST_PER_THOUSAND: readonly [2366, "Costo por Mil"];
|
|
45
|
+
readonly PER_MILEAGE: readonly [891, "Por Milaje"];
|
|
46
|
+
readonly MILLIMETER: readonly [95, "Milímetros"];
|
|
47
|
+
readonly CENTIMETER: readonly [91, "Centimetros"];
|
|
48
|
+
readonly METER: readonly [87, "Metros"];
|
|
49
|
+
readonly METER_ALT: readonly [108, "Metros"];
|
|
50
|
+
readonly LINEAR_METER: readonly [660, "Metro lineal"];
|
|
51
|
+
readonly KILOMETER: readonly [625, "Kilómetros"];
|
|
52
|
+
readonly INCH: readonly [94, "Pulgadas"];
|
|
53
|
+
readonly YARD: readonly [103, "Yardas"];
|
|
54
|
+
readonly SQUARE_MILLIMETER: readonly [96, "Milímetros cuadrados"];
|
|
55
|
+
readonly SQUARE_CENTIMETER: readonly [92, "Centimetros cuadrados"];
|
|
56
|
+
readonly SQUARE_METER: readonly [109, "Metros cuadrados"];
|
|
57
|
+
readonly HECTARE: readonly [869, "Hectáreas"];
|
|
58
|
+
readonly CUBIC_CENTIMETER: readonly [93, "Centimetros cubicos"];
|
|
59
|
+
readonly CUBIC_METER: readonly [110, "Metros cúbicos"];
|
|
60
|
+
readonly MILLILITER: readonly [88, "Mililitros"];
|
|
61
|
+
readonly LITER: readonly [89, "Litros"];
|
|
62
|
+
readonly MILLIGRAM: readonly [90, "Miligramos"];
|
|
63
|
+
readonly GRAM: readonly [86, "Gramos"];
|
|
64
|
+
readonly KILOGRAM: readonly [83, "Kilogramos"];
|
|
65
|
+
readonly TON: readonly [99, "Tonelada"];
|
|
66
|
+
readonly KILOGRAM_PER_SQUARE_METER: readonly [79, "Kilogramos s/ metro cuadrado"];
|
|
67
|
+
readonly SECOND: readonly [666, "Segundo"];
|
|
68
|
+
readonly MINUTE: readonly [101, "Minuto"];
|
|
69
|
+
readonly HOUR: readonly [100, "Hora"];
|
|
70
|
+
readonly DAY: readonly [102, "Día"];
|
|
71
|
+
readonly MONTH: readonly [98, "Mes"];
|
|
72
|
+
readonly YEAR: readonly [97, "Año"];
|
|
73
|
+
}>;
|
|
74
|
+
export type MeasureUnit = CatalogValueOf<typeof MeasureUnit>;
|
|
75
|
+
/** Motivo de una nota de remisión (`reasonCode`). */
|
|
76
|
+
export declare const RemissionReason: import("./catalog.js").Catalog<{
|
|
77
|
+
readonly SALE: readonly [1, "Traslado por ventas"];
|
|
78
|
+
readonly CONSIGNMENT: readonly [2, "Traslado por consignación"];
|
|
79
|
+
readonly EXPORT: readonly [3, "Exportación"];
|
|
80
|
+
readonly PURCHASE: readonly [4, "Traslado por compra"];
|
|
81
|
+
readonly IMPORT: readonly [5, "Importación"];
|
|
82
|
+
readonly RETURN: readonly [6, "Traslado por devolución"];
|
|
83
|
+
readonly BETWEEN_COMPANY_LOCATIONS: readonly [7, "Traslado entre locales de la empresa"];
|
|
84
|
+
readonly TRANSFORMATION: readonly [8, "Traslado de bienes por transformación"];
|
|
85
|
+
readonly REPAIR: readonly [9, "Traslado de bienes por reparación"];
|
|
86
|
+
readonly MOBILE_ISSUER: readonly [10, "Traslado por emisor móvil"];
|
|
87
|
+
readonly EXHIBITION: readonly [11, "Exhibición o demostración"];
|
|
88
|
+
readonly TRADE_FAIR: readonly [12, "Participación en ferias"];
|
|
89
|
+
readonly PARCEL: readonly [13, "Traslado de encomienda"];
|
|
90
|
+
readonly SEIZURE: readonly [14, "Decomiso"];
|
|
91
|
+
readonly OTHER: readonly [99, "Otro"];
|
|
92
|
+
}>;
|
|
93
|
+
export type RemissionReason = CatalogValueOf<typeof RemissionReason>;
|
|
94
|
+
/** Responsable de la emisión de la nota de remisión (`responsibleCode`). */
|
|
95
|
+
export declare const RemissionResponsible: import("./catalog.js").Catalog<{
|
|
96
|
+
readonly INVOICE_ISSUER: readonly [1, "Emisor de la factura"];
|
|
97
|
+
readonly INVOICE_AND_GOODS_HOLDER: readonly [2, "Poseedor de la factura y bienes"];
|
|
98
|
+
readonly CARRIER_COMPANY: readonly [3, "Empresa transportista"];
|
|
99
|
+
readonly CUSTOMS_BROKER: readonly [4, "Despachante de Aduanas"];
|
|
100
|
+
readonly TRANSPORT_AGENT: readonly [5, "Agente de transporte o intermediario"];
|
|
101
|
+
}>;
|
|
102
|
+
export type RemissionResponsible = CatalogValueOf<typeof RemissionResponsible>;
|
|
103
|
+
/** Tipo de transporte (`transportTypeCode`). */
|
|
104
|
+
export declare const TransportType: import("./catalog.js").Catalog<{
|
|
105
|
+
readonly OWN: readonly [1, "Propio"];
|
|
106
|
+
readonly THIRD_PARTY: readonly [2, "Tercero"];
|
|
107
|
+
}>;
|
|
108
|
+
export type TransportType = CatalogValueOf<typeof TransportType>;
|
|
109
|
+
/** Modalidad de transporte (`transportModeCode`). */
|
|
110
|
+
export declare const TransportMode: import("./catalog.js").Catalog<{
|
|
111
|
+
readonly LAND: readonly [1, "Terrestre"];
|
|
112
|
+
readonly RIVER: readonly [2, "Fluvial"];
|
|
113
|
+
readonly AIR: readonly [3, "Aéreo"];
|
|
114
|
+
readonly MULTIMODAL: readonly [4, "Multimodal"];
|
|
115
|
+
}>;
|
|
116
|
+
export type TransportMode = CatalogValueOf<typeof TransportMode>;
|
|
117
|
+
/** Responsable del flete (`transportResponsibleCode`). */
|
|
118
|
+
export declare const FreightResponsible: import("./catalog.js").Catalog<{
|
|
119
|
+
readonly INVOICE_ISSUER: readonly [1, "Emisor de la Factura Electrónica"];
|
|
120
|
+
readonly INVOICE_RECEIVER: readonly [2, "Receptor de la Factura Electrónica"];
|
|
121
|
+
readonly THIRD_PARTY: readonly [3, "Tercero"];
|
|
122
|
+
readonly TRANSPORT_AGENT: readonly [4, "Agente intermediario del transporte (cuando intervenga)"];
|
|
123
|
+
readonly OWN_TRANSPORT: readonly [5, "Transporte propio"];
|
|
124
|
+
}>;
|
|
125
|
+
export type FreightResponsible = CatalogValueOf<typeof FreightResponsible>;
|
|
126
|
+
/** Tipo de identificación del vehículo (`transportVehicleDocumentTypeCode`). */
|
|
127
|
+
export declare const VehicleIdentificationType: import("./catalog.js").Catalog<{
|
|
128
|
+
readonly VIN: readonly [1, "Número de identificación del vehículo"];
|
|
129
|
+
readonly REGISTRATION: readonly [2, "Número de matrícula del vehículo"];
|
|
130
|
+
}>;
|
|
131
|
+
export type VehicleIdentificationType = CatalogValueOf<typeof VehicleIdentificationType>;
|
|
132
|
+
/**
|
|
133
|
+
* Tipo de documento impreso asociado (`associatedDocumentPrintedType`).
|
|
134
|
+
*
|
|
135
|
+
* Se usa cuando el documento asociado no es electrónico.
|
|
136
|
+
*/
|
|
137
|
+
export declare const PrintedDocumentType: import("./catalog.js").Catalog<{
|
|
138
|
+
readonly INVOICE: readonly [1, "Factura"];
|
|
139
|
+
readonly CREDIT_NOTE: readonly [2, "Nota de crédito"];
|
|
140
|
+
readonly DEBIT_NOTE: readonly [3, "Nota de débito"];
|
|
141
|
+
readonly REMISSION_NOTE: readonly [4, "Nota de remisión"];
|
|
142
|
+
readonly WITHHOLDING_RECEIPT: readonly [5, "Comprobante de retención"];
|
|
143
|
+
}>;
|
|
144
|
+
export type PrintedDocumentType = CatalogValueOf<typeof PrintedDocumentType>;
|
|
145
|
+
/**
|
|
146
|
+
* Tipo de documento del transportista (`carrierDocumentTypeCode`).
|
|
147
|
+
*
|
|
148
|
+
* Es el catálogo de documentos de identidad del receptor que usa SIFEN.
|
|
149
|
+
*/
|
|
150
|
+
export declare const CarrierDocumentType: import("./catalog.js").Catalog<{
|
|
151
|
+
readonly PARAGUAYAN_ID: readonly [1, "Cédula paraguaya"];
|
|
152
|
+
readonly PASSPORT: readonly [2, "Pasaporte"];
|
|
153
|
+
readonly FOREIGN_ID: readonly [3, "Cédula extranjera"];
|
|
154
|
+
readonly RESIDENCE_CARD: readonly [4, "Carnet de residencia"];
|
|
155
|
+
readonly UNNAMED: readonly [5, "Innominado"];
|
|
156
|
+
readonly DIPLOMATIC_CARD: readonly [6, "Tarjeta Diplomática de exoneración fiscal"];
|
|
157
|
+
readonly UNSPECIFIED: readonly [9, "No especificado"];
|
|
158
|
+
}>;
|
|
159
|
+
export type CarrierDocumentType = CatalogValueOf<typeof CarrierDocumentType>;
|
|
160
|
+
//# sourceMappingURL=sifen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sifen.d.ts","sourceRoot":"","sources":["../../../src/constants/sifen.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAIhE;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;EAkB3B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,eAAe,CAAC,CAAC;AAErE;;;;;GAKG;AACH,eAAO,MAAM,W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