@triveria/wallet 0.0.154 → 0.0.156
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/api.d.ts +26 -32
- package/api.js +18 -23
- package/auth.d.ts +1 -1
- package/auth.js +3 -4
- package/client.d.ts +1 -1
- package/client.js +2 -2
- package/package.json +1 -1
package/api.d.ts
CHANGED
|
@@ -912,6 +912,16 @@ export interface Jwks {
|
|
|
912
912
|
*/
|
|
913
913
|
'keys': Array<object>;
|
|
914
914
|
}
|
|
915
|
+
/**
|
|
916
|
+
* Sort flag controls the sort direction by the time created
|
|
917
|
+
* @export
|
|
918
|
+
* @enum {string}
|
|
919
|
+
*/
|
|
920
|
+
export declare const ListSort: {
|
|
921
|
+
readonly Asc: "asc";
|
|
922
|
+
readonly Desc: "desc";
|
|
923
|
+
};
|
|
924
|
+
export type ListSort = typeof ListSort[keyof typeof ListSort];
|
|
915
925
|
/**
|
|
916
926
|
* Common error message
|
|
917
927
|
* @export
|
|
@@ -1665,13 +1675,13 @@ export declare const DefaultApiAxiosParamCreator: (configuration?: Configuration
|
|
|
1665
1675
|
* @param {string} [type] The credential type as comma delimited list representing a single type. I.e. VerifiableCredential,VerifiableAttestation,Europass.
|
|
1666
1676
|
* @param {number} [limit] The number of items
|
|
1667
1677
|
* @param {string} [nextMarker] Marking the next set of items
|
|
1668
|
-
* @param {
|
|
1678
|
+
* @param {ListSort} [sort] Sort flag controls the sort direction by the time updated or issued
|
|
1669
1679
|
* @param {string} [path] JSON path specification for the filter to apply
|
|
1670
1680
|
* @param {string} [filter] JSON schema filter used to select the credentials (base64 encoded)
|
|
1671
1681
|
* @param {*} [options] Override http request option.
|
|
1672
1682
|
* @throws {RequiredError}
|
|
1673
1683
|
*/
|
|
1674
|
-
credentialList: (walletId: string, interaction: CredentialListInteractionEnum, type?: string, limit?: number, nextMarker?: string, sort?:
|
|
1684
|
+
credentialList: (walletId: string, interaction: CredentialListInteractionEnum, type?: string, limit?: number, nextMarker?: string, sort?: ListSort, path?: string, filter?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
1675
1685
|
/**
|
|
1676
1686
|
* Verifiable Credential metadata may be updated even after the credential was issued. It is available as a key value storage for a client to store any additional data for the credential.
|
|
1677
1687
|
* @param {string} credentialId Verifiable Credential Identifier
|
|
@@ -1938,11 +1948,11 @@ export declare const DefaultApiAxiosParamCreator: (configuration?: Configuration
|
|
|
1938
1948
|
* @param {number} [limit] The number of items
|
|
1939
1949
|
* @param {string} [nextMarker] Marking the next set of items
|
|
1940
1950
|
* @param {Array<WalletNotificationEventType>} [type] Notification types
|
|
1941
|
-
* @param {
|
|
1951
|
+
* @param {ListSort} [sort] Sort flag controls the sort direction by the time created
|
|
1942
1952
|
* @param {*} [options] Override http request option.
|
|
1943
1953
|
* @throws {RequiredError}
|
|
1944
1954
|
*/
|
|
1945
|
-
walletNotificationHistory: (walletId: string, limit?: number, nextMarker?: string, type?: Array<WalletNotificationEventType>, sort?:
|
|
1955
|
+
walletNotificationHistory: (walletId: string, limit?: number, nextMarker?: string, type?: Array<WalletNotificationEventType>, sort?: ListSort, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
1946
1956
|
/**
|
|
1947
1957
|
* Provides first-in-first-out queue of notifications for a specific wallet.
|
|
1948
1958
|
* @param {string} walletId Wallet ID
|
|
@@ -2010,13 +2020,13 @@ export declare const DefaultApiFp: (configuration?: Configuration) => {
|
|
|
2010
2020
|
* @param {string} [type] The credential type as comma delimited list representing a single type. I.e. VerifiableCredential,VerifiableAttestation,Europass.
|
|
2011
2021
|
* @param {number} [limit] The number of items
|
|
2012
2022
|
* @param {string} [nextMarker] Marking the next set of items
|
|
2013
|
-
* @param {
|
|
2023
|
+
* @param {ListSort} [sort] Sort flag controls the sort direction by the time updated or issued
|
|
2014
2024
|
* @param {string} [path] JSON path specification for the filter to apply
|
|
2015
2025
|
* @param {string} [filter] JSON schema filter used to select the credentials (base64 encoded)
|
|
2016
2026
|
* @param {*} [options] Override http request option.
|
|
2017
2027
|
* @throws {RequiredError}
|
|
2018
2028
|
*/
|
|
2019
|
-
credentialList(walletId: string, interaction: CredentialListInteractionEnum, type?: string, limit?: number, nextMarker?: string, sort?:
|
|
2029
|
+
credentialList(walletId: string, interaction: CredentialListInteractionEnum, type?: string, limit?: number, nextMarker?: string, sort?: ListSort, path?: string, filter?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CredentialList>>;
|
|
2020
2030
|
/**
|
|
2021
2031
|
* Verifiable Credential metadata may be updated even after the credential was issued. It is available as a key value storage for a client to store any additional data for the credential.
|
|
2022
2032
|
* @param {string} credentialId Verifiable Credential Identifier
|
|
@@ -2283,11 +2293,11 @@ export declare const DefaultApiFp: (configuration?: Configuration) => {
|
|
|
2283
2293
|
* @param {number} [limit] The number of items
|
|
2284
2294
|
* @param {string} [nextMarker] Marking the next set of items
|
|
2285
2295
|
* @param {Array<WalletNotificationEventType>} [type] Notification types
|
|
2286
|
-
* @param {
|
|
2296
|
+
* @param {ListSort} [sort] Sort flag controls the sort direction by the time created
|
|
2287
2297
|
* @param {*} [options] Override http request option.
|
|
2288
2298
|
* @throws {RequiredError}
|
|
2289
2299
|
*/
|
|
2290
|
-
walletNotificationHistory(walletId: string, limit?: number, nextMarker?: string, type?: Array<WalletNotificationEventType>, sort?:
|
|
2300
|
+
walletNotificationHistory(walletId: string, limit?: number, nextMarker?: string, type?: Array<WalletNotificationEventType>, sort?: ListSort, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<WalletNotificationHistory>>;
|
|
2291
2301
|
/**
|
|
2292
2302
|
* Provides first-in-first-out queue of notifications for a specific wallet.
|
|
2293
2303
|
* @param {string} walletId Wallet ID
|
|
@@ -2355,13 +2365,13 @@ export declare const DefaultApiFactory: (configuration?: Configuration, basePath
|
|
|
2355
2365
|
* @param {string} [type] The credential type as comma delimited list representing a single type. I.e. VerifiableCredential,VerifiableAttestation,Europass.
|
|
2356
2366
|
* @param {number} [limit] The number of items
|
|
2357
2367
|
* @param {string} [nextMarker] Marking the next set of items
|
|
2358
|
-
* @param {
|
|
2368
|
+
* @param {ListSort} [sort] Sort flag controls the sort direction by the time updated or issued
|
|
2359
2369
|
* @param {string} [path] JSON path specification for the filter to apply
|
|
2360
2370
|
* @param {string} [filter] JSON schema filter used to select the credentials (base64 encoded)
|
|
2361
2371
|
* @param {*} [options] Override http request option.
|
|
2362
2372
|
* @throws {RequiredError}
|
|
2363
2373
|
*/
|
|
2364
|
-
credentialList(walletId: string, interaction: CredentialListInteractionEnum, type?: string, limit?: number, nextMarker?: string, sort?:
|
|
2374
|
+
credentialList(walletId: string, interaction: CredentialListInteractionEnum, type?: string, limit?: number, nextMarker?: string, sort?: ListSort, path?: string, filter?: string, options?: any): AxiosPromise<CredentialList>;
|
|
2365
2375
|
/**
|
|
2366
2376
|
* Verifiable Credential metadata may be updated even after the credential was issued. It is available as a key value storage for a client to store any additional data for the credential.
|
|
2367
2377
|
* @param {string} credentialId Verifiable Credential Identifier
|
|
@@ -2628,11 +2638,11 @@ export declare const DefaultApiFactory: (configuration?: Configuration, basePath
|
|
|
2628
2638
|
* @param {number} [limit] The number of items
|
|
2629
2639
|
* @param {string} [nextMarker] Marking the next set of items
|
|
2630
2640
|
* @param {Array<WalletNotificationEventType>} [type] Notification types
|
|
2631
|
-
* @param {
|
|
2641
|
+
* @param {ListSort} [sort] Sort flag controls the sort direction by the time created
|
|
2632
2642
|
* @param {*} [options] Override http request option.
|
|
2633
2643
|
* @throws {RequiredError}
|
|
2634
2644
|
*/
|
|
2635
|
-
walletNotificationHistory(walletId: string, limit?: number, nextMarker?: string, type?: Array<WalletNotificationEventType>, sort?:
|
|
2645
|
+
walletNotificationHistory(walletId: string, limit?: number, nextMarker?: string, type?: Array<WalletNotificationEventType>, sort?: ListSort, options?: any): AxiosPromise<WalletNotificationHistory>;
|
|
2636
2646
|
/**
|
|
2637
2647
|
* Provides first-in-first-out queue of notifications for a specific wallet.
|
|
2638
2648
|
* @param {string} walletId Wallet ID
|
|
@@ -2707,14 +2717,14 @@ export declare class DefaultApi extends BaseAPI {
|
|
|
2707
2717
|
* @param {string} [type] The credential type as comma delimited list representing a single type. I.e. VerifiableCredential,VerifiableAttestation,Europass.
|
|
2708
2718
|
* @param {number} [limit] The number of items
|
|
2709
2719
|
* @param {string} [nextMarker] Marking the next set of items
|
|
2710
|
-
* @param {
|
|
2720
|
+
* @param {ListSort} [sort] Sort flag controls the sort direction by the time updated or issued
|
|
2711
2721
|
* @param {string} [path] JSON path specification for the filter to apply
|
|
2712
2722
|
* @param {string} [filter] JSON schema filter used to select the credentials (base64 encoded)
|
|
2713
2723
|
* @param {*} [options] Override http request option.
|
|
2714
2724
|
* @throws {RequiredError}
|
|
2715
2725
|
* @memberof DefaultApi
|
|
2716
2726
|
*/
|
|
2717
|
-
credentialList(walletId: string, interaction: CredentialListInteractionEnum, type?: string, limit?: number, nextMarker?: string, sort?:
|
|
2727
|
+
credentialList(walletId: string, interaction: CredentialListInteractionEnum, type?: string, limit?: number, nextMarker?: string, sort?: ListSort, path?: string, filter?: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<CredentialList, any>>;
|
|
2718
2728
|
/**
|
|
2719
2729
|
* Verifiable Credential metadata may be updated even after the credential was issued. It is available as a key value storage for a client to store any additional data for the credential.
|
|
2720
2730
|
* @param {string} credentialId Verifiable Credential Identifier
|
|
@@ -3014,12 +3024,12 @@ export declare class DefaultApi extends BaseAPI {
|
|
|
3014
3024
|
* @param {number} [limit] The number of items
|
|
3015
3025
|
* @param {string} [nextMarker] Marking the next set of items
|
|
3016
3026
|
* @param {Array<WalletNotificationEventType>} [type] Notification types
|
|
3017
|
-
* @param {
|
|
3027
|
+
* @param {ListSort} [sort] Sort flag controls the sort direction by the time created
|
|
3018
3028
|
* @param {*} [options] Override http request option.
|
|
3019
3029
|
* @throws {RequiredError}
|
|
3020
3030
|
* @memberof DefaultApi
|
|
3021
3031
|
*/
|
|
3022
|
-
walletNotificationHistory(walletId: string, limit?: number, nextMarker?: string, type?: Array<WalletNotificationEventType>, sort?:
|
|
3032
|
+
walletNotificationHistory(walletId: string, limit?: number, nextMarker?: string, type?: Array<WalletNotificationEventType>, sort?: ListSort, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<WalletNotificationHistory, any>>;
|
|
3023
3033
|
/**
|
|
3024
3034
|
* Provides first-in-first-out queue of notifications for a specific wallet.
|
|
3025
3035
|
* @param {string} walletId Wallet ID
|
|
@@ -3048,19 +3058,3 @@ export declare const CredentialListInteractionEnum: {
|
|
|
3048
3058
|
readonly TaoCredentials: "taoCredentials";
|
|
3049
3059
|
};
|
|
3050
3060
|
export type CredentialListInteractionEnum = typeof CredentialListInteractionEnum[keyof typeof CredentialListInteractionEnum];
|
|
3051
|
-
/**
|
|
3052
|
-
* @export
|
|
3053
|
-
*/
|
|
3054
|
-
export declare const CredentialListSortEnum: {
|
|
3055
|
-
readonly Asc: "asc";
|
|
3056
|
-
readonly Desc: "desc";
|
|
3057
|
-
};
|
|
3058
|
-
export type CredentialListSortEnum = typeof CredentialListSortEnum[keyof typeof CredentialListSortEnum];
|
|
3059
|
-
/**
|
|
3060
|
-
* @export
|
|
3061
|
-
*/
|
|
3062
|
-
export declare const WalletNotificationHistorySortEnum: {
|
|
3063
|
-
readonly Asc: "asc";
|
|
3064
|
-
readonly Desc: "desc";
|
|
3065
|
-
};
|
|
3066
|
-
export type WalletNotificationHistorySortEnum = typeof WalletNotificationHistorySortEnum[keyof typeof WalletNotificationHistorySortEnum];
|
package/api.js
CHANGED
|
@@ -25,7 +25,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.
|
|
28
|
+
exports.CredentialListInteractionEnum = exports.DefaultApi = exports.DefaultApiFactory = exports.DefaultApiFp = exports.DefaultApiAxiosParamCreator = exports.WalletNotificationEventType = exports.WalletConfigTrustFrameworkEnum = exports.WalletRoleEnum = exports.SystemImpactStatusEnum = exports.PresentationDefinitionSubmissionRequirementsRuleEnum = exports.PrepareToAccreditRequestTypeEnum = exports.ListSort = exports.InteractionAuthorizationRequirementsRequirementTypeEnum = exports.HealthStatusStatusEnum = exports.DeferredStatusEnum = exports.CredentialMetadataStatusEnum = exports.CredentialIssuerDefinitionCredentialIssuerEnum = exports.CredentialIssuerDefinitionCredentialFormatEnum = exports.AccreditationRequestTypeEnum = void 0;
|
|
29
29
|
const axios_1 = __importDefault(require("axios"));
|
|
30
30
|
// Some imports not used depending on template conditions
|
|
31
31
|
// @ts-ignore
|
|
@@ -64,6 +64,15 @@ exports.InteractionAuthorizationRequirementsRequirementTypeEnum = {
|
|
|
64
64
|
VpToken: 'vp_token',
|
|
65
65
|
Pin: 'pin'
|
|
66
66
|
};
|
|
67
|
+
/**
|
|
68
|
+
* Sort flag controls the sort direction by the time created
|
|
69
|
+
* @export
|
|
70
|
+
* @enum {string}
|
|
71
|
+
*/
|
|
72
|
+
exports.ListSort = {
|
|
73
|
+
Asc: 'asc',
|
|
74
|
+
Desc: 'desc'
|
|
75
|
+
};
|
|
67
76
|
exports.PrepareToAccreditRequestTypeEnum = {
|
|
68
77
|
TrustedIssuer: 'TrustedIssuer',
|
|
69
78
|
TrustedAccreditationOrganisation: 'TrustedAccreditationOrganisation'
|
|
@@ -286,7 +295,7 @@ const DefaultApiAxiosParamCreator = function (configuration) {
|
|
|
286
295
|
* @param {string} [type] The credential type as comma delimited list representing a single type. I.e. VerifiableCredential,VerifiableAttestation,Europass.
|
|
287
296
|
* @param {number} [limit] The number of items
|
|
288
297
|
* @param {string} [nextMarker] Marking the next set of items
|
|
289
|
-
* @param {
|
|
298
|
+
* @param {ListSort} [sort] Sort flag controls the sort direction by the time updated or issued
|
|
290
299
|
* @param {string} [path] JSON path specification for the filter to apply
|
|
291
300
|
* @param {string} [filter] JSON schema filter used to select the credentials (base64 encoded)
|
|
292
301
|
* @param {*} [options] Override http request option.
|
|
@@ -1504,7 +1513,7 @@ const DefaultApiAxiosParamCreator = function (configuration) {
|
|
|
1504
1513
|
* @param {number} [limit] The number of items
|
|
1505
1514
|
* @param {string} [nextMarker] Marking the next set of items
|
|
1506
1515
|
* @param {Array<WalletNotificationEventType>} [type] Notification types
|
|
1507
|
-
* @param {
|
|
1516
|
+
* @param {ListSort} [sort] Sort flag controls the sort direction by the time created
|
|
1508
1517
|
* @param {*} [options] Override http request option.
|
|
1509
1518
|
* @throws {RequiredError}
|
|
1510
1519
|
*/
|
|
@@ -1706,7 +1715,7 @@ const DefaultApiFp = function (configuration) {
|
|
|
1706
1715
|
* @param {string} [type] The credential type as comma delimited list representing a single type. I.e. VerifiableCredential,VerifiableAttestation,Europass.
|
|
1707
1716
|
* @param {number} [limit] The number of items
|
|
1708
1717
|
* @param {string} [nextMarker] Marking the next set of items
|
|
1709
|
-
* @param {
|
|
1718
|
+
* @param {ListSort} [sort] Sort flag controls the sort direction by the time updated or issued
|
|
1710
1719
|
* @param {string} [path] JSON path specification for the filter to apply
|
|
1711
1720
|
* @param {string} [filter] JSON schema filter used to select the credentials (base64 encoded)
|
|
1712
1721
|
* @param {*} [options] Override http request option.
|
|
@@ -2251,7 +2260,7 @@ const DefaultApiFp = function (configuration) {
|
|
|
2251
2260
|
* @param {number} [limit] The number of items
|
|
2252
2261
|
* @param {string} [nextMarker] Marking the next set of items
|
|
2253
2262
|
* @param {Array<WalletNotificationEventType>} [type] Notification types
|
|
2254
|
-
* @param {
|
|
2263
|
+
* @param {ListSort} [sort] Sort flag controls the sort direction by the time created
|
|
2255
2264
|
* @param {*} [options] Override http request option.
|
|
2256
2265
|
* @throws {RequiredError}
|
|
2257
2266
|
*/
|
|
@@ -2361,7 +2370,7 @@ const DefaultApiFactory = function (configuration, basePath, axios) {
|
|
|
2361
2370
|
* @param {string} [type] The credential type as comma delimited list representing a single type. I.e. VerifiableCredential,VerifiableAttestation,Europass.
|
|
2362
2371
|
* @param {number} [limit] The number of items
|
|
2363
2372
|
* @param {string} [nextMarker] Marking the next set of items
|
|
2364
|
-
* @param {
|
|
2373
|
+
* @param {ListSort} [sort] Sort flag controls the sort direction by the time updated or issued
|
|
2365
2374
|
* @param {string} [path] JSON path specification for the filter to apply
|
|
2366
2375
|
* @param {string} [filter] JSON schema filter used to select the credentials (base64 encoded)
|
|
2367
2376
|
* @param {*} [options] Override http request option.
|
|
@@ -2702,7 +2711,7 @@ const DefaultApiFactory = function (configuration, basePath, axios) {
|
|
|
2702
2711
|
* @param {number} [limit] The number of items
|
|
2703
2712
|
* @param {string} [nextMarker] Marking the next set of items
|
|
2704
2713
|
* @param {Array<WalletNotificationEventType>} [type] Notification types
|
|
2705
|
-
* @param {
|
|
2714
|
+
* @param {ListSort} [sort] Sort flag controls the sort direction by the time created
|
|
2706
2715
|
* @param {*} [options] Override http request option.
|
|
2707
2716
|
* @throws {RequiredError}
|
|
2708
2717
|
*/
|
|
@@ -2799,7 +2808,7 @@ class DefaultApi extends base_1.BaseAPI {
|
|
|
2799
2808
|
* @param {string} [type] The credential type as comma delimited list representing a single type. I.e. VerifiableCredential,VerifiableAttestation,Europass.
|
|
2800
2809
|
* @param {number} [limit] The number of items
|
|
2801
2810
|
* @param {string} [nextMarker] Marking the next set of items
|
|
2802
|
-
* @param {
|
|
2811
|
+
* @param {ListSort} [sort] Sort flag controls the sort direction by the time updated or issued
|
|
2803
2812
|
* @param {string} [path] JSON path specification for the filter to apply
|
|
2804
2813
|
* @param {string} [filter] JSON schema filter used to select the credentials (base64 encoded)
|
|
2805
2814
|
* @param {*} [options] Override http request option.
|
|
@@ -3174,7 +3183,7 @@ class DefaultApi extends base_1.BaseAPI {
|
|
|
3174
3183
|
* @param {number} [limit] The number of items
|
|
3175
3184
|
* @param {string} [nextMarker] Marking the next set of items
|
|
3176
3185
|
* @param {Array<WalletNotificationEventType>} [type] Notification types
|
|
3177
|
-
* @param {
|
|
3186
|
+
* @param {ListSort} [sort] Sort flag controls the sort direction by the time created
|
|
3178
3187
|
* @param {*} [options] Override http request option.
|
|
3179
3188
|
* @throws {RequiredError}
|
|
3180
3189
|
* @memberof DefaultApi
|
|
@@ -3214,17 +3223,3 @@ exports.CredentialListInteractionEnum = {
|
|
|
3214
3223
|
StatusList: 'statusList',
|
|
3215
3224
|
TaoCredentials: 'taoCredentials'
|
|
3216
3225
|
};
|
|
3217
|
-
/**
|
|
3218
|
-
* @export
|
|
3219
|
-
*/
|
|
3220
|
-
exports.CredentialListSortEnum = {
|
|
3221
|
-
Asc: 'asc',
|
|
3222
|
-
Desc: 'desc'
|
|
3223
|
-
};
|
|
3224
|
-
/**
|
|
3225
|
-
* @export
|
|
3226
|
-
*/
|
|
3227
|
-
exports.WalletNotificationHistorySortEnum = {
|
|
3228
|
-
Asc: 'asc',
|
|
3229
|
-
Desc: 'desc'
|
|
3230
|
-
};
|
package/auth.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function RequestToken(clientId: string, clientSecret: string): Promise<string>;
|
|
1
|
+
export declare function RequestToken(tokenUrl: string, audience: string, clientId: string, clientSecret: string): Promise<string>;
|
package/auth.js
CHANGED
|
@@ -14,11 +14,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.RequestToken = void 0;
|
|
16
16
|
const axios_1 = __importDefault(require("axios"));
|
|
17
|
-
|
|
18
|
-
function RequestToken(clientId, clientSecret) {
|
|
17
|
+
function RequestToken(tokenUrl, audience, clientId, clientSecret) {
|
|
19
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
const body = `{"client_id":"${clientId}","client_secret":"${clientSecret}","audience":"
|
|
21
|
-
const { data: { access_token } } = yield axios_1.default.post(`${
|
|
19
|
+
const body = `{"client_id":"${clientId}","client_secret":"${clientSecret}","audience":"${audience}","grant_type":"client_credentials"}`, headers = { 'content-type': 'application/json' };
|
|
20
|
+
const { data: { access_token } } = yield axios_1.default.post(`${tokenUrl}`, body, {
|
|
22
21
|
headers,
|
|
23
22
|
});
|
|
24
23
|
return access_token;
|
package/client.d.ts
CHANGED
|
@@ -13,5 +13,5 @@ export type ClientConfiguration = {
|
|
|
13
13
|
export declare class Client extends DefaultApi {
|
|
14
14
|
protected baseURL: string;
|
|
15
15
|
protected axios: AxiosInstance;
|
|
16
|
-
constructor(clientId: string, clientSecret: string, baseURL
|
|
16
|
+
constructor(tokenUrl: string, audience: string, clientId: string, clientSecret: string, baseURL: string, axios?: AxiosInstance);
|
|
17
17
|
}
|
package/client.js
CHANGED
|
@@ -14,9 +14,9 @@ const auth_1 = require("./auth");
|
|
|
14
14
|
* @extends {DefaultApi}
|
|
15
15
|
*/
|
|
16
16
|
class Client extends api_1.DefaultApi {
|
|
17
|
-
constructor(clientId, clientSecret, baseURL
|
|
17
|
+
constructor(tokenUrl, audience, clientId, clientSecret, baseURL, axios = axios_1.default) {
|
|
18
18
|
super({
|
|
19
|
-
accessToken: (0, auth_1.RequestToken)(clientId, clientSecret),
|
|
19
|
+
accessToken: (0, auth_1.RequestToken)(tokenUrl, audience, clientId, clientSecret),
|
|
20
20
|
basePath: baseURL,
|
|
21
21
|
isJsonMime,
|
|
22
22
|
}, baseURL, axios);
|