mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-07-27 02:04:39 +10:00
feat(object transactions): support more types
This commit is contained in:
+4
-2
@@ -1,5 +1,6 @@
|
|||||||
import { Developer, Publisher } from "@prisma/client";
|
import { Developer, Publisher } from "@prisma/client";
|
||||||
import { ObjectReference } from "../objects";
|
import { ObjectReference } from "../objects";
|
||||||
|
import { ObjectTransactionalHandler, TransactionDataType } from "../objects/transactional";
|
||||||
|
|
||||||
export interface GameMetadataSearchResult {
|
export interface GameMetadataSearchResult {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -54,16 +55,17 @@ export type DeveloperMetadata = PublisherMetadata;
|
|||||||
|
|
||||||
export interface _FetchGameMetadataParams {
|
export interface _FetchGameMetadataParams {
|
||||||
id: string;
|
id: string;
|
||||||
|
name: string;
|
||||||
|
|
||||||
publisher: (query: string) => Promise<Publisher>;
|
publisher: (query: string) => Promise<Publisher>;
|
||||||
developer: (query: string) => Promise<Developer>;
|
developer: (query: string) => Promise<Developer>;
|
||||||
|
|
||||||
createObject: (url: string) => ObjectReference;
|
createObject: (data: TransactionDataType) => ObjectReference;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface _FetchPublisherMetadataParams {
|
export interface _FetchPublisherMetadataParams {
|
||||||
query: string;
|
query: string;
|
||||||
createObject: (url: string) => ObjectReference;
|
createObject: (data: TransactionDataType) => ObjectReference;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type _FetchDeveloperMetadataParams = _FetchPublisherMetadataParams;
|
export type _FetchDeveloperMetadataParams = _FetchPublisherMetadataParams;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { Readable } from "stream";
|
|||||||
import { v4 as uuidv4 } from "uuid";
|
import { v4 as uuidv4 } from "uuid";
|
||||||
import { objectHandler } from "~/server/plugins/objects";
|
import { objectHandler } from "~/server/plugins/objects";
|
||||||
|
|
||||||
type TransactionDataType = string | Readable | Buffer;
|
export type TransactionDataType = string | Readable | Buffer;
|
||||||
type TransactionTable = { [key: string]: TransactionDataType }; // ID to data
|
type TransactionTable = { [key: string]: TransactionDataType }; // ID to data
|
||||||
type GlobalTransactionRecord = { [key: string]: TransactionTable }; // Transaction ID to table
|
type GlobalTransactionRecord = { [key: string]: TransactionTable }; // Transaction ID to table
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user