/** * Organization member operations for Managed Runtime. * * Distinct from project members: organization members hold a role at the * organization level and may be granted permission to view all projects * and manage custom domain certificates. * * @module operations/mrt/organization-member */ import type { AuthStrategy } from '../../auth/types.js'; import type { components } from '../../clients/mrt.js'; export type MrtOrgMember = components['schemas']['APIOrganizationMember']; export type MrtOrgMemberCreate = components['schemas']['APIOrganizationMemberCreate']; export type MrtOrgMemberUpdate = components['schemas']['PatchedAPIOrganizationMemberUpdate']; /** * Organization role values. * 0 = Owner, 1 = Member */ export type OrgRoleValue = 0 | 1; export declare const ORG_ROLES: Record; /** * Cert permission status. 1 = Disabled, 2 = Enabled (per Status1d2Enum). */ export type OrgCertPermission = 1 | 2; export interface ListOrgMembersOptions { organizationSlug: string; limit?: number; offset?: number; ordering?: string; search?: string; origin?: string; } export interface ListOrgMembersResult { count: number; next: string | null; previous: string | null; members: MrtOrgMember[]; } /** * Lists members of an MRT organization. * * @param options - List options including organization slug and optional pagination/filtering parameters * @param auth - Authentication strategy (ApiKeyStrategy or other AuthStrategy implementation) * @returns Promise resolving to paginated list of organization members with count, next, previous, and members array * @throws Error if the request fails * * @example * ```typescript * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth'; * import { listOrgMembers } from '@salesforce/b2c-tooling-sdk/operations/mrt'; * * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization'); * * const result = await listOrgMembers({ * organizationSlug: 'my-org' * }, auth); * ``` */ export declare function listOrgMembers(options: ListOrgMembersOptions, auth: AuthStrategy): Promise; export interface AddOrgMemberOptions { organizationSlug: string; email: string; role: OrgRoleValue; canViewAllProjects?: boolean; customDomainCertPermission?: OrgCertPermission; origin?: string; } /** * Adds a member to an MRT organization. * * @param options - Add member options * @param options.organizationSlug - Organization slug identifier * @param options.email - Email of the member to add * @param options.role - Role value (0 = Owner, 1 = Member) * @param options.canViewAllProjects - Optional: grant permission to view all projects * @param options.customDomainCertPermission - Optional: custom domain certificate permission (1 = Disabled, 2 = Enabled) * @param options.origin - Optional: MRT API origin endpoint * @param auth - Authentication strategy (e.g., ApiKeyStrategy) * @returns The created organization member * @throws Error if the request fails * * @example * ```typescript * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth'; * import { addOrgMember } from '@salesforce/b2c-tooling-sdk/operations/mrt'; * * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization'); * * const member = await addOrgMember({ * organizationSlug: 'my-org', * email: 'user@example.com', * role: 1 // Member * }, auth); * ``` */ export declare function addOrgMember(options: AddOrgMemberOptions, auth: AuthStrategy): Promise; export interface GetOrgMemberOptions { organizationSlug: string; email: string; origin?: string; } /** * Gets an organization member by email. * * @param options - Get options including organization slug and email * @param auth - Authentication strategy (ApiKeyStrategy) * @returns The organization member details * @throws Error if the request fails or member is not found * * @example * ```typescript * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth'; * import { getOrgMember } from '@salesforce/b2c-tooling-sdk/operations/mrt'; * * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization'); * * const member = await getOrgMember({ * organizationSlug: 'my-org', * email: 'user@example.com' * }, auth); * * console.log(`Member role: ${member.role}`); * ``` */ export declare function getOrgMember(options: GetOrgMemberOptions, auth: AuthStrategy): Promise; export interface UpdateOrgMemberOptions { organizationSlug: string; email: string; canViewAllProjects?: boolean; customDomainCertPermission?: OrgCertPermission; origin?: string; } /** * Updates an organization member's permissions and settings. * * @param options - Update options with organizationSlug, email, and optional canViewAllProjects and customDomainCertPermission * @param auth - Authentication strategy (required for API authorization) * @returns Promise resolving to the updated organization member with full member details * @throws Error if the API request fails */ export declare function updateOrgMember(options: UpdateOrgMemberOptions, auth: AuthStrategy): Promise; export interface RemoveOrgMemberOptions { organizationSlug: string; email: string; origin?: string; } /** * Removes a member from an MRT organization. * * @param options - Remove options * @param options.organizationSlug - Slug of the organization * @param options.email - Email address of the member to remove * @param options.origin - Optional MRT API origin (defaults to DEFAULT_MRT_ORIGIN) * @param auth - Authentication strategy * @throws {Error} If the API request fails */ export declare function removeOrgMember(options: RemoveOrgMemberOptions, auth: AuthStrategy): Promise;