#
tokens: 44514/50000 7/825 files (page 28/43)
lines: off (toggle) GitHub
raw markdown copy
This is page 28 of 43. Use http://codebase.md/taurgis/sfcc-dev-mcp?page={x} to view the full context.

# Directory Structure

```
├── .DS_Store
├── .github
│   ├── dependabot.yml
│   ├── instructions
│   │   ├── mcp-node-tests.instructions.md
│   │   └── mcp-yml-tests.instructions.md
│   ├── ISSUE_TEMPLATE
│   │   ├── bug_report.yml
│   │   ├── config.yml
│   │   ├── documentation.yml
│   │   ├── feature_request.yml
│   │   └── question.yml
│   ├── PULL_REQUEST_TEMPLATE
│   │   ├── bug_fix.md
│   │   ├── documentation.md
│   │   └── new_tool.md
│   ├── pull_request_template.md
│   └── workflows
│       ├── ci.yml
│       ├── deploy-pages.yml
│       ├── publish.yml
│       └── update-docs.yml
├── .gitignore
├── .husky
│   └── pre-commit
├── aegis.config.docs-only.json
├── aegis.config.json
├── aegis.config.with-dw.json
├── AGENTS.md
├── ai-instructions
│   ├── claude-desktop
│   │   └── claude_custom_instructions.md
│   ├── cursor
│   │   └── .cursor
│   │       └── rules
│   │           ├── debugging-workflows.mdc
│   │           ├── hooks-development.mdc
│   │           ├── isml-templates.mdc
│   │           ├── job-framework.mdc
│   │           ├── performance-optimization.mdc
│   │           ├── scapi-endpoints.mdc
│   │           ├── security-patterns.mdc
│   │           ├── sfcc-development.mdc
│   │           ├── sfra-controllers.mdc
│   │           ├── sfra-models.mdc
│   │           ├── system-objects.mdc
│   │           └── testing-patterns.mdc
│   └── github-copilot
│       └── copilot-instructions.md
├── CHANGELOG.md
├── CONTRIBUTING.md
├── docs
│   ├── best-practices
│   │   ├── cartridge_creation.md
│   │   ├── isml_templates.md
│   │   ├── job_framework.md
│   │   ├── localserviceregistry.md
│   │   ├── ocapi_hooks.md
│   │   ├── performance.md
│   │   ├── scapi_custom_endpoint.md
│   │   ├── scapi_hooks.md
│   │   ├── security.md
│   │   ├── sfra_client_side_js.md
│   │   ├── sfra_controllers.md
│   │   ├── sfra_models.md
│   │   └── sfra_scss.md
│   ├── dw_campaign
│   │   ├── ABTest.md
│   │   ├── ABTestMgr.md
│   │   ├── ABTestSegment.md
│   │   ├── AmountDiscount.md
│   │   ├── ApproachingDiscount.md
│   │   ├── BonusChoiceDiscount.md
│   │   ├── BonusDiscount.md
│   │   ├── Campaign.md
│   │   ├── CampaignMgr.md
│   │   ├── CampaignStatusCodes.md
│   │   ├── Coupon.md
│   │   ├── CouponMgr.md
│   │   ├── CouponRedemption.md
│   │   ├── CouponStatusCodes.md
│   │   ├── Discount.md
│   │   ├── DiscountPlan.md
│   │   ├── FixedPriceDiscount.md
│   │   ├── FixedPriceShippingDiscount.md
│   │   ├── FreeDiscount.md
│   │   ├── FreeShippingDiscount.md
│   │   ├── PercentageDiscount.md
│   │   ├── PercentageOptionDiscount.md
│   │   ├── PriceBookPriceDiscount.md
│   │   ├── Promotion.md
│   │   ├── PromotionMgr.md
│   │   ├── PromotionPlan.md
│   │   ├── SlotContent.md
│   │   ├── SourceCodeGroup.md
│   │   ├── SourceCodeInfo.md
│   │   ├── SourceCodeStatusCodes.md
│   │   └── TotalFixedPriceDiscount.md
│   ├── dw_catalog
│   │   ├── Catalog.md
│   │   ├── CatalogMgr.md
│   │   ├── Category.md
│   │   ├── CategoryAssignment.md
│   │   ├── CategoryLink.md
│   │   ├── PriceBook.md
│   │   ├── PriceBookMgr.md
│   │   ├── Product.md
│   │   ├── ProductActiveData.md
│   │   ├── ProductAttributeModel.md
│   │   ├── ProductAvailabilityLevels.md
│   │   ├── ProductAvailabilityModel.md
│   │   ├── ProductInventoryList.md
│   │   ├── ProductInventoryMgr.md
│   │   ├── ProductInventoryRecord.md
│   │   ├── ProductLink.md
│   │   ├── ProductMgr.md
│   │   ├── ProductOption.md
│   │   ├── ProductOptionModel.md
│   │   ├── ProductOptionValue.md
│   │   ├── ProductPriceInfo.md
│   │   ├── ProductPriceModel.md
│   │   ├── ProductPriceTable.md
│   │   ├── ProductSearchHit.md
│   │   ├── ProductSearchModel.md
│   │   ├── ProductSearchRefinementDefinition.md
│   │   ├── ProductSearchRefinements.md
│   │   ├── ProductSearchRefinementValue.md
│   │   ├── ProductVariationAttribute.md
│   │   ├── ProductVariationAttributeValue.md
│   │   ├── ProductVariationModel.md
│   │   ├── Recommendation.md
│   │   ├── SearchModel.md
│   │   ├── SearchRefinementDefinition.md
│   │   ├── SearchRefinements.md
│   │   ├── SearchRefinementValue.md
│   │   ├── SortingOption.md
│   │   ├── SortingRule.md
│   │   ├── Store.md
│   │   ├── StoreGroup.md
│   │   ├── StoreInventoryFilter.md
│   │   ├── StoreInventoryFilterValue.md
│   │   ├── StoreMgr.md
│   │   ├── Variant.md
│   │   └── VariationGroup.md
│   ├── dw_content
│   │   ├── Content.md
│   │   ├── ContentMgr.md
│   │   ├── ContentSearchModel.md
│   │   ├── ContentSearchRefinementDefinition.md
│   │   ├── ContentSearchRefinements.md
│   │   ├── ContentSearchRefinementValue.md
│   │   ├── Folder.md
│   │   ├── Library.md
│   │   ├── MarkupText.md
│   │   └── MediaFile.md
│   ├── dw_crypto
│   │   ├── CertificateRef.md
│   │   ├── CertificateUtils.md
│   │   ├── Cipher.md
│   │   ├── Encoding.md
│   │   ├── JWE.md
│   │   ├── JWEHeader.md
│   │   ├── JWS.md
│   │   ├── JWSHeader.md
│   │   ├── KeyRef.md
│   │   ├── Mac.md
│   │   ├── MessageDigest.md
│   │   ├── SecureRandom.md
│   │   ├── Signature.md
│   │   ├── WeakCipher.md
│   │   ├── WeakMac.md
│   │   ├── WeakMessageDigest.md
│   │   ├── WeakSignature.md
│   │   └── X509Certificate.md
│   ├── dw_customer
│   │   ├── AddressBook.md
│   │   ├── AgentUserMgr.md
│   │   ├── AgentUserStatusCodes.md
│   │   ├── AuthenticationStatus.md
│   │   ├── Credentials.md
│   │   ├── Customer.md
│   │   ├── CustomerActiveData.md
│   │   ├── CustomerAddress.md
│   │   ├── CustomerCDPData.md
│   │   ├── CustomerContextMgr.md
│   │   ├── CustomerGroup.md
│   │   ├── CustomerList.md
│   │   ├── CustomerMgr.md
│   │   ├── CustomerPasswordConstraints.md
│   │   ├── CustomerPaymentInstrument.md
│   │   ├── CustomerStatusCodes.md
│   │   ├── EncryptedObject.md
│   │   ├── ExternalProfile.md
│   │   ├── OrderHistory.md
│   │   ├── ProductList.md
│   │   ├── ProductListItem.md
│   │   ├── ProductListItemPurchase.md
│   │   ├── ProductListMgr.md
│   │   ├── ProductListRegistrant.md
│   │   ├── Profile.md
│   │   └── Wallet.md
│   ├── dw_extensions.applepay
│   │   ├── ApplePayHookResult.md
│   │   └── ApplePayHooks.md
│   ├── dw_extensions.facebook
│   │   ├── FacebookFeedHooks.md
│   │   └── FacebookProduct.md
│   ├── dw_extensions.paymentrequest
│   │   ├── PaymentRequestHookResult.md
│   │   └── PaymentRequestHooks.md
│   ├── dw_extensions.payments
│   │   ├── SalesforceBancontactPaymentDetails.md
│   │   ├── SalesforceCardPaymentDetails.md
│   │   ├── SalesforceEpsPaymentDetails.md
│   │   ├── SalesforceIdealPaymentDetails.md
│   │   ├── SalesforceKlarnaPaymentDetails.md
│   │   ├── SalesforcePaymentDetails.md
│   │   ├── SalesforcePaymentIntent.md
│   │   ├── SalesforcePaymentMethod.md
│   │   ├── SalesforcePaymentRequest.md
│   │   ├── SalesforcePaymentsHooks.md
│   │   ├── SalesforcePaymentsMgr.md
│   │   ├── SalesforcePaymentsSiteConfiguration.md
│   │   ├── SalesforcePayPalOrder.md
│   │   ├── SalesforcePayPalOrderAddress.md
│   │   ├── SalesforcePayPalOrderPayer.md
│   │   ├── SalesforcePayPalPaymentDetails.md
│   │   ├── SalesforceSepaDebitPaymentDetails.md
│   │   └── SalesforceVenmoPaymentDetails.md
│   ├── dw_extensions.pinterest
│   │   ├── PinterestAvailability.md
│   │   ├── PinterestFeedHooks.md
│   │   ├── PinterestOrder.md
│   │   ├── PinterestOrderHooks.md
│   │   └── PinterestProduct.md
│   ├── dw_io
│   │   ├── CSVStreamReader.md
│   │   ├── CSVStreamWriter.md
│   │   ├── File.md
│   │   ├── FileReader.md
│   │   ├── FileWriter.md
│   │   ├── InputStream.md
│   │   ├── OutputStream.md
│   │   ├── PrintWriter.md
│   │   ├── RandomAccessFileReader.md
│   │   ├── Reader.md
│   │   ├── StringWriter.md
│   │   ├── Writer.md
│   │   ├── XMLIndentingStreamWriter.md
│   │   ├── XMLStreamConstants.md
│   │   ├── XMLStreamReader.md
│   │   └── XMLStreamWriter.md
│   ├── dw_job
│   │   ├── JobExecution.md
│   │   └── JobStepExecution.md
│   ├── dw_net
│   │   ├── FTPClient.md
│   │   ├── FTPFileInfo.md
│   │   ├── HTTPClient.md
│   │   ├── HTTPRequestPart.md
│   │   ├── Mail.md
│   │   ├── SFTPClient.md
│   │   ├── SFTPFileInfo.md
│   │   ├── WebDAVClient.md
│   │   └── WebDAVFileInfo.md
│   ├── dw_object
│   │   ├── ActiveData.md
│   │   ├── CustomAttributes.md
│   │   ├── CustomObject.md
│   │   ├── CustomObjectMgr.md
│   │   ├── Extensible.md
│   │   ├── ExtensibleObject.md
│   │   ├── Note.md
│   │   ├── ObjectAttributeDefinition.md
│   │   ├── ObjectAttributeGroup.md
│   │   ├── ObjectAttributeValueDefinition.md
│   │   ├── ObjectTypeDefinition.md
│   │   ├── PersistentObject.md
│   │   ├── SimpleExtensible.md
│   │   └── SystemObjectMgr.md
│   ├── dw_order
│   │   ├── AbstractItem.md
│   │   ├── AbstractItemCtnr.md
│   │   ├── Appeasement.md
│   │   ├── AppeasementItem.md
│   │   ├── Basket.md
│   │   ├── BasketMgr.md
│   │   ├── BonusDiscountLineItem.md
│   │   ├── CouponLineItem.md
│   │   ├── CreateAgentBasketLimitExceededException.md
│   │   ├── CreateBasketFromOrderException.md
│   │   ├── CreateCouponLineItemException.md
│   │   ├── CreateOrderException.md
│   │   ├── CreateTemporaryBasketLimitExceededException.md
│   │   ├── GiftCertificate.md
│   │   ├── GiftCertificateLineItem.md
│   │   ├── GiftCertificateMgr.md
│   │   ├── GiftCertificateStatusCodes.md
│   │   ├── Invoice.md
│   │   ├── InvoiceItem.md
│   │   ├── LineItem.md
│   │   ├── LineItemCtnr.md
│   │   ├── Order.md
│   │   ├── OrderAddress.md
│   │   ├── OrderItem.md
│   │   ├── OrderMgr.md
│   │   ├── OrderPaymentInstrument.md
│   │   ├── OrderProcessStatusCodes.md
│   │   ├── PaymentCard.md
│   │   ├── PaymentInstrument.md
│   │   ├── PaymentMethod.md
│   │   ├── PaymentMgr.md
│   │   ├── PaymentProcessor.md
│   │   ├── PaymentStatusCodes.md
│   │   ├── PaymentTransaction.md
│   │   ├── PriceAdjustment.md
│   │   ├── PriceAdjustmentLimitTypes.md
│   │   ├── ProductLineItem.md
│   │   ├── ProductShippingCost.md
│   │   ├── ProductShippingLineItem.md
│   │   ├── ProductShippingModel.md
│   │   ├── Return.md
│   │   ├── ReturnCase.md
│   │   ├── ReturnCaseItem.md
│   │   ├── ReturnItem.md
│   │   ├── Shipment.md
│   │   ├── ShipmentShippingCost.md
│   │   ├── ShipmentShippingModel.md
│   │   ├── ShippingLineItem.md
│   │   ├── ShippingLocation.md
│   │   ├── ShippingMethod.md
│   │   ├── ShippingMgr.md
│   │   ├── ShippingOrder.md
│   │   ├── ShippingOrderItem.md
│   │   ├── SumItem.md
│   │   ├── TaxGroup.md
│   │   ├── TaxItem.md
│   │   ├── TaxMgr.md
│   │   ├── TrackingInfo.md
│   │   └── TrackingRef.md
│   ├── dw_order.hooks
│   │   ├── CalculateHooks.md
│   │   ├── OrderHooks.md
│   │   ├── PaymentHooks.md
│   │   ├── ReturnHooks.md
│   │   └── ShippingOrderHooks.md
│   ├── dw_rpc
│   │   ├── SOAPUtil.md
│   │   ├── Stub.md
│   │   └── WebReference.md
│   ├── dw_suggest
│   │   ├── BrandSuggestions.md
│   │   ├── CategorySuggestions.md
│   │   ├── ContentSuggestions.md
│   │   ├── CustomSuggestions.md
│   │   ├── ProductSuggestions.md
│   │   ├── SearchPhraseSuggestions.md
│   │   ├── SuggestedCategory.md
│   │   ├── SuggestedContent.md
│   │   ├── SuggestedPhrase.md
│   │   ├── SuggestedProduct.md
│   │   ├── SuggestedTerm.md
│   │   ├── SuggestedTerms.md
│   │   ├── Suggestions.md
│   │   └── SuggestModel.md
│   ├── dw_svc
│   │   ├── FTPService.md
│   │   ├── FTPServiceDefinition.md
│   │   ├── HTTPFormService.md
│   │   ├── HTTPFormServiceDefinition.md
│   │   ├── HTTPService.md
│   │   ├── HTTPServiceDefinition.md
│   │   ├── LocalServiceRegistry.md
│   │   ├── Result.md
│   │   ├── Service.md
│   │   ├── ServiceCallback.md
│   │   ├── ServiceConfig.md
│   │   ├── ServiceCredential.md
│   │   ├── ServiceDefinition.md
│   │   ├── ServiceProfile.md
│   │   ├── ServiceRegistry.md
│   │   ├── SOAPService.md
│   │   └── SOAPServiceDefinition.md
│   ├── dw_system
│   │   ├── AgentUserStatusCodes.md
│   │   ├── Cache.md
│   │   ├── CacheMgr.md
│   │   ├── HookMgr.md
│   │   ├── InternalObject.md
│   │   ├── JobProcessMonitor.md
│   │   ├── Log.md
│   │   ├── Logger.md
│   │   ├── LogNDC.md
│   │   ├── OrganizationPreferences.md
│   │   ├── Pipeline.md
│   │   ├── PipelineDictionary.md
│   │   ├── RemoteInclude.md
│   │   ├── Request.md
│   │   ├── RequestHooks.md
│   │   ├── Response.md
│   │   ├── RESTErrorResponse.md
│   │   ├── RESTResponseMgr.md
│   │   ├── RESTSuccessResponse.md
│   │   ├── SearchStatus.md
│   │   ├── Session.md
│   │   ├── Site.md
│   │   ├── SitePreferences.md
│   │   ├── Status.md
│   │   ├── StatusItem.md
│   │   ├── System.md
│   │   └── Transaction.md
│   ├── dw_util
│   │   ├── ArrayList.md
│   │   ├── Assert.md
│   │   ├── BigInteger.md
│   │   ├── Bytes.md
│   │   ├── Calendar.md
│   │   ├── Collection.md
│   │   ├── Currency.md
│   │   ├── DateUtils.md
│   │   ├── Decimal.md
│   │   ├── FilteringCollection.md
│   │   ├── Geolocation.md
│   │   ├── HashMap.md
│   │   ├── HashSet.md
│   │   ├── Iterator.md
│   │   ├── LinkedHashMap.md
│   │   ├── LinkedHashSet.md
│   │   ├── List.md
│   │   ├── Locale.md
│   │   ├── Map.md
│   │   ├── MapEntry.md
│   │   ├── MappingKey.md
│   │   ├── MappingMgr.md
│   │   ├── PropertyComparator.md
│   │   ├── SecureEncoder.md
│   │   ├── SecureFilter.md
│   │   ├── SeekableIterator.md
│   │   ├── Set.md
│   │   ├── SortedMap.md
│   │   ├── SortedSet.md
│   │   ├── StringUtils.md
│   │   ├── Template.md
│   │   └── UUIDUtils.md
│   ├── dw_value
│   │   ├── EnumValue.md
│   │   ├── MimeEncodedText.md
│   │   ├── Money.md
│   │   └── Quantity.md
│   ├── dw_web
│   │   ├── ClickStream.md
│   │   ├── ClickStreamEntry.md
│   │   ├── Cookie.md
│   │   ├── Cookies.md
│   │   ├── CSRFProtection.md
│   │   ├── Form.md
│   │   ├── FormAction.md
│   │   ├── FormElement.md
│   │   ├── FormElementValidationResult.md
│   │   ├── FormField.md
│   │   ├── FormFieldOption.md
│   │   ├── FormFieldOptions.md
│   │   ├── FormGroup.md
│   │   ├── FormList.md
│   │   ├── FormListItem.md
│   │   ├── Forms.md
│   │   ├── HttpParameter.md
│   │   ├── HttpParameterMap.md
│   │   ├── LoopIterator.md
│   │   ├── PageMetaData.md
│   │   ├── PageMetaTag.md
│   │   ├── PagingModel.md
│   │   ├── Resource.md
│   │   ├── URL.md
│   │   ├── URLAction.md
│   │   ├── URLParameter.md
│   │   ├── URLRedirect.md
│   │   ├── URLRedirectMgr.md
│   │   └── URLUtils.md
│   ├── sfra
│   │   ├── account.md
│   │   ├── address.md
│   │   ├── billing.md
│   │   ├── cart.md
│   │   ├── categories.md
│   │   ├── content.md
│   │   ├── locale.md
│   │   ├── order.md
│   │   ├── payment.md
│   │   ├── price-default.md
│   │   ├── price-range.md
│   │   ├── price-tiered.md
│   │   ├── product-bundle.md
│   │   ├── product-full.md
│   │   ├── product-line-items.md
│   │   ├── product-search.md
│   │   ├── product-tile.md
│   │   ├── querystring.md
│   │   ├── render.md
│   │   ├── request.md
│   │   ├── response.md
│   │   ├── server.md
│   │   ├── shipping.md
│   │   ├── store.md
│   │   ├── stores.md
│   │   └── totals.md
│   └── TopLevel
│       ├── APIException.md
│       ├── arguments.md
│       ├── Array.md
│       ├── ArrayBuffer.md
│       ├── BigInt.md
│       ├── Boolean.md
│       ├── ConversionError.md
│       ├── DataView.md
│       ├── Date.md
│       ├── Error.md
│       ├── ES6Iterator.md
│       ├── EvalError.md
│       ├── Fault.md
│       ├── Float32Array.md
│       ├── Float64Array.md
│       ├── Function.md
│       ├── Generator.md
│       ├── global.md
│       ├── Int16Array.md
│       ├── Int32Array.md
│       ├── Int8Array.md
│       ├── InternalError.md
│       ├── IOError.md
│       ├── Iterable.md
│       ├── Iterator.md
│       ├── JSON.md
│       ├── Map.md
│       ├── Math.md
│       ├── Module.md
│       ├── Namespace.md
│       ├── Number.md
│       ├── Object.md
│       ├── QName.md
│       ├── RangeError.md
│       ├── ReferenceError.md
│       ├── RegExp.md
│       ├── Set.md
│       ├── StopIteration.md
│       ├── String.md
│       ├── Symbol.md
│       ├── SyntaxError.md
│       ├── SystemError.md
│       ├── TypeError.md
│       ├── Uint16Array.md
│       ├── Uint32Array.md
│       ├── Uint8Array.md
│       ├── Uint8ClampedArray.md
│       ├── URIError.md
│       ├── WeakMap.md
│       ├── WeakSet.md
│       ├── XML.md
│       ├── XMLList.md
│       └── XMLStreamError.md
├── docs-site
│   ├── .gitignore
│   ├── App.tsx
│   ├── components
│   │   ├── Badge.tsx
│   │   ├── BreadcrumbSchema.tsx
│   │   ├── CodeBlock.tsx
│   │   ├── Collapsible.tsx
│   │   ├── ConfigBuilder.tsx
│   │   ├── ConfigHero.tsx
│   │   ├── ConfigModeTabs.tsx
│   │   ├── icons.tsx
│   │   ├── Layout.tsx
│   │   ├── LightCodeContainer.tsx
│   │   ├── NewcomerCTA.tsx
│   │   ├── NextStepsStrip.tsx
│   │   ├── OnThisPage.tsx
│   │   ├── Search.tsx
│   │   ├── SEO.tsx
│   │   ├── Sidebar.tsx
│   │   ├── StructuredData.tsx
│   │   ├── ToolCard.tsx
│   │   ├── ToolFilters.tsx
│   │   ├── Typography.tsx
│   │   └── VersionBadge.tsx
│   ├── constants.tsx
│   ├── index.html
│   ├── main.tsx
│   ├── metadata.json
│   ├── package-lock.json
│   ├── package.json
│   ├── pages
│   │   ├── AIInterfacesPage.tsx
│   │   ├── ConfigurationPage.tsx
│   │   ├── DevelopmentPage.tsx
│   │   ├── ExamplesPage.tsx
│   │   ├── FeaturesPage.tsx
│   │   ├── HomePage.tsx
│   │   ├── SecurityPage.tsx
│   │   ├── ToolsPage.tsx
│   │   └── TroubleshootingPage.tsx
│   ├── postcss.config.js
│   ├── public
│   │   ├── .well-known
│   │   │   └── security.txt
│   │   ├── 404.html
│   │   ├── android-chrome-192x192.png
│   │   ├── android-chrome-512x512.png
│   │   ├── apple-touch-icon.png
│   │   ├── explain-product-pricing-methods-no-mcp.png
│   │   ├── explain-product-pricing-methods.png
│   │   ├── favicon-16x16.png
│   │   ├── favicon-32x32.png
│   │   ├── favicon.ico
│   │   ├── llms.txt
│   │   ├── robots.txt
│   │   ├── site.webmanifest
│   │   └── sitemap.xml
│   ├── README.md
│   ├── scripts
│   │   ├── generate-search-index.js
│   │   ├── generate-sitemap.js
│   │   └── search-dev.js
│   ├── src
│   │   └── styles
│   │       ├── input.css
│   │       └── prism-theme.css
│   ├── tailwind.config.js
│   ├── tsconfig.json
│   ├── types.ts
│   ├── utils
│   │   ├── search.ts
│   │   └── toolsData.ts
│   └── vite.config.ts
├── eslint.config.js
├── jest.config.js
├── LICENSE
├── package-lock.json
├── package.json
├── README.md
├── scripts
│   └── convert-docs.js
├── SECURITY.md
├── server.json
├── src
│   ├── clients
│   │   ├── base
│   │   │   ├── http-client.ts
│   │   │   ├── oauth-token.ts
│   │   │   └── ocapi-auth-client.ts
│   │   ├── best-practices-client.ts
│   │   ├── cartridge-generation-client.ts
│   │   ├── docs
│   │   │   ├── class-content-parser.ts
│   │   │   ├── class-name-resolver.ts
│   │   │   ├── documentation-scanner.ts
│   │   │   ├── index.ts
│   │   │   └── referenced-types-extractor.ts
│   │   ├── docs-client.ts
│   │   ├── log-client.ts
│   │   ├── logs
│   │   │   ├── index.ts
│   │   │   ├── log-analyzer.ts
│   │   │   ├── log-client.ts
│   │   │   ├── log-constants.ts
│   │   │   ├── log-file-discovery.ts
│   │   │   ├── log-file-reader.ts
│   │   │   ├── log-formatter.ts
│   │   │   ├── log-processor.ts
│   │   │   ├── log-types.ts
│   │   │   └── webdav-client-manager.ts
│   │   ├── ocapi
│   │   │   ├── code-versions-client.ts
│   │   │   ├── site-preferences-client.ts
│   │   │   └── system-objects-client.ts
│   │   ├── ocapi-client.ts
│   │   └── sfra-client.ts
│   ├── config
│   │   ├── configuration-factory.ts
│   │   └── dw-json-loader.ts
│   ├── core
│   │   ├── handlers
│   │   │   ├── abstract-log-tool-handler.ts
│   │   │   ├── base-handler.ts
│   │   │   ├── best-practices-handler.ts
│   │   │   ├── cartridge-handler.ts
│   │   │   ├── client-factory.ts
│   │   │   ├── code-version-handler.ts
│   │   │   ├── docs-handler.ts
│   │   │   ├── job-log-handler.ts
│   │   │   ├── job-log-tool-config.ts
│   │   │   ├── log-handler.ts
│   │   │   ├── log-tool-config.ts
│   │   │   ├── sfra-handler.ts
│   │   │   ├── system-object-handler.ts
│   │   │   └── validation-helpers.ts
│   │   ├── server.ts
│   │   └── tool-definitions.ts
│   ├── index.ts
│   ├── main.ts
│   ├── services
│   │   ├── file-system-service.ts
│   │   ├── index.ts
│   │   └── path-service.ts
│   ├── tool-configs
│   │   ├── best-practices-tool-config.ts
│   │   ├── cartridge-tool-config.ts
│   │   ├── code-version-tool-config.ts
│   │   ├── docs-tool-config.ts
│   │   ├── job-log-tool-config.ts
│   │   ├── log-tool-config.ts
│   │   ├── sfra-tool-config.ts
│   │   └── system-object-tool-config.ts
│   ├── types
│   │   └── types.ts
│   └── utils
│       ├── cache.ts
│       ├── job-log-tool-config.ts
│       ├── job-log-utils.ts
│       ├── log-cache.ts
│       ├── log-tool-config.ts
│       ├── log-tool-constants.ts
│       ├── log-tool-utils.ts
│       ├── logger.ts
│       ├── ocapi-url-builder.ts
│       ├── path-resolver.ts
│       ├── query-builder.ts
│       ├── utils.ts
│       └── validator.ts
├── tests
│   ├── __mocks__
│   │   ├── docs-client.ts
│   │   ├── src
│   │   │   └── clients
│   │   │       └── base
│   │   │           └── http-client.js
│   │   └── webdav.js
│   ├── base-handler.test.ts
│   ├── base-http-client.test.ts
│   ├── best-practices-handler.test.ts
│   ├── cache.test.ts
│   ├── cartridge-handler.test.ts
│   ├── class-content-parser.test.ts
│   ├── class-name-resolver.test.ts
│   ├── client-factory.test.ts
│   ├── code-version-handler.test.ts
│   ├── code-versions-client.test.ts
│   ├── config.test.ts
│   ├── configuration-factory.test.ts
│   ├── docs-handler.test.ts
│   ├── documentation-scanner.test.ts
│   ├── file-system-service.test.ts
│   ├── job-log-handler.test.ts
│   ├── job-log-utils.test.ts
│   ├── log-client.test.ts
│   ├── log-handler.test.ts
│   ├── log-processor.test.ts
│   ├── logger.test.ts
│   ├── mcp
│   │   ├── AGENTS.md
│   │   ├── node
│   │   │   ├── activate-code-version-advanced.full-mode.programmatic.test.js
│   │   │   ├── code-versions.full-mode.programmatic.test.js
│   │   │   ├── generate-cartridge-structure.docs-only.programmatic.test.js
│   │   │   ├── get-available-best-practice-guides.docs-only.programmatic.test.js
│   │   │   ├── get-available-sfra-documents.programmatic.test.js
│   │   │   ├── get-best-practice-guide.docs-only.programmatic.test.js
│   │   │   ├── get-hook-reference.docs-only.programmatic.test.js
│   │   │   ├── get-job-execution-summary.full-mode.programmatic.test.js
│   │   │   ├── get-job-log-entries.full-mode.programmatic.test.js
│   │   │   ├── get-latest-debug.full-mode.programmatic.test.js
│   │   │   ├── get-latest-error.full-mode.programmatic.test.js
│   │   │   ├── get-latest-info.full-mode.programmatic.test.js
│   │   │   ├── get-latest-job-log-files.full-mode.programmatic.test.js
│   │   │   ├── get-latest-warn.full-mode.programmatic.test.js
│   │   │   ├── get-log-file-contents.full-mode.programmatic.test.js
│   │   │   ├── get-sfcc-class-documentation.docs-only.programmatic.test.js
│   │   │   ├── get-sfcc-class-info.docs-only.programmatic.test.js
│   │   │   ├── get-sfra-categories.docs-only.programmatic.test.js
│   │   │   ├── get-sfra-document.programmatic.test.js
│   │   │   ├── get-sfra-documents-by-category.docs-only.programmatic.test.js
│   │   │   ├── get-system-object-definition.full-mode.programmatic.test.js
│   │   │   ├── get-system-object-definitions.docs-only.programmatic.test.js
│   │   │   ├── get-system-object-definitions.full-mode.programmatic.test.js
│   │   │   ├── list-log-files.full-mode.programmatic.test.js
│   │   │   ├── list-sfcc-classes.docs-only.programmatic.test.js
│   │   │   ├── search-best-practices.docs-only.programmatic.test.js
│   │   │   ├── search-custom-object-attribute-definitions.full-mode.programmatic.test.js
│   │   │   ├── search-job-logs-by-name.full-mode.programmatic.test.js
│   │   │   ├── search-job-logs.full-mode.programmatic.test.js
│   │   │   ├── search-logs.full-mode.programmatic.test.js
│   │   │   ├── search-sfcc-classes.docs-only.programmatic.test.js
│   │   │   ├── search-sfcc-methods.docs-only.programmatic.test.js
│   │   │   ├── search-sfra-documentation.docs-only.programmatic.test.js
│   │   │   ├── search-site-preferences.full-mode.programmatic.test.js
│   │   │   ├── search-system-object-attribute-definitions.full-mode.programmatic.test.js
│   │   │   ├── search-system-object-attribute-groups.full-mode.programmatic.test.js
│   │   │   ├── summarize-logs.full-mode.programmatic.test.js
│   │   │   ├── tools.docs-only.programmatic.test.js
│   │   │   └── tools.full-mode.programmatic.test.js
│   │   ├── README.md
│   │   ├── test-fixtures
│   │   │   └── dw.json
│   │   └── yaml
│   │       ├── activate-code-version.docs-only.test.mcp.yml
│   │       ├── activate-code-version.full-mode.test.mcp.yml
│   │       ├── get_latest_error.test.mcp.yml
│   │       ├── get-available-best-practice-guides.docs-only.test.mcp.yml
│   │       ├── get-available-best-practice-guides.full-mode.test.mcp.yml
│   │       ├── get-available-sfra-documents.docs-only.test.mcp.yml
│   │       ├── get-available-sfra-documents.full-mode.test.mcp.yml
│   │       ├── get-best-practice-guide.docs-only.test.mcp.yml
│   │       ├── get-best-practice-guide.full-mode.test.mcp.yml
│   │       ├── get-code-versions.docs-only.test.mcp.yml
│   │       ├── get-code-versions.full-mode.test.mcp.yml
│   │       ├── get-hook-reference.docs-only.test.mcp.yml
│   │       ├── get-hook-reference.full-mode.test.mcp.yml
│   │       ├── get-job-execution-summary.full-mode.test.mcp.yml
│   │       ├── get-job-log-entries.full-mode.test.mcp.yml
│   │       ├── get-latest-debug.full-mode.test.mcp.yml
│   │       ├── get-latest-error.full-mode.test.mcp.yml
│   │       ├── get-latest-info.full-mode.test.mcp.yml
│   │       ├── get-latest-job-log-files.full-mode.test.mcp.yml
│   │       ├── get-latest-warn.full-mode.test.mcp.yml
│   │       ├── get-log-file-contents.full-mode.test.mcp.yml
│   │       ├── get-sfcc-class-documentation.docs-only.test.mcp.yml
│   │       ├── get-sfcc-class-documentation.full-mode.test.mcp.yml
│   │       ├── get-sfcc-class-info.docs-only.test.mcp.yml
│   │       ├── get-sfcc-class-info.full-mode.test.mcp.yml
│   │       ├── get-sfra-categories.docs-only.test.mcp.yml
│   │       ├── get-sfra-categories.full-mode.test.mcp.yml
│   │       ├── get-sfra-document.docs-only.test.mcp.yml
│   │       ├── get-sfra-document.full-mode.test.mcp.yml
│   │       ├── get-sfra-documents-by-category.docs-only.test.mcp.yml
│   │       ├── get-sfra-documents-by-category.full-mode.test.mcp.yml
│   │       ├── get-system-object-definition.docs-only.test.mcp.yml
│   │       ├── get-system-object-definition.full-mode.test.mcp.yml
│   │       ├── get-system-object-definitions.docs-only.test.mcp.yml
│   │       ├── get-system-object-definitions.full-mode.test.mcp.yml
│   │       ├── list-log-files.full-mode.test.mcp.yml
│   │       ├── list-sfcc-classes.docs-only.test.mcp.yml
│   │       ├── list-sfcc-classes.full-mode.test.mcp.yml
│   │       ├── search-best-practices.docs-only.test.mcp.yml
│   │       ├── search-best-practices.full-mode.test.mcp.yml
│   │       ├── search-custom-object-attribute-definitions.docs-only.test.mcp.yml
│   │       ├── search-custom-object-attribute-definitions.test.mcp.yml
│   │       ├── search-job-logs-by-name.full-mode.test.mcp.yml
│   │       ├── search-job-logs.full-mode.test.mcp.yml
│   │       ├── search-logs.full-mode.test.mcp.yml
│   │       ├── search-sfcc-classes.docs-only.test.mcp.yml
│   │       ├── search-sfcc-classes.full-mode.test.mcp.yml
│   │       ├── search-sfcc-methods.docs-only.test.mcp.yml
│   │       ├── search-sfcc-methods.full-mode.test.mcp.yml
│   │       ├── search-sfra-documentation.docs-only.test.mcp.yml
│   │       ├── search-sfra-documentation.full-mode.test.mcp.yml
│   │       ├── search-site-preferences.docs-only.test.mcp.yml
│   │       ├── search-site-preferences.full-mode.test.mcp.yml
│   │       ├── search-system-object-attribute-definitions.docs-only.test.mcp.yml
│   │       ├── search-system-object-attribute-definitions.full-mode.test.mcp.yml
│   │       ├── search-system-object-attribute-groups.docs-only.test.mcp.yml
│   │       ├── search-system-object-attribute-groups.full-mode.test.mcp.yml
│   │       ├── summarize-logs.full-mode.test.mcp.yml
│   │       ├── tools.docs-only.test.mcp.yml
│   │       └── tools.full-mode.test.mcp.yml
│   ├── oauth-token.test.ts
│   ├── ocapi-auth-client.test.ts
│   ├── ocapi-client.test.ts
│   ├── path-service.test.ts
│   ├── query-builder.test.ts
│   ├── referenced-types-extractor.test.ts
│   ├── servers
│   │   ├── sfcc-mock-server
│   │   │   ├── mock-data
│   │   │   │   └── ocapi
│   │   │   │       ├── code-versions.json
│   │   │   │       ├── custom-object-attributes-customapi.json
│   │   │   │       ├── custom-object-attributes-globalsettings.json
│   │   │   │       ├── custom-object-attributes-versionhistory.json
│   │   │   │       ├── site-preferences-ccv.json
│   │   │   │       ├── site-preferences-fastforward.json
│   │   │   │       ├── site-preferences-sfra.json
│   │   │   │       ├── site-preferences-storefront.json
│   │   │   │       ├── site-preferences-system.json
│   │   │   │       ├── system-object-attribute-groups-campaign.json
│   │   │   │       ├── system-object-attribute-groups-category.json
│   │   │   │       ├── system-object-attribute-groups-order.json
│   │   │   │       ├── system-object-attribute-groups-product.json
│   │   │   │       ├── system-object-attribute-groups-sitepreferences.json
│   │   │   │       ├── system-object-attributes-customeraddress.json
│   │   │   │       ├── system-object-attributes-product-expanded.json
│   │   │   │       ├── system-object-attributes-product.json
│   │   │   │       ├── system-object-definition-category.json
│   │   │   │       ├── system-object-definition-customer.json
│   │   │   │       ├── system-object-definition-customeraddress.json
│   │   │   │       ├── system-object-definition-order.json
│   │   │   │       ├── system-object-definition-product.json
│   │   │   │       ├── system-object-definitions-old.json
│   │   │   │       └── system-object-definitions.json
│   │   │   ├── package-lock.json
│   │   │   ├── package.json
│   │   │   ├── README.md
│   │   │   ├── scripts
│   │   │   │   └── setup-logs.js
│   │   │   ├── server.js
│   │   │   └── src
│   │   │       ├── app.js
│   │   │       ├── config
│   │   │       │   └── server-config.js
│   │   │       ├── middleware
│   │   │       │   ├── auth.js
│   │   │       │   ├── cors.js
│   │   │       │   └── logging.js
│   │   │       ├── routes
│   │   │       │   ├── ocapi
│   │   │       │   │   ├── code-versions-handler.js
│   │   │       │   │   ├── oauth-handler.js
│   │   │       │   │   ├── ocapi-error-utils.js
│   │   │       │   │   ├── ocapi-utils.js
│   │   │       │   │   ├── site-preferences-handler.js
│   │   │       │   │   └── system-objects-handler.js
│   │   │       │   ├── ocapi.js
│   │   │       │   └── webdav.js
│   │   │       └── utils
│   │   │           ├── mock-data-loader.js
│   │   │           └── webdav-xml.js
│   │   └── sfcc-mock-server-manager.ts
│   ├── sfcc-mock-server.test.ts
│   ├── site-preferences-client.test.ts
│   ├── system-objects-client.test.ts
│   ├── utils.test.ts
│   ├── validation-helpers.test.ts
│   └── validator.test.ts
├── tsconfig.json
└── tsconfig.test.json
```

