growsurf-python 1.1.1__py3-none-any.whl → 1.1.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
growsurf/_client.py CHANGED
@@ -115,6 +115,7 @@ class Growsurf(SyncAPIClient):
115
115
  custom_query=default_query,
116
116
  _strict_response_validation=_strict_response_validation,
117
117
  )
118
+ self._idempotency_header = "Idempotency-Key"
118
119
 
119
120
  @cached_property
120
121
  def account(self) -> AccountResource:
@@ -311,6 +312,7 @@ class AsyncGrowsurf(AsyncAPIClient):
311
312
  custom_query=default_query,
312
313
  _strict_response_validation=_strict_response_validation,
313
314
  )
315
+ self._idempotency_header = "Idempotency-Key"
314
316
 
315
317
  @cached_property
316
318
  def account(self) -> AsyncAccountResource:
growsurf/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "growsurf"
4
- __version__ = "1.1.1" # x-release-please-version
4
+ __version__ = "1.1.2" # x-release-please-version
@@ -65,9 +65,10 @@ class AccountResource(SyncAPIResource):
65
65
  an API key, so you can call it on a client constructed with any placeholder
66
66
  `api_key`.
67
67
 
68
- The response includes an API key for the new account, but the key is locked
69
- until the account's email address is verified: authenticated endpoints outside
70
- the Accounts group return a `403` with error code `EMAIL_NOT_VERIFIED_ERROR`
68
+ The response includes an API key for the new account, shown once in the
69
+ response. The key is locked until the account's email address is verified:
70
+ authenticated endpoints outside the Accounts group return a `403` with error
71
+ code `EMAIL_NOT_VERIFIED_ERROR`
71
72
  until then (resend the email via the resend-verification-email endpoint, then
72
73
  retry). A welcome email is sent to the address with the verification link and a
73
74
  set-password link for dashboard access. Accounts whose email is never verified
@@ -183,11 +184,13 @@ class AccountResource(SyncAPIResource):
183
184
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
184
185
  ) -> RotateApiKeyResponse:
185
186
  """
186
- Generates a new API key and immediately revokes the old one.
187
+ Generates a new API key and invalidates the key used for the request.
187
188
 
188
- The key used to make this request stops working as soon as the response is
189
- returned — update every integration that used the old key with the new one. The
190
- account owner is notified by email whenever the key is rotated.
189
+ The SDK sends a retry-safe `Idempotency-Key`, so automatic retries return the
190
+ same replacement. Store the returned key, then update every integration that
191
+ used the old key. The account owner is notified by email whenever the key is
192
+ rotated. Requires an API key with `api_key:rotate`. This operation is available
193
+ only through the REST API or a GrowSurf API SDK, not through MCP.
191
194
  """
192
195
  return self._post(
193
196
  "/account/api-key",
@@ -288,9 +291,10 @@ class AsyncAccountResource(AsyncAPIResource):
288
291
  an API key, so you can call it on a client constructed with any placeholder
289
292
  `api_key`.
290
293
 
291
- The response includes an API key for the new account, but the key is locked
292
- until the account's email address is verified: authenticated endpoints outside
293
- the Accounts group return a `403` with error code `EMAIL_NOT_VERIFIED_ERROR`
294
+ The response includes an API key for the new account, shown once in the
295
+ response. The key is locked until the account's email address is verified:
296
+ authenticated endpoints outside the Accounts group return a `403` with error
297
+ code `EMAIL_NOT_VERIFIED_ERROR`
294
298
  until then (resend the email via the resend-verification-email endpoint, then
295
299
  retry). A welcome email is sent to the address with the verification link and a
296
300
  set-password link for dashboard access. Accounts whose email is never verified
@@ -406,11 +410,13 @@ class AsyncAccountResource(AsyncAPIResource):
406
410
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
407
411
  ) -> RotateApiKeyResponse:
