@topolo/sdk 0.9.0 → 0.9.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.
|
@@ -393,9 +393,9 @@ async function refreshCredentialIfNeeded(environment = selectedEnvironment(), op
|
|
|
393
393
|
const profile = profileForEnvironment(config, environment);
|
|
394
394
|
const cred = profile.credential;
|
|
395
395
|
if (!cred || cred.kind !== "access_token") return cred ?? null;
|
|
396
|
-
if (!cred.refreshToken || !
|
|
396
|
+
if (!cred.refreshToken || !profile.oauthClientId) return cred;
|
|
397
397
|
const now = Math.floor(Date.now() / 1e3);
|
|
398
|
-
if (!options.force && cred.expiresAt - REFRESH_SKEW_SECONDS > now) return cred;
|
|
398
|
+
if (!options.force && cred.expiresAt && cred.expiresAt - REFRESH_SKEW_SECONDS > now) return cred;
|
|
399
399
|
try {
|
|
400
400
|
const oauth = new TopoloOAuth({
|
|
401
401
|
serviceUrls: resolveServiceUrls(profile.serviceUrls, environment)
|
|
@@ -436,9 +436,9 @@ async function refreshContextCredentialIfNeeded(environment, key, options = {})
|
|
|
436
436
|
const credential = context?.credential;
|
|
437
437
|
if (!credential || credential.kind !== "access_token") return credential ?? null;
|
|
438
438
|
const oauthClientId = context.oauthClientId ?? profile.oauthClientId;
|
|
439
|
-
if (!credential.refreshToken || !
|
|
439
|
+
if (!credential.refreshToken || !oauthClientId) return credential;
|
|
440
440
|
const now = Math.floor(Date.now() / 1e3);
|
|
441
|
-
if (!options.force && credential.expiresAt - REFRESH_SKEW_SECONDS > now) return credential;
|
|
441
|
+
if (!options.force && credential.expiresAt && credential.expiresAt - REFRESH_SKEW_SECONDS > now) return credential;
|
|
442
442
|
try {
|
|
443
443
|
const oauth = new TopoloOAuth({
|
|
444
444
|
serviceUrls: resolveServiceUrls(profile.serviceUrls, environment)
|
|
@@ -349,9 +349,9 @@ async function refreshCredentialIfNeeded(environment = selectedEnvironment(), op
|
|
|
349
349
|
const profile = profileForEnvironment(config, environment);
|
|
350
350
|
const cred = profile.credential;
|
|
351
351
|
if (!cred || cred.kind !== "access_token") return cred ?? null;
|
|
352
|
-
if (!cred.refreshToken || !
|
|
352
|
+
if (!cred.refreshToken || !profile.oauthClientId) return cred;
|
|
353
353
|
const now = Math.floor(Date.now() / 1e3);
|
|
354
|
-
if (!options.force && cred.expiresAt - REFRESH_SKEW_SECONDS > now) return cred;
|
|
354
|
+
if (!options.force && cred.expiresAt && cred.expiresAt - REFRESH_SKEW_SECONDS > now) return cred;
|
|
355
355
|
try {
|
|
356
356
|
const oauth = new TopoloOAuth({
|
|
357
357
|
serviceUrls: resolveServiceUrls(profile.serviceUrls, environment)
|
|
@@ -392,9 +392,9 @@ async function refreshContextCredentialIfNeeded(environment, key, options = {})
|
|
|
392
392
|
const credential = context?.credential;
|
|
393
393
|
if (!credential || credential.kind !== "access_token") return credential ?? null;
|
|
394
394
|
const oauthClientId = context.oauthClientId ?? profile.oauthClientId;
|
|
395
|
-
if (!credential.refreshToken || !
|
|
395
|
+
if (!credential.refreshToken || !oauthClientId) return credential;
|
|
396
396
|
const now = Math.floor(Date.now() / 1e3);
|
|
397
|
-
if (!options.force && credential.expiresAt - REFRESH_SKEW_SECONDS > now) return credential;
|
|
397
|
+
if (!options.force && credential.expiresAt && credential.expiresAt - REFRESH_SKEW_SECONDS > now) return credential;
|
|
398
398
|
try {
|
|
399
399
|
const oauth = new TopoloOAuth({
|
|
400
400
|
serviceUrls: resolveServiceUrls(profile.serviceUrls, environment)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topolo/sdk",
|
|
3
|
-
"version": "0.9.
|
|
4
|
-
"topoloPublishedVersion": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
|
+
"topoloPublishedVersion": "0.9.1",
|
|
5
5
|
"description": "Typed client SDK for the Topolo platform. Used by TopoloCli, TopoloMCP, and third-party agents.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|