@grvpandey11/backstage-plugin-scaffolder-backend-module-ms-teams 1.0.1 → 2.0.0
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/LICENSE +21 -0
- package/README.md +2 -29
- package/dist/actions/ms-teams/send-ms-teams-message.cjs.js +63 -0
- package/dist/actions/ms-teams/send-ms-teams-message.cjs.js.map +1 -0
- package/dist/actions/ms-teams/send-ms-teams-message.examples.cjs.js +44 -0
- package/dist/actions/ms-teams/send-ms-teams-message.examples.cjs.js.map +1 -0
- package/dist/index.cjs.js +4 -56
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +10 -4
- package/dist/module.cjs.js +24 -0
- package/dist/module.cjs.js.map +1 -0
- package/package.json +26 -11
- package/src/index.ts +2 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Gaurav Pandey
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -21,38 +21,11 @@ yarn add --cwd packages/backend @grvpandey11/backstage-plugin-scaffolder-backend
|
|
|
21
21
|
Add the actions you'd like to the scaffolder:
|
|
22
22
|
|
|
23
23
|
```typescript
|
|
24
|
-
// packages/backend/src/
|
|
25
|
-
|
|
26
|
-
import {
|
|
27
|
-
createSendTeamsMessageViaWebhookAction
|
|
28
|
-
} from '@grvpandey11/backstage-plugin-scaffolder-backend-module-ms-teams'
|
|
29
|
-
|
|
30
|
-
import { ScmIntegrations } from '@backstage/integration';
|
|
31
|
-
import { createBuiltinActions, createRouter } from '@backstage/plugin-scaffolder-backend';
|
|
24
|
+
// packages/backend/src/index.ts
|
|
32
25
|
|
|
33
26
|
...
|
|
34
27
|
|
|
35
|
-
|
|
36
|
-
const builtInActions = createBuiltinActions({
|
|
37
|
-
catalogClient,
|
|
38
|
-
integrations,
|
|
39
|
-
config: env.config,
|
|
40
|
-
reader: env.reader
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
const actions = [
|
|
44
|
-
createSendTeamsMessageViaWebhookAction({config: env.config}),
|
|
45
|
-
...builtInActions
|
|
46
|
-
];
|
|
47
|
-
|
|
48
|
-
return await createRouter({
|
|
49
|
-
logger: env.logger,
|
|
50
|
-
config: env.config,
|
|
51
|
-
database: env.database,
|
|
52
|
-
reader: env.reader,
|
|
53
|
-
catalogClient,
|
|
54
|
-
actions
|
|
55
|
-
});
|
|
28
|
+
backend.add(import('@grvpandey11/backstage-plugin-scaffolder-backend-module-ms-teams'));
|
|
56
29
|
```
|
|
57
30
|
|
|
58
31
|
Add a ms-teams configuration section to your app-config.yaml.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var pluginScaffolderNode = require('@backstage/plugin-scaffolder-node');
|
|
4
|
+
var axios = require('axios');
|
|
5
|
+
var errors = require('@backstage/errors');
|
|
6
|
+
var sendMsTeamsMessage_examples = require('./send-ms-teams-message.examples.cjs.js');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
9
|
+
|
|
10
|
+
var axios__default = /*#__PURE__*/_interopDefaultCompat(axios);
|
|
11
|
+
|
|
12
|
+
function createSendTeamsMessageViaWebhookAction(options) {
|
|
13
|
+
const { config } = options;
|
|
14
|
+
return pluginScaffolderNode.createTemplateAction({
|
|
15
|
+
id: "ms-teams:sendMessage",
|
|
16
|
+
description: "Sends a Microsoft Teams message via a webhook",
|
|
17
|
+
examples: sendMsTeamsMessage_examples.examples,
|
|
18
|
+
schema: {
|
|
19
|
+
input: {
|
|
20
|
+
type: "object",
|
|
21
|
+
required: ["message"],
|
|
22
|
+
properties: {
|
|
23
|
+
message: {
|
|
24
|
+
title: "Message",
|
|
25
|
+
description: "The message to send via webhook",
|
|
26
|
+
type: "string"
|
|
27
|
+
},
|
|
28
|
+
webhookUrl: {
|
|
29
|
+
title: "Webhook URL",
|
|
30
|
+
description: "The Microsoft Teams webhook URL to send the request to. The URL must either be specified here or in the Backstage config",
|
|
31
|
+
type: "string"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
async handler(ctx) {
|
|
37
|
+
const webhookUrl = config.getOptionalString("ms-teams.webhookUrl") ?? ctx.input.webhookUrl;
|
|
38
|
+
if (!webhookUrl) {
|
|
39
|
+
throw new errors.InputError(
|
|
40
|
+
"Webhook URL is not specified in either the app-config or the action input. This must be specified in at least one place in order to send a message"
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
const body = {
|
|
44
|
+
text: ctx.input.message
|
|
45
|
+
};
|
|
46
|
+
const result = await axios__default.default.post(webhookUrl, body);
|
|
47
|
+
if (result.status !== 200) {
|
|
48
|
+
ctx.logger.error(
|
|
49
|
+
`Something went wrong while trying to send a request to the Teams webhook URL - StatusCode ${result.status}`
|
|
50
|
+
);
|
|
51
|
+
ctx.logger.debug(`Response body: ${result.data}`);
|
|
52
|
+
ctx.logger.debug(`Webhook URL: ${webhookUrl}`);
|
|
53
|
+
ctx.logger.debug(`Input message: ${ctx.input.message}`);
|
|
54
|
+
throw new Error(
|
|
55
|
+
`Something went wrong while trying to send a request to the Teams webhook URL - StatusCode ${result.status}`
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
exports.createSendTeamsMessageViaWebhookAction = createSendTeamsMessageViaWebhookAction;
|
|
63
|
+
//# sourceMappingURL=send-ms-teams-message.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-ms-teams-message.cjs.js","sources":["../../../src/actions/ms-teams/send-ms-teams-message.ts"],"sourcesContent":["import { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport axios from 'axios';\nimport { Config } from '@backstage/config';\nimport { InputError } from '@backstage/errors';\nimport { examples } from './send-ms-teams-message.examples';\n\n/**\n * Creates a `msteams:sendMessage` Scaffolder action.\n *\n * @public\n */\nexport function createSendTeamsMessageViaWebhookAction(options: {\n config: Config;\n }) {\n const { config } = options;\n \n return createTemplateAction<{\n message: string;\n webhookUrl?: string;\n }>({\n id: 'ms-teams:sendMessage',\n description: 'Sends a Microsoft Teams message via a webhook',\n examples,\n schema: {\n input: {\n type: 'object',\n required: ['message'],\n properties: {\n message: {\n title: 'Message',\n description: 'The message to send via webhook',\n type: 'string',\n },\n webhookUrl: {\n title: 'Webhook URL',\n description:\n 'The Microsoft Teams webhook URL to send the request to. The URL must either be specified here or in the Backstage config',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const webhookUrl =\n config.getOptionalString('ms-teams.webhookUrl') ?? ctx.input.webhookUrl;\n \n if (!webhookUrl) {\n throw new InputError(\n 'Webhook URL is not specified in either the app-config or the action input. This must be specified in at least one place in order to send a message',\n );\n }\n \n const body = {\n text: ctx.input.message,\n };\n \n const result = await axios.post(webhookUrl, body);\n \n if (result.status !== 200) {\n ctx.logger.error(\n `Something went wrong while trying to send a request to the Teams webhook URL - StatusCode ${result.status}`,\n );\n ctx.logger.debug(`Response body: ${result.data}`);\n ctx.logger.debug(`Webhook URL: ${webhookUrl}`);\n ctx.logger.debug(`Input message: ${ctx.input.message}`);\n throw new Error(\n `Something went wrong while trying to send a request to the Teams webhook URL - StatusCode ${result.status}`,\n );\n }\n },\n });\n }\n"],"names":["createTemplateAction","examples","InputError","axios"],"mappings":";;;;;;;;;;;AAWO,SAAS,uCAAuC,OAElD,EAAA;AACD,EAAM,MAAA,EAAE,QAAW,GAAA,OAAA;AAEnB,EAAA,OAAOA,yCAGJ,CAAA;AAAA,IACD,EAAI,EAAA,sBAAA;AAAA,IACJ,WAAa,EAAA,+CAAA;AAAA,cACbC,oCAAA;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,KAAO,EAAA;AAAA,QACL,IAAM,EAAA,QAAA;AAAA,QACN,QAAA,EAAU,CAAC,SAAS,CAAA;AAAA,QACpB,UAAY,EAAA;AAAA,UACV,OAAS,EAAA;AAAA,YACP,KAAO,EAAA,SAAA;AAAA,YACP,WAAa,EAAA,iCAAA;AAAA,YACb,IAAM,EAAA;AAAA,WACR;AAAA,UACA,UAAY,EAAA;AAAA,YACV,KAAO,EAAA,aAAA;AAAA,YACP,WACE,EAAA,0HAAA;AAAA,YACF,IAAM,EAAA;AAAA;AACR;AACF;AACF,KACF;AAAA,IACA,MAAM,QAAQ,GAAK,EAAA;AACjB,MAAA,MAAM,aACJ,MAAO,CAAA,iBAAA,CAAkB,qBAAqB,CAAA,IAAK,IAAI,KAAM,CAAA,UAAA;AAE/D,MAAA,IAAI,CAAC,UAAY,EAAA;AACf,QAAA,MAAM,IAAIC,iBAAA;AAAA,UACR;AAAA,SACF;AAAA;AAGF,MAAA,MAAM,IAAO,GAAA;AAAA,QACX,IAAA,EAAM,IAAI,KAAM,CAAA;AAAA,OAClB;AAEA,MAAA,MAAM,MAAS,GAAA,MAAMC,sBAAM,CAAA,IAAA,CAAK,YAAY,IAAI,CAAA;AAEhD,MAAI,IAAA,MAAA,CAAO,WAAW,GAAK,EAAA;AACzB,QAAA,GAAA,CAAI,MAAO,CAAA,KAAA;AAAA,UACT,CAAA,0FAAA,EAA6F,OAAO,MAAM,CAAA;AAAA,SAC5G;AACA,QAAA,GAAA,CAAI,MAAO,CAAA,KAAA,CAAM,CAAkB,eAAA,EAAA,MAAA,CAAO,IAAI,CAAE,CAAA,CAAA;AAChD,QAAA,GAAA,CAAI,MAAO,CAAA,KAAA,CAAM,CAAgB,aAAA,EAAA,UAAU,CAAE,CAAA,CAAA;AAC7C,QAAA,GAAA,CAAI,OAAO,KAAM,CAAA,CAAA,eAAA,EAAkB,GAAI,CAAA,KAAA,CAAM,OAAO,CAAE,CAAA,CAAA;AACtD,QAAA,MAAM,IAAI,KAAA;AAAA,UACR,CAAA,0FAAA,EAA6F,OAAO,MAAM,CAAA;AAAA,SAC5G;AAAA;AACF;AACF,GACD,CAAA;AACH;;;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var yaml = require('yaml');
|
|
4
|
+
|
|
5
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
6
|
+
|
|
7
|
+
var yaml__default = /*#__PURE__*/_interopDefaultCompat(yaml);
|
|
8
|
+
|
|
9
|
+
const examples = [
|
|
10
|
+
{
|
|
11
|
+
description: "Send a simple message to Microsoft Teams",
|
|
12
|
+
example: yaml__default.default.stringify({
|
|
13
|
+
steps: [
|
|
14
|
+
{
|
|
15
|
+
id: "ms-teams:sendMessage",
|
|
16
|
+
action: "ms-teams:sendMessage",
|
|
17
|
+
name: "Send a message to Teams",
|
|
18
|
+
input: {
|
|
19
|
+
message: "Hello, Teams!"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
})
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
description: "Send a message to Microsoft Teams with a specific webhook URL",
|
|
27
|
+
example: yaml__default.default.stringify({
|
|
28
|
+
steps: [
|
|
29
|
+
{
|
|
30
|
+
id: "ms-teams:sendMessage",
|
|
31
|
+
action: "ms-teams:sendMessage",
|
|
32
|
+
name: "Send a message to Teams",
|
|
33
|
+
input: {
|
|
34
|
+
message: "Hello, Teams!",
|
|
35
|
+
webhookUrl: "https://example-teams-webhook.com"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
exports.examples = examples;
|
|
44
|
+
//# sourceMappingURL=send-ms-teams-message.examples.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-ms-teams-message.examples.cjs.js","sources":["../../../src/actions/ms-teams/send-ms-teams-message.examples.ts"],"sourcesContent":["import { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Send a simple message to Microsoft Teams',\n example: yaml.stringify({\n steps: [\n {\n id: 'ms-teams:sendMessage',\n action: 'ms-teams:sendMessage',\n name: 'Send a message to Teams',\n input: {\n message: 'Hello, Teams!',\n },\n },\n ],\n }),\n },\n {\n description: 'Send a message to Microsoft Teams with a specific webhook URL',\n example: yaml.stringify({\n steps: [\n {\n id: 'ms-teams:sendMessage',\n action: 'ms-teams:sendMessage',\n name: 'Send a message to Teams',\n input: {\n message: 'Hello, Teams!',\n webhookUrl: 'https://example-teams-webhook.com',\n },\n },\n ],\n }),\n },\n];\n"],"names":["yaml"],"mappings":";;;;;;;;AAGO,MAAM,QAA8B,GAAA;AAAA,EACzC;AAAA,IACE,WAAa,EAAA,0CAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,EAAI,EAAA,sBAAA;AAAA,UACJ,MAAQ,EAAA,sBAAA;AAAA,UACR,IAAM,EAAA,yBAAA;AAAA,UACN,KAAO,EAAA;AAAA,YACL,OAAS,EAAA;AAAA;AACX;AACF;AACF,KACD;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAa,EAAA,+DAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,EAAI,EAAA,sBAAA;AAAA,UACJ,MAAQ,EAAA,sBAAA;AAAA,UACR,IAAM,EAAA,yBAAA;AAAA,UACN,KAAO,EAAA;AAAA,YACL,OAAS,EAAA,eAAA;AAAA,YACT,UAAY,EAAA;AAAA;AACd;AACF;AACF,KACD;AAAA;AAEL;;;;"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -2,63 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var errors = require('@backstage/errors');
|
|
5
|
+
var sendMsTeamsMessage = require('./actions/ms-teams/send-ms-teams-message.cjs.js');
|
|
6
|
+
var module$1 = require('./module.cjs.js');
|
|
8
7
|
|
|
9
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
8
|
|
|
11
|
-
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
12
9
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return pluginScaffolderNode.createTemplateAction({
|
|
16
|
-
id: "ms-teams:sendMessage",
|
|
17
|
-
description: "Sends a Microsoft Teams message via a webhook",
|
|
18
|
-
schema: {
|
|
19
|
-
input: {
|
|
20
|
-
type: "object",
|
|
21
|
-
required: ["message"],
|
|
22
|
-
properties: {
|
|
23
|
-
message: {
|
|
24
|
-
title: "Message",
|
|
25
|
-
description: "The message to send via webhook",
|
|
26
|
-
type: "string"
|
|
27
|
-
},
|
|
28
|
-
webhookUrl: {
|
|
29
|
-
title: "Webhook URL",
|
|
30
|
-
description: "The Microsoft Teams webhook URL to send the request to. The URL must either be specified here or in the Backstage config",
|
|
31
|
-
type: "string"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
async handler(ctx) {
|
|
37
|
-
var _a;
|
|
38
|
-
const webhookUrl = (_a = config.getOptionalString("ms-teams.webhookUrl")) != null ? _a : ctx.input.webhookUrl;
|
|
39
|
-
if (!webhookUrl) {
|
|
40
|
-
throw new errors.InputError(
|
|
41
|
-
"Webhook URL is not specified in either the app-config or the action input. This must be specified in at least one place in order to send a message"
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
const body = {
|
|
45
|
-
text: ctx.input.message
|
|
46
|
-
};
|
|
47
|
-
const result = await axios__default["default"].post(webhookUrl, body);
|
|
48
|
-
if (result.status !== 200) {
|
|
49
|
-
ctx.logger.error(
|
|
50
|
-
`Something went wrong while trying to send a request to the Teams webhook URL - StatusCode ${result.status}`
|
|
51
|
-
);
|
|
52
|
-
ctx.logger.debug(`Response body: ${result.data}`);
|
|
53
|
-
ctx.logger.debug(`Webhook URL: ${webhookUrl}`);
|
|
54
|
-
ctx.logger.debug(`Input message: ${ctx.input.message}`);
|
|
55
|
-
throw new Error(
|
|
56
|
-
`Something went wrong while trying to send a request to the Teams webhook URL - StatusCode ${result.status}`
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
exports.createSendTeamsMessageViaWebhookAction = createSendTeamsMessageViaWebhookAction;
|
|
10
|
+
exports.createSendTeamsMessageViaWebhookAction = sendMsTeamsMessage.createSendTeamsMessageViaWebhookAction;
|
|
11
|
+
exports.default = module$1.scaffolderModuleSendTeamsMessage;
|
|
64
12
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as _backstage_plugin_scaffolder_node from '@backstage/plugin-scaffolder-node';
|
|
2
|
-
import * as
|
|
2
|
+
import * as _backstage_types_index from '@backstage/types/index';
|
|
3
3
|
import { Config } from '@backstage/config';
|
|
4
|
+
import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Creates a `msteams:sendMessage` Scaffolder action.
|
|
@@ -11,7 +12,12 @@ declare function createSendTeamsMessageViaWebhookAction(options: {
|
|
|
11
12
|
config: Config;
|
|
12
13
|
}): _backstage_plugin_scaffolder_node.TemplateAction<{
|
|
13
14
|
message: string;
|
|
14
|
-
webhookUrl?: string
|
|
15
|
-
},
|
|
15
|
+
webhookUrl?: string;
|
|
16
|
+
}, _backstage_types_index.JsonObject>;
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
/**
|
|
19
|
+
* A backend module that registers the action into the scaffolder
|
|
20
|
+
*/
|
|
21
|
+
declare const scaffolderModuleSendTeamsMessage: _backstage_backend_plugin_api.BackendFeature;
|
|
22
|
+
|
|
23
|
+
export { createSendTeamsMessageViaWebhookAction, scaffolderModuleSendTeamsMessage as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var backendPluginApi = require('@backstage/backend-plugin-api');
|
|
4
|
+
var alpha = require('@backstage/plugin-scaffolder-node/alpha');
|
|
5
|
+
var sendMsTeamsMessage = require('./actions/ms-teams/send-ms-teams-message.cjs.js');
|
|
6
|
+
|
|
7
|
+
const scaffolderModuleSendTeamsMessage = backendPluginApi.createBackendModule({
|
|
8
|
+
moduleId: "ms-teams:sendMessage",
|
|
9
|
+
pluginId: "scaffolder",
|
|
10
|
+
register({ registerInit }) {
|
|
11
|
+
registerInit({
|
|
12
|
+
deps: {
|
|
13
|
+
scaffolderActions: alpha.scaffolderActionsExtensionPoint,
|
|
14
|
+
config: backendPluginApi.coreServices.rootConfig
|
|
15
|
+
},
|
|
16
|
+
async init({ scaffolderActions, config }) {
|
|
17
|
+
scaffolderActions.addActions(sendMsTeamsMessage.createSendTeamsMessageViaWebhookAction({ config }));
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
exports.scaffolderModuleSendTeamsMessage = scaffolderModuleSendTeamsMessage;
|
|
24
|
+
//# sourceMappingURL=module.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["import { createBackendModule, coreServices } from \"@backstage/backend-plugin-api\";\nimport { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';\nimport { createSendTeamsMessageViaWebhookAction } from \"./actions/ms-teams/send-ms-teams-message\";\n\n/**\n * A backend module that registers the action into the scaffolder\n */\nexport const scaffolderModuleSendTeamsMessage = createBackendModule({\n moduleId: 'ms-teams:sendMessage',\n pluginId: 'scaffolder',\n register({ registerInit }) {\n registerInit({\n deps: {\n scaffolderActions: scaffolderActionsExtensionPoint,\n config: coreServices.rootConfig,\n },\n async init({ scaffolderActions, config }) {\n scaffolderActions.addActions(createSendTeamsMessageViaWebhookAction({ config }));\n }\n });\n },\n})\n"],"names":["createBackendModule","scaffolderActionsExtensionPoint","coreServices","createSendTeamsMessageViaWebhookAction"],"mappings":";;;;;;AAOO,MAAM,mCAAmCA,oCAAoB,CAAA;AAAA,EAClE,QAAU,EAAA,sBAAA;AAAA,EACV,QAAU,EAAA,YAAA;AAAA,EACV,QAAA,CAAS,EAAE,YAAA,EAAgB,EAAA;AACzB,IAAa,YAAA,CAAA;AAAA,MACX,IAAM,EAAA;AAAA,QACJ,iBAAmB,EAAAC,qCAAA;AAAA,QACnB,QAAQC,6BAAa,CAAA;AAAA,OACvB;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,iBAAA,EAAmB,QAAU,EAAA;AACxC,QAAA,iBAAA,CAAkB,UAAW,CAAAC,yDAAA,CAAuC,EAAE,MAAA,EAAQ,CAAC,CAAA;AAAA;AACjF,KACD,CAAA;AAAA;AAEL,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grvpandey11/backstage-plugin-scaffolder-backend-module-ms-teams",
|
|
3
3
|
"description": "The Microsoft Teams module for @backstage/plugin-scaffolder-backend",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"private": false,
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/grvpandey11/backstage-plugin-scaffolder-backend-module-ms-teams.git",
|
|
12
|
+
"directory": "."
|
|
13
|
+
},
|
|
9
14
|
"publishConfig": {
|
|
10
15
|
"access": "public",
|
|
11
16
|
"main": "dist/index.cjs.js",
|
|
12
17
|
"types": "dist/index.d.ts"
|
|
13
18
|
},
|
|
14
19
|
"backstage": {
|
|
15
|
-
"role": "backend-plugin-module"
|
|
20
|
+
"role": "backend-plugin-module",
|
|
21
|
+
"pluginId": "scaffolder",
|
|
22
|
+
"pluginPackage": "@backstage/plugin-scaffolder-backend"
|
|
16
23
|
},
|
|
17
24
|
"scripts": {
|
|
18
25
|
"start": "backstage-cli package start",
|
|
@@ -24,18 +31,26 @@
|
|
|
24
31
|
"postpack": "backstage-cli package postpack"
|
|
25
32
|
},
|
|
26
33
|
"dependencies": {
|
|
27
|
-
"@backstage/
|
|
28
|
-
"@backstage/
|
|
29
|
-
"@backstage/
|
|
30
|
-
"@backstage/plugin-scaffolder-node": "^0.
|
|
31
|
-
"axios": "^1.
|
|
34
|
+
"@backstage/backend-plugin-api": "^1.1.0",
|
|
35
|
+
"@backstage/config": "^1.3.1",
|
|
36
|
+
"@backstage/errors": "^1.2.6",
|
|
37
|
+
"@backstage/plugin-scaffolder-node": "^0.6.2",
|
|
38
|
+
"axios": "^1.7.9",
|
|
39
|
+
"yaml": "^2.6.1"
|
|
32
40
|
},
|
|
33
41
|
"devDependencies": {
|
|
34
|
-
"@backstage/
|
|
35
|
-
"@backstage/
|
|
36
|
-
"winston": "^3.
|
|
42
|
+
"@backstage/cli": "^0.29.4",
|
|
43
|
+
"@backstage/plugin-scaffolder-node-test-utils": "^0.1.17",
|
|
44
|
+
"winston": "^3.17.0"
|
|
37
45
|
},
|
|
38
46
|
"files": [
|
|
39
47
|
"dist"
|
|
40
|
-
]
|
|
48
|
+
],
|
|
49
|
+
"typesVersions": {
|
|
50
|
+
"*": {
|
|
51
|
+
"index": [
|
|
52
|
+
"dist/index.d.ts"
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
41
56
|
}
|