Maximo API Client - v0.9.01
    Preparing search index...

    Class QueryBuilder<T>

    Builder class for constructing OSLC queries Uses the builder pattern for fluent interface Use this on collection resources not on a single resource

    Type Parameters

    • T extends OslcResource

      The resource type that extends OslcResource

    Index

    Methods

    • Sets the OSLC where clause for filtering records

      Parameters

      • whereClause: string

        The OSLC where clause

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Adds an OR condition to the existing where clause Following Maximo OSLC standard for combining conditions with 'or' operator

      Parameters

      • condition: string

        The condition to OR with the existing where clause

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Creates a grouped set of OR conditions Useful for creating complex OR clauses as described in the OSLC filtering documentation

      Parameters

      • conditions: string[]

        Array of conditions to OR together

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Adds an 'in' clause to filter an attribute by multiple values Follows Maximo OSLC query syntax: attribute in [val1, val2, val3]

      Parameters

      • attribute: string

        The attribute name to filter

      • values: (string | number | boolean)[]

        Array of values to include in the 'in' clause

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Adds a 'not in' clause to filter an attribute by excluding specific values For ALN attributes, follows Maximo OSLC syntax: attribute!="[val1,val2,val3]"

      Parameters

      • attribute: string

        The attribute name to filter

      • values: (string | number | boolean)[]

        Array of values to exclude

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Adds a LIKE condition for pattern matching Implements various LIKE patterns as described in the OSLC filtering documentation

      Parameters

      • attribute: string

        The attribute name to filter

      • pattern: string

        The pattern to match (can include % wildcards)

      • type: "contains" | "startsWith" | "endsWith" = 'contains'

        The type of LIKE condition: 'contains', 'startsWith', or 'endsWith'

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Adds a condition to check if a field is NULL Implements the NULL check using the OSLC '*' notation

      Parameters

      • attribute: string

        The attribute name to check

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Adds a condition to check if a field is NOT NULL Implements the NOT NULL check using the OSLC '*' notation

      Parameters

      • attribute: string

        The attribute name to check

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Adds a date range filter using the timeline filter capabilities Based on the OSLC timeline filter syntax described in the documentation

      Parameters

      • attribute: string

        The date attribute to filter on

      • range: string

        The range specification (e.g., '-3M' for past 3 months)

      • OptionalindexDate: string

        Optional ISO date string to use as reference instead of current date

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Sets the order by clause for sorting

      Parameters

      • fields: string | string[]

        The fields to order by

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Sets the page number and size for pagination

      Parameters

      • pageNum: number

        The page number (1-based)

      • pageSize: number

        The page size

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Sets the page size for pagination

      Parameters

      • size: number

        Number of records per page

      Returns QueryBuilder<T>

    • Includes count information in the response

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Sets a saved query to use

      Parameters

      • queryName: string

        The name of the saved query

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Sets a field to fetch distinct values for

      Parameters

      • field: string

        The field to get distinct values for

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Sets the operation mode (e.g. 'or' or 'and')

      Parameters

      • mode: "or" | "and"

        The operation mode

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Sets the oslc.searchTerms parameter for text search

      Parameters

      • terms: string

        The terms to search for

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Sets the stablepaging parameter Ensures dataset consistency during pagination

      Parameters

      • enabled: boolean = true

        Whether to enable stable paging (default: true)

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Sets the _dropnulls parameter Controls whether null values are included in response

      Parameters

      • enabled: boolean = true

        Whether to drop nulls (default: true)

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Sets the inlinedoc parameter Includes document content in response

      Parameters

      • enabled: boolean = true

        Whether to include inline documents (default: true)

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Sets the ignorecollectionref parameter Prevents generation of href links for child collections

      Parameters

      • enabled: boolean = true

        Whether to ignore collection refs (default: true)

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Use OR logic for the where clause (sets opmodeor=1)

      Parameters

      • enabled: boolean = true

        Whether to use OR logic (default: true)

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Enables default server-side paging (oslc.paging) The server will use its configured default page size.

      Parameters

      • enabled: boolean = true

        Whether to enable paging (default: true)

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Removes rowstamps from parent and child objects (ignorers=1)

      Parameters

      • enabled: boolean = true

        Whether to ignore rowstamps (default: true)

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Removes ref and localref from parent and child objects (ignorekeyref=1)

      Parameters

      • enabled: boolean = true

        Whether to ignore key refs (default: true)

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Adds JSON schema to the response (addschema=1)

      Parameters

      • enabled: boolean = true

        Whether to add schema (default: true)

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Changes geometry data format in the response (geometryformat=1)

      Parameters

      • enabled: boolean = true

        Whether to change geometry format (default: true)

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Adds internal values to the response (internalvalues=1) For example, adds status_maxvalue alongside status

      Parameters

      • enabled: boolean = true

        Whether to include internal values (default: true)

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Returns relative URIs instead of absolute URIs (relativeuri=1) Note: This may not work in all scenarios

      Parameters

      • enabled: boolean = true

        Whether to use relative URIs (default: true)

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Enables E-Signature checking (checkesig=1) When set, server responds with BMXAA9766E if an E-Signature enabled attribute is modified. Use withEsigAuth() to provide the E-Signature password when re-submitting.

      Returns this

      This builder instance for chaining

    • Sets the group by columns for aggregation queries (gbcols)

      Parameters

      • columns: string | string[]

        Comma-separated columns or array of column names

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Sets the order by clause for group by queries (gbsortby) Follows the same syntax as oslc.orderBy

      Parameters

      • orderBy: string

        The order by clause (e.g., '+count' or '-total')

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Sets the range clause for group by queries (gbrange)

      Parameters

      • range: string

        The range clause for the group by query

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

    • Sets a custom query parameter Use this for any parameter not covered by the built-in methods.

      Parameters

      • name: string

        The parameter name

      • value: string

        The parameter value

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

      query.param('customParam', 'value')
      .param('anotherParam', '123');
    • Sets multiple custom query parameters at once

      Parameters

      • params: Record<string, string>

        Object containing parameter name-value pairs

      Returns QueryBuilder<T>

      This QueryBuilder instance for chaining

      query.params({ customParam: 'value', anotherParam: '123' });
      
    • Creates a clone of this QueryBuilder instance This is useful for pagination to reuse the same query parameters

      Returns QueryBuilder<T>

      A new QueryBuilder instance with the same parameters

    • Checks if page settings have been defined on this query

      Returns boolean

      True if page settings have been defined, false otherwise

    • Checks if count has been requested on this query

      Returns boolean

      True if count has been requested, false otherwise

    • Builds the query for execution

      Returns BuiltQuery

      A BuiltQuery object ready for execution

    Constructors

    • Creates a new QueryBuilder for a specific object structure

      Type Parameters

      • T extends OslcResource

        The resource type that extends OslcResource

      Parameters

      • objectStructure: string

        The Maximo object structure name

      Returns QueryBuilder<T>