roboto-js 1.1.5 → 1.1.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roboto-js",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "dist/cjs/index.cjs",
package/src/index.js CHANGED
@@ -71,11 +71,20 @@ export default class Roboto{
71
71
  }
72
72
 
73
73
  async registerUser(params){
74
+
75
+ // TODO - need to
76
+
74
77
  return this.api.registerUser(params);
75
78
  }
79
+ async loadUser(params){
80
+ return this.api.loadUser(params);
81
+ }
76
82
  async loadCurrentUser(){
77
83
  return this.api.loadCurrentUser();
78
84
  }
85
+ async confirmUserEmail(params){
86
+ return this.api.confirmUserEmail(params);
87
+ }
79
88
 
80
89
  //
81
90
  // create and upload files
package/src/rbt_api.js CHANGED
@@ -117,18 +117,51 @@ export default class RbtApi {
117
117
  User.setData(userData);
118
118
  return User;
119
119
 
120
- //const record = response.data;
121
- //
122
- //if(dataHash){
123
- // record.data = dataHash;
124
- //}
125
- //return new RbtObject(record, this.axios);
126
120
  } catch (e) {
127
121
  return this._handleError(e);
128
122
  }
129
123
 
130
124
  }
131
125
 
126
+
127
+ async confirmUserEmail(confirmCode){
128
+
129
+ debugger;
130
+ let params = { emailConfirmCode: confirmCode };
131
+
132
+ try {
133
+
134
+ const response = await this.axios.post('/user_service/confirmUserEmail', [params]);
135
+ debugger;
136
+ return response;
137
+
138
+ } catch (e) {
139
+ return this._handleError(e);
140
+ }
141
+
142
+ }
143
+
144
+
145
+ async loadUser(userId){
146
+
147
+ let params = { id: userId };
148
+
149
+ try {
150
+
151
+ const response = await this.axios.post('/user_service/loadUser', [params]);
152
+ let userData = response?.data?.user;
153
+
154
+ let User = new RbtUser({ id: userData.id }, this.axios);
155
+ User.setData(userData);
156
+ return User;
157
+
158
+ } catch (e) {
159
+ return this._handleError(e);
160
+ }
161
+
162
+ }
163
+
164
+
132
165
  async refreshAuthToken(authtoken){
133
166
 
134
167
  try {
@@ -153,11 +186,9 @@ export default class RbtApi {
153
186
  async registerUser(dataHash={}) {
154
187
  try {
155
188
  const response = await this.axios.post('/user_service/registerUser', [dataHash]);
156
- const record = response.data;
157
189
 
158
- if(dataHash){
159
- record.data = dataHash;
160
- }
190
+ debugger;
191
+ const record = response.data;
161
192
  return new RbtUser(record, this.axios);
162
193
  } catch (e) {
163
194
  debugger;