@tempoxyz/id 0.0.0-pr-986.sha-c2ced0f → 0.0.0-pr-841.sha-bd4d6dd

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.
@@ -2,9 +2,9 @@ import {
2
2
  attach,
3
3
  create,
4
4
  pending
5
- } from "./chunk-DHNGO76P.js";
5
+ } from "./chunk-7KIOFUO2.js";
6
6
  import "./chunk-FWGE6HXK.js";
7
- import "./chunk-KWKSUZOG.js";
7
+ import "./chunk-Y5ESRTOA.js";
8
8
  import "./chunk-FHXDPKTL.js";
9
9
  import "./chunk-MLKGABMK.js";
10
10
  export {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  InvalidError
3
3
  } from "./chunk-2T7V6ASK.js";
4
- import "./chunk-VNORMO3B.js";
4
+ import "./chunk-AVGHKMEM.js";
5
5
  import {
6
6
  authPath,
7
7
  basePath,
@@ -12,7 +12,7 @@ import {
12
12
  RequestError,
13
13
  key,
14
14
  siwe
15
- } from "./chunk-KWKSUZOG.js";
15
+ } from "./chunk-Y5ESRTOA.js";
16
16
  import "./chunk-FHXDPKTL.js";
17
17
  import "./chunk-MLKGABMK.js";
18
18
 
@@ -4,8 +4,8 @@ import {
4
4
  machines,
5
5
  prompt,
6
6
  waiting
7
- } from "./chunk-L3XL2S2D.js";
8
- import "./chunk-KWKSUZOG.js";
7
+ } from "./chunk-6YB3Z2ZN.js";
8
+ import "./chunk-Y5ESRTOA.js";
9
9
  import "./chunk-FHXDPKTL.js";
10
10
  import "./chunk-MLKGABMK.js";
11
11
  export {
@@ -3,7 +3,7 @@ import {
3
3
  openPopup,
4
4
  received,
5
5
  watchPopup
6
- } from "./chunk-KWKSUZOG.js";
6
+ } from "./chunk-Y5ESRTOA.js";
7
7
 
8
8
  // ../../accounts/src/internal/Sheet.ts
9
9
  import {
@@ -905,6 +905,15 @@ var machines;
905
905
  open: {
906
906
  exit: "unlisten",
907
907
  on: {
908
+ // A loaded frame shows the deferred request already, so its challenge follows at once. A
909
+ // dialog that offers a popup takes the challenge too, whose full request the popup opens.
910
+ challenge: [
911
+ {
912
+ actions: ["supply", "arm", "post", "sent"],
913
+ guard: and(["ours", "loaded"])
914
+ },
915
+ { actions: ["supply", "arm"], guard: "ours" }
916
+ ],
908
917
  close: [
909
918
  { guard: "animate", target: "closing" },
910
919
  { target: "closed" }
@@ -926,16 +935,7 @@ var machines;
926
935
  actions: "onCallback",
927
936
  guard: "current"
928
937
  },
929
- "popup.close": { actions: "onClose", guard: "current" },
930
- // A loaded frame shows the deferred request already, so its challenge follows at once. A
931
- // dialog that offers a popup takes the challenge too, whose full request the popup opens.
932
- challenge: [
933
- {
934
- actions: ["supply", "arm", "post", "sent"],
935
- guard: and(["ours", "loaded"])
936
- },
937
- { actions: ["supply", "arm"], guard: "ours" }
938
- ]
938
+ "popup.close": { actions: "onClose", guard: "current" }
939
939
  },
940
940
  states: {
941
941
  dialog: {
@@ -8,7 +8,7 @@ import {
8
8
  from,
9
9
  json,
10
10
  post
11
- } from "./chunk-KWKSUZOG.js";
11
+ } from "./chunk-Y5ESRTOA.js";
12
12
  import {
13
13
  __export
14
14
  } from "./chunk-MLKGABMK.js";
@@ -19,7 +19,7 @@ import {
19
19
  tokens,
20
20
  url,
21
21
  user
22
- } from "./chunk-KWKSUZOG.js";
22
+ } from "./chunk-Y5ESRTOA.js";
23
23
  import {
24
24
  __export
25
25
  } from "./chunk-MLKGABMK.js";
@@ -16,7 +16,7 @@ import {
16
16
  tempoAccount,
17
17
  tokens,
18
18
  user
19
- } from "./chunk-KWKSUZOG.js";
19
+ } from "./chunk-Y5ESRTOA.js";
20
20
  import {
21
21
  __export
22
22
  } from "./chunk-MLKGABMK.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  handleCallback,
3
3
  handleResult
4
- } from "./chunk-VNORMO3B.js";
4
+ } from "./chunk-AVGHKMEM.js";
5
5
  import {
6
6
  create,
7
7
  prompt,
8
8
  waiting
9
- } from "./chunk-L3XL2S2D.js";
9
+ } from "./chunk-6YB3Z2ZN.js";
10
10
  import {
11
11
  authPath,
12
12
  basePath
@@ -31,7 +31,7 @@ import {
31
31
  resources,
32
32
  revoke,
33
33
  watchPopup
34
- } from "./chunk-KWKSUZOG.js";
34
+ } from "./chunk-Y5ESRTOA.js";
35
35
  import {
36
36
  __export
37
37
  } from "./chunk-MLKGABMK.js";
