UNPKG

trimble-connect-sdk

Version:

Trimble Connect SDK for JavaScript

798 lines (797 loc) 36.9 kB
import { DeleteOptions, GetOptions, ListOptions, PagedItems, ResourceIdentityWithError, UserInfoGetOptions, UserInfoResponse, WSSubscriptionResponse } from './common'; import { Configuration } from './config'; import { Policy } from './policy'; import { ServiceResponse } from './response'; import { Service } from './service'; export declare const DefaultPSetServiceUri = "https://pset-api.connect.trimble.com/v1/"; /** * The request body for the @see PSet#createLibrary operation. */ export interface CreateLibraryRequest { /** The optional identifier for the new library, if not provided service will generate an unique identifier. */ id?: string; /** The access conrol policy document to be attached to the library. */ policy?: Policy; /** The optional library name. */ name?: string; /** The optional description. */ description?: string; } /** * The request parameters for the @see PSet#getLibrary operation. */ export interface GetLibraryOptions extends GetOptions { } /** * The request parameters for the @see PSet#getDefinition operation. */ export interface GetDefinitionOptions extends GetOptions { } /** * The request body for the @see PSet#updateLibrary operation. * All properties are optional, if property is not provided in the request the property will retain it's old value. */ export interface UpdateLibraryRequest { /** * The last seen version of the tree descriptor. * If provided service will use this information for the concurency control and will refuse to apply changes if current version is not equal to version provided in the request. */ v?: number; /** * The access conrol policy document to be attached to the library. * If property is specified caller must have org:UpdateLibraryPolicy right to execute this operation in addition to org:UpdateLibrary. */ policy?: Policy; /** The new name. */ name?: string; /** The new description. */ description?: string; } /** * The tree descriptor returned from @see PSet#createLibrary , @see PSet#updateLibrary , @see PSet#deleteLibrary and @see PSet#getLibrary operations. */ export interface LibraryResponse { /** The unique library identifier. */ id: string; /** The creation timestamp in ISO format. */ createdAt: string; /** The identifier of the principal who created the tree. */ createdBy: string; /** The last modification timestamp in ISO format. */ modifiedAt: string; /** The identifier of the princilat who last modified the tree descriptor. */ modifiedBy: string; /** The current version of the tree descriptor. */ v: number; /** The access conrol policy document attached to the library. This property is returned only if caller has pset:GetLibraryPolicy right. */ policy?: Policy; /** The deletion marker. If not present or false the tree is active, otherwise the tree is marked as deleted. */ deleted?: boolean; /** The library name. */ name: string; /** The optional description. */ description?: string; /** The collection of actions current user has rights to perform on this resource at the moment the response is generated by service. Not returned when specific version is requested. */ _actions?: string[]; } /** * The request body for the @see PSet#createDefinition operation. */ export interface CreateDefinitionRequest { /** The optional identifier for the new pset definition, if not provided service will generate an unique identifier. */ id?: string; /** The pset name. */ name: string; /** The optional description. */ description?: string; /** The optional collection of resource types the pset applicable to. */ types?: string[]; /** The pset schema. */ schema: object; /** The internationalization part with translation tables. */ i18n?: object; } /** * The request body for the @see PSet#updateDefinition operation. * All properties are optional, if property not provided in the request the property will retain it's old value. */ export interface UpdateDefinitionRequest { /** * The last seen version of the tree descriptor. * If provided service will use this information for the concurency control and will refuse to apply changes if current version is not equal to version provided in the request. */ v?: number; /** The new name. */ name?: string; /** The new description. */ description?: string; /** The new collection of resource types the pset applicable to. */ types?: string[]; /** The new pset schema. */ schema?: object; /** The internationalization part with translation tables. */ i18n?: object; } /** * The pset definition descriptor returned from @see PSet#createDefinition, @see PSet#updateDefinition, @see PSet#deleteNode, @see PSet#getDefinition and @see Organiser#getDefinitionVersion operations. */ export interface DefinitionResponse { /** The library identifier. */ libId: string; /** The definition identifier. Unique inside the library. */ id: string; /** The creation timestamp in ISO format. */ createdAt: string; /** The identifier of the principal who created the node. */ createdBy: string; /** The last modification timestamp in ISO format. */ modifiedAt: string; /** The identifier of the princilat who last modified the node. */ modifiedBy: string; /** The version number. */ v: number; /** The deletion marker. If not present or false the node is active, otherwise the node is marked as deleted. */ deleted?: boolean; /** The name. */ name: string; /** The optional description. */ description?: string; /** The collection of resource types the pset applicable to. If not present pset can be attached to all resource types. */ types?: string[]; /** The pset schema. */ schema: object; /** The internationalization part with translation tables. */ i18n: object; /** The collection of actions current user has rights to perform on this resource at the moment the response is generated by service. Not returned when specific version is requested. */ _actions?: string[]; } /** * The request options to validate psets against a new schema. */ export interface ValidateOptions { /** * The if defined and true informs server that entities marked as deleted should be returned as well. * The default behavior is to skip/hide entitied marked as deleted. */ deleted?: boolean; /** The skip token used a as cursor to indicate the place where next page of results should fetched from. */ skiptoken?: string; } /** * The request body for the @see PSet#validate operation. */ export interface ValidateRequest { /** The schema to validate existing data against. */ schema: object; } /** * The response body for the @see PSet#validate operation. */ export interface ValidateResponse { /** The number of valid psets. */ validItemsCount: number; /** The number of not valid psets. */ invalidItemsCount: number; /** The collection of error messages for found invalid psets. Only first 100 unique error messages are returned. */ errors?: string[]; /** The link to the next page. If not present, this is the last page. */ next?: string; } /** * The de-serialized data returned from the request with list of pset definitions. */ export interface ListDefinitionsResponse extends PagedItems<DefinitionResponse> { } /** * The de-serialized data returned from the request with list of definitions. */ export interface ListDefinitionsOptions extends ListOptions { /** The return only pset definitions applicable to the given resource type. */ type?: string; /** The name prefix to filter pset definitions. Only definitions whos name starts with this prefix are returned. */ prefix?: string; } /** * The de-serialized data returned from the request with list of definition versions. */ export interface ListDefinitionVersionsOptions extends ListOptions { } /** * The request body for the @see PSet#updatePSet operation. * All properties are optional, if property not provided in the request the property will retain it's old value. */ export interface PSetRequest { /** * The last seen version of the pset instance. * If provided service will use this information for the concurency control and will refuse to apply changes if current version is not equal to version provided in the request. */ v?: number; /** The version of the pset definition schema. */ schemaV?: number; /** The new property values. */ props?: object; } /** * The pset instance response. */ export interface PSetResponse { /** The link to the external resource. */ link: string; /** The library identifier. */ libId: string; /** The pset definition identifier. */ defId: string; /** The creation timestamp in ISO format. */ createdAt: string; /** The identifier of the principal who created the node. */ createdBy: string; /** The last modification timestamp in ISO format. */ modifiedAt: string; /** The identifier of the princilat who last modified the node. */ modifiedBy: string; /** The version number. */ v: number; /** The deletion marker. If not present or false the node is active, otherwise the node is marked as deleted. */ deleted?: boolean; /** The version of pset definition schema for this pset instance. */ schemaV: number; /** The property values. */ props: object; /** The collection of actions current user has rights to perform on this resource at the moment the response is generated by service. Not returned when specific version is requested. */ _actions?: string[]; } /** * The pset key. */ export interface PSetKey { /** The link to the external resource. */ link: string; /** The library identifier. */ libId: string; /** The pset definition identifier. */ defId: string; /** The version number. */ v?: number; } /** * Body for batch request of property sets */ export interface PSetKeyRequest { /** The collection of keys for PSets to get. */ items: PSetKey[]; } /** * The pset definition/version identifier. Used in batch get. */ export interface PSetDefId { /** The pset definition identifier. When only the id is specified then the latest version is requested. */ id: string; /** Requesting the definition with this schema version. Optional, can't be used together with 'v'. */ schemaV?: number; /** Requesting the definition with this version. Optional, can't be used together with 'schemaV'. */ v?: number; } /** * Body for batch request of property set definitions. */ export interface PSetDefIdRequest { /** The collection of ids for PSet definitions to get. */ items: PSetDefId[]; } /** * An error descriptor from the batch get PSet definitions API. */ export interface PSetDefIdError { /** The pset definition/version identifier (from the request). */ item: PSetDefId; /** The error code. */ code: string; /** A human readable error message. */ message: string; } /** * The response from batch get PSet definitions API. */ export interface BatchPSetDefResponse { /** The list of unprocessed PSet definition keys. */ unprocessed?: PSetDefId[]; /** The collection PSet definitions. */ items?: DefinitionResponse[]; /** The list of errors. */ errors?: PSetDefIdError[]; } /** * Body for batch request of property sets for a lib/def */ export interface LinkRequest { /** The array of links for PSets to get. */ items: string[]; } export interface BatchPSetResponse<T> { /** The collection of property sets. */ items: PSetResponse[]; /** The collection of unhandled requests. */ unhandled?: T[]; } /** * The library identity. */ export interface LibraryIdentity { /** The library identifier. */ libId: string; } /** * The definition identity. */ export interface DefinitionIdentity { /** The library identifier. */ libId: string; /** The definition identifier. */ defId: string; /** Requesting the resource with this version. Optional. If not specified the latest version is requested. */ v?: number; /** Requesting the definition with this schema version. Optional. If not specified the latest version is requested. */ schemaV?: number; } /** * The pset identity. */ export interface PSetIdentity { /** The link. */ link: string; /** The library identifier. */ libId: string; /** The definition identifier. */ defId: string; /** Requesting the resource with this version. Optional. If not specified the latest version is requested. */ v?: number; } /** * The batch get API request body. */ export interface PSetBatchGetRequest extends PSetBatchGetMap<LibraryIdentity, DefinitionIdentity, PSetIdentity> { } /** * The BatchGet API options. */ export interface PSetBatchGetOptions extends GetOptions { } /** * The node descriptor that includes the tree identity. */ export interface DefinitionWithLibIdentityResponse extends DefinitionResponse { /** The library identifier. */ libId: string; } /** * The response from batch get API. */ export interface PSetBatchGetResponse { /** The list of unprocessed requested resources. * It is important that client has a retry logic to fetch the items unprocessed in the original request. * Collection of unprocessed items can be passed as is to the next request. */ unprocessed: PSetBatchGetMap<LibraryIdentity, DefinitionIdentity, PSetIdentity>; /** The collection requested nodes. */ responses: PSetBatchGetMap<LibraryResponse, DefinitionWithLibIdentityResponse, PSetResponse>; /** The list of errors. */ errors: PSetBatchGetMap<ResourceIdentityWithError<LibraryIdentity>, ResourceIdentityWithError<DefinitionIdentity>, ResourceIdentityWithError<PSetIdentity>>; } /** * The pset service map structure used in batch get API. */ export interface PSetBatchGetMap<L, D, P> { /** The collection libraries. */ libs?: L[]; /** The collection definitions. */ defs?: D[]; /** The collection psets. */ psets?: P[]; } /** * The request options to query psets by link. */ export interface ListPSetsOptions extends ListOptions { } /** * The request options to query psets by definition. */ export interface ListPSetsByDefinitionOptions extends ListOptions { /** The link prefix to filter psets by. */ link?: string; } /** * The de-serialized data returned from the request with list of pset instances. */ export interface ListPSetsResponse extends PagedItems<PSetResponse> { } /** * The de-serialized data returned from the request with list of definition versions. */ export interface ListPSetVersionsOptions extends ListOptions { } /** * The request body for @see PSet#changeset operation. */ export interface PSetChangesetRequest { /** The collection of change requests to PSets. */ items: ChangePSetRequest[]; } /** * The items in request body for @see PSet#changeset operation. * All properties except referencing keys are optional, if property not provided in the request the property will retain it's old value. */ export interface ChangePSetRequest { /** The link to the external resource. */ link: string; /** The library identifier. */ libId: string; /** The pset definition identifier. */ defId: string; /** * The last seen version of the pset instance. * If provided service will use this information for the concurency control and will refuse to apply changes if current version is not equal to version provided in the request. */ v?: number; /** The version of the pset definition schema. */ schemaV?: number; /** The new property values. */ props?: object; /** The deletion flag. If specified it is an instruction to mark the pset as deleted. */ deleted?: boolean; } /** * The response body for @see PSet#changeset operation if it goes to async execution mode (>500 items in the request). */ export interface PSetChangesetResponseAccepted { /** The changeset identifier. */ id: string; /** The user identifier. */ createdBy: string; /** The creation timestamp in ISO format. */ createdAt: string; /** The changeset processing status: WaitingUpload, Queued, Processing, Done, Failed. */ status: string; } /** * The response body for @see PSet#changeset operation if it is executed in sync mode (<=500 items in the request). */ export interface PSetChangesetResponseInline extends PSetChangesetResponseAccepted { /** The timestamp in ISO format when processing has been started. */ startedAt: string; /** The timestamp in ISO format when processing has been finished. */ processedAt: string; /** The error message if processing of the changeset failed. */ message?: string; /** Number of items successfull processed. */ itemCount: number; /** Number of failed request items. */ errorCount: number; /** The collection of echoed PSets after processing changes. */ items: PSetResponse[]; /** The collection of failed change requests. */ errors?: PSetChangesetError[]; } /** * The changeset request processing failed due to some error. */ export interface PSetChangesetError { /** The change requested in the changeset. */ item: ChangePSetRequest; /** The error code. */ code: string; /** The error message. */ message: string; } /** * The response body for initializing asynchronous changeset, @see PSet#changesetAsync operation. */ export interface PSetChangesetResponseAsync extends PSetChangesetResponseAccepted { /** Url for uploading request items. File must contain multiple separate ChangePSetRequest objects in Newline Delimited JSON format (see http://ndjson.org/, Content-Type=application/x-ndjson). */ uploadUrl: string; } /** * The response body for @see PSet#changesetStatus operation. */ export interface PSetChangesetResponse extends PSetChangesetResponseAccepted { /** The timestamp in ISO format when processing has been started. */ startedAt?: string; /** The timestamp in ISO format when processing has been finished. */ processedAt?: string; /** The error message if processing of the changeset failed. */ message?: string; /** Number of items successfull processed. */ itemCount: number; /** Number of failed request items. */ errorCount: number; /** Url for downloading echoed processed items. File contains multiple separate PSet objects in Newline Delimited JSON format (see http://ndjson.org/, Content-Type=application/x-ndjson). */ resultsUrl?: string; /** Url for downloading failed request items. File contains multiple separate PSetChangesetError objects in Newline Delimited JSON format (see http://ndjson.org/, Content-Type=application/x-ndjson). */ errorsUrl?: string; } /** * The service client that represents connection to the Organizer Service. * Each API operation is exposed as a function on service. */ export declare class PSet extends Service { /** * @constructor Constructs a service object. * @param {Config} config The configuration options (e.g. service url). If not provided the default configuration will be used. * @param {Credentials} credentials The credentials to be attached to service requests. */ constructor(config?: Partial<Configuration>); /** * Returns information the service knows about the current user. * @returns {Promise<ServiceResponse<UserInfoResponse>>} the information known about the caller. */ getUserInfo(params?: UserInfoGetOptions): Promise<ServiceResponse<UserInfoResponse>>; /** * Returns the tree descriptor. * @param {string} libId The library identifier. * @param {GetLibraryOptions} params The optional request parameters. * @returns {Promise<ServiceResponse<LibraryResponse>>} The service response with tree descriptor. * @throws {ServiceError} in case of the error response from the service. */ getLibrary(libId: string, params?: GetLibraryOptions): Promise<ServiceResponse<LibraryResponse>>; /** * Creates a new library. * @param {CreateLibraryRequest} request The library creation request. * @returns {Promise<ServiceResponse<LibraryResponse>>} The service response with tree descriptor. * @throws {ServiceError} in case of the error response from the service. */ createLibrary(request: CreateLibraryRequest): Promise<ServiceResponse<LibraryResponse>>; /** * Updates the library descriptor. * @param {string} libId The library identifier. * @param {UpdateLibraryRequest} request The library descriptor update request. * @returns {Promise<ServiceResponse<LibraryResponse>>} The service response with tree descriptor. * @throws {ServiceError} in case of the error response from the service. */ updateLibrary(libId: string, request: UpdateLibraryRequest): Promise<ServiceResponse<LibraryResponse>>; /** * Marks the tree as deleted. * @param {string} libId The library identifier. * @returns {Promise<TreeResponse>>} The de-serialized service response with library descriptor. * @param {DeleteOptions} params The optional request parameters. * @throws {ServiceError} in case of the error response from the service. */ deleteLibrary(libId: string, params?: DeleteOptions): Promise<ServiceResponse<LibraryResponse>>; /** * Get the library access control policy. * @param {string} libId The library identifier. * @returns {Promise<ServiceResponse<Policy>>} the access control policy. */ getLibraryPolicy(libId: string): Promise<ServiceResponse<Policy>>; /** * Puts the library access control policy. * @param {string} libId The library identifier. * @param {Policy} policy The policy. * @returns {Promise<ServiceResponse<void>>} the empty response. */ putLibraryPolicy(libId: string, policy: Policy): Promise<ServiceResponse<void>>; /** * Returns some or all (up to 500, default is 100) of the pset definitions in a library. * You can use the request parameters as selection criteria to return a subset of the nodes in a tree. * @param {string} libId The identifier of the library to list definitions from. * @param {ListDefinitionsOptions} params The request parameters. * @returns {Promise<ServiceResponse<ListDefinitionsResponse>>} The de-serialized service response. * @throws {ServiceError} in case of the error response from the service. */ listDefinitions(libId: string, params?: ListDefinitionsOptions): Promise<ServiceResponse<ListDefinitionsResponse>>; /** * Returns some or all (up to 500, default is 100) of the definition versions. * @param {string} libId The library identifier. * @param {string} defId The definition identifier. * @param {ListNodeVersionsOptions} params The request parameters. * @returns {Promise<ServiceResponse<ListDefinitionsResponse>>} The de-serialized service response. * @throws {ServiceError} in case of the error response from the service. */ listDefinitionVersions(libId: string, defId: string, params?: ListDefinitionVersionsOptions): Promise<ServiceResponse<ListDefinitionsResponse>>; /** * Returns the definition descriptor. * @param {string} libId The library identifier. * @param {string} defId The definition identifier. * @param {GetDefinitionOptions} params The optional request parameters. * @returns {Promise<ServiceResponse<DefinitionResponse>>} The service response with pset definition descriptor. * @throws {ServiceError} in case of the error response from the service. */ getDefinition(libId: string, defId: string, params?: GetDefinitionOptions): Promise<ServiceResponse<DefinitionResponse>>; /** * Returns the specific version of the pset definition. * @param {string} libId The library identifier. * @param {string} defId The definition identifier. * @param {number} ver The definition resource version number. * @returns {Promise<ServiceResponse<DefinitionResponse>>} The service response with pset definition descriptor. * @throws {ServiceError} in case of the error response from the service. */ getDefinitionVersion(libId: string, defId: string, ver: number): Promise<ServiceResponse<DefinitionResponse>>; /** * Returns the specific version of the pset definition by the schema version. * @param {string} libId The library identifier. * @param {string} defId The definition identifier. * @param {number} ver The schema version number. * @returns {Promise<ServiceResponse<DefinitionResponse>>} The service response with pset definition descriptor. * @throws {ServiceError} in case of the error response from the service. */ getDefinitionVersionBySchema(libId: string, defId: string, ver: number): Promise<ServiceResponse<DefinitionResponse>>; /** * Returns an object with a collection of property set definitions from a library, a collection of errors and a collection of unhandled requests. * It should never return a paged response. * @deprecated Use batchGet instead * @param {string} libId The library identifier. * @param {PSetDefIdRequest} ids The ids/versions of property set definitions to return. * @param {GetDefinitionOptions} params The optional request parameters. * @returns {Promise<ServiceResponse<BatchPSetDefResponse>>} The service response. * @throws {ServiceError} in case of the error response from the service. */ getPSetDefinitions(libId: string, ids: PSetDefIdRequest, params?: GetDefinitionOptions): Promise<ServiceResponse<BatchPSetDefResponse>>; /** * Creates a new definition. * @param {string} libId The identifier of the library to create a definition in. * @param {CreateDefinitionRequest} request The definition creation request. * @returns {Promise<ServiceResponse<DefinitionResponse>>} The de-serialized service response with tree descriptor. * @throws {ServiceError} in case of the error response from the service. */ createDefinition(libId: string, request: CreateDefinitionRequest): Promise<ServiceResponse<DefinitionResponse>>; /** * Updates the definition. * @param {string} libId The library identifier. * @param {string} defId The definition identifier. * @param {UpdateDefinitionRequest} request The tree descriptor update request. * @returns {Promise<ServiceResponse<DefinitionResponse>>} The de-serialized service response. * @throws {ServiceError} in case of the error response from the service. */ updateDefinition(libId: string, defId: string, request: UpdateDefinitionRequest): Promise<ServiceResponse<DefinitionResponse>>; /** * Marks the definition as deleted. * @param {string} libId The tree identifier. * @param {string} defId The node identifier. * @param {DeleteOptions} params The optional request parameters. * @returns {Promise<ServiceResponse<DefinitionResponse>>} The de-serialized service response with node descriptor. * @throws {ServiceError} in case of the error response from the service. */ deleteDefinition(libId: string, defId: string, params?: DeleteOptions): Promise<ServiceResponse<DefinitionResponse>>; /** * Validates existing pset instances against a schema proposal. * @param {string} libId The library identifier. * @param {string} defId The definition identifier. * @param {ValidateRequest} request The tree descriptor update request. * @param {ValidateOptions} params The request parameters. * @returns {Promise<ServiceResponse<ValidateResponse>>} The de-serialized service response. * @throws {ServiceError} in case of the error response from the service. */ validate(libId: string, defId: string, request: ValidateRequest, params?: ValidateOptions): Promise<ServiceResponse<ValidateResponse>>; /** * Validates existing pset instances against a schema proposal. * @param {ValidateResponse} prev The response for previous page. * @param {ValidateRequest} request The tree descriptor update request. * @returns {Promise<ServiceResponse<ValidateResponse>>} The de-serialized service response. * @throws {ServiceError} in case of the error response from the service. */ validateNextPage(prev: ValidateResponse, request: ValidateRequest): Promise<ServiceResponse<ValidateResponse>>; /** * Returns some or all (up to 500, default is 100) of the psets linked to the external resource. * You can use the request parameters as selection criteria to return a subset of the nodes in a tree. * @param {string} link The link to external resource. * @param {ListPSetsOptions} params The request parameters. * @returns {Promise<ServiceResponse<ListPSetsResponse>>} The de-serialized service response. * @throws {ServiceError} in case of the error response from the service. */ listPSets(link: string, params?: ListPSetsOptions): Promise<ServiceResponse<ListPSetsResponse>>; /** * Returns some or all (up to 500, default is 100) of the psets created from the definition. * You can use the request parameters as selection criteria to return a subset of the nodes in a tree. * @param {string} libId The library id. * @param {string} defId The definition id. * @param {ListPSetsByDefinitionOptions} params The request parameters. * @returns {Promise<ServiceResponse<ListPSetsResponse>>} The de-serialized service response. * @throws {ServiceError} in case of the error response from the service. */ listPSetsByDefinition(libId: string, defId: string, params?: ListPSetsByDefinitionOptions): Promise<ServiceResponse<ListPSetsResponse>>; /** * Returns some or all (up to 500, default is 100) of the pset versions. * @param {string} link The external resource link. * @param {string} libId The library identifier. * @param {string} defId The definition identifier. * @param {ListPSetVersionsOptions} params The request parameters. * @returns {Promise<ServiceResponse<ListPSetsResponse>>} The de-serialized service response. * @throws {ServiceError} in case of the error response from the service. */ listPSetVersions(link: string, libId: string, defId: string, params?: ListPSetVersionsOptions): Promise<ServiceResponse<ListPSetsResponse>>; /** * Returns the pset instance. * @param {string} link The external resource link. * @param {string} libId The library identifier. * @param {string} defId The definition identifier. * @param {GetDefinitionOptions} params The optional request parameters. * @returns {Promise<ServiceResponse<PSetResponse>>} The service response with tree descriptor. * @throws {ServiceError} in case of the error response from the service. */ getPSet(link: string, libId: string, defId: string, params?: GetDefinitionOptions): Promise<ServiceResponse<PSetResponse>>; /** * Returns the specific version of the pset instance. * @param {string} link The external resource link. * @param {string} libId The library identifier. * @param {string} defId The definition identifier. * @param {number} ver The version number. * @param {GetDefinitionOptions} params The optional request parameters. * @returns {Promise<ServiceResponse<PSetResponse>>} The service response with tree descriptor. * @throws {ServiceError} in case of the error response from the service. */ getPSetVersion(link: string, libId: string, defId: string, ver: number): Promise<ServiceResponse<PSetResponse>>; /** * Returns an object with a collection of property sets and a collection of unhandled requsts. * @deprecated Use batchGet instead * @keys {PSetKeyRequest} The keys of property sets to return * @param {GetDefinitionOptions} params The optional request parameters. * @returns {Promise<ServiceResponse<PSetResponse>>} The service response with tree descriptor. * @throws {ServiceError} in case of the error response from the service. */ getPSets(keys: PSetKeyRequest, params?: GetDefinitionOptions): Promise<ServiceResponse<BatchPSetResponse<PSetKey>>>; /** * Returns an object with a collection of property sets and a collection of unhandled requsts. * @deprecated Use batchGet instead * @param {string} libId The library identifier. * @param {string} defId The definition identifier. * @links {LinkRequest} The list of external resource links * @param {GetDefinitionOptions} params The optional request parameters. * @returns {Promise<ServiceResponse<PSetResponse>>} The service response with tree descriptor. * @throws {ServiceError} in case of the error response from the service. */ getPSetsByDefinition(libId: string, defId: string, links: LinkRequest, params?: GetDefinitionOptions): Promise<ServiceResponse<BatchPSetResponse<string>>>; /** * Batch get resources. Different resource types (libs, defs, psets) can be requested in a single request. * It should never return a paged response. * @param {BatchGetRequest} request The ids/versions of resources to return. * @param {BatchGetOptions} params The optional request parameters. * @returns {Promise<ServiceResponse<BatchGetResponse>>} The service response. * @throws {ServiceError} in case of the error response from the service. */ batchGet(request: PSetBatchGetRequest, params?: PSetBatchGetOptions): Promise<ServiceResponse<PSetBatchGetResponse>>; /** * Updates the pset. * @param {string} link The external resource link. * @param {string} libId The library identifier. * @param {string} defId The definition identifier. * @param {UpdateDefinitionRequest} request The tree descriptor update request. * @returns {Promise<ServiceResponse<PSetResponse>>} The de-serialized service response. * @throws {ServiceError} in case of the error response from the service. */ updatePSet(link: string, libId: string, defId: string, request: PSetRequest): Promise<ServiceResponse<PSetResponse>>; /** * Marks the pset as deleted. * @param {string} link The external resource link. * @param {string} libId The tree identifier. * @param {string} defId The node identifier. * @param {DeleteOptions} params The optional request parameters. * @returns {Promise<ServiceResponse<PSetResponse>>} The de-serialized service response with node descriptor. * @throws {ServiceError} in case of the error response from the service. */ deletePSet(link: string, libId: string, defId: string, params?: DeleteOptions): Promise<ServiceResponse<PSetResponse>>; /** * Post a changeset for processing. The changeset is processes synchronously if ther eare <=500 items in the request, otherwise asynchronously. * @param {ChangesetRequest} changeset The request. * @returns {Promise<ServiceResponse<ChangesetResponse | PSetChangesetAcceptedResponse>>} The de-serialized service response. * @throws {ServiceError} in case of the error response from the service. */ changeset(changeset: PSetChangesetRequest): Promise<ServiceResponse<PSetChangesetResponseInline | PSetChangesetResponseAccepted>>; /** * Initialize a changeset and get a link for uploading changeset for later processing. * @returns {Promise<ServiceResponse<ChangesetStatusResponse>>} The de-serialized service response. * @throws {ServiceError} in case of the error response from the service. */ changesetAsync(): Promise<ServiceResponse<PSetChangesetResponseAsync>>; /** * Gets a changeset status. * @param {string} changesetId The changeset identifier. * @returns {Promise<ServiceResponse<ChangesetStatusResponse>>} The de-serialized service response. * @throws {ServiceError} in case of the error response from the service. */ changesetStatus(changesetId: string): Promise<ServiceResponse<PSetChangesetResponse>>; /** * Requests credential to subscribe to change notifications. * @returns {Promise<ServiceResponse<WSSubscriptionResponse>>} The de-serialized service response with temporary credentials and subscription details. * @throws {ServiceError} in case of the error response from the service. */ subscribeWS(): Promise<ServiceResponse<WSSubscriptionResponse>>; }