/*! * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { QueryType } from '../query'; import { TaskStatus } from './types'; /** * Expressions representing various properties of a task useful for filtering * or projection expressions in operations like {@link TaskClient.list}, {@link * TaskClient.listSummary}, {@link TaskClient.iterate}, {@link * TaskClient.iterateSummary} and more. * * @public */ declare namespace t { /** * Unique identifier for the task * * @public */ const id: QueryType.StringProperty; /** * The type (grouping) for the task * * @public */ const type: QueryType.StringProperty; /** * Indicates whether the task is eligible for processing * * @public */ const enabled: QueryType.BooleanProperty; /** * Unix ms epoch representing the time when the task was first created * * @public */ const createTime: QueryType.NumericProperty; /** * Unix ms epoch representing the next time the task should be processed. * Can be earlier than the current time if the task is pending or currently * running and is undefined if the task is not running and has no future * runs scheduled. * * @public */ const nextRunTime: QueryType.NumericProperty; /** * Unix ms epoch representing the last time the task was updated, either * explicitly or as part of processing. */ const lastUpdatedTime: QueryType.NumericProperty; /** * Metadata about the most recent completed/failed run of the task. If the * task has neither failed a run, this is undefined. * * @public */ const lastRun: QueryType.ObjectProperty; /** * Unix ms epoch representing when the most recent run began processing. If * the task has neither completed nor failed a run, this is undefined. * * @public */ const lastRunStartTime: QueryType.NumericProperty; /** * Unix ms epoch representing when the last run finished processing. If the * task has neither completed nor failed a run, this is undefined. * * @public */ const lastRunFinishTime: QueryType.NumericProperty; /** * Boolean indicating whether or not the most recent run succeeded or * failed. If the task has neither completed nor failed a run, this is * undefined. * * @public */ const lastRunSucceeded: QueryType.BooleanProperty; /** * Number of times the task has been delivered for processing. This number * only includes deliveries that are not currently running and resets after * each time the task completes or fails a run. * * @public */ const deliveries: QueryType.NumericProperty; /** * Number of times task processing has been attempted unsuccessfully. This * number only includes attempts that are not currently running and resets * after each time the task completes or fails a run. It is similar to * deliveries but only increments for results that indicate some sort of * failure. These include calling {@link ActiveTask.retry} and when the * task's lock expires. * * @public */ const attempts: QueryType.NumericProperty; /** * Number of times task processing has run to completion, regardless of * whether they ultimately succeeded or failed. This number only includes * previously completed runs. For one-time tasks, this will only ever be 0 * or 1, but can be arbitrarily large for recurring tasks that have run many * times. * * @public */ const runs: QueryType.NumericProperty; /** * If defined, the schedule on which to run the task. If it is a number, it * represents the number of milliseconds between each run of the task. If it * is a string, it is a cron string indicating the schedule on which to run. * * @public */ const interval: QueryType.Property; /** * User-defined payload holding information about the task. If called with * no arguments, it points to the entire payload. However, you can also * reference portions of the payload by providing arguments to the function. * Each argument represents a property name or array index that, when * combined, form a path to a property in the payload. * * @example Retrieve the full payload * * ```ts * t.payload() * ``` * * @example Retrieve payload.prop[2] * * ```ts * t.payload('prop', 2) * ``` * * @public */ const payload: (...path: (string | number)[]) => QueryType.Property; /** * Status is a derived property. It does not behave as a property because it * is computed dynamically, but this helper can be used to determine whether * the status belongs to each of the possible states. * * @param status - Status to check the task for * * @public */ const hasStatus: (status: TaskStatus) => QueryType.Bool; } export default t; //# sourceMappingURL=properties.d.ts.map