@entegrasyonapp/lib 1.0.0 → 1.2.0

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/dist/index.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.defaultBackoffRequestOptions = exports.backoffRequest = exports.generateRequestId = exports.Ozon = exports.LCW = exports.PttAvm = exports.N11 = exports.Boyner = exports.Ciceksepeti = exports.Trendyol = exports.Hepsiburada = void 0;
27
37
  // Integrations
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,eAAe;AACf,6EAA6D;AAC7D,uEAAuD;AACvD,6EAA6D;AAC7D,mEAAmD;AACnD,6DAA6C;AAC7C,mEAAmD;AACnD,6DAA6C;AAC7C,+DAA+C;AAE/C,QAAQ;AACR,iDAAuD;AAA9C,+GAAA,iBAAiB,OAAA;AAC1B,2DAAuF;AAA9E,iHAAA,cAAc,OAAA;AAAE,+HAAA,4BAA4B,OAAA","sourcesContent":["// Integrations\nexport * as Hepsiburada from './integrations/hepsiburada/v1';\nexport * as Trendyol from './integrations/trendyol/v1';\nexport * as Ciceksepeti from './integrations/ciceksepeti/v1';\nexport * as Boyner from './integrations/boyner/v1';\nexport * as N11 from './integrations/n11/v2';\nexport * as PttAvm from './integrations/pttavm/v1';\nexport * as LCW from './integrations/lcw/v1';\nexport * as Ozon from './integrations/ozon/v1';\n\n// Utils\nexport { generateRequestId } from './utils/request-id';\nexport { backoffRequest, defaultBackoffRequestOptions } from './utils/backoff-request';\nexport type { IBackoffRequestOptions } from './utils/backoff-request';\n\n// Common\nexport type { IClient } from './common/client';\nexport type { IRequest, IRequestInput } from './common/request';\nexport type { IKVHandler } from './common/kv-handler';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,eAAe;AACf,6EAA6D;AAC7D,uEAAuD;AACvD,6EAA6D;AAC7D,mEAAmD;AACnD,6DAA6C;AAC7C,mEAAmD;AACnD,6DAA6C;AAC7C,+DAA+C;AAE/C,QAAQ;AACR,iDAAuD;AAA9C,+GAAA,iBAAiB,OAAA;AAC1B,2DAAuF;AAA9E,iHAAA,cAAc,OAAA;AAAE,+HAAA,4BAA4B,OAAA","sourcesContent":["// Integrations\nexport * as Hepsiburada from './integrations/hepsiburada/v1';\nexport * as Trendyol from './integrations/trendyol/v1';\nexport * as Ciceksepeti from './integrations/ciceksepeti/v1';\nexport * as Boyner from './integrations/boyner/v1';\nexport * as N11 from './integrations/n11/v2';\nexport * as PttAvm from './integrations/pttavm/v1';\nexport * as LCW from './integrations/lcw/v1';\nexport * as Ozon from './integrations/ozon/v1';\n\n// Utils\nexport { generateRequestId } from './utils/request-id';\nexport { backoffRequest, defaultBackoffRequestOptions } from './utils/backoff-request';\nexport type { IBackoffRequestOptions } from './utils/backoff-request';\n\n// Common\nexport type { IClient } from './common/client';\nexport type { IRequest, IRequestInput } from './common/request';\nexport type { IKVHandler } from './common/kv-handler';\n"]}
@@ -40,7 +40,7 @@ class Request {
40
40
  headers: this.request.headers,
41
41
  responseType: 'json',
42
42
  validateStatus: (status) => {
43
- return ![401, 403, 404].includes(status);
43
+ return ![401, 403, 404, 500].includes(status);
44
44
  },
45
45
  };
46
46
  this.axiosConfig.auth = {
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/integrations/boyner/v1/request.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,kDAAiE;AAEjE,4EAA6C;AAE7C,0DAA8D;AAE9D,MAAa,OAAO;IAII;IAAwB;IAHpC,WAAW,CAA8B;IACzC,iBAAiB,CAAY;IAErC,YAAoB,MAAc,EAAU,OAA+B;QAAvD,WAAM,GAAN,MAAM,CAAQ;QAAU,YAAO,GAAP,OAAO,CAAwB;QACvE,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,SAAS,EAAE,CAAC;YACpC,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC;QAC9B,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,kBAAkB,CAAC;QACxF,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,UAAU,oBAAoB,CAAC;QAC9I,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YACpB,IAAI,CAAC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AI,IAAI,CAAC,iBAAiB,IAAI,SAAS,EAAE,CAAC;YACtC,MAAM,IAAI,GAAG,IAAI,4BAAW,CAAC,eAAK,CAAC,CAAC;YACpC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;QAED,OAAO,IAAA,eAAK,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;CACJ;AArDD,0BAqDC","sourcesContent":["/**\n * Request module for Boyner\n * @package entegrasyonapp/lib\n * @author Ekin Karadeniz\n * @copyright 2023-2024\n */\n\nimport axios, { AxiosRequestConfig, AxiosResponse } from \"axios\";\nimport { Client } from \"./client\";\nimport MockAdapter from \"axios-mock-adapter\";\nimport { IRequest, IRequestInput } from \"./../../../common/request\";\nimport { generateRequestId } from \"../../../utils/request-id\";\n\nexport class Request implements IRequest {\n private axiosConfig: Partial<AxiosRequestConfig>;\n private axiosMockCallback?: Function;\n\n constructor(private client: Client, private request: Partial<IRequestInput>) {\n if (this.request.headers == undefined) {\n this.request.headers = {};\n }\n this.request.headers['Accept'] = this.request.headers?.['Accept'] ?? 'application/json';\n this.request.headers['User-Agent'] = this.request.headers?.['User-Agent'] ?? `${this.client.params.credentials.supplierId} - Entegrasyon.app`;\n if (this.request.body) {\n this.request.headers['Content-Type'] = this.request.headers?.['Content-Type'] ?? 'application/json';\n }\n\n this.axiosConfig = {\n baseURL: this.client.getBaseURL(),\n timeout: this.client.params.options?.timeout,\n proxy: this.client.params.options?.proxy,\n method: this.request.method,\n url: this.request.path,\n params: this.request.params,\n data: this.request.body,\n headers: this.request.headers,\n responseType: 'json',\n validateStatus: (status: number) => {\n return ![401, 403, 404].includes(status);\n },\n };\n\n this.axiosConfig.auth = {\n username: this.client.params.credentials.apiKey,\n password: this.client.params.credentials.apiSecret\n };\n }\n\n setAxiosMock(callback: Function) {\n this.axiosMockCallback = callback;\n }\n\n getRequestId(): string {\n return generateRequestId(this.axiosConfig, 'boyner-v1');\n }\n\n async send(): Promise<AxiosResponse> {\n\n // mocks will be used during the tests\n if (this.axiosMockCallback != undefined) {\n const mock = new MockAdapter(axios);\n this.axiosMockCallback(mock);\n }\n\n return axios(this.axiosConfig);\n }\n}"]}
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/integrations/boyner/v1/request.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,kDAAiE;AAEjE,4EAA6C;AAE7C,0DAA8D;AAE9D,MAAa,OAAO;IAII;IAAwB;IAHpC,WAAW,CAA8B;IACzC,iBAAiB,CAAY;IAErC,YAAoB,MAAc,EAAU,OAA+B;QAAvD,WAAM,GAAN,MAAM,CAAQ;QAAU,YAAO,GAAP,OAAO,CAAwB;QACvE,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,SAAS,EAAE,CAAC;YACpC,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC;QAC9B,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,kBAAkB,CAAC;QACxF,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,UAAU,oBAAoB,CAAC;QAC9I,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YACpB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,cAAc,CAAC,IAAI,kBAAkB,CAAC;QACxG,CAAC;QAED,IAAI,CAAC,WAAW,GAAG;YACf,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;YACjC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,M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ACJ;AArDD,0BAqDC","sourcesContent":["/**\n * Request module for Boyner\n * @package entegrasyonapp/lib\n * @author Ekin Karadeniz\n * @copyright 2023-2024\n */\n\nimport axios, { AxiosRequestConfig, AxiosResponse } from \"axios\";\nimport { Client } from \"./client\";\nimport MockAdapter from \"axios-mock-adapter\";\nimport { IRequest, IRequestInput } from \"./../../../common/request\";\nimport { generateRequestId } from \"../../../utils/request-id\";\n\nexport class Request implements IRequest {\n private axiosConfig: Partial<AxiosRequestConfig>;\n private axiosMockCallback?: Function;\n\n constructor(private client: Client, private request: Partial<IRequestInput>) {\n if (this.request.headers == undefined) {\n this.request.headers = {};\n }\n this.request.headers['Accept'] = this.request.headers?.['Accept'] ?? 'application/json';\n this.request.headers['User-Agent'] = this.request.headers?.['User-Agent'] ?? `${this.client.params.credentials.supplierId} - Entegrasyon.app`;\n if (this.request.body) {\n this.request.headers['Content-Type'] = this.request.headers?.['Content-Type'] ?? 'application/json';\n }\n\n this.axiosConfig = {\n baseURL: this.client.getBaseURL(),\n timeout: this.client.params.options?.timeout,\n proxy: this.client.params.options?.proxy,\n method: this.request.method,\n url: this.request.path,\n params: this.request.params,\n data: this.request.body,\n headers: this.request.headers,\n responseType: 'json',\n validateStatus: (status: number) => {\n return ![401, 403, 404, 500].includes(status);\n },\n };\n\n this.axiosConfig.auth = {\n username: this.client.params.credentials.apiKey,\n password: this.client.params.credentials.apiSecret\n };\n }\n\n setAxiosMock(callback: Function) {\n this.axiosMockCallback = callback;\n }\n\n getRequestId(): string {\n return generateRequestId(this.axiosConfig, 'boyner-v1');\n }\n\n async send(): Promise<AxiosResponse> {\n\n // mocks will be used during the tests\n if (this.axiosMockCallback != undefined) {\n const mock = new MockAdapter(axios);\n this.axiosMockCallback(mock);\n }\n\n return axios(this.axiosConfig);\n }\n}"]}
@@ -40,7 +40,7 @@ class Request {
40
40
  headers: this.request.headers,
41
41
  responseType: 'json',
42
42
  validateStatus: (status) => {
43
- return ![401, 403, 404].includes(status);
43
+ return ![401, 403, 404, 500].includes(status);
44
44
  },
45
45
  };
46
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/integrations/ciceksepeti/v1/request.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,kDAAiE;AAEjE,4EAA6C;AAE7C,0DAA8D;AAE9D,MAAa,OAAO;IAII;IAAwB;IAHpC,WAAW,CAA8B;IACzC,iBAAiB,CAAY;IAErC,YAAoB,MAAc,EAAU,OAA+B;QAAvD,WAAM,GAAN,MAAM,CAAQ;QAAU,YAAO,GAAP,OAAO,CAAwB;QACvE,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,SAAS,EAAE,CAAC;YACpC,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC;QAC9B,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,kBAAkB,CAAC;QACxF,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC;QAC1E,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YACpB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,cAAc,CAAC,IAAI,kBAAkB,CAAC;QACxG,CAAC;QAED,IAAI,CAAC,WAAW,GAAG;YACf,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;YACjC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO;YAC5C,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK;YACxC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;YAC3B,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;YACtB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;YAC3B,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;YACvB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO;YAC7B,YAAY,EAAE,MAAM;YACpB,cAAc,EAAE,CAAC,MAAc,EAAE,EAAE;gBAC/B,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC7C,CAAC;SACJ,CAAC;IACN,CAAC;IAED,YAAY,CAAC,QAAkB;QAC3B,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC;IACtC,CAAC;IAED,YAAY;QACR,OAAO,IAAA,8BAAiB,EAAC,IAAI,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,IAAI;QAEN,sCAAsC;QACtC,IAAI,IAAI,CAAC,iBAAiB,IAAI,SAAS,EAAE,CAAC;YACtC,MAAM,IAAI,GAAG,IAAI,4BAAW,CAAC,eAAK,CAAC,CAAC;YACpC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;QAED,OAAO,IAAA,eAAK,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;CACJ;AAhDD,0BAgDC","sourcesContent":["/**\n * Request module for Çiçeksepeti\n * @package entegrasyonapp/lib\n * @author Ekin Karadeniz\n * @copyright 2023-2024\n */\n\nimport axios, { AxiosRequestConfig, AxiosResponse } from \"axios\";\nimport { Client } from \"./client\";\nimport MockAdapter from \"axios-mock-adapter\";\nimport { IRequest, IRequestInput } from \"./../../../common/request\";\nimport { generateRequestId } from \"../../../utils/request-id\";\n\nexport class Request implements IRequest {\n private axiosConfig: Partial<AxiosRequestConfig>;\n private axiosMockCallback?: Function;\n\n constructor(private client: Client, private request: Partial<IRequestInput>) {\n if (this.request.headers == undefined) {\n this.request.headers = {};\n }\n this.request.headers['Accept'] = this.request.headers?.['Accept'] ?? 'application/json';\n this.request.headers['x-api-key'] = this.client.params.credentials.apiKey;\n if (this.request.body) {\n this.request.headers['Content-Type'] = this.request.headers?.['Content-Type'] ?? 'application/json';\n }\n\n this.axiosConfig = {\n baseURL: this.client.getBaseURL(),\n timeout: this.client.params.options?.timeout,\n proxy: this.client.params.options?.proxy,\n method: this.request.method,\n url: this.request.path,\n params: this.request.params,\n data: this.request.body,\n headers: this.request.headers,\n responseType: 'json',\n validateStatus: (status: number) => {\n return ![401, 403, 404].includes(status);\n },\n };\n }\n\n setAxiosMock(callback: Function) {\n this.axiosMockCallback = callback;\n }\n\n getRequestId(): string {\n return generateRequestId(this.axiosConfig, 'ciceksepeti-v1');\n }\n\n async send(): Promise<AxiosResponse> {\n\n // mocks will be used during the tests\n if (this.axiosMockCallback != undefined) {\n const mock = new MockAdapter(axios);\n this.axiosMockCallback(mock);\n }\n\n return axios(this.axiosConfig);\n }\n}"]}
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/integrations/ciceksepeti/v1/request.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,kDAAiE;AAEjE,4EAA6C;AAE7C,0DAA8D;AAE9D,MAAa,OAAO;IAII;IAAwB;IAHpC,WAAW,CAA8B;IACzC,iBAAiB,CAAY;IAErC,YAAoB,MAAc,EAAU,OAA+B;QAAvD,WAAM,GAAN,MAAM,CAAQ;QAAU,YAAO,GAAP,OAAO,CAAwB;QACvE,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,SAAS,EAAE,CAAC;YACpC,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC;QAC9B,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,QAAQ,CA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AI;QAEN,sCAAsC;QACtC,IAAI,IAAI,CAAC,iBAAiB,IAAI,SAAS,EAAE,CAAC;YACtC,MAAM,IAAI,GAAG,IAAI,4BAAW,CAAC,eAAK,CAAC,CAAC;YACpC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;QAED,OAAO,IAAA,eAAK,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;CACJ;AAhDD,0BAgDC","sourcesContent":["/**\n * Request module for Çiçeksepeti\n * @package entegrasyonapp/lib\n * @author Ekin Karadeniz\n * @copyright 2023-2024\n */\n\nimport axios, { AxiosRequestConfig, AxiosResponse } from \"axios\";\nimport { Client } from \"./client\";\nimport MockAdapter from \"axios-mock-adapter\";\nimport { IRequest, IRequestInput } from \"./../../../common/request\";\nimport { generateRequestId } from \"../../../utils/request-id\";\n\nexport class Request implements IRequest {\n private axiosConfig: Partial<AxiosRequestConfig>;\n private axiosMockCallback?: Function;\n\n constructor(private client: Client, private request: Partial<IRequestInput>) {\n if (this.request.headers == undefined) {\n this.request.headers = {};\n }\n this.request.headers['Accept'] = this.request.headers?.['Accept'] ?? 'application/json';\n this.request.headers['x-api-key'] = this.client.params.credentials.apiKey;\n if (this.request.body) {\n this.request.headers['Content-Type'] = this.request.headers?.['Content-Type'] ?? 'application/json';\n }\n\n this.axiosConfig = {\n baseURL: this.client.getBaseURL(),\n timeout: this.client.params.options?.timeout,\n proxy: this.client.params.options?.proxy,\n method: this.request.method,\n url: this.request.path,\n params: this.request.params,\n data: this.request.body,\n headers: this.request.headers,\n responseType: 'json',\n validateStatus: (status: number) => {\n return ![401, 403, 404, 500].includes(status);\n },\n };\n }\n\n setAxiosMock(callback: Function) {\n this.axiosMockCallback = callback;\n }\n\n getRequestId(): string {\n return generateRequestId(this.axiosConfig, 'ciceksepeti-v1');\n }\n\n async send(): Promise<AxiosResponse> {\n\n // mocks will be used during the tests\n if (this.axiosMockCallback != undefined) {\n const mock = new MockAdapter(axios);\n this.axiosMockCallback(mock);\n }\n\n return axios(this.axiosConfig);\n }\n}"]}
@@ -42,7 +42,7 @@ class Request {
42
42
  headers: this.request.headers,
43
43
  responseType: 'json',
44
44
  validateStatus: (status) => {
45
- return ![401, 403, 404].includes(status);
45
+ return ![401, 403, 404, 500].includes(status);
46
46
  },
47
47
  };
