Skip to content

Commit

Permalink
NK-588 Add storage index listing pagination support (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
sesposito authored Oct 21, 2024
1 parent f48ddb5 commit c7b5486
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project are documented below.
The format is based on [keep a changelog](http://keepachangelog.com) and this project uses [semantic versioning](http://semver.org).

## [Unreleased]
### Changed
- Added pagination support to storage index listing.

### Added
- New runtime function to list user notifications.

Expand Down
7 changes: 6 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3126,6 +3126,11 @@ declare namespace nkruntime {
status?: string
}

export interface StorageIndexResult {
objects: StorageObject[]
cursor: string | null
}

export interface EnvelopeStatusUpdate {
statusUpdate: StatusUpdateMessage
}
Expand Down Expand Up @@ -4990,7 +4995,7 @@ declare namespace nkruntime {
* @returns A list of storage objects matching the query criteria.
* @throws {TypeError, GoError}
*/
storageIndexList(indexName: string, query: string, limit: number, order?: string[], callerId?: string | void): StorageObject[];
storageIndexList(indexName: string, query: string, limit: number, order?: string[], callerId?: string | void, cursor?: string): StorageIndexResult;

/**
* Get Satori object.
Expand Down
2 changes: 1 addition & 1 deletion runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ type NakamaModule interface {
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, callerID, indexName, query string, limit int, order []string) (*api.StorageObjects, error)
StorageIndexList(ctx context.Context, callerID, indexName, query string, limit int, order []string, cursor string) (*api.StorageObjects, string, error)

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

Expand Down

0 comments on commit c7b5486

Please sign in to comment.