Add AnyClip integration tools and extracted source code

- Add authentication scripts with SubtleCrypto password encryption
- Add sourcemap extraction pipeline (update-urls, download-sourcemaps, extract-sources)
- Add Playwright API interception script for monetization endpoints
- Document two-step auth flow with JWT tokens and dual cookies
- Move extracted source from root to anyclip/ directory
- Add project configuration (.env.example, .gitignore, CLAUDE.md)
This commit is contained in:
2026-01-21 10:36:51 +08:00
parent d4fe4800e6
commit e32d475aa9
3463 changed files with 184648 additions and 64341 deletions

113
README.md
View File

@@ -1,55 +1,78 @@
# AnyClip Video Manager - Extracted Source
# AnyClip Integration
Source code extracted from sourcemaps of `videomanager.anyclip.com`.
Tools for integrating with AnyClip's Video Manager API.
## Overview
## Setup
Next.js application for video content management, analytics, and publishing.
## Structure
```
├── src/
│ ├── modules/ # Feature modules (business logic)
│ ├── pages/ # Next.js page components
│ ├── client/ # Client-side utilities
│ ├── shared/ # Shared libraries
│ └── assets/
├── pages/ # Root Next.js pages (_app.tsx, _error.tsx)
├── client/ # Next.js client runtime
├── vendor/ # Bundled node_modules
└── sourcemaps/ # Original .map files
```bash
cp .env.example .env
# Edit .env with your AnyClip credentials
bun install
```
## Modules (`src/modules/`)
## Project Structure
| Module | Description |
|--------|-------------|
| `analytics/` | Dashboards - monetization, video performance, custom reports |
| `editorial/` | Video editing - tagging, search, bulk actions, video details |
| `publishing/` | Content publishing and destination management |
| `marketplace/` | Marketplace accounts and dashboard |
| `xRay/` | X-Ray - campaigns, creatives, line items |
| `hubs/` | Content hubs management |
| `users/` | User management |
| `invitations/` | User invitation system |
| `forms/` | Form builder/management |
| `uploaderNew/` | Video upload functionality |
| `userRulesSettings/` | User rules and settings |
| `layout/` | App layout and Redux state |
| `common/` | Shared components - forms, tables, lists, tag selectors |
```
├── anyclip/ # Extracted source code (from sourcemaps)
├── docs/ # Documentation
├── scripts/ # CLI tools
├── sourcemaps/ # Raw .map files (gitignored)
└── urls.txt # JS file URLs to download
```
## Pages (`src/pages/`)
## Scripts
- `/analytics` - Analytics dashboard
- `/studio` - Studio interface
- `/personal-settings` - User settings
- `/hubs`, `/users`, `/invitations`, `/forms` - Management pages
- `/x-ray/*` - Campaign, creative, and line item analytics
### Authentication
## Tech Stack
```bash
# Login and save session to session.json
bun scripts/auth.ts
```
- Next.js, React, TypeScript
- Redux (state management)
- Material-UI (components)
- Victory/D3 (charts)
Programmatic usage:
```typescript
import { login, getAuthHeaders } from './scripts/auth';
const session = await login(email, password);
const headers = getAuthHeaders(session);
// session.cookies contains both required cookies
```
See [docs/auth.md](docs/auth.md) for details on the two-step auth flow.
### Source Extraction
Extract AnyClip's frontend source from public sourcemaps:
```bash
# 1. Update urls.txt from build manifest
bun scripts/update-urls.ts
# 2. Download sourcemaps for all URLs
bun scripts/download-sourcemaps.ts
# 3. Extract source files to anyclip/
bun scripts/extract-sources.ts
```
Or run all three:
```bash
bun scripts/update-urls.ts && bun scripts/download-sourcemaps.ts && bun scripts/extract-sources.ts
```
### Script Options
**extract-sources.ts:**
```bash
bun scripts/extract-sources.ts [options]
--output, -o <dir> Output directory (default: anyclip)
--input, -i <dir> Sourcemaps directory (default: sourcemaps)
--verbose, -v Verbose output
--no-clean Don't delete output directory first
```
## Documentation
- [docs/auth.md](docs/auth.md) - Authentication system (two-step flow, cookies, encryption)