@vharapuendava/psst-tasks-sdk 1.0.11 → 1.0.12
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 +5 -1
- package/dist/sdk.gen.js +4 -0
- package/dist/types.gen.d.ts +25 -3
- package/dist/zodSchemas/zod.schemas.d.ts +91 -18
- package/dist/zodSchemas/zod.schemas.js +25 -10
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
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';
|
|
1
|
+
export { createTask, deleteTaskById, getTaskById, listTasks, type Options } from './sdk.gen.js';
|
|
2
|
+
export type { BaseTask, ClientOptions, CreateTaskData, CreateTaskResponse, CreateTaskResponses, DeleteTaskByIdData, DeleteTaskByIdResponse, DeleteTaskByIdResponses, GetTaskByIdData, GetTaskByIdResponse, GetTaskByIdResponses, ListTasksData, ListTasksResponse, ListTasksResponses, NewTask, Task, TaskType } 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, getTaskById, listTasks } from './sdk.gen.js';
|
|
2
|
+
export { createTask, deleteTaskById, 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, GetTaskByIdData, GetTaskByIdResponses, ListTasksData, ListTasksResponses } from './types.gen.js';
|
|
2
|
+
import type { CreateTaskData, CreateTaskResponses, DeleteTaskByIdData, DeleteTaskByIdResponses, 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
|
|
@@ -21,6 +21,10 @@ export declare const listTasks: <ThrowOnError extends boolean = false>(options?:
|
|
|
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
|
+
* Delete a task by id
|
|
26
|
+
*/
|
|
27
|
+
export declare const deleteTaskById: <ThrowOnError extends boolean = false>(options: Options<DeleteTaskByIdData, ThrowOnError>) => import("./client/types.gen.js").RequestResult<DeleteTaskByIdResponses, unknown, ThrowOnError, "fields">;
|
|
24
28
|
/**
|
|
25
29
|
* Get a task by id
|
|
26
30
|
*/
|
package/dist/sdk.gen.js
CHANGED
|
@@ -15,6 +15,10 @@ export const createTask = (options) => (options.client ?? client).post({
|
|
|
15
15
|
...options.headers
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
/**
|
|
19
|
+
* Delete a task by id
|
|
20
|
+
*/
|
|
21
|
+
export const deleteTaskById = (options) => (options.client ?? client).delete({ url: '/v1/task/{taskId}', ...options });
|
|
18
22
|
/**
|
|
19
23
|
* Get a task by id
|
|
20
24
|
*/
|
package/dist/types.gen.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
export type ClientOptions = {
|
|
2
2
|
baseUrl: 'https://api.example.com/v1' | 'https://m51crfeyal.execute-api.eu-central-1.amazonaws.com/dev' | (string & {});
|
|
3
3
|
};
|
|
4
|
-
export type
|
|
4
|
+
export type TaskType = 'one-time' | 'recurring';
|
|
5
|
+
export type BaseTask = {
|
|
5
6
|
title: string;
|
|
7
|
+
taskType: TaskType;
|
|
8
|
+
dueDate?: string;
|
|
6
9
|
};
|
|
7
|
-
export type
|
|
10
|
+
export type NewTask = BaseTask;
|
|
11
|
+
export type Task = BaseTask & {
|
|
8
12
|
taskId: string;
|
|
9
|
-
|
|
13
|
+
status?: 'pending' | 'completed';
|
|
10
14
|
};
|
|
11
15
|
export type ListTasksData = {
|
|
12
16
|
body?: never;
|
|
@@ -34,9 +38,27 @@ export type CreateTaskResponses = {
|
|
|
34
38
|
201: Task;
|
|
35
39
|
};
|
|
36
40
|
export type CreateTaskResponse = CreateTaskResponses[keyof CreateTaskResponses];
|
|
41
|
+
export type DeleteTaskByIdData = {
|
|
42
|
+
body?: never;
|
|
43
|
+
path: {
|
|
44
|
+
taskId: string;
|
|
45
|
+
};
|
|
46
|
+
query?: never;
|
|
47
|
+
url: '/v1/task/{taskId}';
|
|
48
|
+
};
|
|
49
|
+
export type DeleteTaskByIdResponses = {
|
|
50
|
+
/**
|
|
51
|
+
* Task deleted successfully
|
|
52
|
+
*/
|
|
53
|
+
204: void;
|
|
54
|
+
};
|
|
55
|
+
export type DeleteTaskByIdResponse = DeleteTaskByIdResponses[keyof DeleteTaskByIdResponses];
|
|
37
56
|
export type GetTaskByIdData = {
|
|
38
57
|
body?: never;
|
|
39
58
|
path: {
|
|
59
|
+
/**
|
|
60
|
+
* The ID (uuid) of the task to retrieve
|
|
61
|
+
*/
|
|
40
62
|
taskId: string;
|
|
41
63
|
};
|
|
42
64
|
query?: never;
|
|
@@ -1,48 +1,121 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export declare const zTaskType: z.ZodEnum<{
|
|
3
|
+
"one-time": "one-time";
|
|
4
|
+
recurring: "recurring";
|
|
5
|
+
}>;
|
|
6
|
+
export declare const zBaseTask: z.ZodObject<{
|
|
7
|
+
title: z.ZodString;
|
|
8
|
+
taskType: z.ZodEnum<{
|
|
9
|
+
"one-time": "one-time";
|
|
10
|
+
recurring: "recurring";
|
|
11
|
+
}>;
|
|
12
|
+
dueDate: z.ZodOptional<z.ZodISODateTime>;
|
|
13
|
+
}, z.core.$strict>;
|
|
2
14
|
export declare const zNewTask: z.ZodObject<{
|
|
3
15
|
title: z.ZodString;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
16
|
+
taskType: z.ZodEnum<{
|
|
17
|
+
"one-time": "one-time";
|
|
18
|
+
recurring: "recurring";
|
|
19
|
+
}>;
|
|
20
|
+
dueDate: z.ZodOptional<z.ZodISODateTime>;
|
|
21
|
+
}, z.core.$strict>;
|
|
22
|
+
export declare const zTask: z.ZodIntersection<z.ZodObject<{
|
|
7
23
|
title: z.ZodString;
|
|
8
|
-
|
|
24
|
+
taskType: z.ZodEnum<{
|
|
25
|
+
"one-time": "one-time";
|
|
26
|
+
recurring: "recurring";
|
|
27
|
+
}>;
|
|
28
|
+
dueDate: z.ZodOptional<z.ZodISODateTime>;
|
|
29
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
30
|
+
taskId: z.ZodString;
|
|
31
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
32
|
+
pending: "pending";
|
|
33
|
+
completed: "completed";
|
|
34
|
+
}>>;
|
|
35
|
+
}, z.core.$strict>>;
|
|
9
36
|
export declare const zListTasksData: z.ZodObject<{
|
|
10
37
|
body: z.ZodOptional<z.ZodNever>;
|
|
11
38
|
path: z.ZodOptional<z.ZodNever>;
|
|
12
39
|
query: z.ZodOptional<z.ZodNever>;
|
|
13
|
-
}, z.core.$
|
|
40
|
+
}, z.core.$strict>;
|
|
14
41
|
/**
|
|
15
42
|
* Successful response
|
|
16
43
|
*/
|
|
17
|
-
export declare const zListTasksResponse: z.ZodArray<z.ZodObject<{
|
|
18
|
-
taskId: z.ZodString;
|
|
44
|
+
export declare const zListTasksResponse: z.ZodArray<z.ZodIntersection<z.ZodObject<{
|
|
19
45
|
title: z.ZodString;
|
|
20
|
-
|
|
46
|
+
taskType: z.ZodEnum<{
|
|
47
|
+
"one-time": "one-time";
|
|
48
|
+
recurring: "recurring";
|
|
49
|
+
}>;
|
|
50
|
+
dueDate: z.ZodOptional<z.ZodISODateTime>;
|
|
51
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
52
|
+
taskId: z.ZodString;
|
|
53
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
54
|
+
pending: "pending";
|
|
55
|
+
completed: "completed";
|
|
56
|
+
}>>;
|
|
57
|
+
}, z.core.$strict>>>;
|
|
21
58
|
export declare const zCreateTaskData: z.ZodObject<{
|
|
22
59
|
body: z.ZodObject<{
|
|
23
60
|
title: z.ZodString;
|
|
24
|
-
|
|
61
|
+
taskType: z.ZodEnum<{
|
|
62
|
+
"one-time": "one-time";
|
|
63
|
+
recurring: "recurring";
|
|
64
|
+
}>;
|
|
65
|
+
dueDate: z.ZodOptional<z.ZodISODateTime>;
|
|
66
|
+
}, z.core.$strict>;
|
|
25
67
|
path: z.ZodOptional<z.ZodNever>;
|
|
26
68
|
query: z.ZodOptional<z.ZodNever>;
|
|
27
|
-
}, z.core.$
|
|
69
|
+
}, z.core.$strict>;
|
|
28
70
|
/**
|
|
29
71
|
* Task created
|
|
30
72
|
*/
|
|
31
|
-
export declare const zCreateTaskResponse: z.ZodObject<{
|
|
32
|
-
taskId: z.ZodString;
|
|
73
|
+
export declare const zCreateTaskResponse: z.ZodIntersection<z.ZodObject<{
|
|
33
74
|
title: z.ZodString;
|
|
34
|
-
|
|
75
|
+
taskType: z.ZodEnum<{
|
|
76
|
+
"one-time": "one-time";
|
|
77
|
+
recurring: "recurring";
|
|
78
|
+
}>;
|
|
79
|
+
dueDate: z.ZodOptional<z.ZodISODateTime>;
|
|
80
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
81
|
+
taskId: z.ZodString;
|
|
82
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
83
|
+
pending: "pending";
|
|
84
|
+
completed: "completed";
|
|
85
|
+
}>>;
|
|
86
|
+
}, z.core.$strict>>;
|
|
87
|
+
export declare const zDeleteTaskByIdData: z.ZodObject<{
|
|
88
|
+
body: z.ZodOptional<z.ZodNever>;
|
|
89
|
+
path: z.ZodObject<{
|
|
90
|
+
taskId: z.ZodString;
|
|
91
|
+
}, z.core.$strict>;
|
|
92
|
+
query: z.ZodOptional<z.ZodNever>;
|
|
93
|
+
}, z.core.$strict>;
|
|
94
|
+
/**
|
|
95
|
+
* Task deleted successfully
|
|
96
|
+
*/
|
|
97
|
+
export declare const zDeleteTaskByIdResponse: z.ZodVoid;
|
|
35
98
|
export declare const zGetTaskByIdData: z.ZodObject<{
|
|
36
99
|
body: z.ZodOptional<z.ZodNever>;
|
|
37
100
|
path: z.ZodObject<{
|
|
38
101
|
taskId: z.ZodString;
|
|
39
|
-
}, z.core.$
|
|
102
|
+
}, z.core.$strict>;
|
|
40
103
|
query: z.ZodOptional<z.ZodNever>;
|
|
41
|
-
}, z.core.$
|
|
104
|
+
}, z.core.$strict>;
|
|
42
105
|
/**
|
|
43
106
|
* Successful response
|
|
44
107
|
*/
|
|
45
|
-
export declare const zGetTaskByIdResponse: z.ZodObject<{
|
|
46
|
-
taskId: z.ZodString;
|
|
108
|
+
export declare const zGetTaskByIdResponse: z.ZodIntersection<z.ZodObject<{
|
|
47
109
|
title: z.ZodString;
|
|
48
|
-
|
|
110
|
+
taskType: z.ZodEnum<{
|
|
111
|
+
"one-time": "one-time";
|
|
112
|
+
recurring: "recurring";
|
|
113
|
+
}>;
|
|
114
|
+
dueDate: z.ZodOptional<z.ZodISODateTime>;
|
|
115
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
116
|
+
taskId: z.ZodString;
|
|
117
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
118
|
+
pending: "pending";
|
|
119
|
+
completed: "completed";
|
|
120
|
+
}>>;
|
|
121
|
+
}, z.core.$strict>>;
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
export const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export const zTaskType = z.enum(['one-time', 'recurring']);
|
|
4
|
+
export const zBaseTask = z.object({
|
|
5
|
+
title: z.string().min(3).max(64),
|
|
6
|
+
taskType: zTaskType,
|
|
7
|
+
dueDate: z.optional(z.iso.datetime())
|
|
8
|
+
}).strict();
|
|
9
|
+
export const zNewTask = zBaseTask;
|
|
10
|
+
export const zTask = zBaseTask.and(z.object({
|
|
7
11
|
taskId: z.string(),
|
|
8
|
-
|
|
9
|
-
});
|
|
12
|
+
status: z.optional(z.enum(['pending', 'completed']))
|
|
13
|
+
}).strict());
|
|
10
14
|
export const zListTasksData = z.object({
|
|
11
15
|
body: z.optional(z.never()),
|
|
12
16
|
path: z.optional(z.never()),
|
|
13
17
|
query: z.optional(z.never())
|
|
14
|
-
});
|
|
18
|
+
}).strict();
|
|
15
19
|
/**
|
|
16
20
|
* Successful response
|
|
17
21
|
*/
|
|
@@ -20,18 +24,29 @@ export const zCreateTaskData = z.object({
|
|
|
20
24
|
body: zNewTask,
|
|
21
25
|
path: z.optional(z.never()),
|
|
22
26
|
query: z.optional(z.never())
|
|
23
|
-
});
|
|
27
|
+
}).strict();
|
|
24
28
|
/**
|
|
25
29
|
* Task created
|
|
26
30
|
*/
|
|
27
31
|
export const zCreateTaskResponse = zTask;
|
|
32
|
+
export const zDeleteTaskByIdData = z.object({
|
|
33
|
+
body: z.optional(z.never()),
|
|
34
|
+
path: z.object({
|
|
35
|
+
taskId: z.string()
|
|
36
|
+
}).strict(),
|
|
37
|
+
query: z.optional(z.never())
|
|
38
|
+
}).strict();
|
|
39
|
+
/**
|
|
40
|
+
* Task deleted successfully
|
|
41
|
+
*/
|
|
42
|
+
export const zDeleteTaskByIdResponse = z.void();
|
|
28
43
|
export const zGetTaskByIdData = z.object({
|
|
29
44
|
body: z.optional(z.never()),
|
|
30
45
|
path: z.object({
|
|
31
46
|
taskId: z.string()
|
|
32
|
-
}),
|
|
47
|
+
}).strict(),
|
|
33
48
|
query: z.optional(z.never())
|
|
34
|
-
});
|
|
49
|
+
}).strict();
|
|
35
50
|
/**
|
|
36
51
|
* Successful response
|
|
37
52
|
*/
|