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:
parent
4b48c08e0e
commit
841e2a6e07
@ -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 = {
|
||||
|
@ -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');
|
||||
|
||||
|
@ -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';
|
||||
|
@ -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 = [
|
||||
|
@ -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;
|
||||
|
@ -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');
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
||||
|
@ -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'];
|
||||
|
@ -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);
|
||||
});
|
@ -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(
|
||||
|
@ -13,7 +13,7 @@ const {
|
||||
DELETE_STRATEGY,
|
||||
CREATE_STRATEGY,
|
||||
UPDATE_STRATEGY,
|
||||
} = require('../../permissions');
|
||||
} = require('../../types/permissions');
|
||||
|
||||
const version = 1;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user