@decohere/scaffold 0.0.1-dev.126 → 0.0.1-dev.18

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 (264) hide show
  1. package/package.json +9 -19
  2. package/src/add-api.action.ts +25 -0
  3. package/src/add-api.command.ts +31 -0
  4. package/src/add.command.ts +20 -0
  5. package/src/add.module.ts +11 -0
  6. package/src/cli.ts +4 -0
  7. package/src/create.command.ts +20 -0
  8. package/src/create.module.ts +11 -0
  9. package/src/domain/prompt.ts +50 -0
  10. package/{types/src/index.d.ts → src/index.ts} +0 -4
  11. package/src/models/compose.model.ts +205 -0
  12. package/src/models/config-yaml.model.ts +83 -0
  13. package/src/models/const.ts +20 -0
  14. package/src/models/dev-container.model.ts +136 -0
  15. package/src/models/docker-image.model.ts +343 -0
  16. package/src/models/env-file.model.ts +45 -0
  17. package/src/models/gitignore.model.ts +35 -0
  18. package/src/models/launch-json.model.ts +60 -0
  19. package/src/models/package-json.model.ts +169 -0
  20. package/src/models/project.model.ts +141 -0
  21. package/{types/src/models/source-file.d.ts → src/models/source-file.ts} +6 -4
  22. package/src/models/tsconfig.model.ts +29 -0
  23. package/src/models/vitest-config.model.ts +26 -0
  24. package/src/models/vscode-settings.model.ts +24 -0
  25. package/src/program.ts +63 -0
  26. package/{types/src/resolve-target-dir.d.ts → src/resolve-target-dir.ts} +4 -1
  27. package/src/services/scaffold.service.ts +89 -0
  28. package/src/version.ts +56 -0
  29. package/src/webapi/api-name.ts +73 -0
  30. package/src/webapi/cli-options.ts +56 -0
  31. package/{types/src/webapi/const.d.ts → src/webapi/const.ts} +21 -9
  32. package/src/webapi/create-api.ts +275 -0
  33. package/src/webapi/devcontainer/host-scripts.ts +35 -0
  34. package/src/webapi/features/auth.feature.ts +454 -0
  35. package/src/webapi/features/auth0-cli.ts +421 -0
  36. package/src/webapi/features/biome-format.ts +34 -0
  37. package/src/webapi/features/database.feature.ts +522 -0
  38. package/src/webapi/features/finalize.feature.ts +112 -0
  39. package/src/webapi/features/postman.feature.ts +287 -0
  40. package/src/webapi/models/api-package-json.model.ts +60 -0
  41. package/src/webapi/models/auth-config.model.ts +36 -0
  42. package/src/webapi/models/controller-source-file.model.ts +232 -0
  43. package/{es6/src/webapi/models/github-ci.model.js → src/webapi/models/github-ci.model.ts} +29 -27
  44. package/src/webapi/models/main-source-file.model.ts +208 -0
  45. package/src/webapi/models/production-dockerfile.model.ts +162 -0
  46. package/src/webapi/models/sample-files.model.ts +45 -0
  47. package/src/webapi/models/webapi-image.model.ts +21 -0
  48. package/src/webapi/postman/hello-openapi.ts +92 -0
  49. package/src/webapi/postman/local-view.ts +195 -0
  50. package/src/webapi/postman/openapi-to-postman.ts +208 -0
  51. package/src/webapi/workspace-readme.ts +192 -0
  52. package/src/webapi.action.ts +22 -0
  53. package/src/webapi.command.ts +41 -0
  54. package/tests/auth-postman.wiring.spec.ts +263 -0
  55. package/tests/auth0-cli.spec.ts +232 -0
  56. package/tests/biome-format.spec.ts +49 -0
  57. package/tests/cli.integration.spec.ts +658 -0
  58. package/tests/compose.model.spec.ts +51 -0
  59. package/tests/container-image.model.spec.ts +162 -0
  60. package/tests/dev-container.model.spec.ts +29 -0
  61. package/tests/devcontainer-base-image.spec.ts +32 -0
  62. package/tests/hello-di-inject.scaffold.spec.ts +18 -0
  63. package/tests/hello-route.contract.spec.ts +94 -0
  64. package/tests/package-json.order.spec.ts +59 -0
  65. package/tests/postman-from-openapi.spec.ts +197 -0
  66. package/tests/seed-devcontainer-templates.ts +40 -0
  67. package/tests/webapi/devcontainer/codebase-rag-mcp.spec.ts +96 -0
  68. package/LICENSE +0 -15
  69. package/commonjs/src/add-api.action.js +0 -37
  70. package/commonjs/src/add-api.command.js +0 -39
  71. package/commonjs/src/add.command.js +0 -22
  72. package/commonjs/src/add.module.js +0 -24
  73. package/commonjs/src/auth0-configure.action.js +0 -28
  74. package/commonjs/src/auth0-configure.command.js +0 -24
  75. package/commonjs/src/auth0-login.action.js +0 -28
  76. package/commonjs/src/auth0-login.command.js +0 -23
  77. package/commonjs/src/auth0.command.js +0 -22
  78. package/commonjs/src/auth0.module.js +0 -28
  79. package/commonjs/src/cli.js +0 -8
  80. package/commonjs/src/create.command.js +0 -22
  81. package/commonjs/src/create.module.js +0 -24
  82. package/commonjs/src/domain/prompt.js +0 -62
  83. package/commonjs/src/index.js +0 -48
  84. package/commonjs/src/models/compose.model.js +0 -258
  85. package/commonjs/src/models/config-yaml.model.js +0 -86
  86. package/commonjs/src/models/const.js +0 -30
  87. package/commonjs/src/models/dev-container.model.js +0 -172
  88. package/commonjs/src/models/docker-image.model.js +0 -277
  89. package/commonjs/src/models/env-file.model.js +0 -48
  90. package/commonjs/src/models/gitignore.model.js +0 -48
  91. package/commonjs/src/models/launch-json.model.js +0 -70
  92. package/commonjs/src/models/package-json.model.js +0 -156
  93. package/commonjs/src/models/project.model.js +0 -132
  94. package/commonjs/src/models/source-file.js +0 -4
  95. package/commonjs/src/models/tsconfig.model.js +0 -32
  96. package/commonjs/src/models/vitest-config.model.js +0 -33
  97. package/commonjs/src/models/vscode-settings.model.js +0 -29
  98. package/commonjs/src/program.js +0 -64
  99. package/commonjs/src/resolve-target-dir.js +0 -17
  100. package/commonjs/src/services/scaffold.service.js +0 -60
  101. package/commonjs/src/version.js +0 -55
  102. package/commonjs/src/webapi/api-name.js +0 -93
  103. package/commonjs/src/webapi/auth0-commands.js +0 -250
  104. package/commonjs/src/webapi/authorize-scopes.js +0 -79
  105. package/commonjs/src/webapi/cli-options.js +0 -99
  106. package/commonjs/src/webapi/const.js +0 -54
  107. package/commonjs/src/webapi/create-api.js +0 -265
  108. package/commonjs/src/webapi/devcontainer/codebase-rag-mcp.js +0 -164
  109. package/commonjs/src/webapi/devcontainer/codebase-rag-mcp.ts +0 -182
  110. package/commonjs/src/webapi/devcontainer/host-scripts.js +0 -50
  111. package/commonjs/src/webapi/devcontainer/templates/codebase-rag.env.example +0 -3
  112. package/commonjs/src/webapi/devcontainer/templates/initialize.sh +0 -169
  113. package/commonjs/src/webapi/devcontainer/templates/post-create.sh +0 -35
  114. package/commonjs/src/webapi/devcontainer/templates/post-start.sh +0 -65
  115. package/commonjs/src/webapi/devcontainer/templates/tty-prompt.sh +0 -38
  116. package/commonjs/src/webapi/features/auth.feature.js +0 -408
  117. package/commonjs/src/webapi/features/auth0-cli.js +0 -472
  118. package/commonjs/src/webapi/features/biome-format.js +0 -47
  119. package/commonjs/src/webapi/features/database.feature.js +0 -433
  120. package/commonjs/src/webapi/features/finalize.feature.js +0 -93
  121. package/commonjs/src/webapi/features/postman.feature.js +0 -322
  122. package/commonjs/src/webapi/models/api-package-json.model.js +0 -58
  123. package/commonjs/src/webapi/models/auth-config.model.js +0 -24
  124. package/commonjs/src/webapi/models/controller-source-file.model.js +0 -190
  125. package/commonjs/src/webapi/models/github-ci.model.js +0 -193
  126. package/commonjs/src/webapi/models/main-source-file.model.js +0 -165
  127. package/commonjs/src/webapi/models/production-dockerfile.model.js +0 -75
  128. package/commonjs/src/webapi/models/sample-files.model.js +0 -58
  129. package/commonjs/src/webapi/models/webapi-image.model.js +0 -25
  130. package/commonjs/src/webapi/postman/hello-openapi.js +0 -173
  131. package/commonjs/src/webapi/postman/local-view.js +0 -182
  132. package/commonjs/src/webapi/postman/openapi-to-postman.js +0 -238
  133. package/commonjs/src/webapi/workspace-readme.js +0 -109
  134. package/commonjs/src/webapi.action.js +0 -28
  135. package/commonjs/src/webapi.command.js +0 -43
  136. package/es6/src/add-api.action.js +0 -27
  137. package/es6/src/add-api.command.js +0 -29
  138. package/es6/src/add.command.js +0 -12
  139. package/es6/src/add.module.js +0 -14
  140. package/es6/src/auth0-configure.action.js +0 -18
  141. package/es6/src/auth0-configure.command.js +0 -14
  142. package/es6/src/auth0-login.action.js +0 -18
  143. package/es6/src/auth0-login.command.js +0 -13
  144. package/es6/src/auth0.command.js +0 -12
  145. package/es6/src/auth0.module.js +0 -18
  146. package/es6/src/cli.js +0 -4
  147. package/es6/src/create.command.js +0 -12
  148. package/es6/src/create.module.js +0 -14
  149. package/es6/src/domain/prompt.js +0 -41
  150. package/es6/src/index.js +0 -9
  151. package/es6/src/models/compose.model.js +0 -254
  152. package/es6/src/models/config-yaml.model.js +0 -74
  153. package/es6/src/models/const.js +0 -20
  154. package/es6/src/models/dev-container.model.js +0 -162
  155. package/es6/src/models/docker-image.model.js +0 -235
  156. package/es6/src/models/env-file.model.js +0 -44
  157. package/es6/src/models/gitignore.model.js +0 -38
  158. package/es6/src/models/launch-json.model.js +0 -60
  159. package/es6/src/models/package-json.model.js +0 -141
  160. package/es6/src/models/project.model.js +0 -117
  161. package/es6/src/models/source-file.js +0 -1
  162. package/es6/src/models/tsconfig.model.js +0 -22
  163. package/es6/src/models/vitest-config.model.js +0 -23
  164. package/es6/src/models/vscode-settings.model.js +0 -19
  165. package/es6/src/program.js +0 -50
  166. package/es6/src/resolve-target-dir.js +0 -7
  167. package/es6/src/services/scaffold.service.js +0 -50
  168. package/es6/src/version.js +0 -34
  169. package/es6/src/webapi/api-name.js +0 -57
  170. package/es6/src/webapi/auth0-commands.js +0 -185
  171. package/es6/src/webapi/authorize-scopes.js +0 -55
  172. package/es6/src/webapi/cli-options.js +0 -34
  173. package/es6/src/webapi/const.js +0 -21
  174. package/es6/src/webapi/create-api.js +0 -245
  175. package/es6/src/webapi/devcontainer/codebase-rag-mcp.js +0 -154
  176. package/es6/src/webapi/devcontainer/codebase-rag-mcp.ts +0 -182
  177. package/es6/src/webapi/devcontainer/host-scripts.js +0 -29
  178. package/es6/src/webapi/devcontainer/templates/codebase-rag.env.example +0 -3
  179. package/es6/src/webapi/devcontainer/templates/initialize.sh +0 -169
  180. package/es6/src/webapi/devcontainer/templates/post-create.sh +0 -35
  181. package/es6/src/webapi/devcontainer/templates/post-start.sh +0 -65
  182. package/es6/src/webapi/devcontainer/templates/tty-prompt.sh +0 -38
  183. package/es6/src/webapi/features/auth.feature.js +0 -357
  184. package/es6/src/webapi/features/auth0-cli.js +0 -406
  185. package/es6/src/webapi/features/biome-format.js +0 -40
  186. package/es6/src/webapi/features/database.feature.js +0 -423
  187. package/es6/src/webapi/features/finalize.feature.js +0 -83
  188. package/es6/src/webapi/features/postman.feature.js +0 -256
  189. package/es6/src/webapi/models/api-package-json.model.js +0 -53
  190. package/es6/src/webapi/models/auth-config.model.js +0 -20
  191. package/es6/src/webapi/models/controller-source-file.model.js +0 -181
  192. package/es6/src/webapi/models/main-source-file.model.js +0 -161
  193. package/es6/src/webapi/models/production-dockerfile.model.js +0 -66
  194. package/es6/src/webapi/models/sample-files.model.js +0 -40
  195. package/es6/src/webapi/models/webapi-image.model.js +0 -18
  196. package/es6/src/webapi/postman/hello-openapi.js +0 -166
  197. package/es6/src/webapi/postman/local-view.js +0 -167
  198. package/es6/src/webapi/postman/openapi-to-postman.js +0 -179
  199. package/es6/src/webapi/workspace-readme.js +0 -88
  200. package/es6/src/webapi.action.js +0 -18
  201. package/es6/src/webapi.command.js +0 -33
  202. package/types/src/add-api.action.d.ts +0 -13
  203. package/types/src/add-api.command.d.ts +0 -7
  204. package/types/src/add.command.d.ts +0 -6
  205. package/types/src/add.module.d.ts +0 -14
  206. package/types/src/auth0-configure.action.d.ts +0 -7
  207. package/types/src/auth0-configure.command.d.ts +0 -6
  208. package/types/src/auth0-login.action.d.ts +0 -4
  209. package/types/src/auth0-login.command.d.ts +0 -6
  210. package/types/src/auth0.command.d.ts +0 -6
  211. package/types/src/auth0.module.d.ts +0 -18
  212. package/types/src/cli.d.ts +0 -2
  213. package/types/src/create.command.d.ts +0 -6
  214. package/types/src/create.module.d.ts +0 -14
  215. package/types/src/domain/prompt.d.ts +0 -4
  216. package/types/src/models/compose.model.d.ts +0 -73
  217. package/types/src/models/config-yaml.model.d.ts +0 -27
  218. package/types/src/models/const.d.ts +0 -20
  219. package/types/src/models/dev-container.model.d.ts +0 -49
  220. package/types/src/models/docker-image.model.d.ts +0 -90
  221. package/types/src/models/env-file.model.d.ts +0 -16
  222. package/types/src/models/gitignore.model.d.ts +0 -9
  223. package/types/src/models/launch-json.model.d.ts +0 -7
  224. package/types/src/models/package-json.model.d.ts +0 -36
  225. package/types/src/models/project.model.d.ts +0 -60
  226. package/types/src/models/tsconfig.model.d.ts +0 -5
  227. package/types/src/models/vitest-config.model.d.ts +0 -5
  228. package/types/src/models/vscode-settings.model.d.ts +0 -7
  229. package/types/src/program.d.ts +0 -8
  230. package/types/src/services/scaffold.service.d.ts +0 -22
  231. package/types/src/version.d.ts +0 -6
  232. package/types/src/webapi/api-name.d.ts +0 -14
  233. package/types/src/webapi/auth0-commands.d.ts +0 -11
  234. package/types/src/webapi/authorize-scopes.d.ts +0 -7
  235. package/types/src/webapi/cli-options.d.ts +0 -6
  236. package/types/src/webapi/create-api.d.ts +0 -15
  237. package/types/src/webapi/devcontainer/codebase-rag-mcp.d.ts +0 -32
  238. package/types/src/webapi/devcontainer/codebase-rag-mcp.ts +0 -182
  239. package/types/src/webapi/devcontainer/host-scripts.d.ts +0 -7
  240. package/types/src/webapi/devcontainer/templates/codebase-rag.env.example +0 -3
  241. package/types/src/webapi/devcontainer/templates/initialize.sh +0 -169
  242. package/types/src/webapi/devcontainer/templates/post-create.sh +0 -35
  243. package/types/src/webapi/devcontainer/templates/post-start.sh +0 -65
  244. package/types/src/webapi/devcontainer/templates/tty-prompt.sh +0 -38
  245. package/types/src/webapi/features/auth.feature.d.ts +0 -10
  246. package/types/src/webapi/features/auth0-cli.d.ts +0 -84
  247. package/types/src/webapi/features/biome-format.d.ts +0 -5
  248. package/types/src/webapi/features/database.feature.d.ts +0 -7
  249. package/types/src/webapi/features/finalize.feature.d.ts +0 -2
  250. package/types/src/webapi/features/postman.feature.d.ts +0 -16
  251. package/types/src/webapi/models/api-package-json.model.d.ts +0 -18
  252. package/types/src/webapi/models/auth-config.model.d.ts +0 -26
  253. package/types/src/webapi/models/controller-source-file.model.d.ts +0 -46
  254. package/types/src/webapi/models/github-ci.model.d.ts +0 -9
  255. package/types/src/webapi/models/main-source-file.model.d.ts +0 -54
  256. package/types/src/webapi/models/production-dockerfile.model.d.ts +0 -18
  257. package/types/src/webapi/models/sample-files.model.d.ts +0 -7
  258. package/types/src/webapi/models/webapi-image.model.d.ts +0 -12
  259. package/types/src/webapi/postman/hello-openapi.d.ts +0 -19
  260. package/types/src/webapi/postman/local-view.d.ts +0 -17
  261. package/types/src/webapi/postman/openapi-to-postman.d.ts +0 -62
  262. package/types/src/webapi/workspace-readme.d.ts +0 -18
  263. package/types/src/webapi.action.d.ts +0 -14
  264. package/types/src/webapi.command.d.ts +0 -11
@@ -0,0 +1,40 @@
1
+ import { dirname } from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ import { vol } from "memfs";
4
+ import { vi } from "vitest";
5
+ import {
6
+ codebaseRagMcpSourcePath,
7
+ devcontainerTemplatePath,
8
+ } from "../src/webapi/devcontainer/host-scripts.js";
9
+
10
+ const realFs = await vi.importActual<typeof import("node:fs")>("node:fs");
11
+
12
+ const TEMPLATE_NAMES = [
13
+ "initialize.sh",
14
+ "post-create.sh",
15
+ "post-start.sh",
16
+ "tty-prompt.sh",
17
+ "codebase-rag.env.example",
18
+ ] as const;
19
+
20
+ /** Copy Dev Container templates into memfs so scaffold can read them after `resetMemfs`. */
21
+ export function seedDevcontainerTemplates(): void {
22
+ const files = [
23
+ ...TEMPLATE_NAMES.map((name) => ({
24
+ mem: devcontainerTemplatePath(name),
25
+ disk: fileURLToPath(
26
+ new URL(`../src/webapi/devcontainer/templates/${name}`, import.meta.url),
27
+ ),
28
+ })),
29
+ {
30
+ mem: codebaseRagMcpSourcePath(),
31
+ disk: fileURLToPath(
32
+ new URL("../src/webapi/devcontainer/codebase-rag-mcp.ts", import.meta.url),
33
+ ),
34
+ },
35
+ ];
36
+ for (const { mem, disk } of files) {
37
+ vol.mkdirSync(dirname(mem), { recursive: true });
38
+ vol.writeFileSync(mem, realFs.readFileSync(disk, "utf8"));
39
+ }
40
+ }
@@ -0,0 +1,96 @@
1
+ import { resetMemfs } from "@decohere/nexus/testing";
2
+ import { vol } from "memfs";
3
+ import { beforeEach, describe, expect, it } from "vitest";
4
+ import { codebaseRagMcp } from "../../../src/webapi/devcontainer/codebase-rag-mcp.js";
5
+
6
+ const HOST_MCP = JSON.stringify({
7
+ mcpServers: {
8
+ other: { command: "echo" },
9
+ "codebase-rag": {
10
+ url: "https://rag.example.com/mcp",
11
+ headers: { Authorization: "Bearer secret-token" },
12
+ },
13
+ },
14
+ });
15
+
16
+ describe("codebaseRagMcp", () => {
17
+ beforeEach(() => {
18
+ resetMemfs();
19
+ });
20
+ it("reads HTTP URL and bearer token from host mcp.json", () => {
21
+ expect(codebaseRagMcp.seedFromMcpJson(HOST_MCP)).toEqual({
22
+ url: "https://rag.example.com/mcp",
23
+ token: "secret-token",
24
+ });
25
+ });
26
+
27
+ it("returns null when codebase-rag is missing or incomplete", () => {
28
+ expect(codebaseRagMcp.seedFromMcpJson("{}")).toBeNull();
29
+ expect(
30
+ codebaseRagMcp.seedFromMcpJson(
31
+ JSON.stringify({ mcpServers: { "codebase-rag": { url: "https://x/mcp" } } }),
32
+ ),
33
+ ).toBeNull();
34
+ });
35
+
36
+ it("merges codebase-rag into mcp.json without dropping other servers", () => {
37
+ vol.fromJSON({
38
+ "/tmp/cursor/mcp.json": JSON.stringify({ mcpServers: { keep: { url: "stdio" } } }),
39
+ });
40
+
41
+ const result = codebaseRagMcp.mergeIntoMcpJson({
42
+ mcpPath: "/tmp/cursor/mcp.json",
43
+ url: "https://rag.example.com/mcp",
44
+ token: "secret-token",
45
+ hostRoot: "/host/repo",
46
+ });
47
+
48
+ expect(result.path).toBe("/tmp/cursor/mcp.json");
49
+ const written = JSON.parse(vol.readFileSync("/tmp/cursor/mcp.json", "utf8") as string) as {
50
+ mcpServers: Record<string, { url?: string; headers?: Record<string, string> }>;
51
+ };
52
+ expect(written.mcpServers.keep).toEqual({ url: "stdio" });
53
+ expect(written.mcpServers["codebase-rag"]).toEqual({
54
+ url: "https://rag.example.com/mcp",
55
+ headers: {
56
+ Authorization: "Bearer secret-token",
57
+ "X-Codebase-Root": "/host/repo",
58
+ },
59
+ });
60
+ });
61
+
62
+ it("seed-print writes url and token on separate lines", () => {
63
+ vol.fromJSON({ "/tmp/host-mcp.json": HOST_MCP });
64
+ const lines: string[] = [];
65
+ const original = console.log;
66
+ console.log = (msg?: unknown) => {
67
+ lines.push(String(msg));
68
+ };
69
+ try {
70
+ expect(codebaseRagMcp.main(["seed-print", "/tmp/host-mcp.json"])).toBe(0);
71
+ } finally {
72
+ console.log = original;
73
+ }
74
+ expect(lines).toEqual(["https://rag.example.com/mcp", "secret-token"]);
75
+ });
76
+
77
+ it("mergeFromEnv reads and writes under the workspace .cursor directory", () => {
78
+ vol.fromJSON({
79
+ "/repo/.cursor/codebase-rag.env":
80
+ "CODEBASE_RAG_MCP_URL=https://rag.example.com/mcp\nCODEBASE_RAG_MCP_TOKEN=secret-token\n",
81
+ });
82
+
83
+ expect(
84
+ codebaseRagMcp.mergeFromEnv({
85
+ CODEBASE_RAG_WORKSPACE: "/repo",
86
+ }),
87
+ ).toBe(0);
88
+
89
+ const written = JSON.parse(
90
+ vol.readFileSync("/repo/.cursor/mcp.json", "utf8") as string,
91
+ ) as {
92
+ mcpServers: Record<string, { url?: string }>;
93
+ };
94
+ expect(written.mcpServers["codebase-rag"]?.url).toBe("https://rag.example.com/mcp");
95
+ });
96
+ });
package/LICENSE DELETED
@@ -1,15 +0,0 @@
1
- ISC License
2
-
3
- Copyright (c) 2025-2026 Typesmiths
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted, provided that the above
7
- copyright notice and this permission notice appear in all copies.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "AddApiAction", {
6
- enumerable: true,
7
- get: function() {
8
- return AddApiAction;
9
- }
10
- });
11
- const _decorators = require("@decohere/crucible/decorators");
12
- const _cli = require("@decohere/devkit/cli");
13
- const _clioptions = require("./webapi/cli-options.js");
14
- function _ts_decorate(decorators, target, key, desc) {
15
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17
- else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
18
- return c > 3 && r && Object.defineProperty(target, key, r), r;
19
- }
20
- class AddApiAction {
21
- async run(options) {
22
- const name = options.apiName;
23
- if (name == null || name === "") {
24
- return _cli.ActionResponse.Error("api", "API name is required");
25
- }
26
- await (0, _clioptions.runScaffoldApi)((0, _clioptions.toApiOptions)(undefined, options, {
27
- names: [
28
- name
29
- ],
30
- add: true
31
- }));
32
- return _cli.ActionResponse.Success("api");
33
- }
34
- }
35
- AddApiAction = _ts_decorate([
36
- (0, _decorators.injectable)()
37
- ], AddApiAction);
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "AddApiCommand", {
6
- enumerable: true,
7
- get: function() {
8
- return AddApiCommand;
9
- }
10
- });
11
- const _cli = require("@decohere/devkit/cli");
12
- const _addapiaction = require("./add-api.action.js");
13
- const _clioptions = require("./webapi/cli-options.js");
14
- class AddApiCommand extends _cli.DecohereCommand {
15
- get actions() {
16
- return [
17
- _addapiaction.AddApiAction
18
- ];
19
- }
20
- constructor(name){
21
- super(name);
22
- this.description("Add an API to an existing Decohere workspace");
23
- this.argument("<name>", "API name under projects/");
24
- this.option("-d <directory>", "Workspace directory (default: current directory)", ".");
25
- (0, _clioptions.addWebapiFeatureOptions)(this);
26
- }
27
- action(fn) {
28
- return super.action((...args)=>{
29
- const cmd = args.at(-1);
30
- const first = args[0];
31
- const hasPositional = typeof first === "string" || first === undefined;
32
- const opts = hasPositional ? args[1] : args[0];
33
- if (typeof first === "string" && first !== "") {
34
- cmd.setOptionValue("apiName", first);
35
- }
36
- return fn(opts, cmd);
37
- });
38
- }
39
- }
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "AddCommand", {
6
- enumerable: true,
7
- get: function() {
8
- return AddCommand;
9
- }
10
- });
11
- const _cli = require("@decohere/devkit/cli");
12
- class AddCommand extends _cli.DecohereCommand {
13
- constructor(commands, handler){
14
- super(AddCommand);
15
- this.description("Add to an existing Decohere workspace");
16
- this.exitOverride();
17
- this.registerSubcommand(commands, handler);
18
- }
19
- run(_actions, _options) {
20
- return this.help();
21
- }
22
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "AddModule", {
6
- enumerable: true,
7
- get: function() {
8
- return AddModule;
9
- }
10
- });
11
- const _cli = require("@decohere/devkit/cli");
12
- const _addcommand = require("./add.command.js");
13
- const _addapiaction = require("./add-api.action.js");
14
- const _addapicommand = require("./add-api.command.js");
15
- class AddModule extends _cli.ModuleManifest {
16
- id = "add";
17
- command = _addcommand.AddCommand;
18
- commands = {
19
- api: _addapicommand.AddApiCommand
20
- };
21
- actions = {
22
- api: _addapiaction.AddApiAction
23
- };
24
- }
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "Auth0ConfigureAction", {
6
- enumerable: true,
7
- get: function() {
8
- return Auth0ConfigureAction;
9
- }
10
- });
11
- const _decorators = require("@decohere/crucible/decorators");
12
- const _cli = require("@decohere/devkit/cli");
13
- const _auth0commands = require("./webapi/auth0-commands.js");
14
- function _ts_decorate(decorators, target, key, desc) {
15
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17
- else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
18
- return c > 3 && r && Object.defineProperty(target, key, r), r;
19
- }
20
- class Auth0ConfigureAction {
21
- async run(options) {
22
- (0, _auth0commands.runAuth0Configure)(typeof options.d === "string" ? options.d : ".");
23
- return _cli.ActionResponse.Success("configure");
24
- }
25
- }
26
- Auth0ConfigureAction = _ts_decorate([
27
- (0, _decorators.injectable)()
28
- ], Auth0ConfigureAction);
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "Auth0ConfigureCommand", {
6
- enumerable: true,
7
- get: function() {
8
- return Auth0ConfigureCommand;
9
- }
10
- });
11
- const _cli = require("@decohere/devkit/cli");
12
- const _auth0configureaction = require("./auth0-configure.action.js");
13
- class Auth0ConfigureCommand extends _cli.DecohereCommand {
14
- get actions() {
15
- return [
16
- _auth0configureaction.Auth0ConfigureAction
17
- ];
18
- }
19
- constructor(name){
20
- super(name);
21
- this.description("Update Auth0 API permissions and Postman SPA from @Authorize in this workspace");
22
- this.option("-d <directory>", "Workspace directory (default: current directory)", ".");
23
- }
24
- }
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "Auth0LoginAction", {
6
- enumerable: true,
7
- get: function() {
8
- return Auth0LoginAction;
9
- }
10
- });
11
- const _decorators = require("@decohere/crucible/decorators");
12
- const _cli = require("@decohere/devkit/cli");
13
- const _auth0commands = require("./webapi/auth0-commands.js");
14
- function _ts_decorate(decorators, target, key, desc) {
15
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17
- else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
18
- return c > 3 && r && Object.defineProperty(target, key, r), r;
19
- }
20
- class Auth0LoginAction {
21
- async run() {
22
- (0, _auth0commands.runAuth0Login)();
23
- return _cli.ActionResponse.Success("login");
24
- }
25
- }
26
- Auth0LoginAction = _ts_decorate([
27
- (0, _decorators.injectable)()
28
- ], Auth0LoginAction);
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "Auth0LoginCommand", {
6
- enumerable: true,
7
- get: function() {
8
- return Auth0LoginCommand;
9
- }
10
- });
11
- const _cli = require("@decohere/devkit/cli");
12
- const _auth0loginaction = require("./auth0-login.action.js");
13
- class Auth0LoginCommand extends _cli.DecohereCommand {
14
- get actions() {
15
- return [
16
- _auth0loginaction.Auth0LoginAction
17
- ];
18
- }
19
- constructor(name){
20
- super(name);
21
- this.description("Authenticate the Auth0 CLI (device URL; tokens persist on the host)");
22
- }
23
- }
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "Auth0Command", {
6
- enumerable: true,
7
- get: function() {
8
- return Auth0Command;
9
- }
10
- });
11
- const _cli = require("@decohere/devkit/cli");
12
- class Auth0Command extends _cli.DecohereCommand {
13
- constructor(commands, handler){
14
- super(Auth0Command);
15
- this.description("Log in to Auth0 and update a scaffolded client");
16
- this.exitOverride();
17
- this.registerSubcommand(commands, handler);
18
- }
19
- run(_actions, _options) {
20
- return this.help();
21
- }
22
- }
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "Auth0Module", {
6
- enumerable: true,
7
- get: function() {
8
- return Auth0Module;
9
- }
10
- });
11
- const _cli = require("@decohere/devkit/cli");
12
- const _auth0command = require("./auth0.command.js");
13
- const _auth0configureaction = require("./auth0-configure.action.js");
14
- const _auth0configurecommand = require("./auth0-configure.command.js");
15
- const _auth0loginaction = require("./auth0-login.action.js");
16
- const _auth0logincommand = require("./auth0-login.command.js");
17
- class Auth0Module extends _cli.ModuleManifest {
18
- id = "auth0";
19
- command = _auth0command.Auth0Command;
20
- commands = {
21
- login: _auth0logincommand.Auth0LoginCommand,
22
- configure: _auth0configurecommand.Auth0ConfigureCommand
23
- };
24
- actions = {
25
- login: _auth0loginaction.Auth0LoginAction,
26
- configure: _auth0configureaction.Auth0ConfigureAction
27
- };
28
- }
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- const _program = require("./program.js");
7
- // Exit as soon as the command is done, without waiting for handles it left open.
8
- process.exit(await (0, _program.runCli)());
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "CreateCommand", {
6
- enumerable: true,
7
- get: function() {
8
- return CreateCommand;
9
- }
10
- });
11
- const _cli = require("@decohere/devkit/cli");
12
- class CreateCommand extends _cli.DecohereCommand {
13
- constructor(commands, handler){
14
- super(CreateCommand);
15
- this.description("Create a new Decohere workspace");
16
- this.exitOverride();
17
- this.registerSubcommand(commands, handler);
18
- }
19
- run(_actions, _options) {
20
- return this.help();
21
- }
22
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "CreateModule", {
6
- enumerable: true,
7
- get: function() {
8
- return CreateModule;
9
- }
10
- });
11
- const _cli = require("@decohere/devkit/cli");
12
- const _createcommand = require("./create.command.js");
13
- const _webapiaction = require("./webapi.action.js");
14
- const _webapicommand = require("./webapi.command.js");
15
- class CreateModule extends _cli.ModuleManifest {
16
- id = "create";
17
- command = _createcommand.CreateCommand;
18
- commands = {
19
- webapi: _webapicommand.WebapiCommand
20
- };
21
- actions = {
22
- webapi: _webapiaction.WebapiAction
23
- };
24
- }
@@ -1,62 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: Object.getOwnPropertyDescriptor(all, name).get
9
- });
10
- }
11
- _export(exports, {
12
- get ask () {
13
- return ask;
14
- },
15
- get closePrompt () {
16
- return closePrompt;
17
- },
18
- get pick () {
19
- return pick;
20
- }
21
- });
22
- const _nodereadline = require("node:readline");
23
- // readline/promises rl.question() has a race condition with piped (non-TTY) stdin
24
- // in Node ≥ 22: after the first line is read, stdin emits 'end', readline closes,
25
- // and all subsequent question() calls resolve to "".
26
- // Fix: use the async-iterator API, which buffers all lines before the close event fires.
27
- let _rl = null;
28
- let _lines = null;
29
- function getLines() {
30
- if (_lines == null) {
31
- _rl = (0, _nodereadline.createInterface)({
32
- input: process.stdin,
33
- terminal: false
34
- });
35
- _lines = _rl[Symbol.asyncIterator]();
36
- }
37
- return _lines;
38
- }
39
- function closePrompt() {
40
- _rl?.close();
41
- _rl = null;
42
- _lines = null;
43
- }
44
- async function readLine(prompt) {
45
- process.stdout.write(prompt);
46
- const { value, done } = await getLines().next();
47
- return done ? "" : value.trim();
48
- }
49
- async function ask(question, fallback = "") {
50
- const answer = await readLine(question);
51
- return answer || fallback;
52
- }
53
- async function pick(label, items, display) {
54
- console.log(label.trimEnd());
55
- for (const [i, item] of items.entries()){
56
- console.log(` ${i + 1}. ${display(item)}`);
57
- }
58
- const answer = await readLine(" > ");
59
- const idx = Number.parseInt(answer, 10);
60
- if (Number.isNaN(idx) || idx < 1 || idx > items.length) return null;
61
- return items[idx - 1];
62
- }
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: Object.getOwnPropertyDescriptor(all, name).get
9
- });
10
- }
11
- _export(exports, {
12
- get AddApiAction () {
13
- return _addapiaction.AddApiAction;
14
- },
15
- get AddModule () {
16
- return _addmodule.AddModule;
17
- },
18
- get Auth0ConfigureAction () {
19
- return _auth0configureaction.Auth0ConfigureAction;
20
- },
21
- get Auth0LoginAction () {
22
- return _auth0loginaction.Auth0LoginAction;
23
- },
24
- get Auth0Module () {
25
- return _auth0module.Auth0Module;
26
- },
27
- get CreateModule () {
28
- return _createmodule.CreateModule;
29
- },
30
- get WebapiAction () {
31
- return _webapiaction.WebapiAction;
32
- },
33
- get runCli () {
34
- return _program.runCli;
35
- },
36
- get scaffoldApi () {
37
- return _createapi.scaffoldApi;
38
- }
39
- });
40
- const _addmodule = require("./add.module.js");
41
- const _addapiaction = require("./add-api.action.js");
42
- const _auth0module = require("./auth0.module.js");
43
- const _auth0configureaction = require("./auth0-configure.action.js");
44
- const _auth0loginaction = require("./auth0-login.action.js");
45
- const _createmodule = require("./create.module.js");
46
- const _program = require("./program.js");
47
- const _createapi = require("./webapi/create-api.js");
48
- const _webapiaction = require("./webapi.action.js");