@devilsdev/rag-pipeline-utils 2.3.1 ā 2.4.0
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 +293 -369
- package/contracts/loader-contract.json +11 -6
- package/contracts/reranker-contract.json +18 -26
- package/dist/index.cjs +21190 -47
- package/dist/index.d.ts +298 -68
- package/dist/index.mjs +9 -76
- package/package.json +20 -8
- package/src/agentic/agentic-pipeline.js +235 -0
- package/src/agentic/iterative-retriever.js +213 -0
- package/src/agentic/query-planner.js +208 -0
- package/src/agentic/self-critique.js +102 -0
- package/src/ai/adaptive-retrieval.js +0 -3
- package/src/ai/federated-learning.js +0 -3
- package/src/ai/federation.js +1 -6
- package/src/ai/index.js +9 -20
- package/src/ai/model-training.js +0 -3
- package/src/ai/multimodal-processing.js +0 -3
- package/src/ai/multimodal.js +1 -6
- package/src/ai/orchestrator.js +1 -6
- package/src/ai/retrieval-engine.js +1 -6
- package/src/chunking/chunking-engine.js +142 -0
- package/src/chunking/strategies/fixed-size.js +54 -0
- package/src/chunking/strategies/recursive.js +127 -0
- package/src/chunking/strategies/semantic.js +128 -0
- package/src/chunking/strategies/sentence.js +32 -0
- package/src/chunking/strategies/structure-aware.js +138 -0
- package/src/citation/citation-tracker.js +161 -0
- package/src/citation/hallucination-detector.js +74 -0
- package/src/citation/source-mapper.js +95 -0
- package/src/cli/commands/ai-ml/adaptive-commands.js +178 -0
- package/src/cli/commands/ai-ml/federated-commands.js +207 -0
- package/src/cli/commands/ai-ml/index.js +17 -0
- package/src/cli/commands/ai-ml/multimodal-commands.js +187 -0
- package/src/cli/commands/ai-ml/shared.js +51 -0
- package/src/cli/commands/ai-ml/training-commands.js +228 -0
- package/src/cli/commands/ai-ml.js +176 -757
- package/src/cli/commands/plugin-hub/certification-commands.js +221 -0
- package/src/cli/commands/plugin-hub/event-handlers.js +64 -0
- package/src/cli/commands/plugin-hub/hub-commands.js +290 -0
- package/src/cli/commands/plugin-hub/review-commands.js +78 -0
- package/src/cli/commands/plugin-hub.js +106 -782
- package/src/cli/diagnostics/config-checker.js +81 -0
- package/src/cli/diagnostics/dependency-checker.js +69 -0
- package/src/cli/diagnostics/environment-checker.js +45 -0
- package/src/cli/diagnostics/performance-checker.js +51 -0
- package/src/cli/diagnostics/plugin-checker.js +106 -0
- package/src/cli/diagnostics/security-checker.js +61 -0
- package/src/cli/doctor-command.js +70 -369
- package/src/cli/enhanced-cli-commands.js +162 -706
- package/src/cli/handlers/config-handler.js +126 -0
- package/src/cli/handlers/diagnostics-handler.js +113 -0
- package/src/cli/handlers/ingest-handler.js +42 -0
- package/src/cli/handlers/init-handler.js +51 -0
- package/src/cli/handlers/query-handler.js +45 -0
- package/src/cli/handlers/run-handler.js +181 -0
- package/src/cli/interactive-wizard.js +99 -723
- package/src/cli/shared/cli-utils.js +89 -0
- package/src/cli/wizard/configuration.js +148 -0
- package/src/cli/wizard/observability.js +79 -0
- package/src/cli/wizard/performance.js +76 -0
- package/src/cli/wizard/plugin-selection.js +297 -0
- package/src/cli/wizard/preview-save.js +172 -0
- package/src/cli/wizard/project-setup.js +66 -0
- package/src/config/memory-optimization.js +3 -3
- package/src/connectors/anthropic-connector.js +179 -0
- package/src/connectors/base-connector.js +94 -0
- package/src/connectors/cohere-connector.js +143 -0
- package/src/connectors/local-embedder.js +171 -0
- package/src/connectors/memory-retriever.js +150 -0
- package/src/connectors/ollama-connector.js +205 -0
- package/src/connectors/openai-connector.js +173 -0
- package/src/core/create-pipeline.js +21 -1
- package/src/core/observability/tracing.js +2 -1
- package/src/core/pipeline-factory.js +0 -1
- package/src/core/plugin-registry.js +14 -14
- package/src/cost/cost-calculator.js +146 -0
- package/src/cost/cost-tracker.js +260 -0
- package/src/cost/token-budget.js +245 -0
- package/src/dag/core/execution-scheduler.js +2 -1
- package/src/dag/core/topology-validation.js +0 -3
- package/src/dag/dag-engine.js +3 -5
- package/src/dag/dag-node.js +0 -1
- package/src/dag/enhanced-dag-engine.js +171 -99
- package/src/dashboard/dashboard-generator.js +642 -0
- package/src/dashboard/metrics-aggregator.js +409 -0
- package/src/debug/execution-tracer.js +210 -0
- package/src/debug/trace-inspector.js +281 -0
- package/src/dev/dev-server.js +5 -5
- package/src/dev/hot-reload.js +3 -2
- package/src/dx/integration-templates.js +0 -3
- package/src/ecosystem/plugin-analytics-dashboard.js +2 -2
- package/src/ecosystem/plugin-hub.js +2 -2
- package/src/enterprise/audit-logging.js +2 -2
- package/src/enterprise/sso-integration.js +52 -32
- package/src/evaluate/context-metrics.js +127 -0
- package/src/evaluate/evaluator.js +4 -2
- package/src/evaluate/faithfulness.js +117 -0
- package/src/evaluate/groundedness.js +60 -0
- package/src/evaluate/pipeline-evaluator.js +156 -0
- package/src/evaluate/relevance.js +129 -0
- package/src/evaluate/scoring.js +27 -0
- package/src/graph/entity-extractor.js +183 -0
- package/src/graph/graph-index.js +113 -0
- package/src/graph/graph-retriever.js +244 -0
- package/src/graph/knowledge-graph.js +256 -0
- package/src/guardrails/guardrails-pipeline.js +136 -0
- package/src/guardrails/post-generation-guard.js +170 -0
- package/src/guardrails/pre-retrieval-guard.js +161 -0
- package/src/guardrails/retrieval-guard.js +126 -0
- package/src/index.js +255 -9
- package/src/loader/html-loader.js +4 -15
- package/src/loader/markdown-loader.js +4 -15
- package/src/mcp/mcp-server.js +199 -0
- package/src/mcp/mcp-tool-builder.js +121 -0
- package/src/observability/audit-logger.js +0 -2
- package/src/observability/event-logger.js +2 -1
- package/src/observability/security-monitor.js +0 -2
- package/src/observability/telemetry.js +0 -2
- package/src/reranker/cascade-reranker.js +79 -0
- package/src/reranker/embedding-reranker.js +124 -0
- package/src/reranker/llm-reranker.js +6 -3
- package/src/reranker/scoring-reranker.js +123 -0
- package/src/retrieval/bm25-search.js +157 -0
- package/src/retrieval/hybrid-retriever.js +111 -0
- package/src/retrieval/rank-fusion.js +62 -0
- package/src/security/jwt-config.js +4 -3
- package/src/security/jwt-validator.js +2 -1
- package/src/security/plugin-sandbox.js +0 -3
- package/src/security/plugin-signature-verifier.js +4 -6
- package/src/security/validator.js +0 -2
- package/src/streaming/embedding-stream.js +197 -0
- package/src/streaming/sse-adapter.js +168 -0
- package/src/streaming/stream-router.js +210 -0
- package/src/streaming/streaming-embedder.js +231 -0
- package/src/streaming/websocket-adapter.js +171 -0
- package/src/templates/scaffold.js +147 -0
- package/src/templates/template-registry.js +272 -0
- package/src/utils/contract-validator.js +2 -1
- package/src/utils/input-sanitizer.js +80 -99
- package/src/utils/performance-monitor.js +0 -3
- package/src/utils/plugin-scaffolder.js +9 -16
- package/src/utils/rate-limiter.js +0 -1
- package/src/utils/retry-policy.js +0 -3
- package/src/utils/safe-expression-evaluator.js +0 -3
- package/src/utils/secure-logger-config.js +2 -4
- package/src/utils/secure-logging.js +0 -3
- package/src/utils/structured-logger.js +0 -3
- package/src/ai/index-fixed.js +0 -509
- package/src/ai/module-template.js +0 -37
- package/src/ci/workflow-analyzer.js +0 -71
- package/src/cli/plugin-marketplace-commands.js +0 -869
- package/src/dev/README.md +0 -126
- package/src/dev/examples/hot-reload-usage.js +0 -355
- package/src/mocks/openai-embedder.js +0 -119
- package/src/mocks/openai-llm.js +0 -77
- package/src/mocks/pdf-loader.js +0 -21
- package/src/mocks/pinecone-retriever.js +0 -106
- package/src/scripts/script-utilities.js +0 -36
- package/src/utils/ci/diagnostic-reporter.js +0 -57
- package/src/utils/examples/error-formatter-usage.js +0 -351
|
@@ -1,875 +1,199 @@
|
|
|
1
1
|
/**
|
|
2
|
-
const path = require('path');
|
|
3
2
|
* Plugin Hub CLI Commands
|
|
4
3
|
* Command-line interface for community plugin hub operations
|
|
5
4
|
*/
|
|
6
5
|
|
|
7
|
-
const { Command } = require(
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
const Table = require('cli-table3');
|
|
16
|
-
// eslint-disable-line global-require
|
|
17
|
-
const { PluginHub } = require('../../ecosystem/plugin-hub');
|
|
18
|
-
// eslint-disable-line global-require
|
|
19
|
-
const { PluginCertification } = require('../../ecosystem/plugin-certification');
|
|
20
|
-
// eslint-disable-line global-require
|
|
6
|
+
const { Command } = require("commander");
|
|
7
|
+
const { PluginHub } = require("../../ecosystem/plugin-hub");
|
|
8
|
+
const { PluginCertification } = require("../../ecosystem/plugin-certification");
|
|
9
|
+
|
|
10
|
+
const hubCommands = require("./plugin-hub/hub-commands");
|
|
11
|
+
const certificationCommands = require("./plugin-hub/certification-commands");
|
|
12
|
+
const reviewCommands = require("./plugin-hub/review-commands");
|
|
13
|
+
const { setupEventListeners } = require("./plugin-hub/event-handlers");
|
|
21
14
|
|
|
22
15
|
class PluginHubCLI {
|
|
23
16
|
constructor() {
|
|
24
17
|
this.hub = new PluginHub();
|
|
25
18
|
this.certification = new PluginCertification();
|
|
26
|
-
this.
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
setupEventListeners() {
|
|
30
|
-
// Hub events
|
|
31
|
-
this.hub.on('install_start', (data) => {
|
|
32
|
-
console.log(
|
|
33
|
-
chalk.blue(
|
|
34
|
-
`š Starting installation of ${data.pluginId}@${data.version}`,
|
|
35
|
-
),
|
|
36
|
-
); // eslint-disable-line no-console
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
this.hub.on('install_progress', (data) => {
|
|
40
|
-
const stages = {
|
|
41
|
-
security_scan: 'š Running security scan...',
|
|
42
|
-
downloading: 'ā¬ļø Downloading plugin...',
|
|
43
|
-
verifying: 'ā
Verifying integrity...',
|
|
44
|
-
sandbox_install: 'šļø Installing in sandbox...',
|
|
45
|
-
installing: 'š¦ Installing to system...',
|
|
46
|
-
};
|
|
47
|
-
console.log(
|
|
48
|
-
chalk.yellow(stages[data.stage] || `Processing ${data.stage}...`),
|
|
49
|
-
); // eslint-disable-line no-console
|
|
50
|
-
}); // eslint-disable-line no-console
|
|
51
|
-
|
|
52
|
-
this.hub.on('install_complete', (data) => {
|
|
53
|
-
console.log(
|
|
54
|
-
chalk.green(
|
|
55
|
-
`ā
Successfully installed ${data.pluginId}@${data.version}`,
|
|
56
|
-
),
|
|
57
|
-
); // eslint-disable-line no-console
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
// eslint-disable-line no-console
|
|
61
|
-
this.hub.on('install_error', (data) => {
|
|
62
|
-
console.error(chalk.red(`ā Installation failed: ${data.error.message}`)); // eslint-disable-line no-console
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
// Certification events
|
|
66
|
-
// eslint-disable-line no-console
|
|
67
|
-
this.certification.on('certification_start', (data) => {
|
|
68
|
-
console.log(
|
|
69
|
-
chalk.blue(
|
|
70
|
-
`š Starting ${data.level} certification for ${data.pluginId}`,
|
|
71
|
-
),
|
|
72
|
-
); // eslint-disable-line no-console
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
this.certification.on('certification_progress', (data) => {
|
|
76
|
-
const stages = {
|
|
77
|
-
// eslint-disable-line no-console
|
|
78
|
-
automated_checks: 'š¤ Running automated checks...',
|
|
79
|
-
manual_review: 'š„ Submitting for manual review...',
|
|
80
|
-
security_audit: 'š Performing security audit...',
|
|
81
|
-
};
|
|
82
|
-
console.log(
|
|
83
|
-
chalk.yellow(stages[data.stage] || `Processing ${data.stage}...`),
|
|
84
|
-
); // eslint-disable-line no-console
|
|
85
|
-
});
|
|
19
|
+
setupEventListeners(this.hub, this.certification);
|
|
86
20
|
}
|
|
87
21
|
|
|
88
22
|
createCommands() {
|
|
89
|
-
const program = new Command(
|
|
90
|
-
program.description(
|
|
23
|
+
const program = new Command("hub");
|
|
24
|
+
program.description("Community plugin hub operations");
|
|
91
25
|
|
|
92
26
|
// Search command
|
|
93
27
|
program
|
|
94
|
-
.command(
|
|
95
|
-
.description(
|
|
96
|
-
.option(
|
|
97
|
-
.option(
|
|
98
|
-
.option(
|
|
99
|
-
.option(
|
|
100
|
-
.option(
|
|
101
|
-
.option(
|
|
28
|
+
.command("search <query>")
|
|
29
|
+
.description("Search plugins in the community hub")
|
|
30
|
+
.option("-c, --category <category>", "Filter by category")
|
|
31
|
+
.option("-t, --tags <tags>", "Filter by tags (comma-separated)")
|
|
32
|
+
.option("-a, --author <author>", "Filter by author")
|
|
33
|
+
.option("-r, --min-rating <rating>", "Minimum rating (1-5)", parseFloat)
|
|
34
|
+
.option("--verified", "Show only verified plugins")
|
|
35
|
+
.option("-l, --limit <limit>", "Number of results", parseInt, 20)
|
|
102
36
|
.option(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
37
|
+
"--sort <sort>",
|
|
38
|
+
"Sort by: relevance, downloads, rating, updated",
|
|
39
|
+
"relevance",
|
|
106
40
|
)
|
|
107
41
|
.action(async (query, _options) => {
|
|
108
|
-
await
|
|
42
|
+
await hubCommands.searchPlugins(this.hub, query, _options);
|
|
109
43
|
});
|
|
110
44
|
|
|
111
45
|
// Install command
|
|
112
46
|
program
|
|
113
|
-
.command(
|
|
114
|
-
.description(
|
|
115
|
-
.option(
|
|
116
|
-
.option(
|
|
117
|
-
.option(
|
|
47
|
+
.command("install <plugin>")
|
|
48
|
+
.description("Install a plugin from the hub")
|
|
49
|
+
.option("-v, --version <version>", "Plugin version", "latest")
|
|
50
|
+
.option("--no-security-scan", "Skip security scan")
|
|
51
|
+
.option("--require-certified", "Only install certified plugins")
|
|
118
52
|
.option(
|
|
119
|
-
|
|
120
|
-
|
|
53
|
+
"--sandbox-timeout <timeout>",
|
|
54
|
+
"Sandbox timeout in ms",
|
|
121
55
|
parseInt,
|
|
122
56
|
30000,
|
|
123
57
|
)
|
|
124
58
|
.action(async (plugin, _options) => {
|
|
125
|
-
await
|
|
59
|
+
await hubCommands.installPlugin(this.hub, plugin, _options);
|
|
126
60
|
});
|
|
127
61
|
|
|
128
62
|
// Info command
|
|
129
63
|
program
|
|
130
|
-
.command(
|
|
131
|
-
.description(
|
|
64
|
+
.command("info <plugin>")
|
|
65
|
+
.description("Get detailed information about a plugin")
|
|
132
66
|
.action(async (plugin) => {
|
|
133
|
-
await
|
|
67
|
+
await hubCommands.getPluginInfo(this.hub, plugin);
|
|
134
68
|
});
|
|
135
69
|
|
|
136
70
|
// List installed command
|
|
137
71
|
program
|
|
138
|
-
.command(
|
|
139
|
-
.alias(
|
|
140
|
-
.description(
|
|
141
|
-
.option(
|
|
72
|
+
.command("list")
|
|
73
|
+
.alias("ls")
|
|
74
|
+
.description("List installed plugins")
|
|
75
|
+
.option("--format <format>", "Output format: table, json", "table")
|
|
142
76
|
.action(async (_options) => {
|
|
143
|
-
await
|
|
77
|
+
await hubCommands.listInstalledPlugins(this.hub, _options);
|
|
144
78
|
});
|
|
145
79
|
|
|
146
80
|
// Publish command
|
|
147
81
|
program
|
|
148
|
-
.command(
|
|
149
|
-
.description(
|
|
150
|
-
.option(
|
|
151
|
-
.option(
|
|
82
|
+
.command("publish [path]")
|
|
83
|
+
.description("Publish a plugin to the hub")
|
|
84
|
+
.option("--dry-run", "Validate without publishing")
|
|
85
|
+
.option("--tag <tag>", "Release tag")
|
|
152
86
|
.action(async (pluginPath, _options) => {
|
|
153
|
-
await
|
|
87
|
+
await hubCommands.publishPlugin(
|
|
88
|
+
this.hub,
|
|
89
|
+
pluginPath || process.cwd(),
|
|
90
|
+
_options,
|
|
91
|
+
);
|
|
154
92
|
});
|
|
155
93
|
|
|
156
94
|
// Rate command
|
|
157
95
|
program
|
|
158
|
-
.command(
|
|
159
|
-
.description(
|
|
160
|
-
.option(
|
|
96
|
+
.command("rate <plugin> <rating>")
|
|
97
|
+
.description("Rate a plugin (1-5 stars)")
|
|
98
|
+
.option("-r, --review <review>", "Written review")
|
|
161
99
|
.action(async (plugin, rating, _options) => {
|
|
162
|
-
await
|
|
100
|
+
await reviewCommands.ratePlugin(
|
|
101
|
+
this.hub,
|
|
102
|
+
plugin,
|
|
103
|
+
parseInt(rating),
|
|
104
|
+
_options,
|
|
105
|
+
);
|
|
163
106
|
});
|
|
164
107
|
|
|
165
108
|
// Reviews command
|
|
166
109
|
program
|
|
167
|
-
.command(
|
|
168
|
-
.description(
|
|
169
|
-
.option(
|
|
170
|
-
.option(
|
|
110
|
+
.command("reviews <plugin>")
|
|
111
|
+
.description("View plugin reviews")
|
|
112
|
+
.option("-l, --limit <limit>", "Number of reviews", parseInt, 10)
|
|
113
|
+
.option("--sort <sort>", "Sort by: helpful, recent, rating", "helpful")
|
|
171
114
|
.action(async (plugin, _options) => {
|
|
172
|
-
await
|
|
115
|
+
await reviewCommands.getPluginReviews(this.hub, plugin, _options);
|
|
173
116
|
});
|
|
174
117
|
|
|
175
118
|
// Trending command
|
|
176
119
|
program
|
|
177
|
-
.command(
|
|
178
|
-
.description(
|
|
179
|
-
.option(
|
|
180
|
-
.option(
|
|
181
|
-
.option(
|
|
120
|
+
.command("trending")
|
|
121
|
+
.description("Show trending plugins")
|
|
122
|
+
.option("-p, --period <period>", "Time period: day, week, month", "week")
|
|
123
|
+
.option("-c, --category <category>", "Filter by category")
|
|
124
|
+
.option("-l, --limit <limit>", "Number of results", parseInt, 20)
|
|
182
125
|
.action(async (_options) => {
|
|
183
|
-
await
|
|
126
|
+
await hubCommands.getTrendingPlugins(this.hub, _options);
|
|
184
127
|
});
|
|
185
128
|
|
|
186
129
|
// Certification commands
|
|
187
130
|
const certifyCmd = program
|
|
188
|
-
.command(
|
|
189
|
-
.description(
|
|
131
|
+
.command("certify")
|
|
132
|
+
.description("Plugin certification operations");
|
|
190
133
|
|
|
191
134
|
certifyCmd
|
|
192
|
-
.command(
|
|
193
|
-
.description(
|
|
135
|
+
.command("submit <plugin>")
|
|
136
|
+
.description("Submit plugin for certification")
|
|
194
137
|
.option(
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
138
|
+
"-l, --level <level>",
|
|
139
|
+
"Certification level: BASIC, VERIFIED, ENTERPRISE",
|
|
140
|
+
"BASIC",
|
|
198
141
|
)
|
|
199
142
|
.action(async (plugin, _options) => {
|
|
200
|
-
await
|
|
143
|
+
await certificationCommands.submitForCertification(
|
|
144
|
+
this.certification,
|
|
145
|
+
plugin,
|
|
146
|
+
_options,
|
|
147
|
+
);
|
|
201
148
|
});
|
|
202
149
|
|
|
203
150
|
certifyCmd
|
|
204
|
-
.command(
|
|
205
|
-
.description(
|
|
151
|
+
.command("verify <plugin> <certificationId>")
|
|
152
|
+
.description("Verify plugin certification")
|
|
206
153
|
.action(async (plugin, certificationId) => {
|
|
207
|
-
await
|
|
154
|
+
await certificationCommands.verifyCertification(
|
|
155
|
+
this.certification,
|
|
156
|
+
plugin,
|
|
157
|
+
certificationId,
|
|
158
|
+
);
|
|
208
159
|
});
|
|
209
160
|
|
|
210
161
|
certifyCmd
|
|
211
|
-
.command(
|
|
212
|
-
.description(
|
|
162
|
+
.command("requirements [level]")
|
|
163
|
+
.description("Show certification requirements")
|
|
213
164
|
.action(async (level) => {
|
|
214
|
-
await
|
|
165
|
+
await certificationCommands.showCertificationRequirements(
|
|
166
|
+
this.certification,
|
|
167
|
+
level,
|
|
168
|
+
);
|
|
215
169
|
});
|
|
216
170
|
|
|
217
171
|
// Publisher commands
|
|
218
172
|
const publisherCmd = program
|
|
219
|
-
.command(
|
|
220
|
-
.description(
|
|
173
|
+
.command("publisher")
|
|
174
|
+
.description("Publisher verification operations");
|
|
221
175
|
|
|
222
176
|
publisherCmd
|
|
223
|
-
.command(
|
|
224
|
-
.description(
|
|
177
|
+
.command("status [publisherId]")
|
|
178
|
+
.description("Check publisher verification status")
|
|
225
179
|
.action(async (publisherId) => {
|
|
226
|
-
await
|
|
180
|
+
await certificationCommands.getPublisherStatus(
|
|
181
|
+
this.certification,
|
|
182
|
+
publisherId,
|
|
183
|
+
);
|
|
227
184
|
});
|
|
228
185
|
|
|
229
186
|
publisherCmd
|
|
230
|
-
.command(
|
|
231
|
-
.description(
|
|
187
|
+
.command("apply")
|
|
188
|
+
.description("Apply for publisher verification")
|
|
232
189
|
.action(async () => {
|
|
233
|
-
await
|
|
190
|
+
await certificationCommands.applyForPublisherVerification(
|
|
191
|
+
this.certification,
|
|
192
|
+
);
|
|
234
193
|
});
|
|
235
194
|
|
|
236
195
|
return program;
|
|
237
196
|
}
|
|
238
|
-
|
|
239
|
-
async searchPlugins(query, _options) {
|
|
240
|
-
const spinner = ora('Searching plugins...').start();
|
|
241
|
-
|
|
242
|
-
try {
|
|
243
|
-
const searchOptions = {
|
|
244
|
-
category: _options.category,
|
|
245
|
-
tags: _options.tags ? _options.tags.split(',') : undefined,
|
|
246
|
-
author: _options.author,
|
|
247
|
-
minRating: _options.minRating,
|
|
248
|
-
verified: _options.verified,
|
|
249
|
-
limit: _options.limit,
|
|
250
|
-
sortBy: _options.sort,
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
const results = await this.hub.searchPlugins(query, searchOptions);
|
|
254
|
-
spinner.stop();
|
|
255
|
-
|
|
256
|
-
if (results.results.length === 0) {
|
|
257
|
-
console.log(chalk.yellow('No plugins found matching your criteria.')); // eslint-disable-line no-console
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
console.log(chalk.green(`Found ${results.total} plugins:\n`)); // eslint-disable-line no-console
|
|
262
|
-
|
|
263
|
-
const table = new Table({
|
|
264
|
-
// eslint-disable-line no-console
|
|
265
|
-
head: [
|
|
266
|
-
'Name',
|
|
267
|
-
'Version',
|
|
268
|
-
'Author',
|
|
269
|
-
'Rating',
|
|
270
|
-
'Downloads',
|
|
271
|
-
'Description',
|
|
272
|
-
],
|
|
273
|
-
colWidths: [20, 10, 15, 8, 10, 40],
|
|
274
|
-
});
|
|
275
|
-
|
|
276
|
-
for (const plugin of results.results) {
|
|
277
|
-
// eslint-disable-line no-console
|
|
278
|
-
const rating =
|
|
279
|
-
'ā
'.repeat(Math.floor(plugin.rating)) +
|
|
280
|
-
'ā'.repeat(5 - Math.floor(plugin.rating));
|
|
281
|
-
const certified = plugin.certified ? chalk.green('ā') : '';
|
|
282
|
-
|
|
283
|
-
table.push([
|
|
284
|
-
`${plugin.name} ${certified}`,
|
|
285
|
-
plugin.version,
|
|
286
|
-
plugin.author,
|
|
287
|
-
`${rating} (${plugin.reviewCount})`,
|
|
288
|
-
plugin.downloadCount.toLocaleString(),
|
|
289
|
-
plugin.description.substring(0, 35) +
|
|
290
|
-
(plugin.description.length > 35 ? '...' : ''),
|
|
291
|
-
]);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
console.log(table.toString()); // eslint-disable-line no-console
|
|
295
|
-
|
|
296
|
-
if (results.hasMore) {
|
|
297
|
-
console.log(
|
|
298
|
-
chalk.blue(
|
|
299
|
-
`\nShowing ${results.results.length} of ${results.total} results. Use --limit to see more.`,
|
|
300
|
-
),
|
|
301
|
-
); // eslint-disable-line no-console
|
|
302
|
-
}
|
|
303
|
-
} catch (error) {
|
|
304
|
-
spinner.stop();
|
|
305
|
-
console.error(chalk.red(`Search failed: ${error.message}`)); // eslint-disable-line no-console
|
|
306
|
-
process.exit(1);
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
// eslint-disable-line no-console
|
|
311
|
-
async installPlugin(plugin, _options) {
|
|
312
|
-
try {
|
|
313
|
-
const installOptions = {
|
|
314
|
-
securityScan: _options.securityScan,
|
|
315
|
-
requireCertified: _options.requireCertified,
|
|
316
|
-
sandboxTimeout: _options.sandboxTimeout, // eslint-disable-line no-console
|
|
317
|
-
};
|
|
318
|
-
|
|
319
|
-
const result = await this.hub.installPlugin(
|
|
320
|
-
plugin,
|
|
321
|
-
_options.version,
|
|
322
|
-
installOptions,
|
|
323
|
-
);
|
|
324
|
-
|
|
325
|
-
console.log(chalk.green('\nā
Installation completed successfully!')); // eslint-disable-line no-console
|
|
326
|
-
console.log(chalk.blue(`Plugin: ${result.pluginInfo.name}`)); // eslint-disable-line no-console
|
|
327
|
-
console.log(chalk.blue(`Version: ${result.version}`)); // eslint-disable-line no-console
|
|
328
|
-
console.log(chalk.blue(`Install Path: ${result.installPath}`)); // eslint-disable-line no-console
|
|
329
|
-
|
|
330
|
-
if (result.pluginInfo.certified) {
|
|
331
|
-
console.log(chalk.green('š This plugin is certified!')); // eslint-disable-line no-console
|
|
332
|
-
}
|
|
333
|
-
} catch (error) {
|
|
334
|
-
console.error(chalk.red(`Installation failed: ${error.message}`)); // eslint-disable-line no-console
|
|
335
|
-
process.exit(1); // eslint-disable-line no-console
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
// eslint-disable-line no-console
|
|
339
|
-
|
|
340
|
-
async getPluginInfo(plugin) {
|
|
341
|
-
// eslint-disable-line no-console
|
|
342
|
-
const spinner = ora('Fetching plugin information...').start();
|
|
343
|
-
|
|
344
|
-
// eslint-disable-line no-console
|
|
345
|
-
try {
|
|
346
|
-
const info = await this.hub.getPluginInfo(plugin);
|
|
347
|
-
spinner.stop();
|
|
348
|
-
|
|
349
|
-
// eslint-disable-line no-console
|
|
350
|
-
console.log(chalk.blue.bold(`\n${info.name} v${info.version}\n`)); // eslint-disable-line no-console
|
|
351
|
-
console.log(chalk.gray(info.description)); // eslint-disable-line no-console
|
|
352
|
-
console.log(); // eslint-disable-line no-console
|
|
353
|
-
|
|
354
|
-
const details = new Table({
|
|
355
|
-
// eslint-disable-line no-console
|
|
356
|
-
chars: {
|
|
357
|
-
top: '',
|
|
358
|
-
'top-mid': '',
|
|
359
|
-
'top-left': '',
|
|
360
|
-
'top-right': '',
|
|
361
|
-
bottom: '',
|
|
362
|
-
'bottom-mid': '',
|
|
363
|
-
'bottom-left': '',
|
|
364
|
-
'bottom-right': '',
|
|
365
|
-
left: '',
|
|
366
|
-
'left-mid': '',
|
|
367
|
-
mid: '',
|
|
368
|
-
'mid-mid': '',
|
|
369
|
-
right: '',
|
|
370
|
-
'right-mid': '',
|
|
371
|
-
middle: ' ',
|
|
372
|
-
},
|
|
373
|
-
style: { 'padding-left': 0, 'padding-right': 0 },
|
|
374
|
-
});
|
|
375
|
-
|
|
376
|
-
const rating =
|
|
377
|
-
'ā
'.repeat(Math.floor(info.rating)) +
|
|
378
|
-
'ā'.repeat(5 - Math.floor(info.rating));
|
|
379
|
-
|
|
380
|
-
details.push(
|
|
381
|
-
['Author:', info.author],
|
|
382
|
-
['Category:', info.category],
|
|
383
|
-
['Rating:', `${rating} (${info.reviewCount} reviews)`],
|
|
384
|
-
// eslint-disable-line no-console
|
|
385
|
-
['Downloads:', info.downloadCount.toLocaleString()],
|
|
386
|
-
['License:', info.license],
|
|
387
|
-
// eslint-disable-line no-console
|
|
388
|
-
['Last Updated:', new Date(info.lastUpdated).toLocaleDateString()],
|
|
389
|
-
[
|
|
390
|
-
'Certified:',
|
|
391
|
-
info.certified ? chalk.green('Yes ā') : chalk.gray('No'),
|
|
392
|
-
],
|
|
393
|
-
// eslint-disable-line no-console
|
|
394
|
-
[
|
|
395
|
-
'Verified Publisher:',
|
|
396
|
-
info.verifiedPublisher ? chalk.green('Yes ā') : chalk.gray('No'),
|
|
397
|
-
],
|
|
398
|
-
);
|
|
399
|
-
|
|
400
|
-
console.log(details.toString()); // eslint-disable-line no-console
|
|
401
|
-
|
|
402
|
-
if (info.tags && info.tags.length > 0) {
|
|
403
|
-
console.log(
|
|
404
|
-
chalk.blue('\nTags:'),
|
|
405
|
-
info.tags.map((tag) => chalk.cyan(`#${tag}`)).join(' '),
|
|
406
|
-
); // eslint-disable-line no-console
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
if (info.homepage) {
|
|
410
|
-
console.log(chalk.blue('\nHomepage:'), chalk.underline(info.homepage)); // eslint-disable-line no-console
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
if (info.repository) {
|
|
414
|
-
console.log(
|
|
415
|
-
chalk.blue('Repository:'),
|
|
416
|
-
chalk.underline(info.repository),
|
|
417
|
-
); // eslint-disable-line no-console
|
|
418
|
-
}
|
|
419
|
-
} catch (error) {
|
|
420
|
-
spinner.stop();
|
|
421
|
-
console.error(chalk.red(`Failed to get plugin info: ${error.message}`)); // eslint-disable-line no-console
|
|
422
|
-
process.exit(1);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
// eslint-disable-line no-console
|
|
427
|
-
async listInstalledPlugins(_options) {
|
|
428
|
-
const spinner = ora('Loading installed plugins...').start();
|
|
429
|
-
|
|
430
|
-
try {
|
|
431
|
-
// eslint-disable-line no-console
|
|
432
|
-
const installed = await this.hub.getInstalledPlugins();
|
|
433
|
-
spinner.stop();
|
|
434
|
-
|
|
435
|
-
if (installed.length === 0) {
|
|
436
|
-
console.log(chalk.yellow('No plugins installed.')); // eslint-disable-line no-console
|
|
437
|
-
return;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
if (_options.format === 'json') {
|
|
441
|
-
console.log(JSON.stringify(installed, null, 2)); // eslint-disable-line no-console
|
|
442
|
-
return;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
console.log(chalk.green(`${installed.length} plugins installed:\n`)); // eslint-disable-line no-console
|
|
446
|
-
|
|
447
|
-
const table = new Table({
|
|
448
|
-
// eslint-disable-line no-console
|
|
449
|
-
head: ['Name', 'Version', 'Type', 'Last Used', 'Status'],
|
|
450
|
-
colWidths: [25, 12, 15, 15, 10],
|
|
451
|
-
});
|
|
452
|
-
|
|
453
|
-
for (const plugin of installed) {
|
|
454
|
-
const lastUsed = plugin.lastUsed
|
|
455
|
-
? new Date(plugin.lastUsed).toLocaleDateString()
|
|
456
|
-
: chalk.gray('Never');
|
|
457
|
-
|
|
458
|
-
const status = plugin.certified
|
|
459
|
-
? chalk.green('Certified')
|
|
460
|
-
: chalk.gray('Standard');
|
|
461
|
-
|
|
462
|
-
table.push([
|
|
463
|
-
// eslint-disable-line no-console
|
|
464
|
-
plugin.name,
|
|
465
|
-
plugin.version,
|
|
466
|
-
plugin._type,
|
|
467
|
-
lastUsed,
|
|
468
|
-
status,
|
|
469
|
-
]); // eslint-disable-line no-console
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
console.log(table.toString()); // eslint-disable-line no-console
|
|
473
|
-
} catch (error) {
|
|
474
|
-
// eslint-disable-line no-console
|
|
475
|
-
spinner.stop();
|
|
476
|
-
console.error(chalk.red(`Failed to list plugins: ${error.message}`)); // eslint-disable-line no-console
|
|
477
|
-
process.exit(1);
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
async publishPlugin(pluginPath, _options) {
|
|
482
|
-
if (_options.dryRun) {
|
|
483
|
-
console.log(
|
|
484
|
-
chalk.blue('š Dry run mode - validating plugin without publishing\n'),
|
|
485
|
-
); // eslint-disable-line no-console
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
try {
|
|
489
|
-
if (!_options.dryRun) {
|
|
490
|
-
const result = await this.hub.publishPlugin(pluginPath, _options);
|
|
491
|
-
|
|
492
|
-
console.log(chalk.green('\nš Plugin published successfully!')); // eslint-disable-line no-console
|
|
493
|
-
console.log(chalk.blue(`Plugin ID: ${result.pluginId}`)); // eslint-disable-line no-console
|
|
494
|
-
console.log(chalk.blue(`Version: ${result.version}`)); // eslint-disable-line no-console
|
|
495
|
-
console.log(chalk.blue(`URL: ${result.url}`)); // eslint-disable-line no-console
|
|
496
|
-
} else {
|
|
497
|
-
console.log(
|
|
498
|
-
chalk.green('ā
Plugin validation passed - ready for publishing!'),
|
|
499
|
-
); // eslint-disable-line no-console
|
|
500
|
-
}
|
|
501
|
-
} catch (error) {
|
|
502
|
-
console.error(chalk.red(`Publishing failed: ${error.message}`)); // eslint-disable-line no-console
|
|
503
|
-
process.exit(1); // eslint-disable-line no-console
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
async ratePlugin(plugin, rating, _options) {
|
|
508
|
-
if (rating < 1 || rating > 5) {
|
|
509
|
-
// eslint-disable-line no-console
|
|
510
|
-
console.error(chalk.red('Rating must be between 1 and 5')); // eslint-disable-line no-console
|
|
511
|
-
process.exit(1);
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
try {
|
|
515
|
-
await this.hub.ratePlugin(plugin, rating, _options.review);
|
|
516
|
-
|
|
517
|
-
const stars = 'ā
'.repeat(rating) + 'ā'.repeat(5 - rating); // eslint-disable-line no-console
|
|
518
|
-
console.log(chalk.green(`ā
Rated ${plugin}: ${stars}`)); // eslint-disable-line no-console
|
|
519
|
-
|
|
520
|
-
if (_options.review) {
|
|
521
|
-
console.log(chalk.blue('Review submitted successfully!')); // eslint-disable-line no-console
|
|
522
|
-
}
|
|
523
|
-
} catch (error) {
|
|
524
|
-
console.error(chalk.red(`Rating failed: ${error.message}`)); // eslint-disable-line no-console
|
|
525
|
-
process.exit(1);
|
|
526
|
-
}
|
|
527
|
-
// eslint-disable-line no-console
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
// eslint-disable-line no-console
|
|
531
|
-
async getPluginReviews(plugin, _options) {
|
|
532
|
-
const spinner = ora('Loading reviews...').start(); // eslint-disable-line no-console
|
|
533
|
-
|
|
534
|
-
try {
|
|
535
|
-
const reviews = await this.hub.getPluginReviews(plugin, _options); // eslint-disable-line no-console
|
|
536
|
-
spinner.stop();
|
|
537
|
-
|
|
538
|
-
if (reviews.reviews.length === 0) {
|
|
539
|
-
console.log(chalk.yellow('No reviews found for this plugin.')); // eslint-disable-line no-console
|
|
540
|
-
return; // eslint-disable-line no-console
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
console.log(chalk.green(`Reviews for ${plugin}:\n`)); // eslint-disable-line no-console
|
|
544
|
-
|
|
545
|
-
for (const review of reviews.reviews) {
|
|
546
|
-
const stars = 'ā
'.repeat(review.rating) + 'ā'.repeat(5 - review.rating);
|
|
547
|
-
const date = new Date(review.createdAt).toLocaleDateString();
|
|
548
|
-
|
|
549
|
-
// eslint-disable-line no-console
|
|
550
|
-
console.log(chalk.blue(`${stars} by ${review.author} on ${date}`)); // eslint-disable-line no-console
|
|
551
|
-
|
|
552
|
-
if (review.review) {
|
|
553
|
-
console.log(chalk.gray(`"${review.review}"`)); // eslint-disable-line no-console
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
if (review.helpful > 0) {
|
|
557
|
-
console.log(chalk.green(`š ${review.helpful} found this helpful`)); // eslint-disable-line no-console
|
|
558
|
-
}
|
|
559
|
-
// eslint-disable-line no-console
|
|
560
|
-
|
|
561
|
-
console.log(); // eslint-disable-line no-console
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
// eslint-disable-line no-console
|
|
565
|
-
if (reviews.hasMore) {
|
|
566
|
-
console.log(
|
|
567
|
-
chalk.blue(
|
|
568
|
-
`Showing ${reviews.reviews.length} of ${reviews.total} reviews.`,
|
|
569
|
-
),
|
|
570
|
-
); // eslint-disable-line no-console
|
|
571
|
-
}
|
|
572
|
-
} catch (error) {
|
|
573
|
-
// eslint-disable-line no-console
|
|
574
|
-
spinner.stop();
|
|
575
|
-
console.error(chalk.red(`Failed to load reviews: ${error.message}`)); // eslint-disable-line no-console
|
|
576
|
-
process.exit(1);
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
async getTrendingPlugins(_options) {
|
|
581
|
-
const spinner = ora('Loading trending plugins...').start();
|
|
582
|
-
|
|
583
|
-
try {
|
|
584
|
-
const trending = await this.hub.getTrendingPlugins(_options);
|
|
585
|
-
spinner.stop();
|
|
586
|
-
|
|
587
|
-
console.log(chalk.green(`š„ Trending plugins (${_options.period}):\n`)); // eslint-disable-line no-console
|
|
588
|
-
|
|
589
|
-
const table = new Table({
|
|
590
|
-
head: ['Rank', 'Name', 'Author', 'Category', 'Growth', 'Rating'],
|
|
591
|
-
colWidths: [6, 20, 15, 15, 10, 10],
|
|
592
|
-
}); // eslint-disable-line no-console
|
|
593
|
-
|
|
594
|
-
trending.forEach((plugin, index) => {
|
|
595
|
-
const rating =
|
|
596
|
-
'ā
'.repeat(Math.floor(plugin.rating)) +
|
|
597
|
-
'ā'.repeat(5 - Math.floor(plugin.rating));
|
|
598
|
-
const certified = plugin.certified ? chalk.green('ā') : '';
|
|
599
|
-
|
|
600
|
-
table.push([
|
|
601
|
-
`#${index + 1}`,
|
|
602
|
-
// eslint-disable-line no-console
|
|
603
|
-
`${plugin.name} ${certified}`,
|
|
604
|
-
plugin.author,
|
|
605
|
-
plugin.category,
|
|
606
|
-
chalk.green(`+${plugin.growth || 0}%`),
|
|
607
|
-
// eslint-disable-line no-console
|
|
608
|
-
rating,
|
|
609
|
-
]);
|
|
610
|
-
});
|
|
611
|
-
|
|
612
|
-
console.log(table.toString()); // eslint-disable-line no-console
|
|
613
|
-
} catch (error) {
|
|
614
|
-
spinner.stop();
|
|
615
|
-
console.error(
|
|
616
|
-
chalk.red(`Failed to load trending plugins: ${error.message}`),
|
|
617
|
-
); // eslint-disable-line no-console
|
|
618
|
-
process.exit(1);
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
async submitForCertification(plugin, options) {
|
|
623
|
-
// eslint-disable-line no-console
|
|
624
|
-
try {
|
|
625
|
-
const result = await this.certification.submitForCertification(
|
|
626
|
-
plugin,
|
|
627
|
-
options.level,
|
|
628
|
-
);
|
|
629
|
-
|
|
630
|
-
console.log(chalk.green('\nš Certification submitted successfully!')); // eslint-disable-line no-console
|
|
631
|
-
console.log(chalk.blue(`Certification ID: ${result.id}`)); // eslint-disable-line no-console
|
|
632
|
-
console.log(chalk.blue(`Level: ${result.level}`)); // eslint-disable-line no-console
|
|
633
|
-
console.log(chalk.blue(`Score: ${result.score}/100`)); // eslint-disable-line no-console
|
|
634
|
-
console.log(chalk.blue(`Status: ${result.status || 'Pending'}`)); // eslint-disable-line no-console
|
|
635
|
-
|
|
636
|
-
if (result.estimatedCompletion) {
|
|
637
|
-
console.log(
|
|
638
|
-
chalk.blue(`Estimated completion: ${result.estimatedCompletion}`),
|
|
639
|
-
); // eslint-disable-line no-console
|
|
640
|
-
}
|
|
641
|
-
} catch (error) {
|
|
642
|
-
console.error(
|
|
643
|
-
chalk.red(`Certification submission failed: ${error.message}`),
|
|
644
|
-
); // eslint-disable-line no-console
|
|
645
|
-
process.exit(1);
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
// eslint-disable-line no-console
|
|
650
|
-
async verifyCertification(plugin, certificationId) {
|
|
651
|
-
const spinner = ora('Verifying certification...').start();
|
|
652
|
-
|
|
653
|
-
try {
|
|
654
|
-
const verification = await this.certification.verifyCertification(
|
|
655
|
-
plugin,
|
|
656
|
-
certificationId,
|
|
657
|
-
);
|
|
658
|
-
spinner.stop();
|
|
659
|
-
|
|
660
|
-
if (verification.valid) {
|
|
661
|
-
console.log(chalk.green('ā
Certification is valid!')); // eslint-disable-line no-console
|
|
662
|
-
console.log(chalk.blue(`Plugin: ${plugin}`)); // eslint-disable-line no-console
|
|
663
|
-
console.log(chalk.blue(`Level: ${verification.certification.level}`)); // eslint-disable-line no-console
|
|
664
|
-
console.log(
|
|
665
|
-
chalk.blue(
|
|
666
|
-
`Expires: ${new Date(verification.expiresAt).toLocaleDateString()}`,
|
|
667
|
-
),
|
|
668
|
-
); // eslint-disable-line no-console
|
|
669
|
-
} else {
|
|
670
|
-
console.log(chalk.red('ā Certification is invalid or expired')); // eslint-disable-line no-console
|
|
671
|
-
}
|
|
672
|
-
} catch (error) {
|
|
673
|
-
spinner.stop();
|
|
674
|
-
console.error(chalk.red(`Verification failed: ${error.message}`)); // eslint-disable-line no-console
|
|
675
|
-
process.exit(1);
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
// eslint-disable-line no-console
|
|
679
|
-
|
|
680
|
-
async showCertificationRequirements(level) {
|
|
681
|
-
const levels = level ? [level] : ['BASIC', 'VERIFIED', 'ENTERPRISE'];
|
|
682
|
-
|
|
683
|
-
for (const certLevel of levels) {
|
|
684
|
-
// eslint-disable-line no-console
|
|
685
|
-
const requirements =
|
|
686
|
-
this.certification.getCertificationRequirements(certLevel);
|
|
687
|
-
|
|
688
|
-
if (!requirements) {
|
|
689
|
-
console.log(chalk.red(`Unknown certification level: ${certLevel}`)); // eslint-disable-line no-console
|
|
690
|
-
continue;
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
console.log(
|
|
694
|
-
chalk.blue.bold(`\n${certLevel} Certification Requirements:\n`),
|
|
695
|
-
); // eslint-disable-line no-console
|
|
696
|
-
|
|
697
|
-
console.log(chalk.green('Automated Checks:')); // eslint-disable-line no-console
|
|
698
|
-
requirements.automated.forEach((check) => {
|
|
699
|
-
console.log(chalk.gray(` ⢠${check}`)); // eslint-disable-line no-console
|
|
700
|
-
});
|
|
701
|
-
|
|
702
|
-
// eslint-disable-line no-console
|
|
703
|
-
if (requirements.manual.length > 0) {
|
|
704
|
-
console.log(chalk.yellow('\nManual Review:')); // eslint-disable-line no-console
|
|
705
|
-
requirements.manual.forEach((review) => {
|
|
706
|
-
console.log(chalk.gray(` ⢠${review}`)); // eslint-disable-line no-console
|
|
707
|
-
});
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
if (requirements.audit.length > 0) {
|
|
711
|
-
// eslint-disable-line no-console
|
|
712
|
-
console.log(chalk.red('\nSecurity Audit:')); // eslint-disable-line no-console
|
|
713
|
-
requirements.audit.forEach((audit) => {
|
|
714
|
-
console.log(chalk.gray(` ⢠${audit}`)); // eslint-disable-line no-console
|
|
715
|
-
});
|
|
716
|
-
}
|
|
717
|
-
// eslint-disable-line no-console
|
|
718
|
-
|
|
719
|
-
console.log(chalk.blue(`\nMinimum Score: ${requirements.minScore}/100`)); // eslint-disable-line no-console
|
|
720
|
-
console.log(
|
|
721
|
-
chalk.blue(`Validity Period: ${requirements.validityPeriod}`),
|
|
722
|
-
); // eslint-disable-line no-console
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
async getPublisherStatus(publisherId) {
|
|
727
|
-
const spinner = ora('Checking publisher status...').start();
|
|
728
|
-
|
|
729
|
-
try {
|
|
730
|
-
const status = await this.certification.getPublisherStatus(
|
|
731
|
-
publisherId || 'me',
|
|
732
|
-
);
|
|
733
|
-
spinner.stop();
|
|
734
|
-
|
|
735
|
-
console.log(chalk.blue.bold('\nPublisher Status:\n')); // eslint-disable-line no-console
|
|
736
|
-
|
|
737
|
-
const table = new Table({
|
|
738
|
-
// eslint-disable-line no-console
|
|
739
|
-
chars: {
|
|
740
|
-
top: '',
|
|
741
|
-
'top-mid': '',
|
|
742
|
-
'top-left': '',
|
|
743
|
-
'top-right': '',
|
|
744
|
-
bottom: '',
|
|
745
|
-
'bottom-mid': '',
|
|
746
|
-
'bottom-left': '',
|
|
747
|
-
'bottom-right': '',
|
|
748
|
-
// eslint-disable-line no-console
|
|
749
|
-
left: '',
|
|
750
|
-
'left-mid': '',
|
|
751
|
-
mid: '',
|
|
752
|
-
'mid-mid': '',
|
|
753
|
-
right: '',
|
|
754
|
-
'right-mid': '',
|
|
755
|
-
middle: ' ',
|
|
756
|
-
},
|
|
757
|
-
// eslint-disable-line no-console
|
|
758
|
-
style: { 'padding-left': 0, 'padding-right': 0 },
|
|
759
|
-
});
|
|
760
|
-
|
|
761
|
-
// eslint-disable-line no-console
|
|
762
|
-
table.push(
|
|
763
|
-
[
|
|
764
|
-
'Verified:',
|
|
765
|
-
status.verified ? chalk.green('Yes ā') : chalk.gray('No'),
|
|
766
|
-
],
|
|
767
|
-
['Level:', status.level || chalk.gray('None')],
|
|
768
|
-
['Certified Plugins:', status.certifiedPlugins.toString()],
|
|
769
|
-
['Reputation:', status.reputation.toString()],
|
|
770
|
-
['Member Since:', new Date(status.joinedAt).toLocaleDateString()],
|
|
771
|
-
// eslint-disable-line no-console
|
|
772
|
-
['Last Activity:', new Date(status.lastActivity).toLocaleDateString()],
|
|
773
|
-
);
|
|
774
|
-
|
|
775
|
-
console.log(table.toString()); // eslint-disable-line no-console
|
|
776
|
-
|
|
777
|
-
if (status.badges && status.badges.length > 0) {
|
|
778
|
-
console.log(chalk.blue('\nBadges:'), status.badges.join(', ')); // eslint-disable-line no-console
|
|
779
|
-
}
|
|
780
|
-
} catch (error) {
|
|
781
|
-
spinner.stop();
|
|
782
|
-
console.error(
|
|
783
|
-
chalk.red(`Failed to get publisher status: ${error.message}`),
|
|
784
|
-
); // eslint-disable-line no-console
|
|
785
|
-
process.exit(1); // eslint-disable-line no-console
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
async applyForPublisherVerification() {
|
|
790
|
-
console.log(chalk.blue('š Publisher Verification Application\n')); // eslint-disable-line no-console
|
|
791
|
-
|
|
792
|
-
const answers = await inquirer.prompt([
|
|
793
|
-
{
|
|
794
|
-
// eslint-disable-line no-console
|
|
795
|
-
_type: 'input',
|
|
796
|
-
name: 'name',
|
|
797
|
-
message: 'Full name:',
|
|
798
|
-
// eslint-disable-line no-console
|
|
799
|
-
validate: (input) => input.length > 0,
|
|
800
|
-
},
|
|
801
|
-
{
|
|
802
|
-
_type: 'input',
|
|
803
|
-
name: 'email',
|
|
804
|
-
// eslint-disable-line no-console
|
|
805
|
-
message: 'Email address:',
|
|
806
|
-
validate: (input) => /\S+@\S+\.\S+/.test(input),
|
|
807
|
-
},
|
|
808
|
-
// eslint-disable-line no-console
|
|
809
|
-
{
|
|
810
|
-
_type: 'input',
|
|
811
|
-
name: 'organization',
|
|
812
|
-
message: 'Organization (optional):',
|
|
813
|
-
},
|
|
814
|
-
{
|
|
815
|
-
// eslint-disable-line no-console
|
|
816
|
-
_type: 'input',
|
|
817
|
-
name: 'website',
|
|
818
|
-
message: 'Website/Portfolio:',
|
|
819
|
-
// eslint-disable-line no-console
|
|
820
|
-
},
|
|
821
|
-
{
|
|
822
|
-
_type: 'input',
|
|
823
|
-
name: 'github',
|
|
824
|
-
message: 'GitHub profile:',
|
|
825
|
-
// eslint-disable-line no-console
|
|
826
|
-
},
|
|
827
|
-
{
|
|
828
|
-
// eslint-disable-line no-console
|
|
829
|
-
_type: 'editor',
|
|
830
|
-
name: 'motivation',
|
|
831
|
-
message: 'Why do you want to become a verified publisher?',
|
|
832
|
-
},
|
|
833
|
-
]);
|
|
834
|
-
|
|
835
|
-
const spinner = ora('Submitting application...').start();
|
|
836
|
-
|
|
837
|
-
try {
|
|
838
|
-
const result =
|
|
839
|
-
await this.certification.applyForPublisherVerification(answers);
|
|
840
|
-
spinner.stop();
|
|
841
|
-
|
|
842
|
-
// eslint-disable-line no-console
|
|
843
|
-
console.log(chalk.green('\nā
Application submitted successfully!')); // eslint-disable-line no-console
|
|
844
|
-
console.log(chalk.blue(`Application ID: ${result.applicationId}`)); // eslint-disable-line no-console
|
|
845
|
-
console.log(chalk.blue(`Status: ${result.status}`)); // eslint-disable-line no-console
|
|
846
|
-
console.log(
|
|
847
|
-
chalk.blue(`Estimated review time: ${result.estimatedReviewTime}`),
|
|
848
|
-
); // eslint-disable-line no-console
|
|
849
|
-
} catch (error) {
|
|
850
|
-
spinner.stop();
|
|
851
|
-
console.error(chalk.red(`Application failed: ${error.message}`)); // eslint-disable-line no-console
|
|
852
|
-
process.exit(1);
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
197
|
}
|
|
856
198
|
|
|
857
199
|
module.exports = { PluginHubCLI };
|
|
858
|
-
|
|
859
|
-
undefined; // eslint-disable-line no-console
|
|
860
|
-
|
|
861
|
-
undefined; // eslint-disable-line no-console
|
|
862
|
-
|
|
863
|
-
undefined; // eslint-disable-line no-console
|
|
864
|
-
|
|
865
|
-
undefined; // eslint-disable-line no-console
|
|
866
|
-
|
|
867
|
-
undefined; // eslint-disable-line no-console
|
|
868
|
-
|
|
869
|
-
undefined; // eslint-disable-line no-console
|
|
870
|
-
|
|
871
|
-
undefined; // eslint-disable-line no-console
|
|
872
|
-
|
|
873
|
-
undefined; // eslint-disable-line no-console
|
|
874
|
-
|
|
875
|
-
undefined; // eslint-disable-line no-console
|