@lowgular/code-graph 0.0.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.
- package/bin/cli.js +2463 -0
- package/lib.js +2430 -0
- package/package.json +26 -7
- package/apps/code-graph/src/main.js +0 -50
- package/libs/cli/code-graph/src/index.js +0 -39
- package/libs/cli/code-graph/src/lib/class-declarations/abstractions/service.js +0 -72
- package/libs/cli/code-graph/src/lib/class-declarations/abstractions/service.stateful.js +0 -68
- package/libs/cli/code-graph/src/lib/class-declarations/class-declarations.doc.js +0 -147
- package/libs/cli/code-graph/src/lib/class-declarations/class-declarations.graph.js +0 -55
- package/libs/cli/code-graph/src/lib/class-declarations/index.js +0 -27
- package/libs/cli/code-graph/src/lib/code.graph.factory.js +0 -63
- package/libs/cli/code-graph/src/lib/code.graph.js +0 -62
- package/libs/cli/code-graph/src/lib/core/core.js +0 -58
- package/libs/cli/code-graph/src/lib/core.js +0 -85
- package/libs/cli/code-graph/src/lib/decorators/index.js +0 -36
- package/libs/cli/code-graph/src/lib/docs/index.js +0 -21
- package/libs/cli/code-graph/src/lib/docs/specs.js +0 -36
- package/libs/cli/code-graph/src/lib/expressions/call-expressions.graph.js +0 -28
- package/libs/cli/code-graph/src/lib/fixtures/reactive-event-bus/src/app/examples.event-bus.js +0 -53
- package/libs/cli/code-graph/src/lib/method-declarations/index.js +0 -23
- package/libs/cli/code-graph/src/lib/method-declarations/method-declarations.doc.js +0 -106
- package/libs/cli/code-graph/src/lib/method-declarations/method-declarations.graph.js +0 -56
- package/libs/cli/code-graph/src/lib/parameters/index.js +0 -42
- package/libs/cli/code-graph/src/lib/property-declarations/abstractions/reactive-state.evals.js +0 -139
- package/libs/cli/code-graph/src/lib/property-declarations/abstractions/reactive-state.js +0 -104
- package/libs/cli/code-graph/src/lib/property-declarations/index.js +0 -25
- package/libs/cli/code-graph/src/lib/property-declarations/property-declarations.doc.js +0 -74
- package/libs/cli/code-graph/src/lib/property-declarations/property-declarations.graph.js +0 -43
- package/libs/cli/code-graph/src/lib/tools/index.js +0 -34
- package/libs/cli/code-graph/src/lib/tools/match-code-graph.tool.js +0 -64
- package/libs/cli/code-graph/src/lib/types/index.js +0 -99
- package/libs/cli/code-graph/src/lib/v2/extractors/extractor.doc.js +0 -345
- package/libs/cli/code-graph/src/lib/v2/extractors/extractor.js +0 -52
- package/libs/cli/code-graph/src/lib/v2/extractors/index.js +0 -23
- package/libs/cli/code-graph/src/lib/v2/graph-builder/code-graph.builder.js +0 -76
- package/libs/cli/code-graph/src/lib/v2/graph-builder/index.js +0 -21
- package/libs/cli/code-graph/src/lib/v2/graph-builder/node.processor.js +0 -48
- package/libs/cli/code-graph/src/lib/v2/graph-builder/relationship.processor.js +0 -79
- package/libs/cli/code-graph/src/lib/v2/graph-builder/type.processor.js +0 -45
- package/libs/cli/code-graph/src/lib/v2/index.js +0 -37
- package/libs/cli/code-graph/src/lib/v2/tools/build-code-graph.doc.js +0 -220
- package/libs/cli/code-graph/src/lib/v2/tools/build-code-graph.tool.js +0 -42
- package/libs/cli/cypher/src/index.js +0 -25
- package/libs/cli/cypher/src/lib/docs/features/advanced-optional-match.feature.js +0 -277
- package/libs/cli/cypher/src/lib/docs/features/anonymous-relationship.feature.js +0 -69
- package/libs/cli/cypher/src/lib/docs/features/anonymous-variable-length.feature.js +0 -105
- package/libs/cli/cypher/src/lib/docs/features/basic-filtering.feature.js +0 -70
- package/libs/cli/cypher/src/lib/docs/features/basic-optional-match.feature.js +0 -99
- package/libs/cli/cypher/src/lib/docs/features/basic-relationship.feature.js +0 -125
- package/libs/cli/cypher/src/lib/docs/features/index.js +0 -51
- package/libs/cli/cypher/src/lib/docs/features/limit.feature.js +0 -50
- package/libs/cli/cypher/src/lib/docs/features/match-nodes.feature.js +0 -106
- package/libs/cli/cypher/src/lib/docs/features/multiple-relationship-types.feature.js +0 -105
- package/libs/cli/cypher/src/lib/docs/features/order-by.feature.js +0 -143
- package/libs/cli/cypher/src/lib/docs/features/property-matching.feature.js +0 -152
- package/libs/cli/cypher/src/lib/docs/features/relationship-without-variable.feature.js +0 -48
- package/libs/cli/cypher/src/lib/docs/features/return-statement.feature.js +0 -65
- package/libs/cli/cypher/src/lib/docs/features/unidirected-relationship.feature.js +0 -82
- package/libs/cli/cypher/src/lib/docs/features/variable-length-path.feature.js +0 -136
- package/libs/cli/cypher/src/lib/docs/features/where-conditional.feature.js +0 -187
- package/libs/cli/cypher/src/lib/docs/features/where-operators.feature.js +0 -302
- package/libs/cli/cypher/src/lib/docs/prompts.js +0 -36
- package/libs/cli/cypher/src/lib/docs/specs.js +0 -181
- package/libs/cli/cypher/src/lib/executor/condition-evaluator.js +0 -158
- package/libs/cli/cypher/src/lib/executor/executor.js +0 -83
- package/libs/cli/cypher/src/lib/executor/graph.js +0 -15
- package/libs/cli/cypher/src/lib/executor/match-engine.js +0 -153
- package/libs/cli/cypher/src/lib/executor/pattern-matcher.js +0 -109
- package/libs/cli/cypher/src/lib/executor/relationship-navigator.js +0 -64
- package/libs/cli/cypher/src/lib/executor/result-formatter.js +0 -143
- package/libs/cli/cypher/src/lib/executor/traverse-engine.js +0 -164
- package/libs/cli/cypher/src/lib/executor/utils.js +0 -37
- package/libs/cli/cypher/src/lib/graph.stub.js +0 -63
- package/libs/cli/cypher/src/lib/index.js +0 -74
- package/libs/cli/cypher/src/lib/lexer.js +0 -398
- package/libs/cli/cypher/src/lib/parser.js +0 -602
- package/libs/cli/cypher/src/lib/validator/query-validator.js +0 -95
- package/libs/cli/cypher/src/lib/validator/supported-features.config.js +0 -111
- package/libs/cli/cypher/src/lib/validator/unsupported-features.config.js +0 -150
- package/libs/cli/shared/src/index.js +0 -53
- package/libs/cli/shared/src/lib/admin-token.js +0 -121
- package/libs/cli/shared/src/lib/config.js +0 -49
- package/libs/cli/shared/src/lib/consts.js +0 -57
- package/libs/cli/shared/src/lib/core.js +0 -46
- package/libs/cli/shared/src/lib/infrastructure/cli.js +0 -47
- package/libs/cli/shared/src/lib/infrastructure/config.js +0 -47
- package/libs/cli/shared/src/lib/infrastructure/config.reporitory.js +0 -51
- package/libs/cli/shared/src/lib/infrastructure/formatters/console-formatter.js +0 -96
- package/libs/cli/shared/src/lib/infrastructure/formatters/index.js +0 -41
- package/libs/cli/shared/src/lib/infrastructure/formatters/json-formatter.js +0 -64
- package/libs/cli/shared/src/lib/infrastructure/formatters/markdown-formatter.js +0 -120
- package/libs/cli/shared/src/lib/infrastructure/formatters/types.js +0 -15
- package/libs/cli/shared/src/lib/infrastructure/formatters/utils.js +0 -72
- package/libs/cli/shared/src/lib/infrastructure/git.js +0 -147
- package/libs/cli/shared/src/lib/infrastructure/http.js +0 -257
- package/libs/cli/shared/src/lib/infrastructure/markdown.js +0 -95
- package/libs/cli/shared/src/lib/infrastructure/transformers/embeddings.js +0 -88
- package/libs/cli/shared/src/lib/infrastructure/transformers/index.js +0 -25
- package/libs/cli/shared/src/lib/infrastructure/transformers/rag-eval.js +0 -154
- package/libs/cli/shared/src/lib/infrastructure/transformers/similarity.js +0 -210
- package/libs/cli/shared/src/lib/infrastructure/workspace.js +0 -297
- package/libs/cli/shared/src/lib/infrastructure/yaml.js +0 -237
- package/libs/cli/shared/src/lib/lowgular.config.js +0 -120
- package/libs/cli/shared/src/lib/token.js +0 -135
- package/libs/cli/shared/src/lib/utils/solution.util.js +0 -35
- package/libs/cli/shared/src/lib/utils/utils.js +0 -89
- package/libs/cli/typescript/src/index.js +0 -21
- package/libs/cli/typescript/src/lib/base/index.js +0 -23
- package/libs/cli/typescript/src/lib/base/nameable.js +0 -34
- package/libs/cli/typescript/src/lib/base/nodeable.js +0 -36
- package/libs/cli/typescript/src/lib/class.implementation.js +0 -52
- package/libs/cli/typescript/src/lib/core/declaration.registry.js +0 -107
- package/libs/cli/typescript/src/lib/core/design-pattern.js +0 -55
- package/libs/cli/typescript/src/lib/core/index.js +0 -35
- package/libs/cli/typescript/src/lib/core/navigable-declaration.js +0 -69
- package/libs/cli/typescript/src/lib/core/program-context.js +0 -71
- package/libs/cli/typescript/src/lib/core/syntax-kind.utils.js +0 -40
- package/libs/cli/typescript/src/lib/core/type.js +0 -374
- package/libs/cli/typescript/src/lib/declaration.abstraction.js +0 -90
- package/libs/cli/typescript/src/lib/decorator.implementation.js +0 -35
- package/libs/cli/typescript/src/lib/enum.implementation.js +0 -35
- package/libs/cli/typescript/src/lib/function-declaration.implementation.js +0 -35
- package/libs/cli/typescript/src/lib/index.js +0 -57
- package/libs/cli/typescript/src/lib/interface.implementation.js +0 -51
- package/libs/cli/typescript/src/lib/members/method-abstraction.resolver.js +0 -90
- package/libs/cli/typescript/src/lib/members/method-declaration.implementation.js +0 -44
- package/libs/cli/typescript/src/lib/members/method-signature.implementation.js +0 -46
- package/libs/cli/typescript/src/lib/members/method.util.js +0 -32
- package/libs/cli/typescript/src/lib/members/parameter.implementation.js +0 -38
- package/libs/cli/typescript/src/lib/members/property-declaration.implementation.js +0 -64
- package/libs/cli/typescript/src/lib/members/property-signature.implementation.js +0 -34
- package/libs/cli/typescript/src/lib/members/property.util.js +0 -61
- package/libs/cli/typescript/src/lib/members/statements/expressions/binary-expression.implementation.js +0 -42
- package/libs/cli/typescript/src/lib/members/statements/expressions/call-expression.implementation.js +0 -114
- package/libs/cli/typescript/src/lib/members/statements/expressions/expression.abstraction.js +0 -188
- package/libs/cli/typescript/src/lib/members/statements/expressions/property-access-expression.implementation.js +0 -35
- package/libs/cli/typescript/src/lib/members/statements/expressions/unary-expression.implementation.js +0 -51
- package/libs/cli/typescript/src/lib/members/statements/statement.implementation.js +0 -49
- package/libs/cli/typescript/src/lib/members/statements/utils.js +0 -51
- package/libs/cli/typescript/src/lib/plugins/built-in.plugin.js +0 -258
- package/libs/cli/typescript/src/lib/plugins/plugin.interface.js +0 -15
- package/libs/cli/typescript/src/lib/plugins/rxjs.plugin.js +0 -228
- package/libs/cli/typescript/src/lib/plugins/signal.plugin.js +0 -126
- package/libs/cli/typescript/src/lib/plugins/stubs.js +0 -66
- package/libs/cli/typescript/src/lib/type-alias.implementation.js +0 -72
- package/libs/cli/typescript/src/lib/utils.js +0 -39
- package/libs/cli/typescript/src/lib/variable-declaration.implementation.js +0 -35
- package/libs/core/codegular/src/index.js +0 -21
- package/libs/core/codegular/src/lib/index.js +0 -29
- package/libs/core/codegular/src/lib/node.js +0 -112
- package/libs/core/codegular/src/lib/program.js +0 -92
- package/libs/core/codegular/src/lib/string.js +0 -168
- package/libs/core/codegular/src/lib/type-checker.js +0 -170
- package/libs/core/codegular/src/lib/utils.js +0 -347
- package/main.js +0 -43
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var supported_features_config_exports = {};
|
|
19
|
-
__export(supported_features_config_exports, {
|
|
20
|
-
ERROR_HANDLING_ITEMS: () => ERROR_HANDLING_ITEMS,
|
|
21
|
-
NODE_CONSTRAINTS: () => NODE_CONSTRAINTS,
|
|
22
|
-
PATTERN_CONSTRAINTS: () => PATTERN_CONSTRAINTS,
|
|
23
|
-
QUERY_CONSTRAINTS: () => QUERY_CONSTRAINTS,
|
|
24
|
-
RELATIONSHIP_CONSTRAINTS: () => RELATIONSHIP_CONSTRAINTS,
|
|
25
|
-
RESULT_FORMAT_ITEMS: () => RESULT_FORMAT_ITEMS
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(supported_features_config_exports);
|
|
28
|
-
const NODE_CONSTRAINTS = [
|
|
29
|
-
{
|
|
30
|
-
description: "Nodes can have multiple labels (:A:B means must have A AND B and :A|B means must have A OR B)"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
description: "Properties are flat (no nested objects)"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
description: "Property values are primitive types only (no temporal types, points, or complex objects)"
|
|
37
|
-
}
|
|
38
|
-
];
|
|
39
|
-
const RELATIONSHIP_CONSTRAINTS = [
|
|
40
|
-
{
|
|
41
|
-
description: "Variable-length paths only support `*` (unlimited, zero or more)"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
description: "Path range syntax not supported: `*1..3`, `*2..`, `*..3` are invalid"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
description: "Edge properties not supported - cannot filter edges by properties"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
description: "Edges only have: source, target, type (no custom properties)"
|
|
51
|
-
}
|
|
52
|
-
];
|
|
53
|
-
const QUERY_CONSTRAINTS = [
|
|
54
|
-
{
|
|
55
|
-
description: "RETURN clause cannot be omitted (make sure to always add at least the clause: RETURN * - all matched variables are returned)"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
description: "The IN operator matches the EXACT array."
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
description: "WHERE conditions must use same logic operator (all AND or all OR, cannot mix)"
|
|
62
|
-
}
|
|
63
|
-
];
|
|
64
|
-
const PATTERN_CONSTRAINTS = [
|
|
65
|
-
{
|
|
66
|
-
description: "Label AND syntax: `(n:Label1:Label2)` requires both labels (AND semantics)"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
description: "Label OR syntax: `(n:Label1|Label2)` requires either label (OR semantics)"
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
description: "Anonymous variables are auto-generated and filtered from results"
|
|
73
|
-
}
|
|
74
|
-
];
|
|
75
|
-
const RESULT_FORMAT_ITEMS = [
|
|
76
|
-
{
|
|
77
|
-
description: "Results are arrays of objects"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
description: "Each object maps variable names to matched nodes/edges"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
description: "Nodes include: id, labels, filePath, range and name."
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
description: "Edges include: source, target, type"
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
description: "Null values preserved for unmatched optional variables"
|
|
90
|
-
}
|
|
91
|
-
];
|
|
92
|
-
const ERROR_HANDLING_ITEMS = [
|
|
93
|
-
{
|
|
94
|
-
description: "Standard parser errors for invalid syntax"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
description: "Undefined variables in WHERE or RETURN will cause errors"
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
description: "Using FORBIDDEN features will cause errors"
|
|
101
|
-
}
|
|
102
|
-
];
|
|
103
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
104
|
-
0 && (module.exports = {
|
|
105
|
-
ERROR_HANDLING_ITEMS,
|
|
106
|
-
NODE_CONSTRAINTS,
|
|
107
|
-
PATTERN_CONSTRAINTS,
|
|
108
|
-
QUERY_CONSTRAINTS,
|
|
109
|
-
RELATIONSHIP_CONSTRAINTS,
|
|
110
|
-
RESULT_FORMAT_ITEMS
|
|
111
|
-
});
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var unsupported_features_config_exports = {};
|
|
19
|
-
__export(unsupported_features_config_exports, {
|
|
20
|
-
FORBIDDEN_AGGREGATIONS: () => FORBIDDEN_AGGREGATIONS,
|
|
21
|
-
FORBIDDEN_FEATURES: () => FORBIDDEN_FEATURES,
|
|
22
|
-
FORBIDDEN_KEYWORDS: () => FORBIDDEN_KEYWORDS,
|
|
23
|
-
FORBIDDEN_MODIFIERS: () => FORBIDDEN_MODIFIERS,
|
|
24
|
-
FORBIDDEN_PATTERNS: () => FORBIDDEN_PATTERNS
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(unsupported_features_config_exports);
|
|
27
|
-
const FORBIDDEN_KEYWORDS = [
|
|
28
|
-
{
|
|
29
|
-
pattern: /\bWITH\b/i,
|
|
30
|
-
name: "WITH clause",
|
|
31
|
-
errorMessage: "WITH clause is not supported. Cannot use WITH for intermediate results or variable passing.",
|
|
32
|
-
alternative: "Use multiple MATCH statements or inline variables directly in WHERE/RETURN clauses."
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
pattern: /\bUNWIND\b/i,
|
|
36
|
-
name: "UNWIND clause",
|
|
37
|
-
errorMessage: "UNWIND clause is not supported. Cannot use UNWIND to expand arrays."
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
pattern: /\bUNION\b/i,
|
|
41
|
-
name: "UNION clause",
|
|
42
|
-
errorMessage: "UNION clause is not supported. Cannot combine result sets with UNION."
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
pattern: /\bCREATE\b/i,
|
|
46
|
-
name: "CREATE clause",
|
|
47
|
-
errorMessage: "CREATE clause is not supported. This is a read-only query engine (no mutations)."
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
pattern: /\bMERGE\b/i,
|
|
51
|
-
name: "MERGE clause",
|
|
52
|
-
errorMessage: "MERGE clause is not supported. This is a read-only query engine (no mutations)."
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
pattern: /\bDELETE\b/i,
|
|
56
|
-
name: "DELETE clause",
|
|
57
|
-
errorMessage: "DELETE clause is not supported. This is a read-only query engine (no mutations)."
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
pattern: /\bSET\b/i,
|
|
61
|
-
name: "SET clause",
|
|
62
|
-
errorMessage: "SET clause is not supported. This is a read-only query engine (no mutations)."
|
|
63
|
-
}
|
|
64
|
-
];
|
|
65
|
-
const FORBIDDEN_AGGREGATIONS = [
|
|
66
|
-
{
|
|
67
|
-
pattern: /\bCOUNT\s*\(/i,
|
|
68
|
-
name: "COUNT() function",
|
|
69
|
-
errorMessage: "COUNT() aggregation function is not supported. Aggregation functions are not available.",
|
|
70
|
-
alternative: "Use manual counting patterns or return all results and count in application code."
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
pattern: /\bSUM\s*\(/i,
|
|
74
|
-
name: "SUM() function",
|
|
75
|
-
errorMessage: "SUM() aggregation function is not supported. Aggregation functions are not available."
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
pattern: /\bcollect\s*\(/i,
|
|
79
|
-
name: "collect() function",
|
|
80
|
-
errorMessage: "collect() aggregation function is not supported. Aggregation functions are not available."
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
pattern: /\bMIN\s*\(/i,
|
|
84
|
-
name: "MIN() function",
|
|
85
|
-
errorMessage: "MIN() aggregation function is not supported. Aggregation functions are not available."
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
pattern: /\bMAX\s*\(/i,
|
|
89
|
-
name: "MAX() function",
|
|
90
|
-
errorMessage: "MAX() aggregation function is not supported. Aggregation functions are not available."
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
pattern: /\bAVG\s*\(/i,
|
|
94
|
-
name: "AVG() function",
|
|
95
|
-
errorMessage: "AVG() aggregation function is not supported. Aggregation functions are not available."
|
|
96
|
-
}
|
|
97
|
-
];
|
|
98
|
-
const FORBIDDEN_MODIFIERS = [
|
|
99
|
-
{
|
|
100
|
-
pattern: /\bSKIP\b/i,
|
|
101
|
-
name: "SKIP clause",
|
|
102
|
-
errorMessage: "SKIP clause is not supported. Pagination is not available."
|
|
103
|
-
}
|
|
104
|
-
];
|
|
105
|
-
const FORBIDDEN_PATTERNS = [
|
|
106
|
-
{
|
|
107
|
-
pattern: /\[.*:\w+\*\d+\.\.\d+.*\]/,
|
|
108
|
-
name: "Path range syntax",
|
|
109
|
-
errorMessage: "Path range syntax is not supported. Patterns like `*1..3`, `*2..`, `*..3` are invalid.",
|
|
110
|
-
alternative: "Use `*` (unlimited, zero or more) for variable-length paths."
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
pattern: /\[.*:\w+\*\d+\.\..*\]/,
|
|
114
|
-
name: "Path range syntax (lower bound)",
|
|
115
|
-
errorMessage: "Path range syntax is not supported. Patterns like `*2..` are invalid.",
|
|
116
|
-
alternative: "Use `*` (unlimited, zero or more) for variable-length paths."
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
pattern: /\[.*:\w+\*\.\.\d+.*\]/,
|
|
120
|
-
name: "Path range syntax (upper bound)",
|
|
121
|
-
errorMessage: "Path range syntax is not supported. Patterns like `*..3` are invalid.",
|
|
122
|
-
alternative: "Use `*` (unlimited, zero or more) for variable-length paths."
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
pattern: /WHERE\s+NOT\s*\(/i,
|
|
126
|
-
name: "WHERE NOT (pattern)",
|
|
127
|
-
errorMessage: "WHERE NOT (pattern) is not supported. Cannot use pattern negation in WHERE clause.",
|
|
128
|
-
alternative: "Use `OPTIONAL MATCH` + `WHERE IS NULL` instead. Example: `OPTIONAL MATCH (m)-[:HAS_PARAMETER]->(:ParameterDeclaration) WHERE ... IS NULL`."
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
pattern: /MATCH\s*\(:\w+[^)]*\)(?:\s*,\s*\(:\w+[^)]*\))*(?:\s*WHERE[^R]*)?/i,
|
|
132
|
-
name: "Anonymous-only queries",
|
|
133
|
-
errorMessage: "Queries with only anonymous nodes (no variable bindings) are not useful.",
|
|
134
|
-
alternative: "Use bound variables in the pattern. Example: `MATCH (a:A)` instead of `MATCH (:A)`."
|
|
135
|
-
}
|
|
136
|
-
];
|
|
137
|
-
const FORBIDDEN_FEATURES = [
|
|
138
|
-
{
|
|
139
|
-
name: "Subqueries",
|
|
140
|
-
description: "Nested queries not supported"
|
|
141
|
-
}
|
|
142
|
-
];
|
|
143
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
144
|
-
0 && (module.exports = {
|
|
145
|
-
FORBIDDEN_AGGREGATIONS,
|
|
146
|
-
FORBIDDEN_FEATURES,
|
|
147
|
-
FORBIDDEN_KEYWORDS,
|
|
148
|
-
FORBIDDEN_MODIFIERS,
|
|
149
|
-
FORBIDDEN_PATTERNS
|
|
150
|
-
});
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
}
|
|
11
|
-
return to;
|
|
12
|
-
};
|
|
13
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var src_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(src_exports);
|
|
17
|
-
__reExport(src_exports, require("./lib/admin-token"), module.exports);
|
|
18
|
-
__reExport(src_exports, require("./lib/config"), module.exports);
|
|
19
|
-
__reExport(src_exports, require("./lib/consts"), module.exports);
|
|
20
|
-
__reExport(src_exports, require("./lib/core"), module.exports);
|
|
21
|
-
__reExport(src_exports, require("./lib/infrastructure/cli"), module.exports);
|
|
22
|
-
__reExport(src_exports, require("./lib/infrastructure/codegular"), module.exports);
|
|
23
|
-
__reExport(src_exports, require("./lib/infrastructure/config"), module.exports);
|
|
24
|
-
__reExport(src_exports, require("./lib/infrastructure/config.reporitory"), module.exports);
|
|
25
|
-
__reExport(src_exports, require("./lib/infrastructure/formatters"), module.exports);
|
|
26
|
-
__reExport(src_exports, require("./lib/infrastructure/http"), module.exports);
|
|
27
|
-
__reExport(src_exports, require("./lib/infrastructure/markdown"), module.exports);
|
|
28
|
-
__reExport(src_exports, require("./lib/infrastructure/transformers"), module.exports);
|
|
29
|
-
__reExport(src_exports, require("./lib/infrastructure/workspace"), module.exports);
|
|
30
|
-
__reExport(src_exports, require("./lib/lowgular.config"), module.exports);
|
|
31
|
-
__reExport(src_exports, require("./lib/token"), module.exports);
|
|
32
|
-
__reExport(src_exports, require("./lib/utils/solution.util"), module.exports);
|
|
33
|
-
__reExport(src_exports, require("./lib/utils/utils"), module.exports);
|
|
34
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
-
0 && (module.exports = {
|
|
36
|
-
...require("./lib/admin-token"),
|
|
37
|
-
...require("./lib/config"),
|
|
38
|
-
...require("./lib/consts"),
|
|
39
|
-
...require("./lib/core"),
|
|
40
|
-
...require("./lib/infrastructure/cli"),
|
|
41
|
-
...require("./lib/infrastructure/codegular"),
|
|
42
|
-
...require("./lib/infrastructure/config"),
|
|
43
|
-
...require("./lib/infrastructure/config.reporitory"),
|
|
44
|
-
...require("./lib/infrastructure/formatters"),
|
|
45
|
-
...require("./lib/infrastructure/http"),
|
|
46
|
-
...require("./lib/infrastructure/markdown"),
|
|
47
|
-
...require("./lib/infrastructure/transformers"),
|
|
48
|
-
...require("./lib/infrastructure/workspace"),
|
|
49
|
-
...require("./lib/lowgular.config"),
|
|
50
|
-
...require("./lib/token"),
|
|
51
|
-
...require("./lib/utils/solution.util"),
|
|
52
|
-
...require("./lib/utils/utils")
|
|
53
|
-
});
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var admin_token_exports = {};
|
|
19
|
-
__export(admin_token_exports, {
|
|
20
|
-
adminTokenGuard: () => adminTokenGuard,
|
|
21
|
-
loginAdmin: () => loginAdmin,
|
|
22
|
-
meAdmin: () => meAdmin,
|
|
23
|
-
readAdminToken: () => readAdminToken,
|
|
24
|
-
refreshAdmin: () => refreshAdmin
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(admin_token_exports);
|
|
27
|
-
var import_prompts = require("@clack/prompts");
|
|
28
|
-
var import_fs = require("fs");
|
|
29
|
-
var import_consts = require("./consts.js");
|
|
30
|
-
var import_http = require("./infrastructure/http.js");
|
|
31
|
-
var import_lowgular_config = require("./lowgular.config.js");
|
|
32
|
-
const adminTokenGuard = () => {
|
|
33
|
-
const token = readAdminToken();
|
|
34
|
-
const refreshToken = readAdminRefreshToken();
|
|
35
|
-
if (!token || !refreshToken) {
|
|
36
|
-
throw new Error(
|
|
37
|
-
"We could not authorize you. Please use lg login or provide --token and --refreshToken parameters"
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
const payload = getAdminDataFromToken();
|
|
41
|
-
if (payload.role !== "admin") {
|
|
42
|
-
throw new Error("You are not authorized to use this command");
|
|
43
|
-
}
|
|
44
|
-
return {
|
|
45
|
-
token,
|
|
46
|
-
refreshToken
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
const loginAdmin = async (credentials) => {
|
|
50
|
-
new import_http.AuthClient().post(`/auth/login`, {
|
|
51
|
-
data: credentials
|
|
52
|
-
}).then(({ data }) => {
|
|
53
|
-
saveAdminToken(data.accessToken);
|
|
54
|
-
saveAdminRefreshToken(data.refreshToken);
|
|
55
|
-
const payload = getAdminDataFromToken();
|
|
56
|
-
import_prompts.log.success(
|
|
57
|
-
`You are logged in as ${payload.email} and your user id is ${payload.user_id || payload.uid}`
|
|
58
|
-
);
|
|
59
|
-
}).catch(() => {
|
|
60
|
-
throw new Error("Invalid credentials");
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
const refreshAdmin = async () => {
|
|
64
|
-
const refreshToken = readAdminRefreshToken();
|
|
65
|
-
return new import_http.AuthClient().post(`/auth/refresh`, {
|
|
66
|
-
data: { refreshToken }
|
|
67
|
-
}).then(({ data }) => {
|
|
68
|
-
saveAdminToken(data.accessToken);
|
|
69
|
-
saveAdminRefreshToken(data.refreshToken);
|
|
70
|
-
}).catch(() => {
|
|
71
|
-
throw new Error("Refresh token expired");
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
const meAdmin = async (di) => {
|
|
75
|
-
const payload = getAdminDataFromToken();
|
|
76
|
-
import_prompts.log.success(
|
|
77
|
-
`You are logged in as ${payload.email} and your user id is ${payload.user_id || payload.uid}`
|
|
78
|
-
);
|
|
79
|
-
};
|
|
80
|
-
const readAdminToken = () => {
|
|
81
|
-
const lowgularDir = (0, import_lowgular_config.createOrGetLowgularDir)();
|
|
82
|
-
if (!(0, import_fs.existsSync)(`${lowgularDir}/${import_consts.LG_ADMIN_TOKEN_FILE}`)) {
|
|
83
|
-
return "";
|
|
84
|
-
}
|
|
85
|
-
return (0, import_fs.readFileSync)(`${lowgularDir}/${import_consts.LG_ADMIN_TOKEN_FILE}`, "utf-8");
|
|
86
|
-
};
|
|
87
|
-
const getAdminDataFromToken = () => {
|
|
88
|
-
const token = readAdminToken();
|
|
89
|
-
const base64Payload = token.split(".")[1];
|
|
90
|
-
const payload = JSON.parse(atob(base64Payload));
|
|
91
|
-
return payload;
|
|
92
|
-
};
|
|
93
|
-
const saveAdminToken = (accessToken) => {
|
|
94
|
-
const lowgularDir = (0, import_lowgular_config.createOrGetLowgularDir)();
|
|
95
|
-
(0, import_fs.writeFileSync)(`${lowgularDir}/${import_consts.LG_ADMIN_TOKEN_FILE}`, accessToken, {
|
|
96
|
-
flag: "w",
|
|
97
|
-
encoding: "utf-8"
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
const saveAdminRefreshToken = (refreshToken) => {
|
|
101
|
-
const lowgularDir = (0, import_lowgular_config.createOrGetLowgularDir)();
|
|
102
|
-
(0, import_fs.writeFileSync)(`${lowgularDir}/${import_consts.LG_ADMIN_REFRESH_TOKEN_FILE}`, refreshToken, {
|
|
103
|
-
flag: "w",
|
|
104
|
-
encoding: "utf-8"
|
|
105
|
-
});
|
|
106
|
-
};
|
|
107
|
-
const readAdminRefreshToken = () => {
|
|
108
|
-
const lowgularDir = (0, import_lowgular_config.createOrGetLowgularDir)();
|
|
109
|
-
if (!(0, import_fs.existsSync)(`${lowgularDir}/${import_consts.LG_ADMIN_REFRESH_TOKEN_FILE}`)) {
|
|
110
|
-
return "";
|
|
111
|
-
}
|
|
112
|
-
return (0, import_fs.readFileSync)(`${lowgularDir}/${import_consts.LG_ADMIN_REFRESH_TOKEN_FILE}`, "utf-8");
|
|
113
|
-
};
|
|
114
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
115
|
-
0 && (module.exports = {
|
|
116
|
-
adminTokenGuard,
|
|
117
|
-
loginAdmin,
|
|
118
|
-
meAdmin,
|
|
119
|
-
readAdminToken,
|
|
120
|
-
refreshAdmin
|
|
121
|
-
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var config_exports = {};
|
|
19
|
-
__export(config_exports, {
|
|
20
|
-
extractParams: () => extractParams
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(config_exports);
|
|
23
|
-
const shortParamsMap = {
|
|
24
|
-
v: "verbose:",
|
|
25
|
-
d: "env:dev",
|
|
26
|
-
p: "pass:",
|
|
27
|
-
f: "fail:"
|
|
28
|
-
};
|
|
29
|
-
const extractParams = (args) => {
|
|
30
|
-
const params = {};
|
|
31
|
-
for (const arg of args) {
|
|
32
|
-
if (arg.startsWith("--")) {
|
|
33
|
-
const split = arg.replace(/^--/, "").split("=");
|
|
34
|
-
params[split[0]] = split[1] || "";
|
|
35
|
-
} else if (arg.startsWith("-")) {
|
|
36
|
-
const param = arg.replace(/^-/, "");
|
|
37
|
-
if (param) {
|
|
38
|
-
const [shortKey, shortVal] = shortParamsMap[param].split(":");
|
|
39
|
-
params[shortKey] = shortVal || "";
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
const env = ["prod", "dev"].includes(params.env) ? params.env : "prod";
|
|
44
|
-
return { ...params, env };
|
|
45
|
-
};
|
|
46
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
-
0 && (module.exports = {
|
|
48
|
-
extractParams
|
|
49
|
-
});
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var consts_exports = {};
|
|
19
|
-
__export(consts_exports, {
|
|
20
|
-
FEATURED_DIR: () => FEATURED_DIR,
|
|
21
|
-
LG_ADMIN_REFRESH_TOKEN_FILE: () => LG_ADMIN_REFRESH_TOKEN_FILE,
|
|
22
|
-
LG_ADMIN_TOKEN_FILE: () => LG_ADMIN_TOKEN_FILE,
|
|
23
|
-
LG_CONFIG_FILE: () => LG_CONFIG_FILE,
|
|
24
|
-
LG_REFRESH_TOKEN_FILE: () => LG_REFRESH_TOKEN_FILE,
|
|
25
|
-
LG_TEMP_DIR: () => LG_TEMP_DIR,
|
|
26
|
-
LG_TOKEN_FILE: () => LG_TOKEN_FILE,
|
|
27
|
-
NODE_MODULES_DIR: () => NODE_MODULES_DIR,
|
|
28
|
-
RECOMMENDED_DIR: () => RECOMMENDED_DIR,
|
|
29
|
-
SOLUTIONS_DIR: () => SOLUTIONS_DIR,
|
|
30
|
-
TEST_SNAPSHOTS_DIR: () => TEST_SNAPSHOTS_DIR
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(consts_exports);
|
|
33
|
-
const LG_CONFIG_FILE = "lg.json";
|
|
34
|
-
const LG_TEMP_DIR = ".lowgular";
|
|
35
|
-
const LG_ADMIN_TOKEN_FILE = "admin-token";
|
|
36
|
-
const LG_ADMIN_REFRESH_TOKEN_FILE = "admin-refresh-token";
|
|
37
|
-
const LG_TOKEN_FILE = `token`;
|
|
38
|
-
const LG_REFRESH_TOKEN_FILE = `refresh-token`;
|
|
39
|
-
const NODE_MODULES_DIR = "node_modules";
|
|
40
|
-
const SOLUTIONS_DIR = "solutions";
|
|
41
|
-
const RECOMMENDED_DIR = "recommended";
|
|
42
|
-
const FEATURED_DIR = "featured";
|
|
43
|
-
const TEST_SNAPSHOTS_DIR = "test-results/snapshots";
|
|
44
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
-
0 && (module.exports = {
|
|
46
|
-
FEATURED_DIR,
|
|
47
|
-
LG_ADMIN_REFRESH_TOKEN_FILE,
|
|
48
|
-
LG_ADMIN_TOKEN_FILE,
|
|
49
|
-
LG_CONFIG_FILE,
|
|
50
|
-
LG_REFRESH_TOKEN_FILE,
|
|
51
|
-
LG_TEMP_DIR,
|
|
52
|
-
LG_TOKEN_FILE,
|
|
53
|
-
NODE_MODULES_DIR,
|
|
54
|
-
RECOMMENDED_DIR,
|
|
55
|
-
SOLUTIONS_DIR,
|
|
56
|
-
TEST_SNAPSHOTS_DIR
|
|
57
|
-
});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var core_exports = {};
|
|
19
|
-
__export(core_exports, {
|
|
20
|
-
createActionWithSpinner: () => createActionWithSpinner,
|
|
21
|
-
setupIoC: () => setupIoC
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(core_exports);
|
|
24
|
-
var import_prompts = require("@clack/prompts");
|
|
25
|
-
var import_http = require("./infrastructure/http");
|
|
26
|
-
const setupIoC = (tokenManager, paramsProvider) => {
|
|
27
|
-
return {
|
|
28
|
-
platformClient: new import_http.PlatformClient(
|
|
29
|
-
tokenManager,
|
|
30
|
-
paramsProvider.getParam("env") ?? "prod"
|
|
31
|
-
),
|
|
32
|
-
authClient: new import_http.AuthClient()
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
function createActionWithSpinner(action, loadingMessage) {
|
|
36
|
-
return (di, ctx) => {
|
|
37
|
-
const s = (0, import_prompts.spinner)();
|
|
38
|
-
s.start(loadingMessage);
|
|
39
|
-
return action(di, ctx).finally(() => s.stop());
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
-
0 && (module.exports = {
|
|
44
|
-
createActionWithSpinner,
|
|
45
|
-
setupIoC
|
|
46
|
-
});
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var cli_exports = {};
|
|
19
|
-
__export(cli_exports, {
|
|
20
|
-
runCommand: () => runCommand
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(cli_exports);
|
|
23
|
-
var import_child_process = require("child_process");
|
|
24
|
-
const runCommand = (command, cwd) => {
|
|
25
|
-
return new Promise((resolve, reject) => {
|
|
26
|
-
const [cmd, ...args] = command.split(" ");
|
|
27
|
-
const child = (0, import_child_process.spawn)(cmd, args, {
|
|
28
|
-
cwd,
|
|
29
|
-
stdio: "inherit",
|
|
30
|
-
shell: true
|
|
31
|
-
});
|
|
32
|
-
child.on("close", (code) => {
|
|
33
|
-
if (code === 0) {
|
|
34
|
-
resolve();
|
|
35
|
-
} else {
|
|
36
|
-
reject(new Error(`Command failed with exit code ${code}`));
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
child.on("error", (error) => {
|
|
40
|
-
reject(error);
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
-
0 && (module.exports = {
|
|
46
|
-
runCommand
|
|
47
|
-
});
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var config_exports = {};
|
|
19
|
-
__export(config_exports, {
|
|
20
|
-
config: () => config
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(config_exports);
|
|
23
|
-
class ConfigService {
|
|
24
|
-
constructor() {
|
|
25
|
-
this._params = {};
|
|
26
|
-
}
|
|
27
|
-
static getInstance() {
|
|
28
|
-
if (!ConfigService.instance) {
|
|
29
|
-
ConfigService.instance = new ConfigService();
|
|
30
|
-
}
|
|
31
|
-
return ConfigService.instance;
|
|
32
|
-
}
|
|
33
|
-
setParams(params) {
|
|
34
|
-
this._params = params;
|
|
35
|
-
}
|
|
36
|
-
getParam(key) {
|
|
37
|
-
return this._params[key];
|
|
38
|
-
}
|
|
39
|
-
hasParam(key) {
|
|
40
|
-
return this._params[key] !== void 0;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
const config = ConfigService.getInstance();
|
|
44
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
-
0 && (module.exports = {
|
|
46
|
-
config
|
|
47
|
-
});
|