diff --git a/pyproject.toml b/pyproject.toml index 2dcc934..deca420 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "pipedream" [tool.poetry] name = "pipedream" -version = "0.3.3" +version = "0.3.4" description = "" readme = "README.md" authors = [] diff --git a/reference.md b/reference.md index d898404..f77e860 100644 --- a/reference.md +++ b/reference.md @@ -3314,7 +3314,6 @@ client = Pipedream( ) client.tokens.create( external_user_id="external_user_id", - project_id="project_id", ) ``` @@ -3339,14 +3338,6 @@ client.tokens.create(
-**project_id:** `str` — The ID of the project - -
-
- -
-
- **allowed_origins:** `typing.Optional[typing.Sequence[str]]` — List of allowed origins for CORS
diff --git a/src/pipedream/client.py b/src/pipedream/client.py index 24d3539..05f4186 100644 --- a/src/pipedream/client.py +++ b/src/pipedream/client.py @@ -4,7 +4,7 @@ import typing import httpx -from .types.project_environment import ProjectEnvironment +from ._.types.project_environment import ProjectEnvironment from .accounts.client import AccountsClient, AsyncAccountsClient from .actions.client import ActionsClient, AsyncActionsClient from .app_categories.client import AppCategoriesClient, AsyncAppCategoriesClient diff --git a/src/pipedream/core/client_wrapper.py b/src/pipedream/core/client_wrapper.py index 9aa7f23..36ea9e3 100644 --- a/src/pipedream/core/client_wrapper.py +++ b/src/pipedream/core/client_wrapper.py @@ -3,7 +3,7 @@ import typing import httpx -from ..types.project_environment import ProjectEnvironment +from .._.types.project_environment import ProjectEnvironment from .http_client import AsyncHttpClient, HttpClient @@ -27,10 +27,10 @@ def __init__( def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { - "User-Agent": "pipedream/0.3.3", + "User-Agent": "pipedream/0.3.4", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "pipedream", - "X-Fern-SDK-Version": "0.3.3", + "X-Fern-SDK-Version": "0.3.4", **(self.get_custom_headers() or {}), } if self._project_environment is not None: diff --git a/src/pipedream/tokens/client.py b/src/pipedream/tokens/client.py index f29691c..c13ff6c 100644 --- a/src/pipedream/tokens/client.py +++ b/src/pipedream/tokens/client.py @@ -32,7 +32,6 @@ def create( self, *, external_user_id: str, - project_id: str, allowed_origins: typing.Optional[typing.Sequence[str]] = OMIT, error_redirect_uri: typing.Optional[str] = OMIT, success_redirect_uri: typing.Optional[str] = OMIT, @@ -45,9 +44,6 @@ def create( external_user_id : str Your end user ID, for whom you're creating the token - project_id : str - The ID of the project - allowed_origins : typing.Optional[typing.Sequence[str]] List of allowed origins for CORS @@ -80,12 +76,10 @@ def create( ) client.tokens.create( external_user_id="external_user_id", - project_id="project_id", ) """ _response = self._raw_client.create( external_user_id=external_user_id, - project_id=project_id, allowed_origins=allowed_origins, error_redirect_uri=error_redirect_uri, success_redirect_uri=success_redirect_uri, @@ -153,7 +147,6 @@ async def create( self, *, external_user_id: str, - project_id: str, allowed_origins: typing.Optional[typing.Sequence[str]] = OMIT, error_redirect_uri: typing.Optional[str] = OMIT, success_redirect_uri: typing.Optional[str] = OMIT, @@ -166,9 +159,6 @@ async def create( external_user_id : str Your end user ID, for whom you're creating the token - project_id : str - The ID of the project - allowed_origins : typing.Optional[typing.Sequence[str]] List of allowed origins for CORS @@ -206,7 +196,6 @@ async def create( async def main() -> None: await client.tokens.create( external_user_id="external_user_id", - project_id="project_id", ) @@ -214,7 +203,6 @@ async def main() -> None: """ _response = await self._raw_client.create( external_user_id=external_user_id, - project_id=project_id, allowed_origins=allowed_origins, error_redirect_uri=error_redirect_uri, success_redirect_uri=success_redirect_uri, diff --git a/src/pipedream/tokens/raw_client.py b/src/pipedream/tokens/raw_client.py index 747b454..0d85a22 100644 --- a/src/pipedream/tokens/raw_client.py +++ b/src/pipedream/tokens/raw_client.py @@ -26,7 +26,6 @@ def create( self, *, external_user_id: str, - project_id: str, allowed_origins: typing.Optional[typing.Sequence[str]] = OMIT, error_redirect_uri: typing.Optional[str] = OMIT, success_redirect_uri: typing.Optional[str] = OMIT, @@ -39,9 +38,6 @@ def create( external_user_id : str Your end user ID, for whom you're creating the token - project_id : str - The ID of the project - allowed_origins : typing.Optional[typing.Sequence[str]] List of allowed origins for CORS @@ -63,13 +59,12 @@ def create( connect token created """ _response = self._client_wrapper.httpx_client.request( - "v1/connect/tokens", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/tokens", method="POST", json={ "allowed_origins": allowed_origins, "error_redirect_uri": error_redirect_uri, "external_user_id": external_user_id, - "project_id": project_id, "success_redirect_uri": success_redirect_uri, "webhook_uri": webhook_uri, }, @@ -117,7 +112,7 @@ def validate( connect token validated """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/tokens/{jsonable_encoder(ctok)}/validate", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/tokens/{jsonable_encoder(ctok)}/validate", method="GET", params={ "params": convert_and_respect_annotation_metadata( @@ -150,7 +145,6 @@ async def create( self, *, external_user_id: str, - project_id: str, allowed_origins: typing.Optional[typing.Sequence[str]] = OMIT, error_redirect_uri: typing.Optional[str] = OMIT, success_redirect_uri: typing.Optional[str] = OMIT, @@ -163,9 +157,6 @@ async def create( external_user_id : str Your end user ID, for whom you're creating the token - project_id : str - The ID of the project - allowed_origins : typing.Optional[typing.Sequence[str]] List of allowed origins for CORS @@ -187,13 +178,12 @@ async def create( connect token created """ _response = await self._client_wrapper.httpx_client.request( - "v1/connect/tokens", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/tokens", method="POST", json={ "allowed_origins": allowed_origins, "error_redirect_uri": error_redirect_uri, "external_user_id": external_user_id, - "project_id": project_id, "success_redirect_uri": success_redirect_uri, "webhook_uri": webhook_uri, }, @@ -241,7 +231,7 @@ async def validate( connect token validated """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/tokens/{jsonable_encoder(ctok)}/validate", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/tokens/{jsonable_encoder(ctok)}/validate", method="GET", params={ "params": convert_and_respect_annotation_metadata( diff --git a/src/pipedream/types/connect_token_create_opts.py b/src/pipedream/types/connect_token_create_opts.py index dc16143..2940955 100644 --- a/src/pipedream/types/connect_token_create_opts.py +++ b/src/pipedream/types/connect_token_create_opts.py @@ -16,11 +16,6 @@ class ConnectTokenCreateOpts(UniversalBaseModel): Your end user ID, for whom you're creating the token """ - project_id: str = pydantic.Field() - """ - The ID of the project - """ - allowed_origins: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of allowed origins for CORS