sim-node-lib 0.0.93 → 0.0.95
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/Helpers/HtmlBadgerHelper.d.ts +9 -0
- package/dist/Helpers/HtmlBadgerHelper.js +100 -0
- package/dist/Models/PriceToConsult.d.ts +16 -0
- package/dist/Models/PriceToConsult.js +24 -0
- package/dist/Models/PriceToSale.d.ts +4 -3
- package/dist/Models/PriceToSale.js +4 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default class AtributoEntradaUtil {
|
|
2
|
+
static getTextoByProduto(operacao: string, produtos: any[]): Promise<string>;
|
|
3
|
+
static getTextoByAgrupadorEmpresa(operacao: string, agrupadores: any[]): Promise<string>;
|
|
4
|
+
static getTextoByEmpresa(operacao: string, empresas: any[]): Promise<string>;
|
|
5
|
+
static getTextoByTag(operacao: string, tags: any[]): Promise<string>;
|
|
6
|
+
static getTextoByFormaPagamento(operacao: string, formasPagamento: any[]): Promise<string>;
|
|
7
|
+
static getTextoOperacao(operacao: string): Promise<string>;
|
|
8
|
+
static getHTMLPill(color: string, texto: string): Promise<string>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
class AtributoEntradaUtil {
|
|
13
|
+
static getTextoByProduto(operacao, produtos) {
|
|
14
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
operacao = yield this.getTextoOperacao(operacao);
|
|
16
|
+
let descriptionList = [];
|
|
17
|
+
if (produtos.length > 0) {
|
|
18
|
+
for (let produto of produtos) {
|
|
19
|
+
descriptionList.push(produto.descricao);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
else
|
|
23
|
+
descriptionList.push('TODOS');
|
|
24
|
+
return this.getHTMLPill('badge-primary', `Produto ${operacao} ${descriptionList.join(', ')}`);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
static getTextoByAgrupadorEmpresa(operacao, agrupadores) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
operacao = yield this.getTextoOperacao(operacao);
|
|
30
|
+
let descriptionList = [];
|
|
31
|
+
for (let agrupador of agrupadores) {
|
|
32
|
+
descriptionList.push(agrupador.descricao);
|
|
33
|
+
}
|
|
34
|
+
return this.getHTMLPill('badge-warning', `Agrupador de Empresa ${operacao} ${descriptionList.join(', ')}`);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
static getTextoByEmpresa(operacao, empresas) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
operacao = yield this.getTextoOperacao(operacao);
|
|
40
|
+
let descriptionList = [];
|
|
41
|
+
if (empresas.length > 0) {
|
|
42
|
+
for (let empresa of empresas) {
|
|
43
|
+
descriptionList.push(empresa.nom_empresa);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
else
|
|
47
|
+
descriptionList.push('TODOS');
|
|
48
|
+
return this.getHTMLPill('badge-secondary', `Empresa ${operacao} ${descriptionList.join(', ')}`);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
static getTextoByTag(operacao, tags) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
operacao = yield this.getTextoOperacao(operacao);
|
|
54
|
+
let descriptionList = [];
|
|
55
|
+
for (let tag of tags) {
|
|
56
|
+
descriptionList.push(tag.nome);
|
|
57
|
+
}
|
|
58
|
+
return this.getHTMLPill('badge-light', `Tag ${operacao} ${descriptionList.join(', ')}`);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
static getTextoByFormaPagamento(operacao, formasPagamento) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
operacao = yield this.getTextoOperacao(operacao);
|
|
64
|
+
let descriptionList = [];
|
|
65
|
+
if (formasPagamento.length > 0) {
|
|
66
|
+
for (let formaPagamento of formasPagamento) {
|
|
67
|
+
descriptionList.push(formaPagamento.descricao);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
else
|
|
71
|
+
descriptionList.push('TODOS');
|
|
72
|
+
return this.getHTMLPill('badge-info', `Forma Pagamento ${operacao} ${descriptionList.join(', ')}`);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
static getTextoOperacao(operacao) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
let resultado = operacao;
|
|
78
|
+
switch (operacao) {
|
|
79
|
+
case '=':
|
|
80
|
+
operacao = 'igual';
|
|
81
|
+
break;
|
|
82
|
+
case '<>':
|
|
83
|
+
operacao = 'diferente';
|
|
84
|
+
break;
|
|
85
|
+
case 'contem':
|
|
86
|
+
operacao = 'contem';
|
|
87
|
+
break;
|
|
88
|
+
default:
|
|
89
|
+
operacao = 'ERROR';
|
|
90
|
+
}
|
|
91
|
+
return resultado;
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
static getHTMLPill(color, texto) {
|
|
95
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
96
|
+
return `<span class="badge ${color}">${texto}</span>`;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.default = AtributoEntradaUtil;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Empresa, Grupo, Item, Preco } from './PriceToSale';
|
|
2
|
+
export declare class PriceToConsult {
|
|
3
|
+
grupo: Grupo;
|
|
4
|
+
dados: Dados[];
|
|
5
|
+
constructor(grupo: Grupo, dados: Dados[]);
|
|
6
|
+
}
|
|
7
|
+
export declare class Dados {
|
|
8
|
+
empresa: Empresa;
|
|
9
|
+
itens: Itens[];
|
|
10
|
+
constructor(empresa: Empresa, itens: Itens[]);
|
|
11
|
+
}
|
|
12
|
+
export declare class Itens {
|
|
13
|
+
itens: Item;
|
|
14
|
+
precos: Preco[];
|
|
15
|
+
constructor(itens: Item, precos: Preco[]);
|
|
16
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Itens = exports.Dados = exports.PriceToConsult = void 0;
|
|
4
|
+
class PriceToConsult {
|
|
5
|
+
constructor(grupo, dados) {
|
|
6
|
+
this.grupo = grupo;
|
|
7
|
+
this.dados = dados;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.PriceToConsult = PriceToConsult;
|
|
11
|
+
class Dados {
|
|
12
|
+
constructor(empresa, itens) {
|
|
13
|
+
this.empresa = empresa;
|
|
14
|
+
this.itens = itens;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.Dados = Dados;
|
|
18
|
+
class Itens {
|
|
19
|
+
constructor(itens, precos) {
|
|
20
|
+
this.itens = itens;
|
|
21
|
+
this.precos = precos;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.Itens = Itens;
|
|
@@ -10,7 +10,6 @@ export declare class Grupo {
|
|
|
10
10
|
constructor(codigo: string, descricao: string);
|
|
11
11
|
}
|
|
12
12
|
export declare class Empresa {
|
|
13
|
-
codigo: string;
|
|
14
13
|
cnpj: string;
|
|
15
14
|
key: string;
|
|
16
15
|
descricao: string;
|
|
@@ -18,7 +17,7 @@ export declare class Empresa {
|
|
|
18
17
|
estado: string;
|
|
19
18
|
latitude: string;
|
|
20
19
|
longitude: string;
|
|
21
|
-
constructor(
|
|
20
|
+
constructor(cnpj: string, key: string, descricao: string, cidade: string, estado: string, latitude: string, longitude: string);
|
|
22
21
|
}
|
|
23
22
|
export declare class Preco {
|
|
24
23
|
item: Item;
|
|
@@ -26,7 +25,9 @@ export declare class Preco {
|
|
|
26
25
|
preco_final: number;
|
|
27
26
|
desconto: number;
|
|
28
27
|
origem: Origem;
|
|
29
|
-
|
|
28
|
+
ordem: number;
|
|
29
|
+
aplicavel?: boolean | undefined;
|
|
30
|
+
constructor(item: Item, preco_base: number, preco_final: number, desconto: number, origem: Origem, ordem: number, aplicavel?: boolean | undefined);
|
|
30
31
|
}
|
|
31
32
|
export declare class Item {
|
|
32
33
|
codigo_erp: string;
|
|
@@ -17,8 +17,7 @@ class Grupo {
|
|
|
17
17
|
}
|
|
18
18
|
exports.Grupo = Grupo;
|
|
19
19
|
class Empresa {
|
|
20
|
-
constructor(
|
|
21
|
-
this.codigo = codigo;
|
|
20
|
+
constructor(cnpj, key, descricao, cidade, estado, latitude, longitude) {
|
|
22
21
|
this.cnpj = cnpj;
|
|
23
22
|
this.key = key;
|
|
24
23
|
this.descricao = descricao;
|
|
@@ -30,12 +29,14 @@ class Empresa {
|
|
|
30
29
|
}
|
|
31
30
|
exports.Empresa = Empresa;
|
|
32
31
|
class Preco {
|
|
33
|
-
constructor(item, preco_base, preco_final, desconto, origem) {
|
|
32
|
+
constructor(item, preco_base, preco_final, desconto, origem, ordem, aplicavel) {
|
|
34
33
|
this.item = item;
|
|
35
34
|
this.preco_base = preco_base;
|
|
36
35
|
this.preco_final = preco_final;
|
|
37
36
|
this.desconto = desconto;
|
|
38
37
|
this.origem = origem;
|
|
38
|
+
this.ordem = ordem;
|
|
39
|
+
this.aplicavel = aplicavel;
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
exports.Preco = Preco;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { NumberHelper } from './Helpers/NumberHelper';
|
|
|
8
8
|
export { PromiseHelper } from './Helpers/PromiseHelper';
|
|
9
9
|
export { StringHelper } from './Helpers/StringHelper';
|
|
10
10
|
export { AxiosModel } from './Models/AxiosModel';
|
|
11
|
+
export { PriceToConsult } from './Models/PriceToConsult';
|
|
11
12
|
export { PriceToSale } from './Models/PriceToSale';
|
|
12
13
|
export { AxiosService } from './Services/AxiosService';
|
|
13
14
|
export { CombustivelService } from './Services/CombustivelService';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CombustivelService = exports.AxiosService = exports.PriceToSale = exports.AxiosModel = exports.StringHelper = exports.PromiseHelper = exports.NumberHelper = exports.HashHelper = exports.DateHelper = exports.CryptHelper = exports.PubSubHandlerAction = exports.GooglePubSubSubscription = exports.GooglePubSubPublish = void 0;
|
|
3
|
+
exports.CombustivelService = exports.AxiosService = exports.PriceToSale = exports.PriceToConsult = exports.AxiosModel = exports.StringHelper = exports.PromiseHelper = exports.NumberHelper = exports.HashHelper = exports.DateHelper = exports.CryptHelper = exports.PubSubHandlerAction = exports.GooglePubSubSubscription = exports.GooglePubSubPublish = void 0;
|
|
4
4
|
var GooglePubSubPublish_1 = require("./Class/GooglePubSubPublish");
|
|
5
5
|
Object.defineProperty(exports, "GooglePubSubPublish", { enumerable: true, get: function () { return GooglePubSubPublish_1.GooglePubSubPublish; } });
|
|
6
6
|
var GooglePubSubSubscription_1 = require("./Class/GooglePubSubSubscription");
|
|
@@ -21,6 +21,8 @@ var StringHelper_1 = require("./Helpers/StringHelper");
|
|
|
21
21
|
Object.defineProperty(exports, "StringHelper", { enumerable: true, get: function () { return StringHelper_1.StringHelper; } });
|
|
22
22
|
var AxiosModel_1 = require("./Models/AxiosModel");
|
|
23
23
|
Object.defineProperty(exports, "AxiosModel", { enumerable: true, get: function () { return AxiosModel_1.AxiosModel; } });
|
|
24
|
+
var PriceToConsult_1 = require("./Models/PriceToConsult");
|
|
25
|
+
Object.defineProperty(exports, "PriceToConsult", { enumerable: true, get: function () { return PriceToConsult_1.PriceToConsult; } });
|
|
24
26
|
var PriceToSale_1 = require("./Models/PriceToSale");
|
|
25
27
|
Object.defineProperty(exports, "PriceToSale", { enumerable: true, get: function () { return PriceToSale_1.PriceToSale; } });
|
|
26
28
|
var AxiosService_1 = require("./Services/AxiosService");
|