@triveria/wallet 0.0.154 → 0.0.155

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/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
- const baseURL = process.env.AUTH_BASE_URL || "https://dev-f64e1ekbjnqzle8o.eu.auth0.com";
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":"https://wallet.dev.triveria.io","grant_type":"client_credentials"}`, headers = { 'content-type': 'application/json' };
21
- const { data: { access_token } } = yield axios_1.default.post(`${baseURL}/oauth/token`, body, {
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?: string, axios?: AxiosInstance);
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 = "https://wallet.dev.triveria.io/api/v1", axios = axios_1.default) {
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);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@triveria/wallet",
3
3
  "private": false,
4
- "version": "0.0.154",
4
+ "version": "0.0.155",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "scripts": {