3.5.0 • Published 3 years ago

@plasma-platform/service-collections v3.5.0

Weekly downloads
5
License
CC-BY-4.0
Repository
gitlab
Last release
3 years ago

version nextVersion downloads license dependency


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

Short documentation

Table of Contents

CollectionsService

  • See: //api.templatemonster.com/collection/v2/

collections Micro Service API that you may adopt for your needs

Parameters

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

messages

Object with class service messages

Type: Object

getCollectionById

Get collection information specified by collection_id

Parameters

Examples

Read collection info

(async () => {
  const collections = new CollectionsService('//api.templatemonster.com/collection/v2/');
  const collection = await collections.getCollectionById('hgm1t2ltgyi7dim9nvo0');
})();

Returns Collection collection object

getColectionItemsById

Get list of collection items of collection specified by collection_id

Examples

Read collection items list

(async () => {
  const collections = new CollectionsService('//api.templatemonster.com/collection/v2/');
  const items = await collections.getColectionItemsById('mfsgxst31slvddqz0miv');
})();

Returns object array of items

getCollectionsOfUser

Get list of collections of user

Parameters

Examples

Get Favorites Collection

(async () => {
  const collections = new CollectionsService('//api.templatemonster.com/collection/v2/');
  const items = await collections.getCollectionsOfUser();
})();

Returns object collections

postCollection

Add new collection

Parameters

Examples

Create collection

(async () => {
  const collections = new CollectionsService('//api.templatemonster.com/collection/v2/');
  const item = await collections.postCollection('Favorites');
})();

Returns Collection collection object

postItem

Add new collection item

Parameters

Examples

Favorite item

(async () => {
  const collections = new CollectionsService('//api.templatemonster.com/collection/v2/');
  const item = await collections.postItem('mfsgxst31slvddqz0miv', 'template-67020');
})();

Returns object record in the collection

deleteItem

Delete Collection Item

Parameters

  • id number id of the record in the collection

Examples

Remove from collection

(async () => {
  const collections = new CollectionsService('//api.templatemonster.com/collection/v2/');
  await collections.deleteItem(2342);
})();

getCollections

Get list of collections

Parameters

  • params object object of params.
    • params.page number Page number.
    • params.ids array Array Collection unique ID.
    • params.names array Array Collection Name.
    • params.name string Array Collection unique ID.
    • params.expand string Get additional fields. Collection items are visible only if "expand=items" param is in request

Examples

(async () => {
  const service = new CollectionsService(serviceUrl);
  const collections = await service.getCollections(params);
})();

Returns object collection list & pagination

getMyCollections

Get my list of collections

Parameters

  • params object object of params.
    • params.page number Page number.
    • params.ids array Array Collection unique ID.
    • params.names array Array Collection Name.
    • params.name string Array Collection unique ID.
    • params.expand string Get additional fields. Collection items are visible only if "expand=items" param is in request

Examples

(async () => {
  const service = new CollectionsService(serviceUrl);
  const collections = await service.getCollections(params);
})();

Returns object collection list & pagination

mergeCollections

Collection - Merge Collections

Parameters

  • targetCollectionId string Target collection unique ID.
  • sourceCollectionId string Source collection unique ID.

Examples

(async () => {
  const service = new CollectionsService(serviceUrl);
  const collections = await service.mergeCollections(targetCollectionId, sourceCollectionId);
})();

Returns object collection data

3.5.0

3 years ago

3.4.0

4 years ago

3.3.20

4 years ago

3.3.19

4 years ago

3.3.18

5 years ago

3.3.17

5 years ago

3.3.18-alpha.0

5 years ago

3.3.17-alpha.0

5 years ago

3.3.16

5 years ago

3.3.15

5 years ago

3.3.15-alpha.0

5 years ago

3.3.14-alpha.0

5 years ago

3.3.13

5 years ago

3.3.12

5 years ago

3.3.11

5 years ago

3.3.11-alpha.0

5 years ago

3.3.10-alpha.0

5 years ago

3.3.9

5 years ago

3.3.8

5 years ago

3.3.7

5 years ago

3.5.0-alpha.0

5 years ago

3.3.6

5 years ago

3.3.5

5 years ago

3.3.4

5 years ago

3.3.3

5 years ago

3.3.2

5 years ago

3.3.1

5 years ago

3.3.0

5 years ago

3.2.10

5 years ago

3.2.9

5 years ago

3.2.8

5 years ago

3.2.7

5 years ago

3.2.6

5 years ago

3.2.5

5 years ago

3.2.4

5 years ago

3.2.3

5 years ago

3.2.2

5 years ago

3.2.1

5 years ago

3.2.0

5 years ago

3.1.13

5 years ago

3.1.12

5 years ago

3.1.11

5 years ago

3.1.10

5 years ago

3.1.9

5 years ago

3.1.8

5 years ago

3.1.7

5 years ago

3.1.6

5 years ago

3.1.5

5 years ago

3.1.4

5 years ago