@nomalism-com/types 1.3.60 → 1.3.61

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/main.d.ts CHANGED
@@ -63,6 +63,7 @@ import * as Prison from "./modules/stock/prison/interface";
63
63
  import * as ProductGoogleSheets from "./modules/stock/productGoogleSheets/interface";
64
64
  import * as ProductImage from "./modules/stock/productImage/interface";
65
65
  import * as ProductLocation from "./modules/stock/productLocation/interface";
66
+ import * as ProductUpdate from "./modules/stock/productUpdate/interface";
66
67
  import * as Promotion from "./modules/stock/promotion/interface";
67
68
  import * as QueryList from "./modules/stock/queryList/interfaces";
68
69
  import * as QueryParameter from "./modules/stock/queryParameter/interfaces";
@@ -151,4 +152,4 @@ import * as stockErrors from "./shared/errors/stockErrors";
151
152
  import * as userErrors from "./shared/errors/userErrors";
152
153
  import * as viewErrors from "./shared/errors/viewErrors";
153
154
  import * as shared from "./shared/interface";
154
- export { AccountCode, Adiantamento, AdminPanel, AllowedDevice, BankData, BillOfLading, Catalogo, Channel, Chat, ChatRapidMessage, ChatSubscriber, Client, ClientType, CLT, Commissioner, ConferirEncomenda, Country, CurrentAccount, Dashboard, DeliveryMethods, DisplayLabel, DisplayLabels, DocumentHeader, DocumentHeaderHistory, DocumentHeaderSubscriber, DocumentHeaderSurvey, DocumentLine, DocumentLineAssoc, DocumentLineMt, DocumentLineNote, DocumentLineRm, documentManagementErrors, DocumentSet, DocumentType, EmailAccount, EmailLog, EmailTemplate, EmailTemplateAttachment, EmailVerification, ErrorLog, EuPago, ExternalDocumentHeader, ExternalDocumentType, FaturaCredito, FaturaRecibo, FaturaSimplificada, Favorites, File, Gmails, GoogleCalendar, GoogleFilePermission, GoogleSheetPool, GoogleSheets, integrationErrors, Inventario, Language, LLM, Location, MaterialEntrance, MaturityDates, MobilePrint, Multimedia, NotaCredito, NotaCreditoAdiantamento, Npc, NPF, NRCL, Observation, ObservationType, Order, OrderManagement, Password, PatchNotes, Payment, PaymentBatch, PaymentMethods, Persona, PersonaMerge, Portal, PreSale, PreSaleProduct, Printer, Prison, ProductGoogleSheets, ProductImage, ProductionOrder, ProductLocation, Proforma, ProjectInfo, Promotion, PropostaFornecedor, PropostaSheets, ProviderCreditNoteFromReturn, ProviderFinancialCreditNote, Providers, ProviderServiceInvoice, ProviderType, Purchase, PurchaseConditions, Quebra, QueryList, QueryParameter, ReasonForExemption, Recibo, RecurrentTasks, RefreshToken, ReturnReason, ReturnToProvider, Saft, SavedEmPicking, SavedProviderProposal, Schedule, SchedulePrintJob, SegmentsArea, Sessions, Settings, shared, Shippings, SideMenu, SidemenuHighlight, SmsSender, SmsTemplate, StartDocumentHeaderLastUpdate, stockErrors, StockMovement, StoreOperator, StoreOperatorSaftLock, Swift, SystemModule, Tag, Task, TaskMessage, Tenant, TenantSaftLock, Theme, Tickets, TicketsLanguage, TimeSheet, Transformado, TypeOfLocation, UnitOfMeasure, UpfrontReturn, userErrors, UserPositions, Users, UserTokens, VatTax, VatTaxZone, VatValidation, Vehicles, viewErrors, WebSocket, Workflow, };
155
+ export { AccountCode, Adiantamento, AdminPanel, AllowedDevice, BankData, BillOfLading, Catalogo, Channel, Chat, ChatRapidMessage, ChatSubscriber, Client, ClientType, CLT, Commissioner, ConferirEncomenda, Country, CurrentAccount, Dashboard, DeliveryMethods, DisplayLabel, DisplayLabels, DocumentHeader, DocumentHeaderHistory, DocumentHeaderSubscriber, DocumentHeaderSurvey, DocumentLine, DocumentLineAssoc, DocumentLineMt, DocumentLineNote, DocumentLineRm, documentManagementErrors, DocumentSet, DocumentType, EmailAccount, EmailLog, EmailTemplate, EmailTemplateAttachment, EmailVerification, ErrorLog, EuPago, ExternalDocumentHeader, ExternalDocumentType, FaturaCredito, FaturaRecibo, FaturaSimplificada, Favorites, File, Gmails, GoogleCalendar, GoogleFilePermission, GoogleSheetPool, GoogleSheets, integrationErrors, Inventario, Language, LLM, Location, MaterialEntrance, MaturityDates, MobilePrint, Multimedia, NotaCredito, NotaCreditoAdiantamento, Npc, NPF, NRCL, Observation, ObservationType, Order, OrderManagement, Password, PatchNotes, Payment, PaymentBatch, PaymentMethods, Persona, PersonaMerge, Portal, PreSale, PreSaleProduct, Printer, Prison, ProductGoogleSheets, ProductImage, ProductionOrder, ProductLocation, ProductUpdate, Proforma, ProjectInfo, Promotion, PropostaFornecedor, PropostaSheets, ProviderCreditNoteFromReturn, ProviderFinancialCreditNote, Providers, ProviderServiceInvoice, ProviderType, Purchase, PurchaseConditions, Quebra, QueryList, QueryParameter, ReasonForExemption, Recibo, RecurrentTasks, RefreshToken, ReturnReason, ReturnToProvider, Saft, SavedEmPicking, SavedProviderProposal, Schedule, SchedulePrintJob, SegmentsArea, Sessions, Settings, shared, Shippings, SideMenu, SidemenuHighlight, SmsSender, SmsTemplate, StartDocumentHeaderLastUpdate, stockErrors, StockMovement, StoreOperator, StoreOperatorSaftLock, Swift, SystemModule, Tag, Task, TaskMessage, Tenant, TenantSaftLock, Theme, Tickets, TicketsLanguage, TimeSheet, Transformado, TypeOfLocation, UnitOfMeasure, UpfrontReturn, userErrors, UserPositions, Users, UserTokens, VatTax, VatTaxZone, VatValidation, Vehicles, viewErrors, WebSocket, Workflow, };
@@ -4,11 +4,16 @@ export declare const Route = "display_labels";
4
4
  export interface ICreateRequest {
5
5
  references: string[];
6
6
  }
