Options
All
  • Public
  • Public/Protected
  • All
Menu

contentful-management.js - v7.39.1

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

ActionType

ActionType: "read" | "create" | "update" | "delete" | "publish" | "unpublish" | "archive" | "unarchive"

AdapterParams

AdapterParams: { apiAdapter: Adapter }

Type declaration

ApiKeyProps

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

Type declaration

AppBundleFile

AppBundleFile: { md5: string; name: string; size: number }

Type declaration

  • md5: string
  • name: string
  • size: number

AppBundleProps

AppBundleProps: { comment?: undefined | string; files: AppBundleFile[]; sys: AppBundleSys }

Type declaration

  • Optional comment?: undefined | string

    A comment that describes this bundle

  • files: AppBundleFile[]

    List of all the files that are in this bundle

  • sys: AppBundleSys

    System metadata

AppBundleSys

AppBundleSys: Except<BasicMetaSysProps, "version"> & { appDefinition: SysLink; organization: SysLink }

AppDefinition

AppDefinition: ContentfulAppDefinitionAPI & AppDefinitionProps & DefaultElements<AppDefinitionProps>

AppDefinitionProps

AppDefinitionProps: { bundle?: Link<"AppBundle">; locations?: AppLocation[]; name: string; parameters?: undefined | { instance?: ParameterDefinition[] }; src?: undefined | string; sys: BasicMetaSysProps & { organization: SysLink; shared: boolean } }

Type declaration

  • Optional bundle?: Link<"AppBundle">

    Link to an AppBundle

  • Optional locations?: AppLocation[]

    Locations where the app can be installed

  • name: string

    App name

  • Optional parameters?: undefined | { instance?: ParameterDefinition[] }

    Instance parameter definitions

  • Optional src?: undefined | string

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

  • sys: BasicMetaSysProps & { organization: SysLink; shared: boolean }

    System metadata

AppInstallationProps

AppInstallationProps: { parameters?: FreeFormParameters; sys: BasicMetaSysProps & { appDefinition: SysLink; environment: SysLink; space: SysLink } }

Type declaration

AppLocation

AppSignedRequestProps

AppSignedRequestProps: { additionalHeaders: { x-contentful-environment-id: string; x-contentful-signature: string; x-contentful-signed-headers: string; x-contentful-space-id: string; x-contentful-timestamp: string; x-contentful-user-id: string }; sys: AppSignedRequestSys }

Type declaration

  • additionalHeaders: { x-contentful-environment-id: string; x-contentful-signature: string; x-contentful-signed-headers: string; x-contentful-space-id: string; x-contentful-timestamp: string; x-contentful-user-id: string }

    new headers to be included in the request

    • x-contentful-environment-id: string
    • x-contentful-signature: string
    • x-contentful-signed-headers: string
    • x-contentful-space-id: string
    • x-contentful-timestamp: string
    • x-contentful-user-id: string
  • sys: AppSignedRequestSys

    System metadata

AppSignedRequestSys

AppSignedRequestSys: Except<BasicMetaSysProps, "version" | "id"> & { appDefinition: SysLink; environment: SysLink; space: SysLink }

AppSigningSecretProps

AppSigningSecretProps: { redactedValue: string; sys: AppSigningSecretSys }

Type declaration

  • redactedValue: string

    The last four characters of the signing secret

  • sys: AppSigningSecretSys

    System metadata

AppSigningSecretSys

AppSigningSecretSys: Except<BasicMetaSysProps, "version" | "id"> & { appDefinition: SysLink; organization: SysLink }

AppUploadProps

AppUploadProps: { sys: AppUploadSys & { expiresAt: string; organization: SysLink } }

Type declaration

AppUploadSys

AppUploadSys: Except<BasicMetaSysProps, "version">

AssetApi

AssetApi: { archive: any; delete: any; isArchived: any; isDraft: any; isPublished: any; isUpdated: any; processForAllLocales: any; processForLocale: any; publish: any; unarchive: any; unpublish: any; update: any }

Type declaration

  • archive: function
    • archive(): Promise<Asset>
    • Archives the object

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getAsset('<asset_id>'))
      .then((asset) => asset.archive())
      .then((asset) => console.log(`Asset ${asset.sys.id} archived.`)
      .catch(console.error)
      

      Returns Promise<Asset>

      Object returned from the server with updated metadata.

  • delete: function
    • delete(): Promise<void>
    • Deletes this object on the server.

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getAsset('<asset_id>'))
      .then((asset) => asset.delete())
      .then((asset) => console.log(`Asset deleted.`)
      .catch(console.error)
      

      Returns Promise<void>

      Promise for the deletion. It contains no data, but the Promise error case should be handled.

  • isArchived: function
    • isArchived(): boolean
    • Checks if asset is archived. This means it's not exposed to the Delivery/Preview APIs.

      Returns boolean

  • isDraft: function
    • isDraft(): boolean
  • isPublished: function
    • isPublished(): boolean
    • Checks if the asset is published. A published asset might have unpublished changes

      Returns boolean

  • isUpdated: function
    • isUpdated(): boolean
    • Checks if the asset is updated. This means the asset was previously published but has unpublished changes.

      Returns boolean

  • processForAllLocales: function
    • Triggers asset processing after an upload, for the files uploaded to all locales of an asset.

      prop

      options.processingCheckWait - Time in milliseconds to wait before checking again if the asset has been processed (default: 500ms)

      prop

      options.processingCheckRetries - Maximum amount of times to check if the asset has been processed (default: 5)

      throws

      {AssetProcessingTimeout} If the asset takes too long to process. If this happens, retrieve the asset again, and if the url property is available, then processing has succeeded. If not, your file might be damaged.

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.createAssetWithId('<asset_id>', {
        title: {
          'en-US': 'Playsam Streamliner',
          'de-DE': 'Playsam Streamliner'
        },
        file: {
          'en-US': {
            contentType: 'image/jpeg',
            fileName: 'example.jpeg',
            upload: 'https://example.com/example.jpg'
          },
          'de-DE': {
            contentType: 'image/jpeg',
            fileName: 'example.jpeg',
            upload: 'https://example.com/example-de.jpg'
          }
        }
      }))
      .then((asset) => asset.processForAllLocales())
      .then((asset) => console.log(asset))
      .catch(console.error)
      

      Parameters

      Returns Promise<Asset>

      Object returned from the server with updated metadata.

  • processForLocale: function
    • Triggers asset processing after an upload, for the file uploaded to a specific locale.

      prop

      options.processingCheckWait - Time in milliseconds to wait before checking again if the asset has been processed (default: 500ms)

      prop

      options.processingCheckRetries - Maximum amount of times to check if the asset has been processed (default: 5)

      throws

      {AssetProcessingTimeout} If the asset takes too long to process. If this happens, retrieve the asset again, and if the url property is available, then processing has succeeded. If not, your file might be damaged.

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.createAssetWithId('<asset_id>', {
        title: {
          'en-US': 'Playsam Streamliner',
        },
        file: {
          'en-US': {
            contentType: 'image/jpeg',
            fileName: 'example.jpeg',
            upload: 'https://example.com/example.jpg'
          }
        }
      }))
      .then((asset) => asset.processForLocale('en-US'))
      .then((asset) => console.log(asset))
      .catch(console.error)
      

      Parameters

      Returns Promise<Asset>

      Object returned from the server with updated metadata.

  • publish: function
    • publish(): Promise<Asset>
    • Publishes the object

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getAsset('<asset_id>'))
      .then((asset) => asset.publish())
      .then((asset) => console.log(`Asset ${asset.sys.id} published.`)
      .catch(console.error)
      

      Returns Promise<Asset>

      Object returned from the server with updated metadata.

  • unarchive: function
    • unarchive(): Promise<Asset>
    • Unarchives the object

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getAsset('<asset_id>'))
      .then((asset) => asset.unarchive())
      .then((asset) => console.log(`Asset ${asset.sys.id} unarchived.`)
      .catch(console.error)
      

      Returns Promise<Asset>

      Object returned from the server with updated metadata.

  • unpublish: function
    • unpublish(): Promise<Asset>
    • Unpublishes the object

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getAsset('<asset_id>'))
      .then((asset) => asset.unpublish())
      .then((asset) => console.log(`Asset ${asset.sys.id} unpublished.`)
      .catch(console.error)
      

      Returns Promise<Asset>

      Object returned from the server with updated metadata.

  • update: function
    • update(): Promise<Asset>
    • Sends an update to the server with any changes made to the object's properties

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getAsset('<asset_id>'))
      .then((asset) => {
        asset.fields.title['en-US'] = 'New asset title'
        return asset.update()
      })
      .then((asset) => console.log(`Asset ${asset.sys.id} updated.`)
      .catch(console.error)
      

      Returns Promise<Asset>

      Object returned from the server with updated changes.

AssetKeyProps

AssetKeyProps: { policy: string; secret: string }

Type declaration

  • policy: string

    A JWT describing a policy; needs to be attached to signed URLs

  • secret: string

    A secret key to be used for signing URLs

AssetProps

AssetProps: { fields: { description?: undefined | {}; file: {}; title: {} }; metadata?: MetadataProps; sys: EntityMetaSysProps }

Type declaration

  • fields: { description?: undefined | {}; file: {}; title: {} }
    • Optional description?: undefined | {}

      Description for this asset

    • file: {}

      File object for this asset

      • [key: string]: { contentType: string; details?: Record<string, any>; fileName: string; upload?: undefined | string; uploadFrom?: Record<string, any>; url?: undefined | string }
        • contentType: string
        • Optional details?: Record<string, any>

          Details for the file, depending on file type (example: image size in bytes, etc)

        • fileName: string
        • Optional upload?: undefined | string

          Url where the file is available to be downloaded from, into the Contentful asset system. After the asset is processed this field is gone.

        • Optional uploadFrom?: Record<string, any>
        • Optional url?: undefined | string

          Url where the file is available at the Contentful media asset system. This field won't be available until the asset is processed.

    • title: {}

      Title for this asset

      • [key: string]: string
  • Optional metadata?: MetadataProps
  • sys: EntityMetaSysProps

AsyncActionProcessingOptions

AsyncActionProcessingOptions: { initialDelayMs?: undefined | number; retryCount?: undefined | number; retryIntervalMs?: undefined | number; throwOnFailedExecution?: undefined | false | true }

Type declaration

  • Optional initialDelayMs?: undefined | number

    Initial delay in milliseconds when performing the first check. This is used to prevent short running bulkActions of waiting too long for a result.

    default

    1000 (1s)

  • Optional retryCount?: undefined | number

    The amount of times to retry.

    default

    30

  • Optional retryIntervalMs?: undefined | number

    The interval between retries, in milliseconds (ms).

    default

    2000 (2s)

  • Optional throwOnFailedExecution?: undefined | false | true

    Throws an error if the Action does not complete with a successful (succeeded) status.

    default

    true

BulkActionPayload

BulkActionStatuses

BulkActionStatuses: typeof STATUSES[number]

BulkActionSysProps

BulkActionSysProps: { createdAt: ISO8601Timestamp; createdBy: Link<"User">; environment: Link<"Environment">; id: string; space: Link<"Space">; status: BulkActionStatuses; type: "BulkAction"; updatedAt: ISO8601Timestamp }

Type declaration

BulkActionType

BulkActionType: "publish" | "unpublish" | "validate"

ClientAPI

ClientAPI: ReturnType<typeof createClientApi>

ClientOptions

ClientParams

deprecated

Collection

Collection<T, T, TPlain>: Array<T>

Type parameters

  • T

  • T

  • TPlain

items

items: T[]

limit

limit: number

skip

skip: number

sys

sys: { type: "Array" }

Type declaration

  • type: "Array"

total

total: number

toPlainObject

ConditionType

ConditionType: "and" | "or" | "not" | "equals"

ConstraintType

ConstraintType: {}

Type declaration

ContentTypeApi

ContentTypeApi: { delete: any; getEditorInterface: any; getSnapshot: any; getSnapshots: any; isDraft: any; isPublished: any; isUpdated: any; omitAndDeleteField: any; publish: any; unpublish: any; update: any }

Type declaration

  • delete: function
    • delete(): Promise<void>
    • Deletes this object on the server.

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getContentType('<contentType_id>'))
      .then((contentType) => contentType.delete())
      .then(() => console.log('contentType deleted'))
      .catch(console.error)
      

      Returns Promise<void>

      Promise for the deletion. It contains no data, but the Promise error case should be handled.

  • getEditorInterface: function
    • Gets the editor interface for the object
      Important note: The editor interface only represent a published contentType.
      To get the most recent representation of the contentType make sure to publish it first

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getContentType('<contentType_id>'))
      .then((contentType) => contentType.getEditorInterface())
      .then((editorInterface) => console.log(editorInterface.contorls))
      .catch(console.error)
      

      Returns Promise<EditorInterface>

      Object returned from the server with the current editor interface.

  • getSnapshot: function
    • Gets a snapshot of a contentType

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getContentType('<contentType_id>'))
      .then((entry) => entry.getSnapshot('<snapshot-id>'))
      .then((snapshot) => console.log(snapshot))
      .catch(console.error)
      

      Parameters

      • snapshotId: string

        Id of the snapshot

      Returns Promise<SnapshotProps<ContentTypeProps>>

  • getSnapshots: function
    • Gets all snapshots of a contentType

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getContentType('<contentType_id>'))
      .then((entry) => entry.getSnapshots())
      .then((snapshots) => console.log(snapshots.items))
      .catch(console.error)
      

      Returns Promise<Collection<Snapshot<ContentTypeProps>, SnapshotProps<ContentTypeProps>>>

  • isDraft: function
    • isDraft(): boolean
  • isPublished: function
    • isPublished(): boolean
    • Checks if the contentType is published. A published contentType might have unpublished changes (@see {ContentType.isUpdated})

      Returns boolean

  • isUpdated: function
    • isUpdated(): boolean
    • Checks if the contentType is updated. This means the contentType was previously published but has unpublished changes.

      Returns boolean

  • omitAndDeleteField: function
    • Omits and deletes a field if it exists on the contentType. This is a convenience method which does both operations at once and potentially less safe than the standard way. See note about deleting fields on the Update method.

      Parameters

      • id: string

      Returns Promise<ContentType>

      Object returned from the server with updated metadata.

  • publish: function
    • Publishes the object

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getContentType('<contentType_id>'))
      .then((contentType) => contentType.publish())
      .then((contentType) => console.log(`${contentType.sys.id} is published`))
      .catch(console.error)
      

      Returns Promise<ContentType>

      Object returned from the server with updated metadata.

  • unpublish: function
    • Unpublishes the object

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getContentType('<contentType_id>'))
      .then((contentType) => contentType.unpublish())
      .then((contentType) => console.log(`${contentType.sys.id} is unpublished`))
      .catch(console.error)
      

      Returns Promise<ContentType>

      Object returned from the server with updated metadata.

  • update: function
    • Sends an update to the server with any changes made to the object's properties.
      Important note about deleting fields: The standard way to delete a field is with two updates: first omit the property from your responses (set the field attribute "omitted" to true), and then delete it by setting the attribute "deleted" to true. See the "Deleting fields" section in the API reference for more reasoning. Alternatively, you may use the convenience method omitAndDeleteField to do both steps at once.

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getContentType('<contentType_id>'))
      .then((contentType) => {
       contentType.name = 'New name'
       return contentType.update()
      })
      .then(contentType => console.log(contentType))
      .catch(console.error)
      

      Returns Promise<ContentType>

      Object returned from the server with updated changes.

