fostrom 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dl-agent.sh +2 -0
  2. package/index.js +6 -16
  3. package/package.json +1 -1
package/dl-agent.sh CHANGED
@@ -133,6 +133,8 @@ main() {
133
133
  case "$ARCH" in
134
134
  x86_64|amd64) ARCH="amd64" ;;
135
135
  aarch64|arm64) ARCH="arm64" ;;
136
+ armv6l) ARCH="armv6hf" ;;
137
+ riscv64) ARCH="riscv64" ;;
136
138
  *) die "Unsupported architecture: $ARCH" ;;
137
139
  esac
138
140
  ;;
package/index.js CHANGED
@@ -131,22 +131,12 @@ export default class Fostrom {
131
131
  throw new FostromError("req_failed", "Communicating with the device agent is failing.")
132
132
  }
133
133
 
134
- const fleet_id = resp.headers.get('x-fleet-id')
135
- const device_id = resp.headers.get('x-device-id')
136
-
137
- if (this.#creds.fleet_id != fleet_id || this.#creds.device_id != device_id) {
138
- console.warn("Restarting Agent due to credential mismatch.")
139
- this.stop_agent()
140
- this.#start_agent()
141
- return await this.#req(path, options)
142
- } else {
143
- try {
144
- body = await resp.json()
145
- }
146
- catch (e) {
147
- console.error(e)
148
- throw new FostromError("req_failed", "Communicating with the device agent is failing.")
149
- }
134
+ try {
135
+ body = await resp.json()
136
+ }
137
+ catch (e) {
138
+ console.error(e)
139
+ throw new FostromError("req_failed", "Communicating with the device agent is failing.")
150
140
  }
151
141
 
152
142
  if (body.error && body.msg) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fostrom",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Fostrom's Official Device SDK for JS. Fostrom (https://fostrom.io) is an IoT Cloud Platform.",
5
5
  "keywords": [
6
6
  "fostrom",