npm package: @plasma-platform/service-properties
Description: SDK for properties service
Author: Anton Nemtsev
Latest version: 0.5.0

![version](https://badgen.net/npm/v/@plasma-platform/service-properties)
![nextVersion](https://badgen.net/npm/v/@plasma-platform/service-properties/next)
![downloads](https://badgen.net/npm/dt/@plasma-platform/service-properties)
![license](https://badgen.net/npm/license/@plasma-platform/service-properties)
![dependency](https://badgen.net/npm/dependents/@plasma-platform/service-properties)  

* * *

[Full documentation](https://templatemonster.gitlab.io/PlasmaPlatform/Frontend/plasma-platform/?path=/story/plasma-platform-sdk--service-properties)  
install:  
`npm i @plasma-platform/service-properties -S`  

# Short documentation

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

-   [PropertiesService](#propertiesservice)
    -   [Parameters](#parameters)
    -   [messages](#messages)
    -   [get](#get)
        -   [Examples](#examples)
    -   [details](#details)
        -   [Parameters](#parameters-1)
        -   [Examples](#examples-1)
    -   [propertiesTree](#propertiestree)
        -   [Parameters](#parameters-2)
        -   [Examples](#examples-2)
    -   [getTopicsTree](#gettopicstree)
        -   [Examples](#examples-3)
    -   [getTopicsTreeByTag](#gettopicstreebytag)
        -   [Examples](#examples-4)

## PropertiesService

-   **See: <http://service-properties.templatemonsterdev.com/doc/>**

Properties Micro Service API that you may adopt for your needs

### Parameters

-   `url` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** service url

### messages

Object with class service messages

Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)

### get

Get properties list

#### Examples

Read properties list


```javascript
(async () => {
  const propertiesService = new PropertiesService('https://api.templatemonsterdev.com/properties/v1/');
  const list = await propertiesService.get();
})();
```

Returns **PropertiesList** array of properties

### details

Get specific propertie

#### Parameters

-   `name` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** propertie name

#### Examples

Get propertie


```javascript
(async () => {
  const propertiesService = new PropertiesService('https://api.templatemonsterdev.com/properties/v1/');
  const details = await propertiesService.details('softwareRequired');
})();
```

Returns **Propertie** propertie

### propertiesTree

Get properties by nesting level

#### Parameters

-   `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** property name
-   `params` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** parameters

#### Examples

Get properties tree


```javascript
(async () => {
  const propertiesService = new PropertiesService('https://api.templatemonsterdev.com/properties/v1/');
  const valuesTree = await propertiesService.valuesTree('topic', {expand='path'});
})();
```

Returns **Propertie** property

### getTopicsTree

Get topic tree properties

#### Examples

Get topic tree properties


```javascript
(async () => {
  const propertiesService = new PropertiesService(serviceUrl);
  const valuesTree = await propertiesService.getTopicsTree();
})();
```

Returns **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** topic tree

### getTopicsTreeByTag

Get property's value tree by tag

#### Examples

Get topic tree properties


```javascript
(async () => {
  const propertiesService = new PropertiesService(serviceUrl);
  const valuesTree = await propertiesService.getTopicsTreeByTag(tagId);
})();
```

Returns **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** topic tree