@raystack/frontier 0.0.8 → 0.0.9

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.
@@ -214,12 +214,28 @@ interface V1Beta1AuthenticateResponse {
214
214
  /** state is used for resuming authentication flow in applicable strategies */
215
215
  state?: string;
216
216
  }
217
+ interface V1Beta1BatchCheckPermissionBody {
218
+ /** the permission name to check. <br/> *Example:* `get` or `list` */
219
+ permission: string;
220
+ /** `namespace:uuid` or `namespace:name` of the org or project, and `namespace:urn` of a resource under a project. In case of an org/project either provide the complete namespace (app/organization) or Frontier can also parse aliases for the same as `org` or `project`. <br/> *Example:* `organization:92f69c3a-334b-4f25-90b8-4d4f3be6b825` or `app/project:project-name` or `compute/instance:92f69c3a-334b-4f25-90b8-4d4f3be6b825` */
221
+ resource?: string;
222
+ }
223
+ interface V1Beta1BatchCheckPermissionRequest {
224
+ bodies?: V1Beta1BatchCheckPermissionBody[];
225
+ }
226
+ interface V1Beta1BatchCheckPermissionResponse {
227
+ pairs?: V1Beta1BatchCheckPermissionResponsePair[];
228
+ }
229
+ interface V1Beta1BatchCheckPermissionResponsePair {
230
+ body?: V1Beta1BatchCheckPermissionBody;
231
+ status?: boolean;
232
+ }
217
233
  interface V1Beta1CheckResourcePermissionRequest {
218
234
  /** Deprecated. Use `resource` field instead. */
219
235
  objectId?: string;
220
236
  /** Deprecated. Use `resource` field instead. */
221
237
  objectNamespace?: string;
222
- /** the permission name to check. <br/> *Example:* `get` or `list` */
238
+ /** the permission name to check. <br/> *Example:* `get`, `list`, `compute.instance.create` */
223
239
  permission: string;
224
240
  /** `namespace:uuid` or `namespace:name` of the org or project, and `namespace:urn` of a resource under a project. In case of an org/project either provide the complete namespace (app/organization) or Frontier can also parse aliases for the same as `org` or `project`. <br/> *Example:* `organization:92f69c3a-334b-4f25-90b8-4d4f3be6b825` or `app/project:project-name` or `compute/instance:92f69c3a-334b-4f25-90b8-4d4f3be6b825` */
225
241
  resource?: string;
@@ -381,14 +397,6 @@ interface V1Beta1GetOrganizationResponse {
381
397
  interface V1Beta1GetOrganizationRoleResponse {
382
398
  role?: V1Beta1Role;
383
399
  }
384
- interface V1Beta1GetOrganizationsByCurrentUserResponse {
385
- organizations?: V1Beta1Organization[];
386
- joinableViaDomain?: V1Beta1Organization[];
387
- }
388
- interface V1Beta1GetOrganizationsByUserResponse {
389
- organizations?: V1Beta1Organization[];
390
- joinableViaDomain?: V1Beta1Organization[];
391
- }
392
400
  interface V1Beta1GetPermissionResponse {
393
401
  permission?: V1Beta1Permission;
394
402
  }
@@ -401,12 +409,6 @@ interface V1Beta1GetProjectResourceResponse {
401
409
  interface V1Beta1GetProjectResponse {
402
410
  project?: V1Beta1Project;
403
411
  }
404
- interface V1Beta1GetProjectsByCurrentUserResponse {
405
- projects?: V1Beta1Project[];
406
- }
407
- interface V1Beta1GetProjectsByUserResponse {
408
- projects?: V1Beta1Project[];
409
- }
410
412
  interface V1Beta1GetRelationResponse {
411
413
  relation?: V1Beta1Relation;
412
414
  }
@@ -531,6 +533,11 @@ interface V1Beta1ListAuthStrategiesResponse {
531
533
  }
532
534
  interface V1Beta1ListCurrentUserGroupsResponse {
533
535
  groups?: V1Beta1Group[];
536
+ accessPairs?: V1Beta1ListCurrentUserGroupsResponseAccessPair[];
537
+ }
538
+ interface V1Beta1ListCurrentUserGroupsResponseAccessPair {
539
+ groupId?: string;
540
+ permissions?: string[];
534
541
  }
535
542
  interface V1Beta1ListCurrentUserPreferencesResponse {
536
543
  preferences?: V1Beta1Preference[];
@@ -540,6 +547,11 @@ interface V1Beta1ListGroupPreferencesResponse {
540
547
  }
541
548
  interface V1Beta1ListGroupUsersResponse {
542
549
  users?: V1Beta1User[];
550
+ rolePairs?: V1Beta1ListGroupUsersResponseRolePair[];
551
+ }
552
+ interface V1Beta1ListGroupUsersResponseRolePair {
553
+ userId?: string;
554
+ roles?: V1Beta1Role[];
543
555
  }
544
556
  interface V1Beta1ListGroupsResponse {
545
557
  groups?: V1Beta1Group[];
@@ -580,6 +592,14 @@ interface V1Beta1ListOrganizationServiceUsersResponse {
580
592
  interface V1Beta1ListOrganizationUsersResponse {
581
593
  users?: V1Beta1User[];
582
594
  }
595
+ interface V1Beta1ListOrganizationsByCurrentUserResponse {
596
+ organizations?: V1Beta1Organization[];
597
+ joinableViaDomain?: V1Beta1Organization[];
598
+ }
599
+ interface V1Beta1ListOrganizationsByUserResponse {
600
+ organizations?: V1Beta1Organization[];
601
+ joinableViaDomain?: V1Beta1Organization[];
602
+ }
583
603
  interface V1Beta1ListOrganizationsResponse {
584
604
  organizations?: V1Beta1Organization[];
585
605
  }
@@ -601,8 +621,32 @@ interface V1Beta1ListProjectPreferencesResponse {
601
621
  interface V1Beta1ListProjectResourcesResponse {
602
622
  resources?: V1Beta1Resource[];
603
623
  }
624
+ interface V1Beta1ListProjectServiceUsersResponse {
625
+ serviceusers?: V1Beta1ServiceUser[];
626
+ rolePairs?: V1Beta1ListProjectServiceUsersResponseRolePair[];
627
+ }
628
+ interface V1Beta1ListProjectServiceUsersResponseRolePair {
629
+ serviceuserId?: string;
630
+ roles?: V1Beta1Role[];
631
+ }
604
632
  interface V1Beta1ListProjectUsersResponse {
605
633
  users?: V1Beta1User[];
634
+ rolePairs?: V1Beta1ListProjectUsersResponseRolePair[];
635
+ }
636
+ interface V1Beta1ListProjectUsersResponseRolePair {
637
+ userId?: string;
638
+ roles?: V1Beta1Role[];
639
+ }
640
+ interface V1Beta1ListProjectsByCurrentUserResponse {
641
+ projects?: V1Beta1Project[];
642
+ accessPairs?: V1Beta1ListProjectsByCurrentUserResponseAccessPair[];
643
+ }
644
+ interface V1Beta1ListProjectsByCurrentUserResponseAccessPair {
645
+ projectId?: string;
646
+ permissions?: string[];
647
+ }
648
+ interface V1Beta1ListProjectsByUserResponse {
649
+ projects?: V1Beta1Project[];
606
650
  }
607
651
  interface V1Beta1ListProjectsResponse {
608
652
  projects?: V1Beta1Project[];
@@ -706,6 +750,13 @@ interface V1Beta1Organization {
706
750
  * @example "2023-06-07T05:39:56.961Z"
707
751
  */
708
752
  updatedAt?: string;
753
+ /**
754
+ * The state of the organization (enabled or disabled).
755
+ * @example "enabled"
756
+ */
757
+ state?: string;
758
+ /** The base64 encoded image string of the organization avatar. Should be less than 2MB. */
759
+ avatar?: string;
709
760
  }
710
761
  interface V1Beta1OrganizationRequestBody {
711
762
  /** The name of the organization. The name must be unique within the entire Frontier instance. The name can contain only alphanumeric characters, dashes and underscores.<br/>*Example:*`"frontier-org1-acme"` */
@@ -714,6 +765,11 @@ interface V1Beta1OrganizationRequestBody {
714
765
  title?: string;
715
766
  /** Metadata object for organizations that can hold key value pairs defined in Organization Metaschema. The metadata object can be used to store arbitrary information about the organization such as labels, descriptions etc. The default Organization Metaschema contains labels and descripton fields. Update the Organization Metaschema to add more fields. <br/>*Example*:`{"labels": {"key": "value"}, "description": "Organization description"}` */
716
767
  metadata?: object;
768
+ /**
769
+ * The avatar is base64 encoded image data of the user. Can also be left empty. The image should be less than 200KB. Should follow the regex pattern `^data:image/(png|jpg|jpeg|gif);base64,([a-zA-Z0-9+/]+={0,2})+$`.
770
+ * @example "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAA"
771
+ */
772
+ avatar?: string;
717
773
  }
718
774
  interface V1Beta1Permission {
719
775
  id?: string;
@@ -1077,7 +1133,13 @@ interface V1Beta1User {
1077
1133
  * @example "2023-06-07T05:39:56.961Z"
1078
1134
  */
1079
1135
  updatedAt?: string;
1136
+ /**
1137
+ * The state of the user (enabled or disabled).
1138
+ * @example "enabled"
1139
+ */
1080
1140
  state?: string;
1141
+ /** The base64 encoded image string of the user avatar. Should be less than 2MB. */
1142
+ avatar?: string;
1081
1143
  }
1082
1144
  interface V1Beta1UserRequestBody {
1083
1145
  /** The name of the user. The name must be unique within the entire Frontier instance. The name can contain only alphanumeric characters, dashes and underscores and must start with a letter. If not provided, Frontier automatically generates a name from the user email. */
@@ -1088,6 +1150,11 @@ interface V1Beta1UserRequestBody {
1088
1150
  metadata?: object;
1089
1151
  /** The title can contain any UTF-8 character, used to provide a human-readable name for the user. Can also be left empty. <br/>*Example:*`"John Doe"` */
1090
1152
  title?: string;
1153
+ /**
1154
+ * The avatar is base64 encoded image data of the user. Can also be left empty. The image should be less than 200KB. Should follow the regex pattern `^data:image/(png|jpg|jpeg|gif);base64,([a-zA-Z0-9+/]+={0,2})+$`.
1155
+ * @example "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAA"
1156
+ */
1157
+ avatar?: string;
1091
1158
  }
1092
1159
  interface V1Beta1VerifyOrganizationDomainResponse {
1093
1160
  state?: string;
@@ -1357,6 +1424,16 @@ declare class V1Beta1<SecurityDataType = unknown> extends HttpClient<SecurityDat
1357
1424
  * @secure
1358
1425
  */
1359
1426
  frontierServiceAuthToken: (body: V1Beta1AuthTokenRequest, params?: RequestParams) => Promise<HttpResponse<V1Beta1AuthTokenResponse, RpcStatus>>;
1427
+ /**
1428
+ * @description Returns true if a principal has required permissions to access a resource and false otherwise.<br/> Note the principal can be a user or a service account, and Frontier will the credentials from the current logged in principal from the session cookie (if any), or the client id and secret (in case of service users) or the access token (in case of human user accounts).
1429
+ *
1430
+ * @tags Authz
1431
+ * @name FrontierServiceBatchCheckPermission
1432
+ * @summary Batch check
1433
+ * @request POST:/v1beta1/batchcheck
1434
+ * @secure
1435
+ */
1436
+ frontierServiceBatchCheckPermission: (body: V1Beta1BatchCheckPermissionRequest, params?: RequestParams) => Promise<HttpResponse<V1Beta1BatchCheckPermissionResponse, RpcStatus>>;
1360
1437
  /**
1361
1438
  * @description Returns true if a principal has required permissions to access a resource and false otherwise.<br/> Note the principal can be a user or a service account, and Frontier will the credentials from the current logged in principal from the session cookie (if any), or the client id and secret (in case of service users) or the access token (in case of human user accounts).
1362
1439
  *
@@ -1804,7 +1881,9 @@ declare class V1Beta1<SecurityDataType = unknown> extends HttpClient<SecurityDat
1804
1881
  * @request GET:/v1beta1/organizations/{orgId}/groups/{id}/users
1805
1882
  * @secure
1806
1883
  */
1807
- frontierServiceListGroupUsers: (orgId: string, id: string, params?: RequestParams) => Promise<HttpResponse<V1Beta1ListGroupUsersResponse, RpcStatus>>;
1884
+ frontierServiceListGroupUsers: (orgId: string, id: string, query?: {
1885
+ withRoles?: boolean;
1886
+ }, params?: RequestParams) => Promise<HttpResponse<V1Beta1ListGroupUsersResponse, RpcStatus>>;
1808
1887
  /**
1809
1888
  * @description Adds a principle(user and service-users) to a group, existing users in the group will be ignored. A group can't have nested groups as members.
1810
1889
  *
@@ -2086,7 +2165,7 @@ declare class V1Beta1<SecurityDataType = unknown> extends HttpClient<SecurityDat
2086
2165
  * @tags Preference
2087
2166
  * @name FrontierServiceDescribePreferences
2088
2167
  * @summary Describe preferences
2089
- * @request GET:/v1beta1/preferences/_describe
2168
+ * @request GET:/v1beta1/preferences/traits
2090
2169
  * @secure
2091
2170
  */
2092
2171
  frontierServiceDescribePreferences: (params?: RequestParams) => Promise<HttpResponse<V1Beta1DescribePreferencesResponse, RpcStatus>>;
@@ -2182,6 +2261,18 @@ declare class V1Beta1<SecurityDataType = unknown> extends HttpClient<SecurityDat
2182
2261
  frontierServiceCreateProjectPreferences: (id: string, body: {
2183
2262
  bodies?: V1Beta1PreferenceRequestBody[];
2184
2263
  }, params?: RequestParams) => Promise<HttpResponse<V1Beta1CreateProjectPreferencesResponse, RpcStatus>>;
2264
+ /**
2265
+ * @description Returns a collection of users of a project. Filter by user permissions is supported.
2266
+ *
2267
+ * @tags Project
2268
+ * @name FrontierServiceListProjectServiceUsers
2269
+ * @summary List project serviceusers
2270
+ * @request GET:/v1beta1/projects/{id}/serviceusers
2271
+ * @secure
2272
+ */
2273
+ frontierServiceListProjectServiceUsers: (id: string, query?: {
2274
+ withRoles?: boolean;
2275
+ }, params?: RequestParams) => Promise<HttpResponse<V1Beta1ListProjectServiceUsersResponse, RpcStatus>>;
2185
2276
  /**
2186
2277
  * @description Returns a collection of users of a project. Filter by user permissions is supported.
2187
2278
  *
@@ -2193,6 +2284,7 @@ declare class V1Beta1<SecurityDataType = unknown> extends HttpClient<SecurityDat
2193
2284
  */
2194
2285
  frontierServiceListProjectUsers: (id: string, query?: {
2195
2286
  permissionFilter?: string;
2287
+ withRoles?: boolean;
2196
2288
  }, params?: RequestParams) => Promise<HttpResponse<V1Beta1ListProjectUsersResponse, RpcStatus>>;
2197
2289
  /**
2198
2290
  * No description
@@ -2557,12 +2649,12 @@ declare class V1Beta1<SecurityDataType = unknown> extends HttpClient<SecurityDat
2557
2649
  * @description This API returns two list of organizations for the user. i) The list of orgs which the current user is already a part of ii) The list of organizations the user can join directly (based on domain whitelisted and verified by the org). This list will also contain orgs of which user is already a part of. Note: the domain needs to be verified by the org before the it is returned as one of the joinable orgs by domain
2558
2650
  *
2559
2651
  * @tags User
2560
- * @name FrontierServiceGetOrganizationsByUser
2652
+ * @name FrontierServiceListOrganizationsByUser
2561
2653
  * @summary Get user organizations
2562
2654
  * @request GET:/v1beta1/users/{id}/organizations
2563
2655
  * @secure
2564
2656
  */
2565
- frontierServiceGetOrganizationsByUser: (id: string, params?: RequestParams) => Promise<HttpResponse<V1Beta1GetOrganizationsByUserResponse, RpcStatus>>;
2657
+ frontierServiceListOrganizationsByUser: (id: string, params?: RequestParams) => Promise<HttpResponse<V1Beta1ListOrganizationsByUserResponse, RpcStatus>>;
2566
2658
  /**
2567
2659
  * @description List a user preferences by ID.
2568
2660
  *
@@ -2589,12 +2681,12 @@ declare class V1Beta1<SecurityDataType = unknown> extends HttpClient<SecurityDat
2589
2681
  * @description Get all the projects a user belongs to.
2590
2682
  *
2591
2683
  * @tags User
2592
- * @name FrontierServiceGetProjectsByUser
2684
+ * @name FrontierServiceListProjectsByUser
2593
2685
  * @summary Get user projects
2594
2686
  * @request GET:/v1beta1/users/{id}/projects
2595
2687
  * @secure
2596
2688
  */
2597
- frontierServiceGetProjectsByUser: (id: string, params?: RequestParams) => Promise<HttpResponse<V1Beta1GetProjectsByUserResponse, RpcStatus>>;
2689
+ frontierServiceListProjectsByUser: (id: string, params?: RequestParams) => Promise<HttpResponse<V1Beta1ListProjectsByUserResponse, RpcStatus>>;
2598
2690
  /**
2599
2691
  * No description
2600
2692
  *
@@ -2624,17 +2716,21 @@ declare class V1Beta1<SecurityDataType = unknown> extends HttpClient<SecurityDat
2624
2716
  * @request GET:/v1beta1/users/self/groups
2625
2717
  * @secure
2626
2718
  */
2627
- frontierServiceListCurrentUserGroups: (params?: RequestParams) => Promise<HttpResponse<V1Beta1ListCurrentUserGroupsResponse, RpcStatus>>;
2719
+ frontierServiceListCurrentUserGroups: (query?: {
2720
+ /** org_id is optional filter over an organization */
2721
+ orgId?: string;
2722
+ withPermissions?: string[];
2723
+ }, params?: RequestParams) => Promise<HttpResponse<V1Beta1ListCurrentUserGroupsResponse, RpcStatus>>;
2628
2724
  /**
2629
2725
  * @description This API returns two list of organizations for the current logged in user. i) The list of orgs which the current user is already a part of ii) The list of organizations the user can join directly (based on domain whitelisted and verified by the org). This list will also contain orgs of which user is already a part of. Note: the domain needs to be verified by the org before the it is returned as one of the joinable orgs by domain
2630
2726
  *
2631
2727
  * @tags User
2632
- * @name FrontierServiceGetOrganizationsByCurrentUser
2728
+ * @name FrontierServiceListOrganizationsByCurrentUser
2633
2729
  * @summary Get my organizations
2634
2730
  * @request GET:/v1beta1/users/self/organizations
2635
2731
  * @secure
2636
2732
  */
2637
- frontierServiceGetOrganizationsByCurrentUser: (params?: RequestParams) => Promise<HttpResponse<V1Beta1GetOrganizationsByCurrentUserResponse, RpcStatus>>;
2733
+ frontierServiceListOrganizationsByCurrentUser: (params?: RequestParams) => Promise<HttpResponse<V1Beta1ListOrganizationsByCurrentUserResponse, RpcStatus>>;
2638
2734
  /**
2639
2735
  * @description List a user preferences by ID.
2640
2736
  *
@@ -2659,12 +2755,21 @@ declare class V1Beta1<SecurityDataType = unknown> extends HttpClient<SecurityDat
2659
2755
  * @description Get all projects the current user belongs to
2660
2756
  *
2661
2757
  * @tags User
2662
- * @name FrontierServiceGetProjectsByCurrentUser
2758
+ * @name FrontierServiceListProjectsByCurrentUser
2663
2759
  * @summary Get my projects
2664
2760
  * @request GET:/v1beta1/users/self/projects
2665
2761
  * @secure
2666
2762
  */
2667
- frontierServiceGetProjectsByCurrentUser: (params?: RequestParams) => Promise<HttpResponse<V1Beta1GetProjectsByCurrentUserResponse, RpcStatus>>;
2763
+ frontierServiceListProjectsByCurrentUser: (query?: {
2764
+ /** org_id is optional and filter projects by org */
2765
+ orgId?: string;
2766
+ /**
2767
+ * list of permissions needs to be checked against each project
2768
+ * query params are set as with_permissions=get&with_permissions=delete
2769
+ * to be represented as array
2770
+ */
2771
+ withPermissions?: string[];
2772
+ }, params?: RequestParams) => Promise<HttpResponse<V1Beta1ListProjectsByCurrentUserResponse, RpcStatus>>;
2668
2773
  }
2669
2774
 
2670
2775
  interface FrontierContextProviderProps {