@cubist-labs/cubesigner-sdk 0.2.28 → 0.3.1

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.
Files changed (143) hide show
  1. package/README.md +30 -28
  2. package/dist/cjs/package.json +41 -0
  3. package/dist/cjs/spec/env/beta.json +9 -0
  4. package/dist/cjs/spec/env/gamma.json +9 -0
  5. package/dist/cjs/spec/env/prod.json +9 -0
  6. package/dist/cjs/src/api.d.ts +634 -0
  7. package/dist/cjs/src/api.js +1309 -0
  8. package/dist/cjs/src/client.d.ts +575 -0
  9. package/dist/cjs/src/client.js +378 -0
  10. package/dist/cjs/src/env.d.ts +15 -0
  11. package/dist/cjs/src/env.js +35 -0
  12. package/dist/cjs/src/error.d.ts +29 -0
  13. package/dist/cjs/src/error.js +36 -0
  14. package/dist/cjs/src/events.d.ts +84 -0
  15. package/dist/cjs/src/events.js +195 -0
  16. package/dist/cjs/src/index.d.ts +203 -0
  17. package/dist/cjs/src/index.js +298 -0
  18. package/dist/cjs/src/key.d.ts +152 -0
  19. package/dist/cjs/src/key.js +242 -0
  20. package/dist/{src/fido.d.ts → cjs/src/mfa.d.ts} +33 -15
  21. package/dist/cjs/src/mfa.js +169 -0
  22. package/dist/cjs/src/org.d.ts +99 -0
  23. package/dist/cjs/src/org.js +95 -0
  24. package/dist/cjs/src/paginator.d.ts +76 -0
  25. package/dist/cjs/src/paginator.js +99 -0
  26. package/dist/cjs/src/response.d.ts +101 -0
  27. package/dist/cjs/src/response.js +164 -0
  28. package/dist/cjs/src/role.d.ts +283 -0
  29. package/dist/cjs/src/role.js +253 -0
  30. package/dist/cjs/src/schema.d.ts +6209 -0
  31. package/dist/cjs/src/schema.js +7 -0
  32. package/dist/cjs/src/schema_types.d.ts +113 -0
  33. package/dist/cjs/src/schema_types.js +3 -0
  34. package/dist/cjs/src/session/session_storage.d.ts +27 -0
  35. package/dist/cjs/src/session/session_storage.js +47 -0
  36. package/dist/cjs/src/session/signer_session_manager.d.ts +125 -0
  37. package/dist/cjs/src/session/signer_session_manager.js +239 -0
  38. package/dist/cjs/src/signer_session.d.ts +41 -0
  39. package/dist/cjs/src/signer_session.js +77 -0
  40. package/dist/cjs/src/user_export.d.ts +52 -0
  41. package/dist/cjs/src/user_export.js +129 -0
  42. package/dist/cjs/src/util.d.ts +56 -0
  43. package/dist/cjs/src/util.js +86 -0
  44. package/dist/esm/package.json +41 -0
  45. package/dist/esm/spec/env/beta.json +9 -0
  46. package/dist/esm/spec/env/gamma.json +9 -0
  47. package/dist/esm/spec/env/prod.json +9 -0
  48. package/dist/esm/src/api.d.ts +634 -0
  49. package/dist/esm/src/api.js +1299 -0
  50. package/dist/esm/src/client.d.ts +575 -0
  51. package/dist/esm/src/client.js +374 -0
  52. package/dist/esm/src/env.d.ts +15 -0
  53. package/dist/esm/src/env.js +9 -0
  54. package/dist/esm/src/error.d.ts +29 -0
  55. package/dist/esm/src/error.js +31 -0
  56. package/dist/esm/src/events.d.ts +84 -0
  57. package/dist/esm/src/events.js +189 -0
  58. package/dist/esm/src/index.d.ts +203 -0
  59. package/dist/esm/src/index.js +276 -0
  60. package/dist/esm/src/key.d.ts +152 -0
  61. package/dist/esm/src/key.js +236 -0
  62. package/dist/esm/src/mfa.d.ts +94 -0
  63. package/dist/esm/src/mfa.js +163 -0
  64. package/dist/esm/src/org.d.ts +99 -0
  65. package/dist/esm/src/org.js +91 -0
  66. package/dist/esm/src/paginator.d.ts +76 -0
  67. package/dist/esm/src/paginator.js +94 -0
  68. package/dist/esm/src/response.d.ts +101 -0
  69. package/dist/esm/src/response.js +159 -0
  70. package/dist/esm/src/role.d.ts +283 -0
  71. package/dist/esm/src/role.js +248 -0
  72. package/dist/esm/src/schema.d.ts +6209 -0
  73. package/dist/esm/src/schema.js +6 -0
  74. package/dist/esm/src/schema_types.d.ts +113 -0
  75. package/dist/esm/src/schema_types.js +2 -0
  76. package/dist/esm/src/session/session_storage.d.ts +27 -0
  77. package/dist/esm/src/session/session_storage.js +43 -0
  78. package/dist/esm/src/session/signer_session_manager.d.ts +125 -0
  79. package/dist/esm/src/session/signer_session_manager.js +235 -0
  80. package/dist/esm/src/signer_session.d.ts +41 -0
  81. package/dist/esm/src/signer_session.js +72 -0
  82. package/dist/esm/src/user_export.d.ts +52 -0
  83. package/dist/esm/src/user_export.js +99 -0
  84. package/dist/esm/src/util.d.ts +56 -0
  85. package/dist/esm/src/util.js +76 -0
  86. package/dist/package.json +13 -45
  87. package/dist/src/api.d.ts +29 -1
  88. package/dist/src/api.js +66 -1
  89. package/dist/src/client.d.ts +35 -14
  90. package/dist/src/client.js +12 -8
  91. package/dist/src/events.js +1 -1
  92. package/dist/src/index.d.ts +6 -11
  93. package/dist/src/index.js +9 -25
  94. package/dist/src/key.d.ts +18 -7
  95. package/dist/src/key.js +52 -19
  96. package/dist/src/role.d.ts +46 -3
  97. package/dist/src/role.js +60 -8
  98. package/dist/src/schema.d.ts +206 -72
  99. package/dist/src/schema.js +1 -1
  100. package/dist/src/schema_types.d.ts +3 -0
  101. package/dist/src/schema_types.js +1 -1
  102. package/dist/src/session/signer_session_manager.d.ts +38 -14
  103. package/dist/src/session/signer_session_manager.js +93 -33
  104. package/dist/src/util.d.ts +14 -0
  105. package/dist/src/util.js +24 -27
  106. package/package.json +19 -46
  107. package/src/api.ts +79 -0
  108. package/src/client.ts +12 -8
  109. package/src/events.ts +2 -0
  110. package/src/index.ts +10 -24
  111. package/src/key.ts +36 -18
  112. package/src/role.ts +78 -7
  113. package/src/schema.ts +269 -110
  114. package/src/schema_types.ts +3 -0
  115. package/src/session/session_storage.ts +0 -32
  116. package/src/session/signer_session_manager.ts +124 -36
  117. package/src/util.ts +19 -10
  118. package/tsconfig.json +1 -21
  119. package/LICENSE-APACHE +0 -177
  120. package/LICENSE-MIT +0 -25
  121. package/NOTICE +0 -13
  122. package/dist/examples/ethers.d.ts +0 -1
  123. package/dist/examples/ethers.js +0 -142
  124. package/dist/src/ethers/index.d.ts +0 -95
  125. package/dist/src/ethers/index.js +0 -215
  126. package/dist/src/fido.js +0 -148
  127. package/dist/src/session/cognito_manager.d.ts +0 -71
  128. package/dist/src/session/cognito_manager.js +0 -129
  129. package/dist/src/session/generic.d.ts +0 -47
  130. package/dist/src/session/generic.js +0 -3
  131. package/dist/src/session/management_session_manager.d.ts +0 -59
  132. package/dist/src/session/management_session_manager.js +0 -111
  133. package/dist/src/session/oidc_session_manager.d.ts +0 -78
  134. package/dist/src/session/oidc_session_manager.js +0 -142
  135. package/dist/src/session/session_manager.d.ts +0 -99
  136. package/dist/src/session/session_manager.js +0 -136
  137. package/dist/src/sign.d.ts +0 -114
  138. package/dist/src/sign.js +0 -248
  139. package/dist/test/sessions.d.ts +0 -35
  140. package/dist/test/sessions.js +0 -56
  141. package/src/ethers/index.ts +0 -253
  142. package/src/session/cognito_manager.ts +0 -161
  143. package/src/session/session_manager.ts +0 -165
@@ -2,6 +2,12 @@
2
2
  * This file was auto-generated by openapi-typescript.
3
3
  * Do not make direct changes to the file.
4
4
  */
5
+ /** OneOf type helpers */
6
+ type Without<T, U> = {
7
+ [P in Exclude<keyof T, keyof U>]?: never;
8
+ };
9
+ type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
10
+ type OneOf<T extends any[]> = T extends [infer Only] ? Only : T extends [infer A, infer B, ...infer Rest] ? OneOf<[XOR<A, B>, ...Rest]> : never;
5
11
  export interface paths {
6
12
  "/v0/about_me": {
7
13
  /**
@@ -58,6 +64,15 @@ export interface paths {
58
64
  */
59
65
  put: operations["deriveKey"];
60
66
  };
67
+ "/v0/org/{org_id}/evm/eip191/sign/{pubkey}": {
68
+ /**
69
+ * Sign EIP-191 Data
70
+ * @description Sign EIP-191 Data
71
+ *
72
+ * Signs a message using EIP-191 personal_sign with a given Secp256k1 key.
73
+ */
74
+ post: operations["eip191Sign"];
75
+ };
61
76
  "/v0/org/{org_id}/evm/eip712/sign/{pubkey}": {
62
77
  /**
63
78
  * Sign EIP-712 Typed Data
@@ -272,14 +287,15 @@ export interface paths {
272
287
  * @description Delete Role
273
288
  *
274
289
  * Deletes a role in an organization.
275
- * Only organization owners can perform this action.
290
+ * Only users in the role can perform this action.
276
291
  */
277
292
  delete: operations["deleteRole"];
278
293
  /**
279
294
  * Update Role
280
295
  * @description Update Role
281
296
  *
282
- * Enables or disables a role.
297
+ * Enables or disables a role (this requires the `manage:role:update:enable` scope).
298
+ * Updates the role's policies (this requires the `manage:role:update:policy` scope).
283
299
  * The user must be in the role or an owner of the organization.
284
300
  */
285
301
  patch: operations["updateRole"];
@@ -387,7 +403,8 @@ export interface paths {
387
403
  * Create new user session (management and/or signing)
388
404
  * @description Create new user session (management and/or signing)
389
405
  *
390
- * Create a new user session
406
+ * Creates a new user session, silently truncating requested session and auth lifetimes
407
+ * to be at most requestor's session and auth lifetime, respectively.
391
408
  */
392
409
  post: operations["createSession"];
393
410
  /**
@@ -771,7 +788,7 @@ export interface components {
771
788
  email: string;
772
789
  identity: components["schemas"]["OIDCIdentity"];
773
790
  /** @description Optional login MFA policy */
774
- mfa_policy?: Record<string, unknown> | null;
791
+ mfa_policy?: unknown;
775
792
  role: components["schemas"]["MemberRole"];
776
793
  };
777
794
  AddThirdPartyUserResponse: {
@@ -987,6 +1004,19 @@ export interface components {
987
1004
  value: number;
988
1005
  };
989
1006
  };
1007
+ /** @description Describes how to derive a WebAuthn challenge value. */
1008
+ ChallengePieces: {
1009
+ /**
1010
+ * @description A base64url encoding of UTF8 JSON. The data in that JSON is endpoint specific, and describes what this FIDO challenge will be used for.
1011
+ *
1012
+ * Clients can use `preimage` along with `random_seed` to reconstruct the challenge like so:
1013
+ *
1014
+ * `challenge = HMAC-SHA256(key=random_seed, message=preimage)`
1015
+ */
1016
+ preimage: string;
1017
+ /** @description A random seed that prevents replay attacks */
1018
+ random_seed: string;
1019
+ };
990
1020
  /**
991
1021
  * @description Session information sent to the client.
992
1022
  * This struct works in tandem with its server-side counterpart [`SessionData`].
@@ -1089,7 +1119,7 @@ export interface components {
1089
1119
  */
1090
1120
  scopes: string[];
1091
1121
  };
1092
- CreateTokenRequest: components["schemas"]["RatchetConfig"] & ({
1122
+ CreateTokenRequest: components["schemas"]["RatchetConfig"] & {
1093
1123
  /**
1094
1124
  * @description A human readable description of the purpose of the key
1095
1125
  * @example Validator Signing
@@ -1103,7 +1133,16 @@ export interface components {
1103
1133
  * ]
1104
1134
  */
1105
1135
  scopes?: string[] | null;
1106
- });
1136
+ };
1137
+ /**
1138
+ * @description An extended form of `PublicKeyCredentialCreationOptions` that allows clients to derive the WebAuthn challenge
1139
+ * from a structured preimage.
1140
+ *
1141
+ * This ensures that the webuathn signature can only be used for a specific purpose
1142
+ */
1143
+ CreationOptionsWithHash: components["schemas"]["ChallengePieces"] & {
1144
+ options: components["schemas"]["PublicKeyCredentialCreationOptions"];
1145
+ };
1107
1146
  CubeSignerUserInfo: {
1108
1147
  /** @description All multi-factor authentication methods configured for this user */
1109
1148
  configured_mfa: components["schemas"]["ConfiguredMfa"][];
@@ -1156,6 +1195,22 @@ export interface components {
1156
1195
  */
1157
1196
  mnemonic_id: string;
1158
1197
  };
1198
+ Eip191Or712SignResponse: {
1199
+ /**
1200
+ * @description Hex-encoded signature comprising 65 bytes in the format required
1201
+ * by ecrecover: 32-byte r, 32-byte s, and one-byte recovery-id v
1202
+ * which is either 27 or 28.
1203
+ * @example 0x4355c47d63924e8a72e509b65029052eb6c299d53a04e167c5775fd466751c9d07299936d304c153f6443dfa05f40ff007d72911b6f72307f996231605b915621c
1204
+ */
1205
+ signature: string;
1206
+ };
1207
+ Eip191SignRequest: {
1208
+ /**
1209
+ * @description EIP-191 data to sign as hex-encoded bytes.
1210
+ * @example 0xdeadbeef13c0ffee
1211
+ */
1212
+ data: string;
1213
+ };
1159
1214
  /**
1160
1215
  * @example {
1161
1216
  * "chain_id": 1337,
@@ -1251,17 +1306,8 @@ export interface components {
1251
1306
  /** @description EIP-712 typed data. Refer to the JSON schema defined in EIP-712. */
1252
1307
  typed_data: Record<string, never>;
1253
1308
  };
1254
- Eip712SignResponse: {
1255
- /**
1256
- * @description Hex-encoded signature comprising 65 bytes in the format required
1257
- * by ecrecover: 32-byte r, 32-byte s, and one-byte recovery-id v
1258
- * which is either 27 or 28.
1259
- * @example 0x4355c47d63924e8a72e509b65029052eb6c299d53a04e167c5775fd466751c9d07299936d304c153f6443dfa05f40ff007d72911b6f72307f996231605b915621c
1260
- */
1261
- signature: string;
1262
- };
1263
1309
  /** @default null */
1264
- Empty: Record<string, unknown> | null;
1310
+ Empty: unknown;
1265
1311
  EmptyImpl: {
1266
1312
  status: string;
1267
1313
  };
@@ -1363,10 +1409,11 @@ export interface components {
1363
1409
  challenge_id: string;
1364
1410
  credential: components["schemas"]["PublicKeyCredential"];
1365
1411
  };
1366
- FidoAssertChallenge: {
1412
+ FidoAssertChallenge: (components["schemas"]["ChallengePieces"] & {
1413
+ options: components["schemas"]["PublicKeyCredentialRequestOptions"];
1414
+ }) & {
1367
1415
  /** @description The id of the challenge. Must be supplied when answering the challenge. */
1368
1416
  challenge_id: string;
1369
- options: components["schemas"]["PublicKeyCredentialRequestOptions"];
1370
1417
  };
1371
1418
  /** @description Sent from the client to the server to answer a fido challenge */
1372
1419
  FidoCreateChallengeAnswer: {
@@ -1378,10 +1425,11 @@ export interface components {
1378
1425
  * @description Sent by the server to the client. Contains the challenge data that must be
1379
1426
  * used to generate a new credential
1380
1427
  */
1381
- FidoCreateChallengeResponse: {
1428
+ FidoCreateChallengeResponse: (components["schemas"]["ChallengePieces"] & {
1429
+ options: components["schemas"]["PublicKeyCredentialCreationOptions"];
1430
+ }) & {
1382
1431
  /** @description The id of the challenge. Must be supplied when answering the challenge. */
1383
1432
  challenge_id: string;
1384
- options: components["schemas"]["PublicKeyCredentialCreationOptions"];
1385
1433
  };
1386
1434
  /** @description Declares intent to register a new FIDO key */
1387
1435
  FidoCreateRequest: {
@@ -1456,6 +1504,8 @@ export interface components {
1456
1504
  * @description Number of requests currently being processed by cube3signer
1457
1505
  */
1458
1506
  current_num_requests_processing: number;
1507
+ /** @description Do not record metric data from this heartbeat */
1508
+ ignore?: boolean;
1459
1509
  /**
1460
1510
  * Format: int64
1461
1511
  * @description Number of new requests during this heartbeat period
@@ -1502,7 +1552,7 @@ export interface components {
1502
1552
  */
1503
1553
  HttpRequest: {
1504
1554
  /** @description HTTP request body */
1505
- body?: Record<string, unknown> | null;
1555
+ body?: unknown;
1506
1556
  /** @description HTTP method of the request */
1507
1557
  method: string;
1508
1558
  /** @description HTTP path of the request (including host or not?) */
@@ -1512,7 +1562,7 @@ export interface components {
1512
1562
  * @description Proof that an end-user provided CubeSigner with a valid auth token
1513
1563
  * (either an OIDC token or a CubeSigner session token)
1514
1564
  */
1515
- IdentityProof: ({
1565
+ IdentityProof: {
1516
1566
  /**
1517
1567
  * @description OIDC audience; set only if the proof was obtained by using OIDC token.
1518
1568
  *
@@ -1527,7 +1577,7 @@ export interface components {
1527
1577
  exp_epoch: components["schemas"]["EpochDateTime"];
1528
1578
  identity?: components["schemas"]["OIDCIdentity"] | null;
1529
1579
  user_info?: components["schemas"]["CubeSignerUserInfo"] | null;
1530
- }) & {
1580
+ } & {
1531
1581
  /** @description An opaque identifier for the proof */
1532
1582
  id: string;
1533
1583
  };
@@ -1560,7 +1610,7 @@ export interface components {
1560
1610
  */
1561
1611
  email: string;
1562
1612
  /** @description Optional login MFA policy */
1563
- mfa_policy?: Record<string, unknown> | null;
1613
+ mfa_policy?: unknown;
1564
1614
  /**
1565
1615
  * @description The user's full name
1566
1616
  * @example Alice Wonderland
@@ -1725,6 +1775,12 @@ export interface components {
1725
1775
  * @example 0x8e3484687e66cdd26cf04c3647633ab4f3570148
1726
1776
  */
1727
1777
  material_id: string;
1778
+ /**
1779
+ * @description User-defined metadata. When rendering (e.g., in the browser) you should treat
1780
+ * it as untrusted user data (and avoid injecting metadata into HTML directly) if
1781
+ * untrusted users can create/update keys (or their metadata).
1782
+ */
1783
+ metadata?: string;
1728
1784
  /**
1729
1785
  * @description Owner of the key
1730
1786
  * @example User#c3b9379c-4e8c-4216-bd0a-65ace53cf98f
@@ -1790,8 +1846,21 @@ export interface components {
1790
1846
  request: components["schemas"]["HttpRequest"];
1791
1847
  status: components["schemas"]["Status"];
1792
1848
  };
1793
- /** @enum {string} */
1794
- MfaType: "CubeSigner" | "Totp" | "Fido";
1849
+ MfaType: OneOf<[
1850
+ "CubeSigner",
1851
+ "Totp",
1852
+ "Fido",
1853
+ {
1854
+ /** @description Answer a FIDO challenge with a specific FIDO key */
1855
+ FidoKey: {
1856
+ /**
1857
+ * @description The ID of the FIDO key that must be use to approve the request
1858
+ * @example FidoKey#EtDd...ZZc8=
1859
+ */
1860
+ key_id: string;
1861
+ };
1862
+ }
1863
+ ]>;
1795
1864
  /**
1796
1865
  * @description Network name ('mainnet', 'prater', 'goerli')
1797
1866
  * @example goerli
@@ -1947,14 +2016,14 @@ export interface components {
1947
2016
  */
1948
2017
  PaginatedListKeysResponse: {
1949
2018
  keys: components["schemas"]["KeyInfo"][];
1950
- } & ({
2019
+ } & {
1951
2020
  /**
1952
2021
  * @description If set, the content of `response` does not contain the entire result set.
1953
2022
  * To fetch the next page of the result set, call the same endpoint
1954
2023
  * but specify this value as the 'page.start' query parameter.
1955
2024
  */
1956
2025
  last_evaluated_key?: string | null;
1957
- });
2026
+ };
1958
2027
  /**
1959
2028
  * @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
1960
2029
  * value (which can the user pass back to use as a url query parameter to continue pagination).
@@ -1962,14 +2031,14 @@ export interface components {
1962
2031
  PaginatedListRoleKeysResponse: {
1963
2032
  /** @description All keys in a role */
1964
2033
  keys: components["schemas"]["KeyInRoleInfo"][];
1965
- } & ({
2034
+ } & {
1966
2035
  /**
1967
2036
  * @description If set, the content of `response` does not contain the entire result set.
1968
2037
  * To fetch the next page of the result set, call the same endpoint
1969
2038
  * but specify this value as the 'page.start' query parameter.
1970
2039
  */
1971
2040
  last_evaluated_key?: string | null;
1972
- });
2041
+ };
1973
2042
  /**
1974
2043
  * @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
1975
2044
  * value (which can the user pass back to use as a url query parameter to continue pagination).
@@ -1977,14 +2046,14 @@ export interface components {
1977
2046
  PaginatedListRoleUsersResponse: {
1978
2047
  /** @description All users in a role */
1979
2048
  users: components["schemas"]["UserInRoleInfo"][];
1980
- } & ({
2049
+ } & {
1981
2050
  /**
1982
2051
  * @description If set, the content of `response` does not contain the entire result set.
1983
2052
  * To fetch the next page of the result set, call the same endpoint
1984
2053
  * but specify this value as the 'page.start' query parameter.
1985
2054
  */
1986
2055
  last_evaluated_key?: string | null;
1987
- });
2056
+ };
1988
2057
  /**
1989
2058
  * @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
1990
2059
  * value (which can the user pass back to use as a url query parameter to continue pagination).
@@ -1992,14 +2061,14 @@ export interface components {
1992
2061
  PaginatedListRolesResponse: {
1993
2062
  /** @description All roles in an organization. */
1994
2063
  roles: components["schemas"]["RoleInfo"][];
1995
- } & ({
2064
+ } & {
1996
2065
  /**
1997
2066
  * @description If set, the content of `response` does not contain the entire result set.
1998
2067
  * To fetch the next page of the result set, call the same endpoint
1999
2068
  * but specify this value as the 'page.start' query parameter.
2000
2069
  */
2001
2070
  last_evaluated_key?: string | null;
2002
- });
2071
+ };
2003
2072
  /**
2004
2073
  * @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
2005
2074
  * value (which can the user pass back to use as a url query parameter to continue pagination).
@@ -2007,28 +2076,28 @@ export interface components {
2007
2076
  PaginatedSessionsResponse: {
2008
2077
  /** @description The list of sessions */
2009
2078
  sessions: components["schemas"]["SessionInfo"][];
2010
- } & ({
2079
+ } & {
2011
2080
  /**
2012
2081
  * @description If set, the content of `response` does not contain the entire result set.
2013
2082
  * To fetch the next page of the result set, call the same endpoint
2014
2083
  * but specify this value as the 'page.start' query parameter.
2015
2084
  */
2016
2085
  last_evaluated_key?: string | null;
2017
- });
2086
+ };
2018
2087
  /**
2019
2088
  * @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
2020
2089
  * value (which can the user pass back to use as a url query parameter to continue pagination).
2021
2090
  */
2022
2091
  PaginatedUserExportListResponse: {
2023
2092
  export_requests: components["schemas"]["UserExportInitResponse"][];
2024
- } & ({
2093
+ } & {
2025
2094
  /**
2026
2095
  * @description If set, the content of `response` does not contain the entire result set.
2027
2096
  * To fetch the next page of the result set, call the same endpoint
2028
2097
  * but specify this value as the 'page.start' query parameter.
2029
2098
  */
2030
2099
  last_evaluated_key?: string | null;
2031
- });
2100
+ };
2032
2101
  /**
2033
2102
  * @description This type represents a wire-encodable form of the PublicKeyCredential interface
2034
2103
  * Clients may need to manually encode into this format to communicate with the server
@@ -2053,7 +2122,7 @@ export interface components {
2053
2122
  * This operation returns the value of [[clientExtensionsResults]], which is a map containing extension identifier → client extension output entries produced by the extension’s client extension processing.
2054
2123
  * https://www.w3.org/TR/webauthn-2/#ref-for-dom-publickeycredential-getclientextensionresults
2055
2124
  */
2056
- clientExtensionResults?: Record<string, unknown> | null;
2125
+ clientExtensionResults?: unknown;
2057
2126
  /**
2058
2127
  * @description This internal slot contains the credential ID, chosen by the
2059
2128
  * authenticator. The credential ID is used to look up credentials for use,
@@ -2104,7 +2173,7 @@ export interface components {
2104
2173
  *
2105
2174
  * https://www.w3.org/TR/webauthn-2/#dom-publickeycredentialcreationoptions-extensions
2106
2175
  */
2107
- extensions?: Record<string, unknown> | null;
2176
+ extensions?: unknown;
2108
2177
  /**
2109
2178
  * @description This member contains information about the desired properties of the
2110
2179
  * credential to be created. The sequence is ordered from most preferred to
@@ -2198,7 +2267,7 @@ export interface components {
2198
2267
  * https://www.w3.org/TR/webauthn-2/#dom-publickeycredentialrequestoptions-challenge
2199
2268
  */
2200
2269
  challenge: string;
2201
- extensions?: Record<string, unknown> | null;
2270
+ extensions?: unknown;
2202
2271
  /**
2203
2272
  * @description This OPTIONAL member specifies the relying party identifier claimed by
2204
2273
  * the caller. If omitted, its value will be the CredentialsContainer
@@ -2345,13 +2414,13 @@ export interface components {
2345
2414
  name: string;
2346
2415
  };
2347
2416
  RatchetConfig: {
2348
- /** @default 300 */
2417
+ /** @default default_auth_lifetime */
2349
2418
  auth_lifetime?: components["schemas"]["Seconds"];
2350
2419
  /** @default default_grace_lifetime */
2351
2420
  grace_lifetime?: components["schemas"]["Seconds"];
2352
- /** @default 86400 */
2421
+ /** @default default_refresh_lifetime */
2353
2422
  refresh_lifetime?: components["schemas"]["Seconds"];
2354
- /** @default 31536000 */
2423
+ /** @default default_session_lifetime */
2355
2424
  session_lifetime?: components["schemas"]["Seconds"];
2356
2425
  };
2357
2426
  /** @description Receipt that an MFA request was approved. */
@@ -2365,6 +2434,15 @@ export interface components {
2365
2434
  final_approver: string;
2366
2435
  timestamp: components["schemas"]["EpochDateTime"];
2367
2436
  };
2437
+ /**
2438
+ * @description An extended form of `PublicKeyCredentialRequestOptions` that allows clients to derive the WebAuthn challenge
2439
+ * from a structured preimage.
2440
+ *
2441
+ * This ensures that the webuathn signature can only be used for a specific purpose
2442
+ */
2443
+ RequestOptionsWithHash: components["schemas"]["ChallengePieces"] & {
2444
+ options: components["schemas"]["PublicKeyCredentialRequestOptions"];
2445
+ };
2368
2446
  /**
2369
2447
  * @description This enumeration’s values describe the Relying Party's requirements for
2370
2448
  * client-side discoverable credentials (formerly known as resident credentials
@@ -2614,6 +2692,11 @@ export interface components {
2614
2692
  * Once disabled, a key cannot be used for signing.
2615
2693
  */
2616
2694
  enabled?: boolean | null;
2695
+ /**
2696
+ * @description If set, update this key's metadata. Validation regex: ^[A-Za-z0-9_=+/ \-\.\,]{0,1024}$
2697
+ * @example Contract admin key
2698
+ */
2699
+ metadata?: string | null;
2617
2700
  /**
2618
2701
  * @description If set, updates key's owner to this value.
2619
2702
  * The new owner must be an existing user who is a member of the same org.
@@ -2861,7 +2944,7 @@ export interface components {
2861
2944
  /** @description All multi-factor authentication methods configured for this user */
2862
2945
  mfa: components["schemas"]["ConfiguredMfa"][];
2863
2946
  /** @description MFA policy, applies before logging in and other sensitive operations */
2864
- mfa_policy?: Record<string, unknown> | null;
2947
+ mfa_policy?: unknown;
2865
2948
  /**
2866
2949
  * @description All organizations the user belongs to
2867
2950
  * @example [
@@ -2974,7 +3057,7 @@ export interface components {
2974
3057
  };
2975
3058
  };
2976
3059
  };
2977
- Eip712SignResponse: {
3060
+ Eip191Or712SignResponse: {
2978
3061
  content: {
2979
3062
  "application/json": {
2980
3063
  /**
@@ -3018,10 +3101,11 @@ export interface components {
3018
3101
  };
3019
3102
  FidoAssertChallenge: {
3020
3103
  content: {
3021
- "application/json": {
3104
+ "application/json": (components["schemas"]["ChallengePieces"] & {
3105
+ options: components["schemas"]["PublicKeyCredentialRequestOptions"];
3106
+ }) & {
3022
3107
  /** @description The id of the challenge. Must be supplied when answering the challenge. */
3023
3108
  challenge_id: string;
3024
- options: components["schemas"]["PublicKeyCredentialRequestOptions"];
3025
3109
  };
