wallaby-cash 1.5.0 → 1.5.2
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/dist/index.cjs.js +3 -23
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +3 -22
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3 -22
- package/dist/index.js.map +1 -1
- package/dist/lib/utils/index.d.ts +0 -14
- package/dist/types/base.d.ts +1 -1
- package/package.json +1 -3
package/dist/index.cjs.js
CHANGED
|
@@ -6,12 +6,10 @@ const ethCryptoJs = require('eth-crypto-js');
|
|
|
6
6
|
const axios = require('axios');
|
|
7
7
|
const cryptoJs = require('crypto-js');
|
|
8
8
|
const uuid = require('uuid');
|
|
9
|
-
const jwt = require('jsonwebtoken');
|
|
10
9
|
|
|
11
10
|
const _interopDefaultCompat = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
|
12
11
|
|
|
13
12
|
const axios__default = /*#__PURE__*/_interopDefaultCompat(axios);
|
|
14
|
-
const jwt__default = /*#__PURE__*/_interopDefaultCompat(jwt);
|
|
15
13
|
|
|
16
14
|
/******************************************************************************
|
|
17
15
|
Copyright (c) Microsoft Corporation.
|
|
@@ -4931,11 +4929,12 @@ var StorageService = /** @class */ (function () {
|
|
|
4931
4929
|
|
|
4932
4930
|
var Base = /** @class */ (function () {
|
|
4933
4931
|
function Base(config) {
|
|
4932
|
+
var _a;
|
|
4934
4933
|
this.apiKey = config.apiKey;
|
|
4935
4934
|
this.baseUrl = config.baseUrl;
|
|
4936
4935
|
this.userId = config.userId;
|
|
4937
4936
|
this.jwt = config.jwt;
|
|
4938
|
-
this.clientAuthToken = config.clientAuthToken;
|
|
4937
|
+
this.clientAuthToken = (_a = config.clientAuthToken) !== null && _a !== void 0 ? _a : config.jwt;
|
|
4939
4938
|
this.options = config.options;
|
|
4940
4939
|
}
|
|
4941
4940
|
Object.defineProperty(Base.prototype, "deviceStorage", {
|
|
@@ -6310,6 +6309,7 @@ var Wallet = /** @class */ (function (_super) {
|
|
|
6310
6309
|
return Wallet;
|
|
6311
6310
|
}(Base));
|
|
6312
6311
|
|
|
6312
|
+
// import jwt, { SignOptions } from 'jsonwebtoken';
|
|
6313
6313
|
var Utils = /** @class */ (function (_super) {
|
|
6314
6314
|
__extends(Utils, _super);
|
|
6315
6315
|
function Utils(config) {
|
|
@@ -6497,26 +6497,6 @@ var Utils = /** @class */ (function (_super) {
|
|
|
6497
6497
|
});
|
|
6498
6498
|
});
|
|
6499
6499
|
};
|
|
6500
|
-
/**
|
|
6501
|
-
* Generates a JWT token for a client using the RS256 algorithm.
|
|
6502
|
-
*
|
|
6503
|
-
* @param {string} externalUserId - The external user ID to be included in the JWT payload. (Must be a UUID)
|
|
6504
|
-
* @param {string} jwtSigningKey - The RS256 private key used for signing the JWT.
|
|
6505
|
-
* @param {string} expiresIn - The duration for which the token is valid.
|
|
6506
|
-
* If not provided, the token will be valid indefinitely.
|
|
6507
|
-
* @returns {string} The generated JWT token.
|
|
6508
|
-
*/
|
|
6509
|
-
Utils.prototype.generateClientJwtToken = function (_a) {
|
|
6510
|
-
var externalUserId = _a.externalUserId, jwtSigningKey = _a.jwtSigningKey, expiresIn = _a.expiresIn;
|
|
6511
|
-
var options = {
|
|
6512
|
-
algorithm: 'RS256',
|
|
6513
|
-
};
|
|
6514
|
-
if (expiresIn) {
|
|
6515
|
-
options.expiresIn = expiresIn;
|
|
6516
|
-
}
|
|
6517
|
-
var jwtToken = jwt__default.default.sign({ sub: externalUserId, externalUserId: externalUserId }, jwtSigningKey, options);
|
|
6518
|
-
return jwtToken;
|
|
6519
|
-
};
|
|
6520
6500
|
return Utils;
|
|
6521
6501
|
}(Base));
|
|
6522
6502
|
|