Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ecwid

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ecwid - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

lib/types/order.d.ts

17

lib/index.d.ts

@@ -1,4 +0,2 @@

declare type StoreId = number;
declare type StoreAccessToken = string;
declare type OrderId = number;
import { ResultFAIL, ResultOK } from 'node-result';
export declare class Ecwid {

@@ -9,12 +7,5 @@ private readonly storeId;

constructor(storeId: StoreId, storeAccessToken: StoreAccessToken, timeout?: number, headers?: object);
/**
* Получить профиль магазина.
*/
getProfile(): Promise<import("node-result").ResultOK<any> | import("node-result").ResultFAIL<any>>;
/**
* Получить заказ.
* @param {OrderId} id - идентификатор заказа.
*/
getOrder(id: OrderId): Promise<import("node-result").ResultOK<any> | import("node-result").ResultFAIL<any>>;
getProfile(): Promise<ResultOK<any> | ResultFAIL<any>>;
getOrder(orderId: OrderId): Promise<ResultOK<Order> | ResultFAIL<Error>>;
getPaymentOptions(): Promise<ResultOK<PaymentOption[]> | ResultFAIL<Error>>;
}
export {};

@@ -25,5 +25,2 @@ "use strict";

}
/**
* Получить профиль магазина.
*/
getProfile() {

@@ -40,10 +37,6 @@ return __awaiter(this, void 0, void 0, function* () {

}
/**
* Получить заказ.
* @param {OrderId} id - идентификатор заказа.
*/
getOrder(id) {
getOrder(orderId) {
return __awaiter(this, void 0, void 0, function* () {
try {
const { data } = yield this.instance.get(`/orders/${id}`);
const { data } = yield this.instance.get(`/orders/${orderId}`);
return node_result_1.ResultOk(data);

@@ -56,3 +49,14 @@ }

}
getPaymentOptions() {
return __awaiter(this, void 0, void 0, function* () {
try {
const { data } = yield this.instance.get('/profile/paymentOptions');
return node_result_1.ResultOk(data);
}
catch (error) {
return node_result_1.ResultFail(error);
}
});
}
}
exports.Ecwid = Ecwid;
{
"name": "ecwid",
"version": "1.2.0",
"version": "1.3.0",
"description": "ecwid",

@@ -30,3 +30,3 @@ "keywords": [

"axios": "^0.19.2",
"node-result": "^5.0.0"
"node-result": "^5.3.0"
},

@@ -33,0 +33,0 @@ "devDependencies": {

@@ -1,1 +0,23 @@

# node-ecwid
# node-ecwid
## install
```shell
npm install ecwid
# or
yarn add ecwid
```
## example
```ts
import {Ecwid} from "ecwid";
(async () => {
const accessToken = 'secret_xxx';
const storeId = 1;
const ecwid = new Ecwid(storeId, accessToken);
const storeProfile = (await ecwid.getStore()).unwrap();
console.log(storeProfile);
})();
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc