@extrahorizon/javascript-sdk 8.13.0-dev-183-2cca517 → 8.13.0-feat-185-88d4738

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 CHANGED
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [8.13.0]
9
9
 
10
+ ### Fixed
11
+ - The following methods are now correctly typed
12
+ - `exh.auth.oauth1.consumeSsoToken`
13
+ - `exh.auth.oauth2.createAuthorization`
14
+ - `exh.auth.oauth2.getAuthorizations`
15
+
16
+ ### Deprecated
17
+ - The following fields will be removed from responses returned by listing endpoints in a future version:
18
+ - The `exh.auth.oauth1.find*` methods deprecate the `tokenSecret` field
19
+ - The `exh.auth.oauth2.find*` methods deprecate the `accessToken` field
20
+ - The `exh.auth.oauth2.getAuthorizations` method deprecates the `codeChallenge` and `authorizationCode` fields
21
+ - The `exh.auth.users.getMfaSetting` method deprecates the TOTP `secret` and recovery codes `codes` fields
22
+
10
23
  ## [8.12.1]
11
24
 
12
25
  ### Fixed
@@ -3410,6 +3410,7 @@ function createTokenService$1(client, httpWithAuth) {
3410
3410
 
3411
3411
  var oauth2 = (client, httpWithAuth) => ({
3412
3412
  tokens: createTokenService(client, httpWithAuth),
3413
+ refreshTokens: createRefreshTokenService(client, httpWithAuth),
3413
3414
  async createAuthorization(data, options) {
3414
3415
  return (await client.post(httpWithAuth, '/oauth2/authorizations', data, options)).data;
3415
3416
  },
@@ -3441,6 +3442,34 @@ function createTokenService(client, httpWithAuth) {
3441
3442
  },
3442
3443
  };
3443
3444
  }
3445
+ function createRefreshTokenService(client, httpWithAuth) {
3446
+ async function find(options) {
3447
+ const result = await client.get(httpWithAuth, `/oauth2/refreshTokens${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, options);
3448
+ return result.data;
3449
+ }
3450
+ return {
3451
+ async find(options) {
3452
+ const result = await find(options);
3453
+ return addPagersFn(find, options, result);
3454
+ },
3455
+ async findAll(options) {
3456
+ return await findAllGeneric(this.find, options);
3457
+ },
3458
+ async findFirst(options) {
3459
+ const result = await find(options);
3460
+ return result.data[0];
3461
+ },
3462
+ async findById(id, options) {
3463
+ const rqlWithId = rqlBuilder(options === null || options === void 0 ? void 0 : options.rql).eq('id', id).build();
3464
+ const result = await find({ ...options, rql: rqlWithId });
3465
+ return result.data[0];
3466
+ },
3467
+ async remove(id, options) {
3468
+ const result = (await client.delete(httpWithAuth, `/oauth2/refreshTokens/${id}`, options));
3469
+ return result.data;
3470
+ },
3471
+ };
3472
+ }
3444
3473
 
3445
3474
  var loginAttempts = (oidcClient, httpWithAuth) => {
3446
3475
  async function query(options) {
@@ -5664,7 +5693,7 @@ const templatesV2Service = (httpWithAuth) => {
5664
5693
  };
5665
5694
  };
5666
5695
 
5667
- const version = '8.13.0-dev-183-2cca517';
5696
+ const version = '8.13.0-feat-185-88d4738';
5668
5697
 
5669
5698
  /**
5670
5699
  * Create ExtraHorizon client.
package/build/index.mjs CHANGED
@@ -3380,6 +3380,7 @@ function createTokenService$1(client, httpWithAuth) {
3380
3380
 
3381
3381
  var oauth2 = (client, httpWithAuth) => ({
3382
3382
  tokens: createTokenService(client, httpWithAuth),
3383
+ refreshTokens: createRefreshTokenService(client, httpWithAuth),
3383
3384
  async createAuthorization(data, options) {
3384
3385
  return (await client.post(httpWithAuth, '/oauth2/authorizations', data, options)).data;
3385
3386
  },
@@ -3411,6 +3412,34 @@ function createTokenService(client, httpWithAuth) {
3411
3412
  },
3412
3413
  };
3413
3414
  }
3415
+ function createRefreshTokenService(client, httpWithAuth) {
3416
+ async function find(options) {
3417
+ const result = await client.get(httpWithAuth, `/oauth2/refreshTokens${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, options);
3418
+ return result.data;
3419
+ }
3420
+ return {
3421
+ async find(options) {
3422
+ const result = await find(options);
3423
+ return addPagersFn(find, options, result);
3424
+ },
3425
+ async findAll(options) {
3426
+ return await findAllGeneric(this.find, options);
3427
+ },
3428
+ async findFirst(options) {
3429
+ const result = await find(options);
3430
+ return result.data[0];
3431
+ },
3432
+ async findById(id, options) {
3433
+ const rqlWithId = rqlBuilder(options === null || options === void 0 ? void 0 : options.rql).eq('id', id).build();
3434
+ const result = await find({ ...options, rql: rqlWithId });
3435
+ return result.data[0];
3436
+ },
3437
+ async remove(id, options) {
3438
+ const result = (await client.delete(httpWithAuth, `/oauth2/refreshTokens/${id}`, options));
3439
+ return result.data;
3440
+ },
3441
+ };
3442
+ }
3414
3443
 
3415
3444
  var loginAttempts = (oidcClient, httpWithAuth) => {
3416
3445
  async function query(options) {
@@ -5634,7 +5663,7 @@ const templatesV2Service = (httpWithAuth) => {
5634
5663
  };
5635
5664
  };
5636
5665
 
5637
- const version = '8.13.0-dev-183-2cca517';
5666
+ const version = '8.13.0-feat-185-88d4738';
5638
5667
 
5639
5668
  /**
5640
5669
  * Create ExtraHorizon client.
@@ -517,6 +517,13 @@ export declare type MockClientOAuth1<MockFn> = {
517
517
  findAll: MockFn;
518
518
  remove: MockFn;
519
519
  };
520
+ refreshTokens: {
521
+ find: MockFn;
522
+ findAll: MockFn;
523
+ findFirst: MockFn;
524
+ findById: MockFn;
525
+ remove: MockFn;
526
+ };
520
527
  createAuthorization: MockFn;
521
528
  getAuthorizations: MockFn;
522
529
  deleteAuthorization: MockFn;
@@ -1104,6 +1111,13 @@ export declare type MockClientOAuth2<MockFn> = {
1104
1111
  findAll: MockFn;
1105
1112
  remove: MockFn;
1106
1113
  };
1114
+ refreshTokens: {
1115
+ find: MockFn;
1116
+ findAll: MockFn;
1117
+ findFirst: MockFn;
1118
+ findById: MockFn;
1119
+ remove: MockFn;
1120
+ };
1107
1121
  createAuthorization: MockFn;
1108
1122
  getAuthorizations: MockFn;
1109
1123
  deleteAuthorization: MockFn;
@@ -1691,6 +1705,13 @@ export declare type MockClientProxy<MockFn> = {
1691
1705
  findAll: MockFn;
1692
1706
  remove: MockFn;
1693
1707
  };
1708
+ refreshTokens: {
1709
+ find: MockFn;
1710
+ findAll: MockFn;
1711
+ findFirst: MockFn;
1712
+ findById: MockFn;
1713
+ remove: MockFn;
1714
+ };
1694
1715
  createAuthorization: MockFn;
1695
1716
  getAuthorizations: MockFn;
1696
1717
  deleteAuthorization: MockFn;
@@ -20,7 +20,7 @@ export interface AuthOauth1Service {
20
20
  * @throws {ApplicationNotAuthenticatedError}
21
21
  * @throws {ResourceUnknownError}
22
22
  */
23
- consumeSsoToken(ssoToken: string): Promise<OAuth1Token>;
23
+ consumeSsoToken(ssoToken: string): Promise<ConsumeSSOTokenResponse>;
24
24
  /**
25
25
  * @deprecated Use `exh.auth.oauth1.tokens.find` instead
26
26
  *
@@ -100,12 +100,26 @@ export interface SsoToken {
100
100
  creationTimestamp: Date;
101
101
  updateTimestamp: Date;
102
102
  }
103
- export interface OAuth1Token {
103
+ export interface ConsumeSSOTokenResponse {
104
104
  id: string;
105
- userId: string;
106
105
  applicationId: string;
106
+ userId: string;
107
107
  token: string;
108
108
  tokenSecret: string;
109
+ updateTimestamp: Date;
110
+ lastUsedTimestamp: Date;
111
+ creationTimestamp: Date;
112
+ }
113
+ export interface OAuth1Token {
114
+ id: string;
115
+ applicationId: string;
116
+ userId: string;
117
+ token: string;
118
+ /**
119
+ * @deprecated `tokenSecret` will be removed from responses returned by listing endpoints in a future version.
120
+ */
121
+ tokenSecret?: string;
122
+ updateTimestamp: Date;
109
123
  lastUsedTimestamp: Date;
110
124
  creationTimestamp: Date;
111
125
  }
@@ -1,4 +1,4 @@
1
- import type { HttpInstance } from '../../../types';
1
+ import { HttpInstance } from '../../../types';
2
2
  import { HttpClient } from '../../http-client';
3
3
  import type { AuthOauth2Service } from './types';
4
4
  declare const _default: (client: HttpClient, httpWithAuth: HttpInstance) => AuthOauth2Service;
@@ -1,6 +1,7 @@
1
1
  import { AffectedRecords, OptionsBase, OptionsWithRql, PagedResult } from '../../types';
2
2
  export interface AuthOauth2Service {
3
3
  tokens: AuthOauth2TokenService;
4
+ refreshTokens: OAuth2RefreshTokenService;
4
5
  /**
5
6
  * Create an OAuth2 authorization
6
7
  *
@@ -12,7 +13,7 @@ export interface AuthOauth2Service {
12
13
  * @throws {CallbackNotValidError}
13
14
  * @throws {UnsupportedResponseTypeError}
14
15
  */
15
- createAuthorization(data: OAuth2AuthorizationCreation, options?: OptionsBase): Promise<OAuth2Authorization>;
16
+ createAuthorization(data: OAuth2AuthorizationCreation, options?: OptionsBase): Promise<OAuth2AuthorizationCreationResponse>;
16
17
  /**
17
18
  * Get a list of OAuth2 Authorizations
18
19
  *
@@ -79,30 +80,125 @@ export interface AuthOauth2TokenService {
79
80
  */
80
81
  remove(id: string): Promise<AffectedRecords>;
81
82
  }
83
+ export interface OAuth2RefreshTokenService {
84
+ /**
85
+ * # Get a list of OAuth2 refresh tokens
86
+ *
87
+ * Permission | Scope | Effect
88
+ * - | - | -
89
+ * none | | Can only see a list of OAuth2 refresh tokens for this account
90
+ * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
91
+ * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
92
+ * @param options.rql Add filters to the requested list
93
+ * @returns PagedResult<OAuth2RefreshToken>
94
+ */
95
+ find(options?: OptionsWithRql): Promise<PagedResult<OAuth2RefreshToken>>;
96
+ /**
97
+ * Get a list of OAuth2 refresh tokens
98
+ *
99
+ * Permission | Scope | Effect
100
+ * - | - | -
101
+ * none | | Can only see a list of OAuth2 refresh tokens for this account
102
+ * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
103
+ * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
104
+ * @param options.rql Add filters to the requested list
105
+ * @returns OAuth2RefreshToken[]
106
+ */
107
+ findAll(options?: OptionsWithRql): Promise<OAuth2RefreshToken[]>;
108
+ /**
109
+ * Get the first OAuth2 refresh token found
110
+ *
111
+ * Permission | Scope | Effect
112
+ * - | - | -
113
+ * none | | Can only see a list of OAuth2 refresh tokens for this account
114
+ * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
115
+ * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
116
+ * @param options.rql Add filters to the requested list
117
+ * @returns {Promise<OAuth2RefreshToken | undefined>
118
+ */
119
+ findFirst(options?: OptionsWithRql): Promise<OAuth2RefreshToken | undefined>;
120
+ /**
121
+ * Get an oAuth2 refresh token by its id
122
+ *
123
+ * Permission | Scope | Effect
124
+ * - | - | -
125
+ * none | | Can only see a list of OAuth2 refresh tokens for this account
126
+ * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
127
+ * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
128
+ * @param id the refresh token id
129
+ * @param options.rql Add filters to the requested list
130
+ * @returns {Promise<OAuth2RefreshToken | undefined>
131
+ */
132
+ findById(id: string, options?: OptionsWithRql): Promise<OAuth2RefreshToken | undefined>;
133
+ /**
134
+ * Delete an oAuth2 refresh token
135
+ *
136
+ * Permission | Scope | Effect
137
+ * - | - | -
138
+ * DELETE_OAUTH2_REFRESH_TOKEN or DELETE_AUTHORIZATIONS | global | Required for this endpoint
139
+ * Using DELETE_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
140
+ * @param id the refresh token id
141
+ * @returns AffectedRecords
142
+ */
143
+ remove(id: string, options: OptionsBase): Promise<AffectedRecords>;
144
+ }
82
145
  export interface OAuth2AuthorizationCreation {
83
146
  responseType: string;
84
147
  clientId: string;
148
+ redirectUri?: string;
149
+ state?: string;
150
+ codeChallengeMethod?: string;
151
+ codeChallenge?: string;
152
+ }
153
+ export interface OAuth2AuthorizationCreationResponse {
154
+ id: string;
155
+ clientId: string;
156
+ userId: string;
85
157
  redirectUri: string;
86
- state: string;
87
- scope: string;
158
+ state?: string;
159
+ codeChallengeMethod?: string;
160
+ codeChallenge?: string;
161
+ authorizationCode: string;
162
+ expiryTimestamp: Date;
163
+ updateTimestamp: Date;
164
+ creationTimestamp: Date;
88
165
  }
89
166
  export interface OAuth2Authorization {
90
167
  id: string;
91
- userId: string;
92
168
  clientId: string;
93
- authorizationCode: string;
94
- state: string;
95
- /** The timestamp when the authorization was last updated */
96
- updateTimestamp?: Date;
97
- /** The timestamp when the authorization was created */
98
- creationTimestamp?: Date;
169
+ userId: string;
170
+ redirectUri: string;
171
+ state?: string;
172
+ codeChallengeMethod?: string;
173
+ /**
174
+ @deprecated `codeChallenge` will be removed from responses returned by listing endpoints in a future version.
175
+ */
176
+ codeChallenge?: string;
177
+ /**
178
+ * @deprecated `authorizationCode` will be removed from responses returned by listing endpoints in a future version.
179
+ */
180
+ authorizationCode?: string;
181
+ expiryTimestamp: Date;
182
+ updateTimestamp: Date;
183
+ creationTimestamp: Date;
99
184
  }
100
185
  export interface OAuth2Token {
101
186
  id: string;
102
187
  applicationId: string;
103
188
  userId: string;
104
189
  refreshTokenId: string;
105
- accessToken: string;
190
+ /**
191
+ * @deprecated `accessToken` will be removed from responses returned by listing endpoints in a future version.
192
+ */
193
+ accessToken?: string;
194
+ expiryTimestamp: Date;
195
+ updateTimestamp: Date;
196
+ creationTimestamp: Date;
197
+ }
198
+ export interface OAuth2RefreshToken {
199
+ id: string;
200
+ applicationId: string;
201
+ userId: string;
106
202
  expiryTimestamp: Date;
107
203
  updateTimestamp: Date;
108
204
  creationTimestamp: Date;
@@ -79,7 +79,10 @@ export interface RecoveryCodesMethod {
79
79
  tags: string[];
80
80
  verified: boolean;
81
81
  type: 'recoveryCodes';
82
- codes: string[];
82
+ /**
83
+ * @deprecated `codes` will be removed from responses returned by listing endpoints in a future version.
84
+ */
85
+ codes?: string[];
83
86
  updateTimestamp: Date;
84
87
  creationTimestamp: Date;
85
88
  }
@@ -89,7 +92,10 @@ export interface TotpMethod {
89
92
  tags: string[];
90
93
  verified: boolean;
91
94
  type: 'totp';
92
- secret: string;
95
+ /**
96
+ * @deprecated `secret` will be removed from responses returned by listing endpoints in a future version.
97
+ */
98
+ secret?: string;
93
99
  updateTimestamp: Date;
94
100
  creationTimestamp: Date;
95
101
  }
@@ -517,6 +517,13 @@ export declare type MockClientOAuth1<MockFn> = {
517
517
  findAll: MockFn;
518
518
  remove: MockFn;
519
519
  };
520
+ refreshTokens: {
521
+ find: MockFn;
522
+ findAll: MockFn;
523
+ findFirst: MockFn;
524
+ findById: MockFn;
525
+ remove: MockFn;
526
+ };
520
527
  createAuthorization: MockFn;
521
528
  getAuthorizations: MockFn;
522
529
  deleteAuthorization: MockFn;
@@ -1104,6 +1111,13 @@ export declare type MockClientOAuth2<MockFn> = {
1104
1111
  findAll: MockFn;
1105
1112
  remove: MockFn;
1106
1113
  };
1114
+ refreshTokens: {
1115
+ find: MockFn;
1116
+ findAll: MockFn;
1117
+ findFirst: MockFn;
1118
+ findById: MockFn;
1119
+ remove: MockFn;
1120
+ };
1107
1121
  createAuthorization: MockFn;
1108
1122
  getAuthorizations: MockFn;
1109
1123
  deleteAuthorization: MockFn;
@@ -1691,6 +1705,13 @@ export declare type MockClientProxy<MockFn> = {
1691
1705
  findAll: MockFn;
1692
1706
  remove: MockFn;
1693
1707
  };
1708
+ refreshTokens: {
1709
+ find: MockFn;
1710
+ findAll: MockFn;
1711
+ findFirst: MockFn;
1712
+ findById: MockFn;
1713
+ remove: MockFn;
1714
+ };
1694
1715
  createAuthorization: MockFn;
1695
1716
  getAuthorizations: MockFn;
1696
1717
  deleteAuthorization: MockFn;
@@ -20,7 +20,7 @@ export interface AuthOauth1Service {
20
20
  * @throws {ApplicationNotAuthenticatedError}
21
21
  * @throws {ResourceUnknownError}
22
22
  */
23
- consumeSsoToken(ssoToken: string): Promise<OAuth1Token>;
23
+ consumeSsoToken(ssoToken: string): Promise<ConsumeSSOTokenResponse>;
24
24
  /**
25
25
  * @deprecated Use `exh.auth.oauth1.tokens.find` instead
26
26
  *
@@ -100,12 +100,26 @@ export interface SsoToken {
100
100
  creationTimestamp: Date;
101
101
  updateTimestamp: Date;
102
102
  }
103
- export interface OAuth1Token {
103
+ export interface ConsumeSSOTokenResponse {
104
104
  id: string;
105
- userId: string;
106
105
  applicationId: string;
106
+ userId: string;
107
107
  token: string;
108
108
  tokenSecret: string;
109
+ updateTimestamp: Date;
110
+ lastUsedTimestamp: Date;
111
+ creationTimestamp: Date;
112
+ }
113
+ export interface OAuth1Token {
114
+ id: string;
115
+ applicationId: string;
116
+ userId: string;
117
+ token: string;
118
+ /**
119
+ * @deprecated `tokenSecret` will be removed from responses returned by listing endpoints in a future version.
120
+ */
121
+ tokenSecret?: string;
122
+ updateTimestamp: Date;
109
123
  lastUsedTimestamp: Date;
110
124
  creationTimestamp: Date;
111
125
  }
@@ -1,4 +1,4 @@
1
- import type { HttpInstance } from '../../../types';
1
+ import { HttpInstance } from '../../../types';
2
2
  import { HttpClient } from '../../http-client';
3
3
  import type { AuthOauth2Service } from './types';
4
4
  declare const _default: (client: HttpClient, httpWithAuth: HttpInstance) => AuthOauth2Service;
@@ -1,6 +1,7 @@
1
1
  import { AffectedRecords, OptionsBase, OptionsWithRql, PagedResult } from '../../types';
2
2
  export interface AuthOauth2Service {
3
3
  tokens: AuthOauth2TokenService;
4
+ refreshTokens: OAuth2RefreshTokenService;
4
5
  /**
5
6
  * Create an OAuth2 authorization
6
7
  *
@@ -12,7 +13,7 @@ export interface AuthOauth2Service {
12
13
  * @throws {CallbackNotValidError}
13
14
  * @throws {UnsupportedResponseTypeError}
14
15
  */
15
- createAuthorization(data: OAuth2AuthorizationCreation, options?: OptionsBase): Promise<OAuth2Authorization>;
16
+ createAuthorization(data: OAuth2AuthorizationCreation, options?: OptionsBase): Promise<OAuth2AuthorizationCreationResponse>;
16
17
  /**
17
18
  * Get a list of OAuth2 Authorizations
18
19
  *
@@ -79,30 +80,125 @@ export interface AuthOauth2TokenService {
79
80
  */
80
81
  remove(id: string): Promise<AffectedRecords>;
81
82
  }
83
+ export interface OAuth2RefreshTokenService {
84
+ /**
85
+ * # Get a list of OAuth2 refresh tokens
86
+ *
87
+ * Permission | Scope | Effect
88
+ * - | - | -
89
+ * none | | Can only see a list of OAuth2 refresh tokens for this account
90
+ * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
91
+ * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
92
+ * @param options.rql Add filters to the requested list
93
+ * @returns PagedResult<OAuth2RefreshToken>
94
+ */
95
+ find(options?: OptionsWithRql): Promise<PagedResult<OAuth2RefreshToken>>;
96
+ /**
97
+ * Get a list of OAuth2 refresh tokens
98
+ *
99
+ * Permission | Scope | Effect
100
+ * - | - | -
101
+ * none | | Can only see a list of OAuth2 refresh tokens for this account
102
+ * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
103
+ * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
104
+ * @param options.rql Add filters to the requested list
105
+ * @returns OAuth2RefreshToken[]
106
+ */
107
+ findAll(options?: OptionsWithRql): Promise<OAuth2RefreshToken[]>;
108
+ /**
109
+ * Get the first OAuth2 refresh token found
110
+ *
111
+ * Permission | Scope | Effect
112
+ * - | - | -
113
+ * none | | Can only see a list of OAuth2 refresh tokens for this account
114
+ * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
115
+ * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
116
+ * @param options.rql Add filters to the requested list
117
+ * @returns {Promise<OAuth2RefreshToken | undefined>
118
+ */
119
+ findFirst(options?: OptionsWithRql): Promise<OAuth2RefreshToken | undefined>;
120
+ /**
121
+ * Get an oAuth2 refresh token by its id
122
+ *
123
+ * Permission | Scope | Effect
124
+ * - | - | -
125
+ * none | | Can only see a list of OAuth2 refresh tokens for this account
126
+ * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
127
+ * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
128
+ * @param id the refresh token id
129
+ * @param options.rql Add filters to the requested list
130
+ * @returns {Promise<OAuth2RefreshToken | undefined>
131
+ */
132
+ findById(id: string, options?: OptionsWithRql): Promise<OAuth2RefreshToken | undefined>;
133
+ /**
134
+ * Delete an oAuth2 refresh token
135
+ *
136
+ * Permission | Scope | Effect
137
+ * - | - | -
138
+ * DELETE_OAUTH2_REFRESH_TOKEN or DELETE_AUTHORIZATIONS | global | Required for this endpoint
139
+ * Using DELETE_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
140
+ * @param id the refresh token id
141
+ * @returns AffectedRecords
142
+ */
143
+ remove(id: string, options: OptionsBase): Promise<AffectedRecords>;
144
+ }
82
145
  export interface OAuth2AuthorizationCreation {
83
146
  responseType: string;
84
147
  clientId: string;
148
+ redirectUri?: string;
149
+ state?: string;
150
+ codeChallengeMethod?: string;
151
+ codeChallenge?: string;
152
+ }
153
+ export interface OAuth2AuthorizationCreationResponse {
154
+ id: string;
155
+ clientId: string;
156
+ userId: string;
85
157
  redirectUri: string;
86
- state: string;
87
- scope: string;
158
+ state?: string;
159
+ codeChallengeMethod?: string;
160
+ codeChallenge?: string;
161
+ authorizationCode: string;
162
+ expiryTimestamp: Date;
163
+ updateTimestamp: Date;
164
+ creationTimestamp: Date;
88
165
  }
89
166
  export interface OAuth2Authorization {
90
167
  id: string;
91
- userId: string;
92
168
  clientId: string;
93
- authorizationCode: string;
94
- state: string;
95
- /** The timestamp when the authorization was last updated */
96
- updateTimestamp?: Date;
97
- /** The timestamp when the authorization was created */
98
- creationTimestamp?: Date;
169
+ userId: string;
170
+ redirectUri: string;
171
+ state?: string;
172
+ codeChallengeMethod?: string;
173
+ /**
174
+ @deprecated `codeChallenge` will be removed from responses returned by listing endpoints in a future version.
175
+ */
176
+ codeChallenge?: string;
177
+ /**
178
+ * @deprecated `authorizationCode` will be removed from responses returned by listing endpoints in a future version.
179
+ */
180
+ authorizationCode?: string;
181
+ expiryTimestamp: Date;
182
+ updateTimestamp: Date;
183
+ creationTimestamp: Date;
99
184
  }
100
185
  export interface OAuth2Token {
101
186
  id: string;
102
187
  applicationId: string;
103
188
  userId: string;
104
189
  refreshTokenId: string;
105
- accessToken: string;
190
+ /**
191
+ * @deprecated `accessToken` will be removed from responses returned by listing endpoints in a future version.
192
+ */
193
+ accessToken?: string;
194
+ expiryTimestamp: Date;
195
+ updateTimestamp: Date;
196
+ creationTimestamp: Date;
197
+ }
198
+ export interface OAuth2RefreshToken {
199
+ id: string;
200
+ applicationId: string;
201
+ userId: string;
106
202
  expiryTimestamp: Date;
107
203
  updateTimestamp: Date;
108
204
  creationTimestamp: Date;
@@ -79,7 +79,10 @@ export interface RecoveryCodesMethod {
79
79
  tags: string[];
80
80
  verified: boolean;
81
81
  type: 'recoveryCodes';
82
- codes: string[];
82
+ /**
83
+ * @deprecated `codes` will be removed from responses returned by listing endpoints in a future version.
84
+ */
85
+ codes?: string[];
83
86
  updateTimestamp: Date;
84
87
  creationTimestamp: Date;
85
88
  }
@@ -89,7 +92,10 @@ export interface TotpMethod {
89
92
  tags: string[];
90
93
  verified: boolean;
91
94
  type: 'totp';
92
- secret: string;
95
+ /**
96
+ * @deprecated `secret` will be removed from responses returned by listing endpoints in a future version.
97
+ */
98
+ secret?: string;
93
99
  updateTimestamp: Date;
94
100
  creationTimestamp: Date;
95
101
  }
@@ -1 +1 @@
1
- export declare const version = "8.13.0-dev-183-2cca517";
1
+ export declare const version = "8.13.0-feat-185-88d4738";
@@ -1 +1 @@
1
- export declare const version = "8.13.0-dev-183-2cca517";
1
+ export declare const version = "8.13.0-feat-185-88d4738";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@extrahorizon/javascript-sdk",
3
- "version": "8.13.0-dev-183-2cca517",
3
+ "version": "8.13.0-feat-185-88d4738",
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",