@cubist-labs/cubesigner-sdk 0.4.263 → 0.4.266
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/package.json +12 -4
- package/dist/src/acl.js +1 -2
- package/dist/src/audit_log.d.ts +4 -4
- package/dist/src/audit_log.js +116 -119
- package/dist/src/bucket.d.ts +2 -2
- package/dist/src/bucket.d.ts.map +1 -1
- package/dist/src/bucket.js +2 -5
- package/dist/src/client/api_client.d.ts +16 -12
- package/dist/src/client/api_client.d.ts.map +1 -1
- package/dist/src/client/api_client.js +288 -292
- package/dist/src/client/base_client.d.ts +6 -6
- package/dist/src/client/base_client.d.ts.map +1 -1
- package/dist/src/client/base_client.js +27 -38
- package/dist/src/client/session.d.ts +2 -2
- package/dist/src/client/session.d.ts.map +1 -1
- package/dist/src/client/session.js +20 -35
- package/dist/src/client.d.ts +18 -18
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/client.js +14 -18
- package/dist/src/contact.d.ts +3 -3
- package/dist/src/contact.d.ts.map +1 -1
- package/dist/src/contact.js +4 -8
- package/dist/src/diffie_hellman.d.ts +1 -1
- package/dist/src/diffie_hellman.d.ts.map +1 -1
- package/dist/src/diffie_hellman.js +9 -12
- package/dist/src/env.js +13 -20
- package/dist/src/error.d.ts +2 -2
- package/dist/src/error.d.ts.map +1 -1
- package/dist/src/error.js +3 -8
- package/dist/src/events.js +2 -6
- package/dist/src/evm/index.d.ts +1 -1
- package/dist/src/evm/index.d.ts.map +1 -1
- package/dist/src/evm/index.js +5 -9
- package/dist/src/fetch.d.ts +1 -1
- package/dist/src/fetch.d.ts.map +1 -1
- package/dist/src/fetch.js +10 -15
- package/dist/src/index.d.ts +24 -24
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +25 -48
- package/dist/src/key.d.ts +10 -8
- package/dist/src/key.d.ts.map +1 -1
- package/dist/src/key.js +35 -34
- package/dist/src/mfa.d.ts +2 -2
- package/dist/src/mfa.d.ts.map +1 -1
- package/dist/src/mfa.js +14 -25
- package/dist/src/org.d.ts +197 -197
- package/dist/src/org.d.ts.map +1 -1
- package/dist/src/org.js +28 -32
- package/dist/src/paginator.js +3 -8
- package/dist/src/passkey.d.ts +1 -1
- package/dist/src/passkey.d.ts.map +1 -1
- package/dist/src/passkey.js +16 -23
- package/dist/src/policy.d.ts +1 -1
- package/dist/src/policy.d.ts.map +1 -1
- package/dist/src/policy.js +17 -27
- package/dist/src/response.d.ts +16 -7
- package/dist/src/response.d.ts.map +1 -1
- package/dist/src/response.js +42 -21
- package/dist/src/retry.d.ts.map +1 -1
- package/dist/src/retry.js +5 -11
- package/dist/src/role.d.ts +3 -3
- package/dist/src/role.d.ts.map +1 -1
- package/dist/src/role.js +13 -18
- package/dist/src/schema.d.ts +117 -40
- package/dist/src/schema.d.ts.map +1 -1
- package/dist/src/schema.js +2 -3
- package/dist/src/schema_types.d.ts +6 -3
- package/dist/src/schema_types.d.ts.map +1 -1
- package/dist/src/schema_types.js +11 -7
- package/dist/src/scopes.d.ts +1 -1
- package/dist/src/scopes.d.ts.map +1 -1
- package/dist/src/scopes.js +19 -21
- package/dist/src/signer_session.d.ts +1 -1
- package/dist/src/signer_session.d.ts.map +1 -1
- package/dist/src/signer_session.js +2 -6
- package/dist/src/user_export.d.ts +1 -1
- package/dist/src/user_export.d.ts.map +1 -1
- package/dist/src/user_export.js +10 -18
- package/dist/src/util.js +9 -19
- package/package.json +12 -4
- package/src/audit_log.ts +1 -1
- package/src/bucket.ts +2 -2
- package/src/client/api_client.ts +25 -19
- package/src/client/base_client.ts +10 -10
- package/src/client/session.ts +4 -4
- package/src/client.ts +12 -6
- package/src/contact.ts +3 -3
- package/src/diffie_hellman.ts +3 -3
- package/src/env.ts +3 -3
- package/src/error.ts +2 -2
- package/src/evm/index.ts +1 -1
- package/src/fetch.ts +3 -3
- package/src/index.ts +29 -24
- package/src/key.ts +16 -12
- package/src/mfa.ts +3 -3
- package/src/org.ts +4 -4
- package/src/passkey.ts +1 -1
- package/src/policy.ts +2 -2
- package/src/response.ts +57 -12
- package/src/role.ts +3 -3
- package/src/schema.ts +110 -23
- package/src/schema_types.ts +14 -3
- package/src/scopes.ts +2 -1
- package/src/signer_session.ts +1 -1
- package/src/user_export.ts +2 -2
- package/tsconfig.json +12 -0
package/src/response.ts
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
import type { MfaVote, EnvInterface, MfaReceipts, MfaRequired } from ".";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { MfaVote, EnvInterface, MfaReceipts, MfaRequired } from "./index.ts";
|
|
2
|
+
import {
|
|
3
|
+
ALL_ACCEPTED_CODES,
|
|
4
|
+
CubeSignerClient,
|
|
5
|
+
ErrResponse,
|
|
6
|
+
MultiRegionEnv,
|
|
7
|
+
isManyMfaReceipts,
|
|
8
|
+
} from "./index.ts";
|
|
9
|
+
import { encodeToBase64Url } from "./util.ts";
|
|
10
|
+
import type {
|
|
11
|
+
AcceptedResponse,
|
|
12
|
+
AcceptedValue,
|
|
13
|
+
SignDryRun,
|
|
14
|
+
JsonRpcResponse,
|
|
15
|
+
JsonRpcResult,
|
|
16
|
+
ErrorResponse,
|
|
17
|
+
AcceptedValueCode,
|
|
18
|
+
} from "./schema_types.ts";
|
|
5
19
|
|
|
6
20
|
/**
|
|
7
21
|
* Response type, which can be either a value of type {@link U}
|
|
@@ -42,7 +56,7 @@ export function mapResponse<U, V>(resp: Response<U>, mapFn: MapFn<U, V>): Respon
|
|
|
42
56
|
*/
|
|
43
57
|
function asAccepted<U>(resp: Response<U>): AcceptedValue | undefined {
|
|
44
58
|
const acceptedResp = resp as AcceptedResponse;
|
|
45
|
-
return
|
|
59
|
+
return ALL_ACCEPTED_CODES.includes(acceptedResp.error_code as AcceptedValueCode)
|
|
46
60
|
? (acceptedResp.accepted ?? undefined)
|
|
47
61
|
: undefined;
|
|
48
62
|
}
|
|
@@ -76,13 +90,6 @@ export class CubeSignerResponse<U> {
|
|
|
76
90
|
return this.asAccepted()?.SignDryRun ?? undefined;
|
|
77
91
|
}
|
|
78
92
|
|
|
79
|
-
/**
|
|
80
|
-
* @returns The associated {@link BinanceDryRun} value, if the response status code is 202 and the response is a dry run of a sign operation.
|
|
81
|
-
*/
|
|
82
|
-
asBinanceDryRun(): BinanceDryRun | undefined {
|
|
83
|
-
return this.asAccepted()?.BinanceDryRun ?? undefined;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
93
|
/**
|
|
87
94
|
* @returns Whether this response is a "200 Success" (in which case it is safe to call {@link data})
|
|
88
95
|
*/
|
|
@@ -285,6 +292,44 @@ export class CubeSignerResponse<U> {
|
|
|
285
292
|
return new CubeSignerResponse(MultiRegionEnv.create(env), requestFn, seed);
|
|
286
293
|
}
|
|
287
294
|
|
|
295
|
+
/**
|
|
296
|
+
* Similar to {@link create} except that unwraps the {@link JsonRpcResponse}
|
|
297
|
+
* to throw an {@link ErrResponse} on error
|
|
298
|
+
*
|
|
299
|
+
* @param env The environment where the response comes from
|
|
300
|
+
* @param reqFn
|
|
301
|
+
* The request function that this response is from.
|
|
302
|
+
* This argument is used to resend requests with different headers if needed.
|
|
303
|
+
* @param mfaReceipt Optional MFA receipt(s)
|
|
304
|
+
* @returns New instance of this class.
|
|
305
|
+
* @internal
|
|
306
|
+
*/
|
|
307
|
+
static async createForJsonRpc(
|
|
308
|
+
env: EnvInterface | MultiRegionEnv,
|
|
309
|
+
reqFn: RequestFn<JsonRpcResponse>,
|
|
310
|
+
mfaReceipt?: MfaReceipts,
|
|
311
|
+
): Promise<CubeSignerResponse<JsonRpcResult>> {
|
|
312
|
+
const requestFn: RequestFn<JsonRpcResult> = async (headers) => {
|
|
313
|
+
const resp = await reqFn(headers);
|
|
314
|
+
if (resp.result) return resp.result;
|
|
315
|
+
const errResp = resp.error?.data as ErrorResponse | undefined;
|
|
316
|
+
|
|
317
|
+
// return AcceptedResponse if accepted
|
|
318
|
+
if (errResp?.accepted) {
|
|
319
|
+
return errResp;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// otherwise it's an error
|
|
323
|
+
throw new ErrResponse({
|
|
324
|
+
message: errResp?.message ?? resp.error?.message ?? "JSON-RPC error",
|
|
325
|
+
errorCode: errResp?.error_code,
|
|
326
|
+
requestId: errResp?.request_id,
|
|
327
|
+
});
|
|
328
|
+
};
|
|
329
|
+
const seed = await requestFn(this.getMfaHeaders(mfaReceipt));
|
|
330
|
+
return new CubeSignerResponse(MultiRegionEnv.create(env), requestFn, seed);
|
|
331
|
+
}
|
|
332
|
+
|
|
288
333
|
/**
|
|
289
334
|
* Return HTTP headers containing a given MFA receipt.
|
|
290
335
|
*
|
package/src/role.ts
CHANGED
|
@@ -20,12 +20,12 @@ import type {
|
|
|
20
20
|
EditPolicy,
|
|
21
21
|
MfaPolicy,
|
|
22
22
|
RoleInfoJwt,
|
|
23
|
-
} from ".";
|
|
24
|
-
import { Key, SignerSessionInfo } from ".";
|
|
23
|
+
} from "./index.ts";
|
|
24
|
+
import { Key, SignerSessionInfo } from "./index.ts";
|
|
25
25
|
|
|
26
26
|
// these types are used in doc comments only
|
|
27
27
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
28
|
-
import type { RoleAttestationClaims, RoleAttestationQuery } from "./schema_types";
|
|
28
|
+
import type { RoleAttestationClaims, RoleAttestationQuery } from "./schema_types.ts";
|
|
29
29
|
|
|
30
30
|
type NameOrAddressOrNull = string | null;
|
|
31
31
|
|
package/src/schema.ts
CHANGED
|
@@ -1320,6 +1320,12 @@ export interface paths {
|
|
|
1320
1320
|
*
|
|
1321
1321
|
* If a `role` query parameter is provided, all active sessions for the selected role are returned
|
|
1322
1322
|
* (asserting first that the current user has permissions to read sessions for that role).
|
|
1323
|
+
*
|
|
1324
|
+
* If a `role_created_by` query parameter is provided, all active **role** sessions created by that
|
|
1325
|
+
* user are returned (gated by the same permissions as listing that user's own sessions: the
|
|
1326
|
+
* current user must be that user or an org owner). When combined with `role`, the result is
|
|
1327
|
+
* further restricted to the sessions created by that user for the given role; the permission model
|
|
1328
|
+
* is unchanged. The `user` selector cannot be combined with `role` or `role_created_by`.
|
|
1323
1329
|
*/
|
|
1324
1330
|
get: operations["listSessions"];
|
|
1325
1331
|
/**
|
|
@@ -1350,6 +1356,14 @@ export interface paths {
|
|
|
1350
1356
|
* user is an org owner, only sessions for roles the current user is **still a member of** are
|
|
1351
1357
|
* revoked (so a user cannot revoke sessions for a role they have since been removed from); org
|
|
1352
1358
|
* owners revoke across all roles.
|
|
1359
|
+
*
|
|
1360
|
+
* If **both** a `role` and a `role_created_by` query parameter are provided, the selection above
|
|
1361
|
+
* is narrowed to only the sessions created by **THAT USER** for **THAT ROLE**. The permission
|
|
1362
|
+
* model is unchanged from the `role_created_by`-only case (the current user must be that user or
|
|
1363
|
+
* an org owner, and non-owners are still limited to roles they are a member of); `role` is purely
|
|
1364
|
+
* an additional filter.
|
|
1365
|
+
*
|
|
1366
|
+
* The `user` selector cannot be combined with `role` or `role_created_by`.
|
|
1353
1367
|
*/
|
|
1354
1368
|
delete: operations["revokeSessions"];
|
|
1355
1369
|
};
|
|
@@ -2949,6 +2963,7 @@ export interface components {
|
|
|
2949
2963
|
| "InvalidSolanaSignRequest"
|
|
2950
2964
|
| "InvalidEip712SignRequest"
|
|
2951
2965
|
| "OnlySpecifyOne"
|
|
2966
|
+
| "IncompatibleParams"
|
|
2952
2967
|
| "NoOidcDataInProof"
|
|
2953
2968
|
| "InvalidEvmSignRequest"
|
|
2954
2969
|
| "InvalidEth2SignRequest"
|
|
@@ -3257,6 +3272,7 @@ export interface components {
|
|
|
3257
3272
|
| "RpcCreateTransaction"
|
|
3258
3273
|
| "RpcGetTransaction"
|
|
3259
3274
|
| "RpcListTransactions"
|
|
3275
|
+
| "RpcBtcListUtxos"
|
|
3260
3276
|
| "RpcRetryTransaction"
|
|
3261
3277
|
| "RpcCancelTransaction"
|
|
3262
3278
|
| "RpcBinance"
|
|
@@ -3646,6 +3662,27 @@ export interface components {
|
|
|
3646
3662
|
/** @description Taproot-tagged hash with tag "TapLeaf". */
|
|
3647
3663
|
leaf_hash: string;
|
|
3648
3664
|
};
|
|
3665
|
+
/** @description Parameters for the [`cs_btcListUtxos`](CsRpc::BtcListUtxos) method. */
|
|
3666
|
+
BtcListUtxosRequest: {
|
|
3667
|
+
/** @description The Bitcoin address whose unspent outputs (UTXOs) are being queried. */
|
|
3668
|
+
address: string;
|
|
3669
|
+
/**
|
|
3670
|
+
* Format: int32
|
|
3671
|
+
* @description The maximum number of UTXOs to return (1-250).
|
|
3672
|
+
* @default 100
|
|
3673
|
+
*/
|
|
3674
|
+
max_results?: number;
|
|
3675
|
+
network: components["schemas"]["BtcNetwork"];
|
|
3676
|
+
/** @description Pagination token returned by a previous call. */
|
|
3677
|
+
next_token?: string | null;
|
|
3678
|
+
};
|
|
3679
|
+
/** @description The response to [`cs_btcListUtxos`](super::request::CsRpc::BtcListUtxos). */
|
|
3680
|
+
BtcListUtxosResponse: {
|
|
3681
|
+
/** @description Pagination token to pass to the next call, if more results remain. */
|
|
3682
|
+
next_token?: string | null;
|
|
3683
|
+
/** @description The unspent transaction outputs for the queried address. */
|
|
3684
|
+
utxos: components["schemas"]["BtcUtxo"][];
|
|
3685
|
+
};
|
|
3649
3686
|
/** @description Data to sign */
|
|
3650
3687
|
BtcMessageSignRequest: {
|
|
3651
3688
|
/** @description Do not produce a valid signature, just evaluate attached policies. */
|
|
@@ -3683,6 +3720,11 @@ export interface components {
|
|
|
3683
3720
|
/** @description The base64-encoded signature in BIP137 format. */
|
|
3684
3721
|
sig: string;
|
|
3685
3722
|
};
|
|
3723
|
+
/**
|
|
3724
|
+
* @description The Bitcoin network to query for UTXOs.
|
|
3725
|
+
* @enum {string}
|
|
3726
|
+
*/
|
|
3727
|
+
BtcNetwork: "mainnet" | "testnet";
|
|
3686
3728
|
/** @enum {string} */
|
|
3687
3729
|
BtcSighashType:
|
|
3688
3730
|
| "All"
|
|
@@ -3779,6 +3821,27 @@ export interface components {
|
|
|
3779
3821
|
*/
|
|
3780
3822
|
value: number;
|
|
3781
3823
|
};
|
|
3824
|
+
/** @description A single Bitcoin unspent transaction output (UTXO). */
|
|
3825
|
+
BtcUtxo: {
|
|
3826
|
+
/** @description The address that controls this output. */
|
|
3827
|
+
address?: string | null;
|
|
3828
|
+
/** @description Whether the output has reached finality (is confirmed). */
|
|
3829
|
+
confirmed: boolean;
|
|
3830
|
+
/**
|
|
3831
|
+
* Format: int64
|
|
3832
|
+
* @description The block time of the output, in seconds since the Unix epoch.
|
|
3833
|
+
*/
|
|
3834
|
+
time?: number | null;
|
|
3835
|
+
/** @description The hash of the transaction that created this output. */
|
|
3836
|
+
transaction_hash: string;
|
|
3837
|
+
/** @description The output value, in satoshis, as a decimal string. */
|
|
3838
|
+
value?: string | null;
|
|
3839
|
+
/**
|
|
3840
|
+
* Format: int32
|
|
3841
|
+
* @description The index of this output within its transaction.
|
|
3842
|
+
*/
|
|
3843
|
+
vout_index?: number | null;
|
|
3844
|
+
};
|
|
3782
3845
|
/**
|
|
3783
3846
|
* @description The access-controlled actions that can be performed on a bucket
|
|
3784
3847
|
* @enum {string}
|
|
@@ -4028,7 +4091,7 @@ export interface components {
|
|
|
4028
4091
|
};
|
|
4029
4092
|
/**
|
|
4030
4093
|
* @description Bybit-family RPC methods. Each variant authenticates as the
|
|
4031
|
-
* [`KeyType::
|
|
4094
|
+
* [`KeyType::HmacSha256Bybit`] key in its `params.key_id` (which must carry
|
|
4032
4095
|
* [`KeyProperties::BybitApi`]).
|
|
4033
4096
|
*/
|
|
4034
4097
|
BybitRpc:
|
|
@@ -5049,35 +5112,37 @@ export interface components {
|
|
|
5049
5112
|
options: components["schemas"]["PublicKeyCredentialCreationOptions"];
|
|
5050
5113
|
};
|
|
5051
5114
|
/** @description Core RPC methods (transaction CRUD). */
|
|
5052
|
-
CsRpc:
|
|
5053
|
-
|
|
5054
|
-
{
|
|
5115
|
+
CsRpc:
|
|
5116
|
+
| {
|
|
5055
5117
|
/** @enum {string} */
|
|
5056
5118
|
method: "cs_createTransaction";
|
|
5057
5119
|
params: components["schemas"]["CreateTransactionRequest"];
|
|
5058
|
-
}
|
|
5059
|
-
|
|
5120
|
+
}
|
|
5121
|
+
| {
|
|
5060
5122
|
/** @enum {string} */
|
|
5061
5123
|
method: "cs_retryTransaction";
|
|
5062
5124
|
params: components["schemas"]["RetryTransactionRequest"];
|
|
5063
|
-
}
|
|
5064
|
-
|
|
5125
|
+
}
|
|
5126
|
+
| {
|
|
5065
5127
|
/** @enum {string} */
|
|
5066
5128
|
method: "cs_cancelTransaction";
|
|
5067
5129
|
params: components["schemas"]["CancelTransactionRequest"];
|
|
5068
|
-
}
|
|
5069
|
-
|
|
5130
|
+
}
|
|
5131
|
+
| {
|
|
5070
5132
|
/** @enum {string} */
|
|
5071
5133
|
method: "cs_getTransaction";
|
|
5072
5134
|
params: components["schemas"]["GetTransactionRequest"];
|
|
5073
|
-
}
|
|
5074
|
-
|
|
5135
|
+
}
|
|
5136
|
+
| {
|
|
5075
5137
|
/** @enum {string} */
|
|
5076
5138
|
method: "cs_listTransactions";
|
|
5077
5139
|
params: components["schemas"]["ListTransactionsRequest"];
|
|
5078
|
-
}
|
|
5079
|
-
|
|
5080
|
-
|
|
5140
|
+
}
|
|
5141
|
+
| {
|
|
5142
|
+
/** @enum {string} */
|
|
5143
|
+
method: "cs_btcListUtxos";
|
|
5144
|
+
params: components["schemas"]["BtcListUtxosRequest"];
|
|
5145
|
+
};
|
|
5081
5146
|
CubeSignerUserInfo: {
|
|
5082
5147
|
/** @description All multi-factor authentication methods configured for this user */
|
|
5083
5148
|
configured_mfa: components["schemas"]["ConfiguredMfa"][];
|
|
@@ -6356,6 +6421,7 @@ export interface components {
|
|
|
6356
6421
|
| "rpc:cancelTransaction"
|
|
6357
6422
|
| "rpc:getTransaction"
|
|
6358
6423
|
| "rpc:listTransactions"
|
|
6424
|
+
| "rpc:btcListUtxos"
|
|
6359
6425
|
| "rpc:binance"
|
|
6360
6426
|
| "rpc:bybit"
|
|
6361
6427
|
| "rpc:coinbase";
|
|
@@ -6507,6 +6573,7 @@ export interface components {
|
|
|
6507
6573
|
| "SiweMessageNotValid"
|
|
6508
6574
|
| "SiweMessageInvalidSignature"
|
|
6509
6575
|
| "SiwsChallengeExpired"
|
|
6576
|
+
| "SiwsDomain"
|
|
6510
6577
|
| "SiwsMessageInvalid"
|
|
6511
6578
|
| "Acl";
|
|
6512
6579
|
/**
|
|
@@ -7068,7 +7135,8 @@ export interface components {
|
|
|
7068
7135
|
| components["schemas"]["BybitWithdrawalsResponse"]
|
|
7069
7136
|
| components["schemas"]["CoinbaseListAccountsResponse"]
|
|
7070
7137
|
| components["schemas"]["CoinbaseListPortfoliosResponse"]
|
|
7071
|
-
| components["schemas"]["CoinbaseMoveFundsResponse"]
|
|
7138
|
+
| components["schemas"]["CoinbaseMoveFundsResponse"]
|
|
7139
|
+
| components["schemas"]["BtcListUtxosResponse"];
|
|
7072
7140
|
JwkSetResponse: {
|
|
7073
7141
|
/** @description The keys included in this set */
|
|
7074
7142
|
keys: Record<string, never>[];
|
|
@@ -7268,7 +7336,8 @@ export interface components {
|
|
|
7268
7336
|
| "SecpXrpAddr"
|
|
7269
7337
|
| "Ed25519XrpAddr"
|
|
7270
7338
|
| "BabyJubjub"
|
|
7271
|
-
| "HmacSha256"
|
|
7339
|
+
| "HmacSha256"
|
|
7340
|
+
| "HmacSha256Bybit";
|
|
7272
7341
|
KeyTypeAndDerivationPath: {
|
|
7273
7342
|
/**
|
|
7274
7343
|
* @description List of derivation paths for which to derive.
|
|
@@ -7634,7 +7703,7 @@ export interface components {
|
|
|
7634
7703
|
* @example 1701879640
|
|
7635
7704
|
*/
|
|
7636
7705
|
expiration?: number;
|
|
7637
|
-
org_id
|
|
7706
|
+
org_id: components["schemas"]["Id"];
|
|
7638
7707
|
/** @description Token that can be used to refresh this session. */
|
|
7639
7708
|
refresh_token: string;
|
|
7640
7709
|
session_info: components["schemas"]["ClientSessionInfo"];
|
|
@@ -12502,7 +12571,7 @@ export interface components {
|
|
|
12502
12571
|
* @example 1701879640
|
|
12503
12572
|
*/
|
|
12504
12573
|
expiration?: number;
|
|
12505
|
-
org_id
|
|
12574
|
+
org_id: components["schemas"]["Id"];
|
|
12506
12575
|
/** @description Token that can be used to refresh this session. */
|
|
12507
12576
|
refresh_token: string;
|
|
12508
12577
|
session_info: components["schemas"]["ClientSessionInfo"];
|
|
@@ -18053,6 +18122,12 @@ export interface operations {
|
|
|
18053
18122
|
*
|
|
18054
18123
|
* If a `role` query parameter is provided, all active sessions for the selected role are returned
|
|
18055
18124
|
* (asserting first that the current user has permissions to read sessions for that role).
|
|
18125
|
+
*
|
|
18126
|
+
* If a `role_created_by` query parameter is provided, all active **role** sessions created by that
|
|
18127
|
+
* user are returned (gated by the same permissions as listing that user's own sessions: the
|
|
18128
|
+
* current user must be that user or an org owner). When combined with `role`, the result is
|
|
18129
|
+
* further restricted to the sessions created by that user for the given role; the permission model
|
|
18130
|
+
* is unchanged. The `user` selector cannot be combined with `role` or `role_created_by`.
|
|
18056
18131
|
*/
|
|
18057
18132
|
listSessions: {
|
|
18058
18133
|
parameters: {
|
|
@@ -18072,7 +18147,8 @@ export interface operations {
|
|
|
18072
18147
|
"page.start"?: string | null;
|
|
18073
18148
|
/**
|
|
18074
18149
|
* @description If provided, the name or ID of a role to operate on.
|
|
18075
|
-
* Cannot be specified together with
|
|
18150
|
+
* Cannot be specified together with `user`, but may be combined with `role_created_by`
|
|
18151
|
+
* to operate on the role sessions created by a given user for this specific role.
|
|
18076
18152
|
* @example my-role
|
|
18077
18153
|
*/
|
|
18078
18154
|
role?: string | null;
|
|
@@ -18085,7 +18161,8 @@ export interface operations {
|
|
|
18085
18161
|
/**
|
|
18086
18162
|
* @description If provided, the ID of the user whose created role sessions to operate on.
|
|
18087
18163
|
* Selects all *role* sessions created by that user (user sessions are not affected).
|
|
18088
|
-
* Cannot be specified together with
|
|
18164
|
+
* Cannot be specified together with `user`. When combined with `role`, the selection is
|
|
18165
|
+
* further restricted to the sessions created by that user for the given role.
|
|
18089
18166
|
* @example User#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
|
|
18090
18167
|
*/
|
|
18091
18168
|
role_created_by?: string | null;
|
|
@@ -18158,13 +18235,22 @@ export interface operations {
|
|
|
18158
18235
|
* user is an org owner, only sessions for roles the current user is **still a member of** are
|
|
18159
18236
|
* revoked (so a user cannot revoke sessions for a role they have since been removed from); org
|
|
18160
18237
|
* owners revoke across all roles.
|
|
18238
|
+
*
|
|
18239
|
+
* If **both** a `role` and a `role_created_by` query parameter are provided, the selection above
|
|
18240
|
+
* is narrowed to only the sessions created by **THAT USER** for **THAT ROLE**. The permission
|
|
18241
|
+
* model is unchanged from the `role_created_by`-only case (the current user must be that user or
|
|
18242
|
+
* an org owner, and non-owners are still limited to roles they are a member of); `role` is purely
|
|
18243
|
+
* an additional filter.
|
|
18244
|
+
*
|
|
18245
|
+
* The `user` selector cannot be combined with `role` or `role_created_by`.
|
|
18161
18246
|
*/
|
|
18162
18247
|
revokeSessions: {
|
|
18163
18248
|
parameters: {
|
|
18164
18249
|
query?: {
|
|
18165
18250
|
/**
|
|
18166
18251
|
* @description If provided, the name or ID of a role to operate on.
|
|
18167
|
-
* Cannot be specified together with
|
|
18252
|
+
* Cannot be specified together with `user`, but may be combined with `role_created_by`
|
|
18253
|
+
* to operate on the role sessions created by a given user for this specific role.
|
|
18168
18254
|
* @example my-role
|
|
18169
18255
|
*/
|
|
18170
18256
|
role?: string | null;
|
|
@@ -18177,7 +18263,8 @@ export interface operations {
|
|
|
18177
18263
|
/**
|
|
18178
18264
|
* @description If provided, the ID of the user whose created role sessions to operate on.
|
|
18179
18265
|
* Selects all *role* sessions created by that user (user sessions are not affected).
|
|
18180
|
-
* Cannot be specified together with
|
|
18266
|
+
* Cannot be specified together with `user`. When combined with `role`, the selection is
|
|
18267
|
+
* further restricted to the sessions created by that user for the given role.
|
|
18181
18268
|
* @example User#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
|
|
18182
18269
|
*/
|
|
18183
18270
|
role_created_by?: string | null;
|
package/src/schema_types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { components, operations, paths } from "./schema";
|
|
2
|
-
import type { JsonMap, JsonValue } from "./util";
|
|
1
|
+
import type { components, operations, paths } from "./schema.ts";
|
|
2
|
+
import type { JsonMap, JsonValue } from "./util.ts";
|
|
3
3
|
|
|
4
4
|
export type schemas = components["schemas"];
|
|
5
5
|
|
|
@@ -90,6 +90,16 @@ const AllOperationKinds: Record<OperationKind, true> = {
|
|
|
90
90
|
};
|
|
91
91
|
export const ALL_OPERATION_KINDS = Object.keys(AllOperationKinds) as readonly OperationKind[];
|
|
92
92
|
|
|
93
|
+
export type AcceptedValueCode = schemas["AcceptedValueCode"];
|
|
94
|
+
const AllAcceptedCodes: Record<AcceptedValueCode, true> = {
|
|
95
|
+
BinanceDryRun: true,
|
|
96
|
+
BybitDryRun: true,
|
|
97
|
+
CoinbaseDryRun: true,
|
|
98
|
+
MfaRequired: true,
|
|
99
|
+
SignDryRun: true,
|
|
100
|
+
};
|
|
101
|
+
export const ALL_ACCEPTED_CODES = Object.keys(AllAcceptedCodes) as readonly AcceptedValueCode[];
|
|
102
|
+
|
|
93
103
|
export type OrgData = schemas["OrgData"];
|
|
94
104
|
export type UserOrgsResponse = schemas["UserOrgsResponse"];
|
|
95
105
|
|
|
@@ -253,7 +263,7 @@ export type QueryMetricsRequest = schemas["QueryMetricsRequest"];
|
|
|
253
263
|
export type QueryMetricsResponse = schemas["QueryMetricsResponse"];
|
|
254
264
|
export type AuditLogRequest = schemas["AuditLogRequest"];
|
|
255
265
|
export type AuditLogResponse = schemas["PaginatedAuditLogResponse"];
|
|
256
|
-
export type { AuditLogEntry } from "./audit_log";
|
|
266
|
+
export type { AuditLogEntry } from "./audit_log.ts";
|
|
257
267
|
|
|
258
268
|
export type DiffieHellmanRequest = schemas["DiffieHellmanRequest"];
|
|
259
269
|
export type DiffieHellmanResponse = schemas["DiffieHellmanResponse"];
|
|
@@ -265,6 +275,7 @@ export type UserExportCompleteResponse = schemas["UserExportCompleteResponse"];
|
|
|
265
275
|
export type UserExportListResponse = schemas["PaginatedUserExportListResponse"];
|
|
266
276
|
export type UserExportKeyMaterial = schemas["JsonKeyPackage"];
|
|
267
277
|
export type JsonRpcResponse = schemas["JsonRpcResponse"];
|
|
278
|
+
export type JsonRpcResult = NonNullable<schemas["JsonRpcResponse"]["result"]>;
|
|
268
279
|
export type JsonRpcRequest = schemas["RpcMethod"] & {
|
|
269
280
|
/** @description Request ID */
|
|
270
281
|
id?: string;
|
package/src/scopes.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// eslint-disable spaced-comment
|
|
2
2
|
|
|
3
|
-
import { type ExplicitScope } from ".";
|
|
3
|
+
import { type ExplicitScope } from "./index.ts";
|
|
4
4
|
|
|
5
5
|
export type ScopesDictionary = Record<string, { label: string; scopes: ScopeItem[] }>;
|
|
6
6
|
|
|
@@ -273,6 +273,7 @@ export const AllScopes: Record<ExplicitScope, string> =
|
|
|
273
273
|
"rpc:createTransaction:*" : "Allows access to the RPC API endpoint, but only for the 'cs_createTransaction' function.",
|
|
274
274
|
"rpc:createTransaction:evm" : "Allows access to the RPC API endpoint, but only for the 'cs_createTransaction' function with an EVM transaction request.",
|
|
275
275
|
"rpc:getTransaction" : "Allows access to the RPC API endpoint, but only for the 'cs_getTransaction' function.",
|
|
276
|
+
"rpc:btcListUtxos" : "Allows access to the RPC API endpoint, but only for the 'cs_btcListUtxos' function.",
|
|
276
277
|
"rpc:listTransactions" : "Allows access to the RPC API endpoint, but only for the 'cs_listTransactions' function.",
|
|
277
278
|
"rpc:retryTransaction" : "Allows access to the RPC API endpoint, but only for the 'cs_retryTransaction' function",
|
|
278
279
|
"rpc:binance" : "Allows access to the RPC API endpoint, but only for the 'cs_binance*' functions",
|
package/src/signer_session.ts
CHANGED
package/src/user_export.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UserExportCompleteResponse, UserExportKeyMaterial } from "./schema_types";
|
|
2
|
-
import { decodeBase64 } from "./util";
|
|
1
|
+
import type { UserExportCompleteResponse, UserExportKeyMaterial } from "./schema_types.ts";
|
|
2
|
+
import { decodeBase64 } from "./util.ts";
|
|
3
3
|
import type { CipherSuite } from "@hpke/core";
|
|
4
4
|
|
|
5
5
|
/**
|
package/tsconfig.json
ADDED