@raystack/frontier 0.0.5 → 0.0.6
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/dist/index.d.ts +51 -2
- package/dist/index.js +19 -2
- package/dist/index.mjs +19 -2
- package/package.json +15 -14
- package/react/dist/index.d.ts +54 -1
- package/react/dist/index.js +239 -143
- package/react/dist/index.mjs +471 -375
package/dist/index.d.ts
CHANGED
|
@@ -152,6 +152,22 @@ interface V1Beta1AuthenticateResponse {
|
|
|
152
152
|
/** state is used for resuming authentication flow in applicable strategies */
|
|
153
153
|
state?: string;
|
|
154
154
|
}
|
|
155
|
+
interface V1Beta1BatchCheckPermissionBody {
|
|
156
|
+
/** the permission name to check. <br/> *Example:* `get` or `list` */
|
|
157
|
+
permission: string;
|
|
158
|
+
/** `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` */
|
|
159
|
+
resource?: string;
|
|
160
|
+
}
|
|
161
|
+
interface V1Beta1BatchCheckPermissionRequest {
|
|
162
|
+
bodies?: V1Beta1BatchCheckPermissionBody[];
|
|
163
|
+
}
|
|
164
|
+
interface V1Beta1BatchCheckPermissionResponse {
|
|
165
|
+
pairs?: V1Beta1BatchCheckPermissionResponsePair[];
|
|
166
|
+
}
|
|
167
|
+
interface V1Beta1BatchCheckPermissionResponsePair {
|
|
168
|
+
body?: V1Beta1BatchCheckPermissionBody;
|
|
169
|
+
status?: boolean;
|
|
170
|
+
}
|
|
155
171
|
interface V1Beta1CheckResourcePermissionRequest {
|
|
156
172
|
/** Deprecated. Use `resource` field instead. */
|
|
157
173
|
objectId?: string;
|
|
@@ -670,6 +686,13 @@ interface V1Beta1Organization {
|
|
|
670
686
|
* @example "2023-06-07T05:39:56.961Z"
|
|
671
687
|
*/
|
|
672
688
|
updatedAt?: string;
|
|
689
|
+
/**
|
|
690
|
+
* The state of the organization (enabled or disabled).
|
|
691
|
+
* @example "enabled"
|
|
692
|
+
*/
|
|
693
|
+
state?: string;
|
|
694
|
+
/** The base64 encoded image string of the organization avatar. Should be less than 2MB. */
|
|
695
|
+
avatar?: string;
|
|
673
696
|
}
|
|
674
697
|
interface V1Beta1OrganizationRequestBody {
|
|
675
698
|
/** 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"` */
|
|
@@ -678,6 +701,11 @@ interface V1Beta1OrganizationRequestBody {
|
|
|
678
701
|
title?: string;
|
|
679
702
|
/** 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"}` */
|
|
680
703
|
metadata?: object;
|
|
704
|
+
/**
|
|
705
|
+
* 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})+$`.
|
|
706
|
+
* @example "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAA"
|
|
707
|
+
*/
|
|
708
|
+
avatar?: string;
|
|
681
709
|
}
|
|
682
710
|
interface V1Beta1Permission {
|
|
683
711
|
id?: string;
|
|
@@ -1043,7 +1071,13 @@ interface V1Beta1User {
|
|
|
1043
1071
|
* @example "2023-06-07T05:39:56.961Z"
|
|
1044
1072
|
*/
|
|
1045
1073
|
updatedAt?: string;
|
|
1074
|
+
/**
|
|
1075
|
+
* The state of the user (enabled or disabled).
|
|
1076
|
+
* @example "enabled"
|
|
1077
|
+
*/
|
|
1046
1078
|
state?: string;
|
|
1079
|
+
/** The base64 encoded image string of the user avatar. Should be less than 2MB. */
|
|
1080
|
+
avatar?: string;
|
|
1047
1081
|
}
|
|
1048
1082
|
interface V1Beta1UserRequestBody {
|
|
1049
1083
|
/** 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. */
|
|
@@ -1054,6 +1088,11 @@ interface V1Beta1UserRequestBody {
|
|
|
1054
1088
|
metadata?: object;
|
|
1055
1089
|
/** 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"` */
|
|
1056
1090
|
title?: string;
|
|
1091
|
+
/**
|
|
1092
|
+
* 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})+$`.
|
|
1093
|
+
* @example "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAA"
|
|
1094
|
+
*/
|
|
1095
|
+
avatar?: string;
|
|
1057
1096
|
}
|
|
1058
1097
|
interface V1Beta1VerifyOrganizationDomainResponse {
|
|
1059
1098
|
state?: string;
|
|
@@ -1323,6 +1362,16 @@ declare class V1Beta1<SecurityDataType = unknown> extends HttpClient<SecurityDat
|
|
|
1323
1362
|
* @secure
|
|
1324
1363
|
*/
|
|
1325
1364
|
frontierServiceAuthToken: (body: V1Beta1AuthTokenRequest, params?: RequestParams) => Promise<HttpResponse<V1Beta1AuthTokenResponse, RpcStatus>>;
|
|
1365
|
+
/**
|
|
1366
|
+
* @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).
|
|
1367
|
+
*
|
|
1368
|
+
* @tags Authz
|
|
1369
|
+
* @name FrontierServiceBatchCheckPermission
|
|
1370
|
+
* @summary Batch check
|
|
1371
|
+
* @request POST:/v1beta1/batchcheck
|
|
1372
|
+
* @secure
|
|
1373
|
+
*/
|
|
1374
|
+
frontierServiceBatchCheckPermission: (body: V1Beta1BatchCheckPermissionRequest, params?: RequestParams) => Promise<HttpResponse<V1Beta1BatchCheckPermissionResponse, RpcStatus>>;
|
|
1326
1375
|
/**
|
|
1327
1376
|
* @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).
|
|
1328
1377
|
*
|
|
@@ -2052,7 +2101,7 @@ declare class V1Beta1<SecurityDataType = unknown> extends HttpClient<SecurityDat
|
|
|
2052
2101
|
* @tags Preference
|
|
2053
2102
|
* @name FrontierServiceDescribePreferences
|
|
2054
2103
|
* @summary Describe preferences
|
|
2055
|
-
* @request GET:/v1beta1/preferences/
|
|
2104
|
+
* @request GET:/v1beta1/preferences/traits
|
|
2056
2105
|
* @secure
|
|
2057
2106
|
*/
|
|
2058
2107
|
frontierServiceDescribePreferences: (params?: RequestParams) => Promise<HttpResponse<V1Beta1DescribePreferencesResponse, RpcStatus>>;
|
|
@@ -2635,4 +2684,4 @@ declare class V1Beta1<SecurityDataType = unknown> extends HttpClient<SecurityDat
|
|
|
2635
2684
|
|
|
2636
2685
|
declare const FrontierClient: typeof V1Beta1;
|
|
2637
2686
|
|
|
2638
|
-
export { FrontierClient, ProtobufAny, ProtobufNullValue, RpcStatus, V1Beta1, V1Beta1AcceptOrganizationInvitationResponse, V1Beta1AddGroupUsersResponse, V1Beta1AddOrganizationUsersResponse, V1Beta1AuditLog, V1Beta1AuditLogActor, V1Beta1AuditLogTarget, V1Beta1AuthCallbackRequest, V1Beta1AuthCallbackResponse, V1Beta1AuthLogoutResponse, V1Beta1AuthStrategy, V1Beta1AuthTokenRequest, V1Beta1AuthTokenResponse, V1Beta1AuthenticateResponse, V1Beta1CheckResourcePermissionRequest, V1Beta1CheckResourcePermissionResponse, V1Beta1CreateCurrentUserPreferencesRequest, V1Beta1CreateCurrentUserPreferencesResponse, V1Beta1CreateGroupPreferencesResponse, V1Beta1CreateGroupResponse, V1Beta1CreateMetaSchemaResponse, V1Beta1CreateOrganizationAuditLogsResponse, V1Beta1CreateOrganizationDomainResponse, V1Beta1CreateOrganizationInvitationResponse, V1Beta1CreateOrganizationPreferencesResponse, V1Beta1CreateOrganizationResponse, V1Beta1CreateOrganizationRoleResponse, V1Beta1CreatePermissionRequest, V1Beta1CreatePermissionResponse, V1Beta1CreatePolicyResponse, V1Beta1CreatePreferencesRequest, V1Beta1CreatePreferencesResponse, V1Beta1CreateProjectPreferencesResponse, V1Beta1CreateProjectResourceResponse, V1Beta1CreateProjectResponse, V1Beta1CreateRelationResponse, V1Beta1CreateRoleResponse, V1Beta1CreateServiceUserKeyResponse, V1Beta1CreateServiceUserRequest, V1Beta1CreateServiceUserResponse, V1Beta1CreateServiceUserSecretResponse, V1Beta1CreateUserPreferencesResponse, V1Beta1CreateUserResponse, V1Beta1DeleteGroupResponse, V1Beta1DeleteMetaSchemaResponse, V1Beta1DeleteOrganizationDomainResponse, V1Beta1DeleteOrganizationInvitationResponse, V1Beta1DeleteOrganizationResponse, V1Beta1DeleteOrganizationRoleResponse, V1Beta1DeletePermissionResponse, V1Beta1DeletePolicyResponse, V1Beta1DeleteProjectResourceResponse, V1Beta1DeleteProjectResponse, V1Beta1DeleteRelationResponse, V1Beta1DeleteRoleResponse, V1Beta1DeleteServiceUserKeyResponse, V1Beta1DeleteServiceUserResponse, V1Beta1DeleteServiceUserSecretResponse, V1Beta1DeleteUserResponse, V1Beta1DescribePreferencesResponse, V1Beta1DisableGroupResponse, V1Beta1DisableOrganizationResponse, V1Beta1DisableProjectResponse, V1Beta1DisableUserResponse, V1Beta1Domain, V1Beta1EnableGroupResponse, V1Beta1EnableOrganizationResponse, V1Beta1EnableProjectResponse, V1Beta1EnableUserResponse, V1Beta1GetCurrentUserResponse, V1Beta1GetGroupResponse, V1Beta1GetJWKsResponse, V1Beta1GetMetaSchemaResponse, V1Beta1GetNamespaceResponse, V1Beta1GetOrganizationAuditLogResponse, V1Beta1GetOrganizationDomainResponse, V1Beta1GetOrganizationInvitationResponse, V1Beta1GetOrganizationResponse, V1Beta1GetOrganizationRoleResponse, V1Beta1GetOrganizationsByCurrentUserResponse, V1Beta1GetOrganizationsByUserResponse, V1Beta1GetPermissionResponse, V1Beta1GetPolicyResponse, V1Beta1GetProjectResourceResponse, V1Beta1GetProjectResponse, V1Beta1GetProjectsByCurrentUserResponse, V1Beta1GetProjectsByUserResponse, V1Beta1GetRelationResponse, V1Beta1GetServiceUserKeyResponse, V1Beta1GetServiceUserResponse, V1Beta1GetUserResponse, V1Beta1Group, V1Beta1GroupRequestBody, V1Beta1Invitation, V1Beta1JSONWebKey, V1Beta1JoinOrganizationResponse, V1Beta1KeyCredential, V1Beta1ListAllOrganizationsResponse, V1Beta1ListAllUsersResponse, V1Beta1ListAuthStrategiesResponse, V1Beta1ListCurrentUserGroupsResponse, V1Beta1ListCurrentUserPreferencesResponse, V1Beta1ListGroupPreferencesResponse, V1Beta1ListGroupUsersResponse, V1Beta1ListGroupsResponse, V1Beta1ListMetaSchemasResponse, V1Beta1ListNamespacesResponse, V1Beta1ListOrganizationAdminsResponse, V1Beta1ListOrganizationAuditLogsResponse, V1Beta1ListOrganizationDomainsResponse, V1Beta1ListOrganizationGroupsResponse, V1Beta1ListOrganizationInvitationsResponse, V1Beta1ListOrganizationPreferencesResponse, V1Beta1ListOrganizationProjectsResponse, V1Beta1ListOrganizationRolesResponse, V1Beta1ListOrganizationServiceUsersResponse, V1Beta1ListOrganizationUsersResponse, V1Beta1ListOrganizationsResponse, V1Beta1ListPermissionsResponse, V1Beta1ListPoliciesResponse, V1Beta1ListPreferencesResponse, V1Beta1ListProjectAdminsResponse, V1Beta1ListProjectPreferencesResponse, V1Beta1ListProjectResourcesResponse, V1Beta1ListProjectUsersResponse, V1Beta1ListProjectsResponse, V1Beta1ListRelationsResponse, V1Beta1ListResourcesResponse, V1Beta1ListRolesResponse, V1Beta1ListServiceUserKeysResponse, V1Beta1ListServiceUserSecretsResponse, V1Beta1ListServiceUsersResponse, V1Beta1ListUserGroupsResponse, V1Beta1ListUserInvitationsResponse, V1Beta1ListUserPreferencesResponse, V1Beta1ListUsersResponse, V1Beta1MetaSchema, V1Beta1MetaSchemaRequestBody, V1Beta1Namespace, V1Beta1Organization, V1Beta1OrganizationRequestBody, V1Beta1Permission, V1Beta1PermissionRequestBody, V1Beta1Policy, V1Beta1PolicyRequestBody, V1Beta1Preference, V1Beta1PreferenceRequestBody, V1Beta1PreferenceTrait, V1Beta1Project, V1Beta1ProjectRequestBody, V1Beta1Relation, V1Beta1RelationRequestBody, V1Beta1RemoveGroupUserResponse, V1Beta1RemoveOrganizationUserResponse, V1Beta1Resource, V1Beta1ResourceRequestBody, V1Beta1Role, V1Beta1RoleRequestBody, V1Beta1SecretCredential, V1Beta1ServiceUser, V1Beta1ServiceUserKey, V1Beta1ServiceUserRequestBody, V1Beta1UpdateCurrentUserResponse, V1Beta1UpdateGroupResponse, V1Beta1UpdateMetaSchemaResponse, V1Beta1UpdateOrganizationResponse, V1Beta1UpdateOrganizationRoleResponse, V1Beta1UpdatePermissionResponse, V1Beta1UpdatePolicyResponse, V1Beta1UpdateProjectResourceResponse, V1Beta1UpdateProjectResponse, V1Beta1UpdateRoleResponse, V1Beta1UpdateUserResponse, V1Beta1User, V1Beta1UserRequestBody, V1Beta1VerifyOrganizationDomainResponse };
|
|
2687
|
+
export { FrontierClient, ProtobufAny, ProtobufNullValue, RpcStatus, V1Beta1, V1Beta1AcceptOrganizationInvitationResponse, V1Beta1AddGroupUsersResponse, V1Beta1AddOrganizationUsersResponse, V1Beta1AuditLog, V1Beta1AuditLogActor, V1Beta1AuditLogTarget, V1Beta1AuthCallbackRequest, V1Beta1AuthCallbackResponse, V1Beta1AuthLogoutResponse, V1Beta1AuthStrategy, V1Beta1AuthTokenRequest, V1Beta1AuthTokenResponse, V1Beta1AuthenticateResponse, V1Beta1BatchCheckPermissionBody, V1Beta1BatchCheckPermissionRequest, V1Beta1BatchCheckPermissionResponse, V1Beta1BatchCheckPermissionResponsePair, V1Beta1CheckResourcePermissionRequest, V1Beta1CheckResourcePermissionResponse, V1Beta1CreateCurrentUserPreferencesRequest, V1Beta1CreateCurrentUserPreferencesResponse, V1Beta1CreateGroupPreferencesResponse, V1Beta1CreateGroupResponse, V1Beta1CreateMetaSchemaResponse, V1Beta1CreateOrganizationAuditLogsResponse, V1Beta1CreateOrganizationDomainResponse, V1Beta1CreateOrganizationInvitationResponse, V1Beta1CreateOrganizationPreferencesResponse, V1Beta1CreateOrganizationResponse, V1Beta1CreateOrganizationRoleResponse, V1Beta1CreatePermissionRequest, V1Beta1CreatePermissionResponse, V1Beta1CreatePolicyResponse, V1Beta1CreatePreferencesRequest, V1Beta1CreatePreferencesResponse, V1Beta1CreateProjectPreferencesResponse, V1Beta1CreateProjectResourceResponse, V1Beta1CreateProjectResponse, V1Beta1CreateRelationResponse, V1Beta1CreateRoleResponse, V1Beta1CreateServiceUserKeyResponse, V1Beta1CreateServiceUserRequest, V1Beta1CreateServiceUserResponse, V1Beta1CreateServiceUserSecretResponse, V1Beta1CreateUserPreferencesResponse, V1Beta1CreateUserResponse, V1Beta1DeleteGroupResponse, V1Beta1DeleteMetaSchemaResponse, V1Beta1DeleteOrganizationDomainResponse, V1Beta1DeleteOrganizationInvitationResponse, V1Beta1DeleteOrganizationResponse, V1Beta1DeleteOrganizationRoleResponse, V1Beta1DeletePermissionResponse, V1Beta1DeletePolicyResponse, V1Beta1DeleteProjectResourceResponse, V1Beta1DeleteProjectResponse, V1Beta1DeleteRelationResponse, V1Beta1DeleteRoleResponse, V1Beta1DeleteServiceUserKeyResponse, V1Beta1DeleteServiceUserResponse, V1Beta1DeleteServiceUserSecretResponse, V1Beta1DeleteUserResponse, V1Beta1DescribePreferencesResponse, V1Beta1DisableGroupResponse, V1Beta1DisableOrganizationResponse, V1Beta1DisableProjectResponse, V1Beta1DisableUserResponse, V1Beta1Domain, V1Beta1EnableGroupResponse, V1Beta1EnableOrganizationResponse, V1Beta1EnableProjectResponse, V1Beta1EnableUserResponse, V1Beta1GetCurrentUserResponse, V1Beta1GetGroupResponse, V1Beta1GetJWKsResponse, V1Beta1GetMetaSchemaResponse, V1Beta1GetNamespaceResponse, V1Beta1GetOrganizationAuditLogResponse, V1Beta1GetOrganizationDomainResponse, V1Beta1GetOrganizationInvitationResponse, V1Beta1GetOrganizationResponse, V1Beta1GetOrganizationRoleResponse, V1Beta1GetOrganizationsByCurrentUserResponse, V1Beta1GetOrganizationsByUserResponse, V1Beta1GetPermissionResponse, V1Beta1GetPolicyResponse, V1Beta1GetProjectResourceResponse, V1Beta1GetProjectResponse, V1Beta1GetProjectsByCurrentUserResponse, V1Beta1GetProjectsByUserResponse, V1Beta1GetRelationResponse, V1Beta1GetServiceUserKeyResponse, V1Beta1GetServiceUserResponse, V1Beta1GetUserResponse, V1Beta1Group, V1Beta1GroupRequestBody, V1Beta1Invitation, V1Beta1JSONWebKey, V1Beta1JoinOrganizationResponse, V1Beta1KeyCredential, V1Beta1ListAllOrganizationsResponse, V1Beta1ListAllUsersResponse, V1Beta1ListAuthStrategiesResponse, V1Beta1ListCurrentUserGroupsResponse, V1Beta1ListCurrentUserPreferencesResponse, V1Beta1ListGroupPreferencesResponse, V1Beta1ListGroupUsersResponse, V1Beta1ListGroupsResponse, V1Beta1ListMetaSchemasResponse, V1Beta1ListNamespacesResponse, V1Beta1ListOrganizationAdminsResponse, V1Beta1ListOrganizationAuditLogsResponse, V1Beta1ListOrganizationDomainsResponse, V1Beta1ListOrganizationGroupsResponse, V1Beta1ListOrganizationInvitationsResponse, V1Beta1ListOrganizationPreferencesResponse, V1Beta1ListOrganizationProjectsResponse, V1Beta1ListOrganizationRolesResponse, V1Beta1ListOrganizationServiceUsersResponse, V1Beta1ListOrganizationUsersResponse, V1Beta1ListOrganizationsResponse, V1Beta1ListPermissionsResponse, V1Beta1ListPoliciesResponse, V1Beta1ListPreferencesResponse, V1Beta1ListProjectAdminsResponse, V1Beta1ListProjectPreferencesResponse, V1Beta1ListProjectResourcesResponse, V1Beta1ListProjectUsersResponse, V1Beta1ListProjectsResponse, V1Beta1ListRelationsResponse, V1Beta1ListResourcesResponse, V1Beta1ListRolesResponse, V1Beta1ListServiceUserKeysResponse, V1Beta1ListServiceUserSecretsResponse, V1Beta1ListServiceUsersResponse, V1Beta1ListUserGroupsResponse, V1Beta1ListUserInvitationsResponse, V1Beta1ListUserPreferencesResponse, V1Beta1ListUsersResponse, V1Beta1MetaSchema, V1Beta1MetaSchemaRequestBody, V1Beta1Namespace, V1Beta1Organization, V1Beta1OrganizationRequestBody, V1Beta1Permission, V1Beta1PermissionRequestBody, V1Beta1Policy, V1Beta1PolicyRequestBody, V1Beta1Preference, V1Beta1PreferenceRequestBody, V1Beta1PreferenceTrait, V1Beta1Project, V1Beta1ProjectRequestBody, V1Beta1Relation, V1Beta1RelationRequestBody, V1Beta1RemoveGroupUserResponse, V1Beta1RemoveOrganizationUserResponse, V1Beta1Resource, V1Beta1ResourceRequestBody, V1Beta1Role, V1Beta1RoleRequestBody, V1Beta1SecretCredential, V1Beta1ServiceUser, V1Beta1ServiceUserKey, V1Beta1ServiceUserRequestBody, V1Beta1UpdateCurrentUserResponse, V1Beta1UpdateGroupResponse, V1Beta1UpdateMetaSchemaResponse, V1Beta1UpdateOrganizationResponse, V1Beta1UpdateOrganizationRoleResponse, V1Beta1UpdatePermissionResponse, V1Beta1UpdatePolicyResponse, V1Beta1UpdateProjectResourceResponse, V1Beta1UpdateProjectResponse, V1Beta1UpdateRoleResponse, V1Beta1UpdateUserResponse, V1Beta1User, V1Beta1UserRequestBody, V1Beta1VerifyOrganizationDomainResponse };
|
package/dist/index.js
CHANGED
|
@@ -446,6 +446,23 @@ var V1Beta1 = class extends HttpClient {
|
|
|
446
446
|
type: "application/json" /* Json */,
|
|
447
447
|
format: "json"
|
|
448
448
|
}, params));
|
|
449
|
+
/**
|
|
450
|
+
* @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).
|
|
451
|
+
*
|
|
452
|
+
* @tags Authz
|
|
453
|
+
* @name FrontierServiceBatchCheckPermission
|
|
454
|
+
* @summary Batch check
|
|
455
|
+
* @request POST:/v1beta1/batchcheck
|
|
456
|
+
* @secure
|
|
457
|
+
*/
|
|
458
|
+
this.frontierServiceBatchCheckPermission = (body, params = {}) => this.request(__spreadValues({
|
|
459
|
+
path: `/v1beta1/batchcheck`,
|
|
460
|
+
method: "POST",
|
|
461
|
+
body,
|
|
462
|
+
secure: true,
|
|
463
|
+
type: "application/json" /* Json */,
|
|
464
|
+
format: "json"
|
|
465
|
+
}, params));
|
|
449
466
|
/**
|
|
450
467
|
* @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).
|
|
451
468
|
*
|
|
@@ -1486,11 +1503,11 @@ var V1Beta1 = class extends HttpClient {
|
|
|
1486
1503
|
* @tags Preference
|
|
1487
1504
|
* @name FrontierServiceDescribePreferences
|
|
1488
1505
|
* @summary Describe preferences
|
|
1489
|
-
* @request GET:/v1beta1/preferences/
|
|
1506
|
+
* @request GET:/v1beta1/preferences/traits
|
|
1490
1507
|
* @secure
|
|
1491
1508
|
*/
|
|
1492
1509
|
this.frontierServiceDescribePreferences = (params = {}) => this.request(__spreadValues({
|
|
1493
|
-
path: `/v1beta1/preferences/
|
|
1510
|
+
path: `/v1beta1/preferences/traits`,
|
|
1494
1511
|
method: "GET",
|
|
1495
1512
|
secure: true,
|
|
1496
1513
|
format: "json"
|
package/dist/index.mjs
CHANGED
|
@@ -421,6 +421,23 @@ var V1Beta1 = class extends HttpClient {
|
|
|
421
421
|
type: "application/json" /* Json */,
|
|
422
422
|
format: "json"
|
|
423
423
|
}, params));
|
|
424
|
+
/**
|
|
425
|
+
* @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).
|
|
426
|
+
*
|
|
427
|
+
* @tags Authz
|
|
428
|
+
* @name FrontierServiceBatchCheckPermission
|
|
429
|
+
* @summary Batch check
|
|
430
|
+
* @request POST:/v1beta1/batchcheck
|
|
431
|
+
* @secure
|
|
432
|
+
*/
|
|
433
|
+
this.frontierServiceBatchCheckPermission = (body, params = {}) => this.request(__spreadValues({
|
|
434
|
+
path: `/v1beta1/batchcheck`,
|
|
435
|
+
method: "POST",
|
|
436
|
+
body,
|
|
437
|
+
secure: true,
|
|
438
|
+
type: "application/json" /* Json */,
|
|
439
|
+
format: "json"
|
|
440
|
+
}, params));
|
|
424
441
|
/**
|
|
425
442
|
* @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).
|
|
426
443
|
*
|
|
@@ -1461,11 +1478,11 @@ var V1Beta1 = class extends HttpClient {
|
|
|
1461
1478
|
* @tags Preference
|
|
1462
1479
|
* @name FrontierServiceDescribePreferences
|
|
1463
1480
|
* @summary Describe preferences
|
|
1464
|
-
* @request GET:/v1beta1/preferences/
|
|
1481
|
+
* @request GET:/v1beta1/preferences/traits
|
|
1465
1482
|
* @secure
|
|
1466
1483
|
*/
|
|
1467
1484
|
this.frontierServiceDescribePreferences = (params = {}) => this.request(__spreadValues({
|
|
1468
|
-
path: `/v1beta1/preferences/
|
|
1485
|
+
path: `/v1beta1/preferences/traits`,
|
|
1469
1486
|
method: "GET",
|
|
1470
1487
|
secure: true,
|
|
1471
1488
|
format: "json"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raystack/frontier",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "A js library for frontier",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -11,6 +11,14 @@
|
|
|
11
11
|
"react/dist/**/*",
|
|
12
12
|
"README.md"
|
|
13
13
|
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsup",
|
|
16
|
+
"dev": "tsup --watch src",
|
|
17
|
+
"size": "size-limit",
|
|
18
|
+
"lint": "eslint \"./**/*.ts*\"",
|
|
19
|
+
"test": "echo \"Error: no test specified\" && exit 0",
|
|
20
|
+
"gen:client": "npx swagger-typescript-api -p ../../../../proto/apidocs.swagger.yaml -o client --modular"
|
|
21
|
+
},
|
|
14
22
|
"author": "pyadav9678@gmail.com",
|
|
15
23
|
"license": "Apache-2.0",
|
|
16
24
|
"lint-staged": {
|
|
@@ -41,6 +49,7 @@
|
|
|
41
49
|
},
|
|
42
50
|
"devDependencies": {
|
|
43
51
|
"@radix-ui/react-icons": "^1.3.0",
|
|
52
|
+
"@raystack/frontier-tsconfig": "workspace:^",
|
|
44
53
|
"@size-limit/preset-small-lib": "^8.2.6",
|
|
45
54
|
"@tanstack/react-table": "^8.9.3",
|
|
46
55
|
"@types/node": "^20.4.5",
|
|
@@ -49,22 +58,22 @@
|
|
|
49
58
|
"esbuild-css-modules-plugin": "^2.7.1",
|
|
50
59
|
"esbuild-plugin-external-global": "^1.0.1",
|
|
51
60
|
"eslint": "^7.32.0",
|
|
61
|
+
"eslint-config-frontier": "workspace:^",
|
|
52
62
|
"np": "^7.7.0",
|
|
53
63
|
"prettier": "^2.5.1",
|
|
54
64
|
"size-limit": "^8.2.6",
|
|
55
65
|
"swagger-typescript-api": "^13.0.2",
|
|
56
66
|
"tsup": "^6.7.0",
|
|
57
|
-
"typescript": "^5.1.6"
|
|
58
|
-
"@raystack/frontier-tsconfig": "^0.0.0",
|
|
59
|
-
"eslint-config-frontier": "^0.0.0"
|
|
67
|
+
"typescript": "^5.1.6"
|
|
60
68
|
},
|
|
61
69
|
"dependencies": {
|
|
62
70
|
"@hookform/resolvers": "^3.1.1",
|
|
63
|
-
"@raystack/apsara": "0.
|
|
71
|
+
"@raystack/apsara": "0.11.0",
|
|
64
72
|
"@tanstack/react-router": "0.0.1-beta.174",
|
|
65
73
|
"axios": "^1.4.0",
|
|
66
74
|
"class-variance-authority": "^0.7.0",
|
|
67
75
|
"react-hook-form": "^7.45.2",
|
|
76
|
+
"react-loading-skeleton": "^3.3.1",
|
|
68
77
|
"sonner": "^0.6.2",
|
|
69
78
|
"yup": "^1.2.0"
|
|
70
79
|
},
|
|
@@ -87,13 +96,5 @@
|
|
|
87
96
|
},
|
|
88
97
|
"publishConfig": {
|
|
89
98
|
"access": "public"
|
|
90
|
-
},
|
|
91
|
-
"scripts": {
|
|
92
|
-
"build": "tsup",
|
|
93
|
-
"dev": "tsup --watch src",
|
|
94
|
-
"size": "size-limit",
|
|
95
|
-
"lint": "eslint \"./**/*.ts*\"",
|
|
96
|
-
"test": "echo \"Error: no test specified\" && exit 0",
|
|
97
|
-
"gen:client": "npx swagger-typescript-api -p ../../../../proto/apidocs.swagger.yaml -o client --modular"
|
|
98
99
|
}
|
|
99
|
-
}
|
|
100
|
+
}
|
package/react/dist/index.d.ts
CHANGED
|
@@ -214,6 +214,22 @@ 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;
|
|
@@ -706,6 +722,13 @@ interface V1Beta1Organization {
|
|
|
706
722
|
* @example "2023-06-07T05:39:56.961Z"
|
|
707
723
|
*/
|
|
708
724
|
updatedAt?: string;
|
|
725
|
+
/**
|
|
726
|
+
* The state of the organization (enabled or disabled).
|
|
727
|
+
* @example "enabled"
|
|
728
|
+
*/
|
|
729
|
+
state?: string;
|
|
730
|
+
/** The base64 encoded image string of the organization avatar. Should be less than 2MB. */
|
|
731
|
+
avatar?: string;
|
|
709
732
|
}
|
|
710
733
|
interface V1Beta1OrganizationRequestBody {
|
|
711
734
|
/** 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 +737,11 @@ interface V1Beta1OrganizationRequestBody {
|
|
|
714
737
|
title?: string;
|
|
715
738
|
/** 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
739
|
metadata?: object;
|
|
740
|
+
/**
|
|
741
|
+
* 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})+$`.
|
|
742
|
+
* @example "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAA"
|
|
743
|
+
*/
|
|
744
|
+
avatar?: string;
|
|
717
745
|
}
|
|
718
746
|
interface V1Beta1Permission {
|
|
719
747
|
id?: string;
|
|
@@ -1077,7 +1105,13 @@ interface V1Beta1User {
|
|
|
1077
1105
|
* @example "2023-06-07T05:39:56.961Z"
|
|
1078
1106
|
*/
|
|
1079
1107
|
updatedAt?: string;
|
|
1108
|
+
/**
|
|
1109
|
+
* The state of the user (enabled or disabled).
|
|
1110
|
+
* @example "enabled"
|
|
1111
|
+
*/
|
|
1080
1112
|
state?: string;
|
|
1113
|
+
/** The base64 encoded image string of the user avatar. Should be less than 2MB. */
|
|
1114
|
+
avatar?: string;
|
|
1081
1115
|
}
|
|
1082
1116
|
interface V1Beta1UserRequestBody {
|
|
1083
1117
|
/** 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 +1122,11 @@ interface V1Beta1UserRequestBody {
|
|
|
1088
1122
|
metadata?: object;
|
|
1089
1123
|
/** 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
1124
|
title?: string;
|
|
1125
|
+
/**
|
|
1126
|
+
* 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})+$`.
|
|
1127
|
+
* @example "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAA"
|
|
1128
|
+
*/
|
|
1129
|
+
avatar?: string;
|
|
1091
1130
|
}
|
|
1092
1131
|
interface V1Beta1VerifyOrganizationDomainResponse {
|
|
1093
1132
|
state?: string;
|
|
@@ -1357,6 +1396,16 @@ declare class V1Beta1<SecurityDataType = unknown> extends HttpClient<SecurityDat
|
|
|
1357
1396
|
* @secure
|
|
1358
1397
|
*/
|
|
1359
1398
|
frontierServiceAuthToken: (body: V1Beta1AuthTokenRequest, params?: RequestParams) => Promise<HttpResponse<V1Beta1AuthTokenResponse, RpcStatus>>;
|
|
1399
|
+
/**
|
|
1400
|
+
* @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).
|
|
1401
|
+
*
|
|
1402
|
+
* @tags Authz
|
|
1403
|
+
* @name FrontierServiceBatchCheckPermission
|
|
1404
|
+
* @summary Batch check
|
|
1405
|
+
* @request POST:/v1beta1/batchcheck
|
|
1406
|
+
* @secure
|
|
1407
|
+
*/
|
|
1408
|
+
frontierServiceBatchCheckPermission: (body: V1Beta1BatchCheckPermissionRequest, params?: RequestParams) => Promise<HttpResponse<V1Beta1BatchCheckPermissionResponse, RpcStatus>>;
|
|
1360
1409
|
/**
|
|
1361
1410
|
* @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
1411
|
*
|
|
@@ -2086,7 +2135,7 @@ declare class V1Beta1<SecurityDataType = unknown> extends HttpClient<SecurityDat
|
|
|
2086
2135
|
* @tags Preference
|
|
2087
2136
|
* @name FrontierServiceDescribePreferences
|
|
2088
2137
|
* @summary Describe preferences
|
|
2089
|
-
* @request GET:/v1beta1/preferences/
|
|
2138
|
+
* @request GET:/v1beta1/preferences/traits
|
|
2090
2139
|
* @secure
|
|
2091
2140
|
*/
|
|
2092
2141
|
frontierServiceDescribePreferences: (params?: RequestParams) => Promise<HttpResponse<V1Beta1DescribePreferencesResponse, RpcStatus>>;
|
|
@@ -2680,6 +2729,10 @@ interface FrontierContextProviderProps {
|
|
|
2680
2729
|
setUser: Dispatch<SetStateAction<V1Beta1User | undefined>>;
|
|
2681
2730
|
activeOrganization: V1Beta1Organization | undefined;
|
|
2682
2731
|
setActiveOrganization: Dispatch<SetStateAction<V1Beta1Organization | undefined>>;
|
|
2732
|
+
isActiveOrganizationLoading: boolean;
|
|
2733
|
+
setIsActiveOrganizationLoading: Dispatch<SetStateAction<boolean>>;
|
|
2734
|
+
isUserLoading: boolean;
|
|
2735
|
+
setIsUserLoading: Dispatch<SetStateAction<boolean>>;
|
|
2683
2736
|
}
|
|
2684
2737
|
declare function useFrontier(): FrontierContextProviderProps;
|
|
2685
2738
|
|