Developer Preview — This project is in active development. APIs may change. Provide feedback
Skip to content

@salesforce/b2c-tooling-sdk / operations/content / detectMetaDefinitionType

Function: detectMetaDefinitionType()

detectMetaDefinitionType(data, filePath?): "image" | "pagetype" | "componenttype" | "aspecttype" | "cmsrecord" | "customeditortype" | "contentassetpageconfig" | "contentassetcomponentconfig" | "contentassetstructuredcontentdata" | null

Defined in: packages/b2c-tooling-sdk/src/operations/content/validate.ts:129

Detect the metadefinition schema type using a 3-tier strategy:

  1. File path convention (if filePath provided)
  2. Property heuristics from data
  3. Returns null if neither works (caller should use explicit --type or throw)

Parameters

data

Record<string, unknown>

filePath?

string

Returns

"image" | "pagetype" | "componenttype" | "aspecttype" | "cmsrecord" | "customeditortype" | "contentassetpageconfig" | "contentassetcomponentconfig" | "contentassetstructuredcontentdata" | null

Released under the Apache-2.0 License.