Skip to content

Commit

Permalink
chore(clerk-js,types): Remove @experimental from types related to c…
Browse files Browse the repository at this point in the history
…ustom roles (#2909)

The feature may have not reached GA yet, but the API is considered stable and will not change for the current major.

Also removing experimental tag from protect as the api is stable and will not change for the current major.
  • Loading branch information
panteliselef authored Mar 1, 2024
1 parent c2be933 commit 37e932a
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 27 deletions.
2 changes: 2 additions & 0 deletions .changeset/five-hotels-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
3 changes: 0 additions & 3 deletions packages/clerk-js/src/core/resources/Permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import type { PermissionJSON, PermissionResource } from '@clerk/types';
import { unixEpochToDate } from '../../utils/date';
import { BaseResource } from './internal';

/**
* @experimental
*/
export class Permission extends BaseResource implements PermissionResource {
id!: string;
key!: string;
Expand Down
3 changes: 0 additions & 3 deletions packages/clerk-js/src/core/resources/Role.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import { unixEpochToDate } from '../../utils/date';
import { BaseResource } from './internal';
import { Permission } from './Permission';

/**
* @experimental
*/
export class Role extends BaseResource implements RoleResource {
id!: string;
key!: string;
Expand Down
4 changes: 1 addition & 3 deletions packages/nextjs/src/server/protect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ import { constants as nextConstants } from '../constants';
type AuthProtectOptions = { unauthorizedUrl?: string; unauthenticatedUrl?: string };

/**
* @experimental
* This function is experimental as it throws a Nextjs notFound error if user is not authenticated or authorized.
* In the future we would investigate a way to throw a more appropriate error that clearly describes the not authorized of authenticated status.
* Throws a Nextjs notFound error if user is not authenticated or authorized.
*/
export interface AuthProtect {
(params?: CheckAuthorizationParamsWithCustomPermissions, options?: AuthProtectOptions): SignedInAuthObject;
Expand Down
6 changes: 0 additions & 6 deletions packages/types/src/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,6 @@ export interface OrganizationDomainJSON extends ClerkResourceJSON {
total_pending_suggestions: number;
}

/**
* @experimental
*/
export interface RoleJSON extends ClerkResourceJSON {
object: 'role';
id: string;
Expand All @@ -355,9 +352,6 @@ export interface RoleJSON extends ClerkResourceJSON {
updated_at: number;
}

/**
* @experimental
*/
export interface PermissionJSON extends ClerkResourceJSON {
object: 'permission';
id: string;
Expand Down
6 changes: 0 additions & 6 deletions packages/types/src/organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ export interface OrganizationResource extends ClerkResource {
update: (params: UpdateOrganizationParams) => Promise<OrganizationResource>;
getMemberships: GetMemberships;
getInvitations: (params?: GetInvitationsParams) => Promise<ClerkPaginatedResponse<OrganizationInvitationResource>>;
/**
* @experimental
*/
getRoles: (params?: GetRolesParams) => Promise<ClerkPaginatedResponse<RoleResource>>;
getDomains: (params?: GetDomainsParams) => Promise<ClerkPaginatedResponse<OrganizationDomainResource>>;
getMembershipRequests: (
Expand All @@ -61,9 +58,6 @@ export interface OrganizationResource extends ClerkResource {
setLogo: (params: SetOrganizationLogoParams) => Promise<OrganizationResource>;
}

/**
* @experimental
*/
export type GetRolesParams = ClerkPaginationParams;

export type GetMembersParams = ClerkPaginationParams<{
Expand Down
3 changes: 0 additions & 3 deletions packages/types/src/permission.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import type { ClerkResource } from './resource';

/**
* @experimental
*/
export interface PermissionResource extends ClerkResource {
id: string;
key: string;
Expand Down
3 changes: 0 additions & 3 deletions packages/types/src/role.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import type { PermissionResource } from './permission';
import type { ClerkResource } from './resource';

/**
* @experimental
*/
export interface RoleResource extends ClerkResource {
id: string;
key: string;
Expand Down

0 comments on commit 37e932a

Please sign in to comment.