ContentTypeProps

ContentTypeProps: { description: string; displayField: string; fields: ContentFields[]; name: string; sys: BasicMetaSysProps & { environment: SysLink; firstPublishedAt?: undefined | string; publishedCounter?: undefined | number; publishedVersion?: undefined | number; space: SysLink } }

Type declaration

  • description: string
  • displayField: string

    Field used as the main display field for Entries

  • fields: ContentFields[]

    All the fields contained in this Content Type

  • name: string
  • sys: BasicMetaSysProps & { environment: SysLink; firstPublishedAt?: undefined | string; publishedCounter?: undefined | number; publishedVersion?: undefined | number; space: SysLink }

CreateApiKeyProps

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

CreateAppBundleProps

CreateAppBundleProps: { appUploadId: string; comment?: undefined | string }

Type declaration

  • appUploadId: string
  • Optional comment?: undefined | string

CreateAppDefinitionProps

CreateAppDefinitionProps: SetOptional<Except<AppDefinitionProps, "sys" | "bundle">, "src" | "locations">

CreateAppInstallationProps

CreateAppInstallationProps: Except<AppInstallationProps, "sys">

CreateAppSignedRequestProps

CreateAppSignedRequestProps: { body?: undefined | string; headers?: Record<string, string>; method: "GET" | "PUT" | "POST" | "DELETE" | "PATCH" | "HEAD"; path: string }

Type declaration

  • Optional body?: undefined | string

    optional stringified body of the request

  • Optional headers?: Record<string, string>

    optional headers of the request

  • method: "GET" | "PUT" | "POST" | "DELETE" | "PATCH" | "HEAD"

    the request method

  • path: string

    the path of the request method

CreateAppSigningSecretProps

CreateAppSigningSecretProps: { value: string }

Type declaration

  • value: string

    A 64 character matching the regular expression /^[0-9a-zA-Z+/=_-]+$/

CreateAssetKeyProps

CreateAssetKeyProps: { expiresAt: number }

Type declaration

  • expiresAt: number

    (required) UNIX timestamp in the future (but not more than 48 hours from now)

CreateAssetProps

CreateAssetProps: Omit<AssetProps, "sys">

CreateContentTypeProps

CreateContentTypeProps: SetOptional<Except<ContentTypeProps, "sys">, "description" | "displayField">

CreateEntryProps

CreateEntryProps<TFields>: Omit<EntryProps<TFields>, "sys">

Type parameters

  • TFields = KeyValueMap

CreateEnvironmentAliasProps

CreateEnvironmentAliasProps: Omit<EnvironmentAliasProps, "sys">

CreateEnvironmentProps

CreateEnvironmentProps: Partial<Omit<EnvironmentProps, "sys">>

CreateExtensionProps

CreateExtensionProps: { extension: RequireExactlyOne<SetRequired<ExtensionProps["extension"], "name" | "fieldTypes" | "sidebar">, "src" | "srcdoc"> }

Type declaration

  • extension: RequireExactlyOne<SetRequired<ExtensionProps["extension"], "name" | "fieldTypes" | "sidebar">, "src" | "srcdoc">

CreateLocaleProps

CreateLocaleProps: Omit<SetOptional<Except<LocaleProps, "sys">, "optional" | "contentManagementApi" | "default" | "contentDeliveryApi">, "internal_code">

CreateOrganizationInvitationProps

CreateOrganizationInvitationProps: Omit<OrganizationInvitationProps, "sys">

CreatePersonalAccessTokenProps

CreatePersonalAccessTokenProps: Pick<PersonalAccessToken, "name" | "scopes">

CreateRoleProps

CreateRoleProps: Omit<RoleProps, "sys">

CreateSpaceMembershipProps

CreateSpaceMembershipProps: Omit<SpaceMembershipProps, "sys" | "user"> & { email: string }

CreateTagProps

CreateTagProps: Omit<TagProps, "sys"> & { sys: Pick<TagSysProps, "visibility"> }

CreateTaskParams

CreateTaskParams: GetEntryParams

CreateTaskProps

CreateTaskProps: Omit<TaskProps, "sys">

CreateTeamMembershipProps

CreateTeamMembershipProps: Omit<TeamMembershipProps, "sys">

CreateTeamProps

CreateTeamProps: Omit<TeamProps, "sys">

CreateTeamSpaceMembershipProps

CreateTeamSpaceMembershipProps: Omit<TeamSpaceMembershipProps, "sys">

CreateUpdateScheduledActionProps

CreateUpdateScheduledActionProps: Pick<ScheduledActionProps, "action" | "entity" | "environment" | "scheduledFor">

CreateWebhooksProps

CreateWebhooksProps: SetOptional<Except<WebhookProps, "sys">, "headers">

DefaultParams

DefaultParams: { environmentId?: undefined | string; organizationId?: undefined | string; spaceId?: undefined | string }

Type declaration

  • Optional environmentId?: undefined | string
  • Optional organizationId?: undefined | string
  • Optional spaceId?: undefined | string

DefinedParameters

DefinedParameters: Record<string, string | number | boolean>

DeleteTagParams

DeleteTagParams: GetTagParams & { version: number }

DeleteTaskParams

DeleteTaskParams: GetTaskParams & { version: number }

EditorInterfaceProps

EditorInterfaceProps: { controls?: Control[]; editor?: Editor; editorLayout?: EditorLayoutItem[]; editors?: Editor[]; groupControls?: GroupControl[]; sidebar?: SidebarItem[]; sys: MetaSysProps & { contentType: { sys: MetaLinkProps }; environment: { sys: MetaLinkProps }; space: { sys: MetaLinkProps } } }

Type declaration

  • Optional controls?: Control[]

    Array of fields and their associated widgetId

  • Optional editor?: Editor

    Legacy singular editor override

  • Optional editorLayout?: EditorLayoutItem[]

    Array of editor layout groups

  • Optional editors?: Editor[]

    Array of editors. Defaults will be used if property is missing.

  • Optional groupControls?: GroupControl[]

    Array of groups and their associated widgetId

  • Optional sidebar?: SidebarItem[]

    Array of sidebar widgets. Defaults will be used if property is missing.

  • sys: MetaSysProps & { contentType: { sys: MetaLinkProps }; environment: { sys: MetaLinkProps }; space: { sys: MetaLinkProps } }

Entity

Entity: "Entry" | "Asset"

Entity types supported by the BulkAction API Entity types supported by the Release API

EntityError

EntityError: { entity: VersionedLink<Entity> | Link<Entity>; error: any }

Type declaration

EntryProps

EntryProps<T>: { fields: T; metadata?: MetadataProps; sys: EntityMetaSysProps }

Type parameters

  • T = KeyValueMap

Type declaration

EntryReferenceOptionsProps

EntryReferenceOptionsProps: { maxDepth?: undefined | number }

Type declaration

  • Optional maxDepth?: undefined | number

Environment

Environment: ContentfulEnvironmentAPI & EnvironmentProps & DefaultElements<EnvironmentProps>

EnvironmentAliasProps

EnvironmentAliasProps: { environment: { sys: MetaLinkProps }; sys: BasicMetaSysProps & { space: SysLink } }

Type declaration

EnvironmentMetaSys

