From 2b1223e79db02630e7abeca38a178e1875274127 Mon Sep 17 00:00:00 2001 From: Artem Date: Wed, 25 Feb 2026 03:26:57 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B2=D0=B5=D1=80=D1=81=D0=B8=D1=8E=20SDK=20?= =?UTF-8?q?=D0=B4=D0=BE=202.6.3=20=D0=B8=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D1=82=D1=8C=20=D0=BF=D0=BE=D0=B4=D0=B4=D0=B5=D1=80=D0=B6?= =?UTF-8?q?=D0=BA=D1=83=20=D0=BD=D0=BE=D0=B2=D1=8B=D1=85=20=D1=82=D0=B8?= =?UTF-8?q?=D0=BF=D0=BE=D0=B2=20=D0=BF=D0=BE=D0=B4=D0=BF=D0=B8=D1=81=D0=BE?= =?UTF-8?q?=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + pyproject.toml | 4 ++-- remnawave/enums/__init__.py | 2 ++ remnawave/enums/subscriptions_settings.py | 12 ++++++++++- remnawave/models/__init__.py | 2 ++ remnawave/models/hosts.py | 17 ++++++++++++++- remnawave/models/subscriptions_settings.py | 25 ++++++++++++++++++++++ 7 files changed, 59 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9e03729..d8f4976 100644 --- a/README.md +++ b/README.md @@ -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 | diff --git a/pyproject.toml b/pyproject.toml index 5ff7373..50e5e12 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"} ] diff --git a/remnawave/enums/__init__.py b/remnawave/enums/__init__.py index 835d0a3..bb01abb 100644 --- a/remnawave/enums/__init__.py +++ b/remnawave/enums/__init__.py @@ -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", diff --git a/remnawave/enums/subscriptions_settings.py b/remnawave/enums/subscriptions_settings.py index b26ffc5..18ce8f2 100644 --- a/remnawave/enums/subscriptions_settings.py +++ b/remnawave/enums/subscriptions_settings.py @@ -37,4 +37,14 @@ class ResponseType(StrEnum): class ResponseRuleVersion(StrEnum): """Response rules config version""" - V1 = "1" \ No newline at end of file + 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" \ No newline at end of file diff --git a/remnawave/models/__init__.py b/remnawave/models/__init__.py index 1e18b1f..fad19a3 100644 --- a/remnawave/models/__init__.py +++ b/remnawave/models/__init__.py @@ -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 diff --git a/remnawave/models/hosts.py b/remnawave/models/hosts.py index 3795fef..d123445 100644 --- a/remnawave/models/hosts.py +++ b/remnawave/models/hosts.py @@ -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]: diff --git a/remnawave/models/subscriptions_settings.py b/remnawave/models/subscriptions_settings.py index bc4f584..8da5bea 100644 --- a/remnawave/models/subscriptions_settings.py +++ b/remnawave/models/subscriptions_settings.py @@ -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):