@private.me/xbind 1.2.16 → 1.3.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.
Files changed (39) hide show
  1. package/README.md +124 -8
  2. package/dist-standalone/_deps/crypto/base64.js +198 -86
  3. package/dist-standalone/_deps/shared/cjs/errors.js +232 -539
  4. package/dist-standalone/_deps/shared/cjs/index.js +88 -442
  5. package/dist-standalone/_deps/shared/cjs/types.js +61 -374
  6. package/dist-standalone/_deps/shared/errors.d.ts +7 -1
  7. package/dist-standalone/_deps/shared/errors.d.ts.map +1 -1
  8. package/dist-standalone/_deps/shared/errors.js +231 -161
  9. package/dist-standalone/_deps/shared/errors.js.map +1 -1
  10. package/dist-standalone/_deps/shared/index.js +54 -55
  11. package/dist-standalone/_deps/shared/types.js +60 -58
  12. package/dist-standalone/_deps/ux-helpers/cjs/errors.js +1 -1
  13. package/dist-standalone/_deps/ux-helpers/cjs/pagination.js +1 -1
  14. package/dist-standalone/_deps/ux-helpers/cjs/progress.js +1 -1
  15. package/dist-standalone/_deps/ux-helpers/cjs/search.js +1 -1
  16. package/dist-standalone/_deps/ux-helpers/errors.js +1 -1
  17. package/dist-standalone/_deps/ux-helpers/pagination.js +1 -1
  18. package/dist-standalone/_deps/ux-helpers/progress.js +1 -1
  19. package/dist-standalone/_deps/ux-helpers/search.js +1 -1
  20. package/dist-standalone/_deps/xregistry/cjs/discovery.js +1 -1
  21. package/dist-standalone/_deps/xregistry/cjs/errors.js +1 -1
  22. package/dist-standalone/_deps/xregistry/cjs/index.js +1 -1
  23. package/dist-standalone/_deps/xregistry/cjs/registry.js +1 -1
  24. package/dist-standalone/_deps/xregistry/cjs/schema.js +1 -1
  25. package/dist-standalone/_deps/xregistry/cjs/types.js +1 -1
  26. package/dist-standalone/_deps/xregistry/discovery.js +1 -1
  27. package/dist-standalone/_deps/xregistry/errors.js +1 -1
  28. package/dist-standalone/_deps/xregistry/index.js +1 -1
  29. package/dist-standalone/_deps/xregistry/registry.js +1 -1
  30. package/dist-standalone/_deps/xregistry/schema.js +1 -1
  31. package/dist-standalone/_deps/xregistry/types.js +1 -1
  32. package/dist-standalone/cli/setup.d.ts +52 -0
  33. package/dist-standalone/cli/setup.js +515 -0
  34. package/dist-standalone/cli/types.d.ts +79 -0
  35. package/dist-standalone/cli/types.js +27 -0
  36. package/dist-standalone/cli/xbind.d.ts +20 -0
  37. package/dist-standalone/cli/xbind.js +149 -0
  38. package/package.json +2 -2
  39. package/share1.dat +0 -0