@@ -369,8 +369,48 @@ async function authorize(auth, options) {
369
369
  if (mode === "iframe")
370
370
  sheet ??= create({ url: frameUrl(auth, { redirectUri }) });
371
371
  name = channel({ state });
372
- written = Promise.resolve(store.setItem(name, true));
373
- await Promise.race([written, aborted, cancelled, closed, replaced]);
372
+ const writing = Promise.resolve(store.setItem(name, true));
373
+ written = writing;
374
+ const early = (() => {
375
+ if (!message || !sheet) return void 0;
376
+ const target = sheet;
377
+ return new Promise((resolve, reject) => {
378
+ const shown = target.show({
379
+ deferred: true,
380
+ onCallback: (callback3, funding2) => resolve({ callback: callback3, funding: funding2 }),
381
+ onClose: () => close?.(),
382
+ request,
383
+ timeout
384
+ });
385
+ Promise.all([message, writing]).then(([value]) => {
386
+ const url = new URL(popupUrl);
387
+ for (const [name2, parameter] of Object.entries(
388
+ challengeParameters(auth, {
389
+ accessKey: Boolean(rest.accessKey),
390
+ challenge: value
391
+ })
392
+ ))
393
+ url.searchParams.set(name2, parameter);
394
+ target.challenge({
395
+ id: shown,
396
+ popupUrl: url.href,
397
+ request: toRequest(url.href)
398
+ });
399
+ }, reject);
400
+ });
401
+ })();
402
+ early?.catch(() => {
403
+ });
404
+ const failed = message?.then(() => new Promise(() => {
405
+ }));
406
+ await Promise.race([
407
+ written,
408
+ aborted,
409
+ cancelled,
410
+ closed,
411
+ ...failed ? [failed] : [],
412
+ replaced
413
+ ]);
374
414
  if (popup?.closed)
375
415
  throw new DOMException("The user closed the sign-in.", "AbortError");
376
416
  const listener = new BroadcastChannel(name);
@@ -389,29 +429,15 @@ async function authorize(auth, options) {
389
429
  onClosed: () => unblock?.(),
390
430
  origin: new URL(auth.url).origin
391
431
  });
392
- if (!sheet) return;
393
- const shown = sheet.show({
394
- onCallback: (callback3, funding2) => resolve({ callback: callback3, funding: funding2 }),
395
- onClose: () => close?.(),
396
- ...message ? { deferred: true } : { popupUrl },
397
- request,
398
- timeout
399
- });
400
- message?.then((value) => {
401
- const url = new URL(popupUrl);
402
- for (const [name2, parameter] of Object.entries(
403
- challengeParameters(auth, {
404
- accessKey: Boolean(rest.accessKey),
405
- challenge: value
406
- })
407
- ))
408
- url.searchParams.set(name2, parameter);
409
- sheet?.challenge({
410
- id: shown,
411
- popupUrl: url.href,
412
- request: toRequest(url.href)
432
+ if (early) early.then(resolve, reject);
433
+ else
434
+ sheet?.show({
435
+ onCallback: (callback3, funding2) => resolve({ callback: callback3, funding: funding2 }),
436
+ onClose: () => close?.(),
437
+ popupUrl,
438
+ request,
439
+ timeout
413
440
  });
414
- }, reject);
415
441
  });
