@tempoxyz/id 0.0.0-pr-670.sha-a9bc8ec → 0.0.0-pr-723.sha-e7399b4

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-IVSEEABZ.js";
8
- import "./chunk-OWN434NG.js";
7
+ } from "./chunk-7EY47TSI.js";
8
+ import "./chunk-TCCWJ2TN.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-OWN434NG.js";
7
+ } from "./chunk-TCCWJ2TN.js";
8
8
  import "./chunk-MLKGABMK.js";
9
9
  export {
10
10
  create,
@@ -5,7 +5,7 @@ import {
5
5
  expired,
6
6
  from,
7
7
  revokeAccessKey
8
- } from "./chunk-OWN434NG.js";
8
+ } from "./chunk-TCCWJ2TN.js";
9
9
  import {
10
10
  from as from2
11
11
  } from "./chunk-YW5DUQT3.js";
@@ -1026,9 +1026,9 @@ async function authorizeUrl(auth, options) {
1026
1026
  if (!accessKey2 && options.challenge !== void 0)
1027
1027
  throw new ChallengeWithoutKeyError();
1028
1028
  const redirectUri = options.redirectUri ?? auth.redirectUri ?? `${window.location.origin}/`;
1029
- const key = accessKey2 ? await resolve(accessKey2) : void 0;
1029
+ const key = accessKey2 && !("address" in accessKey2) ? await resolve(accessKey2) : void 0;
1030
1030
  const pending = from2({
1031
- ...key ? key.material : { key: false },
1031
+ ...key ? key.material : accessKey2 ? {} : { key: false },
1032
1032
  chainId: auth.chainId,
1033
1033
  clientId: auth.clientId,
1034
1034
  redirectUri,
@@ -1036,9 +1036,13 @@ async function authorizeUrl(auth, options) {
1036
1036
  state: Base644.fromBytes(Bytes2.random(16), base64url),
1037
1037
  verifier: Base644.fromBytes(Bytes2.random(32), base64url)
1038
1038
  });
1039
- const authorization2 = key && accessKey2 ? keyAuthorization(auth, {
1040
- accessKey: { ...accessKey2, account: key.accessKey }
1041
- }) : void 0;
1039
+ const authorization2 = (() => {
1040
+ if (!accessKey2) return void 0;
1041
+ if ("address" in accessKey2) return keyAuthorization(auth, { accessKey: accessKey2 });
1042
+ return keyAuthorization(auth, {
1043
+ accessKey: { ...accessKey2, account: key.accessKey }
1044
+ });
1045
+ })();
1042
1046
  const url = new URL("/oauth2/authorize", auth.url);
1043
1047
  const parameters = new URLSearchParams({
1044
1048
  ...options.challenge === void 0 ? {} : { challenge: options.challenge },
@@ -1095,23 +1099,39 @@ function request(auth, options) {
1095
1099
  };
1096
1100
  }
1097
1101
  function keyAuthorization(auth, options) {
1098
- const { account: signer } = options.accessKey;
1099
- const permissions2 = resolve2(options.accessKey, {
1102
+ const { accessKey: accessKey2 } = options;
1103
+ const permissions2 = resolve2(accessKey2, {
1100
1104
  chainId: auth.chainId
1101
1105
  });
1102
- const account2 = options.account ?? (signer.accessKeyAddress ? signer.address : void 0);
1106
+ const named = (() => {
1107
+ if ("address" in accessKey2)
1108
+ return {
1109
+ account: options.account ?? accessKey2.access,
1110
+ address: accessKey2.address,
1111
+ keyType: accessKey2.type ?? "secp256k1",
1112
+ witness: accessKey2.witness
1113
+ };
1114
+ const { account: signer } = accessKey2;
1115
+ return {
1116
+ account: options.account ?? (signer.accessKeyAddress ? signer.address : void 0),
1117
+ address: signer.accessKeyAddress ?? signer.address,
1118
+ keyType: signer.keyType,
1119
+ witness: void 0
1120
+ };
1121
+ })();
1103
1122
  return {
1104
- ...account2 ? { account: account2 } : {},
1105
- address: signer.accessKeyAddress ?? signer.address,
1123
+ ...named.account ? { account: named.account } : {},
1124
+ address: named.address,
1106
1125
  chainId: Hex2.fromNumber(permissions2.chainId),
1107
1126
  expiry: permissions2.expiry,
1108
- keyType: signer.keyType,
1127
+ keyType: named.keyType,
1109
1128
  limits: permissions2.limits?.map(({ limit, period, token: token2 }) => ({
1110
1129
  limit: Hex2.fromNumber(limit),
1111
1130
  ...period ? { period } : {},
1112
1131
  token: token2
1113
1132
  })),
1114
- scopes: permissions2.scopes
1133
+ scopes: permissions2.scopes,
1134
+ ...named.witness ? { witness: named.witness } : {}
1115
1135
  };
1116
1136
  }
1117
1137
  function funding(options) {
@@ -1800,7 +1820,7 @@ async function open(auth, options) {
1800
1820
  throw new OriginError({ origin: window.location.origin, redirectUri });
1801
1821
  if (mode === "popup" && options.mode !== "popup" && !activated()) {
1802
1822
  const address2 = await abortable(read2(), { signal });
1803
- const Sheet = await import("./Sheet-NWJMJ4Y6.js");
1823
+ const Sheet = await import("./Sheet-CT6VA4S7.js");
1804
1824
  return await new Promise((resolve3, reject) => {
1805
1825
  const abort = () => {
1806
1826
  close();
@@ -1851,7 +1871,7 @@ async function watch(auth, options) {
1851
1871
  try {
1852
1872
  return await new Promise(
1853
1873
  (resolve3, reject) => {
1854
- void import("./Sheet-NWJMJ4Y6.js").then(
1874
+ void import("./Sheet-CT6VA4S7.js").then(
1855
1875
  (Sheet) => {
1856
1876
  if (settled) return;
1857
1877
  unblock = Sheet.waiting({
@@ -1916,7 +1936,7 @@ function parse(url, options) {
1916
1936
  async function frame(auth, options) {
1917
1937
  const { redirectUri, signal, toUrl } = options;
1918
1938
  const address2 = await abortable(options.address, { signal });
1919
- const Sheet = await import("./Sheet-NWJMJ4Y6.js");
1939
+ const Sheet = await import("./Sheet-CT6VA4S7.js");
1920
1940
  signal?.throwIfAborted();
1921
1941
  let close;
1922
1942
  let abort;
@@ -2084,7 +2104,7 @@ function complete3(auth, options = {}) {
2084
2104
  removed
2085
2105
  ]);
2086
2106
  return finish({
2087
- accessKey: own(options.accessKey),
2107
+ accessKey: options.accessKey,
2088
2108
  body,
2089
2109
  pending: stored
2090
2110
  });
@@ -2097,7 +2117,7 @@ async function createUrl(auth, options = {}) {
2097
2117
  }
2098
2118
  async function handleCallback(auth, options) {
2099
2119
  return finish({
2100
- accessKey: own(options.accessKey),
2120
+ accessKey: options.accessKey,
2101
2121
  body: await redeem(auth, {
2102
2122
  pending: options.pending,
2103
2123
  url: new URL(options.url)
@@ -2126,7 +2146,7 @@ function handleResult(options) {
2126
2146
  status: 400
2127
2147
  });
2128
2148
  return finish({
2129
- accessKey: own(options.accessKey),
2149
+ accessKey: options.accessKey,
2130
2150
  body: authorization2,
2131
2151
  pending: options.pending
2132
2152
  });
@@ -2204,13 +2224,24 @@ function finish(options) {
2204
2224
  signedIn: true,
2205
2225
  status: 400
2206
2226
  });
2227
+ if (options.accessKey && "address" in options.accessKey) {
2228
+ const tokens3 = tokens(body);
2229
+ return {
2230
+ ...tokens3,
2231
+ key: from({
2232
+ account: body.account,
2233
+ keyAuthorization: body.key_authorization
2234
+ }),
2235
+ user: user(tokens3)
2236
+ };
2237
+ }
2207
2238
  return authorization(
2208
2239
  {
2209
2240
  account: body.account,
2210
2241
  key_authorization: body.key_authorization,
2211
2242
  tokens: body
2212
2243
  },
2213
- { accessKey: options.accessKey, material }
2244
+ { accessKey: own(options.accessKey), material }
2214
2245
  );
2215
2246
  }
2216
2247
  async function prefetch(auth) {
@@ -4936,7 +4967,7 @@ var signInIds = /* @__PURE__ */ new Set([
4936
4967
  function plugin() {
4937
4968
  let loading;
4938
4969
  function load() {
4939
- loading ??= import("./dialog-YGV3SM4O.js").then((module) => module.dialog()).catch((error3) => {
4970
+ loading ??= import("./dialog-Q3USRJTG.js").then((module) => module.dialog()).catch((error3) => {
4940
4971
  loading = void 0;
4941
4972
  throw error3;
4942
4973
  });
@@ -5433,7 +5464,7 @@ function create5(options = {}) {
5433
5464
  function connections2() {
5434
5465
  if (!connectionsOptions)
5435
5466
  return Promise.reject(new ConnectionsRequiredError());
5436
- attached ??= import("./Connections-FMSXLTDQ.js").then(
5467
+ attached ??= import("./Connections-72NVXTIA.js").then(
5437
5468
  (module) => module.attach(config, connectionsOptions)
5438
5469
  );
5439
5470
  return attached;
@@ -2,7 +2,7 @@ import {
2
2
  AccessKey_exports,
3
3
  Accounts_exports,
4
4
  Actions_exports
5
- } from "./chunk-OWN434NG.js";
5
+ } from "./chunk-TCCWJ2TN.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-SQYUAMGZ.js";
5
- import "../chunk-IVSEEABZ.js";
6
- import "../chunk-OWN434NG.js";
4
+ } from "../chunk-UBMFGLY4.js";
5
+ import "../chunk-7EY47TSI.js";
6
+ import "../chunk-TCCWJ2TN.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-SQYUAMGZ.js";
5
- import "../chunk-IVSEEABZ.js";
6
- import "../chunk-OWN434NG.js";
4
+ } from "../chunk-UBMFGLY4.js";
5
+ import "../chunk-7EY47TSI.js";
6
+ import "../chunk-TCCWJ2TN.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-SQYUAMGZ.js";
6
- import "../chunk-IVSEEABZ.js";
7
- import "../chunk-OWN434NG.js";
5
+ } from "../chunk-UBMFGLY4.js";
6
+ import "../chunk-7EY47TSI.js";
7
+ import "../chunk-TCCWJ2TN.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-OWN434NG.js";
7
+ } from "./chunk-TCCWJ2TN.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-670.sha-a9bc8ec",
12
+ "version": "0.0.0-pr-723.sha-e7399b4",
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": {