sfq 0.0.13__tar.gz → 0.0.14__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.
- {sfq-0.0.13 → sfq-0.0.14}/PKG-INFO +1 -1
- {sfq-0.0.13 → sfq-0.0.14}/pyproject.toml +1 -1
- {sfq-0.0.13 → sfq-0.0.14}/src/sfq/__init__.py +16 -2
- {sfq-0.0.13 → sfq-0.0.14}/uv.lock +1 -1
- {sfq-0.0.13 → sfq-0.0.14}/.github/workflows/publish.yml +0 -0
- {sfq-0.0.13 → sfq-0.0.14}/.gitignore +0 -0
- {sfq-0.0.13 → sfq-0.0.14}/.python-version +0 -0
- {sfq-0.0.13 → sfq-0.0.14}/README.md +0 -0
- {sfq-0.0.13 → sfq-0.0.14}/src/sfq/py.typed +0 -0
@@ -88,7 +88,8 @@ class SFAuth:
|
|
88
88
|
access_token: Optional[str] = None,
|
89
89
|
token_expiration_time: Optional[float] = None,
|
90
90
|
token_lifetime: int = 15 * 60,
|
91
|
-
user_agent: str = "sfq/0.0.
|
91
|
+
user_agent: str = "sfq/0.0.14",
|
92
|
+
sforce_client: str = '_auto',
|
92
93
|
proxy: str = "auto",
|
93
94
|
) -> None:
|
94
95
|
"""
|
@@ -103,7 +104,8 @@ class SFAuth:
|
|
103
104
|
:param access_token: The access token for the current session (default is None).
|
104
105
|
:param token_expiration_time: The expiration time of the access token (default is None).
|
105
106
|
:param token_lifetime: The lifetime of the access token in seconds (default is 15 minutes).
|
106
|
-
:param user_agent: Custom User-Agent string (default is "sfq/0.0.
|
107
|
+
:param user_agent: Custom User-Agent string (default is "sfq/0.0.14").
|
108
|
+
:param sforce_client: Custom Application Identifier (default is user_agent).
|
107
109
|
:param proxy: The proxy configuration, "auto" to use environment (default is "auto").
|
108
110
|
"""
|
109
111
|
self.instance_url = self._format_instance_url(instance_url)
|
@@ -116,9 +118,13 @@ class SFAuth:
|
|
116
118
|
self.token_expiration_time = token_expiration_time
|
117
119
|
self.token_lifetime = token_lifetime
|
118
120
|
self.user_agent = user_agent
|
121
|
+
self.sforce_client = sforce_client
|
119
122
|
self._auto_configure_proxy(proxy)
|
120
123
|
self._high_api_usage_threshold = 80
|
121
124
|
|
125
|
+
if sforce_client == '_auto':
|
126
|
+
self.sforce_client = user_agent
|
127
|
+
|
122
128
|
if self.client_secret == "_deprecation_warning":
|
123
129
|
warnings.warn(
|
124
130
|
"The 'client_secret' parameter will be mandatory and positional arguments will change after 1 August 2025. "
|
@@ -212,6 +218,7 @@ class SFAuth:
|
|
212
218
|
"Accept": "application/json",
|
213
219
|
"Content-Type": "application/x-www-form-urlencoded",
|
214
220
|
"User-Agent": self.user_agent,
|
221
|
+
"Sforce-Call-Options": f"client={self.sforce_client}",
|
215
222
|
}
|
216
223
|
body = "&".join(f"{key}={quote(str(value))}" for key, value in payload.items())
|
217
224
|
|
@@ -372,6 +379,7 @@ class SFAuth:
|
|
372
379
|
headers = {
|
373
380
|
"Authorization": f"Bearer {self.access_token}",
|
374
381
|
"User-Agent": self.user_agent,
|
382
|
+
"Sforce-Call-Options": f"client={self.sforce_client}",
|
375
383
|
"Accept": "application/json",
|
376
384
|
}
|
377
385
|
|
@@ -467,6 +475,7 @@ class SFAuth:
|
|
467
475
|
headers = {
|
468
476
|
"Authorization": f"Bearer {self.access_token}",
|
469
477
|
"User-Agent": self.user_agent,
|
478
|
+
"Sforce-Call-Options": f"client={self.sforce_client}",
|
470
479
|
"Content-Type": "application/json",
|
471
480
|
"Accept": "application/json",
|
472
481
|
}
|
@@ -525,6 +534,7 @@ class SFAuth:
|
|
525
534
|
headers = {
|
526
535
|
"Authorization": f"Bearer {self.access_token}",
|
527
536
|
"User-Agent": self.user_agent,
|
537
|
+
"Sforce-Call-Options": f"client={self.sforce_client}",
|
528
538
|
"Accept": "application/json",
|
529
539
|
}
|
530
540
|
|
@@ -581,6 +591,7 @@ class SFAuth:
|
|
581
591
|
headers = {
|
582
592
|
"Authorization": f"Bearer {self.access_token}",
|
583
593
|
"User-Agent": self.user_agent,
|
594
|
+
"Sforce-Call-Options": f"client={self.sforce_client}",
|
584
595
|
"Accept": "application/json",
|
585
596
|
}
|
586
597
|
|
@@ -677,6 +688,7 @@ class SFAuth:
|
|
677
688
|
headers = {
|
678
689
|
"Authorization": f"Bearer {self.access_token}",
|
679
690
|
"User-Agent": self.user_agent,
|
691
|
+
"Sforce-Call-Options": f"client={self.sforce_client}",
|
680
692
|
"Accept": "application/json",
|
681
693
|
}
|
682
694
|
|
@@ -753,6 +765,7 @@ class SFAuth:
|
|
753
765
|
headers = {
|
754
766
|
"Authorization": f"Bearer {self.access_token}",
|
755
767
|
"User-Agent": self.user_agent,
|
768
|
+
"Sforce-Call-Options": f"client={self.sforce_client}",
|
756
769
|
"Accept": "application/json",
|
757
770
|
"Content-Type": "application/json",
|
758
771
|
}
|
@@ -896,6 +909,7 @@ class SFAuth:
|
|
896
909
|
"Content-Type": "application/json",
|
897
910
|
"Accept": "application/json",
|
898
911
|
"User-Agent": self.user_agent,
|
912
|
+
"Sforce-Call-Options": f"client={self.sforce_client}",
|
899
913
|
}
|
900
914
|
|
901
915
|
parsed_url = urlparse(self.instance_url)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|