Skip to content

Latest commit

 

History

History
327 lines (292 loc) · 8.84 KB

File metadata and controls

327 lines (292 loc) · 8.84 KB

API Report File for "firebase-admin.messaging"

Do not edit this file. It is a report generated by API Extractor.

import { Agent } from 'http';

// @public
export interface AndroidConfig {
    bandwidthConstrainedOk?: boolean;
    collapseKey?: string;
    data?: {
        [key: string]: string;
    };
    directBootOk?: boolean;
    fcmOptions?: AndroidFcmOptions;
    notification?: AndroidNotification;
    priority?: ('high' | 'normal');
    restrictedPackageName?: string;
    restrictedSatelliteOk?: boolean;
    ttl?: number;
}

// @public
export interface AndroidFcmOptions {
    analyticsLabel?: string;
}

// @public
export interface AndroidNotification {
    body?: string;
    bodyLocArgs?: string[];
    bodyLocKey?: string;
    channelId?: string;
    clickAction?: string;
    color?: string;
    defaultLightSettings?: boolean;
    defaultSound?: boolean;
    defaultVibrateTimings?: boolean;
    eventTimestamp?: Date;
    icon?: string;
    imageUrl?: string;
    lightSettings?: LightSettings;
    localOnly?: boolean;
    notificationCount?: number;
    priority?: ('min' | 'low' | 'default' | 'high' | 'max');
    proxy?: ('allow' | 'deny' | 'if_priority_lowered');
    sound?: string;
    sticky?: boolean;
    tag?: string;
    ticker?: string;
    title?: string;
    titleLocArgs?: string[];
    titleLocKey?: string;
    vibrateTimingsMillis?: number[];
    visibility?: ('private' | 'public' | 'secret');
}

// @public
export interface ApnsConfig {
    fcmOptions?: ApnsFcmOptions;
    headers?: {
        [key: string]: string;
    };
    liveActivityToken?: string;
    payload?: ApnsPayload;
}

// @public
export interface ApnsFcmOptions {
    analyticsLabel?: string;
    imageUrl?: string;
}

// @public
export interface ApnsPayload {
    // (undocumented)
    [customData: string]: any;
    aps: Aps;
}

// @public
export interface Aps {
    // (undocumented)
    [customData: string]: any;
    alert?: string | ApsAlert;
    badge?: number;
    category?: string;
    contentAvailable?: boolean;
    mutableContent?: boolean;
    sound?: string | CriticalSound;
    threadId?: string;
}

// @public (undocumented)
export interface ApsAlert {
    // (undocumented)
    actionLocKey?: string;
    // (undocumented)
    body?: string;
    // (undocumented)
    launchImage?: string;
    // (undocumented)
    locArgs?: string[];
    // (undocumented)
    locKey?: string;
    // (undocumented)
    subtitle?: string;
    // (undocumented)
    subtitleLocArgs?: string[];
    // (undocumented)
    subtitleLocKey?: string;
    // (undocumented)
    title?: string;
    // (undocumented)
    titleLocArgs?: string[];
    // (undocumented)
    titleLocKey?: string;
}

// @public (undocumented)
export interface BaseMessage {
    // (undocumented)
    android?: AndroidConfig;
    // (undocumented)
    apns?: ApnsConfig;
    // (undocumented)
    data?: {
        [key: string]: string;
    };
    // (undocumented)
    fcmOptions?: FcmOptions;
    // (undocumented)
    notification?: Notification;
    // (undocumented)
    webpush?: WebpushConfig;
}

// @public
export interface BatchResponse {
    failureCount: number;
    responses: SendResponse[];
    successCount: number;
}

// @public (undocumented)
export interface ConditionMessage extends BaseMessage {
    // (undocumented)
    condition: string;
}

// @public
export interface CriticalSound {
    critical?: boolean;
    name: string;
    volume?: number;
}

// @public
export interface FcmOptions {
    analyticsLabel?: string;
}

// @public
export interface FidMessage extends BaseMessage {
    fid: string;
}

// @public
export interface FidMulticastMessage extends BaseMessage {
    fids: string[];
}

// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts
//
// @public
export class FirebaseMessagingError extends FirebaseError {
    // Warning: (ae-forgotten-export) The symbol "ErrorInfo" needs to be exported by the entry point index.d.ts
    constructor(info: ErrorInfo, message?: string);
}

// Warning: (ae-forgotten-export) The symbol "App" needs to be exported by the entry point index.d.ts
//
// @public
export function getMessaging(app?: App): Messaging;

// @public
export interface LightSettings {
    color: string;
    lightOffDurationMillis: number;
    lightOnDurationMillis: number;
}

// @public
export type Message = FidMessage | TokenMessage | TopicMessage | ConditionMessage;

