cidaas-javascript-sdk 2.2.3 → 2.2.5

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/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ ## [2.2.5](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/compare/v2.2.4...v2.2.5) (2023-01-31)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **[gitlab-240](https://gitlab.widas.de/cidaas-v2/auth/issues/-/issues/240):** removed deviceUUID package ([7a06262](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/7a062620d8279fea170e4f656f21f4c136bbe7ad))
7
+ * removed nexus ([fe57fd9](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/fe57fd9cb77634bee184cf5e2dd6045af9bf648d))
8
+ * sync from development ([4d38430](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/4d3843018999401ef82ea52e998b910b992d4067))
9
+ * sync from development ([35294aa](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/35294aa746b2a5e488f826970faad2f23bedca37))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cidaas-javascript-sdk",
3
- "version": "2.2.3",
3
+ "version": "2.2.5",
4
4
  "author": "cidaas by Widas ID GmbH",
5
5
  "description": "Cidaas native javascript sdk",
6
6
  "license": "MIT",
@@ -3,6 +3,7 @@ var CustomException = require('./exception');
3
3
  var Oidc = require('oidc-client');
4
4
  var CryptoJS = require("crypto-js");
5
5
 
6
+
6
7
  var code_verifier;
7
8
 
8
9
  function WebAuth(settings) {
@@ -594,6 +595,66 @@ WebAuth.prototype.getClientInfo = function (options) {
594
595
  });
595
596
  };
596
597
 
598
+ // get all devices associated to the client
599
+ WebAuth.prototype.getDevicesInfo = function (options) {
600
+ return new Promise(function (resolve, reject) {
601
+ try {
602
+ var http = new XMLHttpRequest();
603
+ var _serviceURL = window.webAuthSettings.authority + "/device-srv/devices";
604
+ http.onreadystatechange = function () {
605
+ if (http.readyState == 4) {
606
+ if (http.responseText) {
607
+ resolve(JSON.parse(http.responseText));
608
+ } else {
609
+ resolve(false);
610
+ }
611
+ }
612
+ };
613
+ http.open("GET", _serviceURL, true);
614
+ http.setRequestHeader("Content-type", "application/json");
615
+ if (window.localeSettings) {
616
+ http.setRequestHeader("accept-language", window.localeSettings);
617
+ }
618
+ if(window.navigator.userAgent) {
619
+ http.setRequestBody("userAgent", window.navigator.userAgent)
620
+ }
621
+ http.send();
622
+ } catch (ex) {
623
+ reject(ex);
624
+ }
625
+ });
626
+ };
627
+
628
+ // delete a device
629
+ WebAuth.prototype.deleteDevice = function (options) {
630
+ return new Promise(function (resolve, reject) {
631
+ try {
632
+ var http = new XMLHttpRequest();
633
+ var _serviceURL = window.webAuthSettings.authority + "/device-srv/device/" + options.device_id;
634
+ http.onreadystatechange = function () {
635
+ if (http.readyState == 4) {
636
+ if (http.responseText) {
637
+ resolve(JSON.parse(http.responseText));
638
+ } else {
639
+ resolve(false);
640
+ }
641
+ }
642
+ };
643
+ http.open("DELETE", _serviceURL, true);
644
+ http.setRequestHeader("Content-type", "application/json");
645
+ if (window.localeSettings) {
646
+ http.setRequestHeader("accept-language", window.localeSettings);
647
+ }
648
+ if(window.navigator.userAgent) {
649
+ http.setRequestBody("userAgent", window.navigator.userAgent)
650
+ }
651
+ http.send();
652
+ } catch (ex) {
653
+ reject(ex);
654
+ }
655
+ });
656
+ };
657
+
597
658
  // get Registration setup
