/** * Project operations for Managed Runtime. * * Handles CRUD operations for MRT projects. * * @module operations/mrt/project */ import type { AuthStrategy } from '../../auth/types.js'; import type { components } from '../../clients/mrt.js'; /** * MRT project type for create/read operations. */ export type MrtProject = components['schemas']['APIProjectV2Create']; /** * MRT project type for update operations. */ export type MrtProjectUpdate = components['schemas']['APIProjectV2Update']; /** * Patched project for partial updates. */ export type PatchedMrtProject = components['schemas']['PatchedAPIProjectV2Update']; /** * SSR region enum. */ export type SsrRegion = components['schemas']['SsrRegionEnum']; /** * Options for listing MRT projects. */ export interface ListProjectsOptions { /** * Filter by organization slug. */ organization?: 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 projects. */ export interface ListProjectsResult { /** * Total count of projects. */ count: number; /** * URL for next page of results. */ next: string | null; /** * URL for previous page of results. */ previous: string | null; /** * Array of projects. */ projects: MrtProject[]; } /** * Lists projects accessible to the authenticated user. * * @param options - List options including organization filter and pagination * @param auth - Authentication strategy (ApiKeyStrategy) * @returns Paginated list of projects * @throws Error if request fails * * @example * ```typescript * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth'; * import { listProjects } from '@salesforce/b2c-tooling-sdk/operations/mrt'; * * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization'); * * // List all projects * const result = await listProjects({}, auth); * * // List projects for a specific organization * const orgProjects = await listProjects({ organization: 'my-org' }, auth); * ``` */ export declare function listProjects(options: ListProjectsOptions, auth: AuthStrategy): Promise; /** * Options for creating an MRT project. */ export interface CreateProjectOptions { /** * User-friendly name for the project. */ name: string; /** * Project slug/identifier (auto-generated if not provided). */ slug?: string; /** * Organization slug to create the project in. */ organization: string; /** * Project URL. */ url?: string; /** * Default AWS region for new targets. */ ssrRegion?: SsrRegion; /** * MRT API origin URL. * @default "https://cloud.mobify.com" */ origin?: string; } /** * Creates a new MRT project. * * @param options - Project creation options * @param auth - Authentication strategy (ApiKeyStrategy) * @returns The created project * @throws Error if creation fails * * @example * ```typescript * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth'; * import { createProject } from '@salesforce/b2c-tooling-sdk/operations/mrt'; * * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization'); * * const project = await createProject({ * name: 'My Storefront', * organization: 'my-org', * ssrRegion: 'us-east-1' * }, auth); * * console.log(`Created project: ${project.slug}`); * ``` */ export declare function createProject(options: CreateProjectOptions, auth: AuthStrategy): Promise; /** * Options for getting an MRT project. */ export interface GetProjectOptions { /** * Project slug to retrieve. */ projectSlug: string; /** * MRT API origin URL. * @default "https://cloud.mobify.com" */ origin?: string; } /** * Gets a project by slug. * * @param options - Get options * @param auth - Authentication strategy (ApiKeyStrategy) * @returns The project * @throws Error if request fails * * @example * ```typescript * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth'; * import { getProject } from '@salesforce/b2c-tooling-sdk/operations/mrt'; * * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization'); * * const project = await getProject({ projectSlug: 'my-storefront' }, auth); * console.log(`Project: ${project.name}`); * ``` */ export declare function getProject(options: GetProjectOptions, auth: AuthStrategy): Promise; /** * Options for updating an MRT project. */ export interface UpdateProjectOptions { /** * Project slug to update. */ projectSlug: string; /** * New name for the project. */ name?: string; /** * New URL for the project. */ url?: string; /** * New default AWS region for new targets. */ ssrRegion?: SsrRegion; /** * MRT API origin URL. * @default "https://cloud.mobify.com" */ origin?: string; } /** * Updates an MRT project. * * @param options - Update options * @param auth - Authentication strategy (ApiKeyStrategy) * @returns The updated project * @throws Error if update fails * * @example * ```typescript * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth'; * import { updateProject } from '@salesforce/b2c-tooling-sdk/operations/mrt'; * * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization'); * * const updated = await updateProject({ * projectSlug: 'my-storefront', * name: 'My Updated Storefront' * }, auth); * ``` */ export declare function updateProject(options: UpdateProjectOptions, auth: AuthStrategy): Promise; /** * Options for deleting an MRT project. */ export interface DeleteProjectOptions { /** * Project slug to delete. */ projectSlug: string; /** * MRT API origin URL. * @default "https://cloud.mobify.com" */ origin?: string; } /** * Deletes an MRT project. * * @param options - Delete options * @param auth - Authentication strategy (ApiKeyStrategy) * @throws Error if deletion fails * * @example * ```typescript * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth'; * import { deleteProject } from '@salesforce/b2c-tooling-sdk/operations/mrt'; * * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization'); * * await deleteProject({ projectSlug: 'my-old-project' }, auth); * console.log('Project deleted'); * ``` */ export declare function deleteProject(options: DeleteProjectOptions, auth: AuthStrategy): Promise;