# Files

--------------------------------------------------------------------------------
/scripts/convert-docs.js:
--------------------------------------------------------------------------------

```javascript
#!/usr/bin/env node

import axios from 'axios';
import * as cheerio from 'cheerio';
import fs from 'fs/promises';
import path from 'path';
import { fileURLToPath } from 'url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const BASE_URL = 'https://salesforcecommercecloud.github.io/b2c-dev-doc/docs/current/scriptapi/html/api';
const OUTPUT_DIR = path.join(__dirname, '..', 'docs');

// Configuration options
const CONFIG = {
    // Limit number of classes per package (0 = no limit)
    maxClassesPerPackage: 0,
    // Limit number of packages (0 = no limit)
    maxPackages: 0,
    // Enable debug logging
    debug: false,
    // Rate limiting settings
    rateLimit: {
        // Delay between requests in milliseconds
        requestDelay: 1000,
        // Maximum requests per minute
        maxRequestsPerMinute: 30,
        // Delay between processing packages in milliseconds
        packageDelay: 2000,
        // Random jitter to add (0-1 multiplier)
        jitter: 0.3
    }
};

// Override config from command line args
if (process.argv.includes('--test')) {
    CONFIG.maxClassesPerPackage = 3;
    CONFIG.maxPackages = 2;
    CONFIG.debug = true;
}

if (process.argv.includes('--limit')) {
    const limitIndex = process.argv.indexOf('--limit');
    if (limitIndex >= 0 && process.argv[limitIndex + 1]) {
        CONFIG.maxClassesPerPackage = parseInt(process.argv[limitIndex + 1]) || 5;
    }
}

if (process.argv.includes('--fast')) {
    CONFIG.rateLimit.requestDelay = 500;
    CONFIG.rateLimit.maxRequestsPerMinute = 45;
    CONFIG.rateLimit.packageDelay = 1000;
    console.log('Using fast mode (less conservative rate limiting)');
}

if (process.argv.includes('--slow')) {
    CONFIG.rateLimit.requestDelay = 2000;
    CONFIG.rateLimit.maxRequestsPerMinute = 15;
    CONFIG.rateLimit.packageDelay = 5000;
    console.log('Using slow mode (very conservative rate limiting)');
}

// Ensure output directory exists
async function ensureDir(dir) {
    try {
        await fs.access(dir);
    } catch {
        await fs.mkdir(dir, { recursive: true });
    }
}

// Fetch HTML content from URL with rate limiting
async function fetchHTML(url) {
    // Apply rate limiting before making request
    await rateLimiter.waitForRateLimit();

    try {
        console.log(`Fetching: ${url}`);

        const response = await axios.get(url, {
            headers: {
                'User-Agent': rateLimiter.getRandomUserAgent(),
                'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
                'Accept-Language': 'en-US,en;q=0.5',
                'Accept-Encoding': 'gzip, deflate, br',
                'Connection': 'keep-alive',
                'Upgrade-Insecure-Requests': '1',
                'Sec-Fetch-Dest': 'document',
                'Sec-Fetch-Mode': 'navigate',
                'Sec-Fetch-Site': 'none',
                'Cache-Control': 'max-age=0'
            },
            timeout: 30000, // 30 second timeout
            validateStatus: function (status) {
                return status >= 200 && status < 300; // Accept only 2xx status codes
            }
        });

        return response.data;
    } catch (error) {
        if (error.response && error.response.status === 429) {
            console.warn(`Rate limited by server. Waiting 60 seconds before retry...`);
            // eslint-disable-next-line no-undef
            await new Promise(resolve => setTimeout(resolve, 60000));
            // Retry once after rate limit
            try {
                const retryResponse = await axios.get(url, {
                    headers: {
                        'User-Agent': rateLimiter.getRandomUserAgent(),
                        'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
                        'Accept-Language': 'en-US,en;q=0.5',
                        'Accept-Encoding': 'gzip, deflate, br',
                        'Connection': 'keep-alive',
                        'Upgrade-Insecure-Requests': '1',
                        'Cache-Control': 'max-age=0'
                    },
                    timeout: 30000
                });
                return retryResponse.data;
            } catch (retryError) {
                console.error(`Retry failed for ${url}:`, retryError.message);
                return null;
            }
        }

        console.error(`Error fetching ${url}:`, error.message);
        return null;
    }
}

// Helper function to clean and normalize text
function cleanText(text) {
    return text
        .replace(/\s+/g, ' ') // Replace multiple whitespace with single space
        .replace(/\n\s*\n/g, '\n') // Remove empty lines
        .replace(/\t/g, ' ') // Replace tabs with spaces
        .trim();
}

// Helper function to extract method signature cleanly
function cleanMethodSignature(htmlContent) {
    const $ = cheerio.load(`<div>${htmlContent}</div>`);

    // Extract static keyword if present
    let signature = '';
    if (htmlContent.includes('static')) {
        signature += 'static ';
    }

    // Extract method name from emphasis span
    const methodName = $('.emphasis').text().trim();
    if (methodName) {
        signature += methodName;
    }

    // Get the full text and clean it up
    const fullText = $.text().replace(/\s+/g, ' ').trim();

    // Extract parameters and return type using regex
    const methodPattern = /(\w+)\s*\(\s*([^)]*)\s*\)\s*:\s*(.+?)$/;
    const match = fullText.match(methodPattern);

    if (match) {
        const params = match[2].trim();
        const returnType = match[3].trim();

        // Clean up parameters - remove excessive whitespace and normalize format
        let cleanParams = '';
        if (params) {
            cleanParams = params
                .replace(/\s*:\s*/g, ' : ')  // Normalize colons
                .replace(/,\s+/g, ', ')      // Normalize commas
                .replace(/\s+/g, ' ')        // Single spaces
                .trim();
        }

        signature += `(${cleanParams}) : ${returnType}`;
    } else {
        // Fallback - try to extract just the method call part
        const simpleMatch = fullText.match(/(\w+\s*\([^)]*\))/);
        if (simpleMatch) {
            const methodCall = simpleMatch[1].replace(/\s+/g, ' ').trim();
            signature += methodCall;
        }
    }

    return signature.replace(/\s+/g, ' ').trim();
}

// Convert HTML to Markdown
function htmlToMarkdown(html) {
    const $ = cheerio.load(html);

    // Remove script tags and other unwanted elements
    $('script, style, .banner, .site-footer, header').remove();

    let markdown = '';

    // Find the main class content
    const classDiv = $('[id^="class_"]').first();

    if (classDiv.length === 0) {
        console.warn('No class content found');
        return '';
    }

    // Extract package name
    const packageName = classDiv.find('.packageName').text().trim();
    if (packageName) {
        markdown += `## Package: ${packageName}\n\n`;
    }

    // Extract class name
    const className = cleanText(classDiv.find('.className').text());
    if (className) {
        markdown += `# ${className}\n\n`;
    }

    // Extract inheritance hierarchy
    const hierarchy = classDiv.find('.hierarchy');
    if (hierarchy.length > 0) {
        markdown += '## Inheritance Hierarchy\n\n';
        hierarchy.find('div').each((i, div) => {
            const $div = $(div);
            const text = cleanText($div.text());
            if (text) {
                // Calculate indentation based on left position
                const leftStyle = $div.attr('style') || '';
                const leftMatch = leftStyle.match(/left:\s*(\d+)%/);
                const level = leftMatch ? Math.floor(parseInt(leftMatch[1]) / 3) : 0;
                const indent = '  '.repeat(level);
                markdown += `${indent}- ${text}\n`;
            }
        });
        markdown += '\n';
    }

    // Extract class description
    const description = cleanText(classDiv.find('.classSummary .description').text());
    if (description) {
        markdown += '## Description\n\n';
        markdown += `${description}\n\n`;
    }

    // Process sections (Properties, Methods, etc.)
    classDiv.find('.section').each((i, section) => {
        const $section = $(section);
        const header = cleanText($section.find('.header').first().text());

        if (!header) return;

        markdown += `## ${header}\n\n`;

        // Handle different section types
        if (header === 'Constants') {
            $section.find('.summaryItem').each((j, item) => {
                const $item = $(item);

                // Extract constant name from the text content before the colon
                const spanContent = $item.find('span').first();
                const fullText = spanContent.text();
                
                // Parse the constant line: "CONSTANT_NAME : Type = value"
                const constMatch = fullText.match(/^([A-Z_][A-Z0-9_]*)\s*:/);
                const constName = constMatch ? constMatch[1].trim() : '';

                // Extract type - look for the type link after the colon
                const typeLink = spanContent.find('a span').first();
                const constType = typeLink.text().trim();

                // Extract value if present (after the = sign)
                const valueMatch = fullText.match(/=\s*([^]+?)(?=\s|$)/);
                const constValue = valueMatch ? valueMatch[1].trim() : '';

                const desc = cleanText($item.find('.description').text());

                if (constName) {
                    markdown += `### ${constName}\n\n`;
                    if (constType) {
                        let typeInfo = `**Type:** ${constType}`;
                        if (constValue) {
                            typeInfo += ` = ${constValue}`;
                        }
                        markdown += `${typeInfo}\n\n`;
                    }
                    if (desc) {
                        markdown += `${desc}\n\n`;
                    }
                }
            });
        } else if (header === 'Properties') {
            $section.find('.summaryItem').each((j, item) => {
                const $item = $(item);

                // For properties, parse the span content more carefully
                const spanContent = $item.find('span').first();
                const fullText = spanContent.text();

                // Extract property name (text before the first colon)
                const nameMatch = fullText.match(/^([^\s:]+)\s*:/);
                const propName = nameMatch ? nameMatch[1].trim() : '';

                // Extract type - look for linked type names
                const typeLinks = spanContent.find('a');
                let propType = '';
                typeLinks.each((idx, link) => {
                    const $link = $(link);
                    const linkText = $link.text().trim();
                    // Skip if it's an anchor link (starts with #)
                    if (!$link.attr('href')?.startsWith('#') && linkText) {
                        propType = linkText;
                        return false; // break the loop
                    }
                });

                // If no type found in links, try to extract from text pattern
                if (!propType) {
                    const typeMatch = fullText.match(/:\s*([A-Za-z][A-Za-z0-9]*)/);
                    if (typeMatch) {
                        propType = typeMatch[1];
                    }
                }

                // Check for modifiers
                const isStatic = fullText.includes('static');
                const isReadOnly = fullText.includes('(Read Only)');

                const desc = $item.find('.description').text().trim();

                if (propName) {
                    markdown += `### ${propName}\n\n`;
                    if (propType) {
                        let typeInfo = `**Type:** ${propType}`;
                        if (isStatic) typeInfo += ' (Static)';
                        if (isReadOnly) typeInfo += ' (Read Only)';
                        markdown += `${typeInfo}\n\n`;
                    }
                    if (desc) {
                        markdown += `${desc}\n\n`;
                    }
                }
            });
        } else if (header === 'Method Summary' || header.includes('Method')) {
            $section.find('.summaryItem').each((j, item) => {
                const $item = $(item);

                // Extract method name from emphasis link
                const methodLink = $item.find('.emphasis a').first();
                const methodName = methodLink.text().trim();

                // Get clean signature
                const signature = cleanMethodSignature($item.find('span').first().html());

                const desc = cleanText($item.find('.description').text());

                if (methodName && !desc.startsWith('This class does not have')) {
                    markdown += `### ${methodName}\n\n`;
                    if (signature) {
                        markdown += `**Signature:** \`${signature}\`\n\n`;
                    }
                    if (desc) {
                        markdown += `${desc}\n\n`;
                    }
                }
            });
        } else if (header === 'Constructor Summary') {
            $section.find('.summaryItem').each((j, item) => {
                const $item = $(item);
                const constructorText = cleanText($item.text());
                if (constructorText && !constructorText.includes('This class does not have')) {
                    markdown += `${constructorText}\n\n`;
                }
            });
        } else {
            // Handle inherited methods and other sections
            const content = cleanText($section.find('.summaryItem').text());
            if (content && !content.includes('This class does not have')) {
                markdown += `${content}\n\n`;
            }
        }
    });

    // Process detailed method descriptions
    const methodDetails = classDiv.find('.section').filter((i, el) => {
        return $(el).find('.header').text().trim() === 'Method Detail';
    });

    if (methodDetails.length > 0) {
        markdown += '## Method Details\n\n';

        methodDetails.find('.detailItem').each((i, item) => {
            const $item = $(item);

            const methodName = cleanText($item.find('.detailName').text());
            const signature = cleanText($item.find('.detailSignature').text());
            const description = cleanText($item.find('.description').first().text());

            if (methodName) {
                markdown += `### ${methodName}\n\n`;

                if (signature) {
                    markdown += `**Signature:** \`${signature}\`\n\n`;
                }

                if (description) {
                    markdown += `**Description:** ${description}\n\n`;
                }

                // Process parameters
                $item.find('.parameters').each((j, param) => {
                    const $param = $(param);
                    const title = cleanText($param.find('.parameterTitle').text());

                    if (title) {
                        markdown += `**${title}**\n\n`;

                        $param.find('.parameterDetail').each((k, detail) => {
                            const $detail = $(detail);
                            const paramName = cleanText($detail.find('.parameterName').text());
                            const paramDesc = cleanText($detail.find('.parameterDesc').text());

                            if (paramName && paramDesc) {
                                markdown += `- \`${paramName}\`: ${paramDesc}\n`;
                            } else {
                                const detailText = cleanText($detail.text());
                                if (detailText) {
                                    markdown += `${detailText}\n`;
                                }
                            }
                        });

                        markdown += '\n';
                    }
                });

                markdown += '---\n\n';
            }
        });
    }

    // Clean up the final markdown
    return markdown
        .replace(/\n{3,}/g, '\n\n') // Replace 3+ newlines with 2
        .trim();
}

