mirror of
https://github.com/remnawave/python-sdk.git
synced 2026-05-13 12:16:42 +00:00
feat: обновить версию SDK до 2.6.3 и добавить поддержку новых типов подписок
This commit is contained in:
parent
7300b57fff
commit
2b1223e79d
7 changed files with 59 additions and 4 deletions
|
|
@ -50,6 +50,7 @@ pip install git+https://github.com/remnawave/python-sdk.git@development
|
|||
|
||||
| Contract Version | Remnawave Panel Version |
|
||||
| ---------------- | ----------------------- |
|
||||
| 2.6.3 | >=2.6.3 |
|
||||
| 2.6.2 | >=2.6.2 |
|
||||
| 2.6.1 | >=2.6.0 |
|
||||
| 2.4.4 | >=2.4.0 |
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
[project]
|
||||
name = "remnawave"
|
||||
version = "2.6.2"
|
||||
description = "A Python SDK for interacting with the Remnawave API v2.6.2."
|
||||
version = "2.6.3"
|
||||
description = "A Python SDK for interacting with the Remnawave API v2.6.3."
|
||||
authors = [
|
||||
{name = "Artem",email = "dev@forestsnet.com"}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ from .subscriptions_settings import (
|
|||
ResponseRuleOperator,
|
||||
ResponseRuleVersion,
|
||||
ResponseType,
|
||||
SubscriptionType,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
|
|
@ -30,6 +31,7 @@ __all__ = [
|
|||
"ResponseRuleOperator",
|
||||
"ResponseRuleVersion",
|
||||
"ResponseType",
|
||||
"SubscriptionType",
|
||||
# Webhook enums
|
||||
"TNodeEvents",
|
||||
"TUserEvents",
|
||||
|
|
|
|||
|
|
@ -37,4 +37,14 @@ class ResponseType(StrEnum):
|
|||
|
||||
class ResponseRuleVersion(StrEnum):
|
||||
"""Response rules config version"""
|
||||
V1 = "1"
|
||||
V1 = "1"
|
||||
|
||||
|
||||
class SubscriptionType(StrEnum):
|
||||
"""Subscription output types (used e.g. to exclude hosts from specific types)"""
|
||||
XRAY_JSON = "XRAY_JSON"
|
||||
XRAY_BASE64 = "XRAY_BASE64"
|
||||
MIHOMO = "MIHOMO"
|
||||
STASH = "STASH"
|
||||
CLASH = "CLASH"
|
||||
SINGBOX = "SINGBOX"
|
||||
|
|
@ -234,6 +234,7 @@ from .subscriptions_settings import (
|
|||
ResponseRuleCondition,
|
||||
ResponseRules,
|
||||
SubscriptionSettingsResponseDto,
|
||||
SubscriptionType,
|
||||
UpdateSubscriptionSettingsRequestDto,
|
||||
UpdateSubscriptionSettingsResponseDto,
|
||||
CustomRemarksDto,
|
||||
|
|
@ -579,6 +580,7 @@ __all__ = [
|
|||
"GetSubscriptionSettingsResponseDto",
|
||||
"SubscriptionSettingsResponseDto",
|
||||
"UpdateSubscriptionSettingsRequestDto",
|
||||
"SubscriptionType",
|
||||
"CustomRemarksDto",
|
||||
"HwidSettingsDto",
|
||||
# Backward compatibility aliases
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from uuid import UUID
|
|||
|
||||
from pydantic import BaseModel, Field, StringConstraints, RootModel
|
||||
|
||||
from remnawave.enums import ALPN, Fingerprint, SecurityLayer
|
||||
from remnawave.enums import ALPN, Fingerprint, SecurityLayer, SubscriptionType
|
||||
|
||||
|
||||
class ReorderHostItem(BaseModel):
|
||||
|
|
@ -53,6 +53,11 @@ class UpdateHostRequestDto(BaseModel):
|
|||
nodes: Optional[List[UUID]] = None
|
||||
xray_json_template_uuid: Optional[UUID] = Field(None, serialization_alias="xrayJsonTemplateUuid")
|
||||
excluded_internal_squads: Optional[List[UUID]] = Field(None, serialization_alias="excludedInternalSquads")
|
||||
exclude_from_subscription_types: Optional[List[SubscriptionType]] = Field(
|
||||
None,
|
||||
serialization_alias="excludeFromSubscriptionTypes",
|
||||
description="Subscription types from which this host will be excluded.",
|
||||
)
|
||||
|
||||
@property
|
||||
def inbound_uuid(self) -> Optional[UUID]:
|
||||
|
|
@ -88,6 +93,11 @@ class HostResponseDto(BaseModel):
|
|||
allow_insecure: bool = Field(False, alias="allowInsecure")
|
||||
xray_json_template_uuid: UUID | None = Field(alias="xrayJsonTemplateUuid")
|
||||
excluded_internal_squads: List[UUID] = Field(default_factory=list, alias="excludedInternalSquads")
|
||||
exclude_from_subscription_types: List[SubscriptionType] = Field(
|
||||
default_factory=list,
|
||||
alias="excludeFromSubscriptionTypes",
|
||||
description="Subscription types from which this host is excluded.",
|
||||
)
|
||||
|
||||
@property
|
||||
def inbound_uuid(self) -> Optional[UUID]:
|
||||
|
|
@ -121,6 +131,11 @@ class CreateHostRequestDto(BaseModel):
|
|||
keep_blank_sni: bool = Field(False, serialization_alias="keepBlankSni")
|
||||
xray_json_template_uuid: Optional[UUID] = Field(None, serialization_alias="xrayJsonTemplateUuid")
|
||||
excluded_internal_squads: List[UUID] = Field(default_factory=list, serialization_alias="excludedInternalSquads")
|
||||
exclude_from_subscription_types: List[SubscriptionType] = Field(
|
||||
default_factory=list,
|
||||
serialization_alias="excludeFromSubscriptionTypes",
|
||||
description="Subscription types from which this host will be excluded.",
|
||||
)
|
||||
|
||||
@property
|
||||
def inbound_uuid(self) -> Optional[UUID]:
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from remnawave.enums import (
|
|||
ResponseRuleOperator,
|
||||
ResponseRuleVersion,
|
||||
ResponseType,
|
||||
SubscriptionType,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -31,9 +32,33 @@ class ResponseModificationHeader(BaseModel):
|
|||
class ResponseModifications(BaseModel):
|
||||
"""Response modifications to apply when rule matches"""
|
||||
headers: Optional[List[ResponseModificationHeader]] = None
|
||||
apply_headers_to_end: Optional[bool] = Field(
|
||||
None,
|
||||
alias="applyHeadersToEnd",
|
||||
description=(
|
||||
"If True, SRR headers are appended at the very end of the response "
|
||||
"and may override headers from other sections."
|
||||
),
|
||||
)
|
||||
subscription_template: Optional[Annotated[str, StringConstraints(min_length=1)]] = Field(
|
||||
None, alias="subscriptionTemplate"
|
||||
)
|
||||
ignore_host_xray_json_template: Optional[bool] = Field(
|
||||
None,
|
||||
alias="ignoreHostXrayJsonTemplate",
|
||||
description=(
|
||||
"If True, the Host's own Xray Json Template is ignored and the "
|
||||
"template defined by the SRR rule is used instead."
|
||||
),
|
||||
)
|
||||
ignore_serve_json_at_base_subscription: Optional[bool] = Field(
|
||||
None,
|
||||
alias="ignoreServeJsonAtBaseSubscription",
|
||||
description=(
|
||||
"If True, the Serve JSON at Base Subscription setting is ignored "
|
||||
"(treated as False)."
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
class ResponseRule(BaseModel):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue