diff --git a/.gitignore b/.gitignore index 86cb8b4..3b58b16 100644 --- a/.gitignore +++ b/.gitignore @@ -31,4 +31,7 @@ yarn-error.log* # OS files .DS_Store -Thumbs.db \ No newline at end of file +Thumbs.db +# Generated documentation (built in CI by `npm run build`) +/public +/docs diff --git a/VERSION.md b/VERSION.md deleted file mode 100644 index 762a0c2..0000000 --- a/VERSION.md +++ /dev/null @@ -1,66 +0,0 @@ -# API Documentation Versions - -This document describes the available versions of the Flash API documentation and their key differences. - -## Available Versions - -| Version | Release Date | Status | Description | -|---------|-------------|--------|-------------| -| 1.0.0 | 2024-04-10 | Stable | Initial stable release | -| 1.1.0 | 2024-05-05 | Latest | Improved authentication flow and additional endpoints | -| Beta | Current | Preview | Preview of upcoming features (unstable) | - -## Version Features - -### v1.0.0 (Initial Release) -- Basic GraphQL API documentation -- Authentication flow with JWT tokens -- Core payment operations (Lightning, On-chain) -- User management operations - -### v1.1.0 (Current Stable) -- Added Nostr integration with new endpoints: - - `isFlashNpub` query to check if a nostr public key belongs to a Flash user - - `userUpdateNpub` mutation to update a user's nostr public key -- Enhanced payment operations: - - Updated `intraLedgerPaymentSend` to use Ibex for routing instead of internal ledger - - Added `description_hash` parameter to `lnInvoiceCreate` -- Improved error handling with more detailed error messages -- Performance optimizations for payment processing - -### Beta (Preview) -- Enhanced Nostr integration: - - New `npubByUsername` query to get the nostr public key for a username - - Improved performance for nostr-related operations -- New wallet export functionality: - - `walletExport` mutation to export wallet data in various formats (CSV, JSON, PDF) - - Requires additional authentication for security -- Updated account limits: - - Added new limits for conversion between currencies - -## Versioning Strategy - -The Flash API follows semantic versioning (MAJOR.MINOR.PATCH): - -- MAJOR version changes indicate backward-incompatible API changes -- MINOR version changes add functionality in a backward-compatible manner -- PATCH version changes make backward-compatible bug fixes - -For most integrations, we recommend using the latest stable version which includes all improvements and bug fixes. The beta version is intended for testing upcoming features and should not be used in production environments. - -## Version Lifecycle - -1. **Beta**: Preview of upcoming features, may change without notice -2. **Latest**: The most recent stable release with all features and bug fixes -3. **Stable**: Previous versions that are still supported -4. **Deprecated**: Versions that will be removed in a future release - -We maintain backward compatibility for at least 6 months for minor versions and provide migration guides for major version upgrades. - -## Accessing Specific Versions - -You can access a specific version of the API documentation by using the version selector in the top navigation bar, or by directly accessing the URL with the version prefix: - -- Latest (v1.1.0): `/v1.1.0/` -- Initial Release (v1.0.0): `/` -- Beta: `/beta/` \ No newline at end of file diff --git a/build-versions.js b/build-versions.js deleted file mode 100644 index 44e505f..0000000 --- a/build-versions.js +++ /dev/null @@ -1,156 +0,0 @@ -/** - * Build script for versioned API documentation - * - * This script: - * 1. Creates directory structure for different API versions - * 2. Copies the appropriate files to each version directory - * 3. Updates paths and references in the files - * 4. Generates version-specific schema files if needed - */ - -const fs = require('fs'); -const path = require('path'); -const { execSync } = require('child_process'); - -// Available versions to build -const versions = [ - { - version: '1.1.0', - path: 'v1.1.0', - schemaUrl: 'https://api.flashapp.me/graphql', - date: '2024-05-05' - }, - { - version: '1.0.0', - path: '', // Root directory for the current stable version - schemaUrl: 'https://api.flashapp.me/graphql', - date: '2024-04-10' - }, - { - version: 'beta', - path: 'beta', - schemaUrl: 'https://api.test.flashapp.me/graphql', - date: 'Current' - } -]; - -// Build directory (default is 'public') -const BUILD_DIR = path.join(__dirname, 'public'); - -// Source directory -const SRC_DIR = path.join(__dirname, 'src'); - -// Create version directories and copy files -async function buildVersionedDocs() { - try { - console.log('Starting versioned build process...'); - - // Create build directory if it doesn't exist - if (!fs.existsSync(BUILD_DIR)) { - fs.mkdirSync(BUILD_DIR, { recursive: true }); - } - - // Build each version - for (const version of versions) { - await buildVersion(version); - } - - // Create version manifest file - createVersionManifest(); - - console.log('Versioned build complete!'); - } catch (error) { - console.error('Error building versioned docs:', error); - process.exit(1); - } -} - -/** - * Build a specific version of the documentation - */ -async function buildVersion(version) { - console.log(`Building version ${version.version}...`); - - // Create version directory - const versionDir = path.join(BUILD_DIR, version.path); - if (version.path && !fs.existsSync(versionDir)) { - fs.mkdirSync(versionDir, { recursive: true }); - } - - // For root version (current stable), we'll use the main build process - if (!version.path) { - return; - } - - // Copy files from public to version directory - console.log(`Copying files to ${versionDir}...`); - - // Copy all files from public to version directory - execSync(`cp -r ${BUILD_DIR}/* ${versionDir}/`); - - // Update paths in HTML files to reference version-specific files - updatePaths(versionDir, version); - - console.log(`Version ${version.version} built successfully`); -} - -/** - * Update paths in HTML files to reference version-specific files - */ -function updatePaths(versionDir, version) { - // Update index.html - const indexPath = path.join(versionDir, 'index.html'); - - if (fs.existsSync(indexPath)) { - let content = fs.readFileSync(indexPath, 'utf8'); - - // Add version information to the page - content = content.replace( - /