@lonca/trendyol 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/{client-Bp0jKEU7.d.cts → client-BhSJFkFo.d.cts} +50 -14
- package/dist/{client-Bp0jKEU7.d.ts → client-BhSJFkFo.d.ts} +50 -14
- package/dist/index.cjs +27 -18
- 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 +27 -18
- package/dist/index.js.map +1 -1
- package/dist/testing.cjs +27 -18
- 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 -18
- package/dist/testing.js.map +1 -1
- package/package.json +5 -5
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-BhSJFkFo.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-BhSJFkFo.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-BhSJFkFo.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-BhSJFkFo.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
|
@@ -83,7 +83,6 @@ function normalizeCategory(node) {
|
|
|
83
83
|
}
|
|
84
84
|
function normalizeAttribute(node) {
|
|
85
85
|
const attr = node.attribute ?? { id: 0, name: "" };
|
|
86
|
-
const rawValues = node.attributeValues ?? [];
|
|
87
86
|
const out = {
|
|
88
87
|
id: String(attr.id),
|
|
89
88
|
name: attr.name,
|
|
@@ -91,7 +90,8 @@ function normalizeAttribute(node) {
|
|
|
91
90
|
allowCustom: !!node.allowCustom,
|
|
92
91
|
varianter: !!node.varianter,
|
|
93
92
|
slicer: !!node.slicer,
|
|
94
|
-
|
|
93
|
+
// Deprecated: normally empty — see `attributeValues` on the node above.
|
|
94
|
+
values: (node.attributeValues ?? []).map((v) => ({ id: String(v.id), name: v.name }))
|
|
95
95
|
};
|
|
96
96
|
if (node.categoryId !== void 0) {
|
|
97
97
|
out.categoryId = String(node.categoryId);
|
|
@@ -153,8 +153,8 @@ var CategoriesResource = class {
|
|
|
153
153
|
/**
|
|
154
154
|
* Fetch the allowed values for a single category attribute (paginated).
|
|
155
155
|
*
|
|
156
|
-
* `getCategoryAttributes` returns attribute metadata + flags
|
|
157
|
-
*
|
|
156
|
+
* `getCategoryAttributes` returns attribute metadata + flags only, never the
|
|
157
|
+
* value catalog (docs and prod wire agree). Use this method to fetch the catalog for an
|
|
158
158
|
* attribute when `allowCustom` is `false` and you need to map your data
|
|
159
159
|
* onto Trendyol's accepted values.
|
|
160
160
|
*
|
|
@@ -1101,8 +1101,7 @@ var LocationsResource = class {
|
|
|
1101
1101
|
return n(data, (node) => ({
|
|
1102
1102
|
id: node.id !== void 0 ? String(node.id) : void 0,
|
|
1103
1103
|
code: String(node.code ?? node.id ?? ""),
|
|
1104
|
-
name: node.name
|
|
1105
|
-
cityCode: node.cityCode !== void 0 ? String(node.cityCode) : void 0
|
|
1104
|
+
name: node.name
|
|
1106
1105
|
}));
|
|
1107
1106
|
}
|
|
1108
1107
|
async neighborhoods(path) {
|
|
@@ -1111,12 +1110,16 @@ var LocationsResource = class {
|
|
|
1111
1110
|
path,
|
|
1112
1111
|
rateLimiter: this.limiter
|
|
1113
1112
|
});
|
|
1114
|
-
return n(data, (node) =>
|
|
1115
|
-
id
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1113
|
+
return n(data, (node) => {
|
|
1114
|
+
const id = node.id !== void 0 ? String(node.id) : void 0;
|
|
1115
|
+
return {
|
|
1116
|
+
id,
|
|
1117
|
+
// Neighborhood rows have no code; `code` mirrors the id (as it always did in practice).
|
|
1118
|
+
code: id ?? "",
|
|
1119
|
+
name: node.name,
|
|
1120
|
+
postCode: typeof node.postCode === "string" ? node.postCode : void 0
|
|
1121
|
+
};
|
|
1122
|
+
});
|
|
1120
1123
|
}
|
|
1121
1124
|
};
|
|
1122
1125
|
var MAX_PAGE_SIZE = 200;
|
|
@@ -2472,29 +2475,35 @@ var VALID_TYPES = /* @__PURE__ */ new Set([
|
|
|
2472
2475
|
"WAREHOUSE"
|
|
2473
2476
|
]);
|
|
2474
2477
|
function normalizeAddressType(raw) {
|
|
2475
|
-
|
|
2476
|
-
|
|
2478
|
+
const upper = typeof raw === "string" ? raw.toUpperCase() : void 0;
|
|
2479
|
+
if (upper && VALID_TYPES.has(upper)) {
|
|
2480
|
+
return upper;
|
|
2477
2481
|
}
|
|
2478
|
-
const stripped =
|
|
2482
|
+
const stripped = upper?.replace(/_ADDRESS$/, "");
|
|
2479
2483
|
if (stripped && VALID_TYPES.has(stripped)) {
|
|
2480
2484
|
return stripped;
|
|
2481
2485
|
}
|
|
2482
2486
|
return "SHIPMENT";
|
|
2483
2487
|
}
|
|
2488
|
+
function optionalString(value) {
|
|
2489
|
+
return typeof value === "number" || typeof value === "string" ? String(value) : void 0;
|
|
2490
|
+
}
|
|
2484
2491
|
function normalizeAddress2(node) {
|
|
2485
2492
|
return {
|
|
2486
2493
|
id: String(node.id),
|
|
2487
|
-
name: node.name,
|
|
2488
2494
|
addressType: normalizeAddressType(node.addressType),
|
|
2489
2495
|
isShipmentAddress: node.isShipmentAddress ?? false,
|
|
2490
2496
|
isReturningAddress: node.isReturningAddress ?? false,
|
|
2491
2497
|
isInvoiceAddress: node.isInvoiceAddress ?? false,
|
|
2492
2498
|
isDefault: node.isDefault ?? false,
|
|
2493
2499
|
address: node.address,
|
|
2500
|
+
fullAddress: node.fullAddress,
|
|
2501
|
+
country: node.country,
|
|
2494
2502
|
city: node.city,
|
|
2503
|
+
cityCode: optionalString(node.cityCode),
|
|
2495
2504
|
district: node.district,
|
|
2496
|
-
|
|
2497
|
-
|
|
2505
|
+
districtId: optionalString(node.districtId),
|
|
2506
|
+
postCode: node.postCode
|
|
2498
2507
|
};
|
|
2499
2508
|
}
|
|
2500
2509
|
var DEFAULT_CACHE_TTL_MS = 60 * 60 * 1e3;
|