npm package: @plasma-platform/service-services
Description: TM services service api
Author: Anton Nemtsev
Latest version: 2.6.0

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

* * *

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

# Short documentation

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

### Table of Contents

-   [ServicesService](#servicesservice)
    -   [Parameters](#parameters)
    -   [requestService](#requestservice)
        -   [Parameters](#parameters-1)
        -   [Examples](#examples)
    -   [getBundlesForType](#getbundlesfortype)
        -   [Parameters](#parameters-2)
        -   [Examples](#examples-1)
    -   [getBundlesById](#getbundlesbyid)
        -   [Parameters](#parameters-3)
        -   [Examples](#examples-2)
    -   [searchRequestServices](#searchrequestservices)
        -   [Parameters](#parameters-4)
        -   [Examples](#examples-3)
    -   [getRequestServices](#getrequestservices)
        -   [Parameters](#parameters-5)
        -   [Examples](#examples-4)
    -   [getServicesSuggestions](#getservicessuggestions)
        -   [Parameters](#parameters-6)

## ServicesService

-   **See: <http://service-services.dev:8116/doc/>**

### Parameters

-   `url` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** service url
-   `token` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | null)** user access token if available (optional, default `null`)

### requestService

Request service

#### Parameters

-   `id` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** (required) ID of the service.
-   `locale` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** locale for service.

#### Examples

```javascript
(async () => {
  const service = new Service('http://service-services.dev/api/v1/', token);
  const request = await service.requestService(3);
})();
```

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;any>** 

### getBundlesForType

Get bundles for type

#### Parameters

-   `type` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** specific product type is required.
-   `locale` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** locale for bundle. (optional, default `'en'`)

#### Examples

```javascript
(async () => {
  const service = new Service('http://service-services.dev/api/v1/', token);
  const request = await service.getBundlesForType('wordpress');
})();
```

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;any>** 

### getBundlesById

Get bundle by id

#### Parameters

-   `id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** ID of the bundle is required.
-   `locale` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** current locale for bundle. (optional, default `'en'`)

#### Examples

```javascript
(async () => {
  const service = new Service('http://service-services.dev/api/v1/', token);
  const request = await service.getBundlesById('5a844d5ef3c03900010f1974');
})();
```

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;any>** 

### searchRequestServices

Request Services

#### Parameters

-   `params` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** {
     channel: Presentation channel,
     onCart: 1 or 0 (1: Service is proposed for the whole cart; 0: Service is proposed for a special product),
     items: Item/Items to find services by its properties and attributes,
     locale: Presentation locale,
     serviceType: Posible types:
       1) regular - Simple service;
       2) bundle-pack - Service, that contains other services;
       3) bundle-price-selector - something else
     page: page number
     perPage: number of services on a page
    } (optional, default `{}`)

#### Examples

```javascript
(async () => {
  const service = new Service('http://service-services.dev/api/v1/');
  const request = await service.searchRequestServices(params);
})();
```

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;any>** 

### getRequestServices

Get Request Services

#### Parameters

-   `ids` **[array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** [8, 101, 1004]
-   `locale` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** current locale for services (optional, default `'en'`)

#### Examples

```javascript
(async () => {
  const service = new Service('http://service-services.dev/api/v1/');
  const request = await service.searchRequestServices([8, 101, 1004]);
})();
```

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;any>** 

### getServicesSuggestions

Get Services Suggests

#### Parameters

-   `params`   (optional, default `{}`)

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;any>**