@abella-bilhalba-engenharia/api-client 0.0.14 → 0.0.16
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.cjs +22 -26
- package/dist/index.d.cts +53 -59
- package/dist/index.d.ts +53 -59
- package/dist/index.js +22 -26
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -104,35 +104,31 @@ var authContract = c.router({
|
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
106
|
|
|
107
|
-
// src/schemas/user.ts
|
|
108
|
-
var import_zod3 = __toESM(require("zod"), 1);
|
|
109
|
-
var userRoleSchema = import_zod3.default.enum(["ROLE_USER", "ROLE_ADMIN"]);
|
|
110
|
-
|
|
111
107
|
// src/contracts/admin.contract.ts
|
|
112
108
|
var import_core2 = require("@ts-rest/core");
|
|
113
|
-
var
|
|
109
|
+
var import_zod3 = __toESM(require("zod"), 1);
|
|
114
110
|
var c2 = (0, import_core2.initContract)();
|
|
115
|
-
var adminContract =
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
}
|
|
111
|
+
var adminContract = {
|
|
112
|
+
clients: c2.router({
|
|
113
|
+
list: {
|
|
114
|
+
method: "GET",
|
|
115
|
+
path: "/admin/clients",
|
|
116
|
+
headers: authorizationHeader,
|
|
117
|
+
query: import_zod3.default.object({
|
|
118
|
+
page: import_zod3.default.number().positive().optional(),
|
|
119
|
+
perPage: import_zod3.default.number().positive().optional()
|
|
120
|
+
}),
|
|
121
|
+
responses: {
|
|
122
|
+
200: import_zod3.default.array(
|
|
123
|
+
import_zod3.default.object({
|
|
124
|
+
name: import_zod3.default.string()
|
|
125
|
+
})
|
|
126
|
+
)
|
|
127
|
+
},
|
|
128
|
+
summary: "List all clients"
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
};
|
|
136
132
|
|
|
137
133
|
// src/contract.ts
|
|
138
134
|
var import_core3 = require("@ts-rest/core");
|
package/dist/index.d.cts
CHANGED
|
@@ -94,24 +94,21 @@ declare const authContract: {
|
|
|
94
94
|
};
|
|
95
95
|
|
|
96
96
|
declare const adminContract: {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
ROLE_ADMIN: "ROLE_ADMIN";
|
|
113
|
-
}>>;
|
|
114
|
-
}, z__default.core.$strip>>;
|
|
97
|
+
clients: {
|
|
98
|
+
list: {
|
|
99
|
+
query: z__default.ZodObject<{
|
|
100
|
+
page: z__default.ZodOptional<z__default.ZodNumber>;
|
|
101
|
+
perPage: z__default.ZodOptional<z__default.ZodNumber>;
|
|
102
|
+
}, z__default.core.$strip>;
|
|
103
|
+
summary: "List all clients";
|
|
104
|
+
method: "GET";
|
|
105
|
+
headers: z__default.ZodString;
|
|
106
|
+
path: "/admin/clients";
|
|
107
|
+
responses: {
|
|
108
|
+
200: z__default.ZodArray<z__default.ZodObject<{
|
|
109
|
+
name: z__default.ZodString;
|
|
110
|
+
}, z__default.core.$strip>>;
|
|
111
|
+
};
|
|
115
112
|
};
|
|
116
113
|
};
|
|
117
114
|
};
|
|
@@ -161,52 +158,49 @@ declare const contract: {
|
|
|
161
158
|
};
|
|
162
159
|
};
|
|
163
160
|
admin: {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
summary: "List all clients";
|
|
170
|
-
method: "GET";
|
|
171
|
-
headers: z.ZodString;
|
|
172
|
-
path: "/admin/clients";
|
|
173
|
-
responses: {
|
|
174
|
-
401: z.ZodObject<{
|
|
175
|
-
error: z.ZodObject<{
|
|
176
|
-
type: z.ZodLiteral<"UNAUTHORIZED">;
|
|
177
|
-
message: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
178
|
-
}, zod_v4_core.$strip>;
|
|
161
|
+
clients: {
|
|
162
|
+
list: {
|
|
163
|
+
query: z.ZodObject<{
|
|
164
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
165
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
179
166
|
}, zod_v4_core.$strip>;
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
167
|
+
summary: "List all clients";
|
|
168
|
+
method: "GET";
|
|
169
|
+
headers: z.ZodString;
|
|
170
|
+
path: "/admin/clients";
|
|
171
|
+
responses: {
|
|
172
|
+
401: z.ZodObject<{
|
|
173
|
+
error: z.ZodObject<{
|
|
174
|
+
type: z.ZodLiteral<"UNAUTHORIZED">;
|
|
175
|
+
message: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
176
|
+
}, zod_v4_core.$strip>;
|
|
185
177
|
}, zod_v4_core.$strip>;
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
178
|
+
404: z.ZodObject<{
|
|
179
|
+
error: z.ZodObject<{
|
|
180
|
+
type: z.ZodLiteral<"ENTITY_NOT_FOUND">;
|
|
181
|
+
entity: z.ZodString;
|
|
182
|
+
message: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
183
|
+
}, zod_v4_core.$strip>;
|
|
192
184
|
}, zod_v4_core.$strip>;
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
185
|
+
409: z.ZodObject<{
|
|
186
|
+
error: z.ZodObject<{
|
|
187
|
+
type: z.ZodLiteral<"ENTITY_ALREADY_EXISTS">;
|
|
188
|
+
entity: z.ZodString;
|
|
189
|
+
message: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
190
|
+
}, zod_v4_core.$strip>;
|
|
198
191
|
}, zod_v4_core.$strip>;
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
192
|
+
500: z.ZodObject<{
|
|
193
|
+
error: z.ZodObject<{
|
|
194
|
+
type: z.ZodLiteral<"INTERNAL_SERVER_ERROR">;
|
|
195
|
+
message: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
196
|
+
}, zod_v4_core.$strip>;
|
|
197
|
+
}, zod_v4_core.$strip>;
|
|
198
|
+
200: z.ZodArray<z.ZodObject<{
|
|
199
|
+
name: z.ZodString;
|
|
200
|
+
}, zod_v4_core.$strip>>;
|
|
201
|
+
};
|
|
202
|
+
strictStatusCodes: true;
|
|
208
203
|
};
|
|
209
|
-
strictStatusCodes: true;
|
|
210
204
|
};
|
|
211
205
|
};
|
|
212
206
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -94,24 +94,21 @@ declare const authContract: {
|
|
|
94
94
|
};
|
|
95
95
|
|
|
96
96
|
declare const adminContract: {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
ROLE_ADMIN: "ROLE_ADMIN";
|
|
113
|
-
}>>;
|
|
114
|
-
}, z__default.core.$strip>>;
|
|
97
|
+
clients: {
|
|
98
|
+
list: {
|
|
99
|
+
query: z__default.ZodObject<{
|
|
100
|
+
page: z__default.ZodOptional<z__default.ZodNumber>;
|
|
101
|
+
perPage: z__default.ZodOptional<z__default.ZodNumber>;
|
|
102
|
+
}, z__default.core.$strip>;
|
|
103
|
+
summary: "List all clients";
|
|
104
|
+
method: "GET";
|
|
105
|
+
headers: z__default.ZodString;
|
|
106
|
+
path: "/admin/clients";
|
|
107
|
+
responses: {
|
|
108
|
+
200: z__default.ZodArray<z__default.ZodObject<{
|
|
109
|
+
name: z__default.ZodString;
|
|
110
|
+
}, z__default.core.$strip>>;
|
|
111
|
+
};
|
|
115
112
|
};
|
|
116
113
|
};
|
|
117
114
|
};
|
|
@@ -161,52 +158,49 @@ declare const contract: {
|
|
|
161
158
|
};
|
|
162
159
|
};
|
|
163
160
|
admin: {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
summary: "List all clients";
|
|
170
|
-
method: "GET";
|
|
171
|
-
headers: z.ZodString;
|
|
172
|
-
path: "/admin/clients";
|
|
173
|
-
responses: {
|
|
174
|
-
401: z.ZodObject<{
|
|
175
|
-
error: z.ZodObject<{
|
|
176
|
-
type: z.ZodLiteral<"UNAUTHORIZED">;
|
|
177
|
-
message: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
178
|
-
}, zod_v4_core.$strip>;
|
|
161
|
+
clients: {
|
|
162
|
+
list: {
|
|
163
|
+
query: z.ZodObject<{
|
|
164
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
165
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
179
166
|
}, zod_v4_core.$strip>;
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
167
|
+
summary: "List all clients";
|
|
168
|
+
method: "GET";
|
|
169
|
+
headers: z.ZodString;
|
|
170
|
+
path: "/admin/clients";
|
|
171
|
+
responses: {
|
|
172
|
+
401: z.ZodObject<{
|
|
173
|
+
error: z.ZodObject<{
|
|
174
|
+
type: z.ZodLiteral<"UNAUTHORIZED">;
|
|
175
|
+
message: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
176
|
+
}, zod_v4_core.$strip>;
|
|
185
177
|
}, zod_v4_core.$strip>;
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
178
|
+
404: z.ZodObject<{
|
|
179
|
+
error: z.ZodObject<{
|
|
180
|
+
type: z.ZodLiteral<"ENTITY_NOT_FOUND">;
|
|
181
|
+
entity: z.ZodString;
|
|
182
|
+
message: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
183
|
+
}, zod_v4_core.$strip>;
|
|
192
184
|
}, zod_v4_core.$strip>;
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
185
|
+
409: z.ZodObject<{
|
|
186
|
+
error: z.ZodObject<{
|
|
187
|
+
type: z.ZodLiteral<"ENTITY_ALREADY_EXISTS">;
|
|
188
|
+
entity: z.ZodString;
|
|
189
|
+
message: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
190
|
+
}, zod_v4_core.$strip>;
|
|
198
191
|
}, zod_v4_core.$strip>;
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
192
|
+
500: z.ZodObject<{
|
|
193
|
+
error: z.ZodObject<{
|
|
194
|
+
type: z.ZodLiteral<"INTERNAL_SERVER_ERROR">;
|
|
195
|
+
message: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
196
|
+
}, zod_v4_core.$strip>;
|
|
197
|
+
}, zod_v4_core.$strip>;
|
|
198
|
+
200: z.ZodArray<z.ZodObject<{
|
|
199
|
+
name: z.ZodString;
|
|
200
|
+
}, zod_v4_core.$strip>>;
|
|
201
|
+
};
|
|
202
|
+
strictStatusCodes: true;
|
|
208
203
|
};
|
|
209
|
-
strictStatusCodes: true;
|
|
210
204
|
};
|
|
211
205
|
};
|
|
212
206
|
};
|
package/dist/index.js
CHANGED
|
@@ -63,35 +63,31 @@ var authContract = c.router({
|
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
|
|
66
|
-
// src/schemas/user.ts
|
|
67
|
-
import z3 from "zod";
|
|
68
|
-
var userRoleSchema = z3.enum(["ROLE_USER", "ROLE_ADMIN"]);
|
|
69
|
-
|
|
70
66
|
// src/contracts/admin.contract.ts
|
|
71
67
|
import { initContract as initContract2 } from "@ts-rest/core";
|
|
72
|
-
import
|
|
68
|
+
import z3 from "zod";
|
|
73
69
|
var c2 = initContract2();
|
|
74
|
-
var adminContract =
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
}
|
|
70
|
+
var adminContract = {
|
|
71
|
+
clients: c2.router({
|
|
72
|
+
list: {
|
|
73
|
+
method: "GET",
|
|
74
|
+
path: "/admin/clients",
|
|
75
|
+
headers: authorizationHeader,
|
|
76
|
+
query: z3.object({
|
|
77
|
+
page: z3.number().positive().optional(),
|
|
78
|
+
perPage: z3.number().positive().optional()
|
|
79
|
+
}),
|
|
80
|
+
responses: {
|
|
81
|
+
200: z3.array(
|
|
82
|
+
z3.object({
|
|
83
|
+
name: z3.string()
|
|
84
|
+
})
|
|
85
|
+
)
|
|
86
|
+
},
|
|
87
|
+
summary: "List all clients"
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
};
|
|
95
91
|
|
|
96
92
|
// src/contract.ts
|
|
97
93
|
import { initContract as initContract3 } from "@ts-rest/core";
|
package/package.json
CHANGED