@cubist-labs/cubesigner-sdk 0.3.13 → 0.3.19

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 (42) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/package.json +2 -2
  3. package/dist/cjs/src/api.d.ts +50 -5
  4. package/dist/cjs/src/api.js +71 -20
  5. package/dist/cjs/src/client.d.ts +4 -0
  6. package/dist/cjs/src/error.d.ts +2 -0
  7. package/dist/cjs/src/error.js +1 -1
  8. package/dist/cjs/src/evm/index.d.ts +74 -0
  9. package/dist/cjs/src/evm/index.js +165 -0
  10. package/dist/cjs/src/index.d.ts +2 -0
  11. package/dist/cjs/src/index.js +3 -1
  12. package/dist/cjs/src/org.d.ts +8 -1
  13. package/dist/cjs/src/org.js +11 -1
  14. package/dist/cjs/src/schema.d.ts +117 -7
  15. package/dist/cjs/src/schema.js +1 -1
  16. package/dist/cjs/src/schema_types.d.ts +3 -1
  17. package/dist/cjs/src/schema_types.js +1 -1
  18. package/dist/esm/package.json +2 -2
  19. package/dist/esm/src/api.d.ts +50 -5
  20. package/dist/esm/src/api.js +72 -21
  21. package/dist/esm/src/client.d.ts +4 -0
  22. package/dist/esm/src/error.d.ts +2 -0
  23. package/dist/esm/src/error.js +1 -1
  24. package/dist/esm/src/evm/index.d.ts +74 -0
  25. package/dist/esm/src/evm/index.js +161 -0
  26. package/dist/esm/src/index.d.ts +2 -0
  27. package/dist/esm/src/index.js +3 -1
  28. package/dist/esm/src/org.d.ts +8 -1
  29. package/dist/esm/src/org.js +12 -2
  30. package/dist/esm/src/schema.d.ts +117 -7
  31. package/dist/esm/src/schema.js +1 -1
  32. package/dist/esm/src/schema_types.d.ts +3 -1
  33. package/dist/esm/src/schema_types.js +1 -1
  34. package/package.json +2 -2
  35. package/src/api.ts +96 -19
  36. package/src/error.ts +2 -0
  37. package/src/evm/index.ts +192 -0
  38. package/src/index.ts +2 -0
  39. package/src/org.ts +17 -1
  40. package/src/schema.ts +134 -7
  41. package/src/schema_types.ts +3 -1
  42. package/tsconfig.json +3 -3
package/src/schema.ts CHANGED
@@ -287,7 +287,12 @@ export interface paths {
287
287
  * Login with OIDC
288
288
  * @description Login with OIDC
289
289
  *
290
- * Exchange an OIDC ID token (passed via the `Authorization` header) for a signer session
290
+ * Exchange an OIDC ID token (passed via the `Authorization` header) for a signer session.
291
+ *
292
+ * MFA is required when:
293
+ * - an MFA policy is explicitly attached to the user logging in
294
+ * (e.g., an org owner can do that at user creation time to require certain kind of MFA)
295
+ * - the user has at least 1 MFA factor configured
291
296
  */
292
297
  post: operations["oidcAuth"];
293
298
  };
@@ -1088,7 +1093,10 @@ export interface components {
1088
1093
  | "ExportWindowTooLong"
1089
1094
  | "InvalidTotpFailureLimit"
1090
1095
  | "InvalidEip191SignRequest"
1091
- | "CannotResendUserInvitation";
1096
+ | "CannotResendUserInvitation"
1097
+ | "InvalidNotificationEndpointCount"
1098
+ | "InvalidNotificationUrlProtocol"
1099
+ | "EmptyOneOfOrgEventFilter";
1092
1100
  /**
1093
1101
  * @example {
1094
1102
  * "message_base64": "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoxMjM0NTYK"
@@ -1717,7 +1725,7 @@ export interface components {
1717
1725
  };
1718
1726
  GetUsersInOrgResponse: {
1719
1727
  /** @description The list of users in the org */
1720
- users: components["schemas"]["UserIdInfo"][];
1728
+ users: components["schemas"]["UserInOrgInfo"][];
1721
1729
  };
1722
1730
  /** @description Stats pertaining the the sender `cube3signer` instance */
