@package-uploader/core
v1.8.34
Published
Patch and upload Rise courses to LMS platforms
Maintainers
Readme
@package-uploader/core
Upload and manage Rise course packages on LMS platforms with a web UI and optional auto-patching.
Features
- Web UI: Browse folders, upload courses, manage documents and shared links
- Course upload: Upload SCORM, cmi5, xAPI packages with drag-and-drop
- Thin Pack links: Auto-create LMS thin pack links on upload
- Version management: Upload new versions to existing documents
- Auto-patching: Automatically patch courses with @patch-adams/core
- Feedback widget: Inject feedback forms into patched courses
Quick Start
Run the Server
# Install globally
npm install -g @package-uploader/core
# Create .env file
cat > .env << EOF
UPLOADER_BASE_URL=https://your-lms.bravais.com
UPLOADER_USERNAME=your-username
UPLOADER_PASSWORD=your-password
PORT=3002
EOF
# Start the server
package-upload-serverOpen http://localhost:3002 to access the web UI.
Using npx (no install)
npx @package-uploader/core serverWeb UI Features
Browse Page
- Navigate folder hierarchy
- View documents with metadata
- Expand documents to see details and shared links
- Create thin pack and shared links
- Copy launch URLs to clipboard
Upload Modal
- Drag-and-drop file upload
- Auto-create LMS Thin Pack link (toggle, default ON)
- Auto-create Shared Link (toggle, default OFF)
- Custom link names with auto-generated slugs
Configuration
Environment Variables
# Required - Bravais LMS connection
UPLOADER_BASE_URL=https://your-lms.bravais.com
UPLOADER_USERNAME=your-username
UPLOADER_PASSWORD=your-password
# Optional - Server settings
PORT=3002
DEFAULT_FOLDER_ID=12345
# Optional - CORS for split-domain deployment
CORS_ORIGINS=https://company.com,https://www.company.com
# Optional - Auto-patching (requires @patch-adams/core)
PATCH_ENABLED=true
PATCH_REMOTE_DOMAIN=https://cdn.example.com/rise-overridesAuto-Patching with @patch-adams/core
Install the optional peer dependency to enable auto-patching:
npm install @patch-adams/core @patch-adams/plugin-feedbackWhen enabled, uploaded courses are automatically patched with:
- LRS bridge for xAPI tracking
- Feedback widget (configurable)
- Custom CSS/JS injections
Split-Domain Deployment
For deploying the UI on a main domain with the API on a subdomain:
1. Build UI for Static Hosting
cd ui
VITE_API_URL=https://api.company.com/api npm run build
# Deploy ui/dist/ to your static host2. Configure CORS on API Server
CORS_ORIGINS=https://company.com,https://www.company.comProgrammatic Usage
import { PackageUploaderClient } from '@package-uploader/core';
const client = new PackageUploaderClient({
baseUrl: 'https://your-lms.bravais.com',
username: 'your-username',
password: 'your-password',
});
// Upload a course
const result = await client.uploadCourse(fileBuffer, 'course.zip', {
folderId: '12345',
title: 'My Course',
});
// Create a thin pack link
await client.createSharedLink(result.documentId, {
name: 'My Course - LMS Thin Pack',
isPublic: true,
isForThinPackage: true,
});API Reference
Folders
client.listFolders()
client.getFolder(folderId)
client.listSubfolders(folderId)Documents
client.listDocuments({ folderId, filterText })
client.getDocument(documentId)
client.getDocumentVersions(documentId)Shared Links
client.listSharedLinks(documentId)
client.createSharedLink(documentId, {
name: 'Link Name',
isPublic: true,
isForThinPackage: true,
})Upload
client.uploadCourse(buffer, filename, { folderId, title })
client.uploadVersion(buffer, filename, { documentId, note })CLI Commands
# Start the web server
package-upload-server
# Upload a course (CLI)
package-upload upload course.zip --folder 12345
# Upload a new version
package-upload update course.zip --document-id 67890Development
# Clone and install
git clone https://github.com/npmbuilder/package-uploader.git
cd package-uploader
npm install
# Build UI
npm run build:ui
# Build TypeScript
npm run build
# Run server in development
npm run serverLicense
MIT
