npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

oute-services-asset-sdk

v0.0.48

Published

- Initialization

Downloads

616

Readme

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 = "[email protected]"
  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": "[email protected]",
          "role": "VIEWER" //posible values VIEWER, EDITOR, PERMANENT_DELETED
      }
    ]
  }
  await asset_instance.inviteMembers(body)
  • Share to members
  body = {
    "asset_ids": ["JrIHcMHgd"],
    "invitees": [
        {
          "email_id": "[email protected]",
          "role": "VIEWER" //posible values VIEWER, EDITOR, PERMANENT_DELETED
        }
    ]
  }
  await asset_instance.share(body)
  • Remove access for member
  body = {
    "asset_id": "MyTbZOnfH",
    "user_id": "[email protected]"
  }
  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": "[email protected]",
    "share_to_all": false,
    "deep_extend": true,
    "meta": {
      "thumbnail": "https://ccc.oute.app/ZzBfJMpfQ/[email protected]/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)