ebay-mcp 1.18.0 → 1.18.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/README.md +24 -35
- package/build/api/account-management/accountV2.js +22 -22
- package/build/api/account-management/finances.js +10 -10
- package/build/api/analytics-and-report/analytics.js +1 -1
- package/build/api/{client.js → client/ebayApiClient.js} +37 -41
- package/build/api/{clientTrading.js → client/tradingApiClient.js} +22 -22
- package/build/api/communication/feedback.js +21 -21
- package/build/api/communication/message.js +23 -23
- package/build/api/communication/negotiation.js +7 -7
- package/build/api/communication/notification.js +52 -52
- package/build/api/developer/developer.js +3 -3
- package/build/api/{index.js → ebaySellerApi.js} +4 -4
- package/build/api/listing-management/feedReportTasks.js +6 -6
- package/build/api/listing-management/feedRequest.js +6 -6
- package/build/api/listing-management/feedSchedules.js +4 -4
- package/build/api/listing-management/feedTasks.js +2 -2
- package/build/api/listing-management/items.js +22 -22
- package/build/api/listing-management/locations.js +4 -4
- package/build/api/listing-management/media.js +14 -14
- package/build/api/listing-management/mediaAttach.js +14 -14
- package/build/api/listing-management/mediaResources.js +15 -13
- package/build/api/listing-management/offerFormat.js +1 -1
- package/build/api/listing-management/offers.js +23 -23
- package/build/api/listing-management/stores.js +9 -9
- package/build/api/listing-metadata/metadata.js +10 -10
- package/build/api/marketing-and-promotions/ads.js +34 -34
- package/build/api/marketing-and-promotions/campaigns.js +19 -19
- package/build/api/marketing-and-promotions/promotions.js +22 -22
- package/build/api/marketing-and-promotions/reports.js +7 -7
- package/build/api/order-management/dispute.js +11 -9
- package/build/api/order-management/fulfillment.js +4 -4
- package/build/api/order-management/logistics.js +7 -7
- package/build/api/other/browseMappers.js +15 -13
- package/build/api/other/browseValidators.js +4 -4
- package/build/api/other/edelivery.js +19 -19
- package/build/api/other/finding.js +13 -13
- package/build/api/other/translation.js +2 -2
- package/build/api/other/vero.js +2 -2
- package/build/api/shared/download.js +7 -7
- package/build/api/shared/request.js +28 -19
- package/build/api/trading/listingFormat.js +37 -30
- package/build/api/trading/trading.js +33 -33
- package/build/auth/credentialSession.js +5 -5
- package/build/auth/oauth.js +3 -3
- package/build/auth/oauthHelper.js +24 -24
- package/build/auth/oauthMetadata.js +4 -4
- package/build/auth/oauthMiddleware.js +16 -16
- package/build/auth/scopeUtils.js +2 -2
- package/build/auth/tokenVerifier.js +23 -23
- package/build/config/environment.js +4 -45
- package/build/config/oauthScopes.js +132 -0
- package/build/index.js +5 -5
- package/build/mcp/httpTransport.js +32 -20
- package/build/mcp/runtime.js +12 -12
- package/build/mcp/toolGating.js +6 -12
- package/build/mcp/uiBridge.js +3 -3
- package/build/schemas/account-management/account.js +2 -52
- package/build/schemas/account-management/accountV2.js +2 -2
- package/build/schemas/account-management/finances.js +1 -1
- package/build/schemas/analytics/analytics.js +2 -48
- package/build/schemas/communication/messages.js +2 -46
- package/build/schemas/developer/developer.js +1 -27
- package/build/schemas/fulfillment/logistics.js +1 -1
- package/build/schemas/fulfillment/orders.js +2 -47
- package/build/schemas/inventory-management/feed.js +1 -1
- package/build/schemas/inventory-management/inventory.js +2 -50
- package/build/schemas/inventory-management/media.js +2 -2
- package/build/schemas/inventory-management/mediaDocuments.js +1 -1
- package/build/schemas/inventory-management/stores.js +1 -1
- package/build/schemas/marketing/ads.js +2 -2
- package/build/schemas/marketing/campaigns.js +2 -2
- package/build/schemas/marketing/common.js +2 -2
- package/build/schemas/marketing/marketing.js +0 -1
- package/build/schemas/marketing/promotions.js +2 -2
- package/build/schemas/marketing/reports.js +2 -2
- package/build/schemas/metadata/metadata.js +2 -90
- package/build/schemas/metadata/shipping.js +1 -1
- package/build/schemas/other/browse.js +2 -2
- package/build/schemas/other/finding.js +2 -2
- package/build/schemas/other/otherApis.js +2 -114
- package/build/schemas/taxonomy/categoryTree.js +1 -1
- package/build/schemas/taxonomy/charity.js +1 -1
- package/build/schemas/taxonomy/taxonomy.js +2 -69
- package/build/scripts/autoSetup.js +3 -3
- package/build/scripts/{buildUi.js → buildMcpApps.js} +13 -13
- package/build/scripts/devSync.js +19 -68
- package/build/scripts/diagnostics.js +15 -16
- package/build/scripts/interactiveSetup.js +25 -25
- package/build/scripts/scopeHelper.js +2 -2
- package/build/scripts/securityChecker.js +20 -20
- package/build/scripts/setup.js +76 -76
- package/build/scripts/setupShared.js +5 -30
- package/build/scripts/setupValidator.js +9 -9
- package/build/scripts/setupWizard.js +23 -23
- package/build/scripts/skills.js +14 -17
- package/build/scripts/specRefs.js +1 -1
- package/build/scripts/specSources.js +144 -0
- package/build/serverHttp.js +4 -7
- package/build/skills/content.js +13 -13
- package/build/skills/install.js +9 -9
- package/build/skills/render.js +2 -2
- package/build/tools/categories/communication.js +1 -1
- package/build/tools/categories/connector.js +19 -16
- package/build/tools/categories/fulfillment.js +4 -4
- package/build/tools/categories/inventory.js +1 -1
- package/build/tools/categories/metadata.js +1 -1
- package/build/tools/categories/taxonomy.js +1 -1
- package/build/tools/categories/tokenManagement.js +8 -8
- package/build/tools/contracts.js +2 -2
- package/build/tools/defineTool.js +27 -12
- package/build/tools/registry.js +2 -2
- package/build/tools/schemas.js +2 -2
- package/build/tools/ui/mapHelpers.js +12 -12
- package/build/tools/ui/maps.js +101 -97
- package/build/tools/ui/viewModels.js +2 -2
- package/build/utils/apiStatusFeed.js +12 -12
- package/build/utils/communication/feedback.js +3 -3
- package/build/utils/communication/message.js +3 -3
- package/build/utils/communication/negotiation.js +3 -3
- package/build/utils/communication/notification.js +3 -3
- package/build/utils/entryModule.js +33 -0
- package/build/utils/envFile.js +47 -0
- package/build/utils/envParser.js +5 -5
- package/build/utils/errors.js +4 -4
- package/build/utils/http.js +38 -38
- package/build/utils/localFeedFiles.js +3 -3
- package/build/utils/logRedaction.js +21 -0
- package/build/utils/logger.js +49 -35
- package/build/utils/other/compliance.js +3 -3
- package/build/utils/other/identity.js +3 -3
- package/build/utils/other/translation.js +3 -3
- package/build/utils/other/vero.js +3 -3
- package/build/utils/schemaHelpers.js +2 -2
- package/build/utils/tokenUtils.js +2 -2
- package/build/utils/trading/trading.js +1 -1
- package/build/utils/version.js +1 -1
- package/build/utils/zodIssues.js +14 -0
- package/package.json +8 -11
- package/README.de.md +0 -426
- package/README.es.md +0 -426
- package/README.fr.md +0 -426
- package/README.ja.md +0 -426
- package/README.ko.md +0 -426
- package/README.pt-BR.md +0 -426
- package/README.ru.md +0 -426
- package/README.zh-CN.md +0 -426
- package/build/schemas/index.js +0 -76
- package/build/schemas/marketing/jsonSchemas.js +0 -118
- package/build/scripts/downloadSpecs.js +0 -117
- package/build/scripts/updateApiStatusDoc.js +0 -71
- package/build/utils/effectSchema.js +0 -203
- package/build/utils/effectSchemaAdapter.js +0 -121
- package/build/utils/effectSchemaChainMethods.js +0 -146
- package/build/utils/effectSchemaRefinements.js +0 -104
- package/build/utils/effectSchemaStringMethods.js +0 -63
- package/build/utils/effectSchemaTypes.js +0 -47
- package/docs/auth/production_scopes.json +0 -111
- package/docs/auth/sandbox_scopes.json +0 -142
- /package/build/api/{clientRequestError.js → client/ebayClientRequestError.js} +0 -0
- /package/build/api/{rateLimitTracker.js → client/rateLimitTracker.js} +0 -0
- /package/build/api/{clientTradingError.js → client/tradingApiFailure.js} +0 -0
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import chalk from 'chalk';
|
|
10
10
|
import { writeFileSync } from 'fs';
|
|
11
|
-
import { join, dirname
|
|
11
|
+
import { join, dirname } from 'path';
|
|
12
12
|
import { fileURLToPath } from 'url';
|
|
13
13
|
import { runSecurityChecks, displaySecurityResults } from '../scripts/securityChecker.js';
|
|
14
14
|
import { validateSetup, displayRecommendations } from '../scripts/setupValidator.js';
|
|
@@ -16,11 +16,12 @@ import { parseEnvFile } from '../utils/envParser.js';
|
|
|
16
16
|
import { detectLLMClients } from '../utils/llmClientDetector.js';
|
|
17
17
|
import { displayScopeVerification, parseScopeString } from '../scripts/scopeHelper.js';
|
|
18
18
|
import { readEnvironment } from './setupShared.js';
|
|
19
|
-
import { EbaySellerApi } from '../api/
|
|
19
|
+
import { EbaySellerApi } from '../api/ebaySellerApi.js';
|
|
20
20
|
import { getErrorMessage } from '../utils/errors.js';
|
|
21
21
|
import { getUpdateInfo, getVersion } from '../utils/version.js';
|
|
22
22
|
import { Effect, Either } from 'effect';
|
|
23
23
|
import process from 'node:process';
|
|
24
|
+
import { isEntryModule } from '../utils/entryModule.js';
|
|
24
25
|
const __filename = fileURLToPath(import.meta.url);
|
|
25
26
|
const __dirname = dirname(__filename);
|
|
26
27
|
const PROJECT_ROOT = join(__dirname, '../..');
|
|
@@ -129,12 +130,12 @@ function displayConfigurationStatus(envVars) {
|
|
|
129
130
|
{ key: 'EBAY_APP_ACCESS_TOKEN', label: 'App Access Token', redact: true },
|
|
130
131
|
];
|
|
131
132
|
for (const check of checks) {
|
|
132
|
-
const
|
|
133
|
+
const envValue = envVars[check.key];
|
|
133
134
|
let status;
|
|
134
135
|
let displayValue;
|
|
135
|
-
if (
|
|
136
|
+
if (envValue && envValue.trim() && !envValue.includes('_here')) {
|
|
136
137
|
status = chalk.green('✓ Set');
|
|
137
|
-
displayValue = check.redact ? `${
|
|
138
|
+
displayValue = check.redact ? `${envValue.substring(0, 10)}...` : envValue;
|
|
138
139
|
}
|
|
139
140
|
else {
|
|
140
141
|
status = chalk.red('✗ Not set');
|
|
@@ -167,18 +168,18 @@ function displayLLMClientStatus() {
|
|
|
167
168
|
*/
|
|
168
169
|
async function displayAuthenticationTest(config) {
|
|
169
170
|
console.log(chalk.bold.cyan('🔐 API Authentication Test\n'));
|
|
170
|
-
const
|
|
171
|
-
if (
|
|
171
|
+
const authCheck = await testEbayAuthentication(config);
|
|
172
|
+
if (authCheck.success) {
|
|
172
173
|
console.log(chalk.green(' ✓ Successfully authenticated with eBay API\n'));
|
|
173
|
-
if (
|
|
174
|
+
if (authCheck.userInfo) {
|
|
174
175
|
console.log(chalk.bold.white(' User Information:'));
|
|
175
|
-
console.log(chalk.gray(JSON.stringify(
|
|
176
|
+
console.log(chalk.gray(JSON.stringify(authCheck.userInfo, null, 2)));
|
|
176
177
|
console.log('');
|
|
177
178
|
}
|
|
178
179
|
}
|
|
179
180
|
else {
|
|
180
181
|
console.log(chalk.red(' ✗ Authentication failed\n'));
|
|
181
|
-
console.log(chalk.yellow(` Error: ${
|
|
182
|
+
console.log(chalk.yellow(` Error: ${authCheck.error}\n`));
|
|
182
183
|
}
|
|
183
184
|
}
|
|
184
185
|
/**
|
|
@@ -299,17 +300,15 @@ export const runDiagnostics = async (exportReport = false) => {
|
|
|
299
300
|
};
|
|
300
301
|
// Direct script entry (`node build/scripts/diagnostics.js` / `npm run diagnose`).
|
|
301
302
|
// Guarded so importing from the bin does not auto-run diagnostics.
|
|
302
|
-
|
|
303
|
-
const modulePath = resolve(fileURLToPath(import.meta.url));
|
|
304
|
-
if (entryPath && modulePath === entryPath) {
|
|
303
|
+
if (isEntryModule(import.meta.url)) {
|
|
305
304
|
const cliArgs = process.argv.slice(2);
|
|
306
305
|
const exportReport = cliArgs.includes('--export') || cliArgs.includes('-e');
|
|
307
306
|
void Effect.runPromise(Effect.either(Effect.tryPromise({
|
|
308
307
|
try: () => runDiagnostics(exportReport),
|
|
309
308
|
catch: (error) => error,
|
|
310
|
-
}))).then((
|
|
311
|
-
if (Either.isLeft(
|
|
312
|
-
console.error(chalk.red('\n❌ Diagnostics failed:'), getErrorMessage(
|
|
309
|
+
}))).then((diagnosticsOutcome) => {
|
|
310
|
+
if (Either.isLeft(diagnosticsOutcome)) {
|
|
311
|
+
console.error(chalk.red('\n❌ Diagnostics failed:'), getErrorMessage(diagnosticsOutcome.left));
|
|
313
312
|
process.exitCode = 1;
|
|
314
313
|
}
|
|
315
314
|
});
|
|
@@ -33,7 +33,7 @@ import { displayScopeCategories, getRecommendedScopes, displayScopeVerification,
|
|
|
33
33
|
import { detectLLMClients, configureLLMClient } from '../utils/llmClientDetector.js';
|
|
34
34
|
import { validateSetup, displayRecommendations } from '../scripts/setupValidator.js';
|
|
35
35
|
import { loadExistingConfig, readEnvironment } from './setupShared.js';
|
|
36
|
-
import { EbaySellerApi } from '../api/
|
|
36
|
+
import { EbaySellerApi } from '../api/ebaySellerApi.js';
|
|
37
37
|
import { EbayOAuthClient } from '../auth/oauth.js';
|
|
38
38
|
import { getErrorMessage } from '../utils/errors.js';
|
|
39
39
|
import process from 'node:process';
|
|
@@ -49,11 +49,11 @@ const ebayColors = {
|
|
|
49
49
|
yellow: chalk.hex('#F5AF02'),
|
|
50
50
|
green: chalk.hex('#85B716'),
|
|
51
51
|
};
|
|
52
|
-
function readOptionalEnvironment(
|
|
53
|
-
if (!
|
|
52
|
+
function readOptionalEnvironment(rawEnvironment) {
|
|
53
|
+
if (!rawEnvironment) {
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
return readEnvironment(
|
|
56
|
+
return readEnvironment(rawEnvironment);
|
|
57
57
|
}
|
|
58
58
|
function parseInteractiveArgs() {
|
|
59
59
|
const args = process.argv.slice(2);
|
|
@@ -113,8 +113,8 @@ function displayLogo() {
|
|
|
113
113
|
console.log(EBAY_LOGO);
|
|
114
114
|
console.log(CREATOR_CREDIT);
|
|
115
115
|
}
|
|
116
|
-
function validateRequired(
|
|
117
|
-
return
|
|
116
|
+
function validateRequired(input) {
|
|
117
|
+
return input.trim().length > 0 || 'This field is required';
|
|
118
118
|
}
|
|
119
119
|
function generateEnvFile(config, environment) {
|
|
120
120
|
const envPath = join(PROJECT_ROOT, `.env${environment === 'sandbox' ? '' : `.${environment}`}`);
|
|
@@ -184,25 +184,25 @@ async function acquireRefreshToken(config, useInteractiveFlow) {
|
|
|
184
184
|
}
|
|
185
185
|
// Manual flow
|
|
186
186
|
displayManualOAuthInstructions(config.clientId, config.redirectUri || 'http://localhost:3000/oauth/callback', config.environment, getRecommendedScopes(config.environment));
|
|
187
|
-
const
|
|
187
|
+
const pastedToken = await prompts({
|
|
188
188
|
type: 'text',
|
|
189
189
|
name: 'refreshToken',
|
|
190
190
|
message: 'Paste your refresh token here:',
|
|
191
|
-
validate: (
|
|
192
|
-
if (!
|
|
191
|
+
validate: (input) => {
|
|
192
|
+
if (!input || input.trim() === '') {
|
|
193
193
|
return 'Refresh token is required';
|
|
194
194
|
}
|
|
195
|
-
const
|
|
196
|
-
if (!
|
|
195
|
+
const cleanToken = input.trim().replace(/^["']|["']$/g, '');
|
|
196
|
+
if (!cleanToken.startsWith('v^1.1#')) {
|
|
197
197
|
return 'Token should start with "v^1.1#"';
|
|
198
198
|
}
|
|
199
199
|
return true;
|
|
200
200
|
},
|
|
201
201
|
});
|
|
202
|
-
if (!
|
|
202
|
+
if (!pastedToken.refreshToken) {
|
|
203
203
|
return null;
|
|
204
204
|
}
|
|
205
|
-
return
|
|
205
|
+
return pastedToken.refreshToken.trim().replace(/^["']|["']$/g, '');
|
|
206
206
|
}
|
|
207
207
|
async function validateAndGenerateTokens(config) {
|
|
208
208
|
console.log(chalk.bold.cyan('\n🔄 Validating Credentials & Generating Tokens...\n'));
|
|
@@ -286,7 +286,7 @@ async function detectAndConfigureLLMClients() {
|
|
|
286
286
|
console.log(chalk.bold.cyan('│ 🤖 LLM Client Detection & Configuration │'));
|
|
287
287
|
console.log(chalk.bold.cyan('└─────────────────────────────────────────────────────────────┘\n'));
|
|
288
288
|
const clients = detectLLMClients();
|
|
289
|
-
const detectedClients = clients.filter((
|
|
289
|
+
const detectedClients = clients.filter((client) => client.detected);
|
|
290
290
|
if (detectedClients.length === 0) {
|
|
291
291
|
console.log(chalk.yellow('⚠️ No compatible LLM clients detected on your system.\n'));
|
|
292
292
|
console.log(chalk.white('Supported clients:'));
|
|
@@ -353,7 +353,7 @@ async function detectAndConfigureLLMClients() {
|
|
|
353
353
|
chalk.gray(' to select, ') +
|
|
354
354
|
chalk.cyan('Enter') +
|
|
355
355
|
chalk.gray(' to confirm\n'));
|
|
356
|
-
const
|
|
356
|
+
const clientSelection = await prompts({
|
|
357
357
|
type: 'multiselect',
|
|
358
358
|
name: 'selectedClients',
|
|
359
359
|
message: 'Select clients to configure:',
|
|
@@ -370,7 +370,7 @@ async function detectAndConfigureLLMClients() {
|
|
|
370
370
|
hint: '← → or Space to toggle • Enter to confirm',
|
|
371
371
|
instructions: false,
|
|
372
372
|
});
|
|
373
|
-
if (!
|
|
373
|
+
if (!clientSelection.selectedClients || clientSelection.selectedClients.length === 0) {
|
|
374
374
|
console.log(chalk.gray('\n⏭️ Skipping LLM client configuration.\n'));
|
|
375
375
|
return;
|
|
376
376
|
}
|
|
@@ -378,8 +378,8 @@ async function detectAndConfigureLLMClients() {
|
|
|
378
378
|
console.log(chalk.bold.cyan('\n┌─────────────────────────────────────────────────────────────┐'));
|
|
379
379
|
console.log(chalk.bold.cyan('│ ⚙️ Configuring Selected Clients │'));
|
|
380
380
|
console.log(chalk.bold.cyan('└─────────────────────────────────────────────────────────────┘\n'));
|
|
381
|
-
for (const clientName of
|
|
382
|
-
const client = detectedClients.find((
|
|
381
|
+
for (const clientName of clientSelection.selectedClients) {
|
|
382
|
+
const client = detectedClients.find((detected) => detected.name === clientName);
|
|
383
383
|
if (!client)
|
|
384
384
|
continue;
|
|
385
385
|
console.log(chalk.cyan(`Configuring ${client.displayName}...`));
|
|
@@ -641,12 +641,12 @@ async function runInteractiveSetup(args) {
|
|
|
641
641
|
name: 'token',
|
|
642
642
|
message: 'Paste your refresh token:',
|
|
643
643
|
initial: refreshToken,
|
|
644
|
-
validate: (
|
|
645
|
-
if (!
|
|
644
|
+
validate: (input) => {
|
|
645
|
+
if (!input || input.trim() === '') {
|
|
646
646
|
return 'Refresh token is required';
|
|
647
647
|
}
|
|
648
|
-
const
|
|
649
|
-
if (!
|
|
648
|
+
const cleanToken = input.trim().replace(/^["']|["']$/g, '');
|
|
649
|
+
if (!cleanToken.startsWith('v^1.1#')) {
|
|
650
650
|
return 'Token should start with "v^1.1#"';
|
|
651
651
|
}
|
|
652
652
|
return true;
|
|
@@ -746,9 +746,9 @@ process.on('SIGINT', () => {
|
|
|
746
746
|
void Effect.runPromise(Effect.either(Effect.tryPromise({
|
|
747
747
|
try: () => main(),
|
|
748
748
|
catch: (error) => error,
|
|
749
|
-
}))).then((
|
|
750
|
-
if (Either.isLeft(
|
|
751
|
-
console.error(chalk.red('\n❌ Setup failed:'), getErrorMessage(
|
|
749
|
+
}))).then((setupOutcome) => {
|
|
750
|
+
if (Either.isLeft(setupOutcome)) {
|
|
751
|
+
console.error(chalk.red('\n❌ Setup failed:'), getErrorMessage(setupOutcome.left));
|
|
752
752
|
process.exitCode = 1;
|
|
753
753
|
}
|
|
754
754
|
});
|
|
@@ -266,5 +266,5 @@ export const getAllScopesString = (environment) => getRecommendedScopes(environm
|
|
|
266
266
|
*/
|
|
267
267
|
export const parseScopeString = (scopeString) => scopeString
|
|
268
268
|
.split(/\s+/)
|
|
269
|
-
.map((
|
|
270
|
-
.filter((
|
|
269
|
+
.map((scope) => scope.trim())
|
|
270
|
+
.filter((scope) => scope.length > 0);
|
|
@@ -14,7 +14,7 @@ import { writeCliLine } from '../utils/cliOutput.js';
|
|
|
14
14
|
* @returns A security check result for the active Node.js process.
|
|
15
15
|
* @example
|
|
16
16
|
* ```ts
|
|
17
|
-
* const
|
|
17
|
+
* const nodeVersionCheck = checkNodeVersion();
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
20
|
export const checkNodeVersion = () => {
|
|
@@ -43,7 +43,7 @@ export const checkNodeVersion = () => {
|
|
|
43
43
|
* @returns A security check result for credential file ignore coverage.
|
|
44
44
|
* @example
|
|
45
45
|
* ```ts
|
|
46
|
-
* const
|
|
46
|
+
* const gitignoreCheck = checkGitignore(process.cwd());
|
|
47
47
|
* ```
|
|
48
48
|
*/
|
|
49
49
|
export const checkGitignore = (projectRoot) => {
|
|
@@ -84,7 +84,7 @@ export const checkGitignore = (projectRoot) => {
|
|
|
84
84
|
* @returns A security check result for the eBay API reachability probe.
|
|
85
85
|
* @example
|
|
86
86
|
* ```ts
|
|
87
|
-
* const
|
|
87
|
+
* const connectivityCheck = await checkNetworkConnectivity();
|
|
88
88
|
* ```
|
|
89
89
|
*/
|
|
90
90
|
export const checkNetworkConnectivity = async () => {
|
|
@@ -107,8 +107,8 @@ export const checkNetworkConnectivity = async () => {
|
|
|
107
107
|
fix: 'Check your internet connection, proxy settings, and firewall',
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
110
|
+
const healthResponse = reached.right;
|
|
111
|
+
if (healthResponse.ok || healthResponse.status === 404) {
|
|
112
112
|
// 404 is fine, means we can reach eBay servers
|
|
113
113
|
return {
|
|
114
114
|
check: 'Network Connectivity',
|
|
@@ -120,7 +120,7 @@ export const checkNetworkConnectivity = async () => {
|
|
|
120
120
|
return {
|
|
121
121
|
check: 'Network Connectivity',
|
|
122
122
|
passed: false,
|
|
123
|
-
message: `Unexpected response from eBay API: ${
|
|
123
|
+
message: `Unexpected response from eBay API: ${healthResponse.status}`,
|
|
124
124
|
severity: 'warning',
|
|
125
125
|
fix: 'Check your internet connection and firewall settings',
|
|
126
126
|
};
|
|
@@ -132,7 +132,7 @@ export const checkNetworkConnectivity = async () => {
|
|
|
132
132
|
* @returns A security check result for build output presence.
|
|
133
133
|
* @example
|
|
134
134
|
* ```ts
|
|
135
|
-
* const
|
|
135
|
+
* const buildCheck = checkProjectBuild(process.cwd());
|
|
136
136
|
* ```
|
|
137
137
|
*/
|
|
138
138
|
export const checkProjectBuild = (projectRoot) => {
|
|
@@ -160,7 +160,7 @@ export const checkProjectBuild = (projectRoot) => {
|
|
|
160
160
|
* @returns A security check result for dependency installation state.
|
|
161
161
|
* @example
|
|
162
162
|
* ```ts
|
|
163
|
-
* const
|
|
163
|
+
* const dependencyCheck = checkDependencies(process.cwd());
|
|
164
164
|
* ```
|
|
165
165
|
*/
|
|
166
166
|
export const checkDependencies = (projectRoot) => {
|
|
@@ -188,7 +188,7 @@ export const checkDependencies = (projectRoot) => {
|
|
|
188
188
|
* @returns A security check result for credential tracking risk.
|
|
189
189
|
* @example
|
|
190
190
|
* ```ts
|
|
191
|
-
* const
|
|
191
|
+
* const gitTrackingCheck = checkGitTracking(process.cwd());
|
|
192
192
|
* ```
|
|
193
193
|
*/
|
|
194
194
|
export const checkGitTracking = (projectRoot) => {
|
|
@@ -275,24 +275,24 @@ export const runSecurityChecks = async (projectRoot) => {
|
|
|
275
275
|
*/
|
|
276
276
|
export const displaySecurityResults = (results) => {
|
|
277
277
|
writeCliLine(chalk.bold.cyan('\n🔒 Security & Environment Checks\n'));
|
|
278
|
-
for (const
|
|
279
|
-
const icon =
|
|
278
|
+
for (const checkResult of results) {
|
|
279
|
+
const icon = checkResult.passed ? chalk.green('✓') : chalk.red('✗');
|
|
280
280
|
let severity = chalk.gray('[INFO]');
|
|
281
|
-
if (
|
|
281
|
+
if (checkResult.severity === 'critical') {
|
|
282
282
|
severity = chalk.red('[CRITICAL]');
|
|
283
283
|
}
|
|
284
|
-
else if (
|
|
284
|
+
else if (checkResult.severity === 'warning') {
|
|
285
285
|
severity = chalk.yellow('[WARNING]');
|
|
286
286
|
}
|
|
287
|
-
writeCliLine(`${icon} ${chalk.bold(
|
|
288
|
-
writeCliLine(` ${chalk.gray(
|
|
289
|
-
if (
|
|
290
|
-
writeCliLine(` ${chalk.yellow('→ Fix:')} ${
|
|
287
|
+
writeCliLine(`${icon} ${chalk.bold(checkResult.check)}: ${severity}`);
|
|
288
|
+
writeCliLine(` ${chalk.gray(checkResult.message)}`);
|
|
289
|
+
if (checkResult.fix) {
|
|
290
|
+
writeCliLine(` ${chalk.yellow('→ Fix:')} ${checkResult.fix}`);
|
|
291
291
|
}
|
|
292
292
|
writeCliLine('');
|
|
293
293
|
}
|
|
294
|
-
const critical = results.filter((
|
|
295
|
-
const warnings = results.filter((
|
|
294
|
+
const critical = results.filter((checkResult) => !checkResult.passed && checkResult.severity === 'critical');
|
|
295
|
+
const warnings = results.filter((checkResult) => !checkResult.passed && checkResult.severity === 'warning');
|
|
296
296
|
if (critical.length > 0) {
|
|
297
297
|
writeCliLine(chalk.red.bold(`⚠️ ${critical.length} critical issue(s) found. Please fix before continuing.\n`));
|
|
298
298
|
}
|
|
@@ -313,4 +313,4 @@ export const displaySecurityResults = (results) => {
|
|
|
313
313
|
* if (hasCriticalFailures(results)) process.exit(1);
|
|
314
314
|
* ```
|
|
315
315
|
*/
|
|
316
|
-
export const hasCriticalFailures = (results) => results.some((
|
|
316
|
+
export const hasCriticalFailures = (results) => results.some((check) => !check.passed && check.severity === 'critical');
|