/** * Notification operations for Managed Runtime. * * Handles listing, creating, updating, and deleting project notifications. * * @module operations/mrt/notification */ import type { AuthStrategy } from '../../auth/types.js'; import type { components } from '../../clients/mrt.js'; /** * Email notification type from API. */ export type MrtEmailNotification = components['schemas']['EmailNotification']; /** * Polymorphic notification (currently only email). */ export type MrtNotification = components['schemas']['PolymorphicNotification']; /** * Patched notification for updates. */ export type PatchedMrtNotification = components['schemas']['PatchedPolymorphicNotification']; /** * Options for listing notifications. */ export interface ListNotificationsOptions { /** * The project slug. */ projectSlug: string; /** * Maximum number of results to return. */ limit?: number; /** * Offset for pagination. */ offset?: number; /** * Filter by target slug. */ targetSlug?: string; /** * MRT API origin URL. * @default "https://cloud.mobify.com" */ origin?: string; } /** * Result of listing notifications. */ export interface ListNotificationsResult { /** * Total count of notifications. */ count: number; /** * URL for next page of results. */ next: string | null; /** * URL for previous page of results. */ previous: string | null; /** * Array of notifications. */ notifications: MrtNotification[]; } /** * Lists notifications for an MRT project. * * @param options - List options including project slug * @param auth - Authentication strategy (ApiKeyStrategy) * @returns Paginated list of notifications * @throws Error if request fails * * @example * ```typescript * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth'; * import { listNotifications } from '@salesforce/b2c-tooling-sdk/operations/mrt'; * * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization'); * * const result = await listNotifications({ * projectSlug: 'my-storefront' * }, auth); * * for (const notification of result.notifications) { * console.log(`Notification ${notification.id}`); * } * ``` */ export declare function listNotifications(options: ListNotificationsOptions, auth: AuthStrategy): Promise; /** * Options for creating a notification. */ export interface CreateNotificationOptions { /** * The project slug. */ projectSlug: string; /** * Target slugs to associate with this notification. */ targets: string[]; /** * Email recipients for this notification. */ recipients: string[]; /** * Trigger notification when deployment starts. */ deploymentStart?: boolean; /** * Trigger notification when deployment succeeds. */ deploymentSuccess?: boolean; /** * Trigger notification when deployment fails. */ deploymentFailed?: boolean; /** * MRT API origin URL. * @default "https://cloud.mobify.com" */ origin?: string; } /** * Creates a notification for an MRT project. * * @param options - Create notification options * @param auth - Authentication strategy (ApiKeyStrategy) * @returns The created notification * @throws Error if request fails * * @example * ```typescript * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth'; * import { createNotification } from '@salesforce/b2c-tooling-sdk/operations/mrt'; * * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization'); * * const notification = await createNotification({ * projectSlug: 'my-storefront', * targets: ['staging', 'production'], * recipients: ['team@example.com'], * deploymentStart: true, * deploymentFailed: true * }, auth); * ``` */ export declare function createNotification(options: CreateNotificationOptions, auth: AuthStrategy): Promise; /** * Options for getting a notification. */ export interface GetNotificationOptions { /** * The project slug. */ projectSlug: string; /** * Notification ID. */ notificationId: string; /** * MRT API origin URL. * @default "https://cloud.mobify.com" */ origin?: string; } /** * Gets a notification from an MRT project. * * @param options - Get notification options * @param auth - Authentication strategy (ApiKeyStrategy) * @returns The notification * @throws Error if request fails */ export declare function getNotification(options: GetNotificationOptions, auth: AuthStrategy): Promise; /** * Options for updating a notification. */ export interface UpdateNotificationOptions { /** * The project slug. */ projectSlug: string; /** * Notification ID. */ notificationId: string; /** * Target slugs to associate with this notification. */ targets?: string[]; /** * Email recipients for this notification. */ recipients?: string[]; /** * Trigger notification when deployment starts. */ deploymentStart?: boolean; /** * Trigger notification when deployment succeeds. */ deploymentSuccess?: boolean; /** * Trigger notification when deployment fails. */ deploymentFailed?: boolean; /** * MRT API origin URL. * @default "https://cloud.mobify.com" */ origin?: string; } /** * Updates a notification in an MRT project. * * @param options - Update notification options * @param auth - Authentication strategy (ApiKeyStrategy) * @returns The updated notification * @throws Error if request fails */ export declare function updateNotification(options: UpdateNotificationOptions, auth: AuthStrategy): Promise; /** * Options for deleting a notification. */ export interface DeleteNotificationOptions { /** * The project slug. */ projectSlug: string; /** * Notification ID. */ notificationId: string; /** * MRT API origin URL. * @default "https://cloud.mobify.com" */ origin?: string; } /** * Deletes a notification from an MRT project. * * @param options - Delete notification options * @param auth - Authentication strategy (ApiKeyStrategy) * @throws Error if request fails */ export declare function deleteNotification(options: DeleteNotificationOptions, auth: AuthStrategy): Promise;