// Rate limiting utilities
class RateLimiter {
    constructor(config) {
        this.config = config;
        this.requestTimes = [];
        this.userAgents = [
            'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
            'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15',
            'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
            'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0'
        ];
        this.currentUserAgentIndex = 0;
    }

    async waitForRateLimit() {
        const now = Date.now();

        // Remove requests older than 1 minute
        this.requestTimes = this.requestTimes.filter(time => now - time < 60000);

        // Check if we're at the rate limit
        if (this.requestTimes.length >= this.config.maxRequestsPerMinute) {
            const oldestRequest = Math.min(...this.requestTimes);
            const waitTime = 60000 - (now - oldestRequest) + 1000; // Add 1 second buffer

            if (waitTime > 0) {
                console.log(`Rate limit reached. Waiting ${Math.ceil(waitTime / 1000)} seconds...`);
                // eslint-disable-next-line no-undef
                await new Promise(resolve => setTimeout(resolve, waitTime));
            }
        }

        // Apply base delay with jitter
        const baseDelay = this.config.requestDelay;
        const jitter = Math.random() * this.config.jitter * baseDelay;
        const totalDelay = baseDelay + jitter;

        if (CONFIG.debug) {
            console.log(`Applying delay: ${Math.ceil(totalDelay)}ms`);
        }

        // eslint-disable-next-line no-undef
        await new Promise(resolve => setTimeout(resolve, totalDelay));

        // Record this request
        this.requestTimes.push(Date.now());
    }

    getRandomUserAgent() {
        const userAgent = this.userAgents[this.currentUserAgentIndex];
        this.currentUserAgentIndex = (this.currentUserAgentIndex + 1) % this.userAgents.length;
        return userAgent;
    }
}

// Initialize rate limiter
const rateLimiter = new RateLimiter(CONFIG.rateLimit);

// Get all packages from overview page
async function getPackages() {
    const overviewHTML = await fetchHTML(`${BASE_URL}/overview.html`);
    if (!overviewHTML) return [];

    const $ = cheerio.load(overviewHTML);
    const packages = [];

    $('.summaryItem a').each((i, element) => {
        const href = $(element).attr('href');
        const name = $(element).text().trim();
        if (href && href.startsWith('package_')) {
            packages.push({
                name,
                href,
                id: href.replace('.html', '').replace('package_', '')
            });
        }
    });

    return packages;
}

// Get all classes from a package page
async function getClassesFromPackage(packageHref) {
    const packageHTML = await fetchHTML(`${BASE_URL}/${packageHref}`);
    if (!packageHTML) return [];

    const $ = cheerio.load(packageHTML);
    const classes = [];

    $('.classesName a').each((i, element) => {
        const href = $(element).attr('href');
        const name = $(element).text().trim();
        if (href && href.startsWith('class_')) {
            classes.push({
                name,
                href,
                id: href.replace('.html', '').replace('class_', '')
            });
        }
    });

    return classes;
}

// Convert a single class to markdown
async function convertClass(classInfo, packageName) {
    const classHTML = await fetchHTML(`${BASE_URL}/${classInfo.href}`);
    if (!classHTML) return;

    const markdown = htmlToMarkdown(classHTML);
    if (!markdown.trim()) {
        console.warn(`No content generated for ${classInfo.name}`);
        return;
    }

    // Create package directory
    const packageDir = path.join(OUTPUT_DIR, packageName.replace('.', '_'));
    await ensureDir(packageDir);

    // Write markdown file
    const filename = `${classInfo.name}.md`;
    const filepath = path.join(packageDir, filename);

    await fs.writeFile(filepath, markdown, 'utf8');
    console.log(`✓ Converted: ${packageName}.${classInfo.name} -> ${filepath}`);
}

// Main function
async function main() {
    console.log('Starting SFCC documentation conversion...');

    if (CONFIG.maxPackages > 0 || CONFIG.maxClassesPerPackage > 0) {
        console.log('Running in limited mode:');
        if (CONFIG.maxPackages > 0) console.log(`- Max packages: ${CONFIG.maxPackages}`);
        if (CONFIG.maxClassesPerPackage > 0) console.log(`- Max classes per package: ${CONFIG.maxClassesPerPackage}`);
    }

    await ensureDir(OUTPUT_DIR);

    // Get all packages
    const packages = await getPackages();
    console.log(`Found ${packages.length} packages`);

    // Limit packages if configured
    const packageLimit = CONFIG.maxPackages > 0 ? CONFIG.maxPackages : packages.length;
    const packagesToProcess = packages.slice(0, packageLimit);

    for (const pkg of packagesToProcess) {
        console.log(`\nProcessing package: ${pkg.name}`);

        // Get classes in this package
        const classes = await getClassesFromPackage(pkg.href);
        console.log(`Found ${classes.length} classes in ${pkg.name}`);

        // Limit classes if configured
        const classLimit = CONFIG.maxClassesPerPackage > 0 ? CONFIG.maxClassesPerPackage : classes.length;
        const classesToProcess = classes.slice(0, classLimit);

        if (classLimit < classes.length) {
            console.log(`Processing first ${classLimit} classes only...`);
        }

        // Convert each class
        for (const cls of classesToProcess) {
            await convertClass(cls, pkg.name);
        }

        // Delay between processing packages
        if (pkg !== packagesToProcess[packagesToProcess.length - 1]) {
            const packageDelay = CONFIG.rateLimit.packageDelay;
            const jitter = Math.random() * CONFIG.rateLimit.jitter * packageDelay;
            console.log(`Waiting ${Math.ceil((packageDelay + jitter) / 1000)}s before next package...`);
            // eslint-disable-next-line no-undef
            await new Promise(resolve => setTimeout(resolve, packageDelay + jitter));
        }
    }

    console.log('\n✓ Documentation conversion completed!');
}

// Handle command line execution
if (import.meta.url === `file://${process.argv[1]}`) {
    main().catch(console.error);
}

export { main, convertClass, getPackages, getClassesFromPackage };

```

--------------------------------------------------------------------------------
/docs/TopLevel/Array.md:
--------------------------------------------------------------------------------

```markdown
## Package: TopLevel

# Class Array

## Inheritance Hierarchy

- Object
  - Array

## Description

An Array of items.

## Properties

### length

**Type:** Number

The length of the Array.

## Constructor Summary

Array() Constructs an Array.

Array(length : Number) Constructs an Array of the specified length.

Array(values : Object...) Constructs an Array using the specified values.

## Method Summary

### concat

**Signature:** `concat(values : Object...) : Array`

Constructs an Array by concatenating multiple values.

### copyWithin

**Signature:** `copyWithin(target : Number, start : Number, end : Number) : Array`

Copies elements within this array.

### entries

**Signature:** `entries() : ES6Iterator`

Returns an iterator containing all index/value pairs of this array.

### every

**Signature:** `every(callback : Function) : boolean`

Returns true if every element in this array satisfies the test performed in the callback function.

### every

**Signature:** `every(callback : Function, thisObject : Object) : boolean`

Returns true if every element in the thisObject argument satisfies the test performed in the callback function, false otherwise.

### fill

**Signature:** `fill(value : Object, start : Number, end : Number) : Array`

Sets multiple entries of this array to specific value.

### filter

**Signature:** `filter(callback : Function) : Array`

Returns a new Array with all of the elements that pass the test implemented by the callback function.

### filter

**Signature:** `filter(callback : Function, thisObject : Object) : Array`

Returns a new Array with all of the elements that pass the test implemented by the callback function that is run against the specified Array, thisObject.

### find

**Signature:** `find(callback : Function, thisObject : Object) : Object`

Returns the first value within the array that satisfies the test defined in the callback function.

### findIndex

**Signature:** `findIndex(callback : Function, thisObject : Object) : Number`

Returns the index of the first value within the array that satisfies the test defined in the callback function.

### forEach

**Signature:** `forEach(callback : Function) : void`

Runs the provided callback function once for each element present in the Array.

### forEach

**Signature:** `forEach(callback : Function, thisObject : Object) : void`

Runs the provided callback function once for each element present in the specified Array, thisObject.

### from

**Signature:** `static from(arrayLike : Object, mapFn : Function, thisObject : Object) : Array`

Creates a new array from an array-like object or an Iterable.

### includes

**Signature:** `includes(valueToFind : Object, fromIndex : Number) : boolean`

Returns if the array contains a specific value.

### indexOf

**Signature:** `indexOf(elementToLocate : Object) : Number`

Returns the first index at which a given element can be found in the array, or -1 if it is not present.

### indexOf

**Signature:** `indexOf(elementToLocate : Object, fromIndex : Number) : Number`

Returns the first index at which a given element can be found in the array starting at fromIndex, or -1 if it is not present.

### isArray

**Signature:** `static isArray(object : Object) : boolean`

Checks if the passed object is an array.

### join

**Signature:** `join() : String`

Converts all Array elements to Strings and concatenates them.

### join

**Signature:** `join(separator : String) : String`

Converts all array elements to Strings and concatenates them.

### keys

**Signature:** `keys() : ES6Iterator`

Returns an iterator containing all indexes of this array.

### lastIndexOf

**Signature:** `lastIndexOf(elementToLocate : Object) : Number`

Returns the last index at which a given element can be found in the array, or -1 if it is not present.

### lastIndexOf

**Signature:** `lastIndexOf(elementToLocate : Object, fromIndex : Number) : Number`

Returns the last index at which a given element can be found in the array starting at fromIndex, or -1 if it is not present.

### map

**Signature:** `map(callback : Function) : Array`

Creates a new Array with the results of calling the specified function on every element in this Array.

### map

**Signature:** `map(callback : Function, thisObject : Object) : Array`

Creates a new Array with the results of calling the specified function on every element in the specified Array.

### of

**Signature:** `static of(values : Object...) : Array`

Creates a new array from a variable list of elements.

### pop

**Signature:** `pop() : Object`

Removes and returns the last element of the Array.

### push

**Signature:** `push(values : Object...) : Number`

Appends elements to the Array.

### reverse

**Signature:** `reverse() : void`

Reverses the order of the elements in the Array.

### shift

**Signature:** `shift() : Object`

Shifts elements down in the Array and returns the former first element.

### slice

**Signature:** `slice(start : Number, end : Number) : Array`

Returns a new Array containing a portion of the Array using the specified start and end positions.

### some

**Signature:** `some(callback : Function) : boolean`

Returns true if any of the elements in the Array pass the test defined in the callback function, false otherwise.

### some

**Signature:** `some(callback : Function, thisObject : Object) : boolean`

Returns true if any of the elements in the specified Array pass the test defined in the callback function, false otherwise.

### sort

**Signature:** `sort() : Array`

Sorts the elements of the Array in alphabetical order based on character encoding.

### sort

**Signature:** `sort(function : Function) : Array`

Sorts the elements of the Array in alphabetical order based on character encoding.

### splice

**Signature:** `splice(start : Number, deleteCount : Number, values : Object...) : Array`

Deletes the specified number of elements from the Array at the specified position, and then inserts values into the Array at that location.

### toLocaleString

**Signature:** `toLocaleString() : String`

Converts the Array to a localized String.

### toString

**Signature:** `toString() : String`

Converts the Array to a String.

### unshift

**Signature:** `unshift(values : Object...) : Number`

Inserts elements at the beginning of the Array.

### values

**Signature:** `values() : ES6Iterator`

Returns an iterator containing all values of this array.

## Constructor Detail

## Method Detail

## Method Details

### concat

**Signature:** `concat(values : Object...) : Array`

**Description:** Constructs an Array by concatenating multiple values.

**Parameters:**

- `values`: one or more Array values.

**Returns:**

a new Array containing the concatenated values.

---

### copyWithin

**Signature:** `copyWithin(target : Number, start : Number, end : Number) : Array`

**Description:** Copies elements within this array. The array length is not changed.

**API Versioned:**

From version 21.2.

**Parameters:**

- `target`: The target of the first element to copy.
- `start`: Optional. The first index to copy. Default is 0.
- `end`: Optional. The index of the end. This element is not included. Default is copy all to the array end.

**Returns:**

This array.

---

### entries

**Signature:** `entries() : ES6Iterator`

**Description:** Returns an iterator containing all index/value pairs of this array. The iterator produces a series of two-element arrays with the first element as the index and the second element as the value.

**API Versioned:**

From version 21.2.

---

### every

**Signature:** `every(callback : Function) : boolean`

**Description:** Returns true if every element in this array satisfies the test performed in the callback function. The callback function is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed.

**Parameters:**

- `callback`: the function to call to determine if every element in this array satisfies the test defined by the function. The callback function is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed.

**Returns:**

true if every element in this array satisfies the test performed in the callback function.

**See Also:**

Function

---

### every

**Signature:** `every(callback : Function, thisObject : Object) : boolean`

**Description:** Returns true if every element in the thisObject argument satisfies the test performed in the callback function, false otherwise. The callback function is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed.

**Parameters:**

- `callback`: the function to call to determine if every element in this array satisfies the test defined by the function. The callback function is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed.
- `thisObject`: the Object to use as 'this' when executing callback.

**Returns:**

true if every element in thisObject satisfies the test performed in the callback function, false otherwise.

**See Also:**

Function

---

### fill

**Signature:** `fill(value : Object, start : Number, end : Number) : Array`

**Description:** Sets multiple entries of this array to specific value.

**API Versioned:**

From version 21.2.

**Parameters:**

- `value`: The value to set.
- `start`: Optional. The first index to copy. Default is 0.
- `end`: Optional. The index of the end. This element is not included. Default is copy all to the array end.

**Returns:**

This array.

---

### filter

**Signature:** `filter(callback : Function) : Array`

**Description:** Returns a new Array with all of the elements that pass the test implemented by the callback function. The callback function is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed.

**Parameters:**

- `callback`: the function that is called on this Array and which returns a new Array containing the elements that satisfy the function's test. The callback function is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed.

**Returns:**

a new Array containing the elements that satisfy the function's test.

---

### filter

**Signature:** `filter(callback : Function, thisObject : Object) : Array`

**Description:** Returns a new Array with all of the elements that pass the test implemented by the callback function that is run against the specified Array, thisObject. The callback function is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed.

