@opentabs-dev/opentabs-plugin-temporal-cloud 0.0.85 → 0.0.86
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/adapter.iife.js +17 -19
- package/dist/adapter.iife.js.map +3 -3
- package/dist/temporal-api.d.ts.map +1 -1
- package/dist/temporal-api.js +12 -17
- package/dist/temporal-api.js.map +1 -1
- package/package.json +1 -1
package/dist/adapter.iife.js
CHANGED
|
@@ -461,28 +461,23 @@
|
|
|
461
461
|
try {
|
|
462
462
|
const data = JSON.parse(entry.value);
|
|
463
463
|
if (!data.body?.access_token) return null;
|
|
464
|
-
if (data.expiresAt && data.expiresAt
|
|
464
|
+
if (data.expiresAt && data.expiresAt < Math.floor(Date.now() / 1e3)) return null;
|
|
465
465
|
return data.body.access_token;
|
|
466
466
|
} catch {
|
|
467
467
|
return null;
|
|
468
468
|
}
|
|
469
469
|
};
|
|
470
470
|
var getAuth = () => {
|
|
471
|
-
const
|
|
472
|
-
if (
|
|
473
|
-
const
|
|
474
|
-
if (
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
const token = getToken();
|
|
482
|
-
if (!token) return null;
|
|
483
|
-
const auth = { token };
|
|
484
|
-
setAuthCache("temporal-cloud", auth);
|
|
485
|
-
return auth;
|
|
471
|
+
const freshToken = getToken();
|
|
472
|
+
if (freshToken) {
|
|
473
|
+
const cached2 = getAuthCache("temporal-cloud");
|
|
474
|
+
if (cached2?.token === freshToken) return cached2;
|
|
475
|
+
const auth = { token: freshToken };
|
|
476
|
+
setAuthCache("temporal-cloud", auth);
|
|
477
|
+
return auth;
|
|
478
|
+
}
|
|
479
|
+
clearAuthCache("temporal-cloud");
|
|
480
|
+
return null;
|
|
486
481
|
};
|
|
487
482
|
var isAuthenticated = () => getAuth() !== null;
|
|
488
483
|
var waitForAuth = async () => {
|
|
@@ -511,7 +506,10 @@
|
|
|
511
506
|
};
|
|
512
507
|
var api = async (namespace, path, query) => {
|
|
513
508
|
const auth = getAuth();
|
|
514
|
-
if (!auth)
|
|
509
|
+
if (!auth)
|
|
510
|
+
throw ToolError.auth(
|
|
511
|
+
"Not authenticated \u2014 token may have expired. Please refresh the Temporal Cloud page to obtain a new token."
|
|
512
|
+
);
|
|
515
513
|
const baseUrl = `https://${namespace}.web.tmprl.cloud/api/v1`;
|
|
516
514
|
const qs = query ? buildQueryString(query) : "";
|
|
517
515
|
const url2 = qs ? `${baseUrl}${path}?${qs}` : `${baseUrl}${path}`;
|
|
@@ -15525,7 +15523,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15525
15523
|
};
|
|
15526
15524
|
var src_default = new TemporalCloudPlugin();
|
|
15527
15525
|
|
|
15528
|
-
// dist/
|
|
15526
|
+
// dist/_adapter_entry_0c6a0673-2322-4bed-b353-8d49a2b5906c.ts
|
|
15529
15527
|
if (!globalThis.__openTabs) {
|
|
15530
15528
|
globalThis.__openTabs = {};
|
|
15531
15529
|
} else {
|
|
@@ -15743,5 +15741,5 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15743
15741
|
};
|
|
15744
15742
|
delete src_default.onDeactivate;
|
|
15745
15743
|
}
|
|
15746
|
-
})();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["temporal-cloud"]){var a=o.adapters["temporal-cloud"];a.__adapterHash="
|
|
15744
|
+
})();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["temporal-cloud"]){var a=o.adapters["temporal-cloud"];a.__adapterHash="df7f03ddc4b9cf247dbd1d46b690baa7e6b5f90e3d043b712133704416b773bc";if(a.tools&&Array.isArray(a.tools)){for(var i=0;i<a.tools.length;i++){Object.freeze(a.tools[i]);}Object.freeze(a.tools);}Object.freeze(a);Object.defineProperty(o.adapters,"temporal-cloud",{value:a,writable:false,configurable:false,enumerable:true});Object.defineProperty(o,"adapters",{value:o.adapters,writable:false,configurable:false});}})();
|
|
15747
15745
|
//# sourceMappingURL=adapter.iife.js.map
|