@defer/client
Advanced tools
Comparing version 1.12.1 to 1.13.0-alpha-20231011101210-5613d53
@@ -29,3 +29,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.rescheduleExecution = exports.getExecutionTries = exports.cancelExecution = exports.getExecution = exports.awaitResult = exports.discardAfter = exports.addMetadata = exports.delay = exports.defer = exports.deferEnabled = exports.__database = void 0; | ||
exports.rescheduleExecution = exports.getExecutionTries = exports.cancelExecution = exports.getExecution = exports.awaitResult = exports.assignOptions = exports.discardAfter = exports.addMetadata = exports.delay = exports.defer = exports.deferEnabled = exports.__database = void 0; | ||
const parse_duration_1 = __importDefault(require("parse-duration")); | ||
@@ -220,2 +220,12 @@ const client = __importStar(require("./client.js")); | ||
exports.discardAfter = discardAfter; | ||
function assignOptions(fn, options) { | ||
const wrapped = async function (...args) { | ||
return enqueue(wrapped, ...args); | ||
}; | ||
wrapped.__fn = fn.__fn; | ||
wrapped.__metadata = fn.__metadata; | ||
wrapped.__execOptions = { ...fn.__execOptions, ...options }; | ||
return wrapped; | ||
} | ||
exports.assignOptions = assignOptions; | ||
function awaitResult(fn) { | ||
@@ -222,0 +232,0 @@ return async function (...args) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = "1.12.1"; | ||
exports.default = "1.13.0-alpha-20231011101210-5613d53"; |
@@ -185,2 +185,11 @@ import parseDuration from "parse-duration"; | ||
} | ||
export function assignOptions(fn, options) { | ||
const wrapped = async function (...args) { | ||
return enqueue(wrapped, ...args); | ||
}; | ||
wrapped.__fn = fn.__fn; | ||
wrapped.__metadata = fn.__metadata; | ||
wrapped.__execOptions = { ...fn.__execOptions, ...options }; | ||
return wrapped; | ||
} | ||
export function awaitResult(fn) { | ||
@@ -187,0 +196,0 @@ return async function (...args) { |
@@ -1,1 +0,1 @@ | ||
export default "1.12.1"; | ||
export default "1.13.0-alpha-20231011101210-5613d53"; |
{ | ||
"name": "@defer/client", | ||
"version": "1.12.1", | ||
"version": "1.13.0-alpha-20231011101210-5613d53", | ||
"description": "Zero infrastructure NodeJS background jobs", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -65,2 +65,3 @@ import { Units } from "parse-duration"; | ||
export declare function discardAfter<F extends DeferableFunction>(fn: DeferredFunction<F>, value: Duration | Date): DeferredFunction<F>; | ||
export declare function assignOptions<F extends DeferableFunction>(fn: DeferredFunction<F>, options: ExecutionOptions): DeferredFunction<F>; | ||
export declare function awaitResult<F extends DeferableFunction>(fn: DeferredFunction<F>): (...args: Parameters<F>) => Promise<Awaited<ReturnType<F>>>; | ||
@@ -67,0 +68,0 @@ export declare function getExecution(id: string): Promise<client.FetchExecutionResponse>; |
@@ -1,2 +0,2 @@ | ||
declare const _default: "1.12.1"; | ||
declare const _default: "1.13.0-alpha-20231011101210-5613d53"; | ||
export default _default; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
67063
1461
6
2