@clickview/ship-it 0.0.18 → 0.0.20-dev.1

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.
Files changed (138) hide show
  1. package/README.md +48 -48
  2. package/config.json +10 -10
  3. package/lib/config.json +11 -11
  4. package/lib/src/api-clients/git-lab/GitLabApiClient.js +404 -404
  5. package/lib/src/api-clients/git-lab/GitLabMapper.js +81 -81
  6. package/lib/src/api-clients/index.js +18 -18
  7. package/lib/src/api-clients/team-city/TeamCityApiClient.js +85 -85
  8. package/lib/src/commands/BumpPackagesCommand.js +84 -84
  9. package/lib/src/commands/CreateBranchCommand.js +100 -100
  10. package/lib/src/commands/CreateMergeRequestCommand.js +107 -107
  11. package/lib/src/commands/CreateReleaseNotesCommand.js +84 -84
  12. package/lib/src/commands/CreateTestingNotesCommand.js +84 -84
  13. package/lib/src/commands/InstallPackagesCommand.js +76 -76
  14. package/lib/src/commands/ListProjectsCommand.js +76 -76
  15. package/lib/src/commands/ReleaseCommand.js +129 -129
  16. package/lib/src/commands/StartConsumingProjectBuildsCommand.js +76 -76
  17. package/lib/src/commands/StatusCommand.js +88 -88
  18. package/lib/src/commands/TagMasterCommand.js +76 -76
  19. package/lib/src/commands/ValidateMergeRequestCommand.js +76 -76
  20. package/lib/src/commands/VersionCommand.js +76 -76
  21. package/lib/src/commands/index.js +29 -29
  22. package/lib/src/constants/CommandTypeMapping.js +19 -19
  23. package/lib/src/constants/GitLabMemberIds.js +6 -6
  24. package/lib/src/constants/MonorepoPackageJsonFiles.js +16 -15
  25. package/lib/src/constants/ProjectNames.js +62 -61
  26. package/lib/src/constants/TeamCityBuildIDs.js +15 -15
  27. package/lib/src/constants/index.js +19 -19
  28. package/lib/src/errors/ShipItError.js +32 -32
  29. package/lib/src/errors/index.js +17 -17
  30. package/lib/src/index.js +18 -18
  31. package/lib/src/interfaces/Config.js +2 -2
  32. package/lib/src/interfaces/MergeRequestState.js +2 -2
  33. package/lib/src/interfaces/ProjectNames.js +2 -2
  34. package/lib/src/interfaces/ShipItCommand.js +2 -2
  35. package/lib/src/interfaces/ShipItTask.js +2 -2
  36. package/lib/src/interfaces/VersionType.js +2 -2
  37. package/lib/src/interfaces/command-cli-options/MilestoneCommandCliOptions.js +2 -2
  38. package/lib/src/interfaces/command-cli-options/ReleaseCommandCliOptions.js +2 -2
  39. package/lib/src/interfaces/command-cli-options/index.js +18 -18
  40. package/lib/src/interfaces/command-options/BaseCommandOptions.js +2 -2
  41. package/lib/src/interfaces/command-options/BumpPackagesCommandOptions.js +2 -2
  42. package/lib/src/interfaces/command-options/DockerMilestoneCommandOptions.js +2 -2
  43. package/lib/src/interfaces/command-options/MilestoneCommandOptions.js +2 -2
  44. package/lib/src/interfaces/command-options/ReleaseCommandOptions.js +2 -2
  45. package/lib/src/interfaces/command-options/ValidateMRCommandOptions.js +2 -2
  46. package/lib/src/interfaces/command-options/index.js +21 -21
  47. package/lib/src/interfaces/index.js +26 -26
  48. package/lib/src/interfaces/models/Branch.js +2 -2
  49. package/lib/src/interfaces/models/Commit.js +2 -2
  50. package/lib/src/interfaces/models/CommitFile.js +2 -2
  51. package/lib/src/interfaces/models/File.js +2 -2
  52. package/lib/src/interfaces/models/Label.js +2 -2
  53. package/lib/src/interfaces/models/MergeRequest.js +2 -2
  54. package/lib/src/interfaces/models/Milestone.js +2 -2
  55. package/lib/src/interfaces/models/Project.js +2 -2
  56. package/lib/src/interfaces/models/ProjectConfig.js +9 -9
  57. package/lib/src/interfaces/models/Release.js +2 -2
  58. package/lib/src/interfaces/models/Tag.js +2 -2
  59. package/lib/src/interfaces/models/index.js +26 -26
  60. package/lib/src/interfaces/view-models/MilestoneProject.js +2 -2
  61. package/lib/src/interfaces/view-models/index.js +17 -17
  62. package/lib/src/inversify.config.js +67 -67
  63. package/lib/src/services/GitLabService.js +498 -498
  64. package/lib/src/services/TeamCityService.js +34 -34
  65. package/lib/src/services/index.js +18 -18
  66. package/lib/src/startup/AddMilestoneCommand.js +95 -95
  67. package/lib/src/startup/GetAction.js +68 -68
  68. package/lib/src/startup/SetupCommands.js +128 -127
  69. package/lib/src/tasks/BumpPackagesTask.js +229 -229
  70. package/lib/src/tasks/BumpVersionTxtTask.js +110 -110
  71. package/lib/src/tasks/CommitPackageVersionsTask.js +116 -116
  72. package/lib/src/tasks/CreateBranchTask.js +104 -104
  73. package/lib/src/tasks/CreateMergeRequestTask.js +118 -118
  74. package/lib/src/tasks/CreateReleaseNotesTask.js +122 -122
  75. package/lib/src/tasks/CreateTestingNotesTask.js +135 -135
  76. package/lib/src/tasks/InstallPackagesTask.js +399 -351
  77. package/lib/src/tasks/ListProjectsTask.js +87 -87
  78. package/lib/src/tasks/StartConsumingProjectBuildsTask.js +149 -149
  79. package/lib/src/tasks/StartMonorepoBuildTask.js +95 -95
  80. package/lib/src/tasks/TagMasterTask.js +121 -121
  81. package/lib/src/tasks/ValidateCommitsTask.js +119 -119
  82. package/lib/src/tasks/ValidateDescriptionsTask.js +151 -151
  83. package/lib/src/tasks/ValidateMergeRequestTask.js +115 -115
  84. package/lib/src/tasks/ValidateTask.js +240 -237
  85. package/lib/src/tasks/VersionTask.js +98 -98
  86. package/lib/src/tasks/index.js +33 -33
  87. package/lib/src/types.js +49 -49
  88. package/lib/src/utils/BranchNames.js +11 -11
  89. package/lib/src/utils/Commits.js +55 -55
  90. package/lib/src/utils/Csv.js +54 -54
  91. package/lib/src/utils/Descriptions.js +237 -237
  92. package/lib/src/utils/GroupIds.js +6 -6
  93. package/lib/src/utils/Logger.js +62 -62
  94. package/lib/src/utils/ProjectIds.js +47 -47
  95. package/lib/src/utils/Versions.js +20 -20
  96. package/lib/src/utils/index.js +22 -22
  97. package/package.json +47 -47
  98. package/dist/A2/A2 Testing Notes.csv +0 -518
  99. package/dist/A2/Batch.Api.md +0 -37
  100. package/dist/A2/ClickView.Curator.md +0 -17
  101. package/dist/A2/Clients.md +0 -23
  102. package/dist/A2/Discover.Api.md +0 -14
  103. package/dist/A2/FileGenerator.md +0 -8
  104. package/dist/A2/Krakend.md +0 -25
  105. package/dist/A2/Library.Api.md +0 -13
  106. package/dist/A2/Lite.md +0 -27
  107. package/dist/A2/Master.Auth.md +0 -52
  108. package/dist/A2/Objects.Api.md +0 -8
  109. package/dist/A2/Permissions.Api.md +0 -12
  110. package/dist/A2/Release Notes.md +0 -479
  111. package/dist/A2/Search.Api.md +0 -12
  112. package/dist/A2/Subjects.API.md +0 -22
  113. package/dist/A2/Users.Api.md +0 -63
  114. package/dist/A2/clickview.md +0 -83
  115. package/dist/A2/index.app.md +0 -15
  116. package/dist/Z2/Analytics Web.md +0 -7
  117. package/dist/Z2/Batch.Api.md +0 -13
  118. package/dist/Z2/ClickView Online.md +0 -19
  119. package/dist/Z2/ClickView.Cron.md +0 -8
  120. package/dist/Z2/ClickView.Curator.md +0 -39
  121. package/dist/Z2/Clients.md +0 -31
  122. package/dist/Z2/Discover.Api.md +0 -12
  123. package/dist/Z2/Domain.Api.md +0 -31
  124. package/dist/Z2/Image.Api.md +0 -12
  125. package/dist/Z2/Krakend.md +0 -33
  126. package/dist/Z2/LTI.md +0 -8
  127. package/dist/Z2/Launch.Web.md +0 -9
  128. package/dist/Z2/Library Editor.md +0 -7
  129. package/dist/Z2/Library.Api.md +0 -13
  130. package/dist/Z2/Lite.md +0 -32
  131. package/dist/Z2/Master.Auth.md +0 -16
  132. package/dist/Z2/Objects.Api.md +0 -9
  133. package/dist/Z2/Permissions.Api.md +0 -0
  134. package/dist/Z2/Prospect.Api.md +0 -17
  135. package/dist/Z2/RealtimeSalesforceSync.md +0 -19
  136. package/dist/Z2/Release Notes.md +0 -549
  137. package/dist/Z2/Users.Api.md +0 -13
  138. package/dist/Z2/clickview.md +0 -135
