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.
- package/README.md +79 -124
- package/assets/patches/LICENSE.braces +21 -0
- package/assets/patches/LICENSE.node-forge +50 -0
- package/assets/patches/audit-deps.mjs +167 -0
- package/assets/patches/braces@3.0.3.patch +127 -0
- package/assets/patches/node-forge@1.4.0.patch +41 -0
- package/dist/auth-schema.js +3 -3
- package/dist/bin.js +284 -163
- package/dist/capabilities.d.ts +4 -4
- package/dist/capabilities.js +6 -2
- package/dist/capability-contract.d.ts +47 -0
- package/dist/capability-contract.js +153 -0
- package/dist/catalog-model.d.ts +24 -0
- package/dist/catalog-model.js +1 -0
- package/dist/catalog-registration.d.ts +16 -0
- package/dist/catalog-registration.js +22 -0
- package/dist/catalog-snapshot.d.ts +5 -0
- package/dist/catalog-snapshot.js +97 -0
- package/dist/cli-arguments.d.ts +16 -0
- package/dist/cli-arguments.js +115 -0
- package/dist/cli-output.d.ts +8 -0
- package/dist/cli-output.js +236 -0
- package/dist/cloudflare.d.ts +14 -3
- package/dist/cloudflare.js +196 -36
- package/dist/command-schema.d.ts +21 -0
- package/dist/command-schema.js +418 -0
- package/dist/delivery.d.ts +12 -5
- package/dist/delivery.js +173 -39
- package/dist/dependencies.d.ts +24 -0
- package/dist/dependencies.js +48 -0
- package/dist/dependency-patches.d.ts +7 -0
- package/dist/dependency-patches.js +125 -0
- package/dist/index.d.ts +26 -1
- package/dist/index.js +17 -1
- package/dist/inspector-model.d.ts +123 -0
- package/dist/inspector-model.js +1 -0
- package/dist/integration-service-readers.d.ts +13 -0
- package/dist/integration-service-readers.js +173 -0
- package/dist/lifecycle-model.d.ts +15 -0
- package/dist/lifecycle-model.js +20 -0
- package/dist/lifecycle.d.ts +11 -0
- package/dist/lifecycle.js +91 -0
- package/dist/mobile-delivery.d.ts +100 -0
- package/dist/mobile-delivery.js +319 -0
- package/dist/neon-service-data.d.ts +8 -0
- package/dist/neon-service-data.js +117 -0
- package/dist/platforms/mobile.js +8 -5
- package/dist/pnpm-policy.d.ts +2 -2
- package/dist/pnpm-policy.js +19 -45
- package/dist/project-catalog.d.ts +41 -0
- package/dist/project-catalog.js +288 -0
- package/dist/project-config.d.ts +14 -0
- package/dist/project-config.js +89 -0
- package/dist/project-inspector.d.ts +4 -0
- package/dist/project-inspector.js +702 -0
- package/dist/project-lifecycle.d.ts +25 -0
- package/dist/project-lifecycle.js +57 -0
- package/dist/project-state.d.ts +22 -1
- package/dist/project-state.js +361 -27
- package/dist/provider-auth.d.ts +41 -0
- package/dist/provider-auth.js +209 -0
- package/dist/provider-readiness.js +27 -10
- package/dist/providers/adapters.d.ts +17 -0
- package/dist/providers/adapters.js +272 -0
- package/dist/providers/api.d.ts +29 -0
- package/dist/providers/api.js +253 -0
- package/dist/providers/config.d.ts +15 -0
- package/dist/providers/config.js +182 -0
- package/dist/providers/definitions.d.ts +318 -0
- package/dist/providers/definitions.js +127 -0
- package/dist/providers/provision.d.ts +24 -0
- package/dist/providers/provision.js +76 -0
- package/dist/providers/receipts.d.ts +20 -0
- package/dist/providers/receipts.js +66 -0
- package/dist/providers/recovery-verification.d.ts +7 -0
- package/dist/providers/recovery-verification.js +112 -0
- package/dist/providers/recovery.d.ts +30 -0
- package/dist/providers/recovery.js +34 -0
- package/dist/providers/runtime.d.ts +10 -0
- package/dist/providers/runtime.js +254 -0
- package/dist/providers/schema.d.ts +28 -0
- package/dist/providers/schema.js +49 -0
- package/dist/providers/state.d.ts +55 -0
- package/dist/providers/state.js +289 -0
- package/dist/provision.d.ts +10 -1
- package/dist/provision.js +91 -4
- package/dist/r2-service-data.d.ts +2 -0
- package/dist/r2-service-data.js +136 -0
- package/dist/readiness.js +9 -13
- package/dist/registry/add.d.ts +6 -0
- package/dist/registry/add.js +93 -22
- package/dist/registry/commands.d.ts +3 -2
- package/dist/registry/commands.js +52 -15
- package/dist/registry/options.d.ts +1 -1
- package/dist/registry/options.js +5 -4
- package/dist/registry/preview.d.ts +11 -0
- package/dist/registry/preview.js +91 -0
- package/dist/registry/receipt.d.ts +1 -0
- package/dist/registry/receipt.js +19 -4
- package/dist/registry/resolve.js +5 -1
- package/dist/registry/usage.d.ts +10 -0
- package/dist/registry/usage.js +18 -37
- package/dist/render.d.ts +2 -0
- package/dist/render.js +6 -0
- package/dist/runtime-policy.d.ts +4 -0
- package/dist/runtime-policy.js +21 -0
- package/dist/scaffold/auth.js +3 -19
- package/dist/scaffold/bootstrap.js +2 -2
- package/dist/scaffold/compose.js +9 -3
- package/dist/scaffold/database.js +107 -25
- package/dist/scaffold/documentation.js +18 -13
- package/dist/scaffold/lint.d.ts +4 -0
- package/dist/scaffold/lint.js +56 -0
- package/dist/scaffold/neon-realtime.d.ts +2 -0
- package/dist/scaffold/neon-realtime.js +97 -0
- package/dist/scaffold/stack-documentation.js +1 -1
- package/dist/scaffold/void.d.ts +4 -0
- package/dist/scaffold/void.js +256 -0
- package/dist/scaffold/web.js +7 -1
- package/dist/scaffold/workspace.js +127 -25
- package/dist/service-deletion.d.ts +29 -0
- package/dist/service-deletion.js +195 -0
- package/dist/service-descriptor.d.ts +10 -0
- package/dist/service-descriptor.js +78 -0
- package/dist/service-model.d.ts +49 -0
- package/dist/service-model.js +8 -0
- package/dist/service-operations.d.ts +29 -0
- package/dist/service-operations.js +78 -0
- package/dist/service-readers.d.ts +8 -0
- package/dist/service-readers.js +247 -0
- package/dist/services-command.d.ts +39 -0
- package/dist/services-command.js +100 -0
- package/dist/ship.d.ts +348 -0
- package/dist/ship.js +237 -0
- package/dist/stack-registry.d.ts +4 -2
- package/dist/stack-registry.js +48 -12
- package/dist/standard.d.ts +2 -1
- package/dist/standard.js +33 -14
- package/dist/transaction.d.ts +2 -0
- package/dist/transaction.js +10 -0
- package/dist/util.js +17 -2
- package/dist/vercel.d.ts +5 -3
- package/dist/vercel.js +96 -14
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/vinext.d.ts +1 -0
- package/dist/vinext.js +13 -1
- package/dist/void-execution.d.ts +10 -0
- package/dist/void-execution.js +94 -0
- package/dist/void-migrations.d.ts +6 -0
- package/dist/void-migrations.js +110 -0
- package/dist/void-state.d.ts +16 -0
- package/dist/void-state.js +65 -0
- package/dist/void.d.ts +3 -0
- package/dist/void.js +5 -0
- package/docs/cli-design.md +67 -0
- package/docs/delivery-workflow.md +32 -17
- package/docs/plugin-ui.md +102 -0
- package/docs/provider-configuration.md +116 -0
- package/docs/stack-standard.md +175 -0
- package/docs/void-verification.md +185 -0
- package/package.json +29 -23
- package/assets/anhedral-cli-init-technical.svg +0 -322
- package/assets/anhedral-cli-init.svg +0 -322
- package/assets/anhedral-mark.svg +0 -4
- package/assets/anhedral.svg +0 -4
- package/assets/favicon.ico +0 -0
- package/assets/security/LICENSES.txt +0 -63
- package/assets/security/audit-deps.mjs +0 -300
- package/assets/security/braces-regression.mjs +0 -102
- package/assets/security/braces@3.0.3.patch +0 -285
- package/assets/security/decode-uri-component@0.2.2.patch +0 -149
- package/assets/security/decoder-regression.mjs +0 -37
- package/assets/security/forge-regression.mjs +0 -46
- package/assets/security/manifest.json +0 -53
- package/assets/security/node-forge@1.4.0.patch +0 -26
- package/dist/managed-hosting.d.ts +0 -49
- package/dist/managed-hosting.js +0 -373
- package/dist/security-backports.d.ts +0 -3
- package/dist/security-backports.js +0 -26
- package/docs/application-stack-standard.md +0 -104
- package/docs/managed-hosting-architecture.md +0 -87
- 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;
|