0.0.66 • Published 1 year ago
oute-services-asset-sdk v0.0.66
This module expose helper functions
- Initialization
var params = {
url: @server url
token: @access token
}
var Asset = require("oute-services-asset-sdk")
var asset_instance = new Asset(params)Cache functions
- Find asset in cache
asset_instance.findAssetInCache(cache_obj, asset_id)- Find asset location in cache
asset_instance.findAssetLocationInCache(cache_obj, asset, parent_id)- Find asset info in cache this return promise
asset_instance.findAssetInfoInCache(cache_obj, asset_id)- Search assets in cache
search_options = {
annotation: ["PROJECT"],
name: "xyz",
recursive: true //this is helpful when want to find in childs
}
asset_instance.findAssetsInCache(cache_obj, search_options)- Delete assets in cache
asset_ids = ["LSN7rofCP"]
is_hard_delete = false //true when deleting from trash
asset_instance.deleteAssetsInCache(cache_obj, asset_ids, is_hard_delete)- Move asset in cache
asset_ids = ["q-GmTD5-K"]
parent_id = "wi3uim5jQ"
asset_instance.moveAssetsInCache(cache_obj, asset_ids, parent_id)- Get Latest cache
user_id = "test@gofo.app"
workspace_id = "ZzBfJMpfQ"
checksum = undefined
await asset_instance.getLatestCache(user_id, workspace_id, checksum)- Add asset in cache
assets = [{"_id": "eW7jrNnhs"}]
parent_id = "wi3uim5jQ"
asset_instance.addAssetsInCache(cache_obj, assets, parent_id)- Rename asset in cache
asset_id = "TSDKpihJY"
asset_name = "test12"
asset_instance.renameAssetInCache(cache_obj, asset_id, asset_name)- Update favorite in cache
asset_ids = ["TSDKpihJY"]
is_favorite = true
asset_instance.updateFavoriteInCache(cache_obj, asset_ids, is_favorite)- Restore assets in cache
asset_ids = ["LSN7rofCP"]
asset_instance.restoreAssetsInCache(cache_obj, asset_ids)- Empty trash in cache
asset_instance.emptyTrashInCache(cache_obj)Core functions
- Invite members
body = {
"workspace_id": "ZzBfJMpfQ",
"notify": false,
"message": "Hi this is imp",
"asset_ids": ["x1QBwyqbN"],
"invitees": [
{
"email_id": "test1@gofo.app",
"role": "VIEWER" //posible values VIEWER, EDITOR, PERMANENT_DELETED
}
]
}
await asset_instance.inviteMembers(body)- Share to members
body = {
"asset_ids": ["JrIHcMHgd"],
"invitees": [
{
"email_id": "test1@gofo.app",
"role": "VIEWER" //posible values VIEWER, EDITOR, PERMANENT_DELETED
}
]
}
await asset_instance.share(body)- Remove access for member
body = {
"asset_id": "MyTbZOnfH",
"user_id": "test1@gofo.app"
}
await asset_instance.removeAccess(body)- get members
asset_id = "MyTbZOnfH"
await asset_instance.getMembers(asset_id)- update favorite for asset
asset_ids = ["q-GmTD5-K"]
is_favorite = false
await asset_instance.updateFavorite(asset_ids, is_favorite)- Rename asset
asset_id = "q-GmTD5-K"
asset_name = "test12"
await asset_instance.rename(asset_id, asset_name)- Move asset
asset_ids = ["q-GmTD5-K"]
parent_id = "wi3uim5jQ"
await asset_instance.move(asset_ids, parent_id)- Delete asset
asset_ids = ["q-GmTD5-K"]
is_hard_delete = false //true when deleting from trash
await asset_instance.delete(asset_ids, is_hard_delete)- Save asset
body = {
"_id": "q-GmTD5-K",
"name": "test",
"workspace_id": "ZzBfJMpfQ",
"parent_id": null,
"type": "FOLDER",
"user_id": "test@gofo.app",
"share_to_all": false,
"deep_extend": true,
"meta": {
"thumbnail": "https://ccc.oute.app/ZzBfJMpfQ/test@gofo.app/1686221763145/test.jpeg",
"test": 1
}
}
await asset_instance.save(body)- Restore assets
asset_ids = ["LSN7rofCP"]
await asset_instance.restore(asset_ids)- Can access asset
asset_id = "q-GmTD5-K"
await asset_instance.canAccess(asset_id)- Can edit asset
asset_id = "q-GmTD5-K"
await asset_instance.canEdit(asset_id)- Empty trash
workspace_id = "q-GmTD5-K"
await asset_instance.emptyTrash(workspace_id)- Find one
query = {
"_id": "q-GmTD5-K"
}
await asset_instance.findOne(query)- Get event list
query = {} //send if want to filter data
await asset_instance.getEvents(query)- Get sheet list
query = { parent_id: "q-GmTD5-K"} //send if want to filter data
await asset_instance.getSheets(query)0.0.62
1 year ago
0.0.63
1 year ago
0.0.64
1 year ago
0.0.65
1 year ago
0.0.66
1 year ago
0.0.60
1 year ago
0.0.61
1 year ago
0.0.59
1 year ago
0.0.51
2 years ago
0.0.52
2 years ago
0.0.53
2 years ago
0.0.54
2 years ago
0.0.55
2 years ago
0.0.56
1 year ago
0.0.57
1 year ago
0.0.58
1 year ago
0.0.50
2 years ago
0.0.49
2 years ago
0.0.48
2 years ago
0.0.46
2 years ago
0.0.47
2 years ago
0.0.45
2 years ago
0.0.44
2 years ago
0.0.43
2 years ago
0.0.42
2 years ago
0.0.40
2 years ago
0.0.41
2 years ago
0.0.38
2 years ago
0.0.39
2 years ago
0.0.37
2 years ago
0.0.32
2 years ago
0.0.33
2 years ago
0.0.34
2 years ago
0.0.35
2 years ago
0.0.36
2 years ago
0.0.31
2 years ago
0.0.30
2 years ago
0.0.29
2 years ago
0.0.28
2 years ago
0.0.27
2 years ago
0.0.26
2 years ago
0.0.25
2 years ago
0.0.24
2 years ago
0.0.23
2 years ago
0.0.22
2 years ago
0.0.21
2 years ago
0.0.20
2 years ago
0.0.19
2 years ago
0.0.18
2 years ago
0.0.17
2 years ago
0.0.16
2 years ago
0.0.15
2 years ago
0.0.14
2 years ago
0.0.13
2 years ago
0.0.12
2 years ago
0.0.11
2 years ago
0.0.10
2 years ago
0.0.9
2 years ago
0.0.8
2 years ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.5
2 years ago
0.0.4
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago