@cubist-labs/cubesigner-sdk 0.4.236 → 0.4.239

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/src/schema.ts CHANGED
@@ -1035,6 +1035,31 @@ export interface paths {
1035
1035
  */
1036
1036
  post: operations["invokePolicy"];
1037
1037
  };
1038
+ "/v0/org/{org_id}/policy/buckets": {
1039
+ /**
1040
+ * List Buckets
1041
+ * @description List Buckets
1042
+ *
1043
+ * List available meta information about all policy KV store buckets in the org.
1044
+ */
1045
+ get: operations["listPolicyBuckets"];
1046
+ };
1047
+ "/v0/org/{org_id}/policy/buckets/{bucket_name}": {
1048
+ /**
1049
+ * Get Bucket
1050
+ * @description Get Bucket
1051
+ *
1052
+ * Returns the meta information of a policy KV store bucket.
1053
+ */
1054
+ get: operations["getPolicyBucket"];
1055
+ /**
1056
+ * Update Bucket
1057
+ * @description Update Bucket
1058
+ *
1059
+ * Updates meta information for an existing policy KV store bucket.
1060
+ */
1061
+ patch: operations["updatePolicyBucket"];
1062
+ };
1038
1063
  "/v0/org/{org_id}/policy/import_key": {
1039
1064
  /**
1040
1065
  * Create Policy Import Key
@@ -1050,7 +1075,7 @@ export interface paths {
1050
1075
  * Get the org-wide policy secrets.
1051
1076
  * @description Get the org-wide policy secrets.
1052
1077
  *
1053
- * Note that this only returns the keys for the secrets, omiting the values.
1078
+ * Note that this only returns the keys for the secrets, omitting the values.
1054
1079
  * The values are secret and are not accessible outside Wasm policy execution.
1055
1080
  */
1056
1081
  get: operations["getPolicySecrets"];
@@ -1859,8 +1884,7 @@ export interface components {
1859
1884
  */
1860
1885
  Aud: string | string[];
1861
1886
  AuditLogEntry: {
1862
- /** @description The name of the event */
1863
- event: string;
1887
+ event: components["schemas"]["OrgEventDiscriminants"];
1864
1888
  /** @description UUID of the event. Unique across all events. */
1865
1889
  event_id: string;
1866
1890
  org_id: components["schemas"]["Id"];
@@ -2997,6 +3021,9 @@ export interface components {
2997
3021
  | "SetPolicySecret"
2998
3022
  | "DeletePolicySecret"
2999
3023
  | "CreatePolicyImportKey"
3024
+ | "GetPolicyBucket"
3025
+ | "ListPolicyBuckets"
3026
+ | "UpdatePolicyBucket"
3000
3027
  | "UserExportDelete"
3001
3028
  | "UserExportList"
3002
3029
  | "UserExportInit"
@@ -3328,6 +3355,57 @@ export interface components {
3328
3355
  */
3329
3356
  value: number;
3330
3357
  };
3358
+ /**
3359
+ * @description The access-controlled actions that can be performed on a bucket
3360
+ * @enum {string}
3361
+ */
3362
+ BucketAction:
3363
+ | "read:key:value"
3364
+ | "read:key:exists"
3365
+ | "update:key:value"
3366
+ | "delete:key:value"
3367
+ | "scan:keys"
3368
+ | "update:bucket:owner"
3369
+ | "update:bucket:acl"
3370
+ | "update:bucket:metadata";
3371
+ /** @description Information about a policy KV store bucket. */
3372
+ BucketInfo: ({
3373
+ created?: components["schemas"]["EpochDateTime"] | null;
3374
+ last_modified?: components["schemas"]["EpochDateTime"] | null;
3375
+ /**
3376
+ * Format: int64
3377
+ * @description Version of this object
3378
+ */
3379
+ version?: number;
3380
+ } & {
3381
+ /** @description The access-control entries for the bucket. */
3382
+ acl?: unknown[] | null;
3383
+ /** @description Arbitrary user-defined metadata. */
3384
+ metadata?: unknown;
3385
+ owner: components["schemas"]["Id"];
3386
+ }) & {
3387
+ /** @description The name of the bucket. */
3388
+ name: string;
3389
+ };
3390
+ /**
3391
+ * @description Sub-entity of org where per-bucket metadata (like ACL) is stored.
3392
+ * The [Id] of a [BucketMeta] must be the bucket name.
3393
+ */
3394
+ BucketMeta: {
3395
+ created?: components["schemas"]["EpochDateTime"] | null;
3396
+ last_modified?: components["schemas"]["EpochDateTime"] | null;
3397
+ /**
3398
+ * Format: int64
3399
+ * @description Version of this object
3400
+ */
3401
+ version?: number;
3402
+ } & {
3403
+ /** @description The access-control entries for the bucket. */
3404
+ acl?: unknown[] | null;
3405
+ /** @description Arbitrary user-defined metadata. */
3406
+ metadata?: unknown;
3407
+ owner: components["schemas"]["Id"];
3408
+ };
3331
3409
  CancelInvitationRequest: {
3332
3410
  email: components["schemas"]["Email"];
3333
3411
  };
@@ -4749,6 +4827,13 @@ export interface components {
4749
4827
  | "manage:policy:secrets:update:values"
4750
4828
  | "manage:policy:secrets:update:acl"
4751
4829
  | "manage:policy:secrets:update:editPolicy"
4830
+ | "manage:policy:buckets:*"
4831
+ | "manage:policy:buckets:get"
4832
+ | "manage:policy:buckets:list"
4833
+ | "manage:policy:buckets:update:*"
4834
+ | "manage:policy:buckets:update:owner"
4835
+ | "manage:policy:buckets:update:acl"
4836
+ | "manage:policy:buckets:update:metadata"
4752
4837
  | "manage:contact:*"
4753
4838
  | "manage:contact:readonly"
4754
4839
  | "manage:contact:create"
@@ -5007,6 +5092,7 @@ export interface components {
5007
5092
  | "AutoAddBlsKeyToProtectedRole"
5008
5093
  | "UserNotPolicyOwner"
5009
5094
  | "UserNotContactOwner"
5095
+ | "UserNotBucketOwner"
5010
5096
  | "LegacySessionCannotHaveScopeCeiling"
5011
5097
  | "RoleInParentOrgNotAllowed"
5012
5098
  | "RemoveKeyFromRoleUserNotAllowed"
@@ -6060,6 +6146,7 @@ export interface components {
6060
6146
  | "OrgExportCiphertextNotFound"
6061
6147
  | "UploadObjectNotFound"
6062
6148
  | "PolicySecretNotFound"
6149
+ | "BucketMetaNotFound"
6063
6150
  | "TimestreamDisabled"
6064
6151
  | "CustomChainNotFound"
6065
6152
  | "InvitationNotFound"
@@ -6740,6 +6827,21 @@ export interface components {
6740
6827
  */
6741
6828
  last_evaluated_key?: string | null;
6742
6829
  };
6830
+ /**
6831
+ * @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
6832
+ * value (which can the user pass back to use as a url query parameter to continue pagination).
6833
+ */
6834
+ PaginatedListBucketsResponse: {
6835
+ /** @description The buckets in the organization. */
6836
+ buckets: components["schemas"]["BucketInfo"][];
6837
+ } & {
6838
+ /**
6839
+ * @description If set, the content of `response` does not contain the entire result set.
6840
+ * To fetch the next page of the result set, call the same endpoint
6841
+ * but specify this value as the 'page.start' query parameter.
6842
+ */
6843
+ last_evaluated_key?: string | null;
6844
+ };
6743
6845
  /**
6744
6846
  * @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
6745
6847
  * value (which can the user pass back to use as a url query parameter to continue pagination).
@@ -7060,16 +7162,16 @@ export interface components {
7060
7162
  }) &
7061
7163
  Record<string, never>;
7062
7164
  /**
7063
- * PolicyAction
7064
7165
  * @description The access-controlled actions that can be performed on a named policy.
7065
- * @example read:policy
7066
7166
  * @enum {string}
7067
7167
  */
7068
7168
  PolicyAction:
7069
7169
  | "read:*"
7170
+ | "read"
7070
7171
  | "read:policy"
7071
7172
  | "read:logs"
7072
7173
  | "update:*"
7174
+ | "update"
7073
7175
  | "update:name"
7074
7176
  | "update:rules"
7075
7177
  | "update:metadata"
@@ -8791,6 +8893,23 @@ export interface components {
8791
8893
  /** @description Optional policy evaluation tree. */
8792
8894
  policy_eval_tree?: unknown;
8793
8895
  } & Record<string, never>;
8896
+ /** @description The information needed to update a bucket. */
8897
+ UpdateBucketRequest: {
8898
+ /** @description Access-control entries defining how the bucket can be accessed. */
8899
+ acl?: unknown;
8900
+ /**
8901
+ * Format: int64
8902
+ * @description If set, updating only succeeds if the current version matches this value.
8903
+ */
8904
+ expected_version?: number | null;
8905
+ /** @description Optional metadata. */
8906
+ metadata?: unknown;
8907
+ /**
8908
+ * @description Update the owner of the bucket
8909
+ * @example User#00000000-0000-0000-0000-000000000000
8910
+ */
8911
+ owner?: string | null;
8912
+ };
8794
8913
  /** @description The information needed to update a Contact. */
8795
8914
  UpdateContactRequest: {
8796
8915
  addresses?: components["schemas"]["AddressMap"] | null;
@@ -9621,6 +9740,29 @@ export interface components {
9621
9740
  };
9622
9741
  };
9623
9742
  };
9743
+ /** @description Information about a policy KV store bucket. */
9744
+ BucketInfo: {
9745
+ content: {
9746
+ "application/json": ({
9747
+ created?: components["schemas"]["EpochDateTime"] | null;
9748
+ last_modified?: components["schemas"]["EpochDateTime"] | null;
9749
+ /**
9750
+ * Format: int64
9751
+ * @description Version of this object
9752
+ */
9753
+ version?: number;
9754
+ } & {
9755
+ /** @description The access-control entries for the bucket. */
9756
+ acl?: unknown[] | null;
9757
+ /** @description Arbitrary user-defined metadata. */
9758
+ metadata?: unknown;
9759
+ owner: components["schemas"]["Id"];
9760
+ }) & {
9761
+ /** @description The name of the bucket. */
9762
+ name: string;
9763
+ };
9764
+ };
9765
+ };
9624
9766
  /** @description The number of users and keys in an org, organized by user role and key type */
9625
9767
  ComputeCountsResponse: {
9626
9768
  content: {
@@ -10342,6 +10484,21 @@ export interface components {
10342
10484
  };
10343
10485
  };
10344
10486
  };
10487
+ PaginatedListBucketsResponse: {
10488
+ content: {
10489
+ "application/json": {
10490
+ /** @description The buckets in the organization. */
10491
+ buckets: components["schemas"]["BucketInfo"][];
10492
+ } & {
10493
+ /**
10494
+ * @description If set, the content of `response` does not contain the entire result set.
10495
+ * To fetch the next page of the result set, call the same endpoint
10496
+ * but specify this value as the 'page.start' query parameter.
10497
+ */
10498
+ last_evaluated_key?: string | null;
10499
+ };
10500
+ };
10501
+ };
10345
10502
  PaginatedListContactsResponse: {
10346
10503
  content: {
10347
10504
  "application/json": {
@@ -14602,6 +14759,108 @@ export interface operations {
14602
14759
  };
14603
14760
  };
14604
14761
  };
14762
+ /**
14763
+ * List Buckets
14764
+ * @description List Buckets
14765
+ *
14766
+ * List available meta information about all policy KV store buckets in the org.
14767
+ */
14768
+ listPolicyBuckets: {
14769
+ parameters: {
14770
+ query?: {
14771
+ /**
14772
+ * @description Max number of items to return per page.
14773
+ *
14774
+ * If the actual number of returned items may be less that this, even if there exist more
14775
+ * data in the result set. To reliably determine if more data is left in the result set,
14776
+ * inspect the [UnencryptedLastEvalKey] value in the response object.
14777
+ */
14778
+ "page.size"?: number;
14779
+ /**
14780
+ * @description The start of the page. Omit to start from the beginning; otherwise, only specify a
14781
+ * the exact value previously returned as 'last_evaluated_key' from the same endpoint.
14782
+ */
14783
+ "page.start"?: string | null;
14784
+ };
14785
+ path: {
14786
+ /**
14787
+ * @description Name or ID of the desired Org
14788
+ * @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
14789
+ */
14790
+ org_id: string;
14791
+ };
14792
+ };
14793
+ responses: {
14794
+ 200: components["responses"]["PaginatedListBucketsResponse"];
14795
+ default: {
14796
+ content: {
14797
+ "application/json": components["schemas"]["ErrorResponse"];
14798
+ };
14799
+ };
14800
+ };
14801
+ };
14802
+ /**
14803
+ * Get Bucket
14804
+ * @description Get Bucket
14805
+ *
14806
+ * Returns the meta information of a policy KV store bucket.
14807
+ */
14808
+ getPolicyBucket: {
14809
+ parameters: {
14810
+ path: {
14811
+ /**
14812
+ * @description Name or ID of the desired Org
14813
+ * @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
14814
+ */
14815
+ org_id: string;
14816
+ bucket_name: string;
14817
+ };
14818
+ };
14819
+ responses: {
14820
+ 200: components["responses"]["BucketInfo"];
14821
+ default: {
14822
+ content: {
14823
+ "application/json": components["schemas"]["ErrorResponse"];
14824
+ };
14825
+ };
14826
+ };
14827
+ };
14828
+ /**
14829
+ * Update Bucket
14830
+ * @description Update Bucket
14831
+ *
14832
+ * Updates meta information for an existing policy KV store bucket.
14833
+ */
14834
+ updatePolicyBucket: {
14835
+ parameters: {
14836
+ path: {
14837
+ /**
14838
+ * @description Name or ID of the desired Org
14839
+ * @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
14840
+ */
14841
+ org_id: string;
14842
+ bucket_name: string;
14843
+ };
14844
+ };
14845
+ requestBody: {
14846
+ content: {
14847
+ "application/json": components["schemas"]["UpdateBucketRequest"];
14848
+ };
14849
+ };
14850
+ responses: {
14851
+ 200: components["responses"]["BucketInfo"];
14852
+ 202: {
14853
+ content: {
14854
+ "application/json": components["schemas"]["AcceptedResponse"];
14855
+ };
14856
+ };
14857
+ default: {
14858
+ content: {
14859
+ "application/json": components["schemas"]["ErrorResponse"];
14860
+ };
14861
+ };
14862
+ };
14863
+ };
14605
14864
  /**
14606
14865
  * Create Policy Import Key
14607
14866
  * @description Create Policy Import Key
@@ -14632,7 +14891,7 @@ export interface operations {
14632
14891
  * Get the org-wide policy secrets.
14633
14892
  * @description Get the org-wide policy secrets.
14634
14893
  *
14635
- * Note that this only returns the keys for the secrets, omiting the values.
14894
+ * Note that this only returns the keys for the secrets, omitting the values.
14636
14895
  * The values are secret and are not accessible outside Wasm policy execution.
14637
14896
  */
14638
14897
  getPolicySecrets: {
@@ -221,7 +221,7 @@ export type QueryMetricsRequest = schemas["QueryMetricsRequest"];
221
221
  export type QueryMetricsResponse = schemas["QueryMetricsResponse"];
222
222
  export type AuditLogRequest = schemas["AuditLogRequest"];
223
223
  export type AuditLogResponse = schemas["PaginatedAuditLogResponse"];
224
- export type AuditLogEntry = schemas["AuditLogEntry"];
224
+ export type { AuditLogEntry } from "./audit_log";
225
225
 
226
226
  export type DiffieHellmanRequest = schemas["DiffieHellmanRequest"];
227
227
  export type DiffieHellmanResponse = schemas["DiffieHellmanResponse"];
@@ -291,10 +291,20 @@ export type ImportKeyRequestMaterial = schemas["ImportKeyRequestMaterial"];
291
291
  export type InvitationAcceptRequest = schemas["InvitationAcceptRequest"];
292
292
 
293
293
  export type KeyTypeAndDerivationPath = schemas["KeyTypeAndDerivationPath"];
294
-
295
294
  export type PolicyInfo = schemas["PolicyInfo"] & {
296
295
  acl?: JsonValue[];
297
296
  };
297
+
298
+ /**
299
+ * Coerce the less accurate `PolicyInfo` type from the OpenAPI schema to a more accurate {@link PolicyInfo}.
300
+ *
301
+ * @param p The policy info received on the wire
302
+ * @returns The same value coerced to {@link PolicyInfo}
303
+ */
304
+ export function coercePolicyInfo(p: schemas["PolicyInfo"]): PolicyInfo {
305
+ return p as PolicyInfo;
306
+ }
307
+
298
308
  export type UpdatePolicyRequest = schemas["UpdatePolicyRequest"] & {
299
309
  rules?: JsonValue[];
300
310
  acl?: JsonValue[];
@@ -303,6 +313,10 @@ export type ListPoliciesResponse = schemas["PaginatedListPoliciesResponse"];
303
313
  export type PolicyType = schemas["PolicyType"];
304
314
  export type PolicyAttachedToId = schemas["PolicyAttachedToId"];
305
315
 
316
+ export type ListBucketsResponse = schemas["PaginatedListBucketsResponse"];
317
+ export type UpdateBucketRequest = schemas["UpdateBucketRequest"];
318
+ export type BucketAction = schemas["BucketAction"];
319
+
306
320
  export type UploadWasmPolicyRequest = schemas["UploadWasmPolicyRequest"];
307
321
  export type UploadWasmPolicyResponse = schemas["UploadWasmPolicyResponse"];
308
322
  export type InvokePolicyRequest = schemas["InvokePolicyRequest"];
package/src/scopes.ts CHANGED
@@ -115,6 +115,13 @@ export const AllScopes: Record<ExplicitScope, string> =
115
115
  "manage:policy:secrets:update:values" : "Allows access only to the policy secrets 'update' endpoint, but restricting updates to the secrets keys and values",
116
116
  "manage:policy:secrets:update:acl" : "Allows access only to the policy secrets 'update' endpoint, but restricting updates to the secrets acl",
117
117
  "manage:policy:secrets:update:editPolicy" : "Allows access only to the policy secrets 'update' endpoint, but restricting updates to the `edit_policy` property",
118
+ "manage:policy:buckets:*" : "Allows access to all policy buckets endpoints",
119
+ "manage:policy:buckets:get" : "Allows access only to the policy buckets 'get' endpoint",
120
+ "manage:policy:buckets:list" : "Allows access only to the policy buckets 'list' endpoint",
121
+ "manage:policy:buckets:update:*" : "Allows access only to the policy buckets 'update' endpoint",
122
+ "manage:policy:buckets:update:owner" : "Allows access only to the policy buckets 'update' endpoint, but restricting updates to the `owner` property",
123
+ "manage:policy:buckets:update:acl" : "Allows access only to the policy buckets 'update' endpoint, but restricting updates to the `acl` property",
124
+ "manage:policy:buckets:update:metadata" : "Allows access only to the policy buckets 'update' endpoint, but restricting updates to the `metadata` property",
118
125
  "manage:contact:*" : "Allows access to all contact endpoints",
119
126
  "manage:contact:readonly" : "Allows access to all contact readonly endpoints",
120
127
  "manage:contact:create" : "Allows access to the contact 'create' endpoint",