@owlworks/hoot-api
Advanced tools
Comparing version 0.0.8 to 0.0.10
import { Activity } from "botframework-schema"; | ||
export declare enum ChannelStatus { | ||
CREATED = "created", | ||
CREATING = "creating", | ||
CREATION_FAILED = "creation_failed", | ||
CREATION_QUEUED = "creation_queued", | ||
DISABLED = "disabled", | ||
DISABLED_FAILED = "disabled_failed", | ||
DISABLING = "disabling", | ||
UPDATED = "updated", | ||
UPDATING = "updating", | ||
UPDATION_FAILED = "updation_failed", | ||
UPDATION_QUEUED = "updation_queued" | ||
} | ||
export declare enum ChannelType { | ||
@@ -8,11 +21,2 @@ FACEBOOK = "facebook", | ||
} | ||
export declare enum ChannelStatus { | ||
CREATED = "created", | ||
CREATING = "creating", | ||
CREATION_FAILED = "creation_failed", | ||
DELETED = "deleted", | ||
DELETING = "deleting", | ||
DELETION_FAILED = "deletion_failed", | ||
QUEUED = "queued" | ||
} | ||
export interface IAccountWebhook { | ||
@@ -29,4 +33,4 @@ accountWebhookId: string; | ||
email?: string; | ||
keyId?: string; | ||
webhook?: IAccountWebhook; | ||
keys: Array<IAccountKey>; | ||
webhooks: Array<IAccountWebhook>; | ||
} | ||
@@ -36,4 +40,5 @@ export interface IAccountKey { | ||
key: string; | ||
creationTimestampSinceEpochInMillis?: number; | ||
expirationTimestampSinceEpochInMillis?: number; | ||
creationTimestampSinceEpochInMillis: string; | ||
expirationTimestampSinceEpochInMillis: string; | ||
status: string; | ||
} | ||
@@ -47,10 +52,2 @@ export interface IFacebookConfiguration { | ||
} | ||
export interface ITelegramConfiguration { | ||
authToken: string; | ||
} | ||
export interface IViberConfiguration { | ||
avatar: string; | ||
name: string; | ||
authToken: string; | ||
} | ||
export interface IMicrosoftTeamsConfiguration { | ||
@@ -67,2 +64,10 @@ botAppId: string; | ||
} | ||
export interface ITelegramConfiguration { | ||
authToken: string; | ||
} | ||
export interface IViberConfiguration { | ||
avatar: string; | ||
name: string; | ||
authToken: string; | ||
} | ||
export type Configuration = IFacebookConfiguration | IViberConfiguration | ITelegramConfiguration | IMicrosoftTeamsConfiguration; | ||
@@ -119,2 +124,5 @@ export interface IChannel { | ||
} | ||
export interface IUpdateChannelRequest { | ||
configuration: Configuration; | ||
} | ||
export declare class HootClient { | ||
@@ -143,2 +151,3 @@ private static readonly DEFAULT_API_URL; | ||
updateAccountSecret(accountSecret: IHootAccountSecret): void; | ||
updateChannel(accountId: string, channelId: string, request: IUpdateChannelRequest): Promise<IChannel>; | ||
webhook(accountId: string): Promise<IAccountWebhook>; | ||
@@ -145,0 +154,0 @@ sendMessage(request: ISendMessageRequest): Promise<ISendMessage>; |
@@ -6,4 +6,18 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.HootClient = exports.ChannelStatus = exports.ChannelType = void 0; | ||
exports.HootClient = exports.ChannelType = exports.ChannelStatus = void 0; | ||
const axios_1 = __importDefault(require("axios")); | ||
var ChannelStatus; | ||
(function (ChannelStatus) { | ||
ChannelStatus["CREATED"] = "created"; | ||
ChannelStatus["CREATING"] = "creating"; | ||
ChannelStatus["CREATION_FAILED"] = "creation_failed"; | ||
ChannelStatus["CREATION_QUEUED"] = "creation_queued"; | ||
ChannelStatus["DISABLED"] = "disabled"; | ||
ChannelStatus["DISABLED_FAILED"] = "disabled_failed"; | ||
ChannelStatus["DISABLING"] = "disabling"; | ||
ChannelStatus["UPDATED"] = "updated"; | ||
ChannelStatus["UPDATING"] = "updating"; | ||
ChannelStatus["UPDATION_FAILED"] = "updation_failed"; | ||
ChannelStatus["UPDATION_QUEUED"] = "updation_queued"; | ||
})(ChannelStatus = exports.ChannelStatus || (exports.ChannelStatus = {})); | ||
var ChannelType; | ||
@@ -16,12 +30,2 @@ (function (ChannelType) { | ||
})(ChannelType = exports.ChannelType || (exports.ChannelType = {})); | ||
var ChannelStatus; | ||
(function (ChannelStatus) { | ||
ChannelStatus["CREATED"] = "created"; | ||
ChannelStatus["CREATING"] = "creating"; | ||
ChannelStatus["CREATION_FAILED"] = "creation_failed"; | ||
ChannelStatus["DELETED"] = "deleted"; | ||
ChannelStatus["DELETING"] = "deleting"; | ||
ChannelStatus["DELETION_FAILED"] = "deletion_failed"; | ||
ChannelStatus["QUEUED"] = "queued"; | ||
})(ChannelStatus = exports.ChannelStatus || (exports.ChannelStatus = {})); | ||
class HootClient { | ||
@@ -123,2 +127,7 @@ constructor(options) { | ||
} | ||
async updateChannel(accountId, channelId, request) { | ||
const headers = this.requestHeadersWithAdminSecretOrAccountApiKey(); | ||
const response = await axios_1.default.put(`${this.apiUrl}/account/${accountId}/channel/${channelId}`, request, { headers }); | ||
return response.data.data; | ||
} | ||
async webhook(accountId) { | ||
@@ -125,0 +134,0 @@ const headers = this.requestHeadersWithAdminSecretOrAccountApiKey(); |
@@ -45,3 +45,3 @@ { | ||
"types": "dist/index.d.ts", | ||
"version": "0.0.8" | ||
"version": "0.0.10" | ||
} |
14499
317