import { CallContextLike, HoistService, PlainObject } from '@xh/hoist/core'; export interface JsonBlob { /** Either null for private blobs or special token "*" for globally shared blobs. */ acl: '*'; /** True if this blob has been archived (soft-deleted). */ archived: boolean; /** Timestamp indicating when this blob was archived, or special value `0` if not archived. */ archivedDate: number; dateCreated: number; description: string; /** @internal database ID for this blob. Favor token instead. */ id: number; lastUpdated: number; lastUpdatedBy: string; /** Optional application-specific metadata. */ meta: PlainObject | unknown[]; name: string; /** Username of the blob's creator / owner. */ owner: string; /** Primary unique identifier for getting, updating, and archiving blobs. */ token: string; /** * Application defined type for this blob. Used as a discriminator when querying blobs related * to a particular use-case within an application. */ type: string; /** * Current JSON value of this blob - its contents or data. Will be undefined for blob stubs * returned by `listAsync` if `includeValue` was false. */ value?: any; } /** * Service to read and set chunks of user-specific JSON persisted via Hoist Core's JSONBlob class. * * This service is intended as a general, lightweight utility for persisting small bundles of * unstructured data that might not warrant a full-blown domain object, but which still need to be * persisted back to the database. */ export declare class JsonBlobService extends HoistService { telemetryPrefix: string; static instance: JsonBlobService; /** Retrieve a single JSONBlob by its unique token. */ getAsync(token: string, ctx?: CallContextLike): Promise; /** Retrieve all blobs of a particular type that are visible to the current user. */ listAsync(spec: { type: string; includeValue?: boolean; ctx?: CallContextLike; }): Promise; /** Persist a new JSONBlob back to the server. */ createAsync({ acl, description, type, meta, name, value }: Partial, ctx?: CallContextLike): Promise; /** Modify mutable properties of an existing JSONBlob, as identified by its unique token. */ updateAsync(token: string, update: Partial, ctx?: CallContextLike): Promise; /** Create or update a blob for a user with the existing type and name. */ createOrUpdateAsync(type: string, name: string, data: Partial, ctx?: CallContextLike): Promise; /** Find a blob owned by this user with a specific type and name. If none exists, return null. */ findAsync(type: string, name: string, ctx?: CallContextLike): Promise; /** Archive (soft-delete) an existing JSONBlob, as identified by its unique token. */ archiveAsync(token: string, ctx?: CallContextLike): Promise; }