@tempoxyz/id 0.0.0-pr-682.sha-7dbcb28 → 0.0.0-pr-684.sha-4ceaf01

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,8 +4,8 @@ import {
4
4
  name,
5
5
  parseName,
6
6
  pending
7
- } from "./chunk-3ZOH2DZZ.js";
8
- import "./chunk-6OUFRS7E.js";
7
+ } from "./chunk-J4QY2QEZ.js";
8
+ import "./chunk-GG25UBDV.js";
9
9
  import "./chunk-YW5DUQT3.js";
10
10
  import "./chunk-MLKGABMK.js";
11
11
  export {
@@ -4,7 +4,7 @@ import {
4
4
  machines,
5
5
  prompt,
6
6
  waiting
7
- } from "./chunk-6OUFRS7E.js";
7
+ } from "./chunk-GG25UBDV.js";
8
8
  import "./chunk-MLKGABMK.js";
9
9
  export {
10
10
  create,
@@ -1658,7 +1658,7 @@ async function open(auth, options) {
1658
1658
  throw new OriginError({ origin: window.location.origin, redirectUri });
1659
1659
  if (mode === "popup" && options.mode !== "popup" && !activated()) {
1660
1660
  const address2 = await abortable(read2(), { signal });
1661
- const Sheet = await import("./Sheet-YVAWI7NQ.js");
1661
+ const Sheet = await import("./Sheet-HSPYTT5H.js");
1662
1662
  return await new Promise((resolve3, reject) => {
1663
1663
  const abort = () => {
1664
1664
  close();
@@ -1709,7 +1709,7 @@ async function watch(auth, options) {
1709
1709
  try {
1710
1710
  return await new Promise(
1711
1711
  (resolve3, reject) => {
1712
- void import("./Sheet-YVAWI7NQ.js").then(
1712
+ void import("./Sheet-HSPYTT5H.js").then(
1713
1713
  (Sheet) => {
1714
1714
  if (settled) return;
1715
1715
  unblock = Sheet.waiting({
@@ -1774,7 +1774,7 @@ function parse(url, options) {
1774
1774
  async function frame(auth, options) {
1775
1775
  const { redirectUri, signal, toUrl } = options;
1776
1776
  const address2 = await abortable(options.address, { signal });
1777
- const Sheet = await import("./Sheet-YVAWI7NQ.js");
1777
+ const Sheet = await import("./Sheet-HSPYTT5H.js");
1778
1778
  signal?.throwIfAborted();
1779
1779
  let close;
1780
1780
  let abort;
@@ -2566,15 +2566,21 @@ async function signIn3(auth, options) {
2566
2566
  )
2567
2567
  );
2568
2568
  })();
2569
+ const chain = options.account?.chain ?? options.account?.chainId;
2569
2570
  const requestedAt = Date.now();
2570
2571
  const response = await post(auth, "/v1/auth/code/verify", {
2571
2572
  // The sign-in carries the authorization, whose code Tempo ID redeems in the same request.
2572
2573
  headers: await redemption(auth),
2573
2574
  json: {
2575
+ ...options.account ? {
2576
+ account: {
2577
+ ...chain !== void 0 ? { chain } : {},
2578
+ client_id: auth.clientId
2579
+ }
2580
+ } : {},
2574
2581
  code,
2575
2582
  email,
2576
2583
  ...options.registration ? { registration: true } : {},
2577
- ...options.account === false ? { tempo: false } : {},
2578
2584
  ...link ? { assertion, link } : {
2579
2585
  authorize: prepared.authorize,
2580
2586
  // A passkey that owns the account signs the access key on this page, in place of a redirect.
@@ -2590,13 +2596,14 @@ async function signIn3(auth, options) {
2590
2596
  request: options
2591
2597
  });
2592
2598
  const account2 = (() => {
2593
- if (!body.tempo) return void 0;
2599
+ if (!options.account || !body.tempo) return void 0;
2600
+ const { getFn: getFn2 } = options.account;
2594
2601
  const [first, ...rest] = body.tempo;
2595
2602
  if (!first) return { account: void 0, accounts: [] };
2596
- const account3 = tempoAccount(first, { getFn });
2603
+ const account3 = tempoAccount(first, { getFn: getFn2 });
2597
2604
  const others = rest.flatMap((entry) => {
2598
2605
  try {
2599
- return [tempoAccount(entry, { getFn })];
2606
+ return [tempoAccount(entry, { getFn: getFn2 })];
2600
2607
  } catch {
2601
2608
  return [];
2602
2609
  }
@@ -2720,14 +2727,12 @@ function prepare2(auth, options = {}) {
2720
2727
  throw error3;
2721
2728
  }
2722
2729
  );
2723
- return await verify(auth, {
2724
- assertion,
2725
- getFn: signInOptions.getFn,
2726
- prepared
2727
- }).catch((error3) => {
2728
- pending ??= ahead();
2729
- throw error3;
2730
- });
2730
+ return await verify(auth, { assertion, prepared }).catch(
2731
+ (error3) => {
2732
+ pending ??= ahead();
2733
+ throw error3;
2734
+ }
2735
+ );
2731
2736
  }
2732
2737
  };
2733
2738
  }
@@ -2835,11 +2840,7 @@ async function register(auth, options = {}) {
2835
2840
  async function signIn4(auth, options = {}) {
2836
2841
  const prepared = await requestOptions(auth, options);
2837
2842
  const assertion = await sign2(prepared, options);
2838
- return await verify(auth, {
2839
- assertion,
2840
- getFn: options.getFn,
2841
- prepared
2842
- });
2843
+ return await verify(auth, { assertion, prepared });
2843
2844
  }
2844
2845
  function forget(options) {
2845
2846
  if (typeof PublicKeyCredential === "undefined") return;
@@ -2890,31 +2891,22 @@ async function sign2(prepared, options) {
2890
2891
  );
2891
2892
  }
2892
2893
  async function verify(auth, options) {
2893
- const { assertion, getFn, prepared } = options;
2894
+ const { assertion, prepared } = options;
2894
2895
  const body = await read(
2895
2896
  await post(auth, "/v1/auth/passkey/verify", {
2896
2897
  // The prepared authorization's code redeems in the same request.
2897
2898
  headers: await redemption(auth),
2898
- json: {
2899
- assertion,
2900
- ...prepared.request.account === false ? { tempo: false } : {}
2901
- }
2899
+ json: { assertion }
2902
2900
  })
2903
2901
  );
2904
2902
  if ("step" in body)
2905
2903
  return { step: { link: body.step.link, type: body.step.type } };
2906
- const authorization2 = await complete(auth, {
2904
+ return await complete(auth, {
2907
2905
  authorize: prepared.authorize,
2908
2906
  body,
2909
2907
  key: prepared.key,
2910
2908
  request: prepared.request
2911
2909
  });
2912
- if (!body.tempo) return authorization2;
2913
- const [first] = body.tempo;
2914
- return {
2915
- ...authorization2,
2916
- account: first ? tempoAccount(first, { getFn }) : void 0
2917
- };
2918
2910
  }
2919
2911
 
2920
2912
  // ../../accounts/src/actions/realm.ts
@@ -3314,7 +3306,7 @@ var signInIds = /* @__PURE__ */ new Set([
3314
3306
  function plugin() {
3315
3307
  let loading;
3316
3308
  function load() {
3317
- loading ??= import("./dialog-A57XPJ5M.js").then((module) => module.dialog()).catch((error3) => {
3309
+ loading ??= import("./dialog-TS2A3CU7.js").then((module) => module.dialog()).catch((error3) => {
3318
3310
  loading = void 0;
3319
3311
  throw error3;
3320
3312
  });
@@ -4522,7 +4514,7 @@ function create4(options = {}) {
4522
4514
  function connections2() {
4523
4515
  if (!connectionsOptions)
4524
4516
  return Promise.reject(new ConnectionsRequiredError());
4525
- attached ??= import("./Connections-HGSRREKT.js").then(
4517
+ attached ??= import("./Connections-E4FRZV7E.js").then(
4526
4518
  (module) => module.attach(config, connectionsOptions)
4527
4519
  );
4528
4520
  return attached;
@@ -5,7 +5,7 @@ import {
5
5
  expired,
6
6
  from,
7
7
  revokeAccessKey
8
- } from "./chunk-6OUFRS7E.js";
8
+ } from "./chunk-GG25UBDV.js";
9
9
  import {
10
10
  from as from2
11
11
  } from "./chunk-YW5DUQT3.js";
@@ -2,7 +2,7 @@ import {
2
2
  AccessKey_exports,
3
3
  Accounts_exports,
4
4
  Actions_exports
5
- } from "./chunk-6OUFRS7E.js";
5
+ } from "./chunk-GG25UBDV.js";
6
6
 
7
7
  // src/Session.ts
8
8
  import * as Fs from "node:fs/promises";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  env,
3
3
  login
4
- } from "../chunk-T5LIQW6C.js";
5
- import "../chunk-3ZOH2DZZ.js";
6
- import "../chunk-6OUFRS7E.js";
4
+ } from "../chunk-U4EJZKQQ.js";
5
+ import "../chunk-J4QY2QEZ.js";
6
+ import "../chunk-GG25UBDV.js";
7
7
  import "../chunk-YW5DUQT3.js";
8
8
  import "../chunk-MLKGABMK.js";
9
9
 
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  env,
3
3
  remove
4
- } from "../chunk-T5LIQW6C.js";
5
- import "../chunk-3ZOH2DZZ.js";
6
- import "../chunk-6OUFRS7E.js";
4
+ } from "../chunk-U4EJZKQQ.js";
5
+ import "../chunk-J4QY2QEZ.js";
6
+ import "../chunk-GG25UBDV.js";
7
7
  import "../chunk-YW5DUQT3.js";
8
8
  import "../chunk-MLKGABMK.js";
9
9
 
@@ -2,9 +2,9 @@ import {
2
2
  env,
3
3
  signedOut,
4
4
  whoami
5
- } from "../chunk-T5LIQW6C.js";
6
- import "../chunk-3ZOH2DZZ.js";
7
- import "../chunk-6OUFRS7E.js";
5
+ } from "../chunk-U4EJZKQQ.js";
6
+ import "../chunk-J4QY2QEZ.js";
7
+ import "../chunk-GG25UBDV.js";
8
8
  import "../chunk-YW5DUQT3.js";
9
9
  import "../chunk-MLKGABMK.js";
10
10
 
@@ -4,7 +4,7 @@ import {
4
4
  expired2 as expired,
5
5
  from2 as from,
6
6
  toSession
7
- } from "./chunk-6OUFRS7E.js";
7
+ } from "./chunk-GG25UBDV.js";
8
8
  import "./chunk-MLKGABMK.js";
9
9
 
10
10
  // ../../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-682.sha-7dbcb28",
12
+ "version": "0.0.0-pr-684.sha-4ceaf01",
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": {