util.nu
1 exported command
10 internal commandsbuild-session
InternalBuild the session record that gets stored in $env.SALESFORCE
Usage
build-session {flags} <session_id> <instance>
Flags
-h, --help- Display the help message for this command
--version <string> (default- '59.0')
--domain <string> (default- 'login')
--auth-type <string> (default- 'direct')
Parameters
session_id <string>instance <string>
Input/output types
| # | input | output |
|---|---|---|
| 0 | any | any |
build-headers
InternalBuild standard Salesforce REST API headers
Usage
build-headers <session_id>
Flags
-h, --help- Display the help message for this command
Parameters
session_id <string>
Input/output types
| # | input | output |
|---|---|---|
| 0 | any | any |
sf-call
InternalCentral HTTP helper for making Salesforce API calls. Returns the parsed response body (usually a record or table). Automatically handles error responses.
Usage
sf-call {flags} <method> <url>
Flags
-h, --help- Display the help message for this command
--data <any>- Body for POST/PATCH/PUT requests
--params <record>- Query parameters for GET requests
Parameters
method <string>url <string>
Input/output types
| # | input | output |
|---|---|---|
| 0 | any | any |
sf-error
InternalRaise a structured Salesforce error based on status code.
Usage
sf-error <status> <url> <content>
Flags
-h, --help- Display the help message for this command
Parameters
status <int>url <string>content <any>
Input/output types
| # | input | output |
|---|---|---|
| 0 | any | any |
validate-soql
InternalValidate a SOQL query string for common structural issues. Raises a descriptive error if problems are found. Call this before sending a SOQL query to the Salesforce API.
Usage
validate-soql <soql>
Flags
-h, --help- Display the help message for this command
Parameters
soql <string>
Input/output types
| # | input | output |
|---|---|---|
| 0 | any | any |
to-sf-datetime
InternalConvert an ISO 8601 date string or datetime to Salesforce-compatible format.
Usage
to-sf-datetime <dt>
Flags
-h, --help- Display the help message for this command
Parameters
dt <any>
Input/output types
| # | input | output |
|---|---|---|
| 0 | any | any |
xml-find-text
InternalFind a specific XML element by tag name in a parsed XML tree.
The XML tree is in Nushell's `from xml` format
{ tag: "name", attributes: {...}, content: [...] } Returns the first matching element's text content, or null if not found.
Usage
xml-find-text <xml> <tag_name>
Flags
-h, --help- Display the help message for this command
Parameters
xml <record>tag_name <string>
Input/output types
| # | input | output |
|---|---|---|
| 0 | any | any |
strip-attributes
InternalUsage
strip-attributes <value>
Flags
-h, --help- Display the help message for this command
Parameters
value <any>
Input/output types
| # | input | output |
|---|---|---|
| 0 | any | any |
format-query-records
InternalUsage
format-query-records <records> <include_attributes>
Flags
-h, --help- Display the help message for this command
Parameters
records <any>include_attributes <bool>
Input/output types
| # | input | output |
|---|---|---|
| 0 | any | any |
load-env-file
Loads environment variables from a file
Usage
load-env-file (path)
Flags
-h, --help- Display the help message for this command
Parameters
path <path>- (optional, default: '.env')
Input/output types
| # | input | output |
|---|---|---|
| 0 | any | any |
from kv
InternalParses `KEY=value` text into a record
Usage
from kv
Flags
-h, --help- Display the help message for this command
Input/output types
| # | input | output |
|---|---|---|
| 0 | oneof<string, nothing> | record |