idosell 0.4.9 → 0.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/changelog.md +6 -0
- package/dist/index.js +1 -1
- package/dist/reqparams.d.ts +2 -0
- package/dist/request.js +4 -1
- package/dist/responses.d.ts +21 -21
- package/package.json +1 -1
- package/tests/postPackagesLabels.test.js +10 -0
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
This package wraps around the Idosell REST Api to make it easier to use by implementing chainable options, more intuitive methods and helpers to format requests more easily. [Official Idosell documentation](https://idosell.readme.io/docs) is still applicable for the most part.
|
|
4
4
|
|
|
5
|
+
Visit [This page](https://idosell-converter.vercel.app/) for more detailed usage and examples.
|
|
6
|
+
|
|
5
7
|
## Basic use
|
|
6
8
|
|
|
7
9
|
Package translates awkward gate names into more readable method names using REST verbs and gateways. Most of the possible methods are kept as is, only changed to camel case. For example:
|
package/changelog.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.4.11] - 2025-09-26
|
|
9
|
+
### Changed
|
|
10
|
+
- Updated to v7
|
|
11
|
+
- Fixed few gates
|
|
12
|
+
- Improved typings
|
|
13
|
+
|
|
8
14
|
## [0.4.3] - 2025-08-28
|
|
9
15
|
### Changed
|
|
10
16
|
- Added type RequestParams for typescript support
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ENUMS from "./enums.js";
|
|
2
2
|
import { gateProxy } from "./gates.js";
|
|
3
|
-
export const DEFAULT_VERSION =
|
|
3
|
+
export const DEFAULT_VERSION = 7;
|
|
4
4
|
const idosell = (url, apiKey, version = DEFAULT_VERSION) => {
|
|
5
5
|
const auth = { url, apiKey, version, apikey: apiKey ? apiKey.slice(0, 6) + '*'.repeat(20) : "" };
|
|
6
6
|
Object.defineProperty(auth, 'apiKey', { enumerable: false });
|
package/dist/reqparams.d.ts
CHANGED
|
@@ -2139,6 +2139,8 @@ export type PostCouriersPickupPointsParams = {
|
|
|
2139
2139
|
city?: string;
|
|
2140
2140
|
/** @description Administrative region (code in ISO 3166-2). */
|
|
2141
2141
|
provinceCode?: string;
|
|
2142
|
+
/** @description Country code (ISO 3166-1 alpha-2). */
|
|
2143
|
+
countryCode?: string;
|
|
2142
2144
|
};
|
|
2143
2145
|
/** @description Geographic coordinates. */
|
|
2144
2146
|
coordinates: {
|
package/dist/request.js
CHANGED
|
@@ -180,7 +180,10 @@ export const checkParams = (request) => {
|
|
|
180
180
|
const array = request.params[request.appendable.arrayNode];
|
|
181
181
|
const last = array[array.length - 1];
|
|
182
182
|
if (typeof last === 'object' && Object.keys(last).length === 0) {
|
|
183
|
-
array.
|
|
183
|
+
if (array.length === 1)
|
|
184
|
+
delete request.params[request.appendable.arrayNode];
|
|
185
|
+
else
|
|
186
|
+
array.pop();
|
|
184
187
|
}
|
|
185
188
|
}
|
|
186
189
|
processRequired(request);
|
package/dist/responses.d.ts
CHANGED
|
@@ -1948,27 +1948,27 @@ export type GetOrdersPackagesResponse = {
|
|
|
1948
1948
|
/** @description Information on error that occurred during gate call. */
|
|
1949
1949
|
errors?: FaultCodeString;
|
|
1950
1950
|
/** @description Package details. */
|
|
1951
|
-
deliveryPackage: {
|
|
1951
|
+
deliveryPackage: {
|
|
1952
1952
|
/** @description Shipment ID. */
|
|
1953
|
-
deliveryPackageId
|
|
1953
|
+
deliveryPackageId?: number;
|
|
1954
1954
|
/** @description Package number. */
|
|
1955
|
-
deliveryPackageNumber
|
|
1955
|
+
deliveryPackageNumber?: string;
|
|
1956
1956
|
/** @description consignment number. */
|
|
1957
|
-
deliveryShippingNumber
|
|
1957
|
+
deliveryShippingNumber?: string;
|
|
1958
1958
|
/** @description Courier ID. */
|
|
1959
|
-
courierId
|
|
1959
|
+
courierId?: number;
|
|
1960
1960
|
/** @description Name of the supplier of the shipment. */
|
|
1961
|
-
courierName
|
|
1961
|
+
courierName?: string;
|
|
1962
1962
|
/** @description Selected delivery date. */
|
|
1963
|
-
deliveryDate
|
|
1963
|
+
deliveryDate?: string;
|
|
1964
1964
|
/** @description Additional information on delivery date. */
|
|
1965
|
-
deliveryDateAdditional
|
|
1965
|
+
deliveryDateAdditional?: string;
|
|
1966
1966
|
/** @description Estimated date of shipment of the order. */
|
|
1967
|
-
estimatedDeliveryDate
|
|
1967
|
+
estimatedDeliveryDate?: string;
|
|
1968
1968
|
/** @description Date of receipt by the buyer, possible formats: "YYYY-MM-dd HH:mm:ss", "YYYY-MM-dd", */
|
|
1969
|
-
receivedDate
|
|
1969
|
+
receivedDate?: string;
|
|
1970
1970
|
/** @description Package parameters. */
|
|
1971
|
-
deliveryPackageParameters
|
|
1971
|
+
deliveryPackageParameters?: {
|
|
1972
1972
|
/** @description Cash on delivery. */
|
|
1973
1973
|
cashOnDelivery: number;
|
|
1974
1974
|
/** @description Postal cash on delivery currency. */
|
|
@@ -4697,18 +4697,18 @@ export type SearchProductsResponse = {
|
|
|
4697
4697
|
}[];
|
|
4698
4698
|
}[];
|
|
4699
4699
|
}[];
|
|
4700
|
-
/** @description Parameters set for price comparison
|
|
4701
|
-
|
|
4702
|
-
/** @description
|
|
4703
|
-
|
|
4704
|
-
/** @description Whether the product is exported in the feed to the
|
|
4700
|
+
/** @description Parameters set for external services (price comparison & marketplace sites) */
|
|
4701
|
+
externalServicesList: {
|
|
4702
|
+
/** @description External service ID */
|
|
4703
|
+
id: number;
|
|
4704
|
+
/** @description Whether the product is exported in the feed to the service */
|
|
4705
4705
|
active?: boolean;
|
|
4706
|
-
/** @description
|
|
4707
|
-
|
|
4708
|
-
/** @description Price settings, possible values: "manual" - Price entered manually, "automatically_calculated" - Price calculated automatically. */
|
|
4709
|
-
|
|
4706
|
+
/** @description External service name */
|
|
4707
|
+
name: string;
|
|
4708
|
+
/** @description Price settings, possible values: "manual" - Price entered manually, "automatically_calculated" - Price calculated automatically, "default_price" - Product's default price. */
|
|
4709
|
+
pricesConfig?: string;
|
|
4710
4710
|
/** @description Configuration details for setting of parameter prices_config=automatically_calculated */
|
|
4711
|
-
|
|
4711
|
+
priceConfigAutomatonDetails?: {
|
|
4712
4712
|
/** @description Price setting, one of values: own, last_purchased, avarage_purchased, retail, wholsale, minimal */
|
|
4713
4713
|
priceAutomatonPriceSettings: string;
|
|
4714
4714
|
/** @description Price type, one of values: gross, net */
|
package/package.json
CHANGED
|
@@ -4,4 +4,14 @@ import { expect, test } from "vitest"
|
|
|
4
4
|
test("postPackagesLabelsEventType", () => {
|
|
5
5
|
const params = idosell().postPackagesLabels.eventId(15).eventType("order").checkParams();
|
|
6
6
|
expect(params).toEqual({"eventId":15,"eventType":"order"});
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
test("postPackagesLabelsOrderSn", () => {
|
|
10
|
+
const params = idosell().postPackagesLabels.orderSn(39).checkParams();
|
|
11
|
+
expect(params).toEqual({"eventId":39,"eventType":"order"});
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
test("postPackagesLabelsSize", () => {
|
|
15
|
+
const params = idosell().postPackagesLabels.orderSn(39).size("small").checkParams();
|
|
16
|
+
expect(params).toEqual({"eventId":39,"eventType":"order","parcelParameters":[{"id":"defaultParcelGauge","value":"small"}]});
|
|
7
17
|
})
|