diff --git a/package-lock.json b/package-lock.json index 9884752..e38ad80 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/apps-ts-definition", - "version": "0.9.12", + "version": "0.9.13", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/accessors/IRead.ts b/src/accessors/IRead.ts index a08571f..20b46fa 100644 --- a/src/accessors/IRead.ts +++ b/src/accessors/IRead.ts @@ -3,6 +3,7 @@ import { IMessageRead } from './IMessageRead'; import { INotifier } from './IModify'; import { IPersistenceRead } from './IPersistenceRead'; import { IRoomRead } from './IRoomRead'; +import { ISubscriptionRead } from './ISubscriptionRead'; import { IUserRead } from './IUserRead'; /** @@ -23,6 +24,9 @@ export interface IRead { /** Gets the IRoomRead instance. */ getRoomReader(): IRoomRead; + /** Gets the ISubscriptionRead instance */ + getSubscriptionReader(): ISubscriptionRead; + /** Gets the IUserRead instance. */ getUserReader(): IUserRead; diff --git a/src/accessors/ISubscriptionRead.ts b/src/accessors/ISubscriptionRead.ts new file mode 100644 index 0000000..b30e0e2 --- /dev/null +++ b/src/accessors/ISubscriptionRead.ts @@ -0,0 +1,15 @@ +import { ISubscription } from '../subscriptions/ISubscription'; + +/** + * This accessor provides methods for accessing + * subscriptions in a read-only-fashion. + */ +export interface ISubscriptionRead { + /** + * Gets a list of subscriptions by a room id. + * + * @param roomId the id of the room + * @returns an iterator of subscriptions + */ + getByRoomId(roomId: string): Promise>; +} diff --git a/src/accessors/index.ts b/src/accessors/index.ts index bad8de8..cf77eb6 100644 --- a/src/accessors/index.ts +++ b/src/accessors/index.ts @@ -36,6 +36,7 @@ import { ISettingRead } from './ISettingRead'; import { ISettingsExtend } from './ISettingsExtend'; import { ISlashCommandsExtend } from './ISlashCommandsExtend'; import { ISlashCommandsModify } from './ISlashCommandsModify'; +import { ISubscriptionRead } from './ISubscriptionRead'; import { IUserRead } from './IUserRead'; export { @@ -72,6 +73,7 @@ export { ISettingsExtend, ISlashCommandsExtend, ISlashCommandsModify, + ISubscriptionRead, IUserRead, LogMessageSeverity, RequestMethod, diff --git a/src/subscriptions/ISubscription.ts b/src/subscriptions/ISubscription.ts new file mode 100644 index 0000000..3c3b21e --- /dev/null +++ b/src/subscriptions/ISubscription.ts @@ -0,0 +1,3 @@ +export interface ISubscription { + id: string; +} diff --git a/src/subscriptions/index.ts b/src/subscriptions/index.ts new file mode 100644 index 0000000..669c044 --- /dev/null +++ b/src/subscriptions/index.ts @@ -0,0 +1,2 @@ +import { ISubscription } from './ISubscription'; +export { ISubscription };