408
412
  """
409
- Generates a new API key and immediately revokes the old one.
413
+ Generates a new API key and invalidates the key used for the request.
410
414
 
411
- The key used to make this request stops working as soon as the response is
412
- returned — update every integration that used the old key with the new one. The
413
- account owner is notified by email whenever the key is rotated.
415
+ The SDK sends a retry-safe `Idempotency-Key`, so automatic retries return the
416
+ same replacement. Store the returned key, then update every integration that
417
+ used the old key. The account owner is notified by email whenever the key is
418
+ rotated. Requires an API key with `api_key:rotate`. This operation is available
419
+ only through the REST API or a GrowSurf API SDK, not through MCP.
414
420
  """
415
421
  return await self._post(
416
422
  "/account/api-key",
@@ -96,7 +96,8 @@ class RewardResource(SyncAPIResource):
96
96
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
97
97
  ) -> RewardApproveResponse:
98
98
  """
99
- Approves a manually approved reward earned by a participant.
99
+ Approves a manually approved reward earned by a participant. Requires
100
+ `reward:write`. Passing `fulfill=True` also requires `reward:fulfill`.
100
101
 
101
102
  Args:
102
103
  fulfill: Set true to mark the reward as fulfilled after approval.
@@ -135,7 +136,7 @@ class RewardResource(SyncAPIResource):
135
136
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
136
137
  ) -> RewardFulfillResponse:
137
138
  """
138
- Marks an approved participant reward as fulfilled.
139
+ Marks an approved participant reward as fulfilled. Requires `reward:fulfill`.
139
140
 
140
141
  Args:
141
142
  extra_headers: Send extra headers
@@ -232,7 +233,8 @@ class AsyncRewardResource(AsyncAPIResource):
232
233
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
233
234
  ) -> RewardApproveResponse:
234
235
  """
235
- Approves a manually approved reward earned by a participant.
236
+ Approves a manually approved reward earned by a participant. Requires
237
+ `reward:write`. Passing `fulfill=True` also requires `reward:fulfill`.
236
238
 
237
239
  Args:
238
240
  fulfill: Set true to mark the reward as fulfilled after approval.
@@ -271,7 +273,7 @@ class AsyncRewardResource(AsyncAPIResource):
271
273
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
272
274
  ) -> RewardFulfillResponse:
273
275
  """
274
- Marks an approved participant reward as fulfilled.
276
+ Marks an approved participant reward as fulfilled. Requires `reward:fulfill`.
275
277
 
276
278
  Args:
277
279
  extra_headers: Send extra headers
@@ -9,4 +9,4 @@ __all__ = ["RotateApiKeyResponse"]
9
9
 
10
10
  class RotateApiKeyResponse(BaseModel):
11
11
  api_key: str = FieldInfo(alias="apiKey")
