@simpleview/sv-auth-client 5.1.0 → 5.2.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 +1 -1
- package/src/prefixes/AuthPrefix.js +71 -0
package/package.json
CHANGED
|
@@ -476,6 +476,77 @@ class AuthPrefix {
|
|
|
476
476
|
return returnData;
|
|
477
477
|
}
|
|
478
478
|
|
|
479
|
+
async create_totp_factor({ fields, context }) {
|
|
480
|
+
context = context || this._graphServer.context;
|
|
481
|
+
|
|
482
|
+
const result = await query({
|
|
483
|
+
query : `
|
|
484
|
+
mutation {
|
|
485
|
+
auth {
|
|
486
|
+
create_totp_factor {
|
|
487
|
+
${fields}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
`,
|
|
492
|
+
url : this._graphUrl,
|
|
493
|
+
token : context.token
|
|
494
|
+
});
|
|
495
|
+
|
|
496
|
+
const returnData = result.auth.create_totp_factor;
|
|
497
|
+
|
|
498
|
+
nullToUndefined(returnData);
|
|
499
|
+
|
|
500
|
+
return returnData;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
async verify_totp_factor({ input, fields, context}) {
|
|
504
|
+
context = context || this._graphServer.context;
|
|
505
|
+
|
|
506
|
+
const result = await query({
|
|
507
|
+
query: `
|
|
508
|
+
query($input: auth_verify_totp_factor_input!) {
|
|
509
|
+
auth {
|
|
510
|
+
verify_totp_factor(input: $input) {
|
|
511
|
+
${fields}
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
`,
|
|
516
|
+
variables: {
|
|
517
|
+
input
|
|
518
|
+
},
|
|
519
|
+
url: this._graphUrl,
|
|
520
|
+
token: context.token
|
|
521
|
+
});
|
|
522
|
+
|
|
523
|
+
const returnData = result.auth.verify_totp_factor;
|
|
524
|
+
|
|
525
|
+
nullToUndefined(returnData)
|
|
526
|
+
|
|
527
|
+
return returnData;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
async verified_totp_factor({ input, fields }) {
|
|
531
|
+
const result = await query({
|
|
532
|
+
query : `
|
|
533
|
+
query($input: auth_verified_totp_factor_input!) {
|
|
534
|
+
auth {
|
|
535
|
+
verified_totp_factor(input: $input) {
|
|
536
|
+
${fields}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
`,
|
|
541
|
+
variables : {
|
|
542
|
+
input
|
|
543
|
+
},
|
|
544
|
+
url : this._graphUrl
|
|
545
|
+
});
|
|
546
|
+
|
|
547
|
+
return result.auth.verified_totp_factor;
|
|
548
|
+
}
|
|
549
|
+
|
|
479
550
|
async test_reset_data({ fields, context }) {
|
|
480
551
|
context = context || this._graphServer.context;
|
|
481
552
|
|