@vharapuendava/psst-tasks-sdk 1.0.8 → 1.0.10
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.
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/sdk.gen.d.ts +7 -3
- package/dist/sdk.gen.js +6 -2
- package/dist/types.gen.d.ts +24 -9
- package/dist/zodSchemas/zod.schemas.d.ts +31 -17
- package/dist/zodSchemas/zod.schemas.js +22 -11
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createTask,
|
|
2
|
-
export type { ClientOptions, CreateTaskData, CreateTaskResponse, CreateTaskResponses,
|
|
1
|
+
export { createTask, getTaskById, listTasks, type Options } from './sdk.gen.js';
|
|
2
|
+
export type { ClientOptions, CreateTaskData, CreateTaskResponse, CreateTaskResponses, GetTaskByIdData, GetTaskByIdResponse, GetTaskByIdResponses, ListTasksData, ListTasksResponse, ListTasksResponses, NewTask, Task } from './types.gen.js';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
export { createTask,
|
|
2
|
+
export { createTask, getTaskById, listTasks } from './sdk.gen.js';
|
package/dist/sdk.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Client, Options as Options2, TDataShape } from './client/index.js';
|
|
2
|
-
import type { CreateTaskData, CreateTaskResponses,
|
|
2
|
+
import type { CreateTaskData, CreateTaskResponses, GetTaskByIdData, GetTaskByIdResponses, ListTasksData, ListTasksResponses } from './types.gen.js';
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -14,10 +14,14 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
|
|
|
14
14
|
meta?: Record<string, unknown>;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
|
-
* Get a list of
|
|
17
|
+
* Get a list of tasks
|
|
18
18
|
*/
|
|
19
|
-
export declare const
|
|
19
|
+
export declare const listTasks: <ThrowOnError extends boolean = false>(options?: Options<ListTasksData, ThrowOnError>) => import("./client/types.gen.js").RequestResult<ListTasksResponses, unknown, ThrowOnError, "fields">;
|
|
20
20
|
/**
|
|
21
21
|
* Create a task
|
|
22
22
|
*/
|
|
23
23
|
export declare const createTask: <ThrowOnError extends boolean = false>(options: Options<CreateTaskData, ThrowOnError>) => import("./client/types.gen.js").RequestResult<CreateTaskResponses, unknown, ThrowOnError, "fields">;
|
|
24
|
+
/**
|
|
25
|
+
* Get a task by id
|
|
26
|
+
*/
|
|
27
|
+
export declare const getTaskById: <ThrowOnError extends boolean = false>(options: Options<GetTaskByIdData, ThrowOnError>) => import("./client/types.gen.js").RequestResult<GetTaskByIdResponses, unknown, ThrowOnError, "fields">;
|
package/dist/sdk.gen.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
2
|
import { client } from './client.gen.js';
|
|
3
3
|
/**
|
|
4
|
-
* Get a list of
|
|
4
|
+
* Get a list of tasks
|
|
5
5
|
*/
|
|
6
|
-
export const
|
|
6
|
+
export const listTasks = (options) => (options?.client ?? client).get({ url: '/v1/task', ...options });
|
|
7
7
|
/**
|
|
8
8
|
* Create a task
|
|
9
9
|
*/
|
|
@@ -15,3 +15,7 @@ export const createTask = (options) => (options.client ?? client).post({
|
|
|
15
15
|
...options.headers
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
/**
|
|
19
|
+
* Get a task by id
|
|
20
|
+
*/
|
|
21
|
+
export const getTaskById = (options) => (options.client ?? client).get({ url: '/v1/task/{taskId}', ...options });
|
package/dist/types.gen.d.ts
CHANGED
|
@@ -4,23 +4,23 @@ export type ClientOptions = {
|
|
|
4
4
|
export type NewTask = {
|
|
5
5
|
title: string;
|
|
6
6
|
};
|
|
7
|
-
export type
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
export type Task = {
|
|
8
|
+
taskId: string;
|
|
9
|
+
title: string;
|
|
10
10
|
};
|
|
11
|
-
export type
|
|
11
|
+
export type ListTasksData = {
|
|
12
12
|
body?: never;
|
|
13
13
|
path?: never;
|
|
14
14
|
query?: never;
|
|
15
15
|
url: '/v1/task';
|
|
16
16
|
};
|
|
17
|
-
export type
|
|
17
|
+
export type ListTasksResponses = {
|
|
18
18
|
/**
|
|
19
19
|
* Successful response
|
|
20
20
|
*/
|
|
21
|
-
200: Array<
|
|
21
|
+
200: Array<Task>;
|
|
22
22
|
};
|
|
23
|
-
export type
|
|
23
|
+
export type ListTasksResponse = ListTasksResponses[keyof ListTasksResponses];
|
|
24
24
|
export type CreateTaskData = {
|
|
25
25
|
body: NewTask;
|
|
26
26
|
path?: never;
|
|
@@ -29,8 +29,23 @@ export type CreateTaskData = {
|
|
|
29
29
|
};
|
|
30
30
|
export type CreateTaskResponses = {
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Task created
|
|
33
33
|
*/
|
|
34
|
-
201:
|
|
34
|
+
201: Task;
|
|
35
35
|
};
|
|
36
36
|
export type CreateTaskResponse = CreateTaskResponses[keyof CreateTaskResponses];
|
|
37
|
+
export type GetTaskByIdData = {
|
|
38
|
+
body?: never;
|
|
39
|
+
path: {
|
|
40
|
+
taskId: string;
|
|
41
|
+
};
|
|
42
|
+
query?: never;
|
|
43
|
+
url: '/v1/task/{taskId}';
|
|
44
|
+
};
|
|
45
|
+
export type GetTaskByIdResponses = {
|
|
46
|
+
/**
|
|
47
|
+
* Successful response
|
|
48
|
+
*/
|
|
49
|
+
200: Task;
|
|
50
|
+
};
|
|
51
|
+
export type GetTaskByIdResponse = GetTaskByIdResponses[keyof GetTaskByIdResponses];
|
|
@@ -1,34 +1,48 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const zNewTask: z.ZodObject<{
|
|
3
3
|
title: z.ZodString;
|
|
4
|
-
}, z.core.$
|
|
5
|
-
export declare const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}, z.core.$
|
|
9
|
-
export declare const
|
|
4
|
+
}, z.core.$strict>;
|
|
5
|
+
export declare const zTask: z.ZodObject<{
|
|
6
|
+
taskId: z.ZodString;
|
|
7
|
+
title: z.ZodString;
|
|
8
|
+
}, z.core.$strict>;
|
|
9
|
+
export declare const zListTasksData: z.ZodObject<{
|
|
10
10
|
body: z.ZodOptional<z.ZodNever>;
|
|
11
11
|
path: z.ZodOptional<z.ZodNever>;
|
|
12
12
|
query: z.ZodOptional<z.ZodNever>;
|
|
13
|
-
}, z.core.$
|
|
13
|
+
}, z.core.$strict>;
|
|
14
14
|
/**
|
|
15
15
|
* Successful response
|
|
16
16
|
*/
|
|
17
|
-
export declare const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}, z.core.$
|
|
17
|
+
export declare const zListTasksResponse: z.ZodArray<z.ZodObject<{
|
|
18
|
+
taskId: z.ZodString;
|
|
19
|
+
title: z.ZodString;
|
|
20
|
+
}, z.core.$strict>>;
|
|
21
21
|
export declare const zCreateTaskData: z.ZodObject<{
|
|
22
22
|
body: z.ZodObject<{
|
|
23
23
|
title: z.ZodString;
|
|
24
|
-
}, z.core.$
|
|
24
|
+
}, z.core.$strict>;
|
|
25
25
|
path: z.ZodOptional<z.ZodNever>;
|
|
26
26
|
query: z.ZodOptional<z.ZodNever>;
|
|
27
|
-
}, z.core.$
|
|
27
|
+
}, z.core.$strict>;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Task created
|
|
30
30
|
*/
|
|
31
31
|
export declare const zCreateTaskResponse: z.ZodObject<{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}, z.core.$
|
|
32
|
+
taskId: z.ZodString;
|
|
33
|
+
title: z.ZodString;
|
|
34
|
+
}, z.core.$strict>;
|
|
35
|
+
export declare const zGetTaskByIdData: z.ZodObject<{
|
|
36
|
+
body: z.ZodOptional<z.ZodNever>;
|
|
37
|
+
path: z.ZodObject<{
|
|
38
|
+
taskId: z.ZodString;
|
|
39
|
+
}, z.core.$strict>;
|
|
40
|
+
query: z.ZodOptional<z.ZodNever>;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
/**
|
|
43
|
+
* Successful response
|
|
44
|
+
*/
|
|
45
|
+
export declare const zGetTaskByIdResponse: z.ZodObject<{
|
|
46
|
+
taskId: z.ZodString;
|
|
47
|
+
title: z.ZodString;
|
|
48
|
+
}, z.core.$strict>;
|
|
@@ -2,26 +2,37 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
export const zNewTask = z.object({
|
|
4
4
|
title: z.string()
|
|
5
|
-
});
|
|
6
|
-
export const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
});
|
|
10
|
-
export const
|
|
5
|
+
}).strict();
|
|
6
|
+
export const zTask = z.object({
|
|
7
|
+
taskId: z.string(),
|
|
8
|
+
title: z.string().min(3).max(64)
|
|
9
|
+
}).strict();
|
|
10
|
+
export const zListTasksData = z.object({
|
|
11
11
|
body: z.optional(z.never()),
|
|
12
12
|
path: z.optional(z.never()),
|
|
13
13
|
query: z.optional(z.never())
|
|
14
|
-
});
|
|
14
|
+
}).strict();
|
|
15
15
|
/**
|
|
16
16
|
* Successful response
|
|
17
17
|
*/
|
|
18
|
-
export const
|
|
18
|
+
export const zListTasksResponse = z.array(zTask);
|
|
19
19
|
export const zCreateTaskData = z.object({
|
|
20
20
|
body: zNewTask,
|
|
21
21
|
path: z.optional(z.never()),
|
|
22
22
|
query: z.optional(z.never())
|
|
23
|
-
});
|
|
23
|
+
}).strict();
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Task created
|
|
26
26
|
*/
|
|
27
|
-
export const zCreateTaskResponse =
|
|
27
|
+
export const zCreateTaskResponse = zTask;
|
|
28
|
+
export const zGetTaskByIdData = z.object({
|
|
29
|
+
body: z.optional(z.never()),
|
|
30
|
+
path: z.object({
|
|
31
|
+
taskId: z.string()
|
|
32
|
+
}).strict(),
|
|
33
|
+
query: z.optional(z.never())
|
|
34
|
+
}).strict();
|
|
35
|
+
/**
|
|
36
|
+
* Successful response
|
|
37
|
+
*/
|
|
38
|
+
export const zGetTaskByIdResponse = zTask;
|