@fayz-ai/plugin-fiscal-br 0.3.2 → 0.3.5

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.
@@ -0,0 +1,75 @@
1
+ import { type ParsedNfe } from '../lib/nfe-xml';
2
+ import type { InboxNote, InboxNoteDetail, InboxStatusFilter, AcceptResult, StageResult, ProductOption, MeasurementUnitOption, ChartAccountOption, StockLocationOption } from '../types';
3
+ export declare function listInboxNotes(options?: {
4
+ filter?: InboxStatusFilter;
5
+ search?: string;
6
+ limit?: number;
7
+ }): Promise<InboxNote[]>;
8
+ export declare function getInboxNote(id: string): Promise<InboxNoteDetail | null>;
9
+ /**
10
+ * Read one XML file and stage it. Returns what the parser found together with
11
+ * how many items the de-para already bound, because that is the number the drop
12
+ * zone reports: "3 itens, 2 já vinculados" is the difference between a screen
13
+ * that remembers the supplier and one that does not.
14
+ */
15
+ export declare function stageNoteFromXml(xml: string, options?: {
16
+ unitId?: string | null;
17
+ }): Promise<StageResult & {
18
+ parsed: ParsedNfe;
19
+ }>;
20
+ export interface ItemDecisionInput {
21
+ id: string;
22
+ productId?: string | null;
23
+ entryType?: string | null;
24
+ chartAccountId?: string | null;
25
+ stockUnitId?: string | null;
26
+ conversionFactor?: number;
27
+ costMode?: string | null;
28
+ shortageQuantity?: number | null;
29
+ shortageReason?: string | null;
30
+ shortageNote?: string | null;
31
+ }
32
+ export interface InstalmentInput {
33
+ index: number;
34
+ number?: string | null;
35
+ dueDate?: string | null;
36
+ amount: number;
37
+ paymentType?: string | null;
38
+ barcode?: string | null;
39
+ pixKey?: string | null;
40
+ paymentMethodId?: string | null;
41
+ }
42
+ export declare function saveNoteDecision(input: {
43
+ documentId: string;
44
+ items: ItemDecisionInput[];
45
+ defaultChartAccountId?: string | null;
46
+ defaultLocationId?: string | null;
47
+ instalments?: InstalmentInput[] | null;
48
+ }): Promise<{
49
+ saved: number;
50
+ items: number;
51
+ reconciled: number;
52
+ }>;
53
+ /**
54
+ * Accept: stock entry and payable, one transaction. `alreadyAccepted` coming
55
+ * back true is not an error — it is the second click, and the RPC is idempotent
56
+ * on the NF-e access key.
57
+ */
58
+ export declare function acceptNote(documentId: string, locationId?: string | null): Promise<AcceptResult>;
59
+ export declare function rejectNote(documentId: string, reason?: string): Promise<void>;
60
+ export declare function searchProducts(term: string, limit?: number): Promise<ProductOption[]>;
61
+ export declare function listMeasurementUnits(): Promise<MeasurementUnitOption[]>;
62
+ export declare function listChartAccounts(): Promise<ChartAccountOption[]>;
63
+ export declare function listStockLocations(): Promise<StockLocationOption[]>;
64
+ /**
65
+ * What the supplier catalogue already remembers. The reconciliation screen shows
66
+ * it next to a bound product so the operator can tell a de-para hit from a
67
+ * product that appeared out of nowhere.
68
+ */
69
+ export declare function listSupplierMap(supplierCnpj: string): Promise<Array<{
70
+ supplierProductCode: string;
71
+ productId: string;
72
+ hitCount: number;
73
+ lastUsedAt: string | null;
74
+ }>>;
75
+ //# sourceMappingURL=inbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inbox.d.ts","sourceRoot":"","sources":["../../src/data/inbox.ts"],"names":[],"mappings":"AAaA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC5E,OAAO,KAAK,EACV,SAAS,EAAE,eAAe,EAC1B,iBAAiB,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAC3D,qBAAqB,EAAE,kBAAkB,EAAE,mBAAmB,EAC/D,MAAM,UAAU,CAAA;AAiEjB,wBAAsB,cAAc,CAAC,OAAO,GAAE;IAC5C,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACV,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAwB5B;AAkDD,wBAAsB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CA8C9E;A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AAI,CAAA;IACrC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,WAAW,CAAC,EAAE,eAAe,EAAE,GAAG,IAAI,CAAA;CACvC,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAqChE;AAED;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAgBtG;AAED,wBAAsB,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMnF;AAID,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAYvF;AAED,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAQ7E;AAED,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC,CASvE;AAED,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAOzE;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IACzE,mBAAmB,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC5F,CAAC,CAAC,CAYF"}
@@ -0,0 +1,3 @@
1
+ import type { PluginRegistryDef } from '@fayz-ai/core';
2
+ export declare const fiscalRegistries: PluginRegistryDef[];
3
+ //# sourceMappingURL=registries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registries.d.ts","sourceRoot":"","sources":["../../src/data/registries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,iBAAiB,EAAE,MAAM,eAAe,CAAA;AA4FjE,eAAO,MAAM,gBAAgB,EAAE,iBAAiB,EAQ/C,CAAA"}
package/dist/index.d.ts CHANGED
@@ -3,7 +3,30 @@ import { type CreatePlugNotasConnectorOptions } from './connectors/plugnotas';
3
3
  export * from './connectors/plugnotas';
4
4
  export * from './lib/financial-provider';
5
5
  export * from './types';
6
+ export * from './lib/nfe-xml';
7
+ export * from './data/inbox';
8
+ export { InboundNotesPage } from './views/InboundNotesPage';
9
+ export { InboundNotesView } from './views/InboundNotesView';
10
+ export { NoteReconcileView } from './views/NoteReconcileView';
11
+ export { ManifestView } from './views/ManifestView';
12
+ export { ComingSoon, EmBreve } from './views/ComingSoon';
13
+ export { IssuedNotesView, ReturnedNotesView, TaxGroupsView } from './views/GapScreens';
14
+ /**
15
+ * O grupo «Notas Fiscais» como o V1 o desenha: cinco telas sob uma aba. Duas
16
+ * funcionam, três anunciam o que falta. O app passa isto para
17
+ * `createInventoryPlugin({ extraViews })` e o Estoque desenha.
18
+ */
19
+ export { inboundNotesInventoryView } from './views/inventoryView';
6
20
  export interface CreatePlugNotasPluginOptions extends CreatePlugNotasConnectorOptions {
21
+ /** Onde a linha de Entrada de Notas entra no rail. Default: `main`, posição 5 (depois do estoque). */
22
+ navSection?: 'main' | 'secondary' | 'settings';
23
+ navPosition?: number;
24
+ /**
25
+ * Onde o título a pagar vive no app anfitrião, para o botão «Abrir a conta a
26
+ * pagar» depois de aceitar. Sem isto o botão não aparece — um botão que leva a
27
+ * lugar nenhum é pior que a ausência dele.
28
+ */
29
+ payableRoute?: (invoiceId: string) => string;
7
30
  }
8
31
  /**
9
32
  * Fiscal Brasil is an addon: Financial owns the fiscal document, while this
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,cAAc,EAAE,M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