UNPKG

@springtree/eva-core

Version:
134 lines (116 loc) 4.27 kB
declare module EVA.Blobs { /** * Creates a new, empty blob. If you wish to store data in there directly, use the `StoreBlob` service instead. * * Empty blobs are placeholders; eventually, you'll want to push data in there. This service allows you to create that placeholder, and it is expected you then use the * multipart or raw binary `POST` call to `/blob/{Guid}` to push your data. * * The combination of `Category` and `OriginalName` must be unique, as the `GetBlobInfoService` allows retrieval based on these values. Internally, a fresh and unique `Guid` is * generated and returned from this request. The response also contains the full `Url` by which this blob can be accessed (which will contain aforementioned `Guid`). Use this * path to POST your data, too! * * - [x] The `MimeType` is required, a few suggestions would be `application/pdf`, `text/csv` or `application/json` - but you probably already know this. * - [x] The `ExpireDate` is the date at which the given blob should expire. Leave this empty to *suggest* to keep it forever. We will bag it and get rid of it when the time is right. :hocho: * * When retrieving the blob, it will be returned to you using the `MimeType` as `ContentType` header and a proper `Expires` header. */ export interface CreateBlob { Category?: string; OriginalName?: string; MimeType?: string; /** * @deprecated Use ExpireDate instead. */ LifeTime?: string; ExpireDate?: string; } export interface CreateBlobResponse { Guid?: string; Url: string; Error: EVA.Core.ServiceError; } export interface DeleteBlob { BlobID?: string; } export interface GetBlobInfo { Guid?: string; Category?: string; OriginalName?: string; } export interface GetBlobInfoResponse { Guid?: string; MimeType: string; OriginalName: string; Category: string; ExpireDate?: string; LastModificationTimeUtc?: string; Size: number; Url: string; Error: EVA.Core.ServiceError; } export interface GetProductImagePlaceholder { } export interface GetPlaceholderResponse { Guid?: string; Url: string; Error: EVA.Core.ServiceError; } export interface ListBlobs { PageConfig?: EVA.Core.PageConfig; } export interface ListBlobsResponse { Result: EVA.Core.PagedResult<BlobDto>; Error: EVA.Core.ServiceError; } export interface BlobDto { ID?: string; OriginalName: string; MimeType: string; Category: string; ExpireDate?: string; LocationType: string; Url: string; } export interface ProcessDocument { Data?: number[]; Type?: string; } export interface ProcessDocumentResponse { ProcessedData: number[]; ExtractedText: { [key: string]: any }; Success: boolean; Error: EVA.Core.ServiceError; } export interface SetProductImagePlaceholder { MimeType?: string; Data?: number[]; } export interface SetPlaceholderResponse { Guid?: string; Url: string; Error: EVA.Core.ServiceError; } /** * Creates a new blob and stores `Data` to it. * * The combination of `Category` and `OriginalName` must be unique, as the `GetBlobInfoService` allows retrieval based on these values. Internally, a fresh and unique `Guid` is * generated and returned from this request. The response also contains the full `Url` by which this blob can be accessed (which will contain aforementioned `Guid`). * * - [x] The `MimeType` is required, a few suggestions would be `application/pdf`, `text/csv` or `application/json` - but you probably already know this. * - [x] The `LifeTime` is the time in which the given blob should expire. Leave this empty to *suggest* to keep it forever. We will bag it and get rid of it when the time is right. :hocho: * * When retrieving the blob, it will be returned to you using the `MimeType` as `ContentType` header and a proper `Expires` header. */ export interface StoreBlob { Category?: string; OriginalName?: string; MimeType?: string; Data?: number[]; LifeTime?: string; } export interface StoreBlobResponse { Guid?: string; Url: string; Error: EVA.Core.ServiceError; } }