interface IFieldDefinitionsClient {
    getFieldDefinition(args: {
        culture?: null | string;
        fieldId: number;
        repositoryId: string;
        select?: null | string;
    }): Promise<FieldDefinition>;
    listFieldDefinitions(args: {
        count?: boolean;
        culture?: null | string;
        orderby?: null | string;
        prefer?: null | string;
        repositoryId: string;
        select?: null | string;
        skip?: number;
        top?: number;
    }): Promise<FieldDefinitionCollectionResponse>;
    listFieldDefinitionsForEach(args: {
        callback: ((response: FieldDefinitionCollectionResponse) => Promise<boolean>);
        count?: boolean;
        culture?: string;
        maxPageSize?: number;
        orderby?: string;
        prefer?: string;
        repositoryId: string;
        select?: string;
        skip?: number;
        top?: number;
    }): Promise<void>;
    listFieldDefinitionsNextLink(args: {
        maxPageSize?: number;
        nextLink: string;
    }): Promise<FieldDefinitionCollectionResponse>;
}

Implemented by

Methods

    • Returns a single field definition associated with the specified ID.
    • Useful when a route provides a minimal amount of details and more information about the specific field definition is needed.
    • Allowed OData query options: Select
    • Required OAuth scope: repository.Read

    Parameters

    • args: {
          culture?: null | string;
          fieldId: number;
          repositoryId: string;
          select?: null | string;
      }
      • Optionalculture?: null | string

        (optional) An optional query parameter used to indicate the locale that should be used for formatting. The value should be a standard language tag.

      • fieldId: number

        The requested field definition ID.

      • repositoryId: string

        The requested repository ID.

      • Optionalselect?: null | string

        (optional) Limits the properties returned in the result.

    Returns Promise<FieldDefinition>

    A single field definition.

    • Returns a paged listing of field definitions available in the specified repository.
    • Useful when trying to find a list of all field definitions available, rather than only those assigned to a specific entry/template.
    • Default page size: 100. Allowed OData query options: Select | Count | OrderBy | Skip | Top | SkipToken | Prefer.
    • Required OAuth scope: repository.Read

    Parameters

    • args: {
          count?: boolean;
          culture?: null | string;
          orderby?: null | string;
          prefer?: null | string;
          repositoryId: string;
          select?: null | string;
          skip?: number;
          top?: number;
      }
      • Optionalcount?: boolean

        (optional) Indicates whether the total count of items within a collection are returned in the result.

      • Optionalculture?: null | string

        (optional) An optional query parameter used to indicate the locale that should be used for formatting. The value should be a standard language tag.

      • Optionalorderby?: null | string

        (optional) Specifies the order in which items are returned. The maximum number of expressions is 5.

      • Optionalprefer?: null | string

        (optional) An optional OData header. Can be used to set the maximum page size using odata.maxpagesize.

      • repositoryId: string

        The requested repository ID.

      • Optionalselect?: null | string

        (optional) Limits the properties returned in the result.

      • Optionalskip?: number

        (optional) Excludes the specified number of items of the queried collection from the result.

      • Optionaltop?: number

        (optional) Limits the number of items returned from a collection.

    Returns Promise<FieldDefinitionCollectionResponse>

    A collection of field definitions.

  • It will continue to make the same call to get a list of field definitions of a fixed size (i.e. maxpagesize) until it reaches the last page (i.e. when next link is null/undefined) or whenever the callback function returns false.

    Parameters

    • args: {
          callback: ((response: FieldDefinitionCollectionResponse) => Promise<boolean>);
          count?: boolean;
          culture?: string;
          maxPageSize?: number;
          orderby?: string;
          prefer?: string;
          repositoryId: string;
          select?: string;
          skip?: number;
          top?: number;
      }
      • callback: ((response: FieldDefinitionCollectionResponse) => Promise<boolean>)

        async callback function that will accept the current page results and return a boolean value to either continue or stop paging.

      • Optionalcount?: boolean

        (optional) Indicates whether the total count of items within a collection are returned in the result.

      • Optionalculture?: string

        (optional) An optional query parameter used to indicate the locale that should be used for formatting. The value should be a standard language tag. The formatFieldValues query parameter must be set to true, otherwise culture will not be used for formatting.

      • OptionalmaxPageSize?: number

        (optional) the maximum page size or number of field definitions allowed per API response schema.

      • Optionalorderby?: string

        (optional) Specifies the order in which items are returned. The maximum number of expressions is 5.

      • Optionalprefer?: string

        (optional) An optional OData header. Can be used to set the maximum page size using odata.maxpagesize.

      • repositoryId: string

        The requested repository ID.

      • Optionalselect?: string

        (optional) Limits the properties returned in the result.

      • Optionalskip?: number

        (optional) Excludes the specified number of items of the queried collection from the result.

      • Optionaltop?: number

        (optional) Limits the number of items returned from a collection.

    Returns Promise<void>