interface ITemplateDefinitionsClient {
    addTemplateField(
        args: {
            repositoryId: string;
            request: LfRepositoryClientV2.AddTemplateFieldRequest;
            templateId: number;
        },
    ): Promise<void>;
    createTemplate(
        args: {
            repositoryId: string;
            request: LfRepositoryClientV2.CreateTemplateRequest;
        },
    ): Promise<LfRepositoryClientV2.TemplateDefinition>;
    deleteTemplate(
        args: { repositoryId: string; templateId: number },
    ): Promise<void>;
    getTemplateAssignedEntryCount(
        args: {
            repositoryId: string;
            select?: null | string;
            templateId: number;
        },
    ): Promise<LfRepositoryClientV2.AssignedEntryCountResponse>;
    getTemplateDefinition(
        args: {
            culture?: null | string;
            repositoryId: string;
            select?: null | string;
            templateId: number;
        },
    ): Promise<LfRepositoryClientV2.TemplateDefinition>;
    getTemplateProperties(
        args: {
            repositoryId: string;
            select?: null | string;
            templateId: number;
        },
    ): Promise<LfRepositoryClientV2.TemplatePropertiesResponse>;
    listTemplateDefinitions(
        args: {
            count?: boolean;
            culture?: null | string;
            orderby?: null | string;
            prefer?: null | string;
            repositoryId: string;
            select?: null | string;
            skip?: number;
            templateName?: null | string;
            top?: number;
        },
    ): Promise<LfRepositoryClientV2.TemplateDefinitionCollectionResponse>;
    listTemplateDefinitionsForEach(
        args: {
            callback: (
                response: LfRepositoryClientV2.TemplateDefinitionCollectionResponse,
            ) => Promise<boolean>;
            count?: boolean;
            culture?: string;
            maxPageSize?: number;
            orderby?: string;
            prefer?: string;
            repositoryId: string;
            select?: string;
            skip?: number;
            templateName?: string;
            top?: number;
        },
    ): Promise<void>;
    listTemplateDefinitionsNextLink(
        args: { maxPageSize?: number; nextLink: string },
    ): Promise<LfRepositoryClientV2.TemplateDefinitionCollectionResponse>;
    listTemplateFieldDefinitionsByTemplateId(
        args: {
            count?: boolean;
            culture?: null | string;
            orderby?: null | string;
            prefer?: null | string;
            repositoryId: string;
            select?: null | string;
            skip?: number;
            templateId: number;
            top?: number;
        },
    ): Promise<LfRepositoryClientV2.TemplateFieldDefinitionCollectionResponse>;
    listTemplateFieldDefinitionsByTemplateIdForEach(
        args: {
            callback: (
                response: LfRepositoryClientV2.TemplateFieldDefinitionCollectionResponse,
            ) => Promise<boolean>;
            count?: boolean;
            culture?: string;
            maxPageSize?: number;
            orderby?: string;
            prefer?: string;
            repositoryId: string;
            select?: string;
            skip?: number;
            templateId: number;
            top?: number;
        },
    ): Promise<void>;
    listTemplateFieldDefinitionsByTemplateIdNextLink(
        args: { maxPageSize?: number; nextLink: string },
    ): Promise<LfRepositoryClientV2.TemplateFieldDefinitionCollectionResponse>;
    listTemplateFieldDefinitionsByTemplateName(
        args: {
            count?: boolean;
            culture?: null | string;
            orderby?: null | string;
            prefer?: null | string;
            repositoryId: string;
            select?: null | string;
            skip?: number;
            templateName: string;
            top?: number;
        },
    ): Promise<LfRepositoryClientV2.TemplateFieldDefinitionCollectionResponse>;
    listTemplateFieldDefinitionsByTemplateNameForEach(
        args: {
            callback: (
                response: LfRepositoryClientV2.TemplateFieldDefinitionCollectionResponse,
            ) => Promise<boolean>;
            count?: boolean;
            culture?: string;
            maxPageSize?: number;
            orderby?: string;
            prefer?: string;
            repositoryId: string;
            select?: string;
            skip?: number;
            templateName: string;
            top?: number;
        },
    ): Promise<void>;
    listTemplateFieldDefinitionsByTemplateNameNextLink(
        args: { maxPageSize?: number; nextLink: string },
    ): Promise<LfRepositoryClientV2.TemplateFieldDefinitionCollectionResponse>;
    moveTemplateField(
        args: {
            repositoryId: string;
            request: LfRepositoryClientV2.MoveTemplateFieldRequest;
            templateId: number;
        },
    ): Promise<void>;
    removeTemplateField(
        args: { fieldName: string; repositoryId: string; templateId: number },
    ): Promise<void>;
    updateTemplate(
        args: {
            repositoryId: string;
            request: LfRepositoryClientV2.UpdateTemplateRequest;
            templateId: number;
        },
    ): Promise<LfRepositoryClientV2.TemplateDefinition>;
    updateTemplateFieldProperties(
        args: {
            fieldName: string;
            repositoryId: string;
            request: LfRepositoryClientV2.UpdateTemplateFieldPropertiesRequest;
            templateId: number;
        },
    ): Promise<void>;
    updateTemplateProperties(
        args: {
            repositoryId: string;
            request: LfRepositoryClientV2.UpdateTemplatePropertiesRequest;
            templateId: number;
        },
    ): Promise<LfRepositoryClientV2.TemplatePropertiesResponse>;
}

