@tempoxyz/id 0.0.0-pr-755.sha-1c7edcc → 0.0.0-pr-740.sha-e82a463

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.
@@ -4,9 +4,9 @@ import {
4
4
  name,
5
5
  parseName,
6
6
  pending
7
- } from "./chunk-ZCIJ7FF2.js";
7
+ } from "./chunk-CMIMUIV7.js";
8
8
  import "./chunk-HWONYWNC.js";
9
- import "./chunk-BZRQBSX2.js";
9
+ import "./chunk-UGIWBXMZ.js";
10
10
  import "./chunk-MLKGABMK.js";
11
11
  export {
12
12
  attach,
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  PendingNotFoundError,
7
7
  RequestError
8
- } from "./chunk-BZRQBSX2.js";
8
+ } from "./chunk-UGIWBXMZ.js";
9
9
  import "./chunk-MLKGABMK.js";
10
10
 
11
11
  // ../../accounts/src/internal/BackendCookie.ts
@@ -4,8 +4,8 @@ import {
4
4
  machines,
5
5
  prompt,
6
6
  waiting
7
- } from "./chunk-U6LTO7G5.js";
8
- import "./chunk-BZRQBSX2.js";
7
+ } from "./chunk-S3QDABXG.js";
8
+ import "./chunk-UGIWBXMZ.js";
9
9
  import "./chunk-MLKGABMK.js";
10
10
  export {
11
11
  create,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  dialog_exports,
3
3
  redirect_exports
4
- } from "./chunk-MIPJIEVS.js";
4
+ } from "./chunk-YXEQ42DK.js";
5
5
  import {
6
6
  connections_exports
7
- } from "./chunk-ZCIJ7FF2.js";
7
+ } from "./chunk-CMIMUIV7.js";
8
8
  import {
9
9
  AccessKeyRequiredError,
10
10
  AccessKey_exports,
@@ -43,7 +43,7 @@ import {
43
43
  unlisted,
44
44
  user,
45
45
  withoutKey
46
- } from "./chunk-BZRQBSX2.js";
46
+ } from "./chunk-UGIWBXMZ.js";
47
47
  import {
48
48
  __export
49
49
  } from "./chunk-MLKGABMK.js";
@@ -9,7 +9,7 @@ import {
9
9
  from,
10
10
  json,
11
11
  post
12
- } from "./chunk-BZRQBSX2.js";
12
+ } from "./chunk-UGIWBXMZ.js";
13
13
  import {
14
14
  __export
15
15
  } from "./chunk-MLKGABMK.js";
@@ -2,7 +2,7 @@ import {
2
2
  openPopup,
3
3
  received,
4
4
  watchPopup
5
- } from "./chunk-BZRQBSX2.js";
5
+ } from "./chunk-UGIWBXMZ.js";
6
6
 
7
7
  // ../../accounts/src/internal/Sheet.ts
