@remnawave/backend-contract 2.9.14 → 2.9.20

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 (259) hide show
  1. package/build/backend/api/controllers/bandwidth-stats.d.ts +7 -8
  2. package/build/backend/api/controllers/bandwidth-stats.d.ts.map +1 -1
  3. package/build/backend/api/controllers/bandwidth-stats.js +8 -20
  4. package/build/backend/api/controllers/connections.d.ts +1 -1
  5. package/build/backend/api/controllers/connections.d.ts.map +1 -1
  6. package/build/backend/api/controllers/connections.js +1 -1
  7. package/build/backend/api/controllers/hwid.d.ts +1 -1
  8. package/build/backend/api/controllers/hwid.d.ts.map +1 -1
  9. package/build/backend/api/controllers/hwid.js +1 -1
  10. package/build/backend/api/controllers/internal-squads.d.ts +2 -0
  11. package/build/backend/api/controllers/internal-squads.d.ts.map +1 -1
  12. package/build/backend/api/controllers/internal-squads.js +2 -0
  13. package/build/backend/api/controllers/metadata.d.ts +4 -4
  14. package/build/backend/api/controllers/metadata.d.ts.map +1 -1
  15. package/build/backend/api/controllers/metadata.js +4 -4
  16. package/build/backend/api/controllers/subscriptions.d.ts +2 -2
  17. package/build/backend/api/controllers/subscriptions.d.ts.map +1 -1
  18. package/build/backend/api/controllers/subscriptions.js +2 -2
  19. package/build/backend/api/controllers/users.d.ts +8 -13
  20. package/build/backend/api/controllers/users.d.ts.map +1 -1
  21. package/build/backend/api/controllers/users.js +8 -13
  22. package/build/backend/api/controllers-info.d.ts +15 -15
  23. package/build/backend/api/controllers-info.js +15 -15
  24. package/build/backend/api/routes.d.ts +21 -23
  25. package/build/backend/api/routes.d.ts.map +1 -1
  26. package/build/backend/api/routes.js +21 -23
  27. package/build/backend/commands/bandwidth-stats/index.d.ts +1 -1
  28. package/build/backend/commands/bandwidth-stats/index.d.ts.map +1 -1
  29. package/build/backend/commands/bandwidth-stats/index.js +1 -1
  30. package/build/backend/commands/bandwidth-stats/internal-squads/get-internal-squad-usage.command.d.ts +31 -0
  31. package/build/backend/commands/bandwidth-stats/internal-squads/get-internal-squad-usage.command.d.ts.map +1 -0
  32. package/build/backend/commands/bandwidth-stats/internal-squads/get-internal-squad-usage.command.js +50 -0
  33. package/build/backend/commands/bandwidth-stats/internal-squads/get-internal-squad-user-usage.command.d.ts +29 -0
  34. package/build/backend/commands/bandwidth-stats/internal-squads/get-internal-squad-user-usage.command.d.ts.map +1 -0
  35. package/build/backend/commands/bandwidth-stats/internal-squads/get-internal-squad-user-usage.command.js +34 -0
  36. package/build/backend/commands/bandwidth-stats/internal-squads/index.d.ts +3 -0
  37. package/build/backend/commands/bandwidth-stats/internal-squads/index.d.ts.map +1 -0
  38. package/build/backend/commands/bandwidth-stats/{legacy → internal-squads}/index.js +2 -2
  39. package/build/backend/commands/bandwidth-stats/nodes/get-node-usage.command.d.ts +29 -0
  40. package/build/backend/commands/bandwidth-stats/nodes/get-node-usage.command.d.ts.map +1 -0
  41. package/build/backend/commands/bandwidth-stats/nodes/get-node-usage.command.js +38 -0
  42. package/build/backend/commands/bandwidth-stats/nodes/index.d.ts +1 -0
  43. package/build/backend/commands/bandwidth-stats/nodes/index.d.ts.map +1 -1
  44. package/build/backend/commands/bandwidth-stats/nodes/index.js +1 -0
  45. package/build/backend/commands/bandwidth-stats/users/get-stats-user-usage.command.d.ts +2 -2
  46. package/build/backend/commands/bandwidth-stats/users/get-stats-user-usage.command.d.ts.map +1 -1
  47. package/build/backend/commands/bandwidth-stats/users/get-stats-user-usage.command.js +5 -4
  48. package/build/backend/commands/connections/connections-by-node-result.command.d.ts +1 -1
  49. package/build/backend/commands/connections/connections-by-node-result.command.js +1 -1
  50. package/build/backend/commands/connections/connections-by-user-result.command.d.ts +1 -2
  51. package/build/backend/commands/connections/connections-by-user-result.command.d.ts.map +1 -1
  52. package/build/backend/commands/connections/connections-by-user-result.command.js +1 -2
  53. package/build/backend/commands/connections/connections-by-user.command.d.ts +2 -2
  54. package/build/backend/commands/connections/connections-by-user.command.d.ts.map +1 -1
  55. package/build/backend/commands/connections/connections-by-user.command.js +4 -3
  56. package/build/backend/commands/connections/drop-connections.command.d.ts +4 -4
  57. package/build/backend/commands/connections/drop-connections.command.js +3 -3
  58. package/build/backend/commands/hwid/create-user-hwid-device.command.d.ts +1 -1
  59. package/build/backend/commands/hwid/create-user-hwid-device.command.js +1 -1
  60. package/build/backend/commands/hwid/delete-all-user-hwid-devices.command.d.ts +1 -1
  61. package/build/backend/commands/hwid/delete-all-user-hwid-devices.command.js +1 -1
  62. package/build/backend/commands/hwid/delete-user-hwid-device.command.d.ts +1 -1
  63. package/build/backend/commands/hwid/delete-user-hwid-device.command.js +1 -1
  64. package/build/backend/commands/hwid/get-top-users-by-hwid-devices.command.d.ts +0 -1
  65. package/build/backend/commands/hwid/get-top-users-by-hwid-devices.command.d.ts.map +1 -1
  66. package/build/backend/commands/hwid/get-top-users-by-hwid-devices.command.js +0 -1
  67. package/build/backend/commands/hwid/get-user-hwid-devices.command.d.ts +2 -2
  68. package/build/backend/commands/hwid/get-user-hwid-devices.command.d.ts.map +1 -1
  69. package/build/backend/commands/hwid/get-user-hwid-devices.command.js +3 -3
  70. package/build/backend/commands/internal-squads/bulk-actions/add-many-users-to-internal-squad.command.d.ts +15 -0
  71. package/build/backend/commands/internal-squads/bulk-actions/add-many-users-to-internal-squad.command.d.ts.map +1 -0
  72. package/build/backend/commands/internal-squads/bulk-actions/add-many-users-to-internal-squad.command.js +18 -0
  73. package/build/backend/commands/internal-squads/bulk-actions/delete-many-users-from-internal-squad.command.d.ts +15 -0
  74. package/build/backend/commands/internal-squads/bulk-actions/delete-many-users-from-internal-squad.command.d.ts.map +1 -0
  75. package/build/backend/commands/internal-squads/bulk-actions/delete-many-users-from-internal-squad.command.js +18 -0
  76. package/build/backend/commands/internal-squads/bulk-actions/index.d.ts +2 -0
  77. package/build/backend/commands/internal-squads/bulk-actions/index.d.ts.map +1 -1
  78. package/build/backend/commands/internal-squads/bulk-actions/index.js +2 -0
  79. package/build/backend/commands/metadata/user/get-user-metadata.command.d.ts +2 -2
  80. package/build/backend/commands/metadata/user/get-user-metadata.command.d.ts.map +1 -1
  81. package/build/backend/commands/metadata/user/get-user-metadata.command.js +4 -3
  82. package/build/backend/commands/metadata/user/upsert-user-metadata.command.d.ts +2 -2
  83. package/build/backend/commands/metadata/user/upsert-user-metadata.command.d.ts.map +1 -1
  84. package/build/backend/commands/metadata/user/upsert-user-metadata.command.js +3 -3
  85. package/build/backend/commands/node-plugins/torrent-blocker/get-torrent-blocker-reports-stats.command.d.ts +1 -1
  86. package/build/backend/commands/node-plugins/torrent-blocker/get-torrent-blocker-reports-stats.command.js +1 -1
  87. package/build/backend/commands/node-plugins/torrent-blocker/get-torrent-blocker-reports.command.d.ts +0 -1
  88. package/build/backend/commands/node-plugins/torrent-blocker/get-torrent-blocker-reports.command.d.ts.map +1 -1
  89. package/build/backend/commands/subscriptions/get-by/{get-connection-keys-by-uuid.command.d.ts → get-connection-keys-by-user-id.command.d.ts} +4 -4
  90. package/build/backend/commands/subscriptions/get-by/get-connection-keys-by-user-id.command.d.ts.map +1 -0
  91. package/build/backend/commands/subscriptions/get-by/get-connection-keys-by-user-id.command.js +23 -0
  92. package/build/backend/commands/subscriptions/get-by/get-raw-subscription-by-short-uuid.command.d.ts +0 -1
  93. package/build/backend/commands/subscriptions/get-by/get-raw-subscription-by-short-uuid.command.d.ts.map +1 -1
  94. package/build/backend/commands/subscriptions/get-by/{get-subscription-by-uuid.command.d.ts → get-subscription-by-user-id.command.d.ts} +4 -4
  95. package/build/backend/commands/subscriptions/get-by/get-subscription-by-user-id.command.d.ts.map +1 -0
  96. package/build/backend/commands/subscriptions/get-by/get-subscription-by-user-id.command.js +19 -0
  97. package/build/backend/commands/subscriptions/get-by/index.d.ts +2 -2
  98. package/build/backend/commands/subscriptions/get-by/index.d.ts.map +1 -1
  99. package/build/backend/commands/subscriptions/get-by/index.js +2 -2
  100. package/build/backend/commands/users/actions/disable-user.command.d.ts +2 -3
  101. package/build/backend/commands/users/actions/disable-user.command.d.ts.map +1 -1
  102. package/build/backend/commands/users/actions/disable-user.command.js +4 -3
  103. package/build/backend/commands/users/actions/enable-user.command.d.ts +2 -3
  104. package/build/backend/commands/users/actions/enable-user.command.d.ts.map +1 -1
  105. package/build/backend/commands/users/actions/enable-user.command.js +4 -3
  106. package/build/backend/commands/users/actions/reset-user-traffic.command.d.ts +2 -3
  107. package/build/backend/commands/users/actions/reset-user-traffic.command.d.ts.map +1 -1
  108. package/build/backend/commands/users/actions/reset-user-traffic.command.js +4 -3
  109. package/build/backend/commands/users/actions/revoke-user-subscription.command.d.ts +2 -3
  110. package/build/backend/commands/users/actions/revoke-user-subscription.command.d.ts.map +1 -1
  111. package/build/backend/commands/users/actions/revoke-user-subscription.command.js +4 -3
  112. package/build/backend/commands/users/bulk/bulk-delete-users.command.d.ts +1 -1
  113. package/build/backend/commands/users/bulk/bulk-delete-users.command.js +2 -2
  114. package/build/backend/commands/users/bulk/bulk-extend-expiration-date.command.d.ts +1 -1
  115. package/build/backend/commands/users/bulk/bulk-extend-expiration-date.command.js +1 -1
  116. package/build/backend/commands/users/bulk/bulk-reset-traffic-users.command.d.ts +1 -1
  117. package/build/backend/commands/users/bulk/bulk-reset-traffic-users.command.js +2 -2
  118. package/build/backend/commands/users/bulk/bulk-revoke-users-subscription.command.d.ts +1 -1
  119. package/build/backend/commands/users/bulk/bulk-revoke-users-subscription.command.js +2 -2
  120. package/build/backend/commands/users/bulk/bulk-update-users-squads.command.d.ts +1 -1
  121. package/build/backend/commands/users/bulk/bulk-update-users-squads.command.js +2 -2
  122. package/build/backend/commands/users/bulk/bulk-update-users.command.d.ts +1 -1
  123. package/build/backend/commands/users/bulk/bulk-update-users.command.js +2 -2
  124. package/build/backend/commands/users/create-user.command.d.ts +0 -2
  125. package/build/backend/commands/users/create-user.command.d.ts.map +1 -1
  126. package/build/backend/commands/users/create-user.command.js +0 -3
  127. package/build/backend/commands/users/delete-user.command.d.ts +2 -2
  128. package/build/backend/commands/users/delete-user.command.d.ts.map +1 -1
  129. package/build/backend/commands/users/delete-user.command.js +4 -3
  130. package/build/backend/commands/users/get-by/get-user-by-short-uuid.command.d.ts +0 -1
  131. package/build/backend/commands/users/get-by/get-user-by-short-uuid.command.d.ts.map +1 -1
  132. package/build/backend/commands/users/get-by/get-user-by-username.command.d.ts +0 -1
  133. package/build/backend/commands/users/get-by/get-user-by-username.command.d.ts.map +1 -1
  134. package/build/backend/commands/users/get-by/index.d.ts +0 -1
  135. package/build/backend/commands/users/get-by/index.d.ts.map +1 -1
  136. package/build/backend/commands/users/get-by/index.js +0 -1
  137. package/build/backend/commands/users/get-user-accessible-nodes.command.d.ts +3 -3
  138. package/build/backend/commands/users/get-user-accessible-nodes.command.d.ts.map +1 -1
  139. package/build/backend/commands/users/get-user-accessible-nodes.command.js +5 -4
  140. package/build/backend/commands/users/{get-user-by-uuid.command.d.ts → get-user-by-id.command.d.ts} +4 -5
  141. package/build/backend/commands/users/get-user-by-id.command.d.ts.map +1 -0
  142. package/build/backend/commands/users/{get-by/get-user-by-id.command.js → get-user-by-id.command.js} +8 -7
  143. package/build/backend/commands/users/get-user-subscription-request-history.command.d.ts +2 -2
  144. package/build/backend/commands/users/get-user-subscription-request-history.command.d.ts.map +1 -1
  145. package/build/backend/commands/users/get-user-subscription-request-history.command.js +5 -5
  146. package/build/backend/commands/users/get-users-stream.command.d.ts +0 -1
  147. package/build/backend/commands/users/get-users-stream.command.d.ts.map +1 -1
  148. package/build/backend/commands/users/get-users.command.d.ts +0 -1
  149. package/build/backend/commands/users/get-users.command.d.ts.map +1 -1
  150. package/build/backend/commands/users/index.d.ts +1 -1
  151. package/build/backend/commands/users/index.d.ts.map +1 -1
  152. package/build/backend/commands/users/index.js +1 -1
  153. package/build/backend/commands/users/resolve-user.command.d.ts +2 -2
  154. package/build/backend/commands/users/resolve-user.command.d.ts.map +1 -1
  155. package/build/backend/commands/users/resolve-user.command.js +5 -5
  156. package/build/backend/commands/users/update-user.command.d.ts +1 -2
  157. package/build/backend/commands/users/update-user.command.d.ts.map +1 -1
  158. package/build/backend/commands/users/update-user.command.js +4 -6
  159. package/build/backend/commands/users/user.response.d.ts +0 -1
  160. package/build/backend/commands/users/user.response.d.ts.map +1 -1
  161. package/build/backend/constants/errors/errors.d.ts +15 -5
  162. package/build/backend/constants/errors/errors.d.ts.map +1 -1
  163. package/build/backend/constants/errors/errors.js +15 -5
  164. package/build/backend/models/extended-users.schema.d.ts +0 -1
  165. package/build/backend/models/extended-users.schema.d.ts.map +1 -1
  166. package/build/backend/models/index.d.ts +1 -0
  167. package/build/backend/models/index.d.ts.map +1 -1
  168. package/build/backend/models/index.js +1 -0
  169. package/build/backend/models/path-params.schema.d.ts +3 -0
  170. package/build/backend/models/path-params.schema.d.ts.map +1 -0
  171. package/build/backend/models/path-params.schema.js +5 -0
  172. package/build/backend/models/torrent-blocker-report.schema.d.ts +0 -1
  173. package/build/backend/models/torrent-blocker-report.schema.d.ts.map +1 -1
  174. package/build/backend/models/torrent-blocker-report.schema.js +0 -1
  175. package/build/backend/models/users.schema.d.ts +0 -1
  176. package/build/backend/models/users.schema.d.ts.map +1 -1
  177. package/build/backend/models/users.schema.js +0 -1
  178. package/build/backend/models/webhook/webhook.schema.d.ts +0 -6
  179. package/build/backend/models/webhook/webhook.schema.d.ts.map +1 -1
  180. package/build/frontend/api/controllers/bandwidth-stats.js +8 -20
  181. package/build/frontend/api/controllers/connections.js +1 -1
  182. package/build/frontend/api/controllers/hwid.js +1 -1
  183. package/build/frontend/api/controllers/internal-squads.js +2 -0
  184. package/build/frontend/api/controllers/metadata.js +4 -4
  185. package/build/frontend/api/controllers/subscriptions.js +2 -2
  186. package/build/frontend/api/controllers/users.js +8 -13
  187. package/build/frontend/api/controllers-info.js +15 -15
  188. package/build/frontend/api/routes.js +21 -23
  189. package/build/frontend/commands/bandwidth-stats/index.js +1 -1
  190. package/build/frontend/commands/bandwidth-stats/internal-squads/get-internal-squad-usage.command.js +50 -0
  191. package/build/frontend/commands/bandwidth-stats/internal-squads/get-internal-squad-user-usage.command.js +34 -0
  192. package/build/frontend/commands/bandwidth-stats/{legacy → internal-squads}/index.js +2 -2
  193. package/build/frontend/commands/bandwidth-stats/nodes/get-node-usage.command.js +38 -0
  194. package/build/frontend/commands/bandwidth-stats/nodes/index.js +1 -0
  195. package/build/frontend/commands/bandwidth-stats/users/get-stats-user-usage.command.js +5 -4
  196. package/build/frontend/commands/connections/connections-by-node-result.command.js +1 -1
  197. package/build/frontend/commands/connections/connections-by-user-result.command.js +1 -2
  198. package/build/frontend/commands/connections/connections-by-user.command.js +4 -3
  199. package/build/frontend/commands/connections/drop-connections.command.js +3 -3
  200. package/build/frontend/commands/hwid/create-user-hwid-device.command.js +1 -1
  201. package/build/frontend/commands/hwid/delete-all-user-hwid-devices.command.js +1 -1
  202. package/build/frontend/commands/hwid/delete-user-hwid-device.command.js +1 -1
  203. package/build/frontend/commands/hwid/get-top-users-by-hwid-devices.command.js +0 -1
  204. package/build/frontend/commands/hwid/get-user-hwid-devices.command.js +3 -3
  205. package/build/frontend/commands/internal-squads/bulk-actions/add-many-users-to-internal-squad.command.js +18 -0
  206. package/build/frontend/commands/internal-squads/bulk-actions/delete-many-users-from-internal-squad.command.js +18 -0
  207. package/build/frontend/commands/internal-squads/bulk-actions/index.js +2 -0
  208. package/build/frontend/commands/metadata/user/get-user-metadata.command.js +4 -3
  209. package/build/frontend/commands/metadata/user/upsert-user-metadata.command.js +3 -3
  210. package/build/frontend/commands/node-plugins/torrent-blocker/get-torrent-blocker-reports-stats.command.js +1 -1
  211. package/build/frontend/commands/subscriptions/get-by/get-connection-keys-by-user-id.command.js +23 -0
  212. package/build/frontend/commands/subscriptions/get-by/get-subscription-by-user-id.command.js +19 -0
  213. package/build/frontend/commands/subscriptions/get-by/index.js +2 -2
  214. package/build/frontend/commands/users/actions/disable-user.command.js +4 -3
  215. package/build/frontend/commands/users/actions/enable-user.command.js +4 -3
  216. package/build/frontend/commands/users/actions/reset-user-traffic.command.js +4 -3
  217. package/build/frontend/commands/users/actions/revoke-user-subscription.command.js +4 -3
  218. package/build/frontend/commands/users/bulk/bulk-delete-users.command.js +2 -2
  219. package/build/frontend/commands/users/bulk/bulk-extend-expiration-date.command.js +1 -1
  220. package/build/frontend/commands/users/bulk/bulk-reset-traffic-users.command.js +2 -2
  221. package/build/frontend/commands/users/bulk/bulk-revoke-users-subscription.command.js +2 -2
  222. package/build/frontend/commands/users/bulk/bulk-update-users-squads.command.js +2 -2
  223. package/build/frontend/commands/users/bulk/bulk-update-users.command.js +2 -2
  224. package/build/frontend/commands/users/create-user.command.js +0 -3
  225. package/build/frontend/commands/users/delete-user.command.js +4 -3
  226. package/build/frontend/commands/users/get-by/index.js +0 -1
  227. package/build/frontend/commands/users/get-user-accessible-nodes.command.js +5 -4
  228. package/build/frontend/commands/users/{get-by/get-user-by-id.command.js → get-user-by-id.command.js} +8 -7
  229. package/build/frontend/commands/users/get-user-subscription-request-history.command.js +5 -5
  230. package/build/frontend/commands/users/index.js +1 -1
  231. package/build/frontend/commands/users/resolve-user.command.js +5 -5
  232. package/build/frontend/commands/users/update-user.command.js +4 -6
  233. package/build/frontend/constants/errors/errors.js +15 -5
  234. package/build/frontend/models/index.js +1 -0
  235. package/build/frontend/models/path-params.schema.js +5 -0
  236. package/build/frontend/models/torrent-blocker-report.schema.js +0 -1
  237. package/build/frontend/models/users.schema.js +0 -1
  238. package/package.json +1 -1
  239. package/build/backend/commands/bandwidth-stats/legacy/get-legacy-stats-node-user-usage.command.d.ts +0 -26
  240. package/build/backend/commands/bandwidth-stats/legacy/get-legacy-stats-node-user-usage.command.d.ts.map +0 -1
  241. package/build/backend/commands/bandwidth-stats/legacy/get-legacy-stats-node-user-usage.command.js +0 -28
  242. package/build/backend/commands/bandwidth-stats/legacy/get-legacy-user-usage.command.d.ts +0 -27
  243. package/build/backend/commands/bandwidth-stats/legacy/get-legacy-user-usage.command.d.ts.map +0 -1
  244. package/build/backend/commands/bandwidth-stats/legacy/get-legacy-user-usage.command.js +0 -29
  245. package/build/backend/commands/bandwidth-stats/legacy/index.d.ts +0 -3
  246. package/build/backend/commands/bandwidth-stats/legacy/index.d.ts.map +0 -1
  247. package/build/backend/commands/subscriptions/get-by/get-connection-keys-by-uuid.command.d.ts.map +0 -1
  248. package/build/backend/commands/subscriptions/get-by/get-connection-keys-by-uuid.command.js +0 -22
  249. package/build/backend/commands/subscriptions/get-by/get-subscription-by-uuid.command.d.ts.map +0 -1
  250. package/build/backend/commands/subscriptions/get-by/get-subscription-by-uuid.command.js +0 -19
  251. package/build/backend/commands/users/get-by/get-user-by-id.command.d.ts +0 -61
  252. package/build/backend/commands/users/get-by/get-user-by-id.command.d.ts.map +0 -1
  253. package/build/backend/commands/users/get-user-by-uuid.command.d.ts.map +0 -1
  254. package/build/backend/commands/users/get-user-by-uuid.command.js +0 -17
  255. package/build/frontend/commands/bandwidth-stats/legacy/get-legacy-stats-node-user-usage.command.js +0 -28
  256. package/build/frontend/commands/bandwidth-stats/legacy/get-legacy-user-usage.command.js +0 -29
  257. package/build/frontend/commands/subscriptions/get-by/get-connection-keys-by-uuid.command.js +0 -22
  258. package/build/frontend/commands/subscriptions/get-by/get-subscription-by-uuid.command.js +0 -19
  259. package/build/frontend/commands/users/get-user-by-uuid.command.js +0 -17
