@kl1/contracts 1.0.96 → 1.0.98

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.js CHANGED
@@ -6062,6 +6062,9 @@ var CreateUserSchema = import_zod82.z.object({
6062
6062
  var UpdateUserSchema = CreateUserSchema.extend({
6063
6063
  newPassword: import_zod82.z.string()
6064
6064
  });
6065
+ var UpdateUserProfileSchema = import_zod82.z.object({
6066
+ password: import_zod82.z.string()
6067
+ });
6065
6068
 
6066
6069
  // src/user/index.ts
6067
6070
  var userContract = (0, import_core31.initContract)().router(
@@ -6078,7 +6081,10 @@ var userContract = (0, import_core31.initContract)().router(
6078
6081
  400: import_zod83.default.object({
6079
6082
  message: import_zod83.default.string()
6080
6083
  }),
6081
- 401: DefaultUnauthorizedSchema
6084
+ 401: DefaultUnauthorizedSchema,
6085
+ 404: DefaultNotFoundSchema,
6086
+ 422: DefaultUnprocessibleSchema,
6087
+ 500: DefaultErrorResponseSchema
6082
6088
  },
6083
6089
  summary: "Create a user."
6084
6090
  },
@@ -6124,15 +6130,38 @@ var userContract = (0, import_core31.initContract)().router(
6124
6130
  body: UpdateUserSchema,
6125
6131
  responses: {
6126
6132
  201: DefaultSuccessResponseSchema.extend({
6127
- role: UserSchema
6133
+ user: UserSchema
6128
6134
  }),
6129
6135
  400: import_zod83.default.object({
6130
6136
  message: import_zod83.default.string()
6131
6137
  }),
6132
- 401: DefaultUnauthorizedSchema
6138
+ 401: DefaultUnauthorizedSchema,
6139
+ 404: DefaultNotFoundSchema,
6140
+ 422: DefaultUnprocessibleSchema,
6141
+ 500: DefaultErrorResponseSchema
6133
6142
  },
6134
6143
  summary: "Update a user."
6135
6144
  },
6145
+ updateUserProfile: {
6146
+ method: "PATCH",
6147
+ path: "/profile/:id",
6148
+ pathParams: import_zod83.default.object({ id: import_zod83.default.string() }),
6149
+ headers: DefaultHeaderSchema,
6150
+ body: UpdateUserProfileSchema,
6151
+ responses: {
6152
+ 201: DefaultSuccessResponseSchema.extend({
6153
+ user: UserSchema
6154
+ }),
6155
+ 400: import_zod83.default.object({
6156
+ message: import_zod83.default.string()
6157
+ }),
6158
+ 401: DefaultUnauthorizedSchema,
6159
+ 404: DefaultNotFoundSchema,
6160
+ 422: DefaultUnprocessibleSchema,
6161
+ 500: DefaultErrorResponseSchema
6162
+ },
6163
+ summary: "Update a user profile."
6164
+ },
6136
6165
  deleteUser: {
6137
6166
  method: "DELETE",
6138
6167
  path: "/:id",
@@ -6141,6 +6170,8 @@ var userContract = (0, import_core31.initContract)().router(
6141
6170
  body: null,
6142
6171
  responses: {
6143
6172
  200: DefaultSuccessResponseSchema.extend({ message: import_zod83.default.string() }),
6173
+ 404: DefaultNotFoundSchema,
6174
+ 422: DefaultUnprocessibleSchema,
6144
6175
  500: DefaultErrorResponseSchema
6145
6176
  },
6146
6177
  summary: "Delete a user."