@tempoxyz/id 0.0.0-pr-682.sha-b7dad3f → 0.0.0-pr-683.sha-ac06cf1
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/{Connections-PATZBG2T.js → Connections-E4FRZV7E.js} +2 -2
- package/dist/{Sheet-M7HBJDX7.js → Sheet-HSPYTT5H.js} +1 -1
- package/dist/{chunk-ETZ5GMXY.js → chunk-GG25UBDV.js} +73 -99
- package/dist/{chunk-5CPFER3V.js → chunk-J4QY2QEZ.js} +1 -1
- package/dist/{chunk-3ITS3YGB.js → chunk-U4EJZKQQ.js} +1 -1
- package/dist/commands/login.js +3 -3
- package/dist/commands/logout.js +3 -3
- package/dist/commands/whoami.js +3 -3
- package/dist/{dialog-LRPUKVRZ.js → dialog-TS2A3CU7.js} +1 -1
- package/package.json +1 -1
|
@@ -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-
|
|
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-
|
|
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-
|
|
1777
|
+
const Sheet = await import("./Sheet-HSPYTT5H.js");
|
|
1778
1778
|
signal?.throwIfAborted();
|
|
1779
1779
|
let close;
|
|
1780
1780
|
let abort;
|
|
@@ -2694,70 +2694,6 @@ import {
|
|
|
2694
2694
|
Credential,
|
|
2695
2695
|
Registration
|
|
2696
2696
|
} from "ox/webauthn";
|
|
2697
|
-
|
|
2698
|
-
// ../../accounts/src/internal/SignIn.ts
|
|
2699
|
-
import { KeyAuthorization as KeyAuthorization2 } from "ox/tempo";
|
|
2700
|
-
|
|
2701
|
-
// ../../accounts/src/Session.ts
|
|
2702
|
-
function from4(value) {
|
|
2703
|
-
return value;
|
|
2704
|
-
}
|
|
2705
|
-
function expired2(session2) {
|
|
2706
|
-
if (session2.key) return expired(session2.key);
|
|
2707
|
-
return !session2.refreshToken && session2.expiresAt <= Date.now();
|
|
2708
|
-
}
|
|
2709
|
-
|
|
2710
|
-
// ../../accounts/src/internal/SignIn.ts
|
|
2711
|
-
function accessKey(context, value) {
|
|
2712
|
-
if (value === false) return void 0;
|
|
2713
|
-
if (typeof value === "function") return value();
|
|
2714
|
-
if (value) return value;
|
|
2715
|
-
return context.accessKey();
|
|
2716
|
-
}
|
|
2717
|
-
function toSession(result) {
|
|
2718
|
-
return from4({
|
|
2719
|
-
accessToken: result.accessToken,
|
|
2720
|
-
...result.account ? { account: result.account } : {},
|
|
2721
|
-
expiresAt: result.expiresAt,
|
|
2722
|
-
...result.idToken !== void 0 ? { idToken: result.idToken } : {},
|
|
2723
|
-
...result.key ? { key: withLifetime(result.key) } : {},
|
|
2724
|
-
...result.refreshToken !== void 0 ? { refreshToken: result.refreshToken } : {},
|
|
2725
|
-
user: result.user
|
|
2726
|
-
});
|
|
2727
|
-
}
|
|
2728
|
-
function withLifetime(key) {
|
|
2729
|
-
const { expiry } = KeyAuthorization2.fromRpc(key.keyAuthorization);
|
|
2730
|
-
if (!expiry) return key;
|
|
2731
|
-
return { ...key, lifetime: expiry - Math.floor(Date.now() / 1e3) };
|
|
2732
|
-
}
|
|
2733
|
-
async function account(config, options) {
|
|
2734
|
-
const listed = await (async () => {
|
|
2735
|
-
try {
|
|
2736
|
-
return await json(
|
|
2737
|
-
await (config.fetch ?? fetch)(
|
|
2738
|
-
new URL(
|
|
2739
|
-
`/v1/account?${new URLSearchParams({ chain: String(config.chainId), client_id: config.clientId })}`,
|
|
2740
|
-
config.url
|
|
2741
|
-
),
|
|
2742
|
-
{ credentials: "include" }
|
|
2743
|
-
)
|
|
2744
|
-
);
|
|
2745
|
-
} catch (error3) {
|
|
2746
|
-
if (unlisted(error3, { field: "chain" })) return void 0;
|
|
2747
|
-
return signedIn(error3, {
|
|
2748
|
-
message: "The account read failed after the sign-in, with no response from Tempo ID. The user is signed in, so sign in again."
|
|
2749
|
-
});
|
|
2750
|
-
}
|
|
2751
|
-
})();
|
|
2752
|
-
if (!listed || listed.id !== options.userId) return void 0;
|
|
2753
|
-
const [first] = listed.tempo;
|
|
2754
|
-
return first && tempoAccount(first, { getFn: options.getFn });
|
|
2755
|
-
}
|
|
2756
|
-
function unlisted(error3, options) {
|
|
2757
|
-
return error3 instanceof RequestError && error3.reason === "invalid_field" && error3.field === options.field;
|
|
2758
|
-
}
|
|
2759
|
-
|
|
2760
|
-
// ../../accounts/src/actions/passkey.ts
|
|
2761
2697
|
async function available(auth) {
|
|
2762
2698
|
const response = await (auth.fetch ?? fetch)(
|
|
2763
2699
|
new URL(
|
|
@@ -2956,47 +2892,21 @@ async function sign2(prepared, options) {
|
|
|
2956
2892
|
}
|
|
2957
2893
|
async function verify(auth, options) {
|
|
2958
2894
|
const { assertion, prepared } = options;
|
|
2959
|
-
const
|
|
2960
|
-
const chain = requested?.chain ?? requested?.chainId;
|
|
2961
|
-
const send2 = async (withAccount) => read(
|
|
2895
|
+
const body = await read(
|
|
2962
2896
|
await post(auth, "/v1/auth/passkey/verify", {
|
|
2963
2897
|
// The prepared authorization's code redeems in the same request.
|
|
2964
2898
|
headers: await redemption(auth),
|
|
2965
|
-
json: {
|
|
2966
|
-
...withAccount ? {
|
|
2967
|
-
account: {
|
|
2968
|
-
...chain !== void 0 ? { chain } : {},
|
|
2969
|
-
client_id: auth.clientId
|
|
2970
|
-
}
|
|
2971
|
-
} : {},
|
|
2972
|
-
assertion
|
|
2973
|
-
}
|
|
2899
|
+
json: { assertion }
|
|
2974
2900
|
})
|
|
2975
2901
|
);
|
|
2976
|
-
const { body, unlisted: unlisted2 } = await (async () => {
|
|
2977
|
-
try {
|
|
2978
|
-
return { body: await send2(requested !== void 0), unlisted: false };
|
|
2979
|
-
} catch (error3) {
|
|
2980
|
-
if (!requested || !(error3 instanceof RequestError) || error3.signedIn || !unlisted(error3, { field: "account.chain" }))
|
|
2981
|
-
throw error3;
|
|
2982
|
-
return { body: await send2(false), unlisted: true };
|
|
2983
|
-
}
|
|
2984
|
-
})();
|
|
2985
2902
|
if ("step" in body)
|
|
2986
2903
|
return { step: { link: body.step.link, type: body.step.type } };
|
|
2987
|
-
|
|
2904
|
+
return await complete(auth, {
|
|
2988
2905
|
authorize: prepared.authorize,
|
|
2989
2906
|
body,
|
|
2990
2907
|
key: prepared.key,
|
|
2991
2908
|
request: prepared.request
|
|
2992
2909
|
});
|
|
2993
|
-
if (unlisted2) return { ...authorization2, account: void 0 };
|
|
2994
|
-
if (!requested || !body.tempo) return authorization2;
|
|
2995
|
-
const [first] = body.tempo;
|
|
2996
|
-
return {
|
|
2997
|
-
...authorization2,
|
|
2998
|
-
account: first ? tempoAccount(first, { getFn: requested.getFn }) : void 0
|
|
2999
|
-
};
|
|
3000
2910
|
}
|
|
3001
2911
|
|
|
3002
2912
|
// ../../accounts/src/actions/realm.ts
|
|
@@ -3116,6 +3026,70 @@ function thirdParty(clientId) {
|
|
|
3116
3026
|
// ../../accounts/src/internal/Core.ts
|
|
3117
3027
|
import { Address as Address4 } from "ox";
|
|
3118
3028
|
import { KeyAuthorization as KeyAuthorization3 } from "ox/tempo";
|
|
3029
|
+
|
|
3030
|
+
// ../../accounts/src/internal/SignIn.ts
|
|
3031
|
+
import { KeyAuthorization as KeyAuthorization2 } from "ox/tempo";
|
|
3032
|
+
|
|
3033
|
+
// ../../accounts/src/Session.ts
|
|
3034
|
+
function from4(value) {
|
|
3035
|
+
return value;
|
|
3036
|
+
}
|
|
3037
|
+
function expired2(session2) {
|
|
3038
|
+
if (session2.key) return expired(session2.key);
|
|
3039
|
+
return !session2.refreshToken && session2.expiresAt <= Date.now();
|
|
3040
|
+
}
|
|
3041
|
+
|
|
3042
|
+
// ../../accounts/src/internal/SignIn.ts
|
|
3043
|
+
function accessKey(context, value) {
|
|
3044
|
+
if (value === false) return void 0;
|
|
3045
|
+
if (typeof value === "function") return value();
|
|
3046
|
+
if (value) return value;
|
|
3047
|
+
return context.accessKey();
|
|
3048
|
+
}
|
|
3049
|
+
function toSession(result) {
|
|
3050
|
+
return from4({
|
|
3051
|
+
accessToken: result.accessToken,
|
|
3052
|
+
...result.account ? { account: result.account } : {},
|
|
3053
|
+
expiresAt: result.expiresAt,
|
|
3054
|
+
...result.idToken !== void 0 ? { idToken: result.idToken } : {},
|
|
3055
|
+
...result.key ? { key: withLifetime(result.key) } : {},
|
|
3056
|
+
...result.refreshToken !== void 0 ? { refreshToken: result.refreshToken } : {},
|
|
3057
|
+
user: result.user
|
|
3058
|
+
});
|
|
3059
|
+
}
|
|
3060
|
+
function withLifetime(key) {
|
|
3061
|
+
const { expiry } = KeyAuthorization2.fromRpc(key.keyAuthorization);
|
|
3062
|
+
if (!expiry) return key;
|
|
3063
|
+
return { ...key, lifetime: expiry - Math.floor(Date.now() / 1e3) };
|
|
3064
|
+
}
|
|
3065
|
+
async function account(config, options) {
|
|
3066
|
+
const listed = await (async () => {
|
|
3067
|
+
try {
|
|
3068
|
+
return await json(
|
|
3069
|
+
await (config.fetch ?? fetch)(
|
|
3070
|
+
new URL(
|
|
3071
|
+
`/v1/account?${new URLSearchParams({ chain: String(config.chainId), client_id: config.clientId })}`,
|
|
3072
|
+
config.url
|
|
3073
|
+
),
|
|
3074
|
+
{ credentials: "include" }
|
|
3075
|
+
)
|
|
3076
|
+
);
|
|
3077
|
+
} catch (error3) {
|
|
3078
|
+
if (unlisted(error3, { field: "chain" })) return void 0;
|
|
3079
|
+
return signedIn(error3, {
|
|
3080
|
+
message: "The account read failed after the sign-in, with no response from Tempo ID. The user is signed in, so sign in again."
|
|
3081
|
+
});
|
|
3082
|
+
}
|
|
3083
|
+
})();
|
|
3084
|
+
if (!listed || listed.id !== options.userId) return void 0;
|
|
3085
|
+
const [first] = listed.tempo;
|
|
3086
|
+
return first && tempoAccount(first, { getFn: options.getFn });
|
|
3087
|
+
}
|
|
3088
|
+
function unlisted(error3, options) {
|
|
3089
|
+
return error3 instanceof RequestError && error3.reason === "invalid_field" && error3.field === options.field;
|
|
3090
|
+
}
|
|
3091
|
+
|
|
3092
|
+
// ../../accounts/src/internal/Core.ts
|
|
3119
3093
|
function authorize5(context, options = {}) {
|
|
3120
3094
|
return context.session.authorize(() => run(context, options));
|
|
3121
3095
|
}
|
|
@@ -3332,7 +3306,7 @@ var signInIds = /* @__PURE__ */ new Set([
|
|
|
3332
3306
|
function plugin() {
|
|
3333
3307
|
let loading;
|
|
3334
3308
|
function load() {
|
|
3335
|
-
loading ??= import("./dialog-
|
|
3309
|
+
loading ??= import("./dialog-TS2A3CU7.js").then((module) => module.dialog()).catch((error3) => {
|
|
3336
3310
|
loading = void 0;
|
|
3337
3311
|
throw error3;
|
|
3338
3312
|
});
|
|
@@ -4540,7 +4514,7 @@ function create4(options = {}) {
|
|
|
4540
4514
|
function connections2() {
|
|
4541
4515
|
if (!connectionsOptions)
|
|
4542
4516
|
return Promise.reject(new ConnectionsRequiredError());
|
|
4543
|
-
attached ??= import("./Connections-
|
|
4517
|
+
attached ??= import("./Connections-E4FRZV7E.js").then(
|
|
4544
4518
|
(module) => module.attach(config, connectionsOptions)
|
|
4545
4519
|
);
|
|
4546
4520
|
return attached;
|
|
@@ -5616,10 +5590,10 @@ export {
|
|
|
5616
5590
|
frame2 as frame,
|
|
5617
5591
|
machines3 as machines,
|
|
5618
5592
|
dialog_exports,
|
|
5593
|
+
Actions_exports,
|
|
5619
5594
|
expired2,
|
|
5620
5595
|
accessKey,
|
|
5621
5596
|
toSession,
|
|
5622
|
-
Actions_exports,
|
|
5623
5597
|
from5 as from2,
|
|
5624
5598
|
PendingNotFoundError,
|
|
5625
5599
|
RequestError,
|
package/dist/commands/login.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
env,
|
|
3
3
|
login
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
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
|
|
package/dist/commands/logout.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
env,
|
|
3
3
|
remove
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
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
|
|
package/dist/commands/whoami.js
CHANGED
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
env,
|
|
3
3
|
signedOut,
|
|
4
4
|
whoami
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
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
|
|
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-
|
|
12
|
+
"version": "0.0.0-pr-683.sha-ac06cf1",
|
|
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": {
|