3026
3110
  };
3027
3111
  };
@@ -3031,10 +3115,11 @@ export interface components {
3031
3115
  */
3032
3116
  FidoCreateChallengeResponse: {
3033
3117
  content: {
3034
- "application/json": {
3118
+ "application/json": (components["schemas"]["ChallengePieces"] & {
3119
+ options: components["schemas"]["PublicKeyCredentialCreationOptions"];
3120
+ }) & {
3035
3121
  /** @description The id of the challenge. Must be supplied when answering the challenge. */
3036
3122
  challenge_id: string;
3037
- options: components["schemas"]["PublicKeyCredentialCreationOptions"];
3038
3123
  };
3039
3124
  };
3040
3125
  };
@@ -3052,7 +3137,7 @@ export interface components {
3052
3137
  */
3053
3138
  IdentityProof: {
3054
3139
  content: {
3055
- "application/json": ({
3140
+ "application/json": {
3056
3141
  /**
3057
3142
  * @description OIDC audience; set only if the proof was obtained by using OIDC token.
3058
3143
  *
@@ -3067,7 +3152,7 @@ export interface components {
3067
3152
  exp_epoch: components["schemas"]["EpochDateTime"];
3068
3153
  identity?: components["schemas"]["OIDCIdentity"] | null;
3069
3154
  user_info?: components["schemas"]["CubeSignerUserInfo"] | null;
3070
- }) & {
3155
+ } & {
3071
3156
  /** @description An opaque identifier for the proof */
3072
3157
  id: string;
3073
3158
  };
@@ -3123,6 +3208,12 @@ export interface components {
3123
3208
  * @example 0x8e3484687e66cdd26cf04c3647633ab4f3570148
3124
3209
  */
3125
3210
  material_id: string;
3211
+ /**
3212
+ * @description User-defined metadata. When rendering (e.g., in the browser) you should treat
3213
+ * it as untrusted user data (and avoid injecting metadata into HTML directly) if
3214
+ * untrusted users can create/update keys (or their metadata).
3215
+ */
3216
+ metadata?: string;
3126
3217
  /**
3127
3218
  * @description Owner of the key
3128
3219
  * @example User#c3b9379c-4e8c-4216-bd0a-65ace53cf98f
@@ -3283,14 +3374,14 @@ export interface components {
3283
3374
  content: {
3284
3375
  "application/json": {
3285
3376
  keys: components["schemas"]["KeyInfo"][];
3286
- } & ({
3377
+ } & {
3287
3378
  /**
3288
3379
  * @description If set, the content of `response` does not contain the entire result set.
3289
3380
  * To fetch the next page of the result set, call the same endpoint
3290
3381
  * but specify this value as the 'page.start' query parameter.
3291
3382
  */
3292
3383
  last_evaluated_key?: string | null;
3293
- });
3384
+ };
3294
3385
  };
3295
3386
  };
3296
3387
  PaginatedListRoleKeysResponse: {
@@ -3298,14 +3389,14 @@ export interface components {
3298
3389
  "application/json": {
3299
3390
  /** @description All keys in a role */
3300
3391
  keys: components["schemas"]["KeyInRoleInfo"][];
3301
- } & ({
3392
+ } & {
3302
3393
  /**
3303
3394
  * @description If set, the content of `response` does not contain the entire result set.
3304
3395
  * To fetch the next page of the result set, call the same endpoint
3305
3396
  * but specify this value as the 'page.start' query parameter.
3306
3397
  */
3307
3398
  last_evaluated_key?: string | null;
3308
- });
3399
+ };
3309
3400
  };
3310
3401
  };
3311
3402
  PaginatedListRoleUsersResponse: {
@@ -3313,14 +3404,14 @@ export interface components {
3313
3404
  "application/json": {
3314
3405
  /** @description All users in a role */
3315
3406
  users: components["schemas"]["UserInRoleInfo"][];
3316
- } & ({
3407
+ } & {
3317
3408
  /**
3318
3409
  * @description If set, the content of `response` does not contain the entire result set.
3319
3410
  * To fetch the next page of the result set, call the same endpoint
3320
3411
  * but specify this value as the 'page.start' query parameter.
3321
3412
  */
3322
3413
  last_evaluated_key?: string | null;
3323
- });
3414
+ };
3324
3415
  };
3325
3416
  };
3326
3417
  PaginatedListRolesResponse: {
@@ -3328,14 +3419,14 @@ export interface components {
3328
3419
  "application/json": {
3329
3420
  /** @description All roles in an organization. */
3330
3421
  roles: components["schemas"]["RoleInfo"][];
3331
- } & ({
3422
+ } & {
3332
3423
  /**
3333
3424
  * @description If set, the content of `response` does not contain the entire result set.
3334
3425
  * To fetch the next page of the result set, call the same endpoint
3335
3426
  * but specify this value as the 'page.start' query parameter.
3336
3427
  */
3337
3428
  last_evaluated_key?: string | null;
3338
- });
3429
+ };
3339
3430
  };
3340
3431
  };
