projen-pipelines 0.2.11 → 0.2.13

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.
@@ -0,0 +1,63 @@
1
+ import { VersioningStrategy } from './strategy';
2
+ import { IVersioningStrategy } from './types';
3
+ import { VersionInfo } from './version-info';
4
+ /**
5
+ * Git information extracted from repository
6
+ */
7
+ export interface GitInfo {
8
+ readonly commitHash: string;
9
+ readonly commitHashShort: string;
10
+ readonly branch: string;
11
+ readonly tag?: string;
12
+ readonly commitsSinceTag?: number;
13
+ readonly commitCount: number;
14
+ readonly packageVersion?: string;
15
+ }
16
+ /**
17
+ * Context for version computation
18
+ */
19
+ export interface ComputationContext {
20
+ readonly gitInfo: GitInfo;
21
+ readonly environment: string;
22
+ readonly deployedBy: string;
23
+ readonly buildNumber?: string;
24
+ readonly repository?: string;
25
+ readonly pipelineVersion?: string;
26
+ }
27
+ /**
28
+ * Base class for version computation strategies
29
+ */
30
+ export declare abstract class VersionComputationStrategy {
31
+ readonly strategy: VersioningStrategy;
32
+ protected constructor(strategy: VersioningStrategy);
33
+ /**
34
+ * Compute version string from context
35
+ */
36
+ abstract computeVersion(context: ComputationContext): string;
37
+ /**
38
+ * Create VersionInfo from context
39
+ */
40
+ createVersionInfo(context: ComputationContext): VersionInfo;
41
+ }
42
+ /**
43
+ * Composite version computation that combines multiple strategies
44
+ */
45
+ export declare class CompositeComputation extends VersionComputationStrategy {
46
+ constructor(strategy: VersioningStrategy);
47
+ computeVersion(context: ComputationContext): string;
48
+ }
49
+ /**
50
+ * Main version computer that handles strategy selection
51
+ */
52
+ export declare class VersionComputer {
53
+ private readonly strategy;
54
+ constructor(strategy: IVersioningStrategy);
55
+ /**
56
+ * Compute version info from context
57
+ */
58
+ computeVersionInfo(context: ComputationContext): Promise<VersionInfo>;
59
+ /**
60
+ * Create strategy instance from configuration
61
+ */
62
+ private createStrategy;
63
+ }
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ var _a, _b, _c;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.VersionComputer = exports.CompositeComputation = exports.VersionComputationStrategy = void 0;
5
+ const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
6
+ const version_info_1 = require("./version-info");
7
+ /**
8
+ * Base class for version computation strategies
9
+ */
10
+ class VersionComputationStrategy {
11
+ constructor(strategy) {
12
+ this.strategy = strategy;
13
+ }
14
+ /**
15
+ * Create VersionInfo from context
16
+ */
17
+ createVersionInfo(context) {
18
+ const version = this.computeVersion(context);
19
+ return version_info_1.VersionInfo.create({
20
+ version,
21
+ commitHash: context.gitInfo.commitHash,
22
+ commitHashShort: context.gitInfo.commitHashShort,
23
+ branch: context.gitInfo.branch,
24
+ tag: context.gitInfo.tag,
25
+ commitsSinceTag: context.gitInfo.commitsSinceTag,
26
+ commitCount: context.gitInfo.commitCount,
27
+ packageVersion: context.gitInfo.packageVersion,
28
+ deployedAt: new Date().toISOString(),
29
+ deployedBy: context.deployedBy,
30
+ buildNumber: context.buildNumber,
31
+ environment: context.environment,
32
+ repository: context.repository,
33
+ pipelineVersion: context.pipelineVersion,
34
+ });
35
+ }
36
+ }
37
+ exports.VersionComputationStrategy = VersionComputationStrategy;
38
+ _a = JSII_RTTI_SYMBOL_1;
39
+ VersionComputationStrategy[_a] = { fqn: "projen-pipelines.VersionComputationStrategy", version: "0.2.13" };
40
+ /**
41
+ * Composite version computation that combines multiple strategies
42
+ */
43
+ class CompositeComputation extends VersionComputationStrategy {
44
+ constructor(strategy) {
45
+ super(strategy);
46
+ }
47
+ computeVersion(context) {
48
+ let result = this.strategy.format;
49
+ const { gitInfo } = context;
50
+ // Replace git tag variables
51
+ if (this.strategy.components.gitTag) {
52
+ let tagValue = gitInfo.tag ?? '0.0.0';
53
+ if (this.strategy.components.gitTag.stripPrefix && gitInfo.tag) {
54
+ tagValue = gitInfo.tag.replace(new RegExp(`^${this.strategy.components.gitTag.stripPrefix}`), '');
55
+ }
56
+ result = result.replace('{git-tag}', tagValue);
57
+ }
58
+ // Replace package version
59
+ if (this.strategy.components.packageJson) {
60
+ const packageValue = gitInfo.packageVersion ?? '0.0.0';
61
+ result = result.replace('{package-version}', packageValue);
62
+ }
63
+ // Replace commit count
64
+ if (this.strategy.components.commitCount) {
65
+ let countValue;
66
+ if (this.strategy.components.commitCount.countFrom === 'since-tag' && gitInfo.commitsSinceTag !== undefined) {
67
+ countValue = gitInfo.commitsSinceTag.toString();
68
+ }
69
+ else {
70
+ // Default to total commit count for 'all' or undefined
71
+ countValue = gitInfo.commitCount.toString();
72
+ }
73
+ if (this.strategy.components.commitCount.padding) {
74
+ countValue = countValue.padStart(this.strategy.components.commitCount.padding, '0');
75
+ }
76
+ result = result.replace('{commit-count}', countValue);
77
+ }
78
+ // Replace commit hash
79
+ result = result.replace('{commit-hash}', gitInfo.commitHash);
80
+ result = result.replace('{commit-hash:8}', gitInfo.commitHashShort);
81
+ // Replace branch
82
+ result = result.replace('{branch}', gitInfo.branch);
83
+ // Replace build number
84
+ if (context.buildNumber) {
85
+ result = result.replace('{build-number}', context.buildNumber);
86
+ }
87
+ return result;
88
+ }
89
+ }
90
+ exports.CompositeComputation = CompositeComputation;
91
+ _b = JSII_RTTI_SYMBOL_1;
92
+ CompositeComputation[_b] = { fqn: "projen-pipelines.CompositeComputation", version: "0.2.13" };
93
+ /**
94
+ * Main version computer that handles strategy selection
95
+ */
96
+ class VersionComputer {
97
+ constructor(strategy) {
98
+ this.strategy = this.createStrategy(strategy);
99
+ }
100
+ /**
101
+ * Compute version info from context
102
+ */
103
+ async computeVersionInfo(context) {
104
+ try {
105
+ return this.strategy.createVersionInfo(context);
106
+ }
107
+ catch (error) {
108
+ throw new Error(`Strategy '${this.strategy.strategy.format}' failed: ${error}`);
109
+ }
110
+ }
111
+ /**
112
+ * Create strategy instance from configuration
113
+ */
114
+ createStrategy(strategy) {
115
+ return new CompositeComputation(strategy);
116
+ }
117
+ }
118
+ exports.VersionComputer = VersionComputer;
119
+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gICByZXR1cm4gbmV3IENvbXBvc2l0ZUNvbXB1dGF0aW9uKHN0cmF0ZWd5KTtcbiAgfVxufVxuIl19
@@ -0,0 +1,41 @@
1
+ import { VersioningConfig, IVersioningStrategy, StandardConfigOptions, VersioningOutputConfig, StageOverrides } from './types';
2
+ export interface CustomVersioningConfig {
3
+ readonly enabled?: boolean;
4
+ readonly strategy: IVersioningStrategy;
5
+ readonly outputs: VersioningOutputConfig;
6
+ readonly stageOverrides?: StageOverrides;
7
+ }
8
+ /**
9
+ * Main versioning configuration class with factory methods
10
+ */
11
+ export declare class VersioningConfigurations {
12
+ /**
13
+ * Standard configuration with commit count strategy
14
+ */
15
+ static standard(options?: StandardConfigOptions): VersioningConfig;
16
+ /**
17
+ * Minimal configuration for testing
18
+ */
19
+ static minimal(): VersioningConfig;
20
+ /**
21
+ * Create a custom configuration
22
+ */
23
+ static custom(config: CustomVersioningConfig): VersioningConfig;
24
+ }
25
+ /**
26
+ * Utility functions for versioning configuration
27
+ */
28
+ export declare class VersioningConfigUtils {
29
+ /**
30
+ * Resolve configuration for a specific stage
31
+ */
32
+ static resolveForStage(config: VersioningConfig, stage: string): VersioningConfig;
33
+ /**
34
+ * Validate configuration
35
+ */
36
+ static validate(config: VersioningConfig): string[];
37
+ /**
38
+ * Get default configuration
39
+ */
40
+ static default(): VersioningConfig;
41
+ }
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ var _a, _b;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.VersioningConfigUtils = exports.VersioningConfigurations = void 0;
5
+ const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
6
+ const outputs_1 = require("./outputs");
7
+ const strategy_1 = require("./strategy");
8
+ /**
9
+ * Main versioning configuration class with factory methods
10
+ */
11
+ class VersioningConfigurations {
12
+ /**
13
+ * Standard configuration with commit count strategy
14
+ */
15
+ static standard(options) {
16
+ return {
17
+ enabled: true,
18
+ strategy: strategy_1.VersioningStrategy.commitCount(),
19
+ outputs: outputs_1.VersioningOutputs.standard({
20
+ parameterName: typeof options?.parameterStore === 'string' ? options.parameterStore : undefined,
21
+ format: options?.format,
22
+ }),
23
+ };
24
+ }
25
+ /**
26
+ * Minimal configuration for testing
27
+ */
28
+ static minimal() {
29
+ return {
30
+ enabled: true,
31
+ strategy: strategy_1.VersioningStrategy.commitHash(),
32
+ outputs: outputs_1.VersioningOutputs.minimal(),
33
+ };
34
+ }
35
+ /**
36
+ * Create a custom configuration
37
+ */
38
+ static custom(config) {
39
+ return {
40
+ enabled: config.enabled ?? true,
41
+ strategy: config.strategy,
42
+ outputs: config.outputs,
43
+ stageOverrides: config.stageOverrides,
44
+ };
45
+ }
46
+ }
47
+ exports.VersioningConfigurations = VersioningConfigurations;
48
+ _a = JSII_RTTI_SYMBOL_1;
49
+ VersioningConfigurations[_a] = { fqn: "projen-pipelines.VersioningConfigurations", version: "0.2.13" };
50
+ /**
51
+ * Utility functions for versioning configuration
52
+ */
53
+ class VersioningConfigUtils {
54
+ /**
55
+ * Resolve configuration for a specific stage
56
+ */
57
+ static resolveForStage(config, stage) {
58
+ const stageOverride = config.stageOverrides?.[stage];
59
+ if (!stageOverride) {
60
+ return config;
61
+ }
62
+ return {
63
+ ...config,
64
+ ...stageOverride,
65
+ outputs: stageOverride.outputs ? { ...config.outputs, ...stageOverride.outputs } : config.outputs,
66
+ };
67
+ }
68
+ /**
69
+ * Validate configuration
70
+ */
71
+ static validate(config) {
72
+ const errors = [];
73
+ if (!config.strategy) {
74
+ errors.push('Strategy is required');
75
+ }
76
+ if (!config.outputs) {
77
+ errors.push('Outputs configuration is required');
78
+ }
79
+ return errors;
80
+ }
81
+ /**
82
+ * Get default configuration
83
+ */
84
+ static default() {
85
+ return VersioningConfigurations.standard();
86
+ }
87
+ }
88
+ exports.VersioningConfigUtils = VersioningConfigUtils;
89
+ _b = JSII_RTTI_SYMBOL_1;
90
+ VersioningConfigUtils[_b] = { fqn: "projen-pipelines.VersioningConfigUtils", version: "0.2.13" };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CFjb25maWcub3V0cHV0cykge1xuICAgICAgZXJyb3JzLnB1c2goJ091dHB1dHMgY29uZmlndXJhdGlvbiBpcyByZXF1aXJlZCcpO1xuICAgIH1cblxuICAgIHJldHVybiBlcnJvcnM7XG4gIH1cblxuICAvKipcbiAgICogR2V0IGRlZmF1bHQgY29uZmlndXJhdGlvblxuICAgKi9cbiAgcHVibGljIHN0YXRpYyBkZWZhdWx0KCk6IFZlcnNpb25pbmdDb25maWcge1xuICAgIHJldHVybiBWZXJzaW9uaW5nQ29uZmlndXJhdGlvbnMuc3RhbmRhcmQoKTtcbiAgfVxufSJdfQ==
@@ -0,0 +1,7 @@
1
+ export * from './types';
2
+ export { VersionInfo, VersionInfoBuilder } from './version-info';
3
+ export { VersioningStrategy, } from './strategy';
4
+ export { OutputConfigBase, CloudFormationOutput, ParameterStoreOutput, OutputFormat, VersioningOutputs, } from './outputs';
5
+ export { GitInfo, ComputationContext, VersionComputationStrategy, CompositeComputation, VersionComputer, } from './computation';
6
+ export { CustomVersioningConfig, VersioningConfigurations, VersioningConfigUtils, } from './config';
7
+ export { VersioningSetup, } from './setup';
@@ -0,0 +1,46 @@
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
+ exports.VersioningSetup = exports.VersioningConfigUtils = exports.VersioningConfigurations = exports.VersionComputer = exports.CompositeComputation = exports.VersionComputationStrategy = exports.VersioningOutputs = exports.OutputFormat = exports.ParameterStoreOutput = exports.CloudFormationOutput = exports.OutputConfigBase = exports.VersioningStrategy = exports.VersionInfoBuilder = exports.VersionInfo = void 0;
18
+ // Types
19
+ __exportStar(require("./types"), exports);
20
+ // Version Information
21
+ var version_info_1 = require("./version-info");
22
+ Object.defineProperty(exports, "VersionInfo", { enumerable: true, get: function () { return version_info_1.VersionInfo; } });
23
+ Object.defineProperty(exports, "VersionInfoBuilder", { enumerable: true, get: function () { return version_info_1.VersionInfoBuilder; } });
24
+ // Strategies
25
+ var strategy_1 = require("./strategy");
26
+ Object.defineProperty(exports, "VersioningStrategy", { enumerable: true, get: function () { return strategy_1.VersioningStrategy; } });
27
+ // Outputs
28
+ var outputs_1 = require("./outputs");
29
+ Object.defineProperty(exports, "OutputConfigBase", { enumerable: true, get: function () { return outputs_1.OutputConfigBase; } });
30
+ Object.defineProperty(exports, "CloudFormationOutput", { enumerable: true, get: function () { return outputs_1.CloudFormationOutput; } });
31
+ Object.defineProperty(exports, "ParameterStoreOutput", { enumerable: true, get: function () { return outputs_1.ParameterStoreOutput; } });
32
+ Object.defineProperty(exports, "OutputFormat", { enumerable: true, get: function () { return outputs_1.OutputFormat; } });
33
+ Object.defineProperty(exports, "VersioningOutputs", { enumerable: true, get: function () { return outputs_1.VersioningOutputs; } });
34
+ // Computation
35
+ var computation_1 = require("./computation");
36
+ Object.defineProperty(exports, "VersionComputationStrategy", { enumerable: true, get: function () { return computation_1.VersionComputationStrategy; } });
37
+ Object.defineProperty(exports, "CompositeComputation", { enumerable: true, get: function () { return computation_1.CompositeComputation; } });
38
+ Object.defineProperty(exports, "VersionComputer", { enumerable: true, get: function () { return computation_1.VersionComputer; } });
39
+ // Configuration
40
+ var config_1 = require("./config");
41
+ Object.defineProperty(exports, "VersioningConfigurations", { enumerable: true, get: function () { return config_1.VersioningConfigurations; } });
42
+ Object.defineProperty(exports, "VersioningConfigUtils", { enumerable: true, get: function () { return config_1.VersioningConfigUtils; } });
43
+ // Setup
44
+ var setup_1 = require("./setup");
45
+ Object.defineProperty(exports, "VersioningSetup", { enumerable: true, get: function () { return setup_1.VersioningSetup; } });
46
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdmVyc2lvbmluZy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLFFBQVE7QUFDUiwwQ0FBd0I7QUFFeEIsc0JBQXNCO0FBQ3RCLCtDQUFpRTtBQUF4RCwyR0FBQSxXQUFXLE9BQUE7QUFBRSxrSEFBQSxrQkFBa0IsT0FBQTtBQUV4QyxhQUFhO0FBQ2IsdUNBRW9CO0FBRGxCLDhHQUFBLGtCQUFrQixPQUFBO0FBR3BCLFVBQVU7QUFDVixxQ0FNbUI7QUFMakIsMkdBQUEsZ0JBQWdCLE9BQUE7QUFDaEIsK0dBQUEsb0JBQW9CLE9BQUE7QUFDcEIsK0dBQUEsb0JBQW9CLE9BQUE7QUFDcEIsdUdBQUEsWUFBWSxPQUFBO0FBQ1osNEdBQUEsaUJBQWlCLE9BQUE7QUFHbkIsY0FBYztBQUNkLDZDQU11QjtBQUhyQix5SEFBQSwwQkFBMEIsT0FBQTtBQUMxQixtSEFBQSxvQkFBb0IsT0FBQTtBQUNwQiw4R0FBQSxlQUFlLE9BQUE7QUFHakIsZ0JBQWdCO0FBQ2hCLG1DQUlrQjtBQUZoQixrSEFBQSx3QkFBd0IsT0FBQTtBQUN4QiwrR0FBQSxxQkFBcUIsT0FBQTtBQUd2QixRQUFRO0FBQ1IsaUNBRWlCO0FBRGYsd0dBQUEsZUFBZSxPQUFBIiwic291cmNlc0NvbnRlbnQiOlsiLy8gVHlwZXNcbmV4cG9ydCAqIGZyb20gJy4vdHlwZXMnO1xuXG4vLyBWZXJzaW9uIEluZm9ybWF0aW9uXG5leHBvcnQgeyBWZXJzaW9uSW5mbywgVmVyc2lvbkluZm9CdWlsZGVyIH0gZnJvbSAnLi92ZXJzaW9uLWluZm8nO1xuXG4vLyBTdHJhdGVnaWVzXG5leHBvcnQge1xuICBWZXJzaW9uaW5nU3RyYXRlZ3ksXG59IGZyb20gJy4vc3RyYXRlZ3knO1xuXG4vLyBPdXRwdXRzXG5leHBvcnQge1xuICBPdXRwdXRDb25maWdCYXNlLFxuICBDbG91ZEZvcm1hdGlvbk91dHB1dCxcbiAgUGFyYW1ldGVyU3RvcmVPdXRwdXQsXG4gIE91dHB1dEZvcm1hdCxcbiAgVmVyc2lvbmluZ091dHB1dHMsXG59IGZyb20gJy4vb3V0cHV0cyc7XG5cbi8vIENvbXB1dGF0aW9uXG5leHBvcnQge1xuICBHaXRJbmZvLFxuICBDb21wdXRhdGlvbkNvbnRleHQsXG4gIFZlcnNpb25Db21wdXRhdGlvblN0cmF0ZWd5LFxuICBDb21wb3NpdGVDb21wdXRhdGlvbixcbiAgVmVyc2lvbkNvbXB1dGVyLFxufSBmcm9tICcuL2NvbXB1dGF0aW9uJztcblxuLy8gQ29uZmlndXJhdGlvblxuZXhwb3J0IHtcbiAgQ3VzdG9tVmVyc2lvbmluZ0NvbmZpZyxcbiAgVmVyc2lvbmluZ0NvbmZpZ3VyYXRpb25zLFxuICBWZXJzaW9uaW5nQ29uZmlnVXRpbHMsXG59IGZyb20gJy4vY29uZmlnJztcblxuLy8gU2V0dXBcbmV4cG9ydCB7XG4gIFZlcnNpb25pbmdTZXR1cCxcbn0gZnJvbSAnLi9zZXR1cCc7XG4iXX0=
@@ -0,0 +1,87 @@
1
+ import { CloudFormationOutputConfig, ParameterStoreConfig, VersioningOutputConfig, StandardOutputOptions, CloudFormationOnlyOptions, HierarchicalParametersOptions } from './types';
2
+ /**
3
+ * Base class for output configurations
4
+ */
5
+ export declare abstract class OutputConfigBase {
6
+ readonly type: string;
7
+ protected constructor(type: string);
8
+ /**
9
+ * Convert to configuration object
10
+ */
11
+ abstract toConfig(): any;
12
+ }
13
+ /**
14
+ * CloudFormation output configuration
15
+ */
16
+ export declare class CloudFormationOutput extends OutputConfigBase {
17
+ private readonly config?;
18
+ static readonly TYPE = "cloudformation";
19
+ /**
20
+ * Enable CloudFormation outputs with default configuration
21
+ */
22
+ static enabled(): CloudFormationOutput;
23
+ /**
24
+ * Disable CloudFormation outputs
25
+ */
26
+ static disabled(): CloudFormationOutput;
27
+ /**
28
+ * Configure CloudFormation outputs with custom settings
29
+ */
30
+ static withConfig(config: CloudFormationOutputConfig): CloudFormationOutput;
31
+ private constructor();
32
+ toConfig(): any;
33
+ }
34
+ /**
35
+ * SSM Parameter Store output configuration
36
+ */
37
+ export declare class ParameterStoreOutput extends OutputConfigBase {
38
+ private readonly config?;
39
+ static readonly TYPE = "parameterStore";
40
+ /**
41
+ * Enable Parameter Store outputs with parameter name
42
+ */
43
+ static enabled(parameterName: string): ParameterStoreOutput;
44
+ /**
45
+ * Disable Parameter Store outputs
46
+ */
47
+ static disabled(): ParameterStoreOutput;
48
+ /**
49
+ * Configure Parameter Store outputs with custom settings
50
+ */
51
+ static withConfig(config: ParameterStoreConfig): ParameterStoreOutput;
52
+ /**
53
+ * Configure Parameter Store with hierarchical parameters
54
+ */
55
+ static hierarchical(basePath: string, options?: HierarchicalParametersOptions): ParameterStoreOutput;
56
+ private constructor();
57
+ toConfig(): any;
58
+ }
59
+ /**
60
+ * Output format types
61
+ */
62
+ export declare class OutputFormat {
63
+ static readonly PLAIN: "plain";
64
+ static readonly STRUCTURED: "structured";
65
+ private constructor();
66
+ }
67
+ /**
68
+ * Factory class for output configurations
69
+ */
70
+ export declare class VersioningOutputs {
71
+ /**
72
+ * Create output configuration with CloudFormation and SSM Parameter Store
73
+ */
74
+ static standard(options?: StandardOutputOptions): VersioningOutputConfig;
75
+ /**
76
+ * Create output configuration with only CloudFormation
77
+ */
78
+ static cloudFormationOnly(options?: CloudFormationOnlyOptions): VersioningOutputConfig;
79
+ /**
80
+ * Create output configuration with hierarchical SSM parameters
81
+ */
82
+ static hierarchicalParameters(basePath: string, options?: HierarchicalParametersOptions): VersioningOutputConfig;
83
+ /**
84
+ * Create minimal output configuration (CloudFormation only, plain format)
85
+ */
86
+ static minimal(): VersioningOutputConfig;
87
+ }