@@ -24,8 +24,7 @@ var ConnectionsByUserResultCommand;
24
24
  result: zod_1.z
25
25
  .object({
26
26
  success: zod_1.z.boolean(),
27
- userUuid: zod_1.z.uuid(),
28
- userId: zod_1.z.string(),
27
+ userId: zod_1.z.number(),
29
28
  nodes: zod_1.z.array(zod_1.z.object({
30
29
  nodeUuid: zod_1.z.uuid(),
31
30
  nodeName: zod_1.z.string(),
@@ -4,13 +4,14 @@ exports.ConnectionsByUserCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const api_1 = require("../../api");
6
6
  const constants_1 = require("../../constants");
7
+ const models_1 = require("../../models");
7
8
  var ConnectionsByUserCommand;
8
9
  (function (ConnectionsByUserCommand) {
9
10
  ConnectionsByUserCommand.url = api_1.REST_API.CONNECTIONS.CONNECTIONS_BY_USER;
10
- ConnectionsByUserCommand.TSQ_url = ConnectionsByUserCommand.url(':uuid');
11
- ConnectionsByUserCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.CONNECTIONS_ROUTES.CONNECTIONS_BY_USER(':uuid'), 'post', 'Request Connections for User', { scope: 'by-user', kind: 'read' });
11
+ ConnectionsByUserCommand.TSQ_url = ConnectionsByUserCommand.url(':userId');
12
+ ConnectionsByUserCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.CONNECTIONS_ROUTES.CONNECTIONS_BY_USER(':userId'), 'post', 'Request Connections for User', { scope: 'by-user', kind: 'read' });
12
13
  ConnectionsByUserCommand.RequestParamSchema = zod_1.z.object({
13
- uuid: zod_1.z.uuid().describe('User UUID'),
14
+ userId: models_1.numberParamSchema,
14
15
  });
15
16
  ConnectionsByUserCommand.ResponseSchema = zod_1.z.object({
16
17
  response: zod_1.z.object({
@@ -12,10 +12,10 @@ var DropConnectionsCommand;
12
12
  DropConnectionsCommand.DropBySchema = zod_1.z.discriminatedUnion('by', [
13
13
  zod_1.z
14
14
  .object({
15
- by: zod_1.z.literal('userUuids'),
16
- userUuids: zod_1.z.array(zod_1.z.uuid()).min(1),
15
+ by: zod_1.z.literal('userIds'),
16
+ userIds: zod_1.z.array(zod_1.z.number()).min(1),
17
17
  })
18
- .describe('Drop by user UUIDs'),
18
+ .describe('Drop by user IDs'),
19
19
  zod_1.z
20
20
  .object({
21
21
  by: zod_1.z.literal('ipAddresses'),
@@ -12,7 +12,7 @@ var CreateUserHwidDeviceCommand;
12
12
  CreateUserHwidDeviceCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.HWID_ROUTES.CREATE_USER_HWID_DEVICE, 'post', 'Create a user HWID device', { scope: 'create', kind: 'write' });
13
13
  CreateUserHwidDeviceCommand.RequestBodySchema = zod_1.z.object({
14
14
  hwid: zod_1.z.string().regex(/^[a-zA-Z0-9=-]{10,64}$/),
15
- userUuid: zod_1.z.uuid(),
15
+ userId: zod_1.z.number(),
16
16
  platform: zod_1.z.optional(zod_1.z.string()),
17
17
  osVersion: zod_1.z.optional(zod_1.z.string()),
18
18
  deviceModel: zod_1.z.optional(zod_1.z.string()),
@@ -11,7 +11,7 @@ var DeleteAllUserHwidDevicesCommand;
11
11
  DeleteAllUserHwidDevicesCommand.TSQ_url = DeleteAllUserHwidDevicesCommand.url;
12
12
  DeleteAllUserHwidDevicesCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.HWID_ROUTES.DELETE_ALL_USER_HWID_DEVICES, 'post', 'Delete all user HWID devices', { scope: 'delete-all', kind: 'write' });
13
13
  DeleteAllUserHwidDevicesCommand.RequestBodySchema = zod_1.z.object({
14
- userUuid: zod_1.z.uuid(),
14
+ userId: zod_1.z.number(),
15
15
  });
16
16
  DeleteAllUserHwidDevicesCommand.ResponseSchema = zod_1.z.object({
17
17
  response: zod_1.z.object({
@@ -11,7 +11,7 @@ var DeleteUserHwidDeviceCommand;
11
11
  DeleteUserHwidDeviceCommand.TSQ_url = DeleteUserHwidDeviceCommand.url;
12
12
  DeleteUserHwidDeviceCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.HWID_ROUTES.DELETE_USER_HWID_DEVICE, 'post', 'Delete a user HWID device', { scope: 'delete', kind: 'write' });
13
13
  DeleteUserHwidDeviceCommand.RequestBodySchema = zod_1.z.object({
14
- userUuid: zod_1.z.uuid(),
14
+ userId: zod_1.z.number(),
15
15
  hwid: zod_1.z.string(),
16
16
  });
17
17
  DeleteUserHwidDeviceCommand.ResponseSchema = zod_1.z.object({
@@ -24,7 +24,6 @@ var GetTopUsersByHwidDevicesCommand;
24
24
  GetTopUsersByHwidDevicesCommand.ResponseSchema = zod_1.z.object({
25
25
  response: zod_1.z.object({
26
26
  users: zod_1.z.array(zod_1.z.object({
27
- userUuid: zod_1.z.uuid(),
28
27
  id: zod_1.z.number(),
29
28
  username: zod_1.z.string(),
30
29
  devicesCount: zod_1.z.number(),
@@ -8,10 +8,10 @@ const models_1 = require("../../models");
8
8
  var GetUserHwidDevicesCommand;
9
9
  (function (GetUserHwidDevicesCommand) {
10
10
  GetUserHwidDevicesCommand.url = api_1.REST_API.HWID.GET_USER_HWID_DEVICES;
11
- GetUserHwidDevicesCommand.TSQ_url = GetUserHwidDevicesCommand.url(':userUuid');
12
- GetUserHwidDevicesCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.HWID_ROUTES.GET_USER_HWID_DEVICES(':userUuid'), 'get', 'Get user HWID devices', { scope: 'list-by-user', kind: 'read' });
11
+ GetUserHwidDevicesCommand.TSQ_url = GetUserHwidDevicesCommand.url(':userId');
12
+ GetUserHwidDevicesCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.HWID_ROUTES.GET_USER_HWID_DEVICES(':userId'), 'get', 'Get user HWID devices', { scope: 'list-by-user', kind: 'read' });
13
13
  GetUserHwidDevicesCommand.RequestParamSchema = zod_1.z.object({
14
- userUuid: zod_1.z.uuid(),
14
+ userId: zod_1.z.coerce.number(),
15
15
  });
16
16
  GetUserHwidDevicesCommand.ResponseSchema = zod_1.z.object({
17
17
  response: zod_1.z.object({
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddManyUsersToInternalSquadCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../../api");
6
+ const constants_1 = require("../../../constants");
7
+ var AddManyUsersToInternalSquadCommand;
8
+ (function (AddManyUsersToInternalSquadCommand) {
9
+ AddManyUsersToInternalSquadCommand.url = api_1.REST_API.INTERNAL_SQUADS.BULK_ACTIONS.ADD_MANY_USERS;
10
+ AddManyUsersToInternalSquadCommand.TSQ_url = AddManyUsersToInternalSquadCommand.url(':uuid');
11
+ AddManyUsersToInternalSquadCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.INTERNAL_SQUADS_ROUTES.BULK_ACTIONS.ADD_MANY_USERS(':uuid'), 'post', 'Add many users to internal squad', { scope: 'add-many-users', kind: 'write' });
12
+ AddManyUsersToInternalSquadCommand.RequestParamSchema = zod_1.z.object({
13
+ uuid: zod_1.z.uuid(),
14
+ });
15
+ AddManyUsersToInternalSquadCommand.RequestBodySchema = zod_1.z.object({
16
+ userIds: zod_1.z.array(zod_1.z.number()).min(1).max(1000),
17
+ });
18
+ })(AddManyUsersToInternalSquadCommand || (exports.AddManyUsersToInternalSquadCommand = AddManyUsersToInternalSquadCommand = {}));
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteManyUsersFromInternalSquadCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../../api");
6
+ const constants_1 = require("../../../constants");
7
+ var DeleteManyUsersFromInternalSquadCommand;
8
+ (function (DeleteManyUsersFromInternalSquadCommand) {
9
+ DeleteManyUsersFromInternalSquadCommand.url = api_1.REST_API.INTERNAL_SQUADS.BULK_ACTIONS.REMOVE_MANY_USERS;
10
+ DeleteManyUsersFromInternalSquadCommand.TSQ_url = DeleteManyUsersFromInternalSquadCommand.url(':uuid');
11
+ DeleteManyUsersFromInternalSquadCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.INTERNAL_SQUADS_ROUTES.BULK_ACTIONS.REMOVE_MANY_USERS(':uuid'), 'delete', 'Delete many users from internal squad', { scope: 'remove-many-users', kind: 'write' });
12
+ DeleteManyUsersFromInternalSquadCommand.RequestParamSchema = zod_1.z.object({
13
+ uuid: zod_1.z.uuid(),
14
+ });
15
+ DeleteManyUsersFromInternalSquadCommand.RequestBodySchema = zod_1.z.object({
16
+ userIds: zod_1.z.array(zod_1.z.number()).min(1).max(1000),
17
+ });
18
+ })(DeleteManyUsersFromInternalSquadCommand || (exports.DeleteManyUsersFromInternalSquadCommand = DeleteManyUsersFromInternalSquadCommand = {}));
@@ -16,3 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./add-users-to-internal-squad.command"), exports);
18
18
  __exportStar(require("./delete-users-from-internal-squad.command"), exports);
19
+ __exportStar(require("./add-many-users-to-internal-squad.command"), exports);
20
+ __exportStar(require("./delete-many-users-from-internal-squad.command"), exports);
@@ -4,13 +4,14 @@ exports.GetUserMetadataCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const api_1 = require("../../../api");
6
6
  const constants_1 = require("../../../constants");
7
+ const models_1 = require("../../../models");
7
8
  var GetUserMetadataCommand;
8
9
  (function (GetUserMetadataCommand) {
9
10
  GetUserMetadataCommand.url = api_1.REST_API.METADATA.USER.GET;
10
- GetUserMetadataCommand.TSQ_url = GetUserMetadataCommand.url(':uuid');
11
- GetUserMetadataCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.METADATA_ROUTES.USER.GET(':uuid'), 'get', 'Get user metadata', { scope: 'get-user', kind: 'read' });
11
+ GetUserMetadataCommand.TSQ_url = GetUserMetadataCommand.url(':userId');
12
+ GetUserMetadataCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.METADATA_ROUTES.USER.GET(':userId'), 'get', 'Get user metadata', { scope: 'get-user', kind: 'read' });
12
13
  GetUserMetadataCommand.RequestParamsSchema = zod_1.z.object({
13
- uuid: zod_1.z.uuid(),
14
+ userId: models_1.numberParamSchema,
14
15
  });
15
16
  GetUserMetadataCommand.ResponseSchema = zod_1.z.object({
16
17
  response: zod_1.z.object({
@@ -7,10 +7,10 @@ const constants_1 = require("../../../constants");
7
7
  var UpsertUserMetadataCommand;
8
8
  (function (UpsertUserMetadataCommand) {
9
9
  UpsertUserMetadataCommand.url = api_1.REST_API.METADATA.USER.UPSERT;
10
- UpsertUserMetadataCommand.TSQ_url = UpsertUserMetadataCommand.url(':uuid');
11
- UpsertUserMetadataCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.METADATA_ROUTES.USER.UPSERT(':uuid'), 'put', 'Update or create User Metadata', { scope: 'upsert-user', kind: 'write' });
10
+ UpsertUserMetadataCommand.TSQ_url = UpsertUserMetadataCommand.url(':userId');
11
+ UpsertUserMetadataCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.METADATA_ROUTES.USER.UPSERT(':userId'), 'put', 'Update or create User Metadata', { scope: 'upsert-user', kind: 'write' });
12
12
  UpsertUserMetadataCommand.RequestParamsSchema = zod_1.z.object({
13
- uuid: zod_1.z.uuid(),
13
+ userId: zod_1.z.coerce.number(),
14
14
  });
15
15
  UpsertUserMetadataCommand.RequestBodySchema = zod_1.z.object({
16
16
  metadata: zod_1.z.looseObject({}),
@@ -18,7 +18,7 @@ var GetTorrentBlockerReportsStatsCommand;
18
18
  reportsLast24Hours: zod_1.z.number(),
19
19
  }),
20
20
  topUsers: zod_1.z.array(zod_1.z.object({
21
- uuid: zod_1.z.uuid(),
21
+ userId: zod_1.z.number(),
22
22
  color: zod_1.z.string(),
23
23
  username: zod_1.z.string(),
24
24
  total: zod_1.z.number(),
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetConnectionKeysByUserIdCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../../api");
6
+ const constants_1 = require("../../../constants");
7
+ const models_1 = require("../../../models");
8
+ var GetConnectionKeysByUserIdCommand;
9
+ (function (GetConnectionKeysByUserIdCommand) {
10
+ GetConnectionKeysByUserIdCommand.url = api_1.REST_API.SUBSCRIPTIONS.GET_CONNECTION_KEYS_BY_USER_ID;
11
+ GetConnectionKeysByUserIdCommand.TSQ_url = GetConnectionKeysByUserIdCommand.url(':userId');
12
+ GetConnectionKeysByUserIdCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SUBSCRIPTIONS_ROUTES.GET_CONNECTION_KEYS_BY_USER_ID(':userId'), 'get', 'Get connection keys (base64 format) by user id', { scope: 'connection-keys', kind: 'read' });
13
+ GetConnectionKeysByUserIdCommand.RequestParamSchema = zod_1.z.object({
14
+ userId: models_1.numberParamSchema.describe('User ID'),
15
+ });
16
+ GetConnectionKeysByUserIdCommand.ResponseSchema = zod_1.z.object({
17
+ response: zod_1.z.object({
18
+ enabledKeys: zod_1.z.array(zod_1.z.string()),
19
+ hiddenKeys: zod_1.z.array(zod_1.z.string()),
20
+ disabledKeys: zod_1.z.array(zod_1.z.string()),
21
+ }),
22
+ });
23
+ })(GetConnectionKeysByUserIdCommand || (exports.GetConnectionKeysByUserIdCommand = GetConnectionKeysByUserIdCommand = {}));
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetSubscriptionByIdCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../../api");
6
+ const constants_1 = require("../../../constants");
7
+ const models_1 = require("../../../models");
8
+ var GetSubscriptionByIdCommand;
9
+ (function (GetSubscriptionByIdCommand) {
10
+ GetSubscriptionByIdCommand.url = api_1.REST_API.SUBSCRIPTIONS.GET_BY.ID;
11
+ GetSubscriptionByIdCommand.TSQ_url = GetSubscriptionByIdCommand.url(':userId');
12
+ GetSubscriptionByIdCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SUBSCRIPTIONS_ROUTES.GET_BY.ID(':userId'), 'get', 'Get subscription by User ID', { scope: 'by-id', kind: 'read' });
13
+ GetSubscriptionByIdCommand.RequestParamSchema = zod_1.z.object({
14
+ userId: models_1.numberParamSchema.describe('User ID'),
15
+ });
16
+ GetSubscriptionByIdCommand.ResponseSchema = zod_1.z.object({
17
+ response: models_1.SubscriptionInfoSchema,
18
+ });
19
+ })(GetSubscriptionByIdCommand || (exports.GetSubscriptionByIdCommand = GetSubscriptionByIdCommand = {}));
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./get-connection-keys-by-uuid.command"), exports);
17
+ __exportStar(require("./get-connection-keys-by-user-id.command"), exports);
18
18
  __exportStar(require("./get-raw-subscription-by-short-uuid.command"), exports);
19
19
  __exportStar(require("./get-subscription-by-short-uuid-protected.command"), exports);
20
20
  __exportStar(require("./get-subscription-by-username.command"), exports);
21
- __exportStar(require("./get-subscription-by-uuid.command"), exports);
21
+ __exportStar(require("./get-subscription-by-user-id.command"), exports);
@@ -4,14 +4,15 @@ exports.DisableUserCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const api_1 = require("../../../api");
6
6
  const constants_1 = require("../../../constants");
7
+ const models_1 = require("../../../models");
7
8
  const user_response_1 = require("../user.response");
8
9
  var DisableUserCommand;
9
10
  (function (DisableUserCommand) {
10
11
  DisableUserCommand.url = api_1.REST_API.USERS.ACTIONS.DISABLE;
11
- DisableUserCommand.TSQ_url = DisableUserCommand.url(':uuid');
12
- DisableUserCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.ACTIONS.DISABLE(':uuid'), 'post', 'Disable user', { scope: 'disable', kind: 'write' });
12
+ DisableUserCommand.TSQ_url = DisableUserCommand.url(':userId');
13
+ DisableUserCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.ACTIONS.DISABLE(':userId'), 'post', 'Disable user', { scope: 'disable', kind: 'write' });
13
14
  DisableUserCommand.RequestParamSchema = zod_1.z.object({
14
- uuid: zod_1.z.uuid(),
15
+ userId: models_1.numberParamSchema,
15
16
  });
16
17
  DisableUserCommand.ResponseSchema = user_response_1.UserResponseSchema;
17
18
  })(DisableUserCommand || (exports.DisableUserCommand = DisableUserCommand = {}));
@@ -4,14 +4,15 @@ exports.EnableUserCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const api_1 = require("../../../api");
6
6
  const constants_1 = require("../../../constants");
7
+ const models_1 = require("../../../models");
7
8
  const user_response_1 = require("../user.response");
8
9
  var EnableUserCommand;
9
10
  (function (EnableUserCommand) {
10
11
  EnableUserCommand.url = api_1.REST_API.USERS.ACTIONS.ENABLE;
11
- EnableUserCommand.TSQ_url = EnableUserCommand.url(':uuid');
12
- EnableUserCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.ACTIONS.ENABLE(':uuid'), 'post', 'Enable user', { scope: 'enable', kind: 'write' });
12
+ EnableUserCommand.TSQ_url = EnableUserCommand.url(':userId');
13
+ EnableUserCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.ACTIONS.ENABLE(':userId'), 'post', 'Enable user', { scope: 'enable', kind: 'write' });
13
14
  EnableUserCommand.RequestParamSchema = zod_1.z.object({
14
- uuid: zod_1.z.uuid(),
15
+ userId: models_1.numberParamSchema,
15
16
  });
16
17
  EnableUserCommand.ResponseSchema = user_response_1.UserResponseSchema;
17
18
  })(EnableUserCommand || (exports.EnableUserCommand = EnableUserCommand = {}));
@@ -4,14 +4,15 @@ exports.ResetUserTrafficCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const api_1 = require("../../../api");
6
6
  const constants_1 = require("../../../constants");
7
+ const models_1 = require("../../../models");
7
8
  const user_response_1 = require("../user.response");
8
9
  var ResetUserTrafficCommand;
9
10
  (function (ResetUserTrafficCommand) {
10
11
  ResetUserTrafficCommand.url = api_1.REST_API.USERS.ACTIONS.RESET_TRAFFIC;
11
- ResetUserTrafficCommand.TSQ_url = ResetUserTrafficCommand.url(':uuid');
12
- ResetUserTrafficCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.ACTIONS.RESET_TRAFFIC(':uuid'), 'post', 'Reset user traffic', { scope: 'reset-traffic', kind: 'write' });
12
+ ResetUserTrafficCommand.TSQ_url = ResetUserTrafficCommand.url(':userId');
13
+ ResetUserTrafficCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.ACTIONS.RESET_TRAFFIC(':userId'), 'post', 'Reset user traffic', { scope: 'reset-traffic', kind: 'write' });
13
14
  ResetUserTrafficCommand.RequestParamSchema = zod_1.z.object({
14
- uuid: zod_1.z.uuid(),
15
+ userId: models_1.numberParamSchema,
15
16
  });
16
17
  ResetUserTrafficCommand.ResponseSchema = user_response_1.UserResponseSchema;
17
18
  })(ResetUserTrafficCommand || (exports.ResetUserTrafficCommand = ResetUserTrafficCommand = {}));
@@ -4,14 +4,15 @@ exports.RevokeUserSubscriptionCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const api_1 = require("../../../api");
6
6
  const constants_1 = require("../../../constants");
7
+ const models_1 = require("../../../models");
7
8
  const user_response_1 = require("../user.response");
8
9
  var RevokeUserSubscriptionCommand;
9
10
  (function (RevokeUserSubscriptionCommand) {
10
11
  RevokeUserSubscriptionCommand.url = api_1.REST_API.USERS.ACTIONS.REVOKE_SUBSCRIPTION;
11
- RevokeUserSubscriptionCommand.TSQ_url = RevokeUserSubscriptionCommand.url(':uuid');
12
- RevokeUserSubscriptionCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.ACTIONS.REVOKE_SUBSCRIPTION(':uuid'), 'post', 'Revoke user subscription', { scope: 'revoke-subscription', kind: 'write' });
12
+ RevokeUserSubscriptionCommand.TSQ_url = RevokeUserSubscriptionCommand.url(':userId');
13
+ RevokeUserSubscriptionCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.ACTIONS.REVOKE_SUBSCRIPTION(':userId'), 'post', 'Revoke user subscription', { scope: 'revoke-subscription', kind: 'write' });
13
14
  RevokeUserSubscriptionCommand.RequestParamSchema = zod_1.z.object({
14
- uuid: zod_1.z.uuid(),
15
+ userId: models_1.numberParamSchema,
15
16
  });
16
17
  RevokeUserSubscriptionCommand.RequestBodySchema = zod_1.z.preprocess((val) => val || {}, zod_1.z.object({
17
18
  revokeOnlyPasswords: zod_1.z.optional(zod_1.z
@@ -8,8 +8,8 @@ var BulkDeleteUsersCommand;
8
8
  (function (BulkDeleteUsersCommand) {
9
9
  BulkDeleteUsersCommand.url = api_1.REST_API.USERS.BULK.DELETE;
10
10
  BulkDeleteUsersCommand.TSQ_url = BulkDeleteUsersCommand.url;
11
- BulkDeleteUsersCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.BULK.DELETE, 'post', 'Bulk delete users by UUIDs', { scope: 'bulk-delete', kind: 'write' });
11
+ BulkDeleteUsersCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.BULK.DELETE, 'post', 'Bulk delete users by User IDs', { scope: 'bulk-delete', kind: 'write' });
12
12
  BulkDeleteUsersCommand.RequestBodySchema = zod_1.z.object({
13
- uuids: zod_1.z.array(zod_1.z.uuid()).min(1).max(500),
13
+ userIds: zod_1.z.array(zod_1.z.number()).min(1).max(500),
14
14
  });
15
15
  })(BulkDeleteUsersCommand || (exports.BulkDeleteUsersCommand = BulkDeleteUsersCommand = {}));
@@ -10,7 +10,7 @@ var BulkExtendExpirationDateCommand;
10
10
  BulkExtendExpirationDateCommand.TSQ_url = BulkExtendExpirationDateCommand.url;
11
11
  BulkExtendExpirationDateCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.BULK.EXTEND_EXPIRATION_DATE, 'post', 'Extend expiration date for specified users by days', { scope: 'bulk-extend-expiration-date', kind: 'write' });
12
12
  BulkExtendExpirationDateCommand.RequestBodySchema = zod_1.z.object({
13
- uuids: zod_1.z.array(zod_1.z.uuid()).min(1).max(500),
13
+ userIds: zod_1.z.array(zod_1.z.number()).min(1).max(500),
14
14
  extendDays: zod_1.z.int().min(1).max(9999),
15
15
  });
16
16
  })(BulkExtendExpirationDateCommand || (exports.BulkExtendExpirationDateCommand = BulkExtendExpirationDateCommand = {}));
@@ -8,8 +8,8 @@ var BulkResetTrafficUsersCommand;
8
8
  (function (BulkResetTrafficUsersCommand) {
9
9
  BulkResetTrafficUsersCommand.url = api_1.REST_API.USERS.BULK.RESET_TRAFFIC;
10
10
  BulkResetTrafficUsersCommand.TSQ_url = BulkResetTrafficUsersCommand.url;
11
- BulkResetTrafficUsersCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.BULK.RESET_TRAFFIC, 'post', 'Bulk reset traffic users by UUIDs', { scope: 'bulk-reset-traffic', kind: 'write' });
11
+ BulkResetTrafficUsersCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.BULK.RESET_TRAFFIC, 'post', 'Bulk reset traffic users by User IDs', { scope: 'bulk-reset-traffic', kind: 'write' });
12
12
  BulkResetTrafficUsersCommand.RequestBodySchema = zod_1.z.object({
13
- uuids: zod_1.z.array(zod_1.z.uuid()).min(1).max(500),
13
+ userIds: zod_1.z.array(zod_1.z.number()).min(1).max(500),
14
14
  });
15
15
  })(BulkResetTrafficUsersCommand || (exports.BulkResetTrafficUsersCommand = BulkResetTrafficUsersCommand = {}));
@@ -8,8 +8,8 @@ var BulkRevokeUsersSubscriptionCommand;
8
8
  (function (BulkRevokeUsersSubscriptionCommand) {
9
9
  BulkRevokeUsersSubscriptionCommand.url = api_1.REST_API.USERS.BULK.REVOKE_SUBSCRIPTION;
10
10
  BulkRevokeUsersSubscriptionCommand.TSQ_url = BulkRevokeUsersSubscriptionCommand.url;
11
- BulkRevokeUsersSubscriptionCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.BULK.REVOKE_SUBSCRIPTION, 'post', 'Revoke users subscription by User UUIDs', { scope: 'bulk-revoke-subscription', kind: 'write' });
11
+ BulkRevokeUsersSubscriptionCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.BULK.REVOKE_SUBSCRIPTION, 'post', 'Revoke users subscription by User IDs', { scope: 'bulk-revoke-subscription', kind: 'write' });
12
12
  BulkRevokeUsersSubscriptionCommand.RequestBodySchema = zod_1.z.object({
13
- uuids: zod_1.z.array(zod_1.z.uuid()).min(1).max(500),
13
+ userIds: zod_1.z.array(zod_1.z.number()).min(1).max(500),
14
14
  });
15
15
  })(BulkRevokeUsersSubscriptionCommand || (exports.BulkRevokeUsersSubscriptionCommand = BulkRevokeUsersSubscriptionCommand = {}));
@@ -8,9 +8,9 @@ var BulkUpdateUsersSquadsCommand;
8
8
  (function (BulkUpdateUsersSquadsCommand) {
9
9
  BulkUpdateUsersSquadsCommand.url = api_1.REST_API.USERS.BULK.UPDATE_SQUADS;
10
10
  BulkUpdateUsersSquadsCommand.TSQ_url = BulkUpdateUsersSquadsCommand.url;
11
- BulkUpdateUsersSquadsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.BULK.UPDATE_SQUADS, 'post', 'Bulk update users internal squads by UUIDs', { scope: 'bulk-update-squads', kind: 'write' });
11
+ BulkUpdateUsersSquadsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.BULK.UPDATE_SQUADS, 'post', 'Bulk update users internal squads by User IDs', { scope: 'bulk-update-squads', kind: 'write' });
12
12
  BulkUpdateUsersSquadsCommand.RequestBodySchema = zod_1.z.object({
13
- uuids: zod_1.z.array(zod_1.z.uuid()).min(1).max(500),
13
+ userIds: zod_1.z.array(zod_1.z.number()).min(1).max(500),
14
14
  activeInternalSquads: zod_1.z.array(zod_1.z.uuid()),
15
15
  });
16
16
  })(BulkUpdateUsersSquadsCommand || (exports.BulkUpdateUsersSquadsCommand = BulkUpdateUsersSquadsCommand = {}));
@@ -10,9 +10,9 @@ var BulkUpdateUsersCommand;
10
10
  (function (BulkUpdateUsersCommand) {
11
11
  BulkUpdateUsersCommand.url = api_1.REST_API.USERS.BULK.UPDATE;
12
12
  BulkUpdateUsersCommand.TSQ_url = BulkUpdateUsersCommand.url;
13
- BulkUpdateUsersCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.BULK.UPDATE, 'post', 'Bulk update users by UUIDs', { scope: 'bulk-update-users', kind: 'write' });
13
+ BulkUpdateUsersCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.BULK.UPDATE, 'post', 'Bulk update users by User IDs', { scope: 'bulk-update-users', kind: 'write' });
14
14
  BulkUpdateUsersCommand.RequestBodySchema = zod_1.z.object({
15
- uuids: zod_1.z.array(zod_1.z.uuid()).min(1).max(500),
15
+ userIds: zod_1.z.array(zod_1.z.number()).min(1).max(500),
16
16
  fields: zod_1.z.object({
17
17
  status: models_1.UsersSchema.shape.status.optional(),
18
18
  trafficLimitBytes: zod_1.z.optional(zod_1.z.number().min(0).describe('Traffic limit in bytes. 0 - unlimited')),
@@ -89,9 +89,6 @@ var CreateUserCommand;
89
89
  .array(zod_1.z.uuid())
90
90
  .optional()
91
91
  .describe('Optional. Array of UUIDs representing enabled internal squads.'),
92
- uuid: zod_1.z.optional(zod_1.z
93
- .uuid()
94
- .describe('Optional. Pass UUID to create user with specific UUID, otherwise it will be generated automatically.')),
95
92
  externalSquadUuid: zod_1.z
96
93
  .optional(zod_1.z.nullable(zod_1.z.uuid()))
97
94
  .describe('Optional. External squad UUID.'),
@@ -4,12 +4,13 @@ exports.DeleteUserCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const api_1 = require("../../api");
6
6
  const constants_1 = require("../../constants");
7
+ const models_1 = require("../../models");
7
8
  var DeleteUserCommand;
8
9
  (function (DeleteUserCommand) {
9
10
  DeleteUserCommand.url = api_1.REST_API.USERS.DELETE;
10
- DeleteUserCommand.TSQ_url = DeleteUserCommand.url(':uuid');
11
- DeleteUserCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.DELETE(':uuid'), 'delete', 'Delete user', { scope: 'delete', kind: 'write' });
11
+ DeleteUserCommand.TSQ_url = DeleteUserCommand.url(':userId');
12
+ DeleteUserCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.DELETE(':userId'), 'delete', 'Delete user', { scope: 'delete', kind: 'write' });
12
13
  DeleteUserCommand.RequestParamSchema = zod_1.z.object({
13
- uuid: zod_1.z.uuid(),
14
+ userId: models_1.numberParamSchema,
14
15
  });
15
16
  })(DeleteUserCommand || (exports.DeleteUserCommand = DeleteUserCommand = {}));
@@ -14,6 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./get-user-by-id.command"), exports);
18
17
  __exportStar(require("./get-user-by-short-uuid.command"), exports);
19
18
  __exportStar(require("./get-user-by-username.command"), exports);
@@ -4,17 +4,18 @@ exports.GetUserAccessibleNodesCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const api_1 = require("../../api");
6
6
  const constants_1 = require("../../constants");
7
+ const models_1 = require("../../models");
7
8
  var GetUserAccessibleNodesCommand;
8
9
  (function (GetUserAccessibleNodesCommand) {
9
10
  GetUserAccessibleNodesCommand.url = api_1.REST_API.USERS.ACCESSIBLE_NODES;
10
- GetUserAccessibleNodesCommand.TSQ_url = GetUserAccessibleNodesCommand.url(':uuid');
11
- GetUserAccessibleNodesCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.ACCESSIBLE_NODES(':uuid'), 'get', 'Get user accessible nodes', { scope: 'accessible-nodes', kind: 'read' });
11
+ GetUserAccessibleNodesCommand.TSQ_url = GetUserAccessibleNodesCommand.url(':userId');
12
+ GetUserAccessibleNodesCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.ACCESSIBLE_NODES(':userId'), 'get', 'Get user accessible nodes', { scope: 'accessible-nodes', kind: 'read' });
12
13
  GetUserAccessibleNodesCommand.RequestParamSchema = zod_1.z.object({
13
- uuid: zod_1.z.uuid(),
14
+ userId: models_1.numberParamSchema,
14
15
  });
15
16
  GetUserAccessibleNodesCommand.ResponseSchema = zod_1.z.object({
16
17
  response: zod_1.z.object({
17
- userUuid: zod_1.z.uuid(),
18
+ userId: zod_1.z.number(),
18
19
  activeNodes: zod_1.z.array(zod_1.z.object({
19
20
  uuid: zod_1.z.uuid(),
20
21
  nodeName: zod_1.z.string(),
@@ -2,16 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetUserByIdCommand = void 0;
4
4
  const zod_1 = require("zod");
5
- const api_1 = require("../../../api");
6
- const constants_1 = require("../../../constants");
7
- const user_response_1 = require("../user.response");
5
+ const api_1 = require("../../api");
6
+ const constants_1 = require("../../constants");
7
+ const models_1 = require("../../models");
8
+ const user_response_1 = require("./user.response");
8
9
  var GetUserByIdCommand;
9
10
  (function (GetUserByIdCommand) {
10
- GetUserByIdCommand.url = api_1.REST_API.USERS.GET_BY.ID;
11
- GetUserByIdCommand.TSQ_url = GetUserByIdCommand.url(':id');
12
- GetUserByIdCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.GET_BY.ID(':id'), 'get', 'Get user by ID', { scope: 'by-id', kind: 'read' });
11
+ GetUserByIdCommand.url = api_1.REST_API.USERS.GET_BY_ID;
12
+ GetUserByIdCommand.TSQ_url = GetUserByIdCommand.url(':userId');
13
+ GetUserByIdCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.GET_BY_ID(':userId'), 'get', 'Get user by ID', { scope: 'by-id', kind: 'read' });
13
14
  GetUserByIdCommand.RequestParamSchema = zod_1.z.object({
14
- id: zod_1.z.string().transform(Number).pipe(zod_1.z.number().nonnegative()),
15
+ userId: models_1.numberParamSchema,
15
16
  });
16
17
  GetUserByIdCommand.ResponseSchema = user_response_1.UserResponseSchema;
17
18
  })(GetUserByIdCommand || (exports.GetUserByIdCommand = GetUserByIdCommand = {}));
@@ -4,13 +4,14 @@ exports.GetUserSubscriptionRequestHistoryCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const api_1 = require("../../api");
6
6
  const constants_1 = require("../../constants");
7
+ const models_1 = require("../../models");
7
8
  var GetUserSubscriptionRequestHistoryCommand;
8
9
  (function (GetUserSubscriptionRequestHistoryCommand) {
9
10
  GetUserSubscriptionRequestHistoryCommand.url = api_1.REST_API.USERS.SUBSCRIPTION_REQUEST_HISTORY;
10
- GetUserSubscriptionRequestHistoryCommand.TSQ_url = GetUserSubscriptionRequestHistoryCommand.url(':uuid');
11
- GetUserSubscriptionRequestHistoryCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.SUBSCRIPTION_REQUEST_HISTORY(':uuid'), 'get', 'Get user subscription request history, recent 24 records', { scope: 'subscription-request-history', kind: 'read' });
11
+ GetUserSubscriptionRequestHistoryCommand.TSQ_url = GetUserSubscriptionRequestHistoryCommand.url(':userId');
12
+ GetUserSubscriptionRequestHistoryCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.SUBSCRIPTION_REQUEST_HISTORY(':userId'), 'get', 'Get user subscription request history, recent 24 records', { scope: 'subscription-request-history', kind: 'read' });
12
13
  GetUserSubscriptionRequestHistoryCommand.RequestParamSchema = zod_1.z.object({
13
- uuid: zod_1.z.uuid(),
14
+ userId: models_1.numberParamSchema,
14
15
  });
15
16
  GetUserSubscriptionRequestHistoryCommand.ResponseSchema = zod_1.z.object({
16
17
  response: zod_1.z.object({
@@ -18,8 +19,7 @@ var GetUserSubscriptionRequestHistoryCommand;
18
19
  records: zod_1.z.array(zod_1.z.object({
19
20
  id: zod_1.z.number(),
20
21
  userId: zod_1.z.number(),
21
- requestAt: zod_1.z.iso.datetime()
22
- .transform((str) => new Date(str)),
22
+ requestAt: zod_1.z.iso.datetime().transform((str) => new Date(str)),
23
23
  requestIp: zod_1.z.string().optional().nullable(),
24
24
  userAgent: zod_1.z.string().optional().nullable(),
25
25
  })),
@@ -22,7 +22,7 @@ __exportStar(require("./delete-user.command"), exports);
22
22
  __exportStar(require("./get-users.command"), exports);
23
23
  __exportStar(require("./get-by"), exports);
24
24
  __exportStar(require("./get-user-accessible-nodes.command"), exports);
25
- __exportStar(require("./get-user-by-uuid.command"), exports);
25
+ __exportStar(require("./get-user-by-id.command"), exports);
26
26
  __exportStar(require("./get-user-subscription-request-history.command"), exports);
27
27
  __exportStar(require("./get-users-stream.command"), exports);
28
28
  __exportStar(require("./resolve-user.command"), exports);
@@ -8,10 +8,10 @@ var ResolveUserCommand;
8
8
  (function (ResolveUserCommand) {
9
9
  ResolveUserCommand.url = api_1.REST_API.USERS.RESOLVE;
10
10
  ResolveUserCommand.TSQ_url = ResolveUserCommand.url;
11
- ResolveUserCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.RESOLVE, 'post', 'Resolve a user', { scope: 'resolve', kind: 'read' });
11
+ ResolveUserCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.RESOLVE, 'post', 'Resolve a user', { scope: 'resolve', kind: 'read' }, 'Resolve a user by ID, Short UUID or username. Exactly one of the fields must be provided.');
12
12
  ResolveUserCommand.RequestBodySchema = zod_1.z
13
13
  .object({
14
- uuid: zod_1.z.uuid().optional(),
14
+ uuid: zod_1.z.uuid().optional().meta({ deprecated: true }),
15
15
  id: zod_1.z.number().optional(),
16
16
  shortUuid: zod_1.z.string().optional(),
17
17
  username: zod_1.z.string().optional(),
@@ -20,14 +20,14 @@ var ResolveUserCommand;
20
20
  const provided = [data.uuid, data.id, data.shortUuid, data.username].filter((v) => v !== undefined);
21
21
  return provided.length === 1;
22
22
  }, {
23
- error: 'Exactly one of uuid, id, shortUuid, or username must be provided'
23
+ error: 'Exactly one of uuid, id, shortUuid, or username must be provided',
24
24
  });
25
25
  ResolveUserCommand.ResponseSchema = zod_1.z.object({
26
26
  response: zod_1.z.object({
27
- uuid: zod_1.z.uuid(),
28
- username: zod_1.z.string(),
29
27
  id: zod_1.z.number(),
28
+ username: zod_1.z.string(),
30
29
  shortUuid: zod_1.z.string(),
30
+ uuid: zod_1.z.uuid().meta({ deprecated: true }),
31
31
  }),
32
32
  });
33
33
  })(ResolveUserCommand || (exports.ResolveUserCommand = ResolveUserCommand = {}));
@@ -9,13 +9,11 @@ var UpdateUserCommand;
9
9
  (function (UpdateUserCommand) {
10
10
  UpdateUserCommand.url = api_1.REST_API.USERS.UPDATE;
11
11
  UpdateUserCommand.TSQ_url = UpdateUserCommand.url;
12
- UpdateUserCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.UPDATE, 'patch', 'Update a user by UUID or username', { scope: 'update', kind: 'write' });
12
+ UpdateUserCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.UPDATE, 'patch', 'Update a user', { scope: 'update', kind: 'write' }, 'Update a user by ID or username. Exactly one of the fields must be provided.');
13
13
  UpdateUserCommand.RequestBodySchema = zod_1.z
14
14
  .object({
15
15
  username: zod_1.z.optional(zod_1.z.string().describe('Username of the user')),
16
- uuid: zod_1.z.optional(zod_1.z
17
- .uuid()
18
- .describe('UUID of the user. UUID has higher priority than username, so if both are provided, username will be ignored.')),
16
+ id: zod_1.z.optional(zod_1.z.number().describe('ID of the user')),
19
17
  status: zod_1.z.enum([constants_1.USERS_STATUS.ACTIVE, constants_1.USERS_STATUS.DISABLED]).optional(),
20
18
  trafficLimitBytes: zod_1.z
21
19
  .number()
@@ -48,8 +46,8 @@ var UpdateUserCommand;
48
46
  .optional(zod_1.z.nullable(zod_1.z.uuid()))
49
47
  .describe('Optional. External squad UUID.'),
50
48
  })
51
- .refine((data) => data.uuid || data.username, {
52
- error: 'Either uuid or username must be provided',
49
+ .refine((d) => d.username ?? d.id, {
50
+ error: 'At least one of username, id must be provided',
53
51
  });
54
52
  UpdateUserCommand.ResponseSchema = user_response_1.UserResponseSchema;
55
53
  })(UpdateUserCommand || (exports.UpdateUserCommand = UpdateUserCommand = {}));