Skip to content

Commit

Permalink
v15.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielburnworth committed Sep 28, 2023
1 parent e3de70e commit b271279
Show file tree
Hide file tree
Showing 24 changed files with 5,362 additions and 3,819 deletions.
10 changes: 9 additions & 1 deletion dist/__tests__/config_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,18 @@ describe("generateConfig", function () {
expect(result.LAST_PING_IN).toEqual(0);
});
it("warns users when atob is missing", function () {
Object.defineProperty(global, "atob", {
value: undefined,
writable: true,
});
// Just to verify mock- not part of test.
expect((0, is_node_1.isNode)()).toBe(true);
global.atob = undefined;
var boom = function () { return (0, config_1.generateConfig)({ token: "{}" }); };
expect(boom).toThrowError(config_1.FIX_ATOB_FIRST);
// TODO
// expect(global.atob).toBeFalsy();
// expect(boom).toThrowError(FIX_ATOB_FIRST);
config_1.FIX_ATOB_FIRST;
expect(boom).toThrowError();
});
});
6 changes: 3 additions & 3 deletions dist/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var MqttChanName;
/** THIS ONE IS SPECIAL. */
MqttChanName["publicBroadcast"] = "public_broadcast";
MqttChanName["pong"] = "pong";
})(MqttChanName = exports.MqttChanName || (exports.MqttChanName = {}));
})(MqttChanName || (exports.MqttChanName = MqttChanName = {}));
/** Not to be confused with MqttChanNames or
* MQTT.js event names */
var FbjsEventName;
Expand All @@ -35,7 +35,7 @@ var FbjsEventName;
FbjsEventName["sync"] = "sync";
/** When a key is removed from the device state tree. */
FbjsEventName["remove"] = "remove";
})(FbjsEventName = exports.FbjsEventName || (exports.FbjsEventName = {}));
})(FbjsEventName || (exports.FbjsEventName = FbjsEventName = {}));
var Misc;
(function (Misc) {
/** Channel delimiter for MQTT channels. */
Expand All @@ -44,4 +44,4 @@ var Misc;
Misc["NULL"] = "null";
/** Reconnect interval for MQTT.js */
Misc[Misc["RECONNECT_THROTTLE_MS"] = 1000] = "RECONNECT_THROTTLE_MS";
})(Misc = exports.Misc || (exports.Misc = {}));
})(Misc || (exports.Misc = Misc = {}));
188 changes: 94 additions & 94 deletions dist/corpus.d.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/farmbot.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as Corpus from "./corpus";
import { Client as MqttClient } from "mqtt";
import { MqttClient } from "mqtt";
import { Dictionary, Vector3 } from "./interfaces";
import { ReadPin, WritePin } from ".";
import { FarmBotInternalConfig as Conf, FarmbotConstructorParams } from "./config";
import { ResourceAdapter } from "./resources/resource_adapter";
declare type RpcResponse = Promise<Corpus.RpcOk | Corpus.RpcError>;
type RpcResponse = Promise<Corpus.RpcOk | Corpus.RpcError>;
/** Meta data that wraps an event callback */
interface CallbackWrapper {
once: boolean;
Expand Down
6 changes: 3 additions & 3 deletions dist/farmbot.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,8 @@ var Farmbot = /** @class */ (function () {
clean: true,
clientId: "FBJS-".concat(Farmbot.VERSION, "-").concat((0, util_1.uuid)()),
password: token,
protocolId: "MQIsdp",
protocolVersion: 3,
protocolId: "MQTT",
protocolVersion: 4,
reconnectPeriod: reconnectPeriod,
username: mqttUsername,
});
Expand Down Expand Up @@ -454,7 +454,7 @@ var Farmbot = /** @class */ (function () {
enumerable: false,
configurable: true
});
Farmbot.VERSION = "15.8.0";
Farmbot.VERSION = "15.8.1";
return Farmbot;
}());
exports.Farmbot = Farmbot;
63 changes: 62 additions & 1 deletion dist/farmbot_single_file.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/farmbot_single_file.js.map

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions dist/interfaces.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NumberConfigKey } from "./resources/configs/firmware";
export declare type Primitive = string | number | boolean;
export type Primitive = string | number | boolean;
/** Everything the farmbot knows about itself at a given moment in time. */
export interface BotStateTree {
/** Microcontroller configuration and settings. */
Expand All @@ -26,10 +26,10 @@ export interface BotStateTree {
} | undefined;
}
/** Microcontroller board. */
export declare type FirmwareHardware = "none" | "arduino" | "express_k10" | "express_k11" | "farmduino_k14" | "farmduino_k15" | "farmduino_k16" | "farmduino";
export type FirmwareHardware = "none" | "arduino" | "express_k10" | "express_k11" | "farmduino_k14" | "farmduino_k15" | "farmduino_k16" | "farmduino";
/** FarmBot motor and encoder positions. */
export declare type LocationName = "position" | "scaled_encoders" | "raw_encoders";
export declare type AxisState = "idle" | "begin" | "accelerate" | "cruise" | "decelerate" | "stop" | "crawl";
export type LocationName = "position" | "scaled_encoders" | "raw_encoders";
export type AxisState = "idle" | "begin" | "accelerate" | "cruise" | "decelerate" | "stop" | "crawl";
export interface LocationData {
position: Record<Xyz, number | undefined>;
scaled_encoders: Record<Xyz, number | undefined>;
Expand All @@ -38,8 +38,8 @@ export interface LocationData {
axis_states?: Record<Xyz, AxisState | undefined>;
}
/** Job progress status. */
export declare type ProgressStatus = "complete" | "working" | "error";
export declare type JobProgress = PercentageProgress | BytesProgress;
export type ProgressStatus = "complete" | "working" | "error";
export type JobProgress = PercentageProgress | BytesProgress;
interface JobProgressBase {
status: ProgressStatus;
type: string;
Expand Down Expand Up @@ -70,7 +70,7 @@ export interface Alert {
* Can be namespaced and supplied to a run Farmware command.
* Also used in FarmBot Web App Farmware page form builder.
*/
export declare type FarmwareConfig = Record<"name" | "label" | "value", string>;
export type FarmwareConfig = Record<"name" | "label" | "value", string>;
/**
* The Farmware manifest is a JSON file published by Farmware authors.
* It is used by FarmBot OS to perform installation and upgrades.
Expand Down Expand Up @@ -109,20 +109,20 @@ export declare enum Encoder {
differential = 1
}
/** Microcontroller firmware hardware setting names. */
export declare type McuParamName = NumberConfigKey;
export type McuParamName = NumberConfigKey;
/** Microcontroller configuration and settings. */
export declare type McuParams = Partial<Record<McuParamName, (number | undefined)>>;
export type McuParams = Partial<Record<McuParamName, (number | undefined)>>;
/** Bot axis names. */
export declare type Xyz = "x" | "y" | "z";
export type Xyz = "x" | "y" | "z";
/** 3 dimensional vector. */
export declare type Vector3 = Record<Xyz, number>;
export type Vector3 = Record<Xyz, number>;
/** GPIO pin value record. */
export interface Pin {
mode: number;
value: number;
}
/** Lookup for pin status, indexed by pin number. */
export declare type Pins = Dictionary<Pin | undefined>;
export type Pins = Dictionary<Pin | undefined>;
/** FarmBot OS configs. */
export interface FullConfiguration {
arduino_debug_messages: number;
Expand All @@ -143,11 +143,11 @@ export interface FullConfiguration {
gantry_height?: number;
}
/** FarmBot OS configs. */
export declare type Configuration = Partial<FullConfiguration>;
export type Configuration = Partial<FullConfiguration>;
/** FarmBot OS config names. */
export declare type ConfigurationName = keyof Configuration;
export type ConfigurationName = keyof Configuration;
/** The possible values for the sync_status property on informational_settings */
export declare type SyncStatus = "booting" | "maintenance" | "sync_error" | "sync_now" | "synced" | "syncing" | "unknown";
export type SyncStatus = "booting" | "maintenance" | "sync_error" | "sync_now" | "synced" | "syncing" | "unknown";
/** Various FarmBot OS status data. */
export interface InformationalSettings {
/** System uptime in seconds. */
Expand Down Expand Up @@ -203,7 +203,7 @@ export interface InformationalSettings {
/** CSV list of available camera device numbers (/dev/video#). */
video_devices?: string;
}
export declare type MQTTEventName = "connect" | "message";
export type MQTTEventName = "connect" | "message";
export interface Dictionary<T> {
[key: string]: T;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/interfaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ var Encoder;
Encoder[Encoder["unknown"] = -1] = "unknown";
Encoder[Encoder["quadrature"] = 0] = "quadrature";
Encoder[Encoder["differential"] = 1] = "differential";
})(Encoder = exports.Encoder || (exports.Encoder = {}));
})(Encoder || (exports.Encoder = Encoder = {}));
2 changes: 1 addition & 1 deletion dist/resources/__tests__/support_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
Expand Down
10 changes: 5 additions & 5 deletions dist/resources/api_resources.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ALLOWED_MESSAGE_TYPES, ALLOWED_CHANNEL_NAMES, PlantStage, Color, Sequence, InternalFarmEventBodyItem } from "..";
import { VariableDeclaration, ParameterDeclaration, ParameterApplication } from "../corpus";
export declare type TimeUnit = "never" | "minutely" | "hourly" | "daily" | "weekly" | "monthly" | "yearly";
export declare type ExecutableType = "Sequence" | "Regimen";
export type TimeUnit = "never" | "minutely" | "hourly" | "daily" | "weekly" | "monthly" | "yearly";
export type ExecutableType = "Sequence" | "Regimen";
export declare enum ToolPulloutDirection {
NONE = 0,
POSITIVE_X = 1,
Expand Down Expand Up @@ -86,7 +86,7 @@ export interface SpecialPinBinding extends PinBindingBase {
binding_type: PinBindingType.special;
special_action: PinBindingSpecialAction;
}
export declare type PinBinding = StandardPinBinding | SpecialPinBinding;
export type PinBinding = StandardPinBinding | SpecialPinBinding;
export interface PlantTemplate extends ResourceBase {
saved_garden_id: number;
radius: number;
Expand Down Expand Up @@ -132,7 +132,7 @@ export interface WeedPointer extends BasePoint {
plant_stage: PlantStage;
radius: number;
}
export declare type Point = GenericPointer | PlantPointer | ToolSlotPointer | WeedPointer;
export type Point = GenericPointer | PlantPointer | ToolSlotPointer | WeedPointer;
/** Individual step that a regimen will execute at a point in time. */
export interface RegimenItem {
id?: number;
Expand Down Expand Up @@ -243,7 +243,7 @@ export interface DeviceAccountSettings extends ResourceBase {
indoor: boolean;
rpi: string | undefined;
}
export declare type PointGroupSortType = "random" | "xy_ascending" | "xy_descending" | "yx_ascending" | "yx_descending" | "xy_alternating" | "yx_alternating" | "nn";
export type PointGroupSortType = "random" | "xy_ascending" | "xy_descending" | "yx_ascending" | "yx_descending" | "xy_alternating" | "yx_alternating" | "nn";
interface PointGroupCriteria {
day: {
op: ">" | "<";
Expand Down
6 changes: 3 additions & 3 deletions dist/resources/api_resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ var ToolPulloutDirection;
ToolPulloutDirection[ToolPulloutDirection["NEGATIVE_X"] = 2] = "NEGATIVE_X";
ToolPulloutDirection[ToolPulloutDirection["POSITIVE_Y"] = 3] = "POSITIVE_Y";
ToolPulloutDirection[ToolPulloutDirection["NEGATIVE_Y"] = 4] = "NEGATIVE_Y";
})(ToolPulloutDirection = exports.ToolPulloutDirection || (exports.ToolPulloutDirection = {}));
})(ToolPulloutDirection || (exports.ToolPulloutDirection = ToolPulloutDirection = {}));
var PinBindingType;
(function (PinBindingType) {
PinBindingType["special"] = "special";
PinBindingType["standard"] = "standard";
})(PinBindingType = exports.PinBindingType || (exports.PinBindingType = {}));
})(PinBindingType || (exports.PinBindingType = PinBindingType = {}));
var PinBindingSpecialAction;
(function (PinBindingSpecialAction) {
PinBindingSpecialAction["emergency_lock"] = "emergency_lock";
Expand All @@ -23,4 +23,4 @@ var PinBindingSpecialAction;
PinBindingSpecialAction["power_off"] = "power_off";
PinBindingSpecialAction["read_status"] = "read_status";
PinBindingSpecialAction["take_photo"] = "take_photo";
})(PinBindingSpecialAction = exports.PinBindingSpecialAction || (exports.PinBindingSpecialAction = {}));
})(PinBindingSpecialAction || (exports.PinBindingSpecialAction = PinBindingSpecialAction = {}));
6 changes: 3 additions & 3 deletions dist/resources/configs/fbos.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ export interface FbosConfig {
soil_height?: number;
gantry_height?: number;
}
export declare type NumberConfigKey = "id" | "device_id" | "safe_height" | "soil_height" | "gantry_height" | "boot_sequence_id";
export declare type StringConfigKey = "firmware_hardware" | "firmware_path" | "update_channel";
export declare type BooleanConfigKey = "arduino_debug_messages" | "firmware_debug_log" | "firmware_input_log" | "firmware_output_log" | "os_auto_update" | "sequence_body_log" | "sequence_complete_log" | "sequence_init_log";
export type NumberConfigKey = "id" | "device_id" | "safe_height" | "soil_height" | "gantry_height" | "boot_sequence_id";
export type StringConfigKey = "firmware_hardware" | "firmware_path" | "update_channel";
export type BooleanConfigKey = "arduino_debug_messages" | "firmware_debug_log" | "firmware_input_log" | "firmware_output_log" | "os_auto_update" | "sequence_body_log" | "sequence_complete_log" | "sequence_init_log";
4 changes: 2 additions & 2 deletions dist/resources/configs/firmware.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,5 @@ export interface FirmwareConfig {
movement_stall_sensitivity_y: number;
movement_stall_sensitivity_z: number;
}
export declare type NumberConfigKey = "encoder_enabled_x" | "encoder_enabled_y" | "encoder_enabled_z" | "encoder_invert_x" | "encoder_invert_y" | "encoder_invert_z" | "encoder_missed_steps_decay_x" | "encoder_missed_steps_decay_y" | "encoder_missed_steps_decay_z" | "encoder_missed_steps_max_x" | "encoder_missed_steps_max_y" | "encoder_missed_steps_max_z" | "encoder_scaling_x" | "encoder_scaling_y" | "encoder_scaling_z" | "encoder_type_x" | "encoder_type_y" | "encoder_type_z" | "encoder_use_for_pos_x" | "encoder_use_for_pos_y" | "encoder_use_for_pos_z" | "movement_axis_nr_steps_x" | "movement_axis_nr_steps_y" | "movement_axis_nr_steps_z" | "movement_axis_stealth_x" | "movement_axis_stealth_y" | "movement_axis_stealth_z" | "movement_calibration_deadzone_x" | "movement_calibration_deadzone_y" | "movement_calibration_deadzone_z" | "movement_calibration_retry_x" | "movement_calibration_retry_y" | "movement_calibration_retry_z" | "movement_calibration_retry_total_x" | "movement_calibration_retry_total_y" | "movement_calibration_retry_total_z" | "movement_enable_endpoints_x" | "movement_enable_endpoints_y" | "movement_enable_endpoints_z" | "movement_home_at_boot_x" | "movement_home_at_boot_y" | "movement_home_at_boot_z" | "movement_home_spd_x" | "movement_home_spd_y" | "movement_home_spd_z" | "movement_home_up_x" | "movement_home_up_y" | "movement_home_up_z" | "movement_invert_2_endpoints_x" | "movement_invert_2_endpoints_y" | "movement_invert_2_endpoints_z" | "movement_invert_endpoints_x" | "movement_invert_endpoints_y" | "movement_invert_endpoints_z" | "movement_invert_motor_x" | "movement_invert_motor_y" | "movement_invert_motor_z" | "movement_keep_active_x" | "movement_keep_active_y" | "movement_keep_active_z" | "movement_max_spd_x" | "movement_max_spd_y" | "movement_max_spd_z" | "movement_max_spd_z2" | "movement_microsteps_x" | "movement_microsteps_y" | "movement_microsteps_z" | "movement_min_spd_x" | "movement_min_spd_y" | "movement_min_spd_z" | "movement_min_spd_z2" | "movement_motor_current_x" | "movement_motor_current_y" | "movement_motor_current_z" | "movement_secondary_motor_invert_x" | "movement_secondary_motor_x" | "movement_stall_sensitivity_x" | "movement_stall_sensitivity_y" | "movement_stall_sensitivity_z" | "movement_step_per_mm_x" | "movement_step_per_mm_y" | "movement_step_per_mm_z" | "movement_steps_acc_dec_x" | "movement_steps_acc_dec_y" | "movement_steps_acc_dec_z" | "movement_steps_acc_dec_z2" | "movement_stop_at_home_x" | "movement_stop_at_home_y" | "movement_stop_at_home_z" | "movement_stop_at_max_x" | "movement_stop_at_max_y" | "movement_stop_at_max_z" | "movement_timeout_x" | "movement_timeout_y" | "movement_timeout_z" | "param_config_ok" | "param_e_stop_on_mov_err" | "param_mov_nr_retry" | "param_test" | "param_use_eeprom" | "param_version" | "pin_guard_1_active_state" | "pin_guard_1_pin_nr" | "pin_guard_1_time_out" | "pin_guard_2_active_state" | "pin_guard_2_pin_nr" | "pin_guard_2_time_out" | "pin_guard_3_active_state" | "pin_guard_3_pin_nr" | "pin_guard_3_time_out" | "pin_guard_4_active_state" | "pin_guard_4_pin_nr" | "pin_guard_4_time_out" | "pin_guard_5_active_state" | "pin_guard_5_pin_nr" | "pin_guard_5_time_out" | "pin_report_1_pin_nr" | "pin_report_2_pin_nr";
export declare type StringConfigKey = "created_at" | "updated_at";
export type NumberConfigKey = "encoder_enabled_x" | "encoder_enabled_y" | "encoder_enabled_z" | "encoder_invert_x" | "encoder_invert_y" | "encoder_invert_z" | "encoder_missed_steps_decay_x" | "encoder_missed_steps_decay_y" | "encoder_missed_steps_decay_z" | "encoder_missed_steps_max_x" | "encoder_missed_steps_max_y" | "encoder_missed_steps_max_z" | "encoder_scaling_x" | "encoder_scaling_y" | "encoder_scaling_z" | "encoder_type_x" | "encoder_type_y" | "encoder_type_z" | "encoder_use_for_pos_x" | "encoder_use_for_pos_y" | "encoder_use_for_pos_z" | "movement_axis_nr_steps_x" | "movement_axis_nr_steps_y" | "movement_axis_nr_steps_z" | "movement_axis_stealth_x" | "movement_axis_stealth_y" | "movement_axis_stealth_z" | "movement_calibration_deadzone_x" | "movement_calibration_deadzone_y" | "movement_calibration_deadzone_z" | "movement_calibration_retry_x" | "movement_calibration_retry_y" | "movement_calibration_retry_z" | "movement_calibration_retry_total_x" | "movement_calibration_retry_total_y" | "movement_calibration_retry_total_z" | "movement_enable_endpoints_x" | "movement_enable_endpoints_y" | "movement_enable_endpoints_z" | "movement_home_at_boot_x" | "movement_home_at_boot_y" | "movement_home_at_boot_z" | "movement_home_spd_x" | "movement_home_spd_y" | "movement_home_spd_z" | "movement_home_up_x" | "movement_home_up_y" | "movement_home_up_z" | "movement_invert_2_endpoints_x" | "movement_invert_2_endpoints_y" | "movement_invert_2_endpoints_z" | "movement_invert_endpoints_x" | "movement_invert_endpoints_y" | "movement_invert_endpoints_z" | "movement_invert_motor_x" | "movement_invert_motor_y" | "movement_invert_motor_z" | "movement_keep_active_x" | "movement_keep_active_y" | "movement_keep_active_z" | "movement_max_spd_x" | "movement_max_spd_y" | "movement_max_spd_z" | "movement_max_spd_z2" | "movement_microsteps_x" | "movement_microsteps_y" | "movement_microsteps_z" | "movement_min_spd_x" | "movement_min_spd_y" | "movement_min_spd_z" | "movement_min_spd_z2" | "movement_motor_current_x" | "movement_motor_current_y" | "movement_motor_current_z" | "movement_secondary_motor_invert_x" | "movement_secondary_motor_x" | "movement_stall_sensitivity_x" | "movement_stall_sensitivity_y" | "movement_stall_sensitivity_z" | "movement_step_per_mm_x" | "movement_step_per_mm_y" | "movement_step_per_mm_z" | "movement_steps_acc_dec_x" | "movement_steps_acc_dec_y" | "movement_steps_acc_dec_z" | "movement_steps_acc_dec_z2" | "movement_stop_at_home_x" | "movement_stop_at_home_y" | "movement_stop_at_home_z" | "movement_stop_at_max_x" | "movement_stop_at_max_y" | "movement_stop_at_max_z" | "movement_timeout_x" | "movement_timeout_y" | "movement_timeout_z" | "param_config_ok" | "param_e_stop_on_mov_err" | "param_mov_nr_retry" | "param_test" | "param_use_eeprom" | "param_version" | "pin_guard_1_active_state" | "pin_guard_1_pin_nr" | "pin_guard_1_time_out" | "pin_guard_2_active_state" | "pin_guard_2_pin_nr" | "pin_guard_2_time_out" | "pin_guard_3_active_state" | "pin_guard_3_pin_nr" | "pin_guard_3_time_out" | "pin_guard_4_active_state" | "pin_guard_4_pin_nr" | "pin_guard_4_time_out" | "pin_guard_5_active_state" | "pin_guard_5_pin_nr" | "pin_guard_5_time_out" | "pin_report_1_pin_nr" | "pin_report_2_pin_nr";
export type StringConfigKey = "created_at" | "updated_at";
Loading

0 comments on commit b271279

Please sign in to comment.