48
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/integrations/n11/v2/request.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,kDAAiE;AAEjE,4EAA6C;AAE7C,0DAA8D;AAE9D,MAAa,OAAO;IAII;IAAwB;IAHpC,WAAW,CAA8B;IACzC,iBAAiB,CAAY;IAErC,YAAoB,MAAc,EAAU,OAA+B;QAAvD,WAAM,GAAN,MAAM,CAAQ;QAAU,YAAO,GAAP,OAAO,CAAwB;QACvE,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,SAAS,EAAE,CAAC;YACpC,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC;QAC9B,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,kBAAkB,CAAC;QACxF,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,YAAY,CAAC,IAAI,qBAAqB,CAAC;QACnG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC;QACvE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC;QAC7E,IAAI,IAAI,CAAC,OAAO,CAAC,IAA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;QAED,OAAO,IAAA,eAAK,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;CACJ;AAlDD,0BAkDC","sourcesContent":["/**\n * Request module for N11\n * @package entegrasyonapp/lib\n * @author Ekin Karadeniz\n * @copyright 2023-2024\n */\n\nimport axios, { AxiosRequestConfig, AxiosResponse } from \"axios\";\nimport { Client } from \"./client\";\nimport MockAdapter from \"axios-mock-adapter\";\nimport { IRequest, IRequestInput } from \"./../../../common/request\";\nimport { generateRequestId } from \"../../../utils/request-id\";\n\nexport class Request implements IRequest {\n private axiosConfig: Partial<AxiosRequestConfig>;\n private axiosMockCallback?: Function;\n\n constructor(private client: Client, private request: Partial<IRequestInput>) {\n if (this.request.headers == undefined) {\n this.request.headers = {};\n }\n this.request.headers['Accept'] = this.request.headers?.['Accept'] ?? 'application/json';\n this.request.headers['User-Agent'] = this.request.headers?.['User-Agent'] ?? 'Entegrasyon.app/1.0';\n this.request.headers['appkey'] = this.client.params.credentials.apiKey;\n this.request.headers['appsecret'] = this.client.params.credentials.apiSecret;\n if (this.request.body) {\n this.request.headers['Content-Type'] = this.request.headers?.['Content-Type'] ?? 'application/json';\n }\n\n this.axiosConfig = {\n baseURL: this.client.getBaseURL(),\n timeout: this.client.params.options?.timeout,\n proxy: this.client.params.options?.proxy,\n method: this.request.method,\n url: this.request.path,\n params: this.request.params,\n data: this.request.body,\n headers: this.request.headers,\n responseType: 'json',\n validateStatus: (status: number) => {\n return ![401, 403, 404].includes(status);\n },\n };\n }\n\n setAxiosMock(callback: Function) {\n this.axiosMockCallback = callback;\n }\n\n getRequestId(): string {\n return generateRequestId(this.axiosConfig, 'n11-v1');\n }\n\n async send(): Promise<AxiosResponse> {\n\n // mocks will be used during the tests\n if (this.axiosMockCallback != undefined) {\n const mock = new MockAdapter(axios);\n this.axiosMockCallback(mock);\n }\n\n return axios(this.axiosConfig);\n }\n}"]}
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/integrations/n11/v2/request.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,CAAC,OAAO,EAAE,OAAO;YAC5C,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK;YACxC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;YAC3B,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;YACtB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;YAC3B,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;YACvB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO;YAC7B,YAAY,EAAE,MAAM;YACpB,cAAc,EAAE,CAAC,MAAc,EAAE,EAAE;gBAC/B,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAClD,CAAC;SACJ,CAAC;IACN,CAAC;IAED,YAAY,CAAC,QAAkB;QAC3B,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC;IACtC,CAAC;IAED,YAAY;QACR,OAAO,IAAA,8BAAiB,EAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,IAAI;QAEN,sCAAsC;QACtC,IAAI,IAAI,CAAC,iBAAiB,IAAI,SAAS,EAAE,CAAC;YACtC,MAAM,IAAI,GAAG,IAAI,4BAAW,CAAC,eAAK,CAAC,CAAC;YACpC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;QAED,OAAO,IAAA,eAAK,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;CACJ;AAlDD,0BAkDC","sourcesContent":["/**\n * Request module for N11\n * @package entegrasyonapp/lib\n * @author Ekin Karadeniz\n * @copyright 2023-2024\n */\n\nimport axios, { AxiosRequestConfig, AxiosResponse } from \"axios\";\nimport { Client } from \"./client\";\nimport MockAdapter from \"axios-mock-adapter\";\nimport { IRequest, IRequestInput } from \"./../../../common/request\";\nimport { generateRequestId } from \"../../../utils/request-id\";\n\nexport class Request implements IRequest {\n private axiosConfig: Partial<AxiosRequestConfig>;\n private axiosMockCallback?: Function;\n\n constructor(private client: Client, private request: Partial<IRequestInput>) {\n if (this.request.headers == undefined) {\n this.request.headers = {};\n }\n this.request.headers['Accept'] = this.request.headers?.['Accept'] ?? 'application/json';\n this.request.headers['User-Agent'] = this.request.headers?.['User-Agent'] ?? 'Entegrasyon.app/1.0';\n this.request.headers['appkey'] = this.client.params.credentials.apiKey;\n this.request.headers['appsecret'] = this.client.params.credentials.apiSecret;\n if (this.request.body) {\n this.request.headers['Content-Type'] = this.request.headers?.['Content-Type'] ?? 'application/json';\n }\n\n this.axiosConfig = {\n baseURL: this.client.getBaseURL(),\n timeout: this.client.params.options?.timeout,\n proxy: this.client.params.options?.proxy,\n method: this.request.method,\n url: this.request.path,\n params: this.request.params,\n data: this.request.body,\n headers: this.request.headers,\n responseType: 'json',\n validateStatus: (status: number) => {\n return ![401, 403, 404, 500].includes(status);\n },\n };\n }\n\n setAxiosMock(callback: Function) {\n this.axiosMockCallback = callback;\n }\n\n getRequestId(): string {\n return generateRequestId(this.axiosConfig, 'n11-v1');\n }\n\n async send(): Promise<AxiosResponse> {\n\n // mocks will be used during the tests\n if (this.axiosMockCallback != undefined) {\n const mock = new MockAdapter(axios);\n this.axiosMockCallback(mock);\n }\n\n return axios(this.axiosConfig);\n }\n}"]}
@@ -43,7 +43,7 @@ class Request {
43
43
  headers: this.request.headers,
44
44
  responseType: 'text',
45
45
  validateStatus: (status) => {
46
- return ![401, 403, 404, 415].includes(status);
46
+ return ![401, 403, 404, 415, 500].includes(status);
47
47
  },
48
48
  };
