@salesforce/afv-skills 1.30.0 → 1.32.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/agentforce-bot-upgrade/SKILL.md +217 -0
- package/skills/agentforce-bot-upgrade/references/extraction-blueprint.md +242 -0
- package/skills/agentforce-bot-upgrade/references/generate-agent-spec.md +128 -0
- package/skills/agentforce-bot-upgrade/references/handoff-output-format.md +208 -0
- package/skills/agentforce-bot-upgrade/references/input-contract.md +101 -0
- package/skills/agentforce-bot-upgrade/references/mapping-rules.md +113 -0
- package/skills/agentforce-bot-upgrade/references/planner-workflow-reference.md +78 -0
- package/skills/agentforce-bot-upgrade/references/post-conversion-enhancements-reference.md +67 -0
- package/skills/agentforce-bot-upgrade/references/quality-checklist.md +33 -0
- package/skills/agentforce-bot-upgrade/references/sf-cli-bot-reference.md +116 -0
- package/skills/data360-code-extension-generate/SKILL.md +15 -2
- package/skills/dx-devops-work-item-manage/SKILL.md +270 -0
- package/skills/dx-devops-work-item-manage/examples/common-workflows.md +479 -0
- package/skills/dx-devops-work-item-manage/references/cli-commands.md +476 -0
- package/skills/dx-org-manage/SKILL.md +8 -5
- package/skills/dx-org-trial-expiration-check/SKILL.md +239 -0
- package/skills/dx-org-trial-expiration-check/scripts/check_expiration.sh +588 -0
- package/skills/dx-pkg-post-install-configure/SKILL.md +184 -0
- package/skills/experience-ui-bundle-app-coordinate/SKILL.md +202 -35
- package/skills/experience-ui-bundle-app-coordinate/scripts/check-hosting-target.sh +26 -0
- package/skills/experience-ui-bundle-app-coordinate/scripts/check-sfdx-project.sh +15 -0
- package/skills/experience-ui-bundle-custom-app-generate/SKILL.md +29 -5
- package/skills/experience-ui-bundle-custom-app-generate/references/configure-metadata-custom-application.md +1 -1
- package/skills/experience-ui-bundle-custom-app-generate/scripts/resolve-uibundle-path.sh +30 -0
- package/skills/experience-ui-bundle-features-generate/SKILL.md +86 -11
- package/skills/experience-ui-bundle-features-generate/references/conflict-resolution-schema.json +20 -0
- package/skills/experience-ui-bundle-features-generate/scripts/verify-react-bundle.sh +14 -0
- package/skills/experience-ui-bundle-frontend-generate/SKILL.md +6 -1
- package/skills/experience-ui-bundle-frontend-generate/references/component.md +34 -1
- package/skills/experience-ui-bundle-frontend-generate/references/page.md +1 -1
- package/skills/experience-ui-bundle-metadata-generate/SKILL.md +19 -8
- package/skills/experience-ui-bundle-metadata-generate/references/csp-metadata-format.md +2 -2
- package/skills/experience-ui-bundle-metadata-generate/scripts/check-api-version.sh +30 -0
- package/skills/experience-ui-bundle-project-generate/SKILL.md +111 -0
- package/skills/experience-ui-bundle-project-generate/scripts/flatten-project.mjs +33 -0
- package/skills/platform-custom-field-generate/SKILL.md +12 -11
- package/skills/platform-custom-field-generate/references/advanced-picklists.md +17 -17
- package/skills/platform-custom-lightning-type-generate/SKILL.md +9 -14
- package/skills/platform-custom-lightning-type-generate/references/widget-rendition.md +27 -111
- package/skills/platform-custom-report-type-generate/SKILL.md +259 -0
- package/skills/platform-custom-report-type-generate/examples/AccountProjectsWithTasks.reportType-meta.xml +51 -0
- package/skills/platform-custom-report-type-generate/examples/AccountsWithIndustry.reportType-meta.xml +27 -0
- package/skills/platform-custom-report-type-generate/examples/AccountsWithProjects.reportType-meta.xml +44 -0
- package/skills/platform-custom-report-type-generate/references/category-values.md +32 -0
- package/skills/platform-custom-report-type-generate/references/errors-and-troubleshooting.md +24 -0
- package/skills/platform-dataspace-access-configure/SKILL.md +318 -0
- package/skills/platform-docs-get/SKILL.md +4 -0
- package/skills/platform-docs-get/scripts/extract_salesforce_doc.py +78 -13
- package/skills/platform-encryption-configure/SKILL.md +122 -0
- package/skills/platform-encryption-configure/assets/EncryptionKey.settings-meta.xml +17 -0
- package/skills/platform-encryption-configure/assets/PlatformEncryption.settings-meta.xml +15 -0
- package/skills/platform-encryption-configure/assets/encrypted-field.field-meta.xml +22 -0
- package/skills/platform-encryption-configure/examples/cache-only-keys.settings-meta.xml +11 -0
- package/skills/platform-encryption-configure/references/encryption-schemes.md +34 -0
- package/skills/platform-encryption-configure/references/key-models.md +34 -0
- package/skills/platform-encryption-configure/references/tenant-secret-lifecycle.md +23 -0
- package/skills/platform-encryption-configure/scripts/validate-encryption-metadata.sh +54 -0
- package/skills/platform-lightning-type-widget-coordinate/SKILL.md +214 -0
- package/skills/platform-lightning-type-widget-coordinate/examples/existing-lightning-type-with-widget-prompt.md +80 -0
- package/skills/platform-lightning-type-widget-coordinate/examples/new-lightning-type-with-widget-prompt.md +75 -0
- package/skills/platform-lightning-type-widget-coordinate/references/build-plan-format.md +67 -0
- package/skills/platform-lightning-type-widget-coordinate/references/lightning-type-discovery.md +124 -0
- package/skills/platform-lightning-type-widget-coordinate/references/validation-gates.md +130 -0
- package/skills/platform-metadata-api-context-get/SKILL.md +13 -10
- package/skills/platform-sharing-owd-configure/SKILL.md +142 -0
- package/skills/platform-sharing-owd-configure/examples/get_owd_output.md +38 -0
- package/skills/platform-sharing-owd-configure/examples/update_owd_output.md +44 -0
- package/skills/platform-sharing-owd-configure/references/access_levels.md +49 -0
- package/skills/platform-sharing-owd-configure/references/metadata_api_approach.md +69 -0
- package/skills/platform-sharing-rules-generate/SKILL.md +89 -19
- package/skills/platform-sharing-rules-generate/examples/test-cases.md +381 -0
- package/skills/platform-widget-generate/SKILL.md +241 -0
- package/skills/platform-widget-generate/examples/conditional.json +73 -0
- package/skills/platform-widget-generate/examples/list-with-foreach.json +66 -0
- package/skills/platform-widget-generate/examples/single-object.json +64 -0
- package/skills/platform-widget-generate/references/schema-from-lightning-type.md +76 -0
- package/skills/platform-widget-generate/references/widget-bundle-layout.md +116 -0
- package/skills/platform-widget-generate/references/widget-meta-directives.md +130 -0
- package/skills/sales-agentforce-pipeline-management-configure/SKILL.md +268 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/field-completion-template.genAiPromptTemplate-meta.xml +141 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/pipeline_management_flow.flow-meta.xml +548 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/sales_management_agent.agent +2938 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/sales_management_agent.bundle-meta.xml +4 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/sfdx-project.json +12 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/stage-descriptions/bant.txt +11 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/stage-descriptions/meddic.txt +11 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/stage-descriptions/spiced.txt +11 -0
- package/skills/sales-agentforce-pipeline-management-configure/examples/custom-prompt-instructions.md +317 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/admin-communication.md +355 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/agent-creation.md +383 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/auth-and-cli.md +146 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/automation-matrix.md +23 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/autonomous-updates.md +215 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/canonical-agent-path.md +75 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/data-sources.md +155 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/field-completion-prompt-template.md +120 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/field-completion-prompts.md +149 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/flags.md +13 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/flow-clone-from-template.md +447 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/metadata-inventory.md +330 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/opportunity-stages.md +246 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/repair-diagnostics.md +265 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/setup-order.md +263 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/soap-api-enablement.md +528 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/CHANGES.md +180 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/README.md +56 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/add-field-suggestion.sh +679 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/create-agent.sh +302 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/create-flow.sh +250 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/define-agent-access.sh +430 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/deploy-settings.sh +77 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/enable-deal-agent.sh +241 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/enable-prerequisites.sh +538 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/flow-debug-and-verify.sh +385 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/retrieve-settings.sh +131 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/setup-all.sh +2791 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/agent-bundle-publish.sh +189 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/agent-detection.sh +239 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/flow-builder.sh +238 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/psg.sh +48 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/soap.sh +140 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/stage-descriptions.sh +448 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/test-opp.sh +166 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/verify-all.sh +636 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/verify-prompt-generation.sh +346 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Enable Pipeline Management (SalesDealAgentSettings) via SOAP API
|
|
4
|
+
# Usage: ./enable-deal-agent.sh <org-alias>
|
|
5
|
+
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
|
|
8
|
+
# sf CLI can emit ANSI color codes inside --json stdout, breaking jq parsing.
|
|
9
|
+
# 2>/dev/null only strips stderr; these env vars are the reliable fix (see PM notes).
|
|
10
|
+
export NO_COLOR=1
|
|
11
|
+
export FORCE_COLOR=0
|
|
12
|
+
|
|
13
|
+
ORG_ALIAS="${1:-}"
|
|
14
|
+
|
|
15
|
+
if [[ -z "$ORG_ALIAS" ]]; then
|
|
16
|
+
echo "❌ Error: Missing org alias"
|
|
17
|
+
echo "Usage: $0 <org-alias>"
|
|
18
|
+
exit 1
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
echo "🚀 Enabling Pipeline Management for org: $ORG_ALIAS"
|
|
22
|
+
echo ""
|
|
23
|
+
|
|
24
|
+
# Get org details
|
|
25
|
+
ORG_INFO=$(sf org display --target-org "$ORG_ALIAS" --json 2>/dev/null)
|
|
26
|
+
ORG_ID=$(echo "$ORG_INFO" | jq -r '.result.id')
|
|
27
|
+
INSTANCE_URL=$(echo "$ORG_INFO" | jq -r '.result.instanceUrl')
|
|
28
|
+
ACCESS_TOKEN=$(echo "$ORG_INFO" | jq -r '.result.accessToken')
|
|
29
|
+
|
|
30
|
+
# Newer CLI versions redact accessToken — use show-access-token fallback
|
|
31
|
+
if [[ -z "$ACCESS_TOKEN" || "$ACCESS_TOKEN" == "null" || "$ACCESS_TOKEN" == *"REDACTED"* ]]; then
|
|
32
|
+
ACCESS_TOKEN=$(echo "y" | sf org auth show-access-token --target-org "$ORG_ALIAS" --no-prompt --json 2>/dev/null | jq -r '.result.accessToken // empty')
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
if [[ -z "$ORG_ID" || -z "$INSTANCE_URL" || -z "$ACCESS_TOKEN" || "$ACCESS_TOKEN" == "null" ]]; then
|
|
36
|
+
echo "Error: Could not retrieve org details. Is the org authenticated?"
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
echo "Org ID: $ORG_ID"
|
|
41
|
+
echo "Instance URL: $INSTANCE_URL"
|
|
42
|
+
echo ""
|
|
43
|
+
|
|
44
|
+
# Pre-flight checks
|
|
45
|
+
echo "🔍 Running pre-flight checks..."
|
|
46
|
+
echo ""
|
|
47
|
+
|
|
48
|
+
PREFLIGHT_FAILED=false
|
|
49
|
+
|
|
50
|
+
# Check Einstein GPT is enabled (critical) — via SOAP readMetadata
|
|
51
|
+
GENAI_CHECK=$(curl -s "${INSTANCE_URL}/services/Soap/m/64.0" \
|
|
52
|
+
-H "Content-Type: text/xml; charset=UTF-8" \
|
|
53
|
+
-H "SOAPAction: readMetadata" \
|
|
54
|
+
-d "<?xml version='1.0' encoding='utf-8'?>
|
|
55
|
+
<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
|
|
56
|
+
<soapenv:Header><met:SessionHeader><met:sessionId>${ACCESS_TOKEN}</met:sessionId></met:SessionHeader></soapenv:Header>
|
|
57
|
+
<soapenv:Body><met:readMetadata><met:type>EinsteinGptSettings</met:type><met:fullNames>EinsteinGpt</met:fullNames></met:readMetadata></soapenv:Body>
|
|
58
|
+
</soapenv:Envelope>" 2>/dev/null | grep -o "<enableEinsteinGptPlatform>[^<]*" | grep -o "true\|false" || echo "")
|
|
59
|
+
|
|
60
|
+
if [[ "$GENAI_CHECK" == "true" ]]; then
|
|
61
|
+
echo " ✅ Einstein GPT enabled"
|
|
62
|
+
else
|
|
63
|
+
echo " ❌ Einstein GPT NOT enabled (required)"
|
|
64
|
+
PREFLIGHT_FAILED=true
|
|
65
|
+
fi
|
|
66
|
+
|
|
67
|
+
# Check Agentforce Agent is enabled (required) — via SOAP readMetadata
|
|
68
|
+
COPILOT_CHECK=$(curl -s "${INSTANCE_URL}/services/Soap/m/64.0" \
|
|
69
|
+
-H "Content-Type: text/xml; charset=UTF-8" \
|
|
70
|
+
-H "SOAPAction: readMetadata" \
|
|
71
|
+
-d "<?xml version='1.0' encoding='utf-8'?>
|
|
72
|
+
<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
|
|
73
|
+
<soapenv:Header><met:SessionHeader><met:sessionId>${ACCESS_TOKEN}</met:sessionId></met:SessionHeader></soapenv:Header>
|
|
74
|
+
<soapenv:Body><met:readMetadata><met:type>EinsteinCopilotSettings</met:type><met:fullNames>EinsteinCopilot</met:fullNames></met:readMetadata></soapenv:Body>
|
|
75
|
+
</soapenv:Envelope>" 2>/dev/null | grep -o "<enableEinsteinGptCopilot>[^<]*" | grep -o "true\|false" || echo "")
|
|
76
|
+
|
|
77
|
+
if [[ "$COPILOT_CHECK" == "true" ]]; then
|
|
78
|
+
echo " ✅ Agentforce Agent enabled"
|
|
79
|
+
else
|
|
80
|
+
echo " ❌ Agentforce Agent NOT enabled (required)"
|
|
81
|
+
PREFLIGHT_FAILED=true
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
# Check Agentforce Studio / Agent Platform is enabled (required) — via SOAP readMetadata.
|
|
85
|
+
# AgentPlatformSettings.enableAgentPlatform (OrgPreference AgentPlatformEnabled) gates
|
|
86
|
+
# SalesDealAgentSettings: core's DealAgentEnabledOrgPreference validates the Agentforce
|
|
87
|
+
# Platform preference and rejects Deal Agent enablement if it is off, so this must pass
|
|
88
|
+
# before we attempt the SalesDealAgent update below.
|
|
89
|
+
AGENT_PLATFORM_CHECK=$(curl -s "${INSTANCE_URL}/services/Soap/m/64.0" \
|
|
90
|
+
-H "Content-Type: text/xml; charset=UTF-8" \
|
|
91
|
+
-H "SOAPAction: readMetadata" \
|
|
92
|
+
-d "<?xml version='1.0' encoding='utf-8'?>
|
|
93
|
+
<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
|
|
94
|
+
<soapenv:Header><met:SessionHeader><met:sessionId>${ACCESS_TOKEN}</met:sessionId></met:SessionHeader></soapenv:Header>
|
|
95
|
+
<soapenv:Body><met:readMetadata><met:type>AgentPlatformSettings</met:type><met:fullNames>AgentPlatform</met:fullNames></met:readMetadata></soapenv:Body>
|
|
96
|
+
</soapenv:Envelope>" 2>/dev/null | grep -o "<enableAgentPlatform>[^<]*" | grep -o "true\|false" || echo "")
|
|
97
|
+
|
|
98
|
+
if [[ "$AGENT_PLATFORM_CHECK" == "true" ]]; then
|
|
99
|
+
echo " ✅ Agentforce Studio (Agent Platform) enabled"
|
|
100
|
+
else
|
|
101
|
+
echo " ❌ Agentforce Studio (Agent Platform) NOT enabled (required — gates Deal Agent)"
|
|
102
|
+
PREFLIGHT_FAILED=true
|
|
103
|
+
fi
|
|
104
|
+
|
|
105
|
+
# Check Enhanced Notes (required dependency) — via SOAP readMetadata
|
|
106
|
+
NOTES_CHECK=$(curl -s "${INSTANCE_URL}/services/Soap/m/64.0" \
|
|
107
|
+
-H "Content-Type: text/xml; charset=UTF-8" \
|
|
108
|
+
-H "SOAPAction: readMetadata" \
|
|
109
|
+
-d "<?xml version='1.0' encoding='utf-8'?>
|
|
110
|
+
<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
|
|
111
|
+
<soapenv:Header><met:SessionHeader><met:sessionId>${ACCESS_TOKEN}</met:sessionId></met:SessionHeader></soapenv:Header>
|
|
112
|
+
<soapenv:Body><met:readMetadata><met:type>EnhancedNotesSettings</met:type><met:fullNames>EnhancedNotes</met:fullNames></met:readMetadata></soapenv:Body>
|
|
113
|
+
</soapenv:Envelope>" 2>/dev/null | grep -o "<enableEnhancedNotes>[^<]*" | grep -o "true\|false" || echo "")
|
|
114
|
+
|
|
115
|
+
if [[ "$NOTES_CHECK" == "true" ]]; then
|
|
116
|
+
echo " ✅ Enhanced Notes enabled"
|
|
117
|
+
else
|
|
118
|
+
echo " ❌ Enhanced Notes NOT enabled (required)"
|
|
119
|
+
PREFLIGHT_FAILED=true
|
|
120
|
+
fi
|
|
121
|
+
|
|
122
|
+
# Check org edition compatibility
|
|
123
|
+
ORG_EDITION=$(sf data query --query "SELECT OrganizationType FROM Organization" --target-org "$ORG_ALIAS" --json 2>/dev/null | jq -r '.result.records[0].OrganizationType')
|
|
124
|
+
echo " ℹ️ Org Edition: $ORG_EDITION"
|
|
125
|
+
|
|
126
|
+
if [[ "$ORG_EDITION" == "Developer Edition" ]]; then
|
|
127
|
+
echo " ⚠️ Warning: Pipeline Management may have limited functionality in Developer Edition"
|
|
128
|
+
fi
|
|
129
|
+
|
|
130
|
+
echo ""
|
|
131
|
+
|
|
132
|
+
if [[ "$PREFLIGHT_FAILED" == "true" ]]; then
|
|
133
|
+
echo "❌ Pre-flight checks failed. Run ./enable-prerequisites.sh first."
|
|
134
|
+
exit 1
|
|
135
|
+
fi
|
|
136
|
+
|
|
137
|
+
echo "✅ Pre-flight checks passed"
|
|
138
|
+
echo ""
|
|
139
|
+
|
|
140
|
+
# Check if already enabled (via SOAP readMetadata — SalesDealAgentSettings is NOT queryable via SOQL)
|
|
141
|
+
echo -n "Checking current SalesDealAgent status... "
|
|
142
|
+
CURRENT_STATUS=$(curl -s "${INSTANCE_URL}/services/Soap/m/64.0" \
|
|
143
|
+
-H "Content-Type: text/xml; charset=UTF-8" \
|
|
144
|
+
-H "SOAPAction: readMetadata" \
|
|
145
|
+
-d "<?xml version='1.0' encoding='utf-8'?>
|
|
146
|
+
<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
|
|
147
|
+
<soapenv:Header><met:SessionHeader><met:sessionId>${ACCESS_TOKEN}</met:sessionId></met:SessionHeader></soapenv:Header>
|
|
148
|
+
<soapenv:Body><met:readMetadata><met:type>SalesDealAgentSettings</met:type><met:fullNames>SalesDealAgent</met:fullNames></met:readMetadata></soapenv:Body>
|
|
149
|
+
</soapenv:Envelope>" 2>/dev/null | grep -o "<enableDealAgent>[^<]*" | grep -o "true\|false" || echo "")
|
|
150
|
+
|
|
151
|
+
if [[ "$CURRENT_STATUS" == "true" ]]; then
|
|
152
|
+
echo "✅ (already enabled)"
|
|
153
|
+
echo ""
|
|
154
|
+
echo "✅ Pipeline Management is already enabled"
|
|
155
|
+
exit 0
|
|
156
|
+
fi
|
|
157
|
+
|
|
158
|
+
echo "⏳ (not enabled)"
|
|
159
|
+
echo ""
|
|
160
|
+
|
|
161
|
+
# Enable via SOAP API v64.0
|
|
162
|
+
echo "Enabling Pipeline Management via SOAP API v64.0..."
|
|
163
|
+
echo ""
|
|
164
|
+
|
|
165
|
+
SOAP_REQUEST=$(cat <<'EOF'
|
|
166
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
167
|
+
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:met="http://soap.sforce.com/2006/04/metadata">
|
|
168
|
+
<soapenv:Header>
|
|
169
|
+
<met:SessionHeader>
|
|
170
|
+
<met:sessionId>{{ACCESS_TOKEN}}</met:sessionId>
|
|
171
|
+
</met:SessionHeader>
|
|
172
|
+
</soapenv:Header>
|
|
173
|
+
<soapenv:Body>
|
|
174
|
+
<met:updateMetadata>
|
|
175
|
+
<met:metadata xsi:type="met:SalesDealAgentSettings" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
176
|
+
<met:fullName>SalesDealAgent</met:fullName>
|
|
177
|
+
<met:enableDealAgent>true</met:enableDealAgent>
|
|
178
|
+
<met:enableDealAgentAutoApproveAllTasks>false</met:enableDealAgentAutoApproveAllTasks>
|
|
179
|
+
</met:metadata>
|
|
180
|
+
</met:updateMetadata>
|
|
181
|
+
</soapenv:Body>
|
|
182
|
+
</soapenv:Envelope>
|
|
183
|
+
EOF
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
# Substitute access token
|
|
187
|
+
SOAP_REQUEST="${SOAP_REQUEST//\{\{ACCESS_TOKEN\}\}/$ACCESS_TOKEN}"
|
|
188
|
+
|
|
189
|
+
# Send SOAP request
|
|
190
|
+
RESPONSE=$(curl -s -X POST "${INSTANCE_URL}/services/Soap/m/64.0" \
|
|
191
|
+
-H "Content-Type: text/xml; charset=utf-8" \
|
|
192
|
+
-H "SOAPAction: update" \
|
|
193
|
+
-d "$SOAP_REQUEST")
|
|
194
|
+
|
|
195
|
+
# Check response
|
|
196
|
+
if echo "$RESPONSE" | grep -q "<success>true</success>"; then
|
|
197
|
+
echo "✅ SOAP API call succeeded"
|
|
198
|
+
else
|
|
199
|
+
echo "❌ SOAP API call failed"
|
|
200
|
+
echo ""
|
|
201
|
+
echo "Response:"
|
|
202
|
+
echo "$RESPONSE"
|
|
203
|
+
exit 1
|
|
204
|
+
fi
|
|
205
|
+
|
|
206
|
+
echo ""
|
|
207
|
+
|
|
208
|
+
# Verify enablement (via SOAP readMetadata)
|
|
209
|
+
echo "🔍 Verifying Pipeline Management is enabled..."
|
|
210
|
+
sleep 2 # Brief wait for propagation
|
|
211
|
+
|
|
212
|
+
VERIFY_RESULT=$(curl -s "${INSTANCE_URL}/services/Soap/m/64.0" \
|
|
213
|
+
-H "Content-Type: text/xml; charset=UTF-8" \
|
|
214
|
+
-H "SOAPAction: readMetadata" \
|
|
215
|
+
-d "<?xml version='1.0' encoding='utf-8'?>
|
|
216
|
+
<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
|
|
217
|
+
<soapenv:Header><met:SessionHeader><met:sessionId>${ACCESS_TOKEN}</met:sessionId></met:SessionHeader></soapenv:Header>
|
|
218
|
+
<soapenv:Body><met:readMetadata><met:type>SalesDealAgentSettings</met:type><met:fullNames>SalesDealAgent</met:fullNames></met:readMetadata></soapenv:Body>
|
|
219
|
+
</soapenv:Envelope>" 2>/dev/null)
|
|
220
|
+
|
|
221
|
+
VERIFY_DEAL_AGENT=$(echo "$VERIFY_RESULT" | grep -o "<enableDealAgent>[^<]*" | grep -o "true\|false" || echo "")
|
|
222
|
+
|
|
223
|
+
if [[ "$VERIFY_DEAL_AGENT" == "true" ]]; then
|
|
224
|
+
echo " ✅ enableDealAgent: true"
|
|
225
|
+
|
|
226
|
+
AUTO_APPROVE=$(echo "$VERIFY_RESULT" | grep -o "<enableDealAgentAutoApproveAllTasks>[^<]*" | grep -o "true\|false" || echo "false")
|
|
227
|
+
echo " ℹ️ enableDealAgentAutoApproveAllTasks: $AUTO_APPROVE (default: false)"
|
|
228
|
+
|
|
229
|
+
echo ""
|
|
230
|
+
echo "✅ Pipeline Management enabled successfully"
|
|
231
|
+
echo ""
|
|
232
|
+
echo "Next steps:"
|
|
233
|
+
echo " 1. Run ./create-flow.sh $ORG_ALIAS to create the suggestion processing flow"
|
|
234
|
+
echo " 2. Run ./create-agent.sh $ORG_ALIAS <bundle-path> to create and activate the agent"
|
|
235
|
+
else
|
|
236
|
+
echo " ❌ Verification failed"
|
|
237
|
+
echo ""
|
|
238
|
+
echo "Query result:"
|
|
239
|
+
echo "$VERIFY_RESULT"
|
|
240
|
+
exit 1
|
|
241
|
+
fi
|