salesforce-data-customcode 6.1.0.dev2__py3-none-any.whl → 6.1.0.dev3__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.
- datacustomcode/cli.py +1 -1
- datacustomcode/constants.py +1 -1
- datacustomcode/deploy.py +4 -4
- datacustomcode/named_credential/__init__.py +2 -0
- datacustomcode/named_credential/direct/transport.py +6 -6
- datacustomcode/named_credential/errors.py +36 -0
- {salesforce_data_customcode-6.1.0.dev2.dist-info → salesforce_data_customcode-6.1.0.dev3.dist-info}/METADATA +1 -1
- {salesforce_data_customcode-6.1.0.dev2.dist-info → salesforce_data_customcode-6.1.0.dev3.dist-info}/RECORD +11 -10
- {salesforce_data_customcode-6.1.0.dev2.dist-info → salesforce_data_customcode-6.1.0.dev3.dist-info}/WHEEL +0 -0
- {salesforce_data_customcode-6.1.0.dev2.dist-info → salesforce_data_customcode-6.1.0.dev3.dist-info}/entry_points.txt +0 -0
- {salesforce_data_customcode-6.1.0.dev2.dist-info → salesforce_data_customcode-6.1.0.dev3.dist-info}/licenses/LICENSE.txt +0 -0
datacustomcode/cli.py
CHANGED
datacustomcode/constants.py
CHANGED
|
@@ -35,7 +35,7 @@ FEATURE_TEMPLATE_MAPPING = {
|
|
|
35
35
|
|
|
36
36
|
# Feature name to Connect API name mapping
|
|
37
37
|
USE_IN_FEATURE_MAPPING_FOR_CONNECT_API = {
|
|
38
|
-
"SearchIndexChunking": "
|
|
38
|
+
"SearchIndexChunking": "SearchIndexChunking",
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
# Pydantic request/response type names to feature names
|
datacustomcode/deploy.py
CHANGED
|
@@ -42,7 +42,7 @@ from datacustomcode.named_credential.direct.credentials import (
|
|
|
42
42
|
)
|
|
43
43
|
from datacustomcode.scan import find_base_directory, get_package_type
|
|
44
44
|
|
|
45
|
-
DATA_CUSTOM_CODE_PATH = "services/data/
|
|
45
|
+
DATA_CUSTOM_CODE_PATH = "services/data/v67.0/ssot/data-custom-code"
|
|
46
46
|
DATA_TRANSFORMS_PATH = "services/data/v63.0/ssot/data-transforms"
|
|
47
47
|
WAIT_FOR_DEPLOYMENT_TIMEOUT = 3000
|
|
48
48
|
|
|
@@ -110,7 +110,7 @@ class CodeExtensionMetadata(BaseModel):
|
|
|
110
110
|
description: str
|
|
111
111
|
computeType: str
|
|
112
112
|
codeType: str
|
|
113
|
-
|
|
113
|
+
invokeOptions: Union[list[str], None] = None
|
|
114
114
|
|
|
115
115
|
def __init__(self, **data):
|
|
116
116
|
name = data.get("name", "")
|
|
@@ -214,8 +214,8 @@ def create_deployment(
|
|
|
214
214
|
"codeType": metadata.codeType,
|
|
215
215
|
}
|
|
216
216
|
)
|
|
217
|
-
if metadata.
|
|
218
|
-
body["
|
|
217
|
+
if metadata.invokeOptions:
|
|
218
|
+
body["invokeOptions"] = metadata.invokeOptions
|
|
219
219
|
logger.debug(f"Creating deployment {metadata.name}...")
|
|
220
220
|
try:
|
|
221
221
|
response = _make_api_call(
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
from datacustomcode.named_credential.base import NamedCredential
|
|
17
17
|
from datacustomcode.named_credential.default import DefaultNamedCredential
|
|
18
|
+
from datacustomcode.named_credential.errors import NamedCredentialCallError
|
|
18
19
|
from datacustomcode.named_credential.spark_base import SparkNamedCredential
|
|
19
20
|
from datacustomcode.named_credential.spark_default import DefaultSparkNamedCredential
|
|
20
21
|
|
|
@@ -22,5 +23,6 @@ __all__ = [
|
|
|
22
23
|
"DefaultNamedCredential",
|
|
23
24
|
"DefaultSparkNamedCredential",
|
|
24
25
|
"NamedCredential",
|
|
26
|
+
"NamedCredentialCallError",
|
|
25
27
|
"SparkNamedCredential",
|
|
26
28
|
]
|
|
@@ -31,11 +31,9 @@ from typing import (
|
|
|
31
31
|
import requests
|
|
32
32
|
|
|
33
33
|
from datacustomcode.named_credential.direct.auth import DynamicAuthHandler
|
|
34
|
-
from datacustomcode.named_credential.direct.credentials import
|
|
35
|
-
CredentialError,
|
|
36
|
-
CredentialStore,
|
|
37
|
-
)
|
|
34
|
+
from datacustomcode.named_credential.direct.credentials import CredentialStore
|
|
38
35
|
from datacustomcode.named_credential.direct.url_resolver import resolve_base_url
|
|
36
|
+
from datacustomcode.named_credential.errors import NamedCredentialCallError
|
|
39
37
|
from datacustomcode.token_provider import (
|
|
40
38
|
CredentialsTokenProvider,
|
|
41
39
|
SFCLITokenProvider,
|
|
@@ -69,7 +67,7 @@ class DirectCalloutTransport:
|
|
|
69
67
|
def callout(self, callout_request: Dict[str, Any]) -> Dict[str, Any]:
|
|
70
68
|
raw_url = callout_request["path"]
|
|
71
69
|
if not raw_url.startswith("callout:"):
|
|
72
|
-
raise
|
|
70
|
+
raise NamedCredentialCallError(
|
|
73
71
|
f"Callout URL must start with 'callout:', got '{raw_url}'."
|
|
74
72
|
)
|
|
75
73
|
|
|
@@ -83,7 +81,9 @@ class DirectCalloutTransport:
|
|
|
83
81
|
path_suffix = raw_url[sep_idx:]
|
|
84
82
|
|
|
85
83
|
if callout_key == "callout:":
|
|
86
|
-
raise
|
|
84
|
+
raise NamedCredentialCallError(
|
|
85
|
+
f"Named Credential name is empty in URL '{raw_url}'."
|
|
86
|
+
)
|
|
87
87
|
|
|
88
88
|
cred_config = self._store.get(callout_key)
|
|
89
89
|
base_url = self._base_url_cache.get(callout_key)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Copyright (c) 2025, Salesforce, Inc.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
"""Exceptions raised by Named Credential implementations."""
|
|
16
|
+
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
from typing import Optional
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class NamedCredentialCallError(RuntimeError):
|
|
23
|
+
"""Raised when a Named Credential external callout fails."""
|
|
24
|
+
|
|
25
|
+
def __init__(
|
|
26
|
+
self,
|
|
27
|
+
message: str,
|
|
28
|
+
*,
|
|
29
|
+
status: Optional[object] = None,
|
|
30
|
+
error_code: Optional[str] = None,
|
|
31
|
+
error_message: Optional[str] = None,
|
|
32
|
+
) -> None:
|
|
33
|
+
super().__init__(message)
|
|
34
|
+
self.status = status
|
|
35
|
+
self.error_code = error_code
|
|
36
|
+
self.error_message = error_message
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
datacustomcode/__init__.py,sha256=SGsDnWDTihWkLNnWdqvH08zklQgxykar73JAcPL2plI,2666
|
|
2
2
|
datacustomcode/auth.py,sha256=fpSjhIBdv9trC8yq2vuljAix_Euu-4Ah7HDCGhYjOxI,8309
|
|
3
|
-
datacustomcode/cli.py,sha256=
|
|
3
|
+
datacustomcode/cli.py,sha256=qAUEFztKjYaG6Ws8xuE8rUpUr06snmFbUEuNRggjdBY,13256
|
|
4
4
|
datacustomcode/client.py,sha256=lbOseiGaDru-vUtdRXgAORhrJa5V5WrFkbcEIfzBkaU,24325
|
|
5
5
|
datacustomcode/cmd.py,sha256=ZMs46aydJw2EaU26JgCtZmnqESQFHvvaJz10hnjZTBk,3537
|
|
6
6
|
datacustomcode/common_config.py,sha256=SAUnxj3kqmOeWwPmFoYq4tuxokMgURVm4QwcGi-avL4,1928
|
|
7
7
|
datacustomcode/config.py,sha256=2Pk61ieQsEWSxKDxlS66_rliKE8iX0j-9LweEm0aaGo,4072
|
|
8
8
|
datacustomcode/config.yaml,sha256=LqpbkZhzN0nZOPEPnaz2qOCbchp8fxC4GHamT_b56D0,1082
|
|
9
|
-
datacustomcode/constants.py,sha256=
|
|
9
|
+
datacustomcode/constants.py,sha256=wcWy82JAZgMCzIrDLb6k0nl-qtNHawGedGBxY4atL8E,1435
|
|
10
10
|
datacustomcode/credentials.py,sha256=D-7Zd3Nh_wStdj8_wUy5cnC8M_mdbfBijhIAi-2EbXs,9467
|
|
11
|
-
datacustomcode/deploy.py,sha256=
|
|
11
|
+
datacustomcode/deploy.py,sha256=eN5k7Rbxe-Yf8c_CeeHICZJqzJqMuvIVNu11agNW8NA,22111
|
|
12
12
|
datacustomcode/einstein_platform_client.py,sha256=ON2B_m--vdbCVVMVcLc81T-BRZ5-UuxVCer8E6OEQPA,4083
|
|
13
13
|
datacustomcode/einstein_platform_config.py,sha256=6lb_FRbEzdt5a8-2cR15f13ZKw674uvRJ4Xq0o_pQXE,1490
|
|
14
14
|
datacustomcode/einstein_predictions/__init__.py,sha256=_RIDTqcEHDRu6AsCsj9lRBykNkHI8Ch8JBILL1ioPtA,1237
|
|
@@ -53,14 +53,15 @@ datacustomcode/llm_gateway/types/generate_text_response.py,sha256=NSvj6nvzR4cZ0c
|
|
|
53
53
|
datacustomcode/llm_gateway/types/generate_text_response_builder.py,sha256=6MV6JZuTyHUId3Slw9k7m0KBgjj-5S9HI4qtd94Jl2A,1272
|
|
54
54
|
datacustomcode/llm_gateway_config.py,sha256=ECm9CFqOFOaLHwenvVFAjiRSzG9Eg9fY4pb8nHbQ34c,3312
|
|
55
55
|
datacustomcode/mixin.py,sha256=ZtROqO1W1_D7MV8lw4cw6zzcchJLoZS0aAiXrolYR4k,4914
|
|
56
|
-
datacustomcode/named_credential/__init__.py,sha256=
|
|
56
|
+
datacustomcode/named_credential/__init__.py,sha256=XD_UI8ggOkFvkqCOZI_3dP1AkviqPIZFOt3RI1_RDe4,1163
|
|
57
57
|
datacustomcode/named_credential/base.py,sha256=-LMskZkKNoaFg-Zc80M_4IPLF7ru5pfnbkfLI7YXrFc,1816
|
|
58
58
|
datacustomcode/named_credential/default.py,sha256=z03B0daZvTPiTmJWGAtDCICB1srelESg7QmPH2iRK5o,3339
|
|
59
59
|
datacustomcode/named_credential/direct/__init__.py,sha256=zqErMI1GqEhseLnYkrWtq3WipRi_dP153c8wwLvgI-o,799
|
|
60
60
|
datacustomcode/named_credential/direct/auth.py,sha256=U09jO0Pn3OEOEudmvcBmtkwoXqE0Ae_Mv6TAMqb3eG4,2201
|
|
61
61
|
datacustomcode/named_credential/direct/credentials.py,sha256=fibIZTyBT1IbAGFjXwAXqYcQt9o_sB8zFmuixGmibE4,4534
|
|
62
|
-
datacustomcode/named_credential/direct/transport.py,sha256=
|
|
62
|
+
datacustomcode/named_credential/direct/transport.py,sha256=UL5eJJsyoAjr8ovJDQKQY3O20DivvbWFPGRyM8Y2or4,4078
|
|
63
63
|
datacustomcode/named_credential/direct/url_resolver.py,sha256=KItv12Az0qoxnVacCTcM9t9AY7qB9_tqPWMgiP-7Y6s,3823
|
|
64
|
+
datacustomcode/named_credential/errors.py,sha256=zyMEgljTf85digXrLrlR9HBh5Un4WtG0WsZx0K4EWt0,1212
|
|
64
65
|
datacustomcode/named_credential/spark_base.py,sha256=w34B-Pg6m_hcUqUbjmB2b6zUme_MSgg6VeghbMMYYN4,3288
|
|
65
66
|
datacustomcode/named_credential/spark_default.py,sha256=DY_STX9-1le8cS5M_vGqB3VUtQ2XCZZYDAmKId7YekA,5219
|
|
66
67
|
datacustomcode/named_credential/types/__init__.py,sha256=gamfOD1VnAtEslRBpqh-yKiVjkG_wYWYdSatGIfsN-w,621
|
|
@@ -117,8 +118,8 @@ datacustomcode/templates/script/requirements-dev.txt,sha256=OWwuy1awesqOZOS3Zizm
|
|
|
117
118
|
datacustomcode/templates/script/requirements.txt,sha256=qJbqzs5z0Hrx590U3T7dHq_m8UQEx2TdhgrJSz-QHIQ,40
|
|
118
119
|
datacustomcode/token_provider.py,sha256=qA_e4vqSXnxn0MccFFPULWO8ZeUOEAu5QpBnoYCg-fc,6839
|
|
119
120
|
datacustomcode/version.py,sha256=9LlbVrzwBvut1L308QbwNBgxdQk5CrghH39JARVSxms,989
|
|
120
|
-
salesforce_data_customcode-6.1.0.
|
|
121
|
-
salesforce_data_customcode-6.1.0.
|
|
122
|
-
salesforce_data_customcode-6.1.0.
|
|
123
|
-
salesforce_data_customcode-6.1.0.
|
|
124
|
-
salesforce_data_customcode-6.1.0.
|
|
121
|
+
salesforce_data_customcode-6.1.0.dev3.dist-info/METADATA,sha256=FDlrw8kdEPaFPCw8PJ0knkNqmS3vIuntw2oznOqA-A0,25115
|
|
122
|
+
salesforce_data_customcode-6.1.0.dev3.dist-info/WHEEL,sha256=eY7nduwzv-ldUxpzbRlxwvC693Hg6PX8bWDjEHjZ_dk,88
|
|
123
|
+
salesforce_data_customcode-6.1.0.dev3.dist-info/entry_points.txt,sha256=WpQ94UB7UuRCYGOLtJV3vAgm1tl7iVf43VYRWIuNu5Y,74
|
|
124
|
+
salesforce_data_customcode-6.1.0.dev3.dist-info/licenses/LICENSE.txt,sha256=iOi8EmQpfkFhMENi7VYtkl2EqS14pEOccoXHiW2dyPU,11443
|
|
125
|
+
salesforce_data_customcode-6.1.0.dev3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|