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

@iflb/tutti

v1.0.8

Published

## Dependency

Downloads

6

Readme

JavaScript client SDK for Tutti.ai

Dependency

Installation

npm install @iflb/tutti

Importing Module

For web (browser, using CDN):

<script src="https://unpkg.com/@iflb/tutti/dist/tutti.min.js" />
<script>
  var duct = new tutti.TuttiDuct();
</script>

For Node.js (server):

const tutti = require("@iflb/tutti");
var duct = new tutti.TuttiDuct();

Usage

For example, to obtain a list of your Tutti projects:

var duct = new tutti.TuttiDuct();

duct.open("https://{your tutti domain}/ducts/wsd").then( (duct) => {   // Open a connection to Tutti server
  duct.eventListeners.resource.on("listProject", {
    success: (data) => {
      // do anything here
      
      // data = {
      //   Contents: {
      //     ...
      //   },
      //   Timestamp: {
      //     "Requested": int,
      //     "Responded": int
      //   }
      // }
    },
    error: (data) => {
      // handle error here
      
      // data = {
      //   Status: "Error",
      //   Reason: str,
      //   Timestamp: {
      //     "Requested": int,
      //     "Responded": int
      //   }
      // }
    }
  };
  
  duct.controllers.resource.listProject();
});

Handling Events with Event Listeners

duct.eventListeners.{source}.on("{method}", handlers)

Executing Methods with Controllers

duct.controllers.{source}.{method}([ ... args])

Sources

  • resource ... Tutti-relevant resources (projects, templates, nanotasks, answers, ...)
  • mturk ... Amazon Mechanical Turk-relevant operations (wrapper methods for Python Boto3 MTurk API)

Methods

Resource

getEventHistory

  • Parameters: None
  • Gets all input parameter histories set by setEventHistory.

setEventHistory

  • Parameters: eid, query
  • Sets input parameters to a history.

listProjects

  • Parameters: None
  • Lists Tutti projects.

createProject

  • Parameters: ProjectName
  • Creates a Tutti project.

listTemplates

  • Parameters: ProjectName
  • Lists Tutti templates for the specified project.

getResponsesForTemplate

  • Parameters: ProjectName, TemplateName
  • Lists all worker responses for the specified template.

getResponsesForNanotask

  • Parameters: NanotaskId

createTemplates

  • Parameters: ProjectName, TemplateNames, PresetEnvName, PresetTemplateName

listTemplatePresets

  • Parameters: None

getProjectScheme

  • Parameters: ProjectName, Cached

getNanotasks

  • Parameters: ProjectName, TemplateName

deleteNanotasks

  • Parameters: ProjectName, TemplateName, NanotaskIds

updateNanotaskNumAssignable

  • Parameters: ProjectName, TemplateName, NanotaskId, NumAssignable

uploadNanotasks

  • Parameters: ProjectName, TemplateName, Nanotasks, NumAssignable, Priority, TagName

getTemplateNode

  • Parameters: Target, WorkSessionId, NodeSessionId

createSession

  • Parameters: ProjectName, PlatformWorkerId, ClientToken, Platform

setResponse

  • Parameters: WorkSessionId, NodeSessionId, Answers

checkPlatformWorkerIdExistenceForProject

  • Parameters: ProjectName, Platform, PlatformWorkerId

MTurk

getCredentials

  • Parameters: None

setCredentials

  • Parameters: AccessKeyId, SecretAccessKey

setSandbox

  • Parameters: Enabled

clearCredentials

  • Parameters: None

deleteQualifications

  • Parameters: QualificationTypeIds

listQualifications

  • Parameters: None

listWorkersWithQualificationType

  • Parameters: QualificationTypeId

createQualification

  • Parameters: QualificationTypeParams

associateQualificationsWithWorkers

  • Parameters: AssociateQualificationParams

listWorkers

  • Parameters: None

notifyWorkers

  • Parameters: Subject, MessageText, SendEmailWorkerIds

createHITType

  • Parameters: CreateHITTypeParams, HITTypeQualificationTypeId

createHITsWithHITType

  • Parameters: ProjectName, NumHITs, CreateHITsWithHITTypeParams

getHITTypes

  • Parameters: HITTypeIds

expireHITs

  • Parameters: HITIds

deleteHITs

  • Parameters: HITIds

listHITs

  • Parameters: Cached

listHITsForHITType

  • Parameters: HITTypeId=null, Cached=true

listAssignments

  • Parameters: Cached

listAssignmentsForHITs

  • Parameters: HITIds

approveAssignments

  • Parameters: AssignmentIds, RequesterFeedback

rejectAssignments

  • Parameters: AssignmentIds, RequesterFeedback

getAssignments

  • Parameters: AssignmentIds