@fayz-ai/plugin-fiscal-br 0.10.3 → 0.11.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/connectors/plugnotas.d.ts +6 -30
- package/dist/connectors/plugnotas.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +555 -285
- package/dist/index.js.map +1 -1
- package/dist/lib/emitters.d.ts +135 -0
- package/dist/lib/emitters.d.ts.map +1 -0
- package/dist/views/EmittersPanel.d.ts +10 -0
- package/dist/views/EmittersPanel.d.ts.map +1 -0
- package/dist/views/UnitFiscalWidgets.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
export type EmitterMode = 'observe' | 'own';
|
|
2
|
+
export interface EmitterModel {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
production: boolean;
|
|
5
|
+
series: number | null;
|
|
6
|
+
nextNumber: number | null;
|
|
7
|
+
}
|
|
8
|
+
export interface EmitterGate {
|
|
9
|
+
id: string;
|
|
10
|
+
ok: boolean;
|
|
11
|
+
detail: string | null;
|
|
12
|
+
}
|
|
13
|
+
export interface Emitter {
|
|
14
|
+
legalEntityId: string;
|
|
15
|
+
cnpj: string;
|
|
16
|
+
legalName: string | null;
|
|
17
|
+
tradeName: string | null;
|
|
18
|
+
/** null in the list until the emitter itself is read. */
|
|
19
|
+
mode: EmitterMode | null;
|
|
20
|
+
bindingId: string | null;
|
|
21
|
+
taxRegimeCode: number | null;
|
|
22
|
+
specialTaxRegimeCode: number;
|
|
23
|
+
nfe: EmitterModel;
|
|
24
|
+
nfce: EmitterModel & {
|
|
25
|
+
cscId: string | null;
|
|
26
|
+
cscTokenSet: boolean;
|
|
27
|
+
};
|
|
28
|
+
certificate: {
|
|
29
|
+
holder: string | null;
|
|
30
|
+
expiresAt: string | null;
|
|
31
|
+
uploadedAt: string | null;
|
|
32
|
+
warning: 'expired' | 'expiring' | null;
|
|
33
|
+
} | null;
|
|
34
|
+
providerSyncedAt: string | null;
|
|
35
|
+
providerWebhookAt: string | null;
|
|
36
|
+
provider?: {
|
|
37
|
+
registered: boolean;
|
|
38
|
+
certificate: {
|
|
39
|
+
id: string;
|
|
40
|
+
holder: string | null;
|
|
41
|
+
expiresAt: string | null;
|
|
42
|
+
} | null;
|
|
43
|
+
nfce: {
|
|
44
|
+
active: boolean;
|
|
45
|
+
production: boolean;
|
|
46
|
+
series: number[];
|
|
47
|
+
} | null;
|
|
48
|
+
nfe: {
|
|
49
|
+
active: boolean;
|
|
50
|
+
dfe: boolean;
|
|
51
|
+
} | null;
|
|
52
|
+
webhook: {
|
|
53
|
+
url: string;
|
|
54
|
+
} | null;
|
|
55
|
+
};
|
|
56
|
+
gates?: EmitterGate[];
|
|
57
|
+
ready?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface EmitterSettingsInput {
|
|
60
|
+
taxRegimeCode?: number | null;
|
|
61
|
+
specialTaxRegimeCode?: number;
|
|
62
|
+
nfe?: Partial<Pick<EmitterModel, 'enabled' | 'production' | 'series' | 'nextNumber'>>;
|
|
63
|
+
nfce?: Partial<Pick<EmitterModel, 'enabled' | 'production' | 'series' | 'nextNumber'>> & {
|
|
64
|
+
cscId?: string | null;
|
|
65
|
+
cscToken?: string | null;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/** A refusal from the service: `code` picks the sentence, `gates` lists what is missing. */
|
|
69
|
+
export declare class EmitterError extends Error {
|
|
70
|
+
readonly status: number;
|
|
71
|
+
readonly code: string;
|
|
72
|
+
readonly gates: EmitterGate[];
|
|
73
|
+
readonly field: string | null;
|
|
74
|
+
constructor(status: number, code: string, message: string, gates?: EmitterGate[], field?: string | null);
|
|
75
|
+
}
|
|
76
|
+
export declare function emitterErrorSentence(error: unknown): string;
|
|
77
|
+
/** What each gate asks of the store, in its words. */
|
|
78
|
+
export declare const GATE_LABELS: Record<string, string>;
|
|
79
|
+
export declare const emitters: {
|
|
80
|
+
list: () => Promise<Emitter[]>;
|
|
81
|
+
/** Also asks PlugNotas what it holds, and lists what issuing still needs. */
|
|
82
|
+
read: (legalEntityId: string) => Promise<Emitter>;
|
|
83
|
+
save: (legalEntityId: string, settings: EmitterSettingsInput) => Promise<Emitter>;
|
|
84
|
+
certificate: (legalEntityId: string, file: File, password: string) => Promise<Emitter>;
|
|
85
|
+
register: (legalEntityId: string) => Promise<Emitter>;
|
|
86
|
+
};
|
|
87
|
+
export declare const TAX_REGIMES: readonly [{
|
|
88
|
+
readonly value: 1;
|
|
89
|
+
readonly label: "Simples Nacional";
|
|
90
|
+
}, {
|
|
91
|
+
readonly value: 2;
|
|
92
|
+
readonly label: "Simples Nacional — excesso";
|
|
93
|
+
}, {
|
|
94
|
+
readonly value: 3;
|
|
95
|
+
readonly label: "Regime Normal (Lucro Presumido / Lucro Real)";
|
|
96
|
+
}];
|
|
97
|
+
/** PlugNotas' regimeTributarioEspecial codes, as the V1 screen lists them. */
|
|
98
|
+
export declare const SPECIAL_TAX_REGIMES: readonly [{
|
|
99
|
+
readonly value: 0;
|
|
100
|
+
readonly label: "Sem regime especial";
|
|
101
|
+
}, {
|
|
102
|
+
readonly value: 1;
|
|
103
|
+
readonly label: "Microempresa municipal";
|
|
104
|
+
}, {
|
|
105
|
+
readonly value: 2;
|
|
106
|
+
readonly label: "Estimativa";
|
|
107
|
+
}, {
|
|
108
|
+
readonly value: 3;
|
|
109
|
+
readonly label: "Sociedade de profissionais";
|
|
110
|
+
}, {
|
|
111
|
+
readonly value: 4;
|
|
112
|
+
readonly label: "Cooperativa";
|
|
113
|
+
}, {
|
|
114
|
+
readonly value: 5;
|
|
115
|
+
readonly label: "MEI";
|
|
116
|
+
}, {
|
|
117
|
+
readonly value: 6;
|
|
118
|
+
readonly label: "ME ou EPP";
|
|
119
|
+
}, {
|
|
120
|
+
readonly value: 7;
|
|
121
|
+
readonly label: "Lucro Real";
|
|
122
|
+
}, {
|
|
123
|
+
readonly value: 8;
|
|
124
|
+
readonly label: "Lucro Presumido";
|
|
125
|
+
}, {
|
|
126
|
+
readonly value: 9;
|
|
127
|
+
readonly label: "Tributação normal";
|
|
128
|
+
}, {
|
|
129
|
+
readonly value: 10;
|
|
130
|
+
readonly label: "Simples Nacional com excesso do sublimite";
|
|
131
|
+
}, {
|
|
132
|
+
readonly value: 11;
|
|
133
|
+
readonly label: "Empresa de responsabilidade limitada";
|
|
134
|
+
}];
|
|
135
|
+
//# sourceMappingURL=emitters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emitters.d.ts","sourceRoot":"","sources":["../../src/lib/emitters.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,KAAK,CAAA;AAE3C,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,OAAO,CAAA;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,OAAO,CAAA;IACX,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB;AAED,MAAM,WAAW,OAAO;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,yDAAyD;IACzD,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,GAAG,EAAE,YAAY,CAAA;IACjB,IAAI,EAAE,YAAY,GAAG;QAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CA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,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,YAAY,GAAG,QAAQ,GAAG,YAAY,CAAC,CAAC,GAAG;QAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAA;CAC7I;AAED,4FAA4F;AAC5F,qBAAa,YAAa,SAAQ,KAAK;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM;IAAmB,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE;IAAO,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;gBAAzH,MAAM,EAAE,MAAM,EAAW,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAW,KAAK,GAAE,WAAW,EAAO,EAAW,KAAK,GAAE,MAAM,GAAG,IAAW;CAItJ;AAmCD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAM3D;AAED,sDAAsD;AACtD,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAe9C,CAAA;AAgDD,eAAO,MAAM,QAAQ;;IAEnB,6EAA6E;0BACvD,MAAM;0BACN,MAAM,YAAY,oBAAoB;iCACzB,MAAM,QAAQ,IAAI,YAAY,MAAM;8BAE7C,MAAM;CACjC,CAAA;AAED,eAAO,MAAM,WAAW;;;;;;;;;EAMd,CAAA;AAEV,8EAA8E;AAC9E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAatB,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The PlugNotas connector's operate panel (control-sdk-backend ADR 0008): one
|
|
4
|
+
* card per company the account's units issue under. The store states the tax
|
|
5
|
+
* regime and the NFC-e settings, sends its A1 certificate and registers the
|
|
6
|
+
* company at PlugNotas. Every rule is the service's; this screen shows what
|
|
7
|
+
* it answers, including the list of what is still missing.
|
|
8
|
+
*/
|
|
9
|
+
export declare function EmittersPanel(): React.JSX.Element;
|
|
10
|
+
//# sourceMappingURL=EmittersPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmittersPanel.d.ts","sourceRoot":"","sources":["../../src/views/EmittersPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB;;;;;;GAMG;AACH,wBAAgB,aAAa,sBAgD5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnitFiscalWidgets.d.ts","sourceRoot":"","sources":["../../src/views/UnitFiscalWidgets.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"UnitFiscalWidgets.d.ts","sourceRoot":"","sources":["../../src/views/UnitFiscalWidgets.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAkCzB,UAAU,QAAQ;IAChB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B;AA4ID,wBAAgB,qBAAqB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,QAAQ,CAAA;CAAE,4BAkHlE;AA6BD,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,QAAQ,CAAA;CAAE,4BAuM7D"}
|