Class: Contributors
appLib/SDKDrivers/xFrameDriver/contributors.Contributors
Contributors repository.
The Contributors class allows the user to manage contributors.
Hierarchy
-
Repository
↳
Contributors
Implements
Table of contents
Constructors
Methods
Constructors
constructor
• new Contributors(agent
)
Creates an instance of Repository.
Parameters
Name | Type |
---|---|
agent |
PeerAgent |
Inherited from
Methods
create
▸ create(payload
): Promise
<SDKContributor
>
Adds a contributor to the project.
Example
const contributor = await dl.contributors.create({
email: 'user@dataloop.ai',
role: 'annotator'
})
Parameters
Name | Type | Description |
---|---|---|
payload |
Object |
The payload of the contributor to be added. |
payload.email |
string |
The email of the contributor to be added. |
payload.role |
string |
The role of the contributor to be added. |
Returns
Promise
<SDKContributor
>
- A promise that resolves to the added contributor.
Implementation of
IBundle.create
crudReq
▸ crudReq(data
): void
Sends a CRUD request to the xFrame.
Parameters
Name | Type |
---|---|
data |
any |
Returns
void
Inherited from
crudReqSync
▸ crudReqSync(data
, options?
): Promise
<any
>
Sends a CRUD request to the xFrame.
Parameters
Name | Type | Description |
---|---|---|
data |
any |
The data to send. |
options |
Object |
|
options.timeout? |
number |
an option to set the timeout for the request. |
Returns
Promise
<any
>
Inherited from
delete
▸ delete(id
): Promise
<void
>
Removes a contributor from the project.
Example
await dl.contributors.delete('user@dataloop.ai')
Parameters
Name | Type | Description |
---|---|---|
id |
string |
The id (email) of the contributor to be removed. |
Returns
Promise
<void
>
Implementation of
IBundle.delete
get
▸ get(contributorId?
): Promise
<SDKContributor
>
Retrieves a contributor.
Example
const contributor = await dl.contributors.get('user@dataloop.ai')
Parameters
Name | Type | Description |
---|---|---|
contributorId? |
string |
The id (email) of the contributor to be retrieved. |
Returns
Promise
<SDKContributor
>
- A promise that resolves to the retrieved contributor.
Implementation of
IBundle.get
query
▸ query(payload?
): Promise
<IPagedResponse
<SDKContributor
>>
Lists all the contributors of the active project.
Example
const pagedResponse = await dl.contributors.query()
const contributors = pagedResponse.items
Parameters
Name | Type |
---|---|
payload? |
any |
Returns
Promise
<IPagedResponse
<SDKContributor
>>
Returns a Promise that resolves to a paged response object of contributors.
Implementation of
IBundle.query