import { NestGdatastoreOptions } from './interfaces'; import { Datastore } from '@google-cloud/datastore'; import { Filter } from './interfaces/datastore.interface'; /** * Sample interface for NestGdatastoreService * * Customize this as needed to describe the NestGdatastoreService * */ interface INestGdatastoreService { datastore: Datastore; createEntity(entity: any, kind: string, keyName: string): void; readEntity(kind: string, filters: Filter[], latestEntity: { property: string; }): Promise; replaceEntity(entity: any, kind: string, keyName: string | number): void; editEntity(id: string | number, kind: string, newValues: any[]): void; deleteEntity(kind: string, keyName: string | number): void; } export declare class NestGdatastoreService implements INestGdatastoreService, INestGdatastoreService { private config; private readonly logger; constructor(config: NestGdatastoreOptions); datastore: Datastore; createEntity(entity: any, kind: string, keyName?: string): Promise<[import("@google-cloud/datastore/build/proto/datastore").google.datastore.v1.ICommitResponse]>; /** * @param {string} kind * @param {Filter[]} filters? NOTE: IF FILTERING ON KEY... ONLY USE NUMBER FOR ID * @param {{property:string}} latestEntity? */ readEntity(kind: string, filters?: Filter[], latestEntity?: { property: string; }, orderBy?: { property: string; descending: boolean; }, limit?: number): Promise; private sortObjects; private addFilter; private runSearchQuery; massDeleteEntitiesInKind(kind: string): Promise; private createKeyListFromEntities; private fiveSecondCounter; replaceEntity(entity: any, kind: string, keyName: string | number): Promise<[import("@google-cloud/datastore/build/proto/datastore").google.datastore.v1.ICommitResponse]>; /** * @param {any} id id of the datastore entity * @param {string} kind Kind of the datastore entity * @param {any} newValues Top level key and nested values of the entity. * * eg. [{age:4}, geolocation:{lat:35,lng:65}] * * Given an id, a kind and a new set of values, can edit properties of an entity. * Capable of replacing top level keys with new values. * ie: {"geolocation":{"lat":3,"lng":3}, "age":3} * to replace lat, you will need to replace the whole geolocation object, and pass * in a new geolocation object as the third parameter. * * To replace age, you simply need to pass in {"age":5} as the third parameter. */ editEntity(id: string | number, kind: string, newValues: any[]): Promise; deleteEntity(kind: string, keyName: string | number): Promise<[import("@google-cloud/datastore/build/proto/datastore").google.datastore.v1.ICommitResponse]>; } export {};