@remnawave/backend-contract 0.0.56 → 0.0.60
Sign up to get free protection for your applications and to get access to all the features.
- package/build/backend/api/controllers/api-tokens.d.ts +7 -0
- package/build/backend/api/controllers/api-tokens.d.ts.map +1 -0
- package/build/backend/api/controllers/auth.d.ts +5 -0
- package/build/backend/api/controllers/auth.d.ts.map +1 -0
- package/build/backend/api/controllers/hosts.d.ts +10 -0
- package/build/backend/api/controllers/hosts.d.ts.map +1 -0
- package/build/backend/api/controllers/inbounds.d.ts +5 -0
- package/build/backend/api/controllers/inbounds.d.ts.map +1 -0
- package/{api/controllers/index.ts → build/backend/api/controllers/index.d.ts} +1 -0
- package/build/backend/api/controllers/index.d.ts.map +1 -0
- package/build/backend/api/controllers/keygen.d.ts +5 -0
- package/build/backend/api/controllers/keygen.d.ts.map +1 -0
- package/build/backend/api/controllers/nodes.d.ts +13 -0
- package/build/backend/api/controllers/nodes.d.ts.map +1 -0
- package/build/backend/api/controllers/subscription.d.ts +6 -0
- package/build/backend/api/controllers/subscription.d.ts.map +1 -0
- package/build/backend/api/controllers/system.d.ts +9 -0
- package/build/backend/api/controllers/system.d.ts.map +1 -0
- package/build/backend/api/controllers/users.d.ts +15 -0
- package/build/backend/api/controllers/users.d.ts.map +1 -0
- package/build/backend/api/controllers/xray.d.ts +6 -0
- package/build/backend/api/controllers/xray.d.ts.map +1 -0
- package/{api/index.ts → build/backend/api/index.d.ts} +1 -0
- package/build/backend/api/index.d.ts.map +1 -0
- package/build/backend/api/routes.d.ts +63 -0
- package/build/backend/api/routes.d.ts.map +1 -0
- package/build/backend/commands/api-tokens/create.command.d.ts +40 -0
- package/build/backend/commands/api-tokens/create.command.d.ts.map +1 -0
- package/build/backend/commands/api-tokens/delete.command.d.ts +22 -0
- package/build/backend/commands/api-tokens/delete.command.d.ts.map +1 -0
- package/build/backend/commands/api-tokens/find.command.d.ts +49 -0
- package/build/backend/commands/api-tokens/find.command.d.ts.map +1 -0
- package/{commands/api-tokens/index.ts → build/backend/commands/api-tokens/index.d.ts} +1 -0
- package/build/backend/commands/api-tokens/index.d.ts.map +1 -0
- package/build/backend/commands/auth/index.d.ts +2 -0
- package/build/backend/commands/auth/index.d.ts.map +1 -0
- package/build/backend/commands/auth/login.command.d.ts +35 -0
- package/build/backend/commands/auth/login.command.d.ts.map +1 -0
- package/build/backend/commands/hosts/create.command.d.ts +122 -0
- package/build/backend/commands/hosts/create.command.d.ts.map +1 -0
- package/build/backend/commands/hosts/delete.command.d.ts +32 -0
- package/build/backend/commands/hosts/delete.command.d.ts.map +1 -0
- package/build/backend/commands/hosts/get-all.command.d.ts +84 -0
- package/build/backend/commands/hosts/get-all.command.d.ts.map +1 -0
- package/{commands/hosts/index.ts → build/backend/commands/hosts/index.d.ts} +1 -0
- package/build/backend/commands/hosts/index.d.ts.map +1 -0
- package/build/backend/commands/hosts/reorder.command.d.ts +58 -0
- package/build/backend/commands/hosts/reorder.command.d.ts.map +1 -0
- package/build/backend/commands/hosts/update.command.d.ts +138 -0
- package/build/backend/commands/hosts/update.command.d.ts.map +1 -0
- package/build/backend/commands/inbounds/get-inbounds.command.d.ts +34 -0
- package/build/backend/commands/inbounds/get-inbounds.command.d.ts.map +1 -0
- package/{commands/inbounds/index.ts → build/backend/commands/inbounds/index.d.ts} +1 -0
- package/build/backend/commands/inbounds/index.d.ts.map +1 -0
- package/{commands/index.ts → build/backend/commands/index.d.ts} +1 -0
- package/build/backend/commands/index.d.ts.map +1 -0
- package/build/backend/commands/keygen/get-pubkey.command.d.ts +24 -0
- package/build/backend/commands/keygen/get-pubkey.command.d.ts.map +1 -0
- package/{commands/keygen/index.ts → build/backend/commands/keygen/index.d.ts} +1 -0
- package/build/backend/commands/keygen/index.d.ts.map +1 -0
- package/build/backend/commands/nodes/create.command.d.ts +155 -0
- package/build/backend/commands/nodes/create.command.d.ts.map +1 -0
- package/build/backend/commands/nodes/delete.command.d.ts +32 -0
- package/build/backend/commands/nodes/delete.command.d.ts.map +1 -0
- package/build/backend/commands/nodes/disable.command.d.ts +137 -0
- package/build/backend/commands/nodes/disable.command.d.ts.map +1 -0
- package/build/backend/commands/nodes/enable.command.d.ts +137 -0
- package/build/backend/commands/nodes/enable.command.d.ts.map +1 -0
- package/build/backend/commands/nodes/get-all.command.d.ts +129 -0
- package/build/backend/commands/nodes/get-all.command.d.ts.map +1 -0
- package/build/backend/commands/nodes/get-one.command.d.ts +137 -0
- package/build/backend/commands/nodes/get-one.command.d.ts.map +1 -0
- package/{commands/nodes/index.ts → build/backend/commands/nodes/index.d.ts} +1 -0
- package/build/backend/commands/nodes/index.d.ts.map +1 -0
- package/build/backend/commands/nodes/restart-all.command.d.ts +24 -0
- package/build/backend/commands/nodes/restart-all.command.d.ts.map +1 -0
- package/build/backend/commands/nodes/restart.command.d.ts +32 -0
- package/build/backend/commands/nodes/restart.command.d.ts.map +1 -0
- package/build/backend/commands/nodes/update.command.d.ts +180 -0
- package/build/backend/commands/nodes/update.command.d.ts.map +1 -0
- package/build/backend/commands/subscription/get-subscription-by-short-uuid.command.d.ts +14 -0
- package/build/backend/commands/subscription/get-subscription-by-short-uuid.command.d.ts.map +1 -0
- package/build/backend/commands/subscription/get-subscription-info-by-short-uuid.command.d.ts +100 -0
- package/build/backend/commands/subscription/get-subscription-info-by-short-uuid.command.d.ts.map +1 -0
- package/{commands/subscription/index.ts → build/backend/commands/subscription/index.d.ts} +1 -0
- package/build/backend/commands/subscription/index.d.ts.map +1 -0
- package/build/backend/commands/system/get-bandwidth-stats.command.d.ts +192 -0
- package/build/backend/commands/system/get-bandwidth-stats.command.d.ts.map +1 -0
- package/build/backend/commands/system/get-nodes-statistics.d.ts +60 -0
- package/build/backend/commands/system/get-nodes-statistics.d.ts.map +1 -0
- package/build/backend/commands/system/get-stats.command.d.ts +150 -0
- package/build/backend/commands/system/get-stats.command.d.ts.map +1 -0
- package/{commands/system/index.ts → build/backend/commands/system/index.d.ts} +1 -0
- package/build/backend/commands/system/index.d.ts.map +1 -0
- package/build/backend/commands/users/create-user.command.d.ts +191 -0
- package/build/backend/commands/users/create-user.command.d.ts.map +1 -0
- package/build/{commands → backend/commands}/users/create-user.command.js +9 -0
- package/build/backend/commands/users/delete-user.command.d.ts +32 -0
- package/build/backend/commands/users/delete-user.command.d.ts.map +1 -0
- package/build/backend/commands/users/disable-user.command.ts.d.ts +155 -0
- package/build/backend/commands/users/disable-user.command.ts.d.ts.map +1 -0
- package/build/backend/commands/users/enable-user.command.d.ts +155 -0
- package/build/backend/commands/users/enable-user.command.d.ts.map +1 -0
- package/build/backend/commands/users/get-all-users-v2.command.d.ts +273 -0
- package/build/backend/commands/users/get-all-users-v2.command.d.ts.map +1 -0
- package/build/backend/commands/users/get-all-users.command.d.ts +247 -0
- package/build/backend/commands/users/get-all-users.command.d.ts.map +1 -0
- package/build/backend/commands/users/get-user-by-short-uuid.command.d.ts +155 -0
- package/build/backend/commands/users/get-user-by-short-uuid.command.d.ts.map +1 -0
- package/build/backend/commands/users/get-user-by-subscription-uuid.command.d.ts +155 -0
- package/build/backend/commands/users/get-user-by-subscription-uuid.command.d.ts.map +1 -0
- package/build/backend/commands/users/get-user-by-uuid.command.d.ts +155 -0
- package/build/backend/commands/users/get-user-by-uuid.command.d.ts.map +1 -0
- package/{commands/users/index.ts → build/backend/commands/users/index.d.ts} +1 -0
- package/build/backend/commands/users/index.d.ts.map +1 -0
- package/build/backend/commands/users/revoke-user-subscription.command.d.ts +155 -0
- package/build/backend/commands/users/revoke-user-subscription.command.d.ts.map +1 -0
- package/build/backend/commands/users/update-user.command.d.ts +202 -0
- package/build/backend/commands/users/update-user.command.d.ts.map +1 -0
- package/build/backend/commands/xray/get-config.command.d.ts +24 -0
- package/build/backend/commands/xray/get-config.command.d.ts.map +1 -0
- package/{commands/xray/index.ts → build/backend/commands/xray/index.d.ts} +1 -0
- package/build/backend/commands/xray/index.d.ts.map +1 -0
- package/build/backend/commands/xray/update-config.command.d.ts +26 -0
- package/build/backend/commands/xray/update-config.command.d.ts.map +1 -0
- package/build/backend/constants/errors/errors.d.ts +293 -0
- package/build/backend/constants/errors/errors.d.ts.map +1 -0
- package/build/backend/constants/errors/index.d.ts +2 -0
- package/build/backend/constants/errors/index.d.ts.map +1 -0
- package/build/backend/constants/events/events.d.ts +25 -0
- package/build/backend/constants/events/events.d.ts.map +1 -0
- package/build/backend/constants/events/index.d.ts +2 -0
- package/build/backend/constants/events/index.d.ts.map +1 -0
- package/build/backend/constants/hosts/alpn.d.ts +8 -0
- package/build/backend/constants/hosts/alpn.d.ts.map +1 -0
- package/build/backend/constants/hosts/fingerprints.d.ts +14 -0
- package/build/backend/constants/hosts/fingerprints.d.ts.map +1 -0
- package/{constants/hosts/index.ts → build/backend/constants/hosts/index.d.ts} +1 -0
- package/build/backend/constants/hosts/index.d.ts.map +1 -0
- package/{constants/index.ts → build/backend/constants/index.d.ts} +1 -0
- package/build/backend/constants/index.d.ts.map +1 -0
- package/build/backend/constants/nodes/cycle/cycle.d.ts +7 -0
- package/build/backend/constants/nodes/cycle/cycle.d.ts.map +1 -0
- package/build/backend/constants/nodes/cycle/index.d.ts +2 -0
- package/build/backend/constants/nodes/cycle/index.d.ts.map +1 -0
- package/{constants/nodes/index.ts → build/backend/constants/nodes/index.d.ts} +1 -0
- package/build/backend/constants/nodes/index.d.ts.map +1 -0
- package/{constants/nodes/status/index.ts → build/backend/constants/nodes/status/index.d.ts} +1 -0
- package/build/backend/constants/nodes/status/index.d.ts.map +1 -0
- package/build/backend/constants/nodes/status/status.constant.d.ts +8 -0
- package/build/backend/constants/nodes/status/status.constant.d.ts.map +1 -0
- package/build/backend/constants/roles/index.d.ts +2 -0
- package/build/backend/constants/roles/index.d.ts.map +1 -0
- package/build/backend/constants/roles/role.d.ts +7 -0
- package/build/backend/constants/roles/role.d.ts.map +1 -0
- package/{constants/templates/index.ts → build/backend/constants/templates/index.d.ts} +1 -0
- package/build/backend/constants/templates/index.d.ts.map +1 -0
- package/build/backend/constants/templates/template-keys.d.ts +3 -0
- package/build/backend/constants/templates/template-keys.d.ts.map +1 -0
- package/build/backend/constants/templates/user-statuses.d.ts +7 -0
- package/build/backend/constants/templates/user-statuses.d.ts.map +1 -0
- package/{constants/users/index.ts → build/backend/constants/users/index.d.ts} +1 -0
- package/build/backend/constants/users/index.d.ts.map +1 -0
- package/{constants/users/reset-periods/index.ts → build/backend/constants/users/reset-periods/index.d.ts} +1 -0
- package/build/backend/constants/users/reset-periods/index.d.ts.map +1 -0
- package/build/backend/constants/users/reset-periods/reset-periods.constant.d.ts +10 -0
- package/build/backend/constants/users/reset-periods/reset-periods.constant.d.ts.map +1 -0
- package/{constants/users/status/index.ts → build/backend/constants/users/status/index.d.ts} +1 -0
- package/build/backend/constants/users/status/index.d.ts.map +1 -0
- package/build/backend/constants/users/status/status.constant.d.ts +9 -0
- package/build/backend/constants/users/status/status.constant.d.ts.map +1 -0
- package/{index.ts → build/backend/index.d.ts} +1 -0
- package/build/backend/index.d.ts.map +1 -0
- package/build/backend/models/api-tokens.schema.d.ts +24 -0
- package/build/backend/models/api-tokens.schema.d.ts.map +1 -0
- package/build/backend/models/auth.schema.d.ts +9 -0
- package/build/backend/models/auth.schema.d.ts.map +1 -0
- package/build/backend/models/base-stat.schema.d.ts +15 -0
- package/build/backend/models/base-stat.schema.d.ts.map +1 -0
- package/build/backend/models/hosts.schema.d.ts +45 -0
- package/build/backend/models/hosts.schema.d.ts.map +1 -0
- package/build/backend/models/inbounds.schema.d.ts +15 -0
- package/build/backend/models/inbounds.schema.d.ts.map +1 -0
- package/{models/index.ts → build/backend/models/index.d.ts} +1 -0
- package/build/backend/models/index.d.ts.map +1 -0
- package/build/backend/models/nodes.schema.d.ts +72 -0
- package/build/backend/models/nodes.schema.d.ts.map +1 -0
- package/build/backend/models/users.schema.d.ts +86 -0
- package/build/backend/models/users.schema.d.ts.map +1 -0
- package/build/frontend/api/controllers/api-tokens.js +9 -0
- package/build/frontend/api/controllers/auth.js +7 -0
- package/build/frontend/api/controllers/hosts.js +12 -0
- package/build/frontend/api/controllers/inbounds.js +7 -0
- package/build/frontend/api/controllers/index.js +26 -0
- package/build/frontend/api/controllers/keygen.js +7 -0
- package/{api/controllers/nodes.ts → build/frontend/api/controllers/nodes.js} +6 -5
- package/build/frontend/api/controllers/subscription.js +8 -0
- package/build/frontend/api/controllers/system.js +11 -0
- package/{api/controllers/users.ts → build/frontend/api/controllers/users.js} +6 -4
- package/build/frontend/api/controllers/xray.js +8 -0
- package/build/frontend/api/index.js +18 -0
- package/build/frontend/api/routes.js +99 -0
- package/build/frontend/commands/api-tokens/create.command.js +20 -0
- package/build/frontend/commands/api-tokens/delete.command.js +16 -0
- package/build/frontend/commands/api-tokens/find.command.js +14 -0
- package/build/frontend/commands/api-tokens/index.js +19 -0
- package/build/frontend/commands/auth/index.js +17 -0
- package/build/frontend/commands/auth/login.command.js +19 -0
- package/build/frontend/commands/hosts/create.command.js +45 -0
- package/build/frontend/commands/hosts/delete.command.js +18 -0
- package/build/frontend/commands/hosts/get-all.command.js +14 -0
- package/build/frontend/commands/hosts/index.js +21 -0
- package/build/frontend/commands/hosts/reorder.command.js +22 -0
- package/build/frontend/commands/hosts/update.command.js +52 -0
- package/build/frontend/commands/inbounds/get-inbounds.command.js +14 -0
- package/build/frontend/commands/inbounds/index.js +17 -0
- package/build/frontend/commands/index.js +26 -0
- package/build/frontend/commands/keygen/get-pubkey.command.js +15 -0
- package/build/frontend/commands/keygen/index.js +17 -0
- package/build/frontend/commands/nodes/create.command.js +31 -0
- package/build/frontend/commands/nodes/delete.command.js +18 -0
- package/build/frontend/commands/nodes/disable.command.js +17 -0
- package/build/frontend/commands/nodes/enable.command.js +17 -0
- package/build/frontend/commands/nodes/get-all.command.js +14 -0
- package/build/frontend/commands/nodes/get-one.command.js +17 -0
- package/build/frontend/commands/nodes/index.js +25 -0
- package/build/frontend/commands/nodes/restart-all.command.js +15 -0
- package/build/frontend/commands/nodes/restart.command.js +18 -0
- package/build/frontend/commands/nodes/update.command.js +31 -0
- package/build/frontend/commands/subscription/get-subscription-by-short-uuid.command.js +13 -0
- package/build/frontend/commands/subscription/get-subscription-info-by-short-uuid.command.js +29 -0
- package/build/frontend/commands/subscription/index.js +18 -0
- package/build/frontend/commands/system/get-bandwidth-stats.command.js +23 -0
- package/build/frontend/commands/system/get-nodes-statistics.js +22 -0
- package/build/frontend/commands/system/get-stats.command.js +37 -0
- package/build/frontend/commands/system/index.js +19 -0
- package/build/frontend/commands/users/create-user.command.js +111 -0
- package/build/frontend/commands/users/delete-user.command.js +18 -0
- package/build/frontend/commands/users/disable-user.command.ts.js +17 -0
- package/build/frontend/commands/users/enable-user.command.js +17 -0
- package/build/frontend/commands/users/get-all-users-v2.command.js +42 -0
- package/build/frontend/commands/users/get-all-users.command.js +49 -0
- package/build/frontend/commands/users/get-user-by-short-uuid.command.js +17 -0
- package/build/frontend/commands/users/get-user-by-subscription-uuid.command.js +17 -0
- package/build/frontend/commands/users/get-user-by-uuid.command.js +17 -0
- package/build/frontend/commands/users/index.js +27 -0
- package/build/frontend/commands/users/revoke-user-subscription.command.js +17 -0
- package/build/frontend/commands/users/update-user.command.js +57 -0
- package/build/frontend/commands/xray/get-config.command.js +15 -0
- package/build/frontend/commands/xray/index.js +18 -0
- package/build/frontend/commands/xray/update-config.command.js +16 -0
- package/{constants/errors/errors.ts → build/frontend/constants/errors/errors.js} +7 -5
- package/build/frontend/constants/errors/index.js +17 -0
- package/{constants/events/events.ts → build/frontend/constants/events/events.js} +4 -1
- package/build/frontend/constants/events/index.js +17 -0
- package/build/frontend/constants/hosts/alpn.js +9 -0
- package/build/frontend/constants/hosts/fingerprints.js +15 -0
- package/build/frontend/constants/hosts/index.js +18 -0
- package/build/frontend/constants/index.js +23 -0
- package/build/frontend/constants/nodes/cycle/cycle.js +8 -0
- package/build/frontend/constants/nodes/cycle/index.js +17 -0
- package/build/frontend/constants/nodes/index.js +18 -0
- package/build/frontend/constants/nodes/status/index.js +17 -0
- package/build/frontend/constants/nodes/status/status.constant.js +9 -0
- package/build/frontend/constants/roles/index.js +17 -0
- package/build/frontend/constants/roles/role.js +7 -0
- package/build/frontend/constants/templates/index.js +18 -0
- package/build/frontend/constants/templates/template-keys.js +10 -0
- package/build/frontend/constants/templates/user-statuses.js +9 -0
- package/build/frontend/constants/users/index.js +18 -0
- package/build/frontend/constants/users/reset-periods/index.js +17 -0
- package/build/frontend/constants/users/reset-periods/reset-periods.constant.js +11 -0
- package/build/frontend/constants/users/status/index.js +17 -0
- package/build/frontend/constants/users/status/status.constant.js +10 -0
- package/build/frontend/index.js +20 -0
- package/build/frontend/models/api-tokens.schema.js +12 -0
- package/build/frontend/models/auth.schema.js +7 -0
- package/build/frontend/models/base-stat.schema.js +9 -0
- package/build/frontend/models/hosts.schema.js +19 -0
- package/build/frontend/models/inbounds.schema.js +9 -0
- package/build/frontend/models/index.js +23 -0
- package/build/frontend/models/nodes.schema.js +28 -0
- package/build/frontend/models/users.schema.js +34 -0
- package/package.json +13 -5
- package/api/controllers/api-tokens.ts +0 -7
- package/api/controllers/auth.ts +0 -5
- package/api/controllers/hosts.ts +0 -10
- package/api/controllers/inbounds.ts +0 -5
- package/api/controllers/keygen.ts +0 -5
- package/api/controllers/subscription.ts +0 -6
- package/api/controllers/system.ts +0 -9
- package/api/controllers/xray.ts +0 -6
- package/api/routes.ts +0 -81
- package/commands/api-tokens/create.command.ts +0 -23
- package/commands/api-tokens/delete.command.ts +0 -19
- package/commands/api-tokens/find.command.ts +0 -14
- package/commands/auth/index.ts +0 -1
- package/commands/auth/login.command.ts +0 -21
- package/commands/hosts/create.command.ts +0 -49
- package/commands/hosts/delete.command.ts +0 -21
- package/commands/hosts/get-all.command.ts +0 -14
- package/commands/hosts/reorder.command.ts +0 -26
- package/commands/hosts/update.command.ts +0 -56
- package/commands/inbounds/get-inbounds.command.ts +0 -14
- package/commands/keygen/get-pubkey.command.ts +0 -15
- package/commands/nodes/create.command.ts +0 -40
- package/commands/nodes/delete.command.ts +0 -21
- package/commands/nodes/disable.command.ts +0 -20
- package/commands/nodes/enable.command.ts +0 -20
- package/commands/nodes/get-all.command.ts +0 -14
- package/commands/nodes/get-one.command.ts +0 -20
- package/commands/nodes/restart-all.command.ts +0 -14
- package/commands/nodes/restart.command.ts +0 -21
- package/commands/nodes/update.command.ts +0 -38
- package/commands/subscription/get-subscription-by-short-uuid.command.ts +0 -13
- package/commands/subscription/get-subscription-info-by-short-uuid.command.ts +0 -32
- package/commands/system/get-bandwidth-stats.command.ts +0 -26
- package/commands/system/get-nodes-statistics.ts +0 -27
- package/commands/system/get-stats.command.ts +0 -43
- package/commands/users/create-user.command.ts +0 -108
- package/commands/users/delete-user.command.ts +0 -20
- package/commands/users/disable-user.command.ts.ts +0 -19
- package/commands/users/enable-user.command.ts +0 -20
- package/commands/users/get-all-users-v2.command.ts +0 -62
- package/commands/users/get-all-users.command.ts +0 -62
- package/commands/users/get-user-by-short-uuid.command.ts +0 -20
- package/commands/users/get-user-by-subscription-uuid.command.ts +0 -20
- package/commands/users/get-user-by-uuid.command.ts +0 -20
- package/commands/users/revoke-user-subscription.command.ts +0 -20
- package/commands/users/update-user.command.ts +0 -60
- package/commands/xray/get-config.command.ts +0 -14
- package/commands/xray/update-config.command.ts +0 -19
- package/constants/errors/index.ts +0 -1
- package/constants/events/index.ts +0 -1
- package/constants/hosts/alpn.ts +0 -8
- package/constants/hosts/fingerprints.ts +0 -14
- package/constants/nodes/cycle/cycle.ts +0 -7
- package/constants/nodes/cycle/index.ts +0 -1
- package/constants/nodes/status/status.constant.ts +0 -8
- package/constants/roles/index.ts +0 -1
- package/constants/roles/role.ts +0 -7
- package/constants/templates/template-keys.ts +0 -8
- package/constants/templates/user-statuses.ts +0 -6
- package/constants/users/reset-periods/reset-periods.constant.ts +0 -10
- package/constants/users/status/status.constant.ts +0 -9
- package/models/api-tokens.schema.ts +0 -11
- package/models/auth.schema.ts +0 -5
- package/models/base-stat.schema.ts +0 -7
- package/models/hosts.schema.ts +0 -17
- package/models/inbounds.schema.ts +0 -7
- package/models/nodes.schema.ts +0 -28
- package/models/users.schema.ts +0 -38
- package/tsconfig.json +0 -103
- /package/build/{api → backend/api}/controllers/api-tokens.js +0 -0
- /package/build/{api → backend/api}/controllers/auth.js +0 -0
- /package/build/{api → backend/api}/controllers/hosts.js +0 -0
- /package/build/{api → backend/api}/controllers/inbounds.js +0 -0
- /package/build/{api → backend/api}/controllers/index.js +0 -0
- /package/build/{api → backend/api}/controllers/keygen.js +0 -0
- /package/build/{api → backend/api}/controllers/nodes.js +0 -0
- /package/build/{api → backend/api}/controllers/subscription.js +0 -0
- /package/build/{api → backend/api}/controllers/system.js +0 -0
- /package/build/{api → backend/api}/controllers/users.js +0 -0
- /package/build/{api → backend/api}/controllers/xray.js +0 -0
- /package/build/{api → backend/api}/index.js +0 -0
- /package/build/{api → backend/api}/routes.js +0 -0
- /package/build/{commands → backend/commands}/api-tokens/create.command.js +0 -0
- /package/build/{commands → backend/commands}/api-tokens/delete.command.js +0 -0
- /package/build/{commands → backend/commands}/api-tokens/find.command.js +0 -0
- /package/build/{commands → backend/commands}/api-tokens/index.js +0 -0
- /package/build/{commands → backend/commands}/auth/index.js +0 -0
- /package/build/{commands → backend/commands}/auth/login.command.js +0 -0
- /package/build/{commands → backend/commands}/hosts/create.command.js +0 -0
- /package/build/{commands → backend/commands}/hosts/delete.command.js +0 -0
- /package/build/{commands → backend/commands}/hosts/get-all.command.js +0 -0
- /package/build/{commands → backend/commands}/hosts/index.js +0 -0
- /package/build/{commands → backend/commands}/hosts/reorder.command.js +0 -0
- /package/build/{commands → backend/commands}/hosts/update.command.js +0 -0
- /package/build/{commands → backend/commands}/inbounds/get-inbounds.command.js +0 -0
- /package/build/{commands → backend/commands}/inbounds/index.js +0 -0
- /package/build/{commands → backend/commands}/index.js +0 -0
- /package/build/{commands → backend/commands}/keygen/get-pubkey.command.js +0 -0
- /package/build/{commands → backend/commands}/keygen/index.js +0 -0
- /package/build/{commands → backend/commands}/nodes/create.command.js +0 -0
- /package/build/{commands → backend/commands}/nodes/delete.command.js +0 -0
- /package/build/{commands → backend/commands}/nodes/disable.command.js +0 -0
- /package/build/{commands → backend/commands}/nodes/enable.command.js +0 -0
- /package/build/{commands → backend/commands}/nodes/get-all.command.js +0 -0
- /package/build/{commands → backend/commands}/nodes/get-one.command.js +0 -0
- /package/build/{commands → backend/commands}/nodes/index.js +0 -0
- /package/build/{commands → backend/commands}/nodes/restart-all.command.js +0 -0
- /package/build/{commands → backend/commands}/nodes/restart.command.js +0 -0
- /package/build/{commands → backend/commands}/nodes/update.command.js +0 -0
- /package/build/{commands → backend/commands}/subscription/get-subscription-by-short-uuid.command.js +0 -0
- /package/build/{commands → backend/commands}/subscription/get-subscription-info-by-short-uuid.command.js +0 -0
- /package/build/{commands → backend/commands}/subscription/index.js +0 -0
- /package/build/{commands → backend/commands}/system/get-bandwidth-stats.command.js +0 -0
- /package/build/{commands → backend/commands}/system/get-nodes-statistics.js +0 -0
- /package/build/{commands → backend/commands}/system/get-stats.command.js +0 -0
- /package/build/{commands → backend/commands}/system/index.js +0 -0
- /package/build/{commands → backend/commands}/users/delete-user.command.js +0 -0
- /package/build/{commands → backend/commands}/users/disable-user.command.ts.js +0 -0
- /package/build/{commands → backend/commands}/users/enable-user.command.js +0 -0
- /package/build/{commands → backend/commands}/users/get-all-users-v2.command.js +0 -0
- /package/build/{commands → backend/commands}/users/get-all-users.command.js +0 -0
- /package/build/{commands → backend/commands}/users/get-user-by-short-uuid.command.js +0 -0
- /package/build/{commands → backend/commands}/users/get-user-by-subscription-uuid.command.js +0 -0
- /package/build/{commands → backend/commands}/users/get-user-by-uuid.command.js +0 -0
- /package/build/{commands → backend/commands}/users/index.js +0 -0
- /package/build/{commands → backend/commands}/users/revoke-user-subscription.command.js +0 -0
- /package/build/{commands → backend/commands}/users/update-user.command.js +0 -0
- /package/build/{commands → backend/commands}/xray/get-config.command.js +0 -0
- /package/build/{commands → backend/commands}/xray/index.js +0 -0
- /package/build/{commands → backend/commands}/xray/update-config.command.js +0 -0
- /package/build/{constants → backend/constants}/errors/errors.js +0 -0
- /package/build/{constants → backend/constants}/errors/index.js +0 -0
- /package/build/{constants → backend/constants}/events/events.js +0 -0
- /package/build/{constants → backend/constants}/events/index.js +0 -0
- /package/build/{constants → backend/constants}/hosts/alpn.js +0 -0
- /package/build/{constants → backend/constants}/hosts/fingerprints.js +0 -0
- /package/build/{constants → backend/constants}/hosts/index.js +0 -0
- /package/build/{constants → backend/constants}/index.js +0 -0
- /package/build/{constants → backend/constants}/nodes/cycle/cycle.js +0 -0
- /package/build/{constants → backend/constants}/nodes/cycle/index.js +0 -0
- /package/build/{constants → backend/constants}/nodes/index.js +0 -0
- /package/build/{constants → backend/constants}/nodes/status/index.js +0 -0
- /package/build/{constants → backend/constants}/nodes/status/status.constant.js +0 -0
- /package/build/{constants → backend/constants}/roles/index.js +0 -0
- /package/build/{constants → backend/constants}/roles/role.js +0 -0
- /package/build/{constants → backend/constants}/templates/index.js +0 -0
- /package/build/{constants → backend/constants}/templates/template-keys.js +0 -0
- /package/build/{constants → backend/constants}/templates/user-statuses.js +0 -0
- /package/build/{constants → backend/constants}/users/index.js +0 -0
- /package/build/{constants → backend/constants}/users/reset-periods/index.js +0 -0
- /package/build/{constants → backend/constants}/users/reset-periods/reset-periods.constant.js +0 -0
- /package/build/{constants → backend/constants}/users/status/index.js +0 -0
- /package/build/{constants → backend/constants}/users/status/status.constant.js +0 -0
- /package/build/{index.js → backend/index.js} +0 -0
- /package/build/{models → backend/models}/api-tokens.schema.js +0 -0
- /package/build/{models → backend/models}/auth.schema.js +0 -0
- /package/build/{models → backend/models}/base-stat.schema.js +0 -0
- /package/build/{models → backend/models}/hosts.schema.js +0 -0
- /package/build/{models → backend/models}/inbounds.schema.js +0 -0
- /package/build/{models → backend/models}/index.js +0 -0
- /package/build/{models → backend/models}/nodes.schema.js +0 -0
- /package/build/{models → backend/models}/users.schema.js +0 -0
@@ -0,0 +1,34 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.UsersSchema = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const constants_1 = require("../constants");
|
6
|
+
const inbounds_schema_1 = require("./inbounds.schema");
|
7
|
+
exports.UsersSchema = zod_1.z.object({
|
8
|
+
uuid: zod_1.z.string().uuid(),
|
9
|
+
subscriptionUuid: zod_1.z.string().uuid(),
|
10
|
+
shortUuid: zod_1.z.string(),
|
11
|
+
username: zod_1.z.string(),
|
12
|
+
status: zod_1.z
|
13
|
+
.enum([constants_1.USERS_STATUS_VALUES[0], ...constants_1.USERS_STATUS_VALUES])
|
14
|
+
.default(constants_1.USERS_STATUS_VALUES[0]),
|
15
|
+
usedTrafficBytes: zod_1.z.number().int().default(0),
|
16
|
+
trafficLimitBytes: zod_1.z.number().int().default(0),
|
17
|
+
trafficLimitStrategy: zod_1.z
|
18
|
+
.enum([constants_1.RESET_PERIODS_VALUES[0], ...constants_1.RESET_PERIODS_VALUES], {
|
19
|
+
description: 'Available reset periods',
|
20
|
+
})
|
21
|
+
.default(constants_1.RESET_PERIODS_VALUES[0]),
|
22
|
+
subLastUserAgent: zod_1.z.nullable(zod_1.z.string()),
|
23
|
+
subLastOpenedAt: zod_1.z.nullable(zod_1.z.string().transform((str) => new Date(str))),
|
24
|
+
expireAt: zod_1.z.nullable(zod_1.z.string().transform((str) => new Date(str))),
|
25
|
+
onlineAt: zod_1.z.nullable(zod_1.z.string().transform((str) => new Date(str))),
|
26
|
+
subRevokedAt: zod_1.z.nullable(zod_1.z.string().transform((str) => new Date(str))),
|
27
|
+
lastTrafficResetAt: zod_1.z.nullable(zod_1.z.string().transform((str) => new Date(str))),
|
28
|
+
trojanPassword: zod_1.z.string(),
|
29
|
+
vlessUuid: zod_1.z.string().uuid(),
|
30
|
+
ssPassword: zod_1.z.string(),
|
31
|
+
createdAt: zod_1.z.string().transform((str) => new Date(str)),
|
32
|
+
updatedAt: zod_1.z.string().transform((str) => new Date(str)),
|
33
|
+
activeUserInbounds: zod_1.z.array(inbounds_schema_1.InboundsSchema),
|
34
|
+
});
|
package/package.json
CHANGED
@@ -1,14 +1,22 @@
|
|
1
1
|
{
|
2
2
|
"name": "@remnawave/backend-contract",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.60",
|
4
4
|
"description": "A contract library for Remnawave",
|
5
|
-
"main": "index.js",
|
5
|
+
"main": "build/backend/index.js",
|
6
|
+
"browser": "build/frontend/index.js",
|
7
|
+
"types": "build/backend/index.d.ts",
|
8
|
+
"files": [
|
9
|
+
"build/**/*"
|
10
|
+
],
|
6
11
|
"scripts": {
|
7
|
-
"
|
8
|
-
"build": "tsc"
|
12
|
+
"clean": "rm -rf build",
|
13
|
+
"build:backend": "tsc -p tsconfig.backend.json",
|
14
|
+
"build:frontend": "tsc -p tsconfig.frontend.json",
|
15
|
+
"build": "npm run clean && npm run build:backend && npm run build:frontend",
|
16
|
+
"prepublish": "npm run build"
|
9
17
|
},
|
10
18
|
"keywords": [],
|
11
|
-
"author": "",
|
19
|
+
"author": "REMNAWAVE",
|
12
20
|
"license": "ISC",
|
13
21
|
"dependencies": {
|
14
22
|
"zod": "^3.22.4"
|
package/api/controllers/auth.ts
DELETED
package/api/controllers/hosts.ts
DELETED
package/api/controllers/xray.ts
DELETED
package/api/routes.ts
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
import * as CONTROLLERS from './controllers';
|
2
|
-
|
3
|
-
export const ROOT = '/api' as const;
|
4
|
-
|
5
|
-
export const REST_API = {
|
6
|
-
AUTH: {
|
7
|
-
LOGIN: `${ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.LOGIN}`,
|
8
|
-
},
|
9
|
-
API_TOKENS: {
|
10
|
-
CREATE: `${ROOT}/${CONTROLLERS.API_TOKENS_CONTROLLER}/${CONTROLLERS.API_TOKENS_ROUTES.CREATE}`,
|
11
|
-
DELETE: (uuid: string) =>
|
12
|
-
`${ROOT}/${CONTROLLERS.API_TOKENS_CONTROLLER}/${CONTROLLERS.API_TOKENS_ROUTES.DELETE}/${uuid}`,
|
13
|
-
GET_ALL: `${ROOT}/${CONTROLLERS.API_TOKENS_CONTROLLER}/${CONTROLLERS.API_TOKENS_ROUTES.GET_ALL}`,
|
14
|
-
},
|
15
|
-
KEYGEN: {
|
16
|
-
GET: `${ROOT}/${CONTROLLERS.KEYGEN_CONTROLLER}/${CONTROLLERS.KEYGEN_ROUTES.GET}`,
|
17
|
-
},
|
18
|
-
NODES: {
|
19
|
-
CREATE: `${ROOT}/${CONTROLLERS.NODES_CONTROLLER}/${CONTROLLERS.NODES_ROUTES.CREATE}`,
|
20
|
-
DELETE: (uuid: string) =>
|
21
|
-
`${ROOT}/${CONTROLLERS.NODES_CONTROLLER}/${CONTROLLERS.NODES_ROUTES.DELETE}/${uuid}`,
|
22
|
-
UPDATE: `${ROOT}/${CONTROLLERS.NODES_CONTROLLER}/${CONTROLLERS.NODES_ROUTES.UPDATE}`,
|
23
|
-
GET_ALL: `${ROOT}/${CONTROLLERS.NODES_CONTROLLER}/${CONTROLLERS.NODES_ROUTES.GET_ALL}`,
|
24
|
-
RESTART: (uuid: string) =>
|
25
|
-
`${ROOT}/${CONTROLLERS.NODES_CONTROLLER}/${CONTROLLERS.NODES_ROUTES.RESTART}/${uuid}`,
|
26
|
-
GET_ONE: (uuid: string) =>
|
27
|
-
`${ROOT}/${CONTROLLERS.NODES_CONTROLLER}/${CONTROLLERS.NODES_ROUTES.GET_ONE}/${uuid}`,
|
28
|
-
DISABLE: (uuid: string) =>
|
29
|
-
`${ROOT}/${CONTROLLERS.NODES_CONTROLLER}/${CONTROLLERS.NODES_ROUTES.DISABLE}/${uuid}`,
|
30
|
-
ENABLE: (uuid: string) =>
|
31
|
-
`${ROOT}/${CONTROLLERS.NODES_CONTROLLER}/${CONTROLLERS.NODES_ROUTES.ENABLE}/${uuid}`,
|
32
|
-
RESTART_ALL: `${ROOT}/${CONTROLLERS.NODES_CONTROLLER}/${CONTROLLERS.NODES_ROUTES.RESTART_ALL}`,
|
33
|
-
},
|
34
|
-
XRAY: {
|
35
|
-
GET_CONFIG: `${ROOT}/${CONTROLLERS.XRAY_CONTROLLER}/${CONTROLLERS.XRAY_ROUTES.GET_CONFIG}`,
|
36
|
-
UPDATE_CONFIG: `${ROOT}/${CONTROLLERS.XRAY_CONTROLLER}/${CONTROLLERS.XRAY_ROUTES.UPDATE_CONFIG}`,
|
37
|
-
},
|
38
|
-
INBOUNDS: {
|
39
|
-
GET_INBOUNDS: `${ROOT}/${CONTROLLERS.INBOUNDS_CONTROLLER}/${CONTROLLERS.INBOUNDS_ROUTES.GET_INBOUNDS}`,
|
40
|
-
},
|
41
|
-
USERS: {
|
42
|
-
CREATE: `${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.CREATE}`,
|
43
|
-
GET_BY_UUID: (uuid: string) =>
|
44
|
-
`${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_UUID}/${uuid}`,
|
45
|
-
GET_BY_SHORT_UUID: (shortUuid: string) =>
|
46
|
-
`${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_SHORT_UUID}/${shortUuid}`,
|
47
|
-
GET_BY_SUBSCRIPTION_UUID: (subscriptionUuid: string) =>
|
48
|
-
`${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_SUBSCRIPTION_UUID}/${subscriptionUuid}`,
|
49
|
-
GET_ALL: `${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_ALL}`,
|
50
|
-
REVOKE_SUBSCRIPTION: (uuid: string) =>
|
51
|
-
`${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.REVOKE_SUBSCRIPTION}/${uuid}`,
|
52
|
-
DISABLE_USER: (uuid: string) =>
|
53
|
-
`${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.DISABLE_USER}/${uuid}`,
|
54
|
-
ENABLE_USER: (uuid: string) =>
|
55
|
-
`${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ENABLE_USER}/${uuid}`,
|
56
|
-
DELETE_USER: (uuid: string) =>
|
57
|
-
`${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.DELETE_USER}/${uuid}`,
|
58
|
-
UPDATE: `${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.UPDATE}`,
|
59
|
-
GET_ALL_V2: `${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_ALL_V2}`,
|
60
|
-
},
|
61
|
-
SUBSCRIPTION: {
|
62
|
-
GET: (shortUuid: string) =>
|
63
|
-
`${ROOT}/${CONTROLLERS.SUBSCRIPTION_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.GET}/${shortUuid}`,
|
64
|
-
GET_INFO: (shortUuid: string) =>
|
65
|
-
`${ROOT}/${CONTROLLERS.SUBSCRIPTION_CONTROLLER}/${shortUuid}${CONTROLLERS.SUBSCRIPTION_ROUTES.GET_INFO}`,
|
66
|
-
},
|
67
|
-
HOSTS: {
|
68
|
-
CREATE: `${ROOT}/${CONTROLLERS.HOSTS_CONTROLLER}/${CONTROLLERS.HOSTS_ROUTES.CREATE}`,
|
69
|
-
GET_ALL: `${ROOT}/${CONTROLLERS.HOSTS_CONTROLLER}/${CONTROLLERS.HOSTS_ROUTES.GET_ALL}`,
|
70
|
-
UPDATE: `${ROOT}/${CONTROLLERS.HOSTS_CONTROLLER}/${CONTROLLERS.HOSTS_ROUTES.UPDATE}`,
|
71
|
-
UPDATE_MANY: `${ROOT}/${CONTROLLERS.HOSTS_CONTROLLER}/${CONTROLLERS.HOSTS_ROUTES.UPDATE_MANY}`,
|
72
|
-
REORDER: `${ROOT}/${CONTROLLERS.HOSTS_CONTROLLER}/${CONTROLLERS.HOSTS_ROUTES.REORDER}`,
|
73
|
-
DELETE: (uuid: string) =>
|
74
|
-
`${ROOT}/${CONTROLLERS.HOSTS_CONTROLLER}/${CONTROLLERS.HOSTS_ROUTES.DELETE}/${uuid}`,
|
75
|
-
},
|
76
|
-
SYSTEM: {
|
77
|
-
STATS: `${ROOT}/${CONTROLLERS.SYSTEM_CONTROLLER}/${CONTROLLERS.SYSTEM_ROUTES.STATS}`,
|
78
|
-
BANDWIDTH: `${ROOT}/${CONTROLLERS.SYSTEM_CONTROLLER}/${CONTROLLERS.SYSTEM_ROUTES.BANDWIDTH}`,
|
79
|
-
NODES_STATISTIC: `${ROOT}/${CONTROLLERS.SYSTEM_CONTROLLER}/${CONTROLLERS.SYSTEM_ROUTES.STATISTIC.NODES}`,
|
80
|
-
},
|
81
|
-
} as const;
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { REST_API } from '../../api';
|
3
|
-
|
4
|
-
export namespace CreateApiTokenCommand {
|
5
|
-
export const url = REST_API.API_TOKENS.CREATE;
|
6
|
-
export const TSQ_url = url;
|
7
|
-
|
8
|
-
export const RequestSchema = z.object({
|
9
|
-
tokenName: z.string(),
|
10
|
-
tokenDescription: z.string().nullable(),
|
11
|
-
});
|
12
|
-
|
13
|
-
export type Request = z.infer<typeof RequestSchema>;
|
14
|
-
|
15
|
-
export const ResponseSchema = z.object({
|
16
|
-
response: z.object({
|
17
|
-
token: z.string(),
|
18
|
-
uuid: z.string(),
|
19
|
-
}),
|
20
|
-
});
|
21
|
-
|
22
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
23
|
-
}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { REST_API } from '../../api';
|
3
|
-
|
4
|
-
export namespace DeleteApiTokenCommand {
|
5
|
-
export const url = REST_API.API_TOKENS.DELETE;
|
6
|
-
export const TSQ_url = url(':uuid');
|
7
|
-
|
8
|
-
export const RequestSchema = z.object({
|
9
|
-
uuid: z.string().uuid(),
|
10
|
-
});
|
11
|
-
|
12
|
-
export type Request = z.infer<typeof RequestSchema>;
|
13
|
-
|
14
|
-
export const ResponseSchema = z.object({
|
15
|
-
response: z.boolean(),
|
16
|
-
});
|
17
|
-
|
18
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
19
|
-
}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { REST_API } from '../../api';
|
3
|
-
import { ApiTokensSchema } from '../../models/api-tokens.schema';
|
4
|
-
|
5
|
-
export namespace FindAllApiTokensCommand {
|
6
|
-
export const url = REST_API.API_TOKENS.GET_ALL;
|
7
|
-
export const TSQ_url = url;
|
8
|
-
|
9
|
-
export const ResponseSchema = z.object({
|
10
|
-
response: z.array(ApiTokensSchema),
|
11
|
-
});
|
12
|
-
|
13
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
14
|
-
}
|
package/commands/auth/index.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './login.command';
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { REST_API } from '../../api';
|
3
|
-
export namespace LoginCommand {
|
4
|
-
export const url = REST_API.AUTH.LOGIN;
|
5
|
-
export const TSQ_url = url;
|
6
|
-
|
7
|
-
export const RequestSchema = z.object({
|
8
|
-
username: z.string(),
|
9
|
-
password: z.string(),
|
10
|
-
});
|
11
|
-
|
12
|
-
export type Request = z.infer<typeof RequestSchema>;
|
13
|
-
|
14
|
-
export const ResponseSchema = z.object({
|
15
|
-
response: z.object({
|
16
|
-
accessToken: z.string(),
|
17
|
-
}),
|
18
|
-
});
|
19
|
-
|
20
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
21
|
-
}
|
@@ -1,49 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { REST_API } from '../../api';
|
3
|
-
import { ALPN_VALUES } from '../../constants/hosts/alpn';
|
4
|
-
import { FINGERPRINTS_VALUES } from '../../constants/hosts/fingerprints';
|
5
|
-
import { HostsSchema } from '../../models';
|
6
|
-
|
7
|
-
export namespace CreateHostCommand {
|
8
|
-
export const url = REST_API.HOSTS.CREATE;
|
9
|
-
export const TSQ_url = url;
|
10
|
-
|
11
|
-
export const RequestSchema = z.object({
|
12
|
-
inboundUuid: z
|
13
|
-
.string({
|
14
|
-
invalid_type_error: 'Inbound UUID must be a string',
|
15
|
-
})
|
16
|
-
.uuid('Inbound UUID must be a valid UUID'),
|
17
|
-
remark: z
|
18
|
-
.string({
|
19
|
-
invalid_type_error: 'Remark must be a string',
|
20
|
-
})
|
21
|
-
.max(40, {
|
22
|
-
message: 'Remark must be less than 40 characters',
|
23
|
-
}),
|
24
|
-
address: z.string({
|
25
|
-
invalid_type_error: 'Address must be a string',
|
26
|
-
}),
|
27
|
-
port: z
|
28
|
-
.number({
|
29
|
-
invalid_type_error: 'Port must be an integer',
|
30
|
-
})
|
31
|
-
.int(),
|
32
|
-
path: z.string().optional(),
|
33
|
-
sni: z.string().optional(),
|
34
|
-
host: z.string().optional(),
|
35
|
-
alpn: z.optional(z.enum([ALPN_VALUES[0], ...ALPN_VALUES]).nullable()),
|
36
|
-
fingerprint: z.optional(
|
37
|
-
z.enum([FINGERPRINTS_VALUES[0], ...FINGERPRINTS_VALUES]).nullable(),
|
38
|
-
),
|
39
|
-
allowInsecure: z.optional(z.boolean().default(false)),
|
40
|
-
isDisabled: z.optional(z.boolean().default(false)),
|
41
|
-
});
|
42
|
-
export type Request = z.infer<typeof RequestSchema>;
|
43
|
-
|
44
|
-
export const ResponseSchema = z.object({
|
45
|
-
response: HostsSchema,
|
46
|
-
});
|
47
|
-
|
48
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
49
|
-
}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { REST_API } from '../../api';
|
3
|
-
|
4
|
-
export namespace DeleteHostCommand {
|
5
|
-
export const url = REST_API.HOSTS.DELETE;
|
6
|
-
export const TSQ_url = url(':uuid');
|
7
|
-
|
8
|
-
export const RequestSchema = z.object({
|
9
|
-
uuid: z.string().uuid(),
|
10
|
-
});
|
11
|
-
|
12
|
-
export type Request = z.infer<typeof RequestSchema>;
|
13
|
-
|
14
|
-
export const ResponseSchema = z.object({
|
15
|
-
response: z.object({
|
16
|
-
isDeleted: z.boolean(),
|
17
|
-
}),
|
18
|
-
});
|
19
|
-
|
20
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
21
|
-
}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { REST_API } from '../../api';
|
3
|
-
import { HostsSchema } from '../../models';
|
4
|
-
|
5
|
-
export namespace GetAllHostsCommand {
|
6
|
-
export const url = REST_API.HOSTS.GET_ALL;
|
7
|
-
export const TSQ_url = url;
|
8
|
-
|
9
|
-
export const ResponseSchema = z.object({
|
10
|
-
response: z.array(HostsSchema),
|
11
|
-
});
|
12
|
-
|
13
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
14
|
-
}
|
@@ -1,26 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { REST_API } from '../../api';
|
3
|
-
import { HostsSchema } from '../../models';
|
4
|
-
|
5
|
-
export namespace ReorderHostCommand {
|
6
|
-
export const url = REST_API.HOSTS.REORDER;
|
7
|
-
export const TSQ_url = url;
|
8
|
-
|
9
|
-
export const RequestSchema = z.object({
|
10
|
-
hosts: z.array(
|
11
|
-
HostsSchema.pick({
|
12
|
-
viewPosition: true,
|
13
|
-
uuid: true,
|
14
|
-
}),
|
15
|
-
),
|
16
|
-
});
|
17
|
-
export type Request = z.infer<typeof RequestSchema>;
|
18
|
-
|
19
|
-
export const ResponseSchema = z.object({
|
20
|
-
response: z.object({
|
21
|
-
isUpdated: z.boolean(),
|
22
|
-
}),
|
23
|
-
});
|
24
|
-
|
25
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
26
|
-
}
|
@@ -1,56 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { REST_API } from '../../api';
|
3
|
-
import { ALPN_VALUES } from '../../constants/hosts/alpn';
|
4
|
-
import { FINGERPRINTS_VALUES } from '../../constants/hosts/fingerprints';
|
5
|
-
import { HostsSchema } from '../../models';
|
6
|
-
|
7
|
-
export namespace UpdateHostCommand {
|
8
|
-
export const url = REST_API.HOSTS.UPDATE;
|
9
|
-
export const TSQ_url = url;
|
10
|
-
|
11
|
-
export const RequestSchema = HostsSchema.pick({
|
12
|
-
uuid: true,
|
13
|
-
}).extend({
|
14
|
-
inboundUuid: z
|
15
|
-
.string({
|
16
|
-
invalid_type_error: 'Inbound UUID must be a string',
|
17
|
-
})
|
18
|
-
.uuid('Inbound UUID must be a valid UUID')
|
19
|
-
.optional(),
|
20
|
-
remark: z
|
21
|
-
.string({
|
22
|
-
invalid_type_error: 'Remark must be a string',
|
23
|
-
})
|
24
|
-
.max(40, {
|
25
|
-
message: 'Remark must be less than 40 characters',
|
26
|
-
})
|
27
|
-
.optional(),
|
28
|
-
address: z
|
29
|
-
.string({
|
30
|
-
invalid_type_error: 'Address must be a string',
|
31
|
-
})
|
32
|
-
.optional(),
|
33
|
-
port: z
|
34
|
-
.number({
|
35
|
-
invalid_type_error: 'Port must be an integer',
|
36
|
-
})
|
37
|
-
.int()
|
38
|
-
.optional(),
|
39
|
-
path: z.optional(z.string()),
|
40
|
-
sni: z.optional(z.string()),
|
41
|
-
host: z.optional(z.string()),
|
42
|
-
alpn: z.optional(z.enum([ALPN_VALUES[0], ...ALPN_VALUES]).nullable()),
|
43
|
-
fingerprint: z.optional(
|
44
|
-
z.enum([FINGERPRINTS_VALUES[0], ...FINGERPRINTS_VALUES]).nullable(),
|
45
|
-
),
|
46
|
-
allowInsecure: z.optional(z.boolean()),
|
47
|
-
isDisabled: z.optional(z.boolean()),
|
48
|
-
});
|
49
|
-
export type Request = z.infer<typeof RequestSchema>;
|
50
|
-
|
51
|
-
export const ResponseSchema = z.object({
|
52
|
-
response: HostsSchema,
|
53
|
-
});
|
54
|
-
|
55
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
56
|
-
}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { REST_API } from '../../api';
|
3
|
-
import { InboundsSchema } from '../../models/inbounds.schema';
|
4
|
-
|
5
|
-
export namespace GetInboundsCommand {
|
6
|
-
export const url = REST_API.INBOUNDS.GET_INBOUNDS;
|
7
|
-
export const TSQ_url = url;
|
8
|
-
|
9
|
-
export const ResponseSchema = z.object({
|
10
|
-
response: z.array(InboundsSchema),
|
11
|
-
});
|
12
|
-
|
13
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
14
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { REST_API } from '../../api';
|
3
|
-
|
4
|
-
export namespace GetPubKeyCommand {
|
5
|
-
export const url = REST_API.KEYGEN.GET;
|
6
|
-
export const TSQ_url = url;
|
7
|
-
|
8
|
-
export const ResponseSchema = z.object({
|
9
|
-
response: z.object({
|
10
|
-
pubKey: z.string(),
|
11
|
-
}),
|
12
|
-
});
|
13
|
-
|
14
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
15
|
-
}
|
@@ -1,40 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { REST_API } from '../../api';
|
3
|
-
import { NodesSchema } from '../../models';
|
4
|
-
|
5
|
-
export namespace CreateNodeCommand {
|
6
|
-
export const url = REST_API.NODES.CREATE;
|
7
|
-
export const TSQ_url = url;
|
8
|
-
|
9
|
-
export const RequestSchema = z.object({
|
10
|
-
name: z.string().min(5, 'Name is required'),
|
11
|
-
address: z.string().min(2, 'Address is required'),
|
12
|
-
port: z.number().int().min(1, 'Port is required').optional(),
|
13
|
-
isTrafficTrackingActive: z.boolean().optional().default(false),
|
14
|
-
trafficLimitBytes: z.optional(
|
15
|
-
z.number().int().min(0, 'Traffic limit must be greater than 0'),
|
16
|
-
),
|
17
|
-
notifyPercent: z.optional(
|
18
|
-
z
|
19
|
-
.number()
|
20
|
-
.int()
|
21
|
-
.min(0, 'Notify percent must be greater than 0')
|
22
|
-
.max(100, 'Notify percent must be less than 100'),
|
23
|
-
),
|
24
|
-
trafficResetDay: z.optional(
|
25
|
-
z
|
26
|
-
.number()
|
27
|
-
.int()
|
28
|
-
.min(1, 'Traffic reset day must be greater than 0')
|
29
|
-
.max(31, 'Traffic reset day must be less than 31'),
|
30
|
-
),
|
31
|
-
});
|
32
|
-
|
33
|
-
export type Request = z.infer<typeof RequestSchema>;
|
34
|
-
|
35
|
-
export const ResponseSchema = z.object({
|
36
|
-
response: NodesSchema,
|
37
|
-
});
|
38
|
-
|
39
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
40
|
-
}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { REST_API } from '../../api';
|
3
|
-
|
4
|
-
export namespace DeleteNodeCommand {
|
5
|
-
export const url = REST_API.NODES.DELETE;
|
6
|
-
export const TSQ_url = url(':uuid');
|
7
|
-
|
8
|
-
export const RequestSchema = z.object({
|
9
|
-
uuid: z.string().uuid(),
|
10
|
-
});
|
11
|
-
|
12
|
-
export type Request = z.infer<typeof RequestSchema>;
|
13
|
-
|
14
|
-
export const ResponseSchema = z.object({
|
15
|
-
response: z.object({
|
16
|
-
isDeleted: z.boolean(),
|
17
|
-
}),
|
18
|
-
});
|
19
|
-
|
20
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
21
|
-
}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { REST_API } from '../../api';
|
3
|
-
import { NodesSchema } from '../../models';
|
4
|
-
|
5
|
-
export namespace DisableNodeCommand {
|
6
|
-
export const url = REST_API.NODES.DISABLE;
|
7
|
-
export const TSQ_url = url(':uuid');
|
8
|
-
|
9
|
-
export const RequestSchema = z.object({
|
10
|
-
uuid: z.string().uuid(),
|
11
|
-
});
|
12
|
-
|
13
|
-
export type Request = z.infer<typeof RequestSchema>;
|
14
|
-
|
15
|
-
export const ResponseSchema = z.object({
|
16
|
-
response: NodesSchema,
|
17
|
-
});
|
18
|
-
|
19
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
20
|
-
}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { REST_API } from '../../api';
|
3
|
-
import { NodesSchema } from '../../models';
|
4
|
-
|
5
|
-
export namespace EnableNodeCommand {
|
6
|
-
export const url = REST_API.NODES.ENABLE;
|
7
|
-
export const TSQ_url = url(':uuid');
|
8
|
-
|
9
|
-
export const RequestSchema = z.object({
|
10
|
-
uuid: z.string().uuid(),
|
11
|
-
});
|
12
|
-
|
13
|
-
export type Request = z.infer<typeof RequestSchema>;
|
14
|
-
|
15
|
-
export const ResponseSchema = z.object({
|
16
|
-
response: NodesSchema,
|
17
|
-
});
|
18
|
-
|
19
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
20
|
-
}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { REST_API } from '../../api';
|
3
|
-
import { NodesSchema } from '../../models';
|
4
|
-
|
5
|
-
export namespace GetAllNodesCommand {
|
6
|
-
export const url = REST_API.NODES.GET_ALL;
|
7
|
-
export const TSQ_url = url;
|
8
|
-
|
9
|
-
export const ResponseSchema = z.object({
|
10
|
-
response: z.array(NodesSchema),
|
11
|
-
});
|
12
|
-
|
13
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
14
|
-
}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { REST_API } from '../../api';
|
3
|
-
import { NodesSchema } from '../../models';
|
4
|
-
|
5
|
-
export namespace GetOneNodeCommand {
|
6
|
-
export const url = REST_API.NODES.GET_ONE;
|
7
|
-
export const TSQ_url = url(':uuid');
|
8
|
-
|
9
|
-
export const RequestSchema = z.object({
|
10
|
-
uuid: z.string().uuid(),
|
11
|
-
});
|
12
|
-
|
13
|
-
export type Request = z.infer<typeof RequestSchema>;
|
14
|
-
|
15
|
-
export const ResponseSchema = z.object({
|
16
|
-
response: NodesSchema,
|
17
|
-
});
|
18
|
-
|
19
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
20
|
-
}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { REST_API } from '../../api';
|
3
|
-
export namespace RestartAllNodesCommand {
|
4
|
-
export const url = REST_API.NODES.RESTART_ALL;
|
5
|
-
export const TSQ_url = url;
|
6
|
-
|
7
|
-
export const ResponseSchema = z.object({
|
8
|
-
response: z.object({
|
9
|
-
eventSent: z.boolean(),
|
10
|
-
}),
|
11
|
-
});
|
12
|
-
|
13
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
14
|
-
}
|