@sorokchat-messanger/contracts 1.0.2

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.

Potentially problematic release.


This version of @sorokchat-messanger/contracts might be problematic. Click here for more details.

Files changed (96) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -0
  3. package/dist/authorization/authorized.schema.d.ts +6 -0
  4. package/dist/authorization/authorized.schema.d.ts.map +1 -0
  5. package/dist/authorization/authorized.schema.js +5 -0
  6. package/dist/authorization/authorized.schema.js.map +1 -0
  7. package/dist/authorization/controller.d.ts +9 -0
  8. package/dist/authorization/controller.d.ts.map +1 -0
  9. package/dist/authorization/controller.js +9 -0
  10. package/dist/authorization/controller.js.map +1 -0
  11. package/dist/authorization/index.d.ts +5 -0
  12. package/dist/authorization/index.d.ts.map +1 -0
  13. package/dist/authorization/index.js +5 -0
  14. package/dist/authorization/index.js.map +1 -0
  15. package/dist/authorization/login.schema.d.ts +7 -0
  16. package/dist/authorization/login.schema.d.ts.map +1 -0
  17. package/dist/authorization/login.schema.js +3 -0
  18. package/dist/authorization/login.schema.js.map +1 -0
  19. package/dist/authorization/messages.d.ts +4 -0
  20. package/dist/authorization/messages.d.ts.map +1 -0
  21. package/dist/authorization/messages.js +4 -0
  22. package/dist/authorization/messages.js.map +1 -0
  23. package/dist/browser/index.d.ts +5 -0
  24. package/dist/browser/index.d.ts.map +1 -0
  25. package/dist/browser/index.js +5 -0
  26. package/dist/browser/index.js.map +1 -0
  27. package/dist/chats/controller.d.ts +13 -0
  28. package/dist/chats/controller.d.ts.map +1 -0
  29. package/dist/chats/controller.js +13 -0
  30. package/dist/chats/controller.js.map +1 -0
  31. package/dist/chats/get-chat.schema.d.ts +14 -0
  32. package/dist/chats/get-chat.schema.d.ts.map +1 -0
  33. package/dist/chats/get-chat.schema.js +10 -0
  34. package/dist/chats/get-chat.schema.js.map +1 -0
  35. package/dist/chats/get-member.schema.d.ts +9 -0
  36. package/dist/chats/get-member.schema.d.ts.map +1 -0
  37. package/dist/chats/get-member.schema.js +8 -0
  38. package/dist/chats/get-member.schema.js.map +1 -0
  39. package/dist/chats/index.d.ts +7 -0
  40. package/dist/chats/index.d.ts.map +1 -0
  41. package/dist/chats/index.js +7 -0
  42. package/dist/chats/index.js.map +1 -0
  43. package/dist/chats/messages.d.ts +7 -0
  44. package/dist/chats/messages.d.ts.map +1 -0
  45. package/dist/chats/messages.js +7 -0
  46. package/dist/chats/messages.js.map +1 -0
  47. package/dist/chats/new-chat.schema.d.ts +7 -0
  48. package/dist/chats/new-chat.schema.d.ts.map +1 -0
  49. package/dist/chats/new-chat.schema.js +6 -0
  50. package/dist/chats/new-chat.schema.js.map +1 -0
  51. package/dist/chats/update-chat.schema.d.ts +7 -0
  52. package/dist/chats/update-chat.schema.d.ts.map +1 -0
  53. package/dist/chats/update-chat.schema.js +3 -0
  54. package/dist/chats/update-chat.schema.js.map +1 -0
  55. package/dist/common/error.schema.d.ts +7 -0
  56. package/dist/common/error.schema.d.ts.map +1 -0
  57. package/dist/common/error.schema.js +6 -0
  58. package/dist/common/error.schema.js.map +1 -0
  59. package/dist/common/index.d.ts +2 -0
  60. package/dist/common/index.d.ts.map +1 -0
  61. package/dist/common/index.js +2 -0
  62. package/dist/common/index.js.map +1 -0
  63. package/dist/node/index.d.ts +6 -0
  64. package/dist/node/index.d.ts.map +1 -0
  65. package/dist/node/index.js +6 -0
  66. package/dist/node/index.js.map +1 -0
  67. package/dist/openapi/index.d.ts +2 -0
  68. package/dist/openapi/index.d.ts.map +1 -0
  69. package/dist/openapi/index.js +2 -0
  70. package/dist/openapi/index.js.map +1 -0
  71. package/dist/openapi/nestjs.resolver.d.ts +3 -0
  72. package/dist/openapi/nestjs.resolver.d.ts.map +1 -0
  73. package/dist/openapi/nestjs.resolver.js +17 -0
  74. package/dist/openapi/nestjs.resolver.js.map +1 -0
  75. package/dist/users/get-user.schema.d.ts +9 -0
  76. package/dist/users/get-user.schema.d.ts.map +1 -0
  77. package/dist/users/get-user.schema.js +9 -0
  78. package/dist/users/get-user.schema.js.map +1 -0
  79. package/dist/users/index.d.ts +5 -0
  80. package/dist/users/index.d.ts.map +1 -0
  81. package/dist/users/index.js +5 -0
  82. package/dist/users/index.js.map +1 -0
  83. package/dist/users/messages.d.ts +3 -0
  84. package/dist/users/messages.d.ts.map +1 -0
  85. package/dist/users/messages.js +3 -0
  86. package/dist/users/messages.js.map +1 -0
  87. package/dist/users/new-user.schema.d.ts +10 -0
  88. package/dist/users/new-user.schema.d.ts.map +1 -0
  89. package/dist/users/new-user.schema.js +18 -0
  90. package/dist/users/new-user.schema.js.map +1 -0
  91. package/dist/users/update-user.schema.d.ts +8 -0
  92. package/dist/users/update-user.schema.d.ts.map +1 -0
  93. package/dist/users/update-user.schema.js +4 -0
  94. package/dist/users/update-user.schema.js.map +1 -0
  95. package/openapi.yaml +568 -0
  96. package/package.json +64 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-user.schema.js","sourceRoot":"","sources":["../../src/users/new-user.schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AACrC,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEvC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,KAAK,EAAE,CAAC;SACL,MAAM,CAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC;SAC5C,QAAQ,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC1C,QAAQ,EAAE,CAAC;SACR,MAAM,CAAC,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;SAC7C,GAAG,CAAC,mBAAmB,EAAE;QACxB,OAAO,EAAE,6BAA6B,mBAAmB,WAAW;KACrE,CAAC;SACD,GAAG,CAAC,mBAAmB,EAAE;QACxB,OAAO,EAAE,8BAA8B,mBAAmB,WAAW;KACtE,CAAC;IACJ,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,6BAA6B,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC7E,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import z from "zod";