**Parameters:**

- `callback`: the function that is called on the thisObject Array and which returns a new Array containing the elements that satisfy the function's test. The callback function is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed.
- `thisObject`: the Object to use as 'this' when executing callback.

**Returns:**

a new Array containing the elements that satisfy the function's test.

---

### find

**Signature:** `find(callback : Function, thisObject : Object) : Object`

**Description:** Returns the first value within the array that satisfies the test defined in the callback function.

**API Versioned:**

From version 21.2.

**Parameters:**

- `callback`: The function to call, which is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed.
- `thisObject`: The object to use as 'this' when executing callback.

**Returns:**

The first value within the array that satisfies the test defined in the callback function, undefined if no matching value was found.

---

### findIndex

**Signature:** `findIndex(callback : Function, thisObject : Object) : Number`

**Description:** Returns the index of the first value within the array that satisfies the test defined in the callback function.

**API Versioned:**

From version 21.2.

**Parameters:**

- `callback`: The function to call, which is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed.
- `thisObject`: The object to use as 'this' when executing callback.

**Returns:**

The index of the first value within the array that satisfies the test defined in the callback function, -1 if no matching value was found.

---

### forEach

**Signature:** `forEach(callback : Function) : void`

**Description:** Runs the provided callback function once for each element present in the Array. The callback function is invoked only for indexes of the Array which have assigned values; it is not invoked for indexes which have been deleted or which have never been assigned a value.

**Parameters:**

- `callback`: the function to call, which is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed.

---

### forEach

**Signature:** `forEach(callback : Function, thisObject : Object) : void`

**Description:** Runs the provided callback function once for each element present in the specified Array, thisObject. The callback function is invoked only for indexes of the Array which have assigned values; it is not invoked for indexes which have been deleted or which have never been assigned a value.

**Parameters:**

- `callback`: the function to call, which is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed.
- `thisObject`: the Object to use as 'this' when executing callback.

---

### from

**Signature:** `static from(arrayLike : Object, mapFn : Function, thisObject : Object) : Array`

**Description:** Creates a new array from an array-like object or an Iterable.

**API Versioned:**

From version 21.2.

**Parameters:**

- `arrayLike`: An array-like object or an iterable that provides the elements for the new array.
- `mapFn`: Optional. A function that maps the input elements into the value for the new array.
- `thisObject`: Optional. The Object to use as 'this' when executing mapFn.

**Returns:**

The newly created array.

---

### includes

**Signature:** `includes(valueToFind : Object, fromIndex : Number) : boolean`

**Description:** Returns if the array contains a specific value.

**API Versioned:**

From version 21.2.

**Parameters:**

- `valueToFind`: The value to look for.
- `fromIndex`: Optional. The index to start from.

**Returns:**

true if the value is found in the array else false.

---

### indexOf

**Signature:** `indexOf(elementToLocate : Object) : Number`

**Description:** Returns the first index at which a given element can be found in the array, or -1 if it is not present.

**Parameters:**

- `elementToLocate`: the element to locate in the Array.

**Returns:**

the index of the element or -1 if it is no preset.

---

### indexOf

**Signature:** `indexOf(elementToLocate : Object, fromIndex : Number) : Number`

**Description:** Returns the first index at which a given element can be found in the array starting at fromIndex, or -1 if it is not present.

**Parameters:**

- `elementToLocate`: the element to locate in the Array.
- `fromIndex`: the index from which to start looking for the element.

**Returns:**

the index of the element or -1 if it is no preset.

---

### isArray

**Signature:** `static isArray(object : Object) : boolean`

**Description:** Checks if the passed object is an array.

**Parameters:**

- `object`: The object to ckeck.

**Returns:**

true if the passed object is an array else false.

---

### join

**Signature:** `join() : String`

**Description:** Converts all Array elements to Strings and concatenates them.

**Returns:**

a concatenated list of all Array elements as a String.

---

### join

**Signature:** `join(separator : String) : String`

**Description:** Converts all array elements to Strings and concatenates them.

**Parameters:**

- `separator`: an optional character or string used to separate one element of the Array from the next element in the return String.

**Returns:**

a concatenated list of all Array elements as a String where the specified delimiter is used to separate elements.

---

### keys

**Signature:** `keys() : ES6Iterator`

**Description:** Returns an iterator containing all indexes of this array.

**API Versioned:**

From version 21.2.

---

### lastIndexOf

**Signature:** `lastIndexOf(elementToLocate : Object) : Number`

**Description:** Returns the last index at which a given element can be found in the array, or -1 if it is not present. The array is searched backwards.

**Parameters:**

- `elementToLocate`: the element to locate in the Array.

**Returns:**

the index of the element or -1 if it is no preset.

---

### lastIndexOf

**Signature:** `lastIndexOf(elementToLocate : Object, fromIndex : Number) : Number`

**Description:** Returns the last index at which a given element can be found in the array starting at fromIndex, or -1 if it is not present. The array is searched backwards.

**Parameters:**

- `elementToLocate`: the element to locate in the Array.
- `fromIndex`: the index from which to start looking for the element. The array is searched backwards.

**Returns:**

the index of the element or -1 if it is no present.

---

### map

**Signature:** `map(callback : Function) : Array`

**Description:** Creates a new Array with the results of calling the specified function on every element in this Array. The callback function is invoked only for indexes of the Array which have assigned values; it is not invoked for indexes which have been deleted or which have never been assigned values.

**Parameters:**

- `callback`: the function to call, which is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed.

**Returns:**

a new Array with the results of calling the specified function on every element in this Array.

---

### map

**Signature:** `map(callback : Function, thisObject : Object) : Array`

**Description:** Creates a new Array with the results of calling the specified function on every element in the specified Array. The callback function is invoked only for indexes of the Array which have assigned values; it is not invoked for indexes which have been deleted or which have never been assigned values.

**Parameters:**

- `callback`: the function to call, which is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed.
- `thisObject`: the Object to use as 'this' when executing callback.

**Returns:**

a new Array with the results of calling the specified function on every element in this Array.

---

### of

**Signature:** `static of(values : Object...) : Array`

**Description:** Creates a new array from a variable list of elements.

**API Versioned:**

From version 21.2.

**Parameters:**

- `values`: The array values.

**Returns:**

The newly created array.

---

### pop

**Signature:** `pop() : Object`

**Description:** Removes and returns the last element of the Array.

**Returns:**

the last element of the Array.

---

### push

**Signature:** `push(values : Object...) : Number`

**Description:** Appends elements to the Array.

**Parameters:**

- `values`: one or more values that will be appended to the Array.

**Returns:**

the new length of the Array.

---

### reverse

**Signature:** `reverse() : void`

**Description:** Reverses the order of the elements in the Array.

---

### shift

**Signature:** `shift() : Object`

**Description:** Shifts elements down in the Array and returns the former first element.

**Returns:**

the former first element.

---

### slice

**Signature:** `slice(start : Number, end : Number) : Array`

**Description:** Returns a new Array containing a portion of the Array using the specified start and end positions.

**Parameters:**

- `start`: the location in the Array to start the slice operation.
- `end`: the location in the Array to stop the slice operation.

**Returns:**

a new Array containing the members bound by start and end.

---

### some

**Signature:** `some(callback : Function) : boolean`

**Description:** Returns true if any of the elements in the Array pass the test defined in the callback function, false otherwise.

**Parameters:**

- `callback`: the function to call, which is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed.

**Returns:**

true if any of the elements in the Array pass the test defined in the callback function, false otherwise.

---

### some

**Signature:** `some(callback : Function, thisObject : Object) : boolean`

**Description:** Returns true if any of the elements in the specified Array pass the test defined in the callback function, false otherwise.

**Parameters:**

- `callback`: the function to call, which is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed.
- `thisObject`: the Object to use as 'this' when executing callback.

**Returns:**

true if any of the elements in the Array pass the test defined in the callback function, false otherwise.

---

### sort

**Signature:** `sort() : Array`

**Description:** Sorts the elements of the Array in alphabetical order based on character encoding. This sort is guaranteed to be stable: equal elements will not be reordered as a result of the sort.

**Returns:**

a reference to the Array.

---

### sort

**Signature:** `sort(function : Function) : Array`

**Description:** Sorts the elements of the Array in alphabetical order based on character encoding. This sort is guaranteed to be stable: equal elements will not be reordered as a result of the sort.

**Parameters:**

- `function`: a Function used to specify the sorting order.

**Returns:**

a reference to the Array.

**See Also:**

Function

---

### splice

**Signature:** `splice(start : Number, deleteCount : Number, values : Object...) : Array`

**Description:** Deletes the specified number of elements from the Array at the specified position, and then inserts values into the Array at that location.

**Parameters:**

- `start`: the start location.
- `deleteCount`: the number of items to delete.
- `values`: zero or more values to be inserted into the Array.

---

### toLocaleString

**Signature:** `toLocaleString() : String`

**Description:** Converts the Array to a localized String.

**Returns:**

a localized String representing the Array.

---

### toString

**Signature:** `toString() : String`

**Description:** Converts the Array to a String.

**Returns:**

a String representation of the Array.

---

### unshift

**Signature:** `unshift(values : Object...) : Number`

**Description:** Inserts elements at the beginning of the Array.

**Parameters:**

- `values`: one or more vales that will be inserted into the beginning of the Array.

**Returns:**

the new length of the Array.

---

### values

**Signature:** `values() : ES6Iterator`

**Description:** Returns an iterator containing all values of this array.

**API Versioned:**

From version 21.2.

---
```

--------------------------------------------------------------------------------
/docs/dw_catalog/ProductSearchHit.md:
--------------------------------------------------------------------------------

```markdown
## Package: dw.catalog

# Class ProductSearchHit

## Inheritance Hierarchy

- Object
  - dw.catalog.ProductSearchHit

## Description

ProductSearchHit is the result of a executed search query and wraps the actual product found by the search. The method getRepresentedProducts() returns the actual products that is conforming the query and is represented by the search hit. Depending on the hit typ, getRepresentedProducts() returns: HIT_TYPE_SIMPLE -> a simple product HIT_TYPE_PRODUCT_MASTER -> a variation product HIT_TYPE_PRODUCT_SET -> a product part of set HIT_TYPE_PRODUCT_BUNDLE -> a product part of a bundle HIT_TYPE_VARIATION_GROUP -> a variation product The ProductSearchHit type can be retrieved by method getHitType() and contains the following types: HIT_TYPE_SIMPLE HIT_TYPE_PRODUCT_MASTER HIT_TYPE_PRODUCT_SET HIT_TYPE_PRODUCT_BUNDLE HIT_TYPE_VARIATION_GROUP The method getProduct() returns the presentation product corresponding to the ProductSearchHit type. HIT_TYPE_SIMPLE -> a simple product HIT_TYPE_PRODUCT_MASTER -> a variation master product HIT_TYPE_PRODUCT_SET -> a product set HIT_TYPE_PRODUCT_BUNDLE -> a product bundle HIT_TYPE_VARIATION_GROUP ->a variation group Example: Given a product master P1 called "Sweater" with attributes color and size that has the following variants: V1 - color: red, size: small V2 - color: red, size: large V3 - color: blue, size: small V4 - color: blue, size: large V5 - color: yellow, size: small V6 - color: yellow, size: large A search for "red sweater" should hit the first two variants, V1 and V2 that are both red. The ProductSearchHit for this result encompass the master and the red variants but not the other non-relevant variants. The variants hit by the query can be retrieved by getRepresentedProducts(), returning a list that contains the two red sweater variants. The master product "Sweater" is returned by getProduct(). Furthermore, to get the first or last of that list of variants hit by the query we can call getFirstRepresentedProduct() or getLastRepresentedProduct(). The product with the highest sort rank is returned first, and the product with the lowest sort rank is returned last. The product sort rank depends on the sorting conditions used for the search query.

## Constants

### HIT_TYPE_PRODUCT_BUNDLE

**Type:** String = "bundle"

Constant representing a product search hit type based on the presentation product of a hit. This hit type is used with product bundles.

### HIT_TYPE_PRODUCT_MASTER

**Type:** String = "master"

Constant representing a product search hit type based on the presentation product of a hit. This hit type is used with master products.

### HIT_TYPE_PRODUCT_SET

**Type:** String = "set"

Constant representing a product search hit type based on the presentation product of a hit. This hit type is used with product sets.

### HIT_TYPE_SIMPLE

**Type:** String = "product"

Constant representing a product search hit type based on the presentation product of a hit. This hit type is used with single, non-complex products, including product variants that are assigned to a category and are returned as the presentation product.

### HIT_TYPE_SLICING_GROUP

**Type:** String = "slicing_group"

Constant representing a product search hit type based on the presentation product of a hit. This hit type is used with slicing groups.

### HIT_TYPE_VARIATION_GROUP

**Type:** String = "variation_group"

Constant representing a product search hit type based on the presentation product of a hit. This hit type is used with variation groups.

## Properties

### allPromotionIDs

**Type:** List (Read Only)

Return the IDs of all searchable promotions for which at least one of the represented products of this search hit
 relates to the promotion, either as qualifying, discount, or bonus product. This may be used as a better
 performing alternative to PromotionPlan.getProductPromotions(Product) in some special cases.
 However be warned: this method has no additional checks and currently returns all id's which are known at
 indexing time. Custom code should generally filter and sort the promotions returned by this method according to
 PromotionMgr.getActiveCustomerPromotions() before messaging the promotions on a product tile.

### bonusPromotionIDs

**Type:** List (Read Only)

Return the IDs of all searchable promotions for which at least one of the represented products of this search hit
 is a bonus product. This may be used as a better performing alternative to
 PromotionPlan.getProductPromotions(Product) in some special cases. However be warned: this
 method has no additional checks and currently returns all id's which are known at indexing time. Custom code
 should generally filter and sort the promotions returned by this method according to
 PromotionMgr.getActiveCustomerPromotions() before messaging the promotions on a product tile.

### discountedPromotionIDs

**Type:** List (Read Only)

Return the IDs of all searchable promotions for which at least one of the represented products of this search hit
 satisfy the discounted product rule. This may be used as a better performing alternative to
 PromotionPlan.getProductPromotionsForDiscountedProduct(Product) in some special cases.
 However be warned: this method has no additional checks and currently returns all id's which are known at
 indexing time. Custom code should generally filter and sort the promotions returned by this method according to
 PromotionMgr.getActiveCustomerPromotions() before messaging the promotions on a product tile.

### firstRepresentedProduct

**Type:** Product (Read Only)

The product that is actually hit by the search and has the highest
 sort rank according to the sorting conditions used for the search query.

### firstRepresentedProductID

**Type:** String (Read Only)

The ID of the product that is actually hit by the search and has the highest
 sort rank according to the sorting conditions used for the search query.

### hitType

**Type:** String (Read Only)

The type of the product wrapped by this search hit. The product type returned will be one of the hit types: 
 
  HIT_TYPE_SIMPLE
  HIT_TYPE_PRODUCT_MASTER
  HIT_TYPE_PRODUCT_BUNDLE
  HIT_TYPE_PRODUCT_SET
  HIT_TYPE_SLICING_GROUP
  HIT_TYPE_VARIATION_GROUP

### lastRepresentedProduct

**Type:** Product (Read Only)

The product that is actually hit by the search and has the lowest
 sort rank according to the sorting conditions used for the search query.

### lastRepresentedProductID

**Type:** String (Read Only)

The ID of the product that is actually hit by the search and has the lowest
 sort rank according to the sorting conditions used for the search query.

### maxPrice

**Type:** Money (Read Only)

The maximum price of all products represented by the
 product hit. See getRepresentedProducts() for details on
 the set of products used for finding the maximum. The method returns
 N/A in case no price information can be found.
 
 Note: The method uses price information of the search index and therefore
 might return different prices than the ProductPriceModel.

### maxPricePerUnit

**Type:** Money (Read Only)

The maximum price per unit of all products represented by the
 product hit. See getRepresentedProducts() for details on
 the set of products used for finding the maximum. The method returns
 N/A in case no price information can be found.
 
 Note: The method uses price information of the search index and therefore
 might return different prices than the ProductPriceModel.

### minPrice

**Type:** Money (Read Only)

The minimum price of all products represented by the
 product hit. See getRepresentedProducts() for details on
 the set of products used for finding the minimum. The method returns
 N/A in case no price information can be found.
 
 Note: the method uses price information of the search index and therefore
 might return different prices than the ProductPriceModel.

### minPricePerUnit

**Type:** Money (Read Only)

The minimum price per unit of all products represented by the
 product hit. See getRepresentedProducts() for details on
 the set of products used for finding the minimum. The method returns
 N/A in case no price information can be found.
 
 Note: the method uses price information of the search index and therefore
 might return different prices than the ProductPriceModel.

### priceRange

**Type:** getRepresentedProducts() (Read Only)

Convenience method to check whether this ProductSearchHit represents
 multiple products (see getRepresentedProducts()) that have
 different prices.

### product

**Type:** Product (Read Only)

The presentation product of this ProductSearchHit corresponding to the ProductSearchHit type.
 
      HIT_TYPE_SIMPLE -> a simple product 
      HIT_TYPE_PRODUCT_MASTER -> a variation master product
      HIT_TYPE_PRODUCT_SET -> a product set
      HIT_TYPE_PRODUCT_BUNDLE -> a product bundle
      HIT_TYPE_VARIATION_GROUP ->a variation group
 

 To retrieve the product(s) actually hit by the search use getRepresentedProducts().

### productID

**Type:** String (Read Only)

The ID of the presentation product of this ProductSearchHit corresponding to the ProductSearchHit type.
 
      HIT_TYPE_SIMPLE -> a simple product 
      HIT_TYPE_PRODUCT_MASTER -> a variation master product
      HIT_TYPE_PRODUCT_SET -> a product set
      HIT_TYPE_PRODUCT_BUNDLE -> a product bundle
      HIT_TYPE_VARIATION_GROUP ->a variation group
 

 To retrieve the ID of the product actually hit by the search use getFirstRepresentedProductID() or getLastRepresentedProductID().

### qualifyingPromotionIDs

**Type:** List (Read Only)

Return the IDs of all searchable promotions for which at least one of the represented products of this search hit
 satisfies the qualifying product rule. This may be used as a better performing alternative to
 PromotionPlan.getProductPromotionsForQualifyingProduct(Product) in some special cases.
 However be warned: this method has no additional checks and currently returns all id's which are known at
 indexing time. Custom code should generally filter and sort the promotions returned by this method according to
 PromotionMgr.getActiveCustomerPromotions() before messaging the promotions on a product tile.

### representedProductIDs

**Type:** List (Read Only)

The method returns the actual ID of the product that is conforming the query and is represented by the search hit.
 Depending on the hit typ, it returns the ID of:
  
      HIT_TYPE_SIMPLE -> a simple product 
      HIT_TYPE_PRODUCT_MASTER -> a variation product
      HIT_TYPE_PRODUCT_SET -> a product part of set
      HIT_TYPE_PRODUCT_BUNDLE -> a product part of a bundle
      HIT_TYPE_VARIATION_GROUP ->a variation product
 

 If the method returns multiple products, the product with the highest
 sort rank is returned first, and the product with the lowest sort rank is
 returned last. The product sort rank depends on the sorting conditions
 used for the search query.

### representedProducts

**Type:** List (Read Only)

The method returns the actual product that is conforming the query and is represented by the search hit.
 Depending on the hit typ, getRepresentedProducts() returns:
  
      HIT_TYPE_SIMPLE -> a simple product 
      HIT_TYPE_PRODUCT_MASTER -> a variation product
      HIT_TYPE_PRODUCT_SET -> a product part of set
      HIT_TYPE_PRODUCT_BUNDLE -> a product part of a bundle
      HIT_TYPE_VARIATION_GROUP ->a variation product
 

 If the method returns multiple products, the product with the highest
 sort rank is returned first, and the product with the lowest sort rank is
 returned last. The product sort rank depends on the sorting conditions
 used for the search query.

## Constructor Summary

## Method Summary

### getFirstRepresentedProduct

**Signature:** `getFirstRepresentedProduct() : Product`

Returns the product that is actually hit by the search and has the highest sort rank according to the sorting conditions used for the search query.

### getFirstRepresentedProductID

**Signature:** `getFirstRepresentedProductID() : String`

Returns the ID of the product that is actually hit by the search and has the highest sort rank according to the sorting conditions used for the search query.

### getHitType

**Signature:** `getHitType() : String`

Returns the type of the product wrapped by this search hit.

### getLastRepresentedProduct

**Signature:** `getLastRepresentedProduct() : Product`

Returns the product that is actually hit by the search and has the lowest sort rank according to the sorting conditions used for the search query.

### getLastRepresentedProductID

**Signature:** `getLastRepresentedProductID() : String`

Returns the ID of the product that is actually hit by the search and has the lowest sort rank according to the sorting conditions used for the search query.

### getMaxPrice

**Signature:** `getMaxPrice() : Money`

Returns the maximum price of all products represented by the product hit.

### getMaxPricePerUnit

**Signature:** `getMaxPricePerUnit() : Money`

Returns the maximum price per unit of all products represented by the product hit.

### getMinPrice

**Signature:** `getMinPrice() : Money`

Returns the minimum price of all products represented by the product hit.

### getMinPricePerUnit

**Signature:** `getMinPricePerUnit() : Money`

Returns the minimum price per unit of all products represented by the product hit.

### getProduct

**Signature:** `getProduct() : Product`

Returns the presentation product of this ProductSearchHit corresponding to the ProductSearchHit type.

### getProductID

**Signature:** `getProductID() : String`

Returns the ID of the presentation product of this ProductSearchHit corresponding to the ProductSearchHit type.

### getRepresentedProductIDs

**Signature:** `getRepresentedProductIDs() : List`

The method returns the actual ID of the product that is conforming the query and is represented by the search hit.

### getRepresentedProducts

**Signature:** `getRepresentedProducts() : List`

The method returns the actual product that is conforming the query and is represented by the search hit.

### getRepresentedVariationValues

**Signature:** `getRepresentedVariationValues(va : Object) : List`

This method is only applicable if this ProductSearchHit represents a product variation (see getRepresentedProducts()).

### isPriceRange

**Signature:** `isPriceRange() : boolean`

Convenience method to check whether this ProductSearchHit represents multiple products (see getRepresentedProducts()) that have different prices.

## Method Detail

## Method Details

### getFirstRepresentedProduct

**Signature:** `getFirstRepresentedProduct() : Product`

**Description:** Returns the product that is actually hit by the search and has the highest sort rank according to the sorting conditions used for the search query.

**Returns:**

