anhedral 0.10.1 → 0.11.1

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 (183) hide show
  1. package/README.md +79 -124
  2. package/assets/patches/LICENSE.braces +21 -0
  3. package/assets/patches/LICENSE.node-forge +50 -0
  4. package/assets/patches/audit-deps.mjs +167 -0
  5. package/assets/patches/braces@3.0.3.patch +127 -0
  6. package/assets/patches/node-forge@1.4.0.patch +41 -0
  7. package/dist/auth-schema.js +3 -3
  8. package/dist/bin.js +284 -163
  9. package/dist/capabilities.d.ts +4 -4
  10. package/dist/capabilities.js +6 -2
  11. package/dist/capability-contract.d.ts +47 -0
  12. package/dist/capability-contract.js +153 -0
  13. package/dist/catalog-model.d.ts +24 -0
  14. package/dist/catalog-model.js +1 -0
  15. package/dist/catalog-registration.d.ts +16 -0
  16. package/dist/catalog-registration.js +22 -0
  17. package/dist/catalog-snapshot.d.ts +5 -0
  18. package/dist/catalog-snapshot.js +97 -0
  19. package/dist/cli-arguments.d.ts +16 -0
  20. package/dist/cli-arguments.js +115 -0
  21. package/dist/cli-output.d.ts +8 -0
  22. package/dist/cli-output.js +236 -0
  23. package/dist/cloudflare.d.ts +14 -3
  24. package/dist/cloudflare.js +196 -36
  25. package/dist/command-schema.d.ts +21 -0
  26. package/dist/command-schema.js +418 -0
  27. package/dist/delivery.d.ts +12 -5
  28. package/dist/delivery.js +173 -39
  29. package/dist/dependencies.d.ts +24 -0
  30. package/dist/dependencies.js +48 -0
  31. package/dist/dependency-patches.d.ts +7 -0
  32. package/dist/dependency-patches.js +125 -0
  33. package/dist/index.d.ts +26 -1
  34. package/dist/index.js +17 -1
  35. package/dist/inspector-model.d.ts +123 -0
  36. package/dist/inspector-model.js +1 -0
  37. package/dist/integration-service-readers.d.ts +13 -0
  38. package/dist/integration-service-readers.js +173 -0
  39. package/dist/lifecycle-model.d.ts +15 -0
  40. package/dist/lifecycle-model.js +20 -0
  41. package/dist/lifecycle.d.ts +11 -0
  42. package/dist/lifecycle.js +91 -0
  43. package/dist/mobile-delivery.d.ts +100 -0
  44. package/dist/mobile-delivery.js +319 -0
  45. package/dist/neon-service-data.d.ts +8 -0
  46. package/dist/neon-service-data.js +117 -0
  47. package/dist/platforms/mobile.js +8 -5
  48. package/dist/pnpm-policy.d.ts +2 -2
  49. package/dist/pnpm-policy.js +19 -45
  50. package/dist/project-catalog.d.ts +41 -0
  51. package/dist/project-catalog.js +288 -0
  52. package/dist/project-config.d.ts +14 -0
  53. package/dist/project-config.js +89 -0
  54. package/dist/project-inspector.d.ts +4 -0
  55. package/dist/project-inspector.js +702 -0
  56. package/dist/project-lifecycle.d.ts +25 -0
  57. package/dist/project-lifecycle.js +57 -0
  58. package/dist/project-state.d.ts +22 -1
  59. package/dist/project-state.js +361 -27
  60. package/dist/provider-auth.d.ts +41 -0
  61. package/dist/provider-auth.js +209 -0
  62. package/dist/provider-readiness.js +27 -10
  63. package/dist/providers/adapters.d.ts +17 -0
  64. package/dist/providers/adapters.js +272 -0
  65. package/dist/providers/api.d.ts +29 -0
  66. package/dist/providers/api.js +253 -0
  67. package/dist/providers/config.d.ts +15 -0
  68. package/dist/providers/config.js +182 -0
  69. package/dist/providers/definitions.d.ts +318 -0
  70. package/dist/providers/definitions.js +127 -0
  71. package/dist/providers/provision.d.ts +24 -0
  72. package/dist/providers/provision.js +76 -0
  73. package/dist/providers/receipts.d.ts +20 -0
  74. package/dist/providers/receipts.js +66 -0
  75. package/dist/providers/recovery-verification.d.ts +7 -0
  76. package/dist/providers/recovery-verification.js +112 -0
  77. package/dist/providers/recovery.d.ts +30 -0
  78. package/dist/providers/recovery.js +34 -0
  79. package/dist/providers/runtime.d.ts +10 -0
  80. package/dist/providers/runtime.js +254 -0
  81. package/dist/providers/schema.d.ts +28 -0
  82. package/dist/providers/schema.js +49 -0
  83. package/dist/providers/state.d.ts +55 -0
  84. package/dist/providers/state.js +289 -0
  85. package/dist/provision.d.ts +10 -1
  86. package/dist/provision.js +91 -4
  87. package/dist/r2-service-data.d.ts +2 -0
  88. package/dist/r2-service-data.js +136 -0
  89. package/dist/readiness.js +9 -13
  90. package/dist/registry/add.d.ts +6 -0
  91. package/dist/registry/add.js +93 -22
  92. package/dist/registry/commands.d.ts +3 -2
  93. package/dist/registry/commands.js +52 -15
  94. package/dist/registry/options.d.ts +1 -1
  95. package/dist/registry/options.js +5 -4
  96. package/dist/registry/preview.d.ts +11 -0
  97. package/dist/registry/preview.js +91 -0
  98. package/dist/registry/receipt.d.ts +1 -0
  99. package/dist/registry/receipt.js +19 -4
  100. package/dist/registry/resolve.js +5 -1
  101. package/dist/registry/usage.d.ts +10 -0
  102. package/dist/registry/usage.js +18 -37
  103. package/dist/render.d.ts +2 -0
  104. package/dist/render.js +6 -0
  105. package/dist/runtime-policy.d.ts +4 -0
  106. package/dist/runtime-policy.js +21 -0
  107. package/dist/scaffold/auth.js +3 -19
  108. package/dist/scaffold/bootstrap.js +2 -2
  109. package/dist/scaffold/compose.js +9 -3
  110. package/dist/scaffold/database.js +107 -25
  111. package/dist/scaffold/documentation.js +18 -13
  112. package/dist/scaffold/lint.d.ts +4 -0
  113. package/dist/scaffold/lint.js +56 -0
  114. package/dist/scaffold/neon-realtime.d.ts +2 -0
  115. package/dist/scaffold/neon-realtime.js +97 -0
  116. package/dist/scaffold/stack-documentation.js +1 -1
  117. package/dist/scaffold/void.d.ts +4 -0
  118. package/dist/scaffold/void.js +256 -0
  119. package/dist/scaffold/web.js +7 -1
  120. package/dist/scaffold/workspace.js +127 -25
  121. package/dist/service-deletion.d.ts +29 -0
  122. package/dist/service-deletion.js +195 -0
  123. package/dist/service-descriptor.d.ts +10 -0
  124. package/dist/service-descriptor.js +78 -0
  125. package/dist/service-model.d.ts +49 -0
  126. package/dist/service-model.js +8 -0
  127. package/dist/service-operations.d.ts +29 -0
  128. package/dist/service-operations.js +78 -0
  129. package/dist/service-readers.d.ts +8 -0
  130. package/dist/service-readers.js +247 -0
  131. package/dist/services-command.d.ts +39 -0
  132. package/dist/services-command.js +100 -0
  133. package/dist/ship.d.ts +348 -0
  134. package/dist/ship.js +237 -0
  135. package/dist/stack-registry.d.ts +4 -2
  136. package/dist/stack-registry.js +48 -12
  137. package/dist/standard.d.ts +2 -1
  138. package/dist/standard.js +33 -14
  139. package/dist/transaction.d.ts +2 -0
  140. package/dist/transaction.js +10 -0
  141. package/dist/util.js +17 -2
  142. package/dist/vercel.d.ts +5 -3
  143. package/dist/vercel.js +96 -14
  144. package/dist/version.d.ts +1 -1
  145. package/dist/version.js +1 -1
  146. package/dist/vinext.d.ts +1 -0
  147. package/dist/vinext.js +13 -1
  148. package/dist/void-execution.d.ts +10 -0
  149. package/dist/void-execution.js +94 -0
  150. package/dist/void-migrations.d.ts +6 -0
  151. package/dist/void-migrations.js +110 -0
  152. package/dist/void-state.d.ts +16 -0
  153. package/dist/void-state.js +65 -0
  154. package/dist/void.d.ts +3 -0
  155. package/dist/void.js +5 -0
  156. package/docs/cli-design.md +67 -0
  157. package/docs/delivery-workflow.md +32 -17
  158. package/docs/plugin-ui.md +102 -0
  159. package/docs/provider-configuration.md +116 -0
  160. package/docs/stack-standard.md +175 -0
  161. package/docs/void-verification.md +185 -0
  162. package/package.json +29 -23
  163. package/assets/anhedral-cli-init-technical.svg +0 -322
  164. package/assets/anhedral-cli-init.svg +0 -322
  165. package/assets/anhedral-mark.svg +0 -4
  166. package/assets/anhedral.svg +0 -4
  167. package/assets/favicon.ico +0 -0
  168. package/assets/security/LICENSES.txt +0 -63
  169. package/assets/security/audit-deps.mjs +0 -300
  170. package/assets/security/braces-regression.mjs +0 -102
  171. package/assets/security/braces@3.0.3.patch +0 -285
  172. package/assets/security/decode-uri-component@0.2.2.patch +0 -149
  173. package/assets/security/decoder-regression.mjs +0 -37
  174. package/assets/security/forge-regression.mjs +0 -46
  175. package/assets/security/manifest.json +0 -53
  176. package/assets/security/node-forge@1.4.0.patch +0 -26
  177. package/dist/managed-hosting.d.ts +0 -49
  178. package/dist/managed-hosting.js +0 -373
  179. package/dist/security-backports.d.ts +0 -3
  180. package/dist/security-backports.js +0 -26
  181. package/docs/application-stack-standard.md +0 -104
  182. package/docs/managed-hosting-architecture.md +0 -87
  183. package/docs/sponsorships.md +0 -25
@@ -0,0 +1,127 @@
1
+ diff --git a/lib/compile.js b/lib/compile.js
2
+ --- a/lib/compile.js
3
+ +++ b/lib/compile.js
4
+ @@ -2,8 +2,10 @@
5
+
6
+ const fill = require('fill-range');
7
+ const utils = require('./utils');
8
+ +const { checkAst } = require('./limits');
9
+
10
+ const compile = (ast, options = {}) => {
11
+ + checkAst(ast);
12
+ const walk = (node, parent = {}) => {
13
+ const invalidBlock = utils.isInvalidBrace(parent);
14
+ const invalidNode = node.invalid === true && options.escapeInvalid === true;
15
+ diff --git a/lib/expand.js b/lib/expand.js
16
+ --- a/lib/expand.js
17
+ +++ b/lib/expand.js
18
+ @@ -3,6 +3,7 @@
19
+ const fill = require('fill-range');
20
+ const stringify = require('./stringify');
21
+ const utils = require('./utils');
22
+ +const { checkAst } = require('./limits');
23
+
24
+ const append = (queue = '', stash = '', enclose = false) => {
25
+ const result = [];
26
+ @@ -31,6 +32,7 @@
27
+ };
28
+
29
+ const expand = (ast, options = {}) => {
30
+ + checkAst(ast, true);
31
+ const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit;
32
+
33
+ const walk = (node, parent = {}) => {
34
+ diff --git a/lib/limits.js b/lib/limits.js
35
+ new file mode 100644
36
+ --- /dev/null
37
+ +++ b/lib/limits.js
38
+ @@ -0,0 +1,44 @@
39
+ +'use strict';
40
+ +
41
+ +const MAX_DEPTH = 100;
42
+ +const fail = () => {
43
+ + throw new RangeError(`braces nesting exceeds maximum depth of ${MAX_DEPTH}`);
44
+ +};
45
+ +
46
+ +// Preflight recursive walkers iteratively. The root is not a nesting level;
47
+ +// leaves do not add a level. Normal parent links are intentionally separate
48
+ +// from child traversal, since a parsed AST links each child to its parent.
49
+ +const checkAst = (ast, checkParents = false) => {
50
+ + const active = new Set();
51
+ + const stack = [{ node: ast, depth: 0, root: true }];
52
+ + while (stack.length) {
53
+ + const frame = stack.pop();
54
+ + const node = frame.node;
55
+ + if (!node || typeof node !== 'object') continue;
56
+ + if (frame.exit) {
57
+ + active.delete(node);
58
+ + continue;
59
+ + }
60
+ + if (active.has(node)) fail();
61
+ + const children = Array.isArray(node.nodes) ? node.nodes : [];
62
+ + const depth = frame.depth + (Array.isArray(node.nodes) && !(frame.root && node.type === 'root') ? 1 : 0);
63
+ + if (depth > MAX_DEPTH) fail();
64
+ + if (checkParents) {
65
+ + const parents = new Set();
66
+ + let parent = node;
67
+ + let count = 0;
68
+ + while (parent && parent.type !== 'brace' && parent.type !== 'root' && parent.parent) {
69
+ + if (parents.has(parent) || ++count > MAX_DEPTH + 1) fail();
70
+ + parents.add(parent);
71
+ + parent = parent.parent;
72
+ + }
73
+ + }
74
+ + active.add(node);
75
+ + stack.push({ node, exit: true });
76
+ + for (let index = children.length - 1; index >= 0; index--) {
77
+ + stack.push({ node: children[index], depth });
78
+ + }
79
+ + }
80
+ +};
81
+ +
82
+ +module.exports = { MAX_DEPTH, checkAst };
83
+ diff --git a/lib/parse.js b/lib/parse.js
84
+ --- a/lib/parse.js
85
+ +++ b/lib/parse.js
86
+ @@ -1,6 +1,7 @@
87
+ 'use strict';
88
+
89
+ const stringify = require('./stringify');
90
+ +const { MAX_DEPTH } = require('./limits');
91
+
92
+ /**
93
+ * Constants
94
+ @@ -143,6 +144,9 @@
95
+ */
96
+
97
+ if (value === CHAR_LEFT_PARENTHESES) {
98
+ + if (stack.length > MAX_DEPTH) {
99
+ + throw new RangeError(`braces nesting exceeds maximum depth of ${MAX_DEPTH}`);
100
+ + }
101
+ block = push({ type: 'paren', nodes: [] });
102
+ stack.push(block);
103
+ push({ type: 'text', value });
104
+ @@ -195,6 +199,9 @@
105
+ */
106
+
107
+ if (value === CHAR_LEFT_CURLY_BRACE) {
108
+ + if (stack.length > MAX_DEPTH) {
109
+ + throw new RangeError(`braces nesting exceeds maximum depth of ${MAX_DEPTH}`);
110
+ + }
111
+ depth++;
112
+
113
+ const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
114
+ diff --git a/lib/stringify.js b/lib/stringify.js
115
+ --- a/lib/stringify.js
116
+ +++ b/lib/stringify.js
117
+ @@ -1,8 +1,10 @@
118
+ 'use strict';
119
+
120
+ const utils = require('./utils');
121
+ +const { checkAst } = require('./limits');
122
+
123
+ module.exports = (ast, options = {}) => {
124
+ + checkAst(ast);
125
+ const stringify = (node, parent = {}) => {
126
+ const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
127
+ const invalidNode = node.invalid === true && options.escapeInvalid === true;