@hubex/mcp 0.2.0

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.
Files changed (92) hide show
  1. package/.env.example +54 -0
  2. package/CONNECTING.md +260 -0
  3. package/README.md +266 -0
  4. package/dist/auth.js +226 -0
  5. package/dist/config.js +120 -0
  6. package/dist/generated/manifest.js +3643 -0
  7. package/dist/guides/field-notes.json +27 -0
  8. package/dist/guides/loader.js +32 -0
  9. package/dist/guides/service-map.js +6 -0
  10. package/dist/http.js +93 -0
  11. package/dist/index/store.js +134 -0
  12. package/dist/index/types.js +1 -0
  13. package/dist/index.js +20 -0
  14. package/dist/paths.js +20 -0
  15. package/dist/pii/fields.js +100 -0
  16. package/dist/pii/mask.js +50 -0
  17. package/dist/pii/strategies.js +88 -0
  18. package/dist/schema/build-index.js +67 -0
  19. package/dist/schema/deref.js +87 -0
  20. package/dist/schema/describe.js +65 -0
  21. package/dist/server.js +62 -0
  22. package/dist/token-prompt.js +41 -0
  23. package/dist/tools/curated.js +151 -0
  24. package/dist/tools/discovery.js +187 -0
  25. package/dist/tools/guides.js +126 -0
  26. package/dist/tools/registry.js +37 -0
  27. package/dist/tools/request.js +170 -0
  28. package/dist/tools/types.js +1 -0
  29. package/docs/guides/assets.md +334 -0
  30. package/docs/guides/attributes.md +125 -0
  31. package/docs/guides/checklisttemplates.md +154 -0
  32. package/docs/guides/companies.md +57 -0
  33. package/docs/guides/dictionaries.md +64 -0
  34. package/docs/guides/lifecycle.md +263 -0
  35. package/docs/guides/materials.md +135 -0
  36. package/docs/guides/notifications.md +184 -0
  37. package/docs/guides/roles.md +125 -0
  38. package/docs/guides/sla.md +130 -0
  39. package/docs/guides/start.md +67 -0
  40. package/docs/guides/taskchecklists.md +149 -0
  41. package/docs/guides/taskcreate.md +260 -0
  42. package/docs/guides/taskedit.md +277 -0
  43. package/docs/guides/tasktypes.md +156 -0
  44. package/docs/guides/users.md +71 -0
  45. package/generated/index.dev.json +18776 -0
  46. package/generated/index.prod.json +18858 -0
  47. package/package.json +48 -0
  48. package/swagger/dev/ADM.json +27777 -0
  49. package/swagger/dev/AUTH.json +1739 -0
  50. package/swagger/dev/AUTHN.json +1250 -0
  51. package/swagger/dev/AUTHZ.json +1404 -0
  52. package/swagger/dev/CM.json +309 -0
  53. package/swagger/dev/COMMON.json +6543 -0
  54. package/swagger/dev/ES.json +28029 -0
  55. package/swagger/dev/EXPORT.json +4575 -0
  56. package/swagger/dev/IMPORT.json +1479 -0
  57. package/swagger/dev/LIC.json +224 -0
  58. package/swagger/dev/MSG.json +7883 -0
  59. package/swagger/dev/NEWS.json +348 -0
  60. package/swagger/dev/PA.json +5981 -0
  61. package/swagger/dev/PMP.json +3196 -0
  62. package/swagger/dev/PROXY.json +416 -0
  63. package/swagger/dev/REPORT.json +3921 -0
  64. package/swagger/dev/SC.json +3771 -0
  65. package/swagger/dev/SLA.json +2837 -0
  66. package/swagger/dev/TSTG.json +4981 -0
  67. package/swagger/dev/UI.json +4720 -0
  68. package/swagger/dev/WH.json +16796 -0
  69. package/swagger/dev/WORK.json +36024 -0
  70. package/swagger/dev/WSP.json +1612 -0
  71. package/swagger/prod/ADM.json +27777 -0
  72. package/swagger/prod/AUTH.json +1308 -0
  73. package/swagger/prod/AUTHN.json +2710 -0
  74. package/swagger/prod/AUTHZ.json +896 -0
  75. package/swagger/prod/CM.json +162 -0
  76. package/swagger/prod/COMMON.json +4910 -0
  77. package/swagger/prod/ES.json +28029 -0
  78. package/swagger/prod/EXPORT.json +3091 -0
  79. package/swagger/prod/LIC.json +123 -0
  80. package/swagger/prod/MSG.json +6239 -0
  81. package/swagger/prod/NEWS.json +295 -0
  82. package/swagger/prod/PA.json +5123 -0
  83. package/swagger/prod/PMP.json +2978 -0
  84. package/swagger/prod/PROXY.json +250 -0
  85. package/swagger/prod/REPORT.json +3729 -0
  86. package/swagger/prod/SC.json +3771 -0
  87. package/swagger/prod/SLA.json +2201 -0
  88. package/swagger/prod/TSTG.json +4220 -0
  89. package/swagger/prod/UI.json +3879 -0
  90. package/swagger/prod/WH.json +16730 -0
  91. package/swagger/prod/WORK.json +35994 -0
  92. package/swagger/prod/WSP.json +1468 -0
