Skip to content

Commit 30e8fcd

Browse files
release: 7.1.0 (#113)
* codegen metadata * codegen metadata * feat: NPM enabled * codegen metadata * codegen metadata * feat: Test * feat: JWT scope updates * codegen metadata * release: 7.1.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent a19e300 commit 30e8fcd

9 files changed

Lines changed: 118 additions & 20 deletions

File tree

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "7.0.1"
2+
".": "7.1.0"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 77
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-33d5d7c18097451b2abe61ea5a694efd6fbff5dca21e62ffd59ea37ec0bd569b.yml
3-
openapi_spec_hash: 5da629173a97d334c5b2253d0a6e22b3
4-
config_hash: 1dfe9dc0d55d828e116bd0f89061c3c5
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-ef9e41c6e60cc3c2a745acf0f0b6130555b4f88fd8b092eb11c84418b2e16481.yml
3+
openapi_spec_hash: f9a7f141a9bbae15c1e240ed6a3a3601
4+
config_hash: 3ec521d062b05b81c22bc1a25bfe3d02

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## 7.1.0 (2025-11-18)
4+
5+
Full Changelog: [v7.0.1...v7.1.0](https://github.com/trycourier/courier-python/compare/v7.0.1...v7.1.0)
6+
7+
### Features
8+
9+
* JWT scope updates ([79503e5](https://github.com/trycourier/courier-python/commit/79503e5c99993a0a81fdc8da9eb8553c541cf6af))
10+
* NPM enabled ([a93573b](https://github.com/trycourier/courier-python/commit/a93573b77947d06113262e73b48c7aaba74e1832))
11+
* Test ([cdeccac](https://github.com/trycourier/courier-python/commit/cdeccac6ac1d08ba5864b8e1a9b05b4ae5ae983f))
12+
313
## 7.0.1 (2025-11-12)
414

515
Full Changelog: [v7.0.0...v7.0.1](https://github.com/trycourier/courier-python/compare/v7.0.0...v7.0.1)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "trycourier"
3-
version = "7.0.1"
3+
version = "7.1.0"
44
description = "The official Python library for the Courier API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/courier/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "courier"
4-
__version__ = "7.0.1" # x-release-please-version
4+
__version__ = "7.1.0" # x-release-please-version

src/courier/resources/auth.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,36 @@ def issue_token(
5757
Returns a new access token.
5858
5959
Args:
60+
expires_in:
61+
Duration for token expiration. Accepts various time formats:
62+
63+
- "2 hours" - 2 hours from now
64+
- "1d" - 1 day
65+
- "3 days" - 3 days
66+
- "10h" - 10 hours
67+
- "2.5 hrs" - 2.5 hours
68+
- "1m" - 1 minute
69+
- "5s" - 5 seconds
70+
- "1y" - 1 year
71+
72+
scope:
73+
Available scopes:
74+
75+
- `user_id:<user-id>` - Defines which user the token will be scoped to. Multiple
76+
can be listed if needed. Ex `user_id:pigeon user_id:bluebird`.
77+
- `read:messages` - Read messages.
78+
- `read:user-tokens` - Read user push tokens.
79+
- `write:user-tokens` - Write user push tokens.
80+
- `read:brands[:<brand_id>]` - Read brands, optionally restricted to a specific
81+
brand_id. Examples `read:brands`, `read:brands:my_brand`.
82+
- `write:brands[:<brand_id>]` - Write brands, optionally restricted to a
83+
specific brand_id. Examples `write:brands`, `write:brands:my_brand`.
84+
- `inbox:read:messages` - Read inbox messages.
85+
- `inbox:write:events` - Write inbox events, such as mark message as read.
86+
- `read:preferences` - Read user preferences.
87+
- `write:preferences` - Write user preferences. Example:
88+
`user_id:user123 write:user-tokens inbox:read:messages inbox:write:events read:preferences write:preferences read:brands`
89+
6090
extra_headers: Send extra headers
6191
6292
extra_query: Add additional query parameters to the request
@@ -117,6 +147,36 @@ async def issue_token(
117147
Returns a new access token.
118148
119149
Args:
150+
expires_in:
151+
Duration for token expiration. Accepts various time formats:
152+
153+
- "2 hours" - 2 hours from now
154+
- "1d" - 1 day
155+
- "3 days" - 3 days
156+
- "10h" - 10 hours
157+
- "2.5 hrs" - 2.5 hours
158+
- "1m" - 1 minute
159+
- "5s" - 5 seconds
160+
- "1y" - 1 year
161+
162+
scope:
163+
Available scopes:
164+
165+
- `user_id:<user-id>` - Defines which user the token will be scoped to. Multiple
166+
can be listed if needed. Ex `user_id:pigeon user_id:bluebird`.
167+
- `read:messages` - Read messages.
168+
- `read:user-tokens` - Read user push tokens.
169+
- `write:user-tokens` - Write user push tokens.
170+
- `read:brands[:<brand_id>]` - Read brands, optionally restricted to a specific
171+
brand_id. Examples `read:brands`, `read:brands:my_brand`.
172+
- `write:brands[:<brand_id>]` - Write brands, optionally restricted to a
173+
specific brand_id. Examples `write:brands`, `write:brands:my_brand`.
174+
- `inbox:read:messages` - Read inbox messages.
175+
- `inbox:write:events` - Write inbox events, such as mark message as read.
176+
- `read:preferences` - Read user preferences.
177+
- `write:preferences` - Write user preferences. Example:
178+
`user_id:user123 write:user-tokens inbox:read:messages inbox:write:events read:preferences write:preferences read:brands`
179+
120180
extra_headers: Send extra headers
121181
122182
extra_query: Add additional query parameters to the request

src/courier/resources/send.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def message(
5353
timeout: float | httpx.Timeout | None | NotGiven = not_given,
5454
) -> SendMessageResponse:
5555
"""
56-
API to send a message to one or more recipients.
56+
Send a message to one or more recipients.
5757
5858
Args:
5959
message: The message property has the following primary top-level properties. They define
@@ -109,7 +109,7 @@ async def message(
109109
timeout: float | httpx.Timeout | None | NotGiven = not_given,
110110
) -> SendMessageResponse:
111111
"""
112-
API to send a message to one or more recipients.
112+
Send a message to one or more recipients.
113113
114114
Args:
115115
message: The message property has the following primary top-level properties. They define

src/courier/types/auth_issue_token_params.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,33 @@
99

1010
class AuthIssueTokenParams(TypedDict, total=False):
1111
expires_in: Required[str]
12+
"""Duration for token expiration. Accepts various time formats:
13+
14+
- "2 hours" - 2 hours from now
15+
- "1d" - 1 day
16+
- "3 days" - 3 days
17+
- "10h" - 10 hours
18+
- "2.5 hrs" - 2.5 hours
19+
- "1m" - 1 minute
20+
- "5s" - 5 seconds
21+
- "1y" - 1 year
22+
"""
1223

1324
scope: Required[str]
25+
"""Available scopes:
26+
27+
- `user_id:<user-id>` - Defines which user the token will be scoped to. Multiple
28+
can be listed if needed. Ex `user_id:pigeon user_id:bluebird`.
29+
- `read:messages` - Read messages.
30+
- `read:user-tokens` - Read user push tokens.
31+
- `write:user-tokens` - Write user push tokens.
32+
- `read:brands[:<brand_id>]` - Read brands, optionally restricted to a specific
33+
brand_id. Examples `read:brands`, `read:brands:my_brand`.
34+
- `write:brands[:<brand_id>]` - Write brands, optionally restricted to a
35+
specific brand_id. Examples `write:brands`, `write:brands:my_brand`.
36+
- `inbox:read:messages` - Read inbox messages.
37+
- `inbox:write:events` - Write inbox events, such as mark message as read.
38+
- `read:preferences` - Read user preferences.
39+
- `write:preferences` - Write user preferences. Example:
40+
`user_id:user123 write:user-tokens inbox:read:messages inbox:write:events read:preferences write:preferences read:brands`
41+
"""

tests/api_resources/test_auth.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ class TestAuth:
2121
@parametrize
2222
def test_method_issue_token(self, client: Courier) -> None:
2323
auth = client.auth.issue_token(
24-
expires_in="expires_in",
25-
scope="scope",
24+
expires_in="$YOUR_NUMBER days",
25+
scope="user_id:$YOUR_USER_ID write:user-tokens inbox:read:messages inbox:write:events read:preferences write:preferences read:brands",
2626
)
2727
assert_matches_type(AuthIssueTokenResponse, auth, path=["response"])
2828

2929
@pytest.mark.skip(reason="Prism tests are disabled")
3030
@parametrize
3131
def test_raw_response_issue_token(self, client: Courier) -> None:
3232
response = client.auth.with_raw_response.issue_token(
33-
expires_in="expires_in",
34-
scope="scope",
33+
expires_in="$YOUR_NUMBER days",
34+
scope="user_id:$YOUR_USER_ID write:user-tokens inbox:read:messages inbox:write:events read:preferences write:preferences read:brands",
3535
)
3636

3737
assert response.is_closed is True
@@ -43,8 +43,8 @@ def test_raw_response_issue_token(self, client: Courier) -> None:
4343
@parametrize
4444
def test_streaming_response_issue_token(self, client: Courier) -> None:
4545
with client.auth.with_streaming_response.issue_token(
46-
expires_in="expires_in",
47-
scope="scope",
46+
expires_in="$YOUR_NUMBER days",
47+
scope="user_id:$YOUR_USER_ID write:user-tokens inbox:read:messages inbox:write:events read:preferences write:preferences read:brands",
4848
) as response:
4949
assert not response.is_closed
5050
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -64,17 +64,17 @@ class TestAsyncAuth:
6464
@parametrize
6565
async def test_method_issue_token(self, async_client: AsyncCourier) -> None:
6666
auth = await async_client.auth.issue_token(
67-
expires_in="expires_in",
68-
scope="scope",
67+
expires_in="$YOUR_NUMBER days",
68+
scope="user_id:$YOUR_USER_ID write:user-tokens inbox:read:messages inbox:write:events read:preferences write:preferences read:brands",
6969
)
7070
assert_matches_type(AuthIssueTokenResponse, auth, path=["response"])
7171

7272
@pytest.mark.skip(reason="Prism tests are disabled")
7373
@parametrize
7474
async def test_raw_response_issue_token(self, async_client: AsyncCourier) -> None:
7575
response = await async_client.auth.with_raw_response.issue_token(
76-
expires_in="expires_in",
77-
scope="scope",
76+
expires_in="$YOUR_NUMBER days",
77+
scope="user_id:$YOUR_USER_ID write:user-tokens inbox:read:messages inbox:write:events read:preferences write:preferences read:brands",
7878
)
7979

8080
assert response.is_closed is True
@@ -86,8 +86,8 @@ async def test_raw_response_issue_token(self, async_client: AsyncCourier) -> Non
8686
@parametrize
8787
async def test_streaming_response_issue_token(self, async_client: AsyncCourier) -> None:
8888
async with async_client.auth.with_streaming_response.issue_token(
89-
expires_in="expires_in",
90-
scope="scope",
89+
expires_in="$YOUR_NUMBER days",
90+
scope="user_id:$YOUR_USER_ID write:user-tokens inbox:read:messages inbox:write:events read:preferences write:preferences read:brands",
9191
) as response:
9292
assert not response.is_closed
9393
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

0 commit comments

Comments
 (0)