Skip to content

Commit

Permalink
Add storageList caller id param
Browse files Browse the repository at this point in the history
  • Loading branch information
sesposito committed Sep 8, 2023
1 parent 6ad13f8 commit f1dc95c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4091,10 +4091,11 @@ declare namespace nkruntime {
* @param collection - Opt. Storage collection.
* @param limit - Opt. Maximum number of items to list. Defaults to 100.
* @param cursor - Opt. Pagination cursor.
* @param callerId - Opt. User ID of the caller, will apply permissions checks of the user. If empty defaults to system user and permissions are bypassed.
* @returns Object containing an array of storage objects and a cursor for the next page of results, if there is one.
* @throws {TypeError, GoError}
*/
storageList(userId: string | null | undefined, collection: string, limit?: number, cursor?: string): StorageObjectList;
storageList(userId: string | void, collection: string, limit?: number, cursor?: string, callerId?: string | void): StorageObjectList;

/**
* Get all storage objects matching the parameters.
Expand Down Expand Up @@ -4790,10 +4791,11 @@ declare namespace nkruntime {
* @param indexName - Index to query.
* @param query - The query to specify the index lookup criteria.
* @param limit - The maximum number of results to retrieve from the index.
* @param callerId - Opt. User ID of the caller, will apply permissions checks of the user. If empty defaults to system user and permissions are bypassed.
* @returns A list of storage objects matching the query criteria.
* @throws {TypeError, GoError}
*/
storageIndexList(idnexName: string, query: string, limit: number): StorageObject[];
storageIndexList(indexName: string, query: string, limit: number, callerId?: string | void): StorageObject[];

/**
* Get Satori object.
Expand Down
4 changes: 2 additions & 2 deletions runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -1066,11 +1066,11 @@ type NakamaModule interface {
WalletLedgerUpdate(ctx context.Context, itemID string, metadata map[string]interface{}) (WalletLedgerItem, error)
WalletLedgerList(ctx context.Context, userID string, limit int, cursor string) ([]WalletLedgerItem, string, error)

StorageList(ctx context.Context, userID, collection string, limit int, cursor string) ([]*api.StorageObject, string, error)
StorageList(ctx context.Context, callerID, userID, collection string, limit int, cursor string) ([]*api.StorageObject, string, error)
StorageRead(ctx context.Context, reads []*StorageRead) ([]*api.StorageObject, error)
StorageWrite(ctx context.Context, writes []*StorageWrite) ([]*api.StorageObjectAck, error)
StorageDelete(ctx context.Context, deletes []*StorageDelete) error
StorageIndexList(ctx context.Context, indexName, query string, limit int) (*api.StorageObjects, error)
StorageIndexList(ctx context.Context, callerID, indexName, query string, limit int) (*api.StorageObjects, error)

MultiUpdate(ctx context.Context, accountUpdates []*AccountUpdate, storageWrites []*StorageWrite, walletUpdates []*WalletUpdate, updateLedger bool) ([]*api.StorageObjectAck, []*WalletUpdateResult, error)

Expand Down

0 comments on commit f1dc95c

Please sign in to comment.