@extrahorizon/javascript-sdk 8.3.0 → 8.4.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 +12 -0
- package/build/index.cjs.js +1 -1
- package/build/index.mjs +1 -1
- package/build/types/mockType.d.ts +36 -0
- package/build/types/services/auth/oauth1/types.d.ts +46 -7
- package/build/types/services/auth/oauth2/types.d.ts +48 -0
- package/build/types/services/events/types.d.ts +3 -0
- package/build/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AffectedRecords, OptionsWithRql, PagedResult } from '../../types';
|
|
2
2
|
export interface AuthOauth1Service {
|
|
3
|
+
tokens: AuthOauth1TokenService;
|
|
3
4
|
/**
|
|
4
5
|
* Generate an SSO token with OAuth 1 authentication
|
|
5
6
|
*
|
|
6
7
|
* Permission | Scope | Effect
|
|
7
8
|
* - | - | -
|
|
8
9
|
* none | | Everyone can use this endpoint
|
|
9
|
-
* @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/SSO/post_oauth1_ssoTokens_generate
|
|
10
10
|
* @throws {ApplicationNotAuthenticatedError}
|
|
11
11
|
* @throws {UserNotAuthenticatedError}
|
|
12
12
|
*/
|
|
@@ -17,32 +17,71 @@ export interface AuthOauth1Service {
|
|
|
17
17
|
* Permission | Scope | Effect
|
|
18
18
|
* - | - | -
|
|
19
19
|
* none | | Everyone can use this endpoint
|
|
20
|
-
* @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/SSO/post_oauth1_ssoTokens_generate
|
|
21
20
|
* @throws {ApplicationNotAuthenticatedError}
|
|
22
21
|
* @throws {ResourceUnknownError}
|
|
23
22
|
*/
|
|
24
23
|
consumeSsoToken(ssoToken: string): Promise<OAuth1Token>;
|
|
25
24
|
/**
|
|
25
|
+
* @deprecated Use `exh.auth.oauth1.tokens.find` instead
|
|
26
|
+
*
|
|
26
27
|
* Get a list of OAuth1 tokens
|
|
27
28
|
*
|
|
28
29
|
* Permission | Scope | Effect
|
|
29
30
|
* - | - | -
|
|
30
31
|
* none | | Can only see a list of OAuth1 tokens for this account
|
|
31
32
|
* VIEW_AUTHORIZATIONS | global | Can see a list of OAuth1 tokens for any account
|
|
32
|
-
* @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/OAuth1/get_oauth1_tokens
|
|
33
33
|
*/
|
|
34
34
|
getTokens(options?: OptionsWithRql): Promise<PagedResult<OAuth1Token>>;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* @deprecated Use `exh.auth.oauth1.tokens.remove` instead
|
|
37
|
+
*
|
|
38
|
+
* Remove a token
|
|
37
39
|
*
|
|
38
40
|
* Permission | Scope | Effect
|
|
39
41
|
* - | - | -
|
|
40
|
-
* none | | Can only
|
|
41
|
-
*
|
|
42
|
-
* * @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/OAuth1/post_oauth1_tokens_mfa
|
|
42
|
+
* none | | Can only remove OAuth1 tokens for this account
|
|
43
|
+
* DELETE_AUTHORIZATIONS | | Can remove any OAuth1 tokens of any account
|
|
43
44
|
*/
|
|
44
45
|
removeToken(tokenId: string): Promise<AffectedRecords>;
|
|
45
46
|
}
|
|
47
|
+
export interface AuthOauth1TokenService {
|
|
48
|
+
/**
|
|
49
|
+
* Get a list of OAuth1 tokens
|
|
50
|
+
*
|
|
51
|
+
* Permission | Scope | Effect
|
|
52
|
+
* - | - | -
|
|
53
|
+
* none | | Can only see a list of OAuth1 tokens for this account
|
|
54
|
+
* VIEW_AUTHORIZATIONS | global | Can see a list of OAuth1 tokens for any account
|
|
55
|
+
*/
|
|
56
|
+
find(options?: OptionsWithRql): Promise<PagedResult<OAuth1Token>>;
|
|
57
|
+
/**
|
|
58
|
+
* Get the first OAuth1 token found
|
|
59
|
+
*
|
|
60
|
+
* Permission | Scope | Effect
|
|
61
|
+
* - | - | -
|
|
62
|
+
* none | | Can only see a list of OAuth1 tokens for this account
|
|
63
|
+
* VIEW_AUTHORIZATIONS | global | Can see a list of OAuth1 tokens for any account
|
|
64
|
+
*/
|
|
65
|
+
findFirst(options?: OptionsWithRql): Promise<OAuth1Token>;
|
|
66
|
+
/**
|
|
67
|
+
* Get an oAuth1 token by its id
|
|
68
|
+
*
|
|
69
|
+
* Permission | Scope | Effect
|
|
70
|
+
* - | - | -
|
|
71
|
+
* none | | Can only see a list of OAuth1 tokens for this account
|
|
72
|
+
* VIEW_AUTHORIZATIONS | global | Can see a list of OAuth1 tokens for any account
|
|
73
|
+
*/
|
|
74
|
+
findById(id: string, options?: OptionsWithRql): Promise<OAuth1Token>;
|
|
75
|
+
/**
|
|
76
|
+
* Remove a token
|
|
77
|
+
*
|
|
78
|
+
* Permission | Scope | Effect
|
|
79
|
+
* - | - | -
|
|
80
|
+
* none | | Can only remove OAuth1 tokens for this account
|
|
81
|
+
* DELETE_AUTHORIZATIONS | | Can remove any OAuth1 tokens of any account
|
|
82
|
+
*/
|
|
83
|
+
remove(id: string): Promise<AffectedRecords>;
|
|
84
|
+
}
|
|
46
85
|
export interface SsoToken {
|
|
47
86
|
id: string;
|
|
48
87
|
ssoToken: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AffectedRecords, OptionsBase, OptionsWithRql, PagedResult } from '../../types';
|
|
2
2
|
export interface AuthOauth2Service {
|
|
3
|
+
tokens: AuthOauth2TokenService;
|
|
3
4
|
/**
|
|
4
5
|
* Create an OAuth2 authorization
|
|
5
6
|
*
|
|
@@ -32,6 +33,43 @@ export interface AuthOauth2Service {
|
|
|
32
33
|
*/
|
|
33
34
|
deleteAuthorization(authorizationId: string, options?: OptionsWithRql): Promise<AffectedRecords>;
|
|
34
35
|
}
|
|
36
|
+
export interface AuthOauth2TokenService {
|
|
37
|
+
/**
|
|
38
|
+
* Get a list of OAuth2 tokens
|
|
39
|
+
*
|
|
40
|
+
* Permission | Scope | Effect
|
|
41
|
+
* - | - | -
|
|
42
|
+
* none | | Can only see a list of OAuth2 tokens for this account
|
|
43
|
+
* VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 tokens for any account
|
|
44
|
+
*/
|
|
45
|
+
find(options?: OptionsWithRql): Promise<PagedResult<OAuth2Token>>;
|
|
46
|
+
/**
|
|
47
|
+
* Get the first OAuth2 token found
|
|
48
|
+
*
|
|
49
|
+
* Permission | Scope | Effect
|
|
50
|
+
* - | - | -
|
|
51
|
+
* none | | Can only see a list of OAuth2 tokens for this account
|
|
52
|
+
* VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 tokens for any account
|
|
53
|
+
*/
|
|
54
|
+
findFirst(options?: OptionsWithRql): Promise<OAuth2Token>;
|
|
55
|
+
/**
|
|
56
|
+
* Get an oAuth2 token by its id
|
|
57
|
+
*
|
|
58
|
+
* Permission | Scope | Effect
|
|
59
|
+
* - | - | -
|
|
60
|
+
* none | | Can only see a list of OAuth2 tokens for this account
|
|
61
|
+
* VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 tokens for any account
|
|
62
|
+
*/
|
|
63
|
+
findById(id: string, options?: OptionsWithRql): Promise<OAuth2Token>;
|
|
64
|
+
/**
|
|
65
|
+
* Remove an oAuth2 token
|
|
66
|
+
*
|
|
67
|
+
* Permission | Scope | Effect
|
|
68
|
+
* - | - | -
|
|
69
|
+
* DELETE_AUTHORIZATIONS | | Required for this endpoint
|
|
70
|
+
*/
|
|
71
|
+
remove(id: string): Promise<AffectedRecords>;
|
|
72
|
+
}
|
|
35
73
|
export interface OAuth2AuthorizationCreation {
|
|
36
74
|
responseType: string;
|
|
37
75
|
clientId: string;
|
|
@@ -50,3 +88,13 @@ export interface OAuth2Authorization {
|
|
|
50
88
|
/** The timestamp when the authorization was created */
|
|
51
89
|
creationTimestamp?: Date;
|
|
52
90
|
}
|
|
91
|
+
export interface OAuth2Token {
|
|
92
|
+
id: string;
|
|
93
|
+
applicationId: string;
|
|
94
|
+
userId: string;
|
|
95
|
+
refreshTokenId: string;
|
|
96
|
+
accessToken: string;
|
|
97
|
+
expiryTimestamp: Date;
|
|
98
|
+
updateTimestamp: Date;
|
|
99
|
+
creationTimestamp: Date;
|
|
100
|
+
}
|
|
@@ -7,6 +7,7 @@ export declare type Event = CreateEvent & Entity & Timestamps;
|
|
|
7
7
|
export interface CreateSubscription {
|
|
8
8
|
service: Service;
|
|
9
9
|
eventTypes: Array<string>;
|
|
10
|
+
retriable?: boolean;
|
|
10
11
|
}
|
|
11
12
|
export declare type Subscription = CreateSubscription & Entity & Timestamps;
|
|
12
13
|
export interface Service {
|
|
@@ -78,6 +79,8 @@ export interface SubscriptionsService {
|
|
|
78
79
|
*/
|
|
79
80
|
findFirst(options?: OptionsWithRql): Promise<Subscription>;
|
|
80
81
|
/**
|
|
82
|
+
* @deprecated Should not be used, services manage subscriptions themselves
|
|
83
|
+
*
|
|
81
84
|
* Creates an event subscription
|
|
82
85
|
*
|
|
83
86
|
* Permission | Scope | Effect
|
package/build/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "8.
|
|
1
|
+
export declare const version = "8.4.0";
|
package/package.json
CHANGED