8
8
  import {
@@ -306,20 +306,6 @@ function requestHeaders(init, options) {
306
306
  headers.set(name, value);
307
307
  return headers;
308
308
  }
309
- function page() {
310
- if (typeof document === "undefined" && !("WorkerGlobalScope" in globalThis))
311
- return void 0;
312
- try {
313
- return globalThis.location?.href;
314
- } catch {
315
- return void 0;
316
- }
317
- }
318
- function sameHost(auth, options) {
319
- const own2 = new URL(auth.url);
320
- const url = new URL(options.page);
321
- return url.protocol === own2.protocol && url.hostname === own2.hostname;
322
- }
323
309
  function bound(token2) {
324
310
  return jkt(token2) !== void 0;
325
311
  }
@@ -964,7 +950,7 @@ async function approve(auth, options) {
964
950
  let unwatch;
965
951
  try {
966
952
  return await new Promise((resolve3, reject) => {
967
- void import("./Sheet-B4CBNDSV.js").then(
953
+ void import("./Sheet-2VUMVJXV.js").then(
968
954
  (Sheet2) => {
969
955
  if (settled) return;
970
956
  unblock = Sheet2.waiting({
@@ -1010,7 +996,7 @@ async function approve(auth, options) {
1010
996
  if (popup === null) throw new BlockedError();
1011
997
  return await watch2(popup);
1012
998
  }
1013
- const Sheet = await import("./Sheet-B4CBNDSV.js");
999
+ const Sheet = await import("./Sheet-2VUMVJXV.js");
1014
1000
  signal?.throwIfAborted();
1015
1001
  let abort;
1016
1002
  let close;
@@ -1617,7 +1603,7 @@ async function fetch2(auth, options) {
1617
1603
  let index = 0;
1618
1604
  while (text.charCodeAt(index) <= 32) index++;
1619
1605
  if (!/^[a-z][a-z\d+.-]*:/i.test(text.slice(index))) {
1620
- const base = page2();
1606
+ const base = page();
1621
1607
  if (base === void 0)
1622
1608
  throw new TypeError(
1623
1609
  `Invalid URL: "${String(options.url)}" is relative, and no page resolves it. Pass an absolute URL.`
@@ -1627,7 +1613,7 @@ async function fetch2(auth, options) {
1627
1613
  try {
1628
1614
  return new URL(options.url);
1629
1615
  } catch (error3) {
1630
- const base = page2();
1616
+ const base = page();
1631
1617
  if (base === void 0) throw error3;
1632
1618
  return new URL(options.url, base);
1633
1619
  }
@@ -1653,7 +1639,7 @@ async function refresh2(auth, options) {
1653
1639
  async function signOut(auth) {
1654
1640
  await json(await post(auth, "/v1/auth/logout", { json: {} }));
1655
1641
  }
1656
- function page2() {
1642
+ function page() {
1657
1643
  try {
1658
1644
  return globalThis.location?.href;
1659
1645
  } catch {
@@ -2044,27 +2030,10 @@ function create(options) {
2044
2030
  const [stored, digests] = await Promise.all([read2(), revoked.read()]);
2045
2031
  if (stored?.refreshToken && stored.refreshToken !== refreshToken) return;
2046
2032
  if (revoked.has(digests, session)) return;
2047
- const failed = await signOut2(session, {
2033
+ await signOut2(session, {
2048
2034
  logout: false,
2049
2035
  onRevoked: () => revoked.write(digests, [refreshToken])
2050
- }).then(
2051
- () => false,
2052
- () => true
2053
- );
2054
- if (!failed) return;
2055
- const current = await unanswered2.read();
2056
- const persisted = current ? await unanswered2.write([
2057
- ...current.filter((token2) => token2 !== refreshToken),
2058
- refreshToken
2059
- ]) : void 0;
2060
- const kept = machines.retains({
2061
- live: [refreshToken],
2062
- logouts: obtainedLogouts,
2063
- persisted,
2064
- retained,
2065
- unsaved: [refreshToken]
2066
2036
  });
2067
- for (const [token2, remote] of kept) retained.set(token2, remote);
2068
2037
  }).catch(() => void 0);
2069
2038
  }
2070
2039
  async function endRefused(ended, refused) {
@@ -3545,7 +3514,7 @@ var signInIds = /* @__PURE__ */ new Set([
3545
3514
  function plugin() {
3546
3515
  let loading;
3547
3516
  function load() {
3548
- loading ??= import("./dialog-EKY2NNFK.js").then((module) => module.dialog()).catch((error3) => {
3517
+ loading ??= import("./dialog-SWHB7N65.js").then((module) => module.dialog()).catch((error3) => {
3549
3518
  loading = void 0;
3550
3519
  throw error3;
3551
3520
  });
@@ -3805,7 +3774,7 @@ async function open(auth, options) {
3805
3774
  throw new OriginError2({ origin: window.location.origin, redirectUri });
3806
3775
  if (mode === "popup" && options.mode !== "popup" && !activated()) {
3807
3776
  const address = await abortable(read2(), { signal });
3808
- const Sheet = await import("./Sheet-B4CBNDSV.js");
3777
+ const Sheet = await import("./Sheet-2VUMVJXV.js");
3809
3778
  return await new Promise((resolve3, reject) => {
3810
3779
  const abort = () => {
3811
3780
  close();
@@ -3856,7 +3825,7 @@ async function watch(auth, options) {
3856
3825
  try {
3857
3826
  return await new Promise(
3858
3827
  (resolve3, reject) => {
3859
- void import("./Sheet-B4CBNDSV.js").then(
3828
+ void import("./Sheet-2VUMVJXV.js").then(
3860
3829
  (Sheet) => {
3861
3830
  if (settled) return;
3862
3831
  unblock = Sheet.waiting({
@@ -3921,7 +3890,7 @@ function parse(url, options) {
3921
3890
  async function frame(auth, options) {
3922
3891
  const { redirectUri, signal, toUrl } = options;
3923
3892
  const address = await abortable(options.address, { signal });
3924
- const Sheet = await import("./Sheet-B4CBNDSV.js");
3893
+ const Sheet = await import("./Sheet-2VUMVJXV.js");
3925
3894
  signal?.throwIfAborted();
3926
3895
  let close;
3927
3896
  let abort;
@@ -4356,15 +4325,11 @@ function create4(options = {}) {
4356
4325
  let rotating;
4357
4326
  let restoring;
4358
4327
  async function ownAccessToken() {
4359
- const page3 = page();
4360
- if (page3 !== void 0 && sameHost(config, { page: page3 })) return void 0;
4361
- await context.session.load();
4362
- const current = context.session.get();
4363
- if (!current) return void 0;
4364
- if (page3 !== void 0 && unbound(config, { accessToken: current.accessToken }))
4328
+ if (typeof document !== "undefined" || "WorkerGlobalScope" in globalThis)
4365
4329
  return void 0;
4366
- if (page3 === void 0) return accessToken2();
4367
- return accessToken2().catch(() => void 0);
4330
+ await context.session.load();
4331
+ if (!context.session.get()) return void 0;
4332
+ return accessToken2();
4368
4333
  }
4369
4334
  async function accessToken2() {
4370
4335
  await context.session.load();
@@ -4397,7 +4362,7 @@ function create4(options = {}) {
4397
4362
  function connections2() {
4398
4363
  if (!connectionsOptions)
4399
4364
  return Promise.reject(new ConnectionsRequiredError());
4400
- attached ??= import("./Connections-K3JRTPCM.js").then(
4365
+ attached ??= import("./Connections-K44EJ6F7.js").then(
4401
4366
  (module) => module.attach(config, connectionsOptions)
4402
4367
  );
4403
4368
  return attached;
@@ -4446,7 +4411,7 @@ function create4(options = {}) {
4446
4411
  },
4447
4412
  handler: {
4448
4413
  async fetch(request2) {
4449
- server ??= import("./Server-PGYQWANQ.js").then(
4414
+ server ??= import("./Server-CAPWBFI3.js").then(
4450
4415
  (module) => module.create({
4451
4416
  accessKeys: connectionsOptions ? async () => (await connections2()).keyEndpoint : void 0,
4452
4417
  // The `backend` plugin's actions sit on the instance under its `id`.
@@ -2,7 +2,7 @@ import {
2
2
  create,
3
3
  prompt,
4
4
  waiting
5
- } from "./chunk-U6LTO7G5.js";
5
+ } from "./chunk-S3QDABXG.js";
6
6
  import {
7
7
  basePath
8
8
  } from "./chunk-HWONYWNC.js";
@@ -27,7 +27,7 @@ import {
27
27
  tokens,
28
28
  user,
29
29
  watchPopup
30
- } from "./chunk-BZRQBSX2.js";
30
+ } from "./chunk-UGIWBXMZ.js";
31
31
  import {
32
32
  __export
33
33
  } from "./chunk-MLKGABMK.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  env,
3
3
  login
4
- } from "../chunk-O2JIV5FP.js";
5
- import "../chunk-MIPJIEVS.js";
6
- import "../chunk-U6LTO7G5.js";
7
- import "../chunk-ZCIJ7FF2.js";
4
+ } from "../chunk-6Y4DXPDA.js";
5
+ import "../chunk-YXEQ42DK.js";
6
+ import "../chunk-S3QDABXG.js";
7
+ import "../chunk-CMIMUIV7.js";
8
8
  import "../chunk-HWONYWNC.js";
9
- import "../chunk-BZRQBSX2.js";
9
+ import "../chunk-UGIWBXMZ.js";
10
10
  import "../chunk-MLKGABMK.js";
11
11
 
12
12
  // src/commands/login.ts
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  env,
3
3
  remove
4
- } from "../chunk-O2JIV5FP.js";
5
- import "../chunk-MIPJIEVS.js";
6
- import "../chunk-U6LTO7G5.js";
7
- import "../chunk-ZCIJ7FF2.js";
4
+ } from "../chunk-6Y4DXPDA.js";
5
+ import "../chunk-YXEQ42DK.js";
6
+ import "../chunk-S3QDABXG.js";
7
+ import "../chunk-CMIMUIV7.js";
8
8
  import "../chunk-HWONYWNC.js";
9
- import "../chunk-BZRQBSX2.js";
9
+ import "../chunk-UGIWBXMZ.js";
10
10
  import "../chunk-MLKGABMK.js";
11
11
 
12
12
  // src/commands/logout.ts
@@ -2,12 +2,12 @@ import {
2
2
  env,
3
3
  signedOut,
4
4
  whoami
5
- } from "../chunk-O2JIV5FP.js";
6
- import "../chunk-MIPJIEVS.js";
7
- import "../chunk-U6LTO7G5.js";
8
- import "../chunk-ZCIJ7FF2.js";
5
+ } from "../chunk-6Y4DXPDA.js";
6
+ import "../chunk-YXEQ42DK.js";
7
+ import "../chunk-S3QDABXG.js";
8
+ import "../chunk-CMIMUIV7.js";
9
9
  import "../chunk-HWONYWNC.js";
10
- import "../chunk-BZRQBSX2.js";
10
+ import "../chunk-UGIWBXMZ.js";
11
11
  import "../chunk-MLKGABMK.js";
12
12
 
13
13
  // src/commands/whoami.ts
@@ -2,8 +2,8 @@ import {
2
2
  callback,
3
3
  preload,
4
4
  signIn
5
- } from "./chunk-MIPJIEVS.js";
6
- import "./chunk-U6LTO7G5.js";
5
+ } from "./chunk-YXEQ42DK.js";
6
+ import "./chunk-S3QDABXG.js";
7
7
  import {
8
8
  basePath
9
9
  } from "./chunk-HWONYWNC.js";
@@ -16,7 +16,7 @@ import {
16
16
  revokeAccessKey,
17
17
  toSession,
18
18
  updateAccessKey
19
- } from "./chunk-BZRQBSX2.js";
19
+ } from "./chunk-UGIWBXMZ.js";
20
20
  import "./chunk-MLKGABMK.js";
21
21
 
22
22
  // ../../accounts/src/plugins/dialog.ts
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "node": ">=24.21"
10
10
  },
11
11
  "name": "@tempoxyz/id",
12
- "version": "0.0.0-pr-755.sha-1c7edcc",
12
+ "version": "0.0.0-pr-740.sha-e82a463",
13
13
  "description": "The tempo-id CLI: sign in to Tempo ID, and call its API and the Admin API.",
14
14
  "type": "module",
15
15
  "bin": {