3341
3432
  PaginatedSessionsResponse: {
@@ -3343,28 +3434,28 @@ export interface components {
3343
3434
  "application/json": {
3344
3435
  /** @description The list of sessions */
3345
3436
  sessions: components["schemas"]["SessionInfo"][];
3346
- } & ({
3437
+ } & {
3347
3438
  /**
3348
3439
  * @description If set, the content of `response` does not contain the entire result set.
3349
3440
  * To fetch the next page of the result set, call the same endpoint
3350
3441
  * but specify this value as the 'page.start' query parameter.
3351
3442
  */
3352
3443
  last_evaluated_key?: string | null;
3353
- });
3444
+ };
3354
3445
  };
3355
3446
  };
3356
3447
  PaginatedUserExportListResponse: {
3357
3448
  content: {
3358
3449
  "application/json": {
3359
3450
  export_requests: components["schemas"]["UserExportInitResponse"][];
3360
- } & ({
3451
+ } & {
3361
3452
  /**
3362
3453
  * @description If set, the content of `response` does not contain the entire result set.
3363
3454
  * To fetch the next page of the result set, call the same endpoint
3364
3455
  * but specify this value as the 'page.start' query parameter.
3365
3456
  */
3366
3457
  last_evaluated_key?: string | null;
3367
- });
3458
+ };
3368
3459
  };