49
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/integrations/pttavm/v1/request.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,kDAAiE;AAEjE,4EAA6C;AAE7C,0DAA8D;AAE9D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3B,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;YACtB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;YAC3B,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;YACvB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO;YAC7B,YAAY,EAAE,MAAM;YACpB,cAAc,EAAE,CAAC,MAAc,EAAE,EAAE;gBAC/B,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAClD,CAAC;SACJ,CAAC;IACN,CAAC;IAED,YAAY,CAAC,QAAkB;QAC3B,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC;IACtC,CAAC;IAED,YAAY;QACR,OAAO,IAAA,8BAAiB,EAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,IAAI;QAEN,sCAAsC;QACtC,IAAI,IAAI,CAAC,iBAAiB,IAAI,SAAS,EAAE,CAAC;YACtC,MAAM,IAAI,GAAG,IAAI,4BAAW,CAAC,eAAK,CAAC,CAAC;YACpC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;QAED,OAAO,IAAA,eAAK,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;CACJ;AApDD,0BAoDC","sourcesContent":["/**\n * Request module for PttAvm\n * @package entegrasyonapp/lib\n * @author Ekin Karadeniz\n * @copyright 2023-2024\n */\n\nimport axios, { AxiosRequestConfig, AxiosResponse } from \"axios\";\nimport { Client } from \"./client\";\nimport MockAdapter from \"axios-mock-adapter\";\nimport { IRequest, IRequestInput } from \"./../../../common/request\";\nimport { generateRequestId } from \"../../../utils/request-id\";\n\nexport class Request implements IRequest {\n private axiosConfig: Partial<AxiosRequestConfig>;\n private axiosMockCallback?: Function;\n\n constructor(private client: Client, private request: Partial<IRequestInput>) {\n if (this.request.headers == undefined) {\n this.request.headers = {};\n }\n this.request.headers['Accept'] = this.request.headers?.['Accept'] ?? 'text/xml';\n this.request.headers['Content-Type'] = this.request.headers?.['Content-Type'] ?? 'text/xml;charset=utf-8';\n this.request.headers['User-Agent'] = this.request.headers?.['User-Agent'] ?? 'Entegrasyon.app/1.0';\n this.request.headers['SOAPAction'] = `http://tempuri.org/IService/${this.request.soapAction}`;\n\n // PttAvm uses POST as a default method.\n if (!this.request.method) {\n this.request.method = 'post';\n }\n\n this.axiosConfig = {\n baseURL: this.client.getBaseURL(),\n timeout: this.client.params.options?.timeout,\n proxy: this.client.params.options?.proxy,\n method: this.request.method,\n url: this.request.path,\n params: this.request.params,\n data: this.request.body,\n headers: this.request.headers,\n responseType: 'text',\n validateStatus: (status: number) => {\n return ![401, 403, 404, 415].includes(status);\n },\n };\n }\n\n setAxiosMock(callback: Function) {\n this.axiosMockCallback = callback;\n }\n\n getRequestId(): string {\n return generateRequestId(this.axiosConfig, 'pttavm-v1');\n }\n\n async send(): Promise<AxiosResponse> {\n\n // mocks will be used during the tests\n if (this.axiosMockCallback != undefined) {\n const mock = new MockAdapter(axios);\n this.axiosMockCallback(mock);\n }\n\n return axios(this.axiosConfig);\n }\n}"]}
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/integrations/pttavm/v1/request.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,kDAAiE;AAEjE,4EAA6C;AAE7C,0DAA8D;AAE9D,MAAa,OAAO;IAII;IAAwB;IAHpC,WAAW,CAA8B;IACzC,iBAAiB,CAAY;IAErC,YAAoB,MAAc,EAAU,OAA+B;QAAvD,WAAM,GAAN,MAAM,CAAQ;QAAU,YAAO,GAAP,OAAO,CAAwB;QACvE,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,SAAS,EAAE,CAAC;YACpC,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC;QAC9B,CAAC;QAC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AAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YACvD,CAAC;SACJ,CAAC;IACN,CAAC;IAED,YAAY,CAAC,QAAkB;QAC3B,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC;IACtC,CAAC;IAED,YAAY;QACR,OAAO,IAAA,8BAAiB,EAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,IAAI;QAEN,sCAAsC;QACtC,IAAI,IAAI,CAAC,iBAAiB,IAAI,SAAS,EAAE,CAAC;YACtC,MAAM,IAAI,GAAG,IAAI,4BAAW,CAAC,eAAK,CAAC,CAAC;YACpC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;QAED,OAAO,IAAA,eAAK,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;CACJ;AApDD,0BAoDC","sourcesContent":["/**\n * Request module for PttAvm\n * @package entegrasyonapp/lib\n * @author Ekin Karadeniz\n * @copyright 2023-2024\n */\n\nimport axios, { AxiosRequestConfig, AxiosResponse } from \"axios\";\nimport { Client } from \"./client\";\nimport MockAdapter from \"axios-mock-adapter\";\nimport { IRequest, IRequestInput } from \"./../../../common/request\";\nimport { generateRequestId } from \"../../../utils/request-id\";\n\nexport class Request implements IRequest {\n private axiosConfig: Partial<AxiosRequestConfig>;\n private axiosMockCallback?: Function;\n\n constructor(private client: Client, private request: Partial<IRequestInput>) {\n if (this.request.headers == undefined) {\n this.request.headers = {};\n }\n this.request.headers['Accept'] = this.request.headers?.['Accept'] ?? 'text/xml';\n this.request.headers['Content-Type'] = this.request.headers?.['Content-Type'] ?? 'text/xml;charset=utf-8';\n this.request.headers['User-Agent'] = this.request.headers?.['User-Agent'] ?? 'Entegrasyon.app/1.0';\n this.request.headers['SOAPAction'] = `http://tempuri.org/IService/${this.request.soapAction}`;\n\n // PttAvm uses POST as a default method.\n if (!this.request.method) {\n this.request.method = 'post';\n }\n\n this.axiosConfig = {\n baseURL: this.client.getBaseURL(),\n timeout: this.client.params.options?.timeout,\n proxy: this.client.params.options?.proxy,\n method: this.request.method,\n url: this.request.path,\n params: this.request.params,\n data: this.request.body,\n headers: this.request.headers,\n responseType: 'text',\n validateStatus: (status: number) => {\n return ![401, 403, 404, 415, 500].includes(status);\n },\n };\n }\n\n setAxiosMock(callback: Function) {\n this.axiosMockCallback = callback;\n }\n\n getRequestId(): string {\n return generateRequestId(this.axiosConfig, 'pttavm-v1');\n }\n\n async send(): Promise<AxiosResponse> {\n\n // mocks will be used during the tests\n if (this.axiosMockCallback != undefined) {\n const mock = new MockAdapter(axios);\n this.axiosMockCallback(mock);\n }\n\n return axios(this.axiosConfig);\n }\n}"]}
@@ -27,9 +27,9 @@ class Client {
27
27
  }
28
28
  getBaseURL() {
29
29
  if (this.params.options?.env == Environment.STAGE) {
30
- return 'https://stageapi.trendyol.com/stagesapigw/';
30
+ return 'https://stageapigw.trendyol.com/integration/';
31
31
  }
32
- return 'https://api.trendyol.com/sapigw/';
32
+ return 'https://apigw.trendyol.com/integration/';
33
33
  }
34
34
  request(request) {
35
35
  return new request_1.Request(this, request);
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/integrations/trendyol/v1/client.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,uCAAoC;AAiBpC,IAAY,WAGX;AAHD,WAAY,WAAW;IACnB,yDAAU,CAAA;IACV,+CAAK,CAAA;AACT,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAOD,MAAa,MAAM;IACI;IAAnB,YAAmB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;QACpC,MAAM,cAAc,GAAa;YAC7B,GAAG,EAAE,WAAW,CAAC,UAAU;YAC3B,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE,CAAC,EAAE,aAAa;YACzB,KAAK,EAAE,SAAS;SACnB,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,gDAAgD;IACzH,CAAC;IAED,UAAU;QACN,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;YAChD,OAAO,4CAA4C,CAAC;QACxD,CAAC;QACD,OAAO,kCAAkC,CAAC;IAC9C,CAAC;IAED,OAAO,CAAC,OAA+B;QACnC,OAAO,IAAI,iBAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;CACJ;AArBD,wBAqBC","sourcesContent":["/**\n * Client module for Trendyol\n * @package entegrasyonapp/lib\n * @author Ekin Karadeniz\n * @copyright 2023-2024\n */\n\nimport { Request } from \"./request\";\nimport { IClient } from \"./../../../common/client\";\nimport { IRequestInput } from \"./../../../common/request\";\n\nexport interface ICredentials {\n supplierId: string;\n apiKey: string;\n apiSecret: string;\n}\n\nexport interface IOptions {\n env: Environment;\n debug: boolean;\n timeout: number; // milliseconds\n proxy: any;\n}\n\nexport enum Environment {\n PRODUCTION,\n STAGE\n}\n\nexport interface IClientParams {\n credentials: ICredentials;\n options?: Partial<IOptions>;\n}\n\nexport class Client implements IClient {\n constructor(public params: IClientParams) {\n const defaultOptions: IOptions = {\n env: Environment.PRODUCTION,\n debug: false,\n timeout: 0, // no timeout\n proxy: undefined\n };\n this.params.options = { ...defaultOptions, ...this.params.options }; // {...{foo:'bar'}, ...undefined} == {foo:'bar'}\n }\n\n getBaseURL(): string {\n if (this.params.options?.env == Environment.STAGE) {\n return 'https://stageapi.trendyol.com/stagesapigw/';\n }\n return 'https://api.trendyol.com/sapigw/';\n }\n\n request(request: Partial<IRequestInput>): Request {\n return new Request(this, request);\n }\n}\n"]}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/integrations/trendyol/v1/client.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,uCAAoC;AAiBpC,IAAY,WAGX;AAHD,WAAY,WAAW;IACnB,yDAAU,CAAA;IACV,+CAAK,CAAA;AACT,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAOD,MAAa,MAAM;IACI;IAAnB,YAAmB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;QACpC,MAAM,cAAc,GAAa;YAC7B,GAAG,EAAE,WAAW,CAAC,UAAU;YAC3B,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE,CAAC,EAAE,aAAa;YACzB,KAAK,EAAE,SAAS;SACnB,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,gDAAgD;IACzH,CAAC;IAED,UAAU;QACN,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;YAChD,OAAO,8CAA8C,CAAC;QAC1D,CAAC;QACD,OAAO,yCAAyC,CAAC;IACrD,CAAC;IAED,OAAO,CAAC,OAA+B;QACnC,OAAO,IAAI,iBAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;CACJ;AArBD,wBAqBC","sourcesContent":["/**\n * Client module for Trendyol\n * @package entegrasyonapp/lib\n * @author Ekin Karadeniz\n * @copyright 2023-2024\n */\n\nimport { Request } from \"./request\";\nimport { IClient } from \"./../../../common/client\";\nimport { IRequestInput } from \"./../../../common/request\";\n\nexport interface ICredentials {\n supplierId: string;\n apiKey: string;\n apiSecret: string;\n}\n\nexport interface IOptions {\n env: Environment;\n debug: boolean;\n timeout: number; // milliseconds\n proxy: any;\n}\n\nexport enum Environment {\n PRODUCTION,\n STAGE\n}\n\nexport interface IClientParams {\n credentials: ICredentials;\n options?: Partial<IOptions>;\n}\n\nexport class Client implements IClient {\n constructor(public params: IClientParams) {\n const defaultOptions: IOptions = {\n env: Environment.PRODUCTION,\n debug: false,\n timeout: 0, // no timeout\n proxy: undefined\n };\n this.params.options = { ...defaultOptions, ...this.params.options }; // {...{foo:'bar'}, ...undefined} == {foo:'bar'}\n }\n\n getBaseURL(): string {\n if (this.params.options?.env == Environment.STAGE) {\n return 'https://stageapigw.trendyol.com/integration/';\n }\n return 'https://apigw.trendyol.com/integration/';\n }\n\n request(request: Partial<IRequestInput>): Request {\n return new Request(this, request);\n }\n}\n"]}
@@ -40,7 +40,7 @@ class Request {
40
40
  headers: this.request.headers,
41
41
  responseType: 'json',
42
42
  validateStatus: (status) => {
43
- return ![401, 403, 404].includes(status);
43
+ return ![401, 403, 404, 500].includes(status);
44
44
  },
45
45
  };