// @public
export class Messaging {
    get app(): App;
    // @deprecated
    enableLegacyHttpTransport(): void;
    send(message: Message, dryRun?: boolean): Promise<string>;
    sendEach(messages: Message[], dryRun?: boolean): Promise<BatchResponse>;
    // @deprecated
    sendEachForMulticast(message: MulticastMessage, dryRun?: boolean): Promise<BatchResponse>;
    sendEachForMulticast(message: FidMulticastMessage, dryRun?: boolean): Promise<BatchResponse>;
    subscribeToTopic(registrationTokenOrTokens: string | string[], topic: string): Promise<MessagingTopicManagementResponse>;
    // @deprecated
    subscribeToTopicLegacy(registrationTokenOrTokens: string | string[], topic: string): Promise<MessagingTopicManagementResponse>;
    unsubscribeFromTopic(registrationTokenOrTokens: string | string[], topic: string): Promise<MessagingTopicManagementResponse>;
    // @deprecated
    unsubscribeFromTopicLegacy(registrationTokenOrTokens: string | string[], topic: string): Promise<MessagingTopicManagementResponse>;
}

// @public
export const MessagingErrorCode: {
    readonly INVALID_ARGUMENT: "invalid-argument";
    readonly INVALID_RECIPIENT: "invalid-recipient";
    readonly INVALID_PAYLOAD: "invalid-payload";
    readonly INVALID_DATA_PAYLOAD_KEY: "invalid-data-payload-key";
    readonly PAYLOAD_SIZE_LIMIT_EXCEEDED: "payload-size-limit-exceeded";
    readonly INVALID_OPTIONS: "invalid-options";
    readonly INVALID_REGISTRATION_TOKEN: "invalid-registration-token";
    readonly REGISTRATION_TOKEN_NOT_REGISTERED: "registration-token-not-registered";
    readonly INSTALLATION_ID_NOT_REGISTERED: "installation-id-not-registered";
    readonly MISMATCHED_CREDENTIAL: "mismatched-credential";
    readonly INVALID_PACKAGE_NAME: "invalid-package-name";
    readonly DEVICE_MESSAGE_RATE_EXCEEDED: "device-message-rate-exceeded";
    readonly TOPICS_MESSAGE_RATE_EXCEEDED: "topics-message-rate-exceeded";
    readonly TOPICS_SUBSCRIPTION_RATE_EXCEEDED: "topics-subscription-rate-exceeded";
    readonly MESSAGE_RATE_EXCEEDED: "message-rate-exceeded";
    readonly THIRD_PARTY_AUTH_ERROR: "third-party-auth-error";
    readonly TOO_MANY_TOPICS: "too-many-topics";
    readonly AUTHENTICATION_ERROR: "authentication-error";
    readonly SERVER_UNAVAILABLE: "server-unavailable";
    readonly INTERNAL_ERROR: "internal-error";
    readonly UNKNOWN_ERROR: "unknown-error";
};

// @public
export type MessagingErrorCode = typeof MessagingErrorCode[keyof typeof MessagingErrorCode];

// @public
export interface MessagingTopicManagementResponse {
    // Warning: (ae-forgotten-export) The symbol "FirebaseArrayIndexError" needs to be exported by the entry point index.d.ts
    errors: FirebaseArrayIndexError[];
    failureCount: number;
    successCount: number;
}

// @public @deprecated
export interface MulticastMessage extends BaseMessage {
    fids?: string[];
    // @deprecated
    tokens: string[];
}

// @public
export interface Notification {
    body?: string;
    imageUrl?: string;
    title?: string;
}

// @public
export interface SendResponse {
    error?: FirebaseError;
    messageId?: string;
    success: boolean;
}

// @public @deprecated (undocumented)
export interface TokenMessage extends BaseMessage {
    // (undocumented)
    token: string;
}

// @public (undocumented)
export interface TopicMessage extends BaseMessage {
    // (undocumented)
    topic: string;
}

// @public
export interface WebpushConfig {
    data?: {
        [key: string]: string;
    };
    fcmOptions?: WebpushFcmOptions;
    headers?: {
        [key: string]: string;
    };
    notification?: WebpushNotification;
}

// @public
export interface WebpushFcmOptions {
    link?: string;
}

// @public
export interface WebpushNotification {
    // (undocumented)
    [key: string]: any;
    actions?: Array<{
        action: string;
        icon?: string;
        title: string;
    }>;
    badge?: string;
    body?: string;
    data?: any;
    dir?: 'auto' | 'ltr' | 'rtl';
    icon?: string;
    image?: string;
    lang?: string;
    renotify?: boolean;
    requireInteraction?: boolean;
    silent?: boolean;
    tag?: string;
    timestamp?: number;
    title?: string;
    vibrate?: number | number[];
}