File:
util.nu
1 exported command
7 internal commandsbuild-session
InternalBuild the session record stored in $env.QUICKBOOKS.
Usage
build-session <access_token> <realm_id> --minorversion <int> --client-id <string> --client-secret <string> --refresh-token <string> [--sandbox]
Parameters
access_token <string>realm_id <string>
Flags
--minorversion <int>- QBO minor version (default: 75)
--client-id <string>- OAuth2 client ID (for refresh)
--client-secret <string>- OAuth2 client secret (for refresh)
--refresh-token <string>- OAuth2 refresh token
--sandbox- Use sandbox API
Input/output types
| input | output |
|---|---|
| any | any |
build-headers
InternalBuild standard QBO REST API headers.
Usage
build-headers <access_token>
Parameters
access_token <string>
Input/output types
| input | output |
|---|---|
| any | any |
refresh-access-token
InternalRefresh the OAuth2 access token using the refresh token. Returns a record with the new access_token and refresh_token.
Usage
refresh-access-token
Input/output types
| input | output |
|---|---|
| any | any |
qb-call
InternalCentral HTTP helper for making QuickBooks API calls. Automatically injects minorversion query parameter. Returns the parsed response body.
Usage
qb-call <method> <url> --data <any> --params <record> --content-type <string>
Parameters
method <string>url <string>
Flags
--data <any>- Body for POST requests
--params <record>- Additional query parameters
--content-type <string>- Override content type
Input/output types
| input | output |
|---|---|
| any | any |
qb-error
InternalRaise a structured QuickBooks error based on status code and QBO error codes.
Usage
qb-error <status> <url> <content>
Parameters
status <int>url <string>content <any>
Input/output types
| input | output |
|---|---|
| any | any |
validate-entity
InternalValidate that an entity name is a known QBO business object.
Usage
validate-entity <entity>
Parameters
entity <string>
Input/output types
| input | output |
|---|---|
| any | any |
load-env-file
Loads environment variables from a file.
Usage
load-env-file <path?>
Parameters
path <path>- (optional, default: '.env')
Input/output types
| input | output |
|---|---|
| any | any |
from kv
InternalParses `KEY=value` text into a record.
Usage
from kv
Input/output types
| input | output |
|---|---|
| oneof<string, nothing> | record |