ironflock 0.1.1 → 1.0.1

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.
@@ -58,7 +58,8 @@ exports.CrossbarConnection = void 0;
58
58
  var autobahn_1 = __importDefault(require("autobahn"));
59
59
  var stream_1 = require("stream");
60
60
  // import { MsgpackSerializer } from "./serializer";
61
- var RESWARM_URL = process.env.RESWARM_URL;
61
+ var _a = process.env, RESWARM_URL = _a.RESWARM_URL, SWARM_KEY = _a.SWARM_KEY, APP_KEY = _a.APP_KEY, ENV = _a.ENV;
62
+ var CB_REALM = "realm-".concat(SWARM_KEY, "-").concat(APP_KEY, "-").concat(ENV);
62
63
  var DATAPODS_WS_URI = "wss://cbw.datapods.io/ws-ua-usr";
63
64
  var STUDIO_WS_URI = "wss://cbw.ironflock.com/ws-ua-usr";
64
65
  var STUDIO_WS_URI_OLD = "wss://cbw.record-evolution.com/ws-ua-usr";
@@ -74,7 +75,7 @@ var CrossbarConnection = /** @class */ (function (_super) {
74
75
  function CrossbarConnection(serial_number) {
75
76
  var _this = _super.call(this) || this;
76
77
  _this.serial_number = serial_number;
77
- _this.realm = "userapps";
78
+ _this.realm = CB_REALM;
78
79
  _this.socketURI = RESWARM_URL ? socketURIMap[RESWARM_URL] : DATAPODS_WS_URI;
79
80
  _this.init();
80
81
  return _this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ironflock",
3
- "version": "0.1.1",
3
+ "version": "1.0.1",
4
4
  "description": "Collect data in the IronFlock Storage architecture",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,7 +1,8 @@
1
1
  import autobahn from "autobahn";
2
2
  import { EventEmitter } from "stream";
3
3
  // import { MsgpackSerializer } from "./serializer";
4
- const { RESWARM_URL } = process.env
4
+ const { RESWARM_URL, SWARM_KEY, APP_KEY, ENV } = process.env
5
+ const CB_REALM = `realm-${SWARM_KEY}-${APP_KEY}-${ENV}`
5
6
 
6
7
  export type Details = { caller_authid: string; caller_authrole: string };
7
8
 
@@ -39,7 +40,7 @@ export class CrossbarConnection extends EventEmitter {
39
40
  constructor(serial_number: string) {
40
41
  super()
41
42
  this.serial_number = serial_number;
42
- this.realm = "userapps";
43
+ this.realm = CB_REALM;
43
44
  this.socketURI = RESWARM_URL ? socketURIMap[RESWARM_URL] : DATAPODS_WS_URI;
44
45
 
45
46
  this.init();