@firestartr/cli 1.47.0 → 1.48.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/build/index.js +1297 -766
- package/build/packages/catalog_common/index.d.ts +8 -0
- package/build/packages/catalog_common/src/io/write.d.ts +2 -2
- package/build/packages/catalog_common/src/logger/index.d.ts +2 -0
- package/build/packages/catalog_common/src/logger/logger.d.ts +9 -0
- package/build/packages/catalog_common/src/logger/utils.d.ts +1 -0
- package/build/packages/features_preparer/src/logger.d.ts +9 -0
- package/build/packages/features_renderer/index.d.ts +10 -1
- package/build/packages/features_renderer/src/auxiliar.d.ts +71 -0
- package/build/packages/features_renderer/src/render.d.ts +2 -0
- package/build/packages/github/index.d.ts +5 -0
- package/build/packages/github/src/check_run.d.ts +83 -0
- package/build/packages/github/src/logger.d.ts +9 -0
- package/build/packages/operator/src/logger.d.ts +2 -2
- package/build/packages/operator/src/user-feedback-ops/gh-checkrun.d.ts +5 -0
- package/build/packages/operator/src/user-feedback-ops/tf-checkrun.d.ts +5 -0
- package/build/packages/provisioner/src/cdktf.d.ts +3 -1
- package/build/packages/provisioner/src/logger.d.ts +9 -0
- package/build/packages/provisioner/src/resources/resource.d.ts +10 -0
- package/build/packages/provisioner/src/terraform.d.ts +7 -5
- package/build/packages/terraform_provisioner/index.d.ts +1 -1
- package/build/packages/terraform_provisioner/src/logger.d.ts +9 -0
- package/build/packages/terraform_provisioner/src/project_tf.d.ts +4 -0
- package/build/packages/terraform_provisioner/src/project_tf_remote.d.ts +4 -0
- package/build/packages/terraform_provisioner/src/utils.d.ts +8 -6
- package/package.json +1 -1
|
@@ -88,5 +88,13 @@ declare const _default: {
|
|
|
88
88
|
allowedOps: string[];
|
|
89
89
|
}[];
|
|
90
90
|
};
|
|
91
|
+
logger: {
|
|
92
|
+
error: (...args: any) => void;
|
|
93
|
+
warn: (...args: any) => void;
|
|
94
|
+
info: (...args: any) => void;
|
|
95
|
+
debug: (...args: any) => void;
|
|
96
|
+
verbose: (...args: any) => void;
|
|
97
|
+
silly: (...args: any) => void;
|
|
98
|
+
};
|
|
91
99
|
};
|
|
92
100
|
export default _default;
|
|
@@ -5,5 +5,5 @@ export declare function renameEntity(entity: any, catalogPath: string, oldname:
|
|
|
5
5
|
export declare function removeEntity(entity: any, catalogPath: string): void;
|
|
6
6
|
export declare function removeFile(path: string): void;
|
|
7
7
|
export declare function moveFile(oldPath: string, newPath: string): void;
|
|
8
|
-
export declare function writeFunctionLog(functionName: string,
|
|
9
|
-
export declare function writeLogFile(fileName: string,
|
|
8
|
+
export declare function writeFunctionLog(functionName: string, logStream: string): void;
|
|
9
|
+
export declare function writeLogFile(fileName: string, logStream: string): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function fixCircularReferences(o: any): (k: string | symbol | number, v: any) => any;
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import validate from './src/validate';
|
|
2
|
-
import render from './src/render';
|
|
2
|
+
import render, { buildContext, renderContent } from './src/render';
|
|
3
3
|
import updateFileContent from './src/update_file';
|
|
4
4
|
declare const _default: {
|
|
5
5
|
validate: typeof validate;
|
|
6
6
|
render: typeof render;
|
|
7
7
|
updateFileContent: typeof updateFileContent;
|
|
8
|
+
auxiliar: {
|
|
9
|
+
mkNamedTmp: (...names: string[]) => Promise<string>;
|
|
10
|
+
loadYaml: <T = unknown>(file: string) => T;
|
|
11
|
+
buildExpectedOutput: (config: import("./src/auxiliar").FeatureConfig, renderDir: string) => import("./src/auxiliar").ExpectedOutput;
|
|
12
|
+
loadAndValidateRenderTests: (featurePath: string) => import("./src/auxiliar").RenderTestsFile;
|
|
13
|
+
resolveCrPath: (featurePath: string, crRelPath: string) => string;
|
|
14
|
+
};
|
|
15
|
+
buildContext: typeof buildContext;
|
|
16
|
+
renderContent: typeof renderContent;
|
|
8
17
|
};
|
|
9
18
|
export default _default;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
export interface ConfigFile {
|
|
5
|
+
dest: string;
|
|
6
|
+
src: string;
|
|
7
|
+
user_managed: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface FeatureConfig {
|
|
10
|
+
files?: ConfigFile[];
|
|
11
|
+
patches?: unknown[];
|
|
12
|
+
}
|
|
13
|
+
export interface ExpectedFile {
|
|
14
|
+
localPath: string;
|
|
15
|
+
repoPath: string;
|
|
16
|
+
userManaged: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface ExpectedOutput {
|
|
19
|
+
files: ExpectedFile[];
|
|
20
|
+
patches: unknown[];
|
|
21
|
+
}
|
|
22
|
+
export interface RenderTest {
|
|
23
|
+
name: string;
|
|
24
|
+
cr: string;
|
|
25
|
+
args?: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
export interface RenderTestsFile {
|
|
28
|
+
tests: RenderTest[];
|
|
29
|
+
}
|
|
30
|
+
export interface RenderContext {
|
|
31
|
+
/** Absolute path to the temp dir */
|
|
32
|
+
getContextPath: () => string;
|
|
33
|
+
/** Join a relative path inside the temp dir */
|
|
34
|
+
join: (...p: string[]) => string;
|
|
35
|
+
/** Read a file (raw / JSON / YAML) from the temp dir */
|
|
36
|
+
getFile: <T = unknown>(relPath: string, opts?: {
|
|
37
|
+
yaml?: boolean;
|
|
38
|
+
json?: boolean;
|
|
39
|
+
}) => Promise<T | string>;
|
|
40
|
+
/** Absolute path of a file in the temp dir (no existence check) */
|
|
41
|
+
getFilePath: (relPath: string) => string;
|
|
42
|
+
/** Write a file (ensures parent dirs) */
|
|
43
|
+
setFile: (relPath: string, contents: string | Buffer | NodeJS.ArrayBufferView) => Promise<void>;
|
|
44
|
+
/** Whether a path exists in the temp dir */
|
|
45
|
+
exists: (relPath: string) => Promise<boolean>;
|
|
46
|
+
/** Convenience: read output.json from the temp dir */
|
|
47
|
+
getOutputJson: <T = unknown>() => Promise<T>;
|
|
48
|
+
/** List entries (name + isDir) in a subdirectory */
|
|
49
|
+
list: (relPath?: string) => Promise<Array<{
|
|
50
|
+
name: string;
|
|
51
|
+
isDir: boolean;
|
|
52
|
+
}>>;
|
|
53
|
+
/** Optional cleanup */
|
|
54
|
+
remove: () => Promise<void>;
|
|
55
|
+
}
|
|
56
|
+
declare function loadAndValidateRenderTests(featurePath: string): RenderTestsFile;
|
|
57
|
+
declare function resolveCrPath(featurePath: string, crRelPath: string): string;
|
|
58
|
+
export declare function listYamlFiles(dir: string): string[];
|
|
59
|
+
declare function loadYaml<T = unknown>(file: string): T;
|
|
60
|
+
declare function mkNamedTmp(...names: string[]): Promise<string>;
|
|
61
|
+
export declare function mkTmp(prefix?: string): Promise<string>;
|
|
62
|
+
declare function buildExpectedOutput(config: FeatureConfig, renderDir: string): ExpectedOutput;
|
|
63
|
+
export declare function createRenderContext(prefix?: string): Promise<RenderContext>;
|
|
64
|
+
declare const _default: {
|
|
65
|
+
mkNamedTmp: typeof mkNamedTmp;
|
|
66
|
+
loadYaml: typeof loadYaml;
|
|
67
|
+
buildExpectedOutput: typeof buildExpectedOutput;
|
|
68
|
+
loadAndValidateRenderTests: typeof loadAndValidateRenderTests;
|
|
69
|
+
resolveCrPath: typeof resolveCrPath;
|
|
70
|
+
};
|
|
71
|
+
export default _default;
|
|
@@ -1 +1,3 @@
|
|
|
1
1
|
export default function render(featurePath: string, featureRenderPath: string, entity: any, firestartrConfig?: any, featureArgs?: any): any;
|
|
2
|
+
export declare function buildContext(entity: any, args: any, firestartrConfig: any, featureArgs: any): any;
|
|
3
|
+
export declare function renderContent(template: string, ctx: any): string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createCheckRun } from './src/check_run';
|
|
1
2
|
import { getOctokitForOrg, getGithubAppToken, getOctokitFromPat } from './src/auth';
|
|
2
3
|
declare const _default: {
|
|
3
4
|
org: {
|
|
@@ -72,5 +73,9 @@ declare const _default: {
|
|
|
72
73
|
createBranch: typeof import("./src/branches").createBranch;
|
|
73
74
|
createOrphanBranch: typeof import("./src/branches").createOrphanBranch;
|
|
74
75
|
};
|
|
76
|
+
feedback: {
|
|
77
|
+
createCheckRun: typeof createCheckRun;
|
|
78
|
+
CheckRun: typeof import("./src/check_run").GithubCheckRun;
|
|
79
|
+
};
|
|
75
80
|
};
|
|
76
81
|
export default _default;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { Octokit } from '@octokit/rest';
|
|
2
|
+
export type CheckRunStatus = 'queued' | 'in_progress' | 'completed';
|
|
3
|
+
export type CheckRunConclusion = 'success' | 'failure' | 'neutral' | 'cancelled' | 'timed_out' | 'action_required' | 'skipped';
|
|
4
|
+
export interface GithubCheckRunParams {
|
|
5
|
+
owner: string;
|
|
6
|
+
repo: string;
|
|
7
|
+
headSHA: string;
|
|
8
|
+
name: string;
|
|
9
|
+
detailsUrl?: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
summary?: string;
|
|
12
|
+
pullNumber?: number;
|
|
13
|
+
includeCheckRunComment?: boolean;
|
|
14
|
+
checkRunComment?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class GithubCheckRun {
|
|
17
|
+
private readonly octokit;
|
|
18
|
+
private readonly owner;
|
|
19
|
+
private readonly repo;
|
|
20
|
+
private readonly headSHA;
|
|
21
|
+
private readonly name;
|
|
22
|
+
private readonly detailsUrl?;
|
|
23
|
+
private readonly title;
|
|
24
|
+
private readonly pullNumber?;
|
|
25
|
+
private readonly includeCheckRunComment;
|
|
26
|
+
private readonly checkRunComment?;
|
|
27
|
+
private hasCommented;
|
|
28
|
+
private closing;
|
|
29
|
+
private closed;
|
|
30
|
+
private buffer;
|
|
31
|
+
private checkRunId?;
|
|
32
|
+
private lastStatus;
|
|
33
|
+
private detailsFormatter;
|
|
34
|
+
private _summaryOverride?;
|
|
35
|
+
constructor(octokit: Octokit, params: GithubCheckRunParams);
|
|
36
|
+
/**
|
|
37
|
+
* Configure markdown formatting for the details (output.text).
|
|
38
|
+
* Example: ch.mdOptionsDetails({ quotes: 'terraform' })
|
|
39
|
+
* Result:
|
|
40
|
+
* ```terraform
|
|
41
|
+
* <log>
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
mdOptionsDetails(opts: {
|
|
45
|
+
quotes: string;
|
|
46
|
+
}): void;
|
|
47
|
+
set summary(data: string);
|
|
48
|
+
get summary(): string | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Append log text and optionally set status ('queued' | 'in_progress').
|
|
51
|
+
*/
|
|
52
|
+
update(text: string, status?: Exclude<CheckRunStatus, 'completed'>): void;
|
|
53
|
+
/**
|
|
54
|
+
* Finalize the check with a conclusion. Flushes buffered text, marks completed.
|
|
55
|
+
*/
|
|
56
|
+
close(finalText: string, ok: boolean): Promise<void>;
|
|
57
|
+
private __ensureCreated;
|
|
58
|
+
private __updateCheckRun;
|
|
59
|
+
private __buildCheckRunUrl;
|
|
60
|
+
private buildOutputTextAndSummary;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Factory: build a GithubCheckRun using an installation token for the given org.
|
|
64
|
+
*/
|
|
65
|
+
export declare function createCheckRunForOrg(org: string, owner: string, repo: string, name: string, opts?: {
|
|
66
|
+
headSHA?: string;
|
|
67
|
+
pullNumber?: number;
|
|
68
|
+
detailsUrl?: string;
|
|
69
|
+
title?: string;
|
|
70
|
+
summary?: string;
|
|
71
|
+
includeCheckRunComment?: boolean;
|
|
72
|
+
checkRunComment?: string;
|
|
73
|
+
}): Promise<GithubCheckRun>;
|
|
74
|
+
export declare function createCheckRun(owner: string, repo: string, name: string, opts?: {
|
|
75
|
+
headSHA?: string;
|
|
76
|
+
pullNumber?: number;
|
|
77
|
+
detailsUrl?: string;
|
|
78
|
+
title?: string;
|
|
79
|
+
summary?: string;
|
|
80
|
+
includeCheckRunComment?: boolean;
|
|
81
|
+
checkRunComment?: string;
|
|
82
|
+
}): Promise<GithubCheckRun>;
|
|
83
|
+
export declare const CheckRun: typeof GithubCheckRun;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const _default: {
|
|
2
2
|
error: (...args: any) => void;
|
|
3
3
|
warn: (...args: any) => void;
|
|
4
4
|
info: (...args: any) => void;
|
|
@@ -6,4 +6,4 @@ declare const log: {
|
|
|
6
6
|
verbose: (...args: any) => void;
|
|
7
7
|
silly: (...args: any) => void;
|
|
8
8
|
};
|
|
9
|
-
export default
|
|
9
|
+
export default _default;
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { PassThrough } from 'stream';
|
|
3
|
+
export declare function runCDKTF(entityPath: any, action: string, depsPath?: any, stream?: PassThrough): Promise<unknown>;
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { PassThrough } from 'stream';
|
|
1
3
|
export declare class Resource {
|
|
2
4
|
data: any;
|
|
3
5
|
output: string;
|
|
6
|
+
logStream: PassThrough;
|
|
4
7
|
logFn: Function;
|
|
8
|
+
synthStreamCallbacks: any;
|
|
9
|
+
tfStreamCallbacks: any;
|
|
5
10
|
setLogger(fn: Function): void;
|
|
11
|
+
setSynthStreamLogs(callbacks: any): void;
|
|
12
|
+
setTFStreamLogs(callbacks: any): void;
|
|
13
|
+
onSyncStreaming(): Promise<void>;
|
|
14
|
+
onTFStreaming(): Promise<void>;
|
|
15
|
+
setLogStream(fnData: Function, fnEnd: Function, reopen?: boolean): void;
|
|
6
16
|
constructor(mainCR: any, operation: string, deps?: any[]);
|
|
7
17
|
run(): Promise<void>;
|
|
8
18
|
artifact(): any;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { PassThrough } from 'stream';
|
|
3
|
+
export declare function runTerraform(entity: any, command: Array<string>, stream?: PassThrough): Promise<unknown>;
|
|
4
|
+
export declare function terraformInit(entity: any, stream?: PassThrough): Promise<unknown>;
|
|
5
|
+
export declare function terraformPlan(entity: any, stream?: PassThrough): Promise<unknown>;
|
|
6
|
+
export declare function terraformApply(entity: any, isImport?: boolean, skipPlan?: boolean, stream?: PassThrough): Promise<unknown>;
|
|
7
|
+
export declare function terraformDestroy(entity: any, stream?: PassThrough): Promise<unknown>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { TFProjectManager } from './src';
|
|
2
2
|
export declare function validateContext(context: any): void;
|
|
3
3
|
export declare function run(): Promise<void>;
|
|
4
|
-
export declare function runTerraformProvisioner(context: any, command?: string): Promise<any>;
|
|
4
|
+
export declare function runTerraformProvisioner(context: any, command?: string, streaming?: any): Promise<any>;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { WriterMainTf } from './writer_main_tf';
|
|
2
3
|
import { WriterTfVarsJson } from './writer_tfvars_json';
|
|
4
|
+
import { PassThrough } from 'stream';
|
|
3
5
|
export declare class TFProjectManager {
|
|
4
6
|
mainTfWriter: WriterMainTf;
|
|
5
7
|
tfVarsJsonWriter: WriterTfVarsJson;
|
|
6
8
|
secrets: any[];
|
|
7
9
|
projectPath: string;
|
|
8
10
|
tfOutput: any;
|
|
11
|
+
stream: PassThrough;
|
|
9
12
|
constructor(ctx: any);
|
|
13
|
+
setStreamCallbacks(fnData: Function, fnEnd: (...args: any[]) => void, reopen?: boolean): void;
|
|
10
14
|
getOutput(): any;
|
|
11
15
|
build(): Promise<void>;
|
|
12
16
|
__init(): Promise<void>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { WriterTerraform } from './writer_terraform';
|
|
2
3
|
import { WriterTfVarsJson } from './writer_tfvars_json';
|
|
4
|
+
import { PassThrough } from 'stream';
|
|
3
5
|
export declare class TFProjectManagerRemote {
|
|
4
6
|
writerTerraform: WriterTerraform;
|
|
5
7
|
tfVarsJsonWriter: WriterTfVarsJson;
|
|
@@ -7,8 +9,10 @@ export declare class TFProjectManagerRemote {
|
|
|
7
9
|
secrets: any[];
|
|
8
10
|
projectPath: string;
|
|
9
11
|
tfOutput: any;
|
|
12
|
+
stream: PassThrough;
|
|
10
13
|
constructor(ctx: any);
|
|
11
14
|
getOutput(): any;
|
|
15
|
+
setStreamCallbacks(fnData: Function, fnEnd: (...args: any[]) => void, reopen?: boolean): void;
|
|
12
16
|
build(): Promise<void>;
|
|
13
17
|
__configGit(): Promise<void>;
|
|
14
18
|
__init(): Promise<void>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { PassThrough } from 'stream';
|
|
1
3
|
export declare function validate(path: string, secrets: any[]): Promise<unknown>;
|
|
2
|
-
export declare function init(path: string, secrets: any[]): Promise<unknown>;
|
|
3
|
-
export declare function initFromModule(path: string, source: string, secrets: any[]): Promise<unknown>;
|
|
4
|
-
export declare function plan(path: string, secrets: any[], format: 'human' | 'json', args?: string[]): Promise<any>;
|
|
5
|
-
export declare function apply(path: string, secrets: any[]): Promise<unknown>;
|
|
6
|
-
export declare function destroy(path: string, secrets: any[]): Promise<unknown>;
|
|
4
|
+
export declare function init(path: string, secrets: any[], stream?: PassThrough): Promise<unknown>;
|
|
5
|
+
export declare function initFromModule(path: string, source: string, secrets: any[], stream?: PassThrough): Promise<unknown>;
|
|
6
|
+
export declare function plan(path: string, secrets: any[], format: 'human' | 'json', args?: string[], stream?: PassThrough): Promise<any>;
|
|
7
|
+
export declare function apply(path: string, secrets: any[], stream?: PassThrough): Promise<unknown>;
|
|
8
|
+
export declare function destroy(path: string, secrets: any[], stream?: PassThrough): Promise<unknown>;
|
|
7
9
|
export declare function output(path: string, secrets: any[]): Promise<unknown>;
|
|
8
|
-
export declare function tfExec(path: string, args: Array<string>, secrets: any[], extraArgs?: string[]): Promise<unknown>;
|
|
10
|
+
export declare function tfExec(path: string, args: Array<string>, secrets: any[], extraArgs?: string[], stream?: PassThrough): Promise<unknown>;
|
|
9
11
|
export declare function configureGit(ghToken: string): Promise<unknown>;
|