the first product that is actually hit by the search

**See Also:**

getRepresentedProducts()
getLastRepresentedProduct()

---

### getFirstRepresentedProductID

**Signature:** `getFirstRepresentedProductID() : String`

**Description:** Returns the ID of the product that is actually hit by the search and has the highest sort rank according to the sorting conditions used for the search query.

**Returns:**

the ID of the first product that is actually hit by the search

**See Also:**

getRepresentedProducts()
getLastRepresentedProduct()

---

### getHitType

**Signature:** `getHitType() : String`

**Description:** Returns the type of the product wrapped by this search hit. The product type returned will be one of the hit types: HIT_TYPE_SIMPLE HIT_TYPE_PRODUCT_MASTER HIT_TYPE_PRODUCT_BUNDLE HIT_TYPE_PRODUCT_SET HIT_TYPE_SLICING_GROUP HIT_TYPE_VARIATION_GROUP

**Returns:**

search hit type

---

### getLastRepresentedProduct

**Signature:** `getLastRepresentedProduct() : Product`

**Description:** Returns the product that is actually hit by the search and has the lowest sort rank according to the sorting conditions used for the search query.

**Returns:**

the last product that is actually hit by the search

**See Also:**

getRepresentedProducts()
getLastRepresentedProduct()

---

### getLastRepresentedProductID

**Signature:** `getLastRepresentedProductID() : String`

**Description:** Returns the ID of the product that is actually hit by the search and has the lowest sort rank according to the sorting conditions used for the search query.

**Returns:**

the ID of the last product that is actually hit by the search

**See Also:**

getRepresentedProducts()
getLastRepresentedProduct()

---

### getMaxPrice

**Signature:** `getMaxPrice() : Money`

**Description:** Returns the maximum price of all products represented by the product hit. See getRepresentedProducts() for details on the set of products used for finding the maximum. The method returns N/A in case no price information can be found. Note: The method uses price information of the search index and therefore might return different prices than the ProductPriceModel.

**Returns:**

the maximum price of all products represented by the product hit.

---

### getMaxPricePerUnit

**Signature:** `getMaxPricePerUnit() : Money`

**Description:** Returns the maximum price per unit of all products represented by the product hit. See getRepresentedProducts() for details on the set of products used for finding the maximum. The method returns N/A in case no price information can be found. Note: The method uses price information of the search index and therefore might return different prices than the ProductPriceModel.

**Returns:**

the maximum price per unit of all products represented by the product hit.

---

### getMinPrice

**Signature:** `getMinPrice() : Money`

**Description:** Returns the minimum price of all products represented by the product hit. See getRepresentedProducts() for details on the set of products used for finding the minimum. The method returns N/A in case no price information can be found. Note: the method uses price information of the search index and therefore might return different prices than the ProductPriceModel.

**Returns:**

the minimum price of all products represented by the product hit.

---

### getMinPricePerUnit

**Signature:** `getMinPricePerUnit() : Money`

**Description:** Returns the minimum price per unit of all products represented by the product hit. See getRepresentedProducts() for details on the set of products used for finding the minimum. The method returns N/A in case no price information can be found. Note: the method uses price information of the search index and therefore might return different prices than the ProductPriceModel.

**Returns:**

the minimum price per unit of all products represented by the product hit.

---

### getProduct

**Signature:** `getProduct() : Product`

**Description:** Returns the presentation product of this ProductSearchHit corresponding to the ProductSearchHit type. HIT_TYPE_SIMPLE -> a simple product HIT_TYPE_PRODUCT_MASTER -> a variation master product HIT_TYPE_PRODUCT_SET -> a product set HIT_TYPE_PRODUCT_BUNDLE -> a product bundle HIT_TYPE_VARIATION_GROUP ->a variation group To retrieve the product(s) actually hit by the search use getRepresentedProducts().

**Returns:**

the presentation product of this ProductSearchHit, which is possibly a representative of other related products actually hit by the search.

**See Also:**

getRepresentedProducts()

---

### getProductID

**Signature:** `getProductID() : String`

**Description:** Returns the ID of the presentation product of this ProductSearchHit corresponding to the ProductSearchHit type. HIT_TYPE_SIMPLE -> a simple product HIT_TYPE_PRODUCT_MASTER -> a variation master product HIT_TYPE_PRODUCT_SET -> a product set HIT_TYPE_PRODUCT_BUNDLE -> a product bundle HIT_TYPE_VARIATION_GROUP ->a variation group To retrieve the ID of the product actually hit by the search use getFirstRepresentedProductID() or getLastRepresentedProductID().

**Returns:**

the ID of the presentation product of this ProductSearchHit, that possibly represents a set of related products actually hit by the search.

**See Also:**

getRepresentedProducts()

---

### getRepresentedProductIDs

**Signature:** `getRepresentedProductIDs() : List`

**Description:** The method returns the actual ID of the product that is conforming the query and is represented by the search hit. Depending on the hit typ, it returns the ID of: HIT_TYPE_SIMPLE -> a simple product HIT_TYPE_PRODUCT_MASTER -> a variation product HIT_TYPE_PRODUCT_SET -> a product part of set HIT_TYPE_PRODUCT_BUNDLE -> a product part of a bundle HIT_TYPE_VARIATION_GROUP ->a variation product If the method returns multiple products, the product with the highest sort rank is returned first, and the product with the lowest sort rank is returned last. The product sort rank depends on the sorting conditions used for the search query.

**Returns:**

a sorted list of products represented by the wrapped product.

**See Also:**

getFirstRepresentedProduct()
getLastRepresentedProduct()

---

### getRepresentedProducts

**Signature:** `getRepresentedProducts() : List`

**Description:** The method returns the actual product that is conforming the query and is represented by the search hit. Depending on the hit typ, getRepresentedProducts() returns: HIT_TYPE_SIMPLE -> a simple product HIT_TYPE_PRODUCT_MASTER -> a variation product HIT_TYPE_PRODUCT_SET -> a product part of set HIT_TYPE_PRODUCT_BUNDLE -> a product part of a bundle HIT_TYPE_VARIATION_GROUP ->a variation product If the method returns multiple products, the product with the highest sort rank is returned first, and the product with the lowest sort rank is returned last. The product sort rank depends on the sorting conditions used for the search query.

**Returns:**

a sorted list of products represented by the wrapped product.

**See Also:**

getFirstRepresentedProduct()
getLastRepresentedProduct()

---

### getRepresentedVariationValues

**Signature:** `getRepresentedVariationValues(va : Object) : List`

**Description:** This method is only applicable if this ProductSearchHit represents a product variation (see getRepresentedProducts()). It returns the distinct value set for the specified variation attribute for all variants represented by this ProductSearchHit. The values are returned in the same order as they are defined for the variation. This method will accept a ProductVariationAttribute parameter or a String which is the ID of a variation attribute. If any other object type is passed, or null is passed, an exception will be thrown. If this ProductSearchHit does not represent a product variation, or the passed variation attribute is not associated with this product, the method returns an empty list.

**Parameters:**

- `va`: the product variation attribute, specified as either a ProductVariationAttribute or a String which is the ID of a variation attribute associated with this product.

**Returns:**

a list containing all distinct ProductVariationAttributeValues.

---

### isPriceRange

**Signature:** `isPriceRange() : boolean`

**Description:** Convenience method to check whether this ProductSearchHit represents multiple products (see getRepresentedProducts()) that have different prices.

**Returns:**

true if the represented products form a price range false otherwise.

---
```

--------------------------------------------------------------------------------
/docs/dw_extensions.payments/SalesforcePaymentsMgr.md:
--------------------------------------------------------------------------------

```markdown
## Package: dw.extensions.payments

# Class SalesforcePaymentsMgr

## Inheritance Hierarchy

- Object
  - dw.extensions.payments.SalesforcePaymentsMgr

## Description

Contains functionality for use with Salesforce Payments. See Salesforce Payments documentation for how to gain access and configure it for use on your sites.

## Constants

### CANCELLATION_REASON_ABANDONED

**Type:** String = "abandoned"

Cancellation reason indicating customer abandoned payment.

### CANCELLATION_REASON_DUPLICATE

**Type:** String = "duplicate"

Cancellation reason indicating payment intent was a duplicate.

### CANCELLATION_REASON_FRAUDULENT

**Type:** String = "fraudulent"

Cancellation reason indicating payment was fraudulent.

### CANCELLATION_REASON_REQUESTED_BY_CUSTOMER

**Type:** String = "requested_by_customer"

Cancellation reason indicating customer action or request.

### REFUND_REASON_DUPLICATE

**Type:** String = "duplicate"

Refund reason indicating payment intent was a duplicate.

### REFUND_REASON_FRAUDULENT

**Type:** String = "fraudulent"

Refund reason indicating payment was fraudulent.

### REFUND_REASON_REQUESTED_BY_CUSTOMER

**Type:** String = "requested_by_customer"

Refund reason indicating customer action or request.

## Properties

### paymentsSiteConfig

**Type:** SalesforcePaymentsSiteConfiguration (Read Only)

A payments site configuration object for the current site.

## Constructor Summary

## Method Summary

### attachPaymentMethod

**Signature:** `static attachPaymentMethod(paymentMethod : SalesforcePaymentMethod, customer : Customer) : void`

Attaches the given payment method to the given customer.

### cancelPaymentIntent

**Signature:** `static cancelPaymentIntent(paymentIntent : SalesforcePaymentIntent, paymentIntentProperties : Object) : Status`

Cancels the given payment intent.

### capturePaymentIntent

**Signature:** `static capturePaymentIntent(paymentIntent : SalesforcePaymentIntent, amount : Money) : Status`

Captures funds for the given payment intent.

### confirmPaymentIntent

**Signature:** `static confirmPaymentIntent(order : Order, paymentMethod : SalesforcePaymentMethod, paymentIntentProperties : Object) : Status`

Confirms a new payment intent using the given payment method, and associates it with the given order.

### createPaymentIntent

**Signature:** `static createPaymentIntent(basket : Basket, shipment : Shipment, zoneId : String, amount : Money, stripeCustomerRequired : boolean, paymentIntentProperties : Object) : Status`

Creates a payment intent using the given information, and associates it with the given basket.

### detachPaymentMethod

**Signature:** `static detachPaymentMethod(paymentMethod : SalesforcePaymentMethod) : void`

Detaches the given payment method from its associated customer.

### getAttachedPaymentMethods

**Signature:** `static getAttachedPaymentMethods(customer : Customer) : Collection`

Returns a collection containing the payment methods attached to the given customer.

### getOffSessionPaymentMethods

**Signature:** `static getOffSessionPaymentMethods(customer : Customer) : Collection`

Returns a collection containing the payment methods for the given customer set up for future off session reuse.

### getPaymentDetails

**Signature:** `static getPaymentDetails(paymentInstrument : OrderPaymentInstrument) : SalesforcePaymentDetails`

Returns the details to the Salesforce Payments payment associated with the given payment instrument, or null if the given payment instrument has none.

### getPaymentIntent

**Signature:** `static getPaymentIntent(basket : Basket) : SalesforcePaymentIntent`

Returns the payment intent for the given basket, or null if the given basket has none.

### getPaymentIntent

**Signature:** `static getPaymentIntent(order : Order) : SalesforcePaymentIntent`

Returns the payment intent for the given order, or null if the given order has none.

### getPaymentsSiteConfig

**Signature:** `static getPaymentsSiteConfig() : SalesforcePaymentsSiteConfiguration`

Returns a payments site configuration object for the current site.

### getPayPalOrder

**Signature:** `static getPayPalOrder(basket : Basket) : SalesforcePayPalOrder`

Returns the PayPal order for the given basket, or null if the given basket has none.

### getPayPalOrder

**Signature:** `static getPayPalOrder(order : Order) : SalesforcePayPalOrder`

Returns the PayPal order for the given order, or null if the given order has none.

### getSavedPaymentMethods

**Signature:** `static getSavedPaymentMethods(customer : Customer) : Collection`

Returns a collection containing the payment methods saved to be presented to the given customer for reuse in checkouts.

### onCustomerRegistered

**Signature:** `static onCustomerRegistered(order : Order) : void`

Handles the account registration of the shopper who placed the given order.

### refundPaymentIntent

**Signature:** `static refundPaymentIntent(paymentIntent : SalesforcePaymentIntent, amount : Money, refundProperties : Object) : Status`

Refunds previously captured funds for the given payment intent.

### removeSavedPaymentMethod

**Signature:** `static removeSavedPaymentMethod(paymentMethod : SalesforcePaymentMethod) : void`

Removes the given saved payment method so that it is no longer presented to the given customer for reuse in checkouts.

### savePaymentMethod

**Signature:** `static savePaymentMethod(customer : Customer, paymentMethod : SalesforcePaymentMethod) : void`

Saves the given payment method to be presented to the given customer for reuse in subsequent checkouts.

### setPaymentDetails

**Signature:** `static setPaymentDetails(paymentInstrument : OrderPaymentInstrument, paymentDetails : SalesforcePaymentDetails) : void`

Sets the details to the Salesforce Payments payment associated with the given payment instrument.

### updatePaymentIntent

**Signature:** `static updatePaymentIntent(paymentIntent : SalesforcePaymentIntent, shipment : Shipment, amount : Money, orderNo : String, paymentIntentProperties : Object) : Status`

Updates the provided information in the given payment intent.

## Method Detail

## Method Details

### attachPaymentMethod

**Signature:** `static attachPaymentMethod(paymentMethod : SalesforcePaymentMethod, customer : Customer) : void`

**Description:** Attaches the given payment method to the given customer. Use this method to attach a payment method of type SalesforcePaymentMethod.TYPE_CARD to a shopper who registers as a customer after placing an order, and has affirmatively elected to save their card as part of the registration process. This method will throw an error if passed incompatible payment method and/or customer objects.

**Deprecated:**

use onCustomerRegistered(Order) and savePaymentMethod(Customer, SalesforcePaymentMethod)

**Parameters:**

- `paymentMethod`: payment method to attach to customer
- `customer`: customer whose payment method to attach

**Throws:**

Exception - if there was an error attaching the payment method to the customer

---

### cancelPaymentIntent

**Signature:** `static cancelPaymentIntent(paymentIntent : SalesforcePaymentIntent, paymentIntentProperties : Object) : Status`

**Description:** Cancels the given payment intent. If a payment authorization has been made for the payment intent, the authorization is removed. The payment intent must be in a status that supports cancel. See the Stripe documentation for more details. The following Payment Intent property is supported: cancellationReason - optional payment intent cancellation reason

**Parameters:**

- `paymentIntent`: payment intent to capture
- `paymentIntentProperties`: additional properties to pass to the create Payment Intent API

**Returns:**

Status 'OK' or 'ERROR'. Status detail 'paymentintent' contains the payment intent, if it is available in the Stripe response. Status detail 'error' contains the Stripe error information, if it is available in the response.

**See Also:**

CANCELLATION_REASON_ABANDONED
CANCELLATION_REASON_DUPLICATE
CANCELLATION_REASON_FRAUDULENT
CANCELLATION_REASON_REQUESTED_BY_CUSTOMER

**Throws:**

Exception - if there was an error canceling the payment intent

---

### capturePaymentIntent

**Signature:** `static capturePaymentIntent(paymentIntent : SalesforcePaymentIntent, amount : Money) : Status`

**Description:** Captures funds for the given payment intent. The payment intent must be in a status that supports capture. See the Stripe documentation for more details. If amount is not specified, the default is the full amount available to capture. If specified, the amount must be less than or equal to the amount available to capture.

**Parameters:**

- `paymentIntent`: payment intent to capture
- `amount`: optional amount to capture, defaults to amount available to capture

**Returns:**

Status 'OK' or 'ERROR'. Status detail 'error' contains the Stripe error information, if it is available in the response.

**Throws:**

Exception - if there was an error capturing the payment intent

---

### confirmPaymentIntent

**Signature:** `static confirmPaymentIntent(order : Order, paymentMethod : SalesforcePaymentMethod, paymentIntentProperties : Object) : Status`

**Description:** Confirms a new payment intent using the given payment method, and associates it with the given order. The order must be prepared to contain products, shipments, and any other necessary data, and must be calculated to reflect the correct total amounts. If the order is not for the same Customer as the given payment method, an error is thrown. The specified payment method must be set up for off session future use or an error is thrown. iDeal and Bancontact implement reuse differently than other payment methods, but they can't be reused themselves. The following Payment Intent properties are supported: statementDescriptor - optional statement descriptor cardCaptureAutomatic - optional true if the credit card payment should be automatically captured at the time of the sale, or false if the credit card payment should be captured later If cardCaptureAutomatic is provided it is used to determine card capture timing, and otherwise the default card capture timing set for the site is used. If statementDescriptor is provided it is used as the complete description that appears on your customers' statements for the payment, and if not a default statement descriptor is used. If a default statement descriptor is set for the site it is used as the default, and otherwise the default statement descriptor for the account will apply.

**Parameters:**

- `order`: order to pay using Salesforce Payments
- `paymentMethod`: payment method to use to pay
- `paymentIntentProperties`: additional properties to pass to the create Payment Intent API

**Returns:**

Status 'OK' or 'ERROR'. Status detail 'paymentintent' contains the payment intent, if it is available in the Stripe response. Status detail 'error' contains the Stripe error information, if it is available in the response.

**Throws:**

Exception - if the parameter validation failed or there's an error confirming the payment intent

---

### createPaymentIntent

**Signature:** `static createPaymentIntent(basket : Basket, shipment : Shipment, zoneId : String, amount : Money, stripeCustomerRequired : boolean, paymentIntentProperties : Object) : Status`

**Description:** Creates a payment intent using the given information, and associates it with the given basket. The following Payment Intent properties are supported: type - required payment method type, such as SalesforcePaymentMethod.TYPE_CARD statementDescriptor - optional statement descriptor cardCaptureAutomatic - optional true if the credit card payment should be automatically captured at the time of the sale, or false if the credit card payment should be captured later The stripeCustomerRequired must be set to true if the payment will be set up for future usage, whether on session or off session. If true then if a Stripe Customer is associated with the shopper then it will be used, and otherwise a new Stripe Customer will be created. The new Stripe Customer will be associated with the shopper if logged into a registered customer account for the site. If cardCaptureAutomatic is provided it is used to determine card capture timing, and otherwise the default card capture timing set for the site is used. If statementDescriptor is provided it is used as the complete description that appears on your customers' statements for the payment, and if not a default statement descriptor is used. If a default statement descriptor is set for the site it is used as the default, and otherwise the default statement descriptor for the account will apply.

**Parameters:**

- `basket`: basket to checkout and pay using Salesforce Payments
- `shipment`: shipment to use for shipping information in the payment intent
- `zoneId`: id of the payment zone
- `amount`: payment amount
- `stripeCustomerRequired`: true if a Stripe Customer must be associated with the payment intent, and would be created if it doesn't already exist, or false if a Stripe Customer does not have to be associated with the payment intent
- `paymentIntentProperties`: properties to pass to the create Payment Intent API

**Returns:**

Status 'OK' or 'ERROR'. Status detail 'paymentintent' contains the payment intent, if it is available in the Stripe response. Status detail 'error' contains the Stripe error information, if it is available in the response.

---

### detachPaymentMethod

**Signature:** `static detachPaymentMethod(paymentMethod : SalesforcePaymentMethod) : void`

**Description:** Detaches the given payment method from its associated customer. Once detached the payment method remains associated with payment intents in the payment account, but is no longer saved for use by the customer in future orders.

**Deprecated:**

use removeSavedPaymentMethod(SalesforcePaymentMethod)

**Parameters:**

- `paymentMethod`: payment method to detach from customer

**Throws:**

Exception - if there was an error detaching the payment method from its customer

---

### getAttachedPaymentMethods

**Signature:** `static getAttachedPaymentMethods(customer : Customer) : Collection`

**Description:** Returns a collection containing the payment methods attached to the given customer. The collection will be empty if there are no payment methods attached to the customer, or there was an error retrieving the attached payment methods.

**Deprecated:**

use getSavedPaymentMethods(Customer)

**Parameters:**

- `customer`: customer whose payment methods to get

**Returns:**

collection of attached payment methods

**Throws:**

Exception - if the given customer is null or undefined

---

### getOffSessionPaymentMethods

**Signature:** `static getOffSessionPaymentMethods(customer : Customer) : Collection`

**Description:** Returns a collection containing the payment methods for the given customer set up for future off session reuse. The collection will be empty if there are no off session payment methods for the customer, or there was an error retrieving the off session payment methods.

**Parameters:**

- `customer`: customer whose off session payment methods to get

**Returns:**

collection of off session payment methods

**Throws:**

Exception - if the given customer is null or undefined, or there is an error getting the off session payment methods

---

### getPaymentDetails

**Signature:** `static getPaymentDetails(paymentInstrument : OrderPaymentInstrument) : SalesforcePaymentDetails`

**Description:** Returns the details to the Salesforce Payments payment associated with the given payment instrument, or null if the given payment instrument has none.

**Parameters:**

- `paymentInstrument`: payment instrument

**Returns:**

The payment details

**Throws:**

Exception - if paymentInstrument is null

---

### getPaymentIntent

**Signature:** `static getPaymentIntent(basket : Basket) : SalesforcePaymentIntent`

**Description:** Returns the payment intent for the given basket, or null if the given basket has none.

**Parameters:**

- `basket`: basket to checkout and pay using Salesforce Payments

**Returns:**

The payment intent

**Throws:**

Exception - if there was an error retrieving the payment intent for the basket

---

### getPaymentIntent

**Signature:** `static getPaymentIntent(order : Order) : SalesforcePaymentIntent`

**Description:** Returns the payment intent for the given order, or null if the given order has none.

**Parameters:**

- `order`: order paid using Salesforce Payments

**Returns:**

The payment intent

**Throws:**

Exception - if there was an error retrieving the payment intent for the order

---

### getPaymentsSiteConfig

**Signature:** `static getPaymentsSiteConfig() : SalesforcePaymentsSiteConfiguration`

**Description:** Returns a payments site configuration object for the current site.

**Returns:**

a payments site configuration or null if no payments site configuration found

**Throws:**

Exception - if there is no current site

---

### getPayPalOrder

**Signature:** `static getPayPalOrder(basket : Basket) : SalesforcePayPalOrder`

**Description:** Returns the PayPal order for the given basket, or null if the given basket has none.

**Parameters:**

- `basket`: basket to checkout and pay using Salesforce Payments

**Returns:**

The PayPal order

**Throws:**

Exception - if there was an error retrieving the PayPal order for the basket

---

### getPayPalOrder

**Signature:** `static getPayPalOrder(order : Order) : SalesforcePayPalOrder`

**Description:** Returns the PayPal order for the given order, or null if the given order has none.

**Parameters:**

- `order`: order paid using Salesforce Payments

**Returns:**

The PayPal order

**Throws:**

Exception - if there was an error retrieving the PayPal order for the order

---

### getSavedPaymentMethods

**Signature:** `static getSavedPaymentMethods(customer : Customer) : Collection`

**Description:** Returns a collection containing the payment methods saved to be presented to the given customer for reuse in checkouts. The collection will be empty if there are no payment methods saved for the customer, or there was an error retrieving the saved payment methods.

**Parameters:**

- `customer`: customer whose saved payment methods to get

**Returns:**

collection of saved payment methods

**Throws:**

Exception - if the given customer is null or undefined, or there is an error getting the saved payment methods

---

### onCustomerRegistered

**Signature:** `static onCustomerRegistered(order : Order) : void`

**Description:** Handles the account registration of the shopper who placed the given order. Use this method to ensure the registered customer profile is associated with the order in Salesforce Payments.

**Parameters:**

- `order`: order paid using Salesforce Payments

**Throws:**

Exception - if there was an error attaching the payment method to the customer

---

### refundPaymentIntent

**Signature:** `static refundPaymentIntent(paymentIntent : SalesforcePaymentIntent, amount : Money, refundProperties : Object) : Status`

**Description:** Refunds previously captured funds for the given payment intent. The payment intent must be in a state that supports refund. This includes its status as well as any previous refunds. See the Stripe documentation for more details. The following Payment Intent property is supported: reason - optional payment intent refund reason If amount is not specified, the default is the full amount available to refund. If specified, the amount must be less than or equal to the amount available to refund.

**Parameters:**

- `paymentIntent`: payment intent to refund
- `amount`: optional amount to refund, defaults to amount previously captured
- `refundProperties`: additional properties to pass to the refund API

**Returns:**

Status 'OK' or 'ERROR'. Status detail 'error' contains the Stripe error information, if it is available in the response.

**See Also:**

REFUND_REASON_DUPLICATE
REFUND_REASON_FRAUDULENT
REFUND_REASON_REQUESTED_BY_CUSTOMER

**Throws:**

Exception - if there was an error refunding the payment intent

---

### removeSavedPaymentMethod

**Signature:** `static removeSavedPaymentMethod(paymentMethod : SalesforcePaymentMethod) : void`

**Description:** Removes the given saved payment method so that it is no longer presented to the given customer for reuse in checkouts. The payment method remains in the payment account, but is no longer saved for use by the customer.

**Parameters:**

- `paymentMethod`: payment method to detach from customer

**Throws:**

Exception - if there was an error removing the saved payment method from its customer

---

### savePaymentMethod

**Signature:** `static savePaymentMethod(customer : Customer, paymentMethod : SalesforcePaymentMethod) : void`

**Description:** Saves the given payment method to be presented to the given customer for reuse in subsequent checkouts. This method will throw an error if passed incompatible payment method and/or customer objects.

**Parameters:**

- `customer`: customer for which to save the payment method
- `paymentMethod`: payment method to save for the customer

**Throws:**

Exception - if there was an error saving the payment method for the customer

---

### setPaymentDetails

**Signature:** `static setPaymentDetails(paymentInstrument : OrderPaymentInstrument, paymentDetails : SalesforcePaymentDetails) : void`

**Description:** Sets the details to the Salesforce Payments payment associated with the given payment instrument.

**Parameters:**

- `paymentInstrument`: payment instrument
- `paymentDetails`: payment details

**See Also:**

SalesforcePaymentMethod.getPaymentDetails(OrderPaymentInstrument)
SalesforcePayPalOrder.getPaymentDetails(OrderPaymentInstrument)

**Throws:**

Exception - if either paymentInstrument or paymentDetails is null

---

### updatePaymentIntent

**Signature:** `static updatePaymentIntent(paymentIntent : SalesforcePaymentIntent, shipment : Shipment, amount : Money, orderNo : String, paymentIntentProperties : Object) : Status`

**Description:** Updates the provided information in the given payment intent. The payment intent must be in a status that supports update. See the Stripe documentation for more details. The following Payment Intent properties are supported: statementDescriptor - optional statement descriptor cardCaptureAutomatic - optional true if the credit card payment should be automatically captured at the time of the sale, or false if the credit card payment should be captured later If cardCaptureAutomatic is provided it is used to determine card capture timing, and otherwise the default card capture timing set for the site is used. If statementDescriptor is provided it is used as the complete description that appears on your customers' statements for the payment, and if not a default statement descriptor is used. If a default statement descriptor is set for the site it is used as the default, and otherwise the default statement descriptor for the account will apply.

**Parameters:**

- `paymentIntent`: payment intent to update
- `shipment`: optional shipment to use to update shipping information in the payment intent
- `amount`: optional new payment amount
- `orderNo`: optional order no of Order to associate with the payment intent in metadata
- `paymentIntentProperties`: optional additional properties to pass to the update Payment Intent API

**Returns:**

Status 'OK' or 'ERROR'. Status detail 'paymentintent' contains the payment intent, if it is available in the Stripe response. Status detail 'error' contains the Stripe error information, if it is available in the response.

**Throws:**

Exception - if the parameter validation failed or there's an error updating the payment intent

---
```

--------------------------------------------------------------------------------
/docs/dw_order/Basket.md:
--------------------------------------------------------------------------------

```markdown
## Package: dw.order

# Class Basket

## Inheritance Hierarchy

- Object
  - dw.object.PersistentObject
  - dw.object.ExtensibleObject
    - dw.order.LineItemCtnr
      - dw.order.Basket

## Description

The Basket class represents a shopping cart.

## Properties

### agentBasket

**Type:** BasketMgr.createAgentBasket() (Read Only)

Returns if the basket was created by an agent.
 
 An agent basket is created by an agent on behalf of the customer in comparison to a storefront basket which is
 created by the customer e.g. in the storefront. An agent basket can be created with
 BasketMgr.createAgentBasket().

### inventoryReservationExpiry

**Type:** Date (Read Only)

The timestamp when the inventory for this basket expires.
 
 It will return null for the following reasons:
 
 No reservation for the basket was done
 Reservation is outdated meaning the timestamp is in the past
 
 
 
 Please note that the expiry timestamp will not always be valid for the whole basket. It will not be valid for
 new items added or items whose quantity has changed after the reservation was done.

### orderBeingEdited

**Type:** Order (Read Only)

The order that this basket represents if the basket is being used to edit an order, otherwise this method
 returns null. Baskets created via BasketMgr.createBasketFromOrder(Order) will create a reference
 to the order that was used to create this basket (please check limitations around basket accessibility in
 BasketMgr.createBasketFromOrder(Order)).

### orderNoBeingEdited

**Type:** String (Read Only)

The number of the order that this basket represents if the basket is being used to edit an order,
 otherwise this method returns null. Baskets created via BasketMgr.createBasketFromOrder(Order)
 will create a reference to the order that was used to create this basket (please check limitations around basket
 accessibility in BasketMgr.createBasketFromOrder(Order)).

### taxRoundedAtGroup

**Type:** boolean (Read Only)

Use this method to check if the Basket was calculated with grouped taxation calculation.
 
 If the tax is rounded on group level, the tax is applied to the summed-up tax basis for each tax rate.

### temporary

**Type:** BasketMgr.createTemporaryBasket() (Read Only)

Returns if the basket is temporary.
 
 Temporary baskets are separate from shopper storefront and agent baskets, and are intended for use to perform
 calculations or create an order without disturbing a shopper's open storefront basket. A temporary basket can be
 created with BasketMgr.createTemporaryBasket().

## Constructor Summary

## Method Summary

### getInventoryReservationExpiry

**Signature:** `getInventoryReservationExpiry() : Date`

Returns the timestamp when the inventory for this basket expires.

### getOrderBeingEdited

**Signature:** `getOrderBeingEdited() : Order`

Returns the order that this basket represents if the basket is being used to edit an order, otherwise this method returns null.

### getOrderNoBeingEdited

**Signature:** `getOrderNoBeingEdited() : String`

Returns the number of the order that this basket represents if the basket is being used to edit an order, otherwise this method returns null.

### isAgentBasket

**Signature:** `isAgentBasket() : boolean`

Returns if the basket was created by an agent.

### isTaxRoundedAtGroup

**Signature:** `isTaxRoundedAtGroup() : boolean`

Use this method to check if the Basket was calculated with grouped taxation calculation.

### isTemporary

**Signature:** `isTemporary() : boolean`

Returns if the basket is temporary.

### releaseInventory

**Signature:** `releaseInventory() : Status`

Releases all inventory previously reserved for this basket.

### reserveInventory

**Signature:** `reserveInventory() : Status`

Reserves inventory for all items in this basket for 10 minutes.

### reserveInventory

**Signature:** `reserveInventory(reservationDurationInMinutes : Number) : Status`

Reserves inventory for all items in this basket for a specified amount of minutes.

### reserveInventory

**Signature:** `reserveInventory(reservationDurationInMinutes : Number, removeIfNotAvailable : boolean) : Status`

Reserves inventory for all items in this basket for a specified amount of minutes.

### setBusinessType

**Signature:** `setBusinessType(aType : Number) : void`

Set the type of the business this order has been placed in. Possible values are LineItemCtnr.BUSINESS_TYPE_B2C or LineItemCtnr.BUSINESS_TYPE_B2B.

### setChannelType

**Signature:** `setChannelType(aType : Number) : void`

Set the channel type in which sales channel this order has been created.

### setCustomerNo

**Signature:** `setCustomerNo(customerNo : String) : void`

Sets the customer number of the customer associated with this container.

### startCheckout

**Signature:** `startCheckout() : void`

Register a "start checkout" event for the current basket.

### updateCurrency

**Signature:** `updateCurrency() : void`

Updates the basket currency if different to session currency, otherwise does nothing.

## Method Detail

## Method Details

### getInventoryReservationExpiry

**Signature:** `getInventoryReservationExpiry() : Date`

**Description:** Returns the timestamp when the inventory for this basket expires. It will return null for the following reasons: No reservation for the basket was done Reservation is outdated meaning the timestamp is in the past Please note that the expiry timestamp will not always be valid for the whole basket. It will not be valid for new items added or items whose quantity has changed after the reservation was done.

**Returns:**

the inventory reservation expiry timestamp or null

---

### getOrderBeingEdited

**Signature:** `getOrderBeingEdited() : Order`

**Description:** Returns the order that this basket represents if the basket is being used to edit an order, otherwise this method returns null. Baskets created via BasketMgr.createBasketFromOrder(Order) will create a reference to the order that was used to create this basket (please check limitations around basket accessibility in BasketMgr.createBasketFromOrder(Order)).

**Returns:**

the order that this basket represents if the basket is being used to edit an order, otherwise this method returns null.

---

### getOrderNoBeingEdited

**Signature:** `getOrderNoBeingEdited() : String`

**Description:** Returns the number of the order that this basket represents if the basket is being used to edit an order, otherwise this method returns null. Baskets created via BasketMgr.createBasketFromOrder(Order) will create a reference to the order that was used to create this basket (please check limitations around basket accessibility in BasketMgr.createBasketFromOrder(Order)).

**Returns:**

the number of the order that this basket represents if the basket is being used to edit an order, otherwise this method returns null.

---

### isAgentBasket

**Signature:** `isAgentBasket() : boolean`

**Description:** Returns if the basket was created by an agent. An agent basket is created by an agent on behalf of the customer in comparison to a storefront basket which is created by the customer e.g. in the storefront. An agent basket can be created with BasketMgr.createAgentBasket().

**Returns:**

true if the basket was created by an agent otherwise false

---

### isTaxRoundedAtGroup

**Signature:** `isTaxRoundedAtGroup() : boolean`

**Description:** Use this method to check if the Basket was calculated with grouped taxation calculation. If the tax is rounded on group level, the tax is applied to the summed-up tax basis for each tax rate.

**Returns:**

true if the Basket was calculated with grouped taxation

---

### isTemporary

**Signature:** `isTemporary() : boolean`

**Description:** Returns if the basket is temporary. Temporary baskets are separate from shopper storefront and agent baskets, and are intended for use to perform calculations or create an order without disturbing a shopper's open storefront basket. A temporary basket can be created with BasketMgr.createTemporaryBasket().

**Returns:**

true if the basket is temporary otherwise false

---

### releaseInventory

**Signature:** `releaseInventory() : Status`

**Description:** Releases all inventory previously reserved for this basket. The method implements its own transaction handling. Calling the method from inside a transaction is disallowed and results in an exception being thrown. This behavior differs when calling the method from an OCAPI hook. OCAPI hooks handle transactions themselves, so in this case there is also no need to do any transaction handling, but to ensure the shortest possible locking of the inventory this method should only be called as the last step in the OCAPI hook.

**Returns:**

a Status instance with - Status.OK if release inventory was successful, otherwise Status.ERROR.

---

### reserveInventory

**Signature:** `reserveInventory() : Status`

**Description:** Reserves inventory for all items in this basket for 10 minutes. Any reservations created by previous calls of this method will be reset to 10 minutes. The method can be used to reserve basket items before checkout to ensure that inventory is still available at the time an order is created from the basket using OrderMgr.createOrder(Basket). If all or some basket items are not reserved before creating an order, OrderMgr.createOrder(Basket) will validate item availability and will fail if any item is unavailable. Calling this method in the same request as OrderMgr.createOrder(Basket) is unnecessary and discouraged for performance reasons. The maximum quantity that can be reserved at one time is equal to the ATS (Available To Sell) quantity. (See ProductInventoryRecord.getATS().) When using B2C Commerce inventory, reserving basket inventory does not reduce ATS. In this case, converting the basket to an order reduces ATS by the reserved amount. For example, consider a product with an ATS quantity of 5 and no reservations. If a basket reserves a quantity of 3, then other baskets still see an ATS of 5 but can only reserve a quantity of 2. When using Omnichannel Inventory, reserving basket inventory reduces ATS. In this case, converting the basket to an order doesn't reduce ATS. In the previous example, after the first basket reserved a quantity of 3, other baskets would see an ATS of 2. Reservations can only be made for products with an inventory record. The reservation of product bundles is controlled by the Use Bundle Inventory Only setting on the inventory list. The setting allows inventory to be reserved for just the bundle or for the bundle and its bundled products. The following conditions must be met for the method to succeed: an inventory list must be assigned to the current site all products in the basket must exist, and must not be of type Master or ProductSet each product line item must have a valid quantity each product must have an inventory record, or the inventory list must define that products without inventory record are available by default the reservation must succeed for each item as described above. The method implements its own transaction handling. Calling the method from inside a transaction is disallowed and results in an exception being thrown. This behavior differs when calling the method from an OCAPI hook. OCAPI hooks handle transactions themselves, so in this case there is also no need to do any transaction handling, but to ensure the shortest possible locking of the inventory this method should only be called as the last step in the OCAPI hook. If the reservation fails with an ERROR status, existing valid reservations for the basket will remain unchanged but no new reservations will be made. This might lead to a partially reserved basket. Behaves same as reserveInventory( null, false );. This method must not be used with the CreateOrder2 pipelet, or OrderMgr.createOrder(Basket), or OrderMgr.createOrder(Basket, String) in the same request.

**Returns:**

a Status instance with - Status.OK if all items could be reserved, otherwise Status.ERROR meaning no items were reserved.

---

### reserveInventory

**Signature:** `reserveInventory(reservationDurationInMinutes : Number) : Status`

**Description:** Reserves inventory for all items in this basket for a specified amount of minutes. Any reservations created by previous calls of this method will be reset to that amount of minutes. The method can be used to reserve basket items before checkout to ensure that inventory is still available at the time an order is created from the basket using OrderMgr.createOrder(Basket). If all or some basket items are not reserved before creating an order, OrderMgr.createOrder(Basket) will validate item availability and will fail if any item is unavailable. Calling this method in the same request as OrderMgr.createOrder(Basket) is unnecessary and discouraged for performance reasons. The maximum quantity that can be reserved at one time is equal to the ATS (Available To Sell) quantity. (See ProductInventoryRecord.getATS().) When using B2C Commerce inventory, reserving basket inventory does not reduce ATS. In this case, converting the basket to an order reduces ATS by the reserved amount. For example, consider a product with an ATS quantity of 5 and no reservations. If a basket reserves a quantity of 3, then other baskets still see an ATS of 5 but can only reserve a quantity of 2. When using Omnichannel Inventory, reserving basket inventory reduces ATS. In this case, converting the basket to an order doesn't reduce ATS. In the previous example, after the first basket reserved a quantity of 3, other baskets would see an ATS of 2. Reservations can only be made for products with an inventory record. The reservation of product bundles is controlled by the Use Bundle Inventory Only setting on the inventory list. The setting allows inventory to be reserved for just the bundle or for the bundle and its bundled products. The following conditions must be met for the method to succeed: an inventory list must be assigned to the current site all products in the basket must exist, and must not be of type Master or ProductSet each product line item must have a valid quantity each product must have an inventory record, or the inventory list must define that products without inventory record are available by default the reservation must succeed for each item as described above. The method implements its own transaction handling. Calling the method from inside a transaction is disallowed and results in an exception being thrown. This behavior differs when calling the method from an OCAPI hook. OCAPI hooks handle transactions themselves, so in this case there is also no need to do any transaction handling, but to ensure the shortest possible locking of the inventory this method should only be called as the last step in the OCAPI hook. getInventoryReservationExpiry() can be used to determine when the expiration will expire. If the reservation fails with an ERROR status, existing valid reservations for the basket will remain unchanged but no new reservations will be made. This might lead to a partially reserved basket. Behaves same as reserveInventory( reservationDurationInMinutes, false );. This method must not be used with the CreateOrder2 pipelet, or OrderMgr.createOrder(Basket), or OrderMgr.createOrder(Basket, String) in the same request.

**Parameters:**

- `reservationDurationInMinutes`: reservation duration in minutes, specifying how long the reservation will last. The maximum value for the reservation duration is 240 minutes.

**Returns:**

a Status instance with - Status.OK if all items could be reserved, otherwise Status.ERROR meaning no items were reserved.

---

### reserveInventory

**Signature:** `reserveInventory(reservationDurationInMinutes : Number, removeIfNotAvailable : boolean) : Status`

**Description:** Reserves inventory for all items in this basket for a specified amount of minutes. Any reservations created by previous calls of this method will be reset to that amount of minutes. The method can be used to reserve basket items before checkout to ensure that inventory is still available at the time an order is created from the basket using OrderMgr.createOrder(Basket). If all or some basket items are not reserved before creating an order, OrderMgr.createOrder(Basket) will validate item availability and will fail if any item is unavailable. Calling this method in the same request as OrderMgr.createOrder(Basket) is unnecessary and discouraged for performance reasons. The maximum quantity that can be reserved at one time is equal to the ATS (Available To Sell) quantity. (See ProductInventoryRecord.getATS().) When using B2C Commerce inventory, reserving basket inventory does not reduce ATS. In this case, converting the basket to an order reduces ATS by the reserved amount. For example, consider a product with an ATS quantity of 5 and no reservations. If a basket reserves a quantity of 3, then other baskets still see an ATS of 5 but can only reserve a quantity of 2. When using Omnichannel Inventory, reserving basket inventory reduces ATS. In this case, converting the basket to an order doesn't reduce ATS. In the previous example, after the first basket reserved a quantity of 3, other baskets would see an ATS of 2. Reservations can only be made for products with an inventory record. The reservation of product bundles is controlled by the Use Bundle Inventory Only setting on the inventory list. The setting allows inventory to be reserved for just the bundle or for the bundle and its bundled products. The following conditions must be met for the method to succeed: an inventory list must be assigned to the current site all products in the basket must exist, and must not be of type Master or ProductSet each product line item must have a valid quantity each product must have an inventory record, or the inventory list must define that products without inventory record are available by default the reservation must succeed for each item as described above or removeIfNotAvailable is set to true The method implements its own transaction handling. Calling the method from inside a transaction is disallowed and results in an exception being thrown. This behavior differs when calling the method from an OCAPI hook. OCAPI hooks handle transactions themselves, so in this case there is also no need to do any transaction handling, but to ensure the shortest possible locking of the inventory this method should only be called as the last step in the OCAPI hook. getInventoryReservationExpiry() can be used to determine when the expiration will expire. If the reservation fails with an ERROR status, existing valid reservations for the basket will remain unchanged but no new reservations will be made. This might lead to a partially reserved basket. If the reservation succeeds with an OK status and removeIfNotAvailable is true, basket line items quantities might have been changed or line items might have been removed. The returned Status object will contain information about the changes. Possible values for StatusItem.getCode() are: BUNDLE_REMOVED - a bundle item was removed completely ITEM_REMOVED - a product line item was removed completely ITEM_QUANTITY_REDUCED - the quantity of a line item was reduced StatusItem.getDetails() will contain for each item the sku and uuid of the item which was changed/removed. This method must not be used with the CreateOrder2 pipelet, or OrderMgr.createOrder(Basket), or OrderMgr.createOrder(Basket, String) in the same request.

**Parameters:**

- `reservationDurationInMinutes`: reservation duration in minutes, specifying how long the reservation will last. The maximum value for the reservation duration is 240 minutes.
- `removeIfNotAvailable`: if true is specified it will not fail if not the full quantity of the items can be reserved. Item quantity will be reduced to the quantity that could be reserved. Item will be removed if not at least quantity 1 for the item could be reserved. Different to that if a bundle line item cannot be reserved completely it will be removed including dependent line item (bundled items).

**Returns:**

a Status instance with - Status.OK meaning reservation process was successful. In case of removeIfNotAvailable is true, status might contain status items (Status.getItems()) for each item that needed to be changed or removed. In the worst case this could result in an empty basket and no items reserved. A Status instance with - Status.ERROR will be returned if removeIfNotAvailable is false and not all items could be reserved fully or any unexpected error occurred.

---

### setBusinessType

**Signature:** `setBusinessType(aType : Number) : void`

**Description:** Set the type of the business this order has been placed in. Possible values are LineItemCtnr.BUSINESS_TYPE_B2C or LineItemCtnr.BUSINESS_TYPE_B2B.

**Parameters:**

- `aType`: the business type to set for this basket

---

### setChannelType

**Signature:** `setChannelType(aType : Number) : void`

