Socket
Socket
Sign inDemoInstall

@nestjs/schedule

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nestjs/schedule - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

20

dist/decorators/cron.decorator.d.ts

@@ -0,7 +1,27 @@

/**
* @ref https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/cron/index.d.ts
*/
export interface CronOptions {
/**
* Specify the name of your cron job. This will allow to inject your cron job reference through `@InjectCronRef`.
*/
name?: string;
/**
* Specify the timezone for the execution. This will modify the actual time relative to your timezone. If the timezone is invalid, an error is thrown. You can check all timezones available at [Moment Timezone Website](http://momentjs.com/timezone/). Probably don't use both ```timeZone``` and ```utcOffset``` together or weird things may happen.
*/
timeZone?: string;
/**
* This allows you to specify the offset of your timezone rather than using the ```timeZone``` param. Probably don't use both ```timeZone``` and ```utcOffset``` together or weird things may happen.
*/
utcOffset?: string | number;
/**
* If you have code that keeps the event loop running and want to stop the node process when that finishes regardless of the state of your cronjob, you can do so making use of this parameter. This is off by default and cron will run as if it needs to control the event loop. For more information take a look at [timers#timers_timeout_unref](https://nodejs.org/api/timers.html#timers_timeout_unref) from the NodeJS docs.
*/
unrefTimeout?: boolean;
}
/**
* Creates a scheduled job.
* @param cronTime The time to fire off your job. This can be in the form of cron syntax or a JS ```Date``` object.
* @param options Job execution options.
*/
export declare function Cron(cronTime: string | Date, options?: CronOptions): MethodDecorator;

@@ -7,2 +7,7 @@ "use strict";

const schedule_constants_1 = require("../schedule.constants");
/**
* Creates a scheduled job.
* @param cronTime The time to fire off your job. This can be in the form of cron syntax or a JS ```Date``` object.
* @param options Job execution options.
*/
function Cron(cronTime, options = {}) {

@@ -9,0 +14,0 @@ const name = options && options.name;

@@ -0,2 +1,8 @@

/**
* Schedules an interval (`setInterval`).
*/
export declare function Interval(timeout: number): MethodDecorator;
/**
* Schedules an interval (`setInterval`).
*/
export declare function Interval(name: string, timeout: number): MethodDecorator;

3

dist/decorators/interval.decorator.js

@@ -8,2 +8,5 @@ "use strict";

const schedule_constants_1 = require("../schedule.constants");
/**
* Schedules an interval (`setInterval`).
*/
function Interval(nameOrTimeout, timeout) {

@@ -10,0 +13,0 @@ const [name, intervalTimeout] = (0, util_1.isString)(nameOrTimeout)

@@ -0,2 +1,8 @@

/**
* Schedules an timeout (`setTimeout`).
*/
export declare function Timeout(timeout: number): MethodDecorator;
/**
* Schedules an timeout (`setTimeout`).
*/
export declare function Timeout(name: string, timeout: number): MethodDecorator;

@@ -8,2 +8,5 @@ "use strict";

const schedule_constants_1 = require("../schedule.constants");
/**
* Schedules an timeout (`setTimeout`).
*/
function Timeout(nameOrTimeout, timeout) {

@@ -10,0 +13,0 @@ const [name, timeoutValue] = (0, util_1.isString)(nameOrTimeout)

3

dist/schedule.explorer.d.ts
import { OnModuleInit } from '@nestjs/common';
import { DiscoveryService } from '@nestjs/core';
import { DiscoveryService, MetadataScanner } from '@nestjs/core';
import { InstanceWrapper } from '@nestjs/core/injector/instance-wrapper';
import { MetadataScanner } from '@nestjs/core/metadata-scanner';
import { SchedulerMetadataAccessor } from './schedule-metadata.accessor';

@@ -6,0 +5,0 @@ import { SchedulerOrchestrator } from './scheduler.orchestrator';

@@ -24,3 +24,2 @@ "use strict";

const core_1 = require("@nestjs/core");
const metadata_scanner_1 = require("@nestjs/core/metadata-scanner");
const scheduler_type_enum_1 = require("./enums/scheduler-type.enum");

@@ -112,4 +111,4 @@ const schedule_metadata_accessor_1 = require("./schedule-metadata.accessor");

schedule_metadata_accessor_1.SchedulerMetadataAccessor,
metadata_scanner_1.MetadataScanner])
core_1.MetadataScanner])
], ScheduleExplorer);
exports.ScheduleExplorer = ScheduleExplorer;

