@salesforce/b2c-cli 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/dev.js +8 -8
- package/bin/run.js +5 -7
- package/content/guidance/b2c/b2c-business-manager-extensions/SKILL.md +361 -0
- package/content/guidance/b2c/b2c-business-manager-extensions/references/EXTENSIONS-XML.md +458 -0
- package/content/guidance/b2c/b2c-controllers/SKILL.md +301 -0
- package/content/guidance/b2c/b2c-controllers/references/CLASSIC-PATTERNS.md +335 -0
- package/content/guidance/b2c/b2c-controllers/references/SFRA-PATTERNS.md +400 -0
- package/content/guidance/b2c/b2c-custom-api-development/SKILL.md +281 -0
- package/content/guidance/b2c/b2c-custom-api-development/references/CONTRACT.md +142 -0
- package/content/guidance/b2c/b2c-custom-api-development/references/IMPLEMENTATION.md +153 -0
- package/content/guidance/b2c/b2c-custom-api-development/references/TESTING.md +118 -0
- package/content/guidance/b2c/b2c-custom-caches/SKILL.md +279 -0
- package/content/guidance/b2c/b2c-custom-job-steps/SKILL.md +520 -0
- package/content/guidance/b2c/b2c-custom-job-steps/references/CHUNK-ORIENTED.md +377 -0
- package/content/guidance/b2c/b2c-custom-job-steps/references/JOBS-XML.md +212 -0
- package/content/guidance/b2c/b2c-custom-job-steps/references/STEPTYPES-JSON.md +373 -0
- package/content/guidance/b2c/b2c-custom-job-steps/references/TASK-ORIENTED.md +344 -0
- package/content/guidance/b2c/b2c-custom-objects/SKILL.md +327 -0
- package/content/guidance/b2c/b2c-custom-objects/references/OCAPI-SEARCH.md +298 -0
- package/content/guidance/b2c/b2c-forms/SKILL.md +242 -0
- package/content/guidance/b2c/b2c-forms/references/FORM-XML.md +409 -0
- package/content/guidance/b2c/b2c-hooks/SKILL.md +500 -0
- package/content/guidance/b2c/b2c-hooks/references/OCAPI-SCAPI-HOOKS.md +403 -0
- package/content/guidance/b2c/b2c-hooks/references/ORDER-HOOK-LIFECYCLE.md +169 -0
- package/content/guidance/b2c/b2c-hooks/references/SYSTEM-HOOKS.md +433 -0
- package/content/guidance/b2c/b2c-isml/SKILL.md +320 -0
- package/content/guidance/b2c/b2c-isml/references/EXPRESSIONS.md +366 -0
- package/content/guidance/b2c/b2c-isml/references/TAGS.md +443 -0
- package/content/guidance/b2c/b2c-localization/SKILL.md +344 -0
- package/content/guidance/b2c/b2c-localization/references/PATTERNS.md +407 -0
- package/content/guidance/b2c/b2c-logging/SKILL.md +352 -0
- package/content/guidance/b2c/b2c-logging/references/LOG-FILES.md +282 -0
- package/content/guidance/b2c/b2c-metadata/SKILL.md +406 -0
- package/content/guidance/b2c/b2c-metadata/references/SYSTEM-OBJECTS.md +320 -0
- package/content/guidance/b2c/b2c-metadata/references/XML-EXAMPLES.md +366 -0
- package/content/guidance/b2c/b2c-onboarding/SKILL.md +154 -0
- package/content/guidance/b2c/b2c-ordering/SKILL.md +391 -0
- package/content/guidance/b2c/b2c-page-designer/SKILL.md +410 -0
- package/content/guidance/b2c/b2c-page-designer/references/ATTRIBUTE-TYPES.md +436 -0
- package/content/guidance/b2c/b2c-page-designer/references/META-DEFINITIONS.md +340 -0
- package/content/guidance/b2c/b2c-querying-data/SKILL.md +289 -0
- package/content/guidance/b2c/b2c-querying-data/references/PERFORMANCE-APIS.md +74 -0
- package/content/guidance/b2c/b2c-scapi-admin/SKILL.md +53 -0
- package/content/guidance/b2c/b2c-scapi-admin/references/CLIENT-EXAMPLES.md +440 -0
- package/content/guidance/b2c/b2c-scapi-admin/references/INTEGRATION-PATTERNS.md +518 -0
- package/content/guidance/b2c/b2c-scapi-admin/references/OAUTH-SCOPES.md +337 -0
- package/content/guidance/b2c/b2c-scapi-shopper/SKILL.md +56 -0
- package/content/guidance/b2c/b2c-scapi-shopper/references/CHECKOUT-FLOW.md +466 -0
- package/content/guidance/b2c/b2c-scapi-shopper/references/CLIENT-EXAMPLES.md +351 -0
- package/content/guidance/b2c/b2c-scapi-shopper/references/COMMON-PATTERNS.md +390 -0
- package/content/guidance/b2c/b2c-scapi-shopper/references/SCOPES.md +290 -0
- package/content/guidance/b2c/b2c-slas-auth-patterns/SKILL.md +420 -0
- package/content/guidance/b2c/b2c-slas-auth-patterns/references/PASSKEYS.md +126 -0
- package/content/guidance/b2c/b2c-slas-auth-patterns/references/SESSION-BRIDGE.md +267 -0
- package/content/guidance/b2c/b2c-slas-auth-patterns/references/TOKEN-LIFECYCLE.md +367 -0
- package/content/guidance/b2c/b2c-webservices/SKILL.md +318 -0
- package/content/guidance/b2c/b2c-webservices/references/FTP-SERVICES.md +524 -0
- package/content/guidance/b2c/b2c-webservices/references/HTTP-SERVICES.md +578 -0
- package/content/guidance/b2c/b2c-webservices/references/SERVICES-XML.md +351 -0
- package/content/guidance/b2c/b2c-webservices/references/SOAP-SERVICES.md +587 -0
- package/content/guidance/b2c-cli/b2c-am/SKILL.md +277 -0
- package/content/guidance/b2c-cli/b2c-bm-users-roles/SKILL.md +210 -0
- package/content/guidance/b2c-cli/b2c-cap/SKILL.md +131 -0
- package/content/guidance/b2c-cli/b2c-cip/SKILL.md +116 -0
- package/content/guidance/b2c-cli/b2c-cip/references/KNOWN_TABLES.md +105 -0
- package/content/guidance/b2c-cli/b2c-cip/references/SALES_ANALYSIS.md +50 -0
- package/content/guidance/b2c-cli/b2c-cip/references/STARTER_QUERIES.md +147 -0
- package/content/guidance/b2c-cli/b2c-code/SKILL.md +146 -0
- package/content/guidance/b2c-cli/b2c-config/SKILL.md +462 -0
- package/content/guidance/b2c-cli/b2c-content/SKILL.md +176 -0
- package/content/guidance/b2c-cli/b2c-debug/SKILL.md +138 -0
- package/content/guidance/b2c-cli/b2c-docs/SKILL.md +301 -0
- package/content/guidance/b2c-cli/b2c-ecdn/SKILL.md +135 -0
- package/content/guidance/b2c-cli/b2c-ecdn/references/ADVANCED.md +97 -0
- package/content/guidance/b2c-cli/b2c-ecdn/references/SECURITY.md +75 -0
- package/content/guidance/b2c-cli/b2c-import-set-migrations/SKILL.md +265 -0
- package/content/guidance/b2c-cli/b2c-job/SKILL.md +64 -0
- package/content/guidance/b2c-cli/b2c-job/references/EXPORT.md +121 -0
- package/content/guidance/b2c-cli/b2c-job/references/IMPORT.md +55 -0
- package/content/guidance/b2c-cli/b2c-job/references/RUN-AND-MONITOR.md +119 -0
- package/content/guidance/b2c-cli/b2c-logs/SKILL.md +249 -0
- package/content/guidance/b2c-cli/b2c-metrics/SKILL.md +315 -0
- package/content/guidance/b2c-cli/b2c-mrt/SKILL.md +207 -0
- package/content/guidance/b2c-cli/b2c-mrt/references/BUNDLE-COMMANDS.md +203 -0
- package/content/guidance/b2c-cli/b2c-mrt/references/ENVIRONMENT-COMMANDS.md +218 -0
- package/content/guidance/b2c-cli/b2c-mrt/references/PROJECT-COMMANDS.md +154 -0
- package/content/guidance/b2c-cli/b2c-sandbox/SKILL.md +112 -0
- package/content/guidance/b2c-cli/b2c-scapi-custom/SKILL.md +126 -0
- package/content/guidance/b2c-cli/b2c-scapi-schemas/SKILL.md +66 -0
- package/content/guidance/b2c-cli/b2c-scapi-schemas/references/CLI-EXAMPLES.md +108 -0
- package/content/guidance/b2c-cli/b2c-site-import-export/SKILL.md +57 -0
- package/content/guidance/b2c-cli/b2c-site-import-export/references/IMPORT-OPTIONS.md +118 -0
- package/content/guidance/b2c-cli/b2c-site-import-export/references/METADATA-XML.md +381 -0
- package/content/guidance/b2c-cli/b2c-site-import-export/references/WORKFLOWS.md +182 -0
- package/content/guidance/b2c-cli/b2c-sites/SKILL.md +112 -0
- package/content/guidance/b2c-cli/b2c-slas/SKILL.md +182 -0
- package/content/guidance/b2c-cli/b2c-webdav/SKILL.md +186 -0
- package/content/guidance/b2c-ops/b2c-checkout-triage/SKILL.md +68 -0
- package/content/guidance/b2c-ops/b2c-job-health/SKILL.md +75 -0
- package/content/guidance/b2c-ops/b2c-job-health/references/job-logs.md +21 -0
- package/content/guidance/b2c-ops/b2c-order-failure-triage/SKILL.md +66 -0
- package/content/guidance/b2c-ops/b2c-order-failure-triage/references/order-evidence.md +87 -0
- package/content/guidance/b2c-ops/b2c-production-triage/SKILL.md +87 -0
- package/content/guidance/b2c-ops/b2c-production-triage/references/escalation.md +57 -0
- package/content/guidance/index.json +1949 -0
- package/content/guidance/storefront-next/sfnext-accessibility/SKILL.md +103 -0
- package/content/guidance/storefront-next/sfnext-accessibility/references/checklist.md +64 -0
- package/content/guidance/storefront-next/sfnext-analytics-consent/SKILL.md +91 -0
- package/content/guidance/storefront-next/sfnext-analytics-consent/references/CUSTOM-ADAPTER.md +49 -0
- package/content/guidance/storefront-next/sfnext-authentication/SKILL.md +127 -0
- package/content/guidance/storefront-next/sfnext-authentication/references/COOKIES.md +39 -0
- package/content/guidance/storefront-next/sfnext-authentication/references/LOGIN-FLOWS.md +59 -0
- package/content/guidance/storefront-next/sfnext-commerce-features/SKILL.md +67 -0
- package/content/guidance/storefront-next/sfnext-commerce-features/references/FEATURE-PREREQUISITES.md +37 -0
- package/content/guidance/storefront-next/sfnext-components/SKILL.md +153 -0
- package/content/guidance/storefront-next/sfnext-components/references/COMPONENT-AUTHORING.md +118 -0
- package/content/guidance/storefront-next/sfnext-components/references/SHAPE-TOKENS.md +51 -0
- package/content/guidance/storefront-next/sfnext-components/references/STORYBOOK.md +54 -0
- package/content/guidance/storefront-next/sfnext-components/references/TOKEN-SYSTEM.md +53 -0
- package/content/guidance/storefront-next/sfnext-components/references/TROUBLESHOOTING.md +19 -0
- package/content/guidance/storefront-next/sfnext-configuration/SKILL.md +163 -0
- package/content/guidance/storefront-next/sfnext-configuration/references/ENV-VARIABLES.md +55 -0
- package/content/guidance/storefront-next/sfnext-configuration/references/MULTI-SITE-URLS.md +137 -0
- package/content/guidance/storefront-next/sfnext-data-fetching/SKILL.md +140 -0
- package/content/guidance/storefront-next/sfnext-data-fetching/references/ACTIONS.md +53 -0
- package/content/guidance/storefront-next/sfnext-data-fetching/references/API-CLIENTS.md +34 -0
- package/content/guidance/storefront-next/sfnext-data-fetching/references/LOADERS.md +73 -0
- package/content/guidance/storefront-next/sfnext-data-fetching/references/SCAPI-FETCHER.md +39 -0
- package/content/guidance/storefront-next/sfnext-deployment/SKILL.md +127 -0
- package/content/guidance/storefront-next/sfnext-deployment/references/MRT-DEPLOYMENT.md +59 -0
- package/content/guidance/storefront-next/sfnext-extensions/SKILL.md +118 -0
- package/content/guidance/storefront-next/sfnext-extensions/references/ACTION-HOOKS.md +57 -0
- package/content/guidance/storefront-next/sfnext-extensions/references/BASE-AUDIT.md +68 -0
- package/content/guidance/storefront-next/sfnext-extensions/references/CLI-AND-INSTALL.md +58 -0
- package/content/guidance/storefront-next/sfnext-extensions/references/EXTENSION-EXAMPLES.md +79 -0
- package/content/guidance/storefront-next/sfnext-hybrid-storefronts/SKILL.md +93 -0
- package/content/guidance/storefront-next/sfnext-hybrid-storefronts/references/HYBRID-PROXY-CONFIG.md +86 -0
- package/content/guidance/storefront-next/sfnext-i18n/SKILL.md +152 -0
- package/content/guidance/storefront-next/sfnext-i18n/references/locale-config.md +35 -0
- package/content/guidance/storefront-next/sfnext-overview/SKILL.md +101 -0
- package/content/guidance/storefront-next/sfnext-page-designer/SKILL.md +202 -0
- package/content/guidance/storefront-next/sfnext-page-designer/references/BUSINESS-MANAGER.md +46 -0
- package/content/guidance/storefront-next/sfnext-page-designer/references/COMPONENT-REGISTRY.md +111 -0
- package/content/guidance/storefront-next/sfnext-page-designer/references/DECORATOR-PATTERNS.md +168 -0
- package/content/guidance/storefront-next/sfnext-page-designer/references/REVIEW-CHECKLIST.md +83 -0
- package/content/guidance/storefront-next/sfnext-page-designer/references/TROUBLESHOOTING.md +35 -0
- package/content/guidance/storefront-next/sfnext-performance/SKILL.md +102 -0
- package/content/guidance/storefront-next/sfnext-performance/references/PERFORMANCE-REVIEW-CHECKLIST.md +85 -0
- package/content/guidance/storefront-next/sfnext-performance/references/SUSPENSE-AND-STREAMING.md +58 -0
- package/content/guidance/storefront-next/sfnext-project-setup/SKILL.md +147 -0
- package/content/guidance/storefront-next/sfnext-project-setup/references/PROJECT-STRUCTURE.md +61 -0
- package/content/guidance/storefront-next/sfnext-project-setup/references/SCRIPTS.md +47 -0
- package/content/guidance/storefront-next/sfnext-project-setup/references/SFNEXT-CLI.md +63 -0
- package/content/guidance/storefront-next/sfnext-quality-gates/SKILL.md +70 -0
- package/content/guidance/storefront-next/sfnext-quality-gates/references/lint-and-budgets.md +39 -0
- package/content/guidance/storefront-next/sfnext-revalidation/SKILL.md +121 -0
- package/content/guidance/storefront-next/sfnext-revalidation/references/POLICIES-AND-TAGS.md +55 -0
- package/content/guidance/storefront-next/sfnext-routing/SKILL.md +123 -0
- package/content/guidance/storefront-next/sfnext-routing/references/ROUTE-CONVENTIONS.md +65 -0
- package/content/guidance/storefront-next/sfnext-routing/references/URLS-AND-SEO-ROUTES.md +22 -0
- package/content/guidance/storefront-next/sfnext-scapi/SKILL.md +126 -0
- package/content/guidance/storefront-next/sfnext-scapi/references/WORKED-EXAMPLE.md +39 -0
- package/content/guidance/storefront-next/sfnext-security/SKILL.md +129 -0
- package/content/guidance/storefront-next/sfnext-security/references/COOKIE-DOMAIN.md +39 -0
- package/content/guidance/storefront-next/sfnext-security/references/TURNSTILE.md +43 -0
- package/content/guidance/storefront-next/sfnext-seo/SKILL.md +95 -0
- package/content/guidance/storefront-next/sfnext-seo/references/MULTI-DOMAIN-BASE-PATH.md +17 -0
- package/content/guidance/storefront-next/sfnext-seo/references/SEO-ROUTES.md +31 -0
- package/content/guidance/storefront-next/sfnext-state-management/SKILL.md +114 -0
- package/content/guidance/storefront-next/sfnext-state-management/references/PATTERNS.md +45 -0
- package/content/guidance/storefront-next/sfnext-testing/SKILL.md +151 -0
- package/content/guidance/storefront-next/sfnext-testing/references/E2E.md +38 -0
- package/content/guidance/storefront-next/sfnext-testing/references/STORYBOOK-PATTERNS.md +97 -0
- package/content/guidance/storefront-next/sfnext-testing/references/UNIT-AND-ROUTE-TESTS.md +60 -0
- package/content/guidance/storefront-next/sfnext-theming/SKILL.md +104 -0
- package/content/guidance/storefront-next/sfnext-theming/references/REBRAND-CHECKLIST.md +29 -0
- package/dist/commands/cap/install.d.ts +1 -0
- package/dist/commands/cap/list.d.ts +1 -0
- package/dist/commands/cap/pull.d.ts +1 -0
- package/dist/commands/cap/tasks.d.ts +1 -0
- package/dist/commands/cap/uninstall.d.ts +1 -0
- package/dist/commands/cip/describe.d.ts +1 -0
- package/dist/commands/cip/query.d.ts +1 -0
- package/dist/commands/cip/report/bot-traffic-share.d.ts +1 -0
- package/dist/commands/cip/report/checkout-funnel-dropoff.d.ts +1 -0
- package/dist/commands/cip/report/controller-error-rate-trend.d.ts +1 -0
- package/dist/commands/cip/report/controller-health-scorecard.d.ts +1 -0
- package/dist/commands/cip/report/customer-registration-trends.d.ts +1 -0
- package/dist/commands/cip/report/discount-depth-breakdown.d.ts +1 -0
- package/dist/commands/cip/report/inventory-stockout-by-location.d.ts +1 -0
- package/dist/commands/cip/report/new-vs-returning-buyer-revenue.d.ts +1 -0
- package/dist/commands/cip/report/ocapi-client-usage.d.ts +1 -0
- package/dist/commands/cip/report/ocapi-requests.d.ts +1 -0
- package/dist/commands/cip/report/payment-method-performance.d.ts +1 -0
- package/dist/commands/cip/report/product-co-purchase-analysis.d.ts +1 -0
- package/dist/commands/cip/report/promotion-discount-analysis.d.ts +1 -0
- package/dist/commands/cip/report/promotion-roi-leaderboard.d.ts +1 -0
- package/dist/commands/cip/report/recommender-effectiveness.d.ts +1 -0
- package/dist/commands/cip/report/remote-include-performance.d.ts +1 -0
- package/dist/commands/cip/report/revenue-by-channel.d.ts +1 -0
- package/dist/commands/cip/report/sales-analytics.d.ts +1 -0
- package/dist/commands/cip/report/sales-summary.d.ts +1 -0
- package/dist/commands/cip/report/scapi-cache-hit-ratio.d.ts +1 -0
- package/dist/commands/cip/report/scapi-error-rate-by-status.d.ts +1 -0
- package/dist/commands/cip/report/scapi-latency-distribution.d.ts +1 -0
- package/dist/commands/cip/report/scapi-traffic-latency.d.ts +1 -0
- package/dist/commands/cip/report/search-query-performance.d.ts +1 -0
- package/dist/commands/cip/report/top-referrers.d.ts +1 -0
- package/dist/commands/cip/report/top-selling-products.d.ts +1 -0
- package/dist/commands/cip/report/zero-result-searches.d.ts +1 -0
- package/dist/commands/cip/tables.d.ts +1 -0
- package/dist/commands/code/activate.d.ts +1 -0
- package/dist/commands/code/delete.d.ts +1 -0
- package/dist/commands/code/deploy.d.ts +1 -0
- package/dist/commands/code/download.d.ts +1 -0
- package/dist/commands/code/watch.d.ts +1 -0
- package/dist/commands/commands/search.d.ts +35 -0
- package/dist/commands/commands/search.js +85 -0
- package/dist/commands/commands/search.js.map +1 -0
- package/dist/commands/content/export.d.ts +1 -0
- package/dist/commands/content/list.d.ts +1 -0
- package/dist/commands/content/validate.d.ts +1 -0
- package/dist/commands/debug/cli.d.ts +1 -0
- package/dist/commands/debug/index.d.ts +1 -0
- package/dist/commands/docs/cache.d.ts +1 -0
- package/dist/commands/docs/download.d.ts +1 -0
- package/dist/commands/docs/read.d.ts +1 -0
- package/dist/commands/docs/schema.d.ts +1 -0
- package/dist/commands/docs/search.d.ts +1 -0
- package/dist/commands/docs/skill.d.ts +41 -0
- package/dist/commands/docs/skill.js +183 -0
- package/dist/commands/docs/skill.js.map +1 -0
- package/dist/commands/ecdn/cache/purge.d.ts +1 -0
- package/dist/commands/ecdn/certificates/add.d.ts +1 -0
- package/dist/commands/ecdn/certificates/delete.d.ts +1 -0
- package/dist/commands/ecdn/certificates/list.d.ts +1 -0
- package/dist/commands/ecdn/certificates/update.d.ts +1 -0
- package/dist/commands/ecdn/certificates/validate.d.ts +1 -0
- package/dist/commands/ecdn/cipher-suites/get.d.ts +1 -0
- package/dist/commands/ecdn/cipher-suites/update.d.ts +1 -0
- package/dist/commands/ecdn/firewall/create.d.ts +1 -0
- package/dist/commands/ecdn/firewall/delete.d.ts +1 -0
- package/dist/commands/ecdn/firewall/get.d.ts +1 -0
- package/dist/commands/ecdn/firewall/list.d.ts +1 -0
- package/dist/commands/ecdn/firewall/reorder.d.ts +1 -0
- package/dist/commands/ecdn/firewall/update.d.ts +1 -0
- package/dist/commands/ecdn/logpush/jobs/create.d.ts +1 -0
- package/dist/commands/ecdn/logpush/jobs/delete.d.ts +1 -0
- package/dist/commands/ecdn/logpush/jobs/get.d.ts +1 -0
- package/dist/commands/ecdn/logpush/jobs/list.d.ts +1 -0
- package/dist/commands/ecdn/logpush/jobs/update.d.ts +1 -0
- package/dist/commands/ecdn/logpush/ownership.d.ts +1 -0
- package/dist/commands/ecdn/mrt-rules/create.d.ts +1 -0
- package/dist/commands/ecdn/mrt-rules/delete.d.ts +1 -0
- package/dist/commands/ecdn/mrt-rules/get.d.ts +1 -0
- package/dist/commands/ecdn/mrt-rules/rules/delete.d.ts +1 -0
- package/dist/commands/ecdn/mrt-rules/rules/update.d.ts +1 -0
- package/dist/commands/ecdn/mrt-rules/update.d.ts +1 -0
- package/dist/commands/ecdn/mtls/create.d.ts +1 -0
- package/dist/commands/ecdn/mtls/delete.d.ts +1 -0
- package/dist/commands/ecdn/mtls/get.d.ts +1 -0
- package/dist/commands/ecdn/mtls/issue.d.ts +1 -0
- package/dist/commands/ecdn/mtls/list.d.ts +1 -0
- package/dist/commands/ecdn/mtls/setup.d.ts +1 -0
- package/dist/commands/ecdn/origin-headers/delete.d.ts +1 -0
- package/dist/commands/ecdn/origin-headers/get.d.ts +1 -0
- package/dist/commands/ecdn/origin-headers/set.d.ts +1 -0
- package/dist/commands/ecdn/page-shield/notifications/create.d.ts +1 -0
- package/dist/commands/ecdn/page-shield/notifications/delete.d.ts +1 -0
- package/dist/commands/ecdn/page-shield/notifications/list.d.ts +1 -0
- package/dist/commands/ecdn/page-shield/policies/create.d.ts +1 -0
- package/dist/commands/ecdn/page-shield/policies/delete.d.ts +1 -0
- package/dist/commands/ecdn/page-shield/policies/get.d.ts +1 -0
- package/dist/commands/ecdn/page-shield/policies/list.d.ts +1 -0
- package/dist/commands/ecdn/page-shield/policies/update.d.ts +1 -0
- package/dist/commands/ecdn/page-shield/scripts/get.d.ts +1 -0
- package/dist/commands/ecdn/page-shield/scripts/list.d.ts +1 -0
- package/dist/commands/ecdn/rate-limit/create.d.ts +1 -0
- package/dist/commands/ecdn/rate-limit/delete.d.ts +1 -0
- package/dist/commands/ecdn/rate-limit/get.d.ts +1 -0
- package/dist/commands/ecdn/rate-limit/list.d.ts +1 -0
- package/dist/commands/ecdn/rate-limit/update.d.ts +1 -0
- package/dist/commands/ecdn/security/get.d.ts +1 -0
- package/dist/commands/ecdn/security/update.d.ts +1 -0
- package/dist/commands/ecdn/speed/get.d.ts +1 -0
- package/dist/commands/ecdn/speed/update.d.ts +1 -0
- package/dist/commands/ecdn/waf/groups/list.d.ts +1 -0
- package/dist/commands/ecdn/waf/groups/update.d.ts +1 -0
- package/dist/commands/ecdn/waf/managed-rules/list.d.ts +1 -0
- package/dist/commands/ecdn/waf/managed-rules/update.d.ts +1 -0
- package/dist/commands/ecdn/waf/migrate.d.ts +1 -0
- package/dist/commands/ecdn/waf/owasp/get.d.ts +1 -0
- package/dist/commands/ecdn/waf/owasp/update.d.ts +1 -0
- package/dist/commands/ecdn/waf/rules/get.d.ts +1 -0
- package/dist/commands/ecdn/waf/rules/list.d.ts +1 -0
- package/dist/commands/ecdn/waf/rules/update.d.ts +1 -0
- package/dist/commands/ecdn/waf/rulesets/list.d.ts +1 -0
- package/dist/commands/ecdn/waf/rulesets/update.d.ts +1 -0
- package/dist/commands/ecdn/zones/create.d.ts +1 -0
- package/dist/commands/ecdn/zones/list.d.ts +1 -0
- package/dist/commands/job/execution/delete.d.ts +1 -0
- package/dist/commands/job/export.d.ts +1 -0
- package/dist/commands/job/import-set.d.ts +1 -0
- package/dist/commands/job/import.d.ts +1 -0
- package/dist/commands/job/log.d.ts +1 -0
- package/dist/commands/job/run.d.ts +1 -0
- package/dist/commands/job/search.d.ts +1 -0
- package/dist/commands/job/wait.d.ts +1 -0
- package/dist/commands/logs/get.d.ts +1 -0
- package/dist/commands/logs/list.d.ts +1 -0
- package/dist/commands/logs/tail.d.ts +1 -0
- package/dist/commands/metrics/controller.d.ts +1 -0
- package/dist/commands/metrics/ecdn.d.ts +1 -0
- package/dist/commands/metrics/mrt.d.ts +1 -0
- package/dist/commands/metrics/ocapi.d.ts +1 -0
- package/dist/commands/metrics/overall.d.ts +1 -0
- package/dist/commands/metrics/sales.d.ts +1 -0
- package/dist/commands/metrics/scapi-hooks.d.ts +1 -0
- package/dist/commands/metrics/scapi.d.ts +1 -0
- package/dist/commands/metrics/third-party.d.ts +1 -0
- package/dist/commands/mrt/bundle/delete.d.ts +1 -0
- package/dist/commands/mrt/bundle/deploy.d.ts +1 -0
- package/dist/commands/mrt/bundle/download.d.ts +1 -0
- package/dist/commands/mrt/bundle/history.d.ts +1 -0
- package/dist/commands/mrt/bundle/list.d.ts +1 -0
- package/dist/commands/mrt/bundle/save.d.ts +1 -0
- package/dist/commands/mrt/bundle/upload-v2.d.ts +1 -0
- package/dist/commands/mrt/env/access-control/list.d.ts +1 -0
- package/dist/commands/mrt/env/b2c.d.ts +1 -0
- package/dist/commands/mrt/env/clone.d.ts +1 -0
- package/dist/commands/mrt/env/create.d.ts +1 -0
- package/dist/commands/mrt/env/delete.d.ts +1 -0
- package/dist/commands/mrt/env/get.d.ts +1 -0
- package/dist/commands/mrt/env/invalidate.d.ts +1 -0
- package/dist/commands/mrt/env/list.d.ts +1 -0
- package/dist/commands/mrt/env/redirect/clone.d.ts +1 -0
- package/dist/commands/mrt/env/redirect/create.d.ts +1 -0
- package/dist/commands/mrt/env/redirect/delete.d.ts +1 -0
- package/dist/commands/mrt/env/redirect/list.d.ts +1 -0
- package/dist/commands/mrt/env/update.d.ts +1 -0
- package/dist/commands/mrt/env/var/delete.d.ts +1 -0
- package/dist/commands/mrt/env/var/list.d.ts +1 -0
- package/dist/commands/mrt/env/var/push.d.ts +1 -0
- package/dist/commands/mrt/env/var/set.d.ts +1 -0
- package/dist/commands/mrt/org/b2c.d.ts +1 -0
- package/dist/commands/mrt/org/cert/create.d.ts +1 -0
- package/dist/commands/mrt/org/cert/delete.d.ts +1 -0
- package/dist/commands/mrt/org/cert/get.d.ts +1 -0
- package/dist/commands/mrt/org/cert/list.d.ts +1 -0
- package/dist/commands/mrt/org/cert/restart-validation.d.ts +1 -0
- package/dist/commands/mrt/org/list.d.ts +1 -0
- package/dist/commands/mrt/org/member/add.d.ts +1 -0
- package/dist/commands/mrt/org/member/get.d.ts +1 -0
- package/dist/commands/mrt/org/member/list.d.ts +1 -0
- package/dist/commands/mrt/org/member/remove.d.ts +1 -0
- package/dist/commands/mrt/org/member/update.d.ts +1 -0
- package/dist/commands/mrt/project/create.d.ts +1 -0
- package/dist/commands/mrt/project/delete.d.ts +1 -0
- package/dist/commands/mrt/project/get.d.ts +1 -0
- package/dist/commands/mrt/project/list.d.ts +1 -0
- package/dist/commands/mrt/project/member/add.d.ts +1 -0
- package/dist/commands/mrt/project/member/get.d.ts +1 -0
- package/dist/commands/mrt/project/member/list.d.ts +1 -0
- package/dist/commands/mrt/project/member/remove.d.ts +1 -0
- package/dist/commands/mrt/project/member/update.d.ts +1 -0
- package/dist/commands/mrt/project/notification/delete.d.ts +1 -0
- package/dist/commands/mrt/project/notification/get.d.ts +1 -0
- package/dist/commands/mrt/project/update.d.ts +1 -0
- package/dist/commands/mrt/save-credentials.d.ts +1 -0
- package/dist/commands/mrt/tail-logs.d.ts +1 -0
- package/dist/commands/mrt/user/api-key.d.ts +1 -0
- package/dist/commands/mrt/user/email-prefs.d.ts +1 -0
- package/dist/commands/mrt/user/profile.d.ts +1 -0
- package/dist/commands/scaffold/init.js +2 -1
- package/dist/commands/scaffold/init.js.map +1 -1
- package/dist/commands/scapi/custom/status.d.ts +1 -0
- package/dist/commands/scapi/schemas/get.d.ts +1 -0
- package/dist/commands/scapi/schemas/list.d.ts +1 -0
- package/dist/commands/setup/ide/tsserver-plugin.d.ts +1 -0
- package/dist/commands/setup/ide/vscode-types.d.ts +1 -0
- package/dist/commands/setup/index.js +4 -3
- package/dist/commands/setup/index.js.map +1 -1
- package/dist/commands/setup/inspect.d.ts +1 -0
- package/dist/commands/setup/inspect.js +17 -2
- package/dist/commands/setup/inspect.js.map +1 -1
- package/dist/commands/setup/instance/create.d.ts +1 -0
- package/dist/commands/setup/instance/list.d.ts +1 -0
- package/dist/commands/setup/instance/remove.d.ts +1 -0
- package/dist/commands/setup/instance/set-active.d.ts +1 -0
- package/dist/commands/setup/openshell.d.ts +1 -0
- package/dist/commands/setup/skills.d.ts +1 -0
- package/dist/commands/slas/client/create.d.ts +1 -0
- package/dist/commands/slas/client/delete.d.ts +1 -0
- package/dist/commands/slas/client/get.d.ts +1 -0
- package/dist/commands/slas/client/list.d.ts +1 -0
- package/dist/commands/slas/client/open.d.ts +1 -0
- package/dist/commands/slas/client/update.d.ts +1 -0
- package/dist/commands/slas/token.d.ts +1 -0
- package/dist/commands/slas/token.js +2 -1
- package/dist/commands/slas/token.js.map +1 -1
- package/dist/commands/webdav/get.d.ts +1 -0
- package/dist/commands/webdav/mkdir.d.ts +2 -0
- package/dist/commands/webdav/mkdir.js +5 -3
- package/dist/commands/webdav/mkdir.js.map +1 -1
- package/dist/commands/webdav/put.d.ts +2 -0
- package/dist/commands/webdav/put.js +5 -3
- package/dist/commands/webdav/put.js.map +1 -1
- package/dist/commands/webdav/rm.d.ts +1 -0
- package/dist/help.d.ts +25 -0
- package/dist/help.js +96 -0
- package/dist/help.js.map +1 -0
- package/dist/lib/scaffold/generate-helper.js +3 -2
- package/dist/lib/scaffold/generate-helper.js.map +1 -1
- package/dist/lib/skills.d.ts +19 -0
- package/dist/lib/skills.js +75 -0
- package/dist/lib/skills.js.map +1 -0
- package/dist/utils/cip/command.d.ts +1 -0
- package/dist/utils/ecdn/zone-command.d.ts +1 -0
- package/dist/utils/slas/client.d.ts +1 -0
- package/oclif.manifest.json +10994 -7653
- package/package.json +11 -5
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
# OCAPI Custom Object Search Reference
|
|
2
|
+
|
|
3
|
+
Full reference for searching custom objects via OCAPI Data API.
|
|
4
|
+
|
|
5
|
+
## Search Endpoint
|
|
6
|
+
|
|
7
|
+
```http
|
|
8
|
+
POST /s/-/dw/data/v{version}/custom_objects_search/{object_type}
|
|
9
|
+
Authorization: Bearer {token}
|
|
10
|
+
Content-Type: application/json
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Request Structure
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"query": { },
|
|
18
|
+
"select": "(**)",
|
|
19
|
+
"expand": [],
|
|
20
|
+
"sorts": [{ "field": "creation_date", "sort_order": "desc" }],
|
|
21
|
+
"start": 0,
|
|
22
|
+
"count": 25
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
| Field | Required | Description |
|
|
27
|
+
|-------|----------|-------------|
|
|
28
|
+
| `query` | Yes | Search query object |
|
|
29
|
+
| `select` | No | Fields to return (`(**)` for all) |
|
|
30
|
+
| `expand` | No | Related objects to expand |
|
|
31
|
+
| `sorts` | No | Sort order array |
|
|
32
|
+
| `start` | No | Pagination offset (default: 0) |
|
|
33
|
+
| `count` | No | Results per page (default: 25, max: 200) |
|
|
34
|
+
|
|
35
|
+
## Query Types
|
|
36
|
+
|
|
37
|
+
### Term Query (Exact Match)
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"query": {
|
|
42
|
+
"term_query": {
|
|
43
|
+
"fields": ["c_status"],
|
|
44
|
+
"operator": "is",
|
|
45
|
+
"values": ["active"]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
`fields` is a required array, and `operator` is required. `values`, when used, is an array;
|
|
52
|
+
omit it for `is_null` and `is_not_null`. Supported operators:
|
|
53
|
+
- `is`: Exact match
|
|
54
|
+
- `one_of`: Match any value in array
|
|
55
|
+
- `is_null`: Check for null
|
|
56
|
+
- `is_not_null`: Check for non-null
|
|
57
|
+
- `less`, `greater`: Comparisons
|
|
58
|
+
- `not_in`: Exclude values
|
|
59
|
+
- `neq`: Not equal
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"term_query": {
|
|
64
|
+
"fields": ["c_priority"],
|
|
65
|
+
"operator": "greater",
|
|
66
|
+
"values": [5]
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"term_query": {
|
|
74
|
+
"fields": ["c_status"],
|
|
75
|
+
"operator": "one_of",
|
|
76
|
+
"values": ["active", "pending"]
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Text Query (Full-Text Search)
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"query": {
|
|
86
|
+
"text_query": {
|
|
87
|
+
"fields": ["c_name", "c_description"],
|
|
88
|
+
"search_phrase": "test product"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Range Filter
|
|
95
|
+
|
|
96
|
+
There is no `range_query`. Ranges are expressed as a `range_filter` inside a `filtered_query`:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"query": {
|
|
101
|
+
"filtered_query": {
|
|
102
|
+
"query": { "match_all_query": {} },
|
|
103
|
+
"filter": {
|
|
104
|
+
"range_filter": {
|
|
105
|
+
"field": "c_count",
|
|
106
|
+
"from": 1,
|
|
107
|
+
"to": 100,
|
|
108
|
+
"from_inclusive": true,
|
|
109
|
+
"to_inclusive": false
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Boolean Query
|
|
118
|
+
|
|
119
|
+
Combine multiple queries:
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
{
|
|
123
|
+
"query": {
|
|
124
|
+
"bool_query": {
|
|
125
|
+
"must": [
|
|
126
|
+
{ "term_query": { "fields": ["c_isActive"], "operator": "is", "values": [true] } },
|
|
127
|
+
{ "term_query": { "fields": ["c_type"], "operator": "is", "values": ["premium"] } }
|
|
128
|
+
],
|
|
129
|
+
"should": [
|
|
130
|
+
{ "term_query": { "fields": ["c_priority"], "operator": "greater", "values": [5] } }
|
|
131
|
+
],
|
|
132
|
+
"must_not": [
|
|
133
|
+
{ "term_query": { "fields": ["c_status"], "operator": "is", "values": ["deleted"] } }
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
| Clause | Description |
|
|
141
|
+
|--------|-------------|
|
|
142
|
+
| `must` | All conditions must match (AND) |
|
|
143
|
+
| `should` | At least one should match (OR) |
|
|
144
|
+
| `must_not` | None of these should match (NOT) |
|
|
145
|
+
|
|
146
|
+
### Match All Query
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"query": {
|
|
151
|
+
"match_all_query": {}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Filtered Query
|
|
157
|
+
|
|
158
|
+
Combine query with filter (filter doesn't affect scoring):
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"query": {
|
|
163
|
+
"filtered_query": {
|
|
164
|
+
"query": {
|
|
165
|
+
"text_query": {
|
|
166
|
+
"fields": ["c_name"],
|
|
167
|
+
"search_phrase": "test"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"filter": {
|
|
171
|
+
"term_filter": {
|
|
172
|
+
"field": "c_isActive",
|
|
173
|
+
"operator": "is",
|
|
174
|
+
"values": [true]
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Nested Query
|
|
183
|
+
|
|
184
|
+
Query nested objects:
|
|
185
|
+
|
|
186
|
+
```json
|
|
187
|
+
{
|
|
188
|
+
"query": {
|
|
189
|
+
"nested_query": {
|
|
190
|
+
"path": "c_addresses",
|
|
191
|
+
"query": {
|
|
192
|
+
"term_query": {
|
|
193
|
+
"fields": ["c_addresses.city"],
|
|
194
|
+
"operator": "is",
|
|
195
|
+
"values": ["Boston"]
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Sorting
|
|
204
|
+
|
|
205
|
+
```json
|
|
206
|
+
{
|
|
207
|
+
"sorts": [
|
|
208
|
+
{ "field": "creation_date", "sort_order": "desc" },
|
|
209
|
+
{ "field": "c_priority", "sort_order": "asc" }
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
| Sort Order | Description |
|
|
215
|
+
|------------|-------------|
|
|
216
|
+
| `asc` | Ascending (A-Z, 0-9, oldest first) |
|
|
217
|
+
| `desc` | Descending (Z-A, 9-0, newest first) |
|
|
218
|
+
|
|
219
|
+
## Field Selection
|
|
220
|
+
|
|
221
|
+
```json
|
|
222
|
+
{
|
|
223
|
+
"select": "(c_name, c_status, creation_date)"
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
- `(**)` - All fields (default)
|
|
228
|
+
- `(field1, field2)` - Specific fields only
|
|
229
|
+
|
|
230
|
+
## Response Structure
|
|
231
|
+
|
|
232
|
+
This example assumes `MyType` defines a string key attribute named `customObjectId`.
|
|
233
|
+
|
|
234
|
+
```json
|
|
235
|
+
{
|
|
236
|
+
"count": 1,
|
|
237
|
+
"hits": [
|
|
238
|
+
{
|
|
239
|
+
"key_property": "customObjectId",
|
|
240
|
+
"key_value_string": "key1",
|
|
241
|
+
"object_type": "MyType",
|
|
242
|
+
"c_name": "Test Object",
|
|
243
|
+
"c_status": "active"
|
|
244
|
+
}
|
|
245
|
+
],
|
|
246
|
+
"query": { "match_all_query": {} },
|
|
247
|
+
"select": "(**)",
|
|
248
|
+
"start": 0,
|
|
249
|
+
"total": 1
|
|
250
|
+
}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## Pagination Example
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
# First page
|
|
257
|
+
curl -X POST ".../custom_objects_search/MyType" \
|
|
258
|
+
-d '{"query":{"match_all_query":{}},"start":0,"count":25}'
|
|
259
|
+
|
|
260
|
+
# Second page
|
|
261
|
+
curl -X POST ".../custom_objects_search/MyType" \
|
|
262
|
+
-d '{"query":{"match_all_query":{}},"start":25,"count":25}'
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## Complex Query Example
|
|
266
|
+
|
|
267
|
+
Find active premium configs modified in the last 7 days:
|
|
268
|
+
|
|
269
|
+
```json
|
|
270
|
+
{
|
|
271
|
+
"query": {
|
|
272
|
+
"bool_query": {
|
|
273
|
+
"must": [
|
|
274
|
+
{ "term_query": { "fields": ["c_isActive"], "operator": "is", "values": [true] } },
|
|
275
|
+
{ "term_query": { "fields": ["c_tier"], "operator": "is", "values": ["premium"] } },
|
|
276
|
+
{
|
|
277
|
+
"term_query": {
|
|
278
|
+
"fields": ["last_modified"],
|
|
279
|
+
"operator": "greater",
|
|
280
|
+
"values": ["2024-01-08T00:00:00.000Z"]
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
]
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
"sorts": [{ "field": "last_modified", "sort_order": "desc" }],
|
|
287
|
+
"count": 50
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
## Error Handling
|
|
292
|
+
|
|
293
|
+
| Status | Description |
|
|
294
|
+
|--------|-------------|
|
|
295
|
+
| 400 | Invalid query syntax |
|
|
296
|
+
| 401 | Missing or invalid token |
|
|
297
|
+
| 403 | Insufficient permissions |
|
|
298
|
+
| 404 | Custom object type not found |
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: b2c-forms
|
|
3
|
+
description: Build forms with validation in B2C Commerce using SFRA patterns. Use this skill whenever the user needs to create a storefront form (checkout, registration, profile edit, address, contact), define form fields in XML, handle form submission in a controller, add field validation rules, or render forms in ISML templates. Also use when they mention form XML definitions, server.forms.getForm, form groups/actions/lists, or CSRF protection on form posts — even if they just say "I need a registration form" or "add validation to checkout".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Forms Skill
|
|
7
|
+
|
|
8
|
+
This skill guides you through creating forms with validation in Salesforce B2C Commerce using the SFRA patterns.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
B2C Commerce forms consist of three parts:
|
|
13
|
+
|
|
14
|
+
1. **Form Definition** - XML file defining fields, validation, and actions
|
|
15
|
+
2. **Controller Logic** - Server-side form handling and processing
|
|
16
|
+
3. **Template** - ISML template rendering the HTML form
|
|
17
|
+
|
|
18
|
+
## File Location
|
|
19
|
+
|
|
20
|
+
Forms are defined in the cartridge's `forms` directory:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
/my-cartridge
|
|
24
|
+
/cartridge
|
|
25
|
+
/forms
|
|
26
|
+
/default # Default locale
|
|
27
|
+
profile.xml
|
|
28
|
+
contact.xml
|
|
29
|
+
/de_DE # German-specific (optional)
|
|
30
|
+
address.xml
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Form Definition (XML)
|
|
34
|
+
|
|
35
|
+
### Basic Structure
|
|
36
|
+
|
|
37
|
+
```xml
|
|
38
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
39
|
+
<form xmlns="http://www.demandware.com/xml/form/2008-04-19">
|
|
40
|
+
<field formid="email" label="form.email.label" type="string"
|
|
41
|
+
mandatory="true" max-length="50"
|
|
42
|
+
regexp="^[\w.%+-]+@[\w.-]+\.\w{2,6}$"
|
|
43
|
+
parse-error="form.email.invalid"/>
|
|
44
|
+
|
|
45
|
+
<field formid="password" label="form.password.label" type="string"
|
|
46
|
+
mandatory="true" min-length="8" max-length="255"
|
|
47
|
+
missing-error="form.password.required"/>
|
|
48
|
+
|
|
49
|
+
<field formid="rememberMe" label="form.remember.label" type="boolean"/>
|
|
50
|
+
|
|
51
|
+
<action formid="submit" valid-form="true"/>
|
|
52
|
+
<action formid="cancel" valid-form="false"/>
|
|
53
|
+
</form>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Field Types
|
|
57
|
+
|
|
58
|
+
| Type | Description | HTML Input |
|
|
59
|
+
|------|-------------|------------|
|
|
60
|
+
| `string` | Text input | `<input type="text">` |
|
|
61
|
+
| `integer` | Whole number | `<input type="number">` |
|
|
62
|
+
| `number` | Decimal number | `<input type="number">` |
|
|
63
|
+
| `boolean` | Checkbox | `<input type="checkbox">` |
|
|
64
|
+
| `date` | Date value | `<input type="date">` |
|
|
65
|
+
|
|
66
|
+
### Key Field Attributes
|
|
67
|
+
|
|
68
|
+
| Attribute | Purpose | Example |
|
|
69
|
+
|-----------|---------|---------|
|
|
70
|
+
| `formid` | Field identifier (required) | `formid="email"` |
|
|
71
|
+
| `label` | Resource key for label | `label="form.email.label"` |
|
|
72
|
+
| `type` | Data type (required) | `type="string"` |
|
|
73
|
+
| `mandatory` | Required field | `mandatory="true"` |
|
|
74
|
+
| `max-length` | Max string length | `max-length="100"` |
|
|
75
|
+
| `min-length` | Min string length | `min-length="8"` |
|
|
76
|
+
| `regexp` | Validation pattern | `regexp="^\d{5}$"` |
|
|
77
|
+
|
|
78
|
+
### Validation Error Messages
|
|
79
|
+
|
|
80
|
+
| Attribute | When Triggered |
|
|
81
|
+
|-----------|----------------|
|
|
82
|
+
| `missing-error` | Mandatory field is empty |
|
|
83
|
+
| `parse-error` | Value doesn't match regexp or type |
|
|
84
|
+
| `range-error` | Value outside min/max range |
|
|
85
|
+
| `value-error` | General validation failure |
|
|
86
|
+
|
|
87
|
+
See [Form XML Reference](references/FORM-XML.md) for complete field attributes, groups, lists, and validation patterns.
|
|
88
|
+
|
|
89
|
+
## Controller Logic (SFRA)
|
|
90
|
+
|
|
91
|
+
### Rendering a Form
|
|
92
|
+
|
|
93
|
+
```javascript
|
|
94
|
+
'use strict';
|
|
95
|
+
|
|
96
|
+
var server = require('server');
|
|
97
|
+
var csrfProtection = require('*/cartridge/scripts/middleware/csrf');
|
|
98
|
+
|
|
99
|
+
server.get('Show',
|
|
100
|
+
csrfProtection.generateToken,
|
|
101
|
+
function (req, res, next) {
|
|
102
|
+
var form = server.forms.getForm('profile');
|
|
103
|
+
form.clear(); // Reset previous values
|
|
104
|
+
|
|
105
|
+
res.render('account/profile', {
|
|
106
|
+
profileForm: form
|
|
107
|
+
});
|
|
108
|
+
next();
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
module.exports = server.exports();
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Processing Form Submission
|
|
116
|
+
|
|
117
|
+
```javascript
|
|
118
|
+
server.post('Submit',
|
|
119
|
+
server.middleware.https,
|
|
120
|
+
csrfProtection.validateAjaxRequest,
|
|
121
|
+
function (req, res, next) {
|
|
122
|
+
var form = server.forms.getForm('profile');
|
|
123
|
+
|
|
124
|
+
if (!form.valid) {
|
|
125
|
+
res.json({
|
|
126
|
+
success: false,
|
|
127
|
+
fields: getFormErrors(form)
|
|
128
|
+
});
|
|
129
|
+
return next();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Access form values
|
|
133
|
+
var email = form.email.value;
|
|
134
|
+
var firstName = form.firstName.value;
|
|
135
|
+
|
|
136
|
+
// Process and save data
|
|
137
|
+
this.on('route:BeforeComplete', function () {
|
|
138
|
+
var Transaction = require('dw/system/Transaction');
|
|
139
|
+
Transaction.wrap(function () {
|
|
140
|
+
customer.profile.email = email;
|
|
141
|
+
customer.profile.firstName = firstName;
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
res.json({ success: true });
|
|
146
|
+
next();
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
function getFormErrors(form) {
|
|
151
|
+
var errors = {};
|
|
152
|
+
Object.keys(form).forEach(function (key) {
|
|
153
|
+
if (form[key] && form[key].error) {
|
|
154
|
+
errors[key] = form[key].error;
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
return errors;
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Prepopulating Forms
|
|
162
|
+
|
|
163
|
+
```javascript
|
|
164
|
+
server.get('Edit', function (req, res, next) {
|
|
165
|
+
var form = server.forms.getForm('profile');
|
|
166
|
+
form.clear();
|
|
167
|
+
|
|
168
|
+
var profile = req.currentCustomer.profile;
|
|
169
|
+
form.firstName.value = profile.firstName;
|
|
170
|
+
form.lastName.value = profile.lastName;
|
|
171
|
+
form.email.value = profile.email;
|
|
172
|
+
|
|
173
|
+
res.render('account/editProfile', { profileForm: form });
|
|
174
|
+
next();
|
|
175
|
+
});
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Template (ISML)
|
|
179
|
+
|
|
180
|
+
### Basic Form Template
|
|
181
|
+
|
|
182
|
+
```html
|
|
183
|
+
<form action="${pdict.actionUrl}" method="POST" name="profile-form"
|
|
184
|
+
class="form-horizontal" data-action="${URLUtils.url('Profile-Submit')}">
|
|
185
|
+
|
|
186
|
+
<!-- CSRF Token -->
|
|
187
|
+
<input type="hidden" name="${pdict.csrf.tokenName}" value="${pdict.csrf.token}"/>
|
|
188
|
+
|
|
189
|
+
<div class="form-group ${pdict.profileForm.email.mandatory ? 'required' : ''}">
|
|
190
|
+
<label for="email" class="form-control-label">
|
|
191
|
+
${Resource.msg('form.email.label', 'forms', null)}
|
|
192
|
+
</label>
|
|
193
|
+
<input type="email"
|
|
194
|
+
id="email"
|
|
195
|
+
name="email"
|
|
196
|
+
class="form-control ${pdict.profileForm.email.error ? 'is-invalid' : ''}"
|
|
197
|
+
value="${pdict.profileForm.email.value || ''}"
|
|
198
|
+
<isif condition="${pdict.profileForm.email.mandatory}">required</isif>
|
|
199
|
+
maxlength="${pdict.profileForm.email.maxLength || 50}"/>
|
|
200
|
+
<isif condition="${pdict.profileForm.email.error}">
|
|
201
|
+
<div class="invalid-feedback">${pdict.profileForm.email.error}</div>
|
|
202
|
+
</isif>
|
|
203
|
+
</div>
|
|
204
|
+
|
|
205
|
+
<button type="submit" class="btn btn-primary">
|
|
206
|
+
${Resource.msg('button.submit', 'forms', null)}
|
|
207
|
+
</button>
|
|
208
|
+
</form>
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Localization
|
|
212
|
+
|
|
213
|
+
Form labels and errors use resource bundles:
|
|
214
|
+
|
|
215
|
+
**forms.properties:**
|
|
216
|
+
```properties
|
|
217
|
+
form.email.label=Email Address
|
|
218
|
+
form.email.required=Email is required
|
|
219
|
+
form.email.invalid=Please enter a valid email address
|
|
220
|
+
form.password.label=Password
|
|
221
|
+
button.submit=Submit
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**forms_de_DE.properties:**
|
|
225
|
+
```properties
|
|
226
|
+
form.email.label=E-Mail-Adresse
|
|
227
|
+
form.email.required=E-Mail ist erforderlich
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Best Practices
|
|
231
|
+
|
|
232
|
+
1. **Always use CSRF protection** for form submissions
|
|
233
|
+
2. **Clear forms** before displaying to reset state
|
|
234
|
+
3. **Use resource keys** for labels and errors (localization)
|
|
235
|
+
4. **Validate server-side** even with client-side validation
|
|
236
|
+
5. **Use `route:BeforeComplete`** for database operations
|
|
237
|
+
6. **Return JSON** for AJAX form submissions
|
|
238
|
+
|
|
239
|
+
## Detailed Reference
|
|
240
|
+
|
|
241
|
+
For comprehensive form patterns:
|
|
242
|
+
- [Form XML Reference](references/FORM-XML.md) - Complete XML schema, validation patterns, and examples
|