/** * Access control header operations for Managed Runtime. * * Handles listing, creating, and deleting access control headers. * * @module operations/mrt/access-control */ import type { AuthStrategy } from '../../auth/types.js'; import type { components } from '../../clients/mrt.js'; /** * Access control header type from API. */ export type MrtAccessControlHeader = components['schemas']['APIAccessControlHeaderV2Create']; /** * Options for listing access control headers. */ export interface ListAccessControlHeadersOptions { /** * The project slug. */ projectSlug: string; /** * The target/environment slug. */ targetSlug: string; /** * Maximum number of results to return. */ limit?: number; /** * Offset for pagination. */ offset?: number; /** * MRT API origin URL. * @default "https://cloud.mobify.com" */ origin?: string; } /** * Result of listing access control headers. */ export interface ListAccessControlHeadersResult { /** * Total count of headers. */ count: number; /** * URL for next page of results. */ next: string | null; /** * URL for previous page of results. */ previous: string | null; /** * Array of access control headers. */ headers: MrtAccessControlHeader[]; } /** * Lists access control headers for an MRT environment. * * @param options - List options * @param auth - Authentication strategy (ApiKeyStrategy) * @returns Paginated list of headers * @throws Error if request fails * * @example * ```typescript * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth'; * import { listAccessControlHeaders } from '@salesforce/b2c-tooling-sdk/operations/mrt'; * * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization'); * * const result = await listAccessControlHeaders({ * projectSlug: 'my-storefront', * targetSlug: 'production' * }, auth); * * console.log(`Found ${result.count} access control headers`); * ``` */ export declare function listAccessControlHeaders(options: ListAccessControlHeadersOptions, auth: AuthStrategy): Promise; /** * Options for creating an access control header. */ export interface CreateAccessControlHeaderOptions { /** * The project slug. */ projectSlug: string; /** * The target/environment slug. */ targetSlug: string; /** * The header value. */ value: string; /** * MRT API origin URL. * @default "https://cloud.mobify.com" */ origin?: string; } /** * Creates an access control header for an MRT environment. * * @param options - Create options * @param auth - Authentication strategy (ApiKeyStrategy) * @returns The created header * @throws Error if request fails * * @example * ```typescript * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth'; * import { createAccessControlHeader } from '@salesforce/b2c-tooling-sdk/operations/mrt'; * * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization'); * * const header = await createAccessControlHeader({ * projectSlug: 'my-storefront', * targetSlug: 'production', * value: 'my-secret-header-value' * }, auth); * * console.log(`Created access control header: ${header.id}`); * ``` */ export declare function createAccessControlHeader(options: CreateAccessControlHeaderOptions, auth: AuthStrategy): Promise; /** * Options for getting an access control header. */ export interface GetAccessControlHeaderOptions { /** * The project slug. */ projectSlug: string; /** * The target/environment slug. */ targetSlug: string; /** * The header ID. */ headerId: string; /** * MRT API origin URL. * @default "https://cloud.mobify.com" */ origin?: string; } /** * Gets an access control header from an MRT environment. * * @param options - Get options * @param auth - Authentication strategy (ApiKeyStrategy) * @returns The header * @throws Error if request fails */ export declare function getAccessControlHeader(options: GetAccessControlHeaderOptions, auth: AuthStrategy): Promise; /** * Options for deleting an access control header. */ export interface DeleteAccessControlHeaderOptions { /** * The project slug. */ projectSlug: string; /** * The target/environment slug. */ targetSlug: string; /** * The header ID. */ headerId: string; /** * MRT API origin URL. * @default "https://cloud.mobify.com" */ origin?: string; } /** * Deletes an access control header from an MRT environment. * * @param options - Delete options * @param auth - Authentication strategy (ApiKeyStrategy) * @throws Error if request fails */ export declare function deleteAccessControlHeader(options: DeleteAccessControlHeaderOptions, auth: AuthStrategy): Promise;