Interface WebNotificationsAPI

interface WebNotificationsAPI {
    clearCache: () => void;
    deleteNotification: (
        notificationId: string,
        options?: ApiCallOptions,
    ) => Promise<DeleteNotificationHttpResponse>;
    deleteNotifications: (
        options?: ApiCallOptions,
    ) => Promise<DeleteNotificationsHttpResponse>;
    getNotification: (
        notificationId: string,
        options?: ApiCallOptions,
    ) => Promise<GetNotificationHttpResponse>;
    getNotifications: (
        query: {
            limit?: number;
            page?: number;
            read?: boolean;
            resourceType?: string;
            sort?: "+createdAt" | "-createdAt" | "+updatedAt" | "-updatedAt";
        },
        options?: ApiCallOptions,
    ) => Promise<GetNotificationsHttpResponse>;
    patchNotification: (
        notificationId: string,
        body: NotificationPatchSchema,
        options?: ApiCallOptions,
    ) => Promise<PatchNotificationHttpResponse>;
    patchNotifications: (
        body: NotificationPatchSchema,
        options?: ApiCallOptions,
    ) => Promise<PatchNotificationsHttpResponse>;
}
Index

Properties

clearCache: () => void

Clears the cache for web-notifications api requests.

Type declaration

    • (): void
    • Clears the cache for web-notifications api requests.

      Returns void

deleteNotification: (
    notificationId: string,
    options?: ApiCallOptions,
) => Promise<DeleteNotificationHttpResponse>

Delete a notification.

Type declaration

The id of the notification to delete.

DeleteNotificationHttpError

deleteNotifications: (
    options?: ApiCallOptions,
) => Promise<DeleteNotificationsHttpResponse>

Delete all notifications.

Type declaration

DeleteNotificationsHttpError

getNotification: (
    notificationId: string,
    options?: ApiCallOptions,
) => Promise<GetNotificationHttpResponse>

Retrieve a single notification by Id.

Type declaration

The id of the notification to retrieve.

GetNotificationHttpError

getNotifications: (
    query: {
        limit?: number;
        page?: number;
        read?: boolean;
        resourceType?: string;
        sort?: "+createdAt" | "-createdAt" | "+updatedAt" | "-updatedAt";
    },
    options?: ApiCallOptions,
) => Promise<GetNotificationsHttpResponse>

Retrieve notifications matching the query.

Type declaration

    • (
          query: {
              limit?: number;
              page?: number;
              read?: boolean;
              resourceType?: string;
              sort?: "+createdAt" | "-createdAt" | "+updatedAt" | "-updatedAt";
          },
          options?: ApiCallOptions,
      ): Promise<GetNotificationsHttpResponse>
    • Retrieve notifications matching the query.

      Parameters

      • query: {
            limit?: number;
            page?: number;
            read?: boolean;
            resourceType?: string;
            sort?: "+createdAt" | "-createdAt" | "+updatedAt" | "-updatedAt";
        }

        an object with query parameters

        • Optionallimit?: number

          The number of notification entries to retrieved.

        • Optionalpage?: number

          Page number

        • Optionalread?: boolean

          Read status of the notification

        • OptionalresourceType?: string

          Filter by resource types. If passing more than 1 resource type, use comma seperated string.

        • Optionalsort?: "+createdAt" | "-createdAt" | "+updatedAt" | "-updatedAt"

          The field to sort by, with +/- prefix indicating sort order

      • Optionaloptions: ApiCallOptions

      Returns Promise<GetNotificationsHttpResponse>

      getNotifications(
      {
      resourceType: "app,space"
      }
      )

      GetNotificationsHttpError

getNotifications(
{
resourceType: "app,space"
}
)

an object with query parameters

GetNotificationsHttpError

patchNotification: (
    notificationId: string,
    body: NotificationPatchSchema,
    options?: ApiCallOptions,
) => Promise<PatchNotificationHttpResponse>

Patch a notification.

Type declaration

The id of the notification to update.

an object with the body content

PatchNotificationHttpError

patchNotifications: (
    body: NotificationPatchSchema,
    options?: ApiCallOptions,
) => Promise<PatchNotificationsHttpResponse>

Patch all notifications.

Type declaration

an object with the body content

PatchNotificationsHttpError