@dereekb/calcom 13.9.0 → 13.10.1
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/index.cjs.js +3 -2
- package/index.esm.js +3 -2
- package/nestjs/index.cjs.js +4 -2
- package/nestjs/index.esm.js +4 -2
- package/nestjs/package.json +9 -9
- package/nestjs/src/lib/oauth/oauth.service.d.ts +3 -1
- package/package.json +9 -9
package/index.cjs.js
CHANGED
|
@@ -94,6 +94,7 @@ function _inherits$1(subClass, superClass) {
|
|
|
94
94
|
if (superClass) _set_prototype_of$1(subClass, superClass);
|
|
95
95
|
}
|
|
96
96
|
function _instanceof(left, right) {
|
|
97
|
+
"@swc/helpers - instanceof";
|
|
97
98
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
98
99
|
return !!right[Symbol.hasInstance](left);
|
|
99
100
|
} else {
|
|
@@ -2028,7 +2029,7 @@ function _ts_generator(thisArg, body) {
|
|
|
2028
2029
|
} : _factoryConfig_fetchFactory;
|
|
2029
2030
|
return function(config) {
|
|
2030
2031
|
var accessTokenFromTokenResponse = function accessTokenFromTokenResponse(result) {
|
|
2031
|
-
var createdAt =
|
|
2032
|
+
var createdAt = Date.now();
|
|
2032
2033
|
var access_token = result.access_token, refresh_token = result.refresh_token, scope = result.scope, expires_in = result.expires_in;
|
|
2033
2034
|
// Store the new refresh token for next use
|
|
2034
2035
|
latestRefreshToken = refresh_token;
|
|
@@ -2199,7 +2200,7 @@ function _ts_generator(thisArg, body) {
|
|
|
2199
2200
|
case 2:
|
|
2200
2201
|
// check expiration
|
|
2201
2202
|
if (currentToken != null) {
|
|
2202
|
-
isExpired =
|
|
2203
|
+
isExpired = Date.now() + tokenExpirationBuffer >= currentToken.expiresAt.getTime();
|
|
2203
2204
|
if (isExpired) {
|
|
2204
2205
|
currentToken = null;
|
|
2205
2206
|
}
|
package/index.esm.js
CHANGED
|
@@ -92,6 +92,7 @@ function _inherits$1(subClass, superClass) {
|
|
|
92
92
|
if (superClass) _set_prototype_of$1(subClass, superClass);
|
|
93
93
|
}
|
|
94
94
|
function _instanceof(left, right) {
|
|
95
|
+
"@swc/helpers - instanceof";
|
|
95
96
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
96
97
|
return !!right[Symbol.hasInstance](left);
|
|
97
98
|
} else {
|
|
@@ -2026,7 +2027,7 @@ function _ts_generator(thisArg, body) {
|
|
|
2026
2027
|
} : _factoryConfig_fetchFactory;
|
|
2027
2028
|
return function(config) {
|
|
2028
2029
|
var accessTokenFromTokenResponse = function accessTokenFromTokenResponse(result) {
|
|
2029
|
-
var createdAt =
|
|
2030
|
+
var createdAt = Date.now();
|
|
2030
2031
|
var access_token = result.access_token, refresh_token = result.refresh_token, scope = result.scope, expires_in = result.expires_in;
|
|
2031
2032
|
// Store the new refresh token for next use
|
|
2032
2033
|
latestRefreshToken = refresh_token;
|
|
@@ -2197,7 +2198,7 @@ function _ts_generator(thisArg, body) {
|
|
|
2197
2198
|
case 2:
|
|
2198
2199
|
// check expiration
|
|
2199
2200
|
if (currentToken != null) {
|
|
2200
|
-
isExpired =
|
|
2201
|
+
isExpired = Date.now() + tokenExpirationBuffer >= currentToken.expiresAt.getTime();
|
|
2201
2202
|
if (isExpired) {
|
|
2202
2203
|
currentToken = null;
|
|
2203
2204
|
}
|
package/nestjs/index.cjs.js
CHANGED
|
@@ -317,12 +317,14 @@ exports.CalcomOAuthAccessTokenCacheService = __decorate([
|
|
|
317
317
|
common.Injectable()
|
|
318
318
|
], exports.CalcomOAuthAccessTokenCacheService);
|
|
319
319
|
/**
|
|
320
|
-
* Derives a short, filesystem-safe cache key from a refresh token
|
|
320
|
+
* Derives a short, filesystem-safe cache key from a refresh token.
|
|
321
|
+
*
|
|
322
|
+
* Uses SHA-256 truncated to 16 hex chars; the goal is fingerprinting, not security.
|
|
321
323
|
*
|
|
322
324
|
* @param refreshToken - the OAuth refresh token to hash
|
|
323
325
|
* @returns a 16-character hex string suitable for use as a cache key
|
|
324
326
|
*/ function calcomRefreshTokenCacheKey(refreshToken) {
|
|
325
|
-
return node_crypto.createHash('
|
|
327
|
+
return node_crypto.createHash('sha256').update(refreshToken).digest('hex').substring(0, 16);
|
|
326
328
|
}
|
|
327
329
|
/**
|
|
328
330
|
* Default error logging function for {@link mergeCalcomOAuthAccessTokenCacheServices}.
|
package/nestjs/index.esm.js
CHANGED
|
@@ -315,12 +315,14 @@ CalcomOAuthAccessTokenCacheService = __decorate([
|
|
|
315
315
|
Injectable()
|
|
316
316
|
], CalcomOAuthAccessTokenCacheService);
|
|
317
317
|
/**
|
|
318
|
-
* Derives a short, filesystem-safe cache key from a refresh token
|
|
318
|
+
* Derives a short, filesystem-safe cache key from a refresh token.
|
|
319
|
+
*
|
|
320
|
+
* Uses SHA-256 truncated to 16 hex chars; the goal is fingerprinting, not security.
|
|
319
321
|
*
|
|
320
322
|
* @param refreshToken - the OAuth refresh token to hash
|
|
321
323
|
* @returns a 16-character hex string suitable for use as a cache key
|
|
322
324
|
*/ function calcomRefreshTokenCacheKey(refreshToken) {
|
|
323
|
-
return createHash('
|
|
325
|
+
return createHash('sha256').update(refreshToken).digest('hex').substring(0, 16);
|
|
324
326
|
}
|
|
325
327
|
/**
|
|
326
328
|
* Default error logging function for {@link mergeCalcomOAuthAccessTokenCacheServices}.
|
package/nestjs/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/calcom/nestjs",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.10.1",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@dereekb/nestjs": "13.
|
|
6
|
-
"@dereekb/rxjs": "13.
|
|
7
|
-
"@dereekb/util": "13.
|
|
8
|
-
"@dereekb/calcom": "13.
|
|
9
|
-
"@nestjs/common": "^11.1.
|
|
5
|
+
"@dereekb/nestjs": "13.10.1",
|
|
6
|
+
"@dereekb/rxjs": "13.10.1",
|
|
7
|
+
"@dereekb/util": "13.10.1",
|
|
8
|
+
"@dereekb/calcom": "13.10.1",
|
|
9
|
+
"@nestjs/common": "^11.1.19",
|
|
10
10
|
"@nestjs/config": "^4.0.4",
|
|
11
|
-
"express": "^5.
|
|
11
|
+
"express": "^5.2.1"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@nestjs/testing": "^11.1.
|
|
15
|
-
"date-fns": "^4.
|
|
14
|
+
"@nestjs/testing": "^11.1.19",
|
|
15
|
+
"date-fns": "^4.1.0"
|
|
16
16
|
},
|
|
17
17
|
"exports": {
|
|
18
18
|
"./package.json": "./package.json",
|
|
@@ -23,7 +23,9 @@ export declare abstract class CalcomOAuthAccessTokenCacheService {
|
|
|
23
23
|
}
|
|
24
24
|
export type CalcomOAuthAccessTokenCacheServiceWithRefreshToken = Required<CalcomOAuthAccessTokenCacheService>;
|
|
25
25
|
/**
|
|
26
|
-
* Derives a short, filesystem-safe cache key from a refresh token
|
|
26
|
+
* Derives a short, filesystem-safe cache key from a refresh token.
|
|
27
|
+
*
|
|
28
|
+
* Uses SHA-256 truncated to 16 hex chars; the goal is fingerprinting, not security.
|
|
27
29
|
*
|
|
28
30
|
* @param refreshToken - the OAuth refresh token to hash
|
|
29
31
|
* @returns a 16-character hex string suitable for use as a cache key
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/calcom",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.10.1",
|
|
4
4
|
"exports": {
|
|
5
5
|
"./nestjs": {
|
|
6
6
|
"module": "./nestjs/index.esm.js",
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@dereekb/nestjs": "13.
|
|
21
|
-
"@dereekb/rxjs": "13.
|
|
22
|
-
"@dereekb/util": "13.
|
|
23
|
-
"@nestjs/common": "^11.1.
|
|
20
|
+
"@dereekb/nestjs": "13.10.1",
|
|
21
|
+
"@dereekb/rxjs": "13.10.1",
|
|
22
|
+
"@dereekb/util": "13.10.1",
|
|
23
|
+
"@nestjs/common": "^11.1.19",
|
|
24
24
|
"@nestjs/config": "^4.0.4",
|
|
25
|
-
"express": "^5.
|
|
26
|
-
"make-error": "^1.3.
|
|
25
|
+
"express": "^5.2.1",
|
|
26
|
+
"make-error": "^1.3.6"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@nestjs/testing": "^11.1.
|
|
30
|
-
"date-fns": "^4.
|
|
29
|
+
"@nestjs/testing": "^11.1.19",
|
|
30
|
+
"date-fns": "^4.1.0"
|
|
31
31
|
},
|
|
32
32
|
"module": "./index.esm.js",
|
|
33
33
|
"main": "./index.cjs.js",
|