@@ -0,0 +1,1250 @@
1
+ {
2
+ "openapi": "3.0.1",
3
+ "info": {
4
+ "title": "Authenticatin and authorization API for HubEx",
5
+ "description": "Performs all of the operations, necessary to authenticate and authorize a user as a valid tenant member. Offers an API for registering, verifying e-mail, changing password, etc.",
6
+ "contact": {
7
+ "name": "SmartService Backend Team",
8
+ "email": "fmbackend@melston.ru"
9
+ },
10
+ "version": "v1.0.0.0"
11
+ },
12
+ "servers": [
13
+ {
14
+ "url": "/AUTHN"
15
+ }
16
+ ],
17
+ "paths": {
18
+ "/Accounts/login": {
19
+ "post": {
20
+ "tags": [
21
+ "Accounts"
22
+ ],
23
+ "summary": "Аутентифицирует учётную запись по логину, e-mail или телефону и паролю.",
24
+ "description": "## Пример запроса:\r\n```text\r\nPOST /Accounts/login\r\nAuthorization: Basic dXNlcjE6cGFzc3dvcmQx\r\n```\r\n \r\n## Пример успешного ответа (200):\r\n```json\r\n{\r\n \"access_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\r\n \"refresh_token\": null,\r\n \"expires_in\": 3600,\r\n \"jwtValidTill\": \"2024-06-15T10:00:00Z\",\r\n \"accountUserTypeID\": null,\r\n \"tenantEntities\": [\r\n {\r\n \"tenantID\": 10,\r\n \"name\": \"Demo Tenant\",\r\n \"fullName\": \"Demo Tenant LLC\",\r\n \"hasUserProfile\": true\r\n }\r\n ],\r\n \"requests\": [],\r\n \"accountHasUserProfile\": true,\r\n \"isCrossTenantAdmin\": false,\r\n \"isAnonymous\": false\r\n}\r\n```\r\n \r\n## Негативные сценарии:\r\n- 401 Unauthorized — отсутствуют или некорректны учётные данные Basic, пароль не задан или требуется смена пароля.\r\n- 403 Forbidden — аккаунт заблокирован.\r\n- 409 Conflict — аккаунт не найден или неверный пароль.",
25
+ "parameters": [
26
+ {
27
+ "name": "X-Application-ID",
28
+ "in": "header",
29
+ "description": "Идентификатор приложения. EngineerMobile - 1, CustomerMobile - 2, MainWeb - 3, AdminWeb - 4, Api - 5, PlateWeb - 6",
30
+ "schema": {
31
+ "enum": [
32
+ 1,
33
+ 2,
34
+ 3,
35
+ 4,
36
+ 5,
37
+ 6
38
+ ],
39
+ "type": "integer",
40
+ "format": "int32",
41
+ "default": 3,
42
+ "x-enumNames": [
43
+ "EngineerMobile",
44
+ "CustomerMobile",
45
+ "MainWeb",
46
+ "AdminWeb",
47
+ "Api",
48
+ "PlateWeb"
49
+ ]
50
+ }
51
+ }
52
+ ],
53
+ "responses": {
54
+ "200": {
55
+ "description": "Аутентификация выполнена успешно.",
56
+ "content": {
57
+ "text/plain": {
58
+ "schema": {
59
+ "$ref": "#/components/schemas/AuthenticationResult"
60
+ }
61
+ },
62
+ "application/json": {
63
+ "schema": {
64
+ "$ref": "#/components/schemas/AuthenticationResult"
65
+ }
66
+ },
67
+ "text/json": {
68
+ "schema": {
69
+ "$ref": "#/components/schemas/AuthenticationResult"
70
+ }
71
+ }
72
+ }
73
+ },
74
+ "401": {
75
+ "description": "Учётные данные отсутствуют, некорректны или требуется смена пароля."
76
+ },
77
+ "403": {
78
+ "description": "Аккаунт заблокирован."
79
+ },
80
+ "409": {
81
+ "description": "Аккаунт не найден или неверный пароль."
82
+ }
83
+ }
84
+ }
85
+ },
86
+ "/Accounts/login/sso": {
87
+ "post": {
88
+ "tags": [
89
+ "Accounts"
90
+ ],
91
+ "summary": "Аутентифицирует учётную запись через SSO (Keycloak).",
92
+ "description": "## Пример запроса:\r\n```text\r\nPOST /Accounts/login/sso\r\nAuthorization: Bearer <keycloak-access-token>\r\nX-Realm-ID: demo\r\n```\r\n \r\n## Пример успешного ответа (200):\r\nФормат ответа совпадает с `POST /Accounts/login`.\r\n \r\n## Негативные сценарии:\r\n- 403 Forbidden — отсутствует заголовок `X-Realm-ID`.\r\n- 401 Unauthorized — отсутствует или некорректен Bearer-токен Keycloak.\r\n- 409 Conflict — аккаунт не найден в HubEx.",
93
+ "parameters": [
94
+ {
95
+ "name": "X-Realm-ID",
96
+ "in": "header",
97
+ "description": "Идентификатор реалма SSO Keycloak",
98
+ "required": true,
99
+ "schema": {
100
+ "type": "string"
101
+ }
102
+ },
103
+ {
104
+ "name": "X-Application-ID",
105
+ "in": "header",
106
+ "description": "Идентификатор приложения. EngineerMobile - 1, CustomerMobile - 2, MainWeb - 3, AdminWeb - 4, Api - 5, PlateWeb - 6",
107
+ "schema": {
108
+ "enum": [
109
+ 1,
110
+ 2,
111
+ 3,
112
+ 4,
113
+ 5,
114
+ 6
115
+ ],
116
+ "type": "integer",
117
+ "format": "int32",
118
+ "default": 3,
119
+ "x-enumNames": [
120
+ "EngineerMobile",
121
+ "CustomerMobile",
122
+ "MainWeb",
123
+ "AdminWeb",
124
+ "Api",
125
+ "PlateWeb"
126
+ ]
127
+ }
128
+ }
129
+ ],
130
+ "responses": {
131
+ "200": {
132
+ "description": "SSO-аутентификация выполнена успешно.",
133
+ "content": {
134
+ "text/plain": {
135
+ "schema": {
136
+ "$ref": "#/components/schemas/AuthenticationResult"
137
+ }
138
+ },
139
+ "application/json": {
140
+ "schema": {
141
+ "$ref": "#/components/schemas/AuthenticationResult"
142
+ }
143
+ },
144
+ "text/json": {
145
+ "schema": {
146
+ "$ref": "#/components/schemas/AuthenticationResult"
147
+ }
148
+ }
149
+ }
150
+ },
151
+ "403": {
152
+ "description": "Не передан заголовок X-Realm-ID.",
153
+ "content": {
154
+ "text/plain": {
155
+ "schema": {
156
+ "type": "array",
157
+ "items": {
158
+ "$ref": "#/components/schemas/ErrorModel"
159
+ }
160
+ }
161
+ },
162
+ "application/json": {
163
+ "schema": {
164
+ "type": "array",
165
+ "items": {
166
+ "$ref": "#/components/schemas/ErrorModel"
167
+ }
168
+ }
169
+ },
170
+ "text/json": {
171
+ "schema": {
172
+ "type": "array",
173
+ "items": {
174
+ "$ref": "#/components/schemas/ErrorModel"
175
+ }
176
+ }
177
+ }
178
+ }
179
+ },
180
+ "401": {
181
+ "description": "Токен Keycloak отсутствует или некорректен."
182
+ },
183
+ "409": {
184
+ "description": "Аккаунт не найден."
185
+ }
186
+ }
187
+ }
188
+ },
189
+ "/Accounts/smsSend": {
190
+ "post": {
191
+ "tags": [
192
+ "Accounts"
193
+ ],
194
+ "summary": "Отправляет SMS с кодом для входа.",
195
+ "description": "## Пример запроса:\r\n```json\r\nPOST /Accounts/smsSend\r\n \r\n{\r\n \"phone\": \"+79001234567\"\r\n}\r\n```\r\n \r\n## Пример успешного ответа (200):\r\nТело ответа пустое.\r\n \r\n## Негативные сценарии:\r\n- 400 Bad Request — некорректное тело запроса.\r\n- 401 Unauthorized — регистрация аккаунта не завершена.\r\n- 404 Not Found — аккаунт с указанным телефоном не найден.\r\n- 403 Forbidden — аккаунт заблокирован.\r\n- 429 Too Many Requests — превышен лимит отправки SMS (заголовок `X-SmsBanTill`).",
196
+ "parameters": [
197
+ {
198
+ "name": "X-Application-ID",
199
+ "in": "header",
200
+ "description": "Идентификатор приложения. EngineerMobile - 1, CustomerMobile - 2, MainWeb - 3, AdminWeb - 4, Api - 5, PlateWeb - 6",
201
+ "schema": {
202
+ "enum": [
203
+ 1,
204
+ 2,
205
+ 3,
206
+ 4,
207
+ 5,
208
+ 6
209
+ ],
210
+ "type": "integer",
211
+ "format": "int32",
212
+ "default": 3,
213
+ "x-enumNames": [
214
+ "EngineerMobile",
215
+ "CustomerMobile",
216
+ "MainWeb",
217
+ "AdminWeb",
218
+ "Api",
219
+ "PlateWeb"
220
+ ]
221
+ }
222
+ }
223
+ ],
224
+ "requestBody": {
225
+ "description": "Номер телефона для отправки кода.",
226
+ "content": {
227
+ "application/json-patch+json": {
228
+ "schema": {
229
+ "$ref": "#/components/schemas/PhoneDto"
230
+ }
231
+ },
232
+ "application/json": {
233
+ "schema": {
234
+ "$ref": "#/components/schemas/PhoneDto"
235
+ }
236
+ },
237
+ "text/json": {
238
+ "schema": {
239
+ "$ref": "#/components/schemas/PhoneDto"
240
+ }
241
+ },
242
+ "application/*+json": {
243
+ "schema": {
244
+ "$ref": "#/components/schemas/PhoneDto"
245
+ }
246
+ }
247
+ }
248
+ },
249
+ "responses": {
250
+ "200": {
251
+ "description": "SMS-код успешно отправлен."
252
+ },
253
+ "400": {
254
+ "description": "Некорректные данные запроса.",
255
+ "content": {
256
+ "text/plain": {
257
+ "schema": {
258
+ "type": "array",
259
+ "items": {
260
+ "$ref": "#/components/schemas/ErrorModel"
261
+ }
262
+ }
263
+ },
264
+ "application/json": {
265
+ "schema": {
266
+ "type": "array",
267
+ "items": {
268
+ "$ref": "#/components/schemas/ErrorModel"
269
+ }
270
+ }
271
+ },
272
+ "text/json": {
273
+ "schema": {
274
+ "type": "array",
275
+ "items": {
276
+ "$ref": "#/components/schemas/ErrorModel"
277
+ }
278
+ }
279
+ }
280
+ }
281
+ },
282
+ "401": {
283
+ "description": "Регистрация аккаунта не завершена.",
284
+ "content": {
285
+ "text/plain": {
286
+ "schema": {
287
+ "type": "array",
288
+ "items": {
289
+ "$ref": "#/components/schemas/ErrorModel"
290
+ }
291
+ }
292
+ },
293
+ "application/json": {
294
+ "schema": {
295
+ "type": "array",
296
+ "items": {
297
+ "$ref": "#/components/schemas/ErrorModel"
298
+ }
299
+ }
300
+ },
301
+ "text/json": {
302
+ "schema": {
303
+ "type": "array",
304
+ "items": {
305
+ "$ref": "#/components/schemas/ErrorModel"
306
+ }
307
+ }
308
+ }
309
+ }
310
+ },
311
+ "404": {
312
+ "description": "Аккаунт не найден."
313
+ },
314
+ "403": {
315
+ "description": "Аккаунт заблокирован.",
316
+ "content": {
317
+ "text/plain": {
318
+ "schema": {
319
+ "type": "array",
320
+ "items": {
321
+ "$ref": "#/components/schemas/ErrorModel"
322
+ }
323
+ }
324
+ },
325
+ "application/json": {
326
+ "schema": {
327
+ "type": "array",
328
+ "items": {
329
+ "$ref": "#/components/schemas/ErrorModel"
330
+ }
331
+ }
332
+ },
333
+ "text/json": {
334
+ "schema": {
335
+ "type": "array",
336
+ "items": {
337
+ "$ref": "#/components/schemas/ErrorModel"
338
+ }
339
+ }
340
+ }
341
+ }
342
+ },
343
+ "429": {
344
+ "description": "Превышен лимит отправки SMS.",
345
+ "content": {
346
+ "text/plain": {
347
+ "schema": {
348
+ "type": "array",
349
+ "items": {
350
+ "$ref": "#/components/schemas/ErrorModel"
351
+ }
352
+ }
353
+ },
354
+ "application/json": {
355
+ "schema": {
356
+ "type": "array",
357
+ "items": {
358
+ "$ref": "#/components/schemas/ErrorModel"
359
+ }
360
+ }
361
+ },
362
+ "text/json": {
363
+ "schema": {
364
+ "type": "array",
365
+ "items": {
366
+ "$ref": "#/components/schemas/ErrorModel"
367
+ }
368
+ }
369
+ }
370
+ }
371
+ }
372
+ }
373
+ }
374
+ },
375
+ "/Accounts/smsLogin": {
376
+ "post": {
377
+ "tags": [
378
+ "Accounts"
379
+ ],
380
+ "summary": "Проверяет SMS-код и выполняет вход.",
381
+ "description": "## Пример запроса:\r\n```json\r\nPOST /Accounts/smsLogin\r\n \r\n{\r\n \"phone\": \"+79001234567\",\r\n \"code\": \"123456\"\r\n}\r\n```\r\n \r\n## Пример успешного ответа (200):\r\nФормат ответа совпадает с `POST /Accounts/login`.\r\n \r\n## Негативные сценарии:\r\n- 400 Bad Request — некорректное тело запроса.\r\n- 401 Unauthorized — неверный SMS-код, код не был запрошен, истёкло время проверки или регистрация аккаунта не завершена.\r\n- 404 Not Found — аккаунт не найден.\r\n- 403 Forbidden — аккаунт заблокирован.",
382
+ "parameters": [
383
+ {
384
+ "name": "X-Application-ID",
385
+ "in": "header",
386
+ "description": "Идентификатор приложения. EngineerMobile - 1, CustomerMobile - 2, MainWeb - 3, AdminWeb - 4, Api - 5, PlateWeb - 6",
387
+ "schema": {
388
+ "enum": [
389
+ 1,
390
+ 2,
391
+ 3,
392
+ 4,
393
+ 5,
394
+ 6
395
+ ],
396
+ "type": "integer",
397
+ "format": "int32",
398
+ "default": 3,
399
+ "x-enumNames": [
400
+ "EngineerMobile",
401
+ "CustomerMobile",
402
+ "MainWeb",
403
+ "AdminWeb",
404
+ "Api",
405
+ "PlateWeb"
406
+ ]
407
+ }
408
+ }
409
+ ],
410
+ "requestBody": {
411
+ "description": "Телефон и код из SMS.",
412
+ "content": {
413
+ "application/json-patch+json": {
414
+ "schema": {
415
+ "$ref": "#/components/schemas/AuthSmsDto"
416
+ }
417
+ },
418
+ "application/json": {
419
+ "schema": {
420
+ "$ref": "#/components/schemas/AuthSmsDto"
421
+ }
422
+ },
423
+ "text/json": {
424
+ "schema": {
425
+ "$ref": "#/components/schemas/AuthSmsDto"
426
+ }
427
+ },
428
+ "application/*+json": {
429
+ "schema": {
430
+ "$ref": "#/components/schemas/AuthSmsDto"
431
+ }
432
+ }
433
+ }
434
+ },
435
+ "responses": {
436
+ "200": {
437
+ "description": "Вход по SMS выполнен успешно.",
438
+ "content": {
439
+ "text/plain": {
440
+ "schema": {
441
+ "$ref": "#/components/schemas/AuthenticationResult"
442
+ }
443
+ },
444
+ "application/json": {
445
+ "schema": {
446
+ "$ref": "#/components/schemas/AuthenticationResult"
447
+ }
448
+ },
449
+ "text/json": {
450
+ "schema": {
451
+ "$ref": "#/components/schemas/AuthenticationResult"
452
+ }
453
+ }
454
+ }
455
+ },
456
+ "400": {
457
+ "description": "Некорректные данные запроса.",
458
+ "content": {
459
+ "text/plain": {
460
+ "schema": {
461
+ "type": "array",
462
+ "items": {
463
+ "$ref": "#/components/schemas/ErrorModel"
464
+ }
465
+ }
466
+ },
467
+ "application/json": {
468
+ "schema": {
469
+ "type": "array",
470
+ "items": {
471
+ "$ref": "#/components/schemas/ErrorModel"
472
+ }
473
+ }
474
+ },
475
+ "text/json": {
476
+ "schema": {
477
+ "type": "array",
478
+ "items": {
479
+ "$ref": "#/components/schemas/ErrorModel"
480
+ }
481
+ }
482
+ }
483
+ }
484
+ },
485
+ "401": {
486
+ "description": "Ошибка проверки SMS-кода или статуса аккаунта.",
487
+ "content": {
488
+ "text/plain": {
489
+ "schema": {
490
+ "type": "array",
491
+ "items": {
492
+ "$ref": "#/components/schemas/ErrorModel"
493
+ }
494
+ }
495
+ },
496
+ "application/json": {
497
+ "schema": {
498
+ "type": "array",
499
+ "items": {
500
+ "$ref": "#/components/schemas/ErrorModel"
501
+ }
502
+ }
503
+ },
504
+ "text/json": {
505
+ "schema": {
506
+ "type": "array",
507
+ "items": {
508
+ "$ref": "#/components/schemas/ErrorModel"
509
+ }
510
+ }
511
+ }
512
+ }
513
+ },
514
+ "404": {
515
+ "description": "Аккаунт не найден."
516
+ },
517
+ "403": {
518
+ "description": "Аккаунт заблокирован.",
519
+ "content": {
520
+ "text/plain": {
521
+ "schema": {
522
+ "type": "array",
523
+ "items": {
524
+ "$ref": "#/components/schemas/ErrorModel"
525
+ }
526
+ }
527
+ },
528
+ "application/json": {
529
+ "schema": {
530
+ "type": "array",
531
+ "items": {
532
+ "$ref": "#/components/schemas/ErrorModel"
533
+ }
534
+ }
535
+ },
536
+ "text/json": {
537
+ "schema": {
538
+ "type": "array",
539
+ "items": {
540
+ "$ref": "#/components/schemas/ErrorModel"
541
+ }
542
+ }
543
+ }
544
+ }
545
+ }
546
+ }
547
+ }
548
+ },
549
+ "/Accounts/realm": {
550
+ "post": {
551
+ "tags": [
552
+ "Accounts"
553
+ ],
554
+ "summary": "Возвращает реалмы SSO для аккаунта по e-mail или домену.",
555
+ "description": "Поддерживает ограничение результата через заголовок `Range`.\r\n \r\n## Пример запроса:\r\n```json\r\nPOST /Accounts/realm\r\nRange: items=1-50\r\n \r\n{\r\n \"credential\": \"user@company.com\"\r\n}\r\n```\r\n \r\n## Пример успешного ответа (200):\r\n```json\r\n[\r\n {\r\n \"tenantID\": 10,\r\n \"tenantName\": \"Demo Tenant\",\r\n \"realm\": \"demo\"\r\n }\r\n]\r\n```\r\n \r\n## Пример успешного ответа (206):\r\nТело ответа имеет тот же формат, что и для `200`, но содержит только часть диапазона. Заголовок `Content-Range` указывает общее количество.\r\n \r\n## Негативные сценарии:\r\n- 400 Bad Request — не указан credential.\r\n- 204 No Content — реалмы для указанного credential не найдены.",
556
+ "parameters": [
557
+ {
558
+ "name": "Range",
559
+ "in": "header",
560
+ "description": "Формат: items=FROM-TILL , где FROM - начальный элемент (включая), TILL - конечный элемент (включая)",
561
+ "schema": {
562
+ "type": "string"
563
+ }
564
+ },
565
+ {
566
+ "name": "offset",
567
+ "in": "query",
568
+ "description": "количество элементов, которое нобходимо пропустить",
569
+ "schema": {
570
+ "type": "string"
571
+ }
572
+ },
573
+ {
574
+ "name": "fetch",
575
+ "in": "query",
576
+ "description": "количество элементов, которое необходимо вернуть",
577
+ "schema": {
578
+ "type": "string"
579
+ }
580
+ },
581
+ {
582
+ "name": "X-Application-ID",
583
+ "in": "header",
584
+ "description": "Идентификатор приложения. EngineerMobile - 1, CustomerMobile - 2, MainWeb - 3, AdminWeb - 4, Api - 5, PlateWeb - 6",
585
+ "schema": {
586
+ "enum": [
587
+ 1,
588
+ 2,
589
+ 3,
590
+ 4,
591
+ 5,
592
+ 6
593
+ ],
594
+ "type": "integer",
595
+ "format": "int32",
596
+ "default": 3,
597
+ "x-enumNames": [
598
+ "EngineerMobile",
599
+ "CustomerMobile",
600
+ "MainWeb",
601
+ "AdminWeb",
602
+ "Api",
603
+ "PlateWeb"
604
+ ]
605
+ }
606
+ }
607
+ ],
608
+ "requestBody": {
609
+ "description": "E-mail или домен аккаунта.",
610
+ "content": {
611
+ "application/json-patch+json": {
612
+ "schema": {
613
+ "$ref": "#/components/schemas/CredentialData"
614
+ }
615
+ },
616
+ "application/json": {
617
+ "schema": {
618
+ "$ref": "#/components/schemas/CredentialData"
619
+ }
620
+ },
621
+ "text/json": {
622
+ "schema": {
623
+ "$ref": "#/components/schemas/CredentialData"
624
+ }
625
+ },
626
+ "application/*+json": {
627
+ "schema": {
628
+ "$ref": "#/components/schemas/CredentialData"
629
+ }
630
+ }
631
+ }
632
+ },
633
+ "responses": {
634
+ "200": {
635
+ "description": "Список реалмов успешно получен.",
636
+ "content": {
637
+ "text/plain": {
638
+ "schema": {
639
+ "type": "array",
640
+ "items": {
641
+ "$ref": "#/components/schemas/AccountRealmResult"
642
+ }
643
+ }
644
+ },
645
+ "application/json": {
646
+ "schema": {
647
+ "type": "array",
648
+ "items": {
649
+ "$ref": "#/components/schemas/AccountRealmResult"
650
+ }
651
+ }
652
+ },
653
+ "text/json": {
654
+ "schema": {
655
+ "type": "array",
656
+ "items": {
657
+ "$ref": "#/components/schemas/AccountRealmResult"
658
+ }
659
+ }
660
+ }
661
+ }
662
+ },
663
+ "206": {
664
+ "description": "Возвращена часть списка в пределах запрошенного диапазона.",
665
+ "content": {
666
+ "text/plain": {
667
+ "schema": {
668
+ "type": "array",
669
+ "items": {
670
+ "$ref": "#/components/schemas/AccountRealmResult"
671
+ }
672
+ }
673
+ },
674
+ "application/json": {
675
+ "schema": {
676
+ "type": "array",
677
+ "items": {
678
+ "$ref": "#/components/schemas/AccountRealmResult"
679
+ }
680
+ }
681
+ },
682
+ "text/json": {
683
+ "schema": {
684
+ "type": "array",
685
+ "items": {
686
+ "$ref": "#/components/schemas/AccountRealmResult"
687
+ }
688
+ }
689
+ }
690
+ }
691
+ },
692
+ "204": {
693
+ "description": "Реалмы не найдены."
694
+ },
695
+ "400": {
696
+ "description": "Некорректные данные запроса.",
697
+ "content": {
698
+ "text/plain": {
699
+ "schema": {
700
+ "type": "array",
701
+ "items": {
702
+ "$ref": "#/components/schemas/ErrorModel"
703
+ }
704
+ }
705
+ },
706
+ "application/json": {
707
+ "schema": {
708
+ "type": "array",
709
+ "items": {
710
+ "$ref": "#/components/schemas/ErrorModel"
711
+ }
712
+ }
713
+ },
714
+ "text/json": {
715
+ "schema": {
716
+ "type": "array",
717
+ "items": {
718
+ "$ref": "#/components/schemas/ErrorModel"
719
+ }
720
+ }
721
+ }
722
+ }
723
+ }
724
+ }
725
+ }
726
+ },
727
+ "/Passwords/set": {
728
+ "post": {
729
+ "tags": [
730
+ "Passwords"
731
+ ],
732
+ "summary": "Устанавливает пароль для учётной записи.",
733
+ "description": "## Пример запроса (по SMS-коду):\r\n```json\r\nPOST /Passwords/set\r\n \r\n{\r\n \"password\": \"MyNewP%40ssw0rd\",\r\n \"code\": \"123456\",\r\n \"mobilePhone\": \"+79001234567\"\r\n}\r\n```\r\n \r\n## Пример запроса (по хэшу из e-mail):\r\n```json\r\nPOST /Passwords/set\r\n \r\n{\r\n \"password\": \"MyNewP%40ssw0rd\",\r\n \"codeHash\": \"a1b2c3d4e5f6\"\r\n}\r\n```\r\n \r\n## Пример успешного ответа (202):\r\n```json\r\n{\r\n \"access_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\r\n \"refresh_token\": null,\r\n \"expires_in\": 3600,\r\n \"jwtValidTill\": \"2024-06-15T10:00:00Z\",\r\n \"accountUserTypeID\": 1\r\n}\r\n```\r\n \r\n## Негативные сценарии:\r\n- 400 Bad Request — не указаны обязательные поля или некорректное тело запроса.\r\n- 401 Unauthorized — аккаунт по коду верификации не найден.",
734
+ "parameters": [
735
+ {
736
+ "name": "X-Application-ID",
737
+ "in": "header",
738
+ "description": "Идентификатор приложения. EngineerMobile - 1, CustomerMobile - 2, MainWeb - 3, AdminWeb - 4, Api - 5, PlateWeb - 6",
739
+ "schema": {
740
+ "enum": [
741
+ 1,
742
+ 2,
743
+ 3,
744
+ 4,
745
+ 5,
746
+ 6
747
+ ],
748
+ "type": "integer",
749
+ "format": "int32",
750
+ "default": 3,
751
+ "x-enumNames": [
752
+ "EngineerMobile",
753
+ "CustomerMobile",
754
+ "MainWeb",
755
+ "AdminWeb",
756
+ "Api",
757
+ "PlateWeb"
758
+ ]
759
+ }
760
+ }
761
+ ],
762
+ "requestBody": {
763
+ "description": "Данные для установки пароля.",
764
+ "content": {
765
+ "application/json-patch+json": {
766
+ "schema": {
767
+ "$ref": "#/components/schemas/SetData"
768
+ }
769
+ },
770
+ "application/json": {
771
+ "schema": {
772
+ "$ref": "#/components/schemas/SetData"
773
+ }
774
+ },
775
+ "text/json": {
776
+ "schema": {
777
+ "$ref": "#/components/schemas/SetData"
778
+ }
779
+ },
780
+ "application/*+json": {
781
+ "schema": {
782
+ "$ref": "#/components/schemas/SetData"
783
+ }
784
+ }
785
+ }
786
+ },
787
+ "responses": {
788
+ "202": {
789
+ "description": "Пароль успешно установлен.",
790
+ "content": {
791
+ "text/plain": {
792
+ "schema": {
793
+ "$ref": "#/components/schemas/JwtResultBase"
794
+ }
795
+ },
796
+ "application/json": {
797
+ "schema": {
798
+ "$ref": "#/components/schemas/JwtResultBase"
799
+ }
800
+ },
801
+ "text/json": {
802
+ "schema": {
803
+ "$ref": "#/components/schemas/JwtResultBase"
804
+ }
805
+ }
806
+ }
807
+ },
808
+ "400": {
809
+ "description": "Некорректные данные запроса.",
810
+ "content": {
811
+ "text/plain": {
812
+ "schema": {
813
+ "type": "array",
814
+ "items": {
815
+ "$ref": "#/components/schemas/ErrorModel"
816
+ }
817
+ }
818
+ },
819
+ "application/json": {
820
+ "schema": {
821
+ "type": "array",
822
+ "items": {
823
+ "$ref": "#/components/schemas/ErrorModel"
824
+ }
825
+ }
826
+ },
827
+ "text/json": {
828
+ "schema": {
829
+ "type": "array",
830
+ "items": {
831
+ "$ref": "#/components/schemas/ErrorModel"
832
+ }
833
+ }
834
+ }
835
+ }
836
+ },
837
+ "401": {
838
+ "description": "Аккаунт не найден."
839
+ }
840
+ }
841
+ }
842
+ }
843
+ },
844
+ "components": {
845
+ "schemas": {
846
+ "AccountRealmResult": {
847
+ "type": "object",
848
+ "properties": {
849
+ "tenantID": {
850
+ "type": "integer",
851
+ "format": "int32"
852
+ },
853
+ "tenantName": {
854
+ "type": "string",
855
+ "nullable": true
856
+ },
857
+ "realm": {
858
+ "type": "string",
859
+ "nullable": true
860
+ }
861
+ },
862
+ "additionalProperties": false
863
+ },
864
+ "AuthSmsDto": {
865
+ "type": "object",
866
+ "properties": {
867
+ "code": {
868
+ "type": "string",
869
+ "nullable": true
870
+ },
871
+ "phone": {
872
+ "type": "string",
873
+ "nullable": true
874
+ }
875
+ },
876
+ "additionalProperties": false
877
+ },
878
+ "AuthenticationResult": {
879
+ "type": "object",
880
+ "properties": {
881
+ "access_token": {
882
+ "type": "string",
883
+ "nullable": true,
884
+ "readOnly": true
885
+ },
886
+ "refresh_token": {
887
+ "type": "string",
888
+ "nullable": true,
889
+ "readOnly": true
890
+ },
891
+ "expires_in": {
892
+ "type": "integer",
893
+ "format": "int32",
894
+ "nullable": true,
895
+ "readOnly": true
896
+ },
897
+ "jwtValidTill": {
898
+ "type": "string",
899
+ "format": "date-time",
900
+ "nullable": true
901
+ },
902
+ "accountUserTypeID": {
903
+ "type": "integer",
904
+ "format": "int32",
905
+ "nullable": true
906
+ },
907
+ "tenantEntities": {
908
+ "type": "array",
909
+ "items": {
910
+ "$ref": "#/components/schemas/TenantAuthorizationProjection"
911
+ },
912
+ "nullable": true
913
+ },
914
+ "requests": {
915
+ "type": "array",
916
+ "items": {
917
+ "$ref": "#/components/schemas/TenantCreationRequestEntity"
918
+ },
919
+ "nullable": true
920
+ },
921
+ "accountHasUserProfile": {
922
+ "type": "boolean"
923
+ },
924
+ "isCrossTenantAdmin": {
925
+ "type": "boolean"
926
+ },
927
+ "isAnonymous": {
928
+ "type": "boolean"
929
+ }
930
+ },
931
+ "additionalProperties": false
932
+ },
933
+ "CredentialData": {
934
+ "required": [
935
+ "credential"
936
+ ],
937
+ "type": "object",
938
+ "properties": {
939
+ "credential": {
940
+ "minLength": 1,
941
+ "type": "string"
942
+ }
943
+ },
944
+ "additionalProperties": false
945
+ },
946
+ "ErrorModel": {
947
+ "type": "object",
948
+ "properties": {
949
+ "traceIdentifier": {
950
+ "type": "string",
951
+ "nullable": true
952
+ },
953
+ "code": {
954
+ "type": "string",
955
+ "nullable": true
956
+ },
957
+ "message": {
958
+ "type": "string",
959
+ "nullable": true
960
+ },
961
+ "arguments": {
962
+ "type": "object",
963
+ "additionalProperties": {
964
+ "type": "string",
965
+ "nullable": true
966
+ },
967
+ "nullable": true
968
+ }
969
+ },
970
+ "additionalProperties": false
971
+ },
972
+ "JwtResultBase": {
973
+ "type": "object",
974
+ "properties": {
975
+ "access_token": {
976
+ "type": "string",
977
+ "nullable": true,
978
+ "readOnly": true
979
+ },
980
+ "refresh_token": {
981
+ "type": "string",
982
+ "nullable": true,
983
+ "readOnly": true
984
+ },
985
+ "expires_in": {
986
+ "type": "integer",
987
+ "format": "int32",
988
+ "nullable": true,
989
+ "readOnly": true
990
+ },
991
+ "jwtValidTill": {
992
+ "type": "string",
993
+ "format": "date-time",
994
+ "nullable": true
995
+ },
996
+ "accountUserTypeID": {
997
+ "type": "integer",
998
+ "format": "int32",
999
+ "nullable": true
1000
+ }
1001
+ },
1002
+ "additionalProperties": false
1003
+ },
1004
+ "PhoneDto": {
1005
+ "type": "object",
1006
+ "properties": {
1007
+ "phone": {
1008
+ "type": "string",
1009
+ "nullable": true
1010
+ }
1011
+ },
1012
+ "additionalProperties": false
1013
+ },
1014
+ "SetData": {
1015
+ "required": [
1016
+ "password"
1017
+ ],
1018
+ "type": "object",
1019
+ "properties": {
1020
+ "password": {
1021
+ "minLength": 1,
1022
+ "type": "string"
1023
+ },
1024
+ "codeHash": {
1025
+ "type": "string",
1026
+ "nullable": true
1027
+ },
1028
+ "code": {
1029
+ "type": "string",
1030
+ "nullable": true
1031
+ },
1032
+ "mobilePhone": {
1033
+ "type": "string",
1034
+ "nullable": true
1035
+ }
1036
+ },
1037
+ "additionalProperties": false
1038
+ },
1039
+ "TenantAuthorizationProjection": {
1040
+ "type": "object",
1041
+ "properties": {
1042
+ "tenantID": {
1043
+ "type": "integer",
1044
+ "format": "int32"
1045
+ },
1046
+ "uriName": {
1047
+ "type": "string",
1048
+ "nullable": true
1049
+ },
1050
+ "name": {
1051
+ "type": "string",
1052
+ "nullable": true
1053
+ },
1054
+ "fullName": {
1055
+ "type": "string",
1056
+ "nullable": true
1057
+ },
1058
+ "banTill": {
1059
+ "type": "string",
1060
+ "format": "date-time",
1061
+ "nullable": true
1062
+ },
1063
+ "banReasonID": {
1064
+ "type": "integer",
1065
+ "format": "int32",
1066
+ "nullable": true
1067
+ },
1068
+ "banReasonCode": {
1069
+ "type": "string",
1070
+ "nullable": true
1071
+ },
1072
+ "isTenantArchived": {
1073
+ "type": "boolean"
1074
+ },
1075
+ "isTenantDeleted": {
1076
+ "type": "boolean"
1077
+ },
1078
+ "accountID": {
1079
+ "type": "integer",
1080
+ "format": "int32"
1081
+ },
1082
+ "userID": {
1083
+ "type": "integer",
1084
+ "format": "int32"
1085
+ },
1086
+ "tenantMemberID": {
1087
+ "type": "integer",
1088
+ "format": "int32"
1089
+ },
1090
+ "tenantMemberDescription": {
1091
+ "type": "string",
1092
+ "nullable": true
1093
+ },
1094
+ "tenantMemberValidTill": {
1095
+ "type": "string",
1096
+ "format": "date-time",
1097
+ "nullable": true
1098
+ },
1099
+ "userBanTill": {
1100
+ "type": "string",
1101
+ "format": "date-time",
1102
+ "nullable": true
1103
+ },
1104
+ "isUserBanned": {
1105
+ "type": "boolean"
1106
+ },
1107
+ "userBanReasonID": {
1108
+ "type": "integer",
1109
+ "format": "int32",
1110
+ "nullable": true
1111
+ },
1112
+ "userBanReasonCode": {
1113
+ "type": "string",
1114
+ "nullable": true
1115
+ },
1116
+ "email": {
1117
+ "type": "string",
1118
+ "nullable": true
1119
+ },
1120
+ "firstName": {
1121
+ "type": "string",
1122
+ "nullable": true
1123
+ },
1124
+ "middleName": {
1125
+ "type": "string",
1126
+ "nullable": true
1127
+ },
1128
+ "lastName": {
1129
+ "type": "string",
1130
+ "nullable": true
1131
+ },
1132
+ "hasUserProfile": {
1133
+ "type": "boolean"
1134
+ }
1135
+ },
1136
+ "additionalProperties": false
1137
+ },
1138
+ "TenantCreationRequestEntity": {
1139
+ "type": "object",
1140
+ "properties": {
1141
+ "id": {
1142
+ "type": "string",
1143
+ "nullable": true
1144
+ },
1145
+ "accountID": {
1146
+ "type": "integer",
1147
+ "format": "int32"
1148
+ },
1149
+ "tenantID": {
1150
+ "type": "integer",
1151
+ "format": "int32",
1152
+ "nullable": true
1153
+ },
1154
+ "tenantName": {
1155
+ "type": "string",
1156
+ "nullable": true
1157
+ },
1158
+ "tenantFullName": {
1159
+ "type": "string",
1160
+ "nullable": true
1161
+ },
1162
+ "tenantUriName": {
1163
+ "type": "string",
1164
+ "nullable": true
1165
+ },
1166
+ "ownerFirstName": {
1167
+ "type": "string",
1168
+ "nullable": true
1169
+ },
1170
+ "ownerLastName": {
1171
+ "type": "string",
1172
+ "nullable": true
1173
+ },
1174
+ "ownerMiddleName": {
1175
+ "type": "string",
1176
+ "nullable": true
1177
+ },
1178
+ "templateID": {
1179
+ "type": "integer",
1180
+ "format": "int32",
1181
+ "nullable": true
1182
+ },
1183
+ "isSuccess": {
1184
+ "type": "boolean",
1185
+ "nullable": true
1186
+ },
1187
+ "message": {
1188
+ "type": "string",
1189
+ "nullable": true
1190
+ },
1191
+ "licenseID": {
1192
+ "type": "integer",
1193
+ "format": "int32",
1194
+ "nullable": true
1195
+ },
1196
+ "created": {
1197
+ "type": "string",
1198
+ "format": "date-time"
1199
+ },
1200
+ "processed": {
1201
+ "type": "string",
1202
+ "format": "date-time",
1203
+ "nullable": true
1204
+ },
1205
+ "approved": {
1206
+ "type": "string",
1207
+ "format": "date-time",
1208
+ "nullable": true
1209
+ },
1210
+ "rejected": {
1211
+ "type": "string",
1212
+ "format": "date-time",
1213
+ "nullable": true
1214
+ },
1215
+ "rejectionReason": {
1216
+ "type": "string",
1217
+ "nullable": true
1218
+ }
1219
+ },
1220
+ "additionalProperties": false
1221
+ }
1222
+ },
1223
+ "securitySchemes": {
1224
+ "Bearer": {
1225
+ "type": "http",
1226
+ "description": "Введите токен для авторизации",
1227
+ "scheme": "Bearer",
1228
+ "bearerFormat": "JWT"
1229
+ }
1230
+ }
1231
+ },
1232
+ "tags": [
1233
+ {
1234
+ "name": "Accounts",
1235
+ "description": "Контроллер для аутентификации учетных записей"
1236
+ },
1237
+ {
1238
+ "name": "Passwords",
1239
+ "description": "Контроллер управления паролями"
1240
+ },
1241
+ {
1242
+ "name": "Accounts",
1243
+ "description": "Контроллер для аутентификации учетных записей"
1244
+ },
1245
+ {
1246
+ "name": "Passwords",
1247
+ "description": "Контроллер управления паролями"
1248
+ }
1249
+ ]
1250
+ }