import type * as Ably from '@ably/pubsub-core/api';
import type { HttpObjectGetCompactResult, HttpObjectGetFullResult, HttpObjectGetParams, HttpObjectOperation, HttpObjectPublishResult } from '@ably/pubsub-core/liveobjects';
import type { WireHttpPaginatedResponse, WirePage } from './wire.js';
/**
* The names under which the Ably activities are registered on the worker. Every name is prefixed with `ably.`.
* `AblyHttpPlugin` adds the Ably activities over the worker's own `activities`, so an application activity with
* the same name is replaced. Application activities must not use names that start with `ably.`.
*/
export declare const ActivityNames: {
readonly publish: "ably.channel.publish";
readonly history: "ably.channel.history";
readonly status: "ably.channel.status";
readonly getMessage: "ably.channel.getMessage";
readonly updateMessage: "ably.channel.updateMessage";
readonly deleteMessage: "ably.channel.deleteMessage";
readonly appendMessage: "ably.channel.appendMessage";
readonly getMessageVersions: "ably.channel.getMessageVersions";
readonly presenceGet: "ably.channel.presence.get";
readonly presenceHistory: "ably.channel.presence.history";
readonly annotationsPublish: "ably.channel.annotations.publish";
readonly annotationsDelete: "ably.channel.annotations.delete";
readonly annotationsGet: "ably.channel.annotations.get";
readonly objectGet: "ably.channel.object.get";
readonly objectPublish: "ably.channel.object.publish";
readonly time: "ably.time";
readonly request: "ably.request";
readonly batchPublish: "ably.batchPublish";
readonly batchPresence: "ably.batchPresence";
readonly pushPublish: "ably.push.admin.publish";
readonly pushCreateApnsBroadcast: "ably.push.admin.createApnsBroadcast";
readonly pushLiveActivityStart: "ably.push.admin.liveActivity.start";
readonly pushLiveActivityUpdate: "ably.push.admin.liveActivity.update";
readonly pushLiveActivityEnd: "ably.push.admin.liveActivity.end";
readonly pushDeviceRegistrationsSave: "ably.push.admin.deviceRegistrations.save";
readonly pushDeviceRegistrationsGet: "ably.push.admin.deviceRegistrations.get";
readonly pushDeviceRegistrationsList: "ably.push.admin.deviceRegistrations.list";
readonly pushDeviceRegistrationsRemove: "ably.push.admin.deviceRegistrations.remove";
readonly pushDeviceRegistrationsRemoveWhere: "ably.push.admin.deviceRegistrations.removeWhere";
readonly pushChannelSubscriptionsSave: "ably.push.admin.channelSubscriptions.save";
readonly pushChannelSubscriptionsList: "ably.push.admin.channelSubscriptions.list";
readonly pushChannelSubscriptionsListChannels: "ably.push.admin.channelSubscriptions.listChannels";
readonly pushChannelSubscriptionsRemove: "ably.push.admin.channelSubscriptions.remove";
readonly pushChannelSubscriptionsRemoveWhere: "ably.push.admin.channelSubscriptions.removeWhere";
};
export type ActivityName = (typeof ActivityNames)[keyof typeof ActivityNames];
/** Identifies the channel that a channel-scoped activity operates on. */
export interface ChannelInput {
channel: string;
}
/**
* Input for {@link ActivityNames.publish}. The workflow normalises every overload of `channel.publish()` to an
* array of messages, and assigns message IDs when idempotent publishing is enabled.
*/
export interface PublishInput extends ChannelInput {
messages: Ably.Message[];
options?: Ably.PublishOptions;
}
/**
* Input for an activity that returns a paginated result. `params` is either the caller's query parameters for
* the first page, or the {@link PageParams} from a {@link WirePage}'s links when fetching a related page.
*/
export interface PaginatedInput
extends ChannelInput {
params?: P | Record;
}
export interface GetMessageInput extends ChannelInput {
serialOrMessage: string | Ably.Message;
}
export interface MessageOperationInput extends ChannelInput {
message: Ably.Message;
operation?: Ably.MessageOperation;
options?: Ably.PublishOptions;
}
export interface GetMessageVersionsInput extends ChannelInput {
serialOrMessage: string | Ably.Message;
params?: Record;
}
export interface AnnotationInput extends ChannelInput {
messageOrSerial: string | Ably.Message;
annotation: Ably.OutboundAnnotation;
}
export interface GetAnnotationsInput extends ChannelInput {
messageOrSerial: string | Ably.Message;
params: Ably.GetAnnotationsParams | Record | null;
}
export interface ObjectGetInput extends ChannelInput {
params?: HttpObjectGetParams;
}
export interface ObjectPublishInput extends ChannelInput {
operations: HttpObjectOperation | HttpObjectOperation[];
}
export interface RequestInput {
method: string;
path: string;
version: number;
params?: Record;
body?: unknown;
headers?: Record;
}
export interface BatchPublishInput {
specs: Ably.BatchPublishSpec | Ably.BatchPublishSpec[];
}
export interface BatchPresenceInput {
channels: string[];
}
export interface PushPublishInput {
recipient: any;
payload: any;
}
/** Input for a push admin activity that takes a single argument, such as a device or a set of filter parameters. */
export interface PushArgumentInput {
argument: T;
}
/**
* Input for a push admin activity that returns a paginated result. `params` is either the caller's filter
* parameters for the first page, or the {@link PageParams} from a {@link WirePage}'s links when fetching a related
* page.
*/
export interface PushListInput {
params?: P | Record;
}
/**
* The Ably activities, keyed by activity name. This is the type the workflow passes to `proxyActivities()`, and
* the type that the worker's activity implementations satisfy.
*/
export interface AblyActivities {
[ActivityNames.publish](input: PublishInput): Promise;
[ActivityNames.history](input: PaginatedInput): Promise>;
[ActivityNames.status](input: ChannelInput): Promise;
[ActivityNames.getMessage](input: GetMessageInput): Promise;
[ActivityNames.updateMessage](input: MessageOperationInput): Promise;
[ActivityNames.deleteMessage](input: MessageOperationInput): Promise;
[ActivityNames.appendMessage](input: MessageOperationInput): Promise;
[ActivityNames.getMessageVersions](input: GetMessageVersionsInput): Promise>;
[ActivityNames.presenceGet](input: PaginatedInput): Promise>;
[ActivityNames.presenceHistory](input: PaginatedInput): Promise>;
[ActivityNames.annotationsPublish](input: AnnotationInput): Promise;
[ActivityNames.annotationsDelete](input: AnnotationInput): Promise;
[ActivityNames.annotationsGet](input: GetAnnotationsInput): Promise>;
[ActivityNames.objectGet](input: ObjectGetInput): Promise;
[ActivityNames.objectPublish](input: ObjectPublishInput): Promise;
[ActivityNames.time](): Promise;
[ActivityNames.request](input: RequestInput): Promise>;
[ActivityNames.batchPublish](input: BatchPublishInput): Promise | Ably.BatchResult[]>;
[ActivityNames.batchPresence](input: BatchPresenceInput): Promise[]>;
[ActivityNames.pushPublish](input: PushPublishInput): Promise;
[ActivityNames.pushCreateApnsBroadcast](input: PushArgumentInput): Promise;
[ActivityNames.pushLiveActivityStart](input: PushArgumentInput): Promise;
[ActivityNames.pushLiveActivityUpdate](input: PushArgumentInput): Promise;
[ActivityNames.pushLiveActivityEnd](input: PushArgumentInput): Promise;
[ActivityNames.pushDeviceRegistrationsSave](input: PushArgumentInput): Promise;
[ActivityNames.pushDeviceRegistrationsGet](input: PushArgumentInput): Promise;
[ActivityNames.pushDeviceRegistrationsList](input: PushListInput): Promise>;
[ActivityNames.pushDeviceRegistrationsRemove](input: PushArgumentInput): Promise;
[ActivityNames.pushDeviceRegistrationsRemoveWhere](input: PushArgumentInput): Promise;
[ActivityNames.pushChannelSubscriptionsSave](input: PushArgumentInput): Promise;
[ActivityNames.pushChannelSubscriptionsList](input: PushListInput): Promise>;
[ActivityNames.pushChannelSubscriptionsListChannels](input: PushListInput): Promise>;
[ActivityNames.pushChannelSubscriptionsRemove](input: PushArgumentInput): Promise;
[ActivityNames.pushChannelSubscriptionsRemoveWhere](input: PushArgumentInput): Promise;
}