1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-11 00:08:30 +01:00

fix: more types

This commit is contained in:
Ivar Conradi Østhus 2021-05-02 21:11:17 +02:00
parent 4b48c08e0e
commit 841e2a6e07
No known key found for this signature in database
GPG Key ID: 31AC596886B0BD09
16 changed files with 23 additions and 18 deletions

View File

@ -1,6 +1,6 @@
import { EventEmitter } from 'events';
import { Knex } from 'knex';
import metricsHelper from '../metrics-helper';
import metricsHelper from '../util/metrics-helper';
import { DB_TIME } from '../metric-events';
const T = {

View File

@ -1,6 +1,6 @@
'use strict';
const metricsHelper = require('../metrics-helper');
const metricsHelper = require('../util/metrics-helper');
const { DB_TIME } = require('../metric-events');
const NotFoundError = require('../error/notfound-error');

View File

@ -1,6 +1,6 @@
import { EventEmitter } from 'events';
import { Knex } from 'knex';
import metricsHelper from '../metrics-helper';
import metricsHelper from '../util/metrics-helper';
import { DB_TIME } from '../metric-events';
import { Logger, LogProvider } from '../logger';
import NotFoundError from '../error/notfound-error';

View File

@ -2,7 +2,7 @@
'use strict';
const metricsHelper = require('../metrics-helper');
const metricsHelper = require('../util/metrics-helper');
const { DB_TIME } = require('../metric-events');
const COLUMNS = [

View File

@ -1,7 +1,7 @@
'use strict';
const { EventEmitter } = require('events');
const metricsHelper = require('../metrics-helper');
const metricsHelper = require('../util/metrics-helper');
const { DB_TIME } = require('../metric-events');
const TEN_SECONDS = 10 * 1000;

View File

@ -1,6 +1,6 @@
'use strict';
const metricsHelper = require('../metrics-helper');
const metricsHelper = require('../util/metrics-helper');
const { DB_TIME } = require('../metric-events');
const NotFoundError = require('../error/notfound-error');
const FeatureHasTagError = require('../error/feature-has-tag-error');

View File

@ -1,6 +1,6 @@
import { EventEmitter } from 'events';
import { Knex } from 'knex';
import metricsHelper from '../metrics-helper';
import metricsHelper from '../util/metrics-helper';
import { DB_TIME } from '../metric-events';
import { Logger, LogProvider } from '../logger';
import NotFoundError from '../error/notfound-error';

View File

@ -3,7 +3,7 @@
import { Knex } from 'knex';
import { EventEmitter } from 'events';
import { DB_TIME } from '../metric-events';
import metricsHelper from '../metrics-helper';
import metricsHelper from '../util/metrics-helper';
import { LogProvider, Logger } from '../logger';
import NotFoundError from '../error/notfound-error';

View File

@ -2,7 +2,7 @@ import { Knex } from 'knex';
import { EventEmitter } from 'events';
import { LogProvider, Logger } from '../logger';
import { DB_TIME } from '../metric-events';
import metricsHelper from '../metrics-helper';
import metricsHelper from '../util/metrics-helper';
import NotFoundError from '../error/notfound-error';
const COLUMNS = ['name', 'description', 'icon'];

View File

@ -1,13 +1,16 @@
'use strict';
const {
import EventEmitter from 'node:events';
import { EventHook } from './types/option';
import {
FEATURE_CREATED,
FEATURE_UPDATED,
FEATURE_ARCHIVED,
FEATURE_REVIVED,
} = require('./types/events');
} from './types/events';
exports.addEventHook = (eventHook, eventStore) => {
export const addEventHook = (
eventHook: EventHook,
eventStore: EventEmitter,
): void => {
eventStore.on(FEATURE_CREATED, data => {
eventHook(FEATURE_CREATED, data);
});

View File

@ -7,7 +7,7 @@ import { IUnleashServices } from '../../types/services';
const Controller = require('../controller');
const extractUser = require('../../extract-user');
const { UPDATE_FEATURE } = require('../../permissions');
const { UPDATE_FEATURE } = require('../../types/permissions');
export default class ArchiveController extends Controller {
constructor(

View File

@ -13,7 +13,7 @@ const {
DELETE_STRATEGY,
CREATE_STRATEGY,
UPDATE_STRATEGY,
} = require('../../permissions');
} = require('../../types/permissions');
const version = 1;

View File

@ -1,5 +1,7 @@
import { LogLevel, LogProvider } from '../logger';
export type EventHook = (eventName: string, data: object) => void;
export interface ISSLOption {
rejectUnauthorized: boolean;
ca?: string;
@ -88,7 +90,7 @@ export interface IUnleashOptions {
enableOAS?: boolean;
preHook?: Function;
preRouterHook?: Function;
eventHook?: Function;
eventHook?: EventHook;
enterpriseVersion?: string;
}
@ -127,6 +129,6 @@ export interface IUnleashConfig {
enableOAS: boolean;
preHook?: Function;
preRouterHook?: Function;
eventHook?: Function;
eventHook?: EventHook;
enterpriseVersion?: string;
}