416
442
  if (popup) popup.location.href = popupUrl;
417
443
  const { callback: callback2, funding } = await received;
@@ -2,16 +2,16 @@ import {
2
2
  bind,
3
3
  from,
4
4
  passkey_exports
5
- } from "./chunk-2T4AO53J.js";
5
+ } from "./chunk-DS4YLNUJ.js";
6
6
  import {
7
7
  dialog_exports
8
- } from "./chunk-U46FKX4C.js";
8
+ } from "./chunk-LN2RXYYW.js";
9
9
  import {
10
10
  redirect_exports
11
- } from "./chunk-VNORMO3B.js";
11
+ } from "./chunk-AVGHKMEM.js";
12
12
  import {
13
13
  connections_exports
14
- } from "./chunk-DHNGO76P.js";
14
+ } from "./chunk-7KIOFUO2.js";
15
15
  import {
16
16
  AccessKey_exports,
17
17
  Accounts_exports,
@@ -50,7 +50,7 @@ import {
50
50
  unlisted,
51
51
  user,
52
52
  withoutAccessKey
53
- } from "./chunk-KWKSUZOG.js";
53
+ } from "./chunk-Y5ESRTOA.js";
54
54
  import {
55
55
  __export
56
56
  } from "./chunk-MLKGABMK.js";
@@ -447,7 +447,7 @@ async function signIn2(auth2, options) {
447
447
  return { ...next, options: next.options };
448
448
  })();
