@cbm-common/cbm-types 0.0.348 → 0.0.349
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/lib/components/accounting-seat/directives/drop-down-menu.directive.d.ts +13 -0
- package/lib/components/accounting-seat/directives/drop-down.directive.d.ts +10 -0
- package/lib/components/add-provider/add-provider.d.ts +3 -0
- package/lib/components/add-provider/constants.d.ts +5 -0
- package/lib/components/record-detail-metadata/components/options/options.d.ts +13 -0
- package/lib/components/record-detail-metadata/directives/drop-down-menu.directive.d.ts +13 -0
- package/lib/components/record-detail-metadata/directives/drop-down.directive.d.ts +9 -0
- package/lib/domain/models/sales-pending-document.domain.model.d.ts +91 -0
- package/lib/domain/repositories/sales-pending-document.domain.repository.d.ts +8 -0
- package/lib/domain/services/web-socket/ai-web-socket.model.d.ts +39 -0
- package/lib/domain/services/web-socket/ai-web-socket.service.d.ts +46 -0
- package/lib/environments/environment.d.ts +1 -0
- package/lib/environments/environment.development.d.ts +1 -0
- package/lib/infrastructure/repositories/blanket-agreement-category-service..infrastructure.repository.d.ts +7 -0
- package/lib/infrastructure/repositories/sales-pending-document.infrastructure.repository.d.ts +5 -0
- package/lib/infrastructure/services/sales-pending-document.infrastructure.service.d.ts +9 -0
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef, OnChanges, Renderer2, SimpleChanges } from '@angular/core';
|
|
2
|
+
export declare class DropdownMenuDirective implements OnChanges, AfterViewInit {
|
|
3
|
+
private element;
|
|
4
|
+
private renderer2;
|
|
5
|
+
hiddenMenu: import("@angular/core").InputSignal<boolean>;
|
|
6
|
+
hiddenMenuOp: import("@angular/core").WritableSignal<boolean>;
|
|
7
|
+
constructor(element: ElementRef, renderer2: Renderer2);
|
|
8
|
+
ngAfterViewInit(): void;
|
|
9
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
10
|
+
toggle(event: Event): void;
|
|
11
|
+
private toggleMenu;
|
|
12
|
+
initStyle(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef, Renderer2 } from '@angular/core';
|
|
2
|
+
export declare class DropdownDirective implements AfterViewInit {
|
|
3
|
+
private elementRef;
|
|
4
|
+
private renderer;
|
|
5
|
+
private isOpen;
|
|
6
|
+
constructor(elementRef: ElementRef, renderer: Renderer2);
|
|
7
|
+
ngAfterViewInit(): void;
|
|
8
|
+
toggleDropdown(event: MouseEvent): void;
|
|
9
|
+
closeDropdown(event: MouseEvent): void;
|
|
10
|
+
}
|
|
@@ -91,6 +91,8 @@ export declare class CbmAddProviderComponent {
|
|
|
91
91
|
isRelatedParty: FormControl<boolean>;
|
|
92
92
|
economicActivitySelector: FormControl<CbmEconomicActivitiesDomainModel.ListResponse.Data | null>;
|
|
93
93
|
}>;
|
|
94
|
+
subjectClass: import("@angular/core").Signal<CbmAddProviderModel.SubjectClass | null>;
|
|
95
|
+
filteredDocumentTypes: import("@angular/core").Signal<CbmDocumentTypeModel.ListResponse.Data[]>;
|
|
94
96
|
economicActivity$: PaginatedListService<CbmEconomicActivitiesDomainModel.ListResponse, CbmEconomicActivitiesDomainModel.ListParams, CbmEconomicActivitiesDomainModel.ListResponse.Data[]>;
|
|
95
97
|
ngOnInit(): void;
|
|
96
98
|
get documentTypeControl(): FormControl<CbmDocumentTypeModel.ListResponse.Data | null>;
|
|
@@ -113,6 +115,7 @@ export declare class CbmAddProviderComponent {
|
|
|
113
115
|
}, b: {
|
|
114
116
|
_id: string;
|
|
115
117
|
}): boolean;
|
|
118
|
+
private isDocumentTypeAllowed;
|
|
116
119
|
documentNumberValidator(): ValidatorFn;
|
|
117
120
|
asyncDocumentNumberValidator(): AsyncValidatorFn;
|
|
118
121
|
noWhitespaceValidator(): ValidatorFn;
|
|
@@ -6,4 +6,9 @@ export declare const DOCUMENT_TYPES_CODES: {
|
|
|
6
6
|
readonly VENTA_A_CONSUMIDOR_FINAL: "07";
|
|
7
7
|
readonly IDENTIFICACION_DEL_EXTERIOR: "08";
|
|
8
8
|
};
|
|
9
|
+
export declare const SUBJECT_CLASS_CODES: {
|
|
10
|
+
readonly PERSONA_NATURAL: "01";
|
|
11
|
+
readonly PERSONA_JURIDICA: "02";
|
|
12
|
+
};
|
|
9
13
|
export declare const SUBJECT_CLASSES: CbmAddProviderModel.SubjectClass[];
|
|
14
|
+
export declare const PERSONA_JURIDICA_DOCUMENT_TYPE_CODES: string[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { WritableSignal } from '@angular/core';
|
|
2
|
+
import { Router, ActivatedRoute, Params } from '@angular/router';
|
|
3
|
+
import { CbmRecordDetailMetadataModel } from "../../types";
|
|
4
|
+
export declare class OptionsComponent {
|
|
5
|
+
private router;
|
|
6
|
+
private route;
|
|
7
|
+
constructor(router: Router, route: ActivatedRoute);
|
|
8
|
+
metadata: import("@angular/core").InputSignal<CbmRecordDetailMetadataModel.metadata | null>;
|
|
9
|
+
options: import("@angular/core").InputSignal<CbmRecordDetailMetadataModel.options[] | undefined>;
|
|
10
|
+
optionInSignals: WritableSignal<WritableSignal<CbmRecordDetailMetadataModel.options>[]>;
|
|
11
|
+
executeFunction(option: WritableSignal<CbmRecordDetailMetadataModel.options>): void;
|
|
12
|
+
navigate(routerLink?: string, queryParams?: Params): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef, OnChanges, Renderer2, SimpleChanges } from '@angular/core';
|
|
2
|
+
export declare class DropdownMenuDirective implements OnChanges, AfterViewInit {
|
|
3
|
+
private element;
|
|
4
|
+
private renderer2;
|
|
5
|
+
hiddenMenu: import("@angular/core").InputSignal<boolean>;
|
|
6
|
+
hiddenMenuOp: import("@angular/core").WritableSignal<boolean>;
|
|
7
|
+
constructor(element: ElementRef, renderer2: Renderer2);
|
|
8
|
+
ngAfterViewInit(): void;
|
|
9
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
10
|
+
toggle(event: Event): void;
|
|
11
|
+
private toggleMenu;
|
|
12
|
+
initStyle(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ElementRef, Renderer2 } from '@angular/core';
|
|
2
|
+
export declare class DropdownDirective {
|
|
3
|
+
private elementRef;
|
|
4
|
+
private renderer;
|
|
5
|
+
private isOpen;
|
|
6
|
+
constructor(elementRef: ElementRef, renderer: Renderer2);
|
|
7
|
+
toggleDropdown(event: MouseEvent): void;
|
|
8
|
+
closeDropdown(event: MouseEvent): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
export declare namespace CbmSalesPendingDocumentModel {
|
|
2
|
+
type TTypeEstablishment = 'matrix' | 'branch';
|
|
3
|
+
export interface ListParams {
|
|
4
|
+
page: number;
|
|
5
|
+
size: number;
|
|
6
|
+
document_number?: string;
|
|
7
|
+
date_end?: number;
|
|
8
|
+
date_begin?: number;
|
|
9
|
+
client_id?: string;
|
|
10
|
+
client_branch_id?: string;
|
|
11
|
+
type?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ListResponse {
|
|
14
|
+
success: boolean;
|
|
15
|
+
pageNum: number;
|
|
16
|
+
pageSize: number;
|
|
17
|
+
pages: number;
|
|
18
|
+
total: number;
|
|
19
|
+
totales: ListResponse.totales;
|
|
20
|
+
items: ListResponse.Item[];
|
|
21
|
+
}
|
|
22
|
+
export namespace ListResponse {
|
|
23
|
+
interface Item {
|
|
24
|
+
_id: string;
|
|
25
|
+
created_at: number;
|
|
26
|
+
document_nomenclature: string;
|
|
27
|
+
document_emission_point_number: string;
|
|
28
|
+
document_sequence: string;
|
|
29
|
+
balance: number;
|
|
30
|
+
client_id: string;
|
|
31
|
+
client_payment_deadline?: number;
|
|
32
|
+
client_credit_limit?: number;
|
|
33
|
+
client_business_name: string;
|
|
34
|
+
client_trade_name: string;
|
|
35
|
+
client_document_number: string;
|
|
36
|
+
client_credit_application: boolean;
|
|
37
|
+
client_price_list_id: string;
|
|
38
|
+
client_price_list_code: string;
|
|
39
|
+
client_price_list_name: string;
|
|
40
|
+
client_document_type_id: string;
|
|
41
|
+
client_document_type_name: string;
|
|
42
|
+
client_document_type_code: string;
|
|
43
|
+
client_category_id: string;
|
|
44
|
+
client_category_name: string;
|
|
45
|
+
client_branch_id: string;
|
|
46
|
+
client_branch_code: string;
|
|
47
|
+
client_branch_name: string;
|
|
48
|
+
client_branch_address: string;
|
|
49
|
+
client_branch_email: string[];
|
|
50
|
+
client_branch_phone_code?: string;
|
|
51
|
+
client_branch_phone?: string;
|
|
52
|
+
client_branch_cellphone?: string;
|
|
53
|
+
client_branch_type_establishment: `${TTypeEstablishment}`;
|
|
54
|
+
client_branch_province_id?: string;
|
|
55
|
+
client_branch_province_code?: string;
|
|
56
|
+
client_branch_province_name?: string;
|
|
57
|
+
client_branch_canton_id?: string;
|
|
58
|
+
client_branch_canton_code?: string;
|
|
59
|
+
client_branch_canton_name?: string;
|
|
60
|
+
client_branch_parish_id?: string;
|
|
61
|
+
client_branch_parish_code?: string;
|
|
62
|
+
client_branch_parish_name?: string;
|
|
63
|
+
client_branch_longitude?: number;
|
|
64
|
+
client_branch_latitude?: number;
|
|
65
|
+
client_branch_seller_id: string;
|
|
66
|
+
client_branch_seller_identification_number: string;
|
|
67
|
+
client_branch_seller_full_name: string;
|
|
68
|
+
client_branch_seller_address: string;
|
|
69
|
+
client_branch_seller_email: string[];
|
|
70
|
+
client_branch_seller_cellphone: string;
|
|
71
|
+
client_branch_contact_id?: string;
|
|
72
|
+
client_branch_contact_identification_number?: string;
|
|
73
|
+
client_branch_contact_full_name?: string;
|
|
74
|
+
client_branch_contact_cellphone?: string;
|
|
75
|
+
client_branch_contact_email?: string[];
|
|
76
|
+
new_document_number: string;
|
|
77
|
+
date: number;
|
|
78
|
+
type: string;
|
|
79
|
+
checked?: boolean;
|
|
80
|
+
}
|
|
81
|
+
interface totales {
|
|
82
|
+
total_retention?: number;
|
|
83
|
+
total_down_payment?: number;
|
|
84
|
+
total_credit_note?: number;
|
|
85
|
+
total_initial_balance_retention?: number;
|
|
86
|
+
total_initial_balance_down_payment?: number;
|
|
87
|
+
total_initial_balance_credit_note?: number;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
export {};
|
|
91
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { CbmSalesPendingDocumentModel } from '../models/sales-pending-document.domain.model';
|
|
3
|
+
import { ICbmSalesPendingDocumentRepository } from '../../infrastructure/repositories/sales-pending-document.infrastructure.repository';
|
|
4
|
+
export declare class CbmSalesPendingDocumentRepository implements ICbmSalesPendingDocumentRepository {
|
|
5
|
+
private service;
|
|
6
|
+
constructor(service: ICbmSalesPendingDocumentRepository);
|
|
7
|
+
list(params: CbmSalesPendingDocumentModel.ListParams): Observable<CbmSalesPendingDocumentModel.ListResponse>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Contrato de `ai-web-socket` (namespace `/ai`): tiempo real del chat de IA. Ver cbm-backend/ai-web-socket/README.md. */
|
|
2
|
+
export declare namespace CbmAiWebSocketModel {
|
|
3
|
+
type RunStatus = 'running' | 'done' | 'error' | 'cancelled' | 'interrupted';
|
|
4
|
+
/** Evento numerado de una corrida; `event` es el JSON del SSE de ai-gateway (más `run-end`), sin interpretar. */
|
|
5
|
+
interface RunEnvelope {
|
|
6
|
+
seq: number;
|
|
7
|
+
/** Hora del servidor (epoch ms). */
|
|
8
|
+
at: number;
|
|
9
|
+
event: unknown;
|
|
10
|
+
}
|
|
11
|
+
/** `run:events`: eventos en vivo de una corrida vigilada. */
|
|
12
|
+
interface RunEvents {
|
|
13
|
+
runId: string;
|
|
14
|
+
events: RunEnvelope[];
|
|
15
|
+
}
|
|
16
|
+
/** Acuse de `run:watch`. `truncated`: hay más eventos; repetir con `afterSeq` = último `seq` recibido. */
|
|
17
|
+
type WatchAck = {
|
|
18
|
+
ok: true;
|
|
19
|
+
status: RunStatus;
|
|
20
|
+
lastSeq: number;
|
|
21
|
+
events: RunEnvelope[];
|
|
22
|
+
truncated: boolean;
|
|
23
|
+
} | {
|
|
24
|
+
ok: false;
|
|
25
|
+
error: string;
|
|
26
|
+
};
|
|
27
|
+
interface ActiveRun {
|
|
28
|
+
runId: string;
|
|
29
|
+
conversationId?: string;
|
|
30
|
+
status: RunStatus;
|
|
31
|
+
startedAt: number;
|
|
32
|
+
lastSeq: number;
|
|
33
|
+
}
|
|
34
|
+
/** Acuse de `runs:active`. */
|
|
35
|
+
interface ActiveRunsAck {
|
|
36
|
+
ok: boolean;
|
|
37
|
+
runs?: ActiveRun[];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ApplicationRef } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { CbmAuthReactiveService } from '../auth-reactive.domain.service';
|
|
4
|
+
import { CbmAiWebSocketModel } from './ai-web-socket.model';
|
|
5
|
+
/** `name` del error con que se rechazan los mensajes en espera cuando el socket se corta (se vuelve a pedir al reconectar). */
|
|
6
|
+
export declare const CBM_AI_SOCKET_DISCONNECTED = "AiSocketDisconnected";
|
|
7
|
+
/**
|
|
8
|
+
* Conexión con `ai-web-socket` (namespace `/ai`), el tiempo real del chat de IA: el backend ejecuta la respuesta en segundo plano
|
|
9
|
+
* (`POST /chat/runs` de ai-gateway) y los eventos llegan por aquí. Es otro servicio que `ws.cbmerp.com`, por eso tiene su propio
|
|
10
|
+
* `Socket` (se crea sin conectar; `connect()` abre la conexión). Solo transporte: orden, repetidos y reintentos de los eventos
|
|
11
|
+
* los resuelve quien lo consume con `seq`.
|
|
12
|
+
*
|
|
13
|
+
* Se autentica con el token global del ERP, leído en cada (re)conexión. Sin sesión el servidor rechaza con `connect_error`
|
|
14
|
+
* `unauthorized`; si la sesión se cierra llega `session:expired` y el servidor desconecta.
|
|
15
|
+
*/
|
|
16
|
+
export declare class CbmAiWebSocketService {
|
|
17
|
+
private readonly authReactive;
|
|
18
|
+
private readonly socket;
|
|
19
|
+
private readonly pending;
|
|
20
|
+
constructor(appRef: ApplicationRef, authReactive: CbmAuthReactiveService);
|
|
21
|
+
get connected(): boolean;
|
|
22
|
+
/** Abre la conexión (si ya está abierta o conectándose no hace nada). */
|
|
23
|
+
connect(): void;
|
|
24
|
+
/** Cierra la conexión y no reconecta. */
|
|
25
|
+
disconnect(): void;
|
|
26
|
+
onConnect(): Observable<void>;
|
|
27
|
+
/** Motivo del corte (`io server disconnect`: lo cerró el servidor y socket.io NO reconecta solo). */
|
|
28
|
+
onDisconnect(): Observable<string>;
|
|
29
|
+
/** Mensaje del fallo al conectar (`unauthorized` = sin sesión). Se repite en cada intento fallido de reconexión. */
|
|
30
|
+
onConnectError(): Observable<string>;
|
|
31
|
+
onSessionExpired(): Observable<void>;
|
|
32
|
+
/** Eventos en vivo de las corridas vigiladas (`run:events`). */
|
|
33
|
+
onRunEvents(): Observable<CbmAiWebSocketModel.RunEvents>;
|
|
34
|
+
/**
|
|
35
|
+
* Se une a una corrida y devuelve lo perdido desde `afterSeq` (0 = todo). Rechaza con `name === CBM_AI_SOCKET_DISCONNECTED` si el
|
|
36
|
+
* socket no está conectado o se corta mientras espera, y con otro error si el servidor no acusa a tiempo.
|
|
37
|
+
*/
|
|
38
|
+
watchRun(runId: string, afterSeq?: number): Promise<CbmAiWebSocketModel.WatchAck>;
|
|
39
|
+
/** Deja de recibir eventos de la corrida (no la cancela). */
|
|
40
|
+
unwatchRun(runId: string): void;
|
|
41
|
+
/** Corridas en curso del usuario (retomar al recargar o desde otra pestaña). */
|
|
42
|
+
activeRuns(): Promise<CbmAiWebSocketModel.ActiveRunsAck>;
|
|
43
|
+
private request;
|
|
44
|
+
private rejectPending;
|
|
45
|
+
private disconnectedError;
|
|
46
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import { CbmBlanketAgreementCategoryServiceModel } from "../../domain/models/blanket-agreement-category-service.domain.model";
|
|
3
|
+
export interface ICbmBlanketAgreementCategoryServiceRepository {
|
|
4
|
+
list(params: CbmBlanketAgreementCategoryServiceModel.ListParams): Observable<CbmBlanketAgreementCategoryServiceModel.ListResponse>;
|
|
5
|
+
save(data: CbmBlanketAgreementCategoryServiceModel.SaveBody): Observable<CbmBlanketAgreementCategoryServiceModel.ConfirmResponse>;
|
|
6
|
+
delete(id: string): Observable<CbmBlanketAgreementCategoryServiceModel.ConfirmResponse>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { CbmSalesPendingDocumentModel } from '../../domain/models/sales-pending-document.domain.model';
|
|
3
|
+
export interface ICbmSalesPendingDocumentRepository {
|
|
4
|
+
list(params: CbmSalesPendingDocumentModel.ListParams): Observable<CbmSalesPendingDocumentModel.ListResponse>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { CbmSalesPendingDocumentModel } from '../../domain/models/sales-pending-document.domain.model';
|
|
4
|
+
export declare class CbmSalesPendingDocumentService {
|
|
5
|
+
private http;
|
|
6
|
+
constructor(http: HttpClient);
|
|
7
|
+
private readonly url;
|
|
8
|
+
list(params: CbmSalesPendingDocumentModel.ListParams): Observable<CbmSalesPendingDocumentModel.ListResponse>;
|
|
9
|
+
}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export * from './lib/domain/services/notification/notification.service';
|
|
|
37
37
|
//#region web socket service
|
|
38
38
|
export * from './lib/domain/services/web-socket/web-socket.model';
|
|
39
39
|
export * from './lib/domain/services/web-socket/web-socket.service';
|
|
40
|
+
export * from './lib/domain/services/web-socket/ai-web-socket.model';
|
|
41
|
+
export * from './lib/domain/services/web-socket/ai-web-socket.service';
|
|
40
42
|
|
|
41
43
|
//#region user repository
|
|
42
44
|
export * from './lib/domain/repositories/user.domain.repository';
|