cidaas-javascript-sdk 4.2.3 → 4.3.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 (55) hide show
  1. package/CHANGELOG.md +23 -3
  2. package/README.md +3 -0
  3. package/dist/authentication/{index.d.ts → Authentication.d.ts} +2 -2
  4. package/dist/authentication/{index.js → Authentication.js} +21 -10
  5. package/dist/authentication/Authentication.model.js +23 -0
  6. package/dist/common/Common.model.d.ts +37 -0
  7. package/dist/common/Common.model.js +26 -0
  8. package/dist/{web-auth → common}/Helper.d.ts +6 -6
  9. package/dist/{web-auth → common}/Helper.js +17 -12
  10. package/dist/common/JwtHelper.d.ts +8 -0
  11. package/dist/{web-auth → common}/JwtHelper.js +13 -9
  12. package/dist/common/User.model.d.ts +134 -0
  13. package/dist/common/User.model.js +2 -0
  14. package/dist/consent-service/ConsentService.d.ts +96 -0
  15. package/dist/consent-service/ConsentService.js +127 -0
  16. package/dist/consent-service/ConsentService.model.d.ts +102 -0
  17. package/dist/consent-service/ConsentService.model.js +2 -0
  18. package/dist/index.d.ts +1 -1
  19. package/dist/index.js +20 -3
  20. package/dist/login-service/LoginService.d.ts +143 -0
  21. package/dist/login-service/LoginService.js +247 -0
  22. package/dist/login-service/LoginService.model.d.ts +138 -0
  23. package/dist/login-service/LoginService.model.js +13 -0
  24. package/dist/token-service/TokenService.d.ts +139 -0
  25. package/dist/token-service/TokenService.js +242 -0
  26. package/dist/token-service/TokenService.model.d.ts +149 -0
  27. package/dist/token-service/TokenService.model.js +43 -0
  28. package/dist/user-service/UserService.d.ts +317 -0
  29. package/dist/user-service/UserService.js +451 -0
  30. package/dist/user-service/UserService.model.d.ts +142 -0
  31. package/dist/user-service/UserService.model.js +10 -0
  32. package/dist/verification-service/VerificationService.d.ts +218 -0
  33. package/dist/verification-service/VerificationService.js +288 -0
  34. package/dist/verification-service/VerificationService.model.d.ts +158 -0
  35. package/dist/verification-service/VerificationService.model.js +2 -0
  36. package/dist/web-auth/WebAuth.d.ts +110 -177
  37. package/dist/web-auth/WebAuth.js +98 -123
  38. package/dist/web-auth/webauth.model.d.ts +50 -0
  39. package/dist/web-auth/webauth.model.js +2 -0
  40. package/package.json +1 -1
  41. package/dist/authentication/authentication.model.js +0 -18
  42. package/dist/web-auth/ConsentService.d.ts +0 -123
  43. package/dist/web-auth/ConsentService.js +0 -133
  44. package/dist/web-auth/Entities.d.ts +0 -516
  45. package/dist/web-auth/Entities.js +0 -59
  46. package/dist/web-auth/JwtHelper.d.ts +0 -7
  47. package/dist/web-auth/LoginService.d.ts +0 -165
  48. package/dist/web-auth/LoginService.js +0 -243
  49. package/dist/web-auth/TokenService.d.ts +0 -143
  50. package/dist/web-auth/TokenService.js +0 -246
  51. package/dist/web-auth/UserService.d.ts +0 -345
  52. package/dist/web-auth/UserService.js +0 -468
  53. package/dist/web-auth/VerificationService.d.ts +0 -224
  54. package/dist/web-auth/VerificationService.js +0 -275
  55. /package/dist/authentication/{authentication.model.d.ts → Authentication.model.d.ts} +0 -0
