@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.
@@ -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
- * Delete a token
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 see a list of OAuth1 tokens for this account
41
- * VIEW_AUTHORIZATIONS | | Can remove any OAuth1 tokens of any account
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
@@ -1 +1 @@
1
- export declare const version = "8.3.0";
1
+ export declare const version = "8.4.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@extrahorizon/javascript-sdk",
3
- "version": "8.3.0",
3
+ "version": "8.4.0",
4
4
  "description": "This package serves as a JavaScript wrapper around all Extra Horizon cloud services.",
5
5
  "main": "build/index.cjs.js",
6
6
  "types": "build/types/index.d.ts",