/*
 * Copyright (c) 2025, Salesforce, Inc.
 * SPDX-License-Identifier: Apache-2
 * For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
 */
/**
 * Authentication strategies for B2C Commerce APIs.
 *
 * This module provides different authentication mechanisms for connecting to
 * B2C Commerce instances and platform services.
 *
 * ## Available Strategies
 *
 * - {@link BasicAuthStrategy} - Username/password authentication for WebDAV operations
 * - {@link OAuthStrategy} - OAuth 2.0 client credentials for OCAPI and platform APIs
 * - {@link ImplicitOAuthStrategy} - Interactive browser-based OAuth for CLI/desktop apps
 * - {@link ApiKeyStrategy} - API key authentication for MRT services
 *
 * ## Strategy Resolution
 *
 * Use {@link resolveAuthStrategy} to automatically select the best strategy based on
 * available credentials and allowed methods:
 *
 * ```typescript
 * import { resolveAuthStrategy } from '@salesforce/b2c-tooling-sdk';
 *
 * // Automatically picks client-credentials if secret available, otherwise implicit
 * const strategy = resolveAuthStrategy({
 *   clientId: 'your-client-id',
 *   clientSecret: process.env.CLIENT_SECRET, // may be undefined
 * });
 *
 * // Force a specific method
 * const implicitOnly = resolveAuthStrategy(
 *   { clientId: 'your-client-id' },
 *   { allowedMethods: ['implicit'] }
 * );
 * ```
 *
 * ## Direct Usage
 *
 * All strategies implement the {@link AuthStrategy} interface:
 *
 * ```typescript
 * import { OAuthStrategy, ImplicitOAuthStrategy } from '@salesforce/b2c-tooling-sdk';
 *
 * // For automated/server usage (client credentials)
 * const oauthAuth = new OAuthStrategy({
 *   clientId: 'your-client-id',
 *   clientSecret: 'your-client-secret',
 * });
 *
 * // For interactive/CLI usage (opens browser)
 * const implicitAuth = new ImplicitOAuthStrategy({
 *   clientId: 'your-client-id',
 * });
 * ```
 *
 * @module auth
 */
export { ALL_AUTH_METHODS } from './types.js';
// Strategies
export { BasicAuthStrategy } from './basic.js';
export { OAuthStrategy, decodeJWT } from './oauth.js';
export { ImplicitOAuthStrategy } from './oauth-implicit.js';
export { ApiKeyStrategy } from './api-key.js';
export { StatefulOAuthStrategy } from './stateful-oauth-strategy.js';
// Stateful auth store
export { initializeStatefulStore, getStoredSession, setStoredSession, clearStoredSession, isStatefulTokenValid, resetStatefulStoreForTesting, } from './stateful-store.js';
// Resolution helpers
export { resolveAuthStrategy, checkAvailableAuthMethods } from './resolve.js';
// Auth middleware
export { globalAuthMiddlewareRegistry, AuthMiddlewareRegistry, applyAuthRequestMiddleware, applyAuthResponseMiddleware, } from './middleware.js';
//# sourceMappingURL=index.js.map