/** * Defines the files that we send to the api server's publish endpoint. */ export type FileType = "root" | "transaction" | "release" | "product" | "table" | "blob" | "tree"; export interface RootFile { readonly data: { readonly markers: FileRefMap; readonly latest: LatestTransaction; readonly trees: FileRefMap; readonly databaseKey: string; }; readonly refs: FileRefResolutionMap; } export interface LatestTransaction { readonly tx: number; readonly date: number; readonly transaction: number; } export interface TreeFile { readonly id: string; readonly name: string; readonly relations: ReadonlyArray; } export interface TreeRelation { readonly childId: string; readonly parentId?: string | undefined; readonly sortNo: number; } /** * File that holds all products as they looked at a given transaction */ export interface TransactionFile { readonly data: { readonly tx: number; readonly date: number; readonly products: FileRefMap; }; readonly refs: FileRefResolutionMap; } export interface ReleaseFile { readonly data: { readonly id: string; readonly name: string; readonly products: FileRefMap; }; readonly refs: FileRefResolutionMap; } export interface ProductFile { readonly data: { readonly id: string; readonly key: string; readonly name: string; readonly description: string; readonly retired: boolean; readonly tables: FileRefMap; }; readonly refs: FileRefResolutionMap; } export interface ProductTableFile { readonly data: { readonly id: string; readonly module: string; readonly name: string; readonly description: string; readonly columns: ReadonlyArray; readonly rows: ReadonlyArray; }; readonly refs: FileRefResolutionMap; } export interface ProductTableFileColumn { readonly type: ProductTableFileColumnType; readonly name: string; readonly params?: string; readonly key?: boolean; readonly description?: string; } export declare const builtinIdColumnName = "builtin@id"; export declare const builtinParentIdColumnName = "builtin@parent_id"; export declare const builtinSortNoColumnName = "sort_no"; export declare enum ProductTableFileColumnType { Text = "Text", LongText = "LongText", PropertyFilter = "PropertyFilter", PropertyValues = "PropertyValues", Blob = "Blob", FixedDiscrete = "FixedDiscrete", DynamicDiscrete = "DynamicDiscrete", DatabaseKey = "DatabaseKey", FixedMultiDiscrete = "FixedMultiDiscrete", Json = "Json", Number = "Number", Product = "Product", Property = "Property", Quantity = "Quantity", Unit = "Unit", TextId = "TextId", PrimaryKey = "PrimaryKey", ForeignKey = "ForeignKey" } export type ProductTableFileRow = ReadonlyArray; export type ProductTableFileCell = string | number | null; export interface FileRefMap { readonly [key: string]: number; } export interface FileRefResolutionMap { readonly [key: string]: string; } export declare function buildReleaseFileName(releaseId: string): string; export declare function buildProductFileName(productId: string, tx: string): string; export declare function buildTransactionFileName(tx: string): string; export declare function buildProductTableFileName(tableId: string, tx: string): string; export declare function buildTreeFileName(treeId: string, hash: string): string; export declare function buildBlobFileName(hash: string): string; export declare function buildRootFileName(): string; export declare function parseReleaseFileName(fileName: string): { readonly releaseId: string; }; export declare function parseTransactionFileName(fileName: string): { readonly tx: string; }; export declare function parseProductFileName(fileName: string): { readonly productId: string; readonly tx: string; }; export declare function parseProductFileIdentifier(fileIdentifier: string): { readonly productId: string; readonly tx: string; }; export declare function parseProductTableFileName(fileName: string): { readonly tableId: string; readonly tx: string; }; export declare function parseProductTableFileIdentifier(fileIdentifier: string): { readonly tableId: string; readonly tx: string; }; /** * For example "product_324234234@12312.json" => ["product", "324234234@12312"] */ export declare function getTypeAndIdentifierFromFileName(fileName: string): { readonly type: FileType; readonly identifier: string; }; //# sourceMappingURL=file-types.d.ts.map