1723
1731
  HeartbeatRequest: {
@@ -1888,7 +1896,10 @@ export interface components {
1888
1896
  | "AvaSignSignatureMissing"
1889
1897
  | "ExpectedRoleSession"
1890
1898
  | "InvalidThirdPartyIdentity"
1891
- | "CognitoGetUser";
1899
+ | "CognitoGetUser"
1900
+ | "SnsSubscribeError"
1901
+ | "SnsUnsubscribeError"
1902
+ | "SnsPublishBatchError";
1892
1903
  InviteRequest: {
1893
1904
  /**
1894
1905
  * @description The user's email address
@@ -2204,6 +2215,12 @@ export interface components {
2204
2215
  | "TotpChallengeNotFound"
2205
2216
  | "UserExportRequestNotFound"
2206
2217
  | "UserExportCiphertextNotFound";
2218
+ /** @description The configuration for an org event endpoint */
2219
+ NotificationEndpointConfiguration: {
2220
+ filter?: components["schemas"]["OrgEventFilter"];
2221
+ /** @description URL of the endpoint */
2222
+ url: string;
2223
+ };
2207
2224
  /**
2208
2225
  * @description Represents a globally unique OIDC-authorized user by expressing the full "path" to a user. That is:
2209
2226
  *
@@ -2244,6 +2261,30 @@ export interface components {
2244
2261
  scopes: string[];
2245
2262
  tokens?: components["schemas"]["RatchetConfig"];
2246
2263
  };
2264
+ /**
2265
+ * @description Auto-generated discriminant enum variants
2266
+ * @enum {string}
2267
+ */
2268
+ OrgEventDiscriminants:
2269
+ | "OidcAuth"
2270
+ | "Eth2ConcurrentAttestationSigning"
2271
+ | "Eth2ConcurrentBlockSigning"
2272
+ | "Eth2InvalidBlockProposerSlotTooLow"
2273
+ | "Eth2InvalidAttestationSourceEpochTooLow"
2274
+ | "Eth2InvalidAttestationTargetEpochTooLow"
2275
+ | "Eth2Unstake"
2276
+ | "Eth2ExceededMaxUnstake"
2277
+ | "MfaRejected";
2278
+ /** @description Filter for org events */
2279
+ OrgEventFilter: OneOf<
2280
+ [
2281
+ "All",
2282
+ {
2283
+ /** @description Only accepts org events that are one of the listed events */
2284
+ OneOf: components["schemas"]["OrgEventDiscriminants"][];
2285
+ },
2286
+ ]
2287
+ >;
2247
2288
  OrgInfo: {
2248
2289
  /** @description When false, all cryptographic operations involving keys in this org are disabled. */
2249
2290
  enabled: boolean;
@@ -2270,6 +2311,17 @@ export interface components {
2270
2311
  * @example my_org_name
2271
2312
  */
2272
2313
  name?: string | null;
2314
+ /**
2315
+ * @description The organization's notification endpoints, which are HTTPS URLs are notified about a
2316
+ * configurable set of events in an organization. For each event, CubeSigner sends a POST
2317
+ * request with a JSON-formatted body that contains the event details.
2318
+ * @example [
2319
+ * {
2320
+ * "url": "https://example.com/endpoint"
2321
+ * }
2322
+ * ]
2323
+ */
2324
+ notification_endpoints?: Record<string, never>[];
2273
2325
  /**
2274
2326
  * @description The ID of the organization
2275
2327
  * @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
@@ -3129,6 +3181,44 @@ export interface components {
3129
3181
  * @example my_org
3130
3182
  */
3131
3183
  name?: string | null;
3184
+ /**
3185
+ * @description If set, update this org's notification endpoints. Notification endpoints are expected to be
3186
+ * HTTPS URLs, which accept POST requests. The body of the requests sent to these endpoints are
3187
+ * are formatted in JSON and have the following format:
3188
+ *
3189
+ * ```json
3190
+ * {
3191
+ * "org": "...",
3192
+ * "utc_timestamp": "...",
3193
+ * "org_event": "...",
3194
+ * ...
3195
+ * }
3196
+ * ```
3197
+ *
3198
+ * `org` is the org id, `utc_timestamp` is the UTC timestamp of the event in milliseconds, and
3199
+ * `org_event` is a string identifying the type of event that has occurred. The rest of the
3200
+ * fields provide additional information related to the type of the event.
3201
+ *
3202
+ * Endpoints can optionally include filters to customize the org events that they are notified
3203
+ * about. Currently, the only supported filter type is `OneOf`, which expects a list of org
3204
+ * event types to send to the endpoint. If no filter is configured, the system sends all org
3205
+ * events to the endpoint.
3206
+ * @example [
3207
+ * {
3208
+ * "url:": "https://example.com/endpoint1"
3209
+ * },
3210
+ * {
3211
+ * "filter": {
3212
+ * "OneOf": [
3213
+ * "Eth2ConcurrentAttestationSigning",
3214
+ * "Eth2ConcurrentBlockSigning"
3215
+ * ]
3216
+ * },
3217
+ * "url:": "https://example.com/endpoint2"
3218
+ * }
3219
+ * ]
3220
+ */
3221
+ notification_endpoints?: Record<string, never>[] | null;
3132
3222
  /**
3133
3223
  * @description If set, update this org's policies (old policies will be overwritten!).
3134
3224
  * @example [
@@ -3181,6 +3271,15 @@ export interface components {
3181
3271
  * @example my_org_name
3182
3272
  */
3183
3273
  name?: string | null;
3274
+ /**
3275
+ * @description The new notification endpoint configurations
3276
+ * @example [
3277
+ * {
3278
+ * "url": "https://example.com/endpoint"
3279
+ * }
3280
+ * ]
3281
+ */
3282
+ notification_endpoints?: Record<string, never>[];
3184
3283
  /**
3185
3284
  * @description The ID of the organization
3186
3285
  * @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
@@ -3328,7 +3427,7 @@ export interface components {
3328
3427
  public_key_hash?: string | null;
3329
3428
  valid_epoch: components["schemas"]["EpochDateTime"];
3330
3429
  };
3331
- UserIdInfo: {
3430
+ UserInOrgInfo: {
3332
3431
  /**
3333
3432
  * @description The user's email
3334
3433
  * @example alice@example.com
@@ -3339,6 +3438,9 @@ export interface components {
3339
3438
  * @example User#c3b9379c-4e8c-4216-bd0a-65ace53cf98f
3340
3439
  */
3341
3440
  id: string;
3441
+ membership: components["schemas"]["MemberRole"];
3442
+ /** @description Optional user name. */
3443
+ name?: string | null;
3342
3444
  };
3343
3445
  UserInRoleInfo: {
3344
3446
  user_id: string;
@@ -3540,7 +3642,7 @@ export interface components {
3540
3642
  content: {
3541
3643
  "application/json": {
3542
3644
  /** @description The list of users in the org */
3543
- users: components["schemas"]["UserIdInfo"][];
3645
+ users: components["schemas"]["UserInOrgInfo"][];
3544
3646
  };
3545
3647
  };
3546
3648
  };
@@ -3748,6 +3850,17 @@ export interface components {
3748
3850
  * @example my_org_name
3749
3851
  */
3750
3852
  name?: string | null;
3853
+ /**
3854
+ * @description The organization's notification endpoints, which are HTTPS URLs are notified about a
3855
+ * configurable set of events in an organization. For each event, CubeSigner sends a POST
3856
+ * request with a JSON-formatted body that contains the event details.
3857
+ * @example [
3858
+ * {
3859
+ * "url": "https://example.com/endpoint"
3860
+ * }
3861
+ * ]
3862
+ */
3863
+ notification_endpoints?: Record<string, never>[];
3751
3864
  /**
3752
3865
  * @description The ID of the organization
3753
3866
  * @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
@@ -4067,6 +4180,15 @@ export interface components {
4067
4180
  * @example my_org_name
4068
4181
  */
4069
4182
  name?: string | null;
4183
+ /**
4184
+ * @description The new notification endpoint configurations
4185
+ * @example [
4186
+ * {
4187
+ * "url": "https://example.com/endpoint"
4188
+ * }
4189
+ * ]
4190
+ */
4191
+ notification_endpoints?: Record<string, never>[];
4070
4192
  /**
4071
4193
  * @description The ID of the organization
4072
4194
  * @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
@@ -5084,7 +5206,12 @@ export interface operations {
5084
5206
  * Login with OIDC
5085
5207
  * @description Login with OIDC
5086
5208
  *
5087
- * Exchange an OIDC ID token (passed via the `Authorization` header) for a signer session
5209
+ * Exchange an OIDC ID token (passed via the `Authorization` header) for a signer session.
5210
+ *
5211
+ * MFA is required when:
5212
+ * - an MFA policy is explicitly attached to the user logging in
5213
+ * (e.g., an org owner can do that at user creation time to require certain kind of MFA)
5214
+ * - the user has at least 1 MFA factor configured
5088
5215
  */
5089
5216
  oidcAuth: {
5090
5217
  parameters: {
@@ -23,9 +23,11 @@ export type PublicKeyCredentialUserEntity = schemas["PublicKeyCredentialUserEnti
23
23
  export type PublicKeyCredential = schemas["PublicKeyCredential"];
24
24
 
25
25
  export type OrgInfo = schemas["OrgInfo"];
26
- export type UserIdInfo = schemas["UserIdInfo"];
26
+ export type UserInOrgInfo = schemas["UserInOrgInfo"];
27
27
  export type UpdateOrgRequest = schemas["UpdateOrgRequest"];
28
28
  export type UpdateOrgResponse = schemas["UpdateOrgResponse"];
29
+ export type NotificationEndpointConfiguration = schemas["NotificationEndpointConfiguration"];
30
+ export type OrgEvents = schemas["OrgEventDiscriminants"];
29
31
 
30
32
  export type OidcIdentity = schemas["OIDCIdentity"];
31
33
  export type MemberRole = schemas["MemberRole"];
package/tsconfig.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "extends": "../../tsconfig.json",
3
3
  "compilerOptions": {
4
- "outDir": "./dist",
4
+ "outDir": "./dist"
5
5
  },
6
6
  "typedocOptions": {
7
7
  "out": "./docs",
8
- "entryPoints": ["src/index.ts", "src/env.ts", "src/schema.ts"],
8
+ "entryPoints": ["src/index.ts", "src/env.ts", "src/schema.ts"]
9
9
  },
10
10
  "exclude": ["spec", "node_modules", "dist"],
11
- "include": ["src/**/*.ts"],
11
+ "include": ["src/**/*.ts"]
12
12
  }