cidaas-javascript-sdk 2.0.7 → 2.0.10

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/README.md CHANGED
@@ -16,9 +16,9 @@ This cidaas Javascript SDK library is built on the top of [OIDC client javascrip
16
16
  From CDN
17
17
 
18
18
  ```html
19
- <!-- Release version 2.0.7 -->
19
+ <!-- Release version 2.0.9 -->
20
20
  <!-- Minified version -->
21
- <script src="https://cdn.cidaas.de/javascript/oidc/2.0.7/cidaas-javascript-sdk.min.js"></script>
21
+ <script src="https://cdn.cidaas.de/javascript/oidc/2.0.9/cidaas-javascript-sdk.min.js"></script>
22
22
  ```
23
23
 
24
24
  From npm
package/package.json CHANGED
@@ -1,18 +1,20 @@
1
1
  {
2
2
  "name": "cidaas-javascript-sdk",
3
- "version": "2.0.7",
3
+ "version": "2.0.10",
4
4
  "author": "cidaas by Widas ID GmbH",
5
5
  "description": "Cidaas native javascript sdk",
6
6
  "license": "MIT",
7
7
  "main": "src/main/index.js",
8
+ "types": "types/main/index.d.ts",
8
9
  "engine": {
9
10
  "node": ">=8.9.10"
10
11
  },
11
12
  "scripts": {
12
13
  "dev": "webpack --config webpack.dev.js",
13
- "build": "webpack --config webpack.prod.js",
14
+ "build": "npm run build-types && webpack --config webpack.prod.js",
14
15
  "test": "jest --coverage",
15
- "test:coverage": "jest --coverage"
16
+ "test:coverage": "jest --coverage",
17
+ "build-types": "npx -p typescript tsc src/**/*.js --declaration --allowJs --emitDeclarationOnly --outDir types"
16
18
  },
17
19
  "dependencies": {
18
20
  "crypto-js": "^3.1.9-1",
@@ -22,6 +24,7 @@
22
24
  "compression-webpack-plugin": "^7.1.2",
23
25
  "jest": "26.6.3",
24
26
  "terser-webpack-plugin": "^5.1.1",
27
+ "typescript": "^4.5.4",
25
28
  "webpack": "^5.27.2",
26
29
  "webpack-cli": "^4.5.0",
27
30
  "webpack-dev-server": "^3.11.2",
@@ -33,4 +36,4 @@
33
36
  "src/main/**/*.{js,jsx,mjs}"
34
37
  ]
35
38
  }
36
- }
39
+ }
@@ -83,9 +83,9 @@ WebAuth.prototype.loginCallback = function () {
83
83
  } else if (window.webAuthSettings.mode == 'window') {
84
84
  window.authentication.popupSignInCallback();
85
85
  } else if (window.webAuthSettings.mode == 'silent') {
86
- window.authentication.silentSignInCallbackV2().then(function(data){
86
+ window.authentication.silentSignInCallbackV2().then(function (data) {
87
87
  resolve(data);
88
- }).catch(function(error){
88
+ }).catch(function (error) {
89
89
  reject(error);
90
90
  })
91
91
  }
@@ -599,6 +599,10 @@ WebAuth.prototype.register = function (options, headers) {
599
599
  if (headers.bot_captcha_response) {
600
600
  http.setRequestHeader("bot_captcha_response", headers.bot_captcha_response);
601
601
  }
602
+ let trackId = headers.trackid || headers.trackId;
603
+ if (trackId) {
604
+ http.setRequestHeader("trackid", trackId);
605
+ }
602
606
  http.send(JSON.stringify(options));
603
607
  } catch (ex) {
604
608
  reject(ex);
@@ -1125,6 +1129,26 @@ WebAuth.prototype.scopeConsentContinue = function (options) {
1125
1129
  }
1126
1130
  };
1127
1131
 
1132
+ // accept claim Consent
1133
+ WebAuth.prototype.acceptClaimConsent = function (options) {
1134
+ var _serviceURL = window.webAuthSettings.authority + "/consent-management-srv/consent/claim/accept";
1135
+ return createPostPromise(options, _serviceURL, false);
1136
+ };
1137
+
1138
+ // claim consent continue login
1139
+ WebAuth.prototype.claimConsentContinue = function (options) {
1140
+ try {
1141
+ var form = document.createElement('form');
1142
+ form.action = window.webAuthSettings.authority + "/login-srv/precheck/continue/" + options.track_id;
1143
+ form.method = 'POST';
1144
+ document.body.appendChild(form);
1145
+ form.submit();
1146
+ } catch (ex) {
1147
+ throw new CustomException(ex, 417);
1148
+ }
1149
+ };
1150
+
1151
+
1128
1152
  // get Deduplication details
1129
1153
  WebAuth.prototype.getDeduplicationDetails = function (options) {
1130
1154
  return new Promise(function (resolve, reject) {
package/tsconfig.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ // Change this to match your project
3
+ "include": ["src/**/*"],
4
+ "compilerOptions": {
5
+ // Tells TypeScript to read JS files, as
6
+ // normally they are ignored as source files
7
+ "allowJs": true,
8
+ // Generate d.ts files
9
+ "declaration": true,
10
+ // This compiler run should
11
+ // only output d.ts files
12
+ "emitDeclarationOnly": true,
13
+ // Types should go into this directory.
14
+ // Removing this would place the .d.ts files
15
+ // next to the .js files
16
+ "outDir": "dist",
17
+ // go to js file when using IDE functions like
18
+ // "Go to Definition" in VSCode
19
+ "declarationMap": true
20
+ }
21
+ }
@@ -0,0 +1,15 @@
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
+ }
@@ -0,0 +1,5 @@
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 };
@@ -0,0 +1,7 @@
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
+ }
@@ -0,0 +1,132 @@
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
+ loginWithSocial(options: any, queryParams: any): void;
24
+ registerWithSocial(options: any, queryParams: any): void;
25
+ getMissingFields(options: any): Promise<any>;
26
+ getTenantInfo(): Promise<any>;
27
+ logoutUser(options: any): void;
28
+ getClientInfo(options: any): Promise<any>;
29
+ getRegistrationSetup(options: any): Promise<any>;
30
+ register(options: any, headers: any): Promise<any>;
31
+ getInviteUserDetails(options: any): Promise<any>;
32
+ getCommunicationStatus(options: any): Promise<any>;
33
+ initiateAccountVerification(options: any): void;
34
+ verifyAccount(options: any): Promise<any>;
35
+ initiateResetPassword(options: any): Promise<any>;
36
+ handleResetPassword(options: any): void;
37
+ resetPassword(options: any): void;
38
+ getMFAList(options: any): Promise<any>;
39
+ getMFAListV2(options: any): Promise<any>;
40
+ initiateMFAV2(options: any): Promise<any>;
41
+ initiateEmail(options: any): Promise<any>;
42
+ initiateEmailV2(options: any): Promise<any>;
43
+ initiateSMS(options: any): Promise<any>;
44
+ initiateSMSV2(options: any): Promise<any>;
45
+ initiateIVR(options: any): Promise<any>;
46
+ initiateIVRV2(options: any): Promise<any>;
47
+ initiateBackupcode(options: any): Promise<any>;
48
+ initiateBackupcodeV2(options: any): Promise<any>;
49
+ initiateTOTP(options: any): Promise<any>;
50
+ initiateTOTPV2(options: any): Promise<any>;
51
+ initiatePattern(options: any): Promise<any>;
52
+ initiatePatternV2(options: any): Promise<any>;
53
+ initiateTouchId(options: any): Promise<any>;
54
+ initiateTouchIdV2(options: any): Promise<any>;
55
+ initiateSmartPush(options: any): Promise<any>;
56
+ initiateSmartPushV2(options: any): Promise<any>;
57
+ initiateFace(options: any): Promise<any>;
58
+ initiateFaceV2(options: any): Promise<any>;
59
+ initiateVoice(options: any): Promise<any>;
60
+ initiateVoiceV2(options: any): Promise<any>;
61
+ authenticateMFAV2(options: any): Promise<any>;
62
+ cancelMFAV2(options: any): Promise<any>;
63
+ authenticateEmail(options: any): Promise<any>;
64
+ authenticateEmailV2(options: any): Promise<any>;
65
+ authenticateSMS(options: any): Promise<any>;
66
+ authenticateSMSV2(options: any): Promise<any>;
67
+ authenticateIVR(options: any): Promise<any>;
68
+ authenticateIVRV2(options: any): Promise<any>;
69
+ authenticateBackupcode(options: any): Promise<any>;
70
+ authenticateBackupcodeV2(options: any): Promise<any>;
71
+ authenticateTOTP(options: any): Promise<any>;
72
+ authenticateTOTPV2(options: any): Promise<any>;
73
+ passwordlessLogin(options: any): void;
74
+ getConsentDetails(options: any): Promise<any>;
75
+ getConsentDetailsV2(options: any): Promise<any>;
76
+ acceptConsent(options: any): Promise<any>;
77
+ acceptConsentV2(options: any): Promise<any>;
78
+ getScopeConsentDetails(options: any): Promise<any>;
79
+ getScopeConsentVersionDetailsV2(options: any): Promise<any>;
80
+ acceptScopeConsent(options: any): Promise<any>;
81
+ scopeConsentContinue(options: any): void;
82
+ acceptClaimConsent(options: any): Promise<any>;
83
+ claimConsentContinue(options: any): void;
84
+ getDeduplicationDetails(options: any): Promise<any>;
85
+ deduplicationLogin(options: any): void;
86
+ registerDeduplication(options: any): Promise<any>;
87
+ consentContinue(options: any): void;
88
+ mfaContinue(options: any): void;
89
+ firstTimeChangePassword(options: any): void;
90
+ changePassword(options: any, access_token: any): Promise<any>;
91
+ updateProfile(options: any, access_token: any, sub: any): Promise<any>;
92
+ getUserActivities(options: any, access_token: any): Promise<any>;
93
+ getUnreviewedDevices(access_token: any, sub: any): Promise<any>;
94
+ getReviewedDevices(access_token: any, sub: any): Promise<any>;
95
+ reviewDevice(options: any, access_token: any, sub: any): Promise<any>;
96
+ getAcceptedConsentList(options: any, access_token: any): Promise<any>;
97
+ viewAcceptedConsent(options: any, access_token: any): Promise<any>;
98
+ getConfiguredVerificationList(options: any, access_token: any): Promise<any>;
99
+ initiateLinkAccount(options: any, access_token: any): Promise<any>;
100
+ completeLinkAccount(options: any, access_token: any): Promise<any>;
101
+ getLinkedUsers(access_token: any, sub: any): Promise<any>;
102
+ unlinkAccount(access_token: any, identityId: any): Promise<any>;
103
+ getAllVerificationList(access_token: any): Promise<any>;
104
+ updateProfileImage(options: any, access_token: any): Promise<any>;
105
+ setupEmail(options: any): Promise<any>;
106
+ setupSMS(options: any): Promise<any>;
107
+ setupIVR(options: any): Promise<any>;
108
+ setupBackupcode(options: any, access_token: any): Promise<any>;
109
+ setupTOTP(options: any, access_token: any): Promise<any>;
110
+ setupPattern(options: any, access_token: any): Promise<any>;
111
+ setupTouchId(options: any, access_token: any): Promise<any>;
112
+ setupSmartPush(options: any, access_token: any): Promise<any>;
113
+ setupFace(options: any, access_token: any): Promise<any>;
114
+ setupVoice(options: any, access_token: any): Promise<any>;
115
+ enrollEmail(options: any, access_token: any): Promise<any>;
116
+ enrollSMS(options: any, access_token: any): Promise<any>;
117
+ enrollIVR(options: any, access_token: any): Promise<any>;
118
+ enrollTOTP(options: any, access_token: any): Promise<any>;
119
+ updateSuggestMFA(track_id: any, options: any): Promise<any>;
120
+ enrollVerification(options: any): Promise<any>;
121
+ updateSocket(status_id: any): Promise<any>;
122
+ setupFidoVerification(options: any): Promise<any>;
123
+ checkVerificationTypeConfigured(options: any): Promise<any>;
124
+ authenticateVerification(options: any): Promise<any>;
125
+ authenticateFaceVerification(options: any): Promise<any>;
126
+ initiateVerification(options: any): Promise<any>;
127
+ deleteUserAccount(options: any): Promise<any>;
128
+ getMissingFieldsLogin(trackId: any): Promise<any>;
129
+ progressiveRegistration(options: any, headers: any): Promise<any>;
130
+ loginAfterRegister(options: any): void;
131
+ userCheckExists(options: any): Promise<any>;
132
+ }
@@ -0,0 +1,2 @@
1
+ export = sum;
2
+ declare function sum(a: any, b: any): any;
@@ -0,0 +1 @@
1
+ export {};