46
46
  this.axiosConfig.auth = {
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/integrations/trendyol/v1/request.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,kDAAiE;AAEjE,4EAA6C;AAE7C,0DAA8D;AAE9D,MAAa,OAAO;IAII;IAAwB;IAHpC,WAAW,CAA8B;IACzC,iBAAiB,CAAY;IAErC,YAAoB,MAAc,EAAU,OAA+B;QAAvD,WAAM,GAAN,MAAM,CAAQ;QAAU,YAAO,GAAP,OAAO,CAAwB;QACvE,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,SAAS,EAAE,CAAC;YACpC,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC;QAC9B,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,kBAAkB,CAAC;QACxF,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,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,IAAA,8BAAiB,EAAC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,IAAI;QAEN,sCAAsC;QACtC,IAAI,IAAI,CAAC,iBAAiB,IAAI,SAAS,EAAE,CAAC;YACtC,MAAM,IAAI,GAAG,IAAI,4BAAW,CAAC,eAAK,CAAC,CAAC;YACpC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;QAED,OAAO,IAAA,eAAK,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;CACJ;AArDD,0BAqDC","sourcesContent":["/**\n * Request module for Trendyol\n * @package entegrasyonapp/lib\n * @author Ekin Karadeniz\n * @copyright 2023-2024\n */\n\nimport axios, { AxiosRequestConfig, AxiosResponse } from \"axios\";\nimport { Client } from \"./client\";\nimport MockAdapter from \"axios-mock-adapter\";\nimport { IRequest, IRequestInput } from \"./../../../common/request\";\nimport { generateRequestId } from \"../../../utils/request-id\";\n\nexport class Request implements IRequest {\n private axiosConfig: Partial<AxiosRequestConfig>;\n private axiosMockCallback?: Function;\n\n constructor(private client: Client, private request: Partial<IRequestInput>) {\n if (this.request.headers == undefined) {\n this.request.headers = {};\n }\n this.request.headers['Accept'] = this.request.headers?.['Accept'] ?? 'application/json';\n this.request.headers['User-Agent'] = this.request.headers?.['User-Agent'] ?? `${this.client.params.credentials.supplierId} - Entegrasyon.app/1.0`;\n if (this.request.body) {\n this.request.headers['Content-Type'] = this.request.headers?.['Content-Type'] ?? 'application/json';\n }\n\n this.axiosConfig = {\n baseURL: this.client.getBaseURL(),\n timeout: this.client.params.options?.timeout,\n proxy: this.client.params.options?.proxy,\n method: this.request.method,\n url: this.request.path,\n params: this.request.params,\n data: this.request.body,\n headers: this.request.headers,\n responseType: 'json',\n validateStatus: (status: number) => {\n return ![401, 403, 404].includes(status);\n },\n };\n\n this.axiosConfig.auth = {\n username: this.client.params.credentials.apiKey,\n password: this.client.params.credentials.apiSecret\n };\n }\n\n setAxiosMock(callback: Function) {\n this.axiosMockCallback = callback;\n }\n\n getRequestId(): string {\n return generateRequestId(this.axiosConfig, 'trendyol-v1');\n }\n\n async send(): Promise<AxiosResponse> {\n\n // mocks will be used during the tests\n if (this.axiosMockCallback != undefined) {\n const mock = new MockAdapter(axios);\n this.axiosMockCallback(mock);\n }\n\n return axios(this.axiosConfig);\n }\n}"]}
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/integrations/trendyol/v1/request.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,kDAAiE;AAEjE,4EAA6C;AAE7C,0DAA8D;AAE9D,MAAa,OAAO;IAII;IAAwB;IAHpC,WAAW,CAA8B;IACzC,iBAAiB,CAAY;IAErC,YAAoB,MAAc,EAAU,OAA+B;QAAvD,WAAM,GAAN,MAAM,CAAQ;QAAU,YAAO,GAAP,OAAO,CAAwB;QACvE,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,SAAS,EAAE,CAAC;YACpC,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC;QAC9B,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,kBAAkB,CAAC;QACxF,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,UAAU,wBAAwB,CAAC;QAClJ,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YACpB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,cAAc,CAAC,IAAI,kBAAkB,CAAC;QACxG,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C,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;QAED,OAAO,IAAA,eAAK,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;CACJ;AArDD,0BAqDC","sourcesContent":["/**\n * Request module for Trendyol\n * @package entegrasyonapp/lib\n * @author Ekin Karadeniz\n * @copyright 2023-2024\n */\n\nimport axios, { AxiosRequestConfig, AxiosResponse } from \"axios\";\nimport { Client } from \"./client\";\nimport MockAdapter from \"axios-mock-adapter\";\nimport { IRequest, IRequestInput } from \"./../../../common/request\";\nimport { generateRequestId } from \"../../../utils/request-id\";\n\nexport class Request implements IRequest {\n private axiosConfig: Partial<AxiosRequestConfig>;\n private axiosMockCallback?: Function;\n\n constructor(private client: Client, private request: Partial<IRequestInput>) {\n if (this.request.headers == undefined) {\n this.request.headers = {};\n }\n this.request.headers['Accept'] = this.request.headers?.['Accept'] ?? 'application/json';\n this.request.headers['User-Agent'] = this.request.headers?.['User-Agent'] ?? `${this.client.params.credentials.supplierId} - Entegrasyon.app/1.0`;\n if (this.request.body) {\n this.request.headers['Content-Type'] = this.request.headers?.['Content-Type'] ?? 'application/json';\n }\n\n this.axiosConfig = {\n baseURL: this.client.getBaseURL(),\n timeout: this.client.params.options?.timeout,\n proxy: this.client.params.options?.proxy,\n method: this.request.method,\n url: this.request.path,\n params: this.request.params,\n data: this.request.body,\n headers: this.request.headers,\n responseType: 'json',\n validateStatus: (status: number) => {\n return ![401, 403, 404, 500].includes(status);\n },\n };\n\n this.axiosConfig.auth = {\n username: this.client.params.credentials.apiKey,\n password: this.client.params.credentials.apiSecret\n };\n }\n\n setAxiosMock(callback: Function) {\n this.axiosMockCallback = callback;\n }\n\n getRequestId(): string {\n return generateRequestId(this.axiosConfig, 'trendyol-v1');\n }\n\n async send(): Promise<AxiosResponse> {\n\n // mocks will be used during the tests\n if (this.axiosMockCallback != undefined) {\n const mock = new MockAdapter(axios);\n this.axiosMockCallback(mock);\n }\n\n return axios(this.axiosConfig);\n }\n}"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entegrasyonapp/lib",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "Entegrasyon.app libraries.",
5
5
  "scripts": {
6
6
  "clean": "rimraf ./dist && rimraf *.tsbuildinfo",
@@ -28,17 +28,17 @@
28
28
  },
