UNPKG

arlas-tagger-api

Version:

(Un)Tag fields of ARLAS collections

712 lines (711 loc) 14.4 kB
/// <reference path="custom.d.ts" /> import { Configuration } from "./configuration"; /** * * @export */ export declare const COLLECTION_FORMATS: { csv: string; ssv: string; tsv: string; pipes: string; }; /** * * @export * @interface FetchAPI */ export interface FetchAPI { (url: string, init?: any): Promise<Response>; } /** * * @export * @interface FetchArgs */ export interface FetchArgs { url: string; options: any; } /** * * @export * @class BaseAPI */ export declare class BaseAPI { protected basePath: string; protected fetch: FetchAPI; protected configuration: Configuration; constructor(configuration?: Configuration, basePath?: string, fetch?: FetchAPI); } /** * * @export * @class RequiredError * @extends {Error} */ export declare class RequiredError extends Error { field: string; name: "RequiredError"; constructor(field: string, msg?: string); } /** * * @export * @interface Expression */ export interface Expression { /** * * @type {string} * @memberof Expression */ field?: string; /** * * @type {string} * @memberof Expression */ op?: Expression.OpEnum; /** * * @type {string} * @memberof Expression */ value?: string; } /** * @export * @namespace Expression */ export declare namespace Expression { /** * @export * @enum {string} */ enum OpEnum { Eq, Gte, Gt, Lte, Lt, Like, Ne, Range, Within, Notwithin, Intersects, Notintersects, } } /** * * @export * @interface Failure */ export interface Failure { /** * * @type {string} * @memberof Failure */ id?: string; /** * * @type {string} * @memberof Failure */ message?: string; /** * * @type {string} * @memberof Failure */ type?: string; } /** * * @export * @interface Filter */ export interface Filter { /** * * @type {Array<Array<Expression>>} * @memberof Filter */ f?: Array<Array<Expression>>; /** * * @type {Array<Array<string>>} * @memberof Filter */ q?: Array<Array<string>>; /** * * @type {string} * @memberof Filter */ dateformat?: string; /** * * @type {boolean} * @memberof Filter */ righthand?: boolean; } /** * * @export * @interface Form */ export interface Form { /** * * @type {boolean} * @memberof Form */ pretty?: boolean; /** * * @type {boolean} * @memberof Form */ flat?: boolean; } /** * * @export * @interface ModelError */ export interface ModelError { /** * * @type {number} * @memberof ModelError */ status?: number; /** * * @type {string} * @memberof ModelError */ message?: string; /** * * @type {string} * @memberof ModelError */ error?: string; } /** * * @export */ export declare type MultiValueFilterExpression = Array<Expression>; /** * * @export */ export declare type MultiValueFilterString = Array<string>; /** * * @export * @interface Page */ export interface Page { /** * * @type {number} * @memberof Page */ size?: number; /** * * @type {number} * @memberof Page */ from?: number; /** * * @type {string} * @memberof Page */ sort?: string; /** * * @type {string} * @memberof Page */ after?: string; /** * * @type {string} * @memberof Page */ before?: string; } /** * * @export * @interface Projection */ export interface Projection { /** * * @type {string} * @memberof Projection */ includes?: string; /** * * @type {string} * @memberof Projection */ excludes?: string; } /** * * @export * @interface Propagation */ export interface Propagation { /** * * @type {string} * @memberof Propagation */ field?: string; /** * * @type {Filter} * @memberof Propagation */ filter?: Filter; } /** * * @export * @interface Search */ export interface Search { /** * * @type {Array<Filter>} * @memberof Search */ partition_filter?: Array<Filter>; /** * * @type {Filter} * @memberof Search */ filter?: Filter; /** * * @type {Form} * @memberof Search */ form?: Form; /** * * @type {Page} * @memberof Search */ page?: Page; /** * * @type {Projection} * @memberof Search */ projection?: Projection; /** * * @type {string} * @memberof Search */ returned_geometries?: string; } /** * * @export * @interface Tag */ export interface Tag { /** * * @type {string} * @memberof Tag */ path?: string; /** * * @type {any} * @memberof Tag */ value?: any; } /** * * @export * @interface TagRefRequest */ export interface TagRefRequest { /** * * @type {string} * @memberof TagRefRequest */ partition_filter?: string; /** * * @type {Filter} * @memberof TagRefRequest */ filter?: Filter; /** * * @type {Form} * @memberof TagRefRequest */ form?: Form; /** * * @type {Search} * @memberof TagRefRequest */ search?: Search; /** * * @type {Tag} * @memberof TagRefRequest */ tag?: Tag; /** * * @type {Propagation} * @memberof TagRefRequest */ propagation?: Propagation; /** * * @type {string} * @memberof TagRefRequest */ label?: string; /** * * @type {string} * @memberof TagRefRequest */ id?: string; /** * * @type {string} * @memberof TagRefRequest */ action?: TagRefRequest.ActionEnum; /** * * @type {string} * @memberof TagRefRequest */ collection?: string; /** * * @type {number} * @memberof TagRefRequest */ propagated?: number; /** * * @type {number} * @memberof TagRefRequest */ creation_time?: number; /** * * @type {number} * @memberof TagRefRequest */ offset?: number; } /** * @export * @namespace TagRefRequest */ export declare namespace TagRefRequest { /** * @export * @enum {string} */ enum ActionEnum { ADD, REMOVE, REMOVEALL, } } /** * * @export * @interface TagRequest */ export interface TagRequest { /** * * @type {Array<Filter>} * @memberof TagRequest */ partition_filter?: Array<Filter>; /** * * @type {Filter} * @memberof TagRequest */ filter?: Filter; /** * * @type {Form} * @memberof TagRequest */ form?: Form; /** * * @type {Search} * @memberof TagRequest */ search?: Search; /** * * @type {Tag} * @memberof TagRequest */ tag?: Tag; /** * * @type {Propagation} * @memberof TagRequest */ propagation?: Propagation; /** * * @type {string} * @memberof TagRequest */ label?: string; } /** * * @export * @interface UpdateResponse */ export interface UpdateResponse { /** * * @type {string} * @memberof UpdateResponse */ id?: string; /** * * @type {string} * @memberof UpdateResponse */ label?: string; /** * * @type {string} * @memberof UpdateResponse */ action?: UpdateResponse.ActionEnum; /** * * @type {Array<Failure>} * @memberof UpdateResponse */ failures?: Array<Failure>; /** * * @type {number} * @memberof UpdateResponse */ failed?: number; /** * * @type {number} * @memberof UpdateResponse */ updated?: number; /** * * @type {number} * @memberof UpdateResponse */ progress?: number; /** * * @type {number} * @memberof UpdateResponse */ nb_request?: number; /** * * @type {number} * @memberof UpdateResponse */ propagated?: number; /** * * @type {number} * @memberof UpdateResponse */ start_time?: number; /** * * @type {number} * @memberof UpdateResponse */ end_time?: number; /** * * @type {number} * @memberof UpdateResponse */ processing_time_ms?: number; } /** * @export * @namespace UpdateResponse */ export declare namespace UpdateResponse { /** * @export * @enum {string} */ enum ActionEnum { ADD, REMOVE, REMOVEALL, } } /** * StatusApi - fetch parameter creator * @export */ export declare const StatusApiFetchParamCreator: (configuration?: Configuration) => { taggingGet(collection: string, id: string, pretty?: boolean, options?: any): FetchArgs; taggingGetList(collection: string, pretty?: boolean, options?: any): FetchArgs; }; /** * StatusApi - functional programming interface * @export */ export declare const StatusApiFp: (configuration?: Configuration) => { taggingGet(collection: string, id: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<UpdateResponse>; taggingGetList(collection: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<TagRefRequest[]>; }; /** * StatusApi - factory interface * @export */ export declare const StatusApiFactory: (configuration?: Configuration, fetch?: FetchAPI, basePath?: string) => { taggingGet(collection: string, id: string, pretty?: boolean, options?: any): Promise<UpdateResponse>; taggingGetList(collection: string, pretty?: boolean, options?: any): Promise<TagRefRequest[]>; }; /** * StatusApi - object-oriented interface * @export * @class StatusApi * @extends {BaseAPI} */ export declare class StatusApi extends BaseAPI { /** * Get the status of the (un)tagging operation, given the id of a previously requested operation * @summary TagStatus * @param {string} collection collection * @param {string} id The id of a previously requested (un)tag operation. * @param {boolean} [pretty] Pretty print * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StatusApi */ taggingGet(collection: string, id: string, pretty?: boolean, options?: any): Promise<UpdateResponse>; /** * Get the list of previously submitted tag requests * @summary TagList * @param {string} collection collection * @param {boolean} [pretty] Pretty print * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StatusApi */ taggingGetList(collection: string, pretty?: boolean, options?: any): Promise<TagRefRequest[]>; } /** * WriteApi - fetch parameter creator * @export */ export declare const WriteApiFetchParamCreator: (configuration?: Configuration) => { tagPost(collection: string, body?: TagRequest, pretty?: boolean, options?: any): FetchArgs; tagReplay(collection: string, offset: number, pretty?: boolean, options?: any): FetchArgs; untagPost(collection: string, body?: TagRequest, pretty?: boolean, options?: any): FetchArgs; }; /** * WriteApi - functional programming interface * @export */ export declare const WriteApiFp: (configuration?: Configuration) => { tagPost(collection: string, body?: TagRequest, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<UpdateResponse>; tagReplay(collection: string, offset: number, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<number>; untagPost(collection: string, body?: TagRequest, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<UpdateResponse>; }; /** * WriteApi - factory interface * @export */ export declare const WriteApiFactory: (configuration?: Configuration, fetch?: FetchAPI, basePath?: string) => { tagPost(collection: string, body?: TagRequest, pretty?: boolean, options?: any): Promise<UpdateResponse>; tagReplay(collection: string, offset: number, pretty?: boolean, options?: any): Promise<number>; untagPost(collection: string, body?: TagRequest, pretty?: boolean, options?: any): Promise<UpdateResponse>; }; /** * WriteApi - object-oriented interface * @export * @class WriteApi * @extends {BaseAPI} */ export declare class WriteApi extends BaseAPI { /** * Search and tag the elements found in the collection, given the filters * @summary Tag * @param {string} collection collection * @param {TagRequest} [body] * @param {boolean} [pretty] Pretty print * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WriteApi */ tagPost(collection: string, body?: TagRequest, pretty?: boolean, options?: any): Promise<UpdateResponse>; /** * Scan the tagref topic and replay tagging operations from the given offset * @summary TagReplay * @param {string} collection collection * @param {number} offset The offset from which the replay must be done. * @param {boolean} [pretty] Pretty print * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WriteApi */ tagReplay(collection: string, offset: number, pretty?: boolean, options?: any): Promise<number>; /** * Search and untag the elements found in the collection, given the filters * @summary Untag * @param {string} collection collection * @param {TagRequest} [body] * @param {boolean} [pretty] Pretty print * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WriteApi */ untagPost(collection: string, body?: TagRequest, pretty?: boolean, options?: any): Promise<UpdateResponse>; }