1.0.5 • Published 15 days ago

prestashop-ws-client v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
15 days ago

WS-CLIENT

Description

Typescript Webservice Client to use with PrestaShop Core.

TO DO :

  • Typing : 2 types are required
    • Readable
    • Writable

PrestaShop Compatibility :

  • 9
  • 8
  • 1.7

NodeJs compatibility :

  • 18

Endpoint to implement

EndpointURLDone
addresses[]
carts[]
cart_rules[]
categories[]
country[]
customers[]
orders[]
products[]
stores[]
taxes[]
tax_rules[]

Stack

How to use

Set up the env file:

cp .env.dist .env
open .env

Run some code:

const client = new BaseClient({
  baseURl: process.env.BASE_URL, // URL of your PrestaShop
  wsKey: process.env.WS_KEY, // Key to connect to your prestashop
});

const response = await client.product.create(productData);
console.log(response.status);
console.log(response.data.product); // Maybe return type writable ??

// Error case
// Return an Exeption depending on what is the error.
// UnreachableServerException
// WrongPayloadException
// RequestTimeoutException
// InvalidCredentialsException

Build

Install dependencies:

npm install -g pnpm
pnpm install

Build the library:

pnpm build

Test the library:

pnpm test

Contributing

This library is an open source solution. Everyone is welcome and even encouraged to contribute with their own improvements!

Just make sure to follow our contribution guidelines.

Reporting issues

You can report issues here.

1.0.5

15 days ago

1.0.4

15 days ago

1.0.3

15 days ago

1.0.2

19 days ago

1.0.1

19 days ago

1.0.0

1 month ago