@40rty/ams-cli 0.5.12 → 0.5.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,17 @@
1
+ // `forty space delete <slug> --confirm <slug>` — end a space the organization
2
+ // owns: its spacefront, connector, configuration and agent runs. Cannot be
3
+ // undone. The slug is typed twice for the same reason the console asks for it:
4
+ // a wrong slug is the realistic mistake, and only naming the target catches it.
5
+ import { deployment, fail, option, positionals } from '../lib/context.mjs';
6
+ import { call } from '../lib/credentials.mjs';
7
+
8
+ const USAGE = 'usage: forty space delete <slug> --confirm <slug>';
9
+
10
+ export async function space() {
11
+ const [action, slug] = positionals();
12
+ if (action !== 'delete' || slug === undefined) fail(USAGE);
13
+ if (option('confirm') !== slug) fail(`${USAGE}\n deleting cannot be undone — repeat the slug after --confirm`);
14
+ const { apiUrl } = deployment(null);
15
+ await call(apiUrl, 'DELETE', `/org/spaces/${encodeURIComponent(slug)}`);
16
+ console.log(`deleted "${slug}"`);
17
+ }
@@ -5,7 +5,7 @@ import { deployment } from '../lib/context.mjs';
5
5
  import { call } from '../lib/credentials.mjs';
6
6
 
7
7
  /** What a 40rty organization does differently — shared with `forty init`. */
8
- export const STAFF_NOTICE = '40rty organization: its spaces are 40rty demos. Build the package in the 40RTY-ai/brands repo (packages/<space>, on the shape of packages/ryleeandcru-conversational, which passes the brands lint), open a PR there, and release it by merging (the brands CI publishes) — never from this machine.';
8
+ export const STAFF_NOTICE = '40rty organization: its spaces are 40rty demos. Build the package in the 40RTY-ai/brands repo (packages/<space>, on the shape of packages/ryleeandcru, which passes the brands lint), open a PR there, and release it by merging (the brands CI publishes) — never from this machine.';
9
9
 
10
10
  export async function whoami() {
11
11
  const { apiUrl } = deployment(null);
package/bin/forty.mjs CHANGED
@@ -25,6 +25,7 @@
25
25
  // forty deploy host this Hydrogen app on 40rty, at the space's address
26
26
  // (`--detect` prints where the app's own production deploys)
27
27
  // forty hosting self the app's own deployment serves the space again
28
+ // forty space delete end a space the organization owns (`--confirm <slug>`)
28
29
  // forty theme sync write the product pages' data from the store's own live
29
30
  // theme (its templates, sections and apps) — `theme` in the config
30
31
  //
@@ -50,6 +51,7 @@ const commands = {
50
51
  deploy: () => import('./commands/deploy.mjs').then((m) => m.deploy()),
51
52
  hosting: () => import('./commands/hosting.mjs').then((m) => m.hosting()),
52
53
  theme: () => import('./commands/theme.mjs').then((m) => m.theme()),
54
+ space: () => import('./commands/space.mjs').then((m) => m.space()),
53
55
  };
54
56
  try {
55
57
  const command = commands[process.argv[2]];
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "peerDependencies": {
17
17
  "zod": "^3.25.0"
18
18
  },
19
- "version": "0.5.12",
19
+ "version": "0.5.13",
20
20
  "homepage": "https://docs.40rty.ai",
21
21
  "license": "UNLICENSED",
22
22
  "engines": {