@nomalism-com/types
Advanced tools
| import type * as IShared from "../../../shared/interface"; | ||
| export declare const Route = "email_account"; | ||
| /** Latest sync audit summary attached to an account row. */ | ||
| export interface IEmailSyncAuditView { | ||
| started_at: Date; | ||
| finished_at: Date | null; | ||
| status: string; | ||
| messages_seen: number; | ||
| messages_inserted: number; | ||
| messages_skipped: number; | ||
| messages_errored: number; | ||
| error_message: string | null; | ||
| } | ||
| /** Secret-free view of an email account for the UI. */ | ||
| export interface IEmailAccountResponse { | ||
| id: string; | ||
| gmail_email: string; | ||
| imap_host: string; | ||
| imap_port: number; | ||
| imap_user: string; | ||
| active: boolean; | ||
| /** Whether the Gmail OAuth consent has been completed (token exists). */ | ||
| has_token: boolean; | ||
| uid_validity: string | null; | ||
| last_uid: number; | ||
| last_error: string | null; | ||
| created_at: Date; | ||
| updated_at: Date; | ||
| last_audit: IEmailSyncAuditView | null; | ||
| } | ||
| export interface ICreateRequest { | ||
| gmail_email: string; | ||
| imap_host: string; | ||
| imap_port: number; | ||
| imap_user: string; | ||
| imap_password: string; | ||
| } | ||
| export interface IUpdateRequest { | ||
| imap_host?: string; | ||
| imap_port?: number; | ||
| imap_user?: string; | ||
| imap_password?: string; | ||
| active?: boolean; | ||
| } | ||
| export interface ICreateResponse { | ||
| id: string; | ||
| } | ||
| export interface ISyncResultResponse { | ||
| auditId: string; | ||
| status: string; | ||
| errorMessage: string | null; | ||
| seen: number; | ||
| inserted: number; | ||
| skipped: number; | ||
| errored: number; | ||
| } | ||
| export interface IRepository { | ||
| find(): Promise<IEmailAccountResponse[]>; | ||
| findById(selector: IShared.IFindByIdRequest): Promise<IEmailAccountResponse>; | ||
| create(data: ICreateRequest): Promise<ICreateResponse>; | ||
| update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>; | ||
| deleteOne(selector: IShared.IFindByIdRequest): Promise<void>; | ||
| /** Returns the Gmail OAuth consent URL for the account's destination mailbox. */ | ||
| auth(selector: IShared.IFindByIdRequest): Promise<string>; | ||
| /** Triggers a sync for one account. */ | ||
| sync(selector: IShared.IFindByIdRequest): Promise<ISyncResultResponse>; | ||
| /** Triggers a sync for all active accounts. */ | ||
| syncAll(): Promise<ISyncResultResponse[]>; | ||
| } | ||
| export type IController = IShared.IEntityWithUserToken<IRepository>; |
| import joi from "joi"; | ||
| export declare const createBody: joi.ObjectSchema<any>; | ||
| export declare const updateBody: joi.ObjectSchema<any>; |
+3
-1
@@ -84,2 +84,4 @@ import * as BillOfLading from "./modules/document/billOfLading/interfaces"; | ||
| import * as DashboardRoutes from "./modules/stock/dashboard/route.schema"; | ||
| import * as EmailAccount from "./modules/stock/emailAccount/interface"; | ||
| import * as EmailAccountRoutes from "./modules/stock/emailAccount/route.schema"; | ||
| import * as File from "./modules/stock/file/interface"; | ||
@@ -262,2 +264,2 @@ import * as FileRoutes from "./modules/stock/file/route.schema"; | ||
| import * as shared from "./shared/interface"; | ||
| export { AccountCode, AccountCodeRoutes, AdminPanel, AllowedDevice, AllowedDeviceRoutes, BankData, BankDataRoutes, BillOfLading, BillOfLadingRoutes, Catalogo, CatalogoRoutes, Channel, ChannelRoutes, Chat, ChatRapidMessage, ChatRapidMessageRoutes, ChatRoutes, ChatSubscriber, ChatSubscriberRoutes, Client, ClientRoutes, ClientType, ClientTypeRoutes, CLT, CLTRoutes, Commissioner, CommissionerRoutes, ConferirEncomenda, Country, CountryRoutes, CurrentAccount, CurrentAccountRoutes, Dashboard, DashboardRoutes, DeliveryMethods, DeliveryMethodsRoutes, DocumentHeader, DocumentHeaderHistory, DocumentHeaderRoutes, DocumentHeaderSubscriber, DocumentHeaderSubscriberRoutes, DocumentHeaderSurvey, DocumentHeaderSurveyRoutes, DocumentLine, DocumentLineAssoc, DocumentLineMt, DocumentLineMtRoutes, DocumentLineNote, DocumentLineNoteRoutes, DocumentLineRm, DocumentLineRmRoutes, DocumentLineRoutes, documentManagementErrors, DocumentSet, DocumentSetRoutes, DocumentType, DocumentTypeRoutes, EmailLog, EmailLogRoutes, EmailTemplate, EmailTemplateAttachment, EmailTemplateAttachmentRoutes, EmailTemplateRoutes, EmailVerification, EmailVerificationRoutes, ErrorLog, ErrorLogRoutes, ExternalDocumentHeader, ExternalDocumentHeaderRoutes, ExternalDocumentType, Favorites, FavoritesRoutes, File, FileRoutes, Gmails, GoogleCalendar, GoogleCalendarRoutes, GoogleFilePermission, GoogleFilePermissionRoutes, GoogleSheetPool, GoogleSheets, GoogleSheetsRoutes, integrationErrors, Inventario, InventarioRoutes, Language, LanguageRoutes, LLM, LLMRoutes, Location, LocationRoutes, MaterialEntrance, MaterialEntranceRoutes, MaturityDates, MaturityDatesRoutes, MobilePrint, MobilePrintRoutes, Multimedia, MultimediaRoutes, Npc, NpcRoutes, NPF, NPFRoutes, NRCL, NRCLRoutes, Observation, ObservationRoutes, ObservationType, ObservationTypeRoutes, Order, OrderManagement, OrderRoutes, Password, PasswordRoutes, PatchNotes, Payment, PaymentBatch, PaymentBatchRoutes, PaymentMethods, PaymentMethodsRoutes, PaymentRoutes, Persona, PersonaRoutes, Portal, PortalRoutes, PreSale, PreSaleProduct, PreSaleProductRoutes, PreSaleRoutes, Printer, PrinterRoutes, Prison, PrisonRoutes, ProductGoogleSheets, ProductGoogleSheetsRoutes, ProductImage, ProductImageRoutes, ProductionOrder, ProductionOrderRoutes, ProductLocation, Proforma, ProformaRoutes, ProjectInfo, ProjectInfoRoutes, Promotion, PromotionAssoc, PromotionAssocRoutes, PromotionRoutes, PropostaFornecedor, PropostaFornecedorRoutes, PropostaSheets, PropostaSheetsRoutes, ProviderCreditNoteFromReturn, ProviderCreditNoteFromReturnRoutes, ProviderFinancialCreditNote, ProviderFinancialCreditNoteRoutes, Providers, ProviderServiceInvoice, ProviderServiceInvoiceRoutes, ProvidersRoutes, ProviderType, ProviderTypeRoutes, Purchase, PurchaseConditions, PurchaseConditionsRoutes, PurchaseRoutes, Quebra, QuebraRoutes, QueryList, QueryListRoutes, QueryParameter, QueryParameterRoutes, ReasonForExemption, ReasonForExemptionRoutes, RecurrentTasks, RefreshToken, RefreshTokenRoutes, ReturnReason, ReturnReasonRoutes, ReturnToProvider, ReturnToProviderRoutes, SavedEmPicking, SavedEmPickingRoutes, SavedProviderProposal, SavedProviderProposalRoutes, Schedule, SchedulePrintJob, SchedulePrintJobRoutes, ScheduleRoutes, SegmentsArea, SegmentsAreaRoutes, Sessions, SessionsRoutes, Settings, SettingsRoutes, shared, Shippings, ShippingsRoutes, SideMenu, SidemenuHighlight, SidemenuHighlightRoutes, SideMenuRoutes, SmsSender, SmsTemplate, SmsTemplateRoutes, StartDocumentHeaderLastUpdate, stockErrors, StockMovement, StockMovementRoutes, StoreOperator, StoreOperatorRoutes, Swift, SwiftRoutes, SystemModule, SystemModuleRoutes, Tag, TagRoutes, Task, TaskMessage, TaskMessageRoutes, TaskRead, TaskReadRoutes, TaskRoutes, Tenant, TenantRoutes, Theme, ThemeRoutes, Tickets, TicketsLanguage, TicketsLanguageRoutes, TicketsRoutes, TimeSheet, TimeSheetRoutes, Transformado, TransformadoRoutes, TypeOfLocation, TypeOfLocationRoutes, UnitOfMeasure, UnitOfMeasureRoutes, UpfrontReturn, UpfrontReturnRoutes, userErrors, UserPositions, UserPositionsRoutes, Users, UsersRoutes, UserTokens, UserTokensRoutes, VatTax, VatTaxRoutes, VatTaxZone, VatTaxZoneRoutes, VatValidation, VatValidationRoutes, Vehicles, VehiclesRoutes, viewErrors, WebSocket, Workflow, WorkflowRoutes, }; | ||
| export { AccountCode, AccountCodeRoutes, AdminPanel, AllowedDevice, AllowedDeviceRoutes, BankData, BankDataRoutes, BillOfLading, BillOfLadingRoutes, Catalogo, CatalogoRoutes, Channel, ChannelRoutes, Chat, ChatRapidMessage, ChatRapidMessageRoutes, ChatRoutes, ChatSubscriber, ChatSubscriberRoutes, Client, ClientRoutes, ClientType, ClientTypeRoutes, CLT, CLTRoutes, Commissioner, CommissionerRoutes, ConferirEncomenda, Country, CountryRoutes, CurrentAccount, CurrentAccountRoutes, Dashboard, DashboardRoutes, DeliveryMethods, DeliveryMethodsRoutes, DocumentHeader, DocumentHeaderHistory, DocumentHeaderRoutes, DocumentHeaderSubscriber, DocumentHeaderSubscriberRoutes, DocumentHeaderSurvey, DocumentHeaderSurveyRoutes, DocumentLine, DocumentLineAssoc, DocumentLineMt, DocumentLineMtRoutes, DocumentLineNote, DocumentLineNoteRoutes, DocumentLineRm, DocumentLineRmRoutes, DocumentLineRoutes, documentManagementErrors, DocumentSet, DocumentSetRoutes, DocumentType, DocumentTypeRoutes, EmailAccount, EmailAccountRoutes, EmailLog, EmailLogRoutes, EmailTemplate, EmailTemplateAttachment, EmailTemplateAttachmentRoutes, EmailTemplateRoutes, EmailVerification, EmailVerificationRoutes, ErrorLog, ErrorLogRoutes, ExternalDocumentHeader, ExternalDocumentHeaderRoutes, ExternalDocumentType, Favorites, FavoritesRoutes, File, FileRoutes, Gmails, GoogleCalendar, GoogleCalendarRoutes, GoogleFilePermission, GoogleFilePermissionRoutes, GoogleSheetPool, GoogleSheets, GoogleSheetsRoutes, integrationErrors, Inventario, InventarioRoutes, Language, LanguageRoutes, LLM, LLMRoutes, Location, LocationRoutes, MaterialEntrance, MaterialEntranceRoutes, MaturityDates, MaturityDatesRoutes, MobilePrint, MobilePrintRoutes, Multimedia, MultimediaRoutes, Npc, NpcRoutes, NPF, NPFRoutes, NRCL, NRCLRoutes, Observation, ObservationRoutes, ObservationType, ObservationTypeRoutes, Order, OrderManagement, OrderRoutes, Password, PasswordRoutes, PatchNotes, Payment, PaymentBatch, PaymentBatchRoutes, PaymentMethods, PaymentMethodsRoutes, PaymentRoutes, Persona, PersonaRoutes, Portal, PortalRoutes, PreSale, PreSaleProduct, PreSaleProductRoutes, PreSaleRoutes, Printer, PrinterRoutes, Prison, PrisonRoutes, ProductGoogleSheets, ProductGoogleSheetsRoutes, ProductImage, ProductImageRoutes, ProductionOrder, ProductionOrderRoutes, ProductLocation, Proforma, ProformaRoutes, ProjectInfo, ProjectInfoRoutes, Promotion, PromotionAssoc, PromotionAssocRoutes, PromotionRoutes, PropostaFornecedor, PropostaFornecedorRoutes, PropostaSheets, PropostaSheetsRoutes, ProviderCreditNoteFromReturn, ProviderCreditNoteFromReturnRoutes, ProviderFinancialCreditNote, ProviderFinancialCreditNoteRoutes, Providers, ProviderServiceInvoice, ProviderServiceInvoiceRoutes, ProvidersRoutes, ProviderType, ProviderTypeRoutes, Purchase, PurchaseConditions, PurchaseConditionsRoutes, PurchaseRoutes, Quebra, QuebraRoutes, QueryList, QueryListRoutes, QueryParameter, QueryParameterRoutes, ReasonForExemption, ReasonForExemptionRoutes, RecurrentTasks, RefreshToken, RefreshTokenRoutes, ReturnReason, ReturnReasonRoutes, ReturnToProvider, ReturnToProviderRoutes, SavedEmPicking, SavedEmPickingRoutes, SavedProviderProposal, SavedProviderProposalRoutes, Schedule, SchedulePrintJob, SchedulePrintJobRoutes, ScheduleRoutes, SegmentsArea, SegmentsAreaRoutes, Sessions, SessionsRoutes, Settings, SettingsRoutes, shared, Shippings, ShippingsRoutes, SideMenu, SidemenuHighlight, SidemenuHighlightRoutes, SideMenuRoutes, SmsSender, SmsTemplate, SmsTemplateRoutes, StartDocumentHeaderLastUpdate, stockErrors, StockMovement, StockMovementRoutes, StoreOperator, StoreOperatorRoutes, Swift, SwiftRoutes, SystemModule, SystemModuleRoutes, Tag, TagRoutes, Task, TaskMessage, TaskMessageRoutes, TaskRead, TaskReadRoutes, TaskRoutes, Tenant, TenantRoutes, Theme, ThemeRoutes, Tickets, TicketsLanguage, TicketsLanguageRoutes, TicketsRoutes, TimeSheet, TimeSheetRoutes, Transformado, TransformadoRoutes, TypeOfLocation, TypeOfLocationRoutes, UnitOfMeasure, UnitOfMeasureRoutes, UpfrontReturn, UpfrontReturnRoutes, userErrors, UserPositions, UserPositionsRoutes, Users, UsersRoutes, UserTokens, UserTokensRoutes, VatTax, VatTaxRoutes, VatTaxZone, VatTaxZoneRoutes, VatValidation, VatValidationRoutes, Vehicles, VehiclesRoutes, viewErrors, WebSocket, Workflow, WorkflowRoutes, }; |
@@ -26,6 +26,6 @@ import { DocumentLineNote } from "../../../shared/entities/stock"; | ||
| provider_tax_value: number; | ||
| client_tax_value: number; | ||
| global_discount: number; | ||
| preco_custo: number; | ||
| preco_venda: number; | ||
| client_unit_total: number; | ||
| margin: number | null; | ||
@@ -32,0 +32,0 @@ total_without_tax: number; |
@@ -33,4 +33,5 @@ import { SmsSender } from "../../../shared/entities/sms"; | ||
| status: string; | ||
| created_at: Date; | ||
| document_link?: string; | ||
| error?: string; | ||
| created_at: Date; | ||
| processed_at?: Date; | ||
@@ -37,0 +38,0 @@ sent_at?: Date; |
@@ -22,2 +22,3 @@ import * as IShared from "../../../shared/interface"; | ||
| chat_document_header_id: string; | ||
| document_header_id: string; | ||
| label: string; | ||
@@ -28,2 +29,8 @@ emission_date: Date; | ||
| tags: ITags[]; | ||
| document_name: string; | ||
| store_operator_name: string; | ||
| user_type: IDocumentTypeUserType; | ||
| document_total: number; | ||
| document_state: string; | ||
| other_personas: ChatSubscriber.IPersona[]; | ||
| created_by: string; | ||
@@ -34,3 +41,2 @@ closed: boolean; | ||
| owner_id: string; | ||
| document?: IPublicDocument; | ||
| persona?: ChatSubscriber.IPersona; | ||
@@ -37,0 +43,0 @@ chat: IChatBalloon[]; |
@@ -9,2 +9,3 @@ import { ISmsSenderStats } from "../../modules/sms/smsSender/interfaces"; | ||
| document_line_id: string | null; | ||
| document_header_id: string | null; | ||
| telephone: string; | ||
@@ -11,0 +12,0 @@ message: string; |
+7
-7
| { | ||
| "name": "@nomalism-com/types", | ||
| "description": "A nomalism package with all necessary types and validations for developing APIs", | ||
| "version": "1.3.46", | ||
| "version": "1.3.47", | ||
| "author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)", | ||
@@ -20,3 +20,3 @@ "license": "UNLICENSED", | ||
| "scripts": { | ||
| "lint": "eslint . --fix && prettier --write .", | ||
| "lint": "eslint . --fix && prettier --write . --log-level warn", | ||
| "prebuild": "rm -rf dist", | ||
@@ -33,3 +33,3 @@ "build": "tsc --emitDeclarationOnly && tsup", | ||
| "@eslint/js": "^10.0.1", | ||
| "@swc/core": "^1.15.43", | ||
| "@swc/core": "^1.15.46", | ||
| "@types/node": "^26.1.1", | ||
@@ -40,9 +40,9 @@ "@typescript-eslint/eslint-plugin": "^8.62.0", | ||
| "eslint-config-prettier": "^10.1.8", | ||
| "eslint-plugin-simple-import-sort": "^13.0.0", | ||
| "eslint-plugin-simple-import-sort": "^14.0.0", | ||
| "globals": "^17.7.0", | ||
| "husky": "^9.1.7", | ||
| "lint-staged": "^17.0.8", | ||
| "prettier": "^3.9.5", | ||
| "lint-staged": "^17.1.0", | ||
| "prettier": "^3.9.6", | ||
| "tsup": "^8.5.1", | ||
| "typescript-eslint": "^8.64.0" | ||
| "typescript-eslint": "^8.65.0" | ||
| }, | ||
@@ -49,0 +49,0 @@ "repository": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
821341
0.63%278
0.72%20895
0.69%