BackstageClient.taskQueues
BackstageClient.taskQueues in @ticketlayer/backstage.
@ticketlayer/backstage / BackstageClient / taskQueues
taskQueues: {
create: (request: {
accountId?: string | null;
defaultDueMinutes?: number | null;
defaultPriority?: "low" | "normal" | "high" | "urgent" | null;
description?: string | null;
members?: {
id: string;
type: "user" | "role" | "account";
}[];
name: string;
taskTypes?: string[];
}, requestOptions?: RequestOptions) => Promise<{
accountId: string | null;
createdAt: string;
defaultDueMinutes: number | null;
defaultPriority: "low" | "normal" | "high" | "urgent" | null;
description: string | null;
id: string;
isArchived: boolean;
isMember: boolean;
members: {
id: string;
type: "user" | "role" | "account";
}[];
name: string;
organisationId: string;
taskTypes: string[];
updatedAt: string;
}>;
get: (queueId: string, requestOptions?: RequestOptions) => Promise<{
accountId: string | null;
createdAt: string;
defaultDueMinutes: number | null;
defaultPriority: "low" | "normal" | "high" | "urgent" | null;
description: string | null;
id: string;
isArchived: boolean;
isMember: boolean;
members: {
id: string;
type: "user" | "role" | "account";
}[];
name: string;
organisationId: string;
taskTypes: string[];
updatedAt: string;
}>;
list: (options?: {
includeArchived?: "true" | "false";
}, requestOptions?: RequestOptions) => Promise<{
accountId: string | null;
createdAt: string;
defaultDueMinutes: number | null;
defaultPriority: "low" | "normal" | "high" | "urgent" | null;
description: string | null;
id: string;
isArchived: boolean;
isMember: boolean;
members: {
id: string;
type: "user" | "role" | "account";
}[];
name: string;
organisationId: string;
taskTypes: string[];
updatedAt: string;
}[]>;
update: (queueId: string, request: {
defaultDueMinutes?: number | null;
defaultPriority?: "low" | "normal" | "high" | "urgent" | null;
description?: string | null;
isArchived?: boolean;
members?: {
id: string;
type: "user" | "role" | "account";
}[];
name?: string;
taskTypes?: string[];
}, requestOptions?: RequestOptions) => Promise<{
accountId: string | null;
createdAt: string;
defaultDueMinutes: number | null;
defaultPriority: "low" | "normal" | "high" | "urgent" | null;
description: string | null;
id: string;
isArchived: boolean;
isMember: boolean;
members: {
id: string;
type: "user" | "role" | "account";
}[];
name: string;
organisationId: string;
taskTypes: string[];
updatedAt: string;
}>;
};Defined in: client.ts:11533
Task Queues methods
create()#
create: (request: {
accountId?: string | null;
defaultDueMinutes?: number | null;
defaultPriority?: "low" | "normal" | "high" | "urgent" | null;
description?: string | null;
members?: {
id: string;
type: "user" | "role" | "account";
}[];
name: string;
taskTypes?: string[];
}, requestOptions?: RequestOptions) => Promise<{
accountId: string | null;
createdAt: string;
defaultDueMinutes: number | null;
defaultPriority: "low" | "normal" | "high" | "urgent" | null;
description: string | null;
id: string;
isArchived: boolean;
isMember: boolean;
members: {
id: string;
type: "user" | "role" | "account";
}[];
name: string;
organisationId: string;
taskTypes: string[];
updatedAt: string;
}>;Create a task queue
A queue tasks wait in: its members (people, roles, accounts), the task types routed to it, and a default priority and deadline. An account's queue takes that account's tasks; the organisation's own (accountId null) takes any account's. Needs taskqueues.manage for the account (the organisation's own at :all).
Parameters#
| Parameter | Type | Description |
|---|---|---|
request | { accountId?: string | null; defaultDueMinutes?: number | null; defaultPriority?: "low" | "normal" | "high" | "urgent" | null; description?: string | null; members?: { id: string; type: "user" | "role" | "account"; }[]; name: string; taskTypes?: string[]; } | - |
request.accountId? | string | null | Description The account the queue is for; null for the organisation's own (which takes every account's tasks and needs taskqueues.manage at :all). Defaults to your one account, else the organisation. |
request.defaultDueMinutes? | number | null | Description A task raised into the queue is due this many minutes later, unless it names a deadline. |
request.defaultPriority? | "low" | "normal" | "high" | "urgent" | null | |
request.description? | string | null | - |
request.members? | { id: string; type: "user" | "role" | "account"; }[] | - |
request.name? | string | Example Payments |
request.taskTypes? | string[] | Description New tasks of these types land in this queue. Example [ "payment.review", "payout.failed" ] |
requestOptions? | RequestOptions | - |
Returns#
Promise<{
accountId: string | null;
createdAt: string;
defaultDueMinutes: number | null;
defaultPriority: "low" | "normal" | "high" | "urgent" | null;
description: string | null;
id: string;
isArchived: boolean;
isMember: boolean;
members: {
id: string;
type: "user" | "role" | "account";
}[];
name: string;
organisationId: string;
taskTypes: string[];
updatedAt: string;
}>
Operation Id#
createTaskQueue
get()#
get: (queueId: string, requestOptions?: RequestOptions) => Promise<{
accountId: string | null;
createdAt: string;
defaultDueMinutes: number | null;
defaultPriority: "low" | "normal" | "high" | "urgent" | null;
description: string | null;
id: string;
isArchived: boolean;
isMember: boolean;
members: {
id: string;
type: "user" | "role" | "account";
}[];
name: string;
organisationId: string;
taskTypes: string[];
updatedAt: string;
}>;Get a task queue
Parameters#
| Parameter | Type |
|---|---|
queueId | string |
requestOptions? | RequestOptions |
Returns#
Promise<{
accountId: string | null;
createdAt: string;
defaultDueMinutes: number | null;
defaultPriority: "low" | "normal" | "high" | "urgent" | null;
description: string | null;
id: string;
isArchived: boolean;
isMember: boolean;
members: {
id: string;
type: "user" | "role" | "account";
}[];
name: string;
organisationId: string;
taskTypes: string[];
updatedAt: string;
}>
Operation Id#
getTaskQueue
list()#
list: (options?: {
includeArchived?: "true" | "false";
}, requestOptions?: RequestOptions) => Promise<{
accountId: string | null;
createdAt: string;
defaultDueMinutes: number | null;
defaultPriority: "low" | "normal" | "high" | "urgent" | null;
description: string | null;
id: string;
isArchived: boolean;
isMember: boolean;
members: {
id: string;
type: "user" | "role" | "account";
}[];
name: string;
organisationId: string;
taskTypes: string[];
updatedAt: string;
}[]>;List task queues
The queues of the accounts your tasks.read reaches (the organisation's own at :all), by name, each saying whether you are a member. Archived ones with includeArchived=true.
Parameters#
| Parameter | Type |
|---|---|
options? | { includeArchived?: "true" | "false"; } |
options.includeArchived? | "true" | "false" |
requestOptions? | RequestOptions |
Returns#
Promise<{
accountId: string | null;
createdAt: string;
defaultDueMinutes: number | null;
defaultPriority: "low" | "normal" | "high" | "urgent" | null;
description: string | null;
id: string;
isArchived: boolean;
isMember: boolean;
members: {
id: string;
type: "user" | "role" | "account";
}[];
name: string;
organisationId: string;
taskTypes: string[];
updatedAt: string;
}[]>
Operation Id#
listTaskQueues
update()#
update: (queueId: string, request: {
defaultDueMinutes?: number | null;
defaultPriority?: "low" | "normal" | "high" | "urgent" | null;
description?: string | null;
isArchived?: boolean;
members?: {
id: string;
type: "user" | "role" | "account";
}[];
name?: string;
taskTypes?: string[];
}, requestOptions?: RequestOptions) => Promise<{
accountId: string | null;
createdAt: string;
defaultDueMinutes: number | null;
defaultPriority: "low" | "normal" | "high" | "urgent" | null;
description: string | null;
id: string;
isArchived: boolean;
isMember: boolean;
members: {
id: string;
type: "user" | "role" | "account";
}[];
name: string;
organisationId: string;
taskTypes: string[];
updatedAt: string;
}>;Update a task queue
Edit a queue. members, when sent, replaces the list. Archiving a queue is refused while tasks wait in it (409 TASK_QUEUE_NOT_EMPTY). Needs taskqueues.manage for its account.
Parameters#
| Parameter | Type | Description |
|---|---|---|
queueId | string | - |
request | { defaultDueMinutes?: number | null; defaultPriority?: "low" | "normal" | "high" | "urgent" | null; description?: string | null; isArchived?: boolean; members?: { id: string; type: "user" | "role" | "account"; }[]; name?: string; taskTypes?: string[]; } | - |
request.defaultDueMinutes? | number | null | Description A task raised into the queue is due this many minutes later, unless it names a deadline. |
request.defaultPriority? | "low" | "normal" | "high" | "urgent" | null | |
request.description? | string | null | - |
request.isArchived? | boolean | Description Archive the queue (refused while tasks wait in it), or bring it back. |
request.members? | { id: string; type: "user" | "role" | "account"; }[] | - |
request.name? | string | Example Payments |
request.taskTypes? | string[] | Description New tasks of these types land in this queue. Example [ "payment.review", "payout.failed" ] |
requestOptions? | RequestOptions | - |
Returns#
Promise<{
accountId: string | null;
createdAt: string;
defaultDueMinutes: number | null;
defaultPriority: "low" | "normal" | "high" | "urgent" | null;
description: string | null;
id: string;
isArchived: boolean;
isMember: boolean;
members: {
id: string;
type: "user" | "role" | "account";
}[];
name: string;
organisationId: string;
taskTypes: string[];
updatedAt: string;
}>
Operation Id#
updateTaskQueue