598
659
  WebAuth.prototype.getRegistrationSetup = function (options) {
599
660
  return new Promise(function (resolve, reject) {
@@ -1880,7 +1941,9 @@ WebAuth.prototype.setAcceptLanguageHeader = function (acceptLanguage) {
1880
1941
  WebAuth.prototype.getDeviceInfo = function (options) {
1881
1942
  return new Promise(function (resolve, reject) {
1882
1943
  try {
1883
- options.deviceFingerprint = self.crypto.randomUUID();
1944
+ if(!options.deviceFingerprint) {
1945
+ options.deviceFingerprint = self.crypto.randomUUID();
1946
+ }
1884
1947
  var http = new XMLHttpRequest();
1885
1948
  var _serviceURL = window.webAuthSettings.authority + "/device-srv/deviceinfo";
1886
1949
  http.onreadystatechange = function () {
@@ -0,0 +1,4 @@
1
+ function sum(a, b) {
2
+ return a + b;
3
+ }
4
+ module.exports = sum;
@@ -0,0 +1,5 @@
1
+ const sum = require('./sum');
2
+
3
+ test('adds 1 + 2 to equal 3', () => {
4
+ expect(sum(1, 2)).toBe(3);
5
+ });
Binary file
@@ -1,15 +0,0 @@
1
- export = Authentication;
2
- declare function Authentication(): void;
3
- declare class Authentication {
4
- redirectSignIn(view_type: any): void;
5
- redirectSignInCallback(): Promise<any>;
6
- redirectSignOut(): Promise<any>;
7
- redirectSignOutCallback(): Promise<any>;
8
- popupSignIn(): void;
9
- popupSignInCallback(): void;
10
- popupSignOut(): void;
11
- popupSignOutCallback(): void;
12
- silentSignIn(): void;
13
- silentSignInCallback(): void;
14
- silentSignInCallbackV2(): Promise<any>;
15
- }
package/types/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import WebAuth = require("./web-auth/webauth");
2
- import CustomException = require("./web-auth/exception");
3
- import Authentication = require("./authentication");
4
- export declare const Version: any;
5
- export { WebAuth, CustomException, Authentication };
@@ -1,7 +0,0 @@
1
- export = CustomException;
2
- declare function CustomException(errorMessage: any, statusCode: any): void;
3
- declare class CustomException {
4
- constructor(errorMessage: any, statusCode: any);
5
- message: any;
6
- status: any;
7
- }
@@ -1,138 +0,0 @@
1
- export = WebAuth;
2
- declare function WebAuth(settings: any): void;
3
- declare class WebAuth {
4
- constructor(settings: any);
5
- loginWithBrowser(): void;
6
- registerWithBrowser(): void;
7
- loginCallback(): Promise<any>;
8
- getUserInfo(): Promise<any>;
9
- getUserProfile(options: any): Promise<any>;
10
- getProfileInfo(access_token: any): Promise<any>;
11
- logout(): Promise<any>;
12
- logoutCallback(): Promise<any>;
13
- renewToken(options: any): Promise<any>;
14
- generateCodeVerifier(): void;
15
- generateRandomString(length: any): string;
16
- generateCodeChallenge(code_verifier: any): any;
17
- base64URL(string: any): any;
18
- getLoginURL(): string;
19
- getAccessToken(options: any): Promise<any>;
20
- validateAccessToken(options: any): Promise<any>;
21
- getRequestId(): Promise<any>;
22
- loginWithCredentials(options: any): void;
23
- loginWithCredentialsAsynFn(options: any): Promise<Response>;
24
- loginWithSocial(options: any, queryParams: any): void;
25
- registerWithSocial(options: any, queryParams: any): void;
26
- getMissingFields(options: any): Promise<any>;
27
- getTenantInfo(): Promise<any>;
28
- logoutUser(options: any): void;
29
- getClientInfo(options: any): Promise<any>;
30
- getRegistrationSetup(options: any): Promise<any>;
31
- register(options: any, headers: any): Promise<any>;
32
- getInviteUserDetails(options: any): Promise<any>;
33
- getCommunicationStatus(options: any): Promise<any>;
34
- initiateAccountVerification(options: any): void;
35
- initiateAccountVerificationAsynFn(options: any): Promise<Response>;
36
- verifyAccount(options: any): Promise<any>;
37
- initiateResetPassword(options: any): Promise<any>;
38
- handleResetPassword(options: any): void;
39
- resetPassword(options: any): void;
40
- getMFAList(options: any): Promise<any>;
41
- getMFAListV2(options: any): Promise<any>;
42
- initiateMFAV2(options: any): Promise<any>;
43
- initiateEmail(options: any): Promise<any>;
44
- initiateEmailV2(options: any): Promise<any>;
45
- initiateSMS(options: any): Promise<any>;
46
- initiateSMSV2(options: any): Promise<any>;
47
- initiateIVR(options: any): Promise<any>;
48
- initiateIVRV2(options: any): Promise<any>;
49
- initiateBackupcode(options: any): Promise<any>;
50
- initiateBackupcodeV2(options: any): Promise<any>;
51
- initiateTOTP(options: any): Promise<any>;
52
- initiateTOTPV2(options: any): Promise<any>;
53
- initiatePattern(options: any): Promise<any>;
54
- initiatePatternV2(options: any): Promise<any>;
55
- initiateTouchId(options: any): Promise<any>;
56
- initiateTouchIdV2(options: any): Promise<any>;
57
- initiateSmartPush(options: any): Promise<any>;
58
- initiateSmartPushV2(options: any): Promise<any>;
59
- initiateFace(options: any): Promise<any>;
60
- initiateFaceV2(options: any): Promise<any>;
61
- initiateVoice(options: any): Promise<any>;
62
- initiateVoiceV2(options: any): Promise<any>;
63
- authenticateMFAV2(options: any): Promise<any>;
64
- cancelMFAV2(options: any): Promise<any>;
65
- authenticateEmail(options: any): Promise<any>;
66
- authenticateEmailV2(options: any): Promise<any>;
67
- authenticateSMS(options: any): Promise<any>;
68
- authenticateSMSV2(options: any): Promise<any>;
69
- authenticateIVR(options: any): Promise<any>;
70
- authenticateIVRV2(options: any): Promise<any>;
71
- authenticateBackupcode(options: any): Promise<any>;
72
- authenticateBackupcodeV2(options: any): Promise<any>;
73
- authenticateTOTP(options: any): Promise<any>;
74
- authenticateTOTPV2(options: any): Promise<any>;
75
- passwordlessLogin(options: any): void;
76
- getConsentDetails(options: any): Promise<any>;
77
- getConsentDetailsV2(options: any): Promise<any>;
78
- acceptConsent(options: any): Promise<any>;
79
- acceptConsentV2(options: any): Promise<any>;
80
- getScopeConsentDetails(options: any): Promise<any>;
81
- getScopeConsentVersionDetailsV2(options: any): Promise<any>;
82
- acceptScopeConsent(options: any): Promise<any>;
83
- scopeConsentContinue(options: any): void;
84
- acceptClaimConsent(options: any): Promise<any>;
85
- claimConsentContinue(options: any): void;
86
- revokeClaimConsent(options: any): Promise<any>;
87
- getDeduplicationDetails(options: any): Promise<any>;
88
- deduplicationLogin(options: any): void;
89
- registerDeduplication(options: any): Promise<any>;
90
- consentContinue(options: any): void;
91
- mfaContinue(options: any): void;
92
- firstTimeChangePassword(options: any): void;
93
- changePassword(options: any, access_token: any): Promise<any>;
94
- updateProfile(options: any, access_token: any, sub: any): Promise<any>;
95
- getUserActivities(options: any, access_token: any): Promise<any>;
96
- getUnreviewedDevices(access_token: any, sub: any): Promise<any>;
97
- getReviewedDevices(access_token: any, sub: any): Promise<any>;
98
- reviewDevice(options: any, access_token: any, sub: any): Promise<any>;
99
- getAcceptedConsentList(options: any, access_token: any): Promise<any>;
100
- viewAcceptedConsent(options: any, access_token: any): Promise<any>;
101
- getConfiguredVerificationList(options: any, access_token: any): Promise<any>;
102
- initiateLinkAccount(options: any, access_token: any): Promise<any>;
103
- completeLinkAccount(options: any, access_token: any): Promise<any>;
104
- getLinkedUsers(access_token: any, sub: any): Promise<any>;
105
- unlinkAccount(access_token: any, identityId: any): Promise<any>;
106
- getAllVerificationList(access_token: any): Promise<any>;
107
- updateProfileImage(options: any, access_token: any): Promise<any>;
108
- setupEmail(options: any): Promise<any>;
109
- setupSMS(options: any): Promise<any>;
110
- setupIVR(options: any): Promise<any>;
111
- setupBackupcode(options: any, access_token: any): Promise<any>;
112
- setupTOTP(options: any, access_token: any): Promise<any>;
113
- setupPattern(options: any, access_token: any): Promise<any>;
114
- setupTouchId(options: any, access_token: any): Promise<any>;
115
- setupSmartPush(options: any, access_token: any): Promise<any>;
116
- setupFace(options: any, access_token: any): Promise<any>;
117
- setupVoice(options: any, access_token: any): Promise<any>;
118
- enrollEmail(options: any, access_token: any): Promise<any>;
119
- enrollSMS(options: any, access_token: any): Promise<any>;
120
- enrollIVR(options: any, access_token: any): Promise<any>;
121
- enrollTOTP(options: any, access_token: any): Promise<any>;
122
- updateSuggestMFA(track_id: any, options: any): Promise<any>;
123
- enrollVerification(options: any): Promise<any>;
124
- updateSocket(status_id: any): Promise<any>;
125
- setupFidoVerification(options: any): Promise<any>;
126
- checkVerificationTypeConfigured(options: any): Promise<any>;
127
- authenticateVerification(options: any): Promise<any>;
128
- authenticateFaceVerification(options: any): Promise<any>;
129
- initiateVerification(options: any): Promise<any>;
130
- deleteUserAccount(options: any): Promise<any>;
131
- getMissingFieldsLogin(trackId: any): Promise<any>;
132
- progressiveRegistration(options: any, headers: any): Promise<any>;
133
- loginAfterRegister(options: any): void;
134
- deviceCodeVerify(code: any): void;
135
- userCheckExists(options: any): Promise<any>;
136
- setAcceptLanguageHeader(acceptLanguage: any): void;
137
- getDeviceInfo(options: any): Promise<any>;
138
- }