cidaas-javascript-sdk 4.3.2 → 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.
Files changed (51) hide show
  1. package/CHANGELOG.md +57 -5
  2. package/README.md +109 -94
  3. package/dist/authentication-service/AuthenticationService.d.ts +140 -0
  4. package/dist/authentication-service/AuthenticationService.js +210 -0
  5. package/dist/{authentication/Authentication.model.d.ts → authentication-service/AuthenticationService.model.d.ts} +18 -12
  6. package/dist/{authentication/Authentication.model.js → authentication-service/AuthenticationService.model.js} +2 -2
  7. package/dist/common/Common.model.d.ts +15 -19
  8. package/dist/common/Common.model.js +17 -17
  9. package/dist/common/ConfigUserProvider.d.ts +10 -0
  10. package/dist/common/ConfigUserProvider.js +28 -0
  11. package/dist/common/Helper.d.ts +7 -0
  12. package/dist/common/Helper.js +19 -0
  13. package/dist/common/User.model.d.ts +0 -4
  14. package/dist/consent-service/ConsentService.d.ts +99 -95
  15. package/dist/consent-service/ConsentService.js +125 -122
  16. package/dist/consent-service/ConsentService.model.d.ts +14 -16
  17. package/dist/device-service/DeviceService.d.ts +49 -0
  18. package/dist/device-service/DeviceService.js +79 -0
  19. package/dist/device-service/DeviceService.model.d.ts +6 -0
  20. package/dist/id-validation-service/IdValidationService.d.ts +28 -0
  21. package/dist/id-validation-service/IdValidationService.js +59 -0
  22. package/dist/id-validation-service/IdValidationService.model.d.ts +8 -0
  23. package/dist/id-validation-service/IdValidationService.model.js +2 -0
  24. package/dist/index.d.ts +22 -3
  25. package/dist/index.js +35 -18
  26. package/dist/login-service/LoginService.d.ts +143 -141
  27. package/dist/login-service/LoginService.js +225 -234
  28. package/dist/login-service/LoginService.model.d.ts +9 -53
  29. package/dist/login-service/LoginService.model.js +1 -1
  30. package/dist/public-service/PublicService.d.ts +57 -0
  31. package/dist/public-service/PublicService.js +73 -0
  32. package/dist/public-service/PublicService.model.d.ts +20 -0
  33. package/dist/public-service/PublicService.model.js +2 -0
  34. package/dist/token-service/TokenService.d.ts +104 -138
  35. package/dist/token-service/TokenService.js +164 -219
  36. package/dist/token-service/TokenService.model.d.ts +3 -44
  37. package/dist/token-service/TokenService.model.js +3 -16
  38. package/dist/user-service/UserService.d.ts +381 -315
  39. package/dist/user-service/UserService.js +552 -426
  40. package/dist/user-service/UserService.model.d.ts +48 -14
  41. package/dist/user-service/UserService.model.js +4 -4
  42. package/dist/verification-service/VerificationService.d.ts +281 -217
  43. package/dist/verification-service/VerificationService.js +343 -281
  44. package/dist/verification-service/VerificationService.model.d.ts +18 -5
  45. package/package.json +6 -4
  46. package/dist/authentication/Authentication.d.ts +0 -139
  47. package/dist/authentication/Authentication.js +0 -186
  48. package/dist/web-auth/WebAuth.d.ts +0 -665
  49. package/dist/web-auth/WebAuth.js +0 -955
  50. package/dist/web-auth/webauth.model.d.ts +0 -66
  51. /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
