@seidor-cloud-produtos/tax-core 1.0.37 → 1.0.39
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 +198 -30
- package/dist/index.d.ts +198 -30
- package/dist/index.js +8 -5
- package/dist/index.mjs +8 -5
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MongoClient } from 'mongodb';
|
|
2
1
|
import { ClientConfig, Pool } from 'pg';
|
|
2
|
+
import { MongoClient } from 'mongodb';
|
|
3
3
|
|
|
4
4
|
type AuditAction = 'CREATED' | 'UPDATED' | 'DELETED' | 'INACTIVATED' | 'ACTIVATED' | 'STATUS_CHANGED' | 'IMPORTED' | 'REPROCESSED';
|
|
5
5
|
type AuditActorType = 'USER' | 'SYSTEM' | 'INTEGRATION';
|
|
@@ -57,6 +57,15 @@ declare class AuditEventBuilder {
|
|
|
57
57
|
build(): AuditEvent;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
declare const EnrichmentField: {
|
|
61
|
+
readonly REFERENTIAL_ACCOUNT_PLAN: "referential_account_plan";
|
|
62
|
+
};
|
|
63
|
+
type EnrichmentField = (typeof EnrichmentField)[keyof typeof EnrichmentField];
|
|
64
|
+
type FieldEnricherFn = (before: Record<string, unknown>, after: Record<string, unknown>, context: AuditContext) => Promise<{
|
|
65
|
+
previous?: unknown;
|
|
66
|
+
next?: unknown;
|
|
67
|
+
}>;
|
|
68
|
+
|
|
60
69
|
interface CompareOptions {
|
|
61
70
|
ignore?: string[];
|
|
62
71
|
}
|
|
@@ -88,10 +97,11 @@ declare class AuditEventService {
|
|
|
88
97
|
private readonly repository;
|
|
89
98
|
private readonly config;
|
|
90
99
|
constructor(repository: IAuditEventRepository, config: AuditServiceConfig);
|
|
91
|
-
trackCreate<T extends Record<string, unknown>>(entityType: string, eventId: string, entity: T, context: AuditContext): Promise<AuditEvent>;
|
|
92
|
-
trackUpdate<T extends Record<string, unknown>>(entityType: string, eventId: string, before: T, after: T, context: AuditContext, compareOptions?: CompareOptions): Promise<AuditEvent | null>;
|
|
100
|
+
trackCreate<T extends Record<string, unknown>>(entityType: string, eventId: string, entity: T, context: AuditContext, enrichers?: Map<EnrichmentField, FieldEnricherFn>): Promise<AuditEvent>;
|
|
101
|
+
trackUpdate<T extends Record<string, unknown>>(entityType: string, eventId: string, before: T, after: T, context: AuditContext, compareOptions?: CompareOptions, enrichers?: Map<EnrichmentField, FieldEnricherFn>): Promise<AuditEvent | null>;
|
|
93
102
|
trackDelete<T extends Record<string, unknown>>(entityType: string, eventId: string, entity: T, context: AuditContext): Promise<AuditEvent>;
|
|
94
103
|
track(action: AuditAction, entityType: string, eventId: string, changeSet: AuditChangeSet, context: AuditContext): Promise<AuditEvent>;
|
|
104
|
+
private applyEnrichers;
|
|
95
105
|
}
|
|
96
106
|
|
|
97
107
|
declare class MongoConfig {
|
|
@@ -127,6 +137,38 @@ declare class MongoAuditEventRepository implements IAuditEventRepository {
|
|
|
127
137
|
disconnect(): Promise<void>;
|
|
128
138
|
}
|
|
129
139
|
|
|
140
|
+
declare class PostgresConfig {
|
|
141
|
+
config: {
|
|
142
|
+
user: string;
|
|
143
|
+
host: string;
|
|
144
|
+
database: string;
|
|
145
|
+
password: string;
|
|
146
|
+
port: number;
|
|
147
|
+
ssl?: {
|
|
148
|
+
rejectUnauthorized: boolean;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
constructor(config: {
|
|
152
|
+
user: string;
|
|
153
|
+
host: string;
|
|
154
|
+
database: string;
|
|
155
|
+
password: string;
|
|
156
|
+
port: number;
|
|
157
|
+
ssl?: {
|
|
158
|
+
rejectUnauthorized: boolean;
|
|
159
|
+
};
|
|
160
|
+
});
|
|
161
|
+
getConnection(): ClientConfig;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
declare class AccountServicePostgresRepository {
|
|
165
|
+
private readonly pool;
|
|
166
|
+
constructor(config: PostgresConfig);
|
|
167
|
+
getReferentialAccountPlanAlias(id: string): Promise<string | null>;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
declare function createReferentialAccountPlanEnricher(config: PostgresConfig, fieldName?: EnrichmentField): FieldEnricherFn;
|
|
171
|
+
|
|
130
172
|
interface Cloneable {
|
|
131
173
|
clone(): this;
|
|
132
174
|
}
|
|
@@ -678,7 +720,8 @@ declare enum MunicipalObligationIdEnum {
|
|
|
678
720
|
RIO_DE_JANEIRO = "RIO_DE_JANEIRO",
|
|
679
721
|
RECIFE = "RECIFE",
|
|
680
722
|
SAO_BERNARDO_DO_CAMPO = "SAO_BERNARDO_DO_CAMPO",
|
|
681
|
-
FLORIANOPOLIS = "FLORIANOPOLIS"
|
|
723
|
+
FLORIANOPOLIS = "FLORIANOPOLIS",
|
|
724
|
+
CAMPOS_DOS_GOYTACAZES_RJ = "CAMPOS_DOS_GOYTACAZES_RJ"
|
|
682
725
|
}
|
|
683
726
|
|
|
684
727
|
declare enum MunicipalObligationNameEnum {
|
|
@@ -2589,30 +2632,6 @@ type MongoRetainedTaxFilter = MongoBaseFilter & {
|
|
|
2589
2632
|
declare function buildMongoFilter(filters: FiltersDocument): MongoBaseFilter;
|
|
2590
2633
|
declare function buildMongoFilterToRetainedTax(filters: FiltersDocument): MongoRetainedTaxFilter;
|
|
2591
2634
|
|
|
2592
|
-
declare class PostgresConfig {
|
|
2593
|
-
config: {
|
|
2594
|
-
user: string;
|
|
2595
|
-
host: string;
|
|
2596
|
-
database: string;
|
|
2597
|
-
password: string;
|
|
2598
|
-
port: number;
|
|
2599
|
-
ssl?: {
|
|
2600
|
-
rejectUnauthorized: boolean;
|
|
2601
|
-
};
|
|
2602
|
-
};
|
|
2603
|
-
constructor(config: {
|
|
2604
|
-
user: string;
|
|
2605
|
-
host: string;
|
|
2606
|
-
database: string;
|
|
2607
|
-
password: string;
|
|
2608
|
-
port: number;
|
|
2609
|
-
ssl?: {
|
|
2610
|
-
rejectUnauthorized: boolean;
|
|
2611
|
-
};
|
|
2612
|
-
});
|
|
2613
|
-
getConnection(): ClientConfig;
|
|
2614
|
-
}
|
|
2615
|
-
|
|
2616
2635
|
declare class MongoRepository implements DocumentRepository {
|
|
2617
2636
|
private readonly _client;
|
|
2618
2637
|
private _isConnected;
|
|
@@ -4739,11 +4758,25 @@ interface RegisterPersist {
|
|
|
4739
4758
|
getByKey(registerKey: string): RegisterDefinition | undefined;
|
|
4740
4759
|
}
|
|
4741
4760
|
|
|
4761
|
+
declare abstract class RegisterSorter {
|
|
4762
|
+
abstract sort(registers: RegisterDefinition[]): RegisterDefinition[];
|
|
4763
|
+
}
|
|
4764
|
+
declare class AlphabeticalRegisterSorter extends RegisterSorter {
|
|
4765
|
+
static createInstance(): AlphabeticalRegisterSorter;
|
|
4766
|
+
sort(registers: RegisterDefinition[]): RegisterDefinition[];
|
|
4767
|
+
}
|
|
4768
|
+
declare class InsertionOrderRegisterSorter extends RegisterSorter {
|
|
4769
|
+
static createInstance(): InsertionOrderRegisterSorter;
|
|
4770
|
+
sort(registers: RegisterDefinition[]): RegisterDefinition[];
|
|
4771
|
+
}
|
|
4772
|
+
declare const alphabeticalByReg: AlphabeticalRegisterSorter;
|
|
4773
|
+
declare const insertionOrder: InsertionOrderRegisterSorter;
|
|
4742
4774
|
declare abstract class Block implements RegisterEventNotifier, RegisterSubscriber {
|
|
4743
4775
|
private readonly _name;
|
|
4744
4776
|
private eventEmitter;
|
|
4745
4777
|
protected registersPersist: RegisterPersist;
|
|
4746
|
-
protected
|
|
4778
|
+
protected sortStrategy: RegisterSorter;
|
|
4779
|
+
protected constructor(name: string, regPersist: RegisterPersist, sortStrategy?: RegisterSorter);
|
|
4747
4780
|
abstract eventHandler(eventData: RegisterEventData): void;
|
|
4748
4781
|
notifyEvent(eventData: RegisterEventData): void;
|
|
4749
4782
|
get name(): string;
|
|
@@ -4796,6 +4829,10 @@ interface RegisterGenerator {
|
|
|
4796
4829
|
generate(register: RegisterDefinition): void;
|
|
4797
4830
|
save(): void;
|
|
4798
4831
|
}
|
|
4832
|
+
interface NestedRegisterGenerator extends RegisterGenerator {
|
|
4833
|
+
beginRegister(register: RegisterDefinition): void;
|
|
4834
|
+
endRegister(register: RegisterDefinition): void;
|
|
4835
|
+
}
|
|
4799
4836
|
|
|
4800
4837
|
interface ReportGenerationOptions {
|
|
4801
4838
|
openSuffix: string;
|
|
@@ -4893,15 +4930,26 @@ declare class StringArrayOutput implements OutputWriter {
|
|
|
4893
4930
|
get Output(): string[];
|
|
4894
4931
|
}
|
|
4895
4932
|
|
|
4933
|
+
type FieldOrder = 'legacy' | 'declaration';
|
|
4934
|
+
declare class FieldKeyResolver {
|
|
4935
|
+
private readonly mode;
|
|
4936
|
+
private constructor();
|
|
4937
|
+
static newWithOptions(mode?: FieldOrder): FieldKeyResolver;
|
|
4938
|
+
resolve(register: object): string[];
|
|
4939
|
+
}
|
|
4940
|
+
|
|
4896
4941
|
interface TaxRegisterGenerationOptions {
|
|
4897
4942
|
writer: OutputWriter;
|
|
4898
4943
|
fieldSeparator: string;
|
|
4899
4944
|
separatorAtTheRegisterStart: boolean;
|
|
4900
4945
|
separatorAtTheRegisterEnd: boolean;
|
|
4901
4946
|
writeRegisterTag: boolean;
|
|
4947
|
+
fieldOrder?: FieldOrder;
|
|
4902
4948
|
}
|
|
4903
4949
|
declare class TaxRegisterGenerator implements RegisterGenerator {
|
|
4904
4950
|
protected _options: TaxRegisterGenerationOptions;
|
|
4951
|
+
private readonly fieldKeyResolver;
|
|
4952
|
+
private readonly fieldFormatter;
|
|
4905
4953
|
private constructor();
|
|
4906
4954
|
save(): void;
|
|
4907
4955
|
static defaultOptions(writer?: OutputWriter): TaxRegisterGenerationOptions;
|
|
@@ -4913,6 +4961,126 @@ declare class TaxRegisterGenerator implements RegisterGenerator {
|
|
|
4913
4961
|
private numericValue;
|
|
4914
4962
|
}
|
|
4915
4963
|
|
|
4964
|
+
interface FormatValueContext {
|
|
4965
|
+
omitZeroWhenOptional: boolean;
|
|
4966
|
+
stripLeadingZeros: boolean;
|
|
4967
|
+
fieldSeparator?: string;
|
|
4968
|
+
}
|
|
4969
|
+
declare class FieldFormatter {
|
|
4970
|
+
private readonly ctx;
|
|
4971
|
+
private constructor();
|
|
4972
|
+
static newWithOptions(ctx: FormatValueContext): FieldFormatter;
|
|
4973
|
+
alphanumericValue(metadata: FieldFormat, value: unknown): string;
|
|
4974
|
+
numericValue(metadata: FieldFormat, value: unknown, stripLeadingZeros?: boolean): string;
|
|
4975
|
+
}
|
|
4976
|
+
|
|
4977
|
+
declare const XML_CHILD_DATA_TYPE: "child";
|
|
4978
|
+
type XmlFieldKind = 'element' | 'attribute' | 'child';
|
|
4979
|
+
type XmlDateFormat = 'date' | 'dateTime';
|
|
4980
|
+
interface XmlFieldMeta {
|
|
4981
|
+
name: string;
|
|
4982
|
+
kind: XmlFieldKind;
|
|
4983
|
+
emitEmpty?: boolean;
|
|
4984
|
+
stripLeadingZeros?: boolean;
|
|
4985
|
+
dateFormat?: XmlDateFormat;
|
|
4986
|
+
}
|
|
4987
|
+
interface XmlTypeMeta {
|
|
4988
|
+
name: string;
|
|
4989
|
+
prefix?: string;
|
|
4990
|
+
}
|
|
4991
|
+
interface XmlNamespaces {
|
|
4992
|
+
default?: string;
|
|
4993
|
+
[prefix: string]: string | undefined;
|
|
4994
|
+
}
|
|
4995
|
+
interface StrictError {
|
|
4996
|
+
register: string;
|
|
4997
|
+
field: string;
|
|
4998
|
+
reason: string;
|
|
4999
|
+
}
|
|
5000
|
+
interface XmlReportGenerationOptions {
|
|
5001
|
+
writer: OutputWriter;
|
|
5002
|
+
rootElement: string;
|
|
5003
|
+
xmlDeclaration?: boolean;
|
|
5004
|
+
encoding?: string;
|
|
5005
|
+
namespaces?: XmlNamespaces;
|
|
5006
|
+
fieldOrder?: FieldOrder;
|
|
5007
|
+
indent?: string | false;
|
|
5008
|
+
strict?: boolean;
|
|
5009
|
+
}
|
|
5010
|
+
interface ResolvedXmlOptions {
|
|
5011
|
+
writer: OutputWriter;
|
|
5012
|
+
rootElement: string;
|
|
5013
|
+
xmlDeclaration: boolean;
|
|
5014
|
+
encoding: string;
|
|
5015
|
+
namespaces: XmlNamespaces;
|
|
5016
|
+
fieldOrder: FieldOrder;
|
|
5017
|
+
indent: string | false;
|
|
5018
|
+
strict: boolean;
|
|
5019
|
+
}
|
|
5020
|
+
interface XmlGenerationResult {
|
|
5021
|
+
xml: string;
|
|
5022
|
+
strictErrors: StrictError[];
|
|
5023
|
+
}
|
|
5024
|
+
|
|
5025
|
+
declare function XmlElement(name: string, opts?: Partial<XmlFieldMeta>): PropertyDecorator;
|
|
5026
|
+
declare function XmlAttribute(name: string): PropertyDecorator;
|
|
5027
|
+
declare function XmlChild(): PropertyDecorator;
|
|
5028
|
+
declare function XmlComplexType(name: string, opts?: {
|
|
5029
|
+
prefix?: string;
|
|
5030
|
+
}): ClassDecorator;
|
|
5031
|
+
declare function XmlDate(): PropertyDecorator;
|
|
5032
|
+
declare function XmlDateTime(): PropertyDecorator;
|
|
5033
|
+
declare class XmlMetadata {
|
|
5034
|
+
static getType(register: object): XmlTypeMeta | undefined;
|
|
5035
|
+
static getField(register: object, prop: string): XmlFieldMeta | undefined;
|
|
5036
|
+
}
|
|
5037
|
+
|
|
5038
|
+
declare class XmlFieldFormatter {
|
|
5039
|
+
private readonly numericFormatter;
|
|
5040
|
+
private constructor();
|
|
5041
|
+
static newWithDefaultOptions(): XmlFieldFormatter;
|
|
5042
|
+
escape(value: string): string;
|
|
5043
|
+
isMissing(value: unknown): boolean;
|
|
5044
|
+
format(fmt: FieldFormat, xml: XmlFieldMeta, value: unknown, strictErrors: StrictError[] | undefined, registerName: string, field: string): string | undefined;
|
|
5045
|
+
private formatDate;
|
|
5046
|
+
private pad2;
|
|
5047
|
+
}
|
|
5048
|
+
|
|
5049
|
+
declare class XmlStrictError extends Error {
|
|
5050
|
+
readonly strictErrors: StrictError[];
|
|
5051
|
+
readonly xml: string;
|
|
5052
|
+
constructor(strictErrors: StrictError[], xml: string);
|
|
5053
|
+
}
|
|
5054
|
+
|
|
5055
|
+
declare class XmlRegisterGenerator implements NestedRegisterGenerator {
|
|
5056
|
+
private readonly opts;
|
|
5057
|
+
private readonly writer;
|
|
5058
|
+
readonly strictErrors: StrictError[];
|
|
5059
|
+
private readonly chunks;
|
|
5060
|
+
private readonly fieldKeyResolver;
|
|
5061
|
+
private readonly fieldFormatter;
|
|
5062
|
+
constructor(opts: ResolvedXmlOptions, writer: OutputWriter);
|
|
5063
|
+
get output(): string;
|
|
5064
|
+
generate(register: RegisterDefinition): void;
|
|
5065
|
+
save(): void;
|
|
5066
|
+
beginRegister(register: RegisterDefinition): void;
|
|
5067
|
+
endRegister(_register: RegisterDefinition): void;
|
|
5068
|
+
append(chunk: string): void;
|
|
5069
|
+
serializeRegister(register: RegisterDefinition, depth: number, inheritedPrefix?: string): void;
|
|
5070
|
+
private nl;
|
|
5071
|
+
private qualify;
|
|
5072
|
+
}
|
|
5073
|
+
|
|
5074
|
+
declare class XmlReportGenerator {
|
|
5075
|
+
private readonly opts;
|
|
5076
|
+
private constructor();
|
|
5077
|
+
static newWithOptions(opts: XmlReportGenerationOptions): XmlReportGenerator;
|
|
5078
|
+
get writer(): OutputWriter;
|
|
5079
|
+
generateFile(taxReport: TaxReport): XmlGenerationResult;
|
|
5080
|
+
private static resolveOptions;
|
|
5081
|
+
private namespaceDeclarations;
|
|
5082
|
+
}
|
|
5083
|
+
|
|
4916
5084
|
declare const MessageCode: {
|
|
4917
5085
|
AUTH: {
|
|
4918
5086
|
UNAUTHORIZED: string;
|
|
@@ -5076,4 +5244,4 @@ declare class Calendar {
|
|
|
5076
5244
|
|
|
5077
5245
|
declare const BRAZIL_HOLIDAYS: HolidayDefinition[];
|
|
5078
5246
|
|
|
5079
|
-
export { AccountingDocument, ActionTypeEnum, Addition, Address, type AllowedCfopsCreditConfig, Alphanumeric, type AuditAction, type AuditActorType, type AuditChangeSet, type AuditChangeSetType, type AuditContext, type AuditEvent, AuditEventBuilder, AuditEventService, type AuditFieldChange, type AuditServiceConfig, type AuditSourceType, type AuditTaxCollectionDetails, type AuditTaxCollectionInfo, type AuthTokenExpiredParams, type AuthUnauthorizedParams, BRAZIL_HOLIDAYS, Block, BuilderAccountingDocument, BuilderAddition, BuilderAddress, BuilderConversionFactor, BuilderDocument, BuilderImportDeclaration, BuilderItem, BuilderPerson, BuilderTax, CNPJ, CNPJ_FLEXIBLE_REGEX, CNPJ_MASKED_REGEX, CNPJ_RAW_REGEX, CPF, CPF_FLEXIBLE_REGEX, CPF_MASKED_REGEX, CPF_RAW_REGEX, CST, CalculationBasisNatureSetting, Calendar, type Cloneable, CloseBlock, CloseFile, CodIncTrib, type Cod_ent_ref, CodeStatusEnum, type CompareOptions, type CompareResult, ConfigTypeEnum, ConsoleOutput, Contact, ContactTypesEnum, ConversionFactor, CounterBlock, CounterRegister, Country, CountryCodeEnum, CprbOption, CreditBalanceOriginCreditTypeEnum, CreditBalanceRegimeTypeEnum, CteTypeEnum, DEFAULT_LOCALE, type DatabaseConnectionFailedParams, type DatabaseQueryErrorParams, DayOfWeek, Decimal, DefaultAlphanumericLength, DefaultDecimalLength, DefaultDecimalSeparator, DescriptionStatusEnum, DifalIcmsCategoryEnum, Document, type DocumentRepository, DocumentTypeEnum, DonationIndicatorEnum, DueDateAdjustmentEnum, EasterCalculator, EcdSpecializedProfile, EcfSpecializedProfile, EfdContribSpecializedProfile, EfdIcmsIpiSpecializedProfile, Email, EnforceabilityOfISSEnum, Establishment, EstablishmentEvent, Event, EventEnum, FederalCollectionSettings, FieldDataType, type FieldFormat, type FiltersDocument, FiscalQualificationType, FreightContractedNatureIndicatorEnum, FreightTypeCodeEnum, FreightTypeEnum, type GetAuditTaxCollectionQuery, GrossRevenueContributionHeaders, type HolidayDefinition, type HolidayLocation, type HolidayScope, type IAccountingDocumentMongo, type IAddition, type IAddressMongo, type IAuditEventRepository, type IBaseHeadersDTO, type ICalculationBasisNatureSetting, type ICollectionSettings, type IConversionFactor, type IDocumentMongo, type IEcdSpecializedProfile, type IEcfSpecializedProfile, type IEfdContribSpecializedProfile, type IEfdicmsipiAdditionalFields, type IEstablishment, type IEstablishmentEvent, type IGrossRevenueContributionHeader, type IIcmsAdjustmentExtraInfo, type IIcmsAdjustmentSetting, type IIcmsCreditBaseConfig, type IIcmsCreditConfigLog, type IImportDeclaration, type IItemMongo, type IJudicialProcess, type INatureConfig, type INatureOfIncomeBusinessPartner, type IPersonMongo, type IProfile, type IProfileRepository, type IProfileServiceUrls, type IReinfAdditionalFields, type IRevenueNatureSettings, type IScp, type ISignatory, type IStartingCreditBalance, type IStateCollectionSettingsRepository, type ITable9, type ITaxMongo, type ITaxTypeConfig, type ITaxTypeConfigBase, type ITaxTypeConfigCreateOrUpdate, type ITaxTypeConfigLog, IcmsAdjustmentGroupEnum, IcmsAdjustmentRegistryEnum, IcmsAdjustmentSetting, IcmsAdjustmentTaxTypeEnum, IcmsAdjustmentTypeEnum, IcmsCalculationIndicatorEnum, type IdentificationNumber, ImportDeclaration, IntermediationTypeEnum, type InternalServerErrorParams, InternationalTransportTypeEnum, IssuerIndicatorEnum, Item, ItemTypeEnum, JudicialProcessOriginEnum, Key, type KeyComposition, type KeyFieldDefinition, LayoutDateFormat, type Locale, MaximumNumericLength, MemoryMasterDataRepository, MemoryPersist, MessageCategory, MessageCode, type MessageCodeType, Messages, ModelConverter, ModelRollback, MongoAuditEventRepository, MongoConfig, MongoRepository, MongoToDocumentBuilder, MunicipalObligation, MunicipalObligationIdEnum, MunicipalObligationNameEnum, MunicipalObligationTypeEnum, MunicipalRegistration, Municipality, NameCountryEnum, NatureCode, NatureConfig, Numeric, ObjectComparator, ObligationCodeEnum, OnDuplication, OnDuplicationStrategy, OpenBlock, OperationTypeEnum, OurDate, type OutputWriter, type ParameterTypes, PaymentTypeEnum, PeriodDateFieldEnum, Person, type PisCofinsOptions, PostgresConfig, PostgresRepository, ProductOriginEnum, Profile, ProfileDbRepository, ProfileRestRepository, ProfileTaxTypeEnum, Register, type RegisterDefinition, type RegisterEventData, type RegisterEventNotifier, type RegisterGenerator, type RegisterPersist, type RegisterSubscriber, ReinfSpecializedProfile, type ReportGenerationOptions, ReportGenerator, type Repository, type ResolvedHoliday, RevenueNatureSettings, RevenueTypeEnum, Scp, ServiceCode, ServiceCodeEnum, type SettingErrorParams, Signatory, SimpleNationalOption, type SimpleReportGenerationOptions, SimpleReportGenerator, StartingCreditBalance, StartingCreditBalanceTypeEnum, State, StateCollectionSettings, StateCollectionSettingsConfigTypeEnum, StateCollectionSettingsTaxTypeEnum, StateEnum, StateRegistration, StateRegistrationIndicatorEnum, StatusDocumentEnum, StringArrayOutput, TagCounter, Tax, type TaxCollectionDetails, TaxCollectionType, TaxCollectionTypeEnum, TaxRegimeEnum, type TaxRegimes, type TaxRegisterGenerationOptions, TaxRegisterGenerator, TaxReport, TaxTypeEnum, TaxationType, Telephone, Uf, type ValidationInvalidInputParams, type ValidationMissingFieldParams, ValueProviderType, WEEKDAYS, ZERO_PIS_COFINS_BY_CST, ZfmPresumedCreditTypeEnum, buildMongoFilter, buildMongoFilterToRetainedTax, calculate_bases_values, cleanData, formatMessage, isEmptyObject, keyCompositionMetadata, logWithContext, newRegisterEventData, normalizeServiceCode, onDuplicationStrategyMetadata, parseState, toSafeNumber, validationValue };
|
|
5247
|
+
export { AccountServicePostgresRepository, AccountingDocument, ActionTypeEnum, Addition, Address, type AllowedCfopsCreditConfig, AlphabeticalRegisterSorter, Alphanumeric, type AuditAction, type AuditActorType, type AuditChangeSet, type AuditChangeSetType, type AuditContext, type AuditEvent, AuditEventBuilder, AuditEventService, type AuditFieldChange, type AuditServiceConfig, type AuditSourceType, type AuditTaxCollectionDetails, type AuditTaxCollectionInfo, type AuthTokenExpiredParams, type AuthUnauthorizedParams, BRAZIL_HOLIDAYS, Block, BuilderAccountingDocument, BuilderAddition, BuilderAddress, BuilderConversionFactor, BuilderDocument, BuilderImportDeclaration, BuilderItem, BuilderPerson, BuilderTax, CNPJ, CNPJ_FLEXIBLE_REGEX, CNPJ_MASKED_REGEX, CNPJ_RAW_REGEX, CPF, CPF_FLEXIBLE_REGEX, CPF_MASKED_REGEX, CPF_RAW_REGEX, CST, CalculationBasisNatureSetting, Calendar, type Cloneable, CloseBlock, CloseFile, CodIncTrib, type Cod_ent_ref, CodeStatusEnum, type CompareOptions, type CompareResult, ConfigTypeEnum, ConsoleOutput, Contact, ContactTypesEnum, ConversionFactor, CounterBlock, CounterRegister, Country, CountryCodeEnum, CprbOption, CreditBalanceOriginCreditTypeEnum, CreditBalanceRegimeTypeEnum, CteTypeEnum, DEFAULT_LOCALE, type DatabaseConnectionFailedParams, type DatabaseQueryErrorParams, DayOfWeek, Decimal, DefaultAlphanumericLength, DefaultDecimalLength, DefaultDecimalSeparator, DescriptionStatusEnum, DifalIcmsCategoryEnum, Document, type DocumentRepository, DocumentTypeEnum, DonationIndicatorEnum, DueDateAdjustmentEnum, EasterCalculator, EcdSpecializedProfile, EcfSpecializedProfile, EfdContribSpecializedProfile, EfdIcmsIpiSpecializedProfile, Email, EnforceabilityOfISSEnum, EnrichmentField, Establishment, EstablishmentEvent, Event, EventEnum, FederalCollectionSettings, FieldDataType, type FieldEnricherFn, type FieldFormat, FieldFormatter, FieldKeyResolver, type FieldOrder, type FiltersDocument, FiscalQualificationType, type FormatValueContext, FreightContractedNatureIndicatorEnum, FreightTypeCodeEnum, FreightTypeEnum, type GetAuditTaxCollectionQuery, GrossRevenueContributionHeaders, type HolidayDefinition, type HolidayLocation, type HolidayScope, type IAccountingDocumentMongo, type IAddition, type IAddressMongo, type IAuditEventRepository, type IBaseHeadersDTO, type ICalculationBasisNatureSetting, type ICollectionSettings, type IConversionFactor, type IDocumentMongo, type IEcdSpecializedProfile, type IEcfSpecializedProfile, type IEfdContribSpecializedProfile, type IEfdicmsipiAdditionalFields, type IEstablishment, type IEstablishmentEvent, type IGrossRevenueContributionHeader, type IIcmsAdjustmentExtraInfo, type IIcmsAdjustmentSetting, type IIcmsCreditBaseConfig, type IIcmsCreditConfigLog, type IImportDeclaration, type IItemMongo, type IJudicialProcess, type INatureConfig, type INatureOfIncomeBusinessPartner, type IPersonMongo, type IProfile, type IProfileRepository, type IProfileServiceUrls, type IReinfAdditionalFields, type IRevenueNatureSettings, type IScp, type ISignatory, type IStartingCreditBalance, type IStateCollectionSettingsRepository, type ITable9, type ITaxMongo, type ITaxTypeConfig, type ITaxTypeConfigBase, type ITaxTypeConfigCreateOrUpdate, type ITaxTypeConfigLog, IcmsAdjustmentGroupEnum, IcmsAdjustmentRegistryEnum, IcmsAdjustmentSetting, IcmsAdjustmentTaxTypeEnum, IcmsAdjustmentTypeEnum, IcmsCalculationIndicatorEnum, type IdentificationNumber, ImportDeclaration, InsertionOrderRegisterSorter, IntermediationTypeEnum, type InternalServerErrorParams, InternationalTransportTypeEnum, IssuerIndicatorEnum, Item, ItemTypeEnum, JudicialProcessOriginEnum, Key, type KeyComposition, type KeyFieldDefinition, LayoutDateFormat, type Locale, MaximumNumericLength, MemoryMasterDataRepository, MemoryPersist, MessageCategory, MessageCode, type MessageCodeType, Messages, ModelConverter, ModelRollback, MongoAuditEventRepository, MongoConfig, MongoRepository, MongoToDocumentBuilder, MunicipalObligation, MunicipalObligationIdEnum, MunicipalObligationNameEnum, MunicipalObligationTypeEnum, MunicipalRegistration, Municipality, NameCountryEnum, NatureCode, NatureConfig, type NestedRegisterGenerator, Numeric, ObjectComparator, ObligationCodeEnum, OnDuplication, OnDuplicationStrategy, OpenBlock, OperationTypeEnum, OurDate, type OutputWriter, type ParameterTypes, PaymentTypeEnum, PeriodDateFieldEnum, Person, type PisCofinsOptions, PostgresConfig, PostgresRepository, ProductOriginEnum, Profile, ProfileDbRepository, ProfileRestRepository, ProfileTaxTypeEnum, Register, type RegisterDefinition, type RegisterEventData, type RegisterEventNotifier, type RegisterGenerator, type RegisterPersist, RegisterSorter, type RegisterSubscriber, ReinfSpecializedProfile, type ReportGenerationOptions, ReportGenerator, type Repository, type ResolvedHoliday, type ResolvedXmlOptions, RevenueNatureSettings, RevenueTypeEnum, Scp, ServiceCode, ServiceCodeEnum, type SettingErrorParams, Signatory, SimpleNationalOption, type SimpleReportGenerationOptions, SimpleReportGenerator, StartingCreditBalance, StartingCreditBalanceTypeEnum, State, StateCollectionSettings, StateCollectionSettingsConfigTypeEnum, StateCollectionSettingsTaxTypeEnum, StateEnum, StateRegistration, StateRegistrationIndicatorEnum, StatusDocumentEnum, type StrictError, StringArrayOutput, TagCounter, Tax, type TaxCollectionDetails, TaxCollectionType, TaxCollectionTypeEnum, TaxRegimeEnum, type TaxRegimes, type TaxRegisterGenerationOptions, TaxRegisterGenerator, TaxReport, TaxTypeEnum, TaxationType, Telephone, Uf, type ValidationInvalidInputParams, type ValidationMissingFieldParams, ValueProviderType, WEEKDAYS, XML_CHILD_DATA_TYPE, XmlAttribute, XmlChild, XmlComplexType, XmlDate, type XmlDateFormat, XmlDateTime, XmlElement, XmlFieldFormatter, type XmlFieldKind, type XmlFieldMeta, type XmlGenerationResult, XmlMetadata, type XmlNamespaces, XmlRegisterGenerator, type XmlReportGenerationOptions, XmlReportGenerator, XmlStrictError, type XmlTypeMeta, ZERO_PIS_COFINS_BY_CST, ZfmPresumedCreditTypeEnum, alphabeticalByReg, buildMongoFilter, buildMongoFilterToRetainedTax, calculate_bases_values, cleanData, createReferentialAccountPlanEnricher, formatMessage, insertionOrder, isEmptyObject, keyCompositionMetadata, logWithContext, newRegisterEventData, normalizeServiceCode, onDuplicationStrategyMetadata, parseState, toSafeNumber, validationValue };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MongoClient } from 'mongodb';
|
|
2
1
|
import { ClientConfig, Pool } from 'pg';
|
|
2
|
+
import { MongoClient } from 'mongodb';
|
|
3
3
|
|
|
4
4
|
type AuditAction = 'CREATED' | 'UPDATED' | 'DELETED' | 'INACTIVATED' | 'ACTIVATED' | 'STATUS_CHANGED' | 'IMPORTED' | 'REPROCESSED';
|
|
5
5
|
type AuditActorType = 'USER' | 'SYSTEM' | 'INTEGRATION';
|
|
@@ -57,6 +57,15 @@ declare class AuditEventBuilder {
|
|
|
57
57
|
build(): AuditEvent;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
declare const EnrichmentField: {
|
|
61
|
+
readonly REFERENTIAL_ACCOUNT_PLAN: "referential_account_plan";
|
|
62
|
+
};
|
|
63
|
+
type EnrichmentField = (typeof EnrichmentField)[keyof typeof EnrichmentField];
|
|
64
|
+
type FieldEnricherFn = (before: Record<string, unknown>, after: Record<string, unknown>, context: AuditContext) => Promise<{
|
|
65
|
+
previous?: unknown;
|
|
66
|
+
next?: unknown;
|
|
67
|
+
}>;
|
|
68
|
+
|
|
60
69
|
interface CompareOptions {
|
|
61
70
|
ignore?: string[];
|
|
62
71
|
}
|
|
@@ -88,10 +97,11 @@ declare class AuditEventService {
|
|
|
88
97
|
private readonly repository;
|
|
89
98
|
private readonly config;
|
|
90
99
|
constructor(repository: IAuditEventRepository, config: AuditServiceConfig);
|
|
91
|
-
trackCreate<T extends Record<string, unknown>>(entityType: string, eventId: string, entity: T, context: AuditContext): Promise<AuditEvent>;
|
|
92
|
-
trackUpdate<T extends Record<string, unknown>>(entityType: string, eventId: string, before: T, after: T, context: AuditContext, compareOptions?: CompareOptions): Promise<AuditEvent | null>;
|
|
100
|
+
trackCreate<T extends Record<string, unknown>>(entityType: string, eventId: string, entity: T, context: AuditContext, enrichers?: Map<EnrichmentField, FieldEnricherFn>): Promise<AuditEvent>;
|
|
101
|
+
trackUpdate<T extends Record<string, unknown>>(entityType: string, eventId: string, before: T, after: T, context: AuditContext, compareOptions?: CompareOptions, enrichers?: Map<EnrichmentField, FieldEnricherFn>): Promise<AuditEvent | null>;
|
|
93
102
|
trackDelete<T extends Record<string, unknown>>(entityType: string, eventId: string, entity: T, context: AuditContext): Promise<AuditEvent>;
|
|
94
103
|
track(action: AuditAction, entityType: string, eventId: string, changeSet: AuditChangeSet, context: AuditContext): Promise<AuditEvent>;
|
|
104
|
+
private applyEnrichers;
|
|
95
105
|
}
|
|
96
106
|
|
|
97
107
|
declare class MongoConfig {
|
|
@@ -127,6 +137,38 @@ declare class MongoAuditEventRepository implements IAuditEventRepository {
|
|
|
127
137
|
disconnect(): Promise<void>;
|
|
128
138
|
}
|
|
129
139
|
|
|
140
|
+
declare class PostgresConfig {
|
|
141
|
+
config: {
|
|
142
|
+
user: string;
|
|
143
|
+
host: string;
|
|
144
|
+
database: string;
|
|
145
|
+
password: string;
|
|
146
|
+
port: number;
|
|
147
|
+
ssl?: {
|
|
148
|
+
rejectUnauthorized: boolean;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
constructor(config: {
|
|
152
|
+
user: string;
|
|
153
|
+
host: string;
|
|
154
|
+
database: string;
|
|
155
|
+
password: string;
|
|
156
|
+
port: number;
|
|
157
|
+
ssl?: {
|
|
158
|
+
rejectUnauthorized: boolean;
|
|
159
|
+
};
|
|
160
|
+
});
|
|
161
|
+
getConnection(): ClientConfig;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
declare class AccountServicePostgresRepository {
|
|
165
|
+
private readonly pool;
|
|
166
|
+
constructor(config: PostgresConfig);
|
|
167
|
+
getReferentialAccountPlanAlias(id: string): Promise<string | null>;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
declare function createReferentialAccountPlanEnricher(config: PostgresConfig, fieldName?: EnrichmentField): FieldEnricherFn;
|
|
171
|
+
|
|
130
172
|
interface Cloneable {
|
|
131
173
|
clone(): this;
|
|
132
174
|
}
|
|
@@ -678,7 +720,8 @@ declare enum MunicipalObligationIdEnum {
|
|
|
678
720
|
RIO_DE_JANEIRO = "RIO_DE_JANEIRO",
|
|
679
721
|
RECIFE = "RECIFE",
|
|
680
722
|
SAO_BERNARDO_DO_CAMPO = "SAO_BERNARDO_DO_CAMPO",
|
|
681
|
-
FLORIANOPOLIS = "FLORIANOPOLIS"
|
|
723
|
+
FLORIANOPOLIS = "FLORIANOPOLIS",
|
|
724
|
+
CAMPOS_DOS_GOYTACAZES_RJ = "CAMPOS_DOS_GOYTACAZES_RJ"
|
|
682
725
|
}
|
|
683
726
|
|
|
684
727
|
declare enum MunicipalObligationNameEnum {
|
|
@@ -2589,30 +2632,6 @@ type MongoRetainedTaxFilter = MongoBaseFilter & {
|
|
|
2589
2632
|
declare function buildMongoFilter(filters: FiltersDocument): MongoBaseFilter;
|
|
2590
2633
|
declare function buildMongoFilterToRetainedTax(filters: FiltersDocument): MongoRetainedTaxFilter;
|
|
2591
2634
|
|
|
2592
|
-
declare class PostgresConfig {
|
|
2593
|
-
config: {
|
|
2594
|
-
user: string;
|
|
2595
|
-
host: string;
|
|
2596
|
-
database: string;
|
|
2597
|
-
password: string;
|
|
2598
|
-
port: number;
|
|
2599
|
-
ssl?: {
|
|
2600
|
-
rejectUnauthorized: boolean;
|
|
2601
|
-
};
|
|
2602
|
-
};
|
|
2603
|
-
constructor(config: {
|
|
2604
|
-
user: string;
|
|
2605
|
-
host: string;
|
|
2606
|
-
database: string;
|
|
2607
|
-
password: string;
|
|
2608
|
-
port: number;
|
|
2609
|
-
ssl?: {
|
|
2610
|
-
rejectUnauthorized: boolean;
|
|
2611
|
-
};
|
|
2612
|
-
});
|
|
2613
|
-
getConnection(): ClientConfig;
|
|
2614
|
-
}
|
|
2615
|
-
|
|
2616
2635
|
declare class MongoRepository implements DocumentRepository {
|
|
2617
2636
|
private readonly _client;
|
|
2618
2637
|
private _isConnected;
|
|
@@ -4739,11 +4758,25 @@ interface RegisterPersist {
|
|
|
4739
4758
|
getByKey(registerKey: string): RegisterDefinition | undefined;
|
|
4740
4759
|
}
|
|
4741
4760
|
|
|
4761
|
+
declare abstract class RegisterSorter {
|
|
4762
|
+
abstract sort(registers: RegisterDefinition[]): RegisterDefinition[];
|
|
4763
|
+
}
|
|
4764
|
+
declare class AlphabeticalRegisterSorter extends RegisterSorter {
|
|
4765
|
+
static createInstance(): AlphabeticalRegisterSorter;
|
|
4766
|
+
sort(registers: RegisterDefinition[]): RegisterDefinition[];
|
|
4767
|
+
}
|
|
4768
|
+
declare class InsertionOrderRegisterSorter extends RegisterSorter {
|
|
4769
|
+
static createInstance(): InsertionOrderRegisterSorter;
|
|
4770
|
+
sort(registers: RegisterDefinition[]): RegisterDefinition[];
|
|
4771
|
+
}
|
|
4772
|
+
declare const alphabeticalByReg: AlphabeticalRegisterSorter;
|
|
4773
|
+
declare const insertionOrder: InsertionOrderRegisterSorter;
|
|
4742
4774
|
declare abstract class Block implements RegisterEventNotifier, RegisterSubscriber {
|
|
4743
4775
|
private readonly _name;
|
|
4744
4776
|
private eventEmitter;
|
|
4745
4777
|
protected registersPersist: RegisterPersist;
|
|
4746
|
-
protected
|
|
4778
|
+
protected sortStrategy: RegisterSorter;
|
|
4779
|
+
protected constructor(name: string, regPersist: RegisterPersist, sortStrategy?: RegisterSorter);
|
|
4747
4780
|
abstract eventHandler(eventData: RegisterEventData): void;
|
|
4748
4781
|
notifyEvent(eventData: RegisterEventData): void;
|
|
4749
4782
|
get name(): string;
|
|
@@ -4796,6 +4829,10 @@ interface RegisterGenerator {
|
|
|
4796
4829
|
generate(register: RegisterDefinition): void;
|
|
4797
4830
|
save(): void;
|
|
4798
4831
|
}
|
|
4832
|
+
interface NestedRegisterGenerator extends RegisterGenerator {
|
|
4833
|
+
beginRegister(register: RegisterDefinition): void;
|
|
4834
|
+
endRegister(register: RegisterDefinition): void;
|
|
4835
|
+
}
|
|
4799
4836
|
|
|
4800
4837
|
interface ReportGenerationOptions {
|
|
4801
4838
|
openSuffix: string;
|
|
@@ -4893,15 +4930,26 @@ declare class StringArrayOutput implements OutputWriter {
|
|
|
4893
4930
|
get Output(): string[];
|
|
4894
4931
|
}
|
|
4895
4932
|
|
|
4933
|
+
type FieldOrder = 'legacy' | 'declaration';
|
|
4934
|
+
declare class FieldKeyResolver {
|
|
4935
|
+
private readonly mode;
|
|
4936
|
+
private constructor();
|
|
4937
|
+
static newWithOptions(mode?: FieldOrder): FieldKeyResolver;
|
|
4938
|
+
resolve(register: object): string[];
|
|
4939
|
+
}
|
|
4940
|
+
|
|
4896
4941
|
interface TaxRegisterGenerationOptions {
|
|
4897
4942
|
writer: OutputWriter;
|
|
4898
4943
|
fieldSeparator: string;
|
|
4899
4944
|
separatorAtTheRegisterStart: boolean;
|
|
4900
4945
|
separatorAtTheRegisterEnd: boolean;
|
|
4901
4946
|
writeRegisterTag: boolean;
|
|
4947
|
+
fieldOrder?: FieldOrder;
|
|
4902
4948
|
}
|
|
4903
4949
|
declare class TaxRegisterGenerator implements RegisterGenerator {
|
|
4904
4950
|
protected _options: TaxRegisterGenerationOptions;
|
|
4951
|
+
private readonly fieldKeyResolver;
|
|
4952
|
+
private readonly fieldFormatter;
|
|
4905
4953
|
private constructor();
|
|
4906
4954
|
save(): void;
|
|
4907
4955
|
static defaultOptions(writer?: OutputWriter): TaxRegisterGenerationOptions;
|
|
@@ -4913,6 +4961,126 @@ declare class TaxRegisterGenerator implements RegisterGenerator {
|
|
|
4913
4961
|
private numericValue;
|
|
4914
4962
|
}
|
|
4915
4963
|
|
|
4964
|
+
interface FormatValueContext {
|
|
4965
|
+
omitZeroWhenOptional: boolean;
|
|
4966
|
+
stripLeadingZeros: boolean;
|
|
4967
|
+
fieldSeparator?: string;
|
|
4968
|
+
}
|
|
4969
|
+
declare class FieldFormatter {
|
|
4970
|
+
private readonly ctx;
|
|
4971
|
+
private constructor();
|
|
4972
|
+
static newWithOptions(ctx: FormatValueContext): FieldFormatter;
|
|
4973
|
+
alphanumericValue(metadata: FieldFormat, value: unknown): string;
|
|
4974
|
+
numericValue(metadata: FieldFormat, value: unknown, stripLeadingZeros?: boolean): string;
|
|
4975
|
+
}
|
|
4976
|
+
|
|
4977
|
+
declare const XML_CHILD_DATA_TYPE: "child";
|
|
4978
|
+
type XmlFieldKind = 'element' | 'attribute' | 'child';
|
|
4979
|
+
type XmlDateFormat = 'date' | 'dateTime';
|
|
4980
|
+
interface XmlFieldMeta {
|
|
4981
|
+
name: string;
|
|
4982
|
+
kind: XmlFieldKind;
|
|
4983
|
+
emitEmpty?: boolean;
|
|
4984
|
+
stripLeadingZeros?: boolean;
|
|
4985
|
+
dateFormat?: XmlDateFormat;
|
|
4986
|
+
}
|
|
4987
|
+
interface XmlTypeMeta {
|
|
4988
|
+
name: string;
|
|
4989
|
+
prefix?: string;
|
|
4990
|
+
}
|
|
4991
|
+
interface XmlNamespaces {
|
|
4992
|
+
default?: string;
|
|
4993
|
+
[prefix: string]: string | undefined;
|
|
4994
|
+
}
|
|
4995
|
+
interface StrictError {
|
|
4996
|
+
register: string;
|
|
4997
|
+
field: string;
|
|
4998
|
+
reason: string;
|
|
4999
|
+
}
|
|
5000
|
+
interface XmlReportGenerationOptions {
|
|
5001
|
+
writer: OutputWriter;
|
|
5002
|
+
rootElement: string;
|
|
5003
|
+
xmlDeclaration?: boolean;
|
|
5004
|
+
encoding?: string;
|
|
5005
|
+
namespaces?: XmlNamespaces;
|
|
5006
|
+
fieldOrder?: FieldOrder;
|
|
5007
|
+
indent?: string | false;
|
|
5008
|
+
strict?: boolean;
|
|
5009
|
+
}
|
|
5010
|
+
interface ResolvedXmlOptions {
|
|
5011
|
+
writer: OutputWriter;
|
|
5012
|
+
rootElement: string;
|
|
5013
|
+
xmlDeclaration: boolean;
|
|
5014
|
+
encoding: string;
|
|
5015
|
+
namespaces: XmlNamespaces;
|
|
5016
|
+
fieldOrder: FieldOrder;
|
|
5017
|
+
indent: string | false;
|
|
5018
|
+
strict: boolean;
|
|
5019
|
+
}
|
|
5020
|
+
interface XmlGenerationResult {
|
|
5021
|
+
xml: string;
|
|
5022
|
+
strictErrors: StrictError[];
|
|
5023
|
+
}
|
|
5024
|
+
|
|
5025
|
+
declare function XmlElement(name: string, opts?: Partial<XmlFieldMeta>): PropertyDecorator;
|
|
5026
|
+
declare function XmlAttribute(name: string): PropertyDecorator;
|
|
5027
|
+
declare function XmlChild(): PropertyDecorator;
|
|
5028
|
+
declare function XmlComplexType(name: string, opts?: {
|
|
5029
|
+
prefix?: string;
|
|
5030
|
+
}): ClassDecorator;
|
|
5031
|
+
declare function XmlDate(): PropertyDecorator;
|
|
5032
|
+
declare function XmlDateTime(): PropertyDecorator;
|
|
5033
|
+
declare class XmlMetadata {
|
|
5034
|
+
static getType(register: object): XmlTypeMeta | undefined;
|
|
5035
|
+
static getField(register: object, prop: string): XmlFieldMeta | undefined;
|
|
5036
|
+
}
|
|
5037
|
+
|
|
5038
|
+
declare class XmlFieldFormatter {
|
|
5039
|
+
private readonly numericFormatter;
|
|
5040
|
+
private constructor();
|
|
5041
|
+
static newWithDefaultOptions(): XmlFieldFormatter;
|
|
5042
|
+
escape(value: string): string;
|
|
5043
|
+
isMissing(value: unknown): boolean;
|
|
5044
|
+
format(fmt: FieldFormat, xml: XmlFieldMeta, value: unknown, strictErrors: StrictError[] | undefined, registerName: string, field: string): string | undefined;
|
|
5045
|
+
private formatDate;
|
|
5046
|
+
private pad2;
|
|
5047
|
+
}
|
|
5048
|
+
|
|
5049
|
+
declare class XmlStrictError extends Error {
|
|
5050
|
+
readonly strictErrors: StrictError[];
|
|
5051
|
+
readonly xml: string;
|
|
5052
|
+
constructor(strictErrors: StrictError[], xml: string);
|
|
5053
|
+
}
|
|
5054
|
+
|
|
5055
|
+
declare class XmlRegisterGenerator implements NestedRegisterGenerator {
|
|
5056
|
+
private readonly opts;
|
|
5057
|
+
private readonly writer;
|
|
5058
|
+
readonly strictErrors: StrictError[];
|
|
5059
|
+
private readonly chunks;
|
|
5060
|
+
private readonly fieldKeyResolver;
|
|
5061
|
+
private readonly fieldFormatter;
|
|
5062
|
+
constructor(opts: ResolvedXmlOptions, writer: OutputWriter);
|
|
5063
|
+
get output(): string;
|
|
5064
|
+
generate(register: RegisterDefinition): void;
|
|
5065
|
+
save(): void;
|
|
5066
|
+
beginRegister(register: RegisterDefinition): void;
|
|
5067
|
+
endRegister(_register: RegisterDefinition): void;
|
|
5068
|
+
append(chunk: string): void;
|
|
5069
|
+
serializeRegister(register: RegisterDefinition, depth: number, inheritedPrefix?: string): void;
|
|
5070
|
+
private nl;
|
|
5071
|
+
private qualify;
|
|
5072
|
+
}
|
|
5073
|
+
|
|
5074
|
+
declare class XmlReportGenerator {
|
|
5075
|
+
private readonly opts;
|
|
5076
|
+
private constructor();
|
|
5077
|
+
static newWithOptions(opts: XmlReportGenerationOptions): XmlReportGenerator;
|
|
5078
|
+
get writer(): OutputWriter;
|
|
5079
|
+
generateFile(taxReport: TaxReport): XmlGenerationResult;
|
|
5080
|
+
private static resolveOptions;
|
|
5081
|
+
private namespaceDeclarations;
|
|
5082
|
+
}
|
|
5083
|
+
|
|
4916
5084
|
declare const MessageCode: {
|
|
4917
5085
|
AUTH: {
|
|
4918
5086
|
UNAUTHORIZED: string;
|
|
@@ -5076,4 +5244,4 @@ declare class Calendar {
|
|
|
5076
5244
|
|
|
5077
5245
|
declare const BRAZIL_HOLIDAYS: HolidayDefinition[];
|
|
5078
5246
|
|
|
5079
|
-
export { AccountingDocument, ActionTypeEnum, Addition, Address, type AllowedCfopsCreditConfig, Alphanumeric, type AuditAction, type AuditActorType, type AuditChangeSet, type AuditChangeSetType, type AuditContext, type AuditEvent, AuditEventBuilder, AuditEventService, type AuditFieldChange, type AuditServiceConfig, type AuditSourceType, type AuditTaxCollectionDetails, type AuditTaxCollectionInfo, type AuthTokenExpiredParams, type AuthUnauthorizedParams, BRAZIL_HOLIDAYS, Block, BuilderAccountingDocument, BuilderAddition, BuilderAddress, BuilderConversionFactor, BuilderDocument, BuilderImportDeclaration, BuilderItem, BuilderPerson, BuilderTax, CNPJ, CNPJ_FLEXIBLE_REGEX, CNPJ_MASKED_REGEX, CNPJ_RAW_REGEX, CPF, CPF_FLEXIBLE_REGEX, CPF_MASKED_REGEX, CPF_RAW_REGEX, CST, CalculationBasisNatureSetting, Calendar, type Cloneable, CloseBlock, CloseFile, CodIncTrib, type Cod_ent_ref, CodeStatusEnum, type CompareOptions, type CompareResult, ConfigTypeEnum, ConsoleOutput, Contact, ContactTypesEnum, ConversionFactor, CounterBlock, CounterRegister, Country, CountryCodeEnum, CprbOption, CreditBalanceOriginCreditTypeEnum, CreditBalanceRegimeTypeEnum, CteTypeEnum, DEFAULT_LOCALE, type DatabaseConnectionFailedParams, type DatabaseQueryErrorParams, DayOfWeek, Decimal, DefaultAlphanumericLength, DefaultDecimalLength, DefaultDecimalSeparator, DescriptionStatusEnum, DifalIcmsCategoryEnum, Document, type DocumentRepository, DocumentTypeEnum, DonationIndicatorEnum, DueDateAdjustmentEnum, EasterCalculator, EcdSpecializedProfile, EcfSpecializedProfile, EfdContribSpecializedProfile, EfdIcmsIpiSpecializedProfile, Email, EnforceabilityOfISSEnum, Establishment, EstablishmentEvent, Event, EventEnum, FederalCollectionSettings, FieldDataType, type FieldFormat, type FiltersDocument, FiscalQualificationType, FreightContractedNatureIndicatorEnum, FreightTypeCodeEnum, FreightTypeEnum, type GetAuditTaxCollectionQuery, GrossRevenueContributionHeaders, type HolidayDefinition, type HolidayLocation, type HolidayScope, type IAccountingDocumentMongo, type IAddition, type IAddressMongo, type IAuditEventRepository, type IBaseHeadersDTO, type ICalculationBasisNatureSetting, type ICollectionSettings, type IConversionFactor, type IDocumentMongo, type IEcdSpecializedProfile, type IEcfSpecializedProfile, type IEfdContribSpecializedProfile, type IEfdicmsipiAdditionalFields, type IEstablishment, type IEstablishmentEvent, type IGrossRevenueContributionHeader, type IIcmsAdjustmentExtraInfo, type IIcmsAdjustmentSetting, type IIcmsCreditBaseConfig, type IIcmsCreditConfigLog, type IImportDeclaration, type IItemMongo, type IJudicialProcess, type INatureConfig, type INatureOfIncomeBusinessPartner, type IPersonMongo, type IProfile, type IProfileRepository, type IProfileServiceUrls, type IReinfAdditionalFields, type IRevenueNatureSettings, type IScp, type ISignatory, type IStartingCreditBalance, type IStateCollectionSettingsRepository, type ITable9, type ITaxMongo, type ITaxTypeConfig, type ITaxTypeConfigBase, type ITaxTypeConfigCreateOrUpdate, type ITaxTypeConfigLog, IcmsAdjustmentGroupEnum, IcmsAdjustmentRegistryEnum, IcmsAdjustmentSetting, IcmsAdjustmentTaxTypeEnum, IcmsAdjustmentTypeEnum, IcmsCalculationIndicatorEnum, type IdentificationNumber, ImportDeclaration, IntermediationTypeEnum, type InternalServerErrorParams, InternationalTransportTypeEnum, IssuerIndicatorEnum, Item, ItemTypeEnum, JudicialProcessOriginEnum, Key, type KeyComposition, type KeyFieldDefinition, LayoutDateFormat, type Locale, MaximumNumericLength, MemoryMasterDataRepository, MemoryPersist, MessageCategory, MessageCode, type MessageCodeType, Messages, ModelConverter, ModelRollback, MongoAuditEventRepository, MongoConfig, MongoRepository, MongoToDocumentBuilder, MunicipalObligation, MunicipalObligationIdEnum, MunicipalObligationNameEnum, MunicipalObligationTypeEnum, MunicipalRegistration, Municipality, NameCountryEnum, NatureCode, NatureConfig, Numeric, ObjectComparator, ObligationCodeEnum, OnDuplication, OnDuplicationStrategy, OpenBlock, OperationTypeEnum, OurDate, type OutputWriter, type ParameterTypes, PaymentTypeEnum, PeriodDateFieldEnum, Person, type PisCofinsOptions, PostgresConfig, PostgresRepository, ProductOriginEnum, Profile, ProfileDbRepository, ProfileRestRepository, ProfileTaxTypeEnum, Register, type RegisterDefinition, type RegisterEventData, type RegisterEventNotifier, type RegisterGenerator, type RegisterPersist, type RegisterSubscriber, ReinfSpecializedProfile, type ReportGenerationOptions, ReportGenerator, type Repository, type ResolvedHoliday, RevenueNatureSettings, RevenueTypeEnum, Scp, ServiceCode, ServiceCodeEnum, type SettingErrorParams, Signatory, SimpleNationalOption, type SimpleReportGenerationOptions, SimpleReportGenerator, StartingCreditBalance, StartingCreditBalanceTypeEnum, State, StateCollectionSettings, StateCollectionSettingsConfigTypeEnum, StateCollectionSettingsTaxTypeEnum, StateEnum, StateRegistration, StateRegistrationIndicatorEnum, StatusDocumentEnum, StringArrayOutput, TagCounter, Tax, type TaxCollectionDetails, TaxCollectionType, TaxCollectionTypeEnum, TaxRegimeEnum, type TaxRegimes, type TaxRegisterGenerationOptions, TaxRegisterGenerator, TaxReport, TaxTypeEnum, TaxationType, Telephone, Uf, type ValidationInvalidInputParams, type ValidationMissingFieldParams, ValueProviderType, WEEKDAYS, ZERO_PIS_COFINS_BY_CST, ZfmPresumedCreditTypeEnum, buildMongoFilter, buildMongoFilterToRetainedTax, calculate_bases_values, cleanData, formatMessage, isEmptyObject, keyCompositionMetadata, logWithContext, newRegisterEventData, normalizeServiceCode, onDuplicationStrategyMetadata, parseState, toSafeNumber, validationValue };
|
|
5247
|
+
export { AccountServicePostgresRepository, AccountingDocument, ActionTypeEnum, Addition, Address, type AllowedCfopsCreditConfig, AlphabeticalRegisterSorter, Alphanumeric, type AuditAction, type AuditActorType, type AuditChangeSet, type AuditChangeSetType, type AuditContext, type AuditEvent, AuditEventBuilder, AuditEventService, type AuditFieldChange, type AuditServiceConfig, type AuditSourceType, type AuditTaxCollectionDetails, type AuditTaxCollectionInfo, type AuthTokenExpiredParams, type AuthUnauthorizedParams, BRAZIL_HOLIDAYS, Block, BuilderAccountingDocument, BuilderAddition, BuilderAddress, BuilderConversionFactor, BuilderDocument, BuilderImportDeclaration, BuilderItem, BuilderPerson, BuilderTax, CNPJ, CNPJ_FLEXIBLE_REGEX, CNPJ_MASKED_REGEX, CNPJ_RAW_REGEX, CPF, CPF_FLEXIBLE_REGEX, CPF_MASKED_REGEX, CPF_RAW_REGEX, CST, CalculationBasisNatureSetting, Calendar, type Cloneable, CloseBlock, CloseFile, CodIncTrib, type Cod_ent_ref, CodeStatusEnum, type CompareOptions, type CompareResult, ConfigTypeEnum, ConsoleOutput, Contact, ContactTypesEnum, ConversionFactor, CounterBlock, CounterRegister, Country, CountryCodeEnum, CprbOption, CreditBalanceOriginCreditTypeEnum, CreditBalanceRegimeTypeEnum, CteTypeEnum, DEFAULT_LOCALE, type DatabaseConnectionFailedParams, type DatabaseQueryErrorParams, DayOfWeek, Decimal, DefaultAlphanumericLength, DefaultDecimalLength, DefaultDecimalSeparator, DescriptionStatusEnum, DifalIcmsCategoryEnum, Document, type DocumentRepository, DocumentTypeEnum, DonationIndicatorEnum, DueDateAdjustmentEnum, EasterCalculator, EcdSpecializedProfile, EcfSpecializedProfile, EfdContribSpecializedProfile, EfdIcmsIpiSpecializedProfile, Email, EnforceabilityOfISSEnum, EnrichmentField, Establishment, EstablishmentEvent, Event, EventEnum, FederalCollectionSettings, FieldDataType, type FieldEnricherFn, type FieldFormat, FieldFormatter, FieldKeyResolver, type FieldOrder, type FiltersDocument, FiscalQualificationType, type FormatValueContext, FreightContractedNatureIndicatorEnum, FreightTypeCodeEnum, FreightTypeEnum, type GetAuditTaxCollectionQuery, GrossRevenueContributionHeaders, type HolidayDefinition, type HolidayLocation, type HolidayScope, type IAccountingDocumentMongo, type IAddition, type IAddressMongo, type IAuditEventRepository, type IBaseHeadersDTO, type ICalculationBasisNatureSetting, type ICollectionSettings, type IConversionFactor, type IDocumentMongo, type IEcdSpecializedProfile, type IEcfSpecializedProfile, type IEfdContribSpecializedProfile, type IEfdicmsipiAdditionalFields, type IEstablishment, type IEstablishmentEvent, type IGrossRevenueContributionHeader, type IIcmsAdjustmentExtraInfo, type IIcmsAdjustmentSetting, type IIcmsCreditBaseConfig, type IIcmsCreditConfigLog, type IImportDeclaration, type IItemMongo, type IJudicialProcess, type INatureConfig, type INatureOfIncomeBusinessPartner, type IPersonMongo, type IProfile, type IProfileRepository, type IProfileServiceUrls, type IReinfAdditionalFields, type IRevenueNatureSettings, type IScp, type ISignatory, type IStartingCreditBalance, type IStateCollectionSettingsRepository, type ITable9, type ITaxMongo, type ITaxTypeConfig, type ITaxTypeConfigBase, type ITaxTypeConfigCreateOrUpdate, type ITaxTypeConfigLog, IcmsAdjustmentGroupEnum, IcmsAdjustmentRegistryEnum, IcmsAdjustmentSetting, IcmsAdjustmentTaxTypeEnum, IcmsAdjustmentTypeEnum, IcmsCalculationIndicatorEnum, type IdentificationNumber, ImportDeclaration, InsertionOrderRegisterSorter, IntermediationTypeEnum, type InternalServerErrorParams, InternationalTransportTypeEnum, IssuerIndicatorEnum, Item, ItemTypeEnum, JudicialProcessOriginEnum, Key, type KeyComposition, type KeyFieldDefinition, LayoutDateFormat, type Locale, MaximumNumericLength, MemoryMasterDataRepository, MemoryPersist, MessageCategory, MessageCode, type MessageCodeType, Messages, ModelConverter, ModelRollback, MongoAuditEventRepository, MongoConfig, MongoRepository, MongoToDocumentBuilder, MunicipalObligation, MunicipalObligationIdEnum, MunicipalObligationNameEnum, MunicipalObligationTypeEnum, MunicipalRegistration, Municipality, NameCountryEnum, NatureCode, NatureConfig, type NestedRegisterGenerator, Numeric, ObjectComparator, ObligationCodeEnum, OnDuplication, OnDuplicationStrategy, OpenBlock, OperationTypeEnum, OurDate, type OutputWriter, type ParameterTypes, PaymentTypeEnum, PeriodDateFieldEnum, Person, type PisCofinsOptions, PostgresConfig, PostgresRepository, ProductOriginEnum, Profile, ProfileDbRepository, ProfileRestRepository, ProfileTaxTypeEnum, Register, type RegisterDefinition, type RegisterEventData, type RegisterEventNotifier, type RegisterGenerator, type RegisterPersist, RegisterSorter, type RegisterSubscriber, ReinfSpecializedProfile, type ReportGenerationOptions, ReportGenerator, type Repository, type ResolvedHoliday, type ResolvedXmlOptions, RevenueNatureSettings, RevenueTypeEnum, Scp, ServiceCode, ServiceCodeEnum, type SettingErrorParams, Signatory, SimpleNationalOption, type SimpleReportGenerationOptions, SimpleReportGenerator, StartingCreditBalance, StartingCreditBalanceTypeEnum, State, StateCollectionSettings, StateCollectionSettingsConfigTypeEnum, StateCollectionSettingsTaxTypeEnum, StateEnum, StateRegistration, StateRegistrationIndicatorEnum, StatusDocumentEnum, type StrictError, StringArrayOutput, TagCounter, Tax, type TaxCollectionDetails, TaxCollectionType, TaxCollectionTypeEnum, TaxRegimeEnum, type TaxRegimes, type TaxRegisterGenerationOptions, TaxRegisterGenerator, TaxReport, TaxTypeEnum, TaxationType, Telephone, Uf, type ValidationInvalidInputParams, type ValidationMissingFieldParams, ValueProviderType, WEEKDAYS, XML_CHILD_DATA_TYPE, XmlAttribute, XmlChild, XmlComplexType, XmlDate, type XmlDateFormat, XmlDateTime, XmlElement, XmlFieldFormatter, type XmlFieldKind, type XmlFieldMeta, type XmlGenerationResult, XmlMetadata, type XmlNamespaces, XmlRegisterGenerator, type XmlReportGenerationOptions, XmlReportGenerator, XmlStrictError, type XmlTypeMeta, ZERO_PIS_COFINS_BY_CST, ZfmPresumedCreditTypeEnum, alphabeticalByReg, buildMongoFilter, buildMongoFilterToRetainedTax, calculate_bases_values, cleanData, createReferentialAccountPlanEnricher, formatMessage, insertionOrder, isEmptyObject, keyCompositionMetadata, logWithContext, newRegisterEventData, normalizeServiceCode, onDuplicationStrategyMetadata, parseState, toSafeNumber, validationValue };
|