2
+ export declare const UpdateUserSchema: z.ZodObject<{
3
+ login: z.ZodOptional<z.ZodString>;
4
+ password: z.ZodOptional<z.ZodString>;
5
+ displayName: z.ZodOptional<z.ZodOptional<z.ZodString>>;
6
+ }, z.core.$strip>;
7
+ export type UpdateUserPayload = z.infer<typeof UpdateUserSchema>;
8
+ //# sourceMappingURL=update-user.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-user.schema.d.ts","sourceRoot":"","sources":["../../src/users/update-user.schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAGpB,eAAO,MAAM,gBAAgB;;;;iBAA0B,CAAC;AACxD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import z from "zod";
2
+ import { NewUserSchema } from "./new-user.schema.js";
3
+ export const UpdateUserSchema = NewUserSchema.partial();
4
+ //# sourceMappingURL=update-user.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-user.schema.js","sourceRoot":"","sources":["../../src/users/update-user.schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC,OAAO,EAAE,CAAC"}
package/openapi.yaml ADDED
@@ -0,0 +1,568 @@
1
+ openapi: 3.0.3
2
+ info:
3
+ title: Sorokchat
4
+ description: Sorokchat - Український захищений месенджер
5
+ version: 1.0.0
6
+ security:
7
+ - bearerAuthorization: []
8
+ components:
9
+ securitySchemes:
10
+ bearerAuthorization:
11
+ type: http
12
+ bearerFormat: JWT
13
+ scheme: bearer
14
+ cookieAuthorization:
15
+ type: apiKey
16
+ in: cookie
17
+ name: __Host-refresh-token
18
+ schemas:
19
+ RegisterPayload:
20
+ type: object
21
+ required:
22
+ - login
23
+ - password
24
+ properties:
25
+ login:
26
+ type: string
27
+ description: Логін користувача
28
+ example: andrey
29
+ password:
30
+ type: string
31
+ description: Пароль користувача
32
+ example: <PASSWORD>
33
+ displayName:
34
+ type: string
35
+ description: Видиме ім'я користувача
36
+ example: Андрій
37
+ LoginPayload:
38
+ type: object
39
+ required:
40
+ - login
41
+ - password
42
+ properties:
43
+ login:
44
+ type: string
45
+ description: Логін користувача
46
+ example: andrey
47
+ password:
48
+ type: string
49
+ description: Пароль користувача
50
+ example: <PASSWORD>
51
+ AuthorizedPayload:
52
+ type: object
53
+ required:
54
+ - accessToken
55
+ properties:
56
+ accessToken:
57
+ type: string
58
+ description: Токен доступу
59
+ example: <TOKEN>
60
+ ErrorPayload:
61
+ type: object
62
+ required:
63
+ - message
64
+ - statusCode
65
+ properties:
66
+ message:
67
+ type: string
68
+ description: Повідомлення помилки
69
+ example: Не коректні данні
70
+ statusCode:
71
+ type: integer
72
+ description: Код помилки
73
+ example: 400
74
+ additionalProperties: true
75
+ GetUserPayload:
76
+ type: object
77
+ required:
78
+ - id
79
+ - login
80
+ - displayName
81
+ properties:
82
+ id:
83
+ type: integer
84
+ description: Унікальний ідентифікатор користувача
85
+ example: 1
86
+ login:
87
+ type: string
88
+ description: Логін користувача
89
+ example: andrey
90
+ displayName:
91
+ type: string
92
+ description: Видиме ім'я користувача
93
+ example: Андрій
94
+ role:
95
+ type: string
96
+ description: Роль користувача
97
+ example: USER
98
+ CreateChatPayload:
99
+ type: object
100
+ required:
101
+ - name
102
+ - description
103
+ properties:
104
+ name:
105
+ type: string
106
+ description: Назва чату
107
+ example: Крутий чат
108
+ description:
109
+ type: string
110
+ description: Опис чату
111
+ example: Дуже крутий чат
112
+ UpdateChatPayload:
113
+ type: object
114
+ properties:
115
+ name:
116
+ type: string
117
+ description: Назва чату
118
+ example: Крутий чат
119
+ description:
120
+ type: string
121
+ description: Опис чату
122
+ example: Дуже крутий чат
123
+ GetMemberPayload:
124
+ type: object
125
+ required:
126
+ - userId
127
+ - login
128
+ - displayName
129
+ - role
130
+ properties:
131
+ userId:
132
+ type: integer
133
+ description: Унікальний ідентифікатор користувача
134
+ example: 1
135
+ login:
136
+ type: string
137
+ description: Логін користувача
138
+ example: andrey
139
+ displayName:
140
+ type: string
141
+ description: Видеме ім'я користувача
142
+ example: Андрій
143
+ role:
144
+ type: string
145
+ description: Роль користувача у чаті
146
+ example: MEMBER
147
+ GetChatPayload:
148
+ type: object
149
+ required:
150
+ - id
151
+ - name
152
+ - description
153
+ properties:
154
+ id:
155
+ type: integer
156
+ description: Унікальний ідентифікатор чату
157
+ example: 1
158
+ name:
159
+ type: string
160
+ description: Назва чату
161
+ example: Крутий чат
162
+ description:
163
+ type: string
164
+ description: Опис чату
165
+ example: Дуже крутий чат
166
+ members:
167
+ type: array
168
+ minLength: 1
169
+ items:
170
+ $ref: "#/components/schemas/GetMemberPayload"
171
+ GetChatListPayload:
172
+ type: array
173
+ items:
174
+ $ref: "#/components/schemas/GetChatPayload"
175
+ responses:
176
+ BadRequestResponse:
177
+ description: Не коректні данні
178
+ content:
179
+ application/json:
180
+ schema:
181
+ $ref: "#/components/schemas/ErrorPayload"
182
+ UnauthorizedResponse:
183
+ description: Користувач не авторизований
184
+ headers:
185
+ WWW-Authenticate:
186
+ schema:
187
+ type: string
188
+ description: Бажаний спосіб авторизації
189
+ example: Bearer
190
+ description: Спосіб авторизації, який очікує сервер
191
+ content:
192
+ application/json:
193
+ schema:
194
+ $ref: "#/components/schemas/ErrorPayload"
195
+ ForbiddenResponse:
196
+ description: У доступі відмовлено
197
+ content:
198
+ application/json:
199
+ schema:
200
+ $ref: "#/components/schemas/ErrorPayload"
201
+ NotFoundResponse:
202
+ description: Не знайдено
203
+ content:
204
+ authorization/json:
205
+ schema:
206
+ $ref: "#/components/schemas/ErrorPayload"
207
+ ConflictResponse:
208
+ description: Сутність вже існує
209
+ content:
210
+ authorization/json:
211
+ schema:
212
+ $ref: "#/components/schemas/ErrorPayload"
213
+ paths:
214
+ /authorization/register:
215
+ post:
216
+ security: []
217
+ summary: Реєстрація
218
+ description: Реєстрація користувача у системі
219
+ operationId: register
220
+ tags:
221
+ - Авторизація
222
+ requestBody:
223
+ content:
224
+ application/json:
225
+ schema:
226
+ $ref: "#/components/schemas/RegisterPayload"
227
+ responses:
228
+ 201:
229
+ description: Успішна реєстрація
230
+ headers:
231
+ Location:
232
+ schema:
233
+ type: string
234
+ description: Посилання на свої данні
235
+ example: authorization/profile
236
+ content:
237
+ application/json:
238
+ schema:
239
+ $ref: "#/components/schemas/AuthorizedPayload"
240
+ 400:
241
+ $ref: "#/components/responses/BadRequestResponse"
242
+ 403:
243
+ $ref: "#/components/responses/ForbiddenResponse"
244
+ 409:
245
+ $ref: "#/components/responses/ConflictResponse"
246
+ /authorization/login:
247
+ post:
248
+ security: []
249
+ summary: Вхід
250
+ description: Вхід користувача у систему
251
+ operationId: login
252
+ tags:
253
+ - Авторизація
254
+ requestBody:
255
+ content:
256
+ application/json:
257
+ schema:
258
+ $ref: "#/components/schemas/LoginPayload"
259
+ responses:
260
+ 201:
261
+ description: Успішний вхід
262
+ headers:
263
+ Location:
264
+ schema:
265
+ type: string
266
+ description: Посилання на свої данні
267
+ example: authorization/profile
268
+ content:
269
+ application/json:
270
+ schema:
271
+ $ref: "#/components/schemas/AuthorizedPayload"
272
+ 400:
273
+ $ref: "#/components/responses/BadRequestResponse"
274
+ 403:
275
+ $ref: "#/components/responses/ForbiddenResponse"
276
+ /authorization/logout:
277
+ delete:
278
+ summary: Вихід із системи
279
+ description: Вихід користувача із системи
280
+ operationId: logout
281
+ tags:
282
+ - Авторизація
283
+ responses:
284
+ 204:
285
+ description: Успішний вихід
286
+ 401:
287
+ $ref: "#/components/responses/UnauthorizedResponse"
288
+ /authorization/refresh-tokens:
289
+ put:
290
+ summary: Оновлення токенів
291
+ description: Оновлює токени за наявності токена оновлення
292
+ operationId: refresh-tokens
293
+ tags:
294
+ - Авторизація
295
+ responses:
296
+ 200:
297
+ description: Успішне оновлення токенів
298
+ content:
299
+ application/json:
300
+ schema:
301
+ $ref: "#/components/schemas/AuthorizedPayload"
302
+ 401:
303
+ $ref: "#/components/responses/UnauthorizedResponse"
304
+ /authorization/profile:
305
+ get:
306
+ summary: Профіль
307
+ description: Можливість для користувача отримати свої данні
308
+ operationId: profile
309
+ tags:
310
+ - Авторизація
311
+ responses:
312
+ 200:
313
+ description: Успішне отримання себе
314
+ content:
315
+ application/json:
316
+ schema:
317
+ $ref: "#/components/schemas/GetUserPayload"
318
+ 401:
319
+ $ref: "#/components/responses/UnauthorizedResponse"
320
+ /chats:
321
+ post:
322
+ summary: Новий чат
323
+ description: Створення нового чату у системі
324
+ operationId: createChat
325
+ tags:
326
+ - Чати
327
+ requestBody:
328
+ content:
329
+ application/json:
330
+ schema:
331
+ $ref: "#/components/schemas/CreateChatPayload"
332
+ responses:
333
+ 201:
334
+ description: Успішне створення чату
335
+ headers:
336
+ Location:
337
+ schema:
338
+ type: string
339
+ description: Посилання на створений чат
340
+ example: /chats/by-id/1
341
+ content:
342
+ application/json:
343
+ schema:
344
+ $ref: "#/components/schemas/GetChatPayload"
345
+ 400:
346
+ $ref: "#/components/responses/BadRequestResponse"
347
+ 401:
348
+ $ref: "#/components/responses/UnauthorizedResponse"
349
+ /chats/me:
350
+ get:
351
+ summary: Мої чати
352
+ description: Чати авторизованого користувача
353
+ operationId: my-chats
354
+ tags:
355
+ - Чати
356
+ responses:
357
+ 200:
358
+ description: Успішне отримання чатів
359
+ content:
360
+ application/json:
361
+ schema:
362
+ $ref: "#/components/schemas/GetChatListPayload"
363
+ 401:
364
+ $ref: "#/components/responses/UnauthorizedResponse"
365
+ /chats/by-id/{id}:
366
+ parameters:
367
+ - in: path
368
+ required: true
369
+ name: id
370
+ schema:
371
+ type: integer
372
+ description: Унікальний ідентифікатор чату
373
+ example: 1
374
+ put:
375
+ summary: Оновлення чату
376
+ description: Адмін чату може оновити чат
377
+ operationId: update-chat
378
+ tags:
379
+ - Чати
380
+ requestBody:
381
+ content:
382
+ application/json:
383
+ schema:
384
+ $ref: "#/components/schemas/UpdateChatPayload"
385
+ responses:
386
+ 204:
387
+ description: Успішне оновлення чату
388
+ 400:
389
+ $ref: "#/components/responses/BadRequestResponse"
390
+ 401:
391
+ $ref: "#/components/responses/UnauthorizedResponse"
392
+ 403:
393
+ $ref: "#/components/responses/ForbiddenResponse"
394
+ 404:
395
+ $ref: "#/components/responses/NotFoundResponse"
396
+ delete:
397
+ summary: Видалення чату
398
+ description: Адмін може видалити чат
399
+ operationId: delete-chat
400
+ tags:
401
+ - Чати
402
+ responses:
403
+ 204:
404
+ description: Успішне видалення чату
405
+ 401:
406
+ $ref: "#/components/responses/UnauthorizedResponse"
407
+ 403:
408
+ $ref: "#/components/responses/ForbiddenResponse"
409
+ 404:
410
+ $ref: "#/components/responses/NotFoundResponse"
411
+ /chats/by-id/{id}/add-member/{userId}:
412
+ put:
413
+ parameters:
414
+ - name: id
415
+ schema:
416
+ type: integer
417
+ description: Унікальне ім'я чату
418
+ example: 1
419
+ in: path
420
+ required: true
421
+ - name: userId
422
+ schema:
423
+ type: integer
424
+ description: Унікальне ім'я користувача
425
+ example: 1
426
+ in: path
427
+ required: true
428
+ summary: Додати учасника
429
+ description: Адмін додає учасника
430
+ operationId: add-member-to-chat
431
+ tags:
432
+ - Чати
433
+ responses:
434
+ 204:
435
+ description: Успішне додавання учасника до чату
436
+ 401:
437
+ $ref: "#/components/responses/UnauthorizedResponse"
438
+ 403:
439
+ $ref: "#/components/responses/ForbiddenResponse"
440
+ 404:
441
+ $ref: "#/components/responses/NotFoundResponse"
442
+ 409:
443
+ $ref: "#/components/responses/ConflictResponse"
444
+ /chats/by-id/{id}/remove-member/{userId}:
445
+ put:
446
+ parameters:
447
+ - name: id
448
+ schema:
449
+ type: integer
450
+ description: Унікальне ім'я чату
451
+ example: 1
452
+ in: path
453
+ required: true
454
+ - name: userId
455
+ schema:
456
+ type: integer
457
+ description: Унікальне ім'я користувача
458
+ example: 1
459
+ in: path
460
+ required: true
461
+ summary: Видалити учасника
462
+ description: Адмін видаляє учасника
463
+ operationId: remove-member-from-chat
464
+ tags:
465
+ - Чати
466
+ responses:
467
+ 204:
468
+ description: Успішне видалення учасника із чату
469
+ 401:
470
+ $ref: "#/components/responses/UnauthorizedResponse"
471
+ 403:
472
+ $ref: "#/components/responses/ForbiddenResponse"
473
+ 404:
474
+ $ref: "#/components/responses/NotFoundResponse"
475
+ /chats/by-id/{id}/leave:
476
+ put:
477
+ summary: Покинути чат
478
+ description: Учасник може покинути чат
479
+ operationId: leave-chat
480
+ parameters:
481
+ - in: path
482
+ required: true
483
+ name: id
484
+ schema:
485
+ type: integer
486
+ description: Унікальний ідентифікатор чату
487
+ example: 1
488
+ tags:
489
+ - Чати
490
+ responses:
491
+ 204:
492
+ description: Успішний вихід із чату
493
+ 400:
494
+ $ref: "#/components/responses/BadRequestResponse"
495
+ 401:
496
+ $ref: "#/components/responses/UnauthorizedResponse"
497
+ 403:
498
+ $ref: "#/components/responses/ForbiddenResponse"
499
+ /chats/by-id/{id}/grant/{userId}/{role}:
500
+ put:
501
+ summary: Дати користувачу роль
502
+ description: Адмін може дати роль користувачу у чаті
503
+ operationId: grant-member
504
+ tags:
505
+ - Чати
506
+ parameters:
507
+ - name: id
508
+ schema:
509
+ type: integer
510
+ description: Унікальне ім'я чату
511
+ example: 1
512
+ in: path
513
+ required: true
514
+ - name: userId
515
+ schema:
516
+ type: integer
517
+ description: Унікальне ім'я користувача
518
+ example: 1
519
+ in: path
520
+ required: true
521
+ - name: role
522
+ in: path
523
+ required: true
524
+ schema:
525
+ type: string
526
+ description: Роль користувача у чаті
527
+ responses:
528
+ 204:
529
+ description: Успішне надання ролі
530
+ 401:
531
+ $ref: "#/components/responses/UnauthorizedResponse"
532
+ 403:
533
+ $ref: "#/components/responses/ForbiddenResponse"
534
+ 404:
535
+ $ref: "#/components/responses/NotFoundResponse"
536
+ /chats/by-id/{id}/revoke/{userId}:
537
+ put:
538
+ summary: Відкликання ролі
539
+ description: Адмін може забрати роль учасника чату
540
+ operationId: revoke-member
541
+ parameters:
542
+ - name: id
543
+ schema:
544
+ type: integer
545
+ description: Унікальне ім'я чату
546
+ example: 1
547
+ in: path
548
+ required: true
549
+ - name: userId
550
+ schema:
551
+ type: integer
552
+ description: Унікальне ім'я користувача
553
+ example: 1
554
+ in: path
555
+ required: true
556
+ tags:
557
+ - Чати
558
+ responses:
559
+ 204:
560
+ description: Успішне відкликання ролі
561
+ 400:
562
+ $ref: "#/components/responses/BadRequestResponse"
563
+ 401:
564
+ $ref: "#/components/responses/UnauthorizedResponse"
565
+ 403:
566
+ $ref: "#/components/responses/ForbiddenResponse"
567
+ 404:
568
+ $ref: "#/components/responses/NotFoundResponse"
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@sorokchat-messanger/contracts",
3
+ "version": "1.0.2",
4
+ "description": "Contracts for sorokchat-messanger",
5
+ "keywords": [
6
+ "contracts",
7
+ "sorokchat",
8
+ "messanger"
9
+ ],
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "files": [
14
+ "dist",
15
+ "openapi.yaml"
16
+ ],
17
+ "author": "Srokovsky Andrey <Sorokovsky0809@gmail.com>",
18
+ "scripts": {
19
+ "build": "tsc"
20
+ },
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/sorokchat-messanger/contracts.git"
24
+ },
25
+ "homepage": "https://github.com/sorokchat-messanger/contracts#readme",
26
+ "bugs": {
27
+ "url": "https://github.com/sorokchat-messanger/contracts/issues"
28
+ },
29
+ "main": "dist/index.js",
30
+ "types": "dist/index.d.ts",
31
+ "license": "MIT",
32
+ "type": "module",
33
+ "dependencies": {
34
+ "js-yaml": "^5.2.3",
35
+ "zod": "^4.4.3"
36
+ },
37
+ "peerDependencies": {
38
+ "zod": "^4.4.3"
39
+ },
40
+ "devDependencies": {
41
+ "@nestjs/swagger": "^11.4.6",
42
+ "@types/js-yaml": "^4.0.9",
43
+ "@types/node": "^26.2.0",
44
+ "typescript": "^7.0.2"
45
+ },
46
+ "exports": {
47
+ "browser": {
48
+ "types": "./dist/browser/index.d.ts",
49
+ "import": "./dist/browser/index.js",
50
+ "require": "./dist/browser/index.js"
51
+ },
52
+ "node": {
53
+ "types": "./dist/node/index.d.ts",
54
+ "import": "./dist/node/index.js",
55
+ "require": "./dist/node/index.js"
56
+ },
57
+ "default": {
58
+ "types": "./dist/node/index.d.ts",
59
+ "import": "./dist/node/index.js",
60
+ "require": "./dist/node/index.js"
61
+ }
62
+ },
63
+ "packageManager": "yarn@4.18.0"
64
+ }