@cosmotech/core 1.3.14 → 1.4.3

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/dist/index.cjs.js CHANGED
@@ -108,6 +108,16 @@ function acquireTokens$1(callback) {
108
108
  return currentProvider.acquireTokens(callback);
109
109
  }
110
110
 
111
+ function acquireTokensByRequest$1(tokenReq) {
112
+ initProviderIfNull();
113
+
114
+ if (currentProvider === undefined) {
115
+ return undefined;
116
+ }
117
+
118
+ return currentProvider.acquireTokensByRequest(tokenReq);
119
+ }
120
+
111
121
  function isUserSignedIn$1(callback) {
112
122
  initProviderIfNull();
113
123
 
@@ -126,6 +136,14 @@ function getUserName$1() {
126
136
  return currentProvider.getUserName();
127
137
  }
128
138
 
139
+ function getUserRoles$1() {
140
+ if (currentProvider === undefined) {
141
+ return undefined;
142
+ }
143
+
144
+ return currentProvider.getUserRoles();
145
+ }
146
+
129
147
  function getUserId$1() {
130
148
  if (currentProvider === undefined) {
131
149
  return undefined;
@@ -151,9 +169,11 @@ const Auth = {
151
169
  isUserSignedIn: isUserSignedIn$1,
152
170
  getUserName: getUserName$1,
153
171
  getUserId: getUserId$1,
172
+ getUserRoles: getUserRoles$1,
154
173
  getUserPicUrl: getUserPicUrl$1,
155
174
  isAsync: isAsync$1,
156
- acquireTokens: acquireTokens$1
175
+ acquireTokens: acquireTokens$1,
176
+ acquireTokensByRequest: acquireTokensByRequest$1
157
177
  };
158
178
 
159
179
  // Copyright (c) Cosmo Tech.
@@ -164,7 +184,8 @@ let authData = null;
164
184
  function setDefaultUser() {
165
185
  authData = {
166
186
  userId: 1,
167
- userName: 'le dev'
187
+ userName: 'le dev',
188
+ roles: ['Organization.User']
168
189
  };
169
190
  }
170
191
 
@@ -198,6 +219,10 @@ function acquireTokens() {
198
219
  return undefined;
199
220
  }
200
221
 
222
+ function acquireTokensByRequest(tokenReq) {
223
+ return undefined;
224
+ }
225
+
201
226
  function getUserId() {
202
227
  if (authData) {
203
228
  return authData.userId;
@@ -206,6 +231,14 @@ function getUserId() {
206
231
  return undefined;
207
232
  }
208
233
 
234
+ function getUserRoles() {
235
+ if (authData) {
236
+ return authData.roles;
237
+ }
238
+
239
+ return undefined;
240
+ }
241
+
209
242
  function getUserPicUrl() {
210
243
  return undefined;
211
244
  }
@@ -216,10 +249,12 @@ const AuthDev = {
216
249
  signOut,
217
250
  isUserSignedIn,
218
251
  getUserName,
252
+ getUserRoles,
219
253
  getUserId,
220
254
  getUserPicUrl,
221
255
  isAsync,
222
- acquireTokens
256
+ acquireTokens,
257
+ acquireTokensByRequest
223
258
  };
224
259
 
225
260
  // Copyright (c) Cosmo Tech.
package/dist/index.esm.js CHANGED
@@ -104,6 +104,16 @@ function acquireTokens$1(callback) {
104
104
  return currentProvider.acquireTokens(callback);
105
105
  }
106
106
 
107
+ function acquireTokensByRequest$1(tokenReq) {
108
+ initProviderIfNull();
109
+
110
+ if (currentProvider === undefined) {
111
+ return undefined;
112
+ }
113
+
114
+ return currentProvider.acquireTokensByRequest(tokenReq);
115
+ }
116
+
107
117
  function isUserSignedIn$1(callback) {
108
118
  initProviderIfNull();
109
119
 
@@ -122,6 +132,14 @@ function getUserName$1() {
122
132
  return currentProvider.getUserName();
123
133
  }
124
134
 
135
+ function getUserRoles$1() {
136
+ if (currentProvider === undefined) {
137
+ return undefined;
138
+ }
139
+
140
+ return currentProvider.getUserRoles();
141
+ }
142
+
125
143
  function getUserId$1() {
126
144
  if (currentProvider === undefined) {
127
145
  return undefined;
@@ -147,9 +165,11 @@ const Auth = {
147
165
  isUserSignedIn: isUserSignedIn$1,
148
166
  getUserName: getUserName$1,
149
167
  getUserId: getUserId$1,
168
+ getUserRoles: getUserRoles$1,
150
169
  getUserPicUrl: getUserPicUrl$1,
151
170
  isAsync: isAsync$1,
152
- acquireTokens: acquireTokens$1
171
+ acquireTokens: acquireTokens$1,
172
+ acquireTokensByRequest: acquireTokensByRequest$1
153
173
  };
154
174
 
155
175
  // Copyright (c) Cosmo Tech.
@@ -160,7 +180,8 @@ let authData = null;
160
180
  function setDefaultUser() {
161
181
  authData = {
162
182
  userId: 1,
163
- userName: 'le dev'
183
+ userName: 'le dev',
184
+ roles: ['Organization.User']
164
185
  };
165
186
  }
166
187
 
@@ -194,6 +215,10 @@ function acquireTokens() {
194
215
  return undefined;
195
216
  }
196
217
 
218
+ function acquireTokensByRequest(tokenReq) {
219
+ return undefined;
220
+ }
221
+
197
222
  function getUserId() {
198
223
  if (authData) {
199
224
  return authData.userId;
@@ -202,6 +227,14 @@ function getUserId() {
202
227
  return undefined;
203
228
  }
204
229
 
230
+ function getUserRoles() {
231
+ if (authData) {
232
+ return authData.roles;
233
+ }
234
+
235
+ return undefined;
236
+ }
237
+
205
238
  function getUserPicUrl() {
206
239
  return undefined;
207
240
  }
@@ -212,10 +245,12 @@ const AuthDev = {
212
245
  signOut,
213
246
  isUserSignedIn,
214
247
  getUserName,
248
+ getUserRoles,
215
249
  getUserId,
216
250
  getUserPicUrl,
217
251
  isAsync,
218
- acquireTokens
252
+ acquireTokens,
253
+ acquireTokensByRequest
219
254
  };
220
255
 
221
256
  // Copyright (c) Cosmo Tech.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cosmotech/core",
3
3
  "private": false,
4
- "version": "1.3.14",
4
+ "version": "1.4.3",
5
5
  "description": "",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.esm.js",