@extrahorizon/javascript-sdk 8.14.0-dev-198-0b81795 → 8.14.0-dev-202-65b18ba

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,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [8.14.0]
9
9
 
10
+ ### Added
11
+ - Added the `exh.auth.oauth2.authorizations.create` method to create an authorization
12
+ - Added the `exh.auth.oauth2.authorizations.find*` methods to retrieve authorizations
13
+ - Added the `exh.auth.oauth2.authorizations.remove` method to delete an authorization
14
+ - Added the error type `InvalidRqlError` to support detecting invalid RQL
15
+
16
+ ### Fixed
17
+ - The permissions documentation for `exh.mails.send` has been updated
18
+
19
+ ### Deprecated
20
+ The following methods have been deprecated in favor of the new `exh.auth.oauth2.authorizations.*` methods:
21
+ - `exh.auth.oauth2.createAuthorization`
22
+ - `exh.auth.oauth2.getAuthorizations`
23
+ - `exh.auth.oauth2.deleteAuthorization`
24
+
10
25
  ## [8.13.0]
11
26
 
12
27
  ### Added
@@ -3379,7 +3379,7 @@ var applications = (client, httpWithAuth) => ({
3379
3379
  });
3380
3380
 
3381
3381
  var oauth1 = (client, httpWithAuth) => ({
3382
- tokens: createTokenService$1(client, httpWithAuth),
3382
+ tokens: createTokenService(client, httpWithAuth),
3383
3383
  async generateSsoToken() {
3384
3384
  return (await client.post(httpWithAuth, '/oauth1/ssoTokens/generate', {}))
3385
3385
  .data;
@@ -3395,7 +3395,7 @@ var oauth1 = (client, httpWithAuth) => ({
3395
3395
  .data;
3396
3396
  },
3397
3397
  });
3398
- function createTokenService$1(client, httpWithAuth) {
3398
+ function createTokenService(client, httpWithAuth) {
3399
3399
  return {
3400
3400
  async find(options) {
3401
3401
  return (await client.get(httpWithAuth, `/oauth1/tokens${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, options)).data;
@@ -3417,6 +3417,26 @@ function createTokenService$1(client, httpWithAuth) {
3417
3417
  };
3418
3418
  }
3419
3419
 
3420
+ var accessTokens = (client, httpWithAuth) => ({
3421
+ async find(options) {
3422
+ return (await client.get(httpWithAuth, `/oauth2/tokens${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, options)).data;
3423
+ },
3424
+ async findFirst(options) {
3425
+ const res = await this.find(options);
3426
+ return res.data[0];
3427
+ },
3428
+ async findById(id, options) {
3429
+ const rqlWithId = rqlBuilder(options === null || options === void 0 ? void 0 : options.rql).eq('id', id).build();
3430
+ return await this.findFirst({ ...options, rql: rqlWithId });
3431
+ },
3432
+ async findAll(options) {
3433
+ return await findAllGeneric(this.find, options);
3434
+ },
3435
+ async remove(id) {
3436
+ return (await client.delete(httpWithAuth, `/oauth2/tokens/${id}`)).data;
3437
+ },
3438
+ });
3439
+
3420
3440
  var authorizations = (client, httpWithAuth) => {
3421
3441
  async function find(options) {
3422
3442
  const result = await client.get(httpWithAuth, `/oauth2/authorizations${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, options);
@@ -3449,42 +3469,7 @@ var authorizations = (client, httpWithAuth) => {
3449
3469
  };
3450
3470
  };
3451
3471
 
3452
- var oauth2 = (client, httpWithAuth) => ({
3453
- tokens: createTokenService(client, httpWithAuth),
3454
- refreshTokens: createRefreshTokenService(client, httpWithAuth),
3455
- authorizations: authorizations(client, httpWithAuth),
3456
- async createAuthorization(data, options) {
3457
- return (await client.post(httpWithAuth, '/oauth2/authorizations', data, options)).data;
3458
- },
3459
- async getAuthorizations(options) {
3460
- return (await client.get(httpWithAuth, `/oauth2/authorizations${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, options)).data;
3461
- },
3462
- async deleteAuthorization(authorizationId, options) {
3463
- return (await client.delete(httpWithAuth, `/oauth2/authorizations/${authorizationId}`, options)).data;
3464
- },
3465
- });
3466
- function createTokenService(client, httpWithAuth) {
3467
- return {
3468
- async find(options) {
3469
- return (await client.get(httpWithAuth, `/oauth2/tokens${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, options)).data;
3470
- },
3471
- async findFirst(options) {
3472
- const res = await this.find(options);
3473
- return res.data[0];
3474
- },
3475
- async findById(id, options) {
3476
- const rqlWithId = rqlBuilder(options === null || options === void 0 ? void 0 : options.rql).eq('id', id).build();
3477
- return await this.findFirst({ ...options, rql: rqlWithId });
3478
- },
3479
- async findAll(options) {
3480
- return await findAllGeneric(this.find, options);
3481
- },
3482
- async remove(id) {
3483
- return (await client.delete(httpWithAuth, `/oauth2/tokens/${id}`)).data;
3484
- },
3485
- };
3486
- }
3487
- function createRefreshTokenService(client, httpWithAuth) {
3472
+ var refreshTokens = (client, httpWithAuth) => {
3488
3473
  async function find(options) {
3489
3474
  const result = await client.get(httpWithAuth, `/oauth2/refreshTokens${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, options);
3490
3475
  return result.data;
@@ -3511,7 +3496,22 @@ function createRefreshTokenService(client, httpWithAuth) {
3511
3496
  return result.data;
3512
3497
  },
3513
3498
  };
3514
- }
3499
+ };
3500
+
3501
+ var oauth2 = (client, httpWithAuth) => ({
3502
+ tokens: accessTokens(client, httpWithAuth),
3503
+ refreshTokens: refreshTokens(client, httpWithAuth),
3504
+ authorizations: authorizations(client, httpWithAuth),
3505
+ async createAuthorization(data, options) {
3506
+ return (await client.post(httpWithAuth, '/oauth2/authorizations', data, options)).data;
3507
+ },
3508
+ async getAuthorizations(options) {
3509
+ return (await client.get(httpWithAuth, `/oauth2/authorizations${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, options)).data;
3510
+ },
3511
+ async deleteAuthorization(authorizationId, options) {
3512
+ return (await client.delete(httpWithAuth, `/oauth2/authorizations/${authorizationId}`, options)).data;
3513
+ },
3514
+ });
3515
3515
 
3516
3516
  var loginAttempts = (oidcClient, httpWithAuth) => {
3517
3517
  async function query(options) {
@@ -5735,7 +5735,7 @@ const templatesV2Service = (httpWithAuth) => {
5735
5735
  };
5736
5736
  };
5737
5737
 
5738
- const version = '8.14.0-dev-198-0b81795';
5738
+ const version = '8.14.0-dev-202-65b18ba';
5739
5739
 
5740
5740
  /**
5741
5741
  * Create ExtraHorizon client.
package/build/index.mjs CHANGED
@@ -3349,7 +3349,7 @@ var applications = (client, httpWithAuth) => ({
3349
3349
  });
3350
3350
 
3351
3351
  var oauth1 = (client, httpWithAuth) => ({
3352
- tokens: createTokenService$1(client, httpWithAuth),
3352
+ tokens: createTokenService(client, httpWithAuth),
3353
3353
  async generateSsoToken() {
3354
3354
  return (await client.post(httpWithAuth, '/oauth1/ssoTokens/generate', {}))
3355
3355
  .data;
@@ -3365,7 +3365,7 @@ var oauth1 = (client, httpWithAuth) => ({
3365
3365
  .data;
3366
3366
  },
3367
3367
  });
3368
- function createTokenService$1(client, httpWithAuth) {
3368
+ function createTokenService(client, httpWithAuth) {
3369
3369
  return {
3370
3370
  async find(options) {
3371
3371
  return (await client.get(httpWithAuth, `/oauth1/tokens${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, options)).data;
@@ -3387,6 +3387,26 @@ function createTokenService$1(client, httpWithAuth) {
3387
3387
  };
3388
3388
  }
3389
3389
 
3390
+ var accessTokens = (client, httpWithAuth) => ({
3391
+ async find(options) {
3392
+ return (await client.get(httpWithAuth, `/oauth2/tokens${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, options)).data;
3393
+ },
3394
+ async findFirst(options) {
3395
+ const res = await this.find(options);
3396
+ return res.data[0];
3397
+ },
3398
+ async findById(id, options) {
3399
+ const rqlWithId = rqlBuilder(options === null || options === void 0 ? void 0 : options.rql).eq('id', id).build();
3400
+ return await this.findFirst({ ...options, rql: rqlWithId });
3401
+ },
3402
+ async findAll(options) {
3403
+ return await findAllGeneric(this.find, options);
3404
+ },
3405
+ async remove(id) {
3406
+ return (await client.delete(httpWithAuth, `/oauth2/tokens/${id}`)).data;
3407
+ },
3408
+ });
3409
+
3390
3410
  var authorizations = (client, httpWithAuth) => {
3391
3411
  async function find(options) {
3392
3412
  const result = await client.get(httpWithAuth, `/oauth2/authorizations${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, options);
@@ -3419,42 +3439,7 @@ var authorizations = (client, httpWithAuth) => {
3419
3439
  };
3420
3440
  };
3421
3441
 
3422
- var oauth2 = (client, httpWithAuth) => ({
3423
- tokens: createTokenService(client, httpWithAuth),
3424
- refreshTokens: createRefreshTokenService(client, httpWithAuth),
3425
- authorizations: authorizations(client, httpWithAuth),
3426
- async createAuthorization(data, options) {
3427
- return (await client.post(httpWithAuth, '/oauth2/authorizations', data, options)).data;
3428
- },
3429
- async getAuthorizations(options) {
3430
- return (await client.get(httpWithAuth, `/oauth2/authorizations${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, options)).data;
3431
- },
3432
- async deleteAuthorization(authorizationId, options) {
3433
- return (await client.delete(httpWithAuth, `/oauth2/authorizations/${authorizationId}`, options)).data;
3434
- },
3435
- });
3436
- function createTokenService(client, httpWithAuth) {
3437
- return {
3438
- async find(options) {
3439
- return (await client.get(httpWithAuth, `/oauth2/tokens${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, options)).data;
3440
- },
3441
- async findFirst(options) {
3442
- const res = await this.find(options);
3443
- return res.data[0];
3444
- },
3445
- async findById(id, options) {
3446
- const rqlWithId = rqlBuilder(options === null || options === void 0 ? void 0 : options.rql).eq('id', id).build();
3447
- return await this.findFirst({ ...options, rql: rqlWithId });
3448
- },
3449
- async findAll(options) {
3450
- return await findAllGeneric(this.find, options);
3451
- },
3452
- async remove(id) {
3453
- return (await client.delete(httpWithAuth, `/oauth2/tokens/${id}`)).data;
3454
- },
3455
- };
3456
- }
3457
- function createRefreshTokenService(client, httpWithAuth) {
3442
+ var refreshTokens = (client, httpWithAuth) => {
3458
3443
  async function find(options) {
3459
3444
  const result = await client.get(httpWithAuth, `/oauth2/refreshTokens${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, options);
3460
3445
  return result.data;
@@ -3481,7 +3466,22 @@ function createRefreshTokenService(client, httpWithAuth) {
3481
3466
  return result.data;
3482
3467
  },
3483
3468
  };
3484
- }
3469
+ };
3470
+
3471
+ var oauth2 = (client, httpWithAuth) => ({
3472
+ tokens: accessTokens(client, httpWithAuth),
3473
+ refreshTokens: refreshTokens(client, httpWithAuth),
3474
+ authorizations: authorizations(client, httpWithAuth),
3475
+ async createAuthorization(data, options) {
3476
+ return (await client.post(httpWithAuth, '/oauth2/authorizations', data, options)).data;
3477
+ },
3478
+ async getAuthorizations(options) {
3479
+ return (await client.get(httpWithAuth, `/oauth2/authorizations${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, options)).data;
3480
+ },
3481
+ async deleteAuthorization(authorizationId, options) {
3482
+ return (await client.delete(httpWithAuth, `/oauth2/authorizations/${authorizationId}`, options)).data;
3483
+ },
3484
+ });
3485
3485
 
3486
3486
  var loginAttempts = (oidcClient, httpWithAuth) => {
3487
3487
  async function query(options) {
@@ -5705,7 +5705,7 @@ const templatesV2Service = (httpWithAuth) => {
5705
5705
  };
5706
5706
  };
5707
5707
 
5708
- const version = '8.14.0-dev-198-0b81795';
5708
+ const version = '8.14.0-dev-202-65b18ba';
5709
5709
 
5710
5710
  /**
5711
5711
  * Create ExtraHorizon client.
@@ -0,0 +1,5 @@
1
+ import { HttpInstance } from '../../../../http/types';
2
+ import { HttpClient } from '../../../http-client';
3
+ import { AuthOauth2TokenService } from './types';
4
+ declare const _default: (client: HttpClient, httpWithAuth: HttpInstance) => AuthOauth2TokenService;
5
+ export default _default;
@@ -0,0 +1,61 @@
1
+ import { AffectedRecords, OptionsWithRql, PagedResult } from '../../../types';
2
+ export interface AuthOauth2TokenService {
3
+ /**
4
+ * Get a list of OAuth2 tokens
5
+ *
6
+ * Permission | Scope | Effect
7
+ * - | - | -
8
+ * none | | Can only see a list of OAuth2 tokens for this account
9
+ * VIEW_AUTHORIZATIONS | global | See any OAuth2 tokens belonging to any user
10
+ */
11
+ find(options?: OptionsWithRql): Promise<PagedResult<OAuth2Token>>;
12
+ /**
13
+ * Get a list of OAuth2 tokens
14
+ *
15
+ * Permission | Scope | Effect
16
+ * - | - | -
17
+ * none | | Can only see a list of OAuth2 tokens for this account
18
+ * VIEW_AUTHORIZATIONS | global | See any OAuth2 tokens belonging to any user
19
+ */
20
+ findAll(options?: OptionsWithRql): Promise<OAuth2Token[]>;
21
+ /**
22
+ * Get the first OAuth2 token found
23
+ *
24
+ * Permission | Scope | Effect
25
+ * - | - | -
26
+ * none | | Can only see a list of OAuth2 tokens for this account
27
+ * VIEW_AUTHORIZATIONS | global | See any OAuth2 tokens belonging to any user
28
+ */
29
+ findFirst(options?: OptionsWithRql): Promise<OAuth2Token | undefined>;
30
+ /**
31
+ * Get an oAuth2 token by its id
32
+ *
33
+ * Permission | Scope | Effect
34
+ * - | - | -
35
+ * none | | Can only see a list of OAuth2 tokens for this account
36
+ * VIEW_AUTHORIZATIONS | global | See any OAuth2 tokens belonging to any user
37
+ */
38
+ findById(id: string, options?: OptionsWithRql): Promise<OAuth2Token | undefined>;
39
+ /**
40
+ * Remove an oAuth2 token
41
+ *
42
+ * Permission | Scope | Effect
43
+ * - | - | -
44
+ * none | | Can only delete OAuth2 tokens for this account
45
+ * DELETE_AUTHORIZATIONS | global | Delete any OAuth2 tokens belonging to any user
46
+ */
47
+ remove(id: string): Promise<AffectedRecords>;
48
+ }
49
+ export interface OAuth2Token {
50
+ id: string;
51
+ applicationId: string;
52
+ userId: string;
53
+ refreshTokenId: string;
54
+ /**
55
+ * @deprecated `accessToken` will be removed from responses returned by listing endpoints in a future version.
56
+ */
57
+ accessToken?: string;
58
+ expiryTimestamp: Date;
59
+ updateTimestamp: Date;
60
+ creationTimestamp: Date;
61
+ }
@@ -0,0 +1,5 @@
1
+ import { HttpInstance } from '../../../../http/types';
2
+ import { HttpClient } from '../../../http-client';
3
+ import { OAuth2RefreshTokenService } from './types';
4
+ declare const _default: (client: HttpClient, httpWithAuth: HttpInstance) => OAuth2RefreshTokenService;
5
+ export default _default;
@@ -0,0 +1,72 @@
1
+ import { AffectedRecords, OptionsBase, OptionsWithRql, PagedResult } from '../../../types';
2
+ export interface OAuth2RefreshTokenService {
3
+ /**
4
+ * # Get a list of OAuth2 refresh tokens
5
+ *
6
+ * Permission | Scope | Effect
7
+ * - | - | -
8
+ * none | | Can only see a list of OAuth2 refresh tokens for this account
9
+ * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
10
+ * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
11
+ * @param options.rql Add filters to the requested list
12
+ * @returns PagedResult<OAuth2RefreshToken>
13
+ */
14
+ find(options?: OptionsWithRql): Promise<PagedResult<OAuth2RefreshToken>>;
15
+ /**
16
+ * Get a list of OAuth2 refresh tokens
17
+ *
18
+ * Permission | Scope | Effect
19
+ * - | - | -
20
+ * none | | Can only see a list of OAuth2 refresh tokens for this account
21
+ * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
22
+ * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
23
+ * @param options.rql Add filters to the requested list
24
+ * @returns OAuth2RefreshToken[]
25
+ */
26
+ findAll(options?: OptionsWithRql): Promise<OAuth2RefreshToken[]>;
27
+ /**
28
+ * Get the first OAuth2 refresh token found
29
+ *
30
+ * Permission | Scope | Effect
31
+ * - | - | -
32
+ * none | | Can only see a list of OAuth2 refresh tokens for this account
33
+ * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
34
+ * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
35
+ * @param options.rql Add filters to the requested list
36
+ * @returns {Promise<OAuth2RefreshToken | undefined>}
37
+ */
38
+ findFirst(options?: OptionsWithRql): Promise<OAuth2RefreshToken | undefined>;
39
+ /**
40
+ * Get an oAuth2 refresh token by its id
41
+ *
42
+ * Permission | Scope | Effect
43
+ * - | - | -
44
+ * none | | Can only see a list of OAuth2 refresh tokens for this account
45
+ * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
46
+ * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
47
+ * @param id the refresh token id
48
+ * @param options.rql Add filters to the requested list
49
+ * @returns {Promise<OAuth2RefreshToken | undefined>}
50
+ */
51
+ findById(id: string, options?: OptionsWithRql): Promise<OAuth2RefreshToken | undefined>;
52
+ /**
53
+ * Delete an oAuth2 refresh token
54
+ *
55
+ * Permission | Scope | Effect
56
+ * - | - | -
57
+ * none | | Can only delete OAuth2 refresh tokens for this account
58
+ * DELETE_OAUTH2_REFRESH_TOKEN or DELETE_AUTHORIZATIONS | global | Delete any OAuth2 refresh tokens belonging to any user
59
+ * Using DELETE_AUTHORIZATIONS for this endpoint is deprecated; use DELETE_OAUTH2_REFRESH_TOKEN instead
60
+ * @param id the refresh token id
61
+ * @returns AffectedRecords
62
+ */
63
+ remove(id: string, options?: OptionsBase): Promise<AffectedRecords>;
64
+ }
65
+ export interface OAuth2RefreshToken {
66
+ id: string;
67
+ applicationId: string;
68
+ userId: string;
69
+ expiryTimestamp: Date;
70
+ updateTimestamp: Date;
71
+ creationTimestamp: Date;
72
+ }
@@ -1,5 +1,10 @@
1
1
  import { AffectedRecords, OptionsBase, OptionsWithRql, PagedResult } from '../../types';
2
+ import { AuthOauth2TokenService } from './accessTokens/types';
2
3
  import { OAuth2AuthorizationsService } from './authorizations/types';
4
+ import { OAuth2RefreshTokenService } from './refreshTokens/types';
5
+ export * from './accessTokens/types';
6
+ export * from './authorizations/types';
7
+ export * from './refreshTokens/types';
3
8
  export interface AuthOauth2Service {
4
9
  tokens: AuthOauth2TokenService;
5
10
  refreshTokens: OAuth2RefreshTokenService;
@@ -41,116 +46,6 @@ export interface AuthOauth2Service {
41
46
  */
42
47
  deleteAuthorization(authorizationId: string, options?: OptionsWithRql): Promise<AffectedRecords>;
43
48
  }
44
- export interface AuthOauth2TokenService {
45
- /**
46
- * Get a list of OAuth2 tokens
47
- *
48
- * Permission | Scope | Effect
49
- * - | - | -
50
- * none | | Can only see a list of OAuth2 tokens for this account
51
- * VIEW_AUTHORIZATIONS | global | See any OAuth2 tokens belonging to any user
52
- */
53
- find(options?: OptionsWithRql): Promise<PagedResult<OAuth2Token>>;
54
- /**
55
- * Get a list of OAuth2 tokens
56
- *
57
- * Permission | Scope | Effect
58
- * - | - | -
59
- * none | | Can only see a list of OAuth2 tokens for this account
60
- * VIEW_AUTHORIZATIONS | global | See any OAuth2 tokens belonging to any user
61
- */
62
- findAll(options?: OptionsWithRql): Promise<OAuth2Token[]>;
63
- /**
64
- * Get the first OAuth2 token found
65
- *
66
- * Permission | Scope | Effect
67
- * - | - | -
68
- * none | | Can only see a list of OAuth2 tokens for this account
69
- * VIEW_AUTHORIZATIONS | global | See any OAuth2 tokens belonging to any user
70
- */
71
- findFirst(options?: OptionsWithRql): Promise<OAuth2Token | undefined>;
72
- /**
73
- * Get an oAuth2 token by its id
74
- *
75
- * Permission | Scope | Effect
76
- * - | - | -
77
- * none | | Can only see a list of OAuth2 tokens for this account
78
- * VIEW_AUTHORIZATIONS | global | See any OAuth2 tokens belonging to any user
79
- */
80
- findById(id: string, options?: OptionsWithRql): Promise<OAuth2Token | undefined>;
81
- /**
82
- * Remove an oAuth2 token
83
- *
84
- * Permission | Scope | Effect
85
- * - | - | -
86
- * none | | Can only delete OAuth2 tokens for this account
87
- * DELETE_AUTHORIZATIONS | global | Delete any OAuth2 tokens belonging to any user
88
- */
89
- remove(id: string): Promise<AffectedRecords>;
90
- }
91
- export interface OAuth2RefreshTokenService {
92
- /**
93
- * # Get a list of OAuth2 refresh tokens
94
- *
95
- * Permission | Scope | Effect
96
- * - | - | -
97
- * none | | Can only see a list of OAuth2 refresh tokens for this account
98
- * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
99
- * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
100
- * @param options.rql Add filters to the requested list
101
- * @returns PagedResult<OAuth2RefreshToken>
102
- */
103
- find(options?: OptionsWithRql): Promise<PagedResult<OAuth2RefreshToken>>;
104
- /**
105
- * Get a list of OAuth2 refresh tokens
106
- *
107
- * Permission | Scope | Effect
108
- * - | - | -
109
- * none | | Can only see a list of OAuth2 refresh tokens for this account
110
- * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
111
- * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
112
- * @param options.rql Add filters to the requested list
113
- * @returns OAuth2RefreshToken[]
114
- */
115
- findAll(options?: OptionsWithRql): Promise<OAuth2RefreshToken[]>;
116
- /**
117
- * Get the first OAuth2 refresh token found
118
- *
119
- * Permission | Scope | Effect
120
- * - | - | -
121
- * none | | Can only see a list of OAuth2 refresh tokens for this account
122
- * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
123
- * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
124
- * @param options.rql Add filters to the requested list
125
- * @returns {Promise<OAuth2RefreshToken | undefined>}
126
- */
127
- findFirst(options?: OptionsWithRql): Promise<OAuth2RefreshToken | undefined>;
128
- /**
129
- * Get an oAuth2 refresh token by its id
130
- *
131
- * Permission | Scope | Effect
132
- * - | - | -
133
- * none | | Can only see a list of OAuth2 refresh tokens for this account
134
- * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
135
- * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
136
- * @param id the refresh token id
137
- * @param options.rql Add filters to the requested list
138
- * @returns {Promise<OAuth2RefreshToken | undefined>}
139
- */
140
- findById(id: string, options?: OptionsWithRql): Promise<OAuth2RefreshToken | undefined>;
141
- /**
142
- * Delete an oAuth2 refresh token
143
- *
144
- * Permission | Scope | Effect
145
- * - | - | -
146
- * none | | Can only delete OAuth2 refresh tokens for this account
147
- * DELETE_OAUTH2_REFRESH_TOKEN or DELETE_AUTHORIZATIONS | global | Delete any OAuth2 refresh tokens belonging to any user
148
- * Using DELETE_AUTHORIZATIONS for this endpoint is deprecated; use DELETE_OAUTH2_REFRESH_TOKEN instead
149
- * @param id the refresh token id
150
- * @returns AffectedRecords
151
- */
152
- remove(id: string, options?: OptionsBase): Promise<AffectedRecords>;
153
- }
154
49
  export interface OAuth2AuthorizationCreation {
155
50
  responseType: 'code';
156
51
  clientId: string;
@@ -191,27 +86,6 @@ export interface OAuth2Authorization {
191
86
  updateTimestamp: Date;
192
87
  creationTimestamp: Date;
193
88
  }
194
- export interface OAuth2Token {
195
- id: string;
196
- applicationId: string;
197
- userId: string;
198
- refreshTokenId: string;
199
- /**
200
- * @deprecated `accessToken` will be removed from responses returned by listing endpoints in a future version.
201
- */
202
- accessToken?: string;
203
- expiryTimestamp: Date;
204
- updateTimestamp: Date;
205
- creationTimestamp: Date;
206
- }
207
- export interface OAuth2RefreshToken {
208
- id: string;
209
- applicationId: string;
210
- userId: string;
211
- expiryTimestamp: Date;
212
- updateTimestamp: Date;
213
- creationTimestamp: Date;
214
- }
215
89
  export declare enum PKCECodeMethods {
216
90
  PLAIN = "plain",
217
91
  S256 = "S256"
@@ -0,0 +1,5 @@
1
+ import { HttpInstance } from '../../../../http/types';
2
+ import { HttpClient } from '../../../http-client';
3
+ import { AuthOauth2TokenService } from './types';
4
+ declare const _default: (client: HttpClient, httpWithAuth: HttpInstance) => AuthOauth2TokenService;
5
+ export default _default;
@@ -0,0 +1,61 @@
1
+ import { AffectedRecords, OptionsWithRql, PagedResult } from '../../../types';
2
+ export interface AuthOauth2TokenService {
3
+ /**
4
+ * Get a list of OAuth2 tokens
5
+ *
6
+ * Permission | Scope | Effect
7
+ * - | - | -
8
+ * none | | Can only see a list of OAuth2 tokens for this account
9
+ * VIEW_AUTHORIZATIONS | global | See any OAuth2 tokens belonging to any user
10
+ */
11
+ find(options?: OptionsWithRql): Promise<PagedResult<OAuth2Token>>;
12
+ /**
13
+ * Get a list of OAuth2 tokens
14
+ *
15
+ * Permission | Scope | Effect
16
+ * - | - | -
17
+ * none | | Can only see a list of OAuth2 tokens for this account
18
+ * VIEW_AUTHORIZATIONS | global | See any OAuth2 tokens belonging to any user
19
+ */
20
+ findAll(options?: OptionsWithRql): Promise<OAuth2Token[]>;
21
+ /**
22
+ * Get the first OAuth2 token found
23
+ *
24
+ * Permission | Scope | Effect
25
+ * - | - | -
26
+ * none | | Can only see a list of OAuth2 tokens for this account
27
+ * VIEW_AUTHORIZATIONS | global | See any OAuth2 tokens belonging to any user
28
+ */
29
+ findFirst(options?: OptionsWithRql): Promise<OAuth2Token | undefined>;
30
+ /**
31
+ * Get an oAuth2 token by its id
32
+ *
33
+ * Permission | Scope | Effect
34
+ * - | - | -
35
+ * none | | Can only see a list of OAuth2 tokens for this account
36
+ * VIEW_AUTHORIZATIONS | global | See any OAuth2 tokens belonging to any user
37
+ */
38
+ findById(id: string, options?: OptionsWithRql): Promise<OAuth2Token | undefined>;
39
+ /**
40
+ * Remove an oAuth2 token
41
+ *
42
+ * Permission | Scope | Effect
43
+ * - | - | -
44
+ * none | | Can only delete OAuth2 tokens for this account
45
+ * DELETE_AUTHORIZATIONS | global | Delete any OAuth2 tokens belonging to any user
46
+ */
47
+ remove(id: string): Promise<AffectedRecords>;
48
+ }
49
+ export interface OAuth2Token {
50
+ id: string;
51
+ applicationId: string;
52
+ userId: string;
53
+ refreshTokenId: string;
54
+ /**
55
+ * @deprecated `accessToken` will be removed from responses returned by listing endpoints in a future version.
56
+ */
57
+ accessToken?: string;
58
+ expiryTimestamp: Date;
59
+ updateTimestamp: Date;
60
+ creationTimestamp: Date;
61
+ }
@@ -0,0 +1,5 @@
1
+ import { HttpInstance } from '../../../../http/types';
2
+ import { HttpClient } from '../../../http-client';
3
+ import { OAuth2RefreshTokenService } from './types';
4
+ declare const _default: (client: HttpClient, httpWithAuth: HttpInstance) => OAuth2RefreshTokenService;
5
+ export default _default;
@@ -0,0 +1,72 @@
1
+ import { AffectedRecords, OptionsBase, OptionsWithRql, PagedResult } from '../../../types';
2
+ export interface OAuth2RefreshTokenService {
3
+ /**
4
+ * # Get a list of OAuth2 refresh tokens
5
+ *
6
+ * Permission | Scope | Effect
7
+ * - | - | -
8
+ * none | | Can only see a list of OAuth2 refresh tokens for this account
9
+ * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
10
+ * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
11
+ * @param options.rql Add filters to the requested list
12
+ * @returns PagedResult<OAuth2RefreshToken>
13
+ */
14
+ find(options?: OptionsWithRql): Promise<PagedResult<OAuth2RefreshToken>>;
15
+ /**
16
+ * Get a list of OAuth2 refresh tokens
17
+ *
18
+ * Permission | Scope | Effect
19
+ * - | - | -
20
+ * none | | Can only see a list of OAuth2 refresh tokens for this account
21
+ * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
22
+ * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
23
+ * @param options.rql Add filters to the requested list
24
+ * @returns OAuth2RefreshToken[]
25
+ */
26
+ findAll(options?: OptionsWithRql): Promise<OAuth2RefreshToken[]>;
27
+ /**
28
+ * Get the first OAuth2 refresh token found
29
+ *
30
+ * Permission | Scope | Effect
31
+ * - | - | -
32
+ * none | | Can only see a list of OAuth2 refresh tokens for this account
33
+ * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
34
+ * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
35
+ * @param options.rql Add filters to the requested list
36
+ * @returns {Promise<OAuth2RefreshToken | undefined>}
37
+ */
38
+ findFirst(options?: OptionsWithRql): Promise<OAuth2RefreshToken | undefined>;
39
+ /**
40
+ * Get an oAuth2 refresh token by its id
41
+ *
42
+ * Permission | Scope | Effect
43
+ * - | - | -
44
+ * none | | Can only see a list of OAuth2 refresh tokens for this account
45
+ * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
46
+ * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
47
+ * @param id the refresh token id
48
+ * @param options.rql Add filters to the requested list
49
+ * @returns {Promise<OAuth2RefreshToken | undefined>}
50
+ */
51
+ findById(id: string, options?: OptionsWithRql): Promise<OAuth2RefreshToken | undefined>;
52
+ /**
53
+ * Delete an oAuth2 refresh token
54
+ *
55
+ * Permission | Scope | Effect
56
+ * - | - | -
57
+ * none | | Can only delete OAuth2 refresh tokens for this account
58
+ * DELETE_OAUTH2_REFRESH_TOKEN or DELETE_AUTHORIZATIONS | global | Delete any OAuth2 refresh tokens belonging to any user
59
+ * Using DELETE_AUTHORIZATIONS for this endpoint is deprecated; use DELETE_OAUTH2_REFRESH_TOKEN instead
60
+ * @param id the refresh token id
61
+ * @returns AffectedRecords
62
+ */
63
+ remove(id: string, options?: OptionsBase): Promise<AffectedRecords>;
64
+ }
65
+ export interface OAuth2RefreshToken {
66
+ id: string;
67
+ applicationId: string;
68
+ userId: string;
69
+ expiryTimestamp: Date;
70
+ updateTimestamp: Date;
71
+ creationTimestamp: Date;
72
+ }
@@ -1,5 +1,10 @@
1
1
  import { AffectedRecords, OptionsBase, OptionsWithRql, PagedResult } from '../../types';
2
+ import { AuthOauth2TokenService } from './accessTokens/types';
2
3
  import { OAuth2AuthorizationsService } from './authorizations/types';
4
+ import { OAuth2RefreshTokenService } from './refreshTokens/types';
5
+ export * from './accessTokens/types';
6
+ export * from './authorizations/types';
7
+ export * from './refreshTokens/types';
3
8
  export interface AuthOauth2Service {
4
9
  tokens: AuthOauth2TokenService;
5
10
  refreshTokens: OAuth2RefreshTokenService;
@@ -41,116 +46,6 @@ export interface AuthOauth2Service {
41
46
  */
42
47
  deleteAuthorization(authorizationId: string, options?: OptionsWithRql): Promise<AffectedRecords>;
43
48
  }
44
- export interface AuthOauth2TokenService {
45
- /**
46
- * Get a list of OAuth2 tokens
47
- *
48
- * Permission | Scope | Effect
49
- * - | - | -
50
- * none | | Can only see a list of OAuth2 tokens for this account
51
- * VIEW_AUTHORIZATIONS | global | See any OAuth2 tokens belonging to any user
52
- */
53
- find(options?: OptionsWithRql): Promise<PagedResult<OAuth2Token>>;
54
- /**
55
- * Get a list of OAuth2 tokens
56
- *
57
- * Permission | Scope | Effect
58
- * - | - | -
59
- * none | | Can only see a list of OAuth2 tokens for this account
60
- * VIEW_AUTHORIZATIONS | global | See any OAuth2 tokens belonging to any user
61
- */
62
- findAll(options?: OptionsWithRql): Promise<OAuth2Token[]>;
63
- /**
64
- * Get the first OAuth2 token found
65
- *
66
- * Permission | Scope | Effect
67
- * - | - | -
68
- * none | | Can only see a list of OAuth2 tokens for this account
69
- * VIEW_AUTHORIZATIONS | global | See any OAuth2 tokens belonging to any user
70
- */
71
- findFirst(options?: OptionsWithRql): Promise<OAuth2Token | undefined>;
72
- /**
73
- * Get an oAuth2 token by its id
74
- *
75
- * Permission | Scope | Effect
76
- * - | - | -
77
- * none | | Can only see a list of OAuth2 tokens for this account
78
- * VIEW_AUTHORIZATIONS | global | See any OAuth2 tokens belonging to any user
79
- */
80
- findById(id: string, options?: OptionsWithRql): Promise<OAuth2Token | undefined>;
81
- /**
82
- * Remove an oAuth2 token
83
- *
84
- * Permission | Scope | Effect
85
- * - | - | -
86
- * none | | Can only delete OAuth2 tokens for this account
87
- * DELETE_AUTHORIZATIONS | global | Delete any OAuth2 tokens belonging to any user
88
- */
89
- remove(id: string): Promise<AffectedRecords>;
90
- }
91
- export interface OAuth2RefreshTokenService {
92
- /**
93
- * # Get a list of OAuth2 refresh tokens
94
- *
95
- * Permission | Scope | Effect
96
- * - | - | -
97
- * none | | Can only see a list of OAuth2 refresh tokens for this account
98
- * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
99
- * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
100
- * @param options.rql Add filters to the requested list
101
- * @returns PagedResult<OAuth2RefreshToken>
102
- */
103
- find(options?: OptionsWithRql): Promise<PagedResult<OAuth2RefreshToken>>;
104
- /**
105
- * Get a list of OAuth2 refresh tokens
106
- *
107
- * Permission | Scope | Effect
108
- * - | - | -
109
- * none | | Can only see a list of OAuth2 refresh tokens for this account
110
- * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
111
- * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
112
- * @param options.rql Add filters to the requested list
113
- * @returns OAuth2RefreshToken[]
114
- */
115
- findAll(options?: OptionsWithRql): Promise<OAuth2RefreshToken[]>;
116
- /**
117
- * Get the first OAuth2 refresh token found
118
- *
119
- * Permission | Scope | Effect
120
- * - | - | -
121
- * none | | Can only see a list of OAuth2 refresh tokens for this account
122
- * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
123
- * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
124
- * @param options.rql Add filters to the requested list
125
- * @returns {Promise<OAuth2RefreshToken | undefined>}
126
- */
127
- findFirst(options?: OptionsWithRql): Promise<OAuth2RefreshToken | undefined>;
128
- /**
129
- * Get an oAuth2 refresh token by its id
130
- *
131
- * Permission | Scope | Effect
132
- * - | - | -
133
- * none | | Can only see a list of OAuth2 refresh tokens for this account
134
- * VIEW_OAUTH2_REFRESH_TOKENS or VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 refresh tokens for any account
135
- * Using VIEW_AUTHORIZATIONS for this endpoint is deprecated; use VIEW_OAUTH2_REFRESH_TOKENS instead
136
- * @param id the refresh token id
137
- * @param options.rql Add filters to the requested list
138
- * @returns {Promise<OAuth2RefreshToken | undefined>}
139
- */
140
- findById(id: string, options?: OptionsWithRql): Promise<OAuth2RefreshToken | undefined>;
141
- /**
142
- * Delete an oAuth2 refresh token
143
- *
144
- * Permission | Scope | Effect
145
- * - | - | -
146
- * none | | Can only delete OAuth2 refresh tokens for this account
147
- * DELETE_OAUTH2_REFRESH_TOKEN or DELETE_AUTHORIZATIONS | global | Delete any OAuth2 refresh tokens belonging to any user
148
- * Using DELETE_AUTHORIZATIONS for this endpoint is deprecated; use DELETE_OAUTH2_REFRESH_TOKEN instead
149
- * @param id the refresh token id
150
- * @returns AffectedRecords
151
- */
152
- remove(id: string, options?: OptionsBase): Promise<AffectedRecords>;
153
- }
154
49
  export interface OAuth2AuthorizationCreation {
155
50
  responseType: 'code';
156
51
  clientId: string;
@@ -191,27 +86,6 @@ export interface OAuth2Authorization {
191
86
  updateTimestamp: Date;
192
87
  creationTimestamp: Date;
193
88
  }
194
- export interface OAuth2Token {
195
- id: string;
196
- applicationId: string;
197
- userId: string;
198
- refreshTokenId: string;
199
- /**
200
- * @deprecated `accessToken` will be removed from responses returned by listing endpoints in a future version.
201
- */
202
- accessToken?: string;
203
- expiryTimestamp: Date;
204
- updateTimestamp: Date;
205
- creationTimestamp: Date;
206
- }
207
- export interface OAuth2RefreshToken {
208
- id: string;
209
- applicationId: string;
210
- userId: string;
211
- expiryTimestamp: Date;
212
- updateTimestamp: Date;
213
- creationTimestamp: Date;
214
- }
215
89
  export declare enum PKCECodeMethods {
216
90
  PLAIN = "plain",
217
91
  S256 = "S256"
@@ -1 +1 @@
1
- export declare const version = "8.14.0-dev-198-0b81795";
1
+ export declare const version = "8.14.0-dev-202-65b18ba";
@@ -1 +1 @@
1
- export declare const version = "8.14.0-dev-198-0b81795";
1
+ export declare const version = "8.14.0-dev-202-65b18ba";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@extrahorizon/javascript-sdk",
3
- "version": "8.14.0-dev-198-0b81795",
3
+ "version": "8.14.0-dev-202-65b18ba",
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",