@clickview/ship-it 0.0.25 → 0.0.27-dev.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/Dockerfile +33 -0
- package/README.md +48 -48
- package/config.json +19 -10
- package/dist/F1/Analytics Web.md +8 -0
- package/dist/F1/AutoCaptions.md +30 -0
- package/dist/F1/Classroom.Api.md +23 -0
- package/dist/F1/ClickView Online.md +17 -0
- package/dist/F1/ClickView.Curator.md +100 -0
- package/dist/F1/ClickView.EmailService.md +53 -0
- package/dist/F1/ClickView.OnlineApi.md +13 -0
- package/dist/F1/Clients.md +19 -0
- package/dist/F1/Domain.Api.md +23 -0
- package/dist/F1/Exchange.Web.md +8 -0
- package/dist/F1/Image.Api.md +8 -0
- package/dist/F1/Integrations.Api.md +23 -0
- package/dist/F1/Krakend.md +8 -0
- package/dist/F1/Library Editor.md +0 -0
- package/dist/F1/Lite.md +60 -0
- package/dist/F1/Master.Api.md +58 -0
- package/dist/F1/Master.Auth.md +22 -0
- package/dist/F1/Objects.Api.md +12 -0
- package/dist/F1/Permissions.Api.md +12 -0
- package/dist/F1/RealtimeSalesforceSync.md +14 -0
- package/dist/F1/Release Notes.md +990 -0
- package/dist/F1/Search.Api.md +12 -0
- package/dist/F1/StreamableLearning.Web.md +35 -0
- package/dist/F1/Users.Api.md +13 -0
- package/dist/F1/VideoProcessorService.md +23 -0
- package/dist/F1/clickview.md +321 -0
- package/dist/F2/Analytics Web.md +7 -0
- package/dist/F2/Batch.Api.md +27 -0
- package/dist/F2/ClickView Online.md +12 -0
- package/dist/F2/ClickView.Curator.md +166 -0
- package/dist/F2/Clients.md +14 -0
- package/dist/F2/CurriculumIngestion.Api.md +13 -0
- package/dist/F2/Discover.Api.md +64 -0
- package/dist/F2/Domain.Api.md +16 -0
- package/dist/F2/Exchange.Web.md +7 -0
- package/dist/F2/Krakend.md +12 -0
- package/dist/F2/Library Editor.md +11 -0
- package/dist/F2/Lite.md +30 -0
- package/dist/F2/Objects.Api.md +12 -0
- package/dist/F2/Release Notes.md +759 -0
- package/dist/F2/Search.Api.md +30 -0
- package/dist/F2/Share.Api.md +12 -0
- package/dist/F2/StreamableLearning.Web.md +14 -0
- package/dist/F2/Subjects.API.md +12 -0
- package/dist/F2/Tv.Web.md +8 -0
- package/dist/F2/Users.Api.md +21 -0
- package/dist/F2/clickview.md +200 -0
- package/dist/F2/shortcode-api.md +8 -0
- package/dist/F3.1/Analytics Web.md +8 -0
- package/dist/F3.1/ClickView.Curator.md +14 -0
- package/dist/F3.1/Discover.Api.md +14 -0
- package/dist/F3.1/Domain.Api.md +7 -0
- package/dist/F3.1/Exchange.Web.md +8 -0
- package/dist/F3.1/Library Editor.md +8 -0
- package/dist/F3.1/Lite.md +8 -0
- package/dist/F3.1/Objects.Api.md +7 -0
- package/dist/F3.1/Release Notes.md +207 -0
- package/dist/F3.1/Search.Api.md +14 -0
- package/dist/F3.1/Share.Api.md +10 -0
- package/dist/F3.1/Subjects.API.md +35 -0
- package/dist/F3.1/VideoViews.Api.md +7 -0
- package/dist/F3.1/clickview.md +28 -0
- package/lib/config.json +20 -11
- package/lib/src/api-clients/git-lab/GitLabApiClient.js +423 -404
- package/lib/src/api-clients/git-lab/GitLabMapper.js +82 -81
- package/lib/src/api-clients/index.js +20 -18
- package/lib/src/api-clients/slack/SlackApiClient.js +206 -0
- package/lib/src/api-clients/team-city/TeamCityApiClient.js +100 -100
- package/lib/src/api-clients/trello/TrelloApiClient.js +145 -0
- package/lib/src/commands/BumpPackagesCommand.js +84 -84
- package/lib/src/commands/CreateBranchCommand.js +100 -100
- package/lib/src/commands/CreateMergeRequestCommand.js +107 -107
- package/lib/src/commands/CreateReleaseNotesCommand.js +95 -84
- package/lib/src/commands/CreateTestingNotesCommand.js +84 -84
- package/lib/src/commands/CreateTrelloCardsCommand.js +77 -0
- package/lib/src/commands/InstallPackagesCommand.js +76 -76
- package/lib/src/commands/ListProjectsCommand.js +76 -76
- package/lib/src/commands/ReleaseCommand.js +117 -129
- package/lib/src/commands/StartConsumingProjectBuildsCommand.js +76 -76
- package/lib/src/commands/StartProjectBuildsCommand.js +76 -76
- package/lib/src/commands/StatusCommand.js +88 -88
- package/lib/src/commands/TagMasterCommand.js +76 -76
- package/lib/src/commands/ValidateMergeRequestCommand.js +76 -76
- package/lib/src/commands/VersionCommand.js +76 -76
- package/lib/src/commands/index.js +30 -29
- package/lib/src/constants/CommandTypeMapping.js +20 -19
- package/lib/src/constants/GitLabMemberIds.js +6 -6
- package/lib/src/constants/MonorepoPackageJsonFiles.js +17 -17
- package/lib/src/constants/MonorepoProjectNames.js +16 -16
- package/lib/src/constants/ProjectNames.js +68 -67
- package/lib/src/constants/SlackUserEmailList.js +13 -0
- package/lib/src/constants/TeamCityBuildIDs.js +45 -44
- package/lib/src/constants/index.js +19 -19
- package/lib/src/errors/ShipItError.js +32 -32
- package/lib/src/errors/index.js +17 -17
- package/lib/src/index.js +18 -18
- package/lib/src/interfaces/Config.js +2 -2
- package/lib/src/interfaces/MergeRequestState.js +2 -2
- package/lib/src/interfaces/ProjectNames.js +2 -2
- package/lib/src/interfaces/ShipItCommand.js +2 -2
- package/lib/src/interfaces/ShipItTask.js +2 -2
- package/lib/src/interfaces/VersionType.js +2 -2
- package/lib/src/interfaces/command-cli-options/MilestoneCommandCliOptions.js +2 -2
- package/lib/src/interfaces/command-cli-options/ReleaseCommandCliOptions.js +2 -2
- package/lib/src/interfaces/command-cli-options/StatusCommandCliOptions.js +2 -0
- package/lib/src/interfaces/command-cli-options/index.js +19 -18
- package/lib/src/interfaces/command-options/BaseCommandOptions.js +2 -2
- package/lib/src/interfaces/command-options/BumpPackagesCommandOptions.js +2 -2
- package/lib/src/interfaces/command-options/DockerMilestoneCommandOptions.js +2 -2
- package/lib/src/interfaces/command-options/MilestoneCommandOptions.js +2 -2
- package/lib/src/interfaces/command-options/ReleaseCommandOptions.js +2 -2
- package/lib/src/interfaces/command-options/StatusCommandOptions.js +2 -0
- package/lib/src/interfaces/command-options/ValidateMRCommandOptions.js +2 -2
- package/lib/src/interfaces/command-options/index.js +22 -21
- package/lib/src/interfaces/index.js +26 -26
- package/lib/src/interfaces/models/Branch.js +2 -2
- package/lib/src/interfaces/models/Commit.js +2 -2
- package/lib/src/interfaces/models/CommitFile.js +2 -2
- package/lib/src/interfaces/models/File.js +2 -2
- package/lib/src/interfaces/models/Label.js +2 -2
- package/lib/src/interfaces/models/MergeRequest.js +2 -2
- package/lib/src/interfaces/models/Milestone.js +2 -2
- package/lib/src/interfaces/models/Project.js +2 -2
- package/lib/src/interfaces/models/ProjectConfig.js +9 -9
- package/lib/src/interfaces/models/Release.js +2 -2
- package/lib/src/interfaces/models/Tag.js +2 -2
- package/lib/src/interfaces/models/index.js +26 -26
- package/lib/src/interfaces/view-models/MilestoneProject.js +2 -2
- package/lib/src/interfaces/view-models/index.js +17 -17
- package/lib/src/inversify.config.js +75 -67
- package/lib/src/services/GitLabService.js +505 -498
- package/lib/src/services/SlackService.js +139 -0
- package/lib/src/services/TeamCityService.js +37 -37
- package/lib/src/services/TrelloService.js +84 -0
- package/lib/src/services/index.js +20 -18
- package/lib/src/startup/AddMilestoneCommand.js +95 -95
- package/lib/src/startup/GetAction.js +68 -68
- package/lib/src/startup/SetupCommands.js +169 -128
- package/lib/src/tasks/BumpPackagesTask.js +229 -229
- package/lib/src/tasks/BumpVersionTxtTask.js +110 -110
- package/lib/src/tasks/CommitPackageVersionsTask.js +116 -116
- package/lib/src/tasks/CreateBranchTask.js +104 -104
- package/lib/src/tasks/CreateMergeRequestTask.js +118 -118
- package/lib/src/tasks/CreateReleaseNotesTask.js +144 -122
- package/lib/src/tasks/CreateTestingNotesTask.js +135 -135
- package/lib/src/tasks/InstallPackagesTask.js +407 -407
- package/lib/src/tasks/ListProjectsTask.js +87 -87
- package/lib/src/tasks/PopulateTrelloBoardTask.js +140 -0
- package/lib/src/tasks/StartConsumingProjectBuildsTask.js +149 -149
- package/lib/src/tasks/StartMonorepoBuildTask.js +109 -109
- package/lib/src/tasks/StartProjectBuildsTask.js +170 -149
- package/lib/src/tasks/TagMasterTask.js +121 -121
- package/lib/src/tasks/ValidateCommitsTask.js +143 -119
- package/lib/src/tasks/ValidateDescriptionsTask.js +178 -151
- package/lib/src/tasks/ValidateMergeRequestTask.js +115 -115
- package/lib/src/tasks/ValidateTask.js +419 -240
- package/lib/src/tasks/VersionTask.js +98 -98
- package/lib/src/tasks/index.js +34 -33
- package/lib/src/types.js +57 -49
- package/lib/src/utils/BranchNames.js +11 -11
- package/lib/src/utils/Commits.js +55 -55
- package/lib/src/utils/Csv.js +54 -54
- package/lib/src/utils/Descriptions.js +237 -237
- package/lib/src/utils/GroupIds.js +6 -6
- package/lib/src/utils/Logger.js +62 -62
- package/lib/src/utils/ProjectIds.js +47 -47
- package/lib/src/utils/Versions.js +20 -20
- package/lib/src/utils/index.js +22 -22
- package/package.json +50 -47
|
@@ -1,81 +1,82 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GitLabMapper = void 0;
|
|
4
|
-
exports.GitLabMapper = {
|
|
5
|
-
mergeRequest: function (m) {
|
|
6
|
-
var _a;
|
|
7
|
-
return {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GitLabMapper = void 0;
|
|
4
|
+
exports.GitLabMapper = {
|
|
5
|
+
mergeRequest: function (m) {
|
|
6
|
+
var _a;
|
|
7
|
+
return {
|
|
8
|
+
iid: m.iid,
|
|
9
|
+
title: m.title,
|
|
10
|
+
description: m.description,
|
|
11
|
+
status: m.state,
|
|
12
|
+
projectId: m.project_id,
|
|
13
|
+
mergeCommit: m.merge_commit_sha,
|
|
14
|
+
author: m.author.name,
|
|
15
|
+
assignee: (_a = m.assignee) === null || _a === void 0 ? void 0 : _a.name,
|
|
16
|
+
url: m.web_url,
|
|
17
|
+
hasConflicts: m.has_conflicts,
|
|
18
|
+
targetBranch: m.target_branch,
|
|
19
|
+
sourceBranch: m.source_branch,
|
|
20
|
+
milestone: exports.GitLabMapper.milestone(m.milestone),
|
|
21
|
+
labels: m.labels,
|
|
22
|
+
dateCreated: m.created_at
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
project: function (p) {
|
|
26
|
+
return {
|
|
27
|
+
id: p.id,
|
|
28
|
+
title: p.name,
|
|
29
|
+
url: p.web_url
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
tag: function (t) {
|
|
33
|
+
return {
|
|
34
|
+
name: t.name,
|
|
35
|
+
target: t.commit.id
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
commit: function (c) {
|
|
39
|
+
return {
|
|
40
|
+
id: c.id,
|
|
41
|
+
title: c.title,
|
|
42
|
+
message: c.message,
|
|
43
|
+
parentIds: c.parent_ids
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
branch: function (b) {
|
|
47
|
+
return {
|
|
48
|
+
name: b.name
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
file: function (f) {
|
|
52
|
+
return {
|
|
53
|
+
name: f.file_name,
|
|
54
|
+
path: f.file_path,
|
|
55
|
+
content: f.content
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
milestone: function (m) {
|
|
59
|
+
if (!m)
|
|
60
|
+
return null;
|
|
61
|
+
return {
|
|
62
|
+
id: m.id,
|
|
63
|
+
name: m.title
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
label: function (m) {
|
|
67
|
+
return {
|
|
68
|
+
name: m.name,
|
|
69
|
+
description: m.description
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
release: function (m) {
|
|
73
|
+
var _a;
|
|
74
|
+
return {
|
|
75
|
+
name: m.name,
|
|
76
|
+
tag: m.tag_name,
|
|
77
|
+
description: m.description,
|
|
78
|
+
ref: m.commit.id,
|
|
79
|
+
milestones: (_a = m.milestones) === null || _a === void 0 ? void 0 : _a.map(function (m) { return m.title; })
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
};
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./git-lab/GitLabApiClient"), exports);
|
|
18
|
-
__exportStar(require("./team-city/TeamCityApiClient"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./git-lab/GitLabApiClient"), exports);
|
|
18
|
+
__exportStar(require("./team-city/TeamCityApiClient"), exports);
|
|
19
|
+
__exportStar(require("./slack/SlackApiClient"), exports);
|
|
20
|
+
__exportStar(require("./trello/TrelloApiClient"), exports);
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
24
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
25
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
26
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
27
|
+
function step(op) {
|
|
28
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
29
|
+
while (_) try {
|
|
30
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
31
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
32
|
+
switch (op[0]) {
|
|
33
|
+
case 0: case 1: t = op; break;
|
|
34
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
35
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
36
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
37
|
+
default:
|
|
38
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
39
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
40
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
41
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
42
|
+
if (t[2]) _.ops.pop();
|
|
43
|
+
_.trys.pop(); continue;
|
|
44
|
+
}
|
|
45
|
+
op = body.call(thisArg, _);
|
|
46
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
47
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
exports.SlackApiClient = void 0;
|
|
52
|
+
require("reflect-metadata");
|
|
53
|
+
var inversify_1 = require("inversify");
|
|
54
|
+
var web_api_1 = require("@slack/web-api");
|
|
55
|
+
var types_1 = require("../../types");
|
|
56
|
+
var utils_1 = require("../../utils");
|
|
57
|
+
var MAX_MESSAGE_LENGTH = 4000;
|
|
58
|
+
var SlackApiClient = /** @class */ (function () {
|
|
59
|
+
function SlackApiClient(config) {
|
|
60
|
+
this.config = config;
|
|
61
|
+
this.client = new web_api_1.WebClient(this.config.botToken);
|
|
62
|
+
}
|
|
63
|
+
SlackApiClient.prototype.sendMessageToChannel = function (message) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
+
var response, error_1;
|
|
66
|
+
return __generator(this, function (_a) {
|
|
67
|
+
switch (_a.label) {
|
|
68
|
+
case 0:
|
|
69
|
+
_a.trys.push([0, 2, , 3]);
|
|
70
|
+
return [4 /*yield*/, this.client.chat.postMessage({
|
|
71
|
+
text: message,
|
|
72
|
+
channel: this.config.channelId,
|
|
73
|
+
})];
|
|
74
|
+
case 1:
|
|
75
|
+
response = _a.sent();
|
|
76
|
+
return [2 /*return*/, response];
|
|
77
|
+
case 2:
|
|
78
|
+
error_1 = _a.sent();
|
|
79
|
+
utils_1.Logger.logError('Error sending message:', error_1.message);
|
|
80
|
+
throw error_1;
|
|
81
|
+
case 3: return [2 /*return*/];
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
SlackApiClient.prototype.uploadFileToChannel = function (message, fileName, threadTs) {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
88
|
+
var uploadResponse, error_2;
|
|
89
|
+
return __generator(this, function (_a) {
|
|
90
|
+
switch (_a.label) {
|
|
91
|
+
case 0:
|
|
92
|
+
_a.trys.push([0, 2, , 3]);
|
|
93
|
+
return [4 /*yield*/, this.client.files.uploadV2({
|
|
94
|
+
channel_id: this.config.channelId,
|
|
95
|
+
content: message,
|
|
96
|
+
filename: fileName,
|
|
97
|
+
thread_ts: threadTs,
|
|
98
|
+
})];
|
|
99
|
+
case 1:
|
|
100
|
+
uploadResponse = _a.sent();
|
|
101
|
+
return [2 /*return*/, uploadResponse];
|
|
102
|
+
case 2:
|
|
103
|
+
error_2 = _a.sent();
|
|
104
|
+
utils_1.Logger.logError('Error uploading message:', error_2.message);
|
|
105
|
+
throw error_2;
|
|
106
|
+
case 3: return [2 /*return*/];
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
SlackApiClient.prototype.replyInThread = function (message, threadTs) {
|
|
112
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
113
|
+
var response, uploadResponse, error_3;
|
|
114
|
+
return __generator(this, function (_a) {
|
|
115
|
+
switch (_a.label) {
|
|
116
|
+
case 0:
|
|
117
|
+
_a.trys.push([0, 4, , 5]);
|
|
118
|
+
if (!(message.length <= MAX_MESSAGE_LENGTH)) return [3 /*break*/, 2];
|
|
119
|
+
return [4 /*yield*/, this.client.chat.postMessage({
|
|
120
|
+
channel: this.config.channelId,
|
|
121
|
+
text: message,
|
|
122
|
+
thread_ts: threadTs,
|
|
123
|
+
})];
|
|
124
|
+
case 1:
|
|
125
|
+
response = _a.sent();
|
|
126
|
+
return [2 /*return*/, response];
|
|
127
|
+
case 2: return [4 /*yield*/, this.client.files.uploadV2({
|
|
128
|
+
channel_id: this.config.channelId,
|
|
129
|
+
content: message,
|
|
130
|
+
filename: 'statusData.txt',
|
|
131
|
+
thread_ts: threadTs,
|
|
132
|
+
})];
|
|
133
|
+
case 3:
|
|
134
|
+
uploadResponse = _a.sent();
|
|
135
|
+
return [2 /*return*/, uploadResponse];
|
|
136
|
+
case 4:
|
|
137
|
+
error_3 = _a.sent();
|
|
138
|
+
utils_1.Logger.logError('Error uploading message:', error_3.message);
|
|
139
|
+
throw error_3;
|
|
140
|
+
case 5: return [2 /*return*/];
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
SlackApiClient.prototype.findLatestMessageTs = function (searchText) {
|
|
146
|
+
var _a, _b;
|
|
147
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
148
|
+
var historyResponse, error_4;
|
|
149
|
+
return __generator(this, function (_c) {
|
|
150
|
+
switch (_c.label) {
|
|
151
|
+
case 0:
|
|
152
|
+
_c.trys.push([0, 2, , 3]);
|
|
153
|
+
return [4 /*yield*/, this.client.conversations.history({
|
|
154
|
+
channel: this.config.channelId,
|
|
155
|
+
})];
|
|
156
|
+
case 1:
|
|
157
|
+
historyResponse = _c.sent();
|
|
158
|
+
// Check if messages array is defined and not empty
|
|
159
|
+
if (!((_a = historyResponse.messages) === null || _a === void 0 ? void 0 : _a.length))
|
|
160
|
+
return [2 /*return*/, undefined]; // No matching messages found
|
|
161
|
+
// Find the latest message that matches the search text
|
|
162
|
+
return [2 /*return*/, (_b = historyResponse.messages.find(function (message) { return message.text === searchText; })) === null || _b === void 0 ? void 0 : _b.ts];
|
|
163
|
+
case 2:
|
|
164
|
+
error_4 = _c.sent();
|
|
165
|
+
utils_1.Logger.logError('Error searching for message:', error_4.message);
|
|
166
|
+
throw error_4;
|
|
167
|
+
case 3: return [2 /*return*/];
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
SlackApiClient.prototype.getUsersList = function (emailIds) {
|
|
173
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
174
|
+
var promises, results, error_5;
|
|
175
|
+
var _this = this;
|
|
176
|
+
return __generator(this, function (_a) {
|
|
177
|
+
switch (_a.label) {
|
|
178
|
+
case 0:
|
|
179
|
+
_a.trys.push([0, 2, , 3]);
|
|
180
|
+
promises = emailIds.map(function (email) { return _this.client.users.lookupByEmail({ email: email }); });
|
|
181
|
+
return [4 /*yield*/, Promise.all(promises)];
|
|
182
|
+
case 1:
|
|
183
|
+
results = _a.sent();
|
|
184
|
+
return [2 /*return*/, results.map(function (result) {
|
|
185
|
+
var _a, _b;
|
|
186
|
+
if (!result.ok || !((_a = result.user) === null || _a === void 0 ? void 0 : _a.id))
|
|
187
|
+
throw new Error("Failed to fetch usernames. Slack error message: ".concat(result.error));
|
|
188
|
+
return (_b = result.user) === null || _b === void 0 ? void 0 : _b.id;
|
|
189
|
+
})];
|
|
190
|
+
case 2:
|
|
191
|
+
error_5 = _a.sent();
|
|
192
|
+
utils_1.Logger.logError('Error:', error_5.message);
|
|
193
|
+
throw error_5;
|
|
194
|
+
case 3: return [2 /*return*/];
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
SlackApiClient = __decorate([
|
|
200
|
+
(0, inversify_1.injectable)(),
|
|
201
|
+
__param(0, (0, inversify_1.inject)(types_1.MISC.SlackConfig)),
|
|
202
|
+
__metadata("design:paramtypes", [Object])
|
|
203
|
+
], SlackApiClient);
|
|
204
|
+
return SlackApiClient;
|
|
205
|
+
}());
|
|
206
|
+
exports.SlackApiClient = SlackApiClient;
|
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
24
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
25
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
26
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
27
|
-
function step(op) {
|
|
28
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
29
|
-
while (_) try {
|
|
30
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
31
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
32
|
-
switch (op[0]) {
|
|
33
|
-
case 0: case 1: t = op; break;
|
|
34
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
35
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
36
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
37
|
-
default:
|
|
38
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
39
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
40
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
41
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
42
|
-
if (t[2]) _.ops.pop();
|
|
43
|
-
_.trys.pop(); continue;
|
|
44
|
-
}
|
|
45
|
-
op = body.call(thisArg, _);
|
|
46
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
47
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
51
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
52
|
-
};
|
|
53
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
-
exports.TeamCityApiClient = void 0;
|
|
55
|
-
require("reflect-metadata");
|
|
56
|
-
var teamcity_rest_api_1 = __importDefault(require("teamcity-rest-api"));
|
|
57
|
-
var inversify_1 = require("inversify");
|
|
58
|
-
var types_1 = require("../../types");
|
|
59
|
-
var TeamCityApiClient = /** @class */ (function () {
|
|
60
|
-
function TeamCityApiClient(config) {
|
|
61
|
-
this.client = teamcity_rest_api_1.default.create(config);
|
|
62
|
-
}
|
|
63
|
-
TeamCityApiClient.prototype.startBuild = function (buildId, branchName) {
|
|
64
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
-
var buildXml, build;
|
|
66
|
-
return __generator(this, function (_a) {
|
|
67
|
-
switch (_a.label) {
|
|
68
|
-
case 0:
|
|
69
|
-
buildXml = "\n <build branchName=\"".concat(branchName, "\">\n <buildType id=\"").concat(buildId, "\" />\n </build>\n ");
|
|
70
|
-
return [4 /*yield*/, this.client.builds.startBuild(buildXml)];
|
|
71
|
-
case 1:
|
|
72
|
-
build = _a.sent();
|
|
73
|
-
return [2 /*return*/, build];
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
TeamCityApiClient.prototype.startCustomBuild = function (buildId, branchName, pList) {
|
|
79
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
80
|
-
var buildXml, build;
|
|
81
|
-
return __generator(this, function (_a) {
|
|
82
|
-
switch (_a.label) {
|
|
83
|
-
case 0:
|
|
84
|
-
buildXml = "\n <build branchName=\"".concat(branchName, "\">\n <buildType id=\"").concat(buildId, "\" />\n <properties>\n <property name=\"ProjectList\" value=\"").concat(pList, "\"/>\n <property name=\"ReleaseEnvironment\" value=\"rc\"/>\n <property name=\"TriggerProjectBuilds\" value=\"all\"/>\n </properties>\n </build>\n ");
|
|
85
|
-
return [4 /*yield*/, this.client.builds.startBuild(buildXml)];
|
|
86
|
-
case 1:
|
|
87
|
-
build = _a.sent();
|
|
88
|
-
return [2 /*return*/, build];
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
};
|
|
93
|
-
TeamCityApiClient = __decorate([
|
|
94
|
-
(0, inversify_1.injectable)(),
|
|
95
|
-
__param(0, (0, inversify_1.inject)(types_1.MISC.TeamCityConfig)),
|
|
96
|
-
__metadata("design:paramtypes", [Object])
|
|
97
|
-
], TeamCityApiClient);
|
|
98
|
-
return TeamCityApiClient;
|
|
99
|
-
}());
|
|
100
|
-
exports.TeamCityApiClient = TeamCityApiClient;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
24
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
25
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
26
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
27
|
+
function step(op) {
|
|
28
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
29
|
+
while (_) try {
|
|
30
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
31
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
32
|
+
switch (op[0]) {
|
|
33
|
+
case 0: case 1: t = op; break;
|
|
34
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
35
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
36
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
37
|
+
default:
|
|
38
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
39
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
40
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
41
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
42
|
+
if (t[2]) _.ops.pop();
|
|
43
|
+
_.trys.pop(); continue;
|
|
44
|
+
}
|
|
45
|
+
op = body.call(thisArg, _);
|
|
46
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
47
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
51
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.TeamCityApiClient = void 0;
|
|
55
|
+
require("reflect-metadata");
|
|
56
|
+
var teamcity_rest_api_1 = __importDefault(require("teamcity-rest-api"));
|
|
57
|
+
var inversify_1 = require("inversify");
|
|
58
|
+
var types_1 = require("../../types");
|
|
59
|
+
var TeamCityApiClient = /** @class */ (function () {
|
|
60
|
+
function TeamCityApiClient(config) {
|
|
61
|
+
this.client = teamcity_rest_api_1.default.create(config);
|
|
62
|
+
}
|
|
63
|
+
TeamCityApiClient.prototype.startBuild = function (buildId, branchName) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
+
var buildXml, build;
|
|
66
|
+
return __generator(this, function (_a) {
|
|
67
|
+
switch (_a.label) {
|
|
68
|
+
case 0:
|
|
69
|
+
buildXml = "\n <build branchName=\"".concat(branchName, "\">\n <buildType id=\"").concat(buildId, "\" />\n </build>\n ");
|
|
70
|
+
return [4 /*yield*/, this.client.builds.startBuild(buildXml)];
|
|
71
|
+
case 1:
|
|
72
|
+
build = _a.sent();
|
|
73
|
+
return [2 /*return*/, build];
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
TeamCityApiClient.prototype.startCustomBuild = function (buildId, branchName, pList) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
80
|
+
var buildXml, build;
|
|
81
|
+
return __generator(this, function (_a) {
|
|
82
|
+
switch (_a.label) {
|
|
83
|
+
case 0:
|
|
84
|
+
buildXml = "\n <build branchName=\"".concat(branchName, "\">\n <buildType id=\"").concat(buildId, "\" />\n <properties>\n <property name=\"ProjectList\" value=\"").concat(pList, "\"/>\n <property name=\"ReleaseEnvironment\" value=\"rc\"/>\n <property name=\"TriggerProjectBuilds\" value=\"all\"/>\n </properties>\n </build>\n ");
|
|
85
|
+
return [4 /*yield*/, this.client.builds.startBuild(buildXml)];
|
|
86
|
+
case 1:
|
|
87
|
+
build = _a.sent();
|
|
88
|
+
return [2 /*return*/, build];
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
TeamCityApiClient = __decorate([
|
|
94
|
+
(0, inversify_1.injectable)(),
|
|
95
|
+
__param(0, (0, inversify_1.inject)(types_1.MISC.TeamCityConfig)),
|
|
96
|
+
__metadata("design:paramtypes", [Object])
|
|
97
|
+
], TeamCityApiClient);
|
|
98
|
+
return TeamCityApiClient;
|
|
99
|
+
}());
|
|
100
|
+
exports.TeamCityApiClient = TeamCityApiClient;
|