@plasma-platform/service-services

2.6.0 • Public • Published

version nextVersion downloads license dependency


Full documentation
install:
npm i @plasma-platform/service-services -S

Short documentation

Table of Contents

ServicesService

Parameters

  • url string service url
  • token (string | null) user access token if available (optional, default null)

requestService

Request service

Parameters

  • id number (required) ID of the service.
  • locale string locale for service.

Examples

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

Returns Promise<any>

getBundlesForType

Get bundles for type

Parameters

  • type string specific product type is required.
  • locale string locale for bundle. (optional, default 'en')

Examples

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

Returns Promise<any>

getBundlesById

Get bundle by id

Parameters

  • id string ID of the bundle is required.
  • locale string current locale for bundle. (optional, default 'en')

Examples

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

Returns Promise<any>

searchRequestServices

Request Services

Parameters

  • params 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

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

Returns Promise<any>

getRequestServices

Get Request Services

Parameters

  • ids array [8, 101, 1004]
  • locale string current locale for services (optional, default 'en')

Examples

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

Returns Promise<any>

getServicesSuggestions

Get Services Suggests

Parameters

  • params (optional, default {})

Returns Promise<any>

Package Sidebar

Install

npm i @plasma-platform/service-services

Weekly Downloads

1

Version

2.6.0

License

CC-BY-4.0

Unpacked Size

38.2 kB

Total Files

6

Last publish

Collaborators

  • alienmonster
  • ch-tm
  • viram