@@ -0,0 +1,149 @@
1
+ #!/usr/bin/env node
2
+ /* eslint-disable no-console */
3
+ /**
4
+ * @module cli/xbind
5
+ * Main xBind CLI router - dispatches to subcommands.
6
+ *
7
+ * Supports 12 commands (v2.0.0 spec):
8
+ * 1. setup - Create deployment identity
9
+ * 2. connect - Connect to a service (TODO)
10
+ * 3. invite - Generate invite link (TODO)
11
+ * 4. list - List connections (TODO)
12
+ * 5. status - Display connection status (TODO)
13
+ * 6. migrate - Scan for API keys (TODO)
14
+ * 7. trial - Activate free trial (TODO)
15
+ * 8. deploy - Deploy algorithms (TODO)
16
+ * 9. server - Start relay server (TODO)
17
+ * 10. revoke - Revoke connection (TODO)
18
+ * 11. backup - Export/import identity (TODO)
19
+ * 12. debug - Diagnostics (TODO)
20
+ */
21
+ import { parseArgs } from 'node:util';
22
+ import { ExitCode, Colors } from './types.js';
23
+ /**
24
+ * Show help message.
25
+ */
26
+ function showHelp() {
27
+ console.log(`
28
+ xBind CLI - Identity-Based M2M Authentication
29
+
30
+ Usage:
31
+ xbind <command> [options]
32
+
33
+ Commands:
34
+ setup Create deployment identity (DID + DeploymentID)
35
+ connect Connect to a service (TODO)
36
+ invite Generate viral invite link (TODO)
37
+ list List all active connections (TODO)
38
+ status Display connection status (TODO)
39
+ migrate Scan codebase for API keys (TODO)
40
+ trial Activate 3-month free trial (TODO)
41
+ deploy Deploy proprietary algorithms (TODO)
42
+ server Start agent relay server (TODO)
43
+ revoke Revoke connection (TODO)
44
+ backup Export/import identity (TODO)
45
+ debug Diagnostic information (TODO)
46
+
47
+ Global Options:
48
+ --json Output JSON only (no human-readable text)
49
+ --no-color Disable colored output
50
+ --debug Show detailed error information
51
+ -h, --help Show this help message
52
+
53
+ Examples:
54
+ xbind setup --name my-service
55
+ xbind setup --email user@example.com --force
56
+ xbind connect payments-service
57
+ xbind status
58
+
59
+ Documentation:
60
+ https://private.me/docs/xbind
61
+ `.trim());
62
+ }
63
+ /**
64
+ * Show version.
65
+ */
66
+ function showVersion() {
67
+ // Read from package.json
68
+ console.log('xBind CLI v1.3.0');
69
+ }
70
+ /**
71
+ * Main CLI entry point.
72
+ */
73
+ async function main() {
74
+ const args = process.argv.slice(2);
75
+ // No arguments - show help
76
+ if (args.length === 0) {
77
+ showHelp();
78
+ return;
79
+ }
80
+ // Parse global flags
81
+ const { values, positionals } = parseArgs({
82
+ args,
83
+ options: {
84
+ help: { type: 'boolean', short: 'h' },
85
+ version: { type: 'boolean', short: 'v' },
86
+ json: { type: 'boolean' },
87
+ 'no-color': { type: 'boolean' },
88
+ debug: { type: 'boolean' },
89
+ },
90
+ allowPositionals: true,
91
+ strict: false, // Allow command-specific flags
92
+ });
93
+ // Global flags
94
+ if (values.help) {
95
+ showHelp();
96
+ return;
97
+ }
98
+ if (values.version) {
99
+ showVersion();
100
+ return;
101
+ }
102
+ // Get command
103
+ const command = positionals[0];
104
+ if (!command) {
105
+ showHelp();
106
+ return;
107
+ }
108
+ // Route to command handler
109
+ switch (command) {
110
+ case 'setup': {
111
+ const { main: setupMain } = await import('./setup.js');
112
+ await setupMain(args.slice(1)); // Pass remaining args to setup command
113
+ break;
114
+ }
115
+ case 'connect':
116
+ case 'invite':
117
+ case 'list':
118
+ case 'status':
119
+ case 'migrate':
120
+ case 'trial':
121
+ case 'deploy':
122
+ case 'server':
123
+ case 'revoke':
124
+ case 'backup':
125
+ case 'debug': {
126
+ const useColors = !values['no-color'] && process.stderr.isTTY;
127
+ const yellow = useColors ? Colors.YELLOW : '';
128
+ const reset = useColors ? Colors.RESET : '';
129
+ console.error(`${yellow}⚠️ Command "${command}" not yet implemented${reset}`);
130
+ console.error(`\nAvailable commands:`);
131
+ console.error(` • setup - Create deployment identity (IMPLEMENTED)`);
132
+ console.error(`\nComing soon: connect, invite, list, status, migrate, trial, deploy, server, revoke, backup, debug`);
133
+ process.exit(ExitCode.USER_ERROR);
134
+ }
135
+ default: {
136
+ const useColors = !values['no-color'] && process.stderr.isTTY;
137
+ const red = useColors ? Colors.RED : '';
138
+ const reset = useColors ? Colors.RESET : '';
139
+ console.error(`${red}❌ Error: Unknown command "${command}"${reset}`);
140
+ console.error(`\nRun "xbind --help" to see available commands.`);
141
+ process.exit(ExitCode.USER_ERROR);
142
+ }
143
+ }
144
+ }
145
+ // Run main
146
+ main().catch((error) => {
147
+ console.error('Fatal error:', error instanceof Error ? error.message : String(error));
148
+ process.exit(ExitCode.SYSTEM_ERROR);
149
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@private.me/xbind",
3
- "version": "1.2.16",
3
+ "version": "1.3.0",
4
4
  "description": "Identity-based M2M authentication (Contains encryption - export restrictions apply)",
5
5
  "license": "Proprietary",
6
6
  "author": "Private.Me Contributors",
@@ -30,7 +30,7 @@
30
30
  "./_deps/*": "./dist-standalone/_deps/*/index.js"
31
31
  },
32
32
  "bin": {
33
- "xbind": "./dist-standalone/cli/init.js",
33
+ "xbind": "./dist-standalone/cli/xbind.js",
34
34
  "xbind-init": "./dist-standalone/cli/init.js",
35
35
  "xbind-onboard": "./dist-standalone/cli/init.js"
36
36
  },
package/share1.dat CHANGED
Binary file