@@ -6,3 +6,7 @@ import { CronJob } from 'cron';

private readonly intervals;
doesExists(type: 'cron' | 'timeout' | 'interval', name: string): boolean;
/**
* @deprecated Use the `doesExist` method instead.
*/
doesExists: (type: 'cron' | 'timeout' | 'interval', name: string) => boolean;
doesExist(type: 'cron' | 'timeout' | 'interval', name: string): boolean;
getCronJob(name: string): CronJob;

@@ -9,0 +13,0 @@ getInterval(name: string): any;

@@ -17,4 +17,9 @@ "use strict";

this.intervals = new Map();
/**
* @deprecated Use the `doesExist` method instead.
*/
// TODO(v2): drop this.
this.doesExists = this.doesExist;
}
doesExists(type, name) {
doesExist(type, name) {
switch (type) {

@@ -21,0 +26,0 @@ case 'cron':

{
"name": "@nestjs/schedule",
"version": "1.0.2",
"version": "1.1.0",
"description": "Nest - modern, fast, powerful node.js web framework (@schedule)",

@@ -21,33 +21,33 @@ "author": "Kamil Mysliwiec",

"dependencies": {
"cron": "1.7.2",
"cron": "1.8.2",
"uuid": "8.3.2"
},
"devDependencies": {
"@commitlint/cli": "14.1.0",
"@commitlint/config-angular": "14.1.0",
"@nestjs/common": "8.2.0",
"@nestjs/core": "8.2.0",
"@nestjs/platform-express": "8.2.0",
"@nestjs/testing": "8.2.0",
"@types/cron": "1.7.2",
"@types/jest": "27.0.2",
"@types/node": "16.11.7",
"@types/sinon": "10.0.6",
"@types/uuid": "8.3.1",
"@typescript-eslint/eslint-plugin": "5.4.0",
"@typescript-eslint/parser": "5.4.0",
"eslint": "8.2.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-import": "2.25.3",
"@commitlint/cli": "16.2.3",
"@commitlint/config-angular": "16.2.3",
"@nestjs/common": "8.4.3",
"@nestjs/core": "8.4.3",
"@nestjs/platform-express": "8.4.3",
"@nestjs/testing": "8.4.3",
"@types/cron": "1.7.3",
"@types/jest": "27.4.1",
"@types/node": "16.11.26",
"@types/sinon": "10.0.11",
"@types/uuid": "8.3.4",
"@typescript-eslint/eslint-plugin": "5.17.0",
"@typescript-eslint/parser": "5.17.0",
"eslint": "8.12.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.25.4",
"husky": "7.0.4",
"jest": "27.3.1",
"lint-staged": "12.0.2",
"prettier": "2.4.1",
"jest": "27.5.1",
"lint-staged": "12.3.7",
"prettier": "2.6.1",
"reflect-metadata": "0.1.13",
"release-it": "14.11.7",
"release-it": "14.13.1",
"rimraf": "3.0.2",
"rxjs": "7.4.0",
"sinon": "12.0.1",
"ts-jest": "27.0.7",
"typescript": "4.4.4"
"rxjs": "7.5.5",
"sinon": "13.0.1",
"ts-jest": "27.1.4",
"typescript": "4.6.3"
},

@@ -54,0 +54,0 @@ "peerDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc