@salesforce/plugin-devops-center 0.1.0-beta.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 (135) hide show
  1. package/LICENSE.txt +12 -0
  2. package/README.md +245 -0
  3. package/lib/commands/deploy/pipeline/report.d.ts +15 -0
  4. package/lib/commands/deploy/pipeline/report.js +42 -0
  5. package/lib/commands/deploy/pipeline/report.js.map +1 -0
  6. package/lib/commands/deploy/pipeline/resume.d.ts +12 -0
  7. package/lib/commands/deploy/pipeline/resume.js +28 -0
  8. package/lib/commands/deploy/pipeline/resume.js.map +1 -0
  9. package/lib/commands/deploy/pipeline.d.ts +26 -0
  10. package/lib/commands/deploy/pipeline.js +50 -0
  11. package/lib/commands/deploy/pipeline.js.map +1 -0
  12. package/lib/common/base/abstractPromote.d.ts +69 -0
  13. package/lib/common/base/abstractPromote.js +173 -0
  14. package/lib/common/base/abstractPromote.js.map +1 -0
  15. package/lib/common/base/abstractReportOnPromote.d.ts +17 -0
  16. package/lib/common/base/abstractReportOnPromote.js +64 -0
  17. package/lib/common/base/abstractReportOnPromote.js.map +1 -0
  18. package/lib/common/base/abstractResume.d.ts +37 -0
  19. package/lib/common/base/abstractResume.js +90 -0
  20. package/lib/common/base/abstractResume.js.map +1 -0
  21. package/lib/common/constants.d.ts +9 -0
  22. package/lib/common/constants.js +20 -0
  23. package/lib/common/constants.js.map +1 -0
  24. package/lib/common/deployPipelineCache.d.ts +39 -0
  25. package/lib/common/deployPipelineCache.js +81 -0
  26. package/lib/common/deployPipelineCache.js.map +1 -0
  27. package/lib/common/flags/flags.d.ts +19 -0
  28. package/lib/common/flags/flags.js +84 -0
  29. package/lib/common/flags/flags.js.map +1 -0
  30. package/lib/common/flags/promote/promoteFlags.d.ts +12 -0
  31. package/lib/common/flags/promote/promoteFlags.js +52 -0
  32. package/lib/common/flags/promote/promoteFlags.js.map +1 -0
  33. package/lib/common/index.d.ts +2 -0
  34. package/lib/common/index.js +18 -0
  35. package/lib/common/index.js.map +1 -0
  36. package/lib/common/outputColumns.d.ts +17 -0
  37. package/lib/common/outputColumns.js +24 -0
  38. package/lib/common/outputColumns.js.map +1 -0
  39. package/lib/common/outputService/aorOutputService.d.ts +43 -0
  40. package/lib/common/outputService/aorOutputService.js +50 -0
  41. package/lib/common/outputService/aorOutputService.js.map +1 -0
  42. package/lib/common/outputService/deployCommandOutputService.d.ts +12 -0
  43. package/lib/common/outputService/deployCommandOutputService.js +28 -0
  44. package/lib/common/outputService/deployCommandOutputService.js.map +1 -0
  45. package/lib/common/outputService/deploySummaryBuilder.d.ts +32 -0
  46. package/lib/common/outputService/deploySummaryBuilder.js +185 -0
  47. package/lib/common/outputService/deploySummaryBuilder.js.map +1 -0
  48. package/lib/common/outputService/deploymentResultOutputService.d.ts +23 -0
  49. package/lib/common/outputService/deploymentResultOutputService.js +18 -0
  50. package/lib/common/outputService/deploymentResultOutputService.js.map +1 -0
  51. package/lib/common/outputService/index.d.ts +6 -0
  52. package/lib/common/outputService/index.js +20 -0
  53. package/lib/common/outputService/index.js.map +1 -0
  54. package/lib/common/outputService/outputService.d.ts +27 -0
  55. package/lib/common/outputService/outputService.js +30 -0
  56. package/lib/common/outputService/outputService.js.map +1 -0
  57. package/lib/common/outputService/outputServiceFactory.d.ts +27 -0
  58. package/lib/common/outputService/outputServiceFactory.js +39 -0
  59. package/lib/common/outputService/outputServiceFactory.js.map +1 -0
  60. package/lib/common/outputService/outputUtils.d.ts +3 -0
  61. package/lib/common/outputService/outputUtils.js +26 -0
  62. package/lib/common/outputService/outputUtils.js.map +1 -0
  63. package/lib/common/outputService/promoteOutputService.d.ts +30 -0
  64. package/lib/common/outputService/promoteOutputService.js +55 -0
  65. package/lib/common/outputService/promoteOutputService.js.map +1 -0
  66. package/lib/common/outputService/reportOutputService.d.ts +21 -0
  67. package/lib/common/outputService/reportOutputService.js +54 -0
  68. package/lib/common/outputService/reportOutputService.js.map +1 -0
  69. package/lib/common/outputService/resumeCommandOutputService.d.ts +12 -0
  70. package/lib/common/outputService/resumeCommandOutputService.js +30 -0
  71. package/lib/common/outputService/resumeCommandOutputService.js.map +1 -0
  72. package/lib/common/outputService/resumeOutputService.d.ts +15 -0
  73. package/lib/common/outputService/resumeOutputService.js +19 -0
  74. package/lib/common/outputService/resumeOutputService.js.map +1 -0
  75. package/lib/common/selectors/asyncOperationResultsSelector.d.ts +7 -0
  76. package/lib/common/selectors/asyncOperationResultsSelector.js +21 -0
  77. package/lib/common/selectors/asyncOperationResultsSelector.js.map +1 -0
  78. package/lib/common/selectors/deployComponentsSelector.d.ts +3 -0
  79. package/lib/common/selectors/deployComponentsSelector.js +18 -0
  80. package/lib/common/selectors/deployComponentsSelector.js.map +1 -0
  81. package/lib/common/selectors/deployProgressSummarySelector.d.ts +13 -0
  82. package/lib/common/selectors/deployProgressSummarySelector.js +24 -0
  83. package/lib/common/selectors/deployProgressSummarySelector.js.map +1 -0
  84. package/lib/common/selectors/deploymentResultsSelector.d.ts +7 -0
  85. package/lib/common/selectors/deploymentResultsSelector.js +24 -0
  86. package/lib/common/selectors/deploymentResultsSelector.js.map +1 -0
  87. package/lib/common/selectors/environmentSelector.d.ts +11 -0
  88. package/lib/common/selectors/environmentSelector.js +22 -0
  89. package/lib/common/selectors/environmentSelector.js.map +1 -0
  90. package/lib/common/selectors/namedCredentialSelector.d.ts +6 -0
  91. package/lib/common/selectors/namedCredentialSelector.js +24 -0
  92. package/lib/common/selectors/namedCredentialSelector.js.map +1 -0
  93. package/lib/common/selectors/pipelineStageSelector.d.ts +7 -0
  94. package/lib/common/selectors/pipelineStageSelector.js +22 -0
  95. package/lib/common/selectors/pipelineStageSelector.js.map +1 -0
  96. package/lib/common/selectors/workItemSelector.d.ts +11 -0
  97. package/lib/common/selectors/workItemSelector.js +22 -0
  98. package/lib/common/selectors/workItemSelector.js.map +1 -0
  99. package/lib/common/types.d.ts +98 -0
  100. package/lib/common/types.js +24 -0
  101. package/lib/common/types.js.map +1 -0
  102. package/lib/common/utils.d.ts +75 -0
  103. package/lib/common/utils.js +176 -0
  104. package/lib/common/utils.js.map +1 -0
  105. package/lib/configMeta.d.ts +13 -0
  106. package/lib/configMeta.js +28 -0
  107. package/lib/configMeta.js.map +1 -0
  108. package/lib/streamer/doceMonitor.d.ts +7 -0
  109. package/lib/streamer/doceMonitor.js +9 -0
  110. package/lib/streamer/doceMonitor.js.map +1 -0
  111. package/lib/streamer/doceStream.d.ts +20 -0
  112. package/lib/streamer/doceStream.js +33 -0
  113. package/lib/streamer/doceStream.js.map +1 -0
  114. package/lib/streamer/processors/asyncOpStream.d.ts +20 -0
  115. package/lib/streamer/processors/asyncOpStream.js +48 -0
  116. package/lib/streamer/processors/asyncOpStream.js.map +1 -0
  117. package/lib/streamer/sObjectStream.d.ts +22 -0
  118. package/lib/streamer/sObjectStream.js +40 -0
  119. package/lib/streamer/sObjectStream.js.map +1 -0
  120. package/messages/aorOperations.output.md +8 -0
  121. package/messages/cache.md +3 -0
  122. package/messages/commonErrors.md +31 -0
  123. package/messages/commonFlags.md +53 -0
  124. package/messages/config.md +3 -0
  125. package/messages/deploy.output.md +31 -0
  126. package/messages/deploy.pipeline.md +37 -0
  127. package/messages/deploy.pipeline.report.md +49 -0
  128. package/messages/deploy.pipeline.resume.md +23 -0
  129. package/messages/promoteFlags.md +53 -0
  130. package/messages/resume.output.md +4 -0
  131. package/oclif.manifest.json +247 -0
  132. package/package.json +115 -0
  133. package/schemas/deploy-pipeline-report.json +25 -0
  134. package/schemas/deploy-pipeline-resume.json +25 -0
  135. package/schemas/deploy-pipeline.json +25 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploymentResultsSelector.js","sourceRoot":"","sources":["../../../src/common/selectors/deploymentResultsSelector.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAKH;;;GAGG;AACI,KAAK,UAAU,qCAAqC,CACzD,GAAe,EACf,UAAkB;IAElB,MAAM,QAAQ,GAAG;;;;;uDAKoC,UAAU,GAAG,CAAC;IACnE,OAAO,GAAG,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AACzC,CAAC;AAXD,sFAWC"}