12
- """The new API key. The previous key is revoked immediately."""
12
+ """The new API key. Store it now; the key used for rotation stops working immediately."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: growsurf-python
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: The official Python library for the growsurf API
5
5
  Project-URL: Homepage, https://github.com/growsurf/growsurf-python
6
6
  Project-URL: Repository, https://github.com/growsurf/growsurf-python
@@ -1,6 +1,6 @@
1
1
  growsurf/__init__.py,sha256=PVU29rH3G7u2LvpyJd5G00W8Saj2Cp_BNzw7JIg8068,2683
2
2
  growsurf/_base_client.py,sha256=4kz0Jq20J5tuau3uZ9dLIBp-EotPbXDIJ5AQ4rTE7AA,74561
3
- growsurf/_client.py,sha256=rjo8rx5CasE5X6xtufScduBfSyfp7Z7sTK0nxkW5nrk,19225
3
+ growsurf/_client.py,sha256=suOVygcmn3NqVYwXaN4wzRYn3u0Yf9iecTpDaBzf7d0,19331
4
4
  growsurf/_compat.py,sha256=_9guQfzYnL3DNtudX5W7T2cdSskx89B5AFfhPQDxMUk,6811
5
5
  growsurf/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
6
6
  growsurf/_exceptions.py,sha256=3bEzw4WDc3VYTMnwkiOucauRjS8Vhr3L0Qb02P0ZKaE,3224
@@ -11,7 +11,7 @@ growsurf/_resource.py,sha256=oeDA0FL2ottIchoUi86M_8eUqmtrGQLYTgfKYEzrsWg,1112
11
11
  growsurf/_response.py,sha256=RTZ8t27W4S6ExkCjzCg4HbcDUTCdOMgiheiMAuAxgu4,28937
12
12
  growsurf/_streaming.py,sha256=9aJ_V6JtddntWCon2Cq_MOLMnySnhc7wuqeZx7sUtKU,10558
13
13
  growsurf/_types.py,sha256=r8hAVihrutiLUToaJhSDys9T9sMc8BMy2qUrr3W_8Wo,7751
14
- growsurf/_version.py,sha256=FXvEzJyTPiTjJO8C3OjpXCjj-qzuaDwWsDUOXW5jhM0,160
14
+ growsurf/_version.py,sha256=8sTKEyG6dzm-lh9DQJ-rPuFC2-kMk2irKInDZRAzlKQ,160
15
15
  growsurf/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  growsurf/_utils/__init__.py,sha256=nQq-iFa5YxTaWySaLigatew5rHgTR0M75FNYm4mrO1s,2313
17
17
  growsurf/_utils/_compat.py,sha256=33246eDcl3pwL6kWsEhVuT4Akrd8gZEW9LPTm465ohk,1231
@@ -29,7 +29,7 @@ growsurf/_utils/_typing.py,sha256=N_5PPuFNsaygbtA_npZd98SVN1LQQvFTKL6bkWPBZGU,47
29
29
  growsurf/_utils/_utils.py,sha256=2nPOzDrPe2GADpLCRM4bNQS8Mu7LjEiCG_LJ2AAL6jg,13111
30
30
  growsurf/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
31
31
  growsurf/resources/__init__.py,sha256=svo5sO2EsnyOM5xM5o8_U1aiqywVAO94WN1nTT156I4,1041
32
- growsurf/resources/account.py,sha256=Er1fuVU8tbKFA7a-D6cjDpZYDhhliKBflCgovEZRt4E,24033
32
+ growsurf/resources/account.py,sha256=2t0yIO0MUaqfuXJpTtLBqlan3qJoVXal2HRlA0peOq4,24461
33
33
  growsurf/resources/campaign/__init__.py,sha256=XW5nmnR2dF-wzM0d9aoF5cZDC7c-XyyIOjdmPV8IPZ8,4875
34
34
  growsurf/resources/campaign/campaign.py,sha256=4-sl6-D0Q68d1Al-_33MPZhKaqF5YFbQeqwhcmcaEk8,75401
35
35
  growsurf/resources/campaign/commission.py,sha256=K5HmznRM7nO-VNiP2Jy1rIeW63rAx1Aa2M9DEJ9dB2I,10294
@@ -38,7 +38,7 @@ growsurf/resources/campaign/emails.py,sha256=wGGP1hTPKGb-O7wRAvkGsMflKaoPMhpXyq2
38
38
  growsurf/resources/campaign/installation.py,sha256=36WbjO6ZDh_dDR4VHLNRxrgjbtkwYb6CbaPSc3KdbSw,11234
39
39
  growsurf/resources/campaign/options.py,sha256=OfXOBysKf7VW3IJFv7bSOcPnMXSETolRGiV2n6Ff0pQ,11130
40
40
  growsurf/resources/campaign/participant.py,sha256=ADDC6f5K8UW-ihsU5rwYHJVOWwPNVn4KOyq1JlWWfro,106610
41
- growsurf/resources/campaign/reward.py,sha256=AVPDhttbglDXnZE4onrCvf6Br6PdAohVV9WJgF7DsjY,14034
41
+ growsurf/resources/campaign/reward.py,sha256=CLRzQywVF6zpjVG2S4OIKyBhaS9B9Obrjk6ENOicb30,14264
42
42
  growsurf/resources/campaign/rewards.py,sha256=x-fZvvo0gx--SEw_r1t6HHEr6aU5Ir4kh2pqFTsxiqw,34425
43
43
  growsurf/resources/campaign/webhooks.py,sha256=DRJ8-8QDibGEq1hT7MTkrlE5kdbEapZXiZb2z_kKM68,22666
44
44
  growsurf/types/__init__.py,sha256=Yj4kkVWCtct-IM6FrmErkEjJSVWuzsdszLFHs8FSk2w,2335
@@ -63,7 +63,7 @@ growsurf/types/participant_commission_list.py,sha256=NodpaTxYHY30DNfBp3m09BPv0Zu
63
63
  growsurf/types/participant_list.py,sha256=5oety8iTXx5anr0W5wAjzCAIMPkQLPeVIc2TNuRbrMY,430
64
64
  growsurf/types/participant_payout_list.py,sha256=93fM0_gS3ej8KbEpkEPsU8GHWnV-un0duWkuxePr_IQ,1493
65
65
  growsurf/types/referral_list.py,sha256=SOU3s0cjeQLhbZVbeGoeCprVyrPTk-tvmMBMV25uG1o,969
66
- growsurf/types/rotate_api_key_response.py,sha256=VdHLkSGMQ7ZF2WPiURKllo9Ok4aOD2Pd2uukPGkES1g,350
66
+ growsurf/types/rotate_api_key_response.py,sha256=dzF80t7wkpHAso5u9QciHNzYww3qTsEmE9LJ4XAQPGM,376
67
67
  growsurf/types/verification_email_response.py,sha256=UYhx3DiXpWWgumukaezuiuIq_OME-3QE2_vG0TnwR00,292
68
68
  growsurf/types/campaign/__init__.py,sha256=cRjsIrPhEbMXTyyWY0IWanGk1SUgRd1IJUd7_9kOoC8,4944
69
69
  growsurf/types/campaign/campaign.py,sha256=Mm2bYeZnGFnghAPxvXPPhrbq8fzqAiqjeyDd-u9tP_E,3111
@@ -120,7 +120,7 @@ growsurf/types/campaign/webhook_list_response.py,sha256=tSk9nTbcsj5Y-j4RjQwu9SZc
120
120
  growsurf/types/campaign/webhook_test_params.py,sha256=X1Osg9-4KGJbZauG_7rDqTE7cKCypeSzgumIhnxj9dk,468
121
121
  growsurf/types/campaign/webhook_test_response.py,sha256=AahcckKSLUeIgpwlosOOmbkioF62xREXgLbieHAPAdI,576
122
122
  growsurf/types/campaign/webhook_update_params.py,sha256=SavKhws8pfybC7O40ovtCreEmOwihEGPOCEX9Iua9cE,598
123
- growsurf_python-1.1.1.dist-info/METADATA,sha256=PTpi26xeIYtYY53H6mT5P-Zbv0JDfDRAQQzLVFHaU_4,13614
124
- growsurf_python-1.1.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
125
- growsurf_python-1.1.1.dist-info/licenses/LICENSE,sha256=kTHLVE-ra1gtTxcn395uFqcOzcErebE-mDdPNW7b8OU,11338
126
- growsurf_python-1.1.1.dist-info/RECORD,,
123
+ growsurf_python-1.1.2.dist-info/METADATA,sha256=NGZ9XyRKo6pp1Ovkml1j0KUDOODoZ6FGDe4G78Gvoaw,13614
124
+ growsurf_python-1.1.2.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
125
+ growsurf_python-1.1.2.dist-info/licenses/LICENSE,sha256=kTHLVE-ra1gtTxcn395uFqcOzcErebE-mDdPNW7b8OU,11338
126
+ growsurf_python-1.1.2.dist-info/RECORD,,