Skip to content

Commit

Permalink
chore(clerk-js): Add experimental tags
Browse files Browse the repository at this point in the history
  • Loading branch information
panteliselef committed Nov 2, 2023
1 parent 9f87347 commit c8d0d5d
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/clerk-js/src/core/resources/Permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ 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: 3 additions & 0 deletions packages/clerk-js/src/core/resources/Role.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ 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
6 changes: 6 additions & 0 deletions packages/types/src/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,9 @@ export interface OrganizationDomainJSON extends ClerkResourceJSON {
total_pending_suggestions: number;
}

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

/**
* @experimental
*/
export interface PermissionJSON extends ClerkResourceJSON {
object: 'permission';
id: string;
Expand Down
5 changes: 5 additions & 0 deletions packages/types/src/localization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ export type LocalizationResource = DeepPartial<_LocalizationResource>;

type _LocalizationResource = {
locale: string;
/**
* @experimental
* Add role keys and their localized value
* e.g. roles:{ 'org:teacher': 'Teacher'}
*/
roles: {
[r: string]: LocalizationValue;
};
Expand Down
6 changes: 6 additions & 0 deletions packages/types/src/organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ export interface OrganizationResource extends ClerkResource {
*/
getPendingInvitations: (params?: GetPendingInvitationsParams) => Promise<OrganizationInvitationResource[]>;
getInvitations: (params?: GetInvitationsParams) => Promise<ClerkPaginatedResponse<OrganizationInvitationResource>>;
/**
* @experimental
*/
getRoles: (params?: GetRolesParams) => Promise<ClerkPaginatedResponse<RoleResource>>;
getDomains: (params?: GetDomainsParams) => Promise<ClerkPaginatedResponse<OrganizationDomainResource>>;
getMembershipRequests: (
Expand All @@ -73,6 +76,9 @@ export type GetMembershipsParams = {
role?: MembershipRole[];
} & ClerkPaginationParams;

/**
* @experimental
*/
export type GetRolesParams = {
/**
* This is the starting point for your fetched results. The initial value persists between re-renders
Expand Down
3 changes: 3 additions & 0 deletions packages/types/src/permission.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import type { ClerkResource } from './resource';

/**
* @experimental
*/
export interface PermissionResource extends ClerkResource {
id: string;
key: string;
Expand Down
3 changes: 3 additions & 0 deletions packages/types/src/role.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
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 c8d0d5d

Please sign in to comment.