@salesforce/afv-skills 1.69.0 → 1.70.0
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.
- package/package.json +1 -1
- package/skills/data360-code-extension-generate/SKILL.md +160 -252
- package/skills/data360-code-extension-generate/references/README.md +34 -172
- package/skills/data360-code-extension-generate/references/environment-setup.md +198 -0
- package/skills/data360-code-extension-generate/references/mcp-integration.md +36 -0
- package/skills/data360-code-extension-generate/references/quick-reference.md +132 -202
- package/skills/data360-code-extension-generate/references/run-logs.md +31 -0
- package/skills/data360-code-extension-generate/references/schema-discovery.md +45 -0
- package/skills/data360-code-extension-generate/references/troubleshooting.md +45 -0
- package/skills/data360-code-extension-generate/scripts/check_env.sh +197 -0
- package/skills/data360-code-extension-generate/scripts/venv_hook.sh +22 -0
- package/skills/dx-devops-work-item-manage/SKILL.md +24 -8
- package/skills/dx-devops-work-item-manage/examples/common-workflows.md +32 -0
- package/skills/dx-devops-work-item-manage/references/review-api.md +95 -0
- package/skills/dx-org-manage/SKILL.md +12 -12
- package/skills/dx-org-manage/examples/scratch-orgs/display_output.json +1 -3
- package/skills/dx-org-manage/examples/scratch-orgs/success_shape.json +1 -3
- package/skills/dx-org-manage/references/opening-org.md +1 -1
- package/skills/dx-org-manage/references/scratch-org-operations.md +15 -20
- package/skills/dx-packaging-move-to-2gp-migrate/SKILL.md +1 -1
- package/skills/education-cloud-academic-calendar-generate/SKILL.md +2 -2
- package/skills/education-cloud-course-catalog-migrate/SKILL.md +1 -1
- package/skills/education-cloud-domain-configure/references/domain-features/recruitment-admissions.md +8 -7
- package/skills/education-cloud-multi-campus-configure/SKILL.md +1 -0
- package/skills/education-cloud-multi-campus-configure/references/error_handling.md +7 -6
- package/skills/education-cloud-student-recruitment-agent-configure/SKILL.md +2 -0
- package/skills/education-cloud-student-recruitment-agent-configure/references/customer-narration.md +2 -0
- package/skills/education-cloud-student-recruitment-agent-configure/references/flows.md +1 -1
- package/skills/education-cloud-student-recruitment-agent-configure/references/grounding.md +5 -4
- package/skills/education-cloud-student-recruitment-agent-configure/references/permissions.md +1 -1
- package/skills/education-cloud-student-recruitment-agent-configure/references/prerequisites.md +1 -1
- package/skills/education-cloud-student-recruitment-agent-configure/references/routing.md +1 -1
- package/skills/experience-cms-content-type-generate/SKILL.md +7 -6
- package/skills/experience-cms-content-type-generate/references/agent-checklist.md +3 -3
- package/skills/experience-cms-content-type-generate/references/anti-patterns.md +2 -2
- package/skills/experience-cms-content-type-generate/references/discovery-details.md +1 -1
- package/skills/experience-cms-content-type-generate/references/retrieve-and-reconcile.md +5 -9
- package/skills/experience-ui-bundle-custom-app-generate/scripts/resolve-uibundle-path.mjs +10 -0
- package/skills/field-service-data-capture-migrate/references/converter-builder-contract.md +2 -2
- package/skills/field-service-data-capture-migrate/references/fsm-dc-capability-catalog.md +2 -2
- package/skills/field-service-data-capture-migrate/scripts/analyze_flow.py +1 -1
- package/skills/field-service-data-capture-migrate/scripts/convert_to_dc_spec.py +1 -1
- package/skills/field-service-data-capture-migrate/scripts/fsm_dc_catalog.py +2 -2
- package/skills/field-service-data-capture-migrate/scripts/generate_summary.py +2 -2
- package/skills/platform-custom-application-generate/SKILL.md +97 -104
- package/skills/platform-custom-application-generate/references/app-properties.md +52 -0
- package/skills/platform-custom-application-generate/references/app-visibility.md +19 -0
- package/skills/platform-custom-application-generate/references/utility-bar.md +55 -0
- package/skills/platform-datamask-run/SKILL.md +1 -1
- package/skills/platform-datamask-run/references/policy-authoring.md +41 -18
- package/skills/platform-dsar-policy-manage/SKILL.md +7 -6
- package/skills/platform-dsar-policy-manage/references/export-and-history.md +10 -8
- package/skills/platform-dsar-policy-manage/references/report-format.md +4 -2
- package/skills/platform-metadata-grounding-get/SKILL.md +7 -7
- package/skills/platform-report-generate/SKILL.md +9 -7
- package/skills/platform-report-generate/references/column-names.md +12 -1
- package/skills/platform-report-generate/references/errors-and-troubleshooting.md +1 -1
- package/skills/platform-sharing-rules-generate/SKILL.md +12 -3
- package/skills/platform-sharing-rules-generate/references/rule-types.md +1 -0
- package/skills/service-agentforce-channel-configure/SKILL.md +6 -3
- package/skills/service-agentforce-channel-configure/references/agent-wiring.md +5 -3
- package/skills/service-agentforce-channel-configure/references/channel-branch-email.md +24 -15
- package/skills/service-agentforce-channel-configure/references/input-validation.md +23 -0
- package/skills/service-agentforce-channel-configure/references/live-traffic-gate.md +13 -7
- package/skills/service-agentforce-channel-configure/references/queue-resolution.md +3 -1
- package/skills/service-agentforce-human-escalation-configure/references/_vendored/input-validation.md +23 -0
- package/skills/service-agentforce-human-escalation-configure/references/_vendored/queue-resolution.md +146 -0
- package/skills/service-agentforce-human-escalation-configure/references/escalation-mechanism.md +1 -1
- package/skills/service-agentforce-human-escalation-configure/scripts/tests/_bootstrap.py +42 -11
- package/skills/service-agentforce-human-escalation-configure/scripts/tests/test_escalation_contracts.py +45 -0
- package/skills/service-agentforce-human-escalation-configure/scripts/verify-and-configure.sh +23 -9
- package/skills/service-de-channel-activate/SKILL.md +10 -10
- package/skills/service-de-channel-activate/references/gotchas.md +4 -4
- package/skills/service-de-channel-activate/references/phone-verification.md +43 -19
- package/skills/service-de-channel-create/SKILL.md +1 -1
- package/skills/service-de-channel-create/references/facebook.md +1 -1
- package/skills/service-de-channel-create/references/whatsapp.md +33 -6
- package/skills/service-de-channel-routing-configure/SKILL.md +5 -1
- package/skills/service-de-channel-routing-configure/references/gotchas.md +3 -1
- package/skills/service-de-channel-routing-configure/references/named-queue.md +39 -0
- package/skills/service-de-channel-settings-configure/SKILL.md +3 -1
- package/skills/service-de-channel-settings-configure/references/channel-settings-facets.md +2 -2
- package/skills/service-de-channel-settings-configure/references/gotchas.md +12 -1
- package/skills/service-de-headless-channel-configure/SKILL.md +68 -74
- package/skills/service-de-headless-channel-configure/references/gotchas.md +6 -2
- package/skills/service-de-headless-channel-configure/references/inputs.md +19 -0
- package/skills/service-de-headless-channel-configure/references/output-envelopes.md +23 -1
- package/skills/service-de-headless-channel-configure/references/partial-success.md +1 -0
- package/skills/service-de-headless-channel-configure/references/requested-settings.md +55 -0
- package/skills/service-de-headless-channel-configure/references/worked-examples.md +35 -1
- package/skills/service-digital-engagement-channel-configure/SKILL.md +3 -3
- package/skills/service-digital-engagement-channel-configure/references/onboarding_contract.md +2 -2
- package/skills/service-digital-engagement-channel-configure/scripts/check-api-version.sh +1 -1
- package/skills/service-digital-engagement-deployment-configure/SKILL.md +2 -2
- package/skills/service-digital-engagement-deployment-configure/references/onboarding_contract.md +4 -2
- package/skills/service-digital-engagement-deployment-configure/scripts/check-api-version.sh +1 -1
- package/skills/service-omni-command-center-configure/SKILL.md +1 -1
- package/skills/data360-schema-get/SKILL.md +0 -388
- package/skills/data360-schema-get/references/README.md +0 -191
- package/skills/data360-schema-get/scripts/get_dlo_schema.py +0 -244
- package/skills/data360-schema-get/scripts/get_dmo_schema.py +0 -233
- package/skills/field-service-prework-brief-deployer-configure/SKILL.md +0 -646
- package/skills/field-service-voice-to-form-configure/SKILL.md +0 -650
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""
|
|
3
|
-
List all Data Lake Objects and retrieve schema for one DLO using REST API.
|
|
4
|
-
Uses SF CLI for authentication.
|
|
5
|
-
"""
|
|
6
|
-
|
|
7
|
-
import subprocess
|
|
8
|
-
import json
|
|
9
|
-
import sys
|
|
10
|
-
import requests
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def authenticate_to_org(org_alias):
|
|
14
|
-
"""
|
|
15
|
-
Authenticate to Salesforce org using SF CLI.
|
|
16
|
-
|
|
17
|
-
Args:
|
|
18
|
-
org_alias: SF CLI org alias (e.g., 'afvibe')
|
|
19
|
-
|
|
20
|
-
Returns:
|
|
21
|
-
Tuple of (instance_url, access_token, username)
|
|
22
|
-
"""
|
|
23
|
-
print(f"🔐 Authenticating to Salesforce org '{org_alias}'...")
|
|
24
|
-
|
|
25
|
-
try:
|
|
26
|
-
result = subprocess.run(
|
|
27
|
-
['sf', 'org', 'display', '--target-org', org_alias, '--json'],
|
|
28
|
-
capture_output=True,
|
|
29
|
-
text=True,
|
|
30
|
-
check=True
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
org_data = json.loads(result.stdout)
|
|
34
|
-
|
|
35
|
-
if org_data.get('status') != 0:
|
|
36
|
-
raise Exception(f"SF CLI returned error: {org_data}")
|
|
37
|
-
|
|
38
|
-
org_info = org_data['result']
|
|
39
|
-
|
|
40
|
-
if org_info.get('connectedStatus') != 'Connected':
|
|
41
|
-
raise Exception(f"Org '{org_alias}' is not connected. Run: sf org login web --alias {org_alias}")
|
|
42
|
-
|
|
43
|
-
instance_url = org_info['instanceUrl']
|
|
44
|
-
access_token = org_info['accessToken']
|
|
45
|
-
username = org_info.get('username', 'Unknown')
|
|
46
|
-
|
|
47
|
-
print(f"✅ Authenticated as: {username}")
|
|
48
|
-
print(f"📍 Instance: {instance_url}\n")
|
|
49
|
-
|
|
50
|
-
return instance_url, access_token, username
|
|
51
|
-
|
|
52
|
-
except subprocess.CalledProcessError as e:
|
|
53
|
-
raise Exception(f"SF CLI command failed: {e.stderr}")
|
|
54
|
-
except (json.JSONDecodeError, KeyError) as e:
|
|
55
|
-
raise Exception(f"Failed to parse SF CLI output: {e}")
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
def list_all_dlos(instance_url, access_token, api_version='v64.0'):
|
|
59
|
-
"""
|
|
60
|
-
List all Data Lake Objects using SSOT REST API.
|
|
61
|
-
|
|
62
|
-
Args:
|
|
63
|
-
instance_url: Salesforce instance URL
|
|
64
|
-
access_token: OAuth access token
|
|
65
|
-
api_version: API version (default: v64.0)
|
|
66
|
-
|
|
67
|
-
Returns:
|
|
68
|
-
List of DLO dictionaries
|
|
69
|
-
"""
|
|
70
|
-
url = f"{instance_url}/services/data/{api_version}/ssot/data-lake-objects"
|
|
71
|
-
|
|
72
|
-
headers = {
|
|
73
|
-
'Authorization': f'Bearer {access_token}',
|
|
74
|
-
'Content-Type': 'application/json',
|
|
75
|
-
'Accept': 'application/json'
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
print("📋 Fetching all Data Lake Objects...")
|
|
79
|
-
response = requests.get(url, headers=headers)
|
|
80
|
-
|
|
81
|
-
if response.status_code != 200:
|
|
82
|
-
raise Exception(f"API Error: HTTP {response.status_code}\n{response.text[:500]}")
|
|
83
|
-
|
|
84
|
-
response_data = response.json()
|
|
85
|
-
|
|
86
|
-
# Extract DLO list from paginated response
|
|
87
|
-
if isinstance(response_data, dict) and 'dataLakeObjects' in response_data:
|
|
88
|
-
dlos = response_data['dataLakeObjects']
|
|
89
|
-
total_size = response_data.get('totalSize', len(dlos))
|
|
90
|
-
print(f"✅ Found {len(dlos)} DLOs (Total: {total_size})\n")
|
|
91
|
-
else:
|
|
92
|
-
# Fallback if response format is different
|
|
93
|
-
dlos = response_data if isinstance(response_data, list) else []
|
|
94
|
-
print(f"✅ Found {len(dlos)} DLOs\n")
|
|
95
|
-
|
|
96
|
-
return dlos
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
def get_dlo_schema(instance_url, access_token, dlo_name, api_version='v64.0'):
|
|
100
|
-
"""
|
|
101
|
-
Get detailed schema for a specific DLO.
|
|
102
|
-
|
|
103
|
-
Args:
|
|
104
|
-
instance_url: Salesforce instance URL
|
|
105
|
-
access_token: OAuth access token
|
|
106
|
-
dlo_name: DLO developer name (e.g., 'Employee__dll')
|
|
107
|
-
api_version: API version (default: v64.0)
|
|
108
|
-
|
|
109
|
-
Returns:
|
|
110
|
-
DLO detail dictionary with full schema
|
|
111
|
-
"""
|
|
112
|
-
url = f"{instance_url}/services/data/{api_version}/ssot/data-lake-objects/{dlo_name}"
|
|
113
|
-
|
|
114
|
-
headers = {
|
|
115
|
-
'Authorization': f'Bearer {access_token}',
|
|
116
|
-
'Content-Type': 'application/json',
|
|
117
|
-
'Accept': 'application/json'
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
print(f"🔍 Fetching schema for DLO: {dlo_name}...")
|
|
121
|
-
response = requests.get(url, headers=headers)
|
|
122
|
-
|
|
123
|
-
if response.status_code != 200:
|
|
124
|
-
raise Exception(f"API Error: HTTP {response.status_code}\n{response.text[:500]}")
|
|
125
|
-
|
|
126
|
-
response_data = response.json()
|
|
127
|
-
|
|
128
|
-
# Extract DLO from paginated response
|
|
129
|
-
if isinstance(response_data, dict) and 'dataLakeObjects' in response_data:
|
|
130
|
-
dlos = response_data['dataLakeObjects']
|
|
131
|
-
if dlos:
|
|
132
|
-
return dlos[0] # Return first (should be only) DLO
|
|
133
|
-
else:
|
|
134
|
-
raise Exception(f"DLO '{dlo_name}' not found")
|
|
135
|
-
else:
|
|
136
|
-
# Fallback if response format is different
|
|
137
|
-
return response_data
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
def display_dlo_list(dlos):
|
|
141
|
-
"""Display summary of all DLOs."""
|
|
142
|
-
print("=" * 80)
|
|
143
|
-
print("📊 DATA LAKE OBJECTS")
|
|
144
|
-
print("=" * 80)
|
|
145
|
-
|
|
146
|
-
for idx, dlo in enumerate(dlos, 1):
|
|
147
|
-
print(f"\n{idx}. {dlo.get('name', 'Unknown')}")
|
|
148
|
-
print(f" Label: {dlo.get('label', 'N/A')}")
|
|
149
|
-
print(f" Category: {dlo.get('category', 'N/A')}")
|
|
150
|
-
if 'id' in dlo:
|
|
151
|
-
print(f" ID: {dlo['id']}")
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
def display_dlo_schema(dlo_detail):
|
|
155
|
-
"""Display detailed schema information for a DLO."""
|
|
156
|
-
print("\n" + "=" * 80)
|
|
157
|
-
print(f"🔍 SCHEMA DETAILS FOR: {dlo_detail.get('name')}")
|
|
158
|
-
print("=" * 80)
|
|
159
|
-
|
|
160
|
-
print(f"\n📝 Basic Information:")
|
|
161
|
-
print(f" Name: {dlo_detail.get('name')}")
|
|
162
|
-
print(f" Label: {dlo_detail.get('label')}")
|
|
163
|
-
print(f" Category: {dlo_detail.get('category')}")
|
|
164
|
-
print(f" Description: {dlo_detail.get('description', 'N/A')}")
|
|
165
|
-
|
|
166
|
-
if 'dataspaceInfo' in dlo_detail:
|
|
167
|
-
dataspaces = dlo_detail['dataspaceInfo']
|
|
168
|
-
dataspace_names = [ds.get('name', 'Unknown') for ds in dataspaces]
|
|
169
|
-
print(f" Dataspaces: {', '.join(dataspace_names)}")
|
|
170
|
-
|
|
171
|
-
# Display field schema
|
|
172
|
-
fields = dlo_detail.get('fields', [])
|
|
173
|
-
|
|
174
|
-
if fields:
|
|
175
|
-
print(f"\n🔧 Fields ({len(fields)} total):")
|
|
176
|
-
print("-" * 80)
|
|
177
|
-
|
|
178
|
-
# Show all fields with detailed info
|
|
179
|
-
for field in fields:
|
|
180
|
-
print(f"\n • {field.get('name')}")
|
|
181
|
-
print(f" Label: {field.get('label', 'N/A')}")
|
|
182
|
-
print(f" Data Type: {field.get('dataType', 'Unknown')}")
|
|
183
|
-
print(f" Primary Key: {field.get('isPrimaryKey', False)}")
|
|
184
|
-
print(f" Nullable: {field.get('isNullable', True)}")
|
|
185
|
-
|
|
186
|
-
if 'length' in field:
|
|
187
|
-
print(f" Length: {field['length']}")
|
|
188
|
-
if 'precision' in field:
|
|
189
|
-
print(f" Precision: {field['precision']}")
|
|
190
|
-
if 'scale' in field:
|
|
191
|
-
print(f" Scale: {field['scale']}")
|
|
192
|
-
else:
|
|
193
|
-
print("\n ⚠️ No fields found in schema")
|
|
194
|
-
|
|
195
|
-
# Show full JSON (optional, can be commented out)
|
|
196
|
-
print("\n" + "=" * 80)
|
|
197
|
-
print("📄 FULL SCHEMA (JSON):")
|
|
198
|
-
print("=" * 80)
|
|
199
|
-
print(json.dumps(dlo_detail, indent=2))
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
def main():
|
|
203
|
-
"""Main execution function."""
|
|
204
|
-
if len(sys.argv) < 2:
|
|
205
|
-
print("Usage: python list_dlos_and_schema.py <org_alias> [dlo_name]")
|
|
206
|
-
print("\nExamples:")
|
|
207
|
-
print(" python list_dlos_and_schema.py afvibe")
|
|
208
|
-
print(" python list_dlos_and_schema.py afvibe Employee__dll")
|
|
209
|
-
sys.exit(1)
|
|
210
|
-
|
|
211
|
-
org_alias = sys.argv[1]
|
|
212
|
-
specific_dlo = sys.argv[2] if len(sys.argv) > 2 else None
|
|
213
|
-
|
|
214
|
-
try:
|
|
215
|
-
# Step 1: Authenticate
|
|
216
|
-
instance_url, access_token, username = authenticate_to_org(org_alias)
|
|
217
|
-
|
|
218
|
-
# Step 2: List all DLOs
|
|
219
|
-
dlos = list_all_dlos(instance_url, access_token)
|
|
220
|
-
display_dlo_list(dlos)
|
|
221
|
-
|
|
222
|
-
# Step 3: Get schema for a specific DLO
|
|
223
|
-
if specific_dlo:
|
|
224
|
-
# User specified a DLO name
|
|
225
|
-
dlo_detail = get_dlo_schema(instance_url, access_token, specific_dlo)
|
|
226
|
-
display_dlo_schema(dlo_detail)
|
|
227
|
-
elif dlos:
|
|
228
|
-
# Get schema for the first DLO
|
|
229
|
-
first_dlo = dlos[0]
|
|
230
|
-
dlo_name = first_dlo.get('name')
|
|
231
|
-
dlo_detail = get_dlo_schema(instance_url, access_token, dlo_name)
|
|
232
|
-
display_dlo_schema(dlo_detail)
|
|
233
|
-
else:
|
|
234
|
-
print("\n⚠️ No DLOs found in this org")
|
|
235
|
-
|
|
236
|
-
print("\n✅ Done!")
|
|
237
|
-
|
|
238
|
-
except Exception as e:
|
|
239
|
-
print(f"\n❌ Error: {e}")
|
|
240
|
-
sys.exit(1)
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
if __name__ == '__main__':
|
|
244
|
-
main()
|
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""
|
|
3
|
-
List all Data Model Objects and retrieve schema for one DMO using REST API.
|
|
4
|
-
Uses SF CLI for authentication.
|
|
5
|
-
"""
|
|
6
|
-
|
|
7
|
-
import subprocess
|
|
8
|
-
import json
|
|
9
|
-
import sys
|
|
10
|
-
import requests
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def authenticate_to_org(org_alias):
|
|
14
|
-
"""
|
|
15
|
-
Authenticate to Salesforce org using SF CLI.
|
|
16
|
-
|
|
17
|
-
Args:
|
|
18
|
-
org_alias: SF CLI org alias (e.g., 'afvibe')
|
|
19
|
-
|
|
20
|
-
Returns:
|
|
21
|
-
Tuple of (instance_url, access_token, username)
|
|
22
|
-
"""
|
|
23
|
-
print(f"🔐 Authenticating to Salesforce org '{org_alias}'...")
|
|
24
|
-
|
|
25
|
-
try:
|
|
26
|
-
result = subprocess.run(
|
|
27
|
-
['sf', 'org', 'display', '--target-org', org_alias, '--json'],
|
|
28
|
-
capture_output=True,
|
|
29
|
-
text=True,
|
|
30
|
-
check=True
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
org_data = json.loads(result.stdout)
|
|
34
|
-
|
|
35
|
-
if org_data.get('status') != 0:
|
|
36
|
-
raise Exception(f"SF CLI returned error: {org_data}")
|
|
37
|
-
|
|
38
|
-
org_info = org_data['result']
|
|
39
|
-
|
|
40
|
-
if org_info.get('connectedStatus') != 'Connected':
|
|
41
|
-
raise Exception(f"Org '{org_alias}' is not connected. Run: sf org login web --alias {org_alias}")
|
|
42
|
-
|
|
43
|
-
instance_url = org_info['instanceUrl']
|
|
44
|
-
access_token = org_info['accessToken']
|
|
45
|
-
username = org_info.get('username', 'Unknown')
|
|
46
|
-
|
|
47
|
-
print(f"✅ Authenticated as: {username}")
|
|
48
|
-
print(f"📍 Instance: {instance_url}\n")
|
|
49
|
-
|
|
50
|
-
return instance_url, access_token, username
|
|
51
|
-
|
|
52
|
-
except subprocess.CalledProcessError as e:
|
|
53
|
-
raise Exception(f"SF CLI command failed: {e.stderr}")
|
|
54
|
-
except (json.JSONDecodeError, KeyError) as e:
|
|
55
|
-
raise Exception(f"Failed to parse SF CLI output: {e}")
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
def list_all_dmos(instance_url, access_token, api_version='v64.0'):
|
|
59
|
-
"""
|
|
60
|
-
List all Data Model Objects using SSOT REST API.
|
|
61
|
-
|
|
62
|
-
Args:
|
|
63
|
-
instance_url: Salesforce instance URL
|
|
64
|
-
access_token: OAuth access token
|
|
65
|
-
api_version: API version (default: v64.0)
|
|
66
|
-
|
|
67
|
-
Returns:
|
|
68
|
-
List of DMO dictionaries
|
|
69
|
-
"""
|
|
70
|
-
url = f"{instance_url}/services/data/{api_version}/ssot/data-model-objects"
|
|
71
|
-
|
|
72
|
-
headers = {
|
|
73
|
-
'Authorization': f'Bearer {access_token}',
|
|
74
|
-
'Content-Type': 'application/json',
|
|
75
|
-
'Accept': 'application/json'
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
print("📋 Fetching all Data Model Objects...")
|
|
79
|
-
response = requests.get(url, headers=headers)
|
|
80
|
-
|
|
81
|
-
if response.status_code != 200:
|
|
82
|
-
raise Exception(f"API Error: HTTP {response.status_code}\n{response.text[:500]}")
|
|
83
|
-
|
|
84
|
-
response_data = response.json()
|
|
85
|
-
|
|
86
|
-
# Extract DMO list from paginated response
|
|
87
|
-
if isinstance(response_data, dict) and 'dataModelObject' in response_data:
|
|
88
|
-
dmos = response_data['dataModelObject']
|
|
89
|
-
total_size = response_data.get('totalSize', len(dmos))
|
|
90
|
-
print(f"✅ Found {len(dmos)} DMOs (Total: {total_size})\n")
|
|
91
|
-
else:
|
|
92
|
-
# Fallback if response format is different
|
|
93
|
-
dmos = response_data if isinstance(response_data, list) else []
|
|
94
|
-
print(f"✅ Found {len(dmos)} DMOs\n")
|
|
95
|
-
|
|
96
|
-
return dmos
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
def get_dmo_schema(instance_url, access_token, dmo_name, api_version='v64.0'):
|
|
100
|
-
"""
|
|
101
|
-
Get detailed schema for a specific DMO.
|
|
102
|
-
|
|
103
|
-
Args:
|
|
104
|
-
instance_url: Salesforce instance URL
|
|
105
|
-
access_token: OAuth access token
|
|
106
|
-
dmo_name: DMO developer name (e.g., 'Individual__dlm')
|
|
107
|
-
api_version: API version (default: v64.0)
|
|
108
|
-
|
|
109
|
-
Returns:
|
|
110
|
-
DMO detail dictionary with full schema
|
|
111
|
-
"""
|
|
112
|
-
url = f"{instance_url}/services/data/{api_version}/ssot/data-model-objects/{dmo_name}"
|
|
113
|
-
|
|
114
|
-
headers = {
|
|
115
|
-
'Authorization': f'Bearer {access_token}',
|
|
116
|
-
'Content-Type': 'application/json',
|
|
117
|
-
'Accept': 'application/json'
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
print(f"🔍 Fetching schema for DMO: {dmo_name}...")
|
|
121
|
-
response = requests.get(url, headers=headers)
|
|
122
|
-
|
|
123
|
-
if response.status_code != 200:
|
|
124
|
-
raise Exception(f"API Error: HTTP {response.status_code}\n{response.text[:500]}")
|
|
125
|
-
|
|
126
|
-
response_data = response.json()
|
|
127
|
-
|
|
128
|
-
# Single DMO endpoint returns the object directly (not wrapped in an array)
|
|
129
|
-
return response_data
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
def display_dmo_list(dmos):
|
|
133
|
-
"""Display summary of all DMOs."""
|
|
134
|
-
print("=" * 80)
|
|
135
|
-
print("📊 DATA MODEL OBJECTS")
|
|
136
|
-
print("=" * 80)
|
|
137
|
-
|
|
138
|
-
for idx, dmo in enumerate(dmos, 1):
|
|
139
|
-
print(f"\n{idx}. {dmo.get('name', 'Unknown')}")
|
|
140
|
-
print(f" Label: {dmo.get('label', 'N/A')}")
|
|
141
|
-
print(f" Category: {dmo.get('category', 'N/A')}")
|
|
142
|
-
print(f" Creation Type: {dmo.get('creationType', 'N/A')}")
|
|
143
|
-
print(f" Data Space: {dmo.get('dataSpaceName', 'N/A')}")
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
def display_dmo_schema(dmo_detail):
|
|
147
|
-
"""Display detailed schema information for a DMO."""
|
|
148
|
-
print("\n" + "=" * 80)
|
|
149
|
-
print(f"🔍 SCHEMA DETAILS FOR: {dmo_detail.get('name')}")
|
|
150
|
-
print("=" * 80)
|
|
151
|
-
|
|
152
|
-
print(f"\n📝 Basic Information:")
|
|
153
|
-
print(f" Name: {dmo_detail.get('name')}")
|
|
154
|
-
print(f" Label: {dmo_detail.get('label')}")
|
|
155
|
-
print(f" Category: {dmo_detail.get('category')}")
|
|
156
|
-
print(f" Creation Type: {dmo_detail.get('creationType', 'N/A')}")
|
|
157
|
-
print(f" Data Space: {dmo_detail.get('dataSpaceName', 'N/A')}")
|
|
158
|
-
|
|
159
|
-
# Display field schema
|
|
160
|
-
fields = dmo_detail.get('fields', [])
|
|
161
|
-
|
|
162
|
-
if fields:
|
|
163
|
-
print(f"\n🔧 Fields ({len(fields)} total):")
|
|
164
|
-
print("-" * 80)
|
|
165
|
-
|
|
166
|
-
# Show all fields with detailed info
|
|
167
|
-
for field in fields:
|
|
168
|
-
print(f"\n • {field.get('name')}")
|
|
169
|
-
print(f" Label: {field.get('label', 'N/A')}")
|
|
170
|
-
print(f" Data Type: {field.get('type', 'Unknown')}")
|
|
171
|
-
print(f" Primary Key: {field.get('isPrimaryKey', False)}")
|
|
172
|
-
print(f" Creation Type: {field.get('creationType', 'N/A')}")
|
|
173
|
-
print(f" Usage Tag: {field.get('usageTag', 'N/A')}")
|
|
174
|
-
|
|
175
|
-
if 'length' in field:
|
|
176
|
-
print(f" Length: {field['length']}")
|
|
177
|
-
if 'precision' in field:
|
|
178
|
-
print(f" Precision: {field['precision']}")
|
|
179
|
-
if 'scale' in field:
|
|
180
|
-
print(f" Scale: {field['scale']}")
|
|
181
|
-
else:
|
|
182
|
-
print("\n ⚠️ No fields found in schema")
|
|
183
|
-
|
|
184
|
-
# Show full JSON
|
|
185
|
-
print("\n" + "=" * 80)
|
|
186
|
-
print("📄 FULL SCHEMA (JSON):")
|
|
187
|
-
print("=" * 80)
|
|
188
|
-
print(json.dumps(dmo_detail, indent=2))
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
def main():
|
|
192
|
-
"""Main execution function."""
|
|
193
|
-
if len(sys.argv) < 2:
|
|
194
|
-
print("Usage: python get_dmo_schema.py <org_alias> [dmo_name]")
|
|
195
|
-
print("\nExamples:")
|
|
196
|
-
print(" python get_dmo_schema.py afvibe")
|
|
197
|
-
print(" python get_dmo_schema.py afvibe Individual__dlm")
|
|
198
|
-
sys.exit(1)
|
|
199
|
-
|
|
200
|
-
org_alias = sys.argv[1]
|
|
201
|
-
specific_dmo = sys.argv[2] if len(sys.argv) > 2 else None
|
|
202
|
-
|
|
203
|
-
try:
|
|
204
|
-
# Step 1: Authenticate
|
|
205
|
-
instance_url, access_token, username = authenticate_to_org(org_alias)
|
|
206
|
-
|
|
207
|
-
# Step 2: List all DMOs
|
|
208
|
-
dmos = list_all_dmos(instance_url, access_token)
|
|
209
|
-
display_dmo_list(dmos)
|
|
210
|
-
|
|
211
|
-
# Step 3: Get schema for a specific DMO
|
|
212
|
-
if specific_dmo:
|
|
213
|
-
# User specified a DMO name
|
|
214
|
-
dmo_detail = get_dmo_schema(instance_url, access_token, specific_dmo)
|
|
215
|
-
display_dmo_schema(dmo_detail)
|
|
216
|
-
elif dmos:
|
|
217
|
-
# Get schema for the first DMO
|
|
218
|
-
first_dmo = dmos[0]
|
|
219
|
-
dmo_name = first_dmo.get('name')
|
|
220
|
-
dmo_detail = get_dmo_schema(instance_url, access_token, dmo_name)
|
|
221
|
-
display_dmo_schema(dmo_detail)
|
|
222
|
-
else:
|
|
223
|
-
print("\n⚠️ No DMOs found in this org")
|
|
224
|
-
|
|
225
|
-
print("\n✅ Done!")
|
|
226
|
-
|
|
227
|
-
except Exception as e:
|
|
228
|
-
print(f"\n❌ Error: {e}")
|
|
229
|
-
sys.exit(1)
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
if __name__ == '__main__':
|
|
233
|
-
main()
|