curatedreels-deploy 1.0.1
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.
- package/README.md +176 -0
- package/dist/clients/deno.d.ts +60 -0
- package/dist/clients/deno.d.ts.map +1 -0
- package/dist/clients/deno.js +173 -0
- package/dist/clients/deno.js.map +1 -0
- package/dist/clients/vercel.d.ts +82 -0
- package/dist/clients/vercel.d.ts.map +1 -0
- package/dist/clients/vercel.js +363 -0
- package/dist/clients/vercel.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +165 -0
- package/dist/index.js.map +1 -0
- package/dist/orchestrator.d.ts +44 -0
- package/dist/orchestrator.d.ts.map +1 -0
- package/dist/orchestrator.js +201 -0
- package/dist/orchestrator.js.map +1 -0
- package/dist/services/bundles.d.ts +42 -0
- package/dist/services/bundles.d.ts.map +1 -0
- package/dist/services/bundles.js +213 -0
- package/dist/services/bundles.js.map +1 -0
- package/dist/services/license.d.ts +39 -0
- package/dist/services/license.d.ts.map +1 -0
- package/dist/services/license.js +103 -0
- package/dist/services/license.js.map +1 -0
- package/dist/services/mongodb.d.ts +21 -0
- package/dist/services/mongodb.d.ts.map +1 -0
- package/dist/services/mongodb.js +161 -0
- package/dist/services/mongodb.js.map +1 -0
- package/dist/utils/credentials.d.ts +26 -0
- package/dist/utils/credentials.d.ts.map +1 -0
- package/dist/utils/credentials.js +176 -0
- package/dist/utils/credentials.js.map +1 -0
- package/package.json +56 -0
package/README.md
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# @curatedreels/deploy
|
|
2
|
+
|
|
3
|
+
White-label deployment CLI for CuratedReels - Deploy to customer's infrastructure without exposing source code.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This CLI tool allows customers to deploy CuratedReels to their own infrastructure (Vercel, Deno Deploy, MongoDB) using pre-compiled bundles, without seeing or modifying the source code.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g @curatedreels/deploy
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
curatedreels-deploy
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The CLI will guide you through:
|
|
22
|
+
1. License verification
|
|
23
|
+
2. Infrastructure credentials collection
|
|
24
|
+
3. Bundle download
|
|
25
|
+
4. Automated deployment
|
|
26
|
+
|
|
27
|
+
## Required Accounts
|
|
28
|
+
|
|
29
|
+
Customers need:
|
|
30
|
+
- ✅ [Vercel](https://vercel.com) account + API token
|
|
31
|
+
- ✅ [Deno Deploy](https://deno.com/deploy) account + access token
|
|
32
|
+
- ✅ [MongoDB Atlas](https://mongodb.com/atlas) cluster + connection URI
|
|
33
|
+
- ✅ [Telegram Bot](https://t.me/botfather) token
|
|
34
|
+
- ✅ Valid CuratedReels license key
|
|
35
|
+
|
|
36
|
+
## Optional Services
|
|
37
|
+
|
|
38
|
+
- [Cloudinary](https://cloudinary.com) - For video uploads
|
|
39
|
+
- [YouTube Data API](https://developers.google.com/youtube/v3) - For metadata extraction
|
|
40
|
+
|
|
41
|
+
## What Gets Deployed
|
|
42
|
+
|
|
43
|
+
### Vercel (2 projects)
|
|
44
|
+
1. **Frontend** - Public-facing web app
|
|
45
|
+
2. **CMS/Admin** - PayloadCMS admin panel + API
|
|
46
|
+
|
|
47
|
+
### Deno Deploy (1 project)
|
|
48
|
+
3. **Bot** - Telegram bot worker
|
|
49
|
+
|
|
50
|
+
### MongoDB Atlas
|
|
51
|
+
- Creates database collections
|
|
52
|
+
- Sets up indexes
|
|
53
|
+
- Seeds initial data
|
|
54
|
+
|
|
55
|
+
## Architecture
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
Customer's Infrastructure:
|
|
59
|
+
├── Vercel
|
|
60
|
+
│ ├── Frontend (Next.js)
|
|
61
|
+
│ └── CMS (Next.js + PayloadCMS)
|
|
62
|
+
├── Deno Deploy
|
|
63
|
+
│ └── Bot (Telegram worker)
|
|
64
|
+
└── MongoDB Atlas
|
|
65
|
+
└── Database
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Deployment Process
|
|
69
|
+
|
|
70
|
+
1. **License Verification** - Validates license key
|
|
71
|
+
2. **Credential Collection** - Interactive prompts for API tokens
|
|
72
|
+
3. **Bundle Download** - Downloads pre-compiled bundles (authenticated)
|
|
73
|
+
4. **Checksum Verification** - Ensures bundle integrity
|
|
74
|
+
5. **Deployment** - Deploys to all services
|
|
75
|
+
6. **Configuration** - Sets up environment variables
|
|
76
|
+
7. **Health Check** - Verifies all services are running
|
|
77
|
+
|
|
78
|
+
## Security
|
|
79
|
+
|
|
80
|
+
- ✅ Pre-compiled bundles only (no source code)
|
|
81
|
+
- ✅ License-gated downloads
|
|
82
|
+
- ✅ Checksum verification
|
|
83
|
+
- ✅ Encrypted credentials
|
|
84
|
+
- ✅ API token validation
|
|
85
|
+
|
|
86
|
+
## Bundle Contents
|
|
87
|
+
|
|
88
|
+
### frontend.zip
|
|
89
|
+
- Next.js production build (`.next/`)
|
|
90
|
+
- Static assets (`public/`)
|
|
91
|
+
- Package.json (dependencies only)
|
|
92
|
+
|
|
93
|
+
### cms.zip
|
|
94
|
+
- Next.js production build
|
|
95
|
+
- PayloadCMS compiled code
|
|
96
|
+
- Package.json (dependencies only)
|
|
97
|
+
|
|
98
|
+
### bot.js
|
|
99
|
+
- Single bundled Deno executable
|
|
100
|
+
- All dependencies included
|
|
101
|
+
- Obfuscated code
|
|
102
|
+
|
|
103
|
+
### schema.json
|
|
104
|
+
- MongoDB collection schemas
|
|
105
|
+
- Index definitions
|
|
106
|
+
- Seed data structure
|
|
107
|
+
|
|
108
|
+
## Environment Variables
|
|
109
|
+
|
|
110
|
+
Auto-configured during deployment:
|
|
111
|
+
|
|
112
|
+
**Frontend:**
|
|
113
|
+
```env
|
|
114
|
+
NEXT_PUBLIC_PAYLOAD_API_URL=<cms-url>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**CMS:**
|
|
118
|
+
```env
|
|
119
|
+
MONGODB_URI=<customer-mongo-uri>
|
|
120
|
+
NEXT_PUBLIC_FRONTEND_URL=<frontend-url>
|
|
121
|
+
TELEGRAM_BOT_TOKEN=<customer-bot-token>
|
|
122
|
+
CLOUDINARY_*=<customer-cloudinary-creds>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Bot:**
|
|
126
|
+
```env
|
|
127
|
+
TELEGRAM_BOT_TOKEN=<customer-bot-token>
|
|
128
|
+
MONGODB_URI=<customer-mongo-uri>
|
|
129
|
+
PAYLOAD_API_URL=<cms-url>
|
|
130
|
+
CLOUDINARY_*=<customer-cloudinary-creds>
|
|
131
|
+
YOUTUBE_API_KEY=<customer-youtube-key>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Troubleshooting
|
|
135
|
+
|
|
136
|
+
### License Issues
|
|
137
|
+
```
|
|
138
|
+
Error: Invalid license key
|
|
139
|
+
```
|
|
140
|
+
**Solution:** Ensure you have an active CuratedReels license. Purchase at https://curatedreels.com/pricing
|
|
141
|
+
|
|
142
|
+
### Vercel Deployment Fails
|
|
143
|
+
```
|
|
144
|
+
Error: Vercel API authentication failed
|
|
145
|
+
```
|
|
146
|
+
**Solution:** Verify your Vercel API token. Get it from https://vercel.com/account/tokens
|
|
147
|
+
|
|
148
|
+
### MongoDB Connection Fails
|
|
149
|
+
```
|
|
150
|
+
Error: MongoDB authentication failed
|
|
151
|
+
```
|
|
152
|
+
**Solution:**
|
|
153
|
+
1. Check your connection string format
|
|
154
|
+
2. Verify IP whitelist in MongoDB Atlas
|
|
155
|
+
3. Confirm database user has read/write permissions
|
|
156
|
+
|
|
157
|
+
### Bundle Download Fails
|
|
158
|
+
```
|
|
159
|
+
Error: Failed to download bundles
|
|
160
|
+
```
|
|
161
|
+
**Solution:**
|
|
162
|
+
1. Check your internet connection
|
|
163
|
+
2. Verify license key is valid and not expired
|
|
164
|
+
3. Ensure you haven't exceeded deployment limits
|
|
165
|
+
|
|
166
|
+
## Support
|
|
167
|
+
|
|
168
|
+
- 📚 Documentation: https://docs.curatedreels.com
|
|
169
|
+
- 💬 Support: support@curatedreels.com
|
|
170
|
+
- 🐛 Issues: https://github.com/curatedreels/deploy-cli/issues
|
|
171
|
+
|
|
172
|
+
## License
|
|
173
|
+
|
|
174
|
+
Proprietary - © CuratedReels 2026
|
|
175
|
+
|
|
176
|
+
This tool is licensed software. Source code is not included in the distributed bundles.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deno Deploy Client
|
|
3
|
+
*
|
|
4
|
+
* Deploys Deno applications to Deno Deploy using deployctl CLI
|
|
5
|
+
*/
|
|
6
|
+
export interface DenoDeploymentOptions {
|
|
7
|
+
projectName: string;
|
|
8
|
+
entrypoint: string;
|
|
9
|
+
envVars: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
export declare class DenoClient {
|
|
12
|
+
private token;
|
|
13
|
+
private org?;
|
|
14
|
+
private baseUrl;
|
|
15
|
+
constructor(token: string, org?: string | undefined);
|
|
16
|
+
/**
|
|
17
|
+
* Deploy a project to Deno Deploy using deployctl
|
|
18
|
+
*/
|
|
19
|
+
deploy(options: DenoDeploymentOptions): Promise<string>;
|
|
20
|
+
/**
|
|
21
|
+
* Deploy using deployctl CLI
|
|
22
|
+
*/
|
|
23
|
+
private deployWithCLI;
|
|
24
|
+
/**
|
|
25
|
+
* Ensure project exists (create if not)
|
|
26
|
+
*/
|
|
27
|
+
private ensureProject;
|
|
28
|
+
/**
|
|
29
|
+
* Get project by name
|
|
30
|
+
*/
|
|
31
|
+
private getProject;
|
|
32
|
+
/**
|
|
33
|
+
* Create a new project
|
|
34
|
+
*/
|
|
35
|
+
private createProject;
|
|
36
|
+
/**
|
|
37
|
+
* Set environment variables
|
|
38
|
+
*/
|
|
39
|
+
setEnvironmentVariables(projectId: string, envVars: Record<string, string>): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Update project settings
|
|
42
|
+
*/
|
|
43
|
+
updateProject(projectId: string, settings: {
|
|
44
|
+
name?: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
}): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* List all deployments for a project
|
|
49
|
+
*/
|
|
50
|
+
listDeployments(projectId: string): Promise<any[]>;
|
|
51
|
+
/**
|
|
52
|
+
* Delete a project
|
|
53
|
+
*/
|
|
54
|
+
deleteProject(projectId: string): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Get request headers
|
|
57
|
+
*/
|
|
58
|
+
private getHeaders;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=deno.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deno.d.ts","sourceRoot":"","sources":["../../src/clients/deno.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,MAAM,WAAW,qBAAqB;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAClC;AAED,qBAAa,UAAU;IAIf,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,GAAG,CAAC;IAJhB,OAAO,CAAC,OAAO,CAA8B;gBAGjC,KAAK,EAAE,MAAM,EACb,GAAG,CAAC,EAAE,MAAM,YAAA;IAGxB;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC;IAc7D;;OAEG;YACW,aAAa;IA2B3B;;OAEG;YACW,aAAa;IAS3B;;OAEG;YACW,UAAU;IAcxB;;OAEG;YACW,aAAa;IAuB3B;;OAEG;IACG,uBAAuB,CACzB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,OAAO,CAAC,IAAI,CAAC;IAoBhB;;OAEG;IACG,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE;QAC7C,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,WAAW,CAAC,EAAE,MAAM,CAAA;KACvB,GAAG,OAAO,CAAC,IAAI,CAAC;IAejB;;OAEG;IACG,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAexD;;OAEG;IACG,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAcrD;;OAEG;IACH,OAAO,CAAC,UAAU;CAMrB"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deno Deploy Client
|
|
3
|
+
*
|
|
4
|
+
* Deploys Deno applications to Deno Deploy using deployctl CLI
|
|
5
|
+
*/
|
|
6
|
+
import fetch from 'node-fetch';
|
|
7
|
+
import { exec } from 'child_process';
|
|
8
|
+
import { promisify } from 'util';
|
|
9
|
+
const execAsync = promisify(exec);
|
|
10
|
+
export class DenoClient {
|
|
11
|
+
token;
|
|
12
|
+
org;
|
|
13
|
+
baseUrl = 'https://dash.deno.com/api';
|
|
14
|
+
constructor(token, org) {
|
|
15
|
+
this.token = token;
|
|
16
|
+
this.org = org;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Deploy a project to Deno Deploy using deployctl
|
|
20
|
+
*/
|
|
21
|
+
async deploy(options) {
|
|
22
|
+
// Step 1: Ensure project exists
|
|
23
|
+
const projectName = await this.ensureProject(options.projectName);
|
|
24
|
+
// Step 2: Deploy using deployctl from the bot directory
|
|
25
|
+
// entrypoint should be a directory containing deno.json and src/main.ts
|
|
26
|
+
const url = await this.deployWithCLI(projectName, options.entrypoint);
|
|
27
|
+
// Step 3: Set environment variables
|
|
28
|
+
await this.setEnvironmentVariables(projectName, options.envVars);
|
|
29
|
+
return url;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Deploy using deployctl CLI
|
|
33
|
+
*/
|
|
34
|
+
async deployWithCLI(projectName, deployDir) {
|
|
35
|
+
const deployctlPath = `${process.env.HOME}/.deno/bin/deployctl`;
|
|
36
|
+
try {
|
|
37
|
+
const { stdout, stderr } = await execAsync(`cd "${deployDir}" && DENO_DEPLOY_TOKEN=${this.token} "${deployctlPath}" deploy --project=${projectName} --entrypoint=src/main.ts --prod 2>&1`, { timeout: 300000 } // 5 minute timeout
|
|
38
|
+
);
|
|
39
|
+
const output = stdout + stderr;
|
|
40
|
+
// Extract deployment URL
|
|
41
|
+
const urlMatch = output.match(/https:\/\/[^\s]+\.deno\.dev/);
|
|
42
|
+
if (urlMatch) {
|
|
43
|
+
return urlMatch[0];
|
|
44
|
+
}
|
|
45
|
+
throw new Error(`Could not extract deployment URL: ${output.slice(0, 500)}`);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
// If deployctl not found, try installing it
|
|
49
|
+
if (error.message?.includes('ENOENT') || error.message?.includes('not found')) {
|
|
50
|
+
throw new Error('deployctl not found. Please install Deno and run: deno install -Arf jsr:@deno/deployctl');
|
|
51
|
+
}
|
|
52
|
+
throw new Error(`Deno Deploy failed: ${error.message}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Ensure project exists (create if not)
|
|
57
|
+
*/
|
|
58
|
+
async ensureProject(name) {
|
|
59
|
+
try {
|
|
60
|
+
const project = await this.getProject(name);
|
|
61
|
+
return project.name; // Return name for deployctl
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return await this.createProject(name);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Get project by name
|
|
69
|
+
*/
|
|
70
|
+
async getProject(name) {
|
|
71
|
+
const url = `${this.baseUrl}/projects/${name}`;
|
|
72
|
+
const response = await fetch(url, {
|
|
73
|
+
headers: this.getHeaders()
|
|
74
|
+
});
|
|
75
|
+
if (!response.ok) {
|
|
76
|
+
throw new Error(`Project not found: ${name}`);
|
|
77
|
+
}
|
|
78
|
+
return await response.json();
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Create a new project
|
|
82
|
+
*/
|
|
83
|
+
async createProject(name) {
|
|
84
|
+
const url = `${this.baseUrl}/projects`;
|
|
85
|
+
const body = { name };
|
|
86
|
+
if (this.org) {
|
|
87
|
+
body.organizationId = this.org;
|
|
88
|
+
}
|
|
89
|
+
const response = await fetch(url, {
|
|
90
|
+
method: 'POST',
|
|
91
|
+
headers: this.getHeaders(),
|
|
92
|
+
body: JSON.stringify(body)
|
|
93
|
+
});
|
|
94
|
+
if (!response.ok) {
|
|
95
|
+
const error = await response.text();
|
|
96
|
+
throw new Error(`Failed to create project: ${error}`);
|
|
97
|
+
}
|
|
98
|
+
const project = await response.json();
|
|
99
|
+
return project.name; // Return name for deployctl
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Set environment variables
|
|
103
|
+
*/
|
|
104
|
+
async setEnvironmentVariables(projectId, envVars) {
|
|
105
|
+
const url = `${this.baseUrl}/projects/${projectId}/env`;
|
|
106
|
+
const variables = Object.entries(envVars).map(([key, value]) => ({
|
|
107
|
+
key,
|
|
108
|
+
value
|
|
109
|
+
}));
|
|
110
|
+
const response = await fetch(url, {
|
|
111
|
+
method: 'PATCH',
|
|
112
|
+
headers: this.getHeaders(),
|
|
113
|
+
body: JSON.stringify({ variables })
|
|
114
|
+
});
|
|
115
|
+
if (!response.ok) {
|
|
116
|
+
const error = await response.text();
|
|
117
|
+
throw new Error(`Failed to set environment variables: ${error}`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Update project settings
|
|
122
|
+
*/
|
|
123
|
+
async updateProject(projectId, settings) {
|
|
124
|
+
const url = `${this.baseUrl}/projects/${projectId}`;
|
|
125
|
+
const response = await fetch(url, {
|
|
126
|
+
method: 'PATCH',
|
|
127
|
+
headers: this.getHeaders(),
|
|
128
|
+
body: JSON.stringify(settings)
|
|
129
|
+
});
|
|
130
|
+
if (!response.ok) {
|
|
131
|
+
const error = await response.text();
|
|
132
|
+
throw new Error(`Failed to update project: ${error}`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* List all deployments for a project
|
|
137
|
+
*/
|
|
138
|
+
async listDeployments(projectId) {
|
|
139
|
+
const url = `${this.baseUrl}/projects/${projectId}/deployments`;
|
|
140
|
+
const response = await fetch(url, {
|
|
141
|
+
headers: this.getHeaders()
|
|
142
|
+
});
|
|
143
|
+
if (!response.ok) {
|
|
144
|
+
throw new Error('Failed to list deployments');
|
|
145
|
+
}
|
|
146
|
+
const data = await response.json();
|
|
147
|
+
return data.deployments || [];
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Delete a project
|
|
151
|
+
*/
|
|
152
|
+
async deleteProject(projectId) {
|
|
153
|
+
const url = `${this.baseUrl}/projects/${projectId}`;
|
|
154
|
+
const response = await fetch(url, {
|
|
155
|
+
method: 'DELETE',
|
|
156
|
+
headers: this.getHeaders()
|
|
157
|
+
});
|
|
158
|
+
if (!response.ok) {
|
|
159
|
+
const error = await response.text();
|
|
160
|
+
throw new Error(`Failed to delete project: ${error}`);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Get request headers
|
|
165
|
+
*/
|
|
166
|
+
getHeaders() {
|
|
167
|
+
return {
|
|
168
|
+
'Authorization': `Bearer ${this.token}`,
|
|
169
|
+
'Content-Type': 'application/json'
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=deno.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deno.js","sourceRoot":"","sources":["../../src/clients/deno.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,YAAY,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CA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C;IAED;;OAEG;IACH,KAAK,CAAC,aAAa,CAAC,SAAiB;QACjC,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,aAAa,SAAS,EAAE,CAAA;QAEnD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAC9B,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE;SAC7B,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACf,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;YACnC,MAAM,IAAI,KAAK,CAAC,6BAA6B,KAAK,EAAE,CAAC,CAAA;QACzD,CAAC;IACL,CAAC;IAED;;OAEG;IACK,UAAU;QACd,OAAO;YACH,eAAe,EAAE,UAAU,IAAI,CAAC,KAAK,EAAE;YACvC,cAAc,EAAE,kBAAkB;SACrC,CAAA;IACL,CAAC;CACJ"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vercel API Client
|
|
3
|
+
*
|
|
4
|
+
* Deploys Next.js applications to Vercel using CLI for pre-built deployments
|
|
5
|
+
*/
|
|
6
|
+
export interface VercelDeploymentOptions {
|
|
7
|
+
projectName: string;
|
|
8
|
+
bundlePath: string;
|
|
9
|
+
envVars: Record<string, string>;
|
|
10
|
+
framework: 'nextjs' | 'static';
|
|
11
|
+
}
|
|
12
|
+
export declare class VercelClient {
|
|
13
|
+
private token;
|
|
14
|
+
private teamId?;
|
|
15
|
+
private baseUrl;
|
|
16
|
+
constructor(token: string, teamId?: string | undefined);
|
|
17
|
+
/**
|
|
18
|
+
* Deploy a project to Vercel using CLI pre-built deployment
|
|
19
|
+
*/
|
|
20
|
+
deploy(options: VercelDeploymentOptions): Promise<string>;
|
|
21
|
+
/**
|
|
22
|
+
* Deploy using Vercel CLI with pre-built output
|
|
23
|
+
*/
|
|
24
|
+
private deployWithCLI;
|
|
25
|
+
/**
|
|
26
|
+
* Ensure project exists (create if not)
|
|
27
|
+
*/
|
|
28
|
+
private ensureProject;
|
|
29
|
+
/**
|
|
30
|
+
* Get project by name
|
|
31
|
+
*/
|
|
32
|
+
private getProject;
|
|
33
|
+
/**
|
|
34
|
+
* Create a new project
|
|
35
|
+
*/
|
|
36
|
+
private createProject;
|
|
37
|
+
/**
|
|
38
|
+
* Collect all files from bundle directory
|
|
39
|
+
*/
|
|
40
|
+
private collectFiles;
|
|
41
|
+
/**
|
|
42
|
+
* Create a deployment
|
|
43
|
+
*/
|
|
44
|
+
private createDeployment;
|
|
45
|
+
/**
|
|
46
|
+
* Wait for deployment to complete
|
|
47
|
+
*/
|
|
48
|
+
private waitForDeployment;
|
|
49
|
+
/**
|
|
50
|
+
* Set environment variables for a project
|
|
51
|
+
*/
|
|
52
|
+
setEnvironmentVariables(projectId: string, envVars: Record<string, string>): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Create or update a single environment variable
|
|
55
|
+
*/
|
|
56
|
+
private createEnvironmentVariable;
|
|
57
|
+
/**
|
|
58
|
+
* Update an existing environment variable
|
|
59
|
+
*/
|
|
60
|
+
private updateEnvironmentVariable;
|
|
61
|
+
/**
|
|
62
|
+
* Update existing environment variables
|
|
63
|
+
*/
|
|
64
|
+
updateEnvironmentVariables(projectName: string, envVars: Record<string, string>): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Trigger a redeployment
|
|
67
|
+
*/
|
|
68
|
+
private triggerRedeployment;
|
|
69
|
+
/**
|
|
70
|
+
* Add a custom domain to a project
|
|
71
|
+
*/
|
|
72
|
+
addDomain(projectName: string, domain: string): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Build API URL with team parameter
|
|
75
|
+
*/
|
|
76
|
+
private buildUrl;
|
|
77
|
+
/**
|
|
78
|
+
* Get request headers
|
|
79
|
+
*/
|
|
80
|
+
private getHeaders;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=vercel.d.ts.map
|
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