Lime Web Components API Documentation - v6.24.0
    Preparing search index...

    Interface ProblemRepositoryAlpha

    Repository for accessing problems from registered providers.

    The repository is the primary interface for consumers to interact with problems. It provides a unified API for querying, counting, and retrieving problems from registered ProblemProviders.

    Packages register their providers with the repository during initialization. Consumers then use the repository's query methods rather than interacting with providers directly.

    Registering a provider

    const repository = platform.get(PlatformServiceName.ProblemRepository);
    repository.registerProvider(new EmailProblemProvider());

    Fetching problems from a provider

    const repository = platform.get(PlatformServiceName.ProblemRepository);
    const problems = await repository.getProblems('email-integration', {
    severity: ProblemSeverity.Critical
    });

    Getting actions for a problem

    const problem = await repository.get('email-integration', 'prob-123');
    const provider = repository.getProvider(problem.providerId);
    const actions = provider.getActions(problem);

    ProblemProvider for the provider interface

    interface ProblemRepository {
        get(providerId: string, problemId: string): Promise<Problem<unknown>>;
        getCount(
            providerId: string,
            options?: ProblemQueryOptions,
        ): Promise<number>;
        getProblems(
            providerId: string,
            options?: ProblemQueryOptions,
        ): Promise<Problem<unknown>[]>;
        getProvider(id: string): ProblemProvider;
        getProviders(): ProblemProvider[];
        registerProvider(provider: ProblemProvider): void;
    }
    Index

    Methods

    • Alpha

      Retrieves a specific problem by provider and problem id.

      Parameters

      • providerId: string

        The id of the provider that owns the problem.

      • problemId: string

        The id of the problem within that provider.

      Returns Promise<Problem<unknown>>

      A promise resolving to the problem if found, undefined otherwise.

      Error if no provider with the given id is registered.

    • Alpha

      Returns the count of problems from a provider.

      More efficient than fetching all problems when only the count is needed.

      Parameters

      • providerId: string

        The provider id to query.

      • Optionaloptions: ProblemQueryOptions

        Optional filtering options.

      Returns Promise<number>

      A promise resolving to the count.

      Error if no provider with the given id is registered.

    • Alpha

      Fetches problems from a provider matching the query options.

      Parameters

      • providerId: string

        The provider id to query.

      • Optionaloptions: ProblemQueryOptions

        Optional filtering and pagination options.

      Returns Promise<Problem<unknown>[]>

      A promise resolving to an array of problems.

      Error if no provider with the given id is registered.

      const emailProblems = await repository.getProblems('email-integration');

      const criticalProblems = await repository.getProblems(
      'email-integration',
      { severity: ProblemSeverity.Critical }
      );
    • Alpha

      Returns a specific provider by its id.

      Parameters

      • id: string

        The unique identifier of the provider.

      Returns ProblemProvider

      The provider if found, undefined otherwise.

    • Alpha

      Returns all registered providers.

      Useful for displaying provider information in the UI, such as provider titles and icons for filtering.

      Returns ProblemProvider[]

      An array of all registered providers.

    • Alpha

      Registers a problem provider with the repository.

      The provider's ProblemProvider.id must be unique. Registering a provider with an id that already exists will throw an error.

      Parameters

      Returns void

      Error if a provider with the same id is already registered.