@lonca/trendyol 1.0.1 → 1.1.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/{client-CnDyop_o.d.cts → client-Bp0jKEU7.d.cts} +26 -0
- package/dist/{client-CnDyop_o.d.ts → client-Bp0jKEU7.d.ts} +26 -0
- package/dist/index.cjs +29 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +29 -9
- package/dist/index.js.map +1 -1
- package/dist/testing.cjs +27 -8
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +27 -8
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { aZ as ShipmentPackage, a7 as KnownShipmentPackageStatus } from './client-
|
|
2
|
-
export { A as AnswerQuestionResult, a as ApproveClaimLineItemsInput, b as ApprovedProductStatus, B as BarcodeCategoryLookup, c as BatchAcceptedResponse, d as BatchPollOptions, e as BatchRequestItemResult, f as BatchRequestResult, g as BatchRequestStatus, h as Brand, i as BrandsResource, j as BuyboxInfo, C as CancelPackageItemInput, k as CareInstruction, l as CargoInvoiceItem, m as CategoriesResource, n as Category, o as CategoryAttribute, p as CategoryAttributeValue, q as City, r as Claim, s as ClaimIssueReason, t as ClaimItemAudit, u as ClaimItemStatus, v as ClaimsResource, w as CommonLabel, x as CommonLabelEntry, y as CompensationItemDetail, z as CompensationTicket, D as CompensationTicketState, E as Country, F as CreateClaimInput, G as CreateClaimIssueInput, H as CreateClaimItemInput, I as CreateClientOptions, J as CreateCommonLabelInput, K as CreateProductV2Input, L as CreateTestOrderInput, M as CreateTestOrderResult, N as CreateVideoInput, O as CreateVideoResult, P as CreateWebhookResult, Q as DeleteInvoiceLinkInput, R as DeliveryOptionInput, S as District, T as ExportBatchAcceptedResponse, U as ExportBatchStatus, V as ExportCategoryAttribute, W as ExportCenterResource, X as ExportPackage, Y as ExportPackageItem, Z as ExportPackageStatus, _ as ExportPriceUpdateInput, $ as ExportProduct, a0 as ExportProductInput, a1 as ExportStockUpdateInput, a2 as FinanceResource, a3 as FinancialTransaction, a4 as GetExportPackageItemsParams, a5 as InventoryResource, a6 as InvoicesResource, a8 as LabelsResource, a9 as LaborCostInput, aa as ListCategoryAttributeValuesParams, ab as ListClaimsParams, ac as ListCompensationTicketsParams, ad as ListExportPackagesV2Params, ae as ListExportPackagesV3Params, af as ListExportProductsParams, ag as ListFinanceParams, ah as ListInventoryAndPriceParams, ai as ListOrdersParams, aj as ListOrdersStreamParams, ak as ListProductsParams, al as ListQuestionsParams, am as ListUnapprovedProductsParams, an as ListVideosParams, ao as LocationsResource, ap as NamedRef, aq as Neighborhood, ar as OrderAddress, as as OrderAddressLines, at as OrderCustomer, au as OrderLine, av as OrderLineDiscountDetail, aw as OrdersResource, ax as OtherFinancialRow, ay as PackageDetail, az as PackageHistoryEntry, aA as PackageLineUpdate, aB as PriceInventoryUpdate, aC as ProcessAlternativeDeliveryInput, aD as Product, aE as ProductAttribute, aF as ProductAttributeV2Input, aG as ProductBase, aH as ProductComposition, aI as ProductContentBase, aJ as ProductImageInput, aK as ProductOrigin, aL as ProductStockPrice, aM as ProductStockPriceVariant, aN as ProductVariant, aO as ProductsResource, aP as QuantitySplit, aQ as Question, aR as QuestionAnswer, aS as QuestionStatus, aT as QuestionsResource, aU as SellerIntegrationStatus, aV as SellerVideo, aW as SendInvoiceLinkInput, aX as SetClaimsWaitingInActionInput, aY as SettlementRow, a_ as ShipmentPackageStatus, a$ as SplitGroup, b0 as SplitPackagePlan, b1 as SupplierAddress, b2 as SupplierAddressType, b3 as SuppliersResource, b4 as SuppliersResourceOptions, b5 as TestOrderStatus, b6 as TestOrderStatusLine, b7 as TestOrdersResource, b8 as TrendyolCapabilities, b9 as TrendyolCargoProvider, ba as TrendyolClient, bb as TrendyolEnvironment, bc as UnapprovedDateQueryType, bd as UnapprovedProduct, be as UnapprovedProductRejectReason, bf as UnapprovedProductStatus, bg as UpdateBoxInfoInput, bh as UpdateContentInput, bi as UpdateDeliveryInfoInput, bj as UpdatePackageStatusInput, bk as UpdatePriceInventoryResponse, bl as UpdateTestOrderStatusOptions, bm as UpdateUnapprovedInput, bn as UpdateVariantInput, bo as UploadInvoiceFileInput, bp as VideoContentType, bq as VideosResource, br as Webhook, bs as WebhookAuthenticationType, bt as WebhookInput, bu as WebhooksResource, bv as createTrendyolClient, bw as normalizeShipmentPackage, bx as pollBatchStatus, by as trendyolCapabilities } from './client-
|
|
1
|
+
import { aZ as ShipmentPackage, a7 as KnownShipmentPackageStatus } from './client-Bp0jKEU7.cjs';
|
|
2
|
+
export { A as AnswerQuestionResult, a as ApproveClaimLineItemsInput, b as ApprovedProductStatus, B as BarcodeCategoryLookup, c as BatchAcceptedResponse, d as BatchPollOptions, e as BatchRequestItemResult, f as BatchRequestResult, g as BatchRequestStatus, h as Brand, i as BrandsResource, j as BuyboxInfo, C as CancelPackageItemInput, k as CareInstruction, l as CargoInvoiceItem, m as CategoriesResource, n as Category, o as CategoryAttribute, p as CategoryAttributeValue, q as City, r as Claim, s as ClaimIssueReason, t as ClaimItemAudit, u as ClaimItemStatus, v as ClaimsResource, w as CommonLabel, x as CommonLabelEntry, y as CompensationItemDetail, z as CompensationTicket, D as CompensationTicketState, E as Country, F as CreateClaimInput, G as CreateClaimIssueInput, H as CreateClaimItemInput, I as CreateClientOptions, J as CreateCommonLabelInput, K as CreateProductV2Input, L as CreateTestOrderInput, M as CreateTestOrderResult, N as CreateVideoInput, O as CreateVideoResult, P as CreateWebhookResult, Q as DeleteInvoiceLinkInput, R as DeliveryOptionInput, S as District, T as ExportBatchAcceptedResponse, U as ExportBatchStatus, V as ExportCategoryAttribute, W as ExportCenterResource, X as ExportPackage, Y as ExportPackageItem, Z as ExportPackageStatus, _ as ExportPriceUpdateInput, $ as ExportProduct, a0 as ExportProductInput, a1 as ExportStockUpdateInput, a2 as FinanceResource, a3 as FinancialTransaction, a4 as GetExportPackageItemsParams, a5 as InventoryResource, a6 as InvoicesResource, a8 as LabelsResource, a9 as LaborCostInput, aa as ListCategoryAttributeValuesParams, ab as ListClaimsParams, ac as ListCompensationTicketsParams, ad as ListExportPackagesV2Params, ae as ListExportPackagesV3Params, af as ListExportProductsParams, ag as ListFinanceParams, ah as ListInventoryAndPriceParams, ai as ListOrdersParams, aj as ListOrdersStreamParams, ak as ListProductsParams, al as ListQuestionsParams, am as ListUnapprovedProductsParams, an as ListVideosParams, ao as LocationsResource, ap as NamedRef, aq as Neighborhood, ar as OrderAddress, as as OrderAddressLines, at as OrderCustomer, au as OrderLine, av as OrderLineDiscountDetail, aw as OrdersResource, ax as OtherFinancialRow, ay as PackageDetail, az as PackageHistoryEntry, aA as PackageLineUpdate, aB as PriceInventoryUpdate, aC as ProcessAlternativeDeliveryInput, aD as Product, aE as ProductAttribute, aF as ProductAttributeV2Input, aG as ProductBase, aH as ProductComposition, aI as ProductContentBase, aJ as ProductImageInput, aK as ProductOrigin, aL as ProductStockPrice, aM as ProductStockPriceVariant, aN as ProductVariant, aO as ProductsResource, aP as QuantitySplit, aQ as Question, aR as QuestionAnswer, aS as QuestionStatus, aT as QuestionsResource, aU as SellerIntegrationStatus, aV as SellerVideo, aW as SendInvoiceLinkInput, aX as SetClaimsWaitingInActionInput, aY as SettlementRow, a_ as ShipmentPackageStatus, a$ as SplitGroup, b0 as SplitPackagePlan, b1 as SupplierAddress, b2 as SupplierAddressType, b3 as SuppliersResource, b4 as SuppliersResourceOptions, b5 as TestOrderStatus, b6 as TestOrderStatusLine, b7 as TestOrdersResource, b8 as TrendyolCapabilities, b9 as TrendyolCargoProvider, ba as TrendyolClient, bb as TrendyolEnvironment, bc as UnapprovedDateQueryType, bd as UnapprovedProduct, be as UnapprovedProductRejectReason, bf as UnapprovedProductStatus, bg as UpdateBoxInfoInput, bh as UpdateContentInput, bi as UpdateDeliveryInfoInput, bj as UpdatePackageStatusInput, bk as UpdatePriceInventoryResponse, bl as UpdateTestOrderStatusOptions, bm as UpdateUnapprovedInput, bn as UpdateVariantInput, bo as UploadInvoiceFileInput, bp as VideoContentType, bq as VideosResource, br as Webhook, bs as WebhookAuthenticationType, bt as WebhookInput, bu as WebhooksResource, bv as createTrendyolClient, bw as normalizeShipmentPackage, bx as pollBatchStatus, by as trendyolCapabilities } from './client-Bp0jKEU7.cjs';
|
|
3
3
|
import * as _lonca_core from '@lonca/core';
|
|
4
4
|
import { NormalizedOrderStatus } from '@lonca/core';
|
|
5
5
|
export { CursorPage, CursorPaginationParams, MutationResult, OffsetPage, OffsetPaginationParams, paginate, paginateOffset } from '@lonca/core';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { aZ as ShipmentPackage, a7 as KnownShipmentPackageStatus } from './client-
|
|
2
|
-
export { A as AnswerQuestionResult, a as ApproveClaimLineItemsInput, b as ApprovedProductStatus, B as BarcodeCategoryLookup, c as BatchAcceptedResponse, d as BatchPollOptions, e as BatchRequestItemResult, f as BatchRequestResult, g as BatchRequestStatus, h as Brand, i as BrandsResource, j as BuyboxInfo, C as CancelPackageItemInput, k as CareInstruction, l as CargoInvoiceItem, m as CategoriesResource, n as Category, o as CategoryAttribute, p as CategoryAttributeValue, q as City, r as Claim, s as ClaimIssueReason, t as ClaimItemAudit, u as ClaimItemStatus, v as ClaimsResource, w as CommonLabel, x as CommonLabelEntry, y as CompensationItemDetail, z as CompensationTicket, D as CompensationTicketState, E as Country, F as CreateClaimInput, G as CreateClaimIssueInput, H as CreateClaimItemInput, I as CreateClientOptions, J as CreateCommonLabelInput, K as CreateProductV2Input, L as CreateTestOrderInput, M as CreateTestOrderResult, N as CreateVideoInput, O as CreateVideoResult, P as CreateWebhookResult, Q as DeleteInvoiceLinkInput, R as DeliveryOptionInput, S as District, T as ExportBatchAcceptedResponse, U as ExportBatchStatus, V as ExportCategoryAttribute, W as ExportCenterResource, X as ExportPackage, Y as ExportPackageItem, Z as ExportPackageStatus, _ as ExportPriceUpdateInput, $ as ExportProduct, a0 as ExportProductInput, a1 as ExportStockUpdateInput, a2 as FinanceResource, a3 as FinancialTransaction, a4 as GetExportPackageItemsParams, a5 as InventoryResource, a6 as InvoicesResource, a8 as LabelsResource, a9 as LaborCostInput, aa as ListCategoryAttributeValuesParams, ab as ListClaimsParams, ac as ListCompensationTicketsParams, ad as ListExportPackagesV2Params, ae as ListExportPackagesV3Params, af as ListExportProductsParams, ag as ListFinanceParams, ah as ListInventoryAndPriceParams, ai as ListOrdersParams, aj as ListOrdersStreamParams, ak as ListProductsParams, al as ListQuestionsParams, am as ListUnapprovedProductsParams, an as ListVideosParams, ao as LocationsResource, ap as NamedRef, aq as Neighborhood, ar as OrderAddress, as as OrderAddressLines, at as OrderCustomer, au as OrderLine, av as OrderLineDiscountDetail, aw as OrdersResource, ax as OtherFinancialRow, ay as PackageDetail, az as PackageHistoryEntry, aA as PackageLineUpdate, aB as PriceInventoryUpdate, aC as ProcessAlternativeDeliveryInput, aD as Product, aE as ProductAttribute, aF as ProductAttributeV2Input, aG as ProductBase, aH as ProductComposition, aI as ProductContentBase, aJ as ProductImageInput, aK as ProductOrigin, aL as ProductStockPrice, aM as ProductStockPriceVariant, aN as ProductVariant, aO as ProductsResource, aP as QuantitySplit, aQ as Question, aR as QuestionAnswer, aS as QuestionStatus, aT as QuestionsResource, aU as SellerIntegrationStatus, aV as SellerVideo, aW as SendInvoiceLinkInput, aX as SetClaimsWaitingInActionInput, aY as SettlementRow, a_ as ShipmentPackageStatus, a$ as SplitGroup, b0 as SplitPackagePlan, b1 as SupplierAddress, b2 as SupplierAddressType, b3 as SuppliersResource, b4 as SuppliersResourceOptions, b5 as TestOrderStatus, b6 as TestOrderStatusLine, b7 as TestOrdersResource, b8 as TrendyolCapabilities, b9 as TrendyolCargoProvider, ba as TrendyolClient, bb as TrendyolEnvironment, bc as UnapprovedDateQueryType, bd as UnapprovedProduct, be as UnapprovedProductRejectReason, bf as UnapprovedProductStatus, bg as UpdateBoxInfoInput, bh as UpdateContentInput, bi as UpdateDeliveryInfoInput, bj as UpdatePackageStatusInput, bk as UpdatePriceInventoryResponse, bl as UpdateTestOrderStatusOptions, bm as UpdateUnapprovedInput, bn as UpdateVariantInput, bo as UploadInvoiceFileInput, bp as VideoContentType, bq as VideosResource, br as Webhook, bs as WebhookAuthenticationType, bt as WebhookInput, bu as WebhooksResource, bv as createTrendyolClient, bw as normalizeShipmentPackage, bx as pollBatchStatus, by as trendyolCapabilities } from './client-
|
|
1
|
+
import { aZ as ShipmentPackage, a7 as KnownShipmentPackageStatus } from './client-Bp0jKEU7.js';
|
|
2
|
+
export { A as AnswerQuestionResult, a as ApproveClaimLineItemsInput, b as ApprovedProductStatus, B as BarcodeCategoryLookup, c as BatchAcceptedResponse, d as BatchPollOptions, e as BatchRequestItemResult, f as BatchRequestResult, g as BatchRequestStatus, h as Brand, i as BrandsResource, j as BuyboxInfo, C as CancelPackageItemInput, k as CareInstruction, l as CargoInvoiceItem, m as CategoriesResource, n as Category, o as CategoryAttribute, p as CategoryAttributeValue, q as City, r as Claim, s as ClaimIssueReason, t as ClaimItemAudit, u as ClaimItemStatus, v as ClaimsResource, w as CommonLabel, x as CommonLabelEntry, y as CompensationItemDetail, z as CompensationTicket, D as CompensationTicketState, E as Country, F as CreateClaimInput, G as CreateClaimIssueInput, H as CreateClaimItemInput, I as CreateClientOptions, J as CreateCommonLabelInput, K as CreateProductV2Input, L as CreateTestOrderInput, M as CreateTestOrderResult, N as CreateVideoInput, O as CreateVideoResult, P as CreateWebhookResult, Q as DeleteInvoiceLinkInput, R as DeliveryOptionInput, S as District, T as ExportBatchAcceptedResponse, U as ExportBatchStatus, V as ExportCategoryAttribute, W as ExportCenterResource, X as ExportPackage, Y as ExportPackageItem, Z as ExportPackageStatus, _ as ExportPriceUpdateInput, $ as ExportProduct, a0 as ExportProductInput, a1 as ExportStockUpdateInput, a2 as FinanceResource, a3 as FinancialTransaction, a4 as GetExportPackageItemsParams, a5 as InventoryResource, a6 as InvoicesResource, a8 as LabelsResource, a9 as LaborCostInput, aa as ListCategoryAttributeValuesParams, ab as ListClaimsParams, ac as ListCompensationTicketsParams, ad as ListExportPackagesV2Params, ae as ListExportPackagesV3Params, af as ListExportProductsParams, ag as ListFinanceParams, ah as ListInventoryAndPriceParams, ai as ListOrdersParams, aj as ListOrdersStreamParams, ak as ListProductsParams, al as ListQuestionsParams, am as ListUnapprovedProductsParams, an as ListVideosParams, ao as LocationsResource, ap as NamedRef, aq as Neighborhood, ar as OrderAddress, as as OrderAddressLines, at as OrderCustomer, au as OrderLine, av as OrderLineDiscountDetail, aw as OrdersResource, ax as OtherFinancialRow, ay as PackageDetail, az as PackageHistoryEntry, aA as PackageLineUpdate, aB as PriceInventoryUpdate, aC as ProcessAlternativeDeliveryInput, aD as Product, aE as ProductAttribute, aF as ProductAttributeV2Input, aG as ProductBase, aH as ProductComposition, aI as ProductContentBase, aJ as ProductImageInput, aK as ProductOrigin, aL as ProductStockPrice, aM as ProductStockPriceVariant, aN as ProductVariant, aO as ProductsResource, aP as QuantitySplit, aQ as Question, aR as QuestionAnswer, aS as QuestionStatus, aT as QuestionsResource, aU as SellerIntegrationStatus, aV as SellerVideo, aW as SendInvoiceLinkInput, aX as SetClaimsWaitingInActionInput, aY as SettlementRow, a_ as ShipmentPackageStatus, a$ as SplitGroup, b0 as SplitPackagePlan, b1 as SupplierAddress, b2 as SupplierAddressType, b3 as SuppliersResource, b4 as SuppliersResourceOptions, b5 as TestOrderStatus, b6 as TestOrderStatusLine, b7 as TestOrdersResource, b8 as TrendyolCapabilities, b9 as TrendyolCargoProvider, ba as TrendyolClient, bb as TrendyolEnvironment, bc as UnapprovedDateQueryType, bd as UnapprovedProduct, be as UnapprovedProductRejectReason, bf as UnapprovedProductStatus, bg as UpdateBoxInfoInput, bh as UpdateContentInput, bi as UpdateDeliveryInfoInput, bj as UpdatePackageStatusInput, bk as UpdatePriceInventoryResponse, bl as UpdateTestOrderStatusOptions, bm as UpdateUnapprovedInput, bn as UpdateVariantInput, bo as UploadInvoiceFileInput, bp as VideoContentType, bq as VideosResource, br as Webhook, bs as WebhookAuthenticationType, bt as WebhookInput, bu as WebhooksResource, bv as createTrendyolClient, bw as normalizeShipmentPackage, bx as pollBatchStatus, by as trendyolCapabilities } from './client-Bp0jKEU7.js';
|
|
3
3
|
import * as _lonca_core from '@lonca/core';
|
|
4
4
|
import { NormalizedOrderStatus } from '@lonca/core';
|
|
5
5
|
export { CursorPage, CursorPaginationParams, MutationResult, OffsetPage, OffsetPaginationParams, paginate, paginateOffset } from '@lonca/core';
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,11 @@ export { paginate, paginateOffset } from '@lonca/core';
|
|
|
3
3
|
|
|
4
4
|
// src/resources/brands.ts
|
|
5
5
|
var DEFAULT_PAGE_SIZE = 1e3;
|
|
6
|
+
function toBrand(node) {
|
|
7
|
+
const brand = { id: String(node.id), name: node.name };
|
|
8
|
+
if (typeof node.luxe === "boolean") brand.luxe = node.luxe;
|
|
9
|
+
return brand;
|
|
10
|
+
}
|
|
6
11
|
var BrandsResource = class {
|
|
7
12
|
constructor(transport, limiter) {
|
|
8
13
|
this.transport = transport;
|
|
@@ -13,6 +18,14 @@ var BrandsResource = class {
|
|
|
13
18
|
/**
|
|
14
19
|
* List Trendyol brands, one page at a time.
|
|
15
20
|
*
|
|
21
|
+
* **Next-page heuristic.** Trendyol's brand list carries no page count (neither the docs
|
|
22
|
+
* nor the prod wire have `totalPages` / `totalElements` — the response is just
|
|
23
|
+
* `{ brands: [...] }`). So when `totalPages` is absent, a **full page** (at least `limit`
|
|
24
|
+
* brands — Trendyol may send ~1000 even for a smaller `limit`) means "there may be more"
|
|
25
|
+
* and sets `nextCursor`; a short page is the last one. When the
|
|
26
|
+
* total is an exact multiple of the page size, `paginate()` makes one extra request that
|
|
27
|
+
* comes back empty and stops there. If Trendyol ever sends `totalPages`, it wins.
|
|
28
|
+
*
|
|
16
29
|
* @example
|
|
17
30
|
* ```ts
|
|
18
31
|
* import { paginate } from '@lonca/core';
|
|
@@ -30,8 +43,10 @@ var BrandsResource = class {
|
|
|
30
43
|
query: { page, size },
|
|
31
44
|
rateLimiter: this.limiter
|
|
32
45
|
});
|
|
33
|
-
const
|
|
34
|
-
const
|
|
46
|
+
const brands = data?.brands ?? [];
|
|
47
|
+
const items = brands.map(toBrand);
|
|
48
|
+
const hasMore = typeof data?.totalPages === "number" ? page + 1 < data.totalPages : size > 0 && brands.length >= size;
|
|
49
|
+
const nextCursor = hasMore ? String(page + 1) : void 0;
|
|
35
50
|
return nextCursor !== void 0 ? { items, nextCursor } : { items };
|
|
36
51
|
}
|
|
37
52
|
/**
|
|
@@ -55,7 +70,7 @@ var BrandsResource = class {
|
|
|
55
70
|
query: { name },
|
|
56
71
|
rateLimiter: this.limiter
|
|
57
72
|
});
|
|
58
|
-
return (data ?? []).map(
|
|
73
|
+
return (data ?? []).map(toBrand);
|
|
59
74
|
}
|
|
60
75
|
};
|
|
61
76
|
function normalizeCategory(node) {
|
|
@@ -1020,7 +1035,7 @@ var LocationsResource = class {
|
|
|
1020
1035
|
}
|
|
1021
1036
|
// ─── Domestic (TR / AZ) ───────────────────────────────────────────────
|
|
1022
1037
|
async getTurkeyCities() {
|
|
1023
|
-
return this.cities(`/integration/member/countries/domestic/TR/cities
|
|
1038
|
+
return this.cities(`/integration/member/countries/domestic/TR/cities`, "TR");
|
|
1024
1039
|
}
|
|
1025
1040
|
/**
|
|
1026
1041
|
* List districts for a Turkish city. **Pass the city `id`** (`City.id`) — the
|
|
@@ -1042,7 +1057,7 @@ var LocationsResource = class {
|
|
|
1042
1057
|
);
|
|
1043
1058
|
}
|
|
1044
1059
|
async getAzerbaijanCities() {
|
|
1045
|
-
return this.cities(`/integration/member/countries/domestic/AZ/cities
|
|
1060
|
+
return this.cities(`/integration/member/countries/domestic/AZ/cities`, "AZ");
|
|
1046
1061
|
}
|
|
1047
1062
|
/** List districts for an Azerbaijani city. **Pass the city `id`** (`City.id`), not `code`. */
|
|
1048
1063
|
async getAzerbaijanDistricts(cityId) {
|
|
@@ -1052,7 +1067,10 @@ var LocationsResource = class {
|
|
|
1052
1067
|
}
|
|
1053
1068
|
// ─── International (GULF / CEE) ───────────────────────────────────────
|
|
1054
1069
|
async getCitiesByCountry(countryCode) {
|
|
1055
|
-
return this.cities(
|
|
1070
|
+
return this.cities(
|
|
1071
|
+
`/integration/member/countries/${encodeURIComponent(countryCode)}/cities`,
|
|
1072
|
+
countryCode
|
|
1073
|
+
);
|
|
1056
1074
|
}
|
|
1057
1075
|
async getDistrictsByCity(countryCode, cityId) {
|
|
1058
1076
|
return this.districts(
|
|
@@ -1060,7 +1078,8 @@ var LocationsResource = class {
|
|
|
1060
1078
|
);
|
|
1061
1079
|
}
|
|
1062
1080
|
// ─── Shared paginators ────────────────────────────────────────────────
|
|
1063
|
-
|
|
1081
|
+
/** `countryCode` is the lookup's country — city rows do not carry one on the wire. */
|
|
1082
|
+
async cities(path, countryCode) {
|
|
1064
1083
|
const data = await this.transport.request({
|
|
1065
1084
|
method: "GET",
|
|
1066
1085
|
path,
|
|
@@ -1070,7 +1089,7 @@ var LocationsResource = class {
|
|
|
1070
1089
|
id: node.id !== void 0 ? String(node.id) : void 0,
|
|
1071
1090
|
code: String(node.code ?? node.id ?? ""),
|
|
1072
1091
|
name: node.name,
|
|
1073
|
-
countryCode
|
|
1092
|
+
countryCode
|
|
1074
1093
|
}));
|
|
1075
1094
|
}
|
|
1076
1095
|
async districts(path) {
|
|
@@ -2942,7 +2961,8 @@ function createTrendyolClient(opts) {
|
|
|
2942
2961
|
integratorName: opts.integratorName,
|
|
2943
2962
|
clientIp: opts.clientIp,
|
|
2944
2963
|
logger: opts.logger,
|
|
2945
|
-
timeoutMs: opts.timeoutMs
|
|
2964
|
+
timeoutMs: opts.timeoutMs,
|
|
2965
|
+
fetch: opts.fetch
|
|
2946
2966
|
});
|
|
2947
2967
|
return buildClient(transport);
|
|
2948
2968
|
}
|