diff --git a/package-lock.json b/package-lock.json index 859be27..4e47102 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2386,7 +2386,7 @@ "any-promise": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==" }, "anymatch": { "version": "3.1.1", @@ -2399,9 +2399,9 @@ } }, "app-root-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.0.0.tgz", - "integrity": "sha512-qMcx+Gy2UZynHjOHOIXPNvpf+9cjvk3cWrBBK7zg4gH9+clobJRb9NGzcT7mQTcV/6Gm/1WelUtqxVXnNlrwcw==" + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.1.0.tgz", + "integrity": "sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA==" }, "append-field": { "version": "1.0.0", @@ -3124,12 +3124,12 @@ } }, "cli-highlight": { - "version": "2.1.10", - "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.10.tgz", - "integrity": "sha512-CcPFD3JwdQ2oSzy+AMG6j3LRTkNjM82kzcSKzoVw6cLanDCJNlsLjeqVTOTfOfucnWv5F0rmBemVf1m9JiIasw==", + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", + "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", "requires": { "chalk": "^4.0.0", - "highlight.js": "^10.0.0", + "highlight.js": "^10.7.1", "mz": "^2.4.0", "parse5": "^5.1.1", "parse5-htmlparser2-tree-adapter": "^6.0.0", @@ -4641,9 +4641,9 @@ } }, "figlet": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/figlet/-/figlet-1.5.0.tgz", - "integrity": "sha512-ZQJM4aifMpz6H19AW1VqvZ7l4pOE9p7i/3LyxgO2kp+PO/VcDYNqIHEMtkccqIhTXMKci4kjueJr/iCQEaT/Ww==" + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/figlet/-/figlet-1.8.0.tgz", + "integrity": "sha512-chzvGjd+Sp7KUvPHZv6EXV5Ir3Q7kYNpCr4aHrRW79qFtTefmQZNny+W1pW9kf5zeE6dikku2W50W/wAH2xWgw==" }, "figures": { "version": "3.2.0", @@ -5027,7 +5027,7 @@ "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", "requires": { "ansi-regex": "^2.0.0" }, @@ -5035,7 +5035,7 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==" } } }, @@ -5103,9 +5103,9 @@ } }, "highlight.js": { - "version": "10.6.0", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.6.0.tgz", - "integrity": "sha512-8mlRcn5vk/r4+QcqerapwBYTe+iPL5ih6xrNylxrnBdHQiijDETfXX7VIxC3UiCRiINBJfANBAsPzAvRQj8RpQ==" + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==" }, "hosted-git-info": { "version": "2.8.8", @@ -7909,7 +7909,7 @@ "parent-require": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parent-require/-/parent-require-1.0.0.tgz", - "integrity": "sha1-dGoWdjgIOoYLDu9nMssn7UbDKXc=" + "integrity": "sha512-2MXDNZC4aXdkkap+rBBMv0lUsfJqvX5/2FiYYnfCnorZt3Pk06/IOR5KeaoghgS2w07MLWgjbsnyaq6PdHn2LQ==" }, "parse-bmfont-ascii": { "version": "1.0.6", @@ -9989,7 +9989,7 @@ "thenify-all": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", "requires": { "thenify": ">= 3.1.0 < 4" } @@ -10436,11 +10436,11 @@ }, "dependencies": { "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "requires": { - "ms": "2.1.2" + "ms": "^2.1.3" } }, "mkdirp": { @@ -10448,11 +10448,6 @@ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, "tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", @@ -10928,9 +10923,9 @@ "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" }, "y18n": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz", - "integrity": "sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg==" + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" }, "yallist": { "version": "4.0.0", @@ -10956,17 +10951,17 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==" }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==" }, "chalk": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", "requires": { "ansi-styles": "^2.2.1", "escape-string-regexp": "^1.0.2", @@ -10978,7 +10973,7 @@ "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", "requires": { "ansi-regex": "^2.0.0" } @@ -10986,7 +10981,7 @@ "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==" } } }, @@ -11005,9 +11000,9 @@ } }, "yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==" + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==" }, "yn": { "version": "3.1.1", diff --git a/package.json b/package.json index 0833e5a..b3b12d9 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "rxjs": "^7.8.0", "stimulsoft-reports-js": "^2021.1.1", "swagger-ui-express": "^4.6.3", - "typeorm": "^0.2.25", + "typeorm": "^0.2.30", "uuid": "^8.3.2" }, "devDependencies": { diff --git a/src/Auth/access-control/access-control.service.ts b/src/Auth/access-control/access-control.service.ts index 73233bc..458550c 100644 --- a/src/Auth/access-control/access-control.service.ts +++ b/src/Auth/access-control/access-control.service.ts @@ -5,6 +5,9 @@ https://docs.nestjs.com/providers#services import { Injectable } from '@nestjs/common'; import { connectionOptions } from 'src/configs/typeorm.config'; import { Connection } from 'typeorm'; +//import { DataSource } from 'typeorm'; +//import { EntityManager } from 'typeorm'; + import { IndexActions } from '../../domain/models/index-action.model'; @Injectable() diff --git a/src/app.module.ts b/src/app.module.ts index 7ebebcf..36c0614 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -37,6 +37,8 @@ import { AppService } from './app.service'; import { TypeOrmModule } from '@nestjs/typeorm'; import { typeOrmConfig } from './configs/typeorm.config'; import { Connection } from 'typeorm'; +//import { DataSource } from 'typeorm'; +//import { EntityManager } from 'typeorm'; import { DictionaryModule } from './backoffice/dictionary/dictionary.module'; import { ConfigModule } from '@nestjs/config/dist/config.module'; import { RedisModule } from './redis/redis.module'; @@ -99,7 +101,8 @@ import { RedisModule } from './redis/redis.module'; exports: [redisProvider], }) export class AppModule implements NestModule { - + + constructor(private connection: Connection) { } // eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars diff --git a/src/partner-range/partner-range.service.ts b/src/partner-range/partner-range.service.ts index beccd0c..83303f1 100644 --- a/src/partner-range/partner-range.service.ts +++ b/src/partner-range/partner-range.service.ts @@ -7,6 +7,9 @@ import { connectionOptions } from 'src/configs/typeorm.config'; import { Estfaixaparceiro } from 'src/domain/entity/tables/estfaixaparceiro.entity'; import { PartnerRange } from 'src/domain/models/partner-range.model'; import { Connection } from 'typeorm'; +//import { DataSource } from 'typeorm'; +import { EntityManager } from 'typeorm'; + @Injectable() export class PartnerRangeService { diff --git a/src/partner/partner.service.ts b/src/partner/partner.service.ts index 83639e3..b23f72b 100644 --- a/src/partner/partner.service.ts +++ b/src/partner/partner.service.ts @@ -10,6 +10,9 @@ import { Customer } from 'src/domain/models/customer.model'; import { Partner } from 'src/domain/models/partner.model'; import { CustomerService } from 'src/sales/customer/customer.service'; import { Connection } from 'typeorm'; +//import { DataSource } from 'typeorm'; +import { EntityManager } from 'typeorm'; + @Injectable() export class PartnerService { diff --git a/src/sales/address-customer/address-customer.service.ts b/src/sales/address-customer/address-customer.service.ts index 2a42580..850f6b9 100644 --- a/src/sales/address-customer/address-customer.service.ts +++ b/src/sales/address-customer/address-customer.service.ts @@ -1,6 +1,8 @@ import { HttpException, HttpStatus, Injectable } from '@nestjs/common'; import { Address } from 'src/domain/models/address.model'; import { Connection } from 'typeorm'; +//import { DataSource } from 'typeorm'; +import { EntityManager } from 'typeorm'; import { Pcclientendent } from '../../domain/entity/tables/pcclientendent.entity'; import { Pccidade } from '../../domain/entity/tables/pccidade.entity'; import { ResultModel } from 'src/domain/models/result.model'; diff --git a/src/sales/customer/customer.service.ts b/src/sales/customer/customer.service.ts index 1515fa4..9e93355 100644 --- a/src/sales/customer/customer.service.ts +++ b/src/sales/customer/customer.service.ts @@ -3,6 +3,8 @@ import { Injectable, HttpException } from '@nestjs/common'; import { connectionOptions } from '../../configs/typeorm.config'; import { Customer } from '../../domain/models/customer.model'; import { Connection } from 'typeorm'; +//import { DataSource } from 'typeorm'; +import { EntityManager } from 'typeorm'; import { Pcclient } from '../../domain/entity/tables/pcclient.entity'; import { Estcategoriacliente } from '../../domain/entity/tables/estcategoriacliente.entity'; import { Estsubcategoriacliente } from '../../domain/entity/tables/estsubcategoriacliente.entity'; @@ -183,18 +185,6 @@ export class CustomerService { default: throw new HttpException('Não foi informado um campo válido para pesquisa.', HttpStatus.BAD_REQUEST); } - /* - if (document){ - where += "REGEXP_REPLACE(\"pcclient\".cgcent, '[^0-9]', '') = REGEXP_REPLACE('"+document+"', '[^0-9]', '')"; - } - if (name){ - - if(where.length > 0) { - where += " AND \"pcclient\".cliente like '" + name + "%'"; - } else { - where += "\"pcclient\".cliente like '" + name + "%'"; - } - }*/ const connection = new Connection(connectionOptions); await connection.connect(); diff --git a/src/sales/dashboard/dashboard.service.ts b/src/sales/dashboard/dashboard.service.ts index 4b7c9c6..04b19fa 100644 --- a/src/sales/dashboard/dashboard.service.ts +++ b/src/sales/dashboard/dashboard.service.ts @@ -5,6 +5,9 @@ https://docs.nestjs.com/providers#services import { Injectable } from '@nestjs/common'; import { connectionOptions } from 'src/configs/typeorm.config'; import { Connection } from 'typeorm'; +//import { DataSource } from 'typeorm'; +//import { EntityManager } from 'typeorm'; + @Injectable() export class DashboardService { diff --git a/src/sales/pre-order/pre-order.service.ts b/src/sales/pre-order/pre-order.service.ts index 2545882..18a6983 100644 --- a/src/sales/pre-order/pre-order.service.ts +++ b/src/sales/pre-order/pre-order.service.ts @@ -7,6 +7,9 @@ import { Pcorcavendai } from 'src/domain/entity/tables/pcorcavendai.entity'; import { Cart } from 'src/domain/models/cart.model'; import { SharedService } from 'src/shared/services/shared.service'; import { Connection } from 'typeorm'; +//import { DataSource } from 'typeorm'; +import { EntityManager } from 'typeorm'; + import { Pcorcavendac } from '../../domain/entity/tables/pcorcavendac.entity'; import { Shopping } from '../../domain/entity/tables/estprevendac.entity'; import { connectionOptions } from 'src/configs/typeorm.config'; diff --git a/src/seller/seller.service.ts b/src/seller/seller.service.ts index e4a3181..04af24e 100644 --- a/src/seller/seller.service.ts +++ b/src/seller/seller.service.ts @@ -5,6 +5,9 @@ https://docs.nestjs.com/providers#services import { Injectable } from '@nestjs/common'; import { connectionOptions } from 'src/configs/typeorm.config'; import { Connection } from 'typeorm'; +//import { DataSource } from 'typeorm'; +import { EntityManager } from 'typeorm'; + @Injectable() export class SellerService { diff --git a/src/shared/services/shared.service.ts b/src/shared/services/shared.service.ts index d294182..7f566b7 100644 --- a/src/shared/services/shared.service.ts +++ b/src/shared/services/shared.service.ts @@ -8,6 +8,9 @@ import { Pcclient } from 'src/domain/entity/tables/pcclient.entity'; import { Store } from 'src/domain/entity/tables/pcfilial.entity'; import { Pctabtrib } from 'src/domain/entity/tables/pctabtrib.entity'; import { Connection } from 'typeorm'; +//import { DataSource } from 'typeorm'; +import { EntityManager } from 'typeorm'; + @Injectable() export class SharedService {