import { Action1 } from "./common/Action1"; import { GNHashtable } from "./common/GNData"; import { ContentModels } from "./entity/models/ContentModels"; import { ContentResponseModels } from "./entity/models/ContentResponseModels"; /** * Public client-scoped namespace for the Content domain. * * Reachable through {@link GNNetwork.content} after * {@link GNNetwork.init}. Manages the **metadata** side of the * file pipeline — registering an upload slot, listing previously * uploaded files, requesting a download token, and reading / * writing arbitrary `contentData` blobs keyed by content key. * * Raw byte transfer is intentionally **not** part of this API: * - Upload bytes go through {@link GNNetwork.uploadFile} after * {@link createNewFileUploadInfo} returns a `fileId`. * - Download bytes are fetched through the URL produced by * {@link GNNetwork.getDownloadFileUrl} after * {@link requestDownloadFileUploadInfo} returns a download * token. * * Common contract for every method: * - Routes through HTTP using {@link RequestType.Content} and the * appropriate {@link RequestRole} for the sub-namespace * (`Client` for this class, `Server` / `Admin` for the * sub-namespaces below). * - The standard parameter set * (`overrideAuthToken`, `overrideSecretKey`, `customTags`, * `timeout`) is documented on {@link GNNetwork.sendViaHttp}. */ export declare class ContentApi { /** * Server-scoped Content sub-namespace. Use from trusted * backend code with a valid server `secretKey`. */ server: ServerContentApi; /** * Admin-scoped Content sub-namespace. Use from dashboard / * backoffice tooling with a valid admin auth token. */ admin: AdminContentApi; /** * Reserves a new file slot and returns the `fileId` plus the * upload token / URL needed to push the bytes. * * Backed by {@link OperationCode.CreateNewFileUploadInfo}. * The application typically follows this with * {@link GNNetwork.uploadFile} to push the actual bytes; the * uploaded file becomes downloadable through * {@link requestDownloadFileUploadInfo} once committed. */ createNewFileUploadInfo(requestData: ContentModels.CreateNewFileUploadInfoRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Promise-based wrapper around {@link createNewFileUploadInfo}. */ createNewFileUploadInfoAsync(requestData: ContentModels.CreateNewFileUploadInfoRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Reads a `contentData` blob by content key. * * Backed by {@link OperationCode.GetContentData}. `contentData` * is a small, structured value the GearN backend stores under * a content key — useful for game-wide config, MOTDs, * remote-config flags, etc. Distinct from file uploads, which * use the `*FileUploadInfo*` operations on this class. */ getContentData(requestData: ContentModels.GetContentDataRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Promise-based wrapper around {@link getContentData}. */ getContentDataAsync(requestData: ContentModels.GetContentDataRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Lists previously registered file upload slots, optionally * filtered by tag / metadata supplied on the request DTO. * * Backed by {@link OperationCode.GetFileUploadInfoList}. * Useful for browsing previously uploaded assets, e.g. when * rebuilding a download cache. */ getFileUploadInfoList(requestData: ContentModels.GetFileUploadInfoListRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Promise-based wrapper around {@link getFileUploadInfoList}. */ getFileUploadInfoListAsync(requestData: ContentModels.GetFileUploadInfoListRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Returns the metadata for a single file upload slot. * * Backed by {@link OperationCode.GetFileUploadInfo}. Useful * for inspecting a known `fileId` (size, mime type, upload * status) without downloading the bytes. */ getFileUploadInfo(requestData: ContentModels.GetFileUploadInfoRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Promise-based wrapper around {@link getFileUploadInfo}. */ getFileUploadInfoAsync(requestData: ContentModels.GetFileUploadInfoRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Removes a previously registered file upload slot and any * stored bytes attached to it. * * Backed by {@link OperationCode.RemoveFileUploadInfo}. The * operation is irreversible from the client side; download * URLs that were already issued become invalid. */ removeFileUploadInfo(requestData: ContentModels.RemoveFileUploadInfoRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Promise-based wrapper around {@link removeFileUploadInfo}. */ removeFileUploadInfoAsync(requestData: ContentModels.RemoveFileUploadInfoRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Issues a short-lived download token for an existing file * upload slot. * * Backed by * {@link OperationCode.RequestDownloadFileUploadInfo}. Pair * the returned token with {@link GNNetwork.getDownloadFileUrl} * to obtain the absolute download URL. */ requestDownloadFileUploadInfo(requestData: ContentModels.RequestDownloadFileUploadInfoRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Promise-based wrapper around * {@link requestDownloadFileUploadInfo}. */ requestDownloadFileUploadInfoAsync(requestData: ContentModels.RequestDownloadFileUploadInfoRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Writes / replaces a `contentData` blob by content key. * * Backed by {@link OperationCode.SetContentData}. Use to * publish small structured config values that should be * fetchable through {@link getContentData} later. */ setContentData(requestData: ContentModels.SetContentDataRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Promise-based wrapper around {@link setContentData}. */ setContentDataAsync(requestData: ContentModels.SetContentDataRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; } /** * Server-scoped Content namespace, reachable through * `GNNetwork.content.server`. * * Mirrors every method on {@link ContentApi} but uses the * `Server*RequestData` DTO variants. The server flavour accepts * additional `userId` / `ownerId` parameters so a trusted * backend can act on behalf of any player without holding their * auth token. * * Always pass a valid server-side `secretKey` (typically through * {@link GNServerSettings.setSecretKey} or `overrideSecretKey`) * so the backend can authorise the request. */ export declare class ServerContentApi { /** * Server variant of * {@link ContentApi.createNewFileUploadInfo}. Accepts the * extended {@link ContentModels.ServerCreateNewFileUploadInfoRequestData} * DTO so the request can target an arbitrary player. */ createNewFileUploadInfo(requestData: ContentModels.ServerCreateNewFileUploadInfoRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Promise-based wrapper around the server variant of * {@link ContentApi.createNewFileUploadInfo}. */ createNewFileUploadInfoAsync(requestData: ContentModels.ServerCreateNewFileUploadInfoRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Server variant of {@link ContentApi.getContentData}. */ getContentData(requestData: ContentModels.ServerGetContentDataRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Promise-based wrapper around the server variant of * {@link ContentApi.getContentData}. */ getContentDataAsync(requestData: ContentModels.ServerGetContentDataRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Server variant of {@link ContentApi.getFileUploadInfoList}. */ getFileUploadInfoList(requestData: ContentModels.ServerGetFileUploadInfoListRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Promise-based wrapper around the server variant of * {@link ContentApi.getFileUploadInfoList}. */ getFileUploadInfoListAsync(requestData: ContentModels.ServerGetFileUploadInfoListRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Server variant of {@link ContentApi.getFileUploadInfo}. */ getFileUploadInfo(requestData: ContentModels.ServerGetFileUploadInfoRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Promise-based wrapper around the server variant of * {@link ContentApi.getFileUploadInfo}. */ getFileUploadInfoAsync(requestData: ContentModels.ServerGetFileUploadInfoRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Server variant of {@link ContentApi.removeFileUploadInfo}. */ removeFileUploadInfo(requestData: ContentModels.ServerRemoveFileUploadInfoRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Promise-based wrapper around the server variant of * {@link ContentApi.removeFileUploadInfo}. */ removeFileUploadInfoAsync(requestData: ContentModels.ServerRemoveFileUploadInfoRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Server variant of * {@link ContentApi.requestDownloadFileUploadInfo}. */ requestDownloadFileUploadInfo(requestData: ContentModels.ServerRequestDownloadFileUploadInfoRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Promise-based wrapper around the server variant of * {@link ContentApi.requestDownloadFileUploadInfo}. */ requestDownloadFileUploadInfoAsync(requestData: ContentModels.ServerRequestDownloadFileUploadInfoRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Server variant of {@link ContentApi.setContentData}. */ setContentData(requestData: ContentModels.ServerSetContentDataRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Promise-based wrapper around the server variant of * {@link ContentApi.setContentData}. */ setContentDataAsync(requestData: ContentModels.ServerSetContentDataRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; } /** * Admin-scoped Content namespace, reachable through * `GNNetwork.content.admin`. * * Mirrors the same method set as {@link ServerContentApi} but * routed through {@link RequestRole.Admin}. The backend uses the * caller's admin auth token to authorise privileged operations * such as touching another tenant's files. Most application code * never needs this namespace — dashboard / backoffice tools are * the primary consumers. */ export declare class AdminContentApi { /** * Admin variant of * {@link ContentApi.createNewFileUploadInfo}. */ createNewFileUploadInfo(requestData: ContentModels.AdminCreateNewFileUploadInfoRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Promise-based wrapper around the admin variant of * {@link ContentApi.createNewFileUploadInfo}. */ createNewFileUploadInfoAsync(requestData: ContentModels.AdminCreateNewFileUploadInfoRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Admin variant of {@link ContentApi.getContentData}. */ getContentData(requestData: ContentModels.AdminGetContentDataRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Promise-based wrapper around the admin variant of * {@link ContentApi.getContentData}. */ getContentDataAsync(requestData: ContentModels.AdminGetContentDataRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Admin variant of {@link ContentApi.getFileUploadInfoList}. */ getFileUploadInfoList(requestData: ContentModels.AdminGetFileUploadInfoListRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Promise-based wrapper around the admin variant of * {@link ContentApi.getFileUploadInfoList}. */ getFileUploadInfoListAsync(requestData: ContentModels.AdminGetFileUploadInfoListRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Admin variant of {@link ContentApi.getFileUploadInfo}. */ getFileUploadInfo(requestData: ContentModels.AdminGetFileUploadInfoRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Promise-based wrapper around the admin variant of * {@link ContentApi.getFileUploadInfo}. */ getFileUploadInfoAsync(requestData: ContentModels.AdminGetFileUploadInfoRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Admin variant of {@link ContentApi.removeFileUploadInfo}. */ removeFileUploadInfo(requestData: ContentModels.AdminRemoveFileUploadInfoRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Promise-based wrapper around the admin variant of * {@link ContentApi.removeFileUploadInfo}. */ removeFileUploadInfoAsync(requestData: ContentModels.AdminRemoveFileUploadInfoRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Admin variant of * {@link ContentApi.requestDownloadFileUploadInfo}. */ requestDownloadFileUploadInfo(requestData: ContentModels.AdminRequestDownloadFileUploadInfoRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Promise-based wrapper around the admin variant of * {@link ContentApi.requestDownloadFileUploadInfo}. */ requestDownloadFileUploadInfoAsync(requestData: ContentModels.AdminRequestDownloadFileUploadInfoRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Admin variant of {@link ContentApi.setContentData}. */ setContentData(requestData: ContentModels.AdminSetContentDataRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Promise-based wrapper around the admin variant of * {@link ContentApi.setContentData}. */ setContentDataAsync(requestData: ContentModels.AdminSetContentDataRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; }