@@ -0,0 +1,50 @@
1
+ export interface LogoutUserRequest {
2
+ /** Access token needed to authorized api call */
3
+ access_token: string;
4
+ }
5
+ export interface GetClientInfoRequest {
6
+ /** Request id returned from the authorization call */
7
+ requestId: string;
8
+ }
9
+ export interface GetRegistrationSetupRequest {
10
+ /** Request id returned from the authorization call */
11
+ requestId: string;
12
+ /** Response language, which is configured in cidaas admin ui */
13
+ acceptlanguage?: string;
14
+ }
15
+ export interface GetUserActivitiesRequest {
16
+ /** sub of user to get its activities */
17
+ sub: string;
18
+ /** limits activities number to be shown */
19
+ size?: number;
20
+ /** shows activities starting from the 'from' number. Default is 0 */
21
+ from?: number;
22
+ /** if true, the activites will be sorted with the latest one at start */
23
+ descending?: boolean;
24
+ /** activities are shown based on the dateFilter */
25
+ dateFilter?: DateFilter;
26
+ }
27
+ export interface UpdateProfileImageRequest {
28
+ /** id for the image */
29
+ image_key: string;
30
+ /** name of the image */
31
+ filename: string;
32
+ /** image file */
33
+ photo: Blob;
34
+ }
35
+ export interface DeleteDeviceRequest {
36
+ /** id of device associated to the client */
37
+ device_id: string;
38
+ /** user-agent information from the browser */
39
+ userAgent?: string;
40
+ }
41
+ export interface DateFilter {
42
+ /** earliest time to show activities */
43
+ from_date: string;
44
+ /** latest time to show activities */
45
+ to_date: string;
46
+ }
47
+ export interface UserActionOnEnrollmentRequest {
48
+ /** action to be executed */
49
+ action: string;
50
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cidaas-javascript-sdk",
3
- "version": "4.2.3",
3
+ "version": "4.3.0",
4
4
  "author": "cidaas by Widas ID GmbH",
5
5
  "description": "Cidaas native javascript sdk",
6
6
  "license": "MIT",
@@ -1,18 +0,0 @@
1
- import { UserManager, User as OidcUser } from 'oidc-client-ts';
2
- /**
3
- * @augments UserManager
4
- * */
5
- export class OidcManager extends UserManager {
6
- constructor(settings) {
7
- super(settings);
8
- }
9
- getClient() {
10
- return this._client;
11
- }
12
- }
13
- /**
14
- * Authenticated user information including token, id_token and claims
15
- * @augments OidcUser
16
- * **/
17
- export class User extends OidcUser {
18
- }
@@ -1,123 +0,0 @@
1
- import { IConsentAcceptEntity } from "./Entities";
2
- /**
3
- * Consent Management
4
- * For the first time login, the user needs to accept the terms and conditions.
5
- */
6
- export declare namespace ConsentService {
7
- /**
8
- * To get consent details , call **getConsentDetails()**.
9
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/858fbeb51c62b-find-consent-info for more details.
10
- * @example
11
- * ```js
12
- * this.cidaas.getConsentDetails({
13
- * consent_id: 'consent id',
14
- * consent_version_id: 'consent version id',
15
- * sub: 'masked sub'
16
- * })
17
- * .then(function (response) {
18
- * // type your code here
19
- * })
20
- * .catch(function (ex) {
21
- * // your failure code here
22
- * });
23
- * ```
24
- */
25
- function getConsentDetails(options: {
26
- consent_id: string;
27
- consent_version_id: string;
28
- sub: string;
29
- }): Promise<unknown>;
30
- /**
31
- * To accept consent, call **acceptConsent()**.
32
- * @example
33
- * ```js
34
- * this.cidaas.acceptConsent({
35
- * client_id: 'your client id',
36
- * consent_id: 'consent id',
37
- * consent_version: 'consent version id',
38
- * sub: 'masked sub'
39
- * }).then((response) => {
40
- * // the response will give you details of accepted consent.
41
- * }).catch((err) => {
42
- * // your failure code here
43
- * });
44
- * ```
45
- */
46
- function acceptConsent(options: IConsentAcceptEntity): Promise<unknown>;
47
- /**
48
- * To get version details of consent, call **getConsentVersionDetails()**.
49
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/7e24ac2113315-get-consent-version-details for more details.
50
- * @example
51
- * ```js
52
- * this.cidaas.getConsentVersionDetails({
53
- * consentid: 'your consent id',
54
- * locale: 'browser accept language or custom language',
55
- * access_token: 'your access token',
56
- * }).then((response) => {
57
- * // type your code here
58
- * }).catch((err) => {
59
- * // your failure code here
60
- * });
61
- * ```
62
- */
63
- function getConsentVersionDetails(options: {
64
- consentid: string;
65
- locale: string;
66
- access_token: string;
67
- }): Promise<unknown>;
68
- /**
69
- * To accept scope consent, call **acceptScopeConsent()**.
70
- * @example
71
- * ```js
72
- * this.cidaas.acceptScopeConsent({
73
- * client_id: 'your client id',
74
- * sub: 'masked sub',
75
- * scopes: [your scope consents]
76
- * });
77
- * ```
78
- */
79
- function acceptScopeConsent(options: {
80
- client_id: string;
81
- sub: string;
82
- scopes: string[];
83
- }): Promise<unknown>;
84
- /**
85
- * To accept claim consent, call **acceptClaimConsent()**.
86
- * @example
87
- * ```js
88
- * this.cidaas.acceptClaimConsent({
89
- * client_id: 'your client id',
90
- * sub: 'masked sub',
91
- * accepted_claims: [your claim consents]
92
- * });
93
- * ```
94
- */
95
- function acceptClaimConsent(options: {
96
- client_id: string;
97
- sub: string;
98
- accepted_claims: string[];
99
- }): Promise<unknown>;
100
- /**
101
- * To revoke claim consent, call **revokeClaimConsent()**.
102
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/9ae62e98842fe-revoke-user-consent-claim for more details.
103
- * @example
104
- * ```js
105
- * this.cidaas.revokeClaimConsent({
106
- * access_token: 'your access token',
107
- * client_id: 'your client id',
108
- * sub: 'masked sub'
109
- * revoked_claims: [your claim consents]
110
- * }).then((response) => {
111
- * // the response will give you revoked claim consent.
112
- * }).catch((err) => {
113
- * // your failure code here
114
- * });
115
- * ```
116
- */
117
- function revokeClaimConsent(options: {
118
- access_token?: string;
119
- client_id: string;
120
- sub: string;
121
- revoked_claims: string[];
122
- }): Promise<unknown>;
123
- }
@@ -1,133 +0,0 @@
1
- import { Helper } from "./Helper";
2
- /**
3
- * Consent Management
4
- * For the first time login, the user needs to accept the terms and conditions.
5
- */
6
- export var ConsentService;
7
- (function (ConsentService) {
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
- * this.cidaas.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
- function getConsentDetails(options) {
27
- var _serviceURL = window.webAuthSettings.authority + "/consent-management-srv/v2/consent/usage/public/info";
28
- return Helper.createHttpPromise(options, _serviceURL, false, "POST");
29
- }
30
- ConsentService.getConsentDetails = getConsentDetails;
31
- ;
32
- /**
33
- * To accept consent, call **acceptConsent()**.
34
- * @example
35
- * ```js
36
- * this.cidaas.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
- function acceptConsent(options) {
49
- var _serviceURL = window.webAuthSettings.authority + "/consent-management-srv/v2/consent/usage/accept";
50
- return Helper.createHttpPromise(options, _serviceURL, false, "POST");
51
- }
52
- ConsentService.acceptConsent = acceptConsent;
53
- ;
54
- /**
55
- * To get version details of consent, call **getConsentVersionDetails()**.
56
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/7e24ac2113315-get-consent-version-details for more details.
57
- * @example
58
- * ```js
59
- * this.cidaas.getConsentVersionDetails({
60
- * consentid: 'your consent id',
61
- * locale: 'browser accept language or custom language',
62
- * access_token: 'your access token',
63
- * }).then((response) => {
64
- * // type your code here
65
- * }).catch((err) => {
66
- * // your failure code here
67
- * });
68
- * ```
69
- */
70
- function getConsentVersionDetails(options) {
71
- const _serviceURL = window.webAuthSettings.authority + "/consent-management-srv/v2/consent/versions/details/" + options.consentid + "?locale=" + options.locale;
72
- return Helper.createHttpPromise(undefined, _serviceURL, false, "GET", options.access_token);
73
- }
74
- ConsentService.getConsentVersionDetails = getConsentVersionDetails;
75
- ;
76
- /**
77
- * To accept scope consent, call **acceptScopeConsent()**.
78
- * @example
79
- * ```js
80
- * this.cidaas.acceptScopeConsent({
81
- * client_id: 'your client id',
82
- * sub: 'masked sub',
83
- * scopes: [your scope consents]
84
- * });
85
- * ```
86
- */
87
- function acceptScopeConsent(options) {
88
- var _serviceURL = window.webAuthSettings.authority + "/consent-management-srv/consent/scope/accept";
89
- return Helper.createHttpPromise(options, _serviceURL, false, "POST");
90
- }
91
- ConsentService.acceptScopeConsent = acceptScopeConsent;
92
- ;
93
- /**
94
- * To accept claim consent, call **acceptClaimConsent()**.
95
- * @example
96
- * ```js
97
- * this.cidaas.acceptClaimConsent({
98
- * client_id: 'your client id',
99
- * sub: 'masked sub',
100
- * accepted_claims: [your claim consents]
101
- * });
102
- * ```
103
- */
104
- function acceptClaimConsent(options) {
105
- var _serviceURL = window.webAuthSettings.authority + "/consent-management-srv/consent/claim/accept";
106
- return Helper.createHttpPromise(options, _serviceURL, false, "POST");
107
- }
108
- ConsentService.acceptClaimConsent = acceptClaimConsent;
109
- ;
110
- /**
111
- * To revoke claim consent, call **revokeClaimConsent()**.
112
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/9ae62e98842fe-revoke-user-consent-claim for more details.
113
- * @example
114
- * ```js
115
- * this.cidaas.revokeClaimConsent({
116
- * access_token: 'your access token',
117
- * client_id: 'your client id',
118
- * sub: 'masked sub'
119
- * revoked_claims: [your claim consents]
120
- * }).then((response) => {
121
- * // the response will give you revoked claim consent.
122
- * }).catch((err) => {
123
- * // your failure code here
124
- * });
125
- * ```
126
- */
127
- function revokeClaimConsent(options) {
128
- var _serviceURL = window.webAuthSettings.authority + "/consent-management-srv/consent/claim/revoke";
129
- return Helper.createHttpPromise(options, _serviceURL, false, "POST", options.access_token);
130
- }
131
- ConsentService.revokeClaimConsent = revokeClaimConsent;
132
- ;
133
- })(ConsentService || (ConsentService = {}));