datasync-asset-store

작성자: contentstack

파일시스템 자산 저장소를 위한 공개 API 및 DataSync 통합 — 시작, FSAssetStore, config, 자산 경로에 사용합니다.

npx skills add https://github.com/contentstack/datasync-asset-store-filesystem --skill datasync-asset-store

DataSync asset store API – DataSync Asset Store Filesystem

When to use

  • Implementing or changing how assets are downloaded, stored, or removed on disk
  • Wiring this package into DataSync Manager (setAssetStore)
  • Debugging URL parsing, baseDir, or path patterns

Instructions

  • Entry: Consumers typically require('@contentstack/datasync-asset-store-filesystem') and pass the module to DataSync Manager; the package main is ./dist (compiled from src/index.ts).
  • Lifecycle: Call start(config) to get a Promise that resolves to an FSAssetStore instance. setConfig / getConfig hold merged config; assetStoreInstance is exported for the active instance after start.
  • Class: FSAssetStore (src/filesystem.ts) implements download/unpublish flows using undici for HTTP, fs for writes, and helpers from src/index.ts for paths.
  • Path helpers: getAssetLocation and getFileLocation build directory/file paths from asset URLs and assetStore config (pattern, patternWithBranch, optional assetFolderPrefixKey). Contentstack asset hostnames are matched via regex in src/index.ts.
  • Defaults: defaultConfig in src/config.ts — e.g. assetStore.baseDir: './_contents', pattern and patternWithBranch for folder layout. Merge with app config as in the README example.
  • Cross-module config: README documents content-store-filesystem.baseDir alongside this module; keep docs aligned when changing default paths.
  • Errors: User-facing strings and errors are centralized in src/messages.ts where applicable.

contentstack의 다른 스킬

cms-assets
contentstack
개발자에게 Contentstack에서 자산을 구성, 전달, 변환하는 방법에 대해 조언합니다. 폴더 구조, Image Delivery API 변환, 게시를 다룹니다...
cms-branches-aliases
contentstack
개발자에게 콘텐츠 개발 격리를 위한 Contentstack 브랜치와 무중단 콘텐츠 배포를 위한 별칭 사용에 대해 조언합니다. 브랜치 전략, …
cms-data-modeling-best-practices
contentstack
개발자들이 Contentstack에서 가장 간단하고 재사용 가능한 구조로 콘텐츠를 모델링하도록 안내합니다. 이 스킬은 콘텐츠 유형, 참조, 전역 필드를 언제 사용해야 하는지 설명합니다.
cms-live-preview-visual-builder-support-assistant
contentstack
Contentstack Live Preview 및 Visual Builder 구현을 진단하고 안내합니다. 미리보기 컨텍스트를 추적하고, 손상된 계약을 식별하며, 다음을 권장합니다…
cms-releases
contentstack
개발자들이 Contentstack Releases를 사용하여 조정되고 원자적인 콘텐츠 배포를 수행하는 방법에 대해 조언합니다. 릴리스 생성, 항목 관리, 단계적 배포 등을 다룹니다. …
cms-roles-permissions
contentstack
개발자들에게 Contentstack에서 역할, 권한, 팀, 토큰 액세스를 설계하는 방법을 조언합니다. 기본 제공 역할, 사용자 지정 역할, 권한 병합 등을 설명합니다.
cms-taxonomy
contentstack
개발자들에게 Contentstack Taxonomy를 구조화되고 계층적인 콘텐츠 분류 및 전달 측 필터링에 사용하는 방법에 대해 조언합니다. 분류 체계와 태그의 차이 등을 다룹니다…
cms-tokens-authentication
contentstack
개발자에게 프론트엔드, 백엔드, 자동화, 타사 앱 사용 사례에 적합한 Contentstack 인증 방법과 토큰 유형 선택에 대해 조언합니다.…