import { Action1 } from "./common/Action1"; import { GNHashtable } from "./common/GNData"; import { CloudScriptModels } from "./entity/models/CloudScriptModels"; import { CloudScriptResponseModels } from "./entity/models/CloudScriptResponseModels"; /** * Public client-scoped namespace for the CloudScript domain. * * Reachable through {@link GNNetwork.cloudScript} after * {@link GNNetwork.init}. Provides client-side access to * server-hosted JavaScript / TypeScript functions ("CloudScript") * that the GearN backend executes on demand. * * Functional groupings: * * 1. **Function execution** — `executeFunction`. The backend * runs the named function in the selected script version * and returns the result inside a typed response. The * outcome is described by {@link ExecuteResponseStatus} * (`Ok`, `Exception`, `FunctionNameNotFound`, * `VersionInvalid`, `Timeout`). * * 2. **Function management** (server / admin only) — * `addFunction`, `setFunction`, `removeFunction`, * `getFunctionList`, plus version management * (`addVersion`, `setActiveVersion`, ...). These are * placeholder client-side endpoints; in practice they are * invoked through the dashboard. * * Common contract: same as {@link GamePlayerApi} (HTTP / * `RequestType.CloudScript` / `RequestRole.Client`, * callback + Promise variants, `.server` / `.admin` * sub-namespaces). */ export declare class CloudScriptApi { /** Server-scoped CloudScript operations for trusted backend callers. */ server: ServerCloudScriptApi; /** Admin-scoped CloudScript operations for dashboard or backoffice callers. */ admin: AdminCloudScriptApi; /** * Sends the addFunction operation and returns the typed response via callback. */ addFunction(requestData: CloudScriptModels.AddFunctionRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Sends the addFunction operation and resolves with the typed response. */ addFunctionAsync(requestData: CloudScriptModels.AddFunctionRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Sends the editFunction operation and returns the typed response via callback. */ editFunction(requestData: CloudScriptModels.EditFunctionRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Sends the editFunction operation and resolves with the typed response. */ editFunctionAsync(requestData: CloudScriptModels.EditFunctionRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Sends the executeFunction operation and returns the typed response via callback. */ executeFunction(requestData: CloudScriptModels.ExecuteFunctionRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Sends the executeFunction operation and resolves with the typed response. */ executeFunctionAsync(requestData: CloudScriptModels.ExecuteFunctionRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Sends the getFunction operation and returns the typed response via callback. */ getFunction(requestData: CloudScriptModels.GetFunctionRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Sends the getFunction operation and resolves with the typed response. */ getFunctionAsync(requestData: CloudScriptModels.GetFunctionRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Sends the getFunctions operation and returns the typed response via callback. */ getFunctions(requestData: CloudScriptModels.GetFunctionsRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Sends the getFunctions operation and resolves with the typed response. */ getFunctionsAsync(requestData: CloudScriptModels.GetFunctionsRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; } /** * Server-scoped CloudScript namespace, reachable through * `GNNetwork.cloudScript.server`. * * Mirrors {@link CloudScriptApi} but with the `Server*RequestData` * DTO variants. Used by trusted backend code that needs to * execute or manage CloudScript functions on behalf of any * player without holding their auth token. Always pass a valid * server-side `secretKey`. */ export declare class ServerCloudScriptApi { /** * Sends the addFunction operation and returns the typed response via callback. */ addFunction(requestData: CloudScriptModels.ServerAddFunctionRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Sends the addFunction operation and resolves with the typed response. */ addFunctionAsync(requestData: CloudScriptModels.ServerAddFunctionRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Sends the editFunction operation and returns the typed response via callback. */ editFunction(requestData: CloudScriptModels.ServerEditFunctionRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Sends the editFunction operation and resolves with the typed response. */ editFunctionAsync(requestData: CloudScriptModels.ServerEditFunctionRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Sends the executeFunction operation and returns the typed response via callback. */ executeFunction(requestData: CloudScriptModels.ServerExecuteFunctionRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Sends the executeFunction operation and resolves with the typed response. */ executeFunctionAsync(requestData: CloudScriptModels.ServerExecuteFunctionRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Sends the getFunction operation and returns the typed response via callback. */ getFunction(requestData: CloudScriptModels.ServerGetFunctionRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Sends the getFunction operation and resolves with the typed response. */ getFunctionAsync(requestData: CloudScriptModels.ServerGetFunctionRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Sends the getFunctions operation and returns the typed response via callback. */ getFunctions(requestData: CloudScriptModels.ServerGetFunctionsRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Sends the getFunctions operation and resolves with the typed response. */ getFunctionsAsync(requestData: CloudScriptModels.ServerGetFunctionsRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; } /** * Admin-scoped CloudScript namespace, reachable through * `GNNetwork.cloudScript.admin`. * * Used by the dashboard / backoffice tooling for the * full CloudScript management surface (publish new versions, * promote / demote versions, grant execution permissions). * Routed through {@link RequestRole.Admin} and authorised * against the admin auth token. */ export declare class AdminCloudScriptApi { /** * Sends the addFunction operation and returns the typed response via callback. */ addFunction(requestData: CloudScriptModels.AdminAddFunctionRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Sends the addFunction operation and resolves with the typed response. */ addFunctionAsync(requestData: CloudScriptModels.AdminAddFunctionRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Sends the editFunction operation and returns the typed response via callback. */ editFunction(requestData: CloudScriptModels.AdminEditFunctionRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Sends the editFunction operation and resolves with the typed response. */ editFunctionAsync(requestData: CloudScriptModels.AdminEditFunctionRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Sends the executeFunction operation and returns the typed response via callback. */ executeFunction(requestData: CloudScriptModels.AdminExecuteFunctionRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Sends the executeFunction operation and resolves with the typed response. */ executeFunctionAsync(requestData: CloudScriptModels.AdminExecuteFunctionRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Sends the getFunction operation and returns the typed response via callback. */ getFunction(requestData: CloudScriptModels.AdminGetFunctionRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Sends the getFunction operation and resolves with the typed response. */ getFunctionAsync(requestData: CloudScriptModels.AdminGetFunctionRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; /** * Sends the getFunctions operation and returns the typed response via callback. */ getFunctions(requestData: CloudScriptModels.AdminGetFunctionsRequestData, onResponse?: Action1, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): void; /** * Sends the getFunctions operation and resolves with the typed response. */ getFunctionsAsync(requestData: CloudScriptModels.AdminGetFunctionsRequestData, overrideAuthToken?: string, overrideSecretKey?: string, customTags?: GNHashtable, timeout?: number): Promise; }