/** This is spectacularly generated code by spectacular based on Qlik Cloud Services APIs */ import Auth from '../auth/auth.js'; import ListableResource from '../listable.js'; import type { Config } from '../types/types.js'; export type Filter = { /** The advanced filtering to be applied the query. All conditional statements within this query parameter are case insensitive. @example "(id eq \"626949b9017b657805080bbd\" or id eq \"626949bf017b657805080bbe\") and (status eq \"active\" or status eq \"deleted\")" */ filter?: string; [key: string]: any; }; export type InviteDataResponse = { data?: Array; [key: string]: any; }; export type InviteItem = { /** Email address for this invitee. Example - "foo@qlik.com". */ email: string; /** Optional ISO 639-1 2 letter code for invite language. Defaults to 'en' when missing or not found. */ language?: string; /** Optional display name for this invitee. Example - "Elvis Presley". */ name?: string; /** Flag - when true invite message is sent to inactive or invited users. Typically used to force email resend to users who are not yet active. */ resend?: boolean; [key: string]: any; }; export type InviteRequest = { /** List of invitees who should receive an invite email. */ invitees?: Array; [key: string]: any; }; export type JSONPatch = { /** The operation to be performed. */ op: 'replace' | 'set (Deprecated)' | 'unset (Deprecated)' | 'add (Deprecated)' | 'renew' | string; /** A JSON Pointer. */ path: '/name' | '/roles (Deprecated)' | '/assignedRoles' | '/inviteExpiry' | '/preferredZoneinfo' | '/preferredLocale' | '/status' | string; /** The value to be used for this operation. */ value: string | boolean | Array | Array | Array; [key: string]: any; }; export type JSONPatchArray = Array; export type JSONPatchAssignedRolesRefIDs = { /** The unique role identitier @example "507f191e810c19729de860ea" */ id: string; [key: string]: any; }; export type Metadata = { /** List of system roles to which the user can be assigned. @example ["TenantAdmin","Developer"] */ valid_roles?: Array; [key: string]: any; }; /** A user object. @param assignedGroups - An array of group references. @param assignedRoles - An array of role references. @param created - Deprecated. Use `createdAt` instead. @param createdAt - The timestamp for when the user record was created. @param email - The email address for the user. @param id - The unique user identifier. @param inviteExpiry - The number of seconds until the user invitation will expire. @param lastUpdated - Deprecated. Use `lastUpdatedAt` instead. @param lastUpdatedAt - The timestamp for when the user record was last updated. @param links - Pagination links to the user. @param locale - Represents the end-user's language tag. @param name - The name of the user. @param picture - A static url linking to the avatar of the user. @param preferredLocale - Represents the end-user's preferred language tag. @param preferredZoneinfo - Represents the end-user's preferred time zone. @param roles - List of system roles to which the user has been assigned. Only returned when permitted by access control. Deprecated. Use `assignedRoles` instead. @param status - The status of the user within the tenant. @param subject - The unique user identitier from an identity provider. @param tenantId - The tenant that the user belongs too. @param zoneinfo - Represents the end-user's time zone. @param auth - Auth object used to make requests */ export declare class User { auth: Auth; assignedGroups?: Array; assignedRoles?: Array; created?: string; createdAt?: string; email?: string; id: string; inviteExpiry?: number; lastUpdated?: string; lastUpdatedAt?: string; links?: { self: { href: string; }; }; locale?: string; name: string; picture?: string; preferredLocale?: string; preferredZoneinfo?: string; roles?: Array; status?: 'active' | 'invited' | 'disabled' | 'deleted' | string; subject: string; tenantId: string; zoneinfo?: string; [key: string]: any; constructor({ assignedGroups, assignedRoles, created, createdAt, email, id, inviteExpiry, lastUpdated, lastUpdatedAt, links, locale, name, picture, preferredLocale, preferredZoneinfo, roles, status, subject, tenantId, zoneinfo, ...rest }: { assignedGroups?: Array; assignedRoles?: Array; created?: string; createdAt?: string; email?: string; id: string; inviteExpiry?: number; lastUpdated?: string; lastUpdatedAt?: string; links?: { self: { href: string; }; }; locale?: string; name: string; picture?: string; preferredLocale?: string; preferredZoneinfo?: string; roles?: Array; status?: 'active' | 'invited' | 'disabled' | 'deleted' | string; subject: string; tenantId: string; zoneinfo?: string; }, auth?: Auth); /** Deletes the requested user. Delete user by ID */ delete(): Promise; /** Updates fields for a user resource Update user by ID @param data - An array of JSON Patch documents */ patch(data: JSONPatchArray): Promise; } export type UserAssignedGroups = { /** An array of role references. */ assignedRoles?: Array; /** The unique group identitier @example "507f191e810c19729de860eb" */ id: string; /** The group name @example "Finance" */ name: string; [key: string]: any; }; export type UserAssignedGroupsAssignedRoles = { /** The unique role identitier @example "507f191e810c19729de860ea" */ id: string; /** The role level @example "user" */ level: 'admin' | 'user' | string; /** The role name @example "Developer" */ name: string; /** An array of permissions associated to a given role. @example ["app:create"] */ permissions: Array; /** The type of role @example "default" */ type: 'default' | string; [key: string]: any; }; export type UserAssignedRoles = { /** The unique role identitier @example "507f191e810c19729de860ea" */ id: string; /** The role level @example "user" */ level: 'admin' | 'user' | string; /** The role name @example "Developer" */ name: string; /** An array of permissions associated to a given role. @example ["app:create"] */ permissions: Array; /** The type of role @example "default" */ type: 'default' | string; [key: string]: any; }; export type UserCount = { /** The total number of users in the tenant. */ total: number; [key: string]: any; }; export type UserPostSchema = { /** The roles to assign to the user. */ assignedRoles?: Array | Array; /** The email address for the user. This is a required field when inviting a user. */ email?: string; /** The name of the user. */ name?: string; /** A static url linking to the avatar of the user. */ picture?: string; /** List of system roles to which the user has been assigned. Only returned when permitted by access control. */ roles?: Array; /** The status of the created user within the tenant. @example "invited" */ status?: 'invited' | string; /** The unique user identitier from an identity provider. @example "foo\\12345" */ subject: string; /** The tenant that the user will belong too. @example "DKNmFJCNo8SGURUdh2ll------TENANT" */ tenantId?: string; [key: string]: any; }; export type UserPostSchemaAssignedRolesRefIDs = { /** The unique role identitier @example "507f191e810c19729de860ea" */ id: string; [key: string]: any; }; export declare class Users { auth: Auth; config: Config; constructor(config: Config | Auth); /** Returns the number of users in a given tenant Count users @param tenantId - The tenant ID to filter by. */ count(queryParams?: { tenantId?: string; }): Promise; /** Retrieves a list of users matching the filter using an advanced query string. Filter users @param fields - A comma-delimited string of the requested fields per entity. If the 'links' value is omitted, then the entity HATEOAS link will also be omitted. @param limit - The number of user entries to retrieve. @param next - Get users with IDs that are higher than the target user ID. Cannot be used in conjunction with prev. @param prev - Get users with IDs that are lower than the target user ID. Cannot be used in conjunction with next. @param sort - The field to sort by, with +/- prefix indicating sort order @param data - An advanced query filter to be used for complex user querying in the tenant. */ filter(data: Filter, queryParams?: { fields?: string; limit?: number; next?: string; prev?: string; sort?: 'name' | '+name' | '-name'; }): Promise>; /** Invite one or more users by email address. @param data - */ invite(data: InviteRequest): Promise; /** Redirects to retrieve the user resource associated with the JWT claims. Get my user */ getMe(): Promise; /** Returns the metadata with regard to the user configuration. Deprecated, use GET /v1/roles instead. Get configuration metadata @deprecated */ getMetadata(): Promise; /** Returns the requested user. Get user by ID @param userId - The user's unique identifier @param fields - A comma-delimited string of the requested fields per entity. If the 'links' value is omitted, then the entity HATEOAS link will also be omitted. */ get(userId: string, queryParams?: { fields?: string; }): Promise; /** Returns a list of users using cursor-based pagination. List users @param fields - A comma-delimited string of the requested fields per entity. If the 'links' value is omitted, then the entity HATEOAS link will also be omitted. @param filter - The advanced filtering to use for the query. Refer to RFC 7644 https://datatracker.ietf.org/doc/rfc7644/ for the syntax. Cannot be combined with any of the fields marked as deprecated. All conditional statements within this query parameter are case insensitive. The following fields support the `eq` operator: `id`, `subject`, `name`, `email`, `status`, `clientId`, `assignedRoles.id` `assignedRoles.name`, `assignedGroups.id`, `assignedGroupsAssignedRoles.name` Additionally, the following fields support the `co` operator: `name`, `email`, `subject` Queries may be rate limited if they differ greatly from these examples: ``` (id eq "62716ab404a7bd8626af9bd6" or id eq "62716ac4c7e500e13ff5fa22") and (status eq "active" or status eq "disabled") ``` ``` name co "query" or email co "query" or subject co "query" or id eq "query" or assignedRoles.name eq "query" ``` Any filters for status must be grouped together and applied to the whole query. Valid: ``` (name eq "Bob" or name eq "Alice") and (status eq "active" or status eq "disabled") ``` Invalid: ``` name eq "Bob" or name eq "Alice" and (status eq "active" or status eq "disabled") ``` @param limit - The number of user entries to retrieve. @param next - Get users that come after this cursor value when sorted. Cannot be used in conjunction with `prev`. @param prev - Get users that come before this cursor value when sorted. Cannot be used in conjunction with `next`. @param sort - The field to sort by, with +/- prefix indicating sort order @param totalResults - Whether to return a total match count in the result. Defaults to false. It will trigger an extra DB query to count, reducing the efficiency of the endpoint. @param email - The email to filter by. Deprecated. Use the new `filter` parameter to provide an advanced query filter. @param endingBefore - Get users with IDs that are lower than the target user ID. Cannot be used in conjunction with startingAfter. Deprecated. Use `prev` instead. @param role - The role to filter by. Deprecated. @param sortBy - The user parameter to sort by. Deprecated. Use `sort` instead. @param sortOrder - The sort order, either ascending or descending. Deprecated. Use `sort` instead. @param startingAfter - Get users with IDs that are higher than the target user ID. Cannot be used in conjunction with endingBefore. Deprecated. Use `next` instead. @param status - The status to filter by. Supports multiple values delimited by commas. Deprecated. Use the new `filter` parameter to provide an advanced query filter. @param subject - The subject to filter by. Deprecated. Use the new `filter` parameter to provide an advanced query filter. @param tenantId - The tenant ID to filter by. Deprecated. */ getUsers(queryParams?: { fields?: string; filter?: string; limit?: number; next?: string; prev?: string; sort?: 'name' | '+name' | '-name'; totalResults?: boolean; email?: string; endingBefore?: string; role?: string; sortBy?: 'name'; sortOrder?: 'asc' | 'desc'; startingAfter?: string; status?: 'active' | 'invited' | 'disabled' | 'deleted'; subject?: string; tenantId?: string; }): Promise>; /** Creates an invited user. Create user @param data - */ create(data: UserPostSchema): Promise; }