Skip to content

CruxExperts/LocalSetup / ls/skills/ls-backblaze-b2-storage

ls-backblaze-b2-storage

Verified

Safely plan and execute Backblaze B2 S3-compatible storage operations and B2 native bucket, key, and notification administration.

scripts/lib/ls_backblaze/native_response_shapes.py

View on GitHub
"""Safe native administration result fields from the reviewed B2 v4 reference."""
from __future__ import annotations

from .request_shapes import obj, array, string, integer

TEXT = {"type": "string"}
NULL_TEXT = {"type": ["string", "null"]}
BOOL = {"type": "boolean"}
INT = {"type": "integer"}
STRINGS = array(TEXT)
ALLOWED = obj({"buckets": {"type": ["array", "null"], "items": obj({"id": TEXT, "name": NULL_TEXT}, ("id", "name"))}, "capabilities": STRINGS, "namePrefix": NULL_TEXT}, ("capabilities",))
STORAGE = obj({"allowed": ALLOWED, "apiUrl": TEXT, "downloadUrl": TEXT, "s3ApiUrl": TEXT, "absoluteMinimumPartSize": INT, "recommendedPartSize": INT})
AUTH = obj({"account_id": TEXT, "allowed": ALLOWED, "api_info": obj({"storageApi": STORAGE})}, ("account_id", "allowed", "api_info"))
RETENTION = obj({"mode": NULL_TEXT, "period": {"oneOf": [{"type": "null"}, obj({"duration": INT, "unit": TEXT})]}})
ENCRYPTION = obj({"isClientAuthorizedToRead": BOOL, "value": obj({"mode": NULL_TEXT, "algorithm": NULL_TEXT})})
CORS = obj({"corsRuleName": TEXT, "allowedOrigins": STRINGS, "allowedHeaders": STRINGS, "allowedOperations": STRINGS, "exposeHeaders": STRINGS, "maxAgeSeconds": INT})
LIFECYCLE = obj({"fileNamePrefix": TEXT, "lifecycleRuleId": TEXT, **{name: {"type": ["integer", "null"]} for name in ("daysFromHidingToDeleting", "daysFromUploadingToHiding", "daysFromStartingToCancelingUnfinishedLargeFiles")}})
BUCKET = obj({"accountId": TEXT, "bucketId": TEXT, "bucketName": TEXT, "bucketType": TEXT, "bucketInfo": {"type": "object", "additionalProperties": True}, "corsRules": array(CORS), "lifecycleRules": array(LIFECYCLE), "revision": INT, "options": STRINGS, "defaultServerSideEncryption": ENCRYPTION, "fileLockConfiguration": obj({"isClientAuthorizedToRead": BOOL, "value": obj({"defaultRetention": RETENTION, "isFileLockEnabled": BOOL})})}, ("bucketId",))
KEY = obj({"accountId": TEXT, "applicationKeyId": TEXT, "keyName": TEXT, "capabilities": STRINGS, "expirationTimestamp": {"type": ["integer", "null"]}, "bucketIds": {"type": ["array", "null"], "items": TEXT}, "namePrefix": NULL_TEXT, "options": STRINGS}, ("applicationKeyId",))
TARGET = obj({"targetType": TEXT, "url": TEXT, "maxEventsPerBatch": INT})
RULE = obj({"name": TEXT, "eventTypes": STRINGS, "isEnabled": BOOL, "objectNamePrefix": TEXT, "targetConfiguration": TARGET, "isSuspended": BOOL, "suspensionReason": NULL_TEXT})
NOTIFICATIONS = array(obj({"bucketId": TEXT, "eventNotificationRules": array(RULE)}, ("bucketId", "eventNotificationRules")))


def payload(name: str, *, secret: bool = False):
    if name == "AuthorizeAccount":
        return AUTH
    if name in {"GetNotificationRules", "SetNotificationRules"}:
        return NOTIFICATIONS
    if name == "ListBuckets":
        return obj({"buckets": array(BUCKET)}, ("buckets",))
    if name == "ListKeys":
        return obj({"keys": array(KEY), "nextApplicationKeyId": NULL_TEXT}, ("keys",))
    if name in {"CreateKey", "DeleteKey"}:
        if name == "CreateKey" and secret:
            return {**KEY, "properties": {**KEY["properties"], "applicationKey": TEXT}}
        return KEY
    return BUCKET
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 196kUpdated Claude CodeCodexVerifiedInstall