flit-modulo-exportacoes 2.0.41 → 4120.0.1

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.
@@ -1,6 +1,6 @@
1
- import { ElasticBase } from './elastic-base';
2
- import { SearchHit } from '@elastic/elasticsearch/lib/api/types';
3
- export declare class ContasElastic extends ElasticBase {
4
- private internalGetContasElastic;
5
- getContaElastic(contaId: string): Promise<SearchHit<any>>;
6
- }
1
+ import { ElasticBase } from './elastic-base';
2
+ import { SearchHit } from '@elastic/elasticsearch/lib/api/types';
3
+ export declare class ContasElastic extends ElasticBase {
4
+ private internalGetContasElastic;
5
+ getContaElastic(contaId: string): Promise<SearchHit<any>>;
6
+ }
@@ -1,36 +1,36 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ContasElastic = void 0;
4
- const elastic_base_1 = require("./elastic-base");
5
- class ContasElastic extends elastic_base_1.ElasticBase {
6
- async internalGetContasElastic(contaId) {
7
- return await this.elasticClient.search({
8
- scroll: '1m',
9
- index: 'contas',
10
- size: this.totalRegistrosFiltradosElastic,
11
- _source: [
12
- 'parametros.horario_noturno'
13
- ],
14
- query: {
15
- bool: {
16
- must: [{
17
- match: {
18
- i_id: contaId
19
- }
20
- }, {
21
- match: {
22
- excluido: false
23
- }
24
- }]
25
- }
26
- },
27
- sort: [{
28
- i_id: 'asc'
29
- }]
30
- });
31
- }
32
- async getContaElastic(contaId) {
33
- return (await this.retornaTodosDadosPaginacaoElastic(await this.internalGetContasElastic(contaId)))[0];
34
- }
35
- }
36
- exports.ContasElastic = ContasElastic;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContasElastic = void 0;
4
+ const elastic_base_1 = require("./elastic-base");
5
+ class ContasElastic extends elastic_base_1.ElasticBase {
6
+ async internalGetContasElastic(contaId) {
7
+ return await this.elasticClient.search({
8
+ scroll: '1m',
9
+ index: 'contas',
10
+ size: this.totalRegistrosFiltradosElastic,
11
+ _source: [
12
+ 'parametros.horario_noturno'
13
+ ],
14
+ query: {
15
+ bool: {
16
+ must: [{
17
+ match: {
18
+ i_id: contaId
19
+ }
20
+ }, {
21
+ match: {
22
+ excluido: false
23
+ }
24
+ }]
25
+ }
26
+ },
27
+ sort: [{
28
+ i_id: 'asc'
29
+ }]
30
+ });
31
+ }
32
+ async getContaElastic(contaId) {
33
+ return (await this.retornaTodosDadosPaginacaoElastic(await this.internalGetContasElastic(contaId)))[0];
34
+ }
35
+ }
36
+ exports.ContasElastic = ContasElastic;
@@ -1,10 +1,10 @@
1
- import { Client } from '@elastic/elasticsearch';
2
- import { SearchHit, SearchResponse } from '@elastic/elasticsearch/lib/api/types';
3
- export declare class ElasticBase {
4
- protected readonly elasticClient: Client;
5
- protected readonly totalRegistrosFiltradosElastic = 500;
6
- constructor(elasticClient: Client);
7
- private searchScrollObjectElastic;
8
- private adicionarRegistrosPaginacaoElastic;
9
- protected retornaTodosDadosPaginacaoElastic(filtroInicial: SearchResponse): Promise<Array<SearchHit<any>>>;
10
- }
1
+ import { Client } from '@elastic/elasticsearch';
2
+ import { SearchHit, SearchResponse } from '@elastic/elasticsearch/lib/api/types';
3
+ export declare class ElasticBase {
4
+ protected readonly elasticClient: Client;
5
+ protected readonly totalRegistrosFiltradosElastic = 500;
6
+ constructor(elasticClient: Client);
7
+ private searchScrollObjectElastic;
8
+ private adicionarRegistrosPaginacaoElastic;
9
+ protected retornaTodosDadosPaginacaoElastic(filtroInicial: SearchResponse): Promise<Array<SearchHit<any>>>;
10
+ }
@@ -1,38 +1,38 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ElasticBase = void 0;
4
- class ElasticBase {
5
- elasticClient;
6
- totalRegistrosFiltradosElastic = 500;
7
- constructor(elasticClient) {
8
- this.elasticClient = elasticClient;
9
- }
10
- async searchScrollObjectElastic(scrollId) {
11
- return await this.elasticClient.scroll({
12
- scroll: '1m',
13
- scroll_id: scrollId
14
- });
15
- }
16
- async adicionarRegistrosPaginacaoElastic({ scrollId, retorno }) {
17
- let objetosPaginacao = await this.searchScrollObjectElastic(scrollId);
18
- while ((objetosPaginacao?.hits?.hits ?? []).length > 0) {
19
- (objetosPaginacao?.hits?.hits ?? []).forEach(objeto => retorno.push(objeto));
20
- objetosPaginacao = await this.searchScrollObjectElastic(scrollId);
21
- }
22
- }
23
- async retornaTodosDadosPaginacaoElastic(filtroInicial) {
24
- const retorno = new Array();
25
- (filtroInicial?.hits?.hits ?? []).forEach(objeto => retorno.push(objeto));
26
- if (filtroInicial?._scroll_id) {
27
- if (((filtroInicial?.hits?.total).value ?? 0) > this.totalRegistrosFiltradosElastic) {
28
- await this.adicionarRegistrosPaginacaoElastic({
29
- retorno: retorno,
30
- scrollId: filtroInicial?._scroll_id
31
- });
32
- }
33
- await this.elasticClient.clearScroll({ scroll_id: filtroInicial?._scroll_id });
34
- }
35
- return retorno;
36
- }
37
- }
38
- exports.ElasticBase = ElasticBase;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ElasticBase = void 0;
4
+ class ElasticBase {
5
+ elasticClient;
6
+ totalRegistrosFiltradosElastic = 500;
7
+ constructor(elasticClient) {
8
+ this.elasticClient = elasticClient;
9
+ }
10
+ async searchScrollObjectElastic(scrollId) {
11
+ return await this.elasticClient.scroll({
12
+ scroll: '1m',
13
+ scroll_id: scrollId
14
+ });
15
+ }
16
+ async adicionarRegistrosPaginacaoElastic({ scrollId, retorno }) {
17
+ let objetosPaginacao = await this.searchScrollObjectElastic(scrollId);
18
+ while ((objetosPaginacao?.hits?.hits ?? []).length > 0) {
19
+ (objetosPaginacao?.hits?.hits ?? []).forEach(objeto => retorno.push(objeto));
20
+ objetosPaginacao = await this.searchScrollObjectElastic(scrollId);
21
+ }
22
+ }
23
+ async retornaTodosDadosPaginacaoElastic(filtroInicial) {
24
+ const retorno = new Array();
25
+ (filtroInicial?.hits?.hits ?? []).forEach(objeto => retorno.push(objeto));
26
+ if (filtroInicial?._scroll_id) {
27
+ if (((filtroInicial?.hits?.total).value ?? 0) > this.totalRegistrosFiltradosElastic) {
28
+ await this.adicionarRegistrosPaginacaoElastic({
29
+ retorno: retorno,
30
+ scrollId: filtroInicial?._scroll_id
31
+ });
32
+ }
33
+ await this.elasticClient.clearScroll({ scroll_id: filtroInicial?._scroll_id });
34
+ }
35
+ return retorno;
36
+ }
37
+ }
38
+ exports.ElasticBase = ElasticBase;
@@ -1,6 +1,6 @@
1
- import { ElasticBase } from './elastic-base';
2
- import { SearchHit } from '@elastic/elasticsearch/lib/api/types';
3
- export declare class EmpresasElastic extends ElasticBase {
4
- private internalGetEmpresasElastic;
5
- getEmpresasElastic(contaId: string): Promise<Array<SearchHit<any>>>;
6
- }
1
+ import { ElasticBase } from './elastic-base';
2
+ import { SearchHit } from '@elastic/elasticsearch/lib/api/types';
3
+ export declare class EmpresasElastic extends ElasticBase {
4
+ private internalGetEmpresasElastic;
5
+ getEmpresasElastic(contaId: string): Promise<Array<SearchHit<any>>>;
6
+ }
@@ -1,42 +1,42 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EmpresasElastic = void 0;
4
- const elastic_base_1 = require("./elastic-base");
5
- class EmpresasElastic extends elastic_base_1.ElasticBase {
6
- async internalGetEmpresasElastic(contaId) {
7
- return await this.elasticClient.search({
8
- scroll: '1m',
9
- index: 'contas_empresas',
10
- size: this.totalRegistrosFiltradosElastic,
11
- _source: [
12
- 'i_id',
13
- 'cnpj',
14
- 'razao',
15
- 'fantasia',
16
- 'endereco.uf',
17
- 'endereco.cidade',
18
- 'parametros.codigo_externo'
19
- ],
20
- query: {
21
- bool: {
22
- must: [{
23
- match: {
24
- i_parent_id: contaId
25
- }
26
- }, {
27
- match: {
28
- excluido: false
29
- }
30
- }]
31
- }
32
- },
33
- sort: [{
34
- i_id: 'asc'
35
- }]
36
- });
37
- }
38
- async getEmpresasElastic(contaId) {
39
- return await this.retornaTodosDadosPaginacaoElastic(await this.internalGetEmpresasElastic(contaId));
40
- }
41
- }
42
- exports.EmpresasElastic = EmpresasElastic;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmpresasElastic = void 0;
4
+ const elastic_base_1 = require("./elastic-base");
5
+ class EmpresasElastic extends elastic_base_1.ElasticBase {
6
+ async internalGetEmpresasElastic(contaId) {
7
+ return await this.elasticClient.search({
8
+ scroll: '1m',
9
+ index: 'contas_empresas',
10
+ size: this.totalRegistrosFiltradosElastic,
11
+ _source: [
12
+ 'i_id',
13
+ 'cnpj',
14
+ 'razao',
15
+ 'fantasia',
16
+ 'endereco.uf',
17
+ 'endereco.cidade',
18
+ 'parametros.codigo_externo'
19
+ ],
20
+ query: {
21
+ bool: {
22
+ must: [{
23
+ match: {
24
+ i_parent_id: contaId
25
+ }
26
+ }, {
27
+ match: {
28
+ excluido: false
29
+ }
30
+ }]
31
+ }
32
+ },
33
+ sort: [{
34
+ i_id: 'asc'
35
+ }]
36
+ });
37
+ }
38
+ async getEmpresasElastic(contaId) {
39
+ return await this.retornaTodosDadosPaginacaoElastic(await this.internalGetEmpresasElastic(contaId));
40
+ }
41
+ }
42
+ exports.EmpresasElastic = EmpresasElastic;
@@ -1,9 +1,9 @@
1
- import { ElasticBase } from './elastic-base';
2
- import { SearchHit } from '@elastic/elasticsearch/lib/api/types';
3
- export declare class EmpresasFeriadoElastic extends ElasticBase {
4
- private internalGeEmpresasFeriadoElastic;
5
- getEmpresasFeriadoElastic({ empresaId, feriadoId }: {
6
- empresaId: string;
7
- feriadoId: string;
8
- }): Promise<Array<SearchHit<any>>>;
9
- }
1
+ import { ElasticBase } from './elastic-base';
2
+ import { SearchHit } from '@elastic/elasticsearch/lib/api/types';
3
+ export declare class EmpresasFeriadoElastic extends ElasticBase {
4
+ private internalGeEmpresasFeriadoElastic;
5
+ getEmpresasFeriadoElastic({ empresaId, feriadoId }: {
6
+ empresaId: string;
7
+ feriadoId: string;
8
+ }): Promise<Array<SearchHit<any>>>;
9
+ }
@@ -1,43 +1,43 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EmpresasFeriadoElastic = void 0;
4
- const elastic_base_1 = require("./elastic-base");
5
- class EmpresasFeriadoElastic extends elastic_base_1.ElasticBase {
6
- async internalGeEmpresasFeriadoElastic({ empresaId, feriadoId }) {
7
- return await this.elasticClient.search({
8
- scroll: '1m',
9
- index: 'contas_feriados_empresasferiado',
10
- size: this.totalRegistrosFiltradosElastic,
11
- _source: [
12
- 'i_id'
13
- ],
14
- query: {
15
- bool: {
16
- must: [{
17
- match: {
18
- i_parent_id: feriadoId
19
- }
20
- }, {
21
- match: {
22
- 'ref.i_id': empresaId
23
- }
24
- }, {
25
- match: {
26
- excluido: false
27
- }
28
- }]
29
- }
30
- },
31
- sort: [{
32
- i_id: 'asc'
33
- }]
34
- });
35
- }
36
- async getEmpresasFeriadoElastic({ empresaId, feriadoId }) {
37
- return await this.retornaTodosDadosPaginacaoElastic(await this.internalGeEmpresasFeriadoElastic({
38
- empresaId: empresaId,
39
- feriadoId: feriadoId
40
- }));
41
- }
42
- }
43
- exports.EmpresasFeriadoElastic = EmpresasFeriadoElastic;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmpresasFeriadoElastic = void 0;
4
+ const elastic_base_1 = require("./elastic-base");
5
+ class EmpresasFeriadoElastic extends elastic_base_1.ElasticBase {
6
+ async internalGeEmpresasFeriadoElastic({ empresaId, feriadoId }) {
7
+ return await this.elasticClient.search({
8
+ scroll: '1m',
9
+ index: 'contas_feriados_empresasferiado',
10
+ size: this.totalRegistrosFiltradosElastic,
11
+ _source: [
12
+ 'i_id'
13
+ ],
14
+ query: {
15
+ bool: {
16
+ must: [{
17
+ match: {
18
+ i_parent_id: feriadoId
19
+ }
20
+ }, {
21
+ match: {
22
+ 'ref.i_id': empresaId
23
+ }
24
+ }, {
25
+ match: {
26
+ excluido: false
27
+ }
28
+ }]
29
+ }
30
+ },
31
+ sort: [{
32
+ i_id: 'asc'
33
+ }]
34
+ });
35
+ }
36
+ async getEmpresasFeriadoElastic({ empresaId, feriadoId }) {
37
+ return await this.retornaTodosDadosPaginacaoElastic(await this.internalGeEmpresasFeriadoElastic({
38
+ empresaId: empresaId,
39
+ feriadoId: feriadoId
40
+ }));
41
+ }
42
+ }
43
+ exports.EmpresasFeriadoElastic = EmpresasFeriadoElastic;
@@ -1,9 +1,9 @@
1
- import { ElasticBase } from './elastic-base';
2
- import { SearchHit } from '@elastic/elasticsearch/lib/api/types';
3
- export declare class EventosExportacoesElastic extends ElasticBase {
4
- private internalGetEventosExportacoesElastic;
5
- getEventosExportacoesElastic({ contaId, tabelaEventosId }: {
6
- contaId: string;
7
- tabelaEventosId: string;
8
- }): Promise<SearchHit<any>>;
9
- }
1
+ import { ElasticBase } from './elastic-base';
2
+ import { SearchHit } from '@elastic/elasticsearch/lib/api/types';
3
+ export declare class EventosExportacoesElastic extends ElasticBase {
4
+ private internalGetEventosExportacoesElastic;
5
+ getEventosExportacoesElastic({ contaId, tabelaEventosId }: {
6
+ contaId: string;
7
+ tabelaEventosId: string;
8
+ }): Promise<SearchHit<any>>;
9
+ }
@@ -1,45 +1,45 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EventosExportacoesElastic = void 0;
4
- const elastic_base_1 = require("./elastic-base");
5
- class EventosExportacoesElastic extends elastic_base_1.ElasticBase {
6
- async internalGetEventosExportacoesElastic({ contaId, tabelaEventosId }) {
7
- return await this.elasticClient.search({
8
- scroll: '1m',
9
- index: 'contas_eventosexportacoes',
10
- size: this.totalRegistrosFiltradosElastic,
11
- _source: [
12
- 'eventos',
13
- 'forma_envio_faltas'
14
- ],
15
- query: {
16
- bool: {
17
- must: [{
18
- match: {
19
- i_parent_id: contaId
20
- }
21
- }, {
22
- match: {
23
- i_id: tabelaEventosId
24
- }
25
- }, {
26
- match: {
27
- excluido: false
28
- }
29
- }]
30
- }
31
- },
32
- sort: [{
33
- i_id: 'asc'
34
- }]
35
- });
36
- }
37
- async getEventosExportacoesElastic({ contaId, tabelaEventosId }) {
38
- const retorno = await this.retornaTodosDadosPaginacaoElastic(await this.internalGetEventosExportacoesElastic({
39
- contaId: contaId,
40
- tabelaEventosId: tabelaEventosId
41
- }));
42
- return retorno[0];
43
- }
44
- }
45
- exports.EventosExportacoesElastic = EventosExportacoesElastic;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EventosExportacoesElastic = void 0;
4
+ const elastic_base_1 = require("./elastic-base");
5
+ class EventosExportacoesElastic extends elastic_base_1.ElasticBase {
6
+ async internalGetEventosExportacoesElastic({ contaId, tabelaEventosId }) {
7
+ return await this.elasticClient.search({
8
+ scroll: '1m',
9
+ index: 'contas_eventosexportacoes',
10
+ size: this.totalRegistrosFiltradosElastic,
11
+ _source: [
12
+ 'eventos',
13
+ 'forma_envio_faltas'
14
+ ],
15
+ query: {
16
+ bool: {
17
+ must: [{
18
+ match: {
19
+ i_parent_id: contaId
20
+ }
21
+ }, {
22
+ match: {
23
+ i_id: tabelaEventosId
24
+ }
25
+ }, {
26
+ match: {
27
+ excluido: false
28
+ }
29
+ }]
30
+ }
31
+ },
32
+ sort: [{
33
+ i_id: 'asc'
34
+ }]
35
+ });
36
+ }
37
+ async getEventosExportacoesElastic({ contaId, tabelaEventosId }) {
38
+ const retorno = await this.retornaTodosDadosPaginacaoElastic(await this.internalGetEventosExportacoesElastic({
39
+ contaId: contaId,
40
+ tabelaEventosId: tabelaEventosId
41
+ }));
42
+ return retorno[0];
43
+ }
44
+ }
45
+ exports.EventosExportacoesElastic = EventosExportacoesElastic;
@@ -1,10 +1,10 @@
1
- import { ElasticBase } from './elastic-base';
2
- import { SearchHit } from '@elastic/elasticsearch/lib/api/types';
3
- export declare class FeriadosElastic extends ElasticBase {
4
- private internalGetFeriadosElastic;
5
- getFeriadosElastic({ contaId, dataFinal, dataInicial }: {
6
- contaId: string;
7
- dataFinal: Date;
8
- dataInicial: Date;
9
- }): Promise<Array<SearchHit<any>>>;
10
- }
1
+ import { ElasticBase } from './elastic-base';
2
+ import { SearchHit } from '@elastic/elasticsearch/lib/api/types';
3
+ export declare class FeriadosElastic extends ElasticBase {
4
+ private internalGetFeriadosElastic;
5
+ getFeriadosElastic({ contaId, dataFinal, dataInicial }: {
6
+ contaId: string;
7
+ dataFinal: Date;
8
+ dataInicial: Date;
9
+ }): Promise<Array<SearchHit<any>>>;
10
+ }
@@ -1,56 +1,56 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.FeriadosElastic = void 0;
7
- const moment_1 = __importDefault(require("moment"));
8
- const elastic_base_1 = require("./elastic-base");
9
- class FeriadosElastic extends elastic_base_1.ElasticBase {
10
- async internalGetFeriadosElastic({ contaId, dataFinal, dataInicial }) {
11
- return await this.elasticClient.search({
12
- scroll: '1m',
13
- index: 'contas_feriados',
14
- size: this.totalRegistrosFiltradosElastic,
15
- _source: [
16
- 'uf',
17
- 'i_id',
18
- 'tipo',
19
- 'data',
20
- 'municipio',
21
- 'todas_empresas'
22
- ],
23
- query: {
24
- bool: {
25
- must: [{
26
- match: {
27
- i_parent_id: contaId
28
- }
29
- }, {
30
- match: {
31
- excluido: false
32
- }
33
- }, {
34
- range: {
35
- data: {
36
- gte: (0, moment_1.default)(dataInicial).format('YYYY-MM-DDTHH:mm:ss.SSS'),
37
- lte: (0, moment_1.default)(dataFinal).format('YYYY-MM-DDTHH:mm:ss.SSS')
38
- }
39
- }
40
- }]
41
- }
42
- },
43
- sort: [{
44
- data: 'asc'
45
- }]
46
- });
47
- }
48
- async getFeriadosElastic({ contaId, dataFinal, dataInicial }) {
49
- return await this.retornaTodosDadosPaginacaoElastic(await this.internalGetFeriadosElastic({
50
- contaId: contaId,
51
- dataFinal: dataFinal,
52
- dataInicial: dataInicial
53
- }));
54
- }
55
- }
56
- exports.FeriadosElastic = FeriadosElastic;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FeriadosElastic = void 0;
7
+ const moment_1 = __importDefault(require("moment"));
8
+ const elastic_base_1 = require("./elastic-base");
9
+ class FeriadosElastic extends elastic_base_1.ElasticBase {
10
+ async internalGetFeriadosElastic({ contaId, dataFinal, dataInicial }) {
11
+ return await this.elasticClient.search({
12
+ scroll: '1m',
13
+ index: 'contas_feriados',
14
+ size: this.totalRegistrosFiltradosElastic,
15
+ _source: [
16
+ 'uf',
17
+ 'i_id',
18
+ 'tipo',
19
+ 'data',
20
+ 'municipio',
21
+ 'todas_empresas'
22
+ ],
23
+ query: {
24
+ bool: {
25
+ must: [{
26
+ match: {
27
+ i_parent_id: contaId
28
+ }
29
+ }, {
30
+ match: {
31
+ excluido: false
32
+ }
33
+ }, {
34
+ range: {
35
+ data: {
36
+ gte: (0, moment_1.default)(dataInicial).format('YYYY-MM-DDTHH:mm:ss.SSS'),
37
+ lte: (0, moment_1.default)(dataFinal).format('YYYY-MM-DDTHH:mm:ss.SSS')
38
+ }
39
+ }
40
+ }]
41
+ }
42
+ },
43
+ sort: [{
44
+ data: 'asc'
45
+ }]
46
+ });
47
+ }
48
+ async getFeriadosElastic({ contaId, dataFinal, dataInicial }) {
49
+ return await this.retornaTodosDadosPaginacaoElastic(await this.internalGetFeriadosElastic({
50
+ contaId: contaId,
51
+ dataFinal: dataFinal,
52
+ dataInicial: dataInicial
53
+ }));
54
+ }
55
+ }
56
+ exports.FeriadosElastic = FeriadosElastic;