Class: Thread

Thread(opts)

Thread is an API module for managing Textile threads

Constructor

new Thread(opts)

Parameters:
Name Type Description
opts Object Connection options object
Properties
Name Type Description
url string
Source:

Extends

Methods

(async) add(name, options)

Add a new thread to your Textile node
Parameters:
Name Type Description
name string The name of the new thread
options Object Additional options to send as headers
Properties
Name Type Description
schema string Schema ID for the new thread
sharing string Sharing type for the new thread
Source:
Example
await textile.thread.add("MyMedia", {
  schema: mediaSchema.id,
  type: "open",
  sharing: "shared"
})

(async) addFile(threadId, file, options, headersopt)

Add a file to a thread in your Textile node
Parameters:
Name Type Attributes Description
threadId string Id of the thread
file File FormData object
options object Options object
Properties
Name Type Description
schema string Schema object to use for the mill
caption string Caption to add to the image
headers object <optional>
Extra headers to send in the request
Source:

(async) addFileStream(threadId, fileStream, fileName, options)

Add a file to a thread in your Textile node
Parameters:
Name Type Description
threadId string Id of the thread
fileStream object Nodejs file stream
fileName string Name of the file in the stream
options object Options object
Properties
Name Type Description
schema string Id of the schema to use for the mill
caption string Caption to add to the image
Source:

(async) get()

Retrieves a list of threads
Source:

(async) getById(threadId)

Retrieve a thread by ID
Parameters:
Name Type Description
threadId string ID of the thread
Source:

(async) getByName(name)

Retrieves a thread by its name
Parameters:
Name Type Description
name string Name of the thread to find
Source:

(async) sendGet(url, args, opts)

Make a get request to the Textile node
Parameters:
Name Type Description
url string The relative URL of the API endpoint
args Array.<string> An array of arguments to pass as Textile args headers
opts Object An object of options to pass as Textile options headers
Inherited From:
Source:

(async) sendPost(url, args, opts, data)

Make a post request to the Textile node
Parameters:
Name Type Description
url string The relative URL of the API endpoint
args Array.<string> An array of arguments to pass as Textile args headers
opts Object An object of options to pass as Textile options headers
data Object An object of data to post
Inherited From:
Source:

(async) sendPostMultiPart(url, args, opts, data)

Make a post request to the Textile node using a multi-part form
Parameters:
Name Type Description
url string The relative URL of the API endpoint
args Array.<string> An array of arguments to pass as Textile args headers
opts Object An object of options to pass as Textile options headers
data Object An object of data to post
Inherited From:
Source: