diff --git a/docs/Docs/HiddenConfigs.md b/docs/Docs/HiddenConfigs.md new file mode 100644 index 0000000..5ad7af2 --- /dev/null +++ b/docs/Docs/HiddenConfigs.md @@ -0,0 +1,20 @@ +# Configuration Flags + +In the Advanced settings of PostalPoint, there is a tool to manually get and set settings by ID. + +Most PostalPoint settings are available in the Settings screen, and their IDs can be found in the JSON file created by running a database backup. + +However, there are some special "hidden" setting options that can override default behavior. + +Warning: PostalPoint is tested with these settings at their default values (usually, unset). There is a small chance of bugs being created by changing a value. + +* `approved_shipper_receipt_disclaimer`: Set non-empty to add a disclaimer on printed receipts: "Note: A non-postal surcharge was added to x items" +* `disable_hid_feedback`: Set non-empty to skip sending scan feedback commands (error beep, etc) to the USB HID POS barcode scanner. +* `disable_keyboard_shortcuts`: Set non-empty to disable the Function key row keyboard navigation shortcuts. +* `disablesettingsbackup`: Set non-empty to skip backing up settings with the database. +* `dymo_twin_roll_selection`: Set label roll selection when using a Dymo twin label printer: 0=auto, 1=left, 2=right, default is 1. +* `easypost_allow_wallet_billing`: Set truthy to allow EasyPost wallet accounts with TOS that restricts resale. +* `mailboxslipoverride`: Change the print size of a mailbox package slip, which is normally 4x6, but defaults to 4x3 when using a QL label printer and DK2243 labels. Set to "4x6" or "4x3" to force a size. +* `mute_sounds`: Set non-empty to disable sound effects. +* `postalpoint_lan_server_port`: Override the port used for the internal web server. This must match on all installations that need to communicate. +* `postalpoint_lan_server_bind_address`: Override the IP address to bind the internal web server to. Default is "0.0.0.0". diff --git a/docs/Plugin API/barcode.md b/docs/Plugin API/barcode.md index c530e9c..57e859a 100644 --- a/docs/Plugin API/barcode.md +++ b/docs/Plugin API/barcode.md @@ -11,6 +11,7 @@ Handle tracking barcodes * [.addPrepaidBarcode(trackingBarcodeData)](#barcode.addPrepaidBarcode) * [.inject(barcodeData)](#barcode.inject) * [.onPrepaidScan(f)](#barcode.onPrepaidScan) + * [.registerDropOffCarrierScanHandler(carrier, fn)](#barcode.registerDropOffCarrierScanHandler) @@ -84,3 +85,36 @@ If the barcode is handled by this function, it shall return a TrackingBarcode ob | --- | --- | | f | function | + + +### barcode.registerDropOffCarrierScanHandler(carrier, fn) +Register to handle prepaid drop off scans for a particular shipping carrier. +Scans are kept in a local, disk-backed queue and the function registered here will be +called when a queued barcode is processed for the provided carrier. +This function is intended for carrier drop-off reimbursement programs such as ASO and FASC. + +**Kind**: static method of [barcode](#barcode) +**Throws**: + +- Error - Only one plugin may register a particular carrier with this function; +any subsequent attempts to register to handle that carrier will throw an Error. + + +| Param | Type | Description | +| --- | --- | --- | +| carrier | string | Carrier name to register for. | +| fn | function | Async function to pass scan details to. Returns true if processed, false if not processed (but the barcode should be removed from queue), or throws an Error if it should be retried later. See example for data and usage. | + +**Example** +```js +global.apis.barcode.registerDropOffCarrierScanHandler("FedEx", function (data) { + global.apis.alert(`Carrier: ${data.carrier}, Tracking number: ${data.tracking}, ` + + `Raw scanned barcode: ${data.barcode}, ` + + `UNIX timestamp of scan: ${data.timestamp}, Scan UUID: ${data.uuid}`, + "Processing DropOffCarrierScan data"); + + return false; // Not processed but should be discarded + return true; // Processed, discard from queue + throw new Error("Failed to process, try again later"); +}); +``` diff --git a/docs/Plugin API/httpserver.md b/docs/Plugin API/httpserver.md index 0df10b3..496a641 100644 --- a/docs/Plugin API/httpserver.md +++ b/docs/Plugin API/httpserver.md @@ -54,7 +54,7 @@ installations of PostalPoint on the LAN. Send a HTTP request to another PostalPoint installation on the local network. **Kind**: static method of [httpserver](#httpserver) -**Returns**: Promise.<Object> - - The JSON reply. +**Returns**: Promise.<Object> - The JSON reply. **Throws**: - Error When there's a network or other unrecoverable error while completing the request. Error message is a human-readable description of the problem.