EnvironmentMetaSys: BasicMetaSysProps & { aliasedEnvironment?: SysLink; aliases?: Array<SysLink>; space: SysLink; status: SysLink }

EnvironmentProps

EnvironmentProps: { name: string; sys: EnvironmentMetaSys }

Type declaration

ErrorDetail

ErrorDetail: { error: any }

Type declaration

  • error: any

ExtensionProps

ExtensionProps: { extension: { fieldTypes: FieldType[]; name: string; parameters?: undefined | { installation?: ParameterDefinition[]; instance?: ParameterDefinition[] }; sidebar?: undefined | false | true; src?: undefined | string; srcdoc?: undefined | string }; parameters?: DefinedParameters; sys: ExtensionSysProps }

Type declaration

  • extension: { fieldTypes: FieldType[]; name: string; parameters?: undefined | { installation?: ParameterDefinition[]; instance?: ParameterDefinition[] }; sidebar?: undefined | false | true; src?: undefined | string; srcdoc?: undefined | string }
    • fieldTypes: FieldType[]

      Field types where an extension can be used

    • name: string

      Extension name

    • Optional parameters?: undefined | { installation?: ParameterDefinition[]; instance?: ParameterDefinition[] }

      Parameter definitions

    • Optional sidebar?: undefined | false | true

      Controls the location of the extension. If true it will be rendered on the sidebar instead of replacing the field's editing control

    • Optional src?: undefined | string

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

    • Optional srcdoc?: undefined | string

      String representation of the extension (e.g. inline HTML code)

  • Optional parameters?: DefinedParameters

    Values for installation parameters

  • sys: ExtensionSysProps

ExtensionSysProps

ExtensionSysProps: BasicMetaSysProps & { environment: SysLink; space: SysLink; srcdocSha256?: undefined | string }

FieldType

FieldType: { type: "Symbol" } | { type: "Text" } | { type: "RichText" } | { type: "Integer" } | { type: "Number" } | { type: "Date" } | { type: "Boolean" } | { type: "Object" } | { type: "Location" } | { linkType: "Asset"; type: "Link" } | { linkType: "Entry"; type: "Link" } | { items: { type: "Symbol" }; type: "Array" } | { items: { linkType: "Entry"; type: "Link" }; type: "Array" } | { items: { linkType: "Asset"; type: "Link" }; type: "Array" }

FreeFormParameters

FreeFormParameters: Record<string, any> | Array<any> | number | string | boolean

GetAppBundleParams

GetAppBundleParams: GetAppDefinitionParams & { appBundleId: string }

GetAppDefinitionParams

GetAppDefinitionParams: GetOrganizationParams & { appDefinitionId: string }

GetAppInstallationParams

GetAppInstallationParams: GetSpaceEnvironmentParams & { appDefinitionId: string }

GetAppUploadParams

GetAppUploadParams: GetOrganizationParams & { appUploadId: string }

GetBulkActionParams

GetBulkActionParams: GetSpaceEnvironmentParams & { bulkActionId: string }

GetContentTypeParams

GetContentTypeParams: GetSpaceEnvironmentParams & { contentTypeId: string }

GetEditorInterfaceParams

GetEditorInterfaceParams: GetSpaceEnvironmentParams & { contentTypeId: string }

GetEntryParams

GetEntryParams: GetSpaceEnvironmentParams & { entryId: string }

GetExtensionParams

GetExtensionParams: GetSpaceEnvironmentParams & { extensionId: string }

GetOrganizationMembershipProps

GetOrganizationMembershipProps: GetOrganizationParams & { organizationMembershipId: string }

GetOrganizationParams

GetOrganizationParams: { organizationId: string }

Type declaration

  • organizationId: string

GetReleaseParams

GetReleaseParams: GetSpaceEnvironmentParams & { releaseId: string }

GetSnapshotForContentTypeParams

GetSnapshotForContentTypeParams: GetSpaceEnvironmentParams & { contentTypeId: string }

GetSnapshotForEntryParams

GetSnapshotForEntryParams: GetSpaceEnvironmentParams & { entryId: string }

GetSpaceEnvAliasParams

GetSpaceEnvAliasParams: GetSpaceParams & { environmentAliasId: string }

GetSpaceEnvironmentParams

GetSpaceEnvironmentParams: { environmentId: string; spaceId: string }

Type declaration

  • environmentId: string
  • spaceId: string

GetSpaceMembershipProps

GetSpaceMembershipProps: GetSpaceParams & { spaceMembershipId: string }

GetSpaceParams

GetSpaceParams: { spaceId: string }

Type declaration

  • spaceId: string

GetTagParams

GetTagParams: GetSpaceEnvironmentParams & { tagId: string }

GetTaskParams

GetTaskParams: GetEntryParams & { taskId: string }

GetTeamMembershipParams

GetTeamMembershipParams: GetTeamParams & { teamMembershipId: string }

GetTeamParams

GetTeamParams: { organizationId: string; teamId: string }

Type declaration

  • organizationId: string
  • teamId: string

GetTeamSpaceMembershipParams

GetTeamSpaceMembershipParams: GetSpaceParams & { teamSpaceMembershipId: string }

GetWebhookCallDetailsUrl

GetWebhookCallDetailsUrl: GetWebhookParams & { callId: string }

GetWebhookParams

GetWebhookParams: GetSpaceParams & { webhookDefinitionId: string }

ISO8601Timestamp

ISO8601Timestamp: string

String will be in ISO8601 datetime format e.g. 2013-06-26T13:57:24Z

IterableFn

IterableFn<P, T>: (params: P) => Promise<CollectionProp<T>>

Type parameters

  • P = any

  • T = any

Type declaration

KeyValueMap

KeyValueMap: Record<string, any>

LocaleProps

LocaleProps: { code: string; contentDeliveryApi: boolean; contentManagementApi: boolean; default: boolean; fallbackCode: string | null; internal_code: string; name: string; optional: boolean; sys: BasicMetaSysProps & { environment: SysLink; space: SysLink } }

Type declaration

  • code: string

    Locale code (example: en-us)

  • contentDeliveryApi: boolean

    If the content under this locale should be available on the CDA (for public reading)

  • contentManagementApi: boolean

    If the content under this locale should be available on the CMA (for editing)

  • default: boolean

    If this is the default locale

  • fallbackCode: string | null

    Locale code to fallback to when there is not content for the current locale

  • internal_code: string

    Internal locale code

  • name: string

    Locale name

  • optional: boolean

    If the locale needs to be filled in on entries or not

  • sys: BasicMetaSysProps & { environment: SysLink; space: SysLink }

LocationType

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

OmitOrDelete

OmitOrDelete: "omitted" | "deleted"

Organization

Organization: DefaultElements<OrganizationProp> & OrganizationProp & ContentfulOrganizationAPI

OrganizationInvitationProps

OrganizationInvitationProps: { email: string; firstName: string; lastName: string; role: string; sys: MetaSysProps & { invitationUrl: string; organizationMembership: { sys: MetaLinkProps }; status: string; user: Record<string, any> | null } }

Type declaration

  • email: string
  • firstName: string
  • lastName: string
  • role: string
  • sys: MetaSysProps & { invitationUrl: string; organizationMembership: { sys: MetaLinkProps }; status: string; user: Record<string, any> | null }

OrganizationMembershipProps

OrganizationMembershipProps: { role: string; status: boolean; sys: MetaSysProps & { user: { sys: MetaLinkProps } } }

Type declaration

OrganizationProp

OrganizationProp: { name: string; sys: MetaSysProps }

Type declaration

PaginationQueryParams

PaginationQueryParams: { query?: PaginationQueryOptions }

Type declaration

ParameterOption

ParameterOption: string | {}