@@ -0,0 +1,11 @@
1
+ import { QueryResult } from 'jsforce';
2
+ import { Connection } from '@salesforce/core';
3
+ import { PipelineStage } from '../types';
4
+ export type EnvQueryResult = {
5
+ sf_devops__Named_Credential__c: string;
6
+ sf_devops__Pipeline_Stages__r: QueryResult<PipelineStage>;
7
+ };
8
+ /**
9
+ * Returns the named credential and pipeline stage name associated with the envId sent
10
+ */
11
+ export declare function selectPipelineStageByEnvironment(con: Connection, envId: string): Promise<EnvQueryResult>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2023, salesforce.com, inc.
4
+ * All rights reserved.
5
+ * Licensed under the BSD 3-Clause license.
6
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.selectPipelineStageByEnvironment = void 0;
10
+ /**
11
+ * Returns the named credential and pipeline stage name associated with the envId sent
12
+ */
13
+ async function selectPipelineStageByEnvironment(con, envId) {
14
+ const queryStr = `SELECT sf_devops__Named_Credential__c,
15
+ (SELECT Name FROM sf_devops__Pipeline_Stages__r)
16
+ FROM sf_devops__Environment__c
17
+ WHERE Id = '${envId}'`;
18
+ const resp = await con.query(queryStr);
19
+ return resp.records[0];
20
+ }
21
+ exports.selectPipelineStageByEnvironment = selectPipelineStageByEnvironment;
22
+ //# sourceMappingURL=environmentSelector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environmentSelector.js","sourceRoot":"","sources":["../../../src/common/selectors/environmentSelector.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAYH;;GAEG;AACI,KAAK,UAAU,gCAAgC,CAAC,GAAe,EAAE,KAAa;IACnF,MAAM,QAAQ,GAAG;;;kCAGe,KAAK,GAAG,CAAC;IACzC,MAAM,IAAI,GAAgC,MAAM,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACpE,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACzB,CAAC;AAPD,4EAOC"}
@@ -0,0 +1,6 @@
1
+ import { Connection } from '@salesforce/core';
2
+ import { NamedCredential } from '../types';
3
+ /**
4
+ * Given a named credential it returns the org url (endpoint) associated with it
5
+ */
6
+ export declare function selectNamedCredentialByName(con: Connection, name: string): Promise<NamedCredential>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2023, salesforce.com, inc.
4
+ * All rights reserved.
5
+ * Licensed under the BSD 3-Clause license.
6
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.selectNamedCredentialByName = void 0;
10
+ /**
11
+ * Given a named credential it returns the org url (endpoint) associated with it
12
+ */
13
+ async function selectNamedCredentialByName(con, name) {
14
+ const queryStr = `
15
+ SELECT Endpoint
16
+ FROM NamedCredential
17
+ WHERE DeveloperName = '${name}'
18
+ AND NamespacePrefix = 'sf_devops'
19
+ LIMIT 1`;
20
+ const resp = await con.query(queryStr);
21
+ return resp.records[0];
22
+ }
23
+ exports.selectNamedCredentialByName = selectNamedCredentialByName;
24
+ //# sourceMappingURL=namedCredentialSelector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"namedCredentialSelector.js","sourceRoot":"","sources":["../../../src/common/selectors/namedCredentialSelector.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAMH;;GAEG;AACI,KAAK,UAAU,2BAA2B,CAAC,GAAe,EAAE,IAAY;IAC7E,MAAM,QAAQ,GAAG;;;6BAGU,IAAI;;YAErB,CAAC;IACX,MAAM,IAAI,GAAiC,MAAM,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACrE,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACzB,CAAC;AATD,kEASC"}
@@ -0,0 +1,7 @@
1
+ import { Connection } from '@salesforce/core';
2
+ import { PipelineStage } from '../types';
3
+ /**
4
+ *
5
+ * Returns an array of a pipeline stages filtering by project name.
6
+ */
7
+ export declare function selectPipelineStagesByProject(con: Connection, projectName: string): Promise<PipelineStage[]>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2023, salesforce.com, inc.
4
+ * All rights reserved.
5
+ * Licensed under the BSD 3-Clause license.
6
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.selectPipelineStagesByProject = void 0;
10
+ /**
11
+ *
12
+ * Returns an array of a pipeline stages filtering by project name.
13
+ */
14
+ async function selectPipelineStagesByProject(con, projectName) {
15
+ const queryStr = `SELECT Id, sf_devops__Pipeline__r.sf_devops__Project__c, sf_devops__Branch__r.sf_devops__Name__c, (SELECT Id FROM sf_devops__Pipeline_Stages__r)
16
+ FROM sf_devops__Pipeline_Stage__c
17
+ WHERE sf_devops__Pipeline__r.sf_devops__Project__r.Name = '${projectName}'`;
18
+ const resp = await con.query(queryStr);
19
+ return resp.records;
20
+ }
21
+ exports.selectPipelineStagesByProject = selectPipelineStagesByProject;
22
+ //# sourceMappingURL=pipelineStageSelector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipelineStageSelector.js","sourceRoot":"","sources":["../../../src/common/selectors/pipelineStageSelector.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAMH;;;GAGG;AACI,KAAK,UAAU,6BAA6B,CAAC,GAAe,EAAE,WAAmB;IACtF,MAAM,QAAQ,GAAG;;iFAE8D,WAAW,GAAG,CAAC;IAC9F,MAAM,IAAI,GAA+B,MAAM,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACnE,OAAO,IAAI,CAAC,OAAO,CAAC;AACtB,CAAC;AAND,sEAMC"}
@@ -0,0 +1,11 @@
1
+ import { QueryResult } from 'jsforce';
2
+ import { Connection } from '@salesforce/core';
3
+ import { WorkItem } from '../types';
4
+ export type WorkItemsQueryResult = {
5
+ Id: string;
6
+ sf_devops__Work_Items__r: QueryResult<WorkItem>;
7
+ };
8
+ /**
9
+ * Returns the work items included in the change bundles sent
10
+ */
11
+ export declare function selectWorkItemsByChangeBundles(con: Connection, changeBundles: string[]): Promise<WorkItemsQueryResult[]>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2023, salesforce.com, inc.
4
+ * All rights reserved.
5
+ * Licensed under the BSD 3-Clause license.
6
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.selectWorkItemsByChangeBundles = void 0;
10
+ /**
11
+ * Returns the work items included in the change bundles sent
12
+ */
13
+ async function selectWorkItemsByChangeBundles(con, changeBundles) {
14
+ const queryStr = `SELECT Id,
15
+ (SELECT Name FROM sf_devops__Work_Items__r)
16
+ FROM sf_devops__Change_Bundle__c
17
+ WHERE Id IN (${changeBundles.map((id) => "'" + id + "'").join(', ')})`;
18
+ const resp = await con.query(queryStr);
19
+ return resp.records;
20
+ }
21
+ exports.selectWorkItemsByChangeBundles = selectWorkItemsByChangeBundles;
22
+ //# sourceMappingURL=workItemSelector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workItemSelector.js","sourceRoot":"","sources":["../../../src/common/selectors/workItemSelector.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAYH;;GAEG;AACI,KAAK,UAAU,8BAA8B,CAClD,GAAe,EACf,aAAuB;IAEvB,MAAM,QAAQ,GAAG;;;mCAGgB,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;IACzF,MAAM,IAAI,GAAsC,MAAM,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC1E,OAAO,IAAI,CAAC,OAAO,CAAC;AACtB,CAAC;AAVD,wEAUC"}
@@ -0,0 +1,98 @@
1
+ export type PromotePipelineResult = {
2
+ jobId: string;
3
+ status?: string;
4
+ message?: string;
5
+ errorDetails?: string;
6
+ };
7
+ export type Pipeline = {
8
+ sf_devops__Project__c: string;
9
+ };
10
+ export type PipelineStage = {
11
+ Id: string;
12
+ Name: string;
13
+ sf_devops__Branch__r: Branch;
14
+ sf_devops__Pipeline__r: Pipeline;
15
+ sf_devops__Pipeline_Stages__r?: PreviousPipelineStages;
16
+ sf_devops__Environment__r: Environment;
17
+ };
18
+ export type PreviousPipelineStages = {
19
+ records: PipelineStage[];
20
+ };
21
+ export type Branch = {
22
+ sf_devops__Name__c: string;
23
+ };
24
+ export declare enum TestLevel {
25
+ NoTestRun = "NoTestRun",
26
+ RunSpecifiedTests = "RunSpecifiedTests",
27
+ RunLocalTests = "RunLocalTests",
28
+ RunAllTestsInOrg = "RunAllTestsInOrg"
29
+ }
30
+ export interface ApiError extends Error {
31
+ errorCode: string;
32
+ name: string;
33
+ }
34
+ export type WorkItem = {
35
+ Name: string;
36
+ };
37
+ export type WorkItemPromote = {
38
+ sf_devops__Pipeline_Stage__r: PipelineStage;
39
+ sf_devops__Work_Item__r: WorkItem;
40
+ };
41
+ export type Environment = {
42
+ Id: string;
43
+ sf_devops__Named_Credential__c: string;
44
+ };
45
+ export type ChangeBundleInstall = {
46
+ sf_devops__Environment__r: Environment;
47
+ sf_devops__Change_Bundle__r: ChangeBundle;
48
+ };
49
+ export type ChangeBundle = {
50
+ Id: string;
51
+ sf_devops__Version_Name__c: string;
52
+ };
53
+ export type PromoteOptions = {
54
+ fullDeploy: boolean;
55
+ testLevel: string;
56
+ runTests: string;
57
+ undeployedOnly: boolean;
58
+ checkDeploy: boolean;
59
+ deploymentId: string;
60
+ };
61
+ export type DeploymentResult = {
62
+ sf_devops__Full_Deploy__c: boolean;
63
+ sf_devops__Check_Deploy__c: boolean;
64
+ sf_devops__Completion_Date__c: string;
65
+ sf_devops__Test_Level__c: string;
66
+ sf_devops__Run_Tests__c: string;
67
+ sf_devops__Status__r: AsyncOperationResult;
68
+ };
69
+ export type AsyncOperationResult = {
70
+ Id: string;
71
+ CreatedDate?: string;
72
+ CreatedById?: string;
73
+ CreatedBy?: User;
74
+ LastModifiedDate?: string;
75
+ sf_devops__Message__c?: string;
76
+ sf_devops__Status__c?: AsyncOperationStatus;
77
+ sf_devops__Error_Details__c?: string;
78
+ };
79
+ export type User = {
80
+ Id?: string;
81
+ Name: string;
82
+ };
83
+ export declare enum AsyncOperationStatus {
84
+ Error = "Error",
85
+ Completed = "Completed",
86
+ Ignored = "Ignored",
87
+ InProgress = "In Progress"
88
+ }
89
+ export type NamedCredential = {
90
+ Endpoint: string;
91
+ };
92
+ export type DeployComponent = {
93
+ sf_devops__Source_Component__c: string;
94
+ sf_devops__Operation__c: string;
95
+ sf_devops__File_Path__c: string;
96
+ Type?: string;
97
+ Name?: string;
98
+ };
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2022, salesforce.com, inc.
4
+ * All rights reserved.
5
+ * Licensed under the BSD 3-Clause license.
6
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.AsyncOperationStatus = exports.TestLevel = void 0;
10
+ var TestLevel;
11
+ (function (TestLevel) {
12
+ TestLevel["NoTestRun"] = "NoTestRun";
13
+ TestLevel["RunSpecifiedTests"] = "RunSpecifiedTests";
14
+ TestLevel["RunLocalTests"] = "RunLocalTests";
15
+ TestLevel["RunAllTestsInOrg"] = "RunAllTestsInOrg";
16
+ })(TestLevel = exports.TestLevel || (exports.TestLevel = {}));
17
+ var AsyncOperationStatus;
18
+ (function (AsyncOperationStatus) {
19
+ AsyncOperationStatus["Error"] = "Error";
20
+ AsyncOperationStatus["Completed"] = "Completed";
21
+ AsyncOperationStatus["Ignored"] = "Ignored";
22
+ AsyncOperationStatus["InProgress"] = "In Progress";
23
+ })(AsyncOperationStatus = exports.AsyncOperationStatus || (exports.AsyncOperationStatus = {}));
24
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/common/types.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AA8BH,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,oCAAuB,CAAA;IACvB,oDAAuC,CAAA;IACvC,4CAA+B,CAAA;IAC/B,kDAAqC,CAAA;AACvC,CAAC,EALW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAKpB;AAiED,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,uCAAe,CAAA;IACf,+CAAuB,CAAA;IACvB,2CAAmB,CAAA;IACnB,kDAA0B,CAAA;AAC5B,CAAC,EALW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAK/B"}
@@ -0,0 +1,75 @@
1
+ import { Connection, Org } from '@salesforce/core';
2
+ import { Duration } from '@salesforce/kit';
3
+ import { Nullable } from '@salesforce/ts-types';
4
+ import { PipelineStage, TestLevel } from '../common';
5
+ import AsyncOpStreaming from '../streamer/processors/asyncOpStream';
6
+ import { AorOutputService } from './outputService/aorOutputService';
7
+ import { AsyncOperationResult, DeployComponent } from './types';
8
+ /**
9
+ * @description validates the following:
10
+ * - if RunSpecifiedTests is specified, then it needs to indicate tests to run.
11
+ * - if other than RunSpecifiedTests is specified, then it can't indicate tests to run.
12
+ * @param testLevel specified test level
13
+ * @param tests specific tests to run
14
+ */
15
+ export declare function validateTestFlags(testLevel: Nullable<TestLevel>, tests: Nullable<string[]>): void;
16
+ /**
17
+ *
18
+ * Query the target org to get a pipeline stage filtering by project name and branch name.
19
+ * Also uses the same query to validate that Devops Center is installed in the target org.
20
+ *
21
+ * @param targetOrg Org. Target org.
22
+ * @param projectName string. Name of the project.
23
+ * @param branchName string. Name of the branch.
24
+ * @throws if Devops Center is not installed in the target org.
25
+ * @throws if it cant' find the given project.
26
+ * @throws if it cant' find the a pipeline stge that matches the given branch.
27
+ */
28
+ export declare function fetchAndValidatePipelineStage(targetOrg: Org, projectName: string, branchName: string): Promise<PipelineStage>;
29
+ export declare function fetchAsyncOperationResult(con: Connection, aorId: string): Promise<AsyncOperationResult>;
30
+ export declare function getAsyncOperationStreamer(org: Org, waitTime: Duration, idToInspect: string, outputService: AorOutputService): AsyncOpStreaming;
31
+ /**
32
+ *
33
+ * Helper to inspect an array of SF ids to check if it contains the given Id,
34
+ * independently if it is a 15 or 18 characters long.
35
+ *
36
+ * @param idsToInspect array of ids which might contain the given id
37
+ * @param idToFind id to look for
38
+ * @returns true is the array contains the given id
39
+ */
40
+ export declare function containsSfId(idsToInspect: string[], idToFind: string): boolean;
41
+ /**
42
+ *
43
+ * Helper to compare to SF Ids independently if they are 15 or 18 characters long.
44
+ *
45
+ * @param firstId
46
+ * @param secondId
47
+ * @returns true is the Ids match
48
+ */
49
+ export declare function matchesSfId(firstId: string, secondId: string): boolean;
50
+ /**
51
+ * Helper to convert an sObject into an array of {key : value}
52
+ * and format the keys.
53
+ *
54
+ * @param sObj sObject to convert.
55
+ * @returns an array of {key : value}
56
+ */
57
+ export declare function sObjectToArrayOfKeyValue(sObj: object): Array<{
58
+ key: string;
59
+ value: unknown;
60
+ }>;
61
+ /**
62
+ * Helper to remove the prefix, sufix and underscores in a DOCe sObject field name.
63
+ *
64
+ * @param fieldName DOCe field name.
65
+ * @returns formatted field name.
66
+ */
67
+ export declare function formatFieldName(fieldName: string): string;
68
+ /**
69
+ * Helper to return a formatted DeployComponent list (Type/Name filled).
70
+ *
71
+ * @param con The connection needed for the query
72
+ * @param asyncOpId The Id of the AsyncOperation
73
+ * @returns A list of DeployComponent
74
+ */
75
+ export declare function getFormattedDeployComponentsByAyncOpId(con: Connection, asyncOpId: string): Promise<DeployComponent[]>;
@@ -0,0 +1,176 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2022, salesforce.com, inc.
4
+ * All rights reserved.
5
+ * Licensed under the BSD 3-Clause license.
6
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.getFormattedDeployComponentsByAyncOpId = exports.formatFieldName = exports.sObjectToArrayOfKeyValue = exports.matchesSfId = exports.containsSfId = exports.getAsyncOperationStreamer = exports.fetchAsyncOperationResult = exports.fetchAndValidatePipelineStage = exports.validateTestFlags = void 0;
10
+ const core_1 = require("@salesforce/core");
11
+ const ts_types_1 = require("@salesforce/ts-types");
12
+ const common_1 = require("../common");
13
+ const pipelineStageSelector_1 = require("../common/selectors/pipelineStageSelector");
14
+ const asyncOpStream_1 = require("../streamer/processors/asyncOpStream");
15
+ const outputUtils_1 = require("./outputService/outputUtils");
16
+ const asyncOperationResultsSelector_1 = require("./selectors/asyncOperationResultsSelector");
17
+ const deployComponentsSelector_1 = require("./selectors/deployComponentsSelector");
18
+ core_1.Messages.importMessagesDirectory(__dirname);
19
+ const messages = core_1.Messages.loadMessages('@salesforce/plugin-devops-center', 'commonErrors');
20
+ /**
21
+ * @description validates the following:
22
+ * - if RunSpecifiedTests is specified, then it needs to indicate tests to run.
23
+ * - if other than RunSpecifiedTests is specified, then it can't indicate tests to run.
24
+ * @param testLevel specified test level
25
+ * @param tests specific tests to run
26
+ */
27
+ function validateTestFlags(testLevel, tests) {
28
+ if (testLevel === common_1.TestLevel.RunSpecifiedTests && (tests ?? []).length === 0) {
29
+ throw messages.createError('error.NoTestsSpecified');
30
+ }
31
+ else if (testLevel !== common_1.TestLevel.RunSpecifiedTests && tests) {
32
+ throw messages.createError('error.InvalidRunTests');
33
+ }
34
+ }
35
+ exports.validateTestFlags = validateTestFlags;
36
+ /**
37
+ *
38
+ * Query the target org to get a pipeline stage filtering by project name and branch name.
39
+ * Also uses the same query to validate that Devops Center is installed in the target org.
40
+ *
41
+ * @param targetOrg Org. Target org.
42
+ * @param projectName string. Name of the project.
43
+ * @param branchName string. Name of the branch.
44
+ * @throws if Devops Center is not installed in the target org.
45
+ * @throws if it cant' find the given project.
46
+ * @throws if it cant' find the a pipeline stge that matches the given branch.
47
+ */
48
+ async function fetchAndValidatePipelineStage(targetOrg, projectName, branchName) {
49
+ let stages;
50
+ try {
51
+ stages = await (0, pipelineStageSelector_1.selectPipelineStagesByProject)(targetOrg.getConnection(), projectName);
52
+ }
53
+ catch (err) {
54
+ const error = err;
55
+ if (error.errorCode === 'INVALID_TYPE') {
56
+ throw messages.createError('error.DevopsAppNotInstalled');
57
+ }
58
+ throw new core_1.SfError((0, ts_types_1.getString)(err, 'errorMessage', 'unknown'), (0, ts_types_1.getString)(err, 'errorStatusCode', 'unknown'));
59
+ }
60
+ if (!stages.length) {
61
+ throw messages.createError('error.ProjectNotFound', [projectName]);
62
+ }
63
+ // find stage by branch name
64
+ const stage = stages.find((s) => s.sf_devops__Branch__r.sf_devops__Name__c.toUpperCase() === branchName.toUpperCase());
65
+ if (!stage) {
66
+ throw messages.createError('error.BranchNotFound', [branchName, projectName]);
67
+ }
68
+ return stage;
69
+ }
70
+ exports.fetchAndValidatePipelineStage = fetchAndValidatePipelineStage;
71
+ async function fetchAsyncOperationResult(con, aorId) {
72
+ let aor;
73
+ try {
74
+ aor = await (0, asyncOperationResultsSelector_1.selectAsyncOperationResultById)(con, aorId);
75
+ }
76
+ catch (err) {
77
+ const error = err;
78
+ if (error.name === 'SingleRecordQuery_NoRecords') {
79
+ throw messages.createError('error.InvalidAorId', [aorId]);
80
+ }
81
+ throw err;
82
+ }
83
+ return aor;
84
+ }
85
+ exports.fetchAsyncOperationResult = fetchAsyncOperationResult;
86
+ function getAsyncOperationStreamer(org, waitTime, idToInspect, outputService) {
87
+ return new asyncOpStream_1.default(org, waitTime, idToInspect, outputService);
88
+ }
89
+ exports.getAsyncOperationStreamer = getAsyncOperationStreamer;
90
+ /**
91
+ *
92
+ * Helper to inspect an array of SF ids to check if it contains the given Id,
93
+ * independently if it is a 15 or 18 characters long.
94
+ *
95
+ * @param idsToInspect array of ids which might contain the given id
96
+ * @param idToFind id to look for
97
+ * @returns true is the array contains the given id
98
+ */
99
+ function containsSfId(idsToInspect, idToFind) {
100
+ let shortId;
101
+ if (idToFind.length === 18) {
102
+ shortId = idToFind.substring(0, 15);
103
+ }
104
+ else if (idToFind.length === 15) {
105
+ shortId = idToFind;
106
+ }
107
+ else {
108
+ return false;
109
+ }
110
+ return idsToInspect.some((k) => k.startsWith(shortId));
111
+ }
112
+ exports.containsSfId = containsSfId;
113
+ /**
114
+ *
115
+ * Helper to compare to SF Ids independently if they are 15 or 18 characters long.
116
+ *
117
+ * @param firstId
118
+ * @param secondId
119
+ * @returns true is the Ids match
120
+ */
121
+ function matchesSfId(firstId, secondId) {
122
+ return containsSfId([firstId], secondId);
123
+ }
124
+ exports.matchesSfId = matchesSfId;
125
+ /**
126
+ * Helper to convert an sObject into an array of {key : value}
127
+ * and format the keys.
128
+ *
129
+ * @param sObj sObject to convert.
130
+ * @returns an array of {key : value}
131
+ */
132
+ function sObjectToArrayOfKeyValue(sObj) {
133
+ const acumulator = [];
134
+ return Object.entries(sObj).reduce((res, [key, value]) => {
135
+ if (key !== 'attributes') {
136
+ if (typeof value === 'object' && value !== null) {
137
+ return res.concat(sObjectToArrayOfKeyValue(value));
138
+ }
139
+ else if (key === 'sf_devops__Status__c') {
140
+ return res.concat({ key: formatFieldName(key), value: (0, outputUtils_1.colorStatus)(value) });
141
+ }
142
+ else {
143
+ return res.concat({ key: formatFieldName(key), value: value });
144
+ }
145
+ }
146
+ return res;
147
+ }, acumulator);
148
+ }
149
+ exports.sObjectToArrayOfKeyValue = sObjectToArrayOfKeyValue;
150
+ /**
151
+ * Helper to remove the prefix, sufix and underscores in a DOCe sObject field name.
152
+ *
153
+ * @param fieldName DOCe field name.
154
+ * @returns formatted field name.
155
+ */
156
+ function formatFieldName(fieldName) {
157
+ return fieldName.replace('sf_devops__', '').replace('__c', '').replace('_', '');
158
+ }
159
+ exports.formatFieldName = formatFieldName;
160
+ /**
161
+ * Helper to return a formatted DeployComponent list (Type/Name filled).
162
+ *
163
+ * @param con The connection needed for the query
164
+ * @param asyncOpId The Id of the AsyncOperation
165
+ * @returns A list of DeployComponent
166
+ */
167
+ async function getFormattedDeployComponentsByAyncOpId(con, asyncOpId) {
168
+ const components = await (0, deployComponentsSelector_1.selectDeployComponentsByAsyncOpId)(con, asyncOpId);
169
+ components.forEach((component) => {
170
+ component.Type = component.sf_devops__Source_Component__c.split(':')[0];
171
+ component.Name = component.sf_devops__Source_Component__c.split(':')[1];
172
+ });
173
+ return components;
174
+ }
175
+ exports.getFormattedDeployComponentsByAyncOpId = getFormattedDeployComponentsByAyncOpId;
176
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/common/utils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,2CAAsE;AAEtE,mDAA2D;AAC3D,sCAA+D;AAC/D,qFAA0F;AAC1F,wEAAoE;AACpE,6DAA0D;AAE1D,6FAA2F;AAE3F,mFAAyF;AAEzF,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,cAAc,CAAC,CAAC;AAE3F;;;;;;GAMG;AACH,SAAgB,iBAAiB,CAAC,SAA8B,EAAE,KAAyB;IACzF,IAAI,SAAS,KAAK,kBAAS,CAAC,iBAAiB,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QAC3E,MAAM,QAAQ,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;KACtD;SAAM,IAAI,SAAS,KAAK,kBAAS,CAAC,iBAAiB,IAAI,KAAK,EAAE;QAC7D,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,8BAA8B,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACxE,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,8BAA8B,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACpB,CAAC;AAZD,wFAYC"}
@@ -0,0 +1,13 @@
1
+ export declare enum ConfigVars {
2
+ TARGET_DEVOPS_CENTER = "target-devops-center"
3
+ }
4
+ /**
5
+ * Creates a configuration variable called --target-devops-center.
6
+ * Once set, it acts as the default target devops center org for the commands in this plugin.
7
+ */
8
+ declare const _default: {
9
+ key: ConfigVars;
10
+ description: string;
11
+ hidden: boolean;
12
+ }[];
13
+ export default _default;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2023, salesforce.com, inc.
4
+ * All rights reserved.
5
+ * Licensed under the BSD 3-Clause license.
6
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ConfigVars = void 0;
10
+ const core_1 = require("@salesforce/core");
11
+ core_1.Messages.importMessagesDirectory(__dirname);
12
+ const messages = core_1.Messages.loadMessages('@salesforce/plugin-devops-center', 'config');
13
+ var ConfigVars;
14
+ (function (ConfigVars) {
15
+ ConfigVars["TARGET_DEVOPS_CENTER"] = "target-devops-center";
16
+ })(ConfigVars = exports.ConfigVars || (exports.ConfigVars = {}));
17
+ /**
18
+ * Creates a configuration variable called --target-devops-center.
19
+ * Once set, it acts as the default target devops center org for the commands in this plugin.
20
+ */
21
+ exports.default = [
22
+ {
23
+ key: ConfigVars.TARGET_DEVOPS_CENTER,
24
+ description: messages.getMessage(ConfigVars.TARGET_DEVOPS_CENTER),
25
+ hidden: false,
26
+ },
27
+ ];
28
+ //# sourceMappingURL=configMeta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configMeta.js","sourceRoot":"","sources":["../src/configMeta.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,2CAA4C;AAE5C,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,QAAQ,CAAC,CAAC;AAErF,IAAY,UAEX;AAFD,WAAY,UAAU;IACpB,2DAA6C,CAAA;AAC/C,CAAC,EAFW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAErB;AAED;;;GAGG;AACH,kBAAe;IACb;QACE,GAAG,EAAE,UAAU,CAAC,oBAAoB;QACpC,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,oBAAoB,CAAC;QACjE,MAAM,EAAE,KAAK;KACd;CACF,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { AnyJson } from '@salesforce/ts-types';
2
+ /**
3
+ * Common interface used to monitor the progress of something in the DevOps Center.
4
+ **/
5
+ export default interface DoceMonitor {
6
+ monitor(): Promise<void | AnyJson>;
7
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2023, salesforce.com, inc.
4
+ * All rights reserved.
5
+ * Licensed under the BSD 3-Clause license.
6
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ //# sourceMappingURL=doceMonitor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doceMonitor.js","sourceRoot":"","sources":["../../src/streamer/doceMonitor.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
@@ -0,0 +1,20 @@
1
+ import { Org, StatusResult } from '@salesforce/core';
2
+ import { AnyJson, JsonMap } from '@salesforce/ts-types';
3
+ import { Duration } from '@salesforce/kit';
4
+ import DoceMonitor from './doceMonitor';
5
+ /**
6
+ * Common base class for DOCe monitor that use the streaming api to listen to a streaming channel (CDC).
7
+ */
8
+ export default abstract class DOCeStreaming implements DoceMonitor {
9
+ private doceOrg;
10
+ private wait;
11
+ constructor(org: Org, wait: Duration);
12
+ /**
13
+ * This creates the streaming client and starts listening the desired streaming channel.
14
+ *
15
+ * @param channel The channel we want to listen (CDC)
16
+ * @param processor The specific processor we want to use for the event
17
+ */
18
+ protected startStream(channel: string, processor: (message: JsonMap) => StatusResult): Promise<void | AnyJson>;
19
+ abstract monitor(): Promise<void | AnyJson>;
20
+ }