Space SDK Package

Space SDK Package

  • Users
  • Storage
  • Space Docs

@spacehq/sdk > UserMetadataStore

UserMetadataStore interface

Metadata Store manages storing and retrieval of a particular users bucket schema information.

Signature:

export interface UserMetadataStore 

Properties

PropertyTypeDescription
createBucket(bucketSlug: string, dbId: string, bucketKey: string) => Promise<BucketMetadata>Create a BucketSchema record with dbId belonging to the current user.It should fail if a bucketSlug with similar dbId already exists.
findBucket(bucketSlug: string) => Promise<BucketMetadata | undefined>Find bucket metadata with slug belonging to the current user matching
findFileMetadata(bucketSlug: string, dbId: string, path: string) => Promise<FileMetadata | undefined>Find existing metadata information about the file at path.
findFileMetadataByUuid(uuid: string) => Promise<FileMetadata | undefined>Find existing metadata information about the file with uuid
findSharedFilesByInvitation(invitationId: string) => Promise<SharedFileMetadata | undefined>Lookup a received shared file by invitation id.
listBuckets() => Promise<BucketMetadata[]>Returns a list of all bucket schemas belonging to the current user
listSharedWithMeFiles() => Promise<SharedFileMetadata[]>List all shared with me files for the existing user
setFilePublic(metadata: FileMetadata) => Promise<void>Make the file with uuid publicly accessible by storing in a datastore domain that is public.
upsertFileMetadata(data: FileMetadata) => Promise<FileMetadata>Updates the metadata information about a specific file.
upsertSharedByMeFile(data: SharedFileMetadata) => Promise<SharedFileMetadata>Inserts a new file. If a file with the same dbId, path and bucket slug exists, the existing record would be updated and returned.
upsertSharedWithMeFile(data: SharedFileMetadata) => Promise<SharedFileMetadata>Inserts a new shared with me file. If a file with the same dbId, path and bucket slug exists, the existing record would be updated and returned.

Methods

MethodDescription
addUserRecentlySharedWith(user)Add user to set of users current user has recently shared files with.
getNotificationsLastSeenAt()Get the notifications last seen at
listSharedByMeFiles()List all shared files current user has shared with other users.
listUsersRecentlySharedWith()List set of users the current user has recently shared files with
setNotificationsLastSeenAt(timestamp)Set the notifications last seen at
  • UserMetadataStore interface
  • Properties
  • Methods
Space SDK Package
Docs
Getting StartedUsersStorage
Resources
All DocumentationProject SlackBlog
More
GitHubStar
Follow @spacestorage