This is page 3 of 61. Use http://codebase.md/taurgis/sfcc-dev-mcp?lines=true&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 -------------------------------------------------------------------------------- /docs/dw_suggest/ContentSuggestions.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.suggest 2 | 3 | # Class ContentSuggestions 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.suggest.Suggestions 9 | - dw.suggest.ContentSuggestions 10 | 11 | ## Description 12 | 13 | The content suggestion container provides access to content pages found using the suggested terms as search criteria. The method getSuggestedContent() can be used to get the list of found content pages. Furthermore the list of suggested terms, after processing the original user input search query, is accessible through SearchPhraseSuggestions.getSuggestedTerms() method. 14 | 15 | ## Properties 16 | 17 | ### suggestedContent 18 | 19 | **Type:** Iterator (Read Only) 20 | 21 | This method returns a list of content pages which were found 22 | using the suggested terms as search criteria. 23 | The content lookup is being executed in the current library and locale. 24 | 25 | ## Constructor Summary 26 | 27 | ## Method Summary 28 | 29 | ### getSuggestedContent 30 | 31 | **Signature:** `getSuggestedContent() : Iterator` 32 | 33 | This method returns a list of content pages which were found using the suggested terms as search criteria. 34 | 35 | ## Method Detail 36 | 37 | ## Method Details 38 | 39 | ### getSuggestedContent 40 | 41 | **Signature:** `getSuggestedContent() : Iterator` 42 | 43 | **Description:** This method returns a list of content pages which were found using the suggested terms as search criteria. The content lookup is being executed in the current library and locale. 44 | 45 | **Returns:** 46 | 47 | a iterator containing a SuggestedContent instance for each found content, the iterator might be empty 48 | 49 | **See Also:** 50 | 51 | Suggestions.hasSuggestions() 52 | 53 | --- ``` -------------------------------------------------------------------------------- /docs-site/components/ConfigHero.tsx: -------------------------------------------------------------------------------- ```typescript 1 | import React from 'react'; 2 | import { H1, PageSubtitle } from './Typography'; 3 | 4 | export const ConfigHero: React.FC = () => { 5 | return ( 6 | <div className="text-center mb-14"> 7 | <div className="inline-flex items-center gap-2 bg-gradient-to-r from-blue-600 to-purple-600 text-white px-4 py-2 rounded-full text-sm font-medium mb-6"> 8 | <svg className="w-4 h-4" fill="currentColor" viewBox="0 0 20 20"><path fillRule="evenodd" d="M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z" clipRule="evenodd"/></svg> 9 | Configuration Guide 10 | </div> 11 | <H1 id="configuration" className="text-5xl md:text-6xl font-extrabold bg-gradient-to-r from-gray-900 via-blue-900 to-purple-900 bg-clip-text text-transparent mb-6">Configure in Minutes</H1> 12 | <PageSubtitle className="text-xl md:text-2xl text-gray-600 max-w-4xl mx-auto leading-relaxed"> 13 | Start zero-config. Add credentials only when you need log analysis, system object exploration & code version control. 14 | </PageSubtitle> 15 | </div> 16 | ); 17 | }; 18 | 19 | export default ConfigHero; 20 | ``` -------------------------------------------------------------------------------- /docs/dw_suggest/CategorySuggestions.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.suggest 2 | 3 | # Class CategorySuggestions 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.suggest.Suggestions 9 | - dw.suggest.CategorySuggestions 10 | 11 | ## Description 12 | 13 | The category suggestion container provides access to categories found using the suggested terms as search criteria. The method getSuggestedCategories() can be used to get the list of found categories. Furthermore the list of suggested terms, after processing the original user input search query, is accessible through SearchPhraseSuggestions.getSuggestedTerms() method. 14 | 15 | ## Properties 16 | 17 | ### suggestedCategories 18 | 19 | **Type:** Iterator (Read Only) 20 | 21 | This method returns a list of categories which were found 22 | using the suggested terms as search criteria. 23 | The category lookup is being executed in the current catalog and locale. 24 | 25 | ## Constructor Summary 26 | 27 | ## Method Summary 28 | 29 | ### getSuggestedCategories 30 | 31 | **Signature:** `getSuggestedCategories() : Iterator` 32 | 33 | This method returns a list of categories which were found using the suggested terms as search criteria. 34 | 35 | ## Method Detail 36 | 37 | ## Method Details 38 | 39 | ### getSuggestedCategories 40 | 41 | **Signature:** `getSuggestedCategories() : Iterator` 42 | 43 | **Description:** This method returns a list of categories which were found using the suggested terms as search criteria. The category lookup is being executed in the current catalog and locale. 44 | 45 | **Returns:** 46 | 47 | a iterator containing a SuggestedCategory instance for each found category, the iterator might be empty 48 | 49 | **See Also:** 50 | 51 | Suggestions.hasSuggestions() 52 | 53 | --- ``` -------------------------------------------------------------------------------- /docs/dw_object/ActiveData.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.object 2 | 3 | # Class ActiveData 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.object.PersistentObject 9 | - dw.object.ExtensibleObject 10 | - dw.object.ActiveData 11 | 12 | ## Description 13 | 14 | Represents the active data for an object in Commerce Cloud Digital. 15 | 16 | ## Properties 17 | 18 | ### custom 19 | 20 | **Type:** CustomAttributes (Read Only) 21 | 22 | The custom attributes for this object. The returned object can 23 | only be used for retrieving attribute values, not storing them. See 24 | CustomAttributes for a detailed example of the syntax for 25 | working with custom attributes. 26 | 27 | ### empty 28 | 29 | **Type:** boolean (Read Only) 30 | 31 | Return true if the ActiveData doesn't exist for the object 32 | 33 | ## Constructor Summary 34 | 35 | ## Method Summary 36 | 37 | ### getCustom 38 | 39 | **Signature:** `getCustom() : CustomAttributes` 40 | 41 | Returns the custom attributes for this object. 42 | 43 | ### isEmpty 44 | 45 | **Signature:** `isEmpty() : boolean` 46 | 47 | Return true if the ActiveData doesn't exist for the object 48 | 49 | ## Method Detail 50 | 51 | ## Method Details 52 | 53 | ### getCustom 54 | 55 | **Signature:** `getCustom() : CustomAttributes` 56 | 57 | **Description:** Returns the custom attributes for this object. The returned object can only be used for retrieving attribute values, not storing them. See CustomAttributes for a detailed example of the syntax for working with custom attributes. 58 | 59 | **Returns:** 60 | 61 | the custom attributes for this object. 62 | 63 | --- 64 | 65 | ### isEmpty 66 | 67 | **Signature:** `isEmpty() : boolean` 68 | 69 | **Description:** Return true if the ActiveData doesn't exist for the object 70 | 71 | **Returns:** 72 | 73 | true if ActiveData is empty, false otherwise 74 | 75 | --- ``` -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE/new_tool.md: -------------------------------------------------------------------------------- ```markdown 1 | ## 🔧 New MCP Tool Implementation 2 | 3 | ### Tool Overview 4 | **Tool Name:** `mcp_sfcc-dev_[tool_name]` 5 | **Category:** <!-- SFCC Documentation / Best Practices / Log Analysis / System Objects --> 6 | **Description:** 7 | 8 | ### Implementation Details 9 | - **Client Modified/Created:** 10 | - **New Dependencies:** 11 | - **SFCC APIs Used:** 12 | 13 | ### Tool Schema 14 | ```typescript 15 | // Tool definition schema 16 | { 17 | name: "mcp_sfcc-dev_[tool_name]", 18 | description: "", 19 | inputSchema: { 20 | // Schema details 21 | } 22 | } 23 | ``` 24 | 25 | ### Testing Performed 26 | - [ ] Unit tests for tool handler 27 | - [ ] Integration tests with mock SFCC responses 28 | - [ ] Manual testing in documentation-only mode 29 | - [ ] Manual testing in full mode (if applicable) 30 | - [ ] Error handling validation 31 | - [ ] Parameter validation testing 32 | 33 | ### Documentation Updates 34 | - [ ] Tool added to copilot-instructions.md tool categories 35 | - [ ] README.md feature list updated 36 | - [ ] Tool count updated in both documentation files 37 | - [ ] JSDoc comments added to implementation 38 | - [ ] Usage examples provided 39 | 40 | ### Security Considerations 41 | - [ ] Input validation implemented 42 | - [ ] No sensitive data logged 43 | - [ ] Proper error handling without data leaks 44 | - [ ] Authentication requirements verified 45 | 46 | ### Performance Notes 47 | - [ ] Caching strategy implemented (if applicable) 48 | - [ ] Resource usage reasonable for single-developer workload 49 | - [ ] No blocking operations without proper async handling 50 | 51 | ### Related Issues 52 | Closes # 53 | 54 | --- 55 | **This PR adds a new MCP tool following the project's architecture patterns and security guidelines.** 56 | ``` -------------------------------------------------------------------------------- /src/clients/ocapi/code-versions-client.ts: -------------------------------------------------------------------------------- ```typescript 1 | /** 2 | * OCAPI Code Versions Client 3 | * 4 | * This module handles all SFCC code version related operations including 5 | * retrieving code versions and activating specific versions for deployment management. 6 | */ 7 | 8 | import { OCAPIConfig } from '../../types/types.js'; 9 | import { OCAPIAuthClient } from '../base/ocapi-auth-client.js'; 10 | import { Validator } from '../../utils/validator.js'; 11 | import { buildOCAPIBaseUrl } from '../../utils/ocapi-url-builder.js'; 12 | 13 | /** 14 | * OCAPI Code Versions Client 15 | * Handles code version management operations for SFCC instances 16 | */ 17 | export class OCAPICodeVersionsClient extends OCAPIAuthClient { 18 | constructor(config: OCAPIConfig) { 19 | super(config); 20 | // Override the baseUrl for this specialized client 21 | this.baseUrl = buildOCAPIBaseUrl(config); 22 | } 23 | 24 | /** 25 | * Get all code versions from the SFCC instance 26 | * 27 | * @returns {Promise<any>} Code version result with data array containing version information 28 | */ 29 | async getCodeVersions(): Promise<any> { 30 | return this.get('/code_versions'); 31 | } 32 | 33 | /** 34 | * Activate a specific code version by setting its active flag to true 35 | * 36 | * @param {string} codeVersionId - The ID of the code version to activate 37 | * @returns {Promise<any>} Updated code version object 38 | */ 39 | async activateCodeVersion(codeVersionId: string): Promise<any> { 40 | Validator.validateRequired({ codeVersionId }, ['codeVersionId']); 41 | 42 | const requestBody = { 43 | active: true, 44 | }; 45 | 46 | return this.patch(`/code_versions/${codeVersionId}`, requestBody); 47 | } 48 | } 49 | ``` -------------------------------------------------------------------------------- /docs/TopLevel/Fault.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: TopLevel 2 | 3 | # Class Fault 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - TopLevel.Error 9 | - Fault 10 | 11 | ## Description 12 | 13 | This error indicates an RPC related error in the system. The Fault is always related to a systems internal Java exception. The class provides access to some more details about this internal Java exception. In particular it provides details about the error send from the remote system. 14 | 15 | ## Properties 16 | 17 | ### causeFullName 18 | 19 | **Type:** String 20 | 21 | If the exception is associated with a root cause, the property 22 | contains the full name of the associated Java exception. 23 | 24 | ### causeMessage 25 | 26 | **Type:** String 27 | 28 | If the exception is associated with a root cause, the property 29 | contains the message of the associated Java exception. 30 | 31 | ### causeName 32 | 33 | **Type:** String 34 | 35 | If the exception is associated with a root cause, the property 36 | contains the simplified name of the associated Java exception. 37 | 38 | ### faultActor 39 | 40 | **Type:** String 41 | 42 | Provides some information on who cause the fault along the message 43 | path. 44 | 45 | ### faultCode 46 | 47 | **Type:** String 48 | 49 | An identifier for the specific fault. 50 | 51 | ### faultDetail 52 | 53 | **Type:** String 54 | 55 | More detailed information about the fault. 56 | 57 | ### faultString 58 | 59 | **Type:** String 60 | 61 | A human readable description for the fault. 62 | 63 | ### javaFullName 64 | 65 | **Type:** String 66 | 67 | The full name of the underlying Java exception. 68 | 69 | ### javaMessage 70 | 71 | **Type:** String 72 | 73 | The message of the underlying Java exception. 74 | 75 | ### javaName 76 | 77 | **Type:** String 78 | 79 | The simplified name of the underlying Java exception. 80 | 81 | ## Constructor Summary 82 | 83 | Fault() 84 | 85 | ## Method Summary 86 | 87 | ## Constructor Detail ``` -------------------------------------------------------------------------------- /src/clients/logs/log-constants.ts: -------------------------------------------------------------------------------- ```typescript 1 | /** 2 | * Constants and configuration values for log operations 3 | */ 4 | 5 | export const LOG_CONSTANTS = { 6 | /** Default number of bytes to read from the end of large files */ 7 | DEFAULT_TAIL_BYTES: 200 * 1024, // 200KB 8 | 9 | /** Maximum number of log files to show in listings */ 10 | MAX_LOG_FILES_DISPLAY: 50, 11 | 12 | /** Default search result limit */ 13 | DEFAULT_SEARCH_LIMIT: 20, 14 | 15 | /** Order multiplier for file priority calculation */ 16 | FILE_ORDER_MULTIPLIER: 1000000, 17 | 18 | /** Supported log levels */ 19 | LOG_LEVELS: ['error', 'warn', 'info', 'debug'] as const, 20 | } as const; 21 | 22 | export const LOG_FILE_PATTERNS = { 23 | /** Standard log file pattern (e.g., "error-", "warn-") */ 24 | STANDARD: (level: string) => `${level}-`, 25 | 26 | /** Custom log file pattern (e.g., "customerror-", "customwarn-") */ 27 | CUSTOM: (level: string) => `custom${level}-`, 28 | 29 | /** Job log file pattern (e.g., "Job-") */ 30 | JOB: () => 'Job-', 31 | } as const; 32 | 33 | export const JOB_LOG_CONSTANTS = { 34 | /** Jobs folder path */ 35 | JOBS_FOLDER: '/jobs/', 36 | 37 | /** Default number of job logs to return */ 38 | DEFAULT_JOB_LOG_LIMIT: 10, 39 | 40 | /** Job log file name pattern for matching */ 41 | JOB_LOG_PATTERN: /^Job-.+\.log$/, 42 | } as const; 43 | 44 | export const LOG_MESSAGES = { 45 | NO_FILES_FOUND: (level: string, date: string, available: string) => 46 | `No ${level} log files found for date ${date}. Available files: ${available}`, 47 | 48 | NO_SEARCH_MATCHES: (pattern: string, date: string) => 49 | `No matches found for "${pattern}" in logs for ${date}`, 50 | 51 | SEARCH_RESULTS: (count: number, pattern: string) => 52 | `Found ${count} matches for "${pattern}":`, 53 | } as const; 54 | ``` -------------------------------------------------------------------------------- /src/core/handlers/sfra-handler.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { BaseToolHandler, ToolExecutionContext, GenericToolSpec, HandlerContext, ToolArguments } from './base-handler.js'; 2 | import { SFRAClient } from '../../clients/sfra-client.js'; 3 | import { 4 | SFRA_TOOL_CONFIG, 5 | SFRAToolName, 6 | SFRA_TOOL_NAMES_SET, 7 | } from '../../tool-configs/sfra-tool-config.js'; 8 | 9 | /** 10 | * Handler for SFRA documentation tools using config-driven dispatch 11 | * Provides access to Storefront Reference Architecture documentation 12 | */ 13 | export class SFRAToolHandler extends BaseToolHandler<SFRAToolName> { 14 | private sfraClient: SFRAClient | null = null; 15 | 16 | constructor(context: HandlerContext, subLoggerName: string) { 17 | super(context, subLoggerName); 18 | } 19 | 20 | protected async onInitialize(): Promise<void> { 21 | if (!this.sfraClient) { 22 | this.sfraClient = new SFRAClient(); 23 | this.logger.debug('SFRA client initialized'); 24 | } 25 | } 26 | 27 | protected async onDispose(): Promise<void> { 28 | this.sfraClient = null; 29 | this.logger.debug('SFRA client disposed'); 30 | } 31 | 32 | canHandle(toolName: string): boolean { 33 | return SFRA_TOOL_NAMES_SET.has(toolName as SFRAToolName); 34 | } 35 | 36 | protected getToolNameSet(): Set<SFRAToolName> { 37 | return SFRA_TOOL_NAMES_SET; 38 | } 39 | 40 | protected getToolConfig(): Record<string, GenericToolSpec<ToolArguments, any>> { 41 | return SFRA_TOOL_CONFIG; 42 | } 43 | 44 | protected async createExecutionContext(): Promise<ToolExecutionContext> { 45 | if (!this.sfraClient) { 46 | throw new Error('SFRA client not initialized'); 47 | } 48 | 49 | return { 50 | handlerContext: this.context, 51 | logger: this.logger, 52 | sfraClient: this.sfraClient, 53 | }; 54 | } 55 | } 56 | ``` -------------------------------------------------------------------------------- /docs/TopLevel/ArrayBuffer.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: TopLevel 2 | 3 | # Class ArrayBuffer 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - ArrayBuffer 9 | 10 | ## Description 11 | 12 | The ArrayBuffer represents a generic array of bytes with fixed length. To access and manipulate content, use DataView or a typed array. 13 | 14 | ## Properties 15 | 16 | ### byteLength 17 | 18 | **Type:** Number 19 | 20 | The number of bytes in the array buffer. 21 | 22 | ## Constructor Summary 23 | 24 | ArrayBuffer() Creates an empty array buffer. 25 | 26 | ArrayBuffer(byteLength : Number) Creates an array buffer with the given number of bytes. 27 | 28 | ## Method Summary 29 | 30 | ### isView 31 | 32 | **Signature:** `static isView(object : Object) : boolean` 33 | 34 | Returns if the given object is one of the views for an ArrayBuffer, such as a typed array or a DataView. 35 | 36 | ### slice 37 | 38 | **Signature:** `slice(begin : Number, end : Number) : ArrayBuffer` 39 | 40 | Returns a new array buffer with a copy of the data of this buffer. 41 | 42 | ## Constructor Detail 43 | 44 | ## Method Detail 45 | 46 | ## Method Details 47 | 48 | ### isView 49 | 50 | **Signature:** `static isView(object : Object) : boolean` 51 | 52 | **Description:** Returns if the given object is one of the views for an ArrayBuffer, such as a typed array or a DataView. 53 | 54 | **Parameters:** 55 | 56 | - `object`: The object to check. 57 | 58 | **Returns:** 59 | 60 | true if the passed object is a view to an array buffer else return false. 61 | 62 | --- 63 | 64 | ### slice 65 | 66 | **Signature:** `slice(begin : Number, end : Number) : ArrayBuffer` 67 | 68 | **Description:** Returns a new array buffer with a copy of the data of this buffer. 69 | 70 | **Parameters:** 71 | 72 | - `begin`: Optional. The first included element. 73 | - `end`: Optional. The index of the end. This element is not included. 74 | 75 | **Returns:** 76 | 77 | The new array object. 78 | 79 | --- ``` -------------------------------------------------------------------------------- /docs/dw_extensions.payments/SalesforcePayPalPaymentDetails.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.extensions.payments 2 | 3 | # Class SalesforcePayPalPaymentDetails 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.extensions.payments.SalesforcePaymentDetails 9 | - dw.extensions.payments.SalesforcePayPalPaymentDetails 10 | 11 | ## Description 12 | 13 | Details to a Salesforce Payments payment of type SalesforcePayPalOrder.TYPE_PAYPAL. See Salesforce Payments documentation for how to gain access and configure it for use on your sites. 14 | 15 | ## Properties 16 | 17 | ### captureID 18 | 19 | **Type:** String (Read Only) 20 | 21 | The ID of the capture against the PayPal order, or null if not known. 22 | 23 | ### payerEmailAddress 24 | 25 | **Type:** String (Read Only) 26 | 27 | The email address of the payer for the PayPal order, or null if not known. 28 | 29 | ## Constructor Summary 30 | 31 | ## Method Summary 32 | 33 | ### getCaptureID 34 | 35 | **Signature:** `getCaptureID() : String` 36 | 37 | Returns the ID of the capture against the PayPal order, or null if not known. 38 | 39 | ### getPayerEmailAddress 40 | 41 | **Signature:** `getPayerEmailAddress() : String` 42 | 43 | Returns the email address of the payer for the PayPal order, or null if not known. 44 | 45 | ## Method Detail 46 | 47 | ## Method Details 48 | 49 | ### getCaptureID 50 | 51 | **Signature:** `getCaptureID() : String` 52 | 53 | **Description:** Returns the ID of the capture against the PayPal order, or null if not known. 54 | 55 | **Returns:** 56 | 57 | PayPal order capture ID 58 | 59 | **See Also:** 60 | 61 | SalesforcePayPalOrder.getCaptureID() 62 | 63 | --- 64 | 65 | ### getPayerEmailAddress 66 | 67 | **Signature:** `getPayerEmailAddress() : String` 68 | 69 | **Description:** Returns the email address of the payer for the PayPal order, or null if not known. 70 | 71 | **Returns:** 72 | 73 | payer email address 74 | 75 | **See Also:** 76 | 77 | SalesforcePayPalOrderPayer.getEmailAddress() 78 | 79 | --- ``` -------------------------------------------------------------------------------- /docs/dw_order/CreateCouponLineItemException.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.order 2 | 3 | # Class CreateCouponLineItemException 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - TopLevel.Error 9 | - TopLevel.APIException 10 | - dw.order.CreateCouponLineItemException 11 | 12 | ## Description 13 | 14 | This exception could be thrown by LineItemCtnr.createCouponLineItem(String, Boolean) when the provided coupon code is invalid. 'errorCode' property is set to one of the following values: CouponStatusCodes.COUPON_CODE_ALREADY_IN_BASKET = Indicates that coupon code has already been added to basket. CouponStatusCodes.COUPON_ALREADY_IN_BASKET = Indicates that another code of the same MultiCode/System coupon has already been added to basket. CouponStatusCodes.COUPON_CODE_ALREADY_REDEEMED = Indicates that code of MultiCode/System coupon has already been redeemed. CouponStatusCodes.COUPON_CODE_UNKNOWN = Indicates that coupon not found for given coupon code or that the code itself was not found. CouponStatusCodes.COUPON_DISABLED = Indicates that coupon is not enabled. CouponStatusCodes.REDEMPTION_LIMIT_EXCEEDED = Indicates that number of redemptions per code exceeded. CouponStatusCodes.CUSTOMER_REDEMPTION_LIMIT_EXCEEDED = Indicates that number of redemptions per code and customer exceeded. CouponStatusCodes.TIMEFRAME_REDEMPTION_LIMIT_EXCEEDED = Indicates that number of redemptions per code, customer and time exceeded. CouponStatusCodes.NO_ACTIVE_PROMOTION = Indicates that coupon is not assigned to an active promotion. 15 | 16 | ## Properties 17 | 18 | ### errorCode 19 | 20 | **Type:** String (Read Only) 21 | 22 | Returns one of the error codes listed in the class doc. 23 | 24 | ## Constructor Summary 25 | 26 | ## Method Summary ``` -------------------------------------------------------------------------------- /docs/TopLevel/WeakSet.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: TopLevel 2 | 3 | # Class WeakSet 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - WeakSet 9 | 10 | ## Description 11 | 12 | The WeakSet is set whose elements are subject to garbage collection if there are no more references to the elements. Only objects (no primitives) can be stored. Elements can't be iterated. 13 | 14 | ## Constructor Summary 15 | 16 | WeakSet() Creates an empty Set. 17 | 18 | WeakSet(values : Iterable) If the passed value is null or undefined then an empty set is constructed. 19 | 20 | ## Method Summary 21 | 22 | ### add 23 | 24 | **Signature:** `add(object : Object) : WeakSet` 25 | 26 | Adds an element to the set. 27 | 28 | ### delete 29 | 30 | **Signature:** `delete(object : Object) : boolean` 31 | 32 | Removes the element from the set. 33 | 34 | ### has 35 | 36 | **Signature:** `has(object : Object) : boolean` 37 | 38 | Returns if this set contains the given object. 39 | 40 | ## Constructor Detail 41 | 42 | ## Method Detail 43 | 44 | ## Method Details 45 | 46 | ### add 47 | 48 | **Signature:** `add(object : Object) : WeakSet` 49 | 50 | **Description:** Adds an element to the set. Does nothing if the set already contains the element. 51 | 52 | **Parameters:** 53 | 54 | - `object`: The object to add. 55 | 56 | **Returns:** 57 | 58 | This set object. 59 | 60 | --- 61 | 62 | ### delete 63 | 64 | **Signature:** `delete(object : Object) : boolean` 65 | 66 | **Description:** Removes the element from the set. 67 | 68 | **Parameters:** 69 | 70 | - `object`: The object to be removed. 71 | 72 | **Returns:** 73 | 74 | true if the set contained the object that was removed. Else false is returned. 75 | 76 | --- 77 | 78 | ### has 79 | 80 | **Signature:** `has(object : Object) : boolean` 81 | 82 | **Description:** Returns if this set contains the given object. 83 | 84 | **Parameters:** 85 | 86 | - `object`: The object to look for. 87 | 88 | **Returns:** 89 | 90 | true if the set contains the object else false is returned. 91 | 92 | --- ``` -------------------------------------------------------------------------------- /docs/dw_object/PersistentObject.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.object 2 | 3 | # Class PersistentObject 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.object.PersistentObject 9 | 10 | ## Description 11 | 12 | Common base class for all objects in Commerce Cloud Digital that have an identity and can be stored and retrieved. Each entity is identified by a unique universal identifier (a UUID). 13 | 14 | ## Properties 15 | 16 | ### creationDate 17 | 18 | **Type:** Date (Read Only) 19 | 20 | The date that this object was created. 21 | 22 | ### lastModified 23 | 24 | **Type:** Date (Read Only) 25 | 26 | The date that this object was last modified. 27 | 28 | ### UUID 29 | 30 | **Type:** String (Read Only) 31 | 32 | The unique universal identifier for this object. 33 | 34 | ## Constructor Summary 35 | 36 | ## Method Summary 37 | 38 | ### getCreationDate 39 | 40 | **Signature:** `getCreationDate() : Date` 41 | 42 | Returns the date that this object was created. 43 | 44 | ### getLastModified 45 | 46 | **Signature:** `getLastModified() : Date` 47 | 48 | Returns the date that this object was last modified. 49 | 50 | ### getUUID 51 | 52 | **Signature:** `getUUID() : String` 53 | 54 | Returns the unique universal identifier for this object. 55 | 56 | ## Method Detail 57 | 58 | ## Method Details 59 | 60 | ### getCreationDate 61 | 62 | **Signature:** `getCreationDate() : Date` 63 | 64 | **Description:** Returns the date that this object was created. 65 | 66 | **Returns:** 67 | 68 | the date that this object was created. 69 | 70 | --- 71 | 72 | ### getLastModified 73 | 74 | **Signature:** `getLastModified() : Date` 75 | 76 | **Description:** Returns the date that this object was last modified. 77 | 78 | **Returns:** 79 | 80 | the date that this object was last modified. 81 | 82 | --- 83 | 84 | ### getUUID 85 | 86 | **Signature:** `getUUID() : String` 87 | 88 | **Description:** Returns the unique universal identifier for this object. 89 | 90 | **Returns:** 91 | 92 | the unique universal identifier for this object. 93 | 94 | --- ``` -------------------------------------------------------------------------------- /docs/dw_extensions.pinterest/PinterestOrderHooks.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.extensions.pinterest 2 | 3 | # Class PinterestOrderHooks 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - dw.extensions.pinterest.PinterestOrderHooks 8 | 9 | ## Description 10 | 11 | PinterestOrderHooks interface containing extension points for customizing Pinterest order status. These hooks are not executed in a transaction. The extension points (hook names), and the functions that are called by each extension point. A function must be defined inside a JavaScript source and must be exported. The script with the exported hook function must be located inside a site cartridge. Inside the site cartridge a 'package.json' file with a 'hooks' entry must exist. "hooks": "./hooks.json" The hooks entry links to a json file, relative to the 'package.json' file. This file lists all registered hooks inside the hooks property: "hooks": [ {"name": "dw.extensions.pinterest.order.getStatus", "script": "./hooks.ds"} ] A hook entry has a 'name' and a 'script' property. The 'name' contains the extension point, the hook name. The 'script' contains the script relative to the hooks file, with the exported hook function. 12 | 13 | ## Constants 14 | 15 | ## Properties 16 | 17 | ## Constructor Summary 18 | 19 | ## Method Summary 20 | 21 | ### getStatus 22 | 23 | **Signature:** `getStatus(order : PinterestOrder) : Status` 24 | 25 | Called to retrieve status for the given order. 26 | 27 | ## Method Detail 28 | 29 | ## Method Details 30 | 31 | ### getStatus 32 | 33 | **Signature:** `getStatus(order : PinterestOrder) : Status` 34 | 35 | **Description:** Called to retrieve status for the given order. Return a null status for unknown orders. 36 | 37 | **Parameters:** 38 | 39 | - `order`: the Pinterest order 40 | 41 | **Returns:** 42 | 43 | a non-null Status ends the hook execution 44 | 45 | --- ``` -------------------------------------------------------------------------------- /docs/dw_order/GiftCertificateStatusCodes.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.order 2 | 3 | # Class GiftCertificateStatusCodes 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.order.GiftCertificateStatusCodes 9 | 10 | ## Description 11 | 12 | Helper class containing status codes for the various errors that can occur when redeeming a gift certificate. One of these codes is returned as part of a Status object when a unsuccessful call to the RedeemGiftCertificate pipelet is made. 13 | 14 | ## Constants 15 | 16 | ### GIFTCERTIFICATE_CURRENCY_MISMATCH 17 | 18 | **Type:** String = "GIFTCERTIFICATE_CURRENCY_MISMATCH" 19 | 20 | Indicates that an error occurred because the Gift Certificate was in a different currency than the Basket. 21 | 22 | ### GIFTCERTIFICATE_DISABLED 23 | 24 | **Type:** String = "GIFTCERTIFICATE_DISABLED" 25 | 26 | Indicates that an error occurred because the Gift Certificate is currently disabled. 27 | 28 | ### GIFTCERTIFICATE_INSUFFICIENT_BALANCE 29 | 30 | **Type:** String = "GIFTCERTIFICATE_INSUFFICIENT_BALANCE" 31 | 32 | Indicates that an error occurred because the Gift Certificate does not have a sufficient balance to perform the requested operation. 33 | 34 | ### GIFTCERTIFICATE_NOT_FOUND 35 | 36 | **Type:** String = "GIFTCERTIFICATE_NOT_FOUND" 37 | 38 | Indicates that an error occurred because the Gift Certificate was not found. 39 | 40 | ### GIFTCERTIFICATE_PENDING 41 | 42 | **Type:** String = "GIFTCERTIFICATE_PENDING" 43 | 44 | Indicates that an error occurred because the Gift Certificate is pending and is not available for use. 45 | 46 | ### GIFTCERTIFICATE_REDEEMED 47 | 48 | **Type:** String = "GIFTCERTIFICATE_REDEEMED" 49 | 50 | Indicates that an error occurred because the Gift Certificate has been fully redeemed. 51 | 52 | ## Properties 53 | 54 | ## Constructor Summary 55 | 56 | GiftCertificateStatusCodes() 57 | 58 | ## Method Summary 59 | 60 | ## Constructor Detail ``` -------------------------------------------------------------------------------- /docs/dw_io/XMLStreamConstants.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.io 2 | 3 | # Class XMLStreamConstants 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.io.XMLStreamConstants 9 | 10 | ## Description 11 | 12 | Useful constants for working with XML streams. 13 | 14 | ## Constants 15 | 16 | ### ATTRIBUTE 17 | 18 | **Type:** Number = 10 19 | 20 | Represents an attribute in an element. 21 | 22 | ### CDATA 23 | 24 | **Type:** Number = 12 25 | 26 | Represents a CDATA section in an element. 27 | 28 | ### CHARACTERS 29 | 30 | **Type:** Number = 4 31 | 32 | Represents the character data in an XML document. 33 | 34 | ### COMMENT 35 | 36 | **Type:** Number = 5 37 | 38 | Represents a comment in an XML document. 39 | 40 | ### DTD 41 | 42 | **Type:** Number = 11 43 | 44 | Represents the document type definition. 45 | 46 | ### END_DOCUMENT 47 | 48 | **Type:** Number = 8 49 | 50 | Represents the end of an XML document. 51 | 52 | ### END_ELEMENT 53 | 54 | **Type:** Number = 2 55 | 56 | Represents the end of an element in an XML document. 57 | 58 | ### ENTITY_DECLARATION 59 | 60 | **Type:** Number = 15 61 | 62 | Represents the entity declaration in an XML document. 63 | 64 | ### ENTITY_REFERENCE 65 | 66 | **Type:** Number = 9 67 | 68 | Represents an entity reference in an XML document. 69 | 70 | ### NAMESPACE 71 | 72 | **Type:** Number = 13 73 | 74 | Represents a namespace declaration in an XML document. 75 | 76 | ### NOTATION_DECLARATION 77 | 78 | **Type:** Number = 14 79 | 80 | Represents the notation declaration in an XML document. 81 | 82 | ### PROCESSING_INSTRUCTION 83 | 84 | **Type:** Number = 3 85 | 86 | Represents processing instruction in an XML document. 87 | 88 | ### SPACE 89 | 90 | **Type:** Number = 6 91 | 92 | Represents a space in an XML document. 93 | 94 | ### START_DOCUMENT 95 | 96 | **Type:** Number = 7 97 | 98 | Represents the start of an XML document. 99 | 100 | ### START_ELEMENT 101 | 102 | **Type:** Number = 1 103 | 104 | Represents the start of an element in an XML document. 105 | 106 | ## Properties 107 | 108 | ## Constructor Summary 109 | 110 | XMLStreamConstants() 111 | 112 | ## Method Summary 113 | 114 | ## Constructor Detail ``` -------------------------------------------------------------------------------- /docs/dw_io/Writer.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.io 2 | 3 | # Class Writer 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.io.Writer 9 | 10 | ## Description 11 | 12 | The class supports writing characters to a stream. Note: when this class is used with sensitive data, be careful in persisting sensitive information to disk. 13 | 14 | ## Constructor Summary 15 | 16 | Writer(stream : OutputStream) Create a writer from a stream using UTF-8 character encoding. 17 | 18 | Writer(stream : OutputStream, encoding : String) Create a writer from a stream using the specified character encoding. 19 | 20 | ## Method Summary 21 | 22 | ### close 23 | 24 | **Signature:** `close() : void` 25 | 26 | Closes the writer. 27 | 28 | ### flush 29 | 30 | **Signature:** `flush() : void` 31 | 32 | Flushes the buffer. 33 | 34 | ### write 35 | 36 | **Signature:** `write(str : String) : void` 37 | 38 | Write the given string to the stream. 39 | 40 | ### write 41 | 42 | **Signature:** `write(str : String, off : Number, len : Number) : void` 43 | 44 | Write the given string to the stream. 45 | 46 | ## Constructor Detail 47 | 48 | ## Method Detail 49 | 50 | ## Method Details 51 | 52 | ### close 53 | 54 | **Signature:** `close() : void` 55 | 56 | **Description:** Closes the writer. 57 | 58 | --- 59 | 60 | ### flush 61 | 62 | **Signature:** `flush() : void` 63 | 64 | **Description:** Flushes the buffer. 65 | 66 | --- 67 | 68 | ### write 69 | 70 | **Signature:** `write(str : String) : void` 71 | 72 | **Description:** Write the given string to the stream. 73 | 74 | **Parameters:** 75 | 76 | - `str`: the string to write to the stream. 77 | 78 | --- 79 | 80 | ### write 81 | 82 | **Signature:** `write(str : String, off : Number, len : Number) : void` 83 | 84 | **Description:** Write the given string to the stream. 85 | 86 | **Parameters:** 87 | 88 | - `str`: the string to write to the stream. 89 | - `off`: the offset from which to start writing characters to the stream. 90 | - `len`: the number of characters to write from the stream. 91 | 92 | --- ``` -------------------------------------------------------------------------------- /docs/dw_extensions.payments/SalesforceVenmoPaymentDetails.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.extensions.payments 2 | 3 | # Class SalesforceVenmoPaymentDetails 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.extensions.payments.SalesforcePaymentDetails 9 | - dw.extensions.payments.SalesforceVenmoPaymentDetails 10 | 11 | ## Description 12 | 13 | Details to a Salesforce Payments payment of type SalesforcePayPalOrder.TYPE_VENMO. See Salesforce Payments documentation for how to gain access and configure it for use on your sites. 14 | 15 | ## Properties 16 | 17 | ### captureID 18 | 19 | **Type:** String (Read Only) 20 | 21 | The ID of the capture against the PayPal Venmo order, or null if not known. 22 | 23 | ### payerEmailAddress 24 | 25 | **Type:** String (Read Only) 26 | 27 | The email address of the payer for the PayPal Venmo order, or null if not known. 28 | 29 | ## Constructor Summary 30 | 31 | ## Method Summary 32 | 33 | ### getCaptureID 34 | 35 | **Signature:** `getCaptureID() : String` 36 | 37 | Returns the ID of the capture against the PayPal Venmo order, or null if not known. 38 | 39 | ### getPayerEmailAddress 40 | 41 | **Signature:** `getPayerEmailAddress() : String` 42 | 43 | Returns the email address of the payer for the PayPal Venmo order, or null if not known. 44 | 45 | ## Method Detail 46 | 47 | ## Method Details 48 | 49 | ### getCaptureID 50 | 51 | **Signature:** `getCaptureID() : String` 52 | 53 | **Description:** Returns the ID of the capture against the PayPal Venmo order, or null if not known. 54 | 55 | **Returns:** 56 | 57 | PayPal order capture ID 58 | 59 | **See Also:** 60 | 61 | SalesforcePayPalOrder.getCaptureID() 62 | 63 | --- 64 | 65 | ### getPayerEmailAddress 66 | 67 | **Signature:** `getPayerEmailAddress() : String` 68 | 69 | **Description:** Returns the email address of the payer for the PayPal Venmo order, or null if not known. 70 | 71 | **Returns:** 72 | 73 | payer email address 74 | 75 | **See Also:** 76 | 77 | SalesforcePayPalOrderPayer.getEmailAddress() 78 | 79 | --- ``` -------------------------------------------------------------------------------- /src/core/handlers/docs-handler.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { BaseToolHandler, ToolExecutionContext, GenericToolSpec, ToolArguments, HandlerContext } from './base-handler.js'; 2 | import { SFCCDocumentationClient } from '../../clients/docs-client.js'; 3 | import { DOCS_TOOL_CONFIG, DocToolName, DOC_TOOL_NAMES_SET } from '../../tool-configs/docs-tool-config.js'; 4 | 5 | /** 6 | * Handler for SFCC documentation tools using config-driven dispatch 7 | * Provides access to SFCC class information, search, and documentation 8 | */ 9 | export class DocsToolHandler extends BaseToolHandler<DocToolName> { 10 | private docsClient: SFCCDocumentationClient | null = null; 11 | 12 | constructor(context: HandlerContext, subLoggerName: string) { 13 | super(context, subLoggerName); 14 | } 15 | 16 | protected async onInitialize(): Promise<void> { 17 | if (!this.docsClient) { 18 | this.docsClient = new SFCCDocumentationClient(); 19 | this.logger.debug('Documentation client initialized'); 20 | } 21 | } 22 | 23 | protected async onDispose(): Promise<void> { 24 | this.docsClient = null; 25 | this.logger.debug('Documentation client disposed'); 26 | } 27 | 28 | canHandle(toolName: string): boolean { 29 | return DOC_TOOL_NAMES_SET.has(toolName as DocToolName); 30 | } 31 | 32 | protected getToolNameSet(): Set<DocToolName> { 33 | return DOC_TOOL_NAMES_SET; 34 | } 35 | 36 | protected getToolConfig(): Record<string, GenericToolSpec<ToolArguments, any>> { 37 | return DOCS_TOOL_CONFIG; 38 | } 39 | 40 | protected async createExecutionContext(): Promise<ToolExecutionContext> { 41 | if (!this.docsClient) { 42 | throw new Error('Documentation client not initialized'); 43 | } 44 | 45 | return { 46 | handlerContext: this.context, 47 | logger: this.logger, 48 | docsClient: this.docsClient, 49 | }; 50 | } 51 | } 52 | ``` -------------------------------------------------------------------------------- /src/utils/ocapi-url-builder.ts: -------------------------------------------------------------------------------- ```typescript 1 | /** 2 | * OCAPI URL Builder Utility 3 | * 4 | * Provides centralized URL construction for OCAPI endpoints with support for 5 | * LOCAL_OCAPI_MOCK_URL environment variable override for testing. 6 | */ 7 | 8 | import { OCAPIConfig } from '../types/types.js'; 9 | 10 | /** 11 | * Build the base URL for OCAPI Data API endpoints 12 | * 13 | * @param config - OCAPI configuration object 14 | * @returns Base URL for OCAPI Data API endpoints 15 | */ 16 | export function buildOCAPIBaseUrl(config: OCAPIConfig): string { 17 | const version = config.version ?? 'v23_2'; 18 | const hostname = config.hostname; 19 | 20 | // Check if hostname is localhost (with or without port) for HTTP protocol 21 | if (hostname === 'localhost' || hostname.startsWith('localhost:')) { 22 | const protocol = hostname.includes('://') ? '' : 'http://'; 23 | return `${protocol}${hostname}/s/-/dw/data/${version}`; 24 | } 25 | 26 | // For live SFCC instances, use HTTPS 27 | return `https://${hostname}/s/-/dw/data/${version}`; 28 | } 29 | 30 | /** 31 | * Build the OAuth token URL for OCAPI authentication 32 | * 33 | * @param config - OCAPI configuration object 34 | * @returns OAuth token endpoint URL 35 | */ 36 | export function buildOCAPIAuthUrl(config: OCAPIConfig): string { 37 | const hostname = config.hostname; 38 | 39 | // Check if hostname is localhost (with or without port) for fallback 40 | if (hostname === 'localhost' || hostname.startsWith('localhost:')) { 41 | // For localhost, use the same host and add the auth endpoint path 42 | const protocol = hostname.includes('://') ? '' : 'http://'; 43 | return `${protocol}${hostname}/dwsso/oauth2/access_token`; 44 | } 45 | 46 | // For live SFCC instances, use the default Demandware auth URL 47 | return 'https://account.demandware.com/dwsso/oauth2/access_token'; 48 | } 49 | ``` -------------------------------------------------------------------------------- /docs/dw_util/PropertyComparator.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.util 2 | 3 | # Class PropertyComparator 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.util.PropertyComparator 9 | 10 | ## Description 11 | 12 | This comparator can be used for the List sort() methods and for the SortSet and SortedMap classes. The comparator can be used to make a comparison based on a property of the contained objects. The Comparison is done based on the natural order of the values. It is guaranteed to work for Numbers, Strings, Dates, Money and Quantity values. 13 | 14 | ## Constructor Summary 15 | 16 | PropertyComparator(property : String, otherProperties : String...) Constructs the comparator from the variable length argument list. 17 | 18 | PropertyComparator(propertyName : String, sortOrder : boolean) Constructs the comparator. 19 | 20 | PropertyComparator(propertyName : String, sortOrder : boolean, nullGreater : boolean) Constructs the comparator. 21 | 22 | ## Method Summary 23 | 24 | ### compare 25 | 26 | **Signature:** `compare(arg1 : Object, arg2 : Object) : Number` 27 | 28 | Compares its two arguments for order. 29 | 30 | ## Constructor Detail 31 | 32 | ## Method Detail 33 | 34 | ## Method Details 35 | 36 | ### compare 37 | 38 | **Signature:** `compare(arg1 : Object, arg2 : Object) : Number` 39 | 40 | **Description:** Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second. By default a null value is treated always greater than any other value. In the constructor of a PropertyComparator this default behavior can be changed. 41 | 42 | **Parameters:** 43 | 44 | - `arg1`: the first object to compare. 45 | - `arg2`: the second object to compare. 46 | 47 | **Returns:** 48 | 49 | a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second. 50 | 51 | --- ``` -------------------------------------------------------------------------------- /docs/dw_util/MappingKey.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.util 2 | 3 | # Class MappingKey 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.util.MappingKey 9 | 10 | ## Description 11 | 12 | Encapsulates the key for a mapping read in with the ImportKeyValueMapping job step. Can be either single or compound keys. For example, a single string (e.g. product id) or multiple string components (e.g. product id and site). 13 | 14 | ## Properties 15 | 16 | ### keyComponents 17 | 18 | **Type:** String (Read Only) 19 | 20 | Gets the (possible compound) key. If the key consists of only of a single value, the string array 21 | will simply contain a single element. 22 | 23 | ### singleComponentKey 24 | 25 | **Type:** String (Read Only) 26 | 27 | Gets a key that contains only a single key component (i.e. that is not a compound key). Returns null if this is 28 | not a single component key. 29 | 30 | ## Constructor Summary 31 | 32 | MappingKey(keyComponents : String...) Instantiates a new key using compound key components. 33 | 34 | ## Method Summary 35 | 36 | ### getKeyComponents 37 | 38 | **Signature:** `getKeyComponents() : String[]` 39 | 40 | Gets the (possible compound) key. 41 | 42 | ### getSingleComponentKey 43 | 44 | **Signature:** `getSingleComponentKey() : String` 45 | 46 | Gets a key that contains only a single key component (i.e. 47 | 48 | ## Constructor Detail 49 | 50 | ## Method Detail 51 | 52 | ## Method Details 53 | 54 | ### getKeyComponents 55 | 56 | **Signature:** `getKeyComponents() : String[]` 57 | 58 | **Description:** Gets the (possible compound) key. If the key consists of only of a single value, the string array will simply contain a single element. 59 | 60 | **Returns:** 61 | 62 | the key 63 | 64 | --- 65 | 66 | ### getSingleComponentKey 67 | 68 | **Signature:** `getSingleComponentKey() : String` 69 | 70 | **Description:** Gets a key that contains only a single key component (i.e. that is not a compound key). Returns null if this is not a single component key. 71 | 72 | **Returns:** 73 | 74 | the single key 75 | 76 | --- ``` -------------------------------------------------------------------------------- /docs/TopLevel/APIException.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: TopLevel 2 | 3 | # Class APIException 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - TopLevel.Error 9 | - APIException 10 | 11 | ## Description 12 | 13 | This error indicates an exceptional outcome of some business logic. Instances of this exception in general provide additional information about the reason of this case. See the actual type referred by the type property for the description of the properties with this additional information. Limitation: The sub classes of this APIException shown in this documentation actually do not exist. All instances are of type APIException, but with different property sets as listed in the sub classes. The APIException is always related to a systems internal Java exception. The class provides access to some more details about this internal Java exception. 14 | 15 | ## Properties 16 | 17 | ### causeFullName 18 | 19 | **Type:** String 20 | 21 | If the exception is associated with a root cause, the property 22 | contains the full name of the associated Java exception. 23 | 24 | ### causeMessage 25 | 26 | **Type:** String 27 | 28 | If the exception is associated with a root cause, the property 29 | contains the message of the associated Java exception. 30 | 31 | ### causeName 32 | 33 | **Type:** String 34 | 35 | If the exception is associated with a root cause, the property 36 | contains the simplified name of the associated Java exception. 37 | 38 | ### javaFullName 39 | 40 | **Type:** String 41 | 42 | The full name of the underlying Java exception. 43 | 44 | ### javaMessage 45 | 46 | **Type:** String 47 | 48 | The message of the underlying Java exception. 49 | 50 | ### javaName 51 | 52 | **Type:** String 53 | 54 | The simplified name of the underlying Java exception. 55 | 56 | ### type 57 | 58 | **Type:** String 59 | 60 | The name of the actual APIException type, without the package name. 61 | 62 | ## Constructor Summary 63 | 64 | APIException() 65 | 66 | ## Method Summary 67 | 68 | ## Constructor Detail ``` -------------------------------------------------------------------------------- /docs/dw_extensions.payments/SalesforcePayPalOrderPayer.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.extensions.payments 2 | 3 | # Class SalesforcePayPalOrderPayer 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.extensions.payments.SalesforcePayPalOrderPayer 9 | 10 | ## Description 11 | 12 | Salesforce Payments representation of a PayPal order's payer object. See Salesforce Payments documentation for how to gain access and configure it for use on your sites. 13 | 14 | ## Properties 15 | 16 | ### emailAddress 17 | 18 | **Type:** String (Read Only) 19 | 20 | The payer's email address. 21 | 22 | ### givenName 23 | 24 | **Type:** String (Read Only) 25 | 26 | The payer's given name. 27 | 28 | ### phone 29 | 30 | **Type:** String (Read Only) 31 | 32 | The payer's national phone number. 33 | 34 | ### surname 35 | 36 | **Type:** String (Read Only) 37 | 38 | The payer's surname. 39 | 40 | ## Constructor Summary 41 | 42 | ## Method Summary 43 | 44 | ### getEmailAddress 45 | 46 | **Signature:** `getEmailAddress() : String` 47 | 48 | Returns the payer's email address. 49 | 50 | ### getGivenName 51 | 52 | **Signature:** `getGivenName() : String` 53 | 54 | Returns the payer's given name. 55 | 56 | ### getPhone 57 | 58 | **Signature:** `getPhone() : String` 59 | 60 | Returns the payer's national phone number. 61 | 62 | ### getSurname 63 | 64 | **Signature:** `getSurname() : String` 65 | 66 | Returns the payer's surname. 67 | 68 | ## Method Detail 69 | 70 | ## Method Details 71 | 72 | ### getEmailAddress 73 | 74 | **Signature:** `getEmailAddress() : String` 75 | 76 | **Description:** Returns the payer's email address. 77 | 78 | **Returns:** 79 | 80 | payer's email address 81 | 82 | --- 83 | 84 | ### getGivenName 85 | 86 | **Signature:** `getGivenName() : String` 87 | 88 | **Description:** Returns the payer's given name. 89 | 90 | **Returns:** 91 | 92 | payer's given name 93 | 94 | --- 95 | 96 | ### getPhone 97 | 98 | **Signature:** `getPhone() : String` 99 | 100 | **Description:** Returns the payer's national phone number. 101 | 102 | **Returns:** 103 | 104 | payer's national phone number 105 | 106 | --- 107 | 108 | ### getSurname 109 | 110 | **Signature:** `getSurname() : String` 111 | 112 | **Description:** Returns the payer's surname. 113 | 114 | **Returns:** 115 | 116 | payer's surname 117 | 118 | --- ``` -------------------------------------------------------------------------------- /docs/dw_svc/ServiceConfig.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.svc 2 | 3 | # Class ServiceConfig 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.object.PersistentObject 9 | - dw.object.ExtensibleObject 10 | - dw.svc.ServiceConfig 11 | 12 | ## Description 13 | 14 | Configuration object for Services. 15 | 16 | ## Properties 17 | 18 | ### credential 19 | 20 | **Type:** ServiceCredential (Read Only) 21 | 22 | The related service credentials. 23 | 24 | ### ID 25 | 26 | **Type:** String (Read Only) 27 | 28 | The unique Service ID. 29 | 30 | ### profile 31 | 32 | **Type:** ServiceProfile (Read Only) 33 | 34 | The related service profile. 35 | 36 | ### serviceType 37 | 38 | **Type:** String (Read Only) 39 | 40 | The type of the service, such as HTTP or SOAP. 41 | 42 | ## Constructor Summary 43 | 44 | ## Method Summary 45 | 46 | ### getCredential 47 | 48 | **Signature:** `getCredential() : ServiceCredential` 49 | 50 | Returns the related service credentials. 51 | 52 | ### getID 53 | 54 | **Signature:** `getID() : String` 55 | 56 | Returns the unique Service ID. 57 | 58 | ### getProfile 59 | 60 | **Signature:** `getProfile() : ServiceProfile` 61 | 62 | Returns the related service profile. 63 | 64 | ### getServiceType 65 | 66 | **Signature:** `getServiceType() : String` 67 | 68 | Returns the type of the service, such as HTTP or SOAP. 69 | 70 | ## Method Detail 71 | 72 | ## Method Details 73 | 74 | ### getCredential 75 | 76 | **Signature:** `getCredential() : ServiceCredential` 77 | 78 | **Description:** Returns the related service credentials. 79 | 80 | **Returns:** 81 | 82 | Related service credentials. 83 | 84 | --- 85 | 86 | ### getID 87 | 88 | **Signature:** `getID() : String` 89 | 90 | **Description:** Returns the unique Service ID. 91 | 92 | **Returns:** 93 | 94 | unique Service ID. 95 | 96 | --- 97 | 98 | ### getProfile 99 | 100 | **Signature:** `getProfile() : ServiceProfile` 101 | 102 | **Description:** Returns the related service profile. 103 | 104 | **Returns:** 105 | 106 | Related service profile. 107 | 108 | --- 109 | 110 | ### getServiceType 111 | 112 | **Signature:** `getServiceType() : String` 113 | 114 | **Description:** Returns the type of the service, such as HTTP or SOAP. 115 | 116 | **Returns:** 117 | 118 | Type of the service, such as HTTP or SOAP. 119 | 120 | --- ``` -------------------------------------------------------------------------------- /docs-site/vite.config.ts: -------------------------------------------------------------------------------- ```typescript 1 | import path from 'path'; 2 | import { defineConfig, loadEnv } from 'vite'; 3 | 4 | export default defineConfig(({ mode }) => { 5 | const env = loadEnv(mode, '.', ''); 6 | return { 7 | base: '/', 8 | build: { 9 | target: 'es2018', 10 | cssCodeSplit: true, 11 | rollupOptions: { 12 | output: { 13 | manualChunks: (id) => { 14 | if (id.includes('node_modules')) { 15 | if (id.includes('react')) { 16 | return 'vendor'; 17 | } 18 | if (id.includes('prism')) { 19 | return 'prism'; 20 | } 21 | return 'vendor'; 22 | } 23 | }, 24 | chunkFileNames: 'assets/[name]-[hash].js', 25 | entryFileNames: 'assets/[name]-[hash].js', 26 | assetFileNames: 'assets/[name]-[hash].[ext]' 27 | }, 28 | }, 29 | minify: 'esbuild', 30 | sourcemap: false, 31 | reportCompressedSize: false, 32 | chunkSizeWarningLimit: 1000 33 | }, 34 | esbuild: { 35 | drop: mode === 'production' ? ['console', 'debugger'] : [], 36 | }, 37 | css: { 38 | postcss: './postcss.config.js', 39 | devSourcemap: false 40 | }, 41 | define: { 42 | 'process.env.API_KEY': JSON.stringify(env.GEMINI_API_KEY), 43 | 'process.env.GEMINI_API_KEY': JSON.stringify(env.GEMINI_API_KEY) 44 | }, 45 | resolve: { 46 | alias: { 47 | '@': path.resolve(__dirname, '.'), 48 | } 49 | }, 50 | // Performance optimizations 51 | optimizeDeps: { 52 | include: ['react', 'react-dom', 'react-router-dom'], 53 | exclude: [] 54 | }, 55 | // SSG specific configuration 56 | ssgOptions: { 57 | script: 'async', 58 | dirStyle: 'nested', 59 | includeAllRoutes: true, 60 | format: 'esm' 61 | }, 62 | }; 63 | }); 64 | ``` -------------------------------------------------------------------------------- /docs/dw_catalog/ProductSearchRefinementDefinition.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.catalog 2 | 3 | # Class ProductSearchRefinementDefinition 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.object.PersistentObject 9 | - dw.object.ExtensibleObject 10 | - dw.catalog.SearchRefinementDefinition 11 | - dw.catalog.ProductSearchRefinementDefinition 12 | 13 | ## Description 14 | 15 | This class provides an interface to refinement options for the product search. 16 | 17 | ## Properties 18 | 19 | ### categoryRefinement 20 | 21 | **Type:** boolean (Read Only) 22 | 23 | Identifies if this is a category refinement. 24 | 25 | ### priceRefinement 26 | 27 | **Type:** boolean (Read Only) 28 | 29 | Identifies if this is a price refinement. 30 | 31 | ### promotionRefinement 32 | 33 | **Type:** boolean (Read Only) 34 | 35 | Identifies if this is a promotion refinement. 36 | 37 | ## Constructor Summary 38 | 39 | ## Method Summary 40 | 41 | ### isCategoryRefinement 42 | 43 | **Signature:** `isCategoryRefinement() : boolean` 44 | 45 | Identifies if this is a category refinement. 46 | 47 | ### isPriceRefinement 48 | 49 | **Signature:** `isPriceRefinement() : boolean` 50 | 51 | Identifies if this is a price refinement. 52 | 53 | ### isPromotionRefinement 54 | 55 | **Signature:** `isPromotionRefinement() : boolean` 56 | 57 | Identifies if this is a promotion refinement. 58 | 59 | ## Method Detail 60 | 61 | ## Method Details 62 | 63 | ### isCategoryRefinement 64 | 65 | **Signature:** `isCategoryRefinement() : boolean` 66 | 67 | **Description:** Identifies if this is a category refinement. 68 | 69 | **Returns:** 70 | 71 | true if this is a category refinement, false otherwise. 72 | 73 | --- 74 | 75 | ### isPriceRefinement 76 | 77 | **Signature:** `isPriceRefinement() : boolean` 78 | 79 | **Description:** Identifies if this is a price refinement. 80 | 81 | **Returns:** 82 | 83 | true if this is a price refinement, false otherwise. 84 | 85 | --- 86 | 87 | ### isPromotionRefinement 88 | 89 | **Signature:** `isPromotionRefinement() : boolean` 90 | 91 | **Description:** Identifies if this is a promotion refinement. 92 | 93 | **Returns:** 94 | 95 | true if this is a promotion refinement, false otherwise. 96 | 97 | --- ``` -------------------------------------------------------------------------------- /docs/dw_extensions.pinterest/PinterestAvailability.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.extensions.pinterest 2 | 3 | # Class PinterestAvailability 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.extensions.pinterest.PinterestAvailability 9 | 10 | ## Description 11 | 12 | Represents a row in the Pinterest availability feed export file. 13 | 14 | ## Properties 15 | 16 | ### availability 17 | 18 | **Type:** String 19 | 20 | The availability of the Pinterest product. Possible values are 21 | PinterestProduct.AVAILABILITY_IN_STOCK or 22 | PinterestProduct.AVAILABILITY_OUT_OF_STOCK. 23 | 24 | ### ID 25 | 26 | **Type:** String (Read Only) 27 | 28 | The ID of the Pinterest product. This is the same as the ID of the Demandware product. 29 | 30 | ## Constructor Summary 31 | 32 | ## Method Summary 33 | 34 | ### getAvailability 35 | 36 | **Signature:** `getAvailability() : String` 37 | 38 | Returns the availability of the Pinterest product. 39 | 40 | ### getID 41 | 42 | **Signature:** `getID() : String` 43 | 44 | Returns the ID of the Pinterest product. 45 | 46 | ### setAvailability 47 | 48 | **Signature:** `setAvailability(availability : String) : void` 49 | 50 | Sets the availability of the Pinterest product. 51 | 52 | ## Method Detail 53 | 54 | ## Method Details 55 | 56 | ### getAvailability 57 | 58 | **Signature:** `getAvailability() : String` 59 | 60 | **Description:** Returns the availability of the Pinterest product. Possible values are PinterestProduct.AVAILABILITY_IN_STOCK or PinterestProduct.AVAILABILITY_OUT_OF_STOCK. 61 | 62 | --- 63 | 64 | ### getID 65 | 66 | **Signature:** `getID() : String` 67 | 68 | **Description:** Returns the ID of the Pinterest product. This is the same as the ID of the Demandware product. 69 | 70 | **Returns:** 71 | 72 | product ID 73 | 74 | --- 75 | 76 | ### setAvailability 77 | 78 | **Signature:** `setAvailability(availability : String) : void` 79 | 80 | **Description:** Sets the availability of the Pinterest product. Possible values are PinterestProduct.AVAILABILITY_IN_STOCK or PinterestProduct.AVAILABILITY_OUT_OF_STOCK. 81 | 82 | **Parameters:** 83 | 84 | - `availability`: the availability status to set for this product 85 | 86 | --- ``` -------------------------------------------------------------------------------- /docs/dw_extensions.payments/SalesforcePaymentsHooks.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.extensions.payments 2 | 3 | # Class SalesforcePaymentsHooks 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - dw.extensions.payments.SalesforcePaymentsHooks 8 | 9 | ## Description 10 | 11 | This interface represents all script hooks that can be registered to customize the Salesforce Payments functionality. See Salesforce Payments documentation for how to gain access and configure it for use on your sites. It contains the extension points (hook names), and the functions that are called by each extension point. A function must be defined inside a JavaScript source and must be exported. The script with the exported hook function must be located inside a site cartridge. Inside the site cartridge a 'package.json' file with a 'hooks' entry must exist. "hooks": "./hooks.json" The hooks entry links to a json file, relative to the 'package.json' file. This file lists all registered hooks inside the hooks property: "hooks": [ {"name": "dw.extensions.payments.asyncPaymentSucceeded", "script": "./payments.js"} ] A hook entry has a 'name' and a 'script' property. The 'name' contains the extension point, the hook name. The 'script' contains the script relative to the hooks file, with the exported hook function. 12 | 13 | ## Constants 14 | 15 | ## Properties 16 | 17 | ## Constructor Summary 18 | 19 | ## Method Summary 20 | 21 | ### asyncPaymentSucceeded 22 | 23 | **Signature:** `asyncPaymentSucceeded(order : Order) : Status` 24 | 25 | Called when asynchronous payment succeeded for the given order. 26 | 27 | ## Method Detail 28 | 29 | ## Method Details 30 | 31 | ### asyncPaymentSucceeded 32 | 33 | **Signature:** `asyncPaymentSucceeded(order : Order) : Status` 34 | 35 | **Description:** Called when asynchronous payment succeeded for the given order. 36 | 37 | **Parameters:** 38 | 39 | - `order`: the order whose asynchronous payment succeeded 40 | 41 | **Returns:** 42 | 43 | a non-null result ends the hook execution, and is ignored 44 | 45 | --- ``` -------------------------------------------------------------------------------- /docs/dw_svc/SOAPService.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.svc 2 | 3 | # Class SOAPService 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.svc.Service 9 | - dw.svc.SOAPService 10 | 11 | ## Description 12 | 13 | Represents a SOAP WebService. 14 | 15 | ## Properties 16 | 17 | ### authentication 18 | 19 | **Type:** String 20 | 21 | The authentication type. 22 | 23 | ### serviceClient 24 | 25 | **Type:** Object 26 | 27 | The serviceClient object. 28 | 29 | ## Constructor Summary 30 | 31 | ## Method Summary 32 | 33 | ### getAuthentication 34 | 35 | **Signature:** `getAuthentication() : String` 36 | 37 | Returns the authentication type. 38 | 39 | ### getServiceClient 40 | 41 | **Signature:** `getServiceClient() : Object` 42 | 43 | Returns the serviceClient object. 44 | 45 | ### setAuthentication 46 | 47 | **Signature:** `setAuthentication(authentication : String) : SOAPService` 48 | 49 | Sets the type of authentication. 50 | 51 | ### setServiceClient 52 | 53 | **Signature:** `setServiceClient(o : Object) : SOAPService` 54 | 55 | Sets the serviceClient object. 56 | 57 | ## Method Detail 58 | 59 | ## Method Details 60 | 61 | ### getAuthentication 62 | 63 | **Signature:** `getAuthentication() : String` 64 | 65 | **Description:** Returns the authentication type. 66 | 67 | **Returns:** 68 | 69 | Authentication type. 70 | 71 | --- 72 | 73 | ### getServiceClient 74 | 75 | **Signature:** `getServiceClient() : Object` 76 | 77 | **Description:** Returns the serviceClient object. 78 | 79 | **Returns:** 80 | 81 | serviceClient object. 82 | 83 | --- 84 | 85 | ### setAuthentication 86 | 87 | **Signature:** `setAuthentication(authentication : String) : SOAPService` 88 | 89 | **Description:** Sets the type of authentication. Valid values include "BASIC" and "NONE". The default value is BASIC. 90 | 91 | **Parameters:** 92 | 93 | - `authentication`: Type of authentication. 94 | 95 | **Returns:** 96 | 97 | this SOAP WebService. 98 | 99 | --- 100 | 101 | ### setServiceClient 102 | 103 | **Signature:** `setServiceClient(o : Object) : SOAPService` 104 | 105 | **Description:** Sets the serviceClient object. This must be set in the prepareCall method, prior to execute being called. 106 | 107 | **Parameters:** 108 | 109 | - `o`: serviceClient object. 110 | 111 | **Returns:** 112 | 113 | this SOAP WebService. 114 | 115 | --- ``` -------------------------------------------------------------------------------- /docs/dw_net/FTPFileInfo.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.net 2 | 3 | # Class FTPFileInfo 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.net.FTPFileInfo 9 | 10 | ## Description 11 | 12 | The class is used to store information about a remote file. Note: when this class is used with sensitive data, be careful in persisting sensitive information to disk. 13 | 14 | ## Properties 15 | 16 | ### directory 17 | 18 | **Type:** boolean (Read Only) 19 | 20 | Identifies if the file is a directory. 21 | 22 | ### name 23 | 24 | **Type:** String (Read Only) 25 | 26 | The name of the file. 27 | 28 | ### size 29 | 30 | **Type:** Number (Read Only) 31 | 32 | The size of the file. 33 | 34 | ### timestamp 35 | 36 | **Type:** Date (Read Only) 37 | 38 | The timestamp of the file. 39 | 40 | ## Constructor Summary 41 | 42 | FTPFileInfo(name : String, size : Number, directory : boolean, timestamp : Date) Constructs the FTPFileInfo instance. 43 | 44 | ## Method Summary 45 | 46 | ### getDirectory 47 | 48 | **Signature:** `getDirectory() : boolean` 49 | 50 | Identifies if the file is a directory. 51 | 52 | ### getName 53 | 54 | **Signature:** `getName() : String` 55 | 56 | Returns the name of the file. 57 | 58 | ### getSize 59 | 60 | **Signature:** `getSize() : Number` 61 | 62 | Returns the size of the file. 63 | 64 | ### getTimestamp 65 | 66 | **Signature:** `getTimestamp() : Date` 67 | 68 | Returns the timestamp of the file. 69 | 70 | ## Constructor Detail 71 | 72 | ## Method Detail 73 | 74 | ## Method Details 75 | 76 | ### getDirectory 77 | 78 | **Signature:** `getDirectory() : boolean` 79 | 80 | **Description:** Identifies if the file is a directory. 81 | 82 | **Returns:** 83 | 84 | true if the file is a directory, false otherwise. 85 | 86 | --- 87 | 88 | ### getName 89 | 90 | **Signature:** `getName() : String` 91 | 92 | **Description:** Returns the name of the file. 93 | 94 | **Returns:** 95 | 96 | the name of the file. 97 | 98 | --- 99 | 100 | ### getSize 101 | 102 | **Signature:** `getSize() : Number` 103 | 104 | **Description:** Returns the size of the file. 105 | 106 | **Returns:** 107 | 108 | the size of the file. 109 | 110 | --- 111 | 112 | ### getTimestamp 113 | 114 | **Signature:** `getTimestamp() : Date` 115 | 116 | **Description:** Returns the timestamp of the file. 117 | 118 | **Returns:** 119 | 120 | the timestamp of the file. 121 | 122 | --- ``` -------------------------------------------------------------------------------- /docs/dw_order/OrderProcessStatusCodes.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.order 2 | 3 | # Class OrderProcessStatusCodes 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.order.OrderProcessStatusCodes 9 | 10 | ## Description 11 | 12 | Contains constants representing different status codes for interacting with an order, such as cancelling or editing an order. 13 | 14 | ## Constants 15 | 16 | ### COUPON_INVALID 17 | 18 | **Type:** String = "COUPON_INVALID" 19 | 20 | Indicates that a coupon in the order is not valid. 21 | 22 | ### INVENTORY_RESERVATION_FAILED 23 | 24 | **Type:** String = "INVENTORY_RESERVATION_FAILED" 25 | 26 | Indicates that no inventory could be reserved for the order. 27 | 28 | ### ORDER_ALREADY_CANCELLED 29 | 30 | **Type:** String = "ORDER_CANCELLED" 31 | 32 | Indicates that the order could not be used because it has already been cancelled. 33 | 34 | ### ORDER_ALREADY_EXPORTED 35 | 36 | **Type:** String = "ORDER_EXPORTED" 37 | 38 | Indicates that the order could not be used because it has already been exported. 39 | 40 | ### ORDER_ALREADY_FAILED 41 | 42 | **Type:** String = "ORDER_FAILED" 43 | 44 | Indicates that the order could not be used because it has already been failed. 45 | 46 | ### ORDER_ALREADY_REPLACED 47 | 48 | **Type:** String = "ORDER_REPLACED" 49 | 50 | Indicates that the order could not be used because it has already been replaced. 51 | 52 | ### ORDER_CONTAINS_GC 53 | 54 | **Type:** String = "CANCEL_ORDER_GC" 55 | 56 | Indicates that the order could not be used because it contains gift certificates. 57 | 58 | ### ORDER_NOT_CANCELLED 59 | 60 | **Type:** String = "ORDER_NOT_CANCELLED" 61 | 62 | Indicates that the order could not be used because it is not cancelled. 63 | 64 | ### ORDER_NOT_FAILED 65 | 66 | **Type:** String = "ORDER_NOT_FAILED" 67 | 68 | Indicates that the order could not be used because it has not been failed. 69 | 70 | ### ORDER_NOT_PLACED 71 | 72 | **Type:** String = "ORDER_NOT_PLACED" 73 | 74 | Indicates that the order could not be used because it has not been placed. 75 | 76 | ## Properties 77 | 78 | ## Constructor Summary 79 | 80 | OrderProcessStatusCodes() 81 | 82 | ## Method Summary 83 | 84 | ## Constructor Detail ``` -------------------------------------------------------------------------------- /docs/dw_extensions.payments/SalesforceCardPaymentDetails.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.extensions.payments 2 | 3 | # Class SalesforceCardPaymentDetails 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.extensions.payments.SalesforcePaymentDetails 9 | - dw.extensions.payments.SalesforceCardPaymentDetails 10 | 11 | ## Description 12 | 13 | Details to a Salesforce Payments payment of type SalesforcePaymentMethod.TYPE_CARD. See Salesforce Payments documentation for how to gain access and configure it for use on your sites. 14 | 15 | ## Properties 16 | 17 | ### brand 18 | 19 | **Type:** String (Read Only) 20 | 21 | The card brand, or null if not known. 22 | 23 | ### last4 24 | 25 | **Type:** String (Read Only) 26 | 27 | The last 4 digits of the card number, or null if not known. 28 | 29 | ### walletType 30 | 31 | **Type:** String (Read Only) 32 | 33 | The type of wallet used to make the card payment, or null if not known. 34 | 35 | ## Constructor Summary 36 | 37 | ## Method Summary 38 | 39 | ### getBrand 40 | 41 | **Signature:** `getBrand() : String` 42 | 43 | Returns the card brand, or null if not known. 44 | 45 | ### getLast4 46 | 47 | **Signature:** `getLast4() : String` 48 | 49 | Returns the last 4 digits of the card number, or null if not known. 50 | 51 | ### getWalletType 52 | 53 | **Signature:** `getWalletType() : String` 54 | 55 | Returns the type of wallet used to make the card payment, or null if not known. 56 | 57 | ## Method Detail 58 | 59 | ## Method Details 60 | 61 | ### getBrand 62 | 63 | **Signature:** `getBrand() : String` 64 | 65 | **Description:** Returns the card brand, or null if not known. 66 | 67 | **Returns:** 68 | 69 | card brand 70 | 71 | **See Also:** 72 | 73 | SalesforcePaymentMethod.getBrand() 74 | 75 | --- 76 | 77 | ### getLast4 78 | 79 | **Signature:** `getLast4() : String` 80 | 81 | **Description:** Returns the last 4 digits of the card number, or null if not known. 82 | 83 | **Returns:** 84 | 85 | last 4 digits of the card number 86 | 87 | **See Also:** 88 | 89 | SalesforcePaymentMethod.getLast4() 90 | 91 | --- 92 | 93 | ### getWalletType 94 | 95 | **Signature:** `getWalletType() : String` 96 | 97 | **Description:** Returns the type of wallet used to make the card payment, or null if not known. 98 | 99 | **Returns:** 100 | 101 | wallet type 102 | 103 | --- ``` -------------------------------------------------------------------------------- /docs/dw_campaign/ABTestMgr.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.campaign 2 | 3 | # Class ABTestMgr 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.campaign.ABTestMgr 9 | 10 | ## Description 11 | 12 | Manager class used to access AB-test information in the storefront. 13 | 14 | ## Properties 15 | 16 | ### assignedTestSegments 17 | 18 | **Type:** Collection (Read Only) 19 | 20 | Return the AB-test segments to which the current customer is assigned. 21 | AB-test segments deleted in the meantime will not be returned. 22 | 23 | ## Constructor Summary 24 | 25 | ## Method Summary 26 | 27 | ### getAssignedTestSegments 28 | 29 | **Signature:** `static getAssignedTestSegments() : Collection` 30 | 31 | Return the AB-test segments to which the current customer is assigned. 32 | 33 | ### isParticipant 34 | 35 | **Signature:** `static isParticipant(testID : String, segmentID : String) : boolean` 36 | 37 | Test whether the current customer is a member of the specified AB-test segment. 38 | 39 | ## Method Detail 40 | 41 | ## Method Details 42 | 43 | ### getAssignedTestSegments 44 | 45 | **Signature:** `static getAssignedTestSegments() : Collection` 46 | 47 | **Description:** Return the AB-test segments to which the current customer is assigned. AB-test segments deleted in the meantime will not be returned. 48 | 49 | **Returns:** 50 | 51 | unordered collection of ABTestSegment instances representing the AB-test segments to which the current customer is assigned. 52 | 53 | --- 54 | 55 | ### isParticipant 56 | 57 | **Signature:** `static isParticipant(testID : String, segmentID : String) : boolean` 58 | 59 | **Description:** Test whether the current customer is a member of the specified AB-test segment. This method can be used to customize the storefront experience in ways that are not supported using Business Manager configuration alone. 60 | 61 | **Parameters:** 62 | 63 | - `testID`: The ID of the AB-test, must not be null. 64 | - `segmentID`: The ID of the segment within the AB-test, must not be null. 65 | 66 | **Returns:** 67 | 68 | true if the current customer is a member of the specified AB-test segment, false otherwise. 69 | 70 | --- ``` -------------------------------------------------------------------------------- /src/tool-configs/cartridge-tool-config.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { GenericToolSpec, ToolExecutionContext } from '../core/handlers/base-handler.js'; 2 | import { ToolArguments } from '../core/handlers/base-handler.js'; 3 | import { ValidationHelpers, CommonValidations } from '../core/handlers/validation-helpers.js'; 4 | import { CartridgeGenerationClient } from '../clients/cartridge-generation-client.js'; 5 | 6 | export const CARTRIDGE_TOOL_NAMES = [ 7 | 'generate_cartridge_structure', 8 | ] as const; 9 | 10 | export type CartridgeToolName = typeof CARTRIDGE_TOOL_NAMES[number]; 11 | export const CARTRIDGE_TOOL_NAMES_SET = new Set<CartridgeToolName>(CARTRIDGE_TOOL_NAMES); 12 | 13 | /** 14 | * Configuration for cartridge generation tools 15 | * Maps each tool to its validation, execution, and messaging logic 16 | */ 17 | export const CARTRIDGE_TOOL_CONFIG: Record<CartridgeToolName, GenericToolSpec<ToolArguments, any>> = { 18 | generate_cartridge_structure: { 19 | defaults: (args: ToolArguments) => ({ 20 | ...args, 21 | fullProjectSetup: args.fullProjectSetup ?? true, 22 | }), 23 | validate: (args: ToolArguments, toolName: string) => { 24 | ValidationHelpers.validateArguments(args, CommonValidations.requiredField( 25 | 'cartridgeName', 26 | 'string', 27 | (value: string) => /^[a-zA-Z][a-zA-Z0-9_-]*$/.test(value), 28 | 'cartridgeName must be a valid identifier (letters, numbers, underscore, hyphen)', 29 | ), toolName); 30 | }, 31 | exec: async (args: ToolArguments, context: ToolExecutionContext) => { 32 | const client = context.cartridgeClient as CartridgeGenerationClient; 33 | return client.generateCartridgeStructure({ 34 | cartridgeName: args.cartridgeName as string, 35 | targetPath: args.targetPath as string | undefined, 36 | fullProjectSetup: args.fullProjectSetup as boolean, 37 | }); 38 | }, 39 | logMessage: (args: ToolArguments) => `Generate cartridge structure for ${args.cartridgeName}`, 40 | }, 41 | }; 42 | ``` -------------------------------------------------------------------------------- /docs-site/tailwind.config.js: -------------------------------------------------------------------------------- ```javascript 1 | import typography from '@tailwindcss/typography'; 2 | 3 | /** @type {import('tailwindcss').Config} */ 4 | export default { 5 | content: [ 6 | './index.html', 7 | './src/**/*.{js,ts,jsx,tsx}', 8 | './components/**/*.{js,ts,jsx,tsx}', 9 | './pages/**/*.{js,ts,jsx,tsx}', 10 | './*.{js,ts,jsx,tsx}', 11 | ], 12 | theme: { 13 | extend: { 14 | screens: { 15 | 'xs': '475px', 16 | }, 17 | typography: { 18 | DEFAULT: { 19 | css: { 20 | maxWidth: 'none', 21 | 'pre': { 22 | 'overflow-x': 'auto', 23 | 'word-wrap': 'normal', 24 | 'white-space': 'pre', 25 | 'max-width': '100%', 26 | 'word-break': 'normal', 27 | }, 28 | 'pre code': { 29 | 'white-space': 'pre', 30 | 'word-break': 'normal', 31 | 'overflow-wrap': 'normal', 32 | }, 33 | 'code': { 34 | 'word-wrap': 'break-word', 35 | 'overflow-wrap': 'break-word', 36 | 'word-break': 'break-word', 37 | }, 38 | 'p code': { 39 | 'word-break': 'break-word', 40 | 'overflow-wrap': 'break-word', 41 | }, 42 | 'li code': { 43 | 'word-break': 'break-word', 44 | 'overflow-wrap': 'break-word', 45 | }, 46 | 'h1, h2, h3, h4, h5, h6': { 47 | 'word-wrap': 'break-word', 48 | 'overflow-wrap': 'break-word', 49 | }, 50 | 'p, li, td, th': { 51 | 'word-wrap': 'break-word', 52 | 'overflow-wrap': 'break-word', 53 | }, 54 | 'table': { 55 | 'width': '100%', 56 | 'table-layout': 'fixed', 57 | }, 58 | 'td, th': { 59 | 'overflow-wrap': 'break-word', 60 | 'word-break': 'break-word', 61 | }, 62 | }, 63 | }, 64 | }, 65 | }, 66 | }, 67 | plugins: [ 68 | typography, 69 | ], 70 | }; 71 | ``` -------------------------------------------------------------------------------- /src/core/handlers/best-practices-handler.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { BaseToolHandler, ToolExecutionContext, GenericToolSpec, HandlerContext, ToolArguments } from './base-handler.js'; 2 | import { SFCCBestPracticesClient } from '../../clients/best-practices-client.js'; 3 | import { 4 | BEST_PRACTICES_TOOL_CONFIG, 5 | BestPracticeToolName, 6 | BEST_PRACTICE_TOOL_NAMES_SET, 7 | } from '../../tool-configs/best-practices-tool-config.js'; 8 | 9 | /** 10 | * Handler for SFCC best practices tools using config-driven dispatch 11 | * Provides access to development guides, security recommendations, and hook references 12 | */ 13 | export class BestPracticesToolHandler extends BaseToolHandler<BestPracticeToolName> { 14 | private bestPracticesClient: SFCCBestPracticesClient | null = null; 15 | 16 | constructor(context: HandlerContext, subLoggerName: string) { 17 | super(context, subLoggerName); 18 | } 19 | 20 | protected async onInitialize(): Promise<void> { 21 | if (!this.bestPracticesClient) { 22 | this.bestPracticesClient = new SFCCBestPracticesClient(); 23 | this.logger.debug('Best practices client initialized'); 24 | } 25 | } 26 | 27 | protected async onDispose(): Promise<void> { 28 | this.bestPracticesClient = null; 29 | this.logger.debug('Best practices client disposed'); 30 | } 31 | 32 | canHandle(toolName: string): boolean { 33 | return BEST_PRACTICE_TOOL_NAMES_SET.has(toolName as BestPracticeToolName); 34 | } 35 | 36 | protected getToolNameSet(): Set<BestPracticeToolName> { 37 | return BEST_PRACTICE_TOOL_NAMES_SET; 38 | } 39 | 40 | protected getToolConfig(): Record<string, GenericToolSpec<ToolArguments, any>> { 41 | return BEST_PRACTICES_TOOL_CONFIG; 42 | } 43 | 44 | protected async createExecutionContext(): Promise<ToolExecutionContext> { 45 | if (!this.bestPracticesClient) { 46 | throw new Error('Best practices client not initialized'); 47 | } 48 | 49 | return { 50 | handlerContext: this.context, 51 | logger: this.logger, 52 | bestPracticesClient: this.bestPracticesClient, 53 | }; 54 | } 55 | } 56 | ``` -------------------------------------------------------------------------------- /docs/dw_order/ProductShippingCost.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.order 2 | 3 | # Class ProductShippingCost 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.order.ProductShippingCost 9 | 10 | ## Description 11 | 12 | Instances of ProductShippingCost represent product specific shipping costs. Use ProductShippingModel.getShippingCost(ShippingMethod) to get the shipping cost for a specific product. 13 | 14 | ## Properties 15 | 16 | ### amount 17 | 18 | **Type:** Money (Read Only) 19 | 20 | The shipping amount. 21 | 22 | ### fixedPrice 23 | 24 | **Type:** boolean (Read Only) 25 | 26 | Returns true if shipping cost is a fixed-price shipping cost, 27 | and false if surcharge shipping cost. 28 | 29 | ### surcharge 30 | 31 | **Type:** boolean (Read Only) 32 | 33 | Returns true if shipping cost is a surcharge to the shipment 34 | shipping cost, and false if fixed-price shipping cost. 35 | 36 | ## Constructor Summary 37 | 38 | ## Method Summary 39 | 40 | ### getAmount 41 | 42 | **Signature:** `getAmount() : Money` 43 | 44 | Returns the shipping amount. 45 | 46 | ### isFixedPrice 47 | 48 | **Signature:** `isFixedPrice() : boolean` 49 | 50 | Returns true if shipping cost is a fixed-price shipping cost, and false if surcharge shipping cost. 51 | 52 | ### isSurcharge 53 | 54 | **Signature:** `isSurcharge() : boolean` 55 | 56 | Returns true if shipping cost is a surcharge to the shipment shipping cost, and false if fixed-price shipping cost. 57 | 58 | ## Method Detail 59 | 60 | ## Method Details 61 | 62 | ### getAmount 63 | 64 | **Signature:** `getAmount() : Money` 65 | 66 | **Description:** Returns the shipping amount. 67 | 68 | **Returns:** 69 | 70 | Shipping amount 71 | 72 | --- 73 | 74 | ### isFixedPrice 75 | 76 | **Signature:** `isFixedPrice() : boolean` 77 | 78 | **Description:** Returns true if shipping cost is a fixed-price shipping cost, and false if surcharge shipping cost. 79 | 80 | **Returns:** 81 | 82 | true of fixed-price shipping cost, else false 83 | 84 | --- 85 | 86 | ### isSurcharge 87 | 88 | **Signature:** `isSurcharge() : boolean` 89 | 90 | **Description:** Returns true if shipping cost is a surcharge to the shipment shipping cost, and false if fixed-price shipping cost. 91 | 92 | **Returns:** 93 | 94 | true of surcharge shipping cost, else false 95 | 96 | --- ``` -------------------------------------------------------------------------------- /src/tool-configs/code-version-tool-config.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { GenericToolSpec, ToolExecutionContext } from '../core/handlers/base-handler.js'; 2 | import { ToolArguments } from '../core/handlers/base-handler.js'; 3 | import { ValidationHelpers, CommonValidations } from '../core/handlers/validation-helpers.js'; 4 | import { OCAPICodeVersionsClient } from '../clients/ocapi/code-versions-client.js'; 5 | 6 | export const CODE_VERSION_TOOL_NAMES = [ 7 | 'get_code_versions', 8 | 'activate_code_version', 9 | ] as const; 10 | 11 | export type CodeVersionToolName = typeof CODE_VERSION_TOOL_NAMES[number]; 12 | export const CODE_VERSION_TOOL_NAMES_SET = new Set<CodeVersionToolName>(CODE_VERSION_TOOL_NAMES); 13 | 14 | /** 15 | * Configuration for code version tools 16 | * Maps each tool to its validation, execution, and messaging logic 17 | */ 18 | export const CODE_VERSION_TOOL_CONFIG: Record<CodeVersionToolName, GenericToolSpec<ToolArguments, any>> = { 19 | get_code_versions: { 20 | defaults: (args: ToolArguments) => args, 21 | validate: (_args: ToolArguments, _toolName: string) => { 22 | // No validation needed for list operation 23 | }, 24 | exec: async (_args: ToolArguments, context: ToolExecutionContext) => { 25 | const client = context.codeVersionsClient as OCAPICodeVersionsClient; 26 | return client.getCodeVersions(); 27 | }, 28 | logMessage: (_args: ToolArguments) => 'Get code versions', 29 | }, 30 | 31 | activate_code_version: { 32 | defaults: (args: ToolArguments) => args, 33 | validate: (args: ToolArguments, toolName: string) => { 34 | ValidationHelpers.validateArguments(args, CommonValidations.requiredString('codeVersionId'), toolName); 35 | }, 36 | exec: async (args: ToolArguments, context: ToolExecutionContext) => { 37 | const client = context.codeVersionsClient as OCAPICodeVersionsClient; 38 | return client.activateCodeVersion(args.codeVersionId as string); 39 | }, 40 | logMessage: (args: ToolArguments) => `Activate code version ${args?.codeVersionId}`, 41 | }, 42 | }; 43 | ``` -------------------------------------------------------------------------------- /docs/dw_value/MimeEncodedText.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.value 2 | 3 | # Class MimeEncodedText 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.value.MimeEncodedText 9 | 10 | ## Description 11 | 12 | Container for an arbitrary text string its mime type, and encoding 13 | 14 | ## Properties 15 | 16 | ### encoding 17 | 18 | **Type:** String (Read Only) 19 | 20 | The encoding of the text. Encoding is set at creation time and 21 | can't be changed afterwards 22 | 23 | ### mimeType 24 | 25 | **Type:** String (Read Only) 26 | 27 | The mime type of the text. Mime type is set at creation time and 28 | can't be changed afterwards. 29 | 30 | ### text 31 | 32 | **Type:** String (Read Only) 33 | 34 | The text. Text is set at creation time and can't be changed 35 | afterwards. 36 | 37 | ## Constructor Summary 38 | 39 | MimeEncodedText(text : String, mimeType : String, encoding : String) Creates a new MimeEncodedText with explicit values for mime type and encoding. 40 | 41 | MimeEncodedText(text : String) Creates a new MimeEncodedText with the given String as text, mime type of "text/plain;charset=UTF-8" and encoding of "UTF-8" 42 | 43 | ## Method Summary 44 | 45 | ### getEncoding 46 | 47 | **Signature:** `getEncoding() : String` 48 | 49 | Returns the encoding of the text. 50 | 51 | ### getMimeType 52 | 53 | **Signature:** `getMimeType() : String` 54 | 55 | Returns the mime type of the text. 56 | 57 | ### getText 58 | 59 | **Signature:** `getText() : String` 60 | 61 | Returns the text. 62 | 63 | ## Constructor Detail 64 | 65 | ## Method Detail 66 | 67 | ## Method Details 68 | 69 | ### getEncoding 70 | 71 | **Signature:** `getEncoding() : String` 72 | 73 | **Description:** Returns the encoding of the text. Encoding is set at creation time and can't be changed afterwards 74 | 75 | **Returns:** 76 | 77 | encoding of the text 78 | 79 | --- 80 | 81 | ### getMimeType 82 | 83 | **Signature:** `getMimeType() : String` 84 | 85 | **Description:** Returns the mime type of the text. Mime type is set at creation time and can't be changed afterwards. 86 | 87 | **Returns:** 88 | 89 | the MimeType of the text 90 | 91 | --- 92 | 93 | ### getText 94 | 95 | **Signature:** `getText() : String` 96 | 97 | **Description:** Returns the text. Text is set at creation time and can't be changed afterwards. 98 | 99 | **Returns:** 100 | 101 | text stored 102 | 103 | --- ``` -------------------------------------------------------------------------------- /src/core/handlers/system-object-handler.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { BaseToolHandler, ToolExecutionContext, GenericToolSpec, HandlerContext, ToolArguments } from './base-handler.js'; 2 | import { OCAPIClient } from '../../clients/ocapi-client.js'; 3 | import { ClientFactory } from './client-factory.js'; 4 | import { 5 | SYSTEM_OBJECT_TOOL_CONFIG, 6 | SystemObjectToolName, 7 | SYSTEM_OBJECT_TOOL_NAMES_SET, 8 | } from '../../tool-configs/system-object-tool-config.js'; 9 | 10 | /** 11 | * Handler for system object tools using config-driven dispatch 12 | * Provides access to SFCC system object definitions, attributes, and site preferences 13 | */ 14 | export class SystemObjectToolHandler extends BaseToolHandler<SystemObjectToolName> { 15 | private ocapiClient: OCAPIClient | null = null; 16 | private clientFactory: ClientFactory; 17 | 18 | constructor(context: HandlerContext, subLoggerName: string) { 19 | super(context, subLoggerName); 20 | this.clientFactory = new ClientFactory(context, this.logger); 21 | } 22 | 23 | protected async onInitialize(): Promise<void> { 24 | this.ocapiClient = this.clientFactory.createOCAPIClient(); 25 | if (this.ocapiClient) { 26 | this.logger.debug('OCAPI client initialized for system objects'); 27 | } 28 | } 29 | 30 | protected async onDispose(): Promise<void> { 31 | this.ocapiClient = null; 32 | this.logger.debug('OCAPI client disposed'); 33 | } 34 | 35 | canHandle(toolName: string): boolean { 36 | return SYSTEM_OBJECT_TOOL_NAMES_SET.has(toolName as SystemObjectToolName); 37 | } 38 | 39 | protected getToolNameSet(): Set<SystemObjectToolName> { 40 | return SYSTEM_OBJECT_TOOL_NAMES_SET; 41 | } 42 | 43 | protected getToolConfig(): Record<string, GenericToolSpec<ToolArguments, any>> { 44 | return SYSTEM_OBJECT_TOOL_CONFIG; 45 | } 46 | 47 | protected async createExecutionContext(): Promise<ToolExecutionContext> { 48 | if (!this.ocapiClient) { 49 | throw new Error(ClientFactory.getClientRequiredError('OCAPI')); 50 | } 51 | 52 | return { 53 | handlerContext: this.context, 54 | logger: this.logger, 55 | ocapiClient: this.ocapiClient, 56 | }; 57 | } 58 | } 59 | ``` -------------------------------------------------------------------------------- /docs/dw_object/ExtensibleObject.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.object 2 | 3 | # Class ExtensibleObject 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.object.PersistentObject 9 | - dw.object.ExtensibleObject 10 | 11 | ## Description 12 | 13 | Base class for all persistent business objects in Commerce Cloud Digital that are customizable through the metadata system. All objects in Digital that have custom attributes derive from ExtensibleObject including both system-defined and custom objects. The describe() method provides access to the related object-type metadata. The method getCustom() is the central point to retrieve and store the objects attribute values themselves. 14 | 15 | ## Properties 16 | 17 | ### custom 18 | 19 | **Type:** CustomAttributes (Read Only) 20 | 21 | The custom attributes for this object. The returned object is 22 | used for retrieving and storing attribute values. See 23 | CustomAttributes for a detailed example of the syntax for 24 | working with custom attributes. 25 | 26 | ## Constructor Summary 27 | 28 | ## Method Summary 29 | 30 | ### describe 31 | 32 | **Signature:** `describe() : ObjectTypeDefinition` 33 | 34 | Returns the meta data of this object. 35 | 36 | ### getCustom 37 | 38 | **Signature:** `getCustom() : CustomAttributes` 39 | 40 | Returns the custom attributes for this object. 41 | 42 | ## Method Detail 43 | 44 | ## Method Details 45 | 46 | ### describe 47 | 48 | **Signature:** `describe() : ObjectTypeDefinition` 49 | 50 | **Description:** Returns the meta data of this object. If no meta data is available the method returns null. The returned ObjectTypeDefinition can be used to retrieve the metadata for any of the custom attributes. 51 | 52 | **Returns:** 53 | 54 | the meta data of this object. If no meta data is available the method returns null. 55 | 56 | --- 57 | 58 | ### getCustom 59 | 60 | **Signature:** `getCustom() : CustomAttributes` 61 | 62 | **Description:** Returns the custom attributes for this object. The returned object is used for retrieving and storing attribute values. See CustomAttributes for a detailed example of the syntax for working with custom attributes. 63 | 64 | **Returns:** 65 | 66 | the custom attributes for this object. 67 | 68 | --- ``` -------------------------------------------------------------------------------- /docs/dw_system/JobProcessMonitor.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.system 2 | 3 | # Class JobProcessMonitor 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.system.JobProcessMonitor 9 | 10 | ## Description 11 | 12 | Reserved for future use. 13 | 14 | ## Properties 15 | 16 | ### totalWork 17 | 18 | **Type:** Number 19 | 20 | Reserved for future use. Gets the total work count. 21 | 22 | ### workMessage 23 | 24 | **Type:** String 25 | 26 | Reserved for future use. Gets the work message. 27 | 28 | ## Constructor Summary 29 | 30 | ## Method Summary 31 | 32 | ### getTotalWork 33 | 34 | **Signature:** `getTotalWork() : Number` 35 | 36 | Reserved for future use. 37 | 38 | ### getWorkMessage 39 | 40 | **Signature:** `getWorkMessage() : String` 41 | 42 | Reserved for future use. 43 | 44 | ### setTotalWork 45 | 46 | **Signature:** `setTotalWork(totalWork : Number) : void` 47 | 48 | Reserved for future use. 49 | 50 | ### setWorkMessage 51 | 52 | **Signature:** `setWorkMessage(msg : String) : void` 53 | 54 | Reserved for future use. 55 | 56 | ### worked 57 | 58 | **Signature:** `worked(worked : Number) : void` 59 | 60 | Reserved for future use. 61 | 62 | ## Method Detail 63 | 64 | ## Method Details 65 | 66 | ### getTotalWork 67 | 68 | **Signature:** `getTotalWork() : Number` 69 | 70 | **Description:** Reserved for future use. Gets the total work count. 71 | 72 | **Returns:** 73 | 74 | the total work count. 75 | 76 | --- 77 | 78 | ### getWorkMessage 79 | 80 | **Signature:** `getWorkMessage() : String` 81 | 82 | **Description:** Reserved for future use. Gets the work message. 83 | 84 | **Returns:** 85 | 86 | the work message. 87 | 88 | --- 89 | 90 | ### setTotalWork 91 | 92 | **Signature:** `setTotalWork(totalWork : Number) : void` 93 | 94 | **Description:** Reserved for future use. Sets the total work count. 95 | 96 | **Parameters:** 97 | 98 | - `totalWork`: the total work count. 99 | 100 | --- 101 | 102 | ### setWorkMessage 103 | 104 | **Signature:** `setWorkMessage(msg : String) : void` 105 | 106 | **Description:** Reserved for future use. Sets the work message. 107 | 108 | **Parameters:** 109 | 110 | - `msg`: the messageto use. If msg is null, then an empty string will be used. 111 | 112 | --- 113 | 114 | ### worked 115 | 116 | **Signature:** `worked(worked : Number) : void` 117 | 118 | **Description:** Reserved for future use. Increments the count of work items by the value of the specified parameter. 119 | 120 | **Parameters:** 121 | 122 | - `worked`: the number of items worked. 123 | 124 | --- ``` -------------------------------------------------------------------------------- /docs/dw_system/LogNDC.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.system 2 | 3 | # Class LogNDC 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.system.LogNDC 9 | 10 | ## Description 11 | 12 | A Nested Diagnostic Context, or NDC in short, is an instrument to distinguish interleaved log output from different sources. Log output is typically interleaved when a server handles multiple script calls near-simultaneously. 13 | 14 | ## Constructor Summary 15 | 16 | ## Method Summary 17 | 18 | ### peek 19 | 20 | **Signature:** `peek() : String` 21 | 22 | Looks at the last diagnostic context at the top of this NDC without removing it. 23 | 24 | ### pop 25 | 26 | **Signature:** `pop() : String` 27 | 28 | Clients should call this method before leaving a diagnostic context. 29 | 30 | ### push 31 | 32 | **Signature:** `push(message : String) : void` 33 | 34 | Push new diagnostic context information for the current script execution. 35 | 36 | ### remove 37 | 38 | **Signature:** `remove() : void` 39 | 40 | Remove the diagnostic context for this script call. 41 | 42 | ## Method Detail 43 | 44 | ## Method Details 45 | 46 | ### peek 47 | 48 | **Signature:** `peek() : String` 49 | 50 | **Description:** Looks at the last diagnostic context at the top of this NDC without removing it. The returned value is the value that was pushed last. If no context is available, then the empty string "" is returned. 51 | 52 | **Returns:** 53 | 54 | String The innermost diagnostic context. 55 | 56 | --- 57 | 58 | ### pop 59 | 60 | **Signature:** `pop() : String` 61 | 62 | **Description:** Clients should call this method before leaving a diagnostic context. The returned value is the value that was pushed last. If no context is available, then the empty string "" is returned. NOTE: The NDC is removed after every script execution. 63 | 64 | **Returns:** 65 | 66 | String The innermost diagnostic context. 67 | 68 | --- 69 | 70 | ### push 71 | 72 | **Signature:** `push(message : String) : void` 73 | 74 | **Description:** Push new diagnostic context information for the current script execution. 75 | 76 | **Parameters:** 77 | 78 | - `message`: - The new diagnostic context information. 79 | 80 | --- 81 | 82 | ### remove 83 | 84 | **Signature:** `remove() : void` 85 | 86 | **Description:** Remove the diagnostic context for this script call. 87 | 88 | --- ``` -------------------------------------------------------------------------------- /docs/dw_order.hooks/OrderHooks.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.order.hooks 2 | 3 | # Class OrderHooks 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - dw.order.hooks.OrderHooks 8 | 9 | ## Description 10 | 11 | This interface represents all script hooks that can be registered to customize the order logic. It contains the extension points (hook names), and the functions that are called by each extension point. A function must be defined inside a JavaScript source and must be exported. The script with the exported hook function must be located inside a site cartridge. Inside the site cartridge a 'package.json' file with a 'hooks' entry must exist. "hooks": "./hooks.json" The hooks entry links to a json file, relative to the 'package.json' file. This file lists all registered hooks inside the hooks property: "hooks": [ {"name": "dw.order.createOrderNo", "script": "./orders.ds"}, ] A hook entry has a 'name' and a 'script' property. The 'name' contains the extension point, the hook name. The 'script' contains the script relative to the hooks file, with the exported hook function. 12 | 13 | ## Constants 14 | 15 | ## Properties 16 | 17 | ## Constructor Summary 18 | 19 | ## Method Summary 20 | 21 | ### createOrderNo 22 | 23 | **Signature:** `createOrderNo() : String` 24 | 25 | This hook is responsible for creating a new order number. 26 | 27 | ## Method Detail 28 | 29 | ## Method Details 30 | 31 | ### createOrderNo 32 | 33 | **Signature:** `createOrderNo() : String` 34 | 35 | **Description:** This hook is responsible for creating a new order number. By default order numbers are generated by using OrderMgr.createOrderSequenceNo(). Use this hook to customize the order number generation. E.g. a prefix or suffix could be added. exports.createOrderNo = function(){ var orderSeqNo = OrderMgr.createOrderSequenceNo(); var prefix = Site.getCurrent().getSiteId(); return prefix + "_"+orderSeqNo; }; If the method returns null or an blank string order number generation will fall back to OrderMgr.createOrderSequenceNo(). The maximum length of the order number is 50 characters. 36 | 37 | **Returns:** 38 | 39 | the order number 40 | 41 | --- ``` -------------------------------------------------------------------------------- /docs/dw_net/SFTPFileInfo.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.net 2 | 3 | # Class SFTPFileInfo 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.net.SFTPFileInfo 9 | 10 | ## Description 11 | 12 | The class is used to store information about a remote file. Note: when this class is used with sensitive data, be careful in persisting sensitive information to disk. 13 | 14 | ## Properties 15 | 16 | ### directory 17 | 18 | **Type:** boolean (Read Only) 19 | 20 | Identifies if the file is a directory. 21 | 22 | ### modificationTime 23 | 24 | **Type:** Date (Read Only) 25 | 26 | The last modification time of the file/directory. 27 | 28 | ### name 29 | 30 | **Type:** String (Read Only) 31 | 32 | The name of the file/directory. 33 | 34 | ### size 35 | 36 | **Type:** Number (Read Only) 37 | 38 | The size of the file/directory. 39 | 40 | ## Constructor Summary 41 | 42 | SFTPFileInfo(name : String, size : Number, directory : boolean, mtime : Number) Constructs the SFTPFileInfo instance. 43 | 44 | ## Method Summary 45 | 46 | ### getDirectory 47 | 48 | **Signature:** `getDirectory() : boolean` 49 | 50 | Identifies if the file is a directory. 51 | 52 | ### getModificationTime 53 | 54 | **Signature:** `getModificationTime() : Date` 55 | 56 | Returns the last modification time of the file/directory. 57 | 58 | ### getName 59 | 60 | **Signature:** `getName() : String` 61 | 62 | Returns the name of the file/directory. 63 | 64 | ### getSize 65 | 66 | **Signature:** `getSize() : Number` 67 | 68 | Returns the size of the file/directory. 69 | 70 | ## Constructor Detail 71 | 72 | ## Method Detail 73 | 74 | ## Method Details 75 | 76 | ### getDirectory 77 | 78 | **Signature:** `getDirectory() : boolean` 79 | 80 | **Description:** Identifies if the file is a directory. 81 | 82 | **Returns:** 83 | 84 | true if the file is a directory, false otherwise. 85 | 86 | --- 87 | 88 | ### getModificationTime 89 | 90 | **Signature:** `getModificationTime() : Date` 91 | 92 | **Description:** Returns the last modification time of the file/directory. 93 | 94 | **Returns:** 95 | 96 | the last modification time. 97 | 98 | --- 99 | 100 | ### getName 101 | 102 | **Signature:** `getName() : String` 103 | 104 | **Description:** Returns the name of the file/directory. 105 | 106 | **Returns:** 107 | 108 | the name. 109 | 110 | --- 111 | 112 | ### getSize 113 | 114 | **Signature:** `getSize() : Number` 115 | 116 | **Description:** Returns the size of the file/directory. 117 | 118 | **Returns:** 119 | 120 | the size. 121 | 122 | --- ``` -------------------------------------------------------------------------------- /docs/dw_io/StringWriter.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.io 2 | 3 | # Class StringWriter 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.io.Writer 9 | - dw.io.StringWriter 10 | 11 | ## Description 12 | 13 | A Writer that can be used to generate a String. In most cases it is not necessary to use StringWriter. If the final destination of the output is a file, use FileWriter directly. This will help to reduce memory usage. If you wish to transfer a feed to a remote FTP, SFTP or WebDAV server, first write the feed to the file system using FileWriter and optionally CSVStreamWriter or XMLStreamWriter, then upload the file with FTPClient.putBinary(String, File), SFTPClient.putBinary(String, File), or WebDAVClient.put(String, File). Note: when this class is used with sensitive data, be careful in persisting sensitive information to disk. 14 | 15 | ## Constructor Summary 16 | 17 | StringWriter() Creates a new StringWriter. 18 | 19 | ## Method Summary 20 | 21 | ### toString 22 | 23 | **Signature:** `toString() : String` 24 | 25 | Returns a string representation of this writer. 26 | 27 | ### write 28 | 29 | **Signature:** `write(str : String) : void` 30 | 31 | Write the given string to the stream. 32 | 33 | ### write 34 | 35 | **Signature:** `write(str : String, off : Number, len : Number) : void` 36 | 37 | Write the given string to the stream. 38 | 39 | ## Constructor Detail 40 | 41 | ## Method Detail 42 | 43 | ## Method Details 44 | 45 | ### toString 46 | 47 | **Signature:** `toString() : String` 48 | 49 | **Description:** Returns a string representation of this writer. 50 | 51 | **Returns:** 52 | 53 | a string representation of this writer. 54 | 55 | --- 56 | 57 | ### write 58 | 59 | **Signature:** `write(str : String) : void` 60 | 61 | **Description:** Write the given string to the stream. 62 | 63 | **Parameters:** 64 | 65 | - `str`: the string to write to the stream. 66 | 67 | --- 68 | 69 | ### write 70 | 71 | **Signature:** `write(str : String, off : Number, len : Number) : void` 72 | 73 | **Description:** Write the given string to the stream. 74 | 75 | **Parameters:** 76 | 77 | - `str`: the string to write to the stream. 78 | - `off`: the offset from which to start writing characters to the stream. 79 | - `len`: the number of characters to write from the stream. 80 | 81 | --- ``` -------------------------------------------------------------------------------- /tests/servers/sfcc-mock-server/src/routes/ocapi.js: -------------------------------------------------------------------------------- ```javascript 1 | /** 2 | * OCAPI Route Handler 3 | * 4 | * Lightweight orchestrator that delegates OCAPI requests to specialized handlers. 5 | * Follows single responsibility principle with modular handler architecture. 6 | */ 7 | 8 | const express = require('express'); 9 | const MockDataLoader = require('../utils/mock-data-loader'); 10 | 11 | // Import modular handlers 12 | const OAuthHandler = require('./ocapi/oauth-handler'); 13 | const SystemObjectsHandler = require('./ocapi/system-objects-handler'); 14 | const SitePreferencesHandler = require('./ocapi/site-preferences-handler'); 15 | const CodeVersionsHandler = require('./ocapi/code-versions-handler'); 16 | 17 | class OCAPIRouteHandler { 18 | constructor(config, authManager) { 19 | this.config = config; 20 | this.authManager = authManager; 21 | this.dataLoader = new MockDataLoader(config.mockDataPath); 22 | this.router = express.Router(); 23 | this.setupRoutes(); 24 | } 25 | 26 | setupRoutes() { 27 | // Initialize modular handlers 28 | const oAuthHandler = new OAuthHandler(this.authManager); 29 | const systemObjectsHandler = new SystemObjectsHandler(this.config, this.dataLoader); 30 | const sitePreferencesHandler = new SitePreferencesHandler(this.config, this.dataLoader); 31 | const codeVersionsHandler = new CodeVersionsHandler(this.config, this.dataLoader); 32 | 33 | // OAuth routes (no authentication required) 34 | this.router.use('/', oAuthHandler.getRouter()); 35 | 36 | // Apply authentication middleware to all OCAPI data endpoints 37 | const requireAuth = this.authManager.requireAuth(); 38 | 39 | // Mount authenticated handlers 40 | this.router.use('/', requireAuth, systemObjectsHandler.getRouter()); 41 | this.router.use('/', requireAuth, sitePreferencesHandler.getRouter()); 42 | this.router.use('/', requireAuth, codeVersionsHandler.getRouter()); 43 | } 44 | 45 | /** 46 | * Get the configured router 47 | */ 48 | getRouter() { 49 | return this.router; 50 | } 51 | } 52 | 53 | module.exports = OCAPIRouteHandler; ``` -------------------------------------------------------------------------------- /src/utils/job-log-utils.ts: -------------------------------------------------------------------------------- ```typescript 1 | /** 2 | * Shared utilities for job log operations 3 | */ 4 | 5 | export class JobLogValidators { 6 | /** 7 | * Allowed log levels for job logs (includes 'all' for job-specific operations) 8 | */ 9 | static readonly ALLOWED_LEVELS = ['error', 'warn', 'info', 'debug', 'all'] as const; 10 | 11 | /** 12 | * Validate job log level parameter 13 | * @param level - The level to validate 14 | * @param toolName - Optional tool name for better error messages 15 | */ 16 | static validateJobLogLevel(level: string, toolName?: string): void { 17 | if (!this.ALLOWED_LEVELS.includes(level as any)) { 18 | const errorPrefix = toolName ? `${toolName}: ` : ''; 19 | throw new Error( 20 | `${errorPrefix}Invalid log level: ${level}. Must be one of: ${this.ALLOWED_LEVELS.join(', ')}`, 21 | ); 22 | } 23 | } 24 | 25 | /** 26 | * Get default limit based on operation type 27 | * @param operationType - Type of operation ('search' | 'entries' | 'files') 28 | */ 29 | static getDefaultLimit(operationType: 'search' | 'entries' | 'files'): number { 30 | switch (operationType) { 31 | case 'search': 32 | return 20; 33 | case 'entries': 34 | return 10; 35 | case 'files': 36 | return 10; 37 | default: 38 | return 10; 39 | } 40 | } 41 | } 42 | 43 | export class JobLogFormatters { 44 | /** 45 | * Format a consistent log message for job operations 46 | * @param operation - The operation being performed 47 | * @param params - Parameters for the operation 48 | */ 49 | static formatJobLogMessage( 50 | operation: string, 51 | params: { 52 | jobName?: string; 53 | level?: string; 54 | limit?: number; 55 | pattern?: string; 56 | }, 57 | ): string { 58 | const parts = [operation]; 59 | 60 | if (params.jobName) { 61 | parts.push(`jobName=${params.jobName}`); 62 | } 63 | 64 | if (params.level) { 65 | parts.push(`level=${params.level}`); 66 | } 67 | 68 | if (params.limit !== undefined) { 69 | parts.push(`limit=${params.limit}`); 70 | } 71 | 72 | if (params.pattern) { 73 | parts.push(`pattern="${params.pattern}"`); 74 | } 75 | 76 | return parts.join(' '); 77 | } 78 | } 79 | ``` -------------------------------------------------------------------------------- /docs/dw_object/Note.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.object 2 | 3 | # Class Note 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.object.Note 9 | 10 | ## Description 11 | 12 | Represents a note that can be attached to any persistent object that supports this feature. 13 | 14 | ## Properties 15 | 16 | ### createdBy 17 | 18 | **Type:** String (Read Only) 19 | 20 | Return the login ID of user that is stored in the session at the time 21 | the note is created. 22 | 23 | ### creationDate 24 | 25 | **Type:** Date (Read Only) 26 | 27 | Return the date and time that the note was created. This is usually 28 | set by the system, but may be specified if the note is generated 29 | via an import. 30 | 31 | ### subject 32 | 33 | **Type:** String (Read Only) 34 | 35 | Return the subject of the note. 36 | 37 | ### text 38 | 39 | **Type:** String (Read Only) 40 | 41 | Return the text of the note. 42 | 43 | ## Constructor Summary 44 | 45 | ## Method Summary 46 | 47 | ### getCreatedBy 48 | 49 | **Signature:** `getCreatedBy() : String` 50 | 51 | Return the login ID of user that is stored in the session at the time the note is created. 52 | 53 | ### getCreationDate 54 | 55 | **Signature:** `getCreationDate() : Date` 56 | 57 | Return the date and time that the note was created. 58 | 59 | ### getSubject 60 | 61 | **Signature:** `getSubject() : String` 62 | 63 | Return the subject of the note. 64 | 65 | ### getText 66 | 67 | **Signature:** `getText() : String` 68 | 69 | Return the text of the note. 70 | 71 | ## Method Detail 72 | 73 | ## Method Details 74 | 75 | ### getCreatedBy 76 | 77 | **Signature:** `getCreatedBy() : String` 78 | 79 | **Description:** Return the login ID of user that is stored in the session at the time the note is created. 80 | 81 | **Returns:** 82 | 83 | the username. 84 | 85 | --- 86 | 87 | ### getCreationDate 88 | 89 | **Signature:** `getCreationDate() : Date` 90 | 91 | **Description:** Return the date and time that the note was created. This is usually set by the system, but may be specified if the note is generated via an import. 92 | 93 | **Returns:** 94 | 95 | the creation date. 96 | 97 | --- 98 | 99 | ### getSubject 100 | 101 | **Signature:** `getSubject() : String` 102 | 103 | **Description:** Return the subject of the note. 104 | 105 | **Returns:** 106 | 107 | the subject. 108 | 109 | --- 110 | 111 | ### getText 112 | 113 | **Signature:** `getText() : String` 114 | 115 | **Description:** Return the text of the note. 116 | 117 | **Returns:** 118 | 119 | the text. 120 | 121 | --- ``` -------------------------------------------------------------------------------- /docs/dw_io/XMLIndentingStreamWriter.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.io 2 | 3 | # Class XMLIndentingStreamWriter 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.io.XMLStreamWriter 9 | - dw.io.XMLIndentingStreamWriter 10 | 11 | ## Description 12 | 13 | A XMLIndentingStreamWriter writes the XML output formatted for good readability. Note: when this class is used with sensitive data, be careful in persisting sensitive information to disk. 14 | 15 | ## Properties 16 | 17 | ### indent 18 | 19 | **Type:** String 20 | 21 | The indent. 22 | 23 | ### newLine 24 | 25 | **Type:** String 26 | 27 | The string that is used for a new line character. The 28 | default is the normal new line character. 29 | 30 | ## Constructor Summary 31 | 32 | XMLIndentingStreamWriter(writer : Writer) Constructs the writer for the specified writer. 33 | 34 | ## Method Summary 35 | 36 | ### getIndent 37 | 38 | **Signature:** `getIndent() : String` 39 | 40 | Returns the indent. 41 | 42 | ### getNewLine 43 | 44 | **Signature:** `getNewLine() : String` 45 | 46 | Returns the string that is used for a new line character. 47 | 48 | ### setIndent 49 | 50 | **Signature:** `setIndent(indent : String) : void` 51 | 52 | Specifies a string that will be used as identing characters. 53 | 54 | ### setNewLine 55 | 56 | **Signature:** `setNewLine(newLine : String) : void` 57 | 58 | Sets the string that is used for a new line character. 59 | 60 | ## Constructor Detail 61 | 62 | ## Method Detail 63 | 64 | ## Method Details 65 | 66 | ### getIndent 67 | 68 | **Signature:** `getIndent() : String` 69 | 70 | **Description:** Returns the indent. 71 | 72 | **Returns:** 73 | 74 | Returns the indent. 75 | 76 | --- 77 | 78 | ### getNewLine 79 | 80 | **Signature:** `getNewLine() : String` 81 | 82 | **Description:** Returns the string that is used for a new line character. The default is the normal new line character. 83 | 84 | **Returns:** 85 | 86 | the new line. 87 | 88 | --- 89 | 90 | ### setIndent 91 | 92 | **Signature:** `setIndent(indent : String) : void` 93 | 94 | **Description:** Specifies a string that will be used as identing characters. The default are two space characters. 95 | 96 | **Parameters:** 97 | 98 | - `indent`: The indent to set. 99 | 100 | --- 101 | 102 | ### setNewLine 103 | 104 | **Signature:** `setNewLine(newLine : String) : void` 105 | 106 | **Description:** Sets the string that is used for a new line character. 107 | 108 | **Parameters:** 109 | 110 | - `newLine`: The newLine to set. 111 | 112 | --- ``` -------------------------------------------------------------------------------- /src/core/handlers/cartridge-handler.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { BaseToolHandler, ToolExecutionContext, GenericToolSpec, HandlerContext, ToolArguments } from './base-handler.js'; 2 | import { CartridgeGenerationClient } from '../../clients/cartridge-generation-client.js'; 3 | import { ClientFactory } from './client-factory.js'; 4 | import { 5 | CARTRIDGE_TOOL_CONFIG, 6 | CartridgeToolName, 7 | CARTRIDGE_TOOL_NAMES_SET, 8 | } from '../../tool-configs/cartridge-tool-config.js'; 9 | 10 | /** 11 | * Handler for cartridge generation tools using config-driven dispatch 12 | * Provides automated cartridge structure creation with complete project setup 13 | */ 14 | export class CartridgeToolHandler extends BaseToolHandler<CartridgeToolName> { 15 | private cartridgeClient: CartridgeGenerationClient | null = null; 16 | private clientFactory: ClientFactory; 17 | 18 | constructor(context: HandlerContext, subLoggerName: string) { 19 | super(context, subLoggerName); 20 | this.clientFactory = new ClientFactory(context, this.logger); 21 | } 22 | 23 | protected async onInitialize(): Promise<void> { 24 | if (!this.cartridgeClient) { 25 | this.cartridgeClient = this.clientFactory.createCartridgeClient(); 26 | this.logger.debug('Cartridge generation client initialized'); 27 | } 28 | } 29 | 30 | protected async onDispose(): Promise<void> { 31 | this.cartridgeClient = null; 32 | this.logger.debug('Cartridge generation client disposed'); 33 | } 34 | 35 | canHandle(toolName: string): boolean { 36 | return CARTRIDGE_TOOL_NAMES_SET.has(toolName as CartridgeToolName); 37 | } 38 | 39 | protected getToolNameSet(): Set<CartridgeToolName> { 40 | return CARTRIDGE_TOOL_NAMES_SET; 41 | } 42 | 43 | protected getToolConfig(): Record<string, GenericToolSpec<ToolArguments, any>> { 44 | return CARTRIDGE_TOOL_CONFIG; 45 | } 46 | 47 | protected async createExecutionContext(): Promise<ToolExecutionContext> { 48 | if (!this.cartridgeClient) { 49 | throw new Error('Cartridge generation client not initialized'); 50 | } 51 | 52 | return { 53 | handlerContext: this.context, 54 | logger: this.logger, 55 | cartridgeClient: this.cartridgeClient, 56 | }; 57 | } 58 | } 59 | ``` -------------------------------------------------------------------------------- /docs/dw_system/RequestHooks.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.system 2 | 3 | # Class RequestHooks 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - dw.system.RequestHooks 8 | 9 | ## Description 10 | 11 | This class represents all script hooks that can be registered to receive notifications about storefront requests. It contains the extension points (hook names), and the functions that are called by each extension point. A function must be defined inside a JavaScript source and must be exported. The script with the exported hook function must be located inside a site cartridge. Inside the site cartridge a 'package.json' file with a 'hooks' entry must exist. "hooks": "./hooks.json" The hooks entry links to a json file, relative to the 'package.json' file. This file lists all registered hooks inside the hooks property: "hooks": [ {"name": "dw.system.request.onSession", "script": "./script.js"}, {"name": "dw.system.request.onRequest", "script": "./script.js"}, ] A hook entry has a 'name' and a 'script' property. The 'name' contains the extension point, the hook name. The 'script' contains the script relative to the hooks file, with the exported hook function. 12 | 13 | ## Constants 14 | 15 | ## Properties 16 | 17 | ## Constructor Summary 18 | 19 | ## Method Summary 20 | 21 | ### onRequest 22 | 23 | **Signature:** `onRequest() : Status` 24 | 25 | The function is called by extension point extensionPointOnRequest. 26 | 27 | ### onSession 28 | 29 | **Signature:** `onSession() : Status` 30 | 31 | The function is called by extension point extensionPointOnSession. 32 | 33 | ## Method Detail 34 | 35 | ## Method Details 36 | 37 | ### onRequest 38 | 39 | **Signature:** `onRequest() : Status` 40 | 41 | **Description:** The function is called by extension point extensionPointOnRequest. It is called when a storefront request was received from the client. 42 | 43 | **Returns:** 44 | 45 | Status.OK for success.Status.ERROR for error. 46 | 47 | --- 48 | 49 | ### onSession 50 | 51 | **Signature:** `onSession() : Status` 52 | 53 | **Description:** The function is called by extension point extensionPointOnSession. It is called when a new storefront session was started. 54 | 55 | **Returns:** 56 | 57 | Status.OK for success.Status.ERROR for error. 58 | 59 | --- ``` -------------------------------------------------------------------------------- /docs-site/components/ToolFilters.tsx: -------------------------------------------------------------------------------- ```typescript 1 | import React from 'react'; 2 | import { TOOL_CATEGORIES, tools } from '../utils/toolsData'; 3 | 4 | interface ToolFiltersProps { 5 | activeCategory: string; 6 | setActiveCategory: (c: string) => void; 7 | search: string; 8 | setSearch: (s: string) => void; 9 | } 10 | 11 | const ToolFilters: React.FC<ToolFiltersProps> = ({ activeCategory, setActiveCategory, search, setSearch }) => { 12 | const categories = ['All', ...TOOL_CATEGORIES]; 13 | const counts: Record<string, number> = React.useMemo(() => { 14 | const base: Record<string, number> = { All: tools.length }; 15 | TOOL_CATEGORIES.forEach(cat => { base[cat] = tools.filter(t => t.category === cat).length; }); 16 | return base; 17 | }, []); 18 | return ( 19 | <div className="space-y-4"> 20 | <div className="flex flex-wrap gap-2"> 21 | {categories.map(cat => { 22 | const active = activeCategory === cat; 23 | return ( 24 | <button key={cat} onClick={() => setActiveCategory(cat)} className={`text-xs px-3 py-1.5 rounded-full border transition font-medium flex items-center gap-2 ${active ? 'bg-gradient-to-r from-blue-600 to-purple-600 text-white border-blue-600 shadow' : 'bg-white text-gray-700 border-gray-200 hover:border-blue-400 hover:text-blue-600'}`}> 25 | <span>{cat}</span> 26 | <span className={`text-[10px] px-1.5 py-0.5 rounded-full ${active ? 'bg-white/20 border border-white/30' : 'bg-gray-100 text-gray-600'}`}>{counts[cat]}</span> 27 | </button> 28 | ); 29 | })} 30 | </div> 31 | <div className="relative max-w-sm"> 32 | <input value={search} onChange={e=>setSearch(e.target.value)} placeholder="Search tools or prompts..." className="w-full border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" /> 33 | {search && <button onClick={()=>setSearch('')} className="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 text-xs">Clear</button>} 34 | </div> 35 | </div> 36 | ); 37 | }; 38 | 39 | export default ToolFilters; 40 | ``` -------------------------------------------------------------------------------- /src/core/handlers/code-version-handler.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { BaseToolHandler, ToolExecutionContext, GenericToolSpec, HandlerContext, ToolArguments } from './base-handler.js'; 2 | import { OCAPICodeVersionsClient } from '../../clients/ocapi/code-versions-client.js'; 3 | import { ClientFactory } from './client-factory.js'; 4 | import { 5 | CODE_VERSION_TOOL_CONFIG, 6 | CodeVersionToolName, 7 | CODE_VERSION_TOOL_NAMES_SET, 8 | } from '../../tool-configs/code-version-tool-config.js'; 9 | 10 | /** 11 | * Handler for code version management tools using config-driven dispatch 12 | * Provides code version listing, activation, and deployment management 13 | */ 14 | export class CodeVersionToolHandler extends BaseToolHandler<CodeVersionToolName> { 15 | private codeVersionsClient: OCAPICodeVersionsClient | null = null; 16 | private clientFactory: ClientFactory; 17 | 18 | constructor(context: HandlerContext, subLoggerName: string) { 19 | super(context, subLoggerName); 20 | this.clientFactory = new ClientFactory(context, this.logger); 21 | } 22 | 23 | protected async onInitialize(): Promise<void> { 24 | this.codeVersionsClient = this.clientFactory.createCodeVersionsClient(); 25 | if (this.codeVersionsClient) { 26 | this.logger.debug('Code versions client initialized'); 27 | } 28 | } 29 | 30 | protected async onDispose(): Promise<void> { 31 | this.codeVersionsClient = null; 32 | this.logger.debug('Code versions client disposed'); 33 | } 34 | 35 | canHandle(toolName: string): boolean { 36 | return CODE_VERSION_TOOL_NAMES_SET.has(toolName as CodeVersionToolName); 37 | } 38 | 39 | protected getToolNameSet(): Set<CodeVersionToolName> { 40 | return CODE_VERSION_TOOL_NAMES_SET; 41 | } 42 | 43 | protected getToolConfig(): Record<string, GenericToolSpec<ToolArguments, any>> { 44 | return CODE_VERSION_TOOL_CONFIG; 45 | } 46 | 47 | protected async createExecutionContext(): Promise<ToolExecutionContext> { 48 | if (!this.codeVersionsClient) { 49 | throw new Error(ClientFactory.getClientRequiredError('OCAPI')); 50 | } 51 | 52 | return { 53 | handlerContext: this.context, 54 | logger: this.logger, 55 | codeVersionsClient: this.codeVersionsClient, 56 | }; 57 | } 58 | } 59 | ``` -------------------------------------------------------------------------------- /src/utils/query-builder.ts: -------------------------------------------------------------------------------- ```typescript 1 | /** 2 | * Query Builder Utility 3 | * 4 | * This module provides utilities for building query strings and handling URL parameters 5 | * for SFCC API requests with proper encoding and array handling. 6 | */ 7 | 8 | /** 9 | * Query parameter builder for SFCC APIs 10 | */ 11 | export class QueryBuilder { 12 | private params: URLSearchParams; 13 | 14 | constructor() { 15 | this.params = new URLSearchParams(); 16 | } 17 | 18 | /** 19 | * Add a parameter to the query string 20 | */ 21 | add(key: string, value: string | number | boolean): QueryBuilder { 22 | if (value !== undefined && value !== null) { 23 | this.params.append(key, value.toString()); 24 | } 25 | return this; 26 | } 27 | 28 | /** 29 | * Add an array parameter with proper handling for different parameter types 30 | */ 31 | addArray(key: string, values: (string | number)[]): QueryBuilder { 32 | if (!Array.isArray(values) || values.length === 0) { 33 | return this; 34 | } 35 | 36 | if (key === 'refine') { 37 | // Special handling for OCAPI refine parameters (multiple entries) 38 | values.forEach(value => this.params.append(key, value.toString())); 39 | } else { 40 | // Join arrays with comma for most parameters 41 | this.params.append(key, values.join(',')); 42 | } 43 | 44 | return this; 45 | } 46 | 47 | /** 48 | * Add multiple parameters from an object 49 | */ 50 | addFromObject(params: Record<string, any>): QueryBuilder { 51 | Object.entries(params).forEach(([key, value]) => { 52 | if (value !== undefined && value !== null) { 53 | if (Array.isArray(value)) { 54 | this.addArray(key, value); 55 | } else { 56 | this.add(key, value); 57 | } 58 | } 59 | }); 60 | return this; 61 | } 62 | 63 | /** 64 | * Build the final query string 65 | */ 66 | build(): string { 67 | return this.params.toString(); 68 | } 69 | 70 | /** 71 | * Reset the builder 72 | */ 73 | reset(): QueryBuilder { 74 | this.params = new URLSearchParams(); 75 | return this; 76 | } 77 | 78 | /** 79 | * Static method to build query string from object 80 | */ 81 | static fromObject(params: Record<string, any>): string { 82 | return new QueryBuilder().addFromObject(params).build(); 83 | } 84 | } 85 | ``` -------------------------------------------------------------------------------- /docs/dw_system/SitePreferences.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.system 2 | 3 | # Class SitePreferences 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.object.PersistentObject 9 | - dw.object.ExtensibleObject 10 | - dw.system.SitePreferences 11 | 12 | ## Description 13 | 14 | SitePreferences is a container for custom site-level attributes. The object corresponds with system object type "SitePreferences". It has no system attributes and exists only as a place for merchants to define custom attributes which need to be available for each site. Logically there is only one SitePreferences instance per site. The instance is obtained by calling Site.getPreferences(). Once an instance of the container is obtained, it is possible to read/write site preference values by using the usual syntax for ExtensibleObject instances. For example: var sitePrefs : SitePreferences = dw.system.Site.getCurrent().getPreferences(); var mySitePrefValue : String = sitePrefs.getCustom()["mySitePref"]; Note: this class allows access to sensitive security-related data. Pay special attention to PCI DSS v3. requirements 2, 4, and 12. Commerce Cloud Digital defines many site-level preferences, relating to baskets, timezone, locales, customers, etc, which can be managed within the "Site Preferences" module of the Business Manager, but these preferences are not accessible through this object. (SourceCodeURLParameterName is the one exception to this rule.) 15 | 16 | ## Properties 17 | 18 | ### sourceCodeURLParameterName 19 | 20 | **Type:** String (Read Only) 21 | 22 | The name of the source code url paremeter configured for the 23 | site. 24 | 25 | ## Constructor Summary 26 | 27 | ## Method Summary 28 | 29 | ### getSourceCodeURLParameterName 30 | 31 | **Signature:** `getSourceCodeURLParameterName() : String` 32 | 33 | Returns the name of the source code url paremeter configured for the site. 34 | 35 | ## Method Detail 36 | 37 | ## Method Details 38 | 39 | ### getSourceCodeURLParameterName 40 | 41 | **Signature:** `getSourceCodeURLParameterName() : String` 42 | 43 | **Description:** Returns the name of the source code url paremeter configured for the site. 44 | 45 | **Returns:** 46 | 47 | source code url parameter name 48 | 49 | --- ``` -------------------------------------------------------------------------------- /docs/TopLevel/Error.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: TopLevel 2 | 3 | # Class Error 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - Error 9 | 10 | ## Description 11 | 12 | Error represents a generic exception. 13 | 14 | ## Properties 15 | 16 | ### message 17 | 18 | **Type:** String 19 | 20 | An error message that provides details about the exception. 21 | 22 | ### name 23 | 24 | **Type:** String 25 | 26 | The name of the error based on the constructor used. 27 | 28 | ### stack 29 | 30 | **Type:** String 31 | 32 | The script stack trace. 33 | This property is filled on throwing or via an explicit call captureStackTrace(Error, Function). 34 | 35 | ## Constructor Summary 36 | 37 | Error() Constructs the Error object. 38 | 39 | Error(msg : String) Constructs the Error object using the specified message. 40 | 41 | ## Method Summary 42 | 43 | ### captureStackTrace 44 | 45 | **Signature:** `static captureStackTrace(error : Error, constructorOpt : Function) : void` 46 | 47 | Fills the stack property for the passed error. 48 | 49 | ### toString 50 | 51 | **Signature:** `toString() : String` 52 | 53 | Returns a String representation of the Error. 54 | 55 | ## Constructor Detail 56 | 57 | ## Method Detail 58 | 59 | ## Method Details 60 | 61 | ### captureStackTrace 62 | 63 | **Signature:** `static captureStackTrace(error : Error, constructorOpt : Function) : void` 64 | 65 | **Description:** Fills the stack property for the passed error. The optional constructorOpt parameter allows you to pass in a function value. When collecting the stack trace all frames above the topmost call to this function, including that call, are left out of the stack trace. This can be useful to hide implementation details that won’t be useful to the user. The usual way of defining a custom error that captures a stack trace would be: function MyError() { // fill the stack trace, but hide the call to MyError Error.captureStackTrace(this, MyError); } 66 | 67 | **API Versioned:** 68 | 69 | From version 21.2. 70 | 71 | **Parameters:** 72 | 73 | - `error`: The error whose stack trace should be filled. 74 | - `constructorOpt`: An optional filter to hide the topmost stack frames. 75 | 76 | --- 77 | 78 | ### toString 79 | 80 | **Signature:** `toString() : String` 81 | 82 | **Description:** Returns a String representation of the Error. 83 | 84 | **Returns:** 85 | 86 | a String representation of the Error. 87 | 88 | --- ``` -------------------------------------------------------------------------------- /tests/servers/sfcc-mock-server/mock-data/ocapi/system-object-attribute-groups-category.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "_v": "23.2", 3 | "_type": "object_attribute_group_search_result", 4 | "count": 6, 5 | "hits": [ 6 | { 7 | "_type": "object_attribute_group", 8 | "_resource_state": "725cfb77da0718c12083846811819be73641bc2ac674cae8f5588db9058dde79", 9 | "id": "ExternalSearch", 10 | "link": "https://localhost:3000/s/-/dw/data/v23_2/system_object_definitions/Category/attribute_groups/ExternalSearch" 11 | }, 12 | { 13 | "_type": "object_attribute_group", 14 | "_resource_state": "31ad3c262c0bebb9aa39db3f558dbb16c6cf2f76de016df268d110f51469c42b", 15 | "id": "Presentation", 16 | "link": "https://localhost:3000/s/-/dw/data/v23_2/system_object_definitions/Category/attribute_groups/Presentation" 17 | }, 18 | { 19 | "_type": "object_attribute_group", 20 | "_resource_state": "b09a3a5aa52110b13baa7206d34d3cdd8260216087712ba267861885a4981609", 21 | "id": "SearchRanking", 22 | "link": "https://localhost:3000/s/-/dw/data/v23_2/system_object_definitions/Category/attribute_groups/SearchRanking" 23 | }, 24 | { 25 | "_type": "object_attribute_group", 26 | "_resource_state": "08a38cfa148750c5949ac5625bd3ad5ebd0ab372cbadf933d197f542f9fc4185", 27 | "id": "SiteMap", 28 | "link": "https://localhost:3000/s/-/dw/data/v23_2/system_object_definitions/Category/attribute_groups/SiteMap" 29 | }, 30 | { 31 | "_type": "object_attribute_group", 32 | "_resource_state": "552e4186fc4e97e07f7839c8cf1aaf41009dcd8b82efb35c8d025b4384595eb8", 33 | "id": "VariationGroups", 34 | "link": "https://localhost:3000/s/-/dw/data/v23_2/system_object_definitions/Category/attribute_groups/VariationGroups" 35 | }, 36 | { 37 | "_type": "object_attribute_group", 38 | "_resource_state": "501f3723e08441d2f5f061c21e7efa0f68a9f86d6950ccae6fc8c8d9839441a3", 39 | "id": "customAttributes", 40 | "link": "https://localhost:3000/s/-/dw/data/v23_2/system_object_definitions/Category/attribute_groups/customAttributes" 41 | } 42 | ], 43 | "query": { 44 | "match_all_query": { 45 | "_type": "match_all_query" 46 | } 47 | }, 48 | "start": 0, 49 | "total": 6 50 | } ``` -------------------------------------------------------------------------------- /docs/dw_util/Iterator.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.util 2 | 3 | # Class Iterator 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.util.Iterator 9 | 10 | ## Description 11 | 12 | The Iterator class allows you to access items in a collection. 13 | 14 | ## Constructor Summary 15 | 16 | ## Method Summary 17 | 18 | ### asList 19 | 20 | **Signature:** `asList() : List` 21 | 22 | Convert the iterator into a list. 23 | 24 | ### asList 25 | 26 | **Signature:** `asList(start : Number, size : Number) : List` 27 | 28 | Converts a sub-sequence within the iterator into a list. 29 | 30 | ### hasNext 31 | 32 | **Signature:** `hasNext() : boolean` 33 | 34 | Indicates if there are more elements. 35 | 36 | ### next 37 | 38 | **Signature:** `next() : Object` 39 | 40 | Returns the next element from the Iterator. 41 | 42 | ## Method Detail 43 | 44 | ## Method Details 45 | 46 | ### asList 47 | 48 | **Signature:** `asList() : List` 49 | 50 | **Description:** Convert the iterator into a list. After this conversion the iterator is empty and hasNext() will always return false. Note: This method should be used with care. For example a large database result is pulled into memory completely with this method and can cause an OutOfMemory situation. 51 | 52 | **Returns:** 53 | 54 | the iterator as a list. 55 | 56 | --- 57 | 58 | ### asList 59 | 60 | **Signature:** `asList(start : Number, size : Number) : List` 61 | 62 | **Description:** Converts a sub-sequence within the iterator into a list. Note: This method should be used with care. For example a large database result is pulled into memory completely with this method and can cause an OutOfMemory situation. 63 | 64 | **Parameters:** 65 | 66 | - `start`: the number of elements to iterate before adding elements to the sublist. Negative values are treated as 0. 67 | - `size`: the maximum number of elements to add to the sublist. Nonpositive values always result in empty list. 68 | 69 | **Returns:** 70 | 71 | a sub-sequence within the iterator into a list. 72 | 73 | --- 74 | 75 | ### hasNext 76 | 77 | **Signature:** `hasNext() : boolean` 78 | 79 | **Description:** Indicates if there are more elements. 80 | 81 | **Returns:** 82 | 83 | true if there are more elements, false otherwise. 84 | 85 | --- 86 | 87 | ### next 88 | 89 | **Signature:** `next() : Object` 90 | 91 | **Description:** Returns the next element from the Iterator. 92 | 93 | **Returns:** 94 | 95 | the next element from the Iterator. 96 | 97 | --- ``` -------------------------------------------------------------------------------- /docs/dw_io/CSVStreamReader.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.io 2 | 3 | # Class CSVStreamReader 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.io.CSVStreamReader 9 | 10 | ## Description 11 | 12 | The class supports reading a CSV file. The reader supports handling CSV entries where the separator is contained in quotes and also CSV entries where a quoted entry contains newline characters. 13 | 14 | ## Constructor Summary 15 | 16 | CSVStreamReader(ioreader : Reader) Creates a new CSVReader with a ',' as separator character and a '"' as quote character. 17 | 18 | CSVStreamReader(ioreader : Reader, separator : String) Creates a new CSVReader with the specified separator character and a '"' as quote character. 19 | 20 | CSVStreamReader(ioreader : Reader, separator : String, quote : String) Creates a new CSVReader with the specified separator character and the specified quote character. 21 | 22 | CSVStreamReader(ioreader : Reader, separator : String, quote : String, skip : Number) Creates a new CSVReader. 23 | 24 | ## Method Summary 25 | 26 | ### close 27 | 28 | **Signature:** `close() : void` 29 | 30 | Closes the underlying reader. 31 | 32 | ### readAll 33 | 34 | **Signature:** `readAll() : List` 35 | 36 | Returns a list of lines representing the entire CSV file. 37 | 38 | ### readNext 39 | 40 | **Signature:** `readNext() : String[]` 41 | 42 | Returns the next line from the input stream. 43 | 44 | ## Constructor Detail 45 | 46 | ## Method Detail 47 | 48 | ## Method Details 49 | 50 | ### close 51 | 52 | **Signature:** `close() : void` 53 | 54 | **Description:** Closes the underlying reader. 55 | 56 | --- 57 | 58 | ### readAll 59 | 60 | **Signature:** `readAll() : List` 61 | 62 | **Description:** Returns a list of lines representing the entire CSV file. Each line is a array of strings. Using this method on large feeds is inherently unsafe and may lead to an out-of-memory condition. Instead use method readNext() and process entries line by line. 63 | 64 | **Returns:** 65 | 66 | a list of lines representing the entire CSV file. 67 | 68 | --- 69 | 70 | ### readNext 71 | 72 | **Signature:** `readNext() : String[]` 73 | 74 | **Description:** Returns the next line from the input stream. The line is returned as an array of strings. The method returns null if the end of the stream is reached. 75 | 76 | **Returns:** 77 | 78 | the next line from the input stream as an array of strings. 79 | 80 | --- ``` -------------------------------------------------------------------------------- /docs/dw_svc/FTPServiceDefinition.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.svc 2 | 3 | # Class FTPServiceDefinition 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.svc.ServiceDefinition 9 | - dw.svc.FTPServiceDefinition 10 | 11 | ## Description 12 | 13 | Represents an FTP or SFTP Service Definition. There are two basic styles of configuration for this service. In the first style, createRequest is implemented to call the setOperation method on the Service. This will cause the single operation to be performed and returned as the data object in the parseResponse method. Any error status is set automatically based on the returned value of the operation. In the second style, execute is implemented to perform one or more operations using the serviceClient available on the Service object. This serviceClient will be either an FTPClient or an SFTPClient. The return value of execute will be passed as the data object in the parseResponse method. 14 | 15 | ## Properties 16 | 17 | ### autoDisconnect 18 | 19 | **Type:** boolean 20 | 21 | The status of whether the underlying FTP connection will be disconnected after the service call. 22 | 23 | ## Constructor Summary 24 | 25 | ## Method Summary 26 | 27 | ### isAutoDisconnect 28 | 29 | **Signature:** `isAutoDisconnect() : boolean` 30 | 31 | Returns the status of whether the underlying FTP connection will be disconnected after the service call. 32 | 33 | ### setAutoDisconnect 34 | 35 | **Signature:** `setAutoDisconnect(b : boolean) : FTPServiceDefinition` 36 | 37 | Sets the auto-disconnect flag. 38 | 39 | ## Method Detail 40 | 41 | ## Method Details 42 | 43 | ### isAutoDisconnect 44 | 45 | **Signature:** `isAutoDisconnect() : boolean` 46 | 47 | **Description:** Returns the status of whether the underlying FTP connection will be disconnected after the service call. 48 | 49 | **Returns:** 50 | 51 | The auto-disconnect flag. 52 | 53 | --- 54 | 55 | ### setAutoDisconnect 56 | 57 | **Signature:** `setAutoDisconnect(b : boolean) : FTPServiceDefinition` 58 | 59 | **Description:** Sets the auto-disconnect flag. If true, the underlying FTP connection will be disconnected after the service call. If false then it will remain open. The default value is true. 60 | 61 | **Parameters:** 62 | 63 | - `b`: true to enable auto-disconnect, false otherwise. 64 | 65 | **Returns:** 66 | 67 | this FTP or SFTP Service Definition. 68 | 69 | --- ``` -------------------------------------------------------------------------------- /docs/dw_system/HookMgr.md: -------------------------------------------------------------------------------- ```markdown 1 | ## Package: dw.system 2 | 3 | # Class HookMgr 4 | 5 | ## Inheritance Hierarchy 6 | 7 | - Object 8 | - dw.system.HookMgr 9 | 10 | ## Description 11 | 12 | This class provides functionality to call hooks. A hook is an extension point in the business logic, where you can register scripts to customize functionality. 13 | 14 | ## Constructor Summary 15 | 16 | ## Method Summary 17 | 18 | ### callHook 19 | 20 | **Signature:** `static callHook(extensionPoint : String, function : String, args : Object...) : Object` 21 | 22 | Calls a hook on base of the specified extensionPoint and function. 23 | 24 | ### hasHook 25 | 26 | **Signature:** `static hasHook(extensionPoint : String) : boolean` 27 | 28 | Checks whether a hook is registered or a system default implementation exists for this extension point. 29 | 30 | ## Method Detail 31 | 32 | ## Method Details 33 | 34 | ### callHook 35 | 36 | **Signature:** `static callHook(extensionPoint : String, function : String, args : Object...) : Object` 37 | 38 | **Description:** Calls a hook on base of the specified extensionPoint and function. If a hook throws an exception, then this method will also throw an exception. If no hook and no system default implementation is provided, then this method will return undefined. Sample: dw.system.HookMgr.callHook( "dw.order.calculate", "calculate", basket ); 39 | 40 | **Parameters:** 41 | 42 | - `extensionPoint`: the extension point to call 43 | - `function`: the script function to call 44 | - `args`: the Array of function parameters 45 | 46 | **Returns:** 47 | 48 | the object returned by the hook or undefined 49 | 50 | --- 51 | 52 | ### hasHook 53 | 54 | **Signature:** `static hasHook(extensionPoint : String) : boolean` 55 | 56 | **Description:** Checks whether a hook is registered or a system default implementation exists for this extension point. extensionPoint refers to the same name used to register a script as implementation. With this method it's only possible to check for a whole script registered but it is not possible to check, whether an individual function is implemented. Sample: dw.system.HookMgr.hasHook( "dw.order.calculate" ); 57 | 58 | **Parameters:** 59 | 60 | - `extensionPoint`: the extension point 61 | 62 | **Returns:** 63 | 64 | true, if a hook is registered or a default implementation exists, otherwise false 65 | 66 | --- ```