widgrensitasobi-defold
widgrensit/asobi-defold/asobi.api.storage
asobi cloud saves and key-value storage over REST. A project reaches it as
client.storage.
- GitHub: widgrensit/asobi-defold — pinned to
v1.18.1- Pick a release from widgrensit/asobi-defold releases and add its Source code (zip) URL (or a packaged
.zipasset, if the library ships one) togame.projectunder[project]dependencies, then Fetch Libraries in the Defold editor. - Run
bunx @defold-typescript/cli resolveto materialize its types. - Import it under a namespace alias of your choice:
import * as api_storage from "asobi.api.storage"
- Pick a release from widgrensit/asobi-defold releases and add its Source code (zip) URL (or a packaged
Functions
list_saves(client: Client, callback?: HttpCallback)get_save(client: Client, slot: string, callback?: HttpCallback)put_save(client: Client, slot: string, data: Payload, version?: number, callback?: HttpCallback)list_storage(client: Client, collection: string, limit?: number, callback?: HttpCallback)get_storage(client: Client, collection: string, key: string, callback?: HttpCallback)put_storage(client: Client, collection: string, key: string, value: Payload, read_perm?: string, write_perm?: string, callback?: HttpCallback)delete_storage(client: Client, collection: string, key: string, callback?: HttpCallback)
list_saves(client: Client, callback?: HttpCallback)
Fetches the signed-in player's save slots.
Parameters
client:Client— The client.callback?:HttpCallback— Receives the saves, or the error.
get_save(client: Client, slot: string, callback?: HttpCallback)
Fetches one save slot.
Parameters
client:Client— The client.slot:string— The slot's name.callback?:HttpCallback— Receives the save, or the error.
put_save(client: Client, slot: string, data: Payload, version?: number, callback?: HttpCallback)
Writes a save slot.
Parameters
client:Client— The client.slot:string— The slot's name.data:Payload— The save's contents.version?:number— The version the write expects to replace. Writes unconditionally when left out.callback?:HttpCallback— Receives the save, or the error.
list_storage(client: Client, collection: string, limit?: number, callback?: HttpCallback)
Fetches the entries of a storage collection.
Parameters
client:Client— The client.collection:string— The collection's name.limit?:number— The most entries to return. Defaults to50.callback?:HttpCallback— Receives the entries, or the error.
get_storage(client: Client, collection: string, key: string, callback?: HttpCallback)
Fetches one storage entry.
Parameters
client:Client— The client.collection:string— The collection's name.key:string— The entry's key.callback?:HttpCallback— Receives the entry, or the error.
put_storage(client: Client, collection: string, key: string, value: Payload, read_perm?: string, write_perm?: string, callback?: HttpCallback)
Writes a storage entry.
Parameters
client:Client— The client.collection:string— The collection's name.key:string— The entry's key.value:Payload— The entry's value.read_perm?:string— Who may read it. Defaults to"owner".write_perm?:string— Who may write it. Defaults to"owner".callback?:HttpCallback— Receives the entry, or the error.
delete_storage(client: Client, collection: string, key: string, callback?: HttpCallback)
Deletes a storage entry.
Parameters
client:Client— The client.collection:string— The collection's name.key:string— The entry's key.callback?:HttpCallback— Receives the server's answer, or the error.