7
+ export interface IFindResponse extends Entity {
8
+ reference: string;
9
+ designation: string;
10
+ pvp: number | null;
11
+ }
7
12
  export interface IDeleteManyRequest {
8
13
  ids: string[];
9
14
  }
10
15
  export interface IRepository {
11
- find(): Promise<Entity[]>;
16
+ findMany(): Promise<IFindResponse[]>;
12
17
  create(data: ICreateRequest): Promise<void>;
13
18
  deleteMany(data: IDeleteManyRequest): Promise<void>;
14
19
  }
@@ -0,0 +1,214 @@
1
+ import * as IShared from "../../../shared/interface";
2
+ export declare const Route = "product_update";
3
+ export interface IExtractRequest {
4
+ multimedia_ids: string[];
5
+ }
6
+ export interface IExtractionResult {
7
+ source: string;
8
+ page_count: number;
9
+ tables: IExtractedTable[];
10
+ }
11
+ export interface IExtractedTable {
12
+ id: string;
13
+ pages: number[];
14
+ row_count: number;
15
+ columns: IExtractedColumn[];
16
+ rows: IExtractedRow[];
17
+ }
18
+ export interface IExtractedColumn {
19
+ id: string;
20
+ name: string;
21
+ samples: string[];
22
+ suggested_field: string | null;
23
+ }
24
+ export interface IExtractedRow {
25
+ _page: number;
26
+ _section: string | null;
27
+ _note?: string;
28
+ [columnId: string]: string | number | null | undefined;
29
+ }
30
+ export declare const ExtractErrorCodeEnum: {
31
+ NOT_A_PDF: "NOT_A_PDF";
32
+ INVALID_PDF: "INVALID_PDF";
33
+ FILE_NOT_FOUND: "FILE_NOT_FOUND";
34
+ TIMEOUT: "TIMEOUT";
35
+ EXTRACTION_FAILED: "EXTRACTION_FAILED";
36
+ };
37
+ export type IExtractErrorCode = (typeof ExtractErrorCodeEnum)[keyof typeof ExtractErrorCodeEnum];
38
+ export interface IExtractError {
39
+ code: IExtractErrorCode;
40
+ message: string;
41
+ }
42
+ interface IExtractFileResultBase {
43
+ multimedia_id: string;
44
+ file_name: string;
45
+ }
46
+ export type IExtractFileResult = (IExtractFileResultBase & {
47
+ status: "ok";
48
+ data: IExtractionResult;
49
+ }) | (IExtractFileResultBase & {
50
+ status: "error";
51
+ error: IExtractError;
52
+ });
53
+ export interface IExtractResponse {
54
+ results: IExtractFileResult[];
55
+ }
56
+ export declare const ImportTabEnum: {
57
+ PRODUTOS: "PRODUTOS";
58
+ NOVA_ENCOMENDA: "NOVA_ENCOMENDA";
59
+ };
60
+ export type IImportTab = (typeof ImportTabEnum)[keyof typeof ImportTabEnum];
61
+ export declare const ImportTabLabels: Record<IImportTab, string>;
62
+ export type IColumnKind = "text" | "price" | "number" | "length" | "weight";
63
+ export declare const MasterColumnKinds: Record<string, IColumnKind>;
64
+ export interface IMasterColumn {
65
+ key: string;
66
+ letter: string;
67
+ kind: IColumnKind;
68
+ locked: string | null;
69
+ }
70
+ export interface IColumnsRequest {
71
+ tab: IImportTab;
72
+ }
73
+ export interface IColumnsResponse {
74
+ tab: IImportTab;
75
+ columns: IMasterColumn[];
76
+ suggested_match_column: string | null;
77
+ }
78
+ export declare const LengthUnitEnum: {
79
+ m: "m";
80
+ cm: "cm";
81
+ mm: "mm";
82
+ };
83
+ export type ILengthUnit = (typeof LengthUnitEnum)[keyof typeof LengthUnitEnum];
84
+ export declare const WeightUnitEnum: {
85
+ kg: "kg";
86
+ g: "g";
87
+ };
88
+ export type IWeightUnit = (typeof WeightUnitEnum)[keyof typeof WeightUnitEnum];
89
+ export declare const RefMatchEnum: {
90
+ exact: "exact";
91
+ contains: "contains";
92
+ };
93
+ export type IRefMatch = (typeof RefMatchEnum)[keyof typeof RefMatchEnum];
94
+ export declare const RefMatchLabels: Record<IRefMatch, string>;
95
+ export type IAnalyzeRowValues = Record<string, string>;
96
+ export interface IAnalyzeRowInput {
97
+ page: number;
98
+ provider_ref: string;
99
+ values: IAnalyzeRowValues;
100
+ }
101
+ export interface IAnalyzeRequest {
102
+ id_provider: number;
103
+ tab: IImportTab;
104
+ match_column: string;
105
+ ref_match: IRefMatch;
106
+ length_unit: ILengthUnit;
107
+ weight_unit: IWeightUnit;
108
+ rows: IAnalyzeRowInput[];
109
+ }
110
+ export type IMasterValue = string | number | null;
111
+ export type IMasterValues = Record<string, IMasterValue>;
112
+ export interface IMasterRow {
113
+ key: string;
114
+ row_number: number;
115
+ reference: string;
116
+ match_value: string;
117
+ state: string | null;
118
+ values: IMasterValues;
119
+ }
120
+ export interface IAnalyzeUpdate extends IMasterRow {
121
+ provider_ref: string;
122
+ page: number;
123
+ new: IMasterValues;
124
+ changes: string[];
125
+ reactivate: boolean;
126
+ warnings: string[];
127
+ }
128
+ export interface IAnalyzeCreate {
129
+ provider_ref: string;
130
+ page: number;
131
+ values: IMasterValues;
132
+ warnings: string[];
133
+ }
134
+ export type IAnalyzeDeactivate = IMasterRow;
135
+ export interface IAnalyzeProblem {
136
+ page: number;
137
+ provider_ref: string | null;
138
+ message: string;
139
+ }
140
+ export interface IAnalyzeResponse {
141
+ tab: IImportTab;
142
+ columns: IMasterColumn[];
143
+ to_update: IAnalyzeUpdate[];
144
+ to_create: IAnalyzeCreate[];
145
+ to_deactivate: IAnalyzeDeactivate[];
146
+ problems: IAnalyzeProblem[];
147
+ unchanged_count: number;
148
+ provider_row_count: number;
149
+ without_match_value: IMasterRow[];
150
+ }
151
+ export interface IApplyRowItem {
152
+ key: string;
153
+ current: IMasterValues;
154
+ }
155
+ export interface IApplyUpdateRequest extends IAnalyzeRequest {
156
+ items: IApplyRowItem[];
157
+ }
158
+ export interface IApplyCreateRequest extends IAnalyzeRequest {
159
+ provider_refs: string[];
160
+ }
161
+ export interface IApplyDeactivateRequest extends IAnalyzeRequest {
162
+ items: IApplyRowItem[];
163
+ }
164
+ export declare const ApplyStatusEnum: {
165
+ applied: "applied";
166
+ conflict: "conflict";
167
+ not_found: "not_found";
168
+ };
169
+ export type IApplyStatus = (typeof ApplyStatusEnum)[keyof typeof ApplyStatusEnum];
170
+ export interface IApplyResult {
171
+ key: string;
172
+ status: IApplyStatus;
173
+ message: string | null;
174
+ }
175
+ export interface IApplyResponse {
176
+ applied: number;
177
+ results: IApplyResult[];
178
+ }
179
+ export type IApplyAction = "update" | "create" | "deactivate";
180
+ export declare const ApplyActionLabels: Record<IApplyAction, string>;
181
+ export interface IHistoryItem {
182
+ key: string;
183
+ row_number: number | null;
184
+ before: IMasterValues;
185
+ after: IMasterValues;
186
+ }
187
+ export interface IHistoryRequest {
188
+ id_provider?: number;
189
+ limit?: number;
190
+ }
191
+ export interface IHistoryEntry {
192
+ id: string;
193
+ created_at: Date;
194
+ user_id: string;
195
+ user_name: string | null;
196
+ id_provider: number;
197
+ tab: IImportTab;
198
+ action: IApplyAction;
199
+ items: IHistoryItem[];
200
+ }
201
+ export interface IHistoryResponse {
202
+ entries: IHistoryEntry[];
203
+ }
204
+ export interface IRepository {
205
+ extract(data: IExtractRequest): Promise<IExtractResponse>;
206
+ columns(data: IColumnsRequest): Promise<IColumnsResponse>;
207
+ analyze(data: IAnalyzeRequest): Promise<IAnalyzeResponse>;
208
+ applyUpdate(data: IApplyUpdateRequest): Promise<IApplyResponse>;
209
+ applyCreate(data: IApplyCreateRequest): Promise<IApplyResponse>;
210
+ applyDeactivate(data: IApplyDeactivateRequest): Promise<IApplyResponse>;
211
+ history(data: IHistoryRequest): Promise<IHistoryResponse>;
212
+ }
213
+ export type IController = IShared.IEntityWithUserToken<IRepository>;
214
+ export {};
@@ -32,12 +32,20 @@ export interface ICurrentAccountNotes {
32
32
  payment_method: string | null;
33
33
  notes: string | null;
34
34
  owner_name: string;
35
+ owner_id: string | null;
36
+ owner_href: string | null;
35
37
  created_at: string;
36
38
  created_by: string;
37
39
  updated_at: string;
38
40
  updated_by: string;
39
41
  }
42
+ export interface ICurrentAccountAffected {
43
+ document_header_id: string;
44
+ document_name: string;
45
+ href: string | null;
46
+ }
40
47
  export interface IFindCurrentAccountByOwnerIdResponse {
48
+ id: string;
41
49
  payment_date: string;
42
50
  emission_date: string;
43
51
  document_description: string;
@@ -49,6 +57,7 @@ export interface IFindCurrentAccountByOwnerIdResponse {
49
57
  balance: number;
50
58
  saldo_a_data: number;
51
59
  href?: string | null;
60
+ affected: ICurrentAccountAffected[];
52
61
  }
53
62
  export interface IUnpaidPurchasesRequest {
54
63
  provider_id: string;
@@ -26,6 +26,7 @@ export interface ICreateRequest extends ICreateForThisDocumentHeaderRequest {
26
26
  export interface IUnpaidPurchasesRequest {
27
27
  provider_id: string;
28
28
  client_id: string | null;
29
+ include_internal_regularization?: boolean;
29
30
  }
30
31
  export interface IUnpaidByDatePurchasesRequest {
31
32
  due_date: Date;
@@ -46,6 +47,7 @@ export interface IUnpaidPurchasesResponse extends Pick<Entity, "date" | "debit"
46
47
  };
47
48
  maturity_days: number;
48
49
  observations: IObservation.IFindByOwnerResponse[];
50
+ internal_regularization?: boolean;
49
51
  }
50
52
  export interface IRepository {
51
53
  findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
@@ -25,7 +25,9 @@ export interface IExportPaymentsRequest {
25
25
  export interface ICreateBulkPdfRequest {
26
26
  month?: number;
27
27
  year?: number;
28
+ /** ids separados por vírgula */
28
29
  ids?: string;
30
+ token: string;
29
31
  }
30
32
  export type IBatchType = "national" | "international" | "null";
31
33
  export interface IPaymentsBatchNpfDh {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nomalism-com/types",
3
3
  "description": "A nomalism package with all necessary types and validations for developing APIs",
4
- "version": "1.3.60",
4
+ "version": "1.3.61",
5
5
  "author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "devDependencies": {
27
27
  "@eslint/js": "^10.0.1",
28
- "@swc/core": "^1.16.13",
28
+ "@swc/core": "^1.16.18",
29
29
  "@types/node": "^26.6.5",
30
30
  "@typescript-eslint/eslint-plugin": "^8.62.0",
31
31
  "@typescript-eslint/parser": "^8.62.0",
@@ -58,7 +58,7 @@
58
58
  ]
59
59
  },
60
60
  "allowScripts": {
61
- "esbuild@0.27.7": true,
62
- "@swc/core@1.16.13": true
61
+ "esbuild": true,
62
+ "@swc/core": true
63
63
  }
64
64
  }