oute-services-authorized-data-sdk
v0.0.17
Published
- Initialization
Downloads
7
Readme
This module expose helper functions
- Initialization
params = {
url: @server url
token: @access token
}
AuthorizedData = require("oute-services-authorized-data-sdk")
authorized_data_instance = new AuthorizedData(params)
Cache functions
Core functions
- Save
body = {
"_id": "FRldyxUB1",
"name": "slack",
"authorization_id": "FRldyxUB1",
"request_id": "FRldyxUB1",
"parent_id": "q-GmTD5-K",
"workspace_id": "ZzBfJMpfQ",
"configs": {"token": "test"},
"state": "ACTIVE"
}
await authorized_data_instance.save(body)
- delete by id
authorized_data_id = "FRldyxUB1"
await authorized_data_instance.deleteById(authorized_data_id)
- get by parent id
query = {
parent_id: "q-GmTD5-K"
}
await authorized_data_instance.getByParent(query)
- find one
query = {
parent_id: "q-GmTD5-K"
}
await authorized_data_instance.findOne(query)
- map to assets
body = {
"authorized_data_ids": ["FRldyxUB1"],
"workspace_id": "ZzBfJMpfQ",
"asset_id" : "q-GmTD5-K"
}
await authorized_data_instance.mapToAsset(body)