29
29
  "homepage": "https://github.com/entegrasyonapp/lib",
30
30
  "devDependencies": {
31
- "@types/jest": "^29.5.11",
32
- "@types/node": "^20.11.0",
33
- "jest": "^29.7.0",
34
- "rimraf": "^5.0.5",
35
- "ts-jest": "^29.1.1",
31
+ "@types/jest": "^30.0.0",
32
+ "@types/node": "^24.10.0",
33
+ "jest": "^30.2.0",
34
+ "rimraf": "^6.1.0",
35
+ "ts-jest": "^29.4.5",
36
36
  "ts-node": "^10.9.2",
37
- "typescript": "^5.4.3"
37
+ "typescript": "^5.9.3"
38
38
  },
39
39
  "dependencies": {
40
- "axios": "^1.6.8",
41
- "axios-mock-adapter": "^1.22.0"
40
+ "axios": "^1.13.2",
41
+ "axios-mock-adapter": "^2.1.0"
42
42
  },
43
43
  "packageManager": "yarn@3.8.5+sha512.786c27300bc8fb134a1a0630db71cfeccc2b92272c031df17ff662876e89c2df488e6819dd7f2ffaf02e021b6827f75d3eb6a6df0a10218f72a589b735db6cc2",
44
44
  "types": "./dist/index.d.ts"