449
449
  if (creation && prepared.accessKey && options.accessKey) {
450
- const { register } = await import("./passkey-OG7VP6QE.js");
450
+ const { register } = await import("./passkey-DFH2IY4D.js");
451
451
  const registered = await register(auth2, {
452
452
  accessKey: { ...options.accessKey, account: prepared.accessKey.signer },
453
453
  challenge: options.challenge,
@@ -1189,7 +1189,7 @@ async function approve(auth, options) {
1189
1189
  let unwatch;
1190
1190
  try {
1191
1191
  return await new Promise((resolve3, reject) => {
1192
- void import("./Sheet-OP6K55OK.js").then(
1192
+ void import("./Sheet-ZAJ3CTUV.js").then(
1193
1193
  (Sheet2) => {
1194
1194
  if (settled) return;
1195
1195
  unblock = Sheet2.waiting({
@@ -1244,7 +1244,7 @@ async function approve(auth, options) {
1244
1244
  }
1245
1245
  }
1246
1246
  const covering = direct ? void 0 : hold;
1247
- const Sheet = await import("./Sheet-OP6K55OK.js");
1247
+ const Sheet = await import("./Sheet-ZAJ3CTUV.js");
1248
1248
  signal?.throwIfAborted();
1249
1249
  const sheet = Sheet.load({
1250
1250
  // The page runs the passkey ceremony of the account's owner, for Tempo ID's origin. The payment
@@ -4619,7 +4619,7 @@ function plugin() {
4619
4619
  let loading;
4620
4620
  let loaded_plugin;
4621
4621
  function load() {
4622
- loading ??= import("./dialog-GREFOEZK.js").then((module) => loaded_plugin = module.dialog()).catch((error3) => {
4622
+ loading ??= import("./dialog-LOM5ZTPY.js").then((module) => loaded_plugin = module.dialog()).catch((error3) => {
4623
4623
  loading = void 0;
4624
4624
  throw error3;
4625
4625
  });
@@ -4928,7 +4928,7 @@ async function open(auth, options) {
4928
4928
  throw new OriginError2({ origin: window.location.origin, redirectUri });
4929
4929
  if (mode === "popup" && options.mode !== "popup" && !activated()) {
4930
4930
  const address = await abortable(read3(), { signal });
4931
- const Sheet = await import("./Sheet-OP6K55OK.js");
4931
+ const Sheet = await import("./Sheet-ZAJ3CTUV.js");
4932
4932
  return await new Promise((resolve3, reject) => {
4933
4933
  const abort = () => {
4934
4934
  close();
@@ -4991,7 +4991,7 @@ async function preload(auth, options) {
4991
4991
  const entry = { ready: Promise.resolve(), sheet: void 0, url: url2 };
4992
4992
  preloads.set(auth, entry);
4993
4993
  entry.ready = (async () => {
4994
- const Sheet = await import("./Sheet-OP6K55OK.js").catch(() => void 0);
4994
+ const Sheet = await import("./Sheet-ZAJ3CTUV.js").catch(() => void 0);
4995
4995
  if (!document.body)
4996
4996
  await new Promise(
4997
4997
  (resolve3) => document.addEventListener("DOMContentLoaded", resolve3, {
@@ -5017,7 +5017,7 @@ async function watch(auth, options) {
5017
5017
  try {
5018
5018
  return await new Promise(
5019
5019
  (resolve3, reject) => {
5020
- void import("./Sheet-OP6K55OK.js").then(
5020
+ void import("./Sheet-ZAJ3CTUV.js").then(
5021
5021
  (Sheet) => {
5022
5022
  if (settled) return;
5023
5023
  unblock = Sheet.waiting({
@@ -5119,7 +5119,7 @@ var decimal = /^(?:0|[1-9]\d{0,17})(?:\.\d{1,18})?$/;
5119
5119
  async function frame(auth, options) {
5120
5120
  const { redirectUri, signal, toUrl } = options;
5121
5121
  const address = await abortable(options.address, { signal });
5122
- const Sheet = await import("./Sheet-OP6K55OK.js");
5122
+ const Sheet = await import("./Sheet-ZAJ3CTUV.js");
5123
5123
  signal?.throwIfAborted();
5124
5124
  const url2 = toUrl(address);
5125
5125
  const held = preloads.get(auth);
@@ -5744,7 +5744,7 @@ function create4(options = {}) {
5744
5744
  function connections2() {
5745
5745
  if (!connectionsOptions)
5746
5746
  return Promise.reject(new ConnectionsRequiredError());
5747
- attached ??= import("./Connections-Y3EZQA6S.js").then(
5747
+ attached ??= import("./Connections-DK2SIMV5.js").then(
5748
5748
  (module) => module.attach(config, connectionsOptions)
5749
5749
  );
5750
5750
  return attached;
@@ -5801,7 +5801,7 @@ function create4(options = {}) {
5801
5801
  },
5802
5802
  handler: {
5803
5803
  async fetch(request2) {
5804
- server ??= import("./Server-IJC3JUAJ.js").then(
5804
+ server ??= import("./Server-CARQOWST.js").then(
5805
5805
  (module) => module.create({
5806
5806
  accessKeys: connectionsOptions ? async () => (await connections2()).accessKeyEndpoint : void 0,
5807
5807
  // The `backend` plugin's actions sit on the instance under its `id`.
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  env,
3
3
  login
4
- } from "../chunk-YX3LA6K5.js";
4
+ } from "../chunk-N5H6SUAV.js";
5
5
  import "../chunk-2T7V6ASK.js";
6
- import "../chunk-2T4AO53J.js";
7
- import "../chunk-U46FKX4C.js";
8
- import "../chunk-VNORMO3B.js";
9
- import "../chunk-L3XL2S2D.js";
10
- import "../chunk-DHNGO76P.js";
6
+ import "../chunk-DS4YLNUJ.js";
7
+ import "../chunk-LN2RXYYW.js";
8
+ import "../chunk-AVGHKMEM.js";
9
+ import "../chunk-6YB3Z2ZN.js";
10
+ import "../chunk-7KIOFUO2.js";
11
11
  import "../chunk-FWGE6HXK.js";
12
12
  import {
13
13
  Accounts_exports
14
- } from "../chunk-KWKSUZOG.js";
14
+ } from "../chunk-Y5ESRTOA.js";
15
15
  import "../chunk-FHXDPKTL.js";
16
16
  import "../chunk-MLKGABMK.js";
17
17
 
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  env,
3
3
  remove
4
- } from "../chunk-YX3LA6K5.js";
4
+ } from "../chunk-N5H6SUAV.js";
5
5
  import "../chunk-2T7V6ASK.js";
6
- import "../chunk-2T4AO53J.js";
7
- import "../chunk-U46FKX4C.js";
8
- import "../chunk-VNORMO3B.js";
9
- import "../chunk-L3XL2S2D.js";
10
- import "../chunk-DHNGO76P.js";
6
+ import "../chunk-DS4YLNUJ.js";
7
+ import "../chunk-LN2RXYYW.js";
8
+ import "../chunk-AVGHKMEM.js";
9
+ import "../chunk-6YB3Z2ZN.js";
10
+ import "../chunk-7KIOFUO2.js";
11
11
  import "../chunk-FWGE6HXK.js";
12
- import "../chunk-KWKSUZOG.js";
12
+ import "../chunk-Y5ESRTOA.js";
13
13
  import "../chunk-FHXDPKTL.js";
14
14
  import "../chunk-MLKGABMK.js";
15
15
 
@@ -2,15 +2,15 @@ import {
2
2
  env,
3
3
  signedOut,
4
4
  whoami
5
- } from "../chunk-YX3LA6K5.js";
5
+ } from "../chunk-N5H6SUAV.js";
6
6
  import "../chunk-2T7V6ASK.js";
7
- import "../chunk-2T4AO53J.js";
8
- import "../chunk-U46FKX4C.js";
9
- import "../chunk-VNORMO3B.js";
10
- import "../chunk-L3XL2S2D.js";
11
- import "../chunk-DHNGO76P.js";
7
+ import "../chunk-DS4YLNUJ.js";
8
+ import "../chunk-LN2RXYYW.js";
9
+ import "../chunk-AVGHKMEM.js";
10
+ import "../chunk-6YB3Z2ZN.js";
11
+ import "../chunk-7KIOFUO2.js";
12
12
  import "../chunk-FWGE6HXK.js";
13
- import "../chunk-KWKSUZOG.js";
13
+ import "../chunk-Y5ESRTOA.js";
14
14
  import "../chunk-FHXDPKTL.js";
15
15
  import "../chunk-MLKGABMK.js";
16
16
 
@@ -3,9 +3,9 @@ import {
3
3
  preload,
4
4
  signIn,
5
5
  signMessage
6
- } from "./chunk-U46FKX4C.js";
7
- import "./chunk-VNORMO3B.js";
8
- import "./chunk-L3XL2S2D.js";
6
+ } from "./chunk-LN2RXYYW.js";
7
+ import "./chunk-AVGHKMEM.js";
8
+ import "./chunk-6YB3Z2ZN.js";
9
9
  import {
10
10
  authPath,
11
11
  basePath
@@ -25,7 +25,7 @@ import {
25
25
  revokeAccessKey,
26
26
  toSession,
27
27
  updateAccessKey
28
- } from "./chunk-KWKSUZOG.js";
28
+ } from "./chunk-Y5ESRTOA.js";
29
29
  import "./chunk-FHXDPKTL.js";
30
30
  import "./chunk-MLKGABMK.js";
31
31
 
@@ -3,8 +3,8 @@ import {
3
3
  prepare,
4
4
  register,
5
5
  signIn
6
- } from "./chunk-2T4AO53J.js";
7
- import "./chunk-KWKSUZOG.js";
6
+ } from "./chunk-DS4YLNUJ.js";
7
+ import "./chunk-Y5ESRTOA.js";
8
8
  import "./chunk-FHXDPKTL.js";
9
9
  import "./chunk-MLKGABMK.js";
10
10
  export {
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-986.sha-c2ced0f",
12
+ "version": "0.0.0-pr-841.sha-bd4d6dd",
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": {