@scopieflows/app-microsoft-teams 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/package.json +31 -0
- package/src/i18n/ca.json +35 -0
- package/src/i18n/de.json +84 -0
- package/src/i18n/es.json +84 -0
- package/src/i18n/fr.json +84 -0
- package/src/i18n/hi.json +35 -0
- package/src/i18n/id.json +35 -0
- package/src/i18n/ja.json +84 -0
- package/src/i18n/nl.json +84 -0
- package/src/i18n/pt.json +84 -0
- package/src/i18n/ru.json +35 -0
- package/src/i18n/translation.json +84 -0
- package/src/i18n/vi.json +35 -0
- package/src/i18n/zh.json +84 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +130 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/create-channel.d.ts +5 -0
- package/src/lib/actions/create-channel.js +41 -0
- package/src/lib/actions/create-channel.js.map +1 -0
- package/src/lib/actions/create-chat-and-send-message.d.ts +6 -0
- package/src/lib/actions/create-chat-and-send-message.js +84 -0
- package/src/lib/actions/create-chat-and-send-message.js.map +1 -0
- package/src/lib/actions/create-private-channel.d.ts +5 -0
- package/src/lib/actions/create-private-channel.js +39 -0
- package/src/lib/actions/create-private-channel.js.map +1 -0
- package/src/lib/actions/delete-chat-message.d.ts +4 -0
- package/src/lib/actions/delete-chat-message.js +36 -0
- package/src/lib/actions/delete-chat-message.js.map +1 -0
- package/src/lib/actions/find-channel.d.ts +4 -0
- package/src/lib/actions/find-channel.js +40 -0
- package/src/lib/actions/find-channel.js.map +1 -0
- package/src/lib/actions/find-team-member.d.ts +5 -0
- package/src/lib/actions/find-team-member.js +54 -0
- package/src/lib/actions/find-team-member.js.map +1 -0
- package/src/lib/actions/get-channel-message.d.ts +6 -0
- package/src/lib/actions/get-channel-message.js +39 -0
- package/src/lib/actions/get-channel-message.js.map +1 -0
- package/src/lib/actions/get-chat-message.d.ts +4 -0
- package/src/lib/actions/get-chat-message.js +31 -0
- package/src/lib/actions/get-chat-message.js.map +1 -0
- package/src/lib/actions/reply-to-channel-message.d.ts +7 -0
- package/src/lib/actions/reply-to-channel-message.js +56 -0
- package/src/lib/actions/reply-to-channel-message.js.map +1 -0
- package/src/lib/actions/request-approval-channel-message.d.ts +5 -0
- package/src/lib/actions/request-approval-channel-message.js +104 -0
- package/src/lib/actions/request-approval-channel-message.js.map +1 -0
- package/src/lib/actions/request-approval-direct-message.d.ts +4 -0
- package/src/lib/actions/request-approval-direct-message.js +102 -0
- package/src/lib/actions/request-approval-direct-message.js.map +1 -0
- package/src/lib/actions/send-channel-message.d.ts +6 -0
- package/src/lib/actions/send-channel-message.js +59 -0
- package/src/lib/actions/send-channel-message.js.map +1 -0
- package/src/lib/actions/send-chat-message.d.ts +5 -0
- package/src/lib/actions/send-chat-message.js +57 -0
- package/src/lib/actions/send-chat-message.js.map +1 -0
- package/src/lib/common/graph.d.ts +10 -0
- package/src/lib/common/graph.js +90 -0
- package/src/lib/common/graph.js.map +1 -0
- package/src/lib/common/index.d.ts +7 -0
- package/src/lib/common/index.js +217 -0
- package/src/lib/common/index.js.map +1 -0
- package/src/lib/triggers/new-channel-message.d.ts +14 -0
- package/src/lib/triggers/new-channel-message.js +137 -0
- package/src/lib/triggers/new-channel-message.js.map +1 -0
- package/src/lib/triggers/new-channel.d.ts +10 -0
- package/src/lib/triggers/new-channel.js +95 -0
- package/src/lib/triggers/new-channel.js.map +1 -0
- package/src/lib/triggers/new-chat-message.d.ts +10 -0
- package/src/lib/triggers/new-chat-message.js +132 -0
- package/src/lib/triggers/new-chat-message.js.map +1 -0
- package/src/lib/triggers/new-chat.d.ts +2 -0
- package/src/lib/triggers/new-chat.js +95 -0
- package/src/lib/triggers/new-chat.js.map +1 -0
package/src/i18n/pt.json
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"\n1. Sign in to [Microsoft Azure Portal](https://portal.azure.com/).\n2. From the left sidebar, go to **Microsoft Enfra ID**.\n3. Under **Manage**, click on **App registrations**.\n4. Click the **New registration** button.\n5. Enter a **Name** for your app.\n6. For **Supported account types**, choose:\n - **Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts**\n - Or select based on your requirement.\n7. In **Redirect URI**, select **Web** and ad": "\n1. Entre no [Microsoft Azure Portal](https://portal.azure.com/).\n. Na barra lateral esquerda, vá até **Microsoft Enfra ID**.\n. Sob **Gerenciar**, clique em **Aplicativos registrados**.\n4. Clique no botão **Novo registro**.\n5. Digite um **nome** para o seu aplicativo.\n6. Para **Tipos de conta suportados**, escolha:\n - **Contas em qualquer diretório organizacional (qualquer inquilino de ID da Microsoft Entra - Multitenant) e contas pessoais da Microsoft**\n - Ou selecione com base nos seus requisitos.\n7. Em **URI de redirecionamento**, selecione **Web** e adicione a URL fornecida.\n8. Clique em **Registrar**.\n9. Após o registro, você será redirecionado para a página de visão geral do aplicativo. Copie o **aplicativo (cliente) ID**.\n10. Do menu à esquerda, vá para **Certificados e segredos**.\n - Em **Segredos do Cliente**, clique em **Novo segredo do Cliente**.\n - Fornece uma descrição, define um vencimento e clique em **Adicionar**.\n - Copiar o **Valor** do segredo do cliente (isso não será exibido novamente).\n11. Vá para **permissões de API** no menu à esquerda.\n - Clique em **Adicionar uma permissão**.\n - Selecione **Microsoft Graph** → **Delegated permissions**.\n - Adicione os seguintes escopos:\n\t - Usuário. ead\n - Canal.Create \n - Channel.ReadBasic. ll\n\t - ChannelMessage.Send\n\t - Team.ReadBasic.All\n\t - Chat.ReadWrite\n\t - ChannelMessage. ead.All\n\t - User.ReadBasic.All\n\t - Presença.Read.All\n\t - Membro. ead.All\n - openid\n - email\n - perfil \n - offline_access\n - Clique em **Adicionar permissões**.\n12. Copie seu **ID do cliente** e **Segredo do cliente**.\n",
|
|
3
|
+
"Create Channel": "Criar Canal",
|
|
4
|
+
"Send Channel Message": "Enviar Mensagem de Canal",
|
|
5
|
+
"Send Chat Message": "Enviar Mensagem de Chat",
|
|
6
|
+
"Reply to Channel Message": "Responder Mensagem de Canal",
|
|
7
|
+
"Create Chat & Send Message": "Criar Chat e Enviar Mensagem",
|
|
8
|
+
"Create Private Channel": "Criar canal privado",
|
|
9
|
+
"Get Chat Message": "Obter mensagem de bate-papo",
|
|
10
|
+
"Delete Chat Message": "Excluir Mensagem de Bate-Papo",
|
|
11
|
+
"Get Channel Message": "Obter mensagem do canal",
|
|
12
|
+
"Find Channel": "Encontrar canal",
|
|
13
|
+
"Find Team Member": "Localizar membro da equipe",
|
|
14
|
+
"Request Approval in Channel": "Solicitação de aprovação no canal",
|
|
15
|
+
"Request Approval from a User": "Solicitar aprovação de um usuário",
|
|
16
|
+
"Custom API Call": "Chamada de API personalizada",
|
|
17
|
+
"Create a new channel in Microsoft Teams.": "Crie um novo canal em Equipes Microsoft.",
|
|
18
|
+
"Sends a message to a teams's channel.": "Envia uma mensagem para o canal de uma equipe.",
|
|
19
|
+
"Sends a message in an existing chat.": "Envia uma mensagem em um chat existente.",
|
|
20
|
+
"Post a reply to an existing channel message.": "Publicar uma resposta a uma mensagem de canal existente.",
|
|
21
|
+
"Start a new chat and send an initial message.": "Inicie um novo bate-papo e envie uma mensagem inicial.",
|
|
22
|
+
"Create a new private channel in a team.": "Crie um novo canal privado na equipe.",
|
|
23
|
+
"Fetch a specific chat message by chat and message ID.": "Obter uma mensagem de bate-papo específica por ID de bate-papo e mensagem.",
|
|
24
|
+
"Soft-Deletes a message in chat.You can only delete messages you sent.": "Exclui uma mensagem no chat.Você só pode excluir mensagens que enviou.",
|
|
25
|
+
"Fetch a specific channel message by team, channel, and message ID (optionally a reply).": "Obter uma mensagem específica do canal por equipe, canal e ID da mensagem (opcionalmente uma resposta).",
|
|
26
|
+
"Finds channels by name.": "Localiza canais por nome.",
|
|
27
|
+
"Finds a team member by email or display name.": "Encontra um membro da equipe por e-mail ou nome de exibição.",
|
|
28
|
+
"Send approval message to a channel and then wait until the message is approved or disapproved": "Enviar mensagem de aprovação para um canal e esperar até que a mensagem seja aprovada ou desaprovada",
|
|
29
|
+
"Send approval message to a user and then wait until the message is approved or disapproved": "Enviar mensagem de aprovação para um usuário e, em seguida, esperar até que a mensagem seja aprovada ou desaprovada",
|
|
30
|
+
"Make a custom API call to a specific endpoint": "Faça uma chamada de API personalizada para um ponto de extremidade específico",
|
|
31
|
+
"Team ID": "ID da Equipe",
|
|
32
|
+
"Channel Name": "Nome do Canal",
|
|
33
|
+
"Channel Description": "Descrição do canal",
|
|
34
|
+
"Channel ID": "ID do canal",
|
|
35
|
+
"Content Type": "Tipo de Conteúdo",
|
|
36
|
+
"Message": "mensagem",
|
|
37
|
+
"Chat ID": "ID do Chat",
|
|
38
|
+
"Message ID": "ID da mensagem",
|
|
39
|
+
"Member": "Membro",
|
|
40
|
+
"Message Content Type": "Tipo de Conteúdo",
|
|
41
|
+
"Initial Message": "Mensagem inicial",
|
|
42
|
+
"Reply ID (optional)": "ID da resposta (opcional)",
|
|
43
|
+
"Search By": "Pesquisar por",
|
|
44
|
+
"searchValue": "pesquisarValor",
|
|
45
|
+
"Method": "Método",
|
|
46
|
+
"Headers": "Cabeçalhos",
|
|
47
|
+
"Query Parameters": "Parâmetros da consulta",
|
|
48
|
+
"Body Type": "Tipo de Corpo",
|
|
49
|
+
"Body": "Conteúdo",
|
|
50
|
+
"Response is Binary ?": "A resposta é binária ?",
|
|
51
|
+
"No Error on Failure": "Nenhum erro no Failure",
|
|
52
|
+
"Timeout (in seconds)": "Tempo limite (em segundos)",
|
|
53
|
+
"Follow redirects": "Seguir redirecionamentos",
|
|
54
|
+
"ID of the parent message to reply to.": "ID da mensagem pai para responder.",
|
|
55
|
+
"The ID of the message to retrieve.": "O ID da mensagem a recuperar.",
|
|
56
|
+
"The ID of the message to delete.": "O ID da mensagem a excluir.",
|
|
57
|
+
"The ID of the channel message to retrieve.": "A ID da mensagem de canal a ser recuperada.",
|
|
58
|
+
"Provide to fetch a specific reply under the message.": "Enviar para busca de uma resposta específica sob a mensagem.",
|
|
59
|
+
"Email address or name to search for.": "Endereço de e-mail ou nome para busca.",
|
|
60
|
+
"Authorization headers are injected automatically from your connection.": "Os cabeçalhos de autorização são inseridos automaticamente a partir da sua conexão.",
|
|
61
|
+
"Enable for files like PDFs, images, etc.": "Habilitar para arquivos como PDFs, imagens, etc.",
|
|
62
|
+
"Text": "texto",
|
|
63
|
+
"HTML": "HTML",
|
|
64
|
+
"Email": "e-mail",
|
|
65
|
+
"Name": "Nome",
|
|
66
|
+
"GET": "OBTER",
|
|
67
|
+
"POST": "POSTAR",
|
|
68
|
+
"PATCH": "COMPRAR",
|
|
69
|
+
"PUT": "COLOCAR",
|
|
70
|
+
"DELETE": "EXCLUIR",
|
|
71
|
+
"HEAD": "CABEÇA",
|
|
72
|
+
"None": "Nenhuma",
|
|
73
|
+
"JSON": "JSON",
|
|
74
|
+
"Form Data": "Dados de Formulário",
|
|
75
|
+
"Raw": "RAW",
|
|
76
|
+
"New Channel Message": "Nova mensagem de canal",
|
|
77
|
+
"New Channel": "Novo Canal",
|
|
78
|
+
"New Chat": "Novo Bate-Papo",
|
|
79
|
+
"New Chat Message": "Nova mensagem de bate-papo",
|
|
80
|
+
"Triggers when a new message is posted in a channel.": "Aciona quando uma nova mensagem é postada em um canal.",
|
|
81
|
+
"Triggers when a new channel is created in a team.": "Dispara quando um novo canal é criado em equipe.",
|
|
82
|
+
"Triggers when a new chat is created.": "Dispara quando um novo chat é criado.",
|
|
83
|
+
"Triggers when a new message is received in a chat.": "Aciona quando uma nova mensagem é recebida em um chat."
|
|
84
|
+
}
|
package/src/i18n/ru.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Microsoft Teams": "Команды Microsoft",
|
|
3
|
+
"Create Channel": "Создать канал",
|
|
4
|
+
"Send Channel Message": "Отправить сообщение канала",
|
|
5
|
+
"Send Chat Message": "Отправить сообщение в чат",
|
|
6
|
+
"Custom API Call": "Пользовательский вызов API",
|
|
7
|
+
"Create a new channel in Microsoft Teams.": "Создайте новый канал в командах Microsoft.",
|
|
8
|
+
"Sends a message to a teams's channel.": "Отправляет сообщение в канал команд.",
|
|
9
|
+
"Sends a message in an existing chat.": "Отправляет сообщение в существующий чат.",
|
|
10
|
+
"Make a custom API call to a specific endpoint": "Сделать пользовательский API вызов к определенной конечной точке",
|
|
11
|
+
"Team ID": "ID команды",
|
|
12
|
+
"Channel Name": "Название канала",
|
|
13
|
+
"Channel Description": "Описание канала",
|
|
14
|
+
"Channel ID": "ID канала",
|
|
15
|
+
"Content Type": "Тип контента",
|
|
16
|
+
"Message": "Сообщение",
|
|
17
|
+
"Chat ID": "Чат ID",
|
|
18
|
+
"Method": "Метод",
|
|
19
|
+
"Headers": "Заголовки",
|
|
20
|
+
"Query Parameters": "Параметры запроса",
|
|
21
|
+
"Body": "Тело",
|
|
22
|
+
"No Error on Failure": "Нет ошибок при ошибке",
|
|
23
|
+
"Timeout (in seconds)": "Таймаут (в секундах)",
|
|
24
|
+
"Authorization headers are injected automatically from your connection.": "Заголовки авторизации включаются автоматически из вашего соединения.",
|
|
25
|
+
"Text": "Текст",
|
|
26
|
+
"HTML": "HTML",
|
|
27
|
+
"GET": "ПОЛУЧИТЬ",
|
|
28
|
+
"POST": "ПОСТ",
|
|
29
|
+
"PATCH": "ПАТЧ",
|
|
30
|
+
"PUT": "ПОКУПИТЬ",
|
|
31
|
+
"DELETE": "УДАЛИТЬ",
|
|
32
|
+
"HEAD": "HEAD",
|
|
33
|
+
"New Channel Message": "Новое сообщение канала",
|
|
34
|
+
"Triggers when a new message is posted in a channel.": "Включает при отправке нового сообщения в канал."
|
|
35
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"\n1. Sign in to [Microsoft Azure Portal](https://portal.azure.com/).\n2. From the left sidebar, go to **Microsoft Enfra ID**.\n3. Under **Manage**, click on **App registrations**.\n4. Click the **New registration** button.\n5. Enter a **Name** for your app.\n6. For **Supported account types**, choose:\n - **Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts**\n - Or select based on your requirement.\n7. In **Redirect URI**, select **Web** and ad": "\n1. Sign in to [Microsoft Azure Portal](https://portal.azure.com/).\n2. From the left sidebar, go to **Microsoft Enfra ID**.\n3. Under **Manage**, click on **App registrations**.\n4. Click the **New registration** button.\n5. Enter a **Name** for your app.\n6. For **Supported account types**, choose:\n - **Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts**\n - Or select based on your requirement.\n7. In **Redirect URI**, select **Web** and add the given URL.\n8. Click **Register**.\n9. After registration, you’ll be redirected to the app’s overview page. Copy the **Application (client) ID**.\n10. From the left menu, go to **Certificates & secrets**.\n - Under **Client secrets**, click **New client secret**.\n - Provide a description, set an expiry, and click **Add**.\n - Copy the **Value** of the client secret (this will not be shown again).\n11. Go to **API permissions** from the left menu.\n - Click **Add a permission**.\n - Select **Microsoft Graph** → **Delegated permissions**.\n - Add the following scopes:\n\t - User.Read\n - Channel.Create\n\t - Channel.ReadBasic.All\n\t - ChannelMessage.Send\n\t - Team.ReadBasic.All\n\t - Chat.ReadWrite\n\t - ChannelMessage.Read.All\n\t - User.ReadBasic.All\n\t - Presence.Read.All\n\t - TeamMember.Read.All\n - openid\n - email\n - profile\n\t - offline_access\n - Click **Add permissions**.\n12. Copy your **Client ID** and **Client Secret**.\n",
|
|
3
|
+
"Create Channel": "Create Channel",
|
|
4
|
+
"Send Channel Message": "Send Channel Message",
|
|
5
|
+
"Send Chat Message": "Send Chat Message",
|
|
6
|
+
"Reply to Channel Message": "Reply to Channel Message",
|
|
7
|
+
"Create Chat & Send Message": "Create Chat & Send Message",
|
|
8
|
+
"Create Private Channel": "Create Private Channel",
|
|
9
|
+
"Get Chat Message": "Get Chat Message",
|
|
10
|
+
"Delete Chat Message": "Delete Chat Message",
|
|
11
|
+
"Get Channel Message": "Get Channel Message",
|
|
12
|
+
"Find Channel": "Find Channel",
|
|
13
|
+
"Find Team Member": "Find Team Member",
|
|
14
|
+
"Request Approval in Channel": "Request Approval in Channel",
|
|
15
|
+
"Request Approval from a User": "Request Approval from a User",
|
|
16
|
+
"Custom API Call": "Custom API Call",
|
|
17
|
+
"Create a new channel in Microsoft Teams.": "Create a new channel in Microsoft Teams.",
|
|
18
|
+
"Sends a message to a teams's channel.": "Sends a message to a teams's channel.",
|
|
19
|
+
"Sends a message in an existing chat.": "Sends a message in an existing chat.",
|
|
20
|
+
"Post a reply to an existing channel message.": "Post a reply to an existing channel message.",
|
|
21
|
+
"Start a new chat and send an initial message.": "Start a new chat and send an initial message.",
|
|
22
|
+
"Create a new private channel in a team.": "Create a new private channel in a team.",
|
|
23
|
+
"Fetch a specific chat message by chat and message ID.": "Fetch a specific chat message by chat and message ID.",
|
|
24
|
+
"Soft-Deletes a message in chat.You can only delete messages you sent.": "Soft-Deletes a message in chat.You can only delete messages you sent.",
|
|
25
|
+
"Fetch a specific channel message by team, channel, and message ID (optionally a reply).": "Fetch a specific channel message by team, channel, and message ID (optionally a reply).",
|
|
26
|
+
"Finds channels by name.": "Finds channels by name.",
|
|
27
|
+
"Finds a team member by email or display name.": "Finds a team member by email or display name.",
|
|
28
|
+
"Send approval message to a channel and then wait until the message is approved or disapproved": "Send approval message to a channel and then wait until the message is approved or disapproved",
|
|
29
|
+
"Send approval message to a user and then wait until the message is approved or disapproved": "Send approval message to a user and then wait until the message is approved or disapproved",
|
|
30
|
+
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
|
|
31
|
+
"Team ID": "Team ID",
|
|
32
|
+
"Channel Name": "Channel Name",
|
|
33
|
+
"Channel Description": "Channel Description",
|
|
34
|
+
"Channel ID": "Channel ID",
|
|
35
|
+
"Content Type": "Content Type",
|
|
36
|
+
"Message": "Message",
|
|
37
|
+
"Chat ID": "Chat ID",
|
|
38
|
+
"Message ID": "Message ID",
|
|
39
|
+
"Member": "Member",
|
|
40
|
+
"Message Content Type": "Message Content Type",
|
|
41
|
+
"Initial Message": "Initial Message",
|
|
42
|
+
"Reply ID (optional)": "Reply ID (optional)",
|
|
43
|
+
"Search By": "Search By",
|
|
44
|
+
"searchValue": "searchValue",
|
|
45
|
+
"Method": "Method",
|
|
46
|
+
"Headers": "Headers",
|
|
47
|
+
"Query Parameters": "Query Parameters",
|
|
48
|
+
"Body Type": "Body Type",
|
|
49
|
+
"Body": "Body",
|
|
50
|
+
"Response is Binary ?": "Response is Binary ?",
|
|
51
|
+
"No Error on Failure": "No Error on Failure",
|
|
52
|
+
"Timeout (in seconds)": "Timeout (in seconds)",
|
|
53
|
+
"Follow redirects": "Follow redirects",
|
|
54
|
+
"ID of the parent message to reply to.": "ID of the parent message to reply to.",
|
|
55
|
+
"The ID of the message to retrieve.": "The ID of the message to retrieve.",
|
|
56
|
+
"The ID of the message to delete.": "The ID of the message to delete.",
|
|
57
|
+
"The ID of the channel message to retrieve.": "The ID of the channel message to retrieve.",
|
|
58
|
+
"Provide to fetch a specific reply under the message.": "Provide to fetch a specific reply under the message.",
|
|
59
|
+
"Email address or name to search for.": "Email address or name to search for.",
|
|
60
|
+
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
|
|
61
|
+
"Enable for files like PDFs, images, etc.": "Enable for files like PDFs, images, etc.",
|
|
62
|
+
"Text": "Text",
|
|
63
|
+
"HTML": "HTML",
|
|
64
|
+
"Email": "Email",
|
|
65
|
+
"Name": "Name",
|
|
66
|
+
"GET": "GET",
|
|
67
|
+
"POST": "POST",
|
|
68
|
+
"PATCH": "PATCH",
|
|
69
|
+
"PUT": "PUT",
|
|
70
|
+
"DELETE": "DELETE",
|
|
71
|
+
"HEAD": "HEAD",
|
|
72
|
+
"None": "None",
|
|
73
|
+
"JSON": "JSON",
|
|
74
|
+
"Form Data": "Form Data",
|
|
75
|
+
"Raw": "Raw",
|
|
76
|
+
"New Channel Message": "New Channel Message",
|
|
77
|
+
"New Channel": "New Channel",
|
|
78
|
+
"New Chat": "New Chat",
|
|
79
|
+
"New Chat Message": "New Chat Message",
|
|
80
|
+
"Triggers when a new message is posted in a channel.": "Triggers when a new message is posted in a channel.",
|
|
81
|
+
"Triggers when a new channel is created in a team.": "Triggers when a new channel is created in a team.",
|
|
82
|
+
"Triggers when a new chat is created.": "Triggers when a new chat is created.",
|
|
83
|
+
"Triggers when a new message is received in a chat.": "Triggers when a new message is received in a chat."
|
|
84
|
+
}
|
package/src/i18n/vi.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Microsoft Teams": "Microsoft Teams",
|
|
3
|
+
"Create Channel": "Create Channel",
|
|
4
|
+
"Send Channel Message": "Send Channel Message",
|
|
5
|
+
"Send Chat Message": "Send Chat Message",
|
|
6
|
+
"Custom API Call": "Custom API Call",
|
|
7
|
+
"Create a new channel in Microsoft Teams.": "Create a new channel in Microsoft Teams.",
|
|
8
|
+
"Sends a message to a teams's channel.": "Sends a message to a teams's channel.",
|
|
9
|
+
"Sends a message in an existing chat.": "Sends a message in an existing chat.",
|
|
10
|
+
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
|
|
11
|
+
"Team ID": "Team ID",
|
|
12
|
+
"Channel Name": "Channel Name",
|
|
13
|
+
"Channel Description": "Channel Description",
|
|
14
|
+
"Channel ID": "Channel ID",
|
|
15
|
+
"Content Type": "Content Type",
|
|
16
|
+
"Message": "Message",
|
|
17
|
+
"Chat ID": "Chat ID",
|
|
18
|
+
"Method": "Method",
|
|
19
|
+
"Headers": "Headers",
|
|
20
|
+
"Query Parameters": "Query Parameters",
|
|
21
|
+
"Body": "Body",
|
|
22
|
+
"No Error on Failure": "No Error on Failure",
|
|
23
|
+
"Timeout (in seconds)": "Timeout (in seconds)",
|
|
24
|
+
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
|
|
25
|
+
"Text": "Text",
|
|
26
|
+
"HTML": "HTML",
|
|
27
|
+
"GET": "GET",
|
|
28
|
+
"POST": "POST",
|
|
29
|
+
"PATCH": "PATCH",
|
|
30
|
+
"PUT": "PUT",
|
|
31
|
+
"DELETE": "DELETE",
|
|
32
|
+
"HEAD": "HEAD",
|
|
33
|
+
"New Channel Message": "New Channel Message",
|
|
34
|
+
"Triggers when a new message is posted in a channel.": "Triggers when a new message is posted in a channel."
|
|
35
|
+
}
|
package/src/i18n/zh.json
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"\n1. Sign in to [Microsoft Azure Portal](https://portal.azure.com/).\n2. From the left sidebar, go to **Microsoft Enfra ID**.\n3. Under **Manage**, click on **App registrations**.\n4. Click the **New registration** button.\n5. Enter a **Name** for your app.\n6. For **Supported account types**, choose:\n - **Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts**\n - Or select based on your requirement.\n7. In **Redirect URI**, select **Web** and ad": "\n1. Sign in to [Microsoft Azure Portal](https://portal.azure.com/).\n2. From the left sidebar, go to **Microsoft Enfra ID**.\n3. Under **Manage**, click on **App registrations**.\n4. Click the **New registration** button.\n5. Enter a **Name** for your app.\n6. For **Supported account types**, choose:\n - **Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts**\n - Or select based on your requirement.\n7. In **Redirect URI**, select **Web** and add the given URL.\n8. Click **Register**.\n9. After registration, you’ll be redirected to the app’s overview page. Copy the **Application (client) ID**.\n10. From the left menu, go to **Certificates & secrets**.\n - Under **Client secrets**, click **New client secret**.\n - Provide a description, set an expiry, and click **Add**.\n - Copy the **Value** of the client secret (this will not be shown again).\n11. Go to **API permissions** from the left menu.\n - Click **Add a permission**.\n - Select **Microsoft Graph** → **Delegated permissions**.\n - Add the following scopes:\n\t - User.Read\n - Channel.Create\n\t - Channel.ReadBasic.All\n\t - ChannelMessage.Send\n\t - Team.ReadBasic.All\n\t - Chat.ReadWrite\n\t - ChannelMessage.Read.All\n\t - User.ReadBasic.All\n\t - Presence.Read.All\n\t - TeamMember.Read.All\n - openid\n - email\n - profile\n\t - offline_access\n - Click **Add permissions**.\n12. Copy your **Client ID** and **Client Secret**.\n",
|
|
3
|
+
"Create Channel": "Create Channel",
|
|
4
|
+
"Send Channel Message": "Send Channel Message",
|
|
5
|
+
"Send Chat Message": "Send Chat Message",
|
|
6
|
+
"Reply to Channel Message": "Reply to Channel Message",
|
|
7
|
+
"Create Chat & Send Message": "Create Chat & Send Message",
|
|
8
|
+
"Create Private Channel": "Create Private Channel",
|
|
9
|
+
"Get Chat Message": "Get Chat Message",
|
|
10
|
+
"Delete Chat Message": "Delete Chat Message",
|
|
11
|
+
"Get Channel Message": "Get Channel Message",
|
|
12
|
+
"Find Channel": "Find Channel",
|
|
13
|
+
"Find Team Member": "Find Team Member",
|
|
14
|
+
"Request Approval in Channel": "Request Approval in Channel",
|
|
15
|
+
"Request Approval from a User": "Request Approval from a User",
|
|
16
|
+
"Custom API Call": "自定义 API 呼叫",
|
|
17
|
+
"Create a new channel in Microsoft Teams.": "Create a new channel in Microsoft Teams.",
|
|
18
|
+
"Sends a message to a teams's channel.": "Sends a message to a teams's channel.",
|
|
19
|
+
"Sends a message in an existing chat.": "Sends a message in an existing chat.",
|
|
20
|
+
"Post a reply to an existing channel message.": "Post a reply to an existing channel message.",
|
|
21
|
+
"Start a new chat and send an initial message.": "Start a new chat and send an initial message.",
|
|
22
|
+
"Create a new private channel in a team.": "Create a new private channel in a team.",
|
|
23
|
+
"Fetch a specific chat message by chat and message ID.": "Fetch a specific chat message by chat and message ID.",
|
|
24
|
+
"Soft-Deletes a message in chat.You can only delete messages you sent.": "Soft-Deletes a message in chat.You can only delete messages you sent.",
|
|
25
|
+
"Fetch a specific channel message by team, channel, and message ID (optionally a reply).": "Fetch a specific channel message by team, channel, and message ID (optionally a reply).",
|
|
26
|
+
"Finds channels by name.": "Finds channels by name.",
|
|
27
|
+
"Finds a team member by email or display name.": "Finds a team member by email or display name.",
|
|
28
|
+
"Send approval message to a channel and then wait until the message is approved or disapproved": "Send approval message to a channel and then wait until the message is approved or disapproved",
|
|
29
|
+
"Send approval message to a user and then wait until the message is approved or disapproved": "Send approval message to a user and then wait until the message is approved or disapproved",
|
|
30
|
+
"Make a custom API call to a specific endpoint": "将一个自定义 API 调用到一个特定的终点",
|
|
31
|
+
"Team ID": "Team ID",
|
|
32
|
+
"Channel Name": "Channel Name",
|
|
33
|
+
"Channel Description": "Channel Description",
|
|
34
|
+
"Channel ID": "Channel ID",
|
|
35
|
+
"Content Type": "Content Type",
|
|
36
|
+
"Message": "Message",
|
|
37
|
+
"Chat ID": "Chat ID",
|
|
38
|
+
"Message ID": "Message ID",
|
|
39
|
+
"Member": "成员",
|
|
40
|
+
"Message Content Type": "Message Content Type",
|
|
41
|
+
"Initial Message": "Initial Message",
|
|
42
|
+
"Reply ID (optional)": "Reply ID (optional)",
|
|
43
|
+
"Search By": "Search By",
|
|
44
|
+
"searchValue": "searchValue",
|
|
45
|
+
"Method": "方法",
|
|
46
|
+
"Headers": "信头",
|
|
47
|
+
"Query Parameters": "查询参数",
|
|
48
|
+
"Body Type": "Body Type",
|
|
49
|
+
"Body": "正文内容",
|
|
50
|
+
"Response is Binary ?": "Response is Binary ?",
|
|
51
|
+
"No Error on Failure": "失败时没有错误",
|
|
52
|
+
"Timeout (in seconds)": "超时(秒)",
|
|
53
|
+
"Follow redirects": "Follow redirects",
|
|
54
|
+
"ID of the parent message to reply to.": "ID of the parent message to reply to.",
|
|
55
|
+
"The ID of the message to retrieve.": "The ID of the message to retrieve.",
|
|
56
|
+
"The ID of the message to delete.": "The ID of the message to delete.",
|
|
57
|
+
"The ID of the channel message to retrieve.": "The ID of the channel message to retrieve.",
|
|
58
|
+
"Provide to fetch a specific reply under the message.": "Provide to fetch a specific reply under the message.",
|
|
59
|
+
"Email address or name to search for.": "Email address or name to search for.",
|
|
60
|
+
"Authorization headers are injected automatically from your connection.": "授权头自动从您的连接中注入。",
|
|
61
|
+
"Enable for files like PDFs, images, etc.": "Enable for files like PDFs, images, etc.",
|
|
62
|
+
"Text": "文本",
|
|
63
|
+
"HTML": "HTML",
|
|
64
|
+
"Email": "电子邮件地址",
|
|
65
|
+
"Name": "名称",
|
|
66
|
+
"GET": "获取",
|
|
67
|
+
"POST": "帖子",
|
|
68
|
+
"PATCH": "PATCH",
|
|
69
|
+
"PUT": "弹出",
|
|
70
|
+
"DELETE": "删除",
|
|
71
|
+
"HEAD": "黑色",
|
|
72
|
+
"None": "无",
|
|
73
|
+
"JSON": "JSON",
|
|
74
|
+
"Form Data": "表单数据",
|
|
75
|
+
"Raw": "原始文件",
|
|
76
|
+
"New Channel Message": "New Channel Message",
|
|
77
|
+
"New Channel": "New Channel",
|
|
78
|
+
"New Chat": "New Chat",
|
|
79
|
+
"New Chat Message": "New Chat Message",
|
|
80
|
+
"Triggers when a new message is posted in a channel.": "Triggers when a new message is posted in a channel.",
|
|
81
|
+
"Triggers when a new channel is created in a team.": "Triggers when a new channel is created in a team.",
|
|
82
|
+
"Triggers when a new chat is created.": "Triggers when a new chat is created.",
|
|
83
|
+
"Triggers when a new message is received in a chat.": "Triggers when a new message is received in a chat."
|
|
84
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const microsoftTeamsAuth: import("@scopieflows/pieces-framework").OAuth2Property<import("@scopieflows/pieces-framework").OAuth2Props>;
|
|
2
|
+
export declare const microsoftTeams: import("@scopieflows/pieces-framework").Piece<import("@scopieflows/pieces-framework").OAuth2Property<import("@scopieflows/pieces-framework").OAuth2Props>>;
|
package/src/index.js
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.microsoftTeams = exports.microsoftTeamsAuth = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@scopieflows/pieces-framework");
|
|
6
|
+
const shared_1 = require("@scopieflows/shared");
|
|
7
|
+
const create_channel_1 = require("./lib/actions/create-channel");
|
|
8
|
+
const send_channel_message_1 = require("./lib/actions/send-channel-message");
|
|
9
|
+
const send_chat_message_1 = require("./lib/actions/send-chat-message");
|
|
10
|
+
const reply_to_channel_message_1 = require("./lib/actions/reply-to-channel-message");
|
|
11
|
+
const pieces_common_1 = require("@scopieflows/pieces-common");
|
|
12
|
+
const new_channel_message_1 = require("./lib/triggers/new-channel-message");
|
|
13
|
+
const new_channel_1 = require("./lib/triggers/new-channel");
|
|
14
|
+
const new_chat_1 = require("./lib/triggers/new-chat");
|
|
15
|
+
const new_chat_message_1 = require("./lib/triggers/new-chat-message");
|
|
16
|
+
const create_chat_and_send_message_1 = require("./lib/actions/create-chat-and-send-message");
|
|
17
|
+
const create_private_channel_1 = require("./lib/actions/create-private-channel");
|
|
18
|
+
const get_chat_message_1 = require("./lib/actions/get-chat-message");
|
|
19
|
+
const get_channel_message_1 = require("./lib/actions/get-channel-message");
|
|
20
|
+
const find_channel_1 = require("./lib/actions/find-channel");
|
|
21
|
+
const find_team_member_1 = require("./lib/actions/find-team-member");
|
|
22
|
+
const graph_1 = require("./lib/common/graph");
|
|
23
|
+
const delete_chat_message_1 = require("./lib/actions/delete-chat-message");
|
|
24
|
+
const request_approval_direct_message_1 = require("./lib/actions/request-approval-direct-message");
|
|
25
|
+
const request_approval_channel_message_1 = require("./lib/actions/request-approval-channel-message");
|
|
26
|
+
const authDesc = `
|
|
27
|
+
1. Sign in to [Microsoft Azure Portal](https://portal.azure.com/).
|
|
28
|
+
2. From the left sidebar, go to **Microsoft Enfra ID**.
|
|
29
|
+
3. Under **Manage**, click on **App registrations**.
|
|
30
|
+
4. Click the **New registration** button.
|
|
31
|
+
5. Enter a **Name** for your app.
|
|
32
|
+
6. For **Supported account types**, choose:
|
|
33
|
+
- **Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts**
|
|
34
|
+
- Or select based on your requirement.
|
|
35
|
+
7. In **Redirect URI**, select **Web** and add the given URL.
|
|
36
|
+
8. Click **Register**.
|
|
37
|
+
9. After registration, you’ll be redirected to the app’s overview page. Copy the **Application (client) ID**.
|
|
38
|
+
10. From the left menu, go to **Certificates & secrets**.
|
|
39
|
+
- Under **Client secrets**, click **New client secret**.
|
|
40
|
+
- Provide a description, set an expiry, and click **Add**.
|
|
41
|
+
- Copy the **Value** of the client secret (this will not be shown again).
|
|
42
|
+
11. Go to **API permissions** from the left menu.
|
|
43
|
+
- Click **Add a permission**.
|
|
44
|
+
- Select **Microsoft Graph** → **Delegated permissions**.
|
|
45
|
+
- Add the following scopes:
|
|
46
|
+
- User.Read
|
|
47
|
+
- Channel.Create
|
|
48
|
+
- Channel.ReadBasic.All
|
|
49
|
+
- ChannelMessage.Send
|
|
50
|
+
- Team.ReadBasic.All
|
|
51
|
+
- Chat.ReadWrite
|
|
52
|
+
- ChannelMessage.Read.All
|
|
53
|
+
- User.ReadBasic.All
|
|
54
|
+
- Presence.Read.All
|
|
55
|
+
- TeamMember.Read.All
|
|
56
|
+
- openid
|
|
57
|
+
- email
|
|
58
|
+
- profile
|
|
59
|
+
- offline_access
|
|
60
|
+
- Click **Add permissions**.
|
|
61
|
+
12. Copy your **Client ID** and **Client Secret**.
|
|
62
|
+
`;
|
|
63
|
+
exports.microsoftTeamsAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
64
|
+
description: authDesc,
|
|
65
|
+
required: true,
|
|
66
|
+
scope: [
|
|
67
|
+
'openid',
|
|
68
|
+
'email',
|
|
69
|
+
'profile',
|
|
70
|
+
'offline_access',
|
|
71
|
+
'User.Read',
|
|
72
|
+
'Channel.Create',
|
|
73
|
+
'Channel.ReadBasic.All',
|
|
74
|
+
'ChannelMessage.Send',
|
|
75
|
+
'Team.ReadBasic.All',
|
|
76
|
+
'Chat.ReadWrite',
|
|
77
|
+
'ChannelMessage.Read.All',
|
|
78
|
+
'TeamMember.Read.All',
|
|
79
|
+
'User.ReadBasic.All',
|
|
80
|
+
'Presence.Read.All',
|
|
81
|
+
],
|
|
82
|
+
prompt: 'omit',
|
|
83
|
+
authUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize',
|
|
84
|
+
tokenUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/token',
|
|
85
|
+
validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
86
|
+
try {
|
|
87
|
+
const authValue = auth;
|
|
88
|
+
const client = (0, graph_1.createGraphClient)(authValue.access_token);
|
|
89
|
+
yield (0, graph_1.withGraphRetry)(() => client.api('/me').get());
|
|
90
|
+
return { valid: true };
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
return { valid: false, error: 'Invalid Credentials.' };
|
|
94
|
+
}
|
|
95
|
+
}),
|
|
96
|
+
});
|
|
97
|
+
exports.microsoftTeams = (0, pieces_framework_1.createPiece)({
|
|
98
|
+
displayName: 'Microsoft Teams',
|
|
99
|
+
auth: exports.microsoftTeamsAuth,
|
|
100
|
+
minimumSupportedRelease: '0.30.0',
|
|
101
|
+
logoUrl: '/pieces/microsoft-teams.png',
|
|
102
|
+
categories: [shared_1.PieceCategory.BUSINESS_INTELLIGENCE, shared_1.PieceCategory.COMMUNICATION],
|
|
103
|
+
authors: ['kishanprmr'],
|
|
104
|
+
actions: [
|
|
105
|
+
create_channel_1.createChannelAction,
|
|
106
|
+
send_channel_message_1.sendChannelMessageAction,
|
|
107
|
+
send_chat_message_1.sendChatMessageAction,
|
|
108
|
+
reply_to_channel_message_1.replyToChannelMessageAction,
|
|
109
|
+
create_chat_and_send_message_1.createChatAndSendMessageAction,
|
|
110
|
+
create_private_channel_1.createPrivateChannelAction,
|
|
111
|
+
get_chat_message_1.getChatMessageAction,
|
|
112
|
+
delete_chat_message_1.deleteChatMessageAction,
|
|
113
|
+
get_channel_message_1.getChannelMessageAction,
|
|
114
|
+
find_channel_1.findChannelAction,
|
|
115
|
+
find_team_member_1.findTeamMemberAction,
|
|
116
|
+
request_approval_channel_message_1.requestApprovalInChannel,
|
|
117
|
+
request_approval_direct_message_1.requestApprovalDirectMessage,
|
|
118
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
119
|
+
auth: exports.microsoftTeamsAuth,
|
|
120
|
+
baseUrl: () => 'https://graph.microsoft.com/v1.0/teams',
|
|
121
|
+
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
122
|
+
return ({
|
|
123
|
+
Authorization: `Bearer ${auth.access_token}`,
|
|
124
|
+
});
|
|
125
|
+
}),
|
|
126
|
+
}),
|
|
127
|
+
],
|
|
128
|
+
triggers: [new_channel_message_1.newChannelMessageTrigger, new_channel_1.newChannelTrigger, new_chat_1.newChatTrigger, new_chat_message_1.newChatMessageTrigger],
|
|
129
|
+
});
|
|
130
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/microsoft-teams/src/index.ts"],"names":[],"mappings":";;;;AAAA,oEAKuC;AACvC,gDAAoD;AACpD,iEAAmE;AACnE,6EAA8E;AAC9E,uEAAwE;AACxE,qFAAqF;AACrF,8DAAuE;AACvE,4EAA8E;AAC9E,4DAA+D;AAC/D,sDAAyD;AACzD,sEAAwE;AACxE,6FAA4F;AAC5F,iFAAkF;AAClF,qEAAsE;AACtE,2EAA4E;AAC5E,6DAA+D;AAC/D,qEAAsE;AACtE,8CAAuE;AACvE,2EAA4E;AAC5E,mGAA6F;AAC7F,qGAA0F;AAE1F,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoChB,CAAA;AAEY,QAAA,kBAAkB,GAAG,4BAAS,CAAC,MAAM,CAAC;IAClD,WAAW,EAAC,QAAQ;IACpB,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACN,QAAQ;QACR,OAAO;QACP,SAAS;QACT,gBAAgB;QAChB,WAAW;QACX,gBAAgB;QAChB,uBAAuB;QACvB,qBAAqB;QACrB,oBAAoB;QACpB,gBAA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YACvD,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC7B,aAAa,EAAE,UAAW,IAA4B,CAAC,YAAY,EAAE;iBACrE,CAAC,CAAA;cAAA;SACF,CAAC;KACF;IACD,QAAQ,EAAE,CAAC,8CAAwB,EAAE,+BAAiB,EAAE,yBAAc,EAAE,wCAAqB,CAAC;CAC9F,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const createChannelAction: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").OAuth2Property<import("@scopieflows/pieces-framework").OAuth2Props>, {
|
|
2
|
+
teamId: import("@scopieflows/pieces-framework").DropdownProperty<string, true, import("@scopieflows/pieces-framework").OAuth2Property<import("@scopieflows/pieces-framework").OAuth2Props>>;
|
|
3
|
+
channelDisplayName: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
channelDescription: import("@scopieflows/pieces-framework").LongTextProperty<false>;
|
|
5
|
+
}>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createChannelAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const __1 = require("../../");
|
|
6
|
+
const pieces_framework_1 = require("@scopieflows/pieces-framework");
|
|
7
|
+
const microsoft_graph_client_1 = require("@microsoft/microsoft-graph-client");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.createChannelAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: __1.microsoftTeamsAuth,
|
|
11
|
+
name: 'microsoft_teams_create_channel',
|
|
12
|
+
displayName: 'Create Channel',
|
|
13
|
+
description: 'Create a new channel in Microsoft Teams.',
|
|
14
|
+
props: {
|
|
15
|
+
teamId: common_1.microsoftTeamsCommon.teamId,
|
|
16
|
+
channelDisplayName: pieces_framework_1.Property.ShortText({
|
|
17
|
+
displayName: 'Channel Name',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
channelDescription: pieces_framework_1.Property.LongText({
|
|
21
|
+
displayName: 'Channel Description',
|
|
22
|
+
required: false,
|
|
23
|
+
}),
|
|
24
|
+
},
|
|
25
|
+
run(context) {
|
|
26
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const { teamId, channelDescription, channelDisplayName } = context.propsValue;
|
|
28
|
+
const client = microsoft_graph_client_1.Client.initWithMiddleware({
|
|
29
|
+
authProvider: {
|
|
30
|
+
getAccessToken: () => Promise.resolve(context.auth.access_token),
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
const channel = {
|
|
34
|
+
displayName: channelDisplayName,
|
|
35
|
+
description: channelDescription,
|
|
36
|
+
};
|
|
37
|
+
return yield client.api(`/teams/${teamId}/channels`).post(channel);
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=create-channel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-channel.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/microsoft-teams/src/lib/actions/create-channel.ts"],"names":[],"mappings":";;;;AAAA,8BAA4C;AAC5C,oEAAuE;AACvE,8EAA2D;AAC3D,sCAAiD;AAEpC,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,sBAAkB;IACxB,IAAI,EAAE,gCAAgC;IACtC,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,0CAA0C;IACvD,KAAK,EAAE;QACN,MAAM,EAAE,6BAAoB,CAAC,MAAM;QACnC,kBAAkB,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtC,WAAW,EAAE,cAAc;YAC3B,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,kBAAkB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACrC,WAAW,EAAE,qBAAqB;YAClC,QAAQ,EAAE,KAAK;SACf,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAE9E,MAAM,MAAM,GAAG,+BAAM,CAAC,kBAAkB,CAAC;gBACxC,YAAY,EAAE;oBACb,cAAc,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC;iBAChE;aACD,CAAC,CAAC;YAEH,MAAM,OAAO,GAAG;gBACf,WAAW,EAAE,kBAAkB;gBAC/B,WAAW,EAAE,kBAAkB;aAC/B,CAAC;YAEF,OAAO,MAAM,MAAM,CAAC,GAAG,CAAC,UAAU,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpE,CAAC;KAAA;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const createChatAndSendMessageAction: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").OAuth2Property<import("@scopieflows/pieces-framework").OAuth2Props>, {
|
|
2
|
+
teamId: import("@scopieflows/pieces-framework").DropdownProperty<string, true, import("@scopieflows/pieces-framework").OAuth2Property<import("@scopieflows/pieces-framework").OAuth2Props>>;
|
|
3
|
+
members: import("@scopieflows/pieces-framework").MultiSelectDropdownProperty<string, false, import("@scopieflows/pieces-framework").OAuth2Property<import("@scopieflows/pieces-framework").OAuth2Props>> | import("@scopieflows/pieces-framework").MultiSelectDropdownProperty<string, true, import("@scopieflows/pieces-framework").OAuth2Property<import("@scopieflows/pieces-framework").OAuth2Props>>;
|
|
4
|
+
contentType: import("@scopieflows/pieces-framework").StaticDropdownProperty<string, true>;
|
|
5
|
+
content: import("@scopieflows/pieces-framework").LongTextProperty<true>;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createChatAndSendMessageAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const __1 = require("../../");
|
|
6
|
+
const pieces_framework_1 = require("@scopieflows/pieces-framework");
|
|
7
|
+
const microsoft_graph_client_1 = require("@microsoft/microsoft-graph-client");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
const shared_1 = require("@scopieflows/shared");
|
|
10
|
+
exports.createChatAndSendMessageAction = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: __1.microsoftTeamsAuth,
|
|
12
|
+
name: 'microsoft_teams_create_chat_and_send_message',
|
|
13
|
+
displayName: 'Create Chat & Send Message',
|
|
14
|
+
description: 'Start a new chat and send an initial message.',
|
|
15
|
+
props: {
|
|
16
|
+
teamId: common_1.microsoftTeamsCommon.teamId,
|
|
17
|
+
members: common_1.microsoftTeamsCommon.memberIds(true),
|
|
18
|
+
contentType: pieces_framework_1.Property.StaticDropdown({
|
|
19
|
+
displayName: 'Message Content Type',
|
|
20
|
+
required: true,
|
|
21
|
+
defaultValue: 'text',
|
|
22
|
+
options: {
|
|
23
|
+
disabled: false,
|
|
24
|
+
options: [
|
|
25
|
+
{ label: 'Text', value: 'text' },
|
|
26
|
+
{ label: 'HTML', value: 'html' },
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
}),
|
|
30
|
+
content: pieces_framework_1.Property.LongText({
|
|
31
|
+
displayName: 'Initial Message',
|
|
32
|
+
required: true,
|
|
33
|
+
}),
|
|
34
|
+
},
|
|
35
|
+
run(context) {
|
|
36
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const { members, contentType, content } = context.propsValue;
|
|
38
|
+
if ((0, shared_1.isNil)(members)) {
|
|
39
|
+
throw new Error('For one-on-one chats, provide exactly one other member.');
|
|
40
|
+
}
|
|
41
|
+
const client = microsoft_graph_client_1.Client.initWithMiddleware({
|
|
42
|
+
authProvider: {
|
|
43
|
+
getAccessToken: () => Promise.resolve(context.auth.access_token),
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
// Resolve current user to include as a member
|
|
47
|
+
const me = yield client.api('/me').select('id,userPrincipalName').get();
|
|
48
|
+
const currentUserBind = `https://graph.microsoft.com/v1.0/users('${me.id}')`;
|
|
49
|
+
// Parse provided members
|
|
50
|
+
const otherMembersRaw = members.map((member) => `https://graph.microsoft.com/v1.0/users('${member}')`);
|
|
51
|
+
const membersPayload = [
|
|
52
|
+
{
|
|
53
|
+
'@odata.type': '#microsoft.graph.aadUserConversationMember',
|
|
54
|
+
roles: ['owner'],
|
|
55
|
+
'user@odata.bind': currentUserBind,
|
|
56
|
+
},
|
|
57
|
+
...otherMembersRaw.map((m) => ({
|
|
58
|
+
'@odata.type': '#microsoft.graph.aadUserConversationMember',
|
|
59
|
+
roles: ['owner'],
|
|
60
|
+
'user@odata.bind': m,
|
|
61
|
+
})),
|
|
62
|
+
];
|
|
63
|
+
const chatBody = {
|
|
64
|
+
chatType: otherMembersRaw.length === 1 ? 'oneOnOne' : 'group',
|
|
65
|
+
members: membersPayload,
|
|
66
|
+
};
|
|
67
|
+
// Create or get existing chat
|
|
68
|
+
const chat = yield client.api('/chats').post(chatBody);
|
|
69
|
+
// Send initial message
|
|
70
|
+
const chatMessage = {
|
|
71
|
+
body: {
|
|
72
|
+
content: content,
|
|
73
|
+
contentType: contentType,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
const messageResponse = yield client.api(`/chats/${chat.id}/messages`).post(chatMessage);
|
|
77
|
+
return {
|
|
78
|
+
chat,
|
|
79
|
+
message: messageResponse,
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
//# sourceMappingURL=create-chat-and-send-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-chat-and-send-message.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/microsoft-teams/src/lib/actions/create-chat-and-send-message.ts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