@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,239 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dx-org-trial-expiration-check
|
|
3
|
+
description: "Check when Salesforce orgs expire (or already expired) and what to do about it, for one org, the default org, or across all authenticated orgs, using the Salesforce CLI (sf). Use when the user asks about org or trial expiration, \"when does my trial expire\", \"is my trial org still active\", \"how many days are left\", \"which orgs are expiring soon\", wants to filter orgs expiring within N days, needs machine-readable (JSON/CSV) output for cron or alerting, wants to back up an at-risk org before it lapses, or asks how to extend or renew an expiring trial or Developer Edition org. Covers trial editions, Developer Edition orgs (anything with a TrialExpirationDate), and scratch orgs (via sf org list). DO NOT TRIGGER for sandbox refresh timing, for creating, deleting, or switching the active org, or for non-Salesforce trials such as AWS, Netflix, or other vendors — this skill reads expiration and prints guidance, it does not modify orgs."
|
|
4
|
+
allowed-tools: Read, Bash(bash), Bash(sf data query), Bash(sf org list), Bash(sf config get), Bash(jq), Bash(date)
|
|
5
|
+
metadata:
|
|
6
|
+
version: "2.0"
|
|
7
|
+
cliTools:
|
|
8
|
+
- tool: ["jq"]
|
|
9
|
+
semver: ">=1.6.0"
|
|
10
|
+
- tool: ["sf"]
|
|
11
|
+
semver: ">=2.0.0"
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Org Expiration Check
|
|
15
|
+
|
|
16
|
+
Determine when a Salesforce org expires, how many days remain, and whether it
|
|
17
|
+
has already expired — for one org, the default org, or every authenticated org.
|
|
18
|
+
Results are **prioritized** (already-expired and soonest-expiring first) with a
|
|
19
|
+
one-line summary. The skill can also emit machine-readable output for alerting,
|
|
20
|
+
print **backup** commands for an at-risk org, and explain how to **renew** an
|
|
21
|
+
expiring trial or Developer Edition org.
|
|
22
|
+
|
|
23
|
+
## When to use
|
|
24
|
+
|
|
25
|
+
Trigger on requests like:
|
|
26
|
+
|
|
27
|
+
- "When does my trial org expire?" / "Is it still active or has it expired?"
|
|
28
|
+
- "How many days are left on my trial?"
|
|
29
|
+
- "Which of my orgs are expiring soon?" / "expiring within 30 days?"
|
|
30
|
+
- "Alert me / set up a cron job for expiring orgs" (use `--json` + `--fail-if-expiring`).
|
|
31
|
+
- "Back up my org before it expires" (use `--preserve`).
|
|
32
|
+
- "How do I extend / renew my trial (or Developer Edition) org?" (use `--renew`).
|
|
33
|
+
|
|
34
|
+
This skill covers **trial editions, Developer Edition orgs** (anything with a
|
|
35
|
+
`TrialExpirationDate`), and **scratch orgs** (via the `expirationDate` from
|
|
36
|
+
`sf org list`).
|
|
37
|
+
|
|
38
|
+
## When NOT to use
|
|
39
|
+
|
|
40
|
+
Do **not** trigger this skill for:
|
|
41
|
+
|
|
42
|
+
- **Sandbox refresh timing** — that is not an expiration date.
|
|
43
|
+
- **Creating, deleting, or switching orgs** — this skill only *reads*
|
|
44
|
+
expiration and *prints* guidance; it never creates, deletes, refreshes, or
|
|
45
|
+
changes the active/default org. (To switch the default org, use
|
|
46
|
+
`dx-org-switch`.)
|
|
47
|
+
- **Non-Salesforce trials** — e.g. AWS free tier, Netflix, or any other
|
|
48
|
+
vendor's trial. This skill is Salesforce-only.
|
|
49
|
+
|
|
50
|
+
## How expiration is determined
|
|
51
|
+
|
|
52
|
+
- **Trial / Developer Edition orgs:** the authoritative source is the org's
|
|
53
|
+
`Organization.TrialExpirationDate` field, read via SOQL (`sf data query`).
|
|
54
|
+
This field is `null` for paid/production orgs, which therefore report **no
|
|
55
|
+
trial expiration** — that is expected, not an error.
|
|
56
|
+
- **Scratch orgs:** the `expirationDate` reported by `sf org list` (no SOQL
|
|
57
|
+
query is issued for scratch orgs).
|
|
58
|
+
|
|
59
|
+
## Steps
|
|
60
|
+
|
|
61
|
+
1. **CRITICAL:** Run the bundled helper script, which handles date math (days
|
|
62
|
+
remaining, expired, expiring-soon warnings), prioritized sorting, and
|
|
63
|
+
structured output, and works on macOS and Linux. Always invoke it by
|
|
64
|
+
**absolute path** from the skill directory — never `./scripts/`, which
|
|
65
|
+
resolves against the user's current directory and will either run the wrong
|
|
66
|
+
script or fail.
|
|
67
|
+
|
|
68
|
+
**Before executing, verify:**
|
|
69
|
+
- [ ] `<skill_dir>` is an absolute path (starts with `/`), not a relative path
|
|
70
|
+
- [ ] The path points at this skill's own directory (the one containing this SKILL.md)
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
bash "<skill_dir>/scripts/check_expiration.sh" <alias-or-username> # one org
|
|
74
|
+
bash "<skill_dir>/scripts/check_expiration.sh" # default org (target-org config)
|
|
75
|
+
bash "<skill_dir>/scripts/check_expiration.sh" --all # every authenticated org
|
|
76
|
+
bash "<skill_dir>/scripts/check_expiration.sh" --all --within 30 # only orgs expiring within 30 days
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
`<skill_dir>` is the absolute path to the directory containing this SKILL.md.
|
|
80
|
+
|
|
81
|
+
2. Relay the script output to the user. When an org could not be queried,
|
|
82
|
+
surface the `sf org login web` command the script prints so the user can
|
|
83
|
+
authenticate. Pick optional flags based on what the user asked for (see
|
|
84
|
+
below): `--preserve` when they want to save their work, `--renew` when they
|
|
85
|
+
ask how to extend, `--json`/`--csv` for automation, `--fail-if-expiring`
|
|
86
|
+
for a cron/CI gate.
|
|
87
|
+
|
|
88
|
+
## Options
|
|
89
|
+
|
|
90
|
+
| Flag | Purpose |
|
|
91
|
+
|------|---------|
|
|
92
|
+
| `--all`, `-a` | Check every authenticated org. |
|
|
93
|
+
| `--within <days>`, `-w` | Show only orgs expiring within N days (includes already-expired; omits paid/production). `--within=30` also works. |
|
|
94
|
+
| `--json` | Emit a JSON array of org records (data only). |
|
|
95
|
+
| `--csv` | Emit CSV rows (data only). |
|
|
96
|
+
| `--preserve` | Print backup commands for expiring/expired orgs. |
|
|
97
|
+
| `--renew` | Print trial/DE extension & reactivation guidance. |
|
|
98
|
+
| `--fail-if-expiring[=N]` | Exit 3 if any org expires within N days (default 7). |
|
|
99
|
+
| `--no-scratch` | Exclude scratch orgs (trial/DE only). |
|
|
100
|
+
| `--help`, `-h` | Show usage. |
|
|
101
|
+
|
|
102
|
+
Flag order is flexible and flags combine (e.g. `--all --within 30 --json`).
|
|
103
|
+
|
|
104
|
+
## Prioritized output
|
|
105
|
+
|
|
106
|
+
Human output is grouped by urgency — **Expired** first, then **Expiring soon**
|
|
107
|
+
(within 7 days, flagged `Warning`), then **Active**, then **No trial expiration**,
|
|
108
|
+
then any orgs that could not be queried — and ends with a one-line summary:
|
|
109
|
+
|
|
110
|
+
```text
|
|
111
|
+
Org expiration status for all authenticated orgs:
|
|
112
|
+
|
|
113
|
+
Expired:
|
|
114
|
+
old-trial trial/DE edition expired 2026-06-20 (EXPIRED 19 day(s) ago)
|
|
115
|
+
|
|
116
|
+
Expiring soon (within 7 day(s)):
|
|
117
|
+
almost-up trial/DE edition expires 2026-07-14 (expires in 5 day(s) Warning)
|
|
118
|
+
|
|
119
|
+
Active (not expiring soon):
|
|
120
|
+
acme-trial trial/DE edition expires 2026-08-15 (expires in 37 day(s))
|
|
121
|
+
my-scratch scratch org expires 2026-07-25 (expires in 16 day(s))
|
|
122
|
+
|
|
123
|
+
No trial expiration (paid/production):
|
|
124
|
+
prod no trial expiration (paid/production org)
|
|
125
|
+
|
|
126
|
+
Summary: 1 expired, 1 expiring within 7 day(s), 2 active, 1 with no expiration.
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Structured output for alerting and cron (`--json` / `--csv`)
|
|
130
|
+
|
|
131
|
+
For dashboards, spreadsheets, or scheduled jobs, use `--json` or `--csv` to get
|
|
132
|
+
machine-readable records (no prose). Each record has `org`, `kind`,
|
|
133
|
+
`expirationDate`, `daysRemaining` (negative = expired, `null` = no expiration),
|
|
134
|
+
`status`, and `orgId`. This is deterministic and needs no LLM in the loop.
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# JSON, filtered to orgs expiring within 30 days:
|
|
138
|
+
bash "<skill_dir>/scripts/check_expiration.sh" --all --within 30 --json
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Cron watchdog** — `--fail-if-expiring[=N]` exits `3` (and prints an `ALERT:`
|
|
142
|
+
line to stderr) if any org expires within N days (default 7), so a scheduled
|
|
143
|
+
job can page you before an org lapses:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# crontab: every morning at 9, alert if anything expires within 7 days
|
|
147
|
+
0 9 * * * bash "<skill_dir>/scripts/check_expiration.sh" --all --fail-if-expiring 7 \
|
|
148
|
+
|| mail -s "Salesforce org expiring soon" me@example.com
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Preserve your work before an org lapses (`--preserve`)
|
|
152
|
+
|
|
153
|
+
When an org expires you lose access to its metadata and data. `--preserve`
|
|
154
|
+
prints ready-to-run backup commands (metadata manifest + `retrieve`, and a bulk
|
|
155
|
+
data export) for each expiring or already-expired org. It only *prints* the
|
|
156
|
+
commands — review and run them yourself:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
bash "<skill_dir>/scripts/check_expiration.sh" my-trial --preserve
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Extend or renew a trial / Developer Edition org (`--renew`)
|
|
163
|
+
|
|
164
|
+
`--renew` prints the current guidance for keeping an org alive, and surfaces the
|
|
165
|
+
Org IDs of at-risk orgs so the steps are actionable:
|
|
166
|
+
|
|
167
|
+
- **Partners:** request a Trial Org extension (up to +12 months) via
|
|
168
|
+
`partners.salesforce.com` → **Ask Agentforce** → "I want to extend my Trial
|
|
169
|
+
Org", providing the Org ID. Eligible while active or expired < 30 days; not
|
|
170
|
+
for LDV orgs. (Salesforce Help article 000387818.)
|
|
171
|
+
- **Nonprofits:** email your Account Executive with subject "Trial Extension"
|
|
172
|
+
and the trial-starter email, Org ID, and username; AMER
|
|
173
|
+
`PowerOfUsDesk@salesforce.com`, other regions `myaccount@salesforce.com` /
|
|
174
|
+
1-800-NO-SOFTWARE. Works even if already expired. (Article 004754220.)
|
|
175
|
+
- **Developer Edition:** DE orgs have no subscription clock but are deactivated
|
|
176
|
+
after prolonged inactivity (~180 days without a login); log in periodically.
|
|
177
|
+
If locked (not yet deleted), open a Salesforce Customer Support case to
|
|
178
|
+
reactivate — once permanently deleted, an org cannot be recovered.
|
|
179
|
+
- To keep a standard trial's data/config, convert/subscribe to a paid edition
|
|
180
|
+
before it lapses.
|
|
181
|
+
|
|
182
|
+
## Exit codes
|
|
183
|
+
|
|
184
|
+
- `0` success
|
|
185
|
+
- `1` an org could not be queried (auth/connection error)
|
|
186
|
+
- `2` bad usage or a missing dependency (`sf` or `jq`)
|
|
187
|
+
- `3` `--fail-if-expiring` threshold breached (at least one org expiring)
|
|
188
|
+
|
|
189
|
+
When both apply, a `--fail-if-expiring` breach (`3`) takes precedence over an
|
|
190
|
+
auth error (`1`): the alerting signal wins so a watchdog still fires. If your
|
|
191
|
+
job must also detect unreachable orgs, run `--json` and inspect the records for
|
|
192
|
+
`status: "auth_error"` in addition to checking the exit code. Note that an org
|
|
193
|
+
whose credentials fail cannot be date-checked, so it never counts toward a
|
|
194
|
+
`--fail-if-expiring` breach on its own.
|
|
195
|
+
|
|
196
|
+
`--fail-if-expiring` with no explicit number treats a following **all-numeric**
|
|
197
|
+
argument as the day count (e.g. `--fail-if-expiring 12345`). In the rare case an
|
|
198
|
+
org's alias is purely numeric, pass the org first (`check_expiration.sh 12345
|
|
199
|
+
--fail-if-expiring 7`) so it isn't mistaken for the threshold.
|
|
200
|
+
|
|
201
|
+
## Authentication
|
|
202
|
+
|
|
203
|
+
If an org isn't authenticated (no saved credentials, or an expired/revoked
|
|
204
|
+
token), the script does not fail silently — it prints the exact command to log
|
|
205
|
+
in and then re-run:
|
|
206
|
+
|
|
207
|
+
```text
|
|
208
|
+
my-trial not authenticated — no saved credentials for this org
|
|
209
|
+
|
|
210
|
+
To authenticate, run one of:
|
|
211
|
+
sf org login web --alias "my-trial"
|
|
212
|
+
sf org login web --alias <my-alias> --instance-url https://test.salesforce.com
|
|
213
|
+
Then re-run this check. List existing logins with: sf org list
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
`sf org login web` opens a browser to complete the OAuth flow. Use
|
|
217
|
+
`--instance-url https://test.salesforce.com` for sandboxes, or a custom My
|
|
218
|
+
Domain URL where applicable.
|
|
219
|
+
|
|
220
|
+
## Manual fallback (if the script is unavailable)
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
# Trial/DE expiration for one org (null = not a trial / paid org):
|
|
224
|
+
sf data query --query "SELECT Id, TrialExpirationDate FROM Organization" --target-org <org> --json
|
|
225
|
+
|
|
226
|
+
# Scratch org expiration comes from the org list, not SOQL:
|
|
227
|
+
sf org list --json
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Notes
|
|
231
|
+
|
|
232
|
+
- Requires the Salesforce CLI (`sf`) and `jq` on the PATH, plus at least one
|
|
233
|
+
authenticated org (`sf org login web`).
|
|
234
|
+
- Avoid launching many `sf` commands concurrently — the CLI can be slow under
|
|
235
|
+
contention. The script queries orgs sequentially for this reason.
|
|
236
|
+
- `sf org list` exposes a `trailExpirationDate` (note the typo) field that is
|
|
237
|
+
often `null`; the script does not rely on it for trial/DE orgs — it uses the
|
|
238
|
+
SOQL `TrialExpirationDate`, which is reliable. It does use `expirationDate`
|
|
239
|
+
from the list for scratch orgs.
|