@tempoxyz/auth 0.0.0-pr-87.sha-6c738f4 → 0.0.0-pr-87.sha-acd2cc7
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/TempoAccount.d.ts +13 -1
- package/dist/TempoAccount.js +5 -1
- package/dist/internal/api.d.ts +5 -1
- package/dist/internal/api.js +2 -1
- package/package.json +1 -1
package/dist/TempoAccount.d.ts
CHANGED
|
@@ -12,13 +12,25 @@ export type TempoAccount = {
|
|
|
12
12
|
* that may refuse a key authorization.
|
|
13
13
|
*/
|
|
14
14
|
owner: 'privy' | 'webAuthn' | (string & {});
|
|
15
|
+
/**
|
|
16
|
+
* The realm the account belongs to: `default`, or one the app's settings name, such as
|
|
17
|
+
* `tempo-cash`, with its display name. An app reaches only the accounts of its realms.
|
|
18
|
+
*/
|
|
19
|
+
realm: {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
};
|
|
15
23
|
};
|
|
16
24
|
/**
|
|
17
25
|
* Instantiates a {@link TempoAccount}.
|
|
18
26
|
*
|
|
19
27
|
* @example
|
|
20
28
|
* ```ts
|
|
21
|
-
* const tempoAccount = TempoAccount.from({
|
|
29
|
+
* const tempoAccount = TempoAccount.from({
|
|
30
|
+
* address: '0x…',
|
|
31
|
+
* owner: 'privy',
|
|
32
|
+
* realm: { id: 'default', name: 'Tempo' },
|
|
33
|
+
* })
|
|
22
34
|
* ```
|
|
23
35
|
*/
|
|
24
36
|
export declare function from(value: TempoAccount): TempoAccount;
|
package/dist/TempoAccount.js
CHANGED
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @example
|
|
5
5
|
* ```ts
|
|
6
|
-
* const tempoAccount = TempoAccount.from({
|
|
6
|
+
* const tempoAccount = TempoAccount.from({
|
|
7
|
+
* address: '0x…',
|
|
8
|
+
* owner: 'privy',
|
|
9
|
+
* realm: { id: 'default', name: 'Tempo' },
|
|
10
|
+
* })
|
|
7
11
|
* ```
|
|
8
12
|
*/
|
|
9
13
|
export function from(value) {
|
package/dist/internal/api.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ export declare function post(auth: Auth, path: string, options: {
|
|
|
52
52
|
* OAuth form posts to WorkOS.
|
|
53
53
|
*/
|
|
54
54
|
export declare function token(auth: Auth, body: Record<string, string>): Promise<TokenResponse>;
|
|
55
|
-
/** Reads the account's address
|
|
55
|
+
/** Reads the account's address, the type of its owner, which the API lists first, and its realm. */
|
|
56
56
|
export declare function tempoAccount(account: TempoAccountResponse): TempoAccount;
|
|
57
57
|
/** A Tempo Account as the API returns it, with the fields the package reads. */
|
|
58
58
|
export type TempoAccountResponse = {
|
|
@@ -64,6 +64,10 @@ export type TempoAccountResponse = {
|
|
|
64
64
|
type: string;
|
|
65
65
|
}[]];
|
|
66
66
|
};
|
|
67
|
+
realm: {
|
|
68
|
+
id: string;
|
|
69
|
+
name: string;
|
|
70
|
+
};
|
|
67
71
|
};
|
|
68
72
|
/** What Tempo Auth's token endpoint returns. Redeeming a redirect's code adds its key authorization. */
|
|
69
73
|
export type TokenResponse = {
|
package/dist/internal/api.js
CHANGED
|
@@ -71,11 +71,12 @@ export async function token(auth, body) {
|
|
|
71
71
|
method: 'POST',
|
|
72
72
|
}));
|
|
73
73
|
}
|
|
74
|
-
/** Reads the account's address
|
|
74
|
+
/** Reads the account's address, the type of its owner, which the API lists first, and its realm. */
|
|
75
75
|
export function tempoAccount(account) {
|
|
76
76
|
return {
|
|
77
77
|
address: account.address,
|
|
78
78
|
owner: account.config.owners[0].type,
|
|
79
|
+
realm: { id: account.realm.id, name: account.realm.name },
|
|
79
80
|
};
|
|
80
81
|
}
|
|
81
82
|
/** Reads a token response into `Tokens`. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tempoxyz/auth",
|
|
3
|
-
"version": "0.0.0-pr-87.sha-
|
|
3
|
+
"version": "0.0.0-pr-87.sha-acd2cc7",
|
|
4
4
|
"description": "Signs users in to Tempo through Tempo Auth, and returns Viem access key accounts on their Tempo Accounts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|