import { BaseResource } from './BaseResource.js'; import type { RequestOptions } from '../types/common.js'; import type { PluginDeployParams, PluginDeployResult, PluginInstantiateParams, PluginInstantiateResult, PluginMountParams, PluginMountResult, PluginUnmountParams, PluginInstance, PluginInstanceListResult, PluginDeploymentDetails, PluginListResult, PluginMountPointListResult, PluginDetails, DeployDirectoryParams, DeployDirectoryResult, ConfigureSplitParams, ConfigureSplitResult } from '../types/plugins.js'; /** * Plugins V2 — deploy HTML/JS/CSS pages, instantiate them for stores, * and mount them to custom domains or aliases. */ export declare class Plugins extends BaseResource { /** * Deploy a local build directory to TagadaPay's CDN in one call. * * Handles everything automatically: file collection, MIME type detection, * base64 encoding, instantiation, and mounting to a CDN hostname. * Builds up to ~3.5 MB are uploaded inline; larger builds are automatically * zipped and uploaded via Vercel Blob (up to 50 MB). * * @example * ```ts * const result = await tagada.plugins.deployDirectory({ * directory: './dist', * storeId: 'store_xxx', * name: 'my-store', * }); * console.log(result.url); // https://my-store--store_xxx.cdn.tagada.io/ * ``` */ deployDirectory(params: DeployDirectoryParams, opts?: RequestOptions): Promise; /** * Create a ZIP archive from raw file buffers using only Node.js built-ins. * Uses the STORE method (no compression) for speed — the files are already * minified JS/CSS/images, so deflate savings are minimal. */ private _createZipBuffer; /** * Upload a ZIP buffer to Vercel Blob using the two-step client upload protocol. * Step 1: POST to generate-upload-token to get a signed clientToken. * Step 2: PUT the ZIP to the Vercel Blob API with that token. */ private _uploadZipToBlob; /** * Deploy a plugin with inline assets (HTML, JS, CSS as base64) or * from a ZIP URL. Returns a deploymentId used for instantiation and mounting. */ deploy(params: PluginDeployParams, opts?: RequestOptions): Promise; /** * Create an instance of a deployed plugin for a specific store. */ instantiate(params: PluginInstantiateParams, opts?: RequestOptions): Promise; /** * List all instances for a store. * Optionally filter by deploymentId. */ listInstances(storeId: string, deploymentId?: string, opts?: RequestOptions): Promise; /** * Retrieve a single instance by ID. */ retrieveInstance(instanceId: string, opts?: RequestOptions): Promise; /** * Retrieve deployment details (version, pages, instances). * Does not require storeId — deployments are global. */ retrieveDeployment(deploymentId: string, opts?: RequestOptions): Promise; /** * Mount a plugin deployment/instance to a custom domain or alias. */ mount(params: PluginMountParams, opts?: RequestOptions): Promise; /** * Unmount a plugin from a domain or alias. */ unmount(params: PluginUnmountParams, opts?: RequestOptions): Promise<{ success: boolean; message: string; }>; /** * Configure A/B split testing on an existing route. * * @example Weighted 50/50 split * ```ts * await tagada.plugins.configureSplit({ * routeId: 'route_xxx', * storeId: 'store_xxx', * splitConfig: { * type: 'weighted', * instances: [ * { instanceId: 'inst_a', deploymentId: 'dep_a', weight: 50 }, * { instanceId: 'inst_b', deploymentId: 'dep_b', weight: 50 }, * ], * }, * }); * ``` */ configureSplit(params: ConfigureSplitParams, opts?: RequestOptions): Promise; /** * List all plugins for a store. */ list(storeId: string, opts?: RequestOptions): Promise; /** * List mount points for a store. */ listMountPoints(storeId: string, opts?: RequestOptions): Promise; /** * Get detailed info about a plugin. */ details(pluginId: string, storeId: string, opts?: RequestOptions): Promise; /** * @deprecated Use retrieveDeployment() instead — it doesn't require storeId. */ deploymentDetails(deploymentId: string, storeId: string, opts?: RequestOptions): Promise; /** * Delete a plugin and all its deployments. */ del(pluginId: string, storeId: string, opts?: RequestOptions): Promise; /** * Delete a specific deployment. */ deleteDeployment(deploymentId: string, storeId: string, opts?: RequestOptions): Promise; } //# sourceMappingURL=Plugins.d.ts.map