cidaas-javascript-sdk 4.0.1 → 4.1.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/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
# [4.1.0](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/compare/v4.0.2...v4.1.0) (2024-01-19)
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
###
|
|
4
|
+
### Features
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* **[1441](https://gitlab.widas.de/cidaas-v2/framework/issues/-/issues/1441):** Add the new method for Get Invite User details ([5917eb0](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/5917eb0cf98248c66d0b149cb41cf27be69c41ae))
|
|
7
|
+
* **[1441](https://gitlab.widas.de/cidaas-v2/framework/issues/-/issues/1441):** Add the new method for Get Invite User details ([ffc503d](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/ffc503dfde2510c8000e18cb437b5ab0a7578ee8))
|
|
8
|
+
* **[1441](https://gitlab.widas.de/cidaas-v2/framework/issues/-/issues/1441):** Add the new method for Get Invite User details ([a3d2860](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/a3d28601490b0303c9f86b60aeda3c5a46788966))
|
|
9
|
+
* **[1441](https://gitlab.widas.de/cidaas-v2/framework/issues/-/issues/1441):** Add the new method for Get Invite User details ([88cd3b7](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/88cd3b766de7ede953594cc47d34d6e45dc3e17b))
|
|
10
|
+
* **[1441](https://gitlab.widas.de/cidaas-v2/framework/issues/-/issues/1441):** Add the new method for Get Invite User details ([1c347ef](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/1c347efc9a54d787538416b3eee1d609238b4b1d))
|
|
11
|
+
* **[1441](https://gitlab.widas.de/cidaas-v2/framework/issues/-/issues/1441):** Add the new method for Get Invite User details ([df4630a](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/df4630a8d8def6ef36d402f230f6ada86875e71e))
|
|
12
|
+
* **[1441](https://gitlab.widas.de/cidaas-v2/framework/issues/-/issues/1441):** Add the new method for Get Invite User details ([3a2ce7e](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/3a2ce7ec82b3ae91ffc8066081f905972f278985))
|
|
7
13
|
|
|
8
14
|
# Changelog
|
|
9
15
|
|
|
16
|
+
## V4.1.0
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
- add latest getInviteUserDetails API, which can be called by specifying function parameter callLatestAPI: true
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
- support trailing slash on Cidaas options: 'authority'
|
|
23
|
+
|
|
24
|
+
## V4.0.2
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
- fix missing error handling in loginCallback() function
|
|
28
|
+
|
|
10
29
|
## V4.0.1
|
|
11
30
|
|
|
12
31
|
### Changed
|
|
@@ -55,11 +55,14 @@ export declare namespace UserService {
|
|
|
55
55
|
trackId?: string;
|
|
56
56
|
}): Promise<unknown>;
|
|
57
57
|
/**
|
|
58
|
-
* to get information about invitation details, call **getInviteUserDetails()
|
|
58
|
+
* to get information about invitation details, call **getInviteUserDetails()**. This API allows to retrieve invitation details and prefill the registration form.
|
|
59
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/0b5efa5a2db5d-prefill-the-user-invitation for more details.
|
|
60
|
+
* Minimum cidaas version to use latest api is v3.100
|
|
59
61
|
* @example
|
|
60
62
|
* ```js
|
|
61
63
|
* const options = {
|
|
62
64
|
* invite_id: 'id of user invitation'
|
|
65
|
+
* callLatestAPI: 'true' // call latest api if parameter is given. By default, the older api will be called
|
|
63
66
|
* }
|
|
64
67
|
* cidaas.getInviteUserDetails(options)
|
|
65
68
|
* .then(function () {
|
|
@@ -71,6 +74,7 @@ export declare namespace UserService {
|
|
|
71
74
|
*/
|
|
72
75
|
function getInviteUserDetails(options: {
|
|
73
76
|
invite_id: string;
|
|
77
|
+
callLatestAPI?: boolean;
|
|
74
78
|
}): Promise<unknown>;
|
|
75
79
|
/**
|
|
76
80
|
* Once registration successful, verify the account based on the flow. To get the details, call **getCommunicationStatus()**.
|
|
@@ -67,11 +67,14 @@ var UserService;
|
|
|
67
67
|
UserService.register = register;
|
|
68
68
|
;
|
|
69
69
|
/**
|
|
70
|
-
* to get information about invitation details, call **getInviteUserDetails()
|
|
70
|
+
* to get information about invitation details, call **getInviteUserDetails()**. This API allows to retrieve invitation details and prefill the registration form.
|
|
71
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/0b5efa5a2db5d-prefill-the-user-invitation for more details.
|
|
72
|
+
* Minimum cidaas version to use latest api is v3.100
|
|
71
73
|
* @example
|
|
72
74
|
* ```js
|
|
73
75
|
* const options = {
|
|
74
76
|
* invite_id: 'id of user invitation'
|
|
77
|
+
* callLatestAPI: 'true' // call latest api if parameter is given. By default, the older api will be called
|
|
75
78
|
* }
|
|
76
79
|
* cidaas.getInviteUserDetails(options)
|
|
77
80
|
* .then(function () {
|
|
@@ -82,7 +85,13 @@ var UserService;
|
|
|
82
85
|
* ```
|
|
83
86
|
*/
|
|
84
87
|
function getInviteUserDetails(options) {
|
|
85
|
-
var _serviceURL =
|
|
88
|
+
var _serviceURL = "";
|
|
89
|
+
if (options.callLatestAPI) {
|
|
90
|
+
_serviceURL = window.webAuthSettings.authority + "/useractions-srv/invitations/" + options.invite_id;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
_serviceURL = window.webAuthSettings.authority + "/users-srv/invite/info/" + options.invite_id;
|
|
94
|
+
}
|
|
86
95
|
return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
|
|
87
96
|
}
|
|
88
97
|
UserService.getInviteUserDetails = getInviteUserDetails;
|
package/dist/web-auth/WebAuth.js
CHANGED
|
@@ -65,6 +65,9 @@ var WebAuth = /** @class */ (function () {
|
|
|
65
65
|
if (!settings.scope) {
|
|
66
66
|
settings.scope = "email openid profile mobile";
|
|
67
67
|
}
|
|
68
|
+
if (settings.authority && settings.authority.charAt(settings.authority.length - 1) === '/') {
|
|
69
|
+
settings.authority = settings.authority.slice(0, settings.authority.length - 1);
|
|
70
|
+
}
|
|
68
71
|
var usermanager = new oidc_client_ts_1.UserManager(settings);
|
|
69
72
|
window.webAuthSettings = settings;
|
|
70
73
|
window.usermanager = usermanager;
|
|
@@ -151,19 +154,14 @@ var WebAuth = /** @class */ (function () {
|
|
|
151
154
|
*/
|
|
152
155
|
WebAuth.prototype.loginCallback = function () {
|
|
153
156
|
return new Promise(function (resolve, reject) {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
throw new Helper_1.CustomException("Settings or Authentication instance in OIDC cannot be empty", 417);
|
|
157
|
-
}
|
|
158
|
-
window.authentication.loginCallback().then(function (user) {
|
|
159
|
-
resolve(user);
|
|
160
|
-
})["catch"](function (ex) {
|
|
161
|
-
reject(ex);
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
catch (ex) {
|
|
165
|
-
console.log(ex);
|
|
157
|
+
if (!window.webAuthSettings && !window.authentication) {
|
|
158
|
+
throw new Helper_1.CustomException("Settings or Authentication instance in OIDC cannot be empty", 417);
|
|
166
159
|
}
|
|
160
|
+
window.authentication.loginCallback().then(function (user) {
|
|
161
|
+
resolve(user);
|
|
162
|
+
})["catch"](function (ex) {
|
|
163
|
+
reject(ex);
|
|
164
|
+
});
|
|
167
165
|
});
|
|
168
166
|
};
|
|
169
167
|
;
|