feat(media): implement integrated media manager with sidebar and picker
- Implement DriveService and ShopifyMediaService for backend operations - Create MediaSidebar.html with premium UI and auto-polling - Integrate Google Picker API for robust file selection - Orchestrate sync logic via MediaService (Drive -> Staged Upload -> Shopify) - Add secure config handling for API keys and tokens - Update ppsscript.json with required OAuth scopes - Update MEMORY.md and README.md with architecture details
This commit is contained in:
29
src/services/MockShopifyMediaService.ts
Normal file
29
src/services/MockShopifyMediaService.ts
Normal file
@ -0,0 +1,29 @@
|
||||
import { IShopifyMediaService } from "../interfaces/IShopifyMediaService"
|
||||
|
||||
export class MockShopifyMediaService implements IShopifyMediaService {
|
||||
stagedUploadsCreate(input: any[]): any {
|
||||
return {
|
||||
stagedTargets: input.map(i => ({
|
||||
url: "https://mock-upload.shopify.com",
|
||||
resourceUrl: `https://mock-resource.shopify.com/${i.filename}`,
|
||||
parameters: []
|
||||
})),
|
||||
userErrors: []
|
||||
}
|
||||
}
|
||||
|
||||
productCreateMedia(productId: string, media: any[]): any {
|
||||
return {
|
||||
media: media.map(m => ({
|
||||
alt: m.alt,
|
||||
mediaContentType: m.mediaContentType,
|
||||
status: "PROCESSING"
|
||||
})),
|
||||
mediaUserErrors: [],
|
||||
product: {
|
||||
id: productId,
|
||||
title: "Mock Product"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user