shipflow 0.1.0 → 0.1.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/dist/carriers/aramex/adapter.d.ts +82 -0
- package/dist/carriers/aramex/adapter.d.ts.map +1 -0
- package/dist/carriers/aramex/index.d.ts +9 -0
- package/dist/carriers/aramex/index.d.ts.map +1 -0
- package/dist/carriers/aramex/index.js +661 -0
- package/dist/carriers/aramex/index.js.map +12 -0
- package/dist/carriers/aramex/mappers.d.ts +68 -0
- package/dist/carriers/aramex/mappers.d.ts.map +1 -0
- package/dist/carriers/aramex/services.d.ts +74 -0
- package/dist/carriers/aramex/services.d.ts.map +1 -0
- package/dist/carriers/aramex/types.d.ts +302 -0
- package/dist/carriers/aramex/types.d.ts.map +1 -0
- package/dist/carriers/aymakan/adapter.d.ts +3 -2
- package/dist/carriers/aymakan/adapter.d.ts.map +1 -1
- package/dist/carriers/aymakan/index.js +54 -43
- package/dist/carriers/aymakan/index.js.map +4 -4
- package/dist/carriers/aymakan/mappers.d.ts.map +1 -1
- package/dist/carriers/aymakan/types.d.ts +4 -6
- package/dist/carriers/aymakan/types.d.ts.map +1 -1
- package/dist/carriers/base.d.ts +2 -2
- package/dist/carriers/base.d.ts.map +1 -1
- package/dist/carriers/smsaexpress/adapter.d.ts +1 -1
- package/dist/carriers/smsaexpress/adapter.d.ts.map +1 -1
- package/dist/carriers/smsaexpress/index.js +12 -8
- package/dist/carriers/smsaexpress/index.js.map +4 -4
- package/dist/carriers/smsaexpress/mappers.d.ts.map +1 -1
- package/dist/core/http.d.ts.map +1 -1
- package/dist/core/schemas.d.ts +3 -3
- package/dist/core/types.d.ts +1 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/{index-x8sk1kw9.js → index-qjtxhwzv.js} +5 -3
- package/dist/{index-x8sk1kw9.js.map → index-qjtxhwzv.js.map} +5 -5
- package/dist/index.js +1 -1
- package/package.json +8 -3
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/carriers/aramex/services.ts", "../src/carriers/aramex/mappers.ts", "../src/carriers/aramex/adapter.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"// file: src/carriers/aramex/services.ts\n/**\n * Aramex Service / Product Codes\n * Use these constants for type-safe product and payment selection.\n *\n * Reference: Aramex Shipping Services API manual, Appendix A (Product Types)\n * and Appendix B (Payment Types).\n */\n\n/** Shipment product group: domestic vs international/express. */\nexport const AramexProductGroup = {\n EXPRESS: \"EXP\",\n DOMESTIC: \"DOM\",\n} as const;\n\n/** Product type codes (Appendix A). `OND` is the only domestic type. */\nexport const AramexProductType = {\n /** Domestic (DOM group) */\n DOMESTIC: \"OND\",\n /** Priority Document Express */\n PRIORITY_DOCUMENT_EXPRESS: \"PDX\",\n /** Priority Parcel Express */\n PRIORITY_PARCEL_EXPRESS: \"PPX\",\n /** Priority Letter Express */\n PRIORITY_LETTER_EXPRESS: \"PLX\",\n /** Deferred Document Express */\n DEFERRED_DOCUMENT_EXPRESS: \"DDX\",\n /** Deferred Parcel Express */\n DEFERRED_PARCEL_EXPRESS: \"DPX\",\n /** Ground Document Express */\n GROUND_DOCUMENT_EXPRESS: \"GDX\",\n /** Ground Parcel Express */\n GROUND_PARCEL_EXPRESS: \"GPX\",\n /** Economy Parcel Express */\n ECONOMY_PARCEL_EXPRESS: \"EPX\",\n /** Return */\n RETURN: \"RTN\",\n} as const;\n\n/** Payment type codes (Appendix B). */\nexport const AramexPaymentType = {\n PREPAID: \"P\",\n COLLECT: \"C\",\n THIRD_PARTY: \"3\",\n} as const;\n\n/**\n * Special service codes joined (comma-separated) into `Details.Services`.\n * e.g. `\"CODS\"` enables Cash-On-Delivery handling.\n */\nexport const AramexService = {\n COD: \"CODS\",\n INSURANCE: \"INSR\",\n} as const;\n\nexport type AramexProductGroupType =\n (typeof AramexProductGroup)[keyof typeof AramexProductGroup];\nexport type AramexProductTypeCode =\n (typeof AramexProductType)[keyof typeof AramexProductType];\nexport type AramexPaymentTypeCode =\n (typeof AramexPaymentType)[keyof typeof AramexPaymentType];\n\n/**\n * Aramex Tracking Status Codes (`UpdateCode`) → unified ShipmentStatus.\n *\n * IMPORTANT: Aramex does not publish a stable, comprehensive `UpdateCode` list,\n * and the codes vary by region/account. This table is a best-effort starter —\n * entries marked `VERIFY` should be confirmed against live tracking data. The\n * mapper falls back to a description-keyword heuristic and then `\"unknown\"`, so\n * an unmapped code never breaks tracking.\n */\nexport const AramexStatusCodes = {\n \"SH001\": \"created\", // Shipment information received (VERIFY)\n \"SH002\": \"picked_up\", // Picked up from shipper (VERIFY)\n \"SH004\": \"at_warehouse\", // Received at origin facility (VERIFY)\n \"SH005\": \"out_for_delivery\", // Out on delivery courier\n \"SH014\": \"delivered\", // Shipment delivered (VERIFY)\n \"SH060\": \"in_transit\", // Departed / in transit (VERIFY)\n \"SH074\": \"exception\", // Delivery attempt failed (VERIFY)\n \"SH159\": \"exception\", // Held / customs / address problem (VERIFY)\n \"SH212\": \"returned\", // Returned to shipper (VERIFY)\n \"SH235\": \"delivered\", // Delivered (VERIFY)\n} as const;\n",
|
|
6
|
+
"// file: src/carriers/aramex/mappers.ts\n/**\n * Aramex Data Mappers\n * Transform between unified ShipFlow types and the Aramex JSON API formats.\n */\n\nimport type {\n Address,\n City,\n CreateShipmentInput,\n Dimensions,\n Location,\n Pickup,\n PickupRequest,\n Rate,\n Shipment,\n ShipmentStatus,\n TrackingEvent,\n TrackingResult,\n} from \"../../core/types\";\nimport {\n AramexProductType,\n AramexService,\n AramexStatusCodes,\n} from \"./services\";\nimport type {\n AramexCalculateRateResponse,\n AramexClientInfo,\n AramexContact,\n AramexDimensions,\n AramexMoney,\n AramexOffice,\n AramexParty,\n AramexPartyAddress,\n AramexPickupObject,\n AramexProcessedPickup,\n AramexProcessedShipment,\n AramexShipment,\n AramexShipmentDetails,\n AramexTrackingResult,\n AramexTrackShipmentsResponse,\n AramexWeight,\n} from \"./types\";\n\n// ============================================================================\n// CREDENTIALS / CLIENT INFO\n// ============================================================================\n\nexport interface AramexCredentials {\n userName: string;\n password: string;\n accountNumber: string;\n accountPin: string;\n accountEntity: string;\n accountCountryCode: string;\n}\n\n/** Build the ClientInfo block injected into every Aramex request body. */\nexport function buildClientInfo(\n credentials: AramexCredentials,\n opts?: { source?: number; version?: string },\n): AramexClientInfo {\n return {\n UserName: credentials.userName,\n Password: credentials.password,\n Version: opts?.version ?? \"v1.0\",\n AccountNumber: credentials.accountNumber,\n AccountPin: credentials.accountPin,\n AccountEntity: credentials.accountEntity,\n AccountCountryCode: credentials.accountCountryCode,\n Source: opts?.source ?? 24,\n };\n}\n\n// ============================================================================\n// STATUS MAPPING\n// ============================================================================\n\nexport function mapAramexStatus(\n updateCode: string,\n): ShipmentStatus | undefined {\n const mapped = AramexStatusCodes[updateCode as keyof typeof AramexStatusCodes];\n return mapped as ShipmentStatus | undefined;\n}\n\n/**\n * Secondary heuristic: derive a status from the human-readable update text when\n * the `UpdateCode` isn't in our table (Aramex codes vary by region). Ordered so\n * the more specific phrases win (e.g. \"out for delivery\" before \"delivered\").\n */\nexport function statusFromDescription(\n description: string | undefined,\n): ShipmentStatus | undefined {\n if (!description) return undefined;\n const d = description.toLowerCase();\n if (/out for delivery|on delivery|with delivery courier/.test(d))\n return \"out_for_delivery\";\n // Failure phrases must be checked before the generic \"deliver\" match, so\n // \"delivery failed\" / \"undeliverable\" aren't mistaken for a delivery.\n if (/fail|unable|undeliver|exception|held|on hold|problem|refused|damaged/.test(d))\n return \"exception\";\n if (/deliver/.test(d)) return \"delivered\";\n if (/return/.test(d)) return \"returned\";\n if (/cancel/.test(d)) return \"cancelled\";\n if (/picked up|collected|pickup/.test(d)) return \"picked_up\";\n if (/transit|departed|forwarded|en route/.test(d)) return \"in_transit\";\n if (/received at|arrived|facility|warehouse|sorting|hub/.test(d))\n return \"at_warehouse\";\n if (/created|information received|booked/.test(d)) return \"created\";\n return undefined;\n}\n\n// ============================================================================\n// DATES (WCF /Date(ms)/ format)\n// ============================================================================\n\n/** Parse an Aramex WCF date (`/Date(1609459200000+0300)/`) or ISO string. */\nexport function parseAramexDate(value: string | null | undefined): Date {\n if (!value) return new Date(Number.NaN);\n const wcf = /\\/Date\\((-?\\d+)(?:[+-]\\d{4})?\\)\\//.exec(value);\n if (wcf?.[1]) return new Date(Number.parseInt(wcf[1], 10));\n return new Date(value);\n}\n\nfunction toWcfDate(date: Date): string {\n return `/Date(${date.getTime()})/`;\n}\n\n// ============================================================================\n// HELPERS\n// ============================================================================\n\nfunction round(value: number): number {\n return Math.round(value * 1000) / 1000;\n}\n\nconst VALID_PRODUCT_TYPES = new Set(\n Object.values(AramexProductType) as string[],\n);\n\nfunction getMeta(\n input: CreateShipmentInput,\n key: string,\n): string | undefined {\n const value = input.options?.metadata?.[key];\n return typeof value === \"string\" ? value : undefined;\n}\n\n/**\n * Resolve ProductGroup (DOM/EXP) and ProductType. Defaults to domestic when\n * shipper and consignee share a country, else express. Overridable via\n * `serviceType` (a valid Aramex product code) or `options.metadata`.\n */\nexport function resolveProductGroupAndType(input: CreateShipmentInput): {\n productGroup: \"EXP\" | \"DOM\";\n productType: string;\n} {\n const sameCountry =\n input.shipper.countryCode.trim().toUpperCase() ===\n input.consignee.countryCode.trim().toUpperCase();\n\n const metaGroup = getMeta(input, \"productGroup\")?.toUpperCase();\n const productGroup: \"EXP\" | \"DOM\" =\n metaGroup === \"EXP\" || metaGroup === \"DOM\"\n ? metaGroup\n : sameCountry\n ? \"DOM\"\n : \"EXP\";\n\n const candidate = getMeta(input, \"productType\") ?? input.serviceType;\n const productType =\n candidate && VALID_PRODUCT_TYPES.has(candidate)\n ? candidate\n : productGroup === \"DOM\"\n ? AramexProductType.DOMESTIC\n : AramexProductType.ECONOMY_PARCEL_EXPRESS;\n\n return { productGroup, productType };\n}\n\nfunction resolvePaymentType(input: CreateShipmentInput): \"P\" | \"C\" | \"3\" {\n const meta = getMeta(input, \"paymentType\");\n if (meta === \"P\" || meta === \"C\" || meta === \"3\") return meta;\n return input.cod?.enabled ? \"C\" : \"P\";\n}\n\n/** Aggregate parcel weights; preserve the unit when uniform, else normalize to kg. */\nfunction aggregateWeight(input: CreateShipmentInput): AramexWeight {\n const allLb = input.parcels.every((p) => p.weight.unit === \"lb\");\n if (allLb) {\n const value = input.parcels.reduce((s, p) => s + p.weight.value, 0);\n return { Value: round(value), Unit: \"Lb\" };\n }\n const value = input.parcels.reduce(\n (s, p) =>\n s + (p.weight.unit === \"lb\" ? p.weight.value * 0.453592 : p.weight.value),\n 0,\n );\n return { Value: round(value), Unit: \"Kg\" };\n}\n\nfunction mapDimensions(dims?: Dimensions): AramexDimensions | null {\n if (!dims) return null;\n const factor = dims.unit === \"in\" ? 2.54 : 1;\n return {\n Length: round(dims.length * factor),\n Width: round(dims.width * factor),\n Height: round(dims.height * factor),\n Unit: \"CM\",\n };\n}\n\nfunction mapAddress(addr: Address): AramexPartyAddress {\n // Aramex's WCF `Address` contract marks Line2, Line3 and PostCode as REQUIRED\n // members — omitting them fails deserialization (\"required data members\n // 'Line2, Line3, PostCode' were not found\"). Always send them (empty if unset).\n return {\n Line1: addr.line1,\n Line2: addr.line2 ?? \"\",\n Line3: addr.neighbourhood ?? \"\",\n City: addr.city,\n StateOrProvinceCode: addr.state,\n PostCode: addr.postalCode ?? \"\",\n CountryCode: addr.countryCode,\n // Coordinates are optional in the contract; omit when unset so Aramex\n // doesn't treat a 0,0 default as a real location.\n Longitude: addr.coordinates?.longitude,\n Latitude: addr.coordinates?.latitude,\n };\n}\n\n/**\n * Build an Aramex `Contact`. Aramex's WCF Contact contract marks its string\n * members as REQUIRED (the same pattern confirmed live for Address and\n * Transaction — an empty value fails deserialization, an empty string is\n * accepted), so every member is sent, defaulting to \"\".\n */\nfunction buildContact(opts: {\n personName: string;\n companyName: string;\n phone: string;\n email?: string;\n}): AramexContact {\n return {\n Department: \"\",\n PersonName: opts.personName,\n Title: \"\",\n CompanyName: opts.companyName,\n PhoneNumber1: opts.phone,\n PhoneNumber1Ext: \"\",\n PhoneNumber2: \"\",\n CellPhone: opts.phone,\n EmailAddress: opts.email ?? \"\",\n Type: \"\",\n };\n}\n\nfunction mapContact(addr: Address, fallbackCompany?: string): AramexContact {\n return buildContact({\n personName: addr.name,\n companyName: addr.company ?? fallbackCompany ?? addr.name,\n phone: addr.phone,\n email: addr.email,\n });\n}\n\nfunction mapParty(\n addr: Address,\n accountNumber?: string,\n fallbackCompany?: string,\n): AramexParty {\n return {\n AccountNumber: accountNumber,\n PartyAddress: mapAddress(addr),\n Contact: mapContact(addr, fallbackCompany),\n };\n}\n\n/** Shared between CreateShipments and CalculateRate. */\nfunction mapShipmentDetails(\n input: CreateShipmentInput,\n productGroup: \"EXP\" | \"DOM\",\n productType: string,\n paymentType: \"P\" | \"C\" | \"3\",\n): AramexShipmentDetails {\n const numberOfPieces =\n input.parcels.reduce((s, p) => s + p.pieces, 0) || 1;\n const description =\n input.parcels\n .map((p) => p.description)\n .filter(Boolean)\n .join(\", \") || \"Goods\";\n\n const services: string[] = [];\n let cashOnDelivery: AramexMoney | null = null;\n if (input.cod?.enabled) {\n // Use the caller-supplied COD currency — never hardcode.\n cashOnDelivery = {\n Value: input.cod.amount,\n CurrencyCode: input.cod.currency,\n };\n services.push(AramexService.COD);\n }\n\n const customsValue: AramexMoney | null = input.declaredValue\n ? {\n Value: input.declaredValue.amount,\n CurrencyCode: input.declaredValue.currency,\n }\n : null;\n\n // Insurance (INSR) must be accompanied by an amount to insure. Aramex rejects\n // the service with a null InsuranceAmount, so only request it when a declared\n // value is present to base the insured amount on.\n const insuranceAmount: AramexMoney | null =\n input.options?.isInsured && customsValue ? customsValue : null;\n if (insuranceAmount) services.push(AramexService.INSURANCE);\n\n return {\n Dimensions: mapDimensions(input.parcels[0]?.dimensions),\n ActualWeight: aggregateWeight(input),\n ChargeableWeight: null,\n DescriptionOfGoods: description,\n GoodsOriginCountry: input.shipper.countryCode,\n NumberOfPieces: numberOfPieces,\n ProductGroup: productGroup,\n ProductType: productType,\n PaymentType: paymentType,\n PaymentOptions: \"\",\n CustomsValueAmount: customsValue,\n CashOnDeliveryAmount: cashOnDelivery,\n InsuranceAmount: insuranceAmount,\n Services: services.join(\",\") || undefined,\n };\n}\n\n// ============================================================================\n// REQUEST MAPPERS\n// ============================================================================\n\nexport interface AramexShipmentContext {\n accountNumber: string;\n companyName?: string;\n}\n\nexport function mapCreateShipmentRequest(\n input: CreateShipmentInput,\n ctx: AramexShipmentContext,\n): AramexShipment {\n const { productGroup, productType } = resolveProductGroupAndType(input);\n const paymentType = resolvePaymentType(input);\n const now = new Date();\n const due = new Date(now.getTime() + 24 * 60 * 60 * 1000);\n\n return {\n Reference1: input.reference,\n Reference2: input.options?.customerTracking,\n Shipper: mapParty(input.shipper, ctx.accountNumber, ctx.companyName),\n Consignee: mapParty(input.consignee),\n ThirdParty: null,\n ShippingDateTime: toWcfDate(now),\n DueDate: toWcfDate(due),\n Comments: getMeta(input, \"comments\"),\n PickupLocation: getMeta(input, \"pickupLocation\"),\n Details: mapShipmentDetails(input, productGroup, productType, paymentType),\n Attachments: null,\n ForeignHAWB: null,\n TransportType: 0,\n Number: null,\n };\n}\n\nexport function mapCalculateRateRequest(\n input: CreateShipmentInput,\n preferredCurrency?: string,\n): {\n OriginAddress: AramexPartyAddress;\n DestinationAddress: AramexPartyAddress;\n ShipmentDetails: AramexShipmentDetails;\n PreferredCurrencyCode?: string;\n} {\n const { productGroup, productType } = resolveProductGroupAndType(input);\n const paymentType = resolvePaymentType(input);\n return {\n OriginAddress: mapAddress(input.shipper),\n DestinationAddress: mapAddress(input.consignee),\n ShipmentDetails: mapShipmentDetails(\n input,\n productGroup,\n productType,\n paymentType,\n ),\n PreferredCurrencyCode:\n preferredCurrency ??\n input.cod?.currency ??\n input.declaredValue?.currency,\n };\n}\n\nexport interface AramexPickupContext {\n accountNumber: string;\n countryCode: string;\n companyName?: string;\n}\n\nexport function mapPickupRequest(\n input: PickupRequest,\n ctx: AramexPickupContext,\n): AramexPickupObject {\n const pickupDate = new Date(`${input.date}T00:00:00`);\n const ready = new Date(`${input.date}T09:00:00`);\n const closing = new Date(`${input.date}T17:00:00`);\n\n return {\n Reference1: input.trackingNumbers?.[0],\n PickupAddress: {\n Line1: input.address,\n City: input.city,\n CountryCode: ctx.countryCode,\n },\n PickupContact: buildContact({\n personName: input.contactName,\n companyName: ctx.companyName ?? input.contactName,\n phone: input.contactPhone,\n }),\n PickupLocation: \"Reception\",\n PickupDate: toWcfDate(pickupDate),\n ReadyTime: toWcfDate(ready),\n LastPickupTime: toWcfDate(closing),\n ClosingTime: toWcfDate(closing),\n Comments: input.timeSlot,\n Status: \"Ready\",\n PickupItems: {\n PickupItemDetail: [\n {\n ProductGroup: \"DOM\",\n ProductType: AramexProductType.DOMESTIC,\n Payment: \"P\",\n NumberOfShipments: input.shipmentCount,\n NumberOfPieces: input.shipmentCount,\n ShipmentWeight: { Value: 1, Unit: \"Kg\" },\n },\n ],\n },\n };\n}\n\n// ============================================================================\n// RESPONSE MAPPERS\n// ============================================================================\n\nexport function mapShipmentResponse(\n processed: AramexProcessedShipment,\n input?: CreateShipmentInput,\n): Shipment {\n const trackingNumber = processed.ID || processed.ShipmentNumber || \"\";\n const labelUrl = processed.ShipmentLabel?.LabelURL || undefined;\n\n return {\n carrier: \"aramex\",\n trackingNumber,\n customerTracking: input?.options?.customerTracking,\n reference: input?.reference,\n // Aramex returns no status code on create — the shipment is freshly created.\n status: \"created\",\n statusLabel: \"Created\",\n labelUrl,\n pdfLabelUrl: labelUrl,\n codAmount: input?.cod?.enabled ? input.cod.amount : undefined,\n declaredValue: input?.declaredValue?.amount,\n currency:\n input?.cod?.currency ?? input?.declaredValue?.currency ?? \"SAR\",\n createdAt: new Date(),\n raw: processed,\n };\n}\n\nexport function mapTrackingEvent(\n result: AramexTrackingResult,\n): TrackingEvent {\n return {\n timestamp: parseAramexDate(result.UpdateDateTime),\n statusCode: result.UpdateCode,\n status:\n mapAramexStatus(result.UpdateCode) ??\n statusFromDescription(result.UpdateDescription) ??\n \"unknown\",\n description: result.UpdateDescription,\n location: result.UpdateLocation || undefined,\n };\n}\n\nexport function mapTrackingResult(\n waybill: string,\n results: AramexTrackingResult[],\n): TrackingResult {\n const events = results\n .map(mapTrackingEvent)\n .sort((a, b) => b.timestamp.getTime() - a.timestamp.getTime());\n\n const latest = events[0];\n const delivered = events.find((e) => e.status === \"delivered\");\n\n // Pull a weight from the most recent raw result that reports one.\n const weightStr = [...results]\n .reverse()\n .find((r) => r.GrossWeight)?.GrossWeight;\n const weight = weightStr ? Number.parseFloat(weightStr) : undefined;\n\n return {\n trackingNumber: waybill,\n carrier: \"aramex\",\n status: latest?.status ?? \"unknown\",\n statusLabel: latest?.description ?? \"Unknown\",\n events,\n deliveryDate: delivered?.timestamp,\n weight: weight != null && !Number.isNaN(weight) ? weight : undefined,\n raw: results,\n };\n}\n\n/**\n * Normalize the `TrackingResults` envelope into a plain map. The WCF JSON\n * serializer renders the dictionary as `[{ Key, Value }]`, but some gateways\n * return a plain object map instead — accept both.\n */\nexport function normalizeTrackingResults(\n raw: AramexTrackShipmentsResponse[\"TrackingResults\"],\n): Record<string, AramexTrackingResult[]> {\n if (!raw) return {};\n if (Array.isArray(raw)) {\n const map: Record<string, AramexTrackingResult[]> = {};\n for (const kv of raw) {\n if (kv && typeof kv === \"object\" && \"Key\" in kv) {\n map[kv.Key] = kv.Value ?? [];\n }\n }\n return map;\n }\n return raw;\n}\n\nexport function mapRate(\n response: AramexCalculateRateResponse,\n input: CreateShipmentInput,\n): Rate {\n const { productType } = resolveProductGroupAndType(input);\n return {\n carrier: \"aramex\",\n serviceType: productType,\n serviceName: productType,\n amount: response.TotalAmount?.Value ?? 0,\n currency:\n response.TotalAmount?.CurrencyCode ??\n input.cod?.currency ??\n input.declaredValue?.currency ??\n \"SAR\",\n raw: response,\n };\n}\n\nexport function mapPickupResponse(\n processed: AramexProcessedPickup,\n input: PickupRequest,\n): Pickup {\n return {\n id: processed.GUID || processed.ID,\n carrier: \"aramex\",\n status: \"pending\",\n date: input.date,\n timeSlot: input.timeSlot,\n city: input.city,\n contactName: input.contactName,\n contactPhone: input.contactPhone,\n address: input.address,\n shipmentCount: input.shipmentCount,\n createdAt: new Date(),\n raw: processed,\n };\n}\n\nexport function mapCity(name: string): City {\n return { nameEn: name };\n}\n\nexport function mapOffice(office: AramexOffice): Location {\n const addr = office.Address;\n const lines = [addr?.Line1, addr?.Line2, addr?.Line3].filter(Boolean);\n return {\n id: office.EntityCode,\n name: office.EntityName ?? office.EntityCode,\n address: lines.length ? lines.join(\", \") : undefined,\n city: addr?.City,\n latitude: addr?.Latitude,\n longitude: addr?.Longitude,\n };\n}\n",
|
|
7
|
+
"// file: src/carriers/aramex/adapter.ts\n/**\n * Aramex Carrier Adapter\n * Implementation of the CarrierAdapter interface for the Aramex JSON Shipping\n * Services API v2.\n *\n * Key differences from the other carriers:\n * - Auth is a `ClientInfo` object sent in EVERY request body (not headers).\n * - The four Aramex services (Shipping, Tracking, RateCalculator, Location)\n * live on different base URLs, so the adapter holds one HttpClient per service.\n * - Errors use the \"Fake 200 OK\" pattern (HTTP 200 + `HasErrors`/`Notifications`),\n * surfaced via the shared HttpClient's `errorExtractor` hook on every call.\n */\n\nimport {\n APIError,\n UnsupportedOperationError,\n ValidationError,\n} from \"../../core/errors\";\nimport { HttpClient } from \"../../core/http\";\nimport {\n validateCreateShipmentInput,\n validatePickupRequest,\n} from \"../../core/schemas\";\nimport type {\n CarrierConfig,\n City,\n CreateShipmentInput,\n Location,\n Pickup,\n PickupRequest,\n Rate,\n Shipment,\n TrackingResult,\n} from \"../../core/types\";\nimport { BaseCarrierAdapter } from \"../base\";\nimport {\n buildClientInfo,\n mapCalculateRateRequest,\n mapCity,\n mapCreateShipmentRequest,\n mapOffice,\n mapPickupRequest,\n mapPickupResponse,\n mapRate,\n mapShipmentResponse,\n mapTrackingResult,\n normalizeTrackingResults,\n} from \"./mappers\";\nimport type {\n AramexCalculateRateResponse,\n AramexClientInfo,\n AramexCreatePickupResponse,\n AramexCancelPickupResponse,\n AramexCreateShipmentsResponse,\n AramexFetchCitiesResponse,\n AramexFetchOfficesResponse,\n AramexLabelInfo,\n AramexNotification,\n AramexPrintLabelResponse,\n AramexTrackShipmentsResponse,\n} from \"./types\";\n\nconst SHIPPING_SANDBOX_URL =\n \"https://ws.dev.aramex.net/ShippingAPI.V2/Shipping/Service_1_0.svc\";\nconst SHIPPING_PRODUCTION_URL =\n \"https://ws.aramex.net/ShippingAPI.V2/Shipping/Service_1_0.svc\";\n\n/** Default Aramex label report (HTML/PDF label at 9.7x21cm), returned as a URL. */\nconst DEFAULT_LABEL_INFO: AramexLabelInfo = {\n ReportID: 9201,\n ReportType: \"URL\",\n};\n\n/**\n * Aramex's WCF `Transaction` data contract marks Reference1–Reference5 as\n * REQUIRED members, so an empty `{}` fails deserialization (\"required data\n * members 'Reference1..Reference5' were not found\") on every operation. All five\n * must be present; empty strings are accepted.\n */\nconst EMPTY_TRANSACTION = {\n Reference1: \"\",\n Reference2: \"\",\n Reference3: \"\",\n Reference4: \"\",\n Reference5: \"\",\n} as const;\n\nexport interface AramexConfig extends CarrierConfig {\n credentials: {\n userName: string;\n password: string;\n accountNumber: string;\n accountPin: string;\n accountEntity: string;\n accountCountryCode: string;\n };\n /** API source channel (default 24). */\n source?: number;\n /** ClientInfo version (default \"v1.0\"). */\n version?: string;\n /** Company name used when an address has no company set. */\n companyName?: string;\n /**\n * Optional override for the Location service base URL. Live Aramex WSDLs\n * disagree on the production Location host (ws.aramex.net vs anfe02.aramex.com);\n * set this if your account is provisioned on a different host.\n */\n locationBaseUrl?: string;\n}\n\nexport class AramexAdapter extends BaseCarrierAdapter {\n readonly name = \"aramex\";\n readonly supportedCountries = [\n \"SA\",\n \"AE\",\n \"BH\",\n \"KW\",\n \"OM\",\n \"QA\",\n \"JO\",\n \"EG\",\n \"LB\",\n \"IQ\",\n ];\n\n private shippingHttp: HttpClient;\n private trackingHttp: HttpClient;\n private rateHttp: HttpClient;\n private locationHttp: HttpClient;\n\n constructor(config: AramexConfig) {\n super(config);\n const shippingBase = this.getBaseUrl();\n const common = {\n carrier: \"aramex\",\n // Aramex auth lives in the request body (ClientInfo), so no auth headers.\n };\n this.shippingHttp = new HttpClient({ ...common, baseUrl: shippingBase });\n this.trackingHttp = new HttpClient({\n ...common,\n baseUrl: this.serviceBase(shippingBase, \"Tracking\"),\n });\n this.rateHttp = new HttpClient({\n ...common,\n baseUrl: this.serviceBase(shippingBase, \"RateCalculator\"),\n });\n this.locationHttp = new HttpClient({\n ...common,\n baseUrl:\n config.locationBaseUrl ?? this.serviceBase(shippingBase, \"Location\"),\n });\n }\n\n protected getBaseUrl(): string {\n return this.config.mode === \"production\"\n ? SHIPPING_PRODUCTION_URL\n : SHIPPING_SANDBOX_URL;\n }\n\n /** Derive a sibling service base URL by swapping the `/Shipping/` segment. */\n private serviceBase(shippingBase: string, service: string): string {\n return shippingBase.replace(\"/Shipping/\", `/${service}/`);\n }\n\n private get aramexConfig(): AramexConfig {\n return this.config as AramexConfig;\n }\n\n private buildClientInfo(): AramexClientInfo {\n const cfg = this.aramexConfig;\n return buildClientInfo(cfg.credentials, {\n source: cfg.source,\n version: cfg.version,\n });\n }\n\n /**\n * Extracts the Aramex \"Fake 200 OK\" error (envelope-level `HasErrors` +\n * `Notifications`). Passed to every request so the HttpClient raises APIError.\n */\n private static aramexErrorExtractor(json: unknown): {\n hasError: boolean;\n message?: string;\n errors?: Record<string, string[]>;\n } {\n const obj = json as {\n HasErrors?: boolean;\n Notifications?: AramexNotification[];\n } | null;\n const notifications = obj?.Notifications ?? [];\n const hasError = obj?.HasErrors === true;\n const message =\n notifications\n .map((n) => n?.Message)\n .filter(Boolean)\n .join(\"; \") || (hasError ? \"Aramex returned an error\" : undefined);\n return {\n hasError,\n message,\n errors: notifications.length\n ? AramexAdapter.notificationsToErrors(notifications)\n : undefined,\n };\n }\n\n private static notificationsToErrors(\n notifications: AramexNotification[],\n ): Record<string, string[]> {\n return {\n _aramex: notifications.map((n) =>\n `${n?.Code ?? \"\"}: ${n?.Message ?? \"\"}`.trim(),\n ),\n };\n }\n\n // =========================================================================\n // SHIPPING\n // =========================================================================\n\n protected async executeCreateShipment(\n input: CreateShipmentInput,\n ): Promise<Shipment> {\n const cfg = this.aramexConfig;\n const shipment = mapCreateShipmentRequest(input, {\n accountNumber: cfg.credentials.accountNumber,\n companyName: cfg.companyName,\n });\n\n const response = await this.shippingHttp.post<AramexCreateShipmentsResponse>(\n \"/json/CreateShipments\",\n {\n ClientInfo: this.buildClientInfo(),\n Transaction: EMPTY_TRANSACTION,\n LabelInfo: DEFAULT_LABEL_INFO,\n Shipments: [shipment],\n },\n { errorExtractor: AramexAdapter.aramexErrorExtractor },\n );\n\n const processed = response.Shipments?.[0];\n if (!processed) {\n throw new APIError(\"Aramex returned no shipment\", {\n carrier: \"aramex\",\n raw: response,\n });\n }\n\n // CreateShipments can also fail per-shipment while the envelope is clean.\n if (processed.HasErrors) {\n const notifications = processed.Notifications ?? [];\n throw new APIError(\n notifications\n .map((n) => n.Message)\n .filter(Boolean)\n .join(\"; \") || \"Failed to create shipment\",\n {\n carrier: \"aramex\",\n errors: AramexAdapter.notificationsToErrors(notifications),\n raw: processed,\n },\n );\n }\n\n return mapShipmentResponse(processed, input);\n }\n\n /**\n * Create multiple shipments in a single request. Aramex's `CreateShipments`\n * operation is natively batch — it takes a `Shipments` array and returns one\n * processed result per shipment, in request order.\n *\n * Fails loud: if ANY shipment in the batch errors, an `APIError` is thrown\n * whose `raw` holds the full response, so already-created AWBs remain\n * recoverable (the unified `Shipment` type has no per-item error channel).\n */\n async createBulkShipments(\n inputs: CreateShipmentInput[],\n ): Promise<Shipment[]> {\n if (inputs.length === 0) {\n throw new ValidationError(\n \"At least one shipment is required for bulk create\",\n { raw: { count: 0 } },\n );\n }\n for (const input of inputs) validateCreateShipmentInput(input);\n\n const cfg = this.aramexConfig;\n const shipments = inputs.map((input) =>\n mapCreateShipmentRequest(input, {\n accountNumber: cfg.credentials.accountNumber,\n companyName: cfg.companyName,\n }),\n );\n\n const response = await this.shippingHttp.post<AramexCreateShipmentsResponse>(\n \"/json/CreateShipments\",\n {\n ClientInfo: this.buildClientInfo(),\n Transaction: EMPTY_TRANSACTION,\n LabelInfo: DEFAULT_LABEL_INFO,\n Shipments: shipments,\n },\n { errorExtractor: AramexAdapter.aramexErrorExtractor },\n );\n\n const processed = response.Shipments ?? [];\n if (processed.length === 0) {\n throw new APIError(\"Aramex returned no shipments\", {\n carrier: \"aramex\",\n raw: response,\n });\n }\n\n const failed = processed.filter((p) => p.HasErrors);\n if (failed.length > 0) {\n const notifications = failed.flatMap((p) => p.Notifications ?? []);\n throw new APIError(\n notifications\n .map((n) => n.Message)\n .filter(Boolean)\n .join(\"; \") ||\n `Failed to create ${failed.length} of ${processed.length} shipments`,\n {\n carrier: \"aramex\",\n errors: AramexAdapter.notificationsToErrors(notifications),\n raw: response,\n },\n );\n }\n\n return processed.map((p, i) => mapShipmentResponse(p, inputs[i]));\n }\n\n /**\n * Aramex's classic Shipping Services API has no shipment-cancellation\n * endpoint, so this is unsupported. (Pickups can be cancelled via cancelPickup.)\n */\n cancelShipment(_trackingNumber: string): Promise<boolean> {\n throw new UnsupportedOperationError(\"aramex\", \"cancelShipment\");\n }\n\n // =========================================================================\n // LABELS\n // =========================================================================\n\n async getLabel(\n trackingNumber: string,\n _format?: \"PDF\" | \"ZPL\" | \"PNG\",\n ): Promise<string> {\n // Aramex PrintLabel returns a URL to the label document. The requested\n // `format` cannot be honored (ZPL/PNG are not selectable) — always a URL.\n const response = await this.shippingHttp.post<AramexPrintLabelResponse>(\n \"/json/PrintLabel\",\n {\n ClientInfo: this.buildClientInfo(),\n Transaction: EMPTY_TRANSACTION,\n ShipmentNumber: trackingNumber,\n LabelInfo: DEFAULT_LABEL_INFO,\n },\n { errorExtractor: AramexAdapter.aramexErrorExtractor },\n );\n\n const url = response.ShipmentLabel?.LabelURL;\n if (!url) {\n throw new APIError(\"Failed to get label\", {\n carrier: \"aramex\",\n raw: response,\n });\n }\n return url;\n }\n\n // =========================================================================\n // TRACKING\n // =========================================================================\n\n async track(trackingNumber: string): Promise<TrackingResult> {\n const results = await this.trackMultiple([trackingNumber]);\n const result = results[0];\n if (!result) {\n throw new APIError(\"Shipment not found\", {\n carrier: \"aramex\",\n raw: { trackingNumber },\n });\n }\n return result;\n }\n\n async trackMultiple(trackingNumbers: string[]): Promise<TrackingResult[]> {\n const response = await this.trackingHttp.post<AramexTrackShipmentsResponse>(\n \"/json/TrackShipments\",\n {\n ClientInfo: this.buildClientInfo(),\n Transaction: EMPTY_TRANSACTION,\n Shipments: trackingNumbers,\n GetLastTrackingUpdateOnly: false,\n },\n { retry: true, errorExtractor: AramexAdapter.aramexErrorExtractor },\n );\n\n const map = normalizeTrackingResults(response.TrackingResults);\n return Object.entries(map).map(([waybill, results]) =>\n mapTrackingResult(waybill, results),\n );\n }\n\n async trackByReference(reference: string): Promise<TrackingResult> {\n // Aramex tracks references through the same TrackShipments operation.\n const result = await this.track(reference);\n return { ...result, reference };\n }\n\n // =========================================================================\n // RATES\n // =========================================================================\n\n async getRates(input: CreateShipmentInput): Promise<Rate[]> {\n const rateRequest = mapCalculateRateRequest(input);\n const response = await this.rateHttp.post<AramexCalculateRateResponse>(\n \"/json/CalculateRate\",\n {\n ClientInfo: this.buildClientInfo(),\n Transaction: EMPTY_TRANSACTION,\n ...rateRequest,\n },\n { retry: true, errorExtractor: AramexAdapter.aramexErrorExtractor },\n );\n\n // A clean envelope with no TotalAmount means Aramex couldn't price the\n // route. Surface it as an error rather than returning a misleading 0 rate.\n if (response.TotalAmount?.Value == null) {\n throw new APIError(\"Aramex returned no rate for this shipment\", {\n carrier: \"aramex\",\n raw: response,\n });\n }\n\n return [mapRate(response, input)];\n }\n\n // =========================================================================\n // PICKUPS\n // =========================================================================\n\n async createPickup(input: PickupRequest): Promise<Pickup> {\n validatePickupRequest(input);\n const cfg = this.aramexConfig;\n const pickup = mapPickupRequest(input, {\n accountNumber: cfg.credentials.accountNumber,\n countryCode: cfg.credentials.accountCountryCode,\n companyName: cfg.companyName,\n });\n\n const response = await this.shippingHttp.post<AramexCreatePickupResponse>(\n \"/json/CreatePickup\",\n {\n ClientInfo: this.buildClientInfo(),\n Transaction: EMPTY_TRANSACTION,\n Pickup: pickup,\n },\n { errorExtractor: AramexAdapter.aramexErrorExtractor },\n );\n\n // Judge success on the body payload, not the HTTP status: a \"Fake 200 OK\"\n // can carry an empty ProcessedPickup. A usable pickup needs a GUID (or ID).\n const processed = response.ProcessedPickup;\n if (!processed || (!processed.GUID && !processed.ID)) {\n throw new APIError(\"Failed to create pickup\", {\n carrier: \"aramex\",\n raw: response,\n });\n }\n\n return mapPickupResponse(processed, input);\n }\n\n async cancelPickup(pickupId: string | number): Promise<boolean> {\n const response = await this.shippingHttp.post<AramexCancelPickupResponse>(\n \"/json/CancelPickup\",\n {\n ClientInfo: this.buildClientInfo(),\n Transaction: EMPTY_TRANSACTION,\n PickupGUID: String(pickupId),\n },\n { errorExtractor: AramexAdapter.aramexErrorExtractor },\n );\n // The errorExtractor already throws on `HasErrors: true`, so reaching here\n // means the body reported no error — judge success from that, treating a\n // missing flag as success (consistent with the extractor's `=== true`).\n return response.HasErrors !== true;\n }\n\n // =========================================================================\n // CITIES & LOCATIONS\n // =========================================================================\n\n async getCities(countryCode?: string): Promise<City[]> {\n const response = await this.locationHttp.post<AramexFetchCitiesResponse>(\n \"/json/FetchCities\",\n {\n ClientInfo: this.buildClientInfo(),\n Transaction: EMPTY_TRANSACTION,\n CountryCode:\n countryCode ?? this.aramexConfig.credentials.accountCountryCode,\n },\n { retry: true, errorExtractor: AramexAdapter.aramexErrorExtractor },\n );\n\n return (response.Cities ?? []).map(mapCity);\n }\n\n async getDropoffLocations(countryCode?: string): Promise<Location[]> {\n const response = await this.locationHttp.post<AramexFetchOfficesResponse>(\n \"/json/FetchOffices\",\n {\n ClientInfo: this.buildClientInfo(),\n Transaction: EMPTY_TRANSACTION,\n CountryCode:\n countryCode ?? this.aramexConfig.credentials.accountCountryCode,\n },\n { retry: true, errorExtractor: AramexAdapter.aramexErrorExtractor },\n );\n\n return (response.Offices ?? []).map(mapOffice);\n }\n}\n"
|
|
8
|
+
],
|
|
9
|
+
"mappings": ";;;;;;;;;;;AAUO,IAAM,qBAAqB;AAAA,EAChC,SAAS;AAAA,EACT,UAAU;AACZ;AAGO,IAAM,oBAAoB;AAAA,EAE/B,UAAU;AAAA,EAEV,2BAA2B;AAAA,EAE3B,yBAAyB;AAAA,EAEzB,yBAAyB;AAAA,EAEzB,2BAA2B;AAAA,EAE3B,yBAAyB;AAAA,EAEzB,yBAAyB;AAAA,EAEzB,uBAAuB;AAAA,EAEvB,wBAAwB;AAAA,EAExB,QAAQ;AACV;AAGO,IAAM,oBAAoB;AAAA,EAC/B,SAAS;AAAA,EACT,SAAS;AAAA,EACT,aAAa;AACf;AAMO,IAAM,gBAAgB;AAAA,EAC3B,KAAK;AAAA,EACL,WAAW;AACb;AAkBO,IAAM,oBAAoB;AAAA,EAC/B,OAAS;AAAA,EACT,OAAS;AAAA,EACT,OAAS;AAAA,EACT,OAAS;AAAA,EACT,OAAS;AAAA,EACT,OAAS;AAAA,EACT,OAAS;AAAA,EACT,OAAS;AAAA,EACT,OAAS;AAAA,EACT,OAAS;AACX;;;ACxBO,SAAS,eAAe,CAC7B,aACA,MACkB;AAAA,EAClB,OAAO;AAAA,IACL,UAAU,YAAY;AAAA,IACtB,UAAU,YAAY;AAAA,IACtB,SAAS,MAAM,WAAW;AAAA,IAC1B,eAAe,YAAY;AAAA,IAC3B,YAAY,YAAY;AAAA,IACxB,eAAe,YAAY;AAAA,IAC3B,oBAAoB,YAAY;AAAA,IAChC,QAAQ,MAAM,UAAU;AAAA,EAC1B;AAAA;AAOK,SAAS,eAAe,CAC7B,YAC4B;AAAA,EAC5B,MAAM,SAAS,kBAAkB;AAAA,EACjC,OAAO;AAAA;AAQF,SAAS,qBAA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AAAA,MACP,CAAC;AAAA,IACH;AAAA,IAEA,OAAO,kBAAkB,WAAW,KAAK;AAAA;AAAA,OAGrC,aAAY,CAAC,UAA6C;AAAA,IAC9D,MAAM,WAAW,MAAM,KAAK,aAAa,KACvC,sBACA;AAAA,MACE,YAAY,KAAK,gBAAgB;AAAA,MACjC,aAAa;AAAA,MACb,YAAY,OAAO,QAAQ;AAAA,IAC7B,GACA,EAAE,gBAAgB,cAAc,qBAAqB,CACvD;AAAA,IAIA,OAAO,SAAS,cAAc;AAAA;AAAA,OAO1B,UAAS,CAAC,aAAuC;AAAA,IACrD,MAAM,WAAW,MAAM,KAAK,aAAa,KACvC,qBACA;AAAA,MACE,YAAY,KAAK,gBAAgB;AAAA,MACjC,aAAa;AAAA,MACb,aACE,eAAe,KAAK,aAAa,YAAY;AAAA,IACjD,GACA,EAAE,OAAO,MAAM,gBAAgB,cAAc,qBAAqB,CACpE;AAAA,IAEA,QAAQ,SAAS,UAAU,CAAC,GAAG,IAAI,OAAO;AAAA;AAAA,OAGtC,oBAAmB,CAAC,aAA2C;AAAA,IACnE,MAAM,WAAW,MAAM,KAAK,aAAa,KACvC,sBACA;AAAA,MACE,YAAY,KAAK,gBAAgB;AAAA,MACjC,aAAa;AAAA,MACb,aACE,eAAe,KAAK,aAAa,YAAY;AAAA,IACjD,GACA,EAAE,OAAO,MAAM,gBAAgB,cAAc,qBAAqB,CACpE;AAAA,IAEA,QAAQ,SAAS,WAAW,CAAC,GAAG,IAAI,SAAS;AAAA;AAEjD;",
|
|
10
|
+
"debugId": "F2518B67CA4397C364756E2164756E21",
|
|
11
|
+
"names": []
|
|
12
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aramex Data Mappers
|
|
3
|
+
* Transform between unified ShipFlow types and the Aramex JSON API formats.
|
|
4
|
+
*/
|
|
5
|
+
import type { City, CreateShipmentInput, Location, Pickup, PickupRequest, Rate, Shipment, ShipmentStatus, TrackingEvent, TrackingResult } from "../../core/types.js";
|
|
6
|
+
import type { AramexCalculateRateResponse, AramexClientInfo, AramexOffice, AramexPartyAddress, AramexPickupObject, AramexProcessedPickup, AramexProcessedShipment, AramexShipment, AramexShipmentDetails, AramexTrackingResult, AramexTrackShipmentsResponse } from "./types.js";
|
|
7
|
+
export interface AramexCredentials {
|
|
8
|
+
userName: string;
|
|
9
|
+
password: string;
|
|
10
|
+
accountNumber: string;
|
|
11
|
+
accountPin: string;
|
|
12
|
+
accountEntity: string;
|
|
13
|
+
accountCountryCode: string;
|
|
14
|
+
}
|
|
15
|
+
/** Build the ClientInfo block injected into every Aramex request body. */
|
|
16
|
+
export declare function buildClientInfo(credentials: AramexCredentials, opts?: {
|
|
17
|
+
source?: number;
|
|
18
|
+
version?: string;
|
|
19
|
+
}): AramexClientInfo;
|
|
20
|
+
export declare function mapAramexStatus(updateCode: string): ShipmentStatus | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Secondary heuristic: derive a status from the human-readable update text when
|
|
23
|
+
* the `UpdateCode` isn't in our table (Aramex codes vary by region). Ordered so
|
|
24
|
+
* the more specific phrases win (e.g. "out for delivery" before "delivered").
|
|
25
|
+
*/
|
|
26
|
+
export declare function statusFromDescription(description: string | undefined): ShipmentStatus | undefined;
|
|
27
|
+
/** Parse an Aramex WCF date (`/Date(1609459200000+0300)/`) or ISO string. */
|
|
28
|
+
export declare function parseAramexDate(value: string | null | undefined): Date;
|
|
29
|
+
/**
|
|
30
|
+
* Resolve ProductGroup (DOM/EXP) and ProductType. Defaults to domestic when
|
|
31
|
+
* shipper and consignee share a country, else express. Overridable via
|
|
32
|
+
* `serviceType` (a valid Aramex product code) or `options.metadata`.
|
|
33
|
+
*/
|
|
34
|
+
export declare function resolveProductGroupAndType(input: CreateShipmentInput): {
|
|
35
|
+
productGroup: "EXP" | "DOM";
|
|
36
|
+
productType: string;
|
|
37
|
+
};
|
|
38
|
+
export interface AramexShipmentContext {
|
|
39
|
+
accountNumber: string;
|
|
40
|
+
companyName?: string;
|
|
41
|
+
}
|
|
42
|
+
export declare function mapCreateShipmentRequest(input: CreateShipmentInput, ctx: AramexShipmentContext): AramexShipment;
|
|
43
|
+
export declare function mapCalculateRateRequest(input: CreateShipmentInput, preferredCurrency?: string): {
|
|
44
|
+
OriginAddress: AramexPartyAddress;
|
|
45
|
+
DestinationAddress: AramexPartyAddress;
|
|
46
|
+
ShipmentDetails: AramexShipmentDetails;
|
|
47
|
+
PreferredCurrencyCode?: string;
|
|
48
|
+
};
|
|
49
|
+
export interface AramexPickupContext {
|
|
50
|
+
accountNumber: string;
|
|
51
|
+
countryCode: string;
|
|
52
|
+
companyName?: string;
|
|
53
|
+
}
|
|
54
|
+
export declare function mapPickupRequest(input: PickupRequest, ctx: AramexPickupContext): AramexPickupObject;
|
|
55
|
+
export declare function mapShipmentResponse(processed: AramexProcessedShipment, input?: CreateShipmentInput): Shipment;
|
|
56
|
+
export declare function mapTrackingEvent(result: AramexTrackingResult): TrackingEvent;
|
|
57
|
+
export declare function mapTrackingResult(waybill: string, results: AramexTrackingResult[]): TrackingResult;
|
|
58
|
+
/**
|
|
59
|
+
* Normalize the `TrackingResults` envelope into a plain map. The WCF JSON
|
|
60
|
+
* serializer renders the dictionary as `[{ Key, Value }]`, but some gateways
|
|
61
|
+
* return a plain object map instead — accept both.
|
|
62
|
+
*/
|
|
63
|
+
export declare function normalizeTrackingResults(raw: AramexTrackShipmentsResponse["TrackingResults"]): Record<string, AramexTrackingResult[]>;
|
|
64
|
+
export declare function mapRate(response: AramexCalculateRateResponse, input: CreateShipmentInput): Rate;
|
|
65
|
+
export declare function mapPickupResponse(processed: AramexProcessedPickup, input: PickupRequest): Pickup;
|
|
66
|
+
export declare function mapCity(name: string): City;
|
|
67
|
+
export declare function mapOffice(office: AramexOffice): Location;
|
|
68
|
+
//# sourceMappingURL=mappers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../../../src/carriers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AqB,EAChC,KAAK,EAAE,aAAa,GACnB,MAAM,CAeR;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE1C;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,QAAQ,CAWxD"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aramex Service / Product Codes
|
|
3
|
+
* Use these constants for type-safe product and payment selection.
|
|
4
|
+
*
|
|
5
|
+
* Reference: Aramex Shipping Services API manual, Appendix A (Product Types)
|
|
6
|
+
* and Appendix B (Payment Types).
|
|
7
|
+
*/
|
|
8
|
+
/** Shipment product group: domestic vs international/express. */
|
|
9
|
+
export declare const AramexProductGroup: {
|
|
10
|
+
readonly EXPRESS: "EXP";
|
|
11
|
+
readonly DOMESTIC: "DOM";
|
|
12
|
+
};
|
|
13
|
+
/** Product type codes (Appendix A). `OND` is the only domestic type. */
|
|
14
|
+
export declare const AramexProductType: {
|
|
15
|
+
/** Domestic (DOM group) */
|
|
16
|
+
readonly DOMESTIC: "OND";
|
|
17
|
+
/** Priority Document Express */
|
|
18
|
+
readonly PRIORITY_DOCUMENT_EXPRESS: "PDX";
|
|
19
|
+
/** Priority Parcel Express */
|
|
20
|
+
readonly PRIORITY_PARCEL_EXPRESS: "PPX";
|
|
21
|
+
/** Priority Letter Express */
|
|
22
|
+
readonly PRIORITY_LETTER_EXPRESS: "PLX";
|
|
23
|
+
/** Deferred Document Express */
|
|
24
|
+
readonly DEFERRED_DOCUMENT_EXPRESS: "DDX";
|
|
25
|
+
/** Deferred Parcel Express */
|
|
26
|
+
readonly DEFERRED_PARCEL_EXPRESS: "DPX";
|
|
27
|
+
/** Ground Document Express */
|
|
28
|
+
readonly GROUND_DOCUMENT_EXPRESS: "GDX";
|
|
29
|
+
/** Ground Parcel Express */
|
|
30
|
+
readonly GROUND_PARCEL_EXPRESS: "GPX";
|
|
31
|
+
/** Economy Parcel Express */
|
|
32
|
+
readonly ECONOMY_PARCEL_EXPRESS: "EPX";
|
|
33
|
+
/** Return */
|
|
34
|
+
readonly RETURN: "RTN";
|
|
35
|
+
};
|
|
36
|
+
/** Payment type codes (Appendix B). */
|
|
37
|
+
export declare const AramexPaymentType: {
|
|
38
|
+
readonly PREPAID: "P";
|
|
39
|
+
readonly COLLECT: "C";
|
|
40
|
+
readonly THIRD_PARTY: "3";
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Special service codes joined (comma-separated) into `Details.Services`.
|
|
44
|
+
* e.g. `"CODS"` enables Cash-On-Delivery handling.
|
|
45
|
+
*/
|
|
46
|
+
export declare const AramexService: {
|
|
47
|
+
readonly COD: "CODS";
|
|
48
|
+
readonly INSURANCE: "INSR";
|
|
49
|
+
};
|
|
50
|
+
export type AramexProductGroupType = (typeof AramexProductGroup)[keyof typeof AramexProductGroup];
|
|
51
|
+
export type AramexProductTypeCode = (typeof AramexProductType)[keyof typeof AramexProductType];
|
|
52
|
+
export type AramexPaymentTypeCode = (typeof AramexPaymentType)[keyof typeof AramexPaymentType];
|
|
53
|
+
/**
|
|
54
|
+
* Aramex Tracking Status Codes (`UpdateCode`) → unified ShipmentStatus.
|
|
55
|
+
*
|
|
56
|
+
* IMPORTANT: Aramex does not publish a stable, comprehensive `UpdateCode` list,
|
|
57
|
+
* and the codes vary by region/account. This table is a best-effort starter —
|
|
58
|
+
* entries marked `VERIFY` should be confirmed against live tracking data. The
|
|
59
|
+
* mapper falls back to a description-keyword heuristic and then `"unknown"`, so
|
|
60
|
+
* an unmapped code never breaks tracking.
|
|
61
|
+
*/
|
|
62
|
+
export declare const AramexStatusCodes: {
|
|
63
|
+
readonly SH001: "created";
|
|
64
|
+
readonly SH002: "picked_up";
|
|
65
|
+
readonly SH004: "at_warehouse";
|
|
66
|
+
readonly SH005: "out_for_delivery";
|
|
67
|
+
readonly SH014: "delivered";
|
|
68
|
+
readonly SH060: "in_transit";
|
|
69
|
+
readonly SH074: "exception";
|
|
70
|
+
readonly SH159: "exception";
|
|
71
|
+
readonly SH212: "returned";
|
|
72
|
+
readonly SH235: "delivered";
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=services.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../src/carriers/aramex/services.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAEH,iEAAiE;AACjE,eAAO,MAAM,kBAAkB;;;CAGrB,CAAC;AAEX,wEAAwE;AACxE,eAAO,MAAM,iBAAiB;IAC5B,2BAA2B;;IAE3B,gCAAgC;;IAEhC,8BAA8B;;IAE9B,8BAA8B;;IAE9B,gCAAgC;;IAEhC,8BAA8B;;IAE9B,8BAA8B;;IAE9B,4BAA4B;;IAE5B,6BAA6B;;IAE7B,aAAa;;CAEL,CAAC;AAEX,uCAAuC;AACvC,eAAO,MAAM,iBAAiB;;;;CAIpB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,aAAa;;;CAGhB,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAChC,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAC/D,MAAM,MAAM,qBAAqB,GAC/B,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAC7D,MAAM,MAAM,qBAAqB,GAC/B,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAE7D;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;CAWpB,CAAC"}
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aramex Raw API Types
|
|
3
|
+
* These directly mirror the Aramex JSON Shipping Services API v2 request/response
|
|
4
|
+
* formats (PascalCase wire names). Auth is carried by `ClientInfo` in every
|
|
5
|
+
* request body. Errors use the "Fake 200 OK" pattern: HTTP 200 with
|
|
6
|
+
* `HasErrors: true` and a `Notifications` array (both at the envelope level and,
|
|
7
|
+
* for CreateShipments, per-shipment inside `Shipments[]`).
|
|
8
|
+
*/
|
|
9
|
+
export interface AramexClientInfo {
|
|
10
|
+
UserName: string;
|
|
11
|
+
Password: string;
|
|
12
|
+
Version: string;
|
|
13
|
+
AccountNumber: string;
|
|
14
|
+
AccountPin: string;
|
|
15
|
+
AccountEntity: string;
|
|
16
|
+
AccountCountryCode: string;
|
|
17
|
+
Source: number;
|
|
18
|
+
}
|
|
19
|
+
/** Echoed back in every response; all fields optional. */
|
|
20
|
+
export interface AramexTransaction {
|
|
21
|
+
Reference1?: string;
|
|
22
|
+
Reference2?: string;
|
|
23
|
+
Reference3?: string;
|
|
24
|
+
Reference4?: string;
|
|
25
|
+
Reference5?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface AramexMoney {
|
|
28
|
+
Value: number;
|
|
29
|
+
CurrencyCode: string;
|
|
30
|
+
}
|
|
31
|
+
export interface AramexWeight {
|
|
32
|
+
Value: number;
|
|
33
|
+
Unit: "Kg" | "Lb";
|
|
34
|
+
}
|
|
35
|
+
export interface AramexDimensions {
|
|
36
|
+
Length: number;
|
|
37
|
+
Width: number;
|
|
38
|
+
Height: number;
|
|
39
|
+
Unit: "CM" | "M";
|
|
40
|
+
}
|
|
41
|
+
export interface AramexNotification {
|
|
42
|
+
Code: string;
|
|
43
|
+
Message: string;
|
|
44
|
+
}
|
|
45
|
+
export interface AramexPartyAddress {
|
|
46
|
+
Line1: string;
|
|
47
|
+
Line2?: string;
|
|
48
|
+
Line3?: string;
|
|
49
|
+
City: string;
|
|
50
|
+
StateOrProvinceCode?: string;
|
|
51
|
+
PostCode?: string;
|
|
52
|
+
CountryCode: string;
|
|
53
|
+
Longitude?: number;
|
|
54
|
+
Latitude?: number;
|
|
55
|
+
}
|
|
56
|
+
export interface AramexContact {
|
|
57
|
+
PersonName: string;
|
|
58
|
+
CompanyName?: string;
|
|
59
|
+
Title?: string;
|
|
60
|
+
PhoneNumber1: string;
|
|
61
|
+
PhoneNumber1Ext?: string;
|
|
62
|
+
PhoneNumber2?: string;
|
|
63
|
+
CellPhone: string;
|
|
64
|
+
EmailAddress?: string;
|
|
65
|
+
Type?: string;
|
|
66
|
+
Department?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface AramexParty {
|
|
69
|
+
Reference1?: string;
|
|
70
|
+
Reference2?: string;
|
|
71
|
+
AccountNumber?: string;
|
|
72
|
+
PartyAddress: AramexPartyAddress;
|
|
73
|
+
Contact: AramexContact;
|
|
74
|
+
}
|
|
75
|
+
export interface AramexLabelInfo {
|
|
76
|
+
ReportID: number;
|
|
77
|
+
ReportType: "URL" | "RPT";
|
|
78
|
+
}
|
|
79
|
+
export interface AramexShipmentDetails {
|
|
80
|
+
Dimensions?: AramexDimensions | null;
|
|
81
|
+
ActualWeight: AramexWeight;
|
|
82
|
+
ChargeableWeight?: AramexWeight | null;
|
|
83
|
+
DescriptionOfGoods: string;
|
|
84
|
+
GoodsOriginCountry: string;
|
|
85
|
+
NumberOfPieces: number;
|
|
86
|
+
ProductGroup: "EXP" | "DOM";
|
|
87
|
+
ProductType: string;
|
|
88
|
+
PaymentType: "P" | "C" | "3";
|
|
89
|
+
PaymentOptions?: string;
|
|
90
|
+
CustomsValueAmount?: AramexMoney | null;
|
|
91
|
+
CashOnDeliveryAmount?: AramexMoney | null;
|
|
92
|
+
InsuranceAmount?: AramexMoney | null;
|
|
93
|
+
CashAdditionalAmount?: AramexMoney | null;
|
|
94
|
+
CashAdditionalAmountDescription?: string;
|
|
95
|
+
CollectAmount?: AramexMoney | null;
|
|
96
|
+
Services?: string;
|
|
97
|
+
}
|
|
98
|
+
export interface AramexShipment {
|
|
99
|
+
Reference1?: string;
|
|
100
|
+
Reference2?: string;
|
|
101
|
+
Reference3?: string;
|
|
102
|
+
Shipper: AramexParty;
|
|
103
|
+
Consignee: AramexParty;
|
|
104
|
+
ThirdParty?: AramexParty | null;
|
|
105
|
+
ShippingDateTime: string;
|
|
106
|
+
DueDate: string;
|
|
107
|
+
Comments?: string;
|
|
108
|
+
PickupLocation?: string;
|
|
109
|
+
PickupGUID?: string;
|
|
110
|
+
Details: AramexShipmentDetails;
|
|
111
|
+
Attachments?: unknown[] | null;
|
|
112
|
+
ForeignHAWB?: string | null;
|
|
113
|
+
TransportType?: number;
|
|
114
|
+
Number?: string | null;
|
|
115
|
+
}
|
|
116
|
+
export interface AramexCreateShipmentsRequest {
|
|
117
|
+
ClientInfo: AramexClientInfo;
|
|
118
|
+
Transaction?: AramexTransaction;
|
|
119
|
+
LabelInfo?: AramexLabelInfo | null;
|
|
120
|
+
Shipments: AramexShipment[];
|
|
121
|
+
}
|
|
122
|
+
export interface AramexShipmentLabel {
|
|
123
|
+
LabelURL?: string;
|
|
124
|
+
LabelFileContents?: string | null;
|
|
125
|
+
}
|
|
126
|
+
export interface AramexProcessedShipment {
|
|
127
|
+
ID: string;
|
|
128
|
+
ShipmentNumber?: string;
|
|
129
|
+
ForeignHAWB?: string | null;
|
|
130
|
+
HasErrors: boolean;
|
|
131
|
+
Notifications: AramexNotification[];
|
|
132
|
+
ShipmentLabel?: AramexShipmentLabel | null;
|
|
133
|
+
ShipmentDetails?: unknown;
|
|
134
|
+
}
|
|
135
|
+
export interface AramexCreateShipmentsResponse {
|
|
136
|
+
Transaction?: AramexTransaction;
|
|
137
|
+
Notifications: AramexNotification[];
|
|
138
|
+
HasErrors: boolean;
|
|
139
|
+
Shipments: AramexProcessedShipment[];
|
|
140
|
+
}
|
|
141
|
+
export interface AramexPrintLabelRequest {
|
|
142
|
+
ClientInfo: AramexClientInfo;
|
|
143
|
+
Transaction?: AramexTransaction;
|
|
144
|
+
ShipmentNumber: string;
|
|
145
|
+
ProductGroup?: string;
|
|
146
|
+
OriginEntity?: string;
|
|
147
|
+
LabelInfo: AramexLabelInfo;
|
|
148
|
+
}
|
|
149
|
+
export interface AramexPrintLabelResponse {
|
|
150
|
+
Transaction?: AramexTransaction;
|
|
151
|
+
Notifications: AramexNotification[];
|
|
152
|
+
HasErrors: boolean;
|
|
153
|
+
ShipmentNumber: string;
|
|
154
|
+
ShipmentLabel: AramexShipmentLabel;
|
|
155
|
+
}
|
|
156
|
+
export interface AramexTrackShipmentsRequest {
|
|
157
|
+
ClientInfo: AramexClientInfo;
|
|
158
|
+
Transaction?: AramexTransaction;
|
|
159
|
+
Shipments: string[];
|
|
160
|
+
GetLastTrackingUpdateOnly?: boolean;
|
|
161
|
+
}
|
|
162
|
+
export interface AramexTrackingResult {
|
|
163
|
+
WaybillNumber: string;
|
|
164
|
+
UpdateCode: string;
|
|
165
|
+
UpdateDescription: string;
|
|
166
|
+
UpdateDateTime: string;
|
|
167
|
+
UpdateLocation: string;
|
|
168
|
+
Comments?: string;
|
|
169
|
+
ProblemCode?: string;
|
|
170
|
+
GrossWeight?: string;
|
|
171
|
+
ChargeableWeight?: string;
|
|
172
|
+
WeightUnit?: string;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* The WCF JSON serializer renders `Dictionary<string, TrackingResult[]>` as an
|
|
176
|
+
* array of `{ Key, Value }` pairs. Some gateways/proxies hand back a plain
|
|
177
|
+
* object map instead, so both shapes are accepted and normalized by the mapper.
|
|
178
|
+
*/
|
|
179
|
+
export interface AramexTrackingKeyValue {
|
|
180
|
+
Key: string;
|
|
181
|
+
Value: AramexTrackingResult[];
|
|
182
|
+
}
|
|
183
|
+
export interface AramexTrackShipmentsResponse {
|
|
184
|
+
Transaction?: AramexTransaction;
|
|
185
|
+
Notifications: AramexNotification[];
|
|
186
|
+
HasErrors: boolean;
|
|
187
|
+
TrackingResults: AramexTrackingKeyValue[] | Record<string, AramexTrackingResult[]> | null;
|
|
188
|
+
NonExistingWaybills: string[];
|
|
189
|
+
}
|
|
190
|
+
export interface AramexCalculateRateRequest {
|
|
191
|
+
ClientInfo: AramexClientInfo;
|
|
192
|
+
Transaction?: AramexTransaction;
|
|
193
|
+
OriginAddress: AramexPartyAddress;
|
|
194
|
+
DestinationAddress: AramexPartyAddress;
|
|
195
|
+
ShipmentDetails: AramexShipmentDetails;
|
|
196
|
+
PreferredCurrencyCode?: string;
|
|
197
|
+
}
|
|
198
|
+
export interface AramexRateDetails {
|
|
199
|
+
Amount?: number;
|
|
200
|
+
OtherAmount1?: number;
|
|
201
|
+
OtherAmount2?: number;
|
|
202
|
+
OtherAmount3?: number;
|
|
203
|
+
OtherAmount4?: number;
|
|
204
|
+
OtherAmount5?: number;
|
|
205
|
+
TotalAmountBeforeTax?: number;
|
|
206
|
+
TaxAmount?: number;
|
|
207
|
+
}
|
|
208
|
+
export interface AramexCalculateRateResponse {
|
|
209
|
+
Transaction?: AramexTransaction;
|
|
210
|
+
Notifications: AramexNotification[];
|
|
211
|
+
HasErrors: boolean;
|
|
212
|
+
TotalAmount: AramexMoney;
|
|
213
|
+
RateDetails?: AramexRateDetails;
|
|
214
|
+
}
|
|
215
|
+
export interface AramexPickupItemDetail {
|
|
216
|
+
ProductGroup: string;
|
|
217
|
+
ProductType: string;
|
|
218
|
+
Payment: string;
|
|
219
|
+
NumberOfShipments: number;
|
|
220
|
+
NumberOfPieces: number;
|
|
221
|
+
ShipmentWeight: AramexWeight;
|
|
222
|
+
ShipmentVolume?: AramexWeight | null;
|
|
223
|
+
CashAmount?: AramexMoney | null;
|
|
224
|
+
ExtraCharges?: AramexMoney | null;
|
|
225
|
+
Comments?: string;
|
|
226
|
+
}
|
|
227
|
+
export interface AramexPickupObject {
|
|
228
|
+
Reference1?: string;
|
|
229
|
+
Reference2?: string;
|
|
230
|
+
PickupAddress: AramexPartyAddress;
|
|
231
|
+
PickupContact: AramexContact;
|
|
232
|
+
PickupLocation: string;
|
|
233
|
+
PickupDate: string;
|
|
234
|
+
ReadyTime: string;
|
|
235
|
+
LastPickupTime: string;
|
|
236
|
+
ClosingTime: string;
|
|
237
|
+
Comments?: string;
|
|
238
|
+
Status: "Ready" | "Pending";
|
|
239
|
+
PickupItems: {
|
|
240
|
+
PickupItemDetail: AramexPickupItemDetail[];
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
export interface AramexCreatePickupRequest {
|
|
244
|
+
ClientInfo: AramexClientInfo;
|
|
245
|
+
Transaction?: AramexTransaction;
|
|
246
|
+
Pickup: AramexPickupObject;
|
|
247
|
+
LabelInfo?: AramexLabelInfo | null;
|
|
248
|
+
}
|
|
249
|
+
export interface AramexProcessedPickup {
|
|
250
|
+
ID: string;
|
|
251
|
+
GUID: string;
|
|
252
|
+
Reference1?: string;
|
|
253
|
+
ProcessedShipments?: AramexProcessedShipment[];
|
|
254
|
+
}
|
|
255
|
+
export interface AramexCreatePickupResponse {
|
|
256
|
+
Transaction?: AramexTransaction;
|
|
257
|
+
Notifications: AramexNotification[];
|
|
258
|
+
HasErrors: boolean;
|
|
259
|
+
ProcessedPickup: AramexProcessedPickup;
|
|
260
|
+
}
|
|
261
|
+
export interface AramexCancelPickupRequest {
|
|
262
|
+
ClientInfo: AramexClientInfo;
|
|
263
|
+
Transaction?: AramexTransaction;
|
|
264
|
+
PickupGUID: string;
|
|
265
|
+
Comments?: string;
|
|
266
|
+
}
|
|
267
|
+
export interface AramexCancelPickupResponse {
|
|
268
|
+
Transaction?: AramexTransaction;
|
|
269
|
+
Notifications: AramexNotification[];
|
|
270
|
+
HasErrors: boolean;
|
|
271
|
+
}
|
|
272
|
+
export interface AramexFetchCitiesRequest {
|
|
273
|
+
ClientInfo: AramexClientInfo;
|
|
274
|
+
Transaction?: AramexTransaction;
|
|
275
|
+
CountryCode: string;
|
|
276
|
+
State?: string;
|
|
277
|
+
NameStartsWith?: string;
|
|
278
|
+
}
|
|
279
|
+
export interface AramexFetchCitiesResponse {
|
|
280
|
+
Transaction?: AramexTransaction;
|
|
281
|
+
Notifications: AramexNotification[];
|
|
282
|
+
HasErrors: boolean;
|
|
283
|
+
/** Plain English city-name strings (no Arabic name, no code). */
|
|
284
|
+
Cities: string[];
|
|
285
|
+
}
|
|
286
|
+
export interface AramexOffice {
|
|
287
|
+
EntityCode: string;
|
|
288
|
+
EntityName?: string;
|
|
289
|
+
Address: AramexPartyAddress;
|
|
290
|
+
}
|
|
291
|
+
export interface AramexFetchOfficesRequest {
|
|
292
|
+
ClientInfo: AramexClientInfo;
|
|
293
|
+
Transaction?: AramexTransaction;
|
|
294
|
+
CountryCode: string;
|
|
295
|
+
}
|
|
296
|
+
export interface AramexFetchOfficesResponse {
|
|
297
|
+
Transaction?: AramexTransaction;
|
|
298
|
+
Notifications: AramexNotification[];
|
|
299
|
+
HasErrors: boolean;
|
|
300
|
+
Offices: AramexOffice[];
|
|
301
|
+
}
|
|
302
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/carriers/aramex/types.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAMH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,0DAA0D;AAC1D,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;CACnB;AAED,MAAM,W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AAiB,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,yBAAyB;IACxC,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,aAAa,EAAE,kBAAkB,EAAE,CAAC;IACpC,SAAS,EAAE,OAAO,CAAC;IACnB,iEAAiE;IACjE,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,0BAA0B;IACzC,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,aAAa,EAAE,kBAAkB,EAAE,CAAC;IACpC,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB"}
|
|
@@ -58,7 +58,7 @@ export declare class AymakanAdapter extends BaseCarrierAdapter {
|
|
|
58
58
|
track(trackingNumber: string): Promise<TrackingResult>;
|
|
59
59
|
trackMultiple(trackingNumbers: string[]): Promise<TrackingResult[]>;
|
|
60
60
|
trackByReference(reference: string): Promise<TrackingResult>;
|
|
61
|
-
getLabel(trackingNumber: string,
|
|
61
|
+
getLabel(trackingNumber: string, _format?: "PDF" | "ZPL" | "PNG"): Promise<string>;
|
|
62
62
|
getBulkLabels(trackingNumbers: string[]): Promise<string>;
|
|
63
63
|
getPickupCities(): Promise<City[]>;
|
|
64
64
|
getTimeSlots(_city: string, date: string): Promise<TimeSlot[]>;
|
|
@@ -69,9 +69,10 @@ export declare class AymakanAdapter extends BaseCarrierAdapter {
|
|
|
69
69
|
getDropoffLocations(): Promise<{
|
|
70
70
|
id: string;
|
|
71
71
|
name: string;
|
|
72
|
-
nameAr?: string;
|
|
73
72
|
address?: string;
|
|
74
73
|
city?: string;
|
|
74
|
+
latitude?: number;
|
|
75
|
+
longitude?: number;
|
|
75
76
|
}[]>;
|
|
76
77
|
createCustomerAddress(address: CustomerAddress): Promise<CustomerAddress>;
|
|
77
78
|
getCustomerAddresses(): Promise<CustomerAddress[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/carriers/aymakan/adapter.ts"],"names":[],"mappings":"AACA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/carriers/aymakan/adapter.ts"],"names":[],"mappings":"AACA;;;GAGG;AAYH,OAAO,KAAK,EACV,OAAO,EACP,aAAa,EACb,IAAI,EACJ,mBAAmB,EACnB,eAAe,EACf,MAAM,EACN,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,aAAa,EACb,YAAY,EACb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAuB7C,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,WAAW,EAAE;QACX,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED,qBAAa,cAAe,SAAQ,kBAAkB;IACpD,QAAQ,CAAC,IAAI,aAAa;IAC1B,QAAQ,CAAC,kBAAkB,WAAwC;IAEnE,OAAO,CAAC,IAAI,CAAa;IAEzB,0DAA0D;IAC1D,OAAO,CAAC,WAAW,CAAuB;IAC1C,OAAO,CAAC,eAAe,CAAK;IAC5B,wBAAwB;IACxB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAkB;gBAE9C,MAAM,EAAE,aAAa;IAWjC,SAAS,CAAC,UAAU,IAAI,MAAM;IAU9B;;;OAGG;YACW,kBAAkB;IAehC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