@cubist-labs/cubesigner-sdk 0.3.1 → 0.3.11
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/cjs/package.json +1 -1
- package/dist/cjs/src/api.d.ts +27 -9
- package/dist/cjs/src/api.js +58 -22
- package/dist/cjs/src/client.d.ts +72 -3
- package/dist/cjs/src/client.js +79 -2
- package/dist/cjs/src/error.d.ts +26 -0
- package/dist/cjs/src/error.js +64 -1
- package/dist/cjs/src/events.d.ts +31 -9
- package/dist/cjs/src/events.js +56 -25
- package/dist/cjs/src/index.js +3 -2
- package/dist/cjs/src/key.d.ts +19 -2
- package/dist/cjs/src/key.js +22 -2
- package/dist/cjs/src/mfa.d.ts +6 -3
- package/dist/cjs/src/mfa.js +8 -5
- package/dist/cjs/src/response.d.ts +14 -1
- package/dist/cjs/src/response.js +65 -26
- package/dist/cjs/src/role.d.ts +6 -0
- package/dist/cjs/src/role.js +9 -1
- package/dist/cjs/src/schema.d.ts +339 -45
- package/dist/cjs/src/schema.js +1 -1
- package/dist/cjs/src/schema_types.d.ts +3 -0
- package/dist/cjs/src/schema_types.js +1 -1
- package/dist/cjs/src/session/signer_session_manager.js +3 -3
- package/dist/cjs/src/util.js +3 -2
- package/dist/esm/package.json +1 -1
- package/dist/esm/src/api.d.ts +27 -9
- package/dist/esm/src/api.js +56 -20
- package/dist/esm/src/client.d.ts +72 -3
- package/dist/esm/src/client.js +79 -2
- package/dist/esm/src/error.d.ts +26 -0
- package/dist/esm/src/error.js +64 -1
- package/dist/esm/src/events.d.ts +31 -9
- package/dist/esm/src/events.js +53 -23
- package/dist/esm/src/index.js +2 -2
- package/dist/esm/src/key.d.ts +19 -2
- package/dist/esm/src/key.js +22 -2
- package/dist/esm/src/mfa.d.ts +6 -3
- package/dist/esm/src/mfa.js +8 -5
- package/dist/esm/src/response.d.ts +14 -1
- package/dist/esm/src/response.js +65 -26
- package/dist/esm/src/role.d.ts +6 -0
- package/dist/esm/src/role.js +9 -1
- package/dist/esm/src/schema.d.ts +339 -45
- package/dist/esm/src/schema.js +1 -1
- package/dist/esm/src/schema_types.d.ts +3 -0
- package/dist/esm/src/schema_types.js +1 -1
- package/dist/esm/src/session/signer_session_manager.js +3 -3
- package/dist/esm/src/util.js +3 -2
- package/package.json +1 -1
- package/src/api.ts +66 -19
- package/src/client.ts +94 -2
- package/src/error.ts +73 -0
- package/src/events.ts +53 -24
- package/src/key.ts +31 -2
- package/src/mfa.ts +8 -4
- package/src/response.ts +50 -4
- package/src/role.ts +9 -0
- package/src/schema.ts +597 -45
- package/src/schema_types.ts +3 -0
- package/src/session/signer_session_manager.ts +2 -2
- package/src/util.ts +2 -3
- package/tsconfig.json +3 -3
package/dist/cjs/package.json
CHANGED
package/dist/cjs/src/api.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import createClient, { FetchOptions, FetchResponse, FilterKeys, HttpMethod, PathsWith } from "openapi-fetch";
|
|
2
2
|
import { paths, operations } from "./schema";
|
|
3
3
|
import { SignerSessionData, SignerSessionLifetime, SignerSessionManager } from "./session/signer_session_manager";
|
|
4
|
-
import { CreateOidcUserOptions, IdentityProof, KeyInRoleInfo, KeyInfoApi, ListKeysResponse, ListRoleKeysResponse, ListRoleUsersResponse, ListRolesResponse, OidcIdentity, SessionsResponse, PublicKeyCredential, RoleInfo, UpdateKeyRequest, UpdateOrgRequest, UpdateOrgResponse, UpdateRoleRequest, UserIdInfo, UserInRoleInfo, UserInfo, SessionInfo, OrgInfo, RatchetConfig, Eip191SignRequest, Eip712SignRequest, Eip191Or712SignResponse, EvmSignRequest, EvmSignResponse, Eth2SignRequest, Eth2SignResponse, Eth2StakeRequest, Eth2StakeResponse, Eth2UnstakeRequest, Eth2UnstakeResponse, BlobSignRequest, BlobSignResponse, BtcSignResponse, BtcSignRequest, SolanaSignRequest, SolanaSignResponse, AvaSignResponse, AvaTx, MfaRequestInfo, MemberRole, UserExportCompleteResponse, UserExportInitResponse, UserExportListResponse, Empty } from "./schema_types";
|
|
4
|
+
import { CreateOidcUserOptions, IdentityProof, KeyInRoleInfo, KeyInfoApi, ListKeysResponse, ListKeyRolesResponse, ListRoleKeysResponse, ListRoleUsersResponse, ListRolesResponse, OidcIdentity, SessionsResponse, PublicKeyCredential, RoleInfo, UpdateKeyRequest, UpdateOrgRequest, UpdateOrgResponse, UpdateRoleRequest, UserIdInfo, UserInRoleInfo, UserInfo, SessionInfo, OrgInfo, RatchetConfig, Eip191SignRequest, Eip712SignRequest, Eip191Or712SignResponse, EvmSignRequest, EvmSignResponse, Eth2SignRequest, Eth2SignResponse, Eth2StakeRequest, Eth2StakeResponse, Eth2UnstakeRequest, Eth2UnstakeResponse, BlobSignRequest, BlobSignResponse, BtcSignResponse, BtcSignRequest, SolanaSignRequest, SolanaSignResponse, AvaSignResponse, AvaTx, MfaRequestInfo, MfaVote, MemberRole, UserExportCompleteResponse, UserExportInitResponse, UserExportListResponse, Empty } from "./schema_types";
|
|
5
5
|
import { AddFidoChallenge, MfaFidoChallenge, MfaReceipt, TotpChallenge } from "./mfa";
|
|
6
6
|
import { CubeSignerResponse } from "./response";
|
|
7
7
|
import { Key, KeyType } from "./key";
|
|
@@ -241,6 +241,14 @@ export declare class CubeSignerApi {
|
|
|
241
241
|
* @return {KeyInfoApi} The key information.
|
|
242
242
|
*/
|
|
243
243
|
keyGet(keyId: string): Promise<KeyInfoApi>;
|
|
244
|
+
/**
|
|
245
|
+
* List all roles a key is in.
|
|
246
|
+
*
|
|
247
|
+
* @param {string} keyId The id of the key to get.
|
|
248
|
+
* @param {PageOpts} page Pagination options. Defaults to fetching the entire result set.
|
|
249
|
+
* @return {Paginator<ListKeyRolesResponse, KeyInRoleInfo>} Paginator for iterating over the roles a key is in.
|
|
250
|
+
*/
|
|
251
|
+
keyRolesList(keyId: string, page?: PageOpts): Paginator<ListKeyRolesResponse, KeyInRoleInfo>;
|
|
244
252
|
/**
|
|
245
253
|
* Update key.
|
|
246
254
|
* @param {string} keyId The ID of the key to update.
|
|
@@ -346,6 +354,13 @@ export declare class CubeSignerApi {
|
|
|
346
354
|
* @param {string} userId The ID of the user to add to the role.
|
|
347
355
|
*/
|
|
348
356
|
roleUserAdd(roleId: string, userId: string): Promise<void>;
|
|
357
|
+
/**
|
|
358
|
+
* Remove an existing user from an existing role.
|
|
359
|
+
*
|
|
360
|
+
* @param {string} roleId The ID of the role.
|
|
361
|
+
* @param {string} userId The ID of the user to remove from the role.
|
|
362
|
+
*/
|
|
363
|
+
roleUserRemove(roleId: string, userId: string): Promise<void>;
|
|
349
364
|
/**
|
|
350
365
|
* List all users in a role.
|
|
351
366
|
*
|
|
@@ -418,20 +433,22 @@ export declare class CubeSignerApi {
|
|
|
418
433
|
*/
|
|
419
434
|
mfaList(): Promise<MfaRequestInfo[]>;
|
|
420
435
|
/**
|
|
421
|
-
* Approve a pending MFA request using the current session.
|
|
436
|
+
* Approve or reject a pending MFA request using the current session.
|
|
422
437
|
*
|
|
423
438
|
* @param {string} mfaId The id of the MFA request
|
|
439
|
+
* @param {MfaVote} mfaVote Approve or reject the MFA request
|
|
424
440
|
* @return {Promise<MfaRequestInfo>} The result of the MFA request
|
|
425
441
|
*/
|
|
426
|
-
|
|
442
|
+
mfaVoteCs(mfaId: string, mfaVote: MfaVote): Promise<MfaRequestInfo>;
|
|
427
443
|
/**
|
|
428
|
-
* Approve a pending MFA request using TOTP.
|
|
444
|
+
* Approve or reject a pending MFA request using TOTP.
|
|
429
445
|
*
|
|
430
|
-
* @param {string} mfaId The MFA request
|
|
446
|
+
* @param {string} mfaId The ID of the MFA request
|
|
431
447
|
* @param {string} code The TOTP code
|
|
448
|
+
* @param {MfaVote} mfaVote Approve or reject the MFA request
|
|
432
449
|
* @return {Promise<MfaRequestInfo>} The current status of the MFA request
|
|
433
450
|
*/
|
|
434
|
-
|
|
451
|
+
mfaVoteTotp(mfaId: string, code: string, mfaVote: MfaVote): Promise<MfaRequestInfo>;
|
|
435
452
|
/**
|
|
436
453
|
* Initiate approval of an existing MFA request using FIDO. A challenge is
|
|
437
454
|
* returned which must be answered via {@link MfaFidoChallenge.answer} or {@link mfaApproveFidoComplete}.
|
|
@@ -439,19 +456,20 @@ export declare class CubeSignerApi {
|
|
|
439
456
|
* @param {string} mfaId The MFA request ID.
|
|
440
457
|
* @return {Promise<MfaFidoChallenge>} A challenge that needs to be answered to complete the approval.
|
|
441
458
|
*/
|
|
442
|
-
|
|
459
|
+
mfaFidoInit(mfaId: string): Promise<MfaFidoChallenge>;
|
|
443
460
|
/**
|
|
444
|
-
* Complete a previously initiated (via {@link mfaApproveFidoInit}) MFA request
|
|
461
|
+
* Complete a previously initiated (via {@link mfaApproveFidoInit}) MFA request using FIDO.
|
|
445
462
|
*
|
|
446
463
|
* Instead of calling this method directly, prefer {@link MfaFidoChallenge.answer} or
|
|
447
464
|
* {@link MfaFidoChallenge.createCredentialAndAnswer}.
|
|
448
465
|
*
|
|
449
466
|
* @param {string} mfaId The MFA request ID
|
|
467
|
+
* @param {MfaVote} mfaVote Approve or reject the MFA request
|
|
450
468
|
* @param {string} challengeId The ID of the challenge issued by {@link mfaApproveFidoInit}
|
|
451
469
|
* @param {PublicKeyCredential} credential The answer to the challenge
|
|
452
470
|
* @return {Promise<MfaRequestInfo>} The current status of the MFA request.
|
|
453
471
|
*/
|
|
454
|
-
|
|
472
|
+
mfaVoteFidoComplete(mfaId: string, mfaVote: MfaVote, challengeId: string, credential: PublicKeyCredential): Promise<MfaRequestInfo>;
|
|
455
473
|
/**
|
|
456
474
|
* Sign an EVM transaction.
|
|
457
475
|
* @param {Key | string} key The key to sign with (either {@link Key} or its material ID).
|