**Description:** Set the channel type in which sales channel this order has been created. This can be used to distinguish order placed through e.g. Storefront, Call Center or Marketplace. Possible values are LineItemCtnr.CHANNEL_TYPE_STOREFRONT, LineItemCtnr.CHANNEL_TYPE_CALLCENTER, LineItemCtnr.CHANNEL_TYPE_MARKETPLACE, LineItemCtnr.CHANNEL_TYPE_DSS, LineItemCtnr.CHANNEL_TYPE_STORE, LineItemCtnr.CHANNEL_TYPE_PINTEREST, LineItemCtnr.CHANNEL_TYPE_TWITTER, LineItemCtnr.CHANNEL_TYPE_FACEBOOKADS, LineItemCtnr.CHANNEL_TYPE_SUBSCRIPTIONS, LineItemCtnr.CHANNEL_TYPE_ONLINERESERVATION, LineItemCtnr.CHANNEL_TYPE_INSTAGRAMCOMMERCE, LineItemCtnr.CHANNEL_TYPE_GOOGLE, LineItemCtnr.CHANNEL_TYPE_YOUTUBE, LineItemCtnr.CHANNEL_TYPE_TIKTOK, LineItemCtnr.CHANNEL_TYPE_SNAPCHAT, LineItemCtnr.CHANNEL_TYPE_WHATSAPP The value for LineItemCtnr.CHANNEL_TYPE_CUSTOMERSERVICECENTER is also available, but it can not be set by the scripting API, it is set only internally.

**Parameters:**

- `aType`: the channel type to set for this basket

---

### setCustomerNo

**Signature:** `setCustomerNo(customerNo : String) : void`

**Description:** Sets the customer number of the customer associated with this container. Note this method has little effect as it only sets the customer number and it does not re-link the basket with a customer profile object, nor is the number copied into the Order should one be created from the basket. Use Order.setCustomer(Customer) instead for a registered customer. For a guest customer the customerNo is usually generated during order creation and the attribute is set at order level.

**Deprecated:**

The method has been deprecated. Please use Order.setCustomer(Customer) instead for registered customer. For guest customer the customerNo is usually generated during order creation and the attribute is set at order level.

**Parameters:**

- `customerNo`: the customer number of the customer associated with this container.

---

### startCheckout

**Signature:** `startCheckout() : void`

**Description:** Register a "start checkout" event for the current basket. This event is tracked for AB test statistics but otherwise has no effect on the basket. The system will register at most one checkout per basket per session.

---

### updateCurrency

**Signature:** `updateCurrency() : void`

**Description:** Updates the basket currency if different to session currency, otherwise does nothing. Use Session.setCurrency(Currency) to set the currency for the session. To reflect the session currency change to the basket you need to update the basket with this method. This ensures that any upcoming basket recalculation, which is based on the session currency, matches the basket currency. ... if (basket.getBillingAddress().getCountryCode() == 'DE'){ var newCurrency : Currency = Currency.getCurrency('EUR'); session.setCurrency( newCurrency ); basket.updateCurrency(); } customBasketRecalculate(); ...

---
```

--------------------------------------------------------------------------------
/docs/dw_campaign/Promotion.md:
--------------------------------------------------------------------------------

```markdown
## Package: dw.campaign

# Class Promotion

## Inheritance Hierarchy

- Object
  - dw.object.PersistentObject
  - dw.object.ExtensibleObject
    - dw.campaign.Promotion

## Description

This class represents a promotion in Commerce Cloud Digital. Examples of promotions include: "Get 20% off your order" "$15 off a given product" "free shipping for all orders over $50" Get a bonus product with purchase of another product The Promotion class provides access to the basic attributes of the promotion such as name, callout message, and description, but the details of the promotion rules are not available in the API due to their complexity. Commerce Cloud Digital allows merchants to create a single logical "promotion rule" (e.g. "Get 20% off your order") and then assign it to one or more "containers" where the supported container types are campaigns or AB-tests. A Promotion represents a specific instance of a promotion rule assigned to a container. Promotion rules themselves that are not assigned to any container are inaccessible through the API. Each instance (i.e. assignment) can have separate "qualifiers". Qualifiers are the customer groups, source code groups, or coupons that trigger a given promotion for a customer.

## Constants

### EXCLUSIVITY_CLASS

**Type:** String = "CLASS"

Constant representing promotion exclusivity of type class.

### EXCLUSIVITY_GLOBAL

**Type:** String = "GLOBAL"

Constant representing promotion exclusivity of type global.

### EXCLUSIVITY_NO

**Type:** String = "NO"

Constant representing promotion exclusivity of type no.

### PROMOTION_CLASS_ORDER

**Type:** String = "ORDER"

Constant representing promotion class of type order.

### PROMOTION_CLASS_PRODUCT

**Type:** String = "PRODUCT"

Constant representing promotion class of type product.

### PROMOTION_CLASS_SHIPPING

**Type:** String = "SHIPPING"

Constant representing promotion class of type shipping.

### QUALIFIER_MATCH_MODE_ALL

**Type:** String = "all"

Constant indicating that that all qualifier conditions must be met in order for this promotion to apply for a given customer.

### QUALIFIER_MATCH_MODE_ANY

**Type:** String = "any"

Constant indicating that that at least one qualifier condition must be met in order for this promotion to apply for a given customer.

## Properties

### active

**Type:** boolean (Read Only)

Returns 'true' if promotion is active, otherwise 'false'. 
 A promotion is active if its campaign is active, and the promotion
 is enabled, and it is scheduled for now.

### basedOnCoupon

**Type:** boolean (Read Only)

Returns 'true' if the promotion is triggered by a coupon,
 false otherwise.

### basedOnCoupons

**Type:** boolean (Read Only)

Returns 'true' if the promotion is triggered by coupons,
 false otherwise.

### basedOnCustomerGroups

**Type:** boolean (Read Only)

Returns 'true' if the promotion is triggered by customer groups,
 false otherwise.

### basedOnSourceCodes

**Type:** boolean (Read Only)

Returns 'true' if the promotion is triggered by source codes,
 false otherwise.

### calloutMsg

**Type:** MarkupText (Read Only)

The callout message of the promotion.

### campaign

**Type:** Campaign (Read Only)

The campaign this particular instance of the promotion is defined
 in.
 
 Note: If this promotion is defined as part of an AB-test, then a Campaign
 object will be returned, but it is a mock implementation, and not a true
 Campaign. This behavior is required for backwards compatibility and
 should not be relied upon as it may change in future releases.

### combinablePromotions

**Type:** String (Read Only)

The promotion's combinable promotions. Combinable promotions is a set of promotions or groups this
 promotion can be combined with.

### conditionalDescription

**Type:** MarkupText (Read Only)

A description of the condition that must be met for this
 promotion to be applicable.
 
 The method and the related attribute have been deprecated. Use the
 getDetails() method instead.

### coupons

**Type:** Collection (Read Only)

The coupons directly assigned to the promotion or assigned to the campaign of the promotion. 
 If the promotion is not based on coupons (see isBasedOnCoupons()), or no coupons is assigned to the
 promotion or its campaign, an empty collection is returned.

### custom

**Type:** CustomAttributes (Read Only)

The custom attributes for this extensible object.

### customerGroups

**Type:** Collection (Read Only)

The customer groups directly assigned to the promotion or assigned to the campaign of the promotion. 
 If the promotion is not based on customer groups (see isBasedOnCustomerGroups()), or no customer group is assigned to the
 promotion or its campaign, an empty collection is returned.

### description

**Type:** MarkupText (Read Only)

The description of the promotion.
 
 Method is deprecated and returns the same value as getCalloutMsg().

### details

**Type:** MarkupText (Read Only)

The detailed description of the promotion.

### enabled

**Type:** boolean (Read Only)

Returns true if promotion is enabled, otherwise false.

### endDate

**Type:** Date (Read Only)

The effective end date of this instance of the promotion. If no
 explicit end date is defined for the promotion, the end date of the
 containing Campaign or AB-test is returned.

### exclusivity

**Type:** String (Read Only)

The promotion's exclusivity specifying how the promotion can be
 combined with other promotions.
 Possible values are EXCLUSIVITY_NO, EXCLUSIVITY_CLASS
 and EXCLUSIVITY_GLOBAL.

### ID

**Type:** String (Read Only)

The unique ID of the promotion.

### image

**Type:** MediaFile (Read Only)

The reference to the promotion image.

### lastModified

**Type:** Date (Read Only)

The date that this object was last modified.

### mutuallyExclusivePromotions

**Type:** String (Read Only)

The promotion's mutually exclusive Promotions. Mutually exclusive Promotions is a set of promotions or
 groups this promotion cannot be combined with.

### name

**Type:** String (Read Only)

The name of the promotion.

### promotionClass

**Type:** String (Read Only)

The promotion class indicating the general type of the promotion.
 Possible values are PROMOTION_CLASS_PRODUCT,
 PROMOTION_CLASS_ORDER, and PROMOTION_CLASS_SHIPPING.

### qualifierMatchMode

**Type:** String (Read Only)

The qualifier matching mode specified by this promotion. A
 promotion may have up to 3 qualifier conditions based on whether it is
 customer-group based, coupon based, and/or source-code based. A promotion
 may require for example that a customer belong to a certain customer
 group and also have a certain coupon in the cart in order for the
 promotion to apply. This method returns QUALIFIER_MATCH_MODE_ALL if it is
 necessary that all the qualifier conditions are satisfied in order for
 this promotion to apply for a given customer. Otherwise, this method
 returns QUALIFIER_MATCH_MODE_ANY indicating that at least of the
 qualifier conditions must be satisfied.
 
 Note: currently QUALIFIER_MATCH_MODE_ALL is only supported for promotions
 assigned to campaigns, and not those assigned to AB-tests.

### rank

**Type:** Number (Read Only)

The promotion's rank. Rank is a numeric attribute that you can specify.
 Promotions with a defined rank are calculated before promotions without a defined rank.
 If two promotions have a rank, the one with the lowest rank is calculated first.
 For example, a promotion with rank 10 is calculated before one with rank 30.

### refinable

**Type:** boolean (Read Only)

Returns true if promotion is refinable, otherwise false.

### sourceCodeGroups

**Type:** Collection (Read Only)

The source code groups directly assigned to the promotion or assigned to the campaign of the promotion. 
 If the promotion is not based on source code groups (see isBasedOnSourceCodes()), or no source code group is assigned to the
 promotion or its campaign, an empty collection is returned.

### startDate

**Type:** Date (Read Only)

The effective start date of this instance of the promotion. If no
 explicit start date is defined for this instance, the start date of the
 containing Campaign or AB-test is returned.

### tags

**Type:** String (Read Only)

The promotion's tags. Tags are a way of categorizing and organizing promotions. A promotion can have many
 tags. Tags will be returned in alphabetical order.

## Constructor Summary

## Method Summary

### getCalloutMsg

**Signature:** `getCalloutMsg() : MarkupText`

Returns the callout message of the promotion.

### getCampaign

**Signature:** `getCampaign() : Campaign`

Returns the campaign this particular instance of the promotion is defined in.

### getCombinablePromotions

**Signature:** `getCombinablePromotions() : String[]`

Returns the promotion's combinable promotions.

### getConditionalDescription

**Signature:** `getConditionalDescription() : MarkupText`

Returns a description of the condition that must be met for this promotion to be applicable.

### getCoupons

**Signature:** `getCoupons() : Collection`

Returns the coupons directly assigned to the promotion or assigned to the campaign of the promotion.

### getCustom

**Signature:** `getCustom() : CustomAttributes`

Returns the custom attributes for this extensible object.

### getCustomerGroups

**Signature:** `getCustomerGroups() : Collection`

Returns the customer groups directly assigned to the promotion or assigned to the campaign of the promotion.

### getDescription

**Signature:** `getDescription() : MarkupText`

Returns the description of the promotion.

### getDetails

**Signature:** `getDetails() : MarkupText`

Returns the detailed description of the promotion.

### getEndDate

**Signature:** `getEndDate() : Date`

Returns the effective end date of this instance of the promotion.

### getExclusivity

**Signature:** `getExclusivity() : String`

Returns the promotion's exclusivity specifying how the promotion can be combined with other promotions.

### getID

**Signature:** `getID() : String`

Returns the unique ID of the promotion.

### getImage

**Signature:** `getImage() : MediaFile`

Returns the reference to the promotion image.

### getLastModified

**Signature:** `getLastModified() : Date`

Returns the date that this object was last modified.

### getMutuallyExclusivePromotions

**Signature:** `getMutuallyExclusivePromotions() : String[]`

Returns the promotion's mutually exclusive Promotions.

### getName

**Signature:** `getName() : String`

Returns the name of the promotion.

### getPromotionalPrice

**Signature:** `getPromotionalPrice(product : Product) : Money`

Returns the promotional price for the specified product.

### getPromotionalPrice

**Signature:** `getPromotionalPrice(product : Product, optionModel : ProductOptionModel) : Money`

This method follows the same logic as getPromotionalPrice(Product) but prices are calculated based on the option values selected in the specified option model.

### getPromotionClass

**Signature:** `getPromotionClass() : String`

Returns the promotion class indicating the general type of the promotion.

### getQualifierMatchMode

**Signature:** `getQualifierMatchMode() : String`

Returns the qualifier matching mode specified by this promotion.

### getRank

**Signature:** `getRank() : Number`

Returns the promotion's rank.

### getSourceCodeGroups

**Signature:** `getSourceCodeGroups() : Collection`

Returns the source code groups directly assigned to the promotion or assigned to the campaign of the promotion.

### getStartDate

**Signature:** `getStartDate() : Date`

Returns the effective start date of this instance of the promotion.

### getTags

**Signature:** `getTags() : String[]`

Returns the promotion's tags.

### isActive

**Signature:** `isActive() : boolean`

Returns 'true' if promotion is active, otherwise 'false'.

### isBasedOnCoupon

**Signature:** `isBasedOnCoupon() : boolean`

Returns 'true' if the promotion is triggered by a coupon, false otherwise.

### isBasedOnCoupons

**Signature:** `isBasedOnCoupons() : boolean`

Returns 'true' if the promotion is triggered by coupons, false otherwise.

### isBasedOnCustomerGroups

**Signature:** `isBasedOnCustomerGroups() : boolean`

Returns 'true' if the promotion is triggered by customer groups, false otherwise.

### isBasedOnSourceCodes

**Signature:** `isBasedOnSourceCodes() : boolean`

Returns 'true' if the promotion is triggered by source codes, false otherwise.

### isEnabled

**Signature:** `isEnabled() : boolean`

Returns true if promotion is enabled, otherwise false.

### isRefinable

**Signature:** `isRefinable() : boolean`

Returns true if promotion is refinable, otherwise false.

## Method Detail

## Method Details

### getCalloutMsg

**Signature:** `getCalloutMsg() : MarkupText`

**Description:** Returns the callout message of the promotion.

**Returns:**

Callout message of the promotion.

---

### getCampaign

**Signature:** `getCampaign() : Campaign`

**Description:** Returns the campaign this particular instance of the promotion is defined in. Note: If this promotion is defined as part of an AB-test, then a Campaign object will be returned, but it is a mock implementation, and not a true Campaign. This behavior is required for backwards compatibility and should not be relied upon as it may change in future releases.

**Returns:**

Campaign of the promotion.

---

### getCombinablePromotions

**Signature:** `getCombinablePromotions() : String[]`

**Description:** Returns the promotion's combinable promotions. Combinable promotions is a set of promotions or groups this promotion can be combined with.

**Returns:**

The promotion's set of combinable promotions.

---

### getConditionalDescription

**Signature:** `getConditionalDescription() : MarkupText`

**Description:** Returns a description of the condition that must be met for this promotion to be applicable. The method and the related attribute have been deprecated. Use the getDetails() method instead.

**Deprecated:**

Use getDetails()

**Returns:**

Condition promotion description.

---

### getCoupons

**Signature:** `getCoupons() : Collection`

**Description:** Returns the coupons directly assigned to the promotion or assigned to the campaign of the promotion. If the promotion is not based on coupons (see isBasedOnCoupons()), or no coupons is assigned to the promotion or its campaign, an empty collection is returned.

**Returns:**

Coupons assigned to promotion in no particular order.

---

### getCustom

**Signature:** `getCustom() : CustomAttributes`

**Description:** Returns the custom attributes for this extensible object.

---

### getCustomerGroups

**Signature:** `getCustomerGroups() : Collection`

**Description:** Returns the customer groups directly assigned to the promotion or assigned to the campaign of the promotion. If the promotion is not based on customer groups (see isBasedOnCustomerGroups()), or no customer group is assigned to the promotion or its campaign, an empty collection is returned.

**Returns:**

Customer groups assigned to promotion in no particular order.

---

### getDescription

**Signature:** `getDescription() : MarkupText`

**Description:** Returns the description of the promotion. Method is deprecated and returns the same value as getCalloutMsg().

**Deprecated:**

Use getCalloutMsg()

**Returns:**

Description of the promotion.

---

### getDetails

**Signature:** `getDetails() : MarkupText`

**Description:** Returns the detailed description of the promotion.

**Returns:**

Detailed promotion description.

---

### getEndDate

**Signature:** `getEndDate() : Date`

**Description:** Returns the effective end date of this instance of the promotion. If no explicit end date is defined for the promotion, the end date of the containing Campaign or AB-test is returned.

**Returns:**

End date of the promotion, or null if no end date is defined.

---

### getExclusivity

**Signature:** `getExclusivity() : String`

**Description:** Returns the promotion's exclusivity specifying how the promotion can be combined with other promotions. Possible values are EXCLUSIVITY_NO, EXCLUSIVITY_CLASS and EXCLUSIVITY_GLOBAL.

**Returns:**

Promotion exclusivity

---

### getID

**Signature:** `getID() : String`

**Description:** Returns the unique ID of the promotion.

**Returns:**

ID of the promotion.

---

### getImage

**Signature:** `getImage() : MediaFile`

**Description:** Returns the reference to the promotion image.

**Returns:**

Image of the promotion.

---

### getLastModified

**Signature:** `getLastModified() : Date`

**Description:** Returns the date that this object was last modified.

**Returns:**

the date that this object was last modified.

---

### getMutuallyExclusivePromotions

**Signature:** `getMutuallyExclusivePromotions() : String[]`

**Description:** Returns the promotion's mutually exclusive Promotions. Mutually exclusive Promotions is a set of promotions or groups this promotion cannot be combined with.

**Returns:**

The promotion's set of mutually exclusive Promotions.

---

### getName

**Signature:** `getName() : String`

**Description:** Returns the name of the promotion.

**Returns:**

Name of the promotion.

---

### getPromotionalPrice

**Signature:** `getPromotionalPrice(product : Product) : Money`

**Description:** Returns the promotional price for the specified product. The promotional price is only returned if the following conditions are met: this promotion is a product promotion without purchase conditions, i.e. is of type 'Without qualifying products'. this promotion's discount is Discount.TYPE_AMOUNT, Discount.TYPE_PERCENTAGE, Discount.TYPE_FIXED_PRICE, or Discount.TYPE_PRICEBOOK_PRICE. specified product is one of the discounted products of the promotion. the product has a valid sales price for quantity 1.0. In all other cases, the method will return Money.NOT_AVAILABLE. It is not required that this promotion be an active customer promotion. NOTE: the method might be extended in the future to support more promotion types. To calculate the promotional price, the method uses the current sales price of the product for quantity 1.0, and applies the discount associated with the promotion to this price. For example, if the product price is $14.99, and the promotion discount is 10%, the method will return $13.49. If the discount is $2 off, the method will return $12.99. If the discount is $10.00 fixed price, the method will return $10.00.

**Parameters:**

- `product`: the product to calculate the discount for

**Returns:**

the price of the passed product after promotional discount is applied, or Money.NOT_AVAILABLE if any of the restrictions on product or promotion are not met.

---

### getPromotionalPrice

**Signature:** `getPromotionalPrice(product : Product, optionModel : ProductOptionModel) : Money`

**Description:** This method follows the same logic as getPromotionalPrice(Product) but prices are calculated based on the option values selected in the specified option model.

**Parameters:**

- `product`: the product to calculate the discount for
- `optionModel`: the option model to use when calculating

**Returns:**

the price of the passed product after promotional discount is applied, or Money.NOT_AVAILABLE if any of the restrictions on product or promotion are not met.

---

### getPromotionClass

**Signature:** `getPromotionClass() : String`

**Description:** Returns the promotion class indicating the general type of the promotion. Possible values are PROMOTION_CLASS_PRODUCT, PROMOTION_CLASS_ORDER, and PROMOTION_CLASS_SHIPPING.

**Returns:**

Promotion class or null if the promotion rule has not been configured.

---

### getQualifierMatchMode

**Signature:** `getQualifierMatchMode() : String`

**Description:** Returns the qualifier matching mode specified by this promotion. A promotion may have up to 3 qualifier conditions based on whether it is customer-group based, coupon based, and/or source-code based. A promotion may require for example that a customer belong to a certain customer group and also have a certain coupon in the cart in order for the promotion to apply. This method returns QUALIFIER_MATCH_MODE_ALL if it is necessary that all the qualifier conditions are satisfied in order for this promotion to apply for a given customer. Otherwise, this method returns QUALIFIER_MATCH_MODE_ANY indicating that at least of the qualifier conditions must be satisfied. Note: currently QUALIFIER_MATCH_MODE_ALL is only supported for promotions assigned to campaigns, and not those assigned to AB-tests.

**Returns:**

the qualifier matching mode specified by this promotion, either QUALIFIER_MATCH_MODE_ALL or QUALIFIER_MATCH_MODE_ANY.

---

### getRank

**Signature:** `getRank() : Number`

**Description:** Returns the promotion's rank. Rank is a numeric attribute that you can specify. Promotions with a defined rank are calculated before promotions without a defined rank. If two promotions have a rank, the one with the lowest rank is calculated first. For example, a promotion with rank 10 is calculated before one with rank 30.

**Returns:**

The promotion's rank.

---

### getSourceCodeGroups

**Signature:** `getSourceCodeGroups() : Collection`

**Description:** Returns the source code groups directly assigned to the promotion or assigned to the campaign of the promotion. If the promotion is not based on source code groups (see isBasedOnSourceCodes()), or no source code group is assigned to the promotion or its campaign, an empty collection is returned.

**Returns:**

Source code groups assigned to promotion in no particular order.

---

### getStartDate

**Signature:** `getStartDate() : Date`

**Description:** Returns the effective start date of this instance of the promotion. If no explicit start date is defined for this instance, the start date of the containing Campaign or AB-test is returned.

**Returns:**

Start date of the promotion, or null if no start date is defined.

---

### getTags

**Signature:** `getTags() : String[]`

**Description:** Returns the promotion's tags. Tags are a way of categorizing and organizing promotions. A promotion can have many tags. Tags will be returned in alphabetical order.

**Returns:**

The promotion's set of tags.

---

### isActive

**Signature:** `isActive() : boolean`

**Description:** Returns 'true' if promotion is active, otherwise 'false'. A promotion is active if its campaign is active, and the promotion is enabled, and it is scheduled for now.

**Returns:**

true if promotion is active, otherwise false.

---

### isBasedOnCoupon

**Signature:** `isBasedOnCoupon() : boolean`

**Description:** Returns 'true' if the promotion is triggered by a coupon, false otherwise.

**Deprecated:**

Use isBasedOnCoupons()

**Returns:**

true if promotion is triggered by coupon, otherwise false.

---

### isBasedOnCoupons

**Signature:** `isBasedOnCoupons() : boolean`

**Description:** Returns 'true' if the promotion is triggered by coupons, false otherwise.

**Returns:**

true if promotion is triggered by coupons, otherwise false.

---

### isBasedOnCustomerGroups

**Signature:** `isBasedOnCustomerGroups() : boolean`

**Description:** Returns 'true' if the promotion is triggered by customer groups, false otherwise.

**Returns:**

true if promotion is triggered by customer groups, otherwise false.

---

### isBasedOnSourceCodes

**Signature:** `isBasedOnSourceCodes() : boolean`

**Description:** Returns 'true' if the promotion is triggered by source codes, false otherwise.

**Returns:**

true if promotion is triggered by source codes, otherwise false.

---

### isEnabled

**Signature:** `isEnabled() : boolean`

**Description:** Returns true if promotion is enabled, otherwise false.

**Returns:**

true if promotion is enabled, otherwise false.

---

### isRefinable

**Signature:** `isRefinable() : boolean`

**Description:** Returns true if promotion is refinable, otherwise false.

**Returns:**

true if promotion is refinable, otherwise false.

---
```

--------------------------------------------------------------------------------
/docs/dw_net/WebDAVClient.md:
--------------------------------------------------------------------------------

```markdown
## Package: dw.net

# Class WebDAVClient

## Inheritance Hierarchy

- Object
  - dw.net.WebDAVClient

## Description

The WebDAVClient class supports the WebDAV methods GET, PUT, MKCOL, MOVE, COPY, PROPFIND,OPTIONS and DELETE. Note: when this class is used with sensitive data, be careful in persisting sensitive information to disk. The client can be used as shown in the following example: var webdavClient : WebDAVClient = new WebDAVClient("http://mywebdav.server.com","myusername", "mypassword"); var getString : String = webdavClient.get("myData.xml","UTF-8"); var message : String; if (webdavClient.succeeded()) { message = webDavClient.statusText; } else { // error handling message="An error occurred with status code "+webdavClient.statusCode; } var data : XML = new XML(getString); The WebDAV client supports the following authentication schemes: Basic authentication Digest authentication The methods of this class do not generally throw exceptions if the underlying WebDAV operation do not succeed.The result of a WebDAV operation can be checked using the methods succeeded(), getStatusCode(), and getStatusText(). Important note: This WebDAV client cannot be used to access the Commerce Cloud Digital server via WebDAV protocol.

## Constants

### DEFAULT_ENCODING

**Type:** String = "UTF-8"

The default encoding character set.

### DEFAULT_GET_FILE_SIZE

**Type:** Number = 5242880

The default size for get() returning a File is 5MB.

### DEFAULT_GET_STRING_SIZE

**Type:** Number = 2097152

The default size for get() returning a String is 2MB.

### DEPTH_0

**Type:** Number = 0

The depth of searching a WebDAV destination using the PROPFIND method - if that depth is given to the PROPFIND method as an input parameter the destination will be searched only on the level of the given path and a list of all containing files on that level will be returned [is not supported by every server].

### DEPTH_1

**Type:** Number = 1

The depth of searching a WebDAV destination using the PROPFIND method - if that depth is given to the PROPFIND method as an input parameter the destination will be searched until one level under the given path and a list of all containing files in that two levels [/path and one level underneath] will be returned [is not supported by every server].

### DEPTH_INIFINITY

**Type:** Number = 2147483647

The depth of searching a WebDAV destination using the PROPFIND method - if that depth is given to the PROPFIND method as an input parameter the destination will be fully searched and a list of all containing files will be returned [is not supported by every server].

### MAX_GET_FILE_SIZE

**Type:** Number = 209715200

The maximum size for get() returning a File is forty times the default size for getting a file. The largest file allowed is 200MB.

### MAX_GET_STRING_SIZE

**Type:** Number = 10485760

The maximum size for get() returning a String is five times the default size for getting a String. The largest String allowed is 10MB.

## Properties

### allResponseHeaders

**Type:** HashMap (Read Only)

A HashMap of all response headers.

### statusCode

**Type:** Number (Read Only)

The status code after the execution of a method.

### statusText

**Type:** String (Read Only)

The status text after the execution of a method.

## Constructor Summary

WebDAVClient(rootUrl : String, username : String, password : String) Creates a new client for the use at a server which requires authentication.

WebDAVClient(rootUrl : String) Creates a new client for the use at a server which does not require authentication.

## Method Summary

### addRequestHeader

**Signature:** `addRequestHeader(headerName : String, headerValue : String) : void`

Adds a request header to the next WebDAV call.

### close

**Signature:** `close() : void`

Closes the current connection to the server.

### copy

**Signature:** `copy(origin : String, destination : String) : boolean`

Copies a file on the server from one place rootUrl/origin to the other rootUrl/destination.

### copy

**Signature:** `copy(origin : String, destination : String, overwrite : boolean) : boolean`

Copies a file on the server from one place rootUrl/origin to the other rootUrl/destination.

### copy

**Signature:** `copy(origin : String, destination : String, overwrite : boolean, shallow : boolean) : boolean`

Copies a file on the server from one place rootUrl/origin to the other rootUrl/destination.

### del

**Signature:** `del(path : String) : boolean`

Deletes a file or directory from the remote server that can be found under rootUrl/path.

### get

**Signature:** `get(path : String) : String`

Reads the content of a remote file or directory that can be found under rootUrl/path and returns a string representation of the data found in the DEFAULT_ENCODING encoding.

### get

**Signature:** `get(path : String, encoding : String) : String`

Reads the content of a remote file or directory that can be found under rootUrl/path and returns a string representation of the data found in the given encoding.

### get

**Signature:** `get(path : String, encoding : String, maxGetSize : Number) : String`

Reads the content of a remote file or directory that can be found under rootUrl/path and returns a string representation of the data found in the given encoding.

### get

**Signature:** `get(path : String, file : File) : boolean`

Reads the content of a remote file or directory that can be found under rootUrl/path in DEFAULT_ENCODING encoding and writes a File in the system's standard encoding, which is "UTF-8".

### get

**Signature:** `get(path : String, file : File, maxFileSize : Number) : boolean`

Reads the content of a remote file or directory that can be found under rootUrl/path in DEFAULT_ENCODING encoding and writes a File in the system's standard encoding, which is "UTF-8".

### get

**Signature:** `get(path : String, file : File, encoding : String, maxFileSize : Number) : boolean`

Reads the content of a remote file or directory that can be found under rootUrl/path in the passed encoding and writes a File in the system standard encoding, which is "UTF-8".

### getAllResponseHeaders

**Signature:** `getAllResponseHeaders() : HashMap`

Returns a HashMap of all response headers.

### getBinary

**Signature:** `getBinary(path : String, file : File) : boolean`

Reads the content of a remote binary file that can be found under rootUrl/path and creates a local copy in File.

### getBinary

**Signature:** `getBinary(path : String, file : File, maxFileSize : Number) : boolean`

Reads the content of a remote binary file that can be found under rootUrl/path and creates a local copy in File.

### getResponseHeader

**Signature:** `getResponseHeader(header : String) : String`

Returns a specified response header - multiple headers are separated by CRLF.

### getStatusCode

**Signature:** `getStatusCode() : Number`

Returns the status code after the execution of a method.

### getStatusText

**Signature:** `getStatusText() : String`

Returns the status text after the execution of a method.

### mkcol

**Signature:** `mkcol(path : String) : boolean`

Creates a directory on the remote server on the location rootUrl/path.

### move

**Signature:** `move(origin : String, destination : String) : boolean`

Moves a file on the server from one place rootUrl + "/" +origin to the other rootUrl/destination.

### move

**Signature:** `move(origin : String, destination : String, overwrite : boolean) : boolean`

Moves a file on the server from one place rootUrl/origin to the other rootUrl/destination Can also be used to rename a remote file.

### options

**Signature:** `options(path : String) : String[]`

Returns a list of methods which can be executed on the server location rootUrl/path.

### propfind

**Signature:** `propfind(path : String) : WebDAVFileInfo[]`

Get file listing of a remote location.

### propfind

**Signature:** `propfind(path : String, depth : Number) : WebDAVFileInfo[]`

Get file listing of a remote location.

### put

**Signature:** `put(path : String, content : String) : boolean`

Puts content encoded with DEFAULT_ENCODING into a remote located file at rootUrl/path.

### put

**Signature:** `put(path : String, content : String, encoding : String) : boolean`

Puts content encoded with the passed encoding into a remote located file at rootUrl/path.

### put

**Signature:** `put(path : String, file : File) : boolean`

Puts content out of a passed local file into a remote located file at rootUrl/path.

### succeeded

**Signature:** `succeeded() : boolean`

Returns true if the last executed WebDAV method was executed successfully - otherwise false.

## Constructor Detail

## Method Detail

## Method Details

### addRequestHeader

**Signature:** `addRequestHeader(headerName : String, headerValue : String) : void`

**Description:** Adds a request header to the next WebDAV call.

**Parameters:**

- `headerName`: name of the header.
- `headerValue`: value of the header.

---

### close

**Signature:** `close() : void`

**Description:** Closes the current connection to the server.

---

### copy

**Signature:** `copy(origin : String, destination : String) : boolean`

**Description:** Copies a file on the server from one place rootUrl/origin to the other rootUrl/destination. If destination already exists it gets overwritten. Returns true if succeeded, otherwise false.

**Parameters:**

- `origin`: The origin where a file is located, relative to the rootUrl stated when instantiating the client.
- `destination`: The destination where the file should be copied to, relative to the rootUrl stated when instantiating the client.

**Returns:**

true if succeeded, otherwise false.

---

### copy

**Signature:** `copy(origin : String, destination : String, overwrite : boolean) : boolean`

**Description:** Copies a file on the server from one place rootUrl/origin to the other rootUrl/destination. If the passed parameter overwrite is true and destination already exists it gets overwritten. Returns true if succeeded, otherwise false.

**Parameters:**

- `origin`: The origin where a file is located, relative to the rootUrl stated when instantiating the client.
- `destination`: The destination where the file should be copied to, relative to the rootUrl stated when instantiating the client.
- `overwrite`: A flag which determines whether the destination gets overwritten if it exists before copying.

**Returns:**

true if succeeded, otherwise false.

---

### copy

**Signature:** `copy(origin : String, destination : String, overwrite : boolean, shallow : boolean) : boolean`

**Description:** Copies a file on the server from one place rootUrl/origin to the other rootUrl/destination. If the passed parameter overwrite is true and destination already exists it gets overwritten. If the passed parameter shallow is true a flat copy mechanism is used. Returns true if succeeded, otherwise false.

**Parameters:**

- `origin`: The origin where a file is located, relative to the rootUrl stated when instantiating the client.
- `destination`: The destination where the file should be copied to, relative to the rootUrl stated when instantiating the client.
- `overwrite`: A flag which determines whether the destination gets overwritten if it exits before copying
- `shallow`: A flag which determines how to copy the given data.

**Returns:**

true if succeeded, otherwise false.

---

### del

**Signature:** `del(path : String) : boolean`

**Description:** Deletes a file or directory from the remote server that can be found under rootUrl/path. Returns true if succeeded, otherwise false.

**Parameters:**

- `path`: The path of the file or collection to delete, relative to the rootUrl stated when instantiating the client.

**Returns:**

true if succeeded, otherwise false.

---

### get

**Signature:** `get(path : String) : String`

**Description:** Reads the content of a remote file or directory that can be found under rootUrl/path and returns a string representation of the data found in the DEFAULT_ENCODING encoding. If the remote location is a directory the result depends on the server configuration, some return an HTML formatted directory listing. Returns at most DEFAULT_GET_STRING_SIZE bytes.

**Parameters:**

- `path`: The path of the collection or file one wants to get, relative to the rootUrl stated when instantiating the client.

**Returns:**

returns the String representation of the data found on the given path.

---

### get

**Signature:** `get(path : String, encoding : String) : String`

**Description:** Reads the content of a remote file or directory that can be found under rootUrl/path and returns a string representation of the data found in the given encoding. If the remote location is a directory the result depends on the server configuration, some return an HTML formatted directory listing. Returns at most DEFAULT_GET_STRING_SIZE bytes.

**Parameters:**

- `path`: The path of the collection or file one wants to get - relative to the rootUrl stated when instantiating the client.
- `encoding`: The encoding of the resulting String.

**Returns:**

returns the String representation of the data found on the given path in the given encoding.

---

### get

**Signature:** `get(path : String, encoding : String, maxGetSize : Number) : String`

**Description:** Reads the content of a remote file or directory that can be found under rootUrl/path and returns a string representation of the data found in the given encoding. If the remote location is a directory the result depends on the server configuration, some return an HTML formatted directory listing. Returns at most maxGetSize bytes.

**Parameters:**

- `path`: The path of the collection or file one wants to get - relative to the rootUrl stated when instantiating the client.
- `encoding`: The encoding of the resulting String.
- `maxGetSize`: The maximum size of data in bytes. Not to exceed MAX_GET_STRING_SIZE.

**Returns:**

returns the String representation of the data found on the given path in the given encoding.

---

### get

**Signature:** `get(path : String, file : File) : boolean`

**Description:** Reads the content of a remote file or directory that can be found under rootUrl/path in DEFAULT_ENCODING encoding and writes a File in the system's standard encoding, which is "UTF-8". If the remote location is a directory the result depends on the server configuration, some return an HTML formatted directory listing. Receives at most DEFAULT_GET_FILE_SIZE bytes which determines the file size of the local file. Returns true if succeeded otherwise false.

**Parameters:**

- `path`: The path of the collection or file one wants to get - relative to the rootUrl stated when instantiating the client.
- `file`: The file to save the received data in.

**Returns:**

returns true if succeeded, otherwise false.

---

### get

**Signature:** `get(path : String, file : File, maxFileSize : Number) : boolean`

**Description:** Reads the content of a remote file or directory that can be found under rootUrl/path in DEFAULT_ENCODING encoding and writes a File in the system's standard encoding, which is "UTF-8". If the remote location is a directory the result depends on the server configuration, some return an HTML formatted directory listing. Receives at most maxFileSize bytes which determines the file size of the local file. Returns true if succeeded, otherwise false.

**Parameters:**

- `path`: The path of the collection or file one wants to get - relative to the rootUrl stated when instantiating the client.
- `file`: The file to save the received data in.
- `maxFileSize`: The maximum size of bytes to stream into the file. Not to exceed MAX_GET_FILE_SIZE.

**Returns:**

returns true if succeeded, otherwise false.

---

### get

**Signature:** `get(path : String, file : File, encoding : String, maxFileSize : Number) : boolean`

**Description:** Reads the content of a remote file or directory that can be found under rootUrl/path in the passed encoding and writes a File in the system standard encoding, which is "UTF-8". If the remote location is a directory the result depends on the server configuration, some return an HTML formatted directory listing. Receives at most maxFileSize bytes which determines the file size of the local file. Returns true if succeeded, otherwise false.

**Parameters:**

- `path`: The path of the collection or file one wants to get - relative to the rootUrl stated when instantiating the client.
- `file`: The file to save the received data in.
- `encoding`: The encoding to use when reading the remote file.
- `maxFileSize`: The maximum number of bytes to stream into the file. Not to exceed MAX_GET_FILE_SIZE.

**Returns:**

returns true if succeeded, otherwise false.

---

### getAllResponseHeaders

**Signature:** `getAllResponseHeaders() : HashMap`

**Description:** Returns a HashMap of all response headers.

**Returns:**

all headers in a HashMap.

---

### getBinary

**Signature:** `getBinary(path : String, file : File) : boolean`

**Description:** Reads the content of a remote binary file that can be found under rootUrl/path and creates a local copy in File. If the remote location is a directory the result depends on the server configuration, some return an HTML formatted directory listing. Copies at most DEFAULT_GET_FILE_SIZE bytes. Returns true if succeeded, otherwise false.

**Parameters:**

- `path`: The path relative to rootUrl on the remote server including the file name.
- `file`: The local file where the received binary data should be stored.

**Returns:**

true if succeeded, otherwise false.

---

### getBinary

**Signature:** `getBinary(path : String, file : File, maxFileSize : Number) : boolean`

**Description:** Reads the content of a remote binary file that can be found under rootUrl/path and creates a local copy in File. If the remote location is a directory the result depends on the server configuration, some return an HTML formatted directory listing. Copies at most maxFileSize bytes. Returns true if succeeded, otherwise false.

**Parameters:**

- `path`: The path relative to rootUrl on the remote server including the file name.
- `file`: The file local file where the received binary data should be stored.
- `maxFileSize`: The maximum number of bytes to stream into the file. Not to exceed MAX_GET_FILE_SIZE.

**Returns:**

true if succeeded, otherwise false.

---

### getResponseHeader

**Signature:** `getResponseHeader(header : String) : String`

**Description:** Returns a specified response header - multiple headers are separated by CRLF.

**Parameters:**

- `header`: The name of the header.

**Returns:**

The header - in case of multiple headers separated by CRLF.

---

### getStatusCode

**Signature:** `getStatusCode() : Number`

**Description:** Returns the status code after the execution of a method.

**Returns:**

the statusCode.

---

### getStatusText

**Signature:** `getStatusText() : String`

**Description:** Returns the status text after the execution of a method.

**Returns:**

the statusText.

---

### mkcol

**Signature:** `mkcol(path : String) : boolean`

**Description:** Creates a directory on the remote server on the location rootUrl/path.

**Parameters:**

- `path`: The path relative to the rootUrl stated when instantiating the client where the new collection should be created.

**Returns:**

true if succeeded, otherwise false.

---

### move

**Signature:** `move(origin : String, destination : String) : boolean`

**Description:** Moves a file on the server from one place rootUrl + "/" +origin to the other rootUrl/destination. If destination already exists it gets overwritten. Can also be used to rename a remote file. Returns true if succeeded, otherwise false.

**Parameters:**

- `origin`: The origin where a file is located, relative to the rootUrl stated when instantiating the client.
- `destination`: The destination where the file should be moved to, relative to the rootUrl stated when instantiating the client.

**Returns:**

true if succeeded, otherwise false.

---

### move

**Signature:** `move(origin : String, destination : String, overwrite : boolean) : boolean`

**Description:** Moves a file on the server from one place rootUrl/origin to the other rootUrl/destination Can also be used to rename a remote file. If overwrite is true and destination already exists it gets overwritten. Returns true if succeeded, otherwise false.

**Parameters:**

- `origin`: The origin where a file is located, relative to the rootUrl stated when instantiating the client.
- `destination`: The destination where the file should be moved to, relative to the rootUrl stated when instantiating the client.
- `overwrite`: A flag which determines whether the destination gets overwritten if it exists before moving.

**Returns:**

true if succeeded, otherwise false.

---

### options

**Signature:** `options(path : String) : String[]`

**Description:** Returns a list of methods which can be executed on the server location rootUrl/path.

**Parameters:**

- `path`: The path relative to the rootUrl stated when instantiating the client one wants to get the options for.

**Returns:**

list of WebDav methods which can be executed on the given path.

---

### propfind

**Signature:** `propfind(path : String) : WebDAVFileInfo[]`

**Description:** Get file listing of a remote location. Returns a list of WebDAVFileInfo objects which contain information about the files and directories located on rootUrl/path and DEPTH_1 (1) level underneath.

**Parameters:**

- `path`: The path relative to the rootUrl stated when instantiating the client where to get information about the containing files from.

**Returns:**

an Array of WebDAVFileInfo objects which hold information about the files located on the server at the location.

---

### propfind

**Signature:** `propfind(path : String, depth : Number) : WebDAVFileInfo[]`

**Description:** Get file listing of a remote location. Returns a list of WebDAVFileInfo objects which contain information about the files and directories located on rootUrl/path and the passed depth underneath.

**Parameters:**

- `path`: The path relative to the rootUrl stated when instantiating the client where to get information about the containing files from.
- `depth`: The level starting from rootUrl down to which the file information gets collected.

**Returns:**

an Array of WebDAVFileInfo objects which hold information about the files located on the server at the location.

---

### put

**Signature:** `put(path : String, content : String) : boolean`

**Description:** Puts content encoded with DEFAULT_ENCODING into a remote located file at rootUrl/path. Returns true if succeeded, otherwise false. If the content of a local file is to be uploaded, please use method put(String, File) instead.

**Parameters:**

- `path`: The path to put given content up to, relative to the rootUrl stated when instantiating the client.
- `content`: The content that has to be pushed on to the server.

**Returns:**

true if succeeded, otherwise false.

---

### put

**Signature:** `put(path : String, content : String, encoding : String) : boolean`

**Description:** Puts content encoded with the passed encoding into a remote located file at rootUrl/path. Returns true if succeeded, otherwise false. If the content of a local file is to be uploaded, please use method put(String, File) instead.

**Parameters:**

- `path`: The path to put a given content up to, relative to the rootUrl stated when instantiating the client.
- `content`: The content that has to be pushed on to a remote location.
- `encoding`: The encoding in which the data should be stored on the server.

**Returns:**

true if succeeded, otherwise false.

---

### put

**Signature:** `put(path : String, file : File) : boolean`

**Description:** Puts content out of a passed local file into a remote located file at rootUrl/path. This method performs a binary file transfer. Returns true if succeeded, otherwise false.

**Parameters:**

- `path`: The path to put given content up to, relative to the rootUrl stated when instantiating the client.
- `file`: The file to push up to the server.

**Returns:**

true if succeeded, otherwise false.

---

### succeeded

**Signature:** `succeeded() : boolean`

**Description:** Returns true if the last executed WebDAV method was executed successfully - otherwise false. See the code snippet above for an example how to use the succeed() method.

**Returns:**

true if the last executed WebDAV method was successful - otherwise false.

**See Also:**

WebDAVClient

---
```
Page 28/43FirstPrevNextLast