@hadcloud/deploy-cli 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +17 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10,6 +10,7 @@ Uso:
10
10
  had logout
11
11
  had config
12
12
  had projects list
13
+ had projects create <name> [--description <text>]
13
14
  had apps list <project-id>
14
15
  had templates list
15
16
  had apps create <project-id> --template <template-id> [--region <region-code>]
@@ -156,6 +157,22 @@ export async function main(args) {
156
157
  })));
157
158
  return;
158
159
  }
160
+ if (group === "projects" && action === "create" && resourceId) {
161
+ const description = optionValue(args, "--description");
162
+ const response = await request("/api/v1/projects", {
163
+ method: "POST",
164
+ headers: {
165
+ "content-type": "application/json",
166
+ "idempotency-key": crypto.randomUUID(),
167
+ },
168
+ body: JSON.stringify({
169
+ name: resourceId,
170
+ ...(description ? { description } : {}),
171
+ }),
172
+ });
173
+ console.log(`Projeto ${response.project.name} (${response.project.id}) criado: ${response.project.status}`);
174
+ return;
175
+ }
159
176
  if (group === "apps" && action === "list" && resourceId) {
160
177
  const { applications } = await request(`/api/v1/automation/projects/${encodeURIComponent(resourceId)}/apps`);
161
178
  printRows(applications.map((application) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hadcloud/deploy-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {