mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-09 01:49:37 -06:00
Merge branch 'hotfix/2.3.3' into develop
This commit is contained in:
commit
f602ba343f
15
.eslintrc.js
15
.eslintrc.js
@ -26,21 +26,14 @@ module.exports = {
|
|||||||
'@typescript-eslint/no-explicit-any': 'off',
|
'@typescript-eslint/no-explicit-any': 'off',
|
||||||
'@typescript-eslint/no-empty-function': 'off',
|
'@typescript-eslint/no-empty-function': 'off',
|
||||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||||
'@typescript-eslint/no-unused-vars': 'error',
|
'@typescript-eslint/no-unused-vars': 'warn',
|
||||||
'import/first': 'error',
|
'import/first': 'error',
|
||||||
'import/no-duplicates': 'error',
|
'import/no-duplicates': 'error',
|
||||||
'simple-import-sort/imports': 'error',
|
'simple-import-sort/imports': 'error',
|
||||||
'simple-import-sort/exports': 'error',
|
'simple-import-sort/exports': 'error',
|
||||||
'@typescript-eslint/ban-types': [
|
'@typescript-eslint/no-empty-object-type': 'off',
|
||||||
'error',
|
'@typescript-eslint/no-wrapper-object-types': 'off',
|
||||||
{
|
'@typescript-eslint/no-unused-expressions': 'off',
|
||||||
extendDefaults: true,
|
|
||||||
types: {
|
|
||||||
'{}': false,
|
|
||||||
Object: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
'prettier/prettier': ['error', { endOfLine: 'auto' }],
|
'prettier/prettier': ['error', { endOfLine: 'auto' }],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -105,7 +105,7 @@ export class EventManager {
|
|||||||
instanceName: string;
|
instanceName: string;
|
||||||
origin: string;
|
origin: string;
|
||||||
event: string;
|
event: string;
|
||||||
data: Object;
|
data: object;
|
||||||
serverUrl: string;
|
serverUrl: string;
|
||||||
dateTime: string;
|
dateTime: string;
|
||||||
sender: string;
|
sender: string;
|
||||||
|
|||||||
@ -431,7 +431,7 @@ export class ChannelStartupService {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async sendDataWebhook<T = any>(event: Events, data: T, local = true, integration?: string[]) {
|
public async sendDataWebhook<T extends object = any>(event: Events, data: T, local = true, integration?: string[]) {
|
||||||
const serverUrl = this.configService.get<HttpServer>('SERVER').URL;
|
const serverUrl = this.configService.get<HttpServer>('SERVER').URL;
|
||||||
const tzoffset = new Date().getTimezoneOffset() * 60000; //offset in milliseconds
|
const tzoffset = new Date().getTimezoneOffset() * 60000; //offset in milliseconds
|
||||||
const localISOTime = new Date(Date.now() - tzoffset).toISOString();
|
const localISOTime = new Date(Date.now() - tzoffset).toISOString();
|
||||||
|
|||||||
4
src/cache/localcache.ts
vendored
4
src/cache/localcache.ts
vendored
@ -53,7 +53,7 @@ export class LocalCache implements ICache {
|
|||||||
|
|
||||||
async hGet(key: string, field: string) {
|
async hGet(key: string, field: string) {
|
||||||
try {
|
try {
|
||||||
const data = LocalCache.localCache.get(this.buildKey(key)) as Object;
|
const data = LocalCache.localCache.get(this.buildKey(key)) as object;
|
||||||
|
|
||||||
if (data && field in data) {
|
if (data && field in data) {
|
||||||
return JSON.parse(data[field], BufferJSON.reviver);
|
return JSON.parse(data[field], BufferJSON.reviver);
|
||||||
@ -84,7 +84,7 @@ export class LocalCache implements ICache {
|
|||||||
|
|
||||||
async hDelete(key: string, field: string) {
|
async hDelete(key: string, field: string) {
|
||||||
try {
|
try {
|
||||||
const data = LocalCache.localCache.get(this.buildKey(key)) as Object;
|
const data = LocalCache.localCache.get(this.buildKey(key)) as object;
|
||||||
|
|
||||||
if (data && field in data) {
|
if (data && field in data) {
|
||||||
delete data[field];
|
delete data[field];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user