Skip to main content

Share

This represents what information that is relavent to anything and every sharing related. v1 will look very bare and will add more and more data as we go! if user is undefined && access is public then we have an asset that is publicly available.

Properties

NameType
schemaEmbeddedModelSchema
idstring
userstring
assetFlattenedAsset
assetsFlattenedAssets
linkstring
accessAccessEnum
accessorsAccessors
createdGroupedTimestamp
_shortstring
namestring
distributionsDistributions
scoreScore

Example

import { Share } from '@pieces.app/pieces-os-client'

// TODO: Update the object below with actual values
const example: Share = {
"schema": null,
"id": null,
"user": null,
"asset": null,
"assets": null,
"link": null,
"access": null,
"accessors": null,
"created": null,
"_short": null,
"name": null,
"distributions": null,
"score": null,
}

console.log(example)

// Convert the instance to a JSON string
const exampleJSON: string = JSON.stringify(example)
console.log(exampleJSON)

// Parse the JSON string back to an object
const exampleParsed = JSON.parse(exampleJSON) as Share
console.log(exampleParsed)