murf 1.1.1__tar.gz → 1.2.0__tar.gz
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.
Potentially problematic release.
This version of murf might be problematic. Click here for more details.
- {murf-1.1.1 → murf-1.2.0}/PKG-INFO +1 -1
- {murf-1.1.1 → murf-1.2.0}/pyproject.toml +1 -1
- {murf-1.1.1 → murf-1.2.0}/src/murf/core/client_wrapper.py +1 -1
- {murf-1.1.1 → murf-1.2.0}/src/murf/dubbing/jobs/client.py +25 -11
- murf-1.2.0/src/murf/utils.py +31 -0
- {murf-1.1.1 → murf-1.2.0}/LICENSE +0 -0
- {murf-1.1.1 → murf-1.2.0}/README.md +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/__init__.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/auth/__init__.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/auth/client.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/base_client.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/client.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/core/__init__.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/core/api_error.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/core/datetime_utils.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/core/file.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/core/http_client.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/core/jsonable_encoder.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/core/pydantic_utilities.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/core/query_encoder.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/core/remove_none_from_dict.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/core/request_options.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/core/serialization.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/dubbing/__init__.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/dubbing/client.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/dubbing/jobs/__init__.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/dubbing/jobs/types/__init__.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/dubbing/jobs/types/jobs_create_request_priority.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/dubbing/jobs/types/jobs_create_with_project_id_request_priority.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/dubbing/languages/__init__.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/dubbing/languages/client.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/dubbing/projects/__init__.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/dubbing/projects/client.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/dubbing/projects/types/__init__.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/dubbing/projects/types/api_create_project_request_dubbing_type.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/dubbing_client.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/environment.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/errors/__init__.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/errors/bad_request_error.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/errors/forbidden_error.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/errors/internal_server_error.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/errors/payment_required_error.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/errors/service_unavailable_error.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/errors/unauthorized_error.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/py.typed +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/text_to_speech/__init__.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/text_to_speech/client.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/text_to_speech/types/__init__.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/text_to_speech/types/generate_speech_request_model_version.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/types/__init__.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/types/api_job_response.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/types/api_job_response_dubbing_type.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/types/api_job_response_priority.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/types/api_project_response.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/types/api_project_response_dubbing_type.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/types/api_voice.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/types/api_voice_gender.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/types/auth_token_response.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/types/dub_api_detail_response.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/types/dub_job_status_response.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/types/form_data_content_disposition.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/types/generate_speech_response.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/types/group_api_project_response.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/types/locale_response.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/types/locale_response_supports_item.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/types/pronunciation_detail.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/types/pronunciation_detail_type.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/types/source_locale_response.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/types/style_details.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/types/word_duration.py +0 -0
- {murf-1.1.1 → murf-1.2.0}/src/murf/version.py +0 -0
|
@@ -16,7 +16,7 @@ class BaseClientWrapper:
|
|
|
16
16
|
headers: typing.Dict[str, str] = {
|
|
17
17
|
"X-Fern-Language": "Python",
|
|
18
18
|
"X-Fern-SDK-Name": "murf",
|
|
19
|
-
"X-Fern-SDK-Version": "1.
|
|
19
|
+
"X-Fern-SDK-Version": "1.2.0",
|
|
20
20
|
}
|
|
21
21
|
if self._api_key is not None:
|
|
22
22
|
headers["api-key"] = self._api_key
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import typing
|
|
4
4
|
from ...core.client_wrapper import SyncClientWrapper
|
|
5
|
-
from .types.jobs_create_request_priority import JobsCreateRequestPriority
|
|
6
5
|
from ... import core
|
|
6
|
+
from .types.jobs_create_request_priority import JobsCreateRequestPriority
|
|
7
7
|
from ...core.request_options import RequestOptions
|
|
8
8
|
from ...types.api_job_response import ApiJobResponse
|
|
9
9
|
from ...core.pydantic_utilities import parse_obj_as
|
|
@@ -30,12 +30,13 @@ class JobsClient:
|
|
|
30
30
|
self,
|
|
31
31
|
*,
|
|
32
32
|
target_locales: typing.List[str],
|
|
33
|
-
priority: JobsCreateRequestPriority,
|
|
34
33
|
file: typing.Optional[core.File] = OMIT,
|
|
35
34
|
file_url: typing.Optional[str] = OMIT,
|
|
36
35
|
source_locale: typing.Optional[str] = OMIT,
|
|
37
36
|
webhook_url: typing.Optional[str] = OMIT,
|
|
38
37
|
file_name: typing.Optional[str] = OMIT,
|
|
38
|
+
priority: typing.Optional[JobsCreateRequestPriority] = OMIT,
|
|
39
|
+
webhook_secret: typing.Optional[str] = OMIT,
|
|
39
40
|
request_options: typing.Optional[RequestOptions] = None,
|
|
40
41
|
) -> ApiJobResponse:
|
|
41
42
|
"""
|
|
@@ -44,9 +45,6 @@ class JobsClient:
|
|
|
44
45
|
target_locales : typing.List[str]
|
|
45
46
|
List of target locales
|
|
46
47
|
|
|
47
|
-
priority : JobsCreateRequestPriority
|
|
48
|
-
Priority of the job. Allowed values: LOW, NORMAL, HIGH
|
|
49
|
-
|
|
50
48
|
file : typing.Optional[core.File]
|
|
51
49
|
See core.File for more documentation
|
|
52
50
|
|
|
@@ -59,6 +57,11 @@ class JobsClient:
|
|
|
59
57
|
|
|
60
58
|
file_name : typing.Optional[str]
|
|
61
59
|
|
|
60
|
+
priority : typing.Optional[JobsCreateRequestPriority]
|
|
61
|
+
Priority of the job. Allowed values: LOW, NORMAL, HIGH
|
|
62
|
+
|
|
63
|
+
webhook_secret : typing.Optional[str]
|
|
64
|
+
|
|
62
65
|
request_options : typing.Optional[RequestOptions]
|
|
63
66
|
Request-specific configuration.
|
|
64
67
|
|
|
@@ -76,7 +79,6 @@ class JobsClient:
|
|
|
76
79
|
)
|
|
77
80
|
client.dubbing.jobs.create(
|
|
78
81
|
target_locales=["target_locales"],
|
|
79
|
-
priority="LOW",
|
|
80
82
|
)
|
|
81
83
|
"""
|
|
82
84
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -89,6 +91,7 @@ class JobsClient:
|
|
|
89
91
|
"webhook_url": webhook_url,
|
|
90
92
|
"file_name": file_name,
|
|
91
93
|
"priority": priority,
|
|
94
|
+
"webhook_secret": webhook_secret,
|
|
92
95
|
},
|
|
93
96
|
files={
|
|
94
97
|
"file": file,
|
|
@@ -159,6 +162,7 @@ class JobsClient:
|
|
|
159
162
|
webhook_url: typing.Optional[str] = OMIT,
|
|
160
163
|
file_name: typing.Optional[str] = OMIT,
|
|
161
164
|
priority: typing.Optional[JobsCreateWithProjectIdRequestPriority] = OMIT,
|
|
165
|
+
webhook_secret: typing.Optional[str] = OMIT,
|
|
162
166
|
request_options: typing.Optional[RequestOptions] = None,
|
|
163
167
|
) -> ApiJobResponse:
|
|
164
168
|
"""
|
|
@@ -179,6 +183,8 @@ class JobsClient:
|
|
|
179
183
|
priority : typing.Optional[JobsCreateWithProjectIdRequestPriority]
|
|
180
184
|
Priority of the job. Allowed values: LOW, NORMAL, HIGH
|
|
181
185
|
|
|
186
|
+
webhook_secret : typing.Optional[str]
|
|
187
|
+
|
|
182
188
|
request_options : typing.Optional[RequestOptions]
|
|
183
189
|
Request-specific configuration.
|
|
184
190
|
|
|
@@ -207,6 +213,7 @@ class JobsClient:
|
|
|
207
213
|
"webhook_url": webhook_url,
|
|
208
214
|
"file_name": file_name,
|
|
209
215
|
"priority": priority,
|
|
216
|
+
"webhook_secret": webhook_secret,
|
|
210
217
|
},
|
|
211
218
|
files={
|
|
212
219
|
"file": file,
|
|
@@ -363,12 +370,13 @@ class AsyncJobsClient:
|
|
|
363
370
|
self,
|
|
364
371
|
*,
|
|
365
372
|
target_locales: typing.List[str],
|
|
366
|
-
priority: JobsCreateRequestPriority,
|
|
367
373
|
file: typing.Optional[core.File] = OMIT,
|
|
368
374
|
file_url: typing.Optional[str] = OMIT,
|
|
369
375
|
source_locale: typing.Optional[str] = OMIT,
|
|
370
376
|
webhook_url: typing.Optional[str] = OMIT,
|
|
371
377
|
file_name: typing.Optional[str] = OMIT,
|
|
378
|
+
priority: typing.Optional[JobsCreateRequestPriority] = OMIT,
|
|
379
|
+
webhook_secret: typing.Optional[str] = OMIT,
|
|
372
380
|
request_options: typing.Optional[RequestOptions] = None,
|
|
373
381
|
) -> ApiJobResponse:
|
|
374
382
|
"""
|
|
@@ -377,9 +385,6 @@ class AsyncJobsClient:
|
|
|
377
385
|
target_locales : typing.List[str]
|
|
378
386
|
List of target locales
|
|
379
387
|
|
|
380
|
-
priority : JobsCreateRequestPriority
|
|
381
|
-
Priority of the job. Allowed values: LOW, NORMAL, HIGH
|
|
382
|
-
|
|
383
388
|
file : typing.Optional[core.File]
|
|
384
389
|
See core.File for more documentation
|
|
385
390
|
|
|
@@ -392,6 +397,11 @@ class AsyncJobsClient:
|
|
|
392
397
|
|
|
393
398
|
file_name : typing.Optional[str]
|
|
394
399
|
|
|
400
|
+
priority : typing.Optional[JobsCreateRequestPriority]
|
|
401
|
+
Priority of the job. Allowed values: LOW, NORMAL, HIGH
|
|
402
|
+
|
|
403
|
+
webhook_secret : typing.Optional[str]
|
|
404
|
+
|
|
395
405
|
request_options : typing.Optional[RequestOptions]
|
|
396
406
|
Request-specific configuration.
|
|
397
407
|
|
|
@@ -414,7 +424,6 @@ class AsyncJobsClient:
|
|
|
414
424
|
async def main() -> None:
|
|
415
425
|
await client.dubbing.jobs.create(
|
|
416
426
|
target_locales=["target_locales"],
|
|
417
|
-
priority="LOW",
|
|
418
427
|
)
|
|
419
428
|
|
|
420
429
|
|
|
@@ -430,6 +439,7 @@ class AsyncJobsClient:
|
|
|
430
439
|
"webhook_url": webhook_url,
|
|
431
440
|
"file_name": file_name,
|
|
432
441
|
"priority": priority,
|
|
442
|
+
"webhook_secret": webhook_secret,
|
|
433
443
|
},
|
|
434
444
|
files={
|
|
435
445
|
"file": file,
|
|
@@ -500,6 +510,7 @@ class AsyncJobsClient:
|
|
|
500
510
|
webhook_url: typing.Optional[str] = OMIT,
|
|
501
511
|
file_name: typing.Optional[str] = OMIT,
|
|
502
512
|
priority: typing.Optional[JobsCreateWithProjectIdRequestPriority] = OMIT,
|
|
513
|
+
webhook_secret: typing.Optional[str] = OMIT,
|
|
503
514
|
request_options: typing.Optional[RequestOptions] = None,
|
|
504
515
|
) -> ApiJobResponse:
|
|
505
516
|
"""
|
|
@@ -520,6 +531,8 @@ class AsyncJobsClient:
|
|
|
520
531
|
priority : typing.Optional[JobsCreateWithProjectIdRequestPriority]
|
|
521
532
|
Priority of the job. Allowed values: LOW, NORMAL, HIGH
|
|
522
533
|
|
|
534
|
+
webhook_secret : typing.Optional[str]
|
|
535
|
+
|
|
523
536
|
request_options : typing.Optional[RequestOptions]
|
|
524
537
|
Request-specific configuration.
|
|
525
538
|
|
|
@@ -556,6 +569,7 @@ class AsyncJobsClient:
|
|
|
556
569
|
"webhook_url": webhook_url,
|
|
557
570
|
"file_name": file_name,
|
|
558
571
|
"priority": priority,
|
|
572
|
+
"webhook_secret": webhook_secret,
|
|
559
573
|
},
|
|
560
574
|
files={
|
|
561
575
|
"file": file,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import hmac
|
|
2
|
+
import hashlib
|
|
3
|
+
import time
|
|
4
|
+
|
|
5
|
+
def validate_hmac(secret: str, payload: str, timestamp_header: str, hmac_signature: str, tolerance_seconds: int):
|
|
6
|
+
"""
|
|
7
|
+
Validate the HMAC signature of a payload against a secret key and timestamp.
|
|
8
|
+
|
|
9
|
+
Args:
|
|
10
|
+
secret (str): The secret key used for HMAC generation.
|
|
11
|
+
payload (str): The payload to validate.
|
|
12
|
+
timestamp_header (str): The timestamp header from the request.
|
|
13
|
+
hmac_signature (str): The HMAC signature to validate against.
|
|
14
|
+
tolerance_seconds (int): The allowed time tolerance in seconds.
|
|
15
|
+
"""
|
|
16
|
+
try:
|
|
17
|
+
received_timestamp = int(timestamp_header)
|
|
18
|
+
current_timestamp = int(time.time()) * 1000
|
|
19
|
+
if (abs(current_timestamp - received_timestamp) / 1000) > tolerance_seconds:
|
|
20
|
+
print("Timestamp is outside the allowed tolerance window.")
|
|
21
|
+
return False
|
|
22
|
+
data_to_sign = f"{payload}.{timestamp_header}"
|
|
23
|
+
calculated_hmac = hmac.new(
|
|
24
|
+
secret.encode('utf-8'),
|
|
25
|
+
data_to_sign.encode('utf-8'),
|
|
26
|
+
hashlib.sha256
|
|
27
|
+
).hexdigest()
|
|
28
|
+
return hmac.compare_digest(calculated_hmac, hmac_signature)
|
|
29
|
+
except Exception as e:
|
|
30
|
+
print(f"Error validating HMAC: {e}")
|
|
31
|
+
return False
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{murf-1.1.1 → murf-1.2.0}/src/murf/dubbing/projects/types/api_create_project_request_dubbing_type.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{murf-1.1.1 → murf-1.2.0}/src/murf/text_to_speech/types/generate_speech_request_model_version.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|