ParameterType

ParameterType: "Boolean" | "Symbol" | "Number" | "Enum"

ParamsType

ParamsType<T>: T extends (params: infer P) => any ? P : never

Type parameters

PersonalAccessTokenProp

PersonalAccessTokenProp: { name: string; revokedAt: null | string; scopes: "content_management_manage"[]; sys: MetaSysProps; token?: undefined | string }

Type declaration

  • name: string
  • revokedAt: null | string
  • scopes: "content_management_manage"[]
  • sys: MetaSysProps
  • Optional token?: undefined | string

PlainClientAPI

PlainClientAPI: { apiKey: { create: any; createWithId: any; delete: any; get: any; getMany: any; update: any }; appBundle: { create: any; delete: any; get: any; getMany: any }; appDefinition: { create: any; delete: any; get: any; getMany: any; update: any }; appInstallation: { delete: any; get: any; getMany: any; upsert: any }; appSignedRequest: { create: any }; appSigningSecret: { delete: any; get: any; upsert: any }; appUpload: { create: any; delete: any; get: any }; asset: { archive: any; create: any; createFromFiles: any; createWithId: any; delete: any; get: any; getMany: any; processForAllLocales: any; processForLocale: any; publish: any; unarchive: any; unpublish: any; update: any }; assetKey: { create: any }; bulkAction: { get: any; publish: any; unpublish: any; validate: any }; contentType: { create: any; createWithId: any; delete: any; get: any; getMany: any; omitAndDeleteField: any; publish: any; unpublish: any; update: any }; editorInterface: { get: any; getMany: any; update: any }; entry: { archive: any; create: any; createWithId: any; delete: any; get: any; getMany: any; patch: any; publish: any; references: any; unarchive: any; unpublish: any; update: any }; environment: { create: any; createWithId: any; delete: any; get: any; getMany: any; update: any }; environmentAlias: { createWithId: any; delete: any; get: any; getMany: any; update: any }; extension: { create: any; createWithId: any; delete: any; get: any; getMany: any; update: any }; locale: { create: any; delete: any; get: any; getMany: any; update: any }; organization: { get: any; getAll: any }; organizationInvitation: { create: any; get: any }; organizationMembership: { delete: any; get: any; getMany: any; update: any }; personalAccessToken: { create: any; get: any; getMany: any; revoke: any }; previewApiKey: { get: any; getMany: any }; raw: { delete: any; get: any; getDefaultParams: any; http: any; patch: any; post: any; put: any }; release: { create: any; delete: any; get: any; publish: any; query: any; unpublish: any; update: any; validate: any }; releaseAction: { get: any; queryForRelease: any }; role: { create: any; createWithId: any; delete: any; get: any; getMany: any; update: any }; scheduledActions: { create: any; delete: any; get: any; getMany: any; update: any }; snapshot: { getForContentType: any; getForEntry: any; getManyForContentType: any; getManyForEntry: any }; space: { create: any; delete: any; get: any; getMany: any; update: any }; spaceMember: { get: any; getMany: any }; spaceMembership: { create: any; createWithId: any; delete: any; get: any; getForOrganization: any; getMany: any; getManyForOrganization: any; update: any }; tag: { createWithId: any; delete: any; get: any; getMany: any; update: any }; task: { create: any; delete: any; get: any; getAll: any; update: any }; team: { create: any; delete: any; get: any; getMany: any; getManyForSpace: any; update: any }; teamMembership: { create: any; delete: any; get: any; getManyForOrganization: any; getManyForTeam: any; update: any }; teamSpaceMembership: { create: any; delete: any; get: any; getForOrganization: any; getMany: any; getManyForOrganization: any; update: any }; upload: { create: any; delete: any; get: any }; usage: { getManyForOrganization: any; getManyForSpace: any }; user: { getCurrent: any; getForOrganization: any; getForSpace: any; getManyForOrganization: any; getManyForSpace: any }; webhook: { create: any; delete: any; get: any; getCallDetails: any; getHealthStatus: any; getMany: any; getManyCallDetails: any; update: any } }

Type declaration

PlainClientDefaultParams

PlainClientDefaultParams: DefaultParams

PlainOptions

PlainOptions: { actionId: string; environmentId: string; plainClient: PlainClientAPI; releaseId: string; spaceId: string }

Type declaration

  • actionId: string
  • environmentId: string
  • plainClient: PlainClientAPI

    Used by the PlainClient to perform a poll for the BulkAction status

  • releaseId: string
  • spaceId: string

PreviewApiKeyProps

PreviewApiKeyProps: { description: string; name: string; sys: MetaSysProps }

Type declaration

QueryParams

QueryParams: { query?: QueryOptions }

Type declaration

ReleaseActionStatuses

ReleaseActionStatuses: "created" | "inProgress" | "failed" | "succeeded"

ReleaseActionSysProps

ReleaseActionSysProps: { createdAt: ISO8601Timestamp; createdBy: Link<"User">; environment: Link<"Environment">; id: string; release: Link<"Release">; space: Link<"Space">; status: ReleaseActionStatuses; type: "ReleaseAction"; updatedAt: ISO8601Timestamp }

Type declaration

ReleaseActionTypes

ReleaseActionTypes: "publish" | "unpublish" | "validate"

ReleaseSysProps

ReleaseSysProps: { createdAt: ISO8601Timestamp; createdBy: Link<"User">; environment: Link<"Environment">; id: string; lastAction?: Link<"ReleaseAction">; space: Link<"Space">; type: "Release"; updatedAt: ISO8601Timestamp; updatedBy: Link<"User">; version: number }

Type declaration

RestAdapterParams

RestAdapterParams: CreateHttpClientParams & { accessToken: CreateHttpClientParams["accessToken"]; host?: undefined | string; hostUpload?: undefined | string }

RoleProps

RoleProps: { description?: undefined | string; name: string; permissions: { ContentDelivery: string[] | string; ContentModel: string[]; EnvironmentAliases: string[] | string; Environments: string[] | string; Settings: string[] | string; Tags: string[] | string }; policies: { actions: ActionType[] | "all"; constraint: ConstraintType; effect: string }[]; sys: BasicMetaSysProps & { space: SysLink } }

Type declaration

  • Optional description?: undefined | string
  • name: string
  • permissions: { ContentDelivery: string[] | string; ContentModel: string[]; EnvironmentAliases: string[] | string; Environments: string[] | string; Settings: string[] | string; Tags: string[] | string }

    Permissions for application sections

    • ContentDelivery: string[] | string
    • ContentModel: string[]
    • EnvironmentAliases: string[] | string
    • Environments: string[] | string
    • Settings: string[] | string
    • Tags: string[] | string
  • policies: { actions: ActionType[] | "all"; constraint: ConstraintType; effect: string }[]
  • sys: BasicMetaSysProps & { space: SysLink }

SchedulableActionType

SchedulableActionType: "publish" | "unpublish"

SchedulableEntityType

SchedulableEntityType: "Entry" | "Asset" | "Release"

ScheduledActionApi

ScheduledActionApi: { delete: any; update: any }

Type declaration

ScheduledActionProps

ScheduledActionProps: { action: SchedulableActionType; entity: Link<SchedulableEntityType>; environment?: undefined | { sys: MetaLinkProps }; error?: ScheduledActionFailedError; scheduledFor: { datetime: ISO8601Timestamp; timezone?: undefined | string }; sys: ScheduledActionSysProps }

Type declaration

ScheduledActionSysProps

ScheduledActionSysProps: { canceledAt?: ISO8601Timestamp; canceledBy?: SysLink; createdAt: ISO8601Timestamp; createdBy: SysLink; id: string; space: SysLink; status: ScheduledActionStatus; type: "ScheduledAction"; updatedAt: ISO8601Timestamp; updatedBy: Link<"User">; version: number }

Type declaration

SnapshotProps

SnapshotProps<T>: { snapshot: T; sys: MetaSysProps & { snapshotEntityType: string; snapshotType: string } }

Type parameters

  • T

Type declaration

  • snapshot: T
  • sys: MetaSysProps & { snapshotEntityType: string; snapshotType: string }

Space

Space: SpaceProps & DefaultElements<SpaceProps> & ContentfulSpaceAPI

SpaceMemberProps

SpaceMemberProps: { admin: boolean; roles: { sys: MetaLinkProps }[]; sys: MetaSysProps }

Type declaration

SpaceMembershipProps

SpaceMembershipProps: { admin: boolean; roles: SysLink[]; sys: MetaSysProps & { space: SysLink; user: SysLink }; user: SysLink }

Type declaration

SpaceProps

SpaceProps: { name: string; sys: BasicMetaSysProps & { organization: { sys: { id: string } } } }

Type declaration

TagApi

TagApi: { delete: any; update: any }

Type declaration

TagCollectionProps

TagCollectionProps: { items: TagProps[]; sys: { type: "Array" }; total: number }

Type declaration

  • items: TagProps[]
  • sys: { type: "Array" }
    • type: "Array"
  • total: number

TagProps

TagProps: { name: string; sys: TagSysProps }

Type declaration

TagSysProps

TagSysProps: Pick<MetaSysProps, "id" | "version" | "createdAt" | "createdBy" | "updatedAt" | "updatedBy"> & { environment: SysLink; space: SysLink; type: "Tag"; visibility: TagVisibility }

TagVisibility

TagVisibility: "private" | "public"

TaskApi

TaskApi: { delete: any; update: any }

Type declaration

TaskProps

TaskProps: { assignedTo: Link<"User" | "Team">; body: string; dueDate?: undefined | string; status: TaskStatus; sys: TaskSysProps }

Type declaration

TaskStatus

TaskStatus: "active" | "resolved"

TaskSysProps

TaskSysProps: Pick<BasicMetaSysProps, "id" | "version" | "createdAt" | "createdBy" | "updatedAt" | "updatedBy"> & { environment: SysLink; parentEntity: Link<"Entry">; space: SysLink; type: "Task" }

TeamMembershipProps

TeamMembershipProps: { admin: boolean; organizationMembershipId: string; sys: MetaSysProps & { organization: { sys: MetaLinkProps }; organizationMembership: { sys: MetaLinkProps }; team: { sys: MetaLinkProps } } }

Type declaration

TeamProps

TeamProps: { description: string; name: string; sys: MetaSysProps & { memberCount: number; organization: { sys: MetaLinkProps } } }

Type declaration

  • description: string

    Description of the team

  • name: string

    Name of the team

  • sys: MetaSysProps & { memberCount: number; organization: { sys: MetaLinkProps } }

    System metadata

TeamSpaceMembershipProps

TeamSpaceMembershipProps: { admin: boolean; roles: { sys: MetaLinkProps }[]; sys: MetaSysProps & { space: { sys: MetaLinkProps }; team: { sys: MetaLinkProps } } }

Type declaration

UpdateTagProps

UpdateTagProps: Omit<TagProps, "sys"> & { sys: Pick<TagSysProps, "version"> }

UpdateTaskParams

UpdateTaskParams: GetTaskParams

UpdateTaskProps

UpdateTaskProps: Omit<TaskProps, "sys"> & { sys: Pick<TaskSysProps, "version"> }

UpdateWebhookProps

UpdateWebhookProps: SetOptional<Except<WebhookProps, "sys">, "headers" | "name" | "topics" | "url">

UploadProps

UploadProps: { sys: MetaSysProps & { space: SysLink } }

Type declaration

UsageMetricEnum

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

UsageProps

