@in.pulse-crm/sdk 2.5.14 → 2.5.16
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/socket.client.js +5 -5
- package/dist/types/customers.types.d.ts +55 -55
- package/dist/wallets.client.d.ts +1 -1
- package/dist/wallets.client.js +2 -2
- package/package.json +1 -1
- package/src/socket.client.ts +6 -6
- package/src/types/customers.types.ts +55 -55
- package/src/wallets.client.ts +2 -2
package/dist/socket.client.js
CHANGED
|
@@ -51,12 +51,12 @@ class SocketClient {
|
|
|
51
51
|
* @returns A function that, when called, removes the event listener for the specified event.
|
|
52
52
|
*/
|
|
53
53
|
on = (event, callback) => {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
});
|
|
58
|
-
this.listeners.set(event, callback);
|
|
54
|
+
const oldListener = this.listeners.get(event);
|
|
55
|
+
if (oldListener) {
|
|
56
|
+
this.ws.off(event, oldListener);
|
|
59
57
|
}
|
|
58
|
+
this.ws.on(event, callback);
|
|
59
|
+
this.listeners.set(event, callback);
|
|
60
60
|
};
|
|
61
61
|
/**
|
|
62
62
|
* Removes a previously registered event listener from the WebSocket connection.
|
|
@@ -1,71 +1,71 @@
|
|
|
1
1
|
export interface Customer {
|
|
2
2
|
CODIGO: number;
|
|
3
3
|
RAZAO: string;
|
|
4
|
-
FANTASIA: string;
|
|
4
|
+
FANTASIA: string | null;
|
|
5
5
|
PESSOA: "FIS" | "JUR" | null;
|
|
6
6
|
ATIVO: "SIM" | "NAO" | null;
|
|
7
|
-
CPF_CNPJ: string;
|
|
8
|
-
IE_RG: string;
|
|
9
|
-
GRUPO: number;
|
|
10
|
-
END_RUA: string;
|
|
11
|
-
CIDADE: string;
|
|
12
|
-
BAIRRO: string;
|
|
13
|
-
ESTADO: string;
|
|
14
|
-
CEP: string;
|
|
15
|
-
COMPLEMENTO: string;
|
|
16
|
-
AREA1: number;
|
|
17
|
-
AREA2: number;
|
|
18
|
-
AREA3: number;
|
|
19
|
-
AREAFAX: number;
|
|
20
|
-
FONE1: string;
|
|
21
|
-
FONE2: string;
|
|
22
|
-
FONE3: string;
|
|
23
|
-
FAX: string;
|
|
24
|
-
DESC_FONE1: string;
|
|
25
|
-
DESC_FONE2: string;
|
|
26
|
-
DESC_FONE3: string;
|
|
27
|
-
DESCFAX: string;
|
|
28
|
-
EMAIL: string;
|
|
29
|
-
WEBSITE: string;
|
|
30
|
-
DATACAD:
|
|
31
|
-
STATUS_CAD: string;
|
|
32
|
-
OBS_ADMIN: string;
|
|
33
|
-
OBS_OPERADOR: string;
|
|
34
|
-
ORIGEM: number;
|
|
35
|
-
OPERADOR: number;
|
|
36
|
-
COD_MIDIA: number;
|
|
37
|
-
COD_ERP: string;
|
|
7
|
+
CPF_CNPJ: string | null;
|
|
8
|
+
IE_RG: string | null;
|
|
9
|
+
GRUPO: number | null;
|
|
10
|
+
END_RUA: string | null;
|
|
11
|
+
CIDADE: string | null;
|
|
12
|
+
BAIRRO: string | null;
|
|
13
|
+
ESTADO: string | null;
|
|
14
|
+
CEP: string | null;
|
|
15
|
+
COMPLEMENTO: string | null;
|
|
16
|
+
AREA1: number | null;
|
|
17
|
+
AREA2: number | null;
|
|
18
|
+
AREA3: number | null;
|
|
19
|
+
AREAFAX: number | null;
|
|
20
|
+
FONE1: string | null;
|
|
21
|
+
FONE2: string | null;
|
|
22
|
+
FONE3: string | null;
|
|
23
|
+
FAX: string | null;
|
|
24
|
+
DESC_FONE1: string | null;
|
|
25
|
+
DESC_FONE2: string | null;
|
|
26
|
+
DESC_FONE3: string | null;
|
|
27
|
+
DESCFAX: string | null;
|
|
28
|
+
EMAIL: string | null;
|
|
29
|
+
WEBSITE: string | null;
|
|
30
|
+
DATACAD: string | null;
|
|
31
|
+
STATUS_CAD: string | null;
|
|
32
|
+
OBS_ADMIN: string | null;
|
|
33
|
+
OBS_OPERADOR: string | null;
|
|
34
|
+
ORIGEM: number | null;
|
|
35
|
+
OPERADOR: number | null;
|
|
36
|
+
COD_MIDIA: number | null;
|
|
37
|
+
COD_ERP: string | null;
|
|
38
38
|
BLOCK_COMPRAS: "SIM" | "NAO" | null;
|
|
39
|
-
COD_UNIDADE: number;
|
|
40
|
-
SALDO_DISPONIVEL: number;
|
|
41
|
-
SALDO_LIMITE: number;
|
|
42
|
-
POTENCIAL: number;
|
|
43
|
-
DATA_ULT_COMPRA:
|
|
44
|
-
SEGMENTO: number;
|
|
45
|
-
ULTI_RESULTADO:
|
|
46
|
-
DT_AGENDAMENTO:
|
|
47
|
-
COD_CAMPANHA: number;
|
|
48
|
-
COD_RESULTADO: number;
|
|
49
|
-
CONTATO_MAIL: string;
|
|
39
|
+
COD_UNIDADE: number | null;
|
|
40
|
+
SALDO_DISPONIVEL: number | null;
|
|
41
|
+
SALDO_LIMITE: number | null;
|
|
42
|
+
POTENCIAL: number | null;
|
|
43
|
+
DATA_ULT_COMPRA: string | null;
|
|
44
|
+
SEGMENTO: number | null;
|
|
45
|
+
ULTI_RESULTADO: string | null;
|
|
46
|
+
DT_AGENDAMENTO: string | null;
|
|
47
|
+
COD_CAMPANHA: number | null;
|
|
48
|
+
COD_RESULTADO: number | null;
|
|
49
|
+
CONTATO_MAIL: string | null;
|
|
50
50
|
ATUALIZADOR: "CADASTRO" | "ATUALIZAÇÃO" | null;
|
|
51
|
-
OPERADOR_LOGIN: string;
|
|
52
|
-
OBS_FONE1: string;
|
|
53
|
-
OBS_FONE2: string;
|
|
54
|
-
OBS_FONE3: string;
|
|
55
|
-
NR_FUNCIONARIOS: number;
|
|
56
|
-
EMAIL2: string;
|
|
57
|
-
OBS_CLIENTES: string;
|
|
58
|
-
VENCIMENTO_LIMITE_CREDITO:
|
|
51
|
+
OPERADOR_LOGIN: string | null;
|
|
52
|
+
OBS_FONE1: string | null;
|
|
53
|
+
OBS_FONE2: string | null;
|
|
54
|
+
OBS_FONE3: string | null;
|
|
55
|
+
NR_FUNCIONARIOS: number | null;
|
|
56
|
+
EMAIL2: string | null;
|
|
57
|
+
OBS_CLIENTES: string | null;
|
|
58
|
+
VENCIMENTO_LIMITE_CREDITO: string | null;
|
|
59
59
|
PERIODO_RECOMPRA: number;
|
|
60
|
-
DT_ULTIMO_ORCAMENTO_VENDA:
|
|
60
|
+
DT_ULTIMO_ORCAMENTO_VENDA: string | null;
|
|
61
61
|
POSSUI_ORCAMENTO: "S" | "N" | null;
|
|
62
62
|
POSSUI_VENDA: "S" | "N" | null;
|
|
63
|
-
CODIGOPRINCIPAL: number;
|
|
64
|
-
SETOR: number;
|
|
63
|
+
CODIGOPRINCIPAL: number | null;
|
|
64
|
+
SETOR: number | null;
|
|
65
65
|
}
|
|
66
66
|
export interface CreateCustomerDTO {
|
|
67
67
|
RAZAO: string;
|
|
68
|
-
CPF_CNPJ
|
|
68
|
+
CPF_CNPJ?: string | null;
|
|
69
69
|
FANTASIA?: string | null;
|
|
70
70
|
PESSOA?: "FIS" | "JUR" | null;
|
|
71
71
|
ATIVO?: "SIM" | "NAO" | null;
|
package/dist/wallets.client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ApiClient from "./api-client";
|
|
2
2
|
import { Wallet } from "./types/wallet.types";
|
|
3
3
|
export default class WalletsClient extends ApiClient {
|
|
4
|
-
createWallet(
|
|
4
|
+
createWallet(name: string): Promise<Wallet>;
|
|
5
5
|
deleteWallet(walletId: number): Promise<Wallet>;
|
|
6
6
|
updateWalletName(id: number, newName: string): Promise<Wallet>;
|
|
7
7
|
addUserToWallet(walletId: number, userId: number): Promise<Wallet>;
|
package/dist/wallets.client.js
CHANGED
|
@@ -5,9 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const api_client_1 = __importDefault(require("./api-client"));
|
|
7
7
|
class WalletsClient extends api_client_1.default {
|
|
8
|
-
async createWallet(
|
|
8
|
+
async createWallet(name) {
|
|
9
9
|
try {
|
|
10
|
-
const response = await this.httpClient.post(`/api/wallets`, {
|
|
10
|
+
const response = await this.httpClient.post(`/api/wallets`, { name });
|
|
11
11
|
return response.data.data;
|
|
12
12
|
}
|
|
13
13
|
catch (error) {
|
package/package.json
CHANGED
package/src/socket.client.ts
CHANGED
|
@@ -60,13 +60,13 @@ export default class SocketClient {
|
|
|
60
60
|
* @returns A function that, when called, removes the event listener for the specified event.
|
|
61
61
|
*/
|
|
62
62
|
public on: ListenSocketEventFn = (event, callback) => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
this.listeners.set(event, callback);
|
|
63
|
+
const oldListener = this.listeners.get(event);
|
|
64
|
+
if (oldListener) {
|
|
65
|
+
this.ws.off(event, oldListener);
|
|
69
66
|
}
|
|
67
|
+
|
|
68
|
+
this.ws.on(event, callback);
|
|
69
|
+
this.listeners.set(event, callback);
|
|
70
70
|
};
|
|
71
71
|
|
|
72
72
|
/**
|
|
@@ -1,72 +1,72 @@
|
|
|
1
1
|
export interface Customer {
|
|
2
2
|
CODIGO: number;
|
|
3
3
|
RAZAO: string;
|
|
4
|
-
FANTASIA: string;
|
|
4
|
+
FANTASIA: string | null;
|
|
5
5
|
PESSOA: "FIS" | "JUR" | null;
|
|
6
6
|
ATIVO: "SIM" | "NAO" | null;
|
|
7
|
-
CPF_CNPJ: string;
|
|
8
|
-
IE_RG: string;
|
|
9
|
-
GRUPO: number;
|
|
10
|
-
END_RUA: string;
|
|
11
|
-
CIDADE: string;
|
|
12
|
-
BAIRRO: string;
|
|
13
|
-
ESTADO: string;
|
|
14
|
-
CEP: string;
|
|
15
|
-
COMPLEMENTO: string;
|
|
16
|
-
AREA1: number;
|
|
17
|
-
AREA2: number;
|
|
18
|
-
AREA3: number;
|
|
19
|
-
AREAFAX: number;
|
|
20
|
-
FONE1: string;
|
|
21
|
-
FONE2: string;
|
|
22
|
-
FONE3: string;
|
|
23
|
-
FAX: string;
|
|
24
|
-
DESC_FONE1: string;
|
|
25
|
-
DESC_FONE2: string;
|
|
26
|
-
DESC_FONE3: string;
|
|
27
|
-
DESCFAX: string;
|
|
28
|
-
EMAIL: string;
|
|
29
|
-
WEBSITE: string;
|
|
30
|
-
DATACAD:
|
|
31
|
-
STATUS_CAD: string;
|
|
32
|
-
OBS_ADMIN: string;
|
|
33
|
-
OBS_OPERADOR: string;
|
|
34
|
-
ORIGEM: number;
|
|
35
|
-
OPERADOR: number;
|
|
36
|
-
COD_MIDIA: number;
|
|
37
|
-
COD_ERP: string;
|
|
7
|
+
CPF_CNPJ: string | null;
|
|
8
|
+
IE_RG: string | null;
|
|
9
|
+
GRUPO: number | null;
|
|
10
|
+
END_RUA: string | null;
|
|
11
|
+
CIDADE: string | null;
|
|
12
|
+
BAIRRO: string | null;
|
|
13
|
+
ESTADO: string | null;
|
|
14
|
+
CEP: string | null;
|
|
15
|
+
COMPLEMENTO: string | null;
|
|
16
|
+
AREA1: number | null;
|
|
17
|
+
AREA2: number | null;
|
|
18
|
+
AREA3: number | null;
|
|
19
|
+
AREAFAX: number | null;
|
|
20
|
+
FONE1: string | null;
|
|
21
|
+
FONE2: string | null;
|
|
22
|
+
FONE3: string | null;
|
|
23
|
+
FAX: string | null;
|
|
24
|
+
DESC_FONE1: string | null;
|
|
25
|
+
DESC_FONE2: string | null;
|
|
26
|
+
DESC_FONE3: string | null;
|
|
27
|
+
DESCFAX: string | null;
|
|
28
|
+
EMAIL: string | null;
|
|
29
|
+
WEBSITE: string | null;
|
|
30
|
+
DATACAD: string | null;
|
|
31
|
+
STATUS_CAD: string | null;
|
|
32
|
+
OBS_ADMIN: string | null;
|
|
33
|
+
OBS_OPERADOR: string | null;
|
|
34
|
+
ORIGEM: number | null;
|
|
35
|
+
OPERADOR: number | null;
|
|
36
|
+
COD_MIDIA: number | null;
|
|
37
|
+
COD_ERP: string | null;
|
|
38
38
|
BLOCK_COMPRAS: "SIM" | "NAO" | null;
|
|
39
|
-
COD_UNIDADE: number;
|
|
40
|
-
SALDO_DISPONIVEL: number;
|
|
41
|
-
SALDO_LIMITE: number;
|
|
42
|
-
POTENCIAL: number;
|
|
43
|
-
DATA_ULT_COMPRA:
|
|
44
|
-
SEGMENTO: number;
|
|
45
|
-
ULTI_RESULTADO:
|
|
46
|
-
DT_AGENDAMENTO:
|
|
47
|
-
COD_CAMPANHA: number;
|
|
48
|
-
COD_RESULTADO: number;
|
|
49
|
-
CONTATO_MAIL: string;
|
|
39
|
+
COD_UNIDADE: number | null;
|
|
40
|
+
SALDO_DISPONIVEL: number | null;
|
|
41
|
+
SALDO_LIMITE: number | null;
|
|
42
|
+
POTENCIAL: number | null;
|
|
43
|
+
DATA_ULT_COMPRA: string | null;
|
|
44
|
+
SEGMENTO: number | null;
|
|
45
|
+
ULTI_RESULTADO: string | null;
|
|
46
|
+
DT_AGENDAMENTO: string | null;
|
|
47
|
+
COD_CAMPANHA: number | null;
|
|
48
|
+
COD_RESULTADO: number | null;
|
|
49
|
+
CONTATO_MAIL: string | null;
|
|
50
50
|
ATUALIZADOR: "CADASTRO" | "ATUALIZAÇÃO" | null;
|
|
51
|
-
OPERADOR_LOGIN: string;
|
|
52
|
-
OBS_FONE1: string;
|
|
53
|
-
OBS_FONE2: string;
|
|
54
|
-
OBS_FONE3: string;
|
|
55
|
-
NR_FUNCIONARIOS: number;
|
|
56
|
-
EMAIL2: string;
|
|
57
|
-
OBS_CLIENTES: string;
|
|
58
|
-
VENCIMENTO_LIMITE_CREDITO:
|
|
51
|
+
OPERADOR_LOGIN: string | null;
|
|
52
|
+
OBS_FONE1: string | null;
|
|
53
|
+
OBS_FONE2: string | null;
|
|
54
|
+
OBS_FONE3: string | null;
|
|
55
|
+
NR_FUNCIONARIOS: number | null;
|
|
56
|
+
EMAIL2: string | null;
|
|
57
|
+
OBS_CLIENTES: string | null;
|
|
58
|
+
VENCIMENTO_LIMITE_CREDITO: string | null;
|
|
59
59
|
PERIODO_RECOMPRA: number;
|
|
60
|
-
DT_ULTIMO_ORCAMENTO_VENDA:
|
|
60
|
+
DT_ULTIMO_ORCAMENTO_VENDA: string | null;
|
|
61
61
|
POSSUI_ORCAMENTO: "S" | "N" | null;
|
|
62
62
|
POSSUI_VENDA: "S" | "N" | null;
|
|
63
|
-
CODIGOPRINCIPAL: number;
|
|
64
|
-
SETOR: number;
|
|
63
|
+
CODIGOPRINCIPAL: number | null;
|
|
64
|
+
SETOR: number | null;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
export interface CreateCustomerDTO {
|
|
68
68
|
RAZAO: string;
|
|
69
|
-
CPF_CNPJ
|
|
69
|
+
CPF_CNPJ?: string | null;
|
|
70
70
|
FANTASIA?: string | null;
|
|
71
71
|
PESSOA?: "FIS" | "JUR" | null;
|
|
72
72
|
ATIVO?: "SIM" | "NAO" | null;
|
package/src/wallets.client.ts
CHANGED
|
@@ -4,11 +4,11 @@ import { Wallet } from "./types/wallet.types";
|
|
|
4
4
|
|
|
5
5
|
export default class WalletsClient extends ApiClient {
|
|
6
6
|
|
|
7
|
-
public async createWallet(
|
|
7
|
+
public async createWallet(name: string) {
|
|
8
8
|
try {
|
|
9
9
|
const response = await this.httpClient.post<DataResponse<Wallet>>(
|
|
10
10
|
`/api/wallets`,
|
|
11
|
-
|
|
11
|
+
{ name }
|
|
12
12
|
);
|
|
13
13
|
return response.data.data
|
|
14
14
|
} catch (error) {
|