@simplysf/simply-cicd-core 0.2.2 → 0.4.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/README.md +32 -3
- package/lib/build/checkPermissionSets.d.ts +22 -0
- package/lib/build/checkPermissionSets.js +102 -0
- package/lib/build/checkPermissionSets.js.map +1 -0
- package/lib/build/cleanupScratchOrgs.d.ts +6 -0
- package/lib/build/cleanupScratchOrgs.js +91 -0
- package/lib/build/cleanupScratchOrgs.js.map +1 -0
- package/lib/build/createFallbackTag.d.ts +24 -0
- package/lib/build/createFallbackTag.js +147 -0
- package/lib/build/createFallbackTag.js.map +1 -0
- package/lib/build/createPackageVersion.d.ts +42 -0
- package/lib/build/createPackageVersion.js +191 -0
- package/lib/build/createPackageVersion.js.map +1 -0
- package/lib/build/createScratchOrg.d.ts +14 -0
- package/lib/build/createScratchOrg.js +182 -0
- package/lib/build/createScratchOrg.js.map +1 -0
- package/lib/build/deleteScratchOrg.d.ts +13 -0
- package/lib/build/deleteScratchOrg.js +62 -0
- package/lib/build/deleteScratchOrg.js.map +1 -0
- package/lib/build/deltaRunner.d.ts +73 -0
- package/lib/build/deltaRunner.js +109 -0
- package/lib/build/deltaRunner.js.map +1 -0
- package/lib/build/determinePackageChanges.d.ts +11 -0
- package/lib/build/determinePackageChanges.js +90 -0
- package/lib/build/determinePackageChanges.js.map +1 -0
- package/lib/build/devHubs.d.ts +12 -0
- package/lib/build/devHubs.js +42 -0
- package/lib/build/devHubs.js.map +1 -0
- package/lib/build/flexipageDelta.d.ts +18 -0
- package/lib/build/flexipageDelta.js +35 -0
- package/lib/build/flexipageDelta.js.map +1 -0
- package/lib/build/flowDelta.d.ts +17 -0
- package/lib/build/flowDelta.js +34 -0
- package/lib/build/flowDelta.js.map +1 -0
- package/lib/build/installDependencies.d.ts +10 -0
- package/lib/build/installDependencies.js +39 -0
- package/lib/build/installDependencies.js.map +1 -0
- package/lib/build/lwcJest.d.ts +25 -0
- package/lib/build/lwcJest.js +126 -0
- package/lib/build/lwcJest.js.map +1 -0
- package/lib/build/publishUtamPageObjects.d.ts +50 -0
- package/lib/build/publishUtamPageObjects.js +274 -0
- package/lib/build/publishUtamPageObjects.js.map +1 -0
- package/lib/build/pushScratch.d.ts +9 -0
- package/lib/build/pushScratch.js +60 -0
- package/lib/build/pushScratch.js.map +1 -0
- package/lib/build/scratchOrgAuth.d.ts +18 -0
- package/lib/build/scratchOrgAuth.js +52 -0
- package/lib/build/scratchOrgAuth.js.map +1 -0
- package/lib/build/scratchOrgInfo.d.ts +14 -0
- package/lib/build/scratchOrgInfo.js +21 -0
- package/lib/build/scratchOrgInfo.js.map +1 -0
- package/lib/build/skipGuard.d.ts +8 -0
- package/lib/build/skipGuard.js +42 -0
- package/lib/build/skipGuard.js.map +1 -0
- package/lib/build/testScratch.d.ts +15 -0
- package/lib/build/testScratch.js +42 -0
- package/lib/build/testScratch.js.map +1 -0
- package/lib/build/utamPageObjects.d.ts +143 -0
- package/lib/build/utamPageObjects.js +258 -0
- package/lib/build/utamPageObjects.js.map +1 -0
- package/lib/build/versionTagFormat.d.ts +57 -0
- package/lib/build/versionTagFormat.js +194 -0
- package/lib/build/versionTagFormat.js.map +1 -0
- package/lib/config/defaultDeploymentPlugins.d.ts +2 -0
- package/lib/config/defaultDeploymentPlugins.js +18 -0
- package/lib/config/defaultDeploymentPlugins.js.map +1 -0
- package/lib/config/trustedPlugins.d.ts +2 -0
- package/lib/config/trustedPlugins.js +18 -0
- package/lib/config/trustedPlugins.js.map +1 -0
- package/lib/deploy/deployCommon.d.ts +105 -0
- package/lib/deploy/deployCommon.js +358 -0
- package/lib/deploy/deployCommon.js.map +1 -0
- package/lib/deploy/deployHappySoup.d.ts +56 -0
- package/lib/deploy/deployHappySoup.js +159 -0
- package/lib/deploy/deployHappySoup.js.map +1 -0
- package/lib/deploy/deployProject.d.ts +27 -0
- package/lib/deploy/deployProject.js +114 -0
- package/lib/deploy/deployProject.js.map +1 -0
- package/lib/deploy/runDeployStage.d.ts +16 -0
- package/lib/deploy/runDeployStage.js +65 -0
- package/lib/deploy/runDeployStage.js.map +1 -0
- package/lib/deploy/stageOptions.d.ts +49 -0
- package/lib/deploy/stageOptions.js +70 -0
- package/lib/deploy/stageOptions.js.map +1 -0
- package/lib/deploy/validate.d.ts +11 -0
- package/lib/deploy/validate.js +54 -0
- package/lib/deploy/validate.js.map +1 -0
- package/lib/env.d.ts +9 -0
- package/lib/env.js +47 -0
- package/lib/env.js.map +1 -0
- package/lib/exec/sfCli.d.ts +27 -0
- package/lib/exec/sfCli.js +50 -0
- package/lib/exec/sfCli.js.map +1 -0
- package/lib/flags/env.d.ts +44 -0
- package/lib/flags/env.js +81 -0
- package/lib/flags/env.js.map +1 -0
- package/lib/git.d.ts +32 -0
- package/lib/git.js +106 -0
- package/lib/git.js.map +1 -0
- package/lib/happySoup/resolveOriginProject.d.ts +22 -0
- package/lib/happySoup/resolveOriginProject.js +61 -0
- package/lib/happySoup/resolveOriginProject.js.map +1 -0
- package/lib/index.d.ts +52 -0
- package/lib/index.js +64 -2
- package/lib/index.js.map +1 -1
- package/lib/logger.d.ts +10 -0
- package/lib/logger.js +33 -0
- package/lib/logger.js.map +1 -0
- package/lib/notify/buildNotification.d.ts +53 -0
- package/lib/notify/buildNotification.js +176 -0
- package/lib/notify/buildNotification.js.map +1 -0
- package/lib/notify/getCommitStories.d.ts +30 -0
- package/lib/notify/getCommitStories.js +70 -0
- package/lib/notify/getCommitStories.js.map +1 -0
- package/lib/notify/getRemoteCommitStories.d.ts +10 -0
- package/lib/notify/getRemoteCommitStories.js +45 -0
- package/lib/notify/getRemoteCommitStories.js.map +1 -0
- package/lib/notify/happySoupNotification.d.ts +26 -0
- package/lib/notify/happySoupNotification.js +140 -0
- package/lib/notify/happySoupNotification.js.map +1 -0
- package/lib/notify/projectNotification.d.ts +46 -0
- package/lib/notify/projectNotification.js +167 -0
- package/lib/notify/projectNotification.js.map +1 -0
- package/lib/notify/renderTemplate.d.ts +3 -0
- package/lib/notify/renderTemplate.js +24 -0
- package/lib/notify/renderTemplate.js.map +1 -0
- package/lib/notify/sendNotification.d.ts +2 -0
- package/lib/notify/sendNotification.js +50 -0
- package/lib/notify/sendNotification.js.map +1 -0
- package/lib/notify/templates.d.ts +13 -0
- package/lib/notify/templates.js +118 -0
- package/lib/notify/templates.js.map +1 -0
- package/lib/schemas/deployConfig.d.ts +25 -0
- package/lib/schemas/deployConfig.js +55 -0
- package/lib/schemas/deployConfig.js.map +1 -0
- package/lib/schemas/deployProgress.d.ts +33 -0
- package/lib/schemas/deployProgress.js +46 -0
- package/lib/schemas/deployProgress.js.map +1 -0
- package/lib/schemas/deployRules.d.ts +34 -0
- package/lib/schemas/deployRules.js +40 -0
- package/lib/schemas/deployRules.js.map +1 -0
- package/lib/sfApex.d.ts +22 -0
- package/lib/sfApex.js +169 -0
- package/lib/sfApex.js.map +1 -0
- package/lib/sfAuth.d.ts +19 -0
- package/lib/sfAuth.js +78 -0
- package/lib/sfAuth.js.map +1 -0
- package/lib/sfConfig.d.ts +23 -0
- package/lib/sfConfig.js +82 -0
- package/lib/sfConfig.js.map +1 -0
- package/lib/sfOrg.d.ts +13 -0
- package/lib/sfOrg.js +39 -0
- package/lib/sfOrg.js.map +1 -0
- package/lib/sfPackages.d.ts +63 -0
- package/lib/sfPackages.js +185 -0
- package/lib/sfPackages.js.map +1 -0
- package/lib/sfPlugins.d.ts +11 -0
- package/lib/sfPlugins.js +134 -0
- package/lib/sfPlugins.js.map +1 -0
- package/lib/sfdxDependabot/dependabotRun.d.ts +95 -0
- package/lib/sfdxDependabot/dependabotRun.js +287 -0
- package/lib/sfdxDependabot/dependabotRun.js.map +1 -0
- package/lib/sfdxDependabot/updater.d.ts +14 -0
- package/lib/sfdxDependabot/updater.js +94 -0
- package/lib/sfdxDependabot/updater.js.map +1 -0
- package/package.json +16 -4
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { promises as fs } from 'node:fs';
|
|
17
|
+
import { execa } from 'execa';
|
|
18
|
+
import { getDefaultPackageDirectory, isSubscriberPackageVersionId, readSfdxProject } from '@simplysf/simply-core';
|
|
19
|
+
import { createAlmProvider } from '../alm/index.js';
|
|
20
|
+
import { logger } from '../logger.js';
|
|
21
|
+
import { getPackageVersionReport, listInstalledPackages } from '../sfPackages.js';
|
|
22
|
+
import { appendToEnvFile } from '../env.js';
|
|
23
|
+
import { getCommitStories } from './getCommitStories.js';
|
|
24
|
+
import { renderNotifyTemplate } from './renderTemplate.js';
|
|
25
|
+
import { sendNotification } from './sendNotification.js';
|
|
26
|
+
/** Queries the target org's installed package version. The org must already be authenticated. */
|
|
27
|
+
export async function resolvePrevInstalledPackageVersion(params) {
|
|
28
|
+
const { alias, debug } = params;
|
|
29
|
+
if (!alias) {
|
|
30
|
+
logger.warn('No --alias given. Skipping installed package version check.');
|
|
31
|
+
return 'N/A';
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
const packageName = getDefaultPackageDirectory(await readSfdxProject())?.package;
|
|
35
|
+
logger.info(`Get installed package version from alias ${alias} for package ${packageName ?? 'unknown'}...`);
|
|
36
|
+
const installed = await listInstalledPackages(alias);
|
|
37
|
+
const pkg = installed.find((p) => p.SubscriberPackageName === packageName);
|
|
38
|
+
return pkg?.SubscriberPackageVersionNumber ? `v${pkg.SubscriberPackageVersionNumber}` : 'N/A';
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
logger.warn(`Could not query installed package version: ${error.message}`);
|
|
42
|
+
if (debug) {
|
|
43
|
+
logger.error(String(error));
|
|
44
|
+
}
|
|
45
|
+
return 'N/A';
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/** Resolves the released package's version from the packaging DevHub. Returns `undefined` on any failure. */
|
|
49
|
+
export async function resolveTargetPackageVersionFromDevHub(params) {
|
|
50
|
+
const { packagingDevhub, subscriberPackageVersionId, debug } = params;
|
|
51
|
+
if (!packagingDevhub) {
|
|
52
|
+
logger.warn('No --packaging-devhub given. Skipping target package version check from DevHub.');
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
if (!subscriberPackageVersionId || !isSubscriberPackageVersionId(subscriberPackageVersionId)) {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
logger.info(`Get latest package version for package version ID ${subscriberPackageVersionId}...`);
|
|
60
|
+
const versionReport = await getPackageVersionReport(subscriberPackageVersionId, packagingDevhub);
|
|
61
|
+
return versionReport.Version ? `v${versionReport.Version}` : undefined;
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
logger.warn(`Could not get target package version from DevHub: ${error.message}`);
|
|
65
|
+
if (debug) {
|
|
66
|
+
logger.error(String(error));
|
|
67
|
+
}
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/** Falls back to the git tag pointing at HEAD when the DevHub can't resolve a target version. */
|
|
72
|
+
export async function resolveTargetPackageVersionFromGitTag(debug) {
|
|
73
|
+
logger.info('Falling back to git tag for target version...');
|
|
74
|
+
try {
|
|
75
|
+
const { stdout } = await execa('git', ['tag', '--points-at', 'HEAD']);
|
|
76
|
+
if (stdout) {
|
|
77
|
+
return stdout.trim().split('\n')[0];
|
|
78
|
+
}
|
|
79
|
+
logger.warn('No git tag found at HEAD.');
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
logger.warn(`Could not get git tag: ${error.message}`);
|
|
83
|
+
if (debug) {
|
|
84
|
+
logger.error(String(error));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return 'N/A';
|
|
88
|
+
}
|
|
89
|
+
export async function resolveTargetPackageVersion(params) {
|
|
90
|
+
const fromDevHub = await resolveTargetPackageVersionFromDevHub(params);
|
|
91
|
+
return fromDevHub ?? resolveTargetPackageVersionFromGitTag(params.debug);
|
|
92
|
+
}
|
|
93
|
+
/** Resolves and records the previously installed and target package versions for later stages. */
|
|
94
|
+
export async function projectNotifyBeforeScript(options) {
|
|
95
|
+
logger.info('Initializing before-script for project notification...');
|
|
96
|
+
if (options.ciJobStage !== 'pre-destructive' || options.ciJobStatus === 'canceled') {
|
|
97
|
+
logger.info(`No notify before-script logic for job stage: ${options.ciJobStage ?? 'unknown'}, status: ${options.ciJobStatus ?? 'unknown'}`);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
logger.info('Running before_script for project notification...');
|
|
101
|
+
await fs.writeFile('project-build.env', `CREATED_BY_JOB_NAME=${options.ciJobName ?? ''}\n`);
|
|
102
|
+
const prevInstalledPackageVersion = await resolvePrevInstalledPackageVersion({
|
|
103
|
+
alias: options.alias,
|
|
104
|
+
debug: options.debug,
|
|
105
|
+
});
|
|
106
|
+
const targetPackageVersion = await resolveTargetPackageVersion({
|
|
107
|
+
packagingDevhub: options.packagingDevhub,
|
|
108
|
+
subscriberPackageVersionId: options.subscriberPackageVersionId,
|
|
109
|
+
debug: options.debug,
|
|
110
|
+
});
|
|
111
|
+
appendToEnvFile('project-build.env', { PREV_INSTALLED_PACKAGE_VERSION: prevInstalledPackageVersion, TARGET_PACKAGE_VERSION: targetPackageVersion }, logger);
|
|
112
|
+
logger.success('before_script for project notification finished.');
|
|
113
|
+
logger.log(`PREV_INSTALLED_PACKAGE_VERSION=${prevInstalledPackageVersion}`);
|
|
114
|
+
logger.log(`TARGET_PACKAGE_VERSION=${targetPackageVersion}`);
|
|
115
|
+
}
|
|
116
|
+
/** Posts the deployment result card (with Jira stories on success) to Teams. */
|
|
117
|
+
export async function projectNotifyAfterScript(options) {
|
|
118
|
+
const { ciJobStage, ciJobStatus } = options;
|
|
119
|
+
const templateData = {
|
|
120
|
+
environmentName: options.ciEnvironmentName,
|
|
121
|
+
refName: options.ciCommitRefName,
|
|
122
|
+
pipelineUrl: options.ciPipelineUrl,
|
|
123
|
+
pipelineId: options.ciPipelineId,
|
|
124
|
+
projectTitle: options.ciProjectTitle,
|
|
125
|
+
storiesLinked: 'N/A',
|
|
126
|
+
stage: ciJobStage,
|
|
127
|
+
};
|
|
128
|
+
let notifyCommitStories = 'N/A';
|
|
129
|
+
let templateName;
|
|
130
|
+
if (ciJobStage === 'post-destructive' && ciJobStatus === 'success') {
|
|
131
|
+
templateName = 'project-success-notification';
|
|
132
|
+
logger.info('Gathering stories for successful deployment...');
|
|
133
|
+
const { stories, storiesWithUrl } = await getCommitStories(options.prevInstalledPackageVersion, options.targetPackageVersion, options.almProjectKey, {
|
|
134
|
+
debug: options.debug,
|
|
135
|
+
almBaseUrl: options.almBaseUrl,
|
|
136
|
+
almProvider: createAlmProvider(options.almProvider ?? 'jira'),
|
|
137
|
+
});
|
|
138
|
+
notifyCommitStories = stories;
|
|
139
|
+
templateData.storiesLinked = storiesWithUrl;
|
|
140
|
+
}
|
|
141
|
+
else if (ciJobStatus === 'failed') {
|
|
142
|
+
templateName = 'project-failure-notification';
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
logger.info(`No notification logic for job status: ${ciJobStatus ?? 'unknown'}`);
|
|
146
|
+
return { sent: false };
|
|
147
|
+
}
|
|
148
|
+
const notifyMessage = renderNotifyTemplate(templateName, templateData);
|
|
149
|
+
const payload = {
|
|
150
|
+
content: notifyMessage,
|
|
151
|
+
environmentName: options.ciEnvironmentName,
|
|
152
|
+
refName: options.ciCommitRefName,
|
|
153
|
+
pipelineId: options.ciPipelineId,
|
|
154
|
+
pipelineUrl: options.ciPipelineUrl,
|
|
155
|
+
projectTitle: options.ciProjectTitle,
|
|
156
|
+
jobName: options.ciJobName,
|
|
157
|
+
jobStage: ciJobStage,
|
|
158
|
+
jobStatus: ciJobStatus,
|
|
159
|
+
stories: notifyCommitStories,
|
|
160
|
+
storiesLinked: templateData.storiesLinked,
|
|
161
|
+
packageVersionPrevious: options.prevInstalledPackageVersion,
|
|
162
|
+
packageVersion: options.targetPackageVersion,
|
|
163
|
+
};
|
|
164
|
+
await sendNotification(options.teamsWebhookUrl, payload);
|
|
165
|
+
return { sent: true };
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=projectNotification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projectNotification.js","sourceRoot":"","sources":["../../src/notify/projectNotification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClH,OAAO,EAAE,iBAAiB,EAAwB,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAsCzD,iGAAiG;AACjG,MAAM,CAAC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IAC9C,CAAC;SAAM,IAAI,WAAW,KAAK,QAAQ,EAAE,CAAC;QACpC,YAAY,GAAG,8BAA8B,CAAC;IAChD,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,IAAI,CAAC,yCAAyC,WAAW,IAAI,SAAS,EAAE,CAAC,CAAC;QACjF,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACzB,CAAC;IAED,MAAM,aAAa,GAAG,oBAAoB,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IAEvE,MAAM,OAAO,GAAG;QACd,OAAO,EAAE,aAAa;QACtB,eAAe,EAAE,OAAO,CAAC,iBAAiB;QAC1C,OAAO,EAAE,OAAO,CAAC,eAAe;QAChC,UAAU,EAAE,OAAO,CAAC,YAAY;QAChC,WAAW,EAAE,OAAO,CAAC,aAAa;QAClC,YAAY,EAAE,OAAO,CAAC,cAAc;QACpC,OAAO,EAAE,OAAO,CAAC,SAAS;QAC1B,QAAQ,EAAE,UAAU;QACpB,SAAS,EAAE,WAAW;QACtB,OAAO,EAAE,mBAAmB;QAC5B,aAAa,EAAE,YAAY,CAAC,aAAa;QACzC,sBAAsB,EAAE,OAAO,CAAC,2BAA2B;QAC3D,cAAc,EAAE,OAAO,CAAC,oBAAoB;KAC7C,CAAC;IAEF,MAAM,gBAAgB,CAAC,OAAO,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;IACzD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import Handlebars from 'handlebars';
|
|
17
|
+
import { NOTIFY_TEMPLATES } from './templates.js';
|
|
18
|
+
const handlebars = Handlebars.create();
|
|
19
|
+
/** Renders one of the built-in Teams notification card templates with the given data. */
|
|
20
|
+
export function renderNotifyTemplate(templateName, data) {
|
|
21
|
+
const template = handlebars.compile(NOTIFY_TEMPLATES[templateName]);
|
|
22
|
+
return template(data);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=renderTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderTemplate.js","sourceRoot":"","sources":["../../src/notify/renderTemplate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAA2B,MAAM,gBAAgB,CAAC;AAE3E,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC;AAEvC,yFAAyF;AACzF,MAAM,UAAU,oBAAoB,CAAC,YAAgC,EAAE,IAA6B;IAClG,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAAC;IACpE,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { logger } from '../logger.js';
|
|
17
|
+
/** Sends a notification payload to one or more Microsoft Teams incoming webhooks. */
|
|
18
|
+
export async function sendNotification(teamsWebhookUrl, payload) {
|
|
19
|
+
const urls = Array.isArray(teamsWebhookUrl) ? teamsWebhookUrl : [teamsWebhookUrl];
|
|
20
|
+
const nonEmptyUrls = urls.filter((u) => Boolean(u));
|
|
21
|
+
if (nonEmptyUrls.length === 0) {
|
|
22
|
+
logger.warn('No webhook URLs provided. Skipping notification.');
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const notificationPromises = nonEmptyUrls.map(async (url) => {
|
|
26
|
+
try {
|
|
27
|
+
const response = await fetch(url, {
|
|
28
|
+
method: 'POST',
|
|
29
|
+
headers: { 'Content-Type': 'application/json' },
|
|
30
|
+
body: typeof payload === 'string' ? payload : JSON.stringify(payload ?? {}),
|
|
31
|
+
});
|
|
32
|
+
if (!response.ok) {
|
|
33
|
+
throw new Error(`Response not OK. Status: ${response.status} ${response.statusText}`);
|
|
34
|
+
}
|
|
35
|
+
logger.success(`Successfully sent notification to ${url}`);
|
|
36
|
+
return { url, status: 'success' };
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
logger.error(`Failed to send notification to ${url}: ${error.message}`);
|
|
40
|
+
return { url, status: 'failure', error };
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const results = await Promise.all(notificationPromises);
|
|
44
|
+
const failures = results.filter((r) => r.status === 'failure');
|
|
45
|
+
if (failures.length > 0) {
|
|
46
|
+
const failedUrls = failures.map((f) => f.url).join(', ');
|
|
47
|
+
throw new Error(`Failed to send ${failures.length} notification(s) to: ${failedUrls}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=sendNotification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendNotification.js","sourceRoot":"","sources":["../../src/notify/sendNotification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC,qFAAqF;AACrF,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,eAA8C,EAC9C,OAAgB;IAEhB,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;IAClF,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAEjE,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,MAAM,CAAC,IAAI,CAAC,kDAAkD,CAAC,CAAC;QAChE,OAAO;IACT,CAAC;IAED,MAAM,oBAAoB,GAAG,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,EAA+B,EAAE;QACvF,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;gBAChC,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;gBAC/C,IAAI,EAAE,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,IAAI,EAAE,CAAC;aAC5E,CAAC,CAAC;YAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;gBACjB,MAAM,IAAI,KAAK,CAAC,4BAA4B,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;YACxF,CAAC;YAED,MAAM,CAAC,OAAO,CAAC,qCAAqC,GAAG,EAAE,CAAC,CAAC;YAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;QACpC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,kCAAkC,GAAG,KAAM,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;YACnF,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;QAC3C,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACxD,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;IAE/D,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzD,MAAM,IAAI,KAAK,CAAC,kBAAkB,QAAQ,CAAC,MAAM,wBAAwB,UAAU,EAAE,CAAC,CAAC;IACzF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Teams notification card templates, keyed the same as the original `.hbs` file names. */
|
|
2
|
+
export declare const NOTIFY_TEMPLATES: {
|
|
3
|
+
readonly 'build-failure-notification': "<table>\n <tr><th colspan=\"3\" style=\"color: white; background-color: darkred;\">{{projectTitle}}: Failed Build</th></tr>\n <tr><th colspan=\"3\" style=\"color: white; background-color: grey;\">Job: {{jobName}} (Stage:\n {{stage}})</th></tr>\n <tr><td>Branch</td><td colspan=\"2\">Pipeline</td></tr>\n <tr><td>{{refName}}</td><td colspan=\"2\"><a\n href=\"{{pipelineUrl}}\"\n >{{pipelineId}}</a></td></tr>\n</table>\n";
|
|
4
|
+
readonly 'build-package-version-notification': "<table>\n <tr><th colspan=\"3\" style=\"color: white; background-color: darkgreen;\">{{projectTitle}}: Package Version\n Created</th></tr>\n <tr><td>Version</td><td>Branch</td><td>Pipeline</td></tr>\n <tr><td>{{packageVersion}}<br />{{subscriberPackageVersionId}}</td><td>{{refName}}</td><td><a\n href=\"{{pipelineUrl}}\"\n >{{pipelineId}}</a></td></tr>\n <tr><td colspan=\"3\">Stories since {{packageVersionPrevious}}</td></tr>\n <tr><td colspan=\"3\">{{{storiesLinked}}}</td></tr>\n</table>\n";
|
|
5
|
+
readonly 'happy-soup-failure-notification': "<table>\n <tr><th colspan=\"3\" style=\"color: white; background-color: darkred;\">Failed Stage:\n {{stage}}</th></tr>\n <tr><td>Environment</td><td>Branch</td><td>Pipeline</td></tr>\n <tr><td>{{environmentName}}</td><td>{{refName}}</td><td><a\n href=\"{{pipelineUrl}}\"\n >{{pipelineId}}</a></td></tr>\n</table>\n";
|
|
6
|
+
readonly 'happy-soup-final-failure-notification': "<table>\n <tr><th colspan=\"3\" style=\"color: white; background-color: darkred;\">Happy Soup Deployment Failed</th></tr>\n <tr><td>Environment</td><td>Branch</td><td>Pipeline</td></tr>\n <tr><td>{{environmentName}}</td><td>{{refName}}</td><td><a\n href=\"{{pipelineUrl}}\"\n >{{pipelineId}}</a></td></tr>\n</table>\n";
|
|
7
|
+
readonly 'happy-soup-final-success-notification': "<table>\n <tr><th colspan=\"3\" style=\"color: white; background-color: darkgreen;\">Happy Soup Deployment\n Completed</th></tr>\n <tr><td>Environment</td><td>Branch</td><td>Pipeline</td></tr>\n <tr><td>{{environmentName}}</td><td>{{refName}}</td><td><a\n href=\"{{pipelineUrl}}\"\n >{{pipelineId}}</a></td></tr>\n{{#if upgradedPackages.length}}\n <tr><td colspan=\"3\">Upgraded Packages</td></tr>\n{{#each upgradedPackages}}\n <tr><td colspan=\"1\">{{packageName}}</td><td colspan=\"2\">{{{storiesLinked}}}</td></tr>\n{{/each}}\n{{/if}}\n</table>\n";
|
|
8
|
+
readonly 'happy-soup-starting-stage-notification': "<table>\n <tr><th colspan=\"3\" style=\"color: white; background-color: #007acc;\">Starting Stage:\n {{stage}}</th></tr>\n <tr><td>Environment</td><td>Branch</td><td>Pipeline</td></tr>\n <tr><td>{{environmentName}}</td><td>{{refName}}</td><td><a\n href=\"{{pipelineUrl}}\"\n >{{pipelineId}}</a></td></tr>\n</table>\n";
|
|
9
|
+
readonly 'happy-soup-success-notification': "<table>\n <tr><th colspan=\"3\" style=\"color: white; background-color: darkgreen;\">Completed Stage:\n {{stage}}</th></tr>\n <tr><td>Environment</td><td>Branch</td><td>Pipeline</td></tr>\n <tr><td>{{environmentName}}</td><td>{{refName}}</td><td><a\n href=\"{{pipelineUrl}}\"\n >{{pipelineId}}</a></td></tr>\n{{#if upgradedPackages.length}}\n <tr><td colspan=\"3\">Upgraded Packages</td></tr>\n{{#each upgradedPackages}}\n <tr><td colspan=\"1\">{{packageName}}</td><td colspan=\"2\">{{{storiesLinked}}}</td></tr>\n{{/each}}\n{{/if}}\n</table>\n";
|
|
10
|
+
readonly 'project-failure-notification': "<table>\n <tr><th colspan=\"3\" style=\"color: white; background-color: darkred;\">{{projectTitle}}: Failed\n Deployment</th></tr>\n <tr><th colspan=\"3\" style=\"color: white; background-color: grey;\">Stage:\n {{stage}}</th></tr>\n <tr><td>Environment</td><td>Branch</td><td>Pipeline</td></tr>\n <tr><td>{{environmentName}}</td><td>{{refName}}</td><td><a\n href=\"{{pipelineUrl}}\"\n >{{pipelineId}}</a></td></tr>\n</table>\n";
|
|
11
|
+
readonly 'project-success-notification': "<table>\n <tr><th colspan=\"3\" style=\"color: white; background-color: darkgreen;\">{{projectTitle}}: Completed\n Deployment</th></tr>\n <tr><td>Environment</td><td>Branch</td><td>Pipeline</td></tr>\n <tr><td>{{environmentName}}</td><td>{{refName}}</td><td><a\n href=\"{{pipelineUrl}}\"\n >{{pipelineId}}</a></td></tr>\n <tr><td colspan=\"3\">Stories</td></tr>\n <tr><td colspan=\"3\">{{{storiesLinked}}}</td></tr>\n</table>\n";
|
|
12
|
+
};
|
|
13
|
+
export type NotifyTemplateName = keyof typeof NOTIFY_TEMPLATES;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/** Teams notification card templates, keyed the same as the original `.hbs` file names. */
|
|
17
|
+
export const NOTIFY_TEMPLATES = {
|
|
18
|
+
'build-failure-notification': `<table>
|
|
19
|
+
<tr><th colspan="3" style="color: white; background-color: darkred;">{{projectTitle}}: Failed Build</th></tr>
|
|
20
|
+
<tr><th colspan="3" style="color: white; background-color: grey;">Job: {{jobName}} (Stage:
|
|
21
|
+
{{stage}})</th></tr>
|
|
22
|
+
<tr><td>Branch</td><td colspan="2">Pipeline</td></tr>
|
|
23
|
+
<tr><td>{{refName}}</td><td colspan="2"><a
|
|
24
|
+
href="{{pipelineUrl}}"
|
|
25
|
+
>{{pipelineId}}</a></td></tr>
|
|
26
|
+
</table>
|
|
27
|
+
`,
|
|
28
|
+
'build-package-version-notification': `<table>
|
|
29
|
+
<tr><th colspan="3" style="color: white; background-color: darkgreen;">{{projectTitle}}: Package Version
|
|
30
|
+
Created</th></tr>
|
|
31
|
+
<tr><td>Version</td><td>Branch</td><td>Pipeline</td></tr>
|
|
32
|
+
<tr><td>{{packageVersion}}<br />{{subscriberPackageVersionId}}</td><td>{{refName}}</td><td><a
|
|
33
|
+
href="{{pipelineUrl}}"
|
|
34
|
+
>{{pipelineId}}</a></td></tr>
|
|
35
|
+
<tr><td colspan="3">Stories since {{packageVersionPrevious}}</td></tr>
|
|
36
|
+
<tr><td colspan="3">{{{storiesLinked}}}</td></tr>
|
|
37
|
+
</table>
|
|
38
|
+
`,
|
|
39
|
+
'happy-soup-failure-notification': `<table>
|
|
40
|
+
<tr><th colspan="3" style="color: white; background-color: darkred;">Failed Stage:
|
|
41
|
+
{{stage}}</th></tr>
|
|
42
|
+
<tr><td>Environment</td><td>Branch</td><td>Pipeline</td></tr>
|
|
43
|
+
<tr><td>{{environmentName}}</td><td>{{refName}}</td><td><a
|
|
44
|
+
href="{{pipelineUrl}}"
|
|
45
|
+
>{{pipelineId}}</a></td></tr>
|
|
46
|
+
</table>
|
|
47
|
+
`,
|
|
48
|
+
'happy-soup-final-failure-notification': `<table>
|
|
49
|
+
<tr><th colspan="3" style="color: white; background-color: darkred;">Happy Soup Deployment Failed</th></tr>
|
|
50
|
+
<tr><td>Environment</td><td>Branch</td><td>Pipeline</td></tr>
|
|
51
|
+
<tr><td>{{environmentName}}</td><td>{{refName}}</td><td><a
|
|
52
|
+
href="{{pipelineUrl}}"
|
|
53
|
+
>{{pipelineId}}</a></td></tr>
|
|
54
|
+
</table>
|
|
55
|
+
`,
|
|
56
|
+
'happy-soup-final-success-notification': `<table>
|
|
57
|
+
<tr><th colspan="3" style="color: white; background-color: darkgreen;">Happy Soup Deployment
|
|
58
|
+
Completed</th></tr>
|
|
59
|
+
<tr><td>Environment</td><td>Branch</td><td>Pipeline</td></tr>
|
|
60
|
+
<tr><td>{{environmentName}}</td><td>{{refName}}</td><td><a
|
|
61
|
+
href="{{pipelineUrl}}"
|
|
62
|
+
>{{pipelineId}}</a></td></tr>
|
|
63
|
+
{{#if upgradedPackages.length}}
|
|
64
|
+
<tr><td colspan="3">Upgraded Packages</td></tr>
|
|
65
|
+
{{#each upgradedPackages}}
|
|
66
|
+
<tr><td colspan="1">{{packageName}}</td><td colspan="2">{{{storiesLinked}}}</td></tr>
|
|
67
|
+
{{/each}}
|
|
68
|
+
{{/if}}
|
|
69
|
+
</table>
|
|
70
|
+
`,
|
|
71
|
+
'happy-soup-starting-stage-notification': `<table>
|
|
72
|
+
<tr><th colspan="3" style="color: white; background-color: #007acc;">Starting Stage:
|
|
73
|
+
{{stage}}</th></tr>
|
|
74
|
+
<tr><td>Environment</td><td>Branch</td><td>Pipeline</td></tr>
|
|
75
|
+
<tr><td>{{environmentName}}</td><td>{{refName}}</td><td><a
|
|
76
|
+
href="{{pipelineUrl}}"
|
|
77
|
+
>{{pipelineId}}</a></td></tr>
|
|
78
|
+
</table>
|
|
79
|
+
`,
|
|
80
|
+
'happy-soup-success-notification': `<table>
|
|
81
|
+
<tr><th colspan="3" style="color: white; background-color: darkgreen;">Completed Stage:
|
|
82
|
+
{{stage}}</th></tr>
|
|
83
|
+
<tr><td>Environment</td><td>Branch</td><td>Pipeline</td></tr>
|
|
84
|
+
<tr><td>{{environmentName}}</td><td>{{refName}}</td><td><a
|
|
85
|
+
href="{{pipelineUrl}}"
|
|
86
|
+
>{{pipelineId}}</a></td></tr>
|
|
87
|
+
{{#if upgradedPackages.length}}
|
|
88
|
+
<tr><td colspan="3">Upgraded Packages</td></tr>
|
|
89
|
+
{{#each upgradedPackages}}
|
|
90
|
+
<tr><td colspan="1">{{packageName}}</td><td colspan="2">{{{storiesLinked}}}</td></tr>
|
|
91
|
+
{{/each}}
|
|
92
|
+
{{/if}}
|
|
93
|
+
</table>
|
|
94
|
+
`,
|
|
95
|
+
'project-failure-notification': `<table>
|
|
96
|
+
<tr><th colspan="3" style="color: white; background-color: darkred;">{{projectTitle}}: Failed
|
|
97
|
+
Deployment</th></tr>
|
|
98
|
+
<tr><th colspan="3" style="color: white; background-color: grey;">Stage:
|
|
99
|
+
{{stage}}</th></tr>
|
|
100
|
+
<tr><td>Environment</td><td>Branch</td><td>Pipeline</td></tr>
|
|
101
|
+
<tr><td>{{environmentName}}</td><td>{{refName}}</td><td><a
|
|
102
|
+
href="{{pipelineUrl}}"
|
|
103
|
+
>{{pipelineId}}</a></td></tr>
|
|
104
|
+
</table>
|
|
105
|
+
`,
|
|
106
|
+
'project-success-notification': `<table>
|
|
107
|
+
<tr><th colspan="3" style="color: white; background-color: darkgreen;">{{projectTitle}}: Completed
|
|
108
|
+
Deployment</th></tr>
|
|
109
|
+
<tr><td>Environment</td><td>Branch</td><td>Pipeline</td></tr>
|
|
110
|
+
<tr><td>{{environmentName}}</td><td>{{refName}}</td><td><a
|
|
111
|
+
href="{{pipelineUrl}}"
|
|
112
|
+
>{{pipelineId}}</a></td></tr>
|
|
113
|
+
<tr><td colspan="3">Stories</td></tr>
|
|
114
|
+
<tr><td colspan="3">{{{storiesLinked}}}</td></tr>
|
|
115
|
+
</table>
|
|
116
|
+
`,
|
|
117
|
+
};
|
|
118
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/notify/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,2FAA2F;AAC3F,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,4BAA4B,EAAE;;;;;;;;;CAS/B;IACC,oCAAoC,EAAE;;;;;;;;;;CAUvC;IACC,iCAAiC,EAAE;;;;;;;;CAQpC;IACC,uCAAuC,EAAE;;;;;;;CAO1C;IACC,uCAAuC,EAAE;;;;;;;;;;;;;;CAc1C;IACC,wCAAwC,EAAE;;;;;;;;CAQ3C;IACC,iCAAiC,EAAE;;;;;;;;;;;;;;CAcpC;IACC,8BAA8B,EAAE;;;;;;;;;;CAUjC;IACC,8BAA8B,EAAE;;;;;;;;;;CAUjC;CACS,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
declare const deploymentSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
5
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
6
|
+
unpackagedDeploy: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
postDeploy: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
preDestructive: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
postDestructive: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
}, z.core.$strict>;
|
|
11
|
+
/** Zod equivalent of the original `deploy.schema.json`. */
|
|
12
|
+
export declare const deployConfigSchema: z.ZodObject<{
|
|
13
|
+
deployments: z.ZodArray<z.ZodObject<{
|
|
14
|
+
name: z.ZodString;
|
|
15
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
16
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
17
|
+
unpackagedDeploy: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
+
postDeploy: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
preDestructive: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
postDestructive: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
}, z.core.$strict>>;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
export type DeploymentConfig = z.infer<typeof deploymentSchema>;
|
|
24
|
+
export type DeployConfig = z.infer<typeof deployConfigSchema>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { z } from 'zod';
|
|
17
|
+
const LOCAL_NAMES = new Set(['local', 'Local', 'LOCAL']);
|
|
18
|
+
const deploymentSchema = z
|
|
19
|
+
.object({
|
|
20
|
+
name: z.string(),
|
|
21
|
+
slug: z.string().optional(),
|
|
22
|
+
ref: z.string().optional(),
|
|
23
|
+
unpackagedDeploy: z.boolean().optional(),
|
|
24
|
+
postDeploy: z.boolean().optional(),
|
|
25
|
+
preDestructive: z.boolean().optional(),
|
|
26
|
+
postDestructive: z.boolean().optional(),
|
|
27
|
+
})
|
|
28
|
+
.strict()
|
|
29
|
+
.superRefine((deployment, ctx) => {
|
|
30
|
+
if (!LOCAL_NAMES.has(deployment.name) && deployment.slug === undefined) {
|
|
31
|
+
ctx.addIssue({
|
|
32
|
+
code: z.ZodIssueCode.custom,
|
|
33
|
+
message: `Deployment "${deployment.name}" must have a "slug" unless its name is one of: ${[...LOCAL_NAMES].join(', ')}.`,
|
|
34
|
+
path: ['slug'],
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
const hasStage = deployment.unpackagedDeploy !== undefined ||
|
|
38
|
+
deployment.postDeploy !== undefined ||
|
|
39
|
+
deployment.preDestructive !== undefined ||
|
|
40
|
+
deployment.postDestructive !== undefined;
|
|
41
|
+
if (!hasStage) {
|
|
42
|
+
ctx.addIssue({
|
|
43
|
+
code: z.ZodIssueCode.custom,
|
|
44
|
+
message: `Deployment "${deployment.name}" must specify at least one of: unpackagedDeploy, postDeploy, preDestructive, postDestructive.`,
|
|
45
|
+
path: [],
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
/** Zod equivalent of the original `deploy.schema.json`. */
|
|
50
|
+
export const deployConfigSchema = z
|
|
51
|
+
.object({
|
|
52
|
+
deployments: z.array(deploymentSchema),
|
|
53
|
+
})
|
|
54
|
+
.strict();
|
|
55
|
+
//# sourceMappingURL=deployConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployConfig.js","sourceRoot":"","sources":["../../src/schemas/deployConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAEzD,MAAM,gBAAgB,GAAG,CAAC;KACvB,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,gBAAgB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACxC,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAClC,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACtC,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACxC,CAAC;KACD,MAAM,EAAE;KACR,WAAW,CAAC,CAAC,UAAU,EAAE,GAAG,EAAE,EAAE;IAC/B,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACvE,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,OAAO,EAAE,eAAe,UAAU,CAAC,IAAI,mDAAmD,CAAC,GAAG,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;YACxH,IAAI,EAAE,CAAC,MAAM,CAAC;SACf,CAAC,CAAC;IACL,CAAC;IAED,MAAM,QAAQ,GACZ,UAAU,CAAC,gBAAgB,KAAK,SAAS;QACzC,UAAU,CAAC,UAAU,KAAK,SAAS;QACnC,UAAU,CAAC,cAAc,KAAK,SAAS;QACvC,UAAU,CAAC,eAAe,KAAK,SAAS,CAAC;IAE3C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,OAAO,EAAE,eAAe,UAAU,CAAC,IAAI,gGAAgG;YACvI,IAAI,EAAE,EAAE;SACT,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,2DAA2D;AAC3D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC;KAChC,MAAM,CAAC;IACN,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;CACvC,CAAC;KACD,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** A single packaged dependency upgraded by `deploy happy-soup install-packaged`. */
|
|
3
|
+
declare const upgradedPackageSchema: z.ZodObject<{
|
|
4
|
+
packageName: z.ZodString;
|
|
5
|
+
prevVersionId: z.ZodString;
|
|
6
|
+
prevVersionNumber: z.ZodOptional<z.ZodString>;
|
|
7
|
+
prevTag: z.ZodOptional<z.ZodString>;
|
|
8
|
+
targetVersionId: z.ZodString;
|
|
9
|
+
targetVersionNumber: z.ZodOptional<z.ZodString>;
|
|
10
|
+
targetTag: z.ZodOptional<z.ZodString>;
|
|
11
|
+
targetDescription: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
/** Zod equivalent of the original `deploy_progress.schema.json`. */
|
|
14
|
+
export declare const deployProgressSchema: z.ZodObject<{
|
|
15
|
+
preDestructive: z.ZodOptional<z.ZodString>;
|
|
16
|
+
unpackagedDeploy: z.ZodOptional<z.ZodString>;
|
|
17
|
+
postDeploy: z.ZodOptional<z.ZodString>;
|
|
18
|
+
postDestructive: z.ZodOptional<z.ZodString>;
|
|
19
|
+
durations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>>;
|
|
20
|
+
upgradedPackages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
21
|
+
packageName: z.ZodString;
|
|
22
|
+
prevVersionId: z.ZodString;
|
|
23
|
+
prevVersionNumber: z.ZodOptional<z.ZodString>;
|
|
24
|
+
prevTag: z.ZodOptional<z.ZodString>;
|
|
25
|
+
targetVersionId: z.ZodString;
|
|
26
|
+
targetVersionNumber: z.ZodOptional<z.ZodString>;
|
|
27
|
+
targetTag: z.ZodOptional<z.ZodString>;
|
|
28
|
+
targetDescription: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$strip>>>;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
export type DeployProgress = z.infer<typeof deployProgressSchema>;
|
|
32
|
+
export type UpgradedPackage = z.infer<typeof upgradedPackageSchema>;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { z } from 'zod';
|
|
17
|
+
/** A single packaged dependency upgraded by `deploy happy-soup install-packaged`. */
|
|
18
|
+
const upgradedPackageSchema = z.object({
|
|
19
|
+
packageName: z.string(),
|
|
20
|
+
prevVersionId: z.string(),
|
|
21
|
+
prevVersionNumber: z.string().optional(),
|
|
22
|
+
/** The origin git commit SHA for the previous version, from that version's `report.Tag`. */
|
|
23
|
+
prevTag: z.string().optional(),
|
|
24
|
+
targetVersionId: z.string(),
|
|
25
|
+
targetVersionNumber: z.string().optional(),
|
|
26
|
+
/** The origin git commit SHA for the target version, from that version's `report.Tag`. */
|
|
27
|
+
targetTag: z.string().optional(),
|
|
28
|
+
/**
|
|
29
|
+
* The target version's `report.Description` (the origin CI pipeline URL). Used at notify time
|
|
30
|
+
* to resolve which VCS project the package's source lives in; the origin repo is assumed stable
|
|
31
|
+
* between a package's previous and target version, so only the target's URL is kept.
|
|
32
|
+
*/
|
|
33
|
+
targetDescription: z.string().optional(),
|
|
34
|
+
});
|
|
35
|
+
/** Zod equivalent of the original `deploy_progress.schema.json`. */
|
|
36
|
+
export const deployProgressSchema = z
|
|
37
|
+
.object({
|
|
38
|
+
preDestructive: z.string().optional(),
|
|
39
|
+
unpackagedDeploy: z.string().optional(),
|
|
40
|
+
postDeploy: z.string().optional(),
|
|
41
|
+
postDestructive: z.string().optional(),
|
|
42
|
+
durations: z.record(z.string(), z.record(z.string(), z.number())).optional(),
|
|
43
|
+
upgradedPackages: z.array(upgradedPackageSchema).optional(),
|
|
44
|
+
})
|
|
45
|
+
.strict();
|
|
46
|
+
//# sourceMappingURL=deployProgress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployProgress.js","sourceRoot":"","sources":["../../src/schemas/deployProgress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,CAA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0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const deployStageSchema: z.ZodEnum<{
|
|
3
|
+
preDestructive: "preDestructive";
|
|
4
|
+
unpackagedDeploy: "unpackagedDeploy";
|
|
5
|
+
postDeploy: "postDeploy";
|
|
6
|
+
postDestructive: "postDestructive";
|
|
7
|
+
}>;
|
|
8
|
+
declare const deployRuleSchema: z.ZodObject<{
|
|
9
|
+
deploymentName: z.ZodOptional<z.ZodString>;
|
|
10
|
+
deploymentSlug: z.ZodOptional<z.ZodString>;
|
|
11
|
+
requireStages: z.ZodArray<z.ZodEnum<{
|
|
12
|
+
preDestructive: "preDestructive";
|
|
13
|
+
unpackagedDeploy: "unpackagedDeploy";
|
|
14
|
+
postDeploy: "postDeploy";
|
|
15
|
+
postDestructive: "postDestructive";
|
|
16
|
+
}>>;
|
|
17
|
+
}, z.core.$strict>;
|
|
18
|
+
/** Zod equivalent of the original `deploy-rules.schema.json`. */
|
|
19
|
+
export declare const deployRulesSchema: z.ZodObject<{
|
|
20
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
21
|
+
deploymentName: z.ZodOptional<z.ZodString>;
|
|
22
|
+
deploymentSlug: z.ZodOptional<z.ZodString>;
|
|
23
|
+
requireStages: z.ZodArray<z.ZodEnum<{
|
|
24
|
+
preDestructive: "preDestructive";
|
|
25
|
+
unpackagedDeploy: "unpackagedDeploy";
|
|
26
|
+
postDeploy: "postDeploy";
|
|
27
|
+
postDestructive: "postDestructive";
|
|
28
|
+
}>>;
|
|
29
|
+
}, z.core.$strict>>;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
export type DeployStage = z.infer<typeof deployStageSchema>;
|
|
32
|
+
export type DeployRule = z.infer<typeof deployRuleSchema>;
|
|
33
|
+
export type DeployRules = z.infer<typeof deployRulesSchema>;
|
|
34
|
+
export {};
|