UNPKG

@takashito/linode-mcp-server

Version:

MCP server for Linode API

174 lines 12.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.cancelObjectStorageSchema = exports.listObjectStorageTypesSchema = exports.getTransferStatsSchema = exports.getObjectStorageQuotaUsageSchema = exports.getObjectStorageQuotaSchema = exports.listObjectStorageQuotasSchema = exports.putBucketAccessSchema = exports.getObjectACLSchema = exports.listBucketsInRegionSchema = exports.deleteObjectSchema = exports.downloadObjectSchema = exports.uploadObjectSchema = exports.getObjectURLSchema = exports.updateObjectACLSchema = exports.deleteKeySchema = exports.updateKeySchema = exports.createKeySchema = exports.getKeySchema = exports.listKeysSchema = exports.deleteBucketCertificateSchema = exports.uploadBucketCertificateSchema = exports.getBucketCertificateSchema = exports.listObjectsSchema = exports.updateBucketAccessSchema = exports.getBucketAccessSchema = exports.deleteBucketSchema = exports.createBucketSchema = exports.getBucketSchema = exports.listBucketsSchema = exports.listEndpointsSchema = void 0; const zod_1 = require("zod"); const schemas_1 = require("../common/schemas"); // Endpoints exports.listEndpointsSchema = zod_1.z.object({ ...schemas_1.pagingParamsSchema.shape }); // Buckets exports.listBucketsSchema = zod_1.z.object({}); exports.getBucketSchema = zod_1.z.object({ region: zod_1.z.string().describe('The region where the bucket is located (e.g., us-east, us-west)'), bucket: zod_1.z.string().describe('The name of the bucket'), }); exports.createBucketSchema = zod_1.z.object({ label: zod_1.z.string().describe('The label for the bucket. Must be 3-63 alphanumeric characters, dashes (-), or dots (.). Cannot end in a dash and cannot use two consecutive dashes. Cannot start or end with a dot, and cannot use two consecutive dots. Must be globally unique within the region.'), region: zod_1.z.string().describe('The region where the bucket will be created (e.g., us-east, us-west). Use List Clusters to get available regions.'), endpoint_type: zod_1.z.enum(['E0', 'E1', 'E2', 'E3']).optional() .describe('The type of S3 endpoint available to the user in this region. E0 typically provides public access, while E2/E3 may support additional features like HTTPS or custom domains. Check available endpoint types for your region with List Object Storage Endpoints.'), acl: zod_1.z.enum(['private', 'public-read', 'authenticated-read', 'public-read-write']).optional() .describe('The Access Control Level for the bucket. Defaults to private.'), cors_enabled: (0, schemas_1.coerceBoolean)().optional().describe('Whether CORS is enabled for the bucket. Defaults to false.'), }); exports.deleteBucketSchema = zod_1.z.object({ region: zod_1.z.string().describe('The region where the bucket is located (e.g., us-east, us-west)'), bucket: zod_1.z.string().describe('The name of the bucket'), }); exports.getBucketAccessSchema = zod_1.z.object({ region: zod_1.z.string().describe('The region where the bucket is located (e.g., us-east, us-west)'), bucket: zod_1.z.string().describe('The name of the bucket'), }); exports.updateBucketAccessSchema = zod_1.z.object({ region: zod_1.z.string().describe('The region where the bucket is located (e.g., us-east, us-west)'), bucket: zod_1.z.string().describe('The name of the bucket'), acl: zod_1.z.enum(['private', 'public-read', 'authenticated-read', 'public-read-write']).optional() .describe('The Access Control Level for the bucket'), cors_enabled: (0, schemas_1.coerceBoolean)().optional().describe('Whether CORS is enabled for the bucket'), }); // Objects exports.listObjectsSchema = zod_1.z.object({ region: zod_1.z.string().describe('The region where the bucket is located (e.g., us-east, us-west)'), bucket: zod_1.z.string().describe('The name of the bucket'), ...schemas_1.paginationSchema.shape }); // SSL/TLS certificates exports.getBucketCertificateSchema = zod_1.z.object({ region: zod_1.z.string().describe('The region where the bucket is located (e.g., us-east, us-west)'), bucket: zod_1.z.string().describe('The name of the bucket'), }); exports.uploadBucketCertificateSchema = zod_1.z.object({ region: zod_1.z.string().describe('The region where the bucket is located (e.g., us-east, us-west)'), bucket: zod_1.z.string().describe('The name of the bucket'), certificate: zod_1.z.string().describe('The SSL/TLS certificate in PEM format. Must be a valid certificate that matches the bucket\'s domain.'), private_key: zod_1.z.string().describe('The private key for the certificate in PEM format. Must be the corresponding private key for the certificate.'), }); exports.deleteBucketCertificateSchema = zod_1.z.object({ region: zod_1.z.string().describe('The region where the bucket is located (e.g., us-east, us-west)'), bucket: zod_1.z.string().describe('The name of the bucket'), }); // Access keys exports.listKeysSchema = zod_1.z.object({ ...schemas_1.paginationSchema.shape }); exports.getKeySchema = zod_1.z.object({ id: zod_1.z.coerce.number().describe('The ID of the Object Storage key'), }); exports.createKeySchema = zod_1.z.object({ label: zod_1.z.string().describe('The label for the Object Storage key. Used for identification and must be unique.'), bucket_access: zod_1.z.array(zod_1.z.object({ region: zod_1.z.string().describe('The region of the bucket. Must be a valid region ID from List region.'), bucket_name: zod_1.z.string().describe('The name of the bucket. Must be an existing bucket in the specified cluster.'), permissions: zod_1.z.enum(['read_only', 'read_write']).describe('The permissions for this bucket. read_only allows GET operations only, read_write allows all operations.'), })).optional().describe('Bucket access configuration for this key. When specified, the key will only have access to the listed buckets with the specified permissions. If omitted, the key will have full access to all buckets.'), regions: zod_1.z.array(zod_1.z.string()).optional().describe('The regions where the key will be allowed to create new buckets.'), }); exports.updateKeySchema = zod_1.z.object({ id: zod_1.z.coerce.number().describe('The ID of the Object Storage key'), label: zod_1.z.string().optional().describe('The new label for the Object Storage key'), bucket_access: zod_1.z.array(zod_1.z.object({ region: zod_1.z.string().describe('The region of the bucket. Must be a valid region ID from List region.'), bucket_name: zod_1.z.string().describe('The name of the bucket'), permissions: zod_1.z.enum(['read_only', 'read_write']).describe('The permissions for this bucket'), })).optional().describe('Updated bucket access configuration for this key'), }); exports.deleteKeySchema = zod_1.z.object({ id: zod_1.z.coerce.number().describe('The ID of the Object Storage key'), }); // Object ACL Management exports.updateObjectACLSchema = zod_1.z.object({ region: zod_1.z.string().describe('The region where the bucket is located (e.g., us-east, us-west)'), bucket: zod_1.z.string().describe('The name of the bucket'), name: zod_1.z.string().describe('The name of the object to update ACL for'), acl: zod_1.z.enum(['private', 'public-read', 'authenticated-read', 'public-read-write', 'custom']) .describe('The Access Control Level for the object') }); // Object URL Generation exports.getObjectURLSchema = zod_1.z.object({ region: zod_1.z.string().describe('The region where the bucket is located (e.g., us-east, us-west)'), bucket: zod_1.z.string().describe('The name of the bucket'), name: zod_1.z.string().describe('The name of the object to generate a URL for'), method: zod_1.z.enum(['GET', 'PUT', 'POST', 'DELETE']).optional() .describe('The HTTP method for the URL. Defaults to GET.'), expires_in: zod_1.z.coerce.number().optional() .describe('The number of seconds the URL will be valid. Defaults to 3600 (1 hour).'), content_type: zod_1.z.string().optional() .describe('The Content-Type header for the object when using PUT. Only applies to PUT requests.'), content_disposition: zod_1.z.string().optional() .describe('The Content-Disposition header for the object. Only applies to GET and PUT requests.') }); // Upload Object exports.uploadObjectSchema = zod_1.z.object({ region: zod_1.z.string().describe('The region where the bucket is located (e.g., us-east, us-west)'), bucket: zod_1.z.string().describe('The name of the bucket'), object_path: zod_1.z.string().describe('The path for the object in the bucket (e.g., "folder/file.txt" or just "file.txt")'), source: zod_1.z.string().describe('The source data: local file path, raw string content, or URL'), content_type: zod_1.z.string().optional().describe('The content type of the object (e.g., "text/plain", "image/jpeg")'), acl: zod_1.z.enum(['private', 'public-read', 'authenticated-read', 'public-read-write', 'custom']).optional() .describe('The Access Control Level for the object. If not provided, bucket default is used.'), expires_in: zod_1.z.coerce.number().optional().describe('How long the signed URL should be valid in seconds. Default: 3600 (1 hour)') }); // Download Object exports.downloadObjectSchema = zod_1.z.object({ region: zod_1.z.string().describe('The region where the bucket is located (e.g., us-east, us-west)'), bucket: zod_1.z.string().describe('The name of the bucket'), object_path: zod_1.z.string().describe('The path of the object to download (e.g., "folder/file.txt" or just "file.txt")'), destination: zod_1.z.string().optional().describe('Local file path where the object should be saved. If not provided, saves to current working directory.'), expires_in: zod_1.z.coerce.number().optional().describe('How long the signed URL should be valid in seconds. Default: 3600 (1 hour)') }); // Delete Object exports.deleteObjectSchema = zod_1.z.object({ region: zod_1.z.string().describe('The region where the bucket is located (e.g., us-east, us-west)'), bucket: zod_1.z.string().describe('The name of the bucket'), object_path: zod_1.z.string().describe('The path of the object to delete (e.g., "folder/file.txt" or just "file.txt")'), expires_in: zod_1.z.coerce.number().optional().describe('How long the signed URL should be valid in seconds. Default: 3600 (1 hour)') }); // Per-region bucket listing exports.listBucketsInRegionSchema = zod_1.z.object({ regionId: zod_1.z.string().describe('The region ID to list buckets for (e.g., us-east, us-west)'), ...schemas_1.pagingParamsSchema.shape }); // Object ACL Get exports.getObjectACLSchema = zod_1.z.object({ regionId: zod_1.z.string().describe('The region where the bucket is located (e.g., us-east, us-west)'), bucket: zod_1.z.string().describe('The name of the bucket'), name: zod_1.z.string().describe('The name of the object to get ACL configuration for'), }); // Bucket Access Update (PUT) exports.putBucketAccessSchema = zod_1.z.object({ regionId: zod_1.z.string().describe('The region where the bucket is located (e.g., us-east, us-west)'), bucket: zod_1.z.string().describe('The name of the bucket'), acl: zod_1.z.string().optional() .describe('The Access Control Level for the bucket (e.g., private, public-read, authenticated-read, public-read-write)'), cors_enabled: (0, schemas_1.coerceBoolean)().optional().describe('Whether CORS is enabled for the bucket'), }); // Object Storage Quotas exports.listObjectStorageQuotasSchema = zod_1.z.object({ ...schemas_1.pagingParamsSchema.shape }); exports.getObjectStorageQuotaSchema = zod_1.z.object({ objQuotaId: zod_1.z.string().describe('The ID of the Object Storage quota'), }); exports.getObjectStorageQuotaUsageSchema = zod_1.z.object({ objQuotaId: zod_1.z.string().describe('The ID of the Object Storage quota'), }); // Transfer Statistics exports.getTransferStatsSchema = zod_1.z.object({}); // Object Storage Types exports.listObjectStorageTypesSchema = zod_1.z.object({}); // Service exports.cancelObjectStorageSchema = zod_1.z.object({ id: zod_1.z.coerce.number().describe('The ID of the Object Storage service to cancel') }); //# sourceMappingURL=schemas.js.map