diff --git a/.gitignore b/.gitignore index 6704566..87b1378 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,7 @@ dist # TernJS port file .tern-port + +#RC Server and APP Testing +RC_SERVER +TESTING_APPS \ No newline at end of file diff --git a/README.md b/README.md index 098e2cd..68f5eee 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,22 @@ -# Apps.Github22 -The ultimate app extending Rocket.Chat for all developers collaborating on Github (2022 and beyond) +# Github +The ultimate app extending Rocket.Chat for all developers collaborating on Github + +## Getting Started +Now that you have generated a blank default Rocket.Chat App, what are you supposed to do next? +Start developing! Open up your favorite editor, our recommended one is Visual Studio code, +and start working on your App. Once you have something ready to test, you can either +package it up and manually deploy it to your test instance or you can use the CLI to do so. +Here are some commands to get started: +- `rc-apps package`: this command will generate a packaged app file (zip) which can be installed **if** it compiles with TypeScript +- `rc-apps deploy`: this will do what `package` does but will then ask you for your server url, username, and password to deploy it for you + +## Documentation +Here are some links to examples and documentation: +- [Rocket.Chat Apps TypeScript Definitions Documentation](https://rocketchat.github.io/Rocket.Chat.Apps-engine/) +- [Rocket.Chat Apps TypeScript Definitions Repository](https://github.com/RocketChat/Rocket.Chat.Apps-engine) +- [Example Rocket.Chat Apps](https://github.com/graywolf336/RocketChatApps) +- Community Forums + - [App Requests](https://forums.rocket.chat/c/rocket-chat-apps/requests) + - [App Guides](https://forums.rocket.chat/c/rocket-chat-apps/guides) + - [Top View of Both Categories](https://forums.rocket.chat/c/rocket-chat-apps) +- [#rocketchat-apps on Open.Rocket.Chat](https://open.rocket.chat/channel/rocketchat-apps) diff --git a/github/.editorconfig b/github/.editorconfig new file mode 100644 index 0000000..a1166f2 --- /dev/null +++ b/github/.editorconfig @@ -0,0 +1,16 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +indent_style = space +indent_size = 4 +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false diff --git a/github/.gitignore b/github/.gitignore new file mode 100644 index 0000000..a461715 --- /dev/null +++ b/github/.gitignore @@ -0,0 +1,28 @@ +# ignore modules pulled in from npm +node_modules/ + +# rc-apps package output +dist/ + +# JetBrains IDEs +out/ +.idea/ +.idea_modules/ + +# macOS +.DS_Store +.AppleDouble +.LSOverride +._* +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk diff --git a/github/.rcappsconfig b/github/.rcappsconfig new file mode 100644 index 0000000..f9892ff --- /dev/null +++ b/github/.rcappsconfig @@ -0,0 +1,19 @@ +{ + "url": "http://localhost:3000", + "username": "", + "password": "", + "ignoredFiles": [ + "**/README.md", + "**/package-lock.json", + "**/package.json", + "**/tslint.json", + "**/tsconfig.json", + "**/*.js", + "**/*.js.map", + "**/*.d.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/dist/**", + "**/.*" + ] +} \ No newline at end of file diff --git a/github/.vscode/extensions.json b/github/.vscode/extensions.json new file mode 100644 index 0000000..b1e1592 --- /dev/null +++ b/github/.vscode/extensions.json @@ -0,0 +1,11 @@ + { + "recommendations": [ + "EditorConfig.editorconfig", + "eamodio.gitlens", + "eg2.vscode-npm-script", + "wayou.vscode-todo-highlight", + "minhthai.vscode-todo-parser", + "ms-vscode.vscode-typescript-tslint-plugin", + "rbbit.typescript-hero" + ] +} diff --git a/github/GithubApp.ts b/github/GithubApp.ts new file mode 100644 index 0000000..d949115 --- /dev/null +++ b/github/GithubApp.ts @@ -0,0 +1,38 @@ +import { + IAppAccessors, + IConfigurationExtend, + IHttp, + ILogger, + IModify, + IPersistence, + IRead, +} from "@rocket.chat/apps-engine/definition/accessors"; +import { App } from "@rocket.chat/apps-engine/definition/App"; +import { IAppInfo } from "@rocket.chat/apps-engine/definition/metadata"; +import { GithubCommand } from "./commands/GithubCommand"; +import { IUIKitResponse, UIKitBlockInteractionContext, UIKitViewCloseInteractionContext } from '@rocket.chat/apps-engine/definition/uikit'; +import { ExecuteViewClosedHandler } from "./handlers/ExecuteViewClosedHandler"; +import { ExecuteBlockActionHandler } from "./handlers/ExecuteBlockActionHandler"; + +export class GithubApp extends App { + constructor(info: IAppInfo, logger: ILogger, accessors: IAppAccessors) { + super(info, logger, accessors); + } + + public async executeBlockActionHandler(context: UIKitBlockInteractionContext, read: IRead, http: IHttp, persistence: IPersistence, modify: IModify): Promise { + const handler = new ExecuteBlockActionHandler(this, read, http, modify, persistence); + return await handler.run(context); + } + + public async executeViewClosedHandler(context: UIKitViewCloseInteractionContext, read: IRead, http: IHttp, persistence: IPersistence, modify: IModify) { + const handler = new ExecuteViewClosedHandler(this, read, http, modify, persistence); + return await handler.run(context); + } + + public async extendConfiguration( + configuration: IConfigurationExtend + ): Promise { + const gitHubCommand: GithubCommand = new GithubCommand(this); + await configuration.slashCommands.provideSlashCommand(gitHubCommand); + } +} diff --git a/github/app.json b/github/app.json new file mode 100644 index 0000000..d52df82 --- /dev/null +++ b/github/app.json @@ -0,0 +1,16 @@ +{ + "id": "826f0d95-9e25-48a6-a781-a32f147230a5", + "version": "0.0.1", + "requiredApiVersion": "^1.19.0", + "iconFile": "icon.png", + "author": { + "name": "Samad Yar Khan", + "homepage": "/samad-yar-khan", + "support": "/samad-yar-khan" + }, + "name": "Github", + "nameSlug": "github", + "classFile": "GithubApp.ts", + "description": "The ultimate app extending Rocket.Chat for all developers collaborating on Github", + "implements": [] +} \ No newline at end of file diff --git a/github/commands/GithubCommand.ts b/github/commands/GithubCommand.ts new file mode 100644 index 0000000..b38cd90 --- /dev/null +++ b/github/commands/GithubCommand.ts @@ -0,0 +1,86 @@ +import { + ISlashCommand, + SlashCommandContext, +} from "@rocket.chat/apps-engine/definition/slashcommands"; +import { + IHttp, + IModify, + IPersistence, + IRead, +} from "@rocket.chat/apps-engine/definition/accessors"; + +import { GithubApp } from "../GithubApp"; +import { initiatorMessage } from "../lib/initiatorMessage"; +import { helperMessage } from "../lib/helperMessage"; +import { basicQueryMessage } from "../helpers/basicQueryMessage"; +import { pullDetailsModal } from "../modals/pullDetailsModal"; + + +export class GithubCommand implements ISlashCommand { + public constructor(private readonly app: GithubApp) {} + public command = "github"; + public i18nDescription = "fetching githup data"; + public providesPreview = false; + public i18nParamsExample = ""; + + public async executor( + context: SlashCommandContext, + read: IRead, + modify: IModify, + http: IHttp, + persistence: IPersistence + ): Promise { + + const command = context.getArguments(); + const sender = context.getSender(); + const room = context.getRoom(); + + if(!Array.isArray(command)){ + return; + } + + switch (command?.length) { + case 0:{ + await helperMessage({room,read, persistence, modify, http}); + break; + } + case 1 : { + const data = { + room: room, + sender: sender, + arguments: command, + }; + await initiatorMessage({ data, read, persistence, modify, http }); + break; + } + case 2 : { + const repository = command[0]; + const query = command[1]; + await basicQueryMessage ({query,repository,room,read,persistence,modify,http}); + break; + } + case 3 :{ + const data = { + repository:command[0], + query:command[1], + number:command[2] + } + const triggerId= context.getTriggerId(); + if(triggerId){ + console.log(triggerId); + const modal = await pullDetailsModal({data,modify,read,persistence,http,slashcommandcontext:context}); + await modify.getUiController().openModalView(modal,{triggerId},context.getSender()); + }else{ + console.log("Inavlid Trigger ID !"); + } + break; + } + default:{ + await helperMessage({room,read, persistence, modify, http}); + break; + } + + } + + } +} \ No newline at end of file diff --git a/github/enum/App.ts b/github/enum/App.ts new file mode 100644 index 0000000..a813e21 --- /dev/null +++ b/github/enum/App.ts @@ -0,0 +1,6 @@ +export enum AppEnum { + DEFAULT_TITLE = 'GitHub', + USERNAME_ALIAS = 'GitHub', + EMOJI_AVATAR = '', + USER_MESSAGED_BOT = 'You have messaged the bot user. This has no effect.', +} \ No newline at end of file diff --git a/github/enum/Modals.ts b/github/enum/Modals.ts new file mode 100644 index 0000000..2ef412d --- /dev/null +++ b/github/enum/Modals.ts @@ -0,0 +1,12 @@ +export enum ModalsEnum { + PULL_VIEW = 'pull-view', + CODE_VIEW = 'code-view', + VIEW_FILE_ACTION = 'view-file-task', + VIEW_FILE_ACTION_LABEL = 'View File', + VIEW_DIFFS_ACTION_LABEL = 'View Changes', + PULL_VIEW_LABEL = 'Pull Request', + MERGE_PULL_REQUEST_ACTION = 'merge-pull-request', + MERGE_PULL_REQUEST_LABEL = 'Merge', + COMMENT_PR_ACTION = 'comment-pull-request', + COMMENT_PR_LABEL = 'Comment', +} \ No newline at end of file diff --git a/github/handlers/ExecuteBlockActionHandler.ts b/github/handlers/ExecuteBlockActionHandler.ts new file mode 100644 index 0000000..261a9e9 --- /dev/null +++ b/github/handlers/ExecuteBlockActionHandler.ts @@ -0,0 +1,97 @@ +import { + IHttp, + ILogger, + IModify, + IPersistence, + IRead, +} from "@rocket.chat/apps-engine/definition/accessors"; +import { IApp } from "@rocket.chat/apps-engine/definition/IApp"; +import { IRoom } from "@rocket.chat/apps-engine/definition/rooms"; +import { basicQueryMessage } from "../helpers/basicQueryMessage"; +import { ModalsEnum } from "../enum/Modals"; +import { fileCodeModal } from "../modals/fileCodeModal"; +import { + IUIKitResponse, + UIKitBlockInteractionContext, +} from "@rocket.chat/apps-engine/definition/uikit"; + +export class ExecuteBlockActionHandler { + constructor( + private readonly app: IApp, + private readonly read: IRead, + private readonly http: IHttp, + private readonly modify: IModify, + private readonly persistence: IPersistence + ) {} + + public async run( + context: UIKitBlockInteractionContext + ): Promise { + const data = context.getInteractionData(); + + const { actionId } = data; + + switch (actionId) { + case "githubDataSelect": { + try { + const param = data.value; + let query: String = ""; + let lengthOfRepoString: number = 0; + if (param && param.length) { + let i = param.length - 1; + for ( + ; + i >= 0 && data.value && data.value[i] != "/"; + i-- + ) { + query = data.value[i] + query; + } + lengthOfRepoString = i; + } + const repository = param?.substring( + 0, + lengthOfRepoString + ) as String; + + const room: IRoom = context.getInteractionData() + .room as IRoom; + + await basicQueryMessage({ + query, + repository, + room, + read: this.read, + persistence: this.persistence, + modify: this.modify, + http: this.http, + }); + + return { + success: true, + }; + } catch (err) { + console.error(err); + return { + success: false, + }; + } + break; + } + case ModalsEnum.VIEW_FILE_ACTION: { + const codeModal = await fileCodeModal({ + data, + modify: this.modify, + read: this.read, + persistence: this.persistence, + http: this.http, + uikitcontext: context, + }); + return context + .getInteractionResponder() + .openModalViewResponse(codeModal); + } + } + + return context.getInteractionResponder().successResponse(); + } +} diff --git a/github/handlers/ExecuteViewClosedHandler.ts b/github/handlers/ExecuteViewClosedHandler.ts new file mode 100644 index 0000000..f299f78 --- /dev/null +++ b/github/handlers/ExecuteViewClosedHandler.ts @@ -0,0 +1,46 @@ +import { + IHttp, + IModify, + IPersistence, + IRead, +} from "@rocket.chat/apps-engine/definition/accessors"; +import { IApp } from "@rocket.chat/apps-engine/definition/IApp"; +import { UIKitViewCloseInteractionContext } from "@rocket.chat/apps-engine/definition/uikit"; +import { ModalsEnum } from "../enum/Modals"; +import { pullDetailsModal } from "../modals/pullDetailsModal"; + +export class ExecuteViewClosedHandler { + constructor( + private readonly app: IApp, + private readonly read: IRead, + private readonly http: IHttp, + private readonly modify: IModify, + private readonly persistence: IPersistence + ) {} + + public async run(context: UIKitViewCloseInteractionContext) { + const { view } = context.getInteractionData(); + switch (view.id) { + case ModalsEnum.PULL_VIEW || ModalsEnum.CODE_VIEW: + const modal = await pullDetailsModal({ + modify: this.modify, + read: this.read, + persistence: this.persistence, + http: this.http, + uikitcontext: context, + }); + await this.modify + .getUiController() + .updateModalView( + modal, + { + triggerId: context.getInteractionData() + .triggerId as string, + }, + context.getInteractionData().user + ); + break; + } + return { success: true } as any; + } +} diff --git a/github/helpers/basicQueryMessage.ts b/github/helpers/basicQueryMessage.ts new file mode 100644 index 0000000..b82fd6d --- /dev/null +++ b/github/helpers/basicQueryMessage.ts @@ -0,0 +1,52 @@ +import { + IHttp, + IModify, + IPersistence, + IRead, +} from "@rocket.chat/apps-engine/definition/accessors"; +import { IRoom } from "@rocket.chat/apps-engine/definition/rooms"; +import { issueListMessage } from "../lib/issuesListMessage"; +import { contributorListMessage } from "../lib/contributorListMessage"; +import { pullRequestListMessage } from "../lib/pullReqeustListMessage"; +import { repoDataMessage } from "../lib/repoDataMessage"; +import { helperMessage } from "../lib/helperMessage"; + +export async function basicQueryMessage({ + query, + repository, + room, + read, + persistence, + modify, + http, +}: { + query: String, + repository:String, + room: IRoom; + read: IRead; + persistence: IPersistence; + modify: IModify; + http: IHttp; +}) { + + switch (query) { + case "issues": { + await issueListMessage({repository,room,read,persistence,modify,http}); + break; + } + case "contributors": { + await contributorListMessage({repository,room,read,persistence,modify,http}); + break; + } + case "pulls": { + await pullRequestListMessage({repository,room,read,persistence,modify,http}); + break; + } + case "repo": { + await repoDataMessage({repository,room,read,persistence,modify,http}) + break; + } + default: + await helperMessage({room,read,persistence,modify,http}); + } +} diff --git a/github/icon.png b/github/icon.png new file mode 100644 index 0000000..081af6c Binary files /dev/null and b/github/icon.png differ diff --git a/github/lib/contributorListMessage.ts b/github/lib/contributorListMessage.ts new file mode 100644 index 0000000..955c439 --- /dev/null +++ b/github/lib/contributorListMessage.ts @@ -0,0 +1,55 @@ +import { + IHttp, + IModify, + IPersistence, + IRead, +} from "@rocket.chat/apps-engine/definition/accessors"; +import { IRoom } from "@rocket.chat/apps-engine/definition/rooms"; + +export async function contributorListMessage({ + repository, + room, + read, + persistence, + modify, + http, +}: { + repository : String, + room: IRoom; + read: IRead; + persistence: IPersistence; + modify: IModify; + http: IHttp; +}) { + const gitResponse = await http.get( + `https://api.github.com/repos/${repository}/contributors` + ); + const resData = gitResponse.data; + const textSender = await modify + .getCreator() + .startMessage() + .setText(`*CONTRIBUTOR LIST*`); + + if (room) { + textSender.setRoom(room); + } + + await modify.getCreator().finish(textSender); + resData.forEach(async (contributor, ind) => { + if (ind < 20) { + const login = contributor.login; + const html_url = contributor.html_url; + + const textSender = await modify + .getCreator() + .startMessage() + .setText(`[ ${login} ](${html_url})`); + + if (room) { + textSender.setRoom(room); + } + + await modify.getCreator().finish(textSender); + } + }); +} diff --git a/github/lib/helperMessage.ts b/github/lib/helperMessage.ts new file mode 100644 index 0000000..f883b7e --- /dev/null +++ b/github/lib/helperMessage.ts @@ -0,0 +1,43 @@ +import { + IHttp, + IModify, + IPersistence, + IRead, +} from "@rocket.chat/apps-engine/definition/accessors"; +import { IRoom } from "@rocket.chat/apps-engine/definition/rooms"; + +export async function helperMessage({ + room, + read, + persistence, + modify, + http, +}: { + room: IRoom; + read: IRead; + persistence: IPersistence; + modify: IModify; + http: IHttp; +}) { + let helperMessageString = ` + Github App + + 1) See Interactive Button interface to fetch repository data -> /github GithubUsername/RepositoryName + 2) Get details of a Repository -> /github GithubUsername/RepositoryName repo + 3) Get Issues of a Repository -> /github GithubUsername/RepositoryName issues + 4) Get Contributors of a Repository -> /github GithubUsername/RepositoryName contributors + 5) Get Recent Pull Request of a Repository -> /github GithubUsername/RepositoryName pulls + 6) Review a Pull Request -> /github GithubUsername/RepositoryName pulls pullNumber + + `; + + const textSender = await modify + .getCreator() + .startMessage() + .setText("```" + helperMessageString + "```"); + + if (room) { + textSender.setRoom(room); + } + await modify.getCreator().finish(textSender); +} diff --git a/github/lib/initiatorMessage.ts b/github/lib/initiatorMessage.ts new file mode 100644 index 0000000..702bb65 --- /dev/null +++ b/github/lib/initiatorMessage.ts @@ -0,0 +1,81 @@ +import { + IHttp, + IMessageBuilder, + IModify, + IModifyCreator, + IPersistence, + IRead, +} from "@rocket.chat/apps-engine/definition/accessors"; +import { ButtonStyle } from "@rocket.chat/apps-engine/definition/uikit"; + +export async function initiatorMessage({ + data, + read, + persistence, + modify, + http, +}: { + data; + read: IRead; + persistence: IPersistence; + modify: IModify; + http: IHttp; +}) { + const greetBuilder = await modify + .getCreator() + .startMessage() + .setRoom(data.room) + .setText(`Hey _${data.sender.username}_ !`); + + if (data.room.type !== "l") { + await modify + .getNotifier() + .notifyUser(data.sender, greetBuilder.getMessage()); + } else { + await modify.getCreator().finish(greetBuilder); + } + + const builder = await modify.getCreator().startMessage().setRoom(data.room); + + const block = modify.getCreator().getBlockBuilder(); + + block.addSectionBlock({ + text: block.newPlainTextObject( + `Choose Action for ${data.arguments[0]} 👇 ?` + ), + }); + + block.addActionsBlock({ + blockId: "githubdata", + elements: [ + block.newButtonElement({ + actionId: "githubDataSelect", + text: block.newPlainTextObject("Overview"), + value: `${data.arguments[0]}/repo`, + style: ButtonStyle.PRIMARY, + }), + block.newButtonElement({ + actionId: "githubDataSelect", + text: block.newPlainTextObject("Issues"), + value: `${data.arguments[0]}/issues`, + style: ButtonStyle.DANGER, + }), + block.newButtonElement({ + actionId: "githubDataSelect", + text: block.newPlainTextObject("Contributors"), + value: `${data.arguments[0]}/contributors`, + style: ButtonStyle.PRIMARY, + }), + block.newButtonElement({ + actionId: "githubDataSelect", + text: block.newPlainTextObject("Pull Requests"), + value: `${data.arguments[0]}/pulls`, + style: ButtonStyle.PRIMARY, + }), + ], + }); + + builder.setBlocks(block); + + await modify.getNotifier().notifyUser(data.sender, builder.getMessage()); +} diff --git a/github/lib/issuesListMessage.ts b/github/lib/issuesListMessage.ts new file mode 100644 index 0000000..43ddf97 --- /dev/null +++ b/github/lib/issuesListMessage.ts @@ -0,0 +1,60 @@ +import { + IHttp, + IMessageBuilder, + IModify, + IModifyCreator, + IPersistence, + IRead, +} from "@rocket.chat/apps-engine/definition/accessors"; +import { IRoom } from "@rocket.chat/apps-engine/definition/rooms"; +import { + ISlashCommand, + SlashCommandContext, +} from "@rocket.chat/apps-engine/definition/slashcommands"; + +export async function issueListMessage({ + repository, + room, + read, + persistence, + modify, + http, +}: { + repository : String, + room: IRoom; + read: IRead; + persistence: IPersistence; + modify: IModify; + http: IHttp; +}) { + + const gitResponse = await http.get( + `https://api.github.com/repos/${repository}/issues` + ); + const resData = gitResponse.data; + const textSender = await modify + .getCreator() + .startMessage() + .setText(`*ISSUES LIST*`); + + if (room) { + textSender.setRoom(room); + } + let ind = 0; + await modify.getCreator().finish(textSender); + resData.forEach(async (issue) => { + if (typeof issue.pull_request === "undefined" && ind < 10) { + const textSender = await modify + .getCreator() + .startMessage() + .setText( + `[ #${issue.number} ](${issue.html_url}) *${issue.title}*` + ); + if (room) { + textSender.setRoom(room); + } + await modify.getCreator().finish(textSender); + ind++; + } + }); +} diff --git a/github/lib/pullReqeustListMessage.ts b/github/lib/pullReqeustListMessage.ts new file mode 100644 index 0000000..1b19bcc --- /dev/null +++ b/github/lib/pullReqeustListMessage.ts @@ -0,0 +1,55 @@ +import { + IHttp, + IMessageBuilder, + IModify, + IModifyCreator, + IPersistence, + IRead, +} from "@rocket.chat/apps-engine/definition/accessors"; +import { IRoom } from "@rocket.chat/apps-engine/definition/rooms"; + +export async function pullRequestListMessage({ + repository, + room, + read, + persistence, + modify, + http, +}: { + repository : String, + room: IRoom; + read: IRead; + persistence: IPersistence; + modify: IModify; + http: IHttp; +}) { + + const gitResponse = await http.get( + `https://api.github.com/repos/${repository}/pulls` + ); + const resData = gitResponse.data; + const textSender = await modify + .getCreator() + .startMessage() + .setText(`*PULL REQUESTS*`); + + if (room) { + textSender.setRoom(room); + } + + await modify.getCreator().finish(textSender); + resData.forEach(async (pull, ind) => { + if (ind < 10) { + const url = pull.html_url; + const textSender = await modify + .getCreator() + .startMessage() + .setText(`[ #${pull.number} ](${url}) *${pull.title}*`); + + if (room) { + textSender.setRoom(room); + } + await modify.getCreator().finish(textSender); + } + }); +} diff --git a/github/lib/repoDataMessage.ts b/github/lib/repoDataMessage.ts new file mode 100644 index 0000000..360b997 --- /dev/null +++ b/github/lib/repoDataMessage.ts @@ -0,0 +1,71 @@ +import { + IHttp, + IModify, + IPersistence, + IRead, +} from "@rocket.chat/apps-engine/definition/accessors"; +import { IRoom } from "@rocket.chat/apps-engine/definition/rooms"; + + +export async function repoDataMessage({ + repository, + room, + read, + persistence, + modify, + http, +}: { + repository : String, + room: IRoom; + read: IRead; + persistence: IPersistence; + modify: IModify; + http: IHttp; +}){ + const gitResponse = await http.get( + `https://api.github.com/repos/${repository}` + ); + const resData = gitResponse.data; + const fullName = + "[" + + resData.full_name + + "](" + + resData.html_url + + ")" + + " ▫️ "; + const stars = + "` ⭐ Stars " + resData.stargazers_count + " ` "; + const issues = "` ❗ Issues " + resData.open_issues + " ` "; + const forks = "` 🍴 Forks " + resData.forks_count + " ` "; + let tags = ""; + if ( + resData && + resData.topics && + Array.isArray(resData.topics) + ) { + resData.topics.forEach((topic: string) => { + let tempTopic = " ` "; + tempTopic += topic; + tempTopic += " ` "; + tags += tempTopic; + }); + } + + const textSender = await modify + .getCreator() + .startMessage() + .setText( + fullName + + stars + + issues + + forks + + "```" + + resData.description + + "```" + + tags + ); + if (room) { + textSender.setRoom(room); + } + await modify.getCreator().finish(textSender); +} \ No newline at end of file diff --git a/github/modals/fileCodeModal.ts b/github/modals/fileCodeModal.ts new file mode 100644 index 0000000..0151548 --- /dev/null +++ b/github/modals/fileCodeModal.ts @@ -0,0 +1,82 @@ + +import { IHttp, IModify, IPersistence, IRead } from '@rocket.chat/apps-engine/definition/accessors'; +import { TextObjectType } from '@rocket.chat/apps-engine/definition/uikit/blocks'; +import { IUIKitModalViewParam } from '@rocket.chat/apps-engine/definition/uikit/UIKitInteractionResponder'; +import { IUser } from '@rocket.chat/apps-engine/definition/users'; +import { ModalsEnum } from '../enum/Modals'; +import { AppEnum } from '../enum/App'; +// import { getRoomTasks, getUIData, persistUIData } from '../lib/persistence'; +import { SlashCommandContext } from '@rocket.chat/apps-engine/definition/slashcommands'; +import { UIKitBlockInteractionContext, UIKitInteractionContext } from '@rocket.chat/apps-engine/definition/uikit'; +import { type } from 'os'; + +export async function fileCodeModal({ data, modify, read, persistence, http, slashcommandcontext, uikitcontext }: { data, modify: IModify, read: IRead, persistence: IPersistence, http: IHttp ,slashcommandcontext?: SlashCommandContext, uikitcontext?: UIKitInteractionContext }): Promise { + const viewId = ModalsEnum.CODE_VIEW; + + const block = modify.getCreator().getBlockBuilder(); + + const room = slashcommandcontext?.getRoom() || uikitcontext?.getInteractionData().room; + const user = slashcommandcontext?.getSender() || uikitcontext?.getInteractionData().user; + + if (user?.id) { + let roomId; + + const pullRawData = await http.get( + data.value + ); + + const pullData = pullRawData.content; + + block.addSectionBlock({ + text: { text: `${pullData}`, type: TextObjectType.MARKDOWN} + + }) + + //shows indentations in input blocks but not inn section block + // block.addInputBlock({ + // blockId: ModalsEnum.TASK_BLOCK, + // label: { text: ModalsEnum.TASK_INPUT_LABEL, type: TextObjectType.PLAINTEXT }, + // element: block.newPlainTextInputElement({ + // initialValue : `${pullData}`, + // multiline:true, + // actionId: ModalsEnum.TASK_INPUT, + // }) + // }); + + block.addDividerBlock(); + + + } + + block.addDividerBlock(); + + block.addActionsBlock({ + elements: [ + block.newButtonElement({ + actionId: ModalsEnum.MERGE_PULL_REQUEST_ACTION, + text: { text: ModalsEnum.MERGE_PULL_REQUEST_LABEL, type: TextObjectType.PLAINTEXT }, + value: room?.id + }), + block.newButtonElement({ + actionId: ModalsEnum.COMMENT_PR_ACTION, + text: { text: ModalsEnum.COMMENT_PR_LABEL, type: TextObjectType.PLAINTEXT }, + value: room?.id + }), + ] + }); + + return { + id: viewId, + title: { + type: TextObjectType.PLAINTEXT, + text: AppEnum.DEFAULT_TITLE, + }, + close: block.newButtonElement({ + text: { + type: TextObjectType.PLAINTEXT, + text: 'Close', + }, + }), + blocks: block.getBlocks() + }; +} \ No newline at end of file diff --git a/github/modals/pullDetailsModal.ts b/github/modals/pullDetailsModal.ts new file mode 100644 index 0000000..37e7f1e --- /dev/null +++ b/github/modals/pullDetailsModal.ts @@ -0,0 +1,107 @@ +import { IHttp, IModify, IPersistence, IRead } from '@rocket.chat/apps-engine/definition/accessors'; +import { TextObjectType } from '@rocket.chat/apps-engine/definition/uikit/blocks'; +import { IUIKitModalViewParam } from '@rocket.chat/apps-engine/definition/uikit/UIKitInteractionResponder'; +import { IUser } from '@rocket.chat/apps-engine/definition/users'; +import { ModalsEnum } from '../enum/Modals'; +import { AppEnum } from '../enum/App'; +// import { getRoomTasks, getUIData, persistUIData } from '../lib/persistence'; +import { SlashCommandContext } from '@rocket.chat/apps-engine/definition/slashcommands'; +import { UIKitBlockInteractionContext, UIKitInteractionContext } from '@rocket.chat/apps-engine/definition/uikit'; + +export async function pullDetailsModal({ data, modify, read, persistence, http, slashcommandcontext, uikitcontext }: { data?, modify: IModify, read: IRead, persistence: IPersistence, http: IHttp ,slashcommandcontext?: SlashCommandContext, uikitcontext?: UIKitInteractionContext }): Promise { + const viewId = ModalsEnum.PULL_VIEW; + + const block = modify.getCreator().getBlockBuilder(); + + const room = slashcommandcontext?.getRoom() || uikitcontext?.getInteractionData().room; + const user = slashcommandcontext?.getSender() || uikitcontext?.getInteractionData().user; + + if (user?.id) { + let roomId; + + const pullRawData = await http.get( + `https://api.github.com/repos/${data?.repository}/pulls/${data?.number}` + ); + const pullData = pullRawData.data; + + const pullRequestFilesRaw = await http.get( + `https://api.github.com/repos/${data?.repository}/pulls/${data?.number}/files` + ); + + const pullRequestFiles= pullRequestFilesRaw.data; + + block.addSectionBlock({ + text: { text: `#${pullData?.title}`, type: TextObjectType.PLAINTEXT }, + accessory: block.newButtonElement({ + actionId: ModalsEnum.VIEW_FILE_ACTION, + text: { + text: ModalsEnum.VIEW_DIFFS_ACTION_LABEL, + type: TextObjectType.PLAINTEXT + }, + value: pullData["diff_url"] + }) + }) + block.addContextBlock({ elements: [ block.newPlainTextObject(`Author: ${pullData?.user?.login} | `),block.newPlainTextObject(`State : ${pullData?.state} | `),block.newPlainTextObject(`Mergeable : ${pullData?.mergeable}`) ]}); + + block.addDividerBlock(); + + let index=1; + + + + for (let file of pullRequestFiles) { + + let fileName = file["filename"]; + let rawUrl = file["raw_url"]; + let status = file["status"]; + let addition = file["additions"]; + let deletions = file["deletions"]; + block.addSectionBlock({ + text: { text: `${index} ${fileName}`, type: TextObjectType.PLAINTEXT }, + accessory: block.newButtonElement({ + actionId: ModalsEnum.VIEW_FILE_ACTION, + text: { + text: ModalsEnum.VIEW_FILE_ACTION_LABEL, + type: TextObjectType.PLAINTEXT + }, + value: rawUrl + }) + }); + block.addContextBlock({ elements: [ block.newPlainTextObject(`Status: ${status} | `),block.newPlainTextObject(`Additions : ${addition} | `),block.newPlainTextObject(`Deletions : ${deletions}`) ]}); + + index++; + } + } + + + + block.addActionsBlock({ + elements: [ + block.newButtonElement({ + actionId: ModalsEnum.MERGE_PULL_REQUEST_ACTION, + text: { text: ModalsEnum.MERGE_PULL_REQUEST_LABEL, type: TextObjectType.PLAINTEXT }, + value: room?.id + }), + block.newButtonElement({ + actionId: ModalsEnum.COMMENT_PR_ACTION, + text: { text: ModalsEnum.COMMENT_PR_LABEL, type: TextObjectType.PLAINTEXT }, + value: room?.id + }), + ] + }); + + return { + id: viewId, + title: { + type: TextObjectType.PLAINTEXT, + text: AppEnum.DEFAULT_TITLE, + }, + close: block.newButtonElement({ + text: { + type: TextObjectType.PLAINTEXT, + text: 'Close', + }, + }), + blocks: block.getBlocks(), + }; +} \ No newline at end of file diff --git a/github/package-lock.json b/github/package-lock.json new file mode 100644 index 0000000..2a28c63 --- /dev/null +++ b/github/package-lock.json @@ -0,0 +1,931 @@ +{ + "name": "github", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "devDependencies": { + "@rocket.chat/apps-engine": "^1.19.0", + "@types/node": "14.14.6", + "tslint": "^5.10.0", + "typescript": "^4.0.5" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.17.12", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.12.tgz", + "integrity": "sha512-7yykMVF3hfZY2jsHZEEgLc+3x4o1O+fYyULu11GynEUQNwB6lua+IIQn1FiJxNucd5UlyJryrwsOh8PL9Sn8Qg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@rocket.chat/apps-engine": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/@rocket.chat/apps-engine/-/apps-engine-1.32.0.tgz", + "integrity": "sha512-K+5NJto1BfO0NFiJX048tAWJqNQjdHGg5YPB24MQ/cDq206hDPnJakihF02LgardAQShIK3TIw2MnKgX1CB2/w==", + "dev": true, + "dependencies": { + "adm-zip": "^0.4.9", + "cryptiles": "^4.1.3", + "lodash.clonedeep": "^4.5.0", + "semver": "^5.5.0", + "stack-trace": "0.0.10", + "uuid": "^3.2.1" + } + }, + "node_modules/@types/node": { + "version": "14.14.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.6.tgz", + "integrity": "sha512-6QlRuqsQ/Ox/aJEQWBEJG7A9+u7oSYl3mem/K8IzxXG/kAGbV1YPD9Bg9Zw3vyxC/YP+zONKwy8hGkSt1jxFMw==", + "dev": true + }, + "node_modules/adm-zip": { + "version": "0.4.16", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz", + "integrity": "sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==", + "dev": true, + "engines": { + "node": ">=0.3.0" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/boom": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-7.3.0.tgz", + "integrity": "sha512-Swpoyi2t5+GhOEGw8rEsKvTxFLIDiiKoUc2gsoV6Lyr43LHBIzch3k2MvYUs8RTROrIkVJ3Al0TkaOGjnb+B6A==", + "deprecated": "This module has moved and is now available at @hapi/boom. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.", + "dev": true, + "dependencies": { + "hoek": "6.x.x" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/cryptiles": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-4.1.3.tgz", + "integrity": "sha512-gT9nyTMSUC1JnziQpPbxKGBbUg8VL7Zn2NB4E1cJYvuXdElHrwxrV9bmltZGDzet45zSDGyYceueke1TjynGzw==", + "deprecated": "This module has moved and is now available at @hapi/cryptiles. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.", + "dev": true, + "dependencies": { + "boom": "7.x.x" + } + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "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/sponsors/isaacs" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/hoek": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.3.tgz", + "integrity": "sha512-YXXAAhmF9zpQbC7LEcREFtXfGq5K1fmd+4PHkBq8NUqmzW3G+Dq10bI/i0KucLRwss3YYFQ0fSfoxBZYiGUqtQ==", + "deprecated": "This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.", + "dev": true + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/is-core-module": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "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/sponsors/ljharb" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", + "dev": true + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "dev": true + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/resolve": { + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.8.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "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/sponsors/ljharb" + } + }, + "node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "node_modules/stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "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/sponsors/ljharb" + } + }, + "node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/tslint": { + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.1.tgz", + "integrity": "sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^4.0.1", + "glob": "^7.1.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.8.0", + "tsutils": "^2.29.0" + }, + "bin": { + "tslint": "bin/tslint" + }, + "engines": { + "node": ">=4.8.0" + }, + "peerDependencies": { + "typescript": ">=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev" + } + }, + "node_modules/tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "peerDependencies": { + "typescript": ">=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev" + } + }, + "node_modules/typescript": { + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.3.tgz", + "integrity": "sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "dev": true, + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + } + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.16.7" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.17.12", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.12.tgz", + "integrity": "sha512-7yykMVF3hfZY2jsHZEEgLc+3x4o1O+fYyULu11GynEUQNwB6lua+IIQn1FiJxNucd5UlyJryrwsOh8PL9Sn8Qg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.16.7", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@rocket.chat/apps-engine": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/@rocket.chat/apps-engine/-/apps-engine-1.32.0.tgz", + "integrity": "sha512-K+5NJto1BfO0NFiJX048tAWJqNQjdHGg5YPB24MQ/cDq206hDPnJakihF02LgardAQShIK3TIw2MnKgX1CB2/w==", + "dev": true, + "requires": { + "adm-zip": "^0.4.9", + "cryptiles": "^4.1.3", + "lodash.clonedeep": "^4.5.0", + "semver": "^5.5.0", + "stack-trace": "0.0.10", + "uuid": "^3.2.1" + } + }, + "@types/node": { + "version": "14.14.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.6.tgz", + "integrity": "sha512-6QlRuqsQ/Ox/aJEQWBEJG7A9+u7oSYl3mem/K8IzxXG/kAGbV1YPD9Bg9Zw3vyxC/YP+zONKwy8hGkSt1jxFMw==", + "dev": true + }, + "adm-zip": { + "version": "0.4.16", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz", + "integrity": "sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "boom": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-7.3.0.tgz", + "integrity": "sha512-Swpoyi2t5+GhOEGw8rEsKvTxFLIDiiKoUc2gsoV6Lyr43LHBIzch3k2MvYUs8RTROrIkVJ3Al0TkaOGjnb+B6A==", + "dev": true, + "requires": { + "hoek": "6.x.x" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ==", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "cryptiles": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-4.1.3.tgz", + "integrity": "sha512-gT9nyTMSUC1JnziQpPbxKGBbUg8VL7Zn2NB4E1cJYvuXdElHrwxrV9bmltZGDzet45zSDGyYceueke1TjynGzw==", + "dev": true, + "requires": { + "boom": "7.x.x" + } + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "hoek": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.3.tgz", + "integrity": "sha512-YXXAAhmF9zpQbC7LEcREFtXfGq5K1fmd+4PHkBq8NUqmzW3G+Dq10bI/i0KucLRwss3YYFQ0fSfoxBZYiGUqtQ==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "is-core-module": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", + "dev": true + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "dev": true + }, + "mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "requires": { + "minimist": "^1.2.6" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "resolve": { + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "dev": true, + "requires": { + "is-core-module": "^2.8.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tslint": { + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.1.tgz", + "integrity": "sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^4.0.1", + "glob": "^7.1.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.8.0", + "tsutils": "^2.29.0" + } + }, + "tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "typescript": { + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.3.tgz", + "integrity": "sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==", + "dev": true + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + } + } +} diff --git a/github/package.json b/github/package.json new file mode 100644 index 0000000..866f402 --- /dev/null +++ b/github/package.json @@ -0,0 +1,8 @@ +{ + "devDependencies": { + "@rocket.chat/apps-engine": "^1.19.0", + "@types/node": "14.14.6", + "tslint": "^5.10.0", + "typescript": "^4.0.5" + } +} \ No newline at end of file diff --git a/github/tsconfig.json b/github/tsconfig.json new file mode 100644 index 0000000..3f5d85a --- /dev/null +++ b/github/tsconfig.json @@ -0,0 +1,17 @@ +{ +"compilerOptions": { + "target": "es2017", + "module": "commonjs", + "moduleResolution": "node", + "declaration": false, + "noImplicitAny": false, + "removeComments": true, + "strictNullChecks": true, + "noImplicitReturns": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + }, +"include": [ + "**/*.ts" + ] +} diff --git a/github/tslint.json b/github/tslint.json new file mode 100644 index 0000000..b01606a --- /dev/null +++ b/github/tslint.json @@ -0,0 +1,15 @@ +{ + "extends": "tslint:recommended", + "rules": { + "array-type": [true, "generic"], + "member-access": true, + "no-console": [false], + "no-duplicate-variable": true, + "object-literal-sort-keys": false, + "quotemark": [true, "single"], + "max-line-length": [true, { + "limit": 160, + "ignore-pattern": "^import | *export .*? {" + }] + } +}