@iacmp/cli 1.1.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/LICENSE +21 -0
- package/bin/run.js +73 -0
- package/dist/chat.js +4068 -0
- package/dist/commands/ai.js +3985 -0
- package/dist/commands/audit-all.js +1039 -0
- package/dist/commands/audit-dr.js +351 -0
- package/dist/commands/audit-ha.js +375 -0
- package/dist/commands/audit-improvements.js +373 -0
- package/dist/commands/audit-security.js +351 -0
- package/dist/commands/dashboard.js +417 -0
- package/dist/commands/deploy.js +188 -0
- package/dist/commands/destroy.js +194 -0
- package/dist/commands/diagram.js +896 -0
- package/dist/commands/diff.js +4420 -0
- package/dist/commands/doctor.js +191 -0
- package/dist/commands/init.js +507 -0
- package/dist/commands/ls.js +75 -0
- package/dist/commands/registry.js +170 -0
- package/dist/commands/registry.json +29 -0
- package/dist/commands/synth.js +4458 -0
- package/dist/commands/watch.js +133 -0
- package/dist/index.js +30 -0
- package/oclif.manifest.json +727 -0
- package/package.json +95 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/commands/ls.ts
|
|
31
|
+
var ls_exports = {};
|
|
32
|
+
__export(ls_exports, {
|
|
33
|
+
default: () => Ls
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(ls_exports);
|
|
36
|
+
var import_core = require("@oclif/core");
|
|
37
|
+
var fs = __toESM(require("fs"));
|
|
38
|
+
var path = __toESM(require("path"));
|
|
39
|
+
var Ls = class extends import_core.Command {
|
|
40
|
+
static description = "Lista as stacks dispon\xEDveis no projeto";
|
|
41
|
+
static examples = ["$ iacmp ls"];
|
|
42
|
+
async run() {
|
|
43
|
+
const cwd = process.cwd();
|
|
44
|
+
const stacksDir = path.join(cwd, "stacks");
|
|
45
|
+
if (!fs.existsSync(stacksDir)) {
|
|
46
|
+
this.log("Diret\xF3rio stacks/ n\xE3o encontrado. Rode: iacmp init");
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const findStackFiles = (dir) => {
|
|
50
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
51
|
+
const files2 = [];
|
|
52
|
+
for (const entry of entries) {
|
|
53
|
+
const full = path.join(dir, entry.name);
|
|
54
|
+
if (entry.isDirectory()) {
|
|
55
|
+
files2.push(...findStackFiles(full));
|
|
56
|
+
} else if (entry.name.endsWith(".ts") || entry.name.endsWith(".js")) {
|
|
57
|
+
files2.push(full);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return files2;
|
|
61
|
+
};
|
|
62
|
+
const files = findStackFiles(stacksDir);
|
|
63
|
+
if (files.length === 0) {
|
|
64
|
+
this.log("Nenhuma stack encontrada em stacks/");
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
this.log("Stacks dispon\xEDveis:\n");
|
|
68
|
+
for (const filePath of files) {
|
|
69
|
+
const stat = fs.statSync(filePath);
|
|
70
|
+
const modified = stat.mtime.toLocaleString("pt-BR");
|
|
71
|
+
const name = path.relative(stacksDir, filePath).replace(/\.(ts|js)$/, "");
|
|
72
|
+
this.log(` ${name.padEnd(30)} modificado: ${modified}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
11
|
+
var __export = (target, all) => {
|
|
12
|
+
for (var name in all)
|
|
13
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from))
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
+
mod
|
|
30
|
+
));
|
|
31
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
+
|
|
33
|
+
// ../registry/dist/client.js
|
|
34
|
+
var require_client = __commonJS({
|
|
35
|
+
"../registry/dist/client.js"(exports2) {
|
|
36
|
+
"use strict";
|
|
37
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
38
|
+
if (k2 === void 0) k2 = k;
|
|
39
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
40
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
41
|
+
desc = { enumerable: true, get: function() {
|
|
42
|
+
return m[k];
|
|
43
|
+
} };
|
|
44
|
+
}
|
|
45
|
+
Object.defineProperty(o, k2, desc);
|
|
46
|
+
}) : (function(o, m, k, k2) {
|
|
47
|
+
if (k2 === void 0) k2 = k;
|
|
48
|
+
o[k2] = m[k];
|
|
49
|
+
}));
|
|
50
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
51
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
52
|
+
}) : function(o, v) {
|
|
53
|
+
o["default"] = v;
|
|
54
|
+
});
|
|
55
|
+
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
|
|
56
|
+
var ownKeys = function(o) {
|
|
57
|
+
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
58
|
+
var ar = [];
|
|
59
|
+
for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
|
|
60
|
+
return ar;
|
|
61
|
+
};
|
|
62
|
+
return ownKeys(o);
|
|
63
|
+
};
|
|
64
|
+
return function(mod) {
|
|
65
|
+
if (mod && mod.__esModule) return mod;
|
|
66
|
+
var result = {};
|
|
67
|
+
if (mod != null) {
|
|
68
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
69
|
+
}
|
|
70
|
+
__setModuleDefault(result, mod);
|
|
71
|
+
return result;
|
|
72
|
+
};
|
|
73
|
+
})();
|
|
74
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
75
|
+
exports2.listConstructs = listConstructs2;
|
|
76
|
+
exports2.searchConstructs = searchConstructs2;
|
|
77
|
+
var path = __importStar(require("path"));
|
|
78
|
+
var fs = __importStar(require("fs"));
|
|
79
|
+
function loadRegistry() {
|
|
80
|
+
const registryPath = path.join(__dirname, "registry.json");
|
|
81
|
+
return JSON.parse(fs.readFileSync(registryPath, "utf-8"));
|
|
82
|
+
}
|
|
83
|
+
function listConstructs2() {
|
|
84
|
+
return loadRegistry().constructs;
|
|
85
|
+
}
|
|
86
|
+
function searchConstructs2(term) {
|
|
87
|
+
const lower = term.toLowerCase();
|
|
88
|
+
return loadRegistry().constructs.filter((c) => c.name.toLowerCase().includes(lower) || c.description.toLowerCase().includes(lower) || c.package.toLowerCase().includes(lower));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// ../registry/dist/index.js
|
|
94
|
+
var require_dist = __commonJS({
|
|
95
|
+
"../registry/dist/index.js"(exports2) {
|
|
96
|
+
"use strict";
|
|
97
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
98
|
+
exports2.searchConstructs = exports2.listConstructs = void 0;
|
|
99
|
+
var client_1 = require_client();
|
|
100
|
+
Object.defineProperty(exports2, "listConstructs", { enumerable: true, get: function() {
|
|
101
|
+
return client_1.listConstructs;
|
|
102
|
+
} });
|
|
103
|
+
Object.defineProperty(exports2, "searchConstructs", { enumerable: true, get: function() {
|
|
104
|
+
return client_1.searchConstructs;
|
|
105
|
+
} });
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
// src/commands/registry.ts
|
|
110
|
+
var registry_exports = {};
|
|
111
|
+
__export(registry_exports, {
|
|
112
|
+
default: () => Registry
|
|
113
|
+
});
|
|
114
|
+
module.exports = __toCommonJS(registry_exports);
|
|
115
|
+
var import_core = require("@oclif/core");
|
|
116
|
+
var import_registry = __toESM(require_dist());
|
|
117
|
+
function padEnd(str, len) {
|
|
118
|
+
return str.length >= len ? str.slice(0, len) : str + " ".repeat(len - str.length);
|
|
119
|
+
}
|
|
120
|
+
function printTable(constructs) {
|
|
121
|
+
if (constructs.length === 0) {
|
|
122
|
+
console.log("Nenhum construct encontrado.");
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const header = `${padEnd("Nome", 22)} ${padEnd("Pacote", 30)} ${padEnd("Providers", 14)} Descri\xE7\xE3o`;
|
|
126
|
+
const sep = "-".repeat(header.length);
|
|
127
|
+
console.log(sep);
|
|
128
|
+
console.log(header);
|
|
129
|
+
console.log(sep);
|
|
130
|
+
for (const c of constructs) {
|
|
131
|
+
const providers = c.providers.join(", ");
|
|
132
|
+
console.log(
|
|
133
|
+
`${padEnd(c.name, 22)} ${padEnd(c.package, 30)} ${padEnd(providers, 14)} ${c.description}`
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
console.log(sep);
|
|
137
|
+
console.log(`${constructs.length} construct(s) encontrado(s).`);
|
|
138
|
+
}
|
|
139
|
+
var Registry = class _Registry extends import_core.Command {
|
|
140
|
+
static description = "Acessa o registry de constructs da comunidade";
|
|
141
|
+
static args = {
|
|
142
|
+
subcommand: import_core.Args.string({ description: "Subcomando: list | search <termo>", required: true }),
|
|
143
|
+
term: import_core.Args.string({ description: "Termo de busca (usado com search)", required: false })
|
|
144
|
+
};
|
|
145
|
+
static examples = [
|
|
146
|
+
"$ iacmp registry list",
|
|
147
|
+
"$ iacmp registry search cognito"
|
|
148
|
+
];
|
|
149
|
+
async run() {
|
|
150
|
+
const { args } = await this.parse(_Registry);
|
|
151
|
+
switch (args.subcommand) {
|
|
152
|
+
case "list": {
|
|
153
|
+
this.log("Constructs dispon\xEDveis no registry:\n");
|
|
154
|
+
printTable((0, import_registry.listConstructs)());
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
case "search": {
|
|
158
|
+
if (!args.term) {
|
|
159
|
+
this.error("Informe um termo de busca. Ex: iacmp registry search cognito");
|
|
160
|
+
}
|
|
161
|
+
this.log(`Buscando por "${args.term}":
|
|
162
|
+
`);
|
|
163
|
+
printTable((0, import_registry.searchConstructs)(args.term));
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
default:
|
|
167
|
+
this.error(`Subcomando desconhecido: '${args.subcommand}'. Use: list ou search <termo>`);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1",
|
|
3
|
+
"constructs": [
|
|
4
|
+
{
|
|
5
|
+
"name": "WebApp.Static",
|
|
6
|
+
"package": "@iacmp-community/webapp",
|
|
7
|
+
"description": "S3 + CloudFront para sites estáticos",
|
|
8
|
+
"providers": ["aws"],
|
|
9
|
+
"version": "1.0.0",
|
|
10
|
+
"author": "comunidade"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "Queue.SQS",
|
|
14
|
+
"package": "@iacmp-community/queue",
|
|
15
|
+
"description": "Fila SQS com DLQ configurada",
|
|
16
|
+
"providers": ["aws"],
|
|
17
|
+
"version": "1.0.0",
|
|
18
|
+
"author": "comunidade"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "Auth.Cognito",
|
|
22
|
+
"package": "@iacmp-community/auth",
|
|
23
|
+
"description": "User pool Cognito com OAuth2",
|
|
24
|
+
"providers": ["aws"],
|
|
25
|
+
"version": "1.0.0",
|
|
26
|
+
"author": "comunidade"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|