@ttoss/oauth-client 0.4.4 → 0.5.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/dist/index.cjs +2 -2
- package/dist/index.d.cts +3 -4
- package/dist/index.d.mts +3 -4
- package/dist/index.mjs +2 -2
- package/dist/providers/index.cjs +1 -1
- package/dist/providers/index.mjs +1 -1
- package/dist/{providers-FHRUbQH_.cjs → providers-BzzfFAl4.cjs} +4 -4
- package/dist/{providers-Cxs2-TSE.mjs → providers-CVenkRvO.mjs} +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
3
3
|
value: 'Module'
|
|
4
4
|
});
|
|
5
|
-
const require_providers = require(
|
|
5
|
+
const require_providers = require("./providers-BzzfFAl4.cjs");
|
|
6
6
|
|
|
7
7
|
//#region src/tokens.ts
|
|
8
8
|
/** Default scheduled-refresh window: 6 hours. */
|
|
9
|
-
var DEFAULT_EXPIRING_WINDOW_MS =
|
|
9
|
+
var DEFAULT_EXPIRING_WINDOW_MS = 216e5;
|
|
10
10
|
/**
|
|
11
11
|
* Filter a list of token records down to those that expire within `windowMs`
|
|
12
12
|
* from now (default 6 hours). Intended for a scheduled job that proactively
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import { a as ExchangeCodeOptions, c as createOAuthClient, d as TokenRecord, f as TokenResponse, i as DEFAULT_REFRESH_WINDOW_MS, l as OAuthProvider, n as createTikTokClient, o as GetValidTokenOptions, p as TokenResponseParser, r as BuildAuthUrlOptions, s as OAuthClient, t as TikTokClientOptions, u as ProviderParamOverrides } from "./index-BgPLLjdP.cjs";
|
|
3
|
-
|
|
4
3
|
//#region src/tokens.d.ts
|
|
5
4
|
/** Default scheduled-refresh window: 6 hours. */
|
|
6
|
-
declare const DEFAULT_EXPIRING_WINDOW_MS: number;
|
|
5
|
+
export declare const DEFAULT_EXPIRING_WINDOW_MS: number;
|
|
7
6
|
/** Options for {@link findExpiringTokens}. */
|
|
8
7
|
interface FindExpiringTokensOptions {
|
|
9
8
|
/** Include records expiring within this window from now. Default: 6h. */
|
|
@@ -15,6 +14,6 @@ interface FindExpiringTokensOptions {
|
|
|
15
14
|
* refreshes tokens before they lapse, keeping connections alive for inactive
|
|
16
15
|
* users. Pure and provider-agnostic — it inspects only `accessTokenExpiresAt`.
|
|
17
16
|
*/
|
|
18
|
-
declare const findExpiringTokens: <T extends TokenRecord>(records: T[], options?: FindExpiringTokensOptions) => T[];
|
|
17
|
+
export declare const findExpiringTokens: <T extends TokenRecord>(records: T[], options?: FindExpiringTokensOptions) => T[];
|
|
19
18
|
//#endregion
|
|
20
|
-
export { type BuildAuthUrlOptions,
|
|
19
|
+
export { type BuildAuthUrlOptions, DEFAULT_REFRESH_WINDOW_MS, type ExchangeCodeOptions, type FindExpiringTokensOptions, type GetValidTokenOptions, type OAuthClient, type OAuthProvider, type ProviderParamOverrides, type TikTokClientOptions, type TokenRecord, type TokenResponse, type TokenResponseParser, createOAuthClient, createTikTokClient };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import { a as ExchangeCodeOptions, c as createOAuthClient, d as TokenRecord, f as TokenResponse, i as DEFAULT_REFRESH_WINDOW_MS, l as OAuthProvider, n as createTikTokClient, o as GetValidTokenOptions, p as TokenResponseParser, r as BuildAuthUrlOptions, s as OAuthClient, t as TikTokClientOptions, u as ProviderParamOverrides } from "./index-BgPLLjdP.mjs";
|
|
3
|
-
|
|
4
3
|
//#region src/tokens.d.ts
|
|
5
4
|
/** Default scheduled-refresh window: 6 hours. */
|
|
6
|
-
declare const DEFAULT_EXPIRING_WINDOW_MS: number;
|
|
5
|
+
export declare const DEFAULT_EXPIRING_WINDOW_MS: number;
|
|
7
6
|
/** Options for {@link findExpiringTokens}. */
|
|
8
7
|
interface FindExpiringTokensOptions {
|
|
9
8
|
/** Include records expiring within this window from now. Default: 6h. */
|
|
@@ -15,6 +14,6 @@ interface FindExpiringTokensOptions {
|
|
|
15
14
|
* refreshes tokens before they lapse, keeping connections alive for inactive
|
|
16
15
|
* users. Pure and provider-agnostic — it inspects only `accessTokenExpiresAt`.
|
|
17
16
|
*/
|
|
18
|
-
declare const findExpiringTokens: <T extends TokenRecord>(records: T[], options?: FindExpiringTokensOptions) => T[];
|
|
17
|
+
export declare const findExpiringTokens: <T extends TokenRecord>(records: T[], options?: FindExpiringTokensOptions) => T[];
|
|
19
18
|
//#endregion
|
|
20
|
-
export { type BuildAuthUrlOptions,
|
|
19
|
+
export { type BuildAuthUrlOptions, DEFAULT_REFRESH_WINDOW_MS, type ExchangeCodeOptions, type FindExpiringTokensOptions, type GetValidTokenOptions, type OAuthClient, type OAuthProvider, type ProviderParamOverrides, type TikTokClientOptions, type TokenRecord, type TokenResponse, type TokenResponseParser, createOAuthClient, createTikTokClient };
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
-
import { n as DEFAULT_REFRESH_WINDOW_MS, r as createOAuthClient, t as createTikTokClient } from "./providers-
|
|
2
|
+
import { n as DEFAULT_REFRESH_WINDOW_MS, r as createOAuthClient, t as createTikTokClient } from "./providers-CVenkRvO.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/tokens.ts
|
|
5
5
|
/** Default scheduled-refresh window: 6 hours. */
|
|
6
|
-
var DEFAULT_EXPIRING_WINDOW_MS =
|
|
6
|
+
var DEFAULT_EXPIRING_WINDOW_MS = 216e5;
|
|
7
7
|
/**
|
|
8
8
|
* Filter a list of token records down to those that expire within `windowMs`
|
|
9
9
|
* from now (default 6 hours). Intended for a scheduled job that proactively
|
package/dist/providers/index.cjs
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
3
3
|
value: 'Module'
|
|
4
4
|
});
|
|
5
|
-
const require_providers = require(
|
|
5
|
+
const require_providers = require("../providers-BzzfFAl4.cjs");
|
|
6
6
|
exports.createTikTokClient = require_providers.createTikTokClient;
|
package/dist/providers/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
2
|
//#region src/client.ts
|
|
3
3
|
/** Default safety window for lazy refresh: 2 hours. */
|
|
4
|
-
var DEFAULT_REFRESH_WINDOW_MS =
|
|
4
|
+
var DEFAULT_REFRESH_WINDOW_MS = 72e5;
|
|
5
5
|
var defaultParseTokenResponse = raw => {
|
|
6
6
|
return {
|
|
7
7
|
accessToken: String(raw.access_token),
|
|
@@ -104,19 +104,19 @@ var createTikTokClient = options => {
|
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
//#endregion
|
|
107
|
-
Object.defineProperty(exports,
|
|
107
|
+
Object.defineProperty(exports, "DEFAULT_REFRESH_WINDOW_MS", {
|
|
108
108
|
enumerable: true,
|
|
109
109
|
get: function () {
|
|
110
110
|
return DEFAULT_REFRESH_WINDOW_MS;
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
|
-
Object.defineProperty(exports,
|
|
113
|
+
Object.defineProperty(exports, "createOAuthClient", {
|
|
114
114
|
enumerable: true,
|
|
115
115
|
get: function () {
|
|
116
116
|
return createOAuthClient;
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
|
-
Object.defineProperty(exports,
|
|
119
|
+
Object.defineProperty(exports, "createTikTokClient", {
|
|
120
120
|
enumerable: true,
|
|
121
121
|
get: function () {
|
|
122
122
|
return createTikTokClient;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
2
|
//#region src/client.ts
|
|
3
3
|
/** Default safety window for lazy refresh: 2 hours. */
|
|
4
|
-
var DEFAULT_REFRESH_WINDOW_MS =
|
|
4
|
+
var DEFAULT_REFRESH_WINDOW_MS = 72e5;
|
|
5
5
|
var defaultParseTokenResponse = raw => {
|
|
6
6
|
return {
|
|
7
7
|
accessToken: String(raw.access_token),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/oauth-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Reusable third-party OAuth 2.0 client for ttoss — authorization, code exchange, lazy and scheduled token refresh",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"auth",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"jest": "^30.
|
|
41
|
-
"tsdown": "^0.
|
|
42
|
-
"@ttoss/
|
|
43
|
-
"@ttoss/
|
|
40
|
+
"jest": "^30.5.2",
|
|
41
|
+
"tsdown": "^0.23.1",
|
|
42
|
+
"@ttoss/config": "^3.0.0",
|
|
43
|
+
"@ttoss/auth-core": "^0.20.0"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public",
|