@ucptools/validator 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +60 -0
- package/.vercel/README.txt +11 -0
- package/.vercel/project.json +1 -0
- package/dist/cli/index.d.ts +6 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +279 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/compliance/compliance-generator.d.ts +34 -0
- package/dist/compliance/compliance-generator.d.ts.map +1 -0
- package/dist/compliance/compliance-generator.js +320 -0
- package/dist/compliance/compliance-generator.js.map +1 -0
- package/dist/compliance/index.d.ts +8 -0
- package/dist/compliance/index.d.ts.map +1 -0
- package/dist/compliance/index.js +17 -0
- package/dist/compliance/index.js.map +1 -0
- package/dist/compliance/templates.d.ts +34 -0
- package/dist/compliance/templates.d.ts.map +1 -0
- package/{src/compliance/templates.ts → dist/compliance/templates.js} +117 -155
- package/dist/compliance/templates.js.map +1 -0
- package/dist/compliance/types.d.ts +64 -0
- package/dist/compliance/types.d.ts.map +1 -0
- package/dist/compliance/types.js +64 -0
- package/dist/compliance/types.js.map +1 -0
- package/dist/db/index.d.ts +11 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +63 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/schema.d.ts +444 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +65 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/feed-analyzer/feed-analyzer.d.ts +26 -0
- package/dist/feed-analyzer/feed-analyzer.d.ts.map +1 -0
- package/{src/feed-analyzer/feed-analyzer.ts → dist/feed-analyzer/feed-analyzer.js} +642 -726
- package/dist/feed-analyzer/feed-analyzer.js.map +1 -0
- package/dist/feed-analyzer/index.d.ts +8 -0
- package/dist/feed-analyzer/index.d.ts.map +1 -0
- package/dist/feed-analyzer/index.js +19 -0
- package/dist/feed-analyzer/index.js.map +1 -0
- package/dist/feed-analyzer/types.d.ts +204 -0
- package/dist/feed-analyzer/types.d.ts.map +1 -0
- package/dist/feed-analyzer/types.js +162 -0
- package/dist/feed-analyzer/types.js.map +1 -0
- package/{src/generator/index.ts → dist/generator/index.d.ts} +1 -1
- package/dist/generator/index.d.ts.map +1 -0
- package/dist/generator/index.js +13 -0
- package/dist/generator/index.js.map +1 -0
- package/dist/generator/key-generator.d.ts +24 -0
- package/dist/generator/key-generator.d.ts.map +1 -0
- package/dist/generator/key-generator.js +144 -0
- package/dist/generator/key-generator.js.map +1 -0
- package/dist/generator/profile-builder.d.ts +15 -0
- package/dist/generator/profile-builder.d.ts.map +1 -0
- package/dist/generator/profile-builder.js +338 -0
- package/dist/generator/profile-builder.js.map +1 -0
- package/dist/hosting/artifacts-generator.d.ts +10 -0
- package/dist/hosting/artifacts-generator.d.ts.map +1 -0
- package/{src/hosting/artifacts-generator.ts → dist/hosting/artifacts-generator.js} +191 -241
- package/dist/hosting/artifacts-generator.js.map +1 -0
- package/{src/hosting/index.ts → dist/hosting/index.d.ts} +1 -1
- package/dist/hosting/index.d.ts.map +1 -0
- package/dist/hosting/index.js +10 -0
- package/dist/hosting/index.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +78 -0
- package/dist/index.js.map +1 -0
- package/{src/security/index.ts → dist/security/index.d.ts} +8 -15
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +12 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/security-scanner.d.ts +10 -0
- package/dist/security/security-scanner.d.ts.map +1 -0
- package/dist/security/security-scanner.js +541 -0
- package/dist/security/security-scanner.js.map +1 -0
- package/dist/security/types.d.ts +48 -0
- package/dist/security/types.d.ts.map +1 -0
- package/dist/security/types.js +21 -0
- package/dist/security/types.js.map +1 -0
- package/dist/services/directory.d.ts +104 -0
- package/dist/services/directory.d.ts.map +1 -0
- package/dist/services/directory.js +333 -0
- package/dist/services/directory.js.map +1 -0
- package/dist/simulator/agent-simulator.d.ts +69 -0
- package/dist/simulator/agent-simulator.d.ts.map +1 -0
- package/{src/simulator/agent-simulator.ts → dist/simulator/agent-simulator.js} +650 -941
- package/dist/simulator/agent-simulator.js.map +1 -0
- package/{src/simulator/index.ts → dist/simulator/index.d.ts} +7 -7
- package/dist/simulator/index.d.ts.map +1 -0
- package/dist/simulator/index.js +23 -0
- package/dist/simulator/index.js.map +1 -0
- package/{src/simulator/types.ts → dist/simulator/types.d.ts} +145 -170
- package/dist/simulator/types.d.ts.map +1 -0
- package/dist/simulator/types.js +18 -0
- package/dist/simulator/types.js.map +1 -0
- package/dist/types/generator.d.ts +106 -0
- package/dist/types/generator.d.ts.map +1 -0
- package/dist/types/generator.js +6 -0
- package/dist/types/generator.js.map +1 -0
- package/{src/types/index.ts → dist/types/index.d.ts} +1 -1
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +23 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/ucp-profile.d.ts +103 -0
- package/dist/types/ucp-profile.d.ts.map +1 -0
- package/dist/types/ucp-profile.js +45 -0
- package/dist/types/ucp-profile.js.map +1 -0
- package/dist/types/validation.d.ts +68 -0
- package/dist/types/validation.d.ts.map +1 -0
- package/dist/types/validation.js +32 -0
- package/dist/types/validation.js.map +1 -0
- package/dist/validator/index.d.ts +26 -0
- package/dist/validator/index.d.ts.map +1 -0
- package/dist/validator/index.js +161 -0
- package/dist/validator/index.js.map +1 -0
- package/dist/validator/network-validator.d.ts +28 -0
- package/dist/validator/network-validator.d.ts.map +1 -0
- package/dist/validator/network-validator.js +319 -0
- package/dist/validator/network-validator.js.map +1 -0
- package/dist/validator/rules-validator.d.ts +11 -0
- package/dist/validator/rules-validator.d.ts.map +1 -0
- package/dist/validator/rules-validator.js +257 -0
- package/dist/validator/rules-validator.js.map +1 -0
- package/dist/validator/sdk-validator.d.ts +58 -0
- package/dist/validator/sdk-validator.d.ts.map +1 -0
- package/{src/validator/sdk-validator.ts → dist/validator/sdk-validator.js} +273 -330
- package/dist/validator/sdk-validator.js.map +1 -0
- package/dist/validator/structural-validator.d.ts +11 -0
- package/dist/validator/structural-validator.d.ts.map +1 -0
- package/dist/validator/structural-validator.js +415 -0
- package/dist/validator/structural-validator.js.map +1 -0
- package/package.json +1 -1
- package/publish-output.txt +0 -0
- package/CLAUDE.md +0 -109
- package/api/analyze-feed.js +0 -140
- package/api/badge.js +0 -185
- package/api/benchmark.js +0 -177
- package/api/directory-stats.ts +0 -29
- package/api/directory.ts +0 -73
- package/api/generate-compliance.js +0 -143
- package/api/generate-schema.js +0 -457
- package/api/generate.js +0 -132
- package/api/security-scan.js +0 -133
- package/api/simulate.js +0 -187
- package/api/tsconfig.json +0 -10
- package/api/validate.js +0 -1351
- package/apify-actor/.actor/actor.json +0 -68
- package/apify-actor/.actor/input_schema.json +0 -32
- package/apify-actor/APIFY-STORE-LISTING.md +0 -412
- package/apify-actor/Dockerfile +0 -8
- package/apify-actor/README.md +0 -166
- package/apify-actor/main.ts +0 -111
- package/apify-actor/package.json +0 -17
- package/apify-actor/src/main.js +0 -199
- package/docs/BRAND-IDENTITY.md +0 -238
- package/docs/BRAND-STYLE-GUIDE.md +0 -356
- package/drizzle/0000_black_king_cobra.sql +0 -39
- package/drizzle/meta/0000_snapshot.json +0 -309
- package/drizzle/meta/_journal.json +0 -13
- package/drizzle.config.ts +0 -10
- package/public/.well-known/ucp +0 -25
- package/public/android-chrome-192x192.png +0 -0
- package/public/android-chrome-512x512.png +0 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/brand.css +0 -321
- package/public/directory.html +0 -701
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/guides/bigcommerce.html +0 -743
- package/public/guides/fastucp.html +0 -838
- package/public/guides/magento.html +0 -779
- package/public/guides/shopify.html +0 -726
- package/public/guides/squarespace.html +0 -749
- package/public/guides/wix.html +0 -747
- package/public/guides/woocommerce.html +0 -733
- package/public/index.html +0 -3835
- package/public/learn.html +0 -396
- package/public/logo.jpeg +0 -0
- package/public/og-image-icon.png +0 -0
- package/public/og-image.png +0 -0
- package/public/robots.txt +0 -6
- package/public/site.webmanifest +0 -31
- package/public/sitemap.xml +0 -69
- package/public/social/linkedin-banner-1128x191.png +0 -0
- package/public/social/temp.PNG +0 -0
- package/public/social/x-header-1500x500.png +0 -0
- package/public/verify.html +0 -410
- package/scripts/generate-favicons.js +0 -44
- package/scripts/generate-ico.js +0 -23
- package/scripts/generate-og-image.js +0 -45
- package/scripts/reset-db.ts +0 -77
- package/scripts/seed-db.ts +0 -71
- package/scripts/setup-benchmark-db.js +0 -70
- package/src/api/server.ts +0 -266
- package/src/cli/index.ts +0 -302
- package/src/compliance/compliance-generator.ts +0 -452
- package/src/compliance/index.ts +0 -28
- package/src/compliance/types.ts +0 -170
- package/src/db/index.ts +0 -28
- package/src/db/schema.ts +0 -84
- package/src/feed-analyzer/index.ts +0 -34
- package/src/feed-analyzer/types.ts +0 -354
- package/src/generator/key-generator.ts +0 -124
- package/src/generator/profile-builder.ts +0 -402
- package/src/index.ts +0 -105
- package/src/security/security-scanner.ts +0 -604
- package/src/security/types.ts +0 -55
- package/src/services/directory.ts +0 -434
- package/src/types/generator.ts +0 -140
- package/src/types/ucp-profile.ts +0 -140
- package/src/types/validation.ts +0 -89
- package/src/validator/index.ts +0 -194
- package/src/validator/network-validator.ts +0 -417
- package/src/validator/rules-validator.ts +0 -297
- package/src/validator/structural-validator.ts +0 -476
- package/tests/fixtures/non-compliant-profile.json +0 -25
- package/tests/fixtures/official-sample-profile.json +0 -75
- package/tests/integration/benchmark.test.ts +0 -207
- package/tests/integration/database.test.ts +0 -163
- package/tests/integration/directory-api.test.ts +0 -268
- package/tests/integration/simulate-api.test.ts +0 -230
- package/tests/integration/validate-api.test.ts +0 -269
- package/tests/setup.ts +0 -15
- package/tests/unit/agent-simulator.test.ts +0 -575
- package/tests/unit/compliance-generator.test.ts +0 -374
- package/tests/unit/directory-service.test.ts +0 -272
- package/tests/unit/feed-analyzer.test.ts +0 -517
- package/tests/unit/lint-suggestions.test.ts +0 -423
- package/tests/unit/official-samples.test.ts +0 -211
- package/tests/unit/pdf-report.test.ts +0 -390
- package/tests/unit/sdk-validator.test.ts +0 -531
- package/tests/unit/security-scanner.test.ts +0 -410
- package/tests/unit/validation.test.ts +0 -390
- package/vercel.json +0 -34
- package/vitest.config.ts +0 -22
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(git add:*)",
|
|
5
|
+
"Bash(git commit:*)",
|
|
6
|
+
"Bash(gh repo view:*)",
|
|
7
|
+
"WebFetch(domain:github.com)",
|
|
8
|
+
"Bash(gh issue create --title \"UCP Merchant Directory - Public registry of UCP-enabled sites\" --body \"$\\(cat <<''EOF''\n## Description\nCreate a public directory/registry of UCP-enabled merchant sites. **No one else has this** - first-mover opportunity.\n\n## Value\n- Unique resource in the UCP ecosystem\n- Drives traffic as the go-to place to discover UCP merchants\n- Builds community and network effects\n- SEO for \"UCP merchants\", \"UCP enabled stores\"\n\n## Features\n- [ ] Database to store validated UCP merchants\n- [ ] Public directory page with search/filter\n- [ ] Auto-add sites that pass validation \\(opt-in\\)\n- [ ] Categories \\(e-commerce platform, industry, region\\)\n- [ ] Badge for listed merchants \\(\"Listed on UCPtools Directory\"\\)\n- [ ] API endpoint to query directory\n\n## Technical Considerations\n- Storage: Vercel KV, Supabase, or similar\n- Moderation: prevent spam/fake entries\n- Privacy: only list with merchant consent\n\n## Effort\nMedium\n\n## Priority\nHigh - First-mover advantage\nEOF\n\\)\" --label \"enhancement,first-mover,priority:high\")",
|
|
9
|
+
"Bash(gh issue create:*)",
|
|
10
|
+
"Bash(gh release:*)",
|
|
11
|
+
"Bash(git checkout:*)",
|
|
12
|
+
"Bash(npx -y @neondatabase/mcp-server-neon --help)",
|
|
13
|
+
"WebFetch(domain:neon.tech)",
|
|
14
|
+
"WebFetch(domain:neon.com)",
|
|
15
|
+
"Bash(npx neonctl@latest init)",
|
|
16
|
+
"Bash(test:*)",
|
|
17
|
+
"Bash(claude mcp add:*)",
|
|
18
|
+
"Bash(node scripts/setup-benchmark-db.js:*)",
|
|
19
|
+
"Bash(node --check:*)",
|
|
20
|
+
"Bash(git push:*)",
|
|
21
|
+
"Bash(gh pr create:*)",
|
|
22
|
+
"Bash(vercel env add:*)",
|
|
23
|
+
"Bash(gh pr merge:*)",
|
|
24
|
+
"Bash(git pull:*)",
|
|
25
|
+
"Bash(gh issue list:*)",
|
|
26
|
+
"Bash(gh issue view:*)",
|
|
27
|
+
"Bash(npm install:*)",
|
|
28
|
+
"Bash(npm uninstall:*)",
|
|
29
|
+
"Bash(npm run db:generate:*)",
|
|
30
|
+
"Bash(npm run db:push:*)",
|
|
31
|
+
"Bash(source:*)",
|
|
32
|
+
"Bash(npx tsc:*)",
|
|
33
|
+
"Bash(npm test:*)",
|
|
34
|
+
"WebSearch",
|
|
35
|
+
"WebFetch(domain:ucp.dev)",
|
|
36
|
+
"WebFetch(domain:puddingheroes.com)",
|
|
37
|
+
"Bash(curl:*)",
|
|
38
|
+
"Bash(npx tsx:*)",
|
|
39
|
+
"Bash(node:*)",
|
|
40
|
+
"WebFetch(domain:raw.githubusercontent.com)",
|
|
41
|
+
"WebFetch(domain:api.github.com)",
|
|
42
|
+
"Bash(git rm:*)",
|
|
43
|
+
"WebFetch(domain:community.shopify.com)",
|
|
44
|
+
"WebFetch(domain:www.consentmo.com)",
|
|
45
|
+
"WebFetch(domain:www.searchenginejournal.com)",
|
|
46
|
+
"WebFetch(domain:www.cio.com)",
|
|
47
|
+
"Bash(gh issue edit:*)",
|
|
48
|
+
"Bash(git restore:*)",
|
|
49
|
+
"WebFetch(domain:blog.fka.dev)",
|
|
50
|
+
"Bash(npm run build:*)",
|
|
51
|
+
"Bash(ls:*)",
|
|
52
|
+
"Bash(npm pack:*)",
|
|
53
|
+
"Bash(npm --version)",
|
|
54
|
+
"Bash(dir:*)",
|
|
55
|
+
"Bash(echo:*)",
|
|
56
|
+
"Bash(npm publish:*)",
|
|
57
|
+
"Bash(tee:*)"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
> Why do I have a folder named ".vercel" in my project?
|
|
2
|
+
The ".vercel" folder is created when you link a directory to a Vercel project.
|
|
3
|
+
|
|
4
|
+
> What does the "project.json" file contain?
|
|
5
|
+
The "project.json" file contains:
|
|
6
|
+
- The ID of the Vercel project that you linked ("projectId")
|
|
7
|
+
- The ID of the user or team your Vercel project is owned by ("orgId")
|
|
8
|
+
|
|
9
|
+
> Should I commit the ".vercel" folder?
|
|
10
|
+
No, you should not share the ".vercel" folder with anyone.
|
|
11
|
+
Upon creation, it will be automatically added to your ".gitignore" file.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"projectId":"prj_eTjAnoZgKgFqS9xhKX7Xbzhz6aHZ","orgId":"team_2huQYroxI3sER9pnJgLgEOWr","projectName":"ucp-tools"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA;;GAEG"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* UCP Profile Validator CLI
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const fs_1 = require("fs");
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const index_js_1 = require("../validator/index.js");
|
|
11
|
+
const index_js_2 = require("../generator/index.js");
|
|
12
|
+
const index_js_3 = require("../hosting/index.js");
|
|
13
|
+
// Colors for terminal output (simple implementation without chalk for ESM)
|
|
14
|
+
const colors = {
|
|
15
|
+
red: (s) => `\x1b[31m${s}\x1b[0m`,
|
|
16
|
+
green: (s) => `\x1b[32m${s}\x1b[0m`,
|
|
17
|
+
yellow: (s) => `\x1b[33m${s}\x1b[0m`,
|
|
18
|
+
blue: (s) => `\x1b[34m${s}\x1b[0m`,
|
|
19
|
+
gray: (s) => `\x1b[90m${s}\x1b[0m`,
|
|
20
|
+
bold: (s) => `\x1b[1m${s}\x1b[0m`,
|
|
21
|
+
};
|
|
22
|
+
commander_1.program
|
|
23
|
+
.name('ucp-validate')
|
|
24
|
+
.description('UCP Profile Validator and Generator CLI')
|
|
25
|
+
.version('1.0.0');
|
|
26
|
+
/**
|
|
27
|
+
* Validate command
|
|
28
|
+
*/
|
|
29
|
+
commander_1.program
|
|
30
|
+
.command('validate')
|
|
31
|
+
.description('Validate a UCP profile')
|
|
32
|
+
.option('-f, --file <path>', 'Path to local JSON file')
|
|
33
|
+
.option('-r, --remote <domain>', 'Remote domain to fetch profile from')
|
|
34
|
+
.option('-q, --quick', 'Quick validation (no network checks)')
|
|
35
|
+
.option('-o, --output <path>', 'Output report to file')
|
|
36
|
+
.option('--json', 'Output as JSON')
|
|
37
|
+
.action(async (options) => {
|
|
38
|
+
try {
|
|
39
|
+
let report;
|
|
40
|
+
if (options.remote) {
|
|
41
|
+
console.log(colors.blue(`Fetching profile from https://${options.remote}/.well-known/ucp...`));
|
|
42
|
+
report = await (0, index_js_1.validateRemote)(options.remote, {
|
|
43
|
+
skipNetworkChecks: options.quick,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
else if (options.file) {
|
|
47
|
+
const filePath = (0, path_1.resolve)(options.file);
|
|
48
|
+
if (!(0, fs_1.existsSync)(filePath)) {
|
|
49
|
+
console.error(colors.red(`File not found: ${filePath}`));
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
const content = (0, fs_1.readFileSync)(filePath, 'utf-8');
|
|
53
|
+
const profile = JSON.parse(content);
|
|
54
|
+
if (options.quick) {
|
|
55
|
+
report = (0, index_js_1.validateQuick)(profile);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
report = await (0, index_js_1.validateProfile)(profile);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
console.error(colors.red('Please specify --file or --remote'));
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
// Output
|
|
66
|
+
if (options.json) {
|
|
67
|
+
console.log(JSON.stringify(report, null, 2));
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
printValidationReport(report);
|
|
71
|
+
}
|
|
72
|
+
if (options.output) {
|
|
73
|
+
(0, fs_1.writeFileSync)(options.output, JSON.stringify(report, null, 2));
|
|
74
|
+
console.log(colors.gray(`\nReport saved to: ${options.output}`));
|
|
75
|
+
}
|
|
76
|
+
process.exit(report.ok ? 0 : 1);
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
console.error(colors.red(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`));
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
/**
|
|
84
|
+
* Generate command
|
|
85
|
+
*/
|
|
86
|
+
commander_1.program
|
|
87
|
+
.command('generate')
|
|
88
|
+
.description('Generate a new UCP profile')
|
|
89
|
+
.requiredOption('-d, --domain <domain>', 'Primary domain (e.g., merchant.com)')
|
|
90
|
+
.requiredOption('-e, --endpoint <url>', 'REST API endpoint URL')
|
|
91
|
+
.option('-i, --id <id>', 'Merchant ID (auto-generated if not provided)')
|
|
92
|
+
.option('--order', 'Enable Order capability')
|
|
93
|
+
.option('--fulfillment', 'Enable Fulfillment capability')
|
|
94
|
+
.option('--discount', 'Enable Discount capability')
|
|
95
|
+
.option('-o, --output <path>', 'Output file path', 'ucp.json')
|
|
96
|
+
.option('--json', 'Output to stdout as JSON')
|
|
97
|
+
.action(async (options) => {
|
|
98
|
+
try {
|
|
99
|
+
const input = {
|
|
100
|
+
merchant: {
|
|
101
|
+
merchantId: options.id || `merchant-${Date.now()}`,
|
|
102
|
+
primaryDomain: options.domain,
|
|
103
|
+
},
|
|
104
|
+
transport: {
|
|
105
|
+
rest: {
|
|
106
|
+
endpoint: options.endpoint,
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
capabilities: {
|
|
110
|
+
checkout: true,
|
|
111
|
+
order: options.order || false,
|
|
112
|
+
fulfillment: options.fulfillment || false,
|
|
113
|
+
discount: options.discount || false,
|
|
114
|
+
},
|
|
115
|
+
security: {
|
|
116
|
+
generateSigningKeys: options.order || false,
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
const result = await (0, index_js_2.buildProfile)(input);
|
|
120
|
+
if (options.json) {
|
|
121
|
+
console.log(result.profileJson);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
(0, fs_1.writeFileSync)(options.output, result.profileJson);
|
|
125
|
+
console.log(colors.green(`✓ Profile generated: ${options.output}`));
|
|
126
|
+
if (result.signingKeyPair) {
|
|
127
|
+
const keyFile = options.output.replace('.json', '-private-key.pem');
|
|
128
|
+
(0, fs_1.writeFileSync)(keyFile, result.signingKeyPair.privateKey);
|
|
129
|
+
console.log(colors.yellow(`⚠ Private key saved: ${keyFile}`));
|
|
130
|
+
console.log(colors.gray(' Keep this file secure! Do not commit to version control.'));
|
|
131
|
+
}
|
|
132
|
+
console.log(colors.blue('\nNext steps:'));
|
|
133
|
+
console.log(' 1. Review the generated profile');
|
|
134
|
+
console.log(' 2. Run: ucp-validate validate -f ' + options.output);
|
|
135
|
+
console.log(' 3. Deploy to https://' + options.domain + '/.well-known/ucp');
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
console.error(colors.red(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`));
|
|
140
|
+
process.exit(1);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
/**
|
|
144
|
+
* Generate minimal profile
|
|
145
|
+
*/
|
|
146
|
+
commander_1.program
|
|
147
|
+
.command('generate-minimal')
|
|
148
|
+
.description('Generate a minimal starter profile')
|
|
149
|
+
.requiredOption('-e, --endpoint <url>', 'REST API endpoint URL')
|
|
150
|
+
.option('-o, --output <path>', 'Output file path', 'ucp.json')
|
|
151
|
+
.action((options) => {
|
|
152
|
+
try {
|
|
153
|
+
const profile = (0, index_js_2.generateMinimalProfile)(options.endpoint);
|
|
154
|
+
const json = JSON.stringify(profile, null, 2);
|
|
155
|
+
(0, fs_1.writeFileSync)(options.output, json);
|
|
156
|
+
console.log(colors.green(`✓ Minimal profile generated: ${options.output}`));
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
console.error(colors.red(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`));
|
|
160
|
+
process.exit(1);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
/**
|
|
164
|
+
* Generate hosting artifacts
|
|
165
|
+
*/
|
|
166
|
+
commander_1.program
|
|
167
|
+
.command('hosting')
|
|
168
|
+
.description('Generate hosting configuration files')
|
|
169
|
+
.requiredOption('-f, --file <path>', 'Path to profile JSON file')
|
|
170
|
+
.requiredOption('-d, --domain <domain>', 'Merchant domain')
|
|
171
|
+
.requiredOption('-m, --mode <mode>', 'Hosting mode: static, edge-worker, reverse-proxy')
|
|
172
|
+
.option('-p, --platform <platform>', 'Platform: nginx, apache, vercel, netlify, cloudflare-worker, s3-cloudfront')
|
|
173
|
+
.option('-i, --id <id>', 'Merchant ID')
|
|
174
|
+
.option('-o, --output <dir>', 'Output directory', './ucp-hosting')
|
|
175
|
+
.action((options) => {
|
|
176
|
+
try {
|
|
177
|
+
const filePath = (0, path_1.resolve)(options.file);
|
|
178
|
+
if (!(0, fs_1.existsSync)(filePath)) {
|
|
179
|
+
console.error(colors.red(`File not found: ${filePath}`));
|
|
180
|
+
process.exit(1);
|
|
181
|
+
}
|
|
182
|
+
const profileJson = (0, fs_1.readFileSync)(filePath, 'utf-8');
|
|
183
|
+
const config = {
|
|
184
|
+
mode: options.mode,
|
|
185
|
+
platform: options.platform,
|
|
186
|
+
merchantId: options.id || `merchant-${Date.now()}`,
|
|
187
|
+
merchantDomain: options.domain,
|
|
188
|
+
};
|
|
189
|
+
const artifacts = (0, index_js_3.generateHostingArtifacts)(config, profileJson);
|
|
190
|
+
// Create output directory
|
|
191
|
+
const outputDir = (0, path_1.resolve)(options.output);
|
|
192
|
+
if (!(0, fs_1.existsSync)(outputDir)) {
|
|
193
|
+
const { mkdirSync } = require('fs');
|
|
194
|
+
mkdirSync(outputDir, { recursive: true });
|
|
195
|
+
}
|
|
196
|
+
// Write artifacts
|
|
197
|
+
for (const artifact of artifacts) {
|
|
198
|
+
const artifactPath = (0, path_1.resolve)(outputDir, artifact.filename);
|
|
199
|
+
// Create subdirectories if needed
|
|
200
|
+
const dir = artifactPath.substring(0, artifactPath.lastIndexOf('/'));
|
|
201
|
+
if (dir && !(0, fs_1.existsSync)(dir)) {
|
|
202
|
+
const { mkdirSync } = require('fs');
|
|
203
|
+
mkdirSync(dir, { recursive: true });
|
|
204
|
+
}
|
|
205
|
+
(0, fs_1.writeFileSync)(artifactPath, artifact.content);
|
|
206
|
+
console.log(colors.green(`✓ ${artifact.filename}`));
|
|
207
|
+
}
|
|
208
|
+
console.log(colors.blue(`\nArtifacts generated in: ${outputDir}`));
|
|
209
|
+
console.log(colors.gray('See README.md for installation instructions.'));
|
|
210
|
+
}
|
|
211
|
+
catch (error) {
|
|
212
|
+
console.error(colors.red(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`));
|
|
213
|
+
process.exit(1);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
/**
|
|
217
|
+
* Print validation report to console
|
|
218
|
+
*/
|
|
219
|
+
function printValidationReport(report) {
|
|
220
|
+
console.log('\n' + colors.bold('UCP Profile Validation Report'));
|
|
221
|
+
console.log('═'.repeat(50));
|
|
222
|
+
if (report.profile_url) {
|
|
223
|
+
console.log(colors.gray(`Profile: ${report.profile_url}`));
|
|
224
|
+
}
|
|
225
|
+
if (report.ucp_version) {
|
|
226
|
+
console.log(colors.gray(`UCP Version: ${report.ucp_version}`));
|
|
227
|
+
}
|
|
228
|
+
console.log(colors.gray(`Validated: ${report.validated_at}`));
|
|
229
|
+
console.log(colors.gray(`Mode: ${report.validation_mode}`));
|
|
230
|
+
console.log('');
|
|
231
|
+
// Summary
|
|
232
|
+
if (report.ok) {
|
|
233
|
+
console.log(colors.green('✓ Validation PASSED'));
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
console.log(colors.red('✗ Validation FAILED'));
|
|
237
|
+
}
|
|
238
|
+
// Issue counts
|
|
239
|
+
const errors = report.issues.filter(i => i.severity === 'error');
|
|
240
|
+
const warnings = report.issues.filter(i => i.severity === 'warn');
|
|
241
|
+
const info = report.issues.filter(i => i.severity === 'info');
|
|
242
|
+
if (report.issues.length === 0) {
|
|
243
|
+
console.log(colors.green('\nNo issues found!'));
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
console.log(`\n${errors.length} error(s), ${warnings.length} warning(s), ${info.length} info`);
|
|
247
|
+
}
|
|
248
|
+
// Print issues
|
|
249
|
+
if (errors.length > 0) {
|
|
250
|
+
console.log('\n' + colors.red('Errors:'));
|
|
251
|
+
for (const issue of errors) {
|
|
252
|
+
printIssue(issue);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
if (warnings.length > 0) {
|
|
256
|
+
console.log('\n' + colors.yellow('Warnings:'));
|
|
257
|
+
for (const issue of warnings) {
|
|
258
|
+
printIssue(issue);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
if (info.length > 0) {
|
|
262
|
+
console.log('\n' + colors.blue('Info:'));
|
|
263
|
+
for (const issue of info) {
|
|
264
|
+
printIssue(issue);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
console.log('');
|
|
268
|
+
}
|
|
269
|
+
function printIssue(issue) {
|
|
270
|
+
const icon = issue.severity === 'error' ? '✗' : issue.severity === 'warn' ? '⚠' : 'ℹ';
|
|
271
|
+
const color = issue.severity === 'error' ? colors.red : issue.severity === 'warn' ? colors.yellow : colors.blue;
|
|
272
|
+
console.log(` ${color(icon)} [${issue.code}] ${issue.message}`);
|
|
273
|
+
console.log(colors.gray(` Path: ${issue.path}`));
|
|
274
|
+
if (issue.hint) {
|
|
275
|
+
console.log(colors.gray(` Hint: ${issue.hint}`));
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
commander_1.program.parse();
|
|
279
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;AACA;;GAEG;;AAEH,yCAAoC;AACpC,2BAA6D;AAC7D,+BAA+B;AAC/B,oDAAuF;AACvF,oDAA6E;AAC7E,kDAA+D;AAI/D,2EAA2E;AAC3E,MAAM,MAAM,GAAG;IACb,GAAG,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS;IACzC,KAAK,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS;IAC3C,MAAM,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS;IAC5C,IAAI,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS;IAC1C,IAAI,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS;IAC1C,IAAI,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS;CAC1C,CAAC;AAEF,mBAAO;KACJ,IAAI,CAAC,cAAc,CAAC;KACpB,WAAW,CAAC,yCAAyC,CAAC;KACtD,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB;;GAEG;AACH,mBAAO;KACJ,OAAO,CAAC,UAAU,CAAC;KACnB,WAAW,CAAC,wBAAwB,CAAC;KACrC,MAAM,CAAC,mBAAmB,EAAE,yBAAyB,CAA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KAAK,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;IAEhH,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACpD,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC;AACH,CAAC;AAED,mBAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GDPR/Privacy Compliance Generator
|
|
3
|
+
* Generates privacy policy addendums and consent language for agentic commerce
|
|
4
|
+
*/
|
|
5
|
+
import type { ComplianceGeneratorInput, ComplianceGeneratorOutput, ComplianceRegion } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Generate complete compliance documentation
|
|
8
|
+
*/
|
|
9
|
+
export declare function generateComplianceDocuments(input: ComplianceGeneratorInput): ComplianceGeneratorOutput;
|
|
10
|
+
/**
|
|
11
|
+
* Get available regions with descriptions
|
|
12
|
+
*/
|
|
13
|
+
export declare function getAvailableRegions(): Array<{
|
|
14
|
+
id: ComplianceRegion;
|
|
15
|
+
name: string;
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Get lawful basis options with descriptions
|
|
19
|
+
*/
|
|
20
|
+
export declare function getLawfulBasisOptions(): Array<{
|
|
21
|
+
id: string;
|
|
22
|
+
title: string;
|
|
23
|
+
description: string;
|
|
24
|
+
gdprArticle: string;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Get AI platform options
|
|
28
|
+
*/
|
|
29
|
+
export declare function getAiPlatformOptions(): Array<{
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
description: string;
|
|
33
|
+
}>;
|
|
34
|
+
//# sourceMappingURL=compliance-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compliance-generator.d.ts","sourceRoot":"","sources":["../../src/compliance/compliance-generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAIzB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAgBpB;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,wBAAwB,GAC9B,yBAAyB,CA4F3B;AA+RD;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,KAAK,CAAC;IAAE,EAAE,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAKnF;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,KAAK,CAAC;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC,CAKD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,KAAK,CAAC;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC,CAOD"}
|