@@ -1,81 +1,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
- title: m.title,
9
- description: m.description,
10
- status: m.state,
11
- projectId: m.project_id,
12
- mergeCommit: m.merge_commit_sha,
13
- author: m.author.name,
14
- assignee: (_a = m.assignee) === null || _a === void 0 ? void 0 : _a.name,
15
- url: m.web_url,
16
- hasConflicts: m.has_conflicts,
17
- targetBranch: m.target_branch,
18
- sourceBranch: m.source_branch,
19
- milestone: exports.GitLabMapper.milestone(m.milestone),
20
- labels: m.labels,
21
- dateCreated: m.created_at
22
- };
23
- },
24
- project: function (p) {
25
- return {
26
- id: p.id,
27
- title: p.name,
28
- url: p.web_url
29
- };
30
- },
31
- tag: function (t) {
32
- return {
33
- name: t.name,
34
- target: t.commit.id
35
- };
36
- },
37
- commit: function (c) {
38
- return {
39
- id: c.id,
40
- title: c.title,
41
- message: c.message,
42
- parentIds: c.parent_ids
43
- };
44
- },
45
- branch: function (b) {
46
- return {
47
- name: b.name
48
- };
49
- },
50
- file: function (f) {
51
- return {
52
- name: f.file_name,
53
- path: f.file_path,
54
- content: f.content
55
- };
56
- },
57
- milestone: function (m) {
58
- if (!m)
59
- return null;
60
- return {
61
- id: m.id,
62
- name: m.title
63
- };
64
- },
65
- label: function (m) {
66
- return {
67
- name: m.name,
68
- description: m.description
69
- };
70
- },
71
- release: function (m) {
72
- var _a;
73
- return {
74
- name: m.name,
75
- tag: m.tag_name,
76
- description: m.description,
77
- ref: m.commit.id,
78
- milestones: (_a = m.milestones) === null || _a === void 0 ? void 0 : _a.map(function (m) { return m.title; })
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
+ title: m.title,
9
+ description: m.description,
10
+ status: m.state,
11
+ projectId: m.project_id,
12
+ mergeCommit: m.merge_commit_sha,
13
+ author: m.author.name,
14
+ assignee: (_a = m.assignee) === null || _a === void 0 ? void 0 : _a.name,
15
+ url: m.web_url,
16
+ hasConflicts: m.has_conflicts,
17
+ targetBranch: m.target_branch,
18
+ sourceBranch: m.source_branch,
19
+ milestone: exports.GitLabMapper.milestone(m.milestone),
20
+ labels: m.labels,
21
+ dateCreated: m.created_at
22
+ };
23
+ },
24
+ project: function (p) {
25
+ return {
26
+ id: p.id,
27
+ title: p.name,
28
+ url: p.web_url
29
+ };
30
+ },
31
+ tag: function (t) {
32
+ return {
33
+ name: t.name,
34
+ target: t.commit.id
35
+ };
36
+ },
37
+ commit: function (c) {
38
+ return {
39
+ id: c.id,
40
+ title: c.title,
41
+ message: c.message,
42
+ parentIds: c.parent_ids
43
+ };
44
+ },
45
+ branch: function (b) {
46
+ return {
47
+ name: b.name
48
+ };
49
+ },
50
+ file: function (f) {
51
+ return {
52
+ name: f.file_name,
53
+ path: f.file_path,
54
+ content: f.content
55
+ };
56
+ },
57
+ milestone: function (m) {
58
+ if (!m)
59
+ return null;
60
+ return {
61
+ id: m.id,
62
+ name: m.title
63
+ };
64
+ },
65
+ label: function (m) {
66
+ return {
67
+ name: m.name,
68
+ description: m.description
69
+ };
70
+ },
71
+ release: function (m) {
72
+ var _a;
73
+ return {
74
+ name: m.name,
75
+ tag: m.tag_name,
76
+ description: m.description,
77
+ ref: m.commit.id,
78
+ milestones: (_a = m.milestones) === null || _a === void 0 ? void 0 : _a.map(function (m) { return m.title; })
79
+ };
80
+ }
81
+ };
@@ -1,18 +1,18 @@
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);
@@ -1,85 +1,85 @@
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 = __decorate([
79
- (0, inversify_1.injectable)(),
80
- __param(0, (0, inversify_1.inject)(types_1.MISC.TeamCityConfig)),
81
- __metadata("design:paramtypes", [Object])
82
- ], TeamCityApiClient);
83
- return TeamCityApiClient;
84
- }());
85
- 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 = __decorate([
79
+ (0, inversify_1.injectable)(),
80
+ __param(0, (0, inversify_1.inject)(types_1.MISC.TeamCityConfig)),
81
+ __metadata("design:paramtypes", [Object])
82
+ ], TeamCityApiClient);
83
+ return TeamCityApiClient;
84
+ }());
85
+ exports.TeamCityApiClient = TeamCityApiClient;
@@ -1,84 +1,84 @@
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.BumpPackagesCommand = void 0;
52
- require("reflect-metadata");
53
- var inversify_1 = require("inversify");
54
- var types_1 = require("../types");
55
- var BumpPackagesCommand = /** @class */ (function () {
56
- function BumpPackagesCommand(bumpPackagesTask, commitPackageVersionsTask) {
57
- this.bumpPackagesTask = bumpPackagesTask;
58
- this.commitPackageVersionsTask = commitPackageVersionsTask;
59
- }
60
- BumpPackagesCommand.prototype.run = function (options) {
61
- return __awaiter(this, void 0, void 0, function () {
62
- var cont;
63
- return __generator(this, function (_a) {
64
- switch (_a.label) {
65
- case 0: return [4 /*yield*/, this.bumpPackagesTask.run(options)];
66
- case 1:
67
- cont = _a.sent();
68
- if (!cont)
69
- return [2 /*return*/, false];
70
- return [4 /*yield*/, this.commitPackageVersionsTask.run(options)];
71
- case 2: return [2 /*return*/, _a.sent()];
72
- }
73
- });
74
- });
75
- };
76
- BumpPackagesCommand = __decorate([
77
- (0, inversify_1.injectable)(),
78
- __param(0, (0, inversify_1.inject)(types_1.TASKS.BumpPackagesTask)),
79
- __param(1, (0, inversify_1.inject)(types_1.TASKS.CommitPackageVersionsTask)),
80
- __metadata("design:paramtypes", [Object, Object])
81
- ], BumpPackagesCommand);
82
- return BumpPackagesCommand;
83
- }());
84
- exports.BumpPackagesCommand = BumpPackagesCommand;
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.BumpPackagesCommand = void 0;
52
+ require("reflect-metadata");
53
+ var inversify_1 = require("inversify");
54
+ var types_1 = require("../types");
55
+ var BumpPackagesCommand = /** @class */ (function () {
56
+ function BumpPackagesCommand(bumpPackagesTask, commitPackageVersionsTask) {
57
+ this.bumpPackagesTask = bumpPackagesTask;
58
+ this.commitPackageVersionsTask = commitPackageVersionsTask;
59
+ }
60
+ BumpPackagesCommand.prototype.run = function (options) {
61
+ return __awaiter(this, void 0, void 0, function () {
62
+ var cont;
63
+ return __generator(this, function (_a) {
64
+ switch (_a.label) {
65
+ case 0: return [4 /*yield*/, this.bumpPackagesTask.run(options)];
66
+ case 1:
67
+ cont = _a.sent();
68
+ if (!cont)
69
+ return [2 /*return*/, false];
70
+ return [4 /*yield*/, this.commitPackageVersionsTask.run(options)];
71
+ case 2: return [2 /*return*/, _a.sent()];
72
+ }
73
+ });
74
+ });
75
+ };
76
+ BumpPackagesCommand = __decorate([
77
+ (0, inversify_1.injectable)(),
78
+ __param(0, (0, inversify_1.inject)(types_1.TASKS.BumpPackagesTask)),
79
+ __param(1, (0, inversify_1.inject)(types_1.TASKS.CommitPackageVersionsTask)),
80
+ __metadata("design:paramtypes", [Object, Object])
81
+ ], BumpPackagesCommand);
82
+ return BumpPackagesCommand;
83
+ }());
84
+ exports.BumpPackagesCommand = BumpPackagesCommand;