roboto-js 1.0.19 → 1.0.21

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.
@@ -39,7 +39,9 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
39
39
  function Roboto() {
40
40
  var proxyReq = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
41
41
  _classCallCheck(this, Roboto);
42
- if (Roboto.instance) {
42
+ if (Roboto.instance && !proxyReq) {
43
+ // if on client, there can only be one instance
44
+ // on server, with proxyReq, each request has its own instance
43
45
  return Roboto.instance;
44
46
  }
45
47
  var isBrowser = typeof window !== "undefined";
@@ -23,6 +23,8 @@ var RbtObject = exports["default"] = /*#__PURE__*/function () {
23
23
  _classCallCheck(this, RbtObject);
24
24
  this._axios = axiosInstance;
25
25
  this._internalData = record;
26
+ this.id = record.id;
27
+ this.id_revision = record.id_revision;
26
28
  if (record.data) {
27
29
  this._data = record.data;
28
30
  } else {
package/dist/esm/index.js CHANGED
@@ -39,7 +39,9 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
39
39
  function Roboto() {
40
40
  var proxyReq = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
41
41
  _classCallCheck(this, Roboto);
42
- if (Roboto.instance) {
42
+ if (Roboto.instance && !proxyReq) {
43
+ // if on client, there can only be one instance
44
+ // on server, with proxyReq, each request has its own instance
43
45
  return Roboto.instance;
44
46
  }
45
47
  var isBrowser = typeof window !== "undefined";
@@ -23,6 +23,8 @@ var RbtObject = exports["default"] = /*#__PURE__*/function () {
23
23
  _classCallCheck(this, RbtObject);
24
24
  this._axios = axiosInstance;
25
25
  this._internalData = record;
26
+ this.id = record.id;
27
+ this.id_revision = record.id_revision;
26
28
  if (record.data) {
27
29
  this._data = record.data;
28
30
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roboto-js",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "dist/cjs/index.cjs",
package/src/index.js CHANGED
@@ -15,7 +15,9 @@ export default class Roboto{
15
15
 
16
16
  constructor(proxyReq = null) {
17
17
 
18
- if(Roboto.instance){
18
+ if(Roboto.instance && !proxyReq){
19
+ // if on client, there can only be one instance
20
+ // on server, with proxyReq, each request has its own instance
19
21
  return Roboto.instance;
20
22
  }
21
23
 
package/src/rbt_object.js CHANGED
@@ -5,6 +5,8 @@ export default class RbtObject {
5
5
  constructor(record, axiosInstance) {
6
6
  this._axios = axiosInstance;
7
7
  this._internalData = record;
8
+ this.id = record.id;
9
+ this.id_revision = record.id_revision;
8
10
  if(record.data){
9
11
  this._data = record.data;
10
12
  }