BREAKING CHANGE(changed main class to SlackAccount): update
This commit is contained in:
parent
ec17d7835e
commit
3510767a72
@ -5,11 +5,11 @@ let testQenv = new Qenv(process.cwd(), process.cwd() + '/.nogit');
|
|||||||
|
|
||||||
import * as slackme from '../ts/index';
|
import * as slackme from '../ts/index';
|
||||||
|
|
||||||
let testSlackme: slackme.Slackme;
|
let testSlackme: slackme.SlackAccount;
|
||||||
let testSlackMessage: slackme.SlackMessage;
|
let testSlackMessage: slackme.SlackMessage;
|
||||||
|
|
||||||
tap.test('should create a valid slackme instance', async (tools) => {
|
tap.test('should create a valid slackme instance', async (tools) => {
|
||||||
testSlackme = new slackme.Slackme(testQenv.getEnvVarOnDemand('SLACK_TOKEN'));
|
testSlackme = new slackme.SlackAccount(testQenv.getEnvVarOnDemand('SLACK_TOKEN'));
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should send a message to Slack', async (tools) => {
|
tap.test('should send a message to Slack', async (tools) => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import * as plugins from './slack.plugins';
|
import * as plugins from './slack.plugins';
|
||||||
import { IMessageOptions } from './slack.classes.slackmessage';
|
import { IMessageOptions } from './slack.classes.slackmessage';
|
||||||
|
|
||||||
export class Slackme {
|
export class SlackAccount {
|
||||||
private postUrl = 'https://slack.com/api/chat.postMessage';
|
private postUrl = 'https://slack.com/api/chat.postMessage';
|
||||||
private updateUrl = 'https://slack.com/api/chat.update';
|
private updateUrl = 'https://slack.com/api/chat.update';
|
||||||
private slackToken: string;
|
private slackToken: string;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as plugins from './slack.plugins';
|
import * as plugins from './slack.plugins';
|
||||||
import { Slackme } from './slack.classes.slackme';
|
import { SlackAccount } from './slack.classes.slackme';
|
||||||
|
|
||||||
export interface IAttachmentField {
|
export interface IAttachmentField {
|
||||||
title: string;
|
title: string;
|
||||||
@ -53,11 +53,11 @@ export interface IMessageOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class SlackMessage {
|
export class SlackMessage {
|
||||||
slackmeRef: Slackme;
|
slackmeRef: SlackAccount;
|
||||||
messageOptions: IMessageOptions;
|
messageOptions: IMessageOptions;
|
||||||
channel: string;
|
channel: string;
|
||||||
ts: string;
|
ts: string;
|
||||||
constructor(messageOptionsArg: IMessageOptions, slackmeArg?: Slackme) {
|
constructor(messageOptionsArg: IMessageOptions, slackmeArg?: SlackAccount) {
|
||||||
if (slackmeArg) {
|
if (slackmeArg) {
|
||||||
this.slackmeRef = slackmeArg;
|
this.slackmeRef = slackmeArg;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user