cidaas-javascript-sdk 4.3.3 → 5.0.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 +52 -5
- package/README.md +109 -93
- package/dist/authentication-service/AuthenticationService.d.ts +140 -0
- package/dist/authentication-service/AuthenticationService.js +210 -0
- package/dist/{authentication/Authentication.model.d.ts → authentication-service/AuthenticationService.model.d.ts} +18 -12
- package/dist/{authentication/Authentication.model.js → authentication-service/AuthenticationService.model.js} +2 -2
- package/dist/common/Common.model.d.ts +15 -19
- package/dist/common/Common.model.js +17 -17
- package/dist/common/ConfigUserProvider.d.ts +10 -0
- package/dist/common/ConfigUserProvider.js +28 -0
- package/dist/common/Helper.d.ts +7 -0
- package/dist/common/Helper.js +19 -0
- package/dist/common/User.model.d.ts +0 -4
- package/dist/consent-service/ConsentService.d.ts +99 -95
- package/dist/consent-service/ConsentService.js +125 -122
- package/dist/consent-service/ConsentService.model.d.ts +14 -16
- package/dist/device-service/DeviceService.d.ts +49 -0
- package/dist/device-service/DeviceService.js +79 -0
- package/dist/device-service/DeviceService.model.d.ts +6 -0
- package/dist/id-validation-service/IdValidationService.d.ts +28 -0
- package/dist/id-validation-service/IdValidationService.js +59 -0
- package/dist/id-validation-service/IdValidationService.model.d.ts +8 -0
- package/dist/id-validation-service/IdValidationService.model.js +2 -0
- package/dist/index.d.ts +22 -3
- package/dist/index.js +35 -18
- package/dist/login-service/LoginService.d.ts +143 -141
- package/dist/login-service/LoginService.js +225 -234
- package/dist/login-service/LoginService.model.d.ts +7 -51
- package/dist/login-service/LoginService.model.js +1 -1
- package/dist/public-service/PublicService.d.ts +57 -0
- package/dist/public-service/PublicService.js +73 -0
- package/dist/public-service/PublicService.model.d.ts +20 -0
- package/dist/public-service/PublicService.model.js +2 -0
- package/dist/token-service/TokenService.d.ts +104 -138
- package/dist/token-service/TokenService.js +164 -219
- package/dist/token-service/TokenService.model.d.ts +3 -44
- package/dist/token-service/TokenService.model.js +3 -16
- package/dist/user-service/UserService.d.ts +381 -315
- package/dist/user-service/UserService.js +552 -426
- package/dist/user-service/UserService.model.d.ts +48 -14
- package/dist/user-service/UserService.model.js +4 -4
- package/dist/verification-service/VerificationService.d.ts +281 -223
- package/dist/verification-service/VerificationService.js +343 -287
- package/dist/verification-service/VerificationService.model.d.ts +4 -5
- package/package.json +6 -4
- package/dist/authentication/Authentication.d.ts +0 -139
- package/dist/authentication/Authentication.js +0 -186
- package/dist/web-auth/WebAuth.d.ts +0 -665
- package/dist/web-auth/WebAuth.js +0 -955
- package/dist/web-auth/webauth.model.d.ts +0 -66
- /package/dist/{web-auth/webauth.model.js → device-service/DeviceService.model.js} +0 -0
|
@@ -1,97 +1,101 @@
|
|
|
1
1
|
import { HTTPRequestHeader } from "../common/Common.model";
|
|
2
|
+
import ConfigUserProvider from "../common/ConfigUserProvider";
|
|
2
3
|
import { AcceptClaimConsentRequest, AcceptConsentRequest, AcceptScopeConsentRequest, GetConsentDetailsRequest, GetConsentVersionDetailsRequest, RevokeClaimConsentRequest } from "./ConsentService.model";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
4
|
+
export declare class ConsentService {
|
|
5
|
+
private config;
|
|
6
|
+
private userManager;
|
|
7
|
+
constructor(configUserProvider: ConfigUserProvider);
|
|
8
|
+
/**
|
|
9
|
+
* To get consent details , call **getConsentDetails()**.
|
|
10
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/858fbeb51c62b-find-consent-info for more details.
|
|
11
|
+
* @example
|
|
12
|
+
* ```js
|
|
13
|
+
* cidaasConsentService.getConsentDetails({
|
|
14
|
+
* consent_id: 'consent id',
|
|
15
|
+
* consent_version_id: 'consent version id',
|
|
16
|
+
* sub: 'masked sub'
|
|
17
|
+
* })
|
|
18
|
+
* .then(function (response) {
|
|
19
|
+
* // type your code here
|
|
20
|
+
* })
|
|
21
|
+
* .catch(function (ex) {
|
|
22
|
+
* // your failure code here
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
getConsentDetails(options: GetConsentDetailsRequest, headers?: HTTPRequestHeader): Promise<any>;
|
|
27
|
+
/**
|
|
28
|
+
* To accept consent, call **acceptConsent()**.
|
|
29
|
+
* @example
|
|
30
|
+
* ```js
|
|
31
|
+
* cidaasConsentService.acceptConsent({
|
|
32
|
+
* client_id: 'your client id',
|
|
33
|
+
* consent_id: 'consent id',
|
|
34
|
+
* consent_version: 'consent version id',
|
|
35
|
+
* sub: 'masked sub'
|
|
36
|
+
* }).then((response) => {
|
|
37
|
+
* // the response will give you details of accepted consent.
|
|
38
|
+
* }).catch((err) => {
|
|
39
|
+
* // your failure code here
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
acceptConsent(options: AcceptConsentRequest, headers?: HTTPRequestHeader): Promise<any>;
|
|
44
|
+
/**
|
|
45
|
+
* To get version details of consent, call **getConsentVersionDetails()**.
|
|
46
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/7e24ac2113315-get-consent-version-details for more details.
|
|
47
|
+
* @example
|
|
48
|
+
* ```js
|
|
49
|
+
* cidaasConsentService.getConsentVersionDetails({
|
|
50
|
+
* consentid: 'your consent id',
|
|
51
|
+
* locale: 'browser accept language or custom language',
|
|
52
|
+
* }).then((response) => {
|
|
53
|
+
* // type your code here
|
|
54
|
+
* }).catch((err) => {
|
|
55
|
+
* // your failure code here
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
getConsentVersionDetails(options: GetConsentVersionDetailsRequest, headers?: HTTPRequestHeader): Promise<any>;
|
|
60
|
+
/**
|
|
61
|
+
* To accept scope consent, call **acceptScopeConsent()**.
|
|
62
|
+
* @example
|
|
63
|
+
* ```js
|
|
64
|
+
* cidaasConsentService.acceptScopeConsent({
|
|
65
|
+
* client_id: 'your client id',
|
|
66
|
+
* sub: 'masked sub',
|
|
67
|
+
* scopes: [your scope consents]
|
|
68
|
+
* });
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
acceptScopeConsent(options: AcceptScopeConsentRequest, headers?: HTTPRequestHeader): Promise<any>;
|
|
72
|
+
/**
|
|
73
|
+
* To accept claim consent, call **acceptClaimConsent()**.
|
|
74
|
+
* @example
|
|
75
|
+
* ```js
|
|
76
|
+
* cidaasConsentService.acceptClaimConsent({
|
|
77
|
+
* client_id: 'your client id',
|
|
78
|
+
* sub: 'masked sub',
|
|
79
|
+
* accepted_claims: [your claim consents]
|
|
80
|
+
* });
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
acceptClaimConsent(options: AcceptClaimConsentRequest, headers?: HTTPRequestHeader): Promise<any>;
|
|
84
|
+
/**
|
|
85
|
+
* To revoke claim consent, call **revokeClaimConsent()**.
|
|
86
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/9ae62e98842fe-revoke-user-consent-claim for more details.
|
|
87
|
+
* @example
|
|
88
|
+
* ```js
|
|
89
|
+
* cidaasConsentService.revokeClaimConsent({
|
|
90
|
+
* client_id: 'your client id',
|
|
91
|
+
* sub: 'masked sub'
|
|
92
|
+
* revoked_claims: [your claim consents]
|
|
93
|
+
* }).then((response) => {
|
|
94
|
+
* // the response will give you revoked claim consent.
|
|
95
|
+
* }).catch((err) => {
|
|
96
|
+
* // your failure code here
|
|
97
|
+
* });
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
revokeClaimConsent(options: RevokeClaimConsentRequest): Promise<any>;
|
|
101
|
+
}
|
|
@@ -1,127 +1,130 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ConsentService = void 0;
|
|
4
4
|
const Helper_1 = require("../common/Helper");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
_serviceURL
|
|
5
|
+
class ConsentService {
|
|
6
|
+
constructor(configUserProvider) {
|
|
7
|
+
this.config = configUserProvider.getConfig();
|
|
8
|
+
this.userManager = configUserProvider.getUserManager();
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* To get consent details , call **getConsentDetails()**.
|
|
12
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/858fbeb51c62b-find-consent-info for more details.
|
|
13
|
+
* @example
|
|
14
|
+
* ```js
|
|
15
|
+
* cidaasConsentService.getConsentDetails({
|
|
16
|
+
* consent_id: 'consent id',
|
|
17
|
+
* consent_version_id: 'consent version id',
|
|
18
|
+
* sub: 'masked sub'
|
|
19
|
+
* })
|
|
20
|
+
* .then(function (response) {
|
|
21
|
+
* // type your code here
|
|
22
|
+
* })
|
|
23
|
+
* .catch(function (ex) {
|
|
24
|
+
* // your failure code here
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
getConsentDetails(options, headers) {
|
|
29
|
+
const _serviceURL = this.config.authority + "/consent-management-srv/v2/consent/usage/public/info";
|
|
30
|
+
return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", undefined, headers);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* To accept consent, call **acceptConsent()**.
|
|
34
|
+
* @example
|
|
35
|
+
* ```js
|
|
36
|
+
* cidaasConsentService.acceptConsent({
|
|
37
|
+
* client_id: 'your client id',
|
|
38
|
+
* consent_id: 'consent id',
|
|
39
|
+
* consent_version: 'consent version id',
|
|
40
|
+
* sub: 'masked sub'
|
|
41
|
+
* }).then((response) => {
|
|
42
|
+
* // the response will give you details of accepted consent.
|
|
43
|
+
* }).catch((err) => {
|
|
44
|
+
* // your failure code here
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
acceptConsent(options, headers) {
|
|
49
|
+
const _serviceURL = this.config.authority + "/consent-management-srv/v2/consent/usage/accept";
|
|
50
|
+
return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", undefined, headers);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* To get version details of consent, call **getConsentVersionDetails()**.
|
|
54
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/7e24ac2113315-get-consent-version-details for more details.
|
|
55
|
+
* @example
|
|
56
|
+
* ```js
|
|
57
|
+
* cidaasConsentService.getConsentVersionDetails({
|
|
58
|
+
* consentid: 'your consent id',
|
|
59
|
+
* locale: 'browser accept language or custom language',
|
|
60
|
+
* }).then((response) => {
|
|
61
|
+
* // type your code here
|
|
62
|
+
* }).catch((err) => {
|
|
63
|
+
* // your failure code here
|
|
64
|
+
* });
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
getConsentVersionDetails(options, headers) {
|
|
68
|
+
let _serviceURL = this.config.authority + "/consent-management-srv/v2/consent/versions/details/" + options.consentid;
|
|
69
|
+
if (options.locale) {
|
|
70
|
+
_serviceURL += "?locale=" + options.locale;
|
|
71
|
+
}
|
|
72
|
+
return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET", undefined, headers);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* To accept scope consent, call **acceptScopeConsent()**.
|
|
76
|
+
* @example
|
|
77
|
+
* ```js
|
|
78
|
+
* cidaasConsentService.acceptScopeConsent({
|
|
79
|
+
* client_id: 'your client id',
|
|
80
|
+
* sub: 'masked sub',
|
|
81
|
+
* scopes: [your scope consents]
|
|
82
|
+
* });
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
acceptScopeConsent(options, headers) {
|
|
86
|
+
const _serviceURL = this.config.authority + "/consent-management-srv/consent/scope/accept";
|
|
87
|
+
return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", undefined, headers);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* To accept claim consent, call **acceptClaimConsent()**.
|
|
91
|
+
* @example
|
|
92
|
+
* ```js
|
|
93
|
+
* cidaasConsentService.acceptClaimConsent({
|
|
94
|
+
* client_id: 'your client id',
|
|
95
|
+
* sub: 'masked sub',
|
|
96
|
+
* accepted_claims: [your claim consents]
|
|
97
|
+
* });
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
acceptClaimConsent(options, headers) {
|
|
101
|
+
const _serviceURL = this.config.authority + "/consent-management-srv/consent/claim/accept";
|
|
102
|
+
return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", undefined, headers);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* To revoke claim consent, call **revokeClaimConsent()**.
|
|
106
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/9ae62e98842fe-revoke-user-consent-claim for more details.
|
|
107
|
+
* @example
|
|
108
|
+
* ```js
|
|
109
|
+
* cidaasConsentService.revokeClaimConsent({
|
|
110
|
+
* client_id: 'your client id',
|
|
111
|
+
* sub: 'masked sub'
|
|
112
|
+
* revoked_claims: [your claim consents]
|
|
113
|
+
* }).then((response) => {
|
|
114
|
+
* // the response will give you revoked claim consent.
|
|
115
|
+
* }).catch((err) => {
|
|
116
|
+
* // your failure code here
|
|
117
|
+
* });
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
revokeClaimConsent(options) {
|
|
121
|
+
const _serviceURL = this.config.authority + "/consent-management-srv/consent/claim/revoke";
|
|
122
|
+
if (options.access_token) {
|
|
123
|
+
return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", options.access_token);
|
|
124
|
+
}
|
|
125
|
+
return Helper_1.Helper.getAccessTokenFromUserStorage(this.userManager).then((accessToken) => {
|
|
126
|
+
return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", accessToken);
|
|
127
|
+
});
|
|
69
128
|
}
|
|
70
|
-
// BREAKING TODO: remove access token as it is not needed to get consent version details
|
|
71
|
-
return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET", options.access_token, headers);
|
|
72
|
-
}
|
|
73
|
-
exports.getConsentVersionDetails = getConsentVersionDetails;
|
|
74
|
-
/**
|
|
75
|
-
* To accept scope consent, call **acceptScopeConsent()**.
|
|
76
|
-
* @example
|
|
77
|
-
* ```js
|
|
78
|
-
* this.cidaas.acceptScopeConsent({
|
|
79
|
-
* client_id: 'your client id',
|
|
80
|
-
* sub: 'masked sub',
|
|
81
|
-
* scopes: [your scope consents]
|
|
82
|
-
* });
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
85
|
-
function acceptScopeConsent(options, headers) {
|
|
86
|
-
const _serviceURL = window.webAuthSettings.authority + "/consent-management-srv/consent/scope/accept";
|
|
87
|
-
return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", undefined, headers);
|
|
88
|
-
}
|
|
89
|
-
exports.acceptScopeConsent = acceptScopeConsent;
|
|
90
|
-
/**
|
|
91
|
-
* To accept claim consent, call **acceptClaimConsent()**.
|
|
92
|
-
* @example
|
|
93
|
-
* ```js
|
|
94
|
-
* this.cidaas.acceptClaimConsent({
|
|
95
|
-
* client_id: 'your client id',
|
|
96
|
-
* sub: 'masked sub',
|
|
97
|
-
* accepted_claims: [your claim consents]
|
|
98
|
-
* });
|
|
99
|
-
* ```
|
|
100
|
-
*/
|
|
101
|
-
function acceptClaimConsent(options, headers) {
|
|
102
|
-
const _serviceURL = window.webAuthSettings.authority + "/consent-management-srv/consent/claim/accept";
|
|
103
|
-
return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", undefined, headers);
|
|
104
|
-
}
|
|
105
|
-
exports.acceptClaimConsent = acceptClaimConsent;
|
|
106
|
-
/**
|
|
107
|
-
* To revoke claim consent, call **revokeClaimConsent()**.
|
|
108
|
-
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/9ae62e98842fe-revoke-user-consent-claim for more details.
|
|
109
|
-
* @example
|
|
110
|
-
* ```js
|
|
111
|
-
* this.cidaas.revokeClaimConsent({
|
|
112
|
-
* access_token: 'your access token',
|
|
113
|
-
* client_id: 'your client id',
|
|
114
|
-
* sub: 'masked sub'
|
|
115
|
-
* revoked_claims: [your claim consents]
|
|
116
|
-
* }).then((response) => {
|
|
117
|
-
* // the response will give you revoked claim consent.
|
|
118
|
-
* }).catch((err) => {
|
|
119
|
-
* // your failure code here
|
|
120
|
-
* });
|
|
121
|
-
* ```
|
|
122
|
-
*/
|
|
123
|
-
function revokeClaimConsent(options) {
|
|
124
|
-
const _serviceURL = window.webAuthSettings.authority + "/consent-management-srv/consent/claim/revoke";
|
|
125
|
-
return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", options.access_token);
|
|
126
129
|
}
|
|
127
|
-
exports.
|
|
130
|
+
exports.ConsentService = ConsentService;
|
|
@@ -6,12 +6,12 @@ export interface GetConsentDetailsRequest {
|
|
|
6
6
|
/**
|
|
7
7
|
* Masked sub (id of user), who will accept the consent.
|
|
8
8
|
* Either sub or q have to be provided, depends on what is given from the query parameter.
|
|
9
|
-
|
|
9
|
+
*/
|
|
10
10
|
sub?: string;
|
|
11
11
|
/**
|
|
12
12
|
* Masked sub (id of user), who will accept the consent.
|
|
13
13
|
* Either sub or q have to be provided, depends on what is given from the query parameter.
|
|
14
|
-
|
|
14
|
+
*/
|
|
15
15
|
q?: string;
|
|
16
16
|
}
|
|
17
17
|
export interface AcceptConsentRequest {
|
|
@@ -24,12 +24,12 @@ export interface AcceptConsentRequest {
|
|
|
24
24
|
/**
|
|
25
25
|
* Masked sub (id of user), who will accept the consent.
|
|
26
26
|
* Either sub or q have to be provided, depends on what is given from the query parameter.
|
|
27
|
-
|
|
27
|
+
*/
|
|
28
28
|
sub?: string;
|
|
29
29
|
/**
|
|
30
30
|
* Masked sub (id of user), who will accept the consent.
|
|
31
31
|
* Either sub or q have to be provided, depends on what is given from the query parameter.
|
|
32
|
-
|
|
32
|
+
*/
|
|
33
33
|
q?: string;
|
|
34
34
|
/** Scopes are list of functional definition. Required to be passed on scope consent (Ex: email, profile, openid) */
|
|
35
35
|
scopes?: string[];
|
|
@@ -55,48 +55,46 @@ export interface GetConsentVersionDetailsRequest {
|
|
|
55
55
|
consentid: string;
|
|
56
56
|
/** Response language, which is configured in cidaas admin ui */
|
|
57
57
|
locale?: string;
|
|
58
|
-
/** DEPRECATED: Access Token is not needed for Getting ConsentVersionDetailsRequest in the current cidaas service. It will be removed in the next Major release */
|
|
59
|
-
access_token?: string;
|
|
60
58
|
}
|
|
61
59
|
export interface AcceptScopeConsentRequest {
|
|
62
60
|
/** Unique identifier of client app, can be found in app setting under admin ui */
|
|
63
61
|
client_id: string;
|
|
62
|
+
/** List of scopes, which is included in the scope consent to be accepted */
|
|
63
|
+
scopes: string[];
|
|
64
64
|
/**
|
|
65
65
|
* Masked sub (id of user), who will accept the consent.
|
|
66
66
|
* Either sub or q have to be provided, depends on what is given from the query parameter.
|
|
67
|
-
|
|
67
|
+
*/
|
|
68
68
|
sub?: string;
|
|
69
69
|
/**
|
|
70
70
|
* Masked sub (id of user), who will accept the consent.
|
|
71
71
|
* Either sub or q have to be provided, depends on what is given from the query parameter.
|
|
72
|
-
|
|
72
|
+
*/
|
|
73
73
|
q?: string;
|
|
74
|
-
/** List of scopes, which is included in the scope consent to be accepted */
|
|
75
|
-
scopes: string[];
|
|
76
74
|
}
|
|
77
75
|
export interface AcceptClaimConsentRequest {
|
|
78
76
|
/** Unique identifier of client app, can be found in app setting under admin ui */
|
|
79
77
|
client_id: string;
|
|
78
|
+
/** List of claims, which is included in the claim consent to be accepted */
|
|
79
|
+
accepted_claims: string[];
|
|
80
80
|
/**
|
|
81
81
|
* Masked sub (id of user), who will accept the consent.
|
|
82
82
|
* Either sub or q have to be provided, depends on what is given from the query parameter.
|
|
83
|
-
|
|
83
|
+
*/
|
|
84
84
|
sub?: string;
|
|
85
85
|
/**
|
|
86
86
|
* Masked sub (id of user), who will accept the consent.
|
|
87
87
|
* Either sub or q have to be provided, depends on what is given from the query parameter.
|
|
88
|
-
|
|
88
|
+
*/
|
|
89
89
|
q?: string;
|
|
90
|
-
/** List of claims, which is included in the claim consent to be accepted */
|
|
91
|
-
accepted_claims: string[];
|
|
92
90
|
}
|
|
93
91
|
export interface RevokeClaimConsentRequest {
|
|
94
|
-
/** Access token needed to authorized api call */
|
|
95
|
-
access_token: string;
|
|
96
92
|
/** Unique identifier of client app, can be found in app setting under admin ui */
|
|
97
93
|
client_id: string;
|
|
98
94
|
/** sub (id of user), who will revoke the consent */
|
|
99
95
|
sub: string;
|
|
100
96
|
/** List of claims, which is included in the claim consent to be revoked */
|
|
101
97
|
revoked_claims: string[];
|
|
98
|
+
/** Access token needed to authorized api call. If not provided, access token from UserStorage will be used. */
|
|
99
|
+
access_token?: string;
|
|
102
100
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import ConfigUserProvider from "../common/ConfigUserProvider";
|
|
2
|
+
import { DeleteDeviceRequest } from "./DeviceService.model";
|
|
3
|
+
export declare class DeviceService {
|
|
4
|
+
private config;
|
|
5
|
+
private userManager;
|
|
6
|
+
constructor(configUserProvider: ConfigUserProvider);
|
|
7
|
+
/**
|
|
8
|
+
* To get all devices information associated to the client, call **getDevicesInfo()**
|
|
9
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/2a2feed70303c-get-device-by-user for more details.
|
|
10
|
+
* @example
|
|
11
|
+
* ```js
|
|
12
|
+
* cidaasDeviceService.getDevicesInfo().then(function (resp) {
|
|
13
|
+
* // the response will give you devices informations.
|
|
14
|
+
* }).catch(function(ex) {
|
|
15
|
+
* // your failure code here
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
getDevicesInfo(access_token?: string): Promise<any>;
|
|
20
|
+
/**
|
|
21
|
+
* To delete device associated to the client, call **deleteDevice()**
|
|
22
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/3d44ad903d6e8-logout-the-user-for-a-device for more details.
|
|
23
|
+
* @example
|
|
24
|
+
* ```js
|
|
25
|
+
* const options = {
|
|
26
|
+
* device_id: 'id of device associated to the client.' // call **getDevicesInfo()** to get List of device ids and its details.
|
|
27
|
+
* };
|
|
28
|
+
* cidaasDeviceService.deleteDevice(options).then(function (resp) {
|
|
29
|
+
* // your success code
|
|
30
|
+
* }).catch(function(ex) {
|
|
31
|
+
* // your failure code
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
deleteDevice(options: DeleteDeviceRequest, access_token?: string): Promise<any>;
|
|
36
|
+
/**
|
|
37
|
+
* to generate device info, call **createDeviceInfo()**.
|
|
38
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/9b5a892afaf0b-create-device-info for more details.
|
|
39
|
+
* @example
|
|
40
|
+
* ```js
|
|
41
|
+
* cidaasDeviceService.createDeviceInfo().then(function (resp) {
|
|
42
|
+
* // your success code
|
|
43
|
+
* }).catch(function(ex) {
|
|
44
|
+
* // your failure code
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
createDeviceInfo(): Promise<any>;
|
|
49
|
+
}
|