@cubist-labs/cubesigner-sdk 0.4.250 → 0.4.254

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.
@@ -145,6 +145,8 @@ import {
145
145
  type RolePolicy,
146
146
  type InvokePolicyResponse,
147
147
  type InvokePolicyRequest,
148
+ type PolicySecretsInfo,
149
+ type SetPolicySecretRequest,
148
150
  type UploadWasmPolicyRequest,
149
151
  type UploadWasmPolicyResponse,
150
152
  type LoginRequest,
@@ -1538,7 +1540,7 @@ export class ApiClient extends BaseClient {
1538
1540
 
1539
1541
  // #endregion
1540
1542
 
1541
- // #region POLICY: policy(Create|Get|List|Update|Delete|Invoke|Secrets)
1543
+ // #region POLICY: policy(Create|Get|List|Update|Delete|Invoke), policySecret(Set|Delete), policySecretsGet
1542
1544
 
1543
1545
  /**
1544
1546
  * Create a new named policy.
@@ -1663,6 +1665,59 @@ export class ApiClient extends BaseClient {
1663
1665
  });
1664
1666
  }
1665
1667
 
1668
+ /**
1669
+ * Set or update an org-level policy secret.
1670
+ *
1671
+ * @param secretName The name of the secret to set.
1672
+ * @param request The set secret request.
1673
+ * @param mfaReceipt Optional MFA receipt(s).
1674
+ * @returns The updated policy secrets info.
1675
+ */
1676
+ async policySecretSet(
1677
+ secretName: string,
1678
+ request: SetPolicySecretRequest,
1679
+ mfaReceipt?: MfaReceipts,
1680
+ ): Promise<CubeSignerResponse<PolicySecretsInfo>> {
1681
+ const o = op("/v0/org/{org_id}/policy/secrets/{secret_name}", "put");
1682
+ const reqFn = async (headers?: HeadersInit) =>
1683
+ this.exec(o, {
1684
+ params: { path: { secret_name: secretName } },
1685
+ body: request,
1686
+ headers,
1687
+ });
1688
+ return await CubeSignerResponse.create(this.env, reqFn, mfaReceipt);
1689
+ }
1690
+
1691
+ /**
1692
+ * Get org-level policy secrets.
1693
+ *
1694
+ * @returns The policy secrets info (names and ACLs only; values are not returned).
1695
+ */
1696
+ async policySecretsGet(): Promise<PolicySecretsInfo> {
1697
+ const o = op("/v0/org/{org_id}/policy/secrets", "get");
1698
+ return this.exec(o, {});
1699
+ }
1700
+
1701
+ /**
1702
+ * Delete an org-level policy secret.
1703
+ *
1704
+ * @param secretName The name of the secret to delete.
1705
+ * @param mfaReceipt Optional MFA receipt(s).
1706
+ * @returns The updated policy secrets info.
1707
+ */
1708
+ async policySecretDelete(
1709
+ secretName: string,
1710
+ mfaReceipt?: MfaReceipts,
1711
+ ): Promise<CubeSignerResponse<PolicySecretsInfo>> {
1712
+ const o = op("/v0/org/{org_id}/policy/secrets/{secret_name}", "delete");
1713
+ const reqFn = async (headers?: HeadersInit) =>
1714
+ this.exec(o, {
1715
+ params: { path: { secret_name: secretName } },
1716
+ headers,
1717
+ });
1718
+ return await CubeSignerResponse.create(this.env, reqFn, mfaReceipt);
1719
+ }
1720
+
1666
1721
  // #endregion
1667
1722
 
1668
1723
  // #region BUCKET: bucket(Get|List|Update)
package/src/env.ts CHANGED
@@ -20,6 +20,7 @@ export interface EnvInterface {
20
20
  Region?: string;
21
21
  SignerApiRoot: string;
22
22
  OrgEventsTopicArn: string;
23
+ UploadBucket?: string;
23
24
  }
24
25
 
25
26
  export type Region = string;
package/src/key.ts CHANGED
@@ -30,6 +30,7 @@ import type {
30
30
  KeyInfoJwt,
31
31
  KeyAttestationQuery,
32
32
  BinanceApiProperties,
33
+ CoinbaseApiProperties,
33
34
  } from "./schema_types";
34
35
  import type {
35
36
  ApiClient,
@@ -101,6 +102,7 @@ export enum Ed25519 {
101
102
  Substrate = "Ed25519SubstrateAddr",
102
103
  Tendermint = "Ed25519TendermintAddr",
103
104
  BinanceApi = "Ed25519BinanceApi",
105
+ CoinbaseApi = "Ed25519CoinbaseApi",
104
106
  Ton = "Ed25519TonAddr",
105
107
  Xrp = "Ed25519XrpAddr",
106
108
  }
@@ -128,7 +130,9 @@ export type BabyJubjub = typeof BabyJubjub;
128
130
  export type KeyType = Secp256k1 | Bls | Ed25519 | Mnemonic | Stark | P256 | BabyJubjub;
129
131
 
130
132
  /** The type representing all different kinds of key properties. */
131
- export type KeyPropertiesPatch = { kind: "BinanceApi" } & BinanceApiProperties;
133
+ export type KeyPropertiesPatch =
134
+ | ({ kind: "BinanceApi" } & BinanceApiProperties)
135
+ | ({ kind: "CoinbaseApi" } & CoinbaseApiProperties);
132
136
 
133
137
  /**
134
138
  * A representation of a signing key.
@@ -844,6 +848,8 @@ export function fromSchemaKeyType(ty: SchemaKeyType): KeyType {
844
848
  return Ed25519.Ton;
845
849
  case "Ed25519BinanceApi":
846
850
  return Ed25519.BinanceApi;
851
+ case "Ed25519CoinbaseApi":
852
+ return Ed25519.CoinbaseApi;
847
853
  case "Stark":
848
854
  return Stark;
849
855
  case "Mnemonic":