Socket
Socket
Sign inDemoInstall

ebay-api

Package Overview
Dependencies
28
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 8.2.0-RC.0 to 8.2.0

2

dist/api/index.d.ts

@@ -5,3 +5,2 @@ import Auth from '../auth/index.js';

import Base from './base.js';
import { SignatureComponents } from './digitalSignature.js';
/**

@@ -13,3 +12,2 @@ * Superclass with Auth container.

constructor(config: AppConfig, req?: IEBayApiRequest, auth?: Auth);
getDigitalSignatureHeaders(signatureComponents: SignatureComponents, payload: any): {};
}
import Auth from '../auth/index.js';
import Base from './base.js';
import { generateContentDigestValue, generateSignature, generateSignatureInput } from './digitalSignature.js';
/**

@@ -12,19 +11,2 @@ * Superclass with Auth container.

}
getDigitalSignatureHeaders(signatureComponents, payload) {
if (!this.config.signature) {
return {};
}
const digitalSignatureHeaders = {
'x-ebay-enforce-signature': true,
'x-ebay-signature-key': this.config.signature.jwe,
...payload ? {
'content-digest': generateContentDigestValue(payload, this.config.signature.cipher ?? 'sha256')
} : {},
'signature-input': generateSignatureInput(payload)
};
return {
...digitalSignatureHeaders,
'signature': generateSignature(digitalSignatureHeaders, this.config.signature.privateKey, signatureComponents, payload)
};
}
}

6

dist/api/restful/developer/keyManagement/index.d.ts

@@ -15,5 +15,7 @@ import Restful from '../../index.js';

/**
* This method creates keypairs.
* his method creates keypairs.
*/
createSigningKey(signingKeyCipher: 'ED25519' | 'RSA'): Promise<any>;
createSigningKey(data: {
signingKeyCipher: string;
}): Promise<any>;
/**

@@ -20,0 +22,0 @@ * This method returns the <b>Public Key</b>, <b>Public Key as JWE</b>,

@@ -20,8 +20,6 @@ import Restful from '../../index.js';

/**
* This method creates keypairs.
* his method creates keypairs.
*/
createSigningKey(signingKeyCipher) {
return this.post(`/signing_key`, {
signingKeyCipher
});
createSigningKey(data) {
return this.post(`/signing_key`, data);
}

@@ -28,0 +26,0 @@ /**

@@ -0,5 +1,5 @@

import Api from '../index.js';
import Auth from '../../auth/index.js';
import { IEBayApiRequest } from '../../request.js';
import { ApiRequestConfig, AppConfig } from '../../types/index.js';
import Api from '../index.js';
export declare const defaultApiHeaders: Record<string, string>;

@@ -9,3 +9,2 @@ export type RestfulApiConfig = {

useIaf?: boolean;
sign?: boolean;
apiVersion?: string;

@@ -19,3 +18,3 @@ basePath?: string;

method: keyof IEBayApiRequest;
path: string;
url: string;
config?: any;

@@ -56,12 +55,8 @@ data?: any;

get apiz(): this;
/**
* Sign request
*/
get sign(): this;
get(path: string, config?: any, apiConfig?: RestfulApiConfig): Promise<any>;
delete(path: string, config?: any, apiConfig?: RestfulApiConfig): Promise<any>;
post(path: string, data?: any, config?: any, apiConfig?: RestfulApiConfig): Promise<any>;
put(path: string, data?: any, config?: any, apiConfig?: RestfulApiConfig): Promise<any>;
get(url: string, config?: any, apiConfig?: RestfulApiConfig): Promise<any>;
delete(url: string, config?: any, apiConfig?: RestfulApiConfig): Promise<any>;
post(url: string, data?: any, config?: any, apiConfig?: RestfulApiConfig): Promise<any>;
put(url: string, data?: any, config?: any, apiConfig?: RestfulApiConfig): Promise<any>;
get additionalHeaders(): any;
enrichRequestConfig(apiRequest: ApiRequest, payload?: any, apiConfig?: Required<RestfulApiConfig>): Promise<any>;
enrichRequestConfig(config?: any, apiConfig?: Required<RestfulApiConfig>): Promise<any>;
private doRequest;

@@ -68,0 +63,0 @@ private shouldRefreshToken;

@@ -0,3 +1,3 @@

import Api from '../index.js';
import { EBayInvalidAccessToken, handleEBayError } from '../../errors/index.js';
import Api from '../index.js';
export const defaultApiHeaders = {

@@ -56,4 +56,3 @@ 'Content-Type': 'application/json',

headers: {},
returnResponse: false,
sign: false
returnResponse: false
};

@@ -84,20 +83,14 @@ }

}
/**
* Sign request
*/
get sign() {
return this.api({ sign: true });
async get(url, config = {}, apiConfig) {
return this.doRequest({ method: 'get', url, config }, apiConfig);
}
async get(path, config = {}, apiConfig) {
return this.doRequest({ method: 'get', path, config }, apiConfig);
async delete(url, config = {}, apiConfig) {
return this.doRequest({ method: 'delete', url, config }, apiConfig);
}
async delete(path, config = {}, apiConfig) {
return this.doRequest({ method: 'delete', path, config }, apiConfig);
async post(url, data, config = {}, apiConfig) {
return this.doRequest({ method: 'post', url, data, config }, apiConfig);
}
async post(path, data, config = {}, apiConfig) {
return this.doRequest({ method: 'post', path, data, config }, apiConfig);
async put(url, data, config = {}, apiConfig) {
return this.doRequest({ method: 'put', url, data, config }, apiConfig);
}
async put(path, data, config = {}, apiConfig) {
return this.doRequest({ method: 'put', path, data, config }, apiConfig);
}
get additionalHeaders() {

@@ -113,9 +106,4 @@ return Object.keys(additionalHeaders)

}
async enrichRequestConfig(apiRequest, payload = null, apiConfig = this.apiConfig) {
async enrichRequestConfig(config = {}, apiConfig = this.apiConfig) {
const authHeader = await this.auth.getHeaderAuthorization(apiConfig.useIaf);
const signatureHeaders = apiConfig.sign ? this.getDigitalSignatureHeaders({
method: apiRequest.method.toUpperCase(),
authority: Restful.buildServerUrl('', apiConfig.subdomain, apiConfig.sandbox, apiConfig.tld),
path: apiConfig.apiVersion + apiConfig.basePath + apiRequest.path
}, payload) : {};
const headers = {

@@ -125,9 +113,8 @@ ...defaultApiHeaders,

...authHeader,
...apiConfig.headers,
...signatureHeaders
...apiConfig.headers
};
return {
...apiRequest.config,
...config,
headers: {
...(apiRequest.config.headers || {}),
...(config.headers || {}),
...headers

@@ -159,5 +146,5 @@ }

async request(apiRequest, apiConfig = this.apiConfig, refreshToken = false) {
const { path, method, data } = apiRequest;
const { url, method, data, config } = apiRequest;
const apiCfg = { ...this.apiConfig, ...apiConfig };
const endpoint = this.getServerUrl(apiCfg) + path;
const endpoint = this.getServerUrl(apiCfg) + url;
try {

@@ -167,3 +154,3 @@ if (refreshToken) {

}
const enrichedConfig = await this.enrichRequestConfig(apiRequest, data, apiCfg);
const enrichedConfig = await this.enrichRequestConfig(config, apiCfg);
const args = ['get', 'delete'].includes(method) ? [enrichedConfig] : [data, enrichedConfig];

@@ -170,0 +157,0 @@ // @ts-ignore

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

import { PaymentsProgramType } from '../../../../enums/index.js';
import { CustomPolicyCreateRequest, CustomPolicyRequest, FulfillmentPolicyRequest, InventoryLocation, InventoryLocationFull, PaymentPolicyRequest, Program, ReturnPolicyRequest, SalesTaxBase } from '../../../../types/index.js';
import Restful from '../../index.js';
import { FulfillmentPolicyRequest, PaymentPolicyRequest, Program, ReturnPolicyRequest, SalesTaxBase } from '../../../../types/index.js';
import { PaymentsProgramType } from '../../../../enums/index.js';
/**

@@ -13,2 +13,23 @@ * The <b>Account API</b> gives sellers the ability to configure their eBay seller accounts,

/**
* This method retrieves the list of custom policies specified by the <b>policy_types</b> query parameter for the selected eBay marketplace.
* @param policyTypes This query parameter specifies the type of custom policies to be returned.
*/
getCustomPolicies(policyTypes: string): Promise<any>;
/**
* This method creates a new custom policy in which a seller specifies their terms for complying with local governmental regulations.
* @param body Request to create a new Custom Policy.
*/
createCustomPolicy(body: CustomPolicyCreateRequest): Promise<any>;
/**
* This method retrieves the custom policy specified by the <b>custom_policy_id</b> path parameter for the selected eBay marketplace.
* @param customPolicyId This path parameter is the unique custom policy identifier for the policy to be returned.
*/
getCustomPolicy(customPolicyId: string): Promise<any>;
/**
* This method updates an existing custom policy specified by the <b>custom_policy_id</b> path parameter for the selected marketplace.
* @param customPolicyId This path parameter is the unique custom policy identifier for the policy to be returned.
* @param body Request to update a current custom policy.
*/
updateCustomPolicy(customPolicyId: string, body: CustomPolicyRequest): Promise<any>;
/**
* This method retrieves all the fulfillment policies configured for the marketplace you specify using the

@@ -215,5 +236,65 @@ * marketplace_id query parameter.

/**
* This method retrieves a list of subscriptions associated with the seller account.
* @param limit This field is for future use.
* @param continuationToken This field is for future use.
*/
getSubscription({ limit, continuationToken }?: {
limit?: string;
continuationToken?: string;
}): Promise<any>;
/**
* his method is used by sellers onboarded for eBay managed payments, or sellers who are currently going through, or who are eligible for onboarding for eBay managed payments.
*/
getKYC(): Promise<any>;
/**
* This method allows developers to check the seller eligibility status for eBay advertising programs.
* @param programTypes A comma-separated list of eBay advertising programs.
*/
getAdvertisingEligibility(programTypes?: string): Promise<any>;
/**
* This call retrieves all defined details of the inventory location that is specified by the <b>merchantLocationKey</b> path parameter.
* @param merchantLocationKey A unique merchant-defined key (ID) for an inventory location.
*/
getInventoryLocation(merchantLocationKey: string): Promise<any>;
/**
* <p>Use this call to create a new inventory location.
* @param merchantLocationKey A unique, merchant-defined key (ID) for an inventory location.
* @param body Inventory Location details
*/
createInventoryLocation(merchantLocationKey: string, body: InventoryLocationFull): Promise<any>;
/**
* <p>This call deletes the inventory location that is specified in the <code>merchantLocationKey</code> path parameter.
* @param merchantLocationKey
*/
deleteInventoryLocation(merchantLocationKey: string): Promise<any>;
/**
* <p>This call disables the inventory location that is specified in the <code>merchantLocationKey</code> path parameter.
* @param merchantLocationKey A unique merchant-defined key (ID) for an inventory location.
*/
disableInventoryLocation(merchantLocationKey: string): Promise<any>;
/**
* <p>This call enables a disabled inventory location that is specified in the <code>merchantLocationKey</code> path parameter.
* @param merchantLocationKey A unique merchant-defined key (ID) for an inventory location.
*/
enableInventoryLocation(merchantLocationKey: string): Promise<any>;
/**
* This call retrieves all defined details for every inventory location associated with the seller's account.
* @param limit The value passed in this query parameter sets the maximum number of records to return per page of data.
* @param offset Specifies the number of locations to skip in the result set before returning the first location in the paginated response.
*/
getInventoryLocations({ limit, offset }?: {
limit?: number;
offset?: number;
}): Promise<any>;
/**
* <p>Use this call to update non-physical location details for an existing inventory location.
* @param merchantLocationKey A unique merchant-defined key (ID) for an inventory location.
* @param body The inventory location details to be updated (other than the address and geo co-ordinates).
*/
updateInventoryLocation(merchantLocationKey: string, body: InventoryLocation): Promise<any>;
/**
* This method retrieves all the sales tax jurisdictions for the country that you specify in the <b>countryCode</b> path parameter.
* @param countryCode This path parameter specifies the two-letter <a href="https://www.iso.org/iso-3166-country-codes.html " title="https://www.iso.org " target="_blank">ISO 3166</a> country code for the country whose jurisdictions you want to retrieve. eBay provides sales tax jurisdiction information for Canada and the United States.
*/
getSalesTaxJurisdictions(countryCode: string): Promise<any>;
}

@@ -12,2 +12,37 @@ import Restful from '../../index.js';

/**
* This method retrieves the list of custom policies specified by the <b>policy_types</b> query parameter for the selected eBay marketplace.
* @param policyTypes This query parameter specifies the type of custom policies to be returned.
*/
getCustomPolicies(policyTypes) {
return this.get(`/custom_policy/`, {
params: {
policy_types: policyTypes
}
});
}
/**
* This method creates a new custom policy in which a seller specifies their terms for complying with local governmental regulations.
* @param body Request to create a new Custom Policy.
*/
createCustomPolicy(body) {
return this.post(`/custom_policy/`, body);
}
/**
* This method retrieves the custom policy specified by the <b>custom_policy_id</b> path parameter for the selected eBay marketplace.
* @param customPolicyId This path parameter is the unique custom policy identifier for the policy to be returned.
*/
getCustomPolicy(customPolicyId) {
customPolicyId = encodeURIComponent(customPolicyId);
return this.get(`/custom_policy/${customPolicyId}`);
}
/**
* This method updates an existing custom policy specified by the <b>custom_policy_id</b> path parameter for the selected marketplace.
* @param customPolicyId This path parameter is the unique custom policy identifier for the policy to be returned.
* @param body Request to update a current custom policy.
*/
updateCustomPolicy(customPolicyId, body) {
customPolicyId = encodeURIComponent(customPolicyId);
return this.put(`/custom_policy/${customPolicyId}`, body);
}
/**
* This method retrieves all the fulfillment policies configured for the marketplace you specify using the

@@ -32,3 +67,3 @@ * marketplace_id query parameter.

createFulfillmentPolicy(body) {
return this.post(`/fulfillment_policy`, body);
return this.post(`/fulfillment_policy/`, body);
}

@@ -42,4 +77,4 @@ /**

updateFulfillmentPolicy(fulfillmentPolicyId, body) {
const id = encodeURIComponent(fulfillmentPolicyId);
return this.put(`/fulfillment_policy/${id}`, body);
fulfillmentPolicyId = encodeURIComponent(fulfillmentPolicyId);
return this.put(`/fulfillment_policy/${fulfillmentPolicyId}`, body);
}

@@ -52,4 +87,4 @@ /**

deleteFulfillmentPolicy(fulfillmentPolicyId) {
const id = encodeURIComponent(fulfillmentPolicyId);
return this.delete(`/fulfillment_policy/${id}`);
fulfillmentPolicyId = encodeURIComponent(fulfillmentPolicyId);
return this.delete(`/fulfillment_policy/${fulfillmentPolicyId}`);
}

@@ -328,2 +363,15 @@ /**

/**
* This method retrieves a list of subscriptions associated with the seller account.
* @param limit This field is for future use.
* @param continuationToken This field is for future use.
*/
getSubscription({ limit, continuationToken } = {}) {
return this.get(`/subscription`, {
params: {
limit,
continuation_token: continuationToken
}
});
}
/**
* his method is used by sellers onboarded for eBay managed payments, or sellers who are currently going through, or who are eligible for onboarding for eBay managed payments.

@@ -334,3 +382,85 @@ */

}
/**
* This method allows developers to check the seller eligibility status for eBay advertising programs.
* @param programTypes A comma-separated list of eBay advertising programs.
*/
getAdvertisingEligibility(programTypes) {
return this.get(`/advertising_eligibility`, {
params: {
program_types: programTypes
}
});
}
/**
* This call retrieves all defined details of the inventory location that is specified by the <b>merchantLocationKey</b> path parameter.
* @param merchantLocationKey A unique merchant-defined key (ID) for an inventory location.
*/
getInventoryLocation(merchantLocationKey) {
merchantLocationKey = encodeURIComponent(merchantLocationKey);
return this.get(`/location/${merchantLocationKey}`);
}
/**
* <p>Use this call to create a new inventory location.
* @param merchantLocationKey A unique, merchant-defined key (ID) for an inventory location.
* @param body Inventory Location details
*/
createInventoryLocation(merchantLocationKey, body) {
merchantLocationKey = encodeURIComponent(merchantLocationKey);
return this.post(`/location/${merchantLocationKey}`, body);
}
/**
* <p>This call deletes the inventory location that is specified in the <code>merchantLocationKey</code> path parameter.
* @param merchantLocationKey
*/
deleteInventoryLocation(merchantLocationKey) {
merchantLocationKey = encodeURIComponent(merchantLocationKey);
return this.delete(`/location/${merchantLocationKey}`);
}
/**
* <p>This call disables the inventory location that is specified in the <code>merchantLocationKey</code> path parameter.
* @param merchantLocationKey A unique merchant-defined key (ID) for an inventory location.
*/
disableInventoryLocation(merchantLocationKey) {
merchantLocationKey = encodeURIComponent(merchantLocationKey);
return this.post(`/location/${merchantLocationKey}/disable`);
}
/**
* <p>This call enables a disabled inventory location that is specified in the <code>merchantLocationKey</code> path parameter.
* @param merchantLocationKey A unique merchant-defined key (ID) for an inventory location.
*/
enableInventoryLocation(merchantLocationKey) {
merchantLocationKey = encodeURIComponent(merchantLocationKey);
return this.post(`/location/${merchantLocationKey}/enable`);
}
/**
* This call retrieves all defined details for every inventory location associated with the seller's account.
* @param limit The value passed in this query parameter sets the maximum number of records to return per page of data.
* @param offset Specifies the number of locations to skip in the result set before returning the first location in the paginated response.
*/
getInventoryLocations({ limit, offset } = {}) {
return this.get(`/location`, {
params: {
limit,
offset
}
});
}
/**
* <p>Use this call to update non-physical location details for an existing inventory location.
* @param merchantLocationKey A unique merchant-defined key (ID) for an inventory location.
* @param body The inventory location details to be updated (other than the address and geo co-ordinates).
*/
updateInventoryLocation(merchantLocationKey, body) {
merchantLocationKey = encodeURIComponent(merchantLocationKey);
return this.post(`/location/${merchantLocationKey}/update_location_details`, body);
}
/**
* This method retrieves all the sales tax jurisdictions for the country that you specify in the <b>countryCode</b> path parameter.
* @param countryCode This path parameter specifies the two-letter <a href="https://www.iso.org/iso-3166-country-codes.html " title="https://www.iso.org " target="_blank">ISO 3166</a> country code for the country whose jurisdictions you want to retrieve. eBay provides sales tax jurisdiction information for Canada and the United States.
*/
getSalesTaxJurisdictions(countryCode) {
countryCode = encodeURIComponent(countryCode);
return this.get(`/country/${countryCode}/sales_tax_jurisdiction`);
}
}
Account.id = 'Account';

@@ -0,3 +1,3 @@

import Api from '../index.js';
import { ClientAlerts, Finding, Merchandising, Shopping, Trading } from '../../types/index.js';
import Api from '../index.js';
/**

@@ -4,0 +4,0 @@ * Traditional eBay API.

import { stringify } from 'qs';
import Api from '../index.js';
import { EBayIAFTokenExpired, EBayIAFTokenInvalid, handleEBayError } from '../../errors/index.js';
import Api from '../index.js';
import ClientAlertsCalls from './clientAlerts/index.js';

@@ -31,2 +31,5 @@ import FindingCalls from './finding/index.js';

createTradingApi() {
if (!this.config.devId) {
throw new Error('devId is required for trading API.');
}
if (typeof this.config.siteId !== 'number') {

@@ -37,6 +40,5 @@ throw new Error('siteId is required for trading API.');

endpoint: {
production: 'api.ebay.com',
sandbox: 'api.sandbox.ebay.com'
production: 'https://api.ebay.com/ws/api.dll',
sandbox: 'https://api.sandbox.ebay.com/ws/api.dll'
},
path: '/ws/api.dll',
calls: TradingCalls,

@@ -61,6 +63,5 @@ xmlns: 'urn:ebay:apis:eBLBaseComponents',

endpoint: {
production: 'open.api.ebay.com',
sandbox: 'open.api.sandbox.ebay.com'
production: 'https://open.api.ebay.com/shopping',
sandbox: 'https://open.api.sandbox.ebay.com/shopping'
},
path: '/shopping',
xmlns: 'urn:ebay:apis:eBLBaseComponents',

@@ -81,6 +82,5 @@ calls: ShoppingCalls,

endpoint: {
production: 'svcs.ebay.com',
sandbox: 'svcs.sandbox.ebay.com'
production: 'https://svcs.ebay.com/services/search/FindingService/v1',
sandbox: 'https://svcs.sandbox.ebay.com/services/search/FindingService/v1'
},
path: '/services/search/FindingService/v1',
xmlns: 'http://www.ebay.com/marketplace/search/v1/services',

@@ -100,6 +100,5 @@ calls: FindingCalls,

endpoint: {
production: 'clientalerts.ebay.com',
sandbox: 'clientalerts.sandbox.ebay.com'
production: 'https://clientalerts.ebay.com/ws/ecasvc/ClientAlerts',
sandbox: 'https://clientalerts.sandbox.ebay.com/ws/ecasvc/ClientAlerts'
},
path: '/ws/ecasvc/ClientAlerts',
calls: ClientAlertsCalls

@@ -138,6 +137,5 @@ };

endpoint: {
production: 'svcs.ebay.com',
sandbox: 'svcs.sandbox.ebay.com'
production: 'https://svcs.ebay.com/MerchandisingService',
sandbox: 'https://svcs.sandbox.ebay.com/MerchandisingService'
},
path: '/MerchandisingService',
xmlns: 'http://www.ebay.com/marketplace/services',

@@ -171,7 +169,6 @@ calls: MerchandisingCalls,

const useIaf = !eBayAuthToken && accessToken;
const host = this.config.sandbox ? api.endpoint.sandbox : api.endpoint.production;
return {
...apiConfig,
xmlns: api.xmlns,
endpoint: `https://${host}${api.path}`,
endpoint: api.endpoint[this.config.sandbox ? 'sandbox' : 'production'],
headers: {

@@ -181,9 +178,2 @@ ...api.headers(callName, useIaf ? accessToken : null),

},
digitalSignatureHeaders: payload => {
return apiConfig.sign ? this.getDigitalSignatureHeaders({
method: 'POST',
authority: host,
path: api.path
}, payload) : {};
},
...(!useIaf ? { eBayAuthToken } : {})

@@ -190,0 +180,0 @@ };

@@ -37,3 +37,2 @@ import { XMLBuilder } from 'fast-xml-parser';

useIaf?: boolean;
sign?: boolean;
hook?: (xml: string) => BodyHeaders;

@@ -45,3 +44,2 @@ } & ApiRequestConfig;

eBayAuthToken?: string | null;
digitalSignatureHeaders?: (payload: any) => Headers;
};

@@ -70,3 +68,3 @@ export declare const defaultApiConfig: Required<Omit<TraditionalApiConfig, 'hook'>>;

*/
constructor(callName: string, fields: Fields | null, config: XMLReqConfig, req: IEBayApiRequest);
constructor(callName: string, fields: Fields, config: XMLReqConfig, req: IEBayApiRequest);
/**

@@ -73,0 +71,0 @@ * returns the expected name of XML node of a Request

import debug from 'debug';
import { XMLBuilder, XMLParser } from 'fast-xml-parser';
import { XMLParser, XMLBuilder } from 'fast-xml-parser';
import { checkEBayResponse, EbayNoCallError } from '../../errors/index.js';

@@ -35,3 +35,2 @@ const log = debug('ebay:xml:request');

useIaf: true,
sign: false,
headers: {},

@@ -142,3 +141,2 @@ returnResponse: false

...this.getHeaders(),
...this.config.digitalSignatureHeaders ? this.config.digitalSignatureHeaders(body) : {},
...(headers ? headers : {})

@@ -145,0 +143,0 @@ }

@@ -32,9 +32,2 @@ import ApiFactory from './api/apiFactory.js';

}
let signature = null;
if (process.env.EBAY_JWE && process.env.EBAY_PRIVATE_KEY) {
signature = {
jwe: process.env.EBAY_JWE,
privateKey: process.env.EBAY_PRIVATE_KEY
};
}
return new eBayApi({

@@ -50,4 +43,3 @@ appId: process.env.EBAY_APP_ID,

ruName: process.env.EBAY_RU_NAME,
sandbox: (process.env.EBAY_SANDBOX === 'true'),
signature
sandbox: (process.env.EBAY_SANDBOX === 'true')
}, req);

@@ -54,0 +46,0 @@ }

@@ -111,7 +111,2 @@ // tslint:disable:max-classes-per-file

}
else if (typeof data === 'string') {
eBayError = {
message: data
};
}
else {

@@ -118,0 +113,0 @@ eBayError = data;

@@ -19,8 +19,2 @@ import { AxiosRequestConfig } from 'axios';

};
export type Cipher = 'sha256' | 'sha512';
export type Signature = {
cipher?: Cipher;
jwe: string;
privateKey: string;
};
export type eBayConfig = Keyset & {

@@ -30,3 +24,2 @@ sandbox: boolean;

scope?: Scope;
signature?: Signature | null;
} & TraditionalConfig & RestConfig;

@@ -33,0 +26,0 @@ export type ApiConfig = {

@@ -888,2 +888,9 @@ import { CancelReason, CaseSearchFieldGroup, CaseStatusFilter, CategoryType as CategoryTypeEnum, Condition, CountryCode, CurrencyCode, Decision, EscalateReason, FilePurpose, FormatType, InquirySearchFieldGroup, InquiryStatusFilter, LengthUnitOfMeasure, Locale, Marketplace, MarketplaceId, PackageType, PaymentMethodType, ReasonForRefund, RecipientAccountReferenceType, RefundFeeType, RefundMethod, RegionType, RequestType, ReturnCountFilter, ReturnMethod, ReturnReason, ReturnShippingCostPayer, ReturnState, ReturnType, ShippingCarrier, ShippingCostType, ShippingOptionType, StoreType, TimeDurationUnit, UserRoleFilter, WeightUnitOfMeasure } from '../enums/index.js';

};
export type CustomPolicyCreateRequest = {
description: string;
label: string;
name: string;
policyType: string;
};
export type CustomPolicyRequest = Omit<CustomPolicyCreateRequest, 'policyType'>;
export type RecipientAccountReference = {

@@ -890,0 +897,0 @@ referenceId: string;

@@ -8,3 +8,3 @@ import ClientAlertsCalls from '../api/traditional/clientAlerts/index.js';

import { TraditionalApiConfig } from '../api/traditional/XMLRequest.js';
export type XMLApiCall = (fields?: Fields | null, apiConfig?: TraditionalApiConfig) => Promise<any>;
export type XMLApiCall = (fields?: Fields, apiConfig?: TraditionalApiConfig) => Promise<any>;
export type Trading = {

@@ -32,3 +32,2 @@ [key in typeof TradingCalls[number]]: XMLApiCall;

xmlns: string;
path: string;
calls: typeof TradingCalls | typeof ShoppingCalls | typeof FindingCalls | typeof ClientAlertsCalls | typeof MerchandisingCalls;

@@ -35,0 +34,0 @@ headers: (callName: string, accessToken?: string | null) => object;

@@ -5,3 +5,2 @@ import Auth from '../auth/index.js';

import Base from './base.js';
import { SignatureComponents } from './digitalSignature.js';
/**

@@ -13,3 +12,2 @@ * Superclass with Auth container.

constructor(config: AppConfig, req?: IEBayApiRequest, auth?: Auth);
getDigitalSignatureHeaders(signatureComponents: SignatureComponents, payload: any): {};
}

@@ -8,3 +8,2 @@ "use strict";

const base_js_1 = __importDefault(require("./base.js"));
const digitalSignature_js_1 = require("./digitalSignature.js");
/**

@@ -18,20 +17,3 @@ * Superclass with Auth container.

}
getDigitalSignatureHeaders(signatureComponents, payload) {
if (!this.config.signature) {
return {};
}
const digitalSignatureHeaders = {
'x-ebay-enforce-signature': true,
'x-ebay-signature-key': this.config.signature.jwe,
...payload ? {
'content-digest': (0, digitalSignature_js_1.generateContentDigestValue)(payload, this.config.signature.cipher ?? 'sha256')
} : {},
'signature-input': (0, digitalSignature_js_1.generateSignatureInput)(payload)
};
return {
...digitalSignatureHeaders,
'signature': (0, digitalSignature_js_1.generateSignature)(digitalSignatureHeaders, this.config.signature.privateKey, signatureComponents, payload)
};
}
}
exports.default = Api;

@@ -15,5 +15,7 @@ import Restful from '../../index.js';

/**
* This method creates keypairs.
* his method creates keypairs.
*/
createSigningKey(signingKeyCipher: 'ED25519' | 'RSA'): Promise<any>;
createSigningKey(data: {
signingKeyCipher: string;
}): Promise<any>;
/**

@@ -20,0 +22,0 @@ * This method returns the <b>Public Key</b>, <b>Public Key as JWE</b>,

@@ -25,8 +25,6 @@ "use strict";

/**
* This method creates keypairs.
* his method creates keypairs.
*/
createSigningKey(signingKeyCipher) {
return this.post(`/signing_key`, {
signingKeyCipher
});
createSigningKey(data) {
return this.post(`/signing_key`, data);
}

@@ -33,0 +31,0 @@ /**

@@ -0,5 +1,5 @@

import Api from '../index.js';
import Auth from '../../auth/index.js';
import { IEBayApiRequest } from '../../request.js';
import { ApiRequestConfig, AppConfig } from '../../types/index.js';
import Api from '../index.js';
export declare const defaultApiHeaders: Record<string, string>;

@@ -9,3 +9,2 @@ export type RestfulApiConfig = {

useIaf?: boolean;
sign?: boolean;
apiVersion?: string;

@@ -19,3 +18,3 @@ basePath?: string;

method: keyof IEBayApiRequest;
path: string;
url: string;
config?: any;

@@ -56,12 +55,8 @@ data?: any;

get apiz(): this;
/**
* Sign request
*/
get sign(): this;
get(path: string, config?: any, apiConfig?: RestfulApiConfig): Promise<any>;
delete(path: string, config?: any, apiConfig?: RestfulApiConfig): Promise<any>;
post(path: string, data?: any, config?: any, apiConfig?: RestfulApiConfig): Promise<any>;
put(path: string, data?: any, config?: any, apiConfig?: RestfulApiConfig): Promise<any>;
get(url: string, config?: any, apiConfig?: RestfulApiConfig): Promise<any>;
delete(url: string, config?: any, apiConfig?: RestfulApiConfig): Promise<any>;
post(url: string, data?: any, config?: any, apiConfig?: RestfulApiConfig): Promise<any>;
put(url: string, data?: any, config?: any, apiConfig?: RestfulApiConfig): Promise<any>;
get additionalHeaders(): any;
enrichRequestConfig(apiRequest: ApiRequest, payload?: any, apiConfig?: Required<RestfulApiConfig>): Promise<any>;
enrichRequestConfig(config?: any, apiConfig?: Required<RestfulApiConfig>): Promise<any>;
private doRequest;

@@ -68,0 +63,0 @@ private shouldRefreshToken;

@@ -7,4 +7,4 @@ "use strict";

exports.defaultApiHeaders = void 0;
const index_js_1 = require("../../errors/index.js");
const index_js_2 = __importDefault(require("../index.js"));
const index_js_1 = __importDefault(require("../index.js"));
const index_js_2 = require("../../errors/index.js");
exports.defaultApiHeaders = {

@@ -24,3 +24,3 @@ 'Content-Type': 'application/json',

};
class Restful extends index_js_2.default {
class Restful extends index_js_1.default {
constructor(config, req, auth, apiConfig = {}) {

@@ -64,4 +64,3 @@ super(config, req, auth);

headers: {},
returnResponse: false,
sign: false
returnResponse: false
};

@@ -92,20 +91,14 @@ }

}
/**
* Sign request
*/
get sign() {
return this.api({ sign: true });
async get(url, config = {}, apiConfig) {
return this.doRequest({ method: 'get', url, config }, apiConfig);
}
async get(path, config = {}, apiConfig) {
return this.doRequest({ method: 'get', path, config }, apiConfig);
async delete(url, config = {}, apiConfig) {
return this.doRequest({ method: 'delete', url, config }, apiConfig);
}
async delete(path, config = {}, apiConfig) {
return this.doRequest({ method: 'delete', path, config }, apiConfig);
async post(url, data, config = {}, apiConfig) {
return this.doRequest({ method: 'post', url, data, config }, apiConfig);
}
async post(path, data, config = {}, apiConfig) {
return this.doRequest({ method: 'post', path, data, config }, apiConfig);
async put(url, data, config = {}, apiConfig) {
return this.doRequest({ method: 'put', url, data, config }, apiConfig);
}
async put(path, data, config = {}, apiConfig) {
return this.doRequest({ method: 'put', path, data, config }, apiConfig);
}
get additionalHeaders() {

@@ -121,9 +114,4 @@ return Object.keys(additionalHeaders)

}
async enrichRequestConfig(apiRequest, payload = null, apiConfig = this.apiConfig) {
async enrichRequestConfig(config = {}, apiConfig = this.apiConfig) {
const authHeader = await this.auth.getHeaderAuthorization(apiConfig.useIaf);
const signatureHeaders = apiConfig.sign ? this.getDigitalSignatureHeaders({
method: apiRequest.method.toUpperCase(),
authority: Restful.buildServerUrl('', apiConfig.subdomain, apiConfig.sandbox, apiConfig.tld),
path: apiConfig.apiVersion + apiConfig.basePath + apiRequest.path
}, payload) : {};
const headers = {

@@ -133,9 +121,8 @@ ...exports.defaultApiHeaders,

...authHeader,
...apiConfig.headers,
...signatureHeaders
...apiConfig.headers
};
return {
...apiRequest.config,
...config,
headers: {
...(apiRequest.config.headers || {}),
...(config.headers || {}),
...headers

@@ -161,3 +148,3 @@ }

}
if (error.name === index_js_1.EBayInvalidAccessToken.name) {
if (error.name === index_js_2.EBayInvalidAccessToken.name) {
return true;

@@ -168,5 +155,5 @@ }

async request(apiRequest, apiConfig = this.apiConfig, refreshToken = false) {
const { path, method, data } = apiRequest;
const { url, method, data, config } = apiRequest;
const apiCfg = { ...this.apiConfig, ...apiConfig };
const endpoint = this.getServerUrl(apiCfg) + path;
const endpoint = this.getServerUrl(apiCfg) + url;
try {

@@ -176,3 +163,3 @@ if (refreshToken) {

}
const enrichedConfig = await this.enrichRequestConfig(apiRequest, data, apiCfg);
const enrichedConfig = await this.enrichRequestConfig(config, apiCfg);
const args = ['get', 'delete'].includes(method) ? [enrichedConfig] : [data, enrichedConfig];

@@ -189,3 +176,3 @@ // @ts-ignore

catch (ex) {
(0, index_js_1.handleEBayError)(ex);
(0, index_js_2.handleEBayError)(ex);
}

@@ -192,0 +179,0 @@ }

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

import { PaymentsProgramType } from '../../../../enums/index.js';
import { CustomPolicyCreateRequest, CustomPolicyRequest, FulfillmentPolicyRequest, InventoryLocation, InventoryLocationFull, PaymentPolicyRequest, Program, ReturnPolicyRequest, SalesTaxBase } from '../../../../types/index.js';
import Restful from '../../index.js';
import { FulfillmentPolicyRequest, PaymentPolicyRequest, Program, ReturnPolicyRequest, SalesTaxBase } from '../../../../types/index.js';
import { PaymentsProgramType } from '../../../../enums/index.js';
/**

@@ -13,2 +13,23 @@ * The <b>Account API</b> gives sellers the ability to configure their eBay seller accounts,

/**
* This method retrieves the list of custom policies specified by the <b>policy_types</b> query parameter for the selected eBay marketplace.
* @param policyTypes This query parameter specifies the type of custom policies to be returned.
*/
getCustomPolicies(policyTypes: string): Promise<any>;
/**
* This method creates a new custom policy in which a seller specifies their terms for complying with local governmental regulations.
* @param body Request to create a new Custom Policy.
*/
createCustomPolicy(body: CustomPolicyCreateRequest): Promise<any>;
/**
* This method retrieves the custom policy specified by the <b>custom_policy_id</b> path parameter for the selected eBay marketplace.
* @param customPolicyId This path parameter is the unique custom policy identifier for the policy to be returned.
*/
getCustomPolicy(customPolicyId: string): Promise<any>;
/**
* This method updates an existing custom policy specified by the <b>custom_policy_id</b> path parameter for the selected marketplace.
* @param customPolicyId This path parameter is the unique custom policy identifier for the policy to be returned.
* @param body Request to update a current custom policy.
*/
updateCustomPolicy(customPolicyId: string, body: CustomPolicyRequest): Promise<any>;
/**
* This method retrieves all the fulfillment policies configured for the marketplace you specify using the

@@ -215,5 +236,65 @@ * marketplace_id query parameter.

/**
* This method retrieves a list of subscriptions associated with the seller account.
* @param limit This field is for future use.
* @param continuationToken This field is for future use.
*/
getSubscription({ limit, continuationToken }?: {
limit?: string;
continuationToken?: string;
}): Promise<any>;
/**
* his method is used by sellers onboarded for eBay managed payments, or sellers who are currently going through, or who are eligible for onboarding for eBay managed payments.
*/
getKYC(): Promise<any>;
/**
* This method allows developers to check the seller eligibility status for eBay advertising programs.
* @param programTypes A comma-separated list of eBay advertising programs.
*/
getAdvertisingEligibility(programTypes?: string): Promise<any>;
/**
* This call retrieves all defined details of the inventory location that is specified by the <b>merchantLocationKey</b> path parameter.
* @param merchantLocationKey A unique merchant-defined key (ID) for an inventory location.
*/
getInventoryLocation(merchantLocationKey: string): Promise<any>;
/**
* <p>Use this call to create a new inventory location.
* @param merchantLocationKey A unique, merchant-defined key (ID) for an inventory location.
* @param body Inventory Location details
*/
createInventoryLocation(merchantLocationKey: string, body: InventoryLocationFull): Promise<any>;
/**
* <p>This call deletes the inventory location that is specified in the <code>merchantLocationKey</code> path parameter.
* @param merchantLocationKey
*/
deleteInventoryLocation(merchantLocationKey: string): Promise<any>;
/**
* <p>This call disables the inventory location that is specified in the <code>merchantLocationKey</code> path parameter.
* @param merchantLocationKey A unique merchant-defined key (ID) for an inventory location.
*/
disableInventoryLocation(merchantLocationKey: string): Promise<any>;
/**
* <p>This call enables a disabled inventory location that is specified in the <code>merchantLocationKey</code> path parameter.
* @param merchantLocationKey A unique merchant-defined key (ID) for an inventory location.
*/
enableInventoryLocation(merchantLocationKey: string): Promise<any>;
/**
* This call retrieves all defined details for every inventory location associated with the seller's account.
* @param limit The value passed in this query parameter sets the maximum number of records to return per page of data.
* @param offset Specifies the number of locations to skip in the result set before returning the first location in the paginated response.
*/
getInventoryLocations({ limit, offset }?: {
limit?: number;
offset?: number;
}): Promise<any>;
/**
* <p>Use this call to update non-physical location details for an existing inventory location.
* @param merchantLocationKey A unique merchant-defined key (ID) for an inventory location.
* @param body The inventory location details to be updated (other than the address and geo co-ordinates).
*/
updateInventoryLocation(merchantLocationKey: string, body: InventoryLocation): Promise<any>;
/**
* This method retrieves all the sales tax jurisdictions for the country that you specify in the <b>countryCode</b> path parameter.
* @param countryCode This path parameter specifies the two-letter <a href="https://www.iso.org/iso-3166-country-codes.html " title="https://www.iso.org " target="_blank">ISO 3166</a> country code for the country whose jurisdictions you want to retrieve. eBay provides sales tax jurisdiction information for Canada and the United States.
*/
getSalesTaxJurisdictions(countryCode: string): Promise<any>;
}

@@ -17,2 +17,37 @@ "use strict";

/**
* This method retrieves the list of custom policies specified by the <b>policy_types</b> query parameter for the selected eBay marketplace.
* @param policyTypes This query parameter specifies the type of custom policies to be returned.
*/
getCustomPolicies(policyTypes) {
return this.get(`/custom_policy/`, {
params: {
policy_types: policyTypes
}
});
}
/**
* This method creates a new custom policy in which a seller specifies their terms for complying with local governmental regulations.
* @param body Request to create a new Custom Policy.
*/
createCustomPolicy(body) {
return this.post(`/custom_policy/`, body);
}
/**
* This method retrieves the custom policy specified by the <b>custom_policy_id</b> path parameter for the selected eBay marketplace.
* @param customPolicyId This path parameter is the unique custom policy identifier for the policy to be returned.
*/
getCustomPolicy(customPolicyId) {
customPolicyId = encodeURIComponent(customPolicyId);
return this.get(`/custom_policy/${customPolicyId}`);
}
/**
* This method updates an existing custom policy specified by the <b>custom_policy_id</b> path parameter for the selected marketplace.
* @param customPolicyId This path parameter is the unique custom policy identifier for the policy to be returned.
* @param body Request to update a current custom policy.
*/
updateCustomPolicy(customPolicyId, body) {
customPolicyId = encodeURIComponent(customPolicyId);
return this.put(`/custom_policy/${customPolicyId}`, body);
}
/**
* This method retrieves all the fulfillment policies configured for the marketplace you specify using the

@@ -37,3 +72,3 @@ * marketplace_id query parameter.

createFulfillmentPolicy(body) {
return this.post(`/fulfillment_policy`, body);
return this.post(`/fulfillment_policy/`, body);
}

@@ -47,4 +82,4 @@ /**

updateFulfillmentPolicy(fulfillmentPolicyId, body) {
const id = encodeURIComponent(fulfillmentPolicyId);
return this.put(`/fulfillment_policy/${id}`, body);
fulfillmentPolicyId = encodeURIComponent(fulfillmentPolicyId);
return this.put(`/fulfillment_policy/${fulfillmentPolicyId}`, body);
}

@@ -57,4 +92,4 @@ /**

deleteFulfillmentPolicy(fulfillmentPolicyId) {
const id = encodeURIComponent(fulfillmentPolicyId);
return this.delete(`/fulfillment_policy/${id}`);
fulfillmentPolicyId = encodeURIComponent(fulfillmentPolicyId);
return this.delete(`/fulfillment_policy/${fulfillmentPolicyId}`);
}

@@ -333,2 +368,15 @@ /**

/**
* This method retrieves a list of subscriptions associated with the seller account.
* @param limit This field is for future use.
* @param continuationToken This field is for future use.
*/
getSubscription({ limit, continuationToken } = {}) {
return this.get(`/subscription`, {
params: {
limit,
continuation_token: continuationToken
}
});
}
/**
* his method is used by sellers onboarded for eBay managed payments, or sellers who are currently going through, or who are eligible for onboarding for eBay managed payments.

@@ -339,4 +387,86 @@ */

}
/**
* This method allows developers to check the seller eligibility status for eBay advertising programs.
* @param programTypes A comma-separated list of eBay advertising programs.
*/
getAdvertisingEligibility(programTypes) {
return this.get(`/advertising_eligibility`, {
params: {
program_types: programTypes
}
});
}
/**
* This call retrieves all defined details of the inventory location that is specified by the <b>merchantLocationKey</b> path parameter.
* @param merchantLocationKey A unique merchant-defined key (ID) for an inventory location.
*/
getInventoryLocation(merchantLocationKey) {
merchantLocationKey = encodeURIComponent(merchantLocationKey);
return this.get(`/location/${merchantLocationKey}`);
}
/**
* <p>Use this call to create a new inventory location.
* @param merchantLocationKey A unique, merchant-defined key (ID) for an inventory location.
* @param body Inventory Location details
*/
createInventoryLocation(merchantLocationKey, body) {
merchantLocationKey = encodeURIComponent(merchantLocationKey);
return this.post(`/location/${merchantLocationKey}`, body);
}
/**
* <p>This call deletes the inventory location that is specified in the <code>merchantLocationKey</code> path parameter.
* @param merchantLocationKey
*/
deleteInventoryLocation(merchantLocationKey) {
merchantLocationKey = encodeURIComponent(merchantLocationKey);
return this.delete(`/location/${merchantLocationKey}`);
}
/**
* <p>This call disables the inventory location that is specified in the <code>merchantLocationKey</code> path parameter.
* @param merchantLocationKey A unique merchant-defined key (ID) for an inventory location.
*/
disableInventoryLocation(merchantLocationKey) {
merchantLocationKey = encodeURIComponent(merchantLocationKey);
return this.post(`/location/${merchantLocationKey}/disable`);
}
/**
* <p>This call enables a disabled inventory location that is specified in the <code>merchantLocationKey</code> path parameter.
* @param merchantLocationKey A unique merchant-defined key (ID) for an inventory location.
*/
enableInventoryLocation(merchantLocationKey) {
merchantLocationKey = encodeURIComponent(merchantLocationKey);
return this.post(`/location/${merchantLocationKey}/enable`);
}
/**
* This call retrieves all defined details for every inventory location associated with the seller's account.
* @param limit The value passed in this query parameter sets the maximum number of records to return per page of data.
* @param offset Specifies the number of locations to skip in the result set before returning the first location in the paginated response.
*/
getInventoryLocations({ limit, offset } = {}) {
return this.get(`/location`, {
params: {
limit,
offset
}
});
}
/**
* <p>Use this call to update non-physical location details for an existing inventory location.
* @param merchantLocationKey A unique merchant-defined key (ID) for an inventory location.
* @param body The inventory location details to be updated (other than the address and geo co-ordinates).
*/
updateInventoryLocation(merchantLocationKey, body) {
merchantLocationKey = encodeURIComponent(merchantLocationKey);
return this.post(`/location/${merchantLocationKey}/update_location_details`, body);
}
/**
* This method retrieves all the sales tax jurisdictions for the country that you specify in the <b>countryCode</b> path parameter.
* @param countryCode This path parameter specifies the two-letter <a href="https://www.iso.org/iso-3166-country-codes.html " title="https://www.iso.org " target="_blank">ISO 3166</a> country code for the country whose jurisdictions you want to retrieve. eBay provides sales tax jurisdiction information for Canada and the United States.
*/
getSalesTaxJurisdictions(countryCode) {
countryCode = encodeURIComponent(countryCode);
return this.get(`/country/${countryCode}/sales_tax_jurisdiction`);
}
}
exports.default = Account;
Account.id = 'Account';

@@ -0,3 +1,3 @@

import Api from '../index.js';
import { ClientAlerts, Finding, Merchandising, Shopping, Trading } from '../../types/index.js';
import Api from '../index.js';
/**

@@ -4,0 +4,0 @@ * Traditional eBay API.

@@ -30,4 +30,4 @@ "use strict";

const qs_1 = require("qs");
const index_js_1 = require("../../errors/index.js");
const index_js_2 = __importDefault(require("../index.js"));
const index_js_1 = __importDefault(require("../index.js"));
const index_js_2 = require("../../errors/index.js");
const index_js_3 = __importDefault(require("./clientAlerts/index.js"));

@@ -42,3 +42,3 @@ const index_js_4 = __importDefault(require("./finding/index.js"));

*/
class Traditional extends index_js_2.default {
class Traditional extends index_js_1.default {
constructor() {

@@ -53,3 +53,3 @@ super(...arguments);

// Try to refresh the token.
if (this.config.autoRefreshToken && (error.name === index_js_1.EBayIAFTokenExpired.name || error.name === index_js_1.EBayIAFTokenInvalid.name)) {
if (this.config.autoRefreshToken && (error.name === index_js_2.EBayIAFTokenExpired.name || error.name === index_js_2.EBayIAFTokenInvalid.name)) {
return await this.request(apiConfig, api, callName, fields, true);

@@ -62,2 +62,5 @@ }

createTradingApi() {
if (!this.config.devId) {
throw new Error('devId is required for trading API.');
}
if (typeof this.config.siteId !== 'number') {

@@ -68,6 +71,5 @@ throw new Error('siteId is required for trading API.');

endpoint: {
production: 'api.ebay.com',
sandbox: 'api.sandbox.ebay.com'
production: 'https://api.ebay.com/ws/api.dll',
sandbox: 'https://api.sandbox.ebay.com/ws/api.dll'
},
path: '/ws/api.dll',
calls: index_js_7.default,

@@ -92,6 +94,5 @@ xmlns: 'urn:ebay:apis:eBLBaseComponents',

endpoint: {
production: 'open.api.ebay.com',
sandbox: 'open.api.sandbox.ebay.com'
production: 'https://open.api.ebay.com/shopping',
sandbox: 'https://open.api.sandbox.ebay.com/shopping'
},
path: '/shopping',
xmlns: 'urn:ebay:apis:eBLBaseComponents',

@@ -112,6 +113,5 @@ calls: index_js_6.default,

endpoint: {
production: 'svcs.ebay.com',
sandbox: 'svcs.sandbox.ebay.com'
production: 'https://svcs.ebay.com/services/search/FindingService/v1',
sandbox: 'https://svcs.sandbox.ebay.com/services/search/FindingService/v1'
},
path: '/services/search/FindingService/v1',
xmlns: 'http://www.ebay.com/marketplace/search/v1/services',

@@ -131,6 +131,5 @@ calls: index_js_4.default,

endpoint: {
production: 'clientalerts.ebay.com',
sandbox: 'clientalerts.sandbox.ebay.com'
production: 'https://clientalerts.ebay.com/ws/ecasvc/ClientAlerts',
sandbox: 'https://clientalerts.sandbox.ebay.com/ws/ecasvc/ClientAlerts'
},
path: '/ws/ecasvc/ClientAlerts',
calls: index_js_3.default

@@ -169,6 +168,5 @@ };

endpoint: {
production: 'svcs.ebay.com',
sandbox: 'svcs.sandbox.ebay.com'
production: 'https://svcs.ebay.com/MerchandisingService',
sandbox: 'https://svcs.sandbox.ebay.com/MerchandisingService'
},
path: '/MerchandisingService',
xmlns: 'http://www.ebay.com/marketplace/services',

@@ -195,3 +193,3 @@ calls: index_js_5.default,

catch (e) {
(0, index_js_1.handleEBayError)(e);
(0, index_js_2.handleEBayError)(e);
}

@@ -203,7 +201,6 @@ }

const useIaf = !eBayAuthToken && accessToken;
const host = this.config.sandbox ? api.endpoint.sandbox : api.endpoint.production;
return {
...apiConfig,
xmlns: api.xmlns,
endpoint: `https://${host}${api.path}`,
endpoint: api.endpoint[this.config.sandbox ? 'sandbox' : 'production'],
headers: {

@@ -213,9 +210,2 @@ ...api.headers(callName, useIaf ? accessToken : null),

},
digitalSignatureHeaders: payload => {
return apiConfig.sign ? this.getDigitalSignatureHeaders({
method: 'POST',
authority: host,
path: api.path
}, payload) : {};
},
...(!useIaf ? { eBayAuthToken } : {})

@@ -222,0 +212,0 @@ };

@@ -37,3 +37,2 @@ import { XMLBuilder } from 'fast-xml-parser';

useIaf?: boolean;
sign?: boolean;
hook?: (xml: string) => BodyHeaders;

@@ -45,3 +44,2 @@ } & ApiRequestConfig;

eBayAuthToken?: string | null;
digitalSignatureHeaders?: (payload: any) => Headers;
};

@@ -70,3 +68,3 @@ export declare const defaultApiConfig: Required<Omit<TraditionalApiConfig, 'hook'>>;

*/
constructor(callName: string, fields: Fields | null, config: XMLReqConfig, req: IEBayApiRequest);
constructor(callName: string, fields: Fields, config: XMLReqConfig, req: IEBayApiRequest);
/**

@@ -73,0 +71,0 @@ * returns the expected name of XML node of a Request

@@ -41,3 +41,2 @@ "use strict";

useIaf: true,
sign: false,
headers: {},

@@ -148,3 +147,2 @@ returnResponse: false

...this.getHeaders(),
...this.config.digitalSignatureHeaders ? this.config.digitalSignatureHeaders(body) : {},
...(headers ? headers : {})

@@ -151,0 +149,0 @@ }

@@ -68,9 +68,2 @@ "use strict";

}
let signature = null;
if (process.env.EBAY_JWE && process.env.EBAY_PRIVATE_KEY) {
signature = {
jwe: process.env.EBAY_JWE,
privateKey: process.env.EBAY_PRIVATE_KEY
};
}
return new eBayApi({

@@ -86,4 +79,3 @@ appId: process.env.EBAY_APP_ID,

ruName: process.env.EBAY_RU_NAME,
sandbox: (process.env.EBAY_SANDBOX === 'true'),
signature
sandbox: (process.env.EBAY_SANDBOX === 'true')
}, req);

@@ -90,0 +82,0 @@ }

@@ -131,7 +131,2 @@ "use strict";

}
else if (typeof data === 'string') {
eBayError = {
message: data
};
}
else {

@@ -138,0 +133,0 @@ eBayError = data;

@@ -19,8 +19,2 @@ import { AxiosRequestConfig } from 'axios';

};
export type Cipher = 'sha256' | 'sha512';
export type Signature = {
cipher?: Cipher;
jwe: string;
privateKey: string;
};
export type eBayConfig = Keyset & {

@@ -30,3 +24,2 @@ sandbox: boolean;

scope?: Scope;
signature?: Signature | null;
} & TraditionalConfig & RestConfig;

@@ -33,0 +26,0 @@ export type ApiConfig = {

@@ -888,2 +888,9 @@ import { CancelReason, CaseSearchFieldGroup, CaseStatusFilter, CategoryType as CategoryTypeEnum, Condition, CountryCode, CurrencyCode, Decision, EscalateReason, FilePurpose, FormatType, InquirySearchFieldGroup, InquiryStatusFilter, LengthUnitOfMeasure, Locale, Marketplace, MarketplaceId, PackageType, PaymentMethodType, ReasonForRefund, RecipientAccountReferenceType, RefundFeeType, RefundMethod, RegionType, RequestType, ReturnCountFilter, ReturnMethod, ReturnReason, ReturnShippingCostPayer, ReturnState, ReturnType, ShippingCarrier, ShippingCostType, ShippingOptionType, StoreType, TimeDurationUnit, UserRoleFilter, WeightUnitOfMeasure } from '../enums/index.js';

};
export type CustomPolicyCreateRequest = {
description: string;
label: string;
name: string;
policyType: string;
};
export type CustomPolicyRequest = Omit<CustomPolicyCreateRequest, 'policyType'>;
export type RecipientAccountReference = {

@@ -890,0 +897,0 @@ referenceId: string;

@@ -8,3 +8,3 @@ import ClientAlertsCalls from '../api/traditional/clientAlerts/index.js';

import { TraditionalApiConfig } from '../api/traditional/XMLRequest.js';
export type XMLApiCall = (fields?: Fields | null, apiConfig?: TraditionalApiConfig) => Promise<any>;
export type XMLApiCall = (fields?: Fields, apiConfig?: TraditionalApiConfig) => Promise<any>;
export type Trading = {

@@ -32,3 +32,2 @@ [key in typeof TradingCalls[number]]: XMLApiCall;

xmlns: string;
path: string;
calls: typeof TradingCalls | typeof ShoppingCalls | typeof FindingCalls | typeof ClientAlertsCalls | typeof MerchandisingCalls;

@@ -35,0 +34,0 @@ headers: (callName: string, accessToken?: string | null) => object;

{
"name": "ebay-api",
"author": "Daniil Tomilow",
"version": "8.2.0-RC.0",
"version": "8.2.0",
"description": "eBay API for Node and Browser",

@@ -98,3 +98,2 @@ "type": "module",

"@rollup/plugin-terser": "^0.2.0",
"@rollup/plugin-virtual": "^3.0.1",
"@types/chai": "^4.3.4",

@@ -101,0 +100,0 @@ "@types/debug": "^4.1.7",

@@ -24,3 +24,3 @@ # eBay Node API in TypeScript with Browser support

* `v8.2.0-RC.0` is the latest release.
* `v8.2.0` is the latest release.
* See [here](https://github.com/hendt/ebay-api/blob/master/CHANGELOG.md) for the full changelog.

@@ -38,3 +38,3 @@

| **Post Order API** | ✔ Cancellation API<br>✔ Case Management API<br>✔ Inquiry API<br>✔ Return API |
| **Sell API** | ✔ Account API `v1.6.3`<br>✔ Analytics API `v1.3.0`<br>✔ Compliance API `v1.4.1`<br>✔ Feed API<br>✔ Finance API `v1.9.0`<br>✔ Fulfillment API `v1.19.10`<br>✔ Inventory API `v1.14.0`<br>✔ Listing API<br>✔ Logistics API<br>✔ Marketing API `v1.10.0`<br>✔ Metadata API<br>✔ Negotiation API `v1.1.0`<br>✔ Recommendation API `v1.1.0` |
| **Sell API** | ✔ Account API `v1.9.0`<br>✔ Analytics API `v1.3.0`<br>✔ Compliance API `v1.4.1`<br>✔ Feed API<br>✔ Finance API `v1.9.0`<br>✔ Fulfillment API `v1.19.10`<br>✔ Inventory API `v1.14.0`<br>✔ Listing API<br>✔ Logistics API<br>✔ Marketing API `v1.10.0`<br>✔ Metadata API<br>✔ Negotiation API `v1.1.0`<br>✔ Recommendation API `v1.1.0` |

@@ -41,0 +41,0 @@ ### Traditional API

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc