Module: mixins/resource

The resource mixin is responsible for adding, retrieving and updating from an existing project.
Source:

Methods

(inner) resource(project_slug, resource_slug)

Retrieve the details of a project's resource
Parameters:
Name Type Description
project_slug string The projects slug
resource_slug string The resource slug
Source:
Example
txApi.resource('autotest', 'resourcetest')

(inner) resourceCreate(project_slug, form)

Add a new resource to a project
Parameters:
Name Type Description
project_slug string The projects slug
form object An object containing the resource definition
Source:
Example
txApi.resourceCreate('autotest', {
       slug: 'resourcetest',
       name: 'resourcetest',
       i18n_type: 'KEYVALUEJSON',
       content: JSON.stringify({"hello world": "hello world"}),
     })

(inner) resourceDelete(project_slug, resource_slug)

Delete an existing resource
Parameters:
Name Type Description
project_slug string The projects slug
resource_slug string The resource slug
Source:
Example
txApi.resourceDelete('autotest', 'resourcetest)

(inner) resourceDetailsUpdate(project_slug, resource_slug, form)

Update the details of an existing resource
Parameters:
Name Type Description
project_slug string The projects slug
resource_slug string The resource slug
form object An object containing the resource definition
Source:
Example
txApi.resourceDetailsUpdate('autotest', 'resourcetest', {
       name: 'updatedresourcetest',
     })

(inner) resources(project_slug)

Retrieve the resources of the specified project.
Parameters:
Name Type Description
project_slug string The projects slug
Source:
Example
txApi.resources().then(function(data) {})

(inner) resourceSourceStringsUpdate(project_slug, resource_slug, form)

Update the resource strings of an existing resource
Parameters:
Name Type Description
project_slug string The projects slug
resource_slug string The resource slug
form object An object containing the resource definition
Source:
Example
txApi.resourceStringsUpdate('autotest', 'resourcetest', {
       name: 'updatedresourcetest',
     })