UsageProps: { dateRange: { endAt: string; startAt: string }; metric: UsageMetricEnum; sys: MetaSysProps & { organization?: undefined | { sys: MetaLinkProps } }; 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: MetaSysProps & { organization?: undefined | { sys: MetaLinkProps } }

    System metadata

  • unitOfMeasure: string

    Unit of usage metric

  • usage: number

    Value of the usage

  • usagePerDay: {}

    Usage per day

    • [key: string]: number

UserProps

UserProps: { 2faEnabled: boolean; activated: boolean; avatarUrl: string; confirmed: boolean; cookieConsentData: string; email: string; firstName: string; lastName: string; signInCount: number; sys: BasicMetaSysProps }

Type declaration

  • 2faEnabled: boolean
  • activated: boolean

    Activation flag

  • avatarUrl: string

    Url to the users avatar

  • confirmed: boolean

    User confirmation flag

  • cookieConsentData: string
  • 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: BasicMetaSysProps

    System metadata

WebhookCallDetailsProps

WebhookCallDetailsProps: { errors: any[]; eventType: string; request: WebhookCallRequest; requestAt: string; response: WebhookCallResponse; responseAt: string; statusCode: number; sys: WebhookCallDetailsSys; url: string }

Type declaration

  • errors: any[]

    Errors

  • eventType: string

    Type of the webhook

  • request: WebhookCallRequest

    Request object

  • requestAt: string

    Timestamp of the request

  • response: WebhookCallResponse

    Request object

  • responseAt: string

    Timestamp of the response

  • statusCode: number

    Status code of the request

  • sys: WebhookCallDetailsSys

    System metadata

  • url: string

    Url of the request

WebhookCallDetailsSys

WebhookCallDetailsSys: Except<BasicMetaSysProps, "version" | "updatedAt" | "updatedBy">

WebhookCallOverviewProps

WebhookCallOverviewProps: Except<WebhookCallDetailsProps, "request" | "response">

WebhookCallRequest

WebhookCallRequest: { body: string; headers: {}; method: string; url: string }

Type declaration

  • body: string
  • headers: {}
    • [key: string]: string
  • method: string
  • url: string

WebhookCallResponse

WebhookCallResponse: WebhookCallRequest & { statusCode: number }

WebhookCalls

WebhookCalls: { healthy: number; total: number }

Type declaration

  • healthy: number
  • total: number

WebhookFilter

WebhookHeader

WebhookHeader: { key: string; secret?: undefined | false | true; value: string }

Type declaration

  • key: string
  • Optional secret?: undefined | false | true
  • value: string

WebhookHealthProps

WebhookHealthProps: { calls: WebhookCalls; sys: WebhookHealthSys & { space: { sys: MetaLinkProps } } }

Type declaration

WebhookHealthSys

WebhookHealthSys: Except<BasicMetaSysProps, "version" | "updatedAt" | "updatedBy" | "createdAt">

WebhookProps

WebhookProps: { filters?: WebhookFilter[]; headers: Array<WebhookHeader>; httpBasicPassword?: undefined | string; httpBasicUsername?: undefined | string; name: string; sys: BasicMetaSysProps & { space: SysLink }; topics: string[]; transformation?: WebhookTransformation; url: string }

Type declaration

  • Optional filters?: WebhookFilter[]

    Webhook filters

  • headers: Array<WebhookHeader>

    Headers that should be appended to the webhook request

  • Optional httpBasicPassword?: undefined | string

    Password for basic http auth

  • Optional httpBasicUsername?: undefined | string

    Username for basic http auth

  • name: string

    Webhook name

  • sys: BasicMetaSysProps & { space: SysLink }

    System metadata

  • topics: string[]

    Topics the webhook wants to subscribe to

  • Optional transformation?: WebhookTransformation

    Transformation to apply

  • url: string

    Webhook url

WebhookTransformation

WebhookTransformation: { body?: JsonValue; contentType?: null | "application/vnd.contentful.management.v1+json" | "application/vnd.contentful.management.v1+json; charset=utf-8" | "application/json" | "application/json; charset=utf-8" | "application/x-www-form-urlencoded" | "application/x-www-form-urlencoded; charset=utf-8"; includeContentLength?: boolean | null; method?: null | "POST" | "GET" | "PUT" | "PATCH" | "DELETE" }

Type declaration

  • Optional body?: JsonValue
  • Optional contentType?: null | "application/vnd.contentful.management.v1+json" | "application/vnd.contentful.management.v1+json; charset=utf-8" | "application/json" | "application/json; charset=utf-8" | "application/x-www-form-urlencoded" | "application/x-www-form-urlencoded; charset=utf-8"
  • Optional includeContentLength?: boolean | null
  • Optional method?: null | "POST" | "GET" | "PUT" | "PATCH" | "DELETE"

Variables

Const DEFAULTS_SETTINGS

DEFAULTS_SETTINGS: { Asset: object; Assets: object; Boolean: object; Date: object; Entries: object; Entry: object } = {Boolean: {falseLabel: 'No',helpText: null,trueLabel: 'Yes',},Date: {helpText: null,ampm: '24',format: 'timeZ',},Entry: {helpText: null,showCreateEntityAction: true,showLinkEntityAction: true,},Asset: {helpText: null,showCreateEntityAction: true,showLinkEntityAction: true,},Entries: {helpText: null,bulkEditing: false,showCreateEntityAction: true,showLinkEntityAction: true,},Assets: {helpText: null,showCreateEntityAction: true,showLinkEntityAction: true,},} as const

Type declaration

  • Asset: object
    • helpText: null
    • showCreateEntityAction: true
    • showLinkEntityAction: true
  • Assets: object
    • helpText: null
    • showCreateEntityAction: true
    • showLinkEntityAction: true
  • Boolean: object
    • falseLabel: "No"
    • helpText: null
    • trueLabel: "Yes"
  • Date: object
    • ampm: "24"
    • format: "timeZ"
    • helpText: null
  • Entries: object
    • bulkEditing: false
    • helpText: null
    • showCreateEntityAction: true
    • showLinkEntityAction: true
  • Entry: object
    • helpText: null
    • showCreateEntityAction: true
    • showLinkEntityAction: true

Const DEFAULT_EDITOR_ID

DEFAULT_EDITOR_ID: "default-editor" = "default-editor"

Const DEFAULT_INITIAL_DELAY_MS

DEFAULT_INITIAL_DELAY_MS: 1000 = 1000

Const DEFAULT_MAX_RETRIES

DEFAULT_MAX_RETRIES: 30 = 30

Const DEFAULT_RETRY_INTERVAL_MS

DEFAULT_RETRY_INTERVAL_MS: 2000 = 2000

Const DROPDOWN_TYPES

DROPDOWN_TYPES: string[] = ['Text', 'Symbol', 'Integer', 'Number', 'Boolean']

Const EntryConfiguration

EntryConfiguration: { name: string; widgetId: string; widgetNamespace: WidgetNamespace }[] = [DefaultEntryEditor, ReferencesEntryEditor, TagsEditor]

Const FIELD_TYPES

FIELD_TYPES: ("Asset" | "Entry" | "Boolean" | "Symbol" | "Number" | "Text" | "RichText" | "Integer" | "Date" | "Object" | "Location" | "File" | "Symbols" | "Entries" | "Assets")[] = Object.keys(INTERNAL_TO_API) as Array<keyof typeof INTERNAL_TO_API>

Const INTERNAL_TO_API

INTERNAL_TO_API: { Asset: object; Assets: object; Boolean: object; Date: object; Entries: object; Entry: object; File: object; Integer: object; Location: object; Number: object; Object: object; RichText: object; Symbol: object; Symbols: object; Text: object } = {Symbol: { type: 'Symbol' },Text: { type: 'Text' },RichText: { type: 'RichText' },Integer: { type: 'Integer' },Number: { type: 'Number' },Boolean: { type: 'Boolean' },Date: { type: 'Date' },Location: { type: 'Location' },Object: { type: 'Object' },File: { type: 'File' },Entry: { type: 'Link', linkType: 'Entry' },Asset: { type: 'Link', linkType: 'Asset' },Symbols: { type: 'Array', items: { type: 'Symbol' } },Entries: { type: 'Array', items: { type: 'Link', linkType: 'Entry' } },Assets: { type: 'Array', items: { type: 'Link', linkType: 'Asset' } },} as const

Type declaration

  • Asset: object
    • linkType: "Asset"
    • type: "Link"
  • Assets: object
    • type: "Array"
    • items: object
      • linkType: "Asset"
      • type: "Link"
  • Boolean: object
    • type: "Boolean"
  • Date: object
    • type: "Date"
  • Entries: object
    • type: "Array"
    • items: object
      • linkType: "Entry"
      • type: "Link"
  • Entry: object
    • linkType: "Entry"
    • type: "Link"
  • File: object
    • type: "File"
  • Integer: object
    • type: "Integer"
  • Location: object
    • type: "Location"
  • Number: object
    • type: "Number"
  • Object: object
    • type: "Object"
  • RichText: object
    • type: "RichText"
  • Symbol: object
    • type: "Symbol"
  • Symbols: object
    • type: "Array"
    • items: object
      • type: "Symbol"
  • Text: object
    • type: "Text"

Const STATUSES

STATUSES: (created | inProgress | succeeded | failed)[] = Object.values(BulkActionStatus)

Const SidebarAssetConfiguration

SidebarAssetConfiguration: { description: string; name: string; widgetId: string; widgetNamespace: WidgetNamespace }[] = [Publication, Releases, Links, Translation, Users]

Const SidebarEntryConfiguration

SidebarEntryConfiguration: { description: string; name: string; widgetId: string; widgetNamespace: WidgetNamespace }[] = [Publication,Releases,Tasks,ContentPreview,Links,Translation,Versions,Users,]

Functions

Const asIterator

  • asIterator<P, T, F>(fn: F, params: ParamsType<F>): AsyncIterable<T>

createClient

createSigningSecretApi

  • createSigningSecretApi(makeRequest: MakeRequest): { delete: any }

getDefaultControlOfField

getDefaultWidget

getInstanceMethods

Const isArchived

Const isDraft

Const isPublished

Const isUpdated

Const omitAndDeleteField

pollAsyncActionStatus

  • description

    Waits for an Action to be completed and to be in one of the final states (failed or succeeded)

    throws

    {ActionFailedError} throws an error if throwOnFailedExecution = true with the Action that failed.

    throws

    {AsyncActionProcessingError} throws an error with a Action when processing takes too long.

    Type parameters

    Parameters

    • actionFunction: () => Promise<T>

      GET function that will be called every interval to fetch an Action status

        • (): Promise<T>
        • Returns Promise<T>

    • Optional options: AsyncActionProcessingOptions

    Returns Promise<T>

toApiFieldType

  • toApiFieldType(internal: keyof typeof INTERNAL_TO_API): { type: "Symbol" } | { type: "Text" } | { type: "RichText" } | { type: "Integer" } | { type: "Number" } | { type: "Boolean" } | { type: "Date" } | { type: "Location" } | { type: "Object" } | { type: "File" } | { linkType: "Entry"; type: "Link" } | { linkType: "Asset"; type: "Link" } | { type: "Array"; items: object } | { type: "Array"; items: object } | { type: "Array"; items: object }
  • Given our internal identifier returns a minimal API field object.

    Parameters

    Returns { type: "Symbol" } | { type: "Text" } | { type: "RichText" } | { type: "Integer" } | { type: "Number" } | { type: "Boolean" } | { type: "Date" } | { type: "Location" } | { type: "Object" } | { type: "File" } | { linkType: "Entry"; type: "Link" } | { linkType: "Asset"; type: "Link" } | { type: "Array"; items: object } | { type: "Array"; items: object } | { type: "Array"; items: object }

toInternalFieldType

  • toInternalFieldType(api: Partial<ContentFields>): undefined | "Asset" | "Entry" | "Boolean" | "Symbol" | "Number" | "Text" | "RichText" | "Integer" | "Date" | "Object" | "Location" | "File" | "Symbols" | "Entries" | "Assets"
  • Returns an internal string identifier for an API field object.

    We use this string as a simplified reference to field types. Possible values are:

    • Symbol
    • Symbols
    • Text
    • RichText
    • Integer
    • Number
    • Boolean
    • Date
    • Location
    • Object
    • Entry
    • Entries
    • Asset
    • Assets
    • File

    Parameters

    Returns undefined | "Asset" | "Entry" | "Boolean" | "Symbol" | "Number" | "Text" | "RichText" | "Integer" | "Date" | "Object" | "Location" | "File" | "Symbols" | "Entries" | "Assets"

waitForBulkActionProcessing

waitForReleaseActionProcessing

Object literals

Const ContentPreview

ContentPreview: object

description

description: string = "Built-in - Displays preview functionality."

name

name: string = "Preview"

widgetId

widgetId: string = SidebarWidgetTypes.CONTENT_PREVIEW

widgetNamespace

widgetNamespace: WidgetNamespace = WidgetNamespace.SIDEBAR_BUILTIN

Const DEFAULTS_WIDGET

DEFAULTS_WIDGET: object

Asset

Asset: object

widgetId

widgetId: string = "assetLinkEditor"

Assets

Assets: object

widgetId

widgetId: string = "assetLinksEditor"

Boolean

Boolean: object

widgetId

widgetId: string = "boolean"

Date

Date: object

widgetId

widgetId: string = "datePicker"

Entries

Entries: object

widgetId

widgetId: string = "entryLinksEditor"

Entry

Entry: object

widgetId

widgetId: string = "entryLinkEditor"

File

File: object

widgetId

widgetId: string = "fileEditor"

Integer

Integer: object

widgetId

widgetId: string = "numberEditor"

Location

Location: object

widgetId

widgetId: string = "locationEditor"

Number

Number: object

widgetId

widgetId: string = "numberEditor"

Object

Object: object

widgetId

widgetId: string = "objectEditor"

RichText

RichText: object

widgetId

widgetId: string = "richTextEditor"

Symbol

Symbol: object

widgetId

widgetId: string = "singleLine"

Symbols

Symbols: object

widgetId

widgetId: string = "tagEditor"

Text

Text: object

widgetId

widgetId: string = "markdown"

Const DefaultEntryEditor

DefaultEntryEditor: object

name

name: string = EntryEditorWidgetTypes.DEFAULT_EDITOR.name

widgetId

widgetId: string = EntryEditorWidgetTypes.DEFAULT_EDITOR.id

widgetNamespace

widgetNamespace: WidgetNamespace = WidgetNamespace.EDITOR_BUILTIN

Const EntryEditorWidgetTypes

EntryEditorWidgetTypes: object

DEFAULT_EDITOR

DEFAULT_EDITOR: object

icon

icon: string = "Entry"

id

id: string = DEFAULT_EDITOR_ID

name

name: string = "Editor"

REFERENCE_TREE

REFERENCE_TREE: object

icon

icon: string = "References"

id

id: string = "reference-tree"

name

name: string = "References"

TAGS_EDITOR

TAGS_EDITOR: object

icon

icon: string = "Tags"

id

id: string = "tags-editor"

name

name: string = "Tags"

Const Links

Links: object

description

description: string = "Built-in - Shows where an entry is linked."

name

name: string = "Links"

widgetId

widgetId: string = SidebarWidgetTypes.INCOMING_LINKS

widgetNamespace

widgetNamespace: WidgetNamespace = WidgetNamespace.SIDEBAR_BUILTIN

Const Publication

Publication: object

description

description: string = "Built-in - View entry status, publish, etc."

name

name: string = "Publish & Status"

widgetId

widgetId: string = SidebarWidgetTypes.PUBLICATION

widgetNamespace

widgetNamespace: WidgetNamespace = WidgetNamespace.SIDEBAR_BUILTIN

Const ReferencesEntryEditor

ReferencesEntryEditor: object

name

name: string = EntryEditorWidgetTypes.REFERENCE_TREE.name

widgetId

widgetId: string = EntryEditorWidgetTypes.REFERENCE_TREE.id

widgetNamespace

widgetNamespace: WidgetNamespace = WidgetNamespace.EDITOR_BUILTIN

Const Releases

Releases: object

description

description: string = "Built-in - View release, add to it, etc."

name

name: string = "Release"

widgetId

widgetId: string = SidebarWidgetTypes.RELEASES

widgetNamespace

widgetNamespace: WidgetNamespace = WidgetNamespace.SIDEBAR_BUILTIN

Const SidebarWidgetTypes

SidebarWidgetTypes: object

COMMENTS_PANEL

COMMENTS_PANEL: string = "comments-panel"

CONTENT_PREVIEW

CONTENT_PREVIEW: string = "content-preview-widget"

INCOMING_LINKS

INCOMING_LINKS: string = "incoming-links-widget"

INFO_PANEL

INFO_PANEL: string = "info-panel"

JOBS

JOBS: string = "jobs-widget"

PUBLICATION

PUBLICATION: string = "publication-widget"

RELEASES

RELEASES: string = "releases-widget"

TASKS

TASKS: string = "content-workflows-tasks-widget"

TRANSLATION

TRANSLATION: string = "translation-widget"

USERS

USERS: string = "users-widget"

VERSIONS

VERSIONS: string = "versions-widget"

Const TagsEditor

TagsEditor: object

name

name: string = EntryEditorWidgetTypes.TAGS_EDITOR.name

widgetId

widgetId: string = EntryEditorWidgetTypes.TAGS_EDITOR.id

widgetNamespace

widgetNamespace: WidgetNamespace = WidgetNamespace.EDITOR_BUILTIN

Const Tasks

Tasks: object

description

description: string = "Built-in - Assign tasks to be completed before publishing. Currently only supported for master environment."

name

name: string = "Tasks"

widgetId

widgetId: string = SidebarWidgetTypes.TASKS

widgetNamespace

widgetNamespace: WidgetNamespace = WidgetNamespace.SIDEBAR_BUILTIN

Const Translation

Translation: object

description

description: string = "Built-in - Manage which translations are visible."

name

name: string = "Translation"

widgetId

widgetId: string = SidebarWidgetTypes.TRANSLATION

widgetNamespace

widgetNamespace: WidgetNamespace = WidgetNamespace.SIDEBAR_BUILTIN

Const Users

Users: object

description

description: string = "Built-in - Displays users on the same entry."

name

name: string = "Users"

widgetId

widgetId: string = SidebarWidgetTypes.USERS

widgetNamespace

widgetNamespace: WidgetNamespace = WidgetNamespace.SIDEBAR_BUILTIN

Const Versions

Versions: object

description

description: string = "Built-in - View previously published versions. Available only for master environment."

name

name: string = "Versions"

widgetId

widgetId: string = SidebarWidgetTypes.VERSIONS

widgetNamespace

widgetNamespace: WidgetNamespace = WidgetNamespace.SIDEBAR_BUILTIN