@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 CHANGED
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, {
3
3
  value: 'Module'
4
4
  });
5
- const require_providers = require('./providers-FHRUbQH_.cjs');
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 = 360 * 60 * 1e3;
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, DEFAULT_EXPIRING_WINDOW_MS, 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, findExpiringTokens };
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, DEFAULT_EXPIRING_WINDOW_MS, 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, findExpiringTokens };
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-Cxs2-TSE.mjs";
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 = 360 * 60 * 1e3;
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
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, {
3
3
  value: 'Module'
4
4
  });
5
- const require_providers = require('../providers-FHRUbQH_.cjs');
5
+ const require_providers = require("../providers-BzzfFAl4.cjs");
6
6
  exports.createTikTokClient = require_providers.createTikTokClient;
@@ -1,3 +1,3 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
- import { t as createTikTokClient } from "../providers-Cxs2-TSE.mjs";
2
+ import { t as createTikTokClient } from "../providers-CVenkRvO.mjs";
3
3
  export { 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 = 7200 * 1e3;
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, 'DEFAULT_REFRESH_WINDOW_MS', {
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, 'createOAuthClient', {
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, 'createTikTokClient', {
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 = 7200 * 1e3;
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.4.4",
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.4.2",
41
- "tsdown": "^0.22.2",
42
- "@ttoss/auth-core": "^0.18.0",
43
- "@ttoss/config": "^1.41.0"
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",