apns2
Version:
Node client for connecting to Apple's Push Notification Service using the new HTTP/2 protocol with JSON web tokens.
53 lines (52 loc) • 2.15 kB
TypeScript
import type { Notification } from "./notifications/notification.js";
export declare const Errors: {
readonly badCertificate: "BadCertificate";
readonly badCertificateEnvironment: "BadCertificateEnvironment";
readonly badCollapseId: "BadCollapseId";
readonly badDeviceToken: "BadDeviceToken";
readonly badExpirationDate: "BadExpirationDate";
readonly badMessageId: "BadMessageId";
readonly badPath: "BadPath";
readonly badPriority: "BadPriority";
readonly badTopic: "BadTopic";
readonly deviceTokenNotForTopic: "DeviceTokenNotForTopic";
readonly duplicateHeaders: "DuplicateHeaders";
readonly error: "Error";
readonly expiredProviderToken: "ExpiredProviderToken";
readonly forbidden: "Forbidden";
readonly idleTimeout: "IdleTimeout";
readonly internalServerError: "InternalServerError";
readonly invalidProviderToken: "InvalidProviderToken";
readonly invalidPushType: "InvalidPushType";
readonly invalidSigningKey: "InvalidSigningKey";
readonly methodNotAllowed: "MethodNotAllowed";
readonly missingDeviceToken: "MissingDeviceToken";
readonly missingProviderToken: "MissingProviderToken";
readonly missingTopic: "MissingTopic";
readonly payloadEmpty: "PayloadEmpty";
readonly payloadTooLarge: "PayloadTooLarge";
readonly serviceUnavailable: "ServiceUnavailable";
readonly shutdown: "Shutdown";
readonly tooManyProviderTokenUpdates: "TooManyProviderTokenUpdates";
readonly tooManyRequests: "TooManyRequests";
readonly topicDisallowed: "TopicDisallowed";
readonly unknownError: "UnknownError";
readonly unregistered: "Unregistered";
};
export type Error = (typeof Errors)[keyof typeof Errors];
export interface ApnsResponseError {
reason: string;
timestamp: number;
}
export declare class ApnsError extends Error {
readonly statusCode: number;
readonly notification: Notification;
readonly response: ApnsResponseError;
constructor(props: {
statusCode: number;
notification: Notification;
response: ApnsResponseError;
});
get reason(): string;
get timestamp(): number;
}