soundbip 2.1.0 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +64 -19
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -4,7 +4,7 @@ const https = require('https');
4
4
  const { exec } = require('child_process');
5
5
 
6
6
  const API_URL = 'api.dltpays.com';
7
- const VERSION = '2.1.0';
7
+ const VERSION = '2.1.2';
8
8
 
9
9
  // Colors
10
10
  const c = {
@@ -382,7 +382,30 @@ async function main() {
382
382
  console.log(`${c.dim} Takes about 2 minutes for WooCommerce, 5-10 for custom integrations${c.reset}`);
383
383
  console.log('');
384
384
 
385
+ // Terms of Service
386
+ section('📋', 'Vendor Terms of Service');
387
+ console.log('');
388
+ console.log(`${c.dim} By registering, you agree to the following:${c.reset}`);
389
+ console.log('');
390
+ console.log(` ${c.white}1.${c.reset} SoundBip is a ${c.bold}non-custodial${c.reset} POS platform — we never hold your funds`);
391
+ console.log(` ${c.white}2.${c.reset} Blockchain transactions on XRPL are ${c.bold}irreversible${c.reset} once confirmed`);
392
+ console.log(` ${c.white}3.${c.reset} You are responsible for your wallet security and tax compliance`);
393
+ console.log(` ${c.white}4.${c.reset} Platform fee: ${c.bold}0.5%${c.reset} on eligible transactions`);
394
+ console.log(` ${c.white}5.${c.reset} Governed by the laws of ${c.bold}Guernsey${c.reset}`);
395
+ console.log('');
396
+ console.log(` ${c.dim}Full terms: ${c.cyan}https://soundbip.com/terms${c.reset}`);
397
+ console.log('');
398
+
399
+ const termsAccepted = await ask(`${c.cyan} Do you accept the Vendor Terms of Service? [y/n]: ${c.reset}`);
400
+ if (termsAccepted.trim().toLowerCase() !== 'y' && termsAccepted.trim().toLowerCase() !== 'yes') {
401
+ console.log(`\n${c.yellow} Registration cancelled. You must accept the terms to continue.${c.reset}\n`);
402
+ rl.close();
403
+ return;
404
+ }
405
+ success('Terms accepted');
406
+
385
407
  // Store details with validation
408
+ section('🏪', 'Business Details');
386
409
  const storeName = await askWithValidation(
387
410
  `${c.cyan} Store name: ${c.reset}`,
388
411
  (name) => name.length >= 2,
@@ -412,30 +435,54 @@ async function main() {
412
435
  section('📍', 'Business Address (Guernsey)');
413
436
  console.log('');
414
437
 
438
+ const PARISHES = {
439
+ '1': 'Castel', '2': 'Forest', '3': 'St Andrew', '4': 'St Martin',
440
+ '5': 'St Peter Port', '6': 'St Pierre du Bois', '7': 'St Sampson',
441
+ '8': 'St Saviour', '9': 'Torteval', '10': 'Vale'
442
+ };
443
+
415
444
  const addressStreet = await askWithValidation(
416
- `${c.cyan} Street address: ${c.reset}`,
445
+ `${c.cyan} Address: ${c.reset}`,
417
446
  (s) => s.length >= 2,
418
- 'Street address is required'
447
+ 'Address is required'
419
448
  );
420
449
 
421
- const addressCity = await askWithValidation(
422
- `${c.cyan} City / Parish: ${c.reset}`,
423
- (s) => s.length >= 2,
424
- 'City is required'
425
- );
450
+ // Auto-extract postcode from address if present
451
+ const postcodeMatch = addressStreet.match(/,?\s*GY\d{1,2}\s?\d[A-Z]{2}\s*$/i);
452
+ let addressPostcode;
453
+ let cleanStreet = addressStreet;
454
+ if (postcodeMatch) {
455
+ addressPostcode = postcodeMatch[0].replace(/^,?\s*/, '').trim().toUpperCase();
456
+ cleanStreet = addressStreet.replace(postcodeMatch[0], '').trim().replace(/,\s*$/, '');
457
+ success(`Postcode detected: ${addressPostcode}`);
458
+ } else {
459
+ addressPostcode = await askWithValidation(
460
+ `${c.cyan} Postcode (e.g. GY1 1AA): ${c.reset}`,
461
+ (pc) => /^GY\d{1,2}\s?\d[A-Z]{2}$/i.test(pc.trim()),
462
+ 'Must be a valid Guernsey postcode (e.g. GY1 1AA)',
463
+ (pc) => pc.trim().toUpperCase()
464
+ );
465
+ }
426
466
 
427
- const addressPostcode = await askWithValidation(
428
- `${c.cyan} Postcode (e.g. GY1 1AA): ${c.reset}`,
429
- (pc) => /^GY\d{1,2}\s?\d[A-Z]{2}$/i.test(pc.trim()),
430
- 'Must be a valid Guernsey postcode (e.g. GY1 1AA)',
431
- (pc) => pc.trim().toUpperCase()
432
- );
467
+ // Parish selection
468
+ console.log('');
469
+ console.log(`${c.bold} Parish:${c.reset}`);
470
+ Object.entries(PARISHES).forEach(([num, name]) => {
471
+ console.log(`${c.dim} ${c.reset}${c.cyan}[${num.padStart(2)}]${c.reset} ${name}`);
472
+ });
473
+ console.log('');
474
+ const parishChoice = await ask(`${c.cyan} Select parish [1-10]: ${c.reset}`);
475
+ const addressCity = PARISHES[parishChoice.trim()] || parishChoice.trim();
433
476
 
434
477
  // Optional fields
435
478
  section('📝', 'Additional Details');
436
479
  console.log('');
437
480
 
438
- const registrationNumber = await ask(`${c.cyan} Guernsey registration number (optional): ${c.reset}`);
481
+ const registrationNumber = await askWithValidation(
482
+ `${c.cyan} Guernsey registration number: ${c.reset}`,
483
+ (n) => n.length >= 3,
484
+ 'Registration number is required'
485
+ );
439
486
 
440
487
  const description = await ask(`${c.cyan} Describe your business (optional, max 250 chars): ${c.reset}`);
441
488
 
@@ -466,7 +513,7 @@ async function main() {
466
513
  email: email,
467
514
  owner_name: ownerName,
468
515
  business_address: {
469
- street: addressStreet,
516
+ street: cleanStreet,
470
517
  city: addressCity,
471
518
  postcode: addressPostcode
472
519
  },
@@ -476,9 +523,7 @@ async function main() {
476
523
  terms_accepted_at: new Date().toISOString()
477
524
  };
478
525
 
479
- if (registrationNumber.trim()) {
480
- registerBody.registration_number = registrationNumber.trim();
481
- }
526
+ registerBody.registration_number = registrationNumber.trim();
482
527
  if (description.trim() && description.trim().length <= 250) {
483
528
  registerBody.description = description.trim();
484
529
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "soundbip",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "CLI for SoundBip POS - instant affiliate commissions on XRPL",
5
5
  "bin": {
6
6
  "soundbip": "./index.js"