@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 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 import_zod4 = __toESM(require("zod"), 1);
109
+ var import_zod3 = __toESM(require("zod"), 1);
114
110
  var c2 = (0, import_core2.initContract)();
115
- var adminContract = c2.router({
116
- login: {
117
- method: "GET",
118
- path: "/admin/clients",
119
- headers: authorizationHeader,
120
- query: import_zod4.default.object({
121
- page: import_zod4.default.number().positive().optional(),
122
- perPage: import_zod4.default.number().positive().optional()
123
- }),
124
- responses: {
125
- 200: import_zod4.default.array(
126
- import_zod4.default.object({
127
- name: import_zod4.default.string(),
128
- email: import_zod4.default.string(),
129
- roles: import_zod4.default.array(userRoleSchema)
130
- })
131
- )
132
- },
133
- summary: "List all clients"
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
- login: {
98
- query: z__default.ZodObject<{
99
- page: z__default.ZodOptional<z__default.ZodNumber>;
100
- perPage: z__default.ZodOptional<z__default.ZodNumber>;
101
- }, z__default.core.$strip>;
102
- summary: "List all clients";
103
- method: "GET";
104
- headers: z__default.ZodString;
105
- path: "/admin/clients";
106
- responses: {
107
- 200: z__default.ZodArray<z__default.ZodObject<{
108
- name: z__default.ZodString;
109
- email: z__default.ZodString;
110
- roles: z__default.ZodArray<z__default.ZodEnum<{
111
- ROLE_USER: "ROLE_USER";
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
- login: {
165
- query: z.ZodObject<{
166
- page: z.ZodOptional<z.ZodNumber>;
167
- perPage: z.ZodOptional<z.ZodNumber>;
168
- }, zod_v4_core.$strip>;
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
- 404: z.ZodObject<{
181
- error: z.ZodObject<{
182
- type: z.ZodLiteral<"ENTITY_NOT_FOUND">;
183
- entity: z.ZodString;
184
- message: z.ZodOptional<z.ZodDefault<z.ZodString>>;
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
- }, zod_v4_core.$strip>;
187
- 409: z.ZodObject<{
188
- error: z.ZodObject<{
189
- type: z.ZodLiteral<"ENTITY_ALREADY_EXISTS">;
190
- entity: z.ZodString;
191
- message: z.ZodOptional<z.ZodDefault<z.ZodString>>;
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
- }, zod_v4_core.$strip>;
194
- 500: z.ZodObject<{
195
- error: z.ZodObject<{
196
- type: z.ZodLiteral<"INTERNAL_SERVER_ERROR">;
197
- message: z.ZodOptional<z.ZodDefault<z.ZodString>>;
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
- }, zod_v4_core.$strip>;
200
- 200: z.ZodArray<z.ZodObject<{
201
- name: z.ZodString;
202
- email: z.ZodString;
203
- roles: z.ZodArray<z.ZodEnum<{
204
- ROLE_USER: "ROLE_USER";
205
- ROLE_ADMIN: "ROLE_ADMIN";
206
- }>>;
207
- }, zod_v4_core.$strip>>;
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
- login: {
98
- query: z__default.ZodObject<{
99
- page: z__default.ZodOptional<z__default.ZodNumber>;
100
- perPage: z__default.ZodOptional<z__default.ZodNumber>;
101
- }, z__default.core.$strip>;
102
- summary: "List all clients";
103
- method: "GET";
104
- headers: z__default.ZodString;
105
- path: "/admin/clients";
106
- responses: {
107
- 200: z__default.ZodArray<z__default.ZodObject<{
108
- name: z__default.ZodString;
109
- email: z__default.ZodString;
110
- roles: z__default.ZodArray<z__default.ZodEnum<{
111
- ROLE_USER: "ROLE_USER";
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
- login: {
165
- query: z.ZodObject<{
166
- page: z.ZodOptional<z.ZodNumber>;
167
- perPage: z.ZodOptional<z.ZodNumber>;
168
- }, zod_v4_core.$strip>;
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
- 404: z.ZodObject<{
181
- error: z.ZodObject<{
182
- type: z.ZodLiteral<"ENTITY_NOT_FOUND">;
183
- entity: z.ZodString;
184
- message: z.ZodOptional<z.ZodDefault<z.ZodString>>;
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
- }, zod_v4_core.$strip>;
187
- 409: z.ZodObject<{
188
- error: z.ZodObject<{
189
- type: z.ZodLiteral<"ENTITY_ALREADY_EXISTS">;
190
- entity: z.ZodString;
191
- message: z.ZodOptional<z.ZodDefault<z.ZodString>>;
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
- }, zod_v4_core.$strip>;
194
- 500: z.ZodObject<{
195
- error: z.ZodObject<{
196
- type: z.ZodLiteral<"INTERNAL_SERVER_ERROR">;
197
- message: z.ZodOptional<z.ZodDefault<z.ZodString>>;
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
- }, zod_v4_core.$strip>;
200
- 200: z.ZodArray<z.ZodObject<{
201
- name: z.ZodString;
202
- email: z.ZodString;
203
- roles: z.ZodArray<z.ZodEnum<{
204
- ROLE_USER: "ROLE_USER";
205
- ROLE_ADMIN: "ROLE_ADMIN";
206
- }>>;
207
- }, zod_v4_core.$strip>>;
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 z4 from "zod";
68
+ import z3 from "zod";
73
69
  var c2 = initContract2();
74
- var adminContract = c2.router({
75
- login: {
76
- method: "GET",
77
- path: "/admin/clients",
78
- headers: authorizationHeader,
79
- query: z4.object({
80
- page: z4.number().positive().optional(),
81
- perPage: z4.number().positive().optional()
82
- }),
83
- responses: {
84
- 200: z4.array(
85
- z4.object({
86
- name: z4.string(),
87
- email: z4.string(),
88
- roles: z4.array(userRoleSchema)
89
- })
90
- )
91
- },
92
- summary: "List all clients"
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
@@ -2,7 +2,7 @@
2
2
  "name": "@abella-bilhalba-engenharia/api-client",
3
3
  "description": "Type-safe Client for Abella Bilhalba Engenharia API.",
4
4
  "author": "TheDevick",
5
- "version": "0.0.14",
5
+ "version": "0.0.16",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "types": "./dist/index.d.ts",