nextemos 4.0.3 → 4.0.5

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.
@@ -0,0 +1,19 @@
1
+ export declare enum AddressPartTypeId {
2
+ Continent = 1,
3
+ Country = 2,
4
+ GoverningDistrict = 3,
5
+ City = 4,
6
+ County = 5,
7
+ Town = 6,
8
+ Neighbourhood = 7,
9
+ PostalCode = 8,
10
+ Street = 9,
11
+ Complex = 10,
12
+ Apartment = 11,
13
+ Description = 12,
14
+ TelephoneNumber = 13,
15
+ Name = 14,
16
+ Surname = 15,
17
+ CorporationName = 16,
18
+ MobilePhone = 17
19
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddressPartTypeId = void 0;
4
+ var AddressPartTypeId;
5
+ (function (AddressPartTypeId) {
6
+ AddressPartTypeId[AddressPartTypeId["Continent"] = 1] = "Continent";
7
+ AddressPartTypeId[AddressPartTypeId["Country"] = 2] = "Country";
8
+ AddressPartTypeId[AddressPartTypeId["GoverningDistrict"] = 3] = "GoverningDistrict";
9
+ AddressPartTypeId[AddressPartTypeId["City"] = 4] = "City";
10
+ AddressPartTypeId[AddressPartTypeId["County"] = 5] = "County";
11
+ AddressPartTypeId[AddressPartTypeId["Town"] = 6] = "Town";
12
+ AddressPartTypeId[AddressPartTypeId["Neighbourhood"] = 7] = "Neighbourhood";
13
+ AddressPartTypeId[AddressPartTypeId["PostalCode"] = 8] = "PostalCode";
14
+ AddressPartTypeId[AddressPartTypeId["Street"] = 9] = "Street";
15
+ AddressPartTypeId[AddressPartTypeId["Complex"] = 10] = "Complex";
16
+ AddressPartTypeId[AddressPartTypeId["Apartment"] = 11] = "Apartment";
17
+ AddressPartTypeId[AddressPartTypeId["Description"] = 12] = "Description";
18
+ AddressPartTypeId[AddressPartTypeId["TelephoneNumber"] = 13] = "TelephoneNumber";
19
+ AddressPartTypeId[AddressPartTypeId["Name"] = 14] = "Name";
20
+ AddressPartTypeId[AddressPartTypeId["Surname"] = 15] = "Surname";
21
+ AddressPartTypeId[AddressPartTypeId["CorporationName"] = 16] = "CorporationName";
22
+ AddressPartTypeId[AddressPartTypeId["MobilePhone"] = 17] = "MobilePhone";
23
+ })(AddressPartTypeId || (exports.AddressPartTypeId = AddressPartTypeId = {}));
@@ -3,3 +3,4 @@ export * from './httpStatusCode';
3
3
  export * from './productDocumentTypes';
4
4
  export * from './productFlags';
5
5
  export * from './scopeTypes';
6
+ export * from './addressPartTypeId';
@@ -19,3 +19,4 @@ __exportStar(require("./httpStatusCode"), exports);
19
19
  __exportStar(require("./productDocumentTypes"), exports);
20
20
  __exportStar(require("./productFlags"), exports);
21
21
  __exportStar(require("./scopeTypes"), exports);
22
+ __exportStar(require("./addressPartTypeId"), exports);
@@ -42,10 +42,6 @@ const fetchRequest = () => {
42
42
  console.log(`Fetch Request: ${method} - ${apiURL} - ${JSON.stringify(options)}`);
43
43
  try {
44
44
  const response = yield fetch(apiURL.toString(), Object.assign(Object.assign({}, options), { method }));
45
- if (!response.ok) {
46
- const errorDetail = yield response.text();
47
- throw new Error(`Fetch Request HTTP Error: ${response.status} - ${apiURL} - ${errorDetail}`);
48
- }
49
45
  // Headers nesnesini Object'e dönüştürme
50
46
  const headers = {};
51
47
  if (response === null || response === void 0 ? void 0 : response.headers) {
@@ -53,6 +49,15 @@ const fetchRequest = () => {
53
49
  headers[name] = value;
54
50
  });
55
51
  }
52
+ if (!response.ok) {
53
+ const errorDetail = yield response.text();
54
+ return {
55
+ status: response.status,
56
+ errorMessage: errorDetail,
57
+ headers
58
+ };
59
+ // throw new Error(`Fetch Request HTTP Error: ${response.status} - ${apiURL} - ${errorDetail}`);
60
+ }
56
61
  // response data nesnesini JSON'a dönüştürme.
57
62
  const responseData = yield response.json().catch(() => ({}));
58
63
  return {
@@ -1,3 +1,4 @@
1
+ import { AddressPartTypeId } from "nextemos/enums";
1
2
  import { IResponse } from "./response";
2
3
  export interface IWarehousesResponse extends IResponse {
3
4
  data?: IWarehouse[];
@@ -5,26 +6,31 @@ export interface IWarehousesResponse extends IResponse {
5
6
  export interface IWarehouseResponse extends IResponse {
6
7
  data?: IWarehouse;
7
8
  }
9
+ export interface AddressPart {
10
+ addressPartTypeId?: AddressPartTypeId;
11
+ addressPartTypeName?: string;
12
+ referenceId?: number;
13
+ inputType?: number;
14
+ valueText?: string;
15
+ valueId?: number;
16
+ valueIntegrationCode?: string;
17
+ }
18
+ export interface Address {
19
+ fullAddress?: string;
20
+ parts?: AddressPart[];
21
+ }
8
22
  export interface IWarehouse {
9
23
  id?: number;
10
24
  name?: string;
11
- shortName?: string;
12
25
  isDefault?: boolean;
13
26
  integrationCode?: string;
14
27
  wareHouseTypeId?: number;
15
- imagePath?: string;
16
28
  longitude?: string;
17
29
  latitude?: string;
18
- cityId?: number;
19
- city?: string;
20
- countyId?: number;
21
- county?: string;
22
- fullAddress?: string;
23
30
  shipPlanOrder?: number;
24
31
  contactPerson?: string;
25
32
  contactMail?: string;
26
33
  stokManagement?: boolean;
27
- vendorId?: number;
28
- order?: number;
29
34
  inStoreDeliveryAvailable?: boolean;
35
+ address?: Address;
30
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextemos",
3
- "version": "4.0.3",
3
+ "version": "4.0.5",
4
4
  "description": "For helpers and hooks used in NextJS projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",