File: util.nu 1 exported command 10 internal commands

build-session

Internal

Build 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

#inputoutput
0anyany

build-headers

Internal

Build 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

#inputoutput
0anyany

sf-call

Internal

Central 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

#inputoutput
0anyany

sf-error

Internal

Raise 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

#inputoutput
0anyany

validate-soql

Internal

Validate 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

#inputoutput
0anyany

to-sf-datetime

Internal

Convert 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

#inputoutput
0anyany

xml-find-text

Internal

Find 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

#inputoutput
0anyany

strip-attributes

Internal

Usage

strip-attributes <value>

Flags

-h, --help
Display the help message for this command

Parameters

value <any>

Input/output types

#inputoutput
0anyany

format-query-records

Internal

Usage

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

#inputoutput
0anyany

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

#inputoutput
0anyany

from kv

Internal

Parses `KEY=value` text into a record

Usage

from kv

Flags

-h, --help
Display the help message for this command

Input/output types

#inputoutput
0oneof<string, nothing>record