@perspectask/sdk 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,587 @@
1
+ type AuthToken = string | undefined;
2
+ interface Auth {
3
+ /**
4
+ * Which part of the request do we use to send the auth?
5
+ *
6
+ * @default 'header'
7
+ */
8
+ in?: 'header' | 'query' | 'cookie';
9
+ /**
10
+ * Header or query parameter name.
11
+ *
12
+ * @default 'Authorization'
13
+ */
14
+ name?: string;
15
+ scheme?: 'basic' | 'bearer';
16
+ type: 'apiKey' | 'http';
17
+ }
18
+
19
+ interface SerializerOptions<T> {
20
+ /**
21
+ * @default true
22
+ */
23
+ explode: boolean;
24
+ style: T;
25
+ }
26
+ type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
27
+ type ObjectStyle = 'form' | 'deepObject';
28
+
29
+ type QuerySerializer = (query: Record<string, unknown>) => string;
30
+ type BodySerializer = (body: unknown) => unknown;
31
+ type QuerySerializerOptionsObject = {
32
+ allowReserved?: boolean;
33
+ array?: Partial<SerializerOptions<ArrayStyle>>;
34
+ object?: Partial<SerializerOptions<ObjectStyle>>;
35
+ };
36
+ type QuerySerializerOptions = QuerySerializerOptionsObject & {
37
+ /**
38
+ * Per-parameter serialization overrides. When provided, these settings
39
+ * override the global array/object settings for specific parameter names.
40
+ */
41
+ parameters?: Record<string, QuerySerializerOptionsObject>;
42
+ };
43
+
44
+ type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
45
+ type Client$1<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
46
+ /**
47
+ * Returns the final request URL.
48
+ */
49
+ buildUrl: BuildUrlFn;
50
+ getConfig: () => Config;
51
+ request: RequestFn;
52
+ setConfig: (config: Config) => Config;
53
+ } & {
54
+ [K in HttpMethod]: MethodFn;
55
+ } & ([SseFn] extends [never] ? {
56
+ sse?: never;
57
+ } : {
58
+ sse: {
59
+ [K in HttpMethod]: SseFn;
60
+ };
61
+ });
62
+ interface Config$1 {
63
+ /**
64
+ * Auth token or a function returning auth token. The resolved value will be
65
+ * added to the request payload as defined by its `security` array.
66
+ */
67
+ auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
68
+ /**
69
+ * A function for serializing request body parameter. By default,
70
+ * {@link JSON.stringify()} will be used.
71
+ */
72
+ bodySerializer?: BodySerializer | null;
73
+ /**
74
+ * An object containing any HTTP headers that you want to pre-populate your
75
+ * `Headers` object with.
76
+ *
77
+ * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
78
+ */
79
+ headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
80
+ /**
81
+ * The request method.
82
+ *
83
+ * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
84
+ */
85
+ method?: Uppercase<HttpMethod>;
86
+ /**
87
+ * A function for serializing request query parameters. By default, arrays
88
+ * will be exploded in form style, objects will be exploded in deepObject
89
+ * style, and reserved characters are percent-encoded.
90
+ *
91
+ * This method will have no effect if the native `paramsSerializer()` Axios
92
+ * API function is used.
93
+ *
94
+ * {@link https://swagger.io/docs/specification/serialization/#query View examples}
95
+ */
96
+ querySerializer?: QuerySerializer | QuerySerializerOptions;
97
+ /**
98
+ * A function validating request data. This is useful if you want to ensure
99
+ * the request conforms to the desired shape, so it can be safely sent to
100
+ * the server.
101
+ */
102
+ requestValidator?: (data: unknown) => Promise<unknown>;
103
+ /**
104
+ * A function transforming response data before it's returned. This is useful
105
+ * for post-processing data, e.g., converting ISO strings into Date objects.
106
+ */
107
+ responseTransformer?: (data: unknown) => Promise<unknown>;
108
+ /**
109
+ * A function validating response data. This is useful if you want to ensure
110
+ * the response conforms to the desired shape, so it can be safely passed to
111
+ * the transformers and returned to the user.
112
+ */
113
+ responseValidator?: (data: unknown) => Promise<unknown>;
114
+ }
115
+
116
+ type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> & Pick<Config$1, 'method' | 'responseTransformer' | 'responseValidator'> & {
117
+ /**
118
+ * Fetch API implementation. You can use this option to provide a custom
119
+ * fetch instance.
120
+ *
121
+ * @default globalThis.fetch
122
+ */
123
+ fetch?: typeof fetch;
124
+ /**
125
+ * Implementing clients can call request interceptors inside this hook.
126
+ */
127
+ onRequest?: (url: string, init: RequestInit) => Promise<Request>;
128
+ /**
129
+ * Callback invoked when a network or parsing error occurs during streaming.
130
+ *
131
+ * This option applies only if the endpoint returns a stream of events.
132
+ *
133
+ * @param error The error that occurred.
134
+ */
135
+ onSseError?: (error: unknown) => void;
136
+ /**
137
+ * Callback invoked when an event is streamed from the server.
138
+ *
139
+ * This option applies only if the endpoint returns a stream of events.
140
+ *
141
+ * @param event Event streamed from the server.
142
+ * @returns Nothing (void).
143
+ */
144
+ onSseEvent?: (event: StreamEvent<TData>) => void;
145
+ serializedBody?: RequestInit['body'];
146
+ /**
147
+ * Default retry delay in milliseconds.
148
+ *
149
+ * This option applies only if the endpoint returns a stream of events.
150
+ *
151
+ * @default 3000
152
+ */
153
+ sseDefaultRetryDelay?: number;
154
+ /**
155
+ * Maximum number of retry attempts before giving up.
156
+ */
157
+ sseMaxRetryAttempts?: number;
158
+ /**
159
+ * Maximum retry delay in milliseconds.
160
+ *
161
+ * Applies only when exponential backoff is used.
162
+ *
163
+ * This option applies only if the endpoint returns a stream of events.
164
+ *
165
+ * @default 30000
166
+ */
167
+ sseMaxRetryDelay?: number;
168
+ /**
169
+ * Optional sleep function for retry backoff.
170
+ *
171
+ * Defaults to using `setTimeout`.
172
+ */
173
+ sseSleepFn?: (ms: number) => Promise<void>;
174
+ url: string;
175
+ };
176
+ interface StreamEvent<TData = unknown> {
177
+ data: TData;
178
+ event?: string;
179
+ id?: string;
180
+ retry?: number;
181
+ }
182
+ type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
183
+ stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
184
+ };
185
+
186
+ type ErrInterceptor<Err, Res, Req, Options> = (error: Err,
187
+ /** response may be undefined due to a network error where no response object is produced */
188
+ response: Res | undefined,
189
+ /** request may be undefined, because error may be from building the request object itself */
190
+ request: Req | undefined, options: Options) => Err | Promise<Err>;
191
+ type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
192
+ type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
193
+ declare class Interceptors<Interceptor> {
194
+ fns: Array<Interceptor | null>;
195
+ clear(): void;
196
+ eject(id: number | Interceptor): void;
197
+ exists(id: number | Interceptor): boolean;
198
+ getInterceptorIndex(id: number | Interceptor): number;
199
+ update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
200
+ use(fn: Interceptor): number;
201
+ }
202
+ interface Middleware<Req, Res, Err, Options> {
203
+ error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;
204
+ request: Interceptors<ReqInterceptor<Req, Options>>;
205
+ response: Interceptors<ResInterceptor<Res, Req, Options>>;
206
+ }
207
+
208
+ type ResponseStyle = 'data' | 'fields';
209
+ interface Config<T extends ClientOptions$1 = ClientOptions$1> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Config$1 {
210
+ /**
211
+ * Base URL for all requests made by this client.
212
+ */
213
+ baseUrl?: T['baseUrl'];
214
+ /**
215
+ * Fetch API implementation. You can use this option to provide a custom
216
+ * fetch instance.
217
+ *
218
+ * @default globalThis.fetch
219
+ */
220
+ fetch?: typeof fetch;
221
+ /**
222
+ * Please don't use the Fetch client for Next.js applications. The `next`
223
+ * options won't have any effect.
224
+ *
225
+ * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
226
+ */
227
+ next?: never;
228
+ /**
229
+ * Return the response data parsed in a specified format. By default, `auto`
230
+ * will infer the appropriate method from the `Content-Type` response header.
231
+ * You can override this behavior with any of the {@link Body} methods.
232
+ * Select `stream` if you don't want to parse response data at all.
233
+ *
234
+ * @default 'auto'
235
+ */
236
+ parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
237
+ /**
238
+ * Should we return only data or multiple fields (data, error, response, etc.)?
239
+ *
240
+ * @default 'fields'
241
+ */
242
+ responseStyle?: ResponseStyle;
243
+ /**
244
+ * Throw an error instead of returning it in the response?
245
+ *
246
+ * @default false
247
+ */
248
+ throwOnError?: T['throwOnError'];
249
+ }
250
+ interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
251
+ responseStyle: TResponseStyle;
252
+ throwOnError: ThrowOnError;
253
+ }>, Pick<ServerSentEventsOptions<TData>, 'onRequest' | 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
254
+ /**
255
+ * Any body that you want to add to your request.
256
+ *
257
+ * {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
258
+ */
259
+ body?: unknown;
260
+ path?: Record<string, unknown>;
261
+ query?: Record<string, unknown>;
262
+ /**
263
+ * Security mechanism(s) to use for the request.
264
+ */
265
+ security?: ReadonlyArray<Auth>;
266
+ url: Url;
267
+ }
268
+ interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
269
+ headers: Headers;
270
+ serializedBody?: string;
271
+ }
272
+ type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'fields'> = ThrowOnError extends true ? Promise<TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
273
+ data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
274
+ request: Request;
275
+ response: Response;
276
+ }> : Promise<TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
277
+ data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
278
+ error: undefined;
279
+ } | {
280
+ data: undefined;
281
+ error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
282
+ }) & {
283
+ /** request may be undefined, because error may be from building the request object itself */
284
+ request?: Request;
285
+ /** response may be undefined, because error may be from building the request object itself or from a network error */
286
+ response?: Response;
287
+ }>;
288
+ interface ClientOptions$1 {
289
+ baseUrl?: string;
290
+ responseStyle?: ResponseStyle;
291
+ throwOnError?: boolean;
292
+ }
293
+ type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
294
+ type SseFn = <TData = unknown, _TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData>>;
295
+ type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
296
+ type BuildUrlFn = <TData extends {
297
+ body?: unknown;
298
+ path?: Record<string, unknown>;
299
+ query?: Record<string, unknown>;
300
+ url: string;
301
+ }>(options: TData & Options$1<TData>) => string;
302
+ type Client = Client$1<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
303
+ interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
304
+ };
305
+ interface TDataShape {
306
+ body?: unknown;
307
+ headers?: unknown;
308
+ path?: unknown;
309
+ query?: unknown;
310
+ url: string;
311
+ }
312
+ type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
313
+ type Options$1<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
314
+
315
+ type ClientOptions = {
316
+ baseUrl: 'https://api.perspectask.com/v1' | (string & {});
317
+ };
318
+ type Task = {
319
+ id?: string;
320
+ title?: string;
321
+ description?: string;
322
+ /**
323
+ * True for end-to-end-encrypted tasks. Their title and description are omitted over this API (the keys are absent, not empty) — decrypt them in the web app.
324
+ */
325
+ encrypted?: boolean;
326
+ /**
327
+ * The task's column id — d-20-11-2026, w-23-2026, m-6-2026, q-2-2026, y-2026, or "l" (lifetime). This is the same canonical form accepted as input on create/update.
328
+ */
329
+ deadline?: string;
330
+ /**
331
+ * The actual end-of-period timestamp (e.g. Sunday 23:59:59 for a weekly task). Omitted for lifetime tasks and tasks without a schedule.
332
+ */
333
+ deadline_date?: string;
334
+ status?: 'ACTIVE' | 'COMPLETED' | 'CANCELLED' | 'READY' | 'IN_PROGRESS' | 'WAITING';
335
+ /**
336
+ * Percentage of completion (e.g. "52%") computed recursively from all descendants' statuses — not just direct children. Only present when the task has children.
337
+ */
338
+ completion?: string;
339
+ priority?: 1 | 2 | 3 | null;
340
+ created?: string;
341
+ children?: Array<string | Task>;
342
+ parents?: Array<string>;
343
+ };
344
+ type ListTasksData = {
345
+ body?: never;
346
+ path?: never;
347
+ query?: {
348
+ /**
349
+ * Defaults to false (plaintext tasks only). Set to true to also include end-to-end-encrypted tasks (returned with `encrypted: true` and no title/description keys) for full tree visibility.
350
+ */
351
+ includeEncrypted?: boolean;
352
+ /**
353
+ * Defaults to false. When true, each task's `children` are returned as full nested task objects (recursively) instead of id strings. A task that was already expanded elsewhere in the tree will not be expanded again — only its short id string will appear in the `children` array of subsequent parent tasks, preserving the relationship without repeating the full object.
354
+ */
355
+ tree?: boolean;
356
+ /**
357
+ * Like `tree` but without deduplication: a task with multiple parents appears under each parent. Mutually exclusive with `tree`.
358
+ */
359
+ treeFull?: boolean;
360
+ };
361
+ url: '/tasks';
362
+ };
363
+ type ListTasksResponses = {
364
+ /**
365
+ * List of tasks
366
+ */
367
+ 200: Array<Task>;
368
+ };
369
+ type ListTasksResponse = ListTasksResponses[keyof ListTasksResponses];
370
+ type CreateTaskData = {
371
+ body: {
372
+ title: string;
373
+ description?: string;
374
+ /**
375
+ * 0 none, 1 low, 2 medium, 3 high.
376
+ */
377
+ priority?: 0 | 1 | 2 | 3;
378
+ /**
379
+ * When this task is due. A single shorthand token that sets both the period type and the date. Accepts: today, tomorrow, this/next week|month|quarter|year, lifetime, the bare letters d/w/m/q/y/l (= today, this week, this month, this quarter, this year, lifetime), or a column id (d-20-11-2026, w-23-2026, m-6-2026, q-2-2026, y-2026; trailing parts may be omitted to default to current month/year; the first number may be glued: q2, w23, d20).
380
+ */
381
+ deadline?: string;
382
+ /**
383
+ * Parent task id — full UUID or a short id prefix.
384
+ */
385
+ parent_id?: string;
386
+ };
387
+ path?: never;
388
+ query?: never;
389
+ url: '/tasks';
390
+ };
391
+ type CreateTaskResponses = {
392
+ /**
393
+ * Created
394
+ */
395
+ 201: Task;
396
+ };
397
+ type CreateTaskResponse = CreateTaskResponses[keyof CreateTaskResponses];
398
+ type GetTaskData = {
399
+ body?: never;
400
+ path: {
401
+ id: string;
402
+ };
403
+ query?: {
404
+ /**
405
+ * Defaults to false. When true, `children` are returned as full nested task objects expanding the entire subtree under this task.
406
+ */
407
+ tree?: boolean;
408
+ };
409
+ url: '/tasks/{id}';
410
+ };
411
+ type GetTaskErrors = {
412
+ /**
413
+ * Not found
414
+ */
415
+ 404: unknown;
416
+ };
417
+ type GetTaskResponses = {
418
+ /**
419
+ * A task
420
+ */
421
+ 200: Task;
422
+ };
423
+ type GetTaskResponse = GetTaskResponses[keyof GetTaskResponses];
424
+ type UpdateTaskData = {
425
+ body: {
426
+ title?: string;
427
+ description?: string;
428
+ /**
429
+ * When this task is due — same shorthand grammar as on create (today, lifetime, q-2-2026, q2, d-20-11, …).
430
+ */
431
+ deadline?: string;
432
+ status?: 'ACTIVE' | 'COMPLETED' | 'CANCELLED' | 'READY' | 'IN_PROGRESS' | 'WAITING';
433
+ priority?: 0 | 1 | 2 | 3;
434
+ /**
435
+ * Attach this task as a child of the given parent (full UUID or short id prefix).
436
+ */
437
+ add_parent?: string;
438
+ /**
439
+ * Detach this task from the given parent (full UUID or short id prefix).
440
+ */
441
+ remove_parent?: string;
442
+ /**
443
+ * Replace the task's existing parent with this new one (full UUID or short id prefix). If the task has exactly one parent, that one is replaced. If it has multiple, you must also pass `replace_parent_from` to say which to replace.
444
+ */
445
+ replace_parent?: string;
446
+ /**
447
+ * When replacing among multiple parents, the existing parent to replace (full UUID or short id prefix; used with `replace_parent`).
448
+ */
449
+ replace_parent_from?: string;
450
+ };
451
+ path: {
452
+ id: string;
453
+ };
454
+ query?: never;
455
+ url: '/tasks/{id}';
456
+ };
457
+ type UpdateTaskErrors = {
458
+ /**
459
+ * Not found
460
+ */
461
+ 404: unknown;
462
+ };
463
+ type UpdateTaskResponses = {
464
+ /**
465
+ * Updated
466
+ */
467
+ 200: Task;
468
+ };
469
+ type UpdateTaskResponse = UpdateTaskResponses[keyof UpdateTaskResponses];
470
+
471
+ type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options$1<TData, ThrowOnError, TResponse> & {
472
+ /**
473
+ * You can provide a client instance returned by `createClient()` instead of
474
+ * individual options. This might be also useful if you want to implement a
475
+ * custom client.
476
+ */
477
+ client?: Client;
478
+ /**
479
+ * You can pass arbitrary values through the `meta` object. This can be
480
+ * used to access values that aren't defined as part of the SDK function.
481
+ */
482
+ meta?: Record<string, unknown>;
483
+ };
484
+ declare class Tasks {
485
+ /**
486
+ * List all tasks
487
+ */
488
+ static listTasks<ThrowOnError extends boolean = false>(options?: Options<ListTasksData, ThrowOnError>): RequestResult<ListTasksResponses, unknown, ThrowOnError, "fields">;
489
+ /**
490
+ * Create a task
491
+ */
492
+ static createTask<ThrowOnError extends boolean = false>(options: Options<CreateTaskData, ThrowOnError>): RequestResult<CreateTaskResponses, unknown, ThrowOnError, "fields">;
493
+ /**
494
+ * Get a task by id
495
+ */
496
+ static getTask<ThrowOnError extends boolean = false>(options: Options<GetTaskData, ThrowOnError>): RequestResult<GetTaskResponses, GetTaskErrors, ThrowOnError, "fields">;
497
+ /**
498
+ * Update a task
499
+ */
500
+ static updateTask<ThrowOnError extends boolean = false>(options: Options<UpdateTaskData, ThrowOnError>): RequestResult<UpdateTaskResponses, UpdateTaskErrors, ThrowOnError, "fields">;
501
+ }
502
+
503
+ interface PerspecTaskOptions {
504
+ /**
505
+ * Your Perspectask API key (begins with `pt_live_`). Create one in the web
506
+ * app under **Settings → API**. Carries `tasks:read` / `tasks:write` scopes.
507
+ */
508
+ apiKey: string;
509
+ /**
510
+ * Override the API base URL. Defaults to `https://api.perspectask.com/v1`.
511
+ * Mostly useful for staging or local development.
512
+ */
513
+ baseUrl?: string;
514
+ }
515
+ /**
516
+ * Official TypeScript SDK for the Perspectask API.
517
+ *
518
+ * @example
519
+ * ```ts
520
+ * import PerspecTask from "@perspectask/sdk";
521
+ *
522
+ * const pt = new PerspecTask({ apiKey: process.env.PERSPECTASK_API_KEY! });
523
+ *
524
+ * const { data } = await pt.tasks.list();
525
+ * if (data) {
526
+ * for (const task of data.tasks ?? []) {
527
+ * console.log(task.title);
528
+ * }
529
+ * }
530
+ * ```
531
+ */
532
+ declare class PerspecTask {
533
+ /**
534
+ * Task resources — list, fetch, create, and update the tasks this API key
535
+ * is scoped to. Encrypted tasks are returned with `encrypted: true` and no title/description keys.
536
+ */
537
+ readonly tasks: ReturnType<typeof createTasksNamespace>;
538
+ constructor(options: PerspecTaskOptions);
539
+ }
540
+ declare function createTasksNamespace(client: Client): {
541
+ /** List tasks. Pass `{ includeEncrypted: true }` and/or `{ tree: true }`. Wraps `Tasks.listTasks`. */
542
+ list: (query?: ListTasksData["query"]) => Promise<({
543
+ data: undefined;
544
+ error: unknown;
545
+ } | {
546
+ data: Task[];
547
+ error: undefined;
548
+ }) & {
549
+ request?: Request;
550
+ response?: Response;
551
+ }>;
552
+ /** Fetch a single task by id. Pass `{ tree: true }` to expand the subtree. Wraps `Tasks.getTask`. */
553
+ get: (id: string, query?: GetTaskData["query"]) => Promise<({
554
+ data: Task;
555
+ error: undefined;
556
+ } | {
557
+ data: undefined;
558
+ error: unknown;
559
+ }) & {
560
+ request?: Request;
561
+ response?: Response;
562
+ }>;
563
+ /** Create a task (`title` required). Wraps `Tasks.createTask`. */
564
+ create: (body: CreateTaskData["body"]) => Promise<({
565
+ data: undefined;
566
+ error: unknown;
567
+ } | {
568
+ data: Task;
569
+ error: undefined;
570
+ }) & {
571
+ request?: Request;
572
+ response?: Response;
573
+ }>;
574
+ /** Update editable fields on a task by id. Wraps `Tasks.updateTask`. */
575
+ update: (id: string, body: UpdateTaskData["body"]) => Promise<({
576
+ data: Task;
577
+ error: undefined;
578
+ } | {
579
+ data: undefined;
580
+ error: unknown;
581
+ }) & {
582
+ request?: Request;
583
+ response?: Response;
584
+ }>;
585
+ };
586
+
587
+ export { type ClientOptions, type CreateTaskData, type CreateTaskResponse, type CreateTaskResponses, type GetTaskData, type GetTaskErrors, type GetTaskResponse, type GetTaskResponses, type ListTasksData, type ListTasksResponse, type ListTasksResponses, type Options, PerspecTask, type PerspecTaskOptions, type Task, Tasks, type UpdateTaskData, type UpdateTaskErrors, type UpdateTaskResponse, type UpdateTaskResponses, PerspecTask as default };