Options
All
  • Public
  • Public/Protected
  • All
Menu

contentful-management.js - v5.26.5

Index

Type aliases

ApiKeyProps

ApiKeyProps: { accessToken: string; description?: undefined | string; environments: MetaSys<MetaLinkProps>[]; name: string; policies?: { action: string; effect: string }[]; preview_api_key: MetaSys<MetaLinkProps>; sys: MetaSysProps }

Type declaration

AppDefinitionProps

AppDefinitionProps: { locations: LocationDefinition[]; name: string; src: string; sys: MetaSysProps }

Type declaration

  • locations: LocationDefinition[]

    Locations where the app can be installed

  • name: string

    App name

  • src: string

    URL where the root HTML document of the app can be found

  • sys: MetaSysProps

    System metadata

AppInstallationProps

AppInstallationProps: { parameters: {}; sys: MetaSysProps & { appDefinition: { sys: MetaLinkProps } } }

Type declaration

  • parameters: {}

    App Installation specific configuration variables

    • [key: string]: string
  • sys: MetaSysProps & { appDefinition: { sys: MetaLinkProps } }

AppLocation

AppLocation: "app-config" | "entry-sidebar" | "entry-editor" | "dialog" | "page"

ClientParams

ClientParams: { accessToken: string; application?: undefined | string; feature?: undefined | string; headers?: undefined | {}; host?: undefined | string; hostUpload?: undefined | string; httpAgent?: httpAgent; httpsAgent?: httpsAgent; insecure?: undefined | false | true; integration?: undefined | string; logHandler?: undefined | ((level: string, data: Error | string) => void); maxContentLength?: undefined | number; proxy?: AxiosProxyConfig; requestLogger?: undefined | ((config: AxiosRequestConfig) => void); responseLogger?: undefined | ((response: AxiosResponse) => void); retryLimit?: undefined | number; retryOnError?: undefined | false | true; timeout?: undefined | number }

Type declaration

  • accessToken: string

    Contentful CMA Access Token

  • Optional application?: undefined | string

    Application name and version e.g myApp/version

  • Optional feature?: undefined | string
  • Optional headers?: undefined | {}

    Optional additional headers

  • Optional host?: undefined | string

    API host

    default

    api.contentful.com

  • Optional hostUpload?: undefined | string

    direct file upload host

    default

    upload.contentful.com

  • Optional httpAgent?: httpAgent

    Optional Node.js HTTP agent for proxying

    see

    Node.js docs and https-proxy-agent

  • Optional httpsAgent?: httpsAgent

    Optional Node.js HTTP agent for proxying

    see

    Node.js docs and https-proxy-agent

  • Optional insecure?: undefined | false | true

    Requests will be made over http instead of the default https

    default

    false

  • Optional integration?: undefined | string

    Integration name and version e.g react/version

  • Optional logHandler?: undefined | ((level: string, data: Error | string) => void)

    A log handler function to process given log messages & errors. Receives the log level (error, warning & info) and the actual log data (Error object or string).

    see

    The default can be found at: https://github.com/contentful/contentful-sdk-core/blob/master/lib/create-http-client.js

  • Optional maxContentLength?: undefined | number

    Optional maximum content length in bytes

    default

    1073741824 i.e 1GB

  • Optional proxy?: AxiosProxyConfig

    Optional Axios proxy

    see

    axios docs

  • Optional requestLogger?: undefined | ((config: AxiosRequestConfig) => void)

    Gets called on every request triggered by the SDK

  • Optional responseLogger?: undefined | ((response: AxiosResponse) => void)

    Gets called on every response

  • Optional retryLimit?: undefined | number

    Optional number of retries before failure

    default

    5

  • Optional retryOnError?: undefined | false | true

    If we should retry on errors and 429 rate limit exceptions

    default

    true

  • Optional timeout?: undefined | number

    Optional number of milliseconds before the request times out.

    default

    30000

CreateApiKeyProps

CreateApiKeyProps: Pick<ApiKeyProps, "name" | "environments" | "description">

EditorInterfaceProps

EditorInterfaceProps: { controls: Control[]; sys: MetaSysProps & { contentType: { sys: MetaLinkProps }; environment: { sys: MetaLinkProps }; space: { sys: MetaLinkProps } } }

Type declaration

EntryFields

EntryFields: symbol | Text | RichText | Integer | number | Date | boolean | Record<string, any> | Location | Entry | Array

Field

Field: "Symbol" | "Text" | "RichText" | "Integer" | "Number" | "Date" | "Location" | "Boolean" | "Object"

FieldType

LinkType

LinkType: "Asset" | "Entry"

LocationDefinition

UsageMetricEnum

UsageMetricEnum: "cda" | "cma" | "cpa" | "gql"

UsageProps

UsageProps: { dateRange: { endAt: string; startAt: string }; metric: UsageMetricEnum; sys: UsageSysProps; unitOfMeasure: string; usage: number; usagePerDay: {} }

Type declaration

  • dateRange: { endAt: string; startAt: string }

    Range of usage

    • endAt: string
    • startAt: string
  • metric: UsageMetricEnum

    Type of usage

  • sys: UsageSysProps

    System metadata

  • unitOfMeasure: string

    Unit of usage metric

  • usage: number

    Value of the usage

  • usagePerDay: {}

    Usage per day

    • [key: string]: number

UserProps

UserProps: { activated: boolean; avatarUrl: string; confirmed: boolean; email: string; firstName: string; lastName: string; signInCount: number; sys: MetaSysProps }

Type declaration

  • activated: boolean

    Activation flag

  • avatarUrl: string

    Url to the users avatar

  • confirmed: boolean

    User confirmation flag

  • email: string

    Email address of the user

  • firstName: string

    First name of the user

  • lastName: string

    Last name of the user

  • signInCount: number

    Number of sign ins

  • sys: MetaSysProps

    System metadata

WebhookProps

WebhookProps: { headers: {}; httpBasicPassword: string; httpBasicUsername: string; name: string; sys: MetaSysProps; topics: string[]; transformation?: undefined | { body?: undefined | object; contentType?: undefined | string; includeContentLength?: undefined | false | true; method?: undefined | string }; url: string }

Type declaration

  • headers: {}

    Headers that should be appended to the webhook request

    • [key: string]: string
  • httpBasicPassword: string

    Password for basic http auth

  • httpBasicUsername: string

    Username for basic http auth

  • name: string

    Webhook name

  • sys: MetaSysProps

    System metadata

  • topics: string[]

    Topics the webhook wants to subscribe to

  • Optional transformation?: undefined | { body?: undefined | object; contentType?: undefined | string; includeContentLength?: undefined | false | true; method?: undefined | string }

    Transformation to apply

  • url: string

    Webhook url

Functions

createClient

  • Create a client instance

    const client = contentfulManagement.createClient({
     accessToken: 'myAccessToken'
    })

    Parameters

    Returns ClientAPI