- * To get consent details , call **getConsentDetails()**.
5
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/858fbeb51c62b-find-consent-info for more details.
6
- * @example
7
- * ```js
8
- * this.cidaas.getConsentDetails({
9
- * consent_id: 'consent id',
10
- * consent_version_id: 'consent version id',
11
- * sub: 'masked sub'
12
- * })
13
- * .then(function (response) {
14
- * // type your code here
15
- * })
16
- * .catch(function (ex) {
17
- * // your failure code here
18
- * });
19
- * ```
20
- */
21
- export declare function getConsentDetails(options: GetConsentDetailsRequest, headers?: HTTPRequestHeader): Promise<any>;
22
- /**
23
- * To accept consent, call **acceptConsent()**.
24
- * @example
25
- * ```js
26
- * this.cidaas.acceptConsent({
27
- * client_id: 'your client id',
28
- * consent_id: 'consent id',
29
- * consent_version: 'consent version id',
30
- * sub: 'masked sub'
31
- * }).then((response) => {
32
- * // the response will give you details of accepted consent.
33
- * }).catch((err) => {
34
- * // your failure code here
35
- * });
36
- * ```
37
- */
38
- export declare function acceptConsent(options: AcceptConsentRequest, headers?: HTTPRequestHeader): Promise<any>;
39
- /**
40
- * To get version details of consent, call **getConsentVersionDetails()**.
41
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/7e24ac2113315-get-consent-version-details for more details.
42
- * @example
43
- * ```js
44
- * this.cidaas.getConsentVersionDetails({
45
- * consentid: 'your consent id',
46
- * locale: 'browser accept language or custom language',
47
- * access_token: 'your access token',
48
- * }).then((response) => {
49
- * // type your code here
50
- * }).catch((err) => {
51
- * // your failure code here
52
- * });
53
- * ```
54
- */
55
- export declare function getConsentVersionDetails(options: GetConsentVersionDetailsRequest, headers?: HTTPRequestHeader): Promise<any>;
56
- /**
57
- * To accept scope consent, call **acceptScopeConsent()**.
58
- * @example
59
- * ```js
60
- * this.cidaas.acceptScopeConsent({
61
- * client_id: 'your client id',
62
- * sub: 'masked sub',
63
- * scopes: [your scope consents]
64
- * });
65
- * ```
66
- */
67
- export declare function acceptScopeConsent(options: AcceptScopeConsentRequest, headers?: HTTPRequestHeader): Promise<any>;
68
- /**
69
- * To accept claim consent, call **acceptClaimConsent()**.
70
- * @example
71
- * ```js
72
- * this.cidaas.acceptClaimConsent({
73
- * client_id: 'your client id',
74
- * sub: 'masked sub',
75
- * accepted_claims: [your claim consents]
76
- * });
77
- * ```
78
- */
79
- export declare function acceptClaimConsent(options: AcceptClaimConsentRequest, headers?: HTTPRequestHeader): Promise<any>;
80
- /**
81
- * To revoke claim consent, call **revokeClaimConsent()**.
82
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/9ae62e98842fe-revoke-user-consent-claim for more details.
83
- * @example
84
- * ```js
85
- * this.cidaas.revokeClaimConsent({
86
- * access_token: 'your access token',
87
- * client_id: 'your client id',
88
- * sub: 'masked sub'
89
- * revoked_claims: [your claim consents]
90
- * }).then((response) => {
91
- * // the response will give you revoked claim consent.
92
- * }).catch((err) => {
93
- * // your failure code here
94
- * });
95
- * ```
96
- */
97
- export declare function revokeClaimConsent(options: RevokeClaimConsentRequest): Promise<any>;
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.revokeClaimConsent = exports.acceptClaimConsent = exports.acceptScopeConsent = exports.getConsentVersionDetails = exports.acceptConsent = exports.getConsentDetails = void 0;
3
+ exports.ConsentService = void 0;
4
4
  const Helper_1 = require("../common/Helper");
5
- /**
6
- * To get consent details , call **getConsentDetails()**.
7
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/858fbeb51c62b-find-consent-info for more details.
8
- * @example
9
- * ```js
10
- * this.cidaas.getConsentDetails({
11
- * consent_id: 'consent id',
12
- * consent_version_id: 'consent version id',
13
- * sub: 'masked sub'
14
- * })
15
- * .then(function (response) {
16
- * // type your code here
17
- * })
18
- * .catch(function (ex) {
19
- * // your failure code here
20
- * });
21
- * ```
22
- */
23
- function getConsentDetails(options, headers) {
24
- const _serviceURL = window.webAuthSettings.authority + "/consent-management-srv/v2/consent/usage/public/info";
25
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", undefined, headers);
26
- }
27
- exports.getConsentDetails = getConsentDetails;
28
- /**
29
- * To accept consent, call **acceptConsent()**.
30
- * @example
31
- * ```js
32
- * this.cidaas.acceptConsent({
33
- * client_id: 'your client id',
34
- * consent_id: 'consent id',
35
- * consent_version: 'consent version id',
36
- * sub: 'masked sub'
37
- * }).then((response) => {
38
- * // the response will give you details of accepted consent.
39
- * }).catch((err) => {
40
- * // your failure code here
41
- * });
42
- * ```
43
- */
44
- function acceptConsent(options, headers) {
45
- const _serviceURL = window.webAuthSettings.authority + "/consent-management-srv/v2/consent/usage/accept";
46
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", undefined, headers);
47
- }
48
- exports.acceptConsent = acceptConsent;
49
- /**
50
- * To get version details of consent, call **getConsentVersionDetails()**.
51
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/7e24ac2113315-get-consent-version-details for more details.
52
- * @example
53
- * ```js
54
- * this.cidaas.getConsentVersionDetails({
55
- * consentid: 'your consent id',
56
- * locale: 'browser accept language or custom language',
57
- * access_token: 'your access token',
58
- * }).then((response) => {
59
- * // type your code here
60
- * }).catch((err) => {
61
- * // your failure code here
62
- * });
63
- * ```
64
- */
65
- function getConsentVersionDetails(options, headers) {
66
- let _serviceURL = window.webAuthSettings.authority + "/consent-management-srv/v2/consent/versions/details/" + options.consentid;
67
- if (options.locale) {
68
- _serviceURL += "?locale=" + options.locale;
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.revokeClaimConsent = revokeClaimConsent;
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
+ }