3369
3460
  };
3370
3461
  RevokeTokenResponse: {
@@ -3601,7 +3692,7 @@ export interface components {
3601
3692
  /** @description All multi-factor authentication methods configured for this user */
3602
3693
  mfa: components["schemas"]["ConfiguredMfa"][];
3603
3694
  /** @description MFA policy, applies before logging in and other sensitive operations */
3604
- mfa_policy?: Record<string, unknown> | null;
3695
+ mfa_policy?: unknown;
3605
3696
  /**
3606
3697
  * @description All organizations the user belongs to
3607
3698
  * @example [
@@ -3810,6 +3901,46 @@ export interface operations {
3810
3901
  };
3811
3902
  };
3812
3903
  };
3904
+ /**
3905
+ * Sign EIP-191 Data
3906
+ * @description Sign EIP-191 Data
3907
+ *
3908
+ * Signs a message using EIP-191 personal_sign with a given Secp256k1 key.
3909
+ */
3910
+ eip191Sign: {
3911
+ parameters: {
3912
+ path: {
3913
+ /**
3914
+ * @description Name or ID of the desired Org
3915
+ * @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
3916
+ */
3917
+ org_id: string;
3918
+ /**
3919
+ * @description Hex-encoded EVM address of the Secp256k1 key
3920
+ * @example 0x49011adbCC3bC9c0307BB07F37Dda1a1a9c69d2E
3921
+ */
3922
+ pubkey: string;
3923
+ };
3924
+ };
3925
+ requestBody: {
3926
+ content: {
3927
+ "application/json": components["schemas"]["Eip191SignRequest"];
3928
+ };
3929
+ };
3930
+ responses: {
3931
+ 200: components["responses"]["Eip191Or712SignResponse"];
3932
+ 202: {
3933
+ content: {
3934
+ "application/json": components["schemas"]["AcceptedResponse"];
3935
+ };
3936
+ };
3937
+ default: {
3938
+ content: {
3939
+ "application/json": components["schemas"]["ErrorResponse"];
3940
+ };
3941
+ };
3942
+ };
3943
+ };
3813
3944
  /**
3814
3945
  * Sign EIP-712 Typed Data
3815
3946
  * @description Sign EIP-712 Typed Data
@@ -3825,7 +3956,7 @@ export interface operations {
3825
3956
  */
3826
3957
  org_id: string;
3827
3958
  /**
3828
- * @description Hex-encoded ethereum address of the secp key
3959
+ * @description Hex-encoded EVM address of the Secp256k1 key
3829
3960
  * @example 0x49011adbCC3bC9c0307BB07F37Dda1a1a9c69d2E
3830
3961
  */
3831
3962
  pubkey: string;
@@ -3837,7 +3968,7 @@ export interface operations {
3837
3968
  };
3838
3969
  };
3839
3970
  responses: {
3840
- 200: components["responses"]["Eip712SignResponse"];
3971
+ 200: components["responses"]["Eip191Or712SignResponse"];
3841
3972
  202: {
3842
3973
  content: {
3843
3974
  "application/json": components["schemas"]["AcceptedResponse"];
@@ -4532,7 +4663,7 @@ export interface operations {
4532
4663
  * @description Delete Role
4533
4664
  *
4534
4665
  * Deletes a role in an organization.
4535
- * Only organization owners can perform this action.
4666
+ * Only users in the role can perform this action.
4536
4667
  */
4537
4668
  deleteRole: {
4538
4669
  parameters: {
@@ -4562,7 +4693,8 @@ export interface operations {
4562
4693
  * Update Role
4563
4694
  * @description Update Role
4564
4695
  *
4565
- * Enables or disables a role.
4696
+ * Enables or disables a role (this requires the `manage:role:update:enable` scope).
4697
+ * Updates the role's policies (this requires the `manage:role:update:policy` scope).
4566
4698
  * The user must be in the role or an owner of the organization.
4567
4699
  */
4568
4700
  updateRole: {
@@ -4961,7 +5093,8 @@ export interface operations {
4961
5093
  * Create new user session (management and/or signing)
4962
5094
  * @description Create new user session (management and/or signing)
4963
5095
  *
4964
- * Create a new user session
5096
+ * Creates a new user session, silently truncating requested session and auth lifetimes
5097
+ * to be at most requestor's session and auth lifetime, respectively.
4965
5098
  */
4966
5099
  createSession: {
4967
5100
  parameters: {
@@ -5863,9 +5996,9 @@ export interface operations {
5863
5996
  org_id: string;
5864
5997
  };
5865
5998
  };
5866
- requestBody: {
5999
+ requestBody?: {
5867
6000
  content: {
5868
- "application/json": components["schemas"]["HeartbeatRequest"];
6001
+ "application/json": components["schemas"]["HeartbeatRequest"] | null;
5869
6002
  };
5870
6003
  };
5871
6004
  responses: {
@@ -6073,3 +6206,4 @@ export interface operations {
6073
6206
  };
6074
6207
  };
6075
6208
  }
6209
+ export {};