Skip to content

RFC: Inventory Use Cases and Draft API #109

Description

@digisomni

Please comment with potential use cases and/or considerations for an API. Simple is better for a v1.0, it's best to make this in a way that lends itself to long term evolution.

The current leading method proposed is to use a JSON bookmark style system with arbitrary data attached for things like categorization, plugins, tags, and any extra functionality that is not enforced by the schema. This allows for maximum flexibility.

The Inventory API itself does not have any upload/download for assets, it's simply a way to bookmark items for users on their accounts. An Asset API will also be developed to help ease use cases where uploading/downloading assistance is desired.

Spec

add -> pass userIdentifier, path, filename -> returns ID
remove / delete -> pass userIdentifier, path, filename -> returns bool
edit -> pass userIdentifier, path, filename OR ID and JSON object with data fields to add/remove/modify ->returns modified object data
findByName -> pass userIdentifier, filename -> returns object data
findByID -> pass userIdentifier, ID -> returns object data
findByHash -> pass userIdentifier, hash -> returns object data
findByType -> pass userIdentifier, ID -> returns object data
listItems -> pass userIdentifier, path (optional) -> returns array with each item and a JSON object with its hash and ID
listFullItems -> pass userIdentifier, path (optional) -> returns array with each item and a full JSON object for each

Are these needed? Maybe have the ability to specify what data you want on a find request.
getID -> pass userIdentifier, path, filename -> returns ID
getHash -> pass userIdentifier, path, filename -> returns hash

Item Schema

name - string
description - string
type - string
tags - array
url - string
metadata - JSON object
ID key - not editable by user - string
hash not editable by user - string - SHA256
lastEdited - date
serverItem - bool - this is to allow the server to control the item rather than the user, useful for games and activities. Only the server or an admin can toggle this.

Example

name - Sword
description - A sword that is long.
type - model
tags - ["sword", "long"]
url - https://google.com/sword.fbx
metadata

{
  "bound": true,
  "pendingTransfer": false,
  "stackable": false,
  "stats": {
    "damage": 5,
    "durability": 0.95,
   }
}

ID key - 543JFDASJ83
hash - 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
lastEdited - (Insert ISO date here, undetermined)
serverItem - true

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions