@simpleview/sv-auth-client 5.1.0 → 5.3.0

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": "@simpleview/sv-auth-client",
3
- "version": "5.1.0",
3
+ "version": "5.3.0",
4
4
  "description": "Client for communicating with sv-auth",
5
5
  "author": "Owen Allen <owenallenaz@gmail.com>",
6
6
  "dependencies": {
@@ -255,6 +255,26 @@ class AuthPrefix {
255
255
  return result.auth.login_google;
256
256
  }
257
257
 
258
+ async login_microsoft({ token, fields }) {
259
+ const result = await query({
260
+ query : `
261
+ query($token: String!) {
262
+ auth {
263
+ login_microsoft(token: $token) {
264
+ ${fields}
265
+ }
266
+ }
267
+ }
268
+ `,
269
+ variables : {
270
+ token
271
+ },
272
+ url : this._graphUrl
273
+ });
274
+
275
+ return result.auth.login_microsoft;
276
+ }
277
+
258
278
  async login_service_account({ input, fields }) {
259
279
  const result = await query({
260
280
  query : `
@@ -476,6 +496,77 @@ class AuthPrefix {
476
496
  return returnData;
477
497
  }
478
498
 
499
+ async create_totp_factor({ fields, context }) {
500
+ context = context || this._graphServer.context;
501
+
502
+ const result = await query({
503
+ query : `
504
+ mutation {
505
+ auth {
506
+ create_totp_factor {
507
+ ${fields}
508
+ }
509
+ }
510
+ }
511
+ `,
512
+ url : this._graphUrl,
513
+ token : context.token
514
+ });
515
+
516
+ const returnData = result.auth.create_totp_factor;
517
+
518
+ nullToUndefined(returnData);
519
+
520
+ return returnData;
521
+ }
522
+
523
+ async verify_totp_factor({ input, fields, context}) {
524
+ context = context || this._graphServer.context;
525
+
526
+ const result = await query({
527
+ query: `
528
+ query($input: auth_verify_totp_factor_input!) {
529
+ auth {
530
+ verify_totp_factor(input: $input) {
531
+ ${fields}
532
+ }
533
+ }
534
+ }
535
+ `,
536
+ variables: {
537
+ input
538
+ },
539
+ url: this._graphUrl,
540
+ token: context.token
541
+ });
542
+
543
+ const returnData = result.auth.verify_totp_factor;
544
+
545
+ nullToUndefined(returnData)
546
+
547
+ return returnData;
548
+ }
549
+
550
+ async verified_totp_factor({ input, fields }) {
551
+ const result = await query({
552
+ query : `
553
+ query($input: auth_verified_totp_factor_input!) {
554
+ auth {
555
+ verified_totp_factor(input: $input) {
556
+ ${fields}
557
+ }
558
+ }
559
+ }
560
+ `,
561
+ variables : {
562
+ input
563
+ },
564
+ url : this._graphUrl
565
+ });
566
+
567
+ return result.auth.verified_totp_factor;
568
+ }
569
+
479
570
  async test_reset_data({ fields, context }) {
480
571
  context = context || this._graphServer.context;
481
572