Implemented by

Methods

    • The field definition must already exist in the repository.
    • Per-template properties do not affect the repository-level field-definition properties.
    • Required OAuth scope: repository.Write

    Parameters

    • args: {
          repositoryId: string;
          request: LfRepositoryClientV2.AddTemplateFieldRequest;
          templateId: number;
      }
      • repositoryId: string

        The requested repository ID.

      • request: LfRepositoryClientV2.AddTemplateFieldRequest

        The field to add. fieldName is required. Optional position (1-based) inserts at that position; omit to append. Optional per-template isRequired and localDescription apply only to this template.

      • templateId: number

        The ID of the template.

    Returns Promise<void>

    Successfully added the field to the template.

    • Creates a new metadata template with the supplied scalar properties and (optionally) an initial set of field assignments.
    • Names must be unique within the repository; duplicate-name failures surface as 409 Conflict from the underlying repository server.
    • Initial fields are appended in array order; each may carry per-template isRequired and localDescription. The repository-level field-definition properties are unaffected.
    • If the scalar template is successfully created but a subsequent AddField mid-loop fails, the template is left in place with the partial field set — there is no implicit rollback. Callers should treat the failure as transactional only at the scalar level and clean up via DeleteTemplate if needed.
    • The template extended-properties bag (REQ-ADMIN-006B) cannot be set during create — follow up with PATCH /Properties.
    • Required OAuth scope: repository.Write

    Parameters

    Returns Promise<LfRepositoryClientV2.TemplateDefinition>

    Successfully created the template definition.

    • Deletes the specified template definition. If the template is currently assigned to entries, the underlying repository server rejects the request and the response surfaces as 409 Conflict.
    • Required OAuth scope: repository.Write

    Parameters

    • args: { repositoryId: string; templateId: number }
      • repositoryId: string

        The requested repository ID.

      • templateId: number

        The ID of the template to delete.

    Returns Promise<void>

    Successfully deleted the template definition.

    • Useful for impact analysis before performing destructive operations on the template.
    • Required OAuth scope: repository.Read

    Parameters

    • args: { repositoryId: string; select?: null | string; templateId: number }
      • repositoryId: string

        The requested repository ID.

      • Optionalselect?: null | string

        (optional) Limits the properties returned in the result.

      • templateId: number

        The ID of the template.

    Returns Promise<LfRepositoryClientV2.AssignedEntryCountResponse>

    Successfully returned the assigned entry count for the template.

    • Returns a single template definition (including field definitions, if relevant).
    • Provide a template definition ID, and get the single template definition associated with that ID. Useful when a route provides a minimal amount of details, and more information about the specific template is needed.
    • Allowed OData query options: Select
    • Required OAuth scope: repository.Read

    Parameters

    • args: {
          culture?: null | string;
          repositoryId: string;
          select?: null | string;
          templateId: number;
      }
      • 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.

      • repositoryId: string

        The requested repository ID.

      • Optionalselect?: null | string

        (optional) Limits the properties returned in the result.

      • templateId: number

        The requested template definition ID.

    Returns Promise<LfRepositoryClientV2.TemplateDefinition>

    Successfully found and returned specified template.

    • Returns the custom-properties bag persisted on the template definition. The bag is an opaque application-defined string → string map scoped to the definition itself (not to a user), useful for attaching integration metadata or application-specific configuration that belongs with the template — for example to record an external system's identifier for the template, or to encode display preferences such as field ordering hints.
    • Keys are application-defined; recommend a namespace prefix (e.g. com.acme.workflow.stage, myapp.template.category) to avoid collisions across applications.
    • The response may include entries written by other applications or by system-managed tooling. Callers should leave unrecognized keys untouched on subsequent UpdateTemplateProperties calls — round-tripping them in set preserves them, including them in remove deletes them.
    • Required OAuth scope: repository.Read

    Parameters

    • args: { repositoryId: string; select?: null | string; templateId: number }
      • repositoryId: string

        The requested repository ID.

      • Optionalselect?: null | string

        (optional) Limits the properties returned in the result.

      • templateId: number

        The ID of the template.

    Returns Promise<LfRepositoryClientV2.TemplatePropertiesResponse>

    Successfully returned the template extended-properties bag.

    • Returns all template definitions (including field definitions) in the repository. If a template name query parameter is given, then a single template definition is returned.
    • Provide a repository ID, and get a paged listing of template definitions available in the repository. Useful when trying to find a list of all template definitions available, rather than a specific one.
    • 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;
          templateName?: null | string;
          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.

      • OptionaltemplateName?: null | string

        (optional) An optional query parameter. Can be used to get a single template definition using the template name.

      • Optionaltop?: number

        (optional) Limits the number of items returned from a collection. The maximum value is 150.

    Returns Promise<LfRepositoryClientV2.TemplateDefinitionCollectionResponse>

    Returned list of template definitions.

  • It will continue to make the same call to get a list of template 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: LfRepositoryClientV2.TemplateDefinitionCollectionResponse,
          ) => Promise<boolean>;
          count?: boolean;
          culture?: string;
          maxPageSize?: number;
          orderby?: string;
          prefer?: string;
          repositoryId: string;
          select?: string;
          skip?: number;
          templateName?: string;
          top?: number;
      }
      • callback: (
            response: LfRepositoryClientV2.TemplateDefinitionCollectionResponse,
        ) => 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 template 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.

      • OptionaltemplateName?: string

        (optional) An optional query parameter. Can be used to get a single template definition using the template name.

      • Optionaltop?: number

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

    Returns Promise<void>

  • Returns all template definitions (including field definitions) in the repository using a next link

    Parameters

    • args: { maxPageSize?: number; nextLink: string }
      • OptionalmaxPageSize?: number

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

      • nextLink: string

        a url that allows retrieving the next subset of the requested collection

    Returns Promise<LfRepositoryClientV2.TemplateDefinitionCollectionResponse>

    A collection of template definitions.

    • Returns the field definitions assigned to a template definition.
    • Provide a template definition ID, and get a paged listing of the field definitions assigned to that 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;
          templateId: 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.

      • templateId: number

        The requested template definition ID.

      • Optionaltop?: number

        (optional) Limits the number of items returned from a collection. The maximum value is 150.

    Returns Promise<LfRepositoryClientV2.TemplateFieldDefinitionCollectionResponse>

    Returned list of field definitions for specified template.

  • It will continue to make the same call to get a list of template 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: LfRepositoryClientV2.TemplateFieldDefinitionCollectionResponse,
          ) => Promise<boolean>;
          count?: boolean;
          culture?: string;
          maxPageSize?: number;
          orderby?: string;
          prefer?: string;
          repositoryId: string;
          select?: string;
          skip?: number;
          templateId: number;
          top?: number;
      }
      • callback: (
            response: LfRepositoryClientV2.TemplateFieldDefinitionCollectionResponse,
        ) => 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 template 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.

      • templateId: number
      • Optionaltop?: number

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

    Returns Promise<void>

    • Returns the field definitions assigned to a template definition.
    • Provide a template definition name, and get a paged listing of the field definitions assigned to that 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;
          templateName: string;
          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.

      • templateName: string

        A required query parameter for the requested template name.

      • Optionaltop?: number

        (optional) Limits the number of items returned from a collection. The maximum value is 150.

    Returns Promise<LfRepositoryClientV2.TemplateFieldDefinitionCollectionResponse>

    Returned list of field definitions for specified template.

  • It will continue to make the same call to get a list of template field definitions by template name 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: LfRepositoryClientV2.TemplateFieldDefinitionCollectionResponse,
          ) => Promise<boolean>;
          count?: boolean;
          culture?: string;
          maxPageSize?: number;
          orderby?: string;
          prefer?: string;
          repositoryId: string;
          select?: string;
          skip?: number;
          templateName: string;
          top?: number;
      }
      • callback: (
            response: LfRepositoryClientV2.TemplateFieldDefinitionCollectionResponse,
        ) => 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 template field definitions by template name 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.

      • templateName: string

        (optional) An optional query parameter. Can be used to get a single template definition using the template name.

      • Optionaltop?: number

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

    Returns Promise<void>

  • Returns the field definitions assigned to a template definition by template name using a next link

    Parameters

    • args: { maxPageSize?: number; nextLink: string }
      • OptionalmaxPageSize?: number

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

      • nextLink: string

        a url that allows retrieving the next subset of the requested collection

    Returns Promise<LfRepositoryClientV2.TemplateFieldDefinitionCollectionResponse>

    A collection of template field definitions.

    • The field must already be part of the template.
    • newPosition must be between 1 and the current field count, inclusive.
    • Required OAuth scope: repository.Write

    Parameters

    Returns Promise<void>

    Successfully moved the field to the new position in the template.

    • Field values already assigned to entries using this template are not affected — RA removes only the binding of the field to the template definition.
    • The field definition itself is not deleted; only the template assignment is removed.
    • Required OAuth scope: repository.Write

    Parameters

    • args: { fieldName: string; repositoryId: string; templateId: number }
      • fieldName: string

        The name of the field to remove. URL-decoded server-side.

      • repositoryId: string

        The requested repository ID.

      • templateId: number

        The ID of the template.

    Returns Promise<void>

    Successfully removed the field from the template.

    • Partial-update merge semantics. null = leave unchanged; "" = clear a string property.
    • To clear an existing color, set clearColor to true and leave color null. Supplying both is rejected with 400.
    • Field membership is managed via the AddTemplateField / RemoveTemplateField / MoveTemplateField endpoints.
    • Required OAuth scope: repository.Write

    Parameters

    Returns Promise<LfRepositoryClientV2.TemplateDefinition>

    Successfully updated the template definition.

    • Affects only the field's behavior on this specific template.
    • The repository-level field-definition properties are unchanged; use the FieldDefinitions admin endpoints for those.
    • Required OAuth scope: repository.Write

    Parameters

    Returns Promise<void>

    Successfully updated the per-template properties for the field assignment.

    • Entries in set are written (creating or overwriting). Entries in remove are deleted. Properties not mentioned in either are left unchanged.
    • Empty set and empty remove is a no-op and returns the current bag.
    • Returns the full custom-properties bag after the change.
    • The bag is application-defined; the API does not validate key semantics. Recommend namespaced keys (e.g. com.acme.workflow.stage, myapp.template.category) to avoid collisions.
    • Required OAuth scope: repository.Write

    Parameters

    Returns Promise<LfRepositoryClientV2.TemplatePropertiesResponse>

    Successfully updated the template extended-properties bag.