diff --git a/packages/stat-reporter/enums/index.ts b/packages/stat-reporter/enums/index.ts new file mode 100644 index 0000000..60d0a5d --- /dev/null +++ b/packages/stat-reporter/enums/index.ts @@ -0,0 +1 @@ +export * from './stat-cron-epxression.enum'; diff --git a/packages/stat-reporter/enums/stat-cron-epxression.enum.ts b/packages/stat-reporter/enums/stat-cron-epxression.enum.ts new file mode 100644 index 0000000..5a88f5e --- /dev/null +++ b/packages/stat-reporter/enums/stat-cron-epxression.enum.ts @@ -0,0 +1,62 @@ +export enum StatCronExpression { + EVERY_MINUTE = "*/1 * * * *", + EVERY_2_MINUTES = "*/2 * * * *", + EVERY_3_MINUTES = "*/3 * * * *", + EVERY_4_MINUTES = "*/4 * * * *", + EVERY_5_MINUTES = "*/5 * * * *", + EVERY_6_MINUTES = "*/6 * * * *", + EVERY_7_MINUTES = "*/7 * * * *", + EVERY_8_MINUTES = "*/8 * * * *", + EVERY_9_MINUTES = "*/9 * * * *", + EVERY_10_MINUTES = "*/10 * * * *", + EVERY_11_MINUTES = "*/11 * * * *", + EVERY_12_MINUTES = "*/12 * * * *", + EVERY_13_MINUTES = "*/13 * * * *", + EVERY_14_MINUTES = "*/14 * * * *", + EVERY_15_MINUTES = "*/15 * * * *", + EVERY_16_MINUTES = "*/16 * * * *", + EVERY_17_MINUTES = "*/17 * * * *", + EVERY_18_MINUTES = "*/18 * * * *", + EVERY_19_MINUTES = "*/19 * * * *", + EVERY_20_MINUTES = "*/20 * * * *", + EVERY_21_MINUTES = "*/21 * * * *", + EVERY_22_MINUTES = "*/22 * * * *", + EVERY_23_MINUTES = "*/23 * * * *", + EVERY_24_MINUTES = "*/24 * * * *", + EVERY_25_MINUTES = "*/25 * * * *", + EVERY_26_MINUTES = "*/26 * * * *", + EVERY_27_MINUTES = "*/27 * * * *", + EVERY_28_MINUTES = "*/28 * * * *", + EVERY_29_MINUTES = "*/29 * * * *", + EVERY_30_MINUTES = "*/30 * * * *", + EVERY_31_MINUTES = "*/31 * * * *", + EVERY_32_MINUTES = "*/32 * * * *", + EVERY_33_MINUTES = "*/33 * * * *", + EVERY_34_MINUTES = "*/34 * * * *", + EVERY_35_MINUTES = "*/35 * * * *", + EVERY_36_MINUTES = "*/36 * * * *", + EVERY_37_MINUTES = "*/37 * * * *", + EVERY_38_MINUTES = "*/38 * * * *", + EVERY_39_MINUTES = "*/39 * * * *", + EVERY_40_MINUTES = "*/40 * * * *", + EVERY_41_MINUTES = "*/41 * * * *", + EVERY_42_MINUTES = "*/42 * * * *", + EVERY_43_MINUTES = "*/43 * * * *", + EVERY_44_MINUTES = "*/44 * * * *", + EVERY_45_MINUTES = "*/45 * * * *", + EVERY_46_MINUTES = "*/46 * * * *", + EVERY_47_MINUTES = "*/47 * * * *", + EVERY_48_MINUTES = "*/48 * * * *", + EVERY_49_MINUTES = "*/49 * * * *", + EVERY_50_MINUTES = "*/50 * * * *", + EVERY_51_MINUTES = "*/51 * * * *", + EVERY_52_MINUTES = "*/52 * * * *", + EVERY_53_MINUTES = "*/53 * * * *", + EVERY_54_MINUTES = "*/54 * * * *", + EVERY_55_MINUTES = "*/55 * * * *", + EVERY_56_MINUTES = "*/56 * * * *", + EVERY_57_MINUTES = "*/57 * * * *", + EVERY_58_MINUTES = "*/58 * * * *", + EVERY_59_MINUTES = "*/59 * * * *", + EVERY_HOUR = "* */1 * * *" +} diff --git a/packages/stat-reporter/index.ts b/packages/stat-reporter/index.ts index a4a8610..117be87 100644 --- a/packages/stat-reporter/index.ts +++ b/packages/stat-reporter/index.ts @@ -1,3 +1,4 @@ +export * from './enums'; export * from './interfaces'; export * from './nestcord-stat-reporter.module'; diff --git a/packages/stat-reporter/interfaces/nestcord-stat-reporter-options.interface.ts b/packages/stat-reporter/interfaces/nestcord-stat-reporter-options.interface.ts index 02fb9bd..c8d37e3 100644 --- a/packages/stat-reporter/interfaces/nestcord-stat-reporter-options.interface.ts +++ b/packages/stat-reporter/interfaces/nestcord-stat-reporter-options.interface.ts @@ -1,5 +1,5 @@ -import { CronExpression } from '@nestjs/schedule'; -import { AxiosHeaders, Method, RawAxiosRequestHeaders } from 'axios'; +import { Method, RawAxiosRequestHeaders } from 'axios'; +import { StatCronExpression } from '../enums'; export interface ServiceOption { /** @@ -34,9 +34,10 @@ export interface ServiceOption { /** * Crontab expression - * @returns CronExpression + * @returns StatCronExpression + * @returns string */ - schedule?: CronExpression; + schedule?: StatCronExpression | string; } export interface NestCordStatReporterOptions {