@oaysus/cli 0.1.13 → 0.1.15
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 +35 -12
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +151 -85
- package/dist/cli.js.map +1 -1
- package/dist/components/App.d.ts +26 -10
- package/dist/components/App.d.ts.map +1 -1
- package/dist/components/App.js +23 -8
- package/dist/components/App.js.map +1 -1
- package/dist/components/SlashCommands.js +1 -1
- package/dist/lib/push.d.ts.map +1 -1
- package/dist/lib/push.js +29 -1
- package/dist/lib/push.js.map +1 -1
- package/dist/lib/shared/commands.d.ts +11 -1
- package/dist/lib/shared/commands.d.ts.map +1 -1
- package/dist/lib/shared/commands.js +55 -13
- package/dist/lib/shared/commands.js.map +1 -1
- package/dist/lib/shared/uploader.d.ts +1 -0
- package/dist/lib/shared/uploader.d.ts.map +1 -1
- package/dist/lib/shared/uploader.js +4 -2
- package/dist/lib/shared/uploader.js.map +1 -1
- package/dist/lib/site/asset-puller.d.ts +93 -0
- package/dist/lib/site/asset-puller.d.ts.map +1 -0
- package/dist/lib/site/asset-puller.js +376 -0
- package/dist/lib/site/asset-puller.js.map +1 -0
- package/dist/lib/site/asset-resolver.d.ts +44 -0
- package/dist/lib/site/asset-resolver.d.ts.map +1 -0
- package/dist/lib/site/asset-resolver.js +225 -0
- package/dist/lib/site/asset-resolver.js.map +1 -0
- package/dist/lib/site/asset-uploader.d.ts +58 -0
- package/dist/lib/site/asset-uploader.d.ts.map +1 -0
- package/dist/lib/site/asset-uploader.js +261 -0
- package/dist/lib/site/asset-uploader.js.map +1 -0
- package/dist/lib/site/index.d.ts +14 -0
- package/dist/lib/site/index.d.ts.map +1 -0
- package/dist/lib/site/index.js +15 -0
- package/dist/lib/site/index.js.map +1 -0
- package/dist/lib/site/metadata.d.ts +99 -0
- package/dist/lib/site/metadata.d.ts.map +1 -0
- package/dist/lib/site/metadata.js +470 -0
- package/dist/lib/site/metadata.js.map +1 -0
- package/dist/lib/site/page-publisher.d.ts +51 -0
- package/dist/lib/site/page-publisher.d.ts.map +1 -0
- package/dist/lib/site/page-publisher.js +460 -0
- package/dist/lib/site/page-publisher.js.map +1 -0
- package/dist/lib/site/page-puller.d.ts +93 -0
- package/dist/lib/site/page-puller.d.ts.map +1 -0
- package/dist/lib/site/page-puller.js +346 -0
- package/dist/lib/site/page-puller.js.map +1 -0
- package/dist/lib/site/page-validator.d.ts +29 -0
- package/dist/lib/site/page-validator.d.ts.map +1 -0
- package/dist/lib/site/page-validator.js +282 -0
- package/dist/lib/site/page-validator.js.map +1 -0
- package/dist/lib/site/project-loader.d.ts +45 -0
- package/dist/lib/site/project-loader.d.ts.map +1 -0
- package/dist/lib/site/project-loader.js +276 -0
- package/dist/lib/site/project-loader.js.map +1 -0
- package/dist/lib/site/shared-component-resolver.d.ts +89 -0
- package/dist/lib/site/shared-component-resolver.d.ts.map +1 -0
- package/dist/lib/site/shared-component-resolver.js +222 -0
- package/dist/lib/site/shared-component-resolver.js.map +1 -0
- package/dist/screens/WelcomeScreen.d.ts +26 -10
- package/dist/screens/WelcomeScreen.d.ts.map +1 -1
- package/dist/screens/WelcomeScreen.js +44 -21
- package/dist/screens/WelcomeScreen.js.map +1 -1
- package/dist/screens/site/SiteInitScreen.d.ts +12 -0
- package/dist/screens/site/SiteInitScreen.d.ts.map +1 -0
- package/dist/screens/site/SiteInitScreen.js +282 -0
- package/dist/screens/site/SiteInitScreen.js.map +1 -0
- package/dist/screens/site/SitePublishScreen.d.ts +15 -0
- package/dist/screens/site/SitePublishScreen.d.ts.map +1 -0
- package/dist/screens/site/SitePublishScreen.js +330 -0
- package/dist/screens/site/SitePublishScreen.js.map +1 -0
- package/dist/screens/site/SitePullScreen.d.ts +14 -0
- package/dist/screens/site/SitePullScreen.d.ts.map +1 -0
- package/dist/screens/site/SitePullScreen.js +455 -0
- package/dist/screens/site/SitePullScreen.js.map +1 -0
- package/dist/screens/site/SiteValidateScreen.d.ts +12 -0
- package/dist/screens/site/SiteValidateScreen.d.ts.map +1 -0
- package/dist/screens/site/SiteValidateScreen.js +201 -0
- package/dist/screens/site/SiteValidateScreen.js.map +1 -0
- package/dist/types/site.d.ts +348 -0
- package/dist/types/site.d.ts.map +1 -0
- package/dist/types/site.js +6 -0
- package/dist/types/site.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asset Uploader
|
|
3
|
+
* Uploads local assets to the DAM (Digital Asset Manager)
|
|
4
|
+
* Also maintains the local assets.json manifest for sync tracking
|
|
5
|
+
*/
|
|
6
|
+
import type { AssetReference, ResolvedAsset, UploadedAssetInfo } from '../../types/site.js';
|
|
7
|
+
/**
|
|
8
|
+
* Upload progress callback
|
|
9
|
+
*/
|
|
10
|
+
export type AssetUploadProgressCallback = (current: number, total: number, filename: string) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Upload result for a single asset
|
|
13
|
+
*/
|
|
14
|
+
export interface AssetUploadResult {
|
|
15
|
+
localPath: string;
|
|
16
|
+
r2Url: string;
|
|
17
|
+
/** Full asset info from DAM (includes id, width, height, etc.) */
|
|
18
|
+
assetInfo?: UploadedAssetInfo;
|
|
19
|
+
/** Content hash for manifest tracking */
|
|
20
|
+
contentHash?: string;
|
|
21
|
+
/** Content type */
|
|
22
|
+
contentType?: string;
|
|
23
|
+
/** File size in bytes */
|
|
24
|
+
sizeInBytes?: number;
|
|
25
|
+
success: boolean;
|
|
26
|
+
error?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Upload a single asset to the DAM
|
|
30
|
+
*/
|
|
31
|
+
export declare function uploadAsset(assetRef: AssetReference, projectPath: string, options: {
|
|
32
|
+
websiteId: string;
|
|
33
|
+
jwt: string;
|
|
34
|
+
}): Promise<AssetUploadResult>;
|
|
35
|
+
/**
|
|
36
|
+
* Upload multiple assets and return a mapping of local paths to R2 URLs
|
|
37
|
+
* Also updates the local assets.json manifest to track uploaded assets
|
|
38
|
+
*/
|
|
39
|
+
export declare function uploadAssets(assets: AssetReference[], projectPath: string, options?: {
|
|
40
|
+
websiteId?: string;
|
|
41
|
+
jwt?: string;
|
|
42
|
+
onProgress?: AssetUploadProgressCallback;
|
|
43
|
+
updateManifest?: boolean;
|
|
44
|
+
}): Promise<{
|
|
45
|
+
assetMap: Map<string, UploadedAssetInfo>;
|
|
46
|
+
results: AssetUploadResult[];
|
|
47
|
+
successCount: number;
|
|
48
|
+
errorCount: number;
|
|
49
|
+
}>;
|
|
50
|
+
/**
|
|
51
|
+
* Convert AssetReferences to ResolvedAssets after upload
|
|
52
|
+
*/
|
|
53
|
+
export declare function resolveAssets(assets: AssetReference[], uploadResults: AssetUploadResult[], projectPath: string): ResolvedAsset[];
|
|
54
|
+
/**
|
|
55
|
+
* Format upload results for display
|
|
56
|
+
*/
|
|
57
|
+
export declare function formatUploadResults(results: AssetUploadResult[]): string[];
|
|
58
|
+
//# sourceMappingURL=asset-uploader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset-uploader.d.ts","sourceRoot":"","sources":["../../../src/lib/site/asset-uploader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,iBAAiB,EAGlB,MAAM,qBAAqB,CAAC;AAa7B;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,CACxC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;AAEV;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,cAAc,EACxB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE;IACP,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;CACb,GACA,OAAO,CAAC,iBAAiB,CAAC,CAiH5B;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,cAAc,EAAE,EACxB,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE;IACP,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,2BAA2B,CAAC;IACzC,cAAc,CAAC,EAAE,OAAO,CAAC;CACrB,GACL,OAAO,CAAC;IACT,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACzC,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CA4FD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,cAAc,EAAE,EACxB,aAAa,EAAE,iBAAiB,EAAE,EAClC,WAAW,EAAE,MAAM,GAClB,aAAa,EAAE,CAkCjB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,EAAE,GAAG,MAAM,EAAE,CAmB1E"}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asset Uploader
|
|
3
|
+
* Uploads local assets to the DAM (Digital Asset Manager)
|
|
4
|
+
* Also maintains the local assets.json manifest for sync tracking
|
|
5
|
+
*/
|
|
6
|
+
import fs from 'fs/promises';
|
|
7
|
+
import path from 'path';
|
|
8
|
+
import axios from 'axios';
|
|
9
|
+
import * as crypto from 'crypto';
|
|
10
|
+
import { loadCredentials } from '../shared/auth.js';
|
|
11
|
+
import { SSO_BASE_URL, debug } from '../shared/config.js';
|
|
12
|
+
import { resolveAssetPath, getAssetInfo } from './asset-resolver.js';
|
|
13
|
+
import { loadAssetManifest, saveAssetManifest } from './metadata.js';
|
|
14
|
+
/**
|
|
15
|
+
* Compute SHA-256 hash of a buffer
|
|
16
|
+
*/
|
|
17
|
+
function computeHash(buffer) {
|
|
18
|
+
return crypto.createHash('sha256').update(buffer).digest('hex');
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Upload a single asset to the DAM
|
|
22
|
+
*/
|
|
23
|
+
export async function uploadAsset(assetRef, projectPath, options) {
|
|
24
|
+
const { websiteId, jwt } = options;
|
|
25
|
+
// Get asset info
|
|
26
|
+
const assetInfo = await getAssetInfo(assetRef, projectPath);
|
|
27
|
+
if (!assetInfo) {
|
|
28
|
+
return {
|
|
29
|
+
localPath: assetRef.localPath,
|
|
30
|
+
r2Url: '',
|
|
31
|
+
success: false,
|
|
32
|
+
error: `Asset file not found: ${assetRef.localPath}`,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
// Read file and encode as base64
|
|
36
|
+
let fileData;
|
|
37
|
+
let contentHash;
|
|
38
|
+
try {
|
|
39
|
+
const buffer = await fs.readFile(assetInfo.absolutePath);
|
|
40
|
+
fileData = buffer.toString('base64');
|
|
41
|
+
contentHash = computeHash(buffer);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
return {
|
|
45
|
+
localPath: assetRef.localPath,
|
|
46
|
+
r2Url: '',
|
|
47
|
+
success: false,
|
|
48
|
+
error: `Failed to read file: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
// Extract filename from path
|
|
52
|
+
const filename = path.basename(assetInfo.absolutePath);
|
|
53
|
+
// Upload to DAM
|
|
54
|
+
const url = `${SSO_BASE_URL}/hosting/dam/assets/upload`;
|
|
55
|
+
debug('Uploading asset:', filename);
|
|
56
|
+
debug('API URL:', url);
|
|
57
|
+
debug('Content-Type:', assetInfo.contentType);
|
|
58
|
+
debug('Size:', assetInfo.size);
|
|
59
|
+
try {
|
|
60
|
+
const response = await axios.post(url, {
|
|
61
|
+
websiteId,
|
|
62
|
+
filename,
|
|
63
|
+
fileData,
|
|
64
|
+
contentType: assetInfo.contentType,
|
|
65
|
+
title: filename,
|
|
66
|
+
}, {
|
|
67
|
+
headers: {
|
|
68
|
+
Authorization: `Bearer ${jwt}`,
|
|
69
|
+
'Content-Type': 'application/json',
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
if (response.data.success && response.data.asset) {
|
|
73
|
+
const damAsset = response.data.asset;
|
|
74
|
+
return {
|
|
75
|
+
localPath: assetRef.localPath,
|
|
76
|
+
r2Url: damAsset.url,
|
|
77
|
+
assetInfo: {
|
|
78
|
+
id: damAsset.id,
|
|
79
|
+
url: damAsset.url,
|
|
80
|
+
width: damAsset.width,
|
|
81
|
+
height: damAsset.height,
|
|
82
|
+
alt: damAsset.altText || '',
|
|
83
|
+
assetAlt: damAsset.altText || '',
|
|
84
|
+
},
|
|
85
|
+
contentHash: damAsset.contentHash || contentHash,
|
|
86
|
+
contentType: assetInfo.contentType,
|
|
87
|
+
sizeInBytes: assetInfo.size,
|
|
88
|
+
success: true,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
localPath: assetRef.localPath,
|
|
93
|
+
r2Url: '',
|
|
94
|
+
success: false,
|
|
95
|
+
error: response.data.error || 'Upload failed',
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
let errorMessage = 'Upload failed';
|
|
100
|
+
if (axios.isAxiosError(error)) {
|
|
101
|
+
const status = error.response?.status;
|
|
102
|
+
const data = error.response?.data;
|
|
103
|
+
if (status === 403) {
|
|
104
|
+
errorMessage = data?.error || 'Storage limit exceeded';
|
|
105
|
+
}
|
|
106
|
+
else if (status === 413) {
|
|
107
|
+
errorMessage = 'File too large (max 10MB)';
|
|
108
|
+
}
|
|
109
|
+
else if (status === 401) {
|
|
110
|
+
errorMessage = 'Authentication failed. Please run "oaysus login"';
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
errorMessage = data?.error || data?.detail?.error || error.message;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
else if (error instanceof Error) {
|
|
117
|
+
errorMessage = error.message;
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
localPath: assetRef.localPath,
|
|
121
|
+
r2Url: '',
|
|
122
|
+
success: false,
|
|
123
|
+
error: errorMessage,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Upload multiple assets and return a mapping of local paths to R2 URLs
|
|
129
|
+
* Also updates the local assets.json manifest to track uploaded assets
|
|
130
|
+
*/
|
|
131
|
+
export async function uploadAssets(assets, projectPath, options = {}) {
|
|
132
|
+
const { updateManifest = true } = options;
|
|
133
|
+
// Get credentials if not provided
|
|
134
|
+
let websiteId = options.websiteId;
|
|
135
|
+
let jwt = options.jwt;
|
|
136
|
+
if (!websiteId || !jwt) {
|
|
137
|
+
const credentials = await loadCredentials();
|
|
138
|
+
if (!credentials) {
|
|
139
|
+
throw new Error('Not authenticated. Run "oaysus login" first.');
|
|
140
|
+
}
|
|
141
|
+
websiteId = websiteId || credentials.websiteId;
|
|
142
|
+
jwt = jwt || credentials.jwt;
|
|
143
|
+
}
|
|
144
|
+
if (!websiteId) {
|
|
145
|
+
throw new Error('No website ID found. Set websiteId in oaysus.website.json or run "oaysus login"');
|
|
146
|
+
}
|
|
147
|
+
// Deduplicate assets by local path
|
|
148
|
+
const uniquePaths = new Set();
|
|
149
|
+
const uniqueAssets = [];
|
|
150
|
+
for (const asset of assets) {
|
|
151
|
+
if (!uniquePaths.has(asset.localPath)) {
|
|
152
|
+
uniquePaths.add(asset.localPath);
|
|
153
|
+
uniqueAssets.push(asset);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
// Load existing manifest for updates
|
|
157
|
+
let manifest = null;
|
|
158
|
+
if (updateManifest) {
|
|
159
|
+
manifest = await loadAssetManifest(projectPath);
|
|
160
|
+
}
|
|
161
|
+
// Upload each asset
|
|
162
|
+
const results = [];
|
|
163
|
+
const assetMap = new Map();
|
|
164
|
+
let successCount = 0;
|
|
165
|
+
let errorCount = 0;
|
|
166
|
+
for (let i = 0; i < uniqueAssets.length; i++) {
|
|
167
|
+
const asset = uniqueAssets[i];
|
|
168
|
+
const filename = path.basename(asset.localPath);
|
|
169
|
+
// Report progress
|
|
170
|
+
if (options.onProgress) {
|
|
171
|
+
options.onProgress(i + 1, uniqueAssets.length, filename);
|
|
172
|
+
}
|
|
173
|
+
// Upload
|
|
174
|
+
const result = await uploadAsset(asset, projectPath, {
|
|
175
|
+
websiteId: websiteId,
|
|
176
|
+
jwt: jwt,
|
|
177
|
+
});
|
|
178
|
+
results.push(result);
|
|
179
|
+
if (result.success && result.assetInfo) {
|
|
180
|
+
assetMap.set(asset.localPath, result.assetInfo);
|
|
181
|
+
successCount++;
|
|
182
|
+
// Update manifest with uploaded asset
|
|
183
|
+
if (manifest && result.contentHash) {
|
|
184
|
+
manifest.assets[filename] = {
|
|
185
|
+
url: result.r2Url,
|
|
186
|
+
contentType: result.contentType || 'application/octet-stream',
|
|
187
|
+
sizeInBytes: result.sizeInBytes || 0,
|
|
188
|
+
width: result.assetInfo.width,
|
|
189
|
+
height: result.assetInfo.height,
|
|
190
|
+
altText: result.assetInfo.alt || undefined,
|
|
191
|
+
contentHash: result.contentHash,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
errorCount++;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
// Save updated manifest
|
|
200
|
+
if (manifest && successCount > 0) {
|
|
201
|
+
await saveAssetManifest(projectPath, manifest);
|
|
202
|
+
}
|
|
203
|
+
return {
|
|
204
|
+
assetMap,
|
|
205
|
+
results,
|
|
206
|
+
successCount,
|
|
207
|
+
errorCount,
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Convert AssetReferences to ResolvedAssets after upload
|
|
212
|
+
*/
|
|
213
|
+
export function resolveAssets(assets, uploadResults, projectPath) {
|
|
214
|
+
const resolved = [];
|
|
215
|
+
const resultMap = new Map(uploadResults
|
|
216
|
+
.filter(r => r.success)
|
|
217
|
+
.map(r => [r.localPath, r.r2Url]));
|
|
218
|
+
for (const asset of assets) {
|
|
219
|
+
const r2Url = resultMap.get(asset.localPath);
|
|
220
|
+
if (!r2Url)
|
|
221
|
+
continue;
|
|
222
|
+
// Get asset info synchronously (we already validated these exist)
|
|
223
|
+
const absolutePath = resolveAssetPath(asset, projectPath);
|
|
224
|
+
const ext = path.extname(absolutePath).toLowerCase();
|
|
225
|
+
const contentTypeMap = {
|
|
226
|
+
'.jpg': 'image/jpeg',
|
|
227
|
+
'.jpeg': 'image/jpeg',
|
|
228
|
+
'.png': 'image/png',
|
|
229
|
+
'.gif': 'image/gif',
|
|
230
|
+
'.webp': 'image/webp',
|
|
231
|
+
'.svg': 'image/svg+xml',
|
|
232
|
+
};
|
|
233
|
+
resolved.push({
|
|
234
|
+
...asset,
|
|
235
|
+
r2Url,
|
|
236
|
+
contentType: contentTypeMap[ext] || 'application/octet-stream',
|
|
237
|
+
size: 0, // Size is captured during upload
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
return resolved;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Format upload results for display
|
|
244
|
+
*/
|
|
245
|
+
export function formatUploadResults(results) {
|
|
246
|
+
const lines = [];
|
|
247
|
+
const successful = results.filter(r => r.success);
|
|
248
|
+
const failed = results.filter(r => !r.success);
|
|
249
|
+
if (successful.length > 0) {
|
|
250
|
+
lines.push(`✓ Uploaded ${successful.length} assets`);
|
|
251
|
+
}
|
|
252
|
+
if (failed.length > 0) {
|
|
253
|
+
lines.push('');
|
|
254
|
+
lines.push('Failed uploads:');
|
|
255
|
+
for (const result of failed) {
|
|
256
|
+
lines.push(` ✗ ${result.localPath}: ${result.error}`);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return lines;
|
|
260
|
+
}
|
|
261
|
+
//# sourceMappingURL=asset-uploader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset-uploader.js","sourceRoot":"","sources":["../../../src/lib/site/asset-uploader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAQjC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAErE;;GAEG;AACH,SAAS,WAAW,CAAC,MAAc;IACjC,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAClE,CAAC;AA6BD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,QAAwB,EACxB,WAAmB,EACnB,OAGC;IAED,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;IAEnC,iBAAiB;IACjB,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IAE5D,IAAI,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CAAC,CAAC,OAAO,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAE/C,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,KAAK,CAAC,IAAI,CAAC,cAAc,UAAU,CAAC,MAAM,SAAS,CAAC,CAAC;IACvD,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC9B,KAAK,MAAM,MAAM,IAAI,MAAM,EAAE,CAAC;YAC5B,KAAK,CAAC,IAAI,CAAC,OAAO,MAAM,CAAC,SAAS,KAAK,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Site Library
|
|
3
|
+
* Utilities for website project management and publishing
|
|
4
|
+
*/
|
|
5
|
+
export * from './project-loader.js';
|
|
6
|
+
export * from './asset-resolver.js';
|
|
7
|
+
export * from './page-validator.js';
|
|
8
|
+
export * from './asset-uploader.js';
|
|
9
|
+
export * from './page-publisher.js';
|
|
10
|
+
export * from './page-puller.js';
|
|
11
|
+
export * from './asset-puller.js';
|
|
12
|
+
export * from './shared-component-resolver.js';
|
|
13
|
+
export { ensureOaysusDir, hasOaysusMetadata, loadConfig, saveConfig, getWebsiteId, loadComponentCatalog, saveComponentCatalog, syncComponentCatalog, isCatalogStale, componentExists, findComponent, isDefaultShared, getSuggestions, loadAssetManifest, saveAssetManifest, migrateLegacyConfig, initializeMetadata, formatCatalogForDisplay, } from './metadata.js';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/site/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gCAAgC,CAAC;AAG/C,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,aAAa,EACb,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Site Library
|
|
3
|
+
* Utilities for website project management and publishing
|
|
4
|
+
*/
|
|
5
|
+
export * from './project-loader.js';
|
|
6
|
+
export * from './asset-resolver.js';
|
|
7
|
+
export * from './page-validator.js';
|
|
8
|
+
export * from './asset-uploader.js';
|
|
9
|
+
export * from './page-publisher.js';
|
|
10
|
+
export * from './page-puller.js';
|
|
11
|
+
export * from './asset-puller.js';
|
|
12
|
+
export * from './shared-component-resolver.js';
|
|
13
|
+
// Selectively export from metadata to avoid conflicts with project-loader
|
|
14
|
+
export { ensureOaysusDir, hasOaysusMetadata, loadConfig, saveConfig, getWebsiteId, loadComponentCatalog, saveComponentCatalog, syncComponentCatalog, isCatalogStale, componentExists, findComponent, isDefaultShared, getSuggestions, loadAssetManifest, saveAssetManifest, migrateLegacyConfig, initializeMetadata, formatCatalogForDisplay, } from './metadata.js';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/site/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gCAAgC,CAAC;AAE/C,0EAA0E;AAC1E,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,aAAa,EACb,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Metadata Manager
|
|
3
|
+
* Handles the .oaysus/ directory containing project metadata:
|
|
4
|
+
* - config.json: Project configuration (websiteId, etc.)
|
|
5
|
+
* - components.json: Component catalog with schemas
|
|
6
|
+
* - assets.json: Asset manifest for sync tracking
|
|
7
|
+
*/
|
|
8
|
+
import type { OaysusConfig, ComponentCatalog, CatalogComponent, AssetManifest, ComponentCatalogSyncResult, MetadataInitResult } from '../../types/site.js';
|
|
9
|
+
/**
|
|
10
|
+
* Ensure the .oaysus directory exists
|
|
11
|
+
*/
|
|
12
|
+
export declare function ensureOaysusDir(projectPath: string): Promise<string>;
|
|
13
|
+
/**
|
|
14
|
+
* Check if a project has .oaysus metadata
|
|
15
|
+
*/
|
|
16
|
+
export declare function hasOaysusMetadata(projectPath: string): Promise<boolean>;
|
|
17
|
+
/**
|
|
18
|
+
* Find project root by looking for .oaysus/ directory
|
|
19
|
+
* Falls back to oaysus.website.json for backward compatibility
|
|
20
|
+
*/
|
|
21
|
+
export declare function findProjectRoot(startPath?: string): Promise<string | null>;
|
|
22
|
+
/**
|
|
23
|
+
* Load project config from .oaysus/config.json
|
|
24
|
+
*/
|
|
25
|
+
export declare function loadConfig(projectPath: string): Promise<OaysusConfig | null>;
|
|
26
|
+
/**
|
|
27
|
+
* Save project config to .oaysus/config.json
|
|
28
|
+
*/
|
|
29
|
+
export declare function saveConfig(projectPath: string, config: OaysusConfig): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Get websiteId from config or credentials
|
|
32
|
+
*/
|
|
33
|
+
export declare function getWebsiteId(projectPath: string): Promise<string | null>;
|
|
34
|
+
/**
|
|
35
|
+
* Load component catalog from .oaysus/components.json
|
|
36
|
+
*/
|
|
37
|
+
export declare function loadComponentCatalog(projectPath: string): Promise<ComponentCatalog | null>;
|
|
38
|
+
/**
|
|
39
|
+
* Save component catalog to .oaysus/components.json
|
|
40
|
+
*/
|
|
41
|
+
export declare function saveComponentCatalog(projectPath: string, catalog: ComponentCatalog): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Fetch components from server and build catalog
|
|
44
|
+
*/
|
|
45
|
+
export declare function syncComponentCatalog(options: {
|
|
46
|
+
projectPath: string;
|
|
47
|
+
websiteId?: string;
|
|
48
|
+
jwt?: string;
|
|
49
|
+
force?: boolean;
|
|
50
|
+
}): Promise<ComponentCatalogSyncResult>;
|
|
51
|
+
/**
|
|
52
|
+
* Check if component catalog is stale (older than threshold)
|
|
53
|
+
* Can take either a ComponentCatalog object or a project path
|
|
54
|
+
*/
|
|
55
|
+
export declare function isCatalogStale(catalogOrPath: ComponentCatalog | string, maxAgeMs?: number): Promise<boolean>;
|
|
56
|
+
/**
|
|
57
|
+
* Check if a component type exists in the catalog
|
|
58
|
+
*/
|
|
59
|
+
export declare function componentExists(catalog: ComponentCatalog, componentType: string): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Find a component in the catalog by type
|
|
62
|
+
*/
|
|
63
|
+
export declare function findComponent(catalog: ComponentCatalog, componentType: string): CatalogComponent | null;
|
|
64
|
+
/**
|
|
65
|
+
* Check if a component type should be shared by default
|
|
66
|
+
*/
|
|
67
|
+
export declare function isDefaultShared(catalog: ComponentCatalog, componentType: string): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Get suggestions for a misspelled component type
|
|
70
|
+
*/
|
|
71
|
+
export declare function getSuggestions(catalog: ComponentCatalog, componentType: string, maxSuggestions?: number): string[];
|
|
72
|
+
/**
|
|
73
|
+
* Load asset manifest from .oaysus/assets.json
|
|
74
|
+
*/
|
|
75
|
+
export declare function loadAssetManifest(projectPath: string): Promise<AssetManifest>;
|
|
76
|
+
/**
|
|
77
|
+
* Save asset manifest to .oaysus/assets.json
|
|
78
|
+
*/
|
|
79
|
+
export declare function saveAssetManifest(projectPath: string, manifest: AssetManifest): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Migrate from legacy oaysus.website.json to .oaysus/
|
|
82
|
+
*/
|
|
83
|
+
export declare function migrateLegacyConfig(projectPath: string): Promise<boolean>;
|
|
84
|
+
/**
|
|
85
|
+
* Initialize .oaysus/ metadata for a project
|
|
86
|
+
*/
|
|
87
|
+
export declare function initializeMetadata(options: {
|
|
88
|
+
projectPath: string;
|
|
89
|
+
websiteId: string;
|
|
90
|
+
websiteName?: string;
|
|
91
|
+
subdomain?: string;
|
|
92
|
+
syncComponents?: boolean;
|
|
93
|
+
jwt?: string;
|
|
94
|
+
}): Promise<MetadataInitResult>;
|
|
95
|
+
/**
|
|
96
|
+
* Format component catalog for display
|
|
97
|
+
*/
|
|
98
|
+
export declare function formatCatalogForDisplay(catalog: ComponentCatalog): string[];
|
|
99
|
+
//# sourceMappingURL=metